repo_name stringlengths 6 101 | path stringlengths 4 300 | text stringlengths 7 1.31M |
|---|---|---|
kiwicom/mobile | scripts/hexToRgba.js | // @flow
const hexToRgba = (hex: string, opacity: number): string => {
// Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF")
const shorthandRegex = /^#?(?<r>[a-f\d])(?<g>[a-f\d])(?<b>[a-f\d])$/i;
const replacedHex = hex.replace(shorthandRegex, (match, r, g, b) => {
return r + r + g + g + b + b;
});
const result = /^#?(?<red>[a-f\d]{2})(?<green>[a-f\d]{2})(?<blue>[a-f\d]{2})$/i.exec(replacedHex);
const { red, green, blue } = result?.groups ?? {};
return result
? `rgba(${parseInt(red, 16)}, ${parseInt(green, 16)}, ${parseInt(blue, 16)}, ${opacity})`
: 'rgba(0,0,0,0)';
};
module.exports = hexToRgba;
|
billwert/azure-sdk-for-java | sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/LocationCheckNameAvailabilitySamples.java | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.batch.generated;
import com.azure.core.util.Context;
import com.azure.resourcemanager.batch.models.CheckNameAvailabilityParameters;
/** Samples for Location CheckNameAvailability. */
public final class LocationCheckNameAvailabilitySamples {
/*
* x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-01-01/examples/LocationCheckNameAvailability_AlreadyExists.json
*/
/**
* Sample code: LocationCheckNameAvailability_AlreadyExists.
*
* @param manager Entry point to BatchManager.
*/
public static void locationCheckNameAvailabilityAlreadyExists(
com.azure.resourcemanager.batch.BatchManager manager) {
manager
.locations()
.checkNameAvailabilityWithResponse(
"japaneast", new CheckNameAvailabilityParameters().withName("existingaccountname"), Context.NONE);
}
/*
* x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-01-01/examples/LocationCheckNameAvailability_Available.json
*/
/**
* Sample code: LocationCheckNameAvailability_Available.
*
* @param manager Entry point to BatchManager.
*/
public static void locationCheckNameAvailabilityAvailable(com.azure.resourcemanager.batch.BatchManager manager) {
manager
.locations()
.checkNameAvailabilityWithResponse(
"japaneast", new CheckNameAvailabilityParameters().withName("newaccountname"), Context.NONE);
}
}
|
Lattice-Works/lattice-orgs | src/core/redux/selectors/selectUser.js | /*
* @flow
*/
import { Map, getIn } from 'immutable';
import { USERS } from '../../../common/constants';
export default function selectUser(userId :string) {
return (state :Map) :Map => getIn(state, [USERS, USERS, userId]) || Map();
}
|
cloudwebrtc/sys | sys-account/service/go/dao/query_params.go | package dao
import "github.com/getcouragenow/sys/sys-account/service/go/pkg/utilities"
// QueryParams can be any condition
type QueryParams struct {
Params map[string]interface{}
}
func (qp *QueryParams) ColumnsAndValues() ([]string, []interface{}) {
var columns []string
var values []interface{}
for k, v := range qp.Params {
columns = append(columns, utilities.ToSnakeCase(k))
values = append(values, v)
}
return columns, values
}
|
XpressAI/frovedis | src/foreign_if/server/ml_result.hpp | <filename>src/foreign_if/server/ml_result.hpp
#ifndef _ML_RESULT_HPP_
#define _ML_RESULT_HPP_
using namespace frovedis;
struct lu_fact_result {
lu_fact_result() {}
lu_fact_result(exrpc_ptr_t ptr, int stat):
ipiv_ptr(ptr), info(stat) {}
exrpc_ptr_t ipiv_ptr;
int info;
SERIALIZE(ipiv_ptr, info)
};
struct svd_result {
svd_result() {}
svd_result(exrpc_ptr_t sptr, exrpc_ptr_t uptr, exrpc_ptr_t vptr,
int mm, int nn, int kk, int stat) :
svec_ptr(sptr), umat_ptr(uptr), vmat_ptr(vptr),
m(mm), n(nn), k(kk), info(stat) {}
exrpc_ptr_t svec_ptr, umat_ptr, vmat_ptr;
int m, n, k, info;
SERIALIZE(svec_ptr,umat_ptr,vmat_ptr,m,n,k,info)
};
struct eigen_result {
eigen_result() {}
eigen_result(exrpc_ptr_t sptr, exrpc_ptr_t uptr,int mm, int nn, int kk):
svec_ptr(sptr), umat_ptr(uptr), m(mm), n(nn), k(kk) {}
exrpc_ptr_t svec_ptr, umat_ptr;
int m, n, k;
SERIALIZE(svec_ptr,umat_ptr,m,n,k);
};
struct knn_result {
knn_result() {}
knn_result(int k,
exrpc_ptr_t indices_ptr, size_t nrow_ind, size_t ncol_ind,
exrpc_ptr_t distances_ptr, size_t nrow_dist, size_t ncol_dist):
k(k), nrow_ind(nrow_ind), ncol_ind(ncol_ind),
nrow_dist(nrow_dist), ncol_dist(ncol_dist),
indices_ptr(indices_ptr), distances_ptr(distances_ptr) {}
int k;
size_t nrow_ind, ncol_ind, nrow_dist, ncol_dist;
exrpc_ptr_t indices_ptr, distances_ptr;
SERIALIZE(k, nrow_ind, ncol_ind, nrow_dist, ncol_dist, indices_ptr,
distances_ptr)
};
struct pca_result {
pca_result() {}
pca_result(int m, int n, int k, double noise,
exrpc_ptr_t comp_ptr, exrpc_ptr_t score_ptr,
exrpc_ptr_t eig_ptr, exrpc_ptr_t var_ratio_ptr,
exrpc_ptr_t sval_ptr, exrpc_ptr_t mean_ptr):
n_samples(m), n_features(n), n_components(k), noise(noise),
comp_ptr(comp_ptr), score_ptr(score_ptr), eig_ptr(eig_ptr),
var_ratio_ptr(var_ratio_ptr), sval_ptr(sval_ptr), mean_ptr(mean_ptr) {}
int n_samples, n_features, n_components;
double noise;
exrpc_ptr_t comp_ptr, score_ptr, eig_ptr, var_ratio_ptr, sval_ptr, mean_ptr;
SERIALIZE(n_samples, n_features, n_components, noise,
comp_ptr, score_ptr, eig_ptr,
var_ratio_ptr, sval_ptr, mean_ptr)
};
struct tsne_result {
tsne_result() {}
tsne_result(size_t m, size_t k, size_t n_iter_, double kl_divergence_,
exrpc_ptr_t embedding_ptr):
n_samples(m), n_comps(k),
n_iter_(n_iter_), kl_divergence_(kl_divergence_),
embedding_ptr(embedding_ptr) {}
size_t n_samples, n_comps, n_iter_;
double kl_divergence_;
exrpc_ptr_t embedding_ptr;
SERIALIZE(n_samples, n_comps, n_iter_, kl_divergence_,
embedding_ptr)
};
struct kmeans_result {
kmeans_result() { n_iter_ = 0; } // to suppress compiler warning in spark wrapper
kmeans_result(const std::vector<int>& label,
const int n_iter,
const float inertia,
const int n_clusters,
exrpc_ptr_t trans_mat_ptr,
size_t trans_mat_nsamples):
label_(label), n_iter_(n_iter), inertia_(inertia),
n_clusters_(n_clusters),
trans_mat_ptr(trans_mat_ptr),
trans_mat_nsamples(trans_mat_nsamples) {}
std::vector<int> label_;
int n_iter_;
float inertia_;
int n_clusters_;
exrpc_ptr_t trans_mat_ptr;
size_t trans_mat_nsamples;
SERIALIZE(label_, n_iter_, inertia_, n_clusters_,
trans_mat_ptr, trans_mat_nsamples)
};
struct gmm_result {
gmm_result() { n_iter_ = 0; } // to suppress compiler warning in spark wrapper
gmm_result(const int n_iter,
const double likelihood):
n_iter_(n_iter),
likelihood_(likelihood){}
int n_iter_;
double likelihood_;
SERIALIZE(n_iter_, likelihood_);
};
template <class T>
struct lnr_result {
lnr_result() { n_iter = 0; } // to suppress compiler warning in spark wrapper
lnr_result(int n_iter,
int rank, std::vector<T>& sval):
n_iter(n_iter), rank(rank) {
singular.swap(sval); // assumes sval is no longer required at caller side
}
int n_iter, rank;
std::vector<T> singular;
SERIALIZE(n_iter, rank, singular);
};
#endif
|
eozturk1/epid-sdk | epid/member/split/src/resize.c | <filename>epid/member/split/src/resize.c
/*############################################################################
# Copyright 2017-2018 Intel Corporation
#
# 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.
############################################################################*/
/// Implements ResizeOctStr
/*! \file */
#include "epid/member/split/src/resize.h"
#include <stdint.h>
#include "epid/common/src/memory.h"
EpidStatus ResizeOctStr(ConstOctStr a, size_t a_size, OctStr r, size_t r_size) {
if (!a || !a_size || !r || !r_size) return kEpidBadArgErr;
if (a_size <= r_size) {
memset(r, 0, r_size - a_size);
if (memcpy_S((uint8_t*)r + (r_size - a_size), a_size, a, a_size))
return kEpidErr;
} else {
size_t i;
for (i = 0; i < a_size - r_size; i++) {
if (((uint8_t*)a)[i])
return kEpidBadArgErr; // a does not fit into r_size
}
if (memcpy_S(r, r_size, (uint8_t*)a + (a_size - r_size), r_size))
return kEpidErr;
}
return kEpidNoErr;
}
|
j3270/SAMD_Experiments | xdk-asf-3.51.0/thirdparty/wireless/bt_wilc_sdk/bt_src/classic/pbap_client.c | /*
* Copyright (C) 2014 BlueKitchen GmbH
*
* 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. Neither the name of the copyright holders nor the names of
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
* 4. Any redistribution, use, or modification is done solely for
* personal benefit and not for any commercial purpose or for
* monetary gain.
*
* THIS SOFTWARE IS PROVIDED BY BLUEKITCHEN GMBH AND CONTRIBUTORS
* ``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 MATTHIAS
* RINGWALD OR CONTRIBUTORS 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.
*
* Please inquire about commercial licensing options at
* <EMAIL>
*
*/
#define __BTSTACK_FILE__ "pbap_client.c"
// *****************************************************************************
//
#if 0
0x0000 = uint32(65542),
// BLUETOOTH_SERVICE_CLASS_PHONEBOOK_ACCESS_PSE
0x0001 = { uuid16(11 2f) },
// BLUETOOTH_PROTOCOL_L2CAP, BLUETOOTH_PROTOCOL_RFCOMM, BLUETOOTH_PROTOCOL_OBEX
0x0004 = { { uuid16(01 00) }, { uuid16(00 03), uint8(19) }, { uuid16(00 08) } }
0x0005 = { uuid16(10 02) },
// BLUETOOTH_SERVICE_CLASS_PHONEBOOK_ACCESS, v1.01 = 0x101
0x0009 = { { uuid16(11 30), uint16(257) } },
0x0100 = string(OBEX Phonebook Access Server
// BLUETOOTH_ATTRIBUTE_SUPPORTED_FEATURES -- should be 0x317 BLUETOOTH_ATTRIBUTE_PBAP_SUPPORTED_FEATURES?
0x0311 = uint8(3),
// BLUETOOTH_ATTRIBUTE_SUPPORTED_REPOSITORIES
0x0314 = uint8(1),
#endif
//
// *****************************************************************************
#include "btstack_config.h"
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "hci_cmd.h"
#include "btstack_run_loop.h"
#include "btstack_debug.h"
#include "hci.h"
#include "btstack_memory.h"
#include "hci_dump.h"
#include "l2cap.h"
#include "bluetooth_sdp.h"
#include "classic/sdp_client_rfcomm.h"
#include "btstack_event.h"
#include "classic/obex.h"
#include "classic/obex_iterator.h"
#include "classic/goep_client.h"
#include "classic/pbap_client.h"
// 796135f0-f0c5-11d8-0966- 0800200c9a66
uint8_t pbap_uuid[] = { 0x79, 0x61, 0x35, 0xf0, 0xf0, 0xc5, 0x11, 0xd8, 0x09, 0x66, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66};
const char * pbap_type = "x-bt/phonebook";
const char * pbap_name = "pb.vcf";
typedef enum {
PBAP_INIT = 0,
PBAP_W4_GOEP_CONNECTION,
PBAP_W2_SEND_CONNECT_REQUEST,
PBAP_W4_CONNECT_RESPONSE,
PBAP_CONNECT_RESPONSE_RECEIVED,
PBAP_CONNECTED,
//
PBAP_W2_PULL_PHONE_BOOK,
PBAP_W4_PHONE_BOOK,
PBAP_W2_SET_PATH_ROOT,
PBAP_W4_SET_PATH_ROOT_COMPLETE,
PBAP_W2_SET_PATH_ELEMENT,
PBAP_W4_SET_PATH_ELEMENT_COMPLETE,
} pbap_state_t;
typedef struct pbap_client {
pbap_state_t state;
uint16_t cid;
bd_addr_t bd_addr;
hci_con_handle_t con_handle;
uint8_t incoming;
uint16_t goep_cid;
btstack_packet_handler_t client_handler;
const char * current_folder;
uint16_t set_path_offset;
} pbap_client_t;
static pbap_client_t _pbap_client;
static pbap_client_t * pbap_client = &_pbap_client;
static inline void pbap_client_emit_connected_event(pbap_client_t * context, uint8_t status){
uint8_t event[15];
int pos = 0;
event[pos++] = HCI_EVENT_PBAP_META;
pos++; // skip len
event[pos++] = PBAP_SUBEVENT_CONNECTION_OPENED;
little_endian_store_16(event,pos,context->cid);
pos+=2;
event[pos++] = status;
memcpy(&event[pos], context->bd_addr, 6);
pos += 6;
little_endian_store_16(event,pos,context->con_handle);
pos += 2;
event[pos++] = context->incoming;
event[1] = pos - 2;
if (pos != sizeof(event)) log_error("goep_client_emit_connected_event size %u", pos);
context->client_handler(HCI_EVENT_PACKET, context->cid, &event[0], pos);
}
static inline void pbap_client_emit_connection_closed_event(pbap_client_t * context){
uint8_t event[5];
int pos = 0;
event[pos++] = HCI_EVENT_PBAP_META;
pos++; // skip len
event[pos++] = PBAP_SUBEVENT_CONNECTION_CLOSED;
little_endian_store_16(event,pos,context->cid);
pos+=2;
event[1] = pos - 2;
if (pos != sizeof(event)) log_error("pbap_client_emit_connection_closed_event size %u", pos);
context->client_handler(HCI_EVENT_PACKET, context->cid, &event[0], pos);
}
static inline void pbap_client_emit_operation_complete_event(pbap_client_t * context, uint8_t status){
uint8_t event[6];
int pos = 0;
event[pos++] = HCI_EVENT_PBAP_META;
pos++; // skip len
event[pos++] = PBAP_SUBEVENT_OPERATION_COMPLETED;
little_endian_store_16(event,pos,context->cid);
pos+=2;
event[pos++]= status;
event[1] = pos - 2;
if (pos != sizeof(event)) log_error("pbap_client_emit_can_send_now_event size %u", pos);
context->client_handler(HCI_EVENT_PACKET, context->cid, &event[0], pos);
}
static void pbap_handle_can_send_now(void){
uint8_t path_element[20];
uint16_t path_element_start;
uint16_t path_element_len;
switch (pbap_client->state){
case PBAP_W2_SEND_CONNECT_REQUEST:
goep_client_create_connect_request(pbap_client->goep_cid, OBEX_VERSION, 0, OBEX_MAX_PACKETLEN_DEFAULT);
goep_client_add_header_target(pbap_client->goep_cid, 16, pbap_uuid);
// state
pbap_client->state = PBAP_W4_CONNECT_RESPONSE;
// send packet
goep_client_execute(pbap_client->goep_cid);
return;
case PBAP_W2_PULL_PHONE_BOOK:
goep_client_create_get_request(pbap_client->goep_cid);
goep_client_add_header_type(pbap_client->goep_cid, pbap_type);
goep_client_add_header_name(pbap_client->goep_cid, pbap_name);
// state
pbap_client->state = PBAP_W4_PHONE_BOOK;
// send packet
goep_client_execute(pbap_client->goep_cid);
break;
case PBAP_W2_SET_PATH_ROOT:
goep_client_create_set_path_request(pbap_client->goep_cid, 1 << 1); // Don’t create directory
// On Android 4.2 Cyanogenmod, using "" as path fails
// goep_client_add_header_name(pbap_client->goep_cid, ""); // empty == /
// state
pbap_client->state = PBAP_W4_SET_PATH_ROOT_COMPLETE;
// send packet
goep_client_execute(pbap_client->goep_cid);
break;
case PBAP_W2_SET_PATH_ELEMENT:
// find '/' or '\0'
path_element_start = pbap_client->set_path_offset;
while (pbap_client->current_folder[pbap_client->set_path_offset] != '\0' &&
pbap_client->current_folder[pbap_client->set_path_offset] != '/'){
pbap_client->set_path_offset++;
}
// skip /
if (pbap_client->current_folder[pbap_client->set_path_offset] == '/'){
pbap_client->set_path_offset++;
}
path_element_len = pbap_client->set_path_offset-path_element_start;
memcpy(path_element, &pbap_client->current_folder[path_element_start], path_element_len);
path_element[path_element_len] = 0;
goep_client_create_set_path_request(pbap_client->goep_cid, 1 << 1); // Don’t create directory
goep_client_add_header_name(pbap_client->goep_cid, (const char *) path_element); // next element
// state
pbap_client->state = PBAP_W4_SET_PATH_ELEMENT_COMPLETE;
// send packet
goep_client_execute(pbap_client->goep_cid);
break;
default:
break;
}
}
static void pbap_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){
UNUSED(channel); // ok: there is no channel
UNUSED(size); // ok: handling own geop events
obex_iterator_t it;
uint8_t status;
switch (packet_type){
case HCI_EVENT_PACKET:
switch (hci_event_packet_get_type(packet)) {
case HCI_EVENT_GOEP_META:
switch (hci_event_goep_meta_get_subevent_code(packet)){
case GOEP_SUBEVENT_CONNECTION_OPENED:
status = goep_subevent_connection_opened_get_status(packet);
pbap_client->con_handle = goep_subevent_connection_opened_get_con_handle(packet);
pbap_client->incoming = goep_subevent_connection_opened_get_incoming(packet);
goep_subevent_connection_opened_get_bd_addr(packet, pbap_client->bd_addr);
if (status){
log_info("pbap: connection failed %u", status);
pbap_client->state = PBAP_INIT;
pbap_client_emit_connected_event(pbap_client, status);
} else {
log_info("pbap: connection established");
pbap_client->goep_cid = goep_subevent_connection_opened_get_goep_cid(packet);
pbap_client->state = PBAP_W2_SEND_CONNECT_REQUEST;
goep_client_request_can_send_now(pbap_client->goep_cid);
}
break;
case GOEP_SUBEVENT_CONNECTION_CLOSED:
if (pbap_client->state != PBAP_CONNECTED){
pbap_client_emit_operation_complete_event(pbap_client, OBEX_DISCONNECTED);
}
pbap_client->state = PBAP_INIT;
pbap_client_emit_connection_closed_event(pbap_client);
break;
case GOEP_SUBEVENT_CAN_SEND_NOW:
pbap_handle_can_send_now();
break;
}
break;
default:
break;
}
break;
case GOEP_DATA_PACKET:
// TODO: handle chunked data
#if 0
obex_dump_packet(goep_client_get_request_opcode(pbap_client->goep_cid), packet, size);
#endif
switch (pbap_client->state){
case PBAP_W4_CONNECT_RESPONSE:
for (obex_iterator_init_with_response_packet(&it, goep_client_get_request_opcode(pbap_client->goep_cid), packet, size); obex_iterator_has_more(&it) ; obex_iterator_next(&it)){
uint8_t hi = obex_iterator_get_hi(&it);
if (hi == OBEX_HEADER_CONNECTION_ID){
goep_client_set_connection_id(pbap_client->goep_cid, obex_iterator_get_data_32(&it));
}
}
if (packet[0] == OBEX_RESP_SUCCESS){
pbap_client->state = PBAP_CONNECTED;
pbap_client_emit_connected_event(pbap_client, 0);
} else {
log_info("pbap: obex connect failed, result 0x%02x", packet[0]);
pbap_client->state = PBAP_INIT;
pbap_client_emit_connected_event(pbap_client, OBEX_CONNECT_FAILED);
}
break;
case PBAP_W4_SET_PATH_ROOT_COMPLETE:
case PBAP_W4_SET_PATH_ELEMENT_COMPLETE:
if (packet[0] == OBEX_RESP_SUCCESS){
if (pbap_client->current_folder){
pbap_client->state = PBAP_W2_SET_PATH_ELEMENT;
goep_client_request_can_send_now(pbap_client->goep_cid);
} else {
pbap_client_emit_operation_complete_event(pbap_client, 0);
}
} else if (packet[0] == OBEX_RESP_NOT_FOUND){
pbap_client->state = PBAP_CONNECTED;
pbap_client_emit_operation_complete_event(pbap_client, OBEX_NOT_FOUND);
} else {
pbap_client->state = PBAP_CONNECTED;
pbap_client_emit_operation_complete_event(pbap_client, OBEX_UNKNOWN_ERROR);
}
break;
case PBAP_W4_PHONE_BOOK:
for (obex_iterator_init_with_response_packet(&it, goep_client_get_request_opcode(pbap_client->goep_cid), packet, size); obex_iterator_has_more(&it) ; obex_iterator_next(&it)){
uint8_t hi = obex_iterator_get_hi(&it);
if (hi == OBEX_HEADER_BODY || hi == OBEX_HEADER_END_OF_BODY){
uint16_t data_len = obex_iterator_get_data_len(&it);
const uint8_t * data = obex_iterator_get_data(&it);
pbap_client->client_handler(PBAP_DATA_PACKET, pbap_client->cid, (uint8_t *) data, data_len);
}
}
if (packet[0] == OBEX_RESP_CONTINUE){
pbap_client->state = PBAP_W2_PULL_PHONE_BOOK;
goep_client_request_can_send_now(pbap_client->goep_cid);
} else if (packet[0] == OBEX_RESP_SUCCESS){
pbap_client->state = PBAP_CONNECTED;
pbap_client_emit_operation_complete_event(pbap_client, 0);
} else {
pbap_client->state = PBAP_CONNECTED;
pbap_client_emit_operation_complete_event(pbap_client, OBEX_UNKNOWN_ERROR);
}
break;
default:
break;
}
break;
default:
break;
}
}
void pbap_client_init(void){
memset(pbap_client, 0, sizeof(pbap_client_t));
pbap_client->state = PBAP_INIT;
pbap_client->cid = 1;
}
uint8_t pbap_connect(btstack_packet_handler_t handler, bd_addr_t addr, uint16_t * out_cid){
if (pbap_client->state != PBAP_INIT) return BTSTACK_MEMORY_ALLOC_FAILED;
pbap_client->state = PBAP_W4_GOEP_CONNECTION;
pbap_client->client_handler = handler;
uint8_t err = goep_client_create_connection(&pbap_packet_handler, addr, BLUETOOTH_SERVICE_CLASS_PHONEBOOK_ACCESS_PSE, &pbap_client->goep_cid);
*out_cid = pbap_client->cid;
if (err) return err;
return 0;
}
uint8_t pbap_disconnect(uint16_t pbap_cid){
UNUSED(pbap_cid);
if (pbap_client->state != PBAP_CONNECTED) return BTSTACK_BUSY;
goep_client_disconnect(pbap_client->goep_cid);
return 0;
}
uint8_t pbap_pull_phonebook(uint16_t pbap_cid){
UNUSED(pbap_cid);
if (pbap_client->state != PBAP_CONNECTED) return BTSTACK_BUSY;
pbap_client->state = PBAP_W2_PULL_PHONE_BOOK;
goep_client_request_can_send_now(pbap_client->goep_cid);
return 0;
}
uint8_t pbap_set_phonebook(uint16_t pbap_cid, const char * path){
UNUSED(pbap_cid);
if (pbap_client->state != PBAP_CONNECTED) return BTSTACK_BUSY;
pbap_client->state = PBAP_W2_SET_PATH_ROOT;
pbap_client->current_folder = path;
pbap_client->set_path_offset = 0;
goep_client_request_can_send_now(pbap_client->goep_cid);
return 0;
}
|
Fatman13/venus | pkg/chainsync/types/syncstate.go | <filename>pkg/chainsync/types/syncstate.go
package types
import "fmt"
//just compatible code lotus
type SyncStateStage int
const (
StageIdle = SyncStateStage(iota)
StateInSyncing
StageSyncComplete
StageSyncErrored
)
func (v SyncStateStage) String() string {
switch v {
case StageIdle:
return "wait"
case StateInSyncing:
return "syncing"
case StageSyncComplete:
return "complete"
case StageSyncErrored:
return "error"
default:
return fmt.Sprintf("<unknown: %d>", v)
}
}
|
MccreeFei/jframe | jframe-plugin/jframe-getui/src/test/java/os_sdk_java/testSetTagList.java | package os_sdk_java;
import java.util.ArrayList;
import java.util.List;
import com.gexin.rp.sdk.base.IIGtQuery;
import com.gexin.rp.sdk.base.IPushResult;
import com.gexin.rp.sdk.base.IQueryResult;
import com.gexin.rp.sdk.http.IGtPush;
public class testSetTagList {
static String appId = "";
static String appkey = "";
static String master = "";
static String CID = "";
static String host = "http://sdk.open.api.igexin.com/apiex.htm";
public static void testSetTag(IIGtQuery push, String appId, String cid, List<String> tagList) {
push.setClientTag(appId, cid, tagList);
}
public static void main(String[] args) throws Exception {
setTag();
System.out.println(CID);
// System.out.println(Integer.MAX_VALUE);
}
public static void testSetTagList() throws Exception {
IIGtQuery push = new IGtPush(host, appkey, master);
List<String> tagList = new ArrayList<String>();
tagList.add("set888");
// tagList.add("set3");
testSetTag(push, appId, CID, tagList);
}
public static void setTag() {
IGtPush push = new IGtPush(host, appkey, master);
List<String> tagList = new ArrayList<String>();
tagList.add(String.valueOf("卡卡"));
tagList.add(host);
tagList.add("CCCCCCCCCCCCCC");
IQueryResult ret = push.setClientTag(appId, CID, tagList);
System.out.println(ret.getResponse().toString());
}
public static void getUserTag() {
IGtPush push = new IGtPush(host, appkey, master);
IPushResult ret = push.getUserTags(appId, CID);
System.out.println(ret);
}
}
|
brenzel/octosql | execution/group_by_test.go | <reponame>brenzel/octosql
package execution_test
import (
"context"
"testing"
"time"
"github.com/cube2222/octosql"
. "github.com/cube2222/octosql/execution"
"github.com/cube2222/octosql/execution/aggregates"
"github.com/cube2222/octosql/storage"
)
func TestGroupBy_SimpleBatch(t *testing.T) {
stateStorage := storage.GetTestStorage(t)
ctx := context.Background()
fields := []octosql.VariableName{"cat", "livesleft", "ownerid"}
source := NewDummyNode([]*Record{
NewRecordFromSliceWithNormalize(fields, []interface{}{"Buster", 9, 5}),
NewRecordFromSliceWithNormalize(fields, []interface{}{"Precious", 6, 4}),
NewRecordFromSliceWithNormalize(fields, []interface{}{"Nala", 5, 3}),
NewRecordFromSliceWithNormalize(fields, []interface{}{"Tiger", 4, 3}),
NewRecordFromSliceWithNormalize(fields, []interface{}{"Lucy", 3, 3}),
})
gb := NewGroupBy(
stateStorage,
source,
[]Expression{NewVariable(octosql.NewVariableName("ownerid"))},
[]octosql.VariableName{
octosql.NewVariableName("ownerid"),
octosql.NewVariableName("livesleft"),
octosql.NewVariableName("livesleft"),
},
[]AggregatePrototype{
aggregates.AggregateTable["key"],
aggregates.AggregateTable["avg"],
aggregates.AggregateTable["count"],
},
octosql.NewVariableName(""),
[]octosql.VariableName{
octosql.NewVariableName("ownerid"),
octosql.NewVariableName("livesleft_avg"),
octosql.NewVariableName("livesleft_count"),
},
octosql.NewVariableName(""),
NewWatermarkTrigger(),
)
outFields := []octosql.VariableName{"ownerid", "livesleft_avg", "livesleft_count"}
expectedOutput := []*Record{
NewRecordFromSliceWithNormalize(outFields, []interface{}{3, 4.0, 3}),
NewRecordFromSliceWithNormalize(outFields, []interface{}{4, 6.0, 1}),
NewRecordFromSliceWithNormalize(outFields, []interface{}{5, 9.0, 1}),
}
stream := GetTestStream(t, stateStorage, octosql.NoVariables(), gb)
tx := stateStorage.BeginTransaction()
want := NewInMemoryStream(storage.InjectStateTransaction(context.Background(), tx), expectedOutput)
if err := tx.Commit(); err != nil {
t.Fatal(err)
}
err := AreStreamsEqualNoOrderingWithIDCheck(ctx, stateStorage, stream, want, WithEqualityBasedOn(EqualityOfEverythingButIDs))
if err != nil {
t.Fatal(err)
}
if err := stream.Close(ctx, stateStorage); err != nil {
t.Errorf("Couldn't close group_by stream: %v", err)
return
}
if err := want.Close(ctx, stateStorage); err != nil {
t.Errorf("Couldn't close wanted in_memory stream: %v", err)
return
}
}
func TestGroupBy_BatchWithUndos(t *testing.T) {
stateStorage := storage.GetTestStorage(t)
ctx := context.Background()
fields := []octosql.VariableName{"cat", "livesleft", "ownerid"}
source := NewDummyNode([]*Record{
NewRecordFromSliceWithNormalize(fields, []interface{}{"Buster", 9, 5}),
NewRecordFromSliceWithNormalize(fields, []interface{}{"Precious", 6, 4}),
NewRecordFromSliceWithNormalize(fields, []interface{}{"Precious", 6, 4}, WithUndo()),
NewRecordFromSliceWithNormalize(fields, []interface{}{"Precious", 6, 4}),
NewRecordFromSliceWithNormalize(fields, []interface{}{"Precious", 6, 4}, WithUndo()),
NewRecordFromSliceWithNormalize(fields, []interface{}{"Precious", 6, 4}),
NewRecordFromSliceWithNormalize(fields, []interface{}{"Precious", 6, 4}, WithUndo()),
NewRecordFromSliceWithNormalize(fields, []interface{}{"Precious", 5, 4}),
NewRecordFromSliceWithNormalize(fields, []interface{}{"Nala", 6, 3}),
NewRecordFromSliceWithNormalize(fields, []interface{}{"Tiger", 4, 3}),
NewRecordFromSliceWithNormalize(fields, []interface{}{"Tiger", 4, 3}, WithUndo()),
NewRecordFromSliceWithNormalize(fields, []interface{}{"Lucy", 4, 3}),
})
gb := NewGroupBy(
stateStorage,
source,
[]Expression{NewVariable(octosql.NewVariableName("ownerid"))},
[]octosql.VariableName{
octosql.NewVariableName("ownerid"),
octosql.NewVariableName("livesleft"),
octosql.NewVariableName("livesleft"),
},
[]AggregatePrototype{
aggregates.AggregateTable["key"],
aggregates.AggregateTable["avg"],
aggregates.AggregateTable["count"],
},
octosql.NewVariableName(""),
[]octosql.VariableName{
octosql.NewVariableName("ownerid"),
octosql.NewVariableName("livesleft_avg"),
octosql.NewVariableName("livesleft_count"),
},
octosql.NewVariableName(""),
NewWatermarkTrigger(),
)
outFields := []octosql.VariableName{"ownerid", "livesleft_avg", "livesleft_count"}
expectedOutput := []*Record{
NewRecordFromSliceWithNormalize(outFields, []interface{}{3, 5.0, 2}),
NewRecordFromSliceWithNormalize(outFields, []interface{}{4, 5.0, 1}),
NewRecordFromSliceWithNormalize(outFields, []interface{}{5, 9.0, 1}),
}
stream := GetTestStream(t, stateStorage, octosql.NoVariables(), gb)
tx := stateStorage.BeginTransaction()
want := NewInMemoryStream(storage.InjectStateTransaction(context.Background(), tx), expectedOutput)
if err := tx.Commit(); err != nil {
t.Fatal(err)
}
err := AreStreamsEqualNoOrderingWithIDCheck(ctx, stateStorage, stream, want, WithEqualityBasedOn(EqualityOfEverythingButIDs))
if err != nil {
t.Fatal(err)
}
if err := stream.Close(ctx, stateStorage); err != nil {
t.Errorf("Couldn't close group_by stream: %v", err)
return
}
if err := want.Close(ctx, stateStorage); err != nil {
t.Errorf("Couldn't close wanted in_memory stream: %v", err)
return
}
}
func TestGroupBy_WithOutputUndos(t *testing.T) {
stateStorage := storage.GetTestStorage(t)
ctx := context.Background()
fields := []octosql.VariableName{"cat", "livesleft", "ownerid"}
source := NewDummyNode([]*Record{
NewRecordFromSliceWithNormalize(fields, []interface{}{"Buster", 9, 5}),
NewRecordFromSliceWithNormalize(fields, []interface{}{"Precious", 6, 4}),
NewRecordFromSliceWithNormalize(fields, []interface{}{"Precious", 6, 4}, WithUndo()),
NewRecordFromSliceWithNormalize(fields, []interface{}{"Precious", 6, 4}),
NewRecordFromSliceWithNormalize(fields, []interface{}{"Precious", 6, 4}, WithUndo()),
NewRecordFromSliceWithNormalize(fields, []interface{}{"Precious", 6, 4}),
NewRecordFromSliceWithNormalize(fields, []interface{}{"Precious", 6, 4}, WithUndo()),
NewRecordFromSliceWithNormalize(fields, []interface{}{"Precious", 5, 4}),
NewRecordFromSliceWithNormalize(fields, []interface{}{"Nala", 6, 3}),
NewRecordFromSliceWithNormalize(fields, []interface{}{"Tiger", 4, 3}),
NewRecordFromSliceWithNormalize(fields, []interface{}{"Tiger", 4, 3}, WithUndo()),
NewRecordFromSliceWithNormalize(fields, []interface{}{"Lucy", 4, 3}),
})
variables := map[octosql.VariableName]octosql.Value{
octosql.NewVariableName("count"): octosql.MakeInt(1),
}
gb := NewGroupBy(
stateStorage,
source,
[]Expression{NewVariable(octosql.NewVariableName("ownerid"))},
[]octosql.VariableName{
octosql.NewVariableName("ownerid"),
octosql.NewVariableName("livesleft"),
octosql.NewVariableName("livesleft"),
},
[]AggregatePrototype{
aggregates.AggregateTable["key"],
aggregates.AggregateTable["avg"],
aggregates.AggregateTable["count"],
},
octosql.NewVariableName(""),
[]octosql.VariableName{
octosql.NewVariableName("ownerid"),
octosql.NewVariableName("livesleft_avg"),
octosql.NewVariableName("livesleft_count"),
},
octosql.NewVariableName(""),
NewCountingTrigger(NewVariable(octosql.NewVariableName("count"))),
)
outFields := []octosql.VariableName{"ownerid", "livesleft_avg", "livesleft_count"}
expectedOutput := []*Record{
NewRecordFromSliceWithNormalize(outFields, []interface{}{5, 9.0, 1}),
NewRecordFromSliceWithNormalize(outFields, []interface{}{4, 6.0, 1}),
NewRecordFromSliceWithNormalize(outFields, []interface{}{4, 6.0, 1}, WithUndo()),
NewRecordFromSliceWithNormalize(outFields, []interface{}{4, 6.0, 1}),
NewRecordFromSliceWithNormalize(outFields, []interface{}{4, 6.0, 1}, WithUndo()),
NewRecordFromSliceWithNormalize(outFields, []interface{}{4, 6.0, 1}),
NewRecordFromSliceWithNormalize(outFields, []interface{}{4, 6.0, 1}, WithUndo()),
NewRecordFromSliceWithNormalize(outFields, []interface{}{4, 5.0, 1}),
NewRecordFromSliceWithNormalize(outFields, []interface{}{3, 6.0, 1}),
NewRecordFromSliceWithNormalize(outFields, []interface{}{3, 6.0, 1}, WithUndo()),
NewRecordFromSliceWithNormalize(outFields, []interface{}{3, 5.0, 2}),
NewRecordFromSliceWithNormalize(outFields, []interface{}{3, 5.0, 2}, WithUndo()),
NewRecordFromSliceWithNormalize(outFields, []interface{}{3, 6.0, 1}),
NewRecordFromSliceWithNormalize(outFields, []interface{}{3, 6.0, 1}, WithUndo()),
NewRecordFromSliceWithNormalize(outFields, []interface{}{3, 5.0, 2}),
}
stream := GetTestStream(t, stateStorage, variables, gb)
tx := stateStorage.BeginTransaction()
want := NewInMemoryStream(storage.InjectStateTransaction(context.Background(), tx), expectedOutput)
if err := tx.Commit(); err != nil {
t.Fatal(err)
}
err := AreStreamsEqualNoOrderingWithIDCheck(ctx, stateStorage, stream, want, WithEqualityBasedOn(EqualityOfEverythingButIDs))
if err != nil {
t.Fatal(err)
}
if err := stream.Close(ctx, stateStorage); err != nil {
t.Errorf("Couldn't close group_by stream: %v", err)
return
}
if err := want.Close(ctx, stateStorage); err != nil {
t.Errorf("Couldn't close wanted in_memory stream: %v", err)
return
}
}
func TestGroupBy_newRecordsNoChanges(t *testing.T) {
stateStorage := storage.GetTestStorage(t)
ctx := context.Background()
fields := []octosql.VariableName{"cat", "livesleft", "ownerid"}
source := NewDummyNode([]*Record{
NewRecordFromSliceWithNormalize(fields, []interface{}{"Precious", 5, 3}),
NewRecordFromSliceWithNormalize(fields, []interface{}{"Nala", 5, 3}),
})
variables := map[octosql.VariableName]octosql.Value{
octosql.NewVariableName("count"): octosql.MakeInt(1),
}
gb := NewGroupBy(
stateStorage,
source,
[]Expression{NewVariable(octosql.NewVariableName("ownerid"))},
[]octosql.VariableName{
octosql.NewVariableName("ownerid"),
octosql.NewVariableName("livesleft"),
},
[]AggregatePrototype{
aggregates.AggregateTable["key"],
aggregates.AggregateTable["avg"],
},
octosql.NewVariableName(""),
[]octosql.VariableName{
octosql.NewVariableName("ownerid"),
octosql.NewVariableName("livesleft_avg"),
},
octosql.NewVariableName(""),
NewCountingTrigger(NewVariable(octosql.NewVariableName("count"))),
)
outFields := []octosql.VariableName{"ownerid", "livesleft_avg"}
expectedOutput := []*Record{
NewRecordFromSliceWithNormalize(outFields, []interface{}{3, 5.0}),
}
stream := GetTestStream(t, stateStorage, variables, gb)
tx := stateStorage.BeginTransaction()
want := NewInMemoryStream(storage.InjectStateTransaction(context.Background(), tx), expectedOutput)
if err := tx.Commit(); err != nil {
t.Fatal(err)
}
err := AreStreamsEqualNoOrderingWithIDCheck(ctx, stateStorage, stream, want, WithEqualityBasedOn(EqualityOfEverythingButIDs))
if err != nil {
t.Fatal(err)
}
if err := stream.Close(ctx, stateStorage); err != nil {
t.Errorf("Couldn't close group_by stream: %v", err)
return
}
if err := want.Close(ctx, stateStorage); err != nil {
t.Errorf("Couldn't close wanted in_memory stream: %v", err)
return
}
}
func TestGroupBy_EventTimes(t *testing.T) {
stateStorage := storage.GetTestStorage(t)
start := time.Date(2020, 7, 2, 14, 0, 0, 0, time.UTC)
firstWindow := start
secondWindow := start.Add(time.Minute * 10)
thirdWindow := start.Add(time.Minute * 20)
ctx := context.Background()
fields := []octosql.VariableName{"cat", "livesleft", "ownerid", "t"}
source := NewDummyNode([]*Record{
NewRecordFromSliceWithNormalize(fields, []interface{}{"Buster", 9, 5, firstWindow}, WithEventTimeField(octosql.NewVariableName("t"))),
NewRecordFromSliceWithNormalize(fields, []interface{}{"Precious", 6, 4, firstWindow}, WithEventTimeField(octosql.NewVariableName("t"))),
NewRecordFromSliceWithNormalize(fields, []interface{}{"Nala", 6, 3, firstWindow}, WithEventTimeField(octosql.NewVariableName("t"))),
NewRecordFromSliceWithNormalize(fields, []interface{}{"Tiger", 5, 3, firstWindow}, WithEventTimeField(octosql.NewVariableName("t"))),
NewRecordFromSliceWithNormalize(fields, []interface{}{"Lucy", 4, 3, firstWindow}, WithEventTimeField(octosql.NewVariableName("t"))),
NewRecordFromSliceWithNormalize(fields, []interface{}{"Buster", 9, 5, secondWindow}, WithEventTimeField(octosql.NewVariableName("t"))),
NewRecordFromSliceWithNormalize(fields, []interface{}{"Nala", 6, 3, secondWindow}, WithEventTimeField(octosql.NewVariableName("t"))),
NewRecordFromSliceWithNormalize(fields, []interface{}{"Lucy", 4, 3, secondWindow}, WithEventTimeField(octosql.NewVariableName("t"))),
NewRecordFromSliceWithNormalize(fields, []interface{}{"Buster", 9, 5, thirdWindow}, WithEventTimeField(octosql.NewVariableName("t"))),
NewRecordFromSliceWithNormalize(fields, []interface{}{"Tiger", 5, 3, thirdWindow}, WithEventTimeField(octosql.NewVariableName("t"))),
NewRecordFromSliceWithNormalize(fields, []interface{}{"Lucy", 4, 3, thirdWindow}, WithEventTimeField(octosql.NewVariableName("t"))),
})
gb := NewGroupBy(
stateStorage,
source,
[]Expression{
NewVariable(octosql.NewVariableName("ownerid")),
NewVariable(octosql.NewVariableName("t")),
},
[]octosql.VariableName{
octosql.NewVariableName("t"),
octosql.NewVariableName("ownerid"),
octosql.NewVariableName("livesleft"),
octosql.NewVariableName("livesleft"),
},
[]AggregatePrototype{
aggregates.AggregateTable["key"],
aggregates.AggregateTable["key"],
aggregates.AggregateTable["avg"],
aggregates.AggregateTable["count"],
},
octosql.NewVariableName("t"),
[]octosql.VariableName{
octosql.NewVariableName("renamed_t"),
octosql.NewVariableName("ownerid"),
octosql.NewVariableName("livesleft_avg"),
octosql.NewVariableName("livesleft_count"),
},
octosql.NewVariableName("renamed_t"),
NewWatermarkTrigger(),
)
outFields := []octosql.VariableName{"renamed_t", "ownerid", "livesleft_avg", "livesleft_count"}
expectedOutput := []*Record{
NewRecordFromSliceWithNormalize(outFields, []interface{}{firstWindow, 5, 9.0, 1}, WithEventTimeField(octosql.NewVariableName("renamed_t"))),
NewRecordFromSliceWithNormalize(outFields, []interface{}{firstWindow, 4, 6.0, 1}, WithEventTimeField(octosql.NewVariableName("renamed_t"))),
NewRecordFromSliceWithNormalize(outFields, []interface{}{firstWindow, 3, 5.0, 3}, WithEventTimeField(octosql.NewVariableName("renamed_t"))),
NewRecordFromSliceWithNormalize(outFields, []interface{}{secondWindow, 5, 9.0, 1}, WithEventTimeField(octosql.NewVariableName("renamed_t"))),
NewRecordFromSliceWithNormalize(outFields, []interface{}{secondWindow, 3, 5.0, 2}, WithEventTimeField(octosql.NewVariableName("renamed_t"))),
NewRecordFromSliceWithNormalize(outFields, []interface{}{thirdWindow, 5, 9.0, 1}, WithEventTimeField(octosql.NewVariableName("renamed_t"))),
NewRecordFromSliceWithNormalize(outFields, []interface{}{thirdWindow, 3, 4.5, 2}, WithEventTimeField(octosql.NewVariableName("renamed_t"))),
}
stream := GetTestStream(t, stateStorage, octosql.NoVariables(), gb)
tx := stateStorage.BeginTransaction()
want := NewInMemoryStream(storage.InjectStateTransaction(context.Background(), tx), expectedOutput)
if err := tx.Commit(); err != nil {
t.Fatal(err)
}
err := AreStreamsEqualNoOrderingWithIDCheck(ctx, stateStorage, stream, want, WithEqualityBasedOn(EqualityOfEverythingButIDs))
if err != nil {
t.Fatal(err)
}
if err := stream.Close(ctx, stateStorage); err != nil {
t.Errorf("Couldn't close group_by stream: %v", err)
return
}
if err := want.Close(ctx, stateStorage); err != nil {
t.Errorf("Couldn't close wanted in_memory stream: %v", err)
return
}
}
|
hwu25/edk2-platforms | Silicon/Intel/LewisburgPkg/Include/Library/PchInfoLib.h | /** @file
Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php.
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef _PCH_INFO_LIB_H_
#define _PCH_INFO_LIB_H_
#include <PchAccess.h>
typedef enum {
PchH = 1,
PchLp,
PchUnknownSeries
} PCH_SERIES;
typedef enum {
SklPch = 1,
PchUnknownGeneration
} PCH_GENERATION;
/**
Return Pch stepping type
@retval PCH_STEPPING Pch stepping type
**/
PCH_STEPPING
EFIAPI
PchStepping (
VOID
);
/**
Determine if PCH is supported
@retval TRUE PCH is supported
@retval FALSE PCH is not supported
**/
BOOLEAN
IsPchSupported (
VOID
);
/**
Return Pch Series
@retval PCH_SERIES Pch Series
**/
PCH_SERIES
EFIAPI
GetPchSeries (
VOID
);
/**
Return Pch Generation
@retval PCH_GENERATION Pch Generation
**/
PCH_GENERATION
EFIAPI
GetPchGeneration (
VOID
);
/**
Get Pch Maximum Pcie Root Port Number
@retval PcieMaxRootPort Pch Maximum Pcie Root Port Number
**/
UINT8
EFIAPI
GetPchMaxPciePortNum (
VOID
);
/**
Get Pch Maximum Sata Port Number
@retval Pch Maximum Sata Port Number
**/
UINT8
EFIAPI
GetPchMaxSataPortNum (
VOID
);
/**
Get Pch Usb Maximum Physical Port Number
@retval Pch Usb Maximum Physical Port Number
**/
UINT8
EFIAPI
GetPchUsbMaxPhysicalPortNum (
VOID
);
/**
Get Pch Maximum Usb2 Port Number of XHCI Controller
@retval Pch Maximum Usb2 Port Number of XHCI Controller
**/
UINT8
EFIAPI
GetPchXhciMaxUsb2PortNum (
VOID
);
/**
Get Pch Maximum Usb3 Port Number of XHCI Controller
@retval Pch Maximum Usb3 Port Number of XHCI Controller
**/
UINT8
EFIAPI
GetPchXhciMaxUsb3PortNum (
VOID
);
/**
Return TRUE if Server Sata is present
@retval BOOLEAN TRUE if sSata device is present
**/
BOOLEAN
EFIAPI
GetIsPchsSataPresent (
VOID
);
/**
Get Pch Maximum sSata Port Number
@param[in] None
@retval Pch Maximum sSata Port Number
**/
UINT8
EFIAPI
GetPchMaxsSataPortNum (
VOID
);
/**
Get Pch Maximum sSata Controller Number
@param[in] None
@retval Pch Maximum sSata Controller Number
**/
UINT8
EFIAPI
GetPchMaxsSataControllerNum (
VOID
);
/**
Return Pch Lpc Device Id
@retval UINT16 Pch DeviceId
**/
UINT16
EFIAPI
GetPchLpcDeviceId (
VOID
);
/**
Get PCH stepping ASCII string
The return string is zero terminated.
@param [in] PchStep Pch stepping
@param [out] Buffer Output buffer of string
@param [in,out] BufferSize Size of input buffer,
and return required string size when buffer is too small.
@retval EFI_SUCCESS String copy successfully
@retval EFI_INVALID_PARAMETER The stepping is not supported, or parameters are NULL
@retval EFI_BUFFER_TOO_SMALL Input buffer size is too small
**/
EFI_STATUS
PchGetSteppingStr (
IN PCH_STEPPING PchStep,
OUT CHAR8 *Buffer,
IN OUT UINT32 *BufferSize
);
/**
Get PCH series ASCII string
The return string is zero terminated.
@param [in] PchSeries Pch series
@param [out] Buffer Output buffer of string
@param [in,out] BufferSize Size of input buffer,
and return required string size when buffer is too small.
@retval EFI_SUCCESS String copy successfully
@retval EFI_INVALID_PARAMETER The series is not supported, or parameters are NULL
@retval EFI_BUFFER_TOO_SMALL Input buffer size is too small
**/
EFI_STATUS
PchGetSeriesStr (
IN PCH_SERIES PchSeries,
OUT CHAR8 *Buffer,
IN OUT UINT32 *BufferSize
);
/**
Get PCH Sku ASCII string
The return string is zero terminated.
@param [in] LpcDid LPC device id
@param [out] Buffer Output buffer of string
@param [in,out] BufferSize Size of input buffer,
and return required string size when buffer is too small.
@retval EFI_SUCCESS String copy successfully
@retval EFI_INVALID_PARAMETER The series is not supported, or parameters are NULL
@retval EFI_BUFFER_TOO_SMALL Input buffer size is too small
**/
EFI_STATUS
PchGetSkuStr (
IN UINT16 LpcDid,
OUT CHAR8 *Buffer,
IN OUT UINT32 *BufferSize
);
#endif // _PCH_INFO_LIB_H_ |
PuttySoftware/gemma-rpg | Gemma/src/com/puttysoftware/gemma/support/map/objects/WeaponsShop.java | <filename>Gemma/src/com/puttysoftware/gemma/support/map/objects/WeaponsShop.java<gh_stars>0
/* Gemma: An RPG
Copyright (C) 2013-2014 <NAME>
Any questions should be directed to the author via email at: <EMAIL>
*/
package com.puttysoftware.gemma.support.map.objects;
import com.puttysoftware.gemma.support.items.ShopTypes;
import com.puttysoftware.gemma.support.map.generic.GenericShop;
public class WeaponsShop extends GenericShop {
// Constructors
public WeaponsShop() {
super(ShopTypes.SHOP_TYPE_WEAPONS);
}
@Override
public String getName() {
return "Weapons Shop";
}
@Override
public String getPluralName() {
return "Weapons Shops";
}
@Override
public String getDescription() {
return "Weapons Shops sell weapons used to fight monsters.";
}
}
|
yoomoney/yookassa-payout-sdk-python | tests/unit/test_xml_helper.py | <filename>tests/unit/test_xml_helper.py<gh_stars>1-10
# -*- coding: utf-8 -*-
import unittest
from yookassa_payout.domain.common.xml_helper import XMLHelper, Object2XML, XML2Object
class TestXMLHelper(unittest.TestCase):
def test_object_to_xml(self):
obj = self.get_obj()
comp = '<root param1="param1" param2="param2"><params p1="p1" p2="p2" /></root>'
res = XMLHelper.object_to_xml(obj)
self.assertEqual(res, comp)
res = XMLHelper.object_to_xml({"xml": ["p1", "p2", None]})
self.assertEqual(res, '<xml>p1p2</xml>')
res = XMLHelper.object_to_xml(["p1", "p2", None])
self.assertEqual(res, 'p1p2')
res = XMLHelper.object_to_xml(None)
self.assertEqual(res, "")
def test_xml_to_object(self):
obj = self.get_obj()
comp = '<root param1="param1" param2="param2"><params p1="p1" p2="p2" /></root>'
res = XMLHelper.xml_to_object(comp)
self.assertEqual(res, dict(obj))
def test_object_parse(self):
o = Object2XML()
res = o.parse([{"p1": "p1", "p2": ["p2"]}], 'items')
self.assertEqual(res, '<items><item p1="p1"><p2>p2</p2></item></items>')
res = o.parse('test', 'root')
self.assertEqual(res, '<root>test</root>')
res = o.parse(["test"], 'root')
self.assertEqual(res, '<root>test</root>')
res = o.parse([{"p1": "p1"}], 'items')
self.assertEqual(res, '<items><item p1="p1" /></items>')
res = o.parse({"root": ["test"]})
self.assertEqual(res, '<root>test</root>')
res = o.parse({"root": [""]})
self.assertEqual(res, '<root></root>')
res = o.parse([""], "root")
self.assertEqual(res, '<root></root>')
res = o.parse([None], "root")
self.assertEqual(res, '<root></root>')
res = o.parse({"root": None})
self.assertEqual(res, '')
res = o.parse(None, "root")
self.assertEqual(res, '')
# var_dump(res)
def test_xml_parse(self):
x = XML2Object()
with self.assertRaises(ValueError):
x.parse('')
res = x.parse('<test/>')
self.assertEqual(res, {'test': []})
res = x.parse('<root><params></params></root>')
self.assertEqual(res, {"root": [[]]})
res = x.parse('<root><params>text</params></root>')
self.assertEqual(res, {"root": [["text"]]})
res = x.parse('<root param1="param1" param2="param2"><params p1="p1" p2="p2" /></root>')
self.assertEqual(res, self.get_obj())
res = x.to_string()
self.assertEqual(res, b'<root param1="param1" param2="param2"><params p1="p1" p2="p2"/></root>')
self.assertEqual(res.decode(), '<root param1="param1" param2="param2"><params p1="p1" p2="p2"/></root>')
@staticmethod
def get_obj():
return {
"root": {
"param1": "param1",
"param2": "param2",
"params": {
"p1": "p1",
"p2": "p2",
},
}
}
|
codegitpro/qt-app | src/bridge/cpp/folder_viewmodel.hpp | // AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from portal.djinni
#pragma once
#include <cstdint>
#include <memory>
#include <string>
#include <vector>
namespace ai {
class FolderView;
class FolderViewmodel {
public:
virtual ~FolderViewmodel() {}
virtual void on_load(const std::shared_ptr<FolderView> & view) = 0;
virtual int32_t folder_id() = 0;
virtual std::vector<uint8_t> list_thumbnail_content(int32_t row) = 0;
virtual bool list_selected(int32_t section, int32_t row) = 0;
virtual void list_action(int32_t section, int32_t row, int32_t sub_index) = 0;
virtual void upload_file_only(const std::string & filename, const std::string & path, const std::vector<uint8_t> & thumbnail) = 0;
virtual void upload_files_only(const std::vector<std::string> & filenames, const std::vector<std::string> & paths, const std::vector<std::vector<uint8_t>> & thumbnails) = 0;
};
} // namespace ai
|
xinminlabs/30-seconds-of-code | test/without/without.test.js | <filename>test/without/without.test.js
const test = require('tape');
const without = require('./without.js');
test('Testing without', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof without === 'function', 'without is a Function');
t.deepEqual(without([2, 1, 2, 3], 1, 2), [3], "without([2, 1, 2, 3], 1, 2) returns [3]");
t.deepEqual(without([]), [], "without([]) returns []");
t.deepEqual(without([3, 1, true, '3', true], '3', true), [3, 1], "without([3, 1, true, '3', true], '3', true) returns [3, 1]");
t.deepEqual(without('string'.split(''), 's', 't', 'g'), ['r', 'i', 'n'], "without('string'.split(''), 's', 't', 'g') returns ['r', 'i', 'n']");
t.throws(() => without(), 'without() throws an error');
t.throws(() => without(null), 'without(null) throws an error');
t.throws(() => without(undefined), 'without(undefined) throws an error');
t.throws(() => without(123), 'without() throws an error');
t.throws(() => without({}), 'without({}) throws an error');
t.end();
});
|
Arthur-Ribeiro/LEDA | Atividade_5/Numero1_Letra_A/heap_teste.c | <gh_stars>1-10
#include <stdio.h>
#include <stdlib.h>
#include "heap.h"
int main() {
printf("------ TESTE BASICO ------\n");
heap* h1 = criar_heap(20);
if(h1 == NULL)
exit(EXIT_FAILURE);
printf("> Inserir elementos\n");
int i;
for(i = 1; i <= 20; i++) {
if(inserir_heap(h1, i))
printf("\nInsercao de %d com sucesso", i);
else
printf("Valor %d nao inserido", i);
exibir_heap(h1);
printf("\n");
}
printf("\n\n> REMOVER\n");
int r = remover_heap(h1);
if(r != -1)
printf("\nRemocao efetuada com sucesso. Valor removido: %d.", r);
else
printf("\nRemocao nao efetuada.");
exibir_heap(h1);
printf("\n");
r = remover_heap(h1);
if(r != -1)
printf("\nRemocao efetuada com sucesso. Valor removido: %d.\n", r);
else
printf("\nRemocao nao efetuada.\n");
exibir_heap(h1);
printf("\n\n>>>> INSERIR os elementos de um vetor \n");
int vetor[] = {50, 29, 33, 21, 11, 78, 66, 99};
heap* h2 = criar_heap(20);
if(h2 == NULL)
exit(EXIT_FAILURE);
inserir_vetor_heap(h2, vetor, sizeof(vetor)/sizeof(int));
printf("\n\n> REMOVER\n");
while(!esta_vazia_heap(h2)) {
r = remover_heap(h2);
if(r != -1)
printf("\nRemocao efetuada com sucesso. Valor removido: %d.", r);
else
printf("\nRemocao nao efetuada.");
exibir_heap(h2);
printf("\n");
}
liberar_heap(&h1);
liberar_heap(&h2);
return 0;
}
|
rpearce/crocks | src/helpers/tap.js | /** @license ISC License (c) copyright 2017 original and current authors */
/** @author <NAME> (evil) */
const curry = require('../core/curry')
const compose = require('../core/compose')
const isFunction = require('../core/isFunction')
const constant = x => () => x
/** tap :: (a -> b) -> a -> a */
function tap(fn, x) {
if(!isFunction(fn)) {
throw new TypeError(
'tap: Function required for first argument'
)
}
return compose(constant(x), fn)(x)
}
module.exports = curry(tap)
|
pxbee/gardens | packages/react-app/src/components/SingleDatePicker/consts.js | export const INPUT_BORDER = 1
export const SINGLE_DATE = 'Choose a day'
|
timboudreau/netbeans-contrib | spi.actions.support/src/test/java/org/netbeans/modules/actions/support/GlobalManagerTest.java | /*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common
* Development and Distribution License("CDDL") (collectively, the
* "License"). You may not use this file except in compliance with the
* License. You can obtain a copy of the License at
* http://www.netbeans.org/cddl-gplv2.html
* or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
* specific language governing permissions and limitations under the
* License. When distributing the software, include this License Header
* Notice in each file and include the License file at
* nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the GPL Version 2 section of the License file that
* accompanied this code. If applicable, add the following below the
* License Header, with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* Contributor(s):
*
* The Original Software is NetBeans. The Initial Developer of the Original
* Software is Sun Microsystems, Inc. Portions Copyright 2006 Sun
* Microsystems, Inc. All Rights Reserved.
*
* If you wish your version of this file to be governed by only the CDDL
* or only the GPL Version 2, indicate your decision by adding
* "[Contributor] elects to include this software in this distribution
* under the [CDDL or GPL Version 2] license." If you do not indicate a
* single choice of license, a recipient has the option to distribute
* your version of this file under either the CDDL, the GPL Version 2 or
* to extend the choice of license to its licensees as provided above.
* However, if you add GPL Version 2 code and therefore, elected the GPL
* Version 2 license, then the option applies only if the new code is
* made subject to such option by the copyright holder.
*/
package org.netbeans.modules.actions.support;
import java.lang.ref.Reference;
import java.lang.ref.WeakReference;
import javax.swing.Action;
import javax.swing.ActionMap;
import org.netbeans.junit.NbTestCase;
import org.openide.util.Lookup;
import org.openide.util.lookup.AbstractLookup;
import org.openide.util.lookup.InstanceContent;
/** Test of behaviour of manager listening for ActionMap in a lookup.
*
* @author <NAME>
*/
public class GlobalManagerTest extends NbTestCase {
public GlobalManagerTest(String testName) {
super(testName);
}
protected void setUp() throws Exception {
}
protected void tearDown() throws Exception {
}
public void testFindManager() {
doFindManager(true);
}
public void testFindManagerNoSurvive() {
doFindManager(false);
}
private void doFindManager(boolean survive) {
Lookup context = new AbstractLookup(new InstanceContent());
GlobalManager r1 = GlobalManager.findManager(context, survive);
assertNotNull("Need an instace", r1);
GlobalManager r2 = GlobalManager.findManager(context, survive);
assertEquals("Caches", r1, r2);
Lookup c3 = new AbstractLookup(new InstanceContent());
GlobalManager r3 = GlobalManager.findManager(c3, survive);
if (r3 == r2) {
fail("Need next manager for new lookup: " + r2 + " e: " + r3);
}
r1 = null;
WeakReference<?> ref = new WeakReference<GlobalManager>(r2);
r2 = null;
assertGC("Disappers", ref);
WeakReference<?> lookupRef = new WeakReference<Lookup>(c3);
c3 = null;
r3 = null;
assertGC("Lookup can also disappear", lookupRef);
}
}
|
hw233/home3 | core/server/toolProject/shineTool/src/main/java/com/home/shineTool/tool/config/ConfigVersionInfo.java | <reponame>hw233/home3
package com.home.shineTool.tool.config;
import com.home.shine.bytes.BytesReadStream;
import com.home.shine.bytes.BytesWriteStream;
/** 配置版本信息 */
public class ConfigVersionInfo
{
/** 名字(useName) */
public String name;
public String clientValueMD5="";
public String serverValueMD5="";
/** 写字节流 */
public void writeBytes(BytesWriteStream stream)
{
stream.writeUTF(name);
stream.writeUTF(clientValueMD5);
stream.writeUTF(serverValueMD5);
}
public void readBytes(BytesReadStream stream)
{
name=stream.readUTF();
clientValueMD5=stream.readUTF();
serverValueMD5=stream.readUTF();
}
}
|
haomingzhi/Model | Model/Mine/MySecHandViewController.h | //
// MySecHandViewController.h
// intelligentgarbagecollection
//
// Created by air on 2017/12/4.
// Copyright © 2017年 ORANLLC_IOS1. All rights reserved.
//
#import <UniversalFramework/UniversalFramework.h>
@interface MySecHandViewController : BaseTableViewController
@end
|
coomia/Doctor | robot/src/main/java/cn/zyzpp/entity/medical/Medical.java | package cn.zyzpp.entity.medical;
import javax.persistence.*;
import java.util.List;
/**
*
* 重构:疾病的实体
* Create by <EMAIL> 2018/7/23/023 20:08
*/
@Entity
@Table(name = "medical")
public class Medical {
@Id
@GeneratedValue
private Long id;//Id
@Column(name = "name",unique = true)
private String name;//病名
@ElementCollection(fetch = FetchType.LAZY)
@OrderColumn(name="position")
private List<String> part;//部位
@ElementCollection(fetch = FetchType.LAZY)
@OrderColumn(name="position")
private List<String> family;//科室
@Column(columnDefinition="TEXT")
private String intro;//简介
@Column(columnDefinition="TEXT")
private String cause;// 病因
@Column(columnDefinition="TEXT")
private String diagnose;//诊断
@Column(columnDefinition="TEXT")
private String cure;//治疗
@Column(columnDefinition="TEXT")
private String prevent;//预防
@Column(columnDefinition="TEXT")
private String complication;//并发症
@Column(columnDefinition="TEXT")
private String symptom;//症状
@ElementCollection(fetch = FetchType.LAZY)
@OrderColumn(name="position")
private List<String> intro_list;
@ElementCollection(fetch = FetchType.LAZY)
@OrderColumn(name="position")
private List<String> cause_list;
@ElementCollection(fetch = FetchType.LAZY)
@OrderColumn(name="position")
private List<String> diagnose_list;
@ElementCollection(fetch = FetchType.LAZY)
@OrderColumn(name="position")
private List<String> cure_list;
@ElementCollection(fetch = FetchType.LAZY)
@OrderColumn(name="position")
private List<String> prevent_list;
@ElementCollection(fetch = FetchType.LAZY)
@OrderColumn(name="position")
private List<String> complication_list;//并发症词集合
/**
* 症状词集合
*/
@ElementCollection(fetch = FetchType.EAGER)
@OrderColumn(name="position")
private List<String> symptom_list;
public Medical() {
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public List<String> getComplication_list() {
return complication_list;
}
public void setComplication_list(List<String> complication_list) {
this.complication_list = complication_list;
}
public List<String> getSymptom_list() {
return symptom_list;
}
public void setSymptom_list(List<String> symptom_list) {
this.symptom_list = symptom_list;
}
public List<String> getFamily() {
return family;
}
public void setFamily(List<String> family) {
this.family = family;
}
public String getCause() {
return cause;
}
public void setCause(String cause) {
this.cause = cause;
}
public String getDiagnose() {
return diagnose;
}
public void setDiagnose(String diagnose) {
this.diagnose = diagnose;
}
public String getCure() {
return cure;
}
public void setCure(String cure) {
this.cure = cure;
}
public String getPrevent() {
return prevent;
}
public void setPrevent(String prevent) {
this.prevent = prevent;
}
public String getComplication() {
return complication;
}
public void setComplication(String complication) {
this.complication = complication;
}
public String getSymptom() {
return symptom;
}
public void setSymptom(String symptom) {
this.symptom = symptom;
}
public List<String> getCause_list() {
return cause_list;
}
public void setCause_list(List<String> cause_list) {
this.cause_list = cause_list;
}
public List<String> getDiagnose_list() {
return diagnose_list;
}
public void setDiagnose_list(List<String> diagnose_list) {
this.diagnose_list = diagnose_list;
}
public List<String> getCure_list() {
return cure_list;
}
public void setCure_list(List<String> cure_list) {
this.cure_list = cure_list;
}
public List<String> getPrevent_list() {
return prevent_list;
}
public void setPrevent_list(List<String> prevent_list) {
this.prevent_list = prevent_list;
}
public String getIntro() {
return intro;
}
public void setIntro(String intro) {
this.intro = intro;
}
public List<String> getIntro_list() {
return intro_list;
}
public void setIntro_list(List<String> intro_list) {
this.intro_list = intro_list;
}
public List<String> getPart() {
return part;
}
public void setPart(List<String> part) {
this.part = part;
}
}
|
bpdesigns/e-QIP-prototype | node_modules/stylelint/src/rules/unit-case/index.js | <gh_stars>0
import valueParser from "postcss-value-parser"
import {
declarationValueIndex,
getUnitFromValueNode,
report,
ruleMessages,
validateOptions,
} from "../../utils"
export const ruleName = "unit-case"
export const messages = ruleMessages(ruleName, {
expected: (actual, expected) => `Expected "${actual}" to be "${expected}"`,
})
export default function (expectation) {
return (root, result) => {
const validOptions = validateOptions(result, ruleName, {
actual: expectation,
possible: [
"lower",
"upper",
],
})
if (!validOptions) { return }
root.walkDecls(decl => {
valueParser(decl.value).walk((node) => {
// Ignore wrong units within `url` function
if (node.type === "function" && node.value.toLowerCase() === "url") { return false }
const unit = getUnitFromValueNode(node)
if (!unit) { return }
const expectedUnit = expectation === "lower" ? unit.toLowerCase() : unit.toUpperCase()
if (unit === expectedUnit) { return }
report({
message: messages.expected(unit, expectedUnit),
node: decl,
index: declarationValueIndex(decl) + node.sourceIndex,
result,
ruleName,
})
})
})
}
}
|
kacann/genieparser | src/genie/libs/parser/iosxr/show_static_routing.py | <reponame>kacann/genieparser
"""
show_static_route.py
"""
import re
from genie.metaparser import MetaParser
from genie.metaparser.util.schemaengine import Schema, \
Any, \
Optional
# ====================================================
# schema for show static ipv4 topology detail
# ====================================================
class ShowStaticTopologyDetailSchema(MetaParser):
"""Schema for:
show static topology detail
show static vrf all topology detail
show static vrf <vrf> topology detail
show static vrf <vrf> ipv4 topology detail
show static vrf <vrf> ipv6 topology detail
show static ipv4 topology detail
show static ipv6 topology detail"""
schema = {
'vrf': {
Any(): {
Optional('address_family'): {
Any(): {
Optional('table_id'): str,
Optional('safi'): str,
Optional('routes'): {
Any(): {
Optional('route'): str,
Optional('next_hop'): {
Optional('outgoing_interface'): {
Any(): { # interface if there is no next_hop
Optional('outgoing_interface'): str,
Optional('active'): bool,
Optional('install_date'): str,
Optional('configure_date'): str,
Optional('tag'): int,
Optional('path_version'): int,
Optional('path_status'): str,
Optional('metrics'): int,
Optional('track'): int,
Optional('explicit_path'): str,
Optional('preference'): int,
},
},
Optional('next_hop_list'): {
Any(): { # index
Optional('index'): int,
Optional('active'): bool,
Optional('next_hop'): str,
Optional('outgoing_interface'): str,
Optional('install_date'): str,
Optional('configure_date'): str,
Optional('tag'): int,
Optional('path_version'): int,
Optional('path_status'): str,
Optional('metrics'): int,
Optional('track'): int,
Optional('explicit_path'): str,
Optional('preference'): int,
},
},
},
},
},
},
},
},
},
}
# ====================================================
# parser for show static topology detail
# ====================================================
class ShowStaticTopologyDetail(ShowStaticTopologyDetailSchema):
"""Parser for:
show static topology detail
show static vrf all topology detail
show static vrf <vrf> topology detail
show static vrf <vrf> ipv4 topology detail
show static ipv4 topology detail
show static ipv6 topology detail
"""
cli_command = ['show static vrf {vrf} {af} topology detail','show static vrf {vrf} topology detail',
'show static {af} topology detail','show static topology detail']
exclude = ['install_date', 'configure_date', 'path_version']
def cli(self, vrf="", af="", output=None):
if output is None:
if vrf:
if af:
cmd = self.cli_command[0].format(vrf=vrf, af=af)
else:
cmd = self.cli_command[1].format(vrf=vrf)
else:
if af:
cmd = self.cli_command[2].format(af=af)
else:
cmd = self.cli_command[3]
out = self.device.execute(cmd)
else:
out = output
if not vrf:
vrf = 'default'
route = interface = next_hop = ""
result_dict = {}
for line in out.splitlines():
if line:
line = line.rstrip()
else:
continue
# No routes in this topology
p = re.compile(r'^\s*No routes in this topology$')
m = p.match(line)
if m:
continue
# VRF: default Table Id: 0xe0000000 AFI: IPv4 SAFI: Unicast
p1 = re.compile(r'^\s*VRF: +(?P<vrf>[\w]+) +Table +Id: +(?P<table_id>[\w]+) +AFI: +(?P<af>[\w]+)'
' +SAFI: +(?P<safi>[\w]+)$')
m = p1.match(line)
if m:
vrf = m.groupdict()['vrf']
af = m.groupdict()['af'].lower()
table_id = m.groupdict()['table_id']
safi = m.groupdict()['safi'].lower()
if 'vrf' not in result_dict:
result_dict['vrf'] = {}
if vrf not in result_dict['vrf']:
result_dict['vrf'][vrf] = {}
if 'address_family' not in result_dict['vrf'][vrf]:
result_dict['vrf'][vrf]['address_family'] = {}
if af and af not in result_dict['vrf'][vrf]['address_family']:
result_dict['vrf'][vrf]['address_family'][af] = {}
result_dict['vrf'][vrf]['address_family'][af]['safi'] = safi.lower()
result_dict['vrf'][vrf]['address_family'][af]['table_id'] = table_id
continue
# Prefix/Len Interface Nexthop Object Explicit-path Metrics
# 2001:1:1:1::1/128 GigabitEthernet0_0_0_3 2001:10:1:2::1 None None [0/0/1/0/1]
# GigabitEthernet0_0_0_0 None None None [0/4096/1/0/1]
p2 = re.compile(r'^\s*(?P<route>[\d\s\/\.\:]+)?'
'(?P<interface>[a-zA-Z][\w\/\.]+)'
' +(?P<nexthop>[\w\/\.\:]+)'
' +(?P<object>[\w]+)'
' +(?P<explicit_path>[\w]+)'
' +(?P<metrics>[\w\/\[\]]+)$')
m = p2.match(line)
if m:
next_hop = ""
if m.groupdict()['route']:
route = m.groupdict()['route'].strip()
index = 1
else:
index += 1
if m.groupdict()['interface'] and 'none' not in m.groupdict()['interface'].lower() :
interface = m.groupdict()['interface'].replace('_','/')
if m.groupdict()['nexthop'] and 'none' not in m.groupdict()['nexthop'].lower():
next_hop = m.groupdict()['nexthop']
if m.groupdict()['metrics']:
metrics_value = m.groupdict()['metrics'].strip('[').strip(']').split('/')
metrics = int(metrics_value[4])
prefernce = int(metrics_value[2])
if m.groupdict()['object'] and 'none' not in m.groupdict()['object'].lower() :
object = m.groupdict()['object']
if m.groupdict()['explicit_path'] and 'none' not in m.groupdict()['explicit_path'].lower() :
explicit_path = m.groupdict()['explicit_path']
if 'routes' not in result_dict['vrf'][vrf]['address_family'][af]:
result_dict['vrf'][vrf]['address_family'][af]['routes'] = {}
if route not in result_dict['vrf'][vrf]['address_family'][af]['routes']:
result_dict['vrf'][vrf]['address_family'][af]['routes'][route] = {}
result_dict['vrf'][vrf]['address_family'][af]['routes'][route]['route'] = route
if 'next_hop' not in result_dict['vrf'][vrf]['address_family'][af]['routes'][route]:
result_dict['vrf'][vrf]['address_family'][af]['routes'][route]['next_hop'] = {}
if not next_hop:
if 'outgoing_interface' not in result_dict['vrf'][vrf]['address_family'][af] \
['routes'][route]['next_hop']:
result_dict['vrf'][vrf]['address_family'][af]['routes'][route] \
['next_hop']['outgoing_interface'] = {}
if m.groupdict()['interface'] and interface not in \
result_dict['vrf'][vrf]['address_family'][af]['routes'][route] \
['next_hop']['outgoing_interface']:
result_dict['vrf'][vrf]['address_family'][af]['routes'][route] \
['next_hop']['outgoing_interface'][interface] = {}
result_dict['vrf'][vrf]['address_family'][af]['routes'][route] \
['next_hop']['outgoing_interface'][interface]['outgoing_interface'] = interface
result_dict['vrf'][vrf]['address_family'][af]['routes'][route] \
['next_hop']['outgoing_interface'][interface]['metrics'] = metrics
result_dict['vrf'][vrf]['address_family'][af]['routes'][route] \
['next_hop']['outgoing_interface'][interface]['preference'] = prefernce
if m.groupdict()['explicit_path']and 'none' not in m.groupdict()['explicit_path'].lower():
result_dict['vrf'][vrf]['address_family'][af]['routes'][route] \
['next_hop']['outgoing_interface'][interface]['explicit_path'] = explicit_path
if m.groupdict()['object'] and 'none' not in m.groupdict()['object'].lower():
result_dict['vrf'][vrf]['address_family'][af]['routes'][route] \
['next_hop']['outgoing_interface'][interface]['track'] = int(object)
else:
if 'next_hop_list' not in result_dict['vrf'][vrf]['address_family'][af]['routes'][route]['next_hop']:
result_dict['vrf'][vrf]['address_family'][af]['routes'][route]['next_hop']['next_hop_list'] = {}
result_dict['vrf'][vrf]['address_family'][af]['routes'][route]['next_hop'] \
['next_hop_list'][index] = {}
result_dict['vrf'][vrf]['address_family'][af]['routes'][route]['next_hop'] \
['next_hop_list'][index]['index'] = index
result_dict['vrf'][vrf]['address_family'][af]['routes'][route]['next_hop'] \
['next_hop_list'][index]['next_hop'] = next_hop.strip()
if m.groupdict()['interface'] and 'none' not in m.groupdict()['interface'].lower():
result_dict['vrf'][vrf]['address_family'][af]['routes'][route]['next_hop'] \
['next_hop_list'][index]['outgoing_interface'] = interface
result_dict['vrf'][vrf]['address_family'][af]['routes'][route]['next_hop'] \
['next_hop_list'][index]['metrics'] = metrics
result_dict['vrf'][vrf]['address_family'][af]['routes'][route]['next_hop'] \
['next_hop_list'][index]['preference'] = prefernce
if m.groupdict()['explicit_path'] and 'none' not in m.groupdict()['explicit_path'].lower():
result_dict['vrf'][vrf]['address_family'][af]['routes'][route]['next_hop'] \
['next_hop_list'][index]['explicit_path'] = explicit_path
if m.groupdict()['object'] and 'none' not in m.groupdict()['object'].lower():
result_dict['vrf'][vrf]['address_family'][af]['routes'][route]['next_hop'] \
['next_hop_list'][index]['track'] = int(object)
continue
# Path is installed into RIB at Dec 7 21:52:00.853
p3 = re.compile(r'^\s*Path +is +installed +into +RIB +at +(?P<install_date>[\w\s\:\.]+)$')
m = p3.match(line)
if m:
active = True
install_date = m.groupdict()['install_date']
if not next_hop:
result_dict['vrf'][vrf]['address_family'][af]['routes'][route] \
['next_hop']['outgoing_interface'][interface]['active'] = active
result_dict['vrf'][vrf]['address_family'][af]['routes'][route] \
['next_hop']['outgoing_interface'][interface]['install_date'] = install_date
else:
result_dict['vrf'][vrf]['address_family'][af]['routes'][route] \
['next_hop']['next_hop_list'][index]['active'] = active
result_dict['vrf'][vrf]['address_family'][af]['routes'][route] \
['next_hop']['next_hop_list'][index]['install_date'] = install_date
continue
# Path is configured at Dec 7 21:47:43.624
p3_1 = re.compile(r'^\s*Path +is +configured +at +(?P<configure_date>[\w\s\:\.]+)$')
m = p3_1.match(line)
if m:
active = False
configure_date = m.groupdict()['configure_date']
if not next_hop:
result_dict['vrf'][vrf]['address_family'][af]['routes'][route] \
['next_hop']['outgoing_interface'][interface]['active'] = active
result_dict['vrf'][vrf]['address_family'][af]['routes'][route] \
['next_hop']['outgoing_interface'][interface]['configure_date'] = configure_date
else:
result_dict['vrf'][vrf]['address_family'][af]['routes'][route] \
['next_hop']['next_hop_list'][index]['active'] = active
result_dict['vrf'][vrf]['address_family'][af]['routes'][route] \
['next_hop']['next_hop_list'][index]['configure_date'] = configure_date
continue
# Path version: 1, Path status: 0x21
p4 = re.compile(r'^\s*Path +version: +(?P<path_version>[\d]+), +Path +status: +(?P<path_status>[\w]+)$')
m = p4.match(line)
if m:
path_version = int(m.groupdict()['path_version'])
path_status = m.groupdict()['path_status']
if not next_hop:
result_dict['vrf'][vrf]['address_family'][af]['routes'][route] \
['next_hop']['outgoing_interface'][interface]['path_version'] = path_version
result_dict['vrf'][vrf]['address_family'][af]['routes'][route] \
['next_hop']['outgoing_interface'][interface]['path_status'] = path_status
else:
result_dict['vrf'][vrf]['address_family'][af]['routes'][route] \
['next_hop']['next_hop_list'][index]['path_version'] = path_version
result_dict['vrf'][vrf]['address_family'][af]['routes'][route] \
['next_hop']['next_hop_list'][index]['path_status'] = path_status
continue
# Path has best tag: 0
p5 = re.compile(r'^\s*Path +has +best +tag: +(?P<tag>[\d]+)$')
m = p5.match(line)
if m:
tag = m.groupdict()['tag']
if not next_hop:
result_dict['vrf'][vrf]['address_family'][af]['routes'][route] \
['next_hop']['outgoing_interface'][interface]['tag'] = int(tag)
else:
result_dict['vrf'][vrf]['address_family'][af]['routes'][route] \
['next_hop']['next_hop_list'][index]['tag'] = int(tag)
continue
return result_dict
|
CognizantOpenSource/Cognizant-Intelligent-Test-Scripter | IDE/src/main/java/com/cognizant/cognizantits/ide/main/mainui/components/testdesign/tree/ProjectTree.java | /*
* Copyright 2014 - 2019 Cognizant Technology Solutions
*
* 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 com.cognizant.cognizantits.ide.main.mainui.components.testdesign.tree;
import com.cognizant.cognizantits.datalib.component.Project;
import com.cognizant.cognizantits.datalib.component.Scenario;
import com.cognizant.cognizantits.datalib.component.TestCase;
import com.cognizant.cognizantits.datalib.model.DataItem;
import com.cognizant.cognizantits.datalib.model.Meta;
import com.cognizant.cognizantits.datalib.model.Tag;
import com.cognizant.cognizantits.ide.main.mainui.components.testdesign.TestDesign;
import com.cognizant.cognizantits.ide.main.mainui.components.testdesign.tree.model.GroupNode;
import com.cognizant.cognizantits.ide.main.mainui.components.testdesign.tree.model.ProjectTreeModel;
import com.cognizant.cognizantits.ide.main.mainui.components.testdesign.tree.model.ScenarioNode;
import com.cognizant.cognizantits.ide.main.mainui.components.testdesign.tree.model.TestCaseNode;
import com.cognizant.cognizantits.ide.main.mainui.components.testdesign.tree.model.TestPlanTreeModel;
import com.cognizant.cognizantits.ide.main.ui.ProjectProperties;
import com.cognizant.cognizantits.ide.main.utils.Utils;
import com.cognizant.cognizantits.ide.main.utils.dnd.TransferActionListener;
import com.cognizant.cognizantits.ide.main.utils.keys.Keystroke;
import com.cognizant.cognizantits.ide.main.utils.tree.TreeSelectionRenderer;
import com.cognizant.cognizantits.ide.settings.IconSettings;
import com.cognizant.cognizantits.ide.util.Canvas;
import com.cognizant.cognizantits.ide.util.Notification;
import com.cognizant.cognizantits.ide.util.Validator;
import java.awt.Component;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPopupMenu;
import javax.swing.JTree;
import javax.swing.KeyStroke;
import javax.swing.SwingUtilities;
import javax.swing.TransferHandler;
import javax.swing.event.CellEditorListener;
import javax.swing.event.ChangeEvent;
import javax.swing.event.PopupMenuEvent;
import javax.swing.event.PopupMenuListener;
import javax.swing.tree.TreePath;
/**
*
*
*/
public class ProjectTree implements ActionListener {
private static final Logger LOGGER = Logger.getLogger(ProjectTree.class.getName());
ProjectPopupMenu popupMenu;
private final ProjectProperties projectProperties;
private final JTree tree;
private final TestDesign testDesign;
ProjectTreeModel treeModel = new TestPlanTreeModel();
public ProjectTree(TestDesign testDesign) {
this.testDesign = testDesign;
tree = new JTree();
projectProperties = new ProjectProperties(testDesign.getsMainFrame());
init();
}
ProjectTreeModel getNewTreeModel() {
return new TestPlanTreeModel();
}
ProjectPopupMenu getNewPopupMenu() {
return new ProjectPopupMenu();
}
private void init() {
popupMenu = getNewPopupMenu();
treeModel = getNewTreeModel();
tree.setModel(treeModel);
tree.setToggleClickCount(0);
tree.setEditable(true);
tree.setInvokesStopCellEditing(true);
tree.setComponentPopupMenu(popupMenu);
tree.setDragEnabled(true);
tree.setTransferHandler(new ProjectDnD(this));
tree.getInputMap(JComponent.WHEN_FOCUSED).put(Keystroke.NEW, "New");
tree.getInputMap(JComponent.WHEN_FOCUSED).put(Keystroke.DELETE, "Delete");
tree.getInputMap(JComponent.WHEN_FOCUSED).put(Keystroke.ALTENTER, "AltEnter");
tree.getInputMap(JComponent.WHEN_FOCUSED).put(KeyStroke.getKeyStroke("ESCAPE"), "Escape");
tree.getActionMap().put("AltEnter", new AbstractAction() {
@Override
public void actionPerformed(ActionEvent ae) {
showDetails();
}
});
tree.getActionMap().put("New", new AbstractAction() {
@Override
public void actionPerformed(ActionEvent ae) {
onNewAction();
}
});
tree.getActionMap().put("Delete", new AbstractAction() {
@Override
public void actionPerformed(ActionEvent ae) {
onDeleteAction();
}
});
tree.getActionMap().put("Escape", new AbstractAction() {
@Override
public void actionPerformed(ActionEvent ae) {
if (tree.isEditing()) {
tree.cancelEditing();
}
}
});
tree.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
if (SwingUtilities.isLeftMouseButton(e) && e.getClickCount() == 2) {
loadTableModelForSelection();
}
}
});
popupMenu.addPopupMenuListener(new PopupMenuListener() {
@Override
public void popupMenuWillBecomeVisible(PopupMenuEvent pme) {
onRightClick();
}
@Override
public void popupMenuWillBecomeInvisible(PopupMenuEvent pme) {
// Not Needed
}
@Override
public void popupMenuCanceled(PopupMenuEvent pme) {
// Not Needed
}
});
setTreeIcon();
tree.getCellEditor().addCellEditorListener(new CellEditorListener() {
@Override
public void editingStopped(ChangeEvent ce) {
if (!checkAndRename()) {
tree.getCellEditor().cancelCellEditing();
}
}
@Override
public void editingCanceled(ChangeEvent ce) {
// Not Needed
}
});
}
private void setTreeIcon() {
tree.setFont(new Font("Arial", Font.PLAIN, 11));
new TreeSelectionRenderer(tree) {
@Override
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean isLeaf, int row, boolean focused) {
Component c = super.getTreeCellRendererComponent(tree, value, selected, expanded, isLeaf, row, focused);
if (value instanceof GroupNode) {
setIcons(IconSettings.getIconSettings().getReusableFolder());
} else if (value instanceof ScenarioNode) {
setIcons(IconSettings.getIconSettings().getTestPlanScenario());
} else if (value instanceof TestCaseNode) {
setIcons(IconSettings.getIconSettings().getTestPlanTestCase());
} else {
setIcons(IconSettings.getIconSettings().getTestPlanRoot());
}
return c;
}
void setIcons(Icon icon) {
setLeafIcon(icon);
setClosedIcon(icon);
setOpenIcon(icon);
setIcon(icon);
}
};
}
public void loadTableModelForSelection() {
Object selected = getSelectedTestCase();
if (selected == null) {
selected = getSelectedScenario();
}
testDesign.loadTableModelForSelection(selected);
}
private void onRightClick() {
TreePath path = tree.getSelectionPath();
if (path != null) {
togglePopupMenu(tree.getSelectionPath().getLastPathComponent());
} else {
popupMenu.setVisible(false);
}
}
protected void togglePopupMenu(Object selected) {
if (selected instanceof ScenarioNode) {
popupMenu.forScenario();
} else if (selected instanceof TestCaseNode) {
popupMenu.forTestCase();
} else if (selected instanceof GroupNode) {
popupMenu.forTestPlan();
}
}
protected void onNewAction() {
if (getSelectedScenarioNode() != null) {
addTestCase();
} else if (getSelectedGroupNode() != null) {
addScenario();
}
}
protected void onDeleteAction() {
deleteTestCases();
deleteScenarios();
}
@Override
public void actionPerformed(ActionEvent ae) {
switch (ae.getActionCommand()) {
case "Add Scenario":
addScenario();
break;
case "Rename Scenario":
tree.startEditingAtPath(new TreePath(getSelectedScenarioNode().getPath()));
break;
case "Delete Scenario":
deleteScenarios();
break;
case "Add TestCase":
addTestCase();
break;
case "Rename TestCase":
tree.startEditingAtPath(new TreePath(getSelectedTestCaseNode().getPath()));
break;
case "Delete TestCase":
deleteTestCases();
break;
case "Sort":
sort();
break;
case "Edit Tag":
editTag();
break;
case "Make As Reusable/TestCase":
makeAsReusableRTestCase();
break;
case "Details":
showDetails();
break;
case "Manual Testcase":
{
try {
convertToManual();
} catch (IOException ex) {
Logger.getLogger(ProjectTree.class.getName()).log(Level.SEVERE, null, ex);
}
}
break;
case "Get Impacted TestCases":
getImpactedTestCases();
break;
case "Get CmdLine Syntax":
getCmdLineSyntax();
break;
default:
throw new UnsupportedOperationException();
}
}
public ProjectTreeModel getTreeModel() {
return treeModel;
}
private void addScenario() {
ScenarioNode scNode = treeModel.addScenario(getSelectedGroupNode(),
testDesign.getProject().addScenario(fetchNewScenarioName()));
selectAndScrollTo(new TreePath(scNode.getPath()));
}
private String fetchNewScenarioName() {
String newScenarioName = "NewScenario";
for (int i = 0;; i++) {
if (testDesign.getProject().getScenarioByName(newScenarioName) == null) {
break;
}
newScenarioName = "NewScenario" + i;
}
return newScenarioName;
}
private void addTestCase() {
ScenarioNode scenarioNode = getSelectedScenarioNode();
if (scenarioNode != null) {
TestCase testcase;
String testCaseName = fetchNewTestCaseName(scenarioNode.getScenario());
testcase = scenarioNode.getScenario().addTestCase(testCaseName);
testDesign.loadTableModelForSelection(testcase);
selectAndScrollTo(new TreePath(treeModel.
addTestCase(scenarioNode, testcase).getPath()));
}
}
private String fetchNewTestCaseName(Scenario scenario) {
String newTestCaseName = "NewTestCase";
for (int i = 0;; i++) {
if (scenario.getTestCaseByName(newTestCaseName) == null) {
break;
}
newTestCaseName = "NewTestCase" + i;
}
return newTestCaseName;
}
protected Boolean checkAndRename() {
String name = tree.getCellEditor().getCellEditorValue().toString().trim();
if (Validator.isValidName(name)) {
ScenarioNode scenarioNode = getSelectedScenarioNode();
if (scenarioNode != null && !scenarioNode.toString().equals(name)) {
if (scenarioNode.getScenario().rename(name)) {
getTreeModel().reload(scenarioNode);
renameScenario(scenarioNode.getScenario());
testDesign.getScenarioComp().refreshTitle();
return true;
} else {
Notification.show("Scenario " + name + " Already present");
return false;
}
}
TestCaseNode testCaseNode = getSelectedTestCaseNode();
if (testCaseNode != null && !testCaseNode.toString().equals(name)) {
if (testCaseNode.getTestCase().rename(name)) {
getTreeModel().reload(testCaseNode);
testDesign.getTestCaseComp().refreshTitle();
return true;
} else {
Notification.show("Testcase '" + name + "' Already present in Scenario - " + getSelectedTestCase().getScenario().getName());
}
}
}
return false;
}
void renameScenario(Scenario scenario) {
getTestDesign().getReusableTree()
.getTreeModel().onScenarioRename(scenario);
}
private void deleteScenarios() {
List<ScenarioNode> scenarioNodes = getSelectedScenarioNodes();
if (!scenarioNodes.isEmpty()) {
int option = JOptionPane.showConfirmDialog(null,
"<html><body><p style='width: 200px;'>"
+ "Are you sure want to delete the following Scenarios?<br>"
+ scenarioNodes
+ "</p></body></html>",
"Delete Scenario",
JOptionPane.YES_NO_OPTION);
if (option == JOptionPane.YES_OPTION) {
LOGGER.log(Level.INFO, "Delete Scenarios approved for {0}; {1}",
new Object[]{scenarioNodes.size(), scenarioNodes});
for (ScenarioNode scenarioNode : scenarioNodes) {
deleteTestCases(TestCaseNode.toList(scenarioNode.children()));
scenarioNode.getScenario().delete();
getTreeModel().removeNodeFromParent(scenarioNode);
}
}
}
}
private void deleteTestCases() {
List<TestCaseNode> testcaseNodes = getSelectedTestCaseNodes();
if (!testcaseNodes.isEmpty()) {
int option = JOptionPane.showConfirmDialog(null,
"<html><body><p style='width: 200px;'>"
+ "Are you sure want to delete the following TestCases?<br>"
+ testcaseNodes
+ "</p></body></html>",
"Delete TestCase",
JOptionPane.YES_NO_OPTION);
if (option == JOptionPane.YES_OPTION) {
LOGGER.log(Level.INFO, "Delete TestCases approved for {0}; {1}",
new Object[]{testcaseNodes.size(), testcaseNodes});
deleteTestCases(testcaseNodes);
}
}
}
private void deleteTestCases(List<TestCaseNode> testcaseNodes) {
TestCase loadedTestCase = testDesign.getTestCaseComp().getCurrentTestCase();
Boolean shouldRemove = false;
for (TestCaseNode testcaseNode : testcaseNodes) {
if (!shouldRemove) {
shouldRemove = Objects.equals(loadedTestCase, testcaseNode.getTestCase());
}
testcaseNode.getTestCase().delete();
getTreeModel().removeNodeFromParent(testcaseNode);
}
if (shouldRemove) {
testDesign.getTestCaseComp().resetTable();
}
}
private Scenario getSelectedScenario() {
ScenarioNode scenarioNode = getSelectedScenarioNode();
if (scenarioNode != null) {
return scenarioNode.getScenario();
}
return null;
}
private List<Scenario> getSelectedScenarios() {
List<Scenario> scenarios = new ArrayList<>();
TreePath[] paths = tree.getSelectionPaths();
if (paths != null && paths.length > 0) {
for (TreePath path : paths) {
if (path.getLastPathComponent() instanceof ScenarioNode) {
scenarios.add(((ScenarioNode) path.getLastPathComponent()).getScenario());
}
}
}
return scenarios;
}
private List<TestCase> getSelectedTestCases() {
List<TestCase> testcases = new ArrayList<>();
TreePath[] paths = tree.getSelectionPaths();
if (paths != null && paths.length > 0) {
for (TreePath path : paths) {
if (path.getLastPathComponent() instanceof TestCaseNode) {
testcases.add(((TestCaseNode) path.getLastPathComponent()).getTestCase());
}
}
}
return testcases;
}
protected GroupNode getSelectedGroupNode() {
List<GroupNode> groups = getSelectedGroupNodes();
if (groups.isEmpty()) {
return null;
}
return groups.get(0);
}
protected List<GroupNode> getSelectedGroupNodes() {
List<GroupNode> groupNodes = new ArrayList<>();
TreePath[] paths = tree.getSelectionPaths();
if (paths != null && paths.length > 0) {
for (TreePath path : paths) {
if (path.getLastPathComponent() instanceof GroupNode) {
groupNodes.add((GroupNode) path.getLastPathComponent());
}
}
}
return groupNodes;
}
private ScenarioNode getSelectedScenarioNode() {
List<ScenarioNode> scenarioNodes = getSelectedScenarioNodes();
if (scenarioNodes.isEmpty()) {
return null;
}
return scenarioNodes.get(0);
}
protected List<ScenarioNode> getSelectedScenarioNodes() {
List<ScenarioNode> scenarioNodes = new ArrayList<>();
TreePath[] paths = tree.getSelectionPaths();
if (paths != null && paths.length > 0) {
for (TreePath path : paths) {
if (path.getLastPathComponent() instanceof ScenarioNode) {
scenarioNodes.add((ScenarioNode) path.getLastPathComponent());
}
}
}
return scenarioNodes;
}
protected TestCase getSelectedTestCase() {
TestCaseNode testcaseNode = getSelectedTestCaseNode();
if (testcaseNode != null) {
return testcaseNode.getTestCase();
}
return null;
}
private TestCaseNode getSelectedTestCaseNode() {
List<TestCaseNode> tcNodes = getSelectedTestCaseNodes();
if (tcNodes.isEmpty()) {
return null;
}
return tcNodes.get(0);
}
protected List<TestCaseNode> getSelectedTestCaseNodes() {
List<TestCaseNode> tcNodes = new ArrayList<>();
TreePath[] paths = tree.getSelectionPaths();
if (paths != null && paths.length > 0) {
for (TreePath path : paths) {
if (path.getLastPathComponent() instanceof TestCaseNode) {
tcNodes.add((TestCaseNode) path.getLastPathComponent());
}
}
}
return tcNodes;
}
protected void selectAndScrollTo(final TreePath path) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
tree.setSelectionPath(path);
tree.scrollPathToVisible(path);
tree.removeSelectionPath(path);
tree.addSelectionPaths(new TreePath[]{path.getParentPath(), path});
}
});
}
private void makeAsReusableRTestCase() {
if (!getSelectedTestCaseNodes().isEmpty()) {
for (TestCaseNode testCaseNode : getSelectedTestCaseNodes()) {
testCaseNode.getTestCase().toggleAsReusable();
getTreeModel().removeNodeFromParent(testCaseNode);
makeAsReusableRTestCase(testCaseNode.getTestCase());
}
}
}
void makeAsReusableRTestCase(TestCase testCase) {
getTestDesign().getReusableTree().getTreeModel().addTestCase(testCase);
}
private void convertToManual() throws IOException {
if (!getSelectedScenarios().isEmpty()) {
testDesign.getsMainFrame().getStepMap().convertScenarios(
Utils.saveDialog("Manual TestCase.csv"), getSelectedScenarios());
} else if (!getSelectedTestCases().isEmpty()) {
testDesign.getsMainFrame().getStepMap().convertTestCase(
Utils.saveDialog("Manual TestCase.csv"), getSelectedTestCases());
} else {
testDesign.getsMainFrame().getStepMap().convertScenarios(
Utils.saveDialog("Manual TestCase.csv"), getProject().getScenarios());
}
}
private void sort() {
if (tree.getSelectionPath() != null) {
getTreeModel().sort(tree.getSelectionPath().getLastPathComponent());
}
}
private void editTag() {
TreePath[] sel = tree.getSelectionPaths();
if (sel != null && sel.length > 0) {
if (sel.length > 1) {
editTag(Arrays.asList(sel));
} else {
editTag(sel[0]);
}
}
}
private Tag onAddTag(String tag) {
getProject().getInfo().addMeta(Meta.createTag(tag));
return Tag.create(tag);
}
private void onRemoveTag(Tag tag) {
getProject().getInfo().removeAll(tag);
}
private void editTag(DataItem tc) {
TagEditorDialog.build(testDesign.getsMainFrame(),
getProject().getInfo().getAllTags(tc.getTags()), tc.getTags(),
this::onRemoveTag, this::onAddTag)
.withTitle(editTagTitle(tc.getName())).show(tc::setTags);
}
private void editTag(Meta scn) {
TagEditorDialog.build(testDesign.getsMainFrame(),
getProject().getInfo().getAllTags(scn.getTags()), scn.getTags(),
this::onRemoveTag, this::onAddTag)
.withTitle(editTagTitle(scn.getName())).show(scn::setTags);
}
private String editTagTitle(String t) {
return String.format("Edit Tag: %s", t);
}
private void editTag(TreePath path) {
if (path.getLastPathComponent() instanceof TestCaseNode) {
TestCase tcn = ((TestCaseNode) path.getLastPathComponent()).getTestCase();
editTag(getProject().getInfo().getData()
.findOrCreate(tcn.getName(), tcn.getScenario().getName()));
} else if (path.getLastPathComponent() instanceof ScenarioNode) {
Scenario scn = ((ScenarioNode) path.getLastPathComponent()).getScenario();
editTag(getProject().getInfo().findScenarioOrCreate(scn.getName()));
}
}
private void editTag(List<TreePath> paths) {
paths.stream().forEach(this::editTag);
}
private void getImpactedTestCases() {
TestCase testCase = getSelectedTestCase();
if (testCase != null) {
String scenarioName = testCase.getScenario().getName();
String testCaseName = testCase.getName();
testDesign.getImpactUI().loadForTestCase(getProject()
.getImpactedTestCaseTestCases(scenarioName, testCaseName), scenarioName, testCaseName);
} else {
Notification.show("Select a Valid TestCase");
}
}
private void getCmdLineSyntax() {
TestCase testCase = getSelectedTestCase();
if (testCase != null) {
String scenarioName = testCase.getScenario().getName();
String testCaseName = testCase.getName();
String syntax = String.format(
"%s -run -project_location \"%s\" -scenario \"%s\" -testcase \"%s\" -browser \"%s\"",
getBatRCommand(),
getProject().getLocation(),
scenarioName,
testCaseName,
getTestDesign().getDefaultBrowser());
Utils.copyTextToClipboard(syntax);
Notification.show("Syntax has been copied to Clipboard");
} else {
Notification.show("Select a Valid TestCase");
}
}
private String getBatRCommand() {
String os = System.getProperty("os.name").toLowerCase();
if (os.contains("windows")) {
return "Run.bat";
}
return "Run.command";
}
private void showDetails() {
TreePath path = tree.getSelectionPath();
if (path != null) {
showProjDetails();
}
}
private void showProjDetails() {
projectProperties.loadForCurrentProject();
// projectProperties.pack();
projectProperties.setLocationRelativeTo(null);
projectProperties.setVisible(true);
}
public final JTree getTree() {
return tree;
}
public final Project getProject() {
return testDesign.getProject();
}
public final TestDesign getTestDesign() {
return testDesign;
}
public final void load() {
treeModel.setProject(testDesign.getProject());
treeModel.reload();
getTree().setSelectionPath(new TreePath(treeModel.getFirstNode().getPath()));
loadTableModelForSelection();
}
class ProjectPopupMenu extends JPopupMenu {
protected JMenuItem addScenario;
protected JMenuItem renameScenario;
protected JMenuItem deleteScenario;
protected JMenuItem addTestCase;
protected JMenuItem renameTestCase;
protected JMenuItem deleteTestCase;
protected JMenuItem toggleReusable;
protected JMenuItem impactAnalysis;
protected JMenuItem copy;
protected JMenuItem cut;
protected JMenuItem paste;
protected JMenuItem sort;
protected JMenuItem getCmdSyntax;
public ProjectPopupMenu() {
init();
}
protected final void init() {
add(addScenario = create("Add Scenario", Keystroke.NEW));
add(renameScenario = create("Rename Scenario", Keystroke.RENAME));
add(deleteScenario = create("Delete Scenario", Keystroke.DELETE));
addSeparator();
add(addTestCase = create("Add TestCase", Keystroke.NEW));
add(renameTestCase = create("Rename TestCase", Keystroke.RENAME));
add(deleteTestCase = create("Delete TestCase", Keystroke.DELETE));
addSeparator();
JMenu menu = new JMenu("Export As");
menu.add(create("Manual Testcase", null));
add(menu);
add(toggleReusable = create("Make As Reusable/TestCase", null));
toggleReusable.setText("Make As Reusable");
addSeparator();
setCCP();
addSeparator();
add(impactAnalysis = create("Get Impacted TestCases", null));
add(getCmdSyntax = create("Get CmdLine Syntax", null));
addSeparator();
add(sort = create("Sort", null));
addSeparator();
add(create("Details", Keystroke.ALTENTER));
sort.setIcon(Canvas.EmptyIcon);
}
protected void forScenario() {
renameScenario.setEnabled(true);
deleteScenario.setEnabled(true);
addTestCase.setEnabled(true);
addScenario.setEnabled(false);
renameTestCase.setEnabled(false);
deleteTestCase.setEnabled(false);
toggleReusable.setEnabled(false);
impactAnalysis.setEnabled(false);
getCmdSyntax.setEnabled(false);
copy.setEnabled(true);
cut.setEnabled(false);
paste.setEnabled(true);
sort.setEnabled(true);
}
protected void forTestCase() {
addScenario.setEnabled(false);
renameScenario.setEnabled(false);
deleteScenario.setEnabled(false);
addTestCase.setEnabled(false);
renameTestCase.setEnabled(true);
deleteTestCase.setEnabled(true);
toggleReusable.setEnabled(true);
impactAnalysis.setEnabled(true);
getCmdSyntax.setEnabled(true);
copy.setEnabled(true);
cut.setEnabled(true);
paste.setEnabled(true);
sort.setEnabled(false);
}
protected void forTestPlan() {
addScenario.setEnabled(true);
renameScenario.setEnabled(false);
deleteScenario.setEnabled(false);
addTestCase.setEnabled(false);
renameTestCase.setEnabled(false);
deleteTestCase.setEnabled(false);
toggleReusable.setEnabled(false);
impactAnalysis.setEnabled(false);
getCmdSyntax.setEnabled(false);
copy.setEnabled(false);
cut.setEnabled(false);
paste.setEnabled(true);
sort.setEnabled(true);
}
protected JMenuItem create(String name, KeyStroke keyStroke) {
JMenuItem menuItem = new JMenuItem(name);
menuItem.setActionCommand(name);
menuItem.setAccelerator(keyStroke);
menuItem.addActionListener(ProjectTree.this);
return menuItem;
}
private void setCCP() {
TransferActionListener actionListener = new TransferActionListener();
cut = new JMenuItem("Cut");
cut.setActionCommand((String) TransferHandler.getCutAction().getValue(Action.NAME));
cut.addActionListener(actionListener);
cut.setAccelerator(Keystroke.CUT);
cut.setMnemonic(KeyEvent.VK_T);
add(cut);
copy = new JMenuItem("Copy");
copy.setActionCommand((String) TransferHandler.getCopyAction().getValue(Action.NAME));
copy.addActionListener(actionListener);
copy.setAccelerator(Keystroke.COPY);
copy.setMnemonic(KeyEvent.VK_C);
add(copy);
paste = new JMenuItem("Paste");
paste.setActionCommand((String) TransferHandler.getPasteAction().getValue(Action.NAME));
paste.addActionListener(actionListener);
paste.setAccelerator(Keystroke.PASTE);
paste.setMnemonic(KeyEvent.VK_P);
add(paste);
}
}
}
|
AsahiOS/gate | usr/src/cmd/lp/cmd/lpsched/schedule.c | <gh_stars>0
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
#pragma ident "%Z%%M% %I% %E% SMI"
#include "stdarg.h"
#include "lpsched.h"
#include <syslog.h>
extern int isStartingForms;
typedef struct later {
struct later * next;
int event,
ticks;
union arg {
PSTATUS * printer;
RSTATUS * request;
FSTATUS * form;
} arg;
} LATER;
static LATER LaterHead = { 0 },
TempHead;
static void ev_interf(PSTATUS *);
static void ev_message(PSTATUS *);
static void ev_form_message(FSTATUS *);
static int ev_slowf(RSTATUS *);
static int ev_notify(RSTATUS *);
static EXEC *find_exec_slot(EXEC **);
static char *_event_name(int event)
{
static char *_names[] = {
"", "EV_SLOWF", "EV_INTERF", "EV_NOTIFY", "EV_LATER", "EV_ALARM",
"EV_MESSAGE", "EV_ENABLE", "EV_FORM_MESSAGE", NULL };
if ((event < 0) || (event > EV_FORM_MESSAGE))
return ("BAD_EVENT");
else
return (_names[event]);
}
/*
* schedule() - SCHEDULE BY EVENT
*/
/*VARARGS1*/
void
schedule(int event, ...)
{
va_list ap;
LATER * plprev;
LATER * pl;
LATER * plnext = 0;
register PSTATUS * pps;
register RSTATUS * prs;
register FSTATUS * pfs;
int i;
/*
* If we're in the process of shutting down, don't
* schedule anything.
*/
syslog(LOG_DEBUG, "schedule(%s)", _event_name(event));
if (Shutdown)
return;
va_start (ap, event);
/*
* If we're still in the process of starting up, don't start
* anything! Schedule it for one tick later. While we're starting
* ticks aren't counted, so the events won't be started.
* HOWEVER, with a count of 1, a single EV_ALARM after we're
* finished starting will be enough to clear all things scheduled
* for later.
*/
if (Starting) {
switch (event) {
case EV_INTERF:
case EV_ENABLE:
pps = va_arg(ap, PSTATUS *);
schedule (EV_LATER, 1, event, pps);
goto Return;
case EV_SLOWF:
case EV_NOTIFY:
prs = va_arg(ap, RSTATUS *);
schedule (EV_LATER, 1, event, prs);
goto Return;
case EV_MESSAGE:
pps = va_arg(ap, PSTATUS *);
schedule (EV_LATER, 1, event, pps);
goto Return;
case EV_FORM_MESSAGE:
pfs = va_arg(ap, FSTATUS *);
schedule (EV_LATER, 1, event, pfs);
goto Return;
case EV_LATER:
/*
* This is okay--in fact it may be us!
*/
break;
case EV_ALARM:
/*
* The alarm will go off again, hold off for now.
*/
goto Return;
}
}
/*
* Schedule something:
*/
switch (event) {
case EV_INTERF:
if ((pps = va_arg(ap, PSTATUS *)) != NULL)
ev_interf (pps);
else
for (i = 0; PStatus != NULL && PStatus[i] != NULL; i++)
ev_interf (PStatus[i]);
break;
/*
* The EV_ENABLE event is used to get a printer going again
* after waiting for a fault to be cleared. We used to use
* just the EV_INTERF event, but this wasn't enough: For
* requests that can go on several different printers (e.g.
* queued for class, queued for ``any''), a printer is
* arbitrarily assigned. The EV_INTERF event just checks
* assignments, not possibilities, so a printer with no
* assigned requests but still eligible to handle one or
* more requests would never automatically start up again after
* a fault. The EV_ENABLE event calls "enable()" which eventually
* gets around to invoking the EV_INTERF event. However, it first
* calls "queue_attract()" to get an eligible request assigned
* so that things proceed. This also makes sense from the
* following standpoint: The documented method of getting a
* printer going, while it is waiting for auto-retry, is to
* manually issue the enable command!
*
* Note: "enable()" will destroy the current record of the fault,
* so if the fault is still with us any new alert will not include
* the history of each repeated fault. This is a plus and a minus,
* usually a minus: While a repeated fault may occasionally show
* a varied record, usually the same reason is given each time;
* before switching to EV_ENABLE we typically saw a boring, long
* list of identical reasons.
*/
case EV_ENABLE:
if ((pps = va_arg(ap, PSTATUS *)) != NULL)
enable (pps);
else
for (i = 0; PStatus != NULL && PStatus[i] != NULL; i++)
enable (PStatus[i]);
break;
case EV_SLOWF:
if ((prs = va_arg(ap, RSTATUS *)) != NULL)
(void) ev_slowf (prs);
else
for (prs = Request_List; prs && ev_slowf(prs) != -1;
prs = prs->next);
break;
case EV_NOTIFY:
if ((prs = va_arg(ap, RSTATUS *)) != NULL)
(void) ev_notify (prs);
else
for (prs = Request_List; prs && ev_notify(prs) != -1;
prs = prs->next);
break;
case EV_MESSAGE:
pps = va_arg(ap, PSTATUS *);
ev_message(pps);
break;
case EV_FORM_MESSAGE:
pfs = va_arg(ap, FSTATUS *);
ev_form_message(pfs);
break;
case EV_LATER:
pl = (LATER *)Malloc(sizeof (LATER));
if (!LaterHead.next)
alarm (CLOCK_TICK);
pl->next = LaterHead.next;
LaterHead.next = pl;
pl->ticks = va_arg(ap, int);
pl->event = va_arg(ap, int);
switch (pl->event) {
case EV_MESSAGE:
case EV_INTERF:
case EV_ENABLE:
pl->arg.printer = va_arg(ap, PSTATUS *);
if (pl->arg.printer)
pl->arg.printer->status |= PS_LATER;
break;
case EV_FORM_MESSAGE:
pl->arg.form = va_arg(ap, FSTATUS *);
break;
case EV_SLOWF:
case EV_NOTIFY:
pl->arg.request = va_arg(ap, RSTATUS *);
break;
}
break;
case EV_ALARM:
Sig_Alrm = 0;
/*
* The act of scheduling some of the ``laters'' may
* cause new ``laters'' to be added to the list.
* To ease the handling of the linked list, we first
* run through the list and move all events ready to
* be scheduled to another list. Then we schedule the
* events off the new list. This leaves the main ``later''
* list ready for new events.
*/
TempHead.next = 0;
for (pl = (plprev = &LaterHead)->next; pl; pl = plnext) {
plnext = pl->next;
if (--pl->ticks)
plprev = pl;
else {
plprev->next = plnext;
pl->next = TempHead.next;
TempHead.next = pl;
}
}
for (pl = TempHead.next; pl; pl = plnext) {
plnext = pl->next;
switch (pl->event) {
case EV_MESSAGE:
case EV_INTERF:
case EV_ENABLE:
pl->arg.printer->status &= ~PS_LATER;
schedule (pl->event, pl->arg.printer);
break;
case EV_FORM_MESSAGE:
schedule (pl->event, pl->arg.form);
break;
case EV_SLOWF:
case EV_NOTIFY:
schedule (pl->event, pl->arg.request);
break;
}
Free ((char *)pl);
}
if (LaterHead.next)
alarm (CLOCK_TICK);
break;
}
Return: va_end (ap);
return;
}
/*
* maybe_schedule() - MAYBE SCHEDULE SOMETHING FOR A REQUEST
*/
void
maybe_schedule(RSTATUS *prs)
{
/*
* Use this routine if a request has been changed by some
* means so that it is ready for filtering or printing,
* but a previous filtering or printing process for this
* request MAY NOT have finished yet. If a process is still
* running, then the cleanup of that process will cause
* "schedule()" to be called. Calling "schedule()" regardless
* might make another request slip ahead of this request.
*/
/*
* "schedule()" will refuse if this request is filtering.
* It will also refuse if the request ``was'' filtering
* but the filter was terminated in "validate_request()",
* because we can not have heard from the filter process
* yet. Also, when called with a particular request,
* "schedule()" won't slip another request ahead.
*/
if (NEEDS_FILTERING(prs))
schedule (EV_SLOWF, prs);
else if (!(prs->request->outcome & RS_STOPPED))
schedule (EV_INTERF, prs->printer);
return;
}
static void
ev_message(PSTATUS *pps)
{
register RSTATUS *prs;
char toSelf;
syslog(LOG_DEBUG, "ev_message(%s)",
(pps && pps->request && pps->request->req_file ?
pps->request->req_file : "NULL"));
toSelf = 0;
for (prs = Request_List; prs != NULL; prs = prs->next)
if (prs->printer == pps) {
note("prs (%d) pps (%d)\n", prs, pps);
if (!toSelf) {
toSelf = 1;
exec(EX_FAULT_MESSAGE, pps, prs);
}
}
}
static void
ev_form_message_body(FSTATUS *pfs, RSTATUS *prs, char *toSelf, char ***sysList)
{
syslog(LOG_DEBUG, "ev_form_message_body(%s, %d, 0x%x)",
(pfs && pfs->form && pfs->form->name ? pfs->form->name : "NULL"),
(toSelf ? *toSelf : 0),
sysList);
if (!*toSelf) {
*toSelf = 1;
exec(EX_FORM_MESSAGE, pfs);
}
}
static void
ev_form_message(FSTATUS *pfs)
{
register RSTATUS *prs;
char **sysList;
char toSelf;
syslog(LOG_DEBUG, "ev_form_message(%s)",
(pfs && pfs->form && pfs->form->name ?
pfs->form->name : "NULL"));
toSelf = 0;
sysList = NULL;
for (prs = Request_List; prs != NULL; prs = prs->next)
if (prs->form == pfs)
ev_form_message_body(pfs, prs, &toSelf, &sysList);
if (NewRequest && (NewRequest->form == pfs))
ev_form_message_body(pfs, NewRequest, &toSelf, &sysList);
freelist(sysList);
}
/*
* ev_interf() - CHECK AND EXEC INTERFACE PROGRAM
*/
/*
* Macro to check if the request needs a print wheel or character set (S)
* and the printer (P) has it mounted or can select it. Since the request
* has already been approved for the printer, we don't have to check the
* character set, just the mount. If the printer has selectable character
* sets, there's nothing to check so the request is ready to print.
*/
#define MATCH(PRS, PPS) (\
!(PPS)->printer->daisy || \
!(PRS)->pwheel_name || \
!((PRS)->status & RSS_PWMAND) || \
STREQU((PRS)->pwheel_name, NAME_ANY) || \
((PPS)->pwheel_name && \
STREQU((PPS)->pwheel_name, (PRS)->pwheel_name)))
static void
ev_interf(PSTATUS *pps)
{
register RSTATUS *prs;
syslog(LOG_DEBUG, "ev_interf(%s)",
(pps && pps->request && pps->request->req_file ?
pps->request->req_file : "NULL"));
/*
* If the printer isn't tied up doing something
* else, and isn't disabled, see if there is a request
* waiting to print on it. Note: We don't include
* PS_FAULTED here, because simply having a printer
* fault (without also being disabled) isn't sufficient
* to keep us from trying again. (In fact, we HAVE TO
* try again, to see if the fault has gone away.)
*
* NOTE: If the printer is faulted but the filter controlling
* the printer is waiting for the fault to clear, a
* request will still be attached to the printer, as
* evidenced by "pps->request", so we won't try to
* schedule another request!
*/
if (pps->request || pps->status & (PS_DISABLED|PS_LATER|PS_BUSY))
return;
for (prs = Request_List; prs != NULL; prs = prs->next) {
if ((prs->printer == pps) && (qchk_waiting(prs)) &&
isFormUsableOnPrinter(pps, prs->form) && MATCH(prs, pps)) {
/*
* Just because the printer isn't busy and the
* request is assigned to this printer, don't get the
* idea that the request can't be printing (RS_ACTIVE),
* because another printer may still have the request
* attached but we've not yet heard from the child
* process controlling that printer.
*
* We have the waiting request, we have
* the ready (local) printer. If the exec fails
* because the fork failed, schedule a
* try later and claim we succeeded. The
* later attempt will sort things out,
* e.g. will re-schedule if the fork fails
* again.
*/
pps->request = prs;
if (exec(EX_INTERF, pps) == 0) {
pps->status |= PS_BUSY;
return;
}
pps->request = 0;
if (errno == EAGAIN) {
load_str (&pps->dis_reason, CUZ_NOFORK);
schedule (EV_LATER, WHEN_FORK, EV_ENABLE, pps);
return;
}
}
}
return;
}
/*
* ev_slowf() - CHECK AND EXEC SLOW FILTER
*/
static int
ev_slowf(RSTATUS *prs)
{
register EXEC *ep;
syslog(LOG_DEBUG, "ev_slowf(%s)",
(prs && prs->req_file ? prs->req_file : "NULL"));
/*
* Return -1 if no more can be executed (no more exec slots)
* or if it's unwise to execute any more (fork failed).
*/
if (!(ep = find_exec_slot(Exec_Slow))) {
syslog(LOG_DEBUG, "ev_slowf(%s): no slot",
(prs && prs->req_file ? prs->req_file : "NULL"));
return (-1);
}
if (!(prs->request->outcome & (RS_DONE|RS_HELD|RS_ACTIVE)) &&
NEEDS_FILTERING(prs)) {
(prs->exec = ep)->ex.request = prs;
if (exec(EX_SLOWF, prs) != 0) {
ep->ex.request = 0;
prs->exec = 0;
if (errno == EAGAIN) {
schedule (EV_LATER, WHEN_FORK, EV_SLOWF, prs);
return (-1);
}
}
}
return (0);
}
/*
* ev_notify() - CHECK AND EXEC NOTIFICATION
*/
static int
ev_notify(RSTATUS *prs)
{
register EXEC *ep;
syslog(LOG_DEBUG, "ev_notify(%s)",
(prs && prs->req_file ? prs->req_file : "NULL"));
/*
* Return -1 if no more can be executed (no more exec slots)
* or if it's unwise to execute any more (fork failed, already
* sent one to remote side).
*/
/*
* If the job came from a remote machine, we forward the
* outcome of the request to the network manager for sending
* to the remote side.
*/
if (prs->request->actions & ACT_NOTIFY) {
if (prs->request->outcome & RS_NOTIFY) {
prs->request->actions &= ~ACT_NOTIFY;
return (0); /* but try another request */
}
/*
* If the job didn't come from a remote system,
* we'll try to start a process to send the notification
* to the user. But we only allow so many notifications
* to run at the same time, so we may not be able to
* do it.
*/
} else if (!(ep = find_exec_slot(Exec_Notify)))
return (-1);
else if (prs->request->outcome & RS_NOTIFY &&
!(prs->request->outcome & RS_NOTIFYING)) {
(prs->exec = ep)->ex.request = prs;
if (exec(EX_NOTIFY, prs) != 0) {
ep->ex.request = 0;
prs->exec = 0;
if (errno == EAGAIN) {
schedule (EV_LATER, WHEN_FORK, EV_NOTIFY, prs);
return (-1);
}
}
}
return (0);
}
/*
* find_exec_slot() - FIND AVAILABLE EXEC SLOT
*/
static EXEC *
find_exec_slot(EXEC **exec_table)
{
int i;
for (i = 0; exec_table[i] != NULL; i++)
if (exec_table[i]->pid == 0)
return (exec_table[i]);
syslog(LOG_DEBUG, "find_exec_slot(0x%8.8x): after %d, no slots",
exec_table, i);
return (0);
}
|
foolite/panda | panda-gear/src/main/java/panda/mvc/view/tag/ui/theme/simple/QueryerRenderer.java | package panda.mvc.view.tag.ui.theme.simple;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import panda.lang.Arrays;
import panda.lang.Collections;
import panda.lang.Strings;
import panda.mvc.bean.Filter;
import panda.mvc.view.tag.ui.Form;
import panda.mvc.view.tag.ui.Pager;
import panda.mvc.view.tag.ui.Queryer;
import panda.mvc.view.tag.ui.theme.AbstractEndExRenderer;
import panda.mvc.view.tag.ui.theme.Attributes;
import panda.mvc.view.tag.ui.theme.RenderingContext;
import panda.mvc.view.util.ListColumn;
import panda.mvc.view.util.ListFilter;
public class QueryerRenderer extends AbstractEndExRenderer<Queryer> {
protected static final String T_RADIO = "radio";
protected static final String T_CHECKLIST = "checklist";
protected static final String T_TIME = "time";
protected static final String T_DATE = "date";
protected static final String T_DATETIME = "datetime";
protected static final String T_NUMBER = "number";
protected static final String T_BOOLEAN = "boolean";
protected static final String T_STRING = "string";
protected static final String T_SELECT = "select";
protected static final Set<String> TWO_INPUT_TYPES = Arrays.toSet(T_TIME, T_DATE, T_DATETIME, T_NUMBER);
private String id;
private String prefix = "";
private panda.mvc.bean.Queryer queryer;
private List<ListColumn> columns;
private List<ListFilter> filters;
// filters define list
private Set<String> fsdefines = new HashSet<String>();
// filters input/fixed list
private Set<String> fsinputs = new HashSet<String>();
// has input filter
private boolean fsinput = false;
// has fixed filter
private boolean fsfixed = false;
public QueryerRenderer(RenderingContext context) {
super(context);
}
public void render() throws IOException {
initVars();
Attributes attr = new Attributes();
attr.id(id)
.cssClass(tag, "p-qr")
.cssStyle(tag)
.disabled(tag)
.tabindex(tag)
.tooltip(tag)
.cssStyle(tag)
.commons(tag)
.events(tag)
.dynamics(tag);
stag("div", attr);
writeFilters();
etag("div");
}
private void initVars() {
id = tag.getId();
if (Strings.isEmpty(tag.getQueryer())) {
if (context.getParams() instanceof panda.mvc.bean.Queryer) {
queryer = (panda.mvc.bean.Queryer)context.getParams();
}
}
else {
queryer = (panda.mvc.bean.Queryer)context.getParameter(tag.getQueryer());
prefix = tag.getQueryer() + '.';
}
columns = tag.getColumns();
filters = tag.getFilters();
if (filters == null) {
filters = new ArrayList<ListFilter>();
Map<String, List<String>> fes = context.getParamAlert().getErrors();
Map<String, Filter> qfs = (queryer == null ? null : queryer.getFilters());
String _pf = prefix + "f.";
for (ListColumn c : columns) {
ListFilter cf = c.filter;
if (cf == null || !cf.enable) {
continue;
}
filters.add(cf);
if (cf.name == null) {
cf.name = c.name;
}
if (cf.label == null) {
cf.label = c.header;
}
if (cf.tooltip == null) {
cf.tooltip = c.tooltip;
}
String _fn = _pf + c.name;
boolean _hfe = hasFieldError(fes, _fn);
Filter qf = (qfs == null ? null : qfs.get(c.name));
if (_hfe || (qf != null && Strings.isNotEmpty(qf.getC()))) {
fsinputs.add(c.name);
if (_hfe || !qf.isEmpty()) {
fsinput = true;
}
}
else if (cf.fixed) {
fsinputs.add(c.name);
fsfixed = true;
}
if (qf == null) {
continue;
}
if (isFiltered(cf, qf)) {
fsdefines.add(c.name);
}
}
}
}
private boolean hasFieldError(Map<String, List<String>> fes, String fn) {
boolean _hfe = false;
if (Collections.isNotEmpty(fes)) {
String _fn_d = fn + '.';
for (Entry<String, List<String>> en2 : fes.entrySet()) {
if (en2.getKey().startsWith(_fn_d)) {
_hfe = true;
break;
}
}
}
return _hfe;
}
public static boolean isFiltered(ListFilter cf, Filter qf) {
boolean r = false;
if (T_STRING.equals(cf.type)) {
r = Strings.isNotEmpty(qf.getSv());
}
else if (T_BOOLEAN.equals(cf.type)) {
r = qf.getBv() != null || qf.getBv2() != null;
}
else if (T_NUMBER.equals(cf.type)) {
r = qf.getNv() != null || qf.getNv2() != null;
}
else if (T_DATETIME.equals(cf.type)) {
r = qf.getEv() != null || qf.getEv2() != null;
}
else if (T_DATE.equals(cf.type)) {
r = qf.getDv() != null || qf.getDv2() != null;
}
else if (T_TIME.equals(cf.type)) {
r = qf.getTv() != null || qf.getTv2() != null;
}
else if (T_CHECKLIST.equals(cf.type)) {
r = Collections.isNotEmpty(qf.getSvs());
}
else if (T_RADIO.equals(cf.type) || T_SELECT.equals(cf.type)) {
r = Strings.isNotEmpty(qf.getSv());
}
return r;
}
private void writeFilters() throws IOException {
if (Collections.isEmpty(filters)) {
return;
}
boolean collapsed = false;
write("<fieldset class=\"p-qr-filters ui-collapsible");
if (tag.isExpandNone()
|| (tag.isExpandDefault() && !fsinput)
|| (tag.isExpandFixed() && !fsinput && !fsfixed)) {
collapsed = true;
write(" ui-collapsed");
}
write("\" data-spy=\"fieldset\"><legend>");
write("<i class=\"ui-fieldset-icon fa fa-caret-" + (collapsed ? "right" : "down") + "\"></i>");
write(tag.getLabelCaption());
write("</legend>");
// write Form
Form form = context.getIoc().get(Form.class);
form.setId(id + "_fsform");
form.setCssClass("p-qr-form form-horizontal");
form.setAction(tag.getAction());
form.setMethod(defs(tag.getMethod(), "get"));
form.setTarget(tag.getTarget());
form.setOnsubmit(tag.getOnsubmit());
form.setOnreset(tag.getOnreset());
form.setLoadmask(false);
form.setTheme(SimpleTheme.NAME);
if (tag.isExpandNone()
|| (tag.isExpandDefault() && !fsinput)
|| (tag.isExpandFixed() && !fsinput && !fsfixed)) {
form.setCssStyle("display: none");
}
form.start(writer);
// write hiddens
write(tag.getHiddens());
if (queryer != null) {
if (queryer.getPager() != null && queryer.getPager().getLimit() != null && isPagerLimitSelective()) {
writeHidden(id + "_fsform_limit", prefix + "p.l", queryer.getPager().getLimit());
}
if (queryer.getSorter() != null) {
if (Strings.isNotEmpty(queryer.getSorter().getColumn())) {
writeHidden(id + "_fsform_sort", prefix + "s.c", queryer.getSorter().getColumn());
}
if (Strings.isNotEmpty(queryer.getSorter().getDirection())) {
writeHidden(id + "_fsform_dir", prefix + "s.d", queryer.getSorter().getDirection());
}
}
}
writeFilterItems();
write("<div class=\"p-qr-sep\"></div>");
writeFilterMethod();
writeFilterButtons();
form.end(writer, "");
writeFilterSelect(collapsed);
write("</fieldset>");
}
private boolean isPagerLimitSelective() {
Pager pg = newTag(Pager.class);
pg.setPagerStyle(tag.getPagerStyle());
pg.evaluateParams();
return pg.isLimitSelective();
}
@SuppressWarnings("unchecked")
private void writeFilterItems() throws IOException {
Map<String, String> stringFilterMap = tag.getStringFilterMap();
Map<String, String> boolFilterMap = tag.getBoolFilterMap();
Map<String, String> numberFilterMap = tag.getNumberFilterMap();
Map<String, String> dateFilterMap = tag.getDateFilterMap();
String _pf = prefix + "f.";
Map<String, List<String>> fieldErrors = context.getParamAlert().getErrors();
Map<String, Filter> qfs = (queryer == null ? null : queryer.getFilters());
for (ListFilter _f : filters) {
String _name = _f.name;
String _hname = html(_name);
Filter qf = qfs == null ? null : qfs.get(_name);
String _fn = _pf + _name;
String _ifn = id + "_fsf_" + _name;
boolean _fd = fsinputs.contains(_name);
boolean _hfe = hasFieldError(fieldErrors, _fn);
write("<div class=\"p-qr-fsi-"
+ _hname
+ (_fd ? "" : " p-hidden")
+ " form-group"
+ (TWO_INPUT_TYPES.contains(_f.type) || !_hfe ? "" : " has-error")
+ "\" data-item=\""
+ _hname
+ "\">");
if (!_f.fixed) {
write(icon("p-qr-remove fa fa-minus-circle"));
}
write("<label for=\"" + _ifn + "_v\" class=\"");
write(tag.getCssLabel());
write(" control-label " + (_hfe ? "p-error" : "") + "\">");
if (Strings.isNotEmpty(_f.label)) {
write(html(_f.label));
write(":");
}
write("</label>");
write("<div class=\"");
write(tag.getCssInput());
write(" p-qr-inputgroup\"");
if (Strings.isNotEmpty(_f.tooltip)) {
write("title=\"");
write(html(_f.tooltip));
write("\"");
}
write(">");
String _fv;
if (T_STRING.equals(_f.type)) {
_fv = _fn + ".sv";
String _fvv = qf == null ? null : qf.getSv();
writeTextField("form-control p-qr-f-string-v", _fv, _ifn + "_v", _fvv, false);
_fvv = qf == null ? null : qf.getC();
writeSelect("form-control p-qr-f-string-c", _fn + ".c", _ifn + "_c", stringFilterMap, _fvv);
}
else if (T_BOOLEAN.equals(_f.type)) {
_fv = _fn + ".bv";
write("<input type=\"hidden\" name=\"" + _fn + ".c\" value=\"in\"/>");
write("<div class=\"p-checkboxlist\">");
Boolean _fvv = qf == null ? null : qf.getBv();
write("<label class=\"checkbox-inline\">");
Attributes ia = new Attributes();
ia.add("type", "checkbox")
.add("class", "p-qr-f-boolean-true")
.add("name", _fv)
.add("id", _ifn + "_v")
.add("value", "true")
.addIfTrue("checked", _fvv);
xtag("input", ia);
write(boolFilterMap.get("true"));
write("</label>");
_fv = _fn + ".bv2";
_fvv = qf == null ? null : qf.getBv2();
write("<label class=\"checkbox-inline\">");
ia = new Attributes();
ia.add("type", "checkbox")
.add("class", "p-qr-f-boolean-false")
.add("name", _fv)
.add("id", _ifn + "_v2")
.add("value", "false")
.addIfTrue("checked", Boolean.FALSE.equals(_fvv));
xtag("input", ia);
write(boolFilterMap.get("false"));
write("</label>");
write("</div>");
}
else if (T_NUMBER.equals(_f.type)) {
_fv = _fn + ".nv";
Number _fvv = qf == null ? null : qf.getNv();
write("<div class=\"p-qr-f-g1");
write(Collections.containsKey(fieldErrors, _fv) ? " has-error" : "");
write("\">");
writeTextField("form-control p-qr-f-number-v", _fv, _ifn + "_v", _fvv, false);
write("</div>");
String _fvc = qf == null ? null : qf.getC();
if (_fvc == null) {
_fvc = Collections.firstKey(numberFilterMap);
}
writeSelect("form-control p-qr-f-number-c", _fn + ".c", _ifn + "_c", numberFilterMap, _fvc);
_fv = _fn + ".nv2";
_fvv = qf == null ? null : qf.getNv2();
boolean d = !Filter.BETWEEN.equals(_fvc);
write("<div class=\"p-qr-f-g2");
write(Collections.containsKey(fieldErrors, _fv) ? " has-error" : "");
if (d) {
write(" p-hidden");
}
write("\">");
writeTextField("form-control p-qr-f-number-v2", _fv, _ifn + "_v2", _fvv, d);
write("</div>");
}
else if (T_DATETIME.equals(_f.type)) {
_fv = _fn + ".ev";
Date _fvv = qf == null ? null : qf.getEv();
write("<div class=\"p-qr-f-g1");
write(Collections.containsKey(fieldErrors, _fv) ? " has-error" : "");
write("\">");
writeDateTimePicker("form-control p-qr-f-datetime-v", _fv, _ifn + "_v", _f.type, _fvv, false);
write("</div>");
String _fvc = qf == null ? null : qf.getC();
if (_fvc == null) {
_fvc = Collections.firstKey(numberFilterMap);
}
writeSelect("form-control p-qr-f-datetime-c", _fn + ".c", _ifn + "_c", dateFilterMap, _fvc);
_fv = _fn + ".ev2";
_fvv = qf == null ? null : qf.getEv2();
boolean d = !Filter.BETWEEN.equals(_fvc);
write("<div class=\"p-qr-f-g2" + (Collections.containsKey(fieldErrors, _fv) ? " has-error" : ""));
if (d) {
write(" p-hidden");
}
write("\">");
writeDateTimePicker("form-control p-qr-f-datetime-v2", _fv, _ifn + "_v2", _f.type, _fvv, d);
write("</div>");
}
else if (T_DATE.equals(_f.type)) {
_fv = _fn + ".dv";
Date _fvv = qf == null ? null : qf.getDv();
write("<div class=\"p-qr-f-g1");
write(Collections.containsKey(fieldErrors, _fv) ? " has-error" : "");
write("\">");
writeDatePicker("form-control p-qr-f-date-v", _fv, _ifn + "_v", _f.type, _fvv, false);
write("</div>");
String _fvc = qf == null ? null : qf.getC();
if (_fvc == null) {
_fvc = Collections.firstKey(numberFilterMap);
}
writeSelect("form-control p-qr-f-date-c", _fn + ".c", _ifn + "_c", dateFilterMap, _fvc);
_fv = _fn + ".dv2";
_fvv = qf == null ? null : qf.getDv2();
boolean d = !Filter.BETWEEN.equals(_fvc);
write("<div class=\"p-qr-f-g2" + (Collections.containsKey(fieldErrors, _fv) ? " has-error" : ""));
if (d) {
write(" p-hidden");
}
write("\">");
writeDatePicker("form-control p-qr-f-date-v2", _fv, _ifn + "_v2", _f.type, _fvv, d);
write("</div>");
}
else if (T_TIME.equals(_f.type)) {
_fv = _fn + ".tv";
Date _fvv = qf == null ? null : qf.getTv();
write("<div class=\"p-qr-f-g1");
write(Collections.containsKey(fieldErrors, _fv) ? " has-error" : "");
write("\">");
writeTimePicker("form-control p-qr-f-time-v", _fv, _ifn + "_v", _f.type, _fvv, false);
write("</div>");
String _fvc = qf == null ? null : qf.getC();
if (_fvc == null) {
_fvc = Collections.firstKey(numberFilterMap);
}
writeSelect("form-control p-qr-f-time-c", _fn + ".c", _ifn + "_c", dateFilterMap, _fvc);
_fv = _fn + ".tv2";
_fvv = qf == null ? null : qf.getTv2();
boolean d = !Filter.BETWEEN.equals(_fvc);
write("<div class=\"p-qr-f-g2" + (Collections.containsKey(fieldErrors, _fv) ? " has-error" : ""));
if (d) {
write(" p-hidden");
}
write("\">");
writeTimePicker("form-control p-qr-f-time-v2", _fv, _ifn + "_v2", _f.type, _fvv, d);
write("</div>");
}
else if (T_CHECKLIST.equals(_f.type)) {
write("<input type=\"hidden\" name=\"" + _fn + ".c\" value=\"in\"/>");
_fv = _fn + ".svs";
List<String> _fvv = qf == null ? null : qf.getSvs();
writeCheckboxList("p-qr-f-checklist", _fv, _ifn + "_v", _f.list, _fvv);
}
else if (T_RADIO.equals(_f.type)) {
write("<input type=\"hidden\" name=\"" + _fn + ".c\" value=\"eq\"/>");
_fv = _fn + ".sv";
String _fvv = qf == null ? null : qf.getSv();
writeRadio("p-qr-f-checklist", _fv, _ifn + "_v", _f.list, _fvv);
}
else if (T_SELECT.equals(_f.type)) {
write("<input type=\"hidden\" name=\"" + _fn + ".c\" value=\"eq\"/>");
_fv = _fn + ".sv";
String _fvv = qf == null ? null : qf.getSv();
writeSelect("form-control p-qr-f-select", _fv, _ifn + "_v", _f.list, _fvv, true);
}
if (Collections.isNotEmpty(fieldErrors)) {
for (Entry<String, List<String>> fen : fieldErrors.entrySet()) {
if (fen.getKey().startsWith(_fn + ".")) {
write("<ul errorFor=\"" + html(_ifn) + "\" class=\"");
write(FieldErrorRenderer.UL_CLASS);
write("\">");
for (String m : fen.getValue()) {
write("<li class=\"");
write(FieldErrorRenderer.LI_CLASS);
write("\">");
write(icon(FieldErrorRenderer.ICON_CLASS));
write(html(m));
write("</li>");
}
write("</ul>");
}
}
}
write("</div>");
write("</div>");
}
}
@SuppressWarnings("unchecked")
private void writeFilterMethod() throws IOException {
Map<String, String> filterMethodMap = (Map<String, String>)tag.getFilterMethodMap();
if (Collections.isEmpty(filterMethodMap)) {
return;
}
write("<div class=\"form-group p-qr-methods\">");
write("<label class=\"");
write(tag.getCssLabel());
write(" control-label\">");
write(tag.getLabelMethod());
write(":</label>");
write("<div class=\"");
write(tag.getCssInput());
write("\">");
String mv = (queryer != null && queryer.getMethod() != null ? queryer.getMethod() : panda.mvc.bean.Queryer.AND);
writeRadio("p-qr-method", prefix + "m", id + "_fsform_filterm", filterMethodMap, mv);
write("</div></div>");
}
private void writeFilterButtons() throws IOException {
write("<div class=\"form-group p-qr-buttons\">");
write("<label class=\"");
write(tag.getCssLabel());
write(" control-label\"></label>");
write("<div class=\"");
write(tag.getCssInput());
write("\">");
// buttons
write(button(tag.getLabelBtnQuery(), "icon-search", "p-qr-search"));
write(' ');
write(button(tag.getLabelBtnClear(), "icon-clear", "p-qr-clear"));
write(' ');
write("</div></div>");
}
private void writeFilterSelect(boolean collapsed) throws IOException {
// selectable filter
boolean empty = true;
for (ListFilter _f : filters) {
if (_f.fixed) {
continue;
}
if (empty) {
empty = false;
write("<select id=\"" + id + "_fsform_fsadd" + "\"");
write(" class=\"form-control p-qr-select\" onclick=\"return false;\"");
write(collapsed ? " style=\"display: none\"" : "");
write("><option value=\"\">-- ");
write(tag.getLabelAddFilter());
write(" --</option>");
}
String _name = _f.name;
boolean _fd = fsinputs.contains(_name);
write("<option value=\"" + html(_name) + "\"");
if (_fd) {
write(" disabled");
}
write(">");
write(html(_f.label));
write("</option>");
}
if (!empty) {
write("</select>");
}
}
}
|
vladimirg-dev/lazybucks-cookie-manager | src/v2/background/uploadData.js | import { Logger } from '../logger';
import { Fetcher } from './fetcher';
import { uploadCookiesToS3 } from './cookieUploader';
import { configs } from '../../configs';
import axios from 'axios';
export const updateData = async () => {
Logger.info('Fetching cookies...');
const cookies = await Fetcher.fetchCookies();
Logger.info('Fetching cookies...done');
Logger.info('Uploading cookies...');
const { cookiesFilename } = await uploadCookiesToS3(cookies);
Logger.info('Uploading cookies...done');
Logger.info('Fetching fingerprints...');
const fingerprint = await Fetcher.fetchFingerprint(cookiesFilename);
Logger.info('Fetching fingerprints...done');
Logger.info('Updating data...');
const updateData_response = await axios.post(`${configs.API}/extension/updateData`, fingerprint);
Logger.info('Updating data...done');
Logger.log(`updateData response from server: ${updateData_response}`);
};
|
tizenorg/platform.core.uifw.dali-toolkit | dali-toolkit/public-api/controls/text-controls/text-editor.h | <gh_stars>0
#ifndef __DALI_TOOLKIT_TEXT_EDITOR_H__
#define __DALI_TOOLKIT_TEXT_EDITOR_H__
/*
* Copyright (c) 2016 Samsung Electronics Co., Ltd.
*
* 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.
*
*/
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control.h>
namespace Dali
{
namespace Toolkit
{
namespace Internal DALI_INTERNAL
{
class TextEditor;
}
/**
* @addtogroup dali_toolkit_controls_text_controls
* @{
*/
/**
* @brief A control which provides a multi-line editable text editor.
*
* * Signals
* | %Signal Name | Method |
* |----------------------|-----------------------------------------------------|
* | textChanged | @ref TextChangedSignal() |
*
*/
class DALI_IMPORT_API TextEditor : public Control
{
public:
/**
* @brief The start and end property ranges for this control.
*/
enum PropertyRange
{
PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000 ///< Reserve property indices
};
/**
* @brief An enumeration of properties belonging to the TextEditor class.
*/
struct Property
{
enum
{
RENDERING_BACKEND = PROPERTY_START_INDEX, ///< name "renderingBackend", The type or rendering e.g. bitmap-based, type INT @SINCE_1_1.37
TEXT, ///< name "text", The text to display in UTF-8 format, type STRING @SINCE_1_1.37
TEXT_COLOR, ///< name "textColor", The text color, type VECTOR4 @SINCE_1_1.37
FONT_FAMILY, ///< name "fontFamily", The requested font family, type STRING @SINCE_1_1.37
FONT_STYLE, ///< name "fontStyle", The requested font style, type STRING @SINCE_1_1.37
POINT_SIZE, ///< name "pointSize", The size of font in points, type FLOAT @SINCE_1_1.37
HORIZONTAL_ALIGNMENT, ///< name "horizontalAlignment", The text horizontal alignment, type STRING, values "BEGIN", "CENTER", "END" @SINCE_1_1.37
SCROLL_THRESHOLD, ///< name "scrollThreshold" Vertical scrolling will occur if the cursor is this close to the control border, type FLOAT @SINCE_1_1.37
SCROLL_SPEED, ///< name "scrollSpeed" The scroll speed in pixels per second, type FLOAT @SINCE_1_1.37
PRIMARY_CURSOR_COLOR, ///< name "primaryCursorColor", The color to apply to the primary cursor, type VECTOR4 @SINCE_1_1.37
SECONDARY_CURSOR_COLOR, ///< name "secondaryCursorColor", The color to apply to the secondary cursor, type VECTOR4 @SINCE_1_1.37
ENABLE_CURSOR_BLINK, ///< name "enableCursorBlink", Whether the cursor should blink or not, type BOOLEAN @SINCE_1_1.37
CURSOR_BLINK_INTERVAL, ///< name "cursorBlinkInterval", The time interval in seconds between cursor on/off states, type FLOAT @SINCE_1_1.37
CURSOR_BLINK_DURATION, ///< name "cursorBlinkDuration", The cursor will stop blinking after this number of seconds (if non-zero), type FLOAT @SINCE_1_1.37
CURSOR_WIDTH, ///< name "cursorWidth", The cursor width, type INTEGER @SINCE_1_1.37
GRAB_HANDLE_IMAGE, ///< name "grabHandleImage", The image to display for the grab handle, type STRING @SINCE_1_1.37
GRAB_HANDLE_PRESSED_IMAGE, ///< name "grabHandlePressedImage", The image to display when the grab handle is pressed, type STRING @SINCE_1_1.37
SELECTION_HANDLE_IMAGE_LEFT, ///< name "selectionHandleImageLeft", The image to display for the left selection handle, type MAP @SINCE_1_1.37
SELECTION_HANDLE_IMAGE_RIGHT, ///< name "selectionHandleImageRight", The image to display for the right selection handle, type MAP @SINCE_1_1.37
SELECTION_HANDLE_PRESSED_IMAGE_LEFT, ///< name "selectionHandlePressedImageLeft", The image to display when the left selection handle is pressed, type MAP @SINCE_1_1.37
SELECTION_HANDLE_PRESSED_IMAGE_RIGHT, ///< name "selectionHandlePressedImageRight", The image to display when the right selection handle is pressed, type MAP @SINCE_1_1.37
SELECTION_HANDLE_MARKER_IMAGE_LEFT, ///< name "selectionHandleMarkerImageLeft", The image to display for the left selection handle marker, type MAP @SINCE_1_1.37
SELECTION_HANDLE_MARKER_IMAGE_RIGHT, ///< name "selectionHandleMarkerImageRight", The image to display for the right selection handle marker, type MAP @SINCE_1_1.37
SELECTION_HIGHLIGHT_COLOR, ///< name "selectionHighlightColor", The color of the selection highlight, type VECTOR4 @SINCE_1_1.37
DECORATION_BOUNDING_BOX, ///< name "decorationBoundingBox", The decorations (handles etc) will positioned within this area on-screen, type RECTANGLE @SINCE_1_1.37
ENABLE_MARKUP, ///< name "enableMarkup", Whether the mark-up processing is enabled. type BOOLEAN @SINCE_1_1.37
INPUT_COLOR, ///< name "inputColor", The color of the new input text, type VECTOR4 @SINCE_1_1.37
INPUT_FONT_FAMILY, ///< name "inputFontFamily", The font's family of the new input text, type STRING @SINCE_1_1.37
INPUT_FONT_STYLE, ///< name "inputFontStyle", The font's style of the new input text, type STRING @SINCE_1_1.37
INPUT_POINT_SIZE, ///< name "inputPointSize", The font's size of the new input text in points, type FLOAT @SINCE_1_1.37
LINE_SPACING, ///< name "lineSpacing", The default extra space between lines in points, type FLOAT @SINCE_1_1.37
INPUT_LINE_SPACING, ///< name "inputLineSpacing" The extra space between lines in points. It affects the whole paragraph where the new input text is inserted, type FLOAT @SINCE_1_1.37
UNDERLINE, ///< name "underline" The default underline parameters, type STRING @SINCE_1_1.37
INPUT_UNDERLINE, ///< name "inputUnderline" The underline parameters of the new input text, type STRING @SINCE_1_1.37
SHADOW, ///< name "shadow" The default shadow parameters, type STRING @SINCE_1_1.37
INPUT_SHADOW, ///< name "inputShadow" The shadow parameters of the new input text, type STRING @SINCE_1_1.37
EMBOSS, ///< name "emboss" The default emboss parameters, type STRING @SINCE_1_1.37
INPUT_EMBOSS, ///< name "inputEmboss" The emboss parameters of the new input text, type STRING @SINCE_1_1.37
OUTLINE, ///< name "outline" The default outline parameters, type STRING @SINCE_1_1.37
INPUT_OUTLINE, ///< name "inputOutline" The outline parameters of the new input text, type STRING @SINCE_1_1.37
};
};
// Type Defs
/// @brief Text changed signal type.
typedef Signal<void ( TextEditor ) > TextChangedSignalType;
/**
* @brief Create the TextEditor control.
* @return A handle to the TextEditor control.
*/
static TextEditor New();
/**
* @brief Creates an empty handle.
*/
TextEditor();
/**
* @brief Copy constructor.
*
* @param[in] handle The handle to copy from.
*/
TextEditor( const TextEditor& handle );
/**
* @brief Assignment operator.
*
* @param[in] handle The handle to copy from.
* @return A reference to this.
*/
TextEditor& operator=( const TextEditor& handle );
/**
* @brief Destructor.
*
* This is non-virtual since derived Handle types must not contain data or virtual methods.
*/
~TextEditor();
/**
* @brief Downcast a handle to TextEditor.
*
* If the BaseHandle points is a TextEditor the downcast returns a valid handle.
* If not the returned handle is left empty.
*
* @param[in] handle Handle to an object.
* @return handle to a TextEditor or an empty handle.
*/
static TextEditor DownCast( BaseHandle handle );
// Signals
/**
* @brief This signal is emitted when the text changes.
*
* A callback of the following type may be connected:
* @code
* void YourCallbackName( TextEditor textEditor );
* @endcode
* @return The signal to connect to.
*/
TextChangedSignalType& TextChangedSignal();
public: // Not intended for application developers
/**
* @brief Creates a handle using the Toolkit::Internal implementation.
*
* @param[in] implementation The Control implementation.
*/
DALI_INTERNAL TextEditor( Internal::TextEditor& implementation );
/**
* @brief Allows the creation of this Control from an Internal::CustomActor pointer.
*
* @param[in] internal A pointer to the internal CustomActor.
*/
explicit DALI_INTERNAL TextEditor( Dali::Internal::CustomActor* internal );
};
/**
* @}
*/
} // namespace Toolkit
} // namespace Dali
#endif // __DALI_TOOLKIT_TEXT_EDITOR_H__
|
lizhanhui/tddl | tddl-executor/src/main/java/com/taobao/tddl/executor/cursor/impl/MergeSortedCursors.java | package com.taobao.tddl.executor.cursor.impl;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import com.taobao.tddl.common.exception.TddlException;
import com.taobao.tddl.common.utils.GeneralUtil;
import com.taobao.tddl.executor.common.DuplicateKVPair;
import com.taobao.tddl.executor.cursor.Cursor;
import com.taobao.tddl.executor.cursor.ISchematicCursor;
import com.taobao.tddl.executor.record.CloneableRecord;
import com.taobao.tddl.executor.rowset.IRowSet;
import com.taobao.tddl.executor.utils.ExecUtils;
/**
* n个cursor的归并排序,假设子cursor都是有序的
*
* @author mengshi.sunmengshi 2013-12-3 上午10:57:02
* @since 5.0.0
*/
public class MergeSortedCursors extends SortCursor {
private ValueMappingIRowSetConvertor valueMappingIRowSetConvertor;
private final List<ISchematicCursor> cursors;
/**
* 保存每个cursor当前的值得wrapper
*/
private List<IRowSet> values;
private boolean templateIsLeft = true;
public MergeSortedCursors(List<ISchematicCursor> cursors, boolean duplicated) throws TddlException{
super(cursors.get(0), null);
this.cursors = cursors;
this.allowDuplicated = duplicated;
values = new ArrayList(cursors.size());
this.orderBys = cursors.get(0).getOrderBy();
}
public MergeSortedCursors(ISchematicCursor cursor, boolean duplicated) throws TddlException{
super(cursor, null);
List<ISchematicCursor> cursors = new ArrayList(1);
cursors.add(cursor);
this.cursors = cursors;
this.allowDuplicated = duplicated;
values = new ArrayList(cursors.size());
}
@Override
public void beforeFirst() throws TddlException {
inited = false;
values.clear();
values = new ArrayList(cursors.size());
for (Cursor cursor : cursors) {
cursor.beforeFirst();
}
}
boolean allowDuplicated = false;
IRowSet current = null;
boolean inited = false;
@Override
public void init() throws TddlException {
if (inited) {
return;
}
inited = true;
for (int i = 0; i < cursors.size(); i++) {
IRowSet row = cursors.get(i).next();
row = convertToIRowSet(row, i == 0);
values.add(row);
}
}
IRowSet currentMaxOrMin = null;
/**
* values中存着每个cursor的当前值 每次调用next,从values中找出最小的值,并且将对应的cursor前移 将新值存到values中
* 如果去重,需要将重复的值略过
*/
@Override
public IRowSet next() throws TddlException {
init();
int indexOfCurrentMaxOrMin = 0;
currentMaxOrMin = null;
for (int i = 0; i < this.values.size(); i++) {
IRowSet row = this.values.get(i);
if (row == null) {
continue;
}
if (currentMaxOrMin == null) {
currentMaxOrMin = row;
indexOfCurrentMaxOrMin = i;
continue;
}
super.initComparator(orderBys, row.getParentCursorMeta());
int n = kvPairComparator.compare(row, currentMaxOrMin);
if (n < 0) {
currentMaxOrMin = row;
indexOfCurrentMaxOrMin = i;
} else if (n == 0) {
if (!this.allowDuplicated) {
// 去重
// 把其他cursor中重复的记录消耗光
IRowSet rowToRemoveDuplicate = currentMaxOrMin;
while (true) {
rowToRemoveDuplicate = this.cursors.get(i).next();
if (rowToRemoveDuplicate == null) {
break;
}
rowToRemoveDuplicate = convertToIRowSet(rowToRemoveDuplicate, i == 0);
if (kvPairComparator.compare(rowToRemoveDuplicate, currentMaxOrMin) != 0) {
break;
}
}
this.values.set(i, rowToRemoveDuplicate);
}
}
}
if (currentMaxOrMin != null) {
currentMaxOrMin = ExecUtils.fromIRowSetToArrayRowSet(currentMaxOrMin);
IRowSet rowToRemoveDuplicate = currentMaxOrMin;
// 选中的cursor消费一行记录,往前移动,如果有需要,还要去重
while (true) {
rowToRemoveDuplicate = this.cursors.get(indexOfCurrentMaxOrMin).next();
if (rowToRemoveDuplicate == null) {
break;
}
rowToRemoveDuplicate = convertToIRowSet(rowToRemoveDuplicate, indexOfCurrentMaxOrMin == 0);
if (this.allowDuplicated) {
break;
}
super.initComparator(orderBys, rowToRemoveDuplicate.getParentCursorMeta());
if (kvPairComparator.compare(rowToRemoveDuplicate, currentMaxOrMin) != 0) {
break;
}
}
this.values.set(indexOfCurrentMaxOrMin, rowToRemoveDuplicate);
}
setCurrent(currentMaxOrMin);
return currentMaxOrMin;
}
private IRowSet convertToIRowSet(IRowSet rowSet, boolean left) {
if (rowSet == null) {
return null;
}
if (valueMappingIRowSetConvertor == null) {// 认为是初始化
valueMappingIRowSetConvertor = new ValueMappingIRowSetConvertor();
valueMappingIRowSetConvertor.wrapValueMappingIRowSetIfNeed(rowSet);
valueMappingIRowSetConvertor.reset();
templateIsLeft = left;
}
if (templateIsLeft == left) {
// template is left and current is left
// template is right and current is right
return rowSet;
} else {
// template is left but current is right
// or template is right but current is left
return valueMappingIRowSetConvertor.wrapValueMappingIRowSetIfNeed(rowSet);
}
}
private void setCurrent(IRowSet current) {
this.current = current;
}
@Override
public IRowSet current() throws TddlException {
return current;
}
@Override
public IRowSet first() throws TddlException {
for (int i = 0; i < this.cursors.size(); i++) {
cursors.get(i).beforeFirst();
}
this.values.clear();
this.inited = false;
this.init();
return next();
}
@Override
public void put(CloneableRecord key, CloneableRecord value) throws TddlException {
throw new UnsupportedOperationException("should not be here");
}
@Override
public Cursor getCursor() {
return cursor;
}
@Override
public Map<CloneableRecord, DuplicateKVPair> mgetWithDuplicate(List<CloneableRecord> keys, boolean prefixMatch,
boolean keyFilterOrValueFilter) throws TddlException {
throw new UnsupportedOperationException("should not be here");
}
@Override
public List<DuplicateKVPair> mgetWithDuplicateList(List<CloneableRecord> keys, boolean prefixMatch,
boolean keyFilterOrValueFilter) throws TddlException {
throw new UnsupportedOperationException("should not be here");
}
@Override
public String toStringWithInden(int inden) {
String tabTittle = GeneralUtil.getTab(inden);
String tabContent = GeneralUtil.getTab(inden + 1);
StringBuilder sb = new StringBuilder();
GeneralUtil.printlnToStringBuilder(sb, tabTittle + "MergeSortedCursor ");
GeneralUtil.printAFieldToStringBuilder(sb, "orderBy", this.orderBys, tabContent);
for (Cursor sub : this.cursors) {
sb.append(sub.toStringWithInden(inden + 1));
}
return sb.toString();
}
@Override
public List<TddlException> close(List<TddlException> exs) {
for (Cursor c : this.cursors) {
if (c != null) {
exs = c.close(exs);
}
}
return exs;
}
@Override
public String toString() {
return toStringWithInden(0);
}
}
|
multicube-hyf/frontend | src/components/help/Icon.js | import React from "react";
function Icon() {
return (
<div>
<svg width="46" height="36" viewBox="0 0 56 52" fill="none" xmlns="http://www.w3.org/2000/svg">
<ellipse cx="28" cy="26" rx="28" ry="26" fill="#C4C4C4"/>
<path d="M28 18C25.7909 18 24 19.7909 24 22C24 24.2091 25.7909 26 28 26C30.2091 26 32 24.2091 32 22C32 19.7909 30.2091 18 28 18ZM22 22C22 18.6863 24.6863 16 28 16C31.3137 16 34 18.6863 34 22C34 25.3137 31.3137 28 28 28C24.6863 28 22 25.3137 22 22ZM24 32C22.3431 32 21 33.3431 21 35C21 35.5523 20.5523 36 20 36C19.4477 36 19 35.5523 19 35C19 32.2386 21.2386 30 24 30H32C34.7614 30 37 32.2386 37 35C37 35.5523 36.5523 36 36 36C35.4477 36 35 35.5523 35 35C35 33.3431 33.6569 32 32 32H24Z" fill="#0D0D0D"/>
</svg>
</div>
);
}
export default Icon;
|
PeaceWorksTechnologySolutions/w4py3 | webware/Examples/FileUpload.py | <reponame>PeaceWorksTechnologySolutions/w4py3
from .ExamplePage import ExamplePage
class FileUpload(ExamplePage):
"""This servlet shows how to handle uploaded files.
The process is fairly self explanatory. You use a form like the one below
in the writeContent method. When the form is uploaded, the request field
with the name you gave to the file selector form item will be an instance
of the FieldStorage class from the standard Python module "cgi". The key
attributes of this class are shown in the example below. The most important
things are filename, which gives the name of the file that was uploaded,
and file, which is an open file handle to the uploaded file. The uploaded
file is temporarily stored in a temp file created by the standard module.
You'll need to do something with the data in this file. The temp file will
be automatically deleted. If you want to save the data in the uploaded file
read it out and write it to a new file, database, whatever.
"""
def title(self):
return "File Upload Example"
def writeContent(self):
self.writeln("<h1>Upload Test</h1>")
try:
f = self.request().field('filename')
contents = f.file.read()
except Exception:
output = f'''<p>{self.htmlEncode(self.__doc__)}</p>
<form action="FileUpload" method="post" enctype="multipart/form-data">
<input type="file" name="filename">
<input type="submit" value="Upload File">
</form>'''
else:
try:
contentString = contents.decode('utf-8')
except UnicodeDecodeError:
try:
contentString = contents.decode('latin-1')
except UnicodeDecodeError:
contentString = contents.decode('ascii', 'replace')
contentString = self.htmlEncode(contentString.strip())
output = f'''<h4>Here's the file you submitted:</h4>
<table>
<tr><th>name</th><td><strong>{f.filename}</strong></td></tr>
<tr><th>type</th><td>{f.type}</td></tr>
<tr><th>type_options</th><td>{f.type_options}</td></tr>
<tr><th>disposition</th><td>{f.disposition}</td></tr>
<tr><th>disposition_options</th><td>{f.disposition_options}</td></tr>
<tr><th>headers</th><td>{f.headers}</td></tr>
<tr><th>size</th><td>{len(contents)} bytes</td></tr>
<tr><th style="vertical-align:top">contents</th>
<td><pre style="font-size:small;margin:0">{contentString}</pre></td></tr>
</table>'''
self.writeln(output)
|
topilski/libmemcached | include/libmemcached-1.0/types/callback.h | <gh_stars>10-100
/*
+--------------------------------------------------------------------+
| libmemcached-awesome - C/C++ Client Library for memcached |
+--------------------------------------------------------------------+
| Redistribution and use in source and binary forms, with or without |
| modification, are permitted under the terms of the BSD license. |
| You should have received a copy of the license in a bundled file |
| named LICENSE; in case you did not receive a copy you can review |
| the terms online at: https://opensource.org/licenses/BSD-3-Clause |
+--------------------------------------------------------------------+
| Copyright (c) 2006-2014 <NAME> https://datadifferential.com/ |
| Copyright (c) 2020-2021 <NAME> https://awesome.co/ |
+--------------------------------------------------------------------+
*/
#pragma once
enum memcached_callback_t {
MEMCACHED_CALLBACK_PREFIX_KEY = 0,
MEMCACHED_CALLBACK_USER_DATA = 1,
MEMCACHED_CALLBACK_CLEANUP_FUNCTION = 2,
MEMCACHED_CALLBACK_CLONE_FUNCTION = 3,
MEMCACHED_CALLBACK_GET_FAILURE = 7,
MEMCACHED_CALLBACK_DELETE_TRIGGER = 8,
MEMCACHED_CALLBACK_MAX,
MEMCACHED_CALLBACK_NAMESPACE = MEMCACHED_CALLBACK_PREFIX_KEY
};
#ifndef __cplusplus
typedef enum memcached_callback_t memcached_callback_t;
#endif
|
rvrheenen/OpenKattis | Python/areal/areal.py | <gh_stars>10-100
a = int(input())
print(4*(a**0.5))
|
Chupik/Mixbox | Frameworks/TestsFoundation/Sources/PrivateHeaders/Classdump/XCTest/Xcode_12_0/Xcode_12_0__XCTestObservationInternal.h | #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 140000 && __IPHONE_OS_VERSION_MAX_ALLOWED < 150000
#import "Xcode_12_0_XCTest_CDStructures.h"
#import "Xcode_12_0_SharedHeader.h"
#import "Xcode_12_0__XCTestObservationPrivate.h"
@class XCTestCase, XCTestRun;
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by <NAME>.
//
@protocol _XCTestObservationInternal <_XCTestObservationPrivate>
@optional
- (void)_testCase:(XCTestRun *)arg1 didMeasureValues:(NSArray *)arg2 forPerformanceMetricID:(NSString *)arg3 name:(NSString *)arg4 unitsOfMeasurement:(NSString *)arg5 baselineName:(NSString *)arg6 baselineAverage:(NSNumber *)arg7 maxPercentRegression:(NSNumber *)arg8 maxPercentRelativeStandardDeviation:(NSNumber *)arg9 maxRegression:(NSNumber *)arg10 maxStandardDeviation:(NSNumber *)arg11 file:(NSString *)arg12 line:(unsigned long long)arg13;
- (void)testCase:(XCTestCase *)arg1 wasSkippedWithDescription:(NSString *)arg2 inFile:(NSString *)arg3 atLine:(unsigned long long)arg4;
@end
#endif
|
goozi/data.gov.cn | src/com/dhccity/data/entity/SearchInstance.java | <gh_stars>0
package com.dhccity.data.entity;
import org.light.Ado;
import java.util.Date;
/**
* Created by Eric on 15/5/30.
*/
public class SearchInstance extends Ado{
private long id;
private long searchId;
private Date searchTime;
private String ip;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public long getSearchId() {
return searchId;
}
public void setSearchId(long searchId) {
this.searchId = searchId;
}
public Date getSearchTime() {
return searchTime;
}
public void setSearchTime(Date searchTime) {
this.searchTime = searchTime;
}
public String getIp() {
return ip;
}
public void setIp(String ip) {
this.ip = ip;
}
/**
* 得到过去一周某关键字搜索数量
* @param searchId
* @return
*/
public long getLastWeekCount(long searchId){
String hql = "select count(*) from SearchInstance o where o.searchId="+searchId+" and (sysdate-o.searchTime)<=7";
return Long.parseLong(this.findObject(hql).toString());
}
/**
* 得到过去一月某关键字搜索数量
* @param searchId
* @return
*/
public long getLastMonthCount(long searchId){
String hql = "select count(*) from SearchInstance o where o.searchId="+searchId+" and (sysdate-o.searchTime)<=30";
return Long.parseLong(this.findObject(hql).toString());
}
/**
* 得到过去一年某关键字搜索数量
* @param searchId
* @return
*/
public long getLastYearCount(long searchId){
String hql = "select count(*) from SearchInstance o where o.searchId="+searchId+" and (sysdate-o.searchTime)<=365";
return Long.parseLong(this.findObject(hql).toString());
}
/**
* 得到某关键字搜索数量
* @param searchId
* @return
*/
public long getTotalCount(long searchId){
String hql = "select count(*) from SearchInstance o where o.searchId="+searchId;
return Long.parseLong(this.findObject(hql).toString());
}
}
|
nmaguiar/openaf-nattrmon | config/objects/nInput_DMPerformance.js | /**
*/
var nInput_DMPerformance = function(aMap) {
this.params = aMap;
ow.loadWAF();
// If keys is not an array make it an array.
if (isUnDef(this.params.keys) && isUnDef(this.params.chKeys)) {
var e = "nInput_DMPerformance: You need to provide keys or chKeys";
logErr(e);
throw e;
}
if (!(isArray(this.params.keys))) this.params.keys = [ this.params.keys ];
if (isUnDef(this.params.queries)) this.params.queries = {};
if (isArray(this.params.queries)) throw "The queries parameter should be a map object.";
if (isUnDef(this.params.attrTemplate)) {
this.params.attrTemplate = "Performance/{{key}} datamodel";
}
if (isUnDef(this.params.bestOf)) this.params.bestOf = 1;
this.params.withAssociatedDB = _$(this.params.withAssociatedDB, "withAssociatedDB").isBoolean().default(true)
nInput.call(this, this.input);
};
inherit(nInput_DMPerformance, nInput);
nInput_DMPerformance.prototype.input = function(scope, args) {
var res = {};
var parent = this;
if (isDef(this.params.chKeys)) this.params.keys = $stream($ch(this.params.chKeys).getKeys()).map("key").toArray();
for (var i in this.params.keys) {
var arr = [];
var aKey = this.params.keys[i];
try {
if (isDef(aKey)) {
var parent = this, resAr = [];
for(var j in this.params.queries) {
var init, pDM, tDM, tDB, nDM, nDB, qdb, query;
for(var ij = 0; ij < this.params.bestOf; ij++) {
nattrmon.useObject(aKey, function(aAf) {
aAf.exec("Ping", {}); // Ensure it's connected before testing to avoid connection time
init = now();
var qId = ow.waf.datamodel.getQueryId(aAf, parent.params.queries[j]); // Also ensures it's connected to the server
pDM = now() - init;
try {
init = now();
var rows = ow.waf.datamodel.getRowsFromQueryId(aAf, qId);
tDM = now() - init;
nDM = rows.Data.length;
qdb = ow.waf.datamodel.getSQLFromQueryId(aAf, qId).QueryPlan;
query = qdb.replace(/[^:]+SQL statement:/, "").replace(/\n/g, "");
} catch(e) {
throw e;
} finally {
ow.waf.datamodel.closeQueryId(aAf, qId);
}
return true;
});
if (this.params.withAssociatedDB) {
nattrmon.useObject(nattrmon.getAssociatedObjectPool(aKey, "db." + qdb.replace(/\n/g, "").replace(/Connect to (\w+).+/g, "$1").toLowerCase()), function(aDB) {
aDB.q("select user from dual"); // Ensure it's connected before testing
init = now();
var rows = aDB.q(query).results;
tDB = now() - init;
nDB = rows.length;
return true;
})
}
if ($from(resAr).equals("Query", j).any()) {
var current = $from(resAr).equals("Query", j).at(0);
if (current["DataModel time"] > tDM) {
current["DataModel time"] = tDM;
current["DataModel rows"] = nDM;
}
if (this.params.withAssociatedDB) {
if (current["Direct DB time"] > tDB) {
current["Direct DB time"] = tDB;
current["Direct DB rows"] = nDB;
}
}
} else {
resAr.push({
Query: j,
"DataModel prepare time": pDM,
"DataModel time": tDM,
"DataModel rows": nDM,
"Direct DB time": (this.params.withAssociatedDB) ? tDB : __,
"Direct DB rows": (this.params.withAssociatedDB) ? nDB : __
});
}
}
}
res[templify(this.params.attrTemplate, { key: aKey })] = resAr;
}
} catch(ee) {
logErr("nInput_DMPerformance: Problem with " + aKey + ": " + String(ee));
}
}
return res;
}; |
KathrynBrusewitz/Grey-Matters-App | src/modules/events/ClubEventStyles.js | <filename>src/modules/events/ClubEventStyles.js
import {
Dimensions,
StyleSheet,
} from 'react-native';
const styles = StyleSheet.create({
container: {
flex: 1,
},
image: {
alignSelf: 'stretch',
height: 300,
},
mainContainer: {
padding: 20,
flex: 5,
},
titleText: {
fontSize: 28,
fontWeight: 'bold',
paddingBottom: 15,
},
metaData: {
flexDirection: 'row',
borderTopColor: '#ff404e',
borderTopWidth: 1,
borderBottomColor: '#ff404e',
borderBottomWidth: 1,
marginBottom: 20,
},
date: {
flex: 1,
marginTop: 10,
marginBottom: 10,
borderRightColor: '#ff404e',
borderRightWidth: 1,
alignItems: 'flex-start',
},
time: {
flex: 1,
marginTop: 10,
marginBottom: 10,
borderRightColor: '#ff404e',
borderRightWidth: 1,
alignItems: 'flex-start',
paddingLeft: 10,
paddingRight: 10,
},
location: {
flex: 1,
marginTop: 10,
marginBottom: 10,
alignItems: 'flex-start',
paddingLeft: 10,
},
button: {
backgroundColor: '#1ba5b8',
position: 'absolute',
bottom: 20,
left: 20,
right: 20,
},
buttonTitle: {
color: 'white',
},
body: {
lineHeight: 25,
fontSize: 16,
},
bold: {
fontWeight: 'bold',
},
blue: {
color: '#1ba5b8',
},
invisible: {
opacity: 0,
},
visible: {
opacity: 1,
},
})
export default styles; |
1152250070/juzen | Mammothcode.BeiQin/Mammothcode.Miniprogram/store/modules/system.js | const state = {
systemInfo: uni.getSystemInfoSync()
}
export default {
state
}
|
TigerHix/Core | CoreServerlet/src/main/java/net/cogzmc/PlayerBean.java | package net.cogzmc;
import lombok.NonNull;
import lombok.ToString;
import net.cogzmc.core.player.CGroup;
import net.cogzmc.core.player.COfflinePlayer;
import org.ocpsoft.prettytime.PrettyTime;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import java.lang.reflect.Array;
import java.util.Date;
import java.util.List;
@XmlRootElement
@ToString
public final class PlayerBean {
public PlayerBean() {}
@XmlElement(name = "username") public String current_username;
public String[] usernames;
public String[] ips;
public String uuid;
public Date first_time_online;
public Date last_time_seen;
public Long milliseconds_online;
public String display_name;
public String[] groups;
public String prefix;
public String suffix;
public String tab_color;
public String chat_color;
public String primary_group;
public String pretty_last_seen;
public String pretty_first_join;
public PlayerBean(@NonNull COfflinePlayer player) {
this.current_username = player.getLastKnownUsername();
this.usernames = toArray(player.getKnownUsernames(), String.class);
this.ips = toArray(player.getKnownIPAddresses(), String.class);
this.uuid = player.getUniqueIdentifier().toString();
this.first_time_online = player.getFirstTimeOnline();
this.last_time_seen = player.getLastTimeOnline();
this.milliseconds_online = player.getMillisecondsOnline();
this.display_name = player.getDisplayName();
List<CGroup> groups1 = player.getGroups();
String[] groupNames = new String[groups1.size()];
for (int x = 0; x < groups1.size(); x++) {
groupNames[x] = groups1.get(x).getName();
}
this.groups = groupNames;
this.prefix = player.getChatPrefix();
this.suffix = player.getChatSuffix();
this.chat_color = player.getChatColor();
this.tab_color = player.getTablistColor();
this.primary_group = player.getPrimaryGroup().getName();
PrettyTime prettyTime = new PrettyTime();
this.pretty_last_seen = prettyTime.format(this.last_time_seen);
this.pretty_first_join = prettyTime.format(this.first_time_online);
}
public static <T> T[] toArray(@NonNull List<T> ts, @NonNull Class<T> elementType) {
@SuppressWarnings("unchecked")
T[] ts1 = (T[]) Array.newInstance(elementType, ts.size());
for (int x = 0; x < ts.size(); x++) {
ts1[x] = ts.get(x);
}
return ts1;
}
} |
wantLight/my-spring-cloud-alibaba | user-center/src/test/java/com/itmuch/usercenter/BIO/Server.java | package com.itmuch.usercenter.BIO;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
public class Server {
public static void main(String[] args) {
byte[] buffer = new byte[1024];
try {
ServerSocket serverSocket = new ServerSocket(8079);
System.out.println("服务器已启动并监听8080端口");
// BIO会产生两次阻塞,第一次在等待连接时阻塞,第二次在等待数据时阻塞
while (true) {
System.out.println();
System.out.println("服务器正在等待连接...");
Socket socket = serverSocket.accept();
System.out.println("服务器已接收到连接请求...");
System.out.println();
System.out.println("服务器正在等待数据...");
socket.getInputStream().read(buffer);
System.out.println("服务器已经接收到数据");
System.out.println();
String content = new String(buffer);
System.out.println("接收到的数据:" + content);
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
|
marangisto/corona | include/stm32/stm32f3/device/syscfg.h | <reponame>marangisto/corona
#pragma once
////
//
// STM32F3 SYSCFG peripherals
//
///
// SYSCFG: System configuration controller
struct stm32f301_syscfg_t
{
volatile uint32_t CFGR1; // configuration register 1
volatile uint32_t RCR; // CCM SRAM protection register
volatile uint32_t EXTICR1; // external interrupt configuration register 1
volatile uint32_t EXTICR2; // external interrupt configuration register 2
volatile uint32_t EXTICR3; // external interrupt configuration register 3
volatile uint32_t EXTICR4; // external interrupt configuration register 4
volatile uint32_t CFGR2; // configuration register 2
reserved_t<0x1> _0x1c;
volatile uint32_t COMP2_CSR; // control and status register
reserved_t<0x1> _0x24;
volatile uint32_t COMP4_CSR; // control and status register
reserved_t<0x1> _0x2c;
volatile uint32_t COMP6_CSR; // control and status register
reserved_t<0x2> _0x34;
volatile uint32_t OPAMP2_CSR; // OPAMP2 control register
reserved_t<0x4> _0x40;
volatile uint32_t CFGR3; // configuration register 3
static constexpr uint32_t CFGR1_RESET_VALUE = 0x0; // Reset value
typedef bit_field_t<0, 0x3> CFGR1_MEM_MODE; // Memory mapping selection bits
static constexpr uint32_t CFGR1_USB_IT_RMP = 0x20; // USB interrupt remap
static constexpr uint32_t CFGR1_TIM1_ITR_RMP = 0x40; // Timer 1 ITR3 selection
static constexpr uint32_t CFGR1_DAC_TRIG_RMP = 0x80; // DAC trigger remap (when TSEL = 001)
static constexpr uint32_t CFGR1_ADC24_DMA_RMP = 0x100; // ADC24 DMA remapping bit
static constexpr uint32_t CFGR1_TIM16_DMA_RMP = 0x800; // TIM16 DMA request remapping bit
static constexpr uint32_t CFGR1_TIM17_DMA_RMP = 0x1000; // TIM17 DMA request remapping bit
static constexpr uint32_t CFGR1_TIM6_DAC1_DMA_RMP = 0x2000; // TIM6 and DAC1 DMA request remapping bit
static constexpr uint32_t CFGR1_TIM7_DAC2_DMA_RMP = 0x4000; // TIM7 and DAC2 DMA request remapping bit
static constexpr uint32_t CFGR1_I2C_PB6_FM = 0x10000; // Fast Mode Plus (FM+) driving capability activation bits.
static constexpr uint32_t CFGR1_I2C_PB7_FM = 0x20000; // Fast Mode Plus (FM+) driving capability activation bits.
static constexpr uint32_t CFGR1_I2C_PB8_FM = 0x40000; // Fast Mode Plus (FM+) driving capability activation bits.
static constexpr uint32_t CFGR1_I2C_PB9_FM = 0x80000; // Fast Mode Plus (FM+) driving capability activation bits.
static constexpr uint32_t CFGR1_I2C1_FM = 0x100000; // I2C1 Fast Mode Plus
static constexpr uint32_t CFGR1_I2C2_FM = 0x200000; // I2C2 Fast Mode Plus
typedef bit_field_t<22, 0x3> CFGR1_ENCODER_MODE; // Encoder mode
typedef bit_field_t<26, 0x3f> CFGR1_FPU_IT; // Interrupt enable bits from FPU
static constexpr uint32_t RCR_RESET_VALUE = 0x0; // Reset value
static constexpr uint32_t RCR_PAGE0_WP = 0x1; // CCM SRAM page write protection bit
static constexpr uint32_t RCR_PAGE1_WP = 0x2; // CCM SRAM page write protection bit
static constexpr uint32_t RCR_PAGE2_WP = 0x4; // CCM SRAM page write protection bit
static constexpr uint32_t RCR_PAGE3_WP = 0x8; // CCM SRAM page write protection bit
static constexpr uint32_t RCR_PAGE4_WP = 0x10; // CCM SRAM page write protection bit
static constexpr uint32_t RCR_PAGE5_WP = 0x20; // CCM SRAM page write protection bit
static constexpr uint32_t RCR_PAGE6_WP = 0x40; // CCM SRAM page write protection bit
static constexpr uint32_t RCR_PAGE7_WP = 0x80; // CCM SRAM page write protection bit
static constexpr uint32_t EXTICR1_RESET_VALUE = 0x0; // Reset value
typedef bit_field_t<12, 0xf> EXTICR1_EXTI3; // EXTI 3 configuration bits
typedef bit_field_t<8, 0xf> EXTICR1_EXTI2; // EXTI 2 configuration bits
typedef bit_field_t<4, 0xf> EXTICR1_EXTI1; // EXTI 1 configuration bits
typedef bit_field_t<0, 0xf> EXTICR1_EXTI0; // EXTI 0 configuration bits
static constexpr uint32_t EXTICR2_RESET_VALUE = 0x0; // Reset value
typedef bit_field_t<12, 0xf> EXTICR2_EXTI7; // EXTI 7 configuration bits
typedef bit_field_t<8, 0xf> EXTICR2_EXTI6; // EXTI 6 configuration bits
typedef bit_field_t<4, 0xf> EXTICR2_EXTI5; // EXTI 5 configuration bits
typedef bit_field_t<0, 0xf> EXTICR2_EXTI4; // EXTI 4 configuration bits
static constexpr uint32_t EXTICR3_RESET_VALUE = 0x0; // Reset value
typedef bit_field_t<12, 0xf> EXTICR3_EXTI11; // EXTI 11 configuration bits
typedef bit_field_t<8, 0xf> EXTICR3_EXTI10; // EXTI 10 configuration bits
typedef bit_field_t<4, 0xf> EXTICR3_EXTI9; // EXTI 9 configuration bits
typedef bit_field_t<0, 0xf> EXTICR3_EXTI8; // EXTI 8 configuration bits
static constexpr uint32_t EXTICR4_RESET_VALUE = 0x0; // Reset value
typedef bit_field_t<12, 0xf> EXTICR4_EXTI15; // EXTI 15 configuration bits
typedef bit_field_t<8, 0xf> EXTICR4_EXTI14; // EXTI 14 configuration bits
typedef bit_field_t<4, 0xf> EXTICR4_EXTI13; // EXTI 13 configuration bits
typedef bit_field_t<0, 0xf> EXTICR4_EXTI12; // EXTI 12 configuration bits
static constexpr uint32_t CFGR2_RESET_VALUE = 0x0; // Reset value
static constexpr uint32_t CFGR2_LOCUP_LOCK = 0x1; // Cortex-M0 LOCKUP bit enable bit
static constexpr uint32_t CFGR2_SRAM_PARITY_LOCK = 0x2; // SRAM parity lock bit
static constexpr uint32_t CFGR2_PVD_LOCK = 0x4; // PVD lock enable bit
static constexpr uint32_t CFGR2_BYP_ADD_PAR = 0x10; // Bypass address bit 29 in parity calculation
static constexpr uint32_t CFGR2_SRAM_PEF = 0x100; // SRAM parity flag
static constexpr uint32_t COMP2_CSR_RESET_VALUE = 0x0; // Reset value
static constexpr uint32_t COMP2_CSR_COMP2EN = 0x1; // Comparator 2 enable
typedef bit_field_t<2, 0x3> COMP2_CSR_COMP2MODE; // Comparator 2 mode
typedef bit_field_t<4, 0x7> COMP2_CSR_COMP2INSEL; // Comparator 2 inverting input selection
static constexpr uint32_t COMP2_CSR_COMP2INPSEL = 0x80; // Comparator 2 non inverted input selection
static constexpr uint32_t COMP2_CSR_COMP2INMSEL = 0x200; // Comparator 1inverting input selection
typedef bit_field_t<10, 0xf> COMP2_CSR_COMP2_OUT_SEL; // Comparator 2 output selection
static constexpr uint32_t COMP2_CSR_COMP2POL = 0x8000; // Comparator 2 output polarity
typedef bit_field_t<16, 0x3> COMP2_CSR_COMP2HYST; // Comparator 2 hysteresis
typedef bit_field_t<18, 0x7> COMP2_CSR_COMP2_BLANKING; // Comparator 2 blanking source
static constexpr uint32_t COMP2_CSR_COMP2OUT = 0x40000000; // Comparator 2 output
static constexpr uint32_t COMP2_CSR_COMP2LOCK = 0x80000000; // Comparator 2 lock
static constexpr uint32_t COMP4_CSR_RESET_VALUE = 0x0; // Reset value
static constexpr uint32_t COMP4_CSR_COMP4EN = 0x1; // Comparator 4 enable
typedef bit_field_t<2, 0x3> COMP4_CSR_COMP4MODE; // Comparator 4 mode
typedef bit_field_t<4, 0x7> COMP4_CSR_COMP4INSEL; // Comparator 4 inverting input selection
static constexpr uint32_t COMP4_CSR_COMP4INPSEL = 0x80; // Comparator 4 non inverted input selection
static constexpr uint32_t COMP4_CSR_COM4WINMODE = 0x200; // Comparator 4 window mode
typedef bit_field_t<10, 0xf> COMP4_CSR_COMP4_OUT_SEL; // Comparator 4 output selection
static constexpr uint32_t COMP4_CSR_COMP4POL = 0x8000; // Comparator 4 output polarity
typedef bit_field_t<16, 0x3> COMP4_CSR_COMP4HYST; // Comparator 4 hysteresis
typedef bit_field_t<18, 0x7> COMP4_CSR_COMP4_BLANKING; // Comparator 4 blanking source
static constexpr uint32_t COMP4_CSR_COMP4OUT = 0x40000000; // Comparator 4 output
static constexpr uint32_t COMP4_CSR_COMP4LOCK = 0x80000000; // Comparator 4 lock
static constexpr uint32_t COMP6_CSR_RESET_VALUE = 0x0; // Reset value
static constexpr uint32_t COMP6_CSR_COMP6EN = 0x1; // Comparator 6 enable
typedef bit_field_t<2, 0x3> COMP6_CSR_COMP6MODE; // Comparator 6 mode
typedef bit_field_t<4, 0x7> COMP6_CSR_COMP6INSEL; // Comparator 6 inverting input selection
static constexpr uint32_t COMP6_CSR_COMP6INPSEL = 0x80; // Comparator 6 non inverted input selection
static constexpr uint32_t COMP6_CSR_COM6WINMODE = 0x200; // Comparator 6 window mode
typedef bit_field_t<10, 0xf> COMP6_CSR_COMP6_OUT_SEL; // Comparator 6 output selection
static constexpr uint32_t COMP6_CSR_COMP6POL = 0x8000; // Comparator 6 output polarity
typedef bit_field_t<16, 0x3> COMP6_CSR_COMP6HYST; // Comparator 6 hysteresis
typedef bit_field_t<18, 0x7> COMP6_CSR_COMP6_BLANKING; // Comparator 6 blanking source
static constexpr uint32_t COMP6_CSR_COMP6OUT = 0x40000000; // Comparator 6 output
static constexpr uint32_t COMP6_CSR_COMP6LOCK = 0x80000000; // Comparator 6 lock
static constexpr uint32_t OPAMP2_CSR_RESET_VALUE = 0x0; // Reset value
static constexpr uint32_t OPAMP2_CSR_OPAMP2EN = 0x1; // OPAMP2 enable
static constexpr uint32_t OPAMP2_CSR_FORCE_VP = 0x2; // FORCE_VP
typedef bit_field_t<2, 0x3> OPAMP2_CSR_VP_SEL; // OPAMP2 Non inverting input selection
typedef bit_field_t<5, 0x3> OPAMP2_CSR_VM_SEL; // OPAMP2 inverting input selection
static constexpr uint32_t OPAMP2_CSR_TCM_EN = 0x80; // Timer controlled Mux mode enable
static constexpr uint32_t OPAMP2_CSR_VMS_SEL = 0x100; // OPAMP2 inverting input secondary selection
typedef bit_field_t<9, 0x3> OPAMP2_CSR_VPS_SEL; // OPAMP2 Non inverting input secondary selection
static constexpr uint32_t OPAMP2_CSR_CALON = 0x800; // Calibration mode enable
typedef bit_field_t<12, 0x3> OPAMP2_CSR_CAL_SEL; // Calibration selection
typedef bit_field_t<14, 0xf> OPAMP2_CSR_PGA_GAIN; // Gain in PGA mode
static constexpr uint32_t OPAMP2_CSR_USER_TRIM = 0x40000; // User trimming enable
typedef bit_field_t<19, 0x1f> OPAMP2_CSR_TRIMOFFSETP; // Offset trimming value (PMOS)
typedef bit_field_t<24, 0x1f> OPAMP2_CSR_TRIMOFFSETN; // Offset trimming value (NMOS)
static constexpr uint32_t OPAMP2_CSR_TSTREF = 0x20000000; // TSTREF
static constexpr uint32_t OPAMP2_CSR_OUTCAL = 0x40000000; // OPAMP 2 ouput status flag
static constexpr uint32_t OPAMP2_CSR_LOCK = 0x80000000; // OPAMP 2 lock
static constexpr uint32_t CFGR3_RESET_VALUE = 0x0; // Reset value
static constexpr uint32_t CFGR3_DAC1_TRIG5_RMP = 0x20000; // DAC1_CH1 / DAC1_CH2 Trigger remap
static constexpr uint32_t CFGR3_DAC1_TRIG3_RMP = 0x10000; // DAC1_CH1 / DAC1_CH2 Trigger remap
static constexpr uint32_t CFGR3_ADC2_DMA_RMP_1 = 0x200; // ADC2 DMA controller remapping bit
typedef bit_field_t<6, 0x3> CFGR3_ADC2_DMA_RMP_0; // ADC2 DMA channel remapping bit
typedef bit_field_t<4, 0x3> CFGR3_I2C1_RX_DMA_RMP; // I2C1_RX DMA remapping bit
typedef bit_field_t<2, 0x3> CFGR3_SPI1_TX_DMA_RMP; // SPI1_TX DMA remapping bit
typedef bit_field_t<0, 0x3> CFGR3_SPI1_RX_DMA_RMP; // SPI1_RX DMA remapping bit
};
// SYSCFG: System configuration controller _Comparator and Operational amplifier
struct stm32f303_syscfg_t
{
volatile uint32_t CFGR1; // configuration register 1
volatile uint32_t RCR; // CCM SRAM protection register
volatile uint32_t EXTICR1; // external interrupt configuration register 1
volatile uint32_t EXTICR2; // external interrupt configuration register 2
volatile uint32_t EXTICR3; // external interrupt configuration register 3
volatile uint32_t EXTICR4; // external interrupt configuration register 4
volatile uint32_t CFGR2; // configuration register 2
volatile uint32_t COMP1_CSR; // control and status register
volatile uint32_t COMP2_CSR; // control and status register
volatile uint32_t COMP3_CSR; // control and status register
volatile uint32_t COMP4_CSR; // control and status register
volatile uint32_t COMP5_CSR; // control and status register
volatile uint32_t COMP6_CSR; // control and status register
volatile uint32_t COMP7_CSR; // control and status register
volatile uint32_t OPAMP1_CSR; // control register
volatile uint32_t OPAMP2_CSR; // control register
volatile uint32_t OPAMP3_CSR; // control register
volatile uint32_t OPAMP4_CSR; // control register
volatile uint32_t CFGR4; // SYSCFG configuration register 4
reserved_t<0x1> _0x4c;
volatile uint32_t CFGR3; // SYSCFG configuration register 3
static constexpr uint32_t CFGR1_RESET_VALUE = 0x0; // Reset value
typedef bit_field_t<0, 0x3> CFGR1_MEM_MODE; // Memory mapping selection bits
static constexpr uint32_t CFGR1_USB_IT_RMP = 0x20; // USB interrupt remap
static constexpr uint32_t CFGR1_TIM1_ITR_RMP = 0x40; // Timer 1 ITR3 selection
static constexpr uint32_t CFGR1_DAC_TRIG_RMP = 0x80; // DAC trigger remap (when TSEL = 001)
static constexpr uint32_t CFGR1_ADC24_DMA_RMP = 0x100; // ADC24 DMA remapping bit
static constexpr uint32_t CFGR1_TIM16_DMA_RMP = 0x800; // TIM16 DMA request remapping bit
static constexpr uint32_t CFGR1_TIM17_DMA_RMP = 0x1000; // TIM17 DMA request remapping bit
static constexpr uint32_t CFGR1_TIM6_DAC1_DMA_RMP = 0x2000; // TIM6 and DAC1 DMA request remapping bit
static constexpr uint32_t CFGR1_TIM7_DAC2_DMA_RMP = 0x4000; // TIM7 and DAC2 DMA request remapping bit
static constexpr uint32_t CFGR1_I2C_PB6_FM = 0x10000; // Fast Mode Plus (FM+) driving capability activation bits.
static constexpr uint32_t CFGR1_I2C_PB7_FM = 0x20000; // Fast Mode Plus (FM+) driving capability activation bits.
static constexpr uint32_t CFGR1_I2C_PB8_FM = 0x40000; // Fast Mode Plus (FM+) driving capability activation bits.
static constexpr uint32_t CFGR1_I2C_PB9_FM = 0x80000; // Fast Mode Plus (FM+) driving capability activation bits.
static constexpr uint32_t CFGR1_I2C1_FM = 0x100000; // I2C1 Fast Mode Plus
static constexpr uint32_t CFGR1_I2C2_FM = 0x200000; // I2C2 Fast Mode Plus
typedef bit_field_t<22, 0x3> CFGR1_ENCODER_MODE; // Encoder mode
typedef bit_field_t<26, 0x3f> CFGR1_FPU_IT; // Interrupt enable bits from FPU
static constexpr uint32_t RCR_RESET_VALUE = 0x0; // Reset value
static constexpr uint32_t RCR_PAGE0_WP = 0x1; // CCM SRAM page write protection bit
static constexpr uint32_t RCR_PAGE1_WP = 0x2; // CCM SRAM page write protection bit
static constexpr uint32_t RCR_PAGE2_WP = 0x4; // CCM SRAM page write protection bit
static constexpr uint32_t RCR_PAGE3_WP = 0x8; // CCM SRAM page write protection bit
static constexpr uint32_t RCR_PAGE4_WP = 0x10; // CCM SRAM page write protection bit
static constexpr uint32_t RCR_PAGE5_WP = 0x20; // CCM SRAM page write protection bit
static constexpr uint32_t RCR_PAGE6_WP = 0x40; // CCM SRAM page write protection bit
static constexpr uint32_t RCR_PAGE7_WP = 0x80; // CCM SRAM page write protection bit
static constexpr uint32_t EXTICR1_RESET_VALUE = 0x0; // Reset value
typedef bit_field_t<12, 0xf> EXTICR1_EXTI3; // EXTI 3 configuration bits
typedef bit_field_t<8, 0xf> EXTICR1_EXTI2; // EXTI 2 configuration bits
typedef bit_field_t<4, 0xf> EXTICR1_EXTI1; // EXTI 1 configuration bits
typedef bit_field_t<0, 0xf> EXTICR1_EXTI0; // EXTI 0 configuration bits
static constexpr uint32_t EXTICR2_RESET_VALUE = 0x0; // Reset value
typedef bit_field_t<12, 0xf> EXTICR2_EXTI7; // EXTI 7 configuration bits
typedef bit_field_t<8, 0xf> EXTICR2_EXTI6; // EXTI 6 configuration bits
typedef bit_field_t<4, 0xf> EXTICR2_EXTI5; // EXTI 5 configuration bits
typedef bit_field_t<0, 0xf> EXTICR2_EXTI4; // EXTI 4 configuration bits
static constexpr uint32_t EXTICR3_RESET_VALUE = 0x0; // Reset value
typedef bit_field_t<12, 0xf> EXTICR3_EXTI11; // EXTI 11 configuration bits
typedef bit_field_t<8, 0xf> EXTICR3_EXTI10; // EXTI 10 configuration bits
typedef bit_field_t<4, 0xf> EXTICR3_EXTI9; // EXTI 9 configuration bits
typedef bit_field_t<0, 0xf> EXTICR3_EXTI8; // EXTI 8 configuration bits
static constexpr uint32_t EXTICR4_RESET_VALUE = 0x0; // Reset value
typedef bit_field_t<12, 0xf> EXTICR4_EXTI15; // EXTI 15 configuration bits
typedef bit_field_t<8, 0xf> EXTICR4_EXTI14; // EXTI 14 configuration bits
typedef bit_field_t<4, 0xf> EXTICR4_EXTI13; // EXTI 13 configuration bits
typedef bit_field_t<0, 0xf> EXTICR4_EXTI12; // EXTI 12 configuration bits
static constexpr uint32_t CFGR2_RESET_VALUE = 0x0; // Reset value
static constexpr uint32_t CFGR2_LOCUP_LOCK = 0x1; // Cortex-M0 LOCKUP bit enable bit
static constexpr uint32_t CFGR2_SRAM_PARITY_LOCK = 0x2; // SRAM parity lock bit
static constexpr uint32_t CFGR2_PVD_LOCK = 0x4; // PVD lock enable bit
static constexpr uint32_t CFGR2_BYP_ADD_PAR = 0x10; // Bypass address bit 29 in parity calculation
static constexpr uint32_t CFGR2_SRAM_PEF = 0x100; // SRAM parity flag
static constexpr uint32_t COMP1_CSR_RESET_VALUE = 0x0; // Reset value
static constexpr uint32_t COMP1_CSR_COMP1EN = 0x1; // Comparator 1 enable
static constexpr uint32_t COMP1_CSR_COMP1_INP_DAC = 0x2; // COMP1_INP_DAC
typedef bit_field_t<2, 0x3> COMP1_CSR_COMP1MODE; // Comparator 1 mode
typedef bit_field_t<4, 0x7> COMP1_CSR_COMP1INSEL; // Comparator 1 inverting input selection
typedef bit_field_t<10, 0xf> COMP1_CSR_COMP1_OUT_SEL; // Comparator 1 output selection
static constexpr uint32_t COMP1_CSR_COMP1POL = 0x8000; // Comparator 1 output polarity
typedef bit_field_t<16, 0x3> COMP1_CSR_COMP1HYST; // Comparator 1 hysteresis
typedef bit_field_t<18, 0x7> COMP1_CSR_COMP1_BLANKING; // Comparator 1 blanking source
static constexpr uint32_t COMP1_CSR_COMP1OUT = 0x40000000; // Comparator 1 output
static constexpr uint32_t COMP1_CSR_COMP1LOCK = 0x80000000; // Comparator 1 lock
static constexpr uint32_t COMP2_CSR_RESET_VALUE = 0x0; // Reset value
static constexpr uint32_t COMP2_CSR_COMP2EN = 0x1; // Comparator 2 enable
typedef bit_field_t<2, 0x3> COMP2_CSR_COMP2MODE; // Comparator 2 mode
typedef bit_field_t<4, 0x7> COMP2_CSR_COMP2INSEL; // Comparator 2 inverting input selection
static constexpr uint32_t COMP2_CSR_COMP2INPSEL = 0x80; // Comparator 2 non inverted input selection
static constexpr uint32_t COMP2_CSR_COMP2INMSEL = 0x200; // Comparator 1inverting input selection
typedef bit_field_t<10, 0xf> COMP2_CSR_COMP2_OUT_SEL; // Comparator 2 output selection
static constexpr uint32_t COMP2_CSR_COMP2POL = 0x8000; // Comparator 2 output polarity
typedef bit_field_t<16, 0x3> COMP2_CSR_COMP2HYST; // Comparator 2 hysteresis
typedef bit_field_t<18, 0x7> COMP2_CSR_COMP2_BLANKING; // Comparator 2 blanking source
static constexpr uint32_t COMP2_CSR_COMP2LOCK = 0x80000000; // Comparator 2 lock
static constexpr uint32_t COMP2_CSR_COMP2OUT = 0x40000000; // Comparator 2 output
static constexpr uint32_t COMP3_CSR_RESET_VALUE = 0x0; // Reset value
static constexpr uint32_t COMP3_CSR_COMP3EN = 0x1; // Comparator 3 enable
typedef bit_field_t<2, 0x3> COMP3_CSR_COMP3MODE; // Comparator 3 mode
typedef bit_field_t<4, 0x7> COMP3_CSR_COMP3INSEL; // Comparator 3 inverting input selection
static constexpr uint32_t COMP3_CSR_COMP3INPSEL = 0x80; // Comparator 3 non inverted input selection
typedef bit_field_t<10, 0xf> COMP3_CSR_COMP3_OUT_SEL; // Comparator 3 output selection
static constexpr uint32_t COMP3_CSR_COMP3POL = 0x8000; // Comparator 3 output polarity
typedef bit_field_t<16, 0x3> COMP3_CSR_COMP3HYST; // Comparator 3 hysteresis
typedef bit_field_t<18, 0x7> COMP3_CSR_COMP3_BLANKING; // Comparator 3 blanking source
static constexpr uint32_t COMP3_CSR_COMP3OUT = 0x40000000; // Comparator 3 output
static constexpr uint32_t COMP3_CSR_COMP3LOCK = 0x80000000; // Comparator 3 lock
static constexpr uint32_t COMP4_CSR_RESET_VALUE = 0x0; // Reset value
static constexpr uint32_t COMP4_CSR_COMP4EN = 0x1; // Comparator 4 enable
typedef bit_field_t<2, 0x3> COMP4_CSR_COMP4MODE; // Comparator 4 mode
typedef bit_field_t<4, 0x7> COMP4_CSR_COMP4INSEL; // Comparator 4 inverting input selection
static constexpr uint32_t COMP4_CSR_COMP4INPSEL = 0x80; // Comparator 4 non inverted input selection
static constexpr uint32_t COMP4_CSR_COM4WINMODE = 0x200; // Comparator 4 window mode
typedef bit_field_t<10, 0xf> COMP4_CSR_COMP4_OUT_SEL; // Comparator 4 output selection
static constexpr uint32_t COMP4_CSR_COMP4POL = 0x8000; // Comparator 4 output polarity
typedef bit_field_t<16, 0x3> COMP4_CSR_COMP4HYST; // Comparator 4 hysteresis
typedef bit_field_t<18, 0x7> COMP4_CSR_COMP4_BLANKING; // Comparator 4 blanking source
static constexpr uint32_t COMP4_CSR_COMP4OUT = 0x40000000; // Comparator 4 output
static constexpr uint32_t COMP4_CSR_COMP4LOCK = 0x80000000; // Comparator 4 lock
static constexpr uint32_t COMP5_CSR_RESET_VALUE = 0x0; // Reset value
static constexpr uint32_t COMP5_CSR_COMP5EN = 0x1; // Comparator 5 enable
typedef bit_field_t<2, 0x3> COMP5_CSR_COMP5MODE; // Comparator 5 mode
typedef bit_field_t<4, 0x7> COMP5_CSR_COMP5INSEL; // Comparator 5 inverting input selection
static constexpr uint32_t COMP5_CSR_COMP5INPSEL = 0x80; // Comparator 5 non inverted input selection
typedef bit_field_t<10, 0xf> COMP5_CSR_COMP5_OUT_SEL; // Comparator 5 output selection
static constexpr uint32_t COMP5_CSR_COMP5POL = 0x8000; // Comparator 5 output polarity
typedef bit_field_t<16, 0x3> COMP5_CSR_COMP5HYST; // Comparator 5 hysteresis
typedef bit_field_t<18, 0x7> COMP5_CSR_COMP5_BLANKING; // Comparator 5 blanking source
static constexpr uint32_t COMP5_CSR_COMP5OUT = 0x40000000; // Comparator51 output
static constexpr uint32_t COMP5_CSR_COMP5LOCK = 0x80000000; // Comparator 5 lock
static constexpr uint32_t COMP6_CSR_RESET_VALUE = 0x0; // Reset value
static constexpr uint32_t COMP6_CSR_COMP6EN = 0x1; // Comparator 6 enable
typedef bit_field_t<2, 0x3> COMP6_CSR_COMP6MODE; // Comparator 6 mode
typedef bit_field_t<4, 0x7> COMP6_CSR_COMP6INSEL; // Comparator 6 inverting input selection
static constexpr uint32_t COMP6_CSR_COMP6INPSEL = 0x80; // Comparator 6 non inverted input selection
static constexpr uint32_t COMP6_CSR_COM6WINMODE = 0x200; // Comparator 6 window mode
typedef bit_field_t<10, 0xf> COMP6_CSR_COMP6_OUT_SEL; // Comparator 6 output selection
static constexpr uint32_t COMP6_CSR_COMP6POL = 0x8000; // Comparator 6 output polarity
typedef bit_field_t<16, 0x3> COMP6_CSR_COMP6HYST; // Comparator 6 hysteresis
typedef bit_field_t<18, 0x7> COMP6_CSR_COMP6_BLANKING; // Comparator 6 blanking source
static constexpr uint32_t COMP6_CSR_COMP6OUT = 0x40000000; // Comparator 6 output
static constexpr uint32_t COMP6_CSR_COMP6LOCK = 0x80000000; // Comparator 6 lock
static constexpr uint32_t COMP7_CSR_RESET_VALUE = 0x0; // Reset value
static constexpr uint32_t COMP7_CSR_COMP7EN = 0x1; // Comparator 7 enable
typedef bit_field_t<2, 0x3> COMP7_CSR_COMP7MODE; // Comparator 7 mode
typedef bit_field_t<4, 0x7> COMP7_CSR_COMP7INSEL; // Comparator 7 inverting input selection
static constexpr uint32_t COMP7_CSR_COMP7INPSEL = 0x80; // Comparator 7 non inverted input selection
typedef bit_field_t<10, 0xf> COMP7_CSR_COMP7_OUT_SEL; // Comparator 7 output selection
static constexpr uint32_t COMP7_CSR_COMP7POL = 0x8000; // Comparator 7 output polarity
typedef bit_field_t<16, 0x3> COMP7_CSR_COMP7HYST; // Comparator 7 hysteresis
typedef bit_field_t<18, 0x7> COMP7_CSR_COMP7_BLANKING; // Comparator 7 blanking source
static constexpr uint32_t COMP7_CSR_COMP7OUT = 0x40000000; // Comparator 7 output
static constexpr uint32_t COMP7_CSR_COMP7LOCK = 0x80000000; // Comparator 7 lock
static constexpr uint32_t OPAMP1_CSR_RESET_VALUE = 0x0; // Reset value
static constexpr uint32_t OPAMP1_CSR_OPAMP1_EN = 0x1; // OPAMP1 enable
static constexpr uint32_t OPAMP1_CSR_FORCE_VP = 0x2; // FORCE_VP
typedef bit_field_t<2, 0x3> OPAMP1_CSR_VP_SEL; // OPAMP1 Non inverting input selection
typedef bit_field_t<5, 0x3> OPAMP1_CSR_VM_SEL; // OPAMP1 inverting input selection
static constexpr uint32_t OPAMP1_CSR_TCM_EN = 0x80; // Timer controlled Mux mode enable
static constexpr uint32_t OPAMP1_CSR_VMS_SEL = 0x100; // OPAMP1 inverting input secondary selection
typedef bit_field_t<9, 0x3> OPAMP1_CSR_VPS_SEL; // OPAMP1 Non inverting input secondary selection
static constexpr uint32_t OPAMP1_CSR_CALON = 0x800; // Calibration mode enable
typedef bit_field_t<12, 0x3> OPAMP1_CSR_CALSEL; // Calibration selection
typedef bit_field_t<14, 0xf> OPAMP1_CSR_PGA_GAIN; // Gain in PGA mode
static constexpr uint32_t OPAMP1_CSR_USER_TRIM = 0x40000; // User trimming enable
typedef bit_field_t<19, 0x1f> OPAMP1_CSR_TRIMOFFSETP; // Offset trimming value (PMOS)
typedef bit_field_t<24, 0x1f> OPAMP1_CSR_TRIMOFFSETN; // Offset trimming value (NMOS)
static constexpr uint32_t OPAMP1_CSR_TSTREF = 0x20000000; // TSTREF
static constexpr uint32_t OPAMP1_CSR_OUTCAL = 0x40000000; // OPAMP 1 ouput status flag
static constexpr uint32_t OPAMP1_CSR_LOCK = 0x80000000; // OPAMP 1 lock
static constexpr uint32_t OPAMP2_CSR_RESET_VALUE = 0x0; // Reset value
static constexpr uint32_t OPAMP2_CSR_OPAMP2EN = 0x1; // OPAMP2 enable
static constexpr uint32_t OPAMP2_CSR_FORCE_VP = 0x2; // FORCE_VP
typedef bit_field_t<2, 0x3> OPAMP2_CSR_VP_SEL; // OPAMP2 Non inverting input selection
typedef bit_field_t<5, 0x3> OPAMP2_CSR_VM_SEL; // OPAMP2 inverting input selection
static constexpr uint32_t OPAMP2_CSR_TCM_EN = 0x80; // Timer controlled Mux mode enable
static constexpr uint32_t OPAMP2_CSR_VMS_SEL = 0x100; // OPAMP2 inverting input secondary selection
typedef bit_field_t<9, 0x3> OPAMP2_CSR_VPS_SEL; // OPAMP2 Non inverting input secondary selection
static constexpr uint32_t OPAMP2_CSR_CALON = 0x800; // Calibration mode enable
typedef bit_field_t<12, 0x3> OPAMP2_CSR_CALSEL; // Calibration selection
typedef bit_field_t<14, 0xf> OPAMP2_CSR_PGA_GAIN; // Gain in PGA mode
static constexpr uint32_t OPAMP2_CSR_USER_TRIM = 0x40000; // User trimming enable
typedef bit_field_t<19, 0x1f> OPAMP2_CSR_TRIMOFFSETP; // Offset trimming value (PMOS)
typedef bit_field_t<24, 0x1f> OPAMP2_CSR_TRIMOFFSETN; // Offset trimming value (NMOS)
static constexpr uint32_t OPAMP2_CSR_TSTREF = 0x20000000; // TSTREF
static constexpr uint32_t OPAMP2_CSR_OUTCAL = 0x40000000; // OPAMP 2 ouput status flag
static constexpr uint32_t OPAMP2_CSR_LOCK = 0x80000000; // OPAMP 2 lock
static constexpr uint32_t OPAMP3_CSR_RESET_VALUE = 0x0; // Reset value
static constexpr uint32_t OPAMP3_CSR_OPAMP3EN = 0x1; // OPAMP3 enable
static constexpr uint32_t OPAMP3_CSR_FORCE_VP = 0x2; // FORCE_VP
typedef bit_field_t<2, 0x3> OPAMP3_CSR_VP_SEL; // OPAMP3 Non inverting input selection
typedef bit_field_t<5, 0x3> OPAMP3_CSR_VM_SEL; // OPAMP3 inverting input selection
static constexpr uint32_t OPAMP3_CSR_TCM_EN = 0x80; // Timer controlled Mux mode enable
static constexpr uint32_t OPAMP3_CSR_VMS_SEL = 0x100; // OPAMP3 inverting input secondary selection
typedef bit_field_t<9, 0x3> OPAMP3_CSR_VPS_SEL; // OPAMP3 Non inverting input secondary selection
static constexpr uint32_t OPAMP3_CSR_CALON = 0x800; // Calibration mode enable
typedef bit_field_t<12, 0x3> OPAMP3_CSR_CALSEL; // Calibration selection
typedef bit_field_t<14, 0xf> OPAMP3_CSR_PGA_GAIN; // Gain in PGA mode
static constexpr uint32_t OPAMP3_CSR_USER_TRIM = 0x40000; // User trimming enable
typedef bit_field_t<19, 0x1f> OPAMP3_CSR_TRIMOFFSETP; // Offset trimming value (PMOS)
typedef bit_field_t<24, 0x1f> OPAMP3_CSR_TRIMOFFSETN; // Offset trimming value (NMOS)
static constexpr uint32_t OPAMP3_CSR_TSTREF = 0x20000000; // TSTREF
static constexpr uint32_t OPAMP3_CSR_OUTCAL = 0x40000000; // OPAMP 3 ouput status flag
static constexpr uint32_t OPAMP3_CSR_LOCK = 0x80000000; // OPAMP 3 lock
static constexpr uint32_t OPAMP4_CSR_RESET_VALUE = 0x0; // Reset value
static constexpr uint32_t OPAMP4_CSR_OPAMP4EN = 0x1; // OPAMP4 enable
static constexpr uint32_t OPAMP4_CSR_FORCE_VP = 0x2; // FORCE_VP
typedef bit_field_t<2, 0x3> OPAMP4_CSR_VP_SEL; // OPAMP4 Non inverting input selection
typedef bit_field_t<5, 0x3> OPAMP4_CSR_VM_SEL; // OPAMP4 inverting input selection
static constexpr uint32_t OPAMP4_CSR_TCM_EN = 0x80; // Timer controlled Mux mode enable
static constexpr uint32_t OPAMP4_CSR_VMS_SEL = 0x100; // OPAMP4 inverting input secondary selection
typedef bit_field_t<9, 0x3> OPAMP4_CSR_VPS_SEL; // OPAMP4 Non inverting input secondary selection
static constexpr uint32_t OPAMP4_CSR_CALON = 0x800; // Calibration mode enable
typedef bit_field_t<12, 0x3> OPAMP4_CSR_CALSEL; // Calibration selection
typedef bit_field_t<14, 0xf> OPAMP4_CSR_PGA_GAIN; // Gain in PGA mode
static constexpr uint32_t OPAMP4_CSR_USER_TRIM = 0x40000; // User trimming enable
typedef bit_field_t<19, 0x1f> OPAMP4_CSR_TRIMOFFSETP; // Offset trimming value (PMOS)
typedef bit_field_t<24, 0x1f> OPAMP4_CSR_TRIMOFFSETN; // Offset trimming value (NMOS)
static constexpr uint32_t OPAMP4_CSR_TSTREF = 0x20000000; // TSTREF
static constexpr uint32_t OPAMP4_CSR_OUTCAL = 0x40000000; // OPAMP 4 ouput status flag
static constexpr uint32_t OPAMP4_CSR_LOCK = 0x80000000; // OPAMP 4 lock
static constexpr uint32_t CFGR4_RESET_VALUE = 0x0; // Reset value
static constexpr uint32_t CFGR4_ADC12_EXT2_RMP = 0x1; // Controls the Input trigger of ADC12 regular channel EXT2
static constexpr uint32_t CFGR4_ADC12_EXT3_RMP = 0x2; // Controls the Input trigger of ADC12 regular channel EXT3
static constexpr uint32_t CFGR4_ADC12_EXT5_RMP = 0x4; // Controls the Input trigger of ADC12 regular channel EXT5
static constexpr uint32_t CFGR4_ADC12_EXT13_RMP = 0x8; // Controls the Input trigger of ADC12 regular channel EXT13
static constexpr uint32_t CFGR4_ADC12_EXT15_RMP = 0x10; // Controls the Input trigger of ADC12 regular channel EXT15
static constexpr uint32_t CFGR4_ADC12_JEXT3_RMP = 0x20; // Controls the Input trigger of ADC12 injected channel EXTI3
static constexpr uint32_t CFGR4_ADC12_JEXT6_RMP = 0x40; // Controls the Input trigger of ADC12 injected channel EXTI6
static constexpr uint32_t CFGR4_ADC12_JEXT13_RMP = 0x80; // Controls the Input trigger of ADC12 injected channel EXTI13
static constexpr uint32_t CFGR4_ADC34_EXT5_RMP = 0x100; // Controls the Input trigger of ADC34 regular channel EXT5
static constexpr uint32_t CFGR4_ADC34_EXT6_RMP = 0x200; // Controls the Input trigger of ADC34 regular channel EXT6
static constexpr uint32_t CFGR4_ADC34_EXT15_RMP = 0x400; // Controls the Input trigger of ADC34 regular channel EXT15
static constexpr uint32_t CFGR4_ADC34_JEXT5_RMP = 0x800; // Controls the Input trigger of ADC34 injected channel JEXT5
static constexpr uint32_t CFGR4_ADC34_JEXT11_RMP = 0x1000; // Controls the Input trigger of ADC34 injected channel JEXT11
static constexpr uint32_t CFGR4_ADC34_JEXT14_RMP = 0x2000; // Controls the Input trigger of ADC34 injected channel JEXT14
static constexpr uint32_t CFGR3_RESET_VALUE = 0x0; // Reset value
typedef bit_field_t<0, 0x3> CFGR3_SPI1_RX_DMA_RMP; // SPI1_RX DMA remapping bit
typedef bit_field_t<2, 0x3> CFGR3_SPI1_TX_DMA_RMP; // SPI1_TX DMA remapping bit
typedef bit_field_t<4, 0x3> CFGR3_I2C1_RX_DMA_RMP; // I2C1_RX DMA remapping bit
typedef bit_field_t<6, 0x3> CFGR3_I2C1_TX_DMA_RMP; // I2C1_TX DMA remapping bit
typedef bit_field_t<8, 0x3> CFGR3_ADC2_DMA_RMP; // ADC2 DMA channel remapping bit
};
// SYSCFG: System configuration controller
struct stm32f3x4_syscfg_t
{
volatile uint32_t CFGR1; // configuration register 1
volatile uint32_t RCR; // CCM SRAM protection register
volatile uint32_t EXTICR1; // external interrupt configuration register 1
volatile uint32_t EXTICR2; // external interrupt configuration register 2
volatile uint32_t EXTICR3; // external interrupt configuration register 3
volatile uint32_t EXTICR4; // external interrupt configuration register 4
volatile uint32_t CFGR2; // configuration register 2
reserved_t<0x1> _0x1c;
volatile uint32_t COMP2_CSR; // control and status register
reserved_t<0x1> _0x24;
volatile uint32_t COMP4_CSR; // control and status register
reserved_t<0x1> _0x2c;
volatile uint32_t COMP6_CSR; // control and status register
reserved_t<0x2> _0x34;
volatile uint32_t OPAMP2_CSR; // OPAMP2 control register
reserved_t<0x4> _0x40;
volatile uint32_t CFGR3; // configuration register 3
static constexpr uint32_t CFGR1_RESET_VALUE = 0x0; // Reset value
typedef bit_field_t<0, 0x3> CFGR1_MEM_MODE; // Memory mapping selection bits
static constexpr uint32_t CFGR1_USB_IT_RMP = 0x20; // USB interrupt remap
static constexpr uint32_t CFGR1_TIM1_ITR_RMP = 0x40; // Timer 1 ITR3 selection
static constexpr uint32_t CFGR1_DAC_TRIG_RMP = 0x80; // DAC trigger remap (when TSEL = 001)
static constexpr uint32_t CFGR1_ADC24_DMA_RMP = 0x100; // ADC24 DMA remapping bit
static constexpr uint32_t CFGR1_TIM16_DMA_RMP = 0x800; // TIM16 DMA request remapping bit
static constexpr uint32_t CFGR1_TIM17_DMA_RMP = 0x1000; // TIM17 DMA request remapping bit
static constexpr uint32_t CFGR1_TIM6_DAC1_DMA_RMP = 0x2000; // TIM6 and DAC1 DMA request remapping bit
static constexpr uint32_t CFGR1_TIM7_DAC2_DMA_RMP = 0x4000; // TIM7 and DAC2 DMA request remapping bit
static constexpr uint32_t CFGR1_I2C_PB6_FM = 0x10000; // Fast Mode Plus (FM+) driving capability activation bits.
static constexpr uint32_t CFGR1_I2C_PB7_FM = 0x20000; // Fast Mode Plus (FM+) driving capability activation bits.
static constexpr uint32_t CFGR1_I2C_PB8_FM = 0x40000; // Fast Mode Plus (FM+) driving capability activation bits.
static constexpr uint32_t CFGR1_I2C_PB9_FM = 0x80000; // Fast Mode Plus (FM+) driving capability activation bits.
static constexpr uint32_t CFGR1_I2C1_FM = 0x100000; // I2C1 Fast Mode Plus
static constexpr uint32_t CFGR1_I2C2_FM = 0x200000; // I2C2 Fast Mode Plus
typedef bit_field_t<22, 0x3> CFGR1_ENCODER_MODE; // Encoder mode
typedef bit_field_t<26, 0x3f> CFGR1_FPU_IT; // Interrupt enable bits from FPU
static constexpr uint32_t RCR_RESET_VALUE = 0x0; // Reset value
static constexpr uint32_t RCR_PAGE0_WP = 0x1; // CCM SRAM page write protection bit
static constexpr uint32_t RCR_PAGE1_WP = 0x2; // CCM SRAM page write protection bit
static constexpr uint32_t RCR_PAGE2_WP = 0x4; // CCM SRAM page write protection bit
static constexpr uint32_t RCR_PAGE3_WP = 0x8; // CCM SRAM page write protection bit
static constexpr uint32_t RCR_PAGE4_WP = 0x10; // CCM SRAM page write protection bit
static constexpr uint32_t RCR_PAGE5_WP = 0x20; // CCM SRAM page write protection bit
static constexpr uint32_t RCR_PAGE6_WP = 0x40; // CCM SRAM page write protection bit
static constexpr uint32_t RCR_PAGE7_WP = 0x80; // CCM SRAM page write protection bit
static constexpr uint32_t EXTICR1_RESET_VALUE = 0x0; // Reset value
typedef bit_field_t<12, 0xf> EXTICR1_EXTI3; // EXTI 3 configuration bits
typedef bit_field_t<8, 0xf> EXTICR1_EXTI2; // EXTI 2 configuration bits
typedef bit_field_t<4, 0xf> EXTICR1_EXTI1; // EXTI 1 configuration bits
typedef bit_field_t<0, 0xf> EXTICR1_EXTI0; // EXTI 0 configuration bits
static constexpr uint32_t EXTICR2_RESET_VALUE = 0x0; // Reset value
typedef bit_field_t<12, 0xf> EXTICR2_EXTI7; // EXTI 7 configuration bits
typedef bit_field_t<8, 0xf> EXTICR2_EXTI6; // EXTI 6 configuration bits
typedef bit_field_t<4, 0xf> EXTICR2_EXTI5; // EXTI 5 configuration bits
typedef bit_field_t<0, 0xf> EXTICR2_EXTI4; // EXTI 4 configuration bits
static constexpr uint32_t EXTICR3_RESET_VALUE = 0x0; // Reset value
typedef bit_field_t<12, 0xf> EXTICR3_EXTI11; // EXTI 11 configuration bits
typedef bit_field_t<8, 0xf> EXTICR3_EXTI10; // EXTI 10 configuration bits
typedef bit_field_t<4, 0xf> EXTICR3_EXTI9; // EXTI 9 configuration bits
typedef bit_field_t<0, 0xf> EXTICR3_EXTI8; // EXTI 8 configuration bits
static constexpr uint32_t EXTICR4_RESET_VALUE = 0x0; // Reset value
typedef bit_field_t<12, 0xf> EXTICR4_EXTI15; // EXTI 15 configuration bits
typedef bit_field_t<8, 0xf> EXTICR4_EXTI14; // EXTI 14 configuration bits
typedef bit_field_t<4, 0xf> EXTICR4_EXTI13; // EXTI 13 configuration bits
typedef bit_field_t<0, 0xf> EXTICR4_EXTI12; // EXTI 12 configuration bits
static constexpr uint32_t CFGR2_RESET_VALUE = 0x0; // Reset value
static constexpr uint32_t CFGR2_LOCUP_LOCK = 0x1; // Cortex-M0 LOCKUP bit enable bit
static constexpr uint32_t CFGR2_SRAM_PARITY_LOCK = 0x2; // SRAM parity lock bit
static constexpr uint32_t CFGR2_PVD_LOCK = 0x4; // PVD lock enable bit
static constexpr uint32_t CFGR2_BYP_ADD_PAR = 0x10; // Bypass address bit 29 in parity calculation
static constexpr uint32_t CFGR2_SRAM_PEF = 0x100; // SRAM parity flag
static constexpr uint32_t COMP2_CSR_RESET_VALUE = 0x0; // Reset value
static constexpr uint32_t COMP2_CSR_COMP2EN = 0x1; // Comparator 2 enable
typedef bit_field_t<4, 0x7> COMP2_CSR_COMP2INMSEL; // Comparator 2 inverting input selection
typedef bit_field_t<10, 0xf> COMP2_CSR_COMP2OUTSEL; // Comparator 2 output selection
static constexpr uint32_t COMP2_CSR_COMP2POL = 0x8000; // Comparator 2 output polarity
typedef bit_field_t<18, 0x7> COMP2_CSR_COMP2_BLANKING; // Comparator 2 blanking source
static constexpr uint32_t COMP2_CSR_COMP2INMSEL3 = 0x400000; // Comparator 2 inverting input selection. It is used with Bits [6..4] to configure the Comp inverting input
static constexpr uint32_t COMP2_CSR_COMP2OUT = 0x40000000; // Comparator 2 output
static constexpr uint32_t COMP2_CSR_COMP2LOCK = 0x80000000; // Comparator 2 lock
static constexpr uint32_t COMP4_CSR_RESET_VALUE = 0x0; // Reset value
static constexpr uint32_t COMP4_CSR_COMP4EN = 0x1; // Comparator 4 enable
typedef bit_field_t<4, 0x7> COMP4_CSR_COMP4INMSEL; // Comparator 4 inverting input selection
typedef bit_field_t<10, 0xf> COMP4_CSR_COMP4OUTSEL; // Comparator 4 output selection
static constexpr uint32_t COMP4_CSR_COMP4POL = 0x8000; // Comparator 4 output polarity
typedef bit_field_t<18, 0x7> COMP4_CSR_COMP4_BLANKING; // Comparator 4 blanking source
static constexpr uint32_t COMP4_CSR_COMP4INMSEL3 = 0x400000; // Comparator 4 inverting input selection. It is used with Bits [6..4] to configure the Comp inverting input
static constexpr uint32_t COMP4_CSR_COMP4OUT = 0x40000000; // Comparator 4 output
static constexpr uint32_t COMP4_CSR_COMP4LOCK = 0x80000000; // Comparator 4 lock
static constexpr uint32_t COMP6_CSR_RESET_VALUE = 0x0; // Reset value
static constexpr uint32_t COMP6_CSR_COMP6EN = 0x1; // Comparator 6 enable
typedef bit_field_t<4, 0x7> COMP6_CSR_COMP6INMSEL; // Comparator 6 inverting input selection
typedef bit_field_t<10, 0xf> COMP6_CSR_COMP6OUTSEL; // Comparator 6 output selection
static constexpr uint32_t COMP6_CSR_COMP6POL = 0x8000; // Comparator 6 output polarity
typedef bit_field_t<18, 0x7> COMP6_CSR_COMP6_BLANKING; // Comparator 6 blanking source
static constexpr uint32_t COMP6_CSR_COMP6INMSEL3 = 0x400000; // Comparator 6 inverting input selection. It is used with Bits [6..4] to configure the Comp inverting input
static constexpr uint32_t COMP6_CSR_COMP6OUT = 0x40000000; // Comparator 6 output
static constexpr uint32_t COMP6_CSR_COMP6LOCK = 0x80000000; // Comparator 6 lock
static constexpr uint32_t OPAMP2_CSR_RESET_VALUE = 0x0; // Reset value
static constexpr uint32_t OPAMP2_CSR_OPAMP2EN = 0x1; // OPAMP2 enable
static constexpr uint32_t OPAMP2_CSR_FORCE_VP = 0x2; // FORCE_VP
typedef bit_field_t<2, 0x3> OPAMP2_CSR_VP_SEL; // OPAMP2 Non inverting input selection
typedef bit_field_t<5, 0x3> OPAMP2_CSR_VM_SEL; // OPAMP2 inverting input selection
static constexpr uint32_t OPAMP2_CSR_TCM_EN = 0x80; // Timer controlled Mux mode enable
static constexpr uint32_t OPAMP2_CSR_VMS_SEL = 0x100; // OPAMP2 inverting input secondary selection
typedef bit_field_t<9, 0x3> OPAMP2_CSR_VPS_SEL; // OPAMP2 Non inverting input secondary selection
static constexpr uint32_t OPAMP2_CSR_CALON = 0x800; // Calibration mode enable
typedef bit_field_t<12, 0x3> OPAMP2_CSR_CAL_SEL; // Calibration selection
typedef bit_field_t<14, 0xf> OPAMP2_CSR_PGA_GAIN; // Gain in PGA mode
static constexpr uint32_t OPAMP2_CSR_USER_TRIM = 0x40000; // User trimming enable
typedef bit_field_t<19, 0x1f> OPAMP2_CSR_TRIMOFFSETP; // Offset trimming value (PMOS)
typedef bit_field_t<24, 0x1f> OPAMP2_CSR_TRIMOFFSETN; // Offset trimming value (NMOS)
static constexpr uint32_t OPAMP2_CSR_TSTREF = 0x20000000; // TSTREF
static constexpr uint32_t OPAMP2_CSR_OUTCAL = 0x40000000; // OPAMP 2 ouput status flag
static constexpr uint32_t OPAMP2_CSR_LOCK = 0x80000000; // OPAMP 2 lock
static constexpr uint32_t CFGR3_RESET_VALUE = 0x0; // Reset value
static constexpr uint32_t CFGR3_DAC1_TRIG5_RMP = 0x20000; // DAC1_CH1 / DAC1_CH2 Trigger remap
static constexpr uint32_t CFGR3_DAC1_TRIG3_RMP = 0x10000; // DAC1_CH1 / DAC1_CH2 Trigger remap
static constexpr uint32_t CFGR3_ADC2_DMA_RMP_1 = 0x200; // ADC2 DMA controller remapping bit
typedef bit_field_t<6, 0x3> CFGR3_ADC2_DMA_RMP_0; // ADC2 DMA channel remapping bit
typedef bit_field_t<4, 0x3> CFGR3_I2C1_RX_DMA_RMP; // I2C1_RX DMA remapping bit
typedef bit_field_t<2, 0x3> CFGR3_SPI1_TX_DMA_RMP; // SPI1_TX DMA remapping bit
typedef bit_field_t<0, 0x3> CFGR3_SPI1_RX_DMA_RMP; // SPI1_RX DMA remapping bit
};
template<>
struct peripheral_t<STM32F301, SYSCFG>
{
static constexpr periph_t P = SYSCFG;
using T = stm32f301_syscfg_t;
static T& V;
};
template<>
struct peripheral_t<STM32F302, SYSCFG>
{
static constexpr periph_t P = SYSCFG;
using T = stm32f301_syscfg_t;
static T& V;
};
template<>
struct peripheral_t<STM32F373, SYSCFG>
{
static constexpr periph_t P = SYSCFG;
using T = stm32f301_syscfg_t;
static T& V;
};
template<>
struct peripheral_t<STM32F3x8, SYSCFG>
{
static constexpr periph_t P = SYSCFG;
using T = stm32f301_syscfg_t;
static T& V;
};
template<>
struct peripheral_t<STM32F303, SYSCFG>
{
static constexpr periph_t P = SYSCFG;
using T = stm32f303_syscfg_t;
static T& V;
};
template<>
struct peripheral_t<STM32F3x4, SYSCFG>
{
static constexpr periph_t P = SYSCFG;
using T = stm32f3x4_syscfg_t;
static T& V;
};
using syscfg_t = peripheral_t<svd, SYSCFG>;
template<int INST> struct syscfg_traits {};
template<> struct syscfg_traits<0>
{
using syscfg = syscfg_t;
static constexpr clock_source_t CLOCK = APB2_PERIPH;
template<typename RCC>
static void enable()
{
RCC::V.APB2ENR |= RCC::T::APB2ENR_SYSCFGEN;
}
template<typename RCC>
static void disable()
{
RCC::V.APB2ENR &= ~RCC::T::APB2ENR_SYSCFGEN;
}
template<typename RCC>
static void reset()
{
RCC::V.APB2RSTR |= RCC::T::APB2RSTR_SYSCFGRST;
}
};
|
pascaldanek/scala-bootstrap | src/main/scala/myproject/api/functions/GetGroupChildren.scala | package myproject.api.functions
import myproject.api.Serializers._
import myproject.api.{ApiFunction, ApiSummaryDoc}
import myproject.common.serialization.OpaqueData
import myproject.common.serialization.OpaqueData.ReifiedDataWrapper.required
import myproject.database.ApplicationDatabase
import myproject.iam.Groups.{CRUD, GroupAccessChecker}
import myproject.iam.Users
import myproject.iam.Users.User
class GetGroupChildren(implicit authz: User => GroupAccessChecker, db: ApplicationDatabase) extends ApiFunction {
override val name = "get_group_children"
override val doc = ApiSummaryDoc(
description = "get all the descendants of a group (this function is more dedicated to a parent group admin as for a channel or platform admin, the complete group hierarchy can be reconstructed from the group lists of a channel using the parent id property)",
`return` = "a list containing all the children groups")
override def process(implicit p: OpaqueData.ReifiedDataWrapper, user: Users.User) = {
val groupId = required(p.uuid("group_id"))
implicit val checker = authz(user)
checkParamAndProcess(groupId) {
CRUD.getGroupChildren(groupId.get) map (_.serialize)
}
}
}
|
eonum/swiss-hospital-statistics | app/assets/javascripts/app.js | <gh_stars>1-10
define([
'views/widgets/TopBar',
'views/widgets/Tabulator',
'views/widgets/TabulatorButton',
'models/TabulatorModel',
'views/widgets/icd/IcdCodePane',
'views/widgets/icd-years/IcdYearsPane',
'views/widgets/chop/ChopCodePane',
'views/widgets/drg/DrgCodePane',
'views/widgets/top3/Top3DiagnosesPane'
], function(
TopBar,
Tabulator,
TabulatorButton,
TabulatorModel,
IcdCodePane,
IcdYearsPane,
ChopCodePane,
DrgCodePane,
Top3DiagnosesPane
){
"use strict";
function App() {
var _this = this;
_this.initialize = function(){
// we use topbar to have tab buttons there
var topBar = new TopBar().title('Eonum');
var languageTabulator = new TabulatorModel();
var languageModels = _.map(Multiglot.languages, function(language){
var tab = languageTabulator.addTab(language.name).onSelected(function(){ Multiglot.setLanguage(language.code) });
if (Multiglot.language === language.code) tab.select();
return tab;
});
topBar.addRightAll(_.map(languageModels,
function(tab){return new TabulatorButton().class('language').model(tab)}));
// first we define tabulator model and script 3 tabs. select first one by default
var tabulatorModel = new TabulatorModel();
var tabIcd = tabulatorModel.addTab(Multiglot.translations.tab_icd).render(function(){return new IcdCodePane().load()}).select();
var tabYearIcd = tabulatorModel.addTab(Multiglot.translations.tab_icd_per_year).render(function(){return new IcdYearsPane().load()});
var tabChop = tabulatorModel.addTab(Multiglot.translations.tab_chop).render(function(){return new ChopCodePane().load()});
var tabDrg = tabulatorModel.addTab(Multiglot.translations.tab_drg).render(function(){return new DrgCodePane().load()});
var tabTop3 = tabulatorModel.addTab(Multiglot.translations.tab_top_3).render(function(){return new Top3DiagnosesPane()});
// then create corresponding button views and attach tab models
topBar.addLeftAll(_.map([tabIcd,tabYearIcd,tabChop,tabDrg, tabTop3],
function(tab){return new TabulatorButton().model(tab)}));
// and finally add everything to the dom
$('body').append($('<header></header>')).find('header').append(topBar);
$('body').append(new Tabulator().styled(function(tab){tab.class('absolute')}).model(tabulatorModel));
};
_this.initialize();
}
return App
});
|
peppelinux/spid-cie-oidc-authority | spid_cie_oidc/entity/admin.py | <filename>spid_cie_oidc/entity/admin.py
import logging
from django.contrib import admin
from django.utils.safestring import mark_safe
from django.contrib import messages
# from prettyjson import PrettyJSONWidget
from django.conf import settings
from .jwtse import unpad_jwt_payload
from .statements import EntityConfiguration, get_entity_configurations, get_entity_statements
from .models import (
FederationEntityConfiguration,
FetchedEntityStatement,
TrustChain
)
from spid_cie_oidc.entity.trust_chain_operations import get_or_create_trust_chain
from . settings import HTTPC_PARAMS
logger = logging.getLogger(__name__)
@admin.register(FederationEntityConfiguration)
class FederationEntityConfigurationAdmin(admin.ModelAdmin):
# formfield_overrides = {
# JSONField: {
# "widget": PrettyJSONWidget(
# attrs={"initial": "parsed", "disabled": True}
# )
# }
# }
@admin.action(description='update trust marks')
def update_trust_marks(modeladmin, request, queryset): # pragma: no cover
"""
fetch trust marks from all the authorities
"""
trust_marks = {}
for obj in queryset:
jwts = get_entity_configurations(obj.authority_hints, HTTPC_PARAMS)
for jwt in jwts:
try:
ec = EntityConfiguration(jwt, httpc_params=HTTPC_PARAMS)
except Exception as e:
_msg = f"Failed getting Entity Configuration for {jwt}: {e}"
logger.warning(_msg)
messages.error(_msg)
continue
try:
# get superior fetch url
fetch_api_url = ec.payload["metadata"]["federation_entity"][
"federation_fetch_endpoint"
]
except KeyError:
_msg = (
"Missing federation_fetch_endpoint in "
f"federation_entity metadata for {obj.sub} by {ec.sub}."
)
logger.warning(_msg)
messages.error(_msg)
continue
_url = f"{fetch_api_url}?sub={obj.sub}"
try:
logger.info(f"Getting entity statements from {_url}")
_jwts = get_entity_statements([_url], HTTPC_PARAMS)
payload = unpad_jwt_payload(_jwts[0])
for i in payload.get("trust_marks", []):
trust_marks[i['id']] = i['trust_mark']
except Exception as e:
_msg = f"Error getting entity statements from {_url}: {e}"
logger.warning(_msg)
messages.error(_msg)
continue
positions = {}
count = 0
for i in obj.trust_marks:
positions[i['id']] = count
count += 1
if positions:
for k,v in trust_marks.items():
if positions.get(k, None):
obj.trust_marks[positions[k]] = {k:v}
else:
obj.trust_marks.append({k:v})
else:
obj.trust_marks = [
{"id":k, "trust_mark":v} for k,v in trust_marks.items()
]
obj.save()
messages.success(
request,
f"Trust mark reloaded succesfully: {', '.join(trust_marks.keys())}"
)
list_display = (
"sub",
"type",
"kids",
"is_active",
"created",
)
list_filter = ("created", "modified", "is_active")
# search_fields = ('command__name',)
readonly_fields = (
"created",
"modified",
"entity_configuration_as_json",
"pems_as_html",
"kids",
"type",
)
actions = [update_trust_marks]
def pems_as_html(self, obj):
res = ""
data = dict()
for k, v in obj.pems_as_dict.items():
data[k] = {}
for i in ("public", "private"):
data[k][i] = v[i].replace("\n", "<br>")
res += (
f"<b>{k}</b><br><br>"
f"{data[k]['public']}<br>"
f"{data[k]['private']}<br><hr>"
)
return mark_safe(res) # nosec
@admin.register(TrustChain)
class TrustChainAdmin(admin.ModelAdmin):
@admin.action(description='reload trust chain')
def update_trust_chain(modeladmin, request, queryset): # pragma: no cover
for tc in queryset:
sub = tc.sub
ta = tc.trust_anchor.sub
try :
get_or_create_trust_chain(
subject=sub,
trust_anchor=ta,
httpc_params=settings.HTTPC_PARAMS,
required_trust_marks=getattr(
settings, "OIDCFED_REQUIRED_TRUST_MARKS", [],
),
force=True
)
messages.success(
request, f"Trust chain successfully reloaded for {sub}"
)
except Exception as e:
messages.error(request, f"Failed to update {sub} due to: {e}")
continue
list_display = ("sub", "exp", "modified", "is_valid")
list_filter = ("exp", "modified", "is_active")
search_fields = ("sub",)
readonly_fields = (
"created",
"modified",
"parties_involved",
"metadata",
"status",
"log",
"chain",
"iat",
)
actions = [update_trust_chain]
@admin.register(FetchedEntityStatement)
class FetchedEntityStatementAdmin(admin.ModelAdmin):
list_display = ("sub", "iss", "exp", "iat", "created", "modified")
list_filter = ("created", "modified", "exp", "iat")
search_fields = ("sub", "iss")
readonly_fields = ("sub", "statement", "created", "modified", "iat", "exp", "iss")
|
Marcos-Correia/incubator-samoa | samoa-storm/src/test/java/org/apache/samoa/topology/impl/StormProcessingItemTest.java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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.apache.samoa.topology.impl;
import static org.junit.Assert.assertEquals;
import mockit.Expectations;
import mockit.MockUp;
import mockit.Mocked;
import mockit.Tested;
import mockit.Verifications;
import org.apache.samoa.core.Processor;
import org.apache.samoa.topology.impl.StormProcessingItem;
import org.apache.samoa.topology.impl.StormTopology;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import backtype.storm.topology.BoltDeclarer;
import backtype.storm.topology.IRichBolt;
import backtype.storm.topology.TopologyBuilder;
public class StormProcessingItemTest {
private static final int PARRALLELISM_HINT_2 = 2;
private static final int PARRALLELISM_HINT_4 = 4;
private static final String ID = "id";
@Tested
private StormProcessingItem pi;
@Mocked
private Processor processor;
@Mocked
private StormTopology topology;
@Mocked
private TopologyBuilder stormBuilder = new TopologyBuilder();
@Before
public void setUp() {
pi = new StormProcessingItem(processor, ID, PARRALLELISM_HINT_2);
}
@Test
public void testAddToTopology() {
new Expectations() {
{
topology.getStormBuilder();
result = stormBuilder;
stormBuilder.setBolt(ID, (IRichBolt) any, anyInt);
result = new MockUp<BoltDeclarer>() {
}.getMockInstance();
}
};
pi.addToTopology(topology, PARRALLELISM_HINT_4); // this parallelism hint is ignored
new Verifications() {
{
assertEquals(pi.getProcessor(), processor);
// TODO add methods to explore a topology and verify them
assertEquals(pi.getParallelism(), PARRALLELISM_HINT_2);
assertEquals(pi.getId(), ID);
}
};
}
}
|
acestudiooleg/vue-vuex-2.0-boilerplate | src/app/services/account/account.spec.js | <filename>src/app/services/account/account.spec.js
import test from 'ava';
import account from './index';
test('roro is pass or not', t => {
const actual = 2;
const expected = 2;
t.is(actual, expected);
});
|
CyanCherry/Travel-at-LeetCode | B_TopInterviewQuestions-MediumCollection/H_Math/F_DivideTwoIntegers.go | package main
import (
"fmt"
"math"
)
func abs(num int) int {
if num < 0 {
return -num
}
return num
}
func divide(dividend int, divisor int) int {
if divisor == 0 {
panic("divisor is 0")
}
if dividend == math.MinInt32 && divisor == -1 {
return math.MaxInt32
}
isPositive := (dividend < 0) == (divisor < 0)
divisor = abs(divisor)
dividend = abs(dividend)
bias := 0
for {
divisor <<= 1
if dividend < divisor {
divisor >>= 1
break
}
bias++
}
result := 0
for bias > -1 {
if dividend >= divisor {
result += 1 << bias
dividend -= divisor
}
divisor >>= 1
bias--
}
if !isPositive {
return -result
}
return result
}
func main() {
fmt.Println(3 == divide(10, 3))
fmt.Println(-2 == divide(7, -3))
fmt.Println(math.MinInt32+1 == divide(math.MaxInt32, -1))
fmt.Println(math.MaxInt32 == divide(math.MinInt32, -1))
fmt.Println(1 == divide(1, 1))
fmt.Println(math.MinInt32 == divide(math.MinInt32, 1))
fmt.Println(715827882 == divide(2147483647, 3))
}
|
gaeaplus/gaeaplus | src/gov/nasa/worldwind/layers/rpf/wizard/ETRCalculator.java | <gh_stars>10-100
/*
* Copyright (C) 2012 United States Government as represented by the Administrator of the
* National Aeronautics and Space Administration.
* All Rights Reserved.
*/
package gov.nasa.worldwind.layers.rpf.wizard;
/**
* @author dcollins
* @version $Id: ETRCalculator.java 1171 2013-02-11 21:45:02Z dcollins $
*/
public class ETRCalculator
{
private int step = -1;
private int numSteps = -1;
private int stepsNeededForEstimate = 1;
private long startTime = -1;
private long updateFrequency = 1000;
private long etr = -1;
private long nextUpdateTime = -1;
public ETRCalculator()
{}
public int getStep()
{
return this.step;
}
public void setStep(int step)
{
this.step = step < 0 ? -1 : step;
}
public int getNumSteps()
{
return this.numSteps;
}
public void setNumSteps(int numSteps)
{
this.numSteps = numSteps < 0 ? -1 : numSteps;
}
public double getStepsNeededForEstimate()
{
return this.stepsNeededForEstimate;
}
public void setStepsNeededForEstimate(int stepsNeededForEstimate)
{
this.stepsNeededForEstimate = stepsNeededForEstimate < 1 ? 1 : stepsNeededForEstimate;
}
public long getStartTime()
{
return this.startTime;
}
public void setStartTime(long timeMillis)
{
this.startTime = timeMillis;
this.nextUpdateTime = this.startTime + this.updateFrequency;
}
public long getUpdateFrequency()
{
return this.updateFrequency;
}
public void setUpdateFrequency(long updateFrequencyMillis)
{
this.updateFrequency = updateFrequencyMillis < 0 ? 0 : updateFrequencyMillis;
}
public long getEstimatedTimeRemaining()
{
if (this.step >= 0
&& this.step >= this.stepsNeededForEstimate
&& this.numSteps >= 0
&& this.startTime >= 0)
{
long time = System.currentTimeMillis();
if (this.nextUpdateTime < time)
{
this.nextUpdateTime = time + this.updateFrequency;
double elapsed = time - this.startTime;
double pctComplete = this.step / (double) (this.numSteps - 1);
this.etr = (long) (elapsed / pctComplete - elapsed);
}
}
else
{
this.etr = -1;
}
return this.etr < 0 ? -1 : this.etr;
}
}
|
DavidCoenFish/ancient-code-0 | gcommon/source/gmeshedgeonepoly.h | <filename>gcommon/source/gmeshedgeonepoly.h<gh_stars>0
//
// GMeshEdgeOnePoly.h
//
// Created by <NAME> on 2011 03 30
// Copyright 2010 Pleasure seeking morons. All rights reserved.
//
#ifndef _GMeshEdgeOnePoly_h_
#define _GMeshEdgeOnePoly_h_
#include <boost/noncopyable.hpp>
/*
the 'image' of data to cast memory as after loading from tools output file
*/
class GMeshEdgeOnePoly : public boost::noncopyable
{
//typedef
private:
//constructor
public:
GMeshEdgeOnePoly(
const int in_vertexIndexOne,
const int in_vertexIndexTwo,
const int in_normalIndex
);
~GMeshEdgeOnePoly();
//public accessors
public:
const int GetVertexIndexOne()const{ return mVertexIndexOne; }
const int GetVertexIndexTwo()const{ return mVertexIndexTwo; }
const int GetNormalIndex()const{ return mNormalIndex; }
//private members;
private:
const int mVertexIndexOne;
const int mVertexIndexTwo;
const int mNormalIndex;
};
#endif |
itthings/lv_sim_visual_studio | ITThings.lvgl/fonts/lv_font_roboto_bold_12.c | /*******************************************************************************
* Size: 12 px
* Bpp: 4
* Opts:
******************************************************************************/
#ifdef LV_LVGL_H_INCLUDE_SIMPLE
#include "lvgl.h"
#else
#include "lvgl/lvgl.h"
#endif
#ifndef LV_FONT_ROBOTO_BOLD_12
#define LV_FONT_ROBOTO_BOLD_12 1
#endif
#if LV_FONT_ROBOTO_BOLD_12
/*-----------------
* BITMAPS
*----------------*/
/*Store the image of the glyphs*/
static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = {
/* U+0020 " " */
/* U+0021 "!" */
0x3, 0x8e, 0xff, 0x74, 0x18, 0x4, 0x60, 0x3,
0x0, 0x87, 0xc0, 0x37, 0x88, 0x4, 0x20, 0x1,
0x0, 0x8c, 0x40, 0x30, 0x98, 0x4, 0xe0, 0x7,
0x0, 0x85, 0x3e, 0x65, 0xe8, 0x20, 0x2f, 0xd1,
0xf, 0x42, 0x0, 0x18, 0x80, 0x1c, 0x0,
/* U+0022 "\"" */
0x4a, 0xfe, 0x84, 0x6b, 0xfc, 0x72, 0x0, 0x8c,
0x1c, 0x2, 0x71, 0x30, 0x9, 0xb8, 0x40, 0x21,
0x31, 0x6f, 0x8e, 0x42, 0x5e, 0x8e, 0x70,
/* U+0023 "#" */
0x0, 0xf9, 0x6b, 0xed, 0x84, 0x4f, 0x9f, 0x48,
0x1, 0xff, 0x1e, 0xb9, 0x1a, 0x8a, 0x69, 0xa6,
0x28, 0x7, 0x8e, 0x37, 0xfd, 0x8e, 0x44, 0x7c,
0xfa, 0x50, 0x49, 0xee, 0x4a, 0x0, 0x47, 0x19,
0xd6, 0xc2, 0x4f, 0x7b, 0x28, 0x9, 0x1b, 0xdf,
0x8, 0x1, 0xc2, 0x31, 0xb, 0x6a, 0x7, 0x30,
0x92, 0x10, 0x8c, 0x1, 0x24, 0xf7, 0xfa, 0x90,
0x12, 0xbf, 0x5c, 0x85, 0xb3, 0xf1, 0xc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0xcb, 0x62, 0x2, 0x42, 0x22,
0xbb, 0xf2, 0x98, 0xa, 0xa1, 0x0, 0x62, 0x57,
0x88, 0xfa, 0x54, 0x40,
/* U+0033 "3" */
0x0, 0x8d, 0xab, 0x3b, 0xfe, 0xed, 0xca, 0x63,
0x0, 0xe4, 0x9d, 0x95, 0x22, 0x33, 0xb9, 0x4,
0xd6, 0x76, 0x4c, 0x0, 0x2f, 0xf3, 0x13, 0x5b,
0x31, 0xa, 0x86, 0x10, 0x15, 0x42, 0x1, 0x36,
0x77, 0x32, 0x1, 0x10, 0xd7, 0x50, 0x40, 0x55,
0x8, 0x3, 0xe6, 0xad, 0xd6, 0x53, 0x11, 0x1b,
0x64, 0xc0, 0x3f, 0x3c, 0x55, 0x52, 0xa4, 0x46,
0xda, 0x51, 0x2, 0x59, 0xaa, 0x42, 0x92, 0xac,
0xd7, 0x46, 0x2, 0x98, 0xa0, 0x60, 0x68, 0xaf,
0x5b, 0x31, 0x9, 0xd9, 0x30, 0x2, 0xe2, 0x80,
0xad, 0xec, 0x29, 0x11, 0xdf, 0x9, 0x2c, 0x5d,
0x28, 0x80,
/* U+0034 "4" */
0x0, 0xfe, 0x16, 0xbf, 0xfb, 0xa5, 0x0, 0x3f,
0xc2, 0xb7, 0x8, 0x1, 0xff, 0xc3, 0x38, 0x82,
0x88, 0x7, 0xff, 0x8, 0x9f, 0xd8, 0x96, 0x1c,
0xc0, 0x3f, 0xc2, 0xd3, 0x6, 0x68, 0x83, 0x78,
0x7, 0xf9, 0x22, 0x8, 0x2b, 0x2a, 0x5, 0xe0,
0x18, 0xc4, 0x84, 0x17, 0x98, 0x40, 0x56, 0xb7,
0x58, 0xe6, 0x0, 0x15, 0xac, 0x83, 0x49, 0xba,
0xaf, 0xa5, 0x88, 0x2, 0x47, 0xab, 0x21, 0x34,
0x55, 0xf9, 0xf8, 0x40, 0x2, 0x58, 0x84, 0x20,
/* U+0035 "5" */
0x0, 0x9a, 0xff, 0xff, 0xf8, 0x18, 0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 0x21, 0xb6,
0x10, 0x7, 0xc9, 0x70, 0x82, 0x25, 0xad, 0xd6,
0x4a, 0x88, 0x0, 0xf8, 0x40, 0x22, 0x6b, 0xee,
0x6e, 0x63, 0x72, 0x48, 0x0, 0x4a, 0x84, 0x1,
0xc2, 0x93, 0x73, 0x1f, 0x90, 0x62, 0xb1, 0x26,
0x1, 0xe2, 0xc6, 0x62, 0xa8, 0x51, 0xeb, 0x29,
0x44, 0x2,
/* U+003A ":" */
0x2, 0x6b, 0xee, 0x63, 0x90, 0x18, 0x6, 0x71,
0x0, 0xb, 0x5f, 0x72, 0xd8, 0x80, 0x3f, 0xf8,
0xe2, 0xb5, 0xdc, 0xb6, 0x20, 0x33, 0x8, 0xb,
0x88, 0x0,
/* U+003B ";" */
0x3, 0x7d, 0xfe, 0xa5, 0x10, 0x10, 0x11, 0x18,
0x6, 0x27, 0xce, 0xda, 0x51, 0x0, 0xff, 0xe4,
0x1b, 0x44, 0x18, 0xc0, 0x25, 0xd7, 0x76, 0xb0,
0x0, 0x85, 0x80, 0x49, 0x80, 0x96, 0xc8, 0xe6,
0xcc, 0x9, 0xf7, 0x67, 0x20, 0x0,
/* U+003C "<" */
0x0, 0xff, 0xeb, 0x12, 0x3c, 0xe4, 0xa8, 0x7,
0xc2, 0x6d, 0x17, 0xbf, 0xb7, 0xc, 0x60, 0x20,
0x19, 0x27, 0xb9, 0x92, 0xea, 0x2b, 0x15, 0x9d,
0xf2, 0x80, 0x18, 0x4c, 0x40, 0x22, 0x55, 0x69,
0x31, 0x8, 0x7, 0xcb, 0x5d, 0x94, 0xee, 0x67,
0x8a, 0xce, 0xfd, 0x84, 0x0, 0xf0, 0x9a, 0xc5,
0x6f, 0x6d, 0xcb, 0x20, 0x10, 0x80, 0x7f, 0xf0,
0x49, 0x1a, 0x6f, 0x69, 0x40,
/* U+003D "=" */
0x3, 0x8e, 0xff, 0xff, 0xe0, 0xda, 0x80, 0x45,
0x92, 0xef, 0xff, 0xc1, 0xe7, 0x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0x0, 0x3f, 0xff, 0xe0, 0x1f, 0xfc, 0x20,
/* U+0049 "I" */
0x2, 0x7c, 0xff, 0xa9, 0x0, 0x3f, 0xff, 0x80,
/* U+004A "J" */
0x0, 0xff, 0xe1, 0x13, 0xe7, 0xfd, 0x48, 0x1,
0xff, 0xff, 0x0, 0xff, 0xf3, 0x24, 0x66, 0x52,
0x80, 0x18, 0x7c, 0x40, 0x2, 0x6e, 0x1, 0xcd,
0xe0, 0x66, 0x69, 0xb9, 0x95, 0x73, 0x90, 0xb,
0xe9, 0x80, 0x71, 0x3f, 0x53, 0x20, 0x2b, 0x31,
0x4c, 0xcb, 0x1b, 0x8, 0x1, 0x0,
/* U+004B "K" */
0x3, 0x9e, 0xff, 0x6c, 0x18, 0x7, 0x1c, 0xef,
0xfd, 0xb2, 0x80, 0x1f, 0xfc, 0x31, 0x4a, 0xd6,
0x20, 0x38, 0xe9, 0x40, 0xf, 0xfe, 0x8, 0xad,
0xd2, 0x88, 0x92, 0x79, 0xcc, 0x3, 0xff, 0x82,
0x55, 0x52, 0x88, 0x96, 0xa8, 0xc4, 0x1, 0xff,
0xc2, 0x25, 0x64, 0x0, 0x8c, 0xce, 0x20, 0x1f,
0xfc, 0x61, 0x44, 0x18, 0x13, 0x74, 0x18, 0x7,
0xff, 0xc, 0x5a, 0xae, 0xde, 0xe4, 0x4, 0xfe,
0xe4, 0x1, 0xff, 0xc1, 0x31, 0x70, 0x1, 0xc4,
0xb0, 0x81, 0xc7, 0x39, 0x0, 0x7f, 0xf1, 0x92,
0x2d, 0x44, 0xe, 0x25, 0x84, 0x2,
/* U+004C "L" */
0x3, 0x9e, 0xff, 0x6c, 0x18, 0x7, 0xff, 0xfc,
0x3, 0xff, 0xf2, 0x69, 0x51, 0x1f, 0x9d, 0x8,
0x3, 0xe1, 0x36, 0x77, 0xfd, 0x3a, 0xc0,
/* U+004D "M" */
0x3, 0x9e, 0xff, 0xdd, 0x6, 0x1, 0xfc, 0x2d,
0x7f, 0xfd, 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 0x8,
0xb5, 0x18, 0xb, 0x72, 0x0, 0x7f, 0xf0, 0x45,
0xe9, 0x0, 0xb, 0xca, 0x1, 0xff, 0xc1, 0x17,
0xe4, 0x0, 0x2f, 0x28, 0x7, 0xff, 0x4, 0x57,
0x94, 0x0, 0x9c, 0xc2, 0x1, 0xff, 0xc1, 0x5f,
0x50, 0x2, 0x6b, 0x88, 0x7, 0xff, 0x5, 0x79,
0x40, 0x9, 0x4e, 0x20, 0x1f, 0xfc, 0x14, 0xe6,
0x10, 0x3a, 0x61, 0x0,
/* U+005D "]" */
0x0, 0x84, 0x7f, 0x0, 0x49, 0x1f, 0xdd, 0xd0,
0x80, 0x5, 0xbb, 0x31, 0x0, 0x7c, 0x24, 0x9e,
0x20, 0x1f, 0xff, 0xf0, 0xf, 0xfe, 0x88, 0x98,
0x80, 0x7e, 0x48, 0xc8, 0x30, 0xf, 0x96, 0xea,
0xef, 0xca,
/* U+005E "^" */
0x0, 0xfc, 0x6c, 0xee, 0x52, 0x0, 0xff, 0xe0,
0x8b, 0x44, 0xc4, 0x2e, 0x10, 0x3, 0xfe, 0x17,
0xa4, 0x24, 0x40, 0x2f, 0xa8, 0x7, 0xf1, 0x35,
0x99, 0xaa, 0x61, 0x85, 0x39, 0x84, 0x3, 0xc7,
0x54, 0x23, 0xb6, 0x23, 0xb6, 0x24, 0xa6, 0x20,
0x0,
/* U+005F "_" */
0x0, 0x84, 0x8b, 0xff, 0x84, 0x20, 0x19, 0x6f,
0x77, 0xff, 0x85, 0x6a, 0x1, 0x24, 0xd5, 0x7f,
0xf0, 0xa5, 0x0,
/* U+0060 "`" */
0x0, 0x85, 0x27, 0x7f, 0xd6, 0xc4, 0x1, 0xe1,
0x49, 0xe8, 0x34, 0x89, 0x51, 0x0,
/* U+0061 "a" */
0x0, 0x8d, 0xeb, 0x3b, 0xfe, 0xed, 0xb7, 0x31,
0x0, 0xe4, 0x9d, 0x85, 0x25, 0x89, 0x75, 0x34,
0x8d, 0x84, 0x0, 0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fc,
/* U+007A "z" */
0x27, 0xdf, 0xff, 0xfe, 0xc, 0xa0, 0x4, 0x69,
0x71, 0x1c, 0xe8, 0x40, 0x10, 0xae, 0x28, 0x4,
0x26, 0xce, 0xf8, 0xc5, 0x48, 0x5, 0x6e, 0xca,
0x20, 0x1f, 0x92, 0x69, 0x84, 0x4b, 0x56, 0xa2,
0x1, 0xf0, 0xa5, 0x51, 0x84, 0x4d, 0x56, 0x82,
0x1, 0xf0, 0xa5, 0xd2, 0x88, 0xa, 0x89, 0xb3,
0xbe, 0x52, 0x0, 0x8b, 0x50, 0x40, 0x21, 0x47,
0x88, 0xf7, 0x20, 0x4,
/* U+007B "{" */
0x0, 0xfe, 0x12, 0x56, 0x42, 0x0, 0xff, 0x13,
0xee, 0xaa, 0x86, 0x20, 0x1f, 0xc7, 0x72, 0x62,
0xd0, 0xe6, 0x1, 0xfc, 0xc6, 0x20, 0x62, 0xc0,
0x1f, 0xfc, 0xf1, 0x5f, 0x40, 0x3, 0xe9, 0x0,
0x7e, 0x6a, 0xa2, 0x89, 0xc4, 0x14, 0x3, 0xf9,
0xe2, 0x8, 0x27, 0x36, 0x80, 0x1f, 0xc2, 0x6f,
0xca, 0x2, 0x86, 0x40, 0x1f, 0xfc, 0x1, 0x0,
0xbc, 0x3, 0xff, 0x80, 0x26, 0x20, 0x62, 0x20,
0xf, 0xf9, 0x29, 0xc4, 0x4f, 0xc, 0x40, 0x1f,
0xe3, 0x9c, 0xb6, 0x20, 0xe,
/* U+007C "|" */
0x0, 0x2d, 0x7d, 0xb0, 0x7, 0xff, 0xfc, 0x3,
0xfc, 0x20, 0x11, 0x80, 0x0,
/* U+007D "}" */
0x0, 0x89, 0x59, 0x48, 0x3, 0xff, 0x82, 0x3b,
0x75, 0xb8, 0xc4, 0x1, 0xfe, 0x38, 0x82, 0x81,
0xdd, 0x18, 0x7, 0xfc, 0xc6, 0x20, 0x44, 0x70,
0xf, 0xfe, 0x0, 0x80, 0x61, 0x0, 0xff, 0x8b,
0x94, 0x0, 0xf8, 0x82, 0x1, 0xfc, 0x2d, 0x30,
0x64, 0xd7, 0x4a, 0x1, 0xfc, 0xb1, 0x26, 0x29,
0x10, 0x40, 0xf, 0xc7, 0xae, 0x20, 0x9c, 0xe6,
0x20, 0x1f, 0xc2, 0x60, 0x10, 0x80, 0x7f, 0xce,
0x62, 0x2, 0x4e, 0x1, 0xfc, 0x4d, 0xe8, 0x4,
0xd6, 0x60, 0x1f, 0xc2, 0x5, 0x37, 0x90, 0x60,
0x1f, 0x0,
/* U+007E "~" */
0x0, 0xa, 0x46, 0x77, 0xf6, 0xd3, 0x18, 0x4,
0x71, 0xbf, 0x8c, 0x20, 0x2, 0x99, 0x39, 0x11,
0x9c, 0x52, 0x77, 0x2a, 0x61, 0x88, 0x51, 0x44,
0x0, 0x3c, 0x8d, 0x1d, 0x32, 0xcc, 0x53, 0x82,
0x32, 0x93, 0x54, 0x98, 0x0,
/* U+00A3 "£" */
0x0, 0xe1, 0x47, 0xad, 0xef, 0xf7, 0x73, 0x25,
0x88, 0x3, 0xf9, 0x2e, 0xa1, 0x4c, 0x95, 0x90,
0xcc, 0xd3, 0xf0, 0x40, 0x1e, 0x3c, 0x71, 0x1,
0x7f, 0xa9, 0xae, 0x95, 0x53, 0xfb, 0x0, 0x7f,
0xf0, 0x4, 0x3, 0x1b, 0x55, 0x4e, 0x80, 0x10,
0xb6, 0x61, 0xc8, 0x0, 0x2f, 0x9f, 0xf5, 0xb0,
0x80, 0x7c, 0x2b, 0x4c, 0x82, 0x1, 0x12, 0xbb,
0xdc, 0xa2, 0x1, 0xf8, 0xda, 0xf0, 0x80, 0x27,
0xe8, 0x89, 0x4c, 0x3, 0xf8, 0xda, 0x28, 0xc0,
0x2, 0x2d, 0x88, 0xfc, 0xc6, 0x20, 0x1, 0x5d,
0x52, 0x0, 0x85, 0x19, 0xdf, 0xf5, 0x21, 0x80,
0x0
};
/*---------------------
* GLYPH DESCRIPTION
*--------------------*/
static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = {
{.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */,
{.bitmap_index = 0, .adv_w = 48, .box_w = 6, .box_h = 0, .ofs_x = -1, .ofs_y = 0},
{.bitmap_index = 0, .adv_w = 52, .box_w = 9, .box_h = 9, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 39, .adv_w = 62, .box_w = 12, .box_h = 4, .ofs_x = 0, .ofs_y = 6},
{.bitmap_index = 62, .adv_w = 114, .box_w = 24, .box_h = 9, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 157, .adv_w = 110, .box_w = 21, .box_h = 12, .ofs_x = 0, .ofs_y = -1},
{.bitmap_index = 275, .adv_w = 142, .box_w = 27, .box_h = 9, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 379, .adv_w = 126, .box_w = 27, .box_h = 9, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 482, .adv_w = 31, .box_w = 6, .box_h = 4, .ofs_x = 0, .ofs_y = 6},
{.bitmap_index = 493, .adv_w = 67, .box_w = 15, .box_h = 14, .ofs_x = 0, .ofs_y = -3},
{.bitmap_index = 570, .adv_w = 68, .box_w = 15, .box_h = 14, .ofs_x = -1, .ofs_y = -3},
{.bitmap_index = 650, .adv_w = 87, .box_w = 21, .box_h = 6, .ofs_x = -1, .ofs_y = 3},
{.bitmap_index = 704, .adv_w = 105, .box_w = 21, .box_h = 7, .ofs_x = 0, .ofs_y = 1},
{.bitmap_index = 750, .adv_w = 47, .box_w = 12, .box_h = 4, .ofs_x = -1, .ofs_y = -2},
{.bitmap_index = 771, .adv_w = 74, .box_w = 15, .box_h = 3, .ofs_x = 0, .ofs_y = 3},
{.bitmap_index = 787, .adv_w = 56, .box_w = 9, .box_h = 2, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 797, .adv_w = 72, .box_w = 18, .box_h = 10, .ofs_x = -1, .ofs_y = -1},
{.bitmap_index = 857, .adv_w = 110, .box_w = 21, .box_h = 9, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 941, .adv_w = 110, .box_w = 18, .box_h = 9, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 973, .adv_w = 110, .box_w = 21, .box_h = 9, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 1057, .adv_w = 110, .box_w = 21, .box_h = 9, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 1147, .adv_w = 110, .box_w = 21, .box_h = 9, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 1219, .adv_w = 110, .box_w = 21, .box_h = 9, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 1303, .adv_w = 110, .box_w = 21, .box_h = 9, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 1391, .adv_w = 110, .box_w = 21, .box_h = 9, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 1456, .adv_w = 110, .box_w = 21, .box_h = 9, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 1551, .adv_w = 110, .box_w = 21, .box_h = 9, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 1641, .adv_w = 54, .box_w = 9, .box_h = 7, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 1667, .adv_w = 50, .box_w = 9, .box_h = 10, .ofs_x = 0, .ofs_y = -3},
{.bitmap_index = 1705, .adv_w = 98, .box_w = 21, .box_h = 8, .ofs_x = -1, .ofs_y = 0},
{.bitmap_index = 1766, .adv_w = 110, .box_w = 21, .box_h = 4, .ofs_x = 0, .ofs_y = 2},
{.bitmap_index = 1789, .adv_w = 99, .box_w = 21, .box_h = 7, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 1850, .adv_w = 96, .box_w = 21, .box_h = 9, .ofs_x = -1, .ofs_y = 0},
{.bitmap_index = 1924, .adv_w = 172, .box_w = 33, .box_h = 12, .ofs_x = 0, .ofs_y = -3},
{.bitmap_index = 2106, .adv_w = 129, .box_w = 30, .box_h = 9, .ofs_x = -1, .ofs_y = 0},
{.bitmap_index = 2204, .adv_w = 123, .box_w = 24, .box_h = 9, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 2290, .adv_w = 126, .box_w = 24, .box_h = 9, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 2388, .adv_w = 125, .box_w = 24, .box_h = 9, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 2467, .adv_w = 108, .box_w = 21, .box_h = 9, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 2526, .adv_w = 105, .box_w = 21, .box_h = 9, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 2568, .adv_w = 131, .box_w = 24, .box_h = 9, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 2669, .adv_w = 136, .box_w = 27, .box_h = 9, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 2708, .adv_w = 56, .box_w = 9, .box_h = 9, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 2716, .adv_w = 107, .box_w = 24, .box_h = 9, .ofs_x = -1, .ofs_y = 0},
{.bitmap_index = 2762, .adv_w = 122, .box_w = 27, .box_h = 9, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 2848, .adv_w = 104, .box_w = 21, .box_h = 9, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 2871, .adv_w = 168, .box_w = 33, .box_h = 9, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 2972, .adv_w = 136, .box_w = 27, .box_h = 9, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 3038, .adv_w = 133, .box_w = 27, .box_h = 9, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 3146, .adv_w = 124, .box_w = 24, .box_h = 9, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 3211, .adv_w = 133, .box_w = 27, .box_h = 11, .ofs_x = 0, .ofs_y = -2},
{.bitmap_index = 3338, .adv_w = 123, .box_w = 24, .box_h = 9, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 3418, .adv_w = 118, .box_w = 24, .box_h = 9, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 3521, .adv_w = 119, .box_w = 27, .box_h = 9, .ofs_x = -1, .ofs_y = 0},
{.bitmap_index = 3560, .adv_w = 126, .box_w = 24, .box_h = 9, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 3615, .adv_w = 126, .box_w = 30, .box_h = 9, .ofs_x = -1, .ofs_y = 0},
{.bitmap_index = 3718, .adv_w = 168, .box_w = 36, .box_h = 9, .ofs_x = -1, .ofs_y = 0},
{.bitmap_index = 3862, .adv_w = 122, .box_w = 27, .box_h = 9, .ofs_x = -1, .ofs_y = 0},
{.bitmap_index = 3964, .adv_w = 119, .box_w = 27, .box_h = 9, .ofs_x = -1, .ofs_y = 0},
{.bitmap_index = 4040, .adv_w = 116, .box_w = 24, .box_h = 9, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 4120, .adv_w = 53, .box_w = 12, .box_h = 15, .ofs_x = 0, .ofs_y = -3},
{.bitmap_index = 4156, .adv_w = 81, .box_w = 21, .box_h = 10, .ofs_x = -1, .ofs_y = -1},
{.bitmap_index = 4232, .adv_w = 53, .box_w = 12, .box_h = 15, .ofs_x = -1, .ofs_y = -3},
{.bitmap_index = 4266, .adv_w = 84, .box_w = 21, .box_h = 5, .ofs_x = -1, .ofs_y = 5},
{.bitmap_index = 4307, .adv_w = 86, .box_w = 21, .box_h = 3, .ofs_x = -1, .ofs_y = -2},
{.bitmap_index = 4326, .adv_w = 63, .box_w = 15, .box_h = 2, .ofs_x = -1, .ofs_y = 8},
{.bitmap_index = 4340, .adv_w = 103, .box_w = 21, .box_h = 7, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 4408, .adv_w = 108, .box_w = 21, .box_h = 10, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 4472, .adv_w = 100, .box_w = 21, .box_h = 7, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 4544, .adv_w = 108, .box_w = 21, .box_h = 10, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 4613, .adv_w = 104, .box_w = 21, .box_h = 7, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 4682, .adv_w = 69, .box_w = 18, .box_h = 10, .ofs_x = -1, .ofs_y = 0},
{.bitmap_index = 4734, .adv_w = 110, .box_w = 21, .box_h = 10, .ofs_x = 0, .ofs_y = -3},
{.bitmap_index = 4827, .adv_w = 107, .box_w = 21, .box_h = 10, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 4867, .adv_w = 51, .box_w = 9, .box_h = 10, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 4889, .adv_w = 50, .box_w = 12, .box_h = 13, .ofs_x = -1, .ofs_y = -3},
{.bitmap_index = 4931, .adv_w = 103, .box_w = 21, .box_h = 10, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 4990, .adv_w = 51, .box_w = 9, .box_h = 10, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 4999, .adv_w = 166, .box_w = 33, .box_h = 7, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 5055, .adv_w = 108, .box_w = 21, .box_h = 7, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 5092, .adv_w = 109, .box_w = 21, .box_h = 7, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 5165, .adv_w = 108, .box_w = 21, .box_h = 10, .ofs_x = 0, .ofs_y = -3},
{.bitmap_index = 5234, .adv_w = 108, .box_w = 21, .box_h = 10, .ofs_x = 0, .ofs_y = -3},
{.bitmap_index = 5305, .adv_w = 70, .box_w = 15, .box_h = 8, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 5333, .adv_w = 99, .box_w = 21, .box_h = 7, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 5403, .adv_w = 65, .box_w = 18, .box_h = 9, .ofs_x = -1, .ofs_y = 0},
{.bitmap_index = 5455, .adv_w = 107, .box_w = 21, .box_h = 7, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 5491, .adv_w = 97, .box_w = 24, .box_h = 7, .ofs_x = -1, .ofs_y = 0},
{.bitmap_index = 5560, .adv_w = 141, .box_w = 30, .box_h = 7, .ofs_x = -1, .ofs_y = 0},
{.bitmap_index = 5657, .adv_w = 98, .box_w = 24, .box_h = 7, .ofs_x = -1, .ofs_y = 0},
{.bitmap_index = 5729, .adv_w = 96, .box_w = 24, .box_h = 10, .ofs_x = -1, .ofs_y = -3},
{.bitmap_index = 5821, .adv_w = 98, .box_w = 21, .box_h = 7, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 5881, .adv_w = 63, .box_w = 18, .box_h = 13, .ofs_x = -1, .ofs_y = -2},
{.bitmap_index = 5958, .adv_w = 49, .box_w = 9, .box_h = 11, .ofs_x = 0, .ofs_y = -2},
{.bitmap_index = 5971, .adv_w = 63, .box_w = 18, .box_h = 13, .ofs_x = -1, .ofs_y = -2},
{.bitmap_index = 6053, .adv_w = 125, .box_w = 24, .box_h = 3, .ofs_x = 0, .ofs_y = 2},
{.bitmap_index = 6090, .adv_w = 114, .box_w = 24, .box_h = 9, .ofs_x = 0, .ofs_y = 0}
};
/*---------------------
* CHARACTER MAPPING
*--------------------*/
/*Collect the unicode lists and glyph_id offsets*/
static const lv_font_fmt_txt_cmap_t cmaps[] =
{
{
.range_start = 32, .range_length = 95, .glyph_id_start = 1,
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
},
{
.range_start = 163, .range_length = 1, .glyph_id_start = 96,
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
}
};
/*-----------------
* KERNING
*----------------*/
/*Pair left and right glyphs for kerning*/
static const uint8_t kern_pair_glyph_ids[] =
{
1, 53,
3, 3,
3, 8,
3, 34,
3, 66,
3, 68,
3, 69,
3, 70,
3, 72,
3, 78,
3, 79,
3, 80,
3, 81,
3, 82,
3, 84,
3, 88,
8, 3,
8, 8,
8, 34,
8, 66,
8, 68,
8, 69,
8, 70,
8, 72,
8, 78,
8, 79,
8, 80,
8, 81,
8, 82,
8, 84,
8, 88,
9, 55,
9, 56,
9, 58,
13, 3,
13, 8,
15, 3,
15, 8,
16, 16,
34, 3,
34, 8,
34, 32,
34, 36,
34, 40,
34, 48,
34, 50,
34, 53,
34, 54,
34, 55,
34, 56,
34, 58,
34, 78,
34, 79,
34, 80,
34, 81,
34, 85,
34, 86,
34, 87,
34, 88,
34, 90,
34, 91,
35, 53,
35, 55,
35, 58,
36, 10,
36, 53,
36, 62,
36, 94,
37, 13,
37, 15,
37, 34,
37, 53,
37, 55,
37, 57,
37, 58,
37, 59,
38, 53,
38, 68,
38, 69,
38, 70,
38, 71,
38, 72,
38, 80,
38, 82,
38, 86,
38, 87,
38, 88,
38, 90,
39, 13,
39, 15,
39, 34,
39, 43,
39, 53,
39, 66,
39, 68,
39, 69,
39, 70,
39, 72,
39, 80,
39, 82,
39, 83,
39, 86,
39, 87,
39, 90,
41, 34,
41, 53,
41, 57,
41, 58,
42, 34,
42, 53,
42, 57,
42, 58,
43, 34,
44, 14,
44, 36,
44, 40,
44, 48,
44, 50,
44, 68,
44, 69,
44, 70,
44, 72,
44, 80,
44, 82,
44, 86,
44, 87,
44, 88,
44, 90,
45, 3,
45, 8,
45, 34,
45, 36,
45, 40,
45, 48,
45, 50,
45, 53,
45, 54,
45, 55,
45, 56,
45, 58,
45, 86,
45, 87,
45, 88,
45, 90,
46, 34,
46, 53,
46, 57,
46, 58,
47, 34,
47, 53,
47, 57,
47, 58,
48, 13,
48, 15,
48, 34,
48, 53,
48, 55,
48, 57,
48, 58,
48, 59,
49, 13,
49, 15,
49, 34,
49, 43,
49, 57,
49, 59,
49, 66,
49, 68,
49, 69,
49, 70,
49, 72,
49, 80,
49, 82,
49, 85,
49, 87,
49, 90,
50, 53,
50, 55,
50, 56,
50, 58,
51, 53,
51, 55,
51, 58,
53, 1,
53, 13,
53, 14,
53, 15,
53, 34,
53, 36,
53, 40,
53, 43,
53, 48,
53, 50,
53, 52,
53, 53,
53, 55,
53, 56,
53, 58,
53, 66,
53, 68,
53, 69,
53, 70,
53, 72,
53, 78,
53, 79,
53, 80,
53, 81,
53, 82,
53, 83,
53, 84,
53, 86,
53, 87,
53, 88,
53, 89,
53, 90,
53, 91,
54, 34,
55, 10,
55, 13,
55, 14,
55, 15,
55, 34,
55, 36,
55, 40,
55, 48,
55, 50,
55, 62,
55, 66,
55, 68,
55, 69,
55, 70,
55, 72,
55, 80,
55, 82,
55, 83,
55, 86,
55, 87,
55, 90,
55, 94,
56, 10,
56, 13,
56, 14,
56, 15,
56, 34,
56, 53,
56, 62,
56, 66,
56, 68,
56, 69,
56, 70,
56, 72,
56, 80,
56, 82,
56, 83,
56, 86,
56, 94,
57, 14,
57, 36,
57, 40,
57, 48,
57, 50,
57, 55,
57, 68,
57, 69,
57, 70,
57, 72,
57, 80,
57, 82,
57, 86,
57, 87,
57, 90,
58, 7,
58, 10,
58, 11,
58, 13,
58, 14,
58, 15,
58, 34,
58, 36,
58, 40,
58, 43,
58, 48,
58, 50,
58, 52,
58, 53,
58, 54,
58, 55,
58, 56,
58, 57,
58, 58,
58, 62,
58, 66,
58, 68,
58, 69,
58, 70,
58, 71,
58, 72,
58, 78,
58, 79,
58, 80,
58, 81,
58, 82,
58, 83,
58, 84,
58, 85,
58, 86,
58, 87,
58, 89,
58, 90,
58, 91,
58, 94,
59, 34,
59, 36,
59, 40,
59, 48,
59, 50,
59, 68,
59, 69,
59, 70,
59, 72,
59, 80,
59, 82,
59, 86,
59, 87,
59, 88,
59, 90,
60, 43,
60, 54,
66, 3,
66, 8,
66, 87,
66, 90,
67, 3,
67, 8,
67, 87,
67, 89,
67, 90,
67, 91,
68, 3,
68, 8,
70, 3,
70, 8,
70, 87,
70, 90,
71, 3,
71, 8,
71, 10,
71, 62,
71, 68,
71, 69,
71, 70,
71, 72,
71, 82,
71, 94,
73, 3,
73, 8,
76, 68,
76, 69,
76, 70,
76, 72,
76, 82,
78, 3,
78, 8,
79, 3,
79, 8,
80, 3,
80, 8,
80, 87,
80, 89,
80, 90,
80, 91,
81, 3,
81, 8,
81, 87,
81, 89,
81, 90,
81, 91,
83, 3,
83, 8,
83, 13,
83, 15,
83, 66,
83, 68,
83, 69,
83, 70,
83, 71,
83, 72,
83, 80,
83, 82,
83, 85,
83, 87,
83, 88,
83, 90,
85, 80,
87, 3,
87, 8,
87, 13,
87, 15,
87, 66,
87, 68,
87, 69,
87, 70,
87, 71,
87, 72,
87, 80,
87, 82,
88, 13,
88, 15,
89, 68,
89, 69,
89, 70,
89, 72,
89, 80,
89, 82,
90, 3,
90, 8,
90, 13,
90, 15,
90, 66,
90, 68,
90, 69,
90, 70,
90, 71,
90, 72,
90, 80,
90, 82,
91, 68,
91, 69,
91, 70,
91, 72,
91, 80,
91, 82,
92, 43,
92, 54
};
/* Kerning between the respective left and right glyphs
* 4.4 format which needs to scaled with `kern_scale`*/
static const int8_t kern_pair_values[] =
{
-6, -3, -3, -11, -5, -6, -6, -6,
-6, -2, -2, -9, -2, -6, -9, 1,
-3, -3, -11, -5, -6, -6, -6, -6,
-2, -2, -9, -2, -6, -9, 1, 2,
4, 2, -27, -27, -27, -27, -23, -11,
-11, -8, -2, -2, -2, -2, -11, -2,
-7, -4, -14, -4, -4, -1, -4, -2,
-1, -5, -3, -5, 1, -3, -2, -5,
-2, -3, -1, -2, -11, -11, -2, -8,
-2, -2, -4, -2, 2, -2, -2, -2,
-2, -2, -2, -2, -2, -2, -2, -2,
-26, -26, -18, -19, 2, -3, -2, -2,
-2, -2, -2, -2, -2, -2, -2, -2,
2, -3, 2, -3, 2, -3, 2, -3,
-2, -15, -3, -3, -3, -3, -2, -2,
-2, -2, -3, -2, -2, -4, -6, -4,
-27, -27, 2, -6, -6, -6, -6, -19,
-2, -19, -9, -26, -1, -12, -5, -12,
2, -3, 2, -3, 2, -3, 2, -3,
-11, -11, -2, -8, -2, -2, -4, -2,
-38, -38, -17, -17, -5, -3, -1, -1,
-1, -1, -1, -1, -1, 1, 1, 1,
-3, -3, -2, -3, -5, -2, -4, -6,
-24, -25, -24, -11, -3, -3, -20, -3,
-3, -1, 2, 2, 1, 2, -16, -8,
-8, -8, -8, -8, -8, -19, -8, -8,
-6, -7, -6, -8, -4, -7, -8, -6,
-2, 2, -20, -15, -20, -7, -1, -1,
-1, -1, 2, -4, -4, -4, -4, -4,
-4, -4, -3, -3, -1, -1, 2, 1,
-13, -6, -13, -4, 1, 1, -3, -3,
-3, -3, -3, -3, -3, -2, -2, 1,
-15, -2, -2, -2, -2, 1, -2, -2,
-2, -2, -2, -2, -2, -3, -3, -3,
2, -5, -22, -14, -22, -14, -3, -3,
-9, -3, -3, -1, 2, -9, 2, 2,
1, 2, 2, -6, -6, -6, -6, -2,
-6, -4, -4, -6, -4, -6, -4, -5,
-2, -4, -2, -2, -2, -3, 2, 1,
-2, -2, -2, -2, -2, -2, -2, -2,
-2, -2, -2, -3, -3, -3, -2, -2,
-2, -2, -1, -1, -3, -3, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
2, 2, 2, 2, -2, -2, -2, -2,
-2, 2, -7, -7, -2, -2, -2, -2,
-2, -7, -7, -7, -7, -8, -8, -1,
-2, -1, -1, -3, -3, -1, -1, -1,
-1, 2, 2, -16, -16, -3, -2, -2,
-2, 2, -2, -3, -2, 5, 2, 2,
2, -3, 1, 1, -16, -16, -1, -1,
-1, -1, 1, -1, -1, -1, -12, -12,
-2, -2, -2, -2, -4, -2, 1, 1,
-16, -16, -1, -1, -1, -1, 1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-2, -2
};
/*Collect the kern pair's data in one place*/
static const lv_font_fmt_txt_kern_pair_t kern_pairs =
{
.glyph_ids = kern_pair_glyph_ids,
.values = kern_pair_values,
.pair_cnt = 434,
.glyph_ids_size = 0
};
/*--------------------
* ALL CUSTOM DATA
*--------------------*/
#if LV_VERSION_CHECK(8, 0, 0)
/*Store all the custom data of the font*/
static lv_font_fmt_txt_glyph_cache_t cache;
static const lv_font_fmt_txt_dsc_t font_dsc = {
#else
static lv_font_fmt_txt_dsc_t font_dsc = {
#endif
.glyph_bitmap = glyph_bitmap,
.glyph_dsc = glyph_dsc,
.cmaps = cmaps,
.kern_dsc = &kern_pairs,
.kern_scale = 16,
.cmap_num = 2,
.bpp = 4,
.kern_classes = 0,
.bitmap_format = 1,
#if LV_VERSION_CHECK(8, 0, 0)
.cache = &cache
#endif
};
/*-----------------
* PUBLIC FONT
*----------------*/
/*Initialize a public general font descriptor*/
#if LV_VERSION_CHECK(8, 0, 0)
const lv_font_t lv_font_roboto_bold_12 = {
#else
lv_font_t lv_font_roboto_bold_12 = {
#endif
.get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/
.get_glyph_bitmap = lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/
.line_height = 15, /*The maximum line height required by the font*/
.base_line = 3, /*Baseline measured from the bottom of the line*/
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
.subpx = LV_FONT_SUBPX_HOR,
#endif
#if LV_VERSION_CHECK(7, 4, 0)
.underline_position = -1,
.underline_thickness = 1,
#endif
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
};
#endif /*#if LV_FONT_ROBOTO_BOLD_12*/
|
wvulibraries/library_directory | db/migrate/20180814151439_change_belongs_to_departments.rb | class ChangeBelongsToDepartments < ActiveRecord::Migration[5.2]
def change
change_table :departments do |t|
t.remove_references :departmentable, :polymorphic => true
t.belongs_to :building
end
change_table :users do |t|
t.belongs_to :department
end
end
end
|
GDH5/Java-Learning | workspace/old java/src/people/ProcessStudent.java | package people;
public class ProcessStudent {
/*The class processStudents shall store at least 10 student objects to an array.
* When the user is querried for a student id, the array should be searched for the
* appropriate student record and displayed to console.
When the user enters -1, or any other similar number,
the user shall not be querried anymore, and the final step should be displaying the
entire set of student objects to console.
If a student id does not exist than state "Student Record not found."
*/
public ProcessStudent(){
}
public static void ProcessStudent(int _id){
int id = _id;
int i = 0;
int current = 0;
//for loop that checks each object in the array for the id number.
for (i = 0; i < Main.ary.length; i++){
Main.ary[i].ID = current;
if (current == id){
Main.ary[i].Puts();
}
}
}
/* public static void puts(int s){
System.out.print(Main.ary[s].FN + Main.ary[s].LN + Main.ary[s].ID + Main.ary[s].DOB + Main.ary[s].GPA);
//System.out.print(String.format("found student" + Main.ary));
}
*/
}
|
mit-ccrg/ml4c3-mirror | ml4c3/utils.py | # Imports: standard library
from datetime import datetime
# Imports: third party
import numpy as np
import pandas as pd
# Imports: first party
from definitions.globals import TIMEZONE
def get_unix_timestamps(time_stamp: np.ndarray) -> np.ndarray:
"""
Convert readable time stamps to unix time stamps.
:param time_stamp: <np.ndarray> Array with all readable time stamps.
:return: <np.ndarray> Array with Unix time stamps.
"""
try:
arr_timestamps = pd.to_datetime(time_stamp)
except pd.errors.ParserError as error:
raise ValueError("Array contains non datetime values") from error
# Convert readable local timestamps in local seconds timestamps
local_timestamps = (
np.array(arr_timestamps, dtype=np.datetime64)
- np.datetime64("1970-01-01T00:00:00")
) / np.timedelta64(1, "s")
# Compute unix timestamp by checking local time shift
def _get_time_shift(t_span):
dt_span = datetime.utcfromtimestamp(t_span)
offset = TIMEZONE.utcoffset( # type: ignore
dt_span,
is_dst=True,
).total_seconds()
return t_span - offset
apply_time_shift = np.vectorize(_get_time_shift)
if np.size(local_timestamps) > 0:
unix_timestamps = apply_time_shift(local_timestamps)
else:
unix_timestamps = local_timestamps
return unix_timestamps
|
lowlander/zpp | tests/compile/src/main.cpp | /*
* Copyright (c) 2019 <NAME> <<EMAIL>>
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* Simple test to check if all zpp headers are error free
*/
#include <zephyr.h>
#include <kernel.h>
#include <ztest.h>
#include <zpp.hpp>
//
// check compile time power_of_two function
//
static_assert(zpp::power_of_two(0) == 1);
static_assert(zpp::power_of_two(1) == 2);
static_assert(zpp::power_of_two(2) == 4);
static_assert(zpp::power_of_two(3) == 8);
static_assert(zpp::power_of_two(4) == 16);
static_assert(zpp::power_of_two(10) == 1024);
static_assert(zpp::power_of_two(20) == 1048576);
//
// check compile time is_power_of_two function
//
static_assert(zpp::is_power_of_two(1) == true);
static_assert(zpp::is_power_of_two(2) == true);
static_assert(zpp::is_power_of_two(4) == true);
static_assert(zpp::is_power_of_two(8) == true);
static_assert(zpp::is_power_of_two(16) == true);
static_assert(zpp::is_power_of_two(3) == false);
static_assert(zpp::is_power_of_two(100) == false);
//
// check compile time is_multiple_of function
//
static_assert(zpp::is_multiple_of(0, 0) == false);
static_assert(zpp::is_multiple_of(4, 4) == true);
static_assert(zpp::is_multiple_of(6, 3) == true);
static_assert(zpp::is_multiple_of(10, 3) == false);
void test_main(void)
{
/* This is only a compile time test */
}
|
ritabc/rails-decision-log | app/validators/user_has_one_role_per_circle.rb | <gh_stars>1-10
class UserHasOneRolePerCircle < ActiveModel::Validator
def validate(user)
users_circle_ids = []
user.roles.each do |role|
users_circle_ids.push(role.circle.id)
end
# if its valid (has no duplicates), it will be nill
# If one of the circles exists more than once in user_circle_ids, add an error
# But don't error if user_circle_ids is empty
unless users_circle_ids.detect { |circle_name| users_circle_ids.count(circle_name) > 1 } == nil
binding.pry
user.errors[:roles] << "User must have only one role per circle"
end
end
end
|
tomsksoft-llc/NATter | batcher/batcher_test.go | <gh_stars>0
package batcher
import (
"context"
"testing"
"time"
m "NATter/mock"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
)
func TestNewOnDefaultParameters(t *testing.T) {
bat, err := New(&Config{}, &m.DriverSender{}, &m.BatcherEncoder{})
assert.Error(t, err)
assert.Nil(t, bat)
}
func TestBatcherRunOnFullBatch(t *testing.T) {
sender := &m.DriverSender{}
enc := &m.BatcherEncoder{}
sender.
On("Send", []byte("batch-of-data")).
Return(nil).Once()
enc.
On("Marshal", [][]byte{
[]byte("some-data"),
[]byte("some-data"),
[]byte("some-data"),
}).
Return([]byte("batch-of-data"), nil).Once()
bat, err := New(&Config{
Timeout: 30,
Capacity: 3,
}, sender, enc)
assert.Nil(t, err)
assert.NotNil(t, bat)
go func() {
for i := 0; i < 3; i++ {
err := bat.Send([]byte("some-data"))
assert.Nil(t, err)
}
}()
ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond)
defer cancel()
bat.Run(ctx)
sender.AssertExpectations(t)
enc.AssertExpectations(t)
}
func TestBatcherRunOnTimeout(t *testing.T) {
sender := &m.DriverSender{}
enc := &m.BatcherEncoder{}
sender.
On("Send", []byte("batch-of-data")).
Return(nil).Once()
enc.
On("Marshal", [][]byte{
[]byte("some-data"),
}).
Return([]byte("batch-of-data"), nil).Once()
bat, err := New(&Config{
Timeout: 1,
Capacity: 3,
}, sender, enc)
assert.Nil(t, err)
assert.NotNil(t, bat)
go func() {
err := bat.Send([]byte("some-data"))
assert.Nil(t, err)
}()
ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond*1001)
defer cancel()
bat.Run(ctx)
sender.AssertExpectations(t)
enc.AssertExpectations(t)
}
func TestBatcherRunOnMarshalError(t *testing.T) {
enc := &m.BatcherEncoder{}
enc.
On("Marshal", [][]byte{
[]byte("some-data"),
}).
Return([]byte(nil), errors.New("error")).Once()
bat, err := New(&Config{
Timeout: 30,
Capacity: 3,
}, &m.DriverSender{}, enc)
assert.Nil(t, err)
assert.NotNil(t, bat)
go func() {
err := bat.Send([]byte("some-data"))
assert.Nil(t, err)
}()
ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond)
defer cancel()
bat.Run(ctx)
enc.AssertExpectations(t)
}
func TestBatcherRunOnSendError(t *testing.T) {
sender := &m.DriverSender{}
enc := &m.BatcherEncoder{}
sender.
On("Send", []byte("batch-of-data")).
Return(errors.New("error"))
enc.
On("Marshal", [][]byte{
[]byte("some-data"),
}).
Return([]byte("batch-of-data"), nil).Once()
bat, err := New(&Config{
Timeout: 30,
Capacity: 1,
}, sender, enc)
assert.Nil(t, err)
assert.NotNil(t, bat)
go func() {
err := bat.Send([]byte("some-data"))
assert.Nil(t, err)
}()
ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond)
defer cancel()
bat.Run(ctx)
sender.AssertExpectations(t)
enc.AssertExpectations(t)
}
func TestBatcherRunOnZeroTimeout(t *testing.T) {
sender := &m.DriverSender{}
bat, err := New(&Config{
Timeout: 0,
Capacity: 3,
}, sender, &m.BatcherEncoder{})
assert.Nil(t, err)
assert.NotNil(t, bat)
ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond)
defer cancel()
bat.Run(ctx)
}
func TestBatcherSend(t *testing.T) {
sender := &m.DriverSender{}
enc := &m.BatcherEncoder{}
sender.
On("Send", []byte("batch-of-data")).
Return(nil).Once()
enc.
On("Marshal", [][]byte{
[]byte("some-data"),
}).
Return([]byte("batch-of-data"), nil).Once()
bat, err := New(&Config{
Timeout: 30,
Capacity: 3,
}, sender, enc)
assert.Nil(t, err)
assert.NotNil(t, bat)
go func() {
err := bat.Send([]byte("some-data"))
assert.Nil(t, err)
}()
ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond)
defer cancel()
bat.Run(ctx)
sender.AssertExpectations(t)
enc.AssertExpectations(t)
}
func TestBatcherRequest(t *testing.T) {
bat, err := New(&Config{
Timeout: 30,
Capacity: 3,
}, &m.DriverSender{}, &m.BatcherEncoder{})
assert.Nil(t, err)
assert.NotNil(t, bat)
respb, err := bat.Request([]byte("some-data"))
assert.Error(t, err)
assert.Nil(t, respb)
}
|
sacahan/opendata | ntpc-od-model/src/main/java/com/udn/ntpc/od/model/set/repository/DataSetRepository.java | <reponame>sacahan/opendata<filename>ntpc-od-model/src/main/java/com/udn/ntpc/od/model/set/repository/DataSetRepository.java
package com.udn.ntpc.od.model.set.repository;
import com.udn.ntpc.od.model.repository.CustomRespository;
import com.udn.ntpc.od.model.set.domain.DataSet;
import org.springframework.stereotype.Repository;
@Repository
public interface DataSetRepository extends CustomRespository<DataSet, String> {
}
|
aliostad/deep-learning-lang-detection | data/test/go/971b78b505f3962c0e5324c07c064889ab5567f0loadavg_darwin.go | <gh_stars>10-100
// +build darwin
package sysstats
import (
"os/exec"
"strconv"
"strings"
)
// LoadAvg represents the load average of the system
// The following are the keys of the map:
// Avg1 - The average processor workload of the last minute
// Avg5 - The average processor workload of the last 5 minutes
// Avg15 - The average processor workload of the last 15 minutes
type LoadAvg map[string]float64
// getLoadAvg gets the load average of an OSX system
func getLoadAvg() (loadAvg LoadAvg, err error) {
// `sysctl -n vm.loadavg` returns the load average with the
// following format:
// { 1.33 1.27 1.38 }
out, err := exec.Command(`sysctl`, `-n`, `vm.loadavg`).Output()
if err != nil {
return nil, err
}
loadAvg = LoadAvg{}
fields := strings.Fields(string(out))
for i := 1; i < 4; i++ {
load, err := strconv.ParseFloat(fields[i], 64)
if err != nil {
return nil, err
}
switch i {
case 1:
loadAvg[`avg1`] = load
case 2:
loadAvg[`avg5`] = load
case 3:
loadAvg[`avg15`] = load
}
}
return loadAvg, nil
}
|
ifellinaholeonce/osem | spec/factories/venues.rb | # frozen_string_literal: true
# Read about factories at https://github.com/thoughtbot/factory_bot
FactoryBot.define do
factory :venue do
name { "#{Faker::Company.name} Office" }
street { Faker::Address.street_address }
city { Faker::Address.city }
postalcode { Faker::Address.postcode }
country { Faker::Address.country_code }
website { Faker::Internet.url }
description { Faker::Lorem.sentence }
end
end
|
StephQuery/transcode-orchestrator | vendor/github.com/bitmovin/bitmovin-api-sdk-go/encoding/encoding_encodings_streams_filters_api.go | <gh_stars>10-100
package encoding
import (
"github.com/bitmovin/bitmovin-api-sdk-go/common"
"github.com/bitmovin/bitmovin-api-sdk-go/query"
"github.com/bitmovin/bitmovin-api-sdk-go/model"
)
type EncodingEncodingsStreamsFiltersApi struct {
apiClient *common.ApiClient
}
func NewEncodingEncodingsStreamsFiltersApi(configs ...func(*common.ApiClient)) (*EncodingEncodingsStreamsFiltersApi, error) {
apiClient, err := common.NewApiClient(configs...)
if err != nil {
return nil, err
}
api := &EncodingEncodingsStreamsFiltersApi{apiClient: apiClient}
if err != nil {
return nil, err
}
return api, nil
}
func (api *EncodingEncodingsStreamsFiltersApi) Create(encodingId string, streamId string, streamFilter []model.StreamFilter) (*model.StreamFilterList, error) {
reqParams := func(params *common.RequestParams) {
params.PathParams["encoding_id"] = encodingId
params.PathParams["stream_id"] = streamId
}
var responseModel *model.StreamFilterList
err := api.apiClient.Post("/encoding/encodings/{encoding_id}/streams/{stream_id}/filters", &streamFilter, &responseModel, reqParams)
return responseModel, err
}
func (api *EncodingEncodingsStreamsFiltersApi) Delete(encodingId string, streamId string, filterId string) (*model.BitmovinResponse, error) {
reqParams := func(params *common.RequestParams) {
params.PathParams["encoding_id"] = encodingId
params.PathParams["stream_id"] = streamId
params.PathParams["filter_id"] = filterId
}
var responseModel *model.BitmovinResponse
err := api.apiClient.Delete("/encoding/encodings/{encoding_id}/streams/{stream_id}/filters/{filter_id}", nil, &responseModel, reqParams)
return responseModel, err
}
func (api *EncodingEncodingsStreamsFiltersApi) DeleteAll(encodingId string, streamId string) (*model.BitmovinResponseList, error) {
reqParams := func(params *common.RequestParams) {
params.PathParams["encoding_id"] = encodingId
params.PathParams["stream_id"] = streamId
}
var responseModel *model.BitmovinResponseList
err := api.apiClient.Delete("/encoding/encodings/{encoding_id}/streams/{stream_id}/filters", nil, &responseModel, reqParams)
return responseModel, err
}
func (api *EncodingEncodingsStreamsFiltersApi) List(encodingId string, streamId string, queryParams ...func(*query.StreamFilterListListQueryParams)) (*model.StreamFilterList, error) {
queryParameters := &query.StreamFilterListListQueryParams{}
for _, queryParam := range queryParams {
queryParam(queryParameters)
}
reqParams := func(params *common.RequestParams) {
params.PathParams["encoding_id"] = encodingId
params.PathParams["stream_id"] = streamId
params.QueryParams = queryParameters
}
var responseModel *model.StreamFilterList
err := api.apiClient.Get("/encoding/encodings/{encoding_id}/streams/{stream_id}/filters", nil, &responseModel, reqParams)
return responseModel, err
}
|
yaccob/adbcj | mysql/src/main/java/org/adbcj/mysql/codec/decoding/ExpectUpdateResult.java | <filename>mysql/src/main/java/org/adbcj/mysql/codec/decoding/ExpectUpdateResult.java
package org.adbcj.mysql.codec.decoding;
import org.adbcj.DbCallback;
import org.adbcj.mysql.MySqlConnection;
import org.adbcj.mysql.codec.MysqlResult;
import org.adbcj.mysql.codec.packets.OkResponse;
import org.adbcj.support.OneArgFunction;
import java.util.ArrayList;
public class ExpectUpdateResult<T> extends ExpectOK<T> {
private final OneArgFunction<MysqlResult, T> transformation;
public ExpectUpdateResult(MySqlConnection connection,
DbCallback<T> callback,
StackTraceElement[] entry
) {
this(connection, callback, entry, OneArgFunction.ID_FUNCTION);
}
public ExpectUpdateResult(
MySqlConnection connection,
DbCallback<T> callback,
StackTraceElement[] entry,
OneArgFunction<MysqlResult, T> transformation) {
super(connection, callback, entry);
this.transformation = transformation;
}
@Override
protected ResultAndState handleOk(OkResponse.RegularOK regularOK) {
return handleUpdateResult(
connection,
regularOK,
callback,
transformation);
}
static <TFutureType> ResultAndState handleUpdateResult(
MySqlConnection connection,
OkResponse.RegularOK regularOK,
DbCallback<TFutureType> futureToComplete,
OneArgFunction<MysqlResult, TFutureType> transformation) {
ArrayList<String> warnings = new ArrayList<String>(regularOK.getWarningCount());
for (int i = 0; i < regularOK.getWarningCount(); i++) {
warnings.add(regularOK.getMessage());
}
MysqlResult result = new MysqlResult(regularOK.getAffectedRows(), warnings, regularOK.getInsertId());
futureToComplete.onComplete(transformation.apply(result), null);
return new ResultAndState(new AcceptNextResponse(connection), regularOK);
}
}
|
tulipanh/nimbus-core | nimbus-core/src/main/java/com/antheminc/oss/nimbus/app/extension/config/DefaultMongoConfig.java | <gh_stars>10-100
/**
* Copyright 2016-2019 the 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 com.antheminc.oss.nimbus.app.extension.config;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.mongodb.config.EnableMongoAuditing;
import org.springframework.data.mongodb.core.MongoOperations;
import org.springframework.data.mongodb.core.convert.MongoCustomConversions;
import com.antheminc.oss.nimbus.context.BeanResolverStrategy;
import com.antheminc.oss.nimbus.domain.config.builder.DomainConfigBuilder;
import com.antheminc.oss.nimbus.domain.defn.Repo;
import com.antheminc.oss.nimbus.domain.model.state.extension.ChangeLogCommandEventHandler;
import com.antheminc.oss.nimbus.domain.model.state.repo.ModelRepository;
import com.antheminc.oss.nimbus.domain.model.state.repo.ModelRepositoryFactory;
import com.antheminc.oss.nimbus.domain.model.state.repo.db.MongoDBModelRepositoryOptions;
import com.antheminc.oss.nimbus.domain.model.state.repo.db.MongoSearchByExampleOperation;
import com.antheminc.oss.nimbus.domain.model.state.repo.db.MongoSearchByQueryOperation;
import com.antheminc.oss.nimbus.domain.model.state.repo.db.mongo.DefaultMongoModelRepository;
import com.antheminc.oss.nimbus.support.mongo.MongoConvertersBuilder;
/**
* @author <NAME>
*
*/
@Configuration
// TODO replace with @ConditionalOnClass(MongoClient.class) once we separate out mongo into its own project
@ConditionalOnProperty("spring.data.mongodb.port")
@EnableMongoAuditing(dateTimeProviderRef="default.zdt.provider")
public class DefaultMongoConfig {
@Bean
public MongoCustomConversions defaultMongoCustomConversions() {
return new MongoConvertersBuilder().addDefaults().build();
}
@Bean(name="default.rep_mongodb")
public DefaultMongoModelRepository defaultMongoModelRepository(MongoOperations mongoOps, BeanResolverStrategy beanResolver, MongoDBModelRepositoryOptions options){
return new DefaultMongoModelRepository(mongoOps, beanResolver, options);
}
@Bean
public MongoDBModelRepositoryOptions defaultMongoDBModelRepositoryOptions(MongoOperations mongoOps, DomainConfigBuilder domainConfigBuilder) {
return MongoDBModelRepositoryOptions.builder()
.addSearchOperation(new MongoSearchByExampleOperation(mongoOps, domainConfigBuilder))
.addSearchOperation(new MongoSearchByQueryOperation(mongoOps, domainConfigBuilder))
.build();
}
@Bean
public ChangeLogCommandEventHandler changeLogCommandEventHandler(BeanResolverStrategy beanResolver, ModelRepositoryFactory modelRepositoryFactory) {
ModelRepository modelRepository = modelRepositoryFactory.get(Repo.Database.rep_mongodb);
return new ChangeLogCommandEventHandler(beanResolver, modelRepository);
}
}
|
RobNE/PyFlinkBachelorThesis2 | flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/consumer/UnionInputGateTest.java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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.apache.flink.runtime.io.network.partition.consumer;
import org.apache.flink.runtime.io.network.util.MockInputChannel;
import org.apache.flink.runtime.jobgraph.IntermediateDataSetID;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
public class UnionInputGateTest {
@Test
public void testChannelMapping() throws Exception {
final SingleInputGate ig1 = new SingleInputGate(new IntermediateDataSetID(), 0, 3);
final SingleInputGate ig2 = new SingleInputGate(new IntermediateDataSetID(), 0, 5);
final UnionInputGate union = new UnionInputGate(new SingleInputGate[]{ig1, ig2});
assertEquals(ig1.getNumberOfInputChannels() + ig2.getNumberOfInputChannels(), union.getNumberOfInputChannels());
final MockInputChannel[][] inputChannels = new MockInputChannel[][]{
MockInputChannel.createInputChannels(ig1, 3),
MockInputChannel.createInputChannels(ig2, 5)
};
inputChannels[0][0].readBuffer(); // 0 => 0
inputChannels[1][2].readBuffer(); // 2 => 5
inputChannels[1][0].readBuffer(); // 0 => 3
inputChannels[1][1].readBuffer(); // 1 => 4
inputChannels[0][1].readBuffer(); // 1 => 1
inputChannels[1][3].readBuffer(); // 3 => 6
inputChannels[0][2].readBuffer(); // 1 => 2
inputChannels[1][4].readBuffer(); // 4 => 7
assertEquals(0, union.getNextBufferOrEvent().getChannelIndex());
assertEquals(5, union.getNextBufferOrEvent().getChannelIndex());
assertEquals(3, union.getNextBufferOrEvent().getChannelIndex());
assertEquals(4, union.getNextBufferOrEvent().getChannelIndex());
assertEquals(1, union.getNextBufferOrEvent().getChannelIndex());
assertEquals(6, union.getNextBufferOrEvent().getChannelIndex());
assertEquals(2, union.getNextBufferOrEvent().getChannelIndex());
assertEquals(7, union.getNextBufferOrEvent().getChannelIndex());
}
}
|
dweng0/game | node_modules/@babylonjs/core/XR/webXRInputSource.js | import { Observable } from "../Misc/observable";
import { AbstractMesh } from "../Meshes/abstractMesh";
import { Quaternion, Vector3 } from "../Maths/math.vector";
import { WebXRMotionControllerManager } from "./motionController/webXRMotionControllerManager";
import { Tools } from "../Misc/tools";
var idCount = 0;
/**
* Represents an XR controller
*/
var WebXRInputSource = /** @class */ (function () {
/**
* Creates the input source object
* @see https://doc.babylonjs.com/how_to/webxr_controllers_support
* @param _scene the scene which the controller should be associated to
* @param inputSource the underlying input source for the controller
* @param _options options for this controller creation
*/
function WebXRInputSource(_scene,
/** The underlying input source for the controller */
inputSource, _options) {
var _this = this;
if (_options === void 0) { _options = {}; }
this._scene = _scene;
this.inputSource = inputSource;
this._options = _options;
this._tmpVector = new Vector3();
this._disposed = false;
/**
* Event that fires when the controller is removed/disposed.
* The object provided as event data is this controller, after associated assets were disposed.
* uniqueId is still available.
*/
this.onDisposeObservable = new Observable();
/**
* Will be triggered when the mesh associated with the motion controller is done loading.
* It is also possible that this will never trigger (!) if no mesh was loaded, or if the developer decides to load a different mesh
* A shortened version of controller -> motion controller -> on mesh loaded.
*/
this.onMeshLoadedObservable = new Observable();
/**
* Observers registered here will trigger when a motion controller profile was assigned to this xr controller
*/
this.onMotionControllerInitObservable = new Observable();
this._uniqueId = "controller-" + idCount++ + "-" + inputSource.targetRayMode + "-" + inputSource.handedness;
this.pointer = new AbstractMesh(this._uniqueId + "-pointer", _scene);
this.pointer.rotationQuaternion = new Quaternion();
if (this.inputSource.gripSpace) {
this.grip = new AbstractMesh(this._uniqueId + "-grip", this._scene);
this.grip.rotationQuaternion = new Quaternion();
}
this._tmpVector.set(0, 0, this._scene.useRightHandedSystem ? -1.0 : 1.0);
// for now only load motion controllers if gamepad object available
if (this.inputSource.gamepad) {
WebXRMotionControllerManager.GetMotionControllerWithXRInput(inputSource, _scene, this._options.forceControllerProfile).then(function (motionController) {
_this.motionController = motionController;
_this.onMotionControllerInitObservable.notifyObservers(motionController);
// should the model be loaded?
if (!_this._options.doNotLoadControllerMesh) {
_this.motionController.loadModel().then(function (success) {
var _a;
if (success && _this.motionController && _this.motionController.rootMesh) {
if (_this._options.renderingGroupId) {
// anything other than 0?
_this.motionController.rootMesh.renderingGroupId = _this._options.renderingGroupId;
_this.motionController.rootMesh.getChildMeshes(false).forEach(function (mesh) { return (mesh.renderingGroupId = _this._options.renderingGroupId); });
}
_this.onMeshLoadedObservable.notifyObservers(_this.motionController.rootMesh);
_this.motionController.rootMesh.parent = _this.grip || _this.pointer;
_this.motionController.disableAnimation = !!_this._options.disableMotionControllerAnimation;
}
// make sure to dispose is the controller is already disposed
if (_this._disposed) {
(_a = _this.motionController) === null || _a === void 0 ? void 0 : _a.dispose();
}
});
}
}, function () {
Tools.Warn("Could not find a matching motion controller for the registered input source");
});
}
}
Object.defineProperty(WebXRInputSource.prototype, "uniqueId", {
/**
* Get this controllers unique id
*/
get: function () {
return this._uniqueId;
},
enumerable: false,
configurable: true
});
/**
* Disposes of the object
*/
WebXRInputSource.prototype.dispose = function () {
if (this.grip) {
this.grip.dispose();
}
if (this.motionController) {
this.motionController.dispose();
}
this.pointer.dispose();
this.onMotionControllerInitObservable.clear();
this.onMeshLoadedObservable.clear();
this.onDisposeObservable.notifyObservers(this);
this.onDisposeObservable.clear();
this._disposed = true;
};
/**
* Gets a world space ray coming from the pointer or grip
* @param result the resulting ray
* @param gripIfAvailable use the grip mesh instead of the pointer, if available
*/
WebXRInputSource.prototype.getWorldPointerRayToRef = function (result, gripIfAvailable) {
if (gripIfAvailable === void 0) { gripIfAvailable = false; }
var object = gripIfAvailable && this.grip ? this.grip : this.pointer;
Vector3.TransformNormalToRef(this._tmpVector, object.getWorldMatrix(), result.direction);
result.direction.normalize();
result.origin.copyFrom(object.absolutePosition);
result.length = 1000;
};
/**
* Updates the controller pose based on the given XRFrame
* @param xrFrame xr frame to update the pose with
* @param referenceSpace reference space to use
*/
WebXRInputSource.prototype.updateFromXRFrame = function (xrFrame, referenceSpace) {
var pose = xrFrame.getPose(this.inputSource.targetRaySpace, referenceSpace);
// Update the pointer mesh
if (pose) {
var pos = pose.transform.position;
this.pointer.position.set(pos.x, pos.y, pos.z);
var orientation_1 = pose.transform.orientation;
this.pointer.rotationQuaternion.set(orientation_1.x, orientation_1.y, orientation_1.z, orientation_1.w);
if (!this._scene.useRightHandedSystem) {
this.pointer.position.z *= -1;
this.pointer.rotationQuaternion.z *= -1;
this.pointer.rotationQuaternion.w *= -1;
}
}
// Update the grip mesh if it exists
if (this.inputSource.gripSpace && this.grip) {
var pose_1 = xrFrame.getPose(this.inputSource.gripSpace, referenceSpace);
if (pose_1) {
var pos = pose_1.transform.position;
var orientation_2 = pose_1.transform.orientation;
this.grip.position.set(pos.x, pos.y, pos.z);
this.grip.rotationQuaternion.set(orientation_2.x, orientation_2.y, orientation_2.z, orientation_2.w);
if (!this._scene.useRightHandedSystem) {
this.grip.position.z *= -1;
this.grip.rotationQuaternion.z *= -1;
this.grip.rotationQuaternion.w *= -1;
}
}
}
if (this.motionController) {
// either update buttons only or also position, if in gamepad mode
this.motionController.updateFromXRFrame(xrFrame);
}
};
return WebXRInputSource;
}());
export { WebXRInputSource };
//# sourceMappingURL=webXRInputSource.js.map |
NifTK/NifTK | MITK/Modules/NVidiaSDIDataSourceService/Internal/niftkNVidiaSDIDataType.h | <reponame>NifTK/NifTK
/*=============================================================================
NifTK: A software platform for medical image computing.
Copyright (c) University College London (UCL). All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
See LICENSE.txt in the top level directory for details.
=============================================================================*/
#ifndef niftkNVidiaSDIDataType_h
#define niftkNVidiaSDIDataType_h
#include <niftkIGIDataType.h>
namespace niftk
{
/**
* \class NVidiaSDIDataType
* \brief Class to represent video frame data from NVidia SDI, to integrate within the niftkIGI framework.
*/
class NVidiaSDIDataType : public IGIDataType
{
public:
typedef unsigned long long NVidiaSDITimeType;
virtual ~NVidiaSDIDataType();
NVidiaSDIDataType(unsigned int, unsigned int, NVidiaSDITimeType);
NVidiaSDIDataType(const NVidiaSDIDataType&);
NVidiaSDIDataType(const NVidiaSDIDataType&&);
NVidiaSDIDataType& operator=(const NVidiaSDIDataType&);
NVidiaSDIDataType& operator=(const NVidiaSDIDataType&&);
unsigned int GetSequenceNumber() const;
unsigned int GetCookie() const;
virtual void Clone(const IGIDataType&) override;
private:
// Used internally to make sure this data item comes from a valid
// capture session. Otherwise what could happen is that when signal drops out (e.g. due to
// interference on the wire) the old capture context is destroyed and a new one is created
// (fairly quickly) but any in-flight NVidiaSDIDataType hanging around in the IGIDataSourceManager
// might still reference the previous one.
unsigned int m_MagicCookie;
// SDI sequence number. Starts counting at 1 and increases for every set of captured images.
unsigned int m_SequenceNumber;
// The SDI card keeps a time stamp for each frame coming out of the wire.
// This is in some arbitrary unit (nanoseconds?) in reference to some arbitrary clock.
NVidiaSDITimeType m_GpuArrivalTime;
};
} // end namespace
#endif
|
akash58/Hops | modules/foodexpirys/client/config/foodexpirys.client.routes.js | <filename>modules/foodexpirys/client/config/foodexpirys.client.routes.js
'use strict';
// Setting up route
angular.module('foodexpirys').config(['$stateProvider',
function($stateProvider) {
// Foods state routing
$stateProvider.
state('listFoodExpirys', {
url: '/foodexpirys',
templateUrl: 'modules/foodexpirys/client/views/foodexpirys.client.view.html'
});
}
]);
|
vadimkorr/react-native-notifications-system | App.js | import React from "react";
import { Routing } from "./src/Routing";
import { configure } from "mobx";
configure({
enforceActions: "observed"
});
const App = () => <Routing />;
export default App;
|
jonchan51/main | src/main/java/seedu/weme/storage/JsonSerializableRecords.java | <gh_stars>1-10
package seedu.weme.storage;
import java.util.HashSet;
import java.util.Set;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonRootName;
import seedu.weme.commons.exceptions.IllegalValueException;
import seedu.weme.model.records.Records;
import seedu.weme.model.records.RecordsManager;
/**
* An Immutable Records that is serializable to JSON format.
*/
@JsonRootName(value = "records")
public class JsonSerializableRecords {
private Set<String> pathRecords = new HashSet<>();
private Set<String> descriptionRecords = new HashSet<>();
private Set<String> tagRecords = new HashSet<>();
private Set<String> nameRecords = new HashSet<>();
private Set<String> textRecords = new HashSet<>();
/**
* Constructs a {@code JsonSerializableRecords} with the given records details.
*/
@JsonCreator
public JsonSerializableRecords(@JsonProperty("pathRecords") Set<String> pathRecords,
@JsonProperty("descriptionRecords") Set<String> descriptionRecords,
@JsonProperty("tagRecords") Set<String> tagRecords,
@JsonProperty("nameRecords") Set<String> nameRecords,
@JsonProperty("textRecords") Set<String> textRecords) {
this.pathRecords.addAll(pathRecords);
this.descriptionRecords.addAll(descriptionRecords);
this.tagRecords.addAll(tagRecords);
this.nameRecords.addAll(nameRecords);
this.textRecords.addAll(textRecords);
}
/**
* Converts a given {@code Records} into this class for Jackson use.
*/
public JsonSerializableRecords(Records records) {
pathRecords.addAll(records.getPaths());
descriptionRecords.addAll(records.getDescriptions());
tagRecords.addAll(records.getTags());
nameRecords.addAll(records.getNames());
textRecords.addAll(records.getTexts());
}
/**
* Converts this serializable records object into the model's {@code Records} object.
*
* @throws IllegalValueException if there were any data constraints violated in the serializable records.
*/
public Records toModelType() throws IllegalValueException {
Set<String> pathRecords = new HashSet<>();
Set<String> descriptionRecords = new HashSet<>();
Set<String> tagRecords = new HashSet<>();
Set<String> nameRecords = new HashSet<>();
Set<String> textRecords = new HashSet<>();
pathRecords.addAll(this.pathRecords);
descriptionRecords.addAll(this.descriptionRecords);
tagRecords.addAll(this.tagRecords);
nameRecords.addAll(this.nameRecords);
textRecords.addAll(this.textRecords);
return new RecordsManager(pathRecords, descriptionRecords, tagRecords, nameRecords, textRecords);
}
}
|
liuzikai/klc3 | include/klee/Statistics/TimerStatIncrementer.h | <reponame>liuzikai/klc3
//===-- TimerStatIncrementer.h ----------------------------------*- C++ -*-===//
//
// The KLEE Symbolic Virtual Machine
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef KLEE_TIMERSTATINCREMENTER_H
#define KLEE_TIMERSTATINCREMENTER_H
#include "klee/Statistics/Statistics.h"
#include "klee/Support/Timer.h"
namespace klee {
/**
* A TimerStatIncrementer adds its lifetime to a specified Statistic.
*/
class TimerStatIncrementer {
private:
const WallTimer timer;
Statistic &statistic;
public:
explicit TimerStatIncrementer(Statistic &statistic) : statistic(statistic) {}
~TimerStatIncrementer() {
// record microseconds
statistic += timer.delta().toMicroseconds();
}
time::Span delta() const { return timer.delta(); }
};
}
#endif /* KLEE_TIMERSTATINCREMENTER_H */
|
ansumandas441/Data-Structures-and-Algorithms | Java/soln-array-problems/shortest-unsorted-continuous-subarray.java | <reponame>ansumandas441/Data-Structures-and-Algorithms<filename>Java/soln-array-problems/shortest-unsorted-continuous-subarray.java
/**
@author <NAME>
Reference-
https://leetcode.com/problems/shortest-unsorted-continuous-subarray
*/
import java.util.*;
import java.lang.*;
import java.io.*;
class Solution {
public int findUnsortedSubarray(int[] nums) {
int min=Integer.MAX_VALUE;
int max=Integer.MIN_VALUE;
for(int i=1;i<nums.length;i++){
//Decreasing value
if(nums[i]<nums[i-1])
min=Math.min(min,nums[i]);
}
for(int i=nums.length-2;i>=0;i--){
//Increasing value
if(nums[i]>nums[i+1])
max=Math.max(max,nums[i]);
}
int i,j;
for(i=0;i<nums.length;i++){
if(min<nums[i])
break;
}
for(j=nums.length-1;j>=0;j--){
if(max>nums[j])
break;
}
return j-i<0?0:j-i+1;
}
} |
kdubb/amf | amf-webapi/shared/src/main/scala/amf/plugins/domain/shapes/models/UnresolvedShape.scala | package amf.plugins.domain.shapes.models
import amf.core.metamodel.Field
import amf.core.metamodel.domain.ModelDoc
import amf.core.model.domain.{AmfScalar, DomainElement, Linkable, Shape}
import amf.core.parser.{Annotations, Fields, UnresolvedReference}
import amf.plugins.document.webapi.parser.spec.common.ShapeExtensionParser
import amf.plugins.domain.shapes.metamodel.AnyShapeModel
import org.yaml.model.{YNode, YPart}
import scala.collection.mutable
/**
* Unresolved shape: intended to be resolved after parsing (exception is thrown if shape is not resolved).
*/
case class UnresolvedShape(override val fields: Fields,
override val annotations: Annotations,
override val reference: String,
fatherExtensionParser: Option[Option[String] => ShapeExtensionParser] = None,
updateFatherLink: Option[String => Unit] = None,
override val shouldLink: Boolean = true)
extends AnyShape(fields, annotations)
with UnresolvedReference {
override def linkCopy(): AnyShape = this
/*
override def withId(newId: String): this.type = {
if (id == null) super.withId(newId)
this
}
*/
override private[amf] def link[T](label: AmfScalar, annotations: Annotations, fieldAnn: Annotations): T =
this.asInstanceOf[T]
/** Resolve [[UnresolvedShape]] as link to specified target. */
def resolve(target: Shape): Shape =
target
.link(AmfScalar(reference), annotations, Annotations.synthesized())
.asInstanceOf[Shape]
.withName(name.value())
override val meta: AnyShapeModel = new AnyShapeModel {
override def fields: List[Field] = AnyShapeModel.fields
override val doc: ModelDoc = AnyShapeModel.doc
override def modelInstance: UnresolvedShape = UnresolvedShape(Fields(), Annotations(), reference = reference)
}
override def ramlSyntaxKey: String = "unresolvedShape"
/** Value , path + field value that is used to compose the id when the object its adopted */
override def componentId: String = "/unresolved"
override def afterResolve(fatherSyntaxKey: Option[String], resolvedKey: String): Unit = {
fatherExtensionParser.foreach { parser =>
parser(fatherSyntaxKey).parse()
}
updateFatherLink.foreach(f => f(resolvedKey))
}
// if is unresolved the effective target its himselft, because any real type has been found.
override def effectiveLinkTarget(links: Seq[String] = Seq()): UnresolvedShape = this
/** apply method for create a new instance with fields and annotations. Aux method for copy */
override protected def classConstructor: (Fields, Annotations) => Linkable with DomainElement =
(fields: Fields, annotations: Annotations) =>
new UnresolvedShape(fields, annotations, reference, fatherExtensionParser)
}
object UnresolvedShape {
def apply(reference: String): UnresolvedShape = apply(reference, Annotations(), None)
def apply(reference: String,
ast: YPart,
extensionParser: Option[Option[String] => ShapeExtensionParser]): UnresolvedShape =
apply(reference, Annotations(ast), extensionParser)
def apply(reference: String, ast: YPart): UnresolvedShape = apply(reference, Annotations(ast), None)
def apply(reference: String, ast: Option[YPart]): UnresolvedShape =
apply(reference, Annotations(ast.getOrElse(YNode.Null)), None)
def apply(reference: String,
annotations: Annotations,
extensionParser: Option[Option[String] => ShapeExtensionParser]): UnresolvedShape =
UnresolvedShape(Fields(), annotations, reference, extensionParser)
def apply(reference: String, annotations: Annotations): UnresolvedShape =
UnresolvedShape(Fields(), annotations, reference, None)
}
|
nanthakumar1305/incubator-hop | plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/core/data/GraphNodeData.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.apache.hop.neo4j.core.data;
import org.apache.hop.core.Const;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.neo4j.driver.Value;
import org.neo4j.driver.types.Node;
import java.util.ArrayList;
import java.util.List;
public class GraphNodeData {
protected String id;
protected List<String> labels;
protected List<GraphPropertyData> properties;
protected String propertySetId;
public GraphNodeData() {
labels = new ArrayList<>();
properties = new ArrayList<>();
}
public GraphNodeData(String id) {
this();
this.id = id;
}
public GraphNodeData(String id, List<String> labels, List<GraphPropertyData> properties) {
this.id = id;
this.labels = labels;
this.properties = properties;
}
public GraphNodeData(Node node) {
this();
this.id = Long.toString(node.id());
StringBuilder propertySet = new StringBuilder();
for (String label : node.labels()) {
labels.add(label);
if (propertySet.length() > 0) {
propertySet.append(",");
}
propertySet.append(label);
}
for (String propertyKey : node.keys()) {
Value propertyValue = node.get(propertyKey);
Object propertyObject = propertyValue.asObject();
GraphPropertyDataType propertyType =
GraphPropertyDataType.getTypeFromNeo4jValue(propertyObject);
properties.add(new GraphPropertyData(propertyKey, propertyObject, propertyType, false));
}
this.propertySetId = propertySet.toString();
}
public GraphNodeData(GraphNodeData graphNode) {
this();
setId(graphNode.getId());
// Copy labels
setLabels(new ArrayList<>(graphNode.getLabels()));
// Copy properties
List<GraphPropertyData> propertiesCopy = new ArrayList<>();
for (GraphPropertyData property : graphNode.getProperties()) {
GraphPropertyData propertyCopy =
new GraphPropertyData(
property.getId(), property.getValue(), property.getType(), property.isPrimary());
propertiesCopy.add(propertyCopy);
}
setProperties(propertiesCopy);
setPropertySetId(graphNode.getPropertySetId());
}
public JSONObject toJson() {
JSONObject jNode = new JSONObject();
jNode.put("id", id);
jNode.put("labels", labels);
JSONArray jProperties = new JSONArray();
jNode.put("properties", jProperties);
for (GraphPropertyData property : properties) {
jProperties.add(property.toJson());
}
jNode.put("property_set", propertySetId);
return jNode;
}
public GraphNodeData(JSONObject jNode) {
id = (String) jNode.get("id");
JSONArray jLabels = (JSONArray) jNode.get("labels");
for (int i = 0; i < jLabels.size(); i++) {
labels.add((String) jLabels.get(i));
}
JSONArray jProperties = (JSONArray) jNode.get("properties");
for (int i = 0; i < jProperties.size(); i++) {
properties.add(new GraphPropertyData((JSONObject) jProperties.get(i)));
}
propertySetId = (String) jNode.get("property_set");
}
public GraphNodeData clone() {
return new GraphNodeData(this);
}
@Override
public String toString() {
return id == null ? super.toString() : id;
}
@Override
public boolean equals(Object o) {
if (o == null) {
return false;
}
if (!(o instanceof GraphNodeData)) {
return false;
}
if (o == this) {
return true;
}
return ((GraphNodeData) o).getId().equals(id);
}
/**
* Search for the property with the given ID, case insensitive
*
* @param id the name of the property to look for
* @return the property or null if nothing could be found.
*/
public GraphPropertyData findProperty(String id) {
for (GraphPropertyData property : properties) {
if (property.getId().equalsIgnoreCase(id)) {
return property;
}
}
return null;
}
/**
* Find a String property called name
*
* @return the name property string or if not available, the ID
*/
public String getName() {
GraphPropertyData nameProperty = findProperty("name");
if (nameProperty == null || nameProperty.getValue() == null) {
return id;
}
return nameProperty.getValue().toString();
}
public String getNodeText() {
String nodeText = getName() + Const.CR;
GraphPropertyData typeProperty = findProperty("type");
if (typeProperty != null && typeProperty.getValue() != null) {
nodeText += typeProperty.getValue().toString();
}
if (labels.size() > 0) {
nodeText += " (:" + labels.get(0) + ")";
}
return nodeText;
}
/**
* Gets id
*
* @return value of id
*/
public String getId() {
return id;
}
/** @param id The id to set */
public void setId(String id) {
this.id = id;
}
/**
* Gets labels
*
* @return value of labels
*/
public List<String> getLabels() {
return labels;
}
/** @param labels The labels to set */
public void setLabels(List<String> labels) {
this.labels = labels;
}
/**
* Gets properties
*
* @return value of properties
*/
public List<GraphPropertyData> getProperties() {
return properties;
}
/** @param properties The properties to set */
public void setProperties(List<GraphPropertyData> properties) {
this.properties = properties;
}
/**
* Gets propertySetId
*
* @return value of propertySetId
*/
public String getPropertySetId() {
return propertySetId;
}
/** @param propertySetId The propertySetId to set */
public void setPropertySetId(String propertySetId) {
this.propertySetId = propertySetId;
}
}
|
Letsmoe/snowblind | src/@snowblind-testing/test/main.spec.js | // test/sub.spec.js
import {describe, it, expect, afterEach, beforeEach, afterAll, beforeAll} from "../dist/testing.min.js";
import {add} from "./importmodule.js";
describe("every matching condition", () => {
it("tests the `toBe` property", () => {
expect(expect(true, false).toBe(true).result).toBe(true);
expect(expect(false, false).toBe(true).result).toBe(false)
})
it("tests the `toEqual` property", () => {
expect(expect("Hey", false).toEqual("Hey").result).toBe(true)
expect(expect("Hey", false).toEqual("Nice").result).toBe(false)
})
it("check whether a value is truthy", () => {
expect(expect(1, false).toBeTruthy().result).toBe(true)
expect(expect(0, false).toBeTruthy().result).toBe(false)
})
it("checks whether a value is falsy", () => {
expect(expect("", false).toBeFalsy().result).toBe(true)
expect(expect("awd", false).toBeFalsy().result).toBe(false)
})
it("tests if a number is x digits close to another", () => {
expect(expect(4.02, false).closeTo(4, 1).result).toBe(true)
expect(expect(-24.005, false).closeTo(12.5, 1).result).toBe(false)
})
})
describe("test add functions", () => {
it("should return 4", () => {
expect(add(2,2)).toBe(4)
expect(add(2,3)).to(x => x == 5)
})
})
describe("Asynchronous thread handling", () => {
it("should resolve asynchronously", () => {
expect(new Promise((resolve, reject) => {
setTimeout(() => {
resolve(1)
}, 500)
})).resolves.toBe(1);
expect(new Promise((resolve, reject) => {
setTimeout(() => {
resolve({hello: "nice"})
}, 500)
})).resolves.toEqual({hello: "nice"});
})
})
describe("In document?", () => {
it("should be in the document", () => {
let element = document.createElement("span");
document.body.appendChild(element)
expect(element).toBeIn(document.body)
})
}) |
Kertf22/social_media_front | src/components/Profile/Profile.js | <filename>src/components/Profile/Profile.js
import { useContext, useEffect, useRef, useState } from "react"
import { AuthContext } from "../../context/AuthContext"
import { api } from "../../services/api"
import { Nav } from "../Nav/Nav"
import Post from "../Post/Post"
import Link from "next/link"
import { Main,ProfileContent,ProfileWarp, UserInfo,UserInfoWrap, UserImg, UseText,EndText,ChangePhoto,ChangePhotoButton } from "./ProfileStyle"
import { Posts } from "../Lobby/LobbyStyle"
import Image from 'next/image'
import ImageDrop from "../ImageDrop/ImageDrop"
export default function Profile({existUser,userProfile,first_posts}) {
// Para ter apenas os post do usuário
const { user, Disconnect, UserPost, ChagePhoto} = useContext(AuthContext)
// Verificação se o usuário procurado existe
if(!existUser){
return(
<>
<Main>
<Nav user={user} Disconnect={Disconnect}/>
<ProfileContent>
<h1>User not Found</h1>
</ProfileContent>
</Main>
</>
)
}
//Implementação do Scroll Infinito
const [posts, setPosts] = useState(first_posts);
const [currentPage, setCurrentPage] = useState(1);
const [hasEndingPosts, setHasEndingPosts] = useState(false);
const loadRef = useRef(null);
useEffect(() => {
const options = {
root: null,
rootMargin: "20px",
threshold: 1.0
}
// Definindo o Observador
const observer = new IntersectionObserver((entities) => {
const target = entities[0];
if (target.isIntersecting){
setCurrentPage(old => old + 1);
}
},options);
if (loadRef.current){
observer.observe(loadRef.current);
}
},[])
// Pegando mais posts
useEffect(() => {
const handleRequest = async () => {
const data = await UserPost(userProfile.id,currentPage, 4);
if (!data.length){
setHasEndingPosts(true);
return;
};
setPosts([...posts,...data]);
};
handleRequest();
},[currentPage]);
const date = new Date(userProfile?.created_at);
let dateTime = `${date.getDay()}/${date.getMonth()}/${date.getFullYear()}`;
const [displayDrop,setDisplayDrop] = useState(false);
const DisplayImageDrop = () => {
console.log(displayDrop)
setDisplayDrop(!displayDrop)
}
const reciveFile = async (state) => {
try {
await ChagePhoto(user._id,state)
} catch (error) {
handleError(error)
}
}
const handleParantCallBack = (closeButtonPress) => {
setDisplayDrop(closeButtonPress)
}
const [error,setError] = useState(false);
const [errorMesage,setErrorMesage] = useState();
const handleError = (err) => {
setError(true);
setErrorMesage(err.message);
setTimeout(() => {
setError(false);
},2000);
}
return (
<Main>
<Nav user={user} Disconnect={Disconnect}/>
<ImageDrop buttonPress={displayDrop} parentCallBack={handleParantCallBack} reciveFile={reciveFile}/>
<ProfileContent>
<ProfileWarp>
<UserInfo>
<UserInfoWrap>
<UserImg>
<img src={userProfile.imgUrl} />
</UserImg>
<UseText>
<h1>{userProfile.name}</h1>
<h2>Numero de Post: {userProfile.posts}</h2>
<p>Perfil criado em: {dateTime}</p>
</UseText>
</UserInfoWrap>
{user?._id == userProfile._id ? <ChangePhoto onClick={DisplayImageDrop}>
<ChangePhotoButton>Edite Profile</ChangePhotoButton>
</ChangePhoto> :<></>}
</UserInfo>
<Posts>
<h1>Posts</h1>
{
posts?.length == 0
? <h1>There isn't any post available</h1> // Lógica de exclusão
: posts?.map(post => (
<Post post={post} user={user} key={post._id}/>))
//
}
{hasEndingPosts ? <EndText>There isn't any more post available</EndText> : <EndText ref={loadRef}>Loading more posts...</EndText>}
</Posts>
</ProfileWarp>
</ProfileContent>
</Main>
)
}
|
minluzhou/test1 | core/src/main/java/com/ctrip/xpipe/cluster/DefaultLeaderElectorManager.java | package com.ctrip.xpipe.cluster;
import com.ctrip.xpipe.api.cluster.LeaderElector;
import com.ctrip.xpipe.api.cluster.LeaderElectorManager;
import com.ctrip.xpipe.api.lifecycle.Ordered;
import com.ctrip.xpipe.api.lifecycle.TopElement;
import com.ctrip.xpipe.lifecycle.AbstractLifecycle;
import com.ctrip.xpipe.zk.ZkClient;
/**
* @author marsqing
*
* Jun 17, 2016 4:53:49 PM
*/
public class DefaultLeaderElectorManager extends AbstractLifecycle implements LeaderElectorManager, TopElement {
private ZkClient zkClient;
public DefaultLeaderElectorManager(ZkClient zkClient) {
this.zkClient = zkClient;
}
@Override
public LeaderElector createLeaderElector(ElectContext ctx) {
return new DefaultLeaderElector(ctx, zkClient.get());
}
@Override
public int getOrder() {
return Ordered.HIGHEST_PRECEDENCE;
}
}
|
JayV254/School-Projects | CS216PA3/Graph.cpp | <reponame>JayV254/School-Projects
// It provides the implementation of the Graph class
#include <list> // create a queue from a list
#include <queue>
#include <cassert>
#include <set>
#include <list>
#include "Graph.h"
// default constructor
Graph::Graph(int numVertices):adj(Matrix<int>(numVertices, numVertices, -1))
{
}
bool Graph::hasEdge(int v, int w)
{
assert(v>=0 && v < adj.GetSizeX() && w >=0 && w < adj.GetSizeX());
if (adj(v, w)==-1)
return false;
return true;
}
// Please provide your implementation
// for the following three member functions
void Graph::addEdge(int v, int w, int edge)
{
adj(v,w) = edge;
adj(w,v) = edge;
}
int Graph::getEdge(int v, int w)
{
return adj(v,w);
}
void Graph::BFS(int s, vector<int>& distance, vector<int>& go_through)
{
int Vertices = distance.size();
bool *visited = new bool[Vertices];
for(int i=0; i < Vertices; i++)
{
visited[i] = false;
}
list <int> queue;
visited[s] = true;
distance[s] = 0;
queue.push_back(s);
go_through[s] = 0;
while(!queue.empty())
{
int current = queue.front();
queue.pop_front();
for(int n = 0; n< distance.size(); n++)
{
if(!visited[n] && adj(current, n) != -1)
{
visited[n] = true;
queue.push_back(n);
go_through[n] = current;
distance[n] = distance[current] + 1;
}
}
}
}
|
Celina-Hadjara/MAPC | src/src/TD3/visiteurs/commandes/XMLRapportCommandes.java | package TD3.visiteurs.commandes;
import TD3.visiteurs.PrePostVisitor;
public class XMLRapportCommandes implements PrePostVisitor {
public XMLRapportCommandes() {
}
@Override
public void preVisit(GroupeClient t) {
}
@Override
public void preVisit(Client t) {
}
@Override
public void preVisit(Commande t) {
}
@Override
public void preVisit(Ligne t) {
}
@Override
public void postVisit(Commande commande) {
}
}
|
rpg711/cs403-semester-project | 3rd-party-libs/NITE-Bin-Dev-Linux-x64-v1.5.2.23/Include/XnVBroadcaster.h | /*******************************************************************************
* *
* PrimeSense NITE 1.3 *
* Copyright (C) 2010 PrimeSense Ltd. *
* *
*******************************************************************************/
#ifndef _XNV_BROADCASTER_H_
#define _XNV_BROADCASTER_H_
#include "XnVFilter.h"
/**
* A XnVBroadcast is a specific Filter, which sends the messages it receives to its listeners, unchanged.
*/
class XNV_NITE_API XnVBroadcaster :
public XnVFilter
{
public:
/**
* Constructor. Create a new Broadcaster
*
* @param [in] strName Name of the control, for log purposes.
*/
XnVBroadcaster(const XnChar* strName = "Broadcaster");
/**
* Send all received messages to listeners.
*
* @param [in] pMessage The message to handle
*/
void Update(XnVMessage* pMessage);
};
#endif // _XNV_BROADCASTER_H_
|
MirahImage/bosh-bootloader | storage/migrator.go | package storage
import (
"encoding/json"
"fmt"
"path/filepath"
"reflect"
"github.com/cloudfoundry/bosh-bootloader/fileio"
)
type store interface {
Set(state State) error
GetVarsDir() (string, error)
GetTerraformDir() (string, error)
GetOldBblDir() string
GetCloudConfigDir() (string, error)
}
type migratorFs interface {
fileio.Renamer
fileio.FileReader
fileio.DirReader
fileio.Stater
fileio.FileWriter
fileio.Remover
fileio.AllRemover
}
type Migrator struct {
store store
fs migratorFs
}
func NewMigrator(store store, fs migratorFs) Migrator {
return Migrator{store: store, fs: fs}
}
func (m Migrator) Migrate(state State) (State, error) {
if reflect.DeepEqual(state, State{}) {
return state, nil
}
varsDir, err := m.store.GetVarsDir()
if err != nil {
return State{}, fmt.Errorf("migrating state: %s", err)
}
state, err = m.MigrateTerraformState(state, varsDir)
if err != nil {
return State{}, err
}
terraformDir, err := m.store.GetTerraformDir()
if err != nil {
return State{}, fmt.Errorf("migrating terraform: %s", err)
}
err = m.MigrateTerraformTemplate(terraformDir)
if err != nil {
return State{}, err
}
state, err = m.MigrateDirectorState(state, varsDir)
if err != nil {
return State{}, err
}
state, err = m.MigrateJumpboxState(state, varsDir)
if err != nil {
return State{}, err
}
bblDir := m.store.GetOldBblDir()
cloudConfigDir, err := m.store.GetCloudConfigDir()
if err != nil {
return State{}, fmt.Errorf("getting cloud-config dir: %s", err)
}
err = m.MigrateCloudConfigDir(bblDir, cloudConfigDir)
if err != nil {
return State{}, err
}
err = m.MigrateTerraformVars(varsDir)
if err != nil {
return State{}, err
}
state, err = m.MigrateDirectorVars(state, varsDir)
if err != nil {
return State{}, err
}
err = m.MigrateDirectorVarsFile(varsDir)
if err != nil {
return State{}, err
}
state, err = m.MigrateJumpboxVars(state, varsDir)
if err != nil {
return State{}, err
}
err = m.MigrateJumpboxVarsFile(varsDir)
if err != nil {
return State{}, err
}
err = m.store.Set(state)
if err != nil {
return State{}, fmt.Errorf("saving migrated state: %s", err)
}
return state, nil
}
func (m Migrator) MigrateTerraformState(state State, varsDir string) (State, error) {
if state.TFState != "" {
err := m.fs.WriteFile(filepath.Join(varsDir, "terraform.tfstate"), []byte(state.TFState), StateMode)
if err != nil {
return State{}, fmt.Errorf("migrating terraform state: %s", err)
}
state.TFState = ""
}
return state, nil
}
func (m Migrator) MigrateTerraformTemplate(terraformDir string) error {
oldTemplatePath := filepath.Join(terraformDir, "template.tf")
_, err := m.fs.Stat(oldTemplatePath)
if err == nil {
err = m.fs.Rename(oldTemplatePath, filepath.Join(terraformDir, "bbl-template.tf"))
if err != nil {
return fmt.Errorf("migrating terraform template: %s", err)
}
}
return nil
}
func (m Migrator) migrateStateFile(state map[string]interface{}, deployment, varsDir string) error {
if len(state) > 0 {
stateJSON, err := json.Marshal(state)
if err != nil {
return fmt.Errorf("marshalling %s state: %s", deployment, err)
}
err = m.fs.WriteFile(filepath.Join(varsDir, fmt.Sprintf("%s-state.json", deployment)), stateJSON, StateMode)
if err != nil {
return fmt.Errorf("migrating %s state: %s", deployment, err)
}
}
return nil
}
func (m Migrator) MigrateDirectorState(state State, varsDir string) (State, error) {
err := m.migrateStateFile(state.BOSH.State, "bosh", varsDir)
if err != nil {
return State{}, err
}
state.BOSH.State = nil
return state, nil
}
func (m Migrator) MigrateJumpboxState(state State, varsDir string) (State, error) {
err := m.migrateStateFile(state.Jumpbox.State, "jumpbox", varsDir)
if err != nil {
return State{}, err
}
state.Jumpbox.State = nil
return state, nil
}
func (m Migrator) MigrateCloudConfigDir(bblDir, cloudConfigDir string) error {
if _, err := m.fs.Stat(bblDir); err == nil {
oldCloudConfigDir := filepath.Join(bblDir, "cloudconfig")
files, err := m.fs.ReadDir(oldCloudConfigDir)
if err != nil {
return fmt.Errorf("reading legacy .bbl dir contents: %s", err)
}
for _, file := range files {
oldFile := filepath.Join(oldCloudConfigDir, file.Name())
oldFileContent, err := m.fs.ReadFile(oldFile)
if err != nil {
return fmt.Errorf("reading %s: %s", oldFile, err)
}
newFile := filepath.Join(cloudConfigDir, file.Name())
err = m.fs.WriteFile(newFile, oldFileContent, StateMode)
if err != nil {
return fmt.Errorf("migrating %s to %s: %s", oldFile, newFile, err)
}
}
err = m.fs.RemoveAll(m.store.GetOldBblDir())
if err != nil {
return fmt.Errorf("removing legacy .bbl dir: %s", err)
}
}
return nil
}
func (m Migrator) MigrateTerraformVars(varsDir string) error {
tfVarsPath := filepath.Join(varsDir, "terraform.tfvars")
bblVarsPath := filepath.Join(varsDir, "bbl.tfvars")
if _, err := m.fs.Stat(tfVarsPath); err == nil {
err = m.fs.Rename(tfVarsPath, bblVarsPath)
if err != nil {
return fmt.Errorf("migrating tfvars: %s", err)
}
}
return nil
}
func (m Migrator) burnAfterReadingLegacyVarsStore(varsDir, deployment string) (string, error) {
legacyVarsStore := filepath.Join(varsDir, fmt.Sprintf("%s-variables.yml", deployment))
if _, err := m.fs.Stat(legacyVarsStore); err == nil {
boshVars, err := m.fs.ReadFile(legacyVarsStore)
if err != nil {
return "", fmt.Errorf("reading legacy %s vars store: %s", deployment, err)
}
if err := m.fs.Remove(legacyVarsStore); err != nil {
return "", fmt.Errorf("removing legacy %s vars store: %s", deployment, err) //not tested
}
return string(boshVars), nil
} else {
return "", nil
}
}
func (m Migrator) MigrateDirectorVars(state State, varsDir string) (State, error) {
err := m.migrateVarsStore(state.BOSH.Variables, "director", varsDir)
if err != nil {
return State{}, err
}
state.BOSH.Variables = ""
return state, nil
}
func (m Migrator) MigrateJumpboxVars(state State, varsDir string) (State, error) {
err := m.migrateVarsStore(state.Jumpbox.Variables, "jumpbox", varsDir)
if err != nil {
return State{}, err
}
state.Jumpbox.Variables = ""
return state, nil
}
func (m Migrator) migrateVarsStore(variables, deployment, varsDir string) error {
boshVars, err := m.burnAfterReadingLegacyVarsStore(varsDir, deployment)
if err != nil {
return err
}
if variables == "" {
variables = boshVars
}
if variables != "" {
err := m.fs.WriteFile(filepath.Join(varsDir, fmt.Sprintf("%s-vars-store.yml", deployment)), []byte(variables), StateMode)
if err != nil {
return fmt.Errorf("migrating %s variables: %s", deployment, err)
}
}
return nil
}
func (m Migrator) MigrateDirectorVarsFile(varsDir string) error {
deploymentVarsPath := filepath.Join(varsDir, "director-deployment-vars.yml")
varsFilePath := filepath.Join(varsDir, "director-vars-file.yml")
if _, err := m.fs.Stat(deploymentVarsPath); err == nil {
err = m.fs.Rename(deploymentVarsPath, varsFilePath)
if err != nil {
return fmt.Errorf("migrating director vars file: %s", err)
}
}
return nil
}
func (m Migrator) MigrateJumpboxVarsFile(varsDir string) error {
deploymentVarsPath := filepath.Join(varsDir, "jumpbox-deployment-vars.yml")
varsFilePath := filepath.Join(varsDir, "jumpbox-vars-file.yml")
if _, err := m.fs.Stat(deploymentVarsPath); err == nil {
err = m.fs.Rename(deploymentVarsPath, varsFilePath)
if err != nil {
return fmt.Errorf("migrating jumpbox vars file: %s", err)
}
}
return nil
}
|
lynchnf/trash | src/main/java/norman/trash/service/AcctNbrService.java | <reponame>lynchnf/trash
package norman.trash.service;
import norman.trash.domain.AcctNbr;
import norman.trash.domain.repository.AcctNbrRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class AcctNbrService {
private static final Logger LOGGER = LoggerFactory.getLogger(AcctNbrService.class);
@Autowired
private AcctNbrRepository repository;
public List<AcctNbr> findByAcctOfxFidAndNumber(String ofxFid, String number) {
return repository.findByAcct_OfxFidAndNumber(ofxFid, number);
}
}
|
manuanish/bon5r | components/home/ResponsiveDesign.js | <reponame>manuanish/bon5r
import { TypographyIcon } from "@primer/octicons-react";
export default function ResponsiveDesign() {
return (
<div className="z-50">
<div className="p-20 bg-transparent bg-gradient-to-t from-slate-900 via-slate-900 to-transparent w-full shadow-2xl">
<div className="p-8 rounded-full mt-20 text-pink-700 bg-pink-400 w-fit mb-10 border-4 border-pink-600">
<TypographyIcon size={30} />
</div>
<h2 className="font-semibold text-pink-400 text-left max-w-[510px]">
Mobile-first
</h2>
<p className="mt-4 text-3xl sm:text-4xl font-extrabold tracking-tight text-slate-50 text-left max-w-[510px] z-50">
Responsive Design
</p>
<p className="mt-4 space-y-6 text-slate-500 text-left max-w-[510px] z-50">
Get your personal website up and running without learning any new
code.
</p>
<a
className="group inline-flex items-center h-9 rounded-full text-sm font-semibold whitespace-nowrap px-3 focus:outline-none focus:ring-2 bg-slate-700 text-slate-100 hover:bg-slate-600 hover:text-white focus:ring-slate-500 mt-8"
href="/docs/getting-started/installation"
>
Learn more<span className="sr-only"></span>
<svg
className="overflow-visible ml-3 text-slate-500 group-hover:text-slate-400"
width="3"
height="6"
viewBox="0 0 3 6"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
>
<path d="M0 0L3 3L0 6"></path>
</svg>
</a>
<div className="md:p-20 pt-10 md:flex md:justify-evenly w-full mt-10 overflow-x-hidden"></div>
</div>
<div className="border-b border-slate-700 opacity-50"></div>
</div>
);
}
|
vero-zhang/cut | src/cut/hook/concept/BeforeAllHook.cpp | #include <cut/hook/concept/BeforeAllHook.h>
#include <cut/hook/runtime/Runtime.h>
#include <cut/hook/registry/HookRegistries.h>
CUT_NS_BEGIN
BeforeAllHook::BeforeAllHook()
{
RUNTIME(BeforeAllHookRegistry).add(*this);
}
CUT_NS_END
|
dm-drogeriemarkt/mail2blog-base | src/test/java/ut/de/dm/mail2blog/base/SpaceExtractionTest.java | <reponame>dm-drogeriemarkt/mail2blog-base
package ut.de.dm.mail2blog.base;
import de.dm.mail2blog.base.*;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.junit.MockitoJUnitRunner;
import javax.mail.Address;
import javax.mail.Message;
import javax.mail.internet.InternetAddress;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.TimeoutException;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@RunWith(MockitoJUnitRunner.class)
public class SpaceExtractionTest {
SpaceExtractor spaceExtractor;
@Before
public void setUp() throws Exception
{
// Create spaceKeyExtractor.
spaceExtractor = new SpaceExtractor(new ISpaceKeyValidator() {
public boolean spaceExists(String spaceKey) {
return true;
}
});
}
/**
* Test that the default space is found.
*/
@Test
public void testDefaultSpace() {
Mail2BlogBaseConfiguration mail2BlogBaseConfiguration = Mail2BlogBaseConfiguration.builder()
.defaultSpace("DefaultSpace")
.build();
Message message = mock(Message.class);
List<SpaceInfo> spaces = spaceExtractor.getSpaces(mail2BlogBaseConfiguration, message);
assertEquals("Expected to find one space (the default space)", 1, spaces.size());
assertEquals("DefaultSpace", spaces.get(0).getSpaceKey());
}
/**
* Test space rules.
*/
@Test
public void testSpaceRules() throws Exception {
String[][] table = new String[][]{
// Field, Operator, Value, Action, Space
new String[]{ "from", "is", "<EMAIL>", "copy", "marseille", },
new String[]{ "to", "contains", "shop", "move", "paris", },
new String[]{ "cc", "start", "alice@", "copy", "grenoble", },
new String[]{ "to/cc", "end", <EMAIL>", "copy", "lyon", },
new String[]{ "subject", "regexp", "[0-9]+", "copy", "bordeaux", },
new String[]{ "subject", "regexp", "([0-9])+", "copy", SpaceRuleSpaces.CapturingGroup0, },
};
Object[][] messages = new Object[][]{
// From, TO, CC, Subject, Spaces
new Object[]{ "<EMAIL>", "<EMAIL>", "<EMAIL>", "test123", new String[]{ "marseille", "paris" } },
new Object[]{ "<EMAIL>", "<EMAIL>", "<EMAIL>", "test123", new String[]{ "marseille", "grenoble", "lyon", "bordeaux", "123", "defaultSpace" } },
};
SpaceRule[] spaceRules = new SpaceRule[table.length];
for (int i = 0; i < table.length; i++) {
spaceRules[i] = SpaceRule.builder()
.field(table[i][0])
.operator(table[i][1])
.value(table[i][2])
.action(table[i][3])
.space(table[i][4])
.build();
}
Mail2BlogBaseConfiguration mail2BlogBaseConfiguration = Mail2BlogBaseConfiguration.builder()
.spaceRules(spaceRules)
.defaultSpace("defaultSpace")
.build();
for (Object[] m : messages) {
String from = (String)m[0];
String to = (String)m[1];
String cc = (String)m[2];
String subject = (String)m[3];
String[] spaceKeys = (String[])m[4];
String strMessage = "from:" + from + " to:" + to + " cc:" +cc + " subject:" + subject;
// Create message
Message message = mock(Message.class);
when(message.getFrom()).thenReturn(new Address[] { new InternetAddress(from) });
when(message.getRecipients(Message.RecipientType.TO)).thenReturn(new Address[] { new InternetAddress(to) });
when(message.getRecipients(Message.RecipientType.CC)).thenReturn(new Address[] { new InternetAddress(cc) });
when(message.getSubject()).thenReturn(subject);
// Try to get spaces
List<SpaceInfo> spaceInfos = spaceExtractor.getSpaces(mail2BlogBaseConfiguration, message);
// Check that the right number of spaces where created.
assertEquals("Wrong number of spaces found for message " + strMessage, spaceKeys.length, spaceInfos.size());
int i = 0;
for (String spaceKey: spaceKeys) {
assertEquals("Wrong space keys for message " + strMessage, spaceKey, spaceInfos.get(i).getSpaceKey());
i++;
}
}
Address[] recipientsTo = new Address[] {
new InternetAddress("<EMAIL>"),
new InternetAddress("<EMAIL>"),
};
Message message = mock(Message.class);
}
/**
* Make sure that an inperformant regexp can't crash the entire application.
*/
@Test
public void testLongRunningRegexp() throws Exception {
String testString = String.join("", Collections.nCopies(1000, "x")); // x repeated 1000 times
String regexp = "(x+x+)+y";
SpaceRule spaceRule = SpaceRule.builder()
.field("subject")
.operator("regexp")
.value(regexp)
.action("copy")
.space(SpaceRuleSpaces.CapturingGroup0)
.build();
Message message = mock(Message.class);
when(message.getSubject()).thenReturn(testString);
Mail2BlogBaseConfiguration mail2BlogBaseConfiguration
= Mail2BlogBaseConfiguration.builder().spaceRules(new SpaceRule[]{spaceRule}).build();
boolean caughtException = false;
try {
spaceExtractor.extractSpaceKey(spaceRule, testString);
} catch (Exception e) {
caughtException = true;
assertTrue(e.getCause() instanceof TimeoutException);
}
assertTrue(caughtException);
caughtException = false;
try {
spaceExtractor.evalCondition(spaceRule, testString);
} catch (Exception e) {
caughtException = true;
assertTrue(e.getCause() instanceof TimeoutException);
}
assertTrue(caughtException);
List<SpaceInfo> spaceInfos = spaceExtractor.getSpaces(mail2BlogBaseConfiguration, message);
}
}
|
ernestyalumni/CompPhys | Cpp/math/Fields/factor.cpp | /**
* @file : factor.cpp
* @author : <NAME>
* @email : <EMAIL>
* @brief : Source file factor.cc for factor procedure
* @ref : pp. 74 Program 5.2, Ch. 5 Arrays; <NAME>, C++ for Mathematicians: An Introduction for Students and Professionals. Taylor & Francis Group, 2006.
*
* If you find this code useful, feel free to donate directly and easily at this direct PayPal link:
*
* https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ernestsaveschristmas%2bpaypal%40gmail%2ecom&lc=US&item_name=ernestyalumni¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted
*
* which won't go through a 3rd. party such as indiegogo, kickstarter, patreon.
* Otherwise, I receive emails and messages on how all my (free) material on physics, math, and engineering have
* helped students with their studies, and I know what it's like to not have money as a student, but love physics
* (or math, sciences, etc.), so I am committed to keeping all my material open-source and free, whether or not
* sufficiently crowdfunded, under the open-source MIT license:
* feel free to copy, edit, paste, make your own versions, share, use as you wish.
* Peace out, never give up! -EY
*
* COMPILATION TIPS:
* g++ -std=c++17 -c factor.cpp
*/
#include "factor.h"
namespace Fields
{
long factor(long n, long* flist)
{
// If n is zero, we return -1
if (n == 0)
{
return -1;
}
// If n is negative, we change it to |n|
if (n < 0)
{
n = -n;
}
// If n is one, we simply return 0
if (n == 1)
{
return 0;
}
// At this point, we know n > 1
int idx = 0; // index into the flist array
int d = 2; // current divisor
while (n > 1)
{
while (n % d == 0)
{
flist[idx] = d;
++idx;
n /= d;
}
++d;
}
return idx;
} // END of long factor(long, long*)
constexpr int factor_recursion(int n, int d, int idx, int* flist)
{
if (n <= 1)
{
return idx;
}
while (n % d == 0)
{
flist[idx] = d;
++idx;
n /= d;
}
++d;
factor_recursion(n, d, idx, flist);
}
int factor(int n, int* flist)
{
// If n is 0, we return -1
if (n == 0)
{
return -1;
}
// If n is negative, we change it to |n|
if (n < 0)
{
n = -n;
}
// If n is 1, we simply return 0
if (n == 1)
{
return 0;
}
// At this point, we know n > 1
return factor_recursion(n, 2, 0, flist);
}
} // namespace Fields
|
raduioanstoica/incubator-crail | rpc-narpc/src/main/java/org/apache/crail/namenode/rpc/tcp/TcpRpcConstants.java | <reponame>raduioanstoica/incubator-crail
/*
* Copyright (C) 2015-2018, IBM Corporation
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.apache.crail.namenode.rpc.tcp;
import java.io.IOException;
import org.apache.crail.conf.CrailConfiguration;
import org.apache.crail.utils.CrailUtils;
import org.slf4j.Logger;
public class TcpRpcConstants {
private static final Logger LOG = CrailUtils.getLogger();
public static final String NAMENODE_TCP_QUEUEDEPTH_KEY = "crail.namenode.tcp.queueDepth";
public static int NAMENODE_TCP_QUEUEDEPTH = 32;
public static final String NAMENODE_TCP_MESSAGESIZE_KEY = "crail.namenode.tcp.messageSize";
public static int NAMENODE_TCP_MESSAGESIZE = 512;
public static final String NAMENODE_TCP_CORES_KEY = "crail.namenode.tcp.cores";
public static int NAMENODE_TCP_CORES = 1;
public static void updateConstants(CrailConfiguration conf){
if (conf.get(NAMENODE_TCP_QUEUEDEPTH_KEY) != null) {
NAMENODE_TCP_QUEUEDEPTH = Integer.parseInt(conf.get(NAMENODE_TCP_QUEUEDEPTH_KEY));
}
if (conf.get(NAMENODE_TCP_MESSAGESIZE_KEY) != null) {
NAMENODE_TCP_MESSAGESIZE = Integer.parseInt(conf.get(NAMENODE_TCP_MESSAGESIZE_KEY));
}
if (conf.get(NAMENODE_TCP_CORES_KEY) != null) {
NAMENODE_TCP_CORES = Integer.parseInt(conf.get(NAMENODE_TCP_CORES_KEY));
}
}
public static void verify() throws IOException {
}
public static void printConf(Logger logger) {
LOG.info(NAMENODE_TCP_QUEUEDEPTH_KEY + " " + NAMENODE_TCP_QUEUEDEPTH);
LOG.info(NAMENODE_TCP_MESSAGESIZE_KEY + " " + NAMENODE_TCP_MESSAGESIZE);
LOG.info(NAMENODE_TCP_CORES_KEY + " " + NAMENODE_TCP_CORES);
}
}
|
gbraad/openshift-origin | cmd/cluster-capacity/go/src/github.com/kubernetes-incubator/cluster-capacity/vendor/k8s.io/kubernetes/pkg/volume/portworx/portworx_util.go | /*
Copyright 2017 The Kubernetes 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 portworx
import (
"github.com/golang/glog"
osdapi "github.com/libopenstorage/openstorage/api"
osdclient "github.com/libopenstorage/openstorage/api/client"
volumeclient "github.com/libopenstorage/openstorage/api/client/volume"
osdspec "github.com/libopenstorage/openstorage/api/spec"
osdvolume "github.com/libopenstorage/openstorage/volume"
"k8s.io/kubernetes/pkg/api/v1"
"k8s.io/kubernetes/pkg/volume"
)
const (
osdMgmtPort = "9001"
osdDriverVersion = "v1"
pxdDriverName = "pxd"
pwxSockName = "pwx"
pvcClaimLabel = "pvc"
)
type PortworxVolumeUtil struct {
portworxClient *osdclient.Client
}
// CreateVolume creates a Portworx volume.
func (util *PortworxVolumeUtil) CreateVolume(p *portworxVolumeProvisioner) (string, int, map[string]string, error) {
hostname := p.plugin.host.GetHostName()
client, err := util.osdClient(hostname)
if err != nil {
return "", 0, nil, err
}
capacity := p.options.PVC.Spec.Resources.Requests[v1.ResourceName(v1.ResourceStorage)]
// Portworx Volumes are specified in GB
requestGB := int(volume.RoundUpSize(capacity.Value(), 1024*1024*1024))
specHandler := osdspec.NewSpecHandler()
spec, err := specHandler.SpecFromOpts(p.options.Parameters)
if err != nil {
return "", 0, nil, err
}
spec.Size = uint64(requestGB * 1024 * 1024 * 1024)
source := osdapi.Source{}
locator := osdapi.VolumeLocator{
Name: p.options.PVName,
}
// Add claim Name as a part of Portworx Volume Labels
locator.VolumeLabels = make(map[string]string)
locator.VolumeLabels[pvcClaimLabel] = p.options.PVC.Name
volumeID, err := client.Create(&locator, &source, spec)
if err != nil {
glog.V(2).Infof("Error creating Portworx Volume : %v", err)
}
return volumeID, requestGB, nil, err
}
// DeleteVolume deletes a Portworx volume
func (util *PortworxVolumeUtil) DeleteVolume(d *portworxVolumeDeleter) error {
hostname := d.plugin.host.GetHostName()
client, err := util.osdClient(hostname)
if err != nil {
return err
}
err = client.Delete(d.volumeID)
if err != nil {
glog.V(2).Infof("Error deleting Portworx Volume (%v): %v", d.volName, err)
return err
}
return nil
}
// AttachVolume attaches a Portworx Volume
func (util *PortworxVolumeUtil) AttachVolume(m *portworxVolumeMounter) (string, error) {
hostname := m.plugin.host.GetHostName()
client, err := util.osdClient(hostname)
if err != nil {
return "", err
}
devicePath, err := client.Attach(m.volName)
if err != nil {
glog.V(2).Infof("Error attaching Portworx Volume (%v): %v", m.volName, err)
return "", err
}
return devicePath, nil
}
// DetachVolume detaches a Portworx Volume
func (util *PortworxVolumeUtil) DetachVolume(u *portworxVolumeUnmounter) error {
hostname := u.plugin.host.GetHostName()
client, err := util.osdClient(hostname)
if err != nil {
return err
}
err = client.Detach(u.volName)
if err != nil {
glog.V(2).Infof("Error detaching Portworx Volume (%v): %v", u.volName, err)
return err
}
return nil
}
// MountVolume mounts a Portworx Volume on the specified mountPath
func (util *PortworxVolumeUtil) MountVolume(m *portworxVolumeMounter, mountPath string) error {
hostname := m.plugin.host.GetHostName()
client, err := util.osdClient(hostname)
if err != nil {
return err
}
err = client.Mount(m.volName, mountPath)
if err != nil {
glog.V(2).Infof("Error mounting Portworx Volume (%v) on Path (%v): %v", m.volName, mountPath, err)
return err
}
return nil
}
// UnmountVolume unmounts a Portworx Volume
func (util *PortworxVolumeUtil) UnmountVolume(u *portworxVolumeUnmounter, mountPath string) error {
hostname := u.plugin.host.GetHostName()
client, err := util.osdClient(hostname)
if err != nil {
return err
}
err = client.Unmount(u.volName, mountPath)
if err != nil {
glog.V(2).Infof("Error unmounting Portworx Volume (%v) on Path (%v): %v", u.volName, mountPath, err)
return err
}
return nil
}
func (util *PortworxVolumeUtil) osdClient(hostname string) (osdvolume.VolumeDriver, error) {
osdEndpoint := "http://" + hostname + ":" + osdMgmtPort
if util.portworxClient == nil {
driverClient, err := volumeclient.NewDriverClient(osdEndpoint, pxdDriverName, osdDriverVersion)
if err != nil {
return nil, err
}
util.portworxClient = driverClient
}
return volumeclient.VolumeDriver(util.portworxClient), nil
}
|
vrk-kpa/misp2-web-app | src/main/java/ee/aktors/misp2/action/EulaAction.java | /*
* The MIT License
* Copyright (c) 2020- Nordic Institute for Interoperability Solutions (NIIS)
* Copyright (c) 2019 Estonian Information System Authority (RIA)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/
package ee.aktors.misp2.action;
import java.io.IOException;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.struts2.StrutsStatics;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.opensymphony.xwork2.ActionContext;
import ee.aktors.misp2.action.SecureLoggedAction;
import ee.aktors.misp2.beans.Auth;
import ee.aktors.misp2.beans.Auth.AUTH_TYPE;
import ee.aktors.misp2.httpMethodChecker.HTTPMethod;
import ee.aktors.misp2.httpMethodChecker.HTTPMethods;
import ee.aktors.misp2.model.Person;
import ee.aktors.misp2.model.PersonEula;
import ee.aktors.misp2.model.Portal;
import ee.aktors.misp2.service.EulaService;
import ee.aktors.misp2.util.Const;
import ee.aktors.misp2.util.DateUtil;
import ee.aktors.misp2.util.JsonUtil;
import ee.aktors.misp2.util.MISPUtils;
import ee.aktors.misp2.util.xroad.exception.DataExchangeException;
/**
* Action for accepting/rejecting EULA and storing necessary changes to DB.
*/
public class EulaAction extends SecureLoggedAction implements StrutsStatics {
private static final long serialVersionUID = 1L;
private static final Logger LOG = LogManager.getLogger(EulaAction.class);
private EulaService eulaService;
/**
* Initialize action
* @param eulaServiceNew EULA service for DB interaction
*/
public EulaAction(EulaService eulaServiceNew) {
super(null);
this.eulaService = eulaServiceNew;
}
/**
* User has accepted EULA. Create necessary changes
* @return null to avoid Struts2 response handling
* @throws IOException on JSON mapping failure
*/
@HTTPMethods(methods = { HTTPMethod.GET, HTTPMethod.POST })
public String acceptEula() throws IOException {
handlePersonEulaStatusChangeJson(true);
return null;
}
/**
* User has rejected EULA. Add necessary changes.
* @return null to avoid Struts2 response handling
* @throws IOException on JSON mapping failure
*/
@HTTPMethods(methods = { HTTPMethod.GET, HTTPMethod.POST })
public String rejectEula() throws IOException {
handlePersonEulaStatusChangeJson(false);
return null;
}
private void handlePersonEulaStatusChangeJson(boolean accept) throws IOException {
HttpServletResponse response = (HttpServletResponse) ActionContext.getContext().get(HTTP_RESPONSE);
response.setContentType(JsonUtil.JSON_CONTENT_TYPE);
ObjectWriter ow = new ObjectMapper().writer().withDefaultPrettyPrinter();
try {
PersonEula personEula = savePersonEula(accept);
Map<String, Object> respMap = new LinkedHashMap<String, Object>();
eulaService.savePendingEulasToSession(session);
respMap.put("personEula", getPersonEulaResponseMap(personEula));
response.setStatus(HttpServletResponse.SC_OK);
ow.writeValue(response.getWriter(), respMap);
} catch (DataExchangeException e) {
LOG.error("Accepting EULA query failed", e);
Map<String, Object> respMap = JsonUtil.getErrorResponseMap(
e.getType().toString(), getText(e.getTranslationCode(), e.getParameters()));
ow.writeValue(response.getWriter(), respMap);
}
}
/**
* Create or query suitable PersonEula object (by current user and selected portal) from DB.
* @param accept true, if EULA was accepted, false if rejected
* @return PersonEula entity
* @throws DataExchangeException on various state change exception,
* for example modifying already accepted PersonEula entry is not allowed.
*/
private PersonEula savePersonEula(boolean accept) throws DataExchangeException {
if (portal == null || !eulaService.isEulaInUse(portal)) {
throw new DataExchangeException(
DataExchangeException.Type.EULA_NOT_USED_IN_PORTAL,
"Eula is not configured for portal " + portal + ".", null);
}
if (user == null) {
throw new DataExchangeException(
DataExchangeException.Type.EULA_USER_NOT_FOUND,
"User was not found from session.", null);
}
HttpServletRequest request = (HttpServletRequest) ActionContext.getContext().get(HTTP_REQUEST);
// Get client IP address
String ipAddress = MISPUtils.getSourceIp(request);
// Get client Authentication method
Auth auth = (Auth)session.get(Const.SESSION_AUTH);
String authMethod = AUTH_TYPE.getXrdTypeFor(auth.getType());
if (accept) {
LOG.debug("Accepting EULA: portal " + portal + " - user " + user);
} else {
LOG.debug("Rejecting EULA: portal " + portal + " - user " + user);
}
PersonEula personEula = savePersonEula(portal, user, accept, ipAddress, authMethod);
return personEula;
}
/**
* Create map for JSON response of PersonEula entity.
* @param personEula PersonEula entity
* @return map with most important parameters from the entity
*/
private Map<String, Object> getPersonEulaResponseMap(PersonEula personEula) {
Map<String, Object> personEulaMap = new LinkedHashMap<String, Object>();
personEulaMap.put("id", personEula.getId());
personEulaMap.put("person_id", personEula.getPerson().getId());
personEulaMap.put("portal_id", personEula.getPortal().getId());
personEulaMap.put("accepted", personEula.getAccepted());
personEulaMap.put("created", DateUtil.convertDateToUsDate(personEula.getCreated()));
personEulaMap.put("modified", DateUtil.convertDateToUsDate(personEula.getLastModified()));
return personEulaMap;
}
/**
* Create or modify PersonEula entity for given portal and user,
* setting 'accepted' field to specified value.
* FIXME:
* For implementation reasons, saving cannot be executed within service.
* Getting "possible non-threadsafe access to session" error.
* @param portal Portal entity associated with PersonEula entity
* @param person user entity associated with PersonEula entity
* @param accepted boolean value specifying whether EULA was
* accepted or rejected by the user in given portal
* @return modified PersonEula entity. <br/>
* Entity is detached from Hibernate session: the modifications are not persisted..
*/
private PersonEula savePersonEula(Portal portal, Person person, boolean accepted, String srcAddr, String authMethod)
throws DataExchangeException {
PersonEula personEula = eulaService.findPersonEula(portal, person);
if (personEula == null) {
LOG.debug("Creating new PersonEula instance.");
personEula = new PersonEula();
personEula.setPortal(portal);
personEula.setPerson(person);
} else {
LOG.debug("Found existing PersonEula instance: " + personEula);
if (personEula.getAccepted() != null && personEula.getAccepted().booleanValue()) {
throw new DataExchangeException(
DataExchangeException.Type.EULA_ALREADY_ACCEPTED,
"EULA has been already accepted PersonEula[id=" + personEula.getId()
+ "]. Cannot alter it after the fact.", null);
}
}
personEula.setAccepted(accepted);
personEula.setSrcAddr(srcAddr);
personEula.setAuthMethod(authMethod);
personEula.setLastModified(new Date());
eulaService.save(personEula);
eulaService.detach(personEula);
return personEula;
}
}
|
acaos/nwnxee-unified | NWNXLib/API/Mac/API/XTextProperty.hpp | #pragma once
#include <cstdint>
namespace NWNXLib {
namespace API {
struct XTextProperty
{
uint8_t* value;
uint32_t encoding;
int32_t format;
uint32_t nitems;
};
}
}
|
varadharajaan/infraproject | remainder-service/src/main/java/com/eventcount/controllers/EventCountServiceStatisticsController.java | package com.eventcount.controllers;
import com.eventcount.monitors.EventCountServiceMethodInvokedStore;
import com.fasterxml.jackson.databind.node.JsonNodeFactory;
import com.fasterxml.jackson.databind.node.ObjectNode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.LongSummaryStatistics;
@RequestMapping("/todo-statistics")
@RestController
public class EventCountServiceStatisticsController {
@Autowired
EventCountServiceMethodInvokedStore monitor;
@GetMapping
public ObjectNode get() {
LongSummaryStatistics statistics = monitor.getStatistics();
return JsonNodeFactory.instance.objectNode().
put("average-duration", statistics.getAverage()).
put("invocation-count", statistics.getCount()).
put("min-duration", statistics.getMin()).
put("max-duration", statistics.getMax());
}
}
|
amad-person/ContactSails | src/test/java/seedu/address/logic/parser/DeleteOrderCommandParserTest.java | <gh_stars>0
//@@author amad-person
package seedu.address.logic.parser;
import static seedu.address.commons.core.Messages.MESSAGE_INVALID_COMMAND_FORMAT;
import static seedu.address.logic.parser.CommandParserTestUtil.assertParseFailure;
import static seedu.address.logic.parser.CommandParserTestUtil.assertParseSuccess;
import static seedu.address.testutil.TypicalIndexes.INDEX_FIRST_PERSON;
import org.junit.Test;
import seedu.address.logic.commands.DeleteOrderCommand;
public class DeleteOrderCommandParserTest {
private final DeleteOrderCommandParser parser = new DeleteOrderCommandParser();
@Test
public void parse_validArgs_returnsDeleteCommand() {
assertParseSuccess(parser, "1", new DeleteOrderCommand(INDEX_FIRST_PERSON));
}
@Test
public void parse_invalidArgs_throwsParseException() {
assertParseFailure(parser, "a",
String.format(MESSAGE_INVALID_COMMAND_FORMAT, DeleteOrderCommand.MESSAGE_USAGE));
}
}
|
sdyear/opensync | src/lib/kconfig/inc/kconfig.h | /*
Copyright (c) 2015, Plume Design Inc. 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. Neither the name of the Plume Design Inc. nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 Plume Design Inc. 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 KCONFIG_H_INCLUDED
#define KCONFIG_H_INCLUDED
/*
* Note: The code below is inspired by include/linux/kconfig.h from the Linux kernel.
*
* To explain the code below, lets assume we have two cases:
*
* #define CONFIG_A 1
* or
* #undef CONFIG_A
*
* step 0) Now, if we call kconfig_enabled(CONFIG_A) there are two possible outcomes:
*
* - the first case will expand to kconfig_enabled0(1)
* - the second case will expand to kconfig_enabled0(CONFIG_A)
*
* step 1) Now, lets look what happens with kconfig_enabled0()
*
* - kconfig_enabled0(1) gets expanded to -> kconfig_enabled1(kconfig_junk_1, 0)
* - kconfig_enabled0(CONFIG_A) gets expanded to -> kconfig_enabled1(kconfig_junk_CONFIG_A, 0)
*
* step 2) Expansion of kconfig_enabled1(). Note that we defined kconfig_junk_1 to be "0, 1"
*
* - kconfig_enabled1(kconfig_junk_1, 0) is expanded to -> kconfig_enabled2(junk, 1, 0)
* - kconfig_enabled1(kconfig_junk_CONFIG_A, 0) is expanded to -> kconfig_enabled2(kconfig_junk_CONFIG_A, 0)
*
* step 3) Due to the expansios above, kconfig_enabled2() may be called with 2 or 3 arguments -- we always return the second
*
* - kconfig_enabled2(junk, 1, 0) -> 1
* - kconfig_enabled2(kconfig_junk_CONFIG_A, 0) -> 0
*/
#define kconfig_junk_1 junk, 1
#define kconfig_enabled(KC) kconfig_enabled0(KC)
#define kconfig_enabled0(KC) kconfig_enabled1(kconfig_junk_##KC, 0)
#define kconfig_enabled1(...) kconfig_enabled2(__VA_ARGS__)
#define kconfig_enabled2(A, B, ...) B
#endif /* KCONFIG_H_INCLUDED */
|
unfrgivn/api-rbac | client/src/containers/UsersScreen/UsersScreen.js | import React, {Component} from 'react';
import {autobind} from 'core-decorators';
import { inject, observer } from 'mobx-react';
import UserTable from '../../components/Users/UserTable';
import AddUser from '../../components/Users/AddUser/AddUser';
import UserKeys from '../../components/Users/UserKeys/UserKeys';
import classes from './UsersScreen.module.scss';
@inject('stores')
@observer @autobind
class UsersScreen extends Component {
render() {
let content = null;
const { Users } = this.props.stores;
const { currentUserId } = Users;
if (currentUserId) {
content = (
<div>
<UserKeys />
<hr />
<div className={classes.UserForm}>
<h4>Edit User</h4>
<AddUser userId={currentUserId} />
</div>
</div>
);
} else {
content = (
<div>
<div className={classes.UserTable}>
<UserTable />
</div>
<div className={classes.UserForm}>
<h4>Add User</h4>
<AddUser />
</div>
</div>
);
}
return (
<div className={classes.UsersScreen}>
{content}
</div>
);
}
}
export default UsersScreen; |
1121206561/springboot- | org-myspring-event/src/main/java/yuhaojun/springevent/MySpringEvent.java | <gh_stars>1-10
package yuhaojun.springevent;
import org.springframework.context.ApplicationEvent;
/**
* 自定义了一个spring事件
*/
public class MySpringEvent extends ApplicationEvent {
public MySpringEvent(Object source) {
super(source);
}
}
|
Hartlex/OpenSUN-Server | agent-server/src/main/java/pl/cwanix/opensun/agentserver/controllers/AuthController.java | <filename>agent-server/src/main/java/pl/cwanix/opensun/agentserver/controllers/AuthController.java<gh_stars>0
package pl.cwanix.opensun.agentserver.controllers;
import org.slf4j.Marker;
import org.slf4j.MarkerFactory;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import pl.cwanix.opensun.agentserver.entities.UserEntity;
import pl.cwanix.opensun.agentserver.properties.AgentServerProperties;
import pl.cwanix.opensun.agentserver.server.session.AgentServerSessionManager;
@Slf4j
@RestController
@RequestMapping("/session")
@RequiredArgsConstructor
public class AuthController {
private static final Marker MARKER = MarkerFactory.getMarker("AUTH CONTROLLER");
private final RestTemplate restTemplate;
private final AgentServerSessionManager sessionManager;
private final AgentServerProperties properties;
@PostMapping(path = "/new", produces = "application/json")
public Integer create(@RequestParam("userId") int userId) {
log.info(MARKER, "Starting new session for user with id: {}", userId);
UserEntity user = restTemplate.getForObject("http://" + properties.getDb().getIp() + ":" + properties.getDb().getPort() + "/user/findById?id=" + userId, UserEntity.class);
if (user == null) {
log.error(MARKER, "Unable to start session for user with id: {}", userId);
return 1;
} else {
sessionManager.startNewSession(user);
}
return 0;
}
}
|
MrNullPoint/marketing-api-go-sdk | pkg/model/model_local_ads_spec_read.go | /*
* Marketing API
*
* Marketing API
*
* API version: 1.3
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package model
// 本地门店信息
type LocalAdsSpecRead struct {
ShopName *string `json:"shop_name,omitempty"`
Address *string `json:"address,omitempty"`
Telphone *string `json:"telphone,omitempty"`
SystemIndustryId *string `json:"system_industry_id,omitempty"`
}
|
jesse-gallagher/XPagesExtensionLibrary | extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.domino/resources/web/dwa/lv/nls/kk/listview_s.js | <reponame>jesse-gallagher/XPagesExtensionLibrary
({
L_CANCEL: "\u0411\u043e\u043b\u0434\u044b\u0440\u043c\u0430\u0443",
L_DOCUMENTS_SELECTED: "%1 \u049b\u04b1\u0436\u0430\u0442 \u0442\u0430\u04a3\u0434\u0430\u043b\u0434\u044b",
L_ENTRY_NOT_FOUND: "\u0416\u0430\u0437\u0431\u0430 \u0442\u0430\u0431\u044b\u043b\u043c\u0430\u0434\u044b",
L_ERR_INVALIDDATE: "\u0416\u0430\u0440\u0430\u043c\u0441\u044b\u0437 \u043a\u04af\u043d \u043a\u04e9\u0440\u0441\u0435\u0442\u0456\u043b\u0433\u0435\u043d.",
L_FETCHING: "\u0416\u0430\u0437\u0431\u0430\u043b\u0430\u0440 \u0448\u044b\u0493\u0430\u0440\u044b\u043f \u0430\u043b\u044b\u043d\u0443\u0434\u0430 . . .",
L_FETCHINGNEXT: "\u0416\u0430\u0437\u0431\u0430\u043b\u0430\u0440\u0434\u044b\u04a3 \u043a\u0435\u043b\u0435\u0441\u0456 \u0431\u0435\u0442\u0456 \u0448\u044b\u0493\u0430\u0440\u044b\u043f \u0430\u043b\u044b\u043d\u0443\u0434\u0430 . . .",
L_FETCHINGPREV: "\u0416\u0430\u0437\u0431\u0430\u043b\u0430\u0440\u0434\u044b\u04a3 \u0430\u043b\u0434\u044b\u04a3\u0493\u044b \u0431\u0435\u0442\u0456 \u0448\u044b\u0493\u0430\u0440\u044b\u043f \u0430\u043b\u044b\u043d\u0443\u0434\u0430 . . .",
L_JAWS_GIGABYTES: "%1 \u0433\u0438\u0433\u0430\u0431\u0430\u0439\u0442",
L_JAWS_KILOBYTES: "%1 \u043a\u0438\u043b\u043e\u0431\u0430\u0439\u0442",
L_JAWS_LISTVIEW_ASCENDINGSORTED: "\u0410\u0440\u0442\u0443 \u0440\u0435\u0442\u0456 \u0431\u043e\u0439\u044b\u043d\u0448\u0430 \u0441\u04b1\u0440\u044b\u043f\u0442\u0430\u043b\u0434\u044b",
L_JAWS_LISTVIEW_COLUMN: "%1 %2 \u0431\u0430\u0493\u0430\u043d\u044b. %3",
L_JAWS_LISTVIEW_DESCENDINGSORTED: "\u041a\u0435\u043c\u0443 \u0440\u0435\u0442\u0456 \u0431\u043e\u0439\u044b\u043d\u0448\u0430 \u0441\u04b1\u0440\u044b\u043f\u0442\u0430\u043b\u0434\u044b",
L_JAWS_LISTVIEW_NOENTRY: "\u0435\u0448\u049b\u0430\u043d\u0434\u0430\u0439 \u0435\u043d\u0433\u0456\u0437\u0443 \u0442\u0430\u04a3\u0434\u0430\u043b\u043c\u0430\u0434\u044b",
L_JAWS_LISTVIEW_NOSORTED: "",
L_JAWS_LISTVIEW_RESORTASCENDING: "\u0410\u0440\u0442\u0443 \u0440\u0435\u0442\u0456 \u0431\u043e\u0439\u044b\u043d\u0448\u0430 \u049b\u0430\u0439\u0442\u0430 \u0441\u04b1\u0440\u044b\u043f\u0442\u0430\u0443 \u04af\u0448\u0456\u043d, enter \u043f\u0435\u0440\u043d\u0435\u0441\u0456\u043d \u0431\u0430\u0441\u0443",
L_JAWS_LISTVIEW_RESORTDESCENDING: "\u041a\u0435\u043c\u0443 \u0440\u0435\u0442\u0456 \u0431\u043e\u0439\u044b\u043d\u0448\u0430 \u049b\u0430\u0439\u0442\u0430 \u0441\u04b1\u0440\u044b\u043f\u0442\u0430\u0443 \u04af\u0448\u0456\u043d, enter \u043f\u0435\u0440\u043d\u0435\u0441\u0456\u043d \u0431\u0430\u0441\u0443",
L_JAWS_LISTVIEW_UNDORESORT: "\u049a\u0430\u0439\u0442\u0430 \u0441\u04b1\u0440\u044b\u043f\u0442\u0430\u0443\u0434\u044b \u0431\u043e\u043b\u0434\u044b\u0440\u043c\u0430\u0443 \u04af\u0448\u0456\u043d, enter \u043f\u0435\u0440\u043d\u0435\u0441\u0456\u043d \u0431\u0430\u0441\u0443",
L_JAWS_LISTVIEW_WITHAPPLICATION: "%1 %2",
L_JAWS_LISTVIEW_WITHCOLNAME: "%1 \u0431\u0430\u0493\u0430\u043d\u044b. ",
L_JAWS_LISTVIEW_WITHPAGENUM: "%3 \u0431\u0430\u0493\u0430\u043d\u044b\u043d\u044b\u04a3 %1 %2",
L_JAWS_MEGABYTES: "%1 \u043c\u0435\u0433\u0430\u0431\u0430\u0439\u0442",
L_JAWS_TERABYTES: "%1 \u0442\u0435\u0440\u0430\u0431\u0430\u0439\u0442",
L_NARROW_DEFAULT: "\u04d8\u0434\u0435\u043f\u043a\u0456 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0456 \u0431\u043e\u0439\u044b\u043d\u0448\u0430 \u0441\u04b1\u0440\u044b\u043f\u0442\u0430\u0443",
L_NARROW_NOTITLE: "\u0422\u0430\u049b\u044b\u0440\u044b\u0431 \u0436\u043e\u049b",
L_NARROW_SORTBY: "%1 \u0431\u043e\u0439\u044b\u043d\u0448\u0430 \u0441\u04b1\u0440\u044b\u043f\u0442\u0430\u0443",
L_SEARCH: "\u0406\u0437\u0434\u0435\u0443",
L_STARTSWITH_COLUMN: "\u041a\u0435\u043b\u0435\u0441\u0456 \u0431\u043e\u0439\u044b\u043d\u0448\u0430 \u0441\u04b1\u0440\u044b\u043f\u0442\u0430\u0443 \u04af\u0448\u0456\u043d \u0431\u0430\u0493\u0430\u043d\u0434\u044b \u0442\u0430\u04a3\u0434\u0430\u0443:",
L_STARTSWITH_INVALID_NUMBER: "\u0416\u0430\u0440\u0430\u043c\u0441\u044b\u0437 \u0441\u0430\u043d \u043a\u04e9\u0440\u0441\u0435\u0442\u0456\u043b\u0433\u0435\u043d",
L_STARTSWITH_SEARCH: "\u041a\u0435\u043b\u0435\u0441\u0456\u043c\u0435\u043d \u0431\u0430\u0441\u0442\u0430\u043b\u0430\u0442\u044b\u043d \u0436\u0430\u0437\u0431\u0430\u043b\u0430\u0440\u0493\u0430 \u0441\u0435\u043a\u0456\u0440\u0443:",
L_STARTSWITH_TITLE: "\u041a\u0435\u043b\u0435\u0441\u0456\u043c\u0435\u043d \u0431\u0430\u0441\u0442\u0430\u043b\u0430\u0434\u044b...",
L_UPDATINGVIEW_MESSAGE: "\u0411\u04b1\u043b \u043a\u04e9\u0440\u0456\u043d\u0456\u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0434\u0435 \u0436\u0430\u04a3\u0430\u0440\u0442\u044b\u043b\u044b\u043f \u0436\u0430\u0442\u049b\u0430\u043d \u0441\u0438\u044f\u049b\u0442\u044b.\n\u041e\u043b \u0436\u0430\u04a3\u0430\u0440\u0442\u0443 \u0430\u044f\u049b\u0442\u0430\u043b\u0493\u0430\u043d \u0431\u043e\u0439\u0434\u0430\u043d \u043a\u04e9\u0440\u0441\u0435\u0442\u0456\u043b\u0435\u0434\u0456.\n\u0411\u0430\u0441\u049b\u0430 \u049b\u043e\u0439\u044b\u043d\u0434\u044b\u043b\u0430\u0440\u043c\u0435\u043d \u0436\u04b1\u043c\u044b\u0441\u0442\u044b \u0436\u0430\u043b\u0493\u0430\u0441\u0442\u044b\u0440\u044b\u04a3\u044b\u0437 \u043d\u0435\u043c\u0435\u0441\u0435 \u0431\u0430\u0441\u049b\u0430 \u043a\u04e9\u0440\u0456\u043d\u0456\u0441\u0442\u0435\u0440\u0433\u0435/\u049b\u0430\u043b\u0442\u0430\u043b\u0430\u0440\u0493\u0430 \u043a\u0456\u0440\u0456\u043f \u043a\u04e9\u0440\u0456\u04a3\u0456\u0437.",
L_VIEWICONTIPS_ELM_0: "",
L_VIEWICONTIPS_ELM_1: "New document ",
L_VIEWICONTIPS_ELM_10: "Reminder ",
L_VIEWICONTIPS_ELM_100: "Blue diamond ",
L_VIEWICONTIPS_ELM_101: "Red up arrow ",
L_VIEWICONTIPS_ELM_102: "Red down arrow ",
L_VIEWICONTIPS_ELM_103: "Red left arrow ",
L_VIEWICONTIPS_ELM_104: "Red right arrow ",
L_VIEWICONTIPS_ELM_105: "Green up arrow ",
L_VIEWICONTIPS_ELM_106: "Green down arrow ",
L_VIEWICONTIPS_ELM_107: "Green left arrow ",
L_VIEWICONTIPS_ELM_108: "Green right arrow ",
L_VIEWICONTIPS_ELM_109: "Blue up arrow ",
L_VIEWICONTIPS_ELM_11: "Information ",
L_VIEWICONTIPS_ELM_110: "Blue down arrow ",
L_VIEWICONTIPS_ELM_111: "Blue left arrow ",
L_VIEWICONTIPS_ELM_112: "Blue right arrow ",
L_VIEWICONTIPS_ELM_113: "Blue display ",
L_VIEWICONTIPS_ELM_114: "Green ball ",
L_VIEWICONTIPS_ELM_115: "Red ball ",
L_VIEWICONTIPS_ELM_116: "Brown ball ",
L_VIEWICONTIPS_ELM_117: "Blue ball ",
L_VIEWICONTIPS_ELM_118: "Dark blue ball ",
L_VIEWICONTIPS_ELM_119: "Purple ball ",
L_VIEWICONTIPS_ELM_12: "Write text ",
L_VIEWICONTIPS_ELM_120: "Yellow ball ",
L_VIEWICONTIPS_ELM_121: "Unopened white envelope ",
L_VIEWICONTIPS_ELM_122: "Sent message ",
L_VIEWICONTIPS_ELM_123: "Unopened blue envelope ",
L_VIEWICONTIPS_ELM_124: "Unopened red envelope ",
L_VIEWICONTIPS_ELM_125: "Opened white envelope ",
L_VIEWICONTIPS_ELM_126: "Opened yellow envelope ",
L_VIEWICONTIPS_ELM_127: "Opened blue envelope ",
L_VIEWICONTIPS_ELM_128: "Red envelope back ",
L_VIEWICONTIPS_ELM_129: "White envelope back ",
L_VIEWICONTIPS_ELM_13: "Graphic ",
L_VIEWICONTIPS_ELM_130: "Yellow envelope back ",
L_VIEWICONTIPS_ELM_131: "Red envelope back ",
L_VIEWICONTIPS_ELM_132: "White invitation ",
L_VIEWICONTIPS_ELM_133: "Yellow invitation ",
L_VIEWICONTIPS_ELM_134: "Red invitation ",
L_VIEWICONTIPS_ELM_135: "Lotus 123 ",
L_VIEWICONTIPS_ELM_136: "Word processing document ",
L_VIEWICONTIPS_ELM_137: "Presentation ",
L_VIEWICONTIPS_ELM_138: "Lotus Approach ",
L_VIEWICONTIPS_ELM_139: "Video camera ",
L_VIEWICONTIPS_ELM_14: "Chart ",
L_VIEWICONTIPS_ELM_140: "Workflow document ",
L_VIEWICONTIPS_ELM_141: "Microsoft Excel ",
L_VIEWICONTIPS_ELM_142: "Microsoft Word ",
L_VIEWICONTIPS_ELM_143: "Microsoft Powerpoint ",
L_VIEWICONTIPS_ELM_144: "Pie chart ",
L_VIEWICONTIPS_ELM_145: "Visio ",
L_VIEWICONTIPS_ELM_146: "Winter ",
L_VIEWICONTIPS_ELM_147: "Spring ",
L_VIEWICONTIPS_ELM_148: "Summer ",
L_VIEWICONTIPS_ELM_149: "Fall ",
L_VIEWICONTIPS_ELM_15: "Sound ",
L_VIEWICONTIPS_ELM_150: "Exclamation Point ",
L_VIEWICONTIPS_ELM_151: "Number 1 ",
L_VIEWICONTIPS_ELM_152: "Number 2 ",
L_VIEWICONTIPS_ELM_153: "Number 3 ",
L_VIEWICONTIPS_ELM_154: "Number 4 ",
L_VIEWICONTIPS_ELM_155: "Number 5 ",
L_VIEWICONTIPS_ELM_156: "Cooking ",
L_VIEWICONTIPS_ELM_157: "Document unacceptable ",
L_VIEWICONTIPS_ELM_158: "Meeting ",
L_VIEWICONTIPS_ELM_159: "Gold star ",
L_VIEWICONTIPS_ELM_16: "Microphone ",
L_VIEWICONTIPS_ELM_160: "Appointment ",
L_VIEWICONTIPS_ELM_161: "Widget ",
L_VIEWICONTIPS_ELM_162: "Question ",
L_VIEWICONTIPS_ELM_163: "Confidential ",
L_VIEWICONTIPS_ELM_164: "Encrypted mail ",
L_VIEWICONTIPS_ELM_165: "Blue padlock ",
L_VIEWICONTIPS_ELM_166: "Disguised ",
L_VIEWICONTIPS_ELM_167: "Blue checkmark ",
L_VIEWICONTIPS_ELM_168: "To Do ",
L_VIEWICONTIPS_ELM_169: "Red medallion ",
L_VIEWICONTIPS_ELM_17: "Graphic ",
L_VIEWICONTIPS_ELM_170: "Yellow medallion ",
L_VIEWICONTIPS_ELM_171: "Lotus Word Pro ",
L_VIEWICONTIPS_ELM_172: "Lotus Freelance ",
L_VIEWICONTIPS_ELM_173: "Airplane ",
L_VIEWICONTIPS_ELM_174: "Car ",
L_VIEWICONTIPS_ELM_175: "Building ",
L_VIEWICONTIPS_ELM_176: "New Document ",
L_VIEWICONTIPS_ELM_177: "Party balloon ",
L_VIEWICONTIPS_ELM_178: "Message replied to ",
L_VIEWICONTIPS_ELM_179: "Message forwarded ",
L_VIEWICONTIPS_ELM_18: "Green display ",
L_VIEWICONTIPS_ELM_180: "Message replied to and forwarded ",
L_VIEWICONTIPS_ELM_181: "Follow up high priority.",
L_VIEWICONTIPS_ELM_182: "Follow up normal priority.",
L_VIEWICONTIPS_ELM_183: "Follow up low priority.",
L_VIEWICONTIPS_ELM_184: "Sent to me only ",
L_VIEWICONTIPS_ELM_185: "Sent to me and a few people ",
L_VIEWICONTIPS_ELM_186: "Sent to me and many people ",
L_VIEWICONTIPS_ELM_187: "Unprocessed meeting notice ",
L_VIEWICONTIPS_ELM_188: "Unread message ",
L_VIEWICONTIPS_ELM_189: "Online meeting ",
L_VIEWICONTIPS_ELM_19: "Table ",
L_VIEWICONTIPS_ELM_190: "High relevance ",
L_VIEWICONTIPS_ELM_191: "Medium relevance ",
L_VIEWICONTIPS_ELM_192: "Low relevance ",
L_VIEWICONTIPS_ELM_193: "Not relevant ",
L_VIEWICONTIPS_ELM_194: "All day event ",
L_VIEWICONTIPS_ELM_195: "Reminder ",
L_VIEWICONTIPS_ELM_196: "Rescheduled ",
L_VIEWICONTIPS_ELM_197: "Decline invitation ",
L_VIEWICONTIPS_ELM_198: "Countered invitation ",
L_VIEWICONTIPS_ELM_199: "Anniversary ",
L_VIEWICONTIPS_ELM_2: "Unopened folder ",
L_VIEWICONTIPS_ELM_20: "Text ",
L_VIEWICONTIPS_ELM_200: "Cancelled meeting ",
L_VIEWICONTIPS_ELM_201: "Completed to do ",
L_VIEWICONTIPS_ELM_202: "Accepted ",
L_VIEWICONTIPS_ELM_203: "Declined ",
L_VIEWICONTIPS_ELM_204: "High priority ",
L_VIEWICONTIPS_ELM_205: "Appointment ",
L_VIEWICONTIPS_ELM_206: "Private invitation ",
L_VIEWICONTIPS_ELM_207: "Joke emoticon ",
L_VIEWICONTIPS_ELM_208: "Confidential emoticon ",
L_VIEWICONTIPS_ELM_209: "Personal emoticon ",
L_VIEWICONTIPS_ELM_21: "Multiple documents ",
L_VIEWICONTIPS_ELM_210: "Accepted invitation ",
L_VIEWICONTIPS_ELM_211: "Read message ",
L_VIEWICONTIPS_ELM_212: "New invitation ",
L_VIEWICONTIPS_ELM_22: "Two documents ",
L_VIEWICONTIPS_ELM_23: "News ",
L_VIEWICONTIPS_ELM_24: "Red book ",
L_VIEWICONTIPS_ELM_25: "Address book ",
L_VIEWICONTIPS_ELM_26: "Open book ",
L_VIEWICONTIPS_ELM_27: "Closed book ",
L_VIEWICONTIPS_ELM_28: "White book ",
L_VIEWICONTIPS_ELM_29: "Torn yellow page ",
L_VIEWICONTIPS_ELM_3: "Person ",
L_VIEWICONTIPS_ELM_30: "Torn blue page ",
L_VIEWICONTIPS_ELM_31: "Light bulb on ",
L_VIEWICONTIPS_ELM_32: "Light bulb off ",
L_VIEWICONTIPS_ELM_33: "Refresh ",
L_VIEWICONTIPS_ELM_34: "Search document ",
L_VIEWICONTIPS_ELM_35: "Search document completed ",
L_VIEWICONTIPS_ELM_36: "Document acceptable ",
L_VIEWICONTIPS_ELM_37: "Document complete ",
L_VIEWICONTIPS_ELM_38: "Document problem ",
L_VIEWICONTIPS_ELM_39: "Document question ",
L_VIEWICONTIPS_ELM_4: "Group ",
L_VIEWICONTIPS_ELM_40: "Document caution ",
L_VIEWICONTIPS_ELM_41: "Document yellow ",
L_VIEWICONTIPS_ELM_42: "Response yellow document ",
L_VIEWICONTIPS_ELM_43: "Response blue document ",
L_VIEWICONTIPS_ELM_44: "Phone ",
L_VIEWICONTIPS_ELM_45: "Active phone ",
L_VIEWICONTIPS_ELM_46: "Computer terminal ",
L_VIEWICONTIPS_ELM_47: "Fax ",
L_VIEWICONTIPS_ELM_48: "CD-ROM ",
L_VIEWICONTIPS_ELM_49: "Floppy disk ",
L_VIEWICONTIPS_ELM_5: "Attachment ",
L_VIEWICONTIPS_ELM_50: "Diskette ",
L_VIEWICONTIPS_ELM_51: "Hard drive ",
L_VIEWICONTIPS_ELM_52: "Network ",
L_VIEWICONTIPS_ELM_53: "Computer ",
L_VIEWICONTIPS_ELM_54: "Server ",
L_VIEWICONTIPS_ELM_55: "Connection ",
L_VIEWICONTIPS_ELM_56: "Find ",
L_VIEWICONTIPS_ELM_57: "Write ",
L_VIEWICONTIPS_ELM_58: "Draft ",
L_VIEWICONTIPS_ELM_59: "Currency ",
L_VIEWICONTIPS_ELM_6: "Interwoven ",
L_VIEWICONTIPS_ELM_60: "Coins ",
L_VIEWICONTIPS_ELM_61: "Key ",
L_VIEWICONTIPS_ELM_62: "Padlock ",
L_VIEWICONTIPS_ELM_63: "Calendar ",
L_VIEWICONTIPS_ELM_64: "Clock ",
L_VIEWICONTIPS_ELM_65: "Alarm ",
L_VIEWICONTIPS_ELM_66: "Flying ",
L_VIEWICONTIPS_ELM_67: "Satellite ",
L_VIEWICONTIPS_ELM_68: "Briefcase ",
L_VIEWICONTIPS_ELM_69: "Home ",
L_VIEWICONTIPS_ELM_7: "Animal ",
L_VIEWICONTIPS_ELM_70: "Globe ",
L_VIEWICONTIPS_ELM_71: "Health ",
L_VIEWICONTIPS_ELM_72: "Finance ",
L_VIEWICONTIPS_ELM_73: "Transportation ",
L_VIEWICONTIPS_ELM_74: "Chemical ",
L_VIEWICONTIPS_ELM_75: "Manufacturing ",
L_VIEWICONTIPS_ELM_76: "Utilities ",
L_VIEWICONTIPS_ELM_77: "Telecommunication ",
L_VIEWICONTIPS_ELM_78: "Construction ",
L_VIEWICONTIPS_ELM_79: "Hourglass ",
L_VIEWICONTIPS_ELM_8: "Search ",
L_VIEWICONTIPS_ELM_80: "Banned ",
L_VIEWICONTIPS_ELM_81: "Rejected ",
L_VIEWICONTIPS_ELM_82: "Completed ",
L_VIEWICONTIPS_ELM_83: "Acceptable ",
L_VIEWICONTIPS_ELM_84: "Unacceptable ",
L_VIEWICONTIPS_ELM_85: "Happy ",
L_VIEWICONTIPS_ELM_86: "Indifferent ",
L_VIEWICONTIPS_ELM_87: "Sad ",
L_VIEWICONTIPS_ELM_88: "Lukewarm ",
L_VIEWICONTIPS_ELM_89: "Warm ",
L_VIEWICONTIPS_ELM_9: "Network activity ",
L_VIEWICONTIPS_ELM_90: "Very hot ",
L_VIEWICONTIPS_ELM_91: "Bomb ",
L_VIEWICONTIPS_ELM_92: "Stop sign ",
L_VIEWICONTIPS_ELM_93: "Stop ",
L_VIEWICONTIPS_ELM_94: "Caution ",
L_VIEWICONTIPS_ELM_95: "Go ",
L_VIEWICONTIPS_ELM_96: "Positive ",
L_VIEWICONTIPS_ELM_97: "Negative ",
L_VIEWICONTIPS_ELM_98: "Red diamond ",
L_VIEWICONTIPS_ELM_99: "Green diamond ",
L_VIEWMAIL: "Mail"
})
|
dennyac/onnxruntime | onnxruntime/core/providers/cuda/controlflow/loop.h | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#pragma once
#include "core/common/common.h"
#include "core/providers/cpu/controlflow/loop.h"
namespace onnxruntime {
namespace cuda {
// Use the CPU implementation for the logic
class Loop final : public onnxruntime::Loop {
public:
Loop(const OpKernelInfo& info);
Status Compute(OpKernelContext* ctx) const override;
};
} // namespace cuda
} // namespace onnxruntime
|
SangMinL96/pds_admin_site | src/views/auth/LoginView.js | <reponame>SangMinL96/pds_admin_site
import React, { useState } from 'react'
import styled from 'styled-components'
import { TextField, Button, Box } from '@material-ui/core'
import useAxiosGet from 'src/components/useAxiosGet'
import { useNavigate } from 'react-router-dom'
import { useForm } from 'react-hook-form'
import NoticeList from './NoticeList'
import Axios from 'axios'
import PwdEdit from './PwdEdit'
import { toast } from 'react-toastify'
import Page from 'src/components/Page'
import useMedia from 'src/components/useMedia'
const LoginView = () => {
const [state] = useAxiosGet(`${process.env.REACT_APP_API_GW_URL}/api/v1/notices`)
const { data: NTC_DATA } = state
const [pwdEdit, setpwdEdit] = useState(false)
const navigate = useNavigate()
const { register, handleSubmit, errors } = useForm()
const [loginError, setLoginError] = useState(false)
const [media] = useMedia()
const onSubmit = async data => {
try {
const token = await Axios.post(`${process.env.REACT_APP_API_GW_URL}/api/v1/login`, data, { withCredentials: true })
if (token !== '' && token !== undefined) {
sessionStorage.setItem('token', token.data.accessToken)
localStorage.setItem(
'userInfo',
JSON.stringify({
loginID: token.data.user.id,
loginDT: new Date(),
}),
)
navigate('/', { replace: true })
}
} catch (error) {
const status = error?.response?.request?.status
const pwdEditStatus = error?.response?.data?.user
if (pwdEditStatus === 'PWD_INIT') {
toast.error('관리자로 인해 비밀번호가 초기화 되었습니다.')
setpwdEdit(true)
}
if (status === 400) {
setLoginError(true)
}
}
}
return (
<Page title={'Hipong Admin'}>
<LoginContainer>
<FormContainer>
<Form onSubmit={handleSubmit(onSubmit)}>
<LoginLogo src="/static/images/loginHipongLogo.png" />
<TextField
error={errors?.id !== undefined ? true : false}
style={{ width: media.w525 ? '70%' : null }}
label="아이디"
variant="outlined"
fullWidth
type="text"
name="id"
inputRef={register({ required: true })}
size="small"
/>
<TextField
error={errors?.pwd !== undefined ? true : loginError ? true : false}
helperText={loginError ? '아이디 또는 비밀번호가 잘못되었습니다.' : null}
style={{ marginTop: '1em', width: media.w525 ? '70%' : null }}
label="비밀번호"
variant="outlined"
fullWidth
type="password"
name="pwd"
inputRef={register({ required: true })}
size="small"
/>
<Box
style={{ marginTop: '1em', width: media.w525 ? '70%' : '100%', display: 'flex', justifyContent: 'space-between' }}
>
<Button style={{ width: '48%' }} type="submit" fullWidth variant="contained" color="primary" size="small">
로그인
</Button>
<Button
style={{ width: '48%' }}
fullWidth
variant="contained"
color="primary"
size="small"
onClick={() => setpwdEdit(true)}
>
비밀번호변경
</Button>
</Box>
</Form>
<NoticeContainer>
<h3>공지사항</h3>
<NoticeContents>
{NTC_DATA?.map(item => (
<NoticeList
key={item.NTC_ID}
title={item.NTC_NM}
dates={item.REG_DT}
content={item.NTC_CONT}
nat={item.NAT_NM_LST}
stt={item.STT_NM_LST}
svc={item.SVC_NM_LST}
regDt={item.REG_DT}
updDt={item.UPD_DT}
fileId={item.FL_ID_LST}
fileNm={item.FL_NM_LST}
/>
))}
</NoticeContents>
</NoticeContainer>
</FormContainer>
</LoginContainer>
{pwdEdit ? <PwdEdit setpwdEdit={setpwdEdit} /> : null}
</Page>
)
}
export default LoginView
// 스타일스 컴포넌트
const LoginContainer = styled.div`
position: absolute;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
background-image: url('/static/images/loginMainImg.png');
background-size: 100% 100%;
top: 0px;
`
const FormContainer = styled.div`
width: 800px;
height: 350px;
border: 1px solid #e3e5e7;
display: flex;
justify-content: space-between;
align-items: center;
padding: 4em;
box-shadow: 0px 1px 7px 0px rgba(156, 156, 156, 0.55);
border-radius: 8px;
background-color: #f0f0f0f5;
@media only screen and (max-width: 800px) {
flex-direction: column;
justify-content: space-evenly;
height: 600px;
margin: 1em;
}
@media only screen and (max-width: 450px) {
width: 350px;
flex-direction: column;
height: 550px;
margin: 1em;
}
h3 {
display: flex;
justify-content: center;
align-items: center;
font-size: 1.1rem;
width: 100px;
height: 30px;
position: absolute;
top: -12px;
left: 5%;
z-index: 10;
border-radius: 20px;
background-color: #f0f0f0f5;
}
`
const NoticeContainer = styled.div`
position: relative;
width: 100%;
height: 215px;
border-radius: 8px;
border: 1px solid #bbbdbf;
box-shadow: 0px 1px 4px 0px rgba(156, 156, 156, 0.55);
@media only screen and (max-width: 800px) {
margin-top: 2em;
padding-bottom: 1em;
}
@media only screen and (max-width: 450px) {
width: 300px;
margin-top: 2em;
padding-bottom: 1em;
}
`
const Form = styled.form`
width: 100%;
display: flex;
flex-direction: column;
@media only screen and (max-width: 800px) {
align-items: center;
}
`
const NoticeContents = styled.div`
margin-top: 1em;
width: 100%;
height: 88%;
display: flex;
flex-direction: column;
overflow-y: auto;
`
const LoginLogo = styled.img`
width: 75%;
`
|
drayan85/TheMovieDataBase | app/src/main/java/com/database/movie/data_layer/database/DBHelper.java | <reponame>drayan85/TheMovieDataBase
/*
* Copyright (c) 2018 <NAME> Open Source Project
*
* 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 com.database.movie.data_layer.database;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;
import com.database.movie.Extras;
import com.database.movie.data_layer.database.entity.IMovie;
import com.database.movie.data_layer.database.entity.INowPlayingMovie;
import javax.inject.Singleton;
/**
* @author <NAME> <<EMAIL>>
* @version 1.0.0
* @since 15th of January 2018
*/
@Singleton
public class DBHelper extends SQLiteOpenHelper {
private static final int DB_VERSION = 2;
private static final String TAG = DBHelper.class.getSimpleName();
public DBHelper(Context context){
super(context, Extras.DB_NAME, null, DB_VERSION);
}
@Override
public void onCreate(SQLiteDatabase db) {
Log.d(TAG, "db onCreate");
//CREATE TABLES
db.execSQL(IMovie.CREATE_TABLE_MOVIES);
db.execSQL(INowPlayingMovie.CREATE_TABLE_NOW_PLAYING_MOVIES);
//CREATE INDICES
db.execSQL(IMovie.CREATE_MOVIES_INDEX_ID);
db.execSQL(INowPlayingMovie.CREATE_NOW_PLAYING_MOVIES_INDEX_ID);
}
@Override
public void onConfigure(SQLiteDatabase db) {
db.enableWriteAheadLogging();
super.onConfigure(db);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
Log.d(TAG, "db onUpgrade oldVersion : " + oldVersion + " newVersion " + newVersion);
dropTables(db);
onCreate(db);
}
public void onClear(SQLiteDatabase db){
db.delete(IMovie.TABLE_NAME, null, null);
db.delete(INowPlayingMovie.TABLE_NAME, null, null);
}
private void dropTables(SQLiteDatabase db){
db.execSQL(IMovie.DROP_TABLE_QUERY);
db.execSQL(INowPlayingMovie.DROP_TABLE_QUERY);
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.