content
stringlengths 7
2.61M
|
---|
Tina Fey and Amy Poehler dole out advice, Neil Patrick Harris dances, and more memorable moments from Sunday's telecast.
Sunday night's Emmys telecast was full of surprises: from upset wins to unexpected (and sometimes bizarre) dance numbers. The show also featured memorable tributes to late stars like Cory Monteith and James Gandolfini.
But by Monday morning, some of the show's most humorous moments were already circulating online as GIFs.
Tina Fey and Amy Poehler's twerk-heavy advice to host Neil Patrick Harris, delivered while wearing 3D glasses and eating popcorn.
Harris' mid-show dance number (not to be confused with the strange choreography segment later).
The TV-show-inspired routines to present the best choreography nominees surprisingly still hadn't generated many GIFs as of Monday afternoon (perhaps viewers were too traumatized). But here's one of the Breaking Bad meth dancers.
Merritt Wever's abbreviated acceptance speech, in which the Nurse Jackie star simply said, "Thank you so much. I gotta go. Bye."
… and gets annoyed with the cameraman. |
<gh_stars>0
import { Module } from '@nestjs/common'
import { PatientSchema } from '../../../data/schemas/patient.schema'
import { MongooseModule } from '@nestjs/mongoose'
import { PatientsService } from './patients.service'
import { PatientsController } from './patients.controller'
import { MessagesQueueModule } from '../../message-queue/messages-queue.module'
@Module({
imports: [
MongooseModule.forFeatureAsync([
{
name: 'patients',
useFactory: () => PatientSchema
}
]),
MessagesQueueModule
],
controllers: [PatientsController],
providers: [PatientsService]
})
export class PatientsModule {}
|
<filename>src/test/java/io/antmedia/test/db/CameraStoreTest.java
package io.antmedia.test.db;
import static org.junit.Assert.fail;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import io.antmedia.ipcamera.utils.CameraStore;
public class CameraStoreTest {
@Before
public void before() {
deleteMapDBFile();
}
@After
public void after() {
deleteMapDBFile();
}
public void deleteMapDBFile() {
File f = new File(CameraStore.CAMERA_STORAGE_FILE);
if (f.exists()) {
try {
Files.delete(f.toPath());
} catch (IOException e) {
e.printStackTrace();
fail(e.getMessage());
}
}
}
public void testDbOperations() {
}
@Test
public void testDeleteCameraBug() {
// These tests are avoided because, there is no seperated camera store
// and camera db anymore, they are also saved in same db
/*
* CameraStore cameraStore = new CameraStore();
*
* Camera[] cameraList = cameraStore.getCameraList();
* assertNotNull(cameraList);
*
* assertEquals(0, cameraList.length);
*
* boolean deleteCamera = cameraStore.deleteCamera("1212");
* assertFalse(deleteCamera);
*
* String ipAddr = "123.334.344.33"; boolean addCamera =
* cameraStore.addCamera("name", ipAddr, "username", "password",
* "rtspUrl"); assertTrue(addCamera);
*
* cameraList = cameraStore.getCameraList(); assertEquals(1,
* cameraList.length);
*
* deleteCamera = cameraStore.deleteCamera(ipAddr);
* assertTrue(deleteCamera);
*
* cameraList = cameraStore.getCameraList(); assertEquals(0,
* cameraList.length);
*
*/
}
}
|
Microsomal oxidation of tribromoethylene and reactions of tribromoethylene oxide. Halogenated olefins are of interest because of their widespread use in industry and their potential toxicity to humans. Epoxides are among the enzymatic oxidation products and have been studied in regard to their toxicity. Most of the attention has been given to chlorinated epoxides, and we have previously studied the reactions of the mono-, di-, tri-, and tetrachloroethylene oxides. To further test some hypotheses concerning the reactivity of these compounds, we prepared tribromoethylene (TBE) oxide and compared it to trichloroethylene (TCE) oxide and other chlorinated epoxides. TBE oxide reacted with HO about 3 times faster than did TCE oxide. Several hydrolysis products of TBE oxide were the same as formed from TCE oxide, i.e., glyoxylic acid, CO, and HCOH. BrCHCOH was formed from TBE oxide; the yield was higher than for ClCHCOH formed in the hydrolysis of TCE oxide. The yield of tribromoacetaldehyde was < 0.4% in aqueous buffer (pH 7.4). In rat liver microsomal incubations containing TBE and NADPH, BrCHCOH was a major product, and tribromoacetaldehyde was a minor product. These results are consistent with schemes previously developed for halogenated epoxides, with migration of bromine being more favorable than for chlorine. Reaction of TBE oxide with lysine yielded relatively more N-dihaloacetyllysine and less N-formyllysine than in the case of TCE oxide. This same pattern was observed in the products of the reaction of TBE oxide with the lysine residues in bovine serum albumin. We conclude that the proposed scheme of hydrolysis of halogenated epoxides follows the expected halide order and that this can be used to rationalize patterns of hydrolysis and reactivity of other halogenated epoxides. |
import { expect } from 'chai';
import 'mocha';
import { isAtStart, isAtEnd, moveToNextElement, moveToPrevElement } from '../src/internal';
import { prepareFakeDom } from './testutils';
const html1 = `<html>
\t<body data-gr-c-s-loaded="true">
\t\t<div id="calc" class="editor">
\t\t\t<div class="vertical-group represent-node" data-node_represented="324292001770075100">
\t\t\t\t<div class="row">
\t\t\t\t\t<input class="fixed title" style="width: 120.875px;">
\t\t\t\t\t<input class="editable title" placeholder="<no name>" required="" style="width: 151.688px;">
\t\t\t\t</div>
\t\t\t\t<div class="row"></div>
\t\t\t\t<div class="row">
\t\t\t\t\t<input class="fixed strong" style="width: 39.8375px;">
\t\t\t\t</div>
\t\t\t\t<div class="row">
\t\t\t\t\t<div class="tab"></div>
\t\t\t\t\t<div class="vertical-collection represent-collection"data-relation_represented="inputs">
\t\t\t\t\t\t<div class="row">
\t\t\t\t\t\t\t<div class="horizontal-group represent-node" data-node_represented="1848360241685547698">
\t\t\t\t\t\t\t\t<input class="editable" placeholder="<no name>" required="" style="width: 10px;">
\t\t\t\t\t\t\t\t<input class="fixed keyword" style="width: 40.225px;">
\t\t\t\t\t\t\t\t<input class="fixed type represent-node" data-node_represented="1848360241685547702" style="width: 45.2875px;">
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t</div>
\t\t\t\t\t\t<div class="row">
\t\t\t\t\t\t\t<div class="horizontal-group represent-node" data-node_represented="1848360241685575196">
\t\t\t\t\t\t\t\t<input class="editable" placeholder="<no name>" required="" style="width: 26.6px;" value="sdsd">
\t\t\t\t\t\t\t\t<input class="fixed keyword" style="width: 40.225px;">
\t\t\t\t\t\t\t\t<input class="fixed type represent-node" data-node_represented="1848360241685575206" style="width: 45.2875px;">
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t</div>
\t\t\t\t\t\t<div class="row">
\t\t\t\t\t\t\t<div class="horizontal-group represent-node" data-node_represented="1848360241685547705">
\t\t\t\t\t\t\t\t<input class="editable" placeholder="<no name>" required="" style="width: 10px;">
\t\t\t\t\t\t\t\t<input class="fixed keyword" style="width: 40.225px;">
\t\t\t\t\t\t\t\t<input class="fixed type represent-node" data-node_represented="1848360241685547711" style="width: 34.0125px;">
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t</div>
\t\t\t\t\t</div>
\t\t\t\t</div>
\t\t\t</div>
\t\t</div>
\t</body>
</html>`;
describe('Navigation', () => {
it('should support moveToNextElement - not at end', () => {
const doc = prepareFakeDom(html1);
const editableName_a = doc.querySelector(
'div[data-node_represented="1848360241685547698"] .editable',
) as HTMLElement;
const keyword_a = doc.querySelector('div[data-node_represented="1848360241685547698"] .keyword') as HTMLElement;
const type_a = doc.querySelector('div[data-node_represented="1848360241685547698"] .fixed.type') as HTMLElement;
// @ts-ignore
editableName_a.focus();
expect(doc.activeElement).to.equals(editableName_a);
expect(moveToNextElement(editableName_a)).to.equals(true);
expect(doc.activeElement).to.equals(keyword_a);
expect(moveToNextElement(keyword_a)).to.equals(true);
expect(doc.activeElement).to.equals(type_a);
const editableName_b = doc.querySelector(
'div[data-node_represented="1848360241685575196"] .editable',
) as HTMLElement;
const keyword_b = doc.querySelector('div[data-node_represented="1848360241685575196"] .keyword') as HTMLElement;
const type_b = doc.querySelector('div[data-node_represented="1848360241685575196"] .fixed.type') as HTMLElement;
expect(moveToNextElement(type_a)).to.equals(true);
expect(doc.activeElement).to.equals(editableName_b);
expect(moveToNextElement(editableName_b)).to.equals(true);
expect(doc.activeElement).to.equals(keyword_b);
expect(moveToNextElement(keyword_b)).to.equals(true);
expect(doc.activeElement).to.equals(type_b);
});
it('should support moveToNextElement - through divs with no inputs', () => {
const doc = prepareFakeDom(html1);
const calculationsLabel = doc.querySelector('div[data-node_represented="324292001770075100"] .fixed');
const editableName_a = doc.querySelector('div[data-node_represented="1848360241685547698"] .editable');
// @ts-ignore
calculationsLabel.focus();
expect(doc.activeElement).to.equals(calculationsLabel);
expect(moveToNextElement(doc.activeElement as HTMLElement)).to.equals(true);
expect(moveToNextElement(doc.activeElement as HTMLElement)).to.equals(true);
expect(moveToNextElement(doc.activeElement as HTMLElement)).to.equals(true);
expect(doc.activeElement).to.equals(editableName_a);
});
it('should support moveToNextElement - at end', () => {
const doc = prepareFakeDom(html1);
const type_c: any = doc.querySelector('div[data-node_represented="1848360241685547705"] .fixed.type');
type_c.focus();
expect(doc.activeElement).to.equals(type_c);
expect(moveToNextElement(type_c)).to.equals(false);
expect(doc.activeElement).to.equals(type_c);
});
it('should support moveToPrevElement - not at end', () => {
const doc = prepareFakeDom(html1);
const editableName_a = doc.querySelector(
'div[data-node_represented="1848360241685547698"] .editable',
) as HTMLElement;
const keyword_a = doc.querySelector('div[data-node_represented="1848360241685547698"] .keyword') as HTMLElement;
const type_a = doc.querySelector('div[data-node_represented="1848360241685547698"] .fixed.type') as HTMLElement;
const editableName_b = doc.querySelector(
'div[data-node_represented="1848360241685575196"] .editable',
) as HTMLElement;
const keyword_b = doc.querySelector('div[data-node_represented="1848360241685575196"] .keyword') as HTMLElement;
const type_b = doc.querySelector('div[data-node_represented="1848360241685575196"] .fixed.type') as HTMLElement;
// @ts-ignore
type_b.focus();
expect(doc.activeElement as HTMLElement).to.equals(type_b);
expect(moveToPrevElement(type_b)).to.equals(true);
expect(doc.activeElement as HTMLElement).to.equals(keyword_b);
expect(moveToPrevElement(keyword_b)).to.equals(true);
expect(doc.activeElement as HTMLElement).to.equals(editableName_b);
expect(moveToPrevElement(editableName_b)).to.equals(true);
expect(doc.activeElement as HTMLElement).to.equals(type_a);
expect(moveToPrevElement(type_a)).to.equals(true);
expect(doc.activeElement as HTMLElement).to.equals(keyword_a);
expect(moveToPrevElement(keyword_a)).to.equals(true);
expect(doc.activeElement as HTMLElement).to.equals(editableName_a);
});
it('should support moveToPrevElement - at end', () => {
const doc = prepareFakeDom(html1);
const calculationsLabel: any = doc.querySelector('div[data-node_represented="324292001770075100"] .fixed');
calculationsLabel.focus();
expect(doc.activeElement).to.equals(calculationsLabel);
expect(moveToPrevElement(calculationsLabel)).to.equals(false);
expect(doc.activeElement).to.equals(calculationsLabel);
});
it('should support moveToPrevElement - through divs with no inputs', () => {
const doc = prepareFakeDom(html1);
const calculationsLabel = doc.querySelector('div[data-node_represented="324292001770075100"] .fixed');
const editableName_a = doc.querySelector('div[data-node_represented="1848360241685547698"] .editable');
// @ts-ignore
editableName_a.focus();
expect(doc.activeElement).to.equals(editableName_a);
expect(moveToPrevElement(doc.activeElement as HTMLElement)).to.equals(true);
expect(moveToPrevElement(doc.activeElement as HTMLElement)).to.equals(true);
expect(moveToPrevElement(doc.activeElement as HTMLElement)).to.equals(true);
expect(doc.activeElement).to.equals(calculationsLabel);
});
it('should support isAtStart - positive case', () => {
const doc = prepareFakeDom(html1);
const editableName_b = doc.querySelector(
'div[data-node_represented="1848360241685575196"] .editable',
) as HTMLInputElement;
// @ts-ignore
expect(editableName_b.value).to.equals('sdsd');
// @ts-ignore
editableName_b.focus();
// @ts-ignore
editableName_b.setSelectionRange(0, 0);
expect(isAtStart(editableName_b)).to.equals(true);
});
it('should support isAtStart - negative case', () => {
const doc = prepareFakeDom(html1);
const editableName_b = doc.querySelector(
'div[data-node_represented="1848360241685575196"] .editable',
) as HTMLInputElement;
// @ts-ignore
expect(editableName_b.value).to.equals('sdsd');
// @ts-ignore
editableName_b.focus();
// @ts-ignore
editableName_b.setSelectionRange(1, 1);
expect(isAtStart(editableName_b)).to.equals(false);
// @ts-ignore
editableName_b.setSelectionRange(2, 2);
expect(isAtStart(editableName_b)).to.equals(false);
// @ts-ignore
editableName_b.setSelectionRange(3, 3);
expect(isAtStart(editableName_b)).to.equals(false);
// @ts-ignore
editableName_b.setSelectionRange(4, 4);
expect(isAtStart(editableName_b)).to.equals(false);
});
it('should support isAtEnd - positive case', () => {
const doc = prepareFakeDom(html1);
const editableName_b: any = doc.querySelector('div[data-node_represented="1848360241685575196"] .editable');
expect(editableName_b.value).to.equals('sdsd');
editableName_b.focus();
editableName_b.setSelectionRange(0, 0);
expect(isAtEnd(editableName_b)).to.equals(false);
editableName_b.setSelectionRange(1, 1);
expect(isAtEnd(editableName_b)).to.equals(false);
editableName_b.setSelectionRange(2, 2);
expect(isAtEnd(editableName_b)).to.equals(false);
editableName_b.setSelectionRange(3, 3);
expect(isAtEnd(editableName_b)).to.equals(false);
});
it('should support isAtEnd - negative case', () => {
const doc = prepareFakeDom(html1);
const editableName_b: any = doc.querySelector('div[data-node_represented="1848360241685575196"] .editable');
expect(editableName_b.value).to.equals('sdsd');
editableName_b.focus();
editableName_b.setSelectionRange(4, 4);
expect(isAtEnd(editableName_b)).to.equals(true);
});
});
|
WHAT HAS COVID-19 PAVED THE WAY FOR SOCIAL WORK PRACTICE TEACHING? The future is undoubtedly unpredictable which is vividly proved by the 2020 pandemic. Educators primarily focused for the well-being of the students in this time of crisis, panic and ambivalence. In present milieu, social work practice teaching has been made online. This is high time which calls for the retrofitting of the previous discussions where the emphasis should now be laid upon a better quality of teaching, curriculum restructuring, and capacity building of clinical practice educators. Yet, there are multitudes of underlying predicaments, i.e. e-teaching versus e-learning, synchronous versus asynchronous modalities, and educator versus youtuber, which need to be analyzed and evaluated before stepping in and getting lost in the new era. |
2017 — a year to remember, or would we be better off if it was a year to forget?
The geopolitical world is like a tsunami zone episode. We have an unusual president calling the shots. It was a banner year for natural disasters — hurricanes, etc. I’m not sure if fires qualify. I suspect arson.
The widespread exposure of sexual misbehavior — I think the taxpayer should be able to deduct the payouts. The Mexico wall is more like yellow crime tape with keep out signs pointed north. Terrorism is still rampant. I don’t recall a nation this fractured up in my lifetime. Democrats and Republicans might as well arm themselves and head for the OK Corral. Race and religion, state and church, the Mideast, North Korea, drugs, opiate crisis, homeless.
There may come a time when people say, “I miss the good ol’ days back in 2017 when it was all peace and love.” I guess it wasn’t all bad. Stock market, A-plus; Charles Manson got out of prison; and Trump said, “We can say Merry Christmas again.” Isn’t that nice of him? |
<filename>lib/commonAPI/coreapi/ext/platform/android/src/com/rho/nativetabbar/NativeTabbar.java<gh_stars>100-1000
package com.rho.nativetabbar;
import java.util.Map;
import com.rhomobile.rhodes.api.IMethodResult;
import com.rhomobile.rhodes.api.MethodResult;
public class NativeTabbar extends NativeTabbarBase implements INativeTabbar {
public NativeTabbar(String id) {
super(id);
}
} |
<reponame>avalloneandrea/neat-app
import { Item } from './item';
export interface Paycheck {
grossIncome?: number;
taxes?: Array<Item>;
credits?: Array<Item>;
netIncome?: number;
}
|
Various apparatuses and methods for providing light for basketball goals and courts are known. It is known to attach lights to basketball goals and their support structures to provide light in low or less-than-optimal lighting conditions. Some systems are adapted for use with an adjustable basketball goal where the height of the goal may be raised or lowered. Many systems are difficult to use and do not allow easy accessibility to the lamp for maintenance or for adjusting the lighting angle. Other systems can require strenuous exertion by one or more people to install and/or erect. Still other systems place the lamp behind or above the backboard potentially interfering with vision. Such systems typically require a ladder or disassembly of the basketball goal to access the light for mounting or to change a bulb. An improved apparatus and method for raising and lowering a light for a basketball goal is desired. Certain features of the present invention address these and other needs and provide other advantages. |
# -*- coding: utf-8 -*-
# Nicolas, 2021-03-05
from __future__ import absolute_import, print_function, unicode_literals
import random
import numpy as np
import sys
from itertools import chain
import pygame
from pySpriteWorld.gameclass import Game,check_init_game_done
from pySpriteWorld.spritebuilder import SpriteBuilder
from pySpriteWorld.players import Player
from pySpriteWorld.sprite import MovingSprite
from pySpriteWorld.ontology import Ontology
import pySpriteWorld.glo
from search.grid2D import ProblemeGrid2D
from search import probleme
# ---- ---- ---- ---- ---- ----
# ---- Misc ----
# ---- ---- ---- ---- ---- ----
# ---- ---- ---- ---- ---- ----
# ---- Main ----
# ---- ---- ---- ---- ---- ----
game = Game()
def init(_boardname=None):
global player,game
name = _boardname if _boardname is not None else 'demoMap'
game = Game('Cartes/' + name + '.json', SpriteBuilder)
game.O = Ontology(True, 'SpriteSheet-32x32/tiny_spritesheet_ontology.csv')
game.populate_sprite_names(game.O)
game.fps = 5 # frames per second
game.mainiteration()
player = game.player
def main():
#for arg in sys.argv:
iterations = 100 # default
if len(sys.argv) == 2:
iterations = int(sys.argv[1])
print ("Iterations: ")
print (iterations)
init()
#-------------------------------
# Initialisation
#-------------------------------
nbLignes = game.spriteBuilder.rowsize
nbCols = game.spriteBuilder.colsize
print("lignes", nbLignes)
print("colonnes", nbCols)
players = [o for o in game.layers['joueur']]
nbPlayers = len(players)
score = [0]*nbPlayers
# on localise tous les états initiaux (loc du joueur)
# positions initiales des joueurs
initStates = [o.get_rowcol() for o in game.layers['joueur']]
print ("Init states:", initStates)
# on localise tous les objets ramassables
# sur le layer ramassable
goalStates = [o.get_rowcol() for o in game.layers['ramassable']]
print ("Goal states:", goalStates)
# on localise tous les murs
# sur le layer obstacle
wallStates = [w.get_rowcol() for w in game.layers['obstacle']]
print ("Wall states:", wallStates)
def legal_position(row,col):
# une position legale est dans la carte et pas sur un mur
return ((row,col) not in wallStates) and row>=0 and row<nbLignes and col>=0 and col<nbCols
#-------------------------------
# Attributaion aleatoire des fioles
#-------------------------------
objectifs = goalStates
random.shuffle(objectifs)
print("Objectif joueur 0", objectifs[0])
print("Objectif joueur 1", objectifs[1])
#-------------------------------
# Carte demo
# 2 joueurs
# Joueur 0: A*
# Joueur 1: random walker
#-------------------------------
#-------------------------------
# calcul A* pour le joueur 0
#-------------------------------
g =np.ones((nbLignes,nbCols),dtype=bool) # par defaut la matrice comprend des True
for w in wallStates: # putting False for walls
g[w]=False
p = ProblemeGrid2D(initStates[0],objectifs[0],g,'manhattan')
path = probleme.greedy_best_first(p)
print ("Chemin trouvé:", path)
#-------------------------------
# Boucle principale de déplacements
#-------------------------------
posPlayers = initStates
for i in range(iterations):
# on fait bouger chaque joueur séquentiellement
# Joeur 0: suit son chemin trouve avec A*
row,col = path[i]
posPlayers[0]=(row,col)
players[0].set_rowcol(row,col)
print ("pos 0:", row,col)
if (row,col) == objectifs[0]:
score[0]+=1
print("le joueur 0 a atteint son but!")
break
# Joueur 1: fait du random walk
row,col = posPlayers[1]
while True: # tant que pas legal on retire une position
x_inc,y_inc = random.choice([(0,1),(0,-1),(1,0),(-1,0)])
next_row = row+x_inc
next_col = col+y_inc
if legal_position(next_row,next_col):
break
players[1].set_rowcol(next_row,next_col)
print ("pos 1:", next_row,next_col)
col=next_col
row=next_row
posPlayers[1]=(row,col)
if (row,col) == objectifs[1]:
score[1]+=1
print("le joueur 1 a atteint son but!")
break
# on passe a l'iteration suivante du jeu
game.mainiteration()
print ("scores:", score)
pygame.quit()
#-------------------------------
if __name__ == '__main__':
main()
|
// +build !ignore_autogenerated
/*
Copyright 2018 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by main. DO NOT EDIT.
package v1alpha1
import (
runtime "k8s.io/apimachinery/pkg/runtime"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *APIResource) DeepCopyInto(out *APIResource) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIResource.
func (in *APIResource) DeepCopy() *APIResource {
if in == nil {
return nil
}
out := new(APIResource)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterCondition) DeepCopyInto(out *ClusterCondition) {
*out = *in
in.LastProbeTime.DeepCopyInto(&out.LastProbeTime)
in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterCondition.
func (in *ClusterCondition) DeepCopy() *ClusterCondition {
if in == nil {
return nil
}
out := new(ClusterCondition)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterHealthCheckConfig) DeepCopyInto(out *ClusterHealthCheckConfig) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterHealthCheckConfig.
func (in *ClusterHealthCheckConfig) DeepCopy() *ClusterHealthCheckConfig {
if in == nil {
return nil
}
out := new(ClusterHealthCheckConfig)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterObjectVersion) DeepCopyInto(out *ClusterObjectVersion) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterObjectVersion.
func (in *ClusterObjectVersion) DeepCopy() *ClusterObjectVersion {
if in == nil {
return nil
}
out := new(ClusterObjectVersion)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterPropagatedVersion) DeepCopyInto(out *ClusterPropagatedVersion) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
out.Spec = in.Spec
in.Status.DeepCopyInto(&out.Status)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterPropagatedVersion.
func (in *ClusterPropagatedVersion) DeepCopy() *ClusterPropagatedVersion {
if in == nil {
return nil
}
out := new(ClusterPropagatedVersion)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ClusterPropagatedVersion) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterPropagatedVersionList) DeepCopyInto(out *ClusterPropagatedVersionList) {
*out = *in
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]ClusterPropagatedVersion, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterPropagatedVersionList.
func (in *ClusterPropagatedVersionList) DeepCopy() *ClusterPropagatedVersionList {
if in == nil {
return nil
}
out := new(ClusterPropagatedVersionList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ClusterPropagatedVersionList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterPropagatedVersionSpec) DeepCopyInto(out *ClusterPropagatedVersionSpec) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterPropagatedVersionSpec.
func (in *ClusterPropagatedVersionSpec) DeepCopy() *ClusterPropagatedVersionSpec {
if in == nil {
return nil
}
out := new(ClusterPropagatedVersionSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DurationConfig) DeepCopyInto(out *DurationConfig) {
*out = *in
out.AvailableDelay = in.AvailableDelay
out.UnavailableDelay = in.UnavailableDelay
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DurationConfig.
func (in *DurationConfig) DeepCopy() *DurationConfig {
if in == nil {
return nil
}
out := new(DurationConfig)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *FeatureGatesConfig) DeepCopyInto(out *FeatureGatesConfig) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeatureGatesConfig.
func (in *FeatureGatesConfig) DeepCopy() *FeatureGatesConfig {
if in == nil {
return nil
}
out := new(FeatureGatesConfig)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *FederatedServiceClusterStatus) DeepCopyInto(out *FederatedServiceClusterStatus) {
*out = *in
in.Status.DeepCopyInto(&out.Status)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FederatedServiceClusterStatus.
func (in *FederatedServiceClusterStatus) DeepCopy() *FederatedServiceClusterStatus {
if in == nil {
return nil
}
out := new(FederatedServiceClusterStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *FederatedServiceStatus) DeepCopyInto(out *FederatedServiceStatus) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
if in.ClusterStatus != nil {
in, out := &in.ClusterStatus, &out.ClusterStatus
*out = make([]FederatedServiceClusterStatus, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FederatedServiceStatus.
func (in *FederatedServiceStatus) DeepCopy() *FederatedServiceStatus {
if in == nil {
return nil
}
out := new(FederatedServiceStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *FederatedServiceStatus) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *FederatedServiceStatusList) DeepCopyInto(out *FederatedServiceStatusList) {
*out = *in
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]FederatedServiceStatus, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FederatedServiceStatusList.
func (in *FederatedServiceStatusList) DeepCopy() *FederatedServiceStatusList {
if in == nil {
return nil
}
out := new(FederatedServiceStatusList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *FederatedServiceStatusList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *FederatedTypeConfig) DeepCopyInto(out *FederatedTypeConfig) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
out.Status = in.Status
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FederatedTypeConfig.
func (in *FederatedTypeConfig) DeepCopy() *FederatedTypeConfig {
if in == nil {
return nil
}
out := new(FederatedTypeConfig)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *FederatedTypeConfig) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *FederatedTypeConfigList) DeepCopyInto(out *FederatedTypeConfigList) {
*out = *in
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]FederatedTypeConfig, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FederatedTypeConfigList.
func (in *FederatedTypeConfigList) DeepCopy() *FederatedTypeConfigList {
if in == nil {
return nil
}
out := new(FederatedTypeConfigList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *FederatedTypeConfigList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *FederatedTypeConfigSpec) DeepCopyInto(out *FederatedTypeConfigSpec) {
*out = *in
out.Target = in.Target
out.FederatedType = in.FederatedType
if in.Status != nil {
in, out := &in.Status, &out.Status
*out = new(APIResource)
**out = **in
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FederatedTypeConfigSpec.
func (in *FederatedTypeConfigSpec) DeepCopy() *FederatedTypeConfigSpec {
if in == nil {
return nil
}
out := new(FederatedTypeConfigSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *FederatedTypeConfigStatus) DeepCopyInto(out *FederatedTypeConfigStatus) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FederatedTypeConfigStatus.
func (in *FederatedTypeConfigStatus) DeepCopy() *FederatedTypeConfigStatus {
if in == nil {
return nil
}
out := new(FederatedTypeConfigStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *KubefedCluster) DeepCopyInto(out *KubefedCluster) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
out.Spec = in.Spec
in.Status.DeepCopyInto(&out.Status)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubefedCluster.
func (in *KubefedCluster) DeepCopy() *KubefedCluster {
if in == nil {
return nil
}
out := new(KubefedCluster)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *KubefedCluster) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *KubefedClusterList) DeepCopyInto(out *KubefedClusterList) {
*out = *in
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]KubefedCluster, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubefedClusterList.
func (in *KubefedClusterList) DeepCopy() *KubefedClusterList {
if in == nil {
return nil
}
out := new(KubefedClusterList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *KubefedClusterList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *KubefedClusterSpec) DeepCopyInto(out *KubefedClusterSpec) {
*out = *in
out.SecretRef = in.SecretRef
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubefedClusterSpec.
func (in *KubefedClusterSpec) DeepCopy() *KubefedClusterSpec {
if in == nil {
return nil
}
out := new(KubefedClusterSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *KubefedClusterStatus) DeepCopyInto(out *KubefedClusterStatus) {
*out = *in
if in.Conditions != nil {
in, out := &in.Conditions, &out.Conditions
*out = make([]ClusterCondition, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.Zones != nil {
in, out := &in.Zones, &out.Zones
*out = make([]string, len(*in))
copy(*out, *in)
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubefedClusterStatus.
func (in *KubefedClusterStatus) DeepCopy() *KubefedClusterStatus {
if in == nil {
return nil
}
out := new(KubefedClusterStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *KubefedConfig) DeepCopyInto(out *KubefedConfig) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubefedConfig.
func (in *KubefedConfig) DeepCopy() *KubefedConfig {
if in == nil {
return nil
}
out := new(KubefedConfig)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *KubefedConfig) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *KubefedConfigList) DeepCopyInto(out *KubefedConfigList) {
*out = *in
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]KubefedConfig, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubefedConfigList.
func (in *KubefedConfigList) DeepCopy() *KubefedConfigList {
if in == nil {
return nil
}
out := new(KubefedConfigList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *KubefedConfigList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *KubefedConfigSpec) DeepCopyInto(out *KubefedConfigSpec) {
*out = *in
out.ControllerDuration = in.ControllerDuration
out.LeaderElect = in.LeaderElect
if in.FeatureGates != nil {
in, out := &in.FeatureGates, &out.FeatureGates
*out = make([]FeatureGatesConfig, len(*in))
copy(*out, *in)
}
out.ClusterHealthCheck = in.ClusterHealthCheck
out.SyncController = in.SyncController
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubefedConfigSpec.
func (in *KubefedConfigSpec) DeepCopy() *KubefedConfigSpec {
if in == nil {
return nil
}
out := new(KubefedConfigSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *LeaderElectConfig) DeepCopyInto(out *LeaderElectConfig) {
*out = *in
out.LeaseDuration = in.LeaseDuration
out.RenewDeadline = in.RenewDeadline
out.RetryPeriod = in.RetryPeriod
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LeaderElectConfig.
func (in *LeaderElectConfig) DeepCopy() *LeaderElectConfig {
if in == nil {
return nil
}
out := new(LeaderElectConfig)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *LocalSecretReference) DeepCopyInto(out *LocalSecretReference) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalSecretReference.
func (in *LocalSecretReference) DeepCopy() *LocalSecretReference {
if in == nil {
return nil
}
out := new(LocalSecretReference)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PropagatedVersion) DeepCopyInto(out *PropagatedVersion) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
out.Spec = in.Spec
in.Status.DeepCopyInto(&out.Status)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PropagatedVersion.
func (in *PropagatedVersion) DeepCopy() *PropagatedVersion {
if in == nil {
return nil
}
out := new(PropagatedVersion)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *PropagatedVersion) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PropagatedVersionList) DeepCopyInto(out *PropagatedVersionList) {
*out = *in
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]PropagatedVersion, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PropagatedVersionList.
func (in *PropagatedVersionList) DeepCopy() *PropagatedVersionList {
if in == nil {
return nil
}
out := new(PropagatedVersionList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *PropagatedVersionList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PropagatedVersionSpec) DeepCopyInto(out *PropagatedVersionSpec) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PropagatedVersionSpec.
func (in *PropagatedVersionSpec) DeepCopy() *PropagatedVersionSpec {
if in == nil {
return nil
}
out := new(PropagatedVersionSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PropagatedVersionStatus) DeepCopyInto(out *PropagatedVersionStatus) {
*out = *in
if in.ClusterVersions != nil {
in, out := &in.ClusterVersions, &out.ClusterVersions
*out = make([]ClusterObjectVersion, len(*in))
copy(*out, *in)
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PropagatedVersionStatus.
func (in *PropagatedVersionStatus) DeepCopy() *PropagatedVersionStatus {
if in == nil {
return nil
}
out := new(PropagatedVersionStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *SyncControllerConfig) DeepCopyInto(out *SyncControllerConfig) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SyncControllerConfig.
func (in *SyncControllerConfig) DeepCopy() *SyncControllerConfig {
if in == nil {
return nil
}
out := new(SyncControllerConfig)
in.DeepCopyInto(out)
return out
}
|
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from decimal import Decimal
from bitarray import bitarray
import __builtin__
class cngn_mon_voq(PybindBase):
"""
This class was auto-generated by the PythonClass plugin for PYANG
from YANG module brocade-sysdiag-operational - based on the path /tm-state/cngn-mon-voq. Each member element of
the container is represented as a class variable - with a specific
YANG type.
YANG Description: TM discard voq pkt config
"""
__slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_rest_name', '_extmethods', '__discard_voq_pkt_threshold','__discard_voq_log_interval',)
_yang_name = 'cngn-mon-voq'
_rest_name = 'cngn-mon-voq'
_pybind_generated_by = 'container'
def __init__(self, *args, **kwargs):
path_helper_ = kwargs.pop("path_helper", None)
if path_helper_ is False:
self._path_helper = False
elif path_helper_ is not None and isinstance(path_helper_, xpathhelper.YANGPathHelper):
self._path_helper = path_helper_
elif hasattr(self, "_parent"):
path_helper_ = getattr(self._parent, "_path_helper", False)
self._path_helper = path_helper_
else:
self._path_helper = False
extmethods = kwargs.pop("extmethods", None)
if extmethods is False:
self._extmethods = False
elif extmethods is not None and isinstance(extmethods, dict):
self._extmethods = extmethods
elif hasattr(self, "_parent"):
extmethods = getattr(self._parent, "_extmethods", None)
self._extmethods = extmethods
else:
self._extmethods = False
self.__discard_voq_pkt_threshold = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="discard-voq-pkt-threshold", rest_name="discard-voq-pkt-threshold", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-sysdiag-operational', defining_module='brocade-sysdiag-operational', yang_type='uint32', is_config=False)
self.__discard_voq_log_interval = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="discard-voq-log-interval", rest_name="discard-voq-log-interval", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-sysdiag-operational', defining_module='brocade-sysdiag-operational', yang_type='uint16', is_config=False)
load = kwargs.pop("load", None)
if args:
if len(args) > 1:
raise TypeError("cannot create a YANG container with >1 argument")
all_attr = True
for e in self._pyangbind_elements:
if not hasattr(args[0], e):
all_attr = False
break
if not all_attr:
raise ValueError("Supplied object did not have the correct attributes")
for e in self._pyangbind_elements:
nobj = getattr(args[0], e)
if nobj._changed() is False:
continue
setmethod = getattr(self, "_set_%s" % e)
if load is None:
setmethod(getattr(args[0], e))
else:
setmethod(getattr(args[0], e), load=load)
def _path(self):
if hasattr(self, "_parent"):
return self._parent._path()+[self._yang_name]
else:
return [u'tm-state', u'cngn-mon-voq']
def _rest_path(self):
if hasattr(self, "_parent"):
if self._rest_name:
return self._parent._rest_path()+[self._rest_name]
else:
return self._parent._rest_path()
else:
return [u'tm-state', u'cngn-mon-voq']
def _get_discard_voq_pkt_threshold(self):
"""
Getter method for discard_voq_pkt_threshold, mapped from YANG variable /tm_state/cngn_mon_voq/discard_voq_pkt_threshold (uint32)
YANG Description: Discard VOQ packet threshold
"""
return self.__discard_voq_pkt_threshold
def _set_discard_voq_pkt_threshold(self, v, load=False):
"""
Setter method for discard_voq_pkt_threshold, mapped from YANG variable /tm_state/cngn_mon_voq/discard_voq_pkt_threshold (uint32)
If this variable is read-only (config: false) in the
source YANG file, then _set_discard_voq_pkt_threshold is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_discard_voq_pkt_threshold() directly.
YANG Description: Discard VOQ packet threshold
"""
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="discard-voq-pkt-threshold", rest_name="discard-voq-pkt-threshold", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-sysdiag-operational', defining_module='brocade-sysdiag-operational', yang_type='uint32', is_config=False)
except (TypeError, ValueError):
raise ValueError({
'error-string': """discard_voq_pkt_threshold must be of a type compatible with uint32""",
'defined-type': "uint32",
'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="discard-voq-pkt-threshold", rest_name="discard-voq-pkt-threshold", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-sysdiag-operational', defining_module='brocade-sysdiag-operational', yang_type='uint32', is_config=False)""",
})
self.__discard_voq_pkt_threshold = t
if hasattr(self, '_set'):
self._set()
def _unset_discard_voq_pkt_threshold(self):
self.__discard_voq_pkt_threshold = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="discard-voq-pkt-threshold", rest_name="discard-voq-pkt-threshold", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-sysdiag-operational', defining_module='brocade-sysdiag-operational', yang_type='uint32', is_config=False)
def _get_discard_voq_log_interval(self):
"""
Getter method for discard_voq_log_interval, mapped from YANG variable /tm_state/cngn_mon_voq/discard_voq_log_interval (uint16)
YANG Description: Discard VOQ packet log interval
"""
return self.__discard_voq_log_interval
def _set_discard_voq_log_interval(self, v, load=False):
"""
Setter method for discard_voq_log_interval, mapped from YANG variable /tm_state/cngn_mon_voq/discard_voq_log_interval (uint16)
If this variable is read-only (config: false) in the
source YANG file, then _set_discard_voq_log_interval is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_discard_voq_log_interval() directly.
YANG Description: Discard VOQ packet log interval
"""
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="discard-voq-log-interval", rest_name="discard-voq-log-interval", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-sysdiag-operational', defining_module='brocade-sysdiag-operational', yang_type='uint16', is_config=False)
except (TypeError, ValueError):
raise ValueError({
'error-string': """discard_voq_log_interval must be of a type compatible with uint16""",
'defined-type': "uint16",
'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="discard-voq-log-interval", rest_name="discard-voq-log-interval", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-sysdiag-operational', defining_module='brocade-sysdiag-operational', yang_type='uint16', is_config=False)""",
})
self.__discard_voq_log_interval = t
if hasattr(self, '_set'):
self._set()
def _unset_discard_voq_log_interval(self):
self.__discard_voq_log_interval = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="discard-voq-log-interval", rest_name="discard-voq-log-interval", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-sysdiag-operational', defining_module='brocade-sysdiag-operational', yang_type='uint16', is_config=False)
discard_voq_pkt_threshold = __builtin__.property(_get_discard_voq_pkt_threshold)
discard_voq_log_interval = __builtin__.property(_get_discard_voq_log_interval)
_pyangbind_elements = {'discard_voq_pkt_threshold': discard_voq_pkt_threshold, 'discard_voq_log_interval': discard_voq_log_interval, }
|
1. Field of the Invention
This invention relates generally to the field of retractable pet barrier devices and methods of using retractable pet barrier devices, and more particularly to pet barrier devices wherein a door can be opened with the barrier extending from the device and closed with the barrier retracting, with features to allow a user to easily attach the barrier to and detach the barrier from the door.
2. Description of Related Art
Containing small pets within a home as one greets guests through an open door has been and continues to be a challenge for pet owners. Pets respond to a knock on the door or the ringing of the doorbell with boisterous enthusiasm. This typically results in the pet owner placing a leg in front of the pet and/or opening the door only a small amount. These physical methods of restraint are cumbersome, un-inviting to the guest, stressful for the pet and pet owner alike and generally unsuccessful.
There are several pet barrier devices available and in use today. Most are made of wood or plastic coated metal and are designed for stationary use between an open doorway or hallway. Once they are put in place they are a semi-permanent fixture until they are physically removed. In a busy household this could result in the barrier being positioned and repositioned several times a day. Although certain existing pet barriers may be effective, they are not convenient. Additionally, these conventional barriers are designed to be effective in an open doorway, which makes them impractical to use on an outside entry door.
Therefore, a need exists to provide an improved pet barrier and method for use, for instance, in a doorway used to enter into or exit out of a home, such as an outside doorway. The improved pet barrier and method of use must be attractive for mounting on the inside of a doorway, self contained, easily accessible, convenient to use and effective in providing both a physical and psychological barrier, for instances, for pets. |
/// Modulo
///
/// reduce a DBig to a Big using the appropriate form of the modulus
pub fn modulo(d: &mut DBig) -> Big {
if MODTYPE == ModType::PseudoMersenne {
let mut b = Big::new();
let mut t = d.split(MODBITS);
b.dcopy(&d);
let v = t.pmul(rom::MCONST as isize);
t.add(&b);
t.norm();
let tw = t.w[big::NLEN - 1];
t.w[big::NLEN - 1] &= TMASK;
t.w[0] += rom::MCONST * ((tw >> TBITS) + (v << (big::BASEBITS - TBITS)));
t.norm();
return t;
}
if MODTYPE == ModType::MontgomeryFriendly {
let mut b = Big::new();
for i in 0..big::NLEN {
let x = d.w[i];
let tuple = Big::mul_add(x, rom::MCONST - 1, x, d.w[big::NLEN + i - 1]);
d.w[big::NLEN + i] += tuple.0;
d.w[big::NLEN + i - 1] = tuple.1;
}
b.zero();
for i in 0..big::NLEN {
b.w[i] = d.w[big::NLEN + i];
}
b.norm();
return b;
}
if MODTYPE == ModType::GeneralisedMersenne {
// GoldiLocks Only
let mut b = Big::new();
let t = d.split(MODBITS);
let rm2 = (MODBITS / 2) as usize;
b.dcopy(&d);
b.add(&t);
let mut dd = DBig::new_scopy(&t);
dd.shl(rm2);
let mut tt = dd.split(MODBITS);
let lo = Big::new_dcopy(&dd);
b.add(&tt);
b.add(&lo);
b.norm();
tt.shl(rm2);
b.add(&tt);
let carry = b.w[big::NLEN - 1] >> TBITS;
b.w[big::NLEN - 1] &= TMASK;
b.w[0] += carry;
b.w[(224 / big::BASEBITS) as usize] += carry << (224 % big::BASEBITS);
b.norm();
return b;
}
if MODTYPE == ModType::NotSpecial {
let m = Big::new_ints(&rom::MODULUS);
return Big::monty(&m, rom::MCONST, d);
}
Big::new()
} |
<reponame>Tadinu/my_arm<gh_stars>1-10
/*
Copyright (c) 2014, Intel Corporation
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Intel Corporation nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/// @file pxc3dseg.h
/// User Segmentation video module interface
#ifndef PXC3DSEG_H
#define PXC3DSEG_H
#include "pxccapture.h"
class PXC3DSeg : public PXCBase
{
public:
/// Return a reference to the most recent segmented image.
/// The returned object's Release method can be used to release the reference.
virtual PXCImage* PXCAPI AcquireSegmentedImage(void)=0;
PXC_CUID_OVERWRITE(PXC_UID('S', 'G', 'I', '1'));
enum AlertEvent
{
ALERT_USER_IN_RANGE = 0,
ALERT_USER_TOO_CLOSE,
ALERT_USER_TOO_FAR
};
struct AlertData
{
pxcI64 timeStamp;
AlertEvent label;
pxcI32 reserved[5];
};
class AlertHandler
{
public:
virtual void PXCAPI OnAlert(const AlertData& data)=0;
};
/// Optionally register to receive event notifications.
/// A subsequent call will replace the previously registered handler object.
/// Subscribe(NULL) to unsubscribe.
virtual void PXCAPI Subscribe(AlertHandler* handler)=0;
virtual pxcStatus PXCAPI SetFrameSkipInterval(pxcI32 skipInterval)=0;
};
#endif
|
def main():
a=int(input())
list_a=list(input().split())
list_b=[]
for k in list_a:
list_b+=[int(k)]
list_b.sort()
out=''
for i in list_b:
out+=str(i)
out+=' '
print(out.strip())
if __name__ == '__main__':
main() |
Conversations about Recovery at and Away from a Drop-in Center among Members of a Collegiate Recovery Community As the population of young adults in recovery from substance abuse increases, colleges are developing collegiate recovery communities. The goal of these communities is to provide students in recovery the opportunity to receive social support for abstinence from other abstaining individuals. To examine how social support in such a recovery community context occurs, this study analyzed 1,304 end-of-day reports made by 55 abstaining college students, 39 males and 16 females (mean age = 22.6). Two talking with others about recovery outcomes were examined: recovery talks outside of the community drop-in center and recovery talks at the drop-in center. Preliminary analyses revealed that the majority of recovery talks at and outside the drop-in center varied more between days within participants than they did across participants. Primary results revealed that daily levels of cravings and negative mood predicted same-day variation in recovery talks occurring outside of the drop-in center. In contrast, recovery talks at the drop-in center were not associated with these predictors. By demonstrating that college students in recovery receive more conversational support for recovery though not at the community drop-in center and that this out-of-center support appears more responsive to members' needs, this study provides insight into how social support for abstinence can succeed within college recovery communities. |
Shocked and appalled by the prospect of a Donald Trump presidency, some supporters of Hillary Clinton have turned to minimizing and even delegitimizing Trump’s election. In an era of severe political polarization, in an election with two candidates seen from the outset in highly unfavorable terms, after the most brutal campaign in modern history, and with an outcome that astonished just about everyone, these reactions are understandable, but wrong.
Many diehard Clinton supporters cannot bring themselves to believe their candidate could lose to Donald Trump. They think: How could such a crude and inept con man be elected president? Even after it has happened, it is unthinkable, a nightmare. So, the election must not have been fair.
Don’t miss: Lobbied, pressured, even threatened: What life has been like for Electoral College voters
Those on the fringe raise the specter of diabolical Russians hacking away at our democracy. More grounded Clintonians have less malevolent bogeymen — our Founding Fathers. As they see it, the election’s outcome should be blamed on a dysfunctional and archaic electoral-vote system. Hillary won the national popular vote. She should be president. It is as simple as that. The Electoral College should go the way of Trump University.
They are right about one thing: Clinton did win the popular vote, by some 2.8 million votes, as the most recent data show.
Yet Clinton has only 232 electoral votes (in 20 states plus Washington, D.C.) to Trump’s 306 (in 30 states plus one from Maine), making him the president-elect. So Trump’s election without a popular-vote plurality is regarded as an injustice. Some Democrats claim a moral victory as victims of an electoral-vote system that once again horribly “misfired.” Their claim, however, neglects two facts.
California single-handedly turns a Trump plurality in the popular vote into a Clinton plurality.
First, had the election been conducted with rules awarding the presidency to the popular-vote winner, the candidates and many voters quite probably would have acted very differently, and the popular vote might not have been the same. Trump and Clinton would have campaigned in the “safe” states. Potential voters in those states would have felt more pressure to turn out and to vote for “the lesser of two evils” and not to waste their votes on third-party candidates. Some additional Clinton voters would probably have shown up, but gains on the Trump side would probably have been larger as more reluctant Republicans would have been pushed to return to the fold, particularly in big blue states like California, New York and Illinois.
In short, a comparison of the national popular vote as cast and the electoral-vote division is no simple matter. This is particularly true in our age of pervasive polling in which people should have a good idea about whether they live in a state where their presidential vote might make a difference.
Second, Clinton’s popular-vote plurality over Trump depends on the votes in a single state: California, which single-handedly turns a Trump plurality into a Clinton plurality.
The electoral-vote system in 2016 (as in 2000, when George W. Bush became president despite losing the national popular vote) functioned as its defenders have long claimed. It prevented a single region (in this instance, a single state) from overruling the verdict of the more populous and diverse nation.
Donald Trump’s election is difficult for many Americans to accept, but there is no good reason to question its democratic legitimacy. For better or worse, Trump won the presidency by constitutional and sensible democratic rules that guided both campaigns and were known to any politically conscious citizen. He also won the national popular vote cast outside of the single state of California. Moreover, Clinton won all of California’s 55 electoral votes despite the fact that 4.3 million of the state’s voters voted for Trump. That big winner-take-all advantage for California’s Democrats and Clinton was certainly felt, but it wasn't enough to override her losses in many other states.
Under our electoral-vote system, American voters elected a national president, not California’s choice. It is in the nation’s interest for Democratic Party’s leaders and for Clinton voters to fully recognize the legitimacy of the election as they had urged Trump to do after the third presidential debate.
The Electoral College system worked as it should. It did not “misfire.” The election’s outcomes were ultimately about what Americans wanted and what they did not want — not about electoral mechanics.
James E. Campbell is a UB distinguished professor of political science at the University at Buffalo, SUNY, and is the author of “Polarized: Making Sense of a Divided America”. |
// +build ignore
package strings_test
import (
"strings"
"testing"
)
func TestIndex(t *testing.T) {
for _, test := range []struct {
s string
sep string
out int
}{
{"", "", 0},
{"", "a", -1},
{"fo", "foo", -1},
{"foo", "foo", 0},
{"oofofoofooo", "f", 2},
// etc
} {
actual := strings.Index(test.s, test.sep)
if actual != test.out {
t.Errorf("Index(%q,%q) = %v; want %v", test.s, test.sep, actual, test.out)
}
}
}
|
// Creates a tf_device.parallel_execute op that wraps TPUExecute op to
// represent execution of TPU program in multiple logical cores.
LogicalResult BuildParallelExecuteOp(
llvm::ArrayRef<llvm::SmallVector<tensorflow::TPUDeviceAndHost, 8>>
tpu_devices,
llvm::ArrayRef<xla::OpSharding> output_sharding_config,
Operation* compile_op, tf_device::ClusterFuncOp cluster_func,
OpBuilder* builder, tf_device::ParallelExecuteOp* parallel_execute_op) {
const int num_cores_per_replica = tpu_devices.front().size();
TODO(b/149102702): Correctly map inputs to parallel_execute op via
identifying xla_sharding op in the cluster_func function.
const auto cluster_result_types = cluster_func.getResultTypes();
llvm::SmallVector<Type, 8> concatenated_output_types;
concatenated_output_types.reserve(cluster_result_types.size() *
num_cores_per_replica);
for (int core = 0; core < num_cores_per_replica; ++core) {
llvm::SmallVector<Type, 4> output_types;
auto result = tensorflow::GetOutputTypesForLogicalDeviceComputation(
core, output_sharding_config, cluster_func, &output_types);
if (failed(result)) return failure();
for (Type t : output_types) concatenated_output_types.emplace_back(t);
}
*parallel_execute_op = builder->create<tf_device::ParallelExecuteOp>(
cluster_func.getLoc(), num_cores_per_replica, concatenated_output_types);
Extract inputs for each region of the parallel_execute op. The i-th
element in the list represents the input lists to TPU computation for
i-th logical core.
llvm::SmallVector<llvm::SmallVector<mlir::Value, 4>, 4> input_list;
builder->setInsertionPoint(*parallel_execute_op);
auto result = tensorflow::ExtractInputsForLogicalDevices(
num_cores_per_replica, cluster_func, builder, &input_list);
if (failed(result)) return failure();
const bool replicated = tpu_devices.size() != 1;
For each logical core, create a region with TPUExecute op.
assert(input_list.size() == num_cores_per_replica);
for (int core = 0; core < num_cores_per_replica; ++core) {
auto& region = parallel_execute_op->GetRegionBlockWithIndex(core);
builder->setInsertionPointToEnd(®ion);
Create Execute op.
TODO(b/148913294): Identify inputs/return values specific to each
logical core TPU execution by parsing xla_sharding op in
cluster_func.
auto execute_inputs = input_list[core];
execute_inputs.emplace_back(compile_op->getResult(core + 1));
TF::TPUExecuteOp execute;
result = BuildExecuteOp(core, output_sharding_config, execute_inputs,
cluster_func, builder, &execute);
if (failed(result)) return failure();
If computation is replicated, use aliased device. Otherwise there is only
one execution device per core and the device is assigned to the execute
op.
std::string device = replicated
? tensorflow::GetDeviceAliasForLogicalCore(core)
: tpu_devices.front()[core].device;
auto region_launch_op =
WrapOpInLaunch(builder, region.getParent()->getLoc(), execute, device);
builder->create<tf_device::ReturnOp>(region.getParent()->getLoc(),
region_launch_op.getResults());
}
return success();
} |
. The variability of mitochondrial DNA (mtDNA) cytochrome b gene sequences of pygmy wood mouse Sylvaemus uralensis from local populations of European regions of Russia, West Siberia, and neighboring countries (Moldova, Kazakhstan, Uzbekistan, and Turkmenistan) have been studied. Phylogenetic analysis both our results and data from GenBank revealed two clusters of haplotypes: "western" with reliable subdivision into two sequence groups and "eastern" without valid differentiation. Clusters correspond exactly to European and Asian races of pygmy wood mouse recognized earlier on the basis of biochemical and karyological variability. We suppose that Asian race can be considered as independent allopatric species. This is supported by following evidences: high divergence level (which proposes more than 1 mya of divergent evolution) between races, absence of common haplotypes and hiatus between main peaks of mismatch distribution, differences in frequencies of codon usage, fixed nucleotide substitutions in cyt b gene, and also changes in amino acid sequences of cytochrome b. Only specimens of the western phylogenetic linage can be considered as S. uralensis while according to the first description S. tokmak may be considered as species united specimens of eastern phylogenetic linage. |
ALEX McLEISH has revealed keeper Ben Foster has had to be patched up to get on the pitch for Birmingham.
Brum boss McLeish says critics should get off Foster’s back for deciding to call time on his England career for now.
The 28-year-old shocked England boss Fabio Capello this week by announcing that he wanted time out from international duty.
But McLeish says some players are being put through too much.
McLeish said: “It’s not been an easy decision for him. He’s been thinking about it for a long time.
“He did talk about it a wee while ago and I said, ‘Think long and hard, don’t make any rash decisions’.
“But it has clearly been troubling him. I think his body has taken a bit of a pounding over the past two or three years.
McLeish’ men face Fulham tomorrow still haunted by the nagging fear of plunging into the relegation zone.
Midfielder Lee Bowyer, 34, looks set to be offered a new one-year deal to stay at the club.
Mark Hughes is not crazy about Fulham cutting short their summer break if they qualify for the Europa League.
The Cottagers are second just ahead of Tottenham in the Fair Play League and will be in Europe next season if they stay above them. |
Medical Image Registration Using Coral Reef Optimization for Substrate Layer Image registration is process of alignment of two or more images. It is used to get more information about the obtained image which is useful for the analysis of the disease. In the proposed method we use three different types of image registration. They are demon registration, image registration by mutual information and difference method. In these methods the alignment is achieved by changing some parameters manually. The degree of alignment of two images is directly proportional to the amount of information obtained. In order to maximize the alignment an optimization algorithm is used. The conventional image registration methods are constrained by many limitations. Hence we use a bio-inspired meta-heuristics and high performance Coral Reef optimization with Substrate Layer (CRO-SL) algorithm. CRO-SL is an advanced method of coral reef optimization based on natural behavior of coral reef. The image registration process comprises of various steps like transformation of registering image, evaluation of performance metrics and finding the optimized value for transformation. A uni-model affine transformation is used in the proposed method. The experimental results show that CRO-SL is a very efficient approach in case of alignment of image in higher degree. |
package com.game.controllers.admin.dto;
import java.util.ArrayList;
public class AdminItem {
public long id_admin;
public String usuario;
public String clave;
public ArrayList<Long> privilegios;
}
|
<reponame>duststar76/gwt-material-addins
package gwt.material.design.addins.client.fileuploader.js;
/*
* #%L
* GwtMaterial
* %%
* Copyright (C) 2015 - 2017 GwtMaterialDesign
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import gwt.material.design.jquery.client.api.Functions;
import jsinterop.annotations.JsMethod;
import jsinterop.annotations.JsPackage;
import jsinterop.annotations.JsProperty;
import jsinterop.annotations.JsType;
import java.util.List;
/**
* Options for file uploader component
*
* @author kevzlou7979
*/
@JsType(isNative = true, name = "Object", namespace = JsPackage.GLOBAL)
public class JsFileUploaderOptions {
public String url;
@JsProperty
public int maxFilesize;
@JsProperty
public String method;
@JsProperty
public int maxFiles;
@JsProperty
public String previewTemplate;
@JsProperty
public String acceptedFiles;
@JsProperty
public boolean autoProcessQueue;
@JsProperty
public boolean autoQueue;
@JsProperty
public String previewsContainer;
@JsProperty
public String clickable;
@JsProperty
public boolean withCredentials;
@JsProperty
public String dictDefaultMessage;
@JsProperty
public String dictFallbackMessage;
@JsProperty
public String dictFallbackText;
@JsProperty
public String dictFileTooBig;
@JsProperty
public String dictInvalidFileType;
@JsProperty
public String dictResponseError;
@JsProperty
public String dictCancelUpload;
@JsProperty
public String dictUploadCanceled;
@JsProperty
public String dictCancelUploadConfirmation;
@JsProperty
public String dictRemoveFile;
@JsProperty
public String dictRemoveFileConfirmation;
@JsProperty
public String dictMaxFilesExceeded;
@JsProperty
public String dictFileSizeUnits;
@JsProperty
public int timeout;
@JsProperty
public int parallelUploads;
@JsProperty
public boolean uploadMultiple;
@JsProperty
public boolean chunking;
@JsProperty
public boolean forceChunking;
@JsProperty
public long chunkSize;
@JsProperty
public boolean parallelChunkUploads;
@JsProperty
public boolean retryChunks;
@JsProperty
public int retryChunksLimit;
@JsProperty
public String paramName;
@JsProperty
public boolean createImageThumbnails;
@JsProperty
public int maxThumbnailFilesize;
@JsProperty
public int thumbnailWidth;
@JsProperty
public int thumbnailHeight;
@JsProperty
public String thumbnailMethod;
@JsProperty
public int resizeWidth;
@JsProperty
public int resizeHeight;
@JsProperty
public String resizeMimeType;
@JsProperty
public double resizeQuality;
@JsProperty
public String resizeMethod;
@JsProperty
public int filesizeBase;
@JsProperty
public Object headers;
@JsProperty
public boolean ignoreHiddenFiles;
@JsProperty
public boolean addRemoveLinks;
@JsProperty
public Object hiddenInputContainer;
@JsProperty
public Object capture;
@JsProperty
public Functions.Func1<File> renameFile;
@JsProperty
public boolean forceFallback;
}
|
package com.ss.rlib.common.geom;
import org.jetbrains.annotations.NotNull;
/**
* The interface to implement a buffer of vectors.
*
* @author JavaSaBr
*/
public interface Vector3fBuffer {
Vector3fBuffer NO_REUSE = new Vector3fBuffer() {
@Override
public @NotNull Vector3f nextVector() {
return new Vector3f();
}
@Override
public @NotNull Vector3f next(@NotNull Vector3f source) {
return new Vector3f(source);
}
@Override
public @NotNull Vector3f next(float x, float y, float z) {
return new Vector3f(x, y, z);
}
};
/**
* Take a next free vector.
*
* @return the next vector.
*/
@NotNull Vector3f nextVector();
/**
* Take a next free vector with copied values from the source vector.
*
* @param source the source vector.
* @return the next free vector with copied values.
*/
default @NotNull Vector3f next(@NotNull Vector3f source) {
return nextVector().set(source);
}
/**
* Take a next free vector with copied values.
*
* @param x the X component.
* @param y the Y component.
* @param z the Z component.
* @return the next free vector with copied values.
*/
default @NotNull Vector3f next(float x, float y, float z) {
return nextVector().set(x, y, z);
}
}
|
<reponame>weezybusy/c-primer-plus-solutions<filename>ch-8/8.7.c<gh_stars>1-10
// 8.7.c -- salary and taxes calculation (modified version of 7.8.c)
#include <stdio.h>
#include <ctype.h>
#define BASE_PAY1 8.75 // 1st wage rate
#define BASE_PAY2 9.33 // 2nd wage rate
#define BASE_PAY3 10.00 // 3rd wage rate
#define BASE_PAY4 11.20 // 4th wage rate
#define BASE_HRS 40 // hours at base pay
#define OVERTIME 1.5 // 1 hour over 40 hours = 1.5 hours
#define AMT1 300 // 1st rate tier (alternative minimum tax)
#define AMT2 150 // 2nd rate tier (alternative minimum tax)
#define RATE1 0.15 // rate for 1st tier
#define RATE2 0.20 // rate for 2nd tier
#define RATE3 0.25 // rate for 3rd tier
char get_choice(void);
void menu(void);
int main(void) {
char choice;
double pay;
double hours;
double gross;
double net;
double taxes;
menu();
while ((choice = get_choice()) != 'q') {
if (choice == '\n') { // skip over new lines
continue;
}
choice = tolower(choice); // change if letter is uppercase
switch (choice) {
case 'a': pay = BASE_PAY1; break;
case 'b': pay = BASE_PAY2; break;
case 'c': pay = BASE_PAY3; break;
case 'd': pay = BASE_PAY4; break;
default : printf("Please, enter a, b, c, d or q.\n");
menu();
continue; // go to beginning of loop
}
printf("Enter a number of hours worked this week: _\b");
scanf("%lf", &hours);
// Gross settlement
if (hours <= BASE_HRS) {
gross = hours * pay;
}
else {
gross = (BASE_HRS * pay) +
(((hours - BASE_HRS) * OVERTIME) * pay);
}
// calculation of taxes
if (gross <= AMT1) {
taxes = gross * RATE1;
}
else if (gross <= (AMT1 + AMT2)) {
taxes = (AMT1 * RATE1) +
((gross - AMT1) * RATE2);
}
else {
taxes = (AMT1 * RATE1) +
(AMT2 * RATE2) +
((gross - (AMT1 + AMT2)) * RATE3);
}
// salary minus taxes
net = gross - taxes;
// printing results
printf("\ngross: $%.2f\ttaxes: $%.2f\tnet: $%.2f\n",
gross, taxes, net);
// printing menu
menu();
}
printf("Done!\n");
return 0;
}
char get_choice(void)
{
char ch;
while (isspace(ch = getchar())) {
continue;
}
while (getchar() != '\n') {
continue;
}
return ch;
}
void menu(void)
{
// getting prefered wage rate
printf("\nEnter the letter corresponding to the desired pay rate "
"or action:\n");
printf("*********************************************************"
"********\n");
printf("a) $%.2f/hr\t\tb) $%.2f/hr\t\tq) quit\n", BASE_PAY1, BASE_PAY2);
printf("c) $%.2f/hr\t\td) $%.2f/hr\n", BASE_PAY3, BASE_PAY4);
printf("*********************************************************"
"********\n");
printf("Your choice: _\b");
}
|
def filter(self, func):
if not isinstance(func, Callable):
raise TypeError("%s object is not callable" % type(func))
data_schema = self._kdf._sdf.drop(*HIDDEN_COLUMNS).schema
groupby_names = [s.name for s in self._groupkeys]
def pandas_filter(pdf):
return pdf.groupby(groupby_names).filter(func)
sdf = GroupBy._spark_group_map_apply(
self._kdf, pandas_filter, self._groupkeys_scols, data_schema, retain_index=True
)
return DataFrame(self._kdf._internal.with_new_sdf(sdf)) |
// Typings for the Google Drive & Sheets APIs.
declare namespace gapi.client {
export var drive: GapiClientDrive;
export var sheets: any;
export function load(discoveryUrl: string); // See Step 2 at https://developers.google.com/sheets/quickstart/js
}
declare interface GapiClientDrive {
about: any;
changes: any;
channels: any;
comments: any;
files: GapiClientDriveFiles;
permissions: any;
replies: any;
revisions: any;
}
declare interface GapiClientDriveFiles {
copy(parameters: any): any;
create(parameters: any): any;
delete(parameters: any): any;
emptyTrash(parameters: any): any;
export(parameters: any): any;
generateIds(parameters: any): any;
get(parameters: any): any;
list(parameters: GapiClientDriveFilesListParameters): Promise<GapiResponseWrapper<GapiClientDriveFilesListResult>>;
update(parameters: any): any;
watch(parameters: any): any;
}
declare interface GapiClientDriveFilesListParameters {
corpus?: string;
orderBy?: string;
pageSize?: number;
pageToken?: string;
q?: string;
spaces?: string;
}
declare interface GapiClientDriveFilesListResult {
kind: string;
nextPageToken: string;
files: GapiClientDriveFile[];
}
declare interface GapiClientDriveFile {
id: string;
name: string;
}
declare interface GapiResponseWrapper<T> {
result: T;
} |
Design and development of continuous positive airway pressure machine for snoring Continuous Positive Airway Pressure (CPAP) is used to maintain the most effective way to live with obstructive sleep apnea. The working principle of the machine is to blow air through the nose or mouth to keep open the upper airway all the time. The price of CPAP in the market is very expensive which affects many people who need to use CPAP for treatment but cannot afford it. The design and development of a prototype CPAP which functions in the way it is supposed to will be the main objectives of this study. The results of a performance test show that accuracy of the measurement of moisture is 94.09% and the accuracy of temperature measurement is 99.20%. The pressure sensor has an accuracy of over 97%. The CPAP machine provided similar pressure to the ideal pressure values for CPAP settings. The results are quite satisfactory which can be a platform for future study of clinical trials. |
def _apply_theme_settings(self):
theme_path = self._settings['theme']
try:
with open(theme_path) as theme:
style_sheet = theme.read()
except IOError:
QMessageBox.critical(
self,
'Invalid Setting',
'Unable to load theme:\n"{}"'.format(theme_path))
return
style_sheet = scss.Compiler().compile_string(style_sheet)
self.setStyleSheet(style_sheet) |
<filename>proxy/static.go
package proxy
import (
"context"
"github.com/khvysofq/krakend/config"
)
// NewStaticMiddleware creates proxy middleware for adding static values to the processed responses
func NewStaticMiddleware(endpointConfig *config.EndpointConfig) Middleware {
cfg, ok := getStaticMiddlewareCfg(endpointConfig.ExtraConfig)
if !ok {
return EmptyMiddleware
}
return func(next ...Proxy) Proxy {
if len(next) > 1 {
panic(ErrTooManyProxies)
}
return func(ctx context.Context, request *Request) (*Response, error) {
result, err := next[0](ctx, request)
if !cfg.Match(result, err) {
return result, err
}
if result == nil {
result = &Response{Data: map[string]interface{}{}}
}
for k, v := range cfg.Data {
result.Data[k] = v
}
return result, err
}
}
}
const (
staticKey = "static"
staticAlwaysStrategy = "always"
staticIfSuccessStrategy = "success"
staticIfErroredStrategy = "errored"
staticIfCompleteStrategy = "complete"
staticIfIncompleteStrategy = "incomplete"
)
type staticConfig struct {
Data map[string]interface{}
Strategy string
Match func(*Response, error) bool
}
func getStaticMiddlewareCfg(extra config.ExtraConfig) (staticConfig, bool) {
v, ok := extra[Namespace]
if !ok {
return staticConfig{}, ok
}
e, ok := v.(map[string]interface{})
if !ok {
return staticConfig{}, ok
}
v, ok = e[staticKey]
if !ok {
return staticConfig{}, ok
}
tmp, ok := v.(map[string]interface{})
if !ok {
return staticConfig{}, ok
}
data, ok := tmp["data"].(map[string]interface{})
if !ok {
return staticConfig{}, ok
}
name, ok := tmp["strategy"].(string)
if !ok {
name = staticAlwaysStrategy
}
cfg := staticConfig{
Data: data,
Strategy: name,
Match: staticAlwaysMatch,
}
switch name {
case staticAlwaysStrategy:
cfg.Match = staticAlwaysMatch
case staticIfSuccessStrategy:
cfg.Match = staticIfSuccessMatch
case staticIfErroredStrategy:
cfg.Match = staticIfErroredMatch
case staticIfCompleteStrategy:
cfg.Match = staticIfCompleteMatch
case staticIfIncompleteStrategy:
cfg.Match = staticIfIncompleteMatch
}
return cfg, true
}
func staticAlwaysMatch(_ *Response, _ error) bool { return true }
func staticIfSuccessMatch(_ *Response, err error) bool { return err == nil }
func staticIfErroredMatch(_ *Response, err error) bool { return err != nil }
func staticIfCompleteMatch(r *Response, err error) bool { return err == nil && r != nil && r.IsComplete }
func staticIfIncompleteMatch(r *Response, _ error) bool { return r == nil || !r.IsComplete }
|
// SendResponse allows to send the response by the request id
func (sc *ServerConn) SendResponse(reqId int32, opErr error, msg xbinary.Writable) {
if atomic.LoadInt32(&sc.closed) != 0 {
return
}
sc.wLock.Lock()
err := sc.codec.writeResponse(reqId, opErr, msg)
sc.wLock.Unlock()
if err != nil {
sc.logger.Warn("Could not write response for reqId=", reqId, ", opErr=", opErr)
sc.closeByError(err)
}
} |
Ryonghung, a North Korean technology company, recently announced a new tablet. It looks a lot like the weird, firewalled computers the country has produced in the past, with the addition of one curious new feature: the name. It’s called... the iPad.
The new Ryonghung iPad comes with a “a quadcore 1.2 GHZ CPU, 1GB of RAM, an 8GB hard disk, an HDMI cable connection and comes with a keyboard and ‘network connection’ capabilities,” NK News reports.
Advertisement
Those aren’t amazing specs, and they’re nowhere close to the latest iPad that Apple sells. But the new Ryonghung iPad does sound nearly identical to the neutered Android tablet spotted in North Korean electronics stores back in 2013. Except for the blatant violation of Apple’s trademark.
Frankly, you’ve got to give the North Koreans credit for having the gall to rip off the world’s richest company, seemingly while giving zero shits. But North Korea has actually made a habit out of stealing Apple’s ideas, although this appears to be the first time one of the country’s tech companies has straight up lifted a trademarked name.
Advertisement
A couple years ago, a desktop computer that looked virtually identical to an Apple iMac showed up at a trade fair in Pyongyong.
Around the same time, North Korea also created a carbon copy of Apple’s OS X. The so-called “Red Star 3.0” operating system could even run a version of Windows, complete with pre-installed military-themed wallpapers. (You can technically download this software, but you probably shouldn’t.) Kim Jong Un has also been photographed with what appears to be a real Apple iMac on his desk.
Advertisement
It’s unclear what kind of software the new Ryonghung iPad runs, but it runs something. “Ryonghung iPad is now popular among customers,” reads an advertisement for the new tablet. “It can perform a range of functions such as reading different sources of digital information, office work and documentation. And it also has more than 40 apps.” The marketing materials suggest that separate apps come on SD cards, including a farming program and something called “Good Doctor 3.0.”
So is Apple going to send its army of lawyers to Pyongyang to defend its trademark? Who knows. We’ve reached out to Apple and asked as much. We’ll update this post if we hear back.
Advertisement
[NK News] |
Reliable diagnostic work-up of rare urinary infections. Lundeby et al. give an account of the diathat air would be transported from pancreas tion with the patients problem. A prerequisite gnostic work-up of a rare form of urinary tract infection in a woman in her 60s. She underwent several CT scans, cystography, retrograde pyelography, cystoscopy and two bouts of ureterorenoscopy before a final diagnosis was made. She developed urosepsis as a complication resulting from the ureterorenoscopy, The patient was referred to a urologist because of recurrent urinary tract infections and haematuria. The diagnostic work-up of urinary tract infections by a urologist normally consists of establishing a urination pattern by means of a micturition diary, investigating the urine stream, measuring residual urine and urine culture. Cystoscopy and X-ray examination are used to look for foreign bodies and obstructions to flow. An assessment of haematuria involves cystoscopy, contrast studies of the upper urinary tract and urine cytology. A good patient-reported history is of very great predictive value in the diagnosis of urinary tract infections. Recurrent infections over a period of many years, long-term diabetes, abuse of alcohol and smoking are risk factors for emphysematous cystitis and pyelonephritis. A common symptom of a fistula between bladder and bowel is mucous in the urine, which this patient did not have. It is the responsibility of the attending doctor to assess the benefit and risk to the patient prior to any medical procedure. With respect to diagnostic value, it is not very probable or duodenum to renal pelvis and from there to the bladder of a patient who has not undergone a simultaneous kidney-pancreas transplant. When it comes to the risk of infection complications, the level of contamination of the procedure is the deciding factor. It is usual to differentiate between four levels of contamination: clean, clean-contaminated, contaminated and dirty-infected. It may be difficult to find effective prophylaxis against infection for a patient with a long medical history of urinary tract infections, and the most potent antibiotics should be reserved for treating any serious complications. Without effective antibiotic prophylaxis, the risk of infection complications is estimated to be up to 5 %, 10 %, 15 % and 40 %, respectively, for the various contamination categories. The most serious urinary tract complication is urosepsis, with a mortality of 20 40 %, depending on how many criteria for systemic inflammatory response syndrome and multi-organ dysfunction syndrome (MODS) are met. Lundebys account of the patient illustrates the importance of securing a good selfreported history from the patient and assessing benefit and risk prior to surgical procedures. Diagnosing air in the urinary tract may be a major challenge, but it is symptomatic of the public health service today that we often devote considerable resources to studying findings obtained with sophisticated diagnostic imaging, and that have an uncertain connecfor an appropriate work-up is knowing the most probable diagnosis. Emphysematous cystopyelonephritis is a condition more doctors should be aware of. |
Julian Richings
Early life
Richings was born in Oxford, Oxfordshire. He trained in drama at the University of Exeter.
Career
After touring the United States with a British stage production, Richings moved to Toronto, Ontario, Canada in 1984. Within five years, he had become a regular on the second season of the War of the Worlds TV series. Other roles followed, and he gained critical acclaim as the bitter, aging, punk rock legend Bucky Haight in the 1996 film Hard Core Logo. He had a brief appearance in the 1997 film Cube. In 1999, he appeared in the science fiction film Thrill Seekers.
In 2000, he appeared as Bellanger in The Claim, and earned a Genie Award nomination for best supporting actor. He was a member of the repertory cast of the A&E TV original series A Nero Wolfe Mystery (2001–02). He has played the role of Death in The CW's show Supernatural since Season 5, and appeared again in Seasons 6, 7, 9 and 10. He played a very similar version of Death in the short film Dave v. Death (2011).
Richings is familiar to horror fans for his manic performance in heavy makeup as Three Finger in Wrong Turn (2003), and nearly-blind security guard Otto in Stephen King's 2004 miniseries Kingdom Hospital. Dramatic roles include stagehand Mr. Turnbull in the 2004 film Being Julia. He appeared as Orr, a cruel loan shark in the 2004 Canadian film The Last Casino. In 2006, he appeared in a brief speaking role as the Mutant Theatre Organiser in X-Men: The Last Stand, and played a vampire killer alongside in the direct-to-DVD horror film The Last Sect.
2007 saw Richings play a driver in the film Shoot 'Em Up, a dissipated and aging punk rocker in The Third Eye, transvestite psychologist Dr. Heker in The Tracey Fragments, and a number of small roles in other films, including Skinwalkers and Saw IV. He appeared in the 2008 film The Timekeeper. Richings continues to be active in short films and television series, mostly in Canada. He was presented with two Dora Awards in the late 1980s, and continues to perform professionally in the Toronto area with a number of theatre groups.
In 2008, Richings was nominated for another Dora Award for his performance in The Palace of the End. He confirmed, via an interview on the Canadian TV show InnerSPACE, that he had a part in the 2013 Superman film Man of Steel. During the interview he was also asked about the campaign to see him become the next Doctor in Doctor Who, one of his favorite childhood TV shows, and admitted to being flattered by the idea. In 2014, he starred in the Matt Wiele and Chad Archibald, directed Science-Fiction film Ejecta. In 2015, he appeared in the Robert Eggers-directed horror film The Witch and Corey Misquita's drama film Reign.
Personal life
Richings resides in the Toronto area with his wife and two children. |
Xeno-Nucleic Acid (XNA) 2-Fluoro-Arabino Nucleic Acid (FANA) Aptamers to the Receptor-Binding Domain of SARS-CoV-2 S Protein Block ACE2 Binding The causative agent of COVID-19, SARS-CoV-2, gains access to cells through interactions of the receptor-binding domain (RBD) on the viral S protein with angiotensin-converting enzyme 2 (ACE2) on the surface of human host cells. Systematic evolution of ligands by exponential enrichment (SELEX) was used to generate aptamers (nucleic acids selected for high binding affinity to a target) to the RBD made from 2-fluoro-arabinonucleic acid (FANA). The best selected ~79 nucleotide aptamers bound the RBD (Arg319-Phe541) and the larger S1 domain (Val16-Arg685) of the 1272 amino acid S protein with equilibrium dissociation constants (KD,app) of ~1020 nM, and binding half-life for the RBD, S1 domain, and full trimeric S protein of 53 ± 18, 76 ± 5, and 127 ± 7 min, respectively. Aptamers inhibited the binding of the RBD to ACE2 in an ELISA assay. Inhibition, on a per weight basis, was similar to neutralizing antibodies that were specific for RBD. Aptamers demonstrated high specificity, binding with about 10-fold lower affinity to the related S1 domain from the original SARS virus, which also binds to ACE2. Overall, FANA aptamers show affinities comparable to previous DNA aptamers to RBD and S1 protein and directly block receptor interactions while using an alternative Xeno-nucleic acid (XNA) platform. Introduction The coronavirus SARS-CoV-2 has had a devastating impact on society that will likely continue into the foreseeable future. It is the third coronavirus (SARS-CoV-1 and MERS being the other two) to emerge as a human pathogen in the past 17 years, raising the possibility that others will arise in the future. Thus, the development of novel therapeutics targeting SARS-CoV-2 and new approaches that can potentially be extended to emerging or future viruses are urgently needed. Infection with SARS-CoV-2 requires interaction between the viral surface protein, spike (S), and a host "receptor" protein, angiotensinconverting enzyme 2 (ACE2), that is expressed on type II alveolar cells and ciliated cells in the human airway epithelium (HAE), making these cells potentially vulnerable to infection. Antibodies that block this interaction have been successfully used to mitigate COVID-2 infections. End-Labeling of Oligonucleotides with T4 Polynucleotide Kinase DNA oligonucleotides were 5 end-labeled in a 50 L volume containing 10-250 pmol of the oligonucleotide of interest, 1X T4 PNK reaction buffer (provided by the manufacturer), 10 U of T4 PNK and 5-10 L of (-32 P) ATP (3000 Ci/mmol, 10 Ci/L). The labeling reaction was performed at 37 C for 30 min according to the manufacturer's protocol. PNK enzyme was heat inactivated by incubating the reaction at 75 C for 15 min. Excess radiolabeled nucleotides were then removed by centrifugation using a Sephadex G-25 column. The 79-nucleotide FANA random pool starting material (referred to as FANA-ST) for SELEX containing a 40-nucleotide central random region flanked at the 5 end by 20 nucleotides of fixed sequence DNA (5 -AAAAGGTAGTGCTGAATTCG-3 ), and at the 3 end by 19 nucleotides of fixed FANA sequence (5 -UUCGCUAUCCAGUUGGCCU-3') (i.e., 5 -AAAAGGTAGTGCTGAATTCG(N) 40 UUCGCUAUCCAGUUGGCCU-3'), was prepared as described previously. About 200 pmol (~1 10 14 different sequences) of 5 32 Plabeled FANA starting pool was heated to 90 C then snap-cooled on ice. The material was then incubated with 20 pmoles of SARS-CoV-2 RBD protein that had been attached to Dynabeads™ using the C-terminal His-tag. Incubations were in 200 L PBS (137 mM NaCl, 2.7 mM KCl, 8 mM Na 2 HPO 4, and 2 mM KH 2 PO 4, pH 7.4) for 30 min with agitation at room temperature. The beads were washed 2 with 200 L of PBS and the bound FANA material was removed by adding 200 L of imidazole containing buffer (300 mM imidazole, 50 mM sodium phosphate pH 8.0, 300 mM NaCl, 0.01% Tween™-20) to the beads and heating for 5 min at 90 C, then removing the beads with a magnet. Bound FANA was recovered by precipitation with ethanol in the presence of 50 g of glycogen. The material was reverse transcribed to DNA, amplified and converted to FANA for another round of selection as previously described. The SELEX was stopped after round 8 as no further binding affinity increase was detected. Sequence Analysis of FANA Products Recovered from Round 8 PCR products were prepared from FANA sequences recovered from round 8. The PCR material was cloned using a TOPO TA cloning kit from Life Technologies. DNA mini-preps were prepared, and the products were sequenced by Macrogen (Rockville, Maryland). The appropriate DNA oligonucleotide templates for some of the recovered sequences were synthesized, and generation of FANA material was performed as described. Determination of Apparent Equilibrium Dissociation Constant (K D,app ) Using Nitrocellulose Filter Binding Assays Standard reactions for K D,app determinations were performed in 20 L of PBS with 0.1 mg/mL BSA and 0.1 nM 5 32 P end-labeled aptamer. Increasing amounts of SARS-CoV-2 RBD or other proteins were diluted in the above buffer and were added in amounts that approximately flanked the K D,app value (estimated from initial experiments) for the aptamer. After 10 min at room temperature, the reactions were applied to a 25 mm nitrocellulose disk (0.45 m pore, Protran BA 85, Whatman™) pre-soaked in filter wash buffer (25 mM Tris-HCl pH 7.5, 10 mM KCl). The filter was washed under vacuum with 5 mL of wash buffer at a flow rate of~1 mL/sec. Filters were then counted in a scintillation counter. A plot of bound aptamer vs. protein concentration was fit to the following equation for ligand binding, one-site saturation in SigmaPlot in order to determine the K D,app : y = B max (x)/(K D +x) where x is the concentration of protein, and y is the amount of bound aptamer. Competition Binding Assays In total, 10 nM 5 32 P end-labeled aptamer was incubated at room temperature in PBS with various amounts of excess unlabeled competitor at 0-, 1-, 2-, 4-, 8-, or 16-fold excess over radiolabeled labeled aptamer. SARS-CoV-2 RBD or S1 protein was added to a final concentration of 10 nM. The total volume was 20 L (in PBS). Incubations were continued for 1 h at room temperature. In competition reactions with the human ACE2 protein, the radiolabeled aptamer was mixed with ACE2 prior to the addition of SARS-CoV-2 RBD. Assays for measuring the binding of ACE2 to aptamers in the absence of RBD or S1 were also performed. The low level of binding to the aptamer in the absence of RBD was subtracted away from the result with radiolabeled aptamer, ACE2, and RBD to produce the final result (see Figure 3). Samples were run over a nitrocellulose filter and washed and quantified as described above. For this, 5 nM (final concentration) 5 32 P end-labeled R8-9 aptamer was incubated for 10 min at room temperature in 90 L PBS with 5 nM (final concentration) SARS-CoV-2 RBD, S1, or Trimer (as indicated). Unlabeled R8-9 aptamer was then added in a volume of 10 L of PBS such that the final concentrations of unlabeled R8-9 were 125 nM (25-fold excess over labeled aptamer). For the SARS-CoV-2 Trimer, the concentration of unlabeled R8-9 was increased to 250 nM due to each trimer having 3 binding sites for the aptamer. A total of 10 L aliquots were removed and filtered over nitrocellulose (see above) at "0", 10, 20, 40, 60, 80, 100, and 120 min, or as indicated. Note that the time "0" was removed immediately upon the addition of unlabeled aptamer, but it is not a true time 0 as a few seconds passed before the material was filtered over nitrocellulose. Producing a time 0 sample by filtering the material prior to unlabeled aptamer addition produced results that were sometimes inconsistent with the remaining time points and produced experimental fits (see below) that were less accurate (based on r 2 values). A background control was prepared by mixing 5 nM 5 32 P end-labeled R8-9 aptamer and 125 nM unlabeled aptamer in 9 ul of PBS, then adding 1 uL of SARS-CoV-2 RBD protein (final concentration 5 nM) and incubated for 10 min before processing. The dissociation constant was determined by fitting the data from a plot of aptamer bound to the filter vs. time, to an equation for a single 2-parameter exponential decay in SigmaPlot: y = ae -bx, where b is the dissociation constant (k off in this case). The t 1/2 value was determined from k off using the following equation: t 1/2 = 0.69/k off. Binding Inhibitions Analysis The ability of aptamers to block the association of SARS-CoV-2 RBD with ACE2 was measured with the cPass™ SARS-CoV-2 Neutralization Antibody Detection kit (GenScript ® ). For comparison, neutralizing monoclonal antibody (GenScript ®, clone ID: 6D11F2) was also used. The manufacturer's suggested protocol for the kit was followed. Positive and negative controls were provided by the manufacturer. This protocol included an initial 30 min binding step with RBD and aptamer or antibody, followed by a 15 min incubation of the material with attached ACE2. Selection of FANA Aptamers against the Spike Receptor Binding Domain (RBD) Aptamers were produced by a modified SELEX approach using mutated enzymes capable of converting between DNA and FANA. The RBD domain of the (SARS-CoV-2) S protein was chosen as the target because aptamers that directly block S protein-ACE2 receptor interactions were desired, rather than those that bind S protein in other domains that may be less likely to block receptor binding. The 223 amino acid RBD (amino acid 319-541), comprises just a small portion of the S protein (1273 amino acids) ( Figure 1). It is part of the S1 subunit (amino acids 14-685) present on the outside of the viral envelope. The C-terminal His-tagged RBD domain was attached to magnetic beads for the selection process (see Materials and Methods). A total of 28 sequences were recovered from a limited number of clones after 8 rounds of selection. The recovered sequences were organized by sequence similarity into clusters using multiple alignment using fast Fourier transform (MAFFT). Sequences (7 total) from different clusters with diverse structures based on RNAfold analysis were chosen for further testing. The FANA aptamer sequences are named based on the SELEX round (i.e., R8), and the number of the particular sequence clone. The two clusters containing the strongest RBD binding sequences (see Table 1) are represented by FANA-R8-9 and FANA-R8-17. These sequences are aligned with other recovered sequences from the same clusters ( Figure 2A) and the predicted structures of FANA-R8-9 and FANA-R8-17 are shown in Figure 2B. The other sequences from these clusters had similar predicted structures. Aptamers from other clusters in Table 1 (FANA-R8-3, FANA-R8-7, and FANA-R8-15) that bound less tightly also had different predicted structures (data not shown). Filter binding assays were used for measuring the apparent equilibrium dissociation constants (K D,app ) to the RBD protein and the larger S1 portion of the SARS-CoV-2 spike protein (Val16-Arg685). All 7 tested FANA sequences bound to the RBD and S1 protein with~25-fold of greater binding affinity than the starting material (FANA-ST, Table 1). Aptamers FANA-R8-9, the closely related FANA-R8-22, and FANA-R8-17 bound the strongest, and FANA-R8-9 was chosen for further testing. This aptamer bound both the S1 protein and S protein trimer (a soluble form of the S trimer that is present on viral membranes) modestly more tightly than the RBD. A version of S1 without the His-tag bound with approximately the same affinity to FANA-R8-9 as tagged protein indicating that the His-tag played no role in aptamer binding. FANA-R8-9 was also tested for binding the Delta variant RBD protein. This protein differs from the Wuhan strain within the RBD domain at two positions, Lys452Arg and Thr478Lys. Interestingly, FANA-R8 bound about 10-fold better to this protein than the Wuhan strain RBD it was selected to. A similar phenomenon was observed for a DNA aptamer selected by the Wuhan RBD, which bound better to the UK variant. The binding of FANA-R8-9 to the S1 protein from SARS-CoV-1 was also tested ( Table 1). The spike proteins from these two viruses, which both use ACE2 as a receptor, are~76% identical at the amino acid level and~74% identical in the RBD domain. The several-fold lower binding to S1 from SARS-CoV-1 demonstrates the high specificity of FANA-R8-9. The binding of RBD and S1 to DNA aptamer selected for RBD binding (CoV2-RBD-1C) was also tested. Aptamer CoV2-RBD-1C has a reported K D for RBD of 5 nM, which suggests modestly tighter binding to RBD than FANA-R8-9. This aptamer bound weakly to our RBD construct but did bind to the S1 protein, albeit with lower affinity than the FANA aptamers. Differences between the published results and ours may reflect the different affinity measurement techniques or different protein constructs (see Discussion). quences are named based on the SELEX round (i.e., R8), and the number of the particular sequence clone. The two clusters containing the strongest RBD binding sequences (see Table 1) are represented by FANA-R8-9 and FANA-R8-17. These sequences are aligned with other recovered sequences from the same clusters ( Figure 2A) and the predicted structures of FANA-R8-9 and FANA-R8-17 are shown in Figure 2B. The other sequences from these clusters had similar predicted structures. Aptamers from other clusters in Table 1 (FANA-R8-3, FANA-R8-7, and FANA-R8-15) that bound less tightly also had different predicted structures (data not shown). Filter binding assays were used for measuring the apparent equilibrium dissociation constants (KD,app) to the RBD protein and the larger S1 portion of the SARS-CoV-2 spike protein (Val16-Arg685). All 7 tested FANA sequences bound to the RBD and S1 protein with ~ 25-fold of greater binding affinity than the starting material (FANA-ST, Table 1). Aptamers FANA-R8-9, the closely related FANA-R8-22, and FANA-R8-17 bound the strongest, and FANA-R8-9 was chosen for further testing. This aptamer bound both the S1 protein and S protein trimer (a soluble form of the S trimer that is present on viral membranes) modestly more tightly than the RBD. A version of S1 without the His-tag bound with approximately the same affinity to FANA-R8-9 as tagged protein indicating that the His-tag played no role in aptamer binding. FANA-R8-9 was also tested for binding the Delta variant RBD protein. This protein differs from the Wuhan strain within the RBD domain at two positions, Lys452Arg and Thr478Lys. Interestingly, FANA-R8 bound about 10-fold better to this protein than the Wuhan strain RBD it was selected to. A similar phenomenon was observed for a DNA aptamer selected by the Wuhan RBD, which bound better to the UK variant. The binding of FANA-R8-9 to the S1 protein from SARS-CoV-1 was also tested ( Table 1). The spike proteins from these two viruses, which both use ACE2 as a receptor, are ~ 76% identical at the amino acid level and ~ 74% identical in the RBD domain. The several-fold lower binding to S1 from SARS-CoV-1 demonstrates the high specificity of FANA-R8-9. The binding of RBD and S1 to DNA aptamer selected for RBD binding (CoV2-RBD-1C) was also tested. Aptamer CoV2-RBD-1C has a reported KD for RBD of 5 nM, which suggests modestly tighter binding to RBD than FANA-R8-9. This aptamer bound weakly to our RBD construct but did bind to the S1 protein, albeit with lower affinity than the FANA aptamers. Differences between the published results and ours may reflect the different affinity measurement techniques or different protein constructs (see Discussion). The spike (S) protein has two major domains, subunit 1 (S1) and subunit 2 (S2). The receptor-binding domain (RBD) that binds to ACE2 is amino acid Arg319-Phe541 of the S1 domain. A 13 amino acid signal peptide (SP) is present at the start of the amino terminus, while the transmembrane domain (TM) is located near the C-terminus (amino acids 1214-1234). The numbering was taken from, and a more detailed representation can be found in that reference. The spike (S) protein has two major domains, subunit 1 (S1) and subunit 2 (S2). The receptor-binding domain (RBD) that binds to ACE2 is amino acid Arg319-Phe541 of the S1 domain. A 13 amino acid signal peptide (SP) is present at the start of the amino terminus, while the transmembrane domain (TM) is located near the C-terminus (amino acids 1214-1234). The numbering was taken from, and a more detailed representation can be found in that reference. Figure 1). c-"S1": S1 portion of SARS-CoV-2 spike protein (Wuhan strain) with C-terminal His-tag (see Figure 1). d-Modified S protein trimer from SARS-CoV-2 (aa 1-1208), furin cleavage site removed, C-terminal His-tagged. e-FANA-ST: starting material for the SELEX procedure (see above under "a"). f-K D,app values were determined using nitrocellulose filter binding in PBS buffer unless otherwise stated. Results are averages of 2-3 experiment ± standard deviation (for experiments with 3 determinations only). g-RBD from the Delta variant differs from Wuhan strain RBD at two amino acids: Lys452Arg, Thr478Lys. h-Assays were performed in cell culture media: D-MEM + 10% fetal bovine serum (FBS). i-Binding of S1 protein from SARS-CoV-1 (2003 virus) to FANA-R8-9. j-DNA aptamer from. Aptamer FANA-R8-9 was used in competition binding and off-rate analysis experiments. As expected, non-labeled FANA-R8-9 was able to compete with radio-labeled aptamer for binding to RBD or S1 (Figure 3). However, non-labeled FANA-ST (starting material for SELEX selections) was unable to displace any FANA-R8-9 aptamer, even when added at 16-fold greater amounts. This confirms that FANA-R8-9 binds to RBD much more tightly than the starting material. In contrast, ACE2 protein was able to compete with FANA-R8-9 for binding to RBD. However, 2-fold excess cold FANA-R8-9 was as effective as 16-fold excess ACE2 in the competition. This indicates that FANA-R8-9 binds better to RBD than ACE2. ACE2 was also tested for binding to FANA-R8-9 and the CoV2-RBD-1C DNA aptamer. Weak binding to ACE2 was detected for both aptamers, with twofold greater binding to FANA-R8-9 ( Figure 3). Off-rate analysis showed that FANA-R8-9 dissociated from RBD with a half-life of 53 ± 18 min (Ave. 3 exp. ± S.D., Figure 4), demonstrating stable binding. Binding appeared to be more stable with SARS-CoV-2 S1 protein (76 ± 5) and the S protein trimer (127 ± 7 min). While the increase was not statistically significant for the S1 protein, it was for the S protein. More stable binding may be due to additional stabilizing contacts being available on the larger S protein. Another possibility for the S protein trimer is that there is a prox imity effect since 3 RBD binding sites for the aptamer are presumably close together and an aptamer that dissociated from a site may quickly bind to a neighboring site. Figure 3. Competition binding assay with SARS-CoV-2 RBD and S1 proteins. Samples contained 10 nM of 5 -32 P end-labeled FANA-R8-9 aptamer and 10 nM of either RBD or S1 proteins (see below). Cold competitor (FANA-R8-9, FANA-ST (starting material for SELEX), or ACE2 protein) was added at 0, 1, 2, 4, 8, and 16-fold excess over labeled FANA-R8-9. RBD and S1 were omitted from the ACE2:FANA-R8-9 and ACE2:CoV2-RBD-1C (51 nt DNA aptamer). * All values are relative to the value for no competitor with RBD:FANA-R8-9 or S1:FANA-R8-9 (for S1 samples only). Off-rate analysis showed that FANA-R8-9 dissociated from RBD with a half-life of 53 ± 18 min (Ave. 3 exp. ± S.D., Figure 4), demonstrating stable binding. Binding appeared to be more stable with SARS-CoV-2 S1 protein (76 ± 5) and the S protein trimer (127 ± 7 min). While the increase was not statistically significant for the S1 protein, it was for the S protein. More stable binding may be due to additional stabilizing contacts being available on the larger S protein. Another possibility for the S protein trimer is that there is a proximity effect since 3 RBD binding sites for the aptamer are presumably close together and an aptamer that dissociated from a site may quickly bind to a neighboring site. Functional Assessment of RBD-Binding Aptamers To measure the ability of aptamers to block the binding of the RBD to the ACE2 receptor, an ACE2 ELISA was used ( Figure 5). Aptamers were compared with an anti-SARS-CoV-2 RBD-neutralizing antibody (GenScript ® clone ID: 6D11F2) and FANA-ST. On a weight basis ( Figure 5, see g/mL amounts on X-axis), antibody 6D11F2 and FANA-R8-9 (as well as FANA-R8-22 (data not shown)) showed similar ability to block ACE2 binding (IC 50~0.6 g/mL for the antibody and 1.30 ± 0.18 g/mL (ave. 3 exp. ± S.D.) for FANA-R8-9), while aptamer FANA-R8-17 was~threefold weaker (data not shown), and FANA-ST showed no significant blocking of ACE2 binding. On a per molecule basis, the antibody was more effective as an inhibitor ( Figure 5, see "nM" amounts on X-axis). Considering that antibodies have two target binding sites vs. one on the aptamer, the antibody was about threefold better using this criterion. Viruses 2021, 13, x FOR PEER REVIEW 8 of 1 Figure 4. Example of an off-rate analysis of FANA-R8-9 from SARS-CoV-2 RBD, S1, and trimer proteins. Experiments to examine the dissociation of aptamer from various proteins were conducted as described in Materials and Methods. Data was fit to a curve for single parameter exponential decay to calculate off-rate (koff) and half-life (t1/2). The experiment was repeated 3 times to yield koff and t1/2 values shown in the insert table. The FANA-ST starting material bound very weakly in this assay with no significant level of bound material (using RBD) being measurable at the 20 min time point. *Values are relative to the value for bound material at time 0. Functional Assessment of RBD-Binding Aptamers To measure the ability of aptamers to block the binding of the RBD to the ACE2 re ceptor, an ACE2 ELISA was used ( Figure 5). Aptamers were compared with an anti-Figure. 5. ELISA assay to test the ability of antibodies and aptamers to block ACE2 binding to the RBD domain. Neutralizing RBD antibody (GenScript 6D11F2) was compared with FANA-R8-9 and FANA-ST (starting material) in an ACE2 ELISA assay (GenScript). *Percent inhibition was calculated based on positive and negative controls supplied by the manufacturer. The negative control produced a value of "0" in the assay and is not shown. See Materials and Methods for Example of an off-rate analysis of FANA-R8-9 from SARS-CoV-2 RBD, S1, and trimer proteins. Experiments to examine the dissociation of aptamer from various proteins were conducted as described in Materials and Methods. Data was fit to a curve for single parameter exponential decay to calculate off-rate (k off ) and half-life (t 1/2 ). The experiment was repeated 3 times to yield k off and t 1/2 values shown in the insert table. The FANA-ST starting material bound very weakly in this assay with no significant level of bound material (using RBD) being measurable at the 20 min time point. * Values are relative to the value for bound material at time 0. Viruses 2021, 13, x FOR PEER REVIEW 8 of 13 Figure 4. Example of an off-rate analysis of FANA-R8-9 from SARS-CoV-2 RBD, S1, and trimer proteins. Experiments to examine the dissociation of aptamer from various proteins were conducted as described in Materials and Methods. Data was fit to a curve for single parameter exponential decay to calculate off-rate (koff) and half-life (t1/2). The experiment was repeated 3 times to yield koff and t1/2 values shown in the insert Functional Assessment of RBD-Binding Aptamers To measure the ability of aptamers to block the binding of the RBD to the ACE2 receptor, an ACE2 ELISA was used ( Figure 5). Aptamers were compared with an anti- FANA-R8-9 was also tested for stability in serum-containing cell culture media ( Figure 6A). Both FANA-R8-9 and CoV2-RBD-1C DNA aptamer remained intact for several hours and demonstrated similar decay rates ( Figure 6B). The slower rate of decay between 4 and 24 h may result from decreased activity of the degrading enzymes in the media. R8-9 (as well as FANA-R8-22 (data not shown)) showed similar ability to block ACE2 binding (IC50 ~ 0.6 g/mL for the antibody and 1.30 ± 0.18 g/mL (ave. 3 exp. ± S.D.) for FANA-R8-9), while aptamer FANA-R8-17 was ~ threefold weaker (data not shown), and FANA-ST showed no significant blocking of ACE2 binding. On a per molecule basis, the antibody was more effective as an inhibitor ( Figure 5, see "nM" amounts on X-axis). Considering that antibodies have two target binding sites vs. one on the aptamer, the antibody was about threefold better using this criterion. FANA-R8-9 was also tested for stability in serum-containing cell culture media (Figure 6A). Both FANA-R8-9 and CoV2-RBD-1C DNA aptamer remained intact for several hours and demonstrated similar decay rates ( Figure 6B). The slower rate of decay between 4 and 24 h may result from decreased activity of the degrading enzymes in the media.. Figure 6. (A and B). Aptamer stability assay. 100 nM of radiolabeled FANA-R8-9 (79 nts) and DNA aptamer CoV2-RBD-1C (51 nts ) were incubated in 200 uL of D-MEM complete + 10% FBS, and 1% penicillin/streptomycin) at 37 °C. Twenty ul aliquots were removed at 0, 1, 2, 4, 8, and 24 h time points and run on a 10% PAGE denaturing gel. Lane 'D", a 20 uL aliquot was digested with DNaseI for 30 min at 37 °C as a control; (B) quantification of products. Gels were visualized and quantified using a phosphorimager. The level of full-length undegraded material was measured at each time point. The graph shows averages from three independent experiments with error bars representing the standard deviations. *Values were relative to the amount of material at time 0. Discussion This report describes the production of aptamers that can bind to and block the binding of the SARS-CoV-2 RBD to ACE2. The aptamers are unique, as they are made from FANA XNA, as opposed to previous DNA aptamer to the SARS-CoV-2 S protein. Binding, Discussion This report describes the production of aptamers that can bind to and block the binding of the SARS-CoV-2 RBD to ACE2. The aptamers are unique, as they are made from FANA XNA, as opposed to previous DNA aptamer to the SARS-CoV-2 S protein. Binding, based on K D,app analysis was comparable to previously reported DNA aptamers [47,. The aptamers were stable for several hours in cell culture media but did break down at a rate comparable to the tested DNA aptamer ( Figure 6). Interestingly, a previously reported DNA aptamer (CoV2-RBD-1C) that bound with a K D of 5.8 ± 0.8 nM to RBD did not bind strongly to the RBD in our system, although it did show binding to the S1 domain protein, albeit at a lower level than the FANA aptamers ( Table 1). The RBD used for binding tests in our experiments was the same as the protein used for selection and included a C-terminal His-tag. Binding was also measured in solution using nitrocellulose filters. The CoV2-RBD-1C aptamer was measured using RBD attached to nickel beads. It is possible that the free His-tag (as opposed to the tag sequestered on beads) in our measurements interfered with binding. The S1 protein used in Viruses 2021, 13,1983 10 of 13 our measurements also contained a His-tag, but it is further away from the RBD domain due to the larger size of the protein. Other DNA aptamers to RBD have also been reported. Most report binding in the same low nM range, as the FANA aptamers described here (https://www.basepairbio.com/COVID19/, accessed on 1 July 2021). This is in the same range as the reported interaction between ACE2 and the SARS-CoV-2 S protein (14.7 nM) and considerably tighter than SARS-CoV-1 S protein binding to ACE2 (325.8 nM). Therefore, it would be expected that these aptamers should be good competitors for ACE2 binding. In agreement with this observation, FANA-R8-9 was about as effective on a per weight basis as the neutralizing RBD-specific antibody used in this analysis ( Figure 5). As there are numerous variations in the type of aptamers that can be generated with different XNAs, perhaps those that bind even more tightly can be obtained in the future. The FANA-R8-9 and other aptamers ( Table 1) bound with low nM affinity to RBD, while previous FANA aptamers isolated in this lab to HIV reverse transcriptase (RT) and integrase (IN) bound with low pM affinity,~1000-fold tighter. One reason for this is RT and IN are both natural nucleic acid binding proteins and already bind tightly to specific nucleic acids. It is more of a challenge to recover strong binding aptamers to proteins that do not naturally bind nucleic acids. However, this is not always the case. Aptamers to thrombin, for example, can bind with pM affinity and modified aptamer to VEGF, which is the target for aptamer therapy for macular degeneration, also show pM binding. Several aptamers made using slow off-rate modified aptamers (SOMAs) technology that includes the addition of hydrophobic groups to nucleic acids bind tightly to targets, even those that are not natural nucleic acid-binding proteins. Still, making aptamers is a "hit-or-miss" proposition, and there are no guarantees that aptamers that can bind more tightly than those reported here or by others can be found. It was notable that despite the modest low nM K D 's of the FANA aptamers (Table 1), the observed off-rates were indicative of highly stable binding, especially for the more natural trimeric S protein ( Figure 4). Stable binding is likely a better predictor of potential therapeutic effect than a lower binding affinity. Finally, we have not yet tested the FANA aptamer in virus neutralization assays. Aptamers that block interactions with the receptor, such as neutralizing antibodies, have the advantage of not having to enter cells to be effective. While DNA aptamers that bind the SARS-CoV-2 RBD have been shown to block virus infection, a recent report indicates that a DNA aptamer that binds to S1 but not in the RBD region can neutralize virus. Interestingly, this aptamer did not appear to block virus binding to the ACE2 receptor. This suggests that even those aptamers that do not directly block binding may be able to inhibit replication. |
LEED Gold-designed Greiner Hall marries green building with universal design.
For the past decade, UB has been a leader in creating green buildings and working to reduce energy and material usage throughout our facilities.
In 2003, UB’s Creekside Village Community Center was the first building in Western New York to become certified under the U.S. Green Building Council’s Leadership in Energy and Environmental Design (LEED) rating system.
Then in 2004, UB published its own High Performance Building Guidelines in support of New York State Executive Order 111. These guidelines were referenced by institutions across New York State and served to further our own commitment to build green.
Our early investments laid the foundation for five new LEED buildings—all opening within one year of another. Four are designed to meet LEED Gold standards and will save critical financial, as well as natural, resources.
William R. Greiner Hall, a residence hall that debuted in 2011, demonstrates UB's leadership in green construction. The building is packed with features such as high-efficiency lighting, low-flow faucets, and laundry room counters made from recycled Tide bottles. It's SUNY's first LEED Gold-designed residence hall.
As part of a NYPA project, over 210 power meters have been installed at UB. The new internet based “Smart” power meters recently installed will permit UB to closely observe and manipulate power consumption within each building. Never before have we been able to track real-time power consumption in 5, 10 or 15 minute blocks of time. Having this information will greatly improve our ability to better control usage within our buildings and it allows us to verify conservation measures are performing as expected. Detailed usage information will allow us to establish a specific energy cost with a specific time frame, so we can target energy reductions when power prices are peaking.
A software platform was also installed with the new meters allowing easy access by multiple users to historical and real-time power data at each building. The platform will automatically upload the energy and demand data into EnergyCAP, our utility accounting system, at the end of each month. The platform will allow Campus Living to raise awareness with students occupying residence halls. The meters and internet based metering platform gives Facilities staff and others the tools they need to implement new energy conservation measures at every location and observe the real-time results.
The new power meters coupled with existing steam, chilled water and natural gas meters gives UB a comprehensive backbone of building energy data measurement tools. The building data will be used to rank building performance, identify new conservation opportunities, raise awareness, identify costs, measure operational effectiveness, test new strategies and improve overall campus sustainability.
Looking for a place to fill up? Zoom in on the map above to see where you can replenish your reusable water bottle. |
Injuries have hampered No. 1 overall pick Markelle Fultz's NBA career, with thoracic outlet syndrome currently keeping the Orlando Magic guard off the court.
However, the 20-year-old offered a positive update to Josh Robbins of The Athletic on Tuesday.
"It's going great," Fultz told Robbins. "I'm feeling really good. I'm happy. I'm blessed. And as I'm going forward, I'm just sticking with the plan and just going through rehab."
For his part, Fultz is pleased with his daily progress.
"I'm definitely getting better each and every day," Fultz said. "That's what a lot of people didn't know about TOS: It's very tricky, and the pain is different for different people. But that's what I'm working on now in rehab: just getting better each and every day. And the progression that I'm making is very good."
Robbins reported that there is no return timeline for Fultz, who the Philadelphia 76ers traded to Orlando on February 7 for Jonathan Simmons and two draft picks. However, the ex-University of Washington star will be going to team practices and games.
Fultz is pleased that Orlando isn't looking to get him back as soon as possible.
"Get right, and everything will take care of itself," he said. "Nobody here is rushing me. Everybody here is just open to me getting right and healthy first."
Those sentiments likely squash any hope of Fultz returning to the team for the regular-season stretch run or playoffs should the 33-38 Magic hop over the 34-36 Miami Heat for the final Eastern Conference postseason spot.
However, that's not particularly important. Fultz is part of an Orlando future built around a young core of Aaron Gordon, Mo Bamba and Jonathan Isaac, all of whom were top-10 overall draft picks.
Current Magic All-Star center Nikola Vucevic may not be part of that future given his upcoming free agency, so the team will need players to somehow make up for this excellent per-game production of 20.7 points, 12.1 rebounds and 3.9 assists.
Fultz would likely play a part of that given his ability to stuff the stat sheet when healthy, as he notably dropped a 13-point triple-double in 25 minutes versus the Milwaukee Bucks last year.
Therefore, Orlando's best bet is to look toward 2019-20 and hope that Fultz is 100 percent for the season. With current starting point guard D.J. Augustin's contract running out in 2020, Fultz could be in line to be the team's starting floor general shortly.
The Maryland native has played 33 regular-season contests in his career and averaged 7.7 points, 3.4 rebounds and 3.4 assists in 20.6 minutes per game. |
<reponame>summerlly/AndroidVideoCache
package com.danikula.videocache;
import java.io.ByteArrayInputStream;
/**
* Simple memory based {@link Source} implementation.
*
* @author <NAME> (<EMAIL>).
*/
public class ByteArraySource implements Source {
private final byte[] data;
private ByteArrayInputStream arrayInputStream;
public ByteArraySource(byte[] data) {
this.data = data;
}
@Override
public int read(byte[] buffer) throws ProxyCacheException {
return arrayInputStream.read(buffer, 0, buffer.length);
}
@Override
public long length() throws ProxyCacheException {
return data.length;
}
@Override
public void open(long offset) throws ProxyCacheException {
arrayInputStream = new ByteArrayInputStream(data);
//noinspection ResultOfMethodCallIgnored
arrayInputStream.skip(offset);
}
@Override
public void close() throws ProxyCacheException {
}
@Override
public Source newSource() {
return new ByteArraySource(data);
}
@Override
public String getMime() throws ProxyCacheException {
throw new IllegalAccessError();
}
@Override
public String getUrl() {
throw new IllegalAccessError();
}
}
|
def okMobility( pdbFile, mobilityCutoff = 2.0 ):
normBfactors = []
OccupancyAndBfactor = []
for line in open(pdbFile):
line = line.strip()
if line.startswith('HETATM'):
OccupancyAndBfactor.append([float(line[54:60]),float(line[60:66])])
occupancy = [a[0] for a in OccupancyAndBfactor]
Bfactors = [a[1] for a in OccupancyAndBfactor]
avgB = np.mean(Bfactors)
avgO = np.mean(occupancy)
pdbFileLines = open(pdbFile).readlines()
nWaters = len(pdbFileLines)-1
logger.debug( 'Number of water molecules: %s' %nWaters )
count = 0
for line in reversed(pdbFileLines):
if line.startswith('HETATM'):
m = ((float(line[60:66])/avgB)/(float(line[54:60])/avgO))
if m >= mobilityCutoff:
count+=1
pdbFileLines.remove(line)
logger.info( 'Water oxygen atoms with a higher mobility than %s: %s: ' % (mobilityCutoff, count))
if count > (nWaters/2):
considerPDB = False
elif count > 0:
outfile = open(pdbFile,'w')
outfile.write("".join(pdbFileLines))
outfile.close()
considerPDB = True
else:
considerPDB = True
if considerPDB:
logger.info( '%s is included in the prediction.' % (pdbFile))
else:
logger.info( '%s is excluded from the prediction.' % (pdbFile))
return considerPDB |
Scene Configuration and Object Reliability Affect the Use of Allocentric Information for Memory-Guided Reaching Previous research has shown that egocentric and allocentric information is used for coding target locations for memory-guided reaching movements. Especially, task-relevance determines the use of objects as allocentric cues. Here, we investigated the influence of scene configuration and object reliability as a function of task-relevance on allocentric coding for memory-guided reaching. For that purpose, we presented participants images of a naturalistic breakfast scene with five objects on a table and six objects in the background. Six of these objects served as potential reach-targets (= task-relevant objects). Participants explored the scene and after a short delay, a test scene appeared with one of the task-relevant objects missing, indicating the location of the reach target. After the test scene vanished, participants performed a memory-guided reaching movement toward the target location. Besides removing one object from the test scene, we also shifted the remaining task-relevant and/or task-irrelevant objects left- or rightwards either coherently in the same direction or incoherently in opposite directions. By varying object coherence, we manipulated the reliability of task-relevant and task-irrelevant objects in the scene. In order to examine the influence of scene configuration (distributed vs. grouped arrangement of task-relevant objects) on allocentric coding, we compared the present data with our previously published data set (). We found that reaching errors systematically deviated in the direction of object shifts, but only when the objects were task-relevant and their reliability was high. However, this effect was substantially reduced when task-relevant objects were distributed across the scene leading to a larger target-cue distance compared to a grouped configuration. No deviations of reach endpoints were observed in conditions with shifts of only task-irrelevant objects or with low object reliability irrespective of task-relevancy. Moreover, when solely task-relevant objects were shifted incoherently, the variability of reaching endpoints increased compared to coherent shifts of task-relevant objects. Our results suggest that the use of allocentric information for coding targets for memory-guided reaching depends on the scene configuration, in particular the average distance of the reach target to task-relevant objects, and the reliability of task-relevant allocentric information. Previous research has shown that egocentric and allocentric information is used for coding target locations for memory-guided reaching movements. Especially, task-relevance determines the use of objects as allocentric cues. Here, we investigated the influence of scene configuration and object reliability as a function of task-relevance on allocentric coding for memory-guided reaching. For that purpose, we presented participants images of a naturalistic breakfast scene with five objects on a table and six objects in the background. Six of these objects served as potential reach-targets (= task-relevant objects). Participants explored the scene and after a short delay, a test scene appeared with one of the task-relevant objects missing, indicating the location of the reach target. After the test scene vanished, participants performed a memory-guided reaching movement toward the target location. Besides removing one object from the test scene, we also shifted the remaining task-relevant and/or task-irrelevant objects left-or rightwards either coherently in the same direction or incoherently in opposite directions. By varying object coherence, we manipulated the reliability of task-relevant and task-irrelevant objects in the scene. In order to examine the influence of scene configuration (distributed vs. grouped arrangement of task-relevant objects) on allocentric coding, we compared the present data with our previously published data set (). We found that reaching errors systematically deviated in the direction of object shifts, but only when the objects were task-relevant and their reliability was high. However, this effect was substantially reduced when task-relevant objects were distributed across the scene leading to a larger target-cue distance compared to a grouped configuration. No deviations of reach endpoints were observed in conditions with shifts of only task-irrelevant objects or with low object reliability irrespective of task-relevancy. Moreover, when solely task-relevant objects were shifted incoherently, the variability of reaching endpoints increased compared to coherent shifts of task-relevant objects. Our results suggest that the use of allocentric information for coding targets for memory-guided reaching depends on the scene configuration, in particular the average distance of the reach target to task-relevant objects, and the reliability of task-relevant allocentric information. Keywords: allocentric reference frames, scene coherence, memory-guided reaching, reliability, target-cue distance INTRODUCTION We constantly interact with objects in our environment, like reaching for a mug or grasping a pen. In order to perform a goal-directed movement, the location of the object has to be encoded in the human brain which is then transformed into a motor plan and read-out by the motor system. The brain makes use of multiple spatial reference frames to localize an object in space (Soechting and Flanders, 1992). Two broad classes of reference frames have been suggested, an egocentric and an allocentric reference frame (Colby, 1998;Klatzky, 1998;). In an egocentric reference frame, object locations are encoded relative to the observer, e.g., relative to the positions of the eyes, the head, or the body. It has been found that egocentric, and in particular gazecentered, reference frames are predominantly used to encode targets for visually-guided reaching movements, but they are also involved in memory-guided movements (Lacquaniti and Caminiti, 1998;Cohen and Anderson, 2002;;Thompson and Henriques, 2011). Besides egocentric coding schemes, allocentric reference frames also contribute to the encoding of movement targets (;Krigolson and Heath, 2004;Obhi and Goodale, 2005;;Byrne and Crawford, 2010). In an allocentric reference frame, object locations are encoded relative to other objects in the environment, background structures, or even imagined landmarks. There is evidence that allocentric coding is stronger for memory-guided than visually-guided reaching movements since they provide more stable, spatial information which can compensate for a rapid decline of visual target information (;Obhi and Goodale, 2005;Hay and Redon, 2006;). However, allocentric coding schemes do also contribute to visually-guided reaching (Taghizadeh and Gail, 2014) supporting the notion of a combined use of egocentric and allocentric reference frames for visuallyguided and memory-guided reaching movements. Previous work on allocentric coding of reach targets mainly used simple and abstract stimuli, like LED light dots or bars, lacking ecological validity of the outcomes. In order to study allocentric coding of reach targets in more naturalistic scenarios, recent work from our lab applied naturalistic 2D images of complex scenes (;) or 3D virtual reality (). In these experiments, we presented naturalistic images of a breakfast scene containing multiple objects on a table and in the background. Participants were instructed beforehand that either table or background objects function as potential reach targets and thus, are relevant for the task. Participants first encoded the scene with free gaze and after a short delay they briefly viewed a test scene with one of the task-relevant objects missing indicating the reach target location. After the test scene vanished, participants performed a reach to the remembered location of the missing object on a gray screen while gaze was fixed. Besides removing one object from the test scene, we also shifted some of the remaining objects either to the left or to the right. We found that reaching endpoints systematically deviated into the direction of object shifts, but only when task-relevant objects were shifted. When we shifted task-irrelevant objects that never became a reach target, reaching endpoints remained unchanged compared to a control condition with no object shifts. Because reaching endpoints were lying between the actual target location in the encoding scene and the target location relative to the shifted objects, we suggested that allocentric and egocentric information is integrated for memory-guided reaching. However, since we only varied the allocentric information by shifting the objects and kept most of the potential egocentric coding schemes constant (e.g., eyes, head or body), we cannot determine which egocentric information has been used in this task. One of our main findings was that only objects relevant for reaching served as potential landmarks and were used for allocentric encoding the target location. Thus, objects' task-relevance is an important factor determining whether they are used as allocentric cues or not. This is in line with previous findings showing that task relevance of objects in a scene leads to more and longer fixations on taskrelevant objects (e.g., Ballard and Hayhoe, 2009) and can improve the detection of changes of object properties () and their retention in visual working memory (Maxcey-Richard and Hollingworth, 2013). In our experiments so far (;), task-relevant objects were located either on the table or in the background forming a spatial cluster that was separated from the cluster containing task-irrelevant objects (see Figure 1). As indicated by the fixation behavior, this spatial arrangement influenced participants' encoding strategies in a way that their overt spatial attention was mainly directed to the relevant object cluster while ignoring the area containing the irrelevant objects (see fixation density maps, Figure 1). The question arises whether spatial grouping of task-relevant information facilitates allocentric coding and thus, would be impeded if task-relevant objects are distributed across the whole scene. Moreover, spatial grouping of objects in task-relevant table or background objects also led to a smaller mean distance between the reach target and the task-relevant than taskirrelevant objects. There is evidence that with an increasing distance between target and landmark (i.e., allocentric cue), the landmark becomes less effective (;). Furthermore, endpoints of pointing movements are most affected by the closest landmark if multiple landmarks are available (Spetch, 1995;). In this study, we aimed to examine the influence of the scene configuration by randomly placing task-relevant objects on the table and in the background within the same scene. By doing so, we not only increased the mean distance from the target to the taskrelevant objects but at the same time also reduced the mean distance from the target to the task-irrelevant objects which also occurred in close proximity to the target comparable to the task-relevant ones. Based on the findings reported above, we predict a decreased contribution of allocentric information for spatial coding of reach targets compared to our previous study (), in which task-relevant objects were spatially grouped and therefore, placed in closer vicinity to the target than task-irrelevant objects. Beyond the scene configuration, the reliability of allocentric cues might be an important factor determining their use for FIGURE 1 | Fixation density maps adapted from Klinghammer et al. containing examples images of the stimuli. In (A), only objects on the table served as reach targets (task-relevant objects) and formed a spatial object cluster which is spatially distinct from the irrelevant objects in the background. As a result, participants mainly fixated this area while ignoring the background. In (B), only objects in the background served as reach targets and formed an object cluster. Consequently, we observed the reversed fixation pattern. coding reach targets in space. Byrne and Crawford investigated the influence of the reliability and stability of landmarks on allocentric coding of target locations for memoryguided reaching. Landmarks consisted of four dots that were arranged in an imagined square around a target dot. They varied their stability and reliability by manipulating the amplitude of the dots' vibration. The authors hypothesized that with increasing the vibration amplitude the landmark stability and reliability should decrease and thus, the weighting of the allocentric information, should also decrease. As expected, they found a larger influence of low vibrating landmarks on directionindependent reaching endpoints compared to landmarks with high vibration amplitude; however, there was no effect on the variability of reaching endpoints. The authors concluded that landmark stability influences the weighting of the allocentric information. This is in line with previous studies on memoryguided reaching showing that humans preferably use stable and reliable landmarks leading to increased reaching endpoint accuracy (Krigolson and Heath, 2004;Obhi and Goodale, 2005). Similar results have been reported for changes in spatial object configurations influencing the reliability of allocentric cues. For example, when asking participants to detect a shift of one of multiple objects from an encoding to a probe display they were more accurate in conditions in which the objects were shifted coherently in one direction (minimal change) than they were arranged in a new, random fashion (maximal change) (). This suggests that the global configuration of objects in the display was taken into account and used for representing the single objects' location. The second goal of this study was to examine whether and how the reliability of task-relevant and task-irrelevant objects, i.e., the reliability of allocentric information, affects the use of objects as allocentric cues. We define reliability of allocentric information as the stability of objects in a scene, i.e., whether they are shifted coherently (stable/reliable) or incoherently (unstable/unreliable). We expect that breaking up the coherence of the spatial object configuration due to incoherent object shifts, the reliability of these objects and thus, their contribution to allocentric coding of reach targets should decrease. In the current study, we used naturalistic images, similar to the ones published by Klinghammer et al., to study the role of the scene configuration and the object reliability on allocentric coding of target locations for memoryguided reaching. For answering the first question, we distributed task-relevant and task-irrelevant objects across the whole scene preventing spatially distinct clusters. Based on our previous findings (), we expected systematic deviations of reaching endpoints in the direction of task-relevant but not of task-irrelevant object shifts. However, reach endpoint deviations resulting from task-relevant object shifts should be smaller than the ones we observed by Klinghammer et al. due to the increased distance between the target and the taskrelevant objects and/or the placement of task-irrelevant objects in closer proximity to the potential reach targets. In order to answer the second question, we manipulated the reliability of taskrelevant and task-irrelevant objects by introducing conditions where we either kept the coherence of the whole object arrangement intact (coherent object shift direction) or broke it up (incoherent object shift direction). We expected that systematic deviations of reaching endpoints in the direction of object shifts are larger in the condition with high (intact coherence) than low (broken coherence) object reliability. Assuming that task-irrelevant objects are widely ignored and thus, unused for allocentric coding of memorized reach targets (), reach endpoint deviations in the direction of object shifts should be strongly influenced by the reliability of task-relevant objects, but hardly affected by the reliability of task-irrelevant objects. In particular, we expected an effect of object shifts on reaching endpoints in conditions in which we kept the scene coherence within the group of task-relevant objects intact, which should strongly decrease when we shifted task-relevant objects incoherently. In contrast, we expected a substantially reduced influence of object shifts in conditions when task-irrelevant compared to task-relevant objects are shifted alone regardless of the coherence manipulation. Participants We recorded data from 22 participants. Four of them had more than 30% of trials without correct fixation and thus, were excluded from further analysis. For one additional participant, we failed to measure reach endpoints or correct fixation behavior in more than 60% of trials and therefore discarded the data from further analysis. The final sample consisted of 17 participants (8 female) with normal or corrected to normal vision ranging in age from 19 to 30 years (mean 25 ± SD 3.2 years). They were right-handed as assessed by Edinburgh handedness inventory (EHI, Oldfield, 1971; mean handedness quotient 78 ± SD 18.8). They received course credit or were paid for their participation. The experiment was approved by and conducted in agreement with the ethical guidelines of the local ethics committee of the University of Giessen in compliance with the Declaration of Helsinki 1. Each participant signed the ethics form before the start of the experiment. Apparatus Stimuli were presented on a 19 (40.5 30 cm) CRT monitor (Ilyama Vision Master Pro 510) with a resolution of 1280 960 pixels and a refresh rate of 85 Hz. To reduce the influence of a high-contrast frame around the scene, a black cardboard (70 50 cm) frame was attached to the monitor. Participants sat at a table with their head stabilized on a chin rest with a distance of roughly 47 cm from the eyes to the center of the screen. A decimalkeyboard was placed in front of the subjects with the start button 24 cm away from the screen and aligned to the chin rest and the center of the screen. Reaches were performed with the right index finger and recorded with an Optotrak Certus (NDI, Waterloo, Ontario, Canada) tracking system with a sampling rate of 150 Hz using one infrared marker attached to the fingertip of the right index finger. To control for correct fixation behavior, eye movements were recorded using an EyeLink II system (SR Research, Osgoode, Ontario, Canada) with a sampling rate of 500 Hz. To run the experiment and to control the devices we used Presentation 16.5 (Neurobehavioral Systems, Inc., Berkeley, CA). Materials Stimuli consisted of 3D-rendered images of a breakfast scene. Images were created in SketchUp Make 2015 (Trimble Navigation Ltd., Sunnyvale, CA) and afterwards rendered with Indigo Renderer 3.8.21 (Glare Technologies Ltd.) with a resolution of 3562 2671 pixels. The breakfast scene contained 5 objects consisting of a coffee mug, a plate, an espresso cooker, a Vegemite jar, and a butter dish placed on a brownish table that stood 86 cm in front of a gray wall. Furthermore, 6 objects, consisting of a chair, vase, painting, calendar, clock, and ceiling lamp were located behind the table in the background. Objects were taken from the open access online 3D-gallery of SketchUp. Object properties are summarized in Table 1. We set all objects in 18 different arrangements (encoding image). They were placed so that < 20% of an object was occluded by another object and with a distance to the edges of the table or the image so that in case of object displacement no object stood in the air next to the table or outside of the image. In any arrangement, objects on the table were placed at one of three possible horizontal depth lines that were equally spaced (19.5 cm starting from the front table edge) on the table with minimal 1 and maximal 2 objects positioned at every depth line. The painting, calendar and clock were placed at three different heights at the wall with 1 object placed at every height level, and the calendar never placed on the highest level in order to minimize unrealistic object arrangements in the scene. The distance of the low height from the ground was 107.55 cm, of the middle height 126.38 cm and of the high height 145.20 cm. Distances from the height levels to the camera were 278.97, 279.51, and 281.30 cm for the low, middle, and high height, respectively. The positions of the vase, chair, and ceiling lamp were fixed on one horizontal line for each object in different distances to the camera (see Table 1). Based on the encoding images, we created test images, in which 1 of 6 pre-defined objects (3 table objects and 3 background objects) was missing (= reach target). These 6 predefined objects served as potential reach targets and thus, were highly relevant to perform the task . The remaining 5 objects never served as reach targets and thus, were task-irrelevant . In 2/3 of the test images, objects (RO and/or IO) were shifted horizontally between 3.56 and 4.47 (mean 3.86 ± SD 0.33 ) either to the left or to the right (50% leftward displacement) in the same (= coherent object shift) or in opposite directions (= incoherent object shift). Variations in the horizontal object displacement arose from the fact that objects were placed at different depth lines relative to the Objects on the table, painting, calendar and clock had no fixed distance to the camera because they were randomly placed on one of three different depth lines on the table or their position altered on three different height levels at the wall, respectively. Some background objects were sometimes not fully visible due to object overlap. Therefore, visible heights may vary from the actual height depending on the object arrangement. Frontiers in Neuroscience | www.frontiersin.org virtual camera position. Hence, similar physical shifts of objects at different depth lines in 3D-space would result in different displacements in the 2D-image. In the remaining 1/3 of the test images, no objects were shifted. These images served as control condition. In total, 360 images were rendered, including 18 encoding images, 228 test images (76 with only RO shifts, 76 with only IO shifts, 76 with RO and IO shifts) and 114 control images. Moreover, from each of the 18 encoding images, a scrambled version made up of 768 randomly arranged squares of the image was created and used to mask the encoding image. Procedure Participants first read a written instruction about the experimental procedure informing about the RO and their function. Afterwards, they performed a learning block in which the 6 RO were presented together on the computer screen and participants were requested to memorize these objects without time restriction. Next, a picture of only one RO or IO was presented and participants were asked to indicate by button press whether this object was a potential reach target or not. After feedback about the correctness of the response was given, the next picture with a different object appeared on the screen. This was repeated until every object was presented once. The learning block ended if participants correctly classified the presented objects as potential reach target for at least three times in a row. Then, the experiment started after some training trials. The procedure of an example trial is depicted in Figure 2. Before every trial, a fixation cross on a gray screen appeared prompting participants to fixate and press a button in order to perform a drift correction for the EyeLink II. Thereafter, the trial started with the presentation of the encoding image of the breakfast scene. Participants freely explored the scene without any time constraints and terminated the encoding phase by pressing the start button. Then, a scrambled version of the encoding scene appeared for 200 ms to avoid afterimages followed by a delay phase of 800 ms with a gray screen and a central fixation cross. Participants were instructed to fixate the cross until the end of the reaching movement in order to control for changes in gaze-centered, egocentric coding due to eye-movements (Thompson and Henriques, 2011). After the delay, the test image was presented for 1300 ms which lacked 1 RO defining the reach target. The trial continued with a short tone after the test image vanished which signaled the participants to perform the reaching movement toward the remembered location of the target object onto a gray screen. Thus, reaches were performed with gaze kept on the fixation cross and without any visual information of the encoding or test images. In this way we ensured that allocentric information could not be used for subsequent online corrections during the reaching movement, which would have led to an allocentric bias. Participants were instructed to reach to the location of the missing object as accurately and natural as possible. Whenever they were unsure about the target location or identity, they had to reach to a marked location at the lower right edge of the monitor. These invalid trials were repeated at the end of the experiment. If subjects released the button before the go-signal, they received feedback and these invalid trials were also repeated at the end of the experiment. Participants performed six experimental conditions (for examples, see Figure 3). In all experimental conditions, 1 of 6 RO was always removed from the test image, which served as the reach target. In the RO same condition, the remaining 5 RO were shifted either to the left or to the right. In the IO same condition, all 5 IO were shifted left-or rightward. In the RO diff or IO diff condition, the 5 relevant or the 5 irrelevant objects were shifted in different directions with 3 objects displaced in one and the remaining 2 objects in the opposite direction, i.e., 3 objects shifted rightward and 2 leftward or vice versa. The direction in which 3 objects were shifted is regarded as the main shift direction. In the RO+IO same condition, all relevant and irrelevant objects were shifted in the same direction, whereas in the RO+IO diff condition all relevant objects were shifted in the opposite direction of all irrelevant objects. How these different conditions influence the overall scene coherence and the coherence within the group of task-relevant objects is summarized in Table 2. In all FIGURE 2 | Trial scheme of one example trial (control condition). (A) First, the encoding image was presented and participants terminated the exploration of the image by button press. (B) Then, a scrambled version of the encoding image was presented for 200 ms, followed by (C) a delay which lasted for 800 ms. (D) Thereafter, the test image with one of the task-relevant objects missing (butter dish) was presented for 1300 ms before (E) a tone prompted participants to reach to the target onto a gray screen while fixating the cross at the center of the screen. conditions, left-and rightward object shifts were balanced with 50% of trials in each direction; the same accounts for the direction of the main object shift in the conditions RO diff and IO diff. In the control condition, all objects remained stationary. Each participant completed a minimum of 648 trials. Because some trials were repeated (criteria see above), the actual number of performed trials varied from 651 to 736 trials. Trials were separated in three sessions with one session per day which lasted about 1 h with one break in between. At the start of each session and after each break, the EyeLink II system was recalibrated. Trials were presented in pseudo-randomized order with a random sequence of conditions and encoding images within a session but fixed trial combinations between sessions. A trial was never followed by a trial containing the same encoding image. Every trial was repeated one time. Data Reduction and Statistical Analysis Data preprocessing was performed with MATLAB R2012a (The MathWorks Inc., Natick, MA) and inferential statistics with R 3.1 (R Development Core Team, http://www.r-project. org). All statistical tests were computed with an alpha-level of 0.05 after testing for normality (Kolmogorov-Smirnov test) and similarity of variances (Bartlett's test for planned t-tests, Mauchly's sphericity test for planned ANOVAs). If correction for multiple testing was necessary, Bonferroni-Holm correction was applied by multiplying the sorted p-values with the number of remaining tests. In case variances between samples were not equal, we used Welch approximation to the degrees of freedom for the t-tests and Greenhouse-Geisser correction for the ANOVAs. Effect sizes were calculated by using Hedges g for t-tests and the generalized Eta-Squared for ANOVA in case of significant results. As a first step, we tested whether the group of relevant objects is different from the group of irrelevant objects regarding their saliency, which could have affected participant's attention, and thus, their encoding and reaching behavior. Therefore, we determined the mean saliency for every object in every encoding image by calculating the mean Graph-Based Visual Saliency (gbvs; ;) of these objects. Next, we split these saliencies into two groups of relevant and irrelevant objects and averaged the mean saliencies for every object. After this, we entered the mean saliencies of these groups into a two-sided t-test. Then, we inspected the eye tracking data and discarded trials from further data analysis in which subjects' gaze deviated more than 2.5 from the center of the fixation cross during a period beginning from delay onset till the end of the reaching movement. All in all 724 trials (6.57%) were rejected due to bad fixation. Second, reaching onsets and offsets were defined for every trial. The moment participants released the response button determined the reaching onset. Reach offsets were calculated from Optotrak data and defined as the first time point during the movement when velocity dropped below 20 mm/s if the index finger reached a maximum distance of about 3 cm from the screen. Reach endpoints were extracted at the time of reach offset. Some trials were excluded because reaching offsets or endpoints could not be extracted due to rarely occurring interferences of the infrared markers of the Optotrak with the IREDs of the EyeLink II (134 trials = 1.3%). Third, we excluded trials in which reaching endpoints deviated more than ± 2.5 SD in horizontal or vertical direction from the group mean in each condition for each object shift direction (534 trials = 5.26%). Taken together, from originally 11.016 trials of all participants, 9.624 valid trials (87.36%) remained. To investigate the influence of object shifts (i.e., allocentric information) on reaching endpoints, we calculated allocentric weights for every subject and every condition by linear regression fit with an intercept set to zero. First, we determined reaching errors as the horizontal distance of the reach endpoint and the actual target position of the encoding image. Therefore, we averaged reach endpoints of the control condition of all subjects for every combination of object arrangements and target objects separately. Since none of the remaining objects were displaced in the control condition, we assume no systematic reaching errors. These averaged reach endpoints were used to define the target positions. Then, we calculated the differences of the reaching endpoints of the other experimental conditions from the corresponding target position in the horizontal plane. This resulted in positive values for reaching errors to the right and negative values for reaching errors to the left. In the next step, we determined maximal expected reaching errors (MERE) for every image after an object shift by assuming that participants completely relied on the allocentric information of the shifted objects (i.e., the information about the target location that is given by the surrounding non-target objects that were shifted) and thus produced reaching endpoints equal to the amount of the objects' displacement. To this end, we averaged the amount of displacement of the shifted objects for every image. If objects were shifted in different directions, we either averaged over the shift distances of only relevant objects (RO+IO diff) or averaged over the main shift direction (RO diff, IO diff). For the regression fit with a fixed intercept at zero, the MERE was used as a predictor and the actual reaching error as a dependent variable for the two shift directions within one condition for every subject. The resulting slope of the regression line indicated the extent to which a participant relied on the allocentric information of object displacements and thus was defined as allocentric weight. Therefore, an allocentric weight of 0 would indicate no use of the allocentric information of the shifted objects (equal to the no-shift control condition), whereas an allocentric weight of 1 would indicate a full use of the allocentric information of the shifted objects. These weights were determined across the two shift directions separately for every participant and every condition and then entered into further analyses. To investigate the influence of object shifts on the variability of reaching endpoints, we calculated standard deviations of reaching errors (in cm) for every participant in every condition. To account for the fact that reaching errors to the left had negative and reaching errors to the right had positive values, we calculated standard deviations for the two shift directions separately and averaged the data afterwards. To investigate whether participants used a different encoding behavior with respect to their focus of overt visual attention compared to our previous experiments (), we created fixation density maps of participants' fixation behavior during the encoding phase. To this end, we calculated a mean fixation point for every fixation starting from the second fixation until the end of the encoding phase. To examine whether participants fixated relevant objects more often than irrelevant objects, we collapsed fixations of the different object arrangement scenes resulting in 18 different heatmaps. We then visually inspected the heatmaps and descriptively compared them to the ones of our previous study (). Next, we performed two-sided one-sample t-tests to investigate whether the group allocentric weights of the different conditions differed significantly from zero. To investigate whether the scene configuration influenced the use of the allocentric information for memory guided reaching, we performed two-sided t-tests for independent samples on allocentric weights from the RO same condition of the current study and the corresponding conditions (conditions when five task-relevant objects were shifted in the same direction) of our previous study published by Klinghammer et al.. In order to assess the impact of scene coherence and thus, the reliability of allocentric cues on reaching endpoints and their variability, we first conducted two-sided one-sample t-tests for the allocentric weights and standard deviations of reaching errors for the conditions RO+IO same and RO+IO diff. Second, we performed a two-way repeated measures ANOVA for conditions RO same, RO diff, IO same, and IO diff with the two factors shift coherence (same or different shift direction) and object relevance (shifted objects are potential reach targets or not). In case of significant main effects or interactions, we conducted two-sided post-hoc t-tests for paired samples. RESULTS First, we tested for differences in the saliency between taskrelevant and task-irrelevant objects. Therefore, we determined the mean gbvs for every object of all encoding images and compared these mean saliency values between task-relevant and task-irrelevant objects. We found normally distributed (K-S test: ps > 0.765) mean saliency values that did not differ between taskrelevant and task-irrelevant objects . Thus, it is unlikely that participant's encoding and reaching behavior was affected by different object saliencies between these two groups. To investigate the participants'encoding behavior, we created fixation density maps of the encoding scene for every object arrangement. As an example, we depict one representative heatmap for one exemplary object arrangement in Figure 4. FIGURE 4 | Fixation density map with averaged fixations of all participants during the encoding phase for one example object arrangement. On the right side, the task-relevant objects of the experiment are depicted (butter dish, ceiling lamp, clock, espresso cooker, vase, Vegemite jar). Participants show higher fixation frequencies for these task-relevant objects than for the remaining task-irrelevant objects. Fixation density was highest at the locations of task-relevant objects (butter dish, ceiling lamp, clock, espresso cooker, vase, Vegemite jar) whereas it was lower at locations of task-irrelevant objects. The heatmaps of the other object arrangements showed a very similar pattern. In Figure 5, we illustrate reaching errors of one exemplary participant in the different conditions averaged over the 18 object arrangements. Reaching endpoints in conditions RO same and RO+IO same deviated systematically in the direction of object shifts. RO diff and RO+IO diff also showed horizontal reaching errors, but these errors were independent of the direction of object shifts. The conditions IO same and IO diff hardly demonstrated deviations of reaching endpoints indicating that in these conditions object shifts had a negligibly influence on reaching behavior. Figure 6A depicts the actual reaching errors and the corresponding MERE of one prototypical participant for the condition RO same for leftward (negative values) and rightward (positive values) object displacements. The slope of the regression line defined the allocentric weight of the respective condition. Allocentric weights of all participants were distributed normally in every condition (K-S test: ps > 0.335). On the group level, allocentric weights of RO same and RO+IO same significantly differed from zero , whereas allocentric weights of the other conditions did not (Table 3). In order to examine the role of the scene configuration on allocentric coding of reach targets, we compared the allocentric weights of the condition RO same with the corresponding conditions of the previously published experiments (), in which we also shifted five task-relevant objects. We found smaller allocentric weights for the current experiment in which task-relevant and task-irrelevant objects were distributed across the entire scene compared to the previous experiments in which task-relevant and task-irrelevant objects were clustered . To assess the influence of the reliability of task-relevant and task-irrelevant objects on their use for allocentric coding, we compared conditions with coherent and incoherent shifts of task-relevant and/or task-irrelevant objects. The results of the allocentric weights and the standard deviations of the reaching endpoints are illustrated in Figure 7. The K-S test also revealed normally distributed standard deviations of reaching errors (ps > 0.446). First, we performed a two-sided one-sample t-test for the allocentric weights and standard deviations of the conditions RO+IO same and RO+IO diff in which we shifted both task-relevant and task-irrelevant objects. We found that allocentric weights differed between the conditions showing higher allocentric weights when task-relevant and task-irrelevant objects were shifted coherently in the same direction than shifted incoherently in opposite directions. The standard deviations did not differ between RO+IO same and RO+IO diff . Additionally, we compared allocentric weights of RO same and RO+IO same and found that allocentric weights were higher when task-relevant and task-irrelevant objects were shifted together in the same direction than when task-relevant objects were shifted alone . Second, we conducted a two-way repeated measures ANOVA for the conditions RO same, RO diff, IO same, and IO diff. We found a main effect of shift coherence [F = 7.399, p = DISCUSSION In this study, we investigated the use of allocentric information for memory-guided reaching by using naturalistic, complex scenes which are closer to real-life situations than simple laboratory task using abstract stimuli. In particular, we aimed to investigate how the scene configuration influences allocentric coding of target locations for memory-guided reaching. Second, we wanted to know whether and how the reliability of allocentric information, in particular the reliability of task-relevant and taskirrelevant objects, affects their use as allocentric cues. We found that reaching errors systematically deviated in the direction of object shifts, but only when the objects were task-relevant. However, this effect was substantially reduced when task-relevant objects were distributed across the scene compared to a clustered configuration used in our previous study (), and vanished completely when their reliability was low, i.e., they were shifted incoherently. No deviations of reach endpoints were observed in conditions with shifts of only taskirrelevant objects. Moreover, when solely task-relevant objects were shifted incoherently, the variability of reaching endpoints increased compared to coherent shifts of task-relevant objects. In order to check whether participants' encoding strategies differed depending on the scene configuration, we created fixation density maps with mean fixation densities for every object arrangement during the encoding phase and compared it to the ones in our previous studies (;). Here, we observed that taskrelevant objects were fixated more frequently than task-irrelevant objects. This supports our previous findings (;) showing that overt visual attention is mainly distributed across areas containing taskrelevant information. Thus, participants used the same encoding strategy irrespective of whether the task-relevant objects were clustered or distributed across the scene. Our results are in line with previous work on overt visual attention showing that participants' fixation behavior is highly task-dependent with more fixations on task-relevant objects (Land and Hayhoe, 2001;Ballard and Hayhoe, 2009;DeAngelus and Pelz, 2009). Overall, we found allocentric weights different from zero (= no-shift control condition) in the RO same and RO+IO same conditions suggesting that allocentric information of taskrelevant objects was used to encode target locations for memoryguided reaching. Allocentric weights in these conditions ranged from 0.13 to 0.20 (see Table 3) which indicates that reaching endpoints were affected by up to 20% by the shifted taskrelevant objects. The remaining percentage could be attributed to the influence of egocentric or additional allocentric reference frames as the environment also provided other, more stable landmarks, e.g., edge of the screen, edge of the black cardboard, or the physical table. In comparison to our previous experiments (;), allocentric weights were relatively small, which was confirmed by the statistical comparison of the RO same condition of the current experiment to the corresponding conditions of our previous experiment (), in which we also coherently shifted five task-relevant objects. A main difference between these experiments is the spatial configuration of taskrelevant and task-irrelevant objects which were distributed in the current and grouped in the previous experiments. On the first view, the lower allocentric weights for the distributed object configuration seem to confirm other findings showing that participants preferably rely on landmarks in the direct vicinity of the target (Spetch, 1995;). By placing task-irrelevant objects as close to the target as taskrelevant ones, the former may have served as additional but misleading allocentric cues. However, we found that task-relevant but not task-irrelevant objects differed from zero suggesting that task-relevancy but not landmark vicinity determined to which extent objects were used as allocentric cues. This is also supported by the lower reaching endpoint variability in the condition IO same (mean = 1.693) than RO same (mean = 2.271). Moreover, the fixation behavior during the encoding phase indicates that participants actually ignored task-irrelevant objects and mainly focused on task-relevant ones. In contrast to clustering the objects on the table or in the background, the distributed object configuration we applied here also increased the distance between the target and the task-relevant objects that may have decreased their use as allocentric cue. This is in line with previous findings which show that the influence of allocentric information decreases with an increasing distance between target and landmarks (;). However, we cannot exclude an impact of an overall lower reliability of the allocentric information in the current experiment that arises from the trial randomization as discussed earlier. By introducing conditions in which we shifted objects coherently in the same direction or incoherently in opposite directions, we were aiming to gain insights on how the reliability of allocentric information affects its use for encoding target locations for memory-guided reaching. As expected, we found the highest allocentric weights in the condition in which the coherence of the object relations was maintained between the encoding and the test scene (RO+IO same). Surprisingly, by shifting task-irrelevant objects in the opposite direction of task-relevant ones (RO+IO diff), the allocentric weights were dramatically reduced and did not differ from zero. Even though these objects were task-irrelevant and thus, could be ignored, they had a clear impact on the use of task-relevant objects as allocentric cues. It is likely that by breaking up the coherence of the whole object arrangement, the reliability of the allocentric information was reduced and as a consequence, participants rather relied on egocentric or other, more stable allocentric information. Alternatively, this pattern could be explained by shifts of task-relevant and task-irrelevant objects in opposite directions canceling each other out instead of affecting the overall reliability of allocentric information. If this was true, we would expect similar effects on reach endpoints if we coherently shifted solely task-relevant and solely task-irrelevant objects, because they should have a similar impact on reaching endpoints and thus cancel each other out. However, this was clearly not the case. We observed no influence on reaching endpoints when we solely shifted task-irrelevant objects, but found a clear influence when we solely shifted task-relevant objects. Therefore, we believe that the observed pattern in the RO+IO diff condition cannot be explained by cancelation effects of task-relevant and task-irrelevant object shifts; rather results are consistent with a decrease of the overall reliability of allocentric information. We found a similar pattern of results when we shifted only task-relevant objects in the same or in different directions (RO same, RO diff). As predicted, allocentric weights were higher when the coherence within the group of task-relevant objects was kept intact compared to the condition in which it was broken with allocentric weights being not different from zero. Again, this finding supports a stronger use of allocentric information when its reliability is high. In contrast to the findings by Byrne and Crawford, we found a higher variability of reaching endpoints for low compared to highly coherent object configurations. This further strengthens an important role of the reliability of taskrelevant allocentric information for encoding target locations for memory-guided reaching movements. Interestingly, we observed increased allocentric weights for RO+IO same compared to RO same. Even though, a coherent shift of irrelevant objects alone had no influence on reaching endpoints (i.e., no difference of IO same from zero), they may have increased the overall object reliability when they were shifted coherently with task-relevant objects. All in all, it can be concluded that if the reliability of only task-relevant objects is decreased, their use as allocentric cues is substantially reduced. Even though, task-irrelevant objects are not directly used as allocentric cues, they seem to increase the overall contribution of allocentric information by increasing the objects'reliability when shifted coherently with task-relevant objects. Our results could be explained within the framework of causal Bayesian integration (;) in which two different target modalities are combined in a Bayes-optimal way. This framework further assumes that the weightings of the target modalities are modulated by the probability of both sharing one source or not. Transferred to our paradigm it is reasonable that by shifting objects in an incoherent manner, the causal link between the target location and positions of the other objects (in terms of their incoherent spatial relation) is broken. In that case, causal Bayesian integration discounts the allocentric information by the remaining non-target objects leading to a low weighting of the allocentric information. Moreover, in incoherent shift conditions the variability associated with the allocentric information increases, which in turn further decreases its weighting. In contrast, if objects are shifted in a coherent way, the causal link between the location of the target and the other objects is maintained leading to a lower variability and thus, higher weighting of the allocentric information. Overall, our findings demonstrate that the use of allocentric information for memory-guided reaching depends on taskrelevancy and the scene configuration, in particular the average distance of the reach target to task-relevant objects. If task-relevancy is given, the reliability of allocentric information determines to which extent allocentric cues are used to encode the location of memorized reach targets. Less reliable allocentric cues contribute to a lesser extent and lead to an increased variability of memory-guided reaching movements. However, the reliability of task-relevant allocentric information seems to be further increased by task-irrelevant allocentric cues if they act coherently. Finally, our results demonstrate that by using more naturalistic, complex stimuli containing a variety of environmental information, new insights into the use and nonuse of allocentric information for encoding target locations for memory-guided reaching movements can be found. ETHICS STATEMENT Local ethical committee of the Justus-Liebig-University Giessen approved the ethic form #2015-00200, October 28 2015. Each participant signed the ethic form before the start of the experiment. AUTHOR CONTRIBUTIONS MK designed experiment, collected and analyzed data, wrote manuscript. GB designed experiment, wrote manuscript. KF designed experiment, wrote manuscript. |
Traditional vs. Critical Service-Learning: Engaging the Literature to Differentiate Two Models There is an emerging body of literature advocating a "critical" approach to community service learning with an explicit social justice aim. A social change orientation, working to redistribute power, and developing authentic relationships are most often cited in the literature as points of departure from traditional service-learning. This literature review unpacks these distinguishing elements. ********** A growing segment of the service-learning literature in higher education assumes that community service linked to classroom learning is inherently connected to concerns of social justice (Delve, Mintz, & Stewart, 1990; Jacoby, 1996; Rosenberger, 2000; Wade, 2000; 2001; Warren, 1998). At the same time, there is an emerging body of literature arguing that the traditional service-learning approach is not enough (Brown, 2001; Butin, 2005; Cipolle, 2004; Marullo, 1999; Robinson 2000a, 2000b; Walker, 2000). This literature advocates a "critical" approach to community service learning with an explicit aim toward social justice. Referencing the service-learning literature, I unpack the elements that distinguish a critical service-learning pedagogy. In reviewing the literature, I was challenged by an unspoken debate that seemed to divide service-learning into two camps--a traditional approach that emphasizes service without attention to systems of inequality, and a critical approach that is unapologetic in its aim to dismantle structures of injustice. The three elements most often cited in the literature as points of departure in the two approaches are working to redistribute power amongst all participants in the service-learning relationship, developing authentic relationships in the classroom and in the community, and working from a social change perspective. I wanted to understand and make clear the differences in these approaches and what they might look like in practice. How might the curriculum, experiences, and outcomes of a critical service-learning course differ from a traditional service-learning course? The critical approach re-imagines the roles of community members, students, and faculty in the service-learning experience. The goal, ultimately, is to deconstruct systems of power so the need for service and the inequalities that create and sustain them are dismantled. This article uses perspectives from the literature to uncover and explicate the meaning of a critical service-learning view. In discussing each of the three distinguishing elements of the critical service-learning approach, I examine the classroom and community components. Traditional vs. Critical Service-Learning Community service learning "serves as a vehicle for connecting students and institutions to their communities and the larger social good, while at the same time instilling in students the values of community and social responsibility" (Neururer & Rhoads, 1998, p. 321). Because service-learning as a pedagogy and practice varies greatly across educators and institutions, it is difficult to create a definition that elicits consensus amongst practitioners (Bickford & Reynolds, 2002; Butin, 2005; Kendall, 1990; Liu, 1995; Varlotta, 1997a). However, I use the terms service-learning and community service learning to define a community service action tied to learning goals and ongoing reflection about the experience. The learning in service-learning results from the connections students make between their community experiences and course themes. Through their community service, students become active learners, bringing skills and information from community work and integrating them with the theory and curriculum of the classroom to produce new knowledge. At the same time, students' classroom learning informs their service in the community. Research heralds traditional service-learning programs for their transformative nature--producing students who are more tolerant, altruistic, and culturally aware; who have stronger leadership and communication skills; and who (albeit marginally) earn higher grade point averages and have stronger critical thinking skills than their non-service-learning counterparts (Astin & Sax, 1998; Densmore, 2000; Eyler & Giles, 1999; Kezar, 2002; Markus, Howard, & King, 1993). |
Carmen Magallón
Carmen Magallón-Portolés is a PhD, a physicist, and Master in Philosophy of Science by University of Zaragoza, Spain, committed with the advancement of women through researching their contributions to two important fields: science and peace. Her thinking is an important reference in the Spanish studies of Women in Science and Feminist Pacifism. Among her works in this field: Mujeres en pie de paz, Madrid, Siglo XXI, 2006 and Contar en el mundo. Una mirada sobre las relaciones internacionales desde las vidas de las mujeres, Madrid, Horas y horas, 2012.
In 2011 she was elected President of WILPF Spain, the Spanish section of the Women's International League for Peace and Freedom. In September 2013, the Martin Luther King Institute of the Polytechnic University of Nicaragua (UPOLI), in the celebration of its 20th anniversary awarded her the 'Order of Peace Martin Luther King': "for her outstanding contribution to the development of women's rights, the feminist thought and the construction of a culture of peace in the world". At the ceremony, Dr. Magallón presented the keynote: "Universalize female legacies, build a civilizatory rationality: steps towards a culture of peace". The Instituto Martin Luther King (IMLK) is part of the UPOLI, a Nicaraguan university located in Managua. Its main objective is to build a culture of peace.
Women contributions to science and peace
The recovery of the history of women, their experiences and their knowledge is a must for building a gender equality. In particular, it is important to deepen the knowledge of Women in science. Much of the literature on this subject comes from the Anglo-Saxon world. This article wants to add the perspective of women scientists in Spain, through the writings published by Carmen Magallón. Most of her works are included in the data basis Dialnet, University of La Rioja, Spain.
External link
Media related to Carmen Magallón (physicist) at Wikimedia Commons |
<filename>momock-ext-holo/src/com/momock/holo/widget/ListPopupWindowCompat.java<gh_stars>1-10
/*
* Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.momock.holo.widget;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.Resources.Theme;
import android.content.res.TypedArray;
import android.database.DataSetObserver;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Handler;
import android.util.AttributeSet;
import android.util.Log;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.MeasureSpec;
import android.view.View.OnTouchListener;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.widget.AbsListView.LayoutParams;
import android.widget.AdapterView;
import android.widget.LinearLayout;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.PopupWindow;
import com.momock.ext.holo.R;
/**
* A ListPopupWindow anchors itself to a host view and displays a list of
* choices.
*
* <p>
* ListPopupWindow contains a number of tricky behaviors surrounding
* positioning, scrolling parents to fit the dropdown, interacting sanely with
* the IME if present, and others.
*
* @see android.widget.AutoCompleteTextView
* @see android.widget.Spinner
*/
public class ListPopupWindowCompat implements ListPopupWindow {
private static final String TAG = "ListPopupWindow";
private static final boolean DEBUG = false;
/**
* This value controls the length of time that the user must leave a pointer
* down without scrolling to expand the autocomplete dropdown list to cover
* the IME.
*/
private static final int EXPAND_LIST_TIMEOUT = 250;
private final Context mContext;
private final PopupWindow mPopup;
private ListAdapter mAdapter;
private DropDownListView mDropDownList;
private int mDropDownHeight = ViewGroup.LayoutParams.WRAP_CONTENT;
private int mDropDownWidth = ViewGroup.LayoutParams.WRAP_CONTENT;
private int mDropDownHorizontalOffset;
private int mDropDownVerticalOffset;
private boolean mDropDownVerticalOffsetSet;
private boolean mDropDownAlwaysVisible = false;
private boolean mForceIgnoreOutsideTouch = false;
int mListItemExpandMaximum = Integer.MAX_VALUE;
private View mPromptView;
private int mPromptPosition = POSITION_PROMPT_ABOVE;
private DataSetObserver mObserver;
private View mDropDownAnchorView;
private Drawable mDropDownListHighlight;
private AdapterView.OnItemClickListener mItemClickListener;
private AdapterView.OnItemSelectedListener mItemSelectedListener;
private final ResizePopupRunnable mResizePopupRunnable = new ResizePopupRunnable();
private final PopupTouchInterceptor mTouchInterceptor = new PopupTouchInterceptor();
// private final PopupScrollListener mScrollListener = new
// PopupScrollListener();
private final ListSelectorHider mHideSelector = new ListSelectorHider();
private Runnable mShowDropDownRunnable;
private final Handler mHandler = new Handler();
private final Rect mTempRect = new Rect();
private boolean mModal;
// from ICS ListView
static final int NO_POSITION = -1;
/**
* Create a new, empty popup window capable of displaying items from a
* ListAdapter. Backgrounds should be set using
* {@link #setBackgroundDrawable(Drawable)}.
*
* @param context Context used for contained views.
*/
public ListPopupWindowCompat(final Context context) {
this(context, null, 0, 0);
}
/**
* Create a new, empty popup window capable of displaying items from a
* ListAdapter. Backgrounds should be set using
* {@link #setBackgroundDrawable(Drawable)}.
*
* @param context Context used for contained views.
* @param attrs Attributes from inflating parent views used to style the
* popup.
*/
public ListPopupWindowCompat(final Context context, final AttributeSet attrs) {
this(context, attrs, 0, 0);
}
/**
* Create a new, empty popup window capable of displaying items from a
* ListAdapter. Backgrounds should be set using
* {@link #setBackgroundDrawable(Drawable)}.
*
* @param context Context used for contained views.
* @param attrs Attributes from inflating parent views used to style the
* popup.
* @param defStyleAttr Default style attribute to use for popup content.
*/
public ListPopupWindowCompat(final Context context, final AttributeSet attrs, final int defStyleAttr) {
this(context, attrs, defStyleAttr, 0);
}
/**
* Create a new, empty popup window capable of displaying items from a
* ListAdapter. Backgrounds should be set using
* {@link #setBackgroundDrawable(Drawable)}.
*
* @param context Context used for contained views.
* @param attrs Attributes from inflating parent views used to style the
* popup.
* @param defStyleAttr Style attribute to read for default styling of popup
* content.
* @param defStyleRes Style resource ID to use for default styling of popup
* content.
*/
public ListPopupWindowCompat(final Context context, final AttributeSet attrs, final int defStyleAttr,
final int defStyleRes) {
mContext = context;
mPopup = new PopupWindow(context, attrs);
mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
final Theme theme = context.getTheme();
final TypedArray array = theme.obtainStyledAttributes(new int[] { R.attr.popupBackground,
android.R.attr.listSelector });
mPopup.setBackgroundDrawable(array.getDrawable(0));
mDropDownListHighlight = array.getDrawable(1);
array.recycle();
}
/**
* Clear any current list selection. Only valid when {@link #isShowing()} ==
* {@code true}.
*/
@Override
public void clearListSelection() {
final DropDownListView list = mDropDownList;
if (list != null) {
// WARNING: Please read the comment where mListSelectionHidden is
// declared
list.mListSelectionHidden = true;
// list.hideSelector();
list.requestLayout();
}
}
/**
* Dismiss the popup window.
*/
@Override
public void dismiss() {
mPopup.dismiss();
removePromptView();
mPopup.setContentView(null);
mDropDownList = null;
mHandler.removeCallbacks(mResizePopupRunnable);
}
/**
* Returns the view that will be used to anchor this popup.
*
* @return The popup's anchor view
*/
@Override
public View getAnchorView() {
return mDropDownAnchorView;
}
/**
* Returns the animation style that will be used when the popup window is
* shown or dismissed.
*
* @return Animation style that will be used.
*/
@Override
public int getAnimationStyle() {
return mPopup.getAnimationStyle();
}
/**
* @return The background drawable for the popup window.
*/
@Override
public Drawable getBackground() {
return mPopup.getBackground();
}
/**
* @return The height of the popup window in pixels.
*/
@Override
public int getHeight() {
return mDropDownHeight;
}
/**
* @return The horizontal offset of the popup from its anchor in pixels.
*/
@Override
public int getHorizontalOffset() {
return mDropDownHorizontalOffset;
}
/**
* Return the current value in {@link #setInputMethodMode(int)}.
*
* @see #setInputMethodMode(int)
*/
@Override
public int getInputMethodMode() {
return mPopup.getInputMethodMode();
}
/**
* @return The {@link ListView} displayed within the popup window. Only
* valid when {@link #isShowing()} == {@code true}.
*/
@Override
public ListView getListView() {
return mDropDownList;
}
/**
* @return Where the optional prompt view should appear.
*
* @see #POSITION_PROMPT_ABOVE
* @see #POSITION_PROMPT_BELOW
*/
@Override
public int getPromptPosition() {
return mPromptPosition;
}
/**
* @return The currently selected item or null if the popup is not showing.
*/
@Override
public Object getSelectedItem() {
if (!isShowing()) return null;
return mDropDownList.getSelectedItem();
}
/**
* @return The ID of the currently selected item or
* {@link ListView#INVALID_ROW_ID} if {@link #isShowing()} ==
* {@code false}.
*
* @see ListView#getSelectedItemId()
*/
@Override
public long getSelectedItemId() {
if (!isShowing()) return ListView.INVALID_ROW_ID;
return mDropDownList.getSelectedItemId();
}
/**
* @return The position of the currently selected item or
* {@link ListView#INVALID_POSITION} if {@link #isShowing()} ==
* {@code false}.
*
* @see ListView#getSelectedItemPosition()
*/
@Override
public int getSelectedItemPosition() {
if (!isShowing()) return ListView.INVALID_POSITION;
return mDropDownList.getSelectedItemPosition();
}
/**
* @return The View for the currently selected item or null if
* {@link #isShowing()} == {@code false}.
*
* @see ListView#getSelectedView()
*/
@Override
public View getSelectedView() {
if (!isShowing()) return null;
return mDropDownList.getSelectedView();
}
/**
* Returns the current value in {@link #setSoftInputMode(int)}.
*
* @see #setSoftInputMode(int)
* @see android.view.WindowManager.LayoutParams#softInputMode
*/
@Override
public int getSoftInputMode() {
return mPopup.getSoftInputMode();
}
/**
* @return The vertical offset of the popup from its anchor in pixels.
*/
@Override
public int getVerticalOffset() {
if (!mDropDownVerticalOffsetSet) return 0;
return mDropDownVerticalOffset;
}
/**
* @return The width of the popup window in pixels.
*/
@Override
public int getWidth() {
return mDropDownWidth;
}
/**
* @return Whether the drop-down is visible under special conditions.
*
* @hide Only used by AutoCompleteTextView under special conditions.
*/
public boolean isDropDownAlwaysVisible() {
return mDropDownAlwaysVisible;
}
/**
* @return {@code true} if this popup is configured to assume the user does
* not need to interact with the IME while it is showing,
* {@code false} otherwise.
*/
@Override
public boolean isInputMethodNotNeeded() {
return mPopup.getInputMethodMode() == INPUT_METHOD_NOT_NEEDED;
}
/**
* Returns whether the popup window will be modal when shown.
*
* @return {@code true} if the popup window will be modal, {@code false}
* otherwise.
*/
@Override
public boolean isModal() {
return mModal;
}
/**
* @return {@code true} if the popup is currently showing, {@code false}
* otherwise.
*/
@Override
public boolean isShowing() {
return mPopup.isShowing();
}
/**
* Filter key down events. By forwarding key down events to this function,
* views using non-modal ListPopupWindow can have it handle key selection of
* items.
*
* @param keyCode keyCode param passed to the host view's onKeyDown
* @param event event param passed to the host view's onKeyDown
* @return true if the event was handled, false if it was ignored.
*
* @see #setModal(boolean)
*/
public boolean onKeyDown(final int keyCode, final KeyEvent event) {
// when the drop down is shown, we drive it directly
if (isShowing()) {
// the key events are forwarded to the list in the drop down view
// note that ListView handles space but we don't want that to happen
// also if selection is not currently in the drop down, then don't
// let center or enter presses go there since that would cause it
// to select one of its items
if (keyCode != KeyEvent.KEYCODE_SPACE
&& (mDropDownList.getSelectedItemPosition() >= 0 || keyCode != KeyEvent.KEYCODE_ENTER
&& keyCode != KeyEvent.KEYCODE_DPAD_CENTER)) {
final int curIndex = mDropDownList.getSelectedItemPosition();
boolean consumed;
final boolean below = !mPopup.isAboveAnchor();
final ListAdapter adapter = mAdapter;
int firstItem = Integer.MAX_VALUE;
int lastItem = Integer.MIN_VALUE;
if (adapter != null) {
firstItem = 0;
lastItem = adapter.getCount() - 1;
// firstItem = allEnabled ? 0 :
// mDropDownList.lookForSelectablePosition(0, true);
// lastItem = allEnabled ? adapter.getCount() - 1 :
// mDropDownList.lookForSelectablePosition(adapter.getCount()
// - 1, false);
}
if (below && keyCode == KeyEvent.KEYCODE_DPAD_UP && curIndex <= firstItem || !below
&& keyCode == KeyEvent.KEYCODE_DPAD_DOWN && curIndex >= lastItem) {
// When the selection is at the top, we block the key
// event to prevent focus from moving.
clearListSelection();
mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
show();
return true;
} else {
// WARNING: Please read the comment where
// mListSelectionHidden
// is declared
mDropDownList.mListSelectionHidden = false;
}
consumed = mDropDownList.onKeyDown(keyCode, event);
if (DEBUG) {
Log.v(TAG, "Key down: code=" + keyCode + " list consumed=" + consumed);
}
if (consumed) {
// If it handled the key event, then the user is
// navigating in the list, so we should put it in front.
mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NOT_NEEDED);
// Here's a little trick we need to do to make sure that
// the list view is actually showing its focus indicator,
// by ensuring it has focus and getting its window out
// of touch mode.
mDropDownList.requestFocusFromTouch();
show();
switch (keyCode) {
// avoid passing the focus from the text view to the
// next component
case KeyEvent.KEYCODE_ENTER:
case KeyEvent.KEYCODE_DPAD_CENTER:
case KeyEvent.KEYCODE_DPAD_DOWN:
case KeyEvent.KEYCODE_DPAD_UP:
return true;
}
} else {
if (below && keyCode == KeyEvent.KEYCODE_DPAD_DOWN) {
// when the selection is at the bottom, we block the
// event to avoid going to the next focusable widget
if (curIndex == lastItem) return true;
} else if (!below && keyCode == KeyEvent.KEYCODE_DPAD_UP && curIndex == firstItem) return true;
}
}
}
return false;
}
/**
* Filter pre-IME key events. By forwarding
* {@link View#onKeyPreIme(int, KeyEvent)} events to this function, views
* using ListPopupWindow can have it dismiss the popup when the back key is
* pressed.
*
* @param keyCode keyCode param passed to the host view's onKeyPreIme
* @param event event param passed to the host view's onKeyPreIme
* @return true if the event was handled, false if it was ignored.
*
* @see #setModal(boolean)
*/
public boolean onKeyPreIme(final int keyCode, final KeyEvent event) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ECLAIR)
return OnKeyPreImeAccessor.onKeyPreIme(this, keyCode, event);
return false;
}
/**
* Filter key down events. By forwarding key up events to this function,
* views using non-modal ListPopupWindow can have it handle key selection of
* items.
*
* @param keyCode keyCode param passed to the host view's onKeyUp
* @param event event param passed to the host view's onKeyUp
* @return true if the event was handled, false if it was ignored.
*
* @see #setModal(boolean)
*/
public boolean onKeyUp(final int keyCode, final KeyEvent event) {
if (isShowing() && mDropDownList.getSelectedItemPosition() >= 0) {
final boolean consumed = mDropDownList.onKeyUp(keyCode, event);
if (consumed) {
switch (keyCode) {
// if the list accepts the key events and the key event
// was a click, the text view gets the selected item
// from the drop down as its content
case KeyEvent.KEYCODE_ENTER:
case KeyEvent.KEYCODE_DPAD_CENTER:
dismiss();
break;
}
}
return consumed;
}
return false;
}
/**
* Perform an item click operation on the specified list adapter position.
*
* @param position Adapter position for performing the click
* @return true if the click action could be performed, false if not. (e.g.
* if the popup was not showing, this method would return false.)
*/
@Override
public boolean performItemClick(final int position) {
if (isShowing()) {
if (mItemClickListener != null) {
final DropDownListView list = mDropDownList;
final View child = list.getChildAt(position - list.getFirstVisiblePosition());
final ListAdapter adapter = list.getAdapter();
mItemClickListener.onItemClick(list, child, position, adapter.getItemId(position));
}
return true;
}
return false;
}
/**
* Post a {@link #show()} call to the UI thread.
*/
@Override
public void postShow() {
mHandler.post(mShowDropDownRunnable);
}
/**
* Sets the adapter that provides the data and the views to represent the
* data in this popup window.
*
* @param adapter The adapter to use to create this window's content.
*/
@Override
public void setAdapter(final ListAdapter adapter) {
if (mObserver == null) {
mObserver = new PopupDataSetObserver();
} else if (mAdapter != null) {
mAdapter.unregisterDataSetObserver(mObserver);
}
mAdapter = adapter;
if (mAdapter != null) {
adapter.registerDataSetObserver(mObserver);
}
if (mDropDownList != null) {
mDropDownList.setAdapter(mAdapter);
}
}
/**
* Sets the popup's anchor view. This popup will always be positioned
* relative to the anchor view when shown.
*
* @param anchor The view to use as an anchor.
*/
@Override
public void setAnchorView(final View anchor) {
mDropDownAnchorView = anchor;
}
/**
* Set an animation style to use when the popup window is shown or
* dismissed.
*
* @param animationStyle Animation style to use.
*/
@Override
public void setAnimationStyle(final int animationStyle) {
mPopup.setAnimationStyle(animationStyle);
}
/**
* Sets a drawable to be the background for the popup window.
*
* @param d A drawable to set as the background.
*/
@Override
public void setBackgroundDrawable(final Drawable d) {
mPopup.setBackgroundDrawable(d);
}
/**
* Sets the width of the popup window by the size of its content. The final
* width may be larger to accommodate styled window dressing.
*
* @param width Desired width of content in pixels.
*/
@Override
public void setContentWidth(final int width) {
final Drawable popupBackground = mPopup.getBackground();
if (popupBackground != null) {
popupBackground.getPadding(mTempRect);
mDropDownWidth = mTempRect.left + mTempRect.right + width;
} else {
setWidth(width);
}
}
/**
* Sets whether the drop-down should remain visible under certain
* conditions.
*
* The drop-down will occupy the entire screen below {@link #getAnchorView}
* regardless of the size or content of the list. {@link #getBackground()}
* will fill any space that is not used by the list.
*
* @param dropDownAlwaysVisible Whether to keep the drop-down visible.
*
* @hide Only used by AutoCompleteTextView under special conditions.
*/
public void setDropDownAlwaysVisible(final boolean dropDownAlwaysVisible) {
mDropDownAlwaysVisible = dropDownAlwaysVisible;
}
/**
* Forces outside touches to be ignored. Normally if
* {@link #isDropDownAlwaysVisible()} is false, we allow outside touch to
* dismiss the dropdown. If this is set to true, then we ignore outside
* touch even when the drop down is not set to always visible.
*
* @hide Used only by AutoCompleteTextView to handle some internal special
* cases.
*/
public void setForceIgnoreOutsideTouch(final boolean forceIgnoreOutsideTouch) {
mForceIgnoreOutsideTouch = forceIgnoreOutsideTouch;
}
/**
* Sets the height of the popup window in pixels. Can also be
* {@link #MATCH_PARENT}.
*
* @param height Height of the popup window.
*/
@Override
public void setHeight(final int height) {
mDropDownHeight = height;
}
/**
* Set the horizontal offset of this popup from its anchor view in pixels.
*
* @param offset The horizontal offset of the popup from its anchor.
*/
@Override
public void setHorizontalOffset(final int offset) {
mDropDownHorizontalOffset = offset;
}
/**
* Control how the popup operates with an input method: one of
* {@link #INPUT_METHOD_FROM_FOCUSABLE}, {@link #INPUT_METHOD_NEEDED}, or
* {@link #INPUT_METHOD_NOT_NEEDED}.
*
* <p>
* If the popup is showing, calling this method will take effect only the
* next time the popup is shown or through a manual call to the
* {@link #show()} method.
* </p>
*
* @see #getInputMethodMode()
* @see #show()
*/
@Override
public void setInputMethodMode(final int mode) {
mPopup.setInputMethodMode(mode);
}
/**
* Sets a drawable to use as the list item selector.
*
* @param selector List selector drawable to use in the popup.
*/
@Override
public void setListSelector(final Drawable selector) {
mDropDownListHighlight = selector;
}
/**
* Set whether this window should be modal when shown.
*
* <p>
* If a popup window is modal, it will receive all touch and key input. If
* the user touches outside the popup window's content area the popup window
* will be dismissed.
*
* @param modal {@code true} if the popup window should be modal,
* {@code false} otherwise.
*/
@Override
public void setModal(final boolean modal) {
mModal = true;
mPopup.setFocusable(modal);
}
/**
* Set a listener to receive a callback when the popup is dismissed.
*
* @param listener Listener that will be notified when the popup is
* dismissed.
*/
@Override
public void setOnDismissListener(final PopupWindow.OnDismissListener listener) {
mPopup.setOnDismissListener(listener);
}
/**
* Sets a listener to receive events when a list item is clicked.
*
* @param clickListener Listener to register
*
* @see ListView#setOnItemClickListener(android.widget.AdapterView.OnItemClickListener)
*/
@Override
public void setOnItemClickListener(final AdapterView.OnItemClickListener clickListener) {
mItemClickListener = clickListener;
}
/**
* Sets a listener to receive events when a list item is selected.
*
* @param selectedListener Listener to register.
*
* @see ListView#setOnItemSelectedListener(android.widget.AdapterView.OnItemSelectedListener)
*/
@Override
public void setOnItemSelectedListener(final AdapterView.OnItemSelectedListener selectedListener) {
mItemSelectedListener = selectedListener;
}
/**
* Set where the optional prompt view should appear. The default is
* {@link #POSITION_PROMPT_ABOVE}.
*
* @param position A position constant declaring where the prompt should be
* displayed.
*
* @see #POSITION_PROMPT_ABOVE
* @see #POSITION_PROMPT_BELOW
*/
@Override
public void setPromptPosition(final int position) {
mPromptPosition = position;
}
/**
* Set a view to act as a user prompt for this popup window. Where the
* prompt view will appear is controlled by {@link #setPromptPosition(int)}.
*
* @param prompt View to use as an informational prompt.
*/
@Override
public void setPromptView(final View prompt) {
final boolean showing = isShowing();
if (showing) {
removePromptView();
}
mPromptView = prompt;
if (showing) {
show();
}
}
/**
* Set the selected position of the list. Only valid when
* {@link #isShowing()} == {@code true}.
*
* @param position List position to set as selected.
*/
@Override
public void setSelection(final int position) {
final DropDownListView list = mDropDownList;
if (isShowing() && list != null) {
list.mListSelectionHidden = false;
list.setSelection(position);
if (list.getChoiceMode() != ListView.CHOICE_MODE_NONE) {
list.setItemChecked(position, true);
}
}
}
/**
* Sets the operating mode for the soft input area.
*
* @param mode The desired mode, see
* {@link android.view.WindowManager.LayoutParams#softInputMode}
* for the full list
*
* @see android.view.WindowManager.LayoutParams#softInputMode
* @see #getSoftInputMode()
*/
@Override
public void setSoftInputMode(final int mode) {
mPopup.setSoftInputMode(mode);
}
/**
* Set the vertical offset of this popup from its anchor view in pixels.
*
* @param offset The vertical offset of the popup from its anchor.
*/
@Override
public void setVerticalOffset(final int offset) {
mDropDownVerticalOffset = offset;
mDropDownVerticalOffsetSet = true;
}
/**
* Sets the width of the popup window in pixels. Can also be
* {@link #MATCH_PARENT} or {@link #WRAP_CONTENT}.
*
* @param width Width of the popup window.
*/
@Override
public void setWidth(final int width) {
mDropDownWidth = width;
}
/**
* Show the popup list. If the list is already showing, this method will
* recalculate the popup's size and position.
*/
@Override
public void show() {
final int height = buildDropDown();
int widthSpec = 0;
int heightSpec = 0;
final boolean noInputMethod = isInputMethodNotNeeded();
// mPopup.setAllowScrollingAnchorParent(!noInputMethod);
if (mPopup.isShowing()) {
if (mDropDownWidth == ViewGroup.LayoutParams.MATCH_PARENT) {
// The call to PopupWindow's update method below can accept -1
// for any
// value you do not want to update.
widthSpec = -1;
} else if (mDropDownWidth == ViewGroup.LayoutParams.WRAP_CONTENT) {
widthSpec = getAnchorView().getWidth();
} else {
widthSpec = mDropDownWidth;
}
if (mDropDownHeight == ViewGroup.LayoutParams.MATCH_PARENT) {
// The call to PopupWindow's update method below can accept -1
// for any
// value you do not want to update.
heightSpec = noInputMethod ? height : ViewGroup.LayoutParams.MATCH_PARENT;
if (noInputMethod) {
mPopup.setWindowLayoutMode(
mDropDownWidth == ViewGroup.LayoutParams.MATCH_PARENT ? ViewGroup.LayoutParams.MATCH_PARENT
: 0, 0);
} else {
mPopup.setWindowLayoutMode(
mDropDownWidth == ViewGroup.LayoutParams.MATCH_PARENT ? ViewGroup.LayoutParams.MATCH_PARENT
: 0, ViewGroup.LayoutParams.MATCH_PARENT);
}
} else if (mDropDownHeight == ViewGroup.LayoutParams.WRAP_CONTENT) {
heightSpec = height;
} else {
heightSpec = mDropDownHeight;
}
mPopup.setOutsideTouchable(!mForceIgnoreOutsideTouch && !mDropDownAlwaysVisible);
mPopup.update(getAnchorView(), mDropDownHorizontalOffset, mDropDownVerticalOffset, widthSpec, heightSpec);
} else {
if (mDropDownWidth == ViewGroup.LayoutParams.MATCH_PARENT) {
widthSpec = ViewGroup.LayoutParams.MATCH_PARENT;
} else {
if (mDropDownWidth == ViewGroup.LayoutParams.WRAP_CONTENT) {
mPopup.setWidth(getAnchorView().getWidth());
} else {
mPopup.setWidth(mDropDownWidth);
}
}
if (mDropDownHeight == ViewGroup.LayoutParams.MATCH_PARENT) {
heightSpec = ViewGroup.LayoutParams.MATCH_PARENT;
} else {
if (mDropDownHeight == ViewGroup.LayoutParams.WRAP_CONTENT) {
mPopup.setHeight(height);
} else {
mPopup.setHeight(mDropDownHeight);
}
}
mPopup.setWindowLayoutMode(widthSpec, heightSpec);
// mPopup.setClipToScreenEnabled(true); might be important aap
// use outside touchable to dismiss drop down when touching outside
// of it, so
// only set this if the dropdown is not always visible
mPopup.setOutsideTouchable(!mForceIgnoreOutsideTouch && !mDropDownAlwaysVisible);
mPopup.setTouchInterceptor(mTouchInterceptor);
mPopup.showAsDropDown(getAnchorView(), mDropDownHorizontalOffset, mDropDownVerticalOffset);
mDropDownList.setSelection(ListView.INVALID_POSITION);
if (!mModal || mDropDownList.isInTouchMode()) {
clearListSelection();
}
if (!mModal) {
mHandler.post(mHideSelector);
}
}
}
/**
* <p>
* Builds the popup window's content and returns the height the popup should
* have. Returns -1 when the content already exists.
* </p>
*
* @return the content's height or -1 if content already exists
*/
private int buildDropDown() {
ViewGroup dropDownView;
int otherHeights = 0;
if (mDropDownList == null) {
final Context context = mContext;
/**
* This Runnable exists for the sole purpose of checking if the view
* layout has got completed and if so call showDropDown to display
* the drop down. This is used to show the drop down as soon as
* possible after user opens up the search dialog, without waiting
* for the normal UI pipeline to do it's job which is slower than
* this method.
*/
mShowDropDownRunnable = new Runnable() {
@Override
public void run() {
// View layout should be all done before displaying the drop
// down.
final View view = getAnchorView();
if (view != null && view.getWindowToken() != null) {
show();
}
}
};
mDropDownList = new DropDownListView(context, !mModal);
if (mDropDownListHighlight != null) {
mDropDownList.setSelector(mDropDownListHighlight);
}
mDropDownList.setAdapter(mAdapter);
mDropDownList.setOnItemClickListener(mItemClickListener);
mDropDownList.setFocusable(true);
mDropDownList.setFocusableInTouchMode(true);
mDropDownList.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(final AdapterView<?> parent, final View view, final int position,
final long id) {
if (position != -1) {
final DropDownListView dropDownList = mDropDownList;
if (dropDownList != null) {
dropDownList.mListSelectionHidden = false;
}
}
}
@Override
public void onNothingSelected(final AdapterView<?> parent) {
}
});
// mDropDownList.setOnScrollListener(mScrollListener);
if (mItemSelectedListener != null) {
mDropDownList.setOnItemSelectedListener(mItemSelectedListener);
}
dropDownView = mDropDownList;
final View hintView = mPromptView;
if (hintView != null) {
// if an hint has been specified, we accomodate more space for
// it and
// add a text view in the drop down menu, at the bottom of the
// list
final LinearLayout hintContainer = new LinearLayout(context);
hintContainer.setOrientation(LinearLayout.VERTICAL);
LinearLayout.LayoutParams hintParams = new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, 0, 1.0f);
switch (mPromptPosition) {
case POSITION_PROMPT_BELOW:
hintContainer.addView(dropDownView, hintParams);
hintContainer.addView(hintView);
break;
case POSITION_PROMPT_ABOVE:
hintContainer.addView(hintView);
hintContainer.addView(dropDownView, hintParams);
break;
default:
Log.e(TAG, "Invalid hint position " + mPromptPosition);
break;
}
// measure the hint's height to find how much more vertical
// space
// we need to add to the drop down's height
final int widthSpec = MeasureSpec.makeMeasureSpec(mDropDownWidth, MeasureSpec.AT_MOST);
final int heightSpec = MeasureSpec.UNSPECIFIED;
hintView.measure(widthSpec, heightSpec);
hintParams = (LinearLayout.LayoutParams) hintView.getLayoutParams();
otherHeights = hintView.getMeasuredHeight() + hintParams.topMargin + hintParams.bottomMargin;
dropDownView = hintContainer;
}
mPopup.setContentView(dropDownView);
} else {
dropDownView = (ViewGroup) mPopup.getContentView();
final View view = mPromptView;
if (view != null) {
final LinearLayout.LayoutParams hintParams = (LinearLayout.LayoutParams) view.getLayoutParams();
otherHeights = view.getMeasuredHeight() + hintParams.topMargin + hintParams.bottomMargin;
}
}
// getMaxAvailableHeight() subtracts the padding, so we put it back
// to get the available height for the whole window
int padding = 0;
final Drawable background = mPopup.getBackground();
if (background != null) {
background.getPadding(mTempRect);
padding = mTempRect.top + mTempRect.bottom;
// If we don't have an explicit vertical offset, determine one from
// the window
// background so that content will line up.
if (!mDropDownVerticalOffsetSet) {
mDropDownVerticalOffset = -mTempRect.top;
}
}
final int maxHeight = mPopup.getMaxAvailableHeight(getAnchorView(), mDropDownVerticalOffset);
if (mDropDownAlwaysVisible || mDropDownHeight == ViewGroup.LayoutParams.MATCH_PARENT)
return maxHeight + padding;
final int listContent = measureHeightOfChildren(MeasureSpec.UNSPECIFIED, 0, NO_POSITION, maxHeight
- otherHeights, -1);
// add padding only if the list has items in it, that way we don't show
// the popup if it is not needed
if (listContent > 0) {
otherHeights += padding;
}
return listContent + otherHeights;
}
private void measureScrapChild(final View child, final int position, final int widthMeasureSpec, final Rect padding) {
LayoutParams p = (LayoutParams) child.getLayoutParams();
if (p == null) {
p = new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT, 0);
child.setLayoutParams(p);
}
// p.viewType = mAdapter.getItemViewType(position);
// p.forceAdd = true;
final int childWidthSpec = ViewGroup.getChildMeasureSpec(widthMeasureSpec, padding.left + padding.right,
p.width);
final int lpHeight = p.height;
int childHeightSpec;
if (lpHeight > 0) {
childHeightSpec = MeasureSpec.makeMeasureSpec(lpHeight, MeasureSpec.EXACTLY);
} else {
childHeightSpec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED);
}
child.measure(childWidthSpec, childHeightSpec);
}
private void removePromptView() {
if (mPromptView != null) {
final ViewParent parent = mPromptView.getParent();
if (parent instanceof ViewGroup) {
final ViewGroup group = (ViewGroup) parent;
group.removeView(mPromptView);
}
}
}
/**
* This method borrowed from ICS ListView.
*
* Measures the height of the given range of children (inclusive) and
* returns the height with this ListView's padding and divider heights
* included. If maxHeight is provided, the measuring will stop when the
* current height reaches maxHeight.
*
* @param widthMeasureSpec The width measure spec to be given to a child's
* {@link View#measure(int, int)}.
* @param startPosition The position of the first child to be shown.
* @param endPosition The (inclusive) position of the last child to be
* shown. Specify {@link #NO_POSITION} if the last child should
* be the last available child from the adapter.
* @param maxHeight The maximum height that will be returned (if all the
* children don't fit in this value, this value will be
* returned).
* @param disallowPartialChildPosition In general, whether the returned
* height should only contain entire children. This is more
* powerful--it is the first inclusive position at which partial
* children will not be allowed. Example: it looks nice to have
* at least 3 completely visible children, and in portrait this
* will most likely fit; but in landscape there could be times
* when even 2 children can not be completely shown, so a value
* of 2 (remember, inclusive) would be good (assuming
* startPosition is 0).
* @return The height of this ListView with the given children.
*/
final int measureHeightOfChildren(final int widthMeasureSpec, final int startPosition, int endPosition,
final int maxHeight, final int disallowPartialChildPosition) {
final Rect padding = new Rect();
// not sure if this is the right padding to use...
mPopup.getBackground().getPadding(padding);
final ListAdapter adapter = mAdapter;
if (adapter == null) return padding.top + padding.bottom;
// Include the padding of the list
int returnedHeight = padding.top + padding.bottom;
final int dividerHeight = 0; // ((mDividerHeight > 0) && mDivider !=
// null) ? mDividerHeight : 0;
// The previous height value that was less than maxHeight and contained
// no partial children
int prevHeightWithoutPartialChild = 0;
int i;
View child;
// mItemCount - 1 since endPosition parameter is inclusive
endPosition = endPosition == NO_POSITION ? adapter.getCount() - 1 : endPosition;
// final AbsListView.RecycleBin recycleBin = mRecycler;
// final boolean recyle = recycleOnMeasure();
// final boolean[] isScrap = mIsScrap;
for (i = startPosition; i <= endPosition; ++i) {
// child = mDropDownList.obtainView(i);
child = mAdapter.getView(i, null, mDropDownList);
measureScrapChild(child, i, widthMeasureSpec, padding);
if (i > 0) {
// Count the divider for all but one child
returnedHeight += dividerHeight;
}
// Recycle the view before we possibly return from the method
// if (recyle && recycleBin.shouldRecycleViewType(
// ((LayoutParams) child.getLayoutParams()).viewType)) {
// recycleBin.addScrapView(child, -1);
// }
returnedHeight += child.getMeasuredHeight();
if (returnedHeight >= maxHeight) // We went over, figure out which
// height to return. If
// returnedHeight > maxHeight,
// then the i'th position did not fit completely.
return disallowPartialChildPosition >= 0 // Disallowing is
// enabled (> -1)
&& i > disallowPartialChildPosition // We've past the
// min pos
&& prevHeightWithoutPartialChild > 0 // We have a prev
// height
&& returnedHeight != maxHeight // i'th child did not
// fit completely
? prevHeightWithoutPartialChild : maxHeight;
if (disallowPartialChildPosition >= 0 && i >= disallowPartialChildPosition) {
prevHeightWithoutPartialChild = returnedHeight;
}
}
// At this point, we went through the range of children, and they each
// completely fit, so return the returnedHeight
return returnedHeight;
}
/**
* The maximum number of list items that can be visible and still have the
* list expand when touched.
*
* @param max Max number of items that can be visible and still allow the
* list to expand.
*/
void setListItemExpandMax(final int max) {
mListItemExpandMaximum = max;
}
/**
* <p>
* Wrapper class for a ListView. This wrapper can hijack the focus to make
* sure the list uses the appropriate drawables and states when displayed on
* screen within a drop down. The focus is never actually passed to the drop
* down in this mode; the list only looks focused.
* </p>
*/
private static class DropDownListView extends ListView {
/*
* WARNING: This is a workaround for a touch mode issue.
*
* Touch mode is propagated lazily to windows. This causes problems in
* the following scenario: - Type something in the AutoCompleteTextView
* and get some results - Move down with the d-pad to select an item in
* the list - Move up with the d-pad until the selection disappears -
* Type more text in the AutoCompleteTextView *using the soft keyboard*
* and get new results; you are now in touch mode - The selection comes
* back on the first item in the list, even though the list is supposed
* to be in touch mode
*
* Using the soft keyboard triggers the touch mode change but that
* change is propagated to our window only after the first list layout,
* therefore after the list attempts to resurrect the selection.
*
* The trick to work around this issue is to pretend the list is in
* touch mode when we know that the selection should not appear, that is
* when we know the user moved the selection away from the list.
*
* This boolean is set to true whenever we explicitly hide the list's
* selection and reset to false whenever we know the user moved the
* selection back to the list.
*
* When this boolean is true, isInTouchMode() returns true, otherwise it
* returns super.isInTouchMode().
*/
private boolean mListSelectionHidden;
/**
* True if this wrapper should fake focus.
*/
private final boolean mHijackFocus;
/**
* <p>
* Creates a new list view wrapper.
* </p>
*
* @param context this view's context
*/
public DropDownListView(final Context context, final boolean hijackFocus) {
super(context, null, android.R.attr.dropDownListViewStyle);
mHijackFocus = hijackFocus;
// setCacheColorHint(0);
setPadding(0, 0, 0, 0);
}
/**
* <p>
* Returns the focus state in the drop down.
* </p>
*
* @return true always if hijacking focus
*/
@Override
public boolean hasFocus() {
return mHijackFocus || super.hasFocus();
}
/**
* <p>
* Returns the focus state in the drop down.
* </p>
*
* @return true always if hijacking focus
*/
@Override
public boolean hasWindowFocus() {
return mHijackFocus || super.hasWindowFocus();
}
/**
* <p>
* Returns the focus state in the drop down.
* </p>
*
* @return true always if hijacking focus
*/
@Override
public boolean isFocused() {
return mHijackFocus || super.isFocused();
}
@Override
public boolean isInTouchMode() {
// WARNING: Please read the comment where mListSelectionHidden is
// declared
return mHijackFocus && mListSelectionHidden || super.isInTouchMode();
}
}
private class ListSelectorHider implements Runnable {
@Override
public void run() {
clearListSelection();
}
}
private class PopupDataSetObserver extends DataSetObserver {
@Override
public void onChanged() {
if (isShowing()) {
// Resize the popup to fit new content
show();
}
}
@Override
public void onInvalidated() {
dismiss();
}
}
private class PopupTouchInterceptor implements OnTouchListener {
@Override
public boolean onTouch(final View v, final MotionEvent event) {
final int action = event.getAction();
final int x = (int) event.getX();
final int y = (int) event.getY();
if (action == MotionEvent.ACTION_DOWN && mPopup != null && mPopup.isShowing() && x >= 0
&& x < mPopup.getWidth() && y >= 0 && y < mPopup.getHeight()) {
mHandler.postDelayed(mResizePopupRunnable, EXPAND_LIST_TIMEOUT);
} else if (action == MotionEvent.ACTION_UP) {
mHandler.removeCallbacks(mResizePopupRunnable);
}
return false;
}
}
private class ResizePopupRunnable implements Runnable {
@Override
public void run() {
if (mDropDownList != null && mDropDownList.getCount() > mDropDownList.getChildCount()
&& mDropDownList.getChildCount() <= mListItemExpandMaximum) {
mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NOT_NEEDED);
show();
}
}
}
@SuppressLint("NewApi")
static class OnKeyPreImeAccessor {
public static boolean onKeyPreIme(final ListPopupWindowCompat window, final int keyCode, final KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK && window.isShowing()) {
// special case for the back key, we do not even try to send it
// to the drop down list but instead, consume it immediately
final View anchorView = window.mDropDownAnchorView;
if (event.getAction() == KeyEvent.ACTION_DOWN && event.getRepeatCount() == 0) {
final KeyEvent.DispatcherState state = anchorView.getKeyDispatcherState();
if (state != null) {
state.startTracking(event, window);
}
return true;
} else if (event.getAction() == KeyEvent.ACTION_UP) {
final KeyEvent.DispatcherState state = anchorView.getKeyDispatcherState();
if (state != null) {
state.handleUpEvent(event);
}
if (event.isTracking() && !event.isCanceled()) {
window.dismiss();
return true;
}
}
}
return false;
}
}
}
|
GROSS TOTAL RESECTION IN A RARE CASE OF OPTIC NERVE ASTROCYTOMA: A CASE REPORT. The authors present a 3-year-old female with increasing proptosis and absent vision in the right eye. Chemotherapy had done for 3months. But her ailments lingered. The right eye exhibited severe proptosis and poor vision, whereas the left eye was normal with 20/20 vision. Preoperative MRI revealed a dumbbell-shaped tumor in the intra-orbital and intra-cranial section of the right optic nerve. A lateral supra-orbital approach was used to dissect the dumbbell-shaped tumor and the right optic nerve. No remnant of the tumor was discovered during a follow-up examination. The case study demonstrates how to identify and treat ONA surgically. However, we need further research on optic nerve PA to gain a better understanding of their behavior. While gross total resection (GTR) is usually curative, tumors in deep locations may be unresectable and require alternative therapeutic procedures. Additionally, the case study emphasizes the importance of additional research on early detection and prevention. |
package ru.job4j.simpleIO;
import org.junit.Test;
import javax.imageio.IIOException;
import java.io.*;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;
/**
* Test SortBigFile.
* @author atrifonov.
* @version 1.
* @since 19.02.2018.
*/
public class TestSortBigFile {
/**
* Test sort.
*/
@Test
public void whenNotSortedLinesInFileThenSortedLinesAnotherFile() {
File source = new File("src\\main\\resources\\ru\\job4j\\simpleIO\\one.txt");
File dest = new File("src\\main\\resources\\ru\\job4j\\simpleIO\\dest.txt");
boolean sort = check(source, dest, false);
assertThat(sort, is(true));
}
/**
* Test sortOld.
*/
@Test
public void whenFileAreNotSortedThenGetSortedFile() {
File source = new File("src\\main\\resources\\ru\\job4j\\simpleIO\\one.txt");
File dest = new File("src\\main\\resources\\ru\\job4j\\simpleIO\\dest.txt");
boolean sort = check(source, dest, true);
assertThat(sort, is(true));
}
private boolean check(File source, File dest, boolean old) {
boolean sort = true;
SortBigFile sortBigFile = new SortBigFile();
try {
if (old) {
sortBigFile.sortOld(source, dest);
} else {
sortBigFile.sort(source, dest);
}
sortBigFile.sort(source, dest);
} catch (IOException e) {
e.printStackTrace();
}
try {
BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(dest), "UTF-8"));
String line = "";
List<String> list = new ArrayList<>(6);
while ( (line = br.readLine()) != null) {
list.add(line);
}
br.close();
int i = 1;
for (String x : list) {
if (!x.startsWith("" + i + "")) {
sort = false;
break;
}
i++;
}
} catch (Exception e) {
e.printStackTrace();
}
return sort;
}
}
|
<gh_stars>100-1000
/*
* Copyright 2020 The Magma Authors.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*
* 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 calculations
import (
"fmt"
"github.com/golang/glog"
"magma/orc8r/cloud/go/services/analytics/calculations"
"magma/orc8r/cloud/go/services/analytics/protos"
"magma/orc8r/cloud/go/services/analytics/query_api"
"magma/orc8r/lib/go/metrics"
)
// UserConsumptionCalculation input params, direction can be user consumption volume
// during upload or download
type UserConsumptionCalculation struct {
calculations.BaseCalculation
Direction calculations.ConsumptionDirection
}
// Calculate computes the total volume of data consumed by subscribers over a required timeperiod
func (x *UserConsumptionCalculation) Calculate(prometheusClient query_api.PrometheusAPI) ([]*protos.CalculationResult, error) {
glog.Infof("Calculating User Consumption. Days: %d, Hours: %d, Direction: %s", x.Days, x.Hours, x.Direction)
var consumptionQuery string
// Measure consumption over x.Hours if exists
if x.Hours > 0 {
consumptionQuery = fmt.Sprintf(`sum(increase(octets_%s[%dh])) by (%s)`, x.Direction, x.Hours, metrics.NetworkLabelName)
} else {
consumptionQuery = fmt.Sprintf(`sum(increase(octets_%s[%dd])) by (%s)`, x.Direction, x.Days, metrics.NetworkLabelName)
}
vec, err := query_api.QueryPrometheusVector(prometheusClient, consumptionQuery)
if err != nil {
return nil, fmt.Errorf("user Consumption query error: %s", err)
}
baseLabels := calculations.CombineLabels(x.Labels, map[string]string{calculations.DirectionLabel: string(x.Direction)})
results := calculations.MakeVectorResults(vec, baseLabels, x.Name)
return results, nil
}
|
<filename>app/src/main/java/com/mindorks/framework/mvp/data/network/model/CombineCollection.java
package com.mindorks.framework.mvp.data.network.model;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.Parcelable.Creator;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
public class CombineCollection implements Serializable, Parcelable
{
@SerializedName("apps")
@Expose
private List<App> apps = new ArrayList<App>();
@SerializedName("total")
@Expose
private Integer total;
public final static Parcelable.Creator<CombineCollection> CREATOR = new Creator<CombineCollection>() {
@SuppressWarnings({
"unchecked"
})
public CombineCollection createFromParcel(Parcel in) {
return new CombineCollection(in);
}
public CombineCollection[] newArray(int size) {
return (new CombineCollection[size]);
}
}
;
private final static long serialVersionUID = 4259994845851775950L;
protected CombineCollection(Parcel in) {
in.readList(this.apps, (com.mindorks.framework.mvp.data.network.model.App.class.getClassLoader()));
this.total = ((Integer) in.readValue((Integer.class.getClassLoader())));
}
/**
* No args constructor for use in serialization
*
*/
public CombineCollection() {
}
/**
*
* @param total
* @param apps
*/
public CombineCollection(List<App> apps, Integer total) {
super();
this.apps = apps;
this.total = total;
}
public List<App> getApps() {
return apps;
}
public void setApps(List<App> apps) {
this.apps = apps;
}
public CombineCollection withApps(List<App> apps) {
this.apps = apps;
return this;
}
public Integer getTotal() {
return total;
}
public void setTotal(Integer total) {
this.total = total;
}
public CombineCollection withTotal(Integer total) {
this.total = total;
return this;
}
@Override
public String toString() {
return new ToStringBuilder(this).append("apps", apps).append("total", total).toString();
}
@Override
public int hashCode() {
return new HashCodeBuilder().append(total).append(apps).toHashCode();
}
@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
if ((other instanceof CombineCollection) == false) {
return false;
}
CombineCollection rhs = ((CombineCollection) other);
return new EqualsBuilder().append(total, rhs.total).append(apps, rhs.apps).isEquals();
}
public void writeToParcel(Parcel dest, int flags) {
dest.writeList(apps);
dest.writeValue(total);
}
public int describeContents() {
return 0;
}
}
|
/*
* parser.c
*
* Created on: Aug 21, 2017
* Author: Joonatan
*/
#include <misc.h>
#include <stdlib.h>
//General use text buffer.
Public char sY[TXT_BUF_LEN];
//We pass information with R:XX,YY,HH,WW --
Public Boolean parseRectangle(char * src, Rectangle * dest)
{
Boolean res = FALSE;
//U32 x,y,height,length = 0u;
U32 values[4u];
char * ps = src;
if (*ps == 'R')
{
//We skip the : character.
ps += 2;
if (parseCommaSeparatedU32Array(values, ps, 4u))
{
res = TRUE;
dest->location.x = values[0];
dest->location.y = values[1];
dest->size.height = values[2];
dest->size.width = values[3];
}
}
return res;
}
/* Returns a rectangle around a central point defined by location.
* TODO : This should be replace by an inline function or a macro. */
Public inline Rectangle CreateRectangleAroundCenter(Point location, Size size)
{
Rectangle res;
//res.location.x = location.x - (size.width / 2);
//res.location.y = location.y - (size.height / 2);
res.location.x = GET_X_FROM_CENTER(location.x, size.width);
res.location.y = GET_Y_FROM_CENTER(location.y, size.height);
res.size.height = size.height;
res.size.width = size.width;
return res;
}
//Returns the pointer to the next character.
Public char * parseU32FromString(U32 * dest, char * src)
{
char * ps = src;
U32 res = 0u;
U32 dec = 1u;
U32 temp;
if(!IS_DIGIT(*ps))
{
ps++;
}
while (IS_DIGIT(*ps))
{
temp = (U32)*ps - (U32)'0';
res += temp * dec;
dec *= 10u;
ps++;
}
return ps;
}
Public Boolean parseCommaSeparatedU32Array(U32 * dest, char * src, U32 dest_len)
{
U8 ix = 0u;
char * ps = src;
//We need to parse the first member separately.
dest[ix] = atoi(ps);
ix++;
ps++;
while(*ps)
{
if ((*ps == ',') && (*(ps + 1) != 0))
{
dest[ix] = atoi(ps + 1);
ix++;
if (ix > dest_len)
{
return FALSE;
}
}
ps++;
}
return TRUE;
}
Public U8 addchar (char * str, char c)
{
U8 pos = 0u;
char *ps = str;
while (ps)
{
if (ps[0] == 0)
{
break;
}
ps++;
pos++;
}
str[pos] = c;
str[++pos] = 0;
return pos;
}
Public U8 addstr (char * str1, const char * str2)
{
U8 pos1 = 0u;
char * ps1 = str1;
const char * ps2 = str2;
while (ps1)
{
if (ps1[0] == 0)
{
break;
}
ps1++;
pos1++;
}
while (ps2)
{
if (ps2[0] == 0)
{
break;
}
str1[pos1] = ps2[0];
ps2++;
pos1++;
}
str1[pos1] = 0;
return pos1;
}
//Returns length of the string.
Public U8 long2string (long nr, char *dest)
{
U8 c, i, imax, imax2, i2;
i2 = 0; i = 0;
if (nr == 0) dest[i++] = '0';
if (nr < 0) {i2 = 1; nr = 0 - nr; }
while (nr > 0)
{
c = nr % 10;
nr = nr / 10;
dest[i++] = '0' + c;
}
if (i2) dest[i++] = '-';
dest[i] = 0;
imax = i;
imax2 = imax / 2;
for (i = 0; i < imax2; ++i)
{
i2 = imax-i-1;
c = dest[i];
dest[i] = dest[i2];
dest[i2] = c;
}
return imax;
}
Public U8 hex2string(unsigned int hex, char *dest)
{
char c;
char *ps = dest;
unsigned char nibble;
do
{
nibble = hex & 0x0000000fu;
if (nibble <= 9u)
{
c = '0' + nibble;
}
else
{
c = 'A' + (nibble - 10);
}
*ps = c;
ps++;
hex = hex >> 4u;
}
while(hex > 0);
return 0;
}
|
<filename>src/materialbusyindicator.h
#ifndef MATERIALBUSYINDICATOR_H
#define MATERIALBUSYINDICATOR_H
#include <chrono>
#include <QWidget>
#include <QTimer>
#include <QPen>
#include <QtMath>
class MaterialBusyIndicator : public QWidget
{
Q_OBJECT
protected:
QTimer timer;
std::chrono::system_clock::time_point lastDraw;
QPen pen;
float rotationSpeed = 3.f;
float sizeSpeed = 2.f;
float sizeCollapseSpeed = 1.f;
float minSize = 0.1 * M_PI;
float maxSize = 1.5 * M_PI;
float rot = M_PI * 3 / 2;
float size = 0.f;
bool sizeCollapse = false;
public:
explicit MaterialBusyIndicator(QWidget *parent = nullptr);
protected:
void paintEvent(QPaintEvent *event) override;
protected slots:
void requestRepaint();
};
#endif // MATERIALBUSYINDICATOR_H
|
def listify(item, flatten=True, unholder=False):
if not isinstance(item, list):
if unholder and hasattr(item, 'held_object'):
item = item.held_object
return [item]
result = []
for i in item:
if unholder and hasattr(i, 'held_object'):
i = i.held_object
if flatten and isinstance(i, list):
result += listify(i, flatten=True, unholder=unholder)
else:
result.append(i)
return result |
<reponame>FuyaoLi2017/leetcode<gh_stars>1-10
/*
All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACGAATTCCG". When studying DNA, it is sometimes useful to identify repeated sequences within the DNA.
Write a function to find all the 10-letter-long sequences (substrings) that occur more than once in a DNA molecule.
Example:
Input: s = "AAAAACCCCCAAAAACCCCCCAAAAAGGGTTT"
Output: ["AAAAACCCCC", "CCCCCAAAAA"]
*/
class Solution {
public List<String> findRepeatedDnaSequences(String s) {
int L = 10, n = s.length();
if (n <= L) return new ArrayList();
// rolling hash parameters: base a
int a = 4, aL = (int)Math.pow(a, L);
// convert string to array of integers
Map<Character, Integer> toInt = new
HashMap() {{put('A', 0); put('C', 1); put('G', 2); put('T', 3); }};
int[] nums = new int[n];
for(int i = 0; i < n; ++i) nums[i] = toInt.get(s.charAt(i));
int bitmask = 0;
Set<Integer> seen = new HashSet();
Set<String> output = new HashSet();
// iterate over all sequences of length L
for (int start = 0; start < n - L + 1; ++start) {
// compute bitmask of the current sequence in O(1) time
if (start != 0) {
// left shift to free the last 2 bit
bitmask <<= 2;
// add a new 2-bits number in the last two bits
bitmask |= nums[start + L - 1];
// unset first two bits: 2L-bit and (2L + 1)-bit
bitmask &= ~(3 << 2 * L);
}
// compute hash of the first sequence in O(L) time
else {
for(int i = 0; i < L; ++i) {
bitmask <<= 2;
bitmask |= nums[i];
}
}
// update output and hashset of seen sequences
if (seen.contains(bitmask)) output.add(s.substring(start, start + L));
seen.add(bitmask);
}
return new ArrayList<String>(output);
}
}
|
// sahilarora.535 - NeverSettle
#include <bits/stdc++.h>
using namespace std;
#define fio ios_base::sync_with_stdio(false); cin.tie(NULL)
#define tr(c,i) for(__typeof((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define rep(i,begin,end)for(__typeof(end) i=(begin)-((begin)>(end));i!=(end)-((begin)>(end));i+=1-2*((begin)>(end)))
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define ii pair<int,int>
#define ll long long
#define pll pair<ll,ll>
#define ff first
#define ss second
#define all(a) (a).begin(), (a).end()
#define pb(x) push_back(x)
#define vi vector< int >
#define vvi vector< vi >
#define vll vector< ll >
#define vvll vector< vll >
#define vii vector< ii >
#define vvii vector< vii >
#define sz(C) int((C).size())
#define M_PI 3.14159265358979323846
#define EPS 1e-6
const ll INF = ~0ull >> 2;
ll MAX = 5353535;
const ll mod = 1e9+7;
vll dp(MAX, -1);
ll solve(ll x) {
ll ret = 0;
while (x > 1) {
ret += (x * (dp[x] - 1)) >> 1;
x /= dp[x];
}
return ret;
}
int main() {
fio;
ll t, l, r;
cin >> t >> l >> r;
rep (i, 2LL, MAX) {
if (dp[i] != -1) continue;
for (ll j = i; j < MAX; j += i) if (dp[j] == -1) dp[j] = i;
}
ll ans = 0;
rep (i, r + 1, l)
ans = (ans * t + solve(i)) % mod;
cout << ans << "\n";
return 0;
} |
/**
* Add this {@link Record} to {@code realm}.
*
* @param realm
* @return {@code true} if this {@link Record} was added to {@link realm};
* otherwise {@code false}
*/
public boolean addRealm(String realm) {
if(_realms.isEmpty()) {
_realms = Sets.newLinkedHashSet();
}
return _realms.add(realm) && (_hasModifiedRealms = true);
} |
<gh_stars>1-10
package com.robben.example.proxy.Static;
public class Purchasing implements Serve {
private Serve realityFactory;
public Purchasing(Serve realityFactory) {
this.realityFactory= realityFactory; //注入一个被代理类
}
@Override
public void service(float price) {
System.out.println("根据市场调研寻找到合适的工厂"); //前置增强
realityFactory.service(price); //工厂只负责制作衣服
System.out.println("工厂制作完毕,我负责帮您邮寄到家"); //后置增强
}
}
|
//Update the cell grid over time
private void step() {
for (int i = 0; i < Controller.getRows(); i++) {
for (int j = 0; j < Controller.getCols(); j++) {
for (int k = 0; k < myGrids.size(); k++) {
myGrids.get(k).update(i, j, myControllers.get(k).getState(i, j));
}
}
}
for (int k = 0; k < myGrids.size(); k++) {
myControllers.get(k).onePass();
}
} |
The present invention generally relates to proton conducting polymer membranes and methods of manufacture thereof, which are useful in methanol-based fuel cells.
Proton conducting polymer membranes, or polymer electrolyte membranes, are of general interest because such membranes can be used to conduct protons in fuel cells, which convert methanol into electrical energy and show promise as low emission power sources. Methanol-based fuel cells produce power through the electrochemical reaction of methanol and oxygen whereby oxygen is reduced at the cathode and methanol is oxidized at the anode. An appropriate polymer membrane is insoluble in water and methanol and is selectively permeable to hydrogen ions.
Fluorocarbon based resins, such as NAFION(trademark) and its derivatives, are the most common materials used in the manufacture of solid-polymer electrolyte membranes in methanol fuel cells. The membranes are stable and conduct protons. However, the membranes are permeable to methanol and allow significant amounts of methanol to diffuse through the membrane and crossover from the anode to cathode resulting in the spontaneous oxidation of methanol at the cathode. This oxidation depletes fuel from the cell and results in a loss of energy and efficiency. In addition, NAFION(trademark) membranes are not cost efficient because NAFION(trademark) is an expensive starting material and the fabricated membranes become unusable upon dehydration at elevated temperatures.
It would therefore be advantageous to develop alternative membrane materials that are more resistant to methanol diffusion (and thus crossover) and which preferably are less expensive than fluorocarbon-based polymers. It would also be desirable to easily and efficiently substitute the polymer to alter, based on specific application needs, the bulk material properties of the polymer material forming the membrane.
It is therefore an object of the present invention to provide compositions for use in proton conducting membranes having enhanced methanol diffusion resistance, and methods of manufacture thereof.
It is another object of the present invention to provide proton conducting membranes having enhanced methanol diffusion resistance and improved bulk properties, preferably at a lower cost than fluorocarbon-based polymers.
Proton conducting membranes having improved resistance to methanol crossover are provided, along with methods for their manufacture. In a preferred embodiment, the polymeric membranes are formed by (a) dissolving a polymer, preferably a polyphosphazene, in an organic solvent to form a polymer solution; (b) adding an oxyacid to the polymer solution; (c) optionally, adding water to the polymer solution, preferably in a molar ratio equivalent to the oxyacid; (d) optionally, concentrating the polymer solution; (e) casting the polymer solution on a casting surface, such as one formed of or coated with TEFLON(trademark); and (f) removing the organic solvent, such as by a controlled evaporation, so as to form the polymeric membrane.
A particularly useful application for these polymeric membranes is in fuel cells, such as those wherein methanol and oxygen are converted into electrical energy. |
The man behind the Looney Tunes.
The singular advantage of growing up in the 1950s was being able to watch Looney Toons on television. But the children of today need no longer feel culturally deprived. Now, with the release of The Looney Tunes Golden Collection, a selection of classic Looney Tunes, kiddies everywhere, by merely pressing a button, may gain entry into a veritable Age of Pericles—cartoonwise, that is.
But it’s not just the animation of the cartoons that’s so good. It’s the man who composed their music. You probably have never heard of him, and if you go looking for his name in the compendia of music—whether jazz, classical, popular—you’ll be unlikely to find him. He is, however, an authentic American genius, an original; if you were to hear even a few bars of any of his musical compositions you would recognize the source immediately.
“Putty Tat Trouble” His name is Carl Stalling. And from 1936, when he hooked up with Warner Bros., until his retirement in 1958, he wrote the musical scores for 600 cartoons. As the musicmaker of Merrie Melodies and Looney Toons, Stalling is as important, in his way, as Ives, Copland, Cage, Partch, and Ellington; his most notable compositions include “Putty Tat Trouble,” “Porky’s Poultry Plant,” “Speedy Gonzales Meets Two Crows From Tacos,” “To Itch His Own,” and hundreds more.
Walt Disney discovered Stalling in the early ‘20s at Kansas City’s Isis Theater, where Stalling was conducting his own orchestra and improvising on the organ to silent movies. Stalling would have been in his early 30s then. Born in Lexington, Mo., he saw The Great Train Robbery projected in a tent when he was 5. From that point on, he was hooked on motion pictures. By the time he was 13, he had become resident pianist at the primitive local movie house where he played during reel changes.
“Dough for the Dodo” Disney had Stalling score two animated shorts for a new character named Mickey Mouse. When Disney set up his studio in Hollywood, he brought Stalling along with him. Stalling invented cartoon scoring, which included a “tick” system, whereby individual members of the orchestra were provided with earphones through which they heard a steady beat and, on one occasion, the voice of Mickey, and which allowed them to synchronize the music more precisely to the action.
“My Bunny Lies Over the Sea” In a sense, then, Carl Stalling was, among the first of the postmodernists—if not the first. His compositions are wildly disjunctive, incorporating tempo shifts, mixed genres (folk motifs, classical, jazz, nursery rhymes), sound effects, speed of transition. He characteristically moves from a stormy, dissonant section to a flute solo, maybe throwing in a quotation from a jazz standard or Rimsky-Korsakov’s “Flight of the Bumblebee.” He was very fond (some might say too fond) of quoting from bandleader, pianist, and composer Raymond Scott, who recorded some notable novelty pieces with a studio quintet between 1936 and 1938—tunes like “Dinner Music for a Pack of Hungry Cannibals,” a Stalling favorite. But Stalling was nothing if not voracious and democratic in his cribbing when it suited the action. For instance, Mendelsohn’s “Fingal’s Cave” made a good match with the Mynah Bird’s walk in Chuck Jones’ “Inki” cartoons.
“Speedy Gonzalez” Even with all the quotations from Scott, classical music, and so forth, some 80 percent to 90 percent of the material was original; it had to be specifically matched to the action. Stalling had a 60-piece orchestra to work with at Warner Bros., and by all accounts the musicians looked forward to the sessions, especially between Bette Davis and Bogart melodramas. Stalling would write the piano parts of the score—the skeleton—and include the cues he wanted and special notations with regard to instrumentation. He was blessed with a brilliant arranger in Milt Franklin and an equally brilliant sound-effects man in Treg Brown, something of a comic genius in his own right—excellent with breaking glass, etc.
When Stalling died in 1974, at the age of 86, the fizz had long gone out of American animation with the televised cartoon. Stalling attributed it to the ascendancy of dialogue over music. But the conventions of the medium had hardened while at the same time the product had become more diluted. The market, not the artist, determined what was produced. That tendency has not abated. But every medium or genre has its heyday, be it the musical comedy, dance, the horror movie, or painted still life. These moments depend on cultural and economic forces, accident, a serendipitous conjunction of geniuses—like thatwhen Disney first found Stalling at the Isis Theater. In short order, Mickey Mouse was the king of cartoons, Disney Hollywood royalty, and Stalling, who had picked out tunes on a broken toy piano as a child, was providing the wackiest soundtrack any child or grown-up dared imagine. The lid was off American animation and would stay off for a good long while. |
Application of Cost Approach for Pavement Valuation and Asset Management An application of the cost approach for valuing pavements is presented. Asset management for civil infrastructure has been increasingly promoted since the 1990s, following the Governmental Accounting Standards Boards infrastructure reporting requirement for state and local governments. There are several ongoing developments in the research, administration, and practice of transportation asset management related to incorporating asset valuation concepts and techniques into existing management systems. To contribute to ongoing developments in this area, a case study is developed to demonstrate an integration of the cost approach for asset valuation with an existing pavement management system and to discuss how the results are useful for asset management. The results demonstrate that the cost approach captures the relationship among pavement value, performance, and time and can be used to capture the added value of pavement maintenance activities. The results also show that the cost approach can be incorporated into various management systems and used as a common basis for evaluating investment trade-offs for different types of infrastructure in order to enhance the overall value of a mixed asset base. The results also indicate that the cost approach can provide a useful common basis and language for discussions among engineers, managers, and stakeholders and is a powerful concept for enhancing the planning and investment decision-making process. The results are potentially useful to agencies involved in upgrading their infrastructure management systems to incorporate asset valuation and to other researchers involved in developing and integrating useful approaches for infrastructure valuation in existing management systems. |
<filename>gdal/ogr/ogrsf_frmts/gml/parsexsd.cpp
/******************************************************************************
*
* Project: GML Reader
* Purpose: Implementation of GMLParseXSD()
* Author: <NAME>, <EMAIL>
*
******************************************************************************
* Copyright (c) 2005, <NAME>
* Copyright (c) 2010-2014, <NAME> <even dot rouault at mines-paris dot org>
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
****************************************************************************/
#include "cpl_port.h"
#include "parsexsd.h"
#include <cstdlib>
#include <cstring>
#include <set>
#include <string>
#include "cpl_conv.h"
#include "cpl_error.h"
#include "cpl_http.h"
#include "cpl_minixml.h"
#include "cpl_string.h"
#include "ogr_core.h"
CPL_CVSID("$Id$")
/************************************************************************/
/* StripNS() */
/* */
/* Return potentially shortened form of string with namespace */
/* stripped off if there is one. Returns pointer into */
/* original string. */
/************************************************************************/
static const char *StripNS(const char *pszFullValue)
{
const char *pszColon = strstr(pszFullValue, ":");
if( pszColon == NULL )
return pszFullValue;
else
return pszColon + 1;
}
/************************************************************************/
/* GetSimpleTypeProperties() */
/************************************************************************/
static
bool GetSimpleTypeProperties(CPLXMLNode *psTypeNode,
GMLPropertyType *pGMLType,
int *pnWidth,
int *pnPrecision)
{
const char *pszBase =
StripNS(CPLGetXMLValue(psTypeNode, "restriction.base", ""));
if( EQUAL(pszBase, "decimal") )
{
*pGMLType = GMLPT_Real;
const char *pszWidth =
CPLGetXMLValue(psTypeNode, "restriction.totalDigits.value", "0");
const char *pszPrecision =
CPLGetXMLValue(psTypeNode, "restriction.fractionDigits.value", "0");
*pnWidth = atoi(pszWidth);
*pnPrecision = atoi(pszPrecision);
return true;
}
else if( EQUAL(pszBase, "float") )
{
*pGMLType = GMLPT_Float;
return true;
}
else if( EQUAL(pszBase, "double") )
{
*pGMLType = GMLPT_Real;
return true;
}
else if( EQUAL(pszBase, "integer") )
{
*pGMLType = GMLPT_Integer;
const char *pszWidth =
CPLGetXMLValue(psTypeNode, "restriction.totalDigits.value", "0");
*pnWidth = atoi(pszWidth);
return true;
}
else if( EQUAL(pszBase, "long") )
{
*pGMLType = GMLPT_Integer64;
const char *pszWidth =
CPLGetXMLValue(psTypeNode, "restriction.totalDigits.value", "0");
*pnWidth = atoi(pszWidth);
return true;
}
else if( EQUAL(pszBase, "long") )
{
*pGMLType = GMLPT_Integer64;
const char *pszWidth =
CPLGetXMLValue(psTypeNode, "restriction.totalDigits.value", "0");
*pnWidth = atoi(pszWidth);
return true;
}
else if( EQUAL(pszBase, "string") )
{
*pGMLType = GMLPT_String;
const char *pszWidth =
CPLGetXMLValue(psTypeNode, "restriction.maxLength.value", "0");
*pnWidth = atoi(pszWidth);
return true;
}
/* TODO: Would be nice to have a proper date type */
else if( EQUAL(pszBase, "date") ||
EQUAL(pszBase, "dateTime") )
{
*pGMLType = GMLPT_String;
return true;
}
else if( EQUAL(pszBase, "boolean") )
{
*pGMLType = GMLPT_Boolean;
return true;
}
else if( EQUAL(pszBase, "short") )
{
*pGMLType = GMLPT_Short;
return true;
}
return false;
}
/************************************************************************/
/* LookForSimpleType() */
/************************************************************************/
static
bool LookForSimpleType(CPLXMLNode *psSchemaNode,
const char* pszStrippedNSType,
GMLPropertyType *pGMLType,
int *pnWidth,
int *pnPrecision)
{
CPLXMLNode *psThis = psSchemaNode->psChild;
for( ; psThis != NULL; psThis = psThis->psNext )
{
if( psThis->eType == CXT_Element &&
EQUAL(psThis->pszValue, "simpleType") &&
EQUAL(CPLGetXMLValue(psThis, "name", ""), pszStrippedNSType) )
{
break;
}
}
if( psThis == NULL )
return false;
return GetSimpleTypeProperties(psThis, pGMLType, pnWidth, pnPrecision);
}
/************************************************************************/
/* GetSingleChildElement() */
/************************************************************************/
/* Returns the child element whose name is pszExpectedValue only if */
/* there is only one child that is an element. */
static
CPLXMLNode *GetSingleChildElement(CPLXMLNode *psNode,
const char *pszExpectedValue)
{
if( psNode == NULL )
return NULL;
CPLXMLNode *psIter = psNode->psChild;
if( psIter == NULL )
return NULL;
CPLXMLNode *psChild = NULL;
while( psIter != NULL )
{
if( psIter->eType == CXT_Element )
{
if( psChild != NULL )
return NULL;
if( pszExpectedValue != NULL &&
strcmp(psIter->pszValue, pszExpectedValue) != 0 )
return NULL;
psChild = psIter;
}
psIter = psIter->psNext;
}
return psChild;
}
/************************************************************************/
/* CheckMinMaxOccursCardinality() */
/************************************************************************/
static int CheckMinMaxOccursCardinality(CPLXMLNode *psNode)
{
const char *pszMinOccurs = CPLGetXMLValue(psNode, "minOccurs", NULL);
const char *pszMaxOccurs = CPLGetXMLValue(psNode, "maxOccurs", NULL);
return (pszMinOccurs == NULL || EQUAL(pszMinOccurs, "0") ||
EQUAL(pszMinOccurs, "1")) &&
(pszMaxOccurs == NULL || EQUAL(pszMaxOccurs, "1"));
}
/************************************************************************/
/* GetListTypeFromSingleType() */
/************************************************************************/
static GMLPropertyType GetListTypeFromSingleType(GMLPropertyType eType)
{
if( eType == GMLPT_String )
return GMLPT_StringList;
if( eType == GMLPT_Integer || eType == GMLPT_Short )
return GMLPT_IntegerList;
if( eType == GMLPT_Integer64 )
return GMLPT_Integer64List;
if( eType == GMLPT_Real || eType == GMLPT_Float )
return GMLPT_RealList;
if( eType == GMLPT_Boolean )
return GMLPT_BooleanList;
if( eType == GMLPT_FeatureProperty )
return GMLPT_FeaturePropertyList;
return eType;
}
/************************************************************************/
/* ParseFeatureType() */
/************************************************************************/
typedef struct
{
const char *pszName;
OGRwkbGeometryType eType;
} AssocNameType;
static const AssocNameType apsPropertyTypes[] =
{
{"GeometryPropertyType", wkbUnknown},
{"PointPropertyType", wkbPoint},
{"LineStringPropertyType", wkbLineString},
{"CurvePropertyType", wkbCompoundCurve},
{"PolygonPropertyType", wkbPolygon},
{"SurfacePropertyType", wkbCurvePolygon},
{"MultiPointPropertyType", wkbMultiPoint},
{"MultiLineStringPropertyType", wkbMultiLineString},
{"MultiCurvePropertyType", wkbMultiCurve},
{"MultiPolygonPropertyType", wkbMultiPolygon},
{"MultiSurfacePropertyType", wkbMultiSurface},
{"MultiGeometryPropertyType", wkbGeometryCollection},
{"GeometryAssociationType", wkbUnknown},
{NULL, wkbUnknown},
};
/* Found in FME .xsd (e.g. <element ref="gml:curveProperty" minOccurs="0"/>) */
static const AssocNameType apsRefTypes[] =
{
{"pointProperty", wkbPoint},
{"curveProperty", wkbLineString}, // Should we promote to wkbCompoundCurve?
{"surfaceProperty", wkbPolygon}, // Should we promote to wkbCurvePolygon?
{"multiPointProperty", wkbMultiPoint},
{"multiCurveProperty", wkbMultiLineString},
// Should we promote to wkbMultiSurface?
{"multiSurfaceProperty", wkbMultiPolygon},
{NULL, wkbUnknown},
};
static
GMLFeatureClass *GMLParseFeatureType(CPLXMLNode *psSchemaNode,
const char *pszName,
CPLXMLNode *psThis);
static
GMLFeatureClass *GMLParseFeatureType(CPLXMLNode *psSchemaNode,
const char *pszName,
const char *pszType)
{
CPLXMLNode *psThis = psSchemaNode->psChild;
for( ; psThis != NULL; psThis = psThis->psNext )
{
if( psThis->eType == CXT_Element &&
EQUAL(psThis->pszValue, "complexType") &&
EQUAL(CPLGetXMLValue(psThis, "name", ""), pszType) )
{
break;
}
}
if( psThis == NULL )
return NULL;
return GMLParseFeatureType(psSchemaNode, pszName, psThis);
}
static
GMLFeatureClass *GMLParseFeatureType(CPLXMLNode *psSchemaNode,
const char *pszName,
CPLXMLNode *psComplexType)
{
/* -------------------------------------------------------------------- */
/* Grab the sequence of extensions greatgrandchild. */
/* -------------------------------------------------------------------- */
CPLXMLNode *psAttrSeq =
CPLGetXMLNode(psComplexType, "complexContent.extension.sequence");
if( psAttrSeq == NULL )
{
return NULL;
}
/* -------------------------------------------------------------------- */
/* We are pretty sure this going to be a valid Feature class */
/* now, so create it. */
/* -------------------------------------------------------------------- */
GMLFeatureClass *poClass = new GMLFeatureClass(pszName);
/* -------------------------------------------------------------------- */
/* Loop over each of the attribute elements being defined for */
/* this feature class. */
/* -------------------------------------------------------------------- */
int nAttributeIndex = 0;
bool bGotUnrecognizedType = false;
CPLXMLNode *psAttrDef = psAttrSeq->psChild;
for( ; psAttrDef != NULL; psAttrDef = psAttrDef->psNext )
{
if( strcmp(psAttrDef->pszValue, "group") == 0 )
{
/* Too complex schema for us. Aborts parsing */
delete poClass;
return NULL;
}
/* Parse stuff like:
<xs:choice>
<xs:element ref="gml:polygonProperty"/>
<xs:element ref="gml:multiPolygonProperty"/>
</xs:choice>
as found in https://downloadagiv.blob.core.windows.net/overstromingsgebieden-en-oeverzones/2014_01/Overstromingsgebieden_en_oeverzones_2014_01_GML.zip
*/
if( strcmp(psAttrDef->pszValue, "choice") == 0 )
{
CPLXMLNode *psChild = psAttrDef->psChild;
bool bPolygon = false;
bool bMultiPolygon = false;
for( ; psChild; psChild = psChild->psNext )
{
if( psChild->eType != CXT_Element )
continue;
if( strcmp(psChild->pszValue, "element") == 0 )
{
const char *pszRef = CPLGetXMLValue(psChild, "ref", NULL);
if( pszRef != NULL )
{
if( strcmp(pszRef, "gml:polygonProperty") == 0 )
{
bPolygon = true;
}
else if( strcmp(pszRef, "gml:multiPolygonProperty") == 0 )
{
bMultiPolygon = true;
}
else
{
delete poClass;
return NULL;
}
}
else
{
delete poClass;
return NULL;
}
}
}
if( bPolygon && bMultiPolygon )
{
poClass->AddGeometryProperty(new GMLGeometryPropertyDefn(
"", "", wkbMultiPolygon, nAttributeIndex, true));
nAttributeIndex++;
}
continue;
}
if( !EQUAL(psAttrDef->pszValue, "element") )
continue;
// MapServer WFS writes element type as an attribute of element
// not as a simpleType definition.
const char *pszType = CPLGetXMLValue(psAttrDef, "type", NULL);
const char *pszElementName = CPLGetXMLValue(psAttrDef, "name", NULL);
bool bNullable =
EQUAL(CPLGetXMLValue(psAttrDef, "minOccurs", "1"), "0");
const char *pszMaxOccurs = CPLGetXMLValue(psAttrDef, "maxOccurs", NULL);
if (pszType != NULL)
{
const char *pszStrippedNSType = StripNS(pszType);
int nWidth = 0;
int nPrecision = 0;
GMLPropertyType gmlType = GMLPT_Untyped;
if (EQUAL(pszStrippedNSType, "string") ||
EQUAL(pszStrippedNSType, "Character"))
gmlType = GMLPT_String;
// TODO: Would be nice to have a proper date type.
else if (EQUAL(pszStrippedNSType, "date") ||
EQUAL(pszStrippedNSType, "dateTime"))
gmlType = GMLPT_String;
else if (EQUAL(pszStrippedNSType, "real") ||
EQUAL(pszStrippedNSType, "double") ||
EQUAL(pszStrippedNSType, "decimal"))
gmlType = GMLPT_Real;
else if (EQUAL(pszStrippedNSType, "float") )
gmlType = GMLPT_Float;
else if (EQUAL(pszStrippedNSType, "int") ||
EQUAL(pszStrippedNSType, "integer"))
gmlType = GMLPT_Integer;
else if (EQUAL(pszStrippedNSType, "long"))
gmlType = GMLPT_Integer64;
else if (EQUAL(pszStrippedNSType, "short") )
gmlType = GMLPT_Short;
else if (EQUAL(pszStrippedNSType, "boolean") )
gmlType = GMLPT_Boolean;
else if (strcmp(pszType, "gml:FeaturePropertyType") == 0 )
{
gmlType = GMLPT_FeatureProperty;
}
else if (STARTS_WITH(pszType, "gml:"))
{
const AssocNameType *psIter = apsPropertyTypes;
while(psIter->pszName)
{
if (strncmp(pszType + 4, psIter->pszName,
strlen(psIter->pszName)) == 0)
{
OGRwkbGeometryType eType = psIter->eType;
// Look if there's a comment restricting to subclasses.
if( psAttrDef->psNext != NULL &&
psAttrDef->psNext->eType == CXT_Comment )
{
if( strstr(psAttrDef->psNext->pszValue,
"restricted to Polygon") )
eType = wkbPolygon;
else if( strstr(psAttrDef->psNext->pszValue,
"restricted to LineString") )
eType = wkbLineString;
else if( strstr(psAttrDef->psNext->pszValue,
"restricted to MultiPolygon") )
eType = wkbMultiPolygon;
else if( strstr(psAttrDef->psNext->pszValue,
"restricted to MultiLineString") )
eType = wkbMultiLineString;
}
poClass->AddGeometryProperty(
new GMLGeometryPropertyDefn(
pszElementName, pszElementName, eType,
nAttributeIndex, bNullable));
nAttributeIndex++;
break;
}
psIter++;
}
if (psIter->pszName == NULL)
{
// Can be a non geometry gml type.
// Too complex schema for us. Aborts parsing.
delete poClass;
return NULL;
}
if (poClass->GetGeometryPropertyCount() == 0)
bGotUnrecognizedType = true;
continue;
}
/* Integraph stuff */
else if (strcmp(pszType, "G:Point_MultiPointPropertyType") == 0 ||
strcmp(pszType, "gmgml:Point_MultiPointPropertyType") == 0)
{
poClass->AddGeometryProperty(new GMLGeometryPropertyDefn(
pszElementName, pszElementName, wkbMultiPoint,
nAttributeIndex, bNullable));
nAttributeIndex++;
continue;
}
else if (strcmp(pszType,
"G:LineString_MultiLineStringPropertyType") == 0 ||
strcmp(pszType,
"gmgml:LineString_MultiLineStringPropertyType") == 0)
{
poClass->AddGeometryProperty(new GMLGeometryPropertyDefn(
pszElementName, pszElementName, wkbMultiLineString,
nAttributeIndex, bNullable));
nAttributeIndex++;
continue;
}
else if (strcmp(pszType,
"G:Polygon_MultiPolygonPropertyType") == 0 ||
strcmp(pszType,
"gmgml:Polygon_MultiPolygonPropertyType") == 0 ||
strcmp(pszType,
"gmgml:Polygon_Surface_MultiSurface_CompositeSurfacePropertyType") == 0)
{
poClass->AddGeometryProperty(new GMLGeometryPropertyDefn(
pszElementName, pszElementName, wkbMultiPolygon,
nAttributeIndex, bNullable));
nAttributeIndex++;
continue;
}
// ERDAS Apollo stufflike in
// http://apollo.erdas.com/erdas-apollo/vector/WORLDWIDE?SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&TYPENAME=wfs:cntry98)
else if (strcmp(pszType, "wfs:MixedPolygonPropertyType") == 0)
{
poClass->AddGeometryProperty(new GMLGeometryPropertyDefn(
pszElementName, pszElementName, wkbMultiPolygon,
nAttributeIndex, bNullable));
nAttributeIndex++;
continue;
}
else
{
gmlType = GMLPT_Untyped;
if ( !LookForSimpleType(psSchemaNode, pszStrippedNSType,
&gmlType, &nWidth, &nPrecision) )
{
// Too complex schema for us. Aborts parsing.
delete poClass;
return NULL;
}
}
if (pszElementName == NULL)
pszElementName = "unnamed";
const char *pszPropertyName = pszElementName;
if( gmlType == GMLPT_FeatureProperty )
{
pszPropertyName = CPLSPrintf("%s_href", pszElementName);
}
GMLPropertyDefn *poProp =
new GMLPropertyDefn(pszPropertyName, pszElementName);
if( pszMaxOccurs != NULL && strcmp(pszMaxOccurs, "1") != 0 )
gmlType = GetListTypeFromSingleType(gmlType);
poProp->SetType(gmlType);
poProp->SetWidth(nWidth);
poProp->SetPrecision(nPrecision);
poProp->SetNullable(bNullable);
if (poClass->AddProperty( poProp ) < 0)
delete poProp;
else
nAttributeIndex++;
continue;
}
// For now we skip geometries. Fixup later.
CPLXMLNode *psSimpleType = CPLGetXMLNode(psAttrDef, "simpleType");
if( psSimpleType == NULL )
{
const char *pszRef = CPLGetXMLValue(psAttrDef, "ref", NULL);
// FME .xsd
if (pszRef != NULL && STARTS_WITH(pszRef, "gml:"))
{
const AssocNameType *psIter = apsRefTypes;
while(psIter->pszName)
{
if (strncmp(pszRef + 4, psIter->pszName,
strlen(psIter->pszName)) == 0)
{
if (poClass->GetGeometryPropertyCount() > 0)
{
OGRwkbGeometryType eNewType = psIter->eType;
OGRwkbGeometryType eOldType =
(OGRwkbGeometryType)poClass
->GetGeometryProperty(0)
->GetType();
if ((eNewType == wkbMultiPoint &&
eOldType == wkbPoint) ||
(eNewType == wkbMultiLineString &&
eOldType == wkbLineString) ||
(eNewType == wkbMultiPolygon &&
eOldType == wkbPolygon))
{
poClass->GetGeometryProperty(0)->SetType(
eNewType);
}
else
{
CPLDebug(
"GML",
"Geometry field already found ! "
"Ignoring the following ones");
}
}
else
{
poClass->AddGeometryProperty(
new GMLGeometryPropertyDefn(
pszElementName, pszElementName,
psIter->eType, nAttributeIndex, true));
nAttributeIndex++;
}
break;
}
psIter++;
}
if (psIter->pszName == NULL)
{
// Can be a non geometry gml type .
// Too complex schema for us. Aborts parsing.
delete poClass;
return NULL;
}
if (poClass->GetGeometryPropertyCount() == 0)
bGotUnrecognizedType = true;
continue;
}
/* Parse stuff like the following found in http://192.168.3.11:8181/miwfs/GetFeature.ashx?REQUEST=GetFeature&MAXFEATURES=1&SERVICE=WFS&VERSION=1.0.0&TYPENAME=miwfs:World :
<xs:element name="Obj" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element ref="gml:_Geometry"/>
</xs:sequence>
</xs:complexType>
</xs:element>
*/
CPLXMLNode *l_psComplexType =
GetSingleChildElement(psAttrDef, "complexType");
CPLXMLNode *psComplexTypeSequence =
GetSingleChildElement(l_psComplexType, "sequence");
CPLXMLNode *psComplexTypeSequenceElement =
GetSingleChildElement(psComplexTypeSequence, "element");
if( pszElementName != NULL &&
CheckMinMaxOccursCardinality(psAttrDef) &&
psComplexTypeSequenceElement != NULL &&
CheckMinMaxOccursCardinality(psComplexTypeSequence) &&
strcmp(CPLGetXMLValue(psComplexTypeSequenceElement, "ref", ""),
"gml:_Geometry") == 0 )
{
poClass->AddGeometryProperty(new GMLGeometryPropertyDefn(
pszElementName, pszElementName, wkbUnknown, nAttributeIndex,
bNullable));
nAttributeIndex++;
continue;
}
else
{
// Too complex schema for us. Aborts parsing.
delete poClass;
return NULL;
}
}
if (pszElementName == NULL)
pszElementName = "unnamed";
GMLPropertyDefn *poProp =
new GMLPropertyDefn(pszElementName, pszElementName);
GMLPropertyType eType = GMLPT_Untyped;
int nWidth = 0;
int nPrecision = 0;
GetSimpleTypeProperties(psSimpleType, &eType, &nWidth, &nPrecision);
if( pszMaxOccurs != NULL && strcmp(pszMaxOccurs, "1") != 0 )
eType = GetListTypeFromSingleType(eType);
poProp->SetType(eType);
poProp->SetWidth(nWidth);
poProp->SetPrecision(nPrecision);
poProp->SetNullable(bNullable);
if (poClass->AddProperty(poProp) < 0)
delete poProp;
else
nAttributeIndex++;
}
// If we have found an unknown types, let's be on the side of caution and
// create a geometry field.
if( poClass->GetGeometryPropertyCount() == 0 &&
bGotUnrecognizedType )
{
poClass->AddGeometryProperty(
new GMLGeometryPropertyDefn("", "", wkbUnknown, -1, true));
}
/* -------------------------------------------------------------------- */
/* Class complete, add to reader class list. */
/* -------------------------------------------------------------------- */
poClass->SetSchemaLocked(true);
return poClass;
}
/************************************************************************/
/* GMLParseXMLFile() */
/************************************************************************/
static CPLXMLNode *GMLParseXMLFile(const char *pszFilename)
{
if( STARTS_WITH(pszFilename, "http://") ||
STARTS_WITH(pszFilename, "https://") )
{
CPLXMLNode *psRet = NULL;
CPLHTTPResult *psResult = CPLHTTPFetch(pszFilename, NULL);
if( psResult != NULL )
{
if( psResult->pabyData != NULL )
{
psRet = CPLParseXMLString((const char *)psResult->pabyData);
}
CPLHTTPDestroyResult(psResult);
}
return psRet;
}
else
{
return CPLParseXMLFile(pszFilename);
}
}
/************************************************************************/
/* CPLGetFirstChildNode() */
/************************************************************************/
static CPLXMLNode *CPLGetFirstChildNode(CPLXMLNode *psNode)
{
if( psNode == NULL )
return NULL;
CPLXMLNode *psIter = psNode->psChild;
while( psIter != NULL )
{
if( psIter->eType == CXT_Element )
return psIter;
psIter = psIter->psNext;
}
return NULL;
}
/************************************************************************/
/* CPLGetLastNode() */
/************************************************************************/
static CPLXMLNode *CPLGetLastNode(CPLXMLNode *psNode)
{
CPLXMLNode *psIter = psNode;
while( psIter->psNext != NULL )
psIter = psIter->psNext;
return psIter;
}
/************************************************************************/
/* CPLXMLSchemaResolveInclude() */
/************************************************************************/
static
void CPLXMLSchemaResolveInclude( const char *pszMainSchemaLocation,
CPLXMLNode *psSchemaNode )
{
std::set<CPLString> osAlreadyIncluded;
bool bTryAgain;
do
{
CPLXMLNode *psLast = NULL;
bTryAgain = false;
CPLXMLNode *psThis = psSchemaNode->psChild;
for( ; psThis != NULL; psThis = psThis->psNext )
{
if( psThis->eType == CXT_Element &&
EQUAL(psThis->pszValue, "include") )
{
const char *pszSchemaLocation =
CPLGetXMLValue(psThis, "schemaLocation", NULL);
if( pszSchemaLocation != NULL &&
osAlreadyIncluded.count( pszSchemaLocation) == 0 )
{
osAlreadyIncluded.insert( pszSchemaLocation );
if( !STARTS_WITH(pszSchemaLocation, "http://") &&
!STARTS_WITH(pszSchemaLocation, "https://") &&
CPLIsFilenameRelative(pszSchemaLocation) )
{
pszSchemaLocation =
CPLFormFilename(CPLGetPath(pszMainSchemaLocation),
pszSchemaLocation, NULL);
}
CPLXMLNode *psIncludedXSDTree =
GMLParseXMLFile( pszSchemaLocation );
if( psIncludedXSDTree != NULL )
{
CPLStripXMLNamespace(psIncludedXSDTree, NULL, TRUE);
CPLXMLNode *psIncludedSchemaNode =
CPLGetXMLNode(psIncludedXSDTree, "=schema");
if( psIncludedSchemaNode != NULL )
{
// Substitute de <include> node by its content.
CPLXMLNode *psFirstChildElement =
CPLGetFirstChildNode(psIncludedSchemaNode);
if( psFirstChildElement != NULL )
{
CPLXMLNode *psCopy =
CPLCloneXMLTree(psFirstChildElement);
if( psLast != NULL )
psLast->psNext = psCopy;
else
psSchemaNode->psChild = psCopy;
CPLXMLNode *psNext = psThis->psNext;
psThis->psNext = NULL;
CPLDestroyXMLNode(psThis);
psThis = CPLGetLastNode(psCopy);
psThis->psNext = psNext;
// In case the included schema also contains
// includes.
bTryAgain = true;
}
}
CPLDestroyXMLNode(psIncludedXSDTree);
}
}
}
psLast = psThis;
}
} while( bTryAgain );
const char *pszSchemaOutputName =
CPLGetConfigOption("GML_SCHEMA_OUTPUT_NAME", NULL);
if( pszSchemaOutputName != NULL )
{
CPLSerializeXMLTreeToFile(psSchemaNode, pszSchemaOutputName);
}
}
/************************************************************************/
/* GMLParseXSD() */
/************************************************************************/
bool GMLParseXSD( const char *pszFile,
std::vector<GMLFeatureClass*> &aosClasses,
bool &bFullyUnderstood)
{
bFullyUnderstood = false;
if( pszFile == NULL )
return false;
/* -------------------------------------------------------------------- */
/* Load the raw XML file. */
/* -------------------------------------------------------------------- */
CPLXMLNode *psXSDTree = GMLParseXMLFile(pszFile);
if( psXSDTree == NULL )
return false;
/* -------------------------------------------------------------------- */
/* Strip off any namespace qualifiers. */
/* -------------------------------------------------------------------- */
CPLStripXMLNamespace( psXSDTree, NULL, TRUE );
/* -------------------------------------------------------------------- */
/* Find <schema> root element. */
/* -------------------------------------------------------------------- */
CPLXMLNode *psSchemaNode = CPLGetXMLNode(psXSDTree, "=schema");
if( psSchemaNode == NULL )
{
CPLDestroyXMLNode( psXSDTree );
return false;
}
/* ==================================================================== */
/* Process each include directive. */
/* ==================================================================== */
CPLXMLSchemaResolveInclude(pszFile, psSchemaNode);
// CPLSerializeXMLTreeToFile(psSchemaNode, "/vsistdout/");
bFullyUnderstood = true;
/* ==================================================================== */
/* Process each feature class definition. */
/* ==================================================================== */
CPLXMLNode *psThis = psSchemaNode->psChild;
for( ; psThis != NULL; psThis = psThis->psNext )
{
/* -------------------------------------------------------------------- */
/* Check for <xs:element> node. */
/* -------------------------------------------------------------------- */
if( psThis->eType != CXT_Element
|| !EQUAL(psThis->pszValue, "element") )
continue;
/* -------------------------------------------------------------------- */
/* Check the substitution group. */
/* -------------------------------------------------------------------- */
const char *pszSubGroup =
StripNS(CPLGetXMLValue(psThis, "substitutionGroup", ""));
// Old OGR produced elements for the feature collection.
if( EQUAL(pszSubGroup, "_FeatureCollection") )
continue;
// AbstractFeature used by GML 3.2.
if( !EQUAL(pszSubGroup, "_Feature") &&
!EQUAL(pszSubGroup, "AbstractFeature") )
{
continue;
}
/* -------------------------------------------------------------------- */
/* Get name */
/* -------------------------------------------------------------------- */
const char *pszName = CPLGetXMLValue(psThis, "name", NULL);
if( pszName == NULL )
{
continue;
}
/* -------------------------------------------------------------------- */
/* Get type and verify relationship with name. */
/* -------------------------------------------------------------------- */
const char *pszType = CPLGetXMLValue(psThis, "type", NULL);
if (pszType == NULL)
{
CPLXMLNode *psComplexType = CPLGetXMLNode(psThis, "complexType");
if (psComplexType)
{
GMLFeatureClass *poClass =
GMLParseFeatureType(psSchemaNode, pszName, psComplexType);
if (poClass)
aosClasses.push_back(poClass);
else
bFullyUnderstood = false;
}
continue;
}
if( strstr(pszType, ":") != NULL )
pszType = strstr(pszType, ":") + 1;
if( EQUAL(pszType, pszName) )
{
// A few WFS servers return a type name which is the element name
// without any _Type or Type suffix
// e.g.:
// http://apollo.erdas.com/erdas-apollo/vector/Cherokee?SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&TYPENAME=iwfs:Air */
// TODO(schwehr): What was supposed to go here?
}
// <element name="RekisteriyksikonPalstanTietoja" type="ktjkiiwfs:PalstanTietojaType" substitutionGroup="gml:_Feature" />
else if( strlen(pszType) > 4 &&
strcmp(pszType + strlen(pszType) - 4, "Type") == 0 &&
strlen(pszName) > strlen(pszType) - 4 &&
strncmp(pszName + strlen(pszName) - (strlen(pszType) - 4),
pszType,
strlen(pszType) - 4) == 0 ) {
}
else if( !EQUALN(pszType, pszName, strlen(pszName))
|| !(EQUAL(pszType + strlen(pszName), "_Type") ||
EQUAL(pszType + strlen(pszName), "Type")) )
{
continue;
}
// CanVec .xsd contains weird types that are not used in the related
// GML.
if (STARTS_WITH(pszName, "XyZz") ||
STARTS_WITH(pszName, "XyZ1") ||
STARTS_WITH(pszName, "XyZ2"))
continue;
GMLFeatureClass *poClass =
GMLParseFeatureType(psSchemaNode, pszName, pszType);
if (poClass)
aosClasses.push_back(poClass);
else
bFullyUnderstood = false;
}
CPLDestroyXMLNode(psXSDTree);
return !aosClasses.empty();
}
|
As Thanksgiving fades into the background and you prepare to see your vegan family member for upcoming holidays, I’d like to say a few things that your loved one may not be able to. I’m not writing this letter to anger or shame you, but rather to encourage you to attempt to develop greater insight into what’s going on with your loved one.
To set the stage, allow me to engage you in a thought experiment that I’d like you to really take seriously. Imagine that you’re going to a holiday event that’s serving a roasted cat as the main dish. Imagine the host “preparing” the dead cat, removing her guts, inserting bread crumbs into her anal cavity, and placing her body in the oven. Later, when the cat is fully cooked, you sit at the table watching others carve up the cat while making merry as if they weren’t eating a cat in front of you. (I’m assuming you’re not partaking in dining on the cat in this scenario.)
End scene. Is the thought of participating in this event upsetting to you? How do you feel about the participants? If you’re like most people, this scenario would be profoundly disturbing. Welcome to the world of being vegan during a non-vegan holiday.
An important aspect of the vegan ethic is that we view all sentient animals as being the same and equally deserving of life. We make no distinctions between the value of a turkey vs. a cat. vs. a dolphin vs. a dog vs. a cow.
The only thing that truly distinguishes these thinking, feeling animals from one another is what we have been taught about their “use.” Society views killing and eating turkeys as acceptable, while other animals are considered off-limits for consumption.
For vegans, all animals are off-limits for consumption, since all think and feel; all have a desire to live, just like us. There is no difference between species in the mind of a vegan. Vegans have unlearned the arbitary distinctions among them, and so it’s every bit as upsetting to witness harm done to a turkey or pig as it is to witness harm done to a cat or a dog. We no longer see a difference like non-vegans do, and many of us have built relationships with animals from these “farmed” animal species as others might with a traditional household pet.
So, if you have a vegan family member coming over for your non-vegan holiday, I’d like for you to be aware that it’s likely very difficult for them. Not only because they have to witness the mutilation and consumption of an animal who wanted to live, but also because they’re observing those they care most about directly participating in it.
I hope you understand that your vegan loved one cares a great deal about you – so much so that they decided to join your event, despite the fact that they may be profoundly upset by your participation in animal suffering. But to be frank, they’re also probably disappointed, because they know you as a kind person, but your participation in this cruelty runs counter to their high regard for you.
I’m guessing that your vegan loved one feels at least some degree of rejection by you because, if you really sought to understand why they chose to go vegan, you’d go vegan yourself. There’s no logical or ethical justification for killing and eating animals, since it’s biologically unnecessary and unhealthy for us. This can be the hardest thing of all for them; they want so much for you to understand their compassion for animals, because it’s a huge part of who they are as a person.
For many vegans, the holidays are also bittersweet because we remember fondly earlier times when we would get together with family and share how we’ve changed and what we’ve learned while living our separate-but-connected lives. That may not be possible when one goes vegan, since many don’t want to hear about how we’ve developed greater compassion for animals and a desire to promote justice for them.
I understand that your response might be “My house, my rules” which is certainly your prerogative. You’re under no obligation to be accommodating to your vegan loved one by having a vegan holiday. However, by the same token, I urge you to respect their decision to refrain from attending future holidays at your home if that’s their choice, as they may similarly need to decide what’s best for them and what they’re able to witness. For some vegans, it’s simply not healthy for them, or your relationship with them, to be exposed to animal cruelty, and they need to decide that for themselves. Many vegans prefer to simply have vegan holidays at their own homes where they can avoid exposure to unnecessary animal cruelty.
So my final request is to really listen to your vegan loved one during the holidays and try to better understand how they’ve changed and why they’re so passionate about helping animals. Perhaps next holiday season you can show them that you really understand by having a vegan holiday, or better yet, going vegan yourself – it would be the greatest gift you could possibly give your vegan loved one and the animals who will no longer be harmed. |
As students at the University of Cape Town held a vigil on Monday for people killed in an attack on a college in northeastern Kenya last week, it was a poignant show of solidarity for a phenomenon that has now undeniably taken root in sub-Saharan Africa.
The horror April 2 massacre of students at Garissa, some 150 kilometres north-east of the capital Nairobi, left some 148 people dead, all but six of them students, sparking a wave of international revulsion even in a world seemingly inured to extremist violence.
The United Nations, United States and the European Union were among those who joined regional governments such as Ethiopia, South Africa and Nigeria in condemning the attack described by a shaken Kenya president Uhuru Kenyatta as a “barbaric medieval slaughter”.
Gallery
But in Kenya, after the initial shock and disbelief, the hard questions are being asked, leaving an edgy government grasping at straws to defend what is increasingly seen as an unacceptable response to the Garissa attack.
Kenya has lost at least 450 people to several terrorist attacks since its soldiers crossed into Somalia in October 2011, following repeated incursions into its territory by al-Shabab, the Somali militant group that claimed the attack.
The most high-profile strike in that period had been the four-day siege of the upscale Westgate supermarket in September 2013, in which at least 67 people were killed in an attack claimed by the al-Qaeda-linked militants.
State failings
But the latest attack, the worst since the 1998 al-Qaeda bombing of the US embassy in which 213 people died, appears to have for the first time sharply focused the debate on the failings of the state.
Anger has simmered following revelations that the first aircraft into Garissa from Nairobi carried top officials, with the elite commando unit that eventually neutralised the four terrorists arriving only seven hours later, beaten even by Nairobi-based journalists.
There are no special forces based in Garissa, a legacy of the colonial system that concentrated itself on protecting Nairobi, the country’s seat of power.
While there had been intelligence warnings of possible attacks on colleges, and at least two universities took measures to bulk up their security, only the United Kingdom government fingered Garissa as a possible target.
But just a day before, Kenyatta had rounded on the UK for its continued travel advisories, which hurt Kenya’s crucial billion-dollar tourism industry.
The prevailing sentiment has been of a government out of touch with the security challenges of the country, views echoed by demonstrators who on Tuesday took to Nairobi streets in protest, demanding greater national security.
The country’s media has also faulted the security establishment for learning little from the Westgate massacre. “It ... beggars belief that many of the failures that were witnessed during the Westgate siege including the late deployment of specialised police were repeated in Garissa,” the leading Daily Nation newspaper wrote at the weekend.
‘Adequate’ response
Stung, the government has furiously sought to push back on the criticism, blaming both bureaucracy and damningly for its own public relations, the element of surprise in the attack.
Foreign minister Amina Mohamed on Monday in a globally broadast interview said the government’s response had been “adequate” in context of the resources it had.
And after Kenyatta promised retaliation in “the severest way possible”, Kenyan fighter jets bombed al-Shabab camps in southern Somalia, the latest of numerous such sorties made since 2011.
The country is part of a five-nation offensive African Union peacekeeping mission, members of which have all been targeted in previous al-Shabab cross-border attacks.
But Kenya, which was responsible for the battlefield loss of the port city of Kismayo that most weakened the group, has borne the brunt of retaliatory attacks.
Radicalised
A significant challenge is that it is home to a significant Somalia population, estimated at two million or 6% of the population, many of whom have been successfully radicalised as they seek to have their needs fulfilled, whether of seeking revenge, recognition, an identity or just the thrill.
In addition, non-Somali Kenyans have also been identified as members of the group, further signalling a long road ahead.
Kenyatta admitted it was a huge ask.
“Our task of countering terrorism has been made all the more difficult by the fact that the planners and financiers of this brutality are deeply embedded in our communities,” he said on Saturday.
“Radicalisation that breeds terrorism is not conducted in the bush at night. It occurs in the full glare of day, in madrasas, in homes, and in mosques with rogue imams.”
Assumptions
The Garissa attack also turned some long-held assumptions about terrorism in the country on their head. The common assumption is that terrorism is attractive to poor, socially excluded, angry young men.
But one the gunmen was a law student at the country’s premier public institution of higher learning, the University of Nairobi. Just 24, he was described as an “A” student with a sharp legal mind and a love for bespoke suits. He was also the son of a county chief, who reported him as missing in 2013, and at ease in middle-class Nairobi.
The unsaid exit plan for Kenya from Somalia has also been the creation of a buffer zone along the border. Yet the identified mastermind of the Garissa attack is said to be an ally of Kenya’s principle partner in southern Somalia, raising the question of just how intractable the threat could be, and if Kenya really knows its friends.
But analysts, who blame the country’s continued vulnerability on lack of political will, also say the answer to the terror nightmare has been with Kenya all through.
“We have a plethora of policies, a legislative framework that has been done along with a government commitment to reform, which consistently have never been implemented,” Ndung’u Wainaina, the executive director of the Nairobi-based International Center for Policy and Conflict, told Bloomberg News.
Missed opportunities
The country has missed at least three major opportunities in the past 10 years to overhaul its security apparatus and is now paying for it, he said.
Dusting off the numerous reports may be the long-term solution, as opposed to existing plans, such as the announced building a wall along Kenya’s 682-kilometre border with Somalia. The entire wall would cost up to $17-billion, or a third of Kenya’s gross domestic product.
The current terror attacks are yet to become a direct political threat to Kenyatta in Kenya’s ethnic-driven politics, but they are beginning to hurt the economy, as the country’s risk profile takes a hit and markets begin to react.
There are also concerns that counter-terrorism will only lead to the creation of an imperial presidency, identified with Kenyatta’s father Jomo, who was the country’s first post-independence leader.
But Kenyatta, who cannot, despite growing internal pressure, order a retreat for geopolitical reasons, may take cold comfort that the targeting of soft targets by al-Shabab highlight the group’s weakened strength following months of territorial losses.
US President Barack Obama will also visit in July, where he will predictably urge him on the strength of further funding, to stay the course—Shabaab have in recent months successfully recruited diaspora Somalis in the US.
But for grieving parents of the Garissa massacre, all this means little. |
Q:
Why did my number of shares of stock decrease?
I bought 24242 shares for $0.16 each in Dec 2015. Today I logged into my brokerage account and saw that the share price has gone down to $.055 and I now only own 1358 shares.
To my understanding, even though the stock price went down I should still own my 24242 shares, right? Or is it the case that if a company's stock price goes down stockholders lose shares in the company?
A:
During a stock split the only thing that changes is the number of shares outstanding. Typically a stock splits to lower its price per share. Sometimes if a company's value is falling it will do a reverse split where X shares will be exchanged for Y shares. This is typically done to avoid being de-listed from an exchange if the price per share falls below a certain threshold, usually $1. Again the only thing changing is the number of shares outstanding. A 20 for 1 reverse split means for every 20 shares outstanding the shareholder will be granted one new share.
Example X Co. has 1,000,000 shares outstanding for a price of $100 per share. It does a 1 for 10 split. Now there are 10,000,000 shares outstanding for a price of $10 per share.
Example Y Co has 1,000,000 shares outstanding for a price of $1 per share. It does a 10 for 1 reverse split. Now there are 100,000 shares outstanding for a price of $10.
Quickly looking at the news for ASTI it looks like it underwent a 20 for 1 reverse split. You should probably look at your statements and ask your broker how the arithmetic worked in your case.
Investopedia links for Reverse Stock Split and Stock Split |
Phenotype Prevalence of ESBLs and Genotype Prevalence of CTX-M in bacterial isolates from lower respiratory tract specimens in tertiary care centre in central Kerala Background and Objectives: Extended spectrum beta lactamases (ESBLs) are responsible for resistance to third generation Cephalopsorins and Monobactums which form the mainstay of therapy in majority of clinical conditions. This study was performed to generate data on ESBLs and their CTX-M genotypes as prevalent in tertiary care centre at Kottayam, Kerala, India. The prevalence of ESBLs among Gram negative rods in specimens from lower respiratory tract in tertiary care centre at Kottayam was detected using standard methods and their CTX-M genotypes were detected using RT-PCR. The risk factors associated with the emergence of ESBLs and the spread of CTX-M enzymes were discussed. Objectives: To determine the phenotype prevalence of ESBLs and genotype prevalence of CTX-M among Gram negative rods in specimens from respiratory tract at Government Medical College Hospital, Kottayam using standard methods and RT-PCR respectively. Materials and Methods: 1216 specimens from lower respiratory tract namely sputum, broncholaveolar lavage and tracheal aspirate were collected during June 2017 to November 2017. Culture yielded 290 isolates of which 40 were multidrug resistant (MDR) strains. Phenotypic testing of ESBLs was done using Clinical Laboratory Standards Institute (CLSI) guidelinesdisc diffusion testing. Genotypic testing of CTX-M Beta-lactamase was done using RT-PCR using primers from Gen Bank for Group ICTX-M1, Group IITOHO1, Group IIICTX-M825 and Group IVCTX-M914. Results: Phenotypic testing showed that out of 40 MDR strains, all 40 tested positive, of which 31/220 (14%) were Klebsiella pneumoniae and 9/70 (12.8%) were E coli. Genotypic testing showed that of the 40 MDR strains, 15% of Klebsiella pneumoniae and 11% of E coli tested positive for Group III CTX-M while all tested negative for Group IV CTX-M. 10-14% of E coli and Klebsiella pneumoniae isolates tested positive for Groups I and II of CTX-M. Conclusion: Even though CTX-M ESBLs which originated in Kluyvera species were first reported from Japan in 1980s, over the last decades, these genes have dispersed globally among Gram negative rods creating chaos in chemotherapy. This study of lower respiratory tract specimens from tertiary care centre reveals prevalence of ESBLs among multidrug resistant(MDR) strains at 72.7% in phenotype testing and 0-100% in the four gene clusters of CTX-M in genotype testing. Since the clinical microbiology laboratory is the first line of defence in the detection and control of ESBLs and failure to detect ESBLs implies treatment failure, this study stresses the importance of routine ESBL testing of atleast MDR strains and the need for clinicians to practise antibiotic stewardship earnestly. Introduction Even though Alexander Fleming only humbly predicted that bacteria would eventually develop resistance towards penicillin, today antibiotic resistance has become a huge public health concern. Over the last half century, third generation Cephalosporins form the most commonly used antibiotic class and today there is global dissemination of Extended spectrum beta lactamases (ESBLs), the most common of which is CTX-M. They hydrolyse third and fourth generation Cephalosporins and Monobactums but not Cephamycins and Carbapenems. Although the first report of CTX-M was by Bauernfeind et al in 1989, in the following years, Gram negative rods evolved in such a way that resulted in a CTX-M pandemic with reports pouring in from all over the world as documented by Coque in 2006, Canton in 2008 and Bush in 2010 and many others. This study attempts to trace CTX-M ESBLs in respiratory tract samples in tertiary care centre at Kottayam in central Kerala, India. CTX-M ESBLs belong to class A of Ambler classification and 2be of Bush-Jacoby-Medeiros classification. They are located in plasmids generally but their origin points to chromosomal bla genes present in Kluyvera species from where they spread to Gram negative rods through mobile genetic elements. A review of global CTX-M research reveals that CTX-M have replaced TEM, SHV and other ESBL variants through their horizontal transfer by insertion sequences and transposons as concluded in the review article by Rafael canton et al in 2012. In this study, the clinical scenario here points to increased usage of third generation Cephalosporins. Cefotaxime used to be the most common antibiotic used for most clinical situations deserving second line antibiotics but the use has come down owing to reports of CTX-M ESBLs. Presently, Ceftriaxone and Ceftazidime are used for situations in which bacteria belonging to the family Enterobactericeae are isolated. The phenotype testing for these controls and clinical strains included screening tests for Cefpodoxime, Ceftazidime and Cefotaxime and confirmatory tests with Ceftazidime-Clavulanic acid and Cefotaxime-Clavulanic acid, all by disc diffusion. In 2004, J D D Pitout with A Hossain and N D Hanson published the first classification of CTX-M Beta lactamases with four groups. According to this, Group I CTX-M included 1, 3 CTX-M enzymes; Group II included TOHO enzyme, group III included 8 CTX-M enzyme and group IV included 9 CTX-M enzyme. In this study, the primers were used accordingly, and the genotypes among MDR strains of bacteria of the family Enterobactericeae were determined. Materials and Methods Bacterial Isolates: In this study, from 1216 samples from respiratory tract during June to December 2017, a total of 290 isolates of Gram negative rods were obtained in culture and were selected for processing. All isolates were plated on Blood agar, Chocolate agar and MacConkey agar and identification was based on biochemical reactions. The 40 MDR isolates were tested and along with them, three isolates from a reference laboratory which were used as positive control. Results The specimens collected from lower respiratory tract infections include sputum, bronchoalveolar lavage and tracheal aspirate as in Table 1. The most common specimen was sputum accounting for 76% of specimens followed by bronchoalveolar lavage and tracheal aspirate. 28% of specimens were from Pulmonology unit, 22% from Cardiothoracic unit and 20% from critical care unit-both medical and surgical. The remaining 30% of specimens were from Medicine, Nephrology and Neurosurgery units. 77% of specimens were from males and 23% were from females. 8% of specimens were positive for Acid fast bacilli either in smear or culture. 10% of patients were started on ATT, of which 2% was empirical ATT. 1.5% of specimens were positive for Candida albicans. They were treated with either Fluconazole or Amphotericin B. Table 2 shows the prevalence of ESBLs among 31 isolates of Klebsiella pneumoniae and 9 of E coli of Enterobactericeae. Table 3 shows the prevalence of CTX-M Beta-lactamases-Groups I, II, III and IV among Gram negative rods as present in Klebsiella pneumoniae and E coli and three control strains from a reference laboratory. The risk factors for ESBL producing strains include prolonged antibiotic usage with third generation Cephalosporins, ICU stay with lines/ catheter and previous and multiple invasive procedures.. Based on the phylogenetic tree analysis of all CTX-M Beta lactamases so far reported, the CTX-M lineage was initially differentiated into clusters as derived from chromosomal bla gene KluC in Kluyvera cryocrescens, KluA in K ascorbata, and KluG and KluY in K georgiana which were considered as the progenitors of CTX-M-1, CTX-M-2 and CTX-M-9 clusters respectively. In this study, the genotype testing was done by RT-PCR with primers for the four groups of CTX-M as given in the J D D Pitout et al classification. In case of Group III CTX-M, this gene was present in 15% of isolates of Klebsiella pneumoniae and 11% of E coli. In case of Group I and Group II CTX-M, varying range from 10 to 14% were positive for the Gram negative rods. All isolates tested negative for Group IV CTX-M. This study highlighted two case histories. In case of one male patient, a tailor, aged 35 years from central Kerala, who was admitted in cardiology ICU one month and was in and out of ventilator most of the time, one sputum sample and one tracheal aspirate were received for culture and sensitivity and from both these samples, culture yielded multidrug resistant Klebsiella pneumoniae that tested positive for ESBLs both phenotypically and for CTX-M genotypically. Inspite of earnest efforts, the patient succumbed after one month in the ICU. In case of one female patient, a housewife, aged 23 years from central Kerala, she was referred from adjacent local government hospital as a case of post operative sepsis with multiorgan dysfunction/ HELPP/ acute fatty liver of pregnancy following Caesarean section. Her baby was normal but she presented with oozing from the wound site, anemia, thrombocytopenia and oliguria. She was in critical care ICU for three months and in the dialysis ward for one month. It was an eventful period in which she was started on dialysis and was on and off the ventilator. During this period, two sputum samples and five tracheal aspirates were received for culture and sensitivity. Three out five tracheal aspirates yielded in culture-multidrug resistant Klebsiella pneumoniae which tested positive for presence of ESBLs both phenotypically and CTX-M Groups I, II, III genotypically. Therapy was administered as per existing antibiotic policy and she survived on injection Piperacillin-Tazobactum, Meropenem and Colistin during various but separate periods. In this study, the risk factors contributing to the prevalence of ESBLs include prolonged antibiotic usage with third generation antibiotics, prolonged ICU stay with indwelling lines and catheters and previous/ multiple invasive procedures/ surgeries. In these cases, the patient almost behaves like an immunocompromised subject with decreased immunity and is highly susceptible to otherwise minor pathogens. The presence of ESBLs warrants the use of higher antibiotics such as Meropenem and Colistin which are not without side effects and complications. Conclusion The presence of ESBLs in Gram negative rods makes them resistant to third generation Cephalosporins and Monobactums. Even though, initially guidelines for phenotypic testing of ESBLs were put forth for routine testing by CLSI, it is presently recommended only for epidemiological and infection control purposes in the current manual. Nevertheless, the clinical microbiology laboratory is the first line of defence in the detection and control of ESBLs and failure to detect ESBLs implies treatment failure. This study of lower respiratory tract specimens from tertiary care centre in Kerala demonstrates a prevalence of 14% for Klebsiella pneumoniae and 12.8% for E coli of ESBLs among multidrug resistant isolates of Enterobactericeae when tested phenotypically. Even though CTX-M ESBLs which originated in Kluyvera species were first reported from Japan in 1980s, over the last decades, these genes have dispersed globally among Gram negative rods creating chaos in chemotherapy. This study demonstrates a range of prevalence of 0 to 19% of the four groups of CTX-M ESBLs in Klebsiella pneumoniae and E coli when tested genotypically. Therefore this study in central Kerala stresses the importance of routine ESBL testing of atleast MDR strains and also points to an urgent need among clinicians and surgeons to adhere to a uniform hospital antibiotic policy and practise antibiotic stewardship earnestly. |
Periplasmic copper-zinc superoxide dismutase of Legionella pneumophila: role in stationary-phase survival Copper-zinc superoxide dismutases (CuZnSODs) are infrequently found in bacteria although widespread in eukaryotes. Legionella pneumophila, the causative organism of Legionnaires' disease, is one of a small number of bacterial species that contain a CuZnSOD, residing in the periplasm, in addition to an iron SOD (FeSOD) in their cytoplasm. To investigate CuZnSOD function, we purified the enzyme from wild-type L. pneumophila, obtained amino acid sequence data from isolated peptides, cloned and sequenced the gene from a L. pneumophila library, and then constructed and characterized a CuZnSOD null mutant. In contrast to the cytoplasmic FeSOD, the CuZnSOD of L. pneumophila is not essential for viability. However, CuZnSOD is critical for survival during the stationary phase of growth. The CuZnSOD null mutant survived 10- to 10-fold less than wild-type L. pneumophila. In wild-type L. pneumophila, the specific activity of CuZnSOD increased during the transition from exponential to stationary-phase growth while the FeSOD activity was constant. These data support a role of periplasmic CuZnSOD in survival of L. pneumophila during stationary phase. Since L. pneumophila survives extensive periods of dormancy between growth within hosts. CuZnSOD may contribute to the ability of this bacterium to be a pathogen. In exponential phase, wild-type and CuZnSOD null strains grew with comparable doubling times. In cultured HL-60 and THP-1 macrophage-like cell lines and in primary cultures of human monocytes, multiplication of the CuZnSOD null mutant was comparable to that of wild type. This indicated that CuZnSOD is not essential for intracellular growth within macrophages or for killing of macrophages in those systems. |
<filename>src/constants/antennaFile.py
antennaData = [
"FPA5250D06-N",
"FPA5250D12-N",
"FPA5250D24-N",
"HP2F-52",
"HPX2F-52",
"P10-57",
"P12-57",
"P2F-52",
"P3F-52",
"P4-57",
"P6-57",
"P8-57",
"PAR6-59",
"PAR8-59",
"PARX6-59",
"PARX8-59",
"PX2F-52",
"PX3F-52",
"FP10-59",
"FP12-59",
"FP6-64",
"FP8-59",
"FPX10-59",
"FPX12-59",
"FPX8-59",
"HDX10-59 Diversity",
"HDX10-59 Main",
"HDX10S-59A Diff Mode",
"HDX10S-59A Sum Mode",
"HDX12-59 Diversity",
"HDX12-59 Main",
"HDX12S-59 Diff Mode",
"HDX12S-59 Sum Mode",
"HDX8-59",
"HDX8S-59 Diff Mode",
"HDX8S-59 Sum Mode",
"HP10-57W",
"HP10-59",
"HP10-59W",
"HP10-611",
"HP12-57W",
"HP12-59",
"HP12-59W",
"HP12-611",
"HP15-59",
"HP15-59W",
"HP4-57W",
"HP4-59W",
"HP6-57W",
"HP6-59G",
"HP6-59W",
"HP8-57W",
"HP8-59",
"HP8-59W",
"HP8-611",
"HPX10-56",
"HPX10-58W",
"HPX10-59",
"HPX12-56",
"HPX12-58W",
"HPX12-59",
"HPX15-58W",
"HPX15-59",
"HPX6-59",
"HPX8-56",
"HPX8-58W",
"HPX8-59",
"HSX10-59 Feed Left",
"HSX10-59 Feed Right",
"HSX12-59 Feed Left",
"HSX12-59 Feed Right",
"HSX15-59 Feed Left",
"HSX15-59 Feed Right",
"HSX4-59 Left Feed",
"HSX4-59 Right Feed",
"HSX6-59 Left Feed",
"HSX6-59 Right Feed",
"HSX8-59 Left Feed",
"HSX8-59 Right Feed",
"HX12-56",
"HX15-59",
"HX6-6W",
"HXPD10-59C",
"HXPD12-58",
"LBX10-59",
"LBX12-59",
"LBX6-59",
"LBX8-59",
"MX10-611",
"P2-57W",
"P2F-57W",
"P4-57W",
"PAR10-59",
"PAR10-59W",
"PAR12-59",
"PAR12-59W",
"PAR6-59",
"PAR6-59W",
"PAR8-59",
"PAR8-59W",
"PARX10-59",
"PARX10-59W",
"PARX12-59",
"PARX6-59",
"PARX6-59W",
"PARX8-59",
"PARX8-59W",
"PL10-57W",
"PL10-59",
"PL10-59W",
"PL12-57W",
"PL12-59",
"PL12-59W",
"PL15-59",
"PL15-59W",
"PL4-59",
"PL6-57W",
"PL6-59",
"PL6-59W",
"PL8-57W",
"PL8-59",
"PL8-59W",
"PXL10-59",
"PXL12-59",
"PXL15-59",
"PXL6-59",
"PXL8-59",
"SHP3-6W",
"SHP4-6W",
"SHPX3-6W",
"SHPX4-6W",
"SHPX6-6W",
"UGX10R-59C",
"UGX12R-59D",
"UHP10-59W Left Feed",
"UHP10-59W Right Feed",
"UHP12-59W Left Feed",
"UHP12-59W Right Feed",
"UHP6-59W Left Feed",
"UHP6-59W Right Feed",
"UHP8-59W Left Feed",
"UHP8-59W Right Feed",
"UHX10-56 Left Feed",
"UHX10-56 Right Feed",
"UHX10-58W Left Feed",
"UHX10-58W Right Feed",
"UHX10-59 Left Feed",
"UHX10-59 Right Feed",
"UHX10-59W Left Feed",
"UHX10-59W Right Feed",
"UHX10X-59D",
"UHX12-56",
"UHX12-59 Left Feed",
"UHX12-59 Right Feed",
"UHX12-59W Left Feed",
"UHX12-59W Right Feed",
"UHX12X-59D",
"UHX15-59 Left Feed",
"UHX15-59 Right Feed",
"UHX4-107B",
"UHX6-59 Left Feed",
"UHX6-59 Right Feed",
"UHX6-59W Left Feed",
"UHX6-59W Right Feed",
"UHX8-58W Left Feed",
"UHX8-58W Right Feed",
"UHX8-59 Left Feed",
"UHX8-59 Right Feed",
"UMX10-3456 Left Feed",
"UMX10-3456 Right Feed",
"UMX10-4456 Left Feed",
"UMX10-4456 Right Feed",
"UMX10-4459 Left Feed",
"UMX10-4459 Right Feed",
"UMX10-459",
"UMX10-611",
"UMX12-3456 Left Feed",
"UMX12-3456 Right Feed",
"UMX12-4456 Left Feed",
"UMX12-4456 Right Feed",
"UMX12-4459 Left Feed",
"UMX12-4459 Right Feed",
"UMX12-459",
"UMX15-3456 Left Feed",
"UMX15-3456 Right Feed",
"UMX15-4456 Left Feed",
"UMX15-4456 Right Feed",
"UMX8-4459 Left Feed",
"UMX8-4459 Right Feed",
"USX6-6W",
"USX8-6W",
"VHLP3-6WA",
"VHLP4-6WC",
"VHLP6-6WB",
"VHLPX3-6W",
"VHLPX4-6WC",
"VHLPX6-6WB",
"VHP4-59",
"VP4-59",
"VP4-59W",
"VP6-59",
"VP6-59W",
"FP10-64",
"FP12-64",
"FP6-64",
"FP8-64",
"FPX10-64",
"FPX12-64",
"FPX6-64",
"FPX8-64",
"HDH10-65 Diversity Beam",
"HDH10-65 Main Beam",
"HDH12-65 Diversity Beam",
"HDH12-65 Main Beam",
"HDH6-65 Diversity Beam",
"HDH6-65 Main Beam",
"HDH8-65 Diversity Beam",
"HDH8-65 Main Beam",
"HDV10-65 Diversity Beam",
"HDV10-65 Main Beam",
"HDV12-65 Diversity Beam",
"HDV12-65 Main Beam",
"HDV6-65 Diversity Beam",
"HDV6-65 Main Beam",
"HDV8-65 Diversity Beam",
"HDV8-65 Main Beam",
"HP10-186 Hor Pol",
"HP10-186 Vert Pol",
"HP10-65",
"HP12-65",
"HP15-65",
"HP4-65",
"HP6-65",
"HP8-186 Hor Pol",
"HP8-186 Vert Pol",
"HP8-65",
"HPX10-58W",
"HPX10-65",
"HPX12-58W",
"HPX12-65",
"HPX12-6511",
"HPX15-58W",
"HPX15-65",
"HPX4-65",
"HPX6-65",
"HPX8-58W",
"HPX8-65",
"HSX10-64 Left Feed",
"HSX10-64 Right Feed",
"HSX12-64 Left Feed",
"HSX12-64 Right Feed",
"HSX15-64 Left Feed",
"HSX15-64 Right Feed",
"HSX6-64 Left Feed",
"HSX6-64 Right Feed",
"HSX8-64 Left Feed",
"HSX8-64 Right Feed",
"HX6-6W",
"LBX10-65",
"LBX12-65",
"LBX6-65",
"LBX8-65",
"P10-186 Hor Pol",
"P10-186 Vert Pol",
"P10-6812",
"P8-186 Hor Pol",
"P8-186 Vert Pol",
"P8-6812",
"PAR10-65",
"PAR12-65",
"PAR6-65",
"PAR8-65",
"PARX10-65",
"PARX12-65",
"PARX6-65",
"PARX8-65",
"PDH10-65 Div Beam",
"PDH10-65 Main Beam",
"PDH12-65 Div Beam",
"PDH12-65 Main Beam",
"PDH6-65 Diversity Beam",
"PDH6-65 Main Beam",
"PDH8-65 Diversity Beam",
"PDH8-65 Main Beam",
"PDH8S-65 Diff Beam",
"PDH8S-65 Sum Beam",
"PDV10-65 Div Beam",
"PDV10-65 Main Beam",
"PDV12-65 Div Beam",
"PDV12-65 Main Beam",
"PDV6-65 Div Beam",
"PDV6-65 Main Beam",
"PDV8-65 Div Beam",
"PDV8-65 Main Beam",
"PDV8S-65 Dif Beam",
"PDV8S-65 Sum Beam",
"PL10-65D",
"PL12-65E",
"PL15-65D",
"PL4-65",
"PL6-65D",
"PL8-186C",
"PL8-65D",
"PXL10-65D",
"PXL12-65E",
"PXL15-65E",
"PXL6-65D",
"PXL8-65D",
"SHP3-6W",
"SHP4-6W",
"SHPX3-6W",
"SHPX4-6W",
"SHPX6-6W",
"UHX10-58W Left Feed",
"UHX10-58W Right Feed",
"UHX10-65 Left Feed",
"UHX10-65 Right Feed",
"UHX10X-65A",
"UHX12-65 Left Feed",
"UHX12-65 Right Feed",
"UHX15-65 Left Feed",
"UHX15-65 Right Feed",
"UHX6-65 Left Feed",
"UHX6-65 Right Feed",
"UHX8-58W Left Feed",
"UHX8-58W Right Feed",
"UHX8-65 Left Feed",
"UHX8-65 Right Feed",
"UMX10-465 Left Feed",
"UMX10-465 Right Feed",
"UMX10-6477 Left Feed",
"UMX10-6477 Right Feed",
"UMX12-6477 Left Feed",
"UMX12-6477 Right Feed",
"UMX12-A465 Left Feed",
"UMX12-A465 Right Feed",
"UMX15-6477 Left Feed",
"UMX15-6477 Right Feed",
"UMX8-4464 Left Feed",
"UMX8-4464 Right Feed",
"UMX8-6477 Left Feed",
"UMX8-6477 Right Feed",
"USX6-6W",
"USX8-6W",
"VHLP3-6W",
"VHLP4-6WC",
"VHLP6-6WB",
"VHLPX3-6WA",
"VHLPX4-6WC",
"VHLPX6-6WB",
"VHP4-64",
"VHPX4-64",
"VP4-64",
"VP6-64",
"VPX4-64",
"39115-34",
"HP10-105",
"HP12-105",
"HP2-102",
"HP2-105A",
"HP4-105",
"HP6-102",
"HP6-105",
"HP8-105",
"HPX10-105",
"HPX12-105",
"HPX2-105A",
"HPX4-105",
"HPX6-102",
"HPX6-105",
"HPX8-105",
"HSX10-105 Left Feed",
"HSX10-105 Right Feed",
"HSX12-105 Left Feed",
"HSX12-105 Right Feed",
"HSX4-105 Left Feed",
"HSX4-105 Right Feed",
"HSX6-105 Left Feed",
"HSX6-105 Right Feed",
"HSX8-105 Left Feed",
"HSX8-105 Right Feed",
"P10-102",
"P10-105",
"P12-105",
"P2-105A",
"P4-102",
"P4-105",
"P6-102",
"P6-105",
"P6-105C",
"P8-102",
"P8-105",
"PAR6-105",
"PAR8-105",
"PL10-105D",
"PL12-105B",
"PL4-105B",
"PL6-105B",
"PL8-105C",
"PX10-102",
"PX10-105",
"PX12-105",
"PX4-102",
"PX6-102",
"PX6-105",
"PX8-105",
"PXL10-105B",
"PXL12-105B",
"PXL6-105B",
"PXL8-105B",
"UHX10-102 Left Feed",
"UHX10-102 Right Feed",
"UHX10-105 Left Feed",
"UHX10-105 Right Feed",
"UHX12-105 Left Feed",
"UHX12-105 Right Feed",
"UHX4-105 Left Feed",
"UHX4-105 Right Feed",
"UHX6-102 Left Feed",
"UHX6-102 Right Feed",
"UHX6-105 Left Feed",
"UHX6-105 Right Feed",
"UHX8-105 Left Feed",
"UHX8-105 Right Feed",
"VHLP1-105",
"VHLP2-105",
"VHLP2-11WA_10.0-11.7",
"VHLP2-11WA_10.55-11.7",
"VHLP2.5-105",
"VHLP3-11WA_10.1-11.7",
"VHLP3-11WA_10.55-11.7",
"VHLP4-105",
"VHLPX1-105",
"VHLPX2-105",
"VHLPX2-11WA_10-11.7",
"VHLPX2-11WA_10.55-11.7",
"VHLPX2.5-105",
"VHLPX3-11WA_10-11.7",
"VHLPX3-11WA_10.55-11.7",
"VHLPX4-105",
"VHP2-105",
"VHP4-105",
"VHP6-105",
"208991-1",
"220666 Diversity Beam",
"220666 Main Beam",
"39115-34",
"HDX10-107 Diversity Beam Left",
"HDX10-107 Diversity Beam Right",
"HDX10-107 Main Beam Left",
"HDX10-107 Main Beam Right",
"HDX8-107",
"HP10-107",
"HP10-611",
"HP12-107",
"HP12-611",
"HP4-107",
"HP6-107",
"HP8-107",
"HP8-611",
"HPX10-107",
"HPX12-107",
"HPX12-6511",
"HPX4-107",
"HPX6-107",
"HPX8-107",
"HSX10-107 Left Feed",
"HSX10-107 Right Feed",
"HSX12-107 Left Feed",
"HSX12-107 Right Feed",
"HSX4-107 Left Feed",
"HSX4-107 Right Feed",
"HSX6-107 Left Feed",
"HSX6-107 Right Feed",
"HSX8-107 Left Feed",
"HSX8-107 Right Feed",
"HX6-11W_10.0-11.7",
"HX6-11W_10.7-11.7",
"HXPD10-107C",
"HXPD8-107C",
"P12-107D",
"P4-107E",
"PAR6-107",
"PAR8-107",
"PL10-107",
"PL12-107",
"PL4-107",
"PL6-107",
"PL8-107",
"PXL10-107",
"PXL12-107",
"PXL6-107",
"PXL8-107",
"SHP3-11W_10.1-11.7",
"SHP3-11W_10.7-11.7",
"SHP4-11W_10-11.7",
"SHP4-11W_10.55-11.7",
"SHPX3-11W_10.1-11.7",
"SHPX3-11W_10.7-11.7",
"SHPX4-11W_10-11.7",
"SHPX4-11W_10.55-11.7",
"UHX10-107 Left Feed",
"UHX10-107 Right Feed",
"UHX12-107 Left Feed",
"UHX12-107 Right Feed",
"UHX4-107 Left Feed",
"UHX4-107 Right Feed",
"UHX6-107 LeftFeed",
"UHX6-107 RightFeed",
"UHX8-107 Left Feed",
"UHX8-107 Right Feed",
"UMX10-611 Left Feed",
"UMX10-611 Right Feed",
"USX6-11W (10.0-11.7)",
"USX6-11W (10.7-11.7)",
"USX6-11W_10.0-11.7",
"USX6-11W_10.7-11.7",
"USX8-11W",
"VHLP1-107",
"VHLP2-107",
"VHLP2-11WA_10.0-11.7",
"VHLP2-11WA_10.55-11.7",
"VHLP2.5-107",
"VHLP3-11WA_10.1-11.7",
"VHLP3-11W_10.55-11.7",
"VHLP4-107",
"VHLP4-11W",
"VHLP6-11",
"VHLP6-11W",
"VHLP800-11",
"VHLPX1-107",
"VHLPX2-107",
"VHLPX2-11W (10.1-11.7)",
"VHLPX2-11W (10.6-11.7)",
"VHLPX2-11WA_10.0-11.7",
"VHLPX2-11WA_10.55-11.7",
"VHLPX2-11W_10.1-11.7",
"VHLPX2.5-107",
"VHLPX3-11W (10.1-11.7)",
"VHLPX3-11W (10.7-11.7)",
"VHLPX3-11WA_10.0-11.7",
"VHLPX3-11WA_10.55-11.7",
"VHLPX3-11W_10.1-11.7",
"VHLPX3-11W_10.7-11.7",
"VHLPX4-107",
"VHLPX4-11W (10.1-11.7)",
"VHLPX4-11W (10.7-11.7)",
"VHLPX4-11W_10.0-11.7",
"VHLPX4-11W_10.1-11.7",
"VHLPX4-11W_10.7-11.7",
"VHLPX6-11",
"VHLPX6-11W",
"VHLPX800-11",
"VHP2-107",
"VHP4-107",
"VHP6-107",
"HP1-180A",
"HP2-180F",
"HP2-180G",
"HP6-180G",
"HP8-180",
"HPX1-180A",
"HPX2-180B",
"HPX4-180A",
"HPX6-180A",
"HSX1-180 Left Feed",
"HSX1-180 Right Feed",
"HSX2-180 Left Feed",
"HSX2-180 Right Feed",
"HSX4-180 Left Feed",
"HSX4-180 Right Feed",
"HSX6-180 Left Feed",
"HSX6-180 Right Feed",
"P8-180",
"SHP2-18",
"SHP3-18",
"SHPX2-18",
"SHPX3-18",
"VHLP1-18",
"VHLP1-180",
"VHLP2-180",
"VHLP2-18C",
"VHLP2.5-180",
"VHLP4-180",
"VHLP4-18C",
"VHLP6-180",
"VHLPX1-180",
"VHLPX1-18F",
"VHLPX2-180",
"VHLPX2-18C",
"VHLPX2.5-180",
"VHLPX3-18",
"VHLPX4-180",
"VHLPX4-18C",
"VHLPX6-18",
"VHLPX6-180",
"VHP1-180",
"VHP2-180B",
"VHP2.5-180A",
"VHP4-180A",
"VHP6-180A",
"VHPX1-180",
"VHPX2-180A",
"VHPX2.5-180",
"VHPX4-180A",
"VHPX6-180A",
"VP2-180A",
"VP4-180A",
"VP6-180A ",
"HP1B-220A",
"HP2-220B",
"HP2B-220",
"HP4-220B",
"HP4B-220A",
"HP6-220A",
"HPX6-220A",
"P2B-220",
"SHP1-23",
"SHP2-23",
"SHP3-23",
"SHPX1-23",
"SHPX2-23",
"SHPX3-23",
"VFP1-220",
"VHLP1-220",
"VHLP1-23",
"VHLP2-220",
"VHLP2-23C",
"VHLP2.5-220",
"VHLP200-220",
"VHLP4-220",
"VHLP4-23",
"VHLPX1-220",
"VHLPX1-23C",
"VHLPX2-220",
"VHLPX2-23C",
"VHLPX2.5-220",
"VHLPX3-23A",
"VHLPX4-220",
"VHP1-220",
"VHP2-220A",
"VHP2.5-220",
"VHP4-220A",
"VHP4-240",
"VHP4A-220A",
"VHP6-220A",
"VHP6A-220A",
"VHPX1-220",
"VHPX2-220A",
"VHPX2.5-220",
"VHPX4-220A",
"VHPX4A-220A",
"VHPX6-220A",
"VHPX6A-220A",
"VP2-220",
"VP4-220A",
"VP4A-220",
"VHLP1-80A",
"VHLP2-80A",
"VHLPX1-80A",
"VHLPX2-80A",
"MA0528-19AN",
"MA0528-23AN",
"MA0528-28AN",
"SDF4-52C",
"SDF6-52C",
"SPF2-52C",
"SPF4-52C",
"SPF6-52C",
"DA10-59A",
"DA12-59A",
"DA15-59A",
"DA4-59B",
"DA6-59B",
"DA8-59A",
"DAX10-59A",
"DAX12-59A",
"DAX15-59A",
"DAX4-59A",
"DAX6-59B",
"DAX8-59A",
"PA10-59A",
"PA12-59A",
"PA8-59A",
"PAD10-59A",
"PAD6-59B",
"PAD8-59A",
"PADX8-59",
"PAL10-59A",
"PAL12-59A",
"PAL8-59A",
"PAX10-59A",
"PAX12-59A",
"PAX15-59A",
"PAX8-59A",
"SB6-W60BMPT",
"SBX6-W60BMPT",
"SP4-59A",
"SP6-59A",
"SPX6-59A",
"SU4-59B",
"SU6-59B",
"SUX4-59A",
"SUX6-59B",
"UA10-59A",
"UA12-59A",
"UA15-59A",
"UA6-59B",
"UA8-59A",
"UDA10-59A",
"UDA12-59A",
"UDA15-59A",
"UDA6-59A",
"UDA8-59A",
"UXA10-59A",
"UXA12-59A",
"UXA15-59A",
"UXA4-59A",
"UXA6-59B",
"UXA8-59A",
"DA10-65A",
"DA12-65A",
"DA15-65A",
"DA4-65B",
"DA6-65B",
"DA8-65A",
"DAX10-65A",
"DAX12-65A",
"DAX15-65A",
"DAX4-65A",
"DAX6-65B",
"DAX8-65A",
"PA10-65A",
"PA12-65A",
"PA8-65A",
"PAD10-65A",
"PAD6-65B",
"PAD8-65A",
"PADX6-65",
"PADX8-65",
"PAL10-65A",
"PAL12-65A",
"PAL15-65A",
"PAL8-65A",
"PAX10-65A",
"PAX12-65A",
"PAX15-65A",
"PAX8-65A",
"SB6-W60BMPT",
"SBX6-W60BMPT",
"SP4-65A",
"SP6-65A",
"SPX4-65A",
"SPX6-65A",
"SU4-65B",
"SU6-65B",
"SUX4-65A",
"SUX6-65B",
"UA10-65A",
"UA12-65A",
"UA15-65A",
"UA4-65A",
"UA6-65A",
"UA8-65A",
"UDA10-65A",
"UDA12-65A",
"UDA15-65A",
"UDA4-65A",
"UDA6-65A",
"UDA8-65A",
"UXA10-65A",
"UXA12-65A",
"UXA15-65A",
"UXA4-65A",
"UXA6-65B",
"UXA8-65A",
"DA10-105A",
"DA4-105B",
"DA6-105B",
"DA8-105A",
"DAX10-105A",
"DAX12-105A",
"DAX4-105A",
"DAX6-105A",
"DAX8-105A",
"PA10-105A",
"PA8-105A",
"Pad10-105",
"PAD6-105",
"PAD8-105",
"PAX10-105A",
"PAX4-105A",
"PAX6-105A",
"PAX8-105A",
"SB2-105C",
"SB3-105B",
"SB3-W100AMPT",
"SB4-105B",
"SB4-W100AMPT",
"SB6-W100AMPT",
"SBX3-W100AMPT",
"SBX4-W100AMPT",
"SBX6-W100AMPT",
"SC3-W100AMPT",
"SCX3-W100AMPT",
"UXA10-105A",
"UXA4-105B",
"UXA6-105B",
"UXA8-105A",
"DA10-107A",
"DA12-107A",
"DA2-107A",
"DA4-107A",
"DA6-107A",
"DA8-107A",
"DAX10-107A",
"DAX12-107A",
"DAX4-107A",
"DAX6-107A",
"DAX8-107A",
"PA10-107A",
"PA12-107A",
"PA8-107A",
"PAD10-107A",
"PAD6-107B",
"PAD8-107A",
"PADX10-107A",
"PADX6-107A",
"PADX8-107A",
"PAL10-107A",
"PAL12-107A",
"PAL8-107A",
"PAX10-107A",
"PAX12-107A",
"PAX8-107A",
"SB2-107AMPT",
"SB2-107C",
"SB3-107B",
"SB3-W100AMPT",
"SB4-107B",
"SB4-W100AMPT",
"SB6-W100AMPT",
"SBX2-107A",
"SBX2-107AMPT",
"SBX3-107A",
"SBX3-W100AMPT",
"SBX4-107A",
"SBX4-W100AMPT",
"SBX6-W100AMPT",
"SC3-W100AMPT",
"SCX3-W100AMPT",
"SD2-107A",
"SD3-107A",
"SD4-107B",
"SD6-107B",
"SDX4-107B",
"SDX6-107B",
"SP2-107A",
"SP3-107A",
"SP4-107",
"SP6-107A",
"SPX4-107A",
"SPX6-107A",
"SU2-107B",
"SU3-107B",
"SU4-107B",
"SU6-107B",
"SUX3-107B",
"SUX4-107B",
"SUX6-107B",
"UA10-107A",
"UA12-107A",
"UA8-107A",
"UDA10-107A",
"UDA12-107A",
"UDA8-107A",
"UXA10-107A",
"UXA12-107A",
"UXA4-107B",
"UXA6-107B",
"UXA8-107A",
"SB1-190B",
"SB2-190C",
"SB3-190C",
"SB4-190B",
"SBX1-190B",
"SBX2-190C",
"SBX3-190AMPT",
"SBX4-190A",
"SBX6-190D",
"SC1-190A",
"SC2-190AMPT",
"SC3-190B",
"SCX1-190A",
"SCX2-190AMPT",
"SCX3-190B",
"SU2-190B",
"SU4-190D",
"SU6-190B",
"SUX2-190B",
"SUX6-190B",
"UXA2-190C",
"UXA4-190D",
"UXA6-190B",
"LA05-220B",
"SB1-220AMPT",
"SB1-220C",
"SB4-220D",
"SBX1-220C",
"SBX4-220D",
"SBX6-220D",
"SC1-220A",
"SC2-220AMPT",
"SC3-220B",
"SCX1-220A",
"SCX2-220AMPT",
"SCX3-220B",
"SU4-220D",
"SU6-220B",
"SUX4-220D",
"SUX6-220B",
"UXA2-220C",
"UXA4-220D",
"UXA6-220B",
"PADX10-U57A",
"PADX6-U57A",
"PADX8-U57A",
"UXA10-U57A",
"UXA6-U57A",
"UXA8-U57A",
"SB3-W100AMPT (10.0-11.7)",
"SB4-W100D (10.0-11.7)",
"SB4-W100D (10.7-11.7)",
"SB6-W100C (10.0-11.7)",
"SBX3-W100AMPT (10.0-11.7)",
"SBX4-W100D (10.0-11.7)",
"SBX4-W100D (10.7-11.7)",
"SBX6-W100C (10.0-11.7)",
"SBX6-W100C (10.55-11.7)",
"SC2-W100B (10.0-11.7)",
"SC2-W100B (10.55-10.68)",
"SC2-W100B (10.7-11.7)",
"SCX2-W100B(10.0-11.7)",
"SCX2-W100B(10.55-10.68)",
"SCX2-W100B(10.7-11.7)",
"DA10-W57A",
"PAD10-W57A",
"PAD6-W57A",
"PAD8-W57A",
"PADX10-W57A",
"PADX8-W57A",
"UXA10-W57A",
"UXA6-W57A",
"UXA8-W57A",
"PAD10-W59A",
"PAD6-W59B",
"PAD8-W59A",
"PADX10-W59A",
"PADX6-W59A",
"PADX8-W59A",
"SB4-W60E",
"SBX4-W60E",
"SC3-W60B",
"SCX3-W60B",
"SB4-W60E (5.725-6.875)",
"SU4-W60A",
"SU6-W60B",
"SB1-W800C",
"SC2-W800B",
"SFA04-W800A (71-76)",
"SFA04-W800A (81-86)"
]
|
Children's haptic experiences of tangible artifacts varying in hardness In this paper we describe our investigations on the role of material hardness in the haptic experience of tangible artifacts. Without seeing the artifacts children had to rank their experience on a scale of two antonyms while touching and holding these artifacts. In this experiment it was shown that children have no problem ranking hardness. Two groups could be identified: soft artifacts were found to be cute, speedy and warm, e.g., and hard artifacts boring, sad and old-fashioned. We think that paying attention to this factor in the design of tangible user interfaces for children can improve their experience. |
Modified hard anodization procedure to fabricate hybrid nanoporous alumina In this work we present an innovative approach to fabricate new structures based on nanoporous alumina. The fabrication process is carried out following a modified two-step hard anodization process in a 0.3M oxalic acid solution at 120V and 0°C. The nanoporous anodic alumina membranes present a hybrid pore structure which consist of pores with short diameters inner pores with longer diameters. This new nanostructure could be used to develop new chemical or biological sensors or to fabricate optoelectronic and storage devices. |
<filename>notifications/notifyByWeibo.ts
/**
* 使用用户的绑定新浪账号发布微博
*/
import { Contact, Subscription } from '@Models';
import { UtilService, WeiboService } from '@Services';
import disableSubscription from './disableSubscription';
import pino from 'pino';
const logger = pino();
async function notifyByWeibo({ contact, subscription, template }: {
contact: Contact;
subscription: Subscription;
template: any;
}) {
if (!contact) {
await disableSubscription(subscription);
return logger.error(new Error(`未找到用户 ${subscription.subscriber} 的微博绑定`));
}
const message = UtilService.shortenString(template.message, 100)
+ ' ' + template.url;
return WeiboService.post(contact.auth, message);
}
export default notifyByWeibo;
|
<gh_stars>10-100
package io.crate.spring.jdbc.samples.model;
import java.util.Objects;
public class User {
private final String name;
private final double lon;
private final double lat;
public User(String name, double lat, double lon) {
this.name = name;
this.lat = lat;
this.lon = lon;
}
public String getName() {
return name;
}
public double getLon() {
return lon;
}
public double getLat() {
return lat;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
User user = (User) o;
return Double.compare(user.lon, lon) == 0 &&
Double.compare(user.lat, lat) == 0 &&
Objects.equals(name, user.name);
}
@Override
public int hashCode() {
return Objects.hash(name, lon, lat);
}
@Override
public String toString() {
return "User{" +
"name='" + name + '\'' +
", lon=" + lon +
", lat=" + lat +
'}';
}
} |
Breaking News Emails Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.
Jan. 2, 2017, 8:06 PM GMT / Updated Jan. 3, 2017, 1:41 PM GMT / Source: Associated Press By Associated Press
RIO DE JANEIRO — An attack by members of a crime gang on rival inmates touched off a riot at a prison in the northern Brazilian state of Amazonas, leaving at least 56 dead, authorities said.
Several of the victims were beheaded or dismembered in the worst bloodshed at a Brazilian prison since 1992.
Authorities said the riot, which raged from Sunday afternoon into Monday morning, grew out of a fight between two of the country's biggest crime gangs over control of prisons and drug routes in northern Brazil.
Relatives of prisoners await news after a bloody prison riot Monday in the Amazon jungle city of Manaus, Brazil. Michael Dantas / Reuters
In a separate incident Monday evening, four inmates were killed at another Amazonas prison. Police were investigating whether there was a connection between the mass killings at Anisio Jobim Penitentiary Complex and the later ones at Unidade Prisional do Puraquequara.
Amazonas authorities initially reported that 60 people were killed at Anisio Jobim in Manaus, but the state public security secretary's office later lowered the figure to 56. Officials also said 112 inmates escaped during the riot.
There were 1,224 inmates in the prison, which was built to hold 592, the Amazonas state public security's office said. The prison is run by a private company that is paid according to the number of inmates.
Twelve prison guards were held hostage during the riot; none were injured.
"This is the biggest prison massacre in our state's history," Public Security Secretary Sergio Fontes said at a news conference. "What happened here is another chapter of the war that narcos are waging on this country, and it shows that this problem cannot be tackled only by state governments."
Fontes confirmed that many of the dead had been beheaded. He said the inmates made few demands to end the riot, which he said indicated a killing spree organized by members of a local gang, the Family of the North, against those of the First Command of the Capital, based in Sao Paulo.
Judge Luis Carlos Valois, who negotiated the end of the riot, said he saw many bodies that had been quartered.
"I never saw anything like that in my life. All those bodies, the blood," Valois wrote on Facebook.
It was the largest death toll during a Brazilian prison riot since the killing of 111 inmates by police officers in the Carandiru penitentiary in Sao Paulo in 1992. Police said they acted in self-defense then. |
// Eval uses the provided bindings to resolve any variable references and returns a slice
// corresponding to the argument values.
func (a *ArgumentList) Eval(vars Bindings) []string {
var values []string
for _, arg := range a.Values {
values = append(values, arg.Eval(vars)...)
}
return values
} |
. Fever of unknown origin is a frequent and significant diagnostic problem often faced by physicians. The first part of the text is dedicated to its definition and wide-ranging aetiology. On the one hand, fever may be a banal and benign condition, on the other, it can be the symptom of a life threatening disease. The second part presents our suggestions for diagnostic approach to fever of unknown origin. We believe this text may become a useful tool for this extremely complex and interesting differential diagnostic. In view of extension and complexity of the topic, the text of this part is presented in full. |
There was no decades-long quest for Ryan Carter to win hockey's ultimate prize.
After Carter played 76 games for Portland of the AHL in his first professional season, the Anaheim Ducks called up the forward for their 2007 playoff run.
The White Bear Lake, Minn., native didn't have a point, penalty or shot in 13 minutes of ice time over four Stanley Cup Playoff games, but still had his name engraved on the Cup when Anaheim beat the Ottawa Senators in five games for the franchise's first title.
That's not to say Carter enjoyed an easy path to NHL success. A finalist for the 2002 Minnesota Mr. Hockey award, he spent two seasons each with the Green Bay Gamblers of the United States Hockey League and Minnesota State University Mankato before signing with Anaheim as an undrafted free agent July 12, 2006.
It took until the 28th game of his rookie season for him to score his first goal, but he did it in style. On Feb. 8, 2008, Carter led the Ducks to a 2-1 win against the New Jersey Devils, putting two pucks past goaltender Martin Brodeur.
Carter played three seasons in Anaheim before being traded twice during the 2010-11 season, first to the Carolina Hurricanes and then to the Florida Panthers. When Florida put Carter on waivers early in the 2011-12 season, the Devils, with former Panthers coach Peter DeBoer behind their bench, quickly picked him up.
Not known for being a scorer, Carter still managed some big goals. None was bigger than his game-winner for the Devils in Game 5 of the 2012 Eastern Conference Final. After blowing a 3-0 lead in that game against the New York Rangers, New Jersey seemed destined to head home for Game 6 one loss from elimination at the hands of their rivals. But with less than five minutes left, Carter scored to give New Jersey a 4-3 lead en route to a 5-3 win.
Two days later, Carter opened the scoring in Game 6 to help the Devils win 3-2 and clinch the series. That put Carter into his second Stanley Cup Final, where the Devils lost in six games to the Los Angeles Kings.
After Carter was awarded New Jersey's Players' Player Award in 2014, the Devils released him during training camp prior to the 2014-15 season. Carter signed with the Minnesota Wild on Oct. 6, 2014, returning to his home state. In 2014-15, Carter's 10 assists gave him double-digits in a scoring category for the first time in his NHL career.
Signed as a free agent by Anaheim, July 12, 2006.
Traded to Carolina by Anaheim for Stefan Chaput and Matt Kennedy, November 23, 2010.
Traded to Florida by Carolina with Carolina's 5th round pick (later traded to Atlanta, later traded to San Jose -- San Jose selected Sean Kuraly) in 2011 NHL Draft for Cory Stillman, February 24, 2011.
Claimed on waivers by New Jersey from Florida, October 26, 2011.
Signed as a free agent by Minnesota, October 7, 2014. |
<filename>Common/kvstore/kvstore_cache.c
/*
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* https://www.FreeRTOS.org
* https://github.com/FreeRTOS
*
*/
#include "FreeRTOS.h"
#include "kvstore_prv.h"
#include <string.h>
#if KV_STORE_CACHE_ENABLE
typedef struct
{
KVStoreValueType_t type;
size_t length;
union
{
void * pvData;
char * pcData;
UBaseType_t uxData;
BaseType_t xData;
uint32_t ulData;
int32_t lData;
};
BaseType_t xChangePending;
} KVStoreCacheEntry_t;
static KVStoreCacheEntry_t kvStoreCache[ CS_NUM_KEYS ] = { 0 };
static inline void * pvGetDataWritePtr( KVStoreKey_t key )
{
void * pvData = NULL;
if( kvStoreCache[ key ].length > sizeof( void * ) )
{
pvData = kvStoreCache[ key ].pvData;
}
else
{
pvData = ( void * ) &( kvStoreCache[ key ].pvData );
}
configASSERT( pvData != NULL );
return pvData;
}
static inline const void * pvGetDataReadPtr( KVStoreKey_t key )
{
const void * pvData = NULL;
if( kvStoreCache[ key ].type == KV_TYPE_NONE )
{
pvData = NULL;
}
else if( kvStoreCache[ key ].length > sizeof( void * ) )
{
pvData = kvStoreCache[ key ].pvData;
}
else
{
pvData = ( void * ) &( kvStoreCache[ key ].pvData );
}
return pvData;
}
static inline void vAllocateDataBuffer( KVStoreKey_t key,
size_t xNewLength )
{
if( xNewLength > sizeof( void * ) )
{
kvStoreCache[ key ].pvData = pvPortMalloc( xNewLength );
kvStoreCache[ key ].length = xNewLength;
}
else
{
kvStoreCache[ key ].ulData = 0;
kvStoreCache[ key ].length = xNewLength;
}
}
static inline void vClearDataBuffer( KVStoreKey_t key )
{
/* Check if data is heap allocated > sizeof( void * ) */
if( kvStoreCache[ key ].length > sizeof( void * ) )
{
vPortFree( kvStoreCache[ key ].pvData );
kvStoreCache[ key ].pvData = NULL;
kvStoreCache[ key ].length = 0;
}
else /* Statically allocated */
{
kvStoreCache[ key ].length = 0;
kvStoreCache[ key ].xData = 0;
}
}
static inline void vReallocDataBuffer( KVStoreKey_t key,
size_t xNewLength )
{
if( xNewLength > kvStoreCache[ key ].length )
{
/* Need to allocate a bigger buffer */
vClearDataBuffer( key );
vAllocateDataBuffer( key, xNewLength );
}
else /* New value is same size or smaller. Re-use already allocated buffer */
{
kvStoreCache[ key ].length = xNewLength;
}
}
/*
* @brief Initialize the Key Value Store Cache by reading each entry from the storage nvm store.
*/
void vprvCacheInit( void )
{
#if KV_STORE_NVIMPL_ENABLE
/* Read from file system into ram */
for( uint32_t i = 0; i < CS_NUM_KEYS; i++ )
{
/* pvData pointer should be NULL on startup */
configASSERT_CONTINUE( kvStoreCache[ i ].pvData == NULL );
kvStoreCache[ i ].xChangePending = pdFALSE;
kvStoreCache[ i ].type = KV_TYPE_NONE;
size_t xNvLength = xprvGetValueLengthFromImpl( i );
if( xNvLength > 0 )
{
vAllocateDataBuffer( i, xNvLength );
KVStoreValueType_t * pxType = &( kvStoreCache[ i ].type );
size_t * pxLength = &( kvStoreCache[ i ].length );
( void ) xprvReadValueFromImpl( i, pxType, pxLength, pvGetDataWritePtr( i ), *pxLength );
}
}
#endif /* KV_STORE_NVIMPL_ENABLE */
}
/*
* @brief Get the length of the value stored in the cache corresponding to a given key.
* @param[in] xKey The key to lookup.
* @return the length of the entry or 0 if non-existent.
*/
size_t prvGetCacheEntryLength( KVStoreKey_t xKey )
{
configASSERT( xKey < CS_NUM_KEYS );
return kvStoreCache[ xKey ].length;
}
/*
* @brief Get the type of the value stored in the cache corresponding to a given key.
* @param[in] xKey The key to lookup.
* @return the type of the entry or KV_TYPE_NONE if non-existent.
*/
KVStoreValueType_t prvGetCacheEntryType( KVStoreKey_t xKey )
{
configASSERT( xKey < CS_NUM_KEYS );
return kvStoreCache[ xKey ].type;
}
/*
* @brief Write a given and / value pair to the cache
* @param[in] xKey Key to store the provided value in
* @param[in] xNewType The type of the data to store.
* @param[in] xLength Length of the data to store.
* @param[in] pvNewValue Pointer to the new data to be copied into the cache.
* @return pdTRUE always.
*/
BaseType_t xprvWriteCacheEntry( KVStoreKey_t xKey,
KVStoreValueType_t xNewType,
size_t xLength,
const void * pvNewValue )
{
configASSERT( xKey < CS_NUM_KEYS );
configASSERT( xNewType < KV_TYPE_LAST );
configASSERT( xLength > 0 );
configASSERT( pvNewValue != NULL );
/* Check if value is not currently set */
if( kvStoreCache[ xKey ].type == KV_TYPE_NONE )
{
vAllocateDataBuffer( xKey, xLength );
kvStoreCache[ xKey ].type = xNewType;
kvStoreCache[ xKey ].xChangePending = pdTRUE;
}
/* Check for change in length */
else if( kvStoreCache[ xKey ].length != xLength )
{
vReallocDataBuffer( xKey, xLength );
kvStoreCache[ xKey ].type = xNewType;
kvStoreCache[ xKey ].xChangePending = pdTRUE;
}
/* Check for change in type */
else if( kvStoreCache[ xKey ].type != xNewType )
{
kvStoreCache[ xKey ].type = xNewType;
kvStoreCache[ xKey ].xChangePending = pdTRUE;
}
/* Otherwise, type / length are the same, so check value */
else
{
const void * pvReadPtr = pvGetDataReadPtr( xKey );
if( ( pvReadPtr == NULL ) ||
( memcmp( pvReadPtr, pvNewValue, xLength ) != 0 ) )
{
kvStoreCache[ xKey ].xChangePending = pdTRUE;
}
}
if( kvStoreCache[ xKey ].xChangePending == pdTRUE )
{
void * pvDataWrite = pvGetDataWritePtr( xKey );
if( pvDataWrite != NULL )
{
( void ) memcpy( pvGetDataWritePtr( xKey ), pvNewValue, xLength );
}
}
return pdTRUE;
}
BaseType_t xprvCopyValueFromCache( KVStoreKey_t xKey,
KVStoreValueType_t * pxDataType,
size_t * pxDataLength,
void * pvBuffer,
size_t xBufferSize )
{
const void * pvDataPtr = NULL;
size_t xDataLen = 0;
configASSERT( xKey < CS_NUM_KEYS );
configASSERT( pvBuffer != NULL );
pvDataPtr = pvGetDataReadPtr( xKey );
if( pvDataPtr != NULL )
{
xDataLen = kvStoreCache[ xKey ].length;
if( xBufferSize < xDataLen )
{
LogWarn( "Read from key: %s was truncated from %d bytes to %d bytes.",
kvStoreKeyMap[ xKey ], xDataLen, xBufferSize );
xDataLen = xBufferSize;
}
( void ) memcpy( pvBuffer, pvDataPtr, xDataLen );
if( pxDataType != NULL )
{
*pxDataType = kvStoreCache[ xKey ].type;
}
if( pxDataLength != NULL )
{
*pxDataLength = kvStoreCache[ xKey ].length;
}
}
return( xDataLen > 0 );
}
BaseType_t KVStore_xCommitChanges( void )
{
BaseType_t xSuccess = pdTRUE;
#if KV_STORE_NVIMPL_ENABLE
for( uint32_t i = 0; i < CS_NUM_KEYS; i++ )
{
if( kvStoreCache[ i ].xChangePending == pdTRUE )
{
xSuccess &= xprvWriteValueToImpl( i,
kvStoreCache[ i ].type,
kvStoreCache[ i ].length,
pvGetDataReadPtr( i ) );
}
}
#endif /* if KV_STORE_NVIMPL_ENABLE */
return xSuccess;
}
#endif /* KV_STORE_CACHE_ENABLE */
|
<reponame>jjzhang166/InstancingAndroid
//--------------------------------------------------------------------------------------
// Copyright 2013 Intel Corporation
// All Rights Reserved
//
// Permission is granted to use, copy, distribute and prepare derivative works of this
// software for any purpose and without fee, provided, that the above copyright notice
// and this statement appear in all copies. Intel makes no representations about the
// suitability of this software for any purpose. THIS SOFTWARE IS PROVIDED "AS IS."
// INTEL SPECIFICALLY DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, AND ALL LIABILITY,
// INCLUDING CONSEQUENTIAL AND OTHER INDIRECT DAMAGES, FOR THE USE OF THIS SOFTWARE,
// INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PROPRIETARY RIGHTS, AND INCLUDING THE
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Intel does not
// assume any responsibility for any errors which may appear in this software nor any
// responsibility to update it.
//--------------------------------------------------------------------------------------
#ifndef __CPUTRENDERPARAMS_H__
#define __CPUTRENDERPARAMS_H__
// TODO: Change name to CPUTRenderContext?
class CPUTCamera;
class CPUTBuffer;
class CPUTRenderParameters
{
public:
bool mShowBoundingBoxes;
bool mDrawModels;
bool mRenderOnlyVisibleModels;
CPUTCamera *mpCamera;
CPUTCamera *mpShadowCamera;
CPUTBuffer *mpPerModelConstants;
CPUTBuffer *mpPerFrameConstants;
CPUTRenderParameters() :
mShowBoundingBoxes(false),
mDrawModels(true),
mRenderOnlyVisibleModels(true),
mpCamera(0),
mpShadowCamera(0),
mpPerModelConstants(0),
mpPerFrameConstants(0)
{}
~CPUTRenderParameters(){}
private:
};
#endif // __CPUTRENDERPARAMS_H__ |
They say imitation is the sincerest form of flattery, but this may be stretching the expression a bit too far. Cut the Birds, a game released five days ago in the Apple (NSDQ: AAPL) App Store, has copied the birds from Rovio’s Angry Birds and the gameplay from Halfbrick’s Fruit Ninja. The resulting app — a “blatant rip-off,” in the words of Rovio’s Mighty Eagle Peter Vesterbacka — is currently ranks as the most popular free app in the Apple App Store.
A version of the game was also released for the Android Market on October 16. It is also free.
The idea of Cut the Birds is very basic: the player chops birds flying across the screen with a swiping motion before they “hit” the glass, avoiding bombs that look a lot like the birds. The game, at least in the current version, increases in difficulty with more and faster birds. No advertising or any other revenue options are available in the current iteration.
There are many other apps and games that play on and borrow from the fame of Rovio’s original creation, which itself has spawned many of its own official games, and a very large merchandising franchise to boot (the latest: a cookbook).
The difference here is that the birds look like they’ve been lifted directly from the original Rovio game, and the challenge itself from Halfbrick’s original. And you could even argue that the name borrows from the best-selling Cut the Rope, made by a third developer, Chillingo.
As the blog GamePro points out, copying is fairly common in the world of gaming apps. Still, it’s not often that the product of that copying goes straight to the top of the charts.
Solverlabs is a Ukraine-based software developer that has created other games — including at least one other that lifts from Fruit Ninja, the Fruits and Ninja app for BlackBerry App World. That is selling for $0.99. The company also works on enterprise services, listing three different U.S.-based companies among their clients.
Vesterbacka tells paidContent that the app is a “blatant rip-off” but it’s not clear whether Rovio can or will do any more than say that.
We have reached out to both Rovio and Halfbrick, as well as Solverlabs, for further response, but for now, the biggest outcry seems to have come from customers. Even though the game is getting downloaded by the masses, a fair number of of them are also getting fairly loud in their copying accusations, too, via the comments on the App Store page for the app.
It may be that it’s too difficult to try to chase the developer down, but as Om Malik points out, it’s surprising that the games got published in the stores to begin with, and haven’t yet been removed. |
Antibodies to human T-cell lymphotropic virus type I (HTLV-I) by particle agglutination (PA) test in Korean blood donors. HTLV-I infection is a recently recognized disease entity that is common in some tropical and subtropical areas, including the southwestern district of Japan. Despite the geographical proximity and frequent cultural exchanges between Korea and Japan, it is understood that Korea is not an endemic area and HTLV-I-associated illnesses are very rare in Korea. This study was designed to evaluate the positive rate of anti-HTLV-I antibodies in Korean blood donors and its regional distribution. Sera were obtained from blood donors from various districts around Korea. Anti-HTLV-I antibodies were detected by using the microtiter particle agglutination test employing an indirect agglutination technique. A total of 9,281 donors were tested and 12 donors (0.13%) were positive for anti-HTLV-I antibodies, 10 (0.11%) out of 8,845 males and 2 (0.46%) out of 436 females, with relative female predominance. A relatively high incidence of anti-HTLV-I positive donors was observed in Cheju Island (0.80%), Kyungnam (0.31%), and Chonnam (0.15%). In conclusion, the positive rate of anti-HTLV-I antibodies seemed to be very low in Korea, but the highest positive rate of anti-HTLV-I antibodies was noticed on Cheju Island, warranting further research for confirmation. |
import math
import vapoursynth as vs
def _LinearAndGamma(src, l2g_flag, fulls, fulld, curve, planes, gcor,
sigmoid, thr, cont):
core = vs.get_core()
if curve == 'srgb':
c_num = 0
elif curve in ['709', '601', '170']:
c_num = 1
elif curve == '240':
c_num = 2
elif curve == '2020':
c_num = 3
else:
raise ValueError('LinearAndGamma: wrong curve value')
if src.format.color_family == vs.GRAY:
planes = [0]
# BT-709/601
# sRGB SMPTE 170M SMPTE 240M BT-2020
k0 = [0.04045, 0.081, 0.0912, 0.08145][c_num]
phi = [12.92, 4.5, 4.0, 4.5][c_num]
alpha = [0.055, 0.099, 0.1115, 0.0993][c_num]
gamma = [2.4, 2.22222, 2.22222, 2.22222][c_num]
def g2l(x):
expr = x / 65536 if fulls else (x - 4096) / 56064
if expr <= k0:
expr /= phi
else:
expr = ((expr + alpha) / (1 + alpha)) ** gamma
if gcor != 1 and expr >= 0:
expr **= gcor
if sigmoid:
x0 = 1 / (1 + math.exp(cont * thr))
x1 = 1 / (1 + math.exp(cont * (thr - 1)))
expr = thr - math.log(max(1 / max(expr * (x1 - x0) + x0, 0.000001) - 1, 0.000001)) / cont
if fulld:
return min(max(round(expr * 65536), 0), 65535)
else:
return min(max(round(expr * 56064 + 4096), 0), 65535)
# E' = (E <= k0 / phi) ? E * phi : (E ^ (1 / gamma)) * (alpha + 1) - alpha
def l2g(x):
expr = x / 65536 if fulls else (x - 4096) / 56064
if sigmoid:
x0 = 1 / (1 + math.exp(cont * thr))
x1 = 1 / (1 + math.exp(cont * (thr - 1)))
expr = (1 / (1 + math.exp(cont * (thr - expr))) - x0) / (x1 - x0)
if gcor != 1 and expr >= 0:
expr **= gcor
if expr <= k0 / phi:
expr *= phi
else:
expr = expr ** (1 / gamma) * (alpha + 1) - alpha
if fulld:
return min(max(round(expr * 65536), 0), 65535)
else:
return min(max(round(expr * 56064 + 4096), 0), 65535)
return core.std.Lut(src, planes=planes, function=l2g if l2g_flag else g2l)
def _Resize(src, w, h, sx=None, sy=None, sw=None, sh=None, kernel=None,
taps=None, a1=None, a2=None, invks=None, invkstaps=None,
css=None, planes=None, center=None, cplace=None, cplaces=None,
cplaced=None, interlaced=None, interlacedd=None, tff=None,
tffd=None, flt=None, noring=False, bits=None, fulls=None,
fulld=None, dmode=None, ampo=None, ampn=None, dyn=None,
staticnoise=None, patsize=None):
core = vs.get_core()
if not isinstance(src, vs.VideoNode):
raise TypeError('Resize: This is not a clip')
if bits is None:
bits = src.format.bits_per_sample
sr_h = w / src.width
sr_v = h / src.height
sr_up = max(sr_h, sr_v)
sr_dw = 1 / min(sr_h, sr_v)
sr = max(sr_up, sr_dw)
assert(sr >= 1)
# Depending on the scale ratio, we may blend or totally disable
# the ringing cancellation
thr = 2.5
nrb = sr > thr
nrf = sr < thr + 1 and noring
if nrb:
nrr = min(sr - thr, 1)
nrv = round((1 - nrr) * 255)
nrv = [nrv * 256 + nrv] * src.format.num_planes
main = core.fmtc.resample(src, w, h, sx, sy, sw, sh, kernel=kernel,
taps=taps, a1=a1, a2=a2, invks=invks,
invkstaps=invkstaps, css=css, planes=planes,
center=center, cplace=cplace, cplaces=cplaces,
cplaced=cplaced, interlaced=interlaced,
interlacedd=interlacedd, tff=tff, tffd=tffd,
flt=flt)
if nrf:
nrng = core.fmtc.resample(src, w, h, sx, sy, sw, sh, kernel='gauss',
taps=taps, a1=100, invks=invks,
invkstaps=invkstaps, css=css, planes=planes,
center=center, cplace=cplace,
cplaces=cplaces, cplaced=cplaced,
interlaced=interlaced,
interlacedd=interlacedd, tff=tff,
tffd=tffd, flt=flt)
# To do: use a simple frame blending instead of Merge
last = core.rgvs.Repair(main, nrng, 1)
if nrb:
nrm = core.std.BlankClip(main, color=nrv)
last = core.std.MaskedMerge(main, last, nrm)
else:
last = main
return core.fmtc.bitdepth(last, bits=bits, fulls=fulls, fulld=fulld,
dmode=dmode, ampo=ampo, ampn=ampn, dyn=dyn,
staticnoise=staticnoise, patsize=patsize)
def resamplehq(src, width=None, height=None, kernel='spline36',
srcmatrix='709', dstmatrix=None, src_left=0, src_top=0,
src_width=0, src_height=0, noring=False, sigmoid=True,
dither=True):
"""Gamma correct resizing in linear light (RGB).
Args:
width (int): The target width.
height (int): The target height.
kernel (string): The kernel to use while resizing.
Default is "spline36".
srcmatrix (string): The source matrix. Default is "709".
Ignored if source colorspace is RGB.
dstmatrix (string): The target matrix. Default is source matrix.
src_left (int): A sub‐pixel offset to crop the source from the left.
Default 0.
src_top (int): A sub‐pixel offset to crop the source from the top.
Default 0.
src_width (int): A sub‐pixel width to crop the source to. If negative,
specifies offset from the right. Default is source width−src_left.
src_height (int): A sub‐pixel height to crop the source to.
If negative, specifies offset from the bottom.
Default is source height − src_top.
noring (bool): True use non-ringing algorithm in flat area scaling.
It may produce blurring and aliasing when downscaling.
sigmoid (bool): This can reduce the clipping of extreme halo or
Ringing Artefacts that may develop along very sharp edges.
dither (bool): If true, the output is dithered to the source bitdepth
if this was lower thant 16. If false, the output will be kept at
the internal precision of this filter of 16 bits.
"""
core = vs.get_core()
# Var stuff
clip = src
if dstmatrix is None:
dstmatrix = srcmatrix
if src.format.bits_per_sample != 16:
clip = core.fmtc.bitdepth(clip=clip, bits=16)
tid = clip.format.id
# Convert to RGB
if src.format.color_family != vs.RGB:
clip = core.fmtc.resample(clip=clip, css='444')
clip = core.fmtc.matrix(clip=clip, mat=srcmatrix, col_fam=vs.RGB)
# Do stuff
clip = _LinearAndGamma(clip, l2g_flag=False, fulls=True, fulld=True,
curve='709', planes=[0, 1, 2], gcor=1.,
sigmoid=sigmoid, thr=0.5, cont=6.5)
clip = _Resize(clip, w=width, h=height, kernel=kernel, noring=noring,
sx=src_left, sy=src_top, sw=src_width, sh=src_height)
clip = _LinearAndGamma(clip, l2g_flag=True, fulls=True, fulld=True,
curve='709', planes=[0, 1, 2], gcor=1.,
sigmoid=sigmoid, thr=0.5, cont=6.5)
# Back to original format
if src.format.color_family != vs.RGB:
clip = core.fmtc.matrix(clip=clip, mat=dstmatrix,
col_fam=src.format.color_family)
clip = core.fmtc.resample(clip=clip, csp=tid)
# Dither as needed
if dither is True and src.format.bits_per_sample != 16:
clip = core.fmtc.bitdepth(clip=clip, bits=src.format.bits_per_sample)
return clip
|
Completely rebuilt in 2014, with a new addition done in 2018 this home is ideal for modern living. Stunning 180-degree views of Mt. Mansfield are perfectly framed by walls of sliding glass doors that allow sunlight to pour into the home. The open floor plan is anchored by a classic wood burning fireplace and expansive custom kitchen. Handcrafted, rift-sawn white oak millwork is used throughout the home. The chef’s kitchen includes Sub-Zero refrigerator/freezer, double Wolf wall ovens, Wolf range & exhaust hood, Miele dishwasher and additional under-counter Sub-Zero refrigerator and freezer drawers. There are two main floor master suites with access to private decks. The main master bedroom also has a large walk-in closet, and a custom bath with a large tub, walk-in shower, double vanity, and Stowe Mt. views. The lower level walkout has two well-appointed bedrooms with access to the patio and lawn. There is a large media room with custom millwork and built-in surround sound. This Smart Home offers two zones of Sonos wireless audio, Nest thermostats, and digital locks. The new forced air heating and cooling system includes central air conditioning. The exterior of the home is a true reflection of sophistication with new standing seam metal roof and Boral rot-resistant siding. The new addition includes a master suite, playroom, two car garage, and oversized mudroom. This is a home that reflects the best of Stowe style coupled with unforgettable Vermont views. |
Latest developments in allergic rhinitis in Allergy for clinicians and researchers Research efforts in allergic rhinitis have always been intense. Over the past 3 years, numerous breakthroughs in basic science and clinical research have been made, augmenting our understanding of this condition that afflicts a significant proportion of the global population. New epidemiological findings, novel insights into the molecular and cellular mechanisms of allergy, enhancement of current developmental theories, new concepts of the goals and endpoints of management, and latest therapeutic modalities that includes the harnessing of information technology and big data are some areas where important advances were made. We attempt to bring you a summary of the key research advances made in the field of allergic rhinitis from 2013 to 2015. |
Mechanisms and Regulation of Alternative Pre-mRNA Splicing. Precursor messenger RNA (pre-mRNA) splicing is a critical step in the posttranscriptional regulation of gene expression, providing significant expansion of the functional proteome of eukaryotic organisms with limited gene numbers. Split eukaryotic genes contain intervening sequences or introns disrupting protein-coding exons, and intron removal occurs by repeated assembly of a large and highly dynamic ribonucleoprotein complex termed the spliceosome, which is composed of five small nuclear ribonucleoprotein particles, U1, U2, U4/U6, and U5. Biochemical studies over the past 10 years have allowed the isolation as well as compositional, functional, and structural analysis of splicing complexes at distinct stages along the spliceosome cycle. The average human gene contains eight exons and seven introns, producing an average of three or more alternatively spliced mRNA isoforms. Recent high-throughput sequencing studies indicate that 100% of human genes produce at least two alternative mRNA isoforms. Mechanisms of alternative splicing include RNA-protein interactions of splicing factors with regulatory sites termed silencers or enhancers, RNA-RNA base-pairing interactions, or chromatin-based effects that can change or determine splicing patterns. Disease-causing mutations can often occur in splice sites near intron borders or in exonic or intronic RNA regulatory silencer or enhancer elements, as well as in genes that encode splicing factors. Together, these studies provide mechanistic insights into how spliceosome assembly, dynamics, and catalysis occur; how alternative splicing is regulated and evolves; and how splicing can be disrupted by cis- and trans-acting mutations leading to disease states. These findings make the spliceosome an attractive new target for small-molecule, antisense, and genome-editing therapeutic interventions. |
California Dreamin’ Boxed Set by Melissa Pearl, Anna Cruise
Genre: Young Adult, Paranormal, New Adult, Romance,
.99 Days: Oct 5-7
Amazon
FOUR MATURE YA ROMANCES SET IN CALIFORNIA TO BENEFIT “A Chance for Children”
This four book boxed-set is designed for mature YA readers. Set in California, these stories follow the lives of various teens, all struggling to find their way and figure out what they want from life.
Betwixt by Melissa Pearl is Dale and Nicole’s story.
Hit by a car and left for dead, Nicole is lost to the world in a isolated forest, until her soul reaches out to be heard. The only one to hear her ghostly cries is Dale, a guy at school who has every reason to hate her. Can she convince him to listen before it’s too late? Or will her killer find her and finish the job first?
If I Fall by Anna Cruise is the story of Meg Calloway, a girl reeling from her parents’ sudden divorce.
Her father is about to marry a woman she can’t stand and her mother’s only companion is an endless supply of alcohol. When Aidan Westwood, an older boy at school, shows interest in her, she grabs on and doesn’t let go, thinking he’s exactly what she needs to help stem her loneliness and despair. She quickly learns that Aidan lives a darker, more dangerous life than she does and the more isolated she feels from her family, the more willing she is to step into his world.
As Meg drifts further from her friends, she tries to find comfort with a boy who is opening her eyes to new things, none of them good. Will she listen to those around her who are warning her that she’s headed down a path of self-destruction?
Or will she fall too far…too fast…too deep?
It Was You by Anna Cruise is the first Abby and West story.
Having endured eighteen years in the shadow of her identical twin sister, Annika, Abby Sellers wants a fresh start. A chance to create her own life, separate from her conniving, deceptive twin.
Surprising both her family and friends, Abby ditches her plans for college and enrolls at a new school instead. There, she encounters West Montgomery, a sexy fellow student who immediately disarms her with his good looks and charm. West takes a liking to Abby and she suddenly finds herself walking a thin line, fabricating a fictional life created not by lies but by omission. She soon discovers West has secrets of his own, secrets that he’s not altogether interested in sharing.
Out from under the shadow of her twin, Abby’s life—and her relationship with West—blossoms. When Abby leaves town one weekend, something unthinkable happens and her relationship with West is shattered. Reeling from the discovery, Abby fears all of her plans have backfired and she’s created a mess for both of them, a mess that no one can clean up.
But West isn’t willing to let her go that easily. When he forces her to confront secrets they’ve both been hiding, Abby must decide more than if she’s willing to forgive and forget. She must also decide just what kind of life she wants…and who she wants to live it with.
True Colors by Melissa Pearl is Caitlyn and Eric’s story.
A chance encounter with a strange, homeless man changes Caitlyn Davis forever. Suddenly, she can see behind people’s masks. She discovers that her life isn’t as simple as she imagined and high school is filled with secrets…some very sinister ones. Will Caitlyn’s new ability lead her into hot water? Or is her new found vision a blessing that will expose her friends’ true colors?
The authors will donate their proceeds to A Chance For Children, a California based charity that strives to empower at-risk youth by providing the opportunities to set goals and the tools to achieve them. |
<gh_stars>10-100
# -*- coding: utf-8 -*-
# Author: github.com/madhavajay
"""
This file is a solution.py proxy to connect the original udacity
solution_test.py test with my project code base
"""
from sudoku.board import Board as SB
from sudoku.board import BoardState
def solve(board_string: str) -> BoardState:
"""Call search with diagonal_mode True in board.py"""
sbrd = SB(diagonal_mode=True)
board = sbrd.grid_values(board_string)
return sbrd.search(board)
def naked_twins(board_dict: BoardState) -> BoardState:
"""Call naked_twins in board.py"""
sbrd = SB()
return sbrd.naked_twins(board_dict)
|
<commit_msg>Add multi-value parameter SynthDef str() test.
<commit_before><commit_after># -*- encoding: utf-8 -*-
from abjad.tools import systemtools
from supriya import synthdeftools
from supriya import ugentools
class TestCase(systemtools.TestCase):
def test_multi_value_parameters(self):
with synthdeftools.SynthDefBuilder(
amp=0.1,
freqs=[300, 400],
out=0,
) as builder:
sines = ugentools.SinOsc.ar(
frequency=builder['freqs'],
)
sines = ugentools.Mix.new(sines)
sines = sines * builder['amp']
ugentools.Out.ar(
bus=builder['out'],
source=sines,
)
synthdef = builder.build()
self.compare_strings(
'''
SynthDef ... {
0_Control[1:freqs[0]] -> 1_SinOsc[0:frequency]
const_0:0.0 -> 1_SinOsc[1:phase]
0_Control[2:freqs[1]] -> 2_SinOsc[0:frequency]
const_0:0.0 -> 2_SinOsc[1:phase]
1_SinOsc[0] -> 3_BinaryOpUGen:ADDITION[0:left]
2_SinOsc[0] -> 3_BinaryOpUGen:ADDITION[1:right]
3_BinaryOpUGen:ADDITION[0] -> 4_BinaryOpUGen:MULTIPLICATION[0:left]
0_Control[0:amp] -> 4_BinaryOpUGen:MULTIPLICATION[1:right]
0_Control[3:out] -> 5_Out[0:bus]
4_BinaryOpUGen:MULTIPLICATION[0] -> 5_Out[1:source]
}
''',
str(synthdef),
)
|
import * as app from './app';
import logger from './logger';
logger.info('Application starting...');
app
.start()
.then(() => {
logger.info('Startup complete');
})
.catch((err) => {
logger.error(err.message);
process.exit(1);
});
const signals: NodeJS.Signals[] = ['SIGHUP', 'SIGINT', 'SIGTERM'];
signals.forEach((signal) => {
process.on(signal, () => {
shutdown(signal);
});
});
const shutdown = (signal: NodeJS.Signals) => {
logger.info(`Received a ${signal} signal. Attempting graceful shutdown...`);
app.stop().finally(() => {
logger.info(`Shutdown completed. Exiting.`);
process.exit(0);
});
};
|
National AFL Women's League needs proper pay and resources to succeed, say players
Posted
Prospective footballers in the new national women's AFL next year insist they need to be looked after financially for the competition to succeed.
The AFL is pushing ahead with plans to establish a national women's league in 2017.
Western Bulldogs player Lauren Arnell, who represented the club in the last two years in exhibition games against Melbourne, said if the league wants elite athletes the players need to be treated as such.
"They want elite athletes so we need to make sure the resources are there for female athletes and female footballers to do the job properly," Arnell said.
Sorry, this video has expired Video: Women coming to an AFL team near you (ABC News)
Details of the league are still being discussed, but one model being mooted involves up to eight teams playing a competition in the weeks before the men's league beginning in late March.
"We'll start from a base where the girls should be no worse off for playing football," said AFL General Manager of Game Development Simon Lethlean.
"As it (the league) becomes more viable, more popular and more commercial realities become available, we'll look to reward the players," he said.
Brisbane teenager Tayla Harris says players understand there will be some trade-offs to get the competition up and running.
"I could be a little bit negative and say I'm going to miss out on getting paid, but then I really want to be in the position where I can trail blaze ... and be in the first group which I think is pretty significant," she said.
Queensland leading the charge in women's AFL
Harris is one of the standout players from the Queensland system, which has become a stronghold in the women's game.
Last year, 71, 293 women and girls in Queensland played or participated in AFL programs, compared to 42, 260 in Victoria.
"We punch well above our weight compared to the traditional football states," says AFL Queensland's Craig Starcevich.
"It's quite exciting for the years to come because we've got a number of good girls to choose from," he said.
The AFL is currently running women's football academies in each state, designed to accelerate the development of talented players.
There is an urgency to the project, with the AFL keen to ensure the standard of the new competition is of a high quality.
"We won't get everything right first up," says Lethlean.
"We want to have a sustainable and viable competition for the elite girls to play in ... year two might be different to year three, we saw with the Big Bash League (cricket) how they started, year one compared to year five."
Lauren Arnell said many people were already surprised by the standard of the women's game.
"Whether they come and watch a training session or they see it on the TV or they come and watch a game ... they see that women can really play a decent brand of footy and it's worth watching."
Topics: sport, australian-football-league, brisbane-4000, qld, melbourne-3000, vic, australia |
Cardiac hypertrophy is positively regulated by long non-coding RNA PVT1. The aim of this study was to determine whether long non-coding RNA PVT1 can participate in the regulation of cardiac hypertrophy. A C57BL/6 mouse cardiac hypertrophic model was established using transverse aortic constriction (TAC). The animals subjected to sham operation were used as controls. Transcripts of PVT1 were analyzed in hearts of model and sham control groups after TAC for 4 weeks using quantitative real-time PCR (qRT-PCR). Additionally, to investigate whether PVT1 was involved in cardiac hypertrophy, 1 M angiotensin II (Ang II) was used to induce hypertrophy and PVT1 siRNA was performed in the cultured neonatal mouse cardiac cardiomyocytes. Cell size was measured by cell surface area and total protein content analyses in response to Ang II treatment. Moreover, some hypertrophic markers including atrial natriuretic peptide (ANP), B-type natriuretic peptide (BNP), and beta-myosin heavy chain (-MHC) were also quantified using qRT-PCR. As a result, PVT1 was up-regulated by 2.5-fold (P<0.05) in hypertrophic hearts after TAC for 4 weeks as compared to sham group. In addition, siRNA of endogenous PVT1 in cardiomyocytes significantly reduced (P<0.05) Ang II-induced increase of cell size in terms of cell surface area (by 5.6-fold) and total protein content (by 23.0%). PVT1 siRNA also obviously attenuated Ang II-induced ANP and -MHC expression by 40.9% and 41.5%, respectively (P<0.05), but had no effect on BNP mRNA expression. Our results demonstrated that PVT1 was essential for the maintenance of cell size of cardiomyocytes and might play a role in the regulation of cardiac hypertrophy. |
import os
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "2"
import io
import tensorflow as tf
import matplotlib.pyplot as plt
import numpy as np
import tensorflow_datasets as tfds
from tensorflow import keras
from tensorflow.keras import layers
# Make sure we don't get any GPU errors
physical_devices = tf.config.list_physical_devices("GPU")
tf.config.experimental.set_memory_growth(physical_devices[0], True)
(ds_train, ds_test), ds_info = tfds.load(
"cifar10",
split=["train", "test"],
shuffle_files=True,
as_supervised=True,
with_info=True,
)
def normalize_img(image, label):
"""Normalizes images"""
return tf.cast(image, tf.float32) / 255.0, label
AUTOTUNE = tf.data.experimental.AUTOTUNE
BATCH_SIZE = 32
def augment(image, label):
if tf.random.uniform((), minval=0, maxval=1) < 0.1:
image = tf.tile(tf.image.rgb_to_grayscale(image), [1, 1, 3])
image = tf.image.random_brightness(image, max_delta=0.1)
image = tf.image.random_flip_left_right(image)
return image, label
# Setup for train dataset
ds_train = ds_train.map(normalize_img, num_parallel_calls=AUTOTUNE)
ds_train = ds_train.cache()
ds_train = ds_train.shuffle(ds_info.splits["train"].num_examples)
ds_train = ds_train.map(augment)
ds_train = ds_train.batch(BATCH_SIZE)
ds_train = ds_train.prefetch(AUTOTUNE)
# Setup for test Dataset
ds_test = ds_train.map(normalize_img, num_parallel_calls=AUTOTUNE)
ds_test = ds_train.batch(BATCH_SIZE)
ds_test = ds_train.prefetch(AUTOTUNE)
class_names = [
"Airplane",
"Autmobile",
"Bird",
"Cat",
"Deer",
"Dog",
"Frog",
"Horse",
"Ship",
"Truck",
]
def get_model():
model = keras.Sequential(
[
layers.Input((32, 32, 3)),
layers.Conv2D(8, 3, padding="same", activation="relu"),
layers.Conv2D(16, 3, padding="same", activation="relu"),
layers.MaxPooling2D((2, 2)),
layers.Flatten(),
layers.Dense(64, activation="relu"),
layers.Dropout(0.1),
layers.Dense(10),
]
)
return model
model = get_model()
num_epochs = 1
loss_fn = keras.losses.SparseCategoricalCrossentropy(from_logits=True)
optimizer = keras.optimizers.Adam(lr=0.001)
acc_metric = keras.metrics.SparseCategoricalAccuracy()
train_writer = tf.summary.create_file_writer("logs/train/")
test_writer = tf.summary.create_file_writer("logs/test/")
train_step = test_step = 0
for lr in [1e-1, 1e-2, 1e-3, 1e-4, 1e-5]:
train_step = test_step = 0
train_writer = tf.summary.create_file_writer("logs/train/" + str(lr))
test_writer = tf.summary.create_file_writer("logs/test/" + str(lr))
model = get_model()
optimizer = keras.optimizers.Adam(lr=lr)
for epoch in range(num_epochs):
# Iterate through training set
for batch_idx, (x, y) in enumerate(ds_train):
with tf.GradientTape() as tape:
y_pred = model(x, training=True)
loss = loss_fn(y, y_pred)
gradients = tape.gradient(loss, model.trainable_weights)
optimizer.apply_gradients(zip(gradients, model.trainable_weights))
acc_metric.update_state(y, y_pred)
with train_writer.as_default():
tf.summary.scalar("Loss", loss, step=train_step)
tf.summary.scalar(
"Accuracy", acc_metric.result(), step=train_step,
)
train_step += 1
# Reset accuracy in between epochs (and for testing and test)
acc_metric.reset_states()
# Iterate through test set
for batch_idx, (x, y) in enumerate(ds_test):
y_pred = model(x, training=False)
loss = loss_fn(y, y_pred)
acc_metric.update_state(y, y_pred)
with test_writer.as_default():
tf.summary.scalar("Loss", loss, step=test_step)
tf.summary.scalar(
"Accuracy", acc_metric.result(), step=test_step,
)
test_step += 1
acc_metric.reset_states()
# Reset accuracy in between epochs (and for testing and test)
acc_metric.reset_states()
|
1. Field of the Invention
The present invention relates to a see-through concrete form through which the state of concrete packed in the concrete form can be inspected at the time of concrete placement.
2. Related Art Statement
Conventionally, concrete forms made of woody materials such as southern sea's timber and the like have been used. When concrete is placed in such concrete forms having no see-through property, however, the state of concrete packed in the form cannot be inspected visually. Thus, when the concrete packed in a form is defective, such as having a gap between the form and concrete, it has been sometimes necessary to destroy the produced construction after the concrete placement, and to place the concrete once again.
For such a reason, the use of a transparent synthetic resin board as a concrete form has been proposed (Japanese Patent Application KOKAI No. 64-80665, No. 1-94159, etc.). However, this transparent synthetic resin board is inferior in stiffness and impact strength, and can exhibit a sufficient strength for use as a concrete form only when an additional measure, such as increasing the thickness of the top, bonding a crosspiece, etc. is taken. |
<filename>sample4/decompiled_raw/assets/LenovoSafeBox455/sources/com/lenovo/safebox/PrivacySpaceReceiver.java
package com.lenovo.safebox;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
/* loaded from: classes.dex */
public class PrivacySpaceReceiver extends BroadcastReceiver {
@Override // android.content.BroadcastReceiver
public void onReceive(Context context, Intent intent) {
}
}
|
DKK1 rescues osteogenic differentiation of mesenchymal stem cells isolated from periodontal ligaments of patients with diabetes mellitus induced periodontitis Multiple studies have shown that diabetes mellitus is an established risk factor for periodontitis. Recently mesenchymal stem cells derived from periodontal ligament (PDLSCs) have been utilized to reconstruct tissues destroyed by chronic inflammation. However, impact of periodontitis with diabetes mellitus on PDLSCs and mechanisms mediating effects of complex microenvironments remain poorly understood. In this study, we found multiple differentiation potential of PDLSCs from chronic periodontitis with diabetes mellitus donors (D-PDLSCs) was damaged significantly. Inhibition of NF-B signaling could rescue osteogenic potential of PDLSCs from simple chronic periodontitis patients (P-PDLSCs), whereas did not promote D-PDLSCs osteogenesis. In addition, we found expression of DKK1 in D-PDLSCs did not respond to osteogenic signal and decreased osteogenic potential of D-PDLSCs treated with DKK1 could be reversed. To further elucidate different character between P-PDLSCs and D-PDLSCs, we treated PDLSCs with TNF- and advanced glycation end products (AGEs), and find out AGEs which enhance effect of TNF- in PDLSCs might mediate special personality of D-PDLSCs. The adverse effect of AGEs in PDLSCs could be reversed when PDLSCs were treated with DKK1. These results suggested DKK1 mediating WNT signaling might be a therapy target to rescue potential of PDLSCs in periodontitis with diabetes mellitus. Results Osteogenic or adipogenic potential of P-PDLSCs and D-PDLSCs were impaired. Consistent with our previous results 15, osteogenic and adipogenic potential of P-PDLSCs decreased significantly compared with H-PDLSCs (Fig. 1). Although both mesenchymal stem cells produced mineralized extracellular matrices which were positively stained with Alizarin Red S staining, D-PDLSCs formed fewest mineralized nodules among three groups (Fig. 1A). Furthermore, Real-time PCR and western blot analyses showed that the expression of osteoblast specific gene run-related gene 2 (RUNX2) in D-PDLSCs was much lower than those in H-PDLSCs and P-PDLSCs following 14 days of osteogenic induction (p < 0.05) (Fig. 1C). When PDLSCs were induced for 4 weeks for adipogenic differentiation, oil globules were formed with accumulation of lipid-rich vacuoles within cells, as confirmed by Oil Red O staining. The H-PDLSCs formed significantly more oil globules (p < 0.05), but no significant difference was found between P-PDLSCs and D-PDLSCs (Fig. 1B). Additionally, Real-time PCR and western blot analyses showed the expression levels of adipogenic key gene peroxisome proliferator-activated receptor gamma (PPAR 2) in P-PDLSCs and D-PDLSCs was lower as compared with H-PDLSCs following adipogenic induction, but there is no statistical difference for PPAR 2 gene expression between P-PDLSCs and D-PDLSCs (Fig. 1D). DKK1 could reverse decreased osteogenesis of D-PDLSCs. It was reported that inhibition of NF- B could increase osteogenesis of PDLSCs from periodontitis 14. The question is whether we could reverse the impaired osteogenic potential of D-PDLSCs through modulating NF- B signaling. Indeed, activity of NF- B was higher in P-PDLSCs and PDTC that inhibitor of NF- B pathway could reverse impared expression of RUNX2 with blocking NF- B signaling in P-PDLSCs ( Fig. 2A). Though NF- B signaling was also activated in D-PDLSCs, PDTC could not promote RUNX2 expression in D-PDLSCs ( Fig. 2A). We previously found that DKK1 could promote osteogenic differentiation of PDLSCs through regulating -catenin 3. To assess DKK1 of PDLSCs in response to inflammatory and diabetic stimulation, we determined the level of DKK1 by Real-time PCR analysis during a period of 7 days. H-PDLSCs and P-PDLSCs expressed the high level DKK1 with culturing in osteogenic medium, but its expression was not increased in D-PDLSCs (Fig. 2B). To directly investigate whether low expression of DKK1 results in impaired osteogenesis in D-PDLSCs, we cultured H-PDLSCs and D-PDLSCs in osteogenic differentiation medium with DKK-1 at 50 ng/ml. Interestingly, quantitative analysis suggested that the incubation of both H-PDLSCs and D-PDLSCs with DKK1 increased the formation of mineralized nodules (p < 0.05) (Fig. 2C). DKK1 could increase expression of RUNX2 through inhibiting active -catenin in D-PDLSCs (Fig. 2D,E). AGEs could aggravate impaired osteogenesis of PDLSCs in inflammatory microenvironments in vitro. Both P-PDLSCs and D-PDLSCs were isolated from periodontal tissues with inflammation, but osteogenic potential of D-PDLSCs could not be regulated by inflammatory related pathway-NF- B. To find out what mediate the character of D-PDLSCs, we examined the effect of AGEs on PDLSCs with Scientific RepoRts | 5:13142 | DOi: 10.1038/srep13142 inflammatory microenvironment in vitro. As reported before, TNF- decreased mineralized bone matrix formation of PDLSCs. Real-time RT-PCR and Western blot analysis indicated osteoblasts marker genes RUNX2 and OSTERIX were reduced by TNF-. Furthermore, AGEs aggravated the effect of TNF- on PDLSCs ( Fig. 3A-C). Quantitative analysis suggested that the administration of AGEs in inflammatory microenvironment decreased the formation of mineralized nodules (p < 0.05). In parallel, Real-time PCR and western blot analyses showed the expression levels of osteoblast specific genes such as RUNX2 and OSTERIX in PDLSCs declined in response with AGEs that presented in the inflammatory cultures. Interestingly, the expression of RAGE which is binding AGEs was increased in inflammatory cultures but not affected by AGEs (Fig. 3C). Furthermore, osteogenic potential of PDLSCs with AGEs treatment declined significantly in terms of ALP staining and ALP quantitation, and was not rescued by PDTC (Fig. 3D,E). AGEs could activate NF- B signaling which was blocked by PDTC, and inhibit expression of RUNX2 that could not be rescued by PDTC. Along with effect of PDTC on osteogenic potential, expression of RAGE was also not affected by PDTC (Fig. 3F,G). DKK1 could inhibit effect of AGEs in PDLSCs and promote D-PDLSCs bone formation in vivo. To confirm the role of WNT signaling regulated by DKK1 in D-PDLSCs, we used siRNA of -catenin in our study to modulate WNT signaling. Active -catenin was increased in D-PDLSCs or in H-PDLSCs with AGEs after culturing in osteo-inductive medium, and was reduced by DKK1 (Figs 2E and 4A). Indeed, -catenin knocked down promoted osteogenic differentiation of H-PDLSCs and D-PDLSCs, which was indicated by ALP staining and ALP activity quantitation ( Fig. 4B-D). Expression of RUNX2 was also increased by catenin siRNA in D-PDLSCs or PDLSCs with AGEs (Fig. 4E,F). We also found that the down-regulated expression of RAGE by -catenin siRNA was only in H-PDLSCs treated with AGEs (Fig. 4E,F). In parallel, impaired osteogenic potential of PDLSCs with AGEs could also be reversed by DKK1. Interestingly, DKK1 could not only rescue osteogenic potential but also reduce expression of RAGE ( Fig. 5A-D). To study the long-term effect of DKK1 in PDLSCs, we performed ectopic bone formation of PDLSCs in vivo. H-PDLSCs, P-PDLSCs and D-PDLSCs treated with DKK1 were loaded on a hydroxyapatite-tricalcium phosphate scaffold and implanted subcutaneously in NOD/SCID mice. After 10 weeks, bone-like tissue was increased 2.3-fold in the D-PDLSCs implants treated with DKK1 compared with D-PDLSCs (Fig. 5E,F). In contrast, DKK1 treated H-PDLSCs and P-PDLSCs only slightly enhanced bone formation by about 20% compared with H-PDLSCs and P-PDLSCs separately. These results suggest that DKK1 indeed promotes osteoblast differentiation of D-PDLSCs in vitro and in vivo. Discussion PDLSCs are known for their stemness in local oral tissues by regenerating periodontal tissues, which leads to a favorable treatment for periodontal defect in periodontitis 16,17. In this study we found that change of osteogenic potential of PDLSCs was associated with diabetic milieu. AGEs inhibited osteogenic potential of PDLSCs and increased impaired effect of TNF- on PDLSCs in vitro. Inflammatory pathway NF- B signaling primarily responded to inflammatory stimulation was uncoupled with diabetic milieu or AGEs treatment in vitro. Notably, DKK1 inhibiting canonical WNT pathway could rescue impaired osteogenic potential of D-PDLSCs. Real-time PCR and western blot analysis of the osteoblast marker gene (RUNX2, normalized to -actin) on day 7 (n = 3). Active -catenin which indicates WNT signaling is activated was examined by western blot analysis. Data (± SD) are representative of two (D) or three (B,C) independent experiments. Student's t test was performed to determine statistical significance (*p < 0.05, **p < 0.01). PDLSCs have been identified as an important factor of periodontitis progression, as they have been found to regenerate the complex system of tooth-supporting apparatus (i.e., the periodontal ligament, alveolar bone and root cementum) 18. Though we previously had demonstrated inflammatory effect on PDLSCs, we still want to understand whether simple periodontitis and complicate periodontitis had the same effect on PDLSCs. Four years ago, we had reported that different character of age matched donors for H-PDLSCs and P-PDLSCs 3,15, and found DKK1 have the similar effect on H-PDLSCs and P-PDLSCs. DKK1 might rescue osteogenic potential of P-PDLSCs. Interestingly, compared with simply periodontitis, the altered inflammatory microenvironment induced by diabetes mellitus leads to reduced lower osteogenic potential but no significantly adipogenic changes. However, we could not completely exclude the aging effect on PDLSCs, since media age in healthy donors for generating H-PDLSCs was much younger (17-years) than patients isolated for D-PDLSCs, and 12 year younger than patients for P-PDLSCs. In clinic, it was very hard to get D-PDLSCs from young donors and H-PDLSCs from old donors. It seems that we could not exclude effect of age on osteoblastogenesis between H-PDLSCs and D-PDLSCs. However, the age of P-PDLSCs and D-PDLSCs of donors was similar. The age between the two groups are basically matched. Additionally, In this study, we treated H-PDLSCs with AGEs in vitro to mimic D-PDLSCs, and found similar results from H-PDLSCs with AGEs and D-PDLSCs. These characteristics suggested that diabetes mellitus might have a unique effect on PDLSCs expected for aggravating periodontitis. There has also been a growing awareness that advanced glycation end products (AGEs) are intimately linked to other complication of diabetes mellitus 7. Nuclear factor-kappaB (NF- B) is well studied in inflammation and diabetes by many different groups, and our recent report shows that NF- B may help in improving stem cell-mediated inflammatory disease therapy in periodontal tissues 14. However, we could not rescue the differentiation potential of PDLSCs either from periodontitis with diabetes patients or in AGEs stimulation in vitro which mimic diabetes mellitus microenvironments. These results suggested there might be another signaling mediating the decreased osteogenic potential of D-PDLSCs or PDLSCs with AGEs treatment. It is known that WNT/ -catenin pathway is related to the pathogenesis of several diseases. Many reports have suggested that WNT signaling could be a major modulator in diabetes. Additionally, a recent clinical study shows that circulating sclerostin (an inhibitor of WNT signaling) is increased in type 2 diabetes mellitus patients 27. However, it is still unclear that roles of WNT signaling in periodontitis with diabetes. In this study, we found that DKK1 blocking WNT signaling indeed promoted osteogenic differentiation of D-PDLSCs in vitro and in vivo. Interestingly, we saw DKK1 could also promote the mineralization of H-PDLSCs, and we also examined in vivo bone formation of H-PDLSCs with or without DKK1. The in vivo bone formation results suggested that DKK1 might promote osteogenesis of H-PDLSCs. However, we found the promotion of DKK1 on H-PDLSCs was less stable than other PDLSCs groups. It might be microenvironment influence clonal formation units of PDLSCs. As we all known, PDLSCs are kinds of MSCs. Several studies indeed have shown the activation of WNT/beta-catenin pathway could promote osteogenic differentiation of MSCs. It was also suggested that high concentration WNT3a treatment could inhibit osteogenesis of MSCs. Interestingly, we have found WNT signaling have completely opposite effect on MSCs from bone marrow and periodontal tissue, and the regulation might influence different inflammatory effect on MSCs from bone marrow and periodontal tissue 29,35. Both WNT3a and LiCl could activate WNT/beta-catenin pathway, and inhibit osteogenic differentiation of MSCs from periodontal tissue 36. It was suggested PDLSCs expressed MSCs markers, and PDLSCs might be another MSCs in periodontal tissue. We supposed the difference might be related to different clonal formation units in MSCs. For this reason, the mechanism, by which WNT signaling activation suppresses osteoblastic differentiation in MSC from other tissue, need further investigate. In conclusion, we found that the function of PDLSCs from periodontitis with diabetes mellitus patients was impaired, which was different with PDLSCs from only periodontitis patients. WNT signaling inhibitor treatment appeared to cause increased bone formation as well as partly regulate AGEs-RAGE axis, suggesting a possible mechanism by which AGEs induces PDLSCs dysfunction in our clinical cell model. The ultimate goal of treating periodontitis patients with diabetes mellitus is to rescue the defect of PDLSCs that are believed to regenerate periodontal tissues. Considering that inhibition of WNT signaling improves function of PDLSCs, as we reported in this study, DKK1 or a small molecule that mimic its function may help PDLSCs server as a potential agent to treat periodontitis patients with diabetes mellitus. Methods Subjects. Periodontitis patients without diabetes mellitus were aged from 30 to 70 years with a mean age of 56.95 ± 11.3 years, and The diagnosis of periodontitis met the following condition: with over 20 teeth, probing depth(PD) over 5 mm, more than 30% teeth with attachment loss (AL) over 4 mm, or over 60% teeth with PD > 4 mm and AL > 3 mm; without periodontal treatment in the last 6 months; without antibiotics or non-steroidal anti-inflammatory drugs administered in the last 3months; without serious systemic diseases and complications. Patients with systemic inflammatory diseases (rheumatoid arthritis, etc.), blood disease, liver damage, kidney disease or trauma were excluded. Periodontitis patients with diabetes mellitus were aged from 47 to 76 with a mean age of 60.15 ± 8.9. The diagnosis of periodontitis met the condition shown as above, and the diagnosis of diabetes mellitus met the following criteria: the diagnosis of diabetes mellitus over 1 year; good glucose control with fasting blood glucose <7.0 mmol/L and HbA1c between 6.5%and 7.5%; no medication changes in the last 3 months; No smoke; without severe complications. The normal control group consisted of 10 healthy male adults, aged from 36 to 50 years with a mean age of 42.8 ± 5.1 years. Human third molars without caries, inflammation, or periodontitis were extracted for impaction reasons from 10 systemically healthy donors at the department of Endocrinology of affiliated hospital and dental hospital of Zunyi Medical College, Zunyi, China. For the aged donors whose third impacted molars were not removed in the correct stage, the extraction of teeth was based on complete oral health examinations showing that the corresponding teeth were harmful to the donors' oral health and must be removed. A total of 20 patients with periodontitis and 20 periodontitis with type 2 diabetes mellitus patients were enrolled from the department of Endocrinology of affiliated hospital and dental hospital of Zunyi Medical College. Informed consents were obtained from all subjects. This study was approved by the Ethics Committee of Zunyi Medical College. All the methods were carried out in accordance with the approved guidelines. Additional information of teeth condition and approach of teeth: Please see Supplemental Methods. Primary human PDLSCs were cultured as described previously 15, and and protocols were in accordance with the approved guidelines. In brief, we gently washed the teeth with sterile phosphate-buffered solution (PBS) (Boster, Wuhan, China) and separated PDL tissues from the middle part of the root surface. PDLSCs were isolated using the limiting dilution technique and cultured in -minimum essential medium ( -MEM; Gibco, Grand Island, NY, USA) supplemented with 10% fetal bovine serum (FBS; Sijiqing, Hangzhou, China), 0.292 mg/mL glutamine ((Invitrogen, Grand Island, NY, USA), 100 U/mL penicillin, 100 mg/mL streptomycin (Gibco) at 37 °C in a humidified atmosphere of 5% CO2. After 2-3 weeks in culture, the single cell-derived clones were harvested and mixed together. Multiple colony-derived PDLSCs from normal control group (H-PDLSCs), periodontitis patients without diabetes mellitus (P-PDLSCs) and periodontitis patients with diabetes mellitus (D-PDLSCs) at 2-4 passages were used in our experiments. Each experiment repeated at least three times. Tumor necrosis factor (TNF- ) and DKK1 were purchased from Pepro-Tech (Rocky Hill, NJ, USA). To mimic diabetes microenvironments in vitro, AGE-BSA (BioVision, Milpitas, CA, USA) was used to treat H-PDLSCs at different concentrations (0, 1, 10, 100, and 200 ng/mL). We transfected PDLSCs with siRNA targeting -catenin or control siRNA that has been tested to not lead to the specific degradation of any known cellular mRNA (GenePharma, Shanghai, China) using Lipofectamine RNAiMAX in Opti-MEM (Invitrogen) according to the protocol recommended by the manufacturer. PDLSCs isolation and culture. We isolated and cultured Osteogenic and adipogenic differentiation. The third-passage of H-PDLSCs, P-PDLSCs and D-PDLSCs were seeded into at a density of 1 105 each well of a six-well plate. At 80% confluent, PDLSCs were cultured in osteogenic medium ( -MEM supplemented with 10% FBS, 5 mM L-glycerophosphate (Sigma, St Louis, MO, USA), 100 nM dexamethasone (Sigma), and 50 ug/ml ascorbic acid. After 4-week induction, the samples were fixed with 4% polyoxymethylene for 30 min; 0.1% Alizarin red staining (Sigma) was performed to determine mineralization as previously reported. At 100% confluent, PDLSCs were cultured in adipogenic medium ( -MEM supplemented with 10% FBS, 2 M insulin (Sigma), 0.5 mM isobutyl-methylxanthine (IBMX; Sigma), 0.5 M hydrocortisone and 1 mM dexamethasone (Sigma)). The control group was cultured in a-MEM plus 10% FBS. The medium was changed every two days for 3 weeks. The experiment was repeated three times. After 3 weeks of Scientific RepoRts | 5:13142 | DOi: 10.1038/srep13142 induction, the cells growing under adipogenic conditions were washed twice with PBS and fixed in 70% ethanol for 15 min. Oil red O staining (Sigma) was performed as previously reported. Alkaline phosphatase (ALP) activity assay. For quantitative analysis of alkaline phosphatase (ALP) activity, single-cell suspensions of H-PDLSCs, P-PDLSCs and D-PDLSCs were seeded at a density of 3 103 cells/well into 96-well plates and cultured in -MEM at 37 °C in a humidified atmosphere of 5% CO2, and 95% air. At 24 hours the media was changed to the osteogenic induction media, after 3-, 5-, and 7-day in vitro culture, the ALP activity of each cell was detected with a commercially available assay kit (Zhongsheng, Beijing, China). In brief, cells were washed 3 times in PBS and incubated in Triton X-100 (3 ml/l in PBS) for 4 hours. 100 l of pnitrophenol phosphate substrate solutions was added to each well and the cells were incubated for 40 min at 37 °C, and then the reaction was stopped with 0.1 M NaOH. The OD value was measured by spectrophotometer at 405 nm using a microplate reader. The experiment was repeated three times. Quantitative real time-polymerase chain reaction (Real time-PCR). Total RNA was isolated from PDLSCs of three groups using the Trizol reagent (Invitrogen). Approximately 1 g of total RNA was converted to cDNA by using the Super Script First Strand Synthesis kit (Invitrogen). The Real time-PCR reactions were performed using the QuantiTect SYBR Green PCR kit (Toyobo, Osaka, Japan) and the CFX96 Touch Real-Time PCR Detection System (Bio-rad, Hercules, CA, USA). Two independent experiments were performed for each reaction in triplicate. The primer sequences used in the experiment were listed in Supplementary table 2. Protein isolation and western blot analysis. Total proteins were extracted from the cells by lysis in RIPA buffer (10 mM Tris-HCl, 1 mM EDTA, 1% sodium dodecyl sulfate, 1% Nonidet P-40, 1:100 proteinase inhibitor cocktail, 50 mM -glycerophosphate, 50 mM sodium fluoride). We determined the protein concentration in the extracted lysates by measuring the absorbance at 595 nm by using a protein assay solution (Bio-Rad, Hercules, CA, USA). Aliquots of 20-50 g of the cell lysates per sample were separated by 10% sodium dodecyl sulfate-polyacrylamide gel electrophoresis (SDS-PAGE) and then transferred to a polyvinylidene fluoride (PVDF) membrane (Bio-Rad). The membranes were blocked with 5% milk for 2 hours and then incubated with primary antibodies overnight at 4 °C The immunocomplexes were incubated with horseradish peroxidase-conjugated anti-rabbit or anti-mouse IgG antibodies (Boster). Immunodetection was performed using the Western-Light chemiluminescent detection system (Peiqing, Shanghai, China). The experiment was repeated three times. In vivo bone formation assay. All of the procedures that involved animals were approved by the Animal Use and Care Committee of the Fourth Military Medical University (license number: SCXK 2007-007). For a single transplant complex, the PDLSCs were treated with DKK1 (100 ng/ml) as described above, and then cultured for 3 days. Approximately 5.0 10 6 cells were mixed with 40 mg of CBB powders (Research and Development Center for Tissue Engineering, Xi'an, China) and implanted into subcutaneous pockets on the backs of the 8-week NOD/SCID mice (Fourth Military Medical University). As a control, PDLSCs from the same sources that had been treated with DMSO were implanted into the other side of the same host. The implants were removed after 8 weeks, fixed in 4% paraformaldehyde, decalcified in EDTA (pH 7.0), and embedded in paraffin. The samples were cut into 5- m sections and stained with H&E or Masson's Trichrome staining. Statistical analysis. All values were expressed as mean ± standard deviation. Statistical significance was assessed by an independent samples t test with SPSS 16.0 software (SPSS, San Rafael, CA, USA). Statistical significance was determined at p < 0.05. All data acquisition and analyses were performed blindly. |
/**
* Poll for a popup corresponding to {@link PopupType} with a specified
* duration interval, then dismiss it when it appears on-screen.
* @param PARAM {@link PopupType} instance.
* @return {@link Flowable} instance.
* @see #popupPollDuration()
* @see #platform()
* @see #rxa_dismissPopup(PopupType)
* @see #rxv_popupPresent(PopupType)
*/
@NotNull
default Flowable<Boolean> rxa_pollAndDismissPopup(@NotNull final PopupType PARAM) {
final PopupActionType<?> THIS = this;
PlatformType platform = platform();
if (PARAM.applicableTo(platform)) {
return Flowable
.interval(popupPollDuration(), TimeUnit.MILLISECONDS)
.flatMap(a -> THIS.rxv_popupPresent(PARAM))
.distinctUntilChanged()
.flatMap(a -> {
if (a) {
return THIS.rxa_dismissPopup(PARAM);
} else {
return Flowable.just(a);
}
});
} else {
return Flowable.just(true);
}
} |
#ifndef RHIO_PROTOCOL_HPP
#define RHIO_PROTOCOL_HPP
#include <vector>
#include <string>
namespace RhIO
{
/**
* Server replier and Server publisher port
*/
extern unsigned int ServersPortBase;
/**
* Protocol message type
*/
enum MsgType : uint8_t
{
/**
* Client.
* Ask for listing children Nodes.
* Args:
* String: absolute node name to inspect
*/
MsgAskChildren,
/**
* Client.
* Ask for listing values of type Bool,
* Int, Float or Str at given Node name.
* Args:
* String: absolute node name
*/
MsgAskValuesBool,
MsgAskValuesInt,
MsgAskValuesFloat,
MsgAskValuesStr,
/**
* Client.
* Ask for values of type Bool, Int,
* Float, Str
* Args:
* String: absolute value name
*/
MsgGetBool,
MsgGetInt,
MsgGetFloat,
MsgGetStr,
/**
* Client.
* Ask for values update for type
* Bool, Int, Float and Str
* Args:
* String: absolute value name to update
* Bool : new value
* or
* Int : new value
* or
* Float : new value
* or
* Str : new value
*/
MsgSetBool,
MsgSetInt,
MsgSetFloat,
MsgSetStr,
/**
* Client.
* Ask for value meta data for type
* Bool, Int, Float and Str
* Args:
* String: absolute value name to update
*/
MsgAskMetaBool,
MsgAskMetaInt,
MsgAskMetaFloat,
MsgAskMetaStr,
/**
* Client
* Ask for streaming enable and disable
* on given absolute value name (for any type).
* (Streaming watcher is incremented/decremented)
* Args:
* String: absolute value name
*/
MsgEnableStreamingValue,
MsgDisableStreamingValue,
/**
* Client
* Ask for streaming enable and disable
* on given absolute stream name (for any type).
* (Streaming watcher is incremented/decremented)
* Args:
* String: absolute stream name
*/
MsgEnableStreamingStream,
MsgDisableStreamingStream,
/**
* Client
* Ask for streaming enable and disable
* on given absolute frame name.
* (Streaming watcher is incremented/decremented)
* Args:
* String: absolute frame name
*/
MsgEnableStreamingFrame,
MsgDisableStreamingFrame,
/**
* Client.
* Ask for Server persist dump and load for all
* subtree below given node into given server
* side path directory
* Args:
* String: absolute node name
* String: configuration path server side
*/
MsgAskSave,
MsgAskLoad,
/**
* Client.
* List all registered command relative
* name at given node absolute name
* Args:
* String: absolute node name
*/
MsgAskCommands,
/**
* Client.
* Ask the description
* for absolute command name
* Args:
* String: absolute command name
*/
MsgAskCommandDescription,
/**
* Client.
* Ask for listing all commands
* alsolute name.
* Args:
* None
*/
MsgAskAllCommands,
/**
* Client.
* Call the given absolute name command
* with given string arguments list
* Args:
* String: absolute command name
* Int: number of argument
* String: argument 1
* String: argument 2
* ...
*/
MsgAskCall,
/**
* Client.
* List all registered streams relative
* name at given node absolute name
* Args:
* String: absolute node name
*/
MsgAskStreams,
/**
* Client.
* Ask given absolute stream name
* textual comment information
* Args:
* String: absolute stream name
*/
MsgAskDescriptionStream,
/**
* Client.
* List all registered frames relative
* name at given node absolute name
* Args:
* String: absolute node name
*/
MsgAskFrames,
/**
* Client.
* Ask given absolute frame name
* meta information
* Args:
* String: absolute frame name
*/
MsgAskMetaFrame,
/**
* Server.
* An error has occured.
* Args:
* String: error message.
*/
MsgError,
/**
* Server.
* Return all names of asked children
* or values (Bool, Int, Float or Str) of asked Node.
* Args:
* Int: number of values
* String: name 1
* String: name 2
* ...
*/
MsgListNames,
/**
* Server.
* Return the value of asked value
* for type Bool, Int, Float, Str
* Args:
* Bool: value
* or
* Int: value
* or
* Float: value
* or
* Str: value
*/
MsgValBool,
MsgValInt,
MsgValFloat,
MsgValStr,
/**
* Server.
* Acknowledge the requested set
* No arguments
*/
MsgSetOk,
/**
* Server.
* Return all asked value meta information
* for type Bool, Int, Float and Str
* Args:
* String: value comment
* Bool: has minimum
* Bool: has maximum
* Bool: is persisted
* Int: number of watcher for streaming
*
* Bool: minimum value
* Bool: maximum value
* Bool: persisted value
* or
* Int: minimum value
* Int: maximum value
* Int: persisted value
* or
* Float: minimum value
* Float: maximum value
* Float: persisted value
* or
* Str: minimum value
* Str: maximum value
* Str: persisted value
*/
MsgValMetaBool,
MsgValMetaInt,
MsgValMetaFloat,
MsgValMetaStr,
/**
* Server.
* Return streamed values for type
* Bool, Int, Float, Str, Stream or Frame
* Args:
* String: value absolute name
* Int: timestamp
* Bool: value
* or
* Int: value
* or
* Float: value
* or
* Str: value
* or
* Str: value
* or
* Int: size
* Int: image width
* Int: image height
* Data: image raw data
*/
MsgStreamBool,
MsgStreamInt,
MsgStreamFloat,
MsgStreamStr,
MsgStreamStream,
MsgStreamFrame,
/**
* Server.
* Return acknowledge when persist
* operation is finished
*/
MsgPersistOK,
/**
* Server.
* Return the string description
* of asked command
* Args:
* String: the coomand description
*/
MsgCommandDescription,
/**
* Server.
* Return call result of asked
* command call
* Args:
* String: call result
*/
MsgCallResult,
/**
* Server.
* Return description for asked
* stream
*/
MsgDescriptionStream,
/**
* Server.
* Return meta information
* for asked frame
* Args:
* String: frame comment
* Int: frame type
* Int: number of watcher for streaming
*/
MsgValMetaFrame,
/**
* Server.
* Acknowledge previous streaming
* config update
*/
MsgStreamingOK,
};
} // namespace RhIO
#endif
|
The Mid-Air FogScreen and User Experiences The immaterial FogScreenTM is an emerging display technology that enables high-quality projected 2D images in mid-air. It also appears dry and non-existant to touch, so reaching or walking through the image is possible. It is becoming widely used in many settings and can also be extended to become a stereoscopic or virtual reality mid-air screen. This chapter consists of two major sections. The first section describes the basic mid-air screen technology and its 3D and VR extensions. The second section describes our user experiences and lessons learned with them when using mid-air screen. DOI: 10.4018/978-1-60960-762-3.ch036 |
From the history of Kyiv philosophical periodicals in the early 20th century: the ideas of Western European philosophy on the pages of the Khristianskaya mysl journal (19161917) The article considers such a largely unknown page in the philosophical history of Kyiv in the early 20th century as philosophical periodicals. The researcher proposed a new approach to the analysis representing each journal not as a source for studying the work of one or another author, but as a separate, integral phenomenon, a certain type of philosophical discourse. Although there were no special philosophical periodicals in Kyiv at that time, she put forward the idea of the specifics of philosophical publications on the pages of particular journals Universitetskie izvestia, Trudy Kievskoi dukhovnoi akademii, Khristianskaya mysl. The author proved it using philosophical articles devoted to the ideas of Western European philosophy in the Khristianskaya mysl journal (19161917). Firstly, she characterized the features that distinguished the journal from other periodicals: 1) its authors were united not by belonging to a certain academic institution, but by the commonality of the Orthodox worldview; 2) it had a scientific and educational character, i.e. it was intended for both professional and amateur philosophers. Secondly, the author noted the characteristic features of the analysis of Western European philosophy in Khristianskaya mysl. She demonstrated that both the choice of topics and the perspective of the study were not determined by the purely academic interests of the authors of the articles, but by their understanding of the threat of certain ideas to both religious consciousness and the humanistic paradigm. In particular, she showed that such an approach was characteristic: 1) for criticizing certain types of science materialism (monastic philosophy of E. Haeckel, anti-metaphysical project of L. Boltzmann) as an attempt to replace religion and as a tool for opposing science and religion; 2) for criticizing the anti-humanism of secular philosophical anthropology, based on the postulates of classical rationalism, and substantiating Christian anthropology as its alternative. |
Virtual machines can be provided in a computer to enhance flexibility and performance. A virtual machine typically refers to some arrangement of components (software and/or hardware) for virtualizing or emulating an actual computer, where the virtual machine can include an operating system (referred to as a “guest” operating system) and software applications. Virtual machines can allow different operating systems to be deployed on the same computer, such that applications written for different operating systems can be executed in different virtual machines (that contain corresponding operating systems) in the same computer.
In a virtualized environment that includes virtual machines, a virtual machine monitor (VMM), also referred to as a hypervisor, manages the sharing (by virtual machines) of physical resources of an underlying physical machine. Virtualized environments have also been implemented in storage systems. In such a virtualized environment, virtual machines are provided with respective engines for accessing storage devices of the storage system. For example, a virtual machine can be provided with an engine that implements a RAID (redundant array of inexpensive disks) architecture.
Conventionally, in a system having multiple virtual machines with different guest operating systems, multiple different RAID engines may have to be provided for the different operating systems. However, this is inefficient since software development of RAID engines is made more complex due to dependencies on different operating systems. |
/* $NetBSD: tx39var.h,v 1.10 2002/01/29 18:53:19 uch Exp $ */
/*-
* Copyright (c) 1999-2002 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by <NAME>.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the NetBSD
* Foundation, Inc. and its contributors.
* 4. Neither the name of The NetBSD Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
enum tx_chipset {
__TX391X,
__TX392X,
};
/* attach priority of TX-internal modules. */
enum tx_attach_order {
ATTACH_FIRST = 3,
ATTACH_NORMAL = 2,
ATTACH_LAST = 1,
};
/* unified I/O manager */
enum txio_group {
MFIO = 0,
IO,
BETTY,
SNOWBALL,
PLUM,
NTXIO_GROUP
};
struct hpcio_chip;
struct tx_chipset_tag {
enum tx_chipset tc_chipset;
void *tc_intrt; /* interrupt tag */
void *tc_powert; /* power tag */
void *tc_clockt; /* clock/timer tag */
void *tc_soundt; /* sound tag */
struct hpcio_chip *tc_iochip[NTXIO_GROUP];
void *tc_videot; /* video chip tag */
};
typedef struct tx_chipset_tag* tx_chipset_tag_t __attribute__((__unused__));
typedef u_int32_t txreg_t;
extern struct tx_chipset_tag tx_chipset;
#define tx_conf_get_tag() (&tx_chipset)
#if defined TX391X && defined TX392X
#define IS_TX391X(t) ((t)->tc_chipset == __TX391X)
#define IS_TX392X(t) ((t)->tc_chipset == __TX392X)
#elif defined TX391X
#define IS_TX391X(t) (1)
#define IS_TX392X(t) (0)
#elif defined TX392X
#define IS_TX391X(t) (0)
#define IS_TX392X(t) (1)
#endif
void tx_conf_register_intr(tx_chipset_tag_t, void *);
void tx_conf_register_power(tx_chipset_tag_t, void *);
void tx_conf_register_clock(tx_chipset_tag_t, void *);
void tx_conf_register_sound(tx_chipset_tag_t, void *);
void tx_conf_register_ioman(tx_chipset_tag_t, struct hpcio_chip *);
void tx_conf_register_video(tx_chipset_tag_t, void *);
/*
* TX39 Internal Function Register access
*/
#define TX39_SYSADDR_CONFIG_REG_KSEG1 0xb0c00000
#define tx_conf_read(t, reg) ( \
(*((volatile txreg_t *)(TX39_SYSADDR_CONFIG_REG_KSEG1 + (reg)))))
#define tx_conf_write(t, reg, val) ( \
(*((volatile txreg_t *)(TX39_SYSADDR_CONFIG_REG_KSEG1 + (reg))) \
= (val)))
/*
* txsim attach arguments. (txsim ... TX System Internal Module)
*/
struct txsimbus_attach_args {
char *tba_busname;
};
/*
* txsim module attach arguments.
*/
struct txsim_attach_args {
tx_chipset_tag_t ta_tc; /* Chipset tag */
};
/*
* Interrupt staff
*/
#define MAKEINTR(s, b) ((s) * 32 + (ffs(b) - 1))
void* tx_intr_establish(tx_chipset_tag_t, int, int, int, int (*)(void *),
void *);
void tx_intr_disestablish(tx_chipset_tag_t, void *);
#ifdef USE_POLL
void* tx39_poll_establish(tx_chipset_tag_t, int, int, int (*)(void *),
void *);
void tx39_poll_disestablish(tx_chipset_tag_t, void *);
#define POLL_CONT 0
#define POLL_END 1
#endif /* USE_POLL */
u_int32_t tx_intr_status(tx_chipset_tag_t, int);
extern u_int32_t tx39intrvec;
/*
* Power management staff
*/
void tx39power_suspend_cpu(void);
/*
* Debug print configration.
*/
#define USE_HPC_DPRINTF
#define __DPRINTF_EXT
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.