text:
#ifdef WIN32
#include "pch.hpp"
#else
#include <core/pch.hpp>
#endif

#include <core/Library/LocalDB.h>
#include <core/Query/Base.h>
#include <core/Preferences.h>

#include <boost/bind.hpp>

using namespace musik::core;

//////////////////////////////////////////
///\brief
///Constructor.
///
///The constructor will not start the Library.
///
///\see
///Startup
//////////////////////////////////////////
Library::LocalDB::LocalDB(utfstring name,int id)
 :Base(name,id)
{
}

//////////////////////////////////////////
///\brief
///Create a LocalDB library
//////////////////////////////////////////
LibraryPtr Library::LocalDB::Create(utfstring name,int id){
	LibraryPtr lib(new Library::LocalDB(name,id));
	lib->self	= lib;
	return lib;
}

//////////////////////////////////////////
///\brief
///Destructor that exits and joins all threads
//////////////////////////////////////////
Library::LocalDB::~LocalDB(void){
    this->Exit();
    this->threads.join_all();
}

//////////////////////////////////////////
///\brief
///Get a short status string of what is going on in the Library.
///
///\returns
///Information string.
///
///The information is mostly used to get the information
///about the Indexer.
//////////////////////////////////////////
utfstring Library::LocalDB::GetInfo(){
    return this->indexer.GetStatus();
}

//////////////////////////////////////////
///\brief
///Startup the library threads.
///
///\returns
///True if successfully started. This should always be true. Nothing else is expected.
///
///Start up the Library like this:
///\code
/// // Create a library
/// musik::core::Library::LocalDB library;
/// // Start the library (and indexer that is included)
/// library.Startup();
/// // The library is now ready to receive queries
///\endcode
//////////////////////////////////////////
bool Library::LocalDB::Startup(){

    // Start the library thread
    try{
        this->threads.create_thread(boost::bind(&Library::LocalDB::ThreadLoop,this));
    }
    catch(...){
        return false;
    }

    return true;
}

//////////////////////////////////////////
///\brief
///Main loop the library thread is running in.
///
///The loop will run until Exit() has been called.
//////////////////////////////////////////
void Library::LocalDB::ThreadLoop(){

    Preferences prefs("Library");

    utfstring database(this->GetDBPath());
    this->db.Open(database.c_str(),0,prefs.GetInt("DatabaseCache",4096));

    Library::Base::CreateDatabase(this->db);

    // Startup the indexer
    this->indexer.database    = database;
    this->indexer.Startup(this->GetLibraryDirectory());

    while(!this->Exited()){
        Query::Ptr query(this->GetNextQuery());

        if(query){    // No empty query

            ////////////////////////////////////////////////////////////
            // Add to the finished queries
            {
                boost::mutex::scoped_lock lock(this->libraryMutex);
                this->runningQuery    = query;
                this->outgoingQueries.push_back(query);

                // Set query as started
                query->status |= Query::Base::Started;
            }

            ////////////////////////////////////////////////////////////
            // Lets parse the query
            if(!this->QueryCanceled(query.get())){
                query->ParseQuery(this,this->db);
            }

            {
                boost::mutex::scoped_lock lock(this->libraryMutex);
                this->runningQuery.reset();
                // And set it as finished
                query->status |= Query::Base::Ended;
            }

            ////////////////////////////////////////////////////////////
            // Notify that the Query is finished.
            this->waitCondition.notify_all();

        }else{

            ////////////////////////////////////////////////////////////
            // Tricky part, waiting for queries to be added.
            // Not sure I'm doing this the right way.
            // Could this part lead to a deadlock???
            boost::mutex::scoped_lock lock(this->libraryMutex);
            if(!this->exit && this->incomingQueries.size()==0 ){

                // This is a likely place where a thread will wait
                this->waitCondition.wait(lock);

            }
        }
    }

}

//////////////////////////////////////////
///\brief
///Cancel the current running query
///
///This method will also send a sqlite3_interrupt to cancel the
///current running SQL Query
//////////////////////////////////////////
void Library::LocalDB::CancelCurrentQuery( ){
    this->db.Interrupt();
}

//////////////////////////////////////////
///\brief
///Get a pointer to the librarys Indexer (NULL if none)
//////////////////////////////////////////
musik::core::Indexer *Library::LocalDB::Indexer(){
    return &this->indexer;
}


text:
<?php

require_once '../configuration.php';

if ($_SESSION['logged'] != true) {
    header("location:login.php");
}

$user_name = $_SESSION['username'];

$pk = mysql_real_escape_string($_POST['pk']);
$name = mysql_real_escape_string($_POST['name']);
$value = mysql_real_escape_string($_POST['value']);
$staff_id = mysql_real_escape_string($_POST['staff_id']);

