text:
<!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/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>C++ Web Framework: Controller Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

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

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

C++ Web Framework
    3.0

Public Member Functions |
List of all members

Controller Class Reference

The Controller class is responsable to attend a request from a specific url. You will need to create a derived class from Controller and then, reconstruct the desired method to response a request, after this, you will need mapping the url to the new controller that you created, you need to do it into the ConfigureCppWebServer using the method addUrlController.
 More...

#include <controller.h>

Inheritance diagram for Controller:

<map name="_controller_inherit__map" id="_controller_inherit__map">
</map>
[legend]

Public Member Functions

virtual 	~Controller ()

 	Destructor.

virtual void 	doDelete (Request &req, Response &resp) const

 	This is an virtual method that can be overloaded to attend the delete request method.  More...

virtual void 	doGet (Request &req, Response &resp) const

 	This is an virtual method that can be overloaded to attend the get request method.  More...

virtual void 	doOptions (Request &req, Response &resp) const

 	This is an virtual method that can be overloaded to attend the options request method.  More...

virtual void 	doPost (Request &req, Response &resp) const

 	This is an virtual method that can be overloaded to attend the post request method.  More...

virtual void 	doPut (Request &req, Response &resp) const

 	This is an virtual method that can be overloaded to attend the put request method.  More...

virtual void 	doTrace (Request &req, Response &resp) const

 	This is an virtual method that can be overloaded to attend the trace request method.  More...

Detailed Description

The Controller class is responsable to attend a request from a specific url. You will need to create a derived class from Controller and then, reconstruct the desired method to response a request, after this, you will need mapping the url to the new controller that you created, you need to do it into the ConfigureCppWebServer using the method addUrlController.

Member Function Documentation

◆ doDelete()

          virtual void Controller::doDelete
          (
          Request &
          req,

          Response &
          resp

          )
          	 const

inlinevirtual

This is an virtual method that can be overloaded to attend the delete request method.

Parameters

req	: This is a reference to the Request.

resp	: This is a reference to the Response.

◆ doGet()

          virtual void Controller::doGet
          (
          Request &
          req,

          Response &
          resp

          )
          	 const

inlinevirtual

This is an virtual method that can be overloaded to attend the get request method.

Parameters

req	: This is a reference to the Request.

resp	: This is a reference to the Response.

Reimplemented in CppWebController.

◆ doOptions()

          virtual void Controller::doOptions
          (
          Request &
          req,

          Response &
          resp

          )
          	 const

inlinevirtual

This is an virtual method that can be overloaded to attend the options request method.

Parameters

req	: This is a reference to the Request.

resp	: This is a reference to the Response.

◆ doPost()

          virtual void Controller::doPost
          (
          Request &
          req,

          Response &
          resp

          )
          	 const

inlinevirtual

This is an virtual method that can be overloaded to attend the post request method.

Parameters

req	: This is a reference to the Request.

resp	: This is a reference to the Response.

◆ doPut()

          virtual void Controller::doPut
          (
          Request &
          req,

          Response &
          resp

          )
          	 const

inlinevirtual

This is an virtual method that can be overloaded to attend the put request method.

Parameters

req	: This is a reference to the Request.

resp	: This is a reference to the Response.

◆ doTrace()

          virtual void Controller::doTrace
          (
          Request &
          req,

          Response &
          resp

          )
          	 const

inlinevirtual

This is an virtual method that can be overloaded to attend the trace request method.

Parameters

req	: This is a reference to the Request.

resp	: This is a reference to the Response.

The documentation for this class was generated from the following files:

/home/herik/CPPWebFramework/CPPWebFramework/cwf/controller.h

/home/herik/CPPWebFramework/CPPWebFramework/cwf/controller.cpp

<address class="footer">
Generated on Mon May 28 2018 11:09:08 for C++ Web Framework by

 1.8.13
</address>


text:
#include <type_traits>
#include "AGame.hh"

DamnCute::AGame::AGame(const std::string& resourcePath, const std::string& fileNameBg) : _engine(sCore),  _baseResourcesPath(resourcePath), _bg(new Background(_baseResourcesPath + fileNameBg)), _isEnd(true) {
  //_engine->freeAll();
    _engine->addOnBg(_bg);
}

DamnCute::AGame::AGame() : _engine(sCore), _baseResourcesPath("resources/"), _bg(NULL) , _isEnd(false) {
  /* _engine->freeAll();*/
}

DamnCute::APlayer* DamnCute::AGame::getPlayer(unsigned int id) {
     std::list<APlayer*>::iterator it = _players.begin();
    for (; id; --id, ++it);
    return *it;
}

template <typename T>
unsigned int DamnCute::AGame::addPlayer() {
    static_assert(std::is_base_of<APlayer, T>::value, "the type between <> MUST INERIT from APlayer !");
    static_assert(std::is_constructible<T>::value, "i can't construct that class for you\nmay be you forget to code some pure virtual from APlayer ?");
    static_assert(std::is_default_constructible<T>::value, "sorry but i can't construct your player if your constructor take arguments =/");
    T* ap = new T();
    _players.push_front(ap);
    _engine->addObject(ap);
    return _players.size();
}

unsigned int DamnCute::AGame::addPlayer(APlayer* ap) {
    _players.push_front(ap);
    _engine->addObject(ap);
    return _players.size();
}

void DamnCute::AGame::delPlayer(unsigned int id) {
    std::list<APlayer*>::iterator it = _players.begin();
    for (; id; --id, ++it);
    delete *it;
    _players.erase(it);
}

void DamnCute::AGame::stopRender() {
    _engine->hideObject(_bg);

    for (std::list<APlayer*>::iterator it = _players.begin(); it != _players.end() ; ++ it)  {
	_engine->hideObject(*it);
    }
}

/*
void DamnCute::AGame::gameLoop() {
    while (_isEnd) {
        _engine->flushScene();
        _engine->flushEvent();
	runGame();
    }
    }*/

DamnCute::AGame::~AGame() {
    _engine->freeAll();
}

redpajama_set_name: RedPajamaGithub


text:
//
// as/array
// -------------------------------------------------------------------------------------------------
// Maps an `{a: "b"}` object to a new array of `{key: "a", value: "b"}` pairs.
//
/**
 * @function asArray
 *
 * @param {Object} object
 *    The object to be mapped.
 *
 * @param {Object} [options]
 * @param {Number} [options.depth=1]
 *    The depth to which the `object`'s tree should be mapped. Set it to `Infinity` to map the
 *    entire tree structure.
 * @param {Boolean} [options.transformArrays=false]
 *    If true, arrays will be transformed. `["a", "b"]` will map to
 *    `[{key: "0", value: "a"}, {key: "1", value: "b"}]`. *
 *
 * @returns {Array}
 *    A new array of key-value pairs mapped from the object.
 */
