text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE chapter PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
  "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">

<chapter id="bbv2.tasks">
  <title>Common tasks</title>

  <para>This section describes main targets types that Boost.Build supports
  of-of-the-box. Unless otherwise noted, all mentioned main target rules
  have the common signature, described in <xref
  linkend="bbv2.advanced.targets"/>.
  </para>

    <title>Programs</title>

      <indexterm><primary>Builtin
      rules</primary><secondary>exe</secondary></indexterm>
      <para>Programs are created using the exe rule, which
        follows the <link linkend="bbv2.main-target-rule-syntax">common
          syntax</link>. For example:
<programlisting>
exe hello : hello.cpp some_library.lib /some_project//library
          : <threading>multi
          ;
</programlisting>
        This will create an executable file from the sources -- in this case,
        one C++ file, one library file present in the same directory, and
        another library that is created by Boost.Build. Generally, sources
        can include C and C++ files, object files and libraries. Boost.Build
        will automatically try to convert targets of other types.
      </para>

      <tip>
        <para>
          On Windows, if an application uses dynamic libraries, and both
          the application and the libraries are built by Boost.Build, its not
          possible to immediately run the application, because the
          <literal>PATH</literal> environment variable should include the path
          to the libraries. It means you have to either add the paths
          manually, or place the application and the libraries to the same
          directory. See <xref linkend="bbv2.tasks.installing"/>.
        </para>

      </tip>

      <title>Libraries</title>

      <para>Libraries are created using the lib rule, which
        follows the <link linkend="bbv2.main-target-rule-syntax">common
          syntax</link>. For example:
<programlisting>
lib helpers : helpers.cpp : <include>boost : : <include>. ;
</programlisting>
      </para>

      <para>In the most common case, the lib creates a library
        from the specified sources. Depending on the value of
        <link> feature the library will be either static or
        shared. There are two other cases. First is when the library is
        installed somewhere in compiler's search paths, and should be
        searched by the compiler (typically, using the <option>-l</option>
        option). The second case is where the library is available as a
        prebuilt file and the full path is known.

        </para>

      <para>
        The syntax for these case is given below:
<programlisting>
lib z : : <name>z <search>/home/ghost ;
lib compress : : <file>/opt/libs/compress.a ;
</programlisting>
        The name property specifies the name that should be
        passed to the <option>-l</option> option, and the file
        property specifies the file location. The <varname>search</varname> feature
        specifies paths in which to search for the library. That feature can
        be specified several times, or it can be omitted, in which case only
        default compiler paths will be searched.
      </para>

      <para>The difference between using the <varname>file</varname> feature as
        opposed to the <varname>name</varname> feature together with the
        <varname>search</varname> feature is that <varname>file</varname> is more
        precise. A specific file will be used. On the other hand, the
        <varname>search</varname> feature only adds a library path, and the
        <varname>name</varname> feature gives the basic name of the library. The
        search rules are specific to the linker. For example, given these
        definition:
<programlisting>
lib a : : <variant>release <file>/pool/release/a.so ;
lib a : : <variant>debug <file>/pool/debug/a.so ;
lib b : : <variant>release <file>/pool/release/b.so ;
lib b : : <variant>debug <file>/pool/debug/b.so ;
</programlisting>
        It's possible to use release version of a and debug
        version of b. Had we used the <varname>name</varname> and
        <varname>search</varname> features, the linker would always pick either
        release or debug versions.

      </para>

      <para>
        For convenience, the following syntax is allowed:
<programlisting>
lib z ;
lib gui db aux ;
</programlisting>
          and is does exactly the same as:
<programlisting>
lib z : : <name>z ;
lib gui : : <name>gui ;
lib db : : <name>db ;
lib aux : : <name>aux ;
</programlisting>
      </para>

      <para>When a library uses another library you should put that other
        library in the list of sources. This will do the right thing in all
        cases. For portability, you should specify library dependencies even
        for searched and prebuilt libraries, othewise, static linking on
        Unix won't work. For example:
<programlisting>
lib z ;
lib png : z : <name>png ;
</programlisting>
        </para>

      <note>
        <para>When a library (say, a), that has another
          library, (say, b)

          is linked dynamically, the b
          library will be incorporated

          in a. (If b
          is dynamic library as well, then a will only refer to
          it, and not include any extra code.)

          When the a
          library is linked statically, Boost.Build will assure that all
          executables that link to a will also link to
          b.
        </para>
      </note>

      <para>One feature of Boost.Build that is very important for libraries
        is usage requirements.

        For example, if you write:
<programlisting>
lib helpers : helpers.cpp : : : <include>. ;
</programlisting>
        then the compiler include path for all targets that use
        helpers will contain the directory

        where the target is defined.path to "helpers.cpp". The user
        only needs to add helpers to the list of sources,
        and needn't consider the requirements its use imposes on a
        dependent target. This feature greatly simplifies Jamfiles.

      </para>

      <note>
        <para>If you don't want shared libraries to include all libraries
          that are specified in sources (especially statically linked ones),
          you'd need to use the following:
<programlisting>
lib b : a.cpp ;
lib a : a.cpp : <use>b : : <library>b ;
</programlisting>
          This specifies that a uses b, and causes
          all executables that link to a also link to
          b. In this case, even for shared linking, the
          a library won't even refer to b.
        </para>
      </note>

      <title>Alias</title>

      <para>
        The <functionname>alias</functionname> rule gives alternative name to
        a group of targets. For example, to give the name
        <filename>core</filename> to a group of three other targets with the
        following code:
        <programlisting>
alias core : im reader writer ;</programlisting>
        Using <filename>core</filename> on the command line, or in the source list
        of any other target is the same as explicitly using
        <filename>im</filename>, <filename>reader</filename>, and
        <filename>writer</filename>, but it is just more convenient.

      </para>

      <para>
        Another use of the alias rule is to change build
        properties. For example, if you always want static linking for a
        specific C++ Boost library, you can write the following:
<programlisting>
alias threads : /boost/thread//boost_thread : <link>static ;
</programlisting>
        and use only the threads alias in your Jamfiles.

      </para>

      <para>
        You can also specify usage requirements for the
        alias target. If you write the following:
<programlisting>
alias header_only_library : : : :  <include>/usr/include/header_only_library ;
</programlisting>
        then using header_only_library in sources will only add an
        include path. Also note that when there are some sources, their usage
        requirements are propagated, too. For example:
<programlisting>
lib lib : lib.cpp : : : <include>. ;
alias lib_alias ;
exe main : main.cpp lib_alias ;
</programlisting>
        will compile <filename>main.cpp</filename> with the additional include.
      </para>

      <title>Installing</title>

      <para>This section describes various ways to install built target
      and arbitrary files.</para>

      <bridgehead>Basic install</bridgehead>

      <para>For installing a built target you should use the
        install rule, which follows the <link
          linkend="bbv2.main-target-rule-syntax">common syntax</link>. For
        example:
<programlisting>
install dist : hello helpers ;
</programlisting>
        will cause the targets hello and helpers to
        be moved to the <filename>dist</filename> directory, relative to
        Jamfile's directory. The directory can
        be changed with the location property:
<programlisting>
install dist : hello helpers : <location>/usr/bin ;
</programlisting>
        While you can achieve the same effect by changing the target name to
        <filename>/usr/bin</filename>, using the location
        property is better, because it allows you to use a mnemonic target
        name.
      </para>

      <para>The location property is especially handy when the location
        is not fixed, but depends on build variant or environment variables:
<programlisting>
install dist : hello helpers : <variant>release:<location>dist/release
                             <variant>debug:<location>dist/debug ;
install dist2 : hello helpers : <location>$(DIST) ;
</programlisting>
        See also <link linkend="bbv2.reference.variants.propcond">conditional
          properties</link> and <link linkend="bbv2.faq.envar">environment variables</link>
      </para>

      <bridgehead>Installing with all dependencies</bridgehead>

      <para>
        Specifying the names of all libraries to install can be boring. The
        install allows you to specify only the top-level executable
        targets to install, and automatically install all dependencies:
<programlisting>
install dist : hello
           : <install-dependencies>on <install-type>EXE
             <install-type>LIB
           ;
</programlisting>
        will find all targets that hello depends on, and install
        all of those which are either executables or libraries. More
        specifically, for each target, other targets that were specified as
        sources or as dependency properties, will be recursively found.  One
        exception is that targets referred with the <link
        linkend="bbv2.builtin.features.use">use</link> feature
        are not considered, because that feature is typically used to refer to
        header-only libraries.
        If the set of target types is specified, only targets of that type
        will be installed, otherwise, all found target will be installed.
      </para>

      <bridgehead>Preserving Directory Hierarchy</bridgehead>

      <para>By default, the install rules will stip paths from
      it's sources. So, if sources include <filename>a/b/c.hpp</filename>,
      the <filename>a/b</filename> part will be ignored. To make the
      install rule preserve the directory hierarchy you need
      to use the install-source-root feature to specify the
      root of the hierarchy you are installing. Relative paths from that
      root will be preserved. For example, if you write:

<programlisting>
install headers
    : a/b/c.h
    : <location>/tmp <install-source-root>a
    ;
</programlisting>

      the a file named <filename>/tmp/b/c.h</filename> will be created.
      </para>

      <bridgehead>Installing into Several Directories</bridgehead>

      <para>The <link linkend="bbv2.tasks.alias">alias</link>
      rule can be used when targets must be installed into several
      directories:
<programlisting>
alias install : install-bin install-lib ;
install install-bin : applications : /usr/bin ;
install install-lib : helper : /usr/lib ;
</programlisting>
    </para>

    <para>Because the install rule just copies targets, most
    free features <footnote><para>see the definition of "free" in <xref
    linkend="bbv2.reference.features.attributes"/>.</para></footnote>
    have no effect when used in requirements of the install rule.
    The only two which matter are
    <link linkend="bbv2.builtin.features.dependency">
    <varname>dependency</varname></link> and, on Unix,
    <link linkend="bbv2.reference.features.dll-path"><varname>dll-path</varname></link>.
    </para>

    <note>
      <para>
        (Unix specific). On Unix, executables built with Boost.Build typically
        contain the list of paths to all used dynamic libraries. For
        installing, this is not desired, so Boost.Build relinks the executable
        with an empty list of paths. You can also specify additional paths for
        installed executables with the <varname>dll-path</varname> feature.
      </para>
    </note>

      <title>Testing</title>

      <para>Boost.Build has convenient support for running unit tests. The
        simplest way is the unit-test rule, which follows the
        <link linkend="bbv2.main-target-rule-syntax">common syntax</link>. For
        example:
