text:
import Redis from "../../lib/Redis";
import { expect } from "chai";

describe("pub/sub", function () {
  it("should invoke the callback when subscribe successfully", (done) => {
    const redis = new Redis();
    let pending = 1;
    redis.subscribe("foo", "bar", function (err, count) {
      expect(count).to.eql(2);
      pending -= 1;
    });
    redis.subscribe("foo", "zoo", function (err, count) {
      expect(count).to.eql(3);
      expect(pending).to.eql(0);
      redis.disconnect();
      done();
    });
  });

  it("should reject when issue a command in the subscriber mode", (done) => {
    const redis = new Redis();
    redis.subscribe("foo", function () {
      redis.set("foo", "bar", function (err) {
        expect(err instanceof Error);
        expect(err.message).to.match(/subscriber mode/);
        redis.disconnect();
        done();
      });
    });
  });

  it("should report being in 'subscriber' mode when subscribed", (done) => {
    const redis = new Redis();
    redis.subscribe("foo", function () {
      expect(redis.mode).to.equal("subscriber");
      redis.disconnect();
      done();
    });
  });

  it("should exit subscriber mode using unsubscribe", (done) => {
    const redis = new Redis();
    redis.subscribe("foo", "bar", function () {
      redis.unsubscribe("foo", "bar", function (err, count) {
        expect(count).to.eql(0);
        redis.set("foo", "bar", function (err) {
          expect(err).to.eql(null);

          redis.subscribe("zoo", "foo", function () {
            redis.unsubscribe(function (err, count) {
              expect(count).to.eql(0);
              redis.set("foo", "bar", function (err) {
                expect(err).to.eql(null);
                redis.disconnect();
                done();
              });
            });
          });
        });
      });
    });
  });

  it("should report being in 'normal' mode after unsubscribing", (done) => {
    const redis = new Redis();
    redis.subscribe("foo", "bar", function () {
      redis.unsubscribe("foo", "bar", function (err, count) {
        expect(redis.mode).to.equal("normal");
        redis.disconnect();
        done();
      });
    });
  });

  it("should receive messages when subscribe a channel", (done) => {
    const redis = new Redis();
    const pub = new Redis();
    let pending = 2;
    redis.subscribe("foo", function () {
      pub.publish("foo", "bar");
    });
    redis.on("message", function (channel, message) {
      expect(channel).to.eql("foo");
      expect(message).to.eql("bar");
      if (!--pending) {
        redis.disconnect();
        done();
      }
    });
    redis.on("messageBuffer", function (channel, message) {
      expect(channel).to.be.instanceof(Buffer);
      expect(channel.toString()).to.eql("foo");
      expect(message).to.be.instanceof(Buffer);
      expect(message.toString()).to.eql("bar");
      if (!--pending) {
        redis.disconnect();
        done();
      }
    });
  });

  it("should receive messages when psubscribe a pattern", (done) => {
    const redis = new Redis();
    const pub = new Redis();
    let pending = 2;
    redis.psubscribe("f?oo", function () {
      pub.publish("fzoo", "bar");
    });
    redis.on("pmessage", function (pattern, channel, message) {
      expect(pattern).to.eql("f?oo");
      expect(channel).to.eql("fzoo");
      expect(message).to.eql("bar");
      if (!--pending) {
        redis.disconnect();
        pub.disconnect();
        done();
      }
    });
    redis.on("pmessageBuffer", function (pattern, channel, message) {
      expect(pattern).to.eql("f?oo");
      expect(channel).to.be.instanceof(Buffer);
      expect(channel.toString()).to.eql("fzoo");
      expect(message).to.be.instanceof(Buffer);
      expect(message.toString()).to.eql("bar");
      if (!--pending) {
        redis.disconnect();
        pub.disconnect();
        done();
      }
    });
  });

  it("should exit subscriber mode using punsubscribe", async () => {
    const redis = new Redis();
    await redis.psubscribe("f?oo", "b?ar");
    const count = await redis.punsubscribe("f?oo", "b?ar");
    expect(count).to.eql(0);

    await redis.set("foo", "bar");
    await redis.psubscribe("z?oo", "f?oo");
    const newCount = await redis.punsubscribe();
    expect(newCount).to.eql(0);
    await redis.set("foo", "bar");
    redis.disconnect();
  });

  it("should be able to send quit command in the subscriber mode", (done) => {
    const redis = new Redis();
    let pending = 1;
    redis.subscribe("foo", function () {
      redis.quit(function () {
        pending -= 1;
      });
    });
    redis.on("end", function () {
      expect(pending).to.eql(0);
      redis.disconnect();
      done();
    });
  });

  it("should restore subscription after reconnecting(subscribe)", (done) => {
    const redis = new Redis();
    const pub = new Redis();
    redis.subscribe("foo", "bar", function () {
      redis.on("ready", function () {
        // Execute a random command to make sure that `subscribe`
        // is sent
        redis.ping(function () {
          let pending = 2;
          redis.on("message", function (channel, message) {
            if (!--pending) {
              redis.disconnect();
              pub.disconnect();
              done();
            }
          });
          pub.publish("foo", "hi1");
          pub.publish("bar", "hi2");
        });
      });
      redis.disconnect(true);
    });
  });

  it("should restore subscription after reconnecting(psubscribe)", (done) => {
    const redis = new Redis();
    const pub = new Redis();
    redis.psubscribe("fo?o", "ba?r", function () {
      redis.on("ready", function () {
        redis.ping(function () {
          let pending = 2;
          redis.on("pmessage", function (pattern, channel, message) {
            if (!--pending) {
              redis.disconnect();
              pub.disconnect();
              done();
            }
          });
          pub.publish("fo1o", "hi1");
          pub.publish("ba1r", "hi2");
        });
      });
      redis.disconnect(true);
    });
  });
});


text:
<?php

namespace Aedart\Model\Contracts\Mixed;

/**
 *
X Aware

 *
 * Component is aware of a mixed "x" value, which can
 * also be specified.
 *
 * @author Alin Eugen Deac <aedart@gmail.com>
 * @package Aedart\Model\Contracts\Mixed
 */
interface XAware
{
    /**
     * Set x
     *
     * @param mixed $value Some kind of value
     *
     * @return self
     */
    public function setX($value);

    /**
     * Get x
     *
     * If no "x" value has been set, this method will
     * set and return a default "x" value,
     * if any such value is available
     *
     * @see getDefaultX()
     *
     * @return mixed|null "x" value or null if no "x" value has been set
     */
    public function getX();

    /**
     * Check if "x" has been set
     *
     * @return bool True if "x" value has been set, false if not
     */
    public function hasX() : bool ;

    /**
     * Get a default "x" value, if any is available
     *
     * @return mixed|null A default "x" value or null if no default value is available
     */
    public function getDefaultX();
}

redpajama_set_name: RedPajamaGithub


text:
set -e

MAN_LOCATION='man/man1'
MAN7_LOCATION='man/man7'
POSTS_LOCATION='docs/_posts'

function checkout_manuals {
  cp -r man/ docs/man
}

function copy_to_posts {
  # Cleaning old files:
  rm -f "$POSTS_LOCATION/*.md"
  rm -rf "$POSTS_LOCATION"
  mkdir -p "$POSTS_LOCATION"

  # Moving new command files:
  local timestamp
  local current_date

  timestamp=$(date "+%Y-%m-%d %H:%M:%S %z")
  current_date=$(date "+%Y-%m-%d")

  # Creating command reference:
  for com in "$MAN_LOCATION"/git-secret-*.1.md; do
    local short_name
    short_name=$(echo "$com" | sed -n "s|$MAN_LOCATION/\(.*\)\.1\.md|\1|p")
    local command_header="---
layout: post
title: '${short_name}'
date: ${timestamp}
permalink: ${short_name}
categories: command
---"

    local post_filename="$POSTS_LOCATION/${current_date}-${short_name}.md"
    echo "$command_header" > "$post_filename"
    cat "$com" >> "$post_filename"
  done

  # Creating main usage file:
  local usage_header="---
layout: post
title: 'git-secret'
date: ${timestamp}
permalink: git-secret
categories: usage
---"
  local usage_filename="$POSTS_LOCATION/${current_date}-git-secret.md"
  echo "$usage_header" > "$usage_filename"
  cat "$MAN7_LOCATION/git-secret.7.md" >> "$usage_filename"
}

function copy_install_scripts {
  # We test these scripts using `release-ci`,
  # so, installation instructions will always be up-to-date:
  cp utils/deb/install.sh docs/_includes/install-deb.sh
  cp utils/rpm/install.sh docs/_includes/install-rpm.sh
  cp utils/apk/install.sh docs/_includes/install-apk.sh
}

function copy_version {
   ./git-secret --version > docs/_includes/version.txt
}

checkout_manuals
copy_to_posts
copy_install_scripts
copy_version


text:
#ifndef __TT_UACCESS_H
#define __TT_UACCESS_H

#include "linux/string.h"
#include "linux/sched.h"
#include "asm/processor.h"
#include "asm/errno.h"
#include "asm/current.h"
#include "asm/a.out.h"
#include "uml_uaccess.h"

#define ABOVE_KMEM (16 * 1024 * 1024)

extern unsigned long end_vm;
extern unsigned long uml_physmem;

#define is_stack(addr, size) \
	(((unsigned long) (addr) < STACK_TOP) && \
	 ((unsigned long) (addr) >= STACK_TOP - ABOVE_KMEM) && \
	 (((unsigned long) (addr) + (size)) <= STACK_TOP))

#define access_ok_tt(type, addr, size) \
	(is_stack(addr, size))

extern unsigned long get_fault_addr(void);

extern int __do_copy_from_user(void *to, const void *from, int n,
			       void **fault_addr, void **fault_catcher);
extern int __do_strncpy_from_user(char *dst, const char *src, size_t n,
				  void **fault_addr, void **fault_catcher);
extern int __do_clear_user(void *mem, size_t len, void **fault_addr,
			   void **fault_catcher);
extern int __do_strnlen_user(const char *str, unsigned long n,
			     void **fault_addr, void **fault_catcher);

extern int copy_from_user_tt(void *to, const void __user *from, int n);
extern int copy_to_user_tt(void __user *to, const void *from, int n);
extern int strncpy_from_user_tt(char *dst, const char __user *src, int count);
extern int __clear_user_tt(void __user *mem, int len);
extern int clear_user_tt(void __user *mem, int len);
extern int strnlen_user_tt(const void __user *str, int len);

#endif


text:
FactoryBot.define do
  factory :text_message, class: BaseCRM::TextMessage do

  end
end


text:
package org.apache.predictionio.examples.java.recommendations.tutorial4;

import org.apache.predictionio.controller.java.EmptyParams;
import org.apache.predictionio.controller.java.IJavaEngineFactory;
import org.apache.predictionio.controller.java.JavaEngine;
import org.apache.predictionio.controller.java.JavaEngineBuilder;
import org.apache.predictionio.controller.java.JavaEngineParams;
import org.apache.predictionio.controller.java.JavaEngineParamsBuilder;
import org.apache.predictionio.controller.java.LJavaFirstServing;
import org.apache.predictionio.controller.java.JavaWorkflow;
import org.apache.predictionio.controller.java.WorkflowParamsBuilder;

import java.util.HashMap;

import org.apache.predictionio.controller.IdentityPreparator;