export default function asArray (object, options) {
  // Parse options.
  if (!options) options = {};
  var depth = (typeof options.depth != "undefined"
    ? options.depth
    : 1
    );
  var transformArrays = !!options.transformArrays;

  // End recursion if we've reached a depth of 0.
  if (!depth) return object;

  // Return if `object` is an Array – unless `options.transformArrays` is set to true.
  if (object instanceof Array && !transformArrays) return object;

  // Create an empty `result` array.
  var result = [];
  // For every `key` of the given `object`:
  for (let key in object) if (object.hasOwnProperty(key)) {  // Can't use iterator because of https://6to5.org/docs/usage/caveats/
    let value = object[key];
    // - recurse if the value is an object
    if (typeof value == "object" && value !== null) {
      value = asArray(value
        , { depth: depth - 1
          , transformArrays: transformArrays
          }
        );
      }
    // - append {key: `key`, value: `object[key]`} to `result`
    result.push({key: key, value: value});
    }

  // Return the `result`.
  return result;
  }


text:
					Your application has been sent

Your reference is

					B23456C

What you need to do now

If possible you should send evidence to support your application, eg care plans, medical reports and prescriptions.

Write your National Insurance number on everything you send. Documents won't be returned - send copies if possible.

FREEPOST RTEU-HBEC-RGTG

				Personal Independence Payment 1

				Mail Handling Site A

				Wolverhampton

				WV98 1AA

What happens next/h1>

You'll get a letter with the outcome of your application, including whether you need to have a face to face assessment and when and where it will happen.

If you haven't got your letter by [insert date], phone [xxxxx-xxx-xxx].


text:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <item
        android:id="@+id/action_date_range"
        android:icon="@drawable/ic_date_picker"
        android:title="@string/date_range"
        app:showAsAction="always"/>
</menu>


text:
#!/usr/bin/ruby
# coding: utf-8
#
# Copyright (C) 2008-2016 Kalray SA.
#
# All rights reserved.
#

$LOAD_PATH.push('metabuild/lib')
require 'metabuild'
include Metabuild
BUILD_CONFIGS = `make list-configs`.split(" ").inject({}){|x, c| x.merge({ c => {} })}
VALID_CONFIGS = `make list-long-configs`.split(" ").inject({}){|x, c| x.merge({ c => {} })}

APP_NAME = "ODP-perf"

options = Options.new({ "k1tools"       => [ENV["K1_TOOLCHAIN_DIR"].to_s,"Path to a valid compiler prefix."],
                        "local-run"     => {"type" => "string", "default" => "0", "help" => "Run target locally"},
                        "debug"         => {"type" => "boolean", "default" => false, "help" => "Debug mode." },
                        "list-configs"  => {"type" => "boolean", "default" => false, "help" => "List all targets" },
                        "configs"       => {"type" => "string", "default" => BUILD_CONFIGS.keys.join(" "), "help" => "Build configs. Default = #{BUILD_CONFIGS.keys.join(" ")}" },
                        "valid-configs" => {"type" => "string", "default" => VALID_CONFIGS.keys.join(" "), "help" => "Build configs. Default = #{VALID_CONFIGS.keys.join(" ")}" },
                        "output-dir"    => [nil, "Output directory for RPMs."],
                        "k1version"     => ["unknown", "K1 Tools version required for building ODP applications"],
                        "librariesversion" => ["", "k1-libraries version required for building ODP applications"],
                     })

if options["list-configs"] == true then
    puts BUILD_CONFIGS.map(){|n, i| n}.join("\n")
    exit 0
end
workspace  = options["workspace"]
odp_clone  = options['clone']
jobs = options['jobs']

local_run = options["local-run"]

odp_path   = File.join(workspace,odp_clone)

odp_perf_files_path = "#{odp_path}/perf_files"
#odp_artifact_files_path = "#{odp_path}/artifact_files"

k1tools = options["k1tools"]

$env = {}
$env["K1_TOOLCHAIN_DIR"] = k1tools
$env["PATH"] = "#{k1tools}/bin:#{ENV["PATH"]}"
$env["LD_LIBRARY_PATH"] = "#{k1tools}/lib:#{k1tools}/lib64:#{ENV["LD_LIBRARY_PATH"]}"

repo = Git.new(odp_clone,workspace)

local_valid = options["local-valid"]

clean = Target.new("clean", repo, [])
version_check = Target.new("version_check", repo, [])
changelog = Target.new("changelog", repo, [])
build = Target.new("build", repo, [changelog, version_check])
install = Target.new("install", repo, [build])
report_perf = Target.new("report_perf", repo, [])
valid = ParallelTarget.new("valid", repo, [install])
valid_packages = ParallelTarget.new("valid-packages", repo, [])

long = nil
apps = nil

long_build = Target.new("long-build", repo, [install])
apps = Target.new("apps", repo, [install])
long = Target.new("long", repo, [])
dkms = Target.new("dkms", repo, [])
package = Target.new("package", repo, [install, apps, long_build, dkms])

b = Builder.new("odp", options, [clean, changelog, version_check, build, valid, valid_packages,
                                 long_build, long, apps, dkms, package, install, report_perf])

b.logsession = "odp"

b.default_targets = [valid]

debug_flags = options["debug"] == true ? "--enable-debug" : ""

configs=nil
valid_configs = options["valid-configs"].split()
valid_type = "sim"