<programlisting>
unit-test helpers_test : helpers_test.cpp helpers ;
</programlisting>
      </para>

      <para>The <functionname>unit-test</functionname> rule behaves like the
        <functionname>exe</functionname> rule, but after the executable is created it is
        run. If the executable returns an error code, the build system will also
        return an error and will try running the executable on the next
        invocation until it runs successfully. This behaviour ensures that you
        can't miss a unit test failure.
      </para>

      <para>By default, the executable is run directly. Sometimes, it's
      desirable to run the executable using some helper command. You should use the
      <literal>testing.launcher</literal> property to specify the name of the
      helper command. For example, if you write:
      </para>
<programlisting>
unit-test helpers_test
   : helpers_test.cpp helpers
   : <emphasis role="bold"><testing.launcher>valgrind</emphasis>
   ;
</programlisting>
      <para>The command used to run the executable will be:</para>
<screen>
<emphasis role="bold">valgrind</emphasis> bin/$toolset/debug/helpers_test
</screen>

      <para>There are few specialized testing rules, listed below:
      <programlisting>
rule compile ( sources : requirements * : target-name ? )
rule compile-fail ( sources : requirements * : target-name ? )
rule link ( sources + : requirements * : target-name ? )
rule link-fail ( sources + : requirements * : target-name ? )
      </programlisting>
      They are are given a list of sources and requirements.
      If the target name is not provided, the name of the first
      source file is used instead. The <literal>compile*</literal>
      tests try to compile the passed source. The <literal>link*</literal>
      rules try to compile and link an application from all the passed sources.
      The <literal>compile</literal> and <literal>link</literal> rules expect
      that compilation/linking succeeds. The <literal>compile-fail</literal>
      and <literal>link-fail</literal> rules, on the opposite, expect that
      the compilation/linking fails.
      </para>

      <para>There are two specialized rules for running applications, which
      are more powerful than the unit-test rule. The
      run rule has the following signature:
      <programlisting>
rule run ( sources + : args * : input-files * : requirements * : target-name ?
    : default-build * )
      </programlisting>
      The rule builds application from the provided sources and runs it,
      passing <varname>args</varname> and <varname>input-files</varname>
      as command-line arguments. The <varname>args</varname> parameter
      is passed verbatim and the values of the <varname>input-files</varname>
      parameter are treated as paths relative to containing Jamfile, and are
      adjusted if <command>bjam</command> is invoked from a different
      directory. The run-fail rule is identical to the
      run rule, except that it expects that the run fails.
      </para>

      <para>All rules described in this section, if executed successfully,
      create a special manifest file to indicate that the test passed.
      For the unit-test rule the files is named
      <filename><replaceable>target-name</replaceable>.passed</filename> and
      for the other rules it is called
      <filename><replaceable>target-name</replaceable>.test</filename>.
      The run* rules also capture all output from the program,
      and store it in a file named
      <filename><replaceable>target-name</replaceable>.output</filename>.</para>

      <para>The run and the run-fail rules, if
      the test passes, automatically delete the linked executable, to
      save space. This behaviour can be suppressed by passing the
      <literal>--preserve-test-targets</literal> command line option.</para>

      <para>It is possible to print the list of all test targets (except for
      unit-test) declared in your project, by passing
      the <literal>--dump-tests</literal> command-line option. The output
      will consist of lines of the form:
      <screen>
boost-test(<replaceable>test-type</replaceable>) <replaceable>path</replaceable> : <replaceable>sources</replaceable>
      </screen>
      </para>

      <para>It is possible to process the list of tests, the output of
      bjam during command run, and the presense/absense of the
      <filename>*.test</filename> files created when test passes into
      human-readable status table of tests. Such processing utilities
      are not included in Boost.Build.</para>

      <title>Custom commands</title>

      <para>When you use most of main target rules, Boost.Build automatically
      figures what commands to run and it what order. As soon as you want
      to use new file types, or support new tools, one approach is to
      extend Boost.Build to smoothly support them, as documented in
      <xref linkend="bbv2.extender"/>. However, if there's a single
      place where the new tool is used, it might be easier to just
      explicitly specify the commands to run.</para>

      <para>Three main target rules can be used for that. The
      <functionname>make</functionname> rule allows you to construct
      a single file from any number of source file, by running a
      command you specify. The <functionname>notfile</functionname> rule
      allows you to run an arbitrary command, without creating any files.
      Finaly, the <functionname>generate</functionname> rule allows you
      to describe transformation using Boost.Build's virtual targets.
      This is higher-level than file names that the make rule operates with,
      and allows you to create more than one target, or create differently
      named targets depending on properties, or use more than one
      tool.</para>

      <para>The <functionname>make</functionname> rule is used when you want to
      create one file from a number of sources using some specific command.
      The <functionname>notfile</functionname> is used to unconditionally run
      a command.
      </para>

      <para>
        Suppose you want to create file <filename>file.out</filename> from
        file <filename>file.in</filename> by running command
        <command>in2out</command>. Here's how you'd do this in Boost.Build:
<programlisting>
actions in2out
{
    in2out $(<) $(>)
}
make file.out : file.in : @in2out ;
</programlisting>
        If you run <command>bjam</command> and <filename>file.out</filename>
        does not exist, Boost.Build will run the <command>in2out</command>
        command to create that file. For more details on specifying actions,
        see <xref linkend="bbv2.advanced.jam_language.actions"/>.
      </para>

      <para>
        It could be that you just want to run some command unconditionally,
        and that command does not create any specific files. The, you can use
        the <functionname>notfile</functionname> rule. For example:
<programlisting>
notfile echo_something : @echo ;
actions echo
{
    echo "something"
}
</programlisting>
        The only difference from the <functionname>make</functionname> rule is
        that the name of the target is not considered a name of a file, so
        Boost.Build will unconditionally run the action.
      </para>

      <para>The <functionname>generate</functionname> rule is used when
      you want to express transformations using Boost.Build's virtual targets,
      as opposed to just filenames. The <functionname>generate</functionname>
      rule has the standard main target rule signature, but you are required
      to specify the <literal>generating-rule</literal> property. The value
      of the property should be in the form
      <literal>@<replaceable>rule-name</replaceable></literal> and the named
      rule should have the following signature:
      <programlisting>
rule generating-rule ( project name : property-set : sources * )
      </programlisting>
      and will be called with an instance of the project-target
      class, the name of the main target, an instance of the
      property-set class containing build properties,
      and the list of instances of the virtual-target class
      corresponding to sources.
      The rule must return a list of virtual-target instances.
      The interface of the virtual-target class can be learned
      by looking at the <filename>build/virtual-target.jam</filename> file.
      The <filename>generate</filename> example in Boost.Build distribution
      illustrates how the <literal>generate</literal> rule can be used.
      </para>

      <title>Precompiled Headers</title>

      <para>Precompiled headers is a mechanism to speed up compilation
      by creating a partially processed version of some header files,
      and then using that version during compilations rather then
      repeatedly parsing the original headers. Boost.Build supports
      precompiled headers with gcc and msvc toolsets.</para>

      <para>To use precompiled headers, follow these steps:</para>
      <orderedlist>
        <listitem><para>Create a header that includes big headers used by your project.
        It's better to include only headers that are sufficiently stable —
        like headers from the compiler, and external libraries. Please wrap
        the header in #ifdef BOOST_BUILD_PCH_ENABLED, so that
        the potentially expensive inclusion of headers is not done
        when PCH is not enabled. Include the new header at the top of your
        source files.</para></listitem>

        <listitem><para>Declare a new Boost.Build target for the precompiled header
        and add that precompiled header to the sources of the target whose compilation
        you want to speed up:
        <programlisting>
cpp-pch pch : header.hpp ;
exe main : main.cpp pch ;</programlisting>
        You can use the c-pch if you want to use the precompiled
        header in C programs.
        </para></listitem>

      </orderedlist>
      <para>The <filename>pch</filename> example in Boost.Build distribution
      can be used as reference.</para>

      <para>Please note the following:</para>
      <itemizedlist>
        <listitem><para>The inclusion of the precompiled header must be the
        first thing in a source file, before any code or preprocessor directives.
        </para></listitem>

        <listitem><para>The build properties used to compile the source files
        and  the precompiled header must be the same. Consider using
        project requirements to assure this.
        </para></listitem>

        <listitem><para>Precompiled headers must be used purely as a way to
        improve compilation time, not to save the number of #include
        statements. If a source file needs to include some header, explicitly include
        it in the source file, even if the same header is included from
        the precompiled header. This makes sure that your project will build
        even if precompiled headers are not supported.</para></listitem>

      </itemizedlist>

      <title>Generated headers</title>

      <para>Usually, Boost.Build handles implicit dependendies completely
        automatically. For example, for C++ files, all <literal>#include</literal>
        statements are found and handled. The only aspect where user help
        might be needed is implicit dependency on generated files.</para>

      <para>By default, Boost.Build handles such dependencies within one
        main target. For example, assume that main target "app" has two
        sources, "app.cpp" and "parser.y". The latter source is converted
        into "parser.c" and "parser.h". Then, if "app.cpp" includes
        "parser.h", Boost.Build will detect this dependency. Moreover,
        since "parser.h" will be generated into a build directory, the
        path to that directory will automatically added to include
        path.</para>

      <para>Making this mechanism work across main target boundaries is
        possible, but imposes certain overhead. For that reason, if
        there's implicit dependency on files from other main targets, the
        <literal><implicit-dependency></literal> [ link ] feature must
        be used, for example:</para>

<programlisting>
lib parser : parser.y ;
exe app : app.cpp : <implicit-dependency>parser ;
</programlisting>

      <para>
        The above example tells the build system that when scanning
        all sources of "app" for implicit-dependencies, it should consider
        targets from "parser" as potential dependencies.
      </para>

</chapter>


text:
=======
Remarks
=======

Type annotations
----------------

``pytest-mock`` is fully type annotated, letting users use static type checkers to
test their code.

The ``mocker`` fixture returns ``pytest_mock.MockerFixture`` which can be used
to annotate test functions:

.. code-block:: python

    from pytest_mock import MockerFixture

    def test_foo(mocker: MockerFixture) -> None:
        ...

The type annotations have been checked with ``mypy``, which is the only
type checker supported at the moment; other type-checkers might work
but are not currently tested.

Why bother with a plugin?
=========================

There are a number of different ``patch`` usages in the standard ``mock`` API,
but IMHO they don't scale very well when you have more than one or two
patches to apply.

It may lead to an excessive nesting of ``with`` statements, breaking the flow
of the test:

.. code-block:: python

    import mock

    def test_unix_fs():
        with mock.patch('os.remove'):
            UnixFS.rm('file')
            os.remove.assert_called_once_with('file')

            with mock.patch('os.listdir'):
                assert UnixFS.ls('dir') == expected
                # ...

        with mock.patch('shutil.copy'):
            UnixFS.cp('src', 'dst')
            # ...