if ($pk) {
    $sql = "UPDATE `dghs_hrm_main`.`old_tbl_staff_organization`
            SET
                `sp_id_2` = \"$value\",
                `last_update` = \"" . date("Y-m-d H:i:s") . "\",
                `updated_by` = \"$user_name\"
            WHERE
                `old_tbl_staff_organization`.`staff_id` = $staff_id;";
    $result = mysql_query($sql) or die(mysql_error() . "
Code:post_match_staff_sp:1

Query:
___
$sql
");

//    echo "
$sql

";

    $sql = "UPDATE `dghs_hrm_main`.`total_manpower_imported_sanctioned_post_copy`
            SET
                `staff_id_2` = \"$staff_id\",
                `updated_datetime` = \"" . date("Y-m-d H:i:s") . "\",
                `updated_by` = \"$user_name\"
            WHERE
                `total_manpower_imported_sanctioned_post_copy`.`id` = $value
            AND total_manpower_imported_sanctioned_post_copy.active LIKE 1";
    $result = mysql_query($sql) or die(mysql_error() . "
Code:post_match_staff_sp:1

Query:
___
$sql
");

//    echo "$sql
";

    echo "Successfully Updated.";
} else {
    /*
      In case of incorrect value or error you should return HTTP status != 200.
      Response body will be shown as error message in editable form.
     */

    header('HTTP 400 Bad Request', true, 400);
    echo "This field is required!";
}
?>

redpajama_set_name: RedPajamaGithub


text:
import javax.management.BadAttributeValueExpException

/* Companion objects */
object Enterprise {
  def go = println("Go where no man has gone before" )
}

Enterprise.go

println

class Person(val name: String) {
  def talk(message: String) = println(name + " says " + message)
  def id(): String = name
}
class Employee(override val name: String, val number: String) extends Person(name) {

  override def talk(message: String) {
    println(name + " with number " + number + " says: " + message)
  }

  override def id():String = number.toString

}
val employee = new Employee("Spock" , "S02E24")
employee.talk("Computers make excellent and efficient servants, but I have no wish to serve under them." )

println

/* Traits */

trait Nice {

  def greet() = println("Hello my old friend!")

}
// extend person and add the nice trait
class NicePerson(override val name:String) extends Person(name) with Nice

val niceperson = new NicePerson("Mr. Nice")
niceperson.greet

println

trait Bad{

  def curse() = println("Object oriented languages are cool too!");

}
// multiple traits
class IndecisivePerson(override val name:String) extends Person(name) with Nice with Bad

val indecisiveperson = new IndecisivePerson("Mr. indecisive")
indecisiveperson.greet()
indecisiveperson.curse


text:
#include <QWidget>
#include <QMessageBox>

#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "appconfig.h"
#include "OntogenyWidget.h"

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    //ui->scrollArea->setBackgroundRole(QPalette::Dark);

    //scrollArea already has a blank QWidget onto which we can place custom widgets
    OntogenyWidget * w = new OntogenyWidget(ui->scrollArea->widget());
    w->move(0, 0);
    w->show();
    m_OntoWidgets.push_back(w);

    //ui->scrollArea->widget()->resize(ui->scrollArea->widget()->size().width(),1000);

    if(!AppConfig::instance().load()) {
        ///@todo auto create a new one if the file doesn't exist?
        QString msgtext(tr("There was a problem loading the application configuration: %1").arg(AppConfig::instance().getErrorString()));
        QMessageBox::warning(NULL, tr("MetaDevo App Config"), msgtext);
    }

}

MainWindow::~MainWindow()
{
    for (std::vector<OntogenyWidget *>::iterator it = m_OntoWidgets.begin(); it != m_OntoWidgets.end(); ++it )
    {
        delete *it;
    }
    delete ui;
}

void MainWindow::on_actionAbout_triggered()
{
    QString aboutText("PlasticAI Experimenter 0.1\nCopyright (C) 2013 Samuel H. Kenyon. All rights reserved.\nContact: code@synapticnulship.com");
    QMessageBox::information(this, "About", aboutText);
}


text:
external help file: ACMESharp.POSH.dll-Help.xml
online version:
schema: 2.0.0
---

# Get-ACMECertificate

## SYNOPSIS
Gets the status and details of a Certificate stored in the Vault.

## SYNTAX

### List (Default)
```
Get-ACMECertificate [-VaultProfile <String>] [-PkiTool <String>]
```

### Get
```
Get-ACMECertificate [-CertificateRef] <String> [-ExportKeyPEM <String>] [-ExportCsrPEM <String>]
 [-ExportCertificatePEM <String>] [-ExportCertificateDER <String>] [-ExportIssuerPEM <String>]
 [-ExportIssuerDER <String>] [-ExportPkcs12 <String>] [-CertificatePassword <String>] [-Overwrite]
 [-VaultProfile <String>] [-PkiTool <String>]
```

## DESCRIPTION
This cmdlet retrieves the details of a Certificate defined in the Vault.
It is also used to export various artificates associated with the Certificate to various formats.

## EXAMPLES

### Example 1
```
PS C:\> {{ Add example code here }}
```

{{ Add example description here }}

## PARAMETERS

### -CertificateRef
A reference (ID or alias) to a previously defined Certificate request.

```yaml
Type: String
Parameter Sets: Get
Aliases: Ref

Required: True
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -ExportKeyPEM
Optionally, specifies a file path where the private key associated with the referenced Certificate will be saved in PEM format.

```yaml
Type: String
Parameter Sets: Get
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -ExportCsrPEM
Optionally, specifies a file path where the CSR associated with the referenced Certificate will be saved in PEM format.

```yaml
Type: String
Parameter Sets: Get
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -ExportCertificatePEM
Optionally, specifies a file path where the referenced Certificate will be saved in PEM format.

```yaml
Type: String
Parameter Sets: Get
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -ExportCertificateDER
Optionally, specifies a file path where the referenced Certificate will be saved in DER format.

```yaml
Type: String
Parameter Sets: Get
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -ExportIssuerPEM
Optionally, specifies a file path where the referenced Issuer Certificate will be saved in PEM format.

```yaml
Type: String
Parameter Sets: Get
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -ExportIssuerDER
Optionally, specifies a file path where the referenced Issuer Certificate will be saved in DER format.

```yaml
Type: String
Parameter Sets: Get
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -ExportPkcs12
Optionally, specifies a file path where the referenced Certificate and related artifacts will be saved into a PKCS#12 archive format.

```yaml
Type: String
Parameter Sets: Get
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -CertificatePassword
Optionally, specifies a password to use to secure an exported PKCS#12 archive file.

```yaml
Type: String
Parameter Sets: Get
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Overwrite
This flag indicates that any existing files matching any of the requested export parameter paths will be overwritten.
If not specified, existing files will cause this cmdlet to error.

```yaml
Type: SwitchParameter
Parameter Sets: Get
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```

### -VaultProfile
Specifies a Vault profile name that will resolve to the Vault instance to be used for all related operations and storage/retrieval of all related assets.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -PkiTool
Specifies a PKI tool provider (i.e.
CertificateProvider) to be used in all PKI related operations such as private key generation, CSR generation and certificate importing and exporting.
If left unspecified a default PKI tool provider will be used.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

## INPUTS

## OUTPUTS

### ACMESharp.Vault.Model.CertificateInfo

## NOTES

## RELATED LINKS

[New-Certificate]()

[Submit-Certificate]()

[Update-Certificate]()


text:
namespace pp {

class Instance;
class Plugin;

class ImageData : public Resource {
 public:
  // Creates an is_null() ImageData object.
  ImageData();

  // This magic constructor is used when we've gotten a PP_Resource as a return
  // value that has already been addref'ed for us.
  struct PassRef {};
  ImageData(PassRef, PP_Resource resource);

  ImageData(const ImageData& other);

  // Allocates a new ImageData in the browser with the given parameters. The
  // resulting object will be is_null() if the allocation failed.
  ImageData(Instance* instance,
            PP_ImageDataFormat format,
            const Size& size,
            bool init_to_zero);

  ImageData& operator=(const ImageData& other);

  // Returns the browser's preferred format for images. Using this format
  // guarantees no extra conversions will occur when painting.
  static PP_ImageDataFormat GetNativeImageDataFormat();

  PP_ImageDataFormat format() const { return desc_.format; }

  pp::Size size() const { return desc_.size; }
  int32_t stride() const { return desc_.stride; }

  void* data() const { return data_; }

  // Helper function to retrieve the address of the given pixel for 32-bit
  // pixel formats.
  const uint32_t* GetAddr32(const Point& coord) const;
  uint32_t* GetAddr32(const Point& coord);

 private:
  void PassRefAndInitData(PP_Resource resource);

  PP_ImageDataDesc desc_;
  void* data_;
};

}  // namespace pp

#endif  // PPAPI_CPP_IMAGE_DATA_H_


text:
$scriptDir = Split-Path $MyInvocation.MyCommand.Definition -Parent
#[Reflection.Assembly]::LoadFile("$scriptDir\bin\Newtonsoft.Json.dll")
#[Reflection.Assembly]::LoadFile("$scriptDir\bin\SimpleRESTServices.dll")
#[Reflection.Assembly]::LoadFile("$scriptDir\bin\Rackspace.dll")
#[Reflection.Assembly]::LoadFile("$scriptDir\Bin\openstacknet.dll")
#[Reflection.Assembly]::LoadFile("$scriptDir\bin\Flurl.Http.dll")
#[Reflection.Assembly]::LoadFile("$scriptdir\bin\Flurl.dll")
Add-Type -Path "$scriptDir\bin\Newtonsoft.Json.dll"
Add-Type -Path "$scriptDir\bin\SimpleRESTServices.dll"
Add-Type -Path "$scriptDir\bin\Rackspace.dll"
Add-Type -Path "$scriptDir\bin\openstacknet.dll"
Add-Type -Path "$scriptDir\bin\Flurl.Http.dll"
Add-Type -Path "$scriptDir\bin\Flurl.dll"
Add-Type -Path "$scriptDir\bin\Marvin.JsonPatch.dll"


text:
<TITLE>Review for From Dusk Till Dawn (1996)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

From Dusk Till Dawn (1996)

reviewed by
John Robertson

                              FROM DUSK TILL DAWN
                       A film review by John Robertson
                        Copyright 1996 John Robertson

Directed by: Robert Rodriguez
Screenplay by: Quentin Tarantino
Starring: George Clooney, Quentin Tarantino, Harvey Keitel,
          Juliette Lewis, Cheech Marin

Perfect Person Rating*: The Perfect Person for this film is Joe Bob
Briggs.  Although I haven't heard what Joe Bob thinks of this movie,
my guess would be that he likes it, a lot.  See the review below for
more information.

Joe Bob Briggs is a fictional persona who writes movie reviews and
books.  Though it may surprise some, much of what I learned about
reviewing comes from him.  To Joe Bob, the most important things in a
movie are, roughly, 'What's the body count?', 'How many breasts do you
see?', 'Do heads roll?' and 'Can any person in this movie die at any
moment?'.  Though Joe Bob traditionally rates drive-in movies, I have
a feeling that he would really, really like this movie.

>From Dusk Till Dawn is thought by many to be the next Quentin
Tarantino film, when in fact, it's really the next Paul Rodriguez
film.  Appropriately, expect style over substance, even though there
is a great deal of substance in this film.  One thing that is central
to this film that I would expect from neither Rodriguez nor Tarantino
is the huge plot and tone shift that the film makes approximately two
thirds of the way through.

The film begins in a typically Tarantino way, with clever dialog that
you wish would make up the whole movie.  In this case, it's a Texas
ranger talking with a clerk in a liquor store.  The ranger is so
gritty, and his speech is so interesting, you wish the movie was about
him, but as you might suspect, this ranger is not going to be in the
movie long.  The film is really about Seth and Richie Gecko, played by
George Clooney and Quentin Tarantino, two men hiding in the back of
the liquor store with hostages, waiting for the ranger to leave.  Seth
is tattooed, tough and cool, while Richie is clever, brutal, and a
psychopath.  Thanks to Richie's dementia, the ranger and the clerk
meet sudden, violent, and in one case, very spectacular deaths.  Scene
one ends, the rock music starts, and the opening credits roll.  Up
until this point, the movie is as good as either Tarantino or
Rodriguez have ever done.

Seth and Richie are headed to Mexico with a hostage in their trunk,
after Richie broke Seth out of prison and the two of them held up a
bank.  Along the way, they kidnap the family and motor home of a
preacher, played by Harvey Keitel, who has abandoned his faith.  Using
the RV and the preacher's family as cover, Seth and Richie make it to
Mexico, where they are scheduled to rendezvous with a local crime boss
who will take them in and help them launder their money.  The meeting
is scheduled to happen at a bar called the Titty Twister, and it's
here that things soon get out of hand.

Outside the bar is Cheech Marin, playing a barker of sorts, trying to
attract bikers and truckers to the bar.  Marin actually plays three
roles in this film, but this one is the most memorable, mostly because
his chant uses the word "pussy" more times that anyone would think is
possible.

Inside the bar, which seems like paradise to Seth and Richie and hell
to the preacher, Jacob, and his family; topless women gyrate, bikers
brawl, and the locals menace in a feast for the eyes and ears.  After
some scene building, the main attraction, a dancer who is called the
queen of evil appears and dances for Richie.  Soon, Richie's psychoses
and some extra attention from the locals lead to a deadly fight
between Seth, Richie and the bouncers.  After the fight, Richie is
bleeding profusely from his hand, and this mesmerizes the dancer.  At
this point, the movie takes the aforementioned plot and tone shift
that had my jaw dropping to the floor.

Before describing what happens next, I should say that I have never
seen a movie make a "left turn" like this.  If you can imagine an
Ingmar Bergman film suddenly turning into a Zucker brothers' Naked Gun
movie two thirds through, you can maybe imagine the change in tone.

The dancer, enthralled with the blood dripping from Richie's wound,
can take no more, and morphs into a bat-like vampire, attacking
Richie.  This signals feeding time to the many other vampires in the
room, and soon you have a supernatural barfight of epic proportions
underway.  Camp, kitsch and non-sequiters rule the film suddenly, as
the movie turns into a monster movie extraordinaire.  If you've seen
Evil Dead, or Dead Alive, you're about ready for the type and tempo of
the action that ensues, but if you're not prepared, you'll be shocked.
There are more deaths per minute than a Rambo movie suddenly, and it's
all done with very impressive effects.

The climax of the movie is as violent and over the top as any I've
ever seen, and then slowly winds down to tone that was present before,
literally, all hell broke loose.  Shaking my head, I left the theatre
awed and puzzled by what I'd seen.

This movie isn't for everyone, clearly, and so the "Perfect Person
Rating" is pretty important here.  Obviously, someone who likes their
movies visceral, with lots of violence, nudity, and gore will love
this movie, particularly the latter half.  There is more here though,
both in things to attract people to the movie and in things to warn
about.  The acting of all characters, but particularly Clooney and,
surprisingly, Tarantino, is very impressive.  Only Keitel and Juliette
Lewis seem stiff, and it's easy to understand.  As mentioned before,
the special effects are very good, as is the score and the screenplay,
which is the main strength of the first half of the movie.  The main
reason that someone wouldn't like this movie is the abrupt tone change
when the vampires make their presence known.  Throughout the latter
half of the movie, I kept thinking to myself that this movie was
violating some unwritten rule that a movie should put itself into a
category and stay there.  Some people might appreciate the daring it
took to make a movie like this, but others will probably just be
unpleasantly confused.

---------------------------------------------------------------------
Copyright 1996 by John Robertson.  Retransmit freely if unedited.  My
opinions are solely my own, and in no way reflect those of my
employer.

* Perfect Person Rating: The Perfect Person Rating is an attempt to
give the reader a new way of understanding my rating.  Rather than
give a film a score, either overall, or on several attributes, the
Perfect Person Rating tries to identify the type of person would enjoy
this movie the most.  Since a reviewer is by nature someone with a
great deal of experience in what they are reviewing, their experience
may not be the same as someone who is less informed, less jaded, or
more attuned to the subject.  Hopefully the Perfect Person Rating will
go further toward eliminating reviewer bias than a simple rating
scale.  Comments are appreciated.

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
package de.tudarmstadt.ukp.clarin.webanno.ui.core.menu;

import static java.util.Collections.emptyList;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Optional;

import org.apache.commons.lang3.ClassUtils;
import org.apache.wicket.Page;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.context.event.EventListener;
import org.springframework.core.annotation.AnnotationAwareOrderComparator;
import org.springframework.stereotype.Component;

@Component(MenuItemRegistry.SERVICE_NAME)
public class MenuItemRegistryImpl
    implements MenuItemRegistry
{
    private final Logger log = LoggerFactory.getLogger(getClass());

    private final List<MenuItem> extensionsProxy;

    private List<MenuItem> extensions;

    public MenuItemRegistryImpl(@Lazy @Autowired(required = false) List<MenuItem> aExtensions)
    {
        extensionsProxy = aExtensions;
    }

    @EventListener
    public void onContextRefreshedEvent(ContextRefreshedEvent aEvent)
    {
        init();
    }

    /* package private */ void init()
    {
        List<MenuItem> exts = new ArrayList<>();

        if (extensionsProxy != null) {
            exts.addAll(extensionsProxy);
            AnnotationAwareOrderComparator.sort(exts);

            for (MenuItem fs : exts) {
                log.info("Found menu item: {}", ClassUtils.getAbbreviatedName(fs.getClass(), 20));

                if (fs.getPageClass() == null) {
                    throw new IllegalStateException("Menu item [" + fs.getClass().getName()
                            + "] does not declare a page class.");
                }
            }
        }

        extensions = Collections.unmodifiableList(exts);
    }

    @Override
    public Optional<MenuItem> getMenuItem(Class<? extends Page> aClass)
    {
        if (extensions == null) {
            return Optional.empty();
        }

        return extensions.stream().filter(mi -> mi.getPageClass().equals(aClass)).findFirst();
    }

    @Override
    public List<MenuItem> getMenuItems()
    {
        if (extensions == null) {
            return emptyList();
        }

        return extensions;
    }
}


text:
//#define LOG_NDEBUG 0
#define LOG_TAG "MediaProfilesJNI"
#include <utils/Log.h>

#include <stdio.h>
#include <utils/threads.h>

#include "jni.h"
#include "JNIHelp.h"
#include "android_runtime/AndroidRuntime.h"
#include <media/MediaProfiles.h>

using namespace android;

static Mutex sLock;
MediaProfiles *sProfiles = NULL;

// This function is called from a static block in MediaProfiles.java class,
// which won't run until the first time an instance of this class is used.
static void
android_media_MediaProfiles_native_init(JNIEnv* /* env */)
{
    ALOGV("native_init");
    Mutex::Autolock lock(sLock);

    if (sProfiles == NULL) {
        sProfiles = MediaProfiles::getInstance();
    }
}

static jint
android_media_MediaProfiles_native_get_num_file_formats(JNIEnv* /* env */, jobject /* thiz */)
{
    ALOGV("native_get_num_file_formats");
    return (jint) sProfiles->getOutputFileFormats().size();
}

static jint
android_media_MediaProfiles_native_get_file_format(JNIEnv *env, jobject /* thiz */, jint index)
{
    ALOGV("native_get_file_format: %d", index);
    Vector<output_format> formats = sProfiles->getOutputFileFormats();
    int nSize = formats.size();
    if (index < 0 || index >= nSize) {
        jniThrowException(env, "java/lang/IllegalArgumentException", "out of array boundary");
        return -1;
    }
    return static_cast<jint>(formats[index]);
}

static jint
android_media_MediaProfiles_native_get_num_video_encoders(JNIEnv* /* env */, jobject /* thiz */)
{
    ALOGV("native_get_num_video_encoders");
    return sProfiles->getVideoEncoders().size();
}

static jobject
android_media_MediaProfiles_native_get_video_encoder_cap(JNIEnv *env, jobject /* thiz */,
                                                         jint index)
{
    ALOGV("native_get_video_encoder_cap: %d", index);
    Vector<video_encoder> encoders = sProfiles->getVideoEncoders();
    int nSize = encoders.size();
    if (index < 0 || index >= nSize) {
        jniThrowException(env, "java/lang/IllegalArgumentException", "out of array boundary");
        return NULL;
    }

    video_encoder encoder = encoders[index];
    int minBitRate = sProfiles->getVideoEncoderParamByName("enc.vid.bps.min", encoder);
    int maxBitRate = sProfiles->getVideoEncoderParamByName("enc.vid.bps.max", encoder);
    int minFrameRate = sProfiles->getVideoEncoderParamByName("enc.vid.fps.min", encoder);
    int maxFrameRate = sProfiles->getVideoEncoderParamByName("enc.vid.fps.max", encoder);
    int minFrameWidth = sProfiles->getVideoEncoderParamByName("enc.vid.width.min", encoder);
    int maxFrameWidth = sProfiles->getVideoEncoderParamByName("enc.vid.width.max", encoder);
    int minFrameHeight = sProfiles->getVideoEncoderParamByName("enc.vid.height.min", encoder);
    int maxFrameHeight = sProfiles->getVideoEncoderParamByName("enc.vid.height.max", encoder);

    // Check on the values retrieved
    if ((minBitRate == -1 || maxBitRate == -1) ||
        (minFrameRate == -1 || maxFrameRate == -1) ||
        (minFrameWidth == -1 || maxFrameWidth == -1) ||
        (minFrameHeight == -1 || maxFrameHeight == -1)) {

        jniThrowException(env, "java/lang/RuntimeException", "Error retrieving video encoder capability params");
        return NULL;
    }

    // Construct an instance of the VideoEncoderCap and set its member variables
    jclass videoEncoderCapClazz = env->FindClass("android/media/EncoderCapabilities$VideoEncoderCap");
    jmethodID videoEncoderCapConstructorMethodID = env->GetMethodID(videoEncoderCapClazz, "<init>", "(IIIIIIIII)V");
    jobject cap = env->NewObject(videoEncoderCapClazz,
                                 videoEncoderCapConstructorMethodID,
                                 static_cast<int>(encoder),
                                 minBitRate, maxBitRate,
                                 minFrameRate, maxFrameRate,
                                 minFrameWidth, maxFrameWidth,
                                 minFrameHeight, maxFrameHeight);
    return cap;
}

static jint
android_media_MediaProfiles_native_get_num_audio_encoders(JNIEnv* /* env */, jobject /* thiz */)
{
    ALOGV("native_get_num_audio_encoders");
    return (jint) sProfiles->getAudioEncoders().size();
}

static jobject
android_media_MediaProfiles_native_get_audio_encoder_cap(JNIEnv *env, jobject /* thiz */,
                                                         jint index)
{
    ALOGV("native_get_audio_encoder_cap: %d", index);
    Vector<audio_encoder> encoders = sProfiles->getAudioEncoders();
    int nSize = encoders.size();
    if (index < 0 || index >= nSize) {
        jniThrowException(env, "java/lang/IllegalArgumentException", "out of array boundary");
        return NULL;
    }

    audio_encoder encoder = encoders[index];
    int minBitRate = sProfiles->getAudioEncoderParamByName("enc.aud.bps.min", encoder);
    int maxBitRate = sProfiles->getAudioEncoderParamByName("enc.aud.bps.max", encoder);
    int minSampleRate = sProfiles->getAudioEncoderParamByName("enc.aud.hz.min", encoder);
    int maxSampleRate = sProfiles->getAudioEncoderParamByName("enc.aud.hz.max", encoder);
    int minChannels = sProfiles->getAudioEncoderParamByName("enc.aud.ch.min", encoder);
    int maxChannels = sProfiles->getAudioEncoderParamByName("enc.aud.ch.max", encoder);

    // Check on the values retrieved
    if ((minBitRate == -1 || maxBitRate == -1) ||
        (minSampleRate == -1 || maxSampleRate == -1) ||
        (minChannels == -1 || maxChannels == -1)) {

        jniThrowException(env, "java/lang/RuntimeException", "Error retrieving video encoder capability params");
        return NULL;
    }

    jclass audioEncoderCapClazz = env->FindClass("android/media/EncoderCapabilities$AudioEncoderCap");
    jmethodID audioEncoderCapConstructorMethodID = env->GetMethodID(audioEncoderCapClazz, "<init>", "(IIIIIII)V");
    jobject cap = env->NewObject(audioEncoderCapClazz,
                                 audioEncoderCapConstructorMethodID,
                                 static_cast<int>(encoder),
                                 minBitRate, maxBitRate,
                                 minSampleRate, maxSampleRate,
                                 minChannels, maxChannels);
    return cap;
}

static bool isCamcorderQualityKnown(int quality)
{
    return ((quality >= CAMCORDER_QUALITY_LIST_START &&
             quality <= CAMCORDER_QUALITY_LIST_END) ||
            (quality >= CAMCORDER_QUALITY_TIME_LAPSE_LIST_START &&
             quality <= CAMCORDER_QUALITY_TIME_LAPSE_LIST_END) ||
             (quality >= CAMCORDER_QUALITY_HIGH_SPEED_LIST_START &&
              quality <= CAMCORDER_QUALITY_HIGH_SPEED_LIST_END));
}

static jobject
android_media_MediaProfiles_native_get_camcorder_profile(JNIEnv *env, jobject /* thiz */, jint id,
                                                         jint quality)
{
    ALOGV("native_get_camcorder_profile: %d %d", id, quality);
    if (!isCamcorderQualityKnown(quality)) {
        jniThrowException(env, "java/lang/RuntimeException", "Unknown camcorder profile quality");
        return NULL;
    }

    camcorder_quality q = static_cast<camcorder_quality>(quality);
    int duration         = sProfiles->getCamcorderProfileParamByName("duration",    id, q);
    int fileFormat       = sProfiles->getCamcorderProfileParamByName("file.format", id, q);
    int videoCodec       = sProfiles->getCamcorderProfileParamByName("vid.codec",   id, q);
    int videoBitRate     = sProfiles->getCamcorderProfileParamByName("vid.bps",     id, q);
    int videoFrameRate   = sProfiles->getCamcorderProfileParamByName("vid.fps",     id, q);
    int videoFrameWidth  = sProfiles->getCamcorderProfileParamByName("vid.width",   id, q);
    int videoFrameHeight = sProfiles->getCamcorderProfileParamByName("vid.height",  id, q);
    int audioCodec       = sProfiles->getCamcorderProfileParamByName("aud.codec",   id, q);
    int audioBitRate     = sProfiles->getCamcorderProfileParamByName("aud.bps",     id, q);
    int audioSampleRate  = sProfiles->getCamcorderProfileParamByName("aud.hz",      id, q);
    int audioChannels    = sProfiles->getCamcorderProfileParamByName("aud.ch",      id, q);

    // Check on the values retrieved
    if (duration == -1 || fileFormat == -1 || videoCodec == -1 || audioCodec == -1 ||
        videoBitRate == -1 || videoFrameRate == -1 || videoFrameWidth == -1 || videoFrameHeight == -1 ||
        audioBitRate == -1 || audioSampleRate == -1 || audioChannels == -1) {

        jniThrowException(env, "java/lang/RuntimeException", "Error retrieving camcorder profile params");
        return NULL;
    }

    jclass camcorderProfileClazz = env->FindClass("android/media/CamcorderProfile");
    jmethodID camcorderProfileConstructorMethodID = env->GetMethodID(camcorderProfileClazz, "<init>", "(IIIIIIIIIIII)V");
    return env->NewObject(camcorderProfileClazz,
                          camcorderProfileConstructorMethodID,
                          duration,
                          quality,
                          fileFormat,
                          videoCodec,
                          videoBitRate,
                          videoFrameRate,
                          videoFrameWidth,
                          videoFrameHeight,
                          audioCodec,
                          audioBitRate,
                          audioSampleRate,
                          audioChannels);
}

static jboolean
android_media_MediaProfiles_native_has_camcorder_profile(JNIEnv* /* env */, jobject /* thiz */,
                                                         jint id, jint quality)
{
    ALOGV("native_has_camcorder_profile: %d %d", id, quality);
    if (!isCamcorderQualityKnown(quality)) {
        return JNI_FALSE;
    }

    camcorder_quality q = static_cast<camcorder_quality>(quality);
    return sProfiles->hasCamcorderProfile(id, q) ? JNI_TRUE : JNI_FALSE;
}

static jint
android_media_MediaProfiles_native_get_num_video_decoders(JNIEnv* /* env */, jobject /* thiz */)
{
    ALOGV("native_get_num_video_decoders");
    return (jint) sProfiles->getVideoDecoders().size();
}

static jint
android_media_MediaProfiles_native_get_video_decoder_type(JNIEnv *env, jobject /* thiz */,
                                                          jint index)
{
    ALOGV("native_get_video_decoder_type: %d", index);
    Vector<video_decoder> decoders = sProfiles->getVideoDecoders();
    int nSize = decoders.size();
    if (index < 0 || index >= nSize) {
        jniThrowException(env, "java/lang/IllegalArgumentException", "out of array boundary");
        return -1;
    }

    return static_cast<jint>(decoders[index]);
}

static jint
android_media_MediaProfiles_native_get_num_audio_decoders(JNIEnv* /* env */, jobject /* thiz */)
{
    ALOGV("native_get_num_audio_decoders");
    return (jint) sProfiles->getAudioDecoders().size();
}

static jint
android_media_MediaProfiles_native_get_audio_decoder_type(JNIEnv *env, jobject /* thiz */,
                                                          jint index)
{
    ALOGV("native_get_audio_decoder_type: %d", index);
    Vector<audio_decoder> decoders = sProfiles->getAudioDecoders();
    int nSize = decoders.size();
    if (index < 0 || index >= nSize) {
        jniThrowException(env, "java/lang/IllegalArgumentException", "out of array boundary");
        return -1;
    }

    return static_cast<jint>(decoders[index]);
}

static jint
android_media_MediaProfiles_native_get_num_image_encoding_quality_levels(JNIEnv* /* env */,
                                                                         jobject /* thiz */,
                                                                         jint cameraId)
{
    ALOGV("native_get_num_image_encoding_quality_levels");
    return (jint) sProfiles->getImageEncodingQualityLevels(cameraId).size();
}

static jint
android_media_MediaProfiles_native_get_image_encoding_quality_level(JNIEnv *env, jobject /* thiz */,
                                                                    jint cameraId, jint index)
{
    ALOGV("native_get_image_encoding_quality_level");
    Vector<int> levels = sProfiles->getImageEncodingQualityLevels(cameraId);
    if (index < 0 || index >= (jint) levels.size()) {
        jniThrowException(env, "java/lang/IllegalArgumentException", "out of array boundary");
        return -1;
    }
    return static_cast<jint>(levels[index]);
}
static JNINativeMethod gMethodsForEncoderCapabilitiesClass[] = {
    {"native_init",                            "()V",                    (void *)android_media_MediaProfiles_native_init},
    {"native_get_num_file_formats",            "()I",                    (void *)android_media_MediaProfiles_native_get_num_file_formats},
    {"native_get_file_format",                 "(I)I",                   (void *)android_media_MediaProfiles_native_get_file_format},
    {"native_get_num_video_encoders",          "()I",                    (void *)android_media_MediaProfiles_native_get_num_video_encoders},
    {"native_get_num_audio_encoders",          "()I",                    (void *)android_media_MediaProfiles_native_get_num_audio_encoders},

    {"native_get_video_encoder_cap",           "(I)Landroid/media/EncoderCapabilities$VideoEncoderCap;",
                                                                         (void *)android_media_MediaProfiles_native_get_video_encoder_cap},

    {"native_get_audio_encoder_cap",           "(I)Landroid/media/EncoderCapabilities$AudioEncoderCap;",
                                                                         (void *)android_media_MediaProfiles_native_get_audio_encoder_cap},
};

static JNINativeMethod gMethodsForCamcorderProfileClass[] = {
    {"native_init",                            "()V",                    (void *)android_media_MediaProfiles_native_init},
    {"native_get_camcorder_profile",           "(II)Landroid/media/CamcorderProfile;",
                                                                         (void *)android_media_MediaProfiles_native_get_camcorder_profile},
    {"native_has_camcorder_profile",           "(II)Z",
                                                                         (void *)android_media_MediaProfiles_native_has_camcorder_profile},
};

static JNINativeMethod gMethodsForDecoderCapabilitiesClass[] = {
    {"native_init",                            "()V",                    (void *)android_media_MediaProfiles_native_init},
    {"native_get_num_video_decoders",          "()I",                    (void *)android_media_MediaProfiles_native_get_num_video_decoders},
    {"native_get_num_audio_decoders",          "()I",                    (void *)android_media_MediaProfiles_native_get_num_audio_decoders},
    {"native_get_video_decoder_type",          "(I)I",                   (void *)android_media_MediaProfiles_native_get_video_decoder_type},
    {"native_get_audio_decoder_type",          "(I)I",                   (void *)android_media_MediaProfiles_native_get_audio_decoder_type},
};

static JNINativeMethod gMethodsForCameraProfileClass[] = {
    {"native_init",                            "()V",                    (void *)android_media_MediaProfiles_native_init},
    {"native_get_num_image_encoding_quality_levels",
                                               "(I)I",                   (void *)android_media_MediaProfiles_native_get_num_image_encoding_quality_levels},
    {"native_get_image_encoding_quality_level","(II)I",                   (void *)android_media_MediaProfiles_native_get_image_encoding_quality_level},
};

static const char* const kEncoderCapabilitiesClassPathName = "android/media/EncoderCapabilities";
static const char* const kDecoderCapabilitiesClassPathName = "android/media/DecoderCapabilities";
static const char* const kCamcorderProfileClassPathName = "android/media/CamcorderProfile";
static const char* const kCameraProfileClassPathName = "android/media/CameraProfile";

// This function only registers the native methods, and is called from
// JNI_OnLoad in android_media_MediaPlayer.cpp
int register_android_media_MediaProfiles(JNIEnv *env)
{
    int ret1 = AndroidRuntime::registerNativeMethods(env,
               kEncoderCapabilitiesClassPathName,
               gMethodsForEncoderCapabilitiesClass,
               NELEM(gMethodsForEncoderCapabilitiesClass));

    int ret2 = AndroidRuntime::registerNativeMethods(env,
               kCamcorderProfileClassPathName,
               gMethodsForCamcorderProfileClass,
               NELEM(gMethodsForCamcorderProfileClass));

    int ret3 = AndroidRuntime::registerNativeMethods(env,
               kDecoderCapabilitiesClassPathName,
               gMethodsForDecoderCapabilitiesClass,
               NELEM(gMethodsForDecoderCapabilitiesClass));

    int ret4 = AndroidRuntime::registerNativeMethods(env,
               kCameraProfileClassPathName,
               gMethodsForCameraProfileClass,
               NELEM(gMethodsForCameraProfileClass));

    // Success if all return values from above are 0
    return (ret1 || ret2 || ret3 || ret4);
}


text:
<?php

global $wlPlaces;
$options = $wlPlaces->getOptions();
?>

		<img src="<?php echo WP_PLUGIN_URL; ?>/welocally-places/resources/images/btn_spacer.png">

		<img src="<?php echo WP_PLUGIN_URL; ?>/welocally-places/resources/images/btn_spacer.png">

		<img src="<?php echo WP_PLUGIN_URL; ?>/welocally-places/resources/images/btn_spacer.png">

		<img src="<?php echo WP_PLUGIN_URL; ?>/welocally-places/resources/images/quick-help.png">

<?php
$reqsMissing = $wlPlaces->databaseRequirementsMissing();
if (count($reqsMissing)>0) {
	$showReqsMissing = print_r($reqsMissing,true);
	echo ('

Reactivation is required to properly support required database changes for version '.WelocallyPlaces::VERSION.'. Please deactivate and re-activate now. '.$showReqsMissing.'

');
}
?>


text:
//////////////////////////////////////////////////////////////////////////
//                                                                      //
// This is a generated file. You can view the original                  //
// source in your browser if your browser supports source maps.         //
//                                                                      //
// If you are using Chrome, open the Developer Tools and click the gear //
// icon in its lower right corner. In the General Settings panel, turn  //
// on 'Enable source maps'.                                             //
//                                                                      //
// If you are using Firefox 23, go to `about:config` and set the        //
// `devtools.debugger.source-maps-enabled` preference to true.          //
// (The preference should be on by default in Firefox 24; versions      //
// older than 23 do not support source maps.)                           //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

(function () {

/* Imports */
var Meteor = Package.meteor.Meteor;
var Reload = Package.reload.Reload;
var Base64 = Package.base64.Base64;
var URL = Package.url.URL;

/* Package-scope variables */
var OAuth, Oauth;

(function () {

//////////////////////////////////////////////////////////////////////////////////////////
//                                                                                //
// packages/oauth/oauth_client.js                                                       //
//                                                                                //
//////////////////////////////////////////////////////////////////////////////////////////
                                                                                //
// credentialToken -> credentialSecret. You must provide both the                       // 1
// credentialToken and the credentialSecret to retrieve an access token from            // 2
// the _pendingCredentials collection.                                                  // 3
var credentialSecrets = {};                                                             // 4
                                                                                // 5
OAuth = {};                                                                             // 6
                                                                                // 7
OAuth.showPopup = function (url, callback, dimensions) {                                // 8
  throw new Error("OAuth.showPopup must be implemented on this arch.");                 // 9
};                                                                                // 10
                                                                                // 11
// Determine the login style (popup or redirect) for this login flow.                   // 12
//                                                                                // 13
//                                                                                // 14
OAuth._loginStyle = function (service, config, options) {                               // 15
                                                                                // 16
  if (Meteor.isCordova) {                                                               // 17
    return "popup";                                                                     // 18
  }                                                                                // 19
                                                                                // 20
  var loginStyle = (options && options.loginStyle) || config.loginStyle || 'popup';     // 21
                                                                                // 22
  if (! _.contains(["popup", "redirect"], loginStyle))                                  // 23
    throw new Error("Invalid login style: " + loginStyle);                              // 24
                                                                                // 25
  // If we don't have session storage (for example, Safari in private                   // 26
  // mode), the redirect login flow won't work, so fallback to the                      // 27
  // popup style.                                                                       // 28
  if (loginStyle === 'redirect') {                                                      // 29
    try {                                                                               // 30
      sessionStorage.setItem('Meteor.oauth.test', 'test');                              // 31
      sessionStorage.removeItem('Meteor.oauth.test');                                   // 32
    } catch (e) {                                                                       // 33
      loginStyle = 'popup';                                                             // 34
    }                                                                                // 35
  }                                                                                // 36
                                                                                // 37
  return loginStyle;                                                                    // 38
};                                                                                // 39
                                                                                // 40
OAuth._stateParam = function (loginStyle, credentialToken) {                            // 41
  var state = {                                                                         // 42
    loginStyle: loginStyle,                                                             // 43
    credentialToken: credentialToken,                                                   // 44
    isCordova: Meteor.isCordova                                                         // 45
  };                                                                                // 46
                                                                                // 47
  if (loginStyle === 'redirect')                                                        // 48
    state.redirectUrl = '' + window.location;                                           // 49
                                                                                // 50
  // Encode base64 as not all login services URI-encode the state                       // 51
  // parameter when they pass it back to us.                                            // 52
  // Use the 'base64' package here because 'btoa' isn't supported in IE8/9.             // 53
  return Base64.encode(JSON.stringify(state));                                          // 54
};                                                                                // 55
                                                                                // 56
                                                                                // 57
// At the beginning of the redirect login flow, before we redirect to                   // 58
// the login service, save the credential token for this login attempt                  // 59
// in the reload migration data.                                                        // 60
//                                                                                // 61
OAuth.saveDataForRedirect = function (loginService, credentialToken) {                  // 62
  Reload._onMigrate('oauth', function () {                                              // 63
    return [true, {loginService: loginService, credentialToken: credentialToken}];      // 64
  });                                                                                // 65
  Reload._migrate(null, {immediateMigration: true});                                    // 66
};                                                                                // 67
                                                                                // 68
// At the end of the redirect login flow, when we've redirected back                    // 69
// to the application, retrieve the credentialToken and (if the login                   // 70
// was successful) the credentialSecret.                                                // 71
//                                                                                // 72
// Called at application startup.  Returns null if this is normal                       // 73
// application startup and we weren't just redirected at the end of                     // 74
// the login flow.                                                                      // 75
//                                                                                // 76
OAuth.getDataAfterRedirect = function () {                                              // 77
  var migrationData = Reload._migrationData('oauth');                                   // 78
                                                                                // 79
  if (! (migrationData && migrationData.credentialToken))                               // 80
    return null;                                                                        // 81
                                                                                // 82
  var credentialToken = migrationData.credentialToken;                                  // 83
  var key = OAuth._storageTokenPrefix + credentialToken;                                // 84
  var credentialSecret;                                                                 // 85
  try {                                                                                // 86
    credentialSecret = sessionStorage.getItem(key);                                     // 87
    sessionStorage.removeItem(key);                                                     // 88
  } catch (e) {                                                                         // 89
    Meteor._debug('error retrieving credentialSecret', e);                              // 90
  }                                                                                // 91
  return {                                                                              // 92
    loginService: migrationData.loginService,                                           // 93
    credentialToken: credentialToken,                                                   // 94
    credentialSecret: credentialSecret                                                  // 95
  };                                                                                // 96
};                                                                                // 97
                                                                                // 98
// Launch an OAuth login flow.  For the popup login style, show the                     // 99
// popup.  For the redirect login style, save the credential token for                  // 100
// this login attempt in the reload migration data, and redirect to                     // 101
// the service for the login.                                                           // 102
//                                                                                // 103
// options:                                                                             // 104
//  loginService: "facebook", "google", etc.                                            // 105
//  loginStyle: "popup" or "redirect"                                                   // 106
//  loginUrl: The URL at the login service provider to start the OAuth flow.            // 107
//  credentialRequestCompleteCallback: for the popup flow, call when the popup          // 108
//    is closed and we have the credential from the login service.                      // 109
//  credentialToken: our identifier for this login flow.                                // 110
//                                                                                // 111
OAuth.launchLogin = function (options) {                                                // 112
  if (! options.loginService)                                                           // 113
    throw new Error('loginService required');                                           // 114
  if (options.loginStyle === 'popup') {                                                 // 115
    OAuth.showPopup(                                                                    // 116
      options.loginUrl,                                                                 // 117
      _.bind(options.credentialRequestCompleteCallback, null, options.credentialToken), // 118
      options.popupOptions);                                                            // 119
  } else if (options.loginStyle === 'redirect') {                                       // 120
    OAuth.saveDataForRedirect(options.loginService, options.credentialToken);           // 121
    window.location = options.loginUrl;                                                 // 122
  } else {                                                                              // 123
    throw new Error('invalid login style');                                             // 124
  }                                                                                // 125
};                                                                                // 126
                                                                                // 127
// XXX COMPAT WITH 0.7.0.1                                                              // 128
// Private interface but probably used by many oauth clients in atmosphere.             // 129
OAuth.initiateLogin = function (credentialToken, url, callback, dimensions) {           // 130
  OAuth.showPopup(                                                                      // 131
    url,                                                                                // 132
    _.bind(callback, null, credentialToken),                                            // 133
    dimensions                                                                          // 134
  );                                                                                // 135
};                                                                                // 136
                                                                                // 137
// Called by the popup when the OAuth flow is completed, right before                   // 138
// the popup closes.                                                                    // 139
OAuth._handleCredentialSecret = function (credentialToken, secret) {                    // 140
  check(credentialToken, String);                                                       // 141
  check(secret, String);                                                                // 142
  if (! _.has(credentialSecrets,credentialToken)) {                                     // 143
    credentialSecrets[credentialToken] = secret;                                        // 144
  } else {                                                                              // 145
    throw new Error("Duplicate credential token from OAuth login");                     // 146
  }                                                                                // 147
};                                                                                // 148
                                                                                // 149
// Used by accounts-oauth, which needs both a credentialToken and the                   // 150
// corresponding to credential secret to call the `login` method over DDP.              // 151
OAuth._retrieveCredentialSecret = function (credentialToken) {                          // 152
  // First check the secrets collected by OAuth._handleCredentialSecret,                // 153
  // then check localStorage. This matches what we do in                                // 154
  // end_of_login_response.html.                                                        // 155
  var secret = credentialSecrets[credentialToken];                                      // 156
  if (! secret) {                                                                       // 157
    var localStorageKey = OAuth._storageTokenPrefix + credentialToken;                  // 158
    secret = Meteor._localStorage.getItem(localStorageKey);                             // 159
    Meteor._localStorage.removeItem(localStorageKey);                                   // 160
  } else {                                                                              // 161
    delete credentialSecrets[credentialToken];                                          // 162
  }                                                                                // 163
  return secret;                                                                        // 164
};                                                                                // 165
                                                                                // 166
//////////////////////////////////////////////////////////////////////////////////////////

}).call(this);

(function () {

//////////////////////////////////////////////////////////////////////////////////////////
//                                                                                //
// packages/oauth/oauth_browser.js                                                      //
//                                                                                //
//////////////////////////////////////////////////////////////////////////////////////////
                                                                                //
// Browser specific code for the OAuth package.                                         // 1
                                                                                // 2
// Open a popup window, centered on the screen, and call a callback when it             // 3
// closes.                                                                              // 4
//                                                                                // 5
// @param url {String} url to show                                                      // 6
// @param callback {Function} Callback function to call on completion. Takes no         // 7
//   arguments.                                                                         // 8
// @param dimensions {optional Object(width, height)} The dimensions of                 // 9
//   the popup. If not passed defaults to something sane.                               // 10
OAuth.showPopup = function (url, callback, dimensions) {                                // 11
  // default dimensions that worked well for facebook and google                        // 12
  var popup = openCenteredPopup(                                                        // 13
    url,                                                                                // 14
    (dimensions && dimensions.width) || 650,                                            // 15
    (dimensions && dimensions.height) || 331                                            // 16
  );                                                                                // 17
                                                                                // 18
  var checkPopupOpen = setInterval(function() {                                         // 19
    try {                                                                               // 20
      // Fix for #328 - added a second test criteria (popup.closed === undefined)       // 21
      // to humour this Android quirk:                                                  // 22
      // http://code.google.com/p/android/issues/detail?id=21061                        // 23
      var popupClosed = popup.closed || popup.closed === undefined;                     // 24
    } catch (e) {                                                                       // 25
      // For some unknown reason, IE9 (and others?) sometimes (when                     // 26
      // the popup closes too quickly?) throws "SCRIPT16386: No such                    // 27
      // interface supported" when trying to read 'popup.closed'. Try                   // 28
      // again in 100ms.                                                                // 29
      return;                                                                           // 30
    }                                                                                // 31
                                                                                // 32
    if (popupClosed) {                                                                  // 33
      clearInterval(checkPopupOpen);                                                    // 34
      callback();                                                                       // 35
    }                                                                                // 36
  }, 100);                                                                              // 37
};                                                                                // 38
                                                                                // 39
var openCenteredPopup = function(url, width, height) {                                  // 40
  var screenX = typeof window.screenX !== 'undefined'                                   // 41
        ? window.screenX : window.screenLeft;                                           // 42
  var screenY = typeof window.screenY !== 'undefined'                                   // 43
        ? window.screenY : window.screenTop;                                            // 44
  var outerWidth = typeof window.outerWidth !== 'undefined'                             // 45
        ? window.outerWidth : document.body.clientWidth;                                // 46
  var outerHeight = typeof window.outerHeight !== 'undefined'                           // 47
        ? window.outerHeight : (document.body.clientHeight - 22);                       // 48
  // XXX what is the 22?                                                                // 49
                                                                                // 50
  // Use `outerWidth - width` and `outerHeight - height` for help in                    // 51
  // positioning the popup centered relative to the current window                      // 52
  var left = screenX + (outerWidth - width) / 2;                                        // 53
  var top = screenY + (outerHeight - height) / 2;                                       // 54
  var features = ('width=' + width + ',height=' + height +                              // 55
                  ',left=' + left + ',top=' + top + ',scrollbars=yes');                 // 56
                                                                                // 57
  var newwindow = window.open(url, 'Login', features);                                  // 58
  if (newwindow.focus)                                                                  // 59
    newwindow.focus();                                                                  // 60
  return newwindow;                                                                     // 61
};                                                                                // 62
//////////////////////////////////////////////////////////////////////////////////////////

}).call(this);

(function () {

//////////////////////////////////////////////////////////////////////////////////////////
//                                                                                //
// packages/oauth/oauth_common.js                                                       //
//                                                                                //
//////////////////////////////////////////////////////////////////////////////////////////
                                                                                //
OAuth._storageTokenPrefix = "Meteor.oauth.credentialSecret-";                           // 1
                                                                                // 2
OAuth._redirectUri = function (serviceName, config, params, absoluteUrlOptions) {       // 3
  // XXX COMPAT WITH 0.9.0                                                              // 4
  // The redirect URI used to have a "?close" query argument.  We                       // 5
  // detect whether we need to be backwards compatible by checking for                  // 6
  // the absence of the `loginStyle` field, which wasn't used in the                    // 7
  // code which had the "?close" argument.                                              // 8
  // This logic is duplicated in the tool so that the tool can do OAuth                 // 9
  // flow with <= 0.9.0 servers (tools/auth.js).                                        // 10
  var query = config.loginStyle ? null : "close";                                       // 11
                                                                                // 12
  // Clone because we're going to mutate 'params'. The 'cordova' and                    // 13
  // 'android' parameters are only used for picking the host of the                     // 14
  // redirect URL, and not actually included in the redirect URL itself.                // 15
  var isCordova = false;                                                                // 16
  var isAndroid = false;                                                                // 17
  if (params) {                                                                         // 18
    params = _.clone(params);                                                           // 19
    isCordova = params.cordova;                                                         // 20
    isAndroid = params.android;                                                         // 21
    delete params.cordova;                                                              // 22
    delete params.android;                                                              // 23
    if (_.isEmpty(params)) {                                                            // 24
      params = undefined;                                                               // 25
    }                                                                                // 26
  }                                                                                // 27
                                                                                // 28
  if (Meteor.isServer && isCordova) {                                                   // 29
    var rootUrl = process.env.MOBILE_ROOT_URL ||                                        // 30
          __meteor_runtime_config__.ROOT_URL;                                           // 31
                                                                                // 32
    if (isAndroid) {                                                                    // 33
      // Match the replace that we do in cordova boilerplate                            // 34
      // (boilerplate-generator package).                                               // 35
      // XXX Maybe we should put this in a separate package or something                // 36
      // that is used here and by boilerplate-generator? Or maybe                       // 37
      // `Meteor.absoluteUrl` should know how to do this?                               // 38
      var url = Npm.require("url");                                                     // 39
      var parsedRootUrl = url.parse(rootUrl);                                           // 40
      if (parsedRootUrl.hostname === "localhost") {                                     // 41
        parsedRootUrl.hostname = "10.0.2.2";                                            // 42
        delete parsedRootUrl.host;                                                      // 43
      }                                                                                // 44
      rootUrl = url.format(parsedRootUrl);                                              // 45
    }                                                                                // 46
                                                                                // 47
    absoluteUrlOptions = _.extend({}, absoluteUrlOptions, {                             // 48
      // For Cordova clients, redirect to the special Cordova root url                  // 49
      // (likely a local IP in development mode).                                       // 50
      rootUrl: rootUrl                                                                  // 51
    });                                                                                // 52
  }                                                                                // 53
                                                                                // 54
  return URL._constructUrl(                                                             // 55
    Meteor.absoluteUrl('_oauth/' + serviceName, absoluteUrlOptions),                    // 56
    query,                                                                              // 57
    params);                                                                            // 58
};                                                                                // 59
                                                                                // 60
//////////////////////////////////////////////////////////////////////////////////////////

}).call(this);

(function () {

//////////////////////////////////////////////////////////////////////////////////////////
//                                                                                //
// packages/oauth/deprecated.js                                                         //
//                                                                                //
//////////////////////////////////////////////////////////////////////////////////////////
                                                                                //
// XXX COMPAT WITH 0.8.0                                                                // 1
                                                                                // 2
Oauth = OAuth;                                                                          // 3
                                                                                // 4
//////////////////////////////////////////////////////////////////////////////////////////

}).call(this);

/* Exports */
if (typeof Package === 'undefined') Package = {};
Package.oauth = {
  OAuth: OAuth,
  Oauth: Oauth
};

})();


text:
package org.opencv.photo;

// C++: class TonemapDrago
//javadoc: TonemapDrago
public class TonemapDrago extends Tonemap {

    protected TonemapDrago(long addr) { super(addr); }

    //
    // C++:  float getSaturation()
    //

    //javadoc: TonemapDrago::getSaturation()
    public  float getSaturation()
    {

        float retVal = getSaturation_0(nativeObj);

        return retVal;
    }

    //
    // C++:  void setSaturation(float saturation)
    //

    //javadoc: TonemapDrago::setSaturation(saturation)
    public  void setSaturation(float saturation)
    {

        setSaturation_0(nativeObj, saturation);

        return;
    }

    //
    // C++:  float getBias()
    //

    //javadoc: TonemapDrago::getBias()
    public  float getBias()
    {

        float retVal = getBias_0(nativeObj);

        return retVal;
    }

    //
    // C++:  void setBias(float bias)
    //

    //javadoc: TonemapDrago::setBias(bias)
    public  void setBias(float bias)
    {

        setBias_0(nativeObj, bias);

        return;
    }

    @Override
    protected void finalize() throws Throwable {
        delete(nativeObj);
    }

    // C++:  float getSaturation()
    private static native float getSaturation_0(long nativeObj);

    // C++:  void setSaturation(float saturation)
    private static native void setSaturation_0(long nativeObj, float saturation);

    // C++:  float getBias()
    private static native float getBias_0(long nativeObj);

    // C++:  void setBias(float bias)
    private static native void setBias_0(long nativeObj, float bias);

    // native support for java finalize()
    private static native void delete(long nativeObj);

}


text:
<!DOCTYPE html>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<body>
<script>
test(function () {
    var proto = Object.create(HTMLElement.prototype);
    var ctor = document.registerElement('x-a', {prototype: proto});
    assert_true(ctor instanceof Function, 'constructor must be a function');
    assert_equals(typeof ctor, 'function', 'constructor must be a function instance');
}, 'constructor type');

test(function () {
    var proto = Object.create(HTMLElement.prototype);
    var ctor = document.registerElement('x-b', {prototype: proto});

    // FIXME: These are not specified yet. Update these assertions
    // when the name is specified.
    assert_equals(ctor.name, 'x-b', 'the constructor\'s name should match the type');
}, 'constructor name');

test(function () {
    var proto = Object.create(HTMLElement.prototype);
    var ctor = document.registerElement('x-c', {prototype: proto});
    assert_own_property(proto, 'constructor', 'document.register must configure the constructor property of the prototype');

    assert_equals(proto.constructor, ctor, 'the value of the constructor property must be the constructor function');

    var desc = Object.getOwnPropertyDescriptor(proto, 'constructor');
    assert_true(desc.writable, 'constructor property must be writable');
    assert_false(desc.enumerable, 'constructor property must be non-enumerable');
    assert_true(desc.configurable, 'constructor property must be configurable');
}, 'prototype "constructor" property');

test(function () {
    var proto = Object.create(HTMLElement.prototype);
    var ctor = document.registerElement('x-d', {prototype: proto});
    assert_own_property(ctor, 'prototype', 'document.register must configure the prototype property of the constructor');

    assert_equals(ctor.prototype, proto, 'the value of the prototype property must be the prototype object');

    var desc = Object.getOwnPropertyDescriptor(ctor, 'prototype');
    assert_false(desc.writable, 'prototype property must not be writable');
    assert_false(desc.enumerable, 'prototype property must be non-enumerable');
    assert_false(desc.configurable, 'prototype property must not be configurable');
}, 'constructor "prototype" property');
</script>


text:
using NMFExamples.Pcm.Core;
using NMFExamples.Pcm.Core.Entity;
using NMFExamples.Pcm.Parameter;
using NMFExamples.Pcm.Protocol;
using NMFExamples.Pcm.Reliability;
using NMFExamples.Pcm.Resourcetype;
using NMFExamples.Pcm.Seff;
using NMF.Collections.Generic;
using NMF.Collections.ObjectModel;
using NMF.Expressions;
using NMF.Expressions.Linq;
using NMF.Models;
using NMF.Models.Collections;
using NMF.Models.Expressions;
using NMF.Models.Meta;
using NMF.Models.Repository;
using NMF.Serialization;
using NMF.Utilities;
using System;
using global::System.Collections;
using global::System.Collections.Generic;
using global::System.Collections.ObjectModel;
using global::System.Collections.Specialized;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.Linq;

namespace NMFExamples.Pcm.Repository
{

    /// <summary>
    /// The public interface for Interface
    /// </summary>
    [DefaultImplementationTypeAttribute(typeof(Interface))]
    [XmlDefaultImplementationTypeAttribute(typeof(Interface))]
    public interface IInterface : IModelElement, IEntity
    {

        /// <summary>
        /// The parentInterfaces__Interface property
        /// </summary>
        ICollectionExpression<IInterface> ParentInterfaces__Interface
        {
            get;
        }

        /// <summary>
        /// The protocols__Interface property
        /// </summary>
        IListExpression<IProtocol> Protocols__Interface
        {
            get;
        }

        /// <summary>
        /// The requiredCharacterisations property
        /// </summary>
        IListExpression<IRequiredCharacterisation> RequiredCharacterisations
        {
            get;
        }

        /// <summary>
        /// The repository__Interface property
        /// </summary>
        IRepository Repository__Interface
        {
            get;
            set;
        }

        /// <summary>
        /// Gets fired before the Repository__Interface property changes its value
        /// </summary>
        event global::System.EventHandler<ValueChangedEventArgs> Repository__InterfaceChanging;

        /// <summary>
        /// Gets fired when the Repository__Interface property changed its value
        /// </summary>
        event global::System.EventHandler<ValueChangedEventArgs> Repository__InterfaceChanged;
    }
}


text:
 * -> operator added for looping
 * length operator # added
 * added number and basic range (int) support
 * added json value type
# release 0.0.7
 * keep sources for reference as well
 * assignment and basic list ops
 * basic string as mushtache assignment
 * initial repository creation


text: from ._marker_info import *


text:
package org.apache.oodt.cas.cli.presenter;

/**
 * Presenter to displaying help messages generated by help printers.
 *
 * @author bfoster (Brian Foster)
 */
public interface CmdLinePresenter {

   void presentOptionHelp(String optionHelpMessage);

   void presentActionHelp(String actionHelpMessage);

   void presentActionsHelp(String actionsHelpMessage);

   void presentErrorMessage(String errorMessage);

   void presentActionMessage(String actionMessage);
}


text:
{%- set categories = resource.pages|get_categories(post) %}

  {%- for category in categories %}
    {%- if category.pages.length === 1 %}
      {%- for item in category.pages|splitComponentsByType(category.name) %}

          {{item.title}}
          {{item.meta.chinese}}

      {%- endfor %}
    {%- else %}

{{category.name}}

        {%- for item in category.pages|splitComponentsByType(category.name) %}
          {%- if item.divider === true %}

{{item.name}}

          {%- else %}

              {{item.title}}
              {{item.meta.chinese}}

          {%- endif %}
        {%- endfor %}

    {%- endif %}
  {%- endfor %}


text:
local childprocess = require('childprocess')
local utils = require('utils')
local fs = require('fs')
local string = require('string')
local table = require('table')
local path = require('path')

local results = {}
local ports = 10001

local async = {}
async.forEachSeries = function(arr, iterator, callback)
  if #arr == 0 then
    return callback()
  end
  local completed = 0
  local iterate
  iterate = function()
    iterator(arr[completed + 1], function(err)
      if err then
        callback(err)
        callback = function() end
      else
        completed = completed + 1
        if completed == #arr then
          callback()
        else
          iterate()
        end
      end
    end)
  end
  iterate()
end

local function runTest(filename, callback)
  results[filename] = {}
  results[filename].stdout_data = ''
  results[filename].stderr_data = ''
  results[filename].filename = filename

  process.stdout:write(utils.color("B") .. filename .. utils.color())

  ports = ports + 100

  local lenv = {}
  lenv.PORT = "" .. ports
  lenv.PATH = process.env.PATH
  local child = childprocess.spawn(process.argv[0], {filename}, {env = lenv})
  child:on('exit', function (exit_status, term_signal)
    results[filename].exit_status = exit_status
    if exit_status ~= 0 then
      process.stdout:write(' ' .. utils.color("Bred") .. 'FAILED' .. utils.color() .. '\n')
    else
      process.stdout:write(' ' .. utils.color("Bgreen") .. 'SUCCESS' .. utils.color() .. '\n')
    end
    callback()
  end)
  child.stdout:on("data", function (chunk)
    results[filename].stdout_data = results[filename].stdout_data .. chunk
  end)
  child.stderr:on("data", function (chunk)
    results[filename].stderr_data = results[filename].stderr_data .. chunk
  end)
end

local function run(callback)
  fs.readdir('.', function(err, files)
    assert(err == nil)
    test_files = {}

    for i, v in ipairs(files) do
      local _, _, ext = string.find(v, '^test-.*%.(.*)')
      if ext == 'lua' then
        table.insert(test_files, v)
      end
    end

    async.forEachSeries(test_files, runTest, function()
      local nerr = 0;
      local nran = 0;

      for k, v in pairs(results) do
        nran = nran + 1
        if v.exit_status ~= 0 then
          nerr = nerr + 1
          process.stdout:write('\n\n')
          process.stdout:write(utils.color("Bred") .. "FAIL (" .. v.filename .. ')' .. utils.color() .. "\n")
          process.stdout:write(v.stdout_data)
          process.stdout:write(v.stderr_data)
        end
      end
      process.stdout:write('Done\n')
      if nerr ~= 0 then
        callback()
        process.exit(1)
      end
    end)
  end)
end

local tmp_dir = path.join(__dirname, 'tmp')

local remove_recursive
remove_recursive = function(dir, done)
  fs.readdir(dir, function(err, files)
    if files == nil then
      done()
      return
    end

    if err then
      done(err)
      return
    end

    for i, v in ipairs(files) do
      local file = path.join(dir, v)
      fs.stat(file, function(err, stat)
        if err then
          done(err)
          return
        end

        if stat.is_directory then
          remove_recursive(file, function(err)
            fs.rmdir(file, function() end)
          end)
        elseif stat.is_file then
          fs.unlink(file, function() end)
        end
      end)
    end
    done()
  end)
end

remove_recursive(tmp_dir, function ()
  fs.mkdir(tmp_dir, "0755", function()
    run(remove_tmp)
  end)
end)


text:
/* eslint-env node */
"use strict";

var fluid = require("../../src/module/fluid.js"),
    path = require("path");

fluid.loadTestingSupport();

var QUnit = fluid.registerNamespace("QUnit");
var jqUnit = fluid.registerNamespace("jqUnit");

fluid.registerNamespace("fluid.tests");

fluid.loadInContext("../../tests/test-core/testTests/js/TestingTests.js");

var testModuleBase = __dirname + path.sep + "node_modules" + path.sep + "test-module";

fluid.module.preInspect(testModuleBase);

// We must store this NOW since it will be overwritten when the module is genuinely loaded - the test
// fixture will run long afterwards
var preInspected = fluid.module.modules["test-module"].baseDir;

jqUnit.test("Test early inspection of test module", function () {
    jqUnit.assertEquals("Test that base directory of test module has been successfully pre-inspected", fluid.module.canonPath(testModuleBase), preInspected);
});

fluid.require("test-module", require, "test-module");

fluid.setLogging(true);

QUnit.testDone(function (data) {
    fluid.log("Test concluded - " + data.name + ": " + data.passed + " passed, " + data.failed + " failed");
});

var expected = 20;

QUnit.done(function (data) {
    fluid.log("Infusion node.js internal tests " +
        (expected === data.passed && data.failed === 0 ? "PASSED" : "FAILED") +
        " - " + data.passed + "/" + (expected + data.failed) + " tests passed");
});

QUnit.log(function (details) {
    if (details.source) { // "white-box" inspection of qunit.js shows that it sets this field on error
        fluid.log("Message: " + details.message + "\nSource: " + details.source);
        if (details.expected !== undefined) {
            console.log("Expected: ", JSON.stringify(details.expected, null, 4));
            console.log("Actual: ", JSON.stringify(details.actual, null, 4));
        }
    }
});

fluid.test.runTests(["fluid.tests.myTestTree"]);

jqUnit.module("Non IoC tests");

jqUnit.test("Rendering truncation test", function () {
    var rendered = fluid.renderLoggingArg(fluid);
    jqUnit.assertTrue("Large object truncated", rendered.length < fluid.logObjectRenderChars + 100); // small allowance for extra diagnostic
    console.log("Large log rendering object truncated to " + rendered.length + " chars");
});

jqUnit.test("Test fluid.require support", function () {
    var testModule = fluid.registerNamespace("test-module");
    jqUnit.assertEquals("Loaded module as Fluid namespace", "Export from test-module", testModule.value);
    jqUnit.assertEquals("Loaded module as Fluid global entry", "Export from test-module", fluid.global["test-module"].value);
});

jqUnit.test("Test fluid.require diagnostics and FLUID-5906 loading", function () {
    jqUnit.expect(1);
    jqUnit.expectFrameworkDiagnostic("Module name for unloaded modules", function () {
        fluid.require("%test-module3");
    }, ["Module test-module3 has not been loaded and could not be loaded"]);
    var testModule2 = fluid.require("%test-module2");
    var rawTestModule2 = require("test-module2");
    jqUnit.assertEquals("Same module resolvable via fluid.require and require ", rawTestModule2, testModule2);
});

jqUnit.test("Test propagation of standard globals", function () {
    var expectedGlobals = ["console.log", "setTimeout", "clearTimeout", "setInterval", "clearInterval"];

    fluid.each(expectedGlobals, function (oneGlobal) {
        var type = typeof(fluid.get(fluid.global, oneGlobal));
        jqUnit.assertEquals("Global " + oneGlobal + " has type function", "function", type);
    });
});

jqUnit.test("Test module resolvePath", function () {
    var resolved = fluid.module.resolvePath("%infusion/src/components/tableOfContents/html/TableOfContents.html");
    var expected = fluid.module.canonPath(path.resolve(__dirname, "../../src/components/tableOfContents/html/TableOfContents.html"));
    jqUnit.assertEquals("Resolved path into infusion module", expected, resolved);

    var pkg = fluid.require("%test-module/package.json");
    jqUnit.assertEquals("Loaded package.json via resolved path directly via fluid.require", "test-module", pkg.name);
});

fluid.tests.expectFailure = false;

fluid.tests.addLogListener = function (listener) {
    fluid.onUncaughtException.addListener(listener, "log",
        fluid.handlerPriorities.uncaughtException.log);
};

fluid.tests.onUncaughtException = function () {
    jqUnit.assertEquals("Expected failure in uncaught exception handler",
        true, fluid.tests.expectFailure);
    fluid.onUncaughtException.removeListener("test-uncaught");
    fluid.onUncaughtException.removeListener("log");
    fluid.tests.addLogListener(fluid.identity);
    fluid.tests.expectFailure = false;
    fluid.invokeLater(function () { // apply this later to avoid nesting uncaught exception handler
        fluid.invokeLater(function () {
            fluid.onUncaughtException.removeListener("log"); // restore the original listener
            console.log("Restarting jqUnit in nested handler");
            jqUnit.start();
        });
        "string".fail(); // provoke a further global uncaught error - should be a no-op
    });
};

fluid.tests.benignLogger = function () {
    fluid.log("Expected global failure received in test case");
    jqUnit.assert("Expected global failure");
};

jqUnit.asyncTest("Test uncaught exception handler registration and deregistration", function () {
    jqUnit.expect(2);
    fluid.onUncaughtException.addListener(fluid.tests.onUncaughtException, "test-uncaught");
    fluid.tests.addLogListener(fluid.tests.benignLogger);
    fluid.tests.expectFailure = true;
    fluid.invokeLater(function () { // put this in a timeout to avoid bombing QUnit's exception handler
        "string".fail(); // provoke a global uncaught error
    });
});

jqUnit.test("FLUID-5807 noncorrupt framework stack traces", function () {
    var error = new fluid.FluidError("thing");
    jqUnit.assertTrue("Framework error is an error (from its own perspective)", error instanceof fluid.Error);
    jqUnit.assertTrue("Framework error is an instance of itself", error instanceof fluid.FluidError);
    var stack = error.stack.toString();
    jqUnit.assertTrue("Our own filename must appear in the stack", stack.indexOf("basic-node-tests") !== -1);
});

QUnit.load();