public class Runner4c {
  public static void main(String[] args) {
    if (args.length == 0) {
      System.out.println("Error: Please specify the file directory as argument");
      System.exit(1);
    }

    JavaEngineParams engineParams = new JavaEngineParamsBuilder()
      .dataSourceParams(new DataSourceParams(args[0], true))
      // 1 -> -1., 2 -> -.5, 3 -> 0., 4 -> .5, 5 -> 1.
      .addAlgorithmParams("featurebased", new FeatureBasedAlgorithmParams(1.0, 5.0, 3.0, 0.5))
      .build();

    JavaWorkflow.runEngine(
      (new SingleEngineFactory()).apply(),
      engineParams,
      new WorkflowParamsBuilder().batch("Recommendation.tutorial4.Runner4c").verbose(3).build()
    );
  }
}


text:
module.exports.fragments_pgMigrate = function(fragments_Promise, fragments_lodash, fragments_console, fragments_config_migrationPath, fragments_config_databaseUrl, fragments_insertSchemaInfoTableIfNotExists, fragments_selectMigrations, fragments_applyMigration, fragments_readMigrationDir) {
  return function(isVerbose, isDry) {
    var _;
    if (isVerbose == null) {
      isVerbose = false;
    }
    if (isDry == null) {
      isDry = false;
    }
    _ = fragments_lodash;
    return fragments_readMigrationDir().then(function(migrations) {
      if (isVerbose) {
        fragments_console.log("fragments_config_migrationPath =", fragments_config_migrationPath);
        fragments_console.log("fragments_config_databaseUrl =", fragments_config_databaseUrl);
        fragments_console.log("migrations =", migrations);
      }
      return fragments_insertSchemaInfoTableIfNotExists().then(function() {
        return fragments_selectMigrations();
      }).then(function(appliedMigrations) {
        var notAppliedMigrations, reducer;
        notAppliedMigrations = _.difference(migrations, appliedMigrations);
        if (isVerbose) {
          fragments_console.log("already applied =", appliedMigrations);
        }
        fragments_console.log("about to apply =", notAppliedMigrations);
        if (isDry) {
          return;
        }
        reducer = function(soFar, m) {
          return soFar.then(function() {
            fragments_console.log("applying", m);
            return fragments_applyMigration(m);
          });
        };
        return notAppliedMigrations.reduce(reducer, fragments_Promise.resolve());
      });
    });
  };
};

module.exports.fragments_getFileExtension = function(fragments_path) {
  return function(filename) {
    var ext;
    ext = fragments_path.extname(filename || '').split('.');
    return ext[ext.length - 1];
  };
};

module.exports.fragments_insertSchemaInfoTableIfNotExists = function(fragments_mesa) {
  return function() {
    return fragments_mesa.query("CREATE TABLE IF NOT EXISTS schema_info (migration text NOT NULL)");
  };
};

module.exports.fragments_selectMigrations = function(fragments_lodash, fragments_mesa) {
  return function() {
    return fragments_mesa.table('schema_info').find().then(function(schemaInfo) {
      return fragments_lodash.pluck(schemaInfo, 'migration');
    });
  };
};

module.exports.fragments_applyMigration = function(mesa, fragments_readMigrationFile) {
  return function(migrationFileName) {
    return fragments_readMigrationFile(migrationFileName).then(function(migrationSql) {
      return mesa.wrapInTransaction(function(connection) {
        var transaction;
        transaction = mesa.setConnection(connection);
        return transaction.query(migrationSql).then(function() {
          return transaction.table('schema_info').unsafe().insert({
            migration: migrationFileName
          });
        });
      });
    });
  };
};

module.exports.fragments_readMigrationDir = function(fragments_fs, fragments_config_migrationPath, fragments_getFileExtension) {
  return function() {
    return fragments_fs.readdirAsync(fragments_config_migrationPath).then(function(files) {
      return files.filter(function(file) {
        return 'sql' === fragments_getFileExtension(file);
      });
    });
  };
};

module.exports.fragments_readMigrationFile = function(fragments_fs, fragments_path, fragments_config_migrationPath) {
  return function(name) {
    var path;
    path = fragments_path.join(fragments_config_migrationPath, name);
    return fragments_fs.readFileAsync(path, 'utf-8');
  };
};

module.exports.fragments_pgCreate = function(fragments_childProcess, fragments_config_postgresDatabase, fragments_console) {
  return function() {
    fragments_console.log('createDatabase', fragments_config_postgresDatabase);
    return fragments_childProcess.execAsync("createdb " + fragments_config_postgresDatabase);
  };
};

module.exports.fragments_pgDrop = function(fragments_childProcess, fragments_config_postgresDatabase, fragments_console) {
  return function() {
    fragments_console.log('dropDatabase', fragments_config_postgresDatabase);
    return fragments_childProcess.execAsync("dropdb --if-exists " + fragments_config_postgresDatabase);
  };
};

module.exports.fragments_pgDropCreate = function(fragments_pgDrop, fragments_pgCreate) {
  return function() {
    return fragments_pgDrop().then(function() {
      return fragments_pgCreate();
    });
  };
};

module.exports.fragments_pgDropCreateMigrate = function(fragments_pgDropCreate, fragments_pgMigrate) {
  return function() {
    return fragments_pgDropCreate().then(function() {
      return fragments_pgMigrate();
    });
  };
};


text:
@rem Used by the buildbot "buildmsi" step.

cmd /c Tools\buildbot\external.bat
@rem build release versions of things
call "%VS90COMNTOOLS%vsvars32.bat"

@rem build Python
vcbuild /useenv PCbuild\pcbuild.sln "Release|Win32"

@rem build the documentation
bash.exe -c 'cd Doc;make PYTHON=python2.5 update htmlhelp'
"%ProgramFiles%\HTML Help Workshop\hhc.exe" Doc\build\htmlhelp\python26a3.hhp

@rem build the MSI file
cd PC
nmake /f icons.mak
cd ..\Tools\msi
del *.msi
nmake /f msisupport.mak
%HOST_PYTHON% msi.py


text:
package org.apache.mahout.vectorizer;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.lib.input.SequenceFileInputFormat;
import org.apache.hadoop.mapreduce.lib.output.SequenceFileOutputFormat;
import org.apache.mahout.common.HadoopUtil;
import org.apache.mahout.math.VectorWritable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;

/**
 *
Runs a Map/Reduce job that encodes {@link org.apache.mahout.vectorizer.encoders.FeatureVectorEncoder} the
 * input and writes it to the output as a sequence file.

 *
 *
Only works on basic text, where the value in the SequenceFile is a blob of text.

 */
//TODO: find commonalities w/ DictionaryVectorizer and abstract them out
public class SimpleTextEncodingVectorizer implements Vectorizer {

  private static final Logger log = LoggerFactory.getLogger(SimpleTextEncodingVectorizer.class);

  @Override
  public void createVectors(Path input, Path output, VectorizerConfig config)
    throws IOException, ClassNotFoundException, InterruptedException {
    //do this for convenience of using prepareJob
    Job job = HadoopUtil.prepareJob(input, output,
                                    SequenceFileInputFormat.class,
                                    EncodingMapper.class,
                                    Text.class,
                                    VectorWritable.class,
                                    SequenceFileOutputFormat.class,
                                    config.getConf());
    Configuration conf = job.getConfiguration();
    conf.set(EncodingMapper.USE_SEQUENTIAL, String.valueOf(config.isSequentialAccess()));
    conf.set(EncodingMapper.USE_NAMED_VECTORS, String.valueOf(config.isNamedVectors()));
    conf.set(EncodingMapper.ANALYZER_NAME, config.getAnalyzerClassName());
    conf.set(EncodingMapper.ENCODER_FIELD_NAME, config.getEncoderName());
    conf.set(EncodingMapper.ENCODER_CLASS, config.getEncoderClass());
    conf.set(EncodingMapper.CARDINALITY, String.valueOf(config.getCardinality()));
    job.setNumReduceTasks(0);
    boolean finished = job.waitForCompletion(true);

    log.info("result of run: {}", finished);
    if (!finished) {
      throw new IllegalStateException("Job failed!");
    }
  }

}


text:
"""SEED network utility helper classes and functions

DEFAULT_HOST: Get ip address from host configuration
DEFAULT_PORT: Default port
DEFAULT_ID:   ID for personalize RPC connection
DEFAULT_HMAC_KEY: Key for RPC connection without name server
node_uri: Generate node URI for Pyro4 object using ip, port and DEFAULT_ID
is_valid_ipv4_address, is_valid_ipv6_address: Verify IP address
"""

import socket

def _get_ip():
    """get ip address"""
    (hostname, aliaslist, ipaddrlist) = \
        socket.gethostbyname_ex(socket.gethostname())
    return ipaddrlist[0]

DEFAULT_HOST = _get_ip()
DEFAULT_PORT = 10001

DEFAULT_ID = 'SEED'
DEFAULT_HMAC_KEY = 'SEED indentifier'

def node_uri(ip_address, port, node_id=DEFAULT_ID):
    """Use ip address, port and (optional) node id to generate Pyro URI,
    create connection without Pyro4 name server"""

    return 'PYRO:' + node_id + '@' + ip_address + ':' + str(port)

def is_valid_ipv4_address(ip_address):
    """Verify IPv4 address"""
    try:
        addr = socket.inet_pton(socket.AF_INET, ip_address)
    except AttributeError: # no inet_pton here, sorry
        try:
            addr = socket.inet_aton(ip_address)
        except socket.error:
            return False
        return ip_address.count('.') == 3
    except socket.error: # not a valid address
        return False

    return True

def is_valid_ipv6_address(ip_address):
    """Verify IPv6 address"""
    try:
        addr = socket.inet_pton(socket.AF_INET6, ip_address)
    except socket.error: # not a valid address
        return False

    return True


text:
<?php
if(!defined('ABSPATH')){
    exit;//Exit if accessed directly
}

class AIOWPSecurity_Misc_Options_Menu extends AIOWPSecurity_Admin_Menu
{
    var $menu_page_slug = AIOWPSEC_MISC_MENU_SLUG;

    /* Specify all the tabs of this menu in the following array */
    var $menu_tabs;

    var $menu_tabs_handler = array(
        'tab1' => 'render_tab1',
        'tab2' => 'render_tab2',
        'tab3' => 'render_tab3',
        'tab4' => 'render_tab4',
        );

    function __construct()
    {
        $this->render_menu_page();
    }

    function set_menu_tabs()
    {
        $this->menu_tabs = array(
        'tab1' => __('Copy Protection', 'all-in-one-wp-security-and-firewall'),
        'tab2' => __('Frames', 'all-in-one-wp-security-and-firewall'),
        'tab3' => __('Users Enumeration', 'all-in-one-wp-security-and-firewall'),
        'tab4' => __('WP REST API', 'all-in-one-wp-security-and-firewall'),
        );
    }

    function get_current_tab()
    {
        $tab_keys = array_keys($this->menu_tabs);
        $tab = isset( $_GET['tab'] ) ? sanitize_text_field($_GET['tab']) : $tab_keys[0];
        return $tab;
    }

    /*
     * Renders our tabs of this menu as nav items
     */
    function render_menu_tabs()
    {
        $current_tab = $this->get_current_tab();

        echo '
';
        foreach ( $this->menu_tabs as $tab_key => $tab_caption )
        {
            $active = $current_tab == $tab_key ? 'nav-tab-active' : '';
            echo 'menu_page_slug . '&tab=' . $tab_key . '">' . $tab_caption . '';
        }
        echo '
';
    }