One can use ``patch`` as a decorator to improve the flow of the test:

.. code-block:: python

    @mock.patch('os.remove')
    @mock.patch('os.listdir')
    @mock.patch('shutil.copy')
    def test_unix_fs(mocked_copy, mocked_listdir, mocked_remove):
        UnixFS.rm('file')
        os.remove.assert_called_once_with('file')

        assert UnixFS.ls('dir') == expected
        # ...

        UnixFS.cp('src', 'dst')
        # ...

But this poses a few disadvantages:

- test functions must receive the mock objects as parameter, even if you don't plan to
  access them directly; also, order depends on the order of the decorated ``patch``
  functions;
- receiving the mocks as parameters doesn't mix nicely with pytest's approach of
  naming fixtures as parameters, or ``pytest.mark.parametrize``;
- you can't easily undo the mocking during the test execution;

An alternative is to use ``contextlib.ExitStack`` to stack the context managers in a single level of indentation
to improve the flow of the test:

.. code-block:: python

    import contextlib
    import mock

    def test_unix_fs():
        with contextlib.ExitStack() as stack:
            stack.enter_context(mock.patch('os.remove'))
            UnixFS.rm('file')
            os.remove.assert_called_once_with('file')

            stack.enter_context(mock.patch('os.listdir'))
            assert UnixFS.ls('dir') == expected
            # ...

            stack.enter_context(mock.patch('shutil.copy'))
            UnixFS.cp('src', 'dst')
            # ...

But this is arguably a little more complex than using ``pytest-mock``.

Usage as context manager
------------------------

Although mocker's API is intentionally the same as ``mock.patch``'s, its use
as context manager and function decorator is **not** supported through the
fixture:

.. code-block:: python

    def test_context_manager(mocker):
        a = A()
        with mocker.patch.object(a, 'doIt', return_value=True, autospec=True):  # DO NOT DO THIS
            assert a.doIt() == True

The purpose of this plugin is to make the use of context managers and
function decorators for mocking unnecessary, so it will emit a warning when used as such.

If you really intend to mock a context manager, ``mocker.patch.context_manager`` exists
which won't issue the above warning.

redpajama_set_name: RedPajamaGithub


text:
package de.mpg.mis.neuesbibliothekssystem.dbmaster.index.services;

import com.sybase.jdbc3.jdbc.*; // Version 6
// Version 4.1
//import com.sybase.jdbcx.*;
import java.sql.*;
import java.util.*;

public class DBConnector {
    private Connection con;
    private String produkt;
    private String db;
    private String user;
    private String password;
    private String server;
    private int port;

    private Connection getSybaseConnection() throws Exception {
	// SybDriver
	// sybDriver=(SybDriver)Class.forName("com.sybase.jdbc.SybDriver").newInstance();
	SybDriver sybDriver = (SybDriver) Class.forName(
		"com.sybase.jdbc3.jdbc.SybDriver").newInstance();
	sybDriver.setVersion(com.sybase.jdbc3.jdbc.SybDriver.VERSION_6);
	try {
	    DriverManager.registerDriver(sybDriver);
	} catch (SQLException e) {
	    System.out.println("Fehler");
	}
	Properties props = new Properties();
	props.put("user", user);
	props.put("password", password);
	// Connection
	// test=DriverManager.getConnection("jdbc:sybase:Tds:194.95.184.5:5000/"+db,props);
	Connection test = DriverManager.getConnection("jdbc:sybase:Tds:"
		+ server + ":" + port + "/" + db, props);
	return test;
    }

    private Connection getMysqlConnection() throws Exception {
	Driver sybDriver = (Driver) Class.forName("com.mysql.jdbc.Driver")
		.newInstance();
	try {
	    DriverManager.registerDriver(sybDriver);
	} catch (SQLException e) {
	    System.out.println("Fehler");
	}
	Connection test = DriverManager.getConnection("jdbc:mysql:" + server
		+ ":" + port + "/" + db + "?user=" + user + "&password="
		+ password);
	return test;
    }

    private void produktToMethod() throws Exception {
	if (produkt.equals("Sybase")) {
	    con = getSybaseConnection();
	} else {
	    throw new Exception("nicht installiert");
	}

    }

    public DBConnector(String pr, String d, String u, String pa, String s, int p)
	    throws Exception {
	produkt = pr;
	db = d;
	user = u;
	password = pa;
	server = s;
	port = p;
    }

    public Connection getConnection() throws Exception {
	if (con == null) {
	    System.out.println("trying ...");
	    produktToMethod();
	    System.out.println("... connected.");
	}
	if (con.isClosed()) {
	    produktToMethod();
	}
	return con;
    }
}


text:
package org.apache.pulsar.functions.secretsproviderconfigurator;

import io.kubernetes.client.apis.AppsV1Api;
import io.kubernetes.client.apis.CoreV1Api;
import io.kubernetes.client.models.V1PodSpec;
import org.apache.pulsar.functions.proto.Function;

import java.lang.reflect.Type;
import java.util.Map;

/**
 * This file defines the SecretsProviderConfigurator interface. This interface is used by the function_workers
 * to choose the SecretProvider class name(if any) and its associated config at the time of starting
 * the function instances.
 */
public interface SecretsProviderConfigurator {
    /**
     * Initialize the SecretsProviderConfigurator
     * @return
     */
    default void init(Map<String, String> config) {}

    /**
     * Return the Secrets Provider Classname. This will be passed to the cmdline
     * of the instance and should contain the logic of connecting with the secrets
     * provider and obtaining secrets
     */
    String getSecretsProviderClassName(Function.FunctionDetails functionDetails);

    /**
     * Return the secrets provider config
     */
    Map<String, String> getSecretsProviderConfig(Function.FunctionDetails functionDetails);

    /**
     * Attaches any secrets specific stuff to the k8 container for kubernetes runtime
     */
    void configureKubernetesRuntimeSecretsProvider(V1PodSpec podSpec, String functionsContainerName, Function.FunctionDetails functionDetails);

    /**
     * Attaches any secrets specific stuff to the ProcessBuilder for process runtime
     */
    void configureProcessRuntimeSecretsProvider(ProcessBuilder processBuilder, Function.FunctionDetails functionDetails);

    /**
     * What is the type of the object that should be in the user secret config
     * @return
     */
    Type getSecretObjectType();

    /**
     * Do config checks to see whether the secrets provided are conforming
     */
    default void doAdmissionChecks(AppsV1Api appsV1Api, CoreV1Api coreV1Api, String jobNamespace, Function.FunctionDetails functionDetails) {}

}


