answer
stringlengths
15
1.25M
/* EntityCollection.hpp */ /* This file is part of the FastGdk project. */ /* The FastGdk is free software: you can redistribute it and/or modify */ /* (at your option) any later version. */ /* The FastGdk is distributed in the hope that it will be useful, */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ #ifndef <API key> #define <API key> #include <Fast/Types.hpp> #include <Fast/Array.hpp> #include <Fast/EntityEntry.hpp> namespace Fast { class GraphicsContext; class PhysicsScene; class Entity; template class FastApi Array<EntityEntry>; class FastApi EntityCollection { private: PhysicsScene &mPhysicsScene; Array<EntityEntry> mEntityEntries; // Hide these functions. No copying collections! EntityCollection(const EntityCollection &that) : mPhysicsScene(that.mPhysicsScene) {} EntityCollection& operator=(const EntityCollection &that) { return *this; } public: // (Con/De)structors EntityCollection(PhysicsScene *physicsScene); ~EntityCollection(); // Entity functions Int AddEntity(Entity *entity); void RemoveEntity(Int id); void RemoveAllEntities(); Entity* GetEntity(Int id); const Entity& GetEntity(Int id) const; PhysicsScene* GetPhysicsScene(); const PhysicsScene& GetPhysicsScene() const; void Update(Long <API key>); void Draw(); }; } #endif // <API key>
#ifndef <API key> #define <API key> #include "<API key>.h" #include "<API key>.h" namespace QtAws { namespace ManagedBlockchain { class <API key>; class <API key> <API key> : public <API key> { Q_OBJECT public: <API key>(const <API key> &request, QNetworkReply * const reply, QObject * const parent = 0); virtual const <API key> * request() const Q_DECL_OVERRIDE; protected slots: virtual void parseSuccess(QIODevice &response) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(<API key>) Q_DISABLE_COPY(<API key>) }; } // namespace ManagedBlockchain } // namespace QtAws #endif
<?php $oForm=new plugin_form($this->oAdresse); $oForm->setMessage($this->tMessage); ?> <form class="form-horizontal" action="" method="POST" > <div class="form-group"> <label class="col-sm-2 control-label">rue</label> <div class="col-sm-10"><?php echo $oForm->getInputText('rue',array('class'=>'form-control')) ?></div> </div> <div class="form-group"> <label class="col-sm-2 control-label">ville</label> <div class="col-sm-10"><?php echo $oForm->getInputText('ville',array('class'=>'form-control')) ?></div> </div> <div class="form-group"> <label class="col-sm-2 control-label">pays</label> <div class="col-sm-10"><?php echo $oForm->getInputText('pays',array('class'=>'form-control')) ?></div> </div> <?php echo $oForm->getToken('token',$this->token)?> <div class="form-group"> <div class="col-sm-offset-2 col-sm-10"> <input type="submit" class="btn btn-success" value="Ajouter" /> <a class="btn btn-link" href="<?php echo $this->getLink('adresse::list')?>">Annuler</a> </div> </div> </form>
<import resource="classpath:alfresco/site-webscripts/org/alfresco/callutils.js"> if (!json.isNull("wikipage")) { var wikipage = String(json.get("wikipage")); model.pagecontent = getPageText(wikipage); model.title = wikipage.replace(/_/g, " "); } else { model.pagecontent = "<h3>" + msg.get("message.nopage") + "</h3>"; model.title = ""; } function getPageText(wikipage) { var c = sitedata.getComponent(url.templateArgs.componentId); c.properties["wikipage"] = wikipage; c.save(); var siteId = String(json.get("siteId")); var uri = "/slingshot/wiki/page/" + siteId + "/" + encodeURIComponent(wikipage) + "?format=mediawiki"; var connector = remote.connect("alfresco"); var result = connector.get(uri); if (result.status == status.STATUS_OK) { /** * Always strip unsafe tags here. * The config to option this is currently webscript-local elsewhere, so this is the safest option * until the config can be moved to share-config scope in a future version. */ return stringUtils.stripUnsafeHTML(result.response); } else { return ""; } }
#!/bin/bash # Usage: ./<API key>.sh <firmeare.elf> \ # <piksi_dev> <bmp_dev> \ # <seconds-to-sleep> # Intended to be called from HITL log capture: # if [ -e $<API key> ]; then # ./<API key>.sh ../../piksi_firmware_$GIT_DESCRIBE.elf \ # $<API key> \ # $<API key> \ # $SECONDS set -e [ -e $1 ] [ -e $2 ] [ -e $3 ] # Find serial number from Piksi device name export PIKSI=`echo $2 | egrep -o "PK[0-9]{4}"` gdb-multiarch -batch -nx \ -ex "tar ext $3" \ -ex "source coredump3.py" \ -ex "set gcore-file-name core-$PIKSI" \ -ex "mon jtag 4 5 6" \ -ex "att 1" \ -ex "run" \ $1 \ &>gdblog.$PIKSI & sleep 1 trap 'kill $(jobs -p)' SIGINT SIGTERM EXIT tail -f gdblog.$PIKSI | grep "core dumped" & sleep $4
package org.eso.ias.plugin; /** * The exception returned by the Plugin * @author acaproni * */ public class PluginException extends Exception { public PluginException() { } public PluginException(String message) { super(message); } public PluginException(Throwable cause) { super(cause); } public PluginException(String message, Throwable cause) { super(message, cause); } public PluginException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { super(message, cause, enableSuppression, writableStackTrace); } }
package clearvolume.renderer; /** * Overlays that implement this interface can declare a key binding that will be * used to toggle it's display on/off * * @author Loic Royer (2015) * */ public interface SingleKeyToggable { /** * Returns key code of toggle key combination. * * @return toggle key as short code. */ public short toggleKeyCode(); /** * Returns modifier of toggle key combination. * * @return toggle key as short code. */ public int <API key>(); /** * Toggle on/off * * @return new state */ public boolean toggle(); }
// This file is part of the go-ethereum library. // The go-ethereum library is free software: you can redistribute it and/or modify // (at your option) any later version. // The go-ethereum library is distributed in the hope that it will be useful, // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the package abi import ( "math/big" "github.com/matthieu/go-ethereum/common" ) type packUnpackTest struct { def string unpacked interface{} packed string } var packUnpackTests = []packUnpackTest{ // Booleans { def: `[{ "type": "bool" }]`, packed: "<SHA256-like>", unpacked: true, }, { def: `[{ "type": "bool" }]`, packed: "<SHA256-like>", unpacked: false, }, // Integers { def: `[{ "type": "uint8" }]`, unpacked: uint8(2), packed: "<SHA256-like>", }, { def: `[{ "type": "uint8[]" }]`, unpacked: []uint8{1, 2}, packed: "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>", }, { def: `[{ "type": "uint16" }]`, unpacked: uint16(2), packed: "<SHA256-like>", }, { def: `[{ "type": "uint16[]" }]`, unpacked: []uint16{1, 2}, packed: "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>", }, { def: `[{"type": "uint17"}]`, packed: "<SHA256-like>", unpacked: big.NewInt(1), }, { def: `[{"type": "uint32"}]`, packed: "<SHA256-like>", unpacked: uint32(1), }, { def: `[{"type": "uint32[]"}]`, unpacked: []uint32{1, 2}, packed: "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>", }, { def: `[{"type": "uint64"}]`, unpacked: uint64(2), packed: "<SHA256-like>", }, { def: `[{"type": "uint64[]"}]`, unpacked: []uint64{1, 2}, packed: "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>", }, { def: `[{"type": "uint256"}]`, unpacked: big.NewInt(2), packed: "<SHA256-like>", }, { def: `[{"type": "uint256[]"}]`, unpacked: []*big.Int{big.NewInt(1), big.NewInt(2)}, packed: "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>", }, { def: `[{"type": "int8"}]`, unpacked: int8(2), packed: "<SHA256-like>", }, { def: `[{"type": "int8[]"}]`, unpacked: []int8{1, 2}, packed: "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>", }, { def: `[{"type": "int16"}]`, unpacked: int16(2), packed: "<SHA256-like>", }, { def: `[{"type": "int16[]"}]`, unpacked: []int16{1, 2}, packed: "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>", }, { def: `[{"type": "int17"}]`, packed: "<SHA256-like>", unpacked: big.NewInt(1), }, { def: `[{"type": "int32"}]`, unpacked: int32(2), packed: "<SHA256-like>", }, { def: `[{"type": "int32"}]`, packed: "<SHA256-like>", unpacked: int32(1), }, { def: `[{"type": "int32[]"}]`, unpacked: []int32{1, 2}, packed: "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>", }, { def: `[{"type": "int64"}]`, unpacked: int64(2), packed: "<SHA256-like>", }, { def: `[{"type": "int64[]"}]`, unpacked: []int64{1, 2}, packed: "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>", }, { def: `[{"type": "int256"}]`, unpacked: big.NewInt(2), packed: "<SHA256-like>", }, { def: `[{"type": "int256"}]`, packed: "<SHA256-like>", unpacked: big.NewInt(-1), }, { def: `[{"type": "int256[]"}]`, unpacked: []*big.Int{big.NewInt(1), big.NewInt(2)}, packed: "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>", }, // Address { def: `[{"type": "address"}]`, packed: "<SHA256-like>", unpacked: common.Address{1}, }, { def: `[{"type": "address[]"}]`, unpacked: []common.Address{{1}, {2}}, packed: "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>", }, // Bytes { def: `[{"type": "bytes1"}]`, unpacked: [1]byte{1}, packed: "<SHA256-like>", }, { def: `[{"type": "bytes2"}]`, unpacked: [2]byte{1}, packed: "<SHA256-like>", }, { def: `[{"type": "bytes3"}]`, unpacked: [3]byte{1}, packed: "<SHA256-like>", }, { def: `[{"type": "bytes4"}]`, unpacked: [4]byte{1}, packed: "<SHA256-like>", }, { def: `[{"type": "bytes5"}]`, unpacked: [5]byte{1}, packed: "<SHA256-like>", }, { def: `[{"type": "bytes6"}]`, unpacked: [6]byte{1}, packed: "<SHA256-like>", }, { def: `[{"type": "bytes7"}]`, unpacked: [7]byte{1}, packed: "<SHA256-like>", }, { def: `[{"type": "bytes8"}]`, unpacked: [8]byte{1}, packed: "<SHA256-like>", }, { def: `[{"type": "bytes9"}]`, unpacked: [9]byte{1}, packed: "<SHA256-like>", }, { def: `[{"type": "bytes10"}]`, unpacked: [10]byte{1}, packed: "<SHA256-like>", }, { def: `[{"type": "bytes11"}]`, unpacked: [11]byte{1}, packed: "<SHA256-like>", }, { def: `[{"type": "bytes12"}]`, unpacked: [12]byte{1}, packed: "<SHA256-like>", }, { def: `[{"type": "bytes13"}]`, unpacked: [13]byte{1}, packed: "<SHA256-like>", }, { def: `[{"type": "bytes14"}]`, unpacked: [14]byte{1}, packed: "<SHA256-like>", }, { def: `[{"type": "bytes15"}]`, unpacked: [15]byte{1}, packed: "<SHA256-like>", }, { def: `[{"type": "bytes16"}]`, unpacked: [16]byte{1}, packed: "<SHA256-like>", }, { def: `[{"type": "bytes17"}]`, unpacked: [17]byte{1}, packed: "<SHA256-like>", }, { def: `[{"type": "bytes18"}]`, unpacked: [18]byte{1}, packed: "<SHA256-like>", }, { def: `[{"type": "bytes19"}]`, unpacked: [19]byte{1}, packed: "<SHA256-like>", }, { def: `[{"type": "bytes20"}]`, unpacked: [20]byte{1}, packed: "<SHA256-like>", }, { def: `[{"type": "bytes21"}]`, unpacked: [21]byte{1}, packed: "<SHA256-like>", }, { def: `[{"type": "bytes22"}]`, unpacked: [22]byte{1}, packed: "<SHA256-like>", }, { def: `[{"type": "bytes23"}]`, unpacked: [23]byte{1}, packed: "<SHA256-like>", }, { def: `[{"type": "bytes24"}]`, unpacked: [24]byte{1}, packed: "<SHA256-like>", }, { def: `[{"type": "bytes25"}]`, unpacked: [25]byte{1}, packed: "<SHA256-like>", }, { def: `[{"type": "bytes26"}]`, unpacked: [26]byte{1}, packed: "<SHA256-like>", }, { def: `[{"type": "bytes27"}]`, unpacked: [27]byte{1}, packed: "<SHA256-like>", }, { def: `[{"type": "bytes28"}]`, unpacked: [28]byte{1}, packed: "<SHA256-like>", }, { def: `[{"type": "bytes29"}]`, unpacked: [29]byte{1}, packed: "<SHA256-like>", }, { def: `[{"type": "bytes30"}]`, unpacked: [30]byte{1}, packed: "<SHA256-like>", }, { def: `[{"type": "bytes31"}]`, unpacked: [31]byte{1}, packed: "<SHA256-like>", }, { def: `[{"type": "bytes32"}]`, unpacked: [32]byte{1}, packed: "<SHA256-like>", }, { def: `[{"type": "bytes32"}]`, packed: "<SHA256-like>", unpacked: [32]byte{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, }, { def: `[{"type": "bytes"}]`, packed: "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>", unpacked: common.Hex2Bytes("<SHA256-like>"), }, { def: `[{"type": "bytes32"}]`, packed: "<SHA256-like>", unpacked: [32]byte{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, }, // Functions { def: `[{"type": "function"}]`, packed: "<SHA256-like>", unpacked: [24]byte{1}, }, // Slice and Array { def: `[{"type": "uint8[]"}]`, packed: "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>", unpacked: []uint8{1, 2}, }, { def: `[{"type": "uint8[]"}]`, packed: "<SHA256-like>" + "<SHA256-like>", unpacked: []uint8{}, }, { def: `[{"type": "uint256[]"}]`, packed: "<SHA256-like>" + "<SHA256-like>", unpacked: []*big.Int{}, }, { def: `[{"type": "uint8[2]"}]`, packed: "<SHA256-like>" + "<SHA256-like>", unpacked: [2]uint8{1, 2}, }, { def: `[{"type": "int8[2]"}]`, packed: "<SHA256-like>" + "<SHA256-like>", unpacked: [2]int8{1, 2}, }, { def: `[{"type": "int16[]"}]`, packed: "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>", unpacked: []int16{1, 2}, }, { def: `[{"type": "int16[2]"}]`, packed: "<SHA256-like>" + "<SHA256-like>", unpacked: [2]int16{1, 2}, }, { def: `[{"type": "int32[]"}]`, packed: "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>", unpacked: []int32{1, 2}, }, { def: `[{"type": "int32[2]"}]`, packed: "<SHA256-like>" + "<SHA256-like>", unpacked: [2]int32{1, 2}, }, { def: `[{"type": "int64[]"}]`, packed: "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>", unpacked: []int64{1, 2}, }, { def: `[{"type": "int64[2]"}]`, packed: "<SHA256-like>" + "<SHA256-like>", unpacked: [2]int64{1, 2}, }, { def: `[{"type": "int256[]"}]`, packed: "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>", unpacked: []*big.Int{big.NewInt(1), big.NewInt(2)}, }, { def: `[{"type": "int256[3]"}]`, packed: "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>", unpacked: [3]*big.Int{big.NewInt(1), big.NewInt(2), big.NewInt(3)}, }, // multi dimensional, if these pass, all types that don't require length prefix should pass { def: `[{"type": "uint8[][]"}]`, packed: "<SHA256-like>" + "<SHA256-like>", unpacked: [][]uint8{}, }, { def: `[{"type": "uint8[][]"}]`, packed: "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>", unpacked: [][]uint8{{1, 2}, {1, 2}}, }, { def: `[{"type": "uint8[][]"}]`, packed: "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>", unpacked: [][]uint8{{1, 2}, {1, 2, 3}}, }, { def: `[{"type": "uint8[2][2]"}]`, packed: "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>", unpacked: [2][2]uint8{{1, 2}, {1, 2}}, }, { def: `[{"type": "uint8[][2]"}]`, packed: "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>", unpacked: [2][]uint8{{}, {}}, }, { def: `[{"type": "uint8[][2]"}]`, packed: "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>", unpacked: [2][]uint8{{1}, {1}}, }, { def: `[{"type": "uint8[2][]"}]`, packed: "<SHA256-like>" + "<SHA256-like>", unpacked: [][2]uint8{}, }, { def: `[{"type": "uint8[2][]"}]`, packed: "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>", unpacked: [][2]uint8{{1, 2}}, }, { def: `[{"type": "uint8[2][]"}]`, packed: "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>", unpacked: [][2]uint8{{1, 2}, {1, 2}}, }, { def: `[{"type": "uint16[]"}]`, packed: "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>", unpacked: []uint16{1, 2}, }, { def: `[{"type": "uint16[2]"}]`, packed: "<SHA256-like>" + "<SHA256-like>", unpacked: [2]uint16{1, 2}, }, { def: `[{"type": "uint32[]"}]`, packed: "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>", unpacked: []uint32{1, 2}, }, { def: `[{"type": "uint32[2][3][4]"}]`, unpacked: [4][3][2]uint32{{{1, 2}, {3, 4}, {5, 6}}, {{7, 8}, {9, 10}, {11, 12}}, {{13, 14}, {15, 16}, {17, 18}}, {{19, 20}, {21, 22}, {23, 24}}}, packed: "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>", }, { def: `[{"type": "bytes32[]"}]`, unpacked: []common.Hash{{1}, {2}}, packed: "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>", }, { def: `[{"type": "uint32[2]"}]`, packed: "<SHA256-like>" + "<SHA256-like>", unpacked: [2]uint32{1, 2}, }, { def: `[{"type": "uint64[]"}]`, packed: "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>", unpacked: []uint64{1, 2}, }, { def: `[{"type": "uint64[2]"}]`, packed: "<SHA256-like>" + "<SHA256-like>", unpacked: [2]uint64{1, 2}, }, { def: `[{"type": "uint256[]"}]`, packed: "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>", unpacked: []*big.Int{big.NewInt(1), big.NewInt(2)}, }, { def: `[{"type": "uint256[3]"}]`, packed: "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>", unpacked: [3]*big.Int{big.NewInt(1), big.NewInt(2), big.NewInt(3)}, }, { def: `[{"type": "string[4]"}]`, packed: "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>", unpacked: [4]string{"Hello", "World", "Go-ethereum", "Ethereum"}, }, { def: `[{"type": "string[]"}]`, packed: "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>", unpacked: []string{"Ethereum", "go-ethereum"}, }, { def: `[{"type": "bytes[]"}]`, packed: "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>", unpacked: [][]byte{{0xf0, 0xf0, 0xf0}, {0xf0, 0xf0, 0xf0}}, }, { def: `[{"type": "uint256[2][][]"}]`, packed: "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>", unpacked: [][][2]*big.Int{{{big.NewInt(1), big.NewInt(200)}, {big.NewInt(1), big.NewInt(1000)}}, {{big.NewInt(1), big.NewInt(200)}, {big.NewInt(1), big.NewInt(1000)}}}, }, // struct outputs { def: `[{"name":"int1","type":"int256"},{"name":"int2","type":"int256"}]`, packed: "<SHA256-like>" + "<SHA256-like>", unpacked: struct { Int1 *big.Int Int2 *big.Int }{big.NewInt(1), big.NewInt(2)}, }, { def: `[{"name":"int_one","type":"int256"}]`, packed: "<SHA256-like>", unpacked: struct { IntOne *big.Int }{big.NewInt(1)}, }, { def: `[{"name":"int__one","type":"int256"}]`, packed: "<SHA256-like>", unpacked: struct { IntOne *big.Int }{big.NewInt(1)}, }, { def: `[{"name":"int_one_","type":"int256"}]`, packed: "<SHA256-like>", unpacked: struct { IntOne *big.Int }{big.NewInt(1)}, }, { def: `[{"name":"int_one","type":"int256"}, {"name":"intone","type":"int256"}]`, packed: "<SHA256-like>" + "<SHA256-like>", unpacked: struct { IntOne *big.Int Intone *big.Int }{big.NewInt(1), big.NewInt(2)}, }, { def: `[{"type": "string"}]`, unpacked: "foobar", packed: "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>", }, { def: `[{"type": "string[]"}]`, unpacked: []string{"hello", "foobar"}, packed: "<SHA256-like>" + "<SHA256-like>" + // len(array) = 2 "<SHA256-like>" + // offset 64 to i = 0 "<SHA256-like>" + // offset 128 to i = 1 "<SHA256-like>" + // len(str[0]) = 5 "<SHA256-like>" + // str[0] "<SHA256-like>" + // len(str[1]) = 6 "<SHA256-like>", // str[1] }, { def: `[{"type": "string[2]"}]`, unpacked: [2]string{"hello", "foobar"}, packed: "<SHA256-like>" + "<SHA256-like>" + // offset to i = 0 "<SHA256-like>" + // offset to i = 1 "<SHA256-like>" + // len(str[0]) = 5 "<SHA256-like>" + // str[0] "<SHA256-like>" + // len(str[1]) = 6 "<SHA256-like>", // str[1] }, { def: `[{"type": "bytes32[][]"}]`, unpacked: [][][32]byte{{{1}, {2}}, {{3}, {4}, {5}}}, packed: "<SHA256-like>" + "<SHA256-like>" + // len(array) = 2 "<SHA256-like>" + // offset 64 to i = 0 "<SHA256-like>" + // offset 160 to i = 1 "<SHA256-like>" + // len(array[0]) = 2 "<SHA256-like>" + // array[0][0] "<SHA256-like>" + // array[0][1] "<SHA256-like>" + // len(array[1]) = 3 "<SHA256-like>" + // array[1][0] "<SHA256-like>" + // array[1][1] "<SHA256-like>", // array[1][2] }, { def: `[{"type": "bytes32[][2]"}]`, unpacked: [2][][32]byte{{{1}, {2}}, {{3}, {4}, {5}}}, packed: "<SHA256-like>" + "<SHA256-like>" + // offset 64 to i = 0 "<SHA256-like>" + // offset 160 to i = 1 "<SHA256-like>" + // len(array[0]) = 2 "<SHA256-like>" + // array[0][0] "<SHA256-like>" + // array[0][1] "<SHA256-like>" + // len(array[1]) = 3 "<SHA256-like>" + // array[1][0] "<SHA256-like>" + // array[1][1] "<SHA256-like>", // array[1][2] }, { def: `[{"type": "bytes32[3][2]"}]`, unpacked: [2][3][32]byte{{{1}, {2}, {3}}, {{3}, {4}, {5}}}, packed: "<SHA256-like>" + // array[0][0] "<SHA256-like>" + // array[0][1] "<SHA256-like>" + // array[0][2] "<SHA256-like>" + // array[1][0] "<SHA256-like>" + // array[1][1] "<SHA256-like>", // array[1][2] }, { // static tuple def: `[{"name":"a","type":"int64"}, {"name":"b","type":"int256"}, {"name":"c","type":"int256"}, {"name":"d","type":"bool"}, {"name":"e","type":"bytes32[3][2]"}]`, unpacked: struct { A int64 B *big.Int C *big.Int D bool E [2][3][32]byte }{1, big.NewInt(1), big.NewInt(-1), true, [2][3][32]byte{{{1}, {2}, {3}}, {{3}, {4}, {5}}}}, packed: "<SHA256-like>" + // struct[a] "<SHA256-like>" + // struct[b] "<SHA256-like>" + // struct[c] "<SHA256-like>" + // struct[d] "<SHA256-like>" + // struct[e] array[0][0] "<SHA256-like>" + // struct[e] array[0][1] "<SHA256-like>" + // struct[e] array[0][2] "<SHA256-like>" + // struct[e] array[1][0] "<SHA256-like>" + // struct[e] array[1][1] "<SHA256-like>", // struct[e] array[1][2] }, { def: `[{"name":"a","type":"string"}, {"name":"b","type":"int64"}, {"name":"c","type":"bytes"}, {"name":"d","type":"string[]"}, {"name":"e","type":"int256[]"}, {"name":"f","type":"address[]"}]`, unpacked: struct { FieldA string `abi:"a"` // Test whether abi tag works FieldB int64 `abi:"b"` C []byte D []string E []*big.Int F []common.Address }{"foobar", 1, []byte{1}, []string{"foo", "bar"}, []*big.Int{big.NewInt(1), big.NewInt(-1)}, []common.Address{{1}, {2}}}, packed: "<SHA256-like>" + // struct[a] offset "<SHA256-like>" + // struct[b] "<SHA256-like>" + // struct[c] offset "<SHA256-like>" + // struct[d] offset "<SHA256-like>" + // struct[e] offset "<SHA256-like>" + // struct[f] offset "<SHA256-like>" + // struct[a] length "<SHA256-like>" + // struct[a] "foobar" "<SHA256-like>" + // struct[c] length "<SHA256-like>" + // []byte{1} "<SHA256-like>" + // struct[d] length "<SHA256-like>" + // foo offset "<SHA256-like>" + // bar offset "<SHA256-like>" + // foo length "<SHA256-like>" + // foo "<SHA256-like>" + // bar offset "<SHA256-like>" + // bar "<SHA256-like>" + // struct[e] length "<SHA256-like>" + "<SHA256-like>" + "<SHA256-like>" + // struct[f] length "<SHA256-like>" + // common.Address{1} "<SHA256-like>", // common.Address{2} }, { def: `[{"components": [{"name": "a","type": "uint256"}, {"name": "b","type": "uint256[]"}], "name": "a","type": "tuple"}, {"name": "b","type": "uint256[]"}]`, unpacked: struct { A struct { FieldA *big.Int `abi:"a"` B []*big.Int } B []*big.Int }{ A: struct { FieldA *big.Int `abi:"a"` // Test whether abi tag works for nested tuple B []*big.Int }{big.NewInt(1), []*big.Int{big.NewInt(1), big.NewInt(2)}}, B: []*big.Int{big.NewInt(1), big.NewInt(2)}}, packed: "<SHA256-like>" + // a offset "<SHA256-like>" + // b offset "<SHA256-like>" + // a.a value "<SHA256-like>" + // a.b offset "<SHA256-like>" + // a.b length "<SHA256-like>" + // a.b[0] value "<SHA256-like>" + // a.b[1] value "<SHA256-like>" + // b length "<SHA256-like>" + // b[0] value "<SHA256-like>", // b[1] value }, { def: `[{"components": [{"name": "a","type": "int256"}, {"name": "b","type": "int256[]"}], "name": "a","type": "tuple[]"}]`, unpacked: []struct { A *big.Int B []*big.Int }{ {big.NewInt(-1), []*big.Int{big.NewInt(1), big.NewInt(3)}}, {big.NewInt(1), []*big.Int{big.NewInt(2), big.NewInt(-1)}}, }, packed: "<SHA256-like>" + "<SHA256-like>" + // tuple length "<SHA256-like>" + // tuple[0] offset "<SHA256-like>" + // tuple[1] offset "<SHA256-like>" + // tuple[0].A "<SHA256-like>" + // tuple[0].B offset "<SHA256-like>" + // tuple[0].B length "<SHA256-like>" + // tuple[0].B[0] value "<SHA256-like>" + // tuple[0].B[1] value "<SHA256-like>" + // tuple[1].A "<SHA256-like>" + // tuple[1].B offset "<SHA256-like>" + // tuple[1].B length "<SHA256-like>" + // tuple[1].B[0] value "<SHA256-like>", // tuple[1].B[1] value }, { def: `[{"components": [{"name": "a","type": "int256"}, {"name": "b","type": "int256"}], "name": "a","type": "tuple[2]"}]`, unpacked: [2]struct { A *big.Int B *big.Int }{ {big.NewInt(-1), big.NewInt(1)}, {big.NewInt(1), big.NewInt(-1)}, }, packed: "<SHA256-like>" + // tuple[0].a "<SHA256-like>" + // tuple[0].b "<SHA256-like>" + // tuple[1].a "<SHA256-like>", // tuple[1].b }, { def: `[{"components": [{"name": "a","type": "int256[]"}], "name": "a","type": "tuple[2]"}]`, unpacked: [2]struct { A []*big.Int }{ {[]*big.Int{big.NewInt(-1), big.NewInt(1)}}, {[]*big.Int{big.NewInt(1), big.NewInt(-1)}}, }, packed: "<SHA256-like>" + "<SHA256-like>" + // tuple[0] offset "<SHA256-like>" + // tuple[1] offset "<SHA256-like>" + // tuple[0].A offset "<SHA256-like>" + // tuple[0].A length "<SHA256-like>" + // tuple[0].A[0] "<SHA256-like>" + // tuple[0].A[1] "<SHA256-like>" + // tuple[1].A offset "<SHA256-like>" + // tuple[1].A length "<SHA256-like>" + // tuple[1].A[0] "<SHA256-like>", // tuple[1].A[1] }, }
package co.edu.unal.<API key>.ajedrez.agentes; import co.edu.unal.<API key>.ajedrez.base.*; import co.edu.unal.<API key>.ajedrez.reversi.Tablero; import co.edu.unal.<API key>.ajedrez.reversi.Reversi.EstadoReversi; import java.io.PrintStream; public class <API key> extends _AgenteHeuristico { private Jugador jugador; private PrintStream output = null; private int niveles; public <API key>(int niveles) { super(); this.niveles = niveles; } public <API key>(int niveles, PrintStream output) { super(); this.niveles = niveles; this.output = output; } @Override public Jugador jugador() { return jugador; } @Override public void comienzo(Jugador jugador, Estado estado) { this.jugador = jugador; } @Override public void fin(Estado estado) { } @Override public void movimiento(Movimiento movimiento, Estado estado) { if(output != null){ output.println(String.format("Jugador %s mueve %s.", movimiento.jugador(), movimiento)); printEstado(estado); } } protected void printEstado(Estado estado) { if(output != null){ output.println("\t"+ estado.toString().replace("\n", "\n\t")); } } @Override public String toString() { return String.format("Agente Heuristico Basico " + jugador.toString()); } @Override public double darHeuristica(Estado estado) { char miFicha = (jugador().toString() == "JugadorNegras" ? 'N' :'B'); char fichaContrario = (jugador().toString() == "JugadorNegras" ? 'B' :'N'); Tablero tablero = ((EstadoReversi)(estado)).getTablero(); int misFichas = tablero.cantidadFichas(miFicha); int fichasContrario = tablero.cantidadFichas(fichaContrario); return misFichas - fichasContrario; } @Override public int niveles() { return niveles; } @Override public double <API key>() { return 18; } }
namespace ZeroMQ { <summary> Specifies possible results for socket receive operations. </summary> public enum ReceiveStatus { <summary> No receive operation has been performed. </summary> None, <summary> The receive operation returned a message that contains data. </summary> Received, <summary> Non-blocking mode was requested and no messages are available at the moment. </summary> TryAgain, <summary> The receive operation was interrupted, likely by terminating the containing context. </summary> Interrupted } }
<?php /** * @author jurgenhaas */ namespace GMJH\SQRL\Sample; use GMJH\SQRL\ClientException; /** * An override class for Sample SQRL account * * @author jurgenhaas * * @link */ class Account extends \GMJH\SQRL\Account { /** * @param Client $client * @param bool $additional * @return bool * @throws ClientException */ public function command_setkey($client, $additional = FALSE) { return FALSE; } /** * @param Client $client * @return bool * @throws ClientException */ public function command_setlock($client) { return FALSE; } /** * @param Client $client * @return bool * @throws ClientException */ public function command_disable($client) { return FALSE; } /** * @param Client $client * @return bool * @throws ClientException */ public function command_enable($client) { return FALSE; } /** * @param Client $client * @return bool * @throws ClientException */ public function command_delete($client) { return FALSE; } /** * @param Client $client * @return bool * @throws ClientException */ public function command_login($client) { return TRUE; } /** * @param Client $client * @return bool * @throws ClientException */ public function command_logme($client) { return FALSE; } /** * @param Client $client * @return bool * @throws ClientException */ public function command_logoff($client) { return FALSE; } #endregion }
using System; using System.Linq; using System.Collections.Generic; using System.Diagnostics; using System.Threading.Tasks; using System.Threading; namespace CoCoL { <summary> Static helper class to create channels </summary> public static class Channel { <summary> Gets or creates a named channel. </summary> <returns>The named channel.</returns> <param name="name">The name of the channel to find.</param> <param name="buffersize">The number of buffers in the channel.</param> <param name="scope">The scope to create a named channel in, defaults to null which means the current scope</param> <param name="maxPendingReaders">The maximum number of pending readers. A negative value indicates infinite</param> <param name="maxPendingWriters">The maximum number of pending writers. A negative value indicates infinite</param> <param name="<API key>">The strategy for dealing with overflow for read requests</param> <param name="<API key>">The strategy for dealing with overflow for write requests</param> <param name="broadcast"><c>True</c> will create the channel as a broadcast channel, the default <c>false</c> will create a normal channel</param> <param name="<API key>">The number of readers required on the channel before sending the first broadcast, can only be used with broadcast channels</param> <param name="broadcastMinimum">The minimum number of readers required on the channel, before a broadcast can be performed, can only be used with broadcast channels</param> <typeparam name="T">The channel type.</typeparam> public static IChannel<T> Get<T>(string name, int buffersize = 0, ChannelScope scope = null, int maxPendingReaders = -1, int maxPendingWriters = -1, <API key> <API key> = <API key>.Reject, <API key> <API key> = <API key>.Reject, bool broadcast = false, int <API key> = -1, int broadcastMinimum = -1) { return ChannelManager.GetChannel<T>(name, buffersize, scope, maxPendingReaders, maxPendingWriters, <API key>, <API key>, broadcast, <API key>, broadcastMinimum); } <summary> Gets or creates a named channel. </summary> <returns>The named channel.</returns> <param name="attr">The attribute describing the channel.</param> <param name="scope">The scope to create a named channel in, defaults to null which means the current scope</param> <typeparam name="T">The channel type.</typeparam> public static IChannel<T> Get<T>(<API key> attr, ChannelScope scope = null) { return ChannelManager.GetChannel<T>(attr, scope); } <summary> Gets or creates a named channel from a marker setup </summary> <returns>The named channel.</returns> <param name="marker">The channel marker instance that describes the channel.</param> <typeparam name="T">The channel type.</typeparam> public static IChannel<T> Get<T>(<API key><T> marker) { return ChannelManager.GetChannel<T>(marker); } <summary> Gets a write channel from a marker interface. </summary> <returns>The requested channel.</returns> <param name="channel">The marker interface, or a real channel instance.</param> <typeparam name="T">The channel type.</typeparam> public static IWriteChannelEnd<T> Get<T>(IWriteChannel<T> channel) { return ChannelManager.GetChannel<T>(channel); } <summary> Gets a read channel from a marker interface. </summary> <returns>The requested channel.</returns> <param name="channel">The marker interface, or a real channel instance.</param> <typeparam name="T">The channel type.</typeparam> public static IReadChannelEnd<T> Get<T>(IReadChannel<T> channel) { return ChannelManager.GetChannel<T>(channel); } <summary> Creates a channel, possibly unnamed. If a channel name is provided, the channel is created in the supplied scope. If a channel with the given name is already found in the supplied scope, the named channel is returned. </summary> <returns>The channel.</returns> <param name="name">The name of the channel, or null.</param> <param name="buffersize">The number of buffers in the channel.</param> <param name="scope">The scope to create a named channel in, defaults to null which means the current scope</param> <param name="maxPendingReaders">The maximum number of pending readers. A negative value indicates infinite</param> <param name="maxPendingWriters">The maximum number of pending writers. A negative value indicates infinite</param> <param name="<API key>">The strategy for dealing with overflow for read requests</param> <param name="<API key>">The strategy for dealing with overflow for write requests</param> <param name="broadcast"><c>True</c> will create the channel as a broadcast channel, the default <c>false</c> will create a normal channel</param> <param name="<API key>">The number of readers required on the channel before sending the first broadcast, can only be used with broadcast channels</param> <param name="broadcastMinimum">The minimum number of readers required on the channel, before a broadcast can be performed, can only be used with broadcast channels</param> <typeparam name="T">The channel type.</typeparam> public static IChannel<T> Create<T>(string name = null, int buffersize = 0, ChannelScope scope = null, int maxPendingReaders = -1, int maxPendingWriters = -1, <API key> <API key> = <API key>.Reject, <API key> <API key> = <API key>.Reject, bool broadcast = false, int <API key> = -1, int broadcastMinimum = -1) { return ChannelManager.CreateChannel<T>(name, buffersize, scope, maxPendingReaders, maxPendingWriters, <API key>, <API key>, broadcast, <API key>, broadcastMinimum); } <summary> Creates a channel, possibly unnamed. If a channel name is provided, the channel is created in the supplied scope. If a channel with the given name is already found in the supplied scope, the named channel is returned. </summary> <returns>The named channel.</returns> <param name="attr">The attribute describing the channel.</param> <param name="scope">The scope to create a named channel in, defaults to null which means the current scope</param> <typeparam name="T">The channel type.</typeparam> public static IChannel<T> Create<T>(<API key> attr, ChannelScope scope = null) { return ChannelManager.CreateChannel<T>(attr, scope); } } <summary> A channel that uses continuation callbacks </summary> public class Channel<T> : IChannel<T>, IUntypedChannel, IJoinAbleChannel, INamedItem { <summary> The minium value for the cleanup threshold </summary> protected const int <API key> = 100; <summary> Interface for an offer </summary> protected interface IEntry { <summary> The two-phase offer instance </summary> <value>The offer.</value> ITwoPhaseOffer Offer { get; } } <summary> Structure for keeping a read request </summary> protected struct ReaderEntry : IEntry, IEquatable<ReaderEntry> { <summary> The offer handler for the request </summary> public readonly ITwoPhaseOffer Offer; <summary> The callback method for reporting progress </summary> public readonly <API key><T> Source; #if !<API key> <summary> A flag indicating if signalling task completion must be enqued on the task pool </summary> public readonly bool EnqueueContinuation; #endif <summary> Initializes a new instance of the <see cref="CoCoL.Channel&lt;T&gt;.ReaderEntry"/> struct. </summary> <param name="offer">The offer handler</param> public ReaderEntry(ITwoPhaseOffer offer) { Offer = offer; #if <API key> Source = new <API key><T>(); #else EnqueueContinuation = ExecutionScope.Current.IsLimitingPool; Source = new <API key><T>( EnqueueContinuation ? TaskCreationOptions.None : TaskCreationOptions.<API key>); #endif } <summary> The offer handler for the request </summary> ITwoPhaseOffer IEntry.Offer { get { return Offer; } } <summary> Gets a value indicating whether this <see cref="T:CoCoL.Channel`1.ReaderEntry"/> is timed out. </summary> public bool IsTimeout => Offer is IExpiringOffer expOffer && expOffer.IsExpired; <summary> Gets a value indicating whether this <see cref="T:CoCoL.Channel`1.ReaderEntry"/> is cancelled. </summary> public bool IsCancelled => Offer is ICancelAbleOffer canOffer && canOffer.CancelToken.<API key>; <summary> Gets a value representing the expiration time of this entry </summary> public DateTime Expires => Offer is IExpiringOffer expOffer ? expOffer.Expires : new DateTime(0); <summary> Signals that the probe phase has finished </summary> public void ProbeCompleted() { if (Offer is IExpiringOffer offer) offer.ProbeComplete(); } <summary> Explict disable of compares </summary> <param name="other">The item to compare with</param> <returns>Always throws an exception to avoid compares</returns> public bool Equals(ReaderEntry other) { throw new <API key>(); } } <summary> Structure for keeping a write request </summary> protected struct WriterEntry : IEntry, IEquatable<WriterEntry> { <summary> The offer handler for the request </summary> public readonly ITwoPhaseOffer Offer; <summary> The callback method for reporting progress </summary> public readonly <API key><bool> Source; <summary> The cancellation token </summary> public readonly CancellationToken CancelToken; <summary> The value being written </summary> public readonly T Value; #if !<API key> <summary> A flag indicating if signalling task completion must be enqued on the task pool </summary> public readonly bool EnqueueContinuation; #endif <summary> Initializes a new instance of the <see cref="CoCoL.Channel&lt;T&gt;.WriterEntry"/> struct. </summary> <param name="offer">The offer handler</param> <param name="value">The value being written.</param> public WriterEntry(ITwoPhaseOffer offer, T value) { Offer = offer; #if <API key> Source = new <API key><bool>(); #else EnqueueContinuation = ExecutionScope.Current.IsLimitingPool; Source = new <API key><bool>( EnqueueContinuation ? TaskCreationOptions.None : TaskCreationOptions.<API key>); #endif Value = value; } <summary> Initializes a new empty instance of the <see cref="CoCoL.Channel&lt;T&gt;.WriterEntry"/> struct. </summary> <param name="value">The value being written.</param> public WriterEntry(T value) { Offer = null; Source = null; Value = value; #if !<API key> EnqueueContinuation = false; #endif } <summary> The offer handler for the request </summary> ITwoPhaseOffer IEntry.Offer { get { return Offer; } } <summary> Gets a value indicating whether this <see cref="T:CoCoL.Channel`1.ReaderEntry"/> is timed out. </summary> public bool IsTimeout => Offer is IExpiringOffer && ((IExpiringOffer)Offer).IsExpired; <summary> Gets a value indicating whether this <see cref="T:CoCoL.Channel`1.ReaderEntry"/> is cancelled. </summary> public bool IsCancelled => Offer is ICancelAbleOffer && ((ICancelAbleOffer)Offer).CancelToken.<API key>; <summary> Gets a value representing the expiration time of this entry </summary> public DateTime Expires => Offer is IExpiringOffer ? ((IExpiringOffer)Offer).Expires : new DateTime(0); <summary> Signals that the probe phase has finished </summary> public void ProbeCompleted() { if (Offer is IExpiringOffer offer) offer.ProbeComplete(); } <summary> Explict disable of compares </summary> <param name="other">The item to compare with</param> <returns>Always throws an exception to avoid compares</returns> public bool Equals(WriterEntry other) { throw new <API key>(); } } <summary> The queue with pending readers </summary> protected List<ReaderEntry> m_readerQueue = new List<ReaderEntry>(1); <summary> The queue with pending writers </summary> protected List<WriterEntry> m_writerQueue = new List<WriterEntry>(1); <summary> The maximal size of the queue </summary> protected readonly int m_bufferSize; <summary> The lock object protecting access to the queues </summary> protected readonly AsyncLock m_asynclock = new AsyncLock(); <summary> Gets or sets the name of the channel </summary> <value>The name.</value> public string Name { get; private set; } <summary> Gets a value indicating whether this instance is retired. </summary> <value><c>true</c> if this instance is retired; otherwise, <c>false</c>.</value> public Task<bool> IsRetiredAsync { get { return GetIsRetiredAsync(); } } <summary> Gets a value indicating whether this instance is retired. </summary> protected bool m_isRetired; <summary> The number of messages to process before marking the channel as retired </summary> protected int m_retireCount = -1; <summary> The number of reader processes having joined the channel </summary> protected int m_joinedReaderCount = 0; <summary> The number of writer processes having joined the channel </summary> protected int m_joinedWriterCount = 0; <summary> The threshold for performing writer queue cleanup </summary> protected int <API key> = <API key>; <summary> The threshold for performing reader queue cleanup </summary> protected int <API key> = <API key>; <summary> The maximum number of pending readers to allow </summary> protected readonly int m_maxPendingReaders; <summary> The strategy for selecting pending readers to discard on overflow </summary> protected readonly <API key> <API key>; <summary> The maximum number of pending writers to allow </summary> protected readonly int m_maxPendingWriters; <summary> The strategy for selecting pending writers to discard on overflow </summary> protected readonly <API key> <API key>; <summary> Initializes a new instance of the <see cref="CoCoL.Channel&lt;T&gt;"/> class. </summary> <param name="attribute">The attribute describing the channel</param> internal Channel(<API key> attribute) { if (attribute == null) throw new <API key>(nameof(attribute)); if (attribute.BufferSize < 0) throw new <API key>(nameof(attribute), "The size parameter must be greater than or equal to zero"); this.Name = attribute.Name; m_bufferSize = attribute.BufferSize; m_maxPendingReaders = attribute.MaxPendingReaders; m_maxPendingWriters = attribute.MaxPendingWriters; <API key> = attribute.<API key>; <API key> = attribute.<API key>; } <summary> Helper method for accessor to get the retired state </summary> <returns>The is retired async.</returns> protected async Task<bool> GetIsRetiredAsync() { using (await m_asynclock.LockAsync()) return m_isRetired; } <summary> Offers a transaction to the write end </summary> <param name="wr">The writer entry.</param> protected async Task<bool> Offer(WriterEntry wr) { Exception tex = null; bool accept = false; System.Diagnostics.Debug.Assert(wr.Source == m_writerQueue[0].Source); try { accept = (wr.Source == null || wr.Source.Task.Status == TaskStatus.<API key>) && (wr.Offer == null || await wr.Offer.OfferAsync(this).ConfigureAwait(false)); } catch (Exception ex) { tex = ex; // Workaround to support C# 5.0, with no await in catch clause } if (tex != null) { TrySetException(wr, tex); m_writerQueue.RemoveAt(0); return false; } if (!accept) { TrySetCancelled(wr); m_writerQueue.RemoveAt(0); return false; } return true; } <summary> Offersa transaction to the read end </summary> <param name="rd">The reader entry.</param> protected async Task<bool> Offer(ReaderEntry rd) { Exception tex = null; bool accept = false; System.Diagnostics.Debug.Assert(rd.Source == m_readerQueue[0].Source); try { accept = (rd.Source == null || rd.Source.Task.Status == TaskStatus.<API key>) && (rd.Offer == null || await rd.Offer.OfferAsync(this).ConfigureAwait(false)); } catch (Exception ex) { tex = ex; // Workaround to support C# 5.0, with no await in catch clause } if (tex != null) { TrySetException(rd, tex); m_readerQueue.RemoveAt(0); return false; } if (!accept) { TrySetCancelled(rd); m_readerQueue.RemoveAt(0); return false; } return true; } <summary> Method that examines the queues and matches readers with writers </summary> <returns>An awaitable that signals if the caller has been accepted or rejected.</returns> <param name="asReader"><c>True</c> if the caller method is a reader, <c>false</c> otherwise.</param> <param name="caller">The caller task.</param> protected virtual async Task<bool> <API key>(bool asReader, Task caller) { var processed = false; while (m_writerQueue != null && m_readerQueue != null && m_writerQueue.Count > 0 && m_readerQueue.Count > 0) { var wr = m_writerQueue[0]; var rd = m_readerQueue[0]; bool offerWriter; bool offerReader; // If the caller is a reader, we assume that the // read call will always proceed, and start emptying // the write queue, and vice versa if the caller // is a writer if (asReader) { offerWriter = await Offer(wr).ConfigureAwait(false); if (!offerWriter) continue; offerReader = await Offer(rd).ConfigureAwait(false); } else { offerReader = await Offer(rd).ConfigureAwait(false); if (!offerReader) continue; offerWriter = await Offer(wr).ConfigureAwait(false); } // We flip the first entry, so we do not repeatedly // offer the side that agrees, and then discover // that the other side denies asReader = !asReader; // If the ends disagree, the declining end // has been removed from the queue, so we just // withdraw the offer from the other end if (!(offerReader && offerWriter)) { if (wr.Offer != null && offerWriter) await wr.Offer.WithdrawAsync(this).ConfigureAwait(false); if (rd.Offer != null && offerReader) await rd.Offer.WithdrawAsync(this).ConfigureAwait(false); } else { // transaction complete m_writerQueue.RemoveAt(0); m_readerQueue.RemoveAt(0); if (wr.Offer != null) await wr.Offer.CommitAsync(this).ConfigureAwait(false); if (rd.Offer != null) await rd.Offer.CommitAsync(this).ConfigureAwait(false); if (caller == rd.Source.Task || (wr.Source != null && caller == wr.Source.Task)) processed = true; SetResult(rd, wr.Value); SetResult(wr, true); // Release items if there is space in the buffer await <API key>(true).ConfigureAwait(false); // Adjust the cleanup threshold if (m_writerQueue.Count <= <API key> - <API key>) <API key> = Math.Max(<API key>, m_writerQueue.Count + <API key>); // Adjust the cleanup threshold if (m_readerQueue.Count <= <API key> - <API key>) <API key> = Math.Max(<API key>, m_readerQueue.Count + <API key>); // If this was the last item before the retirement, // flush all following and set the retired flag await <API key>(true).ConfigureAwait(false); } } return processed || caller.Status != TaskStatus.<API key>; } <summary> Registers a desire to read from the channel </summary> public Task<T> ReadAsync() { return ReadAsync(null); } <summary> Registers a desire to read from the channel </summary> <param name="offer">A callback method for offering an item, use null to unconditionally accept</param> public async Task<T> ReadAsync(ITwoPhaseOffer offer) { var rd = new ReaderEntry(offer); if (rd.IsCancelled) throw new <API key>(); using (await m_asynclock.LockAsync()) { if (m_isRetired) { TrySetException(rd, new RetiredException(this.Name)); return await rd.Source.Task.ConfigureAwait(false); } m_readerQueue.Add(rd); if (!await <API key>(true, rd.Source.Task).ConfigureAwait(false)) { rd.ProbeCompleted(); System.Diagnostics.Debug.Assert(m_readerQueue[m_readerQueue.Count - 1].Source == rd.Source); // If this was a probe call, return a timeout now if (rd.IsTimeout) { m_readerQueue.RemoveAt(m_readerQueue.Count - 1); TrySetException(rd, new TimeoutException()); } else if (rd.IsCancelled) { m_readerQueue.RemoveAt(m_readerQueue.Count - 1); TrySetException(rd, new <API key>()); } else { // Make room if we have too many if (m_maxPendingReaders > 0 && (m_readerQueue.Count - 1) >= m_maxPendingReaders) { switch (<API key>) { case <API key>.FIFO: { var exp = m_readerQueue[0]; m_readerQueue.RemoveAt(0); TrySetException(exp, new <API key>(this.Name)); } break; case <API key>.LIFO: { var exp = m_readerQueue[m_readerQueue.Count - 2]; m_readerQueue.RemoveAt(m_readerQueue.Count - 2); TrySetException(exp, new <API key>(this.Name)); } break; //case <API key>.Reject: default: { var exp = m_readerQueue[m_readerQueue.Count - 1]; m_readerQueue.RemoveAt(m_readerQueue.Count - 1); TrySetException(exp, new <API key>(this.Name)); } break; } } // If we have expanded the queue with a new batch, see if we can purge old entries <API key> = await <API key>(m_readerQueue, true, <API key>).ConfigureAwait(false); if (rd.Offer is IExpiringOffer && ((IExpiringOffer)rd.Offer).Expires != Timeout.InfiniteDateTime) ExpirationManager.<API key>(((IExpiringOffer)rd.Offer).Expires, () => ExpireItemsAsync().FireAndForget()); } } } return await rd.Source.Task.ConfigureAwait(false); } <summary> Registers a desire to write to the channel </summary> <param name="value">The value to write to the channel.</param> public Task WriteAsync(T value) { return WriteAsync(value, null); } <summary> Registers a desire to write to the channel </summary> <param name="offer">A callback method for offering an item, use null to unconditionally accept</param> <param name="value">The value to write to the channel.</param> public async Task WriteAsync(T value, ITwoPhaseOffer offer) { var wr = new WriterEntry(offer, value); if (wr.IsCancelled) throw new <API key>(); using (await m_asynclock.LockAsync()) { if (m_isRetired) { TrySetException(wr, new RetiredException(this.Name)); await wr.Source.Task.ConfigureAwait(false); return; } m_writerQueue.Add(wr); if (!await <API key>(false, wr.Source.Task).ConfigureAwait(false)) { System.Diagnostics.Debug.Assert(m_writerQueue[m_writerQueue.Count - 1].Source == wr.Source); // If we have a buffer slot to use if (m_writerQueue.Count <= m_bufferSize && m_retireCount < 0) { if (offer == null || await offer.OfferAsync(this)) { if (offer != null) await offer.CommitAsync(this).ConfigureAwait(false); m_writerQueue[m_writerQueue.Count - 1] = new WriterEntry(value); TrySetResult(wr, true); } else { TrySetCancelled(wr); } // For good measure, we also make sure the probe phase is completed wr.ProbeCompleted(); } else { wr.ProbeCompleted(); // If this was a probe call, return a timeout now if (wr.IsTimeout) { m_writerQueue.RemoveAt(m_writerQueue.Count - 1); TrySetException(wr, new TimeoutException()); } else if (wr.IsCancelled) { m_writerQueue.RemoveAt(m_writerQueue.Count - 1); TrySetException(wr, new <API key>()); } else { // Make room if we have too many if (m_maxPendingWriters > 0 && (m_writerQueue.Count - m_bufferSize - 1) >= m_maxPendingWriters) { switch (<API key>) { case <API key>.FIFO: { var exp = m_writerQueue[m_bufferSize]; m_writerQueue.RemoveAt(m_bufferSize); TrySetException(exp, new <API key>(this.Name)); } break; case <API key>.LIFO: { var exp = m_writerQueue[m_writerQueue.Count - 2]; m_writerQueue.RemoveAt(m_writerQueue.Count - 2); TrySetException(exp, new <API key>(this.Name)); } break; //case <API key>.Reject: default: { var exp = m_writerQueue[m_writerQueue.Count - 1]; m_writerQueue.RemoveAt(m_writerQueue.Count - 1); TrySetException(exp, new <API key>(this.Name)); } break; } } // If we have expanded the queue with a new batch, see if we can purge old entries <API key> = await <API key>(m_writerQueue, true, <API key>).ConfigureAwait(false); if (wr.Offer is IExpiringOffer && ((IExpiringOffer)wr.Offer).Expires != Timeout.InfiniteDateTime) ExpirationManager.<API key>(((IExpiringOffer)wr.Offer).Expires, () => ExpireItemsAsync().FireAndForget()); } } } } await wr.Source.Task.ConfigureAwait(false); return; } <summary> Purges items in the queue that are no longer active </summary> <param name="queue">The queue to remove from.</param> <param name="queueCleanup">The threshold parameter.</param> <param name="isLocked"><c>True</c> if we are already holding the lock, <c>false</c> otherwise</param> <typeparam name="Tx">The type of list data.</typeparam> private async Task<int> <API key><Tx>(List<Tx> queue, bool isLocked, int queueCleanup) where Tx : IEntry { var res = queueCleanup; using(isLocked ? default(AsyncLock.Releaser) : await m_asynclock.LockAsync()) { if (queue.Count > queueCleanup) { for (var i = queue.Count - 1; i >= 0; i { if (queue[i].Offer != null) if (await queue[i].Offer.OfferAsync(this).ConfigureAwait(false)) await queue[i].Offer.WithdrawAsync(this).ConfigureAwait(false); else { TrySetCancelled(queue[i]); queue.RemoveAt(i); } } // Prevent repeated cleanup requests res = Math.Max(<API key>, queue.Count + <API key>); } } return res; } <summary> Helper method for dequeueing write requests after space has been allocated in the writer queue </summary> <param name="isLocked"><c>True</c> if we are already holding the lock, <c>false</c> otherwise</param> private async Task <API key>(bool isLocked) { using(isLocked ? default(AsyncLock.Releaser) : await m_asynclock.LockAsync()) { // If there is now a buffer slot in the queue, trigger a callback to a waiting item while (m_retireCount < 0 && m_bufferSize > 0 && m_writerQueue.Count >= m_bufferSize) { var nextItem = m_writerQueue[m_bufferSize - 1]; if (nextItem.Offer == null || await nextItem.Offer.OfferAsync(this).ConfigureAwait(false)) { if (nextItem.Offer != null) await nextItem.Offer.CommitAsync(this).ConfigureAwait(false); SetResult(nextItem, true); // Now that the transaction has completed for the writer, record it as waiting forever m_writerQueue[m_bufferSize - 1] = new WriterEntry(nextItem.Value); // We can have at most one, since we process at most one read break; } else m_writerQueue.RemoveAt(m_bufferSize - 1); } } } <summary> Stops this channel from processing messages </summary> public Task RetireAsync() { return RetireAsync(false, false); } <summary> Stops this channel from processing messages </summary> <param name="immediate">Retires the channel without processing the queue, which may cause lost messages</param> public Task RetireAsync(bool immediate) { return RetireAsync(immediate, false); } <summary> Stops this channel from processing messages </summary> <param name="immediate">Retires the channel without processing the queue, which may cause lost messages</param> <param name="isLocked"><c>True</c> if we are already holding the lock, <c>false</c> otherwise</param> private async Task RetireAsync(bool immediate, bool isLocked) { using (isLocked ? default(AsyncLock.Releaser) : await m_asynclock.LockAsync()) { if (m_isRetired) return; if (m_retireCount < 0) { // If we have responded to buffered writes, // make sure we pair those before retiring m_retireCount = Math.Min(m_writerQueue.Count, m_bufferSize) + 1; // For immediate retire, remove buffered writes if (immediate) while (m_retireCount > 1) { if (m_writerQueue[0].Source != null) TrySetException(m_writerQueue[0], new RetiredException(this.Name)); m_writerQueue.RemoveAt(0); m_retireCount } } await <API key>(true).ConfigureAwait(false); } } <summary> Join the channel </summary> <param name="asReader"><c>true</c> if joining as a reader, <c>false</c> otherwise</param> public virtual async Task JoinAsync(bool asReader) { using (await m_asynclock.LockAsync()) { // Do not allow anyone to join after we retire the channel if (m_isRetired) throw new RetiredException(this.Name); if (asReader) m_joinedReaderCount++; else m_joinedWriterCount++; } } <summary> Leave the channel. </summary> <param name="asReader"><c>true</c> if leaving as a reader, <c>false</c> otherwise</param> public virtual async Task LeaveAsync(bool asReader) { using (await m_asynclock.LockAsync()) { // If we are already retired, skip this call if (m_isRetired) return; // Countdown if (asReader) m_joinedReaderCount else m_joinedWriterCount // Retire if required if ((asReader && m_joinedReaderCount <= 0) || (!asReader && m_joinedWriterCount <= 0)) await RetireAsync(false, true).ConfigureAwait(false); } } <summary> Empties the queue if the channel is retired. </summary> <param name="isLocked"><c>True</c> if we are already holding the lock, <c>false</c> otherwise</param> private async Task <API key>(bool isLocked) { List<ReaderEntry> readers = null; List<WriterEntry> writers = null; using (isLocked ? default(AsyncLock.Releaser) : await m_asynclock.LockAsync()) { // Countdown as required if (m_retireCount > 0) { m_retireCount if (m_retireCount == 0) { // Empty the queues, as we are now retired readers = m_readerQueue; writers = m_writerQueue; // Make sure nothing new enters the queues m_isRetired = true; m_readerQueue = null; m_writerQueue = null; } } } // If there are pending retire messages, send them if (readers != null || writers != null) { if (readers != null) foreach (var r in readers) TrySetException(r, new RetiredException(this.Name)); if (writers != null) foreach (var w in writers) TrySetException(w, new RetiredException(this.Name)); } } <summary> Callback method used to signal timeout on expired items </summary> private async Task ExpireItemsAsync() { KeyValuePair<int, ReaderEntry>[] expiredReaders; KeyValuePair<int, WriterEntry>[] expiredWriters; // Extract all expired items from their queues using (await m_asynclock.LockAsync()) { // If the channel is retired, there is nothing to do here if (m_readerQueue == null || m_writerQueue == null) return; var now = DateTime.Now; expiredReaders = m_readerQueue.Zip(Enumerable.Range(0, m_readerQueue.Count), (n, i) => new KeyValuePair<int, ReaderEntry>(i, n)).Where(x => x.Value.Expires.Ticks != 0 && (x.Value.Expires - now).Ticks <= ExpirationManager.<API key>).ToArray(); expiredWriters = m_writerQueue.Zip(Enumerable.Range(0, m_writerQueue.Count), (n, i) => new KeyValuePair<int, WriterEntry>(i, n)).Where(x => x.Value.Expires.Ticks != 0 && (x.Value.Expires - now).Ticks <= ExpirationManager.<API key>).ToArray(); foreach (var r in expiredReaders.OrderByDescending(x => x.Key)) m_readerQueue.RemoveAt(r.Key); foreach (var r in expiredWriters.OrderByDescending(x => x.Key)) m_writerQueue.RemoveAt(r.Key); } // Send the notifications foreach (var r in expiredReaders.OrderBy(x => x.Value.Expires)) TrySetException(r.Value, new TimeoutException()); // Send the notifications foreach (var w in expiredWriters.OrderBy(x => x.Value.Expires)) TrySetException(w.Value, new TimeoutException()); } #region Task continuation support methods <summary> Sets the task to be failed </summary> <param name="entry">The task to set</param> <param name="ex">The exception to set</param> private static void TrySetException(ReaderEntry entry, Exception ex) { #if <API key> ThreadPool.QueueItem(() => entry.Source.TrySetException(ex)); #else if (entry.EnqueueContinuation) ThreadPool.QueueItem(() => entry.Source.TrySetException(ex)); else entry.Source.TrySetException(ex); #endif } <summary> Sets the task to be failed </summary> <param name="entry">The task to set</param> <param name="ex">The exception to set</param> private static void TrySetException(WriterEntry entry, Exception ex) { if (entry.Source != null) { #if <API key> ThreadPool.QueueItem(() => entry.Source.TrySetException(ex)); #else if (entry.EnqueueContinuation) ThreadPool.QueueItem(() => entry.Source.TrySetException(ex)); else entry.Source.TrySetException(ex); #endif } } <summary> Tries to set the source to Cancelled </summary> <param name="entry">The entry to signal</param> private static void TrySetCancelled(IEntry entry) { if (entry is ReaderEntry re) TrySetCancelled(re); else if (entry is WriterEntry we) TrySetCancelled(we); else throw new <API key>("No such type"); } <summary> Tries to set the source to Cancelled </summary> <param name="entry">The entry to signal</param> private static void TrySetCancelled(ReaderEntry entry) { #if <API key> ThreadPool.QueueItem(() => entry.Source.TrySetCanceled()); #else if (entry.EnqueueContinuation) ThreadPool.QueueItem(() => entry.Source.TrySetCanceled()); else entry.Source.TrySetCanceled(); #endif } <summary> Tries to set the source to Cancelled </summary> <param name="entry">The entry to signal</param> private static void TrySetCancelled(WriterEntry entry) { if (entry.Source != null) { #if <API key> ThreadPool.QueueItem(() => entry.Source.TrySetCanceled()); #else if (entry.EnqueueContinuation) ThreadPool.QueueItem(() => entry.Source.TrySetCanceled()); else entry.Source.TrySetCanceled(); #endif } } <summary> Tries to set the source result </summary> <param name="entry">The entry to signal</param> <param name="value">The value to signal</param> private static void TrySetResult(WriterEntry entry, bool value) { if (entry.Source != null) { #if <API key> ThreadPool.QueueItem(() => entry.Source.TrySetResult(value)); #else if (entry.EnqueueContinuation) ThreadPool.QueueItem(() => entry.Source.TrySetResult(value)); else entry.Source.TrySetResult(value); #endif } } <summary> Sets the source result </summary> <param name="entry">The entry to signal</param> <param name="value">The value to signal</param> private static void SetResult(WriterEntry entry, bool value) { if (entry.Source != null) { #if <API key> ThreadPool.QueueItem(() => entry.Source.SetResult(value)); #else if (entry.EnqueueContinuation) ThreadPool.QueueItem(() => entry.Source.SetResult(value)); else entry.Source.SetResult(value); #endif } } <summary> Sets the source result </summary> <param name="entry">The entry to signal</param> <param name="value">The value to signal</param> private static void SetResult(ReaderEntry entry, T value) { #if <API key> ThreadPool.QueueItem(() => entry.Source.SetResult(value)); #else if (entry.EnqueueContinuation) ThreadPool.QueueItem(() => entry.Source.SetResult(value)); else entry.Source.SetResult(value); #endif } #endregion } }
<?php class CsvTest extends \<API key> { use ExcelFileTestCase; protected $class = '\Maatwebsite\Clerk\Files\Csv'; protected $ext = 'csv'; }
// Dapplo - building blocks for .NET applications // This file is part of Dapplo.Jira // Dapplo.Jira is free software: you can redistribute it and/or modify // (at your option) any later version. // Dapplo.Jira is distributed in the hope that it will be useful, // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #endregion namespace Dapplo.Jira.Domains { <summary> The marker interface of the user domain </summary> public interface IUserDomain : IJiraDomain { } }
package tk.teemocode.module.base.vo; import java.io.Serializable; public class Vo implements Serializable, Cloneable { private Long id; private String uuid; private Integer tag; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getUuid() { return uuid; } public void setUuid(String uuid) { this.uuid = uuid; } public Integer getTag() { return tag; } public void setTag(Integer tag) { this.tag = tag; } }
<!DOCTYPE HTML PUBLIC "- <!--NewPage <HTML> <HEAD> <!-- Generated by javadoc (build 1.5.0_14) on Tue Aug 12 15:38:40 EDT 2008 --> <TITLE> BlockingInfo (NITRO 2.0-RC1 API) </TITLE> <META NAME="keywords" CONTENT="nitf.BlockingInfo class"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { parent.document.title="BlockingInfo (NITRO 2.0-RC1 API)"; } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <A NAME="navbar_top"></A> <A HREF="BlockingInfo.html#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/BlockingInfo.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="BandSource.html" title="class in nitf"><B>PREV CLASS</B></A>&nbsp; &nbsp;<A HREF="CloneableObject.html" title="class in nitf"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../index.html?nitf%252FBlockingInfo.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="BlockingInfo.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <! if(window==top) { document.writeln('<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>'); } </SCRIPT> <NOSCRIPT> <A HREF="../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="BlockingInfo.html#<API key>.NITFObject">FIELD</A>&nbsp;|&nbsp;<A HREF="BlockingInfo.html#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="BlockingInfo.html#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="BlockingInfo.html#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="BlockingInfo.html#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <HR> <H2> <FONT SIZE="-1"> nitf</FONT> <BR> Class BlockingInfo</H2> <PRE> java.lang.Object <IMG SRC="../resources/inherit.gif" ALT="extended by "><A HREF="NITFObject.html" title="class in nitf">nitf.NITFObject</A> <IMG SRC="../resources/inherit.gif" ALT="extended by "><A HREF="DestructibleObject.html" title="class in nitf">nitf.DestructibleObject</A> <IMG SRC="../resources/inherit.gif" ALT="extended by "><B>nitf.BlockingInfo</B> </PRE> <HR> <DL> <DT><PRE>public final class <B>BlockingInfo</B><DT>extends <A HREF="DestructibleObject.html" title="class in nitf">DestructibleObject</A></DL> </PRE> <P> A representation of the blocking information used in the library. <P> <P> <HR> <P> <A NAME="field_summary"></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Field Summary</B></FONT></TH> </TR> </TABLE> &nbsp;<A NAME="<API key>.NITFObject"></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="<API key>"> <TH ALIGN="left"><B>Fields inherited from class nitf.<A HREF="NITFObject.html" title="class in nitf">NITFObject</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="NITFObject.html#address">address</A>, <A HREF="NITFObject.html#INVALID_ADDRESS">INVALID_ADDRESS</A>, <A HREF="NITFObject.html#NITF_LIBRARY_NAME">NITF_LIBRARY_NAME</A></CODE></TD> </TR> </TABLE> &nbsp; <A NAME="constructor_summary"></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Constructor Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="BlockingInfo.html#BlockingInfo()">BlockingInfo</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <A NAME="method_summary"></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected &nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="BlockingInfo.html#destructMemory()">destructMemory</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Destruct the underlying memory</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;int</CODE></FONT></TD> <TD><CODE><B><A HREF="BlockingInfo.html#getLength()">getLength</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the length</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;int</CODE></FONT></TD> <TD><CODE><B><A HREF="BlockingInfo.html#getNumBlocksPerCol()">getNumBlocksPerCol</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the number of blocks per column</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;int</CODE></FONT></TD> <TD><CODE><B><A HREF="BlockingInfo.html#getNumBlocksPerRow()">getNumBlocksPerRow</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the number of blocks per row</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;int</CODE></FONT></TD> <TD><CODE><B><A HREF="BlockingInfo.html#getNumColsPerBlock()">getNumColsPerBlock</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the number of columns per block</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;int</CODE></FONT></TD> <TD><CODE><B><A HREF="BlockingInfo.html#getNumRowsPerBlock()">getNumRowsPerBlock</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the number of rows per block</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="BlockingInfo.html#print(java.io.PrintStream)">print</A></B>(java.io.PrintStream&nbsp;out)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Prints the data pertaining to this object to an OutputStream</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="BlockingInfo.html#setLength(int)">setLength</A></B>(int&nbsp;length)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the length</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="BlockingInfo.html#setNumBlocksPerCol(int)">setNumBlocksPerCol</A></B>(int&nbsp;numBlocksPerCol)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the number of blocks per column</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="BlockingInfo.html#setNumBlocksPerRow(int)">setNumBlocksPerRow</A></B>(int&nbsp;numBlocksPerRow)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the number of blocks per row</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="BlockingInfo.html#setNumColsPerBlock(int)">setNumColsPerBlock</A></B>(int&nbsp;numColsPerBlock)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the number of columns per block</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="BlockingInfo.html#setNumRowsPerBlock(int)">setNumRowsPerBlock</A></B>(int&nbsp;numRowsPerBlock)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the number of rows per block</TD> </TR> </TABLE> &nbsp;<A NAME="<API key>.DestructibleObject"></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="<API key>"> <TH ALIGN="left"><B>Methods inherited from class nitf.<A HREF="DestructibleObject.html" title="class in nitf">DestructibleObject</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="DestructibleObject.html#destruct()">destruct</A>, <A HREF="DestructibleObject.html#finalize()">finalize</A>, <A HREF="DestructibleObject.html#getInfo()">getInfo</A>, <A HREF="DestructibleObject.html#isManaged()">isManaged</A>, <A HREF="DestructibleObject.html#setManaged(boolean)">setManaged</A>, <A HREF="DestructibleObject.html#toString()">toString</A></CODE></TD> </TR> </TABLE> &nbsp;<A NAME="<API key>.NITFObject"></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="<API key>"> <TH ALIGN="left"><B>Methods inherited from class nitf.<A HREF="NITFObject.html" title="class in nitf">NITFObject</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="NITFObject.html#equals(java.lang.Object)">equals</A>, <A HREF="NITFObject.html#isValid()">isValid</A></CODE></TD> </TR> </TABLE> &nbsp;<A NAME="<API key>.lang.Object"></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="<API key>"> <TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE>clone, getClass, hashCode, notify, notifyAll, wait, wait, wait</CODE></TD> </TR> </TABLE> &nbsp; <P> <A NAME="constructor_detail"></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Constructor Detail</B></FONT></TH> </TR> </TABLE> <A NAME="BlockingInfo()"></A><H3> BlockingInfo</H3> <PRE> public <B>BlockingInfo</B>() throws <A HREF="NITFException.html" title="class in nitf">NITFException</A></PRE> <DL> <DL> <DT><B>Throws:</B> <DD><CODE><A HREF="NITFException.html" title="class in nitf">NITFException</A></CODE></DL> </DL> <A NAME="method_detail"></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </TR> </TABLE> <A NAME="destructMemory()"></A><H3> destructMemory</H3> <PRE> protected void <B>destructMemory</B>()</PRE> <DL> <DD>Destruct the underlying memory <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="DestructibleObject.html#destructMemory()">destructMemory</A></CODE> in class <CODE><A HREF="DestructibleObject.html" title="class in nitf">DestructibleObject</A></CODE></DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="getNumBlocksPerRow()"></A><H3> getNumBlocksPerRow</H3> <PRE> public int <B>getNumBlocksPerRow</B>()</PRE> <DL> <DD>Returns the number of blocks per row <P> <DD><DL> <DT><B>Returns:</B><DD></DL> </DD> </DL> <HR> <A NAME="setNumBlocksPerRow(int)"></A><H3> setNumBlocksPerRow</H3> <PRE> public void <B>setNumBlocksPerRow</B>(int&nbsp;numBlocksPerRow)</PRE> <DL> <DD>Sets the number of blocks per row <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>numBlocksPerRow</CODE> - </DL> </DD> </DL> <HR> <A NAME="getNumBlocksPerCol()"></A><H3> getNumBlocksPerCol</H3> <PRE> public int <B>getNumBlocksPerCol</B>()</PRE> <DL> <DD>Returns the number of blocks per column <P> <DD><DL> <DT><B>Returns:</B><DD></DL> </DD> </DL> <HR> <A NAME="setNumBlocksPerCol(int)"></A><H3> setNumBlocksPerCol</H3> <PRE> public void <B>setNumBlocksPerCol</B>(int&nbsp;numBlocksPerCol)</PRE> <DL> <DD>Sets the number of blocks per column <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>numBlocksPerCol</CODE> - </DL> </DD> </DL> <HR> <A NAME="getNumRowsPerBlock()"></A><H3> getNumRowsPerBlock</H3> <PRE> public int <B>getNumRowsPerBlock</B>()</PRE> <DL> <DD>Returns the number of rows per block <P> <DD><DL> <DT><B>Returns:</B><DD></DL> </DD> </DL> <HR> <A NAME="setNumRowsPerBlock(int)"></A><H3> setNumRowsPerBlock</H3> <PRE> public void <B>setNumRowsPerBlock</B>(int&nbsp;numRowsPerBlock)</PRE> <DL> <DD>Sets the number of rows per block <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>numRowsPerBlock</CODE> - </DL> </DD> </DL> <HR> <A NAME="getNumColsPerBlock()"></A><H3> getNumColsPerBlock</H3> <PRE> public int <B>getNumColsPerBlock</B>()</PRE> <DL> <DD>Returns the number of columns per block <P> <DD><DL> <DT><B>Returns:</B><DD></DL> </DD> </DL> <HR> <A NAME="setNumColsPerBlock(int)"></A><H3> setNumColsPerBlock</H3> <PRE> public void <B>setNumColsPerBlock</B>(int&nbsp;numColsPerBlock)</PRE> <DL> <DD>Sets the number of columns per block <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>numColsPerBlock</CODE> - </DL> </DD> </DL> <HR> <A NAME="getLength()"></A><H3> getLength</H3> <PRE> public int <B>getLength</B>()</PRE> <DL> <DD>Returns the length <P> <DD><DL> <DT><B>Returns:</B><DD></DL> </DD> </DL> <HR> <A NAME="setLength(int)"></A><H3> setLength</H3> <PRE> public void <B>setLength</B>(int&nbsp;length)</PRE> <DL> <DD>Sets the length <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>length</CODE> - </DL> </DD> </DL> <HR> <A NAME="print(java.io.PrintStream)"></A><H3> print</H3> <PRE> public void <B>print</B>(java.io.PrintStream&nbsp;out) throws java.io.IOException</PRE> <DL> <DD>Prints the data pertaining to this object to an OutputStream <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>out</CODE> - <DT><B>Throws:</B> <DD><CODE>java.io.IOException</CODE></DL> </DD> </DL> <HR> <A NAME="navbar_bottom"></A> <A HREF="BlockingInfo.html#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="<API key>"></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/BlockingInfo.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <b>Created: 08/12/2008 03:38:34 PM</b></EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="BandSource.html" title="class in nitf"><B>PREV CLASS</B></A>&nbsp; &nbsp;<A HREF="CloneableObject.html" title="class in nitf"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../index.html?nitf%252FBlockingInfo.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="BlockingInfo.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <! if(window==top) { document.writeln('<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>'); } </SCRIPT> <NOSCRIPT> <A HREF="../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="BlockingInfo.html#<API key>.NITFObject">FIELD</A>&nbsp;|&nbsp;<A HREF="BlockingInfo.html#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="BlockingInfo.html#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="BlockingInfo.html#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="BlockingInfo.html#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <HR> <i>Copyright & <div style="float:left;"><a href="http: <script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https: document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript"> var pageTracker = _gat._getTracker("UA-3779761-1"); pageTracker._initData(); pageTracker._trackPageview(); </script> </BODY> </HTML>
package edu.cmu.cs.lti.ark.util.ds.map; import gnu.trove.TObjectIntHashMap; import gnu.trove.TObjectIntIterator; import gnu.trove.TObjectIntProcedure; import java.util.Collection; import java.util.HashSet; import java.util.Map; import java.util.Set; /** * Simple integer counter: stores integer values for keys; lookup on nonexistent keys returns 0. * Stores the sum of all values and provides methods for normalizing them. * * A {@code null} key is allowed, although the Iterator returned by {@link #getIterator()} * will not include an entry whose key is {@code null}. * * @author Nathan Schneider (nschneid) * @since 2009-03-19 * @param <T> Type for keys */ public class IntCounter<T> extends AbstractCounter<T, Integer> implements java.io.Serializable { private static final long serialVersionUID = -<API key>; protected TObjectIntHashMap<T> m_map; protected int m_sum = 0; public final int DEFAULT_VALUE = 0; public IntCounter() { m_map = new TObjectIntHashMap<T>(); } public IntCounter(TObjectIntHashMap<T> map) { m_map = map; int vals[] = map.getValues(); for (int val : vals) { m_sum += val; } } /** * @param key * @return The value stored for a particular key (if present), or 0 otherwise */ public int getT(T key) { if (m_map.containsKey(key)) return m_map.get(key); return DEFAULT_VALUE; } /** Calls {@link #getT(T)}; required for compliance with {@link Map} */ @SuppressWarnings("unchecked") public Integer get(Object key) { return getT((T)key); } /** * @param key * @param newValue * @return Previous value for the key */ public int set(T key, int newValue) { int preval = getT(key); m_map.put(key, newValue); m_sum += newValue - preval; return preval; } /** * Increments a value in the counter by 1. * @param key * @return The new value */ public int increment(T key) { return incrementBy(key, 1); } /** * Changes a value in the counter by adding the specified delta to its current value. * @param key * @param delta * @return The new value */ public int incrementBy(T key, int delta) { int curval = getT(key); int newValue = curval+delta; set(key, newValue); return newValue; } /** * Returns a new counter containing only keys with nonzero values in * at least one of the provided counters. Each key's value is the * number of counters in which it occurs. */ public static <T> IntCounter<T> or(Collection<IntCounter<? extends T>> counters) { IntCounter<T> result = new IntCounter<T>(); for (IntCounter<? extends T> counter : counters) { for (TObjectIntIterator<? extends T> iter = counter.getIterator(); iter.hasNext();) { iter.advance(); if (iter.value()!=0) result.increment(iter.key()); } } return result; } /** * @return Sum of all values currently in the Counter */ public int getSum() { return m_sum; } public IntCounter<T> add(final int val) { final IntCounter<T> result = new IntCounter<T>(); m_map.forEachEntry(new TObjectIntProcedure<T>() { private boolean first = true; public boolean execute(T key, int value) { if ( first ) first = false; int newValue = value + val; result.set(key, newValue); return true; } }); return result; } /** * @return Iterator for the counter. Ignores the {@code null} key (if present). */ public TObjectIntIterator<T> getIterator() { return m_map.iterator(); } @SuppressWarnings("unchecked") public Set<T> keySet() { Object[] okeys = m_map.keys(); HashSet<T> keyset = new HashSet<T>(); for(Object o:okeys) { keyset.add((T)o); } return keyset; } /** * @param valueThreshold * @return New IntCounter containing only entries whose value equals or exceeds the given threshold */ public IntCounter<T> filter(int valueThreshold) { IntCounter<T> result = new IntCounter<T>(); for (TObjectIntIterator<T> iter = getIterator(); iter.hasNext();) { iter.advance(); T key = iter.key(); int value = getT(key); if (value >= valueThreshold) { result.set(key, value); } } int nullValue = getT(null); if (containsKey(null) && nullValue >= valueThreshold) result.set(null, nullValue); return result; } /** Calls {@link #containsKeyT(T)}; required for compliance with {@link Map} */ @SuppressWarnings("unchecked") public boolean containsKey(Object key) { return containsKeyT((T)key); } public boolean containsKeyT(T key) { return m_map.containsKey(key); } public int size() { return m_map.size(); } public String toString() { return toString(Integer.MIN_VALUE, null); } public String toString(int valueThreshold) { return toString(valueThreshold, null); } /** * @param sep Array with two Strings: an entry separator ("," by default, if this is {@code null}), and a key-value separator ("=" by default) */ public String toString(String[] sep) { return toString(Integer.MIN_VALUE, sep); } /** * @param valueThreshold * @param sep Array with two Strings: an entry separator ("," by default, if this is {@code null}), and a key-value separator ("=" by default) * @return A string representation of all (key, value) pairs such that the value equals or exceeds the given threshold */ public String toString(final int valueThreshold, String[] sep) { String entrySep = ","; // default String kvSep = "="; // default if (sep!=null && sep.length>0) { if (sep[0]!=null) entrySep = sep[0]; if (sep.length>1 && sep[1]!=null) kvSep = sep[1]; } final String ENTRYSEP = entrySep; final String KVSEP = kvSep; final StringBuilder buf = new StringBuilder("{"); m_map.forEachEntry(new TObjectIntProcedure<T>() { private boolean first = true; public boolean execute(T key, int value) { if (value >= valueThreshold) { if ( first ) first = false; else buf.append(ENTRYSEP); buf.append(key); buf.append(KVSEP); buf.append(value); } return true; } }); buf.append("}"); return buf.toString(); } public IntCounter<T> clone() { return new IntCounter<T>(m_map.clone()); } // Other methods implemented by the Map interface @Override public void clear() { throw new <API key>("IntCounter.clear() unsupported"); } @Override public boolean containsValue(Object value) { return m_map.containsValue((Integer)value); } @Override public Set<java.util.Map.Entry<T, Integer>> entrySet() { throw new <API key>("IntCounter.entrySet() unsupported"); } @Override public boolean isEmpty() { return m_map.isEmpty(); } @Override public Integer put(T key, Integer value) { return set(key,value); } @Override public void putAll(Map<? extends T, ? extends Integer> m) { throw new <API key>("IntCounter.putAll() unsupported"); } @Override public Integer remove(Object key) { throw new <API key>("IntCounter.remove() unsupported"); } @Override public Collection<Integer> values() { throw new <API key>("IntCounter.values() unsupported"); } }
/* FramepaC -- frame manipulation in C++ */ /* Version 2.01 */ /* by Ralf Brown <ralf@cs.cmu.edu> */ /* File frsymbol.h class FrSymbol */ /* LastEdit: 08nov2015 */ /* Ralf Brown/Carnegie Mellon University */ /* This program is free software; you can redistribute it and/or */ /* modify it under the terms of the GNU Lesser General Public */ /* version 3. */ /* This program is distributed in the hope that it will be */ /* details. */ /* You should have received a copy of the GNU Lesser General */ /* GPL.txt) along with this program. If not, see */ #ifndef <API key> #define <API key> #ifndef __FRLIST_H_INCLUDED #include "frlist.h" #endif #include <string.h> #if defined(__GNUC__) # pragma interface #endif /* Optional Demon support */ typedef bool FrDemonFunc(const FrSymbol *frame, const FrSymbol *slot, const FrSymbol *facet, const FrObject *value, va_list args) ; enum FrDemonType { DT_IfCreated, DT_IfAdded, DT_IfRetrieved, DT_IfMissing, DT_IfDeleted } ; struct FrDemonList ; struct FrDemons { FrDemonList *if_created ; // demons to call just after creating facet FrDemonList *if_added ; // demons to call just before adding filler FrDemonList *if_missing ; // demons to call before attempting inheritance FrDemonList *if_retrieved ; // demons to call just before returning filler FrDemonList *if_deleted ; // demons to call just after deleting filler void *operator new(size_t size) { return FrMalloc(size) ; } void operator delete(void *obj) { FrFree(obj) ; } } ; #ifdef FrSYMBOL_RELATION # define <API key>(x) x #else # define <API key>(x) #endif #ifdef FrSYMBOL_VALUE # define if_FrSYMBOL_VALUE(x) x #else # define if_FrSYMBOL_VALUE(x) #endif #ifdef FrDEMONS # define if_FrDEMONS(x) x #else # define if_FrDEMONS(x) #endif FrSymbol *findSymbol(const char *name) ; class FrSymbol : public FrAtom { private: FrFrame *m_frame ; // in lieu of a full property list, <API key>(FrSymbol *m_inv_relation) ;// we have these 2 ptrs if_FrSYMBOL_VALUE(FrObject *m_value) ; if_FrDEMONS(FrDemons *theDemons) ; char m_name[1] ; //__attribute__((bnd_variable_size)) ; private: // methods void setInvRelation(FrSymbol *inv) { (void)inv ; <API key>(m_inv_relation = inv) ; } void setDemons(FrDemons *d) { (void)d ; if_FrDEMONS(theDemons = d) ; } void *operator new(size_t size,void *where) { (void)size; return where ; } FrSymbol(const char *symname,int len) // private use for FramepaC only // { memcpy(m_name,(char *)symname,len) ; if_FrSYMBOL_VALUE(m_value = &UNBOUND) ; setFrame(0) ; setInvRelation(0) ; setDemons(0) ; } public: FrSymbol() _fnattr_noreturn ; virtual ~FrSymbol() _fnattr_noreturn ; void *operator new(size_t size) { return FrMalloc(size) ; } void operator delete(void *sym, size_t) { FrFree(sym) ; } virtual FrObjectType objType() const ; virtual const char *objTypeName() const ; virtual FrObjectType objSuperclass() const ; virtual ostream &printValue(ostream &output) const ; virtual char *displayValue(char *buffer) const ; virtual size_t displayLength() const ; virtual void freeObject() {} // can never free a FrSymbol virtual long int intValue() const ; virtual const char *printableName() const ; virtual FrSymbol *coerce2symbol(FrCharEncoding) const { return (FrSymbol*)this ; } virtual bool symbolp() const ; virtual size_t length() const ; virtual int compare(const FrObject *obj) const ; FrSymbol *makeSymbol(const char *nam) const ; FrSymbol *findSymbol(const char *nam) const ; const char *symbolName() const { return m_name ; } static bool nameNeedsQuoting(const char *name) ; FrFrame *symbolFrame() const { return m_frame ; } ostream &printBinding(ostream &output) const ; #ifdef FrSYMBOL_VALUE void setValue(const FrObject *newval) { m_value = (FrObject *)newval; } FrObject *symbolValue() const { return m_value ; } #else void setValue(const FrObject *newval) ; FrObject *symbolValue() const ; #endif /* FrSYMBOL_VALUE */ #ifdef FrDEMONS FrDemons *demons() const { return theDemons ; } bool addDemon(FrDemonType type,FrDemonFunc *func, va_list args = 0) ; bool removeDemon(FrDemonType type, FrDemonFunc *func) ; #else FrDemons *demons() const { return 0 ; } bool addDemon(FrDemonType,FrDemonFunc,va_list=0) { return false ; } bool removeDemon(FrDemonType,FrDemonFunc) { return false ; } #endif /* FrDEMONS */ void setFrame(const FrFrame *fr) { m_frame = (FrFrame *)fr ; } void defineRelation(const FrSymbol *inverse) ; void undefineRelation() ; #ifdef FrSYMBOL_RELATION FrSymbol *inverseRelation() const { return m_inv_relation ; } #else FrSymbol *inverseRelation() const { return 0 ; } #endif /* FrSYMBOL_RELATION */ //functions to support VFrames FrFrame *createFrame() ; FrFrame *createVFrame() ; FrFrame *createInstanceFrame() ; bool isFrame() ; bool isDeletedFrame() ; FrFrame *findFrame() ; int startTransaction() ; int endTransaction(int transaction) ; int abortTransaction(int transaction) ; FrFrame *lockFrame() ; static bool lockFrames(FrList *locklist) ; bool unlockFrame() ; static bool unlockFrames(FrList *locklist) ; bool isLocked() const ; bool emptyFrame() ; bool dirtyFrame() ; int commitFrame() ; int discardFrame() ; int deleteFrame() ; FrFrame *oldFrame(int generation) ; FrFrame *copyFrame(FrSymbol *newframe, bool temporary = false) ; bool renameFrame(FrSymbol *newname) ; FrSlot *createSlot(const FrSymbol *slotname) ; void createFacet(const FrSymbol *slotname, const FrSymbol *facetname) ; void addFiller(const FrSymbol *slotname,const FrSymbol *facet, const FrObject *filler) ; void addValue(const FrSymbol *slotname, const FrObject *filler) ; void addSem(const FrSymbol *slotname, const FrObject *filler) ; void addFillers(const FrSymbol *slotname,const FrSymbol *facet, const FrList *fillers); void addValues(const FrSymbol *slotname, const FrList *fillers) ; void addSems(const FrSymbol *slotname, const FrList *fillers) ; void pushFiller(const FrSymbol *slotname,const FrSymbol *facet, const FrObject *filler) ; FrObject *popFiller(const FrSymbol *slotname, const FrSymbol *facet) ; void replaceFiller(const FrSymbol *slotname, const FrSymbol *facetname, const FrObject *old, const FrObject *newfiller) ; void replaceFiller(const FrSymbol *slotname, const FrSymbol *facetname, const FrObject *old, const FrObject *newfiller, FrCompareFunc cmp) ; void replaceFacet(const FrSymbol *slotname, const FrSymbol *facet, const FrList *newfillers) ; void eraseFrame() ; void eraseCopyFrame() ; void eraseSlot(const char *slotname) ; void eraseSlot(const FrSymbol *slotname) ; void eraseFacet(const FrSymbol *slotname,const FrSymbol *facetname) ; void eraseFiller(const FrSymbol *slotname,const FrSymbol *facetname, const FrObject *filler) ; void eraseFiller(const FrSymbol *slotname,const FrSymbol *facetname, const FrObject *filler,FrCompareFunc cmp) ; void eraseSem(const FrSymbol *slotname, const FrObject *filler) ; void eraseSem(const FrSymbol *slotname, const FrObject *filler, FrCompareFunc cmp) ; void eraseValue(const FrSymbol *slotname, const FrObject *filler) ; void eraseValue(const FrSymbol *slotname, const FrObject *filler, FrCompareFunc cmp) ; // const FrList *getImmedFillers(const FrSymbol *slotname, // const FrSymbol *facet) const ; const FrList *getFillers(const FrSymbol *slotname, const FrSymbol *facet, bool inherit = true) ; FrObject *firstFiller(const FrSymbol *slotname,const FrSymbol *facet, bool inherit = true) ; const FrList *getValues(const FrSymbol *slotname,bool inherit = true) ; FrObject *getValue(const FrSymbol *slotname,bool inherit=true) ; const FrList *getSem(const FrSymbol *slotname,bool inherit = true) ; bool isA_p(FrSymbol *poss_parent) ; bool partOf_p(FrSymbol *poss_container) ; FrList *collectSlots(FrInheritanceType inherit,FrList *allslots=0, bool include_names = false) ; void inheritAll() ; void inheritAll(FrInheritanceType inherit) ; FrList *allSlots() const ; FrList *slotFacets(const FrSymbol *slotname) const ; bool doSlots(bool (*func)(const FrFrame *frame, const FrSymbol *slot, va_list args), va_list args) ; bool doFacets(const FrSymbol *slotname, bool (*func)(const FrFrame *frame, const FrSymbol *slot, const FrSymbol *facet, va_list args), va_list args) ; bool doAllFacets(bool (*func)(const FrFrame *frame, const FrSymbol *slot, const FrSymbol *facet, va_list args), va_list args) ; //overloaded operators int operator == (const char *symname) const { return (FrSymbol *)this == findSymbol(symname) ; } int operator != (const char *symname) const { return (FrSymbol *)this != findSymbol(symname) ; } operator char* () const { return (char*)symbolName() ; } //friends friend class FrSymbolTable ; } ; // non-member functions related to class FrSymbol FrSymbol *read_Symbol(istream &input) ; FrSymbol *string_to_Symbol(const char *&input) ; bool verify_Symbol(const char *&input, bool strict = false) ; FrSymbol *makeSymbol(const FrSymbol *sym) ; // copy from another symbol table FrSymbol *gensym(const char *basename = 0, const char *suffix = 0) ; FrSymbol *gensym(const FrSymbol *basename) ; void define_relation(const char *relname,const char *invname) ; void undefine_relation(const char *relname) ; /* Optional Demon support */ #ifdef FrDEMONS inline bool add_demon(FrSymbol *sym, FrDemonType type, FrDemonFunc *func,va_list args) { return (sym) ? sym->addDemon(type,func,args) : false ; } inline bool remove_demon(FrSymbol *sym, FrDemonType type, FrDemonFunc *func) { return (sym) ? sym->removeDemon(type,func) : false ; } #endif /* FrDEMONS */ /* overloaded operators (non-member functions) */ inline istream &operator >> (istream &input,FrSymbol *&obj) { FramepaC_bgproc() ; obj = read_Symbol(input) ; return input ; } #endif /* !<API key> */ // end of file frsymbol.h //
<?php /** * Custom factory for photos with method to get next sort order * * @package Modules * @subpackage PhotoGallery * @author Peter Epp * @version $Id: photo_factory.php 13843 2011-07-27 19:45:49Z teknocat $ */ class PhotoFactory extends ModelFactory { /** * Find and return the next sort order to use * * @return void * @author Peter Epp */ public function next_sort_order($album_id) { return parent::next_highest('sort_order',1,"`album_id` = {$album_id}"); } }
/*! \file * \brief This is an automatically included header file. * * This file should mostly contain imports of things defined somewhere else. * Usual piece of code put in this file is supposed to looks like * * \code #include "path/to/some/header/file.hpp" namespace sfd { using some::symbol; using some::other_symbol; } * \endcode * * \author Martin Kampas <martin.kampas@tieto.com>, 01/2010 */ #pragma once // IMPORTS #include "tools/PIMPL.hpp" namespace sfd { using tools::p_ptr; } // OTHER STUFF //! Redefinition to make use of GCC's __PRETTY_FUNCTION__ #define __func__ __PRETTY_FUNCTION__ //! Use it to mark deprecated symbols #define SFD_DEPRECATED __attribute__((deprecated)) #include <QtCore/QDebug>
#ifndef <API key> #define <API key> #include "smsresponse_p.h" namespace QtAws { namespace SMS { class <API key>; class <API key> : public SmsResponsePrivate { public: explicit <API key>(<API key> * const q); void <API key>(QXmlStreamReader &xml); private: Q_DECLARE_PUBLIC(<API key>) Q_DISABLE_COPY(<API key>) }; } // namespace SMS } // namespace QtAws #endif
package com.nextgis.maplib.util; import android.accounts.Account; import android.annotation.TargetApi; import android.content.ContentResolver; import android.content.Context; import android.content.SyncInfo; import android.os.Build; import android.util.Base64; import com.nextgis.maplib.api.IGISApplication; import org.json.JSONException; import org.json.JSONObject; import java.io.File; import java.io.IOException; import java.security.KeyFactory; import java.security.PublicKey; import java.security.Signature; import java.security.spec.X509EncodedKeySpec; import static com.nextgis.maplib.util.Constants.JSON_END_DATE_KEY; import static com.nextgis.maplib.util.Constants.JSON_SIGNATURE_KEY; import static com.nextgis.maplib.util.Constants.JSON_START_DATE_KEY; import static com.nextgis.maplib.util.Constants.JSON_SUPPORTED_KEY; import static com.nextgis.maplib.util.Constants.JSON_USER_ID_KEY; import static com.nextgis.maplib.util.Constants.SUPPORT; public class AccountUtil { public static boolean isProUser(Context context) { File support = context.getExternalFilesDir(null); if (support == null) support = new File(context.getFilesDir(), SUPPORT); else support = new File(support, SUPPORT); try { String jsonString = FileUtil.readFromFile(support); JSONObject json = new JSONObject(jsonString); if (json.optBoolean(JSON_SUPPORTED_KEY)) { final String id = json.getString(JSON_USER_ID_KEY); final String start = json.getString(JSON_START_DATE_KEY); final String end = json.getString(JSON_END_DATE_KEY); final String data = id + start + end + "true"; final String signature = json.getString(JSON_SIGNATURE_KEY); return verifySignature(data, signature); } } catch (JSONException | IOException ignored) { } return false; } private static boolean verifySignature(String data, String signature) { try { // add public key KeyFactory keyFactory = KeyFactory.getInstance("RSA"); String key = "<API key>\n" + "jebXVOn4oV++8z5VsBkQwK+svDkGK/<API key>\n" + "<API key>/<API key>\n" + "XfErPKGio7+<API key>\n" + "ln/VfX43r/<API key>/yWkIsvidMNL/FekQVTiRCl/exPgioDGrf\n" + "06z5a0sd3NDbS++<API key>\n" + "HwIDAQAB"; byte[] keyBytes = Base64.decode(key.getBytes("UTF-8"), Base64.DEFAULT); X509EncodedKeySpec spec = new X509EncodedKeySpec(keyBytes); PublicKey publicKey = keyFactory.generatePublic(spec); // verify signature Signature signCheck = Signature.getInstance("SHA256withRSA"); signCheck.initVerify(publicKey); signCheck.update(data.getBytes("UTF-8")); byte[] sigBytes = Base64.decode(signature, Base64.DEFAULT); return signCheck.verify(sigBytes); } catch (Exception e) { return false; } } public static boolean isSyncActive(Account account, String authority) { return <API key>(account, authority); } public static boolean <API key>(Account account, String authority) { for (SyncInfo syncInfo : ContentResolver.getCurrentSyncs()) { if (syncInfo.account.equals(account) && syncInfo.authority.equals(authority)) { return true; } } return false; } public static AccountData getAccountData(Context context, String accountName) throws <API key> { IGISApplication app = (IGISApplication) context.<API key>(); Account account = app.getAccount(accountName); if (null == account) { throw new <API key>("Account is null"); } AccountData accountData = new AccountData(); accountData.url = app.getAccountUrl(account); accountData.login = app.getAccountLogin(account); accountData.password = app.getAccountPassword(account); return accountData; } public static class AccountData { public String url; public String login; public String password; } }
package edu.ucsd.arcum.interpreter.ast; import java.util.List; import java.util.Set; import org.eclipse.core.runtime.CoreException; import com.google.common.collect.Lists; import com.google.common.collect.Sets; import edu.ucsd.arcum.exceptions.ArcumError; import edu.ucsd.arcum.exceptions.SourceLocation; import edu.ucsd.arcum.interpreter.ast.expressions.<API key>; import edu.ucsd.arcum.interpreter.query.EntityDataBase; import edu.ucsd.arcum.interpreter.query.OptionMatchTable; import edu.ucsd.arcum.util.StringUtil; public class MapTraitArgument extends MapNameValueBinding { private RequireMap map; private <API key> patternExpr; private List<FormalParameter> formals; // TODO: paramNames should be allowed to have the types explicit, just like // any other realize statement public MapTraitArgument(SourceLocation location, RequireMap map, String traitName, List<FormalParameter> formals, <API key> patternExpr) { super(location, traitName); this.map = map; this.patternExpr = patternExpr; this.formals = formals; } public void initializeValue(EntityDataBase edb, Option option, OptionMatchTable table) throws CoreException { <API key> pseudoStmt; OptionInterface optionIntf = option.getOptionInterface(); List<FormalParameter> allParams = optionIntf.<API key>(); List<FormalParameter> formals = null; for (FormalParameter param : allParams) { if (param.getIdentifier().equals(getName())) { formals = param.getTraitArguments(); break; } } if (formals == null) { ArcumError.fatalUserError(getLocation(), "Couldn't find %s", getName()); } pseudoStmt = <API key>.makeNested(map, getName(), patternExpr, formals, this.getLocation()); pseudoStmt.<API key>(optionIntf); List<<API key>> stmts = Lists.newArrayList(pseudoStmt); try { EntityDataBase.pushCurrentDataBase(edb); <API key>.<API key>(stmts, edb, table); } finally { EntityDataBase.<API key>(); } } @Override public Object getValue() { return this; } @Override public String toString() { return String.format("%s(%s): %s", getName(), StringUtil.separate(formals), patternExpr.toString()); } public void <API key>(List<TraitSignature> tupleSets) { Set<String> names = Sets.newHashSet(); names.addAll(Lists.transform(formals, FormalParameter.getIdentifier)); patternExpr.<API key>(tupleSets, names); } }
package edu.hm.gamedev.server.packets.client2server; import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; import edu.hm.gamedev.server.packets.Packet; import edu.hm.gamedev.server.packets.Type; public class JoinGame extends Packet { private final String gameName; @JsonCreator public JoinGame(@JsonProperty("gameName") String gameName) { super(Type.JOIN_GAME); this.gameName = gameName; } public String getGameName() { return gameName; } @Override public String toString() { return "JoinGame{" + "gameName='" + gameName + '\'' + '}'; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } if (!super.equals(o)) { return false; } JoinGame joinGame = (JoinGame) o; if (gameName != null ? !gameName.equals(joinGame.gameName) : joinGame.gameName != null) { return false; } return true; } @Override public int hashCode() { int result = super.hashCode(); result = 31 * result + (gameName != null ? gameName.hashCode() : 0); return result; } }
#!/usr/bin/env python import sys, argparse def main(): parser = argparse.ArgumentParser() parser.add_argument('-i', '--input', type=str, action='store', dest='input', default=None, help="Input file") args = parser.parse_args() stats = dict() if args.input is None: print "Error: No input file" with open(args.input) as in_file: for line in in_file.readlines(): time = int(line.split()[0]) tx_bytes = int(line.split()[1]) stats[time] = tx_bytes stats = sorted(stats.items()) start_time = stats[0][0] prev_tx = stats[0][1] no_traffic_flag = True for time, tx_bytes in stats: if no_traffic_flag: if tx_bytes > (prev_tx+100000): no_traffic_flag = False start_time, prev_tx = time, tx_bytes else: print (time-start_time), (tx_bytes-prev_tx) prev_tx = tx_bytes if __name__ == "__main__": main()
// This file is part AriseID. // AriseID free software: you can redistribute it and/or modify // (at your option) any later version. // AriseID distributed in the hope that it will be useful, // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the package main import ( "bytes" "fmt" "math/big" "math/rand" "time" "github.com/ariseid/ariseid-core/common" "github.com/ariseid/ariseid-core/core" "github.com/ariseid/ariseid-core/log" "github.com/ariseid/ariseid-core/params" ) // makeGenesis creates a new genesis struct based on some user input. func (w *wizard) makeGenesis() { // Construct a default genesis block genesis := &core.Genesis{ Timestamp: uint64(time.Now().Unix()), LifeLimit: 4700000, Difficulty: big.NewInt(1048576), Alloc: make(core.GenesisAlloc), Config: &params.ChainConfig{ HomesteadBlock: big.NewInt(1), EIP150Block: big.NewInt(2), EIP155Block: big.NewInt(3), EIP158Block: big.NewInt(3), }, } // Figure out which consensus engine to choose fmt.Println() fmt.Println("Which consensus engine to use? (default = clique)") fmt.Println(" 1. Idhash - proof-of-work") fmt.Println(" 2. Clique - proof-of-authority") choice := w.read() switch { case choice == "1": // In case of idhash, we're pretty much done genesis.Config.Idhash = new(params.IdhashConfig) genesis.ExtraData = make([]byte, 32) case choice == "" || choice == "2": // In the case of clique, configure the consensus parameters genesis.Difficulty = big.NewInt(1) genesis.Config.Clique = &params.CliqueConfig{ Period: 15, Epoch: 30000, } fmt.Println() fmt.Println("How many seconds should blocks take? (default = 15)") genesis.Config.Clique.Period = uint64(w.readDefaultInt(15)) // We also need the initial list of signers fmt.Println() fmt.Println("Which accounts are allowed to seal? (mandatory at least one)") var signers []common.Address for { if address := w.readAddress(); address != nil { signers = append(signers, *address) continue } if len(signers) > 0 { break } } // Sort the signers and embed into the extra-data section for i := 0; i < len(signers); i++ { for j := i + 1; j < len(signers); j++ { if bytes.Compare(signers[i][:], signers[j][:]) > 0 { signers[i], signers[j] = signers[j], signers[i] } } } genesis.ExtraData = make([]byte, 32+len(signers)*common.AddressLength+65) for i, signer := range signers { copy(genesis.ExtraData[32+i*common.AddressLength:], signer[:]) } default: log.Crit("Invalid consensus engine choice", "choice", choice) } // Consensus all set, just ask for initial funds and go fmt.Println() fmt.Println("Which accounts should be pre-funded? (advisable at least one)") for { // Read the address of the account to fund if address := w.readAddress(); address != nil { genesis.Alloc[*address] = core.GenesisAccount{ Balance: new(big.Int).Lsh(big.NewInt(1), 256-7), // 2^256 / 128 (allow many pre-funds without balance overflows) } continue } break } // Add a batch of precompile balances to avoid them getting deleted for i := int64(0); i < 256; i++ { genesis.Alloc[common.BigToAddress(big.NewInt(i))] = core.GenesisAccount{Balance: big.NewInt(1)} } fmt.Println() // Query the user for some custom extras fmt.Println() fmt.Println("Specify your chain/network ID if you want an explicit one (default = random)") genesis.Config.ChainId = new(big.Int).SetUint64(uint64(w.readDefaultInt(rand.Intn(65536)))) fmt.Println() fmt.Println("Anything fun to embed into the genesis block? (max 32 bytes)") extra := w.read() if len(extra) > 32 { extra = extra[:32] } genesis.ExtraData = append([]byte(extra), genesis.ExtraData[len(extra):]...) // All done, store the genesis and flush to disk w.conf.genesis = genesis }
@echo off rem HTMLParser Library - A java-based parser for HTML rem http:remhtmlparser.org rem Copyright (C) 2006 Derrick Oswald rem rem Revision Control Information rem rem $URL: file:///svn/p/htmlparser/code/tags/HTMLParserProject-2.1/src/main/bin/beanybaby.cmd $ rem $Author: derrickoswald $ rem $Date: 2006-09-16 14:44:17 +0000 (Sat, 16 Sep 2006) $ rem $Revision: 4 $ rem rem This library is free software; you can redistribute it and/or rem modify it under the terms of the Common Public License; either rem version 1.0 of the License, or (at your option) any later version. rem rem This library is distributed in the hope that it will be useful, rem but WITHOUT ANY WARRANTY; without even the implied warranty of rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the rem Common Public License for more details. rem rem You should have received a copy of the Common Public License rem along with this library; if not, the license is available from rem the Open Source Initiative (OSI) website: rem http: rem setlocal enableextensions if errorlevel 1 goto no_extensions_error for %%i in ("%0") do set cmd_path=%%~dpi for /D %%i in ("%cmd_path%..\lib\") do set lib_path=%%~dpi if not exist "%lib_path%htmllexer.jar" goto <API key> if not exist "%lib_path%htmlparser.jar" goto <API key> for %%i in (java.exe) do set java_executable=%%~$PATH:i if "%java_executable%"=="" goto no_java_error @echo on %java_executable% -classpath "%lib_path%htmlparser.jar;%lib_path%htmllexer.jar" org.htmlparser.beans.BeanyBaby %1 %2 @echo off goto end :no_extensions_error echo Unable to use CMD extensions goto end :<API key> echo Unable to find htmllexer.jar goto end :<API key> echo Unable to find htmlparser.jar goto end :no_java_error echo Unable to find java.exe goto end :end
package uk.co.wehavecookies56.kk.common.container.slot; import net.minecraft.item.ItemStack; import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.SlotItemHandler; import uk.co.wehavecookies56.kk.common.item.ItemSynthesisBagS; import uk.co.wehavecookies56.kk.common.item.base.<API key>; public class SlotSynthesisBag extends SlotItemHandler { public SlotSynthesisBag (IItemHandler inventory, int index, int x, int y) { super(inventory, index, x, y); } @Override public boolean isItemValid (ItemStack stack) { return !(stack.getItem() instanceof ItemSynthesisBagS) && stack.getItem() instanceof <API key>; } }
package org.sonar.duplications.statement; import org.sonar.duplications.statement.matcher.AnyTokenMatcher; import org.sonar.duplications.statement.matcher.BridgeTokenMatcher; import org.sonar.duplications.statement.matcher.ExactTokenMatcher; import org.sonar.duplications.statement.matcher.<API key>; import org.sonar.duplications.statement.matcher.OptTokenMatcher; import org.sonar.duplications.statement.matcher.TokenMatcher; import org.sonar.duplications.statement.matcher.UptoTokenMatcher; public final class TokenMatcherFactory { private TokenMatcherFactory() { } public static TokenMatcher from(String token) { return new ExactTokenMatcher(token); } public static TokenMatcher to(String... tokens) { return new UptoTokenMatcher(tokens); } public static TokenMatcher bridge(String lToken, String rToken) { return new BridgeTokenMatcher(lToken, rToken); } public static TokenMatcher anyToken() { // TODO Godin: we can return singleton instance return new AnyTokenMatcher(); } public static TokenMatcher opt(TokenMatcher optMatcher) { return new OptTokenMatcher(optMatcher); } public static TokenMatcher forgetLastToken() { // TODO Godin: we can return singleton instance return new <API key>(); } public static TokenMatcher token(String token) { return new ExactTokenMatcher(token); } }
package com.farevee.groceries; public class BulkItem implements Item { // | Fields | /** * The type of food of the bulk item */ BulkFood food; /** * The unit of the bulk item */ Units unit; /** * The amount of bulk item */ int amount; // | Constructor | public BulkItem(BulkFood food, Units unit, int amount) { this.food = food; this.unit = unit; this.amount = amount; } // BulkItem (BulkFood, Units, int) // | Methods | /** * Retrieve the Weight of BulkItem, including unit and amount */ public Weight getWeight() { return new Weight(this.unit, this.amount); }//getWeight() /** * Retrieve the amount of Weight of BulkItem */ @Override public int getWeightAmount() { return this.getWeight().amount; }//getWeightAmount() //Get the unit of weight @Override public Units getWeightUnit() { return this.unit; }//getWeightUnit() //Get the price public int getPrice() { return this.food.pricePerUnit * this.amount; }//getPrice() //Creates a string for the name public String toString() { return (amount + " " + unit.name + " of " + food.name); }//toString() //Gets the name @Override public String getName() { return this.food.name; }//getName() //Get the type of BulkFood public BulkFood getBulkFoodType() { return this.food; }//getBulkFoodType() //Get the amount of BulkItem public int getBulkItemAmount() { return this.amount; }//getBulkItemAmount() //Compares two BulkItem public boolean equalZ(Object thing) { if (thing instanceof BulkItem) { BulkItem anotherBulkItem = (BulkItem) thing; return ((this.food.name.equals(anotherBulkItem.food.name)) && (this.unit.name.equals(anotherBulkItem.unit.name))); } else { return Boolean.FALSE; } }//equals(Object) public void increaseAmount(int x) { this.amount += x; }//increaseAmount(int) }
#pragma once #include <ICLUtils/CompatMacros.h> #include <ICLFilter/InplaceOp.h> namespace icl{ namespace filter{ Filter class for logical in-place operations \ingroup INPLACE /** The InplaceLogicalOp class provides functionalities for arbitrary logical in-place operations on images. The operator can be set to implement a certain operation using a given optype value. Logical (non-bit-wise) operations result in images of value 0 or 255.\n Operation list can be split into two sections: - pure logical operations (AND OR XOR and NOT) - bit-wise operations (bit-wise-AND bit-wise-OR bit-wise-XOR and bit-wise-NOT) Pure Logical operations are available for all types; bit-wise operations make no sense on floating point data, hence these operations are available for integer types only. Supported operator types (implementation on pixel value P and operator value V in braces) - <b>andOp</b> "logical and" ((P&&V)*255) - <b>orOp</b> "logical or" ((P||V)*255) - <b>xorOp</b> "logical and" ((!!P xor !!V)*255) - <b>notOp</b> "logical not" ((!P)*255) operator value is not used in this case - <b>binAndOp</b> "binary and" (P&V) [integer types only] - <b>binOrOp</b> "binary or" ((P|V) [integer types only] - <b>binXorOp</b> "binary and" (P^V) [integer types only] - <b>binNotOp</b> "binary not" (~P) operator value is not used in this case [integer types only] \section IPP-Optimization IPP-Optimization is possible, but not yet implemented. */ class ICLFilter_API InplaceLogicalOp : public InplaceOp{ public: enum optype{ andOp=0, ///< logical "and" orOp=1, ///< logical "or" xorOp=2, ///< logical "xor" notOp=3, ///< logical "not" binAndOp=4,///< binary "and" (for integer types only) binOrOp=5, ///< binary "or" (for integer types only) binXorOp=6,///< binary "xor" (for integer types only) binNotOp=7 ///< binary "not" (for integer types only) }; Creates a new InplaceLogicalOp instance with given optype and value InplaceLogicalOp(optype t, icl64f value=0): m_eOpType(t),m_dValue(value){} applies this operation in-place on given source image virtual core::ImgBase *apply(core::ImgBase *src); returns current value icl64f getValue() const { return m_dValue; } set current value void setValue(icl64f val){ m_dValue = val; } returns current optype optype getOpType() const { return m_eOpType; } set current optype void setOpType(optype t) { m_eOpType = t; } private: optype optype m_eOpType; value icl64f m_dValue; }; } // namespace filter }
#ifndef <API key> #define <API key> #include <testngppst/testngppst.h> #include <testngppst/runner/TestHierarchyRunner.h> TESTNGPPST_NS_START struct TestCaseRunner; struct <API key>; struct <API key> : public TestHierarchyRunner { <API key> ( unsigned int maxCurrentProcess , TestCaseRunner*); ~<API key>(); void run ( <API key>* , <API key>*); private: <API key>* This; }; TESTNGPPST_NS_END #endif
package org.logicobjects.converter.old; import java.util.Arrays; import java.util.List; import org.jpc.term.Term; import org.jpc.util.ParadigmLeakUtil; import org.logicobjects.converter.<API key>; import org.logicobjects.converter.context.old.AdaptationContext; import org.logicobjects.converter.context.old.<API key>; import org.logicobjects.converter.context.old.<API key>; import org.logicobjects.converter.context.old.<API key>; import org.logicobjects.converter.descriptor.<API key>; import org.logicobjects.core.LogicObject; import org.logicobjects.methodadapter.LogicAdapter; import org.minitoolbox.reflection.BeansUtil; public class <API key><From> extends LogicAdapter<From, Term> { @Override public Term adapt(From object) { return adapt(object, null); } public Term adapt(From object, AdaptationContext context) { <API key> annotatedContext; if(context != null) { if(understandsContext(context)) annotatedContext = (<API key>)context; else throw new <API key>(this.getClass(), context); } else { annotatedContext = new <API key>(object.getClass()); //the current context is null, then create default context } if(annotatedContext.<API key>()) { //first check if there is an explicit adapter, in the current implementation, an Adapter annotation overrides any method invoker description return <API key>(object, annotatedContext); } else if(annotatedContext.<API key>()) { return <API key>(object, annotatedContext); } throw new <API key>(this.getClass(), object); } protected Term <API key>(From object, <API key> annotatedContext) { <API key> termAdapter = annotatedContext.<API key>(); return termAdapter.adapt(object); } protected Term <API key>(From object, <API key> annotatedContext) { <API key> <API key> = annotatedContext.<API key>(); String logicObjectName = <API key>.name(); if(logicObjectName.isEmpty()) logicObjectName = <API key>(annotatedContext); List<Term> arguments; String <API key> = <API key>.argsList(); if(<API key> != null && !<API key>.isEmpty()) { <API key> adaptationContext = new <API key>(object.getClass(), <API key>); Object argsListObject = BeansUtil.getProperty(object, <API key>, adaptationContext.getGuidingClass()); List argsList = null; if(List.class.isAssignableFrom(argsListObject.getClass())) argsList = (List) argsListObject; else if(Object[].class.isAssignableFrom(argsListObject.getClass())) argsList = Arrays.asList((Object[])argsListObject); else throw new RuntimeException("Property " + <API key> + " is neither a list nor an array"); arguments = new <API key>().adaptObjects(argsList, adaptationContext); } else { arguments = LogicObject.propertiesAsTerms(object, <API key>.args()); } return new LogicObject(logicObjectName, arguments).asTerm(); } /** * In case the id is not explicitly specified (e.g., with an annotation), it will have to be inferred * It can be inferred from a class id (if the transformation context is a class instance to a logic object), from a field id (if the context is the transformation of a field), etc * Different context override this method to specify how they infer the logic id of the object * @return */ public String <API key>(<API key> annotatedContext) { return ParadigmLeakUtil.<API key>(annotatedContext.getGuidingClass().getSimpleName()); } public static boolean understandsContext(AdaptationContext context) { return context != null && context instanceof <API key>; } }
<?php return array( 'item' => array( 'delete' => ' DELETE FROM "mshop_product" WHERE :cond AND siteid = ? ', 'insert' => ' INSERT INTO "mshop_product" ( "siteid", "typeid", "code", "suppliercode", "label", "status", "start", "end", "mtime", "editor", "ctime" ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ) ', 'update' => ' UPDATE "mshop_product" SET "siteid" = ?, "typeid" = ?, "code" = ?, "suppliercode" = ?, "label" = ?, "status" = ?, "start" = ?, "end" = ?, "mtime" = ?, "editor" = ? WHERE "id" = ? ', 'search' => ' SELECT DISTINCT mpro."id", mpro."siteid", mpro."typeid", mpro."label", mpro."status", mpro."start", mpro."end", mpro."code", mpro."suppliercode", mpro."ctime", mpro."mtime", mpro."editor" FROM "mshop_product" AS mpro :joins WHERE :cond /*-orderby*/ ORDER BY :order /*orderby-*/ LIMIT :size OFFSET :start ', 'count' => ' SELECT COUNT(*) AS "count" FROM ( SELECT DISTINCT mpro."id" FROM "mshop_product" AS mpro :joins WHERE :cond LIMIT 10000 OFFSET 0 ) AS list ', ), );
#ifndef STEADYAIMCOMMAND_H_ #define STEADYAIMCOMMAND_H_ #include "server/zone/objects/scene/SceneObject.h" #include "SquadLeaderCommand.h" class SteadyaimCommand : public SquadLeaderCommand { public: SteadyaimCommand(const String& name, ZoneProcessServer* server) : SquadLeaderCommand(name, server) { } int doQueueCommand(CreatureObject* creature, const uint64& target, const UnicodeString& arguments) { if (!checkStateMask(creature)) return INVALIDSTATE; if (!<API key>(creature)) return INVALIDLOCOMOTION; if (!creature->isPlayerCreature()) return GENERALERROR; ManagedReference<CreatureObject*> player = cast<CreatureObject*>(creature); ManagedReference<GroupObject*> group = player->getGroup(); if (!checkGroupLeader(player, group)) return GENERALERROR; float skillMod = (float) creature->getSkillMod("steadyaim"); int hamCost = (int) (100.0f * (1.0f - (skillMod / 100.0f))) * <API key>(group); int healthCost = creature-><API key>(CreatureAttribute::STRENGTH, hamCost); int actionCost = creature-><API key>(CreatureAttribute::QUICKNESS, hamCost); int mindCost = creature-><API key>(CreatureAttribute::FOCUS, hamCost); if (!inflictHAM(player, healthCost, actionCost, mindCost)) return GENERALERROR; // shoutCommand(player, group); int amount = 5 + skillMod; if (!doSteadyAim(player, group, amount)) return GENERALERROR; if (player->isPlayerCreature() && player->getPlayerObject()-><API key>(String("steadyaim").hashCode()).isEmpty()==false) { UnicodeString shout(player->getPlayerObject()-><API key>(String("steadyaim").hashCode())); server->getChatManager()->broadcastMessage(player, shout, 0, 0, 80); } return SUCCESS; } bool doSteadyAim(CreatureObject* leader, GroupObject* group, int amount) { if (leader == NULL || group == NULL) return false; for (int i = 0; i < group->getGroupSize(); i++) { ManagedReference<SceneObject*> member = group->getGroupMember(i); if (!member->isPlayerCreature() || member == NULL || member->getZone() != leader->getZone()) continue; ManagedReference<CreatureObject*> memberPlayer = cast<CreatureObject*>( member.get()); Locker clocker(memberPlayer, leader); sendCombatSpam(memberPlayer); ManagedReference<WeaponObject*> weapon = memberPlayer->getWeapon(); if (!weapon->isRangedWeapon()) continue; int duration = 300; ManagedReference<Buff*> buff = new Buff(memberPlayer, actionCRC, duration, BuffType::SKILL); buff->setSkillModifier("private_aim", amount); memberPlayer->addBuff(buff); } return true; } }; #endif //STEADYAIMCOMMAND_H_
package org.sonar.api.utils; import org.apache.commons.io.FileUtils; import org.junit.Test; import java.io.File; import java.io.IOException; import static org.hamcrest.core.Is.is; import static org.junit.Assert.assertThat; public class TempFileUtilsTest { @Test public void createTempDirectory() throws IOException { File dir = TempFileUtils.createTempDirectory(); try { assertThat(dir.exists(), is(true)); assertThat(dir.isDirectory(), is(true)); assertThat(dir.listFiles().length, is(0)); } finally { FileUtils.deleteDirectory(dir); } } }
package net.anthavio.sewer.test; import net.anthavio.sewer.ServerInstance; import net.anthavio.sewer.<API key>; import net.anthavio.sewer.ServerMetadata; import net.anthavio.sewer.ServerMetadata.CacheScope; import net.anthavio.sewer.ServerType; import org.junit.rules.TestRule; import org.junit.runner.Description; import org.junit.runners.model.Statement; public class SewerRule implements TestRule { private final <API key> manager = <API key>.INSTANCE; private final ServerMetadata metadata; private ServerInstance server; public SewerRule(ServerType type, String home) { this(type, home, -1, null, CacheScope.JVM); } public SewerRule(ServerType type, String home, int port) { this(type, home, port, null, CacheScope.JVM); } public SewerRule(ServerType type, String home, int port, CacheScope cache) { this(type, home, port, null, cache); } public SewerRule(ServerType type, String home, int port, String[] configs, CacheScope cache) { this.metadata = new ServerMetadata(type, home, port, configs, cache); } public ServerInstance getServer() { return server; } @Override public Statement apply(Statement base, Description description) { return new SewerStatement(base); } public class SewerStatement extends Statement { private final Statement base; public SewerStatement(Statement base) { this.base = base; } @Override public void evaluate() throws Throwable { server = manager.borrowServer(metadata); try { base.evaluate(); } finally { manager.returnServer(metadata); } } } }
package org.sonar.api.ce.posttask; /** * @since 5.5 */ public interface CeTask { /** * Id of the Compute Engine task. * <p> * This is the id under which the processing of the project analysis report has been added to the Compute Engine * queue. * */ String getId(); /** * Indicates whether the Compute Engine task ended successfully or not. */ Status getStatus(); enum Status { SUCCESS, FAILED } }
#include "<API key>.h" #include "<API key>.h" #include "<API key>.h" #include "rdsrequest_p.h" namespace QtAws { namespace RDS { /*! * Constructs a copy of \a other. */ <API key>::<API key>(const <API key> &other) : RdsRequest(new <API key>(*other.d_func(), this)) { } /*! * Constructs a <API key> object. */ <API key>::<API key>() : RdsRequest(new <API key>(RdsRequest::<API key>, this)) { } /*! * \reimp */ bool <API key>::isValid() const { return false; } /*! * Returns a <API key> object to process \a reply. * * \sa QtAws::Core::AwsAbstractClient::send */ QtAws::Core::AwsAbstractResponse * <API key>::response(QNetworkReply * const reply) const { return new <API key>(*this, reply); } /*! * \class QtAws::RDS::<API key> * \brief The <API key> class provides private implementation for <API key>. * \internal * * \inmodule QtAwsRDS */ /*! * Constructs a <API key> object for Rds \a action, * with public implementation \a q. */ <API key>::<API key>( const RdsRequest::Action action, <API key> * const q) : RdsRequestPrivate(action, q) { } /*! * Constructs a copy of \a other, with public implementation \a q. * * This copy-like constructor exists for the benefit of the <API key> * class' copy constructor. */ <API key>::<API key>( const <API key> &other, <API key> * const q) : RdsRequestPrivate(other, q) { } } // namespace RDS } // namespace QtAws
var KevoreeEntity = require('./KevoreeEntity'); /** * AbstractChannel entity * * @type {AbstractChannel} extends KevoreeEntity */ module.exports = KevoreeEntity.extend({ toString: 'AbstractChannel', construct: function () { this.remoteNodes = {}; this.inputs = {}; }, internalSend: function (portPath, msg) { var remoteNodeNames = this.remoteNodes[portPath]; for (var remoteNodeName in remoteNodeNames) { this.onSend(remoteNodeName, msg); } }, /** * * @param remoteNodeName * @param msg */ onSend: function (remoteNodeName, msg) { }, remoteCallback: function (msg) { for (var name in this.inputs) { this.inputs[name].getCallback().call(this, msg); } }, <API key>: function (portPath, remoteNodes) { this.remoteNodes[portPath] = remoteNodes; }, <API key>: function (port) { this.inputs[port.getName()] = port; } });
package calc.lib; /** Class (POJO) used to store Uninhabited Solar System JSON objects * * @author Carlin Robertson * @version 1.0 * */ public class <API key> { private String[] information; private String requirePermit; private Coords coords; private String name; public String[] getInformation () { return information; } public void setInformation (String[] information) { this.information = information; } public String getRequirePermit () { return requirePermit; } public void setRequirePermit (String requirePermit) { this.requirePermit = requirePermit; } public Coords getCoords () { return coords; } public void setCoords (Coords coords) { this.coords = coords; } public String getName () { return name; } public void setName (String name) { this.name = name; } }
<?php require_once '../../../config.php'; require_once $config['root_path'] . '/system/functions.php'; include_once $config['system_path'] . '/start_system.php'; admin_login(); if (isset($_POST['delete']) && isset($_POST['id']) && isset($_SESSION['member']['access']['countries'])) { require_once ROOT_PATH . '/applications/news/modeles/news.class.php'; $cms = new news(); $cms->delete(intval($_POST['id'])); die ( json_encode( array_merge( $_POST, array ( 'status' => 'true' ) ) ) ); } echo json_encode ( array_merge ( $_POST, array ( 'status' => 'unknown error' ) ) ); die (); ?>
// Catalano Fuzzy Library // The Catalano Framework // diego.catalano at live.com // andrew.kirillov at gmail.com // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // This library is distributed in the hope that it will be useful, // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // You should have received a copy of the GNU Lesser General Public // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA package Catalano.Fuzzy; /** * Interface with the common methods of Fuzzy Unary Operator. * @author Diego Catalano */ public interface IUnaryOperator { /** * Calculates the numerical result of a Unary operation applied to one fuzzy membership value. * @param membership A fuzzy membership value, [0..1]. * @return The numerical result of the operation applied to <paramref name="membership"/>. */ float Evaluate( float membership ); }
<?php namespace Google\AdsApi\Dfp\v201708; /** * This file was generated from WSDL. DO NOT EDIT. */ class <API key> { const TOP_LEVEL = 'TOP_LEVEL'; const FLAT = 'FLAT'; const HIERARCHICAL = 'HIERARCHICAL'; }
package flabs.mods.magitech.aura; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.WorldSavedData; public class AuraSavedData extends WorldSavedData{ public static final String nbtName="MagiAura"; public AuraSavedData(String name) { super(name); } @Override public void readFromNBT(NBTTagCompound nbttagcompound) { System.out.println("Reading Aura Data"); } @Override public void writeToNBT(NBTTagCompound nbttagcompound) { System.out.println("Writing Aura Data"); } }
.iwl-height-full { height: 100%; } /*# sourceMappingURL=!design.css.map */
--Copyright (C) 2009 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version --which carries forward this exception. <API key> = <API key>:new { appearanceFilename = "appearance/<API key>.apt", <API key> = "", <API key> = {}, clearFloraRadius = 25, clientDataFile = "clientdata/lair/<API key>.cdf", <API key> = 0, <API key> = 51, <API key> = 1, <API key> = 0, <API key> = 1, <API key> = 0, containerType = 0, <API key> = 1, <API key> = {}, detailedDescription = "@lair_d:womp_rat", gameObjectType = 4, <API key> = 0, lookAtText = "string_id_table", noBuildRadius = 64, objectName = "@lair_n:womp_rat", onlyVisibleInTools = 0, <API key> = {}, <API key> = "", <API key> = {}, scale = 1, <API key> = 0.5, sendToClient = 1, <API key> = "", snapToTerrain = 1, socketDestinations = {}, <API key> = "", surfaceType = 0, targetable = 1, <API key> = 0 } ObjectTemplates:addTemplate(<API key>, 2053935761) <API key> = <API key>:new { appearanceFilename = "appearance/<API key>.apt", <API key> = "", <API key> = {}, clearFloraRadius = 25, clientDataFile = "clientdata/lair/<API key>.cdf", <API key> = 0, <API key> = 51, <API key> = 1, <API key> = 0, <API key> = 1, <API key> = 0, containerType = 0, <API key> = 1, <API key> = {}, detailedDescription = "@lair_d:womp_rat_desert", gameObjectType = 4, <API key> = 0, lookAtText = "string_id_table", noBuildRadius = 64, objectName = "@lair_n:womp_rat_desert", onlyVisibleInTools = 0, <API key> = {}, <API key> = "", <API key> = {}, scale = 1, <API key> = 0.5, sendToClient = 1, <API key> = "", snapToTerrain = 1, socketDestinations = {}, <API key> = "", surfaceType = 0, targetable = 1, <API key> = 0 } ObjectTemplates:addTemplate(<API key>, 703016558)
package edu.ut.mobile.network; public class NetInfo{ //public static byte[] IPAddress = {Integer.valueOf("54").byteValue(),Integer.valueOf("73").byteValue(),Integer.valueOf("28").byteValue(),Integer.valueOf("236").byteValue()}; static byte[] IPAddress = {Integer.valueOf("192").byteValue(),Integer.valueOf("168").byteValue(),Integer.valueOf("1").byteValue(),Integer.valueOf("67").byteValue()}; static int port = 6000; static int waitTime = 100000; }
package org.sd.text; import org.sd.io.FileUtil; import org.sd.nlp.AbstractLexicon; import org.sd.nlp.AbstractNormalizer; import org.sd.nlp.Break; import org.sd.nlp.BreakStrategy; import org.sd.nlp.Categories; import org.sd.nlp.Category; import org.sd.nlp.CategoryFactory; import org.sd.nlp.GeneralNormalizer; import org.sd.nlp.GenericLexicon; import org.sd.nlp.Lexicon; import org.sd.nlp.LexiconPipeline; import org.sd.nlp.<API key>; import org.sd.nlp.TokenizerWrapper; import org.sd.nlp.StringWrapper; import org.sd.util.PropertiesParser; import org.sd.util.tree.Tree; import java.io.BufferedReader; import java.io.File; import java.io.IOException; import java.net.<API key>; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Properties; /** * Utility to find meaningful words in strings. * <p> * @author Spence Koehler */ public class MungedWordFinder { private static final String UNDETERMINED_LETTER = "X"; private static final String UNDETERMINED_WORD = "U"; private static final String WORD = "W"; private static final String NUMBER = "N"; private static final String SEQUENCE = "S"; private static final String CONSTITUENT = "C"; private static final String[] CATEGORIES = new String[] { UNDETERMINED_LETTER, UNDETERMINED_WORD, WORD, NUMBER, SEQUENCE, CONSTITUENT, }; private static final AbstractNormalizer NORMALIZER = GeneralNormalizer.<API key>(); private static final BreakStrategy BREAK_STRATEGY = new MyBreakStrategy(); private static final Comparator<WordSequence> SEQUENCE_COMPARATOR = new Comparator<WordSequence>() { public int compare(WordSequence ws1, WordSequence ws2) { return ws1.size() - ws2.size(); } public boolean equals(Object o) { return this == o; } }; private CategoryFactory categoryFactory; private Map<String, File> wordFiles; private Map<String, String[]> wordSets; private List<Lexicon> lexicons; private TokenizerWrapper _tokenizerWrapper; /** * Construct without any dictionaries. * <p> * Add dictionaries to use for finding munged words using the * addWordFile, addWordSet, and addLexicon methods. */ public MungedWordFinder() { this.categoryFactory = new CategoryFactory(CATEGORIES); this.wordFiles = new HashMap<String, File>(); this.wordSets = new HashMap<String, String[]>(); this.lexicons = new ArrayList<Lexicon>(); this._tokenizerWrapper = null; } /** * Add a word file defining words to recognize. */ public final void addWordFile(String name, File wordFile) { this.wordFiles.put(name, wordFile); this._tokenizerWrapper = null; // force rebuild. } /** * Add a word set defining words to recognize. */ public final void addWordSet(String name, String[] words) { this.wordSets.put(name, words); this._tokenizerWrapper = null; // force rebuild. } /** * Add a lexicon defining words to recognize. */ public final void addLexicon(Lexicon lexicon) { this.lexicons.add(lexicon); this._tokenizerWrapper = null; // force rebuild. } protected final TokenizerWrapper getTokenizerWrapper() { if (_tokenizerWrapper == null) { try { final Lexicon lexicon = new LexiconPipeline(buildLexicons()); _tokenizerWrapper = new TokenizerWrapper( lexicon, categoryFactory, <API key>.Type.LONGEST_TO_SHORTEST, NORMALIZER, BREAK_STRATEGY, false, 0, false); //NOTE: lexicon should classify every token } catch (IOException e) { throw new <API key>(e); } } return _tokenizerWrapper; } private final Lexicon[] buildLexicons() throws IOException { final List<Lexicon> result = new ArrayList<Lexicon>(); final Category wordCategory = categoryFactory.getCategory(WORD); // add a lexicon that identifies/recognizes number sequences. result.add(new NumberLexicon(categoryFactory.getCategory(NUMBER))); // add a lexicon for each wordSet for (Map.Entry<String, String[]> wordSetEntry : wordSets.entrySet()) { final String name = wordSetEntry.getKey(); final String[] terms = wordSetEntry.getValue(); final GenericLexicon genericLexicon = new GenericLexicon(terms, NORMALIZER, wordCategory, false, true, false, "name=" + name); genericLexicon.setMaxNumWords(0); // disable "word" limit. each char counts as a word with our break strategy. result.add(genericLexicon); } // add a lexicon for each wordFile for (Map.Entry<String, File> wordFileEntry : wordFiles.entrySet()) { final String name = wordFileEntry.getKey(); final File wordFile = wordFileEntry.getValue(); final GenericLexicon genericLexicon = new GenericLexicon(FileUtil.getInputStream(wordFile), NORMALIZER, wordCategory, false, true, false, "name=" + name); genericLexicon.setMaxNumWords(0); // disable "word" limit. each char counts as a word with our break strategy. result.add(genericLexicon); } // add each lexicon for (Lexicon lexicon : lexicons) { result.add(lexicon); } // add a lexicon that identifies a single letter as unknown. result.add(new UnknownLexicon(categoryFactory.getCategory(UNDETERMINED_LETTER))); return result.toArray(new Lexicon[result.size()]); //todo: what about conjugations? } public List<WordSequence> getBestSplits(String string) { List<WordSequence> result = new ArrayList<WordSequence>(); final TokenizerWrapper tokenizerWrapper = getTokenizerWrapper(); final Tree<StringWrapper.SubString> tokenTree = tokenizerWrapper.tokenize(string); final List<Tree<StringWrapper.SubString>> leaves = tokenTree.gatherLeaves(); int maxScore = -1; for (Tree<StringWrapper.SubString> leaf : leaves) { final WordSequence wordSequence = new WordSequence(leaf); final int curScore = wordSequence.getScore(); if (curScore >= maxScore) { if (curScore > maxScore) { result.clear(); maxScore = curScore; } result.add(wordSequence); } } if (result.size() > 0) { Collections.sort(result, SEQUENCE_COMPARATOR); } return result; } public List<WordSequence> getBestDomainSplits(String domain) { final int dotPos = domain.indexOf('.'); if (dotPos > 0 && dotPos < domain.length() - 1) { final DetailedUrl dUrl = new DetailedUrl(domain); domain = dUrl.getHost(false, false, false); } return getBestSplits(domain); } public String getSplitsAsString(List<WordSequence> splits) { final StringBuilder result = new StringBuilder(); if (splits != null) { for (Iterator<WordSequence> splitIter = splits.iterator(); splitIter.hasNext(); ) { final WordSequence split = splitIter.next(); result.append(split.toString()); if (splitIter.hasNext()) result.append('|'); } } return result.toString(); } // symbols are hard breaks... letters are soft breaks... consecutive digits aren't (don't break numbers) private static final class MyBreakStrategy implements BreakStrategy { public Break[] computeBreaks(int[] codePoints) { final Break[] result = new Break[codePoints.length]; boolean inNumber = false; for (int i = 0; i < codePoints.length; ++i) { Break curBreak = Break.NONE; final int cp = codePoints[i]; if (Character.isDigit(cp)) { if (i > 0 && !inNumber && result[i - 1] != Break.HARD) { curBreak = Break.SOFT_SPLIT; } else { curBreak = Break.NONE; } inNumber = true; } else if (Character.isLetter(cp)) { // first letter after a hard break (or at start) isn't a break if (i == 0 || result[i - 1] == Break.HARD) { curBreak = Break.NONE; } else { curBreak = Break.SOFT_SPLIT; } inNumber = false; } else { // if following a digit or with-digit-symbol, then consider the number parts as a whole if (inNumber) { curBreak = Break.NONE; } // else if a digit or digit-symbol follows, then consider the number parts as a whole else if (i + 1 < codePoints.length && (Character.isDigit(codePoints[i + 1]) || (i + 2 < codePoints.length && Character.isDigit(codePoints[i + 2])))) { curBreak = Break.NONE; inNumber = true; } else { curBreak = Break.HARD; inNumber = false; } } result[i] = curBreak; } return result; } } private static final class NumberLexicon extends AbstractLexicon { private Category category; public NumberLexicon(Category category) { super(null); this.category = category; } /** * Define applicable categories in the subString. * <p> * In this case, if a digit is found in the subString, then the NUMBER category is added. * * @param subString The substring to define. * @param normalizer The normalizer to use. */ protected void define(StringWrapper.SubString subString, AbstractNormalizer normalizer) { if (!subString.<API key>()) { boolean isNumber = true; int lastNumberPos = -1; for (int i = subString.startPos; i < subString.endPos; ++i) { final int cp = subString.stringWrapper.getCodePoint(i); if (cp > '9' || cp < '0') { isNumber = false; break; } lastNumberPos = i; } if (!isNumber) { // check for "text" numbers if (lastNumberPos >= 0 && lastNumberPos == subString.endPos - 3) { // check for number suffix isNumber = TextNumber.isNumberEnding(subString.originalSubString.substring(lastNumberPos + 1).toLowerCase()); } else if (lastNumberPos < 0) { // check for number word isNumber = TextNumber.isNumber(subString.originalSubString.toLowerCase()); } } if (isNumber) { subString.setAttribute("name", NUMBER); subString.addCategory(category); subString.setDefinitive(true); } } } /** * Determine whether the categories container already has category type(s) * that this lexicon would add. * <p> * NOTE: this is used to avoid calling "define" when categories already exist * for the substring. * * @return true if this lexicon's category type(s) are already present. */ protected boolean alreadyHasTypes(Categories categories) { return categories.hasType(category); } } private static final class UnknownLexicon extends AbstractLexicon { private Category category; public UnknownLexicon(Category category) { super(null); this.category = category; } /** * Define applicable categories in the subString. * <p> * In this case, if a digit is found in the subString, then the NUMBER category is added. * * @param subString The substring to define. * @param normalizer The normalizer to use. */ protected void define(StringWrapper.SubString subString, AbstractNormalizer normalizer) { if (!subString.<API key>() && subString.length() == 1) { subString.addCategory(category); subString.setAttribute("name", UNDETERMINED_WORD); } } /** * Determine whether the categories container already has category type(s) * that this lexicon would add. * <p> * NOTE: this is used to avoid calling "define" when categories already exist * for the substring. * * @return true if this lexicon's category type(s) are already present. */ protected boolean alreadyHasTypes(Categories categories) { return categories.hasType(category); } } /** * Container class for a word. */ public static final class Word { public final StringWrapper.SubString word; public final String type; private Integer _score; public Word(StringWrapper.SubString word, String type) { this.word = word; this.type = type; this._score = null; } /** * Get this word's score. * <p> * A word's score is its number of defined letters. */ public int getScore() { if (_score == null) { _score = UNDETERMINED_WORD.equals(type) ? 0 : word.length() * word.length(); } return _score; } public String toString() { final StringBuilder result = new StringBuilder(); result.append(type).append('=').append(word.originalSubString); return result.toString(); } } /** * Container for a sequence of words for a string. */ public static final class WordSequence { public final String string; public final List<Word> words; private int score; public WordSequence(Tree<StringWrapper.SubString> leaf) { final LinkedList<Word> theWords = new LinkedList<Word>(); this.words = theWords; this.score = 0; String theString = null; while (leaf != null) { final StringWrapper.SubString subString = leaf.getData(); if (subString == null) break; // hit root. final String nameValue = subString.getAttribute("name"); final Word word = new Word(subString, nameValue == null ? UNDETERMINED_WORD : nameValue); theWords.addFirst(word); score += word.getScore(); if (theString == null) theString = subString.stringWrapper.string; leaf = leaf.getParent(); } this.string = theString; } /** * Get this sequence's score. * <p> * The score is the total number of defined letters in the sequence's words. */ public int getScore() { return score; } public int size() { return words.size(); } public String toString() { return asString(","); } public String asString(String delim) { final StringBuilder result = new StringBuilder(); for (Iterator<Word> wordIter = words.iterator(); wordIter.hasNext(); ) { final Word word = wordIter.next(); result.append(word.toString()); if (wordIter.hasNext()) result.append(delim); } // result.append('(').append(getScore()).append(')'); return result.toString(); } } //java -Xmx640m org.sd.nlp.MungedWordFinder wordSet="foo,bar,baz" wordSetName="fbb" foobarbaz "foo-bar-baz" "foobArbaz" gesundheit public static final void main(String[] args) throws IOException { // properties: // wordFiles="file1,file2,..." // wordSet="word1,word2,..." // wordSetName="name" // non-property arguments are munged strings to split. // STDIN has other munged strings or domains to split. final PropertiesParser propertiesParser = new PropertiesParser(args); final Properties properties = propertiesParser.getProperties(); final String wordFileNames = properties.getProperty("wordFiles"); final String wordSet = properties.getProperty("wordSet"); final String wordSetName = properties.getProperty("wordSetName"); final MungedWordFinder mungedWordFinder = new MungedWordFinder(); if (wordFileNames != null) { for (String wordFile : wordFileNames.split("\\s*,\\s*")) { final File file = new File(wordFile); mungedWordFinder.addWordFile(file.getName().split("\\.")[0], file); } } if (wordSet != null) { mungedWordFinder.addWordSet(wordSetName, wordSet.split("\\s*,\\s*")); } final String[] mungedWords = propertiesParser.getArgs(); for (String mungedWord : mungedWords) { final List<WordSequence> splits = mungedWordFinder.getBestDomainSplits(mungedWord); final String splitsString = mungedWordFinder.getSplitsAsString(splits); System.out.println(mungedWord + "|" + splitsString); } final BufferedReader reader = FileUtil.getReader(System.in); String line = null; while ((line = reader.readLine()) != null) { final List<WordSequence> splits = mungedWordFinder.getBestDomainSplits(line); final String splitsString = mungedWordFinder.getSplitsAsString(splits); System.out.println(line + "|" + splitsString); } reader.close(); } }
package org.oss.pdfreporter.sql.factory; import java.io.InputStream; import java.util.Date; import org.oss.pdfreporter.sql.IBlob; import org.oss.pdfreporter.sql.IConnection; import org.oss.pdfreporter.sql.IDate; import org.oss.pdfreporter.sql.IDateTime; import org.oss.pdfreporter.sql.ITime; import org.oss.pdfreporter.sql.ITimestamp; import org.oss.pdfreporter.sql.SQLException; /** * Sql connectivity factory. * The interface supports queries with prepared statements. * No DDL or modifying operations are supported, neither transactions or cursors. * @author donatmuller, 2013, last change 5:39:58 PM */ public interface ISqlFactory { /** * Returns a connection for the connection parameter. * It is up to the implementor to define the syntax of the connection parameter.<br> * The parameter could include a driver class name or just an url and assume that a driver * was already loaded. * @param url * @param user * @param password * @return */ IConnection newConnection(String url, String user, String password) throws SQLException; /** * used by dynamic loading of specific database driver and JDBC-URL, when the implementation don't know about the specific <API key>. * @param jdbcUrl * @param user * @param password * @return * @throws SQLException */ IConnection createConnection(String jdbcUrl, String user, String password) throws SQLException; /** * Creates a Date. * @param date * @return */ IDate newDate(Date date); /** * Creates a Time. * @param time * @return */ ITime newTime(Date time); /** * Creates a Timestamp. * @param timestamp * @return */ ITimestamp newTimestamp(long milliseconds); /** * Creates a DateTime. * @param datetime * @return */ IDateTime newDateTime(Date datetime); /** * Creates a Blob. * @param is * @return */ IBlob newBlob(InputStream is); /** * Creates a Blob. * @param bytes * @return */ IBlob newBlob(byte[] bytes); }
package org.alfresco.repo.admin.registry; import java.io.Serializable; import java.util.Collection; /** * Interface for service providing access to key-value pairs for storage * of system-controlled metadata. * * @author Derek Hulley */ public interface RegistryService { /** * Assign a value to the registry key, which must be of the form <b>/a/b/c</b>. * * @param key the registry key. * @param value any value that can be stored in the repository. */ void addProperty(RegistryKey key, Serializable value); /** * @param key the registry key. * @return Returns the value stored in the key or <tt>null</tt> if * no value exists at the path and name provided * * @see #addProperty(String, Serializable) */ Serializable getProperty(RegistryKey key); /** * Fetches all child elements for the given path. The key's property should be * <tt>null</tt> as it is completely ignored. * <code><pre> * ... * registryService.addValue(KEY_A_B_C_1, VALUE_ONE); * registryService.addValue(KEY_A_B_C_2, VALUE_TWO); * ... * assertTrue(registryService.getChildElements(KEY_A_B_null).contains("C")); * ... * </pre></code> * * @param key the registry key with the path. The last element in the path * will be ignored, and can be any acceptable value localname or <tt>null</tt>. * @return Returns all child elements (not values) for the given key, ignoring * the last element in the key. * * @see RegistryKey#getPath() */ Collection<String> getChildElements(RegistryKey key); /** * Copies the path or value from the source to the target location. The source and target * keys <b>must</b> be both either path-specific or property-specific. If the source doesn't * exist, then nothing will be done; there is no guarantee that the target will exist after * the call. * <p> * This is essentially a merge operation. Use {@link #delete(RegistryKey) delete} first * if the target must be cleaned. * * @param sourceKey the source registry key to take values from * @param targetKey the target registyr key to move the path or value to */ void copy(RegistryKey sourceKey, RegistryKey targetKey); /** * Delete the path element or value described by the key. If the key points to nothing, * then nothing is done. * <code>delete(/a/b/c)</code> will remove value <b>c</b> from path <b>/a/b</b>.<br/> * <code>delete(/a/b/null)</code> will remove node <b>/a/b</b> along with all values and child * elements. * * @param key the path or value to delete */ void delete(RegistryKey key); }
import java.util.*; import Jakarta.util.FixDosOutputStream; import java.io.*; // it would make more sense for PJ and Mixin to have similar // output. public class ModOverrides { public void reduce2java( AstProperties props ) { // Step 1: the overrides modifier should not be present, UNLESS // there is a SoUrCe property. It's an error otherwise. if ( props.getProperty( "SoUrCe" ) == null ) { AstNode.error( tok[0], "overrides modifier should not be present" ); return; } // Step 2: it's OK to be present. If so, the reduction is to // print the white-space in front for pretty-printing props.print( getComment() ); } }
package org.exoplatform.social.core.storage.proxy; import java.lang.reflect.Proxy; import org.exoplatform.social.core.activity.model.ExoSocialActivity; public class <API key> { @SuppressWarnings("unchecked") static <T> T of(ProxyInvocation invocation) { Class<?> targetClass = invocation.getTargetClass(); //1. loader - the class loader to define the proxy class //2. the list of interfaces for the proxy class to implement //3. the invocation handler to dispatch method invocations to return (T) Proxy.newProxyInstance(targetClass.getClassLoader(), new Class<?>[]{targetClass}, invocation); } public static <T> T of(Class<T> aClass, ExoSocialActivity activity) { return of(new ProxyInvocation(aClass, activity)); } }
<?php namespace Tests\Browser\Pages\Admin; use Laravel\Dusk\Browser; use Laravel\Dusk\Page as BasePage; class FilterAdd extends BasePage { /** * Get the URL for the page. * * @return string */ public function url() { return '/admin/filter/create'; } /** * Assert that the browser is on the page. * * @param Browser $browser * @return void */ public function assert(Browser $browser) { $browser->assertPathIs($this->url()); } /** * Get the element shortcuts for the page. * * @return array */ public function elements() { return [ '@status' => 'select[name="properties[status]"]', '@display' => 'select[name="properties[display]"]', '@displayCount' => 'input[name="properties[display_count]"]', '@roundTo' => 'input[name="properties[other][round_to]"]', '@title' => 'input[name="properties[title]"]', '@type' => 'select[name="properties[type]"]', '@feature' => 'select[name="properties[feature_id]"]', '@categories' => 'select[name="categories[]"]', '@submit' => '#submit' ]; } }
package xades4j.xml.unmarshalling; import xades4j.algorithms.Algorithm; import xades4j.properties.<API key>; import xades4j.properties.data.<API key>; import xades4j.xml.bind.xades.<API key>; class <API key> extends <API key><<API key>> implements <API key> { <API key>() { super(<API key>.PROP_NAME); } @Override public void <API key>( <API key> xmlProps, <API key> <API key>) throws <API key> { super.convertTimeStamps(xmlProps.<API key>(), <API key>); } @Override protected <API key> createTSData(Algorithm c14n) { return new <API key>(c14n); } @Override protected void setTSData( <API key> tsData, <API key> <API key>) { <API key>.<API key>(tsData); } }
package fr.umlv.unitex.cassys; public class <API key> { private String fileName; private boolean mergeMode; private boolean replaceMode; private boolean disabled; private boolean star; private boolean commentFound; /** * @return the fileName */ public String getFileName() { return fileName; } /** * @return the mergeMode */ public boolean isMergeMode() { return mergeMode; } /** * @return the replaceMode */ public boolean isReplaceMode() { return replaceMode; } /** * @return the commentFound */ public boolean isCommentFound() { return commentFound; } /** * * @return disabled */ public boolean isDisabled(){ return disabled; } public boolean isStar(){ return star; } public <API key>(String line) throws EmptyLineException, <API key> { // extract line comment final String lineSubstring[] = line.split(" if (lineSubstring.length > 1) { commentFound = true; } if (lineSubstring[0] == null || lineSubstring[0].equals("")) { throw new EmptyLineException(); } final String lineCore[] = lineSubstring[0].split(" "); if (!lineCore[0].startsWith("\"") || !lineCore[0].endsWith("\"")) { throw new <API key>(lineSubstring[0] + " --> FileName must start and end with quote\n"); } lineCore[0] = lineCore[0].substring(1, lineCore[0].length() - 1); if (lineCore.length > 1) { fileName = lineCore[0]; if (lineCore[1].equals("M") || lineCore[1].equals("Merge") || lineCore[1].equals("merge")) { mergeMode = true; replaceMode = false; } else if (lineCore[1].equals("R") || lineCore[1].equals("Replace") || lineCore[1].equals("replace")) { mergeMode = false; replaceMode = true; } else { throw new <API key>(lineSubstring[0] + " --> Second argument should be Merge or Replace\n"); } } else { throw new <API key>( lineSubstring[0] + " --> FileName should be followed by a white space and Merge or Replace\n"); } if(lineCore.length>2){ if(lineCore[2].equals("Disabled")||lineCore[2].equals("Disabled")){ disabled = true; } else if(lineCore[2].equals("Enabled")){ disabled = false; } else { throw new <API key>(lineSubstring[0] + " --> Third argument should be Disabled or Enabled\n"); } if(lineCore.length>3){ if(lineCore[3].equals("*")){ star = true; } else if(lineCore[3].equals("1")){ star = false; } else { throw new <API key>(lineSubstring[0] + " --> Fourth argument should be 1 or *\n"); } } else { star = false; } } else { disabled = false; star = false; } } public class <API key> extends Exception { public <API key>(String s) { super(s); } public <API key>() { /* NOP */ } } public class EmptyLineException extends Exception { public EmptyLineException() { /* NOP */ } } }
# This program is free software: you can redistribute it and/or modify # (at your option) any later version. # This program is distributed in the hope that it will be useful, # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the from django.conf.urls.defaults import patterns, url urlpatterns = patterns('autoreports.views', url(r'^ajax/fields/tree/$', 'reports_ajax_fields', name='reports_ajax_fields'), url(r'^ajax/fields/options/$', '<API key>', name='<API key>'), url(r'^(category/(?P<category_key>[\w-]+)/)?$', 'reports_list', name='reports_list'), url(r'^(?P<registry_key>[\w-]+)/$', 'reports_api', name='reports_api'), url(r'^(?P<registry_key>[\w-]+)/(?P<report_id>\d+)/$', 'reports_api', name='reports_api'), url(r'^(?P<registry_key>[\w-]+)/reports/$', 'reports_api_list', name='reports_api_list'), url(r'^(?P<registry_key>[\w-]+)/wizard/$', 'reports_api_wizard', name='reports_api_wizard'), url(r'^(?P<registry_key>[\w-]+)/wizard/(?P<report_id>\d+)/$', 'reports_api_wizard', name='reports_api_wizard'), url(r'^(?P<app_name>[\w-]+)/(?P<model_name>[\w-]+)/$', 'reports_view', name='reports_view'), )
<?php //ini_set("display_errors", 1); //ini_set("<API key>", 1); <API key>("GMT"); $timezone = <API key>(); if ( !isset($_GET['p'])) { header("HTTP/1.1 400 Bad Request"); header("Status: Bad Request"); exit; } $t_start = microtime(true); $data = array(); require_once "./dbconnect.php"; require_once "./terminfo.php"; if ( !$conn ) { header("HTTP/1.1 400 Bad Request"); header("Status: Bad Request"); echo "Failed to connect to DB: $conn->connect_error\n"; exit; } $headers = getallheaders(); if (isset($headers["If-Modified-Since"])) { $lastmodcheck = strtotime($headers["If-Modified-Since"]); if ($lastmodcheck >= $last_run_timestamp) { header("HTTP/1.0 304 Not Modified"); exit; } } if ( strpos($_GET['p'], '/') !== 0 ) { header("HTTP/1.1 400 Bad Request"); header("Status: Bad Request"); echo "Invalid path spec"; exit; } $paths = explode(';', $_GET['p']); if (count($paths) == 1) { $path = explode('/', $paths[0]); array_shift($path); if (count($path) > 1 && $path[0] != "") { $cond = "course = '" . implode("", $path) . "'"; } else { $cond = "TRUE"; } } else { $names = array(); $cond = ""; foreach ($paths as $p) { $path = explode('/', $p); array_shift($path); if (count($path) == 1 && $path[0] == "") { continue; } if ($cond !== "") $cond .= " OR\n"; $cond .= "course = '" . implode("", $path) . "'"; } } $result_array = array(); if (true) { define("CF_SUBJECT" ,0); define("CF_COURSE" ,0); define("CF_TITLE" ,1); define("CF_CREDITS" ,2); //define("CF_SECTIONS" ,3); //define("CF_CRSID" ,0); /* struct { const char* course; const char* title; float credits; struct { const char* course; const char* section; short callnr; const char* seats; const char* instructor; bool online; bool honors; const char* comments; const char* alt_title; const void* slots; } sections[1]; }; */ define("SF_COURSE" ,0); define("SF_SECTION" ,1); define("SF_CALLNR" ,2); //define("SF_ENROLLED" ,3); //define("SF_CAPACITY" ,4); define("SF_SEATS" ,3); define("SF_INSTRUCTOR" ,4); define("SF_ONLINE" ,5); define("SF_HONORS" ,6); //define("SF_FLAGS" ,7); define("SF_COMMENTS" ,7); define("SF_ALT_TITLE" ,8); define("SF_SLOTS" ,9); define("SF_SUBJECT" ,10); } else { define("CF_CRSID", "_id"); define("CF_COURSE", "course"); define("CF_TITLE","title"); define("CF_CREDITS","credits"); define("CF_SECTIONS","sections"); define("SF_SUBJECT","subject"); define("SF_COURSE","course"); define("SF_SECTION","section"); define("SF_CALLNR","callnr"); define("SF_ENROLLED", "enrolled"); define("SF_CAPACITY", "capacity"); define("SF_SEATS","seats"); define("SF_INSTRUCTOR","instructor"); define("SF_ONLINE","online"); define("SF_HONORS","honors"); define("SF_FLAGS","flags"); define("SF_COMMENTS","comments"); define("SF_ALT_TITLE","alt_title"); define("SF_SLOTS", "slots"); } $query = <<<_ SELECT course, title, credits, callnr, flags, section, enrolled, capacity, instructor, comments FROM NX_COURSE WHERE ($cond) _; $res = $conn->query($query); if ( !$res ) { header("HTTP/1.1 400 Bad Request"); header("Status: Bad Request"); echo "MySQL Query Failed: $conn->error"; exit; } $num_sects = $res->num_rows; class Flags { const ONLINE = 1; const HONORS = 2; const ST = 4; const CANCELLED = 8; }; $map = array(); $ctable = array(); $result = array(); $secFields = array(SF_INSTRUCTOR, SF_COMMENTS, SF_ALT_TITLE); $callnrToSlots = array(); while ($row = $res->fetch_row()) { if (!isset($ctable[$row[0]])) { $ctable[$row[0]] = array(); $arr = &$ctable[$row[0]]; $arr[CF_COURSE] = $row[0]; $arr[CF_TITLE] = $row[1]; $arr[CF_CREDITS] = floatval($row[2]); if (defined("CF_SECTIONS")) $arr[CF_SECTIONS] = array(); } else { $arr = &$ctable[$row[0]]; } if (defined("CF_SECTIONS")) { $map[$row[3]] = array($row[0], count($arr[CF_SECTIONS])); } else { $map[$row[3]] = array($row[0], count($arr) - 3); } $sec = array(); $sec[SF_COURSE] = $row[0]; $sec[SF_SECTION] = $row[5]; $sec[SF_CALLNR] = intval($row[3]); if (defined("SF_ENROLLED")) { $sec[SF_ENROLLED] = intval($row[6]); $sec[SF_CAPACITY] = intval($row[7]); } else { $sec[SF_SEATS] = "$row[6] / $row[7]"; } $sec[SF_INSTRUCTOR] = $row[8]; if (defined("SF_FLAGS")) { $sec[SF_FLAGS] = intval($row[4]); } else { $sec[SF_ONLINE] = ($row[4] & Flags::ONLINE) != 0; $sec[SF_HONORS] = ($row[4] & Flags::HONORS) != 0; } $sec[SF_COMMENTS] = $row[9]; $sec[SF_ALT_TITLE] = $row[1]; $sec[SF_SLOTS] = array(); $callnrToSlots[$sec[SF_CALLNR]] = &$sec[SF_SLOTS]; if (defined("CF_SECTIONS")) $arr[CF_SECTIONS][] = $sec; else $arr[] = $sec; //$data[] = &$arr; } if (count($map) > 0) { //$in_cond = 'callnr=' . implode(' OR callnr=', array_keys($map)); $in_cond = implode(',', array_keys($map)); $query = <<<_ SELECT DISTINCT callnr, day, TIME_TO_SEC(start), TIME_TO_SEC(end), room FROM TIMESLOT WHERE callnr IN ($in_cond) _; $res = $conn->query($query) or die("abc: $conn->error\nQuery: $query"); while ($row = $res->fetch_row()) { $callnrToSlots[$row[0]][] = array( /*"day" => */intval($row[1]), /*"start" => */intval($row[2]), /*"end" => */intval($row[3]), /*"location" => */trim($row[4]) ); } } $data = array_values($ctable); unset($ctable); unset($map); if (!defined("INTERNAL")) { header("Content-Type: application/x-javascript"); header("Cache-Control: no-cache, private, must-revalidate"); header("Last-Modified: " . gmdate("D, d M Y H:i:s", $last_run_timestamp). " GMT"); if (!isset($_SERVER['<API key>'])) { echo "var COURSE_DATA = "; } // echo json_encode(array("data" => &$data, "t" => microtime(true) - $t_start, "n" => $num_sects)); echo json_encode($data); /* foreach($data as $row) { $sects = $row[CF_SECTIONS]; $row[CF_SECTIONS] = array(); //unset($row[CF_SECTIONS]); echo "db.courses.insert( " . json_encode($row) . " );\n"; echo "db.courses.ensureIndex({course:1});\n"; foreach($sects as $sec) { foreach ($secFields as $nullable) { if (!$sec[$nullable]) { unset($sec[$nullable]); } } if (count($sec[SF_SLOTS]) == 0) unset($sec[SF_SLOTS]); else foreach($sec[SF_SLOTS] as &$slot) { if ($slot["location"] == "") { unset($slot["location"]); } } echo "db.courses.update( { course:'" . $row[CF_COURSE] . "'}, { \$push: { " . CF_SECTIONS . ":". json_encode($sec) . " } } );\n"; } } */ } ?>
#ifndef <API key> #define <API key> #include "<API key>.h" #include "deletebotrequest.h" namespace QtAws { namespace <API key> { class DeleteBotRequest; class <API key> : public <API key> { public: <API key>(const <API key>::Action action, DeleteBotRequest * const q); <API key>(const <API key> &other, DeleteBotRequest * const q); private: Q_DECLARE_PUBLIC(DeleteBotRequest) }; } // namespace <API key> } // namespace QtAws #endif
#include <rlib/rbinfmt.h> static void dump_opt_hdr (RPeOptHdr * opt) { r_print ("\tLinkerVer: %u.%u\n", opt->major_linker_ver, opt->minor_linker_ver); r_print ("\tEntrypoint: 0x%.8x\n", opt->addr_entrypoint); r_print ("\tCode addr: 0x%.8x\n", opt->base_code); r_print ("\tCode size: 0x%.8x\n", opt->size_code); } static void dump_pe32_image (RPe32ImageHdr * img) { dump_opt_hdr (&img->opt); r_print ("\tImage base: 0x%.8x\n", img->winopt.image_base); r_print ("\tSect align: 0x%.8x\n", img->winopt.section_alignment); r_print ("\tFile align: 0x%.8x\n", img->winopt.file_alignment); r_print ("\tImage size: 0x%.8x\n", img->winopt.size_image); r_print ("\tHeaders size: 0x%.8x\n", img->winopt.size_headers); r_print ("\tOS ver: %u.%u\n", img->winopt.major_os_ver, img->winopt.minor_os_ver); r_print ("\tImage ver: %u.%u\n", img->winopt.major_image_ver, img->winopt.minor_image_ver); r_print ("\tSubSys ver: %u.%u\n", img->winopt.major_subsystem_ver, img->winopt.minor_subsystem_ver); r_print ("\tSubSys: %.4x\n", img->winopt.subsystem); r_print ("\tChecksum: 0x%.8x\n", img->winopt.checksum); r_print ("\tDLL flags: 0x%.4x\n", img->winopt.dll_characteristics); r_print ("\tLoader flags: 0x%.8x\n", img->winopt.loader_flags); r_print ("\tStack: 0x%.8x (res) 0x%.8x (commit)\n", img->winopt.size_stack_reserve, img->winopt.size_stack_commit); r_print ("\tHeap: 0x%.8x (res) 0x%.8x (commit)\n", img->winopt.size_stack_reserve, img->winopt.size_stack_commit); } static void dump_pe32p_image (RPe32PlusImageHdr * img) { dump_opt_hdr (&img->opt); r_print ("\tImage base: 0x%.12"RINT64_MODIFIER"x\n", img->winopt.image_base); r_print ("\tSect align: 0x%.8x\n", img->winopt.section_alignment); r_print ("\tFile align: 0x%.8x\n", img->winopt.file_alignment); r_print ("\tImage size: 0x%.8x\n", img->winopt.size_image); r_print ("\tHeaders size: 0x%.8x\n", img->winopt.size_headers); r_print ("\tOS ver: %u.%u\n", img->winopt.major_os_ver, img->winopt.minor_os_ver); r_print ("\tImage ver: %u.%u\n", img->winopt.major_image_ver, img->winopt.minor_image_ver); r_print ("\tSubSys ver: %u.%u\n", img->winopt.major_subsystem_ver, img->winopt.minor_subsystem_ver); r_print ("\tSubSys: %.4x\n", img->winopt.subsystem); r_print ("\tChecksum: 0x%.8x\n", img->winopt.checksum); r_print ("\tDLL flags: 0x%.4x\n", img->winopt.dll_characteristics); r_print ("\tLoader flags: 0x%.8x\n", img->winopt.loader_flags); r_print ("\tStack: 0x%.12"RINT64_MODIFIER"x (res) 0x%.12"RINT64_MODIFIER"x (commit)\n", img->winopt.size_stack_reserve, img->winopt.size_stack_commit); r_print ("\tHeap: 0x%.12"RINT64_MODIFIER"x (res) 0x%.12"RINT64_MODIFIER"x (commit)\n", img->winopt.size_stack_reserve, img->winopt.size_stack_commit); } static void dump_section (RPeParser * parser, RPeSectionHdr * sec) { r_print ("\tSection: '%s'\n", sec->name); r_print ("\t\tvmsize: 0x%.8x\n", sec->vmsize); r_print ("\t\tvmaddr: 0x%.8x\n", sec->vmaddr); r_print ("\t\tSize: 0x%.8x\n", sec->size_raw_data); r_print ("\t\tOffset: 0x%.8x\n", sec->ptr_raw_data); r_print ("\t\tReloc: 0x%.8x\n", sec->ptr_relocs); r_print ("\t\tReloc#: %u\n", sec->nrelocs); r_print ("\t\tLinenum: 0x%.8x\n", sec->ptr_linenos); r_print ("\t\tLinenum#: %u\n", sec->nlinenos); r_print ("\t\tFlags: 0x%.8x\n", sec->characteristics); } int main (int argc, char ** argv) { RPeParser * parser; RPeSectionHdr * sec; RPe32ImageHdr * pe32; RPe32PlusImageHdr * pe32p; ruint16 i; if (argc < 2) { r_printerr ("Usage: %s <filename>\n", argv[0]); return -1; } else if ((parser = r_pe_parser_new (argv[1])) == NULL) { r_printerr ("Unable to parse '%s' as Mach-O\n", argv[1]); return -1; } switch (<API key> (parser)) { case R_PE_PE32_MAGIC: r_print ("PE32\n"); break; case R_PE_PE32PLUS_MAGIC: r_print ("PE32+\n"); break; default: r_print ("Unknown PE format\n"); return -1; } r_print ("\tMachine: %s\n", r_pe_machine_str (<API key> (parser))); r_print ("\tSections: %u\n", <API key> (parser)); r_print ("\tSymbols: %u\n", <API key> (parser)); r_print ("\tFlags: 0x%.4x\n\n", <API key> (parser)); if ((pe32 = <API key> (parser)) != NULL) dump_pe32_image (pe32); if ((pe32p = <API key> (parser)) != NULL) dump_pe32p_image (pe32p); r_print ("\nSections\n"); for (i = 0; (sec = <API key> (parser, i)) != NULL; i++) dump_section (parser, sec); return 0; }
<?php return array( 'code' => 'ANG', 'sign' => 'f', 'sign_position' => 0, 'sign_delim' => '', 'title' => 'Netherlands Antillean guilder', 'name' => array( array('', ''), 'NAƒ', 'NAf', 'ƒ', ), 'frac_name' => array( array('cent', 'cents'), ) );
# encoding: utf-8 from __future__ import absolute_import, unicode_literals from apiview.model import AbstractUserMixin, BaseModel from django.contrib.auth.base_user import AbstractBaseUser from django.db import models class User(AbstractUserMixin, BaseModel, AbstractBaseUser): is_staff = False def get_short_name(self): return self.name def get_full_name(self): return self.nickname USERNAME_FIELD = 'username' username = models.CharField('', unique=True, max_length=64, editable=False, null=False, blank=False) password = models.CharField('', max_length=128, unique=True, editable=False, null=False, blank=True) nickname = models.CharField('', unique=True, max_length=64, editable=False, null=False, blank=False) class Meta: db_table = 'example_user' app_label = 'example_app' verbose_name = verbose_name_plural = ""
-- SETTINGS <API key> = 3 NEW_STYLE_WIRES = true -- true = new nodebox wires, false = old raillike wires <API key> = 0.1 <API key> = 6 PISTON_MAXIMUM_PUSH = 15 <API key> = 100
#include "<API key>.h" #include "util/File.h" #include "QtTextureLoader.h" /** * @brief For tracking memory leaks under windows using the crtdbg */ #if ( defined( _DEBUG ) || defined( DEBUG ) ) && defined( _MSC_VER ) #define _CRTDBG_MAP_ALLOC #include <crtdbg.h> #define DEBUG_NEW new( _NORMAL_BLOCK, __FILE__, __LINE__ ) #define new DEBUG_NEW #endif Etoile::EPlugin* <API key>() { return new Etoile::<API key>("ImageToTexture"); } namespace Etoile { <API key>::<API key>(const std::string& name) : StringInputSocket(name) { } void <API key>::perform(std::string* signal) { if(signal == NULL) return; <API key>* plugin = (<API key>*)(this->getNode()); plugin->openFile(*signal); } void <API key>::retrieve(std::string* signal) { <API key>* plugin = (<API key>*)(this->getNode()); plugin->openFile(""); } <API key>::<API key>(const std::string& name) : TextureOutputSocket(name) { } <API key>::<API key>(const std::string& name): EPlugin(), SocketNode() { this->getType()._description = "ImageToTexture"; this->getType()._name = name; this->getType()._w = 80; this->getType()._h = 60; this->getType()._color._r = 120; this->getType()._color._g = 240; this->getType()._color._b = 250; this->getType()._color._a = 240; _pInput = new <API key>(); this->addInputSocket(_pInput); _pOutput = new <API key>(); this->addOutputSocket(_pOutput); } <API key>::~<API key>() { } void <API key>::openFile(const std::string& filename) { if(filename.empty()) return; std::string ext = File::getFileExtension(filename); Mesh *mesh = new Mesh(filename); QtTextureLoader textureloader; Texture* t = textureloader.loadFromFile(filename); _pOutput->set(t); _pOutput->signalEmit(t); } }
package vitro.vspEngine.service.common.abstractservice.dao; import javax.persistence.EntityManager; import vitro.vspEngine.logic.model.Gateway; import vitro.vspEngine.service.common.abstractservice.model.ServiceInstance; import vitro.vspEngine.service.persistence.DBRegisteredGateway; import java.util.List; public class GatewayDAO { private static GatewayDAO instance = new GatewayDAO(); private GatewayDAO(){ super(); } public static GatewayDAO getInstance(){ return instance; } /** * * @param manager * @param incId the incremental auto id in the db * @return */ public DBRegisteredGateway getGatewayByIncId(EntityManager manager, int incId){ DBRegisteredGateway dbRegisteredGateway = manager.find(DBRegisteredGateway.class, incId); return dbRegisteredGateway; } /** * * @param manager * @param name the gateway (registered) name * @return */ public DBRegisteredGateway getGateway(EntityManager manager, String name){ StringBuffer sb = new StringBuffer(); sb.append("SELECT g "); sb.append("FROM DBRegisteredGateway g "); sb.append("WHERE g.registeredName = :gname "); DBRegisteredGateway result = manager.createQuery(sb.toString(), DBRegisteredGateway.class). setParameter("gname", name). getSingleResult(); return result; } public List<DBRegisteredGateway> getInstanceList(EntityManager manager){ List<DBRegisteredGateway> result = manager.createQuery("SELECT instance FROM DBRegisteredGateway instance", DBRegisteredGateway.class).getResultList(); return result; } }
package org.teaminfty.math_dragon.view.math.source.operation; import static org.teaminfty.math_dragon.view.math.Expression.lineWidth; import org.teaminfty.math_dragon.view.math.Empty; import org.teaminfty.math_dragon.view.math.source.Expression; import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.Path; import android.graphics.Rect; /** A class that represents a source for new {@link Root}s in the drag-and-drop interface */ public class Root extends Expression { /** The paint we use to draw the operator */ private Paint paintOperator = new Paint(); /** Default constructor */ public Root() { // Initialise the paint paintOperator.setStyle(Paint.Style.STROKE); paintOperator.setAntiAlias(true); } @Override public org.teaminfty.math_dragon.view.math.Expression createMathObject() { return new org.teaminfty.math_dragon.view.math.operation.binary.Root(); } @Override public void draw(Canvas canvas, int w, int h) { // The width of the gap between the big box and the small box final int gapWidth = (int) (3 * lineWidth); // Get a boxes that fit the given width and height (we'll use it to draw the empty boxes) // We'll want one big and one small (2/3 times the big one) box Rect bigBox = getRectBoundingBox(3 * (w - gapWidth) / 5, 3 * h / 4, Empty.RATIO); Rect smallBox = getRectBoundingBox(2 * (w - gapWidth) / 5, 2 * h / 4, Empty.RATIO); // Position the boxes smallBox.offsetTo((w - bigBox.width() - smallBox.width() - gapWidth) / 2, (h - bigBox.height() - smallBox.height() / 2) / 2); bigBox.offsetTo(smallBox.right + gapWidth, smallBox.centerY()); // Draw the boxes drawEmptyBox(canvas, bigBox); drawEmptyBox(canvas, smallBox); // Create a path for the operator Path path = new Path(); path.moveTo(smallBox.left, smallBox.bottom + 2 * lineWidth); path.lineTo(smallBox.right - 2 * lineWidth, smallBox.bottom + 2 * lineWidth); path.lineTo(smallBox.right + 1.5f * lineWidth, bigBox.bottom - lineWidth / 2); path.lineTo(smallBox.right + 1.5f * lineWidth, bigBox.top - 2 * lineWidth); path.lineTo(bigBox.right, bigBox.top - 2 * lineWidth); // Draw the operator paintOperator.setStrokeWidth(lineWidth); canvas.drawPath(path, paintOperator); } }
js.Offset = function(rawptr) { this.rawptr = rawptr; } js.Offset.prototype = new konoha.Object(); js.Offset.prototype._new = function(rawptr) { this.rawptr = rawptr; } js.Offset.prototype.getTop = function() { return this.rawptr.top; } js.Offset.prototype.getLeft = function() { return this.rawptr.left; } js.jquery = {}; var initJQuery = function() { var verifyArgs = function(args) { for (var i = 0; i < args.length; i++) { if (args[i].rawptr) { args[i] = args[i].rawptr; } } return args; } var jquery = function(rawptr) { this.rawptr = rawptr; } jquery.prototype = new konoha.Object(); jquery.konohaclass = "js.jquery.JQuery"; /* Selectors */ jquery.prototype.each_ = function(callback) { this.rawptr.each(callback.rawptr); } jquery.prototype.size = function() { return this.rawptr.size(); } jquery.prototype.getSelector = function() { return new konoha.String(this.rawptr.getSelector()); } jquery.prototype.getContext = function() { return new js.dom.Node(this.rawptr.getContext()); } jquery.prototype.getNodeList = function() { return new js.dom.NodeList(this.rawptr.get()); } jquery.prototype.getNode = function(index) { return new js.dom.Node(this.rawptr.get(index)); } /* Attributes */ jquery.prototype.getAttr = function(arg) { return new konoha.String(this.rawptr.attr(arg.rawptr)); } jquery.prototype.attr = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); return new jquery(this.rawptr.attr.apply(this.rawptr, args)); } jquery.prototype.removeAttr = function(name) { return new jquery(this.rawptr.removeAttr(name.rawptr)); } jquery.prototype.addClass = function(className) { return new jquery(this.rawptr.addClass(className.rawptr)); } jquery.prototype.removeClass = function(className) { return new jquery(this.rawptr.removeClass(className.rawptr)); } jquery.prototype.toggleClass = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); return new jquery(this.rawptr.toggleClass.apply(this.rawptr, args)); } jquery.prototype.getHTML = function() { return new konoha.String(this.rawptr.html()); } jquery.prototype.html = function(val) { return new jquery(this.rawptr.html(val.rawptr)); } jquery.prototype.getText = function() { return new konoha.String(this.rawptr.text()); } jquery.prototype.text = function(val) { return new jquery(this.rawptr.text(val.rawptr)); } jquery.prototype.getVal = function() { return new konoha.Array(this.rawptr.val()) } jquery.prototype.val = function(val) { return new jquery(this.rawptr.val(val.rawptr)); } /* Traversing */ jquery.prototype.eq = function(position) { return new jquery(this.rawptr.eq(position)); } jquery.prototype.filter = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); return new jquery(this.rawptr.filter.apply(this.rawptr, args)); } jquery.prototype.is = function(expr) { return this.rawptr.is(expr.rawptr); } jquery.prototype.opnot = function(expr) { return this.rawptr.not(expr.rawptr); } jquery.prototype.slice = function() { return new jquery(this.rawptr.slice.apply(this.rawptr, Array.prototype.slice.call(arguments))); } jquery.prototype.add = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); return new jquery(this.rawptr.add.apply(this.rawptr, args)); } jquery.prototype.children = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); return new jquery(this.rawptr.children.apply(this.rawptr, args)); } jquery.prototype.closest = function() { var args =verifyArgs(Array.prototype.slice.call(arguments)); return new jquery(this.rawptr.closest.apply(this.rawptr, args)); } jquery.prototype.contents = function() { return new jquery(this.rawptr.contents()); } jquery.prototype.find = function(expr) { return new jquery(this.rawptr.find(expr.rawptr)); } jquery.prototype.next = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); return new jquery(this.rawptr.next.apply(this.rawptr, args)); } jquery.prototype.nextAll = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); return new jquery(this.rawptr.nextAll.apply(this.rawptr, args)); } jquery.prototype.parent = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); return new jquery(this.rawptr.parent.apply(this.rawptr, args)); } jquery.prototype.parents = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); return new jquery(this.rawptr.parents.apply(this.rawptr, args)); } jquery.prototype.prev = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); return new jquery(this.rawptr.prev.apply(this.rawptr, args)); } jquery.prototype.prevAll = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); return new jquery(this.rawptr.prevAll.apply(this.rawptr, args)); } jquery.prototype.siblings = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); return new jquery(this.rawptr.siblings.apply(this.rawptr, args)); } jquery.prototype.andSelf = function() { return new jquery(this.rawptr.andSelf()); } jquery.prototype.end = function() { return new jquery(this.rawptr.end()); } /* Manipulation */ jquery.prototype.append = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); return new jquery(this.rawptr.append.apply(this.rawptr, args)); } jquery.prototype.appendTo = function(content) { return new jquery(this.rawptr.appendTo(content.rawptr)); } jquery.prototype.prepend = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); return new jquery(this.rawptr.prepend.apply(this.rawptr, args)); } jquery.prototype.prependTo = function(content) { return new jquery(this.rawptr.prependTo(content.rawptr)); } jquery.prototype.after = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); return new jquery(this.rawptr.after.apply(this.rawptr, args)); } jquery.prototype.before = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); return new jquery(this.rawptr.before.apply(this.rawptr, args)); } jquery.prototype.insertAfter = function(content) { return new jquery(this.rawptr.insertAfter(content.rawptr)); } jquery.prototype.insertBefore = function(content) { return new jquery(this.rawptr.insertBefore(content.rawptr)); } jquery.prototype.wrap = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); return new jquery(this.rawptr.wrap.apply(this.rawptr, args)); } jquery.prototype.wrapAll = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); return new jquery(this.rawptr.wrapAll.apply(this.rawptr, args)); } jquery.prototype.wrapInner = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); return new jquery(this.rawptr.wrapInner.apply(this.rawptr, args)); } jquery.prototype.replaceWith = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); return new jquery(this.rawptr.replaceWith.apply(this.rawptr, args)); } jquery.prototype.replaceAll = function(selector) { return new jquery(this.rawptr.replaceAll(selector.rawptr)); } jquery.prototype.empty = function() { return new jquery(this.rawptr.empty()); } jquery.prototype.remove = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); return new jquery(this.rawptr.remove.apply(this.rawptr, args)); } jquery.prototype.clone = function() { return new jquery(this.rawptr.clone.apply(this.rawptr, Array.prototype.slice.call(arguments))); } /* CSS */ jquery.prototype.getCss = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); return new konoha.String(this.rawptr.css.apply(this.rawptr, args)); } jquery.prototype.css = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); return new jquery(this.rawptr.css.apply(this.rawptr, args)); } jquery.prototype.offset = function() { return new js.Offset(this.rawptr.offset()); } jquery.prototype.position = function() { return new js.Offset(this.rawptr.position()); } jquery.prototype.scrollTop = function() { return this.rawptr.scrollTop.apply(this.rawptr, Array.prototype.slice.call(arguments)); } jquery.prototype.scrollLeft = function() { return this.rawptr.scrollLeft.apply(this.rawptr, Array.prototype.slice.call(arguments)); } jquery.prototype.height = function() { return this.rawptr.height.apply(this.rawptr, Array.prototype.slice.call(arguments)); } jquery.prototype.width = function() { return this.rawptr.width.apply(this.rawptr, Array.prototype.slice.call(arguments)); } jquery.prototype.innerHeight = function() { return this.rawptr.innerHeight(); } jquery.prototype.innerWidth = function() { return this.rawptr.innerWidth(); } jquery.prototype.outerHeight = function() { return this.rawptr.outerHeight(); } jquery.prototype.outerWidth = function() { return this.rawptr.outerWidth(); } /* Events */ jquery.prototype.ready = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); return new jquery(this.rawptr.ready.apply(this.rawptr, args)); } jquery.prototype.bind = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); return new jquery(this.rawptr.bind.apply(this.rawptr, args)); } jquery.prototype.one = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); return new jquery(this.rawptr.one.apply(this.rawptr, args)); } jquery.prototype.trigger = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); return new jquery(this.rawptr.trigger.apply(this.rawptr, args)); } jquery.prototype.triggerHandler = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); return new jquery(this.rawptr.triggerHandler.apply(this.rawptr, args)); } jquery.prototype.unbind = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); return new jquery(this.rawptr.unbind.apply(this.rawptr, args)); } jquery.prototype.hover = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); return new jquery(this.rawptr.hover.apply(this.rawptr, args)); } jquery.prototype.toggleEvent = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); args = verifyArgs(args[0]); return new jquery(this.rawptr.toggle.apply(this.rawptr, args)); } jquery.prototype.live = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); return new jquery(this.rawptr.live.apply(this.rawptr, args)); } jquery.prototype.die = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); return new jquery(this.rawptr.die.apply(this.rawptr, args)); } jquery.prototype.blur = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); if (args.length == 0) { return new jquery(this.rawptr.blur.apply(this.rawptr, args)); } else { return new jquery(this.rawptr.blur(function(e) { args[0].apply(new js.dom.Element(this), [new js.jquery.JEvent(e)]); })); } } jquery.prototype.change = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); if (args.length == 0) { return new jquery(this.rawptr.change.apply(this.rawptr, args)); } else { return new jquery(this.rawptr.change(function(e) { args[0].apply(new js.dom.Element(this), [new js.jquery.JEvent(e)]); })); } } jquery.prototype.click = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); if (args.length == 0) { return new jquery(this.rawptr.click.apply(this.rawptr, args)); } else { return new jquery(this.rawptr.click(function(e) { args[0].apply(new js.dom.Element(this), [new js.jquery.JEvent(e)]); })); } } jquery.prototype.dblclick = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); if (args.length == 0) { return new jquery(this.rawptr.dblclick.apply(this.rawptr, args)); } else { return new jquery(this.rawptr.dblclick(function(e) { args[0].apply(new js.dom.Element(this), [new js.jquery.JEvent(e)]); })); } } jquery.prototype.error = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); if (args.length == 0) { return new jquery(this.rawptr.error.apply(this.rawptr, args)); } else { return new jquery(this.rawptr.error(function(e) { args[0].apply(new js.dom.Element(this), [new js.jquery.JEvent(e)]); })); } } jquery.prototype.focus = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); if (args.length == 0) { return new jquery(this.rawptr.focus.apply(this.rawptr, args)); } else { return new jquery(this.rawptr.focus(function(e) { args[0].apply(new js.dom.Element(this), [new js.jquery.JEvent(e)]); })); } } jquery.prototype.keydown = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); if (args.length == 0) { return new jquery(this.rawptr.keydown.apply(this.rawptr, args)); } else { return new jquery(this.rawptr.keydown(function(e) { args[0].apply(new js.dom.Element(this), [new js.jquery.JEvent(e)]); })); } } jquery.prototype.keypress = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); if (args.length == 0) { return new jquery(this.rawptr.keypress.apply(this.rawptr, args)); } else { return new jquery(this.rawptr.keypress(function(e) { args[0].apply(new js.dom.Element(this), [new js.jquery.JEvent(e)]); })); } } jquery.prototype.keyup = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); if (args.length == 0) { return new jquery(this.rawptr.keyup.apply(this.rawptr, args)); } else { return new jquery(this.rawptr.keyup(function(e) { args[0].apply(new js.dom.Element(this), [new js.jquery.JEvent(e)]); })); } } jquery.prototype.load = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); if (args.length == 0) { return new jquery(this.rawptr.load.apply(this.rawptr, args)); } else { return new jquery(this.rawptr.load(function(e) { args[0].apply(new js.dom.Element(this), [new js.jquery.JEvent(e)]); })); } } jquery.prototype.mousedown = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); if (args.length == 0) { return new jquery(this.rawptr.mousedown.apply(this.rawptr, args)); } else { return new jquery(this.rawptr.mousedown(function(e) { args[0].apply(new js.dom.Element(this), [new js.jquery.JEvent(e)]); })); } } jquery.prototype.mousemove = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); if (args.length == 0) { return new jquery(this.rawptr.mousemove.apply(this.rawptr, args)); } else { return new jquery(this.rawptr.mousemove(function(e) { args[0].apply(new js.dom.Element(this), [new js.jquery.JEvent(e)]); })); } } jquery.prototype.mouseout = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); if (args.length == 0) { return new jquery(this.rawptr.mouseout.apply(this.rawptr, args)); } else { return new jquery(this.rawptr.mouseout(function(e) { args[0].apply(new js.dom.Element(this), [new js.jquery.JEvent(e)]); })); } } jquery.prototype.mouseover = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); if (args.length == 0) { return new jquery(this.rawptr.mouseover.apply(this.rawptr, args)); } else { return new jquery(this.rawptr.mouseover(function(e) { args[0].apply(new js.dom.Element(this), [new js.jquery.JEvent(e)]); })); } } jquery.prototype.mouseup = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); if (args.length == 0) { return new jquery(this.rawptr.mouseup.apply(this.rawptr, args)); } else { return new jquery(this.rawptr.mouseup(function(e) { args[0].apply(new js.dom.Element(this), [new js.jquery.JEvent(e)]); })); } } jquery.prototype.resize = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); if (args.length == 0) { return new jquery(this.rawptr.resize.apply(this.rawptr, args)); } else { return new jquery(this.rawptr.resize(function(e) { args[0].apply(new js.dom.Element(this), [new js.jquery.JEvent(e)]); })); } } jquery.prototype.scroll = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); if (args.length == 0) { return new jquery(this.rawptr.scroll.apply(this.rawptr, args)); } else { return new jquery(this.rawptr.scroll(function(e) { args[0].apply(new js.dom.Element(this), [new js.jquery.JEvent(e)]); })); } } jquery.prototype.select = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); if (args.length == 0) { return new jquery(this.rawptr.select.apply(this.rawptr, args)); } else { return new jquery(this.rawptr.select(function(e) { args[0].apply(new js.dom.Element(this), [new js.jquery.JEvent(e)]); })); } } jquery.prototype.submit = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); if (args.length == 0) { return new jquery(this.rawptr.submit.apply(this.rawptr, args)); } else { return new jquery(this.rawptr.select(function(e) { args[0].apply(new js.dom.Element(this), [new js.jquery.JEvent(e)]); })); } } jquery.prototype.unload = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); if (args.length == 0) { return new jquery(this.rawptr.unload.apply(this.rawptr, args)); } else { return new jquery(this.rawptr.unload(function(e) { args[0].apply(new js.dom.Element(this), [new js.jquery.JEvent(e)]); })); } } /* Effects */ jquery.prototype.show = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); return new jquery(this.rawptr.show.apply(this.rawptr, args)); } jquery.prototype.hide = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); return new jquery(this.rawptr.hide.apply(this.rawptr, args)); } jquery.prototype.toggle = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); return new jquery(this.rawptr.toggle.apply(this.rawptr, args)); } jquery.prototype.slideDown = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); return new jquery(this.rawptr.slideDown.apply(this.rawptr, args)); } jquery.prototype.slideUp = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); return new jquery(this.rawptr.slideUp.apply(this.rawptr, args)); } jquery.prototype.slideToggle = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); return new jquery(this.rawptr.slideToggle.apply(this.rawptr, args)); } jquery.prototype.fadeIn = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); return new jquery(this.rawptr.fadeIn.apply(this.rawptr, args)); } jquery.prototype.fadeOut = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); return new jquery(this.rawptr.fadeOut.apply(this.rawptr, args)); } jquery.prototype.fadeTo = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); return new jquery(this.rawptr.fadeTo.apply(this.rawptr, args)); } jquery.prototype._new = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); if (arguments.length == 1) { this.rawptr = new $(args[0]); } else if (arguments.length == 2) { this.rawptr = new $(args[0], args[1]); } else { throw ("Script !!"); } return this; } return jquery; } js.jquery.JQuery = new initJQuery(); js.jquery.JEvent = new function() { var jevent = function(rawptr) { this.rawptr = rawptr; } jevent.prototype = new konoha.Object(); jevent.konohaclass = "js.jquery.JEvent"; jevent.prototype.type = function() { return new konoha.String(this.rawptr.type); } jevent.prototype.target = function() { return new konoha.dom.Element(this.rawptr.target); } jevent.prototype.relatedTarget = function() { return new konoha.dom.Element(this.rawptr.relatedTarget); } jevent.prototype.currentTarget = function() { return new konoha.dom.Element(this.rawptr.currentTarget); } jevent.prototype.pageX = function() { return this.rawptr.pageX; } jevent.prototype.pageY = function() { return this.rawptr.pageY; } jevent.prototype.timeStamp = function() { return this.rawptr.timeStamp; } jevent.prototype.preventDefault = function() { return new jevent(this.rawptr.preventDefault()); } jevent.prototype.isDefaultPrevented = function() { return this.rawptr.isDefaultPrevented(); } jevent.prototype.stopPropagation = function() { return new jevent(this.rawptr.stopPropagation()); } jevent.prototype.<API key> = function() { return this.rawptr.<API key>(); } jevent.prototype.<API key> = function() { return new jevent(this.rawptr.<API key>()); } jevent.prototype.<API key> = function() { return this.rawptr.<API key>(); } jevent.prototype._new = function() { var args = verifyArgs(Array.prototype.slice.call(arguments)); if (arguments.length == 1) { this.rawptr = new $(args[0]); } else if (arguments.length == 2) { this.rawptr = new $(args[0], args[1]); } else { throw ("Script !!"); } return this; } return jevent; }();
package br.gov.serpro.infoconv.proxy.businesscontroller; import java.lang.reflect.Field; import java.util.ArrayList; import java.util.List; import javax.inject.Inject; import br.gov.frameworkdemoiselle.stereotype.BusinessController; import br.gov.serpro.infoconv.proxy.exception.<API key>; import br.gov.serpro.infoconv.proxy.exception.<API key>; import br.gov.serpro.infoconv.proxy.exception.<API key>; import br.gov.serpro.infoconv.proxy.exception.<API key>; import br.gov.serpro.infoconv.proxy.exception.InfraException; import br.gov.serpro.infoconv.proxy.exception.<API key>; import br.gov.serpro.infoconv.proxy.rest.dto.cnpj.Perfil1CNPJ; import br.gov.serpro.infoconv.proxy.rest.dto.cnpj.Perfil2CNPJ; import br.gov.serpro.infoconv.proxy.rest.dto.cnpj.Perfil3CNPJ; import br.gov.serpro.infoconv.proxy.util.InfoconvConfig; import br.gov.serpro.infoconv.ws.cnpj.ArrayOfCNPJPerfil1; import br.gov.serpro.infoconv.ws.cnpj.ArrayOfCNPJPerfil2; import br.gov.serpro.infoconv.ws.cnpj.ArrayOfCNPJPerfil3; import br.gov.serpro.infoconv.ws.cnpj.CNPJPerfil1; import br.gov.serpro.infoconv.ws.cnpj.CNPJPerfil2; import br.gov.serpro.infoconv.ws.cnpj.CNPJPerfil3; @BusinessController public class ConsultaCNPJBC { @Inject InfoconvConfig infoconv; private static final String CPF_CONSULTANTE = "79506240949"; private void verificarErros(final Object retorno) throws <API key>, <API key>, InfraException, <API key> { try { Class<?> c = retorno.getClass(); Field erroField = c.getDeclaredField("erro"); erroField.setAccessible(true); String erroMsg = (String) erroField.get(retorno); if (erroMsg.indexOf("ACS - Erro") > -1) { throw new <API key>(erroMsg); } else if (erroMsg.indexOf("CPJ - Erro 04") > -1) { throw new <API key>(erroMsg); } else if (erroMsg.indexOf("CPJ - Erro 02") > -1 || erroMsg.indexOf("CPJ - Erro 06") > -1 || erroMsg.indexOf("CPJ - Erro 11") > -1) { throw new <API key>(erroMsg); } else if (erroMsg.indexOf("CPJ - Erro 01") > -1 || erroMsg.indexOf("CPJ - Erro 03") > -1 || erroMsg.indexOf("CPJ - Erro 00") > -1 || erroMsg.indexOf("CPJ - Erro 08") > -1 || erroMsg.indexOf("CPJ - Erro 09") > -1) { throw new InfraException(erroMsg); } } catch (<API key> e) { e.printStackTrace(); } catch (SecurityException e) { e.printStackTrace(); } catch (<API key> e) { e.printStackTrace(); } catch (<API key> e) { e.printStackTrace(); } } /** * Baseado no perfil indicado monta uma lista generia com o tipo de CNPJ do * perfil como Object. * * @param listaCNPJs * @param perfil * @return * @throws <API key> * @throws InfraException * @throws <API key> * @throws <API key> * @throws <API key> */ public List<Object> <API key>(final String listaCNPJs, final String perfil) throws <API key>, <API key>, <API key>, InfraException, <API key> { List<Object> lista = new ArrayList<Object>(); String perfilUpper = perfil.toUpperCase(); if (perfil == null || "P1".equals(perfilUpper)) { ArrayOfCNPJPerfil1 p = infoconv.consultarCNPJSoap.consultarCNPJP1(listaCNPJs, CPF_CONSULTANTE); lista.addAll(p.getCNPJPerfil1()); } else if ("P1T".equals(perfilUpper)) { ArrayOfCNPJPerfil1 p = infoconv.consultarCNPJSoap.consultarCNPJP1T(listaCNPJs, CPF_CONSULTANTE); lista.addAll(p.getCNPJPerfil1()); } else if ("P2".equals(perfilUpper)) { ArrayOfCNPJPerfil2 p = infoconv.consultarCNPJSoap.consultarCNPJP2(listaCNPJs, CPF_CONSULTANTE); lista.addAll(p.getCNPJPerfil2()); } else if ("P2T".equals(perfilUpper)) { ArrayOfCNPJPerfil2 p = infoconv.consultarCNPJSoap.consultarCNPJP2T(listaCNPJs, CPF_CONSULTANTE); lista.addAll(p.getCNPJPerfil2()); } else if ("P3".equals(perfilUpper)) { ArrayOfCNPJPerfil3 p = infoconv.consultarCNPJSoap.consultarCNPJP3(listaCNPJs, CPF_CONSULTANTE); lista.addAll(p.getCNPJPerfil3()); } else if ("P3T".equals(perfilUpper)) { ArrayOfCNPJPerfil3 p = infoconv.consultarCNPJSoap.consultarCNPJP3T(listaCNPJs, CPF_CONSULTANTE); lista.addAll(p.getCNPJPerfil3()); } else { throw new <API key>(); } verificarErros(lista.get(0)); return lista; } /** * Consulta o webservice do infoconv ConsultarCNPJSoap/ConsultarCNPJP1 * * @param listaCNPJs * @return * @throws <API key> * @throws <API key> * @throws <API key> * @throws InfraException */ public List<Perfil1CNPJ> listarPerfil1(String listaCNPJs) throws <API key>, <API key>, <API key>, InfraException{ ArrayOfCNPJPerfil1 result = infoconv.consultarCNPJSoap.consultarCNPJP1(listaCNPJs, CPF_CONSULTANTE); verificarErros(result.getCNPJPerfil1().get(0)); List<Perfil1CNPJ> lista = new ArrayList<Perfil1CNPJ>(); for (CNPJPerfil1 perfil1 : result.getCNPJPerfil1()) { lista.add(new Perfil1CNPJ(perfil1)); } return lista; } /** * Consulta o webservice do infoconv ConsultarCNPJSoap/ConsultarCNPJP2 * * @param listaCNPJs * @return * @throws <API key> * @throws <API key> * @throws <API key> * @throws InfraException */ public List<Perfil2CNPJ> listarPerfil2(String listaCNPJs) throws <API key>, <API key>, <API key>, InfraException{ ArrayOfCNPJPerfil2 result = infoconv.consultarCNPJSoap.consultarCNPJP2(listaCNPJs, CPF_CONSULTANTE); verificarErros(result.getCNPJPerfil2().get(0)); List<Perfil2CNPJ> lista = new ArrayList<Perfil2CNPJ>(); for (CNPJPerfil2 perfil1 : result.getCNPJPerfil2()) { lista.add(new Perfil2CNPJ(perfil1)); } return lista; } /** * Consulta o webservice do infoconv ConsultarCNPJSoap/ConsultarCNPJP3 * * @param listaCNPJs * @return * @throws <API key> * @throws <API key> * @throws <API key> * @throws InfraException */ public List<Perfil3CNPJ> listarPerfil3(String listaCNPJs) throws <API key>, <API key>, <API key>, InfraException{ ArrayOfCNPJPerfil3 result = infoconv.consultarCNPJSoap.consultarCNPJP3(listaCNPJs, CPF_CONSULTANTE); verificarErros(result.getCNPJPerfil3().get(0)); List<Perfil3CNPJ> lista = new ArrayList<Perfil3CNPJ>(); for (CNPJPerfil3 perfil1 : result.getCNPJPerfil3()) { lista.add(new Perfil3CNPJ(perfil1)); } return lista; } }
// <auto-generated> // Dieser Code wurde von einem Tool generiert. // der Code erneut generiert wird. // </auto-generated> namespace ClickBot.Properties { [global::System.Runtime.CompilerServices.<API key>()] [global::System.CodeDom.Compiler.<API key>("Microsoft.VisualStudio.Editors.SettingsDesigner.<API key>", "10.0.0.0")] internal sealed partial class Settings : global::System.Configuration.<API key> { private static Settings defaultInstance = ((Settings)(global::System.Configuration.<API key>.Synchronized(new Settings()))); public static Settings Default { get { return defaultInstance; } } } }
#ifndef _ccr_algorithm_h_ #define _ccr_algorithm_h_ #include "algo_suite.h" #include "bvector.h" #include "prng.h" #include "sencode.h" /* * virtual interface definition for all cryptographic algorithm instances. * * Note that the whole class could be defined static, but we really enjoy * having the tiny virtual pointers stored in some cool structure along with * the handy algorithm name. */ class algorithm { public: virtual bool provides_signatures() = 0; virtual bool provides_encryption() = 0; virtual std::string get_alg_id() = 0; void register_into_suite (algorithm_suite&s) { s[this->get_alg_id()] = this; } /* * note that these functions should be ready for different * plaintext/ciphertext/message lengths, usually padding them somehow. */ virtual int encrypt (const bvector&plain, bvector&cipher, sencode* pubkey, prng&rng) { return -1; } virtual int decrypt (const bvector&cipher, bvector&plain, sencode* privkey) { return -1; } virtual int sign (const bvector&msg, bvector&sig, sencode** privkey, bool&dirty, prng&rng) { return -1; } virtual int verify (const bvector&sig, const bvector&msg, sencode* pubkey) { return -1; } virtual int create_keypair (sencode**pub, sencode**priv, prng&rng) { return -1; } }; #endif
package org.cristalise.kernel.lifecycle.instance.stateMachine; import lombok.Getter; import lombok.Setter; @Getter @Setter public class TransitionQuery { /** * Name & version of the query to be run by the agent during this transition */ String name, version; public TransitionQuery() {} public TransitionQuery(String n, String v) { name = n; version = v; } }
<?php namespace rocket\si\content\impl\iframe; use n2n\util\type\attrs\DataSet; use n2n\util\type\ArgUtils; use rocket\si\content\impl\InSiFieldAdapter; class IframeInSiField extends InSiFieldAdapter { private $iframeData; private $params = []; public function __construct(IframeData $iframeData) { $this->iframeData = $iframeData; } /** * @return string */ function getType(): string { return 'iframe-in'; } /** * @return array */ function getParams(): array { return $this->params; } /** * @param array $params * @return IframeInSiField */ function setParams(array $params) { ArgUtils::valArray($params, ['scalar', 'null']); $this->params = $params; return $this; } /** * {@inheritDoc} * @see \rocket\si\content\SiField::getData() */ function getData(): array { $data = $this->iframeData->toArray(); $data['params'] = $this->getParams(); $data['messages'] = $this->getMessageStrs(); return $data; } /** * {@inheritDoc} * @see \rocket\si\content\SiField::handleInput() */ function handleInput(array $data) { $ds = new DataSet($data); $this->params = $ds->reqScalarArray('params', false, true); } }
using System.Collections; using System.Linq; using System.Reflection; namespace System.ComponentModel.DataAnnotations { public class <API key> : ValidationAttribute { public <API key>(Type type, string <API key>) { this.type = type; method = type.GetMethod(<API key>, BindingFlags.Static | BindingFlags.Public); if (method != null) { if (method.ReturnType == typeof(bool)) { var pars = method.GetParameters(); if (pars.Count() != 2) throw new ArgumentException($"Method '{<API key>}' in type '{type.Name}' specified for this '{nameof(<API key>)}' must has 2 parameters. Both of them must be of type of property."); } else throw new ArgumentException($"Method '{<API key>}' in type '{type.Name}' specified for this '{nameof(<API key>)}' must return 'bool'."); } else throw new ArgumentException($"Method '{<API key>}' in type '{type.Name}' specified for this '{nameof(<API key>)}' was not found. This method must be public and static."); } Type type; MethodInfo? method; string? lastDuplicateValue; public override string FormatErrorMessage(string name) { return string.Format(ErrorMessageString, name, lastDuplicateValue); } public override bool IsValid(object? value) { if (value is IList list) { if (list.Count < 2) return true; for (int i = 1; i < list.Count; i++) { if ((bool?)method?.Invoke(null, new[] { list[i - 1], list[i] }) ?? false) { lastDuplicateValue = list[i]?.ToString(); return false; } } return true; } return false; } //public override bool <API key> => true; //protected override ValidationResult IsValid(object value, ValidationContext context) // if (value is IList list) // if (list.Count < 2) return ValidationResult.Success; // for (int i = 1; i < list.Count; i++) // if ((bool)method.Invoke(null, new[] { list[i - 1], list[i] })) // lastDuplicateValue = list[i].ToString(); // return new ValidationResult(string.Format(ErrorMessageString, context.DisplayName, list[i])); // return ValidationResult.Success; // return new ValidationResult("Value isn't IList"); } }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http: <html> <head> <title>Henon Map</title> <style type="text/css"> h1 {text-align: center} </style> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Style-Type" content="text/css"> <meta name="author" content="Mark Hale"> </head> <body> <h1>Henon Map</h1> <div align="center"> <object codetype="application/java" classid="java:HenonPlot.class" width=400 height=400> <param name="code" value="HenonPlot.class"> <param name="type" value="application/x-java-applet;version=1.3"> </object> </div> </body> </html> 
#include "NodoTipo.h" NodoTipo::NodoTipo(Tipo* obj) { setTipo(obj); setDer(NULL); setIzq(NULL); _listaISBN = new ListaISBN(); } NodoTipo*&NodoTipo::getIzq() { return _izq; } void NodoTipo::setIzq(NodoTipo* _izq) { this->_izq = _izq; } NodoTipo*& NodoTipo::getDer() { return _der; } void NodoTipo::setDer(NodoTipo* _der) { this->_der = _der; } Tipo* NodoTipo::getTipo()const { return _Tipo; } void NodoTipo::setTipo(Tipo* _Tipo) { this->_Tipo = _Tipo; } NodoTipo::~NodoTipo() { _listaISBN->destruir(); delete _listaISBN; delete _Tipo; } ListaISBN* NodoTipo::getListaISBN(){ return _listaISBN; } void NodoTipo::setListaISBN(ListaISBN* l){ _listaISBN = l; } void NodoTipo::agregarISBN(int isbn){ _listaISBN->Inserta(isbn); } bool NodoTipo::borrarISBN(int isbn){ return _listaISBN->borrar(isbn); } void NodoTipo::destruirISBN(){ _listaISBN->destruir(); } string NodoTipo::MostrarListaISBN(){ return _listaISBN->toString(); }
#!/bin/bash # RktCopyHosts # Function: RktCopyHosts # Params: $1 - Host's '/etc/hosts' location # $2 - Container's '/etc/hosts' location # Output: (Normal acbuild output) function RktCopyHosts { local HOSTS="/etc/hosts" local RKT_HOSTS="/etc/hosts" if [ "${1}" != "" ]; then HOSTS="${1}" fi if [ "${2}" != "" ]; then RKT_HOSTS="${2}" fi sudo ${ACBUILD} copy "${HOSTS}" "${RKT_HOSTS}" if [ "${?}" != "0" ]; then Error "Rkt_CopyHosts: Failed to copy '${HOSTS}' to 'rkt:${RKT_HOSTS}'." return 1 fi return 0 } # vim: tabstop=4 shiftwidth=4
// -*- Mode:C++ -*- #ifndef <API key> #define <API key> void init_OSGShader(void); #endif
<?php function qv_extension($maestro, $data, $prefix, $SYSID, $TYPOLOGYID, $oper){ global $babelcode, $babelparams, $global_cache; if($oper!=2){ // 0 insert, 1 update, 2 virtual delete, 3 delete $tabletypes=$prefix."TYPES"; $tableviews=$prefix."VIEWS"; if($t=_qv_cacheloader($maestro, $tabletypes, $TYPOLOGYID)){ $TABLENAME=$t["TABLENAME"]; $DELETABLE=$t["DELETABLE"]; unset($t); if($TABLENAME!=""){ if($oper==3){ if($DELETABLE) $sql="DELETE FROM $TABLENAME WHERE SYSID='$SYSID'"; else $sql="UPDATE $TABLENAME SET SYSID=NULL WHERE SYSID='$SYSID'"; if(!maestro_execute($maestro, $sql, false)){ $babelcode="QVERR_EXECUTE"; $trace=debug_backtrace(); $b_params=array("FUNCTION" => $trace[0]["function"] ); $b_pattern=$maestro->errdescr; throw new Exception( qv_babeltranslate($b_pattern, $b_params) ); } } elseif($DELETABLE || $oper==1){ if(isset($global_cache["$tableviews-$TYPOLOGYID"])){ // REPERISCO LE INFO DALLA CACHE $infos=$global_cache["$tableviews-$TYPOLOGYID"]; } else{ // REPERISCO LE INFO DAL DATABASE $infos=array(); maestro_query($maestro,"SELECT * FROM $tableviews WHERE TYPOLOGYID='$TYPOLOGYID'",$r); for($i=0;$i<count($r);$i++){ $FIELDTYPE=$r[$i]["FIELDTYPE"]; $TABLEREF=""; $NOTEMPTY=false; if(substr($FIELDTYPE,0,5)=="SYSID"){ $TABLEREF=substr($FIELDTYPE, 6, -1); if(substr($TABLEREF,0,1)==" $NOTEMPTY=true; $TABLEREF=substr($TABLEREF,1); } } $infos[$i]["FIELDNAME"]=$r[$i]["FIELDNAME"]; $infos[$i]["FIELDTYPE"]=$FIELDTYPE; $infos[$i]["FORMULA"]=$r[$i]["FORMULA"]; $infos[$i]["WRITABLE"]=intval($r[$i]["WRITABLE"]); $infos[$i]["TABLEREF"]=$TABLEREF; $infos[$i]["NOTEMPTY"]=$NOTEMPTY; } // INSERISCO LE INFO NELLA CACHE $global_cache["$tableviews-$TYPOLOGYID"]=$infos; } if(count($infos)>0 || $oper==0){ // Ci sono campi estensione oppure solo il SYSID in inserimento if($oper==0){ $columns="SYSID"; $values="'$SYSID'"; $helpful=true; } else{ $sets=""; $where="SYSID='$SYSID'"; $helpful=false; } $clobs=false; for($i=0;$i<count($infos);$i++){ $FIELDNAME=$infos[$i]["FIELDNAME"]; $FIELDTYPE=$infos[$i]["FIELDTYPE"]; $FORMULA=$infos[$i]["FORMULA"]; $WRITABLE=$infos[$i]["WRITABLE"]; $TABLEREF=$infos[$i]["TABLEREF"]; $NOTEMPTY=$infos[$i]["NOTEMPTY"]; if($WRITABLE){ // IL CAMPO PUO' ESSERE AGGIORNATO // DETERMINO IL NOME DEL CAMPO if($FORMULA=="") $ACTUALNAME=$FIELDNAME; else $ACTUALNAME=str_replace("$TABLENAME.", "", $FORMULA); // DETERMINO IL VALORE DEL CAMPO if(isset($data[$ACTUALNAME])){ // FORMATTAZIONE IN BASE AL TIPO if($TABLEREF!=""){ // SYSID(Tabella referenziata) $value=ryqEscapize($data[$ACTUALNAME]); if($value!=""){ // Controllo che esista l'oggetto con SYSID=$value nella tabella $TABLEREF qv_linkable($maestro, $TABLEREF, $value); } elseif($NOTEMPTY){ $babelcode="QVERR_EMPTYSYSID"; $trace=debug_backtrace(); $b_params=array("FUNCTION" => $trace[0]["function"], "ACTUALNAME" => $ACTUALNAME ); $b_pattern="Campo [{2}] obbligatorio"; throw new Exception( qv_babeltranslate($b_pattern, $b_params) ); } $value="'$value'"; } elseif($FIELDTYPE=="TEXT"){ $value=ryqNormalize($data[$ACTUALNAME]); qv_setclob($maestro, $ACTUALNAME, $value, $value, $clobs); } elseif(substr($FIELDTYPE, 0, 4)=="JSON"){ $value=ryqNormalize($data[$ACTUALNAME]); if(substr($FIELDTYPE, 0, 5)=="JSON("){ $len=intval(substr($FIELDTYPE, 5)); $value=substr($value, 0, $len); } if($value!=""){ if(!json_decode($value)){ $babelcode="QVERR_JSON"; $trace=debug_backtrace(); $b_params=array("FUNCTION" => $trace[0]["function"], "ACTUALNAME" => $ACTUALNAME ); $b_pattern="Documento JSON [{2}] non corretto o troppo esteso"; throw new Exception( qv_babeltranslate($b_pattern, $b_params) ); } } qv_setclob($maestro, $ACTUALNAME, $value, $value, $clobs); } else{ $value=ryqEscapize($data[$ACTUALNAME]); $value=qv_sqlize($value, $FIELDTYPE); } if($oper==0){ qv_appendcomma($columns, $ACTUALNAME); qv_appendcomma($values, $value); } else{ qv_appendcomma($sets,"$ACTUALNAME=$value"); $helpful=true; } } else{ if($oper==0){ if($NOTEMPTY){ $babelcode="QVERR_EMPTYSYSID"; $trace=debug_backtrace(); $b_params=array("FUNCTION" => $trace[0]["function"], "ACTUALNAME" => $ACTUALNAME ); $b_pattern="Campo [{2}] obbligatorio"; throw new Exception( qv_babeltranslate($b_pattern, $b_params) ); } $value=qv_sqlize("", $FIELDTYPE); qv_appendcomma($columns, $ACTUALNAME); qv_appendcomma($values, $value); } } } } unset($r); if($helpful){ if($oper==0) $sql="INSERT INTO $TABLENAME ($columns) VALUES($values)"; else $sql="UPDATE $TABLENAME SET $sets WHERE $where"; if(!maestro_execute($maestro, $sql, false, $clobs)){ $babelcode="QVERR_EXECUTE"; $trace=debug_backtrace(); $b_params=array("FUNCTION" => $trace[0]["function"] ); $b_pattern=$maestro->errdescr; throw new Exception( qv_babeltranslate($b_pattern, $b_params) ); } } } } } } } } function qv_sqlize($value, $FIELDTYPE){ $FIELDTYPE=strtoupper($FIELDTYPE); switch($FIELDTYPE){ case "INTEGER": $value=strval(intval($value)); break; case "RATIONAL": $value=strval(round(floatval($value),7)); break; case "DATE": if(strlen($value)<8) $value=LOWEST_DATE; $value="[:DATE($value)]"; break; case "TIMESTAMP": if(strlen($value)<8) $value=LOWEST_TIME; $value="[:TIME($value)]"; break; case "BOOLEAN": if(intval($value)!=0) $value="1"; else $value="0"; break; default: if(substr($FIELDTYPE, 0, 9)=="RATIONAL("){ $dec=intval(substr($FIELDTYPE, 9)); $value=strval(round(floatval($value), $dec)); } elseif(substr($FIELDTYPE, 0, 5)=="CHAR("){ $len=intval(substr($FIELDTYPE, 5)); $value="'".substr(qv_inputUTF8($value), 0, $len)."'"; } elseif(substr($value, 0, 2)!="[:" || substr($value, -1, 1)!="]"){ $value="'$value'"; } break; } return $value; } function _qv_historicizing($maestro, $prefix, $SYSID, $TYPOLOGYID, $oper){ global $global_quiveruserid, $global_quiverroleid; global $babelcode, $babelparams; $tablebase=$prefix."S"; $tabletypes=$prefix."TYPES"; if($t=_qv_cacheloader($maestro, $tabletypes, $TYPOLOGYID)){ if( intval($t["HISTORICIZING"]) ){ $TABLE=$t["VIEWNAME"]; if($TABLE==""){ $TABLE=$tablebase; } if($r=_qv_cacheloader($maestro, $TABLE, $SYSID)){ $clobs=false; $DATABAG=json_encode($r); qv_setclob($maestro, "DATABAG", $DATABAG, $DATABAG, $clobs); $HISTORYID=qv_createsysid($maestro); $DESCRIPTION=ryqEscapize($r["DESCRIPTION"]); $TIMEINSERT=qv_strtime($r["TIMEINSERT"]); $RECORDTIME=qv_strtime($r["TIMEUPDATE"]); if($RECORDTIME<$TIMEINSERT){ $RECORDTIME=$TIMEINSERT; } $RECORDTIME="[:TIME($RECORDTIME)]"; $EVENTTIME="[:NOW()]"; // PREDISPONGO COLONNE E VALORI DA REGISTRARE $columns="SYSID,RECORDID,DESCRIPTION,RECORDTIME,TABLEBASE,TYPOLOGYID,OPERTYPE,ROLEID,USERID,EVENTTIME,DATABAG"; $values="'$HISTORYID','$SYSID','$DESCRIPTION',$RECORDTIME,'$tablebase','$TYPOLOGYID','$oper','$global_quiverroleid','$global_quiveruserid',$EVENTTIME,$DATABAG"; $sql="INSERT INTO QVHISTORY($columns) VALUES($values)"; if(!maestro_execute($maestro, $sql, false, $clobs)){ $babelcode="QVERR_EXECUTE"; $trace=debug_backtrace(); $b_params=array("FUNCTION" => $trace[0]["function"] ); $b_pattern=$maestro->errdescr; throw new Exception( qv_babeltranslate($b_pattern, $b_params) ); } } } } } ?>
/* * SupplyTask.h - Tasks issued to SupplyManager. Basically, just * produce Supply Depots while nearing capacity. */ #pragma once #include "Task.h" class BuildTask: public Task { };
# -*- coding: utf-8 -*- # This file is part of a weboob module. # This weboob module is free software: you can redistribute it and/or modify # (at your option) any later version. # This weboob module is distributed in the hope that it will be useful, # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the from __future__ import unicode_literals import re from weboob.exceptions import <API key> from weboob.browser.pages import HTMLPage, JsonPage, pagination, LoggedPage from weboob.browser.elements import ListElement, ItemElement, TableElement, method from weboob.browser.filters.standard import CleanText, CleanDecimal, DateGuesser, Env, Field, Filter, Regexp, Currency, Date from weboob.browser.filters.html import Link, Attr, TableCell from weboob.capabilities.bank import Account, Investment from weboob.capabilities.base import NotAvailable from weboob.tools.capabilities.bank.transactions import FrenchTransaction from weboob.tools.compat import urljoin from weboob.tools.capabilities.bank.investments import is_isin_valid __all__ = ['LoginPage'] class UselessPage(HTMLPage): pass class <API key>(HTMLPage): def get_message(self): xpath = '//div[@class="bienvenueMdp"]/following-sibling::div' return '%s%s' % (CleanText(xpath + '/strong')(self.doc), CleanText(xpath, children=False)(self.doc)) class ErrorPage(HTMLPage): pass class SubscriptionPage(LoggedPage, JsonPage): pass class LoginPage(HTMLPage): pass class CMSOPage(HTMLPage): @property def logged(self): if len(self.doc.xpath('//b[text()="Session interrompue"]')) > 0: return False return True class AccountsPage(CMSOPage): TYPES = {'COMPTE CHEQUES': Account.TYPE_CHECKING, 'COMPTE TITRES': Account.TYPE_MARKET, "ACTIV'EPARGNE": Account.TYPE_SAVINGS, "TRESO'VIV": Account.TYPE_SAVINGS, } @method class iter_accounts(ListElement): item_xpath = '//div[has-class("groupe-comptes")]//li' class item(ItemElement): klass = Account class Type(Filter): def filter(self, label): for pattern, actype in AccountsPage.TYPES.items(): if label.startswith(pattern): return actype return Account.TYPE_UNKNOWN obj__history_url = Link('. obj_id = CleanText('.//span[has-class("numero-compte")]') & Regexp(pattern=r'(\d{3,}[\w]+)', default='') obj_label = CleanText('.//span[has-class("libelle")][1]') obj_currency = Currency('//span[has-class("montant")]') obj_balance = CleanDecimal('.//span[has-class("montant")]', replace_dots=True) obj_type = Type(Field('label')) # Last numbers replaced with XX... or we have to send sms to get RIB. obj_iban = NotAvailable # some accounts may appear on multiple areas, but the area where they come from is indicated obj__owner = CleanText('(./preceding-sibling::tr[@class="LnMnTiers"])[last()]') def validate(self, obj): if obj.id is None: obj.id = obj.label.replace(' ', '') return True def on_load(self): if self.doc.xpath('//p[contains(text(), "incident technique")]'): raise <API key>("Vous n'avez aucun compte sur cet espace. " \ "Veuillez choisir un autre type de compte.") class InvestmentPage(CMSOPage): def has_error(self): return CleanText('//span[@id="id_error_msg"]')(self.doc) @method class iter_accounts(ListElement): item_xpath = '//table[@class="Tb" and tr[1][@class="LnTit"]]/tr[@class="LnA" or @class="LnB"]' class item(ItemElement): klass = Account def obj_id(self): area_id = Regexp(CleanText('(./preceding-sibling::tr[@class="LnMnTiers"][1])//span[@class="CelMnTiersT1"]'), r'\((\d+)\)', default='')(self) acc_id = Regexp(CleanText('./td[1]'), r'(\d+)\s*(\d+)', r'\1\2')(self) if area_id: return '%s.%s' % (area_id, acc_id) return acc_id def obj__formdata(self): js = Attr('./td/a[1]', 'onclick', default=None)(self) if js is None: return args = re.search(r'\((.*)\)', js).group(1).split(',') form = args[0].strip().split('.')[1] idx = args[2].strip() idroot = args[4].strip().replace("'", "") return (form, idx, idroot) obj_url = Link('./td/a[1]', default=None) def go_account(self, form, idx, idroot): form = self.get_form(name=form) form['indiceCompte'] = idx form['idRacine'] = idroot form.submit() class CmsoTableElement(TableElement): head_xpath = '//table[has-class("Tb")]/tr[has-class("LnTit")]/td' item_xpath = '//table[has-class("Tb")]/tr[has-class("LnA") or has-class("LnB")]' class <API key>(CMSOPage): @method class iter_investments(CmsoTableElement): col_label = 'Valeur' col_code = 'Code' col_quantity = 'Qté' col_unitvalue = 'Cours' col_valuation = 'Valorisation' col_vdate = 'Date cours' class item(ItemElement): klass = Investment obj_label = CleanText(TableCell('label')) obj_quantity = CleanDecimal(TableCell('quantity'), replace_dots=True) obj_unitvalue = CleanDecimal(TableCell('unitvalue'), replace_dots=True) obj_valuation = CleanDecimal(TableCell('valuation'), replace_dots=True) obj_vdate = Date(CleanText(TableCell('vdate')), dayfirst=True, default=NotAvailable) def obj_code(self): if Field('label')(self) == "LIQUIDITES": return 'XX-liquidity' code = CleanText(TableCell('code'))(self) return code if is_isin_valid(code) else NotAvailable def obj_code_type(self): return Investment.CODE_TYPE_ISIN if is_isin_valid(Field('code')(self)) else NotAvailable class Transaction(FrenchTransaction): PATTERNS = [(re.compile(r'^RET DAB (?P<dd>\d{2})/?(?P<mm>\d{2})(/?(?P<yy>\d{2}))? (?P<text>.*)'), FrenchTransaction.TYPE_WITHDRAWAL), (re.compile(r'CARTE (?P<dd>\d{2})/(?P<mm>\d{2}) (?P<text>.*)'), FrenchTransaction.TYPE_CARD), (re.compile(r'^(?P<category>VIR(EMEN)?T? (SEPA)?(RECU|FAVEUR)?)( /FRM)?(?P<text>.*)'), FrenchTransaction.TYPE_TRANSFER), (re.compile(r'^PRLV (?P<text>.*)( \d+)?$'), FrenchTransaction.TYPE_ORDER), (re.compile(r'^(CHQ|CHEQUE) .*$'), FrenchTransaction.TYPE_CHECK), (re.compile(r'^(AGIOS /|FRAIS) (?P<text>.*)'), FrenchTransaction.TYPE_BANK), (re.compile(r'^(CONVENTION \d+ |F )?COTIS(ATION)? (?P<text>.*)'), FrenchTransaction.TYPE_BANK), (re.compile(r'^REMISE (?P<text>.*)'), FrenchTransaction.TYPE_DEPOSIT), (re.compile(r'^(?P<text>.*)( \d+)? QUITTANCE .*'), FrenchTransaction.TYPE_ORDER), (re.compile(r'^.* LE (?P<dd>\d{2})/(?P<mm>\d{2})/(?P<yy>\d{2})$'), FrenchTransaction.TYPE_UNKNOWN), (re.compile(r'^.* PAIEMENT (?P<dd>\d{2})/(?P<mm>\d{2}) (?P<text>.*)'), FrenchTransaction.TYPE_UNKNOWN), ] class <API key>(ItemElement): klass = Transaction def condition(self): return len(self.el) >= 5 and not self.el.get('id', '').startswith('libelleLong') class HistoryPage(CMSOPage): def get_date_range_list(self): return [d for d in self.doc.xpath('//select[@name="date"]/option/@value') if d] @pagination @method class iter_history(ListElement): item_xpath = '//div[contains(@class, "master-table")]//ul/li' def next_page(self): pager = self.page.doc.xpath('//div[@class="pager"]') if pager: # more than one page if only enough transactions assert len(pager) == 1 next_links = pager[0].xpath('./span/following-sibling::a[@class="page"]') if next_links: url_next_page = Link('.')(next_links[0]) url_next_page = urljoin(self.page.url, url_next_page) return self.page.browser.build_request(url_next_page) class item(<API key>): def date(selector): return DateGuesser(Regexp(CleanText(selector), r'\w+ (\d{2}/\d{2})'), Env('date_guesser')) | Transaction.Date(selector) # CAUTION: this website write a 'Date valeur' inside a div with a class == 'c-ope' # so actually i assume 'c-val' class is the real operation date and 'c-ope' is value date obj_date = date('./div[contains(@class, "c-val")]') obj_vdate = date('./div[contains(@class, "c-ope")]') obj_raw = Transaction.Raw(Regexp(CleanText('./div[contains(@class, "c-libelle-long")]'), r'Libellé étendu (.+)')) obj_amount = Transaction.Amount('./div[contains(@class, "c-credit")]', './div[contains(@class, "c-debit")]') class UpdateTokenMixin(object): def on_load(self): if 'Authentication' in self.response.headers: self.browser.token = self.response.headers['Authentication'].split(' ')[-1] class SSODomiPage(JsonPage, UpdateTokenMixin): def get_sso_url(self): return self.doc['urlSSO'] class AuthCheckUser(HTMLPage): pass
// Created file "Lib\src\Uuid\tapi3if_i" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(IID_ITStreamControl, 0xee3bd604, 0x3868, 0x11d2, 0xa0, 0x45, 0x00, 0xc0, 0x4f, 0xb6, 0x80, 0x9f);
package gomaasapi import "github.com/juju/utils/set" const ( // Capability constants. NetworksManagement = "networks-management" StaticIPAddresses = "static-ipaddresses" <API key> = "<API key>" DevicesManagement = "devices-management" <API key> = "<API key>" <API key> = "<API key>" ) // Controller represents an API connection to a MAAS Controller. Since the API // is restful, there is no long held connection to the API server, but instead // HTTP calls are made and JSON response structures parsed. type Controller interface { // Capabilities returns a set of capabilities as defined by the string // constants. Capabilities() set.Strings BootResources() ([]BootResource, error) // Fabrics returns the list of Fabrics defined in the MAAS controller. Fabrics() ([]Fabric, error) // Spaces returns the list of Spaces defined in the MAAS controller. Spaces() ([]Space, error) // Zones lists all the zones known to the MAAS controller. Zones() ([]Zone, error) // Machines returns a list of machines that match the params. Machines(MachinesArgs) ([]Machine, error) // AllocateMachine will attempt to allocate a machine to the user. // If successful, the allocated machine is returned. AllocateMachine(AllocateMachineArgs) (Machine, ConstraintMatches, error) // ReleaseMachines will stop the specified machines, and release them // from the user making them available to be allocated again. ReleaseMachines(ReleaseMachinesArgs) error // Devices returns a list of devices that match the params. Devices(DevicesArgs) ([]Device, error) // CreateDevice creates and returns a new Device. CreateDevice(CreateDeviceArgs) (Device, error) // Files returns all the files that match the specified prefix. Files(prefix string) ([]File, error) // Return a single file by its filename. GetFile(filename string) (File, error) // AddFile adds or replaces the content of the specified filename. // If or when the MAAS api is able to return metadata about a single // file without sending the content of the file, we can return a File // instance here too. AddFile(AddFileArgs) error } // File represents a file stored in the MAAS controller. type File interface { // Filename is the name of the file. No path, just the filename. Filename() string // AnonymousURL is a URL that can be used to retrieve the conents of the // file without credentials. AnonymousURL() string // Delete removes the file from the MAAS controller. Delete() error // ReadAll returns the content of the file. ReadAll() ([]byte, error) } // Fabric represents a set of interconnected VLANs that are capable of mutual // communication. A fabric can be thought of as a logical grouping in which // VLANs can be considered unique. // For example, a distributed network may have a fabric in London containing // VLAN 100, while a separate fabric in San Francisco may contain a VLAN 100, // whose attached subnets are completely different and unrelated. type Fabric interface { ID() int Name() string ClassType() string VLANs() []VLAN } // VLAN represents an instance of a Virtual LAN. VLANs are a common way to // create logically separate networks using the same physical infrastructure. // it is the default VLAN for that port, and requires no special configuration // in order to access. // with nodes in MAAS. That is, if a switch port is configured such that // can be configured to automatically bring up VLAN interfaces, so that the // deployed node can make use of them. // object in the fabric will be associated to by default (unless otherwise // specified). type VLAN interface { ID() int Name() string Fabric() string // VID is the VLAN ID. eth0.10 -> VID = 10. VID() int // MTU (maximum transmission unit) is the largest size packet or frame, // specified in octets (eight-bit bytes), that can be sent. MTU() int DHCP() bool PrimaryRack() string SecondaryRack() string } // Zone represents a physical zone that a Machine is in. The meaning of a // physical zone is up to you: it could identify e.g. a server rack, a network, // or a data centre. Users can then allocate nodes from specific physical zones, // to suit their redundancy or performance requirements. type Zone interface { Name() string Description() string } // BootResource is the bomb... find something to say here. type BootResource interface { ID() int Name() string Type() string Architecture() string SubArchitectures() set.Strings KernelFlavor() string } // Device represents some form of device in MAAS. type Device interface { // TODO: add domain SystemID() string Hostname() string FQDN() string IPAddresses() []string Zone() Zone // Parent returns the SystemID of the Parent. Most often this will be a // Machine. Parent() string // Owner is the username of the user that created the device. Owner() string // InterfaceSet returns all the interfaces for the Device. InterfaceSet() []Interface // CreateInterface will create a physical interface for this machine. CreateInterface(CreateInterfaceArgs) (Interface, error) // Delete will remove this Device. Delete() error } // Machine represents a physical machine. type Machine interface { SystemID() string Hostname() string FQDN() string Tags() []string OperatingSystem() string DistroSeries() string Architecture() string Memory() int CPUCount() int IPAddresses() []string PowerState() string // Devices returns a list of devices that match the params and have // this Machine as the parent. Devices(DevicesArgs) ([]Device, error) // Consider bundling the status values into a single struct. // but need to check for consistent representation if exposed on other // entities. StatusName() string StatusMessage() string // BootInterface returns the interface that was used to boot the Machine. BootInterface() Interface // InterfaceSet returns all the interfaces for the Machine. InterfaceSet() []Interface // Interface returns the interface for the machine that matches the id // specified. If there is no match, nil is returned. Interface(id int) Interface // <API key> returns all the physical block devices on the machine. <API key>() []BlockDevice // PhysicalBlockDevice returns the physical block device for the machine // that matches the id specified. If there is no match, nil is returned. PhysicalBlockDevice(id int) BlockDevice // BlockDevices returns all the physical and virtual block devices on the machine. BlockDevices() []BlockDevice Zone() Zone // Start the machine and install the operating system specified in the args. Start(StartArgs) error // CreateDevice creates a new Device with this Machine as the parent. // The device will have one interface that is linked to the specified subnet. CreateDevice(<API key>) (Device, error) } // Space is a name for a collection of Subnets. type Space interface { ID() int Name() string Subnets() []Subnet } // Subnet refers to an IP range on a VLAN. type Subnet interface { ID() int Name() string Space() string VLAN() VLAN Gateway() string CIDR() string // dns_mode // DNSServers is a list of ip addresses of the DNS servers for the subnet. // This list may be empty. DNSServers() []string } // Interface represents a physical or virtual network interface on a Machine. type Interface interface { ID() int Name() string // The parents of an interface are the names of interfaces that must exist // for this interface to exist. For example a parent of "eth0.100" would be // "eth0". Parents may be empty. Parents() []string // The children interfaces are the names of those that are dependent on this // interface existing. Children may be empty. Children() []string Type() string Enabled() bool Tags() []string VLAN() VLAN Links() []Link MACAddress() string EffectiveMTU() int // Params is a JSON field, and defaults to an empty string, but is almost // always a JSON object in practice. Gleefully ignoring it until we need it. // Update the name, mac address or VLAN. Update(UpdateInterfaceArgs) error // Delete this interface. Delete() error // LinkSubnet will attempt to make this interface available on the specified // Subnet. LinkSubnet(LinkSubnetArgs) error // UnlinkSubnet will remove the Link to the subnet, and release the IP // address associated if there is one. UnlinkSubnet(Subnet) error } // Link represents a network link between an Interface and a Subnet. type Link interface { ID() int Mode() string Subnet() Subnet // IPAddress returns the address if one has been assigned. // If unavailble, the address will be empty. IPAddress() string } // FileSystem represents a formatted filesystem mounted at a location. type FileSystem interface { // Type is the format type, e.g. "ext4". Type() string MountPoint() string Label() string UUID() string } // Partition represents a partition of a block device. It may be mounted // as a filesystem. type Partition interface { ID() int Path() string // FileSystem may be nil if not mounted. FileSystem() FileSystem UUID() string // UsedFor is a human readable string. UsedFor() string // Size is the number of bytes in the partition. Size() uint64 } // BlockDevice represents an entire block device on the machine. type BlockDevice interface { ID() int Name() string Model() string Path() string UsedFor() string Tags() []string BlockSize() uint64 UsedSize() uint64 Size() uint64 Partitions() []Partition // There are some other attributes for block devices, but we can // expose them on an as needed basis. }
/*! \file MMCObj.h \par Description Extension and update of headers for PellesC compiler suite. \par Project: PellesC Headers extension \date Created on Sun Aug 7 22:15:35 2016 \date Modified on Sun Aug 7 22:15:35 2016 \author frankie \*/ #ifndef <API key> #define <API key> 500 #endif #ifndef <API key> #define <API key> 100 #endif #include <rpc.h> #include <rpcndr.h> #ifndef <API key> #error this stub requires an updated version of <rpcndr.h> #endif #ifndef COM_NO_WINDOWS_H #include <windows.h> #include <ole2.h> #endif #ifndef __mmcobj_h__ #define __mmcobj_h__ #if __POCC__ >= 500 #pragma once #endif #ifndef <API key> #define <API key> typedef interface ISnapinProperties ISnapinProperties; #endif #ifndef <API key> #define <API key> typedef interface <API key> <API key>; #endif #ifndef <API key> #define <API key> typedef interface _Application _Application; #endif #ifndef <API key> #define <API key> typedef interface _AppEvents _AppEvents; #endif #ifndef <API key> #define <API key> typedef interface AppEvents AppEvents; #endif #ifndef <API key> #define <API key> typedef struct Application Application; #endif #ifndef <API key> #define <API key> typedef interface _EventConnector _EventConnector; #endif #ifndef <API key> #define <API key> typedef struct <API key> <API key>; #endif #ifndef <API key> #define <API key> typedef interface Frame Frame; #endif #ifndef <API key> #define <API key> typedef interface Node Node; #endif #ifndef <API key> #define <API key> typedef interface ScopeNamespace ScopeNamespace; #endif #ifndef <API key> #define <API key> typedef interface Document Document; #endif #ifndef <API key> #define <API key> typedef interface SnapIn SnapIn; #endif #ifndef <API key> #define <API key> typedef interface SnapIns SnapIns; #endif #ifndef <API key> #define <API key> typedef interface Extension Extension; #endif #ifndef <API key> #define <API key> typedef interface Extensions Extensions; #endif #ifndef <API key> #define <API key> typedef interface Columns Columns; #endif #ifndef <API key> #define <API key> typedef interface Column Column; #endif #ifndef <API key> #define <API key> typedef interface Views Views; #endif #ifndef <API key> #define <API key> typedef interface View View; #endif #ifndef <API key> #define <API key> typedef interface Nodes Nodes; #endif #ifndef <API key> #define <API key> typedef interface ContextMenu ContextMenu; #endif #ifndef <API key> #define <API key> typedef interface MenuItem MenuItem; #endif #ifndef <API key> #define <API key> typedef interface Properties Properties; #endif #ifndef <API key> #define <API key> typedef interface Property Property; #endif #include <oaidl.h> #ifndef MMC_VER #define MMC_VER 0x0200 #endif #if (MMC_VER >= 0x0200) typedef _Application *PAPPLICATION; typedef _Application **PPAPPLICATION; typedef Column *PCOLUMN; typedef Column **PPCOLUMN; typedef Columns *PCOLUMNS; typedef Columns **PPCOLUMNS; typedef ContextMenu *PCONTEXTMENU; typedef ContextMenu **PPCONTEXTMENU; typedef Document *PDOCUMENT; typedef Document **PPDOCUMENT; typedef Frame *PFRAME; typedef Frame **PPFRAME; typedef MenuItem *PMENUITEM; typedef MenuItem **PPMENUITEM; typedef Node *PNODE; typedef Node **PPNODE; typedef Nodes *PNODES; typedef Nodes **PPNODES; typedef Properties *PPROPERTIES; typedef Properties **PPPROPERTIES; typedef Property *PPROPERTY; typedef Property **PPPROPERTY; typedef ScopeNamespace *PSCOPENAMESPACE; typedef ScopeNamespace **PPSCOPENAMESPACE; typedef SnapIn *PSNAPIN; typedef SnapIn **PPSNAPIN; typedef SnapIns *PSNAPINS; typedef SnapIns **PPSNAPINS; typedef Extension *PEXTENSION; typedef Extension **PPEXTENSION; typedef Extensions *PEXTENSIONS; typedef Extensions **PPEXTENSIONS; typedef View *PVIEW; typedef View **PPVIEW; typedef Views *PVIEWS; typedef Views **PPVIEWS; typedef ISnapinProperties *LPSNAPINPROPERTIES; typedef <API key> *<API key>; typedef BOOL *PBOOL; typedef int *PINT; typedef BSTR *PBSTR; typedef VARIANT *PVARIANT; typedef long *PLONG; typedef IDispatch *PDISPATCH; typedef IDispatch **PPDISPATCH; extern RPC_IF_HANDLE <API key>; extern RPC_IF_HANDLE <API key>; #ifndef <API key> #define <API key> typedef enum <API key> { <API key> = 1, <API key> = (<API key> + 1), <API key> = (<API key> + 1) } MMC_PROPERTY_ACTION; typedef struct <API key> { LPCOLESTR pszPropName; VARIANT varValue; MMC_PROPERTY_ACTION eAction; } MMC_SNAPIN_PROPERTY; extern const IID <API key>; typedef struct <API key> { BEGIN_INTERFACE HRESULT(STDMETHODCALLTYPE * QueryInterface) (ISnapinProperties * This, REFIID riid, void **ppvObject); ULONG(STDMETHODCALLTYPE * AddRef) (ISnapinProperties * This); ULONG(STDMETHODCALLTYPE * Release) (ISnapinProperties * This); HRESULT(STDMETHODCALLTYPE * Initialize) (ISnapinProperties * This, Properties * pProperties); HRESULT(STDMETHODCALLTYPE * QueryPropertyNames) (ISnapinProperties * This, <API key> * pCallback); HRESULT(STDMETHODCALLTYPE * PropertiesChanged) (ISnapinProperties * This, long cProperties, MMC_SNAPIN_PROPERTY * pProperties); END_INTERFACE } <API key>; interface ISnapinProperties { CONST_VTBL struct <API key> *lpVtbl; }; #ifdef COBJMACROS #define <API key>(This,riid,ppvObject) ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define <API key>(This) ( (This)->lpVtbl -> AddRef(This) ) #define <API key>(This) ( (This)->lpVtbl -> Release(This) ) #define <API key>(This,pProperties) ( (This)->lpVtbl -> Initialize(This,pProperties) ) #define <API key>(This,pCallback) ( (This)->lpVtbl -> QueryPropertyNames(This,pCallback) ) #define <API key>(This,cProperties,pProperties) ( (This)->lpVtbl -> PropertiesChanged(This,cProperties,pProperties) ) #endif #endif #ifndef <API key> #define <API key> #define <API key> ( 0x1 ) #define MMC_PROP_MODIFIABLE ( 0x2 ) #define MMC_PROP_REMOVABLE ( 0x4 ) #define MMC_PROP_PERSIST ( 0x8 ) extern const IID <API key>; typedef struct <API key> { BEGIN_INTERFACE HRESULT(STDMETHODCALLTYPE * QueryInterface) (<API key> * This, REFIID riid, void **ppvObject); ULONG(STDMETHODCALLTYPE * AddRef) (<API key> * This); ULONG(STDMETHODCALLTYPE * Release) (<API key> * This); HRESULT(STDMETHODCALLTYPE * AddPropertyName) (<API key> * This, LPCOLESTR pszPropName, DWORD dwFlags); END_INTERFACE } <API key>; interface <API key> { CONST_VTBL struct <API key> *lpVtbl; }; #ifdef COBJMACROS #define <API key>(This,riid,ppvObject) ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define <API key>(This) ( (This)->lpVtbl -> AddRef(This) ) #define <API key>(This) ( (This)->lpVtbl -> Release(This) ) #define <API key>(This,pszPropName,dwFlags) ( (This)->lpVtbl -> AddPropertyName(This,pszPropName,dwFlags) ) #endif #endif #ifndef <API key> #define <API key> typedef enum DocumentMode { DocumentMode_Author = 0, DocumentMode_User = (DocumentMode_Author + 1), <API key> = (DocumentMode_User + 1), <API key> = (<API key> + 1) } _DocumentMode; typedef enum DocumentMode DOCUMENTMODE; typedef enum DocumentMode *PDOCUMENTMODE; typedef enum DocumentMode **PPDOCUMENTMODE; typedef enum ListViewMode { <API key> = 0, <API key> = (<API key> + 1), ListMode_List = (<API key> + 1), ListMode_Detail = (ListMode_List + 1), ListMode_Filtered = (ListMode_Detail + 1) } _ListViewMode; typedef enum ListViewMode LISTVIEWMODE; typedef enum ListViewMode *PLISTVIEWMODE; typedef enum ListViewMode **PPLISTVIEWMODE; typedef enum ViewOptions { ViewOption_Default = 0, <API key> = 0x1, <API key> = 0x2, <API key> = 0x4, <API key> = 0x8 } _ViewOptions; typedef enum ViewOptions VIEWOPTIONS; typedef enum ViewOptions *PVIEWOPTIONS; typedef enum ViewOptions **PPVIEWOPTIONS; typedef enum ExportListOptions { <API key> = 0, <API key> = 0x1, <API key> = 0x2, <API key> = 0x4 } _ExportListOptions; typedef enum ExportListOptions EXPORTLISTOPTIONS; extern const IID LIBID_MMC20; #ifndef <API key> #define <API key> extern const IID IID__Application; typedef struct _ApplicationVtbl { BEGIN_INTERFACE HRESULT(STDMETHODCALLTYPE * QueryInterface) (_Application * This, REFIID riid, void **ppvObject); ULONG(STDMETHODCALLTYPE * AddRef) (_Application * This); ULONG(STDMETHODCALLTYPE * Release) (_Application * This); HRESULT(STDMETHODCALLTYPE * GetTypeInfoCount) (_Application * This, UINT * pctinfo); HRESULT(STDMETHODCALLTYPE * GetTypeInfo) (_Application * This, UINT iTInfo, LCID lcid, ITypeInfo ** ppTInfo); HRESULT(STDMETHODCALLTYPE * GetIDsOfNames) (_Application * This, REFIID riid, LPOLESTR * rgszNames, UINT cNames, LCID lcid, DISPID * rgDispId); HRESULT(STDMETHODCALLTYPE * Invoke) (_Application * This, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS * pDispParams, VARIANT * pVarResult, EXCEPINFO * pExcepInfo, UINT * puArgErr); void (STDMETHODCALLTYPE * Help) (_Application * This); void (STDMETHODCALLTYPE * Quit) (_Application * This); HRESULT(STDMETHODCALLTYPE * get_Document) (_Application * This, PPDOCUMENT Document); HRESULT(STDMETHODCALLTYPE * Load) (_Application * This, BSTR Filename); HRESULT(STDMETHODCALLTYPE * get_Frame) (_Application * This, PPFRAME Frame); HRESULT(STDMETHODCALLTYPE * get_Visible) (_Application * This, PBOOL Visible); HRESULT(STDMETHODCALLTYPE * Show) (_Application * This); HRESULT(STDMETHODCALLTYPE * Hide) (_Application * This); HRESULT(STDMETHODCALLTYPE * get_UserControl) (_Application * This, PBOOL UserControl); HRESULT(STDMETHODCALLTYPE * put_UserControl) (_Application * This, BOOL UserControl); HRESULT(STDMETHODCALLTYPE * get_VersionMajor) (_Application * This, PLONG VersionMajor); HRESULT(STDMETHODCALLTYPE * get_VersionMinor) (_Application * This, PLONG VersionMinor); END_INTERFACE } _ApplicationVtbl; interface _Application { CONST_VTBL struct _ApplicationVtbl *lpVtbl; }; #ifdef COBJMACROS #define <API key>(This,riid,ppvObject) ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define _Application_AddRef(This) ( (This)->lpVtbl -> AddRef(This) ) #define <API key>(This) ( (This)->lpVtbl -> Release(This) ) #define <API key>(This,pctinfo) ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define <API key>(This,iTInfo,lcid,ppTInfo) ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define <API key>(This,riid,rgszNames,cNames,lcid,rgDispId) ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define _Application_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define _Application_Help(This) ( (This)->lpVtbl -> Help(This) ) #define _Application_Quit(This) ( (This)->lpVtbl -> Quit(This) ) #define <API key>(This,Document) ( (This)->lpVtbl -> get_Document(This,Document) ) #define _Application_Load(This,Filename) ( (This)->lpVtbl -> Load(This,Filename) ) #define <API key>(This,Frame) ( (This)->lpVtbl -> get_Frame(This,Frame) ) #define <API key>(This,Visible) ( (This)->lpVtbl -> get_Visible(This,Visible) ) #define _Application_Show(This) ( (This)->lpVtbl -> Show(This) ) #define _Application_Hide(This) ( (This)->lpVtbl -> Hide(This) ) #define <API key>(This,UserControl) ( (This)->lpVtbl -> get_UserControl(This,UserControl) ) #define <API key>(This,UserControl) ( (This)->lpVtbl -> put_UserControl(This,UserControl) ) #define <API key>(This,VersionMajor) ( (This)->lpVtbl -> get_VersionMajor(This,VersionMajor) ) #define <API key>(This,VersionMinor) ( (This)->lpVtbl -> get_VersionMinor(This,VersionMinor) ) #endif #endif #ifndef <API key> #define <API key> extern const IID IID__AppEvents; typedef struct _AppEventsVtbl { BEGIN_INTERFACE HRESULT(STDMETHODCALLTYPE * QueryInterface) (_AppEvents * This, REFIID riid, void **ppvObject); ULONG(STDMETHODCALLTYPE * AddRef) (_AppEvents * This); ULONG(STDMETHODCALLTYPE * Release) (_AppEvents * This); HRESULT(STDMETHODCALLTYPE * GetTypeInfoCount) (_AppEvents * This, UINT * pctinfo); HRESULT(STDMETHODCALLTYPE * GetTypeInfo) (_AppEvents * This, UINT iTInfo, LCID lcid, ITypeInfo ** ppTInfo); HRESULT(STDMETHODCALLTYPE * GetIDsOfNames) (_AppEvents * This, REFIID riid, LPOLESTR * rgszNames, UINT cNames, LCID lcid, DISPID * rgDispId); HRESULT(STDMETHODCALLTYPE * Invoke) (_AppEvents * This, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS * pDispParams, VARIANT * pVarResult, EXCEPINFO * pExcepInfo, UINT * puArgErr); HRESULT(STDMETHODCALLTYPE * OnQuit) (_AppEvents * This, PAPPLICATION Application); HRESULT(STDMETHODCALLTYPE * OnDocumentOpen) (_AppEvents * This, PDOCUMENT Document, BOOL New); HRESULT(STDMETHODCALLTYPE * OnDocumentClose) (_AppEvents * This, PDOCUMENT Document); HRESULT(STDMETHODCALLTYPE * OnSnapInAdded) (_AppEvents * This, PDOCUMENT Document, PSNAPIN SnapIn); HRESULT(STDMETHODCALLTYPE * OnSnapInRemoved) (_AppEvents * This, PDOCUMENT Document, PSNAPIN SnapIn); HRESULT(STDMETHODCALLTYPE * OnNewView) (_AppEvents * This, PVIEW View); HRESULT(STDMETHODCALLTYPE * OnViewClose) (_AppEvents * This, PVIEW View); HRESULT(STDMETHODCALLTYPE * OnViewChange) (_AppEvents * This, PVIEW View, PNODE NewOwnerNode); HRESULT(STDMETHODCALLTYPE * OnSelectionChange) (_AppEvents * This, PVIEW View, PNODES NewNodes); HRESULT(STDMETHODCALLTYPE * <API key>) (_AppEvents * This, PMENUITEM MenuItem); HRESULT(STDMETHODCALLTYPE * <API key>) (_AppEvents * This); HRESULT(STDMETHODCALLTYPE * OnListUpdated) (_AppEvents * This, PVIEW View); END_INTERFACE } _AppEventsVtbl; interface _AppEvents { CONST_VTBL struct _AppEventsVtbl *lpVtbl; }; #ifdef COBJMACROS #define <API key>(This,riid,ppvObject) ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define _AppEvents_AddRef(This) ( (This)->lpVtbl -> AddRef(This) ) #define _AppEvents_Release(This) ( (This)->lpVtbl -> Release(This) ) #define <API key>(This,pctinfo) ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define <API key>(This,iTInfo,lcid,ppTInfo) ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define <API key>(This,riid,rgszNames,cNames,lcid,rgDispId) ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define _AppEvents_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define _AppEvents_OnQuit(This,Application) ( (This)->lpVtbl -> OnQuit(This,Application) ) #define <API key>(This,Document,New) ( (This)->lpVtbl -> OnDocumentOpen(This,Document,New) ) #define <API key>(This,Document) ( (This)->lpVtbl -> OnDocumentClose(This,Document) ) #define <API key>(This,Document,SnapIn) ( (This)->lpVtbl -> OnSnapInAdded(This,Document,SnapIn) ) #define <API key>(This,Document,SnapIn) ( (This)->lpVtbl -> OnSnapInRemoved(This,Document,SnapIn) ) #define <API key>(This,View) ( (This)->lpVtbl -> OnNewView(This,View) ) #define <API key>(This,View) ( (This)->lpVtbl -> OnViewClose(This,View) ) #define <API key>(This,View,NewOwnerNode) ( (This)->lpVtbl -> OnViewChange(This,View,NewOwnerNode) ) #define <API key>(This,View,NewNodes) ( (This)->lpVtbl -> OnSelectionChange(This,View,NewNodes) ) #define <API key>(This,MenuItem) ( (This)->lpVtbl -> <API key>(This,MenuItem) ) #define <API key>(This) ( (This)->lpVtbl -> <API key>(This) ) #define <API key>(This,View) ( (This)->lpVtbl -> OnListUpdated(This,View) ) #endif #endif #ifndef <API key> #define <API key> extern const IID DIID_AppEvents; typedef struct AppEventsVtbl { BEGIN_INTERFACE HRESULT(STDMETHODCALLTYPE * QueryInterface) (AppEvents * This, REFIID riid, void **ppvObject); ULONG(STDMETHODCALLTYPE * AddRef) (AppEvents * This); ULONG(STDMETHODCALLTYPE * Release) (AppEvents * This); HRESULT(STDMETHODCALLTYPE * GetTypeInfoCount) (AppEvents * This, UINT * pctinfo); HRESULT(STDMETHODCALLTYPE * GetTypeInfo) (AppEvents * This, UINT iTInfo, LCID lcid, ITypeInfo ** ppTInfo); HRESULT(STDMETHODCALLTYPE * GetIDsOfNames) (AppEvents * This, REFIID riid, LPOLESTR * rgszNames, UINT cNames, LCID lcid, DISPID * rgDispId); HRESULT(STDMETHODCALLTYPE * Invoke) (AppEvents * This, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS * pDispParams, VARIANT * pVarResult, EXCEPINFO * pExcepInfo, UINT * puArgErr); END_INTERFACE } AppEventsVtbl; interface AppEvents { CONST_VTBL struct AppEventsVtbl *lpVtbl; }; #ifdef COBJMACROS #define <API key>(This,riid,ppvObject) ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define AppEvents_AddRef(This) ( (This)->lpVtbl -> AddRef(This) ) #define AppEvents_Release(This) ( (This)->lpVtbl -> Release(This) ) #define <API key>(This,pctinfo) ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define <API key>(This,iTInfo,lcid,ppTInfo) ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define <API key>(This,riid,rgszNames,cNames,lcid,rgDispId) ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define AppEvents_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #endif #endif extern const CLSID CLSID_Application; #ifndef <API key> #define <API key> extern const IID IID__EventConnector; typedef struct _EventConnectorVtbl { BEGIN_INTERFACE HRESULT(STDMETHODCALLTYPE * QueryInterface) (_EventConnector * This, REFIID riid, void **ppvObject); ULONG(STDMETHODCALLTYPE * AddRef) (_EventConnector * This); ULONG(STDMETHODCALLTYPE * Release) (_EventConnector * This); HRESULT(STDMETHODCALLTYPE * GetTypeInfoCount) (_EventConnector * This, UINT * pctinfo); HRESULT(STDMETHODCALLTYPE * GetTypeInfo) (_EventConnector * This, UINT iTInfo, LCID lcid, ITypeInfo ** ppTInfo); HRESULT(STDMETHODCALLTYPE * GetIDsOfNames) (_EventConnector * This, REFIID riid, LPOLESTR * rgszNames, UINT cNames, LCID lcid, DISPID * rgDispId); HRESULT(STDMETHODCALLTYPE * Invoke) (_EventConnector * This, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS * pDispParams, VARIANT * pVarResult, EXCEPINFO * pExcepInfo, UINT * puArgErr); HRESULT(STDMETHODCALLTYPE * ConnectTo) (_EventConnector * This, PAPPLICATION Application); HRESULT(STDMETHODCALLTYPE * Disconnect) (_EventConnector * This); END_INTERFACE } _EventConnectorVtbl; interface _EventConnector { CONST_VTBL struct _EventConnectorVtbl *lpVtbl; }; #ifdef COBJMACROS #define <API key>(This,riid,ppvObject) ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define <API key>(This) ( (This)->lpVtbl -> AddRef(This) ) #define <API key>(This) ( (This)->lpVtbl -> Release(This) ) #define <API key>(This,pctinfo) ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define <API key>(This,iTInfo,lcid,ppTInfo) ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define <API key>(This,riid,rgszNames,cNames,lcid,rgDispId) ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define <API key>(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define <API key>(This,Application) ( (This)->lpVtbl -> ConnectTo(This,Application) ) #define <API key>(This) ( (This)->lpVtbl -> Disconnect(This) ) #endif #endif extern const CLSID <API key>; #ifndef <API key> #define <API key> extern const IID IID_Frame; typedef struct FrameVtbl { BEGIN_INTERFACE HRESULT(STDMETHODCALLTYPE * QueryInterface) (Frame * This, REFIID riid, void **ppvObject); ULONG(STDMETHODCALLTYPE * AddRef) (Frame * This); ULONG(STDMETHODCALLTYPE * Release) (Frame * This); HRESULT(STDMETHODCALLTYPE * GetTypeInfoCount) (Frame * This, UINT * pctinfo); HRESULT(STDMETHODCALLTYPE * GetTypeInfo) (Frame * This, UINT iTInfo, LCID lcid, ITypeInfo ** ppTInfo); HRESULT(STDMETHODCALLTYPE * GetIDsOfNames) (Frame * This, REFIID riid, LPOLESTR * rgszNames, UINT cNames, LCID lcid, DISPID * rgDispId); HRESULT(STDMETHODCALLTYPE * Invoke) (Frame * This, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS * pDispParams, VARIANT * pVarResult, EXCEPINFO * pExcepInfo, UINT * puArgErr); HRESULT(STDMETHODCALLTYPE * Maximize) (Frame * This); HRESULT(STDMETHODCALLTYPE * Minimize) (Frame * This); HRESULT(STDMETHODCALLTYPE * Restore) (Frame * This); HRESULT(STDMETHODCALLTYPE * get_Top) (Frame * This, PINT Top); HRESULT(STDMETHODCALLTYPE * put_Top) (Frame * This, int top); HRESULT(STDMETHODCALLTYPE * get_Bottom) (Frame * This, PINT Bottom); HRESULT(STDMETHODCALLTYPE * put_Bottom) (Frame * This, int bottom); HRESULT(STDMETHODCALLTYPE * get_Left) (Frame * This, PINT Left); HRESULT(STDMETHODCALLTYPE * put_Left) (Frame * This, int left); HRESULT(STDMETHODCALLTYPE * get_Right) (Frame * This, PINT Right); HRESULT(STDMETHODCALLTYPE * put_Right) (Frame * This, int right); END_INTERFACE } FrameVtbl; interface Frame { CONST_VTBL struct FrameVtbl *lpVtbl; }; #ifdef COBJMACROS #define <API key>(This,riid,ppvObject) ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define Frame_AddRef(This) ( (This)->lpVtbl -> AddRef(This) ) #define Frame_Release(This) ( (This)->lpVtbl -> Release(This) ) #define <API key>(This,pctinfo) ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define Frame_GetTypeInfo(This,iTInfo,lcid,ppTInfo) ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define Frame_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define Frame_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define Frame_Maximize(This) ( (This)->lpVtbl -> Maximize(This) ) #define Frame_Minimize(This) ( (This)->lpVtbl -> Minimize(This) ) #define Frame_Restore(This) ( (This)->lpVtbl -> Restore(This) ) #define Frame_get_Top(This,Top) ( (This)->lpVtbl -> get_Top(This,Top) ) #define Frame_put_Top(This,top) ( (This)->lpVtbl -> put_Top(This,top) ) #define Frame_get_Bottom(This,Bottom) ( (This)->lpVtbl -> get_Bottom(This,Bottom) ) #define Frame_put_Bottom(This,bottom) ( (This)->lpVtbl -> put_Bottom(This,bottom) ) #define Frame_get_Left(This,Left) ( (This)->lpVtbl -> get_Left(This,Left) ) #define Frame_put_Left(This,left) ( (This)->lpVtbl -> put_Left(This,left) ) #define Frame_get_Right(This,Right) ( (This)->lpVtbl -> get_Right(This,Right) ) #define Frame_put_Right(This,right) ( (This)->lpVtbl -> put_Right(This,right) ) #endif #endif #ifndef <API key> #define <API key> extern const IID IID_Node; typedef struct NodeVtbl { BEGIN_INTERFACE HRESULT(STDMETHODCALLTYPE * QueryInterface) (Node * This, REFIID riid, void **ppvObject); ULONG(STDMETHODCALLTYPE * AddRef) (Node * This); ULONG(STDMETHODCALLTYPE * Release) (Node * This); HRESULT(STDMETHODCALLTYPE * GetTypeInfoCount) (Node * This, UINT * pctinfo); HRESULT(STDMETHODCALLTYPE * GetTypeInfo) (Node * This, UINT iTInfo, LCID lcid, ITypeInfo ** ppTInfo); HRESULT(STDMETHODCALLTYPE * GetIDsOfNames) (Node * This, REFIID riid, LPOLESTR * rgszNames, UINT cNames, LCID lcid, DISPID * rgDispId); HRESULT(STDMETHODCALLTYPE * Invoke) (Node * This, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS * pDispParams, VARIANT * pVarResult, EXCEPINFO * pExcepInfo, UINT * puArgErr); HRESULT(STDMETHODCALLTYPE * get_Name) (Node * This, PBSTR Name); HRESULT(STDMETHODCALLTYPE * get_Property) (Node * This, BSTR PropertyName, PBSTR PropertyValue); HRESULT(STDMETHODCALLTYPE * get_Bookmark) (Node * This, PBSTR Bookmark); HRESULT(STDMETHODCALLTYPE * IsScopeNode) (Node * This, PBOOL IsScopeNode); HRESULT(STDMETHODCALLTYPE * get_Nodetype) (Node * This, PBSTR Nodetype); END_INTERFACE } NodeVtbl; interface Node { CONST_VTBL struct NodeVtbl *lpVtbl; }; #ifdef COBJMACROS #define Node_QueryInterface(This,riid,ppvObject) ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define Node_AddRef(This) ( (This)->lpVtbl -> AddRef(This) ) #define Node_Release(This) ( (This)->lpVtbl -> Release(This) ) #define <API key>(This,pctinfo) ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define Node_GetTypeInfo(This,iTInfo,lcid,ppTInfo) ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define Node_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define Node_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define Node_get_Name(This,Name) ( (This)->lpVtbl -> get_Name(This,Name) ) #define Node_get_Property(This,PropertyName,PropertyValue) ( (This)->lpVtbl -> get_Property(This,PropertyName,PropertyValue) ) #define Node_get_Bookmark(This,Bookmark) ( (This)->lpVtbl -> get_Bookmark(This,Bookmark) ) #define Node_IsScopeNode(This,IsScopeNode) ( (This)->lpVtbl -> IsScopeNode(This,IsScopeNode) ) #define Node_get_Nodetype(This,Nodetype) ( (This)->lpVtbl -> get_Nodetype(This,Nodetype) ) #endif #endif #ifndef <API key> #define <API key> extern const IID IID_ScopeNamespace; typedef struct ScopeNamespaceVtbl { BEGIN_INTERFACE HRESULT(STDMETHODCALLTYPE * QueryInterface) (ScopeNamespace * This, REFIID riid, void **ppvObject); ULONG(STDMETHODCALLTYPE * AddRef) (ScopeNamespace * This); ULONG(STDMETHODCALLTYPE * Release) (ScopeNamespace * This); HRESULT(STDMETHODCALLTYPE * GetTypeInfoCount) (ScopeNamespace * This, UINT * pctinfo); HRESULT(STDMETHODCALLTYPE * GetTypeInfo) (ScopeNamespace * This, UINT iTInfo, LCID lcid, ITypeInfo ** ppTInfo); HRESULT(STDMETHODCALLTYPE * GetIDsOfNames) (ScopeNamespace * This, REFIID riid, LPOLESTR * rgszNames, UINT cNames, LCID lcid, DISPID * rgDispId); HRESULT(STDMETHODCALLTYPE * Invoke) (ScopeNamespace * This, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS * pDispParams, VARIANT * pVarResult, EXCEPINFO * pExcepInfo, UINT * puArgErr); HRESULT(STDMETHODCALLTYPE * GetParent) (ScopeNamespace * This, PNODE Node, PPNODE Parent); HRESULT(STDMETHODCALLTYPE * GetChild) (ScopeNamespace * This, PNODE Node, PPNODE Child); HRESULT(STDMETHODCALLTYPE * GetNext) (ScopeNamespace * This, PNODE Node, PPNODE Next); HRESULT(STDMETHODCALLTYPE * GetRoot) (ScopeNamespace * This, PPNODE Root); HRESULT(STDMETHODCALLTYPE * Expand) (ScopeNamespace * This, PNODE Node); END_INTERFACE } ScopeNamespaceVtbl; interface ScopeNamespace { CONST_VTBL struct ScopeNamespaceVtbl *lpVtbl; }; #ifdef COBJMACROS #define <API key>(This,riid,ppvObject) ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define <API key>(This) ( (This)->lpVtbl -> AddRef(This) ) #define <API key>(This) ( (This)->lpVtbl -> Release(This) ) #define <API key>(This,pctinfo) ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define <API key>(This,iTInfo,lcid,ppTInfo) ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define <API key>(This,riid,rgszNames,cNames,lcid,rgDispId) ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define <API key>(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define <API key>(This,Node,Parent) ( (This)->lpVtbl -> GetParent(This,Node,Parent) ) #define <API key>(This,Node,Child) ( (This)->lpVtbl -> GetChild(This,Node,Child) ) #define <API key>(This,Node,Next) ( (This)->lpVtbl -> GetNext(This,Node,Next) ) #define <API key>(This,Root) ( (This)->lpVtbl -> GetRoot(This,Root) ) #define <API key>(This,Node) ( (This)->lpVtbl -> Expand(This,Node) ) #endif #endif #ifndef <API key> #define <API key> extern const IID IID_Document; typedef struct DocumentVtbl { BEGIN_INTERFACE HRESULT(STDMETHODCALLTYPE * QueryInterface) (Document * This, REFIID riid, void **ppvObject); ULONG(STDMETHODCALLTYPE * AddRef) (Document * This); ULONG(STDMETHODCALLTYPE * Release) (Document * This); HRESULT(STDMETHODCALLTYPE * GetTypeInfoCount) (Document * This, UINT * pctinfo); HRESULT(STDMETHODCALLTYPE * GetTypeInfo) (Document * This, UINT iTInfo, LCID lcid, ITypeInfo ** ppTInfo); HRESULT(STDMETHODCALLTYPE * GetIDsOfNames) (Document * This, REFIID riid, LPOLESTR * rgszNames, UINT cNames, LCID lcid, DISPID * rgDispId); HRESULT(STDMETHODCALLTYPE * Invoke) (Document * This, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS * pDispParams, VARIANT * pVarResult, EXCEPINFO * pExcepInfo, UINT * puArgErr); HRESULT(STDMETHODCALLTYPE * Save) (Document * This); HRESULT(STDMETHODCALLTYPE * SaveAs) (Document * This, BSTR Filename); HRESULT(STDMETHODCALLTYPE * Close) (Document * This, BOOL SaveChanges); HRESULT(STDMETHODCALLTYPE * get_Views) (Document * This, PPVIEWS Views); HRESULT(STDMETHODCALLTYPE * get_SnapIns) (Document * This, PPSNAPINS SnapIns); HRESULT(STDMETHODCALLTYPE * get_ActiveView) (Document * This, PPVIEW View); HRESULT(STDMETHODCALLTYPE * get_Name) (Document * This, PBSTR Name); HRESULT(STDMETHODCALLTYPE * put_Name) (Document * This, BSTR Name); HRESULT(STDMETHODCALLTYPE * get_Location) (Document * This, PBSTR Location); HRESULT(STDMETHODCALLTYPE * get_IsSaved) (Document * This, PBOOL IsSaved); HRESULT(STDMETHODCALLTYPE * get_Mode) (Document * This, PDOCUMENTMODE Mode); HRESULT(STDMETHODCALLTYPE * put_Mode) (Document * This, DOCUMENTMODE Mode); HRESULT(STDMETHODCALLTYPE * get_RootNode) (Document * This, PPNODE Node); HRESULT(STDMETHODCALLTYPE * get_ScopeNamespace) (Document * This, PPSCOPENAMESPACE ScopeNamespace); HRESULT(STDMETHODCALLTYPE * CreateProperties) (Document * This, PPPROPERTIES Properties); HRESULT(STDMETHODCALLTYPE * get_Application) (Document * This, PPAPPLICATION Application); END_INTERFACE } DocumentVtbl; interface Document { CONST_VTBL struct DocumentVtbl *lpVtbl; }; #ifdef COBJMACROS #define <API key>(This,riid,ppvObject) ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define Document_AddRef(This) ( (This)->lpVtbl -> AddRef(This) ) #define Document_Release(This) ( (This)->lpVtbl -> Release(This) ) #define <API key>(This,pctinfo) ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define <API key>(This,iTInfo,lcid,ppTInfo) ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define <API key>(This,riid,rgszNames,cNames,lcid,rgDispId) ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define Document_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define Document_Save(This) ( (This)->lpVtbl -> Save(This) ) #define Document_SaveAs(This,Filename) ( (This)->lpVtbl -> SaveAs(This,Filename) ) #define Document_Close(This,SaveChanges) ( (This)->lpVtbl -> Close(This,SaveChanges) ) #define Document_get_Views(This,Views) ( (This)->lpVtbl -> get_Views(This,Views) ) #define <API key>(This,SnapIns) ( (This)->lpVtbl -> get_SnapIns(This,SnapIns) ) #define <API key>(This,View) ( (This)->lpVtbl -> get_ActiveView(This,View) ) #define Document_get_Name(This,Name) ( (This)->lpVtbl -> get_Name(This,Name) ) #define Document_put_Name(This,Name) ( (This)->lpVtbl -> put_Name(This,Name) ) #define <API key>(This,Location) ( (This)->lpVtbl -> get_Location(This,Location) ) #define <API key>(This,IsSaved) ( (This)->lpVtbl -> get_IsSaved(This,IsSaved) ) #define Document_get_Mode(This,Mode) ( (This)->lpVtbl -> get_Mode(This,Mode) ) #define Document_put_Mode(This,Mode) ( (This)->lpVtbl -> put_Mode(This,Mode) ) #define <API key>(This,Node) ( (This)->lpVtbl -> get_RootNode(This,Node) ) #define <API key>(This,ScopeNamespace) ( (This)->lpVtbl -> get_ScopeNamespace(This,ScopeNamespace) ) #define <API key>(This,Properties) ( (This)->lpVtbl -> CreateProperties(This,Properties) ) #define <API key>(This,Application) ( (This)->lpVtbl -> get_Application(This,Application) ) #endif #endif #ifndef <API key> #define <API key> extern const IID IID_SnapIn; typedef struct SnapInVtbl { BEGIN_INTERFACE HRESULT(STDMETHODCALLTYPE * QueryInterface) (SnapIn * This, REFIID riid, void **ppvObject); ULONG(STDMETHODCALLTYPE * AddRef) (SnapIn * This); ULONG(STDMETHODCALLTYPE * Release) (SnapIn * This); HRESULT(STDMETHODCALLTYPE * GetTypeInfoCount) (SnapIn * This, UINT * pctinfo); HRESULT(STDMETHODCALLTYPE * GetTypeInfo) (SnapIn * This, UINT iTInfo, LCID lcid, ITypeInfo ** ppTInfo); HRESULT(STDMETHODCALLTYPE * GetIDsOfNames) (SnapIn * This, REFIID riid, LPOLESTR * rgszNames, UINT cNames, LCID lcid, DISPID * rgDispId); HRESULT(STDMETHODCALLTYPE * Invoke) (SnapIn * This, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS * pDispParams, VARIANT * pVarResult, EXCEPINFO * pExcepInfo, UINT * puArgErr); HRESULT(STDMETHODCALLTYPE * get_Name) (SnapIn * This, PBSTR Name); HRESULT(STDMETHODCALLTYPE * get_Vendor) (SnapIn * This, PBSTR Vendor); HRESULT(STDMETHODCALLTYPE * get_Version) (SnapIn * This, PBSTR Version); HRESULT(STDMETHODCALLTYPE * get_Extensions) (SnapIn * This, PPEXTENSIONS Extensions); HRESULT(STDMETHODCALLTYPE * get_SnapinCLSID) (SnapIn * This, PBSTR SnapinCLSID); HRESULT(STDMETHODCALLTYPE * get_Properties) (SnapIn * This, PPPROPERTIES Properties); HRESULT(STDMETHODCALLTYPE * EnableAllExtensions) (SnapIn * This, BOOL Enable); END_INTERFACE } SnapInVtbl; interface SnapIn { CONST_VTBL struct SnapInVtbl *lpVtbl; }; #ifdef COBJMACROS #define <API key>(This,riid,ppvObject) ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define SnapIn_AddRef(This) ( (This)->lpVtbl -> AddRef(This) ) #define SnapIn_Release(This) ( (This)->lpVtbl -> Release(This) ) #define <API key>(This,pctinfo) ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define SnapIn_GetTypeInfo(This,iTInfo,lcid,ppTInfo) ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define <API key>(This,riid,rgszNames,cNames,lcid,rgDispId) ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define SnapIn_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define SnapIn_get_Name(This,Name) ( (This)->lpVtbl -> get_Name(This,Name) ) #define SnapIn_get_Vendor(This,Vendor) ( (This)->lpVtbl -> get_Vendor(This,Vendor) ) #define SnapIn_get_Version(This,Version) ( (This)->lpVtbl -> get_Version(This,Version) ) #define <API key>(This,Extensions) ( (This)->lpVtbl -> get_Extensions(This,Extensions) ) #define <API key>(This,SnapinCLSID) ( (This)->lpVtbl -> get_SnapinCLSID(This,SnapinCLSID) ) #define <API key>(This,Properties) ( (This)->lpVtbl -> get_Properties(This,Properties) ) #define <API key>(This,Enable) ( (This)->lpVtbl -> EnableAllExtensions(This,Enable) ) #endif #endif #ifndef <API key> #define <API key> extern const IID IID_SnapIns; typedef struct SnapInsVtbl { BEGIN_INTERFACE HRESULT(STDMETHODCALLTYPE * QueryInterface) (SnapIns * This, REFIID riid, void **ppvObject); ULONG(STDMETHODCALLTYPE * AddRef) (SnapIns * This); ULONG(STDMETHODCALLTYPE * Release) (SnapIns * This); HRESULT(STDMETHODCALLTYPE * GetTypeInfoCount) (SnapIns * This, UINT * pctinfo); HRESULT(STDMETHODCALLTYPE * GetTypeInfo) (SnapIns * This, UINT iTInfo, LCID lcid, ITypeInfo ** ppTInfo); HRESULT(STDMETHODCALLTYPE * GetIDsOfNames) (SnapIns * This, REFIID riid, LPOLESTR * rgszNames, UINT cNames, LCID lcid, DISPID * rgDispId); HRESULT(STDMETHODCALLTYPE * Invoke) (SnapIns * This, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS * pDispParams, VARIANT * pVarResult, EXCEPINFO * pExcepInfo, UINT * puArgErr); HRESULT(STDMETHODCALLTYPE * get__NewEnum) (SnapIns * This, IUnknown ** retval); HRESULT(STDMETHODCALLTYPE * Item) (SnapIns * This, long Index, PPSNAPIN SnapIn); HRESULT(STDMETHODCALLTYPE * get_Count) (SnapIns * This, PLONG Count); HRESULT(STDMETHODCALLTYPE * Add) (SnapIns * This, BSTR SnapinNameOrCLSID, VARIANT ParentSnapin, VARIANT Properties, PPSNAPIN SnapIn); HRESULT(STDMETHODCALLTYPE * Remove) (SnapIns * This, PSNAPIN SnapIn); END_INTERFACE } SnapInsVtbl; interface SnapIns { CONST_VTBL struct SnapInsVtbl *lpVtbl; }; #ifdef COBJMACROS #define <API key>(This,riid,ppvObject) ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define SnapIns_AddRef(This) ( (This)->lpVtbl -> AddRef(This) ) #define SnapIns_Release(This) ( (This)->lpVtbl -> Release(This) ) #define <API key>(This,pctinfo) ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define SnapIns_GetTypeInfo(This,iTInfo,lcid,ppTInfo) ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define <API key>(This,riid,rgszNames,cNames,lcid,rgDispId) ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define SnapIns_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define <API key>(This,retval) ( (This)->lpVtbl -> get__NewEnum(This,retval) ) #define SnapIns_Item(This,Index,SnapIn) ( (This)->lpVtbl -> Item(This,Index,SnapIn) ) #define SnapIns_get_Count(This,Count) ( (This)->lpVtbl -> get_Count(This,Count) ) #define SnapIns_Add(This,SnapinNameOrCLSID,ParentSnapin,Properties,SnapIn) ( (This)->lpVtbl -> Add(This,SnapinNameOrCLSID,ParentSnapin,Properties,SnapIn) ) #define SnapIns_Remove(This,SnapIn) ( (This)->lpVtbl -> Remove(This,SnapIn) ) #endif #endif #ifndef <API key> #define <API key> extern const IID IID_Extension; typedef struct ExtensionVtbl { BEGIN_INTERFACE HRESULT(STDMETHODCALLTYPE * QueryInterface) (Extension * This, REFIID riid, void **ppvObject); ULONG(STDMETHODCALLTYPE * AddRef) (Extension * This); ULONG(STDMETHODCALLTYPE * Release) (Extension * This); HRESULT(STDMETHODCALLTYPE * GetTypeInfoCount) (Extension * This, UINT * pctinfo); HRESULT(STDMETHODCALLTYPE * GetTypeInfo) (Extension * This, UINT iTInfo, LCID lcid, ITypeInfo ** ppTInfo); HRESULT(STDMETHODCALLTYPE * GetIDsOfNames) (Extension * This, REFIID riid, LPOLESTR * rgszNames, UINT cNames, LCID lcid, DISPID * rgDispId); HRESULT(STDMETHODCALLTYPE * Invoke) (Extension * This, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS * pDispParams, VARIANT * pVarResult, EXCEPINFO * pExcepInfo, UINT * puArgErr); HRESULT(STDMETHODCALLTYPE * get_Name) (Extension * This, PBSTR Name); HRESULT(STDMETHODCALLTYPE * get_Vendor) (Extension * This, PBSTR Vendor); HRESULT(STDMETHODCALLTYPE * get_Version) (Extension * This, PBSTR Version); HRESULT(STDMETHODCALLTYPE * get_Extensions) (Extension * This, PPEXTENSIONS Extensions); HRESULT(STDMETHODCALLTYPE * get_SnapinCLSID) (Extension * This, PBSTR SnapinCLSID); HRESULT(STDMETHODCALLTYPE * EnableAllExtensions) (Extension * This, BOOL Enable); HRESULT(STDMETHODCALLTYPE * Enable) (Extension * This, BOOL Enable); END_INTERFACE } ExtensionVtbl; interface Extension { CONST_VTBL struct ExtensionVtbl *lpVtbl; }; #ifdef COBJMACROS #define <API key>(This,riid,ppvObject) ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define Extension_AddRef(This) ( (This)->lpVtbl -> AddRef(This) ) #define Extension_Release(This) ( (This)->lpVtbl -> Release(This) ) #define <API key>(This,pctinfo) ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define <API key>(This,iTInfo,lcid,ppTInfo) ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define <API key>(This,riid,rgszNames,cNames,lcid,rgDispId) ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define Extension_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define Extension_get_Name(This,Name) ( (This)->lpVtbl -> get_Name(This,Name) ) #define <API key>(This,Vendor) ( (This)->lpVtbl -> get_Vendor(This,Vendor) ) #define <API key>(This,Version) ( (This)->lpVtbl -> get_Version(This,Version) ) #define <API key>(This,Extensions) ( (This)->lpVtbl -> get_Extensions(This,Extensions) ) #define <API key>(This,SnapinCLSID) ( (This)->lpVtbl -> get_SnapinCLSID(This,SnapinCLSID) ) #define <API key>(This,Enable) ( (This)->lpVtbl -> EnableAllExtensions(This,Enable) ) #define Extension_Enable(This,Enable) ( (This)->lpVtbl -> Enable(This,Enable) ) #endif #endif #ifndef <API key> #define <API key> extern const IID IID_Extensions; typedef struct ExtensionsVtbl { BEGIN_INTERFACE HRESULT(STDMETHODCALLTYPE * QueryInterface) (Extensions * This, REFIID riid, void **ppvObject); ULONG(STDMETHODCALLTYPE * AddRef) (Extensions * This); ULONG(STDMETHODCALLTYPE * Release) (Extensions * This); HRESULT(STDMETHODCALLTYPE * GetTypeInfoCount) (Extensions * This, UINT * pctinfo); HRESULT(STDMETHODCALLTYPE * GetTypeInfo) (Extensions * This, UINT iTInfo, LCID lcid, ITypeInfo ** ppTInfo); HRESULT(STDMETHODCALLTYPE * GetIDsOfNames) (Extensions * This, REFIID riid, LPOLESTR * rgszNames, UINT cNames, LCID lcid, DISPID * rgDispId); HRESULT(STDMETHODCALLTYPE * Invoke) (Extensions * This, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS * pDispParams, VARIANT * pVarResult, EXCEPINFO * pExcepInfo, UINT * puArgErr); HRESULT(STDMETHODCALLTYPE * get__NewEnum) (Extensions * This, IUnknown ** retval); HRESULT(STDMETHODCALLTYPE * Item) (Extensions * This, long Index, PPEXTENSION Extension); HRESULT(STDMETHODCALLTYPE * get_Count) (Extensions * This, PLONG Count); END_INTERFACE } ExtensionsVtbl; interface Extensions { CONST_VTBL struct ExtensionsVtbl *lpVtbl; }; #ifdef COBJMACROS #define <API key>(This,riid,ppvObject) ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define Extensions_AddRef(This) ( (This)->lpVtbl -> AddRef(This) ) #define Extensions_Release(This) ( (This)->lpVtbl -> Release(This) ) #define <API key>(This,pctinfo) ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define <API key>(This,iTInfo,lcid,ppTInfo) ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define <API key>(This,riid,rgszNames,cNames,lcid,rgDispId) ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define Extensions_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define <API key>(This,retval) ( (This)->lpVtbl -> get__NewEnum(This,retval) ) #define Extensions_Item(This,Index,Extension) ( (This)->lpVtbl -> Item(This,Index,Extension) ) #define <API key>(This,Count) ( (This)->lpVtbl -> get_Count(This,Count) ) #endif #endif #ifndef <API key> #define <API key> extern const IID IID_Columns; typedef struct ColumnsVtbl { BEGIN_INTERFACE HRESULT(STDMETHODCALLTYPE * QueryInterface) (Columns * This, REFIID riid, void **ppvObject); ULONG(STDMETHODCALLTYPE * AddRef) (Columns * This); ULONG(STDMETHODCALLTYPE * Release) (Columns * This); HRESULT(STDMETHODCALLTYPE * GetTypeInfoCount) (Columns * This, UINT * pctinfo); HRESULT(STDMETHODCALLTYPE * GetTypeInfo) (Columns * This, UINT iTInfo, LCID lcid, ITypeInfo ** ppTInfo); HRESULT(STDMETHODCALLTYPE * GetIDsOfNames) (Columns * This, REFIID riid, LPOLESTR * rgszNames, UINT cNames, LCID lcid, DISPID * rgDispId); HRESULT(STDMETHODCALLTYPE * Invoke) (Columns * This, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS * pDispParams, VARIANT * pVarResult, EXCEPINFO * pExcepInfo, UINT * puArgErr); HRESULT(STDMETHODCALLTYPE * Item) (Columns * This, long Index, PPCOLUMN Column); HRESULT(STDMETHODCALLTYPE * get_Count) (Columns * This, PLONG Count); HRESULT(STDMETHODCALLTYPE * get__NewEnum) (Columns * This, IUnknown ** retval); END_INTERFACE } ColumnsVtbl; interface Columns { CONST_VTBL struct ColumnsVtbl *lpVtbl; }; #ifdef COBJMACROS #define <API key>(This,riid,ppvObject) ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define Columns_AddRef(This) ( (This)->lpVtbl -> AddRef(This) ) #define Columns_Release(This) ( (This)->lpVtbl -> Release(This) ) #define <API key>(This,pctinfo) ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define Columns_GetTypeInfo(This,iTInfo,lcid,ppTInfo) ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define <API key>(This,riid,rgszNames,cNames,lcid,rgDispId) ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define Columns_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define Columns_Item(This,Index,Column) ( (This)->lpVtbl -> Item(This,Index,Column) ) #define Columns_get_Count(This,Count) ( (This)->lpVtbl -> get_Count(This,Count) ) #define <API key>(This,retval) ( (This)->lpVtbl -> get__NewEnum(This,retval) ) #endif #endif #ifndef <API key> #define <API key> typedef enum ColumnSortOrder { SortOrder_Ascending = 0, <API key> = (SortOrder_Ascending + 1) } _ColumnSortOrder; typedef enum ColumnSortOrder COLUMNSORTORDER; extern const IID IID_Column; typedef struct ColumnVtbl { BEGIN_INTERFACE HRESULT(STDMETHODCALLTYPE * QueryInterface) (Column * This, REFIID riid, void **ppvObject); ULONG(STDMETHODCALLTYPE * AddRef) (Column * This); ULONG(STDMETHODCALLTYPE * Release) (Column * This); HRESULT(STDMETHODCALLTYPE * GetTypeInfoCount) (Column * This, UINT * pctinfo); HRESULT(STDMETHODCALLTYPE * GetTypeInfo) (Column * This, UINT iTInfo, LCID lcid, ITypeInfo ** ppTInfo); HRESULT(STDMETHODCALLTYPE * GetIDsOfNames) (Column * This, REFIID riid, LPOLESTR * rgszNames, UINT cNames, LCID lcid, DISPID * rgDispId); HRESULT(STDMETHODCALLTYPE * Invoke) (Column * This, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS * pDispParams, VARIANT * pVarResult, EXCEPINFO * pExcepInfo, UINT * puArgErr); HRESULT(STDMETHODCALLTYPE * Name) (Column * This, BSTR * Name); HRESULT(STDMETHODCALLTYPE * get_Width) (Column * This, PLONG Width); HRESULT(STDMETHODCALLTYPE * put_Width) (Column * This, long Width); HRESULT(STDMETHODCALLTYPE * get_DisplayPosition) (Column * This, PLONG DisplayPosition); HRESULT(STDMETHODCALLTYPE * put_DisplayPosition) (Column * This, long Index); HRESULT(STDMETHODCALLTYPE * get_Hidden) (Column * This, PBOOL Hidden); HRESULT(STDMETHODCALLTYPE * put_Hidden) (Column * This, BOOL Hidden); HRESULT(STDMETHODCALLTYPE * SetAsSortColumn) (Column * This, COLUMNSORTORDER SortOrder); HRESULT(STDMETHODCALLTYPE * IsSortColumn) (Column * This, PBOOL IsSortColumn); END_INTERFACE } ColumnVtbl; interface Column { CONST_VTBL struct ColumnVtbl *lpVtbl; }; #ifdef COBJMACROS #define <API key>(This,riid,ppvObject) ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define Column_AddRef(This) ( (This)->lpVtbl -> AddRef(This) ) #define Column_Release(This) ( (This)->lpVtbl -> Release(This) ) #define <API key>(This,pctinfo) ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define Column_GetTypeInfo(This,iTInfo,lcid,ppTInfo) ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define <API key>(This,riid,rgszNames,cNames,lcid,rgDispId) ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define Column_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define Column_Name(This,Name) ( (This)->lpVtbl -> Name(This,Name) ) #define Column_get_Width(This,Width) ( (This)->lpVtbl -> get_Width(This,Width) ) #define Column_put_Width(This,Width) ( (This)->lpVtbl -> put_Width(This,Width) ) #define <API key>(This,DisplayPosition) ( (This)->lpVtbl -> get_DisplayPosition(This,DisplayPosition) ) #define <API key>(This,Index) ( (This)->lpVtbl -> put_DisplayPosition(This,Index) ) #define Column_get_Hidden(This,Hidden) ( (This)->lpVtbl -> get_Hidden(This,Hidden) ) #define Column_put_Hidden(This,Hidden) ( (This)->lpVtbl -> put_Hidden(This,Hidden) ) #define <API key>(This,SortOrder) ( (This)->lpVtbl -> SetAsSortColumn(This,SortOrder) ) #define Column_IsSortColumn(This,IsSortColumn) ( (This)->lpVtbl -> IsSortColumn(This,IsSortColumn) ) #endif #endif #ifndef <API key> #define <API key> extern const IID IID_Views; typedef struct ViewsVtbl { BEGIN_INTERFACE HRESULT(STDMETHODCALLTYPE * QueryInterface) (Views * This, REFIID riid, void **ppvObject); ULONG(STDMETHODCALLTYPE * AddRef) (Views * This); ULONG(STDMETHODCALLTYPE * Release) (Views * This); HRESULT(STDMETHODCALLTYPE * GetTypeInfoCount) (Views * This, UINT * pctinfo); HRESULT(STDMETHODCALLTYPE * GetTypeInfo) (Views * This, UINT iTInfo, LCID lcid, ITypeInfo ** ppTInfo); HRESULT(STDMETHODCALLTYPE * GetIDsOfNames) (Views * This, REFIID riid, LPOLESTR * rgszNames, UINT cNames, LCID lcid, DISPID * rgDispId); HRESULT(STDMETHODCALLTYPE * Invoke) (Views * This, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS * pDispParams, VARIANT * pVarResult, EXCEPINFO * pExcepInfo, UINT * puArgErr); HRESULT(STDMETHODCALLTYPE * Item) (Views * This, long Index, PPVIEW View); HRESULT(STDMETHODCALLTYPE * get_Count) (Views * This, PLONG Count); HRESULT(STDMETHODCALLTYPE * Add) (Views * This, PNODE Node, VIEWOPTIONS viewOptions); HRESULT(STDMETHODCALLTYPE * get__NewEnum) (Views * This, IUnknown ** retval); END_INTERFACE } ViewsVtbl; interface Views { CONST_VTBL struct ViewsVtbl *lpVtbl; }; #ifdef COBJMACROS #define <API key>(This,riid,ppvObject) ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define Views_AddRef(This) ( (This)->lpVtbl -> AddRef(This) ) #define Views_Release(This) ( (This)->lpVtbl -> Release(This) ) #define <API key>(This,pctinfo) ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define Views_GetTypeInfo(This,iTInfo,lcid,ppTInfo) ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define Views_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define Views_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define Views_Item(This,Index,View) ( (This)->lpVtbl -> Item(This,Index,View) ) #define Views_get_Count(This,Count) ( (This)->lpVtbl -> get_Count(This,Count) ) #define Views_Add(This,Node,viewOptions) ( (This)->lpVtbl -> Add(This,Node,viewOptions) ) #define Views_get__NewEnum(This,retval) ( (This)->lpVtbl -> get__NewEnum(This,retval) ) #endif #endif #ifndef <API key> #define <API key> extern const IID IID_View; typedef struct ViewVtbl { BEGIN_INTERFACE HRESULT(STDMETHODCALLTYPE * QueryInterface) (View * This, REFIID riid, void **ppvObject); ULONG(STDMETHODCALLTYPE * AddRef) (View * This); ULONG(STDMETHODCALLTYPE * Release) (View * This); HRESULT(STDMETHODCALLTYPE * GetTypeInfoCount) (View * This, UINT * pctinfo); HRESULT(STDMETHODCALLTYPE * GetTypeInfo) (View * This, UINT iTInfo, LCID lcid, ITypeInfo ** ppTInfo); HRESULT(STDMETHODCALLTYPE * GetIDsOfNames) (View * This, REFIID riid, LPOLESTR * rgszNames, UINT cNames, LCID lcid, DISPID * rgDispId); HRESULT(STDMETHODCALLTYPE * Invoke) (View * This, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS * pDispParams, VARIANT * pVarResult, EXCEPINFO * pExcepInfo, UINT * puArgErr); HRESULT(STDMETHODCALLTYPE * get_ActiveScopeNode) (View * This, PPNODE Node); HRESULT(STDMETHODCALLTYPE * put_ActiveScopeNode) (View * This, PNODE Node); HRESULT(STDMETHODCALLTYPE * get_Selection) (View * This, PPNODES Nodes); HRESULT(STDMETHODCALLTYPE * get_ListItems) (View * This, PPNODES Nodes); HRESULT(STDMETHODCALLTYPE * SnapinScopeObject) (View * This, VARIANT ScopeNode, PPDISPATCH ScopeNodeObject); HRESULT(STDMETHODCALLTYPE * <API key>) (View * This, PPDISPATCH SelectionObject); HRESULT(STDMETHODCALLTYPE * Is) (View * This, PVIEW View, VARIANT_BOOL * TheSame); HRESULT(STDMETHODCALLTYPE * get_Document) (View * This, PPDOCUMENT Document); HRESULT(STDMETHODCALLTYPE * SelectAll) (View * This); HRESULT(STDMETHODCALLTYPE * Select) (View * This, PNODE Node); HRESULT(STDMETHODCALLTYPE * Deselect) (View * This, PNODE Node); HRESULT(STDMETHODCALLTYPE * IsSelected) (View * This, PNODE Node, PBOOL IsSelected); HRESULT(STDMETHODCALLTYPE * <API key>) (View * This, VARIANT ScopeNode); HRESULT(STDMETHODCALLTYPE * <API key>) (View * This); HRESULT(STDMETHODCALLTYPE * CopyScopeNode) (View * This, VARIANT ScopeNode); HRESULT(STDMETHODCALLTYPE * CopySelection) (View * This); HRESULT(STDMETHODCALLTYPE * DeleteScopeNode) (View * This, VARIANT ScopeNode); HRESULT(STDMETHODCALLTYPE * DeleteSelection) (View * This); HRESULT(STDMETHODCALLTYPE * RenameScopeNode) (View * This, BSTR NewName, VARIANT ScopeNode); HRESULT(STDMETHODCALLTYPE * RenameSelectedItem) (View * This, BSTR NewName); HRESULT(STDMETHODCALLTYPE * <API key>) (View * This, VARIANT ScopeNode, PPCONTEXTMENU ContextMenu); HRESULT(STDMETHODCALLTYPE * <API key>) (View * This, PPCONTEXTMENU ContextMenu); HRESULT(STDMETHODCALLTYPE * RefreshScopeNode) (View * This, VARIANT ScopeNode); HRESULT(STDMETHODCALLTYPE * RefreshSelection) (View * This); HRESULT(STDMETHODCALLTYPE * <API key>) (View * This, BSTR MenuItemPath); HRESULT(STDMETHODCALLTYPE * <API key>) (View * This, BSTR MenuItemPath, VARIANT ScopeNode); HRESULT(STDMETHODCALLTYPE * ExecuteShellCommand) (View * This, BSTR Command, BSTR Directory, BSTR Parameters, BSTR WindowState); HRESULT(STDMETHODCALLTYPE * get_Frame) (View * This, PPFRAME Frame); HRESULT(STDMETHODCALLTYPE * Close) (View * This); HRESULT(STDMETHODCALLTYPE * <API key>) (View * This, PBOOL Visible); HRESULT(STDMETHODCALLTYPE * <API key>) (View * This, BOOL Visible); HRESULT(STDMETHODCALLTYPE * Back) (View * This); HRESULT(STDMETHODCALLTYPE * Forward) (View * This); HRESULT(STDMETHODCALLTYPE * put_StatusBarText) (View * This, BSTR StatusBarText); HRESULT(STDMETHODCALLTYPE * get_Memento) (View * This, PBSTR Memento); HRESULT(STDMETHODCALLTYPE * ViewMemento) (View * This, BSTR Memento); HRESULT(STDMETHODCALLTYPE * get_Columns) (View * This, PPCOLUMNS Columns); HRESULT(STDMETHODCALLTYPE * get_CellContents) (View * This, PNODE Node, long Column, PBSTR CellContents); HRESULT(STDMETHODCALLTYPE * ExportList) (View * This, BSTR File, EXPORTLISTOPTIONS exportoptions); HRESULT(STDMETHODCALLTYPE * get_ListViewMode) (View * This, PLISTVIEWMODE Mode); HRESULT(STDMETHODCALLTYPE * put_ListViewMode) (View * This, LISTVIEWMODE mode); HRESULT(STDMETHODCALLTYPE * get_ControlObject) (View * This, PPDISPATCH Control); END_INTERFACE } ViewVtbl; interface View { CONST_VTBL struct ViewVtbl *lpVtbl; }; #ifdef COBJMACROS #define View_QueryInterface(This,riid,ppvObject) ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define View_AddRef(This) ( (This)->lpVtbl -> AddRef(This) ) #define View_Release(This) ( (This)->lpVtbl -> Release(This) ) #define <API key>(This,pctinfo) ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define View_GetTypeInfo(This,iTInfo,lcid,ppTInfo) ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define View_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define View_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define <API key>(This,Node) ( (This)->lpVtbl -> get_ActiveScopeNode(This,Node) ) #define <API key>(This,Node) ( (This)->lpVtbl -> put_ActiveScopeNode(This,Node) ) #define View_get_Selection(This,Nodes) ( (This)->lpVtbl -> get_Selection(This,Nodes) ) #define View_get_ListItems(This,Nodes) ( (This)->lpVtbl -> get_ListItems(This,Nodes) ) #define <API key>(This,ScopeNode,ScopeNodeObject) ( (This)->lpVtbl -> SnapinScopeObject(This,ScopeNode,ScopeNodeObject) ) #define <API key>(This,SelectionObject) ( (This)->lpVtbl -> <API key>(This,SelectionObject) ) #define View_Is(This,View,TheSame) ( (This)->lpVtbl -> Is(This,View,TheSame) ) #define View_get_Document(This,Document) ( (This)->lpVtbl -> get_Document(This,Document) ) #define View_SelectAll(This) ( (This)->lpVtbl -> SelectAll(This) ) #define View_Select(This,Node) ( (This)->lpVtbl -> Select(This,Node) ) #define View_Deselect(This,Node) ( (This)->lpVtbl -> Deselect(This,Node) ) #define View_IsSelected(This,Node,IsSelected) ( (This)->lpVtbl -> IsSelected(This,Node,IsSelected) ) #define <API key>(This,ScopeNode) ( (This)->lpVtbl -> <API key>(This,ScopeNode) ) #define <API key>(This) ( (This)->lpVtbl -> <API key>(This) ) #define View_CopyScopeNode(This,ScopeNode) ( (This)->lpVtbl -> CopyScopeNode(This,ScopeNode) ) #define View_CopySelection(This) ( (This)->lpVtbl -> CopySelection(This) ) #define <API key>(This,ScopeNode) ( (This)->lpVtbl -> DeleteScopeNode(This,ScopeNode) ) #define <API key>(This) ( (This)->lpVtbl -> DeleteSelection(This) ) #define <API key>(This,NewName,ScopeNode) ( (This)->lpVtbl -> RenameScopeNode(This,NewName,ScopeNode) ) #define <API key>(This,NewName) ( (This)->lpVtbl -> RenameSelectedItem(This,NewName) ) #define <API key>(This,ScopeNode,ContextMenu) ( (This)->lpVtbl -> <API key>(This,ScopeNode,ContextMenu) ) #define <API key>(This,ContextMenu) ( (This)->lpVtbl -> <API key>(This,ContextMenu) ) #define <API key>(This,ScopeNode) ( (This)->lpVtbl -> RefreshScopeNode(This,ScopeNode) ) #define <API key>(This) ( (This)->lpVtbl -> RefreshSelection(This) ) #define <API key>(This,MenuItemPath) ( (This)->lpVtbl -> <API key>(This,MenuItemPath) ) #define <API key>(This,MenuItemPath,ScopeNode) ( (This)->lpVtbl -> <API key>(This,MenuItemPath,ScopeNode) ) #define <API key>(This,Command,Directory,Parameters,WindowState) ( (This)->lpVtbl -> ExecuteShellCommand(This,Command,Directory,Parameters,WindowState) ) #define View_get_Frame(This,Frame) ( (This)->lpVtbl -> get_Frame(This,Frame) ) #define View_Close(This) ( (This)->lpVtbl -> Close(This) ) #define <API key>(This,Visible) ( (This)->lpVtbl -> <API key>(This,Visible) ) #define <API key>(This,Visible) ( (This)->lpVtbl -> <API key>(This,Visible) ) #define View_Back(This) ( (This)->lpVtbl -> Back(This) ) #define View_Forward(This) ( (This)->lpVtbl -> Forward(This) ) #define <API key>(This,StatusBarText) ( (This)->lpVtbl -> put_StatusBarText(This,StatusBarText) ) #define View_get_Memento(This,Memento) ( (This)->lpVtbl -> get_Memento(This,Memento) ) #define View_ViewMemento(This,Memento) ( (This)->lpVtbl -> ViewMemento(This,Memento) ) #define View_get_Columns(This,Columns) ( (This)->lpVtbl -> get_Columns(This,Columns) ) #define <API key>(This,Node,Column,CellContents) ( (This)->lpVtbl -> get_CellContents(This,Node,Column,CellContents) ) #define View_ExportList(This,File,exportoptions) ( (This)->lpVtbl -> ExportList(This,File,exportoptions) ) #define <API key>(This,Mode) ( (This)->lpVtbl -> get_ListViewMode(This,Mode) ) #define <API key>(This,mode) ( (This)->lpVtbl -> put_ListViewMode(This,mode) ) #define <API key>(This,Control) ( (This)->lpVtbl -> get_ControlObject(This,Control) ) #endif #endif #ifndef <API key> #define <API key> extern const IID IID_Nodes; typedef struct NodesVtbl { BEGIN_INTERFACE HRESULT(STDMETHODCALLTYPE * QueryInterface) (Nodes * This, REFIID riid, void **ppvObject); ULONG(STDMETHODCALLTYPE * AddRef) (Nodes * This); ULONG(STDMETHODCALLTYPE * Release) (Nodes * This); HRESULT(STDMETHODCALLTYPE * GetTypeInfoCount) (Nodes * This, UINT * pctinfo); HRESULT(STDMETHODCALLTYPE * GetTypeInfo) (Nodes * This, UINT iTInfo, LCID lcid, ITypeInfo ** ppTInfo); HRESULT(STDMETHODCALLTYPE * GetIDsOfNames) (Nodes * This, REFIID riid, LPOLESTR * rgszNames, UINT cNames, LCID lcid, DISPID * rgDispId); HRESULT(STDMETHODCALLTYPE * Invoke) (Nodes * This, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS * pDispParams, VARIANT * pVarResult, EXCEPINFO * pExcepInfo, UINT * puArgErr); HRESULT(STDMETHODCALLTYPE * get__NewEnum) (Nodes * This, IUnknown ** retval); HRESULT(STDMETHODCALLTYPE * Item) (Nodes * This, long Index, PPNODE Node); HRESULT(STDMETHODCALLTYPE * get_Count) (Nodes * This, PLONG Count); END_INTERFACE } NodesVtbl; interface Nodes { CONST_VTBL struct NodesVtbl *lpVtbl; }; #ifdef COBJMACROS #define <API key>(This,riid,ppvObject) ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define Nodes_AddRef(This) ( (This)->lpVtbl -> AddRef(This) ) #define Nodes_Release(This) ( (This)->lpVtbl -> Release(This) ) #define <API key>(This,pctinfo) ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define Nodes_GetTypeInfo(This,iTInfo,lcid,ppTInfo) ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define Nodes_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define Nodes_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define Nodes_get__NewEnum(This,retval) ( (This)->lpVtbl -> get__NewEnum(This,retval) ) #define Nodes_Item(This,Index,Node) ( (This)->lpVtbl -> Item(This,Index,Node) ) #define Nodes_get_Count(This,Count) ( (This)->lpVtbl -> get_Count(This,Count) ) #endif #endif #ifndef <API key> #define <API key> extern const IID IID_ContextMenu; typedef struct ContextMenuVtbl { BEGIN_INTERFACE HRESULT(STDMETHODCALLTYPE * QueryInterface) (ContextMenu * This, REFIID riid, void **ppvObject); ULONG(STDMETHODCALLTYPE * AddRef) (ContextMenu * This); ULONG(STDMETHODCALLTYPE * Release) (ContextMenu * This); HRESULT(STDMETHODCALLTYPE * GetTypeInfoCount) (ContextMenu * This, UINT * pctinfo); HRESULT(STDMETHODCALLTYPE * GetTypeInfo) (ContextMenu * This, UINT iTInfo, LCID lcid, ITypeInfo ** ppTInfo); HRESULT(STDMETHODCALLTYPE * GetIDsOfNames) (ContextMenu * This, REFIID riid, LPOLESTR * rgszNames, UINT cNames, LCID lcid, DISPID * rgDispId); HRESULT(STDMETHODCALLTYPE * Invoke) (ContextMenu * This, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS * pDispParams, VARIANT * pVarResult, EXCEPINFO * pExcepInfo, UINT * puArgErr); HRESULT(STDMETHODCALLTYPE * get__NewEnum) (ContextMenu * This, IUnknown ** retval); HRESULT(STDMETHODCALLTYPE * get_Item) (ContextMenu * This, VARIANT IndexOrPath, PPMENUITEM MenuItem); HRESULT(STDMETHODCALLTYPE * get_Count) (ContextMenu * This, PLONG Count); END_INTERFACE } ContextMenuVtbl; interface ContextMenu { CONST_VTBL struct ContextMenuVtbl *lpVtbl; }; #ifdef COBJMACROS #define <API key>(This,riid,ppvObject) ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define ContextMenu_AddRef(This) ( (This)->lpVtbl -> AddRef(This) ) #define ContextMenu_Release(This) ( (This)->lpVtbl -> Release(This) ) #define <API key>(This,pctinfo) ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define <API key>(This,iTInfo,lcid,ppTInfo) ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define <API key>(This,riid,rgszNames,cNames,lcid,rgDispId) ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define ContextMenu_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define <API key>(This,retval) ( (This)->lpVtbl -> get__NewEnum(This,retval) ) #define <API key>(This,IndexOrPath,MenuItem) ( (This)->lpVtbl -> get_Item(This,IndexOrPath,MenuItem) ) #define <API key>(This,Count) ( (This)->lpVtbl -> get_Count(This,Count) ) #endif #endif #ifndef <API key> #define <API key> extern const IID IID_MenuItem; typedef struct MenuItemVtbl { BEGIN_INTERFACE HRESULT(STDMETHODCALLTYPE * QueryInterface) (MenuItem * This, REFIID riid, void **ppvObject); ULONG(STDMETHODCALLTYPE * AddRef) (MenuItem * This); ULONG(STDMETHODCALLTYPE * Release) (MenuItem * This); HRESULT(STDMETHODCALLTYPE * GetTypeInfoCount) (MenuItem * This, UINT * pctinfo); HRESULT(STDMETHODCALLTYPE * GetTypeInfo) (MenuItem * This, UINT iTInfo, LCID lcid, ITypeInfo ** ppTInfo); HRESULT(STDMETHODCALLTYPE * GetIDsOfNames) (MenuItem * This, REFIID riid, LPOLESTR * rgszNames, UINT cNames, LCID lcid, DISPID * rgDispId); HRESULT(STDMETHODCALLTYPE * Invoke) (MenuItem * This, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS * pDispParams, VARIANT * pVarResult, EXCEPINFO * pExcepInfo, UINT * puArgErr); HRESULT(STDMETHODCALLTYPE * get_DisplayName) (MenuItem * This, PBSTR DisplayName); HRESULT(STDMETHODCALLTYPE * <API key>) (MenuItem * This, PBSTR <API key>); HRESULT(STDMETHODCALLTYPE * get_Path) (MenuItem * This, PBSTR Path); HRESULT(STDMETHODCALLTYPE * <API key>) (MenuItem * This, PBSTR <API key>); HRESULT(STDMETHODCALLTYPE * Execute) (MenuItem * This); HRESULT(STDMETHODCALLTYPE * get_Enabled) (MenuItem * This, PBOOL Enabled); END_INTERFACE } MenuItemVtbl; interface MenuItem { CONST_VTBL struct MenuItemVtbl *lpVtbl; }; #ifdef COBJMACROS #define <API key>(This,riid,ppvObject) ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define MenuItem_AddRef(This) ( (This)->lpVtbl -> AddRef(This) ) #define MenuItem_Release(This) ( (This)->lpVtbl -> Release(This) ) #define <API key>(This,pctinfo) ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define <API key>(This,iTInfo,lcid,ppTInfo) ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define <API key>(This,riid,rgszNames,cNames,lcid,rgDispId) ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define MenuItem_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define <API key>(This,DisplayName) ( (This)->lpVtbl -> get_DisplayName(This,DisplayName) ) #define <API key>(This,<API key>) ( (This)->lpVtbl -> <API key>(This,<API key>) ) #define MenuItem_get_Path(This,Path) ( (This)->lpVtbl -> get_Path(This,Path) ) #define <API key>(This,<API key>) ( (This)->lpVtbl -> <API key>(This,<API key>) ) #define MenuItem_Execute(This) ( (This)->lpVtbl -> Execute(This) ) #define <API key>(This,Enabled) ( (This)->lpVtbl -> get_Enabled(This,Enabled) ) #endif #endif #ifndef <API key> #define <API key> extern const IID IID_Properties; typedef struct PropertiesVtbl { BEGIN_INTERFACE HRESULT(STDMETHODCALLTYPE * QueryInterface) (Properties * This, REFIID riid, void **ppvObject); ULONG(STDMETHODCALLTYPE * AddRef) (Properties * This); ULONG(STDMETHODCALLTYPE * Release) (Properties * This); HRESULT(STDMETHODCALLTYPE * GetTypeInfoCount) (Properties * This, UINT * pctinfo); HRESULT(STDMETHODCALLTYPE * GetTypeInfo) (Properties * This, UINT iTInfo, LCID lcid, ITypeInfo ** ppTInfo); HRESULT(STDMETHODCALLTYPE * GetIDsOfNames) (Properties * This, REFIID riid, LPOLESTR * rgszNames, UINT cNames, LCID lcid, DISPID * rgDispId); HRESULT(STDMETHODCALLTYPE * Invoke) (Properties * This, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS * pDispParams, VARIANT * pVarResult, EXCEPINFO * pExcepInfo, UINT * puArgErr); HRESULT(STDMETHODCALLTYPE * get__NewEnum) (Properties * This, IUnknown ** retval); HRESULT(STDMETHODCALLTYPE * Item) (Properties * This, BSTR Name, PPPROPERTY Property); HRESULT(STDMETHODCALLTYPE * get_Count) (Properties * This, PLONG Count); HRESULT(STDMETHODCALLTYPE * Remove) (Properties * This, BSTR Name); END_INTERFACE } PropertiesVtbl; interface Properties { CONST_VTBL struct PropertiesVtbl *lpVtbl; }; #ifdef COBJMACROS #define <API key>(This,riid,ppvObject) ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define Properties_AddRef(This) ( (This)->lpVtbl -> AddRef(This) ) #define Properties_Release(This) ( (This)->lpVtbl -> Release(This) ) #define <API key>(This,pctinfo) ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define <API key>(This,iTInfo,lcid,ppTInfo) ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define <API key>(This,riid,rgszNames,cNames,lcid,rgDispId) ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define Properties_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define <API key>(This,retval) ( (This)->lpVtbl -> get__NewEnum(This,retval) ) #define Properties_Item(This,Name,Property) ( (This)->lpVtbl -> Item(This,Name,Property) ) #define <API key>(This,Count) ( (This)->lpVtbl -> get_Count(This,Count) ) #define Properties_Remove(This,Name) ( (This)->lpVtbl -> Remove(This,Name) ) #endif #endif #ifndef <API key> #define <API key> extern const IID IID_Property; typedef struct PropertyVtbl { BEGIN_INTERFACE HRESULT(STDMETHODCALLTYPE * QueryInterface) (Property * This, REFIID riid, void **ppvObject); ULONG(STDMETHODCALLTYPE * AddRef) (Property * This); ULONG(STDMETHODCALLTYPE * Release) (Property * This); HRESULT(STDMETHODCALLTYPE * GetTypeInfoCount) (Property * This, UINT * pctinfo); HRESULT(STDMETHODCALLTYPE * GetTypeInfo) (Property * This, UINT iTInfo, LCID lcid, ITypeInfo ** ppTInfo); HRESULT(STDMETHODCALLTYPE * GetIDsOfNames) (Property * This, REFIID riid, LPOLESTR * rgszNames, UINT cNames, LCID lcid, DISPID * rgDispId); HRESULT(STDMETHODCALLTYPE * Invoke) (Property * This, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS * pDispParams, VARIANT * pVarResult, EXCEPINFO * pExcepInfo, UINT * puArgErr); HRESULT(STDMETHODCALLTYPE * get_Value) (Property * This, PVARIANT Value); HRESULT(STDMETHODCALLTYPE * put_Value) (Property * This, VARIANT Value); HRESULT(STDMETHODCALLTYPE * get_Name) (Property * This, PBSTR Name); END_INTERFACE } PropertyVtbl; interface Property { CONST_VTBL struct PropertyVtbl *lpVtbl; }; #ifdef COBJMACROS #define <API key>(This,riid,ppvObject) ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define Property_AddRef(This) ( (This)->lpVtbl -> AddRef(This) ) #define Property_Release(This) ( (This)->lpVtbl -> Release(This) ) #define <API key>(This,pctinfo) ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define <API key>(This,iTInfo,lcid,ppTInfo) ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define <API key>(This,riid,rgszNames,cNames,lcid,rgDispId) ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define Property_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define Property_get_Value(This,Value) ( (This)->lpVtbl -> get_Value(This,Value) ) #define Property_put_Value(This,Value) ( (This)->lpVtbl -> put_Value(This,Value) ) #define Property_get_Name(This,Name) ( (This)->lpVtbl -> get_Name(This,Name) ) #endif #endif #endif #endif extern RPC_IF_HANDLE <API key>; extern RPC_IF_HANDLE <API key>; unsigned long __RPC_USER VARIANT_UserSize(unsigned long *, unsigned long, VARIANT *); unsigned char *__RPC_USER VARIANT_UserMarshal(unsigned long *, unsigned char *, VARIANT *); unsigned char *__RPC_USER <API key>(unsigned long *, unsigned char *, VARIANT *); void __RPC_USER VARIANT_UserFree(unsigned long *, VARIANT *); unsigned long __RPC_USER VARIANT_UserSize64(unsigned long *, unsigned long, VARIANT *); unsigned char *__RPC_USER <API key>(unsigned long *, unsigned char *, VARIANT *); unsigned char *__RPC_USER <API key>(unsigned long *, unsigned char *, VARIANT *); void __RPC_USER VARIANT_UserFree64(unsigned long *, VARIANT *); #endif
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ #ifndef <API key> #define <API key> #include <webkit/webkit.h> #include "dh-base.h" #include "dh-link.h" G_BEGIN_DECLS #define <API key> (<API key> ()) #define DH_ASSISTANT_VIEW(i) (<API key> ((i), <API key>, DhAssistantView)) #define <API key>(c) (<API key> ((c), <API key>, <API key>)) #define <API key>(i) (<API key> ((i), <API key>)) #define <API key>(c) (<API key> ((c), DH_ASSISTANT_VIEW)) #define <API key>(i) (<API key> ((i), <API key>, DhAssistantView)) typedef struct _DhAssistantView DhAssistantView; typedef struct <API key> <API key>; struct _DhAssistantView { WebKitWebView parent_instance; }; struct <API key> { WebKitWebViewClass parent_class; }; GType <API key> (void) G_GNUC_CONST; GtkWidget* <API key> (void); gboolean <API key> (DhAssistantView *view, const gchar *str); DhBase* <API key> (DhAssistantView *view); void <API key> (DhAssistantView *view, DhBase *base); gboolean <API key> (DhAssistantView *view, DhLink *link); G_END_DECLS #endif /* <API key> */
package edu.nd.nina.event; /** * An event which indicates that a graph edge has changed, or is about to * change. The event can be used either as an indication <i>after</i> the edge * has been added or removed, or <i>before</i> it is added. The type of the * event can be tested using the {@link * edu.nd.nina.event.GraphChangeEvent#getType()} method. * * @author Barak Naveh * @since Aug 10, 2003 */ public class <API key><V, E> extends GraphChangeEvent { private static final long serialVersionUID = <API key>; /** * Before edge added event. This event is fired before an edge is added to a * graph. */ public static final int BEFORE_EDGE_ADDED = 21; /** * Before edge removed event. This event is fired before an edge is removed * from a graph. */ public static final int BEFORE_EDGE_REMOVED = 22; /** * Edge added event. This event is fired after an edge is added to a graph. */ public static final int EDGE_ADDED = 23; /** * Edge removed event. This event is fired after an edge is removed from a * graph. */ public static final int EDGE_REMOVED = 24; /** * The edge that this event is related to. */ protected E edge; /** * Constructor for <API key>. * * @param eventSource the source of this event. * @param type the event type of this event. * @param e the edge that this event is related to. */ public <API key>(Object eventSource, int type, E e) { super(eventSource, type); edge = e; } /** * Returns the edge that this event is related to. * * @return the edge that this event is related to. */ public E getEdge() { return edge; } } // End <API key>.java
<?php namespace pocketmine\level\format\mcregion; use pocketmine\level\format\FullChunk; use pocketmine\level\format\LevelProvider; use pocketmine\nbt\NBT; use pocketmine\nbt\tag\Byte; use pocketmine\nbt\tag\ByteArray; use pocketmine\nbt\tag\Compound; use pocketmine\nbt\tag\Enum; use pocketmine\nbt\tag\Int; use pocketmine\nbt\tag\IntArray; use pocketmine\nbt\tag\Long; use pocketmine\utils\Binary; use pocketmine\utils\ChunkException; use pocketmine\utils\MainLogger; class RegionLoader{ const VERSION = 1; const COMPRESSION_GZIP = 1; const COMPRESSION_ZLIB = 2; const MAX_SECTOR_LENGTH = 256 << 12; //256 sectors, (1 MiB) public static $COMPRESSION_LEVEL = 7; protected $x; protected $z; protected $filePath; protected $filePointer; protected $lastSector; /** @var LevelProvider */ protected $levelProvider; protected $locationTable = []; public $lastUsed; public function __construct(LevelProvider $level, $regionX, $regionZ){ $this->x = $regionX; $this->z = $regionZ; $this->levelProvider = $level; $this->filePath = $this->levelProvider->getPath() . "region/r.$regionX.$regionZ.mcr"; $exists = file_exists($this->filePath); touch($this->filePath); $this->filePointer = fopen($this->filePath, "r+b"); <API key>($this->filePointer, 1024 * 16); //16KB <API key>($this->filePointer, 1024 * 16); //16KB if(!$exists){ $this->createBlank(); }else{ $this->loadLocationTable(); } $this->lastUsed = time(); } public function __destruct(){ if(is_resource($this->filePointer)){ $this->writeLocationTable(); fclose($this->filePointer); } } protected function isChunkGenerated($index){ return !($this->locationTable[$index][0] === 0 or $this->locationTable[$index][1] === 0); } public function readChunk($x, $z, $generate = true, $forward = false){ $index = self::getChunkOffset($x, $z); if($index < 0 or $index >= 4096){ return null; } $this->lastUsed = time(); if(!$this->isChunkGenerated($index)){ if($generate === true){ //Allocate space $this->locationTable[$index][0] = ++$this->lastSector; $this->locationTable[$index][1] = 1; fseek($this->filePointer, $this->locationTable[$index][0] << 12); fwrite($this->filePointer, str_pad(Binary::writeInt(0) . chr(self::COMPRESSION_ZLIB), 4096, "\x00", STR_PAD_RIGHT)); $this->writeLocationIndex($index); }else{ return null; } } fseek($this->filePointer, $this->locationTable[$index][0] << 12); $length = Binary::readInt(fread($this->filePointer, 4)); $compression = ord(fgetc($this->filePointer)); if($length <= 0 or $length > self::MAX_SECTOR_LENGTH){ //Not yet generated / corrupted if($length >= self::MAX_SECTOR_LENGTH){ $this->locationTable[$index][0] = ++$this->lastSector; $this->locationTable[$index][1] = 1; MainLogger::getLogger()->error("Corrupted chunk header detected"); } $this->generateChunk($x, $z); fseek($this->filePointer, $this->locationTable[$index][0] << 12); $length = Binary::readInt(fread($this->filePointer, 4)); $compression = ord(fgetc($this->filePointer)); } if($length > ($this->locationTable[$index][1] << 12)){ //Invalid chunk, bigger than defined number of sectors MainLogger::getLogger()->error("Corrupted bigger chunk detected"); $this->locationTable[$index][1] = $length >> 12; $this->writeLocationIndex($index); }elseif($compression !== self::COMPRESSION_ZLIB and $compression !== self::COMPRESSION_GZIP){ MainLogger::getLogger()->error("Invalid compression type"); return null; } $chunk = Chunk::fromBinary(fread($this->filePointer, $length - 1), $this->levelProvider); if($chunk instanceof Chunk){ return $chunk; }elseif($forward === false){ MainLogger::getLogger()->error("Corrupted chunk detected"); $this->generateChunk($x, $z); return $this->readChunk($x, $z, $generate, true); }else{ return null; } } public function chunkExists($x, $z){ return $this->isChunkGenerated(self::getChunkOffset($x, $z)); } public function generateChunk($x, $z){ $nbt = new Compound("Level", []); $nbt->xPos = new Int("xPos", ($this->getX() * 32) + $x); $nbt->zPos = new Int("zPos", ($this->getZ() * 32) + $z); $nbt->LastUpdate = new Long("LastUpdate", 0); $nbt->LightPopulated = new Byte("LightPopulated", 0); $nbt->TerrainPopulated = new Byte("TerrainPopulated", 0); $nbt->V = new Byte("V", self::VERSION); $nbt->InhabitedTime = new Long("InhabitedTime", 0); $nbt->Biomes = new ByteArray("Biomes", str_repeat(Binary::writeByte(-1), 256)); $nbt->HeightMap = new IntArray("HeightMap", array_fill(0, 256, 127)); $nbt->BiomeColors = new IntArray("BiomeColors", array_fill(0, 256, Binary::readInt("\x00\x85\xb2\x4a"))); $nbt->Blocks = new ByteArray("Blocks", str_repeat("\x00", 32768)); $nbt->Data = new ByteArray("Data", $half = str_repeat("\x00", 16384)); $nbt->SkyLight = new ByteArray("SkyLight", $half); $nbt->BlockLight = new ByteArray("BlockLight", $half); $nbt->Entities = new Enum("Entities", []); $nbt->Entities->setTagType(NBT::TAG_Compound); $nbt->TileEntities = new Enum("TileEntities", []); $nbt->TileEntities->setTagType(NBT::TAG_Compound); $nbt->TileTicks = new Enum("TileTicks", []); $nbt->TileTicks->setTagType(NBT::TAG_Compound); $writer = new NBT(NBT::BIG_ENDIAN); $nbt->setName("Level"); $writer->setData(new Compound("", ["Level" => $nbt])); $chunkData = $writer->writeCompressed(<API key>, self::$COMPRESSION_LEVEL); if($chunkData !== false){ $this->saveChunk($x, $z, $chunkData); } } protected function saveChunk($x, $z, $chunkData){ $length = strlen($chunkData) + 1; if($length + 4 > self::MAX_SECTOR_LENGTH){ throw new ChunkException("Chunk is too big! ".($length + 4)." > ".self::MAX_SECTOR_LENGTH); } $sectors = (int) ceil(($length + 4) / 4096); $index = self::getChunkOffset($x, $z); if($this->locationTable[$index][1] < $sectors){ $this->locationTable[$index][0] = $this->lastSector + 1; $this->lastSector += $sectors; //The GC will clean this shift "later" } $this->locationTable[$index][1] = $sectors; $this->locationTable[$index][2] = time(); fseek($this->filePointer, $this->locationTable[$index][0] << 12); fwrite($this->filePointer, str_pad(Binary::writeInt($length) . chr(self::COMPRESSION_ZLIB) . $chunkData, $sectors << 12, "\x00", STR_PAD_RIGHT)); $this->writeLocationIndex($index); } public function removeChunk($x, $z){ $index = self::getChunkOffset($x, $z); $this->locationTable[$index][0] = 0; $this->locationTable[$index][1] = 0; } public function writeChunk(FullChunk $chunk){ $this->lastUsed = time(); $chunkData = $chunk->toBinary(); if($chunkData !== false){ $this->saveChunk($chunk->getX() - ($this->getX() * 32), $chunk->getZ() - ($this->getZ() * 32), $chunkData); } } protected static function getChunkOffset($x, $z){ return $x + ($z << 5); } public function close(){ $this->writeLocationTable(); fclose($this->filePointer); $this->levelProvider = null; } public function doSlowCleanUp(){ for($i = 0; $i < 1024; ++$i){ if($this->locationTable[$i][0] === 0 or $this->locationTable[$i][1] === 0){ continue; } fseek($this->filePointer, $this->locationTable[$i][0] << 12); $chunk = fread($this->filePointer, $this->locationTable[$i][1] << 12); $length = Binary::readInt(substr($chunk, 0, 4)); if($length <= 1){ $this->locationTable[$i] = [0, 0, 0]; //Non-generated chunk, remove it from index } try{ $chunk = zlib_decode(substr($chunk, 5)); }catch(\Exception $e){ $this->locationTable[$i] = [0, 0, 0]; //Corrupted chunk, remove it continue; } $chunk = chr(self::COMPRESSION_ZLIB) . zlib_encode($chunk, <API key>, 9); $chunk = Binary::writeInt(strlen($chunk)) . $chunk; $sectors = (int) ceil(strlen($chunk) / 4096); if($sectors > $this->locationTable[$i][1]){ $this->locationTable[$i][0] = $this->lastSector + 1; $this->lastSector += $sectors; } fseek($this->filePointer, $this->locationTable[$i][0] << 12); fwrite($this->filePointer, str_pad($chunk, $sectors << 12, "\x00", STR_PAD_RIGHT)); } $this->writeLocationTable(); $n = $this->cleanGarbage(); $this->writeLocationTable(); return $n; } private function cleanGarbage(){ $sectors = []; foreach($this->locationTable as $index => $data){ //Calculate file usage if($data[0] === 0 or $data[1] === 0){ $this->locationTable[$index] = [0, 0, 0]; continue; } for($i = 0; $i < $data[1]; ++$i){ $sectors[$data[0]] = $index; } } if(count($sectors) === ($this->lastSector - 2)){ //No collection needed return 0; } ksort($sectors); $shift = 0; $lastSector = 1; //First chunk - 1 fseek($this->filePointer, 8192); $sector = 2; foreach($sectors as $sector => $index){ if(($sector - $lastSector) > 1){ $shift += $sector - $lastSector - 1; } if($shift > 0){ fseek($this->filePointer, $sector << 12); $old = fread($this->filePointer, 4096); fseek($this->filePointer, ($sector - $shift) << 12); fwrite($this->filePointer, $old, 4096); } $this->locationTable[$index][0] -= $shift; $lastSector = $sector; } ftruncate($this->filePointer, ($sector + 1) << 12); //Truncate to the end of file written return $shift; } protected function loadLocationTable(){ fseek($this->filePointer, 0); $this->lastSector = 1; $table = fread($this->filePointer, 4 * 1024 * 2); //1024 records * 4 bytes * 2 times for($i = 0; $i < 1024; ++$i){ $index = unpack("N", substr($table, $i << 2, 4))[1]; $this->locationTable[$i] = [$index >> 8, $index & 0xff, unpack("N", substr($table, 4096 + ($i << 2), 4))[1]]; if(($this->locationTable[$i][0] + $this->locationTable[$i][1] - 1) > $this->lastSector){ $this->lastSector = $this->locationTable[$i][0] + $this->locationTable[$i][1] - 1; } } } private function writeLocationTable(){ $write = []; for($i = 0; $i < 1024; ++$i){ $write[] = (($this->locationTable[$i][0] << 8) | $this->locationTable[$i][1]); } for($i = 0; $i < 1024; ++$i){ $write[] = $this->locationTable[$i][2]; } fseek($this->filePointer, 0); fwrite($this->filePointer, pack("N*", ...$write), 4096 * 2); } protected function writeLocationIndex($index){ fseek($this->filePointer, $index << 2); fwrite($this->filePointer, Binary::writeInt(($this->locationTable[$index][0] << 8) | $this->locationTable[$index][1]), 4); fseek($this->filePointer, 4096 + ($index << 2)); fwrite($this->filePointer, Binary::writeInt($this->locationTable[$index][2]), 4); } protected function createBlank(){ fseek($this->filePointer, 0); ftruncate($this->filePointer, 0); $this->lastSector = 1; $table = ""; for($i = 0; $i < 1024; ++$i){ $this->locationTable[$i] = [0, 0]; $table .= Binary::writeInt(0); } $time = time(); for($i = 0; $i < 1024; ++$i){ $this->locationTable[$i][2] = $time; $table .= Binary::writeInt($time); } fwrite($this->filePointer, $table, 4096 * 2); } public function getX(){ return $this->x; } public function getZ(){ return $this->z; } }
#PBS -S /bin/bash #PBS -N mnakao_job #PBS -A XMPTCA #PBS -q tcaq-q1 #PBS -l select=1:ncpus=1:host=tcag-0001-eth0+1:ncpus=1:host=tcag-0002-eth0+1:ncpus=1:host=tcag-0003-eth0+1:ncpus=1:host=tcag-0004-eth0+1:ncpus=1:host=tcag-0005-eth0+1:ncpus=1:host=tcag-0006-eth0+1:ncpus=1:host=tcag-0007-eth0+1:ncpus=1:host=tcag-0008-eth0 #PBS -l walltime=00:01:00 . /opt/Modules/default/init/bash # select=NODES:ncpus=CORES:mpiprocs=PROCS:ompthreads=THREADS:mem=MEMORY # NODES : num of nodes # CORES : num of cores per node # PROCS : num of procs per node # THREADS : num of threads per process NP=8 module purge module load cuda/6.5.14 mvapich2-gdr/2.0_gnu_cuda-6.5 export LD_LIBRARY_PATH=/work/XMPTCA/mnakao/omni-compiler/PEACH2:$LD_LIBRARY_PATH cd $PBS_O_WORKDIR OPT="MV2_GPUDIRECT_LIMIT=4194304 MV2_ENABLE_AFFINITY=0 <API key>=1 numactl --cpunodebind=0 --localalloc" for i in $(seq 1 10) do mpirun_rsh -np $NP -hostfile $PBS_NODEFILE $OPT ./L done
<?php namespace Pardisan\Support\Facades; use Illuminate\Support\Facades\Facade; class Menu extends Facade { /** * Get the registered name of the component. * * @return string */ protected static function getFacadeAccessor() { return 'menu'; } }
package edu.mit.blocks.codeblockutil; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Cursor; import java.awt.Dimension; import java.awt.Font; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Point; import java.awt.RenderingHints; import java.awt.Toolkit; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.FocusEvent; import java.awt.event.FocusListener; import java.awt.event.InputEvent; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; import java.awt.geom.AffineTransform; import java.awt.geom.GeneralPath; import javax.swing.BorderFactory; import javax.swing.JComponent; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTextField; import javax.swing.JToolTip; import javax.swing.KeyStroke; import javax.swing.border.Border; import javax.swing.border.CompoundBorder; import javax.swing.border.EmptyBorder; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; import edu.mit.blocks.renderable.BlockLabel; public class LabelWidget extends JComponent { public static final int <API key> = 7; private static final long serialVersionUID = 837647234895L; /** Border of textfield*/ private static final Border textFieldBorder = new CompoundBorder(BorderFactory.<API key>(), new EmptyBorder(1, 2, 1, 2)); /** Number formatter for this label */ private static final NumberFormatter nf = new NumberFormatter(NumberFormatter.MEDIUM_PRECISION); /** Label that is visable iff editingText is false */ private final ShadowLabel textLabel = new ShadowLabel(); /** TextField that is visable iff editingText is true */ private final BlockLabelTextField textField = new BlockLabelTextField(); /** drop down menu icon */ private final LabelMenu menu = new LabelMenu(); ; /** The label text before user begins edit (applies only to editable labels)*/ private String labelBeforeEdit = ""; /** If this is a number, then only allow nagatvie signs and periods at certain spots */ private boolean isNumber = false; /** Is labelText editable by the user -- default true */ private boolean isEditable = false; /** If focus is true, then show the combo pop up menu */ private boolean isFocused = false; /** Has ComboPopup accessable selections */ private boolean hasSiblings = false; /** True if TEXTFIELD is being edited by user. */ private boolean editingText; /** the background color of the tooltip */ private Color tooltipBackground = new Color(255, 255, 225); private double zoom = 1.0; private BlockLabel blockLabel; /** * BlockLabel Constructor that takes in BlockID as well. * Unfortunately BlockID is needed, so the label can redirect mouse actions. * */ public LabelWidget(String initLabelText, Color fieldColor, Color tooltipBackground) { if (initLabelText == null) { initLabelText = ""; } this.<API key>(false);//MOVE DEFAULT FOCUS TRAVERSAL KEYS SUCH AS TABS this.setLayout(new BorderLayout()); this.tooltipBackground = tooltipBackground; this.labelBeforeEdit = initLabelText; //set up textfield colors textField.setForeground(Color.WHITE);//white text textField.setBackground(fieldColor);//background matching block color textField.setCaretColor(Color.WHITE);//white caret textField.setSelectionColor(Color.BLACK);//black highlight textField.<API key>(Color.WHITE);//white text when highlighted textField.setBorder(textFieldBorder); textField.setMargin(textFieldBorder.getBorderInsets(textField)); } public void setBlockLabel(BlockLabel blockLabel) { this.blockLabel = blockLabel; } protected void fireTextChanged(String text) { blockLabel.textChanged(text); } protected void fireGenusChanged(String genus) { blockLabel.genusChanged(genus); } protected void <API key>(Dimension value) { blockLabel.dimensionsChanged(value); } protected boolean isTextValid(String text) { return blockLabel.textValid(text); } public void <API key>(KeyListener l) { textField.addKeyListener(l); } public void <API key>(MouseListener l) { textLabel.addMouseListener(l); } public void <API key>(MouseMotionListener l) { textLabel.<API key>(l); } / LABEL CONFIGURATION public void showMenuIcon(boolean show) { if (this.hasSiblings) { isFocused = show; // repaints the menu and items with the new zoom level menu.popupmenu.setZoomLevel(zoom); menu.repaint(); } } /** * setEditingState sets the current editing state of the BlockLabel. * Repaints BlockLabel to reflect the change. */ public void setEditingState(boolean editing) { if (editing) { editingText = true; textField.setText(textLabel.getText().trim()); labelBeforeEdit = textLabel.getText(); this.removeAll(); this.add(textField); textField.grabFocus(); } else { //update to current textfield.text //if text entered was not empty and if it was editing before if (editingText) { //make sure to remove leading and trailing spaces before testing if text is valid //TODO if allow labels to have leading and trailing spaces, will need to modify this if statement if (isTextValid(textField.getText().trim())) { setText(textField.getText()); } else { setText(labelBeforeEdit); } } editingText = false; } } /** * editingText returns if BlockLable is being edited * @return editingText */ public boolean editingText() { return editingText; } /** * setEditable state of BlockLabel * @param isEditable specifying editable state of BlockLabel */ public void setEditable(boolean isEditable) { this.isEditable = isEditable; } /** * isEditable returns if BlockLable is editable * @return isEditable */ public boolean isEditable() { return isEditable; } public void setNumeric(boolean isNumber) { this.isNumber = isNumber; } /** * isEditable returns if BlockLable is editable * @return isEditable */ public boolean isNumeric() { return isNumber; } public void setSiblings(boolean hasSiblings, String[][] siblings) { this.hasSiblings = hasSiblings; this.menu.setSiblings(siblings); } public boolean hasSiblings() { return this.hasSiblings; } /** * set up fonts * @param font */ public void setFont(Font font) { super.setFont(font); textLabel.setFont(font); textField.setFont(font); menu.setFont(font); } /** * sets the tool tip of the label */ public void <API key>(String text) { this.textLabel.setToolTipText(text); } /** * getText * @return String of the current BlockLabel */ public String getText() { return textLabel.getText().trim(); } /** * setText to a NumberFormatted double * @param value */ public void setText(double value) { //check for +/- Infinity if (Math.abs(value - Double.MAX_VALUE) < 1) { updateLabelText("Infinity"); } else if (Math.abs(value + Double.MAX_VALUE) < 1) { updateLabelText("-Infinity"); } else { updateLabelText(nf.format(value)); } } /** * setText to a String (trimmed to remove excess spaces) * @param string */ public void setText(String string) { if (string != null) { updateLabelText(string.trim()); } } /** * setText to a boolean * @param bool */ public void setText(boolean bool) { updateLabelText(bool ? "True" : "False"); } /** * updateLabelText updates labelText and sychronizes textField and textLabel to it * @param text */ public void updateLabelText(String text) { //leave some space to click on if (text.equals("")) { text = " "; } //update the text everywhere textLabel.setText(text); textField.setText(text); //resize to new text updateDimensions(); //the blockLabel needs to update the data in Block this.fireTextChanged(text); //show text label and additional ComboPopup if one exists this.removeAll(); this.add(textLabel, BorderLayout.CENTER); if (hasSiblings) { this.add(menu, BorderLayout.EAST); } } / RENDERING /** * Updates the dimensions of the textRect, textLabel, and textField to the minimum size needed * to contain all of the text in the current font. */ private void updateDimensions() { Dimension updatedDimension = new Dimension( textField.getPreferredSize().width, textField.getPreferredSize().height); if (this.hasSiblings) { updatedDimension.width += LabelWidget.<API key>; } textField.setSize(updatedDimension); textLabel.setSize(updatedDimension); this.setSize(updatedDimension); this.<API key>(this.getSize()); } /** * high lights the text of the editing text field from * 0 to the end of textfield */ public void highlightText() { this.textField.setSelectionStart(0); } /** * Toggles the visual suggestion that this label may be editable depending on the specified * suggest flag and properties of the block and label. If suggest is true, the visual suggestion will display. Otherwise, nothing * is shown. For now, the visual suggestion is a simple white line boder. * Other requirements for indicator to show: * - label type must be NAME * - label must be editable * - block can not be a factory block * @param suggest */ protected void suggestEditable(boolean suggest) { if (isEditable) { if (suggest) { setBorder(BorderFactory.createLineBorder(Color.white));//show white border } else { setBorder(null);//hide white border } } } public void setZoomLevel(double newZoom) { this.zoom = newZoom; Font renderingFont;// = new Font(font.getFontName(), font.getStyle(), (int)(font.getSize()*newZoom)); AffineTransform at = new AffineTransform(); at.setToScale(newZoom, newZoom); renderingFont = this.getFont().deriveFont(at); this.setFont(renderingFont); this.repaint(); this.updateDimensions(); } public String toString() { return "Label at " + this.getLocation() + " with text: \"" + textLabel.getText() + "\""; } /** * returns true if this block should can accept a negative sign */ public boolean <API key>() { if (this.getText() != null && this.getText().contains("-")) { //if it already has a negative sign, //make sure we're highlighting it if (textField.getSelectedText() != null && textField.getSelectedText().contains("-")) { return true; } else { return false; } } else { //if it does not have negative sign, //make sure our highlight covers index 0 if (textField.getCaretPosition() == 0) { return true; } else { if (textField.getSelectionStart() == 0) { return true; } } } return false; } /** * BlockLabelTextField is a java JtextField that internally handles various events * and provides the semantic to interface with the user. Unliek typical JTextFields, * the blockLabelTextField allows clients to only enter certain keys board input. * It also reacts to enters and escapse by delegating the KeyEvent to the parent * RenderableBlock. */ private class BlockLabelTextField extends JTextField implements MouseListener, DocumentListener, FocusListener, ActionListener { private static final long serialVersionUID = 873847239234L; /** These Key inputs are processed by this text field */ private final char[] validNumbers = {'1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '.'}; /** These Key inputs are processed by this text field if NOT a number block*/ private final char[] validChar = {'1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'z', 'x', 'c', 'v', 'b', 'n', 'm', 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z', 'X', 'C', 'V', 'B', 'N', 'M', '\'', '!', '@', ' '-', '=', '{', '}', '|', '[', ']', '\\', ' ', ':', '"', ';', '\'', '<', '>', '?', ',', '.', '/', '`', '~'}; /** These Key inputs are processed by all this text field */ private final int[] validMasks = {KeyEvent.VK_BACK_SPACE, KeyEvent.VK_UP, KeyEvent.VK_DOWN, KeyEvent.VK_LEFT, KeyEvent.VK_RIGHT, KeyEvent.VK_END, KeyEvent.VK_HOME, '-', KeyEvent.VK_DELETE, KeyEvent.VK_SHIFT, KeyEvent.VK_CONTROL, InputEvent.SHIFT_MASK, InputEvent.SHIFT_DOWN_MASK}; /** * Contructs new block label text field */ private BlockLabelTextField() { this.addActionListener(this); this.getDocument().addDocumentListener(this); this.addFocusListener(this); this.addMouseListener(this); /* * Sets whether focus traversal keys are enabled * for this Component. Components for which focus * traversal keys are disabled receive key events * for focus traversal keys. */ this.<API key>(false); } public void mousePressed(MouseEvent e) { } public void mouseReleased(MouseEvent e) { } public void mouseEntered(MouseEvent e) { } public void mouseClicked(MouseEvent e) { } public void mouseExited(MouseEvent arg0) { //remove the white line border //note: make call here since text fields consume mouse events //preventing parent from responding to mouse exited events suggestEditable(false); } public void actionPerformed(ActionEvent e) { setEditingState(false); } public void changedUpdate(DocumentEvent e) { //listens for change in attributes } public void insertUpdate(DocumentEvent e) { updateDimensions(); } public void removeUpdate(DocumentEvent e) { updateDimensions(); } public void focusGained(FocusEvent e) { } public void focusLost(FocusEvent e) { setEditingState(false); } /** * for all user-generated AND/OR system generated key inputs, * either perform some action that should be triggered by * that key or */ protected boolean processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed) { if (isNumber) { if (e.getKeyChar() == '-' && <API key>()) { return super.processKeyBinding(ks, e, condition, pressed); } if (this.getText().contains(".") && e.getKeyChar() == '.') { return false; } for (char c : validNumbers) { if (e.getKeyChar() == c) { return super.processKeyBinding(ks, e, condition, pressed); } } } else { for (char c : validChar) { if (e.getKeyChar() == c) { return super.processKeyBinding(ks, e, condition, pressed); } } } for (int i : validMasks) { if (e.getKeyCode() == i) { return super.processKeyBinding(ks, e, condition, pressed); } } if ((e.getModifiers() & Toolkit.getDefaultToolkit().<API key>()) != 0) { return super.processKeyBinding(ks, e, condition, pressed); } return false; } } private class LabelMenu extends JPanel implements MouseListener, MouseMotionListener { private static final long serialVersionUID = 328149080240L; private CPopupMenu popupmenu; private GeneralPath triangle; private LabelMenu() { this.setOpaque(false); this.addMouseListener(this); this.<API key>(this); this.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); this.popupmenu = new CPopupMenu(); } /** * @param siblings = array of siblin's genus and initial label * { {genus, label}, {genus, label}, {genus, label} ....} */ private void setSiblings(String[][] siblings) { popupmenu = new CPopupMenu(); //if connected to a block, add self and add siblings for (int i = 0; i < siblings.length; i++) { final String selfGenus = siblings[i][0]; CMenuItem selfItem = new CMenuItem(siblings[i][1]); selfItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { fireGenusChanged(selfGenus); showMenuIcon(false); } }); popupmenu.add(selfItem); } } public boolean contains(Point p) { return triangle != null && triangle.contains(p); } public boolean contains(int x, int y) { return triangle != null && triangle.contains(x, y); } public void paint(Graphics g) { super.paint(g); if (isFocused) { Graphics2D g2 = (Graphics2D) g; g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); triangle = new GeneralPath(); triangle.moveTo(0, this.getHeight() / 4); triangle.lineTo(this.getWidth() - 1, this.getHeight() / 4); triangle.lineTo(this.getWidth() / 2 - 1, this.getHeight() / 4 + LabelWidget.<API key>); triangle.lineTo(0, this.getHeight() / 4); triangle.closePath(); g2.setColor(new Color(255, 255, 255, 100)); g2.fill(triangle); g2.setColor(Color.BLACK); g2.draw(triangle); } } public void mouseEntered(MouseEvent e) { } public void mouseExited(MouseEvent e) { } public void mousePressed(MouseEvent e) { if (hasSiblings) { popupmenu.show(this, 0, 0); } } public void mouseReleased(MouseEvent e) { } public void mouseClicked(MouseEvent e) { } public void mouseDragged(MouseEvent e) { } public void mouseMoved(MouseEvent e) { } } /** * Much like a JLabel, only the text is displayed with a shadow like outline */ private class ShadowLabel extends JLabel implements MouseListener, MouseMotionListener { private static final long serialVersionUID = 90123787382L; //To get the shadow effect the text must be displayed multiple times at //multiple locations. x represents the center, white label. // o is color values (0,0,0,0.5f) and b is black. // o o // o x b o // o b o //offsetArrays representing the translation movement needed to get from // the center location to a specific offset location given in {{x,y},{x,y}....} //..........................................grey points.............................................black points private final int[][] shadowPositionArray = {{0, -1}, {1, -1}, {-1, 0}, {2, 0}, {-1, 1}, {1, 1}, {0, 2}, {1, 0}, {0, 1}}; private final float[] shadowColorArray = {0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0, 0}; private double offsetSize = 1; private ShadowLabel() { this.addMouseListener(this); this.<API key>(this); } public void paint(Graphics g) { Graphics2D g2 = (Graphics2D) g; g2.addRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)); //DO NOT DRAW SUPER's to prevent drawing of label's string. //Implecations: background not automatically drawn //super.paint(g); //draw shadows for (int i = 0; i < shadowPositionArray.length; i++) { int dx = shadowPositionArray[i][0]; int dy = shadowPositionArray[i][1]; g2.setColor(new Color(0, 0, 0, shadowColorArray[i])); g2.drawString(this.getText(), (int) ((4 + dx) * offsetSize), this.getHeight() + (int) ((dy - 6) * offsetSize)); } //draw main Text g2.setColor(Color.white); g2.drawString(this.getText(), (int) ((4) * offsetSize), this.getHeight() + (int) ((-6) * offsetSize)); } public JToolTip createToolTip() { return new CToolTip(tooltipBackground); } /** * Set to editing state upon mouse click if this block label is editable */ public void mouseClicked(MouseEvent e) { //if clicked and if the label is editable, if ((e.getClickCount() == 1) && isEditable) { //if clicked and if the label is editable, //then set it to the editing state when the label is clicked on setEditingState(true); textField.setSelectionStart(0); } } public void mousePressed(MouseEvent e) { } public void mouseReleased(MouseEvent e) { } public void mouseEntered(MouseEvent e) { suggestEditable(true); } public void mouseExited(MouseEvent e) { suggestEditable(false); } public void mouseDragged(MouseEvent e) { suggestEditable(false); } public void mouseMoved(MouseEvent e) { suggestEditable(true); } } }
package org.chocolate_milk.model.descriptors; //- Imported classes and packages -/ import org.chocolate_milk.model.<API key>; public class <API key> extends org.exolab.castor.xml.util.<API key> { //- Class/Member Variables -/ /** * Field _elementDefinition. */ private boolean _elementDefinition; /** * Field _nsPrefix. */ private java.lang.String _nsPrefix; /** * Field _nsURI. */ private java.lang.String _nsURI; /** * Field _xmlName. */ private java.lang.String _xmlName; /** * Field _identity. */ private org.exolab.castor.xml.XMLFieldDescriptor _identity; //- Constructors -/ public <API key>() { super(); _xmlName = "<API key>"; _elementDefinition = false; //-- set grouping compositor <API key>(); org.exolab.castor.xml.util.<API key> desc = null; org.exolab.castor.mapping.FieldHandler handler = null; org.exolab.castor.xml.FieldValidator fieldValidator = null; //-- initialize attribute descriptors //-- _requestID desc = new org.exolab.castor.xml.util.<API key>(java.lang.String.class, "_requestID", "requestID", org.exolab.castor.xml.NodeType.Attribute); desc.setImmutable(true); handler = new org.exolab.castor.xml.XMLFieldHandler() { @Override public java.lang.Object getValue( java.lang.Object object ) throws <API key> { <API key> target = (<API key>) object; return target.getRequestID(); } @Override public void setValue( java.lang.Object object, java.lang.Object value) throws <API key>, <API key> { try { <API key> target = (<API key>) object; target.setRequestID( (java.lang.String) value); } catch (java.lang.Exception ex) { throw new <API key>(ex.toString()); } } @Override @SuppressWarnings("unused") public java.lang.Object newInstance(java.lang.Object parent) { return null; } }; desc.setSchemaType("string"); desc.setHandler(handler); desc.setMultivalued(false); addFieldDescriptor(desc); //-- validation code for: _requestID fieldValidator = new org.exolab.castor.xml.FieldValidator(); { //-- local scope org.exolab.castor.xml.validators.StringValidator typeValidator; typeValidator = new org.exolab.castor.xml.validators.StringValidator(); fieldValidator.setValidator(typeValidator); typeValidator.setWhiteSpace("preserve"); } desc.setValidator(fieldValidator); //-- initialize element descriptors //-- <API key> desc = new org.exolab.castor.xml.util.<API key>(org.chocolate_milk.model.CreditCardCreditMod.class, "<API key>", "CreditCardCreditMod", org.exolab.castor.xml.NodeType.Element); handler = new org.exolab.castor.xml.XMLFieldHandler() { @Override public java.lang.Object getValue( java.lang.Object object ) throws <API key> { <API key> target = (<API key>) object; return target.<API key>(); } @Override public void setValue( java.lang.Object object, java.lang.Object value) throws <API key>, <API key> { try { <API key> target = (<API key>) object; target.<API key>( (org.chocolate_milk.model.CreditCardCreditMod) value); } catch (java.lang.Exception ex) { throw new <API key>(ex.toString()); } } @Override @SuppressWarnings("unused") public java.lang.Object newInstance(java.lang.Object parent) { return null; } }; desc.setSchemaType("org.chocolate_milk.model.CreditCardCreditMod"); desc.setHandler(handler); desc.setRequired(true); desc.setMultivalued(false); addFieldDescriptor(desc); addSequenceElement(desc); //-- validation code for: <API key> fieldValidator = new org.exolab.castor.xml.FieldValidator(); fieldValidator.setMinOccurs(1); { //-- local scope } desc.setValidator(fieldValidator); //-- <API key> desc = new org.exolab.castor.xml.util.<API key>(java.lang.String.class, "<API key>", "IncludeRetElement", org.exolab.castor.xml.NodeType.Element); desc.setImmutable(true); handler = new org.exolab.castor.xml.XMLFieldHandler() { @Override public java.lang.Object getValue( java.lang.Object object ) throws <API key> { <API key> target = (<API key>) object; return target.<API key>(); } @Override public void setValue( java.lang.Object object, java.lang.Object value) throws <API key>, <API key> { try { <API key> target = (<API key>) object; target.<API key>( (java.lang.String) value); } catch (java.lang.Exception ex) { throw new <API key>(ex.toString()); } } public void resetValue(Object object) throws <API key>, <API key> { try { <API key> target = (<API key>) object; target.<API key>(); } catch (java.lang.Exception ex) { throw new <API key>(ex.toString()); } } @Override @SuppressWarnings("unused") public java.lang.Object newInstance(java.lang.Object parent) { return null; } }; desc.setSchemaType("list"); desc.setComponentType("string"); desc.setHandler(handler); desc.setMultivalued(true); addFieldDescriptor(desc); addSequenceElement(desc); //-- validation code for: <API key> fieldValidator = new org.exolab.castor.xml.FieldValidator(); fieldValidator.setMinOccurs(0); { //-- local scope org.exolab.castor.xml.validators.StringValidator typeValidator; typeValidator = new org.exolab.castor.xml.validators.StringValidator(); fieldValidator.setValidator(typeValidator); typeValidator.setWhiteSpace("preserve"); typeValidator.setMaxLength(50); } desc.setValidator(fieldValidator); } //- Methods -/ /** * Method getAccessMode. * * @return the access mode specified for this class. */ @Override() public org.exolab.castor.mapping.AccessMode getAccessMode( ) { return null; } /** * Method getIdentity. * * @return the identity field, null if this class has no * identity. */ @Override() public org.exolab.castor.mapping.FieldDescriptor getIdentity( ) { return _identity; } /** * Method getJavaClass. * * @return the Java class represented by this descriptor. */ @Override() public java.lang.Class getJavaClass( ) { return org.chocolate_milk.model.<API key>.class; } /** * Method getNameSpacePrefix. * * @return the namespace prefix to use when marshaling as XML. */ @Override() public java.lang.String getNameSpacePrefix( ) { return _nsPrefix; } /** * Method getNameSpaceURI. * * @return the namespace URI used when marshaling and * unmarshaling as XML. */ @Override() public java.lang.String getNameSpaceURI( ) { return _nsURI; } /** * Method getValidator. * * @return a specific validator for the class described by this * ClassDescriptor. */ @Override() public org.exolab.castor.xml.TypeValidator getValidator( ) { return this; } /** * Method getXMLName. * * @return the XML Name for the Class being described. */ @Override() public java.lang.String getXMLName( ) { return _xmlName; } /** * Method isElementDefinition. * * @return true if XML schema definition of this Class is that * of a global * element or element with anonymous type definition. */ public boolean isElementDefinition( ) { return _elementDefinition; } }
package org.sonar.api.technicaldebt.server.internal; import org.junit.Test; import org.sonar.api.rule.RuleKey; import org.sonar.api.utils.WorkUnit; import org.sonar.api.utils.internal.WorkDuration; import static org.fest.assertions.Assertions.assertThat; public class <API key> { @Test public void <API key>() throws Exception { <API key> characteristic = new <API key>() .setId(1) .setKey("NETWORK_USE") .setName("Network use") .setOrder(5) .setParentId(2) .setRootId(2); assertThat(characteristic.id()).isEqualTo(1); assertThat(characteristic.key()).isEqualTo("NETWORK_USE"); assertThat(characteristic.name()).isEqualTo("Network use"); assertThat(characteristic.order()).isEqualTo(5); assertThat(characteristic.ruleKey()).isNull(); assertThat(characteristic.function()).isNull(); assertThat(characteristic.factorValue()).isNull(); assertThat(characteristic.factorUnit()).isNull(); assertThat(characteristic.offsetValue()).isNull(); assertThat(characteristic.offsetUnit()).isNull(); assertThat(characteristic.parentId()).isEqualTo(2); assertThat(characteristic.rootId()).isEqualTo(2); } @Test public void <API key>() throws Exception { <API key> requirement = new <API key>() .setId(1) .setRuleKey(RuleKey.of("repo", "rule")) .setFunction("linear_offset") .setFactorValue(2) .setFactorUnit(WorkDuration.UNIT.MINUTES) .setOffsetValue(1) .setOffsetUnit(WorkDuration.UNIT.HOURS) .setRootId(3) .setParentId(2); assertThat(requirement.id()).isEqualTo(1); assertThat(requirement.key()).isNull(); assertThat(requirement.name()).isNull(); assertThat(requirement.order()).isNull(); assertThat(requirement.ruleKey()).isEqualTo(RuleKey.of("repo", "rule")); assertThat(requirement.function()).isEqualTo("linear_offset"); assertThat(requirement.factorValue()).isEqualTo(2); assertThat(requirement.factorUnit()).isEqualTo(WorkDuration.UNIT.MINUTES); assertThat(requirement.offsetValue()).isEqualTo(1); assertThat(requirement.offsetUnit()).isEqualTo(WorkDuration.UNIT.HOURS); assertThat(requirement.parentId()).isEqualTo(2); assertThat(requirement.rootId()).isEqualTo(3); } @Test public void is_root() throws Exception { <API key> characteristic = new <API key>() .setId(1) .setKey("NETWORK_USE") .setName("Network use") .setOrder(5) .setParentId(null) .setRootId(null); assertThat(characteristic.isRoot()).isTrue(); } @Test public void is_requirement() throws Exception { <API key> requirement = new <API key>() .setId(1) .setRuleKey(RuleKey.of("repo", "rule")) .setFunction("linear_offset") .setFactorValue(2) .setFactorUnit(WorkDuration.UNIT.MINUTES) .setOffsetValue(1) .setOffsetUnit(WorkDuration.UNIT.HOURS) .setRootId(3) .setParentId(2); assertThat(requirement.isRequirement()).isTrue(); } @Test public void test_equals() throws Exception { assertThat(new <API key>().setKey("NETWORK_USE")).isEqualTo(new <API key>().setKey("NETWORK_USE")); assertThat(new <API key>().setKey("NETWORK_USE")).isNotEqualTo(new <API key>().setKey("MAINTABILITY")); assertThat(new <API key>().setRuleKey(RuleKey.of("repo", "rule"))).isEqualTo(new <API key>().setRuleKey(RuleKey.of("repo", "rule"))); assertThat(new <API key>().setRuleKey(RuleKey.of("repo", "rule"))).isNotEqualTo(new <API key>().setRuleKey(RuleKey.of("repo2", "rule2"))); } @Test public void test_hascode() throws Exception { assertThat(new <API key>().setKey("NETWORK_USE").hashCode()).isEqualTo(new <API key>().setKey("NETWORK_USE").hashCode()); assertThat(new <API key>().setKey("NETWORK_USE").hashCode()).isNotEqualTo(new <API key>().setKey("MAINTABILITY").hashCode()); assertThat(new <API key>().setRuleKey(RuleKey.of("repo", "rule")).hashCode()).isEqualTo(new <API key>().setRuleKey(RuleKey.of("repo", "rule")).hashCode()); assertThat(new <API key>().setRuleKey(RuleKey.of("repo", "rule")).hashCode()).isNotEqualTo(new <API key>().setRuleKey(RuleKey.of("repo2", "rule2")).hashCode()); } @Test public void <API key>() throws Exception { <API key> requirement = new <API key>() .setId(1) .setRuleKey(RuleKey.of("repo", "rule")) .setFunction("linear_offset") .setFactor(WorkUnit.create(2d, WorkUnit.MINUTES)) .setOffset(WorkUnit.create(1d, WorkUnit.HOURS)); assertThat(requirement.factor()).isEqualTo(WorkUnit.create(2d, WorkUnit.MINUTES)); assertThat(requirement.offset()).isEqualTo(WorkUnit.create(1d, WorkUnit.HOURS)); assertThat(new <API key>() .setId(1) .setRuleKey(RuleKey.of("repo", "rule")) .setFunction("linear") .setFactor(WorkUnit.create(2d, WorkUnit.DAYS)) .factor()).isEqualTo(WorkUnit.create(2d, WorkUnit.DAYS)); } }
#ifndef __math_test_uhf_h__ #define __math_test_uhf_h__ #include "psi4/libpsio/psio.hpp" #include "hf.h" namespace psi { namespace scf { class UHF : public HF { protected: SharedMatrix Dt_, Dt_old_; SharedMatrix Da_old_, Db_old_; SharedMatrix Ga_, Gb_, J_, Ka_, Kb_, wKa_, wKb_; void form_initialF(); void form_C(); void form_V(); void form_D(); double compute_initial_E(); virtual double compute_E(); virtual bool stability_analysis(); bool <API key>(); virtual void form_G(); virtual void form_F(); virtual void <API key>(bool save_diis); bool diis(); bool test_convergency(); void save_information(); void common_init(); void <API key>(); // Finalize memory/files virtual void finalize(); // Scaling factor for orbital rotation double step_scale_; // Increment to explore different scaling factors double step_increment_; // Stability eigenvalue, for doing smart eigenvector following double stab_val; // Compute UHF NOs void compute_nos(); // Damp down the density update virtual void damp_update(); // Second-order convergence code void Hx(SharedMatrix x_a, SharedMatrix IFock_a, SharedMatrix Cocc_a, SharedMatrix Cvir_a, SharedMatrix ret_a, SharedMatrix x_b, SharedMatrix IFock_b, SharedMatrix Cocc_b, SharedMatrix Cvir_b, SharedMatrix ret_b); virtual int soscf_update(void); public: UHF(SharedWavefunction ref_wfn, std::shared_ptr<SuperFunctional> functional); UHF(SharedWavefunction ref_wfn, std::shared_ptr<SuperFunctional> functional, Options& options, std::shared_ptr<PSIO> psio); virtual ~UHF(); virtual bool same_a_b_orbs() const { return false; } virtual bool same_a_b_dens() const { return false; } Hessian-vector computers and solvers virtual std::vector<SharedMatrix> onel_Hx(std::vector<SharedMatrix> x); virtual std::vector<SharedMatrix> twoel_Hx(std::vector<SharedMatrix> x, bool combine = true, std::string return_basis = "MO"); virtual std::vector<SharedMatrix> cphf_Hx(std::vector<SharedMatrix> x); virtual std::vector<SharedMatrix> cphf_solve(std::vector<SharedMatrix> x_vec, double conv_tol = 1.e-4, int max_iter = 10, int print_lvl = 1); std::shared_ptr<UHF> c1_deep_copy(std::shared_ptr<BasisSet> basis); }; }} #endif
// Created file "Lib\src\ksuser\X64\guids" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(<API key>, 0x7f40eac0, 0x3947, 0x11d2, 0x87, 0x4e, 0x00, 0xa0, 0xc9, 0x22, 0x31, 0x96);
#ifndef <API key> #define <API key> // W A R N I N G // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // We mean it. #include "<API key>.h" #include "private/<API key>.h" #include "private/<API key>.h" #include "private/qbitfield_p.h" #include "qdeclarativeerror.h" #include "qdeclarative.h" #include <QtCore/QString> #include <QtCore/QStringList> #include <QtCore/QList> #include <private/qobject_p.h> QT_BEGIN_NAMESPACE class <API key>; class QDeclarativeEngine; class <API key>; class <API key>; class Q_AUTOTEST_EXPORT <API key> : public QObjectPrivate, public <API key>::TypeDataCallback { Q_DECLARE_PUBLIC(<API key>) public: <API key>() : typeData(0), progress(0.), start(-1), count(-1), cc(0), engine(0), creationContext(0) {} QObject *beginCreate(<API key> *, const QBitField &); void completeCreate(); <API key> *typeData; virtual void typeDataReady(<API key> *) {}; virtual void typeDataProgress(<API key> *, qreal) {}; void fromTypeData(<API key> *data); QUrl url; qreal progress; int start; int count; <API key> *cc; struct ConstructionState { ConstructionState() : componentAttached(0), completePending(false) {} QList<<API key>::SimpleList<<API key>> > bindValues; QList<<API key>::SimpleList<<API key>> > parserStatus; QList<QPair<QDeclarativeGuard<QObject>, int> > <API key>; <API key> *componentAttached; QList<QDeclarativeError> errors; bool completePending; }; ConstructionState state; static QObject *begin(<API key> *parentContext, <API key> *<API key>, <API key> *component, int start, int count, ConstructionState *state, QList<QDeclarativeError> *errors, const QBitField &bindings = QBitField()); static void beginDeferred(<API key> *enginePriv, QObject *object, ConstructionState *state); static void complete(<API key> *enginePriv, ConstructionState *state); QScriptValue createObject(QObject *publicParent, const QScriptValue valuemap); QDeclarativeEngine *engine; <API key> creationContext; void clear(); static <API key> *get(<API key> *c) { return static_cast<<API key> *>(QObjectPrivate::get(c)); } }; class <API key> : public QObject { Q_OBJECT public: <API key>(QObject *parent = 0); virtual ~<API key>() {}; void add(<API key> **a) { prev = a; next = *a; *a = this; if (next) next->prev = &next; } void rem() { if (next) next->prev = prev; *prev = next; next = 0; prev = 0; } <API key> **prev; <API key> *next; Q_SIGNALS: void completed(); void destruction(); private: friend class <API key>; friend class <API key>; }; QT_END_NAMESPACE #endif // <API key>
'use strict'; const chai = require('chai'); const assert = chai.assert; const sinon = require('sinon'); const responseError = require('../../../server/utils/errors/responseError'); describe('responseError', () => { let spyCall; const res = {}; let error = 'An error message'; beforeEach(() => { res.status = sinon.stub().returns(res); res.json = sinon.stub(); responseError(error, res); }); it('Calls response method with default(500) error code', () => { spyCall = res.status.getCall(0); assert.isTrue(res.status.calledOnce); assert.isTrue(spyCall.calledWithExactly(500)); }); it('Returns error wrapped in json response', () => { spyCall = res.json.getCall(0); assert.isTrue(res.json.calledOnce); assert.isObject(spyCall.args[0]); assert.property(spyCall.args[0], 'response', 'status'); }); it('Calls response method with custom error code', () => { error = { description: 'Bad request', status_code: 400, }; responseError(error, res); spyCall = res.status.getCall(0); assert.isTrue(res.status.called); assert.isTrue(res.status.calledWithExactly(400)); }); });
#ifndef B2_DYNAMIC_TREE_H #define B2_DYNAMIC_TREE_H #include <Box2D/Collision/b2Collision.h> #include <Box2D/Common/b2GrowableStack.h> #define b2_nullNode (-1) A node in the dynamic tree. The client does not interact with this directly. struct b2TreeNode { bool IsLeaf() const { return child1 == b2_nullNode; } Enlarged AABB b2AABB aabb; void* userData; union { int32 parent; int32 next; }; int32 child1; int32 child2; // leaf = 0, free node = -1 int32 height; }; A dynamic AABB tree broad-phase, inspired by Nathanael Presson's btDbvt. A dynamic tree arranges data in a binary tree to accelerate queries such as volume queries and ray casts. Leafs are proxies with an AABB. In the tree we expand the proxy AABB by b2_fatAABBFactor so that the proxy AABB is bigger than the client object. This allows the client object to move by small amounts without triggering a tree update. Nodes are pooled and relocatable, so we use node indices rather than pointers. class b2DynamicTree { public: Constructing the tree initializes the node pool. b2DynamicTree(); Destroy the tree, freeing the node pool. ~b2DynamicTree(); create a proxy. Provide a tight fitting AABB and a userData pointer. int32 CreateProxy(const b2AABB& aabb, void* userData); Destroy a proxy. This asserts if the id is invalid. void DestroyProxy(int32 proxyId); Move a proxy with a swepted AABB. If the proxy has moved outside of its fattened AABB, then the proxy is removed from the tree and re-inserted. Otherwise the function returns immediately. @return true if the proxy was re-inserted. bool MoveProxy(int32 proxyId, const b2AABB& aabb1, const b2Vec2& displacement); Get proxy user data. @return the proxy user data or 0 if the id is invalid. void* GetUserData(int32 proxyId) const; Get the fat AABB for a proxy. const b2AABB& GetFatAABB(int32 proxyId) const; Query an AABB for overlapping proxies. The callback class is called for each proxy that overlaps the supplied AABB. template <typename T> void Query(T* callback, const b2AABB& aabb) const; Ray-cast against the proxies in the tree. This relies on the callback to perform a exact ray-cast in the case were the proxy contains a shape. The callback also performs the any collision filtering. This has performance roughly equal to k * log(n), where k is the number of collisions and n is the number of proxies in the tree. @param input the ray-cast input data. The ray extends from p1 to p1 + maxFraction * (p2 - p1). @param callback a callback class that is called for each proxy that is hit by the ray. template <typename T> void RayCast(T* callback, const b2RayCastInput& input) const; Validate this tree. For testing. void Validate() const; Compute the height of the binary tree in O(N) time. Should not be called often. int32 GetHeight() const; Get the maximum balance of an node in the tree. The balance is the difference in height of the two children of a node. int32 GetMaxBalance() const; Get the ratio of the sum of the node areas to the root area. float32 GetAreaRatio() const; Build an optimal tree. Very expensive. For testing. void RebuildBottomUp(); private: int32 AllocateNode(); void FreeNode(int32 node); void InsertLeaf(int32 node); void RemoveLeaf(int32 node); int32 Balance(int32 index); int32 ComputeHeight() const; int32 ComputeHeight(int32 nodeId) const; void ValidateStructure(int32 index) const; void ValidateMetrics(int32 index) const; int32 m_root; b2TreeNode* m_nodes; int32 m_nodeCount; int32 m_nodeCapacity; int32 m_freeList; This is used to incrementally traverse the tree for re-balancing. uint32 m_path; int32 m_insertionCount; }; inline void* b2DynamicTree::GetUserData(int32 proxyId) const { b2Assert(0 <= proxyId && proxyId < m_nodeCapacity); return m_nodes[proxyId].userData; } inline const b2AABB& b2DynamicTree::GetFatAABB(int32 proxyId) const { b2Assert(0 <= proxyId && proxyId < m_nodeCapacity); return m_nodes[proxyId].aabb; } template <typename T> inline void b2DynamicTree::Query(T* callback, const b2AABB& aabb) const { b2GrowableStack<int32, 256> stack; stack.Push(m_root); while (stack.GetCount() > 0) { int32 nodeId = stack.Pop(); if (nodeId == b2_nullNode) { continue; } const b2TreeNode* node = m_nodes + nodeId; if (b2TestOverlap(node->aabb, aabb)) { if (node->IsLeaf()) { bool proceed = callback->QueryCallback(nodeId); if (proceed == false) { return; } } else { stack.Push(node->child1); stack.Push(node->child2); } } } } template <typename T> inline void b2DynamicTree::RayCast(T* callback, const b2RayCastInput& input) const { b2Vec2 p1 = input.p1; b2Vec2 p2 = input.p2; b2Vec2 r = p2 - p1; b2Assert(r.LengthSquared() > 0.0f); r.Normalize(); // v is perpendicular to the segment. b2Vec2 v = b2Cross(1.0f, r); b2Vec2 abs_v = b2Abs(v); // Separating axis for segment (Gino, p80). // |dot(v, p1 - c)| > dot(|v|, h) float32 maxFraction = input.maxFraction; // Build a bounding box for the segment. b2AABB segmentAABB; { b2Vec2 t = p1 + maxFraction * (p2 - p1); segmentAABB.lowerBound = b2Min(p1, t); segmentAABB.upperBound = b2Max(p1, t); } b2GrowableStack<int32, 256> stack; stack.Push(m_root); while (stack.GetCount() > 0) { int32 nodeId = stack.Pop(); if (nodeId == b2_nullNode) { continue; } const b2TreeNode* node = m_nodes + nodeId; if (b2TestOverlap(node->aabb, segmentAABB) == false) { continue; } // Separating axis for segment (Gino, p80). // |dot(v, p1 - c)| > dot(|v|, h) b2Vec2 c = node->aabb.GetCenter(); b2Vec2 h = node->aabb.GetExtents(); float32 separation = b2Abs(b2Dot(v, p1 - c)) - b2Dot(abs_v, h); if (separation > 0.0f) { continue; } if (node->IsLeaf()) { b2RayCastInput subInput; subInput.p1 = input.p1; subInput.p2 = input.p2; subInput.maxFraction = maxFraction; float32 value = callback->RayCastCallback(subInput, nodeId); if (value == 0.0f) { // The client has terminated the ray cast. return; } if (value > 0.0f) { // Update segment bounding box. maxFraction = value; b2Vec2 t = p1 + maxFraction * (p2 - p1); segmentAABB.lowerBound = b2Min(p1, t); segmentAABB.upperBound = b2Max(p1, t); } } else { stack.Push(node->child1); stack.Push(node->child2); } } } #endif
package GT::Signals::Graphical::CandleSticks::BullishHarami; # This program is free software; you can redistribute it and/or modify # (at your option) any later version. # This program is distributed in the hope that it will be useful, # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. use strict; use vars qw(@ISA @NAMES); use GT::Signals; use GT::Prices; use GT::Indicators::CNDL; @ISA = qw(GT::Signals); @NAMES = ("BullishHarami"); =head1 GT::Signals::Graphical::CandleSticks::BullishHarami =head2 Overview The Bullish Harami signifies a decrease of momentum. It occurs when a small bullish (empty) line occurs after a large bearish (filled) line in such a way that close of the bullish line is above the open of the bearish line and the open of the bullish line is lower than the close of the bearish line. The Bullish Harami is a mirror image of the Bearish Engulfing Line. =head2 Construction If yesterday closed higher, a Bullish Harami will form when today's open is above yesterday's close and today's close is above yesterday's open. =head2 Representation | _|_ | | |___| | | Bullish Harami =head2 Links 1. More information about the bullish harami on Page 33 of the book "Candlestick Charting Explained" by Gregory L. Morris. Morris says that this pattern suggests a trend change. 2. Steve Nison also says that the Harami Patterns suggest a trend change. This is on page 80 of his book "Japanese Candlesticks Charting Techniques". 3. http: =cut sub new { my $type = shift; my $class = ref($type) || $type; my $args = shift; my $self = { "args" => defined($args) ? $args : [] }; return manage_object(\@NAMES, $self, $class, $self->{'args'}, ""); } sub initialize { my ($self) = @_; $self->{'cndl'} = GT::Indicators::CNDL->new($self->{'args'}); $self-><API key>($self->{'cndl'}, 2); } sub detect { my ($self, $calc, $i) = @_; my $prices = $calc->prices; my $cndl_name = $self->{'cndl'}->get_name(0); my $bullish_harami_name = $self->get_name(0);; return if ($calc->signals->is_available($self->get_name(0), $i)); return if (! $self->check_dependencies($calc, $i)); my $previous_cndl_code = $calc->indicators->get($cndl_name, $i - 1); my $cndl_code = $calc->indicators->get($cndl_name, $i); # Previous CandleCode from 0 to 15 # CandleCode from 80 to 111 if (($previous_cndl_code >= 0) and ($previous_cndl_code <= 15) and ($cndl_code >= 80) and ($cndl_code <= 111) and ($prices->at($i)->[$OPEN] > $prices->at($i - 1)->[$CLOSE]) and ($prices->at($i)->[$CLOSE] < $prices->at($i - 1)->[$OPEN]) ) { $calc->signals->set($bullish_harami_name, $i, 1); } else { $calc->signals->set($bullish_harami_name, $i, 0); } } 1;
<API key> [![Build Status](http: ======================== The AngularJS implementation of the Scenario Comparison and Analysis and the <API key> and Decision Support Functional Building Block. ![<API key>](https://cloud.githubusercontent.com/assets/973421/4491054/<API key>.png) ## Get started Simply pull in the libraries and all the dependencies via [bower](http://bower.io/) sh bower install --save <API key> There is a number of directives that are useful for the different parts of the worldstate analysis. Currently the best way to get a grip on the usage, see the <code>index.html</code> of this repo. Pull in and wire toghether the directives that you want to use in your application accordingly. However, this will only work correctly if you provide info where to find the ICMM instance to use: javascript angular.module( 'myCoolModule' ).config( [ '$provide', function ($provide) { 'use strict'; $provide.constant('CRISMA_DOMAIN', 'CRISMA'); // the name of the CRISMA domain to use $provide.constant('CRISMA_ICMM_API', 'http://url/to/the/icmm/api'); // the url to the API of the ICMM instance to use } } ] ); ## Demo Simply checkout the project and put the app folder in your favourite web server, or even more simple, use grunt to fire up a web server for you sh grunt serve
#include "sensorcontrol.h" using namespace oi; /*! * \brief SensorControl::SensorControl * \param station * \param parent */ SensorControl::SensorControl(QPointer<Station> &station, QObject *parent) : QObject(parent), station(station), sensorValid(false){ this->worker = new SensorWorker(); this->connectSensorWorker(); } /*! * \brief SensorControl::~SensorControl */ SensorControl::~SensorControl(){ this-><API key>(); } /*! * \brief SensorControl::getSensor * Returns a copy of the current sensor * \return */ Sensor SensorControl::getSensor(){ //get sensor Sensor sensor; bool hasInvoked = QMetaObject::invokeMethod(this->worker, "getSensor", Qt::DirectConnection, Q_RETURN_ARG(Sensor, sensor)); if(!hasInvoked){ emit this->sensorMessage("Cannot invoke getSensor method of sensor worker", eErrorMessage, eConsoleMessage); } return sensor; } /*! * \brief SensorControl::setSensor * Sets the current sensor to the given one * \param sensor */ void SensorControl::setSensor(const QPointer<Sensor> &sensor){ //check sensor if(sensor.isNull()){ return; } //check old sensor and add it to the list of used sensors if(sensorValid){ this->usedSensors.append(this->getSensor()); } //call method of sensor worker bool hasInvoked = QMetaObject::invokeMethod(this->worker, "setSensor", Qt::DirectConnection, Q_ARG(QPointer<Sensor>, sensor)); if(!hasInvoked){ emit this->sensorMessage("Cannot invoke getSensor method of sensor worker", eErrorMessage, eConsoleMessage); } //set sensor valid this->sensorValid = true; } /*! * \brief SensorControl::takeSensor * Returns the current sensor instance. That sensor will no longer be used by the sensor worker * \return */ QPointer<Sensor> SensorControl::takeSensor(){ //check old sensor and add it to the list of used sensors if(sensorValid){ this->usedSensors.append(this->getSensor()); } //call method of sensor worker QPointer<Sensor> sensor(NULL); bool hasInvoked = QMetaObject::invokeMethod(this->worker, "takeSensor", Qt::DirectConnection, Q_RETURN_ARG(QPointer<Sensor>, sensor)); if(!hasInvoked){ emit this->sensorMessage("Cannot invoke getSensor method of sensor worker", eErrorMessage, eConsoleMessage); } //set sensor invalid this->sensorValid = false; return sensor; } /*! * \brief SensorControl::resetSensor * Disconnects and deletes the current sensor */ void SensorControl::resetSensor(){ //check old sensor and add it to the list of used sensors if(sensorValid){ this->usedSensors.append(this->getSensor()); } //call method of sensor worker bool hasInvoked = QMetaObject::invokeMethod(this->worker, "resetSensor", Qt::QueuedConnection); if(!hasInvoked){ emit this->sensorMessage("Cannot invoke getSensor method of sensor worker", eErrorMessage, eConsoleMessage); } //set sensor invalid this->sensorValid = false; } /*! * \brief SensorControl::getUsedSensors * \return */ const QList<Sensor> &SensorControl::getUsedSensors(){ return this->usedSensors; } /*! * \brief SensorControl::setUsedSensors * \param sensors */ void SensorControl::setUsedSensors(const QList<Sensor> &sensors){ this->usedSensors = sensors; } /*! * \brief SensorControl::getStreamFormat * \return */ ReadingTypes SensorControl::getStreamFormat(){ //call method of sensor worker ReadingTypes type = eUndefinedReading; bool hasInvoked = QMetaObject::invokeMethod(this->worker, "getStreamFormat", Qt::DirectConnection, Q_RETURN_ARG(ReadingTypes, type)); if(!hasInvoked){ emit this->sensorMessage("Cannot invoke getSensor method of sensor worker", eErrorMessage, eConsoleMessage); } return type; } /*! * \brief SensorControl::setStreamFormat * \param streamFormat */ void SensorControl::setStreamFormat(ReadingTypes streamFormat){ //call method of sensor worker bool hasInvoked = QMetaObject::invokeMethod(this->worker, "setStreamFormat", Qt::QueuedConnection, Q_ARG(ReadingTypes, streamFormat)); if(!hasInvoked){ emit this->sensorMessage("Cannot invoke getSensor method of sensor worker", eErrorMessage, eConsoleMessage); } } /*! * \brief SensorControl::getIsSensorSet * \return */ bool SensorControl::getIsSensorSet(){ return this->sensorValid; } /*! * \brief SensorControl::<API key> * \return */ bool SensorControl::<API key>(){ //call method of sensor worker bool isConnected = false; bool hasInvoked = QMetaObject::invokeMethod(this->worker, "<API key>", Qt::DirectConnection, Q_RETURN_ARG(bool, isConnected)); if(!hasInvoked){ emit this->sensorMessage("Cannot invoke getSensor method of sensor worker", eErrorMessage, eConsoleMessage); } return isConnected; } /*! * \brief SensorControl::<API key> * \return */ bool SensorControl::<API key>(){ //call method of sensor worker bool isReady = false; bool hasInvoked = QMetaObject::invokeMethod(this->worker, "<API key>", Qt::DirectConnection, Q_RETURN_ARG(bool, isReady)); if(!hasInvoked){ emit this->sensorMessage("Cannot invoke getSensor method of sensor worker", eErrorMessage, eConsoleMessage); } return isReady; } /*! * \brief SensorControl::getIsBusy * \return */ bool SensorControl::getIsBusy(){ //call method of sensor worker bool isBusy = false; bool hasInvoked = QMetaObject::invokeMethod(this->worker, "getIsBusy", Qt::DirectConnection, Q_RETURN_ARG(bool, isBusy)); if(!hasInvoked){ emit this->sensorMessage("Cannot invoke getSensor method of sensor worker", eErrorMessage, eConsoleMessage); } return isBusy; } /*! * \brief SensorControl::getSensorStatus * \return */ QMap<QString, QString> SensorControl::getSensorStatus(){ //call method of sensor worker QMap<QString, QString> status; bool hasInvoked = QMetaObject::invokeMethod(this->worker, "getSensorStatus", Qt::DirectConnection, Q_RETURN_ARG(StringStringMap, status)); if(!hasInvoked){ emit this->sensorMessage("Cannot invoke getSensor method of sensor worker", eErrorMessage, eConsoleMessage); } return status; } /*! * \brief SensorControl::getActiveSensorType * \return */ SensorTypes SensorControl::getActiveSensorType(){ //call method of sensor worker SensorTypes type; bool hasInvoked = QMetaObject::invokeMethod(this->worker, "getActiveSensorType", Qt::DirectConnection, Q_RETURN_ARG(SensorTypes, type)); if(!hasInvoked){ emit this->sensorMessage("Cannot invoke getSensor method of sensor worker", eErrorMessage, eConsoleMessage); } return type; } /*! * \brief SensorControl::<API key> * \return */ QList<ReadingTypes> SensorControl::<API key>(){ //call method of sensor worker QList<ReadingTypes> types; bool hasInvoked = QMetaObject::invokeMethod(this->worker, "<API key>", Qt::DirectConnection, Q_RETURN_ARG(QList<ReadingTypes>, types)); if(!hasInvoked){ emit this->sensorMessage("Cannot invoke getSensor method of sensor worker", eErrorMessage, eConsoleMessage); } return types; } /*! * \brief SensorControl::<API key> * \return */ QList<ConnectionTypes> SensorControl::<API key>(){ //call method of sensor worker QList<ConnectionTypes> types; bool hasInvoked = QMetaObject::invokeMethod(this->worker, "<API key>", Qt::DirectConnection, Q_RETURN_ARG(QList<ConnectionTypes>, types)); if(!hasInvoked){ emit this->sensorMessage("Cannot invoke getSensor method of sensor worker", eErrorMessage, eConsoleMessage); } return types; } /*! * \brief SensorControl::<API key> * \return */ QList<SensorFunctions> SensorControl::<API key>(){ //call method of sensor worker QList<SensorFunctions> actions; bool hasInvoked = QMetaObject::invokeMethod(this->worker, "<API key>", Qt::DirectConnection, Q_RETURN_ARG(QList<SensorFunctions>, actions)); if(!hasInvoked){ emit this->sensorMessage("Cannot invoke getSensor method of sensor worker", eErrorMessage, eConsoleMessage); } return actions; } /*! * \brief SensorControl::<API key> * \return */ QStringList SensorControl::<API key>(){ //call method of sensor worker QStringList actions; bool hasInvoked = QMetaObject::invokeMethod(this->worker, "<API key>", Qt::DirectConnection, Q_RETURN_ARG(QStringList, actions)); if(!hasInvoked){ emit this->sensorMessage("Cannot invoke getSensor method of sensor worker", eErrorMessage, eConsoleMessage); } return actions; } /*! * \brief SensorControl::<API key> * \return */ SensorConfiguration SensorControl::<API key>(){ //call method of sensor worker SensorConfiguration sConfig; bool hasInvoked = QMetaObject::invokeMethod(this->worker, "<API key>", Qt::DirectConnection, Q_RETURN_ARG(SensorConfiguration, sConfig)); if(!hasInvoked){ emit this->sensorMessage("Cannot invoke getSensor method of sensor worker", eErrorMessage, eConsoleMessage); } return sConfig; } /*! * \brief SensorControl::<API key> * \param sConfig */ void SensorControl::<API key>(const SensorConfiguration &sConfig){ //call method of sensor worker bool hasInvoked = QMetaObject::invokeMethod(this->worker, "<API key>", Qt::QueuedConnection, Q_ARG(SensorConfiguration, sConfig)); if(!hasInvoked){ emit this->sensorMessage("Cannot invoke getSensor method of sensor worker", eErrorMessage, eConsoleMessage); } } /*! * \brief SensorControl::connectSensor */ void SensorControl::connectSensor(){ //call method of sensor worker bool hasInvoked = QMetaObject::invokeMethod(this->worker, "connectSensor", Qt::QueuedConnection); if(!hasInvoked){ emit this->sensorMessage("Cannot invoke getSensor method of sensor worker", eErrorMessage, eConsoleMessage); } } /*! * \brief SensorControl::disconnectSensor */ void SensorControl::disconnectSensor(){ //call method of sensor worker bool hasInvoked = QMetaObject::invokeMethod(this->worker, "disconnectSensor", Qt::QueuedConnection); if(!hasInvoked){ emit this->sensorMessage("Cannot invoke getSensor method of sensor worker", eErrorMessage, eConsoleMessage); } } /*! * \brief SensorControl::measure * \param geomId * \param mConfig */ void SensorControl::measure(const int &geomId, const MeasurementConfig &mConfig){ //call method of sensor worker bool hasInvoked = QMetaObject::invokeMethod(this->worker, "measure", Qt::QueuedConnection, Q_ARG(int, geomId), Q_ARG(MeasurementConfig, mConfig)); if(!hasInvoked){ emit this->sensorMessage("Cannot invoke getSensor method of sensor worker", eErrorMessage, eConsoleMessage); } } /*! * \brief SensorControl::move * \param azimuth * \param zenith * \param distance * \param isRelative * \param measure * \param geomId * \param mConfig */ void SensorControl::move(const double &azimuth, const double &zenith, const double &distance, const bool &isRelative, const bool &measure, const int &geomId, const MeasurementConfig &mConfig){ //call method of sensor worker bool hasInvoked = QMetaObject::invokeMethod(this->worker, "move", Qt::QueuedConnection, Q_ARG(double, azimuth), Q_ARG(double, zenith), Q_ARG(double, distance), Q_ARG(bool, isRelative), Q_ARG(bool, measure), Q_ARG(int, geomId), Q_ARG(MeasurementConfig, mConfig)); if(!hasInvoked){ emit this->sensorMessage("Cannot invoke getSensor method of sensor worker", eErrorMessage, eConsoleMessage); } } /*! * \brief SensorControl::move * \param x * \param y * \param z * \param measure * \param geomId * \param mConfig */ void SensorControl::move(const double &x, const double &y, const double &z, const bool &measure, const int &geomId, const MeasurementConfig &mConfig){ //call method of sensor worker bool hasInvoked = QMetaObject::invokeMethod(this->worker, "move", Qt::QueuedConnection, Q_ARG(double, x), Q_ARG(double, y), Q_ARG(double, z), Q_ARG(bool, measure), Q_ARG(int, geomId), Q_ARG(MeasurementConfig, mConfig)); if(!hasInvoked){ emit this->sensorMessage("Cannot invoke getSensor method of sensor worker", eErrorMessage, eConsoleMessage); } } /*! * \brief SensorControl::initialize */ void SensorControl::initialize(){ //call method of sensor worker bool hasInvoked = QMetaObject::invokeMethod(this->worker, "initialize", Qt::QueuedConnection); if(!hasInvoked){ emit this->sensorMessage("Cannot invoke getSensor method of sensor worker", eErrorMessage, eConsoleMessage); } } /*! * \brief SensorControl::motorState */ void SensorControl::motorState(){ //call method of sensor worker bool hasInvoked = QMetaObject::invokeMethod(this->worker, "motorState", Qt::QueuedConnection); if(!hasInvoked){ emit this->sensorMessage("Cannot invoke getSensor method of sensor worker", eErrorMessage, eConsoleMessage); } } /*! * \brief SensorControl::home */ void SensorControl::home(){ //call method of sensor worker bool hasInvoked = QMetaObject::invokeMethod(this->worker, "home", Qt::QueuedConnection); if(!hasInvoked){ emit this->sensorMessage("Cannot invoke getSensor method of sensor worker", eErrorMessage, eConsoleMessage); } } /*! * \brief SensorControl::toggleSight */ void SensorControl::toggleSight(){ //call method of sensor worker bool hasInvoked = QMetaObject::invokeMethod(this->worker, "toggleSight", Qt::QueuedConnection); if(!hasInvoked){ emit this->sensorMessage("Cannot invoke getSensor method of sensor worker", eErrorMessage, eConsoleMessage); } } /*! * \brief SensorControl::compensation */ void SensorControl::compensation(){ //call method of sensor worker bool hasInvoked = QMetaObject::invokeMethod(this->worker, "compensation", Qt::QueuedConnection); if(!hasInvoked){ emit this->sensorMessage("Cannot invoke getSensor method of sensor worker", eErrorMessage, eConsoleMessage); } } /*! * \brief SensorControl::selfDefinedAction * \param action */ void SensorControl::selfDefinedAction(const QString &action){ //call method of sensor worker bool hasInvoked = QMetaObject::invokeMethod(this->worker, "selfDefinedAction", Qt::QueuedConnection, Q_ARG(QString, action)); if(!hasInvoked){ emit this->sensorMessage("Cannot invoke getSensor method of sensor worker", eErrorMessage, eConsoleMessage); } } void SensorControl::search(){ //call method of sensor worker bool hasInvoked = QMetaObject::invokeMethod(this->worker, "search", Qt::QueuedConnection); if(!hasInvoked){ emit this->sensorMessage("Cannot invoke getSensor method of sensor worker", eErrorMessage, eConsoleMessage); } } /*! * \brief SensorControl::startReadingStream */ void SensorControl::startReadingStream(){ //call method of sensor worker bool hasInvoked = QMetaObject::invokeMethod(this->worker, "startReadingStream", Qt::QueuedConnection); if(!hasInvoked){ emit this->sensorMessage("Cannot invoke getSensor method of sensor worker", eErrorMessage, eConsoleMessage); } } /*! * \brief SensorControl::stopReadingStream */ void SensorControl::stopReadingStream(){ //call method of sensor worker bool hasInvoked = QMetaObject::invokeMethod(this->worker, "stopReadingStream", Qt::QueuedConnection); if(!hasInvoked){ emit this->sensorMessage("Cannot invoke getSensor method of sensor worker", eErrorMessage, eConsoleMessage); } } /*! * \brief SensorControl::<API key> */ void SensorControl::<API key>(){ //call method of sensor worker bool hasInvoked = QMetaObject::invokeMethod(this->worker, "<API key>", Qt::QueuedConnection); if(!hasInvoked){ emit this->sensorMessage("Cannot invoke getSensor method of sensor worker", eErrorMessage, eConsoleMessage); } } /*! * \brief SensorControl::<API key> */ void SensorControl::<API key>(){ //call method of sensor worker bool hasInvoked = QMetaObject::invokeMethod(this->worker, "<API key>", Qt::QueuedConnection); if(!hasInvoked){ emit this->sensorMessage("Cannot invoke getSensor method of sensor worker", eErrorMessage, eConsoleMessage); } } /*! * \brief SensorControl::<API key> */ void SensorControl::<API key>(){ //call method of sensor worker bool hasInvoked = QMetaObject::invokeMethod(this->worker, "<API key>", Qt::QueuedConnection); if(!hasInvoked){ emit this->sensorMessage("Cannot invoke getSensor method of sensor worker", eErrorMessage, eConsoleMessage); } } /*! * \brief SensorControl::<API key> */ void SensorControl::<API key>(){ //call method of sensor worker bool hasInvoked = QMetaObject::invokeMethod(this->worker, "<API key>", Qt::QueuedConnection); if(!hasInvoked){ emit this->sensorMessage("Cannot invoke getSensor method of sensor worker", eErrorMessage, eConsoleMessage); } } void SensorControl::finishMeasurement(){ //call method of sensor worker bool hasInvoked = QMetaObject::invokeMethod(this->worker, "finishMeasurement", Qt::DirectConnection); if(!hasInvoked){ emit this->sensorMessage("Cannot invoke getSensor method of sensor worker", eErrorMessage, eConsoleMessage); } } /*! * \brief SensorControl::connectSensorWorker */ void SensorControl::connectSensorWorker(){ //connect sensor action results QObject::connect(this->worker, &SensorWorker::commandFinished, this, &SensorControl::commandFinished, Qt::QueuedConnection); QObject::connect(this->worker, &SensorWorker::measurementFinished, this, &SensorControl::measurementFinished, Qt::QueuedConnection); QObject::connect(this->worker, &SensorWorker::measurementDone, this, &SensorControl::measurementDone, Qt::QueuedConnection); //connect streaming results QObject::connect(this->worker, &SensorWorker::realTimeReading, this, &SensorControl::realTimeReading, Qt::QueuedConnection); QObject::connect(this->worker, &SensorWorker::realTimeStatus, this, &SensorControl::realTimeStatus, Qt::QueuedConnection); QObject::connect(this->worker, &SensorWorker::connectionLost, this, &SensorControl::connectionLost, Qt::QueuedConnection); QObject::connect(this->worker, &SensorWorker::connectionReceived, this, &SensorControl::connectionReceived, Qt::QueuedConnection); QObject::connect(this->worker, &SensorWorker::<API key>, this, &SensorControl::<API key>, Qt::QueuedConnection); //connect sensor messages QObject::connect(this->worker, &SensorWorker::sensorMessage, this, &SensorControl::sensorMessage, Qt::QueuedConnection); } /*! * \brief SensorControl::<API key> */ void SensorControl::<API key>(){ } void SensorControl::<API key>(QPointer<QThread> t) { this->worker->moveToThread(t); }
using System; namespace MakingSense.AspNetCore.HypermediaApi.Linking.StandardRelations { public class RelatedRelation : IRelation { public Type InputModel => null; public bool IsVirtual => false; public HttpMethod? Method => null; public Type OutputModel => null; public string RelationName => "related"; } }