    /*
     * The menu rendering goes here
     */
    function render_menu_page()
    {
        echo '
';
        echo '
'.__('Miscellaneous','all-in-one-wp-security-and-firewall').'
';//Interface title
        $this->set_menu_tabs();
        $tab = $this->get_current_tab();
        $this->render_menu_tabs();
        ?>

        <?php
        //$tab_keys = array_keys($this->menu_tabs);
        call_user_func(array(&$this, $this->menu_tabs_handler[$tab]));
        ?>

        <?php
    }

    function render_tab1()
    {
        global $aio_wp_security;
        $maint_msg = '';
        if(isset($_POST['aiowpsec_save_copy_protection']))
        {
            $nonce=$_REQUEST['_wpnonce'];
            if (!wp_verify_nonce($nonce, 'aiowpsec-copy-protection'))
            {
                $aio_wp_security->debug_logger->log_debug("Nonce check failed on copy protection feature settings save!",4);
                die("Nonce check failed on copy protection feature settings save!");
            }

            //Save settings
            $aio_wp_security->configs->set_value('aiowps_copy_protection',isset($_POST["aiowps_copy_protection"])?'1':'');
            $aio_wp_security->configs->save_config();

            $this->show_msg_updated(__('Copy Protection feature settings saved!', 'all-in-one-wp-security-and-firewall'));

        }
        ?>

<?php _e('Disable The Ability To Copy Text', 'all-in-one-wp-security-and-firewall'); ?>

        <form action="" method="POST">
        <?php wp_nonce_field('aiowpsec-copy-protection'); ?>

            <?php
            echo '
'.__('This feature allows you to disable the ability to select and copy text from your front end.', 'all-in-one-wp-security-and-firewall').'
';
            echo '
'.__('When admin user is logged in, the feature is automatically disabled for his session.', 'all-in-one-wp-security-and-firewall').'
';
            ?>

                <?php _e('Enable Copy Protection', 'all-in-one-wp-security-and-firewall')?>:

                <input name="aiowps_copy_protection" type="checkbox"<?php if($aio_wp_security->configs->get_value('aiowps_copy_protection')=='1') echo ' checked="checked"'; ?> value="1"/>
                <?php _e('Check this if you want to disable the "Right Click", "Text Selection" and "Copy" option on the front end of your site.', 'all-in-one-wp-security-and-firewall'); ?>

            <input type="submit" class="button-primary" name="aiowpsec_save_copy_protection" value="<?php _e('Save Copy Protection Settings', 'all-in-one-wp-security-and-firewall'); ?>" />

        </form>

        <?php
    }

    function render_tab2()
    {
        global $aio_wp_security;
        $maint_msg = '';
        if(isset($_POST['aiowpsec_save_frame_display_prevent']))
        {
            $nonce=$_REQUEST['_wpnonce'];
            if (!wp_verify_nonce($nonce, 'aiowpsec-prevent-display-frame'))
            {
                $aio_wp_security->debug_logger->log_debug("Nonce check failed on prevent display inside frame feature settings save!",4);
                die("Nonce check failed on prevent display inside frame feature settings save!");
            }

            //Save settings
            $aio_wp_security->configs->set_value('aiowps_prevent_site_display_inside_frame',isset($_POST["aiowps_prevent_site_display_inside_frame"])?'1':'');
            $aio_wp_security->configs->save_config();

            $this->show_msg_updated(__('Frame Display Prevention feature settings saved!', 'all-in-one-wp-security-and-firewall'));

        }
        ?>

<?php _e('Prevent Your Site From Being Displayed In a Frame', 'all-in-one-wp-security-and-firewall'); ?>

        <form action="" method="POST">
        <?php wp_nonce_field('aiowpsec-prevent-display-frame'); ?>

            <?php
            echo '
'.__('This feature allows you to prevent other sites from displaying any of your content via a frame or iframe.', 'all-in-one-wp-security-and-firewall').'
';
            echo '
'.__('When enabled, this feature will set the "X-Frame-Options" paramater to "sameorigin" in the HTTP header.', 'all-in-one-wp-security-and-firewall').'
';
            ?>

                <?php _e('Enable iFrame Protection', 'all-in-one-wp-security-and-firewall')?>:

                <input name="aiowps_prevent_site_display_inside_frame" type="checkbox"<?php if($aio_wp_security->configs->get_value('aiowps_prevent_site_display_inside_frame')=='1') echo ' checked="checked"'; ?> value="1"/>
                <?php _e('Check this if you want to stop other sites from displaying your content in a frame or iframe.', 'all-in-one-wp-security-and-firewall'); ?>

            <input type="submit" class="button-primary" name="aiowpsec_save_frame_display_prevent" value="<?php _e('Save Settings', 'all-in-one-wp-security-and-firewall'); ?>" />

        </form>

        <?php
    }

    function render_tab3()
    {
        global $aio_wp_security;
        $maint_msg = '';
        if(isset($_POST['aiowpsec_save_users_enumeration']))
        {
            $nonce=$_REQUEST['_wpnonce'];
            if (!wp_verify_nonce($nonce, 'aiowpsec-users-enumeration'))
            {
                $aio_wp_security->debug_logger->log_debug("Nonce check failed on prevent users enumeration feature settings save!",4);
                die("Nonce check failed on prevent users enumeration feature settings save!");
            }

            //Save settings
            $aio_wp_security->configs->set_value('aiowps_prevent_users_enumeration',isset($_POST["aiowps_prevent_users_enumeration"])?'1':'');
            $aio_wp_security->configs->save_config();

            $this->show_msg_updated(__('Users Enumeration Prevention feature settings saved!', 'all-in-one-wp-security-and-firewall'));

        }
        ?>

<?php _e('Prevent Users Enumeration', 'all-in-one-wp-security-and-firewall'); ?>

        <form action="" method="POST">
        <?php wp_nonce_field('aiowpsec-users-enumeration'); ?>

            <?php
            echo '
'.__('This feature allows you to prevent external users/bots from fetching the user info with urls like "/?author=1".', 'all-in-one-wp-security-and-firewall').'
';
            echo '
'.__('When enabled, this feature will print a "forbidden" error rather than the user information.', 'all-in-one-wp-security-and-firewall').'
';
            ?>

                <?php _e('Disable Users Enumeration', 'all-in-one-wp-security-and-firewall')?>:

                <input name="aiowps_prevent_users_enumeration" type="checkbox"<?php if($aio_wp_security->configs->get_value('aiowps_prevent_users_enumeration')=='1') echo ' checked="checked"'; ?> value="1"/>
                <?php _e('Check this if you want to stop users enumeration.', 'all-in-one-wp-security-and-firewall'); ?>

            <input type="submit" class="button-primary" name="aiowpsec_save_users_enumeration" value="<?php _e('Save Settings', 'all-in-one-wp-security-and-firewall'); ?>" />

        </form>

        <?php
    }

    function render_tab4()
    {
        global $aio_wp_security;
        $maint_msg = '';
        if(isset($_POST['aiowpsec_save_rest_settings']))
        {
            $nonce=$_REQUEST['_wpnonce'];
            if (!wp_verify_nonce($nonce, 'aiowpsec-rest-settings'))
            {
                $aio_wp_security->debug_logger->log_debug("Nonce check failed on REST API security feature settings save!",4);
                die("Nonce check failed on REST API security feature settings save!");
            }

            //Save settings
            $aio_wp_security->configs->set_value('aiowps_disallow_unauthorized_rest_requests',isset($_POST["aiowps_disallow_unauthorized_rest_requests"])?'1':'');
            $aio_wp_security->configs->save_config();

            $this->show_msg_updated(__('WP REST API Security feature settings saved!', 'all-in-one-wp-security-and-firewall'));

        }
        ?>

<?php _e('', 'all-in-one-wp-security-and-firewall'); ?>

        <form action="" method="POST">
        <?php wp_nonce_field('aiowpsec-rest-settings'); ?>

            <?php
            echo '
'.__('This feature allows you to block WordPress REST API access for unauthorized requests.', 'all-in-one-wp-security-and-firewall').'
';
            echo '
'.__('When enabled this feature will only allow REST requests to be processed if the user is logged in.', 'all-in-one-wp-security-and-firewall').'
';
            ?>

            <?php
            echo __('Beware that if you are using other plugins which have registered REST endpoints (eg, Contact Form 7), then this feature will also block REST requests used by these plugins if the user is not logged in.'
                    . ' It is recommended that you leave this feature disabled if you want uninterrupted functionality for such plugins.', 'all-in-one-wp-security-and-firewall');
            ?>

                <?php _e('Disallow Unauthorized REST Requests', 'all-in-one-wp-security-and-firewall')?>:

                <input name="aiowps_disallow_unauthorized_rest_requests" type="checkbox"<?php if($aio_wp_security->configs->get_value('aiowps_disallow_unauthorized_rest_requests')=='1') echo ' checked="checked"'; ?> value="1"/>
                <?php _e('Check this if you want to stop REST API access for non-logged in requests.', 'all-in-one-wp-security-and-firewall'); ?>

            <input type="submit" class="button-primary" name="aiowpsec_save_rest_settings" value="<?php _e('Save Settings', 'all-in-one-wp-security-and-firewall'); ?>" />

        </form>

        <?php
    }

} //end class


text:
/**
 * CAcctHis.java	2010/07/12
 */

package com.ycsoft.beans.core.acct;

import java.io.Serializable;

import com.ycsoft.daos.config.POJO;

/**
 * CAcctHis -> C_ACCT_HIS mapping
 */
@POJO(tn = "C_ACCT_HIS", sn = "", pk = "")
public class CAcctHis extends CAcct implements Serializable {

	// CAcctHis all properties

	/**
	 *
	 */
	private static final long serialVersionUID = 4298091236121130228L;

	/**
	 * default empty constructor
	 */
	public CAcctHis() {
	}

}


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<type language="gradle" name="org.gradle.api.specs.AndSpec" version="3.0" superType="org.gradle.api.specs.CompositeSpec">
    <description> A org.gradle.api.specs.CompositeSpec which requires all its specs to be true in order to evaluate to true.
 Uses lazy evaluation.

param:<T> The target type for this Spec

</description>
    <method name="and" returnType="org.gradle.api.specs.AndSpec">
        <parameter type="groovy.lang.Closure" name="spec"/>
    </method>
    <method name="and" returnType="org.gradle.api.specs.AndSpec">
        <parameter type="org.gradle.api.specs.Spec" name="specs"/>
    </method>
    <method name="hashCode" returnType="int"/>
    <method name="isSatisfiedBy" returnType="boolean">
        <parameter type="T" name="object"/>
    </method>
    <property name="satisfiedBy" type="boolean"/>
</type>


text:
#include <aws/macie2/model/DataIdentifierSeverity.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>

using namespace Aws::Utils;

namespace Aws
{
  namespace Macie2
  {
    namespace Model
    {
      namespace DataIdentifierSeverityMapper
      {

        static const int LOW_HASH = HashingUtils::HashString("LOW");
        static const int MEDIUM_HASH = HashingUtils::HashString("MEDIUM");
        static const int HIGH_HASH = HashingUtils::HashString("HIGH");

        DataIdentifierSeverity GetDataIdentifierSeverityForName(const Aws::String& name)
        {
          int hashCode = HashingUtils::HashString(name.c_str());
          if (hashCode == LOW_HASH)
          {
            return DataIdentifierSeverity::LOW;
          }
          else if (hashCode == MEDIUM_HASH)
          {
            return DataIdentifierSeverity::MEDIUM;
          }
          else if (hashCode == HIGH_HASH)
          {
            return DataIdentifierSeverity::HIGH;
          }
          EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
          if(overflowContainer)
          {
            overflowContainer->StoreOverflow(hashCode, name);
            return static_cast<DataIdentifierSeverity>(hashCode);
          }

          return DataIdentifierSeverity::NOT_SET;
        }