text:
$(document).ready(function() {
  $.fn.dataTableExt.afnFiltering.push(function (oSettings, aData, iDataIndex) {
    if (oSettings.sTableId === "js-table-progress" || oSettings.sTableId === "js-table-all") {
      if ($('#' + oSettings.sTableId + '-container').find('.js-show-only-mine').is(':checked')) {
        return aData[0] === currentUser;
      }
      return true;
    }
    return true;
  });

  var progressTable = $('#js-table-progress').DataTable({
    // order by expiration date -- column 4
    'order': [[8, 'asc']],

    'aoColumnDefs': [
      { 'orderable': false, 'aTargets': [1] },
      { 'bVisible': false, 'aTargets': [0, 4, 7, 11] },
      { 'iDataSort': 7, 'aTargets': [8] },
      { 'iDataSort': 4, 'aTargets': [5] }
    ],
  });

  var allTable = $('#js-table-all').DataTable({
    // order by expiration date -- column 4
    'order': [[7, 'asc']],
    // use column 3 (actual timestamps) as a sort proxy for
    // column 4 (formatted "days since")
    'aoColumnDefs': [
      { 'orderable': false, 'aTargets': [1] },
      { 'bVisible': false, 'aTargets': [0, 6, 10] },
      { 'iDataSort': 6, 'aTargets': [7] }
    ],
  });

  $('.js-show-only-mine').on('change', function() {
    var checked = $(this);
    if (checked.attr('data-table-name') === 'progress') {
      progressTable.draw();
    } else if (checked.attr('data-table-name') === 'all') {
      allTable.draw();
    }
  });

  function format(itemNumber, description, department, controller, spec, parentSpec, companies) {
    var table = '

';
    if (itemNumber) { table += '
Item #	' + itemNumber + '
' }
    if (description) { table += '
Full Description	' + description + '
' }
    if (department) { table += '
Department	' + department + '
' }
    if (controller) { table += '
Controller #	' + controller + '
' }
    if (spec) { table += '
Spec #	' + spec + '
' }
    if (parentSpec) { table += '
Old Spec #	' + parentSpec + '
' }
    if (companies) { table += '
Companies	' + companies + '
' }
    table += '

';

    return table;
  }

  function showHideAdditionalInformation(clickedElem, table, formatMethod) {
    var clicked = $(clickedElem);
    var tr = clicked.closest('tr');
    var row = table.row(tr);

    if (row.child.isShown()) {
      row.child.hide();
      tr.removeClass('shown');
      clicked.find('.fa').removeClass('fa-minus').addClass('fa-plus');
    } else {
      row.child(format(
        tr.attr('data-item-number'), tr.attr('data-full-description'),
        tr.attr('data-department'), tr.attr('data-controller'),
        tr.attr('data-spec-number'), tr.attr('data-parent-spec-number'),
        tr.attr('data-companies')
      )).show();
      tr.addClass('shown');
      clicked.find('.fa').removeClass('fa-plus').addClass('fa-minus');
    }
  }

  $('#js-table-progress tbody').on('click', 'td.details-control', function() {
    showHideAdditionalInformation(this, progressTable);
  });

  $('#js-table-all tbody').on('click', 'td.details-control', function() {
    showHideAdditionalInformation(this, allTable);
  });

  $('.js-conductor-init-hidden').removeClass('hidden');
  $('#js-loading-spinner').addClass('hidden');

  // custom styling for datatables
  $('.dataTables_filter').find('input').addClass('form-control datatables-form-controls');
  $('.dataTables_length').find('select').addClass('form-control input-sm datatables-form-controls');

});


text:
aLSI: Asymmetric Latent Semantic Indexing
======

R-code to reproduce the experiment of the paper:

Javier González, Alberto Muñoz and Gabriel Martos. Asymmetric latent semantic indexing for gene expression experiments visualization', 2015.


text:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd">

<struts>

	<!-- ajax js -->

	<package name="ajax-comment" extends="struts-default">
		<action name="ajax_comment_*" method="{1}" class="com.lerx.web.ajax.service.CommentUtilAction">
		</action>
	</package>

	<package name="ajax-user-check" extends="struts-default">
		<action name="ajax_user_*" method="{1}"
				class="com.lerx.web.ajax.service.AjaxUserCheckAction">
		</action>
		<action name="ajax_users_articlesNumList" method="findUsersArticlesNum" class="com.lerx.web.ajax.service.AjaxUserCheckAction">
		</action>
	</package>

	<package name="ajax-siteandstyle" extends="struts-default">
		<action name="ajax_site_stat" method="stat" class="com.lerx.web.ajax.service.SiteStatAction">
		</action>
		<action name="ajax_site_inf" method="inf" class="com.lerx.web.ajax.service.SiteInfAction">
		</action>
		<action name="ajax_site_views" method="views" class="com.lerx.web.ajax.service.SiteInfAction">
		</action>
		<action name="ajax_style_siteCustom" method="custom" class="com.lerx.web.ajax.service.SiteStyleCustomFormatAction">
		</action>
		<action name="ajax_articleGroupMask_Show" method="create" class="com.lerx.web.ajax.service.UserGroupPowerMaskCodeAction">
		</action>

	</package>

	<package name="ajax-thread-list" extends="struts-default">
		<action name="ajax_threads_list" method="list" class="com.lerx.web.ajax.service.SiteThreadListAction">
		</action>
	</package>

	<package name="ajax-thread-realtime" extends="struts-default">
		<action name="ajax_thread_*" method="{1}" class="com.lerx.web.ajax.service.SiteThreadRealTimeAction">
		</action>
	</package>

	<package name="ajax-poll" extends="struts-default">
		<action name="ajax_art_poll_*" method="{1}" class="com.lerx.web.ajax.service.ArticlePollAction">
		</action>
		<action name="ajax_bbs_poll_*" method="{1}" class="com.lerx.web.ajax.service.BbsThemePollAction">
		</action>
	</package>

	<package name="ajax-artlen" extends="struts-default">
		<action name="ajax_art_lenchk" method="chk" class="com.lerx.web.ajax.service.ArticlePostAction">
		</action>

	</package>
	<package name="ajax-attachment-realtime" extends="struts-default">
		<action name="ajax_attachment_*" method="{1}" class="com.lerx.web.ajax.service.AttachmentAction">
		</action>
	</package>

	<package name="ajax-util" extends="struts-default">
		<action name="ajax_util_*" method="{1}" class="com.lerx.web.ajax.service.UtilAction">
		</action>
		<action name="ajax_sec_*" method="{1}" class="com.lerx.web.ajax.service.SecStrAction">
		</action>
	</package>

	<package name="ajax-bbs-style" extends="struts-default">
		<action name="ajax_bbs_stylecode_*" method="{1}" class="com.lerx.web.ajax.service.BbsThreadCreateCodeAction">
		</action>
	</package>
	<package name="ajax-bbs" extends="struts-default">
		<action name="ajax_bbs_*" method="{1}" class="com.lerx.web.ajax.service.AjaxForBbsAction">
		</action>
	</package>

	<package name="ajax-qa" extends="struts-default">
		<action name="ajax_qa_items_*" method="{1}" class="com.lerx.web.ajax.service.QaItemShowAction">
		</action>
		<action name="ajax_qa_item_real_*" method="{1}" class="com.lerx.web.ajax.service.QaItemRealTimeAction">
		</action>
	</package>

	<package name="ajax-vote" extends="struts-default">
		<action name="ajax_vote_findMes" method="findMes" class="com.lerx.vote.service.VoteRecAction">
		</action>

	</package>
	<package name="ajax-draw" extends="struts-default">
		<action name="ajax_draw_checkPws" method="checkPws" class="com.lerx.web.ajax.service.DrawAction">
		</action>

	</package>
	<package name="ajax-custom_code" extends="struts-default">
		<action name="ajax_custom_code_*" method="{1}" class="com.lerx.web.ajax.service.AiaxCustomCodeAction">
		</action>

	</package>

</struts>


text:
/*
 * CLOUD API
 *
 * An enterprise-grade Infrastructure is provided as a Service (IaaS) solution that can be managed through a browser-based \"Data Center Designer\" (DCD) tool or via an easy to use API.   The API allows you to perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. It is designed to allow users to leverage the same power and flexibility found within the DCD visual tool. Both tools are consistent with their concepts and lend well to making the experience smooth and intuitive.
 *
 * API version: 5.0
 */

// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.

package ionossdk

import (
	"encoding/json"
)

// UserProperties struct for UserProperties
type UserProperties struct {
	// first name of the user
	Firstname *string `json:"firstname,omitempty"`
	// last name of the user
	Lastname *string `json:"lastname,omitempty"`
	// email address of the user
	Email *string `json:"email,omitempty"`
	// indicates if the user has admin rights or not
	Administrator *bool `json:"administrator,omitempty"`
	// indicates if secure authentication should be forced on the user or not
	ForceSecAuth *bool `json:"forceSecAuth,omitempty"`
	// indicates if secure authentication is active for the user or not
	SecAuthActive *bool `json:"secAuthActive,omitempty"`
	// Canonical (S3) id of the user for a given identity
	S3CanonicalUserId *string `json:"s3CanonicalUserId,omitempty"`
	// User password
	Password *string `json:"password,omitempty"`
}

// GetFirstname returns the Firstname field value
// If the value is explicit nil, the zero value for string will be returned
func (o *UserProperties) GetFirstname() *string {
	if o == nil {
		return nil
	}

	return o.Firstname
}

// GetFirstnameOk returns a tuple with the Firstname field value
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *UserProperties) GetFirstnameOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.Firstname, true
}

// SetFirstname sets field value
func (o *UserProperties) SetFirstname(v string) {
	o.Firstname = &v
}

// HasFirstname returns a boolean if a field has been set.
func (o *UserProperties) HasFirstname() bool {
	if o != nil && o.Firstname != nil {
		return true
	}

	return false
}

// GetLastname returns the Lastname field value
// If the value is explicit nil, the zero value for string will be returned
func (o *UserProperties) GetLastname() *string {
	if o == nil {
		return nil
	}

	return o.Lastname
}

// GetLastnameOk returns a tuple with the Lastname field value
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *UserProperties) GetLastnameOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.Lastname, true
}

// SetLastname sets field value
func (o *UserProperties) SetLastname(v string) {
	o.Lastname = &v
}

// HasLastname returns a boolean if a field has been set.
func (o *UserProperties) HasLastname() bool {
	if o != nil && o.Lastname != nil {
		return true
	}

	return false
}

// GetEmail returns the Email field value
// If the value is explicit nil, the zero value for string will be returned
func (o *UserProperties) GetEmail() *string {
	if o == nil {
		return nil
	}

	return o.Email
}

// GetEmailOk returns a tuple with the Email field value
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *UserProperties) GetEmailOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.Email, true
}

// SetEmail sets field value
func (o *UserProperties) SetEmail(v string) {
	o.Email = &v
}

// HasEmail returns a boolean if a field has been set.
func (o *UserProperties) HasEmail() bool {
	if o != nil && o.Email != nil {
		return true
	}

	return false
}

// GetAdministrator returns the Administrator field value
// If the value is explicit nil, the zero value for bool will be returned
func (o *UserProperties) GetAdministrator() *bool {
	if o == nil {
		return nil
	}

	return o.Administrator
}

// GetAdministratorOk returns a tuple with the Administrator field value
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *UserProperties) GetAdministratorOk() (*bool, bool) {
	if o == nil {
		return nil, false
	}
	return o.Administrator, true
}

// SetAdministrator sets field value
func (o *UserProperties) SetAdministrator(v bool) {
	o.Administrator = &v
}

// HasAdministrator returns a boolean if a field has been set.
func (o *UserProperties) HasAdministrator() bool {
	if o != nil && o.Administrator != nil {
		return true
	}

	return false
}

// GetForceSecAuth returns the ForceSecAuth field value
// If the value is explicit nil, the zero value for bool will be returned
func (o *UserProperties) GetForceSecAuth() *bool {
	if o == nil {
		return nil
	}

	return o.ForceSecAuth
}

// GetForceSecAuthOk returns a tuple with the ForceSecAuth field value
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *UserProperties) GetForceSecAuthOk() (*bool, bool) {
	if o == nil {
		return nil, false
	}
	return o.ForceSecAuth, true
}

// SetForceSecAuth sets field value
func (o *UserProperties) SetForceSecAuth(v bool) {
	o.ForceSecAuth = &v
}

// HasForceSecAuth returns a boolean if a field has been set.
func (o *UserProperties) HasForceSecAuth() bool {
	if o != nil && o.ForceSecAuth != nil {
		return true
	}

	return false
}

// GetSecAuthActive returns the SecAuthActive field value
// If the value is explicit nil, the zero value for bool will be returned
func (o *UserProperties) GetSecAuthActive() *bool {
	if o == nil {
		return nil
	}

	return o.SecAuthActive
}

// GetSecAuthActiveOk returns a tuple with the SecAuthActive field value
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *UserProperties) GetSecAuthActiveOk() (*bool, bool) {
	if o == nil {
		return nil, false
	}
	return o.SecAuthActive, true
}

// SetSecAuthActive sets field value
func (o *UserProperties) SetSecAuthActive(v bool) {
	o.SecAuthActive = &v
}

// HasSecAuthActive returns a boolean if a field has been set.
func (o *UserProperties) HasSecAuthActive() bool {
	if o != nil && o.SecAuthActive != nil {
		return true
	}

	return false
}

// GetS3CanonicalUserId returns the S3CanonicalUserId field value
// If the value is explicit nil, the zero value for string will be returned
func (o *UserProperties) GetS3CanonicalUserId() *string {
	if o == nil {
		return nil
	}

	return o.S3CanonicalUserId
}

// GetS3CanonicalUserIdOk returns a tuple with the S3CanonicalUserId field value
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *UserProperties) GetS3CanonicalUserIdOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.S3CanonicalUserId, true
}

// SetS3CanonicalUserId sets field value
func (o *UserProperties) SetS3CanonicalUserId(v string) {
	o.S3CanonicalUserId = &v
}

// HasS3CanonicalUserId returns a boolean if a field has been set.
func (o *UserProperties) HasS3CanonicalUserId() bool {
	if o != nil && o.S3CanonicalUserId != nil {
		return true
	}

	return false
}

// GetPassword returns the Password field value
// If the value is explicit nil, the zero value for string will be returned
func (o *UserProperties) GetPassword() *string {
	if o == nil {
		return nil
	}

	return o.Password
}

// GetPasswordOk returns a tuple with the Password field value
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *UserProperties) GetPasswordOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.Password, true
}

// SetPassword sets field value
func (o *UserProperties) SetPassword(v string) {
	o.Password = &v
}

// HasPassword returns a boolean if a field has been set.
func (o *UserProperties) HasPassword() bool {
	if o != nil && o.Password != nil {
		return true
	}

	return false
}