if ENV["label"].to_s() != "" then
    case ENV["label"]
    when /MPPADevelopers-ab01b*/, /MPPAEthDevelopers-ab01b*/
        valid_configs = [
            "k1b-kalray-nodeos_developer",
            "k1b-kalray-mos_developer",
            "k1b-kalray-nodeos_developer-crypto",
            "k1b-kalray-mos_developer-crypto",
        ]
        valid_type = "jtag"
    when /KONIC80Developers*/, /MPPA_KONIC80_Developers*/
        valid_configs = [
            "k1b-kalray-nodeos_konic80",
            "k1b-kalray-mos_konic80",
            "k1b-kalray-nodeos_konic80-crypto",
            "k1b-kalray-mos_konic80-crypto",
        ]
        valid_type = "jtag"
    when /MPPA_EMB01b_centos7-with-eth-loopback/
        valid_configs = [
            "k1b-kalray-mos_emb01",
            "k1b-kalray-mos_emb01-crypto",
        ]
        valid_type = "remote"
    when /MPPA_AB04_Developers-with-loopback/
        valid_configs = [
            "k1b-kalray-mos_ab04",
            "k1b-kalray-mos_ab04-crypto",
        ]
        valid_type = "jtag"
    when "fedora19-64","debian6-64", /MPPADevelopers*/, /MPPAEthDevelopers*/
        # Validate nothing.
        valid_configs = [ ]
    when "fedora17-64"
        configs= [ "k1b-kalray-nodeos_explorer", "k1b-kalray-mos_explorer" ]
        # Validate nothing.
        valid_configs = [ ]
    when "centos7-64", "debian7-64","debian8-64"
        valid_configs = "k1b-kalray-nodeos_simu", "k1b-kalray-mos_simu"
        valid_type = "sim"
    when /MPPAExplorers_k1b*/
        valid_configs = [
            "k1b-kalray-nodeos_explorer",
            "k1b-kalray-mos_explorer",
            "k1b-kalray-nodeos_explorer-crypto",
            "k1b-kalray-mos_explorer-crypto",
        ]
        valid_type = "jtag"
    else
        raise("Unsupported label #{ENV["label"]}!")
    end
end

if configs == nil then
    configs = (options["configs"].split(" ")).uniq
    configs.each(){|conf|
        raise ("Invalid config '#{conf}'") if BUILD_CONFIGS[conf] == nil
    }
end

if options["output-dir"] != nil then
    artifacts = File.expand_path(options["output-dir"])
else
    artifacts = File.join(workspace,"artifacts")
end
mkdir_p artifacts unless File.exists?(artifacts)

b.target("changelog") do
    b.logtitle = "Report for odp changelog"
    cd odp_path
    ref_commit = ENV["INTEGRATION_BRANCH"]
    if(ref_commit == nil || ref_commit == "")
        # Do not know what is the source... Try HEAD^
        ref_commit = "HEAD^"
    else
	ref_commit = "origin/#{ref_commit}"
    end
    b.run("./ls_modules.sh #{ref_commit} HEAD | ./ansi2html.sh > #{artifacts}/ls_modules.html")
end

b.target("version_check") do
    b.run(" echo 'Checking header versions vs file versions'")
    tag=`git describe --match 'release-*'`.chomp()

    if tag !~ /release-([0-9]+)\.([0-9]+)\.([0-9]+)\.k([0-9]+)/ then
        raise("Invalid release tag")
    end
    generation=$1
    major=$2
    minor=$3
    kal_ver=$4
    (version,releaseID,sha1) = repo.describe()

   	file_gen=`grep ODP_VERSION_API_GENERATION include/odp/api/version.h  | awk '{ print $NF}'`.chomp()
   	file_maj=`grep ODP_VERSION_API_MAJOR include/odp/api/version.h  | awk '{ print $NF}'`.chomp()
   	file_min=`grep ODP_VERSION_API_MINOR include/odp/api/version.h  | awk '{ print $NF}'`.chomp()
   	file_kal_ver=`grep ODP_VERSION_KALRAY_VER platform/mppa/include/odp/version.h  | awk '{ print $NF}'`.chomp()

    raise ("Generation mismatch") if generation != file_gen
    raise ("Major mismatch") if major != file_maj
    raise ("Minor mismatch") if minor != file_min
    raise ("Kalray Version mismatch") if kal_ver != file_kal_ver

    b.run("echo 'Header and tag version match'")
end

b.target("build") do
    b.logtitle = "Report for odp build."
    cd odp_path

    b.run(:cmd => "make build CONFIGS='#{configs.join(" ")}'")
end

b.target("valid") do
    b.logtitle = "Report for odp tests."
    if valid_type == "jtag" then
	b.run(:cmd => "(/usr/sbin/lsmod | grep mppapcie_odp) ||"+
		      " (sudo /usr/sbin/modprobe mppapcie_odp)", :env => $env)
    end
    cd odp_path

    b.valid(:cmd => "make valid CONFIGS='#{valid_configs.join(" ")}'")

    b.valid(:cmd => "mkdir -p perf_files")
    #b.valid(:cmd => "mkdir -p artifact_files")

    if options['logtype'] == :junit then
        fName=File.dirname(options['logfile']) + "/" + "automake-tests.xml"
        b.valid(:cmd => "make junits CONFIGS='#{valid_configs.join(" ")}' JUNIT_FILE=#{fName}")
    end
end

b.target("valid-packages") do
    b.logtitle = "Report for odp tests."

    valid_configs.each(){|conf|
	cd odp_path
	cmd = "make --no-print-directory valid-packages-dir-#{conf}"
	b.run(:cmd => cmd,
	      :end => $env)

	odp_valid_name = `#{cmd}`.chomp()
        platform, board = odp_valid_name.split("_")
	p odp_valid_name
	p platform
	p board
        [ "platform/mppa/test", "test/performance", "helper/test"].each(){|dir|
            cd File.join(ENV["K1_TOOLCHAIN_DIR"], "share/odp/tests", board,
                         platform, dir)
            testEnv = $env.merge({ :test_name => "valid-#{conf}-#{dir}"})
          b.ctest( {
                        :ctest_args => "",
                        :fail_msg => "Failed to validate #{conf}",
                        :success_msg => "Successfully validated #{conf}",
                        :env => testEnv,
                    })
        }
    }
end

b.target("long-build") do
    b.logtitle = "Report for odp tests."
    cd odp_path

    b.run(:cmd => "make long-install CONFIGS='#{configs.join(" ")}'")
end

b.target("long") do
    b.logtitle = "Report for odp tests."
    if valid_type == "jtag" then
	b.run(:cmd => "(/usr/sbin/lsmod | grep mppapcie_odp) ||"+
		      " (sudo /usr/sbin/modprobe mppapcie_odp)", :env => $env)
    end

    cd odp_path

    valid_configs.each(){|conf|
        board=conf.split("_")[1]
        platform=conf.split("_")[0]

        testEnv = $env.merge({ :test_name => "long-#{conf}", :perf_files_path => odp_perf_files_path})

        if local_run == "1" then
            cd File.join(odp_path, "install/local/k1tools/share/odp/long", board, platform)
            ENV["LOCAL_RUN"] = "1"
        else
            cd File.join(ENV["K1_TOOLCHAIN_DIR"], "share/odp/long/", board, platform)
        end

        b.ctest( {
                     :ctest_args => "-L #{valid_type}",
                     :fail_msg => "Failed to validate #{conf}",
                     :success_msg => "Successfully validated #{conf}",
                     :env => testEnv,
                 })
    }
    b.report_perf_files("ODP-perf", [odp_perf_files_path])

    cd odp_path
    cd ".metabuild"
    if File.exists?("perffiles") then
        cd "perffiles"
        b.run("tar -cvf perffiles.tar *.perf")
        b.run("mv perffiles.tar #{artifacts}")
    end
