text:
/**
@header patch_61_62_h - external_db.db_name_release_idx

@desc   Add unique index to db_name field in external_db table.
*/

CREATE UNIQUE INDEX db_name_release_idx ON external_db(db_name, db_release);

# Patch identifier
INSERT INTO meta (species_id, meta_key, meta_value)
  VALUES (NULL, 'patch', 'patch_61_62_h.sql|external_db.db_name_release_idx');

redpajama_set_name: RedPajamaGithub


text:
<meta content="text/html;charset=utf-8" http-equiv="Content-Type"/>
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
<meta content="IE=edge" http-equiv="X-UA-Compatible"/>
<title>

 SUNY Upstate Medical University</title>
<system-page-meta-keywords/>
<system-page-meta-description/>

Menu Skip to Content

Content <system-region name="DEFAULT"/>

Top


text:
"""
Copyright 2017 Alex Seymour

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""

import uuid
from pymongo import MongoClient
from bson.objectid import ObjectId

class AccountUtils:
    @staticmethod
    def is_admin(user):
        db_utils = DatabaseUtils()
        account = db_utils.get_admin(user)

        return bool(account is not None)

class SocketUtils:
    @staticmethod
    def message_clients(clients, message):
        for client in clients:
            client.write_message(message)

class ScoreUtils:
    @staticmethod
    def assign_positions(users):
        position = 1
        new_users = []

        for user in users:
            user['position'] = position
            new_users.append(user)
            position += 1

        return new_users

    def get_current_scores(self):
        db_utils = DatabaseUtils()

        return self.assign_positions(db_utils.get_contestants())

class FlagUtils:
    @staticmethod
    def create_flags(total):
        flags = []

        for count in range(0, total):
            flag_uuid = str(uuid.uuid4()).replace('-', '')
            flag = 'flag_[_{}_]'.format(flag_uuid)
            flags.append(flag)

        return flags

    @staticmethod
    def check_flag(entered_flag, db_result, current_user):
        db_utils = DatabaseUtils()

        if db_result is not None and entered_flag not in db_utils.get_completed_challenges(current_user):
            db_utils.update_score(current_user, db_result)
            db_utils.inc_tasks_complete(current_user)
            db_utils.add_completed_challenge(current_user, entered_flag)
            return True
        else:
            return False

class DatabaseUtils:
    def __init__(self):
        try:
            mongo_client = MongoClient()
            self.database = mongo_client.ctf_scoreboard
        except pymongo.errors.ServerSelectionTimeoutError as err:
            print(err)

    def get_contestants(self):
        return self.database.contestants.find().sort('score', -1)

    def get_contestant(self, contestant_id):
        return self.database.contestants.find_one({
            'uuid': contestant_id.decode('utf-8')
        })

    def check_name(self, display_name):
        return self.database.contestants.find_one({
            'display_name': display_name
        })

    def set_score(self, contestant_id, score):
        return self.database.contestants.update_one({
            'uuid': contestant_id.decode('utf-8')
        }, {
            '$set': {
                'score': score
            }
        })

    def check_team_name(self, team_name):
        return self.database.contestants.find_one({
            'team_name': team_name
        })

    def inc_tasks_complete(self, contestant_id):
        return self.database.contestants.update_one({
            'uuid': contestant_id.decode('utf-8')
        }, {
            '$inc': {
                'tasks_complete': 1
            }
        })

    def add_completed_challenge(self, contestant_id, flag):
        return self.database.contestants.update_one({
            'uuid': contestant_id.decode('utf-8')
        }, {
            '$push': {
                'completed_tasks': flag
            }
        })

    def get_completed_challenges(self, contestant_id):
        return self.database.contestants.find_one({
            'uuid': contestant_id.decode('utf-8')
        })['completed_tasks']

    def create_contestant(self, contestant):
        return self.database.contestants.insert_one(contestant)

    def create_challenges(self, flags):
        for flag in flags:
            self.database.challenges.insert_one({
                'flag_id': flag,
                'title': 'Challenge Title',
                'category': 'None',
                'description': '',
                'points': 10,
                'bonus': 10,
                'solved': False,
                'solve_count': 0
            })

    def update_challenge(self, challenge):
        self.database.challenges.update_one({
            'flag_id': challenge['flag_id']
        }, {
            '$set': {
                'title': challenge['title'],
                'category': challenge['category'],
                'description': challenge['description'],
                'points': int(challenge['points']),
                'bonus': int(challenge['bonus'])
            }
        })

    def get_challenges(self):
        return self.database.challenges.find()

    def get_challenge(self, flag=None, challenge=None):
        if flag is not None:
            return self.database.challenges.find_one({
                'flag_id': flag
            })
        else:
            return self.database.challenges.find_one({
                '_id': ObjectId(challenge)
            })

    def set_challenge_solved(self, flag):
        return self.database.challenges.update_one({
            'flag_id': flag
        }, {
            '$set': {
                'solved': True
            }
        })

    def inc_challenge_solve_count(self, flag):
        return self.database.challenges.update_one({
            'flag_id': flag
        }, {
            '$inc': {
                'solve_count': 1
            }
        })

    def delete_flag(self, flag_id):
        return self.database.challenges.remove({
            'flag_id': flag_id
        })

    def update_score(self, contestant, flag):
        current_score = self.get_contestant(contestant)['score']
        multiplier = 0

        if flag['solved'] is False:
            multiplier = flag['points'] * (flag['bonus'] / 100)
            self.set_challenge_solved(flag['flag_id'])

        self.inc_challenge_solve_count(flag['flag_id'])
        new_score = current_score + flag['points'] + multiplier
        return self.set_score(contestant, new_score)

    def get_admin(self, username):
        if type(username) is bytes:
            username = username.decode('utf-8')

        return self.database.users.find_one({
            'username': username
        })

    def create_admin(self, username, password):
        return self.database.users.insert_one({
            'username': username,
            'password': password,
            'default_password': True
        })

    def update_admin_password(self, user, password):
        return self.database.users.update_one({
            'username': user.decode('utf-8')
        }, {
            '$set': {
                'password': password
            }
        })

    def update_default_password(self, user, state):
        return self.database.users.update_one({
            'username': user.decode('utf-8')
        }, {
            '$set': {
                'default_password': state
            }
        })

    def update_admin_session_id(self, user, session_id):
        return self.database.users.update_one({
            'username': user
        }, {
            '$set': {
                'session_id': session_id
            }
        })

    def update_admin_session_expiry(self, user, expires):
        return self.database.users.update_one({
            'username': user
        }, {
            '$set': {
                'session_expires': expires
            }
        })

    def get_start_time(self):
        time = self.database.settings.find_one({
            'name': 'event_settings'
        })

        if 'start_time' in time:
            start_time = time['start_time']
        else:
            start_time = False

        return start_time

    def get_end_time(self):
        time = self.database.settings.find_one({
            'name': 'event_settings'
        })

        if 'end_time' in time:
            end_time = time['end_time']
        else:
            end_time = False

        return end_time

    def update_times(self, start_time, end_time):
        return self.database.settings.update_one({
            'name': 'event_settings'
        }, {
            '$set': {
                'start_time': start_time,
                'end_time': end_time
            }
        }, upsert=True)

    def get_event_name(self):
        settings = self.database.settings.find_one({
            'name': 'event_settings'
        })

        return settings['event_name']

    def update_event_name(self, name):
        return self.database.settings.update_one({
            'name': 'event_settings'
        }, {
            '$set': {
                'event_name': name
            }
        }, upsert=True)

    def get_event_type(self):
        settings = self.database.settings.find_one({
            'name': 'event_settings'
        })

        return settings['participation']

    def update_event_type(self, event_type):
        return self.database.settings.update_one({
            'name': 'event_settings'
        }, {
            '$set': {
                'participation': event_type
            }
        })

    def get_flag_entry(self):
        settings = self.database.settings.find_one({
            'name': 'event_settings'
        })

        return settings['flag_entry']

    def update_flag_entry(self, flag_input):
        return self.database.settings.update_one({
            'name': 'event_settings'
        }, {
            '$set': {
                'flag_entry': flag_input
            }
        })

    def reset(self):
        self.database.contestants.drop()
        self.database.challenges.drop()


text:
#define BOOST_BIND_NO_PLACEHOLDERS
#include "ray/core_worker/context.h"
#include "ray/core_worker/core_worker.h"
#include "ray/core_worker/store_provider/store_provider.h"
#include "ray/core_worker/task_execution.h"
#include "src/ray/util/test_util.h"

using namespace std::placeholders;

namespace ray {

/// A mock C++ worker used by core_worker_test.cc to verify the task submission/execution
/// interfaces in both single node and cross-nodes scenarios. As the raylet client can
/// only
/// be called by a real worker process, core_worker_test.cc has to use this program binary
/// to start the actual worker process, in the test, the task submission interfaces are
/// called
/// in core_worker_test, and task execution interfaces are called in this file, see that
/// test
/// for more details on how this class is used.
class MockWorker {
 public:
  MockWorker(const std::string &store_socket, const std::string &raylet_socket,
             const gcs::GcsClientOptions &gcs_options)
      : worker_(WorkerType::WORKER, Language::PYTHON, store_socket, raylet_socket,
                JobID::FromInt(1), gcs_options, /*log_dir=*/"",
                /*node_id_address=*/"127.0.0.1",
                std::bind(&MockWorker::ExecuteTask, this, _1, _2, _3, _4)) {}

  void Run() {
    // Start executing tasks.
    worker_.Execution().Run();
  }

 private:
  Status ExecuteTask(const RayFunction &ray_function,
                     const std::vector<std::shared_ptr<RayObject>> &args, int num_returns,
                     std::vector<std::shared_ptr<RayObject>> *results) {
    // Note that this doesn't include dummy object id.
    RAY_CHECK(num_returns >= 0);

    // Merge all the content from input args.
    std::vector<uint8_t> buffer;
    for (const auto &arg : args) {
      auto &data = arg->GetData();
      buffer.insert(buffer.end(), data->Data(), data->Data() + data->Size());
    }
    if (buffer.size() >= 8) {
      auto int_arr = reinterpret_cast<int64_t *>(buffer.data());
      if (int_arr[0] == SHOULD_CHECK_MESSAGE_ORDER) {
        auto seq_no = int_arr[1];
        if (seq_no > 0) {
          RAY_CHECK(seq_no == prev_seq_no_ + 1) << seq_no << " vs " << prev_seq_no_;
        }
        prev_seq_no_ = seq_no;
      }
    }
    auto memory_buffer =
        std::make_shared<LocalMemoryBuffer>(buffer.data(), buffer.size(), true);

    // Write the merged content to each of return ids.
    for (int i = 0; i < num_returns; i++) {
      results->push_back(std::make_shared<RayObject>(memory_buffer, nullptr));
    }

    return Status::OK();
  }

  CoreWorker worker_;
  int64_t prev_seq_no_ = 0;
};

}  // namespace ray

int main(int argc, char **argv) {
  RAY_CHECK(argc == 3);
  auto store_socket = std::string(argv[1]);
  auto raylet_socket = std::string(argv[2]);

  ray::gcs::GcsClientOptions gcs_options("127.0.0.1", 6379, "");
  ray::MockWorker worker(store_socket, raylet_socket, gcs_options);
  worker.Run();
  return 0;
}


text:
<?php
    $right=$_SESSION["MSA"]["right"];
    $loggedIn=$_SESSION["MSA"]["loggedIn"];
?>

            <input type="text" name="Search" class="header-search-input z-depth-2" placeholder="Explore Materialize">

รายงานการใช้เชื้อเพลิง

รายงาน

รายงานการใช้น้ำมัน

            <form id="form-reportFilter" action="report/showTruckFuelUsageReport" method="post" target="iframe-report">
                <input type="hidden" id="displayType" name="displayType" value="print">
                <input type="hidden" name="method" value="<?=$this->router->fetch_method()?>">

                    <select name="branchID">
                        <?php
                            if(isset($right["view-allBranch"])){
                                foreach ($branchName as $branchID => $name) {
                                    ?>
                        <option value="<?=$branchID?>"><?=$name?></option>
                                    <?php
                                }
                            }else{
                                ?>
                        <option value="<?=$loggedIn["branchID"]?>"><?=$branchName[$loggedIn["branchID"]]?></option>
                                <?php
                            }
                        ?>
                    </select>
                    สาขา

                    <input type="text" name="startDate" id="startDate" placeholder="" required="">
                    ตั้งแต่

                    <input type="text" name="endDate" id="endDate" placeholder="" required="">
                    ถึง

                    <button id="button-submit" class="btn waves-effect waves-light right green" type="submit">
                        ออกรายงาน
                    </button>
                    <button id="button-fullScreen" class="btn waves-effect waves-light right blue" type="button" style="margin-right: 5px;">
                        ขยายหน้าจอ
                    </button>

            </form>


text:
import py
from rpython.jit.tl.tlopcode import compile, NEW, RETURN
from rpython.jit.tl.test import test_tl
from rpython.jit.tl.tlc import ConstantPool

def test_constant_pool():
    pool = ConstantPool()
    bytecode = compile("""
        NEW foo,bar,meth=f
      f:
        RETURN
    """, pool)
    expected = test_tl.list2bytecode([NEW, 0, RETURN])
    assert expected == bytecode
    assert len(pool.classdescrs) == 1
    descr = pool.classdescrs[0]
    assert descr.attributes == ['foo', 'bar']
    assert descr.methods == [('meth', 2)]

def test_serialization():
    from rpython.jit.tl.tlopcode import serialize_program, decode_program
    pool = ConstantPool()
    bytecode = compile("""
        NEW foo,bar,meth=f
        SETATTR foobar
      f:
        RETURN
    """, pool)
    s = serialize_program(bytecode, pool)
    bytecode2, pool2 = decode_program(s)
    assert bytecode == bytecode2
    assert pool == pool2

class TestTLC(object):
    @staticmethod
    def interp(code='', pc=0, inputarg=0):
        from rpython.jit.tl.tlc import interp
        return interp(code, pc, inputarg)

    def test_unconditional_branch(self):
        bytecode = compile("""
    main:
        BR target
        PUSH 123
        RETURN
    target:
        PUSH 42
        RETURN
    """)
        res = self.interp(bytecode, 0, 0)
        assert res == 42

    def test_basic_cons_cell(self):
        bytecode = compile("""
            NIL
            PUSHARG
            CONS
            PUSH 1
            CONS
            CDR
            CAR
        """)

        res = self.interp(bytecode, 0, 42)
        assert res == 42

    def test_nth(self):
        bytecode = compile("""
            NIL
            PUSH 4
            CONS
            PUSH 2
            CONS
            PUSH 1
            CONS
            PUSHARG
            DIV
        """)

        res = self.interp(bytecode, 0, 0)
        assert res == 1
        res = self.interp(bytecode, 0, 1)
        assert res == 2
        res = self.interp(bytecode, 0, 2)
        assert res == 4

        py.test.raises(IndexError, self.interp, bytecode, 0, 3)

    def test_concat(self):
        bytecode = compile("""
            NIL
            PUSH 4
            CONS
            PUSH 2
            CONS
            NIL
            PUSH 5
            CONS
            PUSH 3
            CONS
            PUSH 1
            CONS
            ADD
            PUSHARG
            DIV
        """)

        for i, n in enumerate([2, 4, 1, 3, 5]):
            res = self.interp(bytecode, 0, i)
            assert res == n

    def test_concat_errors(self):
        bytecode = compile("""
            NIL
            PUSH 4
            ADD
        """)
        py.test.raises(TypeError, self.interp, bytecode, 0, 0)

        bytecode = compile("""
            PUSH 4
            NIL
            ADD
        """)
        py.test.raises(TypeError, self.interp, bytecode, 0, 0)

        bytecode = compile("""
            NIL
            PUSH 1
            CONS
            PUSH 4
            ADD
        """)
        py.test.raises(TypeError, self.interp, bytecode, 0, 0)

        bytecode = compile("""
            PUSH 4
            NIL
            PUSH 1
            CONS
            ADD
        """)
        py.test.raises(TypeError, self.interp, bytecode, 0, 0)

        bytecode = compile("""
            PUSH 2
            PUSH 1
            CONS
            NIL
            ADD
        """)
        py.test.raises(TypeError, self.interp, bytecode, 0, 0)

    def test_new_obj(self):
        from rpython.jit.tl.tlc import interp_eval, InstanceObj, nil
        pool = ConstantPool()
        bytecode = compile("""
            NEW foo,bar
        """, pool)
        obj = interp_eval(bytecode, 0, [nil], pool)
        assert isinstance(obj, InstanceObj)
        assert len(obj.values) == 2
        assert sorted(obj.cls.attributes.keys()) == ['bar', 'foo']

    def test_setattr(self):
        from rpython.jit.tl.tlc import interp_eval, nil
        pool = ConstantPool()
        bytecode = compile("""
            NEW foo,bar
            PICK 0
            PUSH 42
            SETATTR foo
        """, pool)
        obj = interp_eval(bytecode, 0, [nil], pool)
        assert obj.values[0].int_o() == 42
        assert obj.values[1] is nil

    def test_getattr(self):
        from rpython.jit.tl.tlc import interp_eval, nil
        pool = ConstantPool()
        bytecode = compile("""
            NEW foo,bar
            PICK 0
            PUSH 42
            SETATTR bar
            GETATTR bar
        """, pool)
        res = interp_eval(bytecode, 0, [nil], pool)
        assert res.int_o() == 42

    def test_obj_truth(self):
        from rpython.jit.tl.tlc import interp_eval, nil
        pool = ConstantPool()
        bytecode = compile("""
            NEW foo,bar
            BR_COND true
            PUSH 12
            PUSH 1
            BR_COND exit
        true:
            PUSH 42
        exit:
            RETURN
        """, pool)
        res = interp_eval(bytecode, 0, [nil], pool)
        assert res.int_o() == 42

    def test_obj_equality(self):
        from rpython.jit.tl.tlc import interp_eval, nil
        pool = ConstantPool()
        bytecode = compile("""
            NEW foo,bar
            NEW foo,bar
            EQ
        """, pool)
        res = interp_eval(bytecode, 0, [nil], pool)
        assert res.int_o() == 0

    def test_method(self):
        from rpython.jit.tl.tlc import interp_eval, nil
        pool = ConstantPool()
        bytecode = compile("""
            NEW foo,meth=meth
            PICK 0
            PUSH 42
            SETATTR foo
            SEND meth/0
            RETURN
        meth:
            PUSHARG
            GETATTR foo
            RETURN
        """, pool)
        res = interp_eval(bytecode, 0, [nil], pool)
        assert res.int_o() == 42

    def test_method_arg(self):
        from rpython.jit.tl.tlc import interp_eval, nil
        pool = ConstantPool()
        bytecode = compile("""
            NEW foo,meth=meth
            PICK 0
            PUSH 40
            SETATTR foo
            PUSH 2
            SEND meth/1
            RETURN
        meth:
            PUSHARG
            GETATTR foo
            PUSHARGN 1
            ADD
            RETURN
        """, pool)
        res = interp_eval(bytecode, 0, [nil], pool)
        assert res.int_o() == 42

    def test_call_without_return_value(self):
        from rpython.jit.tl.tlc import interp_eval, nil
        pool = ConstantPool()
        bytecode = compile("""
            CALL foo
            PUSH 42
            RETURN
        foo:
            RETURN
        """, pool)
        res = interp_eval(bytecode, 0, [nil], pool)
        assert res.int_o() == 42

    def compile(self, filename):
        from rpython.jit.tl.tlc import interp_eval, IntObj
        pool = ConstantPool()
        path = py.path.local(__file__).join(filename)
        src = path.read()
        bytecode = compile(src, pool)
        def fn(n):
            obj = IntObj(n)
            res = interp_eval(bytecode, 0, [obj], pool)
            return res.int_o()
        return fn

    def test_binarytree(self):
        search = self.compile('../../binarytree.tlc.src')
        assert search(20)
        assert search(10)
        assert search(15)
        assert search(30)
        assert not search(1)
        assert not search(40)
        assert not search(12)
        assert not search(27)

    def test_fibo(self):
        fibo = self.compile('../../fibo.tlc.src')
        assert fibo(1) == 1
        assert fibo(2) == 1
        assert fibo(3) == 2
        assert fibo(7) == 13

    def test_accumulator(self):
        acc = self.compile('../../accumulator.tlc.src')
        assert acc(0) == 0
        assert acc(1) == 0
        assert acc(10) == sum(range(10))
        assert acc(20) == sum(range(20))
        assert acc(-1) == 1
        assert acc(-2) == 2
        assert acc(-10) == 10


text:
odetest
====
ODE(Open Dynamics Engine)
  - http://ode.org/

![img01.gif](img01.gif)

How to
----

    $ sudo apt-get install libode-dev cmake
	$ git clone https://github.com/yoggy/odetest.git
    $ cd odetes
    $ cmake .
    $ make
    $ ./odetest02

Copyright and license
----
Copyright (c) 2015 yoggy

Released under the [MIT license](LICENSE.txt)


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using SimpleDataGenerator.Core.Customization.Specimens;
using SimpleDataGenerator.Core.Mapping.Interfaces;
using SimpleDataGenerator.Core.Model;

namespace SimpleDataGenerator.Core.Mapping.Implementations
{
    public class DateTimePropertyConfiguration : PropertyConfiguration<DateTime>, IDateTimePropertyConfiguration
    {
        public DateTimePropertyConfiguration(PropertyInfo propertyInfo)
            : base(propertyInfo)
        {

        }

        public void InRange(DateTime fromDate, DateTime toDate)
        {
            AddCustomSpecimen(new RangedDateTimeSpecimenBuilder(SelectedProperty, new DateTimeRange(fromDate, toDate)));
        }
    }
}


text:
package org.jenkinsci.plugins;

import hudson.Extension;
import hudson.Util;
import hudson.model.Descriptor;
import hudson.model.Fingerprint.RangeSet;
import hudson.model.User;
import hudson.security.GroupDetails;
import hudson.security.Permission;
import hudson.security.HudsonPrivateSecurityRealm.Details;
import hudson.security.SecurityRealm;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.Map.Entry;
import java.util.logging.Logger;

import hudson.tasks.Mailer;
import jenkins.model.Jenkins;
import org.acegisecurity.Authentication;
import org.acegisecurity.AuthenticationException;
import org.acegisecurity.AuthenticationManager;
import org.acegisecurity.BadCredentialsException;
import org.acegisecurity.context.SecurityContextHolder;
import org.acegisecurity.providers.UsernamePasswordAuthenticationToken;
import org.acegisecurity.providers.anonymous.AnonymousAuthenticationToken;
import org.acegisecurity.userdetails.UserDetails;
import org.acegisecurity.userdetails.UserDetailsService;
import org.acegisecurity.userdetails.UsernameNotFoundException;
import org.apache.bcel.generic.ATHROW;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.util.EntityUtils;
import org.jfree.util.Log;
import org.kohsuke.github.GHOrganization;
import org.kohsuke.github.GHUser;
import org.kohsuke.github.GitHub;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.Header;
import org.kohsuke.stapler.HttpRedirect;
import org.kohsuke.stapler.HttpResponse;
import org.kohsuke.stapler.HttpResponses;
import org.kohsuke.stapler.StaplerRequest;
import org.springframework.dao.DataAccessException;
import org.springframework.dao.DataRetrievalFailureException;

import com.thoughtworks.xstream.converters.ConversionException;
import com.thoughtworks.xstream.converters.Converter;
import com.thoughtworks.xstream.converters.MarshallingContext;
import com.thoughtworks.xstream.converters.UnmarshallingContext;
import com.thoughtworks.xstream.io.HierarchicalStreamReader;
import com.thoughtworks.xstream.io.HierarchicalStreamWriter;

/**
 *
 * Implementation of the AbstractPasswordBasedSecurityRealm that uses github
 * oauth to verify the user can login.
 *
 * This is based on the MySQLSecurityRealm from the mysql-auth-plugin written by
 * Alex Ackerman.
 */
public class GithubSecurityRealm extends SecurityRealm {

	private static final String DEFAULT_URI = "https://github.com";

    private String githubUri;
	private String clientID;
	private String clientSecret;

	@DataBoundConstructor
	public GithubSecurityRealm(String githubUri, String clientID,
			String clientSecret) {
		super();

		this.githubUri = Util.fixEmptyAndTrim(githubUri);
		this.clientID = Util.fixEmptyAndTrim(clientID);
		this.clientSecret = Util.fixEmptyAndTrim(clientSecret);

	}

	private GithubSecurityRealm() {
		// TODO Auto-generated constructor stub
	}

	/**
	 * @param githubUri
	 *            the githubUri to set
	 */
	private void setGithubUri(String githubUri) {
		this.githubUri = githubUri;
	}

	/**
	 * @param clientID
	 *            the clientID to set
	 */
	private void setClientID(String clientID) {
		this.clientID = clientID;
	}

	/**
	 * @param clientSecret
	 *            the clientSecret to set
	 */
	private void setClientSecret(String clientSecret) {
		this.clientSecret = clientSecret;
	}

	public static final class ConverterImpl implements Converter {

		public boolean canConvert(Class type) {
			return type == GithubSecurityRealm.class;
		}

		public void marshal(Object source, HierarchicalStreamWriter writer,
				MarshallingContext context) {

			GithubSecurityRealm realm = (GithubSecurityRealm) source;

			writer.startNode("githubUri");
			writer.setValue(realm.getGithubUri());
			writer.endNode();

			writer.startNode("clientID");
			writer.setValue(realm.getClientID());
			writer.endNode();

			writer.startNode("clientSecret");
			writer.setValue(realm.getClientSecret());
			writer.endNode();

		}

		public Object unmarshal(HierarchicalStreamReader reader,
				UnmarshallingContext context) {

			String node = reader.getNodeName();

			reader.moveDown();

			GithubSecurityRealm realm = new GithubSecurityRealm();

			node = reader.getNodeName();

			String value = reader.getValue();

			setValue(realm, node, value);

			reader.moveUp();

			reader.moveDown();

			node = reader.getNodeName();

			value = reader.getValue();

			setValue(realm, node, value);

			reader.moveUp();

			if (reader.hasMoreChildren()) {
				reader.moveDown();

				node = reader.getNodeName();

				value = reader.getValue();

				setValue(realm, node, value);

				reader.moveUp();
			}

			if (realm.getGithubUri() == null) {
				realm.setGithubUri(DEFAULT_URI);
			}

			return realm;
		}

		private void setValue(GithubSecurityRealm realm, String node,
				String value) {

			if (node.toLowerCase().equals("clientid")) {
				realm.setClientID(value);
			} else if (node.toLowerCase().equals("clientsecret")) {
				realm.setClientSecret(value);
			} else if (node.toLowerCase().equals("githuburi")) {
				realm.setGithubUri(value);
			} else
				throw new ConversionException("invalid node value = " + node);

		}

	}

	/**
	 * @return the uri to Github (varies for Github Enterprise Edition)
	 */
	public String getGithubUri() {

		return githubUri;
	}

	/**
	 * @return the clientID
	 */
	public String getClientID() {
		return clientID;
	}

	/**
	 * @return the clientSecret
	 */
	public String getClientSecret() {
		return clientSecret;
	}

	// @Override
	// public Filter createFilter(FilterConfig filterConfig) {
	//
	// return new GithubOAuthAuthenticationFilter();
	// }

	public HttpResponse doCommenceLogin(StaplerRequest request, @Header("Referer") final String referer)
			throws IOException {

        request.getSession().setAttribute(REFERER_ATTRIBUTE,referer);

        Set<String> scopes = new HashSet<String>();
        for (GitHubOAuthScope s : Jenkins.getInstance().getExtensionList(GitHubOAuthScope.class)) {
            scopes.addAll(s.getScopesToRequest());
        }
        String suffix="";
        if (!scopes.isEmpty()) {
            suffix = "&scope="+Util.join(scopes,",");
        }

		return new HttpRedirect(githubUri + "/login/oauth/authorize?client_id="
				+ clientID + suffix);
	}

	/**
	 * This is where the user comes back to at the end of the OpenID redirect
	 * ping-pong.
	 */
	public HttpResponse doFinishLogin(StaplerRequest request)
			throws IOException {

		String code = request.getParameter("code");

		if (code == null || code.trim().length() == 0) {
			Log.info("doFinishLogin: missing code.");
			return HttpResponses.redirectToContextRoot();
		}

		Log.info("test");

		HttpPost httpost = new HttpPost(githubUri
				+ "/login/oauth/access_token?" + "client_id=" + clientID + "&"
				+ "client_secret=" + clientSecret + "&" + "code=" + code);

		DefaultHttpClient httpclient = new DefaultHttpClient();

		org.apache.http.HttpResponse response = httpclient.execute(httpost);

		HttpEntity entity = response.getEntity();

		String content = EntityUtils.toString(entity);

		// When HttpClient instance is no longer needed,
		// shut down the connection manager to ensure
		// immediate deallocation of all system resources
		httpclient.getConnectionManager().shutdown();

		String accessToken = extractToken(content);

		if (accessToken != null && accessToken.trim().length() > 0) {

			String githubServer = githubUri.replaceFirst("http.*\\/\\/", "");

			// only set the access token if it exists.
            GithubAuthenticationToken auth = new GithubAuthenticationToken(accessToken,githubServer);
            SecurityContextHolder.getContext().setAuthentication(auth);

            GHUser self = auth.getGitHub().getMyself();
            User u = User.current();
            u.setFullName(self.getName());
            u.addProperty(new Mailer.UserProperty(self.getEmail()));
        }
		else {
			Log.info("github did not return an access token.");
		}

        String referer = (String)request.getSession().getAttribute(REFERER_ATTRIBUTE);
        if (referer!=null)  return HttpResponses.redirectTo(referer);
		return HttpResponses.redirectToContextRoot();   // referer should be always there, but be defensive
	}

	private String extractToken(String content) {

		String parts[] = content.split("&");

		for (String part : parts) {

			if (content.contains("access_token")) {

				String tokenParts[] = part.split("=");

				return tokenParts[1];
			}

			// fall through
		}

		return null;
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see hudson.security.SecurityRealm#allowsSignup()
	 */
	@Override
	public boolean allowsSignup() {
		return false;
	}

	@Override
	public SecurityComponents createSecurityComponents() {

		return new SecurityComponents(new AuthenticationManager() {

			public Authentication authenticate(Authentication authentication)
					throws AuthenticationException {
				if (authentication instanceof GithubAuthenticationToken)
					return authentication;
				throw new BadCredentialsException(
						"Unexpected authentication type: " + authentication);
			}
		}, new UserDetailsService() {
			public UserDetails loadUserByUsername(String username)
					throws UsernameNotFoundException, DataAccessException {
				throw new UsernameNotFoundException(username);
			}
		});
	}

	@Override
	public String getLoginUrl() {

		return "securityRealm/commenceLogin";
	}

	@Extension
	public static final class DescriptorImpl extends Descriptor<SecurityRealm> {

		@Override
		public String getHelpFile() {
			return "/plugin/github-oauth/help/help-security-realm.html";
		}

		@Override
		public String getDisplayName() {
			return "Github Authentication Plugin";
		}

		public DescriptorImpl() {
			super();
			// TODO Auto-generated constructor stub
		}

		public DescriptorImpl(Class<? extends SecurityRealm> clazz) {
			super(clazz);
			// TODO Auto-generated constructor stub
		}

	}

	/**
	 *
	 * @param username
	 * @return
	 * @throws UsernameNotFoundException
	 * @throws DataAccessException
	 */
	@Override
	public UserDetails loadUserByUsername(String username)
			throws UsernameNotFoundException, DataAccessException {
		GHUser user = null;

		GithubAuthenticationToken authToken =  (GithubAuthenticationToken) SecurityContextHolder.getContext().getAuthentication();

		try {

			GroupDetails group = loadGroupByGroupname(username);

			if (group != null) {
				throw new UsernameNotFoundException ("user("+username+") is also an organization");
			}

			user = authToken.loadUser(username);

			if (user != null)
				return new GithubOAuthUserDetails(user);
			else
				throw new UsernameNotFoundException("no known user: " + username);
		} catch (IOException e) {
			throw new DataRetrievalFailureException("loadUserByUsername (username=" + username +")", e);
		}
	}

	/**
	 *
	 * @param groupName
	 * @return
	 * @throws UsernameNotFoundException
	 * @throws DataAccessException
	 */
	@Override
	public GroupDetails loadGroupByGroupname(String groupName)
			throws UsernameNotFoundException, DataAccessException {

		GithubAuthenticationToken authToken =  (GithubAuthenticationToken) SecurityContextHolder.getContext().getAuthentication();

		try {
			GHOrganization org = authToken.loadOrganization(groupName);

			if (org != null)
				return new GithubOAuthGroupDetails(org);
			else
				throw new UsernameNotFoundException("no known group: " + groupName);
		} catch (IOException e) {
			throw new DataRetrievalFailureException("loadGroupByGroupname (groupname=" + groupName +")", e);
		}
	}

	/**
	 * Logger for debugging purposes.
	 */
	private static final Logger LOGGER = Logger.getLogger(GithubSecurityRealm.class.getName());

    private static final String REFERER_ATTRIBUTE = GithubSecurityRealm.class.getName()+".referer";
}


text:
ACCEPTED

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

#### Published in
null

#### Original name
Lycopodium cernuum L.

### Remarks
null


text:
$(document).ready(function(){
    $('body').delegate('.btn-order-process','click',function(){
            var order_id = $(this).attr('data-id');
            var status_next = $(this).attr('data-status');
            var title = '';
            var message = '';
            var open = 0;
            if(status_next == 2)
            {
                title = 'ORDER PAID PROCESS';
                message = 'Apakah Kamu Yakin Akan Mengubah Status Order Menjadi PAID?';
                open = 1;
            }
            else if(status_next == 3)
            {
                var nomor_resi = $('#nomor_resi').val();
                if(nomor_resi == '')
                {
                    open = 0;
                    alert('Nomor Resi Harus Diisi');
                }
                else
                    open = 1;
                title = 'ORDER SHIPPED PROCESS';
                message = 'Apakah Kamu Yakin Akan Mengubah Status Order Menjadi SHIPPED?';
                $('#process_id').attr('data-nomor-resi', nomor_resi);
            }
            else
            {
                title = 'ORDER REJECT PROCESS';
                message = 'Apakah Kamu Yakin Akan Mengubah Status Order Menjadi REJECTED?';
                open = 1;
            }
            $('#popup-title').html(title);
            $('#msg-show').html(message);
            $('#process_id').attr('data-id', order_id);
            $('#process_id').attr('data-status', status_next);
            if(open == 1)
                $('#px-order-message-box').addClass('open');
    });

    $('#process_id').click(function(){
        var order_id = $(this).attr('data-id');
        var status_id = $(this).attr('data-status');
        var nomor_resi = $(this).attr('data-nomor-resi');
        $('#px-order-message-form .alert-warning').removeClass('hidden');
        $('#px-order-message-form .alert-success').addClass('hidden');
        $('#px-order-message-form .alert-danger').addClass('hidden');
        $.ajax({
            url:'admin_order/process_order',
            type:'post',
            dataType:'json',
            data:{'id':order_id, 'status':status_id, 'nomor_resi':nomor_resi},
            success:function(response)
            {
                $('#px-order-message-form .alert-warning').addClass('hidden');
                if(response.status == 'ok'){
                    $('#px-order-message-form .alert-success').removeClass('hidden').children('span').text(response.msg);
                    window.location.href = response.redirect;
                }
                else
                    $('#px-order-message-form .alert-danger').removeClass('hidden').children('span').text(response.msg);
            }
        });
    });
});


text:
package com.ran.coolweather.activity;

import java.util.List;

import com.ran.coolweather.R;
import com.ran.coolweather.model.City;
import com.ran.coolweather.model.CoolWeatherDB;
import com.ran.coolweather.model.County;
import com.ran.coolweather.model.Province;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;

public class MainActivity extends Activity{

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		Intent intent = new Intent(MainActivity.this, ChooseAreaActivity.class);
		startActivity(intent);
	}
}


text: require('radedit');


text:
<?php

namespace Oenstrom\Session;

/**
 * Class for session handling.
 */
class Session
{
    /**
     * @var string $name the session name.
     */
    private $name;

    /**
     * Constructor
     * @param string $name (optional) The name of the session
     */
    public function __construct($name = "olen16-anax-session")
    {
        $this->name = $name;
    }

    /**
     * Starts the session if not exists
     * @return void
     */
    public function start()
    {
        session_name($this->name);

        if (!empty(session_id())) {
            session_destroy();
        }
        session_start();
    }

    /**
     * Check if key exists in session
     * @param $key string The key to check for in session
     * @return bool true if $key exists, otherwise false
     */
    public function has($key)
    {
        return array_key_exists($key, $_SESSION);
    }

    /**
     * Sets a variable in session
     * @param $key string The key in session
     * @param $val string The value to set to $key
     * @return void
     */
    public function set($key, $val)
    {
        $_SESSION[$key] = $val;
    }

    /**
     * Retrieve value if exists in session
     * @param $key string The key to get from session
     * @param $default optional The return value if not found
     * @return string The session variable if present, else $default
     */
    public function get($key, $default = false)
    {
        return (self::has($key)) ? $_SESSION[$key] : $default;
    }

    /**
     * Retrieve value if exists in session and then unset it.
     * @param $key string The key to get from session
     * @param $default optional The return value if not found
     * @return string The session variable if present, else $default
     */
    public function getOnce($key, $default = false)
    {
        if (self::has($key)) {
            $value = $_SESSION[$key];
            $this->delete($key);
            return $value;
        }
        return $default;
    }

    /**
     * Destroys the session and sets cookie
     * @return void
     */
    public function destroy()
    {
        session_destroy();
    }

    /**
     * Deletes variable from session if exists
     * @param $key string The key variable to unset from session
     * @return void
     */
    public function delete($key)
    {
        if (self::has($key)) {
            unset($_SESSION[$key]);
        }
    }

    /**
     * Dumps the session
     * Good for debugging
     * @return void
     */
    public function dump()
    {
        var_dump($_SESSION);
    }

    /**
     * Get all keys in the session.
     * @return array All session keys.
     */
    public function getKeys()
    {
        return array_keys($_SESSION);
    }
}


text:
import unittest
import warnings

import mxnet as mx

def test_print_summary():
    data = mx.sym.Variable('data')
    bias = mx.sym.Variable('fc1_bias', lr_mult=1.0)
    emb1= mx.symbol.Embedding(data = data, name='emb1', input_dim=100, output_dim=28)
    conv1= mx.symbol.Convolution(data = emb1, name='conv1', num_filter=32, kernel=(3,3), stride=(2,2))
    bn1 = mx.symbol.BatchNorm(data = conv1, name="bn1")
    act1 = mx.symbol.Activation(data = bn1, name='relu1', act_type="relu")
    mp1 = mx.symbol.Pooling(data = act1, name = 'mp1', kernel=(2,2), stride=(2,2), pool_type='max')
    fc1 = mx.sym.FullyConnected(data=mp1, bias=bias, name='fc1', num_hidden=10, lr_mult=0)
    fc2 = mx.sym.FullyConnected(data=fc1, name='fc2', num_hidden=10, wd_mult=0.5)
    sc1 = mx.symbol.SliceChannel(data=fc2, num_outputs=10, name="slice_1", squeeze_axis=0)
    mx.viz.print_summary(sc1)
    shape = {}
    shape["data"]=(1,3,28)
    mx.viz.print_summary(sc1, shape)

def graphviz_exists():
    try:
        import graphviz
    except ImportError:
        return False
    else:
        return True

@unittest.skipIf(not graphviz_exists(), "Skip test_plot_network as Graphviz could not be imported")
def test_plot_network():
    # Test warnings for cyclic graph
    net = mx.sym.Variable('data')
    net = mx.sym.FullyConnected(data=net, name='fc', num_hidden=128)
    net = mx.sym.Activation(data=net, name='relu1', act_type="relu")
    net = mx.sym.FullyConnected(data=net, name='fc', num_hidden=10)
    net = mx.sym.SoftmaxOutput(data=net, name='out')
    with warnings.catch_warnings(record=True) as w:
        digraph = mx.viz.plot_network(net, shape={'data': (100, 200)},
                                      node_attrs={"fixedsize": "false"})
    assert len(w) == 1
    assert "There are multiple variables with the same name in your graph" in str(w[-1].message)
    assert "fc" in str(w[-1].message)

if __name__ == "__main__":
    import nose
    nose.runmodule()


text:
<!DOCTYPE html>

    <meta http-equiv="refresh" content="0;URL=constant.CL_GL_NUM_SAMPLES.html">

Redirecting to constant.CL_GL_NUM_SAMPLES.html...


text:
package com.nbtaskfocus.core.ui;

import java.awt.EventQueue;
import java.beans.PropertyVetoException;
import java.util.Collection;
import java.util.prefs.PreferenceChangeEvent;
import java.util.prefs.PreferenceChangeListener;
import java.util.prefs.Preferences;
import org.openide.filesystems.FileObject;
import org.openide.loaders.DataObject;
import org.openide.nodes.Node;
import org.openide.util.*;
import org.openide.windows.TopComponent;

/**
 *
 * @author tushar_joshi
 */
public class EditorSynchronizationSupport {

    private final EditorSynchronizable synchronizable;
    public static final RequestProcessor RP = new RequestProcessor(EditorSynchronizationSupport.class);
    private boolean synchronizeViews = false;

    public EditorSynchronizationSupport(EditorSynchronizable synchronizable) {
        this.synchronizable = synchronizable;

        Preferences nbPrefs = NbPreferences.root().node("org/netbeans/modules/projectui");
        synchronizeViews = nbPrefs.getBoolean("synchronizeEditorWithViews", false);
        nbPrefs.addPreferenceChangeListener(new EditorSynchronizationSupport.NbPrefsListener());

        selectionTask = createSelectionTask();
    }

    private class NbPrefsListener implements PreferenceChangeListener {

        @Override
        public void preferenceChange(PreferenceChangeEvent evt) {
            if ("synchronizeEditorWithViews".equals(evt.getKey())) {
                synchronizeViews = Boolean.parseBoolean(evt.getNewValue());
            }
        }

    };

    // SEARCHING NODES

    private static final Lookup context = Utilities.actionsGlobalContext();

    private static final Lookup.Result<FileObject> foSelection = context.lookup(new Lookup.Template<FileObject>(FileObject.class));

    private static final Lookup.Result<DataObject> doSelection = context.lookup(new Lookup.Template<DataObject>(DataObject.class));

    private FileObject objectToSelect;

    private RequestProcessor.Task selectionTask;

    private static final int NODE_SELECTION_DELAY = 200;

    private final LookupListener baseListener = new LookupListener() {

        @Override
        public void resultChanged(LookupEvent le) {
            if (TopComponent.getRegistry().getActivated() == synchronizable.getTopComponent()) {
                return;
            }

            if (synchronizeViews) {
                Collection<? extends FileObject> fos = foSelection.allInstances();
                if (fos.size() == 1) {
                    selectNodeAsyncNoSelect(fos.iterator().next());
                } else {
                    Collection<? extends DataObject> dos = doSelection.allInstances();
                    if (dos.size() == 1) {
                        selectNodeAsyncNoSelect((dos.iterator().next()).getPrimaryFile());
                    }
                }
            }
        }

    };

    private final LookupListener weakListener = WeakListeners.create(LookupListener.class, baseListener, null);

    public void startListening() {
        foSelection.addLookupListener(weakListener);
        doSelection.addLookupListener(weakListener);
        baseListener.resultChanged(null);
    }

    public void stopListening() {
        foSelection.removeLookupListener(weakListener);
        doSelection.removeLookupListener(weakListener);
    }

    private void selectNodeAsyncNoSelect(FileObject object) {
        objectToSelect = object;
        selectionTask.schedule(NODE_SELECTION_DELAY);
    }

    private RequestProcessor.Task createSelectionTask() {
        RequestProcessor.Task task = RP.create(new Runnable() {

            @Override
            public void run() {
                if (objectToSelect == null) {
                    return;
                }
                Node tempNode = synchronizable.findNode(objectToSelect);

                if( null != tempNode ) {
                    final Node selectedNode = tempNode;
                    EventQueue.invokeLater(new Runnable() {

                        @Override
                        public void run() {
                            if ( selectedNode != null ) {
                                try {
                                    synchronizable.getExplorerManager().setSelectedNodes( new Node[] { selectedNode } );
                                    synchronizable.getCustomTreeView().scrollToNode(selectedNode);
                                } catch(PropertyVetoException e) {
                                     // Bad day node found but can't be selected
                                }
                            }
                        }
                    });
                }
            }

        });
        return task;
    }

}


text:
simpledialog = object()

class Canvas(object):
    pass

class Frame(object):
    pass

class Tk(object):
    pass

# for py2
def mainloop():
    pass


text:
var Auslastung = new Class({
	User: null
});


text:
local runner = require('user_modules/script_runner')
local common = require('test_scripts/RC/OnRCStatus/commonOnRCStatus')

--[[ Test Configuration ]]
runner.testSettings.isSelfIncluded = false

--[[ General configuration parameters ]]
config.application2.registerAppInterfaceParams.appHMIType = { "DEFAULT" }

--[[ Local Functions ]]
local function pTUfunc(tbl)
  local appId1 = config.application1.registerAppInterfaceParams.fullAppID
  tbl.policy_table.app_policies[appId1] = common.getRCAppConfig(tbl)
  tbl.policy_table.app_policies[appId1].moduleType = { "RADIO" }
  local appId2 = config.application2.registerAppInterfaceParams.fullAppID
  tbl.policy_table.app_policies[appId2] = common.getRCAppConfig(tbl)
  tbl.policy_table.app_policies[appId2].AppHMIType = { "DEFAULT" }
end

local function alocateModule(pModuleType)
  common.setModuleStatus(pModuleType)
  common.rpcAllowed(pModuleType, 1, "SetInteriorVehicleData")
  common.validateOnRCStatus({ 1 })
end

local function ptuWithRevokingModule()
  common.policyTableUpdate(pTUfunc)
  local pModuleStatus = {
    freeModules = common.getModulesAllocationByApp(1).freeModules,
    allocatedModules = { }
  }
  common.validateOnRCStatusForApp(1, pModuleStatus)
  common.validateOnRCStatusForHMI(1, pModuleStatus)
end

--[[ Scenario ]]
runner.Title("Preconditions")
runner.Step("Clean environment", common.preconditions, { true, 1 })
runner.Step("Update SDL config", common.setSDLIniParameter, { "ApplicationListUpdateTimeout", 5000 })
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
runner.Step("Register RC application 1", common.registerRCApplication)
runner.Step("Activate App 1", common.activateApp)
runner.Step("Allocating module CLIMATE", alocateModule, { "CLIMATE" })

runner.Title("Test")
runner.Step("Register application 2", common.registerApp, { 2 })
runner.Step("OnRCStatus by PTU with revoking of allocated module", ptuWithRevokingModule)

runner.Title("Postconditions")
runner.Step("Stop SDL", common.postconditions)


text:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/**
 * Words for numbers 1 to 100
 */
$lang['mathcaptcha_numeric_word_0'] = 'zero';
$lang['mathcaptcha_numeric_word_1'] = 'one';
$lang['mathcaptcha_numeric_word_2'] = 'two';
$lang['mathcaptcha_numeric_word_3'] = 'three';
$lang['mathcaptcha_numeric_word_4'] = 'four';
$lang['mathcaptcha_numeric_word_5'] = 'five';
$lang['mathcaptcha_numeric_word_6'] = 'six';
$lang['mathcaptcha_numeric_word_7'] = 'seven';
$lang['mathcaptcha_numeric_word_8'] = 'eight';
$lang['mathcaptcha_numeric_word_9'] = 'nine';
$lang['mathcaptcha_numeric_word_10'] = 'ten';
$lang['mathcaptcha_numeric_word_11'] = 'eleven';
$lang['mathcaptcha_numeric_word_12'] = 'twelve';
$lang['mathcaptcha_numeric_word_13'] = 'thirteen';
$lang['mathcaptcha_numeric_word_14'] = 'fourteen';
$lang['mathcaptcha_numeric_word_15'] = 'fifteen';
$lang['mathcaptcha_numeric_word_16'] = 'sixteen';
$lang['mathcaptcha_numeric_word_17'] = 'seventeen';
$lang['mathcaptcha_numeric_word_18'] = 'eighteen';
$lang['mathcaptcha_numeric_word_19'] = 'nineteen';
$lang['mathcaptcha_numeric_word_20'] = 'twenty';
$lang['mathcaptcha_numeric_word_21'] = 'twenty one';
$lang['mathcaptcha_numeric_word_22'] = 'twenty two';
$lang['mathcaptcha_numeric_word_23'] = 'twenty three';
$lang['mathcaptcha_numeric_word_24'] = 'twenty four';
$lang['mathcaptcha_numeric_word_25'] = 'twenty five';
$lang['mathcaptcha_numeric_word_26'] = 'twenty six';
$lang['mathcaptcha_numeric_word_27'] = 'twenty seven';
$lang['mathcaptcha_numeric_word_28'] = 'twenty eight';
$lang['mathcaptcha_numeric_word_29'] = 'twenty nine';
$lang['mathcaptcha_numeric_word_30'] = 'thirty';
$lang['mathcaptcha_numeric_word_31'] = 'thirty one';
$lang['mathcaptcha_numeric_word_32'] = 'thirty two';
$lang['mathcaptcha_numeric_word_33'] = 'thirty three';
$lang['mathcaptcha_numeric_word_34'] = 'thirty four';
$lang['mathcaptcha_numeric_word_35'] = 'thirty five';
$lang['mathcaptcha_numeric_word_36'] = 'thirty six';
$lang['mathcaptcha_numeric_word_37'] = 'thirty seven';
$lang['mathcaptcha_numeric_word_38'] = 'thirty eight';
$lang['mathcaptcha_numeric_word_39'] = 'thirty nine';
$lang['mathcaptcha_numeric_word_40'] = 'forty';
$lang['mathcaptcha_numeric_word_41'] = 'forty one';
$lang['mathcaptcha_numeric_word_42'] = 'forty two';
$lang['mathcaptcha_numeric_word_43'] = 'forty three';
$lang['mathcaptcha_numeric_word_44'] = 'forty four';
$lang['mathcaptcha_numeric_word_45'] = 'forty five';
$lang['mathcaptcha_numeric_word_46'] = 'forty six';
$lang['mathcaptcha_numeric_word_47'] = 'forty seven';
$lang['mathcaptcha_numeric_word_48'] = 'forty eight';
$lang['mathcaptcha_numeric_word_49'] = 'forty nine';
$lang['mathcaptcha_numeric_word_50'] = 'fifty';
$lang['mathcaptcha_numeric_word_51'] = 'fifty one';
$lang['mathcaptcha_numeric_word_52'] = 'fifty two';
$lang['mathcaptcha_numeric_word_53'] = 'fifty three';
$lang['mathcaptcha_numeric_word_54'] = 'fifty four';
$lang['mathcaptcha_numeric_word_55'] = 'fifty five';
$lang['mathcaptcha_numeric_word_56'] = 'fifty six';
$lang['mathcaptcha_numeric_word_57'] = 'fifty seven';
$lang['mathcaptcha_numeric_word_58'] = 'fifty eight';
$lang['mathcaptcha_numeric_word_59'] = 'fifty nine';
$lang['mathcaptcha_numeric_word_60'] = 'sixty';
$lang['mathcaptcha_numeric_word_61'] = 'sixty one';
$lang['mathcaptcha_numeric_word_62'] = 'sixty two';
$lang['mathcaptcha_numeric_word_63'] = 'sixty three';
$lang['mathcaptcha_numeric_word_64'] = 'sixty four';
$lang['mathcaptcha_numeric_word_65'] = 'sixty five';
$lang['mathcaptcha_numeric_word_66'] = 'sixty six';
$lang['mathcaptcha_numeric_word_67'] = 'sixty seven';
$lang['mathcaptcha_numeric_word_68'] = 'sixty eight';
$lang['mathcaptcha_numeric_word_69'] = 'sixty nine';
$lang['mathcaptcha_numeric_word_70'] = 'seventy';
$lang['mathcaptcha_numeric_word_71'] = 'seventy one';
$lang['mathcaptcha_numeric_word_72'] = 'seventy two';
$lang['mathcaptcha_numeric_word_73'] = 'seventy three';
$lang['mathcaptcha_numeric_word_74'] = 'seventy four';
$lang['mathcaptcha_numeric_word_75'] = 'seventy five';
$lang['mathcaptcha_numeric_word_76'] = 'seventy six';
$lang['mathcaptcha_numeric_word_77'] = 'seventy seven';
$lang['mathcaptcha_numeric_word_78'] = 'seventy eight';
$lang['mathcaptcha_numeric_word_79'] = 'seventy nine';
$lang['mathcaptcha_numeric_word_80'] = 'eighty';
$lang['mathcaptcha_numeric_word_81'] = 'eighty one';
$lang['mathcaptcha_numeric_word_82'] = 'eighty two';
$lang['mathcaptcha_numeric_word_83'] = 'eighty three';
$lang['mathcaptcha_numeric_word_84'] = 'eighty four';
$lang['mathcaptcha_numeric_word_85'] = 'eighty five';
$lang['mathcaptcha_numeric_word_86'] = 'eighty six';
$lang['mathcaptcha_numeric_word_87'] = 'eighty seven';
$lang['mathcaptcha_numeric_word_88'] = 'eighty eight';
$lang['mathcaptcha_numeric_word_89'] = 'eighty nine';
$lang['mathcaptcha_numeric_word_90'] = 'ninety';
$lang['mathcaptcha_numeric_word_91'] = 'ninety one';
$lang['mathcaptcha_numeric_word_92'] = 'ninety two';
$lang['mathcaptcha_numeric_word_93'] = 'ninety three';
$lang['mathcaptcha_numeric_word_94'] = 'ninety four';
$lang['mathcaptcha_numeric_word_95'] = 'ninety five';
$lang['mathcaptcha_numeric_word_96'] = 'ninety six';
$lang['mathcaptcha_numeric_word_97'] = 'ninety seven';
$lang['mathcaptcha_numeric_word_98'] = 'ninety eight';
$lang['mathcaptcha_numeric_word_99'] = 'ninety nine';
$lang['mathcaptcha_numeric_word_100'] = 'one hundred';

/**
 * Addition phrases for two numbers
 */
$lang['mathcaptcha_addition_2_1'] = 'What is !1 plus !2?';
$lang['mathcaptcha_addition_2_2'] = 'Add together !1 and !2';
$lang['mathcaptcha_addition_2_3'] = 'What do you get if you add !1 to !2?';
$lang['mathcaptcha_addition_2_4'] = 'Add !1 to !2, what do you get?';
$lang['mathcaptcha_addition_2_5'] = 'What is the sum of !1 and !2?';

/**
 * Subraction phrases for two numbers
 * In this case !2 is always >= !1
 */
$lang['mathcaptcha_subtraction_2_1'] = 'What is !2 minus !1?';
$lang['mathcaptcha_subtraction_2_2'] = 'Substract !1 from !2';
$lang['mathcaptcha_subtraction_2_3'] = 'Substract !1 from !2, what do you get?';
$lang['mathcaptcha_subtraction_2_4'] = 'What do you get if you substract !1 from !2?';
$lang['mathcaptcha_subtraction_2_5'] = 'What is the substraction !1 from !2?';

/**
 * Multiplication phrases for two numbers
 */
$lang['mathcaptcha_multiplication_2_1'] = 'What is !1 times !2?';
$lang['mathcaptcha_multiplication_2_2'] = 'What is !1 multiplied by !2?';
$lang['mathcaptcha_multiplication_2_3'] = 'Multiply !1 by !2, what do you get?';
$lang['mathcaptcha_multiplication_2_4'] = 'What do you get if you multiply !1 by !2?';
$lang['mathcaptcha_multiplication_2_5'] = 'What is the multiplication of !1 and !2?';

/**
 * Division phrases for two numbers
 * In this case !1 is a number we will divide
 */
$lang['mathcaptcha_division_2_1'] = 'Divide !1 by !2?';
$lang['mathcaptcha_division_2_2'] = 'What is !1 divided by !2?';
$lang['mathcaptcha_division_2_3'] = 'Divide !1 by !2, what do you get?';
$lang['mathcaptcha_division_2_4'] = 'What do yiu get if you divide !1 by !2?';
$lang['mathcaptcha_division_2_5'] = 'What is the division of !1 by !2?';

/* End of file mathcaptcha_lang.php */
/* Location: ./application/languages/english/mathcaptcha_lang.php */


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Mycologia 24: 181 (1932)

#### Original name
Puccinia proluviosa H.S. Jacks. & Holw.

### Remarks
null


text:
exports.templateData = {};
exports.loadOptions = {
  preserveWhitespace: true
};


text:
{
  const Type = Object.freeze({

    CREATE_ROOT_COMPONENT: Symbol('init-root-component'),
    UPDATE_COMPONENT: Symbol('update-component'),

    ADD_ELEMENT: Symbol('add-element'),
    REMOVE_ELEMENT: Symbol('remove-element'),

    ADD_COMPONENT: Symbol('add-component'),
    REMOVE_COMPONENT: Symbol('remove-component'),

    ADD_ATTRIBUTE: Symbol('add-attribute'),
    REPLACE_ATTRIBUTE: Symbol('replace-attribute'),
    REMOVE_ATTRIBUTE: Symbol('remove-attribute'),

    ADD_DATA_ATTRIBUTE: Symbol('add-data-attribute'),
    REPLACE_DATA_ATTRIBUTE: Symbol('replace-data-attribute'),
    REMOVE_DATA_ATTRIBUTE: Symbol('remove-data-attribute'),

    ADD_STYLE_PROPERTY: Symbol('add-style-property'),
    REPLACE_STYLE_PROPERTY: Symbol('replace-style-property'),
    REMOVE_STYLE_PROPERTY: Symbol('remove-style-property'),

    ADD_CLASS_NAME: Symbol('add-class-name'),
    REMOVE_CLASS_NAME: Symbol('remove-class-name'),

    ADD_LISTENER: Symbol('add-listener'),
    REPLACE_LISTENER: Symbol('replace-listener'),
    REMOVE_LISTENER: Symbol('remove-listener'),

    INSERT_CHILD_NODE: Symbol('insert-child-node'),
    MOVE_CHILD_NODE: Symbol('move-child-node'),
    REMOVE_CHILD_NODE: Symbol('remove-child-node'),

    SET_TEXT_CONTENT: Symbol('set-text-content'),
    REMOVE_TEXT_CONTENT: Symbol('remove-text-content'),
  });

  const Patch = class {

    constructor(type, props) {
      Object.assign(this, {
        type
      }, props);
    }

    static createRootComponent(root) {
      return new Patch(Type.CREATE_ROOT_COMPONENT, {
        root,
        apply: () => {
          root.props = null;
        }
      });
    }

    static updateComponent(target, props) {
      return new Patch(Type.UPDATE_COMPONENT, {
        target,
        props,
        apply: () => {
          target.props = props;
        }
      });
    }

    static addAttribute(name, value, target) {
      return new Patch(Type.ADD_ATTRIBUTE, {
        name,
        value,
        target,
        apply: () => {
          target.setAttribute(name, value);
          Reactor.Document.setAttribute(target.ref, name, value);
        }
      });
    }

    static replaceAttribute(name, value, target) {
      return new Patch(Type.REPLACE_ATTRIBUTE, {
        name,
        value,
        target,
        apply: () => {
          target.setAttribute(name, value);
          Reactor.Document.setAttribute(target.ref, name, value);
        }
      });
    }

    static removeAttribute(name, target) {
      return new Patch(Type.REMOVE_ATTRIBUTE, {
        name,
        target,
        apply: () => {
          target.removeAttribute(name);
          Reactor.Document.removeAttribute(target.ref, name);
        }
      });
    }

    static addDataAttribute(name, value, target) {
      return new Patch(Type.ADD_DATA_ATTRIBUTE, {
        name,
        value,
        target,
        apply: () => {
          target.setDataAttribute(name, value);
          Reactor.Document.setDataAttribute(target.ref, name, value);
        }
      });
    }

    static replaceDataAttribute(name, value, target) {
      return new Patch(Type.REPLACE_DATA_ATTRIBUTE, {
        name,
        value,
        target,
        apply: () => {
          target.setDataAttribute(name, value);
          Reactor.Document.setDataAttribute(target.ref, name, value);
        }
      });
    }

    static removeDataAttribute(name, target) {
      return new Patch(Type.REMOVE_DATA_ATTRIBUTE, {
        name,
        target,
        apply: () => {
          target.removeDataAttribute(name);
          Reactor.Document.removeDataAttribute(target.ref, name);
        }
      });
    }
    static addStyleProperty(property, value, target) {
      return new Patch(Type.ADD_STYLE_PROPERTY, {
        property,
        value,
        target,
        apply: () => {
          target.setStyleProperty(property, value);
          Reactor.Document.setStyleProperty(target.ref, property, value);
        }
      });
    }

    static replaceStyleProperty(property, value, target) {
      return new Patch(Type.REPLACE_STYLE_PROPERTY, {
        property,
        value,
        target,
        apply: () => {
          target.setStyleProperty(property, value);
          Reactor.Document.setStyleProperty(target.ref, property, value);
        }
      });
    }

    static removeStyleProperty(property, target) {
      return new Patch(Type.REMOVE_STYLE_PROPERTY, {
        property,
        target,
        apply: () => {
          target.removeStyleProperty(property);
          Reactor.Document.removeStyleProperty(target.ref, property);
        }
      });
    }

    static addClassName(name, target) {
      return new Patch(Type.ADD_CLASS_NAME, {
        name,
        target,
        apply: () => {
          target.addClassName(name);
          Reactor.Document.addClassName(target.ref, name);
        }
      });
    }

    static removeClassName(name, target) {
      return new Patch(Type.REMOVE_CLASS_NAME, {
        name,
        target,
        apply: () => {
          target.removeClassName(name);
          Reactor.Document.removeClassName(target.ref, name);
        }
      });
    }

    static addListener(event, listener, target) {
      return new Patch(Type.ADD_LISTENER, {
        event,
        listener,
        target,
        apply: () => {
          target.addListener(event, listener);
          Reactor.Document.addEventListener(target.ref, event, listener);
        }
      });
    }

    static replaceListener(event, removed, added, target) {
      return new Patch(Type.REPLACE_LISTENER, {
        event,
        removed,
        added,
        target,
        apply: () => {
          target.removeListener(event, removed);
          Reactor.Document.removeEventListener(target.ref, event, removed);
          target.addListener(event, added);
          Reactor.Document.addEventListener(target.ref, event, added);
        }
      });
    }

    static removeListener(event, listener, target) {
      return new Patch(Type.REMOVE_LISTENER, {
        event,
        listener,
        target,
        apply: () => {
          target.removeListener(event, listener);
          Reactor.Document.removeEventListener(target.ref, event, listener);
        }
      });
    }

    static addElement(element, parent) {
      return new Patch(Type.ADD_ELEMENT, {
        element,
        parent,
        apply: () => {
          parent.appendChild(element);
          Reactor.Document.attachElementTree(element, domElement => {
            parent.parentElement.ref.appendChild(domElement);
          });
        }
      });
    }

    static removeElement(element, parent) {
      return new Patch(Type.REMOVE_ELEMENT, {
        element,
        parent,
        apply: () => {
          parent.removeChild(element);
          element.ref.remove();
        }
      });
    }

    static addComponent(component, parent) {
      return new Patch(Type.ADD_COMPONENT, {
        component,
        parent,
        apply: () => {
          const comment = parent.placeholder.ref;
          const parentDomNode = parent.parentElement.ref;
          if (parent.isRoot()) {
            parent.appendChild(component);
            Reactor.Document.attachElementTree(component, domNode => {
              if (parentDomNode.hasChildNodes()) {
                Reactor.Document.replaceChild(
                  domNode, parentDomNode.firstChild, parentDomNode);
              } else {
                Reactor.Document.appendChild(domNode, parentDomNode);
              }
            });
          } else {
            parent.appendChild(component);
            Reactor.Document.attachElementTree(component, domNode => {
              Reactor.Document.replaceChild(domNode, comment, parentDomNode);
            });
          }
        }
      });
    }

    static removeComponent(component, parent) {
      return new Patch(Type.REMOVE_COMPONENT, {
        component,
        parent,
        apply: () => {
          const domChildNode = (component.childElement || component.placeholder).ref;
          parent.removeChild(component);
          parent.placeholder.ref = Reactor.Document.createComment(parent.placeholder);
          parent.parentElement.ref.replaceChild(parent.placeholder.ref, domChildNode);
        }
      });
    }

    static insertChildNode(node, at, parent) {
      return new Patch(Type.INSERT_CHILD_NODE, {
        node,
        at,
        parent,
        apply: () => {
          parent.insertChild(node, at);
          Reactor.Document.attachElementTree(node, domNode => {
            parent.ref.insertBefore(domNode, parent.ref.childNodes[at]);
          });
        }
      });
    }

    static moveChildNode(node, from, to, parent) {
      return new Patch(Type.MOVE_CHILD_NODE, {
        node,
        from,
        to,
        parent,
        apply: () => {
          parent.moveChild(node, from, to);
          Reactor.Document.moveChild(node.ref, from, to, parent.ref);
        }
      });
    }

    static removeChildNode(node, at, parent) {
      return new Patch(Type.REMOVE_CHILD_NODE, {
        node,
        at,
        parent,
        apply: () => {
          parent.removeChild(node);
          Reactor.Document.removeChild(node.ref, parent.ref);
        }
      });
    }

    static setTextContent(element, text) {
      return new Patch(Type.SET_TEXT_CONTENT, {
        element,
        text,
        apply: () => {
          element.text = text;
          Reactor.Document.setTextContent(element.ref, text);
        }
      });
    }

    static removeTextContent(element) {
      return new Patch(Type.REMOVE_TEXT_CONTENT, {
        element,
        apply: () => {
          element.text = null;
          Reactor.Document.setTextContent(element.ref, '');
        }
      });
    }

    static get Type() {
      return Object.assign({}, Type);
    }
  };

  module.exports = Patch;
}


text:
<?php namespace Mmanos\Metable\Commands;

use Illuminate\Console\Command;
use Illuminate\Support\Str;
use Illuminate\Support\Facades\File;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;

class MetasCommand extends Command
{
    /**
     * The console command name.
     *
     * @var string
     */
    protected $name = 'laravel-metable:metas';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Create a migration and model for a metas summary table';

    /**
     * Execute the console command.
     *
     * @return void
     */
    public function fire()
    {
        $full_migration_path = $this->createBaseMigration();
        file_put_contents($full_migration_path, $this->getMigrationStub());
        $this->info('Migration created successfully!');

        $full_model_path = $this->createBaseModel();
        file_put_contents($full_model_path, $this->getModelStub());
        $this->info('Model created successfully!');

        $this->call('optimize');
    }

    /**
     * Return the name of the table to create.
     *
     * @return string
     */
    protected function tableName()
    {
        return $this->argument('table') ?: 'metas';
    }

    /**
     * Create a base migration file.
     *
     * @return string
     */
    protected function createBaseMigration()
    {
        $name = 'create_' . $this->tableName() . '_table';

        $path = base_path('database/migrations');

        return $this->laravel['migration.creator']->create($name, $path);
    }

    /**
     * Get the contents of the migration stub.
     *
     * @return string
     */
    protected function getMigrationStub()
    {
        $stub = file_get_contents(__DIR__.'/../Stubs/MetasMigration.stub.php');

        $stub = str_replace('{{table}}', $this->tableName(), $stub);
        $stub = str_replace(
            '{{class}}',
            'Create' . Str::studly($this->tableName()) . 'Table',
            $stub
        );

        return $stub;
    }

    /**
     * Create a base model file.
     *
     * @return string
     */
    protected function createBaseModel()
    {
        $name_parts = explode('_', $this->tableName());

        $path = app_path();

        for ($i = 0; $i < (count($name_parts) - 1); $i++) {
            $path .= '/' . Str::studly(Str::singular($name_parts[$i]));
        }

        if (count($name_parts) > 1 && !File::exists($path)) {
            File::makeDirectory($path, 0755, true);
        }

        $path .= '/' . Str::studly(Str::singular(end($name_parts))) . '.php';

        return $path;
    }

    /**
     * Get the contents of the model stub.
     *
     * @return string
     */
    protected function getModelStub()
    {
        $stub = file_get_contents(__DIR__.'/../Mmanos/Metable/Stubs/MetaModel.stub.php');

        $name_parts = explode('_', $this->tableName());
        $namespace = '';
        for ($i = 0; $i < (count($name_parts) - 1); $i++) {
            $namespace .= '\\' . Str::studly(Str::singular($name_parts[$i]));
        }
        $namespace = trim($namespace, '\\');
        $class = Str::studly(Str::singular(end($name_parts)));

        $stub = str_replace('{{namespace}}', empty($namespace) ? '' : " namespace {$namespace};", $stub);
        $stub = str_replace('{{class}}', $class, $stub);
        $stub = str_replace('{{table}}', $this->tableName(), $stub);

        return $stub;
    }

    /**
     * Get the console command arguments.
     *
     * @return array
     */
    protected function getArguments()
    {
        return array(
            array('table', InputArgument::OPTIONAL, 'The name of your metas table (default is metas).'),
        );
    }
}