func (o UserProperties) MarshalJSON() ([]byte, error) {
	toSerialize := map[string]interface{}{}

	if o.Firstname != nil {
		toSerialize["firstname"] = o.Firstname
	}

	if o.Lastname != nil {
		toSerialize["lastname"] = o.Lastname
	}

	if o.Email != nil {
		toSerialize["email"] = o.Email
	}

	if o.Administrator != nil {
		toSerialize["administrator"] = o.Administrator
	}

	if o.ForceSecAuth != nil {
		toSerialize["forceSecAuth"] = o.ForceSecAuth
	}

	if o.SecAuthActive != nil {
		toSerialize["secAuthActive"] = o.SecAuthActive
	}

	if o.S3CanonicalUserId != nil {
		toSerialize["s3CanonicalUserId"] = o.S3CanonicalUserId
	}

	if o.Password != nil {
		toSerialize["password"] = o.Password
	}

	return json.Marshal(toSerialize)
}

type NullableUserProperties struct {
	value *UserProperties
	isSet bool
}

func (v NullableUserProperties) Get() *UserProperties {
	return v.value
}

func (v *NullableUserProperties) Set(val *UserProperties) {
	v.value = val
	v.isSet = true
}

func (v NullableUserProperties) IsSet() bool {
	return v.isSet
}

func (v *NullableUserProperties) Unset() {
	v.value = nil
	v.isSet = false
}

func NewNullableUserProperties(val *UserProperties) *NullableUserProperties {
	return &NullableUserProperties{value: val, isSet: true}
}

func (v NullableUserProperties) MarshalJSON() ([]byte, error) {
	return json.Marshal(v.value)
}

func (v *NullableUserProperties) UnmarshalJSON(src []byte) error {
	v.isSet = true
	return json.Unmarshal(src, &v.value)
}


text:
<?php

/**
 * Define the user's "~/.rocket" path.
 */
define('ROCKET_HOME_PATH', posix_getpwuid(fileowner(__FILE__))['dir'].'/.rocket');
define('ROCKET_STATIC_PREFIX', '41c270e4-5535-4daa-b23e-c269744c2f45');

/**
 * Load the rocket 🚀 configuration.
 */
$valetConfig = json_decode(
    file_get_contents(ROCKET_HOME_PATH.'/config.json'), true
);

/**
 * Parse the URI and site / host for the incoming request.
 */
$uri = urldecode(
    explode('?', $_SERVER['REQUEST_URI'])[0]
);

$siteName = basename(
    // Filter host to support xip.io feature
    $_SERVER['HTTP_HOST'],
    '.'.$valetConfig['domain']
);

if (strpos($siteName, 'www.') === 0) {
    $siteName = substr($siteName, 4);
}

/**
 * Determine the fully qualified path to the site.
 */
$rocketSitePath = apcu_fetch('rocket_site_path'.$siteName);
$domain = array_slice(explode('.', $siteName), -1)[0];

if (!$rocketSitePath) {
    foreach ($valetConfig['paths'] as $path) {
        if (is_dir($path.'/'.$siteName)) {
            $rocketSitePath = $path.'/'.$siteName;
            break;
        }

        if (is_dir($path.'/'.$domain)) {
            $rocketSitePath = $path.'/'.$domain;
            break;
        }
    }

    if (is_null($rocketSitePath)) {
        http_response_code(404);
        require __DIR__.'/cli/templates/404.php';
        exit;
    }

    $rocketSitePath = realpath($rocketSitePath);

    apcu_add('rocket_site_path'.$siteName, $rocketSitePath, 3600);
}

/**
 * Find the appropriate rocket 🚀 driver for the request.
 */
$rocketDriver = null;

require __DIR__.'/cli/drivers/require.php';

$rocketDriver = RocketDriver::assign($rocketSitePath, $siteName, $uri);

if (!$rocketDriver) {
    http_response_code(404);
    echo 'Could not find suitable driver for your project.';
    exit;
}

/*
 * ngrok uses the X-Original-Host to store the forwarded hostname.
 */
if (isset($_SERVER['HTTP_X_ORIGINAL_HOST']) && !isset($_SERVER['HTTP_X_FORWARDED_HOST'])) {
    $_SERVER['HTTP_X_FORWARDED_HOST'] = $_SERVER['HTTP_X_ORIGINAL_HOST'];
}

/**
 * Allow driver to mutate incoming URL.
 */
$uri = $rocketDriver->mutateUri($uri);

/**
 * Determine if the incoming request is for a static file.
 */
$isPhpFile = pathinfo($uri, PATHINFO_EXTENSION) === 'php';

if ($uri !== '/' && !$isPhpFile && $staticFilePath = $rocketDriver->isStaticFile($rocketSitePath, $siteName, $uri)) {
    return $rocketDriver->serveStaticFile($staticFilePath, $rocketSitePath, $siteName, $uri);
}

/**
 * Attempt to dispatch to a front controller.
 */
$frontControllerPath = $rocketDriver->frontControllerPath(
    $rocketSitePath, $siteName, $uri
);

if (!$frontControllerPath) {
    http_response_code(404);
    echo 'Did not get front controller from driver. Please return a front controller to be executed.';
    exit;
}

chdir(dirname($frontControllerPath));

unset($domain, $path, $siteName, $uri, $valetConfig, $rocketDriver, $rocketSitePath);

require $frontControllerPath;


text:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <!--SubActivityから受け取った値を表示するTextView-->
    <TextView
        android:id="@+id/textView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:gravity="center"
        android:text="New Text" />

    <LinearLayout
        android:layout_centerInParent="true"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <!--StartActivityで起動するButton-->
        <Button
            android:id="@+id/button1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="startActivity" />

        <!--StartActivityForResultで起動するButton-->
        <Button
            android:id="@+id/button2"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="startActivityForResult" />
    </LinearLayout>
</RelativeLayout>


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Cosmological Models: NumCosmo Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" />
<link rel="home" href="index.html" title="NumCosmo Reference Manual" />
<link rel="up" href="index.html" title="NumCosmo Reference Manual" />
<link rel="prev" href="numcosmo-Gir-Scanning-Compatibility.html" title="Gir Scanning Compatibility" />
<link rel="next" href="NcHICosmo.html" title="NcHICosmo" />
<meta name="generator" content="GTK-Doc V1.33.1 (XML mode)" />
<link rel="stylesheet" href="style.css" type="text/css" />
<link rel="stylesheet" href="container.css" type="text/css" />

Cosmological Models

NcHICosmo — Abstract class for implementing homogeneous and isotropic cosmological models

NcHICosmoPrior — Collection of priors for NcHICosmo models

NcHICosmoLCDM — $\Lambda$CDM model

NcHICosmoGCG — Generalized Chaplygin Gas

NcHICosmoIDEM2 — Interacting Dark Energy Model

NcDECont — Dark energy contraction perturbations model

Darkenergy

NcHICosmoDE — Abstract class for implementing dark energy models

NcHICosmoDEReparamOk — Dark Energy -- reparametrization $\Omega_{x0} \to \Omega_{k0}$

NcHICosmoDEReparamCMB — Dark Energy -- CMB reparametrization

NcHICosmoDEXcdm — Dark Energy -- constant equation of state

NcHICosmoDECpl — Dark Energy -- Chevallier–Polarski–Linder equation of state

NcHICosmoDEJbp — Dark Energy -- Jassal-Bagla-Padmanabhan equation of state

Quantum Gravity Bounce

NcHICosmoQGRW — Radiation plus $w$-fluid model with a quantum generated bounce phase model.

NcHICosmoVexp — Single scalar field with an exponential potential

Kinematic Models

NcHICosmoQConst — Kinetic model -- Constant deceleration function

NcHICosmoQLinear — Kinetic model -- Linear deceleration function

NcHICosmoQSpline — Kinetic model -- Spline deceleration function

NcHICosmoQRBF — Kinetic model -- Spline deceleration function

Darkenergy

Generated by GTK-Doc V1.33.1


text:
.class public Lcom/crittercism/app/CritterUserData;
.super Ljava/lang/Object;

# instance fields
.field private a:Ljava/util/Map;

.field private final b:Z

# direct methods
.method constructor <init>(Ljava/util/Map;Z)V
    .registers 3
    .param p2, "isOptedOut"    # Z

    .prologue
    .line 12
    .local p1, "map":Ljava/util/Map;, "Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;"
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 13
    iput-object p1, p0, Lcom/crittercism/app/CritterUserData;->a:Ljava/util/Map;

    .line 14
    iput-boolean p2, p0, Lcom/crittercism/app/CritterUserData;->b:Z

    .line 15
    return-void
.end method