end

b.target("apps") do
    b.logtitle = "Report for odp apps."
    cd odp_path

    b.run(:cmd => "make apps-install")

end

b.target("install") do

    b.logtitle = "Report for odp install."
    cd odp_path

    b.run(:cmd => "rm -Rf install/")
    b.run(:cmd => "make install CONFIGS='#{configs.join(" ")}'")
end

b.target("package") do
    b.logtitle = "Report for odp package."
    cd odp_path

    b.run(:cmd => "cd install/; tar cf ../odp.tar "+
                  "$(ls -d local/k1tools/lib/odp/* | grep -v -- -debug | grep -v -- -crypto ) ",
          :env => $env)
    b.run(:cmd => "cd install/; tar cf ../odp-crypto.tar "+
                  "$(ls -d local/k1tools/lib/odp/* | grep -v -- -debug | grep  -- -crypto ) ",
          :env => $env)
    b.run(:cmd => "cd install/; tar cf ../odp-common.tar "+
                  "$(ls -d local/k1tools/share/odp/firmware/* | grep -v -- -debug) "+
                  "local/k1tools/share/odp/build/ local/k1tools/share/odp/skel/ "+
                  "local/k1tools/k1*/include local/k1tools/lib64", :env => $env)

    b.run(:cmd => "cd install/; tar cf ../odp-doc.tar local/k1tools/share/doc/ ", :env => $env)
    b.run(:cmd => "cd install/; tar cf ../odp-tests.tar "+
                  "$(ls -d local/k1tools/share/odp/tests/* | grep -v -- -debug) "+
                  "$(ls -d local/k1tools/share/odp/long/* | grep -v -- -debug)", :env => $env)
    b.run(:cmd => "cd install/; tar cf ../odp-apps-internal.tar local/k1tools/share/odp/apps", :env => $env)
    b.run(:cmd => "cd install/; tar cf ../odp-runtime.tar local/k1tools/share/odp/apps/odp-netdev", :env => $env)
    b.run(:cmd => "cd install/; tar cf ../odp-cunit.tar local/k1tools/kalray_internal/cunit", :env => $env)
    b.run(:cmd => "cd install/; tar cf ../odp-headers-internal.tar local/k1tools/kalray_internal/odp", :env => $env)
    b.run(:cmd => "touch install/local/k1tools/lib/odp/foo-debug", :env => $env)
    b.run(:cmd => "cd install/; tar cf ../odp-debug.tar "+
                  "$(ls -d local/k1tools/lib/odp/* | grep -- -debug) "+
                  "$(ls -d local/k1tools/share/odp/firmware/* | grep -- -debug) " +
                  "$(ls -d local/k1tools/share/odp/tests/* | grep -- -debug) "+
                  "$(ls -d local/k1tools/share/odp/long/* | grep -- -debug)", :env => $env)
    (version,releaseID,sha1) = repo.describe()
    release_info = b.release_info(version,releaseID,sha1)
    sha1 = repo.sha1()

    #K1 ODP
    tar_package = File.expand_path("odp.tar")
    depends = []
    depends.push b.depends_info_struct.new("k1-re","=", options["k1version"], "")
    depends.push b.depends_info_struct.new("k1-dev","=", options["k1version"], "")
    depends.push b.depends_info_struct.new("k1-odp-doc","=", release_info.full_version)
    depends.push b.depends_info_struct.new("k1-odp-common","=", release_info.full_version)
    depends.push b.depends_info_struct.new("k1-mppapcie-odp-dkms","=", release_info.full_version)

    if not options["librariesversion"].to_s.empty? then
      depends.push b.depends_info_struct.new("k1-libraries","=", options["librariesversion"], "")
    end

    package_description = "K1 ODP package (k1-odp-#{version}-#{releaseID} sha1 #{sha1})."
    pinfo = b.package_info("k1-odp", release_info,
                           package_description,
                           depends, "/usr", workspace)
    pinfo.license = "BSD"
    b.create_package(tar_package, pinfo)

    #K1 ODP Crypto
    tar_package = File.expand_path("odp-crypto.tar")
    depends = []
    depends.push b.depends_info_struct.new("k1-re","=", options["k1version"], "")
    depends.push b.depends_info_struct.new("k1-dev","=", options["k1version"], "")
    depends.push b.depends_info_struct.new("k1-odp-doc","=", release_info.full_version)
    depends.push b.depends_info_struct.new("k1-odp-common","=", release_info.full_version)
    depends.push b.depends_info_struct.new("k1-mppapcie-odp-dkms","=", release_info.full_version)

    if not options["librariesversion"].to_s.empty? then
      depends.push b.depends_info_struct.new("k1-libraries","=", options["librariesversion"], "")
    end

    package_description = "K1 ODP Crypto package (k1-odp-#{version}-#{releaseID} sha1 #{sha1})."
    pinfo = b.package_info("k1-odp-crypto", release_info,
                           package_description,
                           depends, "/usr", workspace)
    pinfo.license = "BSD"
    b.create_package(tar_package, pinfo)

    #K1 ODP Common
    tar_package = File.expand_path("odp-common.tar")
    depends = []
    package_description = "K1 ODP Common package (k1-odp-runtime-#{version}-#{releaseID} sha1 #{sha1})."
    pinfo = b.package_info("k1-odp-common", release_info,
                           package_description,
                           depends, "/usr", workspace)
    pinfo.license = "BSD"
    b.create_package(tar_package, pinfo)

    #K1 ODP Runtime
    tar_package = File.expand_path("odp-runtime.tar")
    depends = []
    depends.push b.depends_info_struct.new("k1-re","=", options["k1version"], "")
    depends.push b.depends_info_struct.new("k1-odp-doc","=", release_info.full_version)
    depends.push b.depends_info_struct.new("k1-mppapcie-odp-dkms","=", release_info.full_version)

    package_description = "K1 ODP Runtime package (k1-odp-runtime-#{version}-#{releaseID} sha1 #{sha1})."
    pinfo = b.package_info("k1-odp-runtime", release_info,
                           package_description,
                           depends, "/usr", workspace)
    pinfo.license = "BSD"
    b.create_package(tar_package, pinfo)

    #K1 ODP Documentation
    tar_package = File.expand_path("odp-doc.tar")
    depends = []
    package_description = "K1 ODP Documentation (k1-odp-doc-#{version}-#{releaseID} sha1 #{sha1})."
    pinfo = b.package_info("k1-odp-doc", release_info,
                           package_description,
                           depends, "/usr", workspace)
    pinfo.license = "BSD"
    b.create_package(tar_package, pinfo)

    #K1 ODP Tests
    tar_package = File.expand_path("odp-tests.tar")
    depends = []
    depends.push b.depends_info_struct.new("k1-odp","=", release_info.full_version)
    package_description = "K1 ODP Standard Tests (k1-odp-tests-#{version}-#{releaseID} sha1 #{sha1})."
    pinfo = b.package_info("k1-odp-tests", release_info,
                           package_description,
                           depends, "/usr", workspace)
    pinfo.license = "BSD"
    b.create_package(tar_package, pinfo)

    #K1 ODP Apps Internal
    tar_package = File.expand_path("odp-apps-internal.tar")
    depends = []
    depends.push b.depends_info_struct.new("k1-odp","=", release_info.full_version)
    package_description = "K1 ODP Internal Application and Demo  (k1-odp-apps-internal-#{version}-#{releaseID} sha1 #{sha1})."
    pinfo = b.package_info("k1-odp-apps-internal", release_info,
                           package_description,
                           depends, "/usr", workspace)
    pinfo.license = "BSD"
    b.create_package(tar_package, pinfo)

    #K1 ODP CUnit
    tar_package = File.expand_path("odp-cunit.tar")
    depends = []
    depends.push b.depends_info_struct.new("k1-odp-cunit","=", release_info.full_version)
    package_description = "K1 ODP CUnit (k1-odp-cunit-#{version}-#{releaseID} sha1 #{sha1})."
    pinfo = b.package_info("k1-odp-cunit", release_info,
                           package_description,
                           depends, "/usr", workspace)
    pinfo.license = "BSD"
    b.create_package(tar_package, pinfo)

    #K1 ODP Internal Headers
    tar_package = File.expand_path("odp-headers-internal.tar")
    depends = []
    depends.push b.depends_info_struct.new("k1-odp","=", release_info.full_version)
    package_description = "K1 ODP Internal Headers  (k1-odp-headers-internal-#{version}-#{releaseID} sha1 #{sha1})."
    pinfo = b.package_info("k1-odp-headers-internal", release_info,
                           package_description,
                           depends, "/usr", workspace)
    pinfo.license = "BSD"
    b.create_package(tar_package, pinfo)

    #K1 ODP Debug
    tar_package = File.expand_path("odp-debug.tar")
    depends = []
    depends.push b.depends_info_struct.new("k1-odp","=", release_info.full_version)
    depends.push b.depends_info_struct.new("k1-odp-tests","=", release_info.full_version)
    package_description = "K1 ODP Debug Build  (k1-odp-debug-#{version}-#{releaseID} sha1 #{sha1})."
    pinfo = b.package_info("k1-odp-debug", release_info,
                           package_description,
                           depends, "/usr", workspace)
    b.create_package(tar_package, pinfo)

    # Generates k1r_parameters.sh
    output_parameters = File.join(artifacts,"parameters.sh")
    b.run("rm -f #{output_parameters}")
    b.run("echo 'K1ODP_VERSION=#{version}-#{releaseID}' >> #{output_parameters}")
    b.run("echo 'K1ODP_RELEASE=#{version}' >> #{output_parameters}")
    b.run("echo 'K1ODP_REVISION=#{repo.long_sha1()}' >> #{output_parameters}")
    b.run("echo 'COMMITER_EMAIL=#{ENV.fetch("COMMITER_EMAIL",options["email"])}' >> #{output_parameters}")
    b.run("echo 'INTEGRATION_BRANCH=#{ENV.fetch("INTEGRATION_BRANCH",options["branch"])}' >> #{output_parameters}")
    b.run("echo 'TMP_BRANCH=#{ENV["TARGET_BRANCH"]}' >> #{output_parameters}")
    b.run("echo 'REVISION=#{repo.long_sha1()}' >> #{output_parameters}")
    b.run("echo 'INIC_BUILD_NUMBER=#{ENV["BUILD_NUMBER"]}' >> #{output_parameters}")
    b.run("#{workspace}/metabuild/bin/packages.rb --tar=#{File.join(artifacts,"package.tar")} tar")