        Aws::String GetNameForDataIdentifierSeverity(DataIdentifierSeverity enumValue)
        {
          switch(enumValue)
          {
          case DataIdentifierSeverity::LOW:
            return "LOW";
          case DataIdentifierSeverity::MEDIUM:
            return "MEDIUM";
          case DataIdentifierSeverity::HIGH:
            return "HIGH";
          default:
            EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
            if(overflowContainer)
            {
              return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
            }

            return {};
          }
        }

      } // namespace DataIdentifierSeverityMapper
    } // namespace Model
  } // namespace Macie2
} // namespace Aws


text:
package com.google.code.siren4j.component.builder;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.collections.CollectionUtils;

import com.google.code.siren4j.component.Action;
import com.google.code.siren4j.component.Field;
import com.google.code.siren4j.component.impl.ActionImpl;
import com.google.code.siren4j.component.impl.ActionImpl.Method;
import com.google.code.siren4j.component.impl.FieldImpl;
import com.google.code.siren4j.error.Siren4JBuilderValidationException;
import org.apache.commons.lang3.StringUtils;

public class ActionBuilder extends BaseBuilder<Action> {

    private List<Field> fields = new ArrayList<Field>();

    private ActionBuilder() {

    }
    /**
     * Retrieve a new instance of an ActionBuilder.
     * @return new instance, never null.
     */
    public static ActionBuilder newInstance() {
        return new ActionBuilder();
    }

    /**
     * Retrieve a new instance of an ActionBuilder. Added to allow this method to be used with
     * static method importing.
     * @since 1.1.0
     * @return new instance, never null.
     */
    public static ActionBuilder createActionBuilder() {
        return newInstance();
    }

    /**
     * Set the component class of the entity to be built. This method can be called many times
     * but only the value of the last call is used in the built entity. This is an optional property as specified
     * by the Siren specification.
     * @param componentClass may be null or empty.
     * @return this builder, never null.
     */
    public ActionBuilder setComponentClass(String... componentClass) {
        addStep("setComponentClass", new Object[] { componentClass }, new Class<?>[] {String[].class});
        return this;
    }

    /**
     * Sets an actions name value.
     * @param name cannot be null or empty.
     * @return
     */
    public ActionBuilder setName(String name) {
        if(StringUtils.isBlank(name)) {
            throw new IllegalArgumentException("name cannot be null or empty.");
        }
        addStep("setName", new Object[] { name });
        return this;
    }

    public ActionBuilder setMethod(Method method) {
        addStep("setMethod", new Object[] { method }, new Class<?>[] {Method.class});
        return this;
    }

    public ActionBuilder setHref(String href) {
        if(StringUtils.isBlank(href)) {
            throw new IllegalArgumentException("href cannot be null or empty.");
        }
        addStep("setHref", new Object[] { href });
        return this;
    }

    public ActionBuilder setTitle(String title) {
        addStep("setTitle", new Object[] { title }, new Class<?>[] {String.class});
        return this;
    }

    public ActionBuilder setType(String type) {
        addStep("setType", new Object[] { type }, new Class<?>[] {String.class});
        return this;
    }

    public ActionBuilder addField(Field field) {
        addStep("_addField", new Object[] { field }, true);
        return this;
    }

    public ActionBuilder addFields(List<Field> fields) {
        for (Field f : fields) {
            addField(f);
        }
        return this;
    }

    protected void _addField(FieldImpl field) {
        fields.add(field);
    }

    @Override
    protected void postProcess(Action obj) {
        ActionImpl action = (ActionImpl) obj;
        if (!CollectionUtils.isEmpty(fields)) {
            action.setFields(fields);
        }
    }

    @Override
    protected void validate(Action obj) {
        String requiredMsg = "Required property.";
        if (StringUtils.isBlank(obj.getName())) {
            throw new Siren4JBuilderValidationException("name", obj.getClass(), requiredMsg);
        }
        if (obj.getHref() == null) {
            throw new Siren4JBuilderValidationException("href", obj.getClass(), requiredMsg);
        }
    }

    @Override
    protected Action createInstance() {
        return new ActionImpl();
    }

}


text:
require "spec_helper"

describe HomePageController do
  describe "routing" do

    it "routes to #index" do
      get("/").should route_to("home_page#index")
    end

  end
end


text:
Utilisation des Query
=====================

TBD

> **NOTE:** elasticsearch limite le nombre d'enregistrements retournés par n'importe quelle requête à 10 enregistrements par défaut.
> Si vous vous attendez à obtenir plus de résultats, vous devez explicitement définir leur nombre dans la définition de la relation.


text:
import { ALL_SELECTED } from 'data/constants';

export const DATA_EXPLORER_BLOCKLIST = [
  'id',
  'iso_code3',
  'iso_code2',
  'emissions',
  'document_type',
  'language'
];

export const DATA_EXPLORER_BLOCKLIST_BY_SECTION = {
  'net-zero-content': ['sector', 'subsector']
};

export const FIRST_TABLE_HEADERS = {
  'historical-emissions': ['country', 'data_source', 'sector', 'gas', 'unit'],
  'ndc-content': [
    'country',
    'global_category',
    'overview_category',
    'sector',
    'subsector',
    'indicator',
    'value',
    'source',
    'indicator_name',
    'indicator_id'
  ],
  'lts-content': [
    'country',
    'global_category',
    'overview_category',
    'sector',
    'subsector',
    'indicator',
    'value',
    'source',
    'indicator_name',
    'indicator_id'
  ],
  'net-zero-content': [
    'country',
    'global_category',
    'overview_category',
    'indicator',
    'value',
    'source',
    'indicator_name',
    'indicator_id'
  ],
  'ndc-sdg-linkages': [
    'country',
    'sdg',
    'sdg_target',
    'indc_text',
    'status',
    'sector',
    'climate_response',
    'type_of_information'
  ],
  'emission-pathways': [
    'location',
    'model',
    'scenario',
    'category',
    'subcategory',
    'indicator',
    'composite_name',
    'definition',
    'unit'
  ]
};

export const FILTER_DEFAULTS = {
  'historical-emissions': {
    'data-sources': 'CAIT',
    regions: ALL_SELECTED,
    gases: 'All GHG',
    sectors: 'Total including LUCF'
  },
  'ndc-content': {
    categories: 'UNFCCC Process',
    indicators: ALL_SELECTED,
    sectors: ALL_SELECTED,
    countries: ALL_SELECTED
  },
  'lts-content': {
    categories: 'Communication of Long-term Strategy',
    indicators: ALL_SELECTED,
    sectors: ALL_SELECTED,
    countries: ALL_SELECTED
  },
  'net-zero-content': {
    categories: 'Target Description',
    indicators: ALL_SELECTED,
    countries: ALL_SELECTED
  },
  'ndc-sdg-linkages': {
    countries: ALL_SELECTED,
    goals: ALL_SELECTED,
    targets: ALL_SELECTED,
    sectors: ALL_SELECTED
  },
  'emission-pathways': {
    locations: ALL_SELECTED,
    models: ALL_SELECTED,
    scenarios: ALL_SELECTED,
    categories: ALL_SELECTED,
    subcategories: ALL_SELECTED,
    indicators: ALL_SELECTED
  }
};

export const DATA_EXPLORER_SECTIONS = {
  'historical-emissions': {
    label: 'historical_emissions',
    moduleName: 'ghg-emissions'
  },
  'ndc-sdg-linkages': {
    label: 'ndc_sdg',
    moduleName: 'ndcs-sdg'
  },
  'emission-pathways': {
    label: 'emission_pathways',
    moduleName: 'pathways'
  },
  'ndc-content': {
    label: 'ndc_content',
    moduleName: 'ndcs-content',
    linkLabel: 'ndcs_explore',
    linkName: 'ndcs-explore'
  },
  'lts-content': {
    label: 'lts_content',
    moduleName: 'lts-content',
    linkLabel: 'lts_explore',
    linkName: 'lts-explore'
  },
  'net-zero-content': {
    label: 'net_zero_content',
    moduleName: 'net-zero-tracker',
    linkLabel: 'net-zero-tracker',
    linkName: 'net-zero-tracker'
  }
};

export const DATA_EXPLORER_METHODOLOGY_SOURCE = {
  'historical-emissions': {
    PIK: ['historical_emissions_pik'],
    CAIT: ['historical_emissions_cait'],
    'UNFCCC Annex I': ['historical_emissions_unfccc'],
    'UNFCCC Non-Annex I': ['historical_emissions_unfccc'],
    GCP: ['historical_emissions_gcp']
  },
  'ndc-sdg-linkages': ['ndc_sdg_all indicators'],
  'ndc-content': ['ndc_cw', 'ndc_wb', 'ndc_die', 'ndc_adaptation'],
  'lts-content': ['lts'],
  'net-zero-content': ['net_zero'],
  'emission-pathways': [null] // model, scenario and indicator related metadata
};

export const DATA_EXPLORER_FILTERS = {
  'historical-emissions': ['data-sources', 'regions', 'sectors', 'gases'],
  'ndc-sdg-linkages': [
    'countries',
    'goals',
    'targets',
    'status',
    'sectors',
    'climate_response',
    'type_of_information'
  ],
  'emission-pathways': [
    'locations',
    'models',
    'scenarios',
    'categories',
    'subcategories',
    'indicators'
  ],
  'ndc-content': ['categories', 'indicators', 'sectors', 'countries'], // TODO: add focus when ready
  'lts-content': ['categories', 'indicators', 'sectors', 'countries'], // TODO: add focus when ready
  'net-zero-content': ['categories', 'indicators', 'countries'] // TODO: add focus when ready
};

// The dropdown named as the keys will be deleted if one of the values column changes
// and will only be selectable if all the values are selected
export const DATA_EXPLORER_DEPENDENCIES = {
  'historical-emissions': {
    regions: ['data-sources'],
    sectors: ['data-sources'],
    gases: ['data-sources']
  },
  'emission-pathways': {
    models: ['locations'],
    scenarios: ['models', 'locations'],
    categories: ['scenarios', 'models', 'locations'],
    subcategories: ['categories', 'scenarios', 'models', 'locations'],
    indicators: [
      'subcategories',
      'categories',
      'scenarios',
      'models',
      'locations'
    ]
  }
};

export const DATA_EXPLORER_EXTERNAL_PREFIX = 'external';
export const DATA_EXPLORER_TO_MODULES_PARAMS = {
  'historical-emissions': {
    data_sources: { key: 'source' },
    gases: { key: 'gases' },
    sectors: { key: 'sectors' },
    regions: { key: 'regions' },
    start_year: { key: 'start_year' },
    end_year: { key: 'end_year' }
  },
  'ndc-sdg-linkages': {
    goals: {
      key: 'goal',
      idLabel: 'number'
    }
  },
  'ndc-content': {
    sectors: {
      key: 'sectors'
    },
    categories: {
      key: 'category'
    },
    indicators: {
      key: 'indicator'
    }
  },
  'lts-content': {
    sectors: {
      key: 'sectors'
    },
    categories: {
      key: 'category'
    },
    indicators: {
      key: 'indicator'
    }
  },
  'net-zero-content': {
    categories: {
      key: 'category'
    },
    indicators: {
      key: 'indicator'
    }
  },
  'emission-pathways': {
    locations: {
      key: 'currentLocation',
      idLabel: 'id',
      currentId: 'iso_code'
    },
    models: {
      key: 'model'
    },
    scenarios: {
      key: 'scenario'
    },
    indicators: {
      key: 'indicator'
    },
    categories: {
      key: 'category'
    },
    subcategories: {
      key: 'subcategory'
    }
  }
};