# virtual methods
.method public crashedOnLastLoad()Z
    .registers 3

    .prologue
    .line 104
    iget-object v0, p0, Lcom/crittercism/app/CritterUserData;->a:Ljava/util/Map;

    const-string v1, "crashedOnLastLoad"

    invoke-interface {v0, v1}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_1b

    .line 105
    iget-boolean v0, p0, Lcom/crittercism/app/CritterUserData;->b:Z

    if-eqz v0, :cond_15

    .line 106
    const-string v0, "User has opted out of Crittercism.  Returning false."

    invoke-static {v0}, Lcrittercism/android/dx;->c(Ljava/lang/String;)V

    .line 110
    :goto_13
    const/4 v0, 0x0

    .line 112
    :goto_14
    return v0

    .line 108
    :cond_15
    const-string v0, "CritterUserData instance has no value for crashedOnLastLoad().  Defaulting to false."

    invoke-static {v0}, Lcrittercism/android/dx;->c(Ljava/lang/String;)V

    goto :goto_13

    .line 112
    :cond_1b
    iget-object v0, p0, Lcom/crittercism/app/CritterUserData;->a:Ljava/util/Map;

    const-string v1, "crashedOnLastLoad"

    invoke-interface {v0, v1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/Boolean;

    invoke-virtual {v0}, Ljava/lang/Boolean;->booleanValue()Z

    move-result v0

    goto :goto_14
.end method

.method public getRateMyAppMessage()Ljava/lang/String;
    .registers 3

    .prologue
    .line 72
    iget-object v0, p0, Lcom/crittercism/app/CritterUserData;->a:Ljava/util/Map;

    const-string v1, "message"

    invoke-interface {v0, v1}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_13

    .line 73
    iget-boolean v0, p0, Lcom/crittercism/app/CritterUserData;->b:Z

    if-eqz v0, :cond_1e

    .line 74
    const-string v0, "User has opted out of Crittercism.  Returning null."

    invoke-static {v0}, Lcrittercism/android/dx;->c(Ljava/lang/String;)V

    .line 79
    :cond_13
    :goto_13
    iget-object v0, p0, Lcom/crittercism/app/CritterUserData;->a:Ljava/util/Map;

    const-string v1, "message"

    invoke-interface {v0, v1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    return-object v0

    .line 76
    :cond_1e
    const-string v0, "CritterUserData instance has no value for getRateMyAppMessage().  Returning null."

    invoke-static {v0}, Lcrittercism/android/dx;->c(Ljava/lang/String;)V

    goto :goto_13
.end method

.method public getRateMyAppTitle()Ljava/lang/String;
    .registers 3

    .prologue
    .line 51
    iget-object v0, p0, Lcom/crittercism/app/CritterUserData;->a:Ljava/util/Map;

    const-string v1, "title"

    invoke-interface {v0, v1}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_13

    .line 52
    iget-boolean v0, p0, Lcom/crittercism/app/CritterUserData;->b:Z

    if-eqz v0, :cond_1e

    .line 53
    const-string v0, "User has opted out of Crittercism.  Returning null."

    invoke-static {v0}, Lcrittercism/android/dx;->c(Ljava/lang/String;)V

    .line 58
    :cond_13
    :goto_13
    iget-object v0, p0, Lcom/crittercism/app/CritterUserData;->a:Ljava/util/Map;

    const-string v1, "title"

    invoke-interface {v0, v1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    return-object v0

    .line 55
    :cond_1e
    const-string v0, "CritterUserData instance has no value for getRateMyAppTitle().  Returning null."

    invoke-static {v0}, Lcrittercism/android/dx;->c(Ljava/lang/String;)V

    goto :goto_13
.end method

.method public getUserUUID()Ljava/lang/String;
    .registers 3

    .prologue
    .line 122
    iget-object v0, p0, Lcom/crittercism/app/CritterUserData;->a:Ljava/util/Map;

    const-string v1, "userUUID"

    invoke-interface {v0, v1}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_13

    .line 123
    iget-boolean v0, p0, Lcom/crittercism/app/CritterUserData;->b:Z

    if-eqz v0, :cond_1e

    .line 124
    const-string v0, "User has opted out of Crittercism.  Returning null."

    invoke-static {v0}, Lcrittercism/android/dx;->c(Ljava/lang/String;)V

    .line 129
    :cond_13
    :goto_13
    iget-object v0, p0, Lcom/crittercism/app/CritterUserData;->a:Ljava/util/Map;

    const-string v1, "userUUID"

    invoke-interface {v0, v1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    return-object v0

    .line 126
    :cond_1e
    const-string v0, "CritterUserData instance has no value for getUserUUID().  Returning null."

    invoke-static {v0}, Lcrittercism/android/dx;->c(Ljava/lang/String;)V

    goto :goto_13
.end method

.method public isOptedOut()Z
    .registers 3

    .prologue
    .line 88
    iget-object v0, p0, Lcom/crittercism/app/CritterUserData;->a:Ljava/util/Map;

    const-string v1, "optOutStatus"

    invoke-interface {v0, v1}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_d

    .line 90
    iget-boolean v0, p0, Lcom/crittercism/app/CritterUserData;->b:Z

    .line 92
    :goto_c
    return v0

    :cond_d
    iget-object v0, p0, Lcom/crittercism/app/CritterUserData;->a:Ljava/util/Map;

    const-string v1, "optOutStatus"

    invoke-interface {v0, v1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/Boolean;

    invoke-virtual {v0}, Ljava/lang/Boolean;->booleanValue()Z

    move-result v0

    goto :goto_c
.end method

.method public shouldShowRateMyAppAlert()Z
    .registers 3

    .prologue
    .line 29
    iget-object v0, p0, Lcom/crittercism/app/CritterUserData;->a:Ljava/util/Map;

    const-string v1, "shouldShowRateAppAlert"

    invoke-interface {v0, v1}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_1b

    .line 30
    iget-boolean v0, p0, Lcom/crittercism/app/CritterUserData;->b:Z

    if-eqz v0, :cond_15

    .line 31
    const-string v0, "User has opted out of Crittercism.  Returning false."

    invoke-static {v0}, Lcrittercism/android/dx;->c(Ljava/lang/String;)V

    .line 35
    :goto_13
    const/4 v0, 0x0

    .line 37
    :goto_14
    return v0

    .line 33
    :cond_15
    const-string v0, "CritterUserData instance has no value for shouldShowMyRateAppAlert().  Defaulting to false."

    invoke-static {v0}, Lcrittercism/android/dx;->c(Ljava/lang/String;)V

    goto :goto_13

    .line 37
    :cond_1b
    iget-object v0, p0, Lcom/crittercism/app/CritterUserData;->a:Ljava/util/Map;

    const-string v1, "shouldShowRateAppAlert"

    invoke-interface {v0, v1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/Boolean;

    invoke-virtual {v0}, Ljava/lang/Boolean;->booleanValue()Z

    move-result v0

    goto :goto_14
.end method


text:
using namespace lldb;
using namespace lldb_private;
using namespace lldb_private::formatters;

bool lldb_private::formatters::CMTimeSummaryProvider(
    ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options) {
  CompilerType type = valobj.GetCompilerType();
  if (!type.IsValid())
    return false;

  TypeSystem *type_system =
      valobj.GetExecutionContextRef()
          .GetTargetSP()
          ->GetScratchTypeSystemForLanguage(nullptr, lldb::eLanguageTypeC);
  if (!type_system)
    return false;

  // fetch children by offset to compensate for potential lack of debug info
  auto int64_ty =
      type_system->GetBuiltinTypeForEncodingAndBitSize(eEncodingSint, 64);
  auto int32_ty =
      type_system->GetBuiltinTypeForEncodingAndBitSize(eEncodingSint, 32);

  auto value_sp(valobj.GetSyntheticChildAtOffset(0, int64_ty, true));
  auto timescale_sp(valobj.GetSyntheticChildAtOffset(8, int32_ty, true));
  auto flags_sp(valobj.GetSyntheticChildAtOffset(12, int32_ty, true));

  if (!value_sp || !timescale_sp || !flags_sp)
    return false;

  auto value = value_sp->GetValueAsUnsigned(0);
  auto timescale = (int32_t)timescale_sp->GetValueAsUnsigned(
      0); // the timescale specifies the fraction of a second each unit in the
          // numerator occupies
  auto flags = Flags(flags_sp->GetValueAsUnsigned(0) &
                     0x00000000000000FF); // the flags I need sit in the LSB

  const unsigned int FlagPositiveInf = 4;
  const unsigned int FlagNegativeInf = 8;
  const unsigned int FlagIndefinite = 16;

  if (flags.AnySet(FlagIndefinite)) {
    stream.Printf("indefinite");
    return true;
  }

  if (flags.AnySet(FlagPositiveInf)) {
    stream.Printf("+oo");
    return true;
  }

  if (flags.AnySet(FlagNegativeInf)) {
    stream.Printf("-oo");
    return true;
  }

  if (timescale == 0)
    return false;

  switch (timescale) {
  case 0:
    return false;
  case 1:
    stream.Printf("%" PRId64 " seconds", value);
    return true;
  case 2:
    stream.Printf("%" PRId64 " half seconds", value);
    return true;
  case 3:
    stream.Printf("%" PRId64 " third%sof a second", value,
                  value == 1 ? " " : "s ");
    return true;
  default:
    stream.Printf("%" PRId64 " %" PRId32 "th%sof a second", value, timescale,
                  value == 1 ? " " : "s ");
    return true;
  }
}


text:
package eu.aniketos.notification;

/**
 * The Notification module defines the INotification interface to be used by components that wants to receive notifications
 * regardless of which service the notifications concern. The Service runtime environment (SRE) should always implement this interface.
 *
 * @version 1.0
 * @author Erlend Andreas Gjære (SINTEF), erlendandreas.gjare@sintef.no
 *
 */
public interface INotification {

	/**
	 * Receives a notification outside the regular subscription mechanism, for cases where message targeting
	 * is done better from the Notification module's perspective rather than from the subscriber's.
	 *
	 * @param alert Message object which contains the data about the notification, i.e. serviceId, alertType and value (required), and optionally description and threatId.
	 */
	public void alert(Notification alert);

}


text:
#include "MemLibInternals.h"

/**
  Fills a target buffer with zeros, and returns the target buffer.

  This function fills Length bytes of Buffer with zeros, and returns Buffer.

  If Length > 0 and Buffer is NULL, then ASSERT().
  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().

  @param  Buffer      The pointer to the target buffer to fill with zeros.
  @param  Length      The number of bytes in Buffer to fill with zeros.

  @return Buffer.

**/
VOID *
EFIAPI
ZeroMem (
  OUT VOID  *Buffer,
  IN UINTN  Length
  )
{
  if (Length == 0) {
    return Buffer;
  }

  ASSERT (Buffer != NULL);
  ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1));
  return InternalMemZeroMem (Buffer, Length);
}


text:
/* Author: Dave Coleman
   Desc:   Example ros_control hardware interface that performs a perfect control loop for
   simulation
*/

#ifndef GENERIC_ROS_CONTROL__SIM_HW_INTERFACE_H
#define GENERIC_ROS_CONTROL__SIM_HW_INTERFACE_H

#include <ros_control_boilerplate/generic_hw_interface.h>

namespace ros_control_boilerplate
{
/** \brief Hardware interface for a robot */
class SimHWInterface : public GenericHWInterface
{
public:
  /**
   * \brief Constructor
   * \param nh - Node handle for topics.
   */
  SimHWInterface(ros::NodeHandle& nh, urdf::Model* urdf_model = NULL);

  /** \brief Initialize the robot hardware interface */
  virtual void init();

  /** \brief Read the state from the robot hardware. */
  virtual void read(ros::Duration& elapsed_time);

  /** \brief Write the command to the robot hardware. */
  virtual void write(ros::Duration& elapsed_time);

  /** \breif Enforce limits for all values before writing */
  virtual void enforceLimits(ros::Duration& period);

protected:
  /** \brief Basic model of system for position control */
  virtual void positionControlSimulation(ros::Duration& elapsed_time, const std::size_t joint_id);

  // Name of this class
  std::string name_;

  // Simulated controller
  double p_error_;
  double v_error_;

  // For position controller to estimate velocity
  std::vector<double> joint_position_prev_;

  // Send commands in different modes
  int sim_control_mode_ = 0;

};  // class

}  // namespace ros_control_boilerplate

#endif


text:
package cn.aposoft.zk;

import java.io.IOException;
import java.util.Collections;
import java.util.List;

import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.Watcher;
import org.apache.zookeeper.ZooDefs;
import org.apache.zookeeper.ZooKeeper;
import org.apache.zookeeper.data.ACL;
import org.apache.zookeeper.data.Stat;

import com.alibaba.fastjson.JSON;

/**
 * @author LiuJian
 * @date 2016年11月9日
 *
 */
public class ZooKeeperCaller {

    /**
     * @param args
     * @throws IOException
     * @throws InterruptedException
     * @throws KeeperException
     */
    public static void main(String[] args) throws IOException, KeeperException, InterruptedException {
        Watcher watcher = new BasicZooKeeperWatcher();

        ZooKeeper zk = new ZooKeeper("192.168.80.128:2181/test", 3000, watcher);
        // getData(zk);
        // exists(zk);
        // create(zk);
        createPersist(zk);
        try {
            Thread.sleep(1000 * 500);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        zk.close();
    }

    public static void createPersist(ZooKeeper zk) throws KeeperException, InterruptedException {
        // 读取信息
        Stat stat = zk.exists("/persistNode1", false);
        System.out.println("Stat for /persistNode1:" + JSON.toJSONString(stat));
        if (stat != null) {
            getData(zk, stat, "/persistNode1");
        } else {
            List<ACL> acls = Collections.emptyList();
            String persistNode = zk.create("/persistNode1", "this is data".getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
            System.out.println(persistNode);
            try {
                int i = System.in.read();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }

    public static void getData(ZooKeeper zk) throws KeeperException, InterruptedException {
        getData(zk, null);
        exists(zk);
    }

    public static void getData(ZooKeeper zk, Stat stat) throws KeeperException, InterruptedException {
        getData(zk, stat, "/");
    }

    public static void getData(ZooKeeper zk, Stat stat, String node) throws KeeperException, InterruptedException {
        // 读取信息
        byte[] data = zk.getData(node, false, stat);

        if (data != null) {
            System.out.println(new String(data));
        }
    }

    public static void exists(ZooKeeper zk) throws KeeperException, InterruptedException {
        // 读取信息
        Stat stat = zk.exists("/", false);
        System.out.println(JSON.toJSONString(stat));
        if (stat != null) {
            getData(zk, stat);
        }
    }

    public static void create(ZooKeeper zk) throws KeeperException, InterruptedException {
        // 读取信息
        Stat stat = zk.exists("/persistNode", false);
        System.out.println(JSON.toJSONString(stat));
        if (stat != null) {
            getData(zk, stat, "/persistNode");
        } else {
            List<ACL> acls = Collections.emptyList();
            String persistNode = zk.create("/persistNode", "this is data".getBytes(), acls, CreateMode.PERSISTENT);
            System.out.println(persistNode);
            try {
                int i = System.in.read();
            } catch (IOException e) {
                e.printStackTrace();
            }

        }
    }

}


text:
module.exports = function (grunt) {

    grunt.loadNpmTasks('grunt-contrib-connect');

    grunt.initConfig({
        connect: {
            root: {
                options: {
                    keepalive: true,
                    hostname: '*',
                    port: 8002
                }
            }
        }

    });

    grunt.registerTask('default', ['connect']);

};


text:
from flask import Flask
from .settings import Production
from .extensions import bcrypt, db, migrate, debug_toolbar, admin, login_manager, assets
from .models import User, Profile
from flask.ext.admin.contrib.sqla import ModelView
from flask.ext.assets import Bundle
import user
import public

def register_assets():
	"""
	Register the static assets to be minimized with Flask-Assets
	:return None:
	"""
	js = Bundle('jquery.js', 'main.js', filters='jsmin', output='packed/site.js')
	assets.register('js_all', js)
	return None

def create_app(config_object=Production):
	"""
	Application factory following the pattern at:
	http://flask.pocoo.org/docs/patterns/appfactories/

	:param config_object: The configuration object that we'll be using
	:returns app:
	"""
	app = Flask(__name__)
	app.config.from_object(config_object)

	# Register stuff to the app
	register_extensions(app)
	register_admin(User,
				   Profile,
				   session=db.session)
	register_blueprints(app)
	register_assets()

	# Configuration
	configure_login()

	# admin requires a custom setup
	# admin_views()
	return app

def register_extensions(app):
	"""
	Given an app object, initialize the application extensions
	:param app: The current application
	:returns None:
	"""
	bcrypt.init_app(app)
	db.init_app(app)
	migrate.init_app(app, db)
	debug_toolbar.init_app(app)
	admin.init_app(app)
	login_manager.init_app(app)
	assets.init_app(app)
	return None

def register_blueprints(app):
	"""
	Given an app object, initialize the blueprints
	:param app: The current application
	:return None:
	"""
	app.register_blueprint(user.blueprint)
	app.register_blueprint(public.blueprint)
	return None

def register_admin(*args, **kwargs):
	"""
	Takes in any number of unnamed args assuming they're database model classes
	and registers them with the SuperAdmin
	:returns None:
	"""
	for model in args:
		admin.add_view(ModelView(model, kwargs['session']))
	return None

def admin_views():
	from .admin import views
	# admin.add_view(views.MyView(name="Hello 1", endpoint="test1", category="Test"))
	# admin.add_view(views.MyView(name="Hello 2", endpoint="test2", category="Test"))
	# admin.add_view(views.MyView(name="Hello 3", endpoint="test3", category="Test"))
	return None

def configure_login():
	login_manager.login_view = "public.login"


text:
module ModelHelper
  def client_exists(client_attributes = {})
    @client = FactoryGirl.create(:application, client_attributes)
  end

  def create_resource_owner
    @resource_owner = User.create!(name: 'Joe', password: 'sekret')
  end

  def authorization_code_exists(options = {})
    @authorization = FactoryGirl.create(:access_grant, options)
  end

  def access_grant_should_exist_for(client, resource_owner)
    grant = Doorkeeper::AccessGrant.first
    expect(grant.application).to eq(client)
    grant.resource_owner_id  == resource_owner.id
  end

  def access_token_should_exist_for(client, resource_owner)
    grant = Doorkeeper::AccessToken.first
    expect(grant.application).to eq(client)
    grant.resource_owner_id  == resource_owner.id
  end

  def access_grant_should_not_exist
    expect(Doorkeeper::AccessGrant.all).to be_empty
  end

  def access_token_should_not_exist
    expect(Doorkeeper::AccessToken.all).to be_empty
  end

  def access_grant_should_have_scopes(*args)
    grant = Doorkeeper::AccessGrant.first
    expect(grant.scopes).to eq(Doorkeeper::OAuth::Scopes.from_array(args))
  end

  def access_token_should_have_scopes(*args)
    grant = Doorkeeper::AccessToken.last
    expect(grant.scopes).to eq(Doorkeeper::OAuth::Scopes.from_array(args))
  end
end

RSpec.configuration.send :include, ModelHelper


text:
package minigamemanager.api.profile;

import java.io.Closeable;
import java.io.IOException;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.UUID;

import minigamemanager.api.db.MySQL;
import minigamemanager.config.MinigameSettings;
import minigamemanager.core.MinigameManager;

public class ProfileDatabase implements Closeable {

	private final Object lock = new Object();
	private final Connection conn;
	private final Statement s;

	public ProfileDatabase(String ip, int port, String database) throws SQLException {
		this(ip, port, database, null, null);
	}

	public ProfileDatabase(String ip, int port, String database, String username, String password) throws SQLException {
		this.conn = new MySQL(ip, port, database).connect(username, password);
		this.s = conn.createStatement();
		create();
	}

	private void create() throws SQLException {
		MinigameSettings set = MinigameManager.getMinigameManager().getMinigameSettings();
		String sql = "CREATE TABLE IF NOT EXISTS " + set.mysqlTables().get("profiles") + " (uuid VARCHAR(36) NOT NULL, elo BIGINT, currency DECIMAL, gamesPlayed BIGINT, achievements VARCHAR(65536), PRIMARY KEY(UUID));";
		s.executeUpdate(sql);
	}

	public int saveProfile(PlayerProfile profile) throws SQLException {
		synchronized (lock) {
			ProfileData data = profile.getData();
			String sql = "INSERT INTO " + MinigameManager.getMinigameManager().getMinigameSettings().mysqlTables().get("profiles") + " (uuid, elo, currency, gamesPlayed) VALUES (\"" + profile.getUUID() + "\", " + data.getELO() + ", " + data.getCurrency() + ", " + data.getGamesPlayed() + ") ON DUPLICATE KEY UPDATE elo=" + data.getELO() + ", currency=" + data.getCurrency() + ", gamesPlayed=" + data.getGamesPlayed() + ", achievements='" + data.getAchievementString() + "';";
			return s.executeUpdate(sql);
		}
	}

	public PlayerProfile getProfile(UUID uuid) throws SQLException {
		synchronized (lock) {
			String sql = "SELECT elo, currency, gamesPlayed, achievements from " + MinigameManager.getMinigameManager().getMinigameSettings().mysqlTables().get("profiles") + " WHERE uuid=\"" + uuid + "\";";
			ResultSet rs = s.executeQuery(sql);
			if (rs.next()) {
				ProfileData data = new ProfileData();
				data.setELO(rs.getLong("elo"));
				data.setCurrency(rs.getDouble("currency"));
				data.setGamesPlayed(rs.getLong("gamesPlayed"));
				data.setAchievements(ProfileData.getAchievementsFromString(rs.getString("achievements")));
				try {
					Class<PlayerProfile> clazz = PlayerProfile.class;
					Constructor<PlayerProfile> cons = clazz.getDeclaredConstructor(UUID.class, ProfileData.class);
					cons.setAccessible(true);
					return cons.newInstance(uuid, data);
				} catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
					e.printStackTrace();
					return null;
				}
			} else
				return null;
		}
	}

	@Override
	public void close() throws IOException {
		try {
			conn.close();
		} catch (SQLException e) {
			throw new IOException(e);
		}
	}

}


text:
SYNONYM

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

#### Published in
Jl S. Afr. Bot. 35: 288 (1969)

#### Original name
Thamnomyces bacillum Mont., 1837

### Remarks
null


text:
import logging
from rest_framework import serializers
from django.contrib.auth import get_user_model
from django.contrib.auth.models import User, Group, Permission
from django.contrib.auth.hashers import make_password
from rest_framework.authentication import BasicAuthentication
from oauth2_provider.models import Application
from django.contrib.contenttypes.models import ContentType
from bio.models import Category, Template, Element, ModuleFunction, ModuleElement, ScriptElement, ModelScript, PipelineRecipe, Step, StepGroup, Ingredient, IngredientGroup, UserCodeGroup, Userfile
from itertools import chain

User = get_user_model()

class AuthSerializerMixin(object):
    def restore_object(self, attrs, instance=None):
        if attrs.get("username", None):
            attrs["username"] = attrs["username"].lower()
        if attrs.get("email", None):
            attrs["email"] = attrs["email"].lower()
        if attrs.get("password", None):
            attrs["password"] = make_password(base64.decodestring(attrs["password"]))
        return super(AuthSerializerMixin, self).restore_object(attrs, instance)

    def validate_password(self, attrs, source):
        if len(attrs[source]) < 6:
            raise serializers.ValidationError("Password must be at least 6 characters")
        return attrs

class BaseModelSerializer(serializers.ModelSerializer):

    def __init__(self, *args, **kwargs):
        super(BaseModelSerializer, self).__init__(*args, **kwargs)
        self.fields['content_type'] = serializers.SerializerMethodField('get_content_type')

    def get_content_type(self, obj):
        return ContentType.objects.get_for_model(obj).pk

class UserSerializer(AuthSerializerMixin, serializers.HyperlinkedModelSerializer):
    class Meta:
        model = User
        fields = ('id', 'url', 'username', 'email', 'groups')

class GroupSerializer(AuthSerializerMixin, serializers.HyperlinkedModelSerializer):
    class Meta:
        model = Group
        fields = ('id', 'url', 'name')

class RegisterSerializer(serializers.ModelSerializer):
    #client_id = serializers.SerializerMethodField('client_id')
    #client_secret = serializers.SerializerMethodField('client_secret')
    class Meta:
        model = User
        fields = ('username', 'email', 'password') #, 'client_id', 'client_secret'
        write_only_fields = ('email', 'password',)

    # def register_client_id(self, obj):
    #     return Application.objects.get(user=obj).client_id
    #
    # def register_client_secret(self, obj):
    #     return Application.objects.get(user=obj).client_secret

class LoginSerializer(AuthSerializerMixin, serializers.ModelSerializer):
    #client_id = serializers.SerializerMethodField('login_client_id')
    #client_secret = serializers.SerializerMethodField('login_client_secret')
    class Meta:
        model = User
        fields = ('username', 'password') # , 'client_id', 'client_secret'

    # def login_client_id(self, obj):
    #     return Application.objects.get(user=obj).client_id
    #
    # def login_client_secret(self, obj):
    #     return Application.objects.get(user=obj).client_secret

class PasswordSerializer(serializers.Serializer):
    old_password = serializers.CharField(required=True)
    password = serializers.CharField(required=True)

    def validate_password(self, attrs, source):
        if len(attrs[source]) < 6:
            raise serializers.ValidationError("Password must be at least 6 characters")
        return attrs

class ElementSerializer(serializers.ModelSerializer):
    class Meta:
        model = Element
        fields = ('id', 'argument', 'default', 'template', 'owner')

class TemplateSerializer(serializers.ModelSerializer):
    elements = ElementSerializer(many=True, read_only=True)
    class Meta:
        model = Template
        fields = ('id', 'title', 'elements', 'category', 'owner')

class CategorySerializer(serializers.ModelSerializer):
    templates = TemplateSerializer(many=True, read_only=True)
    class Meta:
        model = Category
        fields = ('id', 'name', 'topic', 'templates', 'owner')

class ScriptSerializer(serializers.ModelSerializer):
    class Meta:
        model = ScriptElement
        fields = ('id', 'name', 'description', 'inputformat', 'outputformat', 'parameters', 'datafile', 'created', 'scriptpath', 'modelscript', 'owner')

class ModelScriptSerializer(serializers.ModelSerializer):
    scripts = ScriptSerializer(many=True, read_only=True)
    class Meta:
        model = ModelScript
        fields = ('id', 'name', 'description', 'inputformat', 'outputformat', 'parameters', 'datafile', 'created', 'server', 'scriptpath', 'scripts', 'owner')#, 'model'

class ModuleElementSerializer(serializers.ModelSerializer):
    models = ModelScriptSerializer(many=True, read_only=True)
    class Meta:
        model = ModuleElement
        fields = ('id', 'name', 'description', 'scheduler', 'inputformat', 'outputformat', 'softwarecitation', 'softwarelink', 'parameters', 'datafile', 'created', 'memory', 'time', 'step', 'models', 'owner')#, 'function'

class ModuleSerializer(serializers.ModelSerializer):
    #modules = ModuleElementSerializer(many=True, read_only=True)
    class Meta:
        model = ModuleFunction
        fields = ('id', 'name', 'description', 'datafile', 'stepgroups', 'steps', 'created', 'owner')#, 'modules'

class PipelineRecipeSerializer(serializers.ModelSerializer):
    #ingredients = IngredientSerializer(many=True, read_only=False)
    #stepgroups = StepGroupSerializer(many=True, read_only=True)
    class Meta:
        model = PipelineRecipe
        fields = ('id', 'name', 'description', 'ingredients', 'stepgroups', 'equipment', 'resultpath', 'footnote', 'created', 'owner')#, 'inputpath'

class StepSerializer(serializers.ModelSerializer):
    modules = ModuleElementSerializer(many=True, read_only=True)
    class Meta:
        model = Step
        fields = ('id', 'title', 'scheduler', 'priority', 'follows', 'group', 'modules', 'owner')

class StepGroupSerializer(serializers.ModelSerializer):
    steps = StepSerializer(many=True, read_only=True)
    recipes = PipelineRecipeSerializer(many=True, read_only=True)
    functions = ModuleSerializer(many=True, read_only=True)
    class Meta:
        model = StepGroup
        fields = ('id', 'name', 'topic', 'steps', 'recipes', 'functions', 'owner')

class IngredientSerializer(serializers.ModelSerializer):
    class Meta:
        model = Ingredient
        fields = ('id', 'title', 'server', 'path', 'format', 'group', 'owner')

class IngredientGroupSerializer(serializers.ModelSerializer):
    ingredients = IngredientSerializer(many=True, read_only=True)
    recipes = PipelineRecipeSerializer(many=True, read_only=True)
    class Meta:
        model = IngredientGroup
        fields = ('id', 'name', 'topic', 'ingredients', 'recipes', 'owner') #

class UserCodeGroupSerializer(serializers.ModelSerializer):
    class Meta:
        model = UserCodeGroup
        fields = ('id', 'name')

class UserfileSerializer(serializers.ModelSerializer):
    models = ModelScriptSerializer(many=True, read_only=True)
    class Meta:
        model = Userfile
        fields = ('id', 'name','server', 'path', 'models', 'owner')


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Bull. trimest. Soc. mycol. Fr. 49(1): 118 (1933)

#### Original name
Inocybe oblectabilis f. macrospora Kühner

### Remarks
null


text:
This theme based on Twenty Fifteen code base. With style and UI changes. This is integrated with Gulp. Gulp will take care all the scss, js and images file to make a production ready minified code. So will no need for any worry.

!['stache](https://raw.githubusercontent.com/Subhojit1992/twenty-fifteen-with-gulp/master/screenshot.png)

## How to use this theme for your next project.

First thing first. Download the file as a zip or clone it on your pc in WP theme folder and open the command line tool and detected that directory. I will suggest to using Git-Bash, Power-Shell or Cmder for your command line tool.

Next make your systems has installed followings:

- Node with NPM (Updated)
- Git
- Gulp
- Sass
- Compass (Optional)

Now locate the "Twenty Fifteen With Gulp" theme directory and write the following code.
```JavaScript
npm install
```
Now will see every dependency will fetched automatically. After the "npm install" write the following code below.
```JavaScript
gulp
```
Gulp will started the all following task accordingly.
If you hit this command after that
```JavaScript
gulp watch
```
Gulp will look any changes you made in style or js file and notify you.
So start this Modern WP-THEME development work-flow. Stay awesome always with Front End Development.


text:
Ext.define('KitchenSink.view.binding.TwoWayFormulasModel', {
    extend: 'Ext.app.ViewModel',

    alias: 'viewmodel.binding-two-way-formulas',

    formulas: {
        age: {
            get: function (get) {
                return this.getAge(get('birthDate'));
            },

            set: function (age) {
                var date = this.getData().birthDate,
                    now = new Date();

                if (!date) {
                    date = Ext.Date.add(now, Ext.Date.YEAR, -age);
                } else {
                    date = new Date(now.getFullYear() - age, date.getMonth(), date.getDate());
                    if (this.getAge(date) !== age) {
                        date = new Date(now.getFullYear() - age - 1, date.getMonth(), date.getDate());
                    }
                }

                this.set('birthDate', date);
            }
        },

        fullName: {
            get: function (get) {
                var ret = get('firstName') || '',
                    last = get('lastName');

                if (last) {
                    ret += ' ' +  last;
                }

                return ret;
            },

            // By providing the set method "fullName" is two-way bindable.
            set: function (value) {
                var space = value.indexOf(' '),
                    split = (space < 0) ? value.length : space;

                this.set({
                    firstName: value.substring(0, split),
                    lastName: value.substring(split + 1)
                });
            }
        }
    },

    getAge: function (date) {
        var now = new Date(),
            age, birth;

        if (date) {
            age = now.getFullYear() - date.getFullYear();
            now = now.getMonth() * 100 + now.getDate();
            birth = date.getMonth() * 100 + date.getDate();
            if (now < birth) {
                --age;
            }
        }
        return age || 0;
    }
});


text:
import { createReducer }     from '../utils';
import { RECEIVE_ISSUE } from 'constants/issue';

const initialState = {};

export default createReducer(initialState, {
  [RECEIVE_ISSUE]: (state, payload) => (payload)
});


text:
require 'rack/mime'
require 'middleman-core/callback_manager'

module Middleman
  class ConfigContext
    extend Forwardable

    attr_reader :app

    # Whitelist methods that can reach out.
    def_delegators :@app, :config, :logger, :use, :map, :mime_type, :files, :root, :build?, :server?, :environment?, :extensions
    def_delegator :"@app.extensions", :activate

    def initialize(app, template_context_class)
      @app = app
      @template_context_class = template_context_class

      @callbacks = ::Middleman::CallbackManager.new
      @callbacks.install_methods!(self, [:before_build, :after_build, :configure, :after_configuration, :ready])

      # Trigger internal callbacks when app level are executed.
      app.subscribe_to_callbacks(&method(:execute_callbacks))
    end

    def include(mod)
      extend(mod)
    end

    def helpers(*helper_modules, &block)
      helper_modules ||= []

      if block_given?
        block_module = Module.new
        block_module.module_eval(&block)
        helper_modules << block_module
      end

      helper_modules.each do |mod|
        @template_context_class.send :include, mod
      end
    end

    def include_environment(name)
      path = File.dirname(__FILE__)
      other_config = File.join(path, name.to_s)

      return unless File.exist? other_config

      instance_eval File.read(other_config), other_config, 1
    end

    def set(key, default=nil, &block)
      config.define_setting(key, default) unless config.defines_setting?(key)
      @app.config[key] = block_given? ? block : default
    end

    # Add a new mime-type for a specific extension
    #
    # @param [Symbol] type File extension
    # @param [String] value Mime type
    # @return [void]
    def mime_type(type, value)
      type = ".#{type}" unless type.to_s[0] == '.'
      ::Rack::Mime::MIME_TYPES[type] = value
    end
  end
end