end

b.target("clean") do
    b.logtitle = "Report for odp clean."

    cd odp_path
    b.run(:cmd => "make clean", :env => $env)
end

b.target("dkms") do

  b.logtitle = "Report for mppapcie_odp driver dkms packaging"

  cd odp_path

  src_tar_name = "mppapcie_odp-src"
  mkdir_p src_tar_name

  b.run(:cmd => "cd mppapcie_odp && make clean")

  cd odp_path
  b.run("cp -rfL mppapcie_odp/* #{src_tar_name}/")
  b.run("mkdir -p #{src_tar_name}/package/lib/firmware")
  b.run("cd #{src_tar_name} && tar zcf ../#{src_tar_name}.tgz ./*")
  src_tar_package = File.expand_path("#{src_tar_name}.tgz")
  cd odp_path
  b.run("rm -rf #{src_tar_name}")

  mppa_pcie_ver=`rpm -qp --qf '%{VERSION}-%{RELEASE}' $K1_TOOLCHAIN_DIR/../../../k1-mppapcie-dkms-*.rpm`.chomp()
  if mppa_pcie_ver.to_s() == "" then
      mppa_pcie_ver = `dpkg-deb -f $K1_TOOLCHAIN_DIR/../../../k1-mppapcie-dkms-*.deb  Version`.chomp()
  end
  if mppa_pcie_ver.to_s() == "" then
      raise("Could not extract mppapcie pacage version")
  end

  depends = []
  depends.push b.depends_info_struct.new("k1-mppapcie-dkms","=", mppa_pcie_ver)

  unload_script =        "# Unload the mppapcie_odp module if it is loaded\n" +
    "MPPAPCIE_ODP_IS_LOADED=$(/bin/grep -c \"^mppapcie_odp\" /proc/modules)\n" +
    "if [ \"${MPPAPCIE_ODP_IS_LOADED}\" -gt 0 ]\n" +
    "then\n" +
    "	echo \"mppapcie_odp module is loaded, unloading it\" \n" +
    "	sudo /sbin/rmmod \"mppapcie_odp\" \n" +
    "	if [ $? -ne 0 ]\n" +
    "	then\n" +
    "		echo \"[FAIL]\"\n" +
    "		exit 1\n" +
    "	fi\n" +
    "	echo \"[OK]\"\n" +
    "fi\n"

  load_script =    ""

  # Versioning is performed now using tag of the form: release-1.0.0
  (version,buildID,sha1) = repo.describe()

  # Version of tools is passed from options["version"]
  package_description = "MPPA Eth package (version:#{version} releaseID=#{buildID} sha1:#{sha1})\n"
  package_description += "This package contains Kalray's mppa ethernet driver module."

  release_info = b.release_info(version,buildID,sha1)

  pack_name = "k1-mppapcie-odp-dkms"

  pinfo = b.package_info(pack_name, release_info,
                         package_description, depends,
                         "/kernel/../extra")

  pinfo.preinst_script = unload_script
  pinfo.postinst_script = load_script
  pinfo.preun_script = unload_script
  pinfo.postun_script = ""
  pinfo.installed_files = "%attr(0755,root,root) /lib/firmware/\n%attr(0755,root,root)"

  b.create_dkms_package(src_tar_package,pinfo,["mppapcie_odp"],)