export const MULTIPLE_LEVEL_SECTION_FIELDS = {
  'historical-emissions': [
    {
      key: 'sectors',
      multiselect: true
    }
  ],
  'ndc-content': [
    {
      key: 'sectors'
    },
    {
      key: 'categories'
    }
  ],
  'lts-content': [
    {
      key: 'sectors'
    },
    {
      key: 'categories'
    }
  ],
  'net-zero-content': [
    {
      key: 'categories'
    }
  ]
};

export const GROUPED_OR_MULTI_SELECT_FIELDS = {
  'historical-emissions': [
    {
      key: 'regions',
      label: 'Countries and Regions',
      groups: [
        { groupId: 'regions', title: 'Regions' },
        { groupId: 'countries', title: 'Countries' }
      ]
    },
    { key: 'gases' }
  ],
  'emission-pathways': [{ key: 'scenarios' }]
};

export const DATA_EXPLORER_PER_PAGE = 200;

export const SECTION_NAMES = {
  pathways: 'emission-pathways',
  historicalEmissions: 'historical-emissions'
};

export const FILTER_NAMES = {
  models: 'models',
  scenarios: 'scenarios',
  indicators: 'indicators',
  categories: 'categories',
  subcategories: 'subcategories',
  regions: 'regions'
};

export const FILTERED_FIELDS = {
  'historical-emissions': {
    sectors: [
      {
        parent: 'data-sources',
        parentId: 'sector_ids',
        id: 'id'
      }
    ],
    gases: [
      {
        parent: 'data-sources',
        parentId: 'gas_ids',
        id: 'id'
      }
    ]
  },
  'ndc-sdg-linkages': {
    targets: [
      {
        parent: 'goals',
        parentId: 'value',
        id: 'goal_id'
      }
    ]
  },
  'ndc-content': {
    indicators: [
      {
        parent: FILTER_NAMES.categories,
        parentId: 'id',
        id: 'category_ids'
      }
    ]
  },
  'lts-content': {
    indicators: [
      {
        parent: FILTER_NAMES.categories,
        parentId: 'id',
        id: 'category_ids'
      }
    ]
  },
  'net-zero-content': {
    indicators: [
      {
        parent: FILTER_NAMES.categories,
        parentId: 'id',
        id: 'category_ids'
      }
    ]
  },
  'emission-pathways': {
    scenarios: [
      {
        parent: 'models',
        idObject: 'model',
        id: 'id'
      }
    ],
    indicators: [
      {
        parent: FILTER_NAMES.categories,
        idObject: 'category',
        id: 'id'
      },
      {
        parent: 'scenarios',
        parentId: 'indicator_ids',
        id: 'id'
      }
    ]
  }
};
export const NON_COLUMN_KEYS = ['start_year', 'end_year'];

export const POSSIBLE_LABEL_FIELDS = [
  'label',
  'value',
  'name',
  'full_name',
  'wri_standard_name',
  'cw_title',
  'title',
  'slug',
  'number'
];

export const POSSIBLE_VALUE_FIELDS = [
  'slug',
  'id',
  'value',
  'iso_code3',
  'iso'
];

export const FIELD_ALIAS = {
  'historical-emissions': { 'data-sources': 'Data sources' },
  'ndc-sdg-linkages': { goals: 'sdg', targets: 'sdg_target' }
};

export const FILTERS_DATA_WITHOUT_MODEL = {
  'ndc-sdg-linkages': ['status', 'climate_response', 'type_of_information']
};

export const DATA_EXPLORER_TABLE_COLUMNS_WIDTH = {
  'historical-emissions': 100,
  'emission-pathways': 100
};


text:
<?xml version="1.0" encoding="utf-8"?>

