hexsha stringlengths 40 40 | size int64 5 1.05M | ext stringclasses 98
values | lang stringclasses 21
values | max_stars_repo_path stringlengths 3 945 | max_stars_repo_name stringlengths 4 118 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k โ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 โ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 โ | max_issues_repo_path stringlengths 3 945 | max_issues_repo_name stringlengths 4 118 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 134k โ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 โ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 โ | max_forks_repo_path stringlengths 3 945 | max_forks_repo_name stringlengths 4 135 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k โ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 โ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 โ | content stringlengths 5 1.05M | avg_line_length float64 1 1.03M | max_line_length int64 2 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a1850f76129ad4b561ad32ebdec05829a35bd3e0 | 2,468 | h | C | Assigment1/Game/Source/Player.h | Xavierlm11/Assignment1 | 78e3004c63923ec15883a22c754e1f403fa5c6cd | [
"MIT"
] | 1 | 2021-12-11T22:51:20.000Z | 2021-12-11T22:51:20.000Z | Assigment1/Game/Source/Player.h | Xavierlm11/Assignment1 | 78e3004c63923ec15883a22c754e1f403fa5c6cd | [
"MIT"
] | null | null | null | Assigment1/Game/Source/Player.h | Xavierlm11/Assignment1 | 78e3004c63923ec15883a22c754e1f403fa5c6cd | [
"MIT"
] | null | null | null | #ifndef __PLAYER_H__
#define __PLAYER_H__
#include "Module.h"
#include "Animation.h"
#include "List.h"
#include "App.h"
#include "Point.h"
struct SDL_Texture;
struct SDL_Surface;
struct Collider;
class Player :public Module {
public:
Player();
// Destructor
virtual ~Player();
// Called before render is available
bool Awake(pugi::xml_node&);
// Called before the first frame
bool Start();
// Called before all Updates
bool PreUpdate();
// Called each loop iteration
bool Update(float dt);
// Called before all Updates
bool PostUpdate();
// Called before quitting
bool CleanUp();
void OnCollision(Collider* c1, Collider* c2) override ;
//All player movement
void MovementPlayer(float dt);
// Load / Save
bool LoadState(pugi::xml_node&);
bool SaveState(pugi::xml_node&) const;
//// Load Texture
//SDL_Texture* const Load(const char* path);
//SDL_Texture* const LoadSurface(SDL_Surface* surface);
iPoint position;
bool ActivePlayer = false;
bool contact;
bool god = false;
bool death;
bool sidesR;
bool sidesL;
bool jumping;
bool jumping2;
int jumps;
int jumped;
int jumped2;
bool dbjump;
bool hit = false;
Collider* misil = nullptr;
uint dieFx = 0;
public:
List<SDL_Texture*> player;
bool CheckActive1 = false;
bool CheckActive2 = false;
bool CheckActive3 = false;
bool CheckActive4 = false;
bool CheckActive5 = false;
bool item1Used = false;
bool item2Used = false;
bool item3Used = false;
bool item4Used = false;
bool Key = false;
int Money = 0;
uint GetCoin = 0;
//Player Lives
int PlayerLives = 5;
bool PlayerPosition = true;
uint JumpFx = 0;
uint EnterFx = 0;
uint playerAttack = 0;
int score = 0;
int timer = 500;
int secs;
int scoreFont = -1;
char scoreText[10] = { "\0" };
int limitFont = -1;
char limitText[10] = { "\0" };
private:
//cargar textura del jugador
SDL_Texture* texture = nullptr;
//player animations
Animation* currentAnimation = nullptr;
Animation idleAnimR,
idleAnimL,
jumpAnimR,
jumpAnimL,
walkAnimR,
walkAnimL,
PlayerDeathR,
PlayerDeathL;
//Lifes
SDL_Texture* HealthBarTex = nullptr;
Animation Bar5, Bar4, Bar3, Bar2, Bar1;
uint GetItem = 0;
uint GetCheckpoint = 0;
uint GetKey = 0;
//Declarar colisiones del jugador
Collider* colliderPlayer = nullptr;
Collider* colliderPlayerR = nullptr;
Collider* colliderPlayerL = nullptr;
Collider* colliderHead = nullptr;
//gravity
int gravity = 1;
};
#endif | 16.453333 | 56 | 0.702188 |
2669877f5a315309818e689d12805de725c283d7 | 141 | java | Java | drools-chance-core/src/main/java/org/drools/chance/factmodel/LinguisticPartition.java | kevinpeterson/drools-chance | 9346eb4c8b6f297f141ddf3c17d0b3adc96407cd | [
"Apache-2.0"
] | 4 | 2017-06-05T13:58:53.000Z | 2020-01-29T13:17:49.000Z | drools-chance-core/src/main/java/org/drools/chance/factmodel/LinguisticPartition.java | kevinpeterson/drools-chance | 9346eb4c8b6f297f141ddf3c17d0b3adc96407cd | [
"Apache-2.0"
] | null | null | null | drools-chance-core/src/main/java/org/drools/chance/factmodel/LinguisticPartition.java | kevinpeterson/drools-chance | 9346eb4c8b6f297f141ddf3c17d0b3adc96407cd | [
"Apache-2.0"
] | 5 | 2017-12-27T02:58:51.000Z | 2021-01-30T22:59:25.000Z | package org.drools.chance.factmodel;
public @interface LinguisticPartition {
Class<? extends Number> value() default Double.class;
}
| 15.666667 | 57 | 0.751773 |
c73cc59f192dfb856a88ad21078ada16365d66f6 | 97 | sql | SQL | Tools/backupdb.sql | DaedalicEntertainment/product-database | b1bc68ed48eebdc57ad62cb47116ded5111fccfe | [
"MIT"
] | 1 | 2020-07-03T17:12:58.000Z | 2020-07-03T17:12:58.000Z | Tools/backupdb.sql | DaedalicEntertainment/product-database | b1bc68ed48eebdc57ad62cb47116ded5111fccfe | [
"MIT"
] | 1 | 2020-07-13T13:18:13.000Z | 2020-07-13T13:18:13.000Z | Tools/backupdb.sql | DaedalicEntertainment/product-database | b1bc68ed48eebdc57ad62cb47116ded5111fccfe | [
"MIT"
] | null | null | null | BACKUP DATABASE DaedalicProductDatabase
TO DISK = N'DaedalicProductDatabase.bak'
WITH FORMAT
GO
| 16.166667 | 40 | 0.845361 |
3ef29f21b6621968e529e73de7b50c69c1a460d3 | 24,035 | h | C | include/native/dxapi/dxapi.h | DeltixInc/TimeBase-Client-Cpp | 92251693e2c3ea8305702407a48f2894d223b63e | [
"Apache-2.0"
] | 1 | 2021-02-26T14:12:25.000Z | 2021-02-26T14:12:25.000Z | include/native/dxapi/dxapi.h | DeltixInc/TimeBase-Client-Cpp | 92251693e2c3ea8305702407a48f2894d223b63e | [
"Apache-2.0"
] | null | null | null | include/native/dxapi/dxapi.h | DeltixInc/TimeBase-Client-Cpp | 92251693e2c3ea8305702407a48f2894d223b63e | [
"Apache-2.0"
] | null | null | null | ๏ปฟ#pragma once
/*
* Native C++ API prototype
*/
#include "dxcommon.h"
#include "dxconstants.h"
#include "data_reader.h"
#include "data_writer.h"
#include <string>
#include <vector>
#include <memory>
namespace DxApi {
class TickDb;
class SelectionOptions;
class TickStream;
struct MessageHeader;
typedef int64_t TimestampMs;
typedef int64_t TimestampNs;
}
// TODO: selection options should be wrapped in interface or split into 2 classes, public and private
#include "selection_options.h"
#include "loading_options.h"
#include "interval.h"
#include "stream_options.h"
#include "bg_proc_info.h"
namespace DxApi {
struct InstrumentTypeEnum {
enum Enum {
EQUITY = 0,
OPTION,
FUTURE,
BOND,
FX,
INDEX, // = 5
ETF,
CUSTOM,
SIMPLE_OPTION,
EXCHANGE,
TRADING_SESSION, // = 10
STREAM,
DATA_CONNECTOR,
EXCHANGE_TRADED_SYNTHETIC,
SYSTEM,
CFD, // Contract-For-Difference-Synthetic = 15
_COUNT_,
UNKNOWN = 0xFF // unknown/invalid
};
};
ENUM_CLASS(uint8_t, InstrumentType);
/**
* true if instrument of this type can accumulate positions and appear in trade orders
* Currently supported as a function, not a method. Use: isTradable(instrumentType)
*/
INLINE bool isTradable(const InstrumentType &t)
{
auto ordinal = t.toInt();
return ordinal <= (unsigned)InstrumentType::SIMPLE_OPTION || InstrumentType::EXCHANGE_TRADED_SYNTHETIC == ordinal;
}
struct InstrumentIdentity {
std::string symbol;
InstrumentType type;
INLINE bool operator==(const InstrumentIdentity &other) const
{
return type == other.type && symbol == other.symbol;
}
INLINE std::string toString() const
{
std::string s;
s.append(this->type.toString()).append(":").append(this->symbol);
return s;
}
InstrumentIdentity(const InstrumentIdentity &other)
: symbol(other.symbol), type(other.type) { }
InstrumentIdentity(InstrumentType type, const std::string &symbol)
: symbol(symbol), type(type) { }
InstrumentIdentity(InstrumentType type, const char * symbol)
: symbol(symbol), type(type) { }
protected:
InstrumentIdentity()
: type(InstrumentType::UNKNOWN) { }
};
class TickCursorException : public std::runtime_error {
public:
TickCursorException(const std::string &s) : std::runtime_error(s) {}
TickCursorException(const char * s) : std::runtime_error(s) {}
};
class TickCursorServerError : public TickCursorException {
public:
int code;
TickCursorServerError(int c, const std::string &s) : TickCursorException(s), code(c) {}
TickCursorServerError(int c, const char * s) : TickCursorException(s), code(c) {}
};
// Local interruption from close() etc.
class TickCursorInterruptedException : public TickCursorException {
public:
TickCursorInterruptedException(const std::string &s) : TickCursorException(s) {}
TickCursorInterruptedException(const char * s) : TickCursorException(s) {}
};
class TickCursorError : public TickCursorException {
public:
TickCursorError(const std::string &s) : TickCursorException(s) {}
TickCursorError(const char * s) : TickCursorException(s) {}
};
class TickCursorClosedException : public TickCursorException {
public:
TickCursorClosedException() : TickCursorException("Tickloader is closed") {}
TickCursorClosedException(const std::string &s) : TickCursorException(s) {}
TickCursorClosedException(const char * s) : TickCursorException(s) {}
};
class TickCursor {
public:
bool isAtEnd() const;
bool isClosed() const;
_DXAPI bool next(MessageHeader * const msg);
bool nextIfAvailable(MessageHeader* const msg);
void close();
size_t preload(size_t nBytesToPreload, size_t readBlockSize = 0x2000);
TickDb& getDB() const;
DataReader& getReader() const;
const std::string* getInstrument(unsigned entityId);
// retrieves name for remote type. Will only return NULL if the server error occured or the message is not server-originated
const std::string* getMessageTypeName(unsigned msgDescId);
//const std::string * getMessageTypeName(unsigned msgDescId, unsigned streamId);
const std::string* getMessageStreamKey(unsigned msgDescId);
const std::string* getMessageSchema(unsigned msgDescId);
// Registers user's message type. This is deprecated and will be removed soon
unsigned registerMessageType(unsigned newTypeId, const std::string &newTypeName);
unsigned registerMessageType(unsigned newTypeId, unsigned streamId, const std::string &newTypeName);
// Subscription methods
// const std::vector<std::string> &types, const std::vector<std::string> &entities
// [+]
// Made unaccessible from .NET API (2016-02-03), deprecated?
void reset(TimestampMs dt, const std::vector<std::string> &entities);
/////
// [+]
void reset(TimestampMs dt);
// [+]
// Add entities to the subscription
// Does nothing if the entities array in empty
void addEntities(const std::vector<std::string> &entities);
// [+]
// Add entities to the subscription
// NULL can be used to denote <ALL>, otherwise the request is ignored if n == 0
void addEntities(std::string entities[], size_t n);
// [+]
// Add a single entity to the subscription
void addEntity(const std::string &entity);
// [+]
// Remove entities from the subscription
// Does nothing if the entities array in empty
void removeEntities(const std::vector<std::string> &entities);
// [+]
// NULL can be used to denote <ALL>, otherwise the request is ignored if n == 0
void removeEntities(std::string entities[], size_t n);
// [+]
// Remove a single entity from the subscription
void removeEntity(const std::string &entity);
// [+]
// Remove all entities from the subscription
void clearAllEntities();
// [+]
// Add <ALL> entities to the subscription
void subscribeToAllEntities();
// [+]
// Add message types to the subscription
// If the types array is empty, does nothing
void addTypes(const std::vector<std::string> &types);
// [+]
// Add message types to the subscription
// NULL can be used to denote <ALL>, otherwise the request is ignored if n == 0
void addTypes(const char * types[], size_t n);
// [+]
// Remove types from the subscription
// If the types array is empty, does nothing
void removeTypes(const std::vector<std::string> &types);
// [+]
// Remove message types from the subscription
// NULL can be used to denote <ALL>, otherwise the request is ignored if n == 0
void removeTypes(const char * types[], size_t n);
// [+]
// Set types
// If the types array is empty, will unsubscribe from all messages (except realtimestart?)
void setTypes(const std::vector<std::string> &types);
// [+]
// Set types
// If types is NULL, should subscribe to all types, otherwise if n == 0 will unsubscribe from all types
void setTypes(const char * types[], size_t n);
// [+]
// Subscribe to all message types
void subscribeToAllTypes();
// [+]
// Add entities and types to the subscription. A shortcut for addEntities() , addTypes()
// Can't be used to subscribe to all entities or types
void add(const std::vector<std::string> &entities, const std::vector<std::string> &types);
// [+]
// Remove entities and types from the subscription. A shortcut for removeEntities() , removeTypes()
void remove(const std::vector<std::string> &entities, const std::vector<std::string> &types);
// [+]
// Add streams to the subscription
// If the streams array is empty, does nothing
void addStreams(const std::vector<TickStream *> &streams);
// [+-]
// Remove streams from the subscription
// If the streams array is empty, does nothing
void removeStreams(const std::vector<TickStream *> &streams);
// [+-]
// Remove all streams from the subscription. RealtimeStartMesage will still come through
void removeAllStreams();
// [+]
// Submitted subscription changes will occur at the speciefied time
void setTimeForNewSubscriptions(TimestampMs dt);
// Statistics ans misc
// Number of bytes received from the input stream
uint64_t nBytesReceived() const;
// Number of bytes read(decoded). Does not include bytes still left in the input buffer
uint64_t nBytesRead() const;
// Number of message bytes read (including 11 byte header and 4-byte length field)
uint64_t nMessageBytesRead() const;
// Number of messages read (number of succesful next calls)
uint64_t nMessagesRead() const;
// Number of messages read (number of succesful next calls)
uint64_t nMessagesSkipped() const;
// Number of messages read+skipped
uint64_t nMessagesReceived() const;
//static bool isValidLocalTypeId(unsigned x);
//static bool isValidRemoteTypeId(unsigned x);
//bool isRegisteredRemoteTypeId(size_t typeId) const;
//bool isRegisteredLocalTypeId(size_t typeId) const;
//bool isRegisteredRemoteEntityId(size_t entityId) const;
~TickCursor();
static void operator delete(void* ptr, size_t sz);
protected:
TickCursor();
DISALLOW_COPY_AND_ASSIGN(TickCursor);
}; // class TickCursor
class TickLoaderException : public std::runtime_error {
public:
TickLoaderException(const std::string &s) : std::runtime_error(s) {}
TickLoaderException(const char * s) : std::runtime_error(s) {}
};
class TickLoaderInterruptedException : public TickLoaderException {
public:
TickLoaderInterruptedException(const std::string &s) : TickLoaderException(s) {}
TickLoaderInterruptedException(const char * s) : TickLoaderException(s) {}
TickLoaderInterruptedException() : TickLoaderException("") {}
};
class TickLoaderClosedException : public TickLoaderException {
public:
TickLoaderClosedException() : TickLoaderException("Tickloader is interrupted/closed") {}
TickLoaderClosedException(const std::string &s) : TickLoaderException(s) {}
TickLoaderClosedException(const char * s) : TickLoaderException(s) {}
};
class TickLoader {
public:
class ErrorListener {
public:
virtual void onError(const std::string &errorClass, const std::string &errorMsg) = 0;
virtual ~ErrorListener() = default;
};
class SubscriptionListener {
public:
virtual void typesAdded(const std::vector<std::string> &types) = 0;
virtual void typesRemoved(const std::vector<std::string> &types) = 0;
virtual void allTypesAdded() = 0;
virtual void allTypesRemoved() = 0;
virtual void entitiesAdded(const std::vector<std::string> &entities) = 0;
virtual void entitiesRemoved(const std::vector<std::string> &entities) = 0;
virtual void allEnititesAdded() = 0;
virtual void allEnititesRemoved() = 0;
protected:
~SubscriptionListener() = default;
};
//MessageHeader make(const std::string &typeName, const std::string &symbolName);
//MessageLoader & next(const MessageHeader &header);
bool isClosed() const;
DataWriter& getWriter();
// Start writing next message (finalize previous one automatically, if necessary) - REMOVED
//DataWriter& next();
// Start writing next message (and fill header fields)
DataWriter& next(const std::string &typeName, const std::string &symbolName, TimestampMs timestamp = TIMESTAMP_NULL);
// Start writing next message (and fill header fields)
DataWriter& next(unsigned messageTypeId, const std::string &symbolName, TimestampMs timestamp = TIMESTAMP_NULL);
// Start writing next message (and fill header fields)
DataWriter& next(unsigned messageTypeId, unsigned entityId, TimestampMs timestamp = TIMESTAMP_NULL);
// Start writing next message (and fill header fields). The previous message (if any) is cancelled
DataWriter& beginMessage(unsigned messageTypeId, unsigned entityId, TimestampMs timestamp = DxApi::TIMESTAMP_NULL);
// Start writing next message (and fill header fields). The previous message (if any) is cancelled
DataWriter& beginMessage(unsigned messageTypeId, const std::string &symbolName, TimestampMs timestamp = TIMESTAMP_NULL);
// Start writing next message (and fill header fields). The previous message (if any) is cancelled
DataWriter& beginMessage(unsigned messageTypeId, unsigned entityId,
TimestampMs timestamp, bool commitPrevious);
// Start writing next message (and fill header fields). The previous message (if any) is cancelled
DataWriter& beginMessage(unsigned messageTypeId, const std::string &symbolName,
TimestampMs timestamp, bool commitPrevious);
// Send the current message
void send();
void commitMessage();
void flush();
// Send the current message (and fill header fields before sending) - REMOVED
//void send(const std::string &typeName, const std::string &symbolName, Timestamp timestamp = DxApi::TIMESTAMP_NULL);
void finish();
void close();
// register message type Id you can use later with this instance of TickLoader.
// Not mandatory in this version, if you know message descriptor order in advance. Id is small uint, can start from 0
void registerMessageType(unsigned newTypeId, const std::string &newTypeName);
// retrieve an ID you can later use instead of instrument name when calling functions for this instance of TickLoader. Value of 0 is reserved
//unsigned getInstrumentId(const std::string &symbolName);
unsigned getInstrumentId(const std::string &instrument);
void addListener(ErrorListener * listener);
void addListener(SubscriptionListener *listener);
void removeListener(ErrorListener *listener);
void removeListener(SubscriptionListener *listener);
size_t nErrorListeners();
size_t nSubscriptionListeners();
uint64_t nBytesWritten() const;
uint64_t nMsgWritten() const;
uint64_t nMsgCancelled() const;
void preload(size_t nBytesToPreload, size_t writeBlockSize = 0x4000);
const TickStream * stream() const;
~TickLoader();
void operator delete(void* ptr, size_t sz);
protected:
TickLoader();
DISALLOW_COPY_AND_ASSIGN(TickLoader);
}; // Class TickLoader
// This definition must match the definition for managed interface
#pragma pack(push, 1)
struct MessageHeader {
int64_t timestamp;
uint32_t length;
uint32_t entityId;
uint32_t typeId;
int32_t streamId;
uint32_t typeIdLocal; // Deprecated.
uint8_t cursorState = 0; // Contains isAtEnd and isAtBeginning flags etc.
uint8_t z0, z1, z2; // Padding
//int64_t pt;
/*struct {
uint64_t nanos;
uint64_t ticks;
} pt;*/
/*union {
void * parent;
uint64_t __dummy;
};*/
};
#pragma pack(pop)
class InstrumentMessage : public MessageHeader {
public:
TickCursor * cursor;
void copyHeaderFrom(const InstrumentMessage &m) { *this = m; }
const std::string * getTypeName() const;
};
class MarketMessage : public InstrumentMessage {
public:
int64_t originalTimestamp;
int64_t sequenceNumber;
int16_t currencyCode;
bool has_originalTimestamp, has_currencyCode, has_sequenceNumber;
std::string toString() const;
};
typedef std::vector<TickStream *> TickStreamVector;
struct QueryParameter {
std::string name; // Name of the parameter
std::string type; // Base type as text
Nullable<std::string> value; // nullable string value
QueryParameter(const std::string &name_, const std::string &type_, const std::string value_)
: name(name_), type(type_), value(value_) {}
QueryParameter(const std::string &name_, const std::string &type_, const Nullable<std::string> &value_)
: name(name_), type(type_), value(value_) {}
QueryParameter(const std::string &name_, const std::string &type_)
: name(name_), type(type_) {}
};
class TickDbException : public std::runtime_error {
public:
TickDbException(const std::string &s) : std::runtime_error(s) {}
TickDbException(const char * s) : std::runtime_error(s) {}
};
class TickDb {
public:
_DXAPI static TickDb * createFromUrl(const char * url);
_DXAPI static TickDb * createFromUrl(const char * url, const char * username, const char * password);
virtual bool isReadOnly() const = 0;
virtual bool isOpen() const = 0;
virtual bool open(bool readOnlyMode) = 0;
virtual void close() = 0;
virtual bool format() = 0;
virtual std::vector<TickStream *> listStreams() = 0;
virtual TickStream * getStream(const std::string &key) = 0;
virtual TickStream * createStream(const std::string &key, const std::string &name, const std::string &description, int distributionFactor) = 0;
virtual TickStream * createStream(const std::string &key, const StreamOptions &options) = 0;
virtual TickStream * createFileStream(const std::string &key, const std::string &dataFile) = 0;
virtual TickCursor * select(TimestampMs time, const std::vector<const TickStream *> *streams, const SelectionOptions &options,
const std::vector<std::string> *types, const std::vector<std::string> *entities) = 0;
virtual TickCursor * select(TimestampMs time, const std::vector<const TickStream *> &streams, const SelectionOptions &options,
const std::vector<std::string> *types, const std::vector<std::string> *entities) = 0;
virtual TickCursor * select(TimestampMs time, const std::vector<TickStream *> *streams, const SelectionOptions &options,
const std::vector<std::string> *types, const std::vector<std::string> *entities) = 0;
virtual TickCursor * select(TimestampMs time, const std::vector<TickStream *> &streams, const SelectionOptions &options,
const std::vector<std::string> *types, const std::vector<std::string> *entities) = 0;
virtual TickCursor* executeQuery(const std::string &qql, const SelectionOptions &options, TimestampMs time,
const std::vector<std::string> *instruments, const std::vector<QueryParameter> ¶ms) = 0;
virtual TickCursor * executeQuery(const std::string &qql, const SelectionOptions &options, TimestampMs time, const std::vector<QueryParameter> ¶ms) = 0;
virtual TickCursor * executeQuery(const std::string &qql, const SelectionOptions &options, const std::vector<QueryParameter> ¶ms) = 0;
virtual TickCursor * executeQuery(const std::string &qql, const std::vector<QueryParameter> ¶ms) = 0;
virtual TickCursor * createCursor(const TickStream *stream, const SelectionOptions &options) = 0;
virtual TickLoader * createLoader(const TickStream *stream, const LoadingOptions &options) = 0;
virtual ~TickDb() = 0;
// Not supposed to be called by the end user of the API
// This should only be called before open()
virtual void setStreamNamespacePrefix(const std::string &prefix) = 0;
virtual void setStreamNamespacePrefix(const char *prefix) = 0;
protected:
TickDb();
DISALLOW_COPY_AND_ASSIGN(TickDb);
}; // class TickDb
// Timebase Tick Stream view class
// Should not be used after deletion of the said database object
// TODO: Verify with signature that is set to magic value only if the object is actually alive? So we always crash or print error when referencing dead object
struct LockTypeEnum {
enum Enum {
NO_LOCK,
READ_LOCK,
WRITE_LOCK
};
};
ENUM_CLASS(uint8_t, LockType);
class TickStream {
public:
const std::string& key() const;
int32_t distributionFactor() const;
const Nullable<std::string>& name() const;
const Nullable<std::string>& description() const;
const Nullable<std::string>& owner() const;
const Nullable<std::string>& location() const;
const Nullable<std::string>& distributionRuleName() const;
StreamScope scope() const;
bool duplicatesAllowed() const;
bool highAvailability() const;
bool unique() const;
bool polymorphic() const;
// TODO: Change representation
const std::string& periodicity() const;
const Nullable<std::string>& metadata() const;
const StreamOptions& options() const;
bool setSchema(const DxApi::StreamOptions & options);
TickCursor* select(TimestampMs millisecondTime, const SelectionOptions &options, const std::vector<std::string> * types, const std::vector<std::string> * entities) const;
TickCursor* createCursor(const SelectionOptions &options) const;
TickLoader* createLoader(const LoadingOptions &options) const;
std::vector<std::string> listEntities() const;
bool getTimeRange(TimestampMs range[], const std::vector<std::string> * const entities = NULL) const;
bool getTimeRange(TimestampMs range[], const std::vector<std::string> &entities) const;
bool truncate(TimestampMs millisecondTime, const std::vector<std::string> * const entities = NULL) const;
bool truncate(TimestampMs millisecondTime, const std::vector<std::string> &entities) const;
bool clear(const std::vector<std::string> * const entities = NULL) const;
bool clear(const std::vector<std::string> &entities) const;
bool purge(TimestampMs millisecondTime) const;
bool deleteStream();
bool abortBackgroundProcess() const;
bool getPeriodicity(Interval * interval) const;
static void operator delete(void* ptr, size_t sz);
~TickStream();
protected:
TickStream();
DISALLOW_COPY_AND_ASSIGN(TickStream);
}; // class TickStream
} // namespace DxApi
namespace std {
template<> struct hash<DxApi::InstrumentIdentity> {
public:
size_t operator()(const DxApi::InstrumentIdentity &x) const
{
size_t h = hash<string>()(x.symbol) ^ hash<uint8_t>()(x.type.toInt());
return h;
}
};
} | 37.437695 | 178 | 0.639401 |
579b5b9ad40dbab1d110d4e28ef00954707e3e2a | 2,580 | h | C | iOS/10.0.2/PrivateFrameworks/AppPredictionInternal.framework/_ATXAppPredictor.h | onmyway133/Runtime-Headers | e9b80e7ab9103f37ad421ad6b8b58ee06369d21f | [
"MIT"
] | 30 | 2016-10-09T20:13:00.000Z | 2022-01-24T04:14:57.000Z | iOS/10.0.2/PrivateFrameworks/AppPredictionInternal.framework/_ATXAppPredictor.h | onmyway133/Runtime-Headers | e9b80e7ab9103f37ad421ad6b8b58ee06369d21f | [
"MIT"
] | null | null | null | iOS/10.0.2/PrivateFrameworks/AppPredictionInternal.framework/_ATXAppPredictor.h | onmyway133/Runtime-Headers | e9b80e7ab9103f37ad421ad6b8b58ee06369d21f | [
"MIT"
] | 7 | 2017-08-29T14:41:25.000Z | 2022-01-19T17:14:54.000Z | /* Generated by RuntimeBrowser
Image: /System/Library/PrivateFrameworks/AppPredictionInternal.framework/AppPredictionInternal
*/
@interface _ATXAppPredictor : NSObject {
NSString * _abGroupIdentifier;
_ATXAppInstallMonitor * _appInstallMonitor;
_ATXAppLaunchLocation * _appLaunchLocation;
_ATXAppLaunchMonitor * _appLaunchMonitor;
bool _appLaunchMonitorInitialized;
_DECAsset * _asset;
NSString * _dayZeroABGroupIdentifier;
_DECAsset * _dayZeroAsset;
NSDictionary * _dayZeroParameters;
_ATXScoreInterpreter * _interpreter;
struct { char *x1; double x2[24]; double x3; } * _lastPredictionItems;
int _nLastPredictionItems;
_ATXRecentInstallCache * _recentInstallCache;
}
+ (void)removeOldLaunchInfoFrom:(id)arg1 appLaunchHistogram:(id)arg2 spotlightLaunchHistogram:(id)arg3 dayOfWeekHistogram:(id)arg4 launchSequenceManager:(id)arg5;
+ (id)sharedInstance;
- (void).cxx_destruct;
- (void)_initAppLaunchMonitor;
- (id)appDictionaryForAppAtIndex:(int)arg1;
- (id)appInstallMonitor;
- (id)appLaunchMonitor;
- (id)constructSessionLogDictionaryWithFeedback:(id)arg1 consumerType:(unsigned long long)arg2 outcome:(unsigned long long)arg3;
- (void)dealloc;
- (id)getParseTree;
- (struct { char *x1; double x2[24]; double x3; }*)getPredictionItemsWithCount:(int*)arg1 scoreLogger:(id)arg2;
- (id)getPredictionModelDetails;
- (id)init;
- (id)initWithAsset:(id)arg1 withDayZeroAsset:(id)arg2;
- (void)logPredictionEventWithShown:(id)arg1 outcome:(unsigned long long)arg2 consumerType:(unsigned long long)arg3 consumerSubType:(unsigned char)arg4;
- (id)oldPathsToRestore;
- (id)pathsToBackUp;
- (id)predictWithLimit:(unsigned long long)arg1 scoreLogger:(id)arg2;
- (double)predictionScoreForItem:(const struct { char *x1; double x2[24]; double x3; }*)arg1;
- (double)predictionScoreForItem:(const struct { char *x1; double x2[24]; double x3; }*)arg1 scoreLogger:(id)arg2;
- (unsigned long long)receiveAppWidgetFeedback:(id)arg1 consumerType:(unsigned long long)arg2;
- (unsigned long long)receiveFeedback:(id)arg1 launchSource:(long long)arg2 consumerType:(unsigned long long)arg3 query:(id)arg4 consumerSubType:(unsigned char)arg5;
- (unsigned long long)receiveZkwSpotlightFeedback:(id)arg1 consumerType:(unsigned long long)arg2;
- (void)restoreSerializedState:(id)arg1;
- (id)serializeState;
- (void)sessionObjectLoggingForFeedback:(id)arg1 consumerType:(unsigned long long)arg2 andOutcome:(unsigned long long)arg3;
- (void)train;
- (void)updateFromAsset;
- (void)updateFromZeroDayAsset;
- (void)updateLaunchHistoryFromDuet;
@end
| 47.777778 | 165 | 0.783333 |
10e9554beed5dff0cf45a3594de96cac6b1864bb | 649 | sql | SQL | sql/_08_javasp/cases/case_7.sql | Zhaojia2019/cubrid-testcases | 475a828e4d7cf74aaf2611fcf791a6028ddd107d | [
"BSD-3-Clause"
] | 9 | 2016-03-24T09:51:52.000Z | 2022-03-23T10:49:47.000Z | sql/_08_javasp/cases/case_7.sql | Zhaojia2019/cubrid-testcases | 475a828e4d7cf74aaf2611fcf791a6028ddd107d | [
"BSD-3-Clause"
] | 173 | 2016-04-13T01:16:54.000Z | 2022-03-16T07:50:58.000Z | sql/_08_javasp/cases/case_7.sql | Zhaojia2019/cubrid-testcases | 475a828e4d7cf74aaf2611fcf791a6028ddd107d | [
"BSD-3-Clause"
] | 38 | 2016-03-24T17:10:31.000Z | 2021-10-30T22:55:45.000Z | autocommit on;
create procedure test_int7(i number)
as language java name 'SpTest.testInt_1(int) return int';
drop procedure test_int7;
create procedure test_int7(i number)
as language java name 'SpTest.testInt_1(int) ';
drop procedure test_int7;
$integer,$5;
call test_int7(?) ;
$integer,$8;
call test_int7(?) ;
$integer,$100;
call test_int7(?, '1') ;
drop procedure test_int7;
create procedure test_int7(i in out number)
as language java name 'SpTest.testInt_3(int []) ';
$integer,$5;
call test_int7(?) ;
$integer,$8;
call test_int7(?) ;
$integer,$100;
call test_int7(?, '1') ;
drop procedure test_int7;
rollback;
autocommit on;
| 17.078947 | 57 | 0.719569 |
3661e66661c7379464f4a53fbcf4e606031e15f0 | 769 | kt | Kotlin | middleware-moshi/src/main/java/com/nytimes/android/external/store3/middleware/moshi/MoshiStringParser.kt | brianPlummer/Core | 823dbcc3e29b49312f9c60641d45df0fe1718756 | [
"Apache-2.0"
] | null | null | null | middleware-moshi/src/main/java/com/nytimes/android/external/store3/middleware/moshi/MoshiStringParser.kt | brianPlummer/Core | 823dbcc3e29b49312f9c60641d45df0fe1718756 | [
"Apache-2.0"
] | null | null | null | middleware-moshi/src/main/java/com/nytimes/android/external/store3/middleware/moshi/MoshiStringParser.kt | brianPlummer/Core | 823dbcc3e29b49312f9c60641d45df0fe1718756 | [
"Apache-2.0"
] | null | null | null | package com.nytimes.android.external.store3.middleware.moshi
import com.nytimes.android.external.store3.base.Parser
import com.nytimes.android.external.store3.util.ParserException
import com.squareup.moshi.JsonAdapter
import com.squareup.moshi.Moshi
import java.io.IOException
import java.lang.reflect.Type
import javax.inject.Inject
class MoshiStringParser<Parsed> @Inject
constructor(moshi: Moshi, type: Type) : Parser<String, Parsed> {
private val jsonAdapter: JsonAdapter<Parsed> = moshi.adapter(type)
@Throws(ParserException::class)
override suspend fun apply(s: String): Parsed {
try {
return jsonAdapter.fromJson(s)!!
} catch (e: IOException) {
throw ParserException(e?.message ?: "", e)
}
}
}
| 30.76 | 70 | 0.726918 |
e76b7e80581b2b7f187a6b0a472a01498fa85316 | 1,457 | js | JavaScript | src/components/Homepage/ReceptionHours.js | OlaFornal/Alergolog | 9d10a72ae838c4ee4fd43e694e2b283847bf10e2 | [
"RSA-MD"
] | 1 | 2021-04-19T12:51:33.000Z | 2021-04-19T12:51:33.000Z | src/components/Homepage/ReceptionHours.js | OlaFornal/Alergolog | 9d10a72ae838c4ee4fd43e694e2b283847bf10e2 | [
"RSA-MD"
] | null | null | null | src/components/Homepage/ReceptionHours.js | OlaFornal/Alergolog | 9d10a72ae838c4ee4fd43e694e2b283847bf10e2 | [
"RSA-MD"
] | null | null | null | import React from "react"
import styled from "styled-components"
const Content = styled.div`
width: 100%;
height: 100%;
text-align: center;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
color: white;
`
const P2 = styled.p`
font-weight: 600;
font-size: 14px;
margin: 0;
${({ theme }) => theme.media.tabletPortrait} {
font-size: 12px;
}
`
const Line = styled.div`
width: 75px;
border-bottom: 3px solid white;
margin: 10px 0;
`
const P4 = styled.div`
font-size: 13px;
font-weight: 400;
line-height: 1.7;
`
const P3 = styled.div`
font-size: 12px;
padding: 0;
margin: 0;
font-weight: 800;
`
const P1 = styled.div`
margin-bottom: 0;
font-size: 25px;
font-weight: 700;
line-height: 1.15;
text-transform: uppercase;
${({ theme }) => theme.media.tabletPortrait} {
font-size: 20px;
}
`
const P5 = styled(P1)`
margin: 15px 0;
`
const Div = styled.div`
display: flex;
flex-direction: column;
align-items: center;
padding-bottom: 15px;
`
const Div2 = styled(Div)`
padding: 10px 0;
`
const ReceptionHours = () => (
<Content>
<Div>
<P1>Godziny przyjฤฤ</P1>
<Line/>
<P1>Krosno</P1>
</Div>
<P2>ul. ลปรณลkiewskiego 1A</P2>
<P2>(pierwsze piฤtro, wejลฤie od tyลu budynku)</P2>
<Div2>
<P3>Wtorki od 16:00 do 20:00</P3>
<P3>Czwartki od 10:00 dp 15:00</P3>
</Div2>
<P4>Rejestracja pacjentรณw</P4>
<P5>13 432 40 21</P5>
</Content>
)
export default ReceptionHours; | 15.836957 | 55 | 0.65477 |
0bfe299e77f7a6a65ce36d50602a1174df0cfcbe | 84 | js | JavaScript | clean.js | TomSaporito/object-bystring | 2c97457a8c842220caf7c085e25c2b5f978d9c2f | [
"MIT"
] | 2 | 2019-08-10T15:16:39.000Z | 2020-11-25T17:36:19.000Z | clean.js | TomSaporito/object-bystring | 2c97457a8c842220caf7c085e25c2b5f978d9c2f | [
"MIT"
] | 8 | 2019-08-10T15:21:44.000Z | 2019-12-09T16:39:01.000Z | clean.js | tamb/object-bystring | 2c97457a8c842220caf7c085e25c2b5f978d9c2f | [
"MIT"
] | null | null | null | const rimraf = require("rimraf");
rimraf.sync("dist");
console.log("removed dist");
| 21 | 33 | 0.702381 |
388c44bd0f6dbddc4fab978c364d202f24fd9fb9 | 666 | c | C | src/map/load/load_file_in_mem.c | Nilexplr/my_world | 536dfde00bc624fc4826de985c555ad8b30b7d2a | [
"MIT"
] | 3 | 2020-03-08T01:22:50.000Z | 2020-05-01T09:03:58.000Z | src/map/load/load_file_in_mem.c | Nilexplr/my_world | 536dfde00bc624fc4826de985c555ad8b30b7d2a | [
"MIT"
] | null | null | null | src/map/load/load_file_in_mem.c | Nilexplr/my_world | 536dfde00bc624fc4826de985c555ad8b30b7d2a | [
"MIT"
] | null | null | null | /*
** EPITECH PROJECT, 2018
** create_map_from_file.c
** File description:
** julien.ollivier@epitech.eu
*/
#include "file.h"
#include "lib.h"
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
file_t *load_file_in_mem(char const *path)
{
int fd = open(path, O_RDONLY);
void *first;
file_t *map;
if (fd < 0)
return NULL;
map = create_empty_node();
if (!map)
return NULL;
first = map;
for (map->line = get_next_line(fd); map->line ;
map = map->next, map->line = get_next_line(fd)) {
map->next = create_empty_node();
if (!map->next) {
free_file_in_mem(first);
return NULL;
}
}
close(fd);
return first;
}
| 17.526316 | 50 | 0.654655 |
5fa831a0f12aecc32331073ebca12d94635f2ad7 | 360 | css | CSS | src/app/visionneuseihm/visionneuse-genihm.component.css | Samhot/GenIHM | ebfcf55350ed1da9e42d6aeed42486dc893dbd36 | [
"MIT"
] | 30 | 2017-03-24T00:09:09.000Z | 2021-05-25T13:01:47.000Z | ADF_2.0.0/search-customisation-example/src/app/search/search-demo.component.css | AlfrescoArchive/adf-examples | dc558ba793f21815c496813481a8bab492358ba5 | [
"Apache-2.0"
] | 22 | 2022-03-01T23:50:02.000Z | 2022-03-02T10:27:53.000Z | src/app/visionneuseihm/visionneuse-genihm.component.css | Samhot/GenIHM | ebfcf55350ed1da9e42d6aeed42486dc893dbd36 | [
"MIT"
] | 32 | 2017-04-19T10:57:45.000Z | 2022-01-10T17:57:26.000Z | .example-card {
width: 200px;
flex: 0 20%;
margin: 15px;
}
.example-card-search-container {
display: flex;
flex-wrap: wrap;
}
.example-header-image {
background-image: url('../../assets/cowProfile.jpg');
background-size: cover;
margin-bottom: 15px;
}
.example-search-input {
width: 100px;
border: 1 solid;
border-color: black;
}
| 15.652174 | 55 | 0.647222 |
40ba27671bf23f57885ecb66992b00ad4de3fc3e | 746 | html | HTML | site-exemplo/index.html | Victorgms/Ola-Mundo | e647bab0a616021e49df67143061aded410fd658 | [
"MIT"
] | null | null | null | site-exemplo/index.html | Victorgms/Ola-Mundo | e647bab0a616021e49df67143061aded410fd658 | [
"MIT"
] | null | null | null | site-exemplo/index.html | Victorgms/Ola-Mundo | e647bab0a616021e49df67143061aded410fd658 | [
"MIT"
] | null | null | null | <!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Meu primeiro site em repositรณrio</title>
</head>
<body>
<h1>Hello, World!</h1>
<hr>
<p>Lorem ipsum dolor, sit amet consectetur adipisicing elit.
Magni nam assumenda inventore fuga, unde atque in sed laudantium
quaerat praesentium neque ullam ducimus, omnis iusto sunt nisi
doloribus nemo repudiandae.</p>
<p>Lorem ipsum dolor sit amet consectetur, adipisicing elit.
Maiores quaerat ut distinctio inventore quos minus, dolorem
eveniet aliquam aut numquam voluptatibus quia natus sunt, nam
alias, quam officia deleniti corrupti.</p>
</body>
</html> | 37.3 | 74 | 0.711796 |
18eac5b1ed130dddf33b4a9d137f3f62635be477 | 1,593 | rb | Ruby | test/cases/aggregator_test.rb | kaspth/activemodel-aggregator | 6ba7142332c5f5e269538f8a3aeaa4b86b3da512 | [
"MIT"
] | 8 | 2015-06-17T10:07:31.000Z | 2020-05-24T17:58:59.000Z | test/cases/aggregator_test.rb | kaspth/activemodel-aggregator | 6ba7142332c5f5e269538f8a3aeaa4b86b3da512 | [
"MIT"
] | null | null | null | test/cases/aggregator_test.rb | kaspth/activemodel-aggregator | 6ba7142332c5f5e269538f8a3aeaa4b86b3da512 | [
"MIT"
] | null | null | null | require 'helper'
class AggregatorTest < ActiveSupport::TestCase
setup do
@attrs = { person_name: 'Timm', email_address: 'test@example.com' }
@profile = Profile.new(@attrs)
end
test "reader returns default object" do
assert @profile.person
end
test "reader returns same object" do
assert_equal @profile.person, @profile.person
end
test "prefixed accessor methods" do
@profile.person_name = 'jjgittes'
assert_equal 'jjgittes', @profile.person_name
end
test "profile save method combines person and email" do
assert_difference ['Person.count', 'Email.count'] do
@profile.save
end
end
test "model scoped attributes" do
exp = { address: 'test@example.com' }
assert_equal exp, @profile.email_attributes
end
test "build a model from attributes" do
email = @profile.person.emails.build @profile.email_attributes
assert_equal 'test@example.com', email.address
end
test "setting a model" do
@profile.person = Person.new(name: 'David')
assert_equal 'David', @profile.person.name
end
end
class AggregatorValidationTest < ActiveSupport::TestCase
class Invite < ActiveModel::Aggregator
aggregate :person, required: :name
end
setup do
@invite = Invite.new(person_name: 'David')
end
test "valid" do
assert @invite.valid?
end
test "invalid" do
@invite.person_name = nil
assert_not @invite.valid?
end
test "collects errors" do
@invite.person_name = nil
@invite.valid?
assert_includes @invite.errors.full_messages, "Person name can't be blank"
end
end
| 23.086957 | 78 | 0.702448 |
188d201b1c8789f8f6a8468280d3b283f33b0328 | 35 | css | CSS | web/app/themes/bbf/custom-editor-style.css | jminguely/bbf | 27139569208e6281cddf171eaeff188da778de41 | [
"MIT"
] | null | null | null | web/app/themes/bbf/custom-editor-style.css | jminguely/bbf | 27139569208e6281cddf171eaeff188da778de41 | [
"MIT"
] | null | null | null | web/app/themes/bbf/custom-editor-style.css | jminguely/bbf | 27139569208e6281cddf171eaeff188da778de41 | [
"MIT"
] | null | null | null | .half-opacity {
opacity: 0.65;
}
| 8.75 | 16 | 0.6 |
f9a3ba47431ab6d7afef40138c08ebd9353d1ecf | 3,991 | go | Go | storage_drivers/ontap/api/azgo/api-lun-move.go | TimCook1/trident | 75ef09cd3c5fc2ea71f9f2930ea2e696d7b015fa | [
"Apache-2.0"
] | 579 | 2016-12-21T23:06:39.000Z | 2022-03-30T12:53:22.000Z | storage_drivers/ontap/api/azgo/api-lun-move.go | TimCook1/trident | 75ef09cd3c5fc2ea71f9f2930ea2e696d7b015fa | [
"Apache-2.0"
] | 693 | 2017-01-05T19:50:08.000Z | 2022-03-29T21:46:15.000Z | storage_drivers/ontap/api/azgo/api-lun-move.go | TimCook1/trident | 75ef09cd3c5fc2ea71f9f2930ea2e696d7b015fa | [
"Apache-2.0"
] | 201 | 2017-01-02T13:30:00.000Z | 2022-03-30T10:33:52.000Z | package azgo
import (
"encoding/xml"
"reflect"
log "github.com/sirupsen/logrus"
)
// LunMoveRequest is a structure to represent a lun-move Request ZAPI object
type LunMoveRequest struct {
XMLName xml.Name `xml:"lun-move"`
NewPathPtr *string `xml:"new-path"`
PathPtr *string `xml:"path"`
}
// LunMoveResponse is a structure to represent a lun-move Response ZAPI object
type LunMoveResponse struct {
XMLName xml.Name `xml:"netapp"`
ResponseVersion string `xml:"version,attr"`
ResponseXmlns string `xml:"xmlns,attr"`
Result LunMoveResponseResult `xml:"results"`
}
// NewLunMoveResponse is a factory method for creating new instances of LunMoveResponse objects
func NewLunMoveResponse() *LunMoveResponse {
return &LunMoveResponse{}
}
// String returns a string representation of this object's fields and implements the Stringer interface
func (o LunMoveResponse) String() string {
return ToString(reflect.ValueOf(o))
}
// ToXML converts this object into an xml string representation
func (o *LunMoveResponse) ToXML() (string, error) {
output, err := xml.MarshalIndent(o, " ", " ")
if err != nil {
log.Errorf("error: %v", err)
}
return string(output), err
}
// LunMoveResponseResult is a structure to represent a lun-move Response Result ZAPI object
type LunMoveResponseResult struct {
XMLName xml.Name `xml:"results"`
ResultStatusAttr string `xml:"status,attr"`
ResultReasonAttr string `xml:"reason,attr"`
ResultErrnoAttr string `xml:"errno,attr"`
}
// NewLunMoveRequest is a factory method for creating new instances of LunMoveRequest objects
func NewLunMoveRequest() *LunMoveRequest {
return &LunMoveRequest{}
}
// NewLunMoveResponseResult is a factory method for creating new instances of LunMoveResponseResult objects
func NewLunMoveResponseResult() *LunMoveResponseResult {
return &LunMoveResponseResult{}
}
// ToXML converts this object into an xml string representation
func (o *LunMoveRequest) ToXML() (string, error) {
output, err := xml.MarshalIndent(o, " ", " ")
if err != nil {
log.Errorf("error: %v", err)
}
return string(output), err
}
// ToXML converts this object into an xml string representation
func (o *LunMoveResponseResult) ToXML() (string, error) {
output, err := xml.MarshalIndent(o, " ", " ")
if err != nil {
log.Errorf("error: %v", err)
}
return string(output), err
}
// String returns a string representation of this object's fields and implements the Stringer interface
func (o LunMoveRequest) String() string {
return ToString(reflect.ValueOf(o))
}
// String returns a string representation of this object's fields and implements the Stringer interface
func (o LunMoveResponseResult) String() string {
return ToString(reflect.ValueOf(o))
}
// ExecuteUsing converts this object to a ZAPI XML representation and uses the supplied ZapiRunner to send to a filer
func (o *LunMoveRequest) ExecuteUsing(zr *ZapiRunner) (*LunMoveResponse, error) {
return o.executeWithoutIteration(zr)
}
// executeWithoutIteration converts this object to a ZAPI XML representation and uses the supplied ZapiRunner to send to a filer
func (o *LunMoveRequest) executeWithoutIteration(zr *ZapiRunner) (*LunMoveResponse, error) {
result, err := zr.ExecuteUsing(o, "LunMoveRequest", NewLunMoveResponse())
if result == nil {
return nil, err
}
return result.(*LunMoveResponse), err
}
// NewPath is a 'getter' method
func (o *LunMoveRequest) NewPath() string {
r := *o.NewPathPtr
return r
}
// SetNewPath is a fluent style 'setter' method that can be chained
func (o *LunMoveRequest) SetNewPath(newValue string) *LunMoveRequest {
o.NewPathPtr = &newValue
return o
}
// Path is a 'getter' method
func (o *LunMoveRequest) Path() string {
r := *o.PathPtr
return r
}
// SetPath is a fluent style 'setter' method that can be chained
func (o *LunMoveRequest) SetPath(newValue string) *LunMoveRequest {
o.PathPtr = &newValue
return o
}
| 30.937984 | 128 | 0.731897 |
2a2385b2f304420aa98d2bb1da6c7c2d0ec71883 | 2,102 | java | Java | mall-sms/src/main/java/com/macro/mall/service/impl/SmsTengxunMegServiceImpl.java | bingglewang/shopping-mall | 24aa1110aa896edd5aae4c0e7a11dfe99eaf1205 | [
"Apache-2.0"
] | null | null | null | mall-sms/src/main/java/com/macro/mall/service/impl/SmsTengxunMegServiceImpl.java | bingglewang/shopping-mall | 24aa1110aa896edd5aae4c0e7a11dfe99eaf1205 | [
"Apache-2.0"
] | null | null | null | mall-sms/src/main/java/com/macro/mall/service/impl/SmsTengxunMegServiceImpl.java | bingglewang/shopping-mall | 24aa1110aa896edd5aae4c0e7a11dfe99eaf1205 | [
"Apache-2.0"
] | 1 | 2019-05-13T08:07:44.000Z | 2019-05-13T08:07:44.000Z | package com.macro.mall.service.impl;
import com.github.qcloudsms.SmsSingleSender;
import com.github.qcloudsms.SmsSingleSenderResult;
import com.macro.mall.common.api.CommonResult;
import com.macro.mall.config.SMSConfig;
import com.macro.mall.dto.SmsCodeProperties;
import com.macro.mall.service.RedisService;
import com.macro.mall.service.SmsTengxunMegService;
import com.macro.mall.util.CodeGenerateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class SmsTengxunMegServiceImpl implements SmsTengxunMegService {
@Autowired
private SMSConfig smsConfig;
@Autowired
private RedisService redisService;
@Override
public boolean sendMessageByTemplate(String phone) throws Exception {
return false;
}
@Override
public CommonResult sendMessageModel(String phone) {
String msg = "็ญไฟกๅ้ๆๅ";
if (!phone.matches("^1[3|4|5|7|8][0-9]{9}$")) {
msg = "้ๆณๆๆบๅท";
return CommonResult.failed(msg);
}
try {
//ๅถไฝ้ช่ฏ็ ๏ผ6ไฝ้ๆบๆฐๅญ
SmsCodeProperties sms = CodeGenerateUtil.generateCode(phone);
//{ๅๆฐ}
String[] params = {sms.getCode()};
SmsSingleSender ssender = new SmsSingleSender(Integer.valueOf(smsConfig.getAppId()), smsConfig.getAppKey());
// ็ญพๅๅๆฐๆชๆไพๆ่
ไธบ็ฉบๆถ๏ผไผไฝฟ็จ้ป่ฎค็ญพๅๅ้็ญไฟก
SmsSingleSenderResult result = ssender.sendWithParam("86", phone,
Integer.valueOf(smsConfig.getTemplateId()), params, smsConfig.getSignName(), "", "");
//0ไปฃ่กจๆๅ ้0ไปฃ่กจๅคฑ่ดฅ
if (result != null && "OK".equals(result.errMsg)) {
// ๅฐ้ช่ฏ็ ไฟๅญๅฐredis๏ผๅนถไธ่ฎพ็ฝฎ่ฟๆๆถ้ด
redisService.set(phone, sms.getCode());
redisService.expire(phone,120);
}else{
return CommonResult.failed(result.errMsg);
}
} catch (Exception e) {
e.printStackTrace();
return CommonResult.failed(e.getMessage());
}
return CommonResult.success(null,msg);
}
}
| 35.033333 | 120 | 0.650333 |
81659c5ce1989be98fa86cab57b99c94ebfe8fbe | 387 | go | Go | util/rand.go | chent1024/cgo | 0a73ff0ae6de200ca4ecc5bc62fb9c3ab8041d74 | [
"MIT"
] | null | null | null | util/rand.go | chent1024/cgo | 0a73ff0ae6de200ca4ecc5bc62fb9c3ab8041d74 | [
"MIT"
] | null | null | null | util/rand.go | chent1024/cgo | 0a73ff0ae6de200ca4ecc5bc62fb9c3ab8041d74 | [
"MIT"
] | null | null | null | package util
import (
"math/rand"
"time"
)
// ้ๆบไธไธชๅบ้ดๆดๆฐ
func RandInt(min, max int) int {
if min > max {
return 0
}
rand.Seed(time.Now().UnixNano())
return rand.Intn(max-min) + min
}
// ้ๆบไธไธชๅฎ้ฟๆฐ็ป
func RandIntSlice(max, length int) []int {
if length > max {
return nil
}
var rs []int
rand.Seed(time.Now().UnixNano())
tmp := rand.Perm(max)
rs = tmp[:length]
return rs
}
| 12.9 | 42 | 0.630491 |
167ad3f9c67161e55a2db080566c3c46aa9ca046 | 1,741 | h | C | EZAudioExamples/iOS/EZAudioCoreGraphicsWaveformExample/EZAudioCoreGraphicsWaveformExample/CoreGraphicsWaveformViewController.h | 1self/noise | 1748695d18f0294b20f5e142c7f3369adede8ed8 | [
"MIT"
] | 2 | 2016-01-13T23:08:03.000Z | 2018-05-09T08:57:24.000Z | EZAudioExamples/iOS/EZAudioCoreGraphicsWaveformExample/EZAudioCoreGraphicsWaveformExample/CoreGraphicsWaveformViewController.h | 1self/noise | 1748695d18f0294b20f5e142c7f3369adede8ed8 | [
"MIT"
] | null | null | null | EZAudioExamples/iOS/EZAudioCoreGraphicsWaveformExample/EZAudioCoreGraphicsWaveformExample/CoreGraphicsWaveformViewController.h | 1self/noise | 1748695d18f0294b20f5e142c7f3369adede8ed8 | [
"MIT"
] | null | null | null | //
// CoreGraphicsWaveformViewController.h
// Noise
//
// Created by Syed Haris Ali on 12/15/13.
// Copyright (c) 2013 Syed Haris Ali. All rights reserved.
//
#import <UIKit/UIKit.h>
// Import EZAudio header
#import "EZAudio.h"
/**
We will allow this view controller to act as an EZMicrophoneDelegate. This is how we listen for the microphone callback.
*/
@interface CoreGraphicsWaveformViewController : UIViewController<NoiseView> {
}
#pragma mark - Components
/**
The CoreGraphics based audio plot
*/
@property (nonatomic,weak) IBOutlet EZAudioPlotGL *audioPlot;
@property (weak, nonatomic) IBOutlet UILabel *autoupload;
#pragma mark - Actions
/**
Switches the plot drawing type between a buffer plot (visualizes the current stream of audio data from the update function) or a rolling plot (visualizes the audio data over time, this is the classic waveform look)
*/
-(IBAction)changePlotType:(id)sender;
//@property (weak, nonatomic) IBOutlet UIView *meterView;
@property (weak, nonatomic) IBOutlet UIView *meterView2;
/**
Toggles the microphone on and off. When the microphone is on it will send its delegate (aka this view controller) the audio data in various ways (check out the EZMicrophoneDelegate documentation for more details);
*/
-(IBAction)reset1Self:(id)sender;
- (IBAction)vizTapHandler:(UIGestureRecognizer*)sender;
@property (weak, nonatomic) IBOutlet UIImageView *graphImageView;
- (IBAction)graphTap:(UIGestureRecognizer*)sender;
@property (weak, nonatomic) IBOutlet UIImageView *help;
- (IBAction)help:(id)sender;
- (IBAction)debug:(id)sender;
- (IBAction)historyTap:(UIGestureRecognizer*)sender;
- (IBAction)settingsTap:(id)sender;
@property (weak, nonatomic) IBOutlet UIImageView *history;
@end
| 32.240741 | 215 | 0.764503 |
47e64c480bde39dda7a05e6d299c705b1cae2105 | 74 | css | CSS | ionyweb/plugin_app/plugin_website_title/static/css/plugin_website_title.css | makinacorpus/ionyweb | 2f18e3dc1fdc86c7e19bae3778e67e28a37567be | [
"BSD-3-Clause"
] | 4 | 2015-09-28T10:07:39.000Z | 2019-10-18T20:14:07.000Z | ionyweb/plugin_app/plugin_website_title/static/css/plugin_website_title.css | makinacorpus/ionyweb | 2f18e3dc1fdc86c7e19bae3778e67e28a37567be | [
"BSD-3-Clause"
] | 1 | 2021-03-19T21:41:33.000Z | 2021-03-19T21:41:33.000Z | ionyweb/plugin_app/plugin_website_title/static/css/plugin_website_title.css | makinacorpus/ionyweb | 2f18e3dc1fdc86c7e19bae3778e67e28a37567be | [
"BSD-3-Clause"
] | 1 | 2017-10-12T09:25:19.000Z | 2017-10-12T09:25:19.000Z | div.iw-plugin-website-title h1 a{ color: inherit; text-decoration: none; } | 74 | 74 | 0.756757 |
39ebebf0db8b7d139ed359ade090fe19474effdd | 2,114 | java | Java | spring-cloud-gcp-data-datastore/src/main/java/org/springframework/cloud/gcp/data/datastore/core/mapping/DatastorePersistentProperty.java | rgregg/spring-cloud-gcp | 7990f0287f48abede4b51ffa5bbdaea02160e747 | [
"Apache-2.0"
] | null | null | null | spring-cloud-gcp-data-datastore/src/main/java/org/springframework/cloud/gcp/data/datastore/core/mapping/DatastorePersistentProperty.java | rgregg/spring-cloud-gcp | 7990f0287f48abede4b51ffa5bbdaea02160e747 | [
"Apache-2.0"
] | null | null | null | spring-cloud-gcp-data-datastore/src/main/java/org/springframework/cloud/gcp/data/datastore/core/mapping/DatastorePersistentProperty.java | rgregg/spring-cloud-gcp | 7990f0287f48abede4b51ffa5bbdaea02160e747 | [
"Apache-2.0"
] | 1 | 2021-09-05T10:02:39.000Z | 2021-09-05T10:02:39.000Z | /*
* Copyright 2018 original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.cloud.gcp.data.datastore.core.mapping;
import org.springframework.data.mapping.PersistentProperty;
/**
* Persistent property for Google Cloud Datastore
*
* @author Chengyuan Zhao
*
* @since 1.1
*/
public interface DatastorePersistentProperty
extends PersistentProperty<DatastorePersistentProperty> {
/**
* Get the name of the field to store this property in Datastore.
* @return the string name of the field.
*/
String getFieldName();
/**
* True for iterable properties that are stored as ARRAY of items in the Datastore
* field.
* @return true for iterable properties. false for singular properties.
*/
boolean isIterable();
/**
* True if the property is a POJO and is to be stored in Datastore as a Key of the
* POJO, which is a separate entity in Datastore.
* @return true if the property is stored in Datastore as a Key.
*/
boolean isReference();
/**
* True if the property is a POJO and is to be stored in Datastore as an embedded
* entity in the field.
* @return true if the property is stored in Datastore as an embedded entity.
*/
boolean isEmbedded();
/**
* True if the property should be excluded from indexes
* @return true if if the property should be indexed
*/
boolean isUnindexed();
/**
* Gets the inner type of the property, which is meaningful for fields of type ARRAY
* in Datastore.
* @return the inner type of the iterable property.
*/
Class<?> getIterableInnerType();
}
| 29.774648 | 85 | 0.722327 |
6195865dc3a2619efb597a7c84b9c1e7f361fdaf | 2,079 | css | CSS | style/navbar.css | henatan99/the-next-web-responsive-page-clone | 0e973cb6cadb266848e1e682d05033dccdaf9ac0 | [
"MIT"
] | 4 | 2020-10-14T10:18:48.000Z | 2021-02-09T13:52:46.000Z | style/navbar.css | henatan99/the-next-web-responsive-page-clone | 0e973cb6cadb266848e1e682d05033dccdaf9ac0 | [
"MIT"
] | 1 | 2020-10-13T07:33:57.000Z | 2020-10-13T07:33:57.000Z | style/navbar.css | henatan99/the-next-web-responsive-page-clone | 0e973cb6cadb266848e1e682d05033dccdaf9ac0 | [
"MIT"
] | null | null | null | .header {
background: #131313;
width: 100%;
max-width: 100%;
position: relative;
color: rgb(103, 103, 103);
}
.tnw-img {
height: 100%;
width: 100px;
position: absolute;
left: 0;
top: 0;
background: black;
padding: 1rem;
}
.nav-wrapper {
height: auto;
width: auto;
display: flex;
flex-direction: column;
margin-left: 100px;
}
.navbar {
display: none;
}
.navbar2 {
float: left;
display: flex;
flex-direction: row;
height: 48px;
width: 100%;
background: rgb(255, 255, 255);
align-items: center;
justify-content: space-between;
}
.nav2-left {
display: none;
}
.nav2-right {
position: absolute;
right: 10px;
}
.search-icon {
margin-right: 20px;
margin-bottom: 5px;
}
.menu-icon {
font-size: 29px;
color: red;
padding-top: 3px;
}
@media screen and (min-width: 768px) {
* {
max-width: 1024px;
}
.navbar {
display: flex;
flex-direction: row;
height: 32px;
width: 100%;
align-items: center;
background: #131313;
justify-content: space-between;
color: #fff;
}
.nav-left,
.nav2-left {
display: flex;
flex-direction: row;
align-items: center;
float: left;
}
.navbar a {
color: #555;
font-size: 12px;
}
.nav-left .is-active {
color: #fff;
}
.nav2-left li {
margin-left: -20px;
padding-right: 42px;
font-family: var(--font-family-tertiary);
}
.nav2-left a {
color: var(--color-light-grey);
}
.nav2-left a:hover {
color: #777;
}
.nav-left li,
.nav-right li {
margin-left: -20px;
padding-right: 30px;
}
.nav-right,
.nav2-right {
display: flex;
flex-direction: row;
align-items: center;
margin-left: -5px;
}
.header li {
list-style: none;
font-size: 14px;
}
.menu-icon {
display: none;
}
.nav-hide {
display: none;
}
}
/* Medaia Query for min-tablet width */
@media screen and (min-width: 1024px) {
* {
max-width: 100%;
}
.nav-wrapper {
width: 100%;
margin: 0;
}
.tnw-img {
display: none;
}
}
| 13.588235 | 45 | 0.577201 |
0e7bf949ac82c5ad8aff673e1a5900e52b912d39 | 2,387 | html | HTML | Office-ProPlus-Deployment/Microsoft.ProPlus.InstallGenerator/InstallGenWPF/HelpFiles/LanguageInfo.html | cvvamsi/Office-IT-Pro-Deployment-Scripts | e0283abbde0f5d322403acc4868c3d3c57b50c8e | [
"MIT"
] | 6 | 2021-08-05T09:13:37.000Z | 2021-11-02T04:54:32.000Z | Office-ProPlus-Deployment/Microsoft.ProPlus.InstallGenerator/InstallGenWPF/HelpFiles/LanguageInfo.html | golfkinguk/Office-IT-Pro-Deployment-Scripts | e0283abbde0f5d322403acc4868c3d3c57b50c8e | [
"MIT"
] | null | null | null | Office-ProPlus-Deployment/Microsoft.ProPlus.InstallGenerator/InstallGenWPF/HelpFiles/LanguageInfo.html | golfkinguk/Office-IT-Pro-Deployment-Scripts | e0283abbde0f5d322403acc4868c3d3c57b50c8e | [
"MIT"
] | 1 | 2020-07-07T16:30:38.000Z | 2020-07-07T16:30:38.000Z | ๏ปฟ<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<title></title>
<!--<link rel="stylesheet" href="https://appsforoffice.microsoft.com/fabric/1.0.1/fabric.min.css">
<link rel="stylesheet" href="https://appsforoffice.microsoft.com/fabric/1.0.1/fabric.components.min.css">-->
</head>
<body>
<div id="languageInfo" class="ms-Callout ms-Callout--arrowLeft" style="position:relative;top:-15px; font-family: Segoe UI Light">
<div class="ms-Callout-main" style="box-shadow: 0 0 0 0">
<div class="ms-Callout-header">
<p class="ms-Callout-title" style="font-weight: bold">Product Language</p>
</div>
<div class="ms-Callout-inner">
<div class="ms-Callout-content">
<p class="ms-Callout-subText">Determine which product languages to install.</p>
<hr>
<p class="ms-Callout-subText">Required. If the <strong>Language ID</strong> value is not set, the installation operation fails and indicates that the input is not valid.</p>
<br />
<p class="ms-Callout-subText">The <strong>ID</strong> value can be set to a valid Office culture language (such as en-us for English US or ja-jp for Japanese). The <em>ll-cc</em> value is the language identifier. </p>
<br />
<p class="ms-Callout-subText">
Language elements determine which product languages to install. Administrators must specify the languages they want to install. The first language determines the Shell UI culture. The Shell UI is the language of shortcuts, right-click context menus, and tooltips.
</p>
<br />
<p class="ms-Callout-subText">
If you decide that you want to change the Shell UI language after an initial installation, you have to uninstall Click-to-Run and reinstall. Add the language that you want to set for the Shell UI as the first language in the custom Configuration.xml file.
</p>
</div>
</div>
</div>
</div>
</body>
</html> | 62.815789 | 291 | 0.578969 |
61d64f975854197050fb3f9750f6e8b8caf047f9 | 1,338 | css | CSS | blog/static/style_files/css/explore.css | Abdelrahman-Security159/DjangoBlog | 08f1cc8e79a9be246c8f93641a3b4450330c5cf4 | [
"MIT"
] | null | null | null | blog/static/style_files/css/explore.css | Abdelrahman-Security159/DjangoBlog | 08f1cc8e79a9be246c8f93641a3b4450330c5cf4 | [
"MIT"
] | null | null | null | blog/static/style_files/css/explore.css | Abdelrahman-Security159/DjangoBlog | 08f1cc8e79a9be246c8f93641a3b4450330c5cf4 | [
"MIT"
] | null | null | null | body {
background-color: #302929;
}
h3 {
font-family: 'Courier New', Courier, monospace;
color: crimson;
margin-top: 15px;
}
h3 a {
color: #000000;
}
h3 a:hover{
color: #000000;
text-decoration: none;
border-style: groove;
border-left: 1px;
border-right: 1px;
border-color: #400000;
}
p {
font-family: 'Courier New', Courier, monospace;
color: blanchedalmond;
font-size: x-small;
}
#count__posts{
color: #000000;
margin-top: 20px;
margin-left: 350px;
}
#stack__post {
background-color: #4e4343;
width: 800px;
height: fit-content;
margin-left: 150px;
margin-top: 30px;
padding-bottom: 20px;
border: 2px;
border-radius: 5px;
border-style: dashed;
border-color: #000000;
}
#post {
border: 2px;
border-radius: 5px;
border-style: groove;
border-color: rgb(2, 36, 36);
height: 100px;
width: 760px;
margin-left: 15px;
margin-top: 20px;
}
#img {
width: 90px;
height: 90px;
margin-left: 10px;
margin-top: 3px;
margin-bottom: 5px;
}
#img__post {
width: 100px;
height: 100px;
display:inline-block;
}
#det__post {
float: right;
width: 630px;
height: 90px;
margin-top: 3px;
} | 16.936709 | 52 | 0.565022 |
58d93f64708e48e9ead5d81d0f8c151ce0ed3e5d | 322 | kt | Kotlin | app/src/main/java/com/tyler/app/kotlinkaiyan/mvp/model/bean/CategoryBean.kt | TylerWang1110/kotlin-kaiyan | 7945cdfbaeff8b67cf3a1123cd663a18c419168c | [
"Apache-2.0"
] | null | null | null | app/src/main/java/com/tyler/app/kotlinkaiyan/mvp/model/bean/CategoryBean.kt | TylerWang1110/kotlin-kaiyan | 7945cdfbaeff8b67cf3a1123cd663a18c419168c | [
"Apache-2.0"
] | null | null | null | app/src/main/java/com/tyler/app/kotlinkaiyan/mvp/model/bean/CategoryBean.kt | TylerWang1110/kotlin-kaiyan | 7945cdfbaeff8b67cf3a1123cd663a18c419168c | [
"Apache-2.0"
] | null | null | null | package com.tyler.app.kotlinkaiyan.mvp.model.bean
/**
* @ๅๅปบ่
Tyler Wang.
* @ๅๅปบๆถ้ด 2019/7/11 16:45.
* @ๆ่ฟฐ ${ๅ็ฑป}.
*/
data class CategoryBean(
var bgPicture: String,
var defaultAuthorId: Int,
var description: String,
var headerImage: String,
var id: Int,
var name: String,
var tagId: Int
) | 20.125 | 49 | 0.636646 |
6b704c2f15fa9d9784c0129bad0d9ef2ad7d193b | 404 | h | C | MotorwayScene/MotorwayScene/Src/Core/AppCore.h | BKhalil85/MotorwayScene | 112e7c5dc5726b90179c34423d3f6f32c75a722f | [
"Apache-2.0"
] | 1 | 2021-08-23T19:35:32.000Z | 2021-08-23T19:35:32.000Z | MotorwayScene/MotorwayScene/Src/Core/AppCore.h | BAKA7K/MotorwayScene | 112e7c5dc5726b90179c34423d3f6f32c75a722f | [
"Apache-2.0"
] | null | null | null | MotorwayScene/MotorwayScene/Src/Core/AppCore.h | BAKA7K/MotorwayScene | 112e7c5dc5726b90179c34423d3f6f32c75a722f | [
"Apache-2.0"
] | null | null | null | #pragma once
#include "Core/WindowFrame.h"
#include "Scripts/Player.h"
#include "Scripts/WorldScene.h"
#include <memory>
class AppCore
{
private:
const std::shared_ptr<WindowFrame> m_window;
// Scripts
Player m_playerUser;
WorldScene m_worldScene;
private:
void SetupScripts();
void MainLoop();
void UpdateTick(const float& deltaTime);
void Render() const;
public:
AppCore();
~AppCore();
}; | 16.16 | 45 | 0.737624 |
a5480356055643a94aefea8fa419f5536a1cdfc1 | 244 | swift | Swift | DeclarativeUI/Classes/UI/UIViewControllerConvertible.swift | Holistic-Apps-LTDA/DeclarativeUI | 70dc37430b1c00e7888ffc09d095317296d69969 | [
"MIT"
] | 1 | 2022-03-21T15:42:23.000Z | 2022-03-21T15:42:23.000Z | DeclarativeUI/Classes/UI/UIViewControllerConvertible.swift | Holistic-Apps-LTDA/DeclarativeUI | 70dc37430b1c00e7888ffc09d095317296d69969 | [
"MIT"
] | null | null | null | DeclarativeUI/Classes/UI/UIViewControllerConvertible.swift | Holistic-Apps-LTDA/DeclarativeUI | 70dc37430b1c00e7888ffc09d095317296d69969 | [
"MIT"
] | null | null | null | import UIKit
public protocol UIViewControllerConvertible: AnyObject {
var uiViewController: UIViewController { get }
}
extension UIViewController: UIViewControllerConvertible {
public var uiViewController: UIViewController { self }
}
| 24.4 | 58 | 0.803279 |
2ce771b8fa1ec4c64995a76409d36d33a3d6057b | 3,069 | kt | Kotlin | app/src/main/java/com/example/cattlelog/herd_member_details/health_tab/HealthFragment.kt | Camoen/CattleLog | 6834da0f6e2b0f927523414e22bafb2a8fd30ada | [
"MIT"
] | null | null | null | app/src/main/java/com/example/cattlelog/herd_member_details/health_tab/HealthFragment.kt | Camoen/CattleLog | 6834da0f6e2b0f927523414e22bafb2a8fd30ada | [
"MIT"
] | 20 | 2019-09-10T22:45:11.000Z | 2019-11-26T23:30:33.000Z | app/src/main/java/com/example/cattlelog/herd_member_details/health_tab/HealthFragment.kt | Camoen/CattleLog | 6834da0f6e2b0f927523414e22bafb2a8fd30ada | [
"MIT"
] | 4 | 2019-11-08T01:55:30.000Z | 2020-10-05T08:54:08.000Z | package com.example.cattlelog.herd_member_details.health_tab
import android.graphics.drawable.Drawable
import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.core.content.ContextCompat
import androidx.lifecycle.ViewModelProvider
import androidx.lifecycle.Observer
import androidx.recyclerview.widget.DividerItemDecoration
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.example.cattlelog.R
import com.example.cattlelog.herd_member_details.HerdMemberDetails
import kotlinx.android.synthetic.main.fragment_health.*
import pl.polidea.view.ZoomView
/**
* A simple [Fragment] subclass.
*/
class HealthFragment : Fragment() {
private var herdMemberTagNumber: Int = -1
private var herdMemberBirthDate: String = ""
private lateinit var healthViewModel: HealthViewModel
private lateinit var healthViewModelFactory: HealthViewModelFactory
private lateinit var healthRecyclerView: RecyclerView
private lateinit var healthAdapter: HealthListAdapter
private lateinit var zoomView: ZoomView
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
herdMemberTagNumber = (activity as HerdMemberDetails).getTagNumber()
herdMemberBirthDate = (activity as HerdMemberDetails).getBirthDate()
}
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
// Inflate the layout for this fragment
val v = inflater.inflate(R.layout.fragment_health, container, false)
zoomView = ZoomView(context)
zoomView.addView(v)
return zoomView
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
healthAdapter =
HealthListAdapter(activity!!)
healthRecyclerView = healthList
healthRecyclerView.layoutManager = LinearLayoutManager(activity!!)
healthRecyclerView.setHasFixedSize(true)
healthRecyclerView.adapter = healthAdapter
val divider = DividerItemDecoration(healthRecyclerView.context, DividerItemDecoration.VERTICAL)
divider.setDrawable(ContextCompat.getDrawable(activity!!, R.drawable.divider) as Drawable)
healthRecyclerView.addItemDecoration(divider)
// healthViewModelFactory takes in extra parameters (TagNumber, BirthDate) and passes them to healthViewModel
healthViewModelFactory =
HealthViewModelFactory(
activity!!.application,
herdMemberTagNumber,
herdMemberBirthDate
)
healthViewModel = ViewModelProvider(this, healthViewModelFactory).get(HealthViewModel::class.java)
healthViewModel.allHealth.observe(this, Observer { healthList ->
healthList?.let { healthAdapter.setHealthList(it) }
})
}
}
| 35.686047 | 117 | 0.746497 |
56e1f0a4db243703581b79fda90aa9e582c82290 | 1,225 | ts | TypeScript | Frontend/src/app/app.module.ts | MasterRadule/sciXiv | 62f1fde327b36359d03d720a271904c8acc40bd3 | [
"MIT"
] | null | null | null | Frontend/src/app/app.module.ts | MasterRadule/sciXiv | 62f1fde327b36359d03d720a271904c8acc40bd3 | [
"MIT"
] | null | null | null | Frontend/src/app/app.module.ts | MasterRadule/sciXiv | 62f1fde327b36359d03d720a271904c8acc40bd3 | [
"MIT"
] | null | null | null | import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { ToolbarModule } from './toolbar/toolbar.module';
import { DashboardModule } from './dashboard/dashboard.module';
import {HttpClientModule, HTTP_INTERCEPTORS} from '@angular/common/http';
import {SharedModule} from "./shared/shared.module";
import {AuthorModule} from "./author/author.module";
import { ReviewerModule } from './reviewer/reviewer.module';
import { EditorModule } from './editor/editor.module';
import { TokenInterceptor } from './interceptors/TokenInterceptor';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
AppRoutingModule,
BrowserAnimationsModule,
ToolbarModule,
DashboardModule,
HttpClientModule,
SharedModule,
AuthorModule,
ReviewerModule,
EditorModule
],
providers: [
{
provide: HTTP_INTERCEPTORS,
useClass: TokenInterceptor,
multi: true
}
],
bootstrap: [AppComponent]
})
export class AppModule { }
| 29.166667 | 79 | 0.717551 |
0e4d5d9b18137343ed8e13e69e836813a0702eeb | 69,324 | html | HTML | jbox2d-serialization/target/apidocs/org/box2d/proto/class-use/Box2D.PbJoint.Builder.html | amrrus/SpaceBattle-physicsServer | 4e2f9e1aa549fd2f8011bb67cc8fe679f1bbf0da | [
"BSD-2-Clause"
] | null | null | null | jbox2d-serialization/target/apidocs/org/box2d/proto/class-use/Box2D.PbJoint.Builder.html | amrrus/SpaceBattle-physicsServer | 4e2f9e1aa549fd2f8011bb67cc8fe679f1bbf0da | [
"BSD-2-Clause"
] | null | null | null | jbox2d-serialization/target/apidocs/org/box2d/proto/class-use/Box2D.PbJoint.Builder.html | amrrus/SpaceBattle-physicsServer | 4e2f9e1aa549fd2f8011bb67cc8fe679f1bbf0da | [
"BSD-2-Clause"
] | null | null | null | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_37) on Tue Feb 19 02:33:44 EST 2013 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
Uses of Class org.box2d.proto.Box2D.PbJoint.Builder (jbox2d-serialization 1.0.1 API)
</TITLE>
<META NAME="date" CONTENT="2013-02-19">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class org.box2d.proto.Box2D.PbJoint.Builder (jbox2d-serialization 1.0.1 API)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#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="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?org/box2d/proto//class-useBox2D.PbJoint.Builder.html" target="_top"><B>FRAMES</B></A>
<A HREF="Box2D.PbJoint.Builder.html" target="_top"><B>NO FRAMES</B></A>
<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>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<CENTER>
<H2>
<B>Uses of Class<br>org.box2d.proto.Box2D.PbJoint.Builder</B></H2>
</CENTER>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
Packages that use <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><A HREF="#org.box2d.proto"><B>org.box2d.proto</B></A></TD>
<TD> </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><A HREF="#org.jbox2d.serialization.pb"><B>org.jbox2d.serialization.pb</B></A></TD>
<TD> </TD>
</TR>
</TABLE>
<P>
<A NAME="org.box2d.proto"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
Uses of <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A> in <A HREF="../../../../org/box2d/proto/package-summary.html">org.box2d.proto</A></FONT></TH>
</TR>
</TABLE>
<P>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../org/box2d/proto/package-summary.html">org.box2d.proto</A> that return <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#addAllBodies(java.lang.Iterable)">addAllBodies</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</A><? extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</A>> values)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#addAllJoints(java.lang.Iterable)">addAllJoints</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</A><? extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</A>> values)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#addBodies(int)">addBodies</A></B>(int value)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#addJoints(int)">addJoints</A></B>(int value)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbWorld.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbWorld.Builder.html#addJointsBuilder()">addJointsBuilder</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbWorld.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbWorld.Builder.html#addJointsBuilder(int)">addJointsBuilder</A></B>(int index)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#clear()">clear</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#clearBodies()">clearBodies</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#clearBodyA()">clearBodyA</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#clearBodyB()">clearBodyB</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#clearCollideConnected()">clearCollideConnected</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#clearDampingRatio()">clearDampingRatio</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#clearEnableLimit()">clearEnableLimit</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#clearEnableMotor()">clearEnableMotor</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#clearFrequency()">clearFrequency</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#clearGroundAnchorA()">clearGroundAnchorA</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#clearGroundAnchorB()">clearGroundAnchorB</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#clearJoint1()">clearJoint1</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#clearJoint2()">clearJoint2</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#clearJoints()">clearJoints</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#clearLength()">clearLength</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#clearLengthA()">clearLengthA</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#clearLengthB()">clearLengthB</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#clearLocalAnchorA()">clearLocalAnchorA</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#clearLocalAnchorB()">clearLocalAnchorB</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#clearLocalAxisA()">clearLocalAxisA</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#clearLowerLimit()">clearLowerLimit</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#clearMaxForce()">clearMaxForce</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#clearMaxLength()">clearMaxLength</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#clearMaxLengthA()">clearMaxLengthA</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#clearMaxLengthB()">clearMaxLengthB</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#clearMaxMotorForce()">clearMaxMotorForce</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#clearMaxMotorTorque()">clearMaxMotorTorque</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#clearMaxTorque()">clearMaxTorque</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#clearMotorSpeed()">clearMotorSpeed</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#clearRatio()">clearRatio</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#clearRefAngle()">clearRefAngle</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#clearSpringDampingRatio()">clearSpringDampingRatio</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#clearSpringFrequency()">clearSpringFrequency</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#clearTag()">clearTag</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#clearTarget()">clearTarget</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#clearTargetVolume()">clearTargetVolume</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#clearType()">clearType</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#clearUpperLimit()">clearUpperLimit</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#clone()">clone</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbWorld.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbWorld.Builder.html#getJointsBuilder(int)">getJointsBuilder</A></B>(int index)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#mergeFrom(org.box2d.proto.Box2D.PbJoint)">mergeFrom</A></B>(<A HREF="../../../../org/box2d/proto/Box2D.PbJoint.html" title="class in org.box2d.proto">Box2D.PbJoint</A> other)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#mergeFrom(com.google.protobuf.CodedInputStream, com.google.protobuf.ExtensionRegistryLite)">mergeFrom</A></B>(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#mergeFrom(com.google.protobuf.Message)">mergeFrom</A></B>(com.google.protobuf.Message other)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#mergeGroundAnchorA(org.box2d.proto.Box2D.PbVec2)">mergeGroundAnchorA</A></B>(<A HREF="../../../../org/box2d/proto/Box2D.PbVec2.html" title="class in org.box2d.proto">Box2D.PbVec2</A> value)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#mergeGroundAnchorB(org.box2d.proto.Box2D.PbVec2)">mergeGroundAnchorB</A></B>(<A HREF="../../../../org/box2d/proto/Box2D.PbVec2.html" title="class in org.box2d.proto">Box2D.PbVec2</A> value)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#mergeLocalAnchorA(org.box2d.proto.Box2D.PbVec2)">mergeLocalAnchorA</A></B>(<A HREF="../../../../org/box2d/proto/Box2D.PbVec2.html" title="class in org.box2d.proto">Box2D.PbVec2</A> value)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#mergeLocalAnchorB(org.box2d.proto.Box2D.PbVec2)">mergeLocalAnchorB</A></B>(<A HREF="../../../../org/box2d/proto/Box2D.PbVec2.html" title="class in org.box2d.proto">Box2D.PbVec2</A> value)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#mergeLocalAxisA(org.box2d.proto.Box2D.PbVec2)">mergeLocalAxisA</A></B>(<A HREF="../../../../org/box2d/proto/Box2D.PbVec2.html" title="class in org.box2d.proto">Box2D.PbVec2</A> value)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#mergeTarget(org.box2d.proto.Box2D.PbVec2)">mergeTarget</A></B>(<A HREF="../../../../org/box2d/proto/Box2D.PbVec2.html" title="class in org.box2d.proto">Box2D.PbVec2</A> value)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.html#newBuilder()">newBuilder</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.html#newBuilder(org.box2d.proto.Box2D.PbJoint)">newBuilder</A></B>(<A HREF="../../../../org/box2d/proto/Box2D.PbJoint.html" title="class in org.box2d.proto">Box2D.PbJoint</A> prototype)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.html#newBuilderForType()">newBuilderForType</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.html#newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent)">newBuilderForType</A></B>(com.google.protobuf.GeneratedMessage.BuilderParent parent)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#setBodies(int, int)">setBodies</A></B>(int index,
int value)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#setBodyA(int)">setBodyA</A></B>(int value)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#setBodyB(int)">setBodyB</A></B>(int value)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#setCollideConnected(boolean)">setCollideConnected</A></B>(boolean value)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#setDampingRatio(float)">setDampingRatio</A></B>(float value)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#setEnableLimit(boolean)">setEnableLimit</A></B>(boolean value)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#setEnableMotor(boolean)">setEnableMotor</A></B>(boolean value)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#setFrequency(float)">setFrequency</A></B>(float value)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#setGroundAnchorA(org.box2d.proto.Box2D.PbVec2.Builder)">setGroundAnchorA</A></B>(<A HREF="../../../../org/box2d/proto/Box2D.PbVec2.Builder.html" title="class in org.box2d.proto">Box2D.PbVec2.Builder</A> builderForValue)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#setGroundAnchorA(org.box2d.proto.Box2D.PbVec2)">setGroundAnchorA</A></B>(<A HREF="../../../../org/box2d/proto/Box2D.PbVec2.html" title="class in org.box2d.proto">Box2D.PbVec2</A> value)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#setGroundAnchorB(org.box2d.proto.Box2D.PbVec2.Builder)">setGroundAnchorB</A></B>(<A HREF="../../../../org/box2d/proto/Box2D.PbVec2.Builder.html" title="class in org.box2d.proto">Box2D.PbVec2.Builder</A> builderForValue)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#setGroundAnchorB(org.box2d.proto.Box2D.PbVec2)">setGroundAnchorB</A></B>(<A HREF="../../../../org/box2d/proto/Box2D.PbVec2.html" title="class in org.box2d.proto">Box2D.PbVec2</A> value)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#setJoint1(int)">setJoint1</A></B>(int value)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#setJoint2(int)">setJoint2</A></B>(int value)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#setJoints(int, int)">setJoints</A></B>(int index,
int value)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#setLength(float)">setLength</A></B>(float value)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#setLengthA(float)">setLengthA</A></B>(float value)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#setLengthB(float)">setLengthB</A></B>(float value)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#setLocalAnchorA(org.box2d.proto.Box2D.PbVec2.Builder)">setLocalAnchorA</A></B>(<A HREF="../../../../org/box2d/proto/Box2D.PbVec2.Builder.html" title="class in org.box2d.proto">Box2D.PbVec2.Builder</A> builderForValue)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#setLocalAnchorA(org.box2d.proto.Box2D.PbVec2)">setLocalAnchorA</A></B>(<A HREF="../../../../org/box2d/proto/Box2D.PbVec2.html" title="class in org.box2d.proto">Box2D.PbVec2</A> value)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#setLocalAnchorB(org.box2d.proto.Box2D.PbVec2.Builder)">setLocalAnchorB</A></B>(<A HREF="../../../../org/box2d/proto/Box2D.PbVec2.Builder.html" title="class in org.box2d.proto">Box2D.PbVec2.Builder</A> builderForValue)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#setLocalAnchorB(org.box2d.proto.Box2D.PbVec2)">setLocalAnchorB</A></B>(<A HREF="../../../../org/box2d/proto/Box2D.PbVec2.html" title="class in org.box2d.proto">Box2D.PbVec2</A> value)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#setLocalAxisA(org.box2d.proto.Box2D.PbVec2.Builder)">setLocalAxisA</A></B>(<A HREF="../../../../org/box2d/proto/Box2D.PbVec2.Builder.html" title="class in org.box2d.proto">Box2D.PbVec2.Builder</A> builderForValue)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#setLocalAxisA(org.box2d.proto.Box2D.PbVec2)">setLocalAxisA</A></B>(<A HREF="../../../../org/box2d/proto/Box2D.PbVec2.html" title="class in org.box2d.proto">Box2D.PbVec2</A> value)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#setLowerLimit(float)">setLowerLimit</A></B>(float value)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#setMaxForce(float)">setMaxForce</A></B>(float value)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#setMaxLength(float)">setMaxLength</A></B>(float value)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#setMaxLengthA(float)">setMaxLengthA</A></B>(float value)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#setMaxLengthB(float)">setMaxLengthB</A></B>(float value)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#setMaxMotorForce(float)">setMaxMotorForce</A></B>(float value)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#setMaxMotorTorque(float)">setMaxMotorTorque</A></B>(float value)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#setMaxTorque(float)">setMaxTorque</A></B>(float value)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#setMotorSpeed(float)">setMotorSpeed</A></B>(float value)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#setRatio(float)">setRatio</A></B>(float value)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#setRefAngle(float)">setRefAngle</A></B>(float value)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#setSpringDampingRatio(float)">setSpringDampingRatio</A></B>(float value)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#setSpringFrequency(float)">setSpringFrequency</A></B>(float value)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#setTag(long)">setTag</A></B>(long value)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#setTarget(org.box2d.proto.Box2D.PbVec2.Builder)">setTarget</A></B>(<A HREF="../../../../org/box2d/proto/Box2D.PbVec2.Builder.html" title="class in org.box2d.proto">Box2D.PbVec2.Builder</A> builderForValue)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#setTarget(org.box2d.proto.Box2D.PbVec2)">setTarget</A></B>(<A HREF="../../../../org/box2d/proto/Box2D.PbVec2.html" title="class in org.box2d.proto">Box2D.PbVec2</A> value)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#setTargetVolume(float)">setTargetVolume</A></B>(float value)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#setType(org.box2d.proto.Box2D.PbJointType)">setType</A></B>(<A HREF="../../../../org/box2d/proto/Box2D.PbJointType.html" title="enum in org.box2d.proto">Box2D.PbJointType</A> value)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html#setUpperLimit(float)">setUpperLimit</A></B>(float value)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbJoint.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbJoint.html#toBuilder()">toBuilder</A></B>()</CODE>
<BR>
</TD>
</TR>
</TABLE>
<P>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../org/box2d/proto/package-summary.html">org.box2d.proto</A> that return types with arguments of type <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A>></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbWorld.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbWorld.Builder.html#getJointsBuilderList()">getJointsBuilderList</A></B>()</CODE>
<BR>
</TD>
</TR>
</TABLE>
<P>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../org/box2d/proto/package-summary.html">org.box2d.proto</A> with parameters of type <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbWorld.Builder.html" title="class in org.box2d.proto">Box2D.PbWorld.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbWorld.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbWorld.Builder.html#addJoints(org.box2d.proto.Box2D.PbJoint.Builder)">addJoints</A></B>(<A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A> builderForValue)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbWorld.Builder.html" title="class in org.box2d.proto">Box2D.PbWorld.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbWorld.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbWorld.Builder.html#addJoints(int, org.box2d.proto.Box2D.PbJoint.Builder)">addJoints</A></B>(int index,
<A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A> builderForValue)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbWorld.Builder.html" title="class in org.box2d.proto">Box2D.PbWorld.Builder</A></CODE></FONT></TD>
<TD><CODE><B>Box2D.PbWorld.Builder.</B><B><A HREF="../../../../org/box2d/proto/Box2D.PbWorld.Builder.html#setJoints(int, org.box2d.proto.Box2D.PbJoint.Builder)">setJoints</A></B>(int index,
<A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A> builderForValue)</CODE>
<BR>
</TD>
</TR>
</TABLE>
<P>
<A NAME="org.jbox2d.serialization.pb"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
Uses of <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A> in <A HREF="../../../../org/jbox2d/serialization/pb/package-summary.html">org.jbox2d.serialization.pb</A></FONT></TH>
</TR>
</TABLE>
<P>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../org/jbox2d/serialization/pb/package-summary.html">org.jbox2d.serialization.pb</A> that return <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto">Box2D.PbJoint.Builder</A></CODE></FONT></TD>
<TD><CODE><B>PbSerializer.</B><B><A HREF="../../../../org/jbox2d/serialization/pb/PbSerializer.html#serializeJoint(org.jbox2d.dynamics.joints.Joint, java.util.Map, java.util.Map)">serializeJoint</A></B>(org.jbox2d.dynamics.joints.Joint argJoint,
<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</A><org.jbox2d.dynamics.Body,<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</A>> argBodyIndexMap,
<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</A><org.jbox2d.dynamics.joints.Joint,<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</A>> argJointIndexMap)</CODE>
<BR>
</TD>
</TR>
</TABLE>
<P>
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#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="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../org/box2d/proto/Box2D.PbJoint.Builder.html" title="class in org.box2d.proto"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?org/box2d/proto//class-useBox2D.PbJoint.Builder.html" target="_top"><B>FRAMES</B></A>
<A HREF="Box2D.PbJoint.Builder.html" target="_top"><B>NO FRAMES</B></A>
<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>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright © 2013. All Rights Reserved.
</BODY>
</HTML>
| 64.07024 | 479 | 0.66068 |
b96afdfa5f69002323e9824c8b6f7ba4b4518419 | 276 | h | C | CIE ID/CIE ID-Bridging-Header.h | bitpdg/cie-middleware-macos | 52a5f7883ddbf485686f285ce32c6e0f5d0e1c9a | [
"BSD-3-Clause"
] | null | null | null | CIE ID/CIE ID-Bridging-Header.h | bitpdg/cie-middleware-macos | 52a5f7883ddbf485686f285ce32c6e0f5d0e1c9a | [
"BSD-3-Clause"
] | null | null | null | CIE ID/CIE ID-Bridging-Header.h | bitpdg/cie-middleware-macos | 52a5f7883ddbf485686f285ce32c6e0f5d0e1c9a | [
"BSD-3-Clause"
] | null | null | null | //
// CIEID-Bridging-Header.h
// CIE ID
//
// Created by Pierluigi De Gregorio on 10/02/21.
// Copyright ยฉ 2021 IPZS. All rights reserved.
//
#ifndef CIEID_Bridging_Header_h
#define CIEID_Bridging_Header_h
#import "ChangeView.h"
#endif /* CIEID_Bridging_Header_h */
| 15.333333 | 49 | 0.717391 |
0cb24ca44f49e7024594f31e5eea8a2d6ed7620b | 1,437 | py | Python | Source Files/auth.py | clever-username/baseball-card-inventory | 9940ba746072892961b7ade586e63f7deb26d2e6 | [
"MIT"
] | 1 | 2021-05-18T21:32:43.000Z | 2021-05-18T21:32:43.000Z | Source Files/auth.py | clever-username/baseball-card-inventory | 9940ba746072892961b7ade586e63f7deb26d2e6 | [
"MIT"
] | null | null | null | Source Files/auth.py | clever-username/baseball-card-inventory | 9940ba746072892961b7ade586e63f7deb26d2e6 | [
"MIT"
] | 2 | 2015-05-18T14:52:01.000Z | 2015-05-19T18:21:51.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""This program prompts for a password."""
import authentication
import getpass
def login(username, maxattempts=3):
"""This function takes input from a user and checks the password.
Arg:
username(str): String input from user.
maxattempts(int): Max attempts for login.
Return:
auth(boolean): True or False if user successfully authenticated
before hitting maximum no. of failed attempts.
Examples:
>>>login('mike', 4)
Incorrect username or password. You have 4 attempts.
Incorrect username or password. You have 3 attempts.
Incorrect username or password. You have 2 attempts.
Incorrect username or password. You have 1 attempts.
Incorrect username or password. You have 0 attempts.
False
"""
auth = False
user_login = 'Please enter your password: '
auth_fail = "Incorrect username or password. You have" ' {} ' "attempts."
attempt = 1
while attempt <= maxattempts:
passwd = getpass.getpass(user_login)
message = authentication.authenticate(username, passwd)
if message:
auth = True
break
else:
print auth_fail.format(maxattempts - attempt)
attempt += 1
return auth
| 31.933333 | 78 | 0.592206 |
7f524f0cf9faf7da9c9e9b262a829076a3c47107 | 6,025 | kt | Kotlin | app/src/main/java/com/piyushjagtap/classifyme/fragment/ImageInfoFragment.kt | PiyushJagtap/ClassifyMe | a62860ff30d21a4c9c45333e368df896f10368f2 | [
"MIT"
] | null | null | null | app/src/main/java/com/piyushjagtap/classifyme/fragment/ImageInfoFragment.kt | PiyushJagtap/ClassifyMe | a62860ff30d21a4c9c45333e368df896f10368f2 | [
"MIT"
] | null | null | null | app/src/main/java/com/piyushjagtap/classifyme/fragment/ImageInfoFragment.kt | PiyushJagtap/ClassifyMe | a62860ff30d21a4c9c45333e368df896f10368f2 | [
"MIT"
] | null | null | null | package com.piyushjagtap.classifyme.fragment
import android.os.AsyncTask
import android.os.Bundle
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.LinearLayoutManager
import com.piyushjagtap.classifyme.adapter.RecyclerViewAdapter
import com.piyushjagtap.classifyme.databinding.ImageInfoFragmentBinding
import org.jsoup.Jsoup
class ImageInfoFragment(var imageLabel: String) : Fragment() {
//ImageInfoFragment View Binding
private var _binding: ImageInfoFragmentBinding? = null
private val binding get() = _binding!!
companion object {
private const val TAG = "ImageInfoFragment"
}
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?,
): View? {
_binding = ImageInfoFragmentBinding.inflate(inflater, container, false)
Log.d(TAG, "onCreateView: ")
//Executing Async Task of WebScraping
try {
GetImageElementsAsyncTask(imageLabel).execute()
} catch (e: Exception) {
Log.e(TAG, "Web Scraping Error: $e")
}
return binding.root
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
Log.d(TAG, "onViewCreated: ")
}
override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState)
Log.d(TAG, "onActivityCreated: ")
}
//Async Task to web scrape data from google search result using the image label and add it to the recycler view.
inner class GetImageElementsAsyncTask(var imageLabel: String) :
AsyncTask<Void, Int, ArrayList<ElementListItem>>() {
override fun onPreExecute() {
super.onPreExecute()
binding.progressCircular.visibility = View.VISIBLE
}
override fun onProgressUpdate(vararg values: Int?) {
super.onProgressUpdate(*values)
Log.d(TAG, "onProgressUpdate: $values")
binding.progressCircular.visibility = View.VISIBLE
}
override fun doInBackground(vararg params: Void?): ArrayList<ElementListItem> {
val elementsList = ArrayList<ElementListItem>()
try {
val doc =
Jsoup.connect("https://www.google.com/search?q=$imageLabel")
.userAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.85 Safari/537.36")
.get()
val linkLists = doc!!.getElementsByClass("eqAnXb")
val divElements = linkLists[0].getElementsByClass("tF2Cxc")
Log.d(TAG, "Main: $linkLists")
Log.d(TAG, "Div: $divElements")
for (divElement in divElements) {
if (divElement != null && divElement.childrenSize() != 0) {
val linkTitle = divElement.getElementsByTag("h3")[0].ownText().toString()
val linkUrl = divElement.getElementsByTag("a")[0].absUrl("href")
val linkDescription =
divElement.getElementsByClass("aCOpRe")[0].text().toString()
when {
linkTitle.isNullOrEmpty() -> {
Log.d(TAG,
"Div Elements:Title: $linkTitle \n Url: $linkUrl \n Desc: $linkDescription")
elementsList.add(ElementListItem("Title Not Available",
linkUrl,
linkDescription))
}
linkUrl.isNullOrEmpty() -> {
Log.d(TAG,
"Div Elements:Title: $linkTitle \n Url: $linkUrl \n Desc: $linkDescription")
elementsList.add(ElementListItem(linkTitle,
"URL Not Available",
linkDescription))
}
linkDescription.isNullOrEmpty() -> {
Log.d(TAG,
"Div Elements:Title: $linkTitle \n Url: $linkUrl \n Desc: $linkDescription")
elementsList.add(ElementListItem(linkTitle,
linkUrl,
"Description Not Available"))
}
else -> {
Log.d(TAG,
"Div Elements:Title: $linkTitle \n Url: $linkUrl \n Desc: $linkDescription")
elementsList.add(ElementListItem(linkTitle,
linkUrl,
linkDescription))
}
}
}
}
} catch (e: Exception) {
Log.e(TAG, "Web Scraping Error: $e")
}
return elementsList
}
override fun onPostExecute(result: ArrayList<ElementListItem>) {
super.onPostExecute(result)
if (!result.isNullOrEmpty()) {
binding.progressCircular.visibility = View.INVISIBLE
Log.d(TAG, "onPostExecute: ${result.size}")
val recyclerViewAdapter = RecyclerViewAdapter(result)
recyclerViewAdapter.notifyDataSetChanged()
val linearLayoutManager = LinearLayoutManager(context)
binding.recyclerView.layoutManager = linearLayoutManager
binding.recyclerView.setHasFixedSize(true)
binding.recyclerView.adapter = recyclerViewAdapter
}
}
}
} | 44.62963 | 152 | 0.542739 |
646c9624f92f53378e5a6dd3e766afd2a23c79eb | 1,420 | rs | Rust | catalog/src/schema.rs | mephistopheles-8/basicweb-rust-experiments | 43e051e1f4a6f732ebf70b555922543447e1e3c4 | [
"MIT"
] | null | null | null | catalog/src/schema.rs | mephistopheles-8/basicweb-rust-experiments | 43e051e1f4a6f732ebf70b555922543447e1e3c4 | [
"MIT"
] | null | null | null | catalog/src/schema.rs | mephistopheles-8/basicweb-rust-experiments | 43e051e1f4a6f732ebf70b555922543447e1e3c4 | [
"MIT"
] | 1 | 2021-05-07T01:34:08.000Z | 2021-05-07T01:34:08.000Z | table! {
catalogs (id) {
id -> Integer,
name -> Text,
description -> Nullable<Text>,
kind -> Integer,
status -> Integer,
uuid -> Binary,
created -> Timestamp,
updated -> Timestamp,
}
}
table! {
products (id) {
id -> Integer,
catalog -> Integer,
name -> Text,
description -> Nullable<Text>,
price_int -> Integer,
price_frac -> Integer,
currency -> Text,
status -> Integer,
uuid -> Binary,
created -> Timestamp,
updated -> Timestamp,
}
}
table! {
transactions (id) {
id -> Integer,
product -> Integer,
txn_code -> Text,
name -> Nullable<Text>,
address -> Nullable<Text>,
city -> Nullable<Text>,
region -> Nullable<Text>,
country -> Nullable<Text>,
postal -> Nullable<Text>,
email -> Nullable<Text>,
phone -> Nullable<Text>,
last4 -> Nullable<Text>,
payment_method -> Nullable<Text>,
amount_int -> Integer,
amount_frac -> Integer,
currency -> Text,
uuid -> Binary,
created -> Timestamp,
updated -> Timestamp,
}
}
joinable!(products -> catalogs (catalog));
joinable!(transactions -> products (product));
allow_tables_to_appear_in_same_query!(
catalogs,
products,
transactions,
);
| 22.903226 | 46 | 0.525352 |
388d5aabded43da1f8f79dad22cba34f39603f0e | 1,751 | h | C | title/bootloader/source/card.h | rootyElf/TWiLightMenu | 9637eca43d0963123eceef56359de18b83d6fb70 | [
"MIT"
] | 2 | 2019-05-09T01:44:15.000Z | 2021-01-26T16:08:15.000Z | title/bootloader/source/card.h | rootyElf/TWiLightMenu | 9637eca43d0963123eceef56359de18b83d6fb70 | [
"MIT"
] | null | null | null | title/bootloader/source/card.h | rootyElf/TWiLightMenu | 9637eca43d0963123eceef56359de18b83d6fb70 | [
"MIT"
] | 1 | 2019-12-25T23:23:09.000Z | 2019-12-25T23:23:09.000Z | /*-----------------------------------------------------------------
Copyright (C) 2005 Michael "Chishm" Chisholm
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
If you use this code, please give due credit and email me about your
project at chishm@hotmail.com
------------------------------------------------------------------*/
#ifndef CARD_H
#define CARD_H
#include "disc_io.h"
#include "io_dldi.h"
#include "sdmmc.h"
extern bool sdRead;
static inline bool CARD_StartUp (void) {
if (sdRead) {
sdmmc_controller_init(true);
return sdmmc_sdcard_init() == 0;
}
return _io_dldi.fn_startup();
}
static inline bool CARD_IsInserted (void) {
return sdRead ? true : _io_dldi.fn_isInserted();
}
static inline bool CARD_ReadSector (u32 sector, void *buffer) {
return sdRead ? (sdmmc_sdcard_readsectors(sector, 1, buffer) == 0) : _io_dldi.fn_readSectors(sector, 1, buffer);
}
static inline bool CARD_ReadSectors (u32 sector, int count, void *buffer) {
return sdRead ? (sdmmc_sdcard_readsectors(sector, count, buffer) == 0) : _io_dldi.fn_readSectors(sector, count, buffer);
}
#endif // CARD_H
| 33.037736 | 121 | 0.698458 |
8119b6dabf69ed5db4f9418caeadc76b84df5e43 | 587 | go | Go | server/server_type.go | potato47/nhwc-server | 411b84e4023e498c50c80d24a7f19896a2da6278 | [
"MIT"
] | 30 | 2018-06-08T07:21:27.000Z | 2022-03-31T10:09:17.000Z | server/server_type.go | potato47/nhwc-server | 411b84e4023e498c50c80d24a7f19896a2da6278 | [
"MIT"
] | 1 | 2020-01-06T03:36:20.000Z | 2020-01-06T03:36:20.000Z | server/server_type.go | potato47/nhwc-server | 411b84e4023e498c50c80d24a7f19896a2da6278 | [
"MIT"
] | 20 | 2018-08-11T05:50:46.000Z | 2022-03-07T07:30:06.000Z | package server
import "golang.org/x/net/websocket"
type (
Client struct {
Cid int
Uid string
Conn *websocket.Conn
}
Token struct {
Token string `json:"token"`
}
WsMessage struct {
Name string `json:"name"`
Value interface{} `json:"value"`
}
Response struct {
Data interface{} `json:"data"`
Error interface{} `json:"error"`
}
UserData struct {
Uid string `json:"uid"`
Username string `json:"username"`
Token string `json:"token"`
}
ErrorData struct {
ErrorCode int `json:"errorcode"`
ErrorMessage string `json:"errormessage"`
}
)
| 18.34375 | 43 | 0.654174 |
f058cebcd7be0c095e91691ed0127b29056028d4 | 1,320 | js | JavaScript | src/compositions/bcl-user-listing/user-listing.story.js | claudiu-cristea/bootstrap-component-library | 87ec400b5a5e5243ec140da1ff2f992dd88e2af9 | [
"MIT"
] | null | null | null | src/compositions/bcl-user-listing/user-listing.story.js | claudiu-cristea/bootstrap-component-library | 87ec400b5a5e5243ec140da1ff2f992dd88e2af9 | [
"MIT"
] | null | null | null | src/compositions/bcl-user-listing/user-listing.story.js | claudiu-cristea/bootstrap-component-library | 87ec400b5a5e5243ec140da1ff2f992dd88e2af9 | [
"MIT"
] | null | null | null | import demoData from "@openeuropa/bcl-user-listing/dataUserListing.js";
import headerData from "@openeuropa/bcl-data-header/data.js";
import userListing from "@openeuropa/bcl-user-listing/user-listing.html.twig";
import defaultSprite from "@openeuropa/bcl-bootstrap/bootstrap-icons.svg";
demoData.data.header = headerData;
export default {
title: "Compositions/Users/Listing",
parameters: {
layout: "fullscreen",
design: [
{
name: "Wireframe",
type: "figma",
url: "https://www.figma.com/file/NQlGvTiTXZYN8TwY2Ur5EI/BCL-Features?node-id=1122%3A33486",
},
],
},
};
const scriptInit = (story) => {
const demo = story();
return `
<script>
var badges = document.querySelectorAll(".badge");
badges.forEach(element => {
var close = element.getElementsByTagName('span')[0];
if (close) {
close.addEventListener('click', event => {
close.parentElement.remove();
})
}
});
</script>
${demo}`;
};
const correctPaths = (data) => {
data.data.filter_button.icon.path = defaultSprite;
data.data.badges.forEach((badge) => {
badge.icons_path = defaultSprite;
});
return data;
};
export const Default = () => userListing(correctPaths(demoData));
Default.decorators = [scriptInit];
| 26.938776 | 99 | 0.643939 |
9b661f733b3765c6202d19881bffc4071b8851eb | 148 | lua | Lua | Interface/AddOns/LittleWigs/WotLK/TheOculus/Options/Sounds.lua | ChinarG/Game-Wow-Plugins-Setting | e3fd3ddec1387c1f971dc195fec4fd9045d3105d | [
"Apache-2.0"
] | null | null | null | Interface/AddOns/LittleWigs/WotLK/TheOculus/Options/Sounds.lua | ChinarG/Game-Wow-Plugins-Setting | e3fd3ddec1387c1f971dc195fec4fd9045d3105d | [
"Apache-2.0"
] | null | null | null | Interface/AddOns/LittleWigs/WotLK/TheOculus/Options/Sounds.lua | ChinarG/Game-Wow-Plugins-Setting | e3fd3ddec1387c1f971dc195fec4fd9045d3105d | [
"Apache-2.0"
] | null | null | null |
BigWigs:AddSounds("Varos Cloudstrider", {
[51021] = "Alert",
})
BigWigs:AddSounds("Mage-Lord Urom", {
[51103] = "Alert",
[51121] = "Alert",
})
| 14.8 | 41 | 0.614865 |
bcda0ca5cb286ec8a4d0af50ad8044e9a7229a18 | 654 | js | JavaScript | node_modules/mdi-material-ui/MonitorClean.js | wh00sh/Tanda-DAPP | c8b21ca87dfa5e88ea6e975311e15e9009c48f75 | [
"Apache-2.0"
] | null | null | null | node_modules/mdi-material-ui/MonitorClean.js | wh00sh/Tanda-DAPP | c8b21ca87dfa5e88ea6e975311e15e9009c48f75 | [
"Apache-2.0"
] | null | null | null | node_modules/mdi-material-ui/MonitorClean.js | wh00sh/Tanda-DAPP | c8b21ca87dfa5e88ea6e975311e15e9009c48f75 | [
"Apache-2.0"
] | null | null | null | "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _createIcon = _interopRequireDefault(require("./util/createIcon"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
var _default = (0, _createIcon["default"])('M21 16H3V4H21M21 2H3C1.89 2 1 2.89 1 4V16C1 17.11 1.9 18 3 18H10V20H8V22H16V20H14V18H21C22.11 18 23 17.11 23 16V4C23 2.89 22.1 2 21 2M15 5.5L14.38 6.87L13 7.5L14.38 8.13L15 9.5L15.63 8.13L17 7.5L15.63 6.87L15 5.5M10.5 7.5L9.41 9.91L7 11L9.41 12.09L10.5 14.5L11.6 12.09L14 11L11.6 9.91L10.5 7.5');
exports["default"] = _default; | 46.714286 | 340 | 0.717125 |
7529bcfff4eb0d44700c546fa1893a6643d6882a | 515 | kt | Kotlin | app/src/main/java/com/fanrong/frwallet/wallet/cwv/bean/MarketInfoResp.kt | iamprivatewallet/PrivateWallet.Android | 5266b181d8d4fa413ec5538d2976f4d1f5d50e0f | [
"MIT"
] | null | null | null | app/src/main/java/com/fanrong/frwallet/wallet/cwv/bean/MarketInfoResp.kt | iamprivatewallet/PrivateWallet.Android | 5266b181d8d4fa413ec5538d2976f4d1f5d50e0f | [
"MIT"
] | null | null | null | app/src/main/java/com/fanrong/frwallet/wallet/cwv/bean/MarketInfoResp.kt | iamprivatewallet/PrivateWallet.Android | 5266b181d8d4fa413ec5538d2976f4d1f5d50e0f | [
"MIT"
] | null | null | null | package com.fanrong.frwallet.wallet.cwv.bean
import java.io.Serializable
data class MarketInfoResp(
var retcode: String
) : Serializable {
var kmarket: List<Kmarket>? = null
var msg: String? = null
}
data class Kmarket(
var coin: String
) : Serializable {
var close: String? = null
var currencyvalue: String? = null
var period: String? = null
var rmbclose: String? = null
var rmbcurrencyvalue: String? = null
var tradecoin: String? = null
var updown: String? = null
} | 22.391304 | 44 | 0.67767 |
d255ea5f73db786c057f3d2742c77d698493a39e | 731 | php | PHP | application/index/controller/Notify.php | gavin2014/dangjian | 49163a029221b0f1301f52b6840fbc715a17b6d6 | [
"Apache-2.0"
] | 1 | 2021-04-06T08:07:24.000Z | 2021-04-06T08:07:24.000Z | application/index/controller/Notify.php | gavin2014/dangjian | 49163a029221b0f1301f52b6840fbc715a17b6d6 | [
"Apache-2.0"
] | null | null | null | application/index/controller/Notify.php | gavin2014/dangjian | 49163a029221b0f1301f52b6840fbc715a17b6d6 | [
"Apache-2.0"
] | null | null | null | <?php
/**
* Created by ไบไธญๆ้นฟ.
* User: ้ไบ
* Blog: http://blog.likecy.cn
* Date: 2019-07-29
* Time: 13:24
*/
namespace app\index\controller;
use app\common\controller\Frontend;
use app\index\model\WisActivitynotify;
class Notify extends Frontend
{
protected $noNeedLogin = '*';
protected $noNeedRight = '*';
protected $layout = '';
public function index()
{
return $this->view->fetch();
}
public function readNotify($ids =null){
if ($ids==null){
return $this->error('ๅฐๅไธๆญฃ็กฎ');
}
$res = WisActivitynotify::get($ids);
// var_dump($res);
$this->assign('web_connent', $res['activity_note']);
return $this->view->fetch();
}
} | 17.829268 | 60 | 0.580027 |
439cdbba2cbb2b27d72ff0945b571fdb9dd92cea | 553 | swift | Swift | falcon/app/falconUITests/Page/ViewControllers/LNURL/LNURLManuallyEnterQRPage.swift | shieldwallets/falcon | 0cc18f526ac4060f6acdb81a5e93f472364abda7 | [
"MIT"
] | 115 | 2019-09-24T19:11:43.000Z | 2022-03-22T12:36:02.000Z | falcon/app/falconUITests/Page/ViewControllers/LNURL/LNURLManuallyEnterQRPage.swift | shieldwallets/falcon | 0cc18f526ac4060f6acdb81a5e93f472364abda7 | [
"MIT"
] | 13 | 2019-10-16T00:33:03.000Z | 2022-03-10T15:27:30.000Z | falcon/app/falconUITests/Page/ViewControllers/LNURL/LNURLManuallyEnterQRPage.swift | shieldwallets/falcon | 0cc18f526ac4060f6acdb81a5e93f472364abda7 | [
"MIT"
] | 13 | 2020-04-27T04:27:16.000Z | 2022-03-30T12:17:32.000Z | //
// LNURLManuallyEnterQRPage.swift
// falconUITests
//
// Created by Federico Bond on 11/05/2021.
// Copyright ยฉ 2021 muun. All rights reserved.
//
import Foundation
final class LNURLManuallyEnterQRPage: UIElementPage<UIElements.Pages.LNURLManuallyEnterQRPage> {
lazy var input = LargeTextInputViewPage(Root.input)
lazy var submitButton = ButtonViewPage(Root.submit)
init() {
super.init(root: Root.root)
}
func enterQR(_ qr: String) {
input.type(text: qr)
submitButton.mainButtonTap()
}
}
| 21.269231 | 96 | 0.687161 |
f01a0c64f7e6a1e2b7d5842eee69eee7bec8c173 | 1,533 | js | JavaScript | dashboard/assets/js/main.js | ministryofjustice/moj-product-dashboard | 13657feeedd66ec53b1e886bdfdfb13316704022 | [
"MIT"
] | 6 | 2016-05-22T15:33:34.000Z | 2017-08-04T10:20:36.000Z | dashboard/assets/js/main.js | ministryofjustice/moj-product-dashboard | 13657feeedd66ec53b1e886bdfdfb13316704022 | [
"MIT"
] | 138 | 2016-05-05T09:50:44.000Z | 2022-02-24T16:19:03.000Z | dashboard/assets/js/main.js | ministryofjustice/moj-product-dashboard | 13657feeedd66ec53b1e886bdfdfb13316704022 | [
"MIT"
] | 5 | 2016-10-07T19:32:08.000Z | 2021-04-11T06:53:49.000Z | import { createHistory } from 'history';
import React from 'react';
import ReactDOM from 'react-dom';
import { ProductContainer } from './containers/product-main';
import { ServiceContainer} from './containers/service';
import { PortfolioContainer } from './containers/portfolio';
import '../styles/gov-uk-elements.css';
import '../styles/main.css';
function product(id) {
ReactDOM.render(
<ProductContainer type='product' id={id} />,
document.getElementById('container')
);
}
function service(id) {
// product table
ReactDOM.render(
<ServiceContainer id={id} />,
document.getElementById('container')
);
}
function portfolio() {
// product table
ReactDOM.render(
<PortfolioContainer />,
document.getElementById('container')
);
}
function productGroup(id) {
ReactDOM.render(
<ProductContainer type='product-group' id={id} />,
document.getElementById('container')
);
}
function route(path) {
// call different loading functions based on page url
if (path === '/') {
portfolio();
return;
}
const pattern = /(products|services|product-groups)(\/(\d+))?/;
const matches = pattern.exec(path);
if (matches === null)
return;
const [_0, endpoint, _1, id] = matches;
switch (endpoint) {
case 'products':
product(id);
break;
case 'services':
service(id);
break;
case 'product-groups':
productGroup(id);
break;
};
}
const location = createHistory().getCurrentLocation();
route(location.pathname);
| 19.653846 | 65 | 0.654925 |
df309a0d2a4a21a74f1e0b10125743c05428303c | 262 | rb | Ruby | config/initializers/auto_complete.rb | MothOnMars/search-gov | 988839ec221fa4cac97aebe6305c4a8144f00256 | [
"ImageMagick"
] | null | null | null | config/initializers/auto_complete.rb | MothOnMars/search-gov | 988839ec221fa4cac97aebe6305c4a8144f00256 | [
"ImageMagick"
] | 3 | 2020-10-23T14:52:00.000Z | 2021-03-10T17:17:53.000Z | config/initializers/auto_complete.rb | MothOnMars/search-gov | 988839ec221fa4cac97aebe6305c4a8144f00256 | [
"ImageMagick"
] | null | null | null | require Rails.root.to_s + "/config/extras/auto_complete/auto_complete"
require Rails.root.to_s + "/config/extras/auto_complete/auto_complete_macros_helper"
ActionController::Base.send :include, AutoComplete
ActionController::Base.helper AutoCompleteMacrosHelper | 52.4 | 84 | 0.851145 |
920e79bfc969b68903e674d0823c00055317817d | 3,121 | kt | Kotlin | src/main/java/com/google/idea/gn/GnCompletionContributor.kt | trespasserw/intellij-gn-plugin | 433d5ca13fbf6121d8f5db34ef8e6e19642d0437 | [
"BSD-3-Clause"
] | 8 | 2020-07-14T04:03:35.000Z | 2022-03-31T14:56:06.000Z | src/main/java/com/google/idea/gn/GnCompletionContributor.kt | trespasserw/intellij-gn-plugin | 433d5ca13fbf6121d8f5db34ef8e6e19642d0437 | [
"BSD-3-Clause"
] | 13 | 2020-07-13T16:54:03.000Z | 2021-12-02T16:29:31.000Z | src/main/java/com/google/idea/gn/GnCompletionContributor.kt | trespasserw/intellij-gn-plugin | 433d5ca13fbf6121d8f5db34ef8e6e19642d0437 | [
"BSD-3-Clause"
] | 6 | 2020-10-13T16:49:34.000Z | 2021-09-03T01:07:11.000Z | // Copyright (c) 2020 Google LLC All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package com.google.idea.gn
import com.google.idea.gn.completion.FileCompletionProvider
import com.google.idea.gn.completion.IdentifierCompletionProvider
import com.google.idea.gn.psi.GnFile
import com.google.idea.gn.psi.Types
import com.google.idea.gn.psi.builtin.BuiltinVariable
import com.google.idea.gn.psi.builtin.Import
import com.intellij.codeInsight.completion.CompletionContributor
import com.intellij.codeInsight.completion.CompletionInitializationContext
import com.intellij.codeInsight.completion.CompletionType
import com.intellij.patterns.PlatformPatterns
import com.intellij.patterns.PlatformPatterns.psiElement
import com.intellij.patterns.StandardPatterns
import com.intellij.util.text.Matcher
class GnCompletionContributor : CompletionContributor() {
companion object {
const val DUMMY_ID = "gn_dummy_completion_"
}
override fun beforeCompletion(context: CompletionInitializationContext) {
context.dummyIdentifier = DUMMY_ID
context.replacementOffset = 0
}
init {
// Complete deps.
extend(CompletionType.BASIC,
psiElement(Types.STRING_LITERAL)
.withAncestor(10,
psiElement(Types.ASSIGNMENT).withFirstNonWhitespaceChild(
psiElement(Types.LVALUE)
.withText(StandardPatterns.or(
PlatformPatterns.string()
.oneOf(BuiltinVariable.DEPS.identifierName,
BuiltinVariable.PUBLIC_DEPS.identifierName,
BuiltinVariable.DATA_DEPS.identifierName,
BuiltinVariable.ALL_DEPENDENT_CONFIGS.identifierName,
BuiltinVariable.PUBLIC_CONFIGS.identifierName
),
// "Heuristic" for template variables that might use deps
PlatformPatterns.string().endsWith("_deps")
))
)
), FileCompletionProvider(
Matcher { name: String -> name == GnFile.BUILD_FILE },
skipFileName = true, parseTargets = true)
)
// Complete imports.
extend(CompletionType.BASIC, psiElement(Types.STRING_LITERAL)
.withSuperParent(5, psiElement(Types.CALL)
.withFirstNonWhitespaceChild(psiElement(Types.ID).withText(
Import.NAME))),
FileCompletionProvider(
Matcher { name: String -> name.endsWith(GnFile.GNI) }))
// Complete sources.
extend(CompletionType.BASIC, psiElement(Types.STRING_LITERAL).withAncestor(10,
psiElement(Types.ASSIGNMENT)
.withFirstChild(
psiElement(Types.LVALUE).withText(BuiltinVariable.SOURCES.identifierName))),
FileCompletionProvider(Matcher { true }))
// Complete identifiers.
extend(CompletionType.BASIC, psiElement(Types.IDENTIFIER), IdentifierCompletionProvider())
}
}
| 40.532468 | 94 | 0.668376 |
7f5fedb5640b227e040739b726378e34b634951f | 2,464 | sql | SQL | database/postgress.sql | OseiasBeu/INI_Backend | faf3f8d2c85d3d84e0e1fd000fddf787efbec985 | [
"MIT"
] | null | null | null | database/postgress.sql | OseiasBeu/INI_Backend | faf3f8d2c85d3d84e0e1fd000fddf787efbec985 | [
"MIT"
] | null | null | null | database/postgress.sql | OseiasBeu/INI_Backend | faf3f8d2c85d3d84e0e1fd000fddf787efbec985 | [
"MIT"
] | null | null | null |
#Usu๏ฟฝrios
CREATE TABLE public.usuarios(
id serial PRIMARY KEY,
email VARCHAR ( 200 ) UNIQUE NOT NULL,
senha VARCHAR ( 200 ) NOT NULL
);
insert into usuarios (email, senha) values('suporte@gmail.com', '$2b$10$6ZbT4sKq5St91o5bgpJpReNDHci.a3lQ18ObJAE97ljgApqFLyvNW');
SELECT id, email, senha FROM public.usuarios;
#Categorias
CREATE TABLE public.categorias(
id serial PRIMARY key not null,
descricao VARCHAR ( 200 ) NOT NULL,
cor VARCHAR ( 9 ) NOT NULL
);
insert into categorias (descricao, cor) values
( 'Pessoal', '#27AE60'),
( 'Escola', '#2F80ED'),
( 'Trabalho de Conclus๏ฟฝo', '#F2C94C'),
( 'Trabalho', '#EB5757');
SELECT * FROM public.categorias;
#Tarefas
CREATE TABLE public.tarefas(
id serial PRIMARY key not NULL,
descricao VARCHAR ( 255 ) UNIQUE NOT NULL,
data DATE NOT NULL DEFAULT CURRENT_DATE,
realizado BOOL NOT NULL,
categoria_id INT not null,
FOREIGN KEY (categoria_id) REFERENCES categorias (id)
);
insert into tarefas (descricao, data, realizado, categoria_id) values
('Pagar conta de energia', '2018-10-03 10:00:00', false, 1),
('Inciar o trabalho de ED', '2018-10-03 12:00:00', false, 2),
('Abastecer o carro', '2018-10-04 00:00:00', true, 1),
('Pagar conta de ๏ฟฝgua', '2018-11-12 10:00:00', true, 1),
('Entregar trabalho de ED', '2018-11-14 19:00:00', false, 2),
('Entregar trabalho de Meio Ambiente', '2018-11-15 19:00:00', false, 2),
('Verificar folha de ponto', '2018-12-13 19:00:00', false, 4),
('Entregar cap๏ฟฝtulo introducao', '2018-11-28 19:00:00', false, 3);
select * from public.tarefas;
update public.tarefas set descricao = 'Seminario Prof๏ฟฝtico 2', data = '2018-10-03T15:00:00.000Z', realizado = true, categoria_id =2 where id = 16;
#Artigos
CREATE TABLE public.artigos(
id serial PRIMARY key not null,
LinkImagem VARCHAR ( 1500 ) NOT NULL,
titulo VARCHAR ( 100 ) NOT NULL,
descricao VARCHAR ( 1000 ) NOT null,
linkArtigo VARCHAR ( 1500 ) NOT null
);
insert into artigos (LinkImagem,titulo,descricao, linkArtigo) values
('https://estiloadoracao.com/wp-content/uploads/2018/03/Le%C3%A3o-da-tribo-de-Jud%C3%A1.jpg', 'Leรฃo Da Tribo de Judรก','Jesus รฉ o Leรฃo de Judรก, mas por quรช? Ele รฉ chamado o leรฃo da tribo de Judรก porque ele รฉ o rei e sua famรญlia era da tribo de Judรก. Deus tinha prometido que o salvador viria de Judรก. O leรฃo representa a forรงa e o poder.','https://www.editoracoffea.com.br/post/conquista-da-cidade-e-ora%C3%A7%C3%A3o')
select * from public.artigos;
| 33.753425 | 417 | 0.708604 |
915d7fcd58eea560f800c44cf1247292cf1fe2e8 | 3,485 | html | HTML | _posts/2010-08-20-hqladdin-vers-1-0-0-45-alpha-2.html | jfromaniello/joseoncodecom | c35f99fbd8b6c709680f9649b078fb6171074719 | [
"MIT"
] | 1 | 2015-11-04T19:35:18.000Z | 2015-11-04T19:35:18.000Z | _posts/2010-08-20-hqladdin-vers-1-0-0-45-alpha-2.html | jfromaniello/joseoncodecom | c35f99fbd8b6c709680f9649b078fb6171074719 | [
"MIT"
] | null | null | null | _posts/2010-08-20-hqladdin-vers-1-0-0-45-alpha-2.html | jfromaniello/joseoncodecom | c35f99fbd8b6c709680f9649b078fb6171074719 | [
"MIT"
] | null | null | null | ---
layout: post
title: HqlAddin vers. 1.0.0.45 - Alpha 2
tags: []
status: publish
type: post
published: true
meta:
blogger_permalink: /2010/08/hqladdin-vers-10045-alpha-2.html
blogger_author: "Jos\xC3\xA9http://www.blogger.com/profile/00939999997597980426noreply@blogger.com"
blogger_blog: jfromaniello.blogspot.com
blogger_images: "1"
dsq_thread_id: "328926838"
---
<p>Today I have released a new version of the HqlAddin project, the version is 1.0.0.<strike>45</strike>50 โ Alpha 2 (a.k.a. Green Popotito). </p> <p>Green Popotito comes with a new amazing feature, intellisense for properties and entities. This is a great work that comes from <a href="http://sourceforge.net/projects/faticalabshqled/">Felice Pollanoโs NhWorkbench</a>, so kudos for him.</p> <p>Before we continue, let me show you a short screencast of the tool:</p> <object id="scPlayer" class="embeddedObject" width="631" height="332" type="application/x-shockwave-flash" data="http://content.screencast.com/users/JoseFR/folders/Jing/media/3817f5a4-093d-4a46-a94d-bf65b30fc51c/jingswfplayer.swf" > <param name="movie" value="http://content.screencast.com/users/JoseFR/folders/Jing/media/3817f5a4-093d-4a46-a94d-bf65b30fc51c/jingswfplayer.swf" /> <param name="quality" value="high" /> <param name="bgcolor" value="#FFFFFF" /> <param name="flashVars" value="thumb=http://content.screencast.com/users/JoseFR/folders/Jing/media/3817f5a4-093d-4a46-a94d-bf65b30fc51c/FirstFrame.jpg&containerwidth=631&containerheight=332&content=http://content.screencast.com/users/JoseFR/folders/Jing/media/3817f5a4-093d-4a46-a94d-bf65b30fc51c/2010-08-19_2114.swf&blurover=false" /> <param name="allowFullScreen" value="true" /> <param name="scale" value="showall" /> <param name="allowScriptAccess" value="always" /> <param name="base" value="http://content.screencast.com/users/JoseFR/folders/Jing/media/3817f5a4-093d-4a46-a94d-bf65b30fc51c/" /> </object> <p> </p> <h3>How does this work?</h3> <p>You have to export (with MEF) your configuration in any assembly, <strike>hql addin will look the output path of the startup project and if it find an <u>export</u> will import the information to give you intellisense.</strike> <strong><u>Just write an export on any project, the build path can be anywhere.</u></strong> Follows the instructions <a href="http://hqladdin.codeplex.com/wikipage?title=HowToAdvanceIntellisense">here</a>.</p> <p>Any configuration of any version of NHibernate is ok. In order to update your intellisense (e.g. when you change your mappings) you will have to rebuild the solution ctrl + shift + b.</p> <h3>How to use the hql files?</h3> <p>You can read the full guide <a href="http://hqladdin.codeplex.com/wikipage?title=HowToHqlFiles&referringTitle=Documentation">here</a>.</p> <h3>Where do I get this?</h3> <p>You can download from the <a href="http://hqladdin.codeplex.com/">main website</a> or simply from the Visual Studio Online Gallery of your Extension Manager. Read more <a href="http://hqladdin.codeplex.com/wikipage?title=Installation&referringTitle=Documentation">here</a>.</p> <h3></h3> <h3>Provide feedback is mandatory</h3> <p>Please get involved with the project, provide some feedback, thoughts, issues or anything!</p> <div class="blogger-post-footer">http://feeds.feedburner.com/JoseFRomaniello<img width='1' height='1' src='https://s3.amazonaws.com/joseoncode.com/img/2935908889399243312-2842886595952542780' alt='' /></div>
| 205 | 3,103 | 0.757532 |
a096b5971b9e449cb52975f416d411c72b1917d9 | 1,625 | kt | Kotlin | app/src/main/java/dev/sagar/assigmenthub/utils/ProgressButton.kt | Prince-Shaikh/AssigmentHub | 04ce4178e3c4fdf133dac43de3c07a6683978247 | [
"Unlicense"
] | 38 | 2021-02-28T08:45:46.000Z | 2022-02-13T22:00:07.000Z | app/src/main/java/dev/sagar/assigmenthub/utils/ProgressButton.kt | Prince-Shaikh/AssigmentHub | 04ce4178e3c4fdf133dac43de3c07a6683978247 | [
"Unlicense"
] | 5 | 2021-03-04T12:05:12.000Z | 2021-06-29T07:42:13.000Z | app/src/main/java/dev/sagar/assigmenthub/utils/ProgressButton.kt | Prince-Shaikh/AssigmentHub | 04ce4178e3c4fdf133dac43de3c07a6683978247 | [
"Unlicense"
] | 14 | 2021-02-28T18:14:12.000Z | 2022-01-30T20:16:38.000Z | package dev.sagar.assigmenthub.utils
import android.content.Context
import android.view.animation.Animation
import android.view.animation.AnimationUtils
import android.widget.ProgressBar
import android.widget.TextView
import androidx.cardview.widget.CardView
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.content.ContextCompat
import dev.hellosagar.assigmenthub.R
import dev.hellosagar.assigmenthub.databinding.ProgressButtonLayoutBinding
class ProgressButton(
context: Context,
view: ProgressButtonLayoutBinding,
private val btnText: String
) {
private var cardView: CardView = view.cvProgressButton
private var layout: ConstraintLayout = view.clProgressButton
private var innerClProgressButton: ConstraintLayout = view.innerClProgressButton
private var progressBar: ProgressBar = view.progressBarProgressButton
private var textView: TextView = view.tvProgressButton
private var fadeIn: Animation = AnimationUtils.loadAnimation(context, R.anim.fade_in)
init {
textView.text = btnText
}
fun btnActivated(text: String) {
progressBar.animation = fadeIn
progressBar.visible()
textView.animation = fadeIn
textView.text = text
}
fun btnFinished(text: String) {
innerClProgressButton.setBackgroundColor(
ContextCompat.getColor(
cardView.context,
R.color.green
)
)
textView.text = text
progressBar.invisible()
}
fun btnReset() {
textView.text = btnText
progressBar.invisible()
}
}
| 30.092593 | 89 | 0.726154 |
761784950feb6532f248dee7de304b1ece6f8cb6 | 3,990 | go | Go | api/types.go | cozzbp/gremcos | 92944d974a97ad477d36c5ee3d4ed4f49977f929 | [
"MIT"
] | 7 | 2020-04-15T06:31:46.000Z | 2022-03-28T20:43:16.000Z | api/types.go | cozzbp/gremcos | 92944d974a97ad477d36c5ee3d4ed4f49977f929 | [
"MIT"
] | 95 | 2020-02-13T11:48:50.000Z | 2022-03-29T11:24:26.000Z | api/types.go | cozzbp/gremcos | 92944d974a97ad477d36c5ee3d4ed4f49977f929 | [
"MIT"
] | 5 | 2021-06-08T02:13:24.000Z | 2021-10-11T22:41:07.000Z | package api
import (
"fmt"
"github.com/spf13/cast"
)
// Property represents the cosmos db type for a property.
// As it would be returned by a call to .properties().
type Property struct {
ID string `mapstructure:"id"`
Value TypedValue `mapstructure:"value,squash"`
Label string `mapstructure:"label"`
}
// Edge represents the cosmos DB type for an edge.
// As it would be returned by a call to g.E().
type Edge struct {
ID string `mapstructure:"id"`
Label string `mapstructure:"label"`
Type Type `mapstructure:"type"`
InVLabel string `mapstructure:"inVLabel"`
InV string `mapstructure:"inV"`
OutVLabel string `mapstructure:"outVLabel"`
OutV string `mapstructure:"outV"`
}
// Vertex represents the cosmos DB type for an vertex.
// As it would be returned by a call to g.V().
type Vertex struct {
Type Type `mapstructure:"type"`
ID string `mapstructure:"id"`
Label string `mapstructure:"label"`
Properties VertexPropertyMap `mapstructure:"properties"`
}
// ValueWithID represents the cosmos DB type for a value in case
// it is used/ attached to a complex type.
type ValueWithID struct {
ID string `mapstructure:"id"`
Value TypedValue `mapstructure:"value,squash"`
}
type VertexPropertyMap map[string][]ValueWithID
// Type defines the cosmos db complex types
type Type string
const (
TypeVertex Type = "vertex"
TypeEdge Type = "edge"
)
// TypedValue represents the cosmos DB type for a value in case
// it is not used/ attached to a complex type.
type TypedValue struct {
Value interface{}
}
// toValue converts the given input to a TypedValue
func toValue(input interface{}) (TypedValue, error) {
return TypedValue{Value: input}, nil
}
// converts a list of values to TypedValue
func toValues(input []interface{}) ([]TypedValue, error) {
if input == nil {
return nil, fmt.Errorf("Data is nil")
}
result := make([]TypedValue, 0, len(input))
for _, element := range input {
value, err := toValue(element)
if err != nil {
return nil, err
}
result = append(result, value)
}
return result, nil
}
func (tv TypedValue) AsFloat64E() (float64, error) {
return cast.ToFloat64E(tv.Value)
}
func (tv TypedValue) AsFloat64() float64 {
return cast.ToFloat64(tv.Value)
}
func (tv TypedValue) AsInt32E() (int32, error) {
return cast.ToInt32E(tv.Value)
}
func (tv TypedValue) AsInt32() int32 {
return cast.ToInt32(tv.Value)
}
func (tv TypedValue) AsBoolE() (bool, error) {
return cast.ToBoolE(tv.Value)
}
func (tv TypedValue) AsBool() bool {
return cast.ToBool(tv.Value)
}
func (tv TypedValue) AsStringE() (string, error) {
value, err := cast.ToStringE(tv.Value)
if err != nil {
return "", err
}
return UnEscape(value), nil
}
func (tv TypedValue) AsString() string {
return UnEscape(cast.ToString(tv.Value))
}
func (tv TypedValue) String() string {
return fmt.Sprintf("%v", tv.Value)
}
func (v Vertex) String() string {
return fmt.Sprintf("%s %s (props %v - type %s", v.ID, v.Label, v.Properties, v.Type)
}
func (e Edge) String() string {
return fmt.Sprintf("%s (%s)-%s->%s (%s) - type %s", e.InVLabel, e.InV, e.Label, e.OutVLabel, e.OutV, e.Type)
}
// Value returns the first value of the properties for this key
// the others are ignored. Anyway it is not possible to store multiple
// values for one property key.
func (vpm VertexPropertyMap) Value(key string) (ValueWithID, bool) {
value, ok := vpm[key]
if !ok {
return ValueWithID{}, false
}
if len(value) == 0 {
return ValueWithID{}, false
}
return value[0], true
}
func (vpm VertexPropertyMap) AsString(key string) (string, error) {
value, ok := vpm.Value(key)
if !ok {
return "", fmt.Errorf("%s does not exist", key)
}
return value.Value.AsStringE()
}
func (vpm VertexPropertyMap) AsInt32(key string) (int32, error) {
value, ok := vpm.Value(key)
if !ok {
return 0, fmt.Errorf("%s does not exist", key)
}
return value.Value.AsInt32E()
}
| 24.478528 | 109 | 0.681704 |
76d52d0d72922342ae30c63acccb7b89d3c3f7ed | 3,078 | h | C | BasicTools/GraphicsTransformTool.h | dhlee4/Tinkercell_new | c4d1848bbb905f0e1f9e011837268ac80aff8711 | [
"BSD-3-Clause"
] | 1 | 2021-01-07T13:12:51.000Z | 2021-01-07T13:12:51.000Z | BasicTools/GraphicsTransformTool.h | dhlee4/Tinkercell_new | c4d1848bbb905f0e1f9e011837268ac80aff8711 | [
"BSD-3-Clause"
] | 7 | 2020-04-12T22:25:46.000Z | 2020-04-13T07:50:40.000Z | BasicTools/GraphicsTransformTool.h | daniel-anavaino/tinkercell | 7896a7f809a0373ab3c848d25e3691d10a648437 | [
"BSD-3-Clause"
] | 2 | 2020-04-12T21:57:01.000Z | 2020-04-12T21:59:29.000Z | /****************************************************************************
Copyright (c) 2008 Deepak Chandran
Contact: Deepak Chandran (dchandran1@gmail.com)
See COPYRIGHT.TXT
This tool contains a set of transformation function such as scale, rotate, etc.
A GraphicsTool is also defined that brings up the transformations window
****************************************************************************/
#ifndef TINKERCELL_GRAPHICSTRANSFORMTOOL_H
#define TINKERCELL_GRAPHICSTRANSFORMTOOL_H
#include <stdlib.h>
#include <QtGui>
#include <QIcon>
#include <QPixmap>
#include <QString>
#include <QtDebug>
#include <QGraphicsItem>
#include <QGraphicsScene>
#include <QGraphicsView>
#include <QAction>
#include <QFile>
#include <QHBoxLayout>
#include <QGridLayout>
#include <QGroupBox>
#include <QUndoCommand>
#include <QGraphicsRectItem>
#include <QGraphicsWidget>
#include <QGroupBox>
#include <QSlider>
#include <QToolButton>
#include <QPushButton>
#include <QButtonGroup>
#include <QTableWidget>
#include <QTableWidgetItem>
#include "NodeGraphicsItem.h"
#include "NodesTree.h"
#include "ItemHandle.h"
#include "Tool.h"
#include "NodeGraphicsItem.h"
#include "ConnectionGraphicsItem.h"
#include "TextGraphicsItem.h"
#ifndef TINKERCELLEXPORT
#ifdef Q_WS_WIN
# if defined(TC_EXPORTS) || defined(TinkerCell_EXPORTS)
# define TINKERCELLEXPORT __declspec(dllexport)
# else
# define TINKERCELLEXPORT __declspec(dllimport)
# endif
#else
# define TINKERCELLEXPORT
#endif
#endif
namespace Tinkercell
{
class TINKERCELLEXPORT GraphicsTransformTool : public Tool
{
Q_OBJECT;
public:
GraphicsTransformTool();
bool setMainWindow(MainWindow * main);
public slots:
void select(int i=0);
void deselect(int i=0);
void selectPenColor();
void selectFillColor();
void scale(int);
void rotate(int);
void scaleStart();
void scaleEnd();
void rotateStart();
void rotateEnd();
void reset();
void onHide(bool);
void flipVertically();
void flipHorizontally();
void updateTable();
void itemsInserted(GraphicsScene* scene, const QList<QGraphicsItem *>& items, const QList<ItemHandle*>& handles);
void itemsSelected(GraphicsScene * scene, const QList<QGraphicsItem*>& items, QPointF point, Qt::KeyboardModifiers modifiers);
void toolLoaded(Tool*);
void xchanged(double dx);
void ychanged(double dy);
void wchanged(double dw);
void hchanged(double dh);
void linewchanged(double value);
void alphaChanged(double value);
void changePenType(int);
protected:
QList<QGraphicsItem*> targetItems;
int scaleRef;
int rotateRef;
qreal totalScaled;
qreal totalRotated;
QSlider scaleSlider;
QSlider rotateSlider;
QDockWidget * dockWidget;
bool moving;
QTableWidget * tableWidget;
QTableWidget * connectionsTableWidget;
void setupTable();
QGroupBox * sizeGroup;
QGroupBox * connectionsGroup;
QPushButton * replaceButton;
QList<QWidget*> connectionTableWidgets;
void connectionSelectionTool();
NodeGraphicsItem eye;
bool openedByUser;
QPushButton * closeButton;
};
}
#endif
| 23.142857 | 128 | 0.719298 |
07b8781a833e989ea6de92fc89262c5873f1b1ab | 86 | sql | SQL | jaffle-shop/macros/lots_of_macros.sql | Topherhindman/basic-dbt | ed1a11c37f8eed937bc7c82ce9fb646c4aa2fa06 | [
"Apache-2.0"
] | null | null | null | jaffle-shop/macros/lots_of_macros.sql | Topherhindman/basic-dbt | ed1a11c37f8eed937bc7c82ce9fb646c4aa2fa06 | [
"Apache-2.0"
] | null | null | null | jaffle-shop/macros/lots_of_macros.sql | Topherhindman/basic-dbt | ed1a11c37f8eed937bc7c82ce9fb646c4aa2fa06 | [
"Apache-2.0"
] | 1 | 2021-11-30T16:17:23.000Z | 2021-11-30T16:17:23.000Z | {% macro concat_name(first_name,last_name) %}
first_name last_name
{% endmacro %} | 28.666667 | 45 | 0.72093 |
1d4618be2cae861659bdf143a526aa6da4cd2981 | 359 | sql | SQL | SourceCode/SADFM/trunk/SADFM.Data/Scripts/1.0/0.077.sql | developersworkspace/EPONS | 7324161c02bb73975befd9be304088e9f3f3e62a | [
"MIT"
] | null | null | null | SourceCode/SADFM/trunk/SADFM.Data/Scripts/1.0/0.077.sql | developersworkspace/EPONS | 7324161c02bb73975befd9be304088e9f3f3e62a | [
"MIT"
] | null | null | null | SourceCode/SADFM/trunk/SADFM.Data/Scripts/1.0/0.077.sql | developersworkspace/EPONS | 7324161c02bb73975befd9be304088e9f3f3e62a | [
"MIT"
] | 1 | 2021-03-01T01:34:38.000Z | 2021-03-01T01:34:38.000Z | ๏ปฟUPDATE lif
SET Value =
CASE lif.Name
WHEN 'Stat' THEN 0
WHEN 'Once-Off' THEN 0
WHEN 'Daily' THEN 1
WHEN 'SecondDay' THEN 2
WHEN 'Weekly' THEN 7
WHEN 'SecondWeek' THEN 14
WHEN 'Monthly' THEN 30
END
FROM ListItem lif
INNER JOIN ListItem lifp ON (lifp.Name = 'Frequency' AND lifp.ParentId IS NULL AND lif.ParentId = lifp.ListItemId); | 27.615385 | 117 | 0.690808 |
f47fdafde9eb9d659c607a1b41a93fdb5be6714f | 15 | go | Go | protocol/msc/name_resolver.go | xfyun/xns | ecf5411a92e89aefbfbf5a1d03abaf65ff470d90 | [
"Apache-2.0"
] | 2 | 2021-12-31T08:19:34.000Z | 2021-12-31T08:29:15.000Z | protocol/msc/name_resolver.go | xfyun/xns | ecf5411a92e89aefbfbf5a1d03abaf65ff470d90 | [
"Apache-2.0"
] | null | null | null | protocol/msc/name_resolver.go | xfyun/xns | ecf5411a92e89aefbfbf5a1d03abaf65ff470d90 | [
"Apache-2.0"
] | null | null | null | package msc
| 3 | 11 | 0.666667 |
71e0b1d7bfcc08cc30688e48d6d6e75072c63436 | 379 | sql | SQL | data/sql/task_numbers.sql | ruzhnikov/SmsMachine | e89d85de07efeda8e41d7ba8a481fee25c09e483 | [
"Artistic-2.0"
] | null | null | null | data/sql/task_numbers.sql | ruzhnikov/SmsMachine | e89d85de07efeda8e41d7ba8a481fee25c09e483 | [
"Artistic-2.0"
] | null | null | null | data/sql/task_numbers.sql | ruzhnikov/SmsMachine | e89d85de07efeda8e41d7ba8a481fee25c09e483 | [
"Artistic-2.0"
] | null | null | null | DROP TABLE IF EXISTS `task_numbers`;
CREATE TABLE `task_numbers` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`task_id` INTEGER NOT NULL,
`message_id` INTEGER NOT NULL,
`number` TEXT NOT NULL,
`status` TEXT NOT NULL DEFAULT 'stop',
`repeat_count` INTEGER NOT NULL DEFAULT 0,
`external_id` INTEGER DEFAULT NULL,
`external_value` TEXT DEFAULT NULL
);
| 29.153846 | 46 | 0.701847 |
e654cdcd2447faf33ee2c99132cf98c776625dc6 | 1,546 | go | Go | initializers/rabbitmq.go | oldfritter/HealthManager | f050091867e7ee4c755d82be1594fe96ef3d9216 | [
"MIT"
] | null | null | null | initializers/rabbitmq.go | oldfritter/HealthManager | f050091867e7ee4c755d82be1594fe96ef3d9216 | [
"MIT"
] | null | null | null | initializers/rabbitmq.go | oldfritter/HealthManager | f050091867e7ee4c755d82be1594fe96ef3d9216 | [
"MIT"
] | null | null | null | package initializers
import (
"io/ioutil"
"log"
"path/filepath"
"time"
"github.com/streadway/amqp"
"gopkg.in/yaml.v2"
"github.com/oldfritter/HealthManager/utils"
)
type Amqp struct {
Host string `yaml:"host"`
Port string `yaml:"port"`
Username string `yaml:"username"`
Password string `yaml:"password"`
Vhost string `yaml:"vhost"`
Exchange map[string]map[string]string `yaml:"exchange"`
}
var (
AmqpGlobalConfigs = make(map[string]Amqp)
RabbitMqConnects = make(map[string]utils.RabbitMqConnect)
)
func InitializeAmqpConfig() {
pathStr, _ := filepath.Abs("config/amqp.yml")
content, err := ioutil.ReadFile(pathStr)
if err != nil {
log.Fatal(err)
return
}
err = yaml.Unmarshal(content, &AmqpGlobalConfigs)
if err != nil {
log.Fatal(err)
return
}
}
func InitializeAmqpConnection(name string) {
var err error
conn, err := amqp.Dial("amqp://" + AmqpGlobalConfigs[name].Username + ":" + AmqpGlobalConfigs[name].Password + "@" + AmqpGlobalConfigs[name].Host + ":" + AmqpGlobalConfigs[name].Port + "/" + AmqpGlobalConfigs[name].Vhost)
RabbitMqConnects[name] = utils.RabbitMqConnect{conn}
if err != nil {
log.Fatal("rabbimq connect error: %v", err)
time.Sleep(5000)
InitializeAmqpConnection(name)
return
}
go func() {
<-RabbitMqConnects[name].NotifyClose(make(chan *amqp.Error))
InitializeAmqpConnection(name)
}()
}
func CloseAmqpConnection(name string) {
RabbitMqConnects[name].Close()
}
func GetRabbitMqConnect(name string) utils.RabbitMqConnect {
return RabbitMqConnects[name]
}
| 23.074627 | 222 | 0.713454 |
65fcf623d7d88e7c43706d0f8c131bcbb67c3df6 | 2,208 | rs | Rust | src/behaviour/entity/random_string.rs | aschaeffer/inexor-rgf-plugin-random | 4d45796668db2a75bec003373aa5ac2186b3b270 | [
"MIT"
] | null | null | null | src/behaviour/entity/random_string.rs | aschaeffer/inexor-rgf-plugin-random | 4d45796668db2a75bec003373aa5ac2186b3b270 | [
"MIT"
] | null | null | null | src/behaviour/entity/random_string.rs | aschaeffer/inexor-rgf-plugin-random | 4d45796668db2a75bec003373aa5ac2186b3b270 | [
"MIT"
] | null | null | null | use std::convert::AsRef;
use std::sync::Arc;
use log::trace;
use serde_json::json;
use crate::behaviour::entity::RandomStringProperties;
use crate::model::PropertyInstanceGetter;
use crate::model::PropertyInstanceSetter;
use crate::model::ReactiveEntityInstance;
use crate::reactive::entity::Disconnectable;
use crate::reactive::BehaviourCreationError;
pub const RANDOM_STRING: &str = "random_string";
pub const CHARSET: &str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
pub struct RandomString {
pub entity: Arc<ReactiveEntityInstance>,
pub handle_id: u128,
}
impl RandomString {
pub fn new<'a>(e: Arc<ReactiveEntityInstance>) -> Result<RandomString, BehaviourCreationError> {
let entity = e.clone();
let handle_id = e.properties.get(RandomStringProperties::TRIGGER.as_ref()).unwrap().id.as_u128();
e.properties
.get(RandomStringProperties::TRIGGER.as_ref())
.unwrap()
.stream
.read()
.unwrap()
.observe_with_handle(
move |trigger| {
if !trigger.is_boolean() || !trigger.as_bool().unwrap() {
return;
}
let length = entity.get(RandomStringProperties::LENGTH.as_ref()).and_then(|v| v.as_i64());
if length.is_none() {
return;
}
let length = length.unwrap() as usize;
let rand_str = json!(random_string::generate(length, CHARSET));
entity.set(RandomStringProperties::RESULT.as_ref(), rand_str);
},
handle_id,
);
Ok(RandomString { entity: e.clone(), handle_id })
}
}
impl Disconnectable for RandomString {
fn disconnect(&self) {
if let Some(property) = self.entity.properties.get(RandomStringProperties::TRIGGER.as_ref()) {
trace!("Disconnecting {} with id {}", RANDOM_STRING, self.entity.id);
property.stream.read().unwrap().remove(self.handle_id);
}
}
}
impl Drop for RandomString {
fn drop(&mut self) {
self.disconnect();
}
}
| 33.454545 | 110 | 0.600543 |
5bf80663e3136281bf8afb6defc293d166a40fcb | 3,826 | h | C | tesseract_process_managers/include/tesseract_process_managers/core/task_info.h | ben-greenberg/tesseract_planning | 6907026937ed60b0344e5844ddb97e21c959fab3 | [
"Apache-2.0",
"BSD-2-Clause"
] | null | null | null | tesseract_process_managers/include/tesseract_process_managers/core/task_info.h | ben-greenberg/tesseract_planning | 6907026937ed60b0344e5844ddb97e21c959fab3 | [
"Apache-2.0",
"BSD-2-Clause"
] | null | null | null | tesseract_process_managers/include/tesseract_process_managers/core/task_info.h | ben-greenberg/tesseract_planning | 6907026937ed60b0344e5844ddb97e21c959fab3 | [
"Apache-2.0",
"BSD-2-Clause"
] | null | null | null | /**
* @file task_info.h
* @brief Process Info
*
* @author Matthew Powelson
* @date July 15. 2020
* @version TODO
* @bug No known bugs
*
* @copyright Copyright (c) 2020, Southwest Research Institute
*
* @par License
* Software License Agreement (Apache License)
* @par
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* @par
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef TESSERACT_PROCESS_MANAGERS_task_info_H
#define TESSERACT_PROCESS_MANAGERS_task_info_H
#include <tesseract_common/macros.h>
TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
#include <memory>
#include <shared_mutex>
#include <map>
TESSERACT_COMMON_IGNORE_WARNINGS_POP
#include <tesseract_command_language/core/instruction.h>
#include <tesseract_command_language/null_instruction.h>
#include <tesseract_environment/core/environment.h>
#ifdef SWIG
%shared_ptr(tesseract_planning::TaskInfo)
%template(TaskInfoMap) std::map<std::size_t, std::shared_ptr<const tesseract_planning::TaskInfo>>;
%shared_ptr(tesseract_planning::TaskInfoContainer)
#endif // SWIG
namespace tesseract_planning
{
/** Stores information about a Task */
class TaskInfo
{
public:
using Ptr = std::shared_ptr<TaskInfo>;
using ConstPtr = std::shared_ptr<const TaskInfo>;
TaskInfo() = default; // Required for serialziation
TaskInfo(std::size_t unique_id, std::string name = "");
virtual ~TaskInfo() = default;
TaskInfo(const TaskInfo&) = default;
TaskInfo& operator=(const TaskInfo&) = default;
TaskInfo(TaskInfo&&) = default;
TaskInfo& operator=(TaskInfo&&) = default;
/** @brief Value returned from the Task on completion */
int return_value;
/** @brief Unique ID generated for the Task by Taskflow */
std::size_t unique_id;
std::string task_name;
std::string message;
/** @brief elapsed_time Time spent in this task in seconds*/
double elapsed_time;
/** @brief Instructions passed to task (optionally set) */
Instruction instructions_input{ NullInstruction() };
/** @brief Instructions after running the task (optionally set)*/
Instruction instructions_output{ NullInstruction() };
/** @brief Seed/Results passed into the task (optionally set) */
Instruction results_input{ NullInstruction() };
/** @brief Seed/Results after running the task (optionally set)*/
Instruction results_output{ NullInstruction() };
/** @brief This is a clone of the environment at the beginning of the task (optionally set)*/
tesseract_environment::Environment::ConstPtr environment{ nullptr };
bool operator==(const TaskInfo& rhs) const;
bool operator!=(const TaskInfo& rhs) const;
private:
friend class boost::serialization::access;
template <class Archive>
void serialize(Archive& ar, const unsigned int version); // NOLINT
};
/** @brief A threadsafe container for TaskInfos */
struct TaskInfoContainer
{
using Ptr = std::shared_ptr<TaskInfoContainer>;
using ConstPtr = std::shared_ptr<const TaskInfoContainer>;
void addTaskInfo(TaskInfo::ConstPtr task_info);
TaskInfo::ConstPtr operator[](std::size_t index) const;
/** @brief Get a copy of the task_info_map_ in case it gets resized*/
std::map<std::size_t, TaskInfo::ConstPtr> getTaskInfoMap() const;
private:
mutable std::shared_mutex mutex_;
std::map<std::size_t, TaskInfo::ConstPtr> task_info_map_;
};
} // namespace tesseract_planning
#endif // TESSERACT_PROCESS_MANAGERS_task_info_H
| 32.982759 | 98 | 0.750653 |
040c9f0d11a64878f8e0202253544e8e5749d4d6 | 345 | js | JavaScript | Public/js/App.js | Juancav/ConsolaSDV | d70d9bb45a50cb683bdbb07a43266832bc4d27dd | [
"MIT"
] | null | null | null | Public/js/App.js | Juancav/ConsolaSDV | d70d9bb45a50cb683bdbb07a43266832bc4d27dd | [
"MIT"
] | null | null | null | Public/js/App.js | Juancav/ConsolaSDV | d70d9bb45a50cb683bdbb07a43266832bc4d27dd | [
"MIT"
] | null | null | null |
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/ConsolaSDV/sw.js')
.then((reg)=> console.log('El Service Worker fue instalado correctamente',reg))
.catch((err)=> console.log('Error, Fallo la instalacion del service worker',err));
}else{
console.log("El service worker no pudo ser instalado ")
} | 38.333333 | 86 | 0.686957 |
afa288a4257903e4aeb69f1cab3e1dd8122f4381 | 585 | rb | Ruby | metadata.rb | osuosl-cookbooks/osl-varnish | 3643fbe1415038e19c20721287618ea0148baabe | [
"Apache-2.0"
] | null | null | null | metadata.rb | osuosl-cookbooks/osl-varnish | 3643fbe1415038e19c20721287618ea0148baabe | [
"Apache-2.0"
] | 7 | 2015-01-06T05:26:45.000Z | 2019-05-02T17:08:40.000Z | metadata.rb | osuosl-cookbooks/osl-varnish | 3643fbe1415038e19c20721287618ea0148baabe | [
"Apache-2.0"
] | null | null | null | name 'osl-varnish'
maintainer 'Oregon State University'
maintainer_email 'systems@osuosl.org'
license 'Apache-2.0'
issues_url 'https://github.com/osuosl-cookbooks/osl-varnish/issues'
source_url 'https://github.com/osuosl-cookbooks/osl-varnish'
description 'OSL wrapper cookbook for varnish'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '1.0.1'
chef_version '>= 13.8.5' if respond_to?(:chef_version)
depends 'varnish'
depends 'firewall'
supports 'centos', '~> 6.0'
| 36.5625 | 73 | 0.661538 |
76dc42d40777f83dee559b9b310c556fb123b709 | 2,463 | h | C | src/symphony-core/HekaIOBridge/HekaIOBridge.h | Symphony-DAS/symphony-core2 | 94c691b3ad4f01246fa32f55d24476b856393368 | [
"NCSA",
"Unlicense"
] | 2 | 2015-07-15T13:41:10.000Z | 2019-01-01T07:09:18.000Z | src/symphony-core/HekaIOBridge/HekaIOBridge.h | Khlick/symphony-core | 94c691b3ad4f01246fa32f55d24476b856393368 | [
"NCSA",
"Unlicense"
] | 1 | 2016-09-30T18:39:46.000Z | 2016-09-30T18:39:46.000Z | src/symphony-core/HekaIOBridge/HekaIOBridge.h | Symphony-DAS/symphony-core2 | 94c691b3ad4f01246fa32f55d24476b856393368 | [
"NCSA",
"Unlicense"
] | 4 | 2015-05-15T10:46:54.000Z | 2021-07-18T23:52:40.000Z | // The following ifdef block is the standard way of creating macros which make exporting
// from a DLL simpler. All files within this DLL are compiled with the HEKAIOBRIDGE_EXPORTS
// symbol defined on the command line. This symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see
// HEKAIOBRIDGE_API functions as being imported from a DLL, whereas this DLL sees symbols
// defined with this macro as being exported.
//#ifdef HEKAIOBRIDGE_EXPORTS
//#define HEKAIOBRIDGE_API __declspec(dllexport)
//#else
//#define HEKAIOBRIDGE_API __declspec(dllimport)
//#endif
#pragma warning (default : 4412)
using namespace System;
using namespace System::Collections::Generic;
using namespace System::Threading;
using namespace Heka::NativeInterop;
#include <cstdint>
namespace Heka {
typedef int16_t itcsample_t;
public value struct ChannelIdentifier
{
public:
property uint16_t ChannelNumber;
property uint16_t ChannelType;
property int32_t Samples; //Number of input/output samples
virtual bool Equals(Object ^obj) override
{
if ( dynamic_cast<ChannelIdentifier^>(obj) )
{
ChannelIdentifier ^other = dynamic_cast<ChannelIdentifier^>(obj);
return (other->ChannelNumber == ChannelNumber &&
other->ChannelType == ChannelType);
} else {
return false;
}
}
virtual int GetHashCode() override
{
return ChannelNumber.GetHashCode() ^ ChannelType.GetHashCode();
}
};
public ref class IOBridge
{
public:
static const unsigned int TRANSFER_BLOCK_SAMPLES = 512;
IOBridge(IntPtr^ dev, unsigned int maxInputStreams, unsigned int maxOutputStreams)
: device(dev->ToPointer()), maxInputs(maxInputStreams), maxOutputs(maxOutputStreams)
{}
array<itcsample_t>^ RunTestMain(array<itcsample_t>^ managedOut, int nsamples);
IDictionary<ChannelIdentifier, array<itcsample_t>^>^
ReadWrite(IDictionary<ChannelIdentifier, array<itcsample_t>^>^ output,
IList<ChannelIdentifier>^ input,
int32_t nsamples,
CancellationToken^ token);
void Preload(IDictionary<ChannelIdentifier, array<itcsample_t>^>^ output);
void Write(IDictionary<ChannelIdentifier, array<itcsample_t>^>^ output);
private:
void *GetDevice() { return device; }
void WriteOutput(IDictionary<ChannelIdentifier, array<itcsample_t>^>^ output,
bool preload);
void *device;
unsigned const int maxInputs;
unsigned const int maxOutputs;
};
} | 29.321429 | 91 | 0.756395 |
0c914b89127421ea137b1e5268f255c0188586da | 775 | py | Python | contoh_2.py | sumarouno/4x4-Matrix-Keypad-Library-for-CHIP | 42794c3460818714fccc1c5a967e151504ef2ade | [
"MIT"
] | null | null | null | contoh_2.py | sumarouno/4x4-Matrix-Keypad-Library-for-CHIP | 42794c3460818714fccc1c5a967e151504ef2ade | [
"MIT"
] | null | null | null | contoh_2.py | sumarouno/4x4-Matrix-Keypad-Library-for-CHIP | 42794c3460818714fccc1c5a967e151504ef2ade | [
"MIT"
] | null | null | null | #!/usr/bin/python3
from time import sleep
from sys import exit
import keypad_4x4_lib_sumar
kp =keypad_4x4_lib_sumar.keypad()
# Setup variables
attempt = "0000"
passcode = "1912"
counter = 0
# Loop while waiting for a keypress
while True:
# Loop to get a pressed digit
digit = None
while digit == None:
digit = kp.getKey()
# Print the result
print ("Digit Entered: %s"%digit)
attempt = (attempt[1:] + str(digit))
print ("Attempt value: %s"%attempt)
# Check for passcode match
if (attempt == passcode):
print ("Your code was correct, goodbye.")
exit()
else:
counter += 1
print ("Entered digit count: %s"%counter)
if (counter >= 4):
print ("Incorrect code!")
sleep(3)
print ("Try Again")
sleep(1)
counter = 0
sleep(0.5)
| 18.452381 | 43 | 0.658065 |
9c17cfdc16eaedba411f955e0336f36da9499ce4 | 1,516 | ts | TypeScript | ts/identityWallet/types.ts | mnzaki/jolocom-lib | cd0b43cf976a017aad0124c200341d907933a984 | [
"MIT"
] | null | null | null | ts/identityWallet/types.ts | mnzaki/jolocom-lib | cd0b43cf976a017aad0124c200341d907933a984 | [
"MIT"
] | null | null | null | ts/identityWallet/types.ts | mnzaki/jolocom-lib | cd0b43cf976a017aad0124c200341d907933a984 | [
"MIT"
] | null | null | null | import { Identity } from '../identity/identity'
import { IVaultedKeyProvider, KeyTypes } from '../vaultedKeyProvider/types'
import { IKeyMetadata } from '../credentials/signedCredential/types'
import { IContractsAdapter, IContractsGateway } from '../contracts/types'
import {
CredentialOfferRequestAttrs,
CredentialOfferResponseAttrs,
ICredentialRequestAttrs,
ICredentialResponseAttrs,
ICredentialsReceiveAttrs,
IPaymentResponseAttrs,
} from '../interactionTokens/interactionTokens.types'
export interface IIdentityWalletCreateArgs {
vaultedKeyProvider: IVaultedKeyProvider
identity: Identity
publicKeyMetadata: IKeyMetadata
contractsAdapter: IContractsAdapter
contractsGateway: IContractsGateway
}
export type PublicKeyMap = { [key in keyof typeof KeyTypes]?: string }
export interface AuthCreationArgs {
callbackURL: string
description?: string
}
export type CredentialReceiveCreationArgs = ICredentialsReceiveAttrs
export type CredentialShareRequestCreationArgs = ICredentialRequestAttrs
export type CredentialShareResponseCreationArgs = ICredentialResponseAttrs
export type CredentialOfferRequestCreationArgs = CredentialOfferRequestAttrs
export type CredentialOfferResponseCreationArgs = CredentialOfferResponseAttrs
export type PaymentResponseCreationArgs = IPaymentResponseAttrs
export interface PaymentRequestCreationArgs {
callbackURL: string
description: string
transactionOptions: {
value: number
to?: string
gasLimit?: number
gasPrice?: number
}
}
| 32.255319 | 78 | 0.823219 |
f71d89ba7a00378cc6211b4a0f57b8c245f1626d | 304 | lua | Lua | mta-resources/[Gamemode]/[TDM]/mtatr_duel/client/global_client.lua | umithyo/MTA-TR | d5121f4671a82dc0593a867795eb988a9cb06da4 | [
"MIT"
] | 2 | 2019-10-02T16:03:16.000Z | 2020-05-13T20:29:58.000Z | mta-resources/[Gamemode]/[TDM]/mtatr_duel/client/global_client.lua | umithyo/MTA-TR | d5121f4671a82dc0593a867795eb988a9cb06da4 | [
"MIT"
] | 8 | 2021-06-17T21:09:17.000Z | 2021-06-27T06:08:52.000Z | mta-resources/[Gamemode]/[TDM]/mtatr_duel/client/global_client.lua | umithyo/mta-tr | d5121f4671a82dc0593a867795eb988a9cb06da4 | [
"MIT"
] | null | null | null | duel = {
tab = {},
tabpanel = {},
edit = {},
button = {},
window = {},
gridlist = {},
combobox = {}
}
current = nil;
players = {};
rooms = {};
weapons = { 2, 3, 4, 5, 6, 7, 8, 9, 22, 23, 24, 25, 26, 27, 28, 29, 32, 30, 31, 33, 34, 35, 36, 37, 38, 16, 17, 39 }; | 20.266667 | 117 | 0.407895 |
75f5fd49843f2b985c0c0afad04e8c29c03a955d | 4,159 | php | PHP | resources/views/about.blade.php | the-gd-dev/portfolio-app | 5cf04c6e72385dad71e3ec7467fb1b5006a05761 | [
"MIT"
] | null | null | null | resources/views/about.blade.php | the-gd-dev/portfolio-app | 5cf04c6e72385dad71e3ec7467fb1b5006a05761 | [
"MIT"
] | null | null | null | resources/views/about.blade.php | the-gd-dev/portfolio-app | 5cf04c6e72385dad71e3ec7467fb1b5006a05761 | [
"MIT"
] | null | null | null | <section id="about" class="about">
<div class="container" data-aos="fade-up">
<div class="section-title">
<h2>About</h2>
<p>{!! $about->about_summery ?? '' !!}</p>
</div>
<div class="row justify-content-center">
<div class="col-lg-4 text-center text-lg-right">
<img style="
object-fit: scale-down;
" src="{{ isset($about->about_image) ? asset('storage/about-images/' . $about->about_image) : '' }}" height="350" width="300" alt="">
</div>
<div class="col-lg-8 pt-4 pt-lg-0 content">
<h3 class="text-capitalize">{{ isset($work_profiles) ? implode(', ', $work_profiles) : ''}}</h3>
<p class="fst-italic">
{!! $about->work_profiles_summery ?? '' !!}
</p>
<div class="row">
<div class="col-lg-6">
<ul>
@if (isset($about->birthday))
<li><i class="bi bi-chevron-right"></i> <strong>Birthday:</strong>
<span>{!! date('M d Y',strtotime($about->birthday)) !!}</span>
</li>
@endif
@if (isset($about->website))
<li><i class="bi bi-chevron-right"></i> <strong>Website:</strong>
<span>{{ $about->website }}</span>
</li>
@endif
@if (isset($about->phone))
<li><i class="bi bi-chevron-right"></i> <strong>Phone:</strong>
<span>+{{ json_decode($about->country_code)->dialCode }} {{ $about->phone }}</span></li>
@endif
@if (isset($about->city))
<li><i class="bi bi-chevron-right"></i> <strong>City:</strong>
<span>{{ $about->city }}, {{ json_decode($about->country_code)->name }}</span></li>
@endif
</ul>
</div>
<div class="col-lg-6">
<ul>
<li><i class="bi bi-chevron-right"></i> <strong>Age:</strong> <span>{{ $about->age }}</span></li>
@if (isset($about->degree))
<li><i class="bi bi-chevron-right"></i> <strong>Degree:</strong>
<span>{{ $about->degree }}</span>
</li>
@endif
@if (isset($about->email))
<li><i class="bi bi-chevron-right"></i> <strong>Email:</strong>
<span>{{ $about->email }}</span>
</li>
@endif
@if (isset($about->freelancer))
<li><i class="bi bi-chevron-right"></i> <strong>Freelance:</strong>
<span>
@switch($about->freelancer)
@case(0)
Not Available
@break
@case(1)
Available
@break
@case(2)
Sometimes
@break
@default
@endswitch
</span>
</li>
@endif
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
| 50.108434 | 146 | 0.319548 |
37ea87ab21463867dfc47a6f7a05e02c4e1ffc7f | 341 | asm | Assembly | programs/oeis/111/A111648.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/111/A111648.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/111/A111648.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A111648: a(n) = A001541(n)^2 + A001653(n)^2 + A002315(n)^2.
; 3,83,2811,95483,3243603,110187011,3743114763,127155714923,4319551192611,146737584833843,4984758333158043,169335045742539611,5752406796913188723,195412496049305876963
seq $0,38762 ; a(n) = 6*a(n-1) - a(n-2) for n >= 2, with a(0)=3, a(1)=13.
pow $0,2
sub $0,9
div $0,2
add $0,3
| 37.888889 | 167 | 0.709677 |
b2c6230f0833dc67533c86730e80fa1268f52969 | 38,237 | rs | Rust | src/diff.rs | zmbush/git2-rs | 8821fbecd9e6c2ede44361b97cf89a3864ab5e98 | [
"Apache-2.0",
"MIT"
] | null | null | null | src/diff.rs | zmbush/git2-rs | 8821fbecd9e6c2ede44361b97cf89a3864ab5e98 | [
"Apache-2.0",
"MIT"
] | null | null | null | src/diff.rs | zmbush/git2-rs | 8821fbecd9e6c2ede44361b97cf89a3864ab5e98 | [
"Apache-2.0",
"MIT"
] | null | null | null | use std::ffi::CString;
use std::iter::Range;
use std::marker;
use std::mem;
use std::path::Path;
use std::slice;
use libc::{c_char, size_t, c_void, c_int};
use {raw, panic, Buf, Delta, Oid, Repository, Tree, Error, Index, DiffFormat};
use {DiffStatsFormat, IntoCString};
use util::{self, Binding};
/// The diff object that contains all individual file deltas.
///
/// This is an opaque structure which will be allocated by one of the diff
/// generator functions below (such as `Diff::tree_to_tree`).
pub struct Diff {
raw: *mut raw::git_diff,
}
/// Description of changes to one entry.
pub struct DiffDelta<'a> {
raw: *mut raw::git_diff_delta,
_marker: marker::PhantomData<&'a raw::git_diff_delta>,
}
/// Description of one side of a delta.
///
/// Although this is called a "file" it could represent a file, a symbolic
/// link, a submodule commit id, or even a tree (although that only happens if
/// you are tracking type changes or ignored/untracked directories).
pub struct DiffFile<'a> {
raw: *const raw::git_diff_file,
_marker: marker::PhantomData<&'a raw::git_diff_file>,
}
/// Structure describing options about how the diff should be executed.
pub struct DiffOptions {
pathspec: Vec<CString>,
pathspec_ptrs: Vec<*const c_char>,
old_prefix: Option<CString>,
new_prefix: Option<CString>,
raw: raw::git_diff_options,
}
/// Control behavior of rename and copy detection
pub struct DiffFindOptions {
raw: raw::git_diff_find_options,
}
/// An iterator over the diffs in a delta
pub struct Deltas<'diff> {
range: Range<usize>,
diff: &'diff Diff,
}
/// Structure describing a line (or data span) of a diff.
pub struct DiffLine<'a> {
raw: *const raw::git_diff_line,
_marker: marker::PhantomData<&'a raw::git_diff_line>,
}
/// Structure describing a hunk of a diff.
pub struct DiffHunk<'a> {
raw: *const raw::git_diff_hunk,
_marker: marker::PhantomData<&'a raw::git_diff_hunk>,
}
/// Structure describing a hunk of a diff.
pub struct DiffStats {
raw: *mut raw::git_diff_stats,
}
impl Diff {
/// Create a diff with the difference between two tree objects.
///
/// This is equivalent to `git diff <old-tree> <new-tree>`
///
/// The first tree will be used for the "old_file" side of the delta and the
/// second tree will be used for the "new_file" side of the delta. You can
/// pass `None` to indicate an empty tree, although it is an error to pass
/// `None` for both the `old_tree` and `new_tree`.
pub fn tree_to_tree(repo: &Repository,
old_tree: Option<&Tree>,
new_tree: Option<&Tree>,
opts: Option<&mut DiffOptions>) -> Result<Diff, Error> {
let mut ret = 0 as *mut raw::git_diff;
unsafe {
try_call!(raw::git_diff_tree_to_tree(&mut ret,
repo.raw(),
old_tree.map(|s| s.raw()),
new_tree.map(|s| s.raw()),
opts.map(|s| s.raw())));
Ok(Binding::from_raw(ret))
}
}
/// Create a diff between a tree and repository index.
///
/// This is equivalent to `git diff --cached <treeish>` or if you pass
/// the HEAD tree, then like `git diff --cached`.
///
/// The tree you pass will be used for the "old_file" side of the delta, and
/// the index will be used for the "new_file" side of the delta.
///
/// If you pass `None` for the index, then the existing index of the `repo`
/// will be used. In this case, the index will be refreshed from disk
/// (if it has changed) before the diff is generated.
///
/// If the tree is `None`, then it is considered an empty tree.
pub fn tree_to_index(repo: &Repository,
old_tree: Option<&Tree>,
index: Option<&Index>,
opts: Option<&mut DiffOptions>) -> Result<Diff, Error> {
let mut ret = 0 as *mut raw::git_diff;
unsafe {
try_call!(raw::git_diff_tree_to_index(&mut ret,
repo.raw(),
old_tree.map(|s| s.raw()),
index.map(|s| s.raw()),
opts.map(|s| s.raw())));
Ok(Binding::from_raw(ret))
}
}
/// Create a diff between the repository index and the workdir directory.
///
/// This matches the `git diff` command. See the note below on
/// `tree_to_workdir` for a discussion of the difference between
/// `git diff` and `git diff HEAD` and how to emulate a `git diff <treeish>`
/// using libgit2.
///
/// The index will be used for the "old_file" side of the delta, and the
/// working directory will be used for the "new_file" side of the delta.
///
/// If you pass `None` for the index, then the existing index of the `repo`
/// will be used. In this case, the index will be refreshed from disk
/// (if it has changed) before the diff is generated.
pub fn index_to_workdir(repo: &Repository,
index: Option<&Index>,
opts: Option<&mut DiffOptions>)
-> Result<Diff, Error> {
let mut ret = 0 as *mut raw::git_diff;
unsafe {
try_call!(raw::git_diff_index_to_workdir(&mut ret,
repo.raw(),
index.map(|s| s.raw()),
opts.map(|s| s.raw())));
Ok(Binding::from_raw(ret))
}
}
/// Create a diff between a tree and the working directory.
///
/// The tree you provide will be used for the "old_file" side of the delta,
/// and the working directory will be used for the "new_file" side.
///
/// This is not the same as `git diff <treeish>` or `git diff-index
/// <treeish>`. Those commands use information from the index, whereas this
/// function strictly returns the differences between the tree and the files
/// in the working directory, regardless of the state of the index. Use
/// `tree_to_workdir_with_index` to emulate those commands.
///
/// To see difference between this and `tree_to_workdir_with_index`,
/// consider the example of a staged file deletion where the file has then
/// been put back into the working dir and further modified. The
/// tree-to-workdir diff for that file is 'modified', but `git diff` would
/// show status 'deleted' since there is a staged delete.
///
/// If `None` is passed for `tree`, then an empty tree is used.
pub fn tree_to_workdir(repo: &Repository,
old_tree: Option<&Tree>,
opts: Option<&mut DiffOptions>)
-> Result<Diff, Error> {
let mut ret = 0 as *mut raw::git_diff;
unsafe {
try_call!(raw::git_diff_tree_to_workdir(&mut ret,
repo.raw(),
old_tree.map(|s| s.raw()),
opts.map(|s| s.raw())));
Ok(Binding::from_raw(ret))
}
}
/// Create a diff between a tree and the working directory using index data
/// to account for staged deletes, tracked files, etc.
///
/// This emulates `git diff <tree>` by diffing the tree to the index and
/// the index to the working directory and blending the results into a
/// single diff that includes staged deleted, etc.
pub fn tree_to_workdir_with_index(repo: &Repository,
old_tree: Option<&Tree>,
opts: Option<&mut DiffOptions>)
-> Result<Diff, Error> {
let mut ret = 0 as *mut raw::git_diff;
unsafe {
try_call!(raw::git_diff_tree_to_workdir_with_index(&mut ret,
repo.raw(), old_tree.map(|s| s.raw()), opts.map(|s| s.raw())));
Ok(Binding::from_raw(ret))
}
}
/// Merge one diff into another.
///
/// This merges items from the "from" list into the "self" list. The
/// resulting diff will have all items that appear in either list.
/// If an item appears in both lists, then it will be "merged" to appear
/// as if the old version was from the "onto" list and the new version
/// is from the "from" list (with the exception that if the item has a
/// pending DELETE in the middle, then it will show as deleted).
pub fn merge(&mut self, from: &Diff) -> Result<(), Error> {
unsafe { try_call!(raw::git_diff_merge(self.raw, &*from.raw)); }
Ok(())
}
/// Returns an iterator over the deltas in this diff.
pub fn deltas(&self) -> Deltas {
let num_deltas = unsafe { raw::git_diff_num_deltas(&*self.raw) };
Deltas { range: range(0, num_deltas as usize), diff: self }
}
/// Return the diff delta for an entry in the diff list.
pub fn get_delta(&self, i: usize) -> Option<DiffDelta> {
unsafe {
let ptr = raw::git_diff_get_delta(&*self.raw, i as size_t);
Binding::from_raw_opt(ptr as *mut _)
}
}
/// Check if deltas are sorted case sensitively or insensitively.
pub fn is_sorted_icase(&self) -> bool {
unsafe { raw::git_diff_is_sorted_icase(&*self.raw) == 1 }
}
/// Iterate over a diff generating formatted text output.
///
/// Returning `false` from the callback will terminate the iteration and
/// return an error from this function.
pub fn print<F>(&self, format: DiffFormat, mut cb: F) -> Result<(), Error>
where F: FnMut(DiffDelta,
Option<DiffHunk>,
DiffLine) -> bool {
unsafe {
try_call!(raw::git_diff_print(self.raw, format, print::<F>,
&mut cb as *mut _ as *mut _));
return Ok(())
}
extern fn print<F>(delta: *const raw::git_diff_delta,
hunk: *const raw::git_diff_hunk,
line: *const raw::git_diff_line,
data: *mut c_void) -> c_int
where F: FnMut(DiffDelta, Option<DiffHunk>,
DiffLine) -> bool
{
unsafe {
let delta = Binding::from_raw(delta as *mut _);
let hunk = Binding::from_raw_opt(hunk);
let line = Binding::from_raw(line);
let data = data as *mut F;
let ok = panic::wrap(move || {
(*data)(delta, hunk, line)
}).unwrap_or(false);
if ok {0} else {-1}
}
}
}
/// Accumulate diff statistics for all patches.
pub fn stats(&self) -> Result<DiffStats, Error> {
let mut ret = 0 as *mut raw::git_diff_stats;
unsafe {
try_call!(raw::git_diff_get_stats(&mut ret, self.raw));
Ok(Binding::from_raw(ret))
}
}
/// Transform a diff marking file renames, copies, etc.
///
/// This modifies a diff in place, replacing old entries that look like
/// renames or copies with new entries reflecting those changes. This also
/// will, if requested, break modified files into add/remove pairs if the
/// amount of change is above a threshold.
pub fn find_similar(&mut self, opts: Option<&mut DiffFindOptions>)
-> Result<(), Error> {
let opts = opts.map(|opts| &opts.raw);
unsafe { try_call!(raw::git_diff_find_similar(self.raw, opts)); }
Ok(())
}
// TODO: num_deltas_of_type, foreach, format_email, find_similar
}
impl Binding for Diff {
type Raw = *mut raw::git_diff;
unsafe fn from_raw(raw: *mut raw::git_diff) -> Diff {
Diff { raw: raw }
}
fn raw(&self) -> *mut raw::git_diff { self.raw }
}
#[unsafe_destructor]
impl Drop for Diff {
fn drop(&mut self) {
unsafe { raw::git_diff_free(self.raw) }
}
}
impl<'a> DiffDelta<'a> {
// TODO: expose when diffs are more exposed
// pub fn similarity(&self) -> u16 {
// unsafe { (*self.raw).similarity }
// }
/// Returns the number of files in this delta.
pub fn nfiles(&self) -> u16 {
unsafe { (*self.raw).nfiles }
}
/// Returns the status of this entry
///
/// For more information, see `Delta`'s documentation
pub fn status(&self) -> Delta {
match unsafe { (*self.raw).status } {
raw::GIT_DELTA_UNMODIFIED => Delta::Unmodified,
raw::GIT_DELTA_ADDED => Delta::Added,
raw::GIT_DELTA_DELETED => Delta::Deleted,
raw::GIT_DELTA_MODIFIED => Delta::Modified,
raw::GIT_DELTA_RENAMED => Delta::Renamed,
raw::GIT_DELTA_COPIED => Delta::Copied,
raw::GIT_DELTA_IGNORED => Delta::Ignored,
raw::GIT_DELTA_UNTRACKED => Delta::Untracked,
raw::GIT_DELTA_TYPECHANGE => Delta::Typechange,
raw::GIT_DELTA_UNREADABLE => Delta::Unreadable,
}
}
/// Return the file which represents the "from" side of the diff.
///
/// What side this means depends on the function that was used to generate
/// the diff and will be documented on the function itself.
pub fn old_file(&self) -> DiffFile<'a> {
unsafe { Binding::from_raw(&(*self.raw).old_file as *const _) }
}
/// Return the file which represents the "to" side of the diff.
///
/// What side this means depends on the function that was used to generate
/// the diff and will be documented on the function itself.
pub fn new_file(&self) -> DiffFile<'a> {
unsafe { Binding::from_raw(&(*self.raw).new_file as *const _) }
}
}
impl<'a> Binding for DiffDelta<'a> {
type Raw = *mut raw::git_diff_delta;
unsafe fn from_raw(raw: *mut raw::git_diff_delta) -> DiffDelta<'a> {
DiffDelta {
raw: raw,
_marker: marker::PhantomData,
}
}
fn raw(&self) -> *mut raw::git_diff_delta { self.raw }
}
impl<'a> DiffFile<'a> {
/// Returns the Oid of this item.
///
/// If this entry represents an absent side of a diff (e.g. the `old_file`
/// of a `Added` delta), then the oid returned will be zeroes.
pub fn id(&self) -> Oid {
unsafe { Binding::from_raw(&(*self.raw).id as *const _) }
}
/// Returns the path, in bytes, of the entry relative to the working
/// directory of the repository.
pub fn path_bytes(&self) -> Option<&'a [u8]> {
static FOO: () = ();
unsafe { ::opt_bytes(&FOO, (*self.raw).path) }
}
/// Returns the path of the entry relative to the working directory of the
/// repository.
pub fn path(&self) -> Option<&'a Path> {
self.path_bytes().map(util::bytes2path)
}
/// Returns the size of this entry, in bytes
pub fn size(&self) -> u64 { unsafe { (*self.raw).size as u64 } }
// TODO: expose flags/mode
}
impl<'a> Binding for DiffFile<'a> {
type Raw = *const raw::git_diff_file;
unsafe fn from_raw(raw: *const raw::git_diff_file) -> DiffFile<'a> {
DiffFile {
raw: raw,
_marker: marker::PhantomData,
}
}
fn raw(&self) -> *const raw::git_diff_file { self.raw }
}
impl DiffOptions {
/// Creates a new set of empty diff options.
///
/// All flags and other options are defaulted to false or their otherwise
/// zero equivalents.
pub fn new() -> DiffOptions {
let mut opts = DiffOptions {
pathspec: Vec::new(),
pathspec_ptrs: Vec::new(),
raw: unsafe { mem::zeroed() },
old_prefix: None,
new_prefix: None,
};
assert_eq!(unsafe {
raw::git_diff_init_options(&mut opts.raw, 1)
}, 0);
opts
}
fn flag(&mut self, opt: u32, val: bool) -> &mut DiffOptions {
if val {
self.raw.flags |= opt;
} else {
self.raw.flags &= !opt;
}
self
}
/// Flag indicating whether the sides of the diff will be reversed.
pub fn reverse(&mut self, reverse: bool) -> &mut DiffOptions {
self.flag(raw::GIT_DIFF_REVERSE, reverse)
}
/// Flag indicating whether ignored files are included.
pub fn include_ignored(&mut self, include: bool) -> &mut DiffOptions {
self.flag(raw::GIT_DIFF_INCLUDE_IGNORED, include)
}
/// Flag indicating whether ignored directories are traversed deeply or not.
pub fn recurse_ignored_dirs(&mut self, recurse: bool) -> &mut DiffOptions {
self.flag(raw::GIT_DIFF_RECURSE_IGNORED_DIRS, recurse)
}
/// Flag indicating whether untracked files are in the diff
pub fn include_untracked(&mut self, include: bool) -> &mut DiffOptions {
self.flag(raw::GIT_DIFF_INCLUDE_UNTRACKED, include)
}
/// Flag indicating whether untracked directories are deeply traversed or
/// not.
pub fn recurse_untracked_dirs(&mut self, recurse: bool) -> &mut DiffOptions {
self.flag(raw::GIT_DIFF_RECURSE_UNTRACKED_DIRS, recurse)
}
/// Flag indicating whether unmodified files are in the diff.
pub fn include_unmodified(&mut self, include: bool) -> &mut DiffOptions {
self.flag(raw::GIT_DIFF_INCLUDE_UNMODIFIED, include)
}
/// If entrabled, then Typechange delta records are generated.
pub fn include_typechange(&mut self, include: bool) -> &mut DiffOptions {
self.flag(raw::GIT_DIFF_INCLUDE_TYPECHANGE, include)
}
/// Event with `include_typechange`, the tree treturned generally shows a
/// deleted blow. This flag correctly labels the tree transitions as a
/// typechange record with the `new_file`'s mode set to tree.
///
/// Note that the tree SHA will not be available.
pub fn include_typechange_trees(&mut self, include: bool) -> &mut DiffOptions {
self.flag(raw::GIT_DIFF_INCLUDE_TYPECHANGE_TREES, include)
}
/// Flag indicating whether file mode changes are ignored.
pub fn ignore_filemode(&mut self, ignore: bool) -> &mut DiffOptions {
self.flag(raw::GIT_DIFF_IGNORE_FILEMODE, ignore)
}
/// Flag indicating whether all submodules should be treated as unmodified.
pub fn ignore_submodules(&mut self, ignore: bool) -> &mut DiffOptions {
self.flag(raw::GIT_DIFF_IGNORE_SUBMODULES, ignore)
}
/// Flag indicating whether case insensitive filenames should be used.
pub fn ignore_case(&mut self, ignore: bool) -> &mut DiffOptions {
self.flag(raw::GIT_DIFF_IGNORE_CASE, ignore)
}
/// If pathspecs are specified, this flag means that they should be applied
/// as an exact match instead of a fnmatch pattern.
pub fn disable_pathspec_match(&mut self, disable: bool) -> &mut DiffOptions {
self.flag(raw::GIT_DIFF_DISABLE_PATHSPEC_MATCH, disable)
}
/// Disable updating the `binary` flag in delta records. This is useful when
/// iterating over a diff if you don't need hunk and data callbacks and want
/// to avoid having to load a file completely.
pub fn skip_binary_check(&mut self, skip: bool) -> &mut DiffOptions {
self.flag(raw::GIT_DIFF_SKIP_BINARY_CHECK, skip)
}
/// When diff finds an untracked directory, to match the behavior of core
/// Git, it scans the contents for ignored and untracked files. If all
/// contents are ignored, then the directory is ignored; if any contents are
/// not ignored, then the directory is untracked. This is extra work that
/// may not matter in many cases.
///
/// This flag turns off that scan and immediately labels an untracked
/// directory as untracked (changing the behavior to not match core git).
pub fn enable_fast_untracked_dirs(&mut self, enable: bool)
-> &mut DiffOptions {
self.flag(raw::GIT_DIFF_ENABLE_FAST_UNTRACKED_DIRS, enable)
}
/// When diff finds a file in the working directory with stat information
/// different from the index, but the OID ends up being the same, write the
/// correct stat information into the index. Note: without this flag, diff
/// will always leave the index untouched.
pub fn update_index(&mut self, update: bool) -> &mut DiffOptions {
self.flag(raw::GIT_DIFF_UPDATE_INDEX, update)
}
/// Include unreadable files in the diff
pub fn include_unreadable(&mut self, include: bool) -> &mut DiffOptions {
self.flag(raw::GIT_DIFF_INCLUDE_UNREADABLE, include)
}
/// Include unreadable files in the diff
pub fn include_unreadable_as_untracked(&mut self, include: bool)
-> &mut DiffOptions {
self.flag(raw::GIT_DIFF_INCLUDE_UNREADABLE_AS_UNTRACKED, include)
}
/// Treat all files as text, disabling binary attributes and detection.
pub fn force_text(&mut self, force: bool) -> &mut DiffOptions {
self.flag(raw::GIT_DIFF_FORCE_TEXT, force)
}
/// Treat all files as binary, disabling text diffs
pub fn force_binary(&mut self, force: bool) -> &mut DiffOptions {
self.flag(raw::GIT_DIFF_FORCE_TEXT, force)
}
/// Ignore all whitespace
pub fn ignore_whitespace(&mut self, ignore: bool) -> &mut DiffOptions {
self.flag(raw::GIT_DIFF_IGNORE_WHITESPACE, ignore)
}
/// Ignore changes in the amount of whitespace
pub fn ignore_whitespace_change(&mut self, ignore: bool) -> &mut DiffOptions {
self.flag(raw::GIT_DIFF_IGNORE_WHITESPACE_CHANGE, ignore)
}
/// Ignore whitespace at tend of line
pub fn ignore_whitespace_eol(&mut self, ignore: bool) -> &mut DiffOptions {
self.flag(raw::GIT_DIFF_IGNORE_WHITESPACE_EOL, ignore)
}
/// When generating patch text, include the content of untracked files.
///
/// This automatically turns on `include_untracked` but it does not turn on
/// `recurse_untracked_dirs`. Add that flag if you want the content of every
/// single untracked file.
pub fn show_untracked_content(&mut self, show: bool) -> &mut DiffOptions {
self.flag(raw::GIT_DIFF_SHOW_UNTRACKED_CONTENT, show)
}
/// When generating output, include the names of unmodified files if they
/// are included in the `Diff`. Normally these are skipped in the formats
/// that list files (e.g. name-only, name-status, raw). Even with this these
/// will not be included in the patch format.
pub fn show_unmodified(&mut self, show: bool) -> &mut DiffOptions {
self.flag(raw::GIT_DIFF_SHOW_UNMODIFIED, show)
}
/// Use the "patience diff" algorithm
pub fn patience(&mut self, patience: bool) -> &mut DiffOptions {
self.flag(raw::GIT_DIFF_PATIENCE, patience)
}
/// Take extra time to find the minimal diff
pub fn minimal(&mut self, minimal: bool) -> &mut DiffOptions {
self.flag(raw::GIT_DIFF_MINIMAL, minimal)
}
/// Include the necessary deflate/delta information so that `git-apply` can
/// apply given diff information to binary files.
pub fn show_binary(&mut self, show: bool) -> &mut DiffOptions {
self.flag(raw::GIT_DIFF_SHOW_BINARY, show)
}
/// Set the number of unchanged lines that define the boundary of a hunk
/// (and to display before and after).
///
/// The default value for this is 3.
pub fn context_lines(&mut self, lines: u32) -> &mut DiffOptions {
self.raw.context_lines = lines;
self
}
/// Set the maximum number of unchanged lines between hunk boundaries before
/// the hunks will be merged into one.
///
/// The default value for this is 0.
pub fn interhunk_lines(&mut self, lines: u32) -> &mut DiffOptions {
self.raw.interhunk_lines = lines;
self
}
/// The default value for this is `core.abbrev` or 7 if unset.
pub fn id_abbrev(&mut self, abbrev: u16) -> &mut DiffOptions {
self.raw.id_abbrev = abbrev;
self
}
/// Maximum size (in bytes) above which a blob will be marked as binary
/// automatically.
///
/// A negative value will disable this entirely.
///
/// The default value for this is 512MB.
pub fn max_size(&mut self, size: i64) -> &mut DiffOptions {
self.raw.max_size = size as raw::git_off_t;
self
}
/// The virtual "directory" to prefix old file names with in hunk headers.
///
/// The default value for this is "a".
pub fn old_prefix<T: IntoCString>(&mut self, t: T) -> &mut DiffOptions {
self.old_prefix = Some(t.into_c_string().unwrap());
self
}
/// The virtual "directory" to prefix new file names with in hunk headers.
///
/// The default value for this is "b".
pub fn new_prefix<T: IntoCString>(&mut self, t: T) -> &mut DiffOptions {
self.new_prefix = Some(t.into_c_string().unwrap());
self
}
/// Add to the array of paths/fnmatch patterns to constrain the diff.
pub fn pathspec<T: IntoCString>(&mut self, pathspec: T)
-> &mut DiffOptions {
let s = pathspec.into_c_string().unwrap();
self.pathspec_ptrs.push(s.as_ptr());
self.pathspec.push(s);
self
}
/// Acquire a pointer to the underlying raw options.
///
/// This function is unsafe as the pointer is only valid so long as this
/// structure is not moved, modified, or used elsewhere.
pub unsafe fn raw(&mut self) -> *const raw::git_diff_options {
self.raw.old_prefix = self.old_prefix.as_ref().map(|s| s.as_ptr())
.unwrap_or(0 as *const _);
self.raw.new_prefix = self.new_prefix.as_ref().map(|s| s.as_ptr())
.unwrap_or(0 as *const _);
self.raw.pathspec.count = self.pathspec_ptrs.len() as size_t;
self.raw.pathspec.strings = self.pathspec_ptrs.as_ptr() as *mut _;
&self.raw as *const _
}
// TODO: expose ignore_submodules, notify_cb/notify_payload
}
impl<'diff> Iterator for Deltas<'diff> {
type Item = DiffDelta<'diff>;
fn next(&mut self) -> Option<DiffDelta<'diff>> {
self.range.next().and_then(|i| self.diff.get_delta(i))
}
fn size_hint(&self) -> (usize, Option<usize>) { self.range.size_hint() }
}
impl<'diff> DoubleEndedIterator for Deltas<'diff> {
fn next_back(&mut self) -> Option<DiffDelta<'diff>> {
self.range.next_back().and_then(|i| self.diff.get_delta(i))
}
}
impl<'diff> ExactSizeIterator for Deltas<'diff> {}
impl<'a> DiffLine<'a> {
/// Line number in old file or `None` for added line
pub fn old_lineno(&self) -> Option<u32> {
match unsafe { (*self.raw).old_lineno } {
n if n < 0 => None,
n => Some(n as u32),
}
}
/// Line number in new file or `None` for deleted line
pub fn new_lineno(&self) -> Option<u32> {
match unsafe { (*self.raw).new_lineno } {
n if n < 0 => None,
n => Some(n as u32),
}
}
/// Number of newline characters in content
pub fn num_lines(&self) -> u32 {
unsafe { (*self.raw).num_lines as u32 }
}
/// Offset in the original file to the content
pub fn content_offset(&self) -> i64 {
unsafe { (*self.raw).content_offset as i64 }
}
/// Content of this line as bytes.
pub fn content(&self) -> &[u8] {
unsafe {
slice::from_raw_parts((*self.raw).content,
(*self.raw).content_len as usize)
}
}
/// Sigil showing the origin of this `DiffLine`.
///
/// * ` ` - Line context
/// * `+` - Line addition
/// * `-` - Line deletion
/// * `=` - Context (End of file)
/// * `>` - Add (End of file)
/// * `<` - Remove (End of file)
/// * `F` - File header
/// * `H` - Hunk header
/// * `B` - Line binary
pub fn origin(&self) -> char {
match unsafe { (*self.raw).origin } {
raw::GIT_DIFF_LINE_CONTEXT => ' ',
raw::GIT_DIFF_LINE_ADDITION => '+',
raw::GIT_DIFF_LINE_DELETION => '-',
raw::GIT_DIFF_LINE_CONTEXT_EOFNL => '=',
raw::GIT_DIFF_LINE_ADD_EOFNL => '>',
raw::GIT_DIFF_LINE_DEL_EOFNL => '<',
raw::GIT_DIFF_LINE_FILE_HDR => 'F',
raw::GIT_DIFF_LINE_HUNK_HDR => 'H',
raw::GIT_DIFF_LINE_LINE_BINARY => 'B',
_ => ' ',
}
}
}
impl<'a> Binding for DiffLine<'a> {
type Raw = *const raw::git_diff_line;
unsafe fn from_raw(raw: *const raw::git_diff_line) -> DiffLine<'a> {
DiffLine {
raw: raw,
_marker: marker::PhantomData,
}
}
fn raw(&self) -> *const raw::git_diff_line { self.raw }
}
impl<'a> DiffHunk<'a> {
/// Starting line number in old_file
pub fn old_start(&self) -> u32 {
unsafe { (*self.raw).old_start as u32 }
}
/// Number of lines in old_file
pub fn old_lines(&self) -> u32 {
unsafe { (*self.raw).old_lines as u32 }
}
/// Starting line number in new_file
pub fn new_start(&self) -> u32 {
unsafe { (*self.raw).new_start as u32 }
}
/// Number of lines in new_file
pub fn new_lines(&self) -> u32 {
unsafe { (*self.raw).new_lines as u32 }
}
/// Header text
pub fn header(&self) -> &[u8] {
unsafe { &(*self.raw).header[..(*self.raw).header_len as usize] }
}
}
impl<'a> Binding for DiffHunk<'a> {
type Raw = *const raw::git_diff_hunk;
unsafe fn from_raw(raw: *const raw::git_diff_hunk) -> DiffHunk<'a> {
DiffHunk {
raw: raw,
_marker: marker::PhantomData,
}
}
fn raw(&self) -> *const raw::git_diff_hunk { self.raw }
}
impl DiffStats {
/// Get the total number of files chaned in a diff.
pub fn files_changed(&self) -> usize {
unsafe { raw::git_diff_stats_files_changed(&*self.raw) as usize }
}
/// Get the total number of insertions in a diff
pub fn insertions(&self) -> usize {
unsafe { raw::git_diff_stats_insertions(&*self.raw) as usize }
}
/// Get the total number of deletions in a diff
pub fn deletions(&self) -> usize {
unsafe { raw::git_diff_stats_deletions(&*self.raw) as usize }
}
/// Print diff statistics to a Buf
pub fn to_buf(&self, format: DiffStatsFormat, width: usize)
-> Result<Buf, Error> {
let buf = Buf::new();
unsafe {
try_call!(raw::git_diff_stats_to_buf(buf.raw(), self.raw,
format.bits(),
width as size_t));
}
Ok(buf)
}
}
impl Binding for DiffStats {
type Raw = *mut raw::git_diff_stats;
unsafe fn from_raw(raw: *mut raw::git_diff_stats) -> DiffStats {
DiffStats { raw: raw }
}
fn raw(&self) -> *mut raw::git_diff_stats { self.raw }
}
#[unsafe_destructor]
impl Drop for DiffStats {
fn drop(&mut self) {
unsafe { raw::git_diff_stats_free(self.raw) }
}
}
impl DiffFindOptions {
/// Creates a new set of empty diff find options.
///
/// All flags and other options are defaulted to false or their otherwise
/// zero equivalents.
pub fn new() -> DiffFindOptions {
let mut opts = DiffFindOptions {
raw: unsafe { mem::zeroed() },
};
assert_eq!(unsafe {
raw::git_diff_find_init_options(&mut opts.raw, 1)
}, 0);
opts
}
fn flag(&mut self, opt: u32, val: bool) -> &mut DiffFindOptions {
if val {
self.raw.flags |= opt;
} else {
self.raw.flags &= !opt;
}
self
}
/// Reset all flags back to their unset state, indicating that
/// `diff.renames` should be used instead. This is overridden once any flag
/// is set.
pub fn by_config(&mut self) -> &mut DiffFindOptions {
self.flag(0xffffffff, false)
}
/// Look for renames?
pub fn renames(&mut self, find: bool) -> &mut DiffFindOptions {
self.flag(raw::GIT_DIFF_FIND_RENAMES, find)
}
/// Consider old side of modified for renames?
pub fn renames_from_rewrites(&mut self, find: bool) -> &mut DiffFindOptions {
self.flag(raw::GIT_DIFF_FIND_RENAMES_FROM_REWRITES, find)
}
/// Look for copies?
pub fn copies(&mut self, find: bool) -> &mut DiffFindOptions {
self.flag(raw::GIT_DIFF_FIND_COPIES, find)
}
/// Consider unmodified as copy sources?
///
/// For this to work correctly, use `include_unmodified` when the initial
/// diff is being generated.
pub fn copies_from_unmodified(&mut self, find: bool)
-> &mut DiffFindOptions {
self.flag(raw::GIT_DIFF_FIND_COPIES_FROM_UNMODIFIED, find)
}
/// Mark significant rewrites for split.
pub fn rewrites(&mut self, find: bool) -> &mut DiffFindOptions {
self.flag(raw::GIT_DIFF_FIND_REWRITES, find)
}
/// Actually split large rewrites into delete/add pairs
pub fn break_rewries(&mut self, find: bool) -> &mut DiffFindOptions {
self.flag(raw::GIT_DIFF_BREAK_REWRITES, find)
}
/// Find renames/copies for untracked items in working directory.
///
/// For this to work correctly use the `include_untracked` option when the
/// initial diff is being generated.
pub fn for_untracked(&mut self, find: bool) -> &mut DiffFindOptions {
self.flag(raw::GIT_DIFF_FIND_FOR_UNTRACKED, find)
}
/// Turn on all finding features.
pub fn all(&mut self, find: bool) -> &mut DiffFindOptions {
self.flag(raw::GIT_DIFF_FIND_ALL, find)
}
/// Measure similarity ignoring leading whitespace (default)
pub fn ignore_leading_whitespace(&mut self, ignore: bool)
-> &mut DiffFindOptions {
self.flag(raw::GIT_DIFF_FIND_IGNORE_LEADING_WHITESPACE, ignore)
}
/// Measure similarity ignoring all whitespace
pub fn ignore_whitespace(&mut self, ignore: bool) -> &mut DiffFindOptions {
self.flag(raw::GIT_DIFF_FIND_IGNORE_WHITESPACE, ignore)
}
/// Measure similarity including all data
pub fn dont_ignore_whitespace(&mut self, dont: bool) -> &mut DiffFindOptions {
self.flag(raw::GIT_DIFF_FIND_DONT_IGNORE_WHITESPACE, dont)
}
/// Measure similarity only by comparing SHAs (fast and cheap)
pub fn exact_match_only(&mut self, exact: bool) -> &mut DiffFindOptions {
self.flag(raw::GIT_DIFF_FIND_EXACT_MATCH_ONLY, exact)
}
/// Do not break rewrites unless they contribute to a rename.
///
/// Normally, `break_rewrites` and `rewrites` will measure the
/// self-similarity of modified files and split the ones that have changed a
/// lot into a delete/add pair. Then the sides of that pair will be
/// considered candidates for rename and copy detection
///
/// If you add this flag in and the split pair is not used for an actual
/// rename or copy, then the modified record will be restored to a regular
/// modified record instead of being split.
pub fn break_rewrites_for_renames_only(&mut self, b: bool)
-> &mut DiffFindOptions {
self.flag(raw::GIT_DIFF_BREAK_REWRITES_FOR_RENAMES_ONLY, b)
}
/// Remove any unmodified deltas after find_similar is done.
///
/// Using `copies_from_unmodified` to emulate the `--find-copies-harder`
/// behavior requires building a diff with the `include_unmodified` flag. If
/// you do not want unmodified records in the final result, pas this flag to
/// have them removed.
pub fn remove_unmodified(&mut self, remove: bool) -> &mut DiffFindOptions {
self.flag(raw::GIT_DIFF_FIND_REMOVE_UNMODIFIED, remove)
}
/// Similarity to consider a file renamed (default 50)
pub fn rename_threshold(&mut self, thresh: u16) -> &mut DiffFindOptions {
self.raw.rename_threshold = thresh;
self
}
/// Similarity of modified to be glegible rename source (default 50)
pub fn rename_from_rewrite_threshold(&mut self, thresh: u16)
-> &mut DiffFindOptions {
self.raw.rename_from_rewrite_threshold = thresh;
self
}
/// Similarity to consider a file copy (default 50)
pub fn copy_threshold(&mut self, thresh: u16) -> &mut DiffFindOptions {
self.raw.copy_threshold = thresh;
self
}
/// Similarity to split modify into delete/add pair (default 60)
pub fn break_rewrite_threshold(&mut self, thresh: u16)
-> &mut DiffFindOptions {
self.raw.break_rewrite_threshold = thresh;
self
}
/// Maximum similarity sources to examine for a file (somewhat like
/// git-diff's `-l` option or `diff.renameLimit` config)
///
/// Defaults to 200
pub fn rename_limit(&mut self, limit: usize) -> &mut DiffFindOptions {
self.raw.rename_limit = limit as size_t;
self
}
// TODO: expose git_diff_similarity_metric
}
#[cfg(test)]
mod tests {
use super::Diff;
#[test]
fn smoke() {
let (_td, repo) = ::test::repo_init();
let diff = Diff::tree_to_workdir(&repo, None, None).unwrap();
assert_eq!(diff.deltas().len(), 0);
let stats = diff.stats().unwrap();
assert_eq!(stats.insertions(), 0);
assert_eq!(stats.deletions(), 0);
assert_eq!(stats.files_changed(), 0);
}
}
| 37.524043 | 83 | 0.596987 |
ef5f537db97ec7f9e968c0d5585a57ea5072fcab | 5,045 | kt | Kotlin | godot-kotlin/godot-library/src/nativeGen/kotlin/godot/PathFollow.kt | utopia-rise/godot-kotlin | 8d51f614df62a97f16e800e6635ea39e7eb1fd62 | [
"MIT"
] | 198 | 2020-02-06T17:34:38.000Z | 2021-03-02T01:11:26.000Z | godot-kotlin/godot-library/src/nativeGen/kotlin/godot/PathFollow.kt | utopia-rise/godot-kotlin-native | 8d51f614df62a97f16e800e6635ea39e7eb1fd62 | [
"MIT"
] | 147 | 2020-02-06T17:25:42.000Z | 2020-11-21T21:40:03.000Z | godot-kotlin/godot-library/src/nativeGen/kotlin/godot/PathFollow.kt | utopia-rise/godot-kotlin | 8d51f614df62a97f16e800e6635ea39e7eb1fd62 | [
"MIT"
] | 14 | 2020-02-06T21:51:33.000Z | 2021-02-13T22:23:53.000Z | // THIS FILE IS GENERATED! DO NOT EDIT IT MANUALLY! ALL CHANGES TO IT WILL BE OVERWRITTEN ON EACH BUILD
package godot
import godot.PathFollow
import godot.icalls._icall_Boolean
import godot.icalls._icall_Double
import godot.icalls._icall_Long
import godot.icalls._icall_Unit_Boolean
import godot.icalls._icall_Unit_Double
import godot.icalls._icall_Unit_Long
import godot.internal.utils.getMethodBind
import godot.internal.utils.invokeConstructor
import kotlin.Boolean
import kotlin.Double
import kotlin.Long
import kotlinx.cinterop.COpaquePointer
open class PathFollow : Spatial() {
open var cubicInterp: Boolean
get() {
val mb = getMethodBind("PathFollow","get_cubic_interpolation")
return _icall_Boolean(mb, this.ptr)
}
set(value) {
val mb = getMethodBind("PathFollow","set_cubic_interpolation")
_icall_Unit_Boolean(mb, this.ptr, value)
}
open var hOffset: Double
get() {
val mb = getMethodBind("PathFollow","get_h_offset")
return _icall_Double(mb, this.ptr)
}
set(value) {
val mb = getMethodBind("PathFollow","set_h_offset")
_icall_Unit_Double(mb, this.ptr, value)
}
open var loop: Boolean
get() {
val mb = getMethodBind("PathFollow","has_loop")
return _icall_Boolean(mb, this.ptr)
}
set(value) {
val mb = getMethodBind("PathFollow","set_loop")
_icall_Unit_Boolean(mb, this.ptr, value)
}
open var offset: Double
get() {
val mb = getMethodBind("PathFollow","get_offset")
return _icall_Double(mb, this.ptr)
}
set(value) {
val mb = getMethodBind("PathFollow","set_offset")
_icall_Unit_Double(mb, this.ptr, value)
}
open var rotationMode: Long
get() {
val mb = getMethodBind("PathFollow","get_rotation_mode")
return _icall_Long(mb, this.ptr)
}
set(value) {
val mb = getMethodBind("PathFollow","set_rotation_mode")
_icall_Unit_Long(mb, this.ptr, value)
}
open var unitOffset: Double
get() {
val mb = getMethodBind("PathFollow","get_unit_offset")
return _icall_Double(mb, this.ptr)
}
set(value) {
val mb = getMethodBind("PathFollow","set_unit_offset")
_icall_Unit_Double(mb, this.ptr, value)
}
open var vOffset: Double
get() {
val mb = getMethodBind("PathFollow","get_v_offset")
return _icall_Double(mb, this.ptr)
}
set(value) {
val mb = getMethodBind("PathFollow","set_v_offset")
_icall_Unit_Double(mb, this.ptr, value)
}
override fun __new(): COpaquePointer = invokeConstructor("PathFollow", "PathFollow")
open fun getCubicInterpolation(): Boolean {
val mb = getMethodBind("PathFollow","get_cubic_interpolation")
return _icall_Boolean( mb, this.ptr)
}
open fun getHOffset(): Double {
val mb = getMethodBind("PathFollow","get_h_offset")
return _icall_Double( mb, this.ptr)
}
open fun getOffset(): Double {
val mb = getMethodBind("PathFollow","get_offset")
return _icall_Double( mb, this.ptr)
}
open fun getRotationMode(): PathFollow.RotationMode {
val mb = getMethodBind("PathFollow","get_rotation_mode")
return PathFollow.RotationMode.from( _icall_Long( mb, this.ptr))
}
open fun getUnitOffset(): Double {
val mb = getMethodBind("PathFollow","get_unit_offset")
return _icall_Double( mb, this.ptr)
}
open fun getVOffset(): Double {
val mb = getMethodBind("PathFollow","get_v_offset")
return _icall_Double( mb, this.ptr)
}
open fun hasLoop(): Boolean {
val mb = getMethodBind("PathFollow","has_loop")
return _icall_Boolean( mb, this.ptr)
}
open fun setCubicInterpolation(enable: Boolean) {
val mb = getMethodBind("PathFollow","set_cubic_interpolation")
_icall_Unit_Boolean( mb, this.ptr, enable)
}
open fun setHOffset(hOffset: Double) {
val mb = getMethodBind("PathFollow","set_h_offset")
_icall_Unit_Double( mb, this.ptr, hOffset)
}
open fun setLoop(loop: Boolean) {
val mb = getMethodBind("PathFollow","set_loop")
_icall_Unit_Boolean( mb, this.ptr, loop)
}
open fun setOffset(offset: Double) {
val mb = getMethodBind("PathFollow","set_offset")
_icall_Unit_Double( mb, this.ptr, offset)
}
open fun setRotationMode(rotationMode: Long) {
val mb = getMethodBind("PathFollow","set_rotation_mode")
_icall_Unit_Long( mb, this.ptr, rotationMode)
}
open fun setUnitOffset(unitOffset: Double) {
val mb = getMethodBind("PathFollow","set_unit_offset")
_icall_Unit_Double( mb, this.ptr, unitOffset)
}
open fun setVOffset(vOffset: Double) {
val mb = getMethodBind("PathFollow","set_v_offset")
_icall_Unit_Double( mb, this.ptr, vOffset)
}
enum class RotationMode(
id: Long
) {
ROTATION_NONE(0),
ROTATION_Y(1),
ROTATION_XY(2),
ROTATION_XYZ(3),
ROTATION_ORIENTED(4);
val id: Long
init {
this.id = id
}
companion object {
fun from(value: Long) = values().single { it.id == value }
}
}
companion object
}
| 27.123656 | 103 | 0.683845 |
084d2bd14a225775dafce227068f2e5cea281839 | 341 | sql | SQL | SQLBits 2022/Code/TestPermissions/TestPermissions/10 Test Select.sql | rloski-public/Presentations | 4ec0e01910c813093fa4f3f722f70ceb12b69c69 | [
"MIT"
] | null | null | null | SQLBits 2022/Code/TestPermissions/TestPermissions/10 Test Select.sql | rloski-public/Presentations | 4ec0e01910c813093fa4f3f722f70ceb12b69c69 | [
"MIT"
] | null | null | null | SQLBits 2022/Code/TestPermissions/TestPermissions/10 Test Select.sql | rloski-public/Presentations | 4ec0e01910c813093fa4f3f722f70ceb12b69c69 | [
"MIT"
] | null | null | null | use Test_Logins;
SELECT SUSER_NAME() LoginName
, USER_NAME() UserName
, IS_SRVROLEMEMBER('sysadmin') IsSysAdmin
, IS_ROLEMEMBER('db_owner') IsDBOwner
declare @sql nvarchar(max) = N'SELECT * FROM PublicTable;';
exec sys.sp_executesql @sql;
GO
declare @sql nvarchar(max) = N'SELECT * FROM PrivateTable;';
exec sys.sp_executesql @sql; | 20.058824 | 60 | 0.747801 |
78d2b2b63083160043491ae6b0a3c7cc28ad84f6 | 12,890 | lua | Lua | Assets/sgk/Lua/view/DefensiveFortress/DefensiveFortressFrame.lua | freeGamePerson/dev_update | 80f75ff1ba6fd0d008e6a4989c2ba09e48129c38 | [
"BSD-3-Clause"
] | 1 | 2019-12-30T06:54:48.000Z | 2019-12-30T06:54:48.000Z | Assets/sgk/Lua/view/DefensiveFortress/DefensiveFortressFrame.lua | freeGamePerson/dev_update | 80f75ff1ba6fd0d008e6a4989c2ba09e48129c38 | [
"BSD-3-Clause"
] | null | null | null | Assets/sgk/Lua/view/DefensiveFortress/DefensiveFortressFrame.lua | freeGamePerson/dev_update | 80f75ff1ba6fd0d008e6a4989c2ba09e48129c38 | [
"BSD-3-Clause"
] | 3 | 2019-12-30T06:54:52.000Z | 2020-12-31T10:04:10.000Z | local defensiveModule = require "module.DefensiveFortressModule"
local playerModule = require "module.playerModule";
local TeamModule = require "module.TeamModule"
local Time = require "module.Time";
local TipCfg = require "config.TipConfig"
local View = {};
function View:Start(data)
self.root=CS.SGK.UIReference.Setup(self.gameObject)
self.view=self.root.view
self.teamInfo = TeamModule.GetTeamInfo();
self.OwnRescourceUI={}
self.PlayerCfg={}
for i,v in ipairs(self.teamInfo.members) do
if playerModule.IsDataExist(v.pid) then
self.PlayerCfg[v.pid]=playerModule.IsDataExist(v.pid)
else
playerModule.Get(pid,function ( ... )
self.PlayerCfg[v.pid]=playerModule.Get(v.pid);
end)
end
end
-- self.OwnResource=data and data.TeamResourceData --- ๆฅๆ่ตๆบๆฐ้
-- self.PlayerData=data.PlayerData
-- self.BossData=data.BossData
-- self.Boss=UnityEngine.GameObject.Find("Boss_"..self.BossData.Id)
-- self.BossDelayTime = {
-- [1] = defensiveModule.GetActionTimeCfg(self.BossData.Id).incident1_time/1000,--ๅๅ
-- [2] = defensiveModule.GetActionTimeCfg(self.BossData.Id).incident2_time/1000,--ๅๅ
-- [3] = defensiveModule.GetActionTimeCfg(self.BossData.Id).incident3_time/1000,--ๅๅค
-- [4] = defensiveModule.GetActionTimeCfg(self.BossData.Id).Move_time/1000,--็งปๅจๆถ้ด
-- }
-- self:InItUI()
self:Init(data)
end
function View:Init(data)
self.OwnResource=data and data.TeamResourceData --- ๆฅๆ่ตๆบๆฐ้
self.PlayerData=data.PlayerData
self.BossData=data.BossData
self.Boss=UnityEngine.GameObject.Find("Boss_"..self.BossData.Id)
self.BossDelayTime = {
[1] = defensiveModule.GetActionTimeCfg(self.BossData.Id).incident1_time/1000,--ๅๅ
[2] = defensiveModule.GetActionTimeCfg(self.BossData.Id).incident2_time/1000,--ๅๅ
[3] = defensiveModule.GetActionTimeCfg(self.BossData.Id).incident3_time/1000,--ๅๅค
[4] = defensiveModule.GetActionTimeCfg(self.BossData.Id).Move_time/1000,--็งปๅจๆถ้ด
}
self:InItUI()
end
function View:InItUI()
local bossCfg=defensiveModule.GetBossCfg(self.BossData.Id)
self.view.MainFrame.top.BossDetail.Icon[UI.Image]:LoadSprite("icon/"..bossCfg.Monster_icon)
local propertyCfg=defensiveModule.GetResourceCfgById(bossCfg.Monster_type)
self.view.MainFrame.top.BossDetail.propertyIcon[UI.Image]:LoadSprite("propertyIcon/"..propertyCfg.Resource_icon)
local _hp=self.BossData.BossHp<=bossCfg.Monster_hp and self.BossData.BossHp or bossCfg.Monster_hp
self.BossData.NowHp=_hp
self.view.MainFrame.top.BossDetail.HP.Image[UI.Image].fillAmount = _hp/bossCfg.Monster_hp
self.view.MainFrame.top.BossDetail.HP.Text[UI.Text].text=string.format("%s%%",math.floor(_hp/bossCfg.Monster_hp*100))
--self:updateBossStatusText(self.BossData.Status)
self.view.MainFrame.roleNode[SGK.LuaBehaviour]:Call("InitData",{BossData=self.BossData,PlayerData=self.PlayerData,teamInfo=self.teamInfo})--,UINode)
CS.UGUIClickEventListener.Get(self.view.MainFrame.bottom.tipData.tipBtn.gameObject).onClick = function (obj)
utils.SGKTools.ShowDlgHelp(TipCfg.GetAssistDescConfig(70001).info,TipCfg.GetAssistDescConfig(70001).tittle, self.root)
end
-- self.view.MainFrame.bottom.exitBtn:SetActive(self.teamInfo.leader.pid == module.playerModule.GetSelfID())
CS.UGUIClickEventListener.Get(self.view.MainFrame.bottom.exitBtn.gameObject).onClick = function (obj)
showDlg(nil,"ๆฏๅฆ็กฎ่ฎค้ๅบ้ไผๅนถ็ฆปๅผ๏ผ\n",function()
--defensiveModule.BackToEntranceNpc()
module.TeamModule.KickTeamMember()
end,function() end)
end
--ๅฐๅพTeamResources
self.resourcesCfg=defensiveModule.GetResourceCfg()
self:updateResourcesItem()
self.view.MainFrame.bottom.tipData.Image:SetActive(true)
self.BossStartCD=true
self.BossStartMoveCD=60*2
end
--ๅทๆฐไธป้ขๆฟ่ตๆบ
function View:updateResourcesItem()-- type ==1 Resources ==2 exchange
local prefab=self.view.MainFrame.bottom.resources.Viewport.Content.Item
for k,v in pairs(self.OwnRescourceUI) do
v.gameObject:SetActive(false)
end
for i,v in ipairs(self.resourcesCfg) do
local _obj=nil
local cfg =self.resourcesCfg[i]
if self.OwnRescourceUI[cfg.Resource_id] then
_obj=self.OwnRescourceUI[cfg.Resource_id]--self.resourcesCfg[i]
else
_obj=UnityEngine.Object.Instantiate(prefab.gameObject)
_obj.transform:SetParent(self.view.MainFrame.bottom.resources.Viewport.Content.gameObject.transform,false)
self.OwnRescourceUI[cfg.Resource_id]=_obj
end
_obj.gameObject:SetActive(true)
local Item=CS.SGK.UIReference.Setup(_obj);
Item.Icon[UI.Image]:LoadSprite("propertyIcon/"..cfg.Resource_icon)
Item.num[UI.Text].text=string.format("%d",self.OwnResource[cfg.Resource_id]>=0 and self.OwnResource[cfg.Resource_id] or 0)
end
end
local delayTime={
[23]=defensiveModule.GetActionTimeCfg(2).Gather_time/1000,--ๆ้ๆถ้ด
}
function View:InResourcesChange(data)
--data[3] 1:ๆถ้่ตๆบ2:ๅ ๅผบ้ท้ฑ3:ๅ
ๆข่ตๆบ4:่ฏฑๆๆถ่่ตๆบ5:ไธboss็ธ้ๆ่ตๆบ6:ๆๆ็ปๆไนๅ่ทๅพ่ตๆบ
self.OwnResource=data[1]
local _Delaytime=data[3] and (data[3]==1 and delayTime[23]+1 or 0) or 0
self.view.transform:DOScale(Vector3.one,_Delaytime):OnComplete(function()
for k,v in pairs(data[2]) do
if self.OwnResource[k]~=v then
CS.SGK.UIReference.Setup(self.OwnRescourceUI[k]).num[UI.Text].text=tostring(self.OwnResource[k]>=0 and self.OwnResource[k] or 0)
self:ShowChangeNum(self.OwnResource[k]-v,CS.SGK.UIReference.Setup(self.OwnRescourceUI[k]))
end
end
end)
end
function View:ShowChangeNum(value,pos)
-- print("่ตๆบๆฐ้ๅๅ",pos.x,pos.y,pos.z)
local prefab = SGK.ResourcesManager.Load("prefabs/DefensiveFortress/hurt_normal_.prefab");
local o = prefab and UnityEngine.GameObject.Instantiate(prefab,pos.gameObject.transform);
o.transform.localPosition=Vector3.zero
local nm = o:GetComponent(typeof(CS.NumberMovement));
if not nm.text then
nm.text = o:GetComponent(typeof(UnityEngine.UI.Text));
end
nm.text.text = string.format("%s%d%s",value>=0 and "<color=#3BFFBCFF>" or "<color=#FF1A1AFF>",value,"</color>");
o.transform:DOLocalMove(Vector3(0,100,0),0.5):OnComplete(function( ... )
if self.gameObject then
CS.UnityEngine.GameObject.Destroy(o)
end
end)
end
--1๏ผ็ ดๅๆฎ็น๏ผ2๏ผๅๅ๏ผ3๏ผ็ๅฝๅๅค4.็งปๅจ
function View:updateBossStatus(data)
--ERROR_LOG("ๆดๆฐ boss็ถๆ",sprinttb(data))
self.BossData.ChangeStatusTime=data[4]
self.BossData.Status=data[3]
local bossCfg=defensiveModule.GetBossCfg(self.BossData.Id)
local _hp=data[5]<=bossCfg.Monster_hp and data[5] or bossCfg.Monster_hp
self.BossData.NowHp=_hp
self.view.MainFrame.top.BossDetail.HP.Image[UI.Image].fillAmount = _hp/bossCfg.Monster_hp
self.view.MainFrame.top.BossDetail.HP.Text[UI.Text].text=string.format("%s%%",math.floor(_hp/bossCfg.Monster_hp*100))
end
function View:updateBossStatusText()
if self.BossStartCD and self.BossData and self.BossDelayTime then--ๆธธๆๅผๅง
--local time=Time.now()-self.BossData.GameStartTime
if self.BossData.Status==0 then
local _time = self.BossStartMoveCD+self.BossData.ChangeStatusTime-Time.now()
if _time>0 then
self.view.MainFrame.top.BossDetail.status.Text[UI.Text].text = string.format("ๅๅไธญ:%02d:%02d",math.floor(math.floor(_time/60)%60),math.floor(_time%60))
end
end
if self.BossData.Status==1 then
local _breakTime = self.BossDelayTime[1]
local _time = _breakTime+self.BossData.ChangeStatusTime-Time.now()
local _Time = _breakTime-_time
if _time>0 then
self.view.MainFrame.top.BossDetail.status.Text[UI.Text].text = string.format("ๅๅไธญ:%02d:%02d",math.floor(math.floor(_time/60)%60),math.floor(_time%60))
end
end
if self.BossData.Status==2 then
local _sleepTime = self.BossDelayTime[2]
local _time = _sleepTime+self.BossData.ChangeStatusTime-Time.now()
if _time>0 then
self.view.MainFrame.top.BossDetail.status.Text[UI.Text].text = string.format("ๆตๅไธญ:%02d:%02d",math.floor(math.floor(_time/60)%60),math.floor(_time%60))
end
end
if self.BossData.Status==3 then
local _sleepTime = self.BossDelayTime[3]
local _time = _sleepTime+self.BossData.ChangeStatusTime-Time.now()
if _time>0 then
self.view.MainFrame.top.BossDetail.status.Text[UI.Text].text = string.format("ๆขๅค็ๅฝไธญ:%02d:%02d",math.floor(math.floor(_time/60)%60),math.floor(_time%60))
end
end
if self.BossData.Status==4 then
local MoveInterval = self.BossDelayTime[4]
local _time = MoveInterval+self.BossData.ChangeStatusTime-Time.now()
if _time>=0 then
self.view.MainFrame.top.BossDetail.status.Text[UI.Text].text = string.format("็งปๅจไธญ:%02d:%02d",math.floor(math.floor(_time/60)%60),math.floor(_time%60))
end
end
end
end
--ๆถ้่ตๆบ
function View:TryCollectResources(data)
--print("--ๆถ้่ตๆบ"..sprinttb(data))
if data[3]==0 then--0ไธบๆ้่ตๆบ
--showDlgError(nil,"่ตๆบๆ้ไธญ")
--ๆถ้ๅฎๆๅๆญๆพๆถ้็นๆ
SGK.Action.DelayTime.Create(delayTime[23]):OnComplete(function()
self:ShowGetResourcesEffect(data[4])
end)
else--่ฟๅ
ฅๆๆ
-- local PosInfo=defensiveModule.getMapCfgById(self.PlayerData[self.Pid].PosId)
-- local fightId=PosInfo.Combat_id
-- --local fight_data=data[3]
-- fightModule.StartFight(fightId,nil,function (win,heros,starInfo)
-- defensiveModule.QueryAfterFight()
-- end)
end
end
function View:ShowGetResourcesEffect(_resourcesInfo)
local prefab_fly = SGK.ResourcesManager.Load("prefabs/effect/UI/fx_ui_dati_lizi.prefab");
local prefab_explode = SGK.ResourcesManager.Load("prefabs/effect/UI/fx_ui_dati_bao.prefab");
for i=1,#_resourcesInfo do
local posId=_resourcesInfo[i][1]
local resourceId=_resourcesInfo[i][2]
--local resourcePos=self.resourcesPoint[self.mapInfo[posId].Idx].gameObject.transform.position
--ไธ็ๅๆ ่ฝฌๆฌๅฐ
local pos=Vector3.zero--self.view.MainFrame.bottom.gameObject.transform:InverseTransformVector(resourcePos)
local o = prefab_fly and UnityEngine.GameObject.Instantiate(prefab_fly,self.view.MainFrame.bottom.gameObject.transform);
o.layer = UnityEngine.LayerMask.NameToLayer("Default");
for i = 0,o.transform.childCount-1 do
o.transform:GetChild(i).gameObject.layer = UnityEngine.LayerMask.NameToLayer("Default");
end
o.transform.localPosition = Vector3(pos.x,pos.y,pos.z)
local resourceNode=CS.SGK.UIReference.Setup(self.OwnRescourceUI[resourceId]).Icon.gameObject.transform
local curr_Pos = resourceNode:TransformPoint(o.transform.localPosition)
local targetPos = o.transform:InverseTransformPoint(curr_Pos);
o.transform:DOLocalMove(Vector3(targetPos.x,targetPos.y,targetPos.z),0.5):OnComplete(function( ... )
if resourceNode then
local fx_o = prefab_explode and UnityEngine.GameObject.Instantiate(prefab_explode, resourceNode);
fx_o.layer = UnityEngine.LayerMask.NameToLayer("Default");
for i = 0,fx_o.transform.childCount-1 do
fx_o.transform:GetChild(i).gameObject.layer = UnityEngine.LayerMask.NameToLayer("Default");
end
fx_o.transform.localPosition =Vector3(0,0,-5)
fx_o.transform.localScale = Vector3.one*100
fx_o.transform.localRotation = Quaternion.identity;
local _obj = fx_o :GetComponentInChildren(typeof(UnityEngine.ParticleSystem))
UnityEngine.Object.Destroy(fx_o , _obj.main.duration)
end
CS.UnityEngine.GameObject.Destroy(o)
end)
end
end
function View:InGameOver(data)
DialogStack.PushPrefStact("DefensiveFortress/ClearGameFrame",{status=data[1],Rewards=data[2]});
if self.gameObject then
CS.UnityEngine.GameObject.Destroy(self.gameObject)
end
end
local lastGetTime=0
local GetInterval=5
local tipTab={"yuansubaozou_tips_01","yuansubaozou_tips_02","yuansubaozou_tips_03","yuansubaozou_tips_04"}
function View:updateTipShow()
if not lastGetTime then
lastGetTime=Time.now()
else
if Time.now()-lastGetTime>=GetInterval then
lastGetTime=Time.now()
local _tip=defensiveModule.GetRandom(tipTab,self.teamInfo.id,3)
self.view.MainFrame.bottom.tipData.Text[UI.Text].text=SGK.Localize:getInstance():getValue(_tip)
end
end
end
function View:Update()
--ๆฏ5็งๆดๆฐไธๆฌกtip
if self.view.MainFrame.bottom.tipData.Image.activeSelf then
self:updateTipShow()
end
--ๆดๆฐboss็ถๆ
self:updateBossStatusText()
end
function View:listEvent()
return {
"FORTRESS_GAME_OVER",
"RESOURCES_NUM_CHANGE",
"LOCAL_GUIDE_CHANE",
"BOSS_DATA_CHANGE",
"START_COLLECT_RESOURCES",
"LOCAL_MAPINFO_CHANGE",
}
end
function View:onEvent(event,data)
if event =="RESOURCES_NUM_CHANGE" then
self:InResourcesChange(data)
elseif event=="BOSS_DATA_CHANGE" then
self:updateBossStatus(data)
elseif event =="START_COLLECT_RESOURCES" then
self:TryCollectResources(data)
elseif event =="FORTRESS_GAME_OVER" then
self:InGameOver(data)
elseif event=="LOCAL_GUIDE_CHANE" then
if data==9001 then
defensiveModule.QueryMapInfo(self._tab)
self.view.MainFrame.gameObject:SetActive(true)
module.guideModule.PlayWaitTime(9002)
elseif data==9002 then
utils.SGKTools.ShowDlgHelp(TipCfg.GetAssistDescConfig(70001).info,TipCfg.GetAssistDescConfig(70001).tittle, self.root)
end
elseif event=="LOCAL_MAPINFO_CHANGE" then
self:Init(data)
end
end
return View; | 38.825301 | 156 | 0.762452 |
1aca0d3d079d21d961579e2023e1c5dd497cb02d | 664 | swift | Swift | NinjaCapture/Queue.swift | Igralino/NinjaCapture | aa9c8398293eb5bdca489ea952b86e87a63d6599 | [
"MIT"
] | 3 | 2018-01-25T18:28:32.000Z | 2021-08-31T12:50:43.000Z | NinjaCapture/Queue.swift | Igralino/NinjaCapture | aa9c8398293eb5bdca489ea952b86e87a63d6599 | [
"MIT"
] | null | null | null | NinjaCapture/Queue.swift | Igralino/NinjaCapture | aa9c8398293eb5bdca489ea952b86e87a63d6599 | [
"MIT"
] | null | null | null | //
// Queue.swift by swift-algorithm-club
// NinjaCapture
//
// Created by Igor Yunash on 25.01.18.
// Copyright ยฉ 2018 Igralino. All rights reserved.
//
public struct Queue<T> {
var array = [T]()
public var isEmpty: Bool {
return array.isEmpty
}
public var count: Int {
return array.count
}
public mutating func enqueue(_ element: T) {
array.append(element)
}
public mutating func dequeue() -> T? {
if isEmpty {
return nil
} else {
return array.removeFirst()
}
}
public var front: T? {
return array.first
}
}
| 18.444444 | 51 | 0.539157 |
f2c73a72c1022be94f2997584af62aec877c5a52 | 1,874 | sql | SQL | DMS5/V_Data_Extraction_Task.sql | viswaratha12/dbwarden | 3931accda4fb401d21b6cb272fe3d6959915ceb8 | [
"Apache-2.0"
] | 2 | 2018-04-03T05:18:15.000Z | 2020-04-23T04:00:25.000Z | DMS5/V_Data_Extraction_Task.sql | viswaratha12/dbwarden | 3931accda4fb401d21b6cb272fe3d6959915ceb8 | [
"Apache-2.0"
] | null | null | null | DMS5/V_Data_Extraction_Task.sql | viswaratha12/dbwarden | 3931accda4fb401d21b6cb272fe3d6959915ceb8 | [
"Apache-2.0"
] | 4 | 2016-05-14T17:56:55.000Z | 2020-01-23T12:02:25.000Z | /****** Object: View [dbo].[V_Data_Extraction_Task] ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create VIEW V_Data_Extraction_Task
AS
SELECT CONVERT(varchar(32), A.AJ_jobID) AS TaskNum, T.AJT_toolName AS ToolName, D.Dataset_Num AS DatasetNum,
D.DS_folder_name AS DatasetFolderName, S.SP_vol_name_client + S.SP_path AS DatasetStoragePath,
A.AJ_parmFileName AS ParmFileName, A.AJ_settingsFileName AS SettingsFileName,
T.AJT_parmFileStoragePath AS ParmFileStoragePath, A.AJ_organismDBName AS OrganismDBName,
O.OG_organismDBPath AS OrganismDBStoragePath, A.AJ_StateID AS StateID, A.AJ_jobID AS jobID,
A.AJ_priority AS priority, A.AJ_comment AS Comment, D.DS_Comp_State AS CompState,
I.IN_class AS InstClass, S.SP_vol_name_client AS StorageServerPath, A.AJ_datasetID AS DatasetID,
A.AJ_assignedProcessorName AS AssignedProcessor, A.AJ_resultsFolderName AS ResultsFolderName,
T.AJT_resultType as toolResultType, DAS.DASN_StateName AS ArchiveState
FROM T_Analysis_Job A
INNER JOIN T_Dataset D ON A.AJ_datasetID = D.Dataset_ID
INNER JOIN T_Organisms O ON A.AJ_organismID = O.Organism_ID
INNER JOIN t_storage_path S ON D.DS_storage_path_ID = S.SP_path_ID
INNER JOIN T_Analysis_Tool T ON A.AJ_analysisToolID = T.AJT_toolID
INNER JOIN T_Instrument_Name I ON D.DS_instrument_name_ID = I.Instrument_ID
INNER JOIN T_Dataset_Archive DA ON A.AJ_DatasetID = DA.AS_Dataset_ID
INNER JOIN T_DatasetArchiveStateName DAS ON DA.AS_state_ID = DAS.DASN_StateID
GO
GRANT VIEW DEFINITION ON [dbo].[V_Data_Extraction_Task] TO [DDL_Viewer] AS [dbo]
GO
| 62.466667 | 120 | 0.682497 |
76104e34356e13843f2391de6c176e1648951488 | 1,681 | go | Go | erp/doc/docSub.go | hansonyu183/gfast | f99510bf4162329dd790511d45a3ef30f7b66bc2 | [
"MIT"
] | null | null | null | erp/doc/docSub.go | hansonyu183/gfast | f99510bf4162329dd790511d45a3ef30f7b66bc2 | [
"MIT"
] | null | null | null | erp/doc/docSub.go | hansonyu183/gfast | f99510bf4162329dd790511d45a3ef30f7b66bc2 | [
"MIT"
] | null | null | null | package doc
import (
"fmt"
"gfast/erp/boot"
"gfast/library/response"
"github.com/gogf/gf/database/gdb"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/net/ghttp"
"github.com/gogf/gf/util/gconv"
"github.com/gogf/gf/util/gvalid"
)
// DocSub API็ฎก็ๅฏน่ฑก
var DocSub = &docSub{}
type docSub struct {
}
type PostSubData struct {
Tables map[string]string
KeyIDs map[string]string
}
//controller
func (ctrl *docSub) Post(r *ghttp.Request) {
var docSubData *PostSubData
var err error
if err = r.Parse(&docSubData); err != nil {
response.FailJson(true, r, err.(*gvalid.Error).FirstString())
}
docID := r.GetInt("docID")
if docID == 0 {
response.FailJson(true, r, "ๆ ไธปๆกฃๆก")
}
docType := r.GetString("docType")
err = ctrl.saveData(docType, docID, docSubData)
if err != nil {
response.FailJson(true, r, err.Error())
}
response.SusJson(true, r, "ๆๅ")
}
func (ctrl *docSub) saveData(docType string, docID int, data *PostSubData) (err error) {
err = boot.ErpDB.Transaction(func(tx *gdb.TX) error {
idKey := fmt.Sprintf("%s_id", docType)
for tb, v := range data.Tables {
if _, err = tx.Table(tb).Delete(idKey, docID); err != nil {
return err
}
tbData := gconv.SliceMap(v)
for i, v := range tbData {
if len(v) > 0 {
tbData[i][idKey] = docID
} else {
tbData = append(tbData[:i], tbData[i+1:]...)
}
}
if len(tbData) == 0 {
continue
}
if _, err = tx.Model(tb).Insert(tbData); err != nil {
return err
}
}
return nil
})
if err != nil {
g.Log().Error(err)
// err = gerror.New("ไฟๅญๅคฑ่ดฅ")
return err
}
return nil
}
| 20.753086 | 89 | 0.600833 |
a28cb5b88e8431916e23add29cc563b2b9d28a99 | 10,480 | sql | SQL | config/queries/fb_int_01.sql | Lerailen/Report_automation_with_Tableau | 6cb9e72476813ed4e4a20acdd92d3315ef84d66a | [
"MIT"
] | null | null | null | config/queries/fb_int_01.sql | Lerailen/Report_automation_with_Tableau | 6cb9e72476813ed4e4a20acdd92d3315ef84d66a | [
"MIT"
] | null | null | null | config/queries/fb_int_01.sql | Lerailen/Report_automation_with_Tableau | 6cb9e72476813ed4e4a20acdd92d3315ef84d66a | [
"MIT"
] | null | null | null | select 'GUSTA' AS 'TIPO',
sum(case when substring(ctimestamp, 7, 2)=01 then likes else 0 end) as '01',
sum(case when substring(ctimestamp, 7, 2)=02 then likes else 0 end) as '02',
sum(case when substring(ctimestamp, 7, 2)=03 then likes else 0 end) as '03',
sum(case when substring(ctimestamp, 7, 2)=04 then likes else 0 end) as '04',
sum(case when substring(ctimestamp, 7, 2)=05 then likes else 0 end) as '05',
sum(case when substring(ctimestamp, 7, 2)=06 then likes else 0 end) as '06',
sum(case when substring(ctimestamp, 7, 2)=07 then likes else 0 end) as '07',
sum(case when substring(ctimestamp, 7, 2)=08 then likes else 0 end) as '08',
sum(case when substring(ctimestamp, 7, 2)=09 then likes else 0 end) as '09',
sum(case when substring(ctimestamp, 7, 2)=10 then likes else 0 end) as '10',
sum(case when substring(ctimestamp, 7, 2)=11 then likes else 0 end) as '11',
sum(case when substring(ctimestamp, 7, 2)=12 then likes else 0 end) as '12',
sum(case when substring(ctimestamp, 7, 2)=13 then likes else 0 end) as '13',
sum(case when substring(ctimestamp, 7, 2)=14 then likes else 0 end) as '14',
sum(case when substring(ctimestamp, 7, 2)=15 then likes else 0 end) as '15',
sum(case when substring(ctimestamp, 7, 2)=16 then likes else 0 end) as '16',
sum(case when substring(ctimestamp, 7, 2)=17 then likes else 0 end) as '17',
sum(case when substring(ctimestamp, 7, 2)=18 then likes else 0 end) as '18',
sum(case when substring(ctimestamp, 7, 2)=19 then likes else 0 end) as '19',
sum(case when substring(ctimestamp, 7, 2)=20 then likes else 0 end) as '20',
sum(case when substring(ctimestamp, 7, 2)=21 then likes else 0 end) as '21',
sum(case when substring(ctimestamp, 7, 2)=22 then likes else 0 end) as '22',
sum(case when substring(ctimestamp, 7, 2)=23 then likes else 0 end) as '23',
sum(case when substring(ctimestamp, 7, 2)=24 then likes else 0 end) as '24',
sum(case when substring(ctimestamp, 7, 2)=25 then likes else 0 end) as '25',
sum(case when substring(ctimestamp, 7, 2)=26 then likes else 0 end) as '26',
sum(case when substring(ctimestamp, 7, 2)=27 then likes else 0 end) as '27',
sum(case when substring(ctimestamp, 7, 2)=28 then likes else 0 end) as '28',
sum(case when substring(ctimestamp, 7, 2)=29 then likes else 0 end) as '29',
sum(case when substring(ctimestamp, 7, 2)=30 then likes else 0 end) as '30',
sum(case when substring(ctimestamp, 7, 2)=31 then likes else 0 end) as '31'
from actividad.aralleida_fbposts
where substring(ctimestamp, 5, 2)=%actual_month% AND substring(ctimestamp, 1, 4)=%actual_year%
union
select 'COMENTARIOS' AS 'TIPO',
sum(case when substring(ctimestamp, 7, 2)=01 then comments else 0 end) as '01',
sum(case when substring(ctimestamp, 7, 2)=02 then comments else 0 end) as '02',
sum(case when substring(ctimestamp, 7, 2)=03 then comments else 0 end) as '03',
sum(case when substring(ctimestamp, 7, 2)=04 then comments else 0 end) as '04',
sum(case when substring(ctimestamp, 7, 2)=05 then comments else 0 end) as '05',
sum(case when substring(ctimestamp, 7, 2)=06 then comments else 0 end) as '06',
sum(case when substring(ctimestamp, 7, 2)=07 then comments else 0 end) as '07',
sum(case when substring(ctimestamp, 7, 2)=08 then comments else 0 end) as '08',
sum(case when substring(ctimestamp, 7, 2)=09 then comments else 0 end) as '09',
sum(case when substring(ctimestamp, 7, 2)=10 then comments else 0 end) as '10',
sum(case when substring(ctimestamp, 7, 2)=11 then comments else 0 end) as '11',
sum(case when substring(ctimestamp, 7, 2)=12 then comments else 0 end) as '12',
sum(case when substring(ctimestamp, 7, 2)=13 then comments else 0 end) as '13',
sum(case when substring(ctimestamp, 7, 2)=14 then comments else 0 end) as '14',
sum(case when substring(ctimestamp, 7, 2)=15 then comments else 0 end) as '15',
sum(case when substring(ctimestamp, 7, 2)=16 then comments else 0 end) as '16',
sum(case when substring(ctimestamp, 7, 2)=17 then comments else 0 end) as '17',
sum(case when substring(ctimestamp, 7, 2)=18 then comments else 0 end) as '18',
sum(case when substring(ctimestamp, 7, 2)=19 then comments else 0 end) as '19',
sum(case when substring(ctimestamp, 7, 2)=20 then comments else 0 end) as '20',
sum(case when substring(ctimestamp, 7, 2)=21 then comments else 0 end) as '21',
sum(case when substring(ctimestamp, 7, 2)=22 then comments else 0 end) as '22',
sum(case when substring(ctimestamp, 7, 2)=23 then comments else 0 end) as '23',
sum(case when substring(ctimestamp, 7, 2)=24 then comments else 0 end) as '24',
sum(case when substring(ctimestamp, 7, 2)=25 then comments else 0 end) as '25',
sum(case when substring(ctimestamp, 7, 2)=26 then comments else 0 end) as '26',
sum(case when substring(ctimestamp, 7, 2)=27 then comments else 0 end) as '27',
sum(case when substring(ctimestamp, 7, 2)=28 then comments else 0 end) as '28',
sum(case when substring(ctimestamp, 7, 2)=29 then comments else 0 end) as '29',
sum(case when substring(ctimestamp, 7, 2)=30 then comments else 0 end) as '30',
sum(case when substring(ctimestamp, 7, 2)=31 then comments else 0 end) as '31'
from actividad.aralleida_fbposts
where substring(ctimestamp, 5, 2)=%actual_month% AND substring(ctimestamp, 1, 4)=%actual_year%
union
select 'COMPARTIDOS' AS 'TIPO',
sum(case when substring(ctimestamp, 7, 2)=01 then shares else 0 end) as '01',
sum(case when substring(ctimestamp, 7, 2)=02 then shares else 0 end) as '02',
sum(case when substring(ctimestamp, 7, 2)=03 then shares else 0 end) as '03',
sum(case when substring(ctimestamp, 7, 2)=04 then shares else 0 end) as '04',
sum(case when substring(ctimestamp, 7, 2)=05 then shares else 0 end) as '05',
sum(case when substring(ctimestamp, 7, 2)=06 then shares else 0 end) as '06',
sum(case when substring(ctimestamp, 7, 2)=07 then shares else 0 end) as '07',
sum(case when substring(ctimestamp, 7, 2)=08 then shares else 0 end) as '08',
sum(case when substring(ctimestamp, 7, 2)=09 then shares else 0 end) as '09',
sum(case when substring(ctimestamp, 7, 2)=10 then shares else 0 end) as '10',
sum(case when substring(ctimestamp, 7, 2)=11 then shares else 0 end) as '11',
sum(case when substring(ctimestamp, 7, 2)=12 then shares else 0 end) as '12',
sum(case when substring(ctimestamp, 7, 2)=13 then shares else 0 end) as '13',
sum(case when substring(ctimestamp, 7, 2)=14 then shares else 0 end) as '14',
sum(case when substring(ctimestamp, 7, 2)=15 then shares else 0 end) as '15',
sum(case when substring(ctimestamp, 7, 2)=16 then shares else 0 end) as '16',
sum(case when substring(ctimestamp, 7, 2)=17 then shares else 0 end) as '17',
sum(case when substring(ctimestamp, 7, 2)=18 then shares else 0 end) as '18',
sum(case when substring(ctimestamp, 7, 2)=19 then shares else 0 end) as '19',
sum(case when substring(ctimestamp, 7, 2)=20 then shares else 0 end) as '20',
sum(case when substring(ctimestamp, 7, 2)=21 then shares else 0 end) as '21',
sum(case when substring(ctimestamp, 7, 2)=22 then shares else 0 end) as '22',
sum(case when substring(ctimestamp, 7, 2)=23 then shares else 0 end) as '23',
sum(case when substring(ctimestamp, 7, 2)=24 then shares else 0 end) as '24',
sum(case when substring(ctimestamp, 7, 2)=25 then shares else 0 end) as '25',
sum(case when substring(ctimestamp, 7, 2)=26 then shares else 0 end) as '26',
sum(case when substring(ctimestamp, 7, 2)=27 then shares else 0 end) as '27',
sum(case when substring(ctimestamp, 7, 2)=28 then shares else 0 end) as '28',
sum(case when substring(ctimestamp, 7, 2)=29 then shares else 0 end) as '29',
sum(case when substring(ctimestamp, 7, 2)=30 then shares else 0 end) as '30',
sum(case when substring(ctimestamp, 7, 2)=31 then shares else 0 end) as '31'
from actividad.aralleida_fbposts
where substring(ctimestamp, 5, 2)=%actual_month% AND substring(ctimestamp, 1, 4)=%actual_year%
union
select 'CLICKS' AS 'TIPO',
sum(case when substring(ctimestamp, 7, 2)=01 then clicks else 0 end) as '01',
sum(case when substring(ctimestamp, 7, 2)=02 then clicks else 0 end) as '02',
sum(case when substring(ctimestamp, 7, 2)=03 then clicks else 0 end) as '03',
sum(case when substring(ctimestamp, 7, 2)=04 then clicks else 0 end) as '04',
sum(case when substring(ctimestamp, 7, 2)=05 then clicks else 0 end) as '05',
sum(case when substring(ctimestamp, 7, 2)=06 then clicks else 0 end) as '06',
sum(case when substring(ctimestamp, 7, 2)=07 then clicks else 0 end) as '07',
sum(case when substring(ctimestamp, 7, 2)=08 then clicks else 0 end) as '08',
sum(case when substring(ctimestamp, 7, 2)=09 then clicks else 0 end) as '09',
sum(case when substring(ctimestamp, 7, 2)=10 then clicks else 0 end) as '10',
sum(case when substring(ctimestamp, 7, 2)=11 then clicks else 0 end) as '11',
sum(case when substring(ctimestamp, 7, 2)=12 then clicks else 0 end) as '12',
sum(case when substring(ctimestamp, 7, 2)=13 then clicks else 0 end) as '13',
sum(case when substring(ctimestamp, 7, 2)=14 then clicks else 0 end) as '14',
sum(case when substring(ctimestamp, 7, 2)=15 then clicks else 0 end) as '15',
sum(case when substring(ctimestamp, 7, 2)=16 then clicks else 0 end) as '16',
sum(case when substring(ctimestamp, 7, 2)=17 then clicks else 0 end) as '17',
sum(case when substring(ctimestamp, 7, 2)=18 then clicks else 0 end) as '18',
sum(case when substring(ctimestamp, 7, 2)=19 then clicks else 0 end) as '19',
sum(case when substring(ctimestamp, 7, 2)=20 then clicks else 0 end) as '20',
sum(case when substring(ctimestamp, 7, 2)=21 then clicks else 0 end) as '21',
sum(case when substring(ctimestamp, 7, 2)=22 then clicks else 0 end) as '22',
sum(case when substring(ctimestamp, 7, 2)=23 then clicks else 0 end) as '23',
sum(case when substring(ctimestamp, 7, 2)=24 then clicks else 0 end) as '24',
sum(case when substring(ctimestamp, 7, 2)=25 then clicks else 0 end) as '25',
sum(case when substring(ctimestamp, 7, 2)=26 then clicks else 0 end) as '26',
sum(case when substring(ctimestamp, 7, 2)=27 then clicks else 0 end) as '27',
sum(case when substring(ctimestamp, 7, 2)=28 then clicks else 0 end) as '28',
sum(case when substring(ctimestamp, 7, 2)=29 then clicks else 0 end) as '29',
sum(case when substring(ctimestamp, 7, 2)=30 then clicks else 0 end) as '30',
sum(case when substring(ctimestamp, 7, 2)=31 then clicks else 0 end) as '31'
from actividad.aralleida_fbposts
where substring(ctimestamp, 5, 2)=%actual_month% AND substring(ctimestamp, 1, 4)=%actual_year% | 75.395683 | 94 | 0.714027 |
265f36fecd4240c8bd8e900dfeb173e31e0d2f4e | 3,041 | java | Java | src/main/java/com/drye/myblog/demo/entity/CommentEntity.java | FourierYe/MyBlog | ff9e2492d3e65e92a92c2df75d1c5be2d9829499 | [
"MIT"
] | 3 | 2019-12-27T15:31:13.000Z | 2021-02-05T04:59:06.000Z | src/main/java/com/drye/myblog/demo/entity/CommentEntity.java | FourierYe/MyBlog | ff9e2492d3e65e92a92c2df75d1c5be2d9829499 | [
"MIT"
] | 1 | 2018-03-07T10:04:20.000Z | 2018-03-07T10:04:20.000Z | src/main/java/com/drye/myblog/demo/entity/CommentEntity.java | MrYezhipeng/MyBlog | ff9e2492d3e65e92a92c2df75d1c5be2d9829499 | [
"MIT"
] | 1 | 2020-04-23T06:03:59.000Z | 2020-04-23T06:03:59.000Z | package com.drye.myblog.demo.entity;
/**
* The type Comment entity.
*
* @Description: CommentEntityๅฎไฝ็ฑป
* @Author: GeekYe
* @Date: 2018 /3/7
*/
public class CommentEntity {
private Integer commentId;
private String commentName;
private String commentEmail;
private String commentContent;
private String commentTime;
private ArticleEntity articleEntity;
/**
* Gets comment id.
*
* @return the comment id
*/
public Integer getCommentId() {
return commentId;
}
/**
* Sets comment id.
*
* @param commentId the comment id
*/
public void setCommentId(Integer commentId) {
this.commentId = commentId;
}
/**
* Gets comment name.
*
* @return the comment name
*/
public String getCommentName() {
return commentName;
}
/**
* Sets comment name.
*
* @param commentName the comment name
*/
public void setCommentName(String commentName) {
this.commentName = commentName;
}
/**
* Gets comment email.
*
* @return the comment email
*/
public String getCommentEmail() {
return commentEmail;
}
/**
* Sets comment email.
*
* @param commentEmail the comment email
*/
public void setCommentEmail(String commentEmail) {
this.commentEmail = commentEmail;
}
/**
* Gets comment content.
*
* @return the comment content
*/
public String getCommentContent() {
return commentContent;
}
/**
* Sets comment content.
*
* @param commentContent the comment content
*/
public void setCommentContent(String commentContent) {
this.commentContent = commentContent;
}
/**
* Gets comment time.
*
* @return the comment time
*/
public String getCommentTime() {
return commentTime;
}
/**
* Sets comment time.
*
* @param commentTime the comment time
*/
public void setCommentTime(String commentTime) {
this.commentTime = commentTime;
}
/**
* Gets article entity.
*
* @return the article entity
*/
public ArticleEntity getArticleEntity() {
return articleEntity;
}
/**
* Sets article entity.
*
* @param articleEntity the article entity
*/
public void setArticleEntity(ArticleEntity articleEntity) {
this.articleEntity = articleEntity;
}
/**
* Instantiates a new Comment entity.
*/
public CommentEntity() {
}
@Override
public String toString() {
return "CommentEntity{" +
"commentId=" + commentId +
", commentName='" + commentName + '\'' +
", commentEmail='" + commentEmail + '\'' +
", commentContent='" + commentContent + '\'' +
", commentTime=" + commentTime +
", articleEntity=" + articleEntity +
'}';
}
}
| 20.972414 | 63 | 0.56363 |
a8cfc222e25174390a2f97fd755df3057a38dd43 | 13,163 | rs | Rust | src/sim/fcfg1.rs | rv32m1-rust/rv32m1_ri5cy-pac | 1f98f7ab62b6f99f9de0157085ecd09855b6560f | [
"Apache-2.0",
"MIT"
] | 5 | 2019-09-09T17:12:39.000Z | 2021-05-25T10:33:24.000Z | src/sim/fcfg1.rs | rv32m1-rust/rv32m1_ri5cy-pac | 1f98f7ab62b6f99f9de0157085ecd09855b6560f | [
"Apache-2.0",
"MIT"
] | null | null | null | src/sim/fcfg1.rs | rv32m1-rust/rv32m1_ri5cy-pac | 1f98f7ab62b6f99f9de0157085ecd09855b6560f | [
"Apache-2.0",
"MIT"
] | null | null | null | #[doc = "Reader of register FCFG1"]
pub type R = crate::R<u32, super::FCFG1>;
#[doc = "Writer for register FCFG1"]
pub type W = crate::W<u32, super::FCFG1>;
#[doc = "Register FCFG1 `reset()`'s with value 0xcaa9_0400"]
impl crate::ResetValue for super::FCFG1 {
type Type = u32;
#[inline(always)]
fn reset_value() -> Self::Type {
0xcaa9_0400
}
}
#[doc = "Flash disable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum FLASHDIS_A {
#[doc = "0: Flash is enabled"]
FLASHDIS_0,
#[doc = "1: Flash is disabled"]
FLASHDIS_1,
}
impl From<FLASHDIS_A> for bool {
#[inline(always)]
fn from(variant: FLASHDIS_A) -> Self {
match variant {
FLASHDIS_A::FLASHDIS_0 => false,
FLASHDIS_A::FLASHDIS_1 => true,
}
}
}
#[doc = "Reader of field `FLASHDIS`"]
pub type FLASHDIS_R = crate::R<bool, FLASHDIS_A>;
impl FLASHDIS_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> FLASHDIS_A {
match self.bits {
false => FLASHDIS_A::FLASHDIS_0,
true => FLASHDIS_A::FLASHDIS_1,
}
}
#[doc = "Checks if the value of the field is `FLASHDIS_0`"]
#[inline(always)]
pub fn is_flashdis_0(&self) -> bool {
*self == FLASHDIS_A::FLASHDIS_0
}
#[doc = "Checks if the value of the field is `FLASHDIS_1`"]
#[inline(always)]
pub fn is_flashdis_1(&self) -> bool {
*self == FLASHDIS_A::FLASHDIS_1
}
}
#[doc = "Write proxy for field `FLASHDIS`"]
pub struct FLASHDIS_W<'a> {
w: &'a mut W,
}
impl<'a> FLASHDIS_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: FLASHDIS_A) -> &'a mut W {
{
self.bit(variant.into())
}
}
#[doc = "Flash is enabled"]
#[inline(always)]
pub fn flashdis_0(self) -> &'a mut W {
self.variant(FLASHDIS_A::FLASHDIS_0)
}
#[doc = "Flash is disabled"]
#[inline(always)]
pub fn flashdis_1(self) -> &'a mut W {
self.variant(FLASHDIS_A::FLASHDIS_1)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01);
self.w
}
}
#[doc = "Flash Doze\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum FLASHDOZE_A {
#[doc = "0: Flash remains enabled during Doze mode"]
FLASHDOZE_0,
#[doc = "1: Flash is disabled for the duration of Doze mode"]
FLASHDOZE_1,
}
impl From<FLASHDOZE_A> for bool {
#[inline(always)]
fn from(variant: FLASHDOZE_A) -> Self {
match variant {
FLASHDOZE_A::FLASHDOZE_0 => false,
FLASHDOZE_A::FLASHDOZE_1 => true,
}
}
}
#[doc = "Reader of field `FLASHDOZE`"]
pub type FLASHDOZE_R = crate::R<bool, FLASHDOZE_A>;
impl FLASHDOZE_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> FLASHDOZE_A {
match self.bits {
false => FLASHDOZE_A::FLASHDOZE_0,
true => FLASHDOZE_A::FLASHDOZE_1,
}
}
#[doc = "Checks if the value of the field is `FLASHDOZE_0`"]
#[inline(always)]
pub fn is_flashdoze_0(&self) -> bool {
*self == FLASHDOZE_A::FLASHDOZE_0
}
#[doc = "Checks if the value of the field is `FLASHDOZE_1`"]
#[inline(always)]
pub fn is_flashdoze_1(&self) -> bool {
*self == FLASHDOZE_A::FLASHDOZE_1
}
}
#[doc = "Write proxy for field `FLASHDOZE`"]
pub struct FLASHDOZE_W<'a> {
w: &'a mut W,
}
impl<'a> FLASHDOZE_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: FLASHDOZE_A) -> &'a mut W {
{
self.bit(variant.into())
}
}
#[doc = "Flash remains enabled during Doze mode"]
#[inline(always)]
pub fn flashdoze_0(self) -> &'a mut W {
self.variant(FLASHDOZE_A::FLASHDOZE_0)
}
#[doc = "Flash is disabled for the duration of Doze mode"]
#[inline(always)]
pub fn flashdoze_1(self) -> &'a mut W {
self.variant(FLASHDOZE_A::FLASHDOZE_1)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1);
self.w
}
}
#[doc = "Flash auto disable enabled.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum FLSAUTODISEN_A {
#[doc = "0: Disable flash auto disable function"]
FLSAUTODISEN_0,
#[doc = "1: Enable flash auto disable function"]
FLSAUTODISEN_1,
}
impl From<FLSAUTODISEN_A> for bool {
#[inline(always)]
fn from(variant: FLSAUTODISEN_A) -> Self {
match variant {
FLSAUTODISEN_A::FLSAUTODISEN_0 => false,
FLSAUTODISEN_A::FLSAUTODISEN_1 => true,
}
}
}
#[doc = "Reader of field `FLSAUTODISEN`"]
pub type FLSAUTODISEN_R = crate::R<bool, FLSAUTODISEN_A>;
impl FLSAUTODISEN_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> FLSAUTODISEN_A {
match self.bits {
false => FLSAUTODISEN_A::FLSAUTODISEN_0,
true => FLSAUTODISEN_A::FLSAUTODISEN_1,
}
}
#[doc = "Checks if the value of the field is `FLSAUTODISEN_0`"]
#[inline(always)]
pub fn is_flsautodisen_0(&self) -> bool {
*self == FLSAUTODISEN_A::FLSAUTODISEN_0
}
#[doc = "Checks if the value of the field is `FLSAUTODISEN_1`"]
#[inline(always)]
pub fn is_flsautodisen_1(&self) -> bool {
*self == FLSAUTODISEN_A::FLSAUTODISEN_1
}
}
#[doc = "Write proxy for field `FLSAUTODISEN`"]
pub struct FLSAUTODISEN_W<'a> {
w: &'a mut W,
}
impl<'a> FLSAUTODISEN_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: FLSAUTODISEN_A) -> &'a mut W {
{
self.bit(variant.into())
}
}
#[doc = "Disable flash auto disable function"]
#[inline(always)]
pub fn flsautodisen_0(self) -> &'a mut W {
self.variant(FLSAUTODISEN_A::FLSAUTODISEN_0)
}
#[doc = "Enable flash auto disable function"]
#[inline(always)]
pub fn flsautodisen_1(self) -> &'a mut W {
self.variant(FLSAUTODISEN_A::FLSAUTODISEN_1)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2);
self.w
}
}
#[doc = "Reader of field `FLSAUTODISWD`"]
pub type FLSAUTODISWD_R = crate::R<u16, u16>;
#[doc = "Write proxy for field `FLSAUTODISWD`"]
pub struct FLSAUTODISWD_W<'a> {
w: &'a mut W,
}
impl<'a> FLSAUTODISWD_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u16) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x07ff << 3)) | (((value as u32) & 0x07ff) << 3);
self.w
}
}
#[doc = "The SRAM size for core1 (CM0+)\n\nValue on reset: 9"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum CORE1_SRAMSIZE_A {
#[doc = "9: CM0+ has 128 KB SRAM"]
CORE1_SRAMSIZE_9,
}
impl From<CORE1_SRAMSIZE_A> for u8 {
#[inline(always)]
fn from(variant: CORE1_SRAMSIZE_A) -> Self {
match variant {
CORE1_SRAMSIZE_A::CORE1_SRAMSIZE_9 => 9,
}
}
}
#[doc = "Reader of field `CORE1_SRAMSIZE`"]
pub type CORE1_SRAMSIZE_R = crate::R<u8, CORE1_SRAMSIZE_A>;
impl CORE1_SRAMSIZE_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> crate::Variant<u8, CORE1_SRAMSIZE_A> {
use crate::Variant::*;
match self.bits {
9 => Val(CORE1_SRAMSIZE_A::CORE1_SRAMSIZE_9),
i => Res(i),
}
}
#[doc = "Checks if the value of the field is `CORE1_SRAMSIZE_9`"]
#[inline(always)]
pub fn is_core1_sramsize_9(&self) -> bool {
*self == CORE1_SRAMSIZE_A::CORE1_SRAMSIZE_9
}
}
#[doc = "The SRAM size for core0 (CM4)\n\nValue on reset: 10"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum CORE0_SRAMSIZE_A {
#[doc = "10: CM4 has 256 KB SRAM"]
CORE0_SRAMSIZE_10,
}
impl From<CORE0_SRAMSIZE_A> for u8 {
#[inline(always)]
fn from(variant: CORE0_SRAMSIZE_A) -> Self {
match variant {
CORE0_SRAMSIZE_A::CORE0_SRAMSIZE_10 => 10,
}
}
}
#[doc = "Reader of field `CORE0_SRAMSIZE`"]
pub type CORE0_SRAMSIZE_R = crate::R<u8, CORE0_SRAMSIZE_A>;
impl CORE0_SRAMSIZE_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> crate::Variant<u8, CORE0_SRAMSIZE_A> {
use crate::Variant::*;
match self.bits {
10 => Val(CORE0_SRAMSIZE_A::CORE0_SRAMSIZE_10),
i => Res(i),
}
}
#[doc = "Checks if the value of the field is `CORE0_SRAMSIZE_10`"]
#[inline(always)]
pub fn is_core0_sramsize_10(&self) -> bool {
*self == CORE0_SRAMSIZE_A::CORE0_SRAMSIZE_10
}
}
#[doc = "The flash size for core1 (CM0+)\n\nValue on reset: 10"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum CORE1_PFSIZE_A {
#[doc = "10: CM0+ has 256 KB flash size."]
CORE1_PFSIZE_10,
}
impl From<CORE1_PFSIZE_A> for u8 {
#[inline(always)]
fn from(variant: CORE1_PFSIZE_A) -> Self {
match variant {
CORE1_PFSIZE_A::CORE1_PFSIZE_10 => 10,
}
}
}
#[doc = "Reader of field `CORE1_PFSIZE`"]
pub type CORE1_PFSIZE_R = crate::R<u8, CORE1_PFSIZE_A>;
impl CORE1_PFSIZE_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> crate::Variant<u8, CORE1_PFSIZE_A> {
use crate::Variant::*;
match self.bits {
10 => Val(CORE1_PFSIZE_A::CORE1_PFSIZE_10),
i => Res(i),
}
}
#[doc = "Checks if the value of the field is `CORE1_PFSIZE_10`"]
#[inline(always)]
pub fn is_core1_pfsize_10(&self) -> bool {
*self == CORE1_PFSIZE_A::CORE1_PFSIZE_10
}
}
#[doc = "The flash size for core0 (CM4)\n\nValue on reset: 12"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum CORE0_PFSIZE_A {
#[doc = "12: CM4 has 1 MB flash size."]
CORE0_PFSIZE_12,
}
impl From<CORE0_PFSIZE_A> for u8 {
#[inline(always)]
fn from(variant: CORE0_PFSIZE_A) -> Self {
match variant {
CORE0_PFSIZE_A::CORE0_PFSIZE_12 => 12,
}
}
}
#[doc = "Reader of field `CORE0_PFSIZE`"]
pub type CORE0_PFSIZE_R = crate::R<u8, CORE0_PFSIZE_A>;
impl CORE0_PFSIZE_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> crate::Variant<u8, CORE0_PFSIZE_A> {
use crate::Variant::*;
match self.bits {
12 => Val(CORE0_PFSIZE_A::CORE0_PFSIZE_12),
i => Res(i),
}
}
#[doc = "Checks if the value of the field is `CORE0_PFSIZE_12`"]
#[inline(always)]
pub fn is_core0_pfsize_12(&self) -> bool {
*self == CORE0_PFSIZE_A::CORE0_PFSIZE_12
}
}
impl R {
#[doc = "Bit 0 - Flash disable"]
#[inline(always)]
pub fn flashdis(&self) -> FLASHDIS_R {
FLASHDIS_R::new((self.bits & 0x01) != 0)
}
#[doc = "Bit 1 - Flash Doze"]
#[inline(always)]
pub fn flashdoze(&self) -> FLASHDOZE_R {
FLASHDOZE_R::new(((self.bits >> 1) & 0x01) != 0)
}
#[doc = "Bit 2 - Flash auto disable enabled."]
#[inline(always)]
pub fn flsautodisen(&self) -> FLSAUTODISEN_R {
FLSAUTODISEN_R::new(((self.bits >> 2) & 0x01) != 0)
}
#[doc = "Bits 3:13 - The clock counter for time period of flash auto disable."]
#[inline(always)]
pub fn flsautodiswd(&self) -> FLSAUTODISWD_R {
FLSAUTODISWD_R::new(((self.bits >> 3) & 0x07ff) as u16)
}
#[doc = "Bits 16:19 - The SRAM size for core1 (CM0+)"]
#[inline(always)]
pub fn core1_sramsize(&self) -> CORE1_SRAMSIZE_R {
CORE1_SRAMSIZE_R::new(((self.bits >> 16) & 0x0f) as u8)
}
#[doc = "Bits 20:23 - The SRAM size for core0 (CM4)"]
#[inline(always)]
pub fn core0_sramsize(&self) -> CORE0_SRAMSIZE_R {
CORE0_SRAMSIZE_R::new(((self.bits >> 20) & 0x0f) as u8)
}
#[doc = "Bits 24:27 - The flash size for core1 (CM0+)"]
#[inline(always)]
pub fn core1_pfsize(&self) -> CORE1_PFSIZE_R {
CORE1_PFSIZE_R::new(((self.bits >> 24) & 0x0f) as u8)
}
#[doc = "Bits 28:31 - The flash size for core0 (CM4)"]
#[inline(always)]
pub fn core0_pfsize(&self) -> CORE0_PFSIZE_R {
CORE0_PFSIZE_R::new(((self.bits >> 28) & 0x0f) as u8)
}
}
impl W {
#[doc = "Bit 0 - Flash disable"]
#[inline(always)]
pub fn flashdis(&mut self) -> FLASHDIS_W {
FLASHDIS_W { w: self }
}
#[doc = "Bit 1 - Flash Doze"]
#[inline(always)]
pub fn flashdoze(&mut self) -> FLASHDOZE_W {
FLASHDOZE_W { w: self }
}
#[doc = "Bit 2 - Flash auto disable enabled."]
#[inline(always)]
pub fn flsautodisen(&mut self) -> FLSAUTODISEN_W {
FLSAUTODISEN_W { w: self }
}
#[doc = "Bits 3:13 - The clock counter for time period of flash auto disable."]
#[inline(always)]
pub fn flsautodiswd(&mut self) -> FLSAUTODISWD_W {
FLSAUTODISWD_W { w: self }
}
}
| 29.057395 | 84 | 0.631771 |
926b3e5704639a096c89c409da0a14ea37137d35 | 1,927 | swift | Swift | MercadoPagoSDK/MercadoPagoSDK/Core/PXAmountHelper.swift | MarceloJoseML/px-ios | a8e9279e562faefcb31accd6151543255d3732bc | [
"MIT"
] | null | null | null | MercadoPagoSDK/MercadoPagoSDK/Core/PXAmountHelper.swift | MarceloJoseML/px-ios | a8e9279e562faefcb31accd6151543255d3732bc | [
"MIT"
] | null | null | null | MercadoPagoSDK/MercadoPagoSDK/Core/PXAmountHelper.swift | MarceloJoseML/px-ios | a8e9279e562faefcb31accd6151543255d3732bc | [
"MIT"
] | null | null | null | //
// PXAmountHelper.swift
// MercadoPagoSDK
//
// Created by Demian Tejo on 29/5/18.
// Copyright ยฉ 2018 MercadoPago. All rights reserved.
//
import Foundation
internal struct PXAmountHelper {
internal let preference: PXCheckoutPreference
internal let paymentData: PXPaymentData
internal let discount: PXDiscount?
internal let campaign: PXCampaign?
internal let chargeRules: [PXPaymentTypeChargeRule]?
internal let consumedDiscount: Bool
var preferenceAmount: Double {
get {
return self.preference.getTotalAmount()
}
}
var preferenceAmountWithCharges: Double {
get {
return preferenceAmount + chargeRuleAmount
}
}
var amountToPay: Double {
get {
if let payerCost = paymentData.payerCost {
return payerCost.totalAmount
}
if let couponAmount = discount?.couponAmount {
return preferenceAmount - couponAmount + chargeRuleAmount
} else {
return preferenceAmount + chargeRuleAmount
}
}
}
var amountOff: Double {
get {
guard let discount = self.discount else {
return 0
}
return discount.couponAmount
}
}
var maxCouponAmount: Double? {
get {
if let maxCouponAmount = campaign?.maxCouponAmount, maxCouponAmount > 0.0 {
return maxCouponAmount
}
return nil
}
}
internal var chargeRuleAmount: Double {
get {
guard let rules = chargeRules else {
return 0
}
for rule in rules {
if rule.paymentMethdodId == paymentData.paymentMethod?.paymentTypeId {
return rule.amountCharge
}
}
return 0
}
}
}
| 25.025974 | 87 | 0.560976 |
28126307e6774ad912aec84c14dbed857c5cbe79 | 303 | go | Go | generator/testdata/rpc/errors/same-request-response-types/greeter.remoto.go | jamesjwarren/remoto | cf17d7a2a80359f3bcf6866d6a60a7177c41f560 | [
"Apache-2.0"
] | 258 | 2018-06-27T19:48:57.000Z | 2018-08-08T21:52:25.000Z | generator/testdata/rpc/errors/same-request-response-types/greeter.remoto.go | jamesjwarren/remoto | cf17d7a2a80359f3bcf6866d6a60a7177c41f560 | [
"Apache-2.0"
] | 7 | 2018-06-28T08:30:16.000Z | 2018-07-03T13:52:16.000Z | generator/testdata/rpc/errors/same-request-response-types/greeter.remoto.go | jamesjwarren/remoto | cf17d7a2a80359f3bcf6866d6a60a7177c41f560 | [
"Apache-2.0"
] | 8 | 2018-06-28T08:29:31.000Z | 2018-07-03T01:14:45.000Z | // Package greeter is a sweet API that greets people.
package greeter
// Greeter provides greeting services.
type Greeter interface {
// Greet generates a greeting.
Greet(GreetRequest) GreetRequest
}
// GreetRequest is the request for Greeter.GreetRequest.
type GreetRequest struct {
Name string
}
| 21.642857 | 56 | 0.778878 |
775176e3c7737494799b1ece0628d92a2ad486ed | 38,871 | html | HTML | docs/apidocs/latest/org.autogui/org/autogui/base/mapping/ScheduledTaskRunner.html | ppp-kohe/ppp-kohe.github.io | ebf2f79e5b2af01212ddbd7c661dffddd6b60e84 | [
"Apache-2.0"
] | null | null | null | docs/apidocs/latest/org.autogui/org/autogui/base/mapping/ScheduledTaskRunner.html | ppp-kohe/ppp-kohe.github.io | ebf2f79e5b2af01212ddbd7c661dffddd6b60e84 | [
"Apache-2.0"
] | null | null | null | docs/apidocs/latest/org.autogui/org/autogui/base/mapping/ScheduledTaskRunner.html | ppp-kohe/ppp-kohe.github.io | ebf2f79e5b2af01212ddbd7c661dffddd6b60e84 | [
"Apache-2.0"
] | null | null | null | <!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (11.0.11) on Sat Jun 26 12:52:32 JST 2021 -->
<title>ScheduledTaskRunner (org.autogui:autogui 1.4 API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="dc.created" content="2021-06-26">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../apidocs.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../jquery/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
<script type="text/javascript" src="../../../../../jquery/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../../../../jquery/jquery-3.5.1.js"></script>
<script type="text/javascript" src="../../../../../jquery/jquery-ui.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="ScheduledTaskRunner (org.autogui:autogui 1.4 API)";
}
}
catch(err) {
}
//-->
var data = {"i0":10,"i1":10,"i2":10,"i3":9,"i4":10,"i5":10,"i6":9,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
var pathtoroot = "../../../../../";
var useModuleDirectories = true;
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<div class="fixedNav">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a id="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../module-summary.html">Module</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/ScheduledTaskRunner.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses.html">All Classes</a></li>
</ul>
<ul class="navListSearch">
<li><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li><a href="#field.summary">Field</a> | </li>
<li><a href="#constructor.summary">Constr</a> | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li><a href="#field.detail">Field</a> | </li>
<li><a href="#constructor.detail">Constr</a> | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a id="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="navPadding"> </div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
</nav>
</header>
<!-- ======== START OF CLASS DATA ======== -->
<main role="main">
<div class="header">
<div class="subTitle"><span class="moduleLabelInType">Module</span> <a href="../../../../module-summary.html">org.autogui</a></div>
<div class="subTitle"><span class="packageLabelInType">Package</span> <a href="package-summary.html">org.autogui.base.mapping</a></div>
<h2 title="Class ScheduledTaskRunner" class="title">Class ScheduledTaskRunner<EventType></h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>org.autogui.base.mapping.ScheduledTaskRunner<EventType></li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>Direct Known Subclasses:</dt>
<dd><code><a href="../../swing/util/EditingRunner.html" title="class in org.autogui.swing.util">EditingRunner</a></code></dd>
</dl>
<hr>
<pre>public class <span class="typeNameLabel">ScheduledTaskRunner<EventType></span>
extends <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></pre>
<div class="block">a delayed task executor accumulating subsequent firing events while the specified delay
<pre>
ScheduledTaskRunner<E> r = new ScheduledTaskRunner<>(300, runner);
r.schedule(e1); //start a task with waiting 300 msec
r.schedule(e2); //cancel the previous task and start another new task with waiting 300 msec
sleep(300);
//the runner will be dispatched with a list of [e1, e2]
</pre></div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary">
<caption><span>Fields</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Field</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a><<a href="ScheduledTaskRunner.html" title="type parameter in ScheduledTaskRunner">EventType</a>></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#accumulatedEvents">accumulatedEvents</a></span></code></th>
<td class="colLast"> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/function/Consumer.html?is-external=true" title="class or interface in java.util.function" class="externalLink">Consumer</a><<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a><<a href="ScheduledTaskRunner.html" title="type parameter in ScheduledTaskRunner">EventType</a>>></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#consumer">consumer</a></span></code></th>
<td class="colLast"> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected long</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#delay">delay</a></span></code></th>
<td class="colLast">
<div class="block">msec</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#enabled">enabled</a></span></code></th>
<td class="colLast"> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/concurrent/ScheduledExecutorService.html?is-external=true" title="class or interface in java.util.concurrent" class="externalLink">ScheduledExecutorService</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#executor">executor</a></span></code></th>
<td class="colLast"> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#executorIsShared">executorIsShared</a></span></code></th>
<td class="colLast">
<div class="block">true if the <a href="#executor"><code>executor</code></a> is <a href="#sharedExecutor"><code>sharedExecutor</code></a>.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/concurrent/ScheduledFuture.html?is-external=true" title="class or interface in java.util.concurrent" class="externalLink">ScheduledFuture</a><?></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#scheduledTask">scheduledTask</a></span></code></th>
<td class="colLast"> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/concurrent/atomic/AtomicInteger.html?is-external=true" title="class or interface in java.util.concurrent.atomic" class="externalLink">AtomicInteger</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#sharedCount">sharedCount</a></span></code></th>
<td class="colLast"> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/concurrent/ScheduledExecutorService.html?is-external=true" title="class or interface in java.util.concurrent" class="externalLink">ScheduledExecutorService</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#sharedExecutor">sharedExecutor</a></span></code></th>
<td class="colLast"> </td>
</tr>
</table>
</li>
</ul>
</section>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Constructor</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(long,java.util.function.Consumer)">ScheduledTaskRunner</a></span>​(long delay,
<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/function/Consumer.html?is-external=true" title="class or interface in java.util.function" class="externalLink">Consumer</a><<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a><<a href="ScheduledTaskRunner.html" title="type parameter in ScheduledTaskRunner">EventType</a>>> consumer)</code></th>
<td class="colLast">
<div class="block">creates a new task-runner with <a href="#sharedExecutor"><code>sharedExecutor</code></a>.</div>
</td>
</tr>
<tr class="rowColor">
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(long,java.util.function.Consumer,java.util.concurrent.ScheduledExecutorService)">ScheduledTaskRunner</a></span>​(long delay,
<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/function/Consumer.html?is-external=true" title="class or interface in java.util.function" class="externalLink">Consumer</a><<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a><<a href="ScheduledTaskRunner.html" title="type parameter in ScheduledTaskRunner">EventType</a>>> consumer,
<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/concurrent/ScheduledExecutorService.html?is-external=true" title="class or interface in java.util.concurrent" class="externalLink">ScheduledExecutorService</a> executor)</code></th>
<td class="colLast"> </td>
</tr>
</table>
</li>
</ul>
</section>
<!-- ========== METHOD SUMMARY =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Method</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/function/Consumer.html?is-external=true" title="class or interface in java.util.function" class="externalLink">Consumer</a><<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a><<a href="ScheduledTaskRunner.html" title="type parameter in ScheduledTaskRunner">EventType</a>>></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getConsumer()">getConsumer</a></span>()</code></th>
<td class="colLast"> </td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>long</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getDelay()">getDelay</a></span>()</code></th>
<td class="colLast"> </td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/concurrent/ScheduledExecutorService.html?is-external=true" title="class or interface in java.util.concurrent" class="externalLink">ScheduledExecutorService</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getExecutor()">getExecutor</a></span>()</code></th>
<td class="colLast"> </td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/concurrent/ScheduledExecutorService.html?is-external=true" title="class or interface in java.util.concurrent" class="externalLink">ScheduledExecutorService</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getSharedExecutor()">getSharedExecutor</a></span>()</code></th>
<td class="colLast"> </td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#hasScheduledTask()">hasScheduledTask</a></span>()</code></th>
<td class="colLast"> </td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#run()">run</a></span>()</code></th>
<td class="colLast"> </td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>static void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#runForShared(java.lang.Runnable)">runForShared</a></span>​(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Runnable.html?is-external=true" title="class or interface in java.lang" class="externalLink">Runnable</a> task)</code></th>
<td class="colLast">
<div class="block">execute a task with synchronization for handling <a href="#sharedExecutor"><code>sharedExecutor</code></a></div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#runImmediately(EventType)">runImmediately</a></span>​(<a href="ScheduledTaskRunner.html" title="type parameter in ScheduledTaskRunner">EventType</a> event)</code></th>
<td class="colLast"> </td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#schedule(EventType)">schedule</a></span>​(<a href="ScheduledTaskRunner.html" title="type parameter in ScheduledTaskRunner">EventType</a> event)</code></th>
<td class="colLast"> </td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#schedule(EventType,long)">schedule</a></span>​(<a href="ScheduledTaskRunner.html" title="type parameter in ScheduledTaskRunner">EventType</a> event,
long delayMSec)</code></th>
<td class="colLast">
<div class="block">if <a href="#enabled"><code>enabled</code></a>, schedules a task for processing the event.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setConsumer(java.util.function.Consumer)">setConsumer</a></span>​(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/function/Consumer.html?is-external=true" title="class or interface in java.util.function" class="externalLink">Consumer</a><<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a><<a href="ScheduledTaskRunner.html" title="type parameter in ScheduledTaskRunner">EventType</a>>> consumer)</code></th>
<td class="colLast"> </td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setDelay(long)">setDelay</a></span>​(long delay)</code></th>
<td class="colLast"> </td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setEnabled(boolean)">setEnabled</a></span>​(boolean enabled)</code></th>
<td class="colLast"> </td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>protected void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setExecutor(java.util.concurrent.ScheduledExecutorService)">setExecutor</a></span>​(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/concurrent/ScheduledExecutorService.html?is-external=true" title="class or interface in java.util.concurrent" class="externalLink">ScheduledExecutorService</a> executor)</code></th>
<td class="colLast">
<div class="block">init the executor to the runner.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#shutdown()">shutdown</a></span>()</code></th>
<td class="colLast"> </td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a id="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class java.lang.<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></h3>
<code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang" class="externalLink">clone</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang" class="externalLink">equals</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang" class="externalLink">finalize</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang" class="externalLink">getClass</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang" class="externalLink">hashCode</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang" class="externalLink">notify</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang" class="externalLink">notifyAll</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang" class="externalLink">toString</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true#wait(long,int)" title="class or interface in java.lang" class="externalLink">wait</a></code></li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a id="delay">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>delay</h4>
<pre>protected long delay</pre>
<div class="block">msec</div>
</li>
</ul>
<a id="executor">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>executor</h4>
<pre>protected <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/concurrent/ScheduledExecutorService.html?is-external=true" title="class or interface in java.util.concurrent" class="externalLink">ScheduledExecutorService</a> executor</pre>
</li>
</ul>
<a id="executorIsShared">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>executorIsShared</h4>
<pre>protected boolean executorIsShared</pre>
<div class="block">true if the <a href="#executor"><code>executor</code></a> is <a href="#sharedExecutor"><code>sharedExecutor</code></a>.</div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.2</dd>
</dl>
</li>
</ul>
<a id="consumer">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>consumer</h4>
<pre>protected <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/function/Consumer.html?is-external=true" title="class or interface in java.util.function" class="externalLink">Consumer</a><<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a><<a href="ScheduledTaskRunner.html" title="type parameter in ScheduledTaskRunner">EventType</a>>> consumer</pre>
</li>
</ul>
<a id="accumulatedEvents">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>accumulatedEvents</h4>
<pre>protected <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a><<a href="ScheduledTaskRunner.html" title="type parameter in ScheduledTaskRunner">EventType</a>> accumulatedEvents</pre>
</li>
</ul>
<a id="scheduledTask">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>scheduledTask</h4>
<pre>protected <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/concurrent/ScheduledFuture.html?is-external=true" title="class or interface in java.util.concurrent" class="externalLink">ScheduledFuture</a><?> scheduledTask</pre>
</li>
</ul>
<a id="enabled">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>enabled</h4>
<pre>protected boolean enabled</pre>
</li>
</ul>
<a id="sharedExecutor">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>sharedExecutor</h4>
<pre>public static <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/concurrent/ScheduledExecutorService.html?is-external=true" title="class or interface in java.util.concurrent" class="externalLink">ScheduledExecutorService</a> sharedExecutor</pre>
</li>
</ul>
<a id="sharedCount">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>sharedCount</h4>
<pre>public static <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/concurrent/atomic/AtomicInteger.html?is-external=true" title="class or interface in java.util.concurrent.atomic" class="externalLink">AtomicInteger</a> sharedCount</pre>
</li>
</ul>
</li>
</ul>
</section>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a id="<init>(long,java.util.function.Consumer)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ScheduledTaskRunner</h4>
<pre>public ScheduledTaskRunner​(long delay,
<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/function/Consumer.html?is-external=true" title="class or interface in java.util.function" class="externalLink">Consumer</a><<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a><<a href="ScheduledTaskRunner.html" title="type parameter in ScheduledTaskRunner">EventType</a>>> consumer)</pre>
<div class="block">creates a new task-runner with <a href="#sharedExecutor"><code>sharedExecutor</code></a>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>delay</code> - the delay milli-seconds for launching a task</dd>
<dd><code>consumer</code> - the actual task runner as taking accumulated events</dd>
</dl>
</li>
</ul>
<a id="<init>(long,java.util.function.Consumer,java.util.concurrent.ScheduledExecutorService)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>ScheduledTaskRunner</h4>
<pre>public ScheduledTaskRunner​(long delay,
<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/function/Consumer.html?is-external=true" title="class or interface in java.util.function" class="externalLink">Consumer</a><<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a><<a href="ScheduledTaskRunner.html" title="type parameter in ScheduledTaskRunner">EventType</a>>> consumer,
<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/concurrent/ScheduledExecutorService.html?is-external=true" title="class or interface in java.util.concurrent" class="externalLink">ScheduledExecutorService</a> executor)</pre>
</li>
</ul>
</li>
</ul>
</section>
<!-- ============ METHOD DETAIL ========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a id="setExecutor(java.util.concurrent.ScheduledExecutorService)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setExecutor</h4>
<pre class="methodSignature">protected void setExecutor​(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/concurrent/ScheduledExecutorService.html?is-external=true" title="class or interface in java.util.concurrent" class="externalLink">ScheduledExecutorService</a> executor)</pre>
<div class="block">init the executor to the runner.
if the executor is <a href="#sharedExecutor"><code>sharedExecutor</code></a>, <a href="#executorIsShared"><code>executorIsShared</code></a> becomes true.
Basically the executor will not be changed, but <a href="#shutdown()"><code>shutdown()</code></a> might cause renewal of <a href="#sharedExecutor"><code>sharedExecutor</code></a>.
Then <a href="#schedule(EventType,long)"><code>schedule(Object, long)</code></a> will call the method again for obtaining a new <a href="#sharedExecutor"><code>sharedExecutor</code></a>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>executor</code> - the executor to be set</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.2</dd>
</dl>
</li>
</ul>
<a id="runForShared(java.lang.Runnable)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>runForShared</h4>
<pre class="methodSignature">public static void runForShared​(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Runnable.html?is-external=true" title="class or interface in java.lang" class="externalLink">Runnable</a> task)</pre>
<div class="block">execute a task with synchronization for handling <a href="#sharedExecutor"><code>sharedExecutor</code></a></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>task</code> - a task with synchronization</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.2</dd>
</dl>
</li>
</ul>
<a id="getSharedExecutor()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSharedExecutor</h4>
<pre class="methodSignature">public static <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/concurrent/ScheduledExecutorService.html?is-external=true" title="class or interface in java.util.concurrent" class="externalLink">ScheduledExecutorService</a> getSharedExecutor()</pre>
</li>
</ul>
<a id="getConsumer()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getConsumer</h4>
<pre class="methodSignature">public <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/function/Consumer.html?is-external=true" title="class or interface in java.util.function" class="externalLink">Consumer</a><<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a><<a href="ScheduledTaskRunner.html" title="type parameter in ScheduledTaskRunner">EventType</a>>> getConsumer()</pre>
</li>
</ul>
<a id="setConsumer(java.util.function.Consumer)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setConsumer</h4>
<pre class="methodSignature">public void setConsumer​(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/function/Consumer.html?is-external=true" title="class or interface in java.util.function" class="externalLink">Consumer</a><<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a><<a href="ScheduledTaskRunner.html" title="type parameter in ScheduledTaskRunner">EventType</a>>> consumer)</pre>
</li>
</ul>
<a id="getDelay()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDelay</h4>
<pre class="methodSignature">public long getDelay()</pre>
</li>
</ul>
<a id="setDelay(long)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setDelay</h4>
<pre class="methodSignature">public void setDelay​(long delay)</pre>
</li>
</ul>
<a id="schedule(java.lang.Object)">
<!-- -->
</a><a id="schedule(EventType)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>schedule</h4>
<pre class="methodSignature">public void schedule​(<a href="ScheduledTaskRunner.html" title="type parameter in ScheduledTaskRunner">EventType</a> event)</pre>
</li>
</ul>
<a id="schedule(java.lang.Object,long)">
<!-- -->
</a><a id="schedule(EventType,long)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>schedule</h4>
<pre class="methodSignature">public void schedule​(<a href="ScheduledTaskRunner.html" title="type parameter in ScheduledTaskRunner">EventType</a> event,
long delayMSec)</pre>
<div class="block">if <a href="#enabled"><code>enabled</code></a>, schedules a task for processing the event.
if another task is already scheduled, then the old task will be canceled.
So, subsequent tasks cause extending the delayed time.
<p>
If the <a href="#executor"><code>executor</code></a> have been shutdown and the executor is the <a href="#sharedExecutor"><code>sharedExecutor</code></a>,
then it will obtain a new shared executor by <a href="#getSharedExecutor()"><code>getSharedExecutor()</code></a>.
This means the method causes reincarnation of the shared executor.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>event</code> - an accumulated event processed by a delayed task</dd>
<dd><code>delayMSec</code> - delaying milliseconds</dd>
</dl>
</li>
</ul>
<a id="runImmediately(java.lang.Object)">
<!-- -->
</a><a id="runImmediately(EventType)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>runImmediately</h4>
<pre class="methodSignature">public void runImmediately​(<a href="ScheduledTaskRunner.html" title="type parameter in ScheduledTaskRunner">EventType</a> event)</pre>
</li>
</ul>
<a id="run()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>run</h4>
<pre class="methodSignature">public void run()</pre>
</li>
</ul>
<a id="setEnabled(boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setEnabled</h4>
<pre class="methodSignature">public void setEnabled​(boolean enabled)</pre>
</li>
</ul>
<a id="getExecutor()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getExecutor</h4>
<pre class="methodSignature">public <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/concurrent/ScheduledExecutorService.html?is-external=true" title="class or interface in java.util.concurrent" class="externalLink">ScheduledExecutorService</a> getExecutor()</pre>
</li>
</ul>
<a id="shutdown()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>shutdown</h4>
<pre class="methodSignature">public void shutdown()</pre>
</li>
</ul>
<a id="hasScheduledTask()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>hasScheduledTask</h4>
<pre class="methodSignature">public boolean hasScheduledTask()</pre>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if it has awaiting task</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.3</dd>
</dl>
</li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
</div>
</main>
<!-- ========= END OF CLASS DATA ========= -->
<footer role="contentinfo">
<nav role="navigation">
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a id="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../module-summary.html">Module</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/ScheduledTaskRunner.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li><a href="#field.summary">Field</a> | </li>
<li><a href="#constructor.summary">Constr</a> | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li><a href="#field.detail">Field</a> | </li>
<li><a href="#constructor.detail">Constr</a> | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a id="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</nav>
<p class="legalCopy"><small>Copyright © 2021. All rights reserved.</small></p>
</footer>
</body>
</html>
| 51.281003 | 2,164 | 0.693422 |
721bc6dba4bbbf917db14e128c3be2a5360d2169 | 257 | rs | Rust | bls12_381/src/fields/fr.rs | mmagician/curves | 5a1e16e2b7719b29d6e0439f511f3796b5bad982 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-11-17T17:38:21.000Z | 2021-11-17T17:38:21.000Z | bls12_381/src/fields/fr.rs | mmagician/curves | 5a1e16e2b7719b29d6e0439f511f3796b5bad982 | [
"Apache-2.0",
"MIT"
] | 8 | 2022-01-06T18:28:42.000Z | 2022-03-04T06:56:14.000Z | test-curves/src/bls12_381/fr.rs | mmagician/algebra | bf1e24211df2be1ee317e382aa128281766e9c1f | [
"Apache-2.0",
"MIT"
] | 1 | 2021-11-17T17:38:13.000Z | 2021-11-17T17:38:13.000Z | use ark_ff::fields::{Fp256, MontBackend, MontConfig};
#[derive(MontConfig)]
#[modulus = "52435875175126190479447740508185965837690552500527637822603658699938581184513"]
#[generator = "7"]
pub struct FrConfig;
pub type Fr = Fp256<MontBackend<FrConfig, 4>>;
| 32.125 | 92 | 0.785992 |
e00f9bd8011841237e304a672b76ce63b18e3e0c | 1,706 | sql | SQL | Database/Install/0001_Create_Tables.sql | Ujinjinjin/JFS | f1aee07ea4a32748f650be82916e7b952cd3b153 | [
"MIT"
] | null | null | null | Database/Install/0001_Create_Tables.sql | Ujinjinjin/JFS | f1aee07ea4a32748f650be82916e7b952cd3b153 | [
"MIT"
] | null | null | null | Database/Install/0001_Create_Tables.sql | Ujinjinjin/JFS | f1aee07ea4a32748f650be82916e7b952cd3b153 | [
"MIT"
] | null | null | null | CREATE TABLE Profile (
id INTEGER CONSTRAINT pk_profile PRIMARY KEY AUTOINCREMENT,
name TEXT UNIQUE NOT NULL,
active BOOLEAN NOT NULL
);
CREATE TABLE Sync (
id INTEGER CONSTRAINT pk_sync PRIMARY KEY AUTOINCREMENT,
jira_key TEXT NOT NULL,
tfs_id INTEGER NOT NULL,
rev INTEGER NOT NULL,
deleted BOOLEAN DEFAULT FALSE,
-- Temporary fields, till the better days
title TEXT NOT NULL,
descr TEXT,
priority INTEGER,
UNIQUE (jira_key, tfs_id)
ON CONFLICT FAIL
);
CREATE TABLE TfsConfig (
id INTEGER CONSTRAINT pk_tfs_config PRIMARY KEY AUTOINCREMENT,
priority INTEGER NOT NULL,
parent_id INTEGER NOT NULL,
sprint TEXT NOT NULL,
area TEXT NOT NULL,
team_project TEXT NOT NULL
);
CREATE TABLE JiraConfig (
id INTEGER CONSTRAINT pk_jira_config PRIMARY KEY AUTOINCREMENT,
priority TEXT NOT NULL,
sprint TEXT NOT NULL,
project TEXT NOT NULL
);
CREATE TABLE Config (
id INTEGER CONSTRAINT pk_config PRIMARY KEY AUTOINCREMENT,
tfs_config_id INTEGER NOT NULL REFERENCES TfsConfig (id),
jira_config_id INTEGER NOT NULL REFERENCES JiraConfig (id),
profile_id INTEGER NOT NULL REFERENCES Profile (id)
);
CREATE INDEX idx_config__jira_config
ON config (jira_config_id);
CREATE INDEX idx_config__profile
ON config (profile_id);
CREATE INDEX idx_config__tfs_config
ON config (tfs_config_id);
CREATE TABLE Priority (
id INTEGER CONSTRAINT pk_priority PRIMARY KEY AUTOINCREMENT,
tfs_priority INTEGER UNIQUE,
jira_priority TEXT UNIQUE
); | 29.413793 | 76 | 0.677608 |
75d377b99a0d4cf3e81bd16eb6670d39cd69a983 | 1,902 | rs | Rust | src/utility/vkstuff/vksemaphore.rs | gwowen/rust-vk-playground | 649196ba316459de514b9ffa03f1563212b3f043 | [
"MIT"
] | null | null | null | src/utility/vkstuff/vksemaphore.rs | gwowen/rust-vk-playground | 649196ba316459de514b9ffa03f1563212b3f043 | [
"MIT"
] | null | null | null | src/utility/vkstuff/vksemaphore.rs | gwowen/rust-vk-playground | 649196ba316459de514b9ffa03f1563212b3f043 | [
"MIT"
] | null | null | null | use ash::version::DeviceV1_0;
use ash::version::EntryV1_0;
use ash::version::InstanceV1_0;
use ash::vk;
use std::ffi::CString;
use std::os::raw::c_char;
use std::os::raw::c_void;
use std::path::Path;
use std::ptr;
use crate::utility::constants::*;
use crate::utility::debug;
use crate::utility::platforms;
use crate::utility::structures::*;
pub fn create_sync_objects(device: &ash::Device, max_frame_in_flight: usize) -> SyncObjects {
let mut sync_objects = SyncObjects {
image_available_semaphores: vec![],
render_finished_semaphores: vec![],
inflight_fences: vec![],
};
let semaphore_create_info = vk::SemaphoreCreateInfo {
s_type: vk::StructureType::SEMAPHORE_CREATE_INFO,
p_next: ptr::null(),
flags: vk::SemaphoreCreateFlags::empty(),
};
let fence_create_info = vk::FenceCreateInfo {
s_type: vk::StructureType::FENCE_CREATE_INFO,
p_next: ptr::null(),
flags: vk::FenceCreateFlags::SIGNALED,
};
for _ in 0..max_frame_in_flight {
unsafe {
let image_available_semaphore = device
.create_semaphore(&semaphore_create_info, None)
.expect("Failed to create Semaphore Object!");
let render_finished_semaphore = device
.create_semaphore(&semaphore_create_info, None)
.expect("Failed to create Semaphore Object!");
let inflight_fence = device
.create_fence(&fence_create_info, None)
.expect("Failed to create Fence Object!");
sync_objects
.image_available_semaphores
.push(image_available_semaphore);
sync_objects
.render_finished_semaphores
.push(render_finished_semaphore);
sync_objects.inflight_fences.push(inflight_fence);
}
}
sync_objects
} | 32.237288 | 93 | 0.633018 |
6d3139105a39d74027c2fe27105f119b45d5ea1e | 20,160 | asm | Assembly | 3d/interp.asm | arbruijn/d1dos | 00b969f31fd475530e7e24d7e9759c70705634e0 | [
"Unlicense"
] | 2 | 2022-01-15T17:56:45.000Z | 2022-02-16T17:58:02.000Z | 3d/interp.asm | arbruijn/d1dos | 00b969f31fd475530e7e24d7e9759c70705634e0 | [
"Unlicense"
] | 1 | 2022-02-16T18:08:42.000Z | 2022-02-21T07:42:27.000Z | 3d/interp.asm | arbruijn/d1dos | 00b969f31fd475530e7e24d7e9759c70705634e0 | [
"Unlicense"
] | null | null | null | ;THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
;SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
;END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
;ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
;IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
;SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
;FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
;CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
;AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
;COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
;
; $Source: f:/miner/source/3d/rcs/interp.asm $
; $Revision: 1.21 $
; $Author: john $
; $Date: 1994/10/26 23:57:49 $
;
; Polygon object interpreter
;
; $Log: interp.asm $
; Revision 1.21 1994/10/26 23:57:49 john
; Took out gr_inverse_table
;
; Revision 1.20 1994/09/26 14:43:31 matt
; Put in checks for faces with fewer than 3 vertices
;
; Revision 1.19 1994/09/09 14:24:14 matt
; Added support for glowing textures, to add engine glow to Descent.
;
; Revision 1.18 1994/08/26 16:42:03 matt
; Added check for how many textures used in an object
;
; Revision 1.17 1994/07/29 18:29:17 matt
; Use instance-by-angles code, instead of building matrix here
;
; Revision 1.16 1994/07/25 10:58:28 matt
; Fixed morph effect for new 3d point handling
;
; Revision 1.15 1994/07/25 00:00:07 matt
; Made 3d no longer deal with point numbers, but only with pointers.
;
; Revision 1.14 1994/07/22 17:57:59 matt
; Changed the name of the rod functions, and took out some debugging code
;
; Revision 1.13 1994/06/07 16:49:36 matt
; Made interpreter take lighting value as parm, rather than in global var
;
; Revision 1.12 1994/05/31 22:11:52 matt
; Fixed morphing object lighting
;
; Revision 1.11 1994/05/31 18:35:52 matt
; Added lighting back to polygon objects
;
; Revision 1.10 1994/05/31 16:03:55 matt
; Made uvls right for triangulated faces in morphing objects
;
; Revision 1.9 1994/05/30 22:48:34 matt
; Added support for morph effect
;
; Revision 1.8 1994/05/19 23:12:04 matt
; Support new uvl value ranges
;
; Revision 1.7 1994/04/29 15:39:46 matt
; Use ebx in one place because the assembler seemed to be using it anyway
; even though I typed just bx.
;
; Revision 1.6 1994/04/19 17:02:32 matt
; Made g3d_interp_outline var accessible by C
;
; Revision 1.5 1994/03/30 10:22:40 matt
; Added outline option for polygon models
;
; Revision 1.4 1994/03/25 18:23:51 matt
; Fixed a couple of subobject problems, and made g3_draw_polygon_model
; take a pointer to a list of angvecs for subobj animation.
;
; Revision 1.3 1994/03/18 16:07:57 matt
; Added subobject and rod bitmap opcodes
;
; Revision 1.2 1994/03/15 21:23:04 matt
; Added code
;
; Revision 1.1 1994/03/14 21:26:56 matt
; Initial revision
;
;
.386
option oldstructs
.nolist
include types.inc
include psmacros.inc
include gr.inc
include 3d.inc
.list
assume cs:_TEXT, ds:_DATA
_DATA segment dword public USE32 'DATA'
rcsid db "$Id: interp.asm 1.21 1994/10/26 23:57:49 john Exp $"
align 4
;table with address for each opcode
opcode_table dd op_eof ;0 = eof
dd op_defpoints ;1 = defpoints
dd op_flatpoly ;2 = flat-shaded polygon
dd op_tmappoly ;3 = texture-mapped polygon
dd op_sortnorm ;4 = sort by normal
dd op_rodbm ;5 = rod bitmap
dd op_subcall ;6 = call a subobject
dd op_defp_start ;7 = defpoints with start
dd op_glow ;8 = glow value for next poly
n_opcodes = ($-opcode_table)/4
bitmap_ptr dd ?
anim_angles dd ? ;pointer to angle data
morph_points dd ? ;alternate points for morph
;light value for the next tmap
glow_num dd -1 ;-1 means off
glow_values dd ? ;ptr to array of values
public _highest_texture_num
_highest_texture_num dw 0
zero_angles fixang 0,0,0 ;vms_angvec <0,0,0> ;for if no angles specified
rod_top_p g3s_point <>
rod_bot_p g3s_point <>
ifndef NDEBUG
public g3d_interp_outline,_g3d_interp_outline
_g3d_interp_outline label dword
g3d_interp_outline dd 0
endif
morph_pointlist dd ?,?,?
morph_uvls fix 3 dup (?,?,?)
;the light for the current model
model_light fix ?
;ptr to array of points
Interp_point_list dd ?
MAX_POINTS_PER_POLY = 25
point_list dd MAX_POINTS_PER_POLY dup (?)
_DATA ends
_TEXT segment dword public USE32 'CODE'
;get and jump to next opcode
next macro
xor ebx,ebx
mov bx,[ebp]
ifndef NDEBUG
cmp ebx,n_opcodes
break_if ge,'Invalid opcode'
endif
mov ebx,opcode_table[ebx*4]
jmp ebx
endm
;get and call the next opcode
call_next macro
xor ebx,ebx
mov bx,[ebp]
ifndef NDEBUG
cmp ebx,n_opcodes
break_if ge,'Invalid opcode'
endif
mov ebx,opcode_table[ebx*4]
call ebx
endm
;give the interpreter an array of points to use
g3_set_interp_points:
mov Interp_point_list,eax
ret
;interpreter to draw polygon model
;takes esi=ptr to object, edi=ptr to array of bitmap pointers,
;eax=ptr to anim angles, edx=light value, ebx=ptr to array of glow values
g3_draw_polygon_model:
pushm eax,ebx,ecx,edx,esi,edi,ebp
mov ebp,esi ;ebp = interp ptr
mov bitmap_ptr,edi ;save ptr to bitmap array
mov anim_angles,eax
mov model_light,edx
mov glow_values,ebx
mov glow_num,-1
;;@@ mov depth,0
call_next
popm eax,ebx,ecx,edx,esi,edi,ebp
ret
;handlers for opcodes
;end of a model or sub-rountine
op_eof: ret
;define a list of points
op_defpoints: xor ecx,ecx
mov cx,2[ebp] ;num points
mov edi,Interp_point_list
lea esi,4[ebp]
rotate_loop: call g3_rotate_point
add edi,size g3s_point
add esi,size vms_vector
dec ecx
jnz rotate_loop
mov ebp,esi
next
;define a list of points, with starting point num specified
op_defp_start: xor ecx,ecx
xor eax,eax
mov ax,w 4[ebp] ;starting point num
imulc eax,size(g3s_point) ;get ofs of point
;changed the above line from "size g3s_point" to "size(g3s_point)" to make the compiler happy -KRB
add eax,Interp_point_list
mov edi,eax
mov cx,2[ebp] ;num points
lea esi,8[ebp]
jmp rotate_loop
next
;draw a flat-shaded polygon
op_flatpoly: xor ecx,ecx
mov cx,2[ebp] ;num verts
lea esi,4[ebp] ;point
lea edi,16[ebp] ;vector
call g3_check_normal_facing
jng flat_not_facing
;polygon is facing, so draw it
xor eax,eax
mov ax,28[ebp] ;get color
call gr_setcolor_ ;set it
lea esi,30[ebp] ;point number list
;make list of point pointers
ifndef NDEBUG
cmp ecx,MAX_POINTS_PER_POLY
break_if ge,'Too many points in interp poly'
endif
lea edi,point_list
xor ebx,ebx
copy_loop: xor eax,eax
mov ax,w [esi+ebx*2] ;get point number
imulc eax,size(g3s_point);Modified to add Parentheses -KRB
add eax,Interp_point_list
mov [edi+ebx*4],eax
inc ebx
cmp ebx,ecx
jne copy_loop
mov esi,edi
call g3_draw_poly
xor ecx,ecx
mov cx,2[ebp] ;restore count
ifndef NDEBUG
test g3d_interp_outline,-1
jz no_outline
pushm ecx,esi
lea esi,30[ebp]
call draw_outline
popm ecx,esi
no_outline:
endif
;polygon is not facing (or we've plotted it). jump to next opcode
flat_not_facing: and ecx,0fffffffeh
inc ecx ;adjust for pad
lea ebp,30[ebp+ecx*2]
next
;set the glow value for the next tmap
op_glow: test glow_values,-1
jz skip_glow
xor eax,eax
mov ax,2[ebp]
mov glow_num,eax
skip_glow: add ebp,4
next
;draw a texture map
op_tmappoly: xor ecx,ecx
mov cx,2[ebp] ;num verts
lea esi,4[ebp] ;point
lea edi,16[ebp] ;normal
call g3_check_normal_facing
jng tmap_not_facing
;polygon is facing, so draw it
xor edx,edx
mov dx,28[ebp] ;get bitmap number
mov eax,bitmap_ptr
mov edx,[eax+edx*4]
lea esi,30[ebp] ;point number list
mov eax,ecx
and eax,0fffffffeh
inc eax
lea ebx,30[ebp+eax*2] ;get uvl list
;calculate light from surface normal
push esi
test glow_num,-1 ;glow override?
js no_glow
;special glow lighting, which doesn't care about surface normal
mov eax,glow_num
mov esi,glow_values
mov eax,[esi+eax*4]
mov glow_num,-1
jmp got_light_value
no_glow:
lea esi,View_matrix.fvec
lea edi,16[ebp] ;normal
call vm_vec_dotprod
neg eax
;scale light by model light
push edx
mov edx,eax
add eax,eax
add eax,edx ;eax *= 3
sar eax,2 ;eax *= 3/4
add eax,f1_0/4 ;eax = 1/4 + eax * 3/4
fixmul model_light
pop edx
;now poke light into l values
got_light_value: pushm ecx,ebx
l_loop: mov 8[ebx],eax
add ebx,12
dec ecx
jnz l_loop
popm ecx,ebx
pop esi
;now draw it
;make list of point pointers
ifndef NDEBUG
cmp ecx,MAX_POINTS_PER_POLY
break_if ge,'Too many points in interp poly'
endif
push ebx
lea edi,point_list
xor ebx,ebx
copy_loop2: xor eax,eax
mov ax,w [esi+ebx*2] ;get point number
imulc eax,size(g3s_point);;Modified to add Parentheses -KRB
add eax,Interp_point_list
mov [edi+ebx*4],eax
inc ebx
cmp ebx,ecx
jne copy_loop2
mov esi,edi
pop ebx
call g3_draw_tmap
xor ecx,ecx
mov cx,2[ebp] ;restore count
ifndef NDEBUG
test g3d_interp_outline,-1
jz no_outline2
pushm ecx,esi
lea esi,30[ebp]
call draw_outline
popm ecx,esi
no_outline2:
endif
;polygon is not facing (or we've plotted it). jump to next opcode
tmap_not_facing: mov ebx,ecx
and ebx,0fffffffeh
inc ebx ;adjust for pad
lea ebp,30[ebp+ebx*2]
mov eax,ecx
sal ecx,1
add ecx,eax
sal ecx,2 ;ecx=ecx*12
add ebp,ecx ;point past uvls
next
;sort based on surface normal
op_sortnorm: lea esi,16[ebp] ;point
lea edi,4[ebp] ;vector
call g3_check_normal_facing
jng sortnorm_not_facing
;is facing. draw back then front
push ebp
xor eax,eax
mov ax,30[ebp] ;get back offset
add ebp,eax
call_next
mov ebp,[esp] ;get ebp
xor eax,eax
mov ax,28[ebp] ;get front offset
add ebp,eax
call_next
pop ebp
lea ebp,32[ebp]
next
;is not facing. draw front then back
sortnorm_not_facing:
push ebp
xor eax,eax
mov ax,28[ebp] ;get back offset
add ebp,eax
call_next
mov ebp,[esp] ;get ebp
xor eax,eax
mov ax,30[ebp] ;get front offset
add ebp,eax
call_next
pop ebp
lea ebp,32[ebp]
next
;draw a rod bitmap
op_rodbm: lea esi,20[ebp] ;bot point
lea edi,rod_bot_p
call g3_rotate_point
lea esi,4[ebp] ;top point
lea edi,rod_top_p
call g3_rotate_point
lea esi,rod_bot_p ;esi=bot, edi=top
mov eax,16[ebp] ;bot width
mov edx,32[ebp] ;top width
xor ebx,ebx
mov bx,2[ebp] ;get bitmap number
mov ecx,bitmap_ptr
mov ebx,[ecx+ebx*4]
call g3_draw_rod_tmap
lea ebp,36[ebp]
next
;draw a subobject
op_subcall: xor eax,eax
mov ax,2[ebp] ;get object number
;get ptr to angles
mov edi,anim_angles
or edi,edi
jnz angles_not_null
;angles not specified. Use zero angles
lea edi,zero_angles
jmp got_angles
angles_not_null:
imulc eax,size(vms_angvec);Modified to add Parentheses -KRB
add edi,eax
got_angles:
;angles in edi
lea esi,4[ebp] ;get position
call g3_start_instance_angles
push ebp
xor eax,eax
mov ax,16[ebp]
add ebp,eax ;offset of subobject
call_next ;draw the subobject
pop ebp
call g3_done_instance
lea ebp,20[ebp]
next
;initialize a polygon object
;translate colors, scale UV values
;takes esi=ptr to model
g3_init_polygon_model:
mov _highest_texture_num,-1
pushm eax,ebx,ecx,edx,esi,edi
call init_loop
popm eax,ebx,ecx,edx,esi,edi
ret
init_loop: mov ax,[esi] ;get opcode
cmp ax,0 ;eof
jne not_eof
ret
not_eof:
;defpoints
cmp ax,1 ;defpoints
jne not_defpoints
xor eax,eax
mov ax,2[esi] ;get count
sal eax,1
add ax,2[esi] ;*3
lea esi,4[esi+eax*4]
jmp init_loop
not_defpoints:
;flat polygon
cmp ax,2
jne not_flatpoly
ifndef NDEBUG
cmp w 2[esi],3
break_if l,'face must have 3 or more points'
endif
;NO_INVERSE_TABLE xor ebx,ebx
;NO_INVERSE_TABLE mov bx,28[esi] ;get color
;NO_INVERSE_TABLE xor eax,eax
;NO_INVERSE_TABLE mov al,gr_inverse_table[ebx] ;xlate it
; The following 3 lines replace the above
xor eax, eax
mov ax,28[esi] ;get color
call gr_find_closest_color_15bpp_
mov 28[esi],ax ;store new color
xor ecx,ecx
mov cx,2[esi] ;get nverts
and ecx,0fffffffeh
inc ecx ;adjust for pad
lea esi,30[esi+ecx*2]
jmp init_loop
not_flatpoly:
;tmap polygon
cmp ax,3
jne not_tmappoly
ifndef NDEBUG
cmp w 2[esi],3
break_if l,'face must have 3 or more points'
endif
mov ax,28[esi] ;get bitmap number
cmp ax,_highest_texture_num
jle not_new
mov _highest_texture_num,ax
not_new: xor ecx,ecx
mov cx,2[esi] ;get nverts
mov ebx,ecx
and ebx,0fffffffeh
inc ebx ;adjust for pad
lea esi,30[esi+ebx*2] ;point at uvls
imul ecx,12 ;size of uvls
add esi,ecx ;skip them
jmp init_loop
;;@@init_uv_loop: mov eax,[esi] ;get u
;;@@ imul eax,64 ;times bitmap w
;;@@ mov [esi],eax
;;@@ mov eax,4[esi] ;get v
;;@@ imul eax,64 ;times bitmap h
;;@@ mov 4[esi],eax
;;@@ add esi,12 ;point at next
;;@@ dec ecx
;;@@ jnz init_uv_loop
;;@@ jmp init_loop
not_tmappoly:
;sort
cmp ax,4 ;sortnorm
jne not_sortnorm
push esi
xor eax,eax
mov ax,28[esi] ;get front offset
add esi,eax
call init_loop
mov esi,[esp]
xor eax,eax
mov ax,30[esi] ;get front offset
add esi,eax
call init_loop
pop esi
lea esi,32[esi]
jmp init_loop
not_sortnorm:
cmp ax,5
jne not_rodbm
add esi,36
jmp init_loop
not_rodbm:
cmp ax,6
jne not_subcall
push esi
xor eax,eax
mov ax,16[esi] ;get subobj offset
add esi,eax
call init_loop
pop esi
add esi,20
jmp init_loop
not_subcall:
cmp ax,7 ;defpoints
jne not_defpoints_st
xor eax,eax
mov ax,2[esi] ;get count
sal eax,1
add ax,2[esi] ;*3
lea esi,8[esi+eax*4]
jmp init_loop
not_defpoints_st:
cmp ax,8
jne not_glow
add esi,4
jmp init_loop
not_glow:
debug_brk "Invalid opcode"
jmp init_loop
;takes ecx=count, esi=ptr to point list
draw_outline: pushm eax,ebx,ecx,edx,esi,edi
;NO_INVERSE_TABLE xor eax,eax
;NO_INVERSE_TABLE mov al,gr_inverse_table[7fffh] ;white
mov eax, 255 ; bright white
call gr_setcolor_
mov ebx,esi
xor eax,eax
mov ax,[ebx] ;get first point
push eax ;save it
outline_loop: xor esi,esi
xor edi,edi
mov si,[ebx]
dec ecx
jz done_loop
mov di,2[ebx]
push ebx
imul esi,size g3s_point
add esi,Interp_point_list
imul edi,size g3s_point
add edi,Interp_point_list
call g3_draw_line
pop ebx
add ebx,2
jmp outline_loop
done_loop: pop edi ;get first point back
imul esi,size g3s_point
add esi,Interp_point_list
imul edi,size g3s_point
add edi,Interp_point_list
call g3_draw_line
popm eax,ebx,ecx,edx,esi,edi
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Special code to draw morphing objects
;define a list of points
morph_defpoints: xor ecx,ecx
mov cx,2[ebp] ;num points
mov edi,Interp_point_list
lea esi,4[ebp]
morph_rotate_list: lea eax,[ecx*2+ecx] ;eax=npoint * 3
lea esi,[esi+eax*4] ;point past points
push esi
mov esi,morph_points ;get alternate points
morph_rotate_loop: call g3_rotate_point
add edi,size g3s_point
add esi,size vms_vector
dec ecx
jnz morph_rotate_loop
pop esi ;restore pointer
mov ebp,esi
next
;define a list of points, with starting point num specified
morph_defp_start: xor ecx,ecx
xor eax,eax
mov ax,w 4[ebp] ;starting point num
imulc eax,size(g3s_point);Modified to add Parentheses -KRB ;get ofs of point
add eax,Interp_point_list
mov edi,eax
mov cx,2[ebp] ;num points
lea esi,8[ebp]
jmp morph_rotate_list
;draw a flat-shaded polygon
morph_flatpoly: xor ecx,ecx
mov cx,2[ebp] ;num verts
lea esi,4[ebp] ;point
lea edi,16[ebp] ;vector
;set color
xor eax,eax
mov ax,28[ebp] ;get color
call gr_setcolor_ ;set it
;check and draw
lea esi,30[ebp] ;point number list
xor eax,eax
lodsw
imulc eax,size(g3s_point);Modified to add Parentheses -KRB
add eax,Interp_point_list
mov morph_pointlist,eax
xor eax,eax
lodsw
imulc eax,size(g3s_point);Modified to add Parentheses -KRB
add eax,Interp_point_list
mov morph_pointlist+4,eax
xor eax,eax
lodsw
imulc eax,size(g3s_point);Modified to add Parentheses -KRB
add eax,Interp_point_list
mov morph_pointlist+8,eax
cmp ecx,3 ;3 points is good!
je flat_got3
sub ecx,2 ;tri count
flat_tri_loop: xor edi,edi ;no normal, must compute
pushm ecx,esi
mov ecx,3 ;always draw triangle
lea esi,morph_pointlist
call g3_check_and_draw_poly
popm ecx,esi
mov eax,morph_pointlist+8
mov morph_pointlist+4,eax
xor eax,eax
lodsw
imulc eax,size(g3s_point);Modified to add Parentheses -KRB
add eax,Interp_point_list
mov morph_pointlist+8,eax
dec ecx
jnz flat_tri_loop
jmp flat_done_draw
flat_got3:
lea esi,morph_pointlist
xor edi,edi ;no normal, must compute
call g3_check_and_draw_poly
flat_done_draw: xor ecx,ecx
mov cx,2[ebp] ;restore count
and ecx,0fffffffeh
inc ecx ;adjust for pad
lea ebp,30[ebp+ecx*2]
next
;draw a texture map
morph_tmappoly: xor ecx,ecx
mov cx,2[ebp] ;num verts
lea esi,4[ebp] ;point
lea edi,16[ebp] ;normal
;get bitmap
xor edx,edx
mov dx,28[ebp] ;get bitmap number
mov eax,bitmap_ptr
mov edx,[eax+edx*4]
lea esi,30[ebp] ;point number list
mov eax,ecx
and eax,0fffffffeh
inc eax
lea ebx,30[ebp+eax*2] ;get uvl list
;calculate light from surface normal
push esi
lea esi,View_matrix.fvec
lea edi,16[ebp] ;normal
call vm_vec_dotprod
neg eax
;scale light by model light
push edx
mov edx,eax
add eax,eax
add eax,edx ;eax *= 3
sar eax,2 ;eax *= 3/4
add eax,f1_0/4 ;eax = 1/4 + eax * 3/4
fixmul model_light
or eax,eax
jge not_zero
xor eax,eax
not_zero:
pop edx
pop esi
;now eax=plane light value
mov morph_uvls+8,eax
mov morph_uvls+20,eax
mov morph_uvls+32,eax
xor eax,eax
lodsw
imulc eax,size(g3s_point);Modified to add Parentheses -KRB
add eax,Interp_point_list
mov morph_pointlist,eax
xor eax,eax
lodsw
imulc eax,size(g3s_point);Modified to add Parentheses -KRB
add eax,Interp_point_list
mov morph_pointlist+4,eax
xor eax,eax
lodsw
imulc eax,size(g3s_point);Modified to add Parentheses -KRB
add eax,Interp_point_list
mov morph_pointlist+8,eax
cmp ecx,3 ;3 points is good!
jl tmap_done_draw ;something is bad, abort
je tmap_got3
sub ecx,2 ;tri count
push edx
mov edx,[ebx]
mov morph_uvls,edx
mov edx,4[ebx]
mov morph_uvls+4,edx
mov edx,12[ebx]
mov morph_uvls+12,edx
mov edx,16[ebx]
mov morph_uvls+16,edx
mov edx,24[ebx]
mov morph_uvls+24,edx
mov edx,28[ebx]
mov morph_uvls+28,edx
add ebx,3*12
pop edx
tmap_tri_loop: xor edi,edi ;no normal, must compute
pushm ebx,edx,ecx,esi
mov ecx,3 ;always draw triangle
lea esi,morph_pointlist
lea ebx,morph_uvls
call g3_check_and_draw_tmap
popm ebx,edx,ecx,esi
mov eax,morph_pointlist+8
mov morph_pointlist+4,eax
xor eax,eax
lodsw
imulc eax,size(g3s_point);Modified to add Parentheses -KRB
add eax,Interp_point_list
mov morph_pointlist+8,eax
push edx
mov edx,morph_uvls+24
mov morph_uvls+12,edx
mov edx,morph_uvls+28
mov morph_uvls+16,edx
mov edx,[ebx]
mov morph_uvls+24,edx
mov edx,4[ebx]
mov morph_uvls+28,edx
add ebx,12
pop edx
dec ecx
jnz tmap_tri_loop
jmp tmap_done_draw
tmap_got3:
;poke in light values
pusha
tmap_l_loop: mov 8[ebx],eax
add ebx,12
dec ecx
jnz tmap_l_loop
popa
lea esi,morph_pointlist
xor edi,edi ;no normal
call g3_check_and_draw_tmap
tmap_done_draw: xor ecx,ecx
mov cx,2[ebp] ;restore count
;jump to next opcode
mov ebx,ecx
and ebx,0fffffffeh
inc ebx ;adjust for pad
lea ebp,30[ebp+ebx*2]
mov eax,ecx
sal ecx,1
add ecx,eax
sal ecx,2 ;ecx=ecx*12
add ebp,ecx ;point past uvls
next
;interpreter to draw polygon model
;takes esi=ptr to object, edi=ptr to array of bitmap pointers,
;eax=ptr to anim angles, ebx=alternate points, edx=light value
g3_draw_morphing_model:
pushm eax,ebx,ecx,edx,esi,edi,ebp
mov bitmap_ptr,edi ;save ptr to bitmap array
mov anim_angles,eax
mov morph_points,ebx
mov model_light,edx
mov ebp,esi ;ebp = interp ptr
;set alternate opcode pointers
push opcode_table[1*4] ;defpoints
push opcode_table[2*4] ;flatpoly
push opcode_table[3*4] ;tmappoly
push opcode_table[7*4] ;defp_start
mov opcode_table[1*4],offset morph_defpoints
mov opcode_table[2*4],offset morph_flatpoly
mov opcode_table[3*4],offset morph_tmappoly
mov opcode_table[7*4],offset morph_defp_start
call_next
pop opcode_table[7*4] ;defp_start
pop opcode_table[3*4] ;tmappoly
pop opcode_table[2*4] ;flatpoly
pop opcode_table[1*4] ;defpoints
popm eax,ebx,ecx,edx,esi,edi,ebp
ret
_TEXT ends
end
| 20.18018 | 99 | 0.739286 |
54d6088f88432a1a75adc69129723aa0be64a3f9 | 587 | asm | Assembly | programs/oeis/007/A007093.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/007/A007093.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/007/A007093.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A007093: Numbers in base 7.
; Coded manually 2021-05-07 by Simon Strandgaard, https://github.com/neoneye
; 0,1,2,3,4,5,6,10,11,12,13,14,15,16,20,21,22,23,24,25,26,30,31,32,33,34,35,36,40,41,42,43,44,45,46,50,51,52,53,54,55,56,60,61,62,63,64,65,66,100,101,102,103,104,105,106,110,111,112,113,114,115,116,120
mov $3,1 ; Scale factor for first digit
lpb $0
mov $2,$0
mod $2,7 ; Extract the lowest base 7 digit
mul $2,$3 ; Convert from base 7 to 10
add $1,$2 ; Insert into result
div $0,7 ; Remove the lowest base 7 digit
mul $3,10 ; Scale factor for next digit
lpe
mov $0,$1
| 39.133333 | 201 | 0.679727 |
2323c387f90007034ae0dbf7c3f76361b125ec31 | 15,036 | rs | Rust | object/src/mem.rs | cozyDoomer/dicom-rs | cdcc2b1326ab5a216a944dfd72e94a10da409aab | [
"Apache-2.0",
"MIT"
] | null | null | null | object/src/mem.rs | cozyDoomer/dicom-rs | cdcc2b1326ab5a216a944dfd72e94a10da409aab | [
"Apache-2.0",
"MIT"
] | null | null | null | object/src/mem.rs | cozyDoomer/dicom-rs | cdcc2b1326ab5a216a944dfd72e94a10da409aab | [
"Apache-2.0",
"MIT"
] | null | null | null | //! This module contains the implementation for an in-memory DICOM object.
use itertools::Itertools;
use smallvec::SmallVec;
use std::collections::BTreeMap;
use std::fs::File;
use std::io::{BufReader, Read};
use std::path::Path;
use crate::meta::FileMetaTable;
use crate::{DicomObject, RootDicomObject};
use dicom_core::dictionary::{DataDictionary, DictionaryEntry};
use dicom_core::header::Header;
use dicom_core::value::{DicomValueType, Value, ValueType, C};
use dicom_core::{DataElement, Length, Tag, VR};
use dicom_dictionary_std::StandardDataDictionary;
use dicom_encoding::text::SpecificCharacterSet;
use dicom_encoding::transfer_syntax::TransferSyntaxIndex;
use dicom_parser::dataset::{DataSetReader, DataToken};
use dicom_parser::error::{DataSetSyntaxError, Error, Result};
use dicom_parser::parser::Parse;
use dicom_transfer_syntax_registry::TransferSyntaxRegistry;
/// A full in-memory DICOM data element.
pub type InMemElement<D> = DataElement<InMemDicomObject<D>>;
/** A DICOM object that is fully contained in memory.
*/
#[derive(Debug, Clone)]
pub struct InMemDicomObject<D> {
/// the element map
entries: BTreeMap<Tag, InMemElement<D>>,
/// the data dictionary
dict: D,
/// The length of the DICOM object in bytes.
/// It is usually undefined, unless it is part of an item
/// in a sequence with a specified length in its item header.
len: Length,
}
impl<'s, D> PartialEq for InMemDicomObject<D> {
// This implementation ignores the data dictionary.
fn eq(&self, other: &Self) -> bool {
self.entries == other.entries
}
}
impl<D> DicomValueType for InMemDicomObject<D> {
fn value_type(&self) -> ValueType {
ValueType::Item
}
fn size(&self) -> Length {
self.len
}
}
impl<'s, D: 's> DicomObject for &'s InMemDicomObject<D>
where
D: DataDictionary,
D: Clone,
{
type Element = &'s InMemElement<D>;
fn element(&self, tag: Tag) -> Result<Self::Element> {
self.entries.get(&tag).ok_or(Error::NoSuchDataElement)
}
fn element_by_name(&self, name: &str) -> Result<Self::Element> {
let tag = self.lookup_name(name)?;
self.element(tag)
}
}
impl RootDicomObject<InMemDicomObject<StandardDataDictionary>> {
/// Create a DICOM object by reading from a file.
///
/// This function assumes the standard file encoding structure: 128-byte
/// preamble, file meta group, and the rest of the data set.
pub fn open_file<P: AsRef<Path>>(path: P) -> Result<Self> {
Self::open_file_with_dict(path, StandardDataDictionary)
}
/// Create a DICOM object by reading from a byte source.
///
/// This function assumes the standard file encoding structure without the
/// preamble: file meta group, followed by the rest of the data set.
pub fn from_reader<S>(src: S) -> Result<Self>
where
S: Read,
{
Self::from_reader_with_dict(src, StandardDataDictionary)
}
}
impl InMemDicomObject<StandardDataDictionary> {
/// Create a new empty DICOM object.
pub fn create_empty() -> Self {
InMemDicomObject {
entries: BTreeMap::new(),
dict: StandardDataDictionary,
len: Length::UNDEFINED,
}
}
/// Construct a DICOM object from an iterator of structured elements.
pub fn from_element_iter<I>(iter: I) -> Result<Self>
where
I: IntoIterator<Item = Result<InMemElement<StandardDataDictionary>>>,
{
Self::from_iter_with_dict(iter, StandardDataDictionary)
}
}
impl<D> RootDicomObject<InMemDicomObject<D>>
where
D: DataDictionary,
D: Clone,
{
/// Create a new empty object, using the given dictionary and
/// file meta table.
pub fn new_empty_with_dict_and_meta(dict: D, meta: FileMetaTable) -> Self {
RootDicomObject {
meta,
obj: InMemDicomObject {
entries: BTreeMap::new(),
dict,
len: Length::UNDEFINED,
},
}
}
/// Create a DICOM object by reading from a file.
///
/// This function assumes the standard file encoding structure: 128-byte
/// preamble, file meta group, and the rest of the data set.
pub fn open_file_with_dict<P: AsRef<Path>>(path: P, dict: D) -> Result<Self> {
Self::open_file_with(path, dict, TransferSyntaxRegistry)
}
/// Create a DICOM object by reading from a file.
///
/// This function assumes the standard file encoding structure: 128-byte
/// preamble, file meta group, and the rest of the data set.
///
/// This function allows you to choose a different transfer syntax index,
/// but its use is only advised when the built-in transfer syntax registry
/// is insufficient. Otherwise, please use [`open_file_with_dict`] instead.
///
/// [`open_file_with_dict`]: #method.open_file_with_dict
pub fn open_file_with<P: AsRef<Path>, R>(path: P, dict: D, ts_index: R) -> Result<Self>
where
P: AsRef<Path>,
R: TransferSyntaxIndex,
{
let mut file = BufReader::new(File::open(path)?);
// skip preamble
{
let mut buf = [0u8; 128];
// skip the preamble
file.read_exact(&mut buf)?;
}
// read metadata header
let meta = FileMetaTable::from_reader(&mut file)?;
// read rest of data according to metadata, feed it to object
let ts = ts_index
.get(&meta.transfer_syntax)
.ok_or(Error::UnsupportedTransferSyntax)?;
let cs = SpecificCharacterSet::Default;
let mut dataset = DataSetReader::new_with_dictionary(file, dict.clone(), ts, cs)?;
Ok(RootDicomObject {
meta,
obj: InMemDicomObject::build_object(&mut dataset, dict, false, Length::UNDEFINED)?,
})
}
/// Create a DICOM object by reading from a byte source.
///
/// This function assumes the standard file encoding structure without the
/// preamble: file meta group, followed by the rest of the data set.
pub fn from_reader_with_dict<S>(src: S, dict: D) -> Result<Self>
where
S: Read,
{
Self::from_reader_with(src, dict, TransferSyntaxRegistry)
}
/// Create a DICOM object by reading from a byte source.
///
/// This function assumes the standard file encoding structure without the
/// preamble: file meta group, followed by the rest of the data set.
///
/// This function allows you to choose a different transfer syntax index,
/// but its use is only advised when the built-in transfer syntax registry
/// is insufficient. Otherwise, please use [`from_reader_with_dict`] instead.
///
/// [`from_reader_with_dict`]: #method.from_reader_with_dict
pub fn from_reader_with<'s, S: 's, R>(src: S, dict: D, ts_index: R) -> Result<Self>
where
S: Read,
R: TransferSyntaxIndex,
{
let mut file = BufReader::new(src);
// read metadata header
let meta = FileMetaTable::from_reader(&mut file)?;
// read rest of data according to metadata, feed it to object
let ts = ts_index
.get(&meta.transfer_syntax)
.ok_or(Error::UnsupportedTransferSyntax)?;
let cs = SpecificCharacterSet::Default;
let mut dataset = DataSetReader::new_with_dictionary(file, dict.clone(), ts, cs)?;
let obj = InMemDicomObject::build_object(&mut dataset, dict, false, Length::UNDEFINED)?;
Ok(RootDicomObject { meta, obj })
}
}
impl<D> InMemDicomObject<D>
where
D: DataDictionary,
D: Clone,
{
/// Create a new empty object, using the given dictionary for name lookup.
pub fn new_empty_with_dict(dict: D) -> Self {
InMemDicomObject {
entries: BTreeMap::new(),
dict,
len: Length::UNDEFINED,
}
}
/// Construct a DICOM object from an iterator of structured elements.
pub fn from_iter_with_dict<I>(iter: I, dict: D) -> Result<Self>
where
I: IntoIterator<Item = Result<InMemElement<D>>>,
{
let entries: Result<_> = iter.into_iter().map_results(|e| (e.tag(), e)).collect();
Ok(InMemDicomObject {
entries: entries?,
dict,
len: Length::UNDEFINED,
})
}
// Standard methods follow. They are not placed as a trait implementation
// because they may require outputs to reference the lifetime of self,
// which is not possible without GATs.
/// Retrieve the object's meta table if available.
///
/// At the moment, this is sure to return `None`, because the meta
/// table is kept in a separate wrapper value.
pub fn meta(&self) -> Option<&FileMetaTable> {
None
}
/// Retrieve a particular DICOM element by its tag.
pub fn element(&self, tag: Tag) -> Result<&InMemElement<D>> {
self.entries.get(&tag).ok_or(Error::NoSuchDataElement)
}
/// Retrieve a particular DICOM element by its name.
pub fn element_by_name(&self, name: &str) -> Result<&InMemElement<D>> {
let tag = self.lookup_name(name)?;
self.element(tag)
}
/// Insert a data element to the object, replacing (and returning) any
/// previous element of the same attribute.
pub fn put(&mut self, elt: InMemElement<D>) -> Option<InMemElement<D>> {
self.entries.insert(elt.tag(), elt)
}
// private methods
/// Build an object by consuming a data set parser.
fn build_object<'s, S: 's, P>(
dataset: &mut DataSetReader<S, P, D>,
dict: D,
in_item: bool,
len: Length,
) -> Result<Self>
where
S: Read,
P: Parse<dyn Read + 's>,
{
let mut entries: BTreeMap<Tag, InMemElement<D>> = BTreeMap::new();
// perform a structured parsing of incoming tokens
while let Some(token) = dataset.next() {
let elem = match token? {
DataToken::ElementHeader(header) => {
// fetch respective value, place it in the entries
let next_token = dataset.next().ok_or_else(|| Error::MissingElementValue)?;
match next_token? {
DataToken::PrimitiveValue(v) => {
InMemElement::new(header.tag, header.vr, Value::Primitive(v))
}
token => {
return Err(DataSetSyntaxError::UnexpectedToken(token).into());
}
}
}
DataToken::SequenceStart { tag, len } => {
// delegate sequence building to another function
let items = Self::build_sequence(tag, len, &mut *dataset, &dict)?;
DataElement::new(tag, VR::SQ, Value::Sequence { items, size: len })
}
DataToken::ItemEnd if in_item => {
// end of item, leave now
return Ok(InMemDicomObject { entries, dict, len });
}
token => return Err(DataSetSyntaxError::UnexpectedToken(token).into()),
};
entries.insert(elem.tag(), elem);
}
Ok(InMemDicomObject { entries, dict, len })
}
/// Build a DICOM sequence by consuming a data set parser.
fn build_sequence<'s, S: 's, P>(
_tag: Tag,
_len: Length,
dataset: &mut DataSetReader<S, P, D>,
dict: &D,
) -> Result<C<InMemDicomObject<D>>>
where
S: Read,
P: Parse<dyn Read + 's>,
{
let mut items: C<_> = SmallVec::new();
while let Some(token) = dataset.next() {
match token? {
DataToken::ItemStart { len } => {
// TODO if length is well defined, then it should be
// considered instead of finding the item delimiter.
items.push(Self::build_object(&mut *dataset, dict.clone(), true, len)?);
}
DataToken::SequenceEnd => {
return Ok(items);
}
token => return Err(DataSetSyntaxError::UnexpectedToken(token).into()),
};
}
// iterator fully consumed without a sequence delimiter
Err(DataSetSyntaxError::PrematureEnd.into())
}
fn lookup_name(&self, name: &str) -> Result<Tag> {
self.dict
.by_name(name)
.ok_or(Error::NoSuchAttributeName)
.map(|e| e.tag())
}
}
impl<'a, D> IntoIterator for &'a InMemDicomObject<D> {
type Item = &'a InMemElement<D>;
type IntoIter = ::std::collections::btree_map::Values<'a, Tag, InMemElement<D>>;
fn into_iter(self) -> Self::IntoIter {
self.entries.values()
}
}
impl<D> IntoIterator for InMemDicomObject<D> {
type Item = InMemElement<D>;
type IntoIter = Iter<D>;
fn into_iter(self) -> Self::IntoIter {
Iter {
inner: self.entries.into_iter(),
}
}
}
/// Base iterator type for an in-memory DICOM object.
#[derive(Debug)]
pub struct Iter<D> {
inner: ::std::collections::btree_map::IntoIter<Tag, InMemElement<D>>,
}
impl<D> Iterator for Iter<D> {
type Item = InMemElement<D>;
fn next(&mut self) -> Option<Self::Item> {
self.inner.next().map(|x| x.1)
}
fn size_hint(&self) -> (usize, Option<usize>) {
self.inner.size_hint()
}
fn count(self) -> usize {
self.inner.count()
}
}
#[cfg(test)]
mod tests {
use super::*;
use dicom_core::value::PrimitiveValue;
use dicom_core::VR;
#[test]
fn inmem_object_write() {
let mut obj1 = InMemDicomObject::create_empty();
let mut obj2 = InMemDicomObject::create_empty();
assert_eq!(obj1, obj2);
let empty_patient_name = DataElement::empty(Tag(0x0010, 0x0010), VR::PN);
obj1.put(empty_patient_name.clone());
assert_ne!(obj1, obj2);
obj2.put(empty_patient_name.clone());
assert_eq!(obj1, obj2);
}
#[test]
fn inmem_object_get() {
let another_patient_name = DataElement::new(
Tag(0x0010, 0x0010),
VR::PN,
PrimitiveValue::Str("Doe^John".to_string()).into(),
);
let mut obj = InMemDicomObject::create_empty();
obj.put(another_patient_name.clone());
let elem1 = (&obj).element(Tag(0x0010, 0x0010)).unwrap();
assert_eq!(elem1, &another_patient_name);
}
#[test]
fn inmem_object_get_by_name() {
let another_patient_name = DataElement::new(
Tag(0x0010, 0x0010),
VR::PN,
PrimitiveValue::Str("Doe^John".to_string()).into(),
);
let mut obj = InMemDicomObject::create_empty();
obj.put(another_patient_name.clone());
let elem1 = (&obj).element_by_name("PatientName").unwrap();
assert_eq!(elem1, &another_patient_name);
}
}
| 33.413333 | 96 | 0.602953 |
b2b6aed7dde137dbec9d46784b9eb3493640ecc8 | 1,322 | py | Python | networks/rnn.py | uchikun2493/nn_modules | ad3486b842fc543561d39227de5daaa475d3513a | [
"MIT"
] | null | null | null | networks/rnn.py | uchikun2493/nn_modules | ad3486b842fc543561d39227de5daaa475d3513a | [
"MIT"
] | null | null | null | networks/rnn.py | uchikun2493/nn_modules | ad3486b842fc543561d39227de5daaa475d3513a | [
"MIT"
] | null | null | null | # pytorch
import torch
import torch.nn as nn
import torch.nn.functional as F
# **********************************************
# rnn class
# **********************************************
class BasicRNNCell(nn.Module):
def __init__(self, inputs, hidden, outputs):
super(BasicRNNCell, self).__init__()
self.l1 = nn.LSTMCell(inputs, hidden)
self.l2 = nn.Linear(hidden, outputs)
self.hidden = hidden
# Forward
def __call__(self, x, h):
h = self.l1(x, h)
y = self.l2(h)
return y, h
def reset_hidden(self):
return torch.zeros(1, self.hidden)
class BasicRNN(nn.Module):
def __init__(self, inputs, hidden, outputs):
super(BasicRNN, self).__init__()
self.l1 = nn.LSTM(inputs, hidden, num_layers=1)
self.l2 = nn.Linear(hidden, outputs)
self.n_layer = 1
self.hidden = hidden
# Forward
def __call__(self, x, h_req=False):
n_sample = 1
# ้ ใๅฑคใฎๅๆ็ถๆ
h0 = torch.zeros(self.n_layer, n_sample, self.hidden)
# ใกใขใชใปใซใฎๅๆ็ถๆ
c0 = torch.zeros(self.n_layer, n_sample, self.hidden)
# out, h = self.l1(x, (h0, c0))
out, h = self.l1(x)
y = self.l2(out[-1])
if h_req is False:
return y
else:
return y, h
| 24.481481 | 61 | 0.533283 |
e50c5ad122d4350bdae67a23c64d9f3b7a1fef89 | 425 | html | HTML | extension/templates/popup-iframe.html | alok1111/leo-translate | 5616cdfa8a0f514a8335b792c1da80ffb9479430 | [
"MIT"
] | 62 | 2017-10-08T23:32:10.000Z | 2022-02-20T16:15:44.000Z | extension/templates/popup-iframe.html | alok1111/leo-translate | 5616cdfa8a0f514a8335b792c1da80ffb9479430 | [
"MIT"
] | 53 | 2017-10-05T11:28:57.000Z | 2022-02-26T03:16:07.000Z | extension/templates/popup-iframe.html | alok1111/leo-translate | 5616cdfa8a0f514a8335b792c1da80ffb9479430 | [
"MIT"
] | 10 | 2017-11-20T19:19:27.000Z | 2020-10-18T19:05:02.000Z | <!DOCTYPE html>
<html class="theme-leo-translate">
<head>
<meta charset="utf-8">
<style>
html, body {
margin: 0;
padding: 0;
border: none;
width: 250px;
overflow-x: hidden;
}
</style>
</head>
<body>
<div id="the-popup-iframe"></div>
<script src="../dist/vendor.js"></script>
<script src="../dist/apply-theme.js"></script>
<script src="../dist/popup-iframe.js"></script>
</body>
</html>
| 18.478261 | 49 | 0.592941 |
cb848416c9f3d6fe9640119ea2c39ed7aec3d424 | 140 | swift | Swift | Sources/Transitions+RequestBuilder/Request Builder/Implementation/HttpMethod.swift | ivabra/Transitions.swift | b3b1f2ab48b85ee02422b0d44aa500c4032d6afe | [
"MIT"
] | null | null | null | Sources/Transitions+RequestBuilder/Request Builder/Implementation/HttpMethod.swift | ivabra/Transitions.swift | b3b1f2ab48b85ee02422b0d44aa500c4032d6afe | [
"MIT"
] | null | null | null | Sources/Transitions+RequestBuilder/Request Builder/Implementation/HttpMethod.swift | ivabra/Transitions.swift | b3b1f2ab48b85ee02422b0d44aa500c4032d6afe | [
"MIT"
] | null | null | null | public enum HttpMethod: String {
case get = "GET"
case post = "POST"
case delete = "DELETE"
case head = "HEAD"
case put = "PUT"
}
| 17.5 | 32 | 0.614286 |
bf301ad3f988ab486c98a8997ce4ca75213d9db6 | 18,046 | rs | Rust | src/computecore/utilities.rs | rafawo/hcsrs | c8d70a431eed24ccc53b4119975cc11fc8972d6a | [
"Apache-2.0",
"MIT"
] | 6 | 2020-04-03T11:34:23.000Z | 2021-04-05T16:55:30.000Z | src/computecore/utilities.rs | rafawo/hcsrs | c8d70a431eed24ccc53b4119975cc11fc8972d6a | [
"Apache-2.0",
"MIT"
] | null | null | null | src/computecore/utilities.rs | rafawo/hcsrs | c8d70a431eed24ccc53b4119975cc11fc8972d6a | [
"Apache-2.0",
"MIT"
] | 2 | 2020-07-16T01:59:22.000Z | 2021-06-27T06:52:19.000Z | // Copyright (c) 2019-2020 Rafael Alcaraz Mercado. All rights reserved.
// Licensed under the Apache License, Version 2.0
// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
// All files in the project carrying such notice may not be copied, modified, or distributed
// except according to those terms.
// THE SOURCE CODE IS AVAILABLE UNDER THE ABOVE CHOSEN LICENSE "AS IS", WITH NO WARRANTIES.
//! Rust types that provide convenient functionality built on top of the computecore APIs.
// TODO:rafawo Change the implementations in this file to use strongly typed representations
// of the JSON API surface of HCS instead of using straight raw strings.
use crate::compute::defs::*;
use crate::compute::{HcsSafeHandle, HcsWrappedHandleDropPolicy};
use crate::computecore;
use crate::hypervdevicevirtualization::utilities::HdvHost;
use crate::HcsResult;
use winutils_rs::windefs::*;
pub const INFINITE: DWord = winapi::um::winbase::INFINITE;
pub const GENERIC_ALL: DWord = winapi::um::winnt::GENERIC_ALL;
struct HcsOperationCallback {
callback: Option<Box<dyn FnMut(&HcsOperation)>>,
}
struct HcsEventCallback {
callback: Option<Box<dyn FnMut(&HcsEvent)>>,
}
unsafe extern "system" fn hcs_operation_callback(operation: HcsOperationHandle, context: PVoid) {
let _ = std::panic::catch_unwind(|| {
let mut operation = HcsOperation::wrap_handle(operation);
operation.set_handle_policy(HcsWrappedHandleDropPolicy::Ignore);
if context != std::ptr::null_mut() {
if let Some(callback) = (*(context as *mut HcsOperationCallback)).callback.as_mut() {
(callback)(&operation);
}
}
});
}
unsafe extern "system" fn hcs_event_callback(event: *const HcsEvent, context: PVoid) {
let _ = std::panic::catch_unwind(|| {
if context != std::ptr::null_mut() {
if let Some(callback) = (*(context as *mut HcsEventCallback)).callback.as_mut() {
(callback)(&*event);
}
}
});
}
/// Safe wrapper of an HCS Operation handle.
/// When dropped, the underlying handle is closed from the HCS API.
pub struct HcsOperation {
handle: HcsOperationHandle,
handle_policy: HcsWrappedHandleDropPolicy,
callback: Box<HcsOperationCallback>,
}
impl std::ops::Drop for HcsOperation {
fn drop(&mut self) {
if self.handle != std::ptr::null_mut()
&& self.handle_policy == HcsWrappedHandleDropPolicy::Close
{
computecore::close_operation(self.handle).expect("Failed to close operation handle");
}
}
}
impl HcsSafeHandle for HcsOperation {
type SafeHandleWrapper = HcsOperation;
fn wrap_handle(handle: Handle) -> HcsOperation {
HcsOperation {
handle,
handle_policy: HcsWrappedHandleDropPolicy::Close,
callback: Box::new(HcsOperationCallback { callback: None }),
}
}
fn handle(&self) -> Handle {
self.handle
}
fn set_handle_policy(&mut self, handle_policy: HcsWrappedHandleDropPolicy) {
self.handle_policy = handle_policy;
}
fn handle_policy(&self) -> HcsWrappedHandleDropPolicy {
self.handle_policy
}
}
/// Safe wrapper of a Compute System handle.
/// When dropped, the underlying handle is closed from the HCS API.
pub struct HcsSystem {
handle: HcsSystemHandle,
handle_policy: HcsWrappedHandleDropPolicy,
callback: Box<HcsEventCallback>,
}
impl std::ops::Drop for HcsSystem {
fn drop(&mut self) {
if self.handle != std::ptr::null_mut()
&& self.handle_policy == HcsWrappedHandleDropPolicy::Close
{
computecore::close_compute_system(self.handle)
.expect("Failed to close compute system handle");
}
}
}
impl HcsSafeHandle for HcsSystem {
type SafeHandleWrapper = HcsSystem;
fn wrap_handle(handle: Handle) -> HcsSystem {
HcsSystem {
handle,
handle_policy: HcsWrappedHandleDropPolicy::Close,
callback: Box::new(HcsEventCallback { callback: None }),
}
}
fn handle(&self) -> Handle {
self.handle
}
fn set_handle_policy(&mut self, handle_policy: HcsWrappedHandleDropPolicy) {
self.handle_policy = handle_policy;
}
fn handle_policy(&self) -> HcsWrappedHandleDropPolicy {
self.handle_policy
}
}
/// Safe wrapper of a Compute System Process handle.
/// When dropped, the underlying handle is closed from the HCS API.
pub struct HcsProcess {
handle: HcsProcessHandle,
handle_policy: HcsWrappedHandleDropPolicy,
callback: Box<HcsEventCallback>,
}
impl std::ops::Drop for HcsProcess {
fn drop(&mut self) {
if self.handle != std::ptr::null_mut()
&& self.handle_policy == HcsWrappedHandleDropPolicy::Close
{
computecore::close_process(self.handle).expect("Failed to close process handle");
}
}
}
impl HcsSafeHandle for HcsProcess {
type SafeHandleWrapper = HcsProcess;
fn wrap_handle(handle: Handle) -> HcsProcess {
HcsProcess {
handle,
handle_policy: HcsWrappedHandleDropPolicy::Close,
callback: Box::new(HcsEventCallback { callback: None }),
}
}
fn handle(&self) -> Handle {
self.handle
}
fn set_handle_policy(&mut self, handle_policy: HcsWrappedHandleDropPolicy) {
self.handle_policy = handle_policy;
}
fn handle_policy(&self) -> HcsWrappedHandleDropPolicy {
self.handle_policy
}
}
/// Thin wrapper of an HCS Operation that interfaces to all HCS APIs that inherently
/// depend on an HCS Operation handle as input and/or output.
impl HcsOperation {
/// Creates a new HCS Operation, and returns a safe wrapper to the handle.
pub fn new() -> HcsResult<HcsOperation> {
Ok(HcsOperation {
handle: computecore::create_operation(std::ptr::null_mut(), None)?,
handle_policy: HcsWrappedHandleDropPolicy::Close,
callback: Box::new(HcsOperationCallback { callback: None }),
})
}
/// Creates a new HCS Operation with callback, and returns a safe wrapper to the handle.
pub fn create<F>(callback: F) -> HcsResult<HcsOperation>
where
F: 'static,
F: FnMut(&HcsOperation),
{
let mut callback = Box::new(HcsOperationCallback {
callback: Some(Box::new(callback)),
});
Ok(HcsOperation {
handle: computecore::create_operation(
&mut *callback as *mut _ as PVoid,
Some(hcs_operation_callback),
)?,
handle_policy: HcsWrappedHandleDropPolicy::Close,
callback,
})
}
/// Returns a safe wrapper of a Compute System handle associated to an operation.
/// The wrapped handle returned is set to drop policy ignored.
pub fn get_compute_system(&self) -> HcsResult<HcsSystem> {
Ok(HcsSystem {
handle: computecore::get_compute_system_from_operation(self.handle)?,
handle_policy: HcsWrappedHandleDropPolicy::Ignore,
callback: Box::new(HcsEventCallback { callback: None }),
})
}
/// Returns a safe wrapper of a Compute System Process handle associated to an operation.
/// The wrapped handle returned is set to drop policy ignored.
pub fn get_process(&self) -> HcsResult<HcsProcess> {
Ok(HcsProcess {
handle: computecore::get_process_from_operation(self.handle)?,
handle_policy: HcsWrappedHandleDropPolicy::Ignore,
callback: Box::new(HcsEventCallback { callback: None }),
})
}
/// Returns the type of the operation.
pub fn get_type(&self) -> HcsResult<HcsOperationType> {
computecore::get_operation_type(self.handle)
}
/// Returns the ID of the operation.
pub fn get_id(&self) -> HcsResult<u64> {
computecore::get_operation_id(self.handle)
}
/// Returns the result document of the operation.
///
/// # Note
/// This is only valid once the operation has been completed.
pub fn get_result(&self) -> (String, HcsResult<()>) {
computecore::get_operation_result(self.handle)
}
/// Returns the result and process info of the operation.
///
/// # Note
/// This is only valid once the operation has been completed.
pub fn get_result_and_process_info(&self) -> (String, HcsResult<HcsProcessInformation>) {
computecore::get_operation_result_and_process_info(self.handle)
}
/// Waits for an operation to complete and returns the result document synchronously.
pub fn wait_for_result(&self, timeout_ms: DWord) -> (String, HcsResult<()>) {
computecore::wait_for_operation_result(self.handle, timeout_ms)
}
/// Waits for an operation to complete and returns the result document and process info syncrhonously.
pub fn wait_for_result_and_process_info(
&self,
timeout_ms: DWord,
) -> (String, HcsResult<HcsProcessInformation>) {
computecore::wait_for_operation_result_and_process_info(self.handle, timeout_ms)
}
/// Sets the operation completion callback.
///
/// # Safety
/// Once the callback is set, do not move the object because its
/// memory address is used as the C-style callback context to trigger the
/// function call.
pub fn set_callback<F>(&mut self, callback: F) -> HcsResult<()>
where
F: 'static,
F: FnMut(&HcsOperation),
{
self.callback = Box::new(HcsOperationCallback {
callback: Some(Box::new(callback)),
});
computecore::set_operation_callback(
self.handle,
&mut *self.callback as *mut _ as PVoid,
Some(hcs_operation_callback),
)
}
/// Cancels an operation.
pub fn cancel(&self) -> HcsResult<()> {
computecore::cancel_operation(self.handle)
}
}
/// Thin wrapper of an HCS Compute System that interfaces to all HCS APIs that inherently
/// depend on an HCS Compute System handle as input and/or output.
impl HcsSystem {
/// Creates a Compute System and returns a safe wrapper of the handle.
pub fn create(
id: &str,
configuration: &str,
operation: &HcsOperation,
security_descriptor: Option<&SecurityDescriptor>,
) -> HcsResult<HcsSystem> {
Ok(HcsSystem {
handle: computecore::create_compute_system(
id,
configuration,
operation.handle,
security_descriptor,
)?,
handle_policy: HcsWrappedHandleDropPolicy::Close,
callback: Box::new(HcsEventCallback { callback: None }),
})
}
/// Opens a compute system and returns a safe wrapper handle to it.
pub fn open(id: &str, requested_access: DWord) -> HcsResult<HcsSystem> {
Ok(HcsSystem {
handle: computecore::open_compute_system(id, requested_access)?,
handle_policy: HcsWrappedHandleDropPolicy::Close,
callback: Box::new(HcsEventCallback { callback: None }),
})
}
/// Starts a compute system.
pub fn start(&self, operation: &HcsOperation, options: Option<&str>) -> HcsResult<()> {
computecore::start_compute_system(self.handle, operation.handle, options)
}
/// Shutdowns a compute system.
pub fn shutdown(&self, operation: &HcsOperation, options: Option<&str>) -> HcsResult<()> {
computecore::shutdown_compute_system(self.handle, operation.handle, options)
}
/// Terminates a compute system.
pub fn terminate(&self, operation: &HcsOperation, options: Option<&str>) -> HcsResult<()> {
computecore::terminate_compute_system(self.handle, operation.handle, options)
}
/// Pauses a compute system.
pub fn pause(&self, operation: &HcsOperation, options: Option<&str>) -> HcsResult<()> {
computecore::pause_compute_system(self.handle, operation.handle, options)
}
/// Resumes a compute system.
pub fn resume(&self, operation: &HcsOperation, options: Option<&str>) -> HcsResult<()> {
computecore::resume_compute_system(self.handle, operation.handle, options)
}
/// Saves a compute system.
pub fn save(&self, operation: &HcsOperation, options: Option<&str>) -> HcsResult<()> {
computecore::save_compute_system(self.handle, operation.handle, options)
}
/// Queries for a compute system's properties.
pub fn get_properties(
&self,
operation: &HcsOperation,
property_query: Option<&str>,
) -> HcsResult<()> {
computecore::get_compute_system_properties(self.handle, operation.handle, property_query)
}
/// Modifies a compute system.
pub fn modify(
&self,
operation: &HcsOperation,
configuration: &str,
identity: Handle,
) -> HcsResult<()> {
computecore::modify_compute_system(self.handle, operation.handle, configuration, identity)
}
/// Sets a callback for this specific compute system, called on key events.
///
/// # Safety
/// Once the callback is set, do not move the object because its
/// memory address is used as the C-style callback context to trigger the
/// function call.
pub fn set_callback<F>(
&mut self,
callback_options: HcsEventOptions,
callback: F,
) -> HcsResult<()>
where
F: 'static,
F: FnMut(&HcsEvent),
{
self.callback = Box::new(HcsEventCallback {
callback: Some(Box::new(callback)),
});
computecore::set_compute_system_callback(
self.handle,
callback_options,
&mut *self.callback as *mut _ as PVoid,
Some(hcs_event_callback),
)
}
/// Creates and returns a new process in the compute system.
pub fn create_process(
&self,
process_parameters: &str,
operation: &HcsOperation,
security_descriptor: Option<&SecurityDescriptor>,
) -> HcsResult<HcsProcess> {
Ok(HcsProcess {
handle: computecore::create_process(
self.handle,
process_parameters,
operation.handle,
security_descriptor,
)?,
handle_policy: HcsWrappedHandleDropPolicy::Close,
callback: Box::new(HcsEventCallback { callback: None }),
})
}
/// Opens a process in the compute system, that has been created through HCS APIs.
pub fn open_process(
&self,
process_id: DWord,
requested_access: DWord,
) -> HcsResult<HcsProcess> {
Ok(HcsProcess {
handle: computecore::open_process(self.handle, process_id, requested_access)?,
handle_policy: HcsWrappedHandleDropPolicy::Close,
callback: Box::new(HcsEventCallback { callback: None }),
})
}
/// Initializes the device emulator host in the caller's process and associates it
/// with the specified compute system. This function should be called after the compute system
/// has been created and before it has been started. The compute system's configuration must
/// indicate that an external device host for the compute system will be present, by means
/// of specifying the identity (SID) of the user account under which the device host will execute.
/// If the device host has not been initialized by the time the compute system starts,
/// the start operation fails.
pub fn initialize_device_host(&self) -> HcsResult<HdvHost> {
HdvHost::new(self.handle)
}
}
/// Thin wrapper of an HCS Compute System Process that interfaces to all HCS APIs that inherently
/// depend on an HCS Compute System Process handle as input and/or output.
impl HcsProcess {
/// Terminates a compute system process.
pub fn terminate(&self, operation: &HcsOperation, options: Option<&str>) -> HcsResult<()> {
computecore::terminate_process(self.handle, operation.handle, options)
}
/// Signals a compute system process.
pub fn signal(&self, operation: &HcsOperation, options: Option<&str>) -> HcsResult<()> {
computecore::signal_process(self.handle, operation.handle, options)
}
/// Gets basic information of the compute system process.
pub fn get_info(&self, operation: &HcsOperation) -> HcsResult<()> {
computecore::get_process_info(self.handle, operation.handle)
}
/// Gets properties of the compute system process.
pub fn get_properties(
&self,
operation: &HcsOperation,
property_query: Option<&str>,
) -> HcsResult<()> {
computecore::get_process_properties(self.handle, operation.handle, property_query)
}
/// Modifues the compute system process.
pub fn modify(&self, operation: &HcsOperation, settings: Option<&str>) -> HcsResult<()> {
computecore::modify_process(self.handle, operation.handle, settings)
}
/// Sets a callback to the compute system process, called on key events.
/// Callback is expected to be a reference to the trait object of the closure.
///
/// # Safety
/// Once the callback is set, do not move the object because its
/// memory address is used as the C-style callback context to trigger the
/// function call.
pub fn set_callback<F>(
&mut self,
callback_options: HcsEventOptions,
callback: F,
) -> HcsResult<()>
where
F: 'static,
F: FnMut(&HcsEvent),
{
self.callback = Box::new(HcsEventCallback {
callback: Some(Box::new(callback)),
});
computecore::set_process_callback(
self.handle,
callback_options,
&mut *self.callback as *mut _ as PVoid,
Some(hcs_event_callback),
)
}
}
| 35.523622 | 106 | 0.646681 |
84f68cf16373a80f740ecf4cf2614fc6f5f81092 | 3,998 | h | C | macOS/10.13/VectorKit.framework/VKSceneConfiguration.h | onmyway133/Runtime-Headers | e9b80e7ab9103f37ad421ad6b8b58ee06369d21f | [
"MIT"
] | 30 | 2016-10-09T20:13:00.000Z | 2022-01-24T04:14:57.000Z | macOS/10.13/VectorKit.framework/VKSceneConfiguration.h | onmyway133/Runtime-Headers | e9b80e7ab9103f37ad421ad6b8b58ee06369d21f | [
"MIT"
] | null | null | null | macOS/10.13/VectorKit.framework/VKSceneConfiguration.h | onmyway133/Runtime-Headers | e9b80e7ab9103f37ad421ad6b8b58ee06369d21f | [
"MIT"
] | 7 | 2017-08-29T14:41:25.000Z | 2022-01-19T17:14:54.000Z | /* Generated by RuntimeBrowser
Image: /System/Library/PrivateFrameworks/VectorKit.framework/Versions/A/VectorKit
*/
@interface VKSceneConfiguration : NSObject {
unsigned char _cameraMode;
unsigned long long _currentGroupedManeuverCount;
unsigned char _currentIncidentType;
unsigned char _currentManeuverComplexity;
int _currentManeuverType;
unsigned char _currentStepLength;
struct ManeveuverDistancesRange {
double _immediate;
double _extremlyNear;
double _veryNear;
double _near;
double _medium;
double _far;
double _veryFar;
} _distanceRanges;
unsigned char _distanceToCurrentManeuver;
double _distanceToDestination;
unsigned int _lineType;
unsigned char _navState;
unsigned char _navigationDestination;
int _nextManeuverRampType;
unsigned char _nextStepLength;
struct vector<GEOLocationCoordinate2D, std::__1::allocator<GEOLocationCoordinate2D> > {
struct { /* ? */ } *__begin_;
struct { /* ? */ } *__end_;
struct __compressed_pair<GEOLocationCoordinate2D *, std::__1::allocator<GEOLocationCoordinate2D> > {
struct { /* ? */ } *__first_;
} __end_cap_;
} _pointsOfInterest;
int _rampType;
unsigned char _roadSpeed;
unsigned long long _roadSpeedZeroes;
struct shared_ptr<gss::StylesheetManager<gss::ScenePropertyID> > {
struct StylesheetManager<gss::ScenePropertyID> {} *__ptr_;
struct __shared_weak_count {} *__cntrl_;
} _sceneManager;
unsigned char _searchAlongTheRoute;
struct shared_ptr<gss::StylesheetManager<gss::PropertyID> > {
struct StylesheetManager<gss::PropertyID> {} *__ptr_;
struct __shared_weak_count {} *__cntrl_;
} _styleManager;
struct shared_ptr<md::TaskContext> {
struct TaskContext {} *__ptr_;
struct __shared_weak_count {} *__cntrl_;
} _taskContext;
unsigned char _transportType;
unsigned char _vehicleSpeed;
}
- (id).cxx_construct;
- (void).cxx_destruct;
- (void)_updateStyleManager;
- (id)analyticsLogContextWithNavigationState;
- (id)initWithTaskContext:(struct shared_ptr<md::TaskContext> { struct TaskContext {} *x1; struct __shared_weak_count {} *x2; })arg1;
- (unsigned long long)navCameraMode;
- (unsigned long long)navigationDestination;
- (unsigned char)navigationState;
- (void)resetState;
- (struct shared_ptr<gss::StylesheetManager<gss::ScenePropertyID> > { struct StylesheetManager<gss::ScenePropertyID> {} *x1; struct __shared_weak_count {} *x2; })sceneManager;
- (void)setCurrentGroupedManeuverCount:(unsigned long long)arg1;
- (void)setCurrentIncidentType:(unsigned long long)arg1;
- (void)setCurrentManeuverJunctionsCount:(unsigned long long)arg1;
- (void)setCurrentManeuverType:(int)arg1;
- (void)setCurrentStepLength:(double)arg1;
- (void)setCurrentTransportationType:(int)arg1;
- (void)setDistanceToCurrentManeuver:(double)arg1;
- (void)setDistanceToDestination:(double)arg1;
- (void)setLineType:(unsigned int)arg1;
- (void)setNavCameraMode:(unsigned long long)arg1;
- (void)setNavigationDestination:(unsigned long long)arg1;
- (void)setNavigationState:(int)arg1;
- (void)setNextManeuverRampType:(int)arg1;
- (void)setNextStepLength:(double)arg1;
- (void)setRampType:(int)arg1;
- (void)setRoadSpeed:(double)arg1;
- (void)setSceneManager:(struct shared_ptr<gss::StylesheetManager<gss::ScenePropertyID> > { struct StylesheetManager<gss::ScenePropertyID> {} *x1; struct __shared_weak_count {} *x2; })arg1;
- (void)setSearchAlongTheRoute:(BOOL)arg1;
- (void)setStyleManager:(struct shared_ptr<gss::StylesheetManager<gss::PropertyID> > { struct StylesheetManager<gss::PropertyID> {} *x1; struct __shared_weak_count {} *x2; })arg1;
- (void)setVehicleSpeed:(double)arg1;
- (struct shared_ptr<gss::StylesheetManager<gss::PropertyID> > { struct StylesheetManager<gss::PropertyID> {} *x1; struct __shared_weak_count {} *x2; })styleManager;
@end
| 45.431818 | 189 | 0.732116 |
b4bb4adcaaa6eb908e1be607611ba8286e79d1c8 | 1,062 | sql | SQL | db/schema.sql | dzungtran/togo | 100025c6331acb11f5206e7ebbb77f5e7406a045 | [
"MIT"
] | null | null | null | db/schema.sql | dzungtran/togo | 100025c6331acb11f5206e7ebbb77f5e7406a045 | [
"MIT"
] | null | null | null | db/schema.sql | dzungtran/togo | 100025c6331acb11f5206e7ebbb77f5e7406a045 | [
"MIT"
] | null | null | null | GRANT ALL PRIVILEGES
ON DATABASE manabie_db TO demo;
CREATE EXTENSION pgcrypto;
CREATE SEQUENCE togo_users_id_seq START 1;
CREATE SEQUENCE togo_task_id_seq START 1;
CREATE TABLE users
(
id int8 NOT NULL DEFAULT nextval('togo_users_id_seq'::regclass),
username varchar(36) NOT NULL,
password varchar(255) NOT NULL,
max_todo int4 DEFAULT 5 NOT NULL,
CONSTRAINT users_PK PRIMARY KEY (id)
);
ALTER SEQUENCE togo_users_id_seq OWNED BY users.id;
CREATE UNIQUE INDEX uniq_username ON users (username);
INSERT INTO users("username", "password") VALUES('firstUser', crypt('example', gen_salt('bf', 8)));
-- tasks definition
CREATE TABLE tasks
(
id int8 NOT NULL DEFAULT nextval('togo_task_id_seq'::regclass),
content TEXT NOT NULL,
user_id int8 NOT NULL,
created_date timestamp NOT NULL,
CONSTRAINT tasks_PK PRIMARY KEY (id),
CONSTRAINT tasks_FK FOREIGN KEY (user_id) REFERENCES users (id)
);
ALTER SEQUENCE togo_task_id_seq OWNED BY tasks.id; | 34.258065 | 99 | 0.699623 |
d5c7010701f2cacb91cb21628b04187af7cf6f47 | 2,847 | h | C | include/rocket/tcp_socket.h | bneff/rocket | 0f6bd66796c45564f85db8753e81a0a64825cc2b | [
"BSD-3-Clause"
] | null | null | null | include/rocket/tcp_socket.h | bneff/rocket | 0f6bd66796c45564f85db8753e81a0a64825cc2b | [
"BSD-3-Clause"
] | null | null | null | include/rocket/tcp_socket.h | bneff/rocket | 0f6bd66796c45564f85db8753e81a0a64825cc2b | [
"BSD-3-Clause"
] | null | null | null | /*
Copyright (c) 2015, Bryan Neff
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef rocket_tcp_socket
#define rocket_tcp_socket
//SOMAXCONN
#include <sys/socket.h>
#include <memory>
namespace rocket
{
class tcp_socket
{
friend class tls_socket;
public:
tcp_socket(const tcp_socket&) = delete;
tcp_socket& operator=(const tcp_socket&) = delete;
tcp_socket(tcp_socket&& other);
tcp_socket& operator=(tcp_socket&& other);
tcp_socket();
virtual ~tcp_socket();
virtual ssize_t connect( std::string host, uint16_t port, std::chrono::milliseconds millis );
virtual ssize_t close();
virtual ssize_t bind( std::string host, uint16_t port );
virtual ssize_t listen( size_t max_connections=SOMAXCONN );
virtual std::unique_ptr<tcp_socket> accept();
//values of how = SHUT_RD, SHUT_WR, or SHUT_RDWR
virtual ssize_t shutdown( int how );
virtual ssize_t send( const void* data, size_t len, std::chrono::milliseconds millis );
virtual ssize_t recv( void* data, size_t len, std::chrono::milliseconds millis );
virtual ssize_t can_send_data( std::chrono::milliseconds millis );
virtual ssize_t can_recv_data( std::chrono::milliseconds millis );
virtual std::pair<std::string, uint16_t> get_peer_address();
virtual std::pair<std::string, uint16_t> get_local_address();
protected:
std::pair<std::string, uint16_t> address_helper( struct sockaddr_storage* s );
ssize_t create_socket( int address_family );
size_t sockfd_;
};
};
#endif
| 35.5875 | 97 | 0.758693 |
0bdccdc19f98bd261bbf7d0743d10bb1d0851190 | 924 | js | JavaScript | lib/cjs/utils/useTimeout.js | Zhurbin/rsuite | a04a00342248d99ef7f17711a265577c467d2860 | [
"MIT"
] | 2 | 2021-11-26T00:46:16.000Z | 2021-11-27T06:55:57.000Z | lib/cjs/utils/useTimeout.js | Zhurbin/rsuite | a04a00342248d99ef7f17711a265577c467d2860 | [
"MIT"
] | 2 | 2022-01-18T13:54:05.000Z | 2022-03-24T01:18:30.000Z | lib/cjs/utils/useTimeout.js | Zhurbin/rsuite | a04a00342248d99ef7f17711a265577c467d2860 | [
"MIT"
] | null | null | null | "use strict";
exports.__esModule = true;
exports.default = void 0;
var _react = require("react");
/**
* A timer hook
* @param fn Timer callback function
* @param ms Milliseconds of the timer
* @param open Whether to open the timer
*/
function useTimeout(fn, ms, open) {
if (ms === void 0) {
ms = 0;
}
if (open === void 0) {
open = true;
}
var timeout = (0, _react.useRef)();
var clear = (0, _react.useCallback)(function () {
timeout.current && clearTimeout(timeout.current);
}, []);
var set = (0, _react.useCallback)(function () {
timeout.current = open && setTimeout(function () {
return fn === null || fn === void 0 ? void 0 : fn();
}, ms);
}, [ms, fn, open]);
(0, _react.useEffect)(function () {
set();
return clear;
}, [fn, ms, open, clear, set]);
return {
clear: clear,
reset: set
};
}
var _default = useTimeout;
exports.default = _default; | 21.488372 | 58 | 0.590909 |
760fe5d4159ddf4da874eac00334ab16a87d42d9 | 644 | go | Go | test/compare/testdata/misc/assignment.go | zapateo/scriggo | 92062fc515661d920c655731b146e40e5b0edec6 | [
"BSD-3-Clause"
] | 294 | 2021-09-15T13:28:31.000Z | 2022-03-02T21:45:58.000Z | test/compare/testdata/misc/assignment.go | zapateo/scriggo | 92062fc515661d920c655731b146e40e5b0edec6 | [
"BSD-3-Clause"
] | 45 | 2021-09-15T15:28:59.000Z | 2022-03-24T08:55:13.000Z | test/compare/testdata/misc/assignment.go | zapateo/scriggo | 92062fc515661d920c655731b146e40e5b0edec6 | [
"BSD-3-Clause"
] | 14 | 2021-09-17T04:30:17.000Z | 2021-12-28T10:54:47.000Z | // run
package main
import "fmt"
func main() {
a, b := 10, 20
fmt.Println(a, b)
a, b = b, a
fmt.Println(a, b)
x := []int{1, 2, 3}
i := 0
i, x[i] = 1, 2
i = 0
x[i], i = 2, 1
x[0], x[0] = 1, 2
x[1], x[2] = 4, 5
v := 10
fmt.Println(v)
ref := &v
*ref = 2
fmt.Println(v)
i = 2
x = []int{3, 5, 7}
// https://github.com/open2b/scriggo/issues/182.
// for i, x[i] = range x {
// break
// }
fmt.Println(i, x)
{
var i, j int = 1, 2
k := 3
fmt.Println(i, j, k)
a, b, c := true, false, "a string"
fmt.Println(i, j, k, a, b, c)
}
var a2 int
var a3, b1 int
fmt.Println(a2)
fmt.Println(a3)
fmt.Println(b1)
}
| 12.384615 | 49 | 0.495342 |
7509af55532ccd2530b1379dff47f0c09d83c832 | 3,888 | c | C | cobrinhas.c | AkiraDemenech/Cobrinha | aa149b255f2dbf9d204e340e1b725480f969b6d3 | [
"Unlicense"
] | null | null | null | cobrinhas.c | AkiraDemenech/Cobrinha | aa149b255f2dbf9d204e340e1b725480f969b6d3 | [
"Unlicense"
] | null | null | null | cobrinhas.c | AkiraDemenech/Cobrinha | aa149b255f2dbf9d204e340e1b725480f969b6d3 | [
"Unlicense"
] | null | null | null | #include<windows.h>
#include<stdlib.h>
#include <stdio.h>
#include <conio.h>
#include <time.h>
#define neck 177 // caractere do pescoรงo
#define head 1 // diferenรงa do pescoรงo para a cabeรงa
#define size 5 // tamanho mรญnimo da cobrinha e diferenรงa para o mรกximo
int tamanho;
char vidro[4]; // caracteres que nรฃo sรฃo a cobrinha
char mostra (int casa);
void carrega (int *tela, int t);
void exibir (int *tela, int t);
int decidir (int *dx, int *dy, int *cob, int cer);
int ir (int *a, int *b, int *c, int t, int *da, int *db);
struct cobrinha { // nรฃo รฉ exatamente um objeto....
int y,x, dx,dy;
};
void gotoxy (int x, int y) { // seta a posiรงรฃo do cursor da linha de comando
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), (COORD){x, y});
// system("cls"); // printf("%c[%d;%dH",0x1B,y,x);
}
int *matrix (int *m, int l, int i, int j) {
return m + l*i + j; // percorrimento da matriz como um vetor em forma de ponteiro
}
int main()
{
gotoxy(0,0);
srand(time(0));
tamanho = (rand()%size) + size;
vidro[3] = '|';
vidro[2] = '/';
vidro[1] = '\\';
vidro[0] = ' ';
int cerca = 6*size;
int cercado[cerca][cerca];
carrega(cercado,cerca*cerca); // abre do arquivo
int t, d, c, cobras = 1 + (rand()%tamanho);
struct cobrinha ofidios[cobras];
for(c=0; c<cobras; c++) {
ofidios[c].dy = 0;
ofidios[c].dx = 0;
do {
ofidios[c].x = (rand()%(cerca-size))+size;
ofidios[c].y = (rand()%(cerca-size))+size;
} while (ir(&ofidios[c].x,&ofidios[c].y,cercado,cerca,&ofidios[c].dx,&ofidios[c].dy) == 0);
for(t=0; t<tamanho; t++) { // posiciona o corpo da cobrinha no comeรงo
while(ir(&ofidios[c].x,&ofidios[c].y,cercado,cerca,&ofidios[c].dx,&ofidios[c].dy) == 0) { } // se a cobrinha pรดde ir a a algum lugar, significa que ela estรก em algum lugar onde poderia estar.
cercado[ofidios[c].y][ofidios[c].x] = head - tamanho + t; // o tamanho serรก o mesmo para todas, se fosse diferente, o processamento do "sumiรงo" do fim do rastro do rabo teria de ser individualizado de alguma forma
}
}
do {
t = time(0);
d = 0;
for(c=0; c<cobras; c++)
if(ir(&ofidios[c].x,&ofidios[c].y,cercado,cerca,&ofidios[c].dx,&ofidios[c].dy) == 1) {
// d+=ir(&ofidios[c].x,&ofidios[c].y,cercado,cerca,&ofidios[c].dx,&ofidios[c].dy);
cercado[ofidios[c].y][ofidios[c].x] = head;
d += 1;
}
if(d > 0) {
gotoxy(0,0);
exibir(cercado, cerca);
if(d > head)
d = 0;
} else if (rand()%tamanho == head) d = head; // se empacar, quanto maior a cobra, menor a chance de ficar esperando parada.
while(time(0)-t<d && kbhit() == 0) { }
} while (kbhit() == 0);
return 0;
}
int ir (int *a, int *b, int *c, int t, int *da, int *db) {
if(decidir(da,db,matrix(c,t,*b,*a),t) == 0)
return 0;
(*a) += *da;
(*b) += *db;
return 1;
}
int decidir (int *dx, int *dy, int *cob, int cer) {
for(int c = 0; c < tamanho; c++) { // tenta mais se a cobra for maior
if(((*dx) != 0 || 0 != (*dy)) && (*matrix(cob,cer,*dy,*dx))<-head && rand()%tamanho>c)
return 1; // quanto maior a cobra, menos chance hรก dela mudar de direรงรฃo sem necessidade
(*dx) = (rand()%3) - 1;
(*dy) = (rand()%3) - 1;
}
return 0;
}
char mostra (int casa) {
if(casa>tamanho)
return vidro[casa/(size+size)]; //casa/10
if(casa+tamanho>head)
return (char)(neck+((casa==head)?(head):(casa%2)));
return vidro[0];//32
}
void carrega (int *tela, int t) {
FILE *obs = fopen("obstaculos.txt","r");
char f;
while (t>0) {
do {
f = getc(obs);
printf("%c",f);
} while (f<32 && f!=EOF);/*(f!='0' && f!='1');
*(tela+(--t)) = (f=='0')?(-tamanho):(size*2*(1+(rand()%3)));
*/ *tela = (f%2==0)?(-tamanho):(size*2*(1+(rand()%3)));
tela++;
t--;
}
}
void exibir (int *tela, int t) {
for(int c,l=0; l<t; l++) {
for(c=0; c<t; c++) {
printf("%c",mostra(*tela));
if ((*tela)<=head && (*tela)>-tamanho)
(*tela)--;
tela++;
}
printf("\n");
}
} | 31.104 | 216 | 0.585648 |
ac857100d300872be14702e0da6a09cc5a68385c | 1,519 | swift | Swift | YGXCheckVersion/YGXAPITool.swift | lxlxl3691/YGXCheckVersion | b4cbffe154bb215e7287e7d65e4c62a75c55adf2 | [
"MIT"
] | null | null | null | YGXCheckVersion/YGXAPITool.swift | lxlxl3691/YGXCheckVersion | b4cbffe154bb215e7287e7d65e4c62a75c55adf2 | [
"MIT"
] | null | null | null | YGXCheckVersion/YGXAPITool.swift | lxlxl3691/YGXCheckVersion | b4cbffe154bb215e7287e7d65e4c62a75c55adf2 | [
"MIT"
] | null | null | null | //
// YGXAPITool.swift
// YGXCheckVersionDemo
//
// Created by michael ไผ on 2018/5/30.
// Copyright ยฉ 2018ๅนด michael ไผ. All rights reserved.
//
import Foundation
typealias callbackfunc = (_ result: [String: Any]) -> Void
typealias faildBlock = (_ error: Error?) -> Void
class YGXAPITool: NSObject {
static let share = YGXAPITool()
func postWithPath(baseUrl: String = Environment.appStore.rawValue, path: String, paras: Dictionary<String,Any>, success: @escaping callbackfunc, failure: @escaping faildBlock) {
var i = 0
var address = baseUrl + path
if !(paras.isEmpty) {
address += "?"
}
// if let paras = paras {
for (key,value) in paras {
if i == 0 {
address += "\(key)=\(value)"
}
else {
address += "&\(key)=\(value)"
}
i += 1
}
// }
let url = URL(string: address)
var request = URLRequest.init(url: url!)
request.httpMethod = "POST"
request.httpBody = address.data(using: .utf8)
let session = URLSession.shared
let dataTask = session.dataTask(with: request) { (data, respond, error) in
if let result = try? JSONSerialization.jsonObject(with: data!, options: .mutableLeaves) as? [String : Any] {
success(result!)
}
else {
failure(error!)
}
}
dataTask.resume()
}
}
| 30.38 | 181 | 0.533904 |
89e2a112577083b586bf919c45ec1784ae98d2ff | 5,468 | kt | Kotlin | src/test/kotlin/net/robinfriedli/exec/modes/ModesTest.kt | robinfriedli/exec | f12d68dbdb0bc2b080363444dcca75851c2a7e81 | [
"MIT"
] | null | null | null | src/test/kotlin/net/robinfriedli/exec/modes/ModesTest.kt | robinfriedli/exec | f12d68dbdb0bc2b080363444dcca75851c2a7e81 | [
"MIT"
] | null | null | null | src/test/kotlin/net/robinfriedli/exec/modes/ModesTest.kt | robinfriedli/exec | f12d68dbdb0bc2b080363444dcca75851c2a7e81 | [
"MIT"
] | null | null | null | package net.robinfriedli.exec.modes
import net.robinfriedli.exec.AbstractNestedModeWrapper
import net.robinfriedli.exec.Invoker
import net.robinfriedli.exec.Mode
import net.robinfriedli.exec.MutexSync
import org.testng.Assert.*
import org.testng.annotations.DataProvider
import org.testng.annotations.Test
import java.util.concurrent.Callable
import java.util.concurrent.atomic.AtomicBoolean
import java.util.concurrent.atomic.AtomicInteger
class ModesTest {
@DataProvider
fun boolDataProvider(): Array<Any> {
return arrayOf(true, false)
}
@Test(dataProvider = "boolDataProvider")
fun testForkMode(immutableMode: Boolean) {
val mode1 = Mode
.create()
.with(AdditionModeWrapper(2))
.with(AdditionModeWrapper(7))
val mode2 = if (immutableMode) {
mode1.immutable()
} else {
mode1.fork()
}.with(AdditionModeWrapper(4))
val invoker = Invoker.defaultInstance
val res1 = invoker.invoke<Int>(mode1) { 3 }
val res2 = invoker.invoke<Int>(mode2) { 3 }
assertEquals(res1, 12)
assertEquals(res2, 16)
}
class AdditionModeWrapper(private val summand: Int) : AbstractNestedModeWrapper() {
override fun <T> wrap(callable: Callable<T>): Callable<T> {
return Callable {
(callable.call() as Int + summand) as T
}
}
}
@Test
fun testExceptionWrappingMode() {
val invoker = Invoker.newInstance()
val mode = Mode.create().with(ExceptionWrappingMode { e: Exception -> TestException(e) })
var caught: TestException? = null
try {
invoker.invoke(mode) {
throw IllegalArgumentException()
}
} catch (e: TestException) {
caught = e
}
assertNotNull(caught)
assertTrue(caught!!.cause is IllegalArgumentException)
}
@Test
fun testSynchronisationMode() {
val lock = Any()
val invoker = Invoker.newInstance()
val mode = Mode.create().with(SynchronisationMode(lock))
val counter = AtomicInteger(0)
val runCount = AtomicInteger(0)
val failed = AtomicBoolean(false)
val threads = ArrayList<Thread>()
for (i in 0 until 10) {
val thread = Thread {
invoker.invoke(mode) {
assertSynchronised(counter, runCount, failed)
}
}
threads.add(thread)
thread.start()
}
for (t in threads) {
t.join()
}
assertEquals(runCount.get(), 10)
assertEquals(counter.get(), 0)
assertFalse(failed.get())
}
@Test
fun testMutexSyncMode() {
val mutexSync = MutexSync<Int>()
val invoker = Invoker.newInstance()
val mode1 = Mode.create().with(MutexSyncMode(1, mutexSync))
val mode2 = Mode.create().with(MutexSyncMode(2, mutexSync))
val threads = ArrayList<Thread>()
val failed = AtomicBoolean(false)
val counter = AtomicInteger(0)
val runCount = AtomicInteger(0)
// assert two threads with different mutex keys can run in parallel
val thread1 = Thread {
invoker.invoke(mode1) {
counter.incrementAndGet()
Thread.sleep(500)
if (counter.get() != 2) {
failed.set(true)
}
counter.decrementAndGet()
runCount.incrementAndGet()
}
}
threads.add(thread1)
val thread2 = Thread {
invoker.invoke(mode2) {
counter.incrementAndGet()
Thread.sleep(1000)
counter.decrementAndGet()
runCount.incrementAndGet()
}
}
threads.add(thread2)
thread1.start()
thread2.start()
Thread.sleep(500)
val counter1 = AtomicInteger(0)
val counter2 = AtomicInteger(0)
for (i in 0 until 20) {
val thread = Thread {
invoker.invoke(mode1) {
assertSynchronised(counter1, runCount, failed)
}
}
threads.add(thread)
thread.start()
}
for (i in 0 until 20) {
val thread = Thread {
invoker.invoke(mode2) {
assertSynchronised(counter2, runCount, failed)
}
}
threads.add(thread)
thread.start()
}
for (t in threads) {
t.join()
}
assertEquals(runCount.get(), 42)
assertEquals(counter.get(), 0)
assertEquals(counter1.get(), 0)
assertEquals(counter2.get(), 0)
assertFalse(failed.get())
}
private fun assertSynchronised(counter: AtomicInteger, runCount: AtomicInteger, failed: AtomicBoolean) {
val prevVal = counter.getAndIncrement()
if (prevVal != 0) {
failed.set(true)
}
Thread.sleep(100)
val prevVal2 = counter.getAndDecrement()
if (prevVal2 != 1) {
failed.set(true)
}
Thread.sleep(100)
if (counter.get() != 0) {
failed.set(true)
}
runCount.incrementAndGet()
}
class TestException(cause: Exception) : RuntimeException(cause)
} | 27.477387 | 108 | 0.555779 |
c7de815013c050587027568096e7b73a8a2db2a0 | 120 | py | Python | tests/models/filters_test.py | aasiffaizal/cowin-alert-system | 4c15509e2794dea684ce0babd7fe30937a5aa527 | [
"Apache-2.0"
] | 1 | 2021-05-20T05:01:04.000Z | 2021-05-20T05:01:04.000Z | tests/models/filters_test.py | aasiffaizal/cowin-alert-system | 4c15509e2794dea684ce0babd7fe30937a5aa527 | [
"Apache-2.0"
] | null | null | null | tests/models/filters_test.py | aasiffaizal/cowin-alert-system | 4c15509e2794dea684ce0babd7fe30937a5aa527 | [
"Apache-2.0"
] | null | null | null | from models.filters import ConfiguredFilter
def test_filters_model(db):
db.query(ConfiguredFilter).limit(1).all()
| 20 | 45 | 0.783333 |
f989f9557ac153492cf2374927f9f5f6a328b88d | 2,040 | go | Go | storage/rocks/rocksdb_shard.go | abv76/vasto | ab20500557e64225e89b14a2b9e8c451ed8e2d4e | [
"Apache-2.0"
] | 252 | 2018-01-16T05:19:58.000Z | 2022-02-04T14:46:02.000Z | storage/rocks/rocksdb_shard.go | abv76/vasto | ab20500557e64225e89b14a2b9e8c451ed8e2d4e | [
"Apache-2.0"
] | 17 | 2018-05-29T11:21:04.000Z | 2019-10-15T21:37:04.000Z | storage/rocks/rocksdb_shard.go | abv76/vasto | ab20500557e64225e89b14a2b9e8c451ed8e2d4e | [
"Apache-2.0"
] | 30 | 2018-04-06T09:56:51.000Z | 2022-01-23T09:48:12.000Z | package rocks
import (
"github.com/chrislusf/glog"
"github.com/chrislusf/gorocksdb"
"github.com/chrislusf/vasto/storage/codec"
"github.com/dgryski/go-jump"
"time"
)
type shardingCompactionFilter struct {
shardId int32
shardCount int
isResizing bool
}
func (m *shardingCompactionFilter) configure(shardId int32, shardCount int) {
m.shardId = shardId
m.shardCount = shardCount
}
func (m *shardingCompactionFilter) Name() string { return "vasto.sharding" }
func (m *shardingCompactionFilter) Filter(level int, key, val []byte) (bool, []byte) {
entry := codec.FromBytes(val)
if entry == nil {
// vasto specific entries not encoded into Entry
glog.V(1).Infof("vasto internal %s: %s", string(key), string(val))
return false, nil
}
if !m.isResizing {
// do not delete anything if during resizing, in case the resizing fails
jumpHash := jump.Hash(entry.PartitionHash, m.shardCount)
if m.shardId != jumpHash {
// glog.V(1).Infof("skipping shard %d, jumpHash %d, shardCount:%d, skipping %s: %s", m.shardId, jumpHash, m.shardCount, string(key), string(val))
return true, nil
}
}
if entry.TtlSecond == 0 {
return false, nil
}
if entry.UpdatedAtNs/uint64(1000000)+uint64(entry.TtlSecond) < uint64(time.Now().Unix()) {
// glog.V(1).Infof("skipping updatedAt:%d, ttl:%d", entry.UpdatedAtNs/uint64(1000000), entry.TtlSecond, string(key), string(val))
return true, nil
}
return false, nil
}
// SetCompactionForShard changes the compaction filter to use the shardId and shardCount.
// All entries not belong to the shard will be physically purged during next compaction.
func (d *Rocks) SetCompactionForShard(shardId, shardCount int) {
d.compactionFilter.configure(int32(shardId), shardCount)
}
func (d *Rocks) PrepareForClusterResize() {
d.compactionFilter.isResizing = true
}
func (d *Rocks) CompleteClusterResize() {
d.compactionFilter.isResizing = false
}
func (d *Rocks) Compact() {
d.db.Flush(gorocksdb.NewDefaultFlushOptions())
d.db.CompactRange(gorocksdb.Range{Start: nil, Limit: nil})
}
| 30.909091 | 148 | 0.728922 |
e04821db107e49d506b9efbfc3afd4a34864c4d9 | 2,473 | swift | Swift | SmartToDo/Views/Cells/ToDoEditorDateBaseTableViewCell.swift | otakisan/SmartToDo | db14478db1dddb7e44d1c9eaa76e67f75836d00e | [
"MIT"
] | null | null | null | SmartToDo/Views/Cells/ToDoEditorDateBaseTableViewCell.swift | otakisan/SmartToDo | db14478db1dddb7e44d1c9eaa76e67f75836d00e | [
"MIT"
] | null | null | null | SmartToDo/Views/Cells/ToDoEditorDateBaseTableViewCell.swift | otakisan/SmartToDo | db14478db1dddb7e44d1c9eaa76e67f75836d00e | [
"MIT"
] | null | null | null | //
// ToDoEditorDateBaseTableViewCell.swift
// SmartToDo
//
// Created by Takashi Ikeda on 2014/11/02.
// Copyright (c) 2014ๅนด ti. All rights reserved.
//
import UIKit
class ToDoEditorDateBaseTableViewCell: ToDoEditorBaseTableViewCell {
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
func completeDelegate() -> ((UIView) -> Void)? {
return self.didFinishDetailView
}
func didFinishDetailView(detailView : UIView){
if let view = detailView as? UIDatePicker {
self.setValueForDate(view)
}
}
func setValueForDate(datePicker : UIDatePicker){
// Subclass Must Implement
}
override func setValueOfCell(value: AnyObject) {
if let entityData = value as? NSDate {
self.setDateStringOfCell(self.stringFromDate(entityData))
}
}
func setDateStringOfCell(value : String){
}
func dateFormatter() -> NSDateFormatter {
// ใใผใฟใจใใฆใฎๆฅไปใจ่กจ็คบใจใใฆใฎๆฅไปใฎๆฑใใๅใใใจใใใฐ
// ใใผใฟ๏ผๆฐๅคใใใใฏใญใฑใผใซใซใใใชใๅบๅฎใใฉใผใใใ
// ่กจ็คบ๏ผใญใฑใผใซใซๅฟใใใใฉใผใใใ
let dateFormatter = NSDateFormatter()
dateFormatter.dateFormat = "yyyy/MM/dd"
return dateFormatter
}
func stringFromDate(date : NSDate) -> String {
return self.dateFormatter().stringFromDate(date)
}
func dateFromString(dateString : String) -> NSDate? {
return self.dateFormatter().dateFromString(dateString)
}
func loadDetailView() -> CommonDatePickerViewController? {
let vc = NSBundle.mainBundle().loadNibNamed("CommonDatePickerViewController", owner: CommonDatePickerViewController(), options: nil)[0] as? CommonDatePickerViewController
return vc
}
override func createDetailView() -> UIViewController? {
var vc : CommonDatePickerViewController?
if !self.readOnly {
vc = self.loadDetailView()
vc?.setViewValue(self.detailViewInitValue()!)
vc?.completeDelegate = self.didFinishDetailView
}
return vc
}
func detailViewInitValue() -> AnyObject? {
return NSDate()
}
var readOnly : Bool {
get{ return false }
}
}
| 26.880435 | 178 | 0.627173 |
59efbe7a3b22c3643a3643d7cca6623db93c4c3f | 7,192 | sql | SQL | Create_StoredProcedure_to_Generate_Dates.sql | Sai-Charan-Nedunuri/Loan_Data_Warehouse | 9aa696a244b5222c8799e8834500eedb314290fe | [
"Unlicense"
] | null | null | null | Create_StoredProcedure_to_Generate_Dates.sql | Sai-Charan-Nedunuri/Loan_Data_Warehouse | 9aa696a244b5222c8799e8834500eedb314290fe | [
"Unlicense"
] | null | null | null | Create_StoredProcedure_to_Generate_Dates.sql | Sai-Charan-Nedunuri/Loan_Data_Warehouse | 9aa696a244b5222c8799e8834500eedb314290fe | [
"Unlicense"
] | null | null | null | USE [BankOne_DW]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE OR ALTER PROCEDURE [dbo].[Load_DimDate]
@StartDate DATE = '2000-01-01',
@EndDate DATE = '2025-12-31'
AS
BEGIN
SET NOCOUNT ON;
SET XACT_ABORT ON;
TRUNCATE TABLE [Dim_Date];
DECLARE @EndOfTime datetime = '9999-12-31';
DECLARE @LastDateLoaded datetime;
BEGIN TRAN;
INSERT INTO [int].[Lineage](
[TableName]
,[StartLoad]
,[FinishLoad]
,[Status]
,[Type]
,[LastLoadedDate]
)
VALUES (
'Dim_Date'
,GETDATE()
,NULL
,'P'
,'F'
,GETDATE()
);
-- Get the lineage of the current load of Dim_Date
DECLARE @LineageKey int = (SELECT TOP(1) [LineageKey]
FROM int.Lineage
WHERE [TableName] = N'Dim_Date'
AND [FinishLoad] IS NULL
ORDER BY [LineageKey] DESC);
IF NOT EXISTS (SELECT 1 FROM Dim_Date WHERE [Date Key] = 0)
INSERT INTO [dbo].[Dim_Date]
([Date Key]
,[Date]
,[Day]
,[Day Suffix]
,[Weekday]
,[Weekday Name]
,[Weekday Name Short]
,[Weekday Name FirstLetter]
,[Day Of Year]
,[Week Of Month]
,[Week Of Year]
,[Month]
,[Month Name]
,[Month Name Short]
,[Month Name FirstLetter]
,[Quarter]
,[Quarter Name]
,[Year]
,[MMYYYY]
,[Month Year]
,[Is Weekend]
,[Is Holiday]
,[Holiday Name]
,[Special Day]
,[First Date Of Year]
,[Last Date Of Year]
,[First Date Of Quater]
,[Last Date Of Quater]
,[First Date Of Month]
,[Last Date Of Month]
,[First Date Of Week]
,[Last Date Of Week]
,[Lineage Key])
VALUES
(0,'1753-01-01',0,'',0,'N/A','N/A','',0,0,0,0,'N/A','N/A','',0,'N/A',0,'N/A','N/A',0,0,'N/A','N/A','1753-01-01','1753-01-01','1753-01-01','1753-01-01','1753-01-01','1753-01-01','1753-01-01','1753-01-01',-1)
WHILE @StartDate < @EndDate
BEGIN
INSERT INTO [dbo].[Dim_Date] (
[Date Key]
,[Date]
,[Day]
,[Day Suffix]
,[Weekday]
,[Weekday Name]
,[Weekday Name Short]
,[Weekday Name FirstLetter]
,[Day Of Year]
,[Week Of Month]
,[Week Of Year]
,[Month]
,[Month Name]
,[Month Name Short]
,[Month Name FirstLetter]
,[Quarter]
,[Quarter Name]
,[Year]
,[MMYYYY]
,[Month Year]
,[Is Weekend]
,[Is Holiday]
,[Holiday Name]
,[Special Day]
,[First Date Of Year]
,[Last Date Of Year]
,[First Date Of Quater]
,[Last Date Of Quater]
,[First Date Of Month]
,[Last Date Of Month]
,[First Date Of Week]
,[Last Date Of Week]
,[Lineage Key]
)
SELECT DateKey = YEAR(@StartDate) * 10000 + MONTH(@StartDate) * 100 + DAY(@StartDate),
DATE = @StartDate,
Day = DAY(@StartDate),
[DaySuffix] = CASE
WHEN DAY(@StartDate) = 1
OR DAY(@StartDate) = 21
OR DAY(@StartDate) = 31
THEN 'st'
WHEN DAY(@StartDate) = 2
OR DAY(@StartDate) = 22
THEN 'nd'
WHEN DAY(@StartDate) = 3
OR DAY(@StartDate) = 23
THEN 'rd'
ELSE 'th'
END,
WEEKDAY = DATEPART(dw, @StartDate),
WeekDayName = DATENAME(dw, @StartDate),
WeekDayName_Short = UPPER(LEFT(DATENAME(dw, @StartDate), 3)),
WeekDayName_FirstLetter = LEFT(DATENAME(dw, @StartDate), 1),
[DayOfYear] = DATENAME(dy, @StartDate),
[WeekOfMonth] = DATEPART(WEEK, @StartDate) - DATEPART(WEEK, DATEADD(MM, DATEDIFF(MM, 0, @StartDate), 0)) + 1,
[WeekOfYear] = DATEPART(wk, @StartDate),
[Month] = MONTH(@StartDate),
[MonthName] = DATENAME(mm, @StartDate),
[MonthName_Short] = UPPER(LEFT(DATENAME(mm, @StartDate), 3)),
[MonthName_FirstLetter] = LEFT(DATENAME(mm, @StartDate), 1),
[Quarter] = DATEPART(q, @StartDate),
[QuarterName] = CASE
WHEN DATENAME(qq, @StartDate) = 1
THEN 'First'
WHEN DATENAME(qq, @StartDate) = 2
THEN 'second'
WHEN DATENAME(qq, @StartDate) = 3
THEN 'third'
WHEN DATENAME(qq, @StartDate) = 4
THEN 'fourth'
END,
[Year] = YEAR(@StartDate),
[MMYYYY] = RIGHT('0' + CAST(MONTH(@StartDate) AS VARCHAR(2)), 2) + CAST(YEAR(@StartDate) AS VARCHAR(4)),
[MonthYear] = CAST(YEAR(@StartDate) AS VARCHAR(4)) + UPPER(LEFT(DATENAME(mm, @StartDate), 3)),
[IsWeekend] = CASE
WHEN DATENAME(dw, @StartDate) = 'Sunday'
OR DATENAME(dw, @StartDate) = 'Saturday'
THEN 1
ELSE 0
END,
[IsHoliday] = 0,
[HolidayName] = CONVERT(varchar(20), ''),
[SpecialDays] = CONVERT(varchar(20), ''),
[FirstDateofYear] = CAST(CAST(YEAR(@StartDate) AS VARCHAR(4)) + '-01-01' AS DATE),
[LastDateofYear] = CAST(CAST(YEAR(@StartDate) AS VARCHAR(4)) + '-12-31' AS DATE),
[FirstDateofQuater] = DATEADD(qq, DATEDIFF(qq, 0, GETDATE()), 0),
[LastDateofQuater] = DATEADD(dd, - 1, DATEADD(qq, DATEDIFF(qq, 0, GETDATE()) + 1, 0)),
[FirstDateofMonth] = CAST(CAST(YEAR(@StartDate) AS VARCHAR(4)) + '-' + CAST(MONTH(@StartDate) AS VARCHAR(2)) + '-01' AS DATE),
[LastDateofMonth] = EOMONTH(@StartDate),
[FirstDateofWeek] = DATEADD(dd, - (DATEPART(dw, @StartDate) - 1), @StartDate),
[LastDateofWeek] = DATEADD(dd, 7 - (DATEPART(dw, @StartDate)), @StartDate),
@LineageKey
SET @StartDate = DATEADD(DD, 1, @StartDate)
END
--Update Holiday information
UPDATE Dim_Date
SET [Is Holiday] = 1,
[Holiday Name] = 'Republic Day'
WHERE [Month] = 1
AND [Day] = 26
UPDATE Dim_Date
SET [Is Holiday] = 1,
[Holiday Name] = 'Ambedkar Jayanti'
WHERE [Month] = 4
AND [Day] = 14
UPDATE Dim_Date
SET [Is Holiday] = 1,
[Holiday Name] = 'Independence Day'
WHERE [Month] = 8
AND [Day] = 15
UPDATE Dim_Date
SET [Is Holiday] = 1,
[Holiday Name] = 'Gandhi Jayanti'
WHERE [Month] = 10
AND [Day] = 2
UPDATE Dim_Date
SET [Is Holiday] = 1,
[Holiday Name] = 'Christmas'
WHERE [Month] = 12
AND [Day] = 25
UPDATE Dim_Date
SET [Special Day] = 'Valentines Day'
WHERE [Month] = 2
AND [Day] = 14
SELECT * FROM Dim_Date
-- Update the lineage table for the most current Dim_Date load with the finish date and
-- 'S' in the Status column, meaning that the load finished successfully
UPDATE [int].Lineage
SET
FinishLoad = SYSDATETIME(),
Status = 'S',
@LastDateLoaded = LastLoadedDate
WHERE [LineageKey] = @LineageKey;
-- Update the LoadDates table with the most current load date for Dim_Date
UPDATE [int].[IncrementalLoads]
SET [LoadDate] = @LastDateLoaded
WHERE [TableName] = N'Dim_Date';
-- All these tasks happen together or don't happen at all.
COMMIT;
RETURN 0;
END;
| 28.768 | 217 | 0.548804 |
fff6ce06a8062c246ab6b48bc6d8f4a7eea3366d | 10,662 | html | HTML | hotelsite/staff/templates/staff/staff_home.html | guapxcv/Hotel_manage | 7e99dcb6d95b6f03f530fdd67ab64e9bc0d18e2c | [
"MIT"
] | null | null | null | hotelsite/staff/templates/staff/staff_home.html | guapxcv/Hotel_manage | 7e99dcb6d95b6f03f530fdd67ab64e9bc0d18e2c | [
"MIT"
] | null | null | null | hotelsite/staff/templates/staff/staff_home.html | guapxcv/Hotel_manage | 7e99dcb6d95b6f03f530fdd67ab64e9bc0d18e2c | [
"MIT"
] | null | null | null | <meta charset="UTF-8" /> <!--ํ๊ธ๊นจ์ง์ ๋ฐฉ์ง.-->
{% extends 'staff/staff_base.html' %}
{% load staticfiles %}
{% block content %}
<div style="border:1px #dedede; width:10; height:10; overflow:auto;" >
<table cellspacing="0" class="case03" style="width:85%; margin: 10px 40px;" id="table" name="table">
<colgroup>
<col width="25%">
<col width="25%">
<col width="25%">
<col width="25%">
</colgroup>
</table>
</div>
<script language="JavaScript">
function button_click()
{
//์๋ ํ
ํ๋ฆฟ์์ ํ์ด์ฌ์ผ๋ก ๋๋น ์ ๋ณด๋ฅผ ๋ฐ์์์. ์ด์ jquery์ด์ฉํด์ ๊ทธ ๊ฐ๋ค์ ์๋ฐ์คํฌ๋ฆฝํธ๋ก ๋ฐ์์์ ์ฒ๋ฆฌํ๋ค.
var selectfloor = document.getElementById("Floor").options[document.getElementById("Floor").selectedIndex].value;
//์ผ๋จ ๋๋น ์ ๋ณด๋ฅผ ๋ฃธ๋ฒํธ,๋ฃธํ์
,๋ฃธ์ฒญ์์ํ๋ก ๋๋ ์ ์ ์ด์ฟผ๋ฆฌ๋ก ๋ฐ๋๋ค.
var roomnumlen = $("input[name = 'roomnum']").length;
var roomnum = new Array(roomnumlen);//๋ฃธ ๋ฒํธ ๋ถ๋ฌ์ฌ ๋ฐฐ์ด
for(var i=0; i<roomnumlen; i++){//๋ฃธ ๋ฒํธ ์ ์ฅํ๊ธฐ
roomnum[i] = $("input[name = 'roomnum']")[i].value;
}
var roomtypelen = $("input[name = 'roomtype']").length;
var roomtype = new Array(roomtypelen);//๋ฃธ ํ์
๋ถ๋ฌ์ฌ ๋ฐฐ์ด
for(var i=0; i<roomtypelen; i++){//๋ฃธ ํ์
๋ง ์ ์ฅํ๊ธฐ
roomtype[i] = $("input[name = 'roomtype']")[i].value;
}
var roomcleanlen = $("input[name = 'roomclean']").length;
var roomclean = new Array(roomcleanlen);//๋ฃธ ์ฒญ์์ํ ๋ถ๋ฌ์ฌ ๋ฐฐ์ด
for(var i=0; i<roomcleanlen; i++){//๋ฃธ ์ฒญ์์ํ๋ง ์ ์ฅํ๊ธฐ
roomclean[i] = $("input[name = 'roomclean']")[i].value;
}
var floor = new Array(roomnumlen);//์ธต์ ๋ด๋ ๋ฐฐ์ด
for(var i = 0; i<roomnumlen; i++){
floor[i] = Math.floor(roomnum[i]/100);//์์์ ์ ๊ฑฐํ๊ณ ์ธต๋ง ๋ฐฐ์ด์ ์ ์ฅ
}
var row_1 = 0;
var row_2 = 0;
var row_3 = 0;
var row_4 = 0;
var num = new Array();
var type = new Array();
var clean = new Array();
var tbl = document.getElementById("table");
var body = document.body;
//var tbl = document.createElement('table');
// tbl.style.width = '1000px';
//tbl.style.height = '200px';
tbl.style.border = '1px solid black';
var guboon = 0;
var a = 0;
var b = 0;
var c = 0;
var d = 0;
for(var i=0; i<roomnumlen; i++){
if(selectfloor == "01" && floor[i] == 1){
//document.write(roomnum[i],"\n",roomtype[i],"\n",roomclean[i],"<br>");
//tableCreate(roomnum[i], roomtype[i], roomclean[i]);
guboon = 1;
row_1++;
num[a] = roomnum[i];
type[a] = roomtype[i];
clean[a] = roomclean[i];
a++;
}else if(selectfloor == "02" && floor[i] == 2){
//document.write(roomnum[i],"\n",roomtype[i],"\n",roomclean[i],"<br>");
//tableCreate(roomnum[i], roomtype[i], roomclean[i]);
guboon = 2;
row_2++;
num[b] = roomnum[i];
type[b] = roomtype[i];
clean[b] = roomclean[i];
b++;
}else if(selectfloor == "03" && floor[i] == 3){
//document.write(roomnum[i],"\n",roomtype[i],"\n",roomclean[i],"<br>");
//tableCreate(roomnum[i], roomtype[i], roomclean[i]);
guboon = 3;
row_3++;
num[c] = roomnum[i];
type[c] = roomtype[i];
clean[c] = roomclean[i];
c++;
}else if(selectfloor == "04" && floor[i] == 4){
//document.write(roomnum[i],"\n",roomtype[i],"\n",roomclean[i],"<br>");
//tableCreate(roomnum[i], roomtype[i], roomclean[i]);
guboon = 4;
row_4++;
num[d] = roomnum[i];
type[d] = roomtype[i];
clean[d] = roomclean[i];
d++;
}
//์ธต์ ๋ ๋์ด๋๋ฉด ์กฐ๊ฑด๋ฌธ์ด๋ ์๋ ์ต์
์์ ์๋ก ์ถ๊ฐํ๋ฉด ๋ฉ๋๋ค.
}
if(guboon == 1){
for(var a = 0; a < row_1; a++){
var tr = tbl.insertRow();
for(var j = 0; j < 1; j++){
var td = tr.insertCell();
td.style.width = '250px';
if(num[b] != undefined)//์์์ ๋ฐฐ์ด์ด roomnumlen๋งํผ ๋์๊ฐ๋ฏ๋ก ํด๋น ์ธต์ด ์๋๊ณณ์ null๋ก ์ธ๋ํ์ธ๋ ๋๋ค. ์ธ๋ํ์ธ๋ ์๋๊ฒ๋ง ํ๋ก ์ถ๋ ฅํด์ผํ๋ค!!!
td.appendChild(document.createTextNode(num[a]));
td.style.border = '1px solid black';
}
for(var j = 0; j < 1; j++){
var td = tr.insertCell();
td.style.width = '250px';
if(num[b] != undefined)
td.appendChild(document.createTextNode(type[a]));
td.style.border = '1px solid black';
}
for(var j = 0; j < 1; j++){
var td = tr.insertCell();
td.style.width = '250px';
if(num[b] != undefined)
td.appendChild(document.createTextNode(clean[a]));
td.style.border = '1px solid black';
}
for(var j = 0; j < 1; j++){
var td = tr.insertCell();
td.style.width = '250px';
if(num[b] != undefined)
td.appendChild(document.createTextNode(" "));
td.style.border = '1px solid black';
}
}
body.appendChild(tbl);
tableCreate();
}
if(guboon == 2){
for(var b = 0; b < row_2; b++){
var tr = tbl.insertRow();
for(var j = 0; j < 1; j++){
var td = tr.insertCell();
td.style.width = '250px';
if(num[b] != undefined)
td.appendChild(document.createTextNode(num[b]));
td.style.border = '1px solid black';
}
for(var j = 0; j < 1; j++){
var td = tr.insertCell();
td.style.width = '250px';
if(num[b] != undefined)
td.appendChild(document.createTextNode(type[b]));
td.style.border = '1px solid black';
}
for(var j = 0; j < 1; j++){
var td = tr.insertCell();
td.style.width = '250px';
if(num[b] != undefined)
td.appendChild(document.createTextNode(clean[b]));
td.style.border = '1px solid black';
}
for(var j = 0; j < 1; j++){
var td = tr.insertCell();
td.style.width = '250px';
if(num[b] != undefined)
td.appendChild(document.createTextNode(" "));
td.style.border = '1px solid black';
}
}
body.appendChild(tbl);
tableCreate();
}
if(guboon == 3){
for(var c = 0; c < row_3; c++){
var tr = tbl.insertRow();
for(var j = 0; j < 1; j++){
var td = tr.insertCell();
td.style.width = '250px';
if(num[c] != undefined)
td.appendChild(document.createTextNode(num[c]));
td.style.border = '1px solid black';
}
for(var j = 0; j < 1; j++){
var td = tr.insertCell();
td.style.width = '250px';
if(num[b] != undefined)
td.appendChild(document.createTextNode(type[c]));
td.style.border = '1px solid black';
}
for(var j = 0; j < 1; j++){
var td = tr.insertCell();
td.style.width = '250px';
if(num[b] != undefined)
td.appendChild(document.createTextNode(clean[c]));
td.style.border = '1px solid black';
}
for(var j = 0; j < 1; j++){
var td = tr.insertCell();
td.style.width = '250px';
if(num[b] != undefined)
td.appendChild(document.createTextNode(" "));
td.style.border = '1px solid black';
}
}
body.appendChild(tbl);
tableCreate();
}
if(guboon == 4){
for(var d = 0; d < row_4; d++){
var tr = tbl.insertRow();
for(var j = 0; j < 1; j++){
var td = tr.insertCell();
td.style.width = '250px';
if(num[d] != undefined)
td.appendChild(document.createTextNode(num[d]));
td.style.border = '1px solid black';
}
for(var j = 0; j < 1; j++){
var td = tr.insertCell();
td.style.width = '250px';
if(num[b] != undefined)
td.appendChild(document.createTextNode(type[d]));
td.style.border = '1px solid black';
}
for(var j = 0; j < 1; j++){
var td = tr.insertCell();
td.style.width = '250px';
if(num[b] != undefined)
td.appendChild(document.createTextNode(clean[d]));
td.style.border = '1px solid black';
}
for(var j = 0; j < 1; j++){
var td = tr.insertCell();
td.style.width = '250px';
if(num[b] != undefined)
td.appendChild(document.createTextNode(" "));
td.style.border = '1px solid black';
}
}
body.appendChild(tbl);
tableCreate();
}
}
</script><!--๋ฒํผ์ด๋ฒคํธ ํ
์คํธ-->
<div class="row">
<div class="col-2 mb-3">
<label for="checkin">์ธต์</label><br>
<div class="field-icon-wrap">
<div class="icon"><span class="ion-ios-arrow-down"></span></div>
<select name="Floor" id="Floor" onchange="button_click();">
<option value="X">์ธต ์ ํ</option>
<option value="01">1</option>
<option value="02">2</option>
<option value="03">3</option>
<option value="04">4</option>
<!--์ธต์๋ ๋์ค์ ๋ ์ถ๊ฐํ๋ฉด ๋ฉ๋๋ค.-->
</select>
<input type=button value="ํ์ธ" style="width:30pt;height:20pt;" onclick="location.reload()">
<!--ํด๋ฆญํ ๋๋ง๋ค ํ
์ด๋ธ์ด ๊ณ์ ์๊ฒจ์... ์์๋ฐฉํธ์ผ๋ก ๋ง๋ค์ด๋์ ์๋ก๊ณ ์นจ ๋ฒํผ์ด์์ใ
ใ
-->
<div class="">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-3">ํธ์ค</div>
<div class="col-3">ํ์
</div>
<div class="col-3">์ฒญ์์ํ</div>
<div class="col-3">์์ฝ์ํ</div>
</div>
<!--์ด ๋๋น ์ ๋ณด๋ ํ๋ ์ด๋ผ ์ค์ ํ์ด์ง์์๋ ์๋ณด์
๋๋ค.-->
{% for room in rooms %}
<input class="col-3" type="hidden" name="roomnum" value = {{room.room_num}}>
<input class="col-3" type="hidden" name="roomtype" value = {{room.room_type}}>
<input class="col-3" type="hidden" name="roomclean" value = {{room.status_clean}}>
{% endfor %}
{% endblock %} | 35.54 | 118 | 0.46783 |