end

b.target("report_perf") do

    raise "artifacts option not set" if(options["artifacts"].empty?)
    artifacts = File.expand_path(options["artifacts"])

    cd ".metabuild"
    if File.exists?("perffiles") then
        cd "perffiles"
        b.run("tar -cvf perffiles.tar *.perf")
        b.run("mv perffiles.tar #{artifacts}")
    end
end

b.launch


text:
How to Contribute
=================

We are so happy to see you reading this page!

Our team wholeheartedly welcomes the community to contribute to robosuite. Contributions from members of the community will help ensure the long-term success of this project. Before you plan to make contributions, here are important resources to get started with:

- Read the robosuite [documentation](https://robosuite.ai/docs/overview.html) and [whitepaper](https://robosuite.ai/assets/whitepaper.pdf)
- Check our latest status from existing [issues](https://github.com/ARISE-Initiative/robosuite/issues), [pull requests](https://github.com/ARISE-Initiative/robosuite/pulls), and [branches](https://github.com/ARISE-Initiative/robosuite/branches) and avoid duplicate efforts
- Join our [ARISE Slack](https://ariseinitiative.slack.com) workspace for technical discussions. Please [email us](mailto:yukez@cs.utexas.edu) to be added to the workspace.

We encourage the community to make four major types of contributions:

- **Bug fixes**: Address open issues and fix bugs presented in the `master` branch
- **Environment designs:** Design new environments and add them to our existing set of [environments](https://github.com/ARISE-Initiative/robosuite/tree/master/robosuite/environments)
- **Additional assets:** Incorporate new [models](https://github.com/ARISE-Initiative/robosuite/tree/master/robosuite/models) and functionalities of robots, grippers, objects, and workspaces
- **New functionalities:** Implement new features, such as dynamics randomization, rendering tools, new controllers, etc.

Testing
-------
Before submitting your contributions, make sure that the changes do not break existing functionalities.
We have a handful of [tests](https://github.com/ARISE-Initiative/robosuite/tree/master/tests) for verifying the correctness of the code.
You can run all the tests with the following command in the root folder of robosuite. Make sure that it does not throw any error before you proceed to the next step.
```sh
$ python -m pytest
```

Submission
----------
Please read the coding conventions below and make sure that your code is consistent with ours. We use the [black](https://github.com/psf/black) and [isort](https://github.com/pycqa/isort) as the [pre-commit](https://pre-commit.com/) hooks to format the source code before code review. To install these hooks, first `pip install pre-commit; pre-commit install` to set them up. Once set up, these hooks should be automatically triggered when committing new changes. If you want to manually check the format of the codes that have already been committed, please run `pre-commit run --all-files` in the project folder.

When making a contribution, make a [pull request](https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/proposing-changes-to-your-work-with-pull-requests)
to robosuite with an itemized list of what you have done. When you submit a pull request, it is immensely helpful to include example script(s) that showcase the proposed changes and highlight any new APIs.
We always love to see more test coverage. When it is appropriate, add a new test to the [tests](https://github.com/ARISE-Initiative/robosuite/tree/master/tests) folder for checking the correctness of your code.

Coding Conventions
------------------
In addition to the pre-commit hooks, we value readability and adhere to the following coding conventions:
- Indent using four spaces (soft tabs)
- Always put spaces after list items and method parameters (e.g., `[1, 2, 3]` rather than `[1,2,3]`), and around operators and hash arrows (e.g., `x += 1` rather than `x+=1`)
- Use the [Google Python Style](https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings) for the docstrings
- For scripts such as in [demos](https://github.com/ARISE-Initiative/robosuite/tree/master/robosuite/demos) and [tests](https://github.com/ARISE-Initiative/robosuite/tree/master/tests),
  include a docstring at the top of the file that describes the high-level purpose of the script and/or instructions on how to use the scripts (if relevant).

We look forward to your contributions. Thanks!

The robosuite core team


text:
import sys

import os
from datetime import timedelta

import telegram
from django.contrib.auth.models import User
from django.core.mail import EmailMultiAlternatives, send_mail
from django.core.management.base import BaseCommand
from django.template.loader import render_to_string
from django.urls import reverse
from django.utils.datetime_safe import date

from clubManagement.models import StatusUpdate

from clubManagement.management.commands._gmail_module import get_status_update_emails
from fosswebsite import settings

class Command(BaseCommand):
    help = 'Checks and updates the status updates'

    def add_arguments(self, parser):
        # optional argument to set a date

        parser.add_argument(
            '--date',
            action='store',
            dest='date',
            default='',
            help='Date to check status update (dd-mm-yyyy)'
        )

        parser.add_argument(
            '--mail',
            action='store_true',
            dest='mail',
            help='Sent status update as mail'
        )

        parser.add_argument(
            '--create-thread',
            action='store_true',
            dest='create-thread',
            help='Create a new thread for the status update'
        )

        parser.add_argument(
            '--telegram',
            action='store_true',
            dest='telegram',
            help='Sent status update to the telegram group'
        )

    @staticmethod
    def remove_periods_from_email(email):
        email_parts = email.split('@')
        return email_parts[0].replace('.', '') + '@' + email_parts[1]

    def handle(self, *args, **options):
        if options['date']:
            try:
                day, month, year = map(int, options['date'].split('-'))
                status_date = date(day=day, month=month, year=year)
            except ValueError:
                print('Date given is wrong, format is dd-mm-yyyy')
                sys.exit()
        else:
            status_date = date.today()
            #status_date = date.today() - timedelta(days=1)

        email_list = get_status_update_emails(status_date)
        print(email_list)

        mailing_list = settings.MAILING_LIST
        from_email = settings.EMAIL

        if email_list:
            # get all users in email_list
            users = User.objects.all()
            user_list = []

            for user in users:
                user_email = self.remove_periods_from_email(user.email)
                if user_email in email_list:
                    user_list.append(user)

            print(user_list)
            # Generate string user_id Y, user_id Y etc....
            status_string = ''

            for user in user_list:
                status_string += str(user.pk) + ' Y, '

            status_string = status_string[:-2]

            # create and process status update data
            status_update, created = StatusUpdate.objects.get_or_create(
                date=status_date)
            status_update.value = status_string
            status_update.process_report()

            domain = settings.DOMAIN

            url = 'https://%s%s' % (domain, reverse('status-update-detail',
                                                    kwargs={
                                                        'day': status_date.day,
                                                        'month': status_date.month,
                                                        'year': status_date.year
                                                    }))

            mailing_list = settings.MAILING_LIST
            from_email = settings.EMAIL

            if options.get('mail', False):

                if not mailing_list:
                    print('MAILING_LIST env variable needs to be set')
                    sys.exit()

                # Send status report
                # render with dynamic value
                html_content = render_to_string(
                    'clubManagement/status-report-mail-template.html', {
                        'status_update': status_update.get_report(),
                        'date': status_date,
                        'url': url
                    })

                # render text only mail
                text_content = render_to_string(
                    'clubManagement/status-report-mail-template.txt', {
                        'status_update': status_update.get_report(),
                        'date': status_date,
                        'url': url
                    })

                subject = 'Status update report %s' % status_date.strftime(
                    '%d-%m-%Y')

                email = EmailMultiAlternatives(
                    subject, text_content, from_email, [mailing_list])
                email.attach_alternative(html_content, "text/html")
                email.send()

            if options.get('telegram', False):
                text_content = render_to_string(
                    'clubManagement/status-report-telegram.txt', {
                        'status_update': status_update.get_report(),
                        'date': status_date,
                        'url': url
                    })

                # Telegram bot
                bot = telegram.Bot(
                    token=settings.telegram_bot_token)
                bot.send_message(
                    chat_id=settings.telegram_group_id,
                    text=text_content,
                    parse_mode=telegram.ParseMode.HTML
                )
        else:
            print("No status updates found, or google api key error.")

        if options.get('create-thread', False):
            # Send next status update reminder
            subject = 'Status Update [%s]' % date.today().strftime('%d-%m-%Y')

            text_content = 'Please reply to this thread to send your status ' \
                           'updates for %s' % date.today().strftime('%d-%m-%Y')

            send_mail(
                subject,
                text_content,
                from_email,
                [mailing_list],
                fail_silently=False,
            )
        print("Status update processing successful")


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Class com.communote.plugins.api.rest.v30.resource.attachment.AttachmentIsEmptyException (Communote 3.5 API)</title>
<meta name="date" content="2019-02-02">
<link rel="stylesheet" type="text/css" href="../../../../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Class
com.communote.plugins.api.rest.v30.resource.attachment.AttachmentIsEmptyException

Packages that use AttachmentIsEmptyException

Package
Description

com.communote.plugins.api.rest.v30.resource.attachment

Uses of AttachmentIsEmptyException in com.communote.plugins.api.rest.v30.resource.attachment

Methods in com.communote.plugins.api.rest.v30.resource.attachment that return types with arguments of type AttachmentIsEmptyException

Modifier and Type
Method and Description

Class<AttachmentIsEmptyException>
AttachmentIsEmptyExceptionMapper.getExceptionClass()

Methods in com.communote.plugins.api.rest.v30.resource.attachment with parameters of type AttachmentIsEmptyException

Modifier and Type
Method and Description

Status
AttachmentIsEmptyExceptionMapper.mapException(AttachmentIsEmptyException exception)

Maps the given exception to a status.

Methods in com.communote.plugins.api.rest.v30.resource.attachment that throw AttachmentIsEmptyException

Modifier and Type
Method and Description

static void
AttachmentResourceHelper.assertAttachmentSize(String contentType,
                    Long fileSize,
                    boolean isBase64)

Check attachment size and throw MaxLengthReachedException

protected javax.ws.rs.core.Response
AttachmentResourceHandler.handleCreateInternally(CreateAttachmentParameter createParameter,
                      String requestedMimeType,
                      javax.ws.rs.core.UriInfo uriInfo,
                      String requestSessionId,
                      javax.ws.rs.core.Request request)

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2019 Communote team. All rights reserved.


text:
/****************************************************************************
** Meta object code from reading C++ file 'qpushbutton.h'
**
** Created: Mon 26. Nov 09:23:49 2012
**      by: The Qt Meta Object Compiler version 63 (Qt 4.8.4)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/

#include "../../../widgets/qpushbutton.h"
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'qpushbutton.h' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 63
#error "This file was generated using the moc from 4.8.4. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif

QT_BEGIN_MOC_NAMESPACE
static const uint qt_meta_data_QPushButton[] = {

 // content:
       6,       // revision
       0,       // classname
       0,    0, // classinfo
       2,   14, // methods
       3,   24, // properties
       0,    0, // enums/sets
       0,    0, // constructors
       0,       // flags
       0,       // signalCount

 // slots: signature, parameters, type, tag, flags
      13,   12,   12,   12, 0x0a,
      24,   12,   12,   12, 0x08,

 // properties: name, type, flags
      47,   42, 0x01095103,
      59,   42, 0x01095103,
      67,   42, 0x01095103,

       0        // eod
};

static const char qt_meta_stringdata_QPushButton[] = {
    "QPushButton\0\0showMenu()\0_q_popupPressed()\0"
    "bool\0autoDefault\0default\0flat\0"
};

void QPushButton::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
    if (_c == QMetaObject::InvokeMetaMethod) {
        Q_ASSERT(staticMetaObject.cast(_o));
        QPushButton *_t = static_cast<QPushButton *>(_o);
        switch (_id) {
        case 0: _t->showMenu(); break;
        case 1: _t->d_func()->_q_popupPressed(); break;
        default: ;
        }
    }
    Q_UNUSED(_a);
}

const QMetaObjectExtraData QPushButton::staticMetaObjectExtraData = {
    0,  qt_static_metacall
};

const QMetaObject QPushButton::staticMetaObject = {
    { &QAbstractButton::staticMetaObject, qt_meta_stringdata_QPushButton,
      qt_meta_data_QPushButton, &staticMetaObjectExtraData }
};

#ifdef Q_NO_DATA_RELOCATION
const QMetaObject &QPushButton::getStaticMetaObject() { return staticMetaObject; }
#endif //Q_NO_DATA_RELOCATION

const QMetaObject *QPushButton::metaObject() const
{
    return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
}

void *QPushButton::qt_metacast(const char *_clname)
{
    if (!_clname) return 0;
    if (!strcmp(_clname, qt_meta_stringdata_QPushButton))
        return static_cast<void*>(const_cast< QPushButton*>(this));
    return QAbstractButton::qt_metacast(_clname);
}

int QPushButton::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QAbstractButton::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        if (_id < 2)
            qt_static_metacall(this, _c, _id, _a);
        _id -= 2;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< bool*>(_v) = autoDefault(); break;
        case 1: *reinterpret_cast< bool*>(_v) = isDefault(); break;
        case 2: *reinterpret_cast< bool*>(_v) = isFlat(); break;
        }
        _id -= 3;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setAutoDefault(*reinterpret_cast< bool*>(_v)); break;
        case 1: setDefault(*reinterpret_cast< bool*>(_v)); break;
        case 2: setFlat(*reinterpret_cast< bool*>(_v)); break;
        }
        _id -= 3;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 3;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 3;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 3;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 3;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 3;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 3;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
QT_END_MOC_NAMESPACE


text:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;
using Approve.RuleCenter;
using Approve.Common;
using Approve.EntityBase;

public partial class Admin_main_BadActioinKindAdd : Page
{
    Share sh = new Share();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            if (Request["fparentid"] == null || Request["fparentid"] == "")
            {
                return;
            }
            ShowParentInfo();
            this.btnAdd.Attributes.Add("onclick", "if(CheckInfo()){return true;}else{return false;}");
            if (Request["fid"] != null && Request["fid"] != null)
            {
                this.ViewState["FID"] = Request["fid"];
                ShowInfo();
            }
        }
    }
    private void ShowParentInfo()
    {
        StringBuilder sb = new StringBuilder();
        sb.Append("select fname from CF_Sys_BadActionCode where fid='" + Request["fparentid"] + "'");
        this.tPFName.Text = sh.GetSignValue(sb.ToString());
    }

    private void ShowInfo()
    {
        pageTool tool = new pageTool(this.Page);
        StringBuilder sb = new StringBuilder();
        sb.Append("select * from CF_Sys_BadActionCode where fid='" + this.ViewState["FID"].ToString() + "'");
        DataTable dt = sh.GetTable(sb.ToString());
        if (dt != null && dt.Rows.Count > 0)
        {
            tool.fillPageControl(dt.Rows[0]);
        }
    }
    private void SaveInfo()
    {
        if (Request["fparentid"] == null || Request["fparentid"] == "")
        {
            return;
        }
        string fParentNumber = sh.GetSignValue(EntityTypeEnum.EsBadActionCode, "FNumber", "fid='" + Request["fparentid"] + "'");
        if (fParentNumber == null || fParentNumber == "")
        {
            return;
        }
        string foldNumber = "";
        pageTool tool = new pageTool(this.Page);
        SaveOptionEnum so = SaveOptionEnum.Insert;
        SortedList sl = tool.getPageValue();
        if (this.ViewState["FID"] != null)
        {
            so = SaveOptionEnum.Update;
            sl.Add("FID", this.ViewState["FID"].ToString());
            foldNumber = sh.GetSignValue(EntityTypeEnum.EsBadActionCode, "FNumber", "FID='" + ViewState["FID"].ToString() + "'");
        }
        else
        {
            sl.Add("FID", Guid.NewGuid().ToString());
            sl.Add("FIsDeleted", 0);
            sl.Add("FCreateTime", DateTime.Now);

        }
        sl.Add("FParentId", fParentNumber);
        if (sh.SaveEBase(EntityTypeEnum.EsBadActionCode, sl, "FID", so))
        {
            this.ViewState["FID"] = sl["FID"].ToString();
            string fnewNumber = sl["FNUMBER"].ToString();
            if (fnewNumber != foldNumber && foldNumber != "")
            {
                StringBuilder sb = new StringBuilder();
                sb.Append("select FId from CF_Sys_BadActionCode where fparentid='" + foldNumber + "'");
                DataTable dt = sh.GetTable(sb.ToString());
                if (dt != null && dt.Rows.Count > 0)
                {
                    int rowCount = dt.Rows.Count;
                    SortedList[] sls = new SortedList[rowCount];
                    EntityTypeEnum[] ens = new EntityTypeEnum[rowCount];
                    string[] fkeys = new string[rowCount];
                    SaveOptionEnum[] sos = new SaveOptionEnum[rowCount];
                    for (int i = 0; i < rowCount; i++)
                    {
                        ens[i] = EntityTypeEnum.EsBadActionCode;
                        sls[i] = new SortedList();
                        sls[i].Add("FID", dt.Rows[i]["FID"].ToString());
                        sls[i].Add("FParentId", fnewNumber);
                        fkeys[i] = "FID";
                        sos[i] = SaveOptionEnum.Update;
                    }
                    sh.SaveEBaseM(ens, sls, fkeys, sos);
                }
            }
            tool.showMessage("保存成功");
            HSaveResult.Value = "1";
        }
        else
        {
            tool.showMessage("保存失败");
        }
    }

    protected void btnAdd_Click(object sender, EventArgs e)
    {
        SaveInfo();
    }
    protected void btnNew_Click(object sender, EventArgs e)
    {
        this.ViewState["FID"] = null;
        pageTool tool = new pageTool(this.Page);
        tool.ExecuteScript("clearPage()");
    }
}


text:
"""PHASM: a haplotype-aware de novo genome assembler which tries to output
contigs for each chromosome in an organism. The main focus of this assembler is
constructing genomes from aneuploid organisms."""

__version__ = '0.1'