<sect1 id="zend.dom.query">
    <title>Zend_Dom_Query</title>

    <para>
        <classname>Zend_Dom_Query</classname> fournit des mécanismes pour requêter dans les
        documents <acronym>XML</acronym> et (X)HTML en utilisant soit XPath ou les sélecteurs <acronym>CSS</acronym>. Il a été développé
        pour faciliter les tests fonctionnels des applications <acronym>MVC</acronym>, mais pourrait également être
        employé pour le développement rapide de "screen scrapers".
    </para>

    <para>
        La notation de type sélecteur <acronym>CSS</acronym> est fournie comme notation plus simple et plus
        familière pour les développeurs Web à utiliser lors de la requête de documents ayant une
        structure de type <acronym>XML</acronym>. La notation devrait être familière pour n'importe qui ayant écrit
        des feuilles de styles <acronym>CSS</acronym> ou ayant utiliser des librairies Javascript qui fournissent pour
        sélectionner des noeuds en utilisant des sélecteurs <acronym>CSS</acronym> (
        <ulink url="http://prototypejs.org/api/utility/dollar-dollar">Prototype's $$()</ulink>et
        <ulink url="http://api.dojotoolkit.org/jsdoc/dojo/HEAD/dojo.query">Dojo's
        dojo.query</ulink>ont tous les deux inspirer ce composant).
    </para>

    <sect2 id="zend.dom.query.operation">
        <title>Aspect théorique</title>

        <para>
            Pour utiliser <classname>Zend_Dom_Query</classname>, vous instanciez un objet
            <classname>Zend_Dom_Query</classname>, en fournissant optionnellement un document à
            analyser (sous la forme d'une chaîne). Une fois que vous avez un document, vous pouvez
            utiliser indifféremment les méthodes <methodname>query()</methodname> ou
            <methodname>queryXpath()</methodname> ; chaque méthode retournera un objet
            <classname>Zend_Dom_Query_Result</classname> avec tout noeud trouvé.
        </para>

        <para>
            La différence principale entre <classname>Zend_Dom_Query</classname> et
            l'utilisation de DOMDocument + DOMXPath est la possibilité de requêter avec les
            sélecteurs <acronym>CSS</acronym>. Vous pouvez utiliser n'importe quel élément suivant, dans n'importe
            quelle combinaison :
        </para>

        <itemizedlist>
            <listitem>
                <para>
                    <emphasis>types de l'élément</emphasis> : fourni un type d'élément à
                    rechercher : "div", "a", "span", "h2", etc.
                </para>
            </listitem>

            <listitem>
                <para>
                    <emphasis>attributs de style</emphasis> : les classes <acronym>CSS</acronym> à
                    rechercher : ".error", "div.error", "label.required", etc. Si un élément
                    défini plus qu'une classe, la correspondance sera trouvé si la classe est
                    présente quelque part dans la déclaration de l'attribut.
                </para>
            </listitem>

            <listitem>
                <para>
                    <emphasis>attribut id</emphasis> : ID de l'élément à rechercher :
                    "#content", "div#nav", etc.
                </para>
            </listitem>

            <listitem>
                <para>
                    <emphasis>attributs arbitraires</emphasis> : tout attribut arbitraire de
                    l'élément à rechercher. Trois types de recherche sont possibles :
                </para>

                <itemizedlist>
                    <listitem>
                        <para>
                            <emphasis>correspondance exacte</emphasis> : l'attribut vaut
                            exactement la chaîne fournie : "div[bar="baz"]" trouvera un élément div
                            qui possède un attribut "bar" dont la valeur vaut exactement
                            "baz".
                        </para>
                    </listitem>

                    <listitem>
                        <para>
                            <emphasis>correspondance de mot</emphasis> : l'attribut contient
                            un mot correspondant à la chaîne fournie : "div[bar~="baz"]"
                            trouvera un élément div qui possède un attribut "bar" dont la valeur
                            contient le mot "baz". "<div bar="foo baz">" trouvera, mais pas
                            "<div bar="foo bazbat">".
                        </para>
                    </listitem>

                    <listitem>
                        <para>
                            <emphasis>correspondance de parties de chaînes</emphasis> :
                            l'attribut contient la chaîne fournie : "div[bar*="baz"]" trouvera
                            un élément div qui possède un attribut "bar" dont la valeur contient la
                            chaîne "baz".
                        </para>
                    </listitem>
                </itemizedlist>
            </listitem>

            <listitem>
                <para>
                    <emphasis>Descendants directs</emphasis> : utilise ">" entre les
                    sélecteurs pour représenter une descendance direct. "div > span" trouvera
                    seulement les éléments "span" qui sont des descendants directs d'un élément
                    "div". Peut aussi être utilisé avec chacun des sélecteurs ci-dessus.
                </para>

            </listitem>

            <listitem>
                <para>
                    <emphasis>Descendants</emphasis> : une chaîne avec des sélecteurs
                    multiples ensemble pour indiquer hiérarchie à rechercher. "div .foo span #one"
                    trouvera un élément avec un id "one" qui est un descendant avec un profondeur
                    arbitraire d'un élément "span", qui est lui-même un descendant avec un
                    profondeur arbitraire d'un élément ayant une classe "foo", qui est un
                    descendant avec un profondeur arbitraire d'un élément "div". Par exemple, il
                    trouvera le lien vers le mot "One" dans le code ci-dessous :
                </para>

                <programlisting language="html"><![CDATA[

                    Lorem ipsum
                        One
                        Two
                        Three
                        Four

]]></programlisting>

            </listitem>

        </itemizedlist>

        <para>
            Une fois que vous avez réalisé votre recherche, vous pouvez ensuite travailler
            avec l'objet de résultat pour déterminer les informations sur les noeuds, ainsi que
            pour les récupérer eux et/ou leurs contenus directement afin de les examiner et les
            manipuler. <classname>Zend_Dom_Query_Result</classname> implémente
            Countable and Iterator, et stocke le résultat en interne sous
            la forme DOMNodes/DOMElements. En exemple, considérons l'appel suivant sur l'HTML
            ci-dessus :
        </para>

        <programlisting language="php"><![CDATA[
$dom = new Zend_Dom_Query($html);
$results = $dom->query('.foo .bar a');

$count = count($results);    // trouvera 4 correspondances
foreach ($results as $result) {
    // $result is a DOMElement
}
]]></programlisting>

        <para>
            <classname>Zend_Dom_Query</classname> permet aussi de faire directement des
            recherches de type XPath en utilisant la méthode <methodname>queryXpath()</methodname> ; vous
            pouvez fournir toute requête XPath valide à cette méthode, et elle retournera un objet
            <classname>Zend_Dom_Query_Result</classname>.
        </para>

    </sect2>

    <sect2 id="zend.dom.query.methods">
        <title>Méthodes disponibles</title>

        <para>
            La famille des classes <classname>Zend_Dom_Query</classname> possèdent les
            méthodes suivantes.
        </para>

        <sect3 id="zend.dom.query.methods.zenddomquery">
            <title>Zend_Dom_Query</title>

            <para>
                Ces méthodes sont disponibles pour <classname>Zend_Dom_Query</classname> :
            </para>

            <itemizedlist>
                <listitem>
                    <para>
                        <methodname>setDocumentXml($document)</methodname> : spécifie une chaîne <acronym>XML</acronym> dans
                        laquelle requêter.
                    </para>
                </listitem>

                <listitem>
                    <para>
                        <methodname>setDocumentXhtml($document)</methodname> : spécifie une chaîne <acronym>XHTML</acronym>
                        dans laquelle requêter.
                    </para>
                </listitem>

                <listitem>
                    <para>
                        <methodname>setDocumentHtml($document)</methodname> : spécifie une chaîne HTML
                        dans laquelle requêter.
                    </para>
                </listitem>

                <listitem>
                    <para>
                        <methodname>setDocument($document)</methodname> : spécifie une chaîne dans
                        laquelle requêter ; <classname>Zend_Dom_Query</classname> tentera
                        alors de détecter automatiquement le type de document.
                    </para>
                </listitem>

                <listitem>
                    <para>
                        <methodname>getDocument()</methodname> : récupère le document original fourni à
                        l'objet.
                    </para>
                </listitem>

                <listitem>
                    <para>
                        <methodname>getDocumentType()</methodname> : récupère le type de document fourni à
                        l'objet ; sera une des constantes de classe :
                        <constant>DOC_XML</constant>, <constant>DOC_XHTML</constant>, ou <constant>DOC_HTML</constant>.
                    </para>
                </listitem>

                <listitem>
                    <para>
                        <methodname>query($query)</methodname> : recherche dans le document en utilisant
                        la notation de type sélecteur <acronym>CSS</acronym>.
                    </para>
                </listitem>

                <listitem>
                    <para>
                        <methodname>queryXpath($xPathQuery)</methodname> : recherche dans le document en
                        utilisant la notation XPath.
                    </para>
                </listitem>
            </itemizedlist>
        </sect3>

        <sect3 id="zend.dom.query.methods.zenddomqueryresult">
            <title>Zend_Dom_Query_Result</title>

            <para>
                Comme mentionné auparavant, <classname>Zend_Dom_Query_Result</classname>
                implémente à la fois Iterator et Countable, et en tant
                que tel peut être utilisé dans une boucle foreach ainsi qu'avec la
                fonction <methodname>count()</methodname>. De plus il expose les méthodes suivantes :
            </para>

            <itemizedlist>
                <listitem>
                    <para>
                        <methodname>getCssQuery()</methodname> : retourne le sélecteur <acronym>CSS</acronym> utilisé pour
                        produire le résultat (si fourni).
                    </para>
                </listitem>

                <listitem>
                    <para>
                        <methodname>getXpathQuery()</methodname> : retourne la requête XPath utilisé pour
                        produire le résultat, <classname>Zend_Dom_Query</classname> convertit les
                        recherches de type sélecteur <acronym>CSS</acronym> en notation XPath, donc cette valeur sera
                        toujours présente.
                    </para>
                </listitem>

                <listitem>
                    <para>
                        <methodname>getDocument()</methodname> : récupère l'élément DOMDocument dans
                        lequel la recherche à été effectuée.
                    </para>
                </listitem>
            </itemizedlist>
        </sect3>
    </sect2>
</sect1>


text:
#ifndef _FATFILE_H
#define _FATFILE_H

#include <sys/stat.h>
#include <io/fat.h>

#include "common.h"
#include "partition.h"
#include "directory.h"

/*
Synchronizes the file data to disc.
Does no locking of its own -- lock the partition before calling.
Returns 0 on success, an error code on failure.
*/
extern int FAT_syncToDisc (FILE_STRUCT* file);

#endif // _FATFILE_H


text:
import { DimItem } from 'app/inventory/item-types';
import styles from './ItemPop.m.scss';

/**
 * Cross browser safe scrollTo implementation.
 */
export function scrollToPosition(options: ScrollToOptions) {
  const isSmoothScrollSupported = 'scrollBehavior' in document.documentElement.style;
  if (isSmoothScrollSupported) {
    window.scroll(options);
  } else {
    document.scrollingElement!.scrollTop = options.top!;
  }
}

/**
 * Scroll a particular element to the top of the view.
 */
export function scrollToElement(elem: Element | null) {
  if (elem) {
    const headerHeight = parseInt(
      document.querySelector('html')!.style.getPropertyValue('--header-height'),
      10
    );
    const rect = elem.getBoundingClientRect();
    scrollToPosition({
      top: window.scrollY + rect.top - (headerHeight + 6),
      left: 0,
      behavior: 'smooth',
    });
  }
}

/**
 * An event handler for link (a) elements which scrolls the window until the element whose ID matches
 * the hash of the link is in view.
 */
export function scrollToHref(e: React.MouseEvent) {
  e.preventDefault();
  const elem = document.getElementById((e.currentTarget as HTMLAnchorElement).hash.slice(1));
  scrollToElement(elem);
}

/**
 * Scroll to an item tile and make it briefly zoom/wobble for attention
 */
export const itemPop = (item: DimItem) => {
  // TODO: this is tough to do with an ID since we'll have multiple
  const element = document.getElementById(item.index)?.parentNode as HTMLElement;
  if (!element) {
    throw new Error(`No element with id ${item.index}`);
  }
  const elementRect = element.getBoundingClientRect();
  const html = document.querySelector('html')!;
  const headerHeight = parseInt(html.style.getPropertyValue('--header-height'), 10);
  const storeHeaderHeight = parseInt(html.style.getPropertyValue('--store-header-height'), 10);
  const absoluteElementTop = elementRect.top + window.pageYOffset;
  scrollToPosition({ left: 0, top: absoluteElementTop - (headerHeight + storeHeaderHeight + 24) });
  element.classList.add(styles.itemPop);

  const removePop = () => {
    element.classList.remove(styles.itemPop);
    for (const event of ['webkitAnimationEnd', 'oanimationend', 'msAnimationEnd', 'animationend']) {
      element.removeEventListener(event, removePop);
    }
  };

  for (const event of ['webkitAnimationEnd', 'oanimationend', 'msAnimationEnd', 'animationend']) {
    element.addEventListener(event, removePop);
  }
};


text:
export * from './admincontroller'
export * from './controller'
export * from './dtos'
export * from './entity'
export * from './guard'
export * from './module'
export * from './pipe'
export * from './repository'
export * from './service'


text:
"""
Functionality for disassmebling code at an address, or at an
address +/- a few instructions.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

import collections

import capstone
import gdb
from capstone import *

import pwndbg.arch
import pwndbg.disasm.arch
import pwndbg.ida
import pwndbg.jump
import pwndbg.memoize
import pwndbg.memory
import pwndbg.symbol

try:
    import pwndbg.emu.emulator
except:
    pwndbg.emu = None

disassembler = None
last_arch    = None

CapstoneArch = {
    'arm': CS_ARCH_ARM,
    'aarch64': CS_ARCH_ARM64,
    'i386': CS_ARCH_X86,
    'x86-64': CS_ARCH_X86,
    'powerpc': CS_ARCH_PPC,
    'mips': CS_ARCH_MIPS,
    'sparc': CS_ARCH_SPARC,
}

CapstoneEndian = {
    'little': CS_MODE_LITTLE_ENDIAN,
    'big': CS_MODE_BIG_ENDIAN,
}

CapstoneMode = {
    4: CS_MODE_32,
    8: CS_MODE_64
}

# For variable-instruction-width architectures
# (x86 and amd64), we keep a cache of instruction
# sizes, and where the end of the instruction falls.
#
# This allows us to consistently disassemble backward.
VariableInstructionSizeMax = {
    'i386':   16,
    'x86-64': 16,
    'mips':   8,
}

backward_cache = collections.defaultdict(lambda: None)

@pwndbg.memoize.reset_on_objfile
def get_disassembler_cached(arch, ptrsize, endian, extra=None):
    arch = CapstoneArch[arch]

    if extra is None:
        mode = CapstoneMode[ptrsize]
    else:
        mode = extra

    mode |= CapstoneEndian[endian]

    cs = Cs(arch, mode)
    cs.detail = True
    return cs

def get_disassembler(pc):
    extra = None

    if pwndbg.arch.current in ('arm', 'aarch64'):
        extra = {0:CS_MODE_ARM,
                 0x20:CS_MODE_THUMB}[pwndbg.regs.cpsr & 0x20]

    return get_disassembler_cached(pwndbg.arch.current,
                                   pwndbg.arch.ptrsize,
                                   pwndbg.arch.endian,
                                   extra)

@pwndbg.memoize.reset_on_cont
def get_one_instruction(address):
    md   = get_disassembler(address)
    size = VariableInstructionSizeMax.get(pwndbg.arch.current, 4)
    data = pwndbg.memory.read(address, size, partial=True)
    for ins in md.disasm(bytes(data), address, 1):
        pwndbg.disasm.arch.DisassemblyAssistant.enhance(ins)
        return ins

def one(address=None):
    if address is None:
        address = pwndbg.regs.pc
    if not pwndbg.memory.peek(address):
        return None
    for insn in get(address, 1):
        backward_cache[insn.next] = insn.address
        return insn

def fix(i):
    for op in i.operands:
        if op.type == CS_OP_IMM and op.va:
            i.op_str = i.op_str.replace()

    return i

def get(address, instructions=1):
    address = int(address)

    # Dont disassemble if there's no memory
    if not pwndbg.memory.peek(address):
        return []

    retval = []
    for _ in range(instructions):
        i = get_one_instruction(address)
        if i is None:
            break
        address = i.next
        retval.append(i)

    return retval

# These instruction types should not be emulated through, either
# because they cannot be emulated without interfering (syscall, etc.)
# or because they may take a long time (call, etc.), or because they
# change privilege levels.
DO_NOT_EMULATE = {
    capstone.CS_GRP_CALL,
    capstone.CS_GRP_INT,
    capstone.CS_GRP_INVALID,
    capstone.CS_GRP_IRET,

# Note that we explicitly do not include the PRIVILEGE category, since
# we may be in kernel code, and privileged instructions are just fine
# in that case.
#    capstone.CS_GRP_PRIVILEGE,
}

def near(address, instructions=1, emulate=False):

    current = one(address)

    pc = pwndbg.regs.pc

    if current is None or not pwndbg.memory.peek(address):
        return []

    # Try to go backward by seeing which instructions we've returned
    # before, which were followed by this one.
    needle = address
    insns  = []
    cached = backward_cache[current.address]
    insn   = one(cached) if cached else None
    while insn is not None and len(insns) < instructions:
        insns.append(insn)
        cached = backward_cache[insn.address]
        insn = one(cached) if cached else None
    insns.reverse()

    insns.append(current)

    # Some architecture aren't emulated yet
    if not pwndbg.emu or pwndbg.arch.current not in pwndbg.emu.emulator.arch_to_UC:
        emulate = False

    # Emulate forward if we are at the current instruction.
    emu = None

    # If we hit the current instruction, we can do emulation going forward from there.
    if address == pc and emulate:
        emu = pwndbg.emu.emulator.Emulator()

        # For whatever reason, the first instruction is emulated twice.
        # Skip the first one here.
        emu.single_step()

    # Now find all of the instructions moving forward.
    #
    # At this point, we've already added everything *BEFORE* the requested address,
    # and the instruction at 'address'.
    insn  = current
    total_instructions = 1+(2*instructions)

    while insn and len(insns) < total_instructions:
        target = insn.target

        # Disable emulation if necessary
        if emulate and set(insn.groups) & DO_NOT_EMULATE:
            emulate = False
            emu     = None

        # Continue disassembling after a RET or JUMP, but don't follow through CALL.
        if capstone.CS_GRP_CALL in insn.groups:
            target = insn.next

        # If we initialized the emulator and emulation is still enabled, we can use it
        # to figure out the next instruction.
        elif emu:
            target_candidate, size_candidate = emu.single_step()

            if None not in (target_candidate, size_candidate):
                target = target_candidate
                size   = size_candidate

        # Continue disassembling at the *next* instruction unless we have emulated
        # the path of execution.
        elif target != pc:
            target = insn.next

        insn = one(target)
        if insn:
            insns.append(insn)

    # Remove repeated instructions at the end of disassembly.
    # Always ensure we display the current and *next* instruction,
    # but any repeats after that are removed.
    #
    # This helps with infinite loops and RET sleds.
    while insns and len(insns) > 2 and len(set(insns[-3:])) == 1:
        del insns[-1]

    return insns


text:
import React from 'react';
import { convertReactProps } from './convertReactProps';

/**
 * Check if the target is a ReactElement.
 * @param target The reference to check.
 */
function isReactNode(target: any): target is React.ReactElement {
    return typeof target === 'object' && target.$$typeof && target.$$typeof.toString() === 'Symbol(react.element)';
}

function isComponentFunction(target: any): target is React.FunctionComponent {
    return typeof target === 'function' && !(target.prototype instanceof React.Component);
}

export type ReferencesMap = Array<[React.RefObject<unknown>, any]>;

/**
 * Wrap React children with fragments in order to always use HTMLElement methods like appendChild and insertBefore.
 * In DNA components those methods are overridden in order to handle slot children.
 * @param children A list of React nodes to convert.
 * @return A list of converted nodes.
 */
export function convertReactNodes(children: React.ReactNode | React.ReactNode[], context: React.Context<unknown>): { children: React.ReactNode[]; references: ReferencesMap} {
    let nodes = children as React.ReactNode[];
    if (!Array.isArray(nodes)) {
        nodes = [nodes];
    }
    let references: ReferencesMap = [];
    return {
        references,
        children: nodes.map((child) => {
            if (!isReactNode(child)) {
                return React.createElement(React.Fragment, null, child);
            }
            if (isComponentFunction(child.type)) {
                let { children, references: childReferences } = convertReactNodes(child.type(child.props, context), context);
                if (children.length === 1) {
                    children = children[0] as React.ReactNode[];
                }
                references.push(...childReferences);
                return React.createElement(React.Fragment, null, children);
            }

            let ref: React.RefObject<unknown>|null = (child as any).ref || React.createRef();
            references.push([ref as React.RefObject<unknown>, child.props]);

            if (child.props.children) {
                let { children, references: childReferences } = convertReactNodes(child.props.children, context);
                references.push(...childReferences);
                return {
                    ...child,
                    ref,
                    props: {
                        ...convertReactProps(child.props, false),
                        children: React.createElement(React.Fragment, null, ...children),
                    },
                };
            }
            return {
                ...child,
                ref,
                props: convertReactProps(child.props, false),
            };
        }),
    };
}


text:
package magic.yuyong.activity;

import java.text.DateFormat;
import java.util.Date;

import magic.yuyong.R;
import magic.yuyong.app.AppConstant;
import magic.yuyong.app.MagicApplication;
import magic.yuyong.persistence.AccessTokenKeeper;
import magic.yuyong.persistence.Persistence;
import magic.yuyong.service.NotificationService;
import magic.yuyong.util.Debug;

import org.json.JSONException;
import org.json.JSONObject;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.animation.Animation;
import android.view.animation.TranslateAnimation;
import android.widget.TextView;
import android.widget.Toast;

import com.sina.weibo.sdk.auth.AuthInfo;
import com.sina.weibo.sdk.auth.Oauth2AccessToken;
import com.sina.weibo.sdk.auth.WeiboAuthListener;
import com.sina.weibo.sdk.auth.sso.SsoHandler;
import com.sina.weibo.sdk.exception.WeiboException;
import com.sina.weibo.sdk.net.RequestListener;
import com.sina.weibo.sdk.openapi.legacy.AccountAPI;

public class MainActivity extends BaseActivity implements OnClickListener,
		WeiboAuthListener {
	private TextView login_but;
	private View content;
	private View clouds_1, clouds_2, clouds_3, clouds_4, clouds_5;
	private boolean has_check_update = false;
	private SsoHandler mSsoHandler;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		actionBar.hide();
		actionBar.setSplitBackgroundDrawable(getResources().getDrawable(
				R.color.theme_color));
		setContentView(R.layout.main);

		content = findViewById(R.id.content);
		login_but = (TextView) this.findViewById(R.id.login_but);
		login_but.setOnClickListener(this);
		clouds_1 = findViewById(R.id.clouds_1);
		clouds_2 = findViewById(R.id.clouds_2);
		clouds_3 = findViewById(R.id.clouds_3);
		clouds_4 = findViewById(R.id.clouds_4);
		clouds_5 = findViewById(R.id.clouds_5);

		Debug.v("token == null ? "
				+ (MagicApplication.getInstance().getAccessToken() == null));
		checkToken();
	}

	@Override
	protected void onStart() {
		super.onStart();
		cloudsFlutter();
	}

	@Override
	protected void onStop() {
		super.onStop();
		cloudsStop();
	}

	private Animation getAnimation(int duration) {
		Animation a = new TranslateAnimation(Animation.RELATIVE_TO_PARENT,
				-0.95f, Animation.RELATIVE_TO_PARENT, 1,
				Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 0);
		a.setDuration(duration);
		a.setRepeatCount(Integer.MAX_VALUE);
		return a;
	}

	private void cloudsFlutter() {
		clouds_1.startAnimation(getAnimation(20000));
		clouds_2.startAnimation(getAnimation(37000));
		clouds_3.startAnimation(getAnimation(15000));
		clouds_4.startAnimation(getAnimation(18000));
		clouds_5.startAnimation(getAnimation(30000));
	}

	private void cloudsStop() {
		clouds_1.clearAnimation();
		clouds_2.clearAnimation();
		clouds_3.clearAnimation();
		clouds_4.clearAnimation();
		clouds_5.clearAnimation();
	}

	private void checkToken() {
		if (MagicApplication.getInstance().getAccessToken() != null
				&& MagicApplication.getInstance().getAccessToken()
						.isSessionValid()) {

			Date expiresTime = new Date(MagicApplication.getInstance()
					.getAccessToken().getExpiresTime());
			String s = DateFormat.getDateInstance().format(expiresTime);
			Debug.v(MagicApplication.getInstance().getAccessToken().toString()
					+ " , expiresTime : " + s);

			startNotificationService();
			chooseMode();
		} else {
			has_check_update = true;
		}
	}

	private void startNotificationService() {
		if (Persistence.isReceiveNotification(getApplicationContext())) {
			Intent service = new Intent(getApplicationContext(),
					NotificationService.class);
			startService(service);
		}
	}

	private void chooseMode() {
		Class activityClass = null;
		if (Persistence.isTimeLineMode(getApplicationContext())) {
			activityClass = TimeLineModeActivity.class;
		} else {
			activityClass = TwitterBoardActivity.class;
		}

		Intent intent = new Intent(getApplicationContext(), activityClass);
		intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
		intent.putExtra("check_update", !has_check_update);
		startActivity(intent);
		finish();
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.login_but:
			if (MagicApplication.getInstance().getAccessToken() != null
					&& MagicApplication.getInstance().getAccessToken()
							.isSessionValid()) {
				chooseMode();
			} else {
				AuthInfo mAuthInfo = new AuthInfo(this,
						AppConstant.CONSUMER_KEY, AppConstant.REDIRECT_URL,
						AppConstant.SCOPE);
				mSsoHandler = new SsoHandler(this, mAuthInfo);
				mSsoHandler.authorize(this);
			}
			break;
		}
	}

	@Override
	public void onCancel() {
	}

	@Override
	protected void onActivityResult(int requestCode, int resultCode, Intent data) {
		super.onActivityResult(requestCode, resultCode, data);

		// SSO 授权回调
		// 重要:发起 SSO 登陆的 Activity 必须重写 onActivityResult
		if (mSsoHandler != null) {
			mSsoHandler.authorizeCallBack(requestCode, resultCode, data);
		}
	}

	@Override
	public void onComplete(Bundle values) {
		// 从 Bundle 中解析 Token
		Oauth2AccessToken mAccessToken = Oauth2AccessToken
				.parseAccessToken(values);
		if (mAccessToken.isSessionValid()) {
			// 保存 Token 到 SharedPreferences
			AccessTokenKeeper.writeAccessToken(this, mAccessToken);
			MagicApplication.getInstance().setAccessToken(mAccessToken);
			startNotificationService();
			chooseMode();

			AccountAPI accountAPI = new AccountAPI(getApplicationContext(), AppConstant.CONSUMER_KEY, MagicApplication.getInstance().getAccessToken());
			accountAPI.getUid(new RequestListener() {

				@Override
				public void onWeiboException(WeiboException arg0) {
					// TODO Auto-generated method stub

				}

				@Override
				public void onComplete(String response) {
					try {
						JSONObject obj = new JSONObject(response);
						long id = obj.getLong("uid");
						Persistence.setUID(getApplicationContext(), id);
					} catch (JSONException e) {
						e.printStackTrace();
					}
				}
			});
		} else {
			Toast.makeText(this, R.string.text_token_invalid, Toast.LENGTH_LONG)
					.show();
		}
	}

	@Override
	public void onWeiboException(WeiboException e) {
		Toast.makeText(getApplicationContext(),
				"Auth exception : " + e.getMessage(), Toast.LENGTH_LONG).show();
	}
}


text:
package org.apache.catalina;

/**
 * Global constants that are applicable to multiple packages within Catalina.
 *
 * @author Craig R. McClanahan
 * @version $Revision: 1.44 $ $Date: 2002/09/23 00:16:35 $
 */

public final class Globals {

    /**
     * The request attribute under which we store the array of X509Certificate
     * objects representing the certificate chain presented by our client,
     * if any.
     */
    public static final String CERTIFICATES_ATTR =
        "javax.servlet.request.X509Certificate";

    /**
     * SSL Certificate Request Attributite.
     */
    public static final String SSL_CERTIFICATE_ATTR = "org.apache.coyote.request.X509Certificate";

    /**
     * The request attribute under which we store the name of the cipher suite
     * being used on an SSL connection (as an object of type
     * java.lang.String).
     */
    public static final String CIPHER_SUITE_ATTR =
        "javax.servlet.request.cipher_suite";

    /**
     * The servlet context attribute under which we store the class loader
     * used for loading servlets (as an object of type java.lang.ClassLoader).
     */
    public static final String CLASS_LOADER_ATTR =
        "org.apache.catalina.classloader";

    /**
     * The JNDI directory context which is associated with the context. This
     * context can be used to manipulate static files.
     */
    public static final String RESOURCES_ATTR =
        "org.apache.catalina.resources";

    /**
     * The servlet context attribute under which we store the class path
     * for our application class loader (as an object of type String),
     * delimited with the appropriate path delimiter for this platform.
     */
    public static final String CLASS_PATH_ATTR =
        "org.apache.catalina.jsp_classpath";

    /**
     * The request attribute under which the original context path is stored
     * on an included dispatcher request.
     */
    public static final String CONTEXT_PATH_ATTR =
        "javax.servlet.include.context_path";

    /**
     * The request attribute under which we forward a Java exception
     * (as an object of type Throwable) to an error page.
     */
    public static final String EXCEPTION_ATTR =
        "javax.servlet.error.exception";

    /**
     * The request attribute under which we forward the request URI
     * (as an object of type String) of the page on which an error occurred.
     */
    public static final String EXCEPTION_PAGE_ATTR =
        "javax.servlet.error.request_uri";

    /**
     * The request attribute under which we forward a Java exception type
     * (as an object of type Class) to an error page.
     */
    public static final String EXCEPTION_TYPE_ATTR =
        "javax.servlet.error.exception_type";

    /**
     * The request attribute under which we forward an HTTP status message
     * (as an object of type STring) to an error page.
     */
    public static final String ERROR_MESSAGE_ATTR =
        "javax.servlet.error.message";

    /**
     * The request attribute under which the Invoker servlet will store
     * the invoking servlet path, if it was used to execute a servlet
     * indirectly instead of through a servlet mapping.
     */
    public static final String INVOKED_ATTR =
        "org.apache.catalina.INVOKED";

    /**
     * The request attribute under which we expose the value of the
     * <jsp-file> value associated with this servlet,
     * if any.
     */
    public static final String JSP_FILE_ATTR =
        "org.apache.catalina.jsp_file";

    /**
     * The request attribute under which we store the key size being used for
     * this SSL connection (as an object of type java.lang.Integer).
     */
    public static final String KEY_SIZE_ATTR =
        "javax.servlet.request.key_size";

    /**
     * The servlet context attribute under which the managed bean Registry
     * will be stored for privileged contexts (if enabled).
     */
    public static final String MBEAN_REGISTRY_ATTR =
        "org.apache.catalina.Registry";

    /**
     * The servlet context attribute under which the MBeanServer will be stored
     * for privileged contexts (if enabled).
     */
    public static final String MBEAN_SERVER_ATTR =
        "org.apache.catalina.MBeanServer";

    /**
     * The request attribute under which we store the servlet name on a
     * named dispatcher request.
     */
    public static final String NAMED_DISPATCHER_ATTR =
        "org.apache.catalina.NAMED";

    /**
     * The request attribute under which the original path info is stored
     * on an included dispatcher request.
     */
    public static final String PATH_INFO_ATTR =
        "javax.servlet.include.path_info";

    /**
     * The request attribute under which the original query string is stored
     * on an included dispatcher request.
     */
    public static final String QUERY_STRING_ATTR =
        "javax.servlet.include.query_string";

    /**
     * The request attribute under which the original request URI is stored
     * on an included dispatcher request.
     */
    public static final String REQUEST_URI_ATTR =
        "javax.servlet.include.request_uri";

    /**
     * The request attribute under which we forward a servlet name to
     * an error page.
     */
    public static final String SERVLET_NAME_ATTR =
        "javax.servlet.error.servlet_name";

    /**
     * The request attribute under which the original servlet path is stored
     * on an included dispatcher request.
     */
    public static final String SERVLET_PATH_ATTR =
        "javax.servlet.include.servlet_path";

    /**
     * The name of the cookie used to pass the session identifier back
     * and forth with the client.
     */
    public static final String SESSION_COOKIE_NAME = "JSESSIONID";

    /**
     * The name of the path parameter used to pass the session identifier
     * back and forth with the client.
     */
    public static final String SESSION_PARAMETER_NAME = "jsessionid";

    /**
     * The request attribute under which we forward an HTTP status code
     * (as an object of type Integer) to an error page.
     */
    public static final String STATUS_CODE_ATTR =
        "javax.servlet.error.status_code";

    /**
     * The servlet context attribute under which we record the set of
     * welcome files (as an object of type String[]) for this application.
     */
    public static final String WELCOME_FILES_ATTR =
        "org.apache.catalina.WELCOME_FILES";

    /**
     * The servlet context attribute under which we store a temporary
     * working directory (as an object of type File) for use by servlets
     * within this web application.
     */
    public static final String WORK_DIR_ATTR =
        "javax.servlet.context.tempdir";

}


text:
<?php
/**
 * File was created 30.05.2015 13:16
 *
 * @author Karsten J. Gerber <kontakt@karsten-gerber.de>
 */

namespace PeekAndPoke\Component\Psi\Psi;

use PeekAndPoke\Component\Psi\Stubs\UnitTestToString;
use PHPUnit\Framework\TestCase;

/**
 * @author Karsten J. Gerber <kontakt@karsten-gerber.de>
 */
class IsNumericIsNotNumericTest extends TestCase
{
    /**
     * @param $psiValue
     * @param $expectedResult
     *
     * @dataProvider provide
     */
    public function testIsNumeric($psiValue, $expectedResult)
    {
        $subject = new IsNumeric();
        $result  = $subject->__invoke($psiValue);

        $this->assertSame($expectedResult, $result);

        // deprecated
        /** @noinspection PhpDeprecationInspection */
        $subject = new \PeekAndPoke\Component\Psi\Functions\Unary\TypeCheck\IsNumeric();
        $result  = $subject->__invoke($psiValue);

        $this->assertSame($expectedResult, $result);
    }

    /**
     * @param $psiValue
     * @param $expectedResult
     *
     * @dataProvider provide
     */
    public function testIsNotNumeric($psiValue, $expectedResult)
    {
        $expectedResult = ! $expectedResult;

        $subject = new IsNotNumeric();
        $result  = $subject->__invoke($psiValue);

        $this->assertSame($expectedResult, $result);

        // deprecated
        /** @noinspection PhpDeprecationInspection */
        $subject = new \PeekAndPoke\Component\Psi\Functions\Unary\TypeCheck\IsNotNumeric();
        $result  = $subject->__invoke($psiValue);

        $this->assertSame($expectedResult, $result);
    }

    /**
     * @return array
     */
    public static function provide()
    {
        return [
            // positives
            [0, true],
            [1.0, true],
            [(int) 1.0, true],
            [1.0, true],
            ['0', true],
            ['1.0', true],
            ['123', true],

            // negatives
            [null, false],
            ['z0', false],
            ['0z', false],
            [new \ArrayIterator(), false],
            [true, false],
            [false, false],
            ['Z', false],
            [new UnitTestToString(1), false],
        ];
    }
}


text:
namespace physx
{
#endif

	PX_INLINE void PxStrcpy(char* dest, size_t size, const char* src) {::strcpy_s(dest, size, src);}
	PX_INLINE void PxStrcat(char* dest, size_t size, const char* src) {::strcat_s(dest, size, src);}
	PX_INLINE PxI32 PxVsprintf(char* dest, size_t size, const char* src, va_list arg)
	{
		PxI32 r = ::vsprintf_s(dest, size, src, arg);

		return r;
	}
	PX_INLINE PxI32 PxStricmp(const char *str, const char *str1) {return(::_stricmp(str, str1));}

#ifndef PX_DOXYGEN
} // namespace physx
#endif

#pragma warning(pop)

#endif


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Mem. Amer. Acad. Arts, ser. 2 16(1): 265 (1931)

#### Original name
Scaphidiomyces baeoceridii Thaxt., 1931

### Remarks
null


text:
<?php

namespace App\Presenters\Scripts;

interface Loader
{
    /**
     * Load the required link of script.
     *
     * @param string $script
     *
     * @return array|null
     */
    public function get($script);

    /**
     * Check if script record exists
     *
     * @param string $script
     *
     * @return bool
     */
    public function know($script);
}


text:
<!DOCTYPE html>

        <meta charset="UTF-8" />
        <meta name="robots" content="index, follow, all" />
        <title>OpenTribes\Core\Context\Player\CreateNewCity | </title>
                    <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css">

Classes

Namespaces

Interfaces

Traits

Index

Class

OpenTribes\Core\Context\Player\CreateNewCity

    class
    CreateNewCity

Description of CreateNewCity

Methods

                    __construct(City $cityRepository, MapTiles $mapTilesRepository, User $userRepository, LocationCalculator $locationCalculator)

                    process(CreateNewCity $request, CreateNewCity $response)

Details

at line 31

                    public
    __construct(City $cityRepository, MapTiles $mapTilesRepository, User $userRepository, LocationCalculator $locationCalculator)

Parameters

                City
                $cityRepository

                MapTiles
                $mapTilesRepository

                User
                $userRepository

                LocationCalculator
                $locationCalculator

at line 38

                    public
    process(CreateNewCity $request, CreateNewCity $response)

Parameters

                CreateNewCity
                $request

                CreateNewCity
                $response

        Generated by Sami, the API Documentation Generator.


text:
<?php

namespace Mickadoo\SearchBundle\Exception;

class MappingNotFoundException extends \Exception
{
    /**
     * @var string
     */
    protected $message = 'No mapping for that field';
}


text:
package fr.rss.download.api.controller.impl;

import java.util.List;

import org.apache.commons.lang3.math.NumberUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestParam;

import fr.rss.download.api.constantes.LANGUE;
import fr.rss.download.api.constantes.QUALITE;
import fr.rss.download.api.controller.ITvShowApiController;
import fr.rss.download.api.exceptions.ApiException;
import fr.rss.download.api.model.zt.tvshow.TVShow;
import fr.rss.download.api.service.ITvShowService;
import io.swagger.annotations.ApiParam;

@CrossOrigin(origins = { "http://localhost:4200", "http://192.168.1.2:4200" })
@Controller
public class TvShowApiControllerImpl implements ITvShowApiController {

	private static final Logger log = LoggerFactory.getLogger(TvShowApiControllerImpl.class);

	@Autowired
	private ITvShowService tvShowService;

	@Override
	public ResponseEntity<List<TVShow>> addTvShow(
			@ApiParam(value = "Nom de la serie TV", required = true) @RequestParam("tvShowName") String tvShowName,
			@ApiParam(value = "Qualité (HDTV, HD720P, HD1080P)", required = true, defaultValue = "HD720P") @RequestParam("qualite") String qualite,
			@ApiParam(value = "Langue (VOSTFR, FRENCH, MULTI, ...)", required = true, defaultValue = "VOSTFR") @RequestParam("langue") String langue,
			@ApiParam(value = "Numero de la saison (1, 2, 3, ...)", required = true) @RequestParam("saison") String saison,
			@ApiParam(value = "Lien de la page ZT de la saison", required = true) @RequestParam("link") String link) throws ApiException {

		if (StringUtils.isEmpty(tvShowName)
				|| StringUtils.isEmpty(qualite)
				|| StringUtils.isEmpty(langue)
				|| StringUtils.isEmpty(saison)
				|| StringUtils.isEmpty(link)) {
			throw new ApiException(HttpStatus.BAD_REQUEST, "Tous les paramètres doivent être renseignés");
		}

		tvShowName = tvShowName.replace("\"", "");
		qualite = qualite.replace("\"", "");
		langue = langue.replace("\"", "");
		saison = saison.replace("\"", "");
		link = link.replace("\"", "");

		if (!NumberUtils.isCreatable(saison)) {
			throw new ApiException(HttpStatus.BAD_REQUEST, "La saison doit être un nombre");
		}

		QUALITE qual = QUALITE.valueOf(qualite.toUpperCase());
		LANGUE lang = LANGUE.valueOf(langue.toUpperCase());
		tvShowName = tvShowName.toUpperCase();

		log.debug("Paramètres : Name = {} - Qualite = {} - Langue = {} - Saison = {} - Lien = {}", tvShowName, qual, lang, saison, link);

		List<TVShow> res = tvShowService.ajouterSerieFichier(tvShowName, qual, lang, saison, link);

		return new ResponseEntity<List<TVShow>>(res, HttpStatus.OK);
	}

	@Override
	public ResponseEntity<List<TVShow>> getTvShow() throws ApiException {
		List<TVShow> res = tvShowService.recupererTvShowList();

		return new ResponseEntity<List<TVShow>>(res, HttpStatus.OK);
	}
}


text:
en.extend(en.Stage, en.Base);
en.extend(en.Object, en.Base);
en.extend(en.Weapon, en.Base);
en.extend(en.Projectile, en.Object);
en.extend(en.Entity, en.Object);
en.extend(en.Spaceship, en.Entity);
en.extend(en.Player, en.Spaceship);