content
stringlengths 10
4.9M
|
---|
<reponame>CarlosPena00/Mobbi<gh_stars>0
import smbus
import time
class MPU:
""" Class that get the Gyro, Acell and temperature from a MPU6050
this module is based on:
1) https://www.filipeflop.com/blog/tutorial-acelerometro-mpu6050-arduino/
2) https://www.sunfounder.com/learn/sensor-kit-v2-0-for-raspberry-pi-b-plus
3) https://github.com/Tijndagamer/mpu6050/blob/master/mpu6050/mpu6050.py
/lesson-32-mpu6050-gyro-acceleration-sensor-sensor-kit-v2-0-for-b-plus.html
"""
ACCEL_SCALE_MODIFIER_2G = 16384.0
GRAVITIY_MS2 = 9.80665
def __init__(self):
self.bus = smbus.SMBus(1)
self.address = 0x68 # i2cdetect -y 1
self.bus.write_byte_data(self.address, 0x6b, 0) # "Wake sensor"
# https://playground.arduino.cc/Main/MPU-6050
self.accelConfig = 0x1C
self.accelRang = self.bus.read_byte_data(self.address, self.accelConfig)
def __getXYZ(self, adr):
xyz = []
for i in range(3):
high = self.bus.read_byte_data(self.address, adr + i * 2)
low = self.bus.read_byte_data(self.address, adr + i * 2 + 1)
val = (high << 8) + low
if (val >= 0x8000):
val = -((65535 - val) + 1)
xyz.append(val)
return xyz
def getGyro(self):
adr = 0x43
gyro = self.__getXYZ(adr)
return gyro
def getAccel(self):
adr = 0x3B
acell = self.__getXYZ(adr)
acell[0] = (self.GRAVITIY_MS2 * acell[0]) / self.ACCEL_SCALE_MODIFIER_2G
acell[1] = (self.GRAVITIY_MS2 * acell[1]) / self.ACCEL_SCALE_MODIFIER_2G
acell[2] = (self.GRAVITIY_MS2 * acell[2]) / self.ACCEL_SCALE_MODIFIER_2G
return acell
def getTemp(self):
high = self.bus.read_byte_data(self.address, 0x41)
low = self.bus.read_byte_data(self.address, 0x42)
val = (high << 8) + low
if (val >= 0x8000):
val = -((65535 - val) + 1)
val2 = (val / 340.00) + 36.53
return val2
mpu = MPU()
while True:
print "Acell: ", mpu.getAccel()
print "Temp: ", mpu.getTemp()
time.sleep(0.5)
|
<gh_stars>10-100
package org.minbox.framework.message.pipe.server.lb;
import org.minbox.framework.message.pipe.core.information.ClientInformation;
import org.minbox.framework.message.pipe.core.exception.MessagePipeException;
import java.util.List;
/**
* Get client list load balancing interface definition
*
* @author 恒宇少年
*/
public interface ClientLoadBalanceStrategy {
/**
* Lookup a {@link ClientInformation}
*
* @param clients message pipe {@link ClientInformation} list
* @return load-balanced client
* @throws MessagePipeException message pipe exception
*/
ClientInformation lookup(List<ClientInformation> clients) throws MessagePipeException;
}
|
// Copyright 2021 The IREE Authors
//
// Licensed under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#ifndef IREE_CODEGEN_SANDBOX_PASSES_H_
#define IREE_CODEGEN_SANDBOX_PASSES_H_
#include "mlir/Dialect/Linalg/Utils/Utils.h"
#include "mlir/Pass/Pass.h"
namespace mlir {
/// Struct to control pass options for `LinalgFuse` pass.
struct LinalgFusePassOptions {
std::string anchorFuncOpName = "";
std::string anchorOpName = "";
SmallVector<int64_t> tileSizes = {};
SmallVector<int64_t> tileInterchange = {};
bool pad = false;
SmallVector<std::string> paddingValues = {};
SmallVector<int64_t> paddingDimensions = {};
SmallVector<int64_t> packPaddings = {};
SmallVector<int64_t> hoistPaddings = {};
SmallVector<std::string> transposePaddings = {};
bool vectorize = false;
bool vectorizePadding = false;
int64_t tilingLevel = -1;
bool doIREEDistribution = false;
};
/// Creates a pass to drive tile + fuse transformations of `LinalgOp`s.
std::unique_ptr<OperationPass<func::FuncOp>> createLinalgFusePass();
std::unique_ptr<OperationPass<func::FuncOp>> createLinalgFusePass(
const LinalgFusePassOptions &options);
/// Struct to control pass options for `LinalgSingleTilingExpert` pass.
struct LinalgSingleTilingExpertPassOptions {
std::string anchorFuncOpName = "";
std::string anchorOpName = "";
SmallVector<int64_t> tileSizes = {};
SmallVector<int64_t> tileInterchange = {};
SmallVector<int64_t> peeledLoops = {};
bool pad = false;
SmallVector<std::string> paddingValues = {};
SmallVector<int64_t> packPaddings = {};
SmallVector<int64_t> hoistPaddings = {};
SmallVector<std::string> transposePaddings = {};
bool scalarizeDynamicDims = false;
bool generalize = false;
SmallVector<int64_t> iteratorInterchange = {};
bool decomposeToLowerDimOp = false;
bool vectorize = false;
bool vectorizePadding = false;
int64_t tilingLevel = -1;
};
/// Creates a pass to drive one level tiling + vectorization of `LinalgOp`s.
std::unique_ptr<OperationPass<func::FuncOp>>
createLinalgSingleTilingExpertPass();
std::unique_ptr<OperationPass<func::FuncOp>> createLinalgSingleTilingExpertPass(
const LinalgSingleTilingExpertPassOptions &passOptions);
/// Struct to control pass options for `LinalgVectorLoweringPass` pass.
struct LinalgVectorLoweringPassOptions {
int vectorLoweringStage = 0;
std::string splitVectorTransfersTo = "";
std::string lowerVectorTransposeTo = "eltwise";
bool lowerVectorTransposeToAVX2 = false;
std::string lowerVectorMultiReductionTo = "innerparallel";
std::string lowerVectorContractionTo = "outerproduct";
bool unrollVectorTransfers = true;
int maxTransferRank = 1;
};
/// Creates a pass to drive the lowering of vector operations in a staged
/// manner.
std::unique_ptr<OperationPass<func::FuncOp>> createLinalgVectorLoweringPass(
int64_t vectorLoweringStage = 0);
std::unique_ptr<OperationPass<func::FuncOp>> createLinalgVectorLoweringPass(
const LinalgVectorLoweringPassOptions &options);
/// Create a pass to drive the unrolling of a single vector op.
std::unique_ptr<OperationPass<func::FuncOp>> createUnrollOneVectorOpPass();
/// Create a pass to drive the unrolling of a single parent loop of an op.
std::unique_ptr<OperationPass<func::FuncOp>> createUnrollOneParentLoopPass();
/// Create a pass to drive the outlining of the region of a single parent loop
/// of an op.
std::unique_ptr<OperationPass<func::FuncOp>> createOutlineOneParentLoopPass();
//===----------------------------------------------------------------------===//
// Transforms that tie together individual drivers.
//===----------------------------------------------------------------------===//
/// Add staged lowering of vector ops. `passManager` is expected to be a
/// `builtin.func` op pass manager.
void addLowerToVectorTransforms(OpPassManager &passManager,
LinalgVectorLoweringPassOptions options);
//===----------------------------------------------------------------------===//
// IREE specific pass creation methods to allow invocation from within IREEs
// backend pipelines
//===----------------------------------------------------------------------===//
namespace iree_compiler {
/// Creates a pass to drive tile + fuse transformations of `LinalgOp`s with
/// additional parameters that allow controlling the value of the pass options
/// when building the pipeline.
std::unique_ptr<OperationPass<func::FuncOp>> createLinalgFusePass(
int64_t tilingLevel, bool vectorize);
/// Creates a pass to drive one level tiling + vectorization of `LinalgOp`s with
/// additional parameters that allow controlling the value of the pass options
/// when building the pipeline.
std::unique_ptr<OperationPass<func::FuncOp>> createLinalgSingleTilingExpertPass(
int64_t tilingLevel, bool vectorize);
//===----------------------------------------------------------------------===//
// Registration
//===----------------------------------------------------------------------===//
void registerSandboxPasses();
} // namespace iree_compiler
} // namespace mlir
#endif // IREE_CODEGEN_SANDBOX_PASSES_H_
|
#!/usr/bin/python
# -*- coding: iso-8859-15 -*-
import sys
import os
from shutil import copyfile
def copy():
src = './README.md'
dst= './docs/index.md'
copyfile(src, dst)
if __name__ == '__main__':
copy()
|
use std::collections::BTreeSet;
use anyhow::{anyhow, Result};
use chrono::{DateTime, Utc};
use tantivy::{
collector::{Count, TopDocs},
query::{AllQuery, BooleanQuery, Occur, Query, QueryParser, TermQuery},
schema::Field,
DocAddress, Document, Index, IndexWriter, Term,
};
use crate::posts::Post;
use super::schema::{FieldGetter, PostField};
use crate::datetime::{self, DateTimeFormat, DateTimeWithFormat};
pub fn get_all(
query: &dyn Query,
index: &Index,
order_by: Option<datetime::OrderBy>,
) -> Result<Option<Vec<Document>>> {
let schema = index.schema();
let searcher = index.reader()?.searcher();
let counter = Count {};
let count = searcher.search(query, &counter)?;
let fb = FieldGetter::new(&schema);
if count == 0 {
return Ok(None);
}
let docs = if let Some(order_by) = order_by {
let collector =
match order_by {
datetime::OrderBy::CreatedAt => TopDocs::with_limit(count)
.order_by_fast_field(fb.get_field(PostField::CreatedAt)),
datetime::OrderBy::UpdatedAt => TopDocs::with_limit(count)
.order_by_fast_field(fb.get_field(PostField::UpdatedAt)),
};
searcher
.search(query, &collector)?
.into_iter()
.flat_map(|doc: (DateTime<Utc>, DocAddress)| searcher.doc(doc.1).ok())
.collect()
} else {
searcher
.search(query, &TopDocs::with_limit(count))?
.into_iter()
.flat_map(|(_, doc_address)| searcher.doc(doc_address).ok())
.collect()
};
Ok(Some(docs))
}
pub fn get_tags_and_categories(index: &Index) -> Result<(Vec<String>, Vec<String>)> {
let q: Box<dyn Query> = Box::new(AllQuery {});
let schema = index.schema();
let fg = FieldGetter::new(&schema);
let _docs = get_all(&q, index, None)?;
if let Some(docs) = _docs {
let mut categories = BTreeSet::new();
let mut tags = BTreeSet::new();
for doc in docs.iter() {
let category = fg.get_text(doc, PostField::Category)?;
let inner_tags = fg.get_tags(doc)?;
categories.insert(category);
tags.extend(inner_tags.into_iter())
}
return Ok((tags.into_iter().collect(), categories.into_iter().collect()));
}
Ok((Vec::new(), Vec::new()))
}
pub fn term_query_one(term: &str, field: Field, index: &Index) -> Result<Document> {
let reader = index.reader()?;
let seracher = reader.searcher();
let t = Term::from_field_text(field, term);
let tq = TermQuery::new(t, tantivy::schema::IndexRecordOption::Basic);
let docs = seracher.search(&tq, &TopDocs::with_limit(10))?;
if docs.is_empty() {
return Err(anyhow!("{} is Not Found", term));
}
let (_, doc_address) = docs.into_iter().next().unwrap();
let doc = seracher.doc(doc_address)?;
Ok(doc)
}
pub fn get_by_uuid(uuid: &str, index: &Index) -> Result<Document> {
let schema = index.schema();
let fg = FieldGetter::new(&schema);
let field = fg.get_field(PostField::Uuid);
term_query_one(uuid, field, index)
}
pub fn get_by_slug_with_lang(slug: &str, lang: &str, index: &Index) -> Result<Document> {
let reader = index.reader()?;
let searcher = reader.searcher();
let schema = index.schema();
let fg = FieldGetter::new(&schema);
let slug_field = fg.get_field(PostField::Slug);
let lang_field = fg.get_field(PostField::Lang);
let slug_query: Box<dyn Query> = Box::new(TermQuery::new(
Term::from_field_text(slug_field, slug),
tantivy::schema::IndexRecordOption::Basic,
));
let lang_query: Box<dyn Query> = Box::new(TermQuery::new(
Term::from_field_text(lang_field, lang),
tantivy::schema::IndexRecordOption::Basic,
));
let q = BooleanQuery::new(vec![(Occur::Must, slug_query), (Occur::Must, lang_query)]);
let docs = searcher.search(&q, &TopDocs::with_limit(1))?;
if docs.is_empty() {
return Err(anyhow!("slug: {} and lang: {} is Not Found", slug, lang));
}
let (_, doc_address) = docs.into_iter().next().unwrap();
Ok(searcher.doc(doc_address)?)
}
pub fn put(
post: &Post,
index: &Index,
index_writer: &mut IndexWriter,
skip_update_date: bool,
) -> Result<Option<Document>> {
let now = Utc::now();
let schema = index.schema();
let fb = FieldGetter::new(&schema);
let new_doc = match get_by_uuid(&post.uuid(), index) {
Ok(doc) => {
let uuid_field = fb.get_field(PostField::Uuid);
// if no update in post, skip update index
// post.diff(&Post::from_doc(&doc, &schema)?);
if post.equal_from_doc(&Post::from_doc(&doc, &schema)?) {
info!("skip post: {}", post.title());
return Ok(None);
}
let created_at = if let Some(created_at) = post.matter().created_at() {
created_at
} else {
let datetime = fb.get_date(&doc, PostField::CreatedAt)?;
let format = fb.get_text(&doc, PostField::CreatedAtFormat)?;
DateTimeWithFormat::new(datetime, DateTimeFormat::from(format.as_str()))
};
let updated_at = if skip_update_date {
post.updated_at().unwrap()
} else {
let updated_at_format =
DateTimeFormat::from(fb.get_text(&doc, PostField::UpdatedAtFormat)?.as_str());
DateTimeWithFormat::new(now, updated_at_format)
};
let new_doc = post.to_doc(&schema, &created_at, &updated_at);
index_writer.delete_term(Term::from_field_text(uuid_field, &post.uuid()));
index_writer.add_document(new_doc.clone());
new_doc
}
Err(_) => {
// If no document in index, insert doc
let now_with_format = DateTimeWithFormat::new(now, DateTimeFormat::RFC3339);
let created_at = if let Some(c) = post.created_at() {
c
} else {
now_with_format.clone()
};
let updated_at = if let Some(u) = post.updated_at() {
u
} else {
now_with_format
};
let new_doc = post.to_doc(&index.schema(), &created_at, &updated_at);
index_writer.add_document(new_doc.clone());
new_doc
}
};
index_writer.commit()?;
Ok(Some(new_doc))
}
pub fn search(
query: &str,
fields: Vec<Field>,
limit: usize,
index: &Index,
) -> Result<Vec<Document>> {
if limit == 0 {
return Ok(Vec::new());
}
let searcher = index.reader()?.searcher();
let query_parser = QueryParser::for_index(index, fields);
let query = query_parser.parse_query(query)?;
let docs = searcher.search(&query, &TopDocs::with_limit(limit))?;
Ok(docs
.into_iter()
.flat_map(|(_, doc_address)| searcher.doc(doc_address).ok())
.collect())
}
#[cfg(test)]
mod test {
use crate::test_utility::*;
use super::*;
use crate::posts::frontmatter::FrontMatter;
use crate::test_utility::build_random_posts_index;
use crate::{
posts::Post,
text_engine::{index::read_or_build_index, schema::build_schema},
};
use tempdir::TempDir;
#[test]
fn test_get_all() -> Result<()> {
let temp_dir = TempDir::new(&format!(
"temp_rand_index_{}",
uuid::Uuid::new_v4().to_string()
))?;
let (posts, index) = build_random_posts_index(10, temp_dir.path())?;
assert_eq!(posts.len(), 10);
let q: Box<dyn Query> = Box::new(AllQuery {});
let docs = get_all(&q, &index, None)?;
assert!(docs.is_some());
assert_eq!(docs.unwrap().len(), 10);
Ok(())
}
#[test]
fn test_get_by_uuid() -> Result<()> {
let temp_dir = TempDir::new(&format!(
"temp_rand_index_{}",
uuid::Uuid::new_v4().to_string()
))?;
let schema = build_schema();
let (posts, index) = build_random_posts_index(5, temp_dir.path())?;
for post in posts.iter() {
let uuid = post.uuid();
let doc = get_by_uuid(&uuid, &index)?;
let res_post = Post::from_doc(&doc, &schema)?;
assert_eq!(res_post.uuid(), uuid);
assert!(res_post.equal_from_doc(&post));
}
Ok(())
}
#[test]
fn test_get_by_slug_and_lang() -> Result<()> {
let temp_dir = TempDir::new(&format!(
"temp_rand_index_{}",
uuid::Uuid::new_v4().to_string()
))?;
let schema = build_schema();
let (posts, index) = build_random_posts_index(5, temp_dir.path())?;
for post in posts.iter() {
let slug = post.slug();
let lang = post.lang();
let doc = get_by_slug_with_lang(&slug, lang.as_str(), &&index)?;
let res_post = Post::from_doc(&doc, &schema)?;
assert!(post.equal_from_doc(&res_post));
}
Ok(())
}
#[test]
fn test_get_tags_and_categories() -> Result<()> {
let temp_dir = tempdir::TempDir::new(&format!(
"temp_rand_index_{}",
uuid::Uuid::new_v4().to_string()
))?;
let (posts, index) = build_random_posts_index(10, temp_dir.path())?;
let (mut tags, mut categories) = get_tags_and_categories(&index)?;
let mut rand_tags = BTreeSet::new();
let mut rand_categories = BTreeSet::new();
for post in posts.iter() {
rand_categories.insert(post.category());
if let Some(tags) = post.tags() {
for tag in tags.iter() {
rand_tags.insert(tag.to_owned());
}
}
}
let mut rand_tags: Vec<String> = rand_tags.into_iter().collect();
let mut rand_categories: Vec<String> = rand_categories.into_iter().collect();
tags.sort_unstable();
categories.sort_unstable();
rand_tags.sort_unstable();
rand_categories.sort_unstable();
assert_eq!(tags, rand_tags);
assert_eq!(categories, rand_categories);
Ok(())
}
#[test]
fn test_put() {
let temp_dir = TempDir::new("test_put_query").unwrap();
let schema = build_schema();
let index =
read_or_build_index(schema.clone(), &temp_dir.path().join("put"), false).unwrap();
let mut index_writer = index.writer(100_000_000).unwrap();
let post = rand_post();
let doc = put(&post, &index, &mut index_writer, false)
.unwrap()
.unwrap();
let post_doc = Post::from_doc(&doc, &schema).unwrap();
assert!(post.equal_from_doc(&post_doc));
let none = put(&post_doc, &index, &mut index_writer, false).unwrap();
assert!(none.is_none());
}
#[test]
fn test_put_with_format() -> Result<()> {
use crate::test_utility::*;
let temp_dir = tempdir::TempDir::new(&format!(
"temp_rand_index_{}",
uuid::Uuid::new_v4().to_string()
))?;
fn rand_post_with_format() -> Post {
let now = Utc::now();
let tags = rand_tags(3);
let matter = FrontMatter::new(
uuid::Uuid::new_v4(),
rand_japanase(TITLE_LENGTH),
rand_japanase(DESCRIPTION_LENGTH),
rand_japanase(TAG_CATEGORIES_LENGTH),
rand_lang(),
tags,
Some(DateTimeWithFormat::new(
now,
DateTimeFormat::Custom("YY/MM/DD".to_string()),
)),
Some(DateTimeWithFormat::new(
now,
DateTimeFormat::Custom("YY-MM-DD".to_string()),
)),
);
Post::new(rand_alpahbet(10), matter, rand_japanase(BODY_LENGHT))
}
let schema = build_schema();
let index = read_or_build_index(schema, temp_dir.path(), true)?;
let mut index_writer = index.writer(100_000_000)?;
fn test_put(post: &mut Post, index: &Index, index_writer: &mut IndexWriter) -> Result<()> {
let doc = put(&post, &index, index_writer, false)?;
assert!(doc.is_some());
let prev_post = Post::from_doc(&doc.unwrap(), &index.schema())?;
let body = post.body_mut();
*body = rand_japanase(BODY_LENGHT - 10);
let doc = put(&post, &index, index_writer, false)?;
assert!(doc.is_some());
let updated_post = Post::from_doc(&doc.unwrap(), &index.schema())?;
assert_ne!(prev_post.updated_at(), updated_post.updated_at());
assert_eq!(
prev_post.updated_at().unwrap().format(),
updated_post.updated_at().unwrap().format()
);
Ok(())
}
let mut post_with_format = rand_post_with_format();
test_put(&mut post_with_format, &index, &mut index_writer)?;
let mut post = rand_post();
test_put(&mut post, &index, &mut index_writer)?;
Ok(())
}
}
|
Ultra-low power MOSFET and tunneling FET technologies using III-V and Ge
CMOS and tunneling FETs (TFETs) utilizing low effective mass III-V/Ge channels on Si substrates is expected to be one of the promising device options for low power integrated systems, because of the enhanced carrier transport and tunneling properties. In this paper, we present viable device and process technologies of Ge/III-V MOSFETs and TFETs on the Si CMOS platform. Heterogeneous integration to form these new materials on Si is a common key issue. The wafer bonding technologies are utilized for this purpose. We demonstrate the operation and the electrical characteristics of a variety of III-V/Ge MOSFETs and TFETs including the hetero-structures. |
/***
* Load from the crypto package all the classes contained in crypto.algos.
* @param cryptoParentPath
* @return
* @throws IOException
* @throws ClassNotFoundException
*/
private static List<Class<?>> loadAlgosClass(String cryptoParentPath)
throws IOException, ClassNotFoundException {
var loader = new CipherClassLoader(cryptoParentPath);
var keysFilename = cryptoParentPath + "/crypto/keys.list";
var algos = Files.readAllLines(Path.of(keysFilename));
var classes = new ArrayList<Class<?>>(algos.size());
for (var algo : algos) {
/* Each line contains a class name and a key separated by a single space. */
var splitted = algo.split(" ");
/* We do care only for the class name, ignoring the key... */
var className = splitted[0];
/* Try to load the class contained in class name */
var loadedClass = loader.loadClass(className);
classes.add(loadedClass);
}
return classes;
} |
// Sorted returns a copy of the SeriesList sorted by the function
func (l *SeriesList) Sorted(sorter func(a, b *models.Series) bool) *SeriesList {
sorted := make(SeriesList, len(*l))
copy(sorted, *l)
sort.Slice(sorted, func(i, j int) bool {
return sorter(sorted[i], sorted[j])
})
return &sorted
} |
/// Draw a quadratic bezier curve from the current point to the point located `(dx, dy)` away,
/// with control point located `(dx1, dy1)` away from the current point.
/// The endpoint of this curve becomes the new current point.
pub fn quadratic_bezier_by(mut self, dx1: f32, dy1: f32, dx: f32, dy: f32) -> Path {
fmt::write(&mut self.inner,
format_args!("q {} {}, {} {}", dx1, dy1, dx, dy)
).unwrap();
self
} |
Impact of the Siewert Classification on the Outcome of Patients Treated by Preoperative Chemoradiotherapy for a Nonmetastatic Adenocarcinoma of the Oesophagogastric Junction
The aim of the study is to analyze the impact of the Siewert classification on the pathological complete response (pcR), pattern of failure, and general outcome of patients treated, by preoperative chemoradiotherapy and surgery for an gastroesophageal junction adenocarcinoma (OGJA). From 2000 to 2008, the charts of 68 patients were retrospectively reviewed. Tumor staging reported was UST1/T2/T3/T4/unknown, respectively, n = 1/7/54/5/1 patients, and N0/N1/unknown, respectively, n = 9/58/1 patients. Patients received primary external-beam radiotherapy with concurrent chemotherapy followed by surgical resection (Siewert I: upper oesogastrectomy; Siewert II/III: total gastrectomy with lower oesophagectomy). Overall survival (OS), overall relapse rate (ORR), cumulative rate of local (CRLR), nodal (CRNR), and metastatic (CRMR) relapse, and their prognostic factors were retrospectively analyzed. Median follow-up was 77.5 months. Median OS was 41.7 ± 5.2 months. The 3-year ORR was 48%. Using univariate analysis ORR was significantly increased for patients with Siewert II/III compared to Siewert I tumors (27.3% versus 62%, p = 0.047). Siewert I tumors had also statistically lower CRNR and CRMR compared to Siewert II/III tumors (0/9.1% versus 41.3/60.2% resp., p = 0.012), despite an equivalent cumulative rate of local relapse and pathological complete response rate between the three groups. For OGJA treated with preoperative CRT and surgery, ORR and CRMR were lower for patients with Siewert I tumors in comparison with Siewert II/III tumors.
Background
Oesophageal and gastroesophageal junction cancer is the eighth most common form of cancer, with almost 482000 new cases and 407000 deaths in the world in 2008 . The incidence of adenocarcinoma has increased in compaison to all other histology . Although early-stage localized disease with no evidence of nodal spread and with invasion confined to the submucosa has a good prognosis after complete local resection, more advanced lesions benefit from combined modality therapy with more extensive resection to ensure negative margins, including lymph node dissection. After primary surgery 25% of patients had microscopically positive resection margins, and the 5-year survival rate remained poor, generally under 40% .
Recently, the seventh edition of the TNM classification improved the predictive ability for cancers of the oesophagus. Differences in patient characteristics, pathogenesis, and especially survival clearly identify adenocarcinomas and squamous cell carcinoma of the oesophagus as 2 separate tumor entities requiring differentiated therapeutic concepts . Meta-analysis suggests an evident survival benefit for preoperative chemoradiotherapy and, to a lesser extent, for chemotherapy in patients with adenocarcinoma of the oesophagus. In this meta-analysis, preoperative radiochemotherapy increased survival whatever the histological subtypes, whereas the benefit in survival for neoadjuvant chemotherapy was observed only for adenocarcinomas .
Siewert recognized the need for a tumor classification based on anatomic location and proposed a classification scheme for distal esophageal and gastroesophageal junction neoplasms to guide therapy and allow for a more meaningful study . The classification of adenocarcinomas of the gastroesophageal junction (AEG) in three types, AEG type I, type II, and type III, shows marked differences between the tumor entities and is recommended for selection of a proper surgical approach. By extrapolation, this classification has been extensively used to adapt the preoperative treatment: patients presenting with a Siewert type 1 tumor are generally considered and treated as patients with oesophagus cancer and receive, for operable locally advanced tumors, concomitant radiation chemotherapy followed by surgery, whereas patients presenting with Siewert type 2 and 3 tumors are generally considered and treated as patients with gastric cancers by perioperative chemotherapy . However, there is no rational basis supported by evidence in the literature to explain such a difference in current preoperative practices according to the Siewert classification.
In this retrospective study, we analyzed the outcome of a series of 68 patients treated, independently of the Siewert classification of their tumor, by concomitant preoperative radiochemotherapy followed by surgery, and the impact of the Siewert classification on the pathological response, pattern of failure, and general outcome of the patients.
Patient's Selection.
Between January 2000 and December 2008, 159 patients were treated by radiotherapy with or without +/− concomitant chemotherapy for a nonmetastatic adenocarcinoma of the gastroesophageal junction in four French cancer centers. During this period and before the publication of the MAGIC Trial and the French FFCD Trial results , all patients requiring neoadjuvant treatment for a nonmetastatic adenocarcinoma of the gastroesophageal junction were treated by neoadjuvant radiotherapy with or without +/− concomitant chemotherapy in these cancer centers. Patients presenting with distant metastasis and/or a squamous cell carcinoma were excluded. Among these 159 patients, the charts of 68 patients who received preoperative radiotherapy with concomitant chemotherapy, followed by surgery, were selected for this study. This analysis was approved by local institutional review boards.
All patients underwent an oeso-gastroscopy, an gastroesophageal endoscopic ultrasound (EUS), and a computed thoracoabdominal and pelvic tomography (CT) scan. Positron emission tomography was not used routinely. All the tumors were restaged on the basis of the seventh edition of the American Joint Committee on Cancer tumor staging criteria . Laparoscopy was never performed as a diagnostic procedure. T and N stage were assessed by EUS and CT scan. Lymph nodes measuring more than 1 cm on the CT scan were considered to be clinically involved. Tumors were also classified using the Siewert classification : Siewert 1 tumors were located only in the lower esophagus, Siewert 2 tumors were located in both the lower esophagus and the upper gastric wall, and Siewert 3 tumors concerned only the gastric part of the gastroesophageal junction, without involvement of the esophagus.
Treatments.
Irradiation consisted of external-beam radiotherapy delivering a mean total dose of 44.5 Gy (range, 36-50 Gy), at 1.8 to 2 Gy per fraction, with a 3-or 4-field technique. The irradiated volume took into account the tumor size and the risk of lymph node involvement. Irradiation modalities were set at the discretion of each attending radiation oncologist. Two patients received a boost in the gross tumor volume delivering 10 and 14.4 Gy, respectively. Mean total treatment time for radiotherapy was 36.5 days (24-60). The dose was prescribed to the International Commission on Radiation Units and Measurements point and delivered through linear accelerators by use of high-energy photons (≥10 MV). During the radiation therapy, all patients received concurrent chemotherapy, mainly based on cisplatin and 5FU regimen ( = 26, 38.3%), cisplatin or carboplatin alone ( = 39, 57.3%), or FOLFOX ( = 3, 4.4%). Six patients (8.8%) previously received 2 additional cycles of neoadjuvant chemotherapy based on cisplatin and 5FU regimen. Seven (10, 3%) patients received adjuvant chemotherapy based on FOLFIRI ( = 4, 5.9%) or cisplatin plus 5FU ( = 3, 4, 4%).
After a mean delay of 58.8 days , patients underwent surgery, which was represented by an oeso-gastrectomy polar superior (Lewis Santy procedure) for Siewert 1 tumors, whereas patients with Siewert 2 or 3 tumors underwent an extended total gastrectomy with resection of the lower esophagus, associated with a D2-lymphadenectomy.
Patients were seen for the first follow-up 8 to 12 weeks after the end of the treatment and thereafter every 3 or 4 months up to 2 years. Afterwards, follow-up was planned every 6 months, until progression or death. Follow-up encompassed a clinical examination and a blood sample including tumor markers, as well as a CT scan. Endoscopic control was generally carried out every year.
Statistics.
The follow-up was calculated from the date of diagnosis to the date of last follow-up, using the Schemper method . The differences between each group were evaluated by use of the chi2 test or the Fisher exact test for categorical variables and the Mann-Whitney test for continuous variables. Survival rates were estimated by use of the Kaplan-Meier method . The overall relapse rate (ORR) was defined by the date of diagnosis and the date of the first relapse whatever the site of relapse. Cumulative rate of local recurrence (CRLR) was defined by the date of diagnosis and the date of the first local relapse, cumulative rate of nodal recurrence (CRNR) was defined by the date of diagnosis and the date of the first nodal relapse, and the cumulative rate of metastatic recurrence (CRMR) was defined by the date of the diagnosis and the date of the first distant relapse. Overall survival (OS) was defined by the interval between the date of the diagnosis and the date of death or last follow-up. The progression-free survival (PFS) was defined between the date of diagnosis and the date of the first relapse and/or death. Univariate and multivariate prognostic analyses were performed with the Cox regression model . Variables associated with survival with < 0.2 in the univariate analysis were included in the multivariate regression. The variables included in the model were age as continuous variable and age (<62 versus ≥62 years, i.e., median age), gender, T and N stage, tumor length, the Siewert classification, and overall treatment time (OTT). All the variables included in the models were categorical. Analyses were performed with SPSS statistical software, version 16.0 (SPSS, Chicago, IL). All statistical tests were 2-sided, and ≤ 0.05 indicated statistical significance.
Results
The characteristics of the patients are reported in (Figure 1(a)). Using univariate analysis, age as a continuous variable ( < 0.0001), tumor size as a continuous variable ( < 0.0001), Karnofsky performance status ( = 0.05), and ypN ( < 0.0001) classification significantly influenced OS.
Using multivariate analysis, ypN status was the only factor independently influencing overall survival ( = 0.001).
Results of uni-and multivariate analysis for OS are detailed in Table 4(a).
Discussion
This study is, to our knowledge, the first to focus on the impact of the Siewert classification on the pathological response, on the pattern of failure, and also on the general outcome of the patients after concomitant preoperative Gastroenterology Research and Practice 5 (1) " value" of Log-rank test.
(2) Hazard-Ratio (95% confidence interval). chemoradiation. This study concerned a consequent number of patients, treated with preoperative radiochemotherapy, avoiding misleading factors such as nonhomogeneous population in terms of patient clinical staging and therapeutic strategy. With regard to study limitations, this analysis was conducted in a retrospective, multicentric, and nonrandomized manner. Pathological response rate observed in this study was 16/68 (22%), in the range to the rate already published in the literature . In our study, no statistical difference was observed in terms of pathological complete tumor response between Siewert 1, 2, and 3 groups of patients. This could suggest that these three groups have the same radiosensitivity, which could have its importance, as it is well described that pathological complete response after neoadjuvant radiotherapy is an independent prognostic factor of overall survival . Based on a large cohort, Wang et al. have demonstrated that over a recent 10-year period, the three subtypes of adenocarcinoma of the gastroesophageal junction showed different histological changing trends, suggesting heterogeneous characteristics of the three Siewert types of adenocarcinoma of the gastroesophageal junction. However nothing was published concerning the difference in terms of radiosensitivity of these three subtypes, and this specific point could be evaluated in a future clinical trial .
In our study the overall and progression-free survival rates are in the range of those already reported in the literature . OS was not statistically different between Gastroenterology Research and Practice the 3 different Siewert groups, whereas we observed a lower overall relapse rate in patients treated for Siewert 1 tumors in comparison to Siewert 2 and 3 tumors, with also a lower rate of nodal and metastatic relapse for this specific group. This, however, only held on univariate analysis and significance was lost in multivariate analysis. In this study, the number of patients with pathological nodal involvement has a trend to be more favorable in Siewert 1 group (11 ypN0,4 ypN+) in comparison with Siewert type 2/3 groups (21 ypN0, 24 ypN+), which could also explain the best results observed in this study for Siewert type 1 group but this difference does not reach statistical significance ( = 0.07), and when we look at the pretreatment classification, there is no difference in terms of USN classification between the two Siewert groups The other prognostic factors found significant in multivariate analysis for ORR in this study were in concordance with other published data in particular age , tumor size , and nodal status .
Xiao et al. have studied the difference in the characteristics of lymphatic metastasis and its impact in terms of surgical approach in a retrospective series of 228 patients, showing that for type I the pattern of lymph node metastasis is similar to that of the distal esophageal carcinoma (with a rate of 44%), for type II they observed a high rate of lymph node metastasis 66.9% (1/3 in the thoracic cage and 2/3 in the abdomen), and for type III, the rate of lymph node metastasis was also 66.9% including mainly abdominal metastasis (70.4%) . The high rate of nodal involvement observed in Siewert types 2 and 3 is in accordance with our statistical difference in terms of nodal and metastasis rate and suggests that preoperative concomitant chemoradiotherapy is not efficient enough to control microscopic distant invasion with further significant uncertainties concerning the clinical target volume. Two other recent publications focused on the same topic, though being in nonirradiated patients. Reeh et al. have described type II OGJA as a more aggressive tumour with higher recurrence rates in comparison with type I OGJA, suggesting a potential benefit from more aggressive surgical treatment for such tumors . More recently, Curtis et al. published the results of a large prospective study including patients who received preoperative chemotherapy instead of CRT and described type III tumours as larger and associated with frequent histological perineural and vascular invasion, although this did not translate into more lymph node metastasis . This hypothesis suggests that Siewert 2 and 3 tumors represent biologically different tumors and could need the use of more aggressive treatment in particular the use of more efficient and aggressive multimodalities treatments. This is also concordant with the publication of Hasegawa et al. where Siewert type 2/3 tumors are more considered as gastric tumors than as esophagus tumors and could be treated as gastric cancer by perioperative chemotherapy, with or without preoperative chemoradiotherapy as suggested by the results of a recent phase II randomized trial .
Conclusions
For gastroesophageal adenocarcinomas, treated with concomitant preoperative chemoradiotherapy, our study pointed out a difference in terms of ORR between Siewert 1 and 2/3 tumors, with an increasing rate of distant relapse for Siewert 2 and 3 tumors in comparison with Siewert I tumors, despite an equivalent local control rate and pathological response rate between these three groups. This paper also found welldescribed prognostic factors to be significant in particular nodal status, in accordance with previous published data, and further study is needed to determine whether there is a real difference between Siewert group 1 and Siewert 2/3 patients, as the reliability of the Siewert classification is actually controverted . |
1. At times like these, it’s worth taking a few breaths and looking at the big picture. First of all, Canadian basketball has never been in better shape. They went 7-2 this summer (all games) and absolutely dominated at FIBA America’s last summer. And while they didn’t have their full compliment of Canadian NBA players with them in Manila, the participation of the NBA contingent has been pretty robust, overall.
There doesn’t appear to be any conflict within the basketball community that seems to be preventing any of Canada’s best from playing as a point of principle as may have been the case when Jamaal Magloire passed on the national team for years or even when Steve Nash himself stopped playing for Canada after Jay Triano was let go as coach in 2004. The pool of players is pretty deep. Canada had six NBA players not with them in Manila, four of them first-round picks. The national team is organized, ambitious and it’s hard to find imagine more qualified leaders than Jay Triano, Steve Nash and Rowan Barrett.
They have international pedigree, NBA credentials and with Barrett’s son, Rowan Jr. gaining recognition as an elite NBA prospect at age 16, strong ties to the development side of the game. Had Canada avoided disaster against Venezuela a year ago, chances are their problem would be who not to take to Rio, rather than who didn’t show up in the Philippines.
2. But they still lost and this generation of Canadian players, led by Triano etc. is now 0-3 in opportunities to qualify for major international competitions, having missed out making it the Worlds in the summer of 2013 and the 2016 Olympics twice. Does something need to change? I can understand that sentiment, but the question is always: what is the alternative? I suppose there is some international guru who could come in as a hired gun and theoretically do a better job than Triano, or someone from the Canadian community who might have better luck, but objectively it’s tough see how you would quantify why you would make the change.
My sense is that if Triano didn’t exist we’d be crying about the need for someone like him: an individual with international success as a player and coach, who has been recognized as a valuable voice by three NBA teams and who absolutely bleeds Canadian basketball. There were quibbles about his rotations at times in the first three games but in the against France he went pretty brand-name down the stretch – Bennett, Thompson, Cory Joseph and Tyler Ennis were all on the floor in crunch time — and France simply proved the better team.
3. I’ve said this before: I’m not going to rip on players who don’t play for Canada, in particular ones that have played for Canada in the past. I’d rather recognize the one’s that do play. In part this is because I don’t feel right – and this is a personal thing – vilifying people for not giving up their time risk to their health for what is essentially a volunteer mission. Also because it will feel weird to make a big deal about guys not playing this summer and then shower them with praise if and when they do play and they lead Canada to a silver medal or something.
Of the Canadian NBA players not playing this summer Andrew Wiggins and Nik Stauskas are taking their share of heat because they’re healthy and under contract. It is very much their choice not to play – Triano made clear before the tournament that NBA players who want to play internationally don’t need the permission of their clubs (although you’d have to think it’s best for all concerned if it’s done cooperatively). You’d like to think that Stauskas and Wiggins feel like they had some unfinished business this summer after each of them struggled against Venezuela – Wiggins with four tentative turnovers; Stauskas essentially a no-show with food poisoning. But each had their reasons and you have to respect that.
I will say this: Canada is going to need players who are willing and able to make some sacrifices if they are ever going to win a medal internationally. That’s why what Thompson did this summer was so important and Joseph too. They jumped in after long tough NBA seasons. Things will never line-up perfectly for everyone. Contracts will always be an issue. Life events will come up. The circumstances may not be ideal. But you either want to experience international success or you don’t. And given how prominent international basketball has become and it will be awkward if at the end of their careers some of the best players Canada has ever had have a big hole on that part of their resume. I thought Nash’s comments, post-game, on the issue, were interesting: “I’m not sure overall if the Olympics resonate with the younger generation like it did, especially in certain spite have the sports. The world is changing all the time that it’s just one of those things. Kids have so many more options now to use and outlets. It doesn’t quite have the same resonance that it did before.”
Bonus time: Give credit to those who did make the trip. Levon Kendal and Joel Anthony in particular. Each played for Canada when the odds were truly stacked against them having any success and it was a great example for two men, both fathers with new kids, to play for Canada this summer with no guarantee that they’d even be on the Olympic roster if Canada qualified. Kendall didn’t even get to play in Manila and Anthony only got a few minutes against Senegal but their contributions shouldn’t be overlooked.
Cory Joseph plays so hard it’s impossible not to appreciate him, but he knows his faults. Even as he was keeping Canada close with France thanks to 20 points and six assists, you could see France increasing the pressure on him. Even with the Raptors Dwane Casey has pointed out Joseph’s tendency to ‘get sped up’ under pressure. What happened against France? He coughed the ball up seven times, many of them at critical moments: “We had a lot of turnovers, they sped me up a little bit and I had a lot of turnovers today,” said Joseph. “So that’s something I have to work on and get better for the next time.”
Nash identified shooting as an area of concern for the national team and it was glaring in this tournament. Canada shot 26 per cent from three for the tournament. Phil Scrubb and Brady Heslip – Canada’s best shooters — finished the week shooting 4-of-25 from deep.
And finally, Melvin Ejim is signed to play in Italy next season and is most likely at the beginning of what will be a long and lucrative European career that will see him gravitate to the best clubs in the world. He was Canada’s best player in the final, finishing with 19 points and making all four of his threes. It would be great to see him get a true NBA look, but regardless he’s clearly a special basketball player, with smarts, skills and athleticism that could help any team at any level. |
ERS-1 AND CCRS C-SAR Data Integration For Look Direction Bias Correction Using Wavelet Transform
Look direction bias in a single look SAR image can often be misinterpreted in the geological application of radar data. This paper investigates digital processing techniques for SAR image data integration and compensation of the SAR data look direction bias. The two important approaches for reducing look direction bias and integration of multiple SAR data sets are (1) principal component analysis (PCA), and (2) wavelet transform(WT) integration techniques. These two methods were investigated and tested with the ERS-1 (VV-polarization) and CCRS*s airborne (HH-polarization) C-SAR image data sets recorded over the Sudbury test site, Canada. The PCA technique has been very effective for integration of more than two layers of digital image data. When there only two sets of SAR data are available, the PCA thchnique requires at least one more set of auxiliary data for proper rendition of the fine surface features. The WT processing approach of SAR data integration utilizes the property which decomposes images into approximated image ( low frequencies) characterizing the spatially large and relatively distinct structures, and detailed image (high frequencies) in which the information on detailed fine structures are preserved. The test results with the ERS-1and CCRS*s C-SAR data indicate that the new WT approach is more efficient and robust in enhancibng the fine details of the multiple SAR images than the PCA approach. |
// NewS3PublicDownloader creates an instance of S3Downloader to a public AWS
// S3.
func NewS3PublicDownloader(region, bucket, key string) Downloader {
return S3Downloader{
session: session.Must(session.NewSession(&aws.Config{Region: aws.String(region)})),
bucket: bucket,
key: key,
}
} |
<filename>samples/TestCpp/Classes/IntervalTest/IntervalTest.cpp
#include "IntervalTest.h"
#include "../testResource.h"
#define SID_STEP1 100
#define SID_STEP2 101
#define SID_STEP3 102
#define IDC_PAUSE 200
IntervalLayer::IntervalLayer()
{
m_time0 = m_time1 = m_time2 = m_time3 = m_time4 = 0.0f;
CCSize s = CCDirector::sharedDirector()->getWinSize();
// sun
CCParticleSystem* sun = CCParticleSun::create();
sun->setTexture(CCTextureCache::sharedTextureCache()->addImage("Images/fire.png"));
sun->setPosition( ccp(VisibleRect::rightTop().x-32,VisibleRect::rightTop().y-32) );
sun->setTotalParticles(130);
sun->setLife(0.6f);
this->addChild(sun);
// timers
m_label0 = CCLabelBMFont::create("0", "fonts/bitmapFontTest4.fnt");
m_label1 = CCLabelBMFont::create("0", "fonts/bitmapFontTest4.fnt");
m_label2 = CCLabelBMFont::create("0", "fonts/bitmapFontTest4.fnt");
m_label3 = CCLabelBMFont::create("0", "fonts/bitmapFontTest4.fnt");
m_label4 = CCLabelBMFont::create("0", "fonts/bitmapFontTest4.fnt");
scheduleUpdate();
schedule(schedule_selector(IntervalLayer::step1));
schedule(schedule_selector(IntervalLayer::step2), 0);
schedule(schedule_selector(IntervalLayer::step3), 1.0f);
schedule(schedule_selector(IntervalLayer::step4), 2.0f);
m_label0->setPosition(ccp(s.width*1/6, s.height/2));
m_label1->setPosition(ccp(s.width*2/6, s.height/2));
m_label2->setPosition(ccp(s.width*3/6, s.height/2));
m_label3->setPosition(ccp(s.width*4/6, s.height/2));
m_label4->setPosition(ccp(s.width*5/6, s.height/2));
addChild(m_label0);
addChild(m_label1);
addChild(m_label2);
addChild(m_label3);
addChild(m_label4);
// Sprite
CCSprite* sprite = CCSprite::create(s_pPathGrossini);
sprite->setPosition( ccp(VisibleRect::left().x + 40, VisibleRect::bottom().y + 50) );
CCJumpBy* jump = CCJumpBy::create(3, ccp(s.width-80,0), 50, 4);
addChild(sprite);
sprite->runAction( CCRepeatForever::create(
(CCActionInterval*)(CCSequence::create(jump, jump->reverse(), NULL ))
)
);
// pause button
CCMenuItem* item1 = CCMenuItemFont::create("Pause", this, menu_selector(IntervalLayer::onPause) );
CCMenu* menu = CCMenu::create(item1, NULL);
menu->setPosition( ccp(s.width/2, s.height-50) );
addChild( menu );
}
IntervalLayer::~IntervalLayer()
{
if(CCDirector::sharedDirector()->isPaused())
{
CCDirector::sharedDirector()->resume();
}
}
void IntervalLayer::update(float dt)
{
m_time0 +=dt;
char time[10] = {0};
sprintf(time, "%2.1f", m_time0);
m_label0->setString(time);
}
void IntervalLayer::onPause(CCObject* pSender)
{
if(CCDirector::sharedDirector()->isPaused())
CCDirector::sharedDirector()->resume();
else
CCDirector::sharedDirector()->pause();
}
void IntervalLayer::step1(float dt)
{
m_time1 +=dt;
char str[10] = {0};
sprintf(str, "%2.1f", m_time1);
m_label1->setString( str );
}
void IntervalLayer::step2(float dt)
{
m_time2 +=dt;
char str[10] = {0};
sprintf(str, "%2.1f", m_time2);
m_label2->setString( str );
}
void IntervalLayer::step3(float dt)
{
m_time3 +=dt;
char str[10] = {0};
sprintf(str, "%2.1f", m_time3);
m_label3->setString( str );
}
void IntervalLayer::step4(float dt)
{
m_time4 +=dt;
char str[10] = {0};
sprintf(str, "%2.1f", m_time4);
m_label4->setString( str );
}
void IntervalTestScene::runThisTest()
{
CCLayer* pLayer = new IntervalLayer();
addChild(pLayer);
pLayer->release();
CCDirector::sharedDirector()->replaceScene(this);
}
|
Phytochemical Investigation and In Vitro Antioxidant Activities of Tetracarpidium conophorum (African Walnut) Seeds
Background: Tetracarpidium conophorum (African walnut) is an African plant with ethnobotanical uses. Objectives: The purpose of this study was to evaluate the phytochemical screening and in vitro antioxidant activities of methanol extract and fractions (F) of T. conophorum seeds. Methods: Phytochemical screening and in vitro antioxidant activity study were carried out using DPPH, ABTs radical scavenging assays, nitric oxide inhibitory and reducing potential assays. Results: Methanol extract and its fractions contain phenols, flavonoids, saponins, tannins, terpenoids, and alkaloids. The concentrations of total phenols and flavonoids content were significantly higher in EA-F and crude methanol extract compared to other fractions. Crude methanol and EA-F contain higher concentrations of tannin while hexane fraction had the lowest tannin content but relatively higher proanthocyanidin content compared to other fractions. The antioxidant activity study showed that both methanol crude extract and fractions of T. conophorum seeds have significant activities for DPPH radical scavenging, reducing power, ferric reducing antioxidant potential, nitric oxide inhibitory activities, ABTS and hydroxyl radical scavenging for. DPPH radical scavenging activities of EA-F showed the lowest IC50 of 33.11 µg/mL, followed by Hex-F, DCM-F and crude methanol extract with IC50 of 33.43, 42.09 and 45.44 µg/mL, respectively, when compared to ascorbic acid with IC50 of 17.08 µg/mL. Conclusion: The study showed that T. conophorum seed is a rich source of secondary metabolites, which may be responsible for its antioxidant activities. |
def add_compounds(self,new_compounds):
self.compounds += new_compounds.keys()
self.compounds = sorted(list(set(self.compounds)),key=lambda x:x.id)
for new_cmp in new_compounds.keys():
self.compounds_by_id[new_cmp.id] = new_cmp
self.compounds_by_clean_id[remove_non_alphanumeric(new_cmp.id).lower()] = new_cmp
for cmp in [c for c in new_compounds.keys() if new_compounds[c] != {}]:
for rxn in new_compounds[cmp].keys():
rxn.add_compounds({cmp:new_compounds[cmp][rxn]}) |
#include "Cable.h"
Cable::Cable(QGraphicsScene * scene)
{
m_scene = scene;
m_scale = 1.0;
}
Cable::~Cable()
{
}
void Cable::connecter(Composant *pere, Composant *fils)
{
m_scale = pere->scale();
fils->centrerV(pere);
float x1, y1, x2, y2;
x1 = pere->x() + pere->longueur()/2.0;
y1 = pere->y() + pere->hauteur();
x2 = fils->x() + fils->longueur()/2.0;
y2 = fils->y();
setLine(x1, y1, x2, y2);
}
void Cable::connecter(Composant *pere, GroupeDeComposants fils, float espacement, bool appliquerNiveau, float niveau)
{
m_scale = pere->scale();
if(fils.count() == 0)
return;
if(fils.count() == 1)
{
connecter(pere, (*fils.iteratorAt(0)));
return;
}
int nb = fils.count();
fils.centrerH(pere, espacement, appliquerNiveau, niveau);
float espace = 0.6*pere->longueur()/(nb - 1);
float xdepart = pere->x() + 0.2 * pere->longueur();
float espaceh = hmaxBrisee() * m_scale/(nb/2);
for(int i = 0; i < nb; i++)
{
Cable * cable = new Cable(m_scene);
m_scene->addItem(cable);
float x1 = (*fils.iteratorAt(i))->milieuHaut().x();
float y1 = (*fils.iteratorAt(i))->milieuHaut().y();
float x2 = xdepart + i*espace;
float y2 = pere->milieuBas().y();
int median = nb/2 + 1;
if((nb % 2 == 0) && (i+1 >= median))
{
median = nb/2;
}
float h = espaceh * abs(median - (i+1));
cable->setCableBrise(x1, y1, x2, y2, h);
}
}
void Cable::setCableBrise(float x1, float y1, float x2, float y2, float h1)
{
float h;
if(h1 <= 0.0 || h1 > hmaxBrisee())
{
h = hmaxBrisee() * m_scale;
}else
{
h = h1 * m_scale;
}
QGraphicsLineItem * lineH = new QGraphicsLineItem();
QGraphicsLineItem * lineV = new QGraphicsLineItem();
m_scene->addItem(lineH);
m_scene->addItem(lineV);
setLine(x1, y1, x1, y1 - h);
lineH->setLine(x1, y1 - h, x2, y1 - h);
lineV->setLine(x2, y1 - h, x2, y2);
}
void Cable::setCableBrise(QPoint p1, QPoint p2, float h1)
{
setCableBrise(p1.x(), p1.y(), p2.x(), p2.y(),h1);
}
|
def _sample_cts_dscr_hps_for_rand_exp_sampling(self):
if not self.options.use_additive_gp:
return super(EuclideanGPFitter, self)._sample_cts_dscr_hps_for_rand_exp_sampling()
else:
return sample_cts_dscr_hps_for_rand_exp_sampling_in_add_model( \
self.hp_tune_max_evals, self.cts_hp_bounds, self.dim, self.dscr_hp_vals, \
self.add_group_size_idx_in_dscr_hp_vals, self._tuning_objective) |
The very status of such parties as insurgents and rebels reflects their dilemma: By positioning themselves as outsiders, they exclude themselves from the mainstream, which they anyhow revile or mock as emblems of a corrupt and elite establishment that has failed the people.
That, in turn, deepens their vulnerability to the inherent frailty and short shelf life of narrow, issue-driven politics. Indeed, the failure of many to build the kind of political machines that determine Western elections leaves their leaders dependent on sometimes troublesome lieutenants and exposed to squabbles within their ranks.
In Britain, Nigel Farage, the beer-drinking, one-of-the-lads leader of UKIP, has tangled frequently with rambunctious figures in his own party, most recently last week, when one of them, Godfrey Bloom, was suspended after referring to women as “sluts” and using a copy of the party’s political program to beat a television reporter over the head, on camera.
Even Mr. Farage admitted that the episode on the fringes of the party’s autumn conference had been a huge setback. “We can’t have any one individual, however fun or flamboyant or entertaining or amusing they are, destroying UKIP’s national conference and that is what he has done,” Mr. Farage said of his erstwhile ally.
It is no coincidence that such populist tub-thumping parties — often anti-immigrant and conservative, but by no means limited to the far right — have seized headlines as Europe’s economic crisis has bitten deeply not only into pocketbooks but also into the reputation of the political elite.
The range of contenders embraces Geert Wilders’s Freedom Party in the Netherlands as much as parties on the left and right in Greece, including the neo-fascist Golden Dawn.
The insurgents’ record for durability is mixed. Some, like the Greens in Germany, or the more established National Front of Marine Le Pen in France, which long predates the latest wave of start-up rebels, have settled into the political spectrum. Others, like Germany’s Pirates, whose main issue is Internet freedom, have fizzled. |
Antitumor activity and antioxidant property of Curcuma caesia against Ehrlich’s ascites carcinoma bearing mice
Abstract Context: Curcuma caesia Roxb. (Zingiberaceae), commonly known as “Kala Haldi” in Bengali, has been traditionally used for the treatment of cancer, bruises, inflammation and as an aphrodisiac. Objective: To evaluate the antitumor activity and antioxidant status of the methanol extract of Curcuma caesia (MECC) rhizomes on Ehrlich’s ascites carcinoma (EAC)-treated mice. Materials and methods: In vitro cytotoxicity assay of MECC was evaluated by using Trypan blue method. Determination of in vivo antitumor activity was performed after 24 h of EAC cells (2 × 106 cells/mouse) inoculation; MECC (50 and 100 mg/kg i.p.) was administered daily for nine consecutive days. On day 10, half of the mice were sacrificed and the rest were kept alive for assessment of increase in lifespan. Antitumor effect of MECC was assessed by the study of tumor volume, tumor weight, viable and non-viable cell count, hematological parameters and biochemical estimations. Furthermore, antioxidant parameters were assayed by estimating liver and kidney tissue enzymes. Results: MECC showed direct cytotoxicity (IC50 90.70 ± 8.37 μg/mL) on EAC cell line. MECC exhibited significant (p < 0.01) decrease in tumor volume, tumor weight, viable cell count and percentage increased the lifespan (57.14 and 88.09%) of EAC-treated mice. Hematological profile, biochemical estimation, tissue antioxidant assay significantly (p < 0.01) reverted to normal level in MECC-treated mice. Conclusion: MECC possesses potent antitumor activity that may be due to its direct cytotoxic effect or antioxidant properties. Further research is in progress to find out the active principle(s) of MECC for its antitumor activity. |
import { CellLocation, ImmutableGrid } from "./game-shared-types";
export const shouldLive = (
currentGrid: ImmutableGrid,
rowIdx: number,
colIdx: number
) => {
const targetCellLiving = currentGrid[rowIdx][colIdx];
const liveNeighborCount = getLiveNeighborCount(currentGrid, {
row: rowIdx,
column: colIdx
});
if (targetCellLiving && (liveNeighborCount < 2 || liveNeighborCount > 3)) {
return false;
}
if (!targetCellLiving && liveNeighborCount !== 3) {
return false;
}
return true;
};
export const isNeighbor = (me: CellLocation, them: CellLocation) => {
if (me.row === them.row && me.column === them.column) {
return false;
}
if (
(them.row === me.row - 1 ||
them.row === me.row ||
them.row === me.row + 1) &&
(them.column === me.column - 1 ||
them.column === me.column ||
them.column === me.column + 1)
) {
return true;
}
return false;
};
const getLiveNeighborCount = (
grid: ImmutableGrid,
target: CellLocation
): number => {
let liveNeighborCount = 0;
const cellToCheck = { row: 0, column: 0 };
for (let rowIdx = 0; rowIdx < grid.length; rowIdx++) {
for (let columnIdx = 0; columnIdx < grid[rowIdx].length; columnIdx++) {
cellToCheck.row = rowIdx;
cellToCheck.column = columnIdx;
if (
grid[rowIdx][columnIdx] && // if cellToCheck is alive
isNeighbor(target, cellToCheck)
) {
liveNeighborCount += 1;
}
}
}
return liveNeighborCount;
};
|
TOM-based blind identification of cubic nonlinear systems
In this paper, we extend our previous studies on blind cubic nonlinear system identification from the second-order moment (SOM) domain into the third-order moment (TOM) domain. It is shown that under the given sufficient conditions, more subsets of truncated sparse Volterra systems can be blindly identified using TOM instead of SOM. This is consistent with the fact that more statistical knowledge can be obtained in the third-order statistics domain for blind system identification. Simulation results confirm the validity and usefulness of our proposed algorithm. |
//function use to enter in the ring network or to create it.
func startConnection() {
for !rightSet {
fmt.Print("Enter ip adress:port (enter for localhost): ")
reader := bufio.NewReader(os.Stdin)
text, _ := reader.ReadString('\n')
text = strings.TrimSuffix(text, "\n")
text = strings.TrimSuffix(text, "\r")
if text == "" {
text = os.Getenv("GAROU_DEFAULT_CONNECT_ADDRESS")
}
log.Infof("Trying to connect to %s", text)
var err error
rightSet = true
right, err = net.Dial("tcp", text)
if err != nil {
rightSet = false
log.Error(err)
} else {
log.Info("Connection success")
}
}
if right.RemoteAddr().String() != "[::1]:"+os.Getenv("GOROU_BIND_PORT") && right.RemoteAddr().String() != "127.0.0.1:"+os.Getenv("GOROU_BIND_PORT") {
rightMutex.Lock()
event := gonest.HelloMessageFactory(lanIPAddress)
writer := bufio.NewWriter(right)
encoded, _ := frame.EncodeEventB64(event)
_, err := writer.WriteString(encoded)
if err != nil {
panic(err.Error())
}
writer.Flush()
reader := bufio.NewReader(right)
log.Info("Waiting ...")
str, err := reader.ReadString('\n')
if err != nil {
panic(err.Error())
}
newMsg, err := frame.DecodeEventB64(str)
if err != nil {
panic(err.Error())
} else {
log.Trace(newMsg.String())
}
log.Debugf("Now setting right peer to %s", newMsg.GetItsHimMessage().GetRightNodeIpAddress())
err = right.Close()
if err != nil {
panic(err.Error())
}
right.Close()
right = nil
right, err = net.Dial("tcp", newMsg.GetItsHimMessage().GetRightNodeIpAddress())
if err != nil {
panic(err.Error())
}
rightMutex.Unlock()
}
sendIPList()
} |
/**
*
*/
package org.perm.testgenerator;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;
/**
*
* Part of Project PermTester
* @author <NAME>
*
*/
public class ConnectionOptions {
private static ConnectionOptions instance;
private Properties props;
private ConnectionOptions () throws FileNotFoundException, IOException {
props = new Properties ();
props.load(new FileInputStream("resource/options.txt"));
}
public static ConnectionOptions getInstance () throws FileNotFoundException, IOException {
if (instance == null)
instance = new ConnectionOptions ();
return instance;
}
public String getDbName () {
return props.getProperty("DBName");
}
public String getUser () {
System.out.println(props.get("User"));
return props.getProperty("User");
}
public String getPassword () {
return props.getProperty("Password");
}
public String getSchema () {
return props.getProperty("Schema");
}
public String getPath () {
return props.getProperty("Path");
}
public void setPath (String path) {
File filePath = new File (path);
Properties newProp = new Properties();
props.setProperty("Path", path);
try {
newProp.load(new FileInputStream(new File(filePath, "options.txt")));
props.setProperty("DBName", newProp.getProperty("DBName"));
props.setProperty("Password", newProp.getProperty("Password"));
} catch (Exception e) {
e.printStackTrace();
}
}
}
|
<gh_stars>0
import React from 'react';
import component from '@ohoareau/react-component';
import {useQuery} from '@apollo/react-hooks';
import ImageContent from './ImageContent';
import AttachFileIcon from '@material-ui/icons/AttachFile';
import CircularProgress from '@material-ui/core/CircularProgress';
import {getGraphQLQuery} from '@ohoareau/react-moduled';
export const types = {
'application/json': 'JSON',
'text/csv': 'Excel (CSV)',
'text/plain': 'Texte',
'image/jpeg': 'Image JPEG',
'image/png': 'Image PNG',
'*': 'Fichier',
};
export const mapType = t => types[t] || types['*'];
export const NoThumbnailContent = component<NoThumbnailContentProps>({
root: {
},
smallContainer: {
display: 'flex',
flexDirection: 'row',
},
name: {
fontSize: '1.1em',
marginBottom: 10,
marginTop: 15,
},
smallName: {
fontSize: '1.1em',
},
contentType: {
fontSize: '0.8em',
},
}, ({classes = {}, data, contentType, size}: NoThumbnailContentProps) => (
<div className={classes.root}>
{size === 'small' && (
<div className={classes.smallContainer}>
<AttachFileIcon />
<div>
<div className={classes.smallName}>{data.name || data.path}</div>
<div className={classes.contentType}>{mapType(contentType)}</div>
</div>
</div>
)}
{size !== 'small' && (
<>
<AttachFileIcon />
<div className={classes.name}>{data.name || data.path}</div>
<div className={classes.contentType}>{mapType(contentType)}</div>
</>
)}
</div>
));
export interface NoThumbnailContentProps {
classes?: {[key: string]: any},
data,
contentType,
size,
}
export const FetchContentWrapper = component<FetchContentWrapperProps>(undefined, ({data, context, size, project, file, contentType, children}: FetchContentWrapperProps) => {
const {data: d = {}, loading, error} = useQuery(getGraphQLQuery('GET_PROJECT_FILE_VIEW_URL'), {variables: {project, file, contentType}});
if (error) return <div>Error! ({error.message})</div>;
if (loading) return <div><CircularProgress /></div>;
const props = {data, context, path: d['getProjectFileViewUrl']['viewUrl'], contentType, size};
return children(props);
});
export interface FetchContentWrapperProps {
data?: any,
context?: any,
size?: any,
project?: any,
file?: any,
contentType?: any,
children?: any,
}
export const ProjectFileThumbnailContent = component<ProjectFileThumbnailContentProps>(undefined, ({data, project, context, size}: ProjectFileThumbnailContentProps) => {
project = project || context.context.project.id;
const file = data.path;
const contentType = data.type || 'application/octet-stream';
switch (contentType) {
case 'image/jpeg': return <FetchContentWrapper data={data} context={context} size={size} project={project} file={file} contentType={contentType}>{props => <ImageContent {...props} />}</FetchContentWrapper>;
case 'image/png': return <FetchContentWrapper data={data} context={context} size={size} project={project} file={file} contentType={contentType}>{props => <ImageContent {...props} />}</FetchContentWrapper>;
default: return <NoThumbnailContent data={data} contentType={contentType} size={size} />;
}
});
export interface ProjectFileThumbnailContentProps {
data?: any,
project?: any,
context?: any,
size?: any,
}
export default ProjectFileThumbnailContent |
<reponame>elenita1221/aerosolve<filename>core/src/main/java/com/airbnb/aerosolve/core/images/HOGFeature.java
package com.airbnb.aerosolve.core.images;
import java.awt.image.BufferedImage;
import java.lang.Override;
import java.lang.Math;
/*
Creates a histogram of oriented gradients.
http://en.wikipedia.org/wiki/Histogram_of_oriented_gradients
*/
public class HOGFeature extends ImageFeature {
private static final int kNumBins = 9;
// The histogram of oriented gradients.
// Split into two parts : gradient magnitude and bin.
private float[][] gradientMagnitude = null;
private byte[][] gradientBin = null;
private BufferedImage imgRef = null;
// Lookup table so we do not have to compute the atan
// millions of times.
private static byte[][] atanTable = computeAtanTable();
private static byte[][] computeAtanTable() {
// The possible values of dx and dy range from
// -255 to 255. So there are 511 values each.
// To prevent divisions by zero
final float kEpsilon = 1e-3f;
byte[][] atanTable = new byte[511][511];
for (int y = 0; y < 511; y++) {
for (int x = 0; x < 511; x++) {
float dx = x - 255;
float dy = y - 255;
if (x == 0) {
dx = kEpsilon;
}
float grad = dy / dx;
Double theta = Math.atan(grad);
theta = kNumBins * (0.5 + theta / Math.PI);
Integer bin = theta.intValue();
if (bin < 0) {
bin = 0;
}
if (bin >= kNumBins) {
bin = kNumBins - 1;
}
atanTable[x][y] = bin.byteValue();
}
}
return atanTable;
}
@Override public String featureName() {
return "hog";
}
// There are 9 orientation bins. This was determined
// to be the optimal bin size by the Dalal and Triggs paper.
@Override public int featureSize() {
return kNumBins;
}
@Override
public void analyze(BufferedImage image) {
imgRef = image;
int width = image.getWidth();
int height = image.getHeight();
gradientMagnitude = new float[width][height];
gradientBin = new byte[width][height];
int[][] lum = new int[width][height];
// Compute sum of all channels per pixel
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
int pixel = image.getRGB(x, y);
for (int i = 0; i < 3; i++) {
lum[x][y] += pixel & 0xff;
pixel = pixel >> 8;
}
lum[x][y] /= 3;
}
}
for (int y = 1; y < height - 1; y++) {
for (int x = 1; x < width - 1; x++) {
int dx = lum[x + 1][y] - lum[x - 1][y];
int dy = lum[x][y + 1] - lum[x][y - 1];
byte bin = atanTable[dx + 255][dy + 255];
Double mag = Math.sqrt(dx * dx + dy * dy);
gradientMagnitude[x][y] = mag.floatValue();
gradientBin[x][y] = bin;
}
}
}
@Override
public float[] extractFeature(int sx, int sy, int ex, int ey) {
float[] feature = new float[featureSize()];
if (sx >= ex || sy >= ey ||
ex > imgRef.getWidth() || ey > imgRef.getHeight()) {
return feature;
}
float sum = 0;
for (int y = sy; y < ey; y++) {
for (int x = sx; x < ex; x++) {
for (int i = 0; i < kNumBins; i++) {
byte bin = gradientBin[x][y];
float mag = gradientMagnitude[x][y];
feature[bin] += mag;
sum += mag;
}
}
}
if (sum > 0) {
float scale = 1.0f / sum;
for (int i = 0; i < featureSize(); i++) {
feature[i] *= scale;
}
}
return feature;
}
}
|
Flecktarn ( German pronunciation: [ˈflɛktaʁn]; "mottled camouflage"; also known as Flecktarnmuster or Fleckentarn) is a family of 3-, 4-, 5- or 6-color disruptive camouflage patterns, the most common being the five-color pattern, consisting of dark green, light green, black, red brown and green brown or tan depending on the manufacturer. The original German 5-color pattern was designed for use in European temperate woodland terrain. A 3-color variation called Tropentarn (formerly Wüstentarn) is intended for arid and desert conditions: the German Bundeswehr wore it in Afghanistan.
The original German 5-color flecktarn has been adopted, copied and modified by many countries for their own camouflage patterns.
History [ edit ]
The German Army started experimenting with camouflage patterns before World War II, and some army units used Splittermuster ("splinter pattern") camouflage, first issued in 1931.[2] Waffen-SS combat units used various patterns from 1935 onwards. Many SS camouflage patterns were designed by Prof. Johann Georg Otto Schick.[3]
Modern patterns [ edit ]
Flecktarn uniform in 2015 Germanuniform in 2015
In 1976, the Bundeswehr in Germany developed a number of prototype camouflage patterns, to be trialled as replacements for the solid olive-grey "moleskin" combat uniform. At least four distinct camouflage patterns were tested during Bundeswehr Truppenversuch 76 ("Bundeswehr Troop Trial 76"). These were based on patterns in nature:[2] one was called "Dots" or "Points"; another was called "Ragged Leaf" or "Saw Tooth Edge"; another was based on pine needles in winter.[2]
Designed by the German company Marquardt & Schulz, several patterns were developed and tested by the German military. The pattern named "Flecktarn B" was chosen as the final pattern for use. The word flecktarn is a composite formed from the German words Fleck (spot, blot, patch or pattern) and Tarnung (camouflage). The Bundeswehr kept its green combat dress throughout the 1980s, however, while trials were conducted. Flecktarn was only widely introduced in 1990 in a newly reunited Germany.[2]
In Germany, the Flecktarn camouflage pattern is used by all Bundeswehr service branches, the Heer (army), the Luftwaffe (air force), some Marine (navy) units and even the Sanitätsdienst (medical service). Its official name is 5 Farben-Tarndruck der Bundeswehr (5-color camouflage print of the Bundeswehr). This temperate Flecktarn 5-color scheme consists of 15% light green, 20% light olive, 35% dark green, 20% brown and 10% black.[4] It is also used by snipers of the Österreichisches Bundesheer (Federal Army of Austria) and Belgian Air Force ground personnel and airborne infantry. Albania used 5-color German flecktarn while participating in IFOR in Bosnia in 1996.[5][better source needed] France tested Flecktarn for use, but rejected it; the Dutch army also tested and rejected it, allegedly because it was "too aggressive".[2] Flecktarn was seen as controversial because of its resemblance to the Waffen-SS "peas" and "oak leaves" patterns, which also used dots in various colors.[2]
Variants [ edit ]
Flecktarn is the basis for the Bundeswehr's Tropentarn desert camouflage,[6] the Danish military's T/78 and M/84 camouflage, including a desert variation of the Danish pattern. Several variations of the Flecktarn camouflage are also used by the Russian military, one is called Sever ("north"), sometimes also referred as Flectarn-D while another variant is called Tochka-4. Other country's variations include Japan's Type II Camouflage; Type 03 Plateau camouflage, used by the Chinese military in Tibet (and some Russian Special Forces); and an urban variation used by some police units in Poland.[7]
In 2013, the German company Mil-Tec introduced a new version of Flecktarn, called the Arid Flecktarn. It retains the 5-color pattern but with the colour scheme resembling that of MultiCam.[8] It remains a commercial variant and is not in use by any world military.
Users [ edit ]
Non-State Actors [ edit ] |
<reponame>anonx/kit
// Package main is used as an entry point of
// the framework. It validates user input parameters
// and runs subcommands (aka tools).
package main
import (
"flag"
"os"
"github.com/goaltools/goal/internal/log"
"github.com/goaltools/goal/tools/create"
"github.com/goaltools/goal/tools/generate/handlers"
"github.com/goaltools/goal/tools/run"
"github.com/goaltools/goal/utils/tool"
)
var trace = flag.Bool("trace", false, "show stack trace in case of runtime errors")
// tools stores information about the registered subcommands (tools)
// the toolkit supports.
var tools = tool.NewContext(
create.Handler,
run.Handler,
handlers.Handler,
)
func main() {
// Do not show stacktrace if something goes wrong
// but tracing is disabled.
defer func() {
if err := recover(); err != nil {
if *trace {
log.Warn.Fatalf("TRACE: %v.", err)
}
os.Exit(0)
}
}()
// Try to run the command user requested.
// Ignoring the first argument as it is name of the executable.
flag.Parse()
err := tools.Run(flag.Args())
if err != nil {
log.Warn.Printf(unknownCmd, err, os.Args[0])
}
}
var unknownCmd = `Error: %v.
Run "%s help" for usage.`
|
<reponame>sudarshanGopal98/dress_check<filename>app/src/main/java/sudarshan_gopalakrishnan/fbla/tompkins/dresscheck/datatypes/Parsable.java
package sudarshan_gopalakrishnan.fbla.tompkins.dresscheck.datatypes;
/**
*
* The interface Parsable enables processes to call sendToParse(). This method is crucial in the data storage process and hence the
* implementation of such an interface is crucial for the storage of the program.
*
* @author Sudarshan
*/
public interface Parsable {
public void sendToParse();
public void updateFromParse() throws com.parse.ParseException;
}
|
import { Router } from 'express';
// Routes
import repoRoute from './repo.route';
interface Route {
path: string;
route: Router;
middlewares?: { (): void }[];
}
const router = Router();
const setRoutes = (routes: Route[]) => {
routes.forEach((route) => {
if (Array.isArray(route.middlewares) && route.middlewares.length) {
router.use(route.path, ...route.middlewares, route.route);
} else {
router.use(route.path, route.route);
}
});
};
const defaultRoutes: Route[] = [
{
path: '/repo',
route: repoRoute,
},
/* {
path: '/route',
route: routeFile,
middlewares: [middleware],
}, */
];
const devRoutes: Route[] = [];
setRoutes(defaultRoutes);
if (process.env.NODE_ENV !== 'production') {
setRoutes(devRoutes);
}
export default router;
|
/*
* 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 tech.dnaco.bytes.encoding;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.function.Consumer;
import tech.dnaco.bytes.ByteArraySlice;
import tech.dnaco.bytes.BytesUtil;
import tech.dnaco.collections.arrays.ByteArray;
public final class RowKeyUtil {
private static final byte[] ZERO = new byte[] { 0, 0 };
private RowKeyUtil() {
// no-op
}
public static ByteArraySlice keyWithoutLastComponent(final byte[] key) {
//final int offset = BytesUtil.lastIndexOf(key, 0, key.length, ZERO);
final int offset = lastKeyComponentOffset(key);
return new ByteArraySlice(key, 0, offset - ZERO.length);
}
public static byte[] lastKeyComponent(final byte[] key) {
final int offset = lastKeyComponentOffset(key);
return decode(key, offset, key.length - offset);
}
private static int lastKeyComponentOffset(final byte[] key) {
int offset = 0;
while (offset < key.length) {
final int separator = BytesUtil.indexOf(key, offset, ZERO);
if (separator < 0) break;
offset = separator + ZERO.length;
}
return offset;
}
public static int nextKeyComponent(final byte[] key, final int offset) {
return BytesUtil.indexOf(key, offset, ZERO) + ZERO.length;
}
public static List<byte[]> decodeKey(final byte[] key) {
final ArrayList<byte[]> parts = new ArrayList<>();
decodeKey(key, parts::add);
return parts;
}
public static void decodeKey(final byte[] key, final Consumer<byte[]> consumer) {
int offset = 0;
while (offset < key.length) {
final int separator = BytesUtil.indexOf(key, offset, ZERO);
if (separator < 0) {
consumer.accept(decode(key, offset, key.length - offset));
break;
}
consumer.accept(decode(key, offset, separator - offset));
offset = separator + ZERO.length;
}
}
private static byte[] decode(final byte[] buf, final int off, final int len) {
if (BytesUtil.indexOf(buf, off, len, (byte) 0) < 0) {
return Arrays.copyOfRange(buf, off, off + len);
}
final ByteArray key = new ByteArray(len - 1);
for (int i = 0; i < len; ++i) {
final int index = off + i;
key.add(buf[index]);
if (buf[index] == 0) {
if (buf[index + 1] != 1) {
throw new IllegalArgumentException("expected 0x01 after 0x00 got [" + (i + 1) + "] = " + Integer.toHexString(buf[off + i + 1]));
}
++i;
}
}
return key.drain();
}
public static RowKeyBuilder newKeyBuilder() {
return new RowKeyBuilder();
}
public static RowKeyBuilder newKeyBuilder(final byte[] key) {
return new RowKeyBuilder(key);
}
public static final class RowKeyBuilder {
private final ByteArray key = new ByteArray(32);
private RowKeyBuilder() {
// no-op
}
private RowKeyBuilder(final byte[] key) {
this.key.add(key);
}
public RowKeyBuilder addKeySeparator() {
key.add(ZERO);
return this;
}
public RowKeyBuilder addInt8(final int value) {
addInt(value & 0xff, 1);
return this;
}
public RowKeyBuilder addInt16(final int value) {
return addInt(value, 2);
}
public RowKeyBuilder addInt24(final long value) {
return addInt(value, 3);
}
public RowKeyBuilder addInt32(final long value) {
return addInt(value, 4);
}
public RowKeyBuilder addInt40(final long value) {
return addInt(value, 5);
}
public RowKeyBuilder addInt48(final long value) {
return addInt(value, 6);
}
public RowKeyBuilder addInt56(final long value) {
return addInt(value, 7);
}
public RowKeyBuilder addInt64(final long value) {
return addInt(value, 8);
}
public RowKeyBuilder addInt(final long value, final int bytesWidth) {
final byte[] buf = new byte[bytesWidth];
IntEncoder.BIG_ENDIAN.writeFixed(buf, 0, value, bytesWidth);
return add(buf, 0, bytesWidth);
}
public RowKeyBuilder add(final String value) {
return add(value.getBytes(StandardCharsets.UTF_8));
}
public RowKeyBuilder add(final byte[] buf) {
return add(buf, 0, buf.length);
}
public RowKeyBuilder add(final byte[] buf, final int off) {
return add(buf, off, buf.length - off);
}
public RowKeyBuilder add(final byte[] buf, final int off, final int len) {
if (key.isNotEmpty()) key.add(ZERO);
for (int i = 0; i < len; ++i) {
final byte currentByte = buf[off + i];
key.add(currentByte);
if (currentByte == 0x00) {
// replace 0x00 with 0x0001, 0x0000 is our key separator
key.add(0x01);
}
}
return this;
}
public byte[] drain() {
return key.drain();
}
public ByteArraySlice slice() {
return new ByteArraySlice(key.rawBuffer(), 0, key.size());
}
public RowKeyBuilder dump() {
System.out.println(key);
return this;
}
}
public static final class RowKeyDecoder {
private final byte[] key;
private int offset;
private RowKeyDecoder(final byte[] key) {
this.key = key;
this.offset = 0;
}
public int getInt8() {
return (int) getInt(1);
}
public int getInt16() {
return (int) getInt(2);
}
public int getInt24() {
return (int) getInt(3);
}
public long getInt32() {
return getInt(4);
}
public long addInt40() {
return getInt(5);
}
public long addInt48() {
return getInt(6);
}
public long addInt56() {
return getInt(7);
}
public long addInt64() {
return getInt(8);
}
public long getInt(final int bytesWidth) {
final long value = IntDecoder.BIG_ENDIAN.readFixed(key, offset, bytesWidth);
this.offset = nextKeyComponent(key, offset);
return value;
}
public String getString() {
final int nextOffset = nextKeyComponent(key, offset);
final String value = new String(key, offset, nextOffset - ZERO.length);
this.offset = nextOffset;
return value;
}
public ByteArraySlice getBytes() {
final int nextOffset = nextKeyComponent(key, offset);
final ByteArraySlice value = new ByteArraySlice(key, offset, nextOffset - ZERO.length);
this.offset = nextOffset;
return value;
}
}
}
|
/**
* Decode an LBER encoded value into an ASN1Type from a byte array.
*/
public ASN1Object decode(byte[] value)
{
ASN1Object asn1 = null;
ByteArrayInputStream in = new ByteArrayInputStream(value);
try {
asn1 = decode(in);
}
catch(IOException ioe) {
}
return asn1;
} |
In a blog post this morning by Kevin Rose, it appears as though Digg has cut roughly 10% of their staff. Layoffs have been made to around 12 employees, and it was difficult on the entire staff to part with many members.
Digg has done nothing but grow over the past few months, so it’s surprising to see a reduction in their team. It seems as though there are still many engineering positions open for the platform, and Digg, Inc. is actively still interested in hiring for jobs.
Below is a quote from Kevin’s post. He details why the decision was made to remove the staff members, and how Digg is still actively in growth for their latest transition.
This is one of the hardest decisions we’ve had to make recently but we strongly believe that it is the right decision for the long-term health of the company. In order to achieve our goals, we are putting more emphasis on the engineering and development efforts. In fact, we are still hiring for these teams as they are critical in getting us to where we need to be for the future, for our impending upcoming redesign and much beyond. The only way for us to truly succeed is to adapt and adjust as necessary.
As Kevin has taken over the CEO position at Digg again we’ve seen some great press and changes to the company. Clearly this is just another step along the path of Digg’s growth, and I’m excited to see where they plan on going. Hopefully once they can see some growth in the company they’ll be able to hire back a few employees lost to layoffs.
Even just a few months ago we were discussing Digg’s potential downfall. However it seems as though with Jay gone and the strictly-business attitude out the door, Kevin is able to resume chairman in the company and make necessary changes for serious growth. I’m happy to be proven wrong in my predictions, and best wishes to the entire Digg team.
If you are an engineer in the Bay area, seriously consider checking out Digg’s open positions. Digg’s a visionary for social news and I would love to see them grow and prosper even further than in past years. |
<filename>katas/lcd/py/kata/__init__.py
# Implement functions here
def template(arg):
result = f"Doing something with {arg}"
return result
DIGITS = [
[ # 0
[0, 1, 0], # 2
[1, 0, 1], # 5
[1, 1, 1], # 7
],
[ # 1
[0, 0, 0], # 0
[0, 0, 1], # 1
[0, 0, 1], # 1
],
[ # 2
[0, 1, 0], # 2
[0, 1, 1], # 3
[1, 1, 0], # 5
],
[ # 3
[0, 1, 0], # 2
[0, 1, 1], # 3
[0, 1, 1], # 3
],
[ # 4
[0, 0, 0], # 0
[1, 1, 1], # 7
[0, 0, 1], # 1
],
[ # 5
[0, 1, 0], # 2
[1, 1, 0], # 6
[0, 1, 1], # 3
],
[ # 6
[0, 1, 0], # 2
[1, 1, 0], # 6
[1, 1, 1], # 7
],
[ # 7
[0, 1, 0], # 2
[0, 0, 1], # 1
[0, 0, 1], # 1
],
[ # 8
[0, 1, 0], # 2
[1, 1, 1], # 7
[1, 1, 1], # 7
],
[ # 9
[0, 1, 0], # 2
[1, 1, 1], # 7
[0, 1, 1], # 3
],
]
encoding = [
[2, 5, 7], # 0
[0, 1, 1], # 1
[2, 3, 6], # 2
[2, 3, 3], # 3
[0, 7, 1], # 4
[2, 6, 3], # 5
[2, 6, 7], # 6
[2, 1, 1], # 7
[2, 7, 7], # 8
[2, 7, 3], # 9
]
lcd = [
" ", # 0
" |", # 1
" _ ", # 2
" _|", # 3
"| ", # 4
"| |", # 5
"|_ ", # 6
"|_|", # 7
]
def number_to_lcd(number):
result = []
digits = str(number) # '18'
line_top = ""
line_mid = ""
line_bot = ""
for digit in digits: # '1', '8'
enc = encoding[int(digit)]
line_top += lcd[enc[0]] # ' _ '
line_mid += lcd[enc[1]] # ' ||_|'
line_bot += lcd[enc[2]] # ' ||_|'
return "\n".join([line_top, line_mid, line_bot])
# Idea:
# #9
# [0, 1, 0], #2 -> ' _ '
# [1, 1, 1], #7 -> '|_|'
# [0, 1, 1], #3 -> ' _|'
# Idea 2:
# number_to_encoding
# #9: [2, 7, 3]
# encoding_to_string
# 2 -> ' _ '
# Change each line to bin then to dec and dec represents a string, e.g.
# 0 -> ' '
# 1 -> ' |'
# 2 -> ' _ '
# 3 -> ' _|'
# 4 -> '| '
# 5 -> '| |'
# 6 -> '|_ '
# 7 -> '|_|'
# Note: the upper line will never have bits 0 and 2 turned on.
|
/**
* The dual of {@link StreamMultiplexer}: This is an output stream into which
* you can dump the multiplexed stream, and it delegates the de-multiplexed
* content back into separate channels (instances of {@link OutputStream}).
*
* The format of the tagged output stream is as follows:
*
* <pre>
* combined :: = [ control_line payload ... ]+
* control_line :: = '@' marker '@'? '\n'
* payload :: = r'^[^\n]*\n'
* </pre>
*
* For more details, please see {@link StreamMultiplexer}.
*/
@ThreadCompatible
public final class StreamDemultiplexer extends OutputStream {
@Override
public void close() throws IOException {
flush();
}
@Override
public void flush() throws IOException {
if (selectedStream != null) {
selectedStream.flush();
}
}
/**
* The output streams, conveniently in an array indexed by the marker byte.
* Some of these will be null, most likely.
*/
private final OutputStream[] outputStreams =
new OutputStream[Byte.MAX_VALUE + 1];
/**
* Each state in this FSM corresponds to a position in the grammar, which is
* simple enough that we can just move through it from beginning to end as we
* parse things.
*/
private enum State {
EXPECT_MARKER_BYTE,
EXPECT_SIZE,
EXPECT_PAYLOAD,
}
private final int[] sizeBuffer = new int[4];
private State state = State.EXPECT_MARKER_BYTE;
private OutputStream selectedStream;
private int currentSizeByte = 0;
private int payloadBytesLeft = 0;
/**
* Construct a new demultiplexer. The {@code smallestMarkerByte} indicates
* the marker byte we would expect for {@code outputStreams[0]} to be used.
* So, if this first stream is your stdout and you're using the
* {@link StreamMultiplexer}, then you will need to set this to
* {@code 1}. Because {@link StreamDemultiplexer} extends
* {@link OutputStream}, this constructor effectively creates an
* {@link OutputStream} instance which demultiplexes the tagged data client
* code writes to it into {@code outputStreams}.
*/
public StreamDemultiplexer(byte smallestMarkerByte,
OutputStream... outputStreams) {
for (int i = 0; i < outputStreams.length; i++) {
this.outputStreams[smallestMarkerByte + i] = outputStreams[i];
}
}
@Override
public void write(int b) throws IOException {
// This dispatch traverses the finite state machine / grammar.
switch (state) {
case EXPECT_MARKER_BYTE:
parseMarkerByte(b);
break;
case EXPECT_SIZE:
parseSize(b);
break;
case EXPECT_PAYLOAD:
parsePayload(b);
break;
}
}
private void parseSize(int b) {
sizeBuffer[currentSizeByte] = b;
currentSizeByte += 1;
if (currentSizeByte == 4) {
state = State.EXPECT_PAYLOAD;
payloadBytesLeft = (sizeBuffer[0] << 24)
+ (sizeBuffer[1] << 16)
+ (sizeBuffer[2] << 8)
+ sizeBuffer[3];
}
}
/**
* Handles {@link State#EXPECT_MARKER_BYTE}. The byte determines which stream
* we will be using, and will set {@link #selectedStream}.
*/
private void parseMarkerByte(int markerByte) throws IOException {
if (markerByte < 0 || markerByte > Byte.MAX_VALUE) {
String msg = "Illegal marker byte (" + markerByte + ")";
throw new IllegalArgumentException(msg);
}
if (markerByte > outputStreams.length
|| outputStreams[markerByte] == null) {
throw new IOException("stream " + markerByte + " not registered.");
}
selectedStream = outputStreams[markerByte];
state = State.EXPECT_SIZE;
currentSizeByte = 0;
}
private void parsePayload(int b) throws IOException {
selectedStream.write(b);
payloadBytesLeft -= 1;
if (payloadBytesLeft == 0) {
state = State.EXPECT_MARKER_BYTE;
}
}
} |
package com.rg.annotationdemo;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import com.example.annotation.ViewInject;
//@PrintInject(value = {1, 2})
public class MainActivity extends AppCompatActivity {
@ViewInject(R.id.textview)
TextView textview;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
com.rg.annotationdemo.MainActivity$ViewBinding binding = new com.rg.annotationdemo.MainActivity$ViewBinding();
binding.bind(this);
textview.setOnClickListener(v -> {
Toast.makeText(this, "Hello", Toast.LENGTH_SHORT).show();
});
textview.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
return false;
}
});
}
}
|
import { assign } from "@xstate/fsm";
import { assertNever } from "../../utils";
import { ChangeType, EventType, MachineContext, MachineEvent } from "../types";
import { setFieldValue } from "./setFieldValue";
import { replace } from "./list/replace";
import { remove } from "./list/remove";
import { prepend } from "./list/prepend";
import { insert } from "./list/insert";
import { move } from "./list/move";
import { swap } from "./list/swap";
import { append } from "./list/append";
function setValuesRecipe<Values, SubmissionResult>(
context: MachineContext<Values, SubmissionResult>,
event: MachineEvent<Values, SubmissionResult>
) {
if (event.type !== EventType.Change) {
throw new Error(`unknown event type "${event.type}"`);
}
switch (event.payload.type) {
case ChangeType.Set: {
return setFieldValue(context, event.payload);
}
case ChangeType.ArrayAppend: {
return append(context, event.payload);
}
case ChangeType.ArraySwap: {
return swap(context, event.payload);
}
case ChangeType.ArrayMove: {
return move(context, event.payload);
}
case ChangeType.ArrayInsert: {
return insert(context, event.payload);
}
case ChangeType.ArrayPrepend: {
return prepend(context, event.payload);
}
case ChangeType.ArrayRemove: {
return remove(context, event.payload);
}
case ChangeType.ArrayReplace: {
return replace(context, event.payload);
}
default:
return assertNever(event.payload);
}
}
export const setValues = assign(setValuesRecipe);
|
<filename>config/test_quiet_include.h<gh_stars>0
/*
* For the raison d'etre of this file, check the comment above the definition
* of the PGAC_C_INLINE macro in config/c-compiler.m4.
*/
static inline int fun () { return 0; }
/*
* "IBM XL C/C++ for AIX, V12.1" miscompiles, for 32-bit, some inline
* expansions of ginCompareItemPointers() "long long" arithmetic. To take
* advantage of inlining, build a 64-bit PostgreSQL.
*/
#if defined(__ILP32__) && defined(__IBMC__)
#error "known inlining bug"
#endif
|
Phylogeny and Conservation edited by Andy Purvis, John L. Gittleman & Thomas Brooks (2005), xiii + 431 pp., Cambridge University Press, Cambridge, UK. ISBN 0-521-53200-0 (pbk), GBP 35.00.
When new scientific fields emerge a great deal of controversy often surrounds what they do and what they should consist of. One such field, conservation genetics, has arguably come of age in only the last 5 years, with the appearance of the first textbook and journal by that name. While participating in a recent Latin American conservation genetics workshop several contributors voiced strong skepticism about the relevance of phylogenetic techniques to the new discipline (notwithstanding their skilled use of such techniques in their non-conservation work). I therefore found it irresistible when, shortly afterward, the opportunity came along to review an edited volume on the subject. Satisfyingly, the editors of this book open their introductory chapter by implicitly recognizing such skepticism, arguing the need for a critical review based on the rapid recent growth in both phylogenetics and conservation biology, and on the fortuitous pre-adaptation of phylogenetic techniques to a growing (and some might say disturbing) trend in conservation biology toward priority-setting, planning, and 'diagnosis' (as opposed to 'cure'). However, they conclude their introduction with a disarming lack of self-promotion: 'In the end how will phylogenies impact conservation? Some of the evidence presented in this book suggests that their impact maybe sma l l . . . in other ways, phylogenetics may provide considerable benefits to conservation.' This dispassionate stance promises and delivers a judicious volume that combines the original work and reviews of a wide range of experts into four main sections, within and across which chapters are well edited to interconnect, with cohesively styled and clear graphics. |
def run(self, lib, opts, args):
if opts.library:
data_collector = library_data
else:
data_collector = tag_data
included_keys = []
for keys in opts.included_keys:
included_keys.extend(keys.split(','))
key_filter = make_key_filter(included_keys)
first = True
summary = {}
for data_emitter in data_collector(lib, ui.decargs(args)):
try:
data, item = data_emitter()
except (mediafile.UnreadableFileError, IOError) as ex:
self._log.error(u'cannot read file: {0}', ex)
continue
data = key_filter(data)
if opts.summarize:
update_summary(summary, data)
else:
if not first:
ui.print_()
if opts.keys_only:
print_data_keys(data, item)
else:
fmt = ui.decargs([opts.format])[0] if opts.format else None
print_data(data, item, fmt)
first = False
if opts.summarize:
print_data(summary) |
/**
* Constructing this joint hierarchy from bytes.<br>
* <br>
* Format:<br>
* First Sector [MetaData]:<br>
* JointCount (int) | Joint0NameSize (int) | Joint1NameSize (int) | ...<br>
* <br>
* Second Sector [JointData]:<br>
* Joint0Index (int) | Joint0ParentIndex (int) | Joint0Name (String) |
* Joint0InverseBindMatrix (float[]) | Joint0BindLocalPoseMatrix (float[]) |
* Joint1Index (int) | ...<br>
*
* @param data Bytes to construct hierarchy from
*/
public void fromBytes(byte[] data) {
int counter = 0;
int jointCount = ByteArrayUtils.fromBytesi(Arrays.copyOfRange(data, counter, counter += 4))[0];
int[] jointNameSizes = ByteArrayUtils
.fromBytesi(Arrays.copyOfRange(data, counter, counter += (4 * jointCount)));
HashMap<Integer, Pair<Joint, Integer>> allJoints = new HashMap<>();
for (int i = 0; i < jointCount; i++) {
int[] jointIndexes = ByteArrayUtils.fromBytesi(Arrays.copyOfRange(data, counter, counter += 8));
String name = new String(Arrays.copyOfRange(data, counter, counter += jointNameSizes[i]));
Matrix4f[] matrices = ByteArrayUtils.fromBytesm4(Arrays.copyOfRange(data, counter, counter += 128));
if (jointIndexes[1] == -1) {
this.index = jointIndexes[0];
this.name = name;
this.parent = null;
this.children.clear();
this.inverseBindMatrix.set(matrices[0]);
this.localPose.set(matrices[1]);
this.bindLocalPose.set(matrices[1]);
this.animatedTransform.setIdentity();
} else {
Joint joint = new Joint(jointIndexes[0], name, matrices[0], matrices[1]);
allJoints.put(jointIndexes[0], new Pair<>(joint, jointIndexes[1]));
}
}
for (Integer jointId : allJoints.keySet()) {
Pair<Joint, Integer> curJoint = allJoints.get(jointId);
if (curJoint.getValue() == this.index)
addChild(curJoint.getKey());
else
allJoints.get(curJoint.getValue()).getKey().addChild(curJoint.getKey());
}
} |
/**
* Test set class to instantiate.
*/
public void testSetClassToInstantiate(){
StudySiteSubClass studySiteSubClass= new StudySiteSubClass();
studySiteSubClass.setId(2);
ParameterizedBiDirectionalInstantiateFactory<DomainAbstractSubClass> parameterizedInstantiateFactory= new ParameterizedBiDirectionalInstantiateFactory<DomainAbstractSubClass>(DomainAbstractSubClass.class,studySiteSubClass);
parameterizedInstantiateFactory.setClassToInstantiate(AbstractMutableDeletableDomainObject.class);
assertEquals(AbstractMutableDeletableDomainObject.class, parameterizedInstantiateFactory.getClassToInstantiate());
} |
#include <iostream>
#include <vector>
using namespace std;
const int MAXN = 111;
enum Ttype {IN, OUT};
struct edge
{
int cost;
bool type;
int dist;
edge(int qc, bool qt, int qd): cost(qc), type(qt), dist(qd) {}
};
vector <edge> v[MAXN];
int go(int start, edge first)
{
int prev = start;
int curcost = 0, cur = start;
if (first.type == IN)
curcost = first.cost;
cur = first.dist;
while (cur != start)
{
for (int i = 0; i < 2; ++i)
{
if (v[cur][i].dist != prev)
{
if (v[cur][i].type == IN)
curcost += v[cur][i].cost;
prev = cur;
cur = v[cur][i].dist;
break;
}
}
}
return curcost;
}
int main()
{
int n;
cin >> n;
int st, en, cost;
for (int i = 0; i < n; ++i)
{
cin >> st >> en >> cost;
v[st].push_back(edge(cost, OUT, en));
v[en].push_back(edge(cost, IN, st));
}
cout << min(go(1, v[1][0]), go(1, v[1][1])) << endl;
return 0;
}
|
Effects of Dietary Protein of Proso Millet on Liver Injury Induced by D-galactosamine in Rats
In this paper, we examined the effects of dietary protein from proso millet on liver injury induced by D-galactosamine or carbon tetrachloride in rats using serum enzyme activities as indices. D-galactosamine- induced elevations of serum activities of aspartate aminotransferase, alanine aminotransferase, and lactate dehydrogenase were significantly suppressed by feeding the diet containing 20% protein of proso millet for 14 days as compared with those of rats fed a 20% casein diet, but not in the case of carbon tetrachloride. The results showed that proso millet protein is effective at lower dietary protein levels than that of dietary gluten reported previously. Therefore, the findings reported here may suggest that proso millet protein is considered to be another preventive food for liver injury. |
package dashboardapi
import (
"context"
"github.com/rancher/rancher/pkg/controllers/dashboard/helm"
"github.com/rancher/rancher/pkg/controllers/dashboardapi/feature"
"github.com/rancher/rancher/pkg/controllers/dashboardapi/settings"
"github.com/rancher/rancher/pkg/wrangler"
)
func Register(ctx context.Context, wrangler *wrangler.Context) error {
feature.Register(ctx, wrangler.Mgmt.Feature())
helm.RegisterReposForFollowers(ctx, wrangler.Core.Secret().Cache(), wrangler.Catalog.ClusterRepo())
return settings.Register(wrangler.Mgmt.Setting())
}
|
A very meaty issue of the British magazine STIR looks at a wide variety of projects based on Solidarity Economics. Produced in collaboration with the Institute for Solidarity Economics at Oxford, England, the Winter 2017 issue explores everything from municipal energy in London to cooperatively owned digital platforms, and from childcare coops to the robust solidarity economies being built in Catalan and Rojava. What’s striking about many of the articles is the fresh experimentation in new cooperative forms now underway.
Consider the Dutch organization BroodFondsMakers, based in Utrecht, an insurance-like system for self-employed individuals. When a public insurance program was abolished by the government in 2004, a small group of self-employed individuals got together to create their own insurance pool. More than a commercial scheme, members of the groups meet a few times a year, and even have outings and parties, in order to develop a certain intimacy and social cohesion.
When someone in a group gets sick for more than a month, they receive donations from the group, which usually have between 20 and 50 members. The mutual support is more than a cash payment, it is a form of emotional and social support as well. BroodFonds now has more than 200 groups and about 10,000 members participating in its system.
Another STIR article describes a new prototype for childcare in England that aims to overcome the well-known problems of high cost, low quality and poor availability of childcare. The new cooperative model, Kidoop, is meant to be co-produced by parents and playworkers, and not just a market transaction. The model, still being implemented, aims to provide greater flexibility, better quality care and working conditions, lower costs, and a system that parents actually want. |
/* This method returns the numerical index of a given observation
*
* @param type String representing the observation type.
*/
int Rinex3ObsHeader::getObsIndex( std::string type ) const
throw(InvalidRequest)
{
if( type.size() == 2 )
{
if( type == "C1" ) type = "C1C";
else if( type == "P1" ) type = "C1P";
else if( type == "L1" ) type = "L1P";
else if( type == "D1" ) type = "D1P";
else if( type == "S1" ) type = "S1P";
else if( type == "C2" ) type = "C2C";
else if( type == "P2" ) type = "C2P";
else if( type == "L2" ) type = "L2P";
else if( type == "D2" ) type = "D2P";
else if( type == "S2" ) type = "S2P";
else
{
InvalidRequest exc("Invalid type.");
GPSTK_THROW(exc);
}
}
if( type.size() == 3 )
{
type = "G" + type;
}
if( !isValidRinexObsID(type) )
{
InvalidRequest ir(type + " is not a valid RinexObsID!.");
GPSTK_THROW(ir);
}
string sysStr( type, 0, 1 );
RinexObsID robs(type);
map<std::string,vector<RinexObsID> >::const_iterator it;
it = mapObsTypes.find(sysStr);
if( it == mapObsTypes.end() )
{
InvalidRequest ir(sysStr + " is not a valid GNSS!.");
GPSTK_THROW(ir);
}
vector<RinexObsID> vecObs(it->second);
size_t index(0);
bool found(false);
while( !found && index < vecObs.size() )
{
found = ( vecObs[index] == robs );
index++;
}
--index;
if( !found )
{
InvalidRequest ir(type + " RinexObsID is not stored!.");
GPSTK_THROW(ir);
}
return index;
} |
/**
* Testing isSecureServer flag is working correctly.
* 1. setting the flag to FALSE, and provide necessary info to create Secure server.
* result = normal server
* 2. setting the flag to TRUE, and provide necessary info to create Secure server.
* result = secure server
*
* @throws Exception any unexpected exception
*/
@Category(PortDependentTest.class)
@Test
public void notSecureServerCreatedTest01() throws Exception {
miniServer = HttpMiniServer.custom().serverHost(LOCAL_HOST).serverPort(MessageTestHelper.getAvailablePort())
.mainHandler(handler).keyStoreFile(tempFolder.getRoot().getAbsolutePath() + "/server.jks").keyStorePassword(KEY_STORE_PASSWORD)
.trustStoreFile(tempFolder.getRoot().getAbsolutePath() + "/server.jks").trustStorePassword(KEY_STORE_PASSWORD)
.keyStoreType("JKS").isSecureServer(false).build();
miniServer.create();
Field serverField = miniServer.getClass().getDeclaredField("server");
serverField.setAccessible(true);
HttpServer server = (HttpServer) serverField.get(miniServer);
Assert.assertFalse(server instanceof HttpsServer);
secureServerSetUp();
miniServer = HttpMiniServer.custom().serverHost(LOCAL_HOST).serverPort(MessageTestHelper.getAvailablePort())
.mainHandler(handler).keyStoreFile(tempFolder.getRoot().getAbsolutePath() + "/server.jks").keyStorePassword(KEY_STORE_PASSWORD)
.trustStoreFile(tempFolder.getRoot().getAbsolutePath() + "/server.jks").trustStorePassword(KEY_STORE_PASSWORD)
.keyStoreType("JKS").isSecureServer(true).build();
miniServer.create();
serverField = miniServer.getClass().getDeclaredField("server");
serverField.setAccessible(true);
server = (HttpServer) serverField.get(miniServer);
Assert.assertTrue(server instanceof HttpsServer);
} |
#pragma once
#include "GameObject.h"
class Box : public GameObject
{
public:
Box() {}
~Box() {}
}; |
“You are wasting your life”
I heard this a lot when I first decided to leave my job to become a nun.
I worked in the IT department of an up-and-coming company and I had just received a promotion and a huge raise.
I was pretty, I was young, I was gifted. My future was bright.
Two of my coworkers took me aside and told me that they did not want me to “throw away my life.”
My looks were mentioned, my intelligence, my youth.
No doubt many of you read the article in Huffington Post recently by Angela Svec entitled “Too Pretty to Be a Nun?” In the article, Angela relates the reactions that she has received to her plans to discern religious life, including comments that she is too pretty or too smart to become a nun.
I relate to her experience, as I am sure most discerning young men and women can. Not all of us have looks that can be compared to Angelina Jolie, but we do live in a culture that elevates youth to one of the highest ideals. To dedicate one’s youth, looks, smarts, strength, and gifts to something other than ourselves is profoundly counter-cultural.
And one does not have to become a nun to do it.
All one really has to do is become a Christian.
The truth is that beneath every comment about wasted youth, looks and smarts is a lack of belief in God, and particularly a lack of belief in Jesus.
It was easy for me to put that on others before I entered the convent. After I entered I realized that I had those same doubts gurgling beneath the surface just as much as those who expressed their disbelief that someone like me would choose to become a nun.
The question in my subconscious was always, “What if I commit to this and it turns out that I can’t really cut it. Will the grace be there for me to persevere?”
And then beneath that question was, “What if I do this and God is not really there? Then I will be throwing my life away.”
The thing is – anyone who understands at least the concept of God understands that if God exists, then it is not a waste to dedicate one’s life to the Creator. To espouse oneself to the Creator of the Universe is pretty much the best deal out there.
If that Creator exists.
And if one dedicates one’s life to God, the incarnation of Jesus Christ tells us that the grace for that life will be given to us.
If Jesus is really God.
It is only when one doubts the existence of God and the Incarnation itself that one begins to speak of throwing one’s life away and of waste.
This is why so many of us settle for mediocre lives. The real Christian life requires risk. It requires waste. It requires an almost suicidal, foolish and perilous love for God.
Jesus was speaking to all Christians when he said:
Amen, amen, I say to you, unless a grain of wheat falls to the ground and dies, it remains just a grain of wheat; but if it dies, it produces much fruit. (Jn 12:25)
The real Christian life is like standing at the edge of a precipice and jumping off, knowing – in faith – that at the bottom are the arms of God, not the cold, hard ground.
But the thing is, we will never be 100% sure that God will meet us at the bottom, until it actually happens.
That is why faith is a risk, an adventure, a gamble.
It always entails the possibility of waste: extravagant, lavish, foolish waste…
But God is worth it. |
def from_packets(cls, source: PacketSource) -> 'StreamDigest':
packet_digests = []
def append_to_digest(p: Packet):
if isinstance(p, LidarPacket):
packet_digests.append(ScanDigest.from_packet(p))
packets = Packets(side_effect(append_to_digest, source),
source.metadata)
scan_digests = list(map(ScanDigest.from_scan, Scans(packets)))
return cls(source.metadata, packet_digests, scan_digests) |
<filename>sdk/go/azure/network/getPublicIPs.go
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package network
import (
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Use this data source to access information about a set of existing Public IP Addresses.
func GetPublicIPs(ctx *pulumi.Context, args *GetPublicIPsArgs, opts ...pulumi.InvokeOption) (*GetPublicIPsResult, error) {
var rv GetPublicIPsResult
err := ctx.Invoke("azure:network/getPublicIPs:getPublicIPs", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getPublicIPs.
type GetPublicIPsArgs struct {
// The Allocation Type for the Public IP Address. Possible values include `Static` or `Dynamic`.
AllocationType *string `pulumi:"allocationType"`
// Filter to include IP Addresses which are attached to a device, such as a VM/LB (`true`) or unattached (`false`).
Attached *bool `pulumi:"attached"`
// A prefix match used for the IP Addresses `name` field, case sensitive.
NamePrefix *string `pulumi:"namePrefix"`
// Specifies the name of the resource group.
ResourceGroupName string `pulumi:"resourceGroupName"`
}
// A collection of values returned by getPublicIPs.
type GetPublicIPsResult struct {
AllocationType *string `pulumi:"allocationType"`
Attached *bool `pulumi:"attached"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
NamePrefix *string `pulumi:"namePrefix"`
// A List of `publicIps` blocks as defined below filtered by the criteria above.
PublicIps []GetPublicIPsPublicIp `pulumi:"publicIps"`
ResourceGroupName string `pulumi:"resourceGroupName"`
}
|
package org.sagebionetworks.bridge.models.files;
import static org.sagebionetworks.bridge.TestConstants.GUID;
import static org.sagebionetworks.bridge.TestConstants.TEST_APP_ID;
import static org.sagebionetworks.bridge.TestConstants.TIMESTAMP;
import static org.sagebionetworks.bridge.models.files.FileDispositionType.INLINE;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNull;
import static org.testng.Assert.assertTrue;
import com.fasterxml.jackson.databind.JsonNode;
import org.mockito.Mockito;
import org.testng.annotations.Test;
import org.sagebionetworks.bridge.json.BridgeObjectMapper;
import nl.jqno.equalsverifier.EqualsVerifier;
public class FileMetadataTest extends Mockito {
@Test
public void equalsHashCode() {
EqualsVerifier.forClass(FileMetadata.class).allFieldsShouldBeUsed().verify();
}
@Test
public void canSerialize() throws Exception {
FileMetadata metadata = new FileMetadata();
metadata.setAppId(TEST_APP_ID);
metadata.setName("oneName");
metadata.setGuid(GUID);
metadata.setDescription("oneDescription");
metadata.setDeleted(true);
metadata.setDisposition(INLINE);
metadata.setVersion(3L);
metadata.setCreatedOn(TIMESTAMP);
metadata.setModifiedOn(TIMESTAMP.plusHours(1));
JsonNode node = BridgeObjectMapper.get().valueToTree(metadata);
assertEquals(node.get("name").textValue(), "oneName");
assertEquals(node.get("guid").textValue(), GUID);
assertEquals(node.get("description").textValue(), "oneDescription");
assertTrue(node.get("deleted").booleanValue());
assertEquals(node.get("disposition").textValue(), "inline");
assertEquals(node.get("version").intValue(), 3);
assertEquals(node.get("createdOn").textValue(), TIMESTAMP.toString());
assertEquals(node.get("modifiedOn").textValue(), TIMESTAMP.plusHours(1).toString());
assertEquals(node.get("type").textValue(), "FileMetadata");
assertNull(node.get("studyId"));
assertNull(node.get("appId"));
FileMetadata deser = BridgeObjectMapper.get().readValue(node.toString(), FileMetadata.class);
assertNull(deser.getAppId());
assertEquals(deser.getName(), "oneName");
assertEquals(deser.getGuid(), GUID);
assertEquals(deser.getDescription(), "oneDescription");
assertTrue(deser.isDeleted());
assertEquals(deser.getDisposition(), INLINE);
assertEquals(deser.getVersion(), 3L);
assertEquals(deser.getCreatedOn(), TIMESTAMP);
assertEquals(deser.getModifiedOn(), TIMESTAMP.plusHours(1));
}
}
|
#include "../_ft_internal.h"
//TODO: SO_BINDTODEVICE
static void _ft_listener_on_io(struct ev_loop *loop, struct ev_io *watcher, int revents);
const char * ft_listener_class = "ft_listener";
///
bool ft_listener_init(struct ft_listener * this, const struct ft_listener_delegate * delegate, struct ft_context * context, struct addrinfo * ai)
{
int rc;
int fd = -1;
bool ok;
const int on = 1;
assert(this != NULL);
assert(delegate != NULL);
assert(context != NULL);
FT_TRACE(FT_TRACE_ID_LISTENER, "BEGIN fa:%d st:%d pr:%d", ai->ai_family, ai->ai_socktype, ai->ai_protocol);
ok = ft_socket_init_(
&this->base.socket, ft_listener_class, context,
ai->ai_family, ai->ai_socktype, ai->ai_protocol,
ai->ai_addr, ai->ai_addrlen
);
if (!ok) return false;
this->delegate = delegate;
this->listening = false;
this->backlog = ft_config.sock_listen_backlog;
this->stats.accept_events = 0;
char addrstr[NI_MAXHOST+NI_MAXSERV];
if (this->base.socket.ai_family == AF_UNIX)
{
struct sockaddr_un * un = (struct sockaddr_un *)&this->base.socket.addr;
struct stat statbuf;
rc = stat(un->sun_path, &statbuf);
if ((rc == 0) && (S_ISSOCK(statbuf.st_mode)))
{
// Remove stalled unix socket
rc = unlink(un->sun_path);
if (rc != 0) FT_WARN_ERRNO(errno, "unlink(%s)", un->sun_path);
else FT_WARN("Stalled listen unix socket '%s', deleting", un->sun_path);
}
snprintf(addrstr, sizeof(addrstr)-1, "%.*s", (int)sizeof(un->sun_path), un->sun_path);
}
else
{
char hoststr[NI_MAXHOST];
char portstr[NI_MAXHOST];
rc = getnameinfo((const struct sockaddr *)&this->base.socket.addr, this->base.socket.addrlen, hoststr, sizeof(hoststr), portstr, sizeof(portstr), NI_NUMERICHOST | NI_NUMERICSERV);
if (rc != 0)
{
if (rc == EAI_FAMILY)
{
FT_WARN("Unsupported family: %d", this->base.socket.ai_family);
// This is not a failure
FT_TRACE(FT_TRACE_ID_LISTENER, "END EAI_FAMILY");
return false;
}
FT_WARN("Problem occured when resolving listen socket: %s", gai_strerror(rc));
snprintf(addrstr, sizeof(addrstr)-1, "? ?");
}
else
snprintf(addrstr, sizeof(addrstr)-1, "%s %s", hoststr, portstr);
}
// Create socket
fd = socket(this->base.socket.ai_family, this->base.socket.ai_socktype, this->base.socket.ai_protocol);
if (fd < 0)
{
FT_ERROR_ERRNO(errno, "Failed creating listen socket");
goto error_exit;
}
// Set reuse address option
if ((ai->ai_family == AF_INET) || (ai->ai_family == AF_INET6))
{
rc = setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (const char *) &on, sizeof(on));
if (rc == -1)
{
FT_WARN_ERRNO(errno, "Failed when setting option SO_REUSEADDR to listen socket");
}
}
#ifdef SO_REUSEPORT
if ((ai->ai_family == AF_INET) || (ai->ai_family == AF_INET6))
{
// Set reuse port option
rc = setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, (const char *) &on, sizeof(on));
if (rc == -1)
{
FT_WARN_ERRNO(errno, "Failed when setting option SO_REUSEPORT to listen socket");
}
}
#endif
// For IPv6, enable IPV6_V6ONLY option
if (this->base.socket.ai_family == AF_INET6)
{
rc = setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, (void *)&on, sizeof(on));
if (rc == -1)
{
FT_ERROR_ERRNO(errno, "Failed when setting option IPV6_V6ONLY to listen socket");
goto error_exit;
}
}
bool res = ft_fd_nonblock(fd, true);
if (!res) FT_WARN_ERRNO(errno, "Failed when setting listen socket to non-blocking mode");
#if TCP_DEFER_ACCEPT
// See http://www.techrepublic.com/article/take-advantage-of-tcp-ip-options-to-optimize-data-transmission/
int timeout = 1;
rc = setsockopt(fd, IPPROTO_TCP, TCP_DEFER_ACCEPT, &timeout, sizeof(int));
if (rc == -1) FT_WARN_ERRNO(errno, "Failed when setting option TCP_DEFER_ACCEPT to listen socket");
#endif // TCP_DEFER_ACCEPT
// Bind socket
rc = bind(fd, (const struct sockaddr *)&this->base.socket.addr, this->base.socket.addrlen);
if (rc != 0)
{
FT_ERROR_ERRNO(errno, "Failed to bind to '%s'", addrstr);
goto error_exit;
}
ev_io_init(&this->watcher, _ft_listener_on_io, fd, EV_READ);
this->watcher.data = this;
FT_DEBUG("Listening on '%s'", addrstr);
FT_TRACE(FT_TRACE_ID_LISTENER, "END fd:%d", fd);
return true;
error_exit:
if (fd >= 0) close(fd);
FT_TRACE(FT_TRACE_ID_LISTENER, "END error");
return false;
}
void ft_listener_fini(struct ft_listener * this)
{
int rc;
assert(this != NULL);
assert(this->base.socket.clazz == ft_listener_class);
FT_TRACE(FT_TRACE_ID_LISTENER, "BEGIN fd:%d", this->watcher.fd);
if (this->watcher.fd >= 0)
{
ev_io_stop(this->base.socket.context->ev_loop, &this->watcher);
rc = close(this->watcher.fd);
if (rc != 0) FT_ERROR_ERRNO(errno, "close()");
this->watcher.fd = -1;
}
if (this->base.socket.ai_family == AF_UNIX)
{
struct sockaddr_un * un = (struct sockaddr_un *)&this->base.socket.addr;
rc = unlink(un->sun_path);
if (rc != 0) FT_WARN_ERRNO(errno, "Unlinking unix socket '%s'", un->sun_path);
}
FT_TRACE(FT_TRACE_ID_LISTENER, "END");
}
bool _ft_listener_cntl_start(struct ft_listener * this)
{
int rc;
assert(this != NULL);
assert(this->base.socket.clazz == ft_listener_class);
FT_TRACE(FT_TRACE_ID_LISTENER, "BEGIN fd:%d", this->watcher.fd);
if (this->watcher.fd < 0)
{
FT_WARN("Listening on socket that is not open!");
FT_TRACE(FT_TRACE_ID_LISTENER, "END not open fd:%d", this->watcher.fd);
return false;
}
if (!this->listening)
{
rc = listen(this->watcher.fd, this->backlog);
if (rc != 0)
{
FT_ERROR_ERRNO_P(errno, "listen(%d, %d)", this->watcher.fd, this->backlog);
FT_TRACE(FT_TRACE_ID_LISTENER, "END listen error fd:%d", this->watcher.fd);
return false;
}
this->listening = true;
}
ev_io_start(this->base.socket.context->ev_loop, &this->watcher);
FT_TRACE(FT_TRACE_ID_LISTENER, "END fd:%d", this->watcher.fd);
return true;
}
bool _ft_listener_cntl_stop(struct ft_listener * this)
{
FT_TRACE(FT_TRACE_ID_LISTENER, "BEGIN fd:%d", this->watcher.fd);
assert(this != NULL);
assert(this->base.socket.clazz == ft_listener_class);
if (this->watcher.fd < 0)
{
FT_WARN("Listening (stop) on socket that is not open!");
FT_TRACE(FT_TRACE_ID_LISTENER, "END not open fd:%d", this->watcher.fd);
return false;
}
ev_io_stop(this->base.socket.context->ev_loop, &this->watcher);
FT_TRACE(FT_TRACE_ID_LISTENER, "END fd:%d", this->watcher.fd);
return true;
}
static void _ft_listener_on_io(struct ev_loop * loop, struct ev_io *watcher, int revents)
{
struct ft_listener * this = watcher->data;
assert(this != NULL);
assert(this->base.socket.clazz == ft_listener_class);
FT_TRACE(FT_TRACE_ID_LISTENER, "BEGIN fd:%d", this->watcher.fd);
if (revents & EV_ERROR)
{
FT_ERROR("Listen socket (accept) got invalid event");
FT_TRACE(FT_TRACE_ID_LISTENER, "END ev error fd:%d", this->watcher.fd);
return;
}
if ((revents & EV_READ) == 0)
{
FT_TRACE(FT_TRACE_ID_LISTENER, "END noop fd:%d", this->watcher.fd);
return;
}
this->stats.accept_events += 1;
struct sockaddr_storage client_addr;
socklen_t client_len = sizeof(struct sockaddr_storage);
// Accept client request
int client_socket = accept(watcher->fd, (struct sockaddr *)&client_addr, &client_len);
if (client_socket < 0)
{
if ((errno == EAGAIN) || (errno==EWOULDBLOCK))
{
FT_TRACE(FT_TRACE_ID_LISTENER, "END fd:%d", this->watcher.fd);
return;
}
int errnum = errno;
FT_ERROR_ERRNO(errnum, "Accept on listening socket");
FT_TRACE(FT_TRACE_ID_LISTENER, "END fd:%d errno:%d", this->watcher.fd, errnum);
return;
}
if (this->delegate->accept == NULL)
{
close(client_socket);
FT_TRACE(FT_TRACE_ID_LISTENER, "END fd:%d ", this->watcher.fd);
return;
}
/*
char host[NI_MAXHOST];
char port[NI_MAXSERV];
rc = getnameinfo((struct sockaddr *)&client_addr, client_len, host, sizeof(host), port, sizeof(port), NI_NUMERICHOST | NI_NUMERICSERV);
if (rc != 0)
{
FT_WARN("Failed to resolve address of accepted connection: %s", gai_strerror(rc));
strcpy(host, "?");
strcpy(port, "?");
}
*/
bool ok = this->delegate->accept(this, client_socket, (const struct sockaddr *)&client_addr, client_len);
if (!ok) close(client_socket);
FT_TRACE(FT_TRACE_ID_LISTENER, "END fd:%d cfd:%d ok:%c", this->watcher.fd, client_socket, ok ? 'Y' : 'N');
}
///
static void ft_listener_list_on_remove(struct ft_list * list, struct ft_list_node * node)
{
assert(list != NULL);
ft_listener_fini((struct ft_listener *)node->data);
}
bool ft_listener_list_init(struct ft_list * list)
{
assert(list != NULL);
return ft_list_init(list, ft_listener_list_on_remove);
}
bool ft_listener_list_cntl(struct ft_list * list, const int control_code)
{
assert(list != NULL);
FT_TRACE(FT_TRACE_ID_LISTENER, "BEGIN");
bool ok = true;
FT_LIST_FOR(list, node)
{
FT_TRACE(FT_TRACE_ID_LISTENER, "node");
ok &= ft_listener_cntl((struct ft_listener *)node->data, control_code);
}
FT_TRACE(FT_TRACE_ID_LISTENER, "END ok:%c", ok ? 'y' : 'N');
return ok;
}
int ft_listener_list_extend(struct ft_list * list, const struct ft_listener_delegate * delegate, struct ft_context * context, int ai_family, int ai_socktype, const char * host, const char * port, void * data)
{
assert(list != NULL);
assert(delegate != NULL);
assert(context != NULL);
int rc;
struct addrinfo hints;
FT_TRACE(FT_TRACE_ID_LISTENER, "BEGIN");
memset(&hints, 0, sizeof(struct addrinfo));
hints.ai_family = ai_family;
hints.ai_socktype = ai_socktype;
hints.ai_flags = AI_PASSIVE;
hints.ai_protocol = 0;
hints.ai_canonname = NULL;
hints.ai_addr = NULL;
hints.ai_next = NULL;
if (ai_family == AF_UNIX)
{
struct sockaddr_un un;
un.sun_family = AF_UNIX;
snprintf(un.sun_path, sizeof(un.sun_path)-1, "%s", host);
hints.ai_addr = (struct sockaddr *)&un;
hints.ai_addrlen = sizeof(un);
rc = ft_listener_list_extend_by_addrinfo(list, delegate, context, &hints, data);
}
else
{
struct addrinfo * res;
if (strcmp(host, "*") == 0) host = NULL;
rc = getaddrinfo(host, port, &hints, &res);
if (rc != 0)
{
FT_ERROR("getaddrinfo failed: %s", gai_strerror(rc));
return -1;
}
rc = ft_listener_list_extend_by_addrinfo(list, delegate, context, res, data);
freeaddrinfo(res);
}
FT_TRACE(FT_TRACE_ID_LISTENER, "END rc:%d", rc);
return rc;
}
int ft_listener_list_extend_by_addrinfo(struct ft_list * list, const struct ft_listener_delegate * delegate, struct ft_context * context, struct addrinfo * rp_list, void * data)
{
assert(list != NULL);
assert(delegate != NULL);
assert(context != NULL);
FT_TRACE(FT_TRACE_ID_LISTENER, "BEGIN");
int rc = 0;
for (struct addrinfo * rp = rp_list; rp != NULL; rp = rp->ai_next)
{
struct ft_list_node * new_node = ft_list_node_new(sizeof(struct ft_listener));
if (new_node == NULL)
{
FT_WARN("Failed to allocate memory for a new listener");
continue;
}
bool ok = ft_listener_init((struct ft_listener *)new_node->data, delegate, context, rp);
if (!ok)
{
ft_list_node_del(new_node);
FT_WARN("Failed to initialize a new listener");
continue;
}
ft_list_append(list, new_node);
((struct ft_listener *)new_node->data)->base.socket.data = data;
rc += 1;
}
FT_TRACE(FT_TRACE_ID_LISTENER, "END rc:%d", rc);
return rc;
}
int ft_listener_list_extend_auto(struct ft_list * list, const struct ft_listener_delegate * delegate, struct ft_context * context, int ai_socktype, const char * value, void * data)
{
assert(list != NULL);
assert(delegate != NULL);
assert(context != NULL);
FT_TRACE(FT_TRACE_ID_LISTENER, "BEGIN");
int rc;
regex_t regex;
regmatch_t match[10];
// Multiple listen entries supported
char * addr = NULL;
char * port = NULL;
int ai_family = -1;
// UNIX path
if ((value[0] == '/') || (value[0] == '.'))
{
ai_family = PF_UNIX;
port = strdup("");
addr = strdup(value);
goto fin_getaddrinfo;
}
// Port only
rc = regcomp(®ex, "^([0-9]{1,4}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$", REG_EXTENDED);
assert(rc == 0);
rc = regexec(®ex, value, 2, match, 0);
if (rc == 0)
{
ai_family = PF_UNSPEC; // IPv4 and IPv6
port = strndup(value + match[1].rm_so, match[1].rm_eo - match[1].rm_so);
addr = strdup("*");
regfree(®ex);
goto fin_getaddrinfo;
}
regfree(®ex);
// IPv4 (1.2.3.4:443)
rc = regcomp(®ex, "^(((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])):([0-9]{1,4}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$", REG_EXTENDED);
assert(rc == 0);
rc = regexec(®ex, value, 10, match, 0);
if (rc == 0)
{
ai_family = PF_INET;
addr = strndup(value + match[1].rm_so, match[1].rm_eo - match[1].rm_so);
port = strndup(value + match[7].rm_so, match[7].rm_eo - match[7].rm_so);
regfree(®ex);
goto fin_getaddrinfo;
}
regfree(®ex);
// IPv6 ([::1]:443)
rc = regcomp(®ex, "^\\[(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\\]:([0-9]{1,4}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$", REG_EXTENDED);
assert(rc == 0);
rc = regexec(®ex, value, 2, match, 0);
if (rc == 0)
{
ai_family = PF_INET6;
addr = strndup(value + match[1].rm_so, match[1].rm_eo - match[1].rm_so);
char * x = strrchr(value,':');
assert(x!=NULL);
port = strdup(x+1);
regfree(®ex);
goto fin_getaddrinfo;
}
regfree(®ex);
// Hostname (localhost:443)
rc = regcomp(®ex, "^([^:]*):([0-9]{1,4}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$", REG_EXTENDED);
assert(rc == 0);
rc = regexec(®ex, value, 2, match, 0);
if (rc == 0)
{
ai_family = PF_UNSPEC; // IPv4 and IPv6
addr = strndup(value + match[1].rm_so, match[1].rm_eo - match[1].rm_so);
char * x = strrchr(value,':');
assert(x!=NULL);
port = strdup(x+1);
regfree(®ex);
goto fin_getaddrinfo;
}
regfree(®ex);
assert(addr == NULL);
assert(port == NULL);
FT_ERROR("Invalid format of address/port for listen: '%s'", value);
FT_TRACE(FT_TRACE_ID_LISTENER, "END error");
return -1;
fin_getaddrinfo:
assert(ai_family >= 0);
assert(addr != NULL);
assert(port != NULL);
int ret = ft_listener_list_extend(list, delegate, context, ai_family, ai_socktype, addr, port, data);
free(addr);
free(port);
FT_TRACE(FT_TRACE_ID_LISTENER, "END ret:%d", ret);
return ret;
}
int ft_listener_list_extend_autov(struct ft_list * list, const struct ft_listener_delegate * delegate, struct ft_context * context, int ai_socktype, const char ** values, void * data)
{
assert(list != NULL);
assert(delegate != NULL);
assert(context != NULL);
// Handle an empty list nicely
if (values == NULL) return 0;
int count = 0;
int rc;
for (int i = 0; ; i++)
{
const char * addr = values[i];
if (addr == NULL) break;
rc = ft_listener_list_extend_auto(list, delegate, context, ai_socktype, addr, data);
if (rc == 0) FT_WARN("Failed to open '%s' socket", addr);
count += rc;
}
return count;
}
|
use clippy_utils::diagnostics::span_lint_and_note;
use clippy_utils::is_lint_allowed;
use clippy_utils::macros::root_macro_call_first_node;
use rustc_ast::LitKind;
use rustc_hir::Expr;
use rustc_hir::ExprKind;
use rustc_lint::{LateContext, LateLintPass};
use rustc_session::{declare_tool_lint, impl_lint_pass};
use rustc_span::sym;
declare_clippy_lint! {
/// ### What it does
/// Checks for the inclusion of large files via `include_bytes!()`
/// and `include_str!()`
///
/// ### Why is this bad?
/// Including large files can increase the size of the binary
///
/// ### Example
/// ```rust,ignore
/// let included_str = include_str!("very_large_file.txt");
/// let included_bytes = include_bytes!("very_large_file.txt");
/// ```
///
/// Use instead:
/// ```rust,ignore
/// use std::fs;
///
/// // You can load the file at runtime
/// let string = fs::read_to_string("very_large_file.txt")?;
/// let bytes = fs::read("very_large_file.txt")?;
/// ```
#[clippy::version = "1.62.0"]
pub LARGE_INCLUDE_FILE,
restriction,
"including a large file"
}
pub struct LargeIncludeFile {
max_file_size: u64,
}
impl LargeIncludeFile {
#[must_use]
pub fn new(max_file_size: u64) -> Self {
Self { max_file_size }
}
}
impl_lint_pass!(LargeIncludeFile => [LARGE_INCLUDE_FILE]);
impl LateLintPass<'_> for LargeIncludeFile {
fn check_expr(&mut self, cx: &LateContext<'_>, expr: &'_ Expr<'_>) {
if_chain! {
if let Some(macro_call) = root_macro_call_first_node(cx, expr);
if !is_lint_allowed(cx, LARGE_INCLUDE_FILE, expr.hir_id);
if cx.tcx.is_diagnostic_item(sym::include_bytes_macro, macro_call.def_id)
|| cx.tcx.is_diagnostic_item(sym::include_str_macro, macro_call.def_id);
if let ExprKind::Lit(lit) = &expr.kind;
then {
let len = match &lit.node {
// include_bytes
LitKind::ByteStr(bstr) => bstr.len(),
// include_str
LitKind::Str(sym, _) => sym.as_str().len(),
_ => return,
};
if len as u64 <= self.max_file_size {
return;
}
span_lint_and_note(
cx,
LARGE_INCLUDE_FILE,
expr.span,
"attempted to include a large file",
None,
&format!(
"the configuration allows a maximum size of {} bytes",
self.max_file_size
),
);
}
}
}
}
|
A class action lawsuit has been filed against the City of Prince George, seeking damages on behalf of those who suffer from a degenerative dental disease allegedly caused by drinking the city's fluoridated water.
A notice of civil claim was filed Tuesday by Kevin Millership, a Slocan resident who brought a lawsuit against the City of Kamloops more than 10 years ago seeking compensation for himself for a mild form of dental fluorosis, which causes a mottling of the tooth enamel.
article continues below
Millership, who is not a lawyer but argued his case himself, was unsuccessful in part because he had taken too long to launch the action.
However, in dismissing the case in 2003, a B.C. Supreme Court Justice found that on a balance of probabilities, Millership had established causation between his condition and drinking fluoridated water. But the Justice also concluded MIllership's condition was a cosmetic problem that did not affect the function of his teeth and rejected a claim for psychological and emotional damage.
This time, Millership is going to bat in the name of those who've been drinking Prince George's water and have "objectionable" dental fluorosis, ranging from moderate to severe trouble. He said most dental plans do not cover the cost of treatment and can range from $1,000 to $100,000 per person with treatment ongoing for a lifetime in some cases.
Between 14 and 18 per cent of Prince George residents have moderate dental fluorosis and a further 0.4 per cent have severe dental fluorosis, according to Millership, who plans to bring in an expert witness, Dr. Hardy Limeback of Canadians Opposed to Fluoridation, to testify about the extent of the problem and its causes.
Millership will also seek compensation for psychological damages for the victims and intends to put a victim of moderate dental fluorosis on the stand to testify about the emotional trauma she has suffered.
Millership said he is looking for a lawyer to argue the case but will step in if need be.
Millership's case against Kamloops was dismissed after 21 days of proceedings that required a review of thousands of pages of supporting material.
City officials declined to comment on the cases while it's before the court.
Millership, who has contacts with the PG Fluoride Free, can be reached at [email protected]. |
/**
* This class has been automatically generated using <a
* href="https://github.com/kirill-grouchnikov/radiance">Photon SVG transcoder</a>.
*/
public class edit_delete implements ResizableIcon {
@SuppressWarnings("unused")
private void innerPaint(Graphics2D g) {
Shape shape = null;
Paint paint = null;
Stroke stroke = null;
float origAlpha = 1.0f;
Composite origComposite = g.getComposite();
if (origComposite instanceof AlphaComposite) {
AlphaComposite origAlphaComposite =
(AlphaComposite)origComposite;
if (origAlphaComposite.getRule() == AlphaComposite.SRC_OVER) {
origAlpha = origAlphaComposite.getAlpha();
}
}
AffineTransform defaultTransform_ = g.getTransform();
//
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
AffineTransform defaultTransform__0 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
AffineTransform defaultTransform__0_0 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
AffineTransform defaultTransform__0_0_0 = g.getTransform();
g.transform(new AffineTransform(0.022623829543590546f, 0.0f, 0.0f, 0.019662480801343918f, 44.39519119262695f, 41.98146057128906f));
// _0_0_0
g.setComposite(AlphaComposite.getInstance(3, 0.40206185f * origAlpha));
AffineTransform defaultTransform__0_0_0_0 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_0_0
paint = new LinearGradientPaint(new Point2D.Double(302.8571472167969, 366.64788818359375), new Point2D.Double(302.8571472167969, 609.5050659179688), new float[] {0.0f,0.5f,1.0f}, new Color[] {new Color(0, 0, 0, 0),new Color(0, 0, 0, 255),new Color(0, 0, 0, 0)}, MultipleGradientPaint.CycleMethod.NO_CYCLE, MultipleGradientPaint.ColorSpaceType.SRGB, new AffineTransform(2.7743890285491943f, 0.0f, 0.0f, 1.9697060585021973f, -1892.178955078125f, -872.8853759765625f));
shape = new Rectangle2D.Double(-1559.2523193359375, -150.6968536376953, 1339.633544921875, 478.357177734375);
g.setPaint(paint);
g.fill(shape);
g.setTransform(defaultTransform__0_0_0_0);
g.setComposite(AlphaComposite.getInstance(3, 0.40206185f * origAlpha));
AffineTransform defaultTransform__0_0_0_1 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_0_1
paint = new RadialGradientPaint(new Point2D.Double(605.7142944335938, 486.64788818359375), 117.14286f, new Point2D.Double(605.7142944335938, 486.64788818359375), new float[] {0.0f,1.0f}, new Color[] {new Color(0, 0, 0, 255),new Color(0, 0, 0, 0)}, MultipleGradientPaint.CycleMethod.NO_CYCLE, MultipleGradientPaint.ColorSpaceType.SRGB, new AffineTransform(2.7743890285491943f, 0.0f, 0.0f, 1.9697060585021973f, -1891.633056640625f, -872.8853759765625f));
shape = new GeneralPath();
((GeneralPath)shape).moveTo(-219.61876, -150.68037);
((GeneralPath)shape).curveTo(-219.61876, -150.68037, -219.61876, 327.65042, -219.61876, 327.65042);
((GeneralPath)shape).curveTo(-76.74459, 328.55087, 125.78146, 220.48074, 125.78138, 88.45424);
((GeneralPath)shape).curveTo(125.78138, -43.572304, -33.655437, -150.68036, -219.61876, -150.68037);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
g.setTransform(defaultTransform__0_0_0_1);
g.setComposite(AlphaComposite.getInstance(3, 0.40206185f * origAlpha));
AffineTransform defaultTransform__0_0_0_2 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_0_2
paint = new RadialGradientPaint(new Point2D.Double(605.7142944335938, 486.64788818359375), 117.14286f, new Point2D.Double(605.7142944335938, 486.64788818359375), new float[] {0.0f,1.0f}, new Color[] {new Color(0, 0, 0, 255),new Color(0, 0, 0, 0)}, MultipleGradientPaint.CycleMethod.NO_CYCLE, MultipleGradientPaint.ColorSpaceType.SRGB, new AffineTransform(-2.7743890285491943f, 0.0f, 0.0f, 1.9697060585021973f, 112.76229858398438f, -872.8853759765625f));
shape = new GeneralPath();
((GeneralPath)shape).moveTo(-1559.2523, -150.68037);
((GeneralPath)shape).curveTo(-1559.2523, -150.68037, -1559.2523, 327.65042, -1559.2523, 327.65042);
((GeneralPath)shape).curveTo(-1702.1265, 328.55087, -1904.6525, 220.48074, -1904.6525, 88.45424);
((GeneralPath)shape).curveTo(-1904.6525, -43.572304, -1745.2157, -150.68036, -1559.2523, -150.68037);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
g.setTransform(defaultTransform__0_0_0_2);
g.setTransform(defaultTransform__0_0_0);
g.setComposite(AlphaComposite.getInstance(3, 0.38659793f * origAlpha));
AffineTransform defaultTransform__0_0_1 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_1
paint = new LinearGradientPaint(new Point2D.Double(25.0, 21.0), new Point2D.Double(25.0, 32.25), new float[] {0.0f,1.0f}, new Color[] {new Color(0, 0, 0, 255),new Color(0, 0, 0, 0)}, MultipleGradientPaint.CycleMethod.NO_CYCLE, MultipleGradientPaint.ColorSpaceType.SRGB, new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
shape = new GeneralPath();
((GeneralPath)shape).moveTo(4.75, 21.0);
((GeneralPath)shape).lineTo(43.25, 21.0);
((GeneralPath)shape).lineTo(42.375, 32.25);
((GeneralPath)shape).lineTo(5.625, 32.25);
((GeneralPath)shape).lineTo(4.75, 21.0);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
g.setTransform(defaultTransform__0_0_1);
g.setComposite(AlphaComposite.getInstance(3, 0.5f * origAlpha));
AffineTransform defaultTransform__0_0_2 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_2
paint = new Color(186, 189, 182, 255);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(4.000805, 16.500029);
((GeneralPath)shape).curveTo(3.9568443, 16.464575, 5.72773, 42.00552, 5.7282343, 42.013264);
((GeneralPath)shape).curveTo(5.8943634, 44.56396, 7.288948, 45.496197, 8.84989, 45.499996);
((GeneralPath)shape).curveTo(8.905668, 45.500126, 38.133934, 45.49671, 38.756645, 45.494057);
((GeneralPath)shape).curveTo(41.38534, 45.482838, 42.029343, 43.85947, 42.202267, 42.085777);
((GeneralPath)shape).curveTo(42.216137, 42.050804, 43.986115, 16.535, 43.99998, 16.500029);
((GeneralPath)shape).curveTo(30.666924, 16.500029, 17.333866, 16.500029, 4.000805, 16.500029);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
paint = new Color(85, 87, 83, 255);
stroke = new BasicStroke(1.0f,0,0,4.0f,null,0.0f);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(4.000805, 16.500029);
((GeneralPath)shape).curveTo(3.9568443, 16.464575, 5.72773, 42.00552, 5.7282343, 42.013264);
((GeneralPath)shape).curveTo(5.8943634, 44.56396, 7.288948, 45.496197, 8.84989, 45.499996);
((GeneralPath)shape).curveTo(8.905668, 45.500126, 38.133934, 45.49671, 38.756645, 45.494057);
((GeneralPath)shape).curveTo(41.38534, 45.482838, 42.029343, 43.85947, 42.202267, 42.085777);
((GeneralPath)shape).curveTo(42.216137, 42.050804, 43.986115, 16.535, 43.99998, 16.500029);
((GeneralPath)shape).curveTo(30.666924, 16.500029, 17.333866, 16.500029, 4.000805, 16.500029);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.setStroke(stroke);
g.draw(shape);
g.setTransform(defaultTransform__0_0_2);
g.setComposite(AlphaComposite.getInstance(3, 0.23711339f * origAlpha));
AffineTransform defaultTransform__0_0_3 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_3
paint = new LinearGradientPaint(new Point2D.Double(7.373860836029053, 27.37662124633789), new Point2D.Double(7.529111862182617, 69.46050262451172), new float[] {0.0f,1.0f}, new Color[] {new Color(0, 0, 0, 255),new Color(0, 0, 0, 0)}, MultipleGradientPaint.CycleMethod.NO_CYCLE, MultipleGradientPaint.ColorSpaceType.SRGB, new AffineTransform(3.5204110145568848f, 0.0f, 0.0f, 0.34801599383354187f, -3.0379180908203125f, 1.5442570447921753f));
shape = new GeneralPath();
((GeneralPath)shape).moveTo(43.457954, 20.71267);
((GeneralPath)shape).lineTo(7.2079372, 20.689264);
((GeneralPath)shape).curveTo(34.519245, 21.326591, 39.885143, 24.337412, 43.214188, 24.183575);
((GeneralPath)shape).lineTo(43.457954, 20.71267);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
g.setTransform(defaultTransform__0_0_3);
g.setComposite(AlphaComposite.getInstance(3, 0.12886599f * origAlpha));
AffineTransform defaultTransform__0_0_4 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.08838865160942078f, 0.08838865160942078f));
// _0_0_4
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
AffineTransform defaultTransform__0_0_4_0 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_4_0
paint = new Color(0, 0, 0, 255);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(29.163486, 19.614075);
((GeneralPath)shape).curveTo(29.163486, 19.614075, 30.279472, 23.33545, 29.517143, 26.348055);
((GeneralPath)shape).curveTo(28.754814, 29.360659, 29.269247, 34.210167, 29.269247, 34.210167);
((GeneralPath)shape).lineTo(30.884373, 34.634373);
((GeneralPath)shape).curveTo(30.884373, 34.634373, 30.117495, 30.028639, 30.931356, 26.524832);
((GeneralPath)shape).curveTo(31.745218, 23.021023, 30.577814, 19.614988, 30.577814, 19.614988);
((GeneralPath)shape).lineTo(29.163486, 19.614075);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
paint = new Color(0, 0, 0, 255);
stroke = new BasicStroke(1.3f,0,0,4.0f,null,0.0f);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(29.163486, 19.614075);
((GeneralPath)shape).curveTo(29.163486, 19.614075, 30.279472, 23.33545, 29.517143, 26.348055);
((GeneralPath)shape).curveTo(28.754814, 29.360659, 29.269247, 34.210167, 29.269247, 34.210167);
((GeneralPath)shape).lineTo(30.884373, 34.634373);
((GeneralPath)shape).curveTo(30.884373, 34.634373, 30.117495, 30.028639, 30.931356, 26.524832);
((GeneralPath)shape).curveTo(31.745218, 23.021023, 30.577814, 19.614988, 30.577814, 19.614988);
((GeneralPath)shape).lineTo(29.163486, 19.614075);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.setStroke(stroke);
g.draw(shape);
g.setTransform(defaultTransform__0_0_4_0);
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
AffineTransform defaultTransform__0_0_4_1 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_4_1
paint = new Color(0, 0, 0, 255);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(9.912416, 19.75934);
((GeneralPath)shape).curveTo(9.912416, 19.75934, 11.028404, 23.480717, 10.266074, 26.49332);
((GeneralPath)shape).curveTo(9.503745, 29.505924, 10.018178, 34.355434, 10.018178, 34.355434);
((GeneralPath)shape).lineTo(11.456527, 33.80737);
((GeneralPath)shape).curveTo(11.456527, 33.80737, 10.866426, 30.173906, 11.680288, 26.670097);
((GeneralPath)shape).curveTo(12.49415, 23.16629, 11.326745, 19.760256, 11.326745, 19.760256);
((GeneralPath)shape).lineTo(9.912416, 19.75934);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
paint = new Color(0, 0, 0, 255);
stroke = new BasicStroke(1.3f,0,0,4.0f,null,0.0f);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(9.912416, 19.75934);
((GeneralPath)shape).curveTo(9.912416, 19.75934, 11.028404, 23.480717, 10.266074, 26.49332);
((GeneralPath)shape).curveTo(9.503745, 29.505924, 10.018178, 34.355434, 10.018178, 34.355434);
((GeneralPath)shape).lineTo(11.456527, 33.80737);
((GeneralPath)shape).curveTo(11.456527, 33.80737, 10.866426, 30.173906, 11.680288, 26.670097);
((GeneralPath)shape).curveTo(12.49415, 23.16629, 11.326745, 19.760256, 11.326745, 19.760256);
((GeneralPath)shape).lineTo(9.912416, 19.75934);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.setStroke(stroke);
g.draw(shape);
g.setTransform(defaultTransform__0_0_4_1);
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
AffineTransform defaultTransform__0_0_4_2 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_4_2
paint = new Color(0, 0, 0, 255);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(11.66716, 19.714073);
((GeneralPath)shape).curveTo(11.66716, 19.714073, 12.783146, 23.43545, 12.020817, 26.448053);
((GeneralPath)shape).curveTo(11.258488, 29.460657, 8.617841, 31.76449, 8.617841, 31.76449);
((GeneralPath)shape).lineTo(9.826038, 33.73022);
((GeneralPath)shape).curveTo(9.826038, 33.73022, 12.621168, 30.12864, 13.43503, 26.62483);
((GeneralPath)shape).curveTo(14.248892, 23.121023, 13.081487, 19.714989, 13.081487, 19.714989);
((GeneralPath)shape).lineTo(11.66716, 19.714073);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
paint = new Color(0, 0, 0, 255);
stroke = new BasicStroke(1.3f,0,0,4.0f,null,0.0f);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(11.66716, 19.714073);
((GeneralPath)shape).curveTo(11.66716, 19.714073, 12.783146, 23.43545, 12.020817, 26.448053);
((GeneralPath)shape).curveTo(11.258488, 29.460657, 8.617841, 31.76449, 8.617841, 31.76449);
((GeneralPath)shape).lineTo(9.826038, 33.73022);
((GeneralPath)shape).curveTo(9.826038, 33.73022, 12.621168, 30.12864, 13.43503, 26.62483);
((GeneralPath)shape).curveTo(14.248892, 23.121023, 13.081487, 19.714989, 13.081487, 19.714989);
((GeneralPath)shape).lineTo(11.66716, 19.714073);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.setStroke(stroke);
g.draw(shape);
g.setTransform(defaultTransform__0_0_4_2);
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
AffineTransform defaultTransform__0_0_4_3 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_4_3
paint = new Color(0, 0, 0, 255);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(21.163486, 19.614075);
((GeneralPath)shape).curveTo(21.163486, 19.614075, 22.279472, 23.33545, 21.517143, 26.348055);
((GeneralPath)shape).curveTo(20.754814, 29.360659, 21.269247, 34.210167, 21.269247, 34.210167);
((GeneralPath)shape).lineTo(22.928568, 34.766956);
((GeneralPath)shape).curveTo(22.928568, 34.766956, 22.117495, 30.028639, 22.931356, 26.524832);
((GeneralPath)shape).curveTo(23.745218, 23.021023, 22.577814, 19.614988, 22.577814, 19.614988);
((GeneralPath)shape).lineTo(21.163486, 19.614075);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
paint = new Color(0, 0, 0, 255);
stroke = new BasicStroke(1.3f,0,0,4.0f,null,0.0f);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(21.163486, 19.614075);
((GeneralPath)shape).curveTo(21.163486, 19.614075, 22.279472, 23.33545, 21.517143, 26.348055);
((GeneralPath)shape).curveTo(20.754814, 29.360659, 21.269247, 34.210167, 21.269247, 34.210167);
((GeneralPath)shape).lineTo(22.928568, 34.766956);
((GeneralPath)shape).curveTo(22.928568, 34.766956, 22.117495, 30.028639, 22.931356, 26.524832);
((GeneralPath)shape).curveTo(23.745218, 23.021023, 22.577814, 19.614988, 22.577814, 19.614988);
((GeneralPath)shape).lineTo(21.163486, 19.614075);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.setStroke(stroke);
g.draw(shape);
g.setTransform(defaultTransform__0_0_4_3);
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
AffineTransform defaultTransform__0_0_4_4 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_4_4
paint = new Color(0, 0, 0, 255);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(35.163486, 19.614075);
((GeneralPath)shape).curveTo(35.163486, 19.614075, 36.279472, 23.33545, 35.517143, 26.348055);
((GeneralPath)shape).curveTo(34.754814, 29.360659, 36.55088, 33.50306, 36.55088, 33.50306);
((GeneralPath)shape).lineTo(38.077614, 32.292084);
((GeneralPath)shape).curveTo(38.077614, 32.292084, 36.117496, 30.028639, 36.93136, 26.524832);
((GeneralPath)shape).curveTo(37.74522, 23.021023, 36.577812, 19.614988, 36.577812, 19.614988);
((GeneralPath)shape).lineTo(35.163486, 19.614075);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
paint = new Color(0, 0, 0, 255);
stroke = new BasicStroke(1.3f,0,0,4.0f,null,0.0f);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(35.163486, 19.614075);
((GeneralPath)shape).curveTo(35.163486, 19.614075, 36.279472, 23.33545, 35.517143, 26.348055);
((GeneralPath)shape).curveTo(34.754814, 29.360659, 36.55088, 33.50306, 36.55088, 33.50306);
((GeneralPath)shape).lineTo(38.077614, 32.292084);
((GeneralPath)shape).curveTo(38.077614, 32.292084, 36.117496, 30.028639, 36.93136, 26.524832);
((GeneralPath)shape).curveTo(37.74522, 23.021023, 36.577812, 19.614988, 36.577812, 19.614988);
((GeneralPath)shape).lineTo(35.163486, 19.614075);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.setStroke(stroke);
g.draw(shape);
g.setTransform(defaultTransform__0_0_4_4);
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
AffineTransform defaultTransform__0_0_4_5 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_4_5
paint = new Color(0, 0, 0, 255);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(31.163486, 19.614075);
((GeneralPath)shape).curveTo(31.163486, 19.614075, 32.279472, 23.33545, 31.517143, 26.348055);
((GeneralPath)shape).curveTo(30.754814, 29.360659, 31.269247, 34.210167, 31.269247, 34.210167);
((GeneralPath)shape).lineTo(32.795982, 34.148235);
((GeneralPath)shape).curveTo(32.795982, 34.148235, 32.117496, 30.028639, 32.93136, 26.524832);
((GeneralPath)shape).curveTo(33.74522, 23.021023, 32.577812, 19.614988, 32.577812, 19.614988);
((GeneralPath)shape).lineTo(31.163486, 19.614075);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
paint = new Color(0, 0, 0, 255);
stroke = new BasicStroke(1.3f,0,0,4.0f,null,0.0f);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(31.163486, 19.614075);
((GeneralPath)shape).curveTo(31.163486, 19.614075, 32.279472, 23.33545, 31.517143, 26.348055);
((GeneralPath)shape).curveTo(30.754814, 29.360659, 31.269247, 34.210167, 31.269247, 34.210167);
((GeneralPath)shape).lineTo(32.795982, 34.148235);
((GeneralPath)shape).curveTo(32.795982, 34.148235, 32.117496, 30.028639, 32.93136, 26.524832);
((GeneralPath)shape).curveTo(33.74522, 23.021023, 32.577812, 19.614988, 32.577812, 19.614988);
((GeneralPath)shape).lineTo(31.163486, 19.614075);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.setStroke(stroke);
g.draw(shape);
g.setTransform(defaultTransform__0_0_4_5);
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
AffineTransform defaultTransform__0_0_4_6 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_4_6
paint = new Color(0, 0, 0, 255);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(33.163486, 19.614075);
((GeneralPath)shape).curveTo(33.163486, 19.614075, 34.279472, 23.33545, 33.517143, 26.348055);
((GeneralPath)shape).curveTo(32.754814, 29.360659, 32.473755, 34.03339, 32.473755, 34.03339);
((GeneralPath)shape).lineTo(34.265656, 34.457596);
((GeneralPath)shape).curveTo(34.265656, 34.457596, 34.117496, 30.028639, 34.93136, 26.524832);
((GeneralPath)shape).curveTo(35.74522, 23.021023, 34.577812, 19.614988, 34.577812, 19.614988);
((GeneralPath)shape).lineTo(33.163486, 19.614075);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
paint = new Color(0, 0, 0, 255);
stroke = new BasicStroke(1.3f,0,0,4.0f,null,0.0f);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(33.163486, 19.614075);
((GeneralPath)shape).curveTo(33.163486, 19.614075, 34.279472, 23.33545, 33.517143, 26.348055);
((GeneralPath)shape).curveTo(32.754814, 29.360659, 32.473755, 34.03339, 32.473755, 34.03339);
((GeneralPath)shape).lineTo(34.265656, 34.457596);
((GeneralPath)shape).curveTo(34.265656, 34.457596, 34.117496, 30.028639, 34.93136, 26.524832);
((GeneralPath)shape).curveTo(35.74522, 23.021023, 34.577812, 19.614988, 34.577812, 19.614988);
((GeneralPath)shape).lineTo(33.163486, 19.614075);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.setStroke(stroke);
g.draw(shape);
g.setTransform(defaultTransform__0_0_4_6);
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
AffineTransform defaultTransform__0_0_4_7 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_4_7
paint = new Color(0, 0, 0, 255);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(27.163486, 19.614075);
((GeneralPath)shape).curveTo(27.163486, 19.614075, 28.279472, 23.33545, 27.517143, 26.348055);
((GeneralPath)shape).curveTo(26.754814, 29.360659, 28.064743, 33.989197, 28.064743, 33.989197);
((GeneralPath)shape).lineTo(29.724062, 33.308548);
((GeneralPath)shape).curveTo(29.724062, 33.308548, 28.117495, 30.028639, 28.931356, 26.524832);
((GeneralPath)shape).curveTo(29.745218, 23.021023, 28.577814, 19.614988, 28.577814, 19.614988);
((GeneralPath)shape).lineTo(27.163486, 19.614075);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
paint = new Color(0, 0, 0, 255);
stroke = new BasicStroke(1.3f,0,0,4.0f,null,0.0f);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(27.163486, 19.614075);
((GeneralPath)shape).curveTo(27.163486, 19.614075, 28.279472, 23.33545, 27.517143, 26.348055);
((GeneralPath)shape).curveTo(26.754814, 29.360659, 28.064743, 33.989197, 28.064743, 33.989197);
((GeneralPath)shape).lineTo(29.724062, 33.308548);
((GeneralPath)shape).curveTo(29.724062, 33.308548, 28.117495, 30.028639, 28.931356, 26.524832);
((GeneralPath)shape).curveTo(29.745218, 23.021023, 28.577814, 19.614988, 28.577814, 19.614988);
((GeneralPath)shape).lineTo(27.163486, 19.614075);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.setStroke(stroke);
g.draw(shape);
g.setTransform(defaultTransform__0_0_4_7);
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
AffineTransform defaultTransform__0_0_4_8 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_4_8
paint = new Color(0, 0, 0, 255);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(25.163486, 19.614075);
((GeneralPath)shape).curveTo(25.163486, 19.614075, 26.279472, 23.33545, 25.517143, 26.348055);
((GeneralPath)shape).curveTo(24.754814, 29.360659, 24.164394, 34.077583, 24.164394, 34.077583);
((GeneralPath)shape).lineTo(25.69113, 34.28082);
((GeneralPath)shape).curveTo(25.69113, 34.28082, 26.117495, 30.028639, 26.931356, 26.524832);
((GeneralPath)shape).curveTo(27.745218, 23.021023, 26.577814, 19.614988, 26.577814, 19.614988);
((GeneralPath)shape).lineTo(25.163486, 19.614075);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
paint = new Color(0, 0, 0, 255);
stroke = new BasicStroke(1.3f,0,0,4.0f,null,0.0f);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(25.163486, 19.614075);
((GeneralPath)shape).curveTo(25.163486, 19.614075, 26.279472, 23.33545, 25.517143, 26.348055);
((GeneralPath)shape).curveTo(24.754814, 29.360659, 24.164394, 34.077583, 24.164394, 34.077583);
((GeneralPath)shape).lineTo(25.69113, 34.28082);
((GeneralPath)shape).curveTo(25.69113, 34.28082, 26.117495, 30.028639, 26.931356, 26.524832);
((GeneralPath)shape).curveTo(27.745218, 23.021023, 26.577814, 19.614988, 26.577814, 19.614988);
((GeneralPath)shape).lineTo(25.163486, 19.614075);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.setStroke(stroke);
g.draw(shape);
g.setTransform(defaultTransform__0_0_4_8);
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
AffineTransform defaultTransform__0_0_4_9 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_4_9
paint = new Color(0, 0, 0, 255);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(23.163486, 19.614075);
((GeneralPath)shape).curveTo(23.163486, 19.614075, 24.279472, 23.33545, 23.517143, 26.348055);
((GeneralPath)shape).curveTo(22.754814, 29.360659, 23.269247, 34.210167, 23.269247, 34.210167);
((GeneralPath)shape).lineTo(24.707596, 33.6621);
((GeneralPath)shape).curveTo(24.707596, 33.6621, 24.117495, 30.028639, 24.931356, 26.524832);
((GeneralPath)shape).curveTo(25.745218, 23.021023, 24.577814, 19.614988, 24.577814, 19.614988);
((GeneralPath)shape).lineTo(23.163486, 19.614075);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
paint = new Color(0, 0, 0, 255);
stroke = new BasicStroke(1.3f,0,0,4.0f,null,0.0f);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(23.163486, 19.614075);
((GeneralPath)shape).curveTo(23.163486, 19.614075, 24.279472, 23.33545, 23.517143, 26.348055);
((GeneralPath)shape).curveTo(22.754814, 29.360659, 23.269247, 34.210167, 23.269247, 34.210167);
((GeneralPath)shape).lineTo(24.707596, 33.6621);
((GeneralPath)shape).curveTo(24.707596, 33.6621, 24.117495, 30.028639, 24.931356, 26.524832);
((GeneralPath)shape).curveTo(25.745218, 23.021023, 24.577814, 19.614988, 24.577814, 19.614988);
((GeneralPath)shape).lineTo(23.163486, 19.614075);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.setStroke(stroke);
g.draw(shape);
g.setTransform(defaultTransform__0_0_4_9);
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
AffineTransform defaultTransform__0_0_4_10 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_4_10
paint = new Color(0, 0, 0, 255);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(13.313608, 19.714073);
((GeneralPath)shape).curveTo(13.313608, 19.714073, 14.429594, 23.43545, 13.667265, 26.448053);
((GeneralPath)shape).curveTo(12.904936, 29.460657, 13.419369, 34.310165, 13.419369, 34.310165);
((GeneralPath)shape).lineTo(14.999517, 34.698425);
((GeneralPath)shape).curveTo(14.999517, 34.698425, 14.267616, 30.12864, 15.081478, 26.62483);
((GeneralPath)shape).curveTo(15.89534, 23.121023, 14.727935, 19.714989, 14.727935, 19.714989);
((GeneralPath)shape).lineTo(13.313608, 19.714073);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
paint = new Color(0, 0, 0, 255);
stroke = new BasicStroke(1.3f,0,0,4.0f,null,0.0f);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(13.313608, 19.714073);
((GeneralPath)shape).curveTo(13.313608, 19.714073, 14.429594, 23.43545, 13.667265, 26.448053);
((GeneralPath)shape).curveTo(12.904936, 29.460657, 13.419369, 34.310165, 13.419369, 34.310165);
((GeneralPath)shape).lineTo(14.999517, 34.698425);
((GeneralPath)shape).curveTo(14.999517, 34.698425, 14.267616, 30.12864, 15.081478, 26.62483);
((GeneralPath)shape).curveTo(15.89534, 23.121023, 14.727935, 19.714989, 14.727935, 19.714989);
((GeneralPath)shape).lineTo(13.313608, 19.714073);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.setStroke(stroke);
g.draw(shape);
g.setTransform(defaultTransform__0_0_4_10);
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
AffineTransform defaultTransform__0_0_4_11 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_4_11
paint = new Color(0, 0, 0, 255);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(19.418083, 20.520258);
((GeneralPath)shape).curveTo(19.418083, 20.520258, 19.615713, 24.1298, 19.064632, 27.254238);
((GeneralPath)shape).curveTo(18.52486, 30.31456, 21.306417, 34.496773, 21.306417, 34.496773);
((GeneralPath)shape).lineTo(22.721163, 33.86443);
((GeneralPath)shape).curveTo(22.721163, 33.86443, 19.926762, 31.248787, 20.55876, 27.078695);
((GeneralPath)shape).curveTo(21.116432, 23.399015, 20.83241, 20.521172, 20.83241, 20.521172);
((GeneralPath)shape).lineTo(19.418083, 20.520258);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
paint = new Color(0, 0, 0, 255);
stroke = new BasicStroke(1.3f,0,0,4.0f,null,0.0f);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(19.418083, 20.520258);
((GeneralPath)shape).curveTo(19.418083, 20.520258, 19.615713, 24.1298, 19.064632, 27.254238);
((GeneralPath)shape).curveTo(18.52486, 30.31456, 21.306417, 34.496773, 21.306417, 34.496773);
((GeneralPath)shape).lineTo(22.721163, 33.86443);
((GeneralPath)shape).curveTo(22.721163, 33.86443, 19.926762, 31.248787, 20.55876, 27.078695);
((GeneralPath)shape).curveTo(21.116432, 23.399015, 20.83241, 20.521172, 20.83241, 20.521172);
((GeneralPath)shape).lineTo(19.418083, 20.520258);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.setStroke(stroke);
g.draw(shape);
g.setTransform(defaultTransform__0_0_4_11);
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
AffineTransform defaultTransform__0_0_4_12 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_4_12
paint = new Color(0, 0, 0, 255);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(15.163487, 19.614075);
((GeneralPath)shape).curveTo(15.163487, 19.614075, 16.279472, 23.33545, 15.517144, 26.348055);
((GeneralPath)shape).curveTo(14.754815, 29.360659, 15.269248, 34.210167, 15.269248, 34.210167);
((GeneralPath)shape).lineTo(16.707596, 33.6621);
((GeneralPath)shape).curveTo(16.707596, 33.6621, 16.117495, 30.028639, 16.931356, 26.524832);
((GeneralPath)shape).curveTo(17.745218, 23.021023, 16.577814, 19.614988, 16.577814, 19.614988);
((GeneralPath)shape).lineTo(15.163487, 19.614075);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
paint = new Color(0, 0, 0, 255);
stroke = new BasicStroke(1.3f,0,0,4.0f,null,0.0f);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(15.163487, 19.614075);
((GeneralPath)shape).curveTo(15.163487, 19.614075, 16.279472, 23.33545, 15.517144, 26.348055);
((GeneralPath)shape).curveTo(14.754815, 29.360659, 15.269248, 34.210167, 15.269248, 34.210167);
((GeneralPath)shape).lineTo(16.707596, 33.6621);
((GeneralPath)shape).curveTo(16.707596, 33.6621, 16.117495, 30.028639, 16.931356, 26.524832);
((GeneralPath)shape).curveTo(17.745218, 23.021023, 16.577814, 19.614988, 16.577814, 19.614988);
((GeneralPath)shape).lineTo(15.163487, 19.614075);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.setStroke(stroke);
g.draw(shape);
g.setTransform(defaultTransform__0_0_4_12);
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
AffineTransform defaultTransform__0_0_4_13 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_4_13
paint = new Color(0, 0, 0, 255);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(16.81613, 20.479515);
((GeneralPath)shape).curveTo(16.81613, 20.479515, 17.932116, 24.200891, 17.169786, 27.213495);
((GeneralPath)shape).curveTo(16.407457, 30.226099, 14.726988, 31.80438, 14.726988, 31.80438);
((GeneralPath)shape).lineTo(15.964957, 32.939804);
((GeneralPath)shape).curveTo(15.964957, 32.939804, 17.770138, 30.89408, 18.584, 27.390272);
((GeneralPath)shape).curveTo(19.397861, 23.886463, 18.230455, 20.480429, 18.230455, 20.480429);
((GeneralPath)shape).lineTo(16.81613, 20.479515);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
paint = new Color(0, 0, 0, 255);
stroke = new BasicStroke(1.3f,0,0,4.0f,null,0.0f);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(16.81613, 20.479515);
((GeneralPath)shape).curveTo(16.81613, 20.479515, 17.932116, 24.200891, 17.169786, 27.213495);
((GeneralPath)shape).curveTo(16.407457, 30.226099, 14.726988, 31.80438, 14.726988, 31.80438);
((GeneralPath)shape).lineTo(15.964957, 32.939804);
((GeneralPath)shape).curveTo(15.964957, 32.939804, 17.770138, 30.89408, 18.584, 27.390272);
((GeneralPath)shape).curveTo(19.397861, 23.886463, 18.230455, 20.480429, 18.230455, 20.480429);
((GeneralPath)shape).lineTo(16.81613, 20.479515);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.setStroke(stroke);
g.draw(shape);
g.setTransform(defaultTransform__0_0_4_13);
g.setTransform(defaultTransform__0_0_4);
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
AffineTransform defaultTransform__0_0_5 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_5
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
AffineTransform defaultTransform__0_0_5_0 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_5_0
paint = new RadialGradientPaint(new Point2D.Double(9.57962417602539, 33.58826446533203), 2.5527742f, new Point2D.Double(9.57962417602539, 33.58826446533203), new float[] {0.0f,1.0f}, new Color[] {new Color(255, 255, 255, 255),new Color(213, 213, 213, 255)}, MultipleGradientPaint.CycleMethod.NO_CYCLE, MultipleGradientPaint.ColorSpaceType.SRGB, new AffineTransform(3.146714925765991f, 0.06924886256456375f, -0.06039990857243538f, 2.744611978530884f, -0.33256199955940247f, -61.89699172973633f));
shape = new GeneralPath();
((GeneralPath)shape).moveTo(29.163486, 19.614075);
((GeneralPath)shape).curveTo(29.163486, 19.614075, 30.279472, 23.33545, 29.517143, 26.348055);
((GeneralPath)shape).curveTo(28.754814, 29.360659, 29.269247, 34.210167, 29.269247, 34.210167);
((GeneralPath)shape).lineTo(30.884373, 34.634373);
((GeneralPath)shape).curveTo(30.884373, 34.634373, 30.117495, 30.028639, 30.931356, 26.524832);
((GeneralPath)shape).curveTo(31.745218, 23.021023, 30.577814, 19.614988, 30.577814, 19.614988);
((GeneralPath)shape).lineTo(29.163486, 19.614075);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
g.setTransform(defaultTransform__0_0_5_0);
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
AffineTransform defaultTransform__0_0_5_1 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_5_1
paint = new RadialGradientPaint(new Point2D.Double(9.57962417602539, 33.58826446533203), 2.5527742f, new Point2D.Double(9.57962417602539, 33.58826446533203), new float[] {0.0f,1.0f}, new Color[] {new Color(255, 255, 255, 255),new Color(213, 213, 213, 255)}, MultipleGradientPaint.CycleMethod.NO_CYCLE, MultipleGradientPaint.ColorSpaceType.SRGB, new AffineTransform(3.146714925765991f, 0.06924886256456375f, -0.06039990857243538f, 2.744611978530884f, -19.583620071411133f, -61.7517204284668f));
shape = new GeneralPath();
((GeneralPath)shape).moveTo(9.912416, 19.75934);
((GeneralPath)shape).curveTo(9.912416, 19.75934, 11.028404, 23.480717, 10.266074, 26.49332);
((GeneralPath)shape).curveTo(9.503745, 29.505924, 10.018178, 34.355434, 10.018178, 34.355434);
((GeneralPath)shape).lineTo(11.456527, 33.80737);
((GeneralPath)shape).curveTo(11.456527, 33.80737, 10.866426, 30.173906, 11.680288, 26.670097);
((GeneralPath)shape).curveTo(12.49415, 23.16629, 11.326745, 19.760256, 11.326745, 19.760256);
((GeneralPath)shape).lineTo(9.912416, 19.75934);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
g.setTransform(defaultTransform__0_0_5_1);
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
AffineTransform defaultTransform__0_0_5_2 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_5_2
paint = new RadialGradientPaint(new Point2D.Double(9.57962417602539, 33.58826446533203), 2.5527742f, new Point2D.Double(9.57962417602539, 33.58826446533203), new float[] {0.0f,1.0f}, new Color[] {new Color(255, 255, 255, 255),new Color(213, 213, 213, 255)}, MultipleGradientPaint.CycleMethod.NO_CYCLE, MultipleGradientPaint.ColorSpaceType.SRGB, new AffineTransform(3.146714925765991f, 0.06924886256456375f, -0.06039990857243538f, 2.744611978530884f, -17.82887077331543f, -61.79698944091797f));
shape = new GeneralPath();
((GeneralPath)shape).moveTo(11.66716, 19.714073);
((GeneralPath)shape).curveTo(11.66716, 19.714073, 12.783146, 23.43545, 12.020817, 26.448053);
((GeneralPath)shape).curveTo(11.258488, 29.460657, 8.617841, 31.76449, 8.617841, 31.76449);
((GeneralPath)shape).lineTo(9.826038, 33.73022);
((GeneralPath)shape).curveTo(9.826038, 33.73022, 12.621168, 30.12864, 13.43503, 26.62483);
((GeneralPath)shape).curveTo(14.248892, 23.121023, 13.081487, 19.714989, 13.081487, 19.714989);
((GeneralPath)shape).lineTo(11.66716, 19.714073);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
g.setTransform(defaultTransform__0_0_5_2);
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
AffineTransform defaultTransform__0_0_5_3 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_5_3
paint = new RadialGradientPaint(new Point2D.Double(9.57962417602539, 33.58826446533203), 2.5527742f, new Point2D.Double(9.57962417602539, 33.58826446533203), new float[] {0.0f,1.0f}, new Color[] {new Color(255, 255, 255, 255),new Color(213, 213, 213, 255)}, MultipleGradientPaint.CycleMethod.NO_CYCLE, MultipleGradientPaint.ColorSpaceType.SRGB, new AffineTransform(3.146714925765991f, 0.06924886256456375f, -0.06039990857243538f, 2.744611978530884f, -8.332562446594238f, -61.89699172973633f));
shape = new GeneralPath();
((GeneralPath)shape).moveTo(21.163486, 19.614075);
((GeneralPath)shape).curveTo(21.163486, 19.614075, 22.279472, 23.33545, 21.517143, 26.348055);
((GeneralPath)shape).curveTo(20.754814, 29.360659, 21.269247, 34.210167, 21.269247, 34.210167);
((GeneralPath)shape).lineTo(22.928568, 34.766956);
((GeneralPath)shape).curveTo(22.928568, 34.766956, 22.117495, 30.028639, 22.931356, 26.524832);
((GeneralPath)shape).curveTo(23.745218, 23.021023, 22.577814, 19.614988, 22.577814, 19.614988);
((GeneralPath)shape).lineTo(21.163486, 19.614075);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
g.setTransform(defaultTransform__0_0_5_3);
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
AffineTransform defaultTransform__0_0_5_4 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_5_4
paint = new RadialGradientPaint(new Point2D.Double(9.57962417602539, 33.58826446533203), 2.5527742f, new Point2D.Double(9.57962417602539, 33.58826446533203), new float[] {0.0f,1.0f}, new Color[] {new Color(255, 255, 255, 255),new Color(213, 213, 213, 255)}, MultipleGradientPaint.CycleMethod.NO_CYCLE, MultipleGradientPaint.ColorSpaceType.SRGB, new AffineTransform(3.146714925765991f, 0.06924886256456375f, -0.06039990857243538f, 2.744611978530884f, 5.66743803024292f, -61.89699172973633f));
shape = new GeneralPath();
((GeneralPath)shape).moveTo(35.163486, 19.614075);
((GeneralPath)shape).curveTo(35.163486, 19.614075, 36.279472, 23.33545, 35.517143, 26.348055);
((GeneralPath)shape).curveTo(34.754814, 29.360659, 36.55088, 33.50306, 36.55088, 33.50306);
((GeneralPath)shape).lineTo(38.077614, 32.292084);
((GeneralPath)shape).curveTo(38.077614, 32.292084, 36.117496, 30.028639, 36.93136, 26.524832);
((GeneralPath)shape).curveTo(37.74522, 23.021023, 36.577812, 19.614988, 36.577812, 19.614988);
((GeneralPath)shape).lineTo(35.163486, 19.614075);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
g.setTransform(defaultTransform__0_0_5_4);
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
AffineTransform defaultTransform__0_0_5_5 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_5_5
paint = new RadialGradientPaint(new Point2D.Double(9.57962417602539, 33.58826446533203), 2.5527742f, new Point2D.Double(9.57962417602539, 33.58826446533203), new float[] {0.0f,1.0f}, new Color[] {new Color(255, 255, 255, 255),new Color(213, 213, 213, 255)}, MultipleGradientPaint.CycleMethod.NO_CYCLE, MultipleGradientPaint.ColorSpaceType.SRGB, new AffineTransform(3.146714925765991f, 0.06924886256456375f, -0.06039990857243538f, 2.744611978530884f, 1.66743803024292f, -61.89699172973633f));
shape = new GeneralPath();
((GeneralPath)shape).moveTo(31.163486, 19.614075);
((GeneralPath)shape).curveTo(31.163486, 19.614075, 32.279472, 23.33545, 31.517143, 26.348055);
((GeneralPath)shape).curveTo(30.754814, 29.360659, 31.269247, 34.210167, 31.269247, 34.210167);
((GeneralPath)shape).lineTo(32.795982, 34.148235);
((GeneralPath)shape).curveTo(32.795982, 34.148235, 32.117496, 30.028639, 32.93136, 26.524832);
((GeneralPath)shape).curveTo(33.74522, 23.021023, 32.577812, 19.614988, 32.577812, 19.614988);
((GeneralPath)shape).lineTo(31.163486, 19.614075);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
g.setTransform(defaultTransform__0_0_5_5);
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
AffineTransform defaultTransform__0_0_5_6 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_5_6
paint = new RadialGradientPaint(new Point2D.Double(9.57962417602539, 33.58826446533203), 2.5527742f, new Point2D.Double(9.57962417602539, 33.58826446533203), new float[] {0.0f,1.0f}, new Color[] {new Color(255, 255, 255, 255),new Color(213, 213, 213, 255)}, MultipleGradientPaint.CycleMethod.NO_CYCLE, MultipleGradientPaint.ColorSpaceType.SRGB, new AffineTransform(3.146714925765991f, 0.06924886256456375f, -0.06039990857243538f, 2.744611978530884f, 3.66743803024292f, -61.89699172973633f));
shape = new GeneralPath();
((GeneralPath)shape).moveTo(33.163486, 19.614075);
((GeneralPath)shape).curveTo(33.163486, 19.614075, 34.279472, 23.33545, 33.517143, 26.348055);
((GeneralPath)shape).curveTo(32.754814, 29.360659, 32.473755, 34.03339, 32.473755, 34.03339);
((GeneralPath)shape).lineTo(34.265656, 34.457596);
((GeneralPath)shape).curveTo(34.265656, 34.457596, 34.117496, 30.028639, 34.93136, 26.524832);
((GeneralPath)shape).curveTo(35.74522, 23.021023, 34.577812, 19.614988, 34.577812, 19.614988);
((GeneralPath)shape).lineTo(33.163486, 19.614075);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
g.setTransform(defaultTransform__0_0_5_6);
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
AffineTransform defaultTransform__0_0_5_7 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_5_7
paint = new RadialGradientPaint(new Point2D.Double(9.57962417602539, 33.58826446533203), 2.5527742f, new Point2D.Double(9.57962417602539, 33.58826446533203), new float[] {0.0f,1.0f}, new Color[] {new Color(255, 255, 255, 255),new Color(213, 213, 213, 255)}, MultipleGradientPaint.CycleMethod.NO_CYCLE, MultipleGradientPaint.ColorSpaceType.SRGB, new AffineTransform(3.146714925765991f, 0.06924886256456375f, -0.06039990857243538f, 2.744611978530884f, -2.33256196975708f, -61.89699172973633f));
shape = new GeneralPath();
((GeneralPath)shape).moveTo(27.163486, 19.614075);
((GeneralPath)shape).curveTo(27.163486, 19.614075, 28.279472, 23.33545, 27.517143, 26.348055);
((GeneralPath)shape).curveTo(26.754814, 29.360659, 28.064743, 33.989197, 28.064743, 33.989197);
((GeneralPath)shape).lineTo(29.724062, 33.308548);
((GeneralPath)shape).curveTo(29.724062, 33.308548, 28.117495, 30.028639, 28.931356, 26.524832);
((GeneralPath)shape).curveTo(29.745218, 23.021023, 28.577814, 19.614988, 28.577814, 19.614988);
((GeneralPath)shape).lineTo(27.163486, 19.614075);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
g.setTransform(defaultTransform__0_0_5_7);
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
AffineTransform defaultTransform__0_0_5_8 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_5_8
paint = new RadialGradientPaint(new Point2D.Double(9.57962417602539, 33.58826446533203), 2.5527742f, new Point2D.Double(9.57962417602539, 33.58826446533203), new float[] {0.0f,1.0f}, new Color[] {new Color(255, 255, 255, 255),new Color(213, 213, 213, 255)}, MultipleGradientPaint.CycleMethod.NO_CYCLE, MultipleGradientPaint.ColorSpaceType.SRGB, new AffineTransform(3.146714925765991f, 0.06924886256456375f, -0.06039990857243538f, 2.744611978530884f, -4.33256196975708f, -61.89699172973633f));
shape = new GeneralPath();
((GeneralPath)shape).moveTo(25.163486, 19.614075);
((GeneralPath)shape).curveTo(25.163486, 19.614075, 26.279472, 23.33545, 25.517143, 26.348055);
((GeneralPath)shape).curveTo(24.754814, 29.360659, 24.164394, 34.077583, 24.164394, 34.077583);
((GeneralPath)shape).lineTo(25.69113, 34.28082);
((GeneralPath)shape).curveTo(25.69113, 34.28082, 26.117495, 30.028639, 26.931356, 26.524832);
((GeneralPath)shape).curveTo(27.745218, 23.021023, 26.577814, 19.614988, 26.577814, 19.614988);
((GeneralPath)shape).lineTo(25.163486, 19.614075);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
g.setTransform(defaultTransform__0_0_5_8);
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
AffineTransform defaultTransform__0_0_5_9 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_5_9
paint = new RadialGradientPaint(new Point2D.Double(9.57962417602539, 33.58826446533203), 2.5527742f, new Point2D.Double(9.57962417602539, 33.58826446533203), new float[] {0.0f,1.0f}, new Color[] {new Color(255, 255, 255, 255),new Color(213, 213, 213, 255)}, MultipleGradientPaint.CycleMethod.NO_CYCLE, MultipleGradientPaint.ColorSpaceType.SRGB, new AffineTransform(3.146714925765991f, 0.06924886256456375f, -0.06039990857243538f, 2.744611978530884f, -6.33256196975708f, -61.89699172973633f));
shape = new GeneralPath();
((GeneralPath)shape).moveTo(23.163486, 19.614075);
((GeneralPath)shape).curveTo(23.163486, 19.614075, 24.279472, 23.33545, 23.517143, 26.348055);
((GeneralPath)shape).curveTo(22.754814, 29.360659, 23.269247, 34.210167, 23.269247, 34.210167);
((GeneralPath)shape).lineTo(24.707596, 33.6621);
((GeneralPath)shape).curveTo(24.707596, 33.6621, 24.117495, 30.028639, 24.931356, 26.524832);
((GeneralPath)shape).curveTo(25.745218, 23.021023, 24.577814, 19.614988, 24.577814, 19.614988);
((GeneralPath)shape).lineTo(23.163486, 19.614075);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
g.setTransform(defaultTransform__0_0_5_9);
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
AffineTransform defaultTransform__0_0_5_10 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_5_10
paint = new RadialGradientPaint(new Point2D.Double(9.57962417602539, 33.58826446533203), 2.5527742f, new Point2D.Double(9.57962417602539, 33.58826446533203), new float[] {0.0f,1.0f}, new Color[] {new Color(255, 255, 255, 255),new Color(213, 213, 213, 255)}, MultipleGradientPaint.CycleMethod.NO_CYCLE, MultipleGradientPaint.ColorSpaceType.SRGB, new AffineTransform(3.146714925765991f, 0.06924886256456375f, -0.06039990857243538f, 2.744611978530884f, -16.182430267333984f, -61.79698944091797f));
shape = new GeneralPath();
((GeneralPath)shape).moveTo(13.313608, 19.714073);
((GeneralPath)shape).curveTo(13.313608, 19.714073, 14.429594, 23.43545, 13.667265, 26.448053);
((GeneralPath)shape).curveTo(12.904936, 29.460657, 13.419369, 34.310165, 13.419369, 34.310165);
((GeneralPath)shape).lineTo(14.999517, 34.698425);
((GeneralPath)shape).curveTo(14.999517, 34.698425, 14.267616, 30.12864, 15.081478, 26.62483);
((GeneralPath)shape).curveTo(15.89534, 23.121023, 14.727935, 19.714989, 14.727935, 19.714989);
((GeneralPath)shape).lineTo(13.313608, 19.714073);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
g.setTransform(defaultTransform__0_0_5_10);
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
AffineTransform defaultTransform__0_0_5_11 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_5_11
paint = new RadialGradientPaint(new Point2D.Double(9.57962417602539, 33.58826446533203), 2.5527742f, new Point2D.Double(9.57962417602539, 33.58826446533203), new float[] {0.0f,1.0f}, new Color[] {new Color(255, 255, 255, 255),new Color(213, 213, 213, 255)}, MultipleGradientPaint.CycleMethod.NO_CYCLE, MultipleGradientPaint.ColorSpaceType.SRGB, new AffineTransform(3.146714925765991f, 0.06924886256456375f, -0.06039990857243538f, 2.744611978530884f, -10.785059928894043f, -60.99081039428711f));
shape = new GeneralPath();
((GeneralPath)shape).moveTo(19.418083, 20.520258);
((GeneralPath)shape).curveTo(19.418083, 20.520258, 19.615713, 24.1298, 19.064632, 27.254238);
((GeneralPath)shape).curveTo(18.52486, 30.31456, 21.306417, 34.496773, 21.306417, 34.496773);
((GeneralPath)shape).lineTo(22.721163, 33.86443);
((GeneralPath)shape).curveTo(22.721163, 33.86443, 19.926762, 31.248787, 20.55876, 27.078695);
((GeneralPath)shape).curveTo(21.116432, 23.399015, 20.83241, 20.521172, 20.83241, 20.521172);
((GeneralPath)shape).lineTo(19.418083, 20.520258);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
g.setTransform(defaultTransform__0_0_5_11);
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
AffineTransform defaultTransform__0_0_5_12 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_5_12
paint = new RadialGradientPaint(new Point2D.Double(9.57962417602539, 33.58826446533203), 2.5527742f, new Point2D.Double(9.57962417602539, 33.58826446533203), new float[] {0.0f,1.0f}, new Color[] {new Color(255, 255, 255, 255),new Color(213, 213, 213, 255)}, MultipleGradientPaint.CycleMethod.NO_CYCLE, MultipleGradientPaint.ColorSpaceType.SRGB, new AffineTransform(3.146714925765991f, 0.06924886256456375f, -0.06039990857243538f, 2.744611978530884f, -14.332550048828125f, -61.89699172973633f));
shape = new GeneralPath();
((GeneralPath)shape).moveTo(15.163487, 19.614075);
((GeneralPath)shape).curveTo(15.163487, 19.614075, 16.279472, 23.33545, 15.517144, 26.348055);
((GeneralPath)shape).curveTo(14.754815, 29.360659, 15.269248, 34.210167, 15.269248, 34.210167);
((GeneralPath)shape).lineTo(16.707596, 33.6621);
((GeneralPath)shape).curveTo(16.707596, 33.6621, 16.117495, 30.028639, 16.931356, 26.524832);
((GeneralPath)shape).curveTo(17.745218, 23.021023, 16.577814, 19.614988, 16.577814, 19.614988);
((GeneralPath)shape).lineTo(15.163487, 19.614075);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
g.setTransform(defaultTransform__0_0_5_12);
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
AffineTransform defaultTransform__0_0_5_13 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_5_13
paint = new RadialGradientPaint(new Point2D.Double(9.57962417602539, 33.58826446533203), 2.5527742f, new Point2D.Double(9.57962417602539, 33.58826446533203), new float[] {0.0f,1.0f}, new Color[] {new Color(255, 255, 255, 255),new Color(213, 213, 213, 255)}, MultipleGradientPaint.CycleMethod.NO_CYCLE, MultipleGradientPaint.ColorSpaceType.SRGB, new AffineTransform(3.146714925765991f, 0.06924886256456375f, -0.06039990857243538f, 2.744611978530884f, -12.679909706115723f, -61.031551361083984f));
shape = new GeneralPath();
((GeneralPath)shape).moveTo(16.81613, 20.479515);
((GeneralPath)shape).curveTo(16.81613, 20.479515, 17.932116, 24.200891, 17.169786, 27.213495);
((GeneralPath)shape).curveTo(16.407457, 30.226099, 14.726988, 31.80438, 14.726988, 31.80438);
((GeneralPath)shape).lineTo(15.964957, 32.939804);
((GeneralPath)shape).curveTo(15.964957, 32.939804, 17.770138, 30.89408, 18.584, 27.390272);
((GeneralPath)shape).curveTo(19.397861, 23.886463, 18.230455, 20.480429, 18.230455, 20.480429);
((GeneralPath)shape).lineTo(16.81613, 20.479515);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
g.setTransform(defaultTransform__0_0_5_13);
g.setTransform(defaultTransform__0_0_5);
g.setComposite(AlphaComposite.getInstance(3, 0.62886596f * origAlpha));
AffineTransform defaultTransform__0_0_6 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_6
paint = new Color(255, 255, 255, 255);
stroke = new BasicStroke(1.0f,0,0,4.0f,null,0.0f);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(5.414681, 19.121548);
((GeneralPath)shape).curveTo(5.3634243, 19.121414, 6.251433, 31.93862, 6.956946, 40.927803);
((GeneralPath)shape).curveTo(7.138951, 43.235264, 7.508862, 44.174408, 8.942307, 44.174408);
((GeneralPath)shape).curveTo(20.75913, 44.174408, 37.552948, 44.260506, 38.124794, 44.258404);
((GeneralPath)shape).curveTo(40.8913, 44.248245, 40.839523, 43.22092, 41.068645, 41.03815);
((GeneralPath)shape).curveTo(41.152054, 40.243546, 42.601147, 19.210922, 42.587322, 19.210922);
((GeneralPath)shape).curveTo(32.686245, 19.210922, 17.64779, 19.153519, 5.414681, 19.121548);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.setStroke(stroke);
g.draw(shape);
g.setTransform(defaultTransform__0_0_6);
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
AffineTransform defaultTransform__0_0_7 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_7
paint = new LinearGradientPaint(new Point2D.Double(24.0000057220459, 15.837312698364258), new Point2D.Double(24.0000057220459, 21.0), new float[] {0.0f,0.7567568f,1.0f}, new Color[] {new Color(89, 139, 203, 255),new Color(47, 92, 150, 255),new Color(32, 62, 101, 255)}, MultipleGradientPaint.CycleMethod.NO_CYCLE, MultipleGradientPaint.ColorSpaceType.SRGB, new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
shape = new GeneralPath();
((GeneralPath)shape).moveTo(7.163233, 6.56876);
((GeneralPath)shape).curveTo(6.0964704, 6.571197, 5.203674, 6.59587, 4.7173743, 7.611591);
((GeneralPath)shape).curveTo(4.6328516, 7.788132, 2.0564582, 14.953189, 1.9325929, 15.226435);
((GeneralPath)shape).curveTo(0.8721842, 17.565664, 1.8500978, 20.512358, 3.8982468, 20.492628);
((GeneralPath)shape).curveTo(4.2877545, 20.488998, 44.257347, 20.510899, 44.877144, 20.492628);
((GeneralPath)shape).curveTo(46.620636, 20.442135, 46.843746, 17.029898, 46.093185, 15.494889);
((GeneralPath)shape).curveTo(46.050663, 15.407927, 42.567223, 7.513946, 42.47838, 7.374125);
((GeneralPath)shape).curveTo(42.067463, 6.749683, 41.14725, 6.476015, 40.463707, 6.501646);
((GeneralPath)shape).curveTo(40.329056, 6.506821, 7.296499, 6.568457, 7.163233, 6.56876);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
paint = new Color(32, 74, 135, 255);
stroke = new BasicStroke(1.0f,0,0,4.0f,null,0.0f);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(7.163233, 6.56876);
((GeneralPath)shape).curveTo(6.0964704, 6.571197, 5.203674, 6.59587, 4.7173743, 7.611591);
((GeneralPath)shape).curveTo(4.6328516, 7.788132, 2.0564582, 14.953189, 1.9325929, 15.226435);
((GeneralPath)shape).curveTo(0.8721842, 17.565664, 1.8500978, 20.512358, 3.8982468, 20.492628);
((GeneralPath)shape).curveTo(4.2877545, 20.488998, 44.257347, 20.510899, 44.877144, 20.492628);
((GeneralPath)shape).curveTo(46.620636, 20.442135, 46.843746, 17.029898, 46.093185, 15.494889);
((GeneralPath)shape).curveTo(46.050663, 15.407927, 42.567223, 7.513946, 42.47838, 7.374125);
((GeneralPath)shape).curveTo(42.067463, 6.749683, 41.14725, 6.476015, 40.463707, 6.501646);
((GeneralPath)shape).curveTo(40.329056, 6.506821, 7.296499, 6.568457, 7.163233, 6.56876);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.setStroke(stroke);
g.draw(shape);
g.setTransform(defaultTransform__0_0_7);
g.setComposite(AlphaComposite.getInstance(3, 0.14948454f * origAlpha));
AffineTransform defaultTransform__0_0_8 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_8
paint = new Color(85, 87, 83, 255);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(4.79225, 20.902176);
((GeneralPath)shape).lineTo(7.292169, 20.902264);
((GeneralPath)shape).lineTo(8.058021, 41.513138);
((GeneralPath)shape).lineTo(7.2954774, 44.58633);
((GeneralPath)shape).curveTo(6.688538, 44.099873, 6.4168015, 43.36201, 6.2792296, 42.52353);
((GeneralPath)shape).lineTo(4.79225, 20.902176);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
g.setTransform(defaultTransform__0_0_8);
g.setComposite(AlphaComposite.getInstance(3, 0.42783505f * origAlpha));
AffineTransform defaultTransform__0_0_9 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_9
paint = new Color(238, 238, 236, 255);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(8.033569, 41.611683);
((GeneralPath)shape).lineTo(7.3212657, 44.54057);
((GeneralPath)shape).curveTo(7.744129, 44.765465, 8.057012, 44.85283, 8.5125475, 45.007175);
((GeneralPath)shape).lineTo(38.53843, 44.978477);
((GeneralPath)shape).curveTo(39.11735, 44.938854, 39.669098, 44.912678, 40.052765, 44.806892);
((GeneralPath)shape).lineTo(38.00699, 41.370872);
((GeneralPath)shape).lineTo(8.033569, 41.611683);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
g.setTransform(defaultTransform__0_0_9);
g.setComposite(AlphaComposite.getInstance(3, 0.371134f * origAlpha));
AffineTransform defaultTransform__0_0_10 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_10
paint = new Color(238, 238, 236, 255);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(38.00699, 41.370872);
((GeneralPath)shape).lineTo(40.01949, 44.81576);
((GeneralPath)shape).curveTo(40.63769, 44.55256, 41.34983, 44.09195, 41.630913, 42.961864);
((GeneralPath)shape).lineTo(43.139313, 20.94521);
((GeneralPath)shape).lineTo(39.69211, 20.942984);
((GeneralPath)shape).lineTo(38.00699, 41.370872);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
g.setTransform(defaultTransform__0_0_10);
g.setComposite(AlphaComposite.getInstance(3, 0.38659793f * origAlpha));
AffineTransform defaultTransform__0_0_11 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_11
paint = new LinearGradientPaint(new Point2D.Double(21.67790985107422, 19.969507217407227), new Point2D.Double(22.33352279663086, 11.643976211547852), new float[] {0.0f,1.0f}, new Color[] {new Color(255, 255, 255, 255),new Color(255, 255, 255, 0)}, MultipleGradientPaint.CycleMethod.NO_CYCLE, MultipleGradientPaint.ColorSpaceType.SRGB, new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
stroke = new BasicStroke(1.0f,0,0,4.0f,null,0.0f);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(40.375, 7.53125);
((GeneralPath)shape).curveTo(40.307785, 7.5315127, 40.187424, 7.5621486, 40.0625, 7.5625);
((GeneralPath)shape).curveTo(39.812653, 7.5632033, 39.458454, 7.5614724, 39.0, 7.5625);
((GeneralPath)shape).curveTo(38.083088, 7.5645556, 36.778275, 7.559461, 35.21875, 7.5625);
((GeneralPath)shape).curveTo(32.0997, 7.5685787, 27.959843, 7.58628, 23.8125, 7.59375);
((GeneralPath)shape).curveTo(15.517814, 7.6086903, 7.175529, 7.593706, 7.15625, 7.59375);
((GeneralPath)shape).curveTo(6.6366935, 7.594937, 6.261561, 7.652425, 6.0625, 7.71875);
((GeneralPath)shape).curveTo(5.863439, 7.7850757, 5.795362, 7.77194, 5.65625, 8.0625);
((GeneralPath)shape).curveTo(5.7244234, 7.9201074, 5.6779785, 8.036386, 5.65625, 8.09375);
((GeneralPath)shape).curveTo(5.6345215, 8.151114, 5.6013284, 8.238751, 5.5625, 8.34375);
((GeneralPath)shape).curveTo(5.4848433, 8.553747, 5.3772674, 8.870004, 5.25, 9.21875);
((GeneralPath)shape).curveTo(4.9954653, 9.916243, 4.647162, 10.82881, 4.3125, 11.75);
((GeneralPath)shape).curveTo(3.977838, 12.67119, 3.6668003, 13.599915, 3.40625, 14.3125);
((GeneralPath)shape).curveTo(3.275975, 14.668793, 3.1460285, 14.962545, 3.0625, 15.1875);
((GeneralPath)shape).curveTo(2.9789715, 15.412455, 2.96316, 15.461769, 2.875, 15.65625);
((GeneralPath)shape).curveTo(2.463348, 16.564342, 2.4810984, 17.654814, 2.75, 18.40625);
((GeneralPath)shape).curveTo(3.0189016, 19.157686, 3.387622, 19.473745, 3.90625, 19.46875);
((GeneralPath)shape).curveTo(4.0431166, 19.467474, 4.618759, 19.468534, 5.75, 19.46875);
((GeneralPath)shape).curveTo(6.881241, 19.468966, 8.469657, 19.46812, 10.375, 19.46875);
((GeneralPath)shape).curveTo(14.185686, 19.470007, 19.25455, 19.46738, 24.3125, 19.46875);
((GeneralPath)shape).curveTo(29.37045, 19.47012, 34.44211, 19.469322, 38.28125, 19.46875);
((GeneralPath)shape).curveTo(40.20082, 19.468464, 41.785362, 19.469906, 42.9375, 19.46875);
((GeneralPath)shape).curveTo(44.089638, 19.467594, 44.934708, 19.466068, 44.84375, 19.46875);
((GeneralPath)shape).curveTo(44.93948, 19.465979, 44.944878, 19.474737, 45.0625, 19.3125);
((GeneralPath)shape).curveTo(45.180122, 19.150263, 45.303425, 18.79192, 45.375, 18.375);
((GeneralPath)shape).curveTo(45.51815, 17.541162, 45.378994, 16.424294, 45.15625, 15.96875);
((GeneralPath)shape).curveTo(45.08818, 15.829539, 45.122097, 15.876058, 45.09375, 15.8125);
((GeneralPath)shape).curveTo(45.065403, 15.748942, 45.01873, 15.674998, 44.96875, 15.5625);
((GeneralPath)shape).curveTo(44.868786, 15.337505, 44.72996, 15.002468, 44.5625, 14.625);
((GeneralPath)shape).curveTo(44.227577, 13.870065, 43.788494, 12.876072, 43.34375, 11.875);
((GeneralPath)shape).curveTo(42.899006, 10.873928, 42.46493, 9.884789, 42.125, 9.125);
((GeneralPath)shape).curveTo(41.955036, 8.745106, 41.790173, 8.413838, 41.6875, 8.1875);
((GeneralPath)shape).curveTo(41.636166, 8.074331, 41.590405, 7.997518, 41.5625, 7.9375);
((GeneralPath)shape).curveTo(41.439575, 7.7832594, 40.85875, 7.517798, 40.5, 7.53125);
((GeneralPath)shape).curveTo(40.400017, 7.535093, 40.456734, 7.5311365, 40.4375, 7.53125);
((GeneralPath)shape).curveTo(40.418266, 7.5313635, 40.408607, 7.531119, 40.375, 7.53125);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.setStroke(stroke);
g.draw(shape);
g.setTransform(defaultTransform__0_0_11);
g.setComposite(AlphaComposite.getInstance(3, 0.8298969f * origAlpha));
AffineTransform defaultTransform__0_0_12 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_12
paint = new LinearGradientPaint(new Point2D.Double(27.5, 14.0), new Point2D.Double(27.625, 18.750015258789062), new float[] {0.0f,1.0f}, new Color[] {new Color(0, 0, 0, 255),new Color(0, 0, 0, 0)}, MultipleGradientPaint.CycleMethod.NO_CYCLE, MultipleGradientPaint.ColorSpaceType.SRGB, new AffineTransform(1.0f, 0.0f, 0.0f, 0.7999910116195679f, 0.0f, -1.199874997138977f));
shape = new GeneralPath();
((GeneralPath)shape).moveTo(8.0, 10.0);
((GeneralPath)shape).lineTo(7.375, 12.0);
((GeneralPath)shape).lineTo(39.375, 12.0);
((GeneralPath)shape).lineTo(38.593147, 10.07544);
((GeneralPath)shape).lineTo(8.0, 10.0);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
g.setTransform(defaultTransform__0_0_12);
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
AffineTransform defaultTransform__0_0_13 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_13
paint = new LinearGradientPaint(new Point2D.Double(26.151338577270508, -5.740115642547607), new Point2D.Double(27.50038719177246, 13.351767539978027), new float[] {0.0f,1.0f}, new Color[] {new Color(255, 255, 255, 255),new Color(211, 211, 211, 255)}, MultipleGradientPaint.CycleMethod.NO_CYCLE, MultipleGradientPaint.ColorSpaceType.SRGB, new AffineTransform(0.9845330119132996f, 0.0f, 0.0f, 1.2035859823226929f, 0.9719030261039734f, -2.1231911182403564f));
shape = new GeneralPath();
((GeneralPath)shape).moveTo(9.853549, 1.5000014);
((GeneralPath)shape).lineTo(37.167316, 1.5000014);
((GeneralPath)shape).curveTo(37.363186, 1.5000014, 37.52087, 1.6576864, 37.52087, 1.853555);
((GeneralPath)shape).lineTo(37.52087, 11.500003);
((GeneralPath)shape).curveTo(37.52087, 11.500003, 9.499995, 11.500003, 9.499995, 11.500003);
((GeneralPath)shape).lineTo(9.499995, 1.853555);
((GeneralPath)shape).curveTo(9.499995, 1.6576864, 9.6576805, 1.5000014, 9.853549, 1.5000014);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
paint = new Color(136, 138, 133, 255);
stroke = new BasicStroke(1.0000008f,0,0,4.0f,null,0.0f);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(9.853549, 1.5000014);
((GeneralPath)shape).lineTo(37.167316, 1.5000014);
((GeneralPath)shape).curveTo(37.363186, 1.5000014, 37.52087, 1.6576864, 37.52087, 1.853555);
((GeneralPath)shape).lineTo(37.52087, 11.500003);
((GeneralPath)shape).curveTo(37.52087, 11.500003, 9.499995, 11.500003, 9.499995, 11.500003);
((GeneralPath)shape).lineTo(9.499995, 1.853555);
((GeneralPath)shape).curveTo(9.499995, 1.6576864, 9.6576805, 1.5000014, 9.853549, 1.5000014);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.setStroke(stroke);
g.draw(shape);
g.setTransform(defaultTransform__0_0_13);
g.setComposite(AlphaComposite.getInstance(3, 0.62886596f * origAlpha));
AffineTransform defaultTransform__0_0_14 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_14
paint = new Color(255, 255, 255, 255);
stroke = new BasicStroke(1.0000002f,2,0,4.0f,null,0.0f);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(10.499998, 10.522594);
((GeneralPath)shape).lineTo(10.499998, 2.5000012);
((GeneralPath)shape).lineTo(36.50438, 2.5000012);
((GeneralPath)shape).lineTo(36.50438, 10.611733);
g.setPaint(paint);
g.setStroke(stroke);
g.draw(shape);
g.setTransform(defaultTransform__0_0_14);
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
AffineTransform defaultTransform__0_0_15 = g.getTransform();
g.transform(new AffineTransform(0.8143839836120605f, 0.0f, 0.0f, 0.796379029750824f, 7.5837202072143555f, 3.212693929672241f));
// _0_0_15
paint = new Color(204, 0, 0, 255);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(43.0, 15.0);
((GeneralPath)shape).curveTo(43.004005, 15.447914, 42.52839, 15.862662, 41.75324, 16.0872);
((GeneralPath)shape).curveTo(40.97809, 16.311737, 40.02191, 16.311737, 39.24676, 16.0872);
((GeneralPath)shape).curveTo(38.47161, 15.862662, 37.995995, 15.447914, 38.0, 15.0);
((GeneralPath)shape).curveTo(37.995995, 14.552086, 38.47161, 14.137338, 39.24676, 13.9128);
((GeneralPath)shape).curveTo(40.02191, 13.688263, 40.97809, 13.688263, 41.75324, 13.9128);
((GeneralPath)shape).curveTo(42.52839, 14.137338, 43.004005, 14.552086, 43.0, 15.0);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
paint = new Color(164, 0, 0, 255);
stroke = new BasicStroke(1.2417247f,2,0,4.0f,null,0.0f);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(43.0, 15.0);
((GeneralPath)shape).curveTo(43.004005, 15.447914, 42.52839, 15.862662, 41.75324, 16.0872);
((GeneralPath)shape).curveTo(40.97809, 16.311737, 40.02191, 16.311737, 39.24676, 16.0872);
((GeneralPath)shape).curveTo(38.47161, 15.862662, 37.995995, 15.447914, 38.0, 15.0);
((GeneralPath)shape).curveTo(37.995995, 14.552086, 38.47161, 14.137338, 39.24676, 13.9128);
((GeneralPath)shape).curveTo(40.02191, 13.688263, 40.97809, 13.688263, 41.75324, 13.9128);
((GeneralPath)shape).curveTo(42.52839, 14.137338, 43.004005, 14.552086, 43.0, 15.0);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.setStroke(stroke);
g.draw(shape);
g.setTransform(defaultTransform__0_0_15);
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
AffineTransform defaultTransform__0_0_16 = g.getTransform();
g.transform(new AffineTransform(0.8143839836120605f, 0.0f, 0.0f, 0.796379029750824f, 7.5837202072143555f, 2.549783945083618f));
// _0_0_16
paint = new Color(239, 41, 41, 255);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(43.0, 15.0);
((GeneralPath)shape).curveTo(43.004005, 15.447914, 42.52839, 15.862662, 41.75324, 16.0872);
((GeneralPath)shape).curveTo(40.97809, 16.311737, 40.02191, 16.311737, 39.24676, 16.0872);
((GeneralPath)shape).curveTo(38.47161, 15.862662, 37.995995, 15.447914, 38.0, 15.0);
((GeneralPath)shape).curveTo(37.995995, 14.552086, 38.47161, 14.137338, 39.24676, 13.9128);
((GeneralPath)shape).curveTo(40.02191, 13.688263, 40.97809, 13.688263, 41.75324, 13.9128);
((GeneralPath)shape).curveTo(42.52839, 14.137338, 43.004005, 14.552086, 43.0, 15.0);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
paint = new LinearGradientPaint(new Point2D.Double(40.5, 13.822796821594238), new Point2D.Double(40.5, 16.87784194946289), new float[] {0.0f,1.0f}, new Color[] {new Color(164, 0, 0, 255),new Color(255, 196, 196, 255)}, MultipleGradientPaint.CycleMethod.NO_CYCLE, MultipleGradientPaint.ColorSpaceType.SRGB, new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
stroke = new BasicStroke(1.2417247f,2,0,4.0f,null,0.0f);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(43.0, 15.0);
((GeneralPath)shape).curveTo(43.004005, 15.447914, 42.52839, 15.862662, 41.75324, 16.0872);
((GeneralPath)shape).curveTo(40.97809, 16.311737, 40.02191, 16.311737, 39.24676, 16.0872);
((GeneralPath)shape).curveTo(38.47161, 15.862662, 37.995995, 15.447914, 38.0, 15.0);
((GeneralPath)shape).curveTo(37.995995, 14.552086, 38.47161, 14.137338, 39.24676, 13.9128);
((GeneralPath)shape).curveTo(40.02191, 13.688263, 40.97809, 13.688263, 41.75324, 13.9128);
((GeneralPath)shape).curveTo(42.52839, 14.137338, 43.004005, 14.552086, 43.0, 15.0);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.setStroke(stroke);
g.draw(shape);
g.setTransform(defaultTransform__0_0_16);
g.setComposite(AlphaComposite.getInstance(3, 0.2731959f * origAlpha));
AffineTransform defaultTransform__0_0_17 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_17
paint = new LinearGradientPaint(new Point2D.Double(23.5, 12.0), new Point2D.Double(23.5, 6.6875), new float[] {0.0f,1.0f}, new Color[] {new Color(0, 0, 0, 255),new Color(0, 0, 0, 0)}, MultipleGradientPaint.CycleMethod.NO_CYCLE, MultipleGradientPaint.ColorSpaceType.SRGB, new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
shape = new Rectangle2D.Double(9.0, 6.6875, 29.0, 5.3125);
g.setPaint(paint);
g.fill(shape);
g.setTransform(defaultTransform__0_0_17);
g.setComposite(AlphaComposite.getInstance(3, 0.13917527f * origAlpha));
AffineTransform defaultTransform__0_0_18 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_18
paint = new Color(0, 0, 0, 255);
shape = new RoundRectangle2D.Double(12.0, 4.0, 23.0, 1.0, 1.0, 1.0);
g.setPaint(paint);
g.fill(shape);
g.setTransform(defaultTransform__0_0_18);
g.setComposite(AlphaComposite.getInstance(3, 0.13917527f * origAlpha));
AffineTransform defaultTransform__0_0_19 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_19
paint = new Color(0, 0, 0, 255);
shape = new RoundRectangle2D.Double(12.0, 6.0, 15.0, 1.0, 1.0, 1.0);
g.setPaint(paint);
g.fill(shape);
g.setTransform(defaultTransform__0_0_19);
g.setComposite(AlphaComposite.getInstance(3, 0.13917527f * origAlpha));
AffineTransform defaultTransform__0_0_20 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_20
paint = new Color(0, 0, 0, 255);
shape = new RoundRectangle2D.Double(12.0, 8.0, 19.0, 1.0, 1.0, 1.0);
g.setPaint(paint);
g.fill(shape);
g.setTransform(defaultTransform__0_0_20);
g.setTransform(defaultTransform__0_0);
g.setTransform(defaultTransform__0);
g.setTransform(defaultTransform_);
}
/**
* Returns the X of the bounding box of the original SVG image.
*
* @return The X of the bounding box of the original SVG image.
*/
public static double getOrigX() {
return 0.51534104347229;
}
/**
* Returns the Y of the bounding box of the original SVG image.
*
* @return The Y of the bounding box of the original SVG image.
*/
public static double getOrigY() {
return 1.0000009536743164;
}
/**
* Returns the width of the bounding box of the original SVG image.
*
* @return The width of the bounding box of the original SVG image.
*/
public static double getOrigWidth() {
return 46.72550964355469;
}
/**
* Returns the height of the bounding box of the original SVG image.
*
* @return The height of the bounding box of the original SVG image.
*/
public static double getOrigHeight() {
return 47.0;
}
/** The current width of this resizable icon. */
private int width;
/** The current height of this resizable icon. */
private int height;
/**
* Creates a new transcoded SVG image. This is marked as private to indicate that app
* code should be using the {@link #of(int, int)} method to obtain a pre-configured instance.
*/
private edit_delete() {
this.width = (int) getOrigWidth();
this.height = (int) getOrigHeight();
}
@Override
public int getIconHeight() {
return height;
}
@Override
public int getIconWidth() {
return width;
}
@Override
public void setDimension(Dimension newDimension) {
this.width = newDimension.width;
this.height = newDimension.height;
}
@Override
public void paintIcon(Component c, Graphics g, int x, int y) {
Graphics2D g2d = (Graphics2D) g.create();
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
RenderingHints.VALUE_INTERPOLATION_BICUBIC);
g2d.translate(x, y);
double coef1 = (double) this.width / getOrigWidth();
double coef2 = (double) this.height / getOrigHeight();
double coef = Math.min(coef1, coef2);
g2d.clipRect(0, 0, this.width, this.height);
g2d.scale(coef, coef);
g2d.translate(-getOrigX(), -getOrigY());
if (coef1 != coef2) {
if (coef1 < coef2) {
int extraDy = (int) ((getOrigWidth() - getOrigHeight()) / 2.0);
g2d.translate(0, extraDy);
} else {
int extraDx = (int) ((getOrigHeight() - getOrigWidth()) / 2.0);
g2d.translate(extraDx, 0);
}
}
Graphics2D g2ForInner = (Graphics2D) g2d.create();
innerPaint(g2ForInner);
g2ForInner.dispose();
g2d.dispose();
}
/**
* Returns a new instance of this icon with specified dimensions.
*
* @param width Required width of the icon
* @param height Required height of the icon
* @return A new instance of this icon with specified dimensions.
*/
public static ResizableIcon of(int width, int height) {
edit_delete base = new edit_delete();
base.width = width;
base.height = height;
return base;
}
/**
* Returns a new {@link UIResource} instance of this icon with specified dimensions.
*
* @param width Required width of the icon
* @param height Required height of the icon
* @return A new {@link UIResource} instance of this icon with specified dimensions.
*/
public static ResizableIconUIResource uiResourceOf(int width, int height) {
edit_delete base = new edit_delete();
base.width = width;
base.height = height;
return new ResizableIconUIResource(base);
}
/**
* Returns a factory that returns instances of this icon on demand.
*
* @return Factory that returns instances of this icon on demand.
*/
public static Factory factory() {
return () -> new edit_delete();
}
} |
package org.gridkit.lab.gridant;
public class GridAntProps {
public static final String REMOTE_ANT_BASE_DIR = "org.grikit.lab.gridant.ANT_BASE_DIR";
public static final String SLAVE_HOSTNAME = "slave.hostname";
public static final String SLAVE_ID = "slave.id";
}
|
#include<stdio.h>
int n,a[100050],b[150];
int main(){
while(scanf("%d",&n)!=EOF){
for(int i=0;i<n;i++){
scanf("%d",&a[i]);
}
for(int i=0;i<150;i++){
b[i]=0;
}
int flag=0;
for(int i=0;i<n;i++){
if(a[i]==25){
b[25]++;
}else if(a[i]==50){
b[50]++;
if(b[25]>0){
b[25]--;
}else{
flag=1;
break;
}
}else if(a[i]==100){
b[100]++;
if(b[50]>=1&&b[25]>=1){
b[50]--;
b[25]--;
}else{
if(b[25]>=3){
b[25]-=3;
}else{
flag=1;
break;
}
}
}
}
if(flag==1){
printf("NO\n");
}else{
printf("YES\n");
}
}
return 0;
}
|
import React, { Component, forwardRef } from 'react';
import { default as styled } from 'styled-components';
import classnames from 'classnames';
import { HtmlDiv, HtmlDivWithRef } from '../../../reset';
import { Icon } from '../../../core/Icon/Icon';
import {
BaseAlertProps,
alertClassNames,
baseClassName,
} from '../BaseAlert/BaseAlert';
import { AutoId } from '../../utils/AutoId/AutoId';
import { SuomifiThemeProp, SuomifiThemeConsumer } from '../../theme';
import { baseStyles } from './InlineAlert.baseStyles';
export interface InlineAlertProps extends BaseAlertProps {
/** Label for the alert */
labelText?: string;
/** Set aria-live mode for the alert text content and label.
* @default 'assertive'
*/
ariaLiveMode?: 'polite' | 'assertive' | 'off';
}
interface InnerRef {
forwardedRef: React.RefObject<HTMLDivElement>;
}
class BaseInlineAlert extends Component<InlineAlertProps & InnerRef> {
render() {
const {
className,
status = 'neutral',
ariaLiveMode = 'assertive',
labelText,
children,
smallScreen,
id,
...passProps
} = this.props;
return (
<HtmlDivWithRef
as="section"
{...passProps}
className={classnames(
baseClassName,
alertClassNames.inline,
className,
{
[`${baseClassName}--${status}`]: !!status,
[alertClassNames.smallScreen]: !!smallScreen,
},
)}
>
<HtmlDiv className={alertClassNames.styleWrapper}>
{status !== 'neutral' && (
<Icon icon={status} className={alertClassNames.icon} />
)}
<HtmlDiv
className={alertClassNames.textContentWrapper}
id={id}
aria-live={ariaLiveMode}
>
{labelText && (
<HtmlDiv className={alertClassNames.label}>{labelText}</HtmlDiv>
)}
<HtmlDiv className={alertClassNames.content}>{children}</HtmlDiv>
</HtmlDiv>
</HtmlDiv>
</HtmlDivWithRef>
);
}
}
const StyledInlineAlert = styled(
(props: InlineAlertProps & InnerRef & SuomifiThemeProp) => {
const { theme, ...passProps } = props;
return <BaseInlineAlert {...passProps} />;
},
)`
${({ theme }) => baseStyles(theme)}
`;
export const InlineAlert = forwardRef(
(props: InlineAlertProps, ref: React.RefObject<HTMLDivElement>) => {
const { id: propId, ...passProps } = props;
return (
<SuomifiThemeConsumer>
{({ suomifiTheme }) => (
<AutoId id={propId}>
{(id) => (
<StyledInlineAlert
forwardedRef={ref}
theme={suomifiTheme}
id={id}
{...passProps}
/>
)}
</AutoId>
)}
</SuomifiThemeConsumer>
);
},
);
|
<gh_stars>1000+
/**
* Copyright (c) Areslabs.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import * as path from 'path'
import * as webpack from 'webpack'
import {geneReactCode} from '../util/uast'
import jsxTran from '../tran/index'
import {miscNameToJSName} from "../util/util";
import {LoaderTmpResult} from './interfaces'
import configure from '../configure'
export default function (this: webpack.loader.LoaderContext,
{ast, isEntry, isRF, isFuncComp} : LoaderTmpResult ): string {
const filepath = this.resourcePath
const {entryFullpath, allCompSet} = configure
let finalCode: string = null
if (filepath === entryFullpath) {
// nothing
finalCode = geneReactCode(ast)
} else if (isRF) {
finalCode = jsxTran(ast, filepath, isFuncComp, isPageComp(filepath, allCompSet), this)
} else {
finalCode = geneReactCode(ast)
}
console.log(`处理完成:${filepath.replace(configure.inputFullpath, '')}`.info)
return finalCode
}
function isPageComp(filepath:string, allCompSet: Set<any>): boolean {
const originPath = miscNameToJSName(filepath)
.replace(configure.inputFullpath + path.sep, '')
.replace('.js', '')
.replace(/\\/g, '/') // 考虑win平台
return allCompSet.has(originPath)
}
|
use warp::crypto::rand::{self, prelude::*};
use warp::multipass::identity::{Identifier, Identity};
use warp::multipass::{Friends, MultiPass};
use warp::pocket_dimension::PocketDimension;
use warp::sync::{Arc, Mutex};
use warp::tesseract::Tesseract;
use warp_mp_solana::solana::anchor_client::anchor_lang::prelude::Pubkey;
use warp_mp_solana::SolanaAccount;
use warp_pd_flatfile::FlatfileStorage;
// use warp_solana_utils::wallet::SolanaWallet;
// fn wallet_a() -> anyhow::Result<SolanaWallet> {
// SolanaWallet::restore_from_mnemonic(
// None,
// "morning caution dose lab six actress pond humble pause enact virtual train",
// )
// }
//
// fn wallet_b() -> anyhow::Result<SolanaWallet> {
// SolanaWallet::restore_from_mnemonic(
// None,
// "mercy quick supreme jealous hire coral guilt undo author detail truck grid",
// )
// }
#[allow(unused)]
fn cache_setup() -> anyhow::Result<Arc<Mutex<Box<dyn PocketDimension>>>> {
let mut root = std::env::temp_dir();
root.push("pd-cache");
let index = {
let mut index = std::path::PathBuf::new();
index.push("cache-index");
index
};
let storage = FlatfileStorage::new_with_index_file(root, index)?;
Ok(Arc::new(Mutex::new(Box::new(storage))))
}
fn account() -> anyhow::Result<SolanaAccount> {
let mut tesseract = Tesseract::default();
tesseract
.unlock(b"this is my totally secured password that should nnever be embedded in code")?;
let tesseract = Arc::new(Mutex::new(tesseract));
// let pd = cache_setup()?;
let mut account = SolanaAccount::with_devnet();
account.set_tesseract(tesseract);
// account.set_cache(pd);
account.create_identity(None, None)?;
Ok(account)
}
fn username(ident: &Identity) -> String {
format!("{}#{}", &ident.username(), &ident.short_id())
}
fn main() -> anyhow::Result<()> {
let mut rng = rand::thread_rng();
let mut account_a = account()?;
let mut account_b = account()?;
let ident_a = account_a.get_own_identity()?;
println!(
"{} with {}",
username(&ident_a),
Pubkey::new(ident_a.public_key().as_ref())
);
let ident_b = account_b.get_own_identity()?;
println!(
"{} with {}",
username(&ident_b),
Pubkey::new(ident_b.public_key().as_ref())
);
println!();
if account_a.has_friend(ident_b.public_key()).is_ok() {
println!(
"{} are friends with {}",
username(&ident_a),
username(&ident_b)
);
return Ok(());
}
account_a.send_request(ident_b.public_key())?;
println!("{} Outgoing request:", username(&ident_a));
for outgoing in account_a.list_outgoing_request()? {
let ident_from = account_a.get_identity(Identifier::from(outgoing.from()))?;
let ident_to = account_a.get_identity(Identifier::from(outgoing.to()))?;
println!("From: {}", username(&ident_from));
println!("To: {}", username(&ident_to));
println!("Status: {:?}", outgoing.status());
println!();
}
println!("{} Incoming request:", username(&ident_b));
for incoming in account_b.list_incoming_request()? {
let ident_from = account_b.get_identity(Identifier::from(incoming.from()))?;
let ident_to = account_b.get_identity(Identifier::from(incoming.to()))?;
println!("From: {}", username(&ident_from));
println!("To: {}", username(&ident_to));
println!("Status: {:?}", incoming.status());
println!();
}
let coin = rng.gen_range(0, 2);
match coin {
0 => {
account_b.accept_request(ident_a.public_key())?;
println!("{} Friends:", username(&ident_a));
for friend in account_a.list_friends()? {
println!("Username: {}", username(&friend));
println!("Public Key: {}", Pubkey::new(friend.public_key().as_ref()));
println!();
}
println!("{} Friends:", username(&ident_b));
for friend in account_b.list_friends()? {
println!("Username: {}", username(&friend));
println!("Public Key: {}", Pubkey::new(friend.public_key().as_ref()));
println!();
}
if rand::random() {
account_a.remove_friend(ident_b.public_key())?;
if account_a.has_friend(ident_b.public_key()).is_ok() {
println!(
"{} is stuck with {} forever",
username(&ident_a),
username(&ident_b)
);
} else {
println!("{} removed {}", username(&ident_a), username(&ident_b));
}
} else {
account_b.remove_friend(ident_a.public_key())?;
if account_b.has_friend(ident_a.public_key()).is_ok() {
println!(
"{} is stuck with {} forever",
username(&ident_b),
username(&ident_a)
);
} else {
println!("{} removed {}", username(&ident_b), username(&ident_a));
}
}
}
1 | _ => {
println!("Denying {} friend request", username(&ident_a));
account_b.deny_request(ident_a.public_key())?;
}
}
println!();
println!("Request List for {}", username(&ident_a));
for list in account_a.list_all_request()? {
let ident_from = account_a.get_identity(Identifier::from(list.from()))?;
let ident_to = account_a.get_identity(Identifier::from(list.to()))?;
println!("From: {}", username(&ident_from));
println!("To: {}", username(&ident_to));
println!("Status: {:?}", list.status());
println!();
}
Ok(())
}
|
<gh_stars>0
package webp
/*
#cgo CFLAGS: -I./internal/libwebp-1.1/
#cgo CFLAGS: -I./internal/libwebp-1.1/src/
#cgo CFLAGS: -Wno-pointer-sign -DWEBP_USE_THREAD
#cgo !windows LDFLAGS: -lm
#include <webp/encode.h>
#include <webp/mux.h>
*/
import "C"
import (
"errors"
"unsafe"
)
type WebPMuxError int
const (
WebpMuxAbiVersion = 0x0108
WebpEncoderAbiVersion = 0x020f
)
const (
WebpMuxOk = WebPMuxError(C.WEBP_MUX_OK)
WebpMuxNotFound = WebPMuxError(C.WEBP_MUX_NOT_FOUND)
WebpMuxInvalidArgument = WebPMuxError(C.WEBP_MUX_INVALID_ARGUMENT)
WebpMuxBadData = WebPMuxError(C.WEBP_MUX_BAD_DATA)
WebpMuxMemoryError = WebPMuxError(C.WEBP_MUX_MEMORY_ERROR)
WebpMuxNotEnoughData = WebPMuxError(C.WEBP_MUX_NOT_ENOUGH_DATA)
)
type WebPPicture C.WebPPicture
type WebPAnimEncoder C.WebPAnimEncoder
type WebPAnimEncoderOptions C.WebPAnimEncoderOptions
type WebPData C.WebPData
type WebPMux C.WebPMux
type WebPMuxAnimParams C.WebPMuxAnimParams
type webPConfig C.WebPConfig
func WebPDataClear(webPData *WebPData) {
C.WebPDataClear((*C.WebPData)(unsafe.Pointer(webPData)))
}
func WebPMuxDelete(webPMux *WebPMux) {
C.WebPMuxDelete((*C.WebPMux)(unsafe.Pointer(webPMux)))
}
func WebPPictureFree(webPPicture *WebPPicture) {
C.WebPPictureFree((*C.WebPPicture)(unsafe.Pointer(webPPicture)))
}
func WebPAnimEncoderDelete(webPAnimEncoder *WebPAnimEncoder) {
C.WebPAnimEncoderDelete((*C.WebPAnimEncoder)(unsafe.Pointer(webPAnimEncoder)))
}
func (wmap *WebPMuxAnimParams) SetBgcolor(v uint32) {
((*C.WebPMuxAnimParams)(wmap)).bgcolor = (C.uint32_t)(v)
}
func (wmap *WebPMuxAnimParams) SetLoopCount(v int) {
(*C.WebPMuxAnimParams)(wmap).loop_count = (C.int)(v)
}
func WebPPictureInit(webPPicture *WebPPicture) int {
return int(C.WebPPictureInit((*C.WebPPicture)(unsafe.Pointer(webPPicture))))
}
func (wpp *WebPPicture) SetWidth(v int) {
((*C.WebPPicture)(wpp)).width = (C.int)(v)
}
func (wpp *WebPPicture) SetHeight(v int) {
((*C.WebPPicture)(wpp)).height = (C.int)(v)
}
func (wpp WebPPicture) GetWidth() int {
return int(((C.WebPPicture)(wpp)).width)
}
func (wpp WebPPicture) GetHeight() int {
return int(((C.WebPPicture)(wpp)).height)
}
func (wpp *WebPPicture) SetUseArgb(v int) {
((*C.WebPPicture)(wpp)).use_argb = (C.int)(v)
}
func (wpd WebPData) GetBytes() []byte {
return C.GoBytes(unsafe.Pointer(((C.WebPData)(wpd)).bytes), (C.int)(((C.WebPData)(wpd)).size))
}
func WebPDataInit(webPData *WebPData) {
C.WebPDataInit((*C.WebPData)(unsafe.Pointer(webPData)))
}
func WebPConfigInitInternal(config *webPConfig) int {
return int(C.WebPConfigInitInternal(
(*C.WebPConfig)(unsafe.Pointer(config)),
(C.WebPPreset)(0),
(C.float)(75.0),
(C.int)(WebpEncoderAbiVersion),
))
}
func (webpCfg *webPConfig) SetLossless(v int) {
((*C.WebPConfig)(webpCfg)).lossless = (C.int)(v)
}
func (webpCfg webPConfig) GetLossless() int {
return int(((C.WebPConfig)(webpCfg)).lossless)
}
func (webpCfg *webPConfig) SetMethod(v int) {
((*C.WebPConfig)(webpCfg)).method = (C.int)(v)
}
func (webpCfg *webPConfig) SetImageHint(v int) {
((*C.WebPConfig)(webpCfg)).image_hint = (C.WebPImageHint)(v)
}
func (webpCfg *webPConfig) SetTargetSize(v int) {
((*C.WebPConfig)(webpCfg)).target_size = (C.int)(v)
}
func (webpCfg *webPConfig) SetTargetPSNR(v float32) {
((*C.WebPConfig)(webpCfg)).target_PSNR = (C.float)(v)
}
func (webpCfg *webPConfig) SetSegments(v int) {
((*C.WebPConfig)(webpCfg)).segments = (C.int)(v)
}
func (webpCfg *webPConfig) SetSnsStrength(v int) {
((*C.WebPConfig)(webpCfg)).sns_strength = (C.int)(v)
}
func (webpCfg *webPConfig) SetFilterStrength(v int) {
((*C.WebPConfig)(webpCfg)).filter_strength = (C.int)(v)
}
func (webpCfg *webPConfig) SetFilterSharpness(v int) {
((*C.WebPConfig)(webpCfg)).filter_sharpness = (C.int)(v)
}
func (webpCfg *webPConfig) SetAutofilter(v int) {
((*C.WebPConfig)(webpCfg)).autofilter = (C.int)(v)
}
func (webpCfg *webPConfig) SetAlphaCompression(v int) {
((*C.WebPConfig)(webpCfg)).alpha_compression = (C.int)(v)
}
func (webpCfg *webPConfig) SetAlphaFiltering(v int) {
((*C.WebPConfig)(webpCfg)).alpha_filtering = (C.int)(v)
}
func (webpCfg *webPConfig) SetPass(v int) {
((*C.WebPConfig)(webpCfg)).pass = (C.int)(v)
}
func (webpCfg *webPConfig) SetShowCompressed(v int) {
((*C.WebPConfig)(webpCfg)).show_compressed = (C.int)(v)
}
func (webpCfg *webPConfig) SetPreprocessing(v int) {
((*C.WebPConfig)(webpCfg)).preprocessing = (C.int)(v)
}
func (webpCfg *webPConfig) SetPartitions(v int) {
((*C.WebPConfig)(webpCfg)).partitions = (C.int)(v)
}
func (webpCfg *webPConfig) SetPartitionLimit(v int) {
((*C.WebPConfig)(webpCfg)).partition_limit = (C.int)(v)
}
func (webpCfg *webPConfig) SetEmulateJpegSize(v int) {
((*C.WebPConfig)(webpCfg)).emulate_jpeg_size = (C.int)(v)
}
func (webpCfg *webPConfig) SetThreadLevel(v int) {
((*C.WebPConfig)(webpCfg)).thread_level = (C.int)(v)
}
func (webpCfg *webPConfig) SetLowMemory(v int) {
((*C.WebPConfig)(webpCfg)).low_memory = (C.int)(v)
}
func (webpCfg *webPConfig) SetNearLossless(v int) {
((*C.WebPConfig)(webpCfg)).near_lossless = (C.int)(v)
}
func (webpCfg *webPConfig) SetExact(v int) {
((*C.WebPConfig)(webpCfg)).exact = (C.int)(v)
}
func (webpCfg *webPConfig) SetUseDeltaPalette(v int) {
((*C.WebPConfig)(webpCfg)).use_delta_palette = (C.int)(v)
}
func (webpCfg *webPConfig) SetUseSharpYuv(v int) {
((*C.WebPConfig)(webpCfg)).use_sharp_yuv = (C.int)(v)
}
func (webpCfg *webPConfig) SetAlphaQuality(v int) {
((*C.WebPConfig)(webpCfg)).alpha_quality = (C.int)(v)
}
func (webpCfg *webPConfig) SetFilterType(v int) {
((*C.WebPConfig)(webpCfg)).filter_type = (C.int)(v)
}
func (webpCfg *webPConfig) SetQuality(v float32) {
((*C.WebPConfig)(webpCfg)).quality = (C.float)(v)
}
func (encOptions *WebPAnimEncoderOptions) GetAnimParams() WebPMuxAnimParams {
return WebPMuxAnimParams(((*C.WebPAnimEncoderOptions)(encOptions)).anim_params)
}
func (encOptions *WebPAnimEncoderOptions) SetAnimParams(v WebPMuxAnimParams) {
((*C.WebPAnimEncoderOptions)(encOptions)).anim_params = (C.WebPMuxAnimParams)(v)
}
func (encOptions *WebPAnimEncoderOptions) SetMinimizeSize(v int) {
((*C.WebPAnimEncoderOptions)(encOptions)).minimize_size = (C.int)(v)
}
func (encOptions *WebPAnimEncoderOptions) SetKmin(v int) {
((*C.WebPAnimEncoderOptions)(encOptions)).kmin = (C.int)(v)
}
func (encOptions *WebPAnimEncoderOptions) SetKmax(v int) {
((*C.WebPAnimEncoderOptions)(encOptions)).kmax = (C.int)(v)
}
func (encOptions *WebPAnimEncoderOptions) SetAllowMixed(v int) {
((*C.WebPAnimEncoderOptions)(encOptions)).allow_mixed = (C.int)(v)
}
func (encOptions *WebPAnimEncoderOptions) SetVerbose(v int) {
((*C.WebPAnimEncoderOptions)(encOptions)).verbose = (C.int)(v)
}
func WebPAnimEncoderOptionsInitInternal(webPAnimEncoderOptions *WebPAnimEncoderOptions) int {
return int(C.WebPAnimEncoderOptionsInitInternal(
(*C.WebPAnimEncoderOptions)(unsafe.Pointer(webPAnimEncoderOptions)),
(C.int)(WebpMuxAbiVersion),
))
}
func WebPPictureImportRGBA(data []byte, stride int, webPPicture *WebPPicture) error {
res := int(C.WebPPictureImportRGBA(
(*C.WebPPicture)(unsafe.Pointer(webPPicture)),
(*C.uint8_t)(unsafe.Pointer(&data[0])),
(C.int)(stride),
))
if res == 0 {
return errors.New("error: WebPPictureImportBGRA")
}
return nil
}
func WebPAnimEncoderNewInternal(width, height int, webPAnimEncoderOptions *WebPAnimEncoderOptions) *WebPAnimEncoder {
return (*WebPAnimEncoder)(C.WebPAnimEncoderNewInternal(
(C.int)(width),
(C.int)(height),
(*C.WebPAnimEncoderOptions)(unsafe.Pointer(webPAnimEncoderOptions)),
(C.int)(WebpMuxAbiVersion),
))
}
func WebPAnimEncoderAdd(webPAnimEncoder *WebPAnimEncoder, webPPicture *WebPPicture, timestamp int, webPConfig *webPConfig) int {
return int(C.WebPAnimEncoderAdd(
(*C.WebPAnimEncoder)(unsafe.Pointer(webPAnimEncoder)),
(*C.WebPPicture)(unsafe.Pointer(webPPicture)),
(C.int)(timestamp),
(*C.WebPConfig)(unsafe.Pointer(webPConfig)),
))
}
func WebPAnimEncoderAssemble(webPAnimEncoder *WebPAnimEncoder, webPData *WebPData) int {
return int(C.WebPAnimEncoderAssemble(
(*C.WebPAnimEncoder)(unsafe.Pointer(webPAnimEncoder)),
(*C.WebPData)(unsafe.Pointer(webPData)),
))
}
func WebPMuxCreateInternal(webPData *WebPData, copyData int) *WebPMux {
return (*WebPMux)(C.WebPMuxCreateInternal(
(*C.WebPData)(unsafe.Pointer(webPData)),
(C.int)(copyData),
(C.int)(WebpMuxAbiVersion),
))
}
func WebPMuxSetAnimationParams(webPMux *WebPMux, webPMuxAnimParams *WebPMuxAnimParams) WebPMuxError {
return (WebPMuxError)(C.WebPMuxSetAnimationParams(
(*C.WebPMux)(unsafe.Pointer(webPMux)),
(*C.WebPMuxAnimParams)(unsafe.Pointer(webPMuxAnimParams)),
))
}
func WebPMuxGetAnimationParams(webPMux *WebPMux, webPMuxAnimParams *WebPMuxAnimParams) WebPMuxError {
return (WebPMuxError)(C.WebPMuxGetAnimationParams(
(*C.WebPMux)(unsafe.Pointer(webPMux)),
(*C.WebPMuxAnimParams)(unsafe.Pointer(webPMuxAnimParams)),
))
}
func WebPMuxAssemble(webPMux *WebPMux, webPData *WebPData) WebPMuxError {
return (WebPMuxError)(C.WebPMuxAssemble(
(*C.WebPMux)(unsafe.Pointer(webPMux)),
(*C.WebPData)(unsafe.Pointer(webPData)),
))
}
|
const schema = {
required: ['thirdQuestion'],
title: 'My new form title',
properties: {
firstQuestion: {
type: 'string',
title: 'Simple Input',
name: 'firstQuestion',
},
secondQuestion: {
type: 'string',
name: 'secondQuestion',
title: 'Input with custom validation and url',
urlPostfix: 'with-url',
},
thirdQuestion: {
type: 'string',
name: 'thirdQuestion',
title: 'Required Input',
},
fourthQuestion: {
type: 'boolean',
title: 'Basic Checkbox',
name: 'fourthQuestion',
},
fifthQuestion: {
type: 'string',
title: 'Radio Groups',
name: 'fifthQuestion',
enum: ['one', 'two', 'three'],
enumNames: ['one', 'two', 'three'],
},
sixthQuestion: {
type: 'object',
name: 'sixthQuestion',
description: 'Group Properties to Include on One Page',
properties: {
firstQ: {
type: 'string',
title: 'first',
name: 'firstQ',
},
secondQ: {
type: 'string',
title: 'second',
name: 'secondQ',
},
},
dependencies: {
firstQ: ['secondQ'],
},
},
seventhQuestion: {
type: 'string',
name: 'seventhQuestion',
title: 'Text area',
},
eigthQuestion: {
type: 'string',
name: 'eigthQuestion',
title: 'Dropdown',
enum: ['one', 'two', 'three'],
},
ninthQuestion: {
type: 'string',
hasFiles: true,
name: 'ninthQuestion',
title: 'File Picker',
},
tenthQuestion: {
type: 'string',
format: 'date',
name: 'tenthQuestion',
title: 'Date Picker',
},
eleventhQuestion: {
type: 'array',
title: 'A multiple-choice list',
items: {
type: 'string',
enum: ['foo', 'bar', 'fuzz', 'qux'],
},
uniqueItems: true,
},
twelfthQuestion: {
type: 'string',
title: 'Simple Input',
name: 'firstQuestion',
},
},
};
export default schema;
|
package javaCore.java8;
import java.util.Optional;
/**
* @Author zsx
* @Date 2021/2/22
*/
public class OptionalTest {
public static void main(String[] args) {
Optional<Object> optional = Optional.empty();
System.out.println(optional.isPresent());
}
}
|
def ReceiveSequenceNumber(self):
return self._get_attribute(self._SDM_ATT_MAP['ReceiveSequenceNumber']) |
Regressing 3D Face Shapes from Arbitrary Image Sets with Disentanglement in Shape Space
Existing methods for reconstructing 3D faces from multiple unconstrained images mainly focus on generating a canonical identity shape. This paper instead aims to optimize both the identity shape and the deformed shapes unique to individual images. To this end, we disentangle 3D face shapes into identity and residual components and leverage facial landmarks on the 2D images to regress both component shapes in shape space directly. Compared with existing methods, our method reconstructs more personal-ized and visually appealing 3D face shapes thanks to its ability to effectively explore both common and different shape characteristics among the multiple images and to cope with various shape deformation that is not limited to expression changes. Quantitative evaluation shows that our method achieves lower reconstruction errors than state-of-the-art methods. |
package resp
import (
"fmt"
"net/url"
"testing"
"github.com/stretchr/testify/require"
"github.com/xy-planning-network/trails/http/ctx"
"github.com/xy-planning-network/trails/http/session"
"github.com/xy-planning-network/trails/http/template/templatetest"
"github.com/xy-planning-network/trails/logger"
)
func TestResponderWithAuthTemplate(t *testing.T) {
expected := "test.tmpl"
d := NewResponder(WithAuthTemplate(expected))
require.Equal(t, expected, d.authed)
}
func TestResponderWithContactErrMsg(t *testing.T) {
expected := fmt.Sprintf(session.ContactUsErr, "<EMAIL>")
d := NewResponder(WithContactErrMsg(expected))
require.Equal(t, expected, d.contactErrMsg)
}
func TestResponderWithCtxKeys(t *testing.T) {
tcs := []struct {
name string
keys []ctx.CtxKeyable
expected []ctx.CtxKeyable
}{
{"nil", nil, nil},
{"zero-value", make([]ctx.CtxKeyable, 0), nil},
{"many-zero-value", make([]ctx.CtxKeyable, 99), nil},
{"sorted", []ctx.CtxKeyable{ctxKey("a"), ctxKey("c"), ctxKey("e"), ctxKey("d")}, []ctx.CtxKeyable{ctxKey("a"), ctxKey("c"), ctxKey("d"), ctxKey("e")}},
{"deduped", []ctx.CtxKeyable{ctxKey("a"), ctxKey("a"), ctxKey("a")}, []ctx.CtxKeyable{ctxKey("a")}},
{"filtered-zero-value", []ctx.CtxKeyable{ctxKey(""), ctxKey("a"), ctxKey(""), ctxKey("b"), ctxKey("")}, []ctx.CtxKeyable{ctxKey("a"), ctxKey("b")}},
}
for _, tc := range tcs {
t.Run(tc.name, func(t *testing.T) {
d := &Responder{}
WithCtxKeys(tc.keys...)(d)
require.Equal(t, tc.expected, d.ctxKeys)
})
}
}
func TestResponderWithLogger(t *testing.T) {
l := logger.NewLogger()
d := NewResponder(WithLogger(l))
require.Equal(t, l, d.logger)
}
func TestResponderWithParser(t *testing.T) {
p := templatetest.NewParser()
d := NewResponder(WithParser(p))
require.Equal(t, p, d.parser)
}
func TestResponderWithRootUrl(t *testing.T) {
t.Run("Success", func(t *testing.T) {
u, _ := url.ParseRequestURI("https://example.com")
expected := u.String()
d := NewResponder(WithRootUrl("https://example.com"))
require.Equal(t, expected, d.rootUrl.String())
})
t.Run("Null-Byte", func(t *testing.T) {
expected := "https://example.com"
d := NewResponder(WithRootUrl(string('\x00')))
require.Equal(t, expected, d.rootUrl.String())
})
}
func TestResponderWithSessionKey(t *testing.T) {
expected := ctxKey("test")
d := NewResponder(WithSessionKey(expected))
require.Equal(t, expected, d.sessionKey)
}
func TestResponderWithUnauthTemplate(t *testing.T) {
expected := "test.tmpl"
d := NewResponder(WithUnauthTemplate(expected))
require.Equal(t, expected, d.unauthed)
}
func TestResponderWithUserSessionKey(t *testing.T) {
expected := ctxKey("user")
d := NewResponder(WithUserSessionKey(expected))
require.Equal(t, expected, d.userSessionKey)
}
func TestResponderWithVueTemplate(t *testing.T) {
expected := "vue"
d := NewResponder(WithVueTemplate(expected))
require.Equal(t, expected, d.vue)
}
type ctxKey string
func (k ctxKey) Key() string { return string(k) }
func (k ctxKey) String() string { return string(k) }
|
Gender and reported health problems in treated alcohol dependent Alaska natives.
OBJECTIVE
An ongoing study of phenotypes of alcohol dependence among Alaska Natives provides the opportunity to investigate gender differences in reported health-related problems among alcohol dependent clients in three residential programs in Anchorage, Alaska.
METHOD
Clinical assessment information was obtained on 469 (263 male) subjects from consecutive admissions to each of three treatment programs. The average (SD) age of the sample was 33.7 (8.4) years. Patterns of substance use, comorbid psychopathology, overall health status, alcohol and other drug withdrawal symptoms, and psychological and physical consequences of alcohol and other drug use were examined.
RESULTS
Male and female subjects reported similar experiences with alcohol-related health problems, including symptoms of withdrawal and the psychological and physical consequences of chronic alcohol abuse. However, women were significantly more likely to have lifetime diagnoses of major depression and cocaine dependence, whereas men were more likely to have lifetime diagnoses of antisocial personality disorder and marijuana dependence. Women reported a lower overall health status, more medication use and pain complaints, and more negative consequences of cocaine abuse and withdrawal than did men.
CONCLUSIONS
Both men and women within this sample of inpatient alcohol-dependent Alaska Natives were found to have a similar early onset and rapid progression to DSM-III-R alcohol dependence, and to report a similar prevalence of alcohol-related psychological and physical problems. Reports by women of more pain symptoms, more medication use and more negative health consequences related to their cocaine abuse, compared with men in this alcohol dependent sample, suggests additional considerations for treatment planning and intervention. |
def min_max_temp(cities_data):
temps = []
for r in cities_data:
temps.append(float(r['temperature']))
return [min(temps), max(temps)] |
// DecryptFailMsg Print app and author info.
func PrintAppInformation() {
fmt.Print("\033[32m***********************************************************\033[0m\n")
fmt.Print("\033[32m* Doki Doki Literature Club Plus Asset Decrypter *\033[0m\n")
fmt.Print("\033[32m* Author: AimerNeige *\033[0m\n")
fmt.Print("\033[32m* Github: github.com/AimerNeige/DDLC-Plus-Asset-Decrypter *\033[0m\n")
fmt.Print("\033[32m* Refer: github.com/MlgmXyysd/DDLC-Plus-Asset-Decrypter *\033[0m\n")
fmt.Print("\033[32m* Email: [email protected] *\033[0m\n")
fmt.Print("\033[32m***********************************************************\033[0m\n")
} |
def encode(self, x):
stats = self.enc(x).squeeze()
mu, logvar = stats[:, : self.z_dim], stats[:, self.z_dim :]
return mu, logvar |
def jwt_manager(app, api=None):
app.config['JWT_TOKEN_LOCATION'] = ['headers', 'cookies']
app.config['JWT_COOKIE_SECURE'] = False
app.config['JWT_COOKIE_CSRF_PROTECT'] = False
app.config['JWT_ACCESS_TOKEN_EXPIRES'] = datetime.timedelta(hours=12)
app.config['JWT_SECRET_KEY'] = os.environ.get(
'JWT_SECRET_KEY',
'CHANGE-ME-1ef43ade8807dc37a6588cb8fb9dec4caf6dfd0e00398f9a')
app.config['JWT_SESSION_COOKIE'] = os.environ.get('JWT_SESSION_COOKIE', "True")
if app.config['JWT_SESSION_COOKIE'].lower() in ("f", "false"):
app.config['JWT_SESSION_COOKIE'] = False
else:
app.config['JWT_SESSION_COOKIE'] = True
jwt = JWTManager(app)
if api:
jwt._set_error_handler_callbacks(api)
@api.errorhandler
def restplus_error_handler(error):
return {}
@jwt.expired_token_loader
def handle_expired_token():
resp = make_response()
unset_jwt_cookies(resp)
return resp
return jwt |
Unusually strong El Niño, coupled with record-high temperatures, has had a catastrophic effect on crops and rainfall across southern and eastern Africa
More than 36 million people face hunger across southern and eastern Africa, the United Nations has warned, as swaths of the continent grapple with the worst drought in decades at a time of record high temperatures.
The immediate cause of the drought which has crippled countries from Ethiopia to Zimbabwe is one of the strongest El Niño events ever recorded. It has turned normal weather patterns upside down around the globe, climate scientists say.
But with the world still reeling from record-high temperatures in February, there are fears that the long-term impacts of climate change are also undermining the region’s ability to endure extremes in weather, leaving huge numbers of people vulnerable to hunger and disease.
The worst hit country in the current crisis is Ethiopia, where rains vital to four-fifths of the country’s crops have failed. Unicef has said it is making plans to treat more than 2 million children for malnutrition, and says more than 10 million people will need food aid.
As drought hits Ethiopia again, food aid risks breaking resilience Read more
“Ethiopia has been hit by a double blow, both from a change to the rainy seasons that have been linked to long-term climate change and now from El Niño, which has potentially led the country to one of the worst droughts in decades,” said Gillian Mellsop, Unicef representative to Ethiopia.
The crisis has been damaging even to Ethiopians not at immediate risk of going hungry. It has truncated the education of 3.9 million children and teenagers, who “are unable to access quality education opportunities because of the drought”, she said.
Facebook Twitter Pinterest An boy walks through failed crops and farmland in Afar, Ethiopia. Four-fifths of crops in the country have failed. Photograph: Mulugeta Ayene/AP
Neighbouring countries grappling with hunger after crops failed include Somalia, Sudan and Kenya, and altogether the failed rains have left more than 20 million people “food insecure” in the region.
The drought caught many officials by surprise, because although El Niño was forecast, the weather event normally brings more rain to the region, not less.
“The typical pattern that you would expect with El Niño is very dry weather in southern Africa, but slightly wetter than normal in eastern Africa,” said Dr Linda Hirons, a research scientist at the National Centre for Atmospheric Science.
“So the fact that we have had parts of eastern Africa experiencing drought is unusual … but every single El Niño event manifests itself differently.”
El Niño has passed peak strength but impacts will continue, UN warns Read more
In southern Africa, the drought caused by El Niño was expected, but it has been even more severe than feared, with rains failing two years in a row.
Overall nearly 16 million people in southern Africa are already going hungry, and that number could rise fast. “More than 40 million rural and 9 million poor urban people are at risk due to the impacts of El Niño’s related drought and erratic rainfall,” the World Food Programme has warned.
Zimbabwe, once the region’s bread basket, is one of the worst hit countries. In February, the country’s president Robert Mugabe declared a state of disaster due to the drought, and in less than a month official estimates of people needing food aid has risen from 3 million to 4 million.
Neighbouring countries are also scrambling to find food aid, including South Africa, whose ports are the main entry point for relief across the region.
“We are seeing this as a regional crisis, a cross-country humanitarian crisis,” said Victor Chinyama. “In each country maybe the numbers [of hungry people] are nowhere near as much as Ethiopia, but if you put these numbers together as a whole region, you get a sense of how large a crisis this is.”
El Niño is causing global food crisis, UN warns Read more
More than a third of households are now going hungry, he said. Families that used to eat two meals a day are cutting back to one, and those who could once provide a single meal for their dependents are now entirely reliant on food aid, he said.
Beyond the immediate scramble to get food to those who need it, aid workers in the region say the drought has served as reminder that communities vulnerable to changing weather patterns need longer-term help adapting.
“It’s becoming common knowledge now that we will experience droughts much more,” said Beatrice Mwangi, resilience and livelihoods director, southern Africa region, World Vision, who said she is focused on medium- and long-term responses.
“In the past it was one big drought every 10 years, then it came to one drought every five years, and now the trends are showing that it will be one every three to five years. So we are in a crisis alright, that is true.
“But it’s going to be the new norm. So our responses need to appreciate that … there is climate change, and it’s going to affect the people that we work with, the communities we serve.” |
import { StyleSheet } from 'react-native';
export default StyleSheet.create({
container: {
color: '#fff',
},
gardient: {
flex: 1,
flexDirection: 'column',
justifyContent: 'space-between',
alignItems: 'stretch',
},
touchableIcon: {
paddingLeft: 20,
paddingRight: 20,
paddingTop: 10,
paddingBottom: 10,
},
content: {
flex: 1,
alignItems: 'center',
},
shadow: {
textShadowColor: 'rgba(0, 0, 0, 0.4)',
textShadowOffset: { width: 1, height: 1 },
textShadowRadius: 1
},
shadowLight: {
textShadowColor: 'rgba(0, 0, 0, 0.3)',
textShadowOffset: { width: 1, height: 1 },
textShadowRadius: 1
},
shadowBlur: {
textShadowColor: 'rgba(0, 0, 0, 0.2)',
textShadowOffset: { width: 1, height: 1 },
textShadowRadius: 5
}
});
/**
* The color of the background
* @type {string[]}
*/
export const BackgroundColors: string[] = ['#FEC325', '#E35908']; |
Marshall came back to Magic after discovering Limited and never looked back. He hosts the Limited Resources podcast and does Grand Prix and Pro Tour video commentary.
In the aftermath of the greatest Grand Prix weekend in the history, I decided to stay in Las Vegas for a couple of weeks. So far, I haven't regretted this decision. I usually come down to the desert for a few weeks every summer for various gaming activities, and the fact that there were so many Magic players hanging around made the decision easy.
Many late-night drafts have fired, and I've been immersed in the culture of the Pro Tour player. This is a culture I'm familiar with, as my duties on the coverage team puts me smack in the middle of this crazy group of people quite often. As it turns out, I can relate to them in ways I can't with most other people.
One of the people I've spent the most time with is Pro Tour Hall of Famer Ben Stark. Ben and I have roomed together before, and decided to room together for this trip as well. We have a lot in common. We both have similar lives, we both travel a lot, we have similar professions, and our hobbies line up almost perfectly. We've played basketball a bunch of times, drafted some, and ate a lot. You get the idea. Oh and Ben made the Top 8 of the GP.
Hall of Fame Pro Ben Stark
Ben and I tend to share similar theories when it comes to Limited as well. He's considered one of the best Booster Draft players in the world. He's at the top of my short list, that's for sure.
But Ben doesn't do much in the way of content. He'll occasionally write an article, or do a draft video, but not much else. I decided, while eating lunch with him today and discussing burning Limited topics, that it would be a good idea to pick his brain a little for the column this week.
I've also got some Modern Masters 2015 Edition tech that I have discovered (with Ben's help) that I'll share with you after the interview.
Without further ado, a rare chat with Ben Stark.
What is the most important concept that Limited players should strive to understand?
Not being too fancy. Most games are won or lost by hitting your mana curve, by having removal or a trick to clear that one creature out of the way. Not by having some kind of crazy three-card combo or over-the-top finish or something like that.
What about the difference between cards that affect the board versus cards that don't?
Yeah, that's a good baseline for Limited. Anything that affects the board is almost always going to be good enough for Limited, assuming it's efficient enough. Cards that do not are very rarely good or playable.
What qualities do you look for in a card that doesn't affect the board to bring it to playable status?
If it draws a lot of cards, because that can translate to wins if you have a bunch of other cards that do affect the board. For cards that just damage a player, for example, it has to be a lot of damage. Lava Axe has almost never been a good card in Limited. Even the most aggressive decks usually only play one.
All of these combo-ish cards, these fancy sorceries feel like they are more designed for Constructed, and are rarely playable in Limited.
What is the biggest mistake that you see players make in Booster Draft?
Along the same lines as the other question, it's drafting too many expensive cards. Most games are won by hitting your curve, but people see these cards that cost five, six, seven mana. They do a lot, these cards, so people want to draft them. But if you draft them aggressively, you can end up with too many of them and lose games where you don't hit your land drops or draw too many expensive spells in the early game.
The most important thing is hitting your curve. Drafting the right number of twos, threes, fours, and being able to cast two-drop into three-drop into four-drop most games.
Do you have a guideline for what the right numbers are for this curve? Is it format dependent?
It is format dependent. A good rule of thumb is to have at least four two-drops and about the same number of three-drops. This way you are very likely to have done something by turn three, and somewhat likely to have done something by turn two or three.
Different types of decks want different curves. For example, the more pump spells you have, the more two-drops you want to cast. This way, as long as you have a two-drop creature out pressuring the opponent, they have to block eventually. When they do, you can use your pump spell to get rid of their three-, four-, or even five-mana creature.
Along the same lines, if you have ten two-mana 2/2 creatures, but zero pump spells or removal, all your opponent has to do is cast a single 2/3 and you can never attack them.
In general, the more pump spells you have, the more your deck wants two-drops over five-drops.
How your removal lines up is really important too. If you have a lot of cheap removal, then you want to have more five-drops and higher. If your deck has more expensive removal, you want cheaper, more aggressive creatures. Reach of Shadows goes better with two-drops, where Wild Slash goes better with five-drops.
How does that play out?
Well, you use your cheap removal spell to stay alive against their early threats, which means you don't have to cast anything on turn two. Since you are still alive in the later part of the game, you get to cast five-drops and higher. If your hand is Reach of Shadows and a five-drop, you'll often just get run over by your opponent hitting their curve.
On the other hand, if you have a deck full of two-drops, you'll need a way to clear away that 3/3 or bigger creature so you can keep attacking. The more expensive removal spells do this, which allows you to keep attacking.
To be clear, I wouldn't cut either of these cards from my deck in either case. The difference is in how you prioritize them. If I have a deck with seven two-mana creatures, Reach of Shadows is going to go up a lot in value for me, where Wild Slash would go down a lot in value.
If I have a bunch of late-game rares, or expensive cards that don't affect the board, like Enhanced Awareness, then Wild Slash will go up in value a lot, where Reach of Shadows will go down.
What was your biggest level-up moment for Limited?
That's a tough one. We always played a lot of Limited. I remember this Magic shop I played at when I was in Middle School where we used to do Mirage-Visions-Weatherlight drafts all night. Even before a Constructed PTQ, we'd just do so many drafts.
I know that my first Draft decks probably weren't good, but I got better over time. I'd love to give you an answer for this, but it was a process for me that took place over the long term. I just feel like we just drafted, and drafted, and drafted, and drafted forever. That's just what we did.
I'm teaching a friend of mine to draft. He's still picking up the basics, and he's having a hard time with red in the current Dragons of Tarkir Draft format. He recognizes that it's a good color, but feels like he can't win with it for some reason. Should he allow himself to play fewer red cards for this reason, or should he just push on and play red anyway?
He should probably move past the barrier, but the way to do that is to seek help. He may not be evaluating the cards correctly. A lot of the time, the cards go up and down in value based on the other cards in the format and the synergies available.
For example, I wasn't drafting green well in Khans of Tarkir Draft until I had a long conversation with William Jensen and then I understood what I wasn't prioritizing correctly. That format was all about the ferocious mechanic, so cards like Hooting Mandrills and Alpine Grizzly—which don't look great on the surface—perform better than cards that look better, like Woolly Loxodon. So that's what I was doing wrong. The problem wasn't green, it was me, basically.
That's probably your friend's problem with red here. Just because you aren't good with a color, doesn't mean you abandon the color. You fix why you aren't good with a color. You reach out to your friends who you respect and you talk to them about the color, the commons, the cards; and you try to learn what your mistake is and what you aren't prioritizing correctly.
Are you of the "stay open" or "stick to your plan" draft strategy?
Definitely stay open. I think one of the worst things you can do is have a plan in Booster Draft. You don't know what the people around you will be drafting. I look at knowledge of the format as weapons in your arsenal. You don't know what is going to be available to you in a given draft, so you need to have a lot of weapons available to you. Even if there is one weapon that is more powerful than the rest, it may not be available to you in that draft, so you may be more successful with the second- or third-most powerful weapon.
If you are of the mindset that you always want to draft the most powerful option, what happens when two people to your right are drafting it as well? You'll end up with a train wreck. And then you go 0-3 because you have no deck.
I think you should try to understand everything about the format you can, and not worry about one specific deck, even if you think it's the best.
When preparing for an event, how off the radar are you willing to go with your Draft decks?
It depends on how much time I have, but I do think there is value to going into the fringe strategies. Even if it's only correct to play that deck one in twenty times, that one time may be the Top 8 of a Grand Prix or at the Pro Tour. If you don't understand how to draft it, you'll miss that opportunity.
If I had infinite time, I'd explore all the strategies.
What is your favorite Draft format?
Champions of Kamigawa block. Or the original Modern Masters.
What is your favorite deck to draft in Modern Masters 2015 Edition?
Green-black with tokens and sacrifice effects. And Algae Gharial.
Thanks to Ben for taking the time to chat with me in-between his busy schedule of basketball games, Chipotle, and drafting.
Modern Masters 2015 Edition: The Truth
I have to admit, I planted one of those questions just for the column. It was the last one, and I knew the answer already because Ben and I have drafted this deck and talked about it a fair bit already.
The Truth. That's what we call Algae Gharial in our hotel room. The Truth is one of the best uncommons in the set, and the lynchpin for this strategy.
The main synergy is with Eldrazi Spawn tokens and the fact that you can sacrifice them at any time to pump your Truth. Also the fact that there is no deathtouch in the format means that your shrouded Truth is surviving almost every game.
I've played more Bone Splinters and Tukatongue Thallids than I ever thought I would. You also get the good token makers and access to other colors of removal since you are a base-green deck.
I don't want to go too deep here on the deck, but suffice it to say that first picking The Truth will reap rewards. The Truth will set you free. They can't handle The Truth.
You get it.
Until next week!
@Marshall_LR |
a = input()
a2 = a
a = a.split("/")
a = ''.join(a)
if not a:
print("/")
else:
a2 = a2.split("/")
a1 = []
for i in range(0, len(a2)):
if a2[i]!="/" and a2[i]!="":
a1.append("/")
a1.append(a2[i])
a1 = ''.join(a1)
print(a1) |
/**
* Trim a string and return either <code>some</code> or <code>none</code> if it's empty. The string may be null.
*/
public static Option<String> trimToNone(String a) {
if (a != null) {
final String trimmed = a.trim();
return trimmed.length() > 0 ? some(trimmed) : NONE;
} else {
return none();
}
} |
<filename>chapter_02/example-2_3.py
#-*-coding:utf-8-*-
# date:2020-03-28
# Author: <NAME>
# function: read video
import cv2
if __name__ == "__main__":
#读取 mp4 格式视频
video_capture = cv2.VideoCapture('./video/a.mp4')
while True:
ret, img = video_capture.read()# 获取视频每一帧图像
if ret == True:# 如果 ret 返回值为 True,显示图片
cv2.namedWindow('frame',0)
cv2.imshow("frame", img)
key = cv2.waitKey(30)
if key == 27:#当按键esc,退出显示
break
else:# 视频结尾 ret 返回 False,退出循环
break
video_capture.release()#释放视频
cv2.destroyAllWindows()#关闭显示窗口
|
<reponame>292916808/MolCloze
# !/usr/bin/env python
# -*- coding: utf-8 -*-
# author: chinshin
# datetime: 2020/4/20 15:37
import torch.nn as nn
from .token import TokenEmbedding
from .segment import SegmentEmbedding
class MolBertEmbedding(nn.Module):
def __init__(self, vocab_size, embed_size, dropout=0.1):
super(MolBertEmbedding, self).__init__()
self.token = TokenEmbedding(vocab_size, embed_size)
self.segment = SegmentEmbedding(embed_size=self.token.embedding_dim)
self.dropout = nn.Dropout(p=dropout)
self.embed_size = embed_size
def forward(self, sequence, segment_label):
x = self.token(sequence) + self.segment(segment_label)
return self.dropout(x)
|
S = list(map(str,input().split()))
from decimal import Decimal
A = Decimal(S[0])
B = Decimal(S[1])
C = A * B
print(int(C)) |
/*
* Return whether the directory entry is a man page section.
*/
static int
select_sections(const struct dirent *entry)
{
const char *p = &entry->d_name[3];
if (strncmp(entry->d_name, "man", 3) != 0)
return (0);
while (*p != '\0') {
if (!isalnum(*p++))
return (0);
}
return (1);
} |
#include<bits/stdc++.h>
using namespace std;
const int MAXN = 2e5+10;
#define ll long long int
int row[MAXN];
int vis[MAXN];
ll ans=0;
void dfs(int u,int step,int p){
if(vis[u]||!row[u]){
if(p==u){
ans+=step+1;
}
else{
ans+=step;
}
return;
}
vis[u]=1;dfs(row[u],step+1,p);
}
int main(){
int t;
scanf("%d",&t);
while(t--){
//memset(line,0,sizeof(line));
memset(vis,0,sizeof(vis));
memset(row,0,sizeof(row));
int n,m;
scanf("%d%d",&n,&m);
for(int i=1;i<=m;i++){
int x,y;
scanf("%d%d",&x,&y);row[x]=y;
}
ans=0;
for(int i=1;i<=n;i++){
if(!row[i]||vis[i]) continue;
bool flag=true;
int p=i,q=row[i];
if(p==q) continue;
dfs(i,0,i);
}
printf("%lld\n",ans);
}
} |
Watch Green Lantern's 4 Minutes Of Wonder Con Footage By Josh Tyler Random Article Blend Green Lantern at Wonder Con and, if you’ve been paying attention to this site, then you know the
You can now watch all four minutes of Green Lantern’s Wonder Con footage right here, embedded below or in HD on
If you saw the movie’s
For me though, the really big improvement here is that this footage does more to separate Green Lantern from every other superhero movie, than anything we’ve seen from it before. This makes it clear that Lantern more than just another superhero out to fight crime tale, it’s a massive science fiction s[ace opera, a superhero movie on a galactic scale. That’s something we’ve never seen before, and that Warners has the guts to try this new direction for a genre which until I saw this footage seemed completely out of new ways to go, says a lot. If nothing else, when Ryan Reynolds says the oath, it ought to send chills down your spine.
The effects still aren’t perfect, but they’ll get better as they keep working on the film. Even if they don’t, I think it’s time we all started to get excited about Green Lantern. There’s something completely unique, maybe even special, going on here. Yesterday Warner Bros. showed four new minutes ofat Wonder Con and, if you’ve been paying attention to this site, then you know the reaction to it was spectacularly positive . Maybe that’s why they’ve made it a point to get that footage into the hands of as many people as possible as fast as possible, by immediately releasing it online.You can now watch all four minutes ofWonder Con footage right here, embedded below or in HD on Apple . What you’ll see is something very different, and far grander, than anything you’ve seen from the movie so far. Play now.If you saw the movie’s first trailer from a few weeks ago then you know that a lot has changed. Lantern’s suit, for instance, is now a darker color. The suit is a completely computer generated effect, which accounts for a lot of the problems with it, but that it is computer generated actually makes sense since it's not a real piece of cloth but something created by Lantern’s ring. They’ve also introduced a pretty cool concept for the use of his mask, which will allow Ryan Reynolds’ face to be seen more frequently on screen. I like it.For me though, the really big improvement here is that this footage does more to separatefrom every other superhero movie, than anything we’ve seen from it before. This makes it clear thatmore than just another superhero out to fight crime tale, it’s a massive science fiction s[ace opera, a superhero movie on a galactic scale. That’s something we’ve never seen before, and that Warners has the guts to try this new direction for a genre which until I saw this footage seemed completely out of new ways to go, says a lot. If nothing else, when Ryan Reynolds says the oath, it ought to send chills down your spine.The effects still aren’t perfect, but they’ll get better as they keep working on the film. Even if they don’t, I think it’s time we all started to get excited about. There’s something completely unique, maybe even special, going on here. Blended From Around The Web Facebook
Back to top |
/**
* Creates an {@link AutoScaler} with an add-on subsystem.
*
* @return
*/
private AutoScaler createAutoscalerWithAddon() {
Map<String, String> addons = Maps.of("fakeAddon", FakeAddon.class.getName());
AutoScalerFactory factory = AutoScalerFactory.launch(new AutoScalerFactoryConfig(storageDir, addons));
return factory.createAutoScaler(parseJsonResource(BLUEPRINT_RESOURCE));
} |
<gh_stars>1-10
class Solution {
public:
int findpivot(vector<int>& nums,int l,int r) {
if(l>r){
return nums[0];
}
if(l==r){
return nums[l];
}
int mid=(l+r)/2;
if(mid < r && nums[mid]>nums[mid+1]){
return nums[mid+1];
}
if(mid > l && nums[mid-1] > nums[mid]){
return nums[mid];
}
if(nums[r]>=nums[mid]){
return findpivot(nums,l,mid-1);
}
return findpivot(nums,mid+1,r);
}
int findMin(vector<int>& nums) {
return findpivot(nums,0,nums.size()-1);
}
};
|
import os
import json
import socket
import shutil
from .app import *
def convert_hostnames(file_path):
with open(file_path, 'r+') as json_file:
data = json.loads(json_file.read())
data_accounts = data['accounts']
length, loop, timeout = 0, 0, 0
for name, value in data_accounts.items():
length += len(value)
for name, value in data_accounts.items():
for i in range(len(value)):
account = data_accounts[name][i]
try:
if timeout == 3: break
log_replace('[Y1][{}/{}] Converting hostnames'.format(app_format(loop+1, align='>', width=len(str(length)), chars='0'), length), log_datetime=True, status='[Y1]INFO')
host = ''
host = socket.gethostbyname(account['hostname'])
if not host:
raise socket.gaierror
elif host != account['host']:
log('[G1]{:.<19} [Y1]{:.<20}{:.>36}'.format((account['host'] if account['host'] else '(empty)')+' ', host+' [G1]', ' '+account['hostname']), status='[G1]INFO')
data_accounts[name][i]['host'] = host
timeout = 0
except socket.gaierror:
log('[R1][{}/{}] Converting hostnames timeout'.format(app_format(timeout+1, align='>', width=len(str(length)), chars='0'), app_format('3', align='>', width=len(str(length)), chars='0')), status='[R1]INFO')
timeout = timeout + 1
finally:
loop = loop + 1
json_file.seek(0)
json.dump(data, json_file, indent=2)
json_file.truncate()
return data_accounts
def generate_accounts(data_accounts):
data_authentications = json.loads(open(real_path('/../database/authentications.json')).read())['authentications']
accounts = []
for i in range(len(data_authentications)):
for name in data_accounts:
for x in range(len(data_accounts[name])):
account = data_accounts[name][x]
accounts.append({
'name': name,
'host': account['host'],
'hostname': account['hostname'],
'username': account['username'].replace('{username}', data_authentications[i]['username']),
'password': account['password'].replace('{password}', data_authentications[i]['password'])
})
accounts = [dict(tuples) for tuples in {tuple(dictionaries.items()) for dictionaries in accounts}]
return accounts
def main():
file_names = [
'config/config.json',
'config/payload.txt',
'config/server-name-indication.txt',
'database/accounts.json',
'database/authentications.json',
'database/servers.json'
]
for file_name in file_names:
try:
open(real_path('/../' + file_name))
except FileNotFoundError:
shutil.copyfile(real_path('/default/' + file_name), real_path('/../' + file_name))
finally: pass
main()
|
<gh_stars>0
import { Injectable } from '@nestjs/common';
import { ConfigService } from 'src/config/config.service';
import { CreateCatDto } from './dto/create-cat.dto';
import { UpdateCatDto } from './dto/update-cat.dto';
import { Cat } from './entities/cat.entity';
@Injectable()
export class CatsService {
private message: string;
constructor(configService: ConfigService) {
this.message = configService.get('HELLO_MESSAGE')
}
private readonly cats: Cat[] = [];
create(createCatDto: CreateCatDto) {
var cat = new Cat()
cat.age = createCatDto.age;
cat.name = createCatDto.name;
console.log(this.message)
return this.cats.push(cat);
}
findAllCats(): Cat[] {
return this.cats;
}
findAll() {
return `This action returns all cats`;
}
findOne(id: number) {
return `This action returns a #${id} cat`;
}
update(id: number, updateCatDto: UpdateCatDto) {
return `This action updates a #${id} cat`;
}
remove(id: number) {
return `This action removes a #${id} cat`;
}
}
|
Surface changes on comet 67P/Churyumov-Gerasimenko suggest a more active past
Changes to the surface geology of comet 67P/Churyumov-Gerasimenko are driven by seasonal factors. The changing surface of a comet From 2014 to 2016, the Rosetta spacecraft investigated comet 67P/Churyumov-Gerasimenko as it passed through the inner solar system. El-Maarry et al. compared images of the surface taken before and after the comet's closest approach to the Sun. Numerous geological changes were evident, including cliff collapses, large boulders that moved, and cracks that opened up. These seem to have been triggered by seasonal factors, such as the amount of sunlight falling on each area. Understanding such changes should help elucidate comet formation and evolution. Science, this issue p. 1392 The Rosetta spacecraft spent ~2 years orbiting comet 67P/Churyumov-Gerasimenko, most of it at distances that allowed surface characterization and monitoring at submeter scales. From December 2014 to June 2016, numerous localized changes were observed, which we attribute to cometary-specific weathering, erosion, and transient events driven by exposure to sunlight and other processes. While the localized changes suggest compositional or physical heterogeneity, their scale has not resulted in substantial alterations to the comet’s landscape. This suggests that most of the major landforms were created early in the comet’s current orbital configuration. They may even date from earlier if the comet had a larger volatile inventory, particularly of CO or CO2 ices, or contained amorphous ice, which could have triggered activity at greater distances from the Sun. |
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
#include "cmockery.h"
#include "../execAmi.c"
/* ==================== ExecEagerFree ==================== */
/*
* Tests that ExecEageFree calls the new ExecEagerFreeShareInputScan
* function when the input is a ShareInputScanState
*/
void
test__ExecEagerFree_ExecEagerFreeShareInputScan(void **state)
{
ShareInputScanState *sisc = makeNode(ShareInputScanState);
expect_value(ExecEagerFreeShareInputScan, node, sisc);
will_be_called(ExecEagerFreeShareInputScan);
ExecEagerFree(sisc);
}
int
main(int argc, char* argv[])
{
cmockery_parse_arguments(argc, argv);
const UnitTest tests[] = {
unit_test(test__ExecEagerFree_ExecEagerFreeShareInputScan)
};
MemoryContextInit();
return run_tests(tests);
}
|
An unbiased approach elucidates variation in (S)-(+)-linalool, a context-specific mediator of a tri-trophic interaction in wild tobacco
Significance The monoterpene alcohol linalool, occurring as 2 enantiomers, is made by many organisms and mediates diverse ecological interactions, including the attraction of both herbivores and their predators to plants. The specific effect of linalool differs by enantiomer and across interactions. Here, we used a forward genetics approach, which identified linalool as a candidate indirect defense compound produced by the wild tobacco Nicotiana attenuata against the specialist herbivore Manduca sexta. Linalool emission varied by orders-of-magnitude across 26 N. attenuata accessions, due to geographically interspersed allelic variation of a linalool synthase gene. We identified specific effects of the enantiomer, but also plant genotype and ecological context, which determined linalool’s effect on M. sexta behavior within this plant–insect interaction. Plant volatile organic compounds (VOCs) mediate many interactions, and the function of common VOCs is especially likely to depend on ecological context. We used a genetic mapping population of wild tobacco, Nicotiana attenuata, originating from a cross of 2 natural accessions from Arizona and Utah, separated by the Grand Canyon, to dissect genetic variation controlling VOCs. Herbivory-induced leaf terpenoid emissions varied substantially, while green leaf volatile emissions were similar. In a field experiment, only emissions of linalool, a common VOC, correlated significantly with predation of the herbivore Manduca sexta by native predators. Using quantitative trait locus mapping and genome mining, we identified an (S)-(+)-linalool synthase (NaLIS). Genome resequencing, gene cloning, and activity assays revealed that the presence/absence of a 766-bp sequence in NaLIS underlies the variation of linalool emissions in 26 natural accessions. We manipulated linalool emissions and composition by ectopically expressing linalool synthases for both enantiomers, (S)-(+)- and (R)-(−)-linalool, reported to oppositely affect M. sexta oviposition, in the Arizona and Utah accessions. We used these lines to test ovipositing moths in increasingly complex environments. The enantiomers had opposite effects on oviposition preference, but the magnitude of the effect depended strongly both on plant genetic background, and complexity of the bioassay environment. Our study reveals that the emission of linalool, a common VOC, differs by orders-of-magnitude among geographically interspersed conspecific plants due to allelic variation in a linalool synthase, and that the response of a specialist herbivore to linalool depends on enantiomer, plant genotype, and environmental complexity. |
"""Dummy Class Implementation."""
class Object(object):
"""Dummy Class."""
def __init__(self):
"""Constructor."""
self.kernels_directory = None
self.working_directory = None
pass
|
This article is about the historical person. For other uses, see Lucrezia Borgia (disambiguation)
Lucrezia Borgia ( Italian pronunciation: [luˈkrɛttsja ˈbɔrdʒa]; Valencian: Lucrècia Borja [luˈkrɛsia ˈbɔɾdʒa]; 18 April 1480 – 24 June 1519) was a Spanish-Italian noblewoman of the House of Borgia who was the daughter of Pope Alexander VI and Vannozza dei Cattanei. She reigned as the Governor of Spoleto, a position usually held by cardinals, in her own right.
Her family arranged several marriages for her that advanced their own political position including Giovanni Sforza, Lord of Pesaro and Gradara, Count of Catignola; Alfonso of Aragon, Duke of Bisceglie and Prince of Salerno; and Alfonso I d'Este, Duke of Ferrara. Tradition has it that Alfonso of Aragon was an illegitimate son of the King of Naples and that her brother Cesare Borgia may have had him murdered after his political value waned.
Rumors about her and her family cast Lucrezia as a femme fatale, a role in which she has been portrayed in many artworks, novels and films.
Early life [ edit ]
Lucrezia Borgia was born on 18 April 1480 at Subiaco, near Rome.[2] Her mother was Vannozza dei Cattanei, one of the mistresses of Lucrezia's father, Cardinal Rodrigo de Borgia (later Pope Alexander VI).[3] During her early life, Lucrezia Borgia's education was entrusted to Adriana Orsini de Milan, a close confidant of her father's. Her education would primarily take place in the Piazza Pizzo de Merlo, a building adjacent to her father's residence. Unlike most educated women of her time, for whom convents were the primary source for knowledge, her education came from within the sphere of intellectuals in court and close relatives. Her upbringing would differ from others due to the inclusion of Humanities, which the Catholic Church at the time considered detrimental to the foundations of piety and obedience. This education would be successful in teaching Lucrezia Spanish, Catalan, Italian, French, and some reading ability of Latin and Greek. She would also become proficient in the lute, poetry, and oration. The biggest testament to her intelligence is her capability in administration, as later on in life she would take care of Vatican City correspondence and governance of Ferrara.[citation needed]
Marriages [ edit ]
First marriage: Giovanni Sforza (Lord of Pesaro and Gradara) [ edit ]
Possible portrait of Lucrezia as St. Catherine of Alexandria in a fresco by Pinturicchio , in the Sala dei Santi the Borgia apartments in the Vatican c. 1494.
Giovanni Sforza
On 26 February 1491, a matrimonial arrangement was drawn up between Lucrezia and the Lord of Val D'Ayora in the kingdom of Valencia, Don Cherubino Joan de Centelles, which was annulled less than two months later in favour of a new contract engaging Lucrezia to Don Gaspare Aversa, count of Procida.[4] When Rodrigo became Pope Alexander VI, he sought to be allied with powerful princely families and founding dynasties of Italy. He therefore called off Lucrezia's previous engagements and arranged for her to marry Giovanni Sforza, a member of the House of Sforza who was Lord of Pesaro and titled Count of Catignola.[5] Giovanni was an illegitimate son of Costanzo I Sforza and a Sforza of the second rank. He married Lucrezia on 12 June 1493 in Rome.[3]
Before long, the Borgia family no longer needed the Sforzas, and the presence of Giovanni Sforza in the papal court was superfluous. The Pope needed new, more advantageous political alliances, so he may have covertly ordered the execution of Giovanni: the generally accepted version is that Lucrezia was informed of this by her brother Cesare, and she warned her husband, who fled Rome.[6]
Alexander asked Giovanni's uncle, Cardinal Ascanio Sforza, to persuade Giovanni to agree to an annulment of the marriage.[citation needed] Giovanni refused and accused Lucrezia of paternal incest.[7] The pope asserted that his daughter's marriage had not been consummated and was thus invalid. Giovanni was offered her dowry in return for his cooperation.[8] The Sforza family threatened to withdraw their protection should he refuse. Giovanni finally signed confessions of impotence and documents of annulment before witnesses.
Alleged affair with Perotto [ edit ]
There has been speculation that during the prolonged process of the annulment, Lucrezia consummated a relationship with someone, perhaps Alexander's chamberlain Pedro Calderon, also named Perotto.[9] In any case, families hostile to the Borgias would later accuse her of being pregnant at the time her marriage was annulled for non-consummation. She is known to have retired to the convent of San Sisto in June 1497 to await the outcome of the annulment proceedings, which were finalized in December of the same year. The bodies of Pedro Calderon,[9] and a maid, Pantasilea, were found in the Tiber in February 1498. In March 1498, the Ferrarese ambassador claimed that Lucrezia had given birth, but this was denied by other sources. A child was born, however, in the Borgia household the year before Lucrezia's marriage to Alfonso of Aragon. He was named Giovanni but is known to historians as the "Infans Romanus".
In 1501, two papal bulls were issued concerning the child, Giovanni Borgia. In the first, he was recognized as Cesare's child from an affair before his marriage. The second, contradictory, bull recognized him as the son of Pope Alexander VI. Lucrezia's name is not mentioned in either, and rumors that she was his mother have never been proven. The second bull was kept secret for many years, and Giovanni was assumed to be Cesare's son. This is supported by the fact that in 1502 he became Duke of Camerino, one of Cesare's recent conquests, hence the natural inheritance of the Duke of Romagna's oldest son. Giovanni went to stay with Lucrezia in Ferrara after Alexander's death, where he was accepted as her half-brother.[10]
Second marriage: Alfonso d'Aragon (Duke of Bisceglie and Prince of Salerno) [ edit ]
Duke Alfonso of Aragon
Following her annulment from Sforza, Lucrezia was married to the Neapolitan Alfonso of Aragon, the half-brother of Sancha of Aragon who was the wife of Lucrezia's brother Gioffre Borgia. The marriage was a short one.[3]
They were married in 1498, making Lucrezia the Duchess consort of Bisceglie and Princess consort of Salerno. Lucrezia—not her husband—was appointed governor of Spoleto in 1499; Alfonso fled Rome shortly afterwards but returned at Lucrezia's request, only to be murdered in 1500.[11]
It was widely rumored[12] that Lucrezia's brother Cesare was responsible for Alfonso's death, as he had recently allied himself (through marriage) with France against Naples. Lucrezia and Alfonso had one child, Rodrigo of Aragon, who was born in 1499 and predeceased his mother in August 1512 at the age of 12.[3]
Third marriage: Alfonso d'Este (Duke of Ferrara) [ edit ]
Alfonso d'Este
After the death of Lucrezia's second husband, her father, Pope Alexander VI, arranged a third marriage. She then married Alfonso I d'Este, Duke of Ferrara, in early 1502 in Ferrara. She had eight children during this marriage and was considered a respectable and accomplished Renaissance duchess, effectively rising above her previous reputation and surviving the fall of the Borgias following her father's death.[14]
Neither partner was faithful: beginning in 1503, Lucrezia enjoyed a long relationship with her brother-in-law, Francesco II Gonzaga, Marquess of Mantua.[15][16] Francesco's wife was the cultured intellectual Isabella d'Este, the sister of Alfonso, to whom Lucrezia had made overtures of friendship to no avail. The affair between Francesco and Lucrezia was passionate, more sexual than sentimental as can be attested in the fevered love letters the pair wrote one another.[17] It has been claimed that the affair ended when Francesco contracted syphilis and had to end sexual relations with Lucrezia.[18] This last assertion is problematic as Francesco had contracted syphilis before 1500 as it was known that he passed the disease onto his eldest son Federico Gonzaga who was born in 1500. Francesco did not meet Lucrezia until 1502.[19]
Lucrezia also had a love affair with the poet Pietro Bembo during her third marriage. Their love letters were deemed "The prettiest love letters in the world" by the Romantic poet Lord Byron when he saw them in the Ambrosian Library of Milan on 15 October 1816.[20][21] On the same occasion Byron claimed to have stolen a lock of Lucrezia's hair – "the prettiest and fairest imaginable"[21] – that was also held there on display.[22][23][24]
Lucrezia met the famed French soldier, the Chevalier Bayard while the latter was co-commanding the French allied garrison of Ferrara in 1510. According to his biographer, the Chevalier became a great admirer of Lucrezia's, considering her a "pearl on this Earth".[25]
After a long history of complicated pregnancies and miscarriages, on 14 June 1519 Lucrezia gave birth to her tenth child, named Isabella Maria in honour of Alfonso's sister Isabella d'Este. The child was sickly and – fearing she would die unbaptised – Alfonso ordered her to be baptised straightaway with Eleonora della Mirandola and Count Alexandro Serafino as godparents.
Lucrezia had become very weak during the pregnancy and fell seriously ill after the birth. After seeming to recover for two days, she worsened again and died on 24 June the same year. She was buried in the convent of Corpus Domini.[26]
Appearance [ edit ]
Portrait of a Woman by by Bartolomeo Veneto , traditionally assumed to be Lucrezia Borgia.
Signature of Lucrezia Borgia in a letter to her sister-in-law Isabella Gonzaga, March 1519
She is described as having heavy blonde hair that fell past her knees, a beautiful complexion, hazel eyes that changed color, a full, high bosom, and a natural grace that made her appear to "walk on air".[27] These physical attributes were highly appreciated in Italy during that period. Another description said, "her mouth is rather large, the teeth brilliantly white, her neck is slender and fair, and the bust is admirably proportioned."[28]
One painting, Portrait of a Youth by Dosso Dossi at the National Gallery of Victoria, was identified as a portrait of Lucrezia in November 2008.[29][30][31][32][33] This painting may be the only surviving formal portrait of Lucrezia Borgia; however, doubts have been cast on that attribution.[34] Several other paintings, such as Veneto's fanciful portrait, have also been said to depict her, but none have been accepted by scholars at present.
Rumours [ edit ]
Several rumours have persisted throughout the years, primarily speculating as to the nature of the extravagant parties thrown by the Borgia family. One example is the Banquet of Chestnuts. Many of these concern allegations of incest, poisoning, and murder on her part; however, no historical basis for these rumours has ever been brought forward beyond allegations made by rival parties.
It is rumoured that Lucrezia was in possession of a hollow ring that she used frequently to poison drinks. [35] [36]
An early 20th-century painting by Frank Cadogan Cowper that hangs in the London art gallery, Tate Britain, portrays Lucrezia taking the place of her father, Pope Alexander VI, at an official Vatican meeting. This apparently documents an actual event, although the precise moment depicted (a Franciscan friar kissing Lucrezia's feet) was invented by the artist.[37]
Issue [ edit ]
Lucrezia was mother to seven or eight known children:
Giovanni Borgia, "infans Romanus" ("Child of Rome", c. 1498–1548) had his paternity acknowledged by both Alexander and Cesare in two separate Papal bulls, but it was rumoured that he was the child of Lucrezia and Perotto. The child (identified in later life as Lucrezia's half-brother) was most likely the result of a liaison between Rodrigo Borgia (Pope Alexander VI, Lucrezia's father) and an unknown mistress and was not Lucrezia's child.[39]
At least one biographer (Maria Bellonci) claims that Lucrezia gave birth to three more children, one by Alfonso of Aragon and two by Alfonso d'Este, who did not survive infancy. She is also thought to have had at least four miscarriages.[40]
Biographies [ edit ]
In fiction [ edit ]
Blood And Beauty by Sarah Dunant; ISBN 1-443-40644-9; ISBN 978-1-44340-644-4; Harper Collins Publishers Ltd | July 8, 2013 |
by Sarah Dunant; ISBN 1-443-40644-9; ISBN 978-1-44340-644-4; Harper Collins Publishers Ltd | July 8, 2013 | The Vatican Princess by C.W. Gortner; released Feb. 2016
by C.W. Gortner; released Feb. 2016 In the Name of the Family by Sarah Dunant; ISBN 978-1-84408-746-4; Virago Press 2017
by Sarah Dunant; ISBN 978-1-84408-746-4; Virago Press 2017 The Pope’s Daughter by [[Dario Fo]], translated from Italian by Antony Shugaar; ISBN 978-|-6945-274-2. Translation copyright (c) 2015 by Europa Editions
Treatments and references [ edit ]
Literature and opera [ edit ]
Film and television [ edit ]
See also [ edit ] |
package csvhandler
import (
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestDefaultFormatter(t *testing.T) {
testcases := map[string]struct {
value interface{}
expected string
}{
"string": {
value: "foo",
expected: "foo",
},
"bool": {
value: false,
expected: "false",
},
"int": {
value: 10,
expected: "10",
},
}
for n, tc := range testcases {
t.Run(n, func(t *testing.T) {
res, err := defaultFormatter(tc.value)
require.NoError(t, err)
assert.Equal(t, tc.expected, res)
})
}
}
func TestStringFormatter(t *testing.T) {
testcases := map[string]struct {
value interface{}
format string
expected string
}{
"regular": {
value: "World",
format: "Hello %s !",
expected: "Hello World !",
},
}
for n, tc := range testcases {
t.Run(n, func(t *testing.T) {
res, err := StringFormatter(tc.format)(tc.value)
require.NoError(t, err)
assert.Equal(t, tc.expected, res)
})
}
}
func TestTimeFormatter(t *testing.T) {
value := time.Date(1998, time.July, 12, 22, 30, 0, 0, time.Local)
testcases := map[string]struct {
value interface{}
layout string
expected string
err bool
}{
"time": {
value: value,
layout: time.ANSIC,
expected: "Sun Jul 12 22:30:00 1998",
},
"time pointer": {
value: &value,
layout: time.ANSIC,
expected: "Sun Jul 12 22:30:00 1998",
},
"not time": {
value: false,
err: true,
},
}
for n, tc := range testcases {
t.Run(n, func(t *testing.T) {
res, err := TimeFormatter(tc.layout)(tc.value)
if tc.err {
require.Error(t, err)
} else {
require.NoError(t, err)
assert.Equal(t, tc.expected, res)
}
})
}
}
func TestChainFormatter(t *testing.T) {
testcases := map[string]struct {
formatters []Formatter
value interface{}
expected string
err bool
}{
"regular": {
formatters: []Formatter{
TimeFormatter("_2 Jan"),
StringFormatter("Santa is coming on %s"),
},
value: time.Date(2021, time.December, 25, 8, 0, 0, 0, time.Local),
expected: "Santa is coming on 25 Dec",
},
"with error": {
formatters: []Formatter{
TimeFormatter("_2 Jan"),
StringFormatter("Santa is coming on %s"),
},
value: nil,
err: true,
},
}
for n, tc := range testcases {
t.Run(n, func(t *testing.T) {
res, err := chainFormatter(tc.formatters...)(tc.value)
if tc.err {
require.Error(t, err)
} else {
require.NoError(t, err)
assert.Equal(t, tc.expected, res)
}
})
}
}
|
// MutationGetOld returns the method name for getting the old value of a field.
func (f Field) MutationGetOld() string {
name := "Old" + pascal(f.Name)
if _, ok := mutMethods[name]; ok {
name = "Get" + name
}
return name
} |
// writes bit map to OLED at x/y
void USM_write_bit_map (uint8_t x, uint8_t y)
{
uint8_t i;
oled.setCursor(x, y);
for (i = 0; i < PATTERN_WIDTH-1; i++)
{
oled.ssd1306WriteRamBuf(bit_map[i]);
}
oled.ssd1306WriteRam(bit_map[i]);
} |
// routeForAdminInterface creates static RouteConfig that forwards requested prefixes to Envoy admin interface.
func routeForAdminInterface(prefixes ...string) *http.HttpConnectionManager_RouteConfig {
config := &http.HttpConnectionManager_RouteConfig{
RouteConfig: &envoy_route_v3.RouteConfiguration{
VirtualHosts: []*envoy_route_v3.VirtualHost{{
Name: "backend",
Domains: []string{"*"},
}},
},
}
for _, prefix := range prefixes {
config.RouteConfig.VirtualHosts[0].Routes = append(config.RouteConfig.VirtualHosts[0].Routes,
&envoy_route_v3.Route{
Match: &envoy_route_v3.RouteMatch{
PathSpecifier: &envoy_route_v3.RouteMatch_Prefix{
Prefix: prefix,
},
},
Action: &envoy_route_v3.Route_Route{
Route: &envoy_route_v3.RouteAction{
ClusterSpecifier: &envoy_route_v3.RouteAction_Cluster{
Cluster: "envoy-admin",
},
},
},
},
)
}
return config
} |
def to_rectangle(self):
return self.to_point(), Tile(self.x + 1, self.y + 1, self.z).to_point() |
<gh_stars>0
import React, { useState, useEffect } from 'react';
import { FiLogOut, FiSun, FiMoon, FiArrowUp } from 'react-icons/fi';
import { DateTime } from 'luxon';
import { toast } from 'react-toastify';
import { useBottomScrollListener } from 'react-bottom-scroll-listener';
import { Container, Header, Trades, NoTradesContainer, StyledModal } from './styles';
import AppCard from '../../components/AppCard';
import Button from '../../components/Button';
import TradeCard from '../../components/TradeCard';
import TradeForm from '../../components/TradeForm';
import Logo from '../../components/Logo';
import { useAuth } from '../../contexts/auth';
import RegularLayout from '../../layouts/RegularLayout';
import { useTheme } from '../../contexts/theme';
import tradeService from '../../services/trade.service';
import Trade from '../../models/Trade';
import { Trans, useTranslation } from 'react-i18next';
import Capitalized from '../../components/Capitalized';
interface Month {
date: string,
totalProfit: number,
tradeCount: number;
}
interface Day {
date: string;
totalProfit: number;
tradeCount: number;
}
function sameMonth(iso1: string, iso2: string) {
const first = new Date(iso1);
const second = new Date(iso2);
return first.getUTCMonth() == second.getUTCMonth() && first.getUTCFullYear() == second.getUTCFullYear();
}
function sameDay(iso1: string, iso2: string) {
const first = new Date(iso1);
const second = new Date(iso2);
return first.getUTCDate() == second.getUTCDate();
}
const TradeList: React.FC = () => {
const { t } = useTranslation();
const { signOut } = useAuth();
const { lightOn, toggle } = useTheme();
const [loading, setLoading] = useState<boolean>(false);
const [loadedAllTrades, setLoadedAllTrades] = useState<boolean>(false);
const [showForm, setShowForm] = useState<boolean>(false);
const [months, setMonths] = useState<Month[]>([]);
const [days, setDays] = useState<Day[]>([]);
const [trades, setTrades] = useState<Trade[]>([]);
const [deleteConfirmation, setDeleteConfirmation] = useState<boolean>(false);
const [deletingAttemptId, setDeletingAttemptId] = useState<number>(0);
const [page, setPage] = useState<number>(1);
const perPage = 8;
// Load more on scroll to bottom
useBottomScrollListener(() => {
if (!loading && !loadedAllTrades)
setPage(page + 1);
});
// Load page and add trades to days, or create days that do not yet exist
useEffect(() => {
setLoading(true);
tradeService.get(page, perPage).then(response => {
const { data } = response;
if (!data) {
setLoadedAllTrades(true);
setLoading(false);
return;
};
// Add only not yet existing month and days, and convert their dates to Dates
setMonths([...months, ...data.months.filter((month: Month) => !months.map(m => m.date).includes(month.date))]);
setDays([...days, ...data.days.filter((day: Day) => !days.map(d => d.date).includes(day.date))]);
setTrades([...trades, ...data.trades]);
setLoading(false);
});
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [page]);
async function handleFormSubmit(trade: Trade) {
const response = await tradeService.create(trade);
const date = DateTime.fromISO(trade.date_time).toISODate();
// Add trade
setShowForm(false);
}
function onClickDelete(id: number) {
setDeleteConfirmation(true);
setDeletingAttemptId(id);
}
async function onDeleteConfirmation() {
setDeleteConfirmation(false);
await tradeService.delete(deletingAttemptId);
// const days = tradeDays;
// const day = days.find(d => d.trades.find(t => t.id === deletingAttemptId));
// if (!day) return;
// day.trades = day.trades.filter(t => t.id !== deletingAttemptId);
// day.totalProfit = day.trades.map(t => t.profit).reduce((total, profit) => total += profit);
// // const days = tradeDays.map(day => ({ ...day, trades: day.trades.filter(trade => trade.id !== deletingAttemptId) }))
// setTradeDays(days.filter(day => day.trades.length > 0));
toast.error(t('tradeDeleted'));
}
return (
<RegularLayout>
<Container>
<AppCard>
<Header>
{lightOn ?
<FiMoon onClick={() => toggle()} />
:
<FiSun onClick={() => toggle()} />
}
<Logo />
<FiLogOut onClick={signOut} />
</Header>
</AppCard>
{showForm ? (
<TradeForm onSubmit={handleFormSubmit} />
) : (
<Button type='button' onClick={() => setShowForm(true)}>{t('newTrade')}</Button>
)}
<Trades>
{
months.length > 0 ? months.map((month, index) => (
<div key={index} className='month'>
<AppCard className='group-card'>
<Capitalized>{DateTime.fromISO(month.date).toLocaleString({ month: 'long', year: 'numeric' })}</Capitalized>
<div>
<span className='trade-count'>{month.tradeCount} {month.tradeCount > 1 ? 'trades' : 'trade'}</span>
{
month.totalProfit > 0 ?
<span className='profit green'>+{t('currencySymbol')}{month.totalProfit}</span>
: month.totalProfit < 0 ?
<span className='profit red'>-{t('currencySymbol')}{Math.abs(month.totalProfit)}</span>
:
<span className='profit'>{t('currencySymbol')}{Math.abs(month.totalProfit)}</span>
}
</div>
</AppCard>
<div className='days'>
{
days.filter(day => sameMonth(day.date, month.date)).map((day, index) => (
<div key={index} className='day'>
<AppCard className='group-card'>
{/* <span>{day.date}</span> */}
<Capitalized>{DateTime.fromISO(day.date).toLocaleString({ weekday: 'long', day: '2-digit' })}</Capitalized>
<div>
<span className='trade-count'>{day.tradeCount} {day.tradeCount > 1 ? 'trades' : 'trade'}</span>
{
day.totalProfit > 0 ?
<span className='profit green'>+{t('currencySymbol')}{day.totalProfit}</span>
: day.totalProfit < 0 ?
<span className='profit red'>-{t('currencySymbol')}{Math.abs(day.totalProfit)}</span>
:
<span className='profit'>{t('currencySymbol')}{Math.abs(day.totalProfit)}</span>
}
</div>
</AppCard>
<div className="trades">
{
trades.filter(trade => sameDay(trade.date_time, day.date)).map((trade) => (
<TradeCard key={trade.id} trade={trade} />
))
}
</div>
</div>
))
}
</div>
</div>
))
: !showForm &&
<NoTradesContainer>
<FiArrowUp />
<Trans i18nKey='noTrades'>
<p> <br /><span className='green'> </span></p>
</Trans>
</NoTradesContainer>
}
</Trades>
<StyledModal
isOpen={deleteConfirmation}
onBackgroundClick={() => setDeleteConfirmation(false)}
onEscapeKeydown={() => setDeleteConfirmation(false)}
>
<h2>{t('deletingTrade')}</h2>
<p>{t('deletingTradeConfirmationQuestion')}</p>
<div className="modal-buttons">
<Button onClick={() => setDeleteConfirmation(false)}>{t('no')}</Button>
<Button className='danger' onClick={onDeleteConfirmation}>{t('yes')}</Button>
</div>
</StyledModal>
</Container>
</RegularLayout>
);
}
export default TradeList; |
/// Add one to the number.
async fn add_one(
&self,
#[graphql(default = 0)] v: ::std::primitive::i32,
) -> ::std::primitive::i32 {
v + 1
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.