content
stringlengths 7
2.61M
|
---|
The present invention relates to improvements of a semiconductor integrated circuit including a diode and a system LSI.
In recent years, development of system LSIs having higher functions has entailed coexistence of a plurality of digital circuit blocks and a plurality of analog circuit blocks in one chip. This configuration produces such a problem that noise from the digital circuit blocks propagates to the analog circuit blocks. To avoid this in the system LSI, the power supply of the digital circuit blocks and the power supply of the analog circuit blocks are separate from each other. However, for the purpose of protection against damage due to electro static discharge (ESD), a single unit of protection device formed by a pair of diodes D1. and D2 placed in opposite directions is inserted between the power supply of the digital circuit blocks and the power supply of the analog circuit blocks as shown in
FIG. 20. Insertion of these diode elements D1 and D2 can reduce the propagation of power supply noise and can ensure surge resistance to ESD.
A specific structure of such diode elements D1 and D2 provided for the purpose of reducing noise propagation is realized by MOS transistors as disclosed in, for example, Japanese Patent No. 2598147.
With respect to reduction in area, a desirable specific structure of the diode elements D1 and D2 is formed by gate-less diode elements instead of MOS transistors used in the conventional structure.
A proposed structure of such a diode element is, for example, one shown in FIG. 21. The diode element D shown in FIG. 21 includes, over a well 1, a diffusion layer 5 which constitutes the anode and diffusion layers 4 provided on the left and right sides of the diffusion layer 5 which constitute the cathode. These diffusion layers 4 and 5 are both formed in a pattern of rectangular strips. Around the diffusion layers 4 and 5 constituting the anode and cathode, a well contact 2 is provided to surround the diffusion layers 4 and 5 constituting the anode and cathode such that noise from the anode and cathode does not propagate to the outside. The diffusion layers 4 and 5 constituting the anode and cathode and the well contact 2 are provided with a large number of contact holes 3 formed thereover for connection with the outside.
When a surge voltage is applied to such a diode element D, a current is allowed to flow from the diffusion layer 5 constituting the anode to the diffusion layers 4 constituting the cathode as illustrated by solid lines in FIG. 22, whereby the diode element D is discharged and absorbs the surge voltage.
However, it was found that the above-described structure causes the following problem. Namely, since the diode element D shown in FIG. 21 is surrounded by the well contact 2, a current flows from the diffusion layer 5 constituting the anode to neighboring part of the well contact 2 as illustrated by broken lines in FIG. 22 in addition to the current flowing from the diffusion layer 5 constituting the anode to the diffusion layers 4 constituting the cathode. In this case, it is expected that the current converges at contact holes 3 of the anode diffusion layer 5 in the vicinity of the well contact 2 to cause breakage of the contact holes 3.
Such an undesirable result might be avoided by employing such a structure that, for example, the four corners of the diffusion layer 5 constituting the anode are truncated, and the contact holes 3 of the diffusion layer 5 are located distant from the four corners, such that electric field convergence at the corners is reduced. However, on the other hand, this structure would result in a smaller number of contact holes. Since the largeness of the current which flows through the diode element is limited by the number of contact holes, the diode element cannot produce a sufficient outcome with respect to its capacity as a protection device. This especially matters in microstructure processes performed with small contact hole diameters. |
Esmolol Infusion Reduces Blood Loss and Opiate Consumption during Fertility Preserving Myomectomy Objectives: The objective of this study is to evaluate the effect of esmolol-induced hypotensive anesthesia (EIHA) on intra-operative (IO) bleeding during open myomectomy. Patients and Methods: Eighty-eight women were randomly divided into the study group received EIHA without uterine tourniquet and control group who received normotensive anesthesia with uterine tourniquet. EIHA was provided as priming dose of esmolol (0.5 mg.kg-1) before the induction of anesthesia and esmolol infusion (0.05-0.3 mg.kg-1.min-1) to maintain mean arterial pressure at 6070 mmHg that was stopped on completion of myomectomy. Fentanyl was used as IO analgesia (loading dose: 1.0 g.kg-1 then infusion of 0.2-0.4 g.kg-1.h-1). All patients received 6% hydroxyethyl starch (HES; initially, 3 mL.kg-1 over 5-10 minutes and supplemental doses according to requirements) and Lactated Ringer's solution (LR; 5 mL.kg-1.h-1). Trigger for blood transfusion was hemoglobin concentration (HBC) <7 g.dL-1. Study outcomes included the extent of postoperative (PO) HBC deficit in relation to preoperative HBC, frequency of tourniquet application for the study patients, and total fentanyl consumption. Results: EIHA significantly reduced blood pressure measures since laryngoscopy and tracheal intubation till the end of surgery in the study group compared to control group. Eight study patients (18.9%) required tourniquet application for control of bleeding; however, amount of IO blood loss; total field visibility score and PO HBC deficit were non significantly lower in the study group. EIHA allowed significant reduction of the IO amount of LR and additional amounts of HES infusions. Study patients group consumed significantly lower IO fentanyl doses with significantly longer duration till the 1st PO request and the number of additional fentanyl, and lower numeric rating scale scores in study group compared to controls. Conclusion: Open myomectomy under EIHA is feasible and safe and allows fertility-sparing with minimal risk of blood transfusion. The applied procedure of EIHA allowed blunting of pressor reflexes secondary to LIT, surgical stresses and extubation, and allowed reduction of IO and PO opioid doses. |
Martial artists use board breaking as a method to demonstrate various attributes such as proper technique, power, targeting and speed among others. Board breaking is used in rank advancement testing, competitions, and even setting Guinness™ world records. Breaking boards requires one or more fellow students to hold the board (referred to as “holders”) for the student performing the technique (referred to as a “breaker”). While hand techniques are usually very accurate, foot techniques used in board breaking are usually not very accurate. High speed breaking techniques, particularly kicks, can cause noticeable injury to the target board holder's(s') hands and fingers due to poor targeting by the breaker. Once struck/injured, a holder is likely to “flinch” or move the board/target on subsequent attempts, increasing the difficulty of successfully breaking the board/target.
Prior art attempts at providing some hand protection have been generally unsuccessful, for example, benefitted only the holder, or compromising between benefitting the breaker and benefitting the holder to the point that neither attempt at protection has worked. A prior art attempt at providing hand protection is illustrated by the sheath (12) in U.S. Pat. No. 4,807,302 by Cannella. A prior art product very similar to the disclosure of Cannella, and marked in the past with the Cannella patent number, has been and is commercially available, but it does not include the spikes 14 shown in the Cannella drawings. Other prior art attempts at hand protection include the holders' wearing of padded gloves.
Increased Chance of Injury:
The inventors believe, in order to avoid or minimize the chance of injury, a holder should hold a board/target with the hand and fingers generally in the position shown by the bare-hand portrayal in FIG. 1A. This places the metacarpophalangeal joints (“knuckles” K) directly adjacent to (directly above in the drawing) the edge of the board B and at or very close to the central plane CP of the board. Further, the inventors prefer that the hand and forearm lie in positions wherein the heel H of the palm is slightly distanced from the board (see P1) and closer to the outer perimeter edge E of the board, rather than being closer to the central region CB of the board, which is understood to be below FIG. 1A. Note the curved dashed line in FIG. 1A that indicates that many martial arts boards have a non-planar rear surface, due to the outer perimeter edges being the thickest portion of the board and the central region being of lesser thickness and/or having break joints. The front surface of martial arts boards are typically planar, represented by the front plane FP in FIG. 1A.
These preferred hand and forearm positions may be described as the hand/wrist being rotated into the position in FIG. 1A from the position of FIG. 1B, which for these figures is a counterclockwise rotation. Note that, in FIG. 1B, the knuckles K are behind the central plane and the rear surface of the board, and the heel H of the palm is pressed against the board and closer to the center region CB of the board.
The preferred position results in an angle between the main portion of the hand (and/or the palm) and the forearm is a large obtuse angle O1 and small supplementary angle A1. The inventors prefer an angle O1 of greater than or equal to 135 degrees and a corresponding supplementary angle A1 of equal to or less than 45 degrees. Possible ranges for the obtuse angle O1 may be, for example, 135-160 degrees, or especially about 135-155 degrees. Possible ranges for the acute angle A1 may be, for example, 45-20 degrees, or especially 45-25 degrees.
The Cannella sheath CAN-S and said prior art commercial product COMM, on the other hand, are adapted to hold the fingers, hand, and wrist in positions substantially similar to those portrayed by the bare-hand holding the board in FIG. 1B. When the Cannella CAN-S and commercial product COMM are used, as shown in FIGS. 2A and 3A, respectively, the fingers, hand, and wrist positions stay similar to those in FIG. 1B. FIGS. 2A and 3A show that the fingers inside the Cannella/commercial-product, up to about the proximal inter-phalangeal joint (that is, the distal phalanx and the middle phalanx), lie parallel to and close to the front plane FP and the central plane CP of the board/target.
When inside the Canella sheath CAN-S, as shown by FIG. 2A, the fingers' distal phalanx and the middle phalanx are parallel to the board, distanced evenly all along their lengths from the front surface of the board by spikes (“14” in Cannella) and by the thickness of the underside (“18” in Cannella) of the sheath. Note, too, in FIG. 2A, that the metacarpophalangeal joints (knuckles K) lie rearward of the central plane CP of the board. The palm lies tight against the rear surface of the board (see P2) and the wrist W is closer to the center of the board than in FIG. 1A. The angle O2 of the forearm to the palm is smaller than angle O1, for example, less than 135 degrees, and more typically in the range of about 110-134 degrees. The corresponding supplementary angle A2 in the Canella sheath, therefore, is greater than 45 degrees, and more typically in the range of about 70-46 degrees. Note that the board outer perimeter edge E region, which is typically the thickest region of a martial arts target board, is shown with front and rear surfaces parallel to each other, but the board may have a reduced thickness and/or curved rear surface nearer to the center of the board as shown by the curved line C.
The commercial product is likewise adapted so that the fingers, up to about the proximal inter-phalangeal joint (especially the distal phalanx and the middle phalanx), lie parallel to the front plane and the central plane of the board/target. In the commercial product COMM, as shown by FIG. 3A, the fingers' distal phalanx and middle phalanx are parallel to the board, distanced evenly from the front surface of the board, only by the thickness of the underside of the sheath. Note in FIG. 3A that the metacarpophalangeal joints (knuckles K) lie rearward of the central plane CP of the board. The palm lies tight against the rear surface of the board (see P3) and the angle of the forearm to the palm O3 and the supplementary angle A3 are the same or nearly the same as O2 and A2 of the sheath of the Cannella patent, described above.
In summary, the surface that the user's fingers rest on, inside these prior devices, is parallel to the board, requiring the holder's fingers distal and middle phalanx to lie flat/parallel relative to the board's front and central planes, and forcing the heel of the holder's palm toward the board and further in toward the center of the target. These features of the prior art devices increases the likelihood of “jamming” the holder's wrist(s) as a result of a kick/strike.
Further, the Cannella sheath is described as “made of a tough, substantially nondeformable, abrasion and cutting resistant material, such as plastic or metal”. The prior art commercial product related to Cannella is advertised as being made of Lexan™ polycarbonate, which the inventors note is hard, rigid, completely-inflexible, and tends to become brittle over time making it more susceptible to breaking/shattering when struck. Also, as shown to best advantage in FIGS. 2B and 3B, both the Canella sheath and the commercial product comprise a flange FL (reference 28 in Cannella) that protrudes rearward from the sheath. This flange FL rests against the outer perimeter edge surface of the board to control and limit the position of the sheath on the board. This flange FL is believed by the inventors not only to limit the user's options for hand placement when holding the board, but also to increase the likelihood of breaker injury due to the introduction of rigid surfaces/edges into the target area.
Inadequate Gripping Surface:
Padded gloves commonly available in martial arts circles may protect the holder's fingers to some extent, and may provide a cushioned surface should the breaker hit the glove. However, even conventionally-padded, prior art martial arts gloves decrease the holder's grip, resulting in the target acting “slippery” and being difficult to hang on to. Gloves with increased padding would only interfere further with the holder's grip on the board. The result of padded gloves, therefore, is typically a reduced grip on the target, increasing the likelihood of dropping or prematurely releasing the board/target during the attempt and resulting in a missed attempt on the break.
Therefore, there is still a need for an improved device for finger protection in martial arts, and embodiments of the invention meet this need. Certain embodiments of the invention provide correct ergonomic positioning that is very different from the positioning encouraged by prior art sheaths. Also, certain embodiments of the invention provide the holder with multiple options for hand and protector placement on the board, while also providing a sure grip. Also, certain embodiments comprise firm, but non-injuring and slightly-compressible, elements and surfaces that provide a surprisingly effective balance of protecting/shielding the holder's hand/fingers and protecting the striker's foot and toes in the case of striking with the foot, or hands and fingers in the case of striking with the hand. |
<filename>month01/核心/exercise.py
# 作业
# 1. 三合一
# 2. 复习day01 ~ day07 所有 exercise-important
# 3. # 员工字典(员工编号 部门编号 姓名 工资)
dict_employees = {
1001: {"did": 9002, "name": "师父", "money": 60000},
1002: {"did": 9001, "name": "孙悟空", "money": 50000},
1003: {"did": 9002, "name": "猪八戒", "money": 20000},
1004: {"did": 9001, "name": "沙僧", "money": 30000},
1005: {"did": 9001, "name": "小白龙", "money": 15000},
}
# 部门列表(部门编号,部门名称)
list_departments = [
{"did": 9001, "title": "教学部"},
{"did": 9002, "title": "销售部"},
{"did": 9003, "title": "品保部"},
]
# 1. 打印所有员工信息,
# 格式:xx的员工编号是xx,部门编号是xx,月薪xx元.
def print_single_info(cid, info):
print(f"{info['name']}的员工编号是{cid},部门编号是{info['did']},月薪{info['money']}元.")
for cid, info in dict_employees.items():
print_single_info(cid, info)
# 2. 打印所有月薪大于2w的员工信息,
for cid, info in dict_employees.items():
if info['money'] > 20000:
print_single_info(cid, info)
# 格式:xx的员工编号是xx,部门编号是xx,月薪xx元.
# 3. 在部门列表中查找编号最小的部门
# min_did = dict_employees[0]["did"]
# for cid,info in dict_employees.items():
min_did = list_departments[0]["did"]
for department in list_departments: # 算法错误,第一个不应该再去比较,应该变成i in range(len()) 然后i+1来实现
if department["did"] < min_did:
min_did = department["did"]
print(min_did)
# 4. 根据部门编号对部门列表降序排列
for r in range(len(list_departments) - 1):
for c in range(r + 1, len(list_departments)):
if list_departments[r]["did"] < list_departments[c]["did"]:
list_departments[r], list_departments[c] = list_departments[c], list_departments[r]
print(list_departments)
|
package rtrawel.village;
import java.util.ArrayList;
import java.util.List;
import rtrawel.battle.Party;
import rtrawel.items.Item;
import rtrawel.unit.RCore;
import trawel.extra;
public class Shop implements Content{
public List<String> items = new ArrayList<String>();
private String name;
public Shop(String s) {
name = s;
}
@Override
public boolean go() {
while (true) {
extra.println("1 back");
extra.println("2 buy");
extra.println("3 sell");
int in = extra.inInt(3);
switch (in){
case 1: return false;
case 2: buyStuff();break;
case 3: sellStuff();break;
}
}
}
private void sellStuff() {
while (true) {
extra.println(Party.party.gold + " gold");
extra.println("1 back");
Party.party.refreshItemKeys();
for (int i = 1;i < Party.party.itemKeys.size()+1;i++) {
Item it = RCore.getItemByName(Party.party.itemKeys.get(i-1));
extra.println(it.display());
extra.println((i+1) + " cost: "+ it.cost() + " count: " + Party.party.items.get(Party.party.itemKeys.get(i-1)));
}
int in = extra.inInt(Party.party.itemKeys.size()+1);
if (in == 1) {
return;
}
Item it = RCore.getItemByName(Party.party.itemKeys.get(in-2));
int canSell = Party.party.items.get(Party.party.itemKeys.get(in-2));
extra.println("Sell how many?");
in = extra.inInt(canSell);
Party.party.gold+=it.cost()*in/2;
for (int i = 0;i< in;i++) {
Party.party.popItem(it);
}
}
}
private void buyStuff() {
while (true) {
extra.println(Party.party.gold + " gold");
extra.println("1 back");
for (int i = 1;i < items.size()+1;i++) {
Item it = RCore.getItemByName(items.get(i-1));
extra.println(it.display());
extra.println((i+1) + " cost: "+ it.cost());
}
int in = extra.inInt(items.size()+1);
if (in == 1) {
return;
}
Item it = RCore.getItemByName(items.get(in-2));
if (it.cost() > Party.party.gold) {
extra.println("You're to poor!");
continue;
}
int canBuy = Party.party.gold/it.cost();
extra.println("Buy how many? (" + canBuy+" max)");
in = extra.inInt(canBuy);
Party.party.gold-=it.cost()*in;
Party.party.addItem(it.getName(),in);
}
}
@Override
public String name() {
return name;
}
}
|
/**
*
* @param a_obj object to serialize, then deserialize
* @return deserialized object that has previously been serialized
* @throws Exception
*
* @author Klaus Meffert
* @since 2.6
*/
public Object doSerialize(Object a_obj)
throws Exception {
File f = File.createTempFile("object", "ser");
OutputStream os = new FileOutputStream(f);
ObjectOutputStream oos = new ObjectOutputStream(os);
oos.writeObject(a_obj);
oos.flush();
oos.close();
InputStream oi = new FileInputStream(f);
ObjectInputStream ois = new ObjectInputStream(oi);
Object result = ois.readObject();
ois.close();
return result;
} |
package com.taskadapter.redmineapi;
import com.taskadapter.redmineapi.bean.CustomFieldDefinition;
import com.taskadapter.redmineapi.internal.RedmineJSONParser;
import com.taskadapter.redmineapi.internal.json.JsonInput;
import java.io.IOException;
import org.junit.BeforeClass;
import org.junit.Test;
import java.util.List;
import org.json.JSONException;
import static org.fest.assertions.Assertions.assertThat;
/**
* The tests expect some manual (one-time) setup in the Redmine server because
* there is no remote API to create custom fields definitions (as of January 2015).
* <p>
* Exactly 3 custom fields must be configured:
* - id: 1, customized_type: issue, name: my_custom_1, type: string
* - id: 2, customized_type: issue, name: custom_boolean_1, type: bool
* - id: 3, customized_type: issue, name: custom_multi_list, type: list,
* multiple: true, possible_values: V1, V2, V3, default: V2
*/
public class CustomFieldDefinitionsTest {
private static final String CUSTOM_FIELDS_FILE = "custom_fields_redmine_2.3.json";
private static RedmineManager mgr;
private static CustomFieldManager customFieldManager;
@BeforeClass
public static void oneTimeSetup() {
mgr = IntegrationTestHelper.createRedmineManager();
customFieldManager = mgr.getCustomFieldManager();
}
@Test
public void testGetCustomFields() throws RedmineException {
List<CustomFieldDefinition> definitions = customFieldManager.getCustomFieldDefinitions();
assertThat(definitions.size()).isEqualTo(3);
for(CustomFieldDefinition fieldDefinition: definitions) {
if(fieldDefinition.getId() == 1) {
assertThat(fieldDefinition.getCustomizedType()).isEqualTo("issue");
assertThat(fieldDefinition.getName()).isEqualTo("my_custom_1");
assertThat(fieldDefinition.getFieldFormat()).isEqualTo("string");
} else if (fieldDefinition.getId() == 2) {
assertThat(fieldDefinition.getCustomizedType()).isEqualTo("issue");
assertThat(fieldDefinition.getName()).isEqualTo("custom_boolean_1");
assertThat(fieldDefinition.getFieldFormat()).isEqualTo("bool");
} else if (fieldDefinition.getId() == 3) {
assertThat(fieldDefinition.getCustomizedType()).isEqualTo("issue");
assertThat(fieldDefinition.getName()).isEqualTo("custom_multi_list");
assertThat(fieldDefinition.getFieldFormat()).isEqualTo("list");
assertThat(fieldDefinition.getDefaultValue()).isEqualTo("V2");
assertThat(fieldDefinition.getPossibleValues()).containsExactly("V1", "V2", "V3");
assertThat(fieldDefinition.isMultiple()).isTrue();
}
}
}
@Test
public void savedJSonResponseFromRedmine23CanBeParsed() throws IOException, JSONException {
String str = MyIOUtils.getResourceAsString(CUSTOM_FIELDS_FILE);
List<CustomFieldDefinition> definitions = JsonInput.getListOrEmpty(
RedmineJSONParser.getResponse(str), "custom_fields",
RedmineJSONParser.CUSTOM_FIELD_DEFINITION_PARSER);
CustomFieldDefinition field0 = definitions.get(0);
assertThat(field0.getId()).isEqualTo(1);
assertThat(field0.getName()).isEqualTo("my_custom_1");
assertThat(field0.getCustomizedType()).isEqualTo("issue");
assertThat(field0.getFieldFormat()).isEqualTo("string");
assertThat(field0.getRegexp()).isEqualTo("some.*");
assertThat(field0.getMinLength()).isEqualTo((Integer) 5);
assertThat(field0.getMaxLength()).isEqualTo((Integer) 80);
assertThat(field0.isFilter()).isEqualTo(true);
assertThat(field0.isSearchable()).isEqualTo(true);
assertThat(field0.isMultiple()).isEqualTo(false);
assertThat(field0.isVisible()).isEqualTo(true);
assertThat(field0.isRequired()).isEqualTo(false);
assertThat(field0.getDefaultValue()).isEqualTo("");
assertThat(field0.getPossibleValues().size()).isEqualTo(0);
assertThat(field0.getTrackers().get(0).getId()).isEqualTo((Integer) 1);
assertThat(field0.getTrackers().get(1).getId()).isEqualTo((Integer) 2);
assertThat(field0.getTrackers().get(2).getId()).isEqualTo((Integer) 3);
assertThat(field0.getRoles().size()).isEqualTo(0);
CustomFieldDefinition field1 = definitions.get(1);
assertThat(field1.getId()).isEqualTo((Integer) 2);
assertThat(field1.getName()).isEqualTo("custom_boolean_1");
assertThat(field1.getCustomizedType()).isEqualTo("issue");
assertThat(field1.getFieldFormat()).isEqualTo("bool");
assertThat(field1.getRegexp()).isEqualTo("");
assertThat(field1.getMinLength()).isEqualTo(null);
assertThat(field1.getMaxLength()).isEqualTo(null);
assertThat(field1.isFilter()).isEqualTo(false);
assertThat(field1.isSearchable()).isEqualTo(false);
assertThat(field1.isMultiple()).isEqualTo(false);
assertThat(field1.isVisible()).isEqualTo(true);
assertThat(field1.isRequired()).isEqualTo(false);
assertThat(field1.getDefaultValue()).isEqualTo("");
assertThat(field1.getPossibleValues().get(0)).isEqualTo("1");
assertThat(field1.getPossibleValues().get(1)).isEqualTo("0");
assertThat(field1.getTrackers().size()).isEqualTo(3);
assertThat(field1.getRoles().size()).isEqualTo(0);
CustomFieldDefinition field2 = definitions.get(2);
assertThat(field2.getId()).isEqualTo((Integer) 3);
assertThat(field2.getName()).isEqualTo("Test");
assertThat(field2.getCustomizedType()).isEqualTo("issue");
assertThat(field2.getFieldFormat()).isEqualTo("bool");
assertThat(field2.getRegexp()).isEqualTo("");
assertThat(field2.getMinLength()).isEqualTo(null);
assertThat(field2.getMaxLength()).isEqualTo(null);
assertThat(field2.isFilter()).isEqualTo(false);
assertThat(field2.isSearchable()).isEqualTo(false);
assertThat(field2.isMultiple()).isEqualTo(false);
assertThat(field2.isVisible()).isEqualTo(false);
assertThat(field2.isRequired()).isEqualTo(true);
assertThat(field2.getDefaultValue()).isEqualTo("1");
assertThat(field2.getPossibleValues().get(0)).isEqualTo("1");
assertThat(field2.getPossibleValues().get(1)).isEqualTo("0");
assertThat(field2.getTrackers().size()).isEqualTo(0);
assertThat(field2.getRoles().get(0).getId()).isEqualTo((Integer) 4);
}
}
|
They did it. They really did it. As we unexpectedly discovered last month, Firaxis are remaking/reimagining the original X-COM, the 1993 title that is quite rightly often hailed as the greatest game ever made. Recently, I had a long, fascinating and genuinely reassuring chat with XCOM: Enemy Unknown‘s lead designer and evident fellow X-COM gonk Jake Solomon – in this first of three parts, he talks how, why, when, the response to the controversial XCOM shooter, Cyberdiscs, whether it’s being simplified for console, 2K’s infamous ‘strategy games aren’t contemporary’ comment and missing hyphens.
RPS: Hi there, I’m Alec Meer from Rock Paper Shotgun, how’re you doing?
Jake Solomon: Alec! I was hoping it would be you.
RPS: Really?
Jake Solomon: Yes Alec, I’m a long-term reader so I know who you are. I have the advantage here. I love your stuff and I know that I’m talking to a real fan here so this’ll be an easy conversation (laughter)
RPS: Is that for better or worse I wonder…for better and worse. It makes me nervous when people say they’ve read the site because I think oh no, I’ve said that thing, and they probably thought….oh no….
Jake Solomon: (laughs) That’s ok, we make sure we send all your articles around here so we’ve all read your stuff.
RPS: That’s… good and bad. Well I am very optimistic about the game, I actually heard a rumour about it two years ago and was getting worried it had been cancelled, so I was very excited when I heard the announcement.
Jake Solomon: Yeah, we got to do that little surprise. It’s funny because a lot of people, I don’t know really how, had heard the rumours. I guess I never even knew there were rumours out there.
RPS: There’s a rumour about everything
Jake Solomon: That’s true! There is a rumour about everything, you know, whether it’s true or not, there’s a rumour about everything.
RPS: I’ve got a mixture of my own questions and also I did a kind of Twitter poll because there’s people on there who are even more ferociously nerdy about this than me so I thought it would be best to take their prompts on it.
Jake Solomon: That is perfectly fine, I feel like I can go toe to toe in the ferociously nerdy category (laughter) I’m happy to field whatever questions you’ve got.
RPS: Cool, well let’s test you on that then. The most important question of all, I think you’ll agree, is why isn’t there a hyphen in the title anymore?
Jake Solomon: (laughs) We have an implied hyphen, you’ve seen our logo, right? You can kind of see it striking through the COM part.
RPS: Good stuff, I didn’t know if it was ‘No, we want to declare we are our own game’ even though it’s tied to the lineage.
Jake Solomon: No no, it’s funny because without the hyphen, I remember when my wife saw that she was saying it looked like ‘TROM’, she thought it was the name of an actual alien, like it was the alien overlord. I was like ‘Ok, we’ve got to fix a hyphen in there somehow.’
RPS: (laughs) How long have you been doing it for?
Jake Solomon: This project, we’ve been doing it for three and a half years at this point. I mean, some guys, some of the early art staff have been on it for four years at this point, so we’ve been in development for a really long time.
RPS: How does that compare to the Firaxis standard for stuff like this, do you normally take that long?
Jake Solomon: No, this one was a little bit longer because we knew that we were sort of starting a whole new process, right, a lot of times with Firaxis we have Sid in house, we have that sort of institutional knowledge of a lot of the games that we make – so let’s say we’re making a Civ, so many of the guys on the Civ teams have already made another Civ so it’s a lot easier to get into it. Even when we made Pirates! of course, that was something that Sid was leading up and of course Sid was in-house so that stuff’s a lot easier. So we knew that when we were making this game – first of all everybody who knows XCOM knows that the game is going to actually require you to be criminally insane to undertake the project as a developer because of all the wonderful but very difficult elements from a development standpoint. Y’know, you’ve got all the destructible terrain, and the 3D fog of war, and you’ve got the two games, it’s not just the combat game, it’s the two games and how they come on together, and so 2K was very accommodating because we said ‘Look, we’re going to need to take some time with this, this is something completely new for us, we’re not re-making one of our old earlier titles.’
To sidetrack for a second, the way we started, the art team rolled on to it first, and they were working on tone and imagery and I would give them some pointers about how the game would actually function, and we wanted to say, ok, if we take exactly what the original game is and then we want to see what we can do with that artistically. The first prototype I wrote was basically a recreation of the original game, so we started with everything: time units, which I know you’re going to ask me about [laughs], time units, ammo, everything, a recreation of the original game. So what we wanted to do was start from that point and say ‘ok, we don’t take anything out unless we can improve it.’ That was a good three and a half/almost four years ago at this point.
RPS: You know you could probably just release that prototype today and you’d make a fortune overnight.
Jake Solomon: (laughs) I don’t know, I suppose it would have interest, maybe that’s something we should put in the collector’s edition or something.
RPS: Yeah, or a least a ‘making of’ thing that showed off what it looked like and what was going on there.
Jake Solomon: Yeah, that’s something that we really really want to do. The fun thing about a development process that’s this long, the idea was when we started developing was that since we were starting from the original game we had that core there, we wanted to work fearlessly where everything had to hold its own weight, so when we made decisions we weren’t afraid, we weren’t making our decisions based on, y’know, ‘is this going to make the game harder to play or simpler to play?. And I know people aren’t going to believe me when I say that but it really is true, we’ve never lost sleep over ‘how can we simplify the game?’, it was really more a question of ‘Ok, here we have this game, what’s the more fun mechanic?’, and I’m telling you, with this game, I cannot wait some day to have a discussion, maybe we can do that with you guys after we ship.
RPS: Oh, we’d love to.
Jake Solomon: I can show you all these old screen shots, and all these old prototypes, and I’m telling you, we have taken this game left, right, up, down, whatever: we’ve done all kinds of crazy things with it. I guess that’s why we’re happy and comfortable where we are because we’ve honestly tried almost everything from a design standpoint.
RPS: Did you have a fixed point in your mind between being a recreation of the original and being something new that you could say is definitely ‘my’ game rather than someone else’s with bells on?
Jake Solomon: Right, exactly, and so that’s why it was important to start with the original as a base. Narratively we occupy the same starting point, we have a lot of the same aliens, and we use the original game as the inspiration for a lot of the things we do, and it’s never out of our minds, I don’t want to say that we design and we just say ‘oh, who cares what was in the original’. We view it more from a design perspective and say look, and the original is still absolutely my favourite game, and the favourite game of a lot of guys on this team, so we view the original not as holy and sacred and we can’t change it because that’s how Julian did it, it’s more that those things worked, they were mechanically fantastic, and they worked very very well, so as a designer, we keep that in mind when we are thinking about making changes, we say ‘look, we have thousands of hours of experience with this other design system and it works very well’, so, we took any changes we made very seriously. But because of that, because we made our changes based on play and prototypes, the only things that stuck were the things that when across the board it was like ‘this is an improvement to the game’.
RPS: Do you feel like people are, when they get this, going to feel that they’ve got it instead of X-COM, or do you think it’s going to be more of a companion almost?
Jake Solomon: Yeah, I think it’s very personal…if you got ten of us in a room, say it’s you, me and eight other guys just like us, right, and you said ‘ok, I want your number one feature that cannot be changed or it’s not XCOM’, somehow we would walk out of that room with twenty five features, because when you ask people, what is XCOM, they’ll say ‘it’s this’, or ‘it’s that’, and a lot of times you’ll find yourself agreeing and you’re like ‘Yes, that is core to the experience’, and so I have to interpret that and my team has to interpret that for ourselves and say ‘It’s these elements which we think make the core experience of XCOM’, but obviously things are going to change. I think it is more of a companion, it’s certainly not something that you’d play and say ‘this is completely different’. I guess it would be another game in the series, that narratively occupies the same space. They did all kinds of interesting things with, maybe not Terror From The Deep, except made it brutally harder and made the cruise ships four times longer than any human could realistically make, but they did awesome stuff with Apocalypse and that’s the funny thing, I don’t even think we’re as far away as Apocalypse is. I think we’re just taking the original, and it’s variations on a theme.
RPS: Was there anything that particularly came from that, or from Terror of the Deep, or did you pretty much put them aside for this one and concentrate on getting the spirit of the original right?
Jake Solomon: It was more the spirit of the original, I mean that’s where my heart is and that’s where we have our memories of the original. I think the reason for that is that the original resonates so much is because the setting is Earth and it’s a setting that you can recognise. I mean, Terror From the Deep was awesome but the setting was underwater and you had these cruise ship missions, and Apoc was the futuristic city… those were things that were very interesting concepts but they’re harder to relate to, but Enemy Unknown was very spooky and very affecting because you recognized the setting, you could translate what you saw into looking out your window. So I think that that’s why the original has such a strong draw on me and I think on other people as well. So when we made our XCOM we definitely started with that and took almost all of our inspiration from the original.
RPS: Yeah, it’s really got that moral imperative of the greater good, because you’ve got civilians around, and you become quite fascinatingly cavalier about their lives because you’ve got this greater goal in your head.
Jake Solomon: Exactly, and the phrase that we use is the feeling of XCOM is almost like a shark in your living room, it’s something completely out of context but in a place that you take for granted and feel comfortable in, but then you’ve got this horrifying thing sitting right in the middle of it and it’s completely jarring. That’s what was so fun, you’d be on these missions, you’d be looking around these suburban neighbourhoods, and then you’d see horrible things: Chrysalids, or Snakemen, or Sectoids just peeking out of the fog there. That was one of the neatest things that XCOM did, it just sort of takes that feeling of something you recognize and it twists it, and again, I think that’s why I think the original did so well.
RPS: It’s a really iconic image, the classic grey alien sitting in the middle of a cornfield, and you think ‘wait, something’s wrong here’…
Jake Solomon: Right, the orchard, or the cabbage, or the wheat field… You get that when they’re half in, half out of the fog, and their eyes are just glinting…and you know you’re moving your guy and he stops, and you see the little red box and you just see the glints in the Sectoids’ eyes out in the darkness, that’s the classic X-COM moment.
RPS: Yeah, waving the cursor around thinking it’s going to turn red in a moment, and you think ‘Yeah, there he is, I can get him’. So have you been able to play up that juxtaposition in yours even more between the recognisable Earthly scenes and the aliens, have you been able to flesh that side out at all?
Jake Solomon: Yes, and that’s artistically a lot of what we wanted to do, we wanted to create scenes that the player would recognize so they would have some sort of emotional resonance with the things that they see, and then you get the very bizarre, in the middle of a convenience store or something, you’ve got that great XCOM moment of like this giant Muton in there, or Sectoids, so that’s something visually we worked very hard to do, to create scenes that the player could recognise.
RPS:In the initial screenshots that came out, I was worried that you were making the aliens quite humanoid, but stuff I’ve found out since, it seems more like you’re going for the ‘this is an alien and so it’s going to look weird’ in the middle of that domestic context.
Jake Solomon: Right, it was funny because the first screenshot that came out it was a surprise because it was the Thin Man out in the woods, which is probably a very unique situation. So then I was happy when the other screenshots came out and you could see the Cyberdisc and the Mutons and the Sectoids, and of course for the majority of our first screenshots we chose the gas station because I was like ‘We have to have a Cyberdisc near the gas station’, we must because the fans of the original will recognize that as a tip of the hat.
RPS: Yeah, and you know the explosion that happens if you shoot it in just the right place.
Jake Solomon: That’s right. The chain of the Cyberdisc exploding next to the gas pump and all your guys are idiots for taking cover there.
RPS: (laughs) Something I wanted to ask about before I forget, there’s that infamous comment that 2K’s Christoph Hartmann made the other month about how strategy games are dead, and then this comes out… Was he just trolling, or was it just confusion?
Jake Solomon: I’m positive it was simply just an out of context thing because obviously I work with him a lot, and I would say that he has proven with what matters, which is, you know, money where your mouth is. He runs one of the largest studios in the world and I know that he has always been deeply supportive. and I said earlier, and this is my experience, we said at the very beginning when we wanted to do this game, the problem with a strategy XCOM, if you’re going to recreate the original, and the reason why it’s never happened before, and we’ve always seen those articles about why has nobody done this before, and I used to think that myself until it was like, ‘Ok, let’s get serious, what will it take to do this.’, and I think development-wise it’s insane. The amount of things that you have to do technically and design-wise, the amount of design systems is overwhelming and it’s not just one game, it’s two games, and so it’s a crazy, crazy game, and it’s wonderful, but it requires a huge investment of design time and technical time.
So when we went to 2K and said we really want to do this they didn’t say ‘well, what game is it like?’ or ‘well, that’s not like the other games that you’ve done’; they were intrigued by the idea of the fact that X-COM is unlike any other game and so they were very very supportive of us, our development time has been long, they’ve always given me anything that I’ve needed, the time I needed, the people I needed, so yeah, I think it was simply a miscommunication, out of context thing as I know him personally. People are going to think I’m blowing smoke here, but I’m not, they’re absolutely the forgotten side of the equation here, because a lot of times if you hear about a publisher it’s not a positive thing, but I’m telling you, with us, we absolutely love 2K because they’re so creatively brave. Ken makes the Bioshocks and things like that and that was a very big departure…
RPS: I’m speaking to him tomorrow actually. [Which we already posted here].
Jake Solomon: Say hi from me! I know that [Hartmann] appreciates that, and we make Civ and you know, Civ is a bit of an oddball, it’s nice that it sells of course but I think that the fact that they make these games, a lot of times I work with them from a creative standpoint, it’s never a question of like ‘Well, what’s the numbers, what’s this and that’. I’ve had a lot of other publishers over the years but with 2K, the conversation is almost always creative, like ‘How are you going to make this work, how is this unique to players, and how are we going to do this and that’. I guess what I’d say is I have absolutely loved working with them, so I felt bad when I saw that because that’s not representative of how they are with us as developers.
RPS: So how’s it been during the long time you’ve been doing this watching the response to the shooter which, to put it generously, was mixed? Has that coloured what you were doing at all, or scared you? Excited you?
Jake Solomon: The thing is, we were always making this game, to us we didn’t really give that a lot of thought, we always knew about the 2K Marin team, we’ve worked with those guys from the very beginning, we’ve worked back and forth and so Jordan [Thomas] and I talk regularly and we work together quite a bit and we’re both very excited about the other things that Marin are doing and how we’re connecting, which we’re not talking about yet. We’ve had great conversations, and it’s been fun because we’re doing this game and they’re doing a completely different take on things and the ideas that a fan of XCOM… and I say this as a fan myself, we’ve been wandering in the desert for quite a while. Since the original you’re looking at eighteen years now, since Apocalypse it’s probably fifteen years now or so, an incredible franchise but it just went dark for so long and so our take on it was won’t this be exciting? We’ll have everything: we’ll have the strategy version to hopefully make people happy, we’ll have the shooter which tells a story in a new way and tells a story about a different time.
So yeah, it was difficult, but it was more difficult just because I know those guys, I like those guys, and things look so differently from the other perspective. I understand that people are passionate about it, I completely do, the only thing that was difficult was that I know those guys and I know how strongly they feel and how good they are at their jobs and how strongly they feel about their title so any negative stuff I saw I felt bad for them – but I knew eventually what they’d show. I thought it did, it definitely started winning people over because what they’re doing I think is pretty cool.
RPS: So: as soon as it’s mentioned that it’s on console our threads fill with people going ‘oh god, oh no, the controls aren’t going to work and it’s going to be dumbed down, yada yada’. Do we need to worry on that front, is there going to be a bespoke PC version with different controls?
Jake Solomon: You know I’m going to say you shouldn’t worry.. But no, not at all. The way I’d say it is that input-wise, from a purely input standpoint, XCOM is not a complicated game at all, in fact it’s a very, very straightforward game from an input perspective, so whether you’re playing on a PC with mouse keyboard or whether you’re playing a gamepad, there really aren’t that many things for you to do anyway, I mean this is not at all like something like Civ, this is a much more straightforward interaction with player and experience. So we’re perfectly comfortable with putting the game to gamepad, putting the game to mouse and keyboard because we’ve do Civ in-house, which is an extremely complicated input system and so for us, XCOM is so straightforward in the inputs the player makes and how the player interacts with the game.
Being on consoles it works fantastically, being on mouse keyboard it works fantastically, there’s not even any particular tension there, I mean the tension there and what needs to be different of course is the way that the player interacts with the scene because with the mouse obviously it’s a input selection-driven input, so the player wants to click on things, he wants to click on enemies, as opposed to something like a gamepad where you want to cycle enemies, right? That’s mainly the big difference, the strategy layer is extremely straightforward, there is a lot of UI involved with it, but that’s very easy to either make those two things either work for both but we have plenty of cases where we just do whole different screens, but certainly tactical is the place where it’s the most different because of the nature of cycling into points of interest as opposed to just straight up clicking on points of interest.
So we’re totally committed to making a separate experience for PC, and in fact there are things we can do on PC obviously that we couldn’t do on something like a console, so whether you’re talking zoom level and the different ways you can view the battlefield tactically, that’s certainly much easier with PC, above and beyond the stuff that you always get on PC like better res and things like that. But really what we’re looking to do is having a more tactical view in terms of zoom level and things like that, and how the information is displayed – those are all things that we can do on PC that have to be changed for gamepad.
RPS: Yeah, that’s the main thing that occurs to me, looking at something like Skyrim when the interface just comes over wholesale from console and it’s all big giant text and missing information and categorisation.
Jake Solomon: Right, and it’s harder and we can’t do that, which is a good thing, I mean you cannot do that with a tactical game or a strategy game, you simply can’t because the interface is not the same thing, you’re not free, your inputs are not like, let’s say a real time or an action based game, where your input is continuous and you can steer the camera around. That’s not how it is in a tactics game, a strategy game, you actually have points of interest that you’re either clicking on or cycling through. Those two things are not the same and so you can’t just bring something over wholesale, which of course we’ve always known and which is actually kind of a good thing because it forces you to make a new interface.
There are two more parts of this mega-interview, to be posted over the next two days. Still to come: time units or lack thereof, Chrysalids, min-maxing, whether the response to the shooter affected decisions on this game, indivdualising your soldiers, losing men, exploring the base, psychic control, the fate of Silacoids, the Gollops, modding and much more. Stay tuned, X-men. |
<filename>external/Angle/Project/src/libGLESv2/Fence.h
//
// Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Fence.h: Defines the gl::Fence class, which supports the GL_NV_fence extension.
#ifndef LIBGLESV2_FENCE_H_
#define LIBGLESV2_FENCE_H_
#include "common/angleutils.h"
namespace rx
{
class Renderer;
class FenceImpl;
}
namespace gl
{
class Fence
{
public:
explicit Fence(rx::Renderer *renderer);
virtual ~Fence();
GLboolean isFence();
void setFence(GLenum condition);
GLboolean testFence();
void finishFence();
void getFenceiv(GLenum pname, GLint *params);
private:
DISALLOW_COPY_AND_ASSIGN(Fence);
rx::FenceImpl *mFence;
};
}
#endif // LIBGLESV2_FENCE_H_
|
Is nativism sufficient? ABSTRACT The past and present state of the empiricismnativism issue is analysed. Empiricist philosophical doctrine (no innate ideas) distinguished idea from structure or mechanism. However, Chomsky's conception of innate linguistic universals erased this distinction. The elimination left would-be empiricists without a coherent and defensible position. I argue that the issue remains alive primarily because of tension between two scientific tasks that face students of development. One is to discover what is cognitively and linguistically primitive, a task that encourages nativism. However, nativism is ultimately unsatisfactory because it systematically neglects the other task, which is to account for development, including the emergence of postulated innate primitives. To account for such primitives, it is necessary to relate them to particular central nervous System structures in such a way as to explain how the structure has the particular cognitive effects that define the primitive. That is likely to be difficult, and I show how the study of learning much neglected in recent years can help by reducing the number and type of innate primitives whose origin must be explained in that way. |
Entrepreneurship, University Research, and Growth: European North vs. South Entrepreneurship has a tremendous impact on the economic development of a country. As can be expected, many public policies foster the development of self- entrepreneurship in times of unemployment, praise the creation of firms and con- sider the willingness to start new ventures as a sign of good fortune. Are those behaviours inherent to a human being, to his genetic code, his psychology or can students, younger children or even adults be taught to become entrepreneurs? What should be the position of universities, of policy makers and how much does it matter for a country? This book presents several articles, following different research approaches to answer those difficult questions. The researchers explore in particular the psychology of entrepreneurship, the role of academia and the macroeconomic impact of entrepreneurship. to economic growth as a mechanism connecting the channel of knowledge sharing with economic growth (). Entrepreneurial opportunities are situations by which products, services, raw material and production methods are harmonically combined, introduced to the market and sold, bringing more revenue than their production cost. They do not refer only to the creation of new products and services, but also to the better exploitation and the combination of existing resources, in order to produce a better product than the one covering a given need of the market. Therefore, the need of the market is crucial in the given definition of entrepreneurial opportunity. It is thus necessary for the entrepreneur to be able to realise and predict where the need is at any given time in the market for a new or sufficiently differentiated product. The spread of innovations within the economy and technological inconsistencies create entrepreneurial opportunities. Yet, do all opportunities have the same potential of affecting economic activity? Obviously not. Thus, there are entrepreneurial "multivalent" opportunities and simple entrepreneurial opportunities. The latter do not include the potential for the creation of new entrepreneurial opportunities and therefore their social significance is limited. Of course, finally, profitmaking from the exploitation of entrepreneurial opportunities is what urges to their search and discovery. The theory of the existence and identification of entrepreneurial opportunities is mainly based on three schools of thought. Shane & Venkataraman representing the economic school claim that entrepreneurial opportunity is an objective phenomenon existent in time and space although not all may know of it. In essence it claims that opportunities do exist and wait to be identified by someone, attributing entrepreneurial opportunities to the allocation of information as to material opportunities existent in society. Based on the economic school, entrepreneurial opportunities offer a clear advantage to the first person to discover them (Lieberman & Montgomery, 1988). Furthermore, the economic school accepts that differences in economic information are crucial for the existence of entrepreneurial opportunities. The cultural school claims that entrepreneurial opportunities are subjective and not objective creations-phenomena. According to Weick, entrepreneurial opportunities exist as long as people understand their existence. Therefore, entrepreneurial opportunities do not objectively exist, waiting to be discovered. Protagonists -individuals -create them combining shapes and cognitive organizations to develop them. Thus, the existence of a particular cultural background forms the base for a maintainable competitive advantage (Pollock & Rindova, 2003). Finally, the socio-political school is a combination of the previous two, stressing the significant role of administrative mechanisms in determining entrepreneurial opportunities. In agreement with the economic school, it underlines the objective properties of entrepreneurial opportunities, stressing the objective properties of entrepreneurial opportunities. It deems that entrepreneurial opportunities exist and grow within complex networks of social relations that shape economic activity. In that sense, it emphasises networks rather than resources (Aldrich & Fiol, 1994;Thornton, 1999). In these networks, social protagonists must activate resources in order to exploit objective opportunities. Within the socio-economic networks, structural opportunities available to the www.intechopen.com protagonists are indicated. Therefore, the position that one has in the networks has a key role in whether he/she will be able to discover opportunities. The positioning of protagonists in a particular network determines the volume of the crucial resources and information that the protagonist may have in order to exploit opportunities. In order to exploit the results of their research, scientists need to identify and understand market needs. Vohora et al. stress that identification of opportunities plays an important role in the growth stage of a spin off company. Many studies have shown that experience (Shane & Venkataraman, 2000), social funding (Shane and Stuart, 2002) and information, are contributing factors in identification of entrepreneurial opportunities. The identification process of an entrepreneurial opportunity, in an academic environment, includes two stages. The first includes the identification of an idea that may evolve in an opportunity (). This idea originates from new knowledge produced in the framework of academic research. The next stage includes the assessment of the idea, namely the identification of an opportunity through data accumulation on the market (Elfring & Hulsink, 2003). Many researchers have also claimed that an important drawback in the commercialization of university research is the fear that businesses do not wish the spread and free exchange of scientific findings as they prefer their own exploitation and not their free spreading. The above analysis shows that academic entrepreneurial activity is a process that might be deemed as included in the logic of the socio-political school on production of entrepreneurial opportunities and draws elements from almost all schools of thought. It is based mainly on asymmetric information and the advantage of priority of identification in entrepreneurial opportunities (economic school), while, in essence, its protagonists create it from scratch in the sense that opportunities do not exist just to be discovered but are "created". In this context, the cultural background plays a definitive role in the determination of entrepreneurial opportunities (cultural school). Yet, above all, processes and co-operation and information networks (socio-political school) play the definitive role in the growth of academic entrepreneurship. In the USA, entrepreneurial potential has always been produced through scientific research. However, the Bayh Dole law had to be created in the 90's, for academic entrepreneurship to grow. Table 1 presents the "opportunity entrepreneurship" variable which is calculated as the rate of people 18-64 years old who are either aspiring entrepreneurs or owners -managers of new businesses, who state that a) they are driven by opportunity and not by need, and b) the driving force is independence and revenue growth rather than its stability. The data of Table 1 show clearly that budding or active entrepreneurs are proportionately more in the European North than in the European South. The economics of university production of information In the framework of academic entrepreneurship, asymmetrical information creates three issues: Moral hazard problem: It appears when contracting parties avoid the process of technologyknowledge sharing, as they do not have all the necessary information available. Lowe realizes that asymmetrical information between the inventor and a private company increases licensing costs on the side of the business. He also notes that there are two forms of asymmetrical information, that of technological uncertainty and that of implied knowledge, which affect the funding potential for an invention of the academic community. Businesses that are founded to exploit university inventions may secure their sustainability by patenting the knowledge they produce so as to compete with already existing businesses (Nerkar & Shane, 2003). Uneven distribution of information is what leads to the creation of spin offs, providing then with a competitive advantage. Adverse selection: It appears when sellers of low quality inventions present their inventions as high quality. The buyer in this case is at an adverse position, as he/she does not have all the necessary information available (Anton & Yao, 1994). Hold-up: It occurs when the contracting parties of the transaction speculatively renegotiate the terms of the agreement to their benefit. Spin offs may have cost advantages due to the knowledge held by the researcher, resulting in limited transaction costs and information problems. Particularly, Shane showed that licensing to researchers is more effective, when the patents are ineffective in preventing information problems (such as moral hazard and adverse selection). This happens because the analyst's knowledge does not allow such problems in new businesses. During knowledge transfer, asymmetrical information between buyer and seller on the value of the innovation may be observed. Buyers usually cannot evaluate the quality of the patents in advance, while it may be difficult for researchers to assess the potential commercial profit making of their inventions (). When drafting a contract with an academic spin off, factors such as the problem of the researcher's moral hazard, participation limitations of key researchers and the issue of asymmetrical information are important. Furthermore, when the moral hazard problem is pronounced, the need for the researcher's economic participation in the spin off leads to further ineffectiveness. Copyright and shares are www.intechopen.com important means for dealing with moral hazard, participation limitations, as well as asymmetrical information problems () Moreover spin offs alter the information environment of businesses. Transaction costs and the impact on the prices of transactions are also higher. Indeed alterations in the information environment benefit more the parties who have the advantage in obtaining information (Huson & MacKinnon, 2003). Ultimately, the transaction uncertainty resulting from asymmetrical information gives an uncertainty premium to transaction costs. This situation increases risk in the economy by discouraging people from undertaking large-scale investment plans and encouraging smaller business ventures instead. The general characteristics of the transaction cost theory, including the major concepts such as uncertainty, frequency and asset specificity, and the human aspects such as bounded rationality and opportunism, constitute components and factors that deeply affect the active cultural background in every society. Uncertainty avoidance deals with a society's tolerance for uncertainty and ambiguity, indicating to what extent a society programs its members to feel either uncomfortable or comfortable in unstructured situations. Southern European cultures seem to have lower uncertainty avoidance in comparison with the southern. Southern cultures are not to keen on uncertainty and try to reduce their risks to the minimum by introducing strict laws and rules, safety and security measures. As a result, entrepreneurship and innovation are mostly promoted in countries of low uncertainty avoidance (Herbig & Dunphy, 1998). Furthermore, as the needed transactions increase in an economy, so does the possibility of corruption (corruption perception index). The following table presents the corruption perceptions index, which is a snapshot of perceptions of public sector corruption. It uses the counter-variable, so the prices it can assume are between 0 (highly corrupt) and 10 (highly clean). This index demonstrates a clear indication on the difference between South and North countries. North countries rank top positions while, the South rank low. Another significant index of high transaction costs in an economy is the time needed to start a business. Similar indicators can be calculated for a number of actions regarding entrepreneurial creativity in a particular external environment. The increase of a business' start or end time is likely to be a barrier to entrepreneurship opportunity. The following table presents the days needed in each country to start up a business. It is observed that North countries remain stably at low levels during the five-year period. In particular, 12 days in average are needed in Northern countries while in Southern countries the double are needed, although as years go by we note some improvement, particularly in Portugal. The network and social capital aspects In the previous part, we realized that the discovery of entrepreneurial opportunities depends on the information distribution process in society. Networks significantly contribute to such information. The relevant literature stresses the importance of the creation of networks within the university community (Ring & Van de Ven, 1994, Nicolaou & Birley, 2003a, Shane, 2004. When establishing a spin off, obviously the original ties originate from the interpersonal relations of the researchers with members of the academic community. Yet their expansion towards the industrial and economic sector is necessary, in order to escape the narrow limits of an academic business (,. To secure the successful course of a researcher participating in a spin off company, he must attempt to integrate in networks. Indeed, researcher entrepreneurs do not have common characteristics with the lone Schumpeterian entrepreneur. Academic entrepreneurs have minimum heterogeneity amongst them than other entrepreneur groups. This is a group with clear characteristics and limited entrepreneurial experience. In this framework, Nicolaou & Birley (2003b) stress the importance of networks, particularly as regards technology transfer through an organized network. They further note the importance of network organization by universities for the promotion of the technology that they produce. Over the past years, the collaboration rate between institutions of most countries has increased. This fact is shown by the co-authorship and co-invention existent in scientific publications and in patents. Generally, there is a positive correlation between rates for international scientific collaboration and the applications for patents in all countries, which indicates the existence of common factors that urge research and the creation of patents. Smaller countries tend to have higher rates of international collaboration, something that justifies the need for search of opportunities of this kind. On the issue of network development, Burg et al. stress that there are two phases in developing academic spin-offs. Originally, the existence of the appropriate infrastructure is required, which includes a collaboration network of investors, administrators and consultants. Then this network allows the support of separate entrepreneurial ventures (). access to information and sources while in the same time through his contacts with businesses, he may acquire market information in time, resulting in an enhancement of R&D. Moreover, references play a significant role in the entrepreneurial ventures of researchers. Thus venture capitalists and businesses are more likely to invest on spin offs which they know or have received positive references as in this way they also limit the issue of asymmetrical information (Shane & Stuart, 2002). Specifically, studying the importance of networks in spin off companies of the Massachusetts Institute of Technology (MIT), Shane & Stuart showed that owners who had direct and indirect relations with the venture capital companies are more likely to be funded and sustainable. Source: OECD, Science, Technology And Industry Scoreboard, 2011 Note: International co-authorship of scientific publications is based on the share of articles with authors affiliated with foreign institutions in total articles produced by domestic institutions. Co-inventions are measured as the share of patent applications with at least one co-inventor located abroad in total patents invented domestically. Fig. 1. International collaboration in science and innovation Various factors have a significant impact on the operation and performance of a spin off company. Connections with financial institutions have multiple impacts on the technological potential and the finding of the economic resources invested on a start-up company (). Furthermore, individuals belonging to an entrepreneurial network are more likely to identify opportunities than individuals who are independently active (,. The networks of spin off companies are linked to social capital theory. The key dimensions of social capital are networks in which it is integrated, as well as the necessary trust for their sustainability. Networks can be classified into personal and broader social networks. According to this theory, external networks of a business are a significant source for the performance and growth of a company (Gabbay & Leenders, 1999). Social capital refers to the benefits enhanced by participation and inclusion of individuals in social networks. Bourdieu defined it as the total of real and potential resources related to one being a member of a stable network of mutual familiarization. Putnam deems as social capital the characteristics of a social organization that "facilitate the coordination and collaboration to a common benefit". Those characteristics include three concepts: networks, rules and trust. Trust is the second key dimension of social capital. The two basic forms of trust that are mostly related to social capital are the interpersonal trust and institutional trust. Both forms make it possible to expand and spread relations integrating social capital. Table 3 shows the proportion of people who think that most people can be trusted according to the question: "generally speaking, would you say that most people can be trusted or that you need to be very careful in dealing with people?" There is an evident difference between Northern and Southern European countries, since this index is higher for Northern than Southern ones. Property rights considerations Institutions, as the "rules of the game" in a society, are defined as society's collective choices. They usually express conflicts of interest and develop under the influence of history and cultural background. Generally, favourable economic institutions (with regard to entrepreneurship) are those that offer secure property rights in a wide range of social activities (). The relationship between institutions and entrepreneurship stems from three different sources, which are the following: a) their contribution to coordination and governance, b) their influence on the process of knowledge development and c) their effect on income distribution and the development of social coherence (). The main tools of economic institutions are property rights and contractual conditions. The protection of property rights seems to be a fundamental part of economic growth (North, 1981;Rosenberg and Birdzell, 1986;;Acemoglu & Johnson, 2005). Subsequently, entrepreneurship thrives through secure property rights which can be used in voluntary contract-based exchanges. A high value for the property rights variable (as presented in Table 4) indicates that a country's laws protect private property rights, the government enforces those laws, the judiciary is independent, there is no corruption and it is easy to enforce contracts. These conditions are expected to encourage the foundation of new businesses. Northern countries have again higher rates (average of 90.6) than Southern. A successful mean of intervention in the property rights regime is the law that changed their operational framework in the USA. The Bayh-Dole Patent and Trademark Amendments Act of 1980 is a US law on copyright (intellectual property) arising from funded research. Inter alia, it granted US universities, small businesses and non profit organizations the control of copyright on their inventions but also the copyright arising from public funding. The cultural background aspect The definition of entrepreneurial opportunities raises the question of the exact impact of culture on entrepreneurship, as indicated by disciplines such as economics, sociology and psychology. Moreover, it involves several issues attributed to the social characteristics that constitute what we understand as "culture". "Culture is defined as a set of shared values, beliefs, and expected behaviours" (). The cultural characteristics of societies reflect psychological social stereotypes created over time, which are prior human constructs to the current conditions of transactions and institutions. The cultural background can be considered an endogenous product of human civilisation (Hong, 2009;Oyserman & Sorensen, 2009) consisting of cultural syndromes that can be considered as intermediate mental constructions that originate from the distant past, connecting it with the present. This view is in line with cultural evolutionary theory, which stresses that individuals tend to adopt certain pre-existing cultural values (Bergh & Stagl, 2003). McClelland attempted to relate societal values with entrepreneurial variables and economic dynamism in general. Furthermore, he attempted to quantify the impact of entrepreneurship culture in economic development without using an economic model. Lynn, also without using a model, concluded that countries moving towards competing values are associated with higher levels of economic development. Scientific research also highlights other factors, including cultural complexity, cultural austerity and value orientation theory (Kluckhohn & Strodtbeck, 1961). The different social and political procedures that shape the cultural background of each society guide human behaviour and the character of all of the stakeholders. Thus, Grief highlights the fact that different cultural values lead to different societal structures of economic relationships. Many studies have quantified the "effects" of the cultural background and provided relevant data for a large number of countries (McClelland, 1961;Hofstede, 1980Hofstede,, 2001;Saving & Schwartz, 2007). Georgas and Berry and Inglehart have identified groups of countries that seem to share common cultural values. Cultural and institutional factors may explain cross-national differences in levels of entrepreneurial activity, Wennekers, 2005. Thomas and Meller found that differences in cultural orientation between countries affect the personality characteristics commonly associated with motivation for entrepreneurship. Furthermore, studying regional differences of entrepreneurial culture in Sweden using cultural values and belief data, Davidsson & Wiklund concluded that there is a weak relationship between entrepreneurial values and the formation of new regional new firms. Shane and Grilo & Thurik argue that other factors beyond the economic ones play a role in shaping entrepreneurship. Shane found a strong influence of Hofstede's cultural value of uncertainty avoidance on the levels of innovativeness of societies. Morris et al. focused on the variable of individualism, which is related both to the desire of people to violate norms and to incentives for achievement (Hofstede 1980), which are characteristics associated with entrepreneurship. Wildeman et al. examined the effects of Hofstede's cultural variables of power distance and uncertainty avoidance on entrepreneurship and showed that they positively influence levels of self-employment. In general, we may approach the relationship between cultural values and entrepreneurial activity from two different perspectives. These are the supply or "pull" perspectives and the demand or "push" perspectives. On the supply side, we have the "legitimation of entrepreneurship" and the "aggregate psychological traits", and on the demand side, we have the "dissatisfaction perspective" for business start-ups and entrepreneurship in general (Stanworth and Curran, 1973;;;. The predicted relationship between the "push" and "pull" perspectives is the opposite (;. The "legitimation of entrepreneurship", or the "legitimation" or "moral approval" of entrepreneurship, focuses on the impact of the norms and institutions on society at large. The cultural determinants of entrepreneurship may also include "aggregate psychological traits", as more entrepreneurial values in a society can lead to an increase in the number of people displaying entrepreneurial behaviour (Davidsson, 1995(Davidsson,, 2004. A third explanation for entrepreneurship is what is called the "dissatisfaction perspective", which, at the macro level, assumes that differences in values between the population as a whole and potential entrepreneurs form the basis for variation in entrepreneurship. Baum et al. concluded that countries with a high degree of uncertainty are associated with higher rates of self-employment, explaining that the cultural determinants of entrepreneurship as the "push explanation for entrepreneurship". Nooerderhaven et al., who used a sample of 22 OECD countries and described the countries with a low degree of uncertainty as "entrepreneurial economies", had the same conclusion. They concluded that per capita GDP has a strong, negative effect on the rate of business ownership in nine countries characterised by high uncertainty avoidance and no effect in countries with low uncertainty avoidance. On the level of business ownership, examined the influence of cultural attitudes towards uncertainty avoidance. They identified a strong, positive effect of uncertainty avoidance on business ownership, concluding that high levels of uncertainty avoidance push people into entrepreneurship through self-employment (in line with Baum's hypothesis). The model of cultural values formed in the two groups of countries is roughly the following: Southern countries accept more widely the existence of greater inequalities and (according to Hofstede) demonstrate higher rates of uncertainty, when compared to Northern European countries. Individual achievements are not highly appreciated and at the same time the socially established organization rules and practices are not acceptable. Nevertheless, individuals express pride, faith, and cohesion with their families and any specific social group they belong to. Feminine values, such as quality of life, care for the weak, and solidarity play a small part and are characteristic features of Northern European countries. Accordingly, the values of imposition and of dispute do not seem to prevail. Regarding the cultural indicators there is a clear distinction between the two groups of countries. Southern countries have a lower ranking, implying lower uncertainty avoidance levels. The Southern countries examined here are characterized by limited future orientation, lack of scheduling and long-term planning and portray low efficiency and human orientation levels while their main focus is on short-term planning. Based on the definitions of the variables used to express cultural background by House et al., we can assume that societies with high values for performance orientation should be associated with higher levels of entrepreneurship, given that they promote profit and performance improvement in their economies. Such societies value training, development, assertiveness, competitiveness, individual achievement and taking initiative, and entrepreneurship contributes towards these goals. High values for future orientation should be related to increases in entrepreneurship too. Indeed, such societies tend to achieve economic success, have flexible and adaptive organisations and managers, and favour financial prosperity, which can facilitate new businesses. Furthermore, a decrease in genderbased differences should reflect greater entrepreneurship because more women will have the chance to exercise their entrepreneurial skills. Such societies tend to afford women a greater role in community decision-making and have a higher percentage of women participating in the labour force and in positions of authority. Moreover, it is expected that a positive correlation exists between higher values of assertiveness and entrepreneurship given that aggression and austerity drive global competitiveness. Such societies value success, progress and competition and tend to act and think of others as opportunistic. Generally, collective activity in a society (institutional collectivism) should be positively related to entrepreneurship, as group loyalty is encouraged even if individual goals suffer. In contrast, in-group collectivism is expected to be associated with lower levels of entrepreneurship because, in essence, in-group collectivism is incompatible with competitiveness and the development of free entrepreneurship: it favours conceptualism and small, low-risk businesses. High levels of power distance indicate that economic development occurs only for those who (mainly) have economic power in societies. Consequently, it is expected to have a negative correlation with opportunity entrepreneurship. In such societies, only a few people have access to resources, skills and capabilities. Human orientation is expected to have a positive correlation with entrepreneurship because, in societies with a high level of human orientation and that have the primary aim being profits; the government's focus should be on individuals. There is expected to be a negative correlation, as it was said before, between uncertainty avoidance and entrepreneurship because lower levels of uncertainty avoidance have been repeatedly associated with higher levels of economic activity (Swierczek & Ha, 2003;). Such societies tend to be less calculating when taking risks and show less resistance to change. Education system, research and academic entrepreneurship The education system and academic research lead to research results that can contribute to the growth of academic entrepreneurship through the creation of spin off companies. Education system and research The question raised is under what conditions different educational systems generate different performance levels in scientific research. We shall attempt a comprehensive analysis of the education system and the way in which it promotes the growth of research. Stressing the importance of the transformation of research results to research activity, we examine to what extent the growth of knowledge in the university and research community is transformed in research results (publications). We thus examine to what extent the education system (structure, motivation) provides satisfactory research results. E.U. countries allocate on average 11% of their total public expenditure to education. North European countries (Sweden, Ireland, and Denmark) rank at the highest positions with an average of 15%. The field of studies, as shown in Table 7, does not seem to be an inhibitor for research that may be commercialized. In particular it does not seem that there are significant differences between the weighted average of the number of graduates per educational field of Southern and Northern European countries. The only significant differentiation observed, refers to the predominance of fields of health and care in North countries (21%) in comparison to Southern countries (16%). In 2009, seventeen EU members marked an increasing or stable trend in R&D expenditure, while in 2010 sixteen EU members forecast an increase of said index in relation to GDP. However, provisional data show that there has been a decrease in 2010 in most EU countries and the same trend seems to be mantained during 2011. In Europe, almost 1 million students graduate annually from higher education and approximately 100,000 receive a PhD title, while indicatively in the USA the number of the latter is almost half. However, taking into consideration GDP, the USA invests 2.5 times more money in education in comparison to the EU. As expenditure per postgraduate or PhD student in Europe is smaller that in the US, the EU focuses more on quantity rather that quality, thus risking to fail the expectations of the entrepreneurial sector (European Commission, 2011). In Europe, 71% of the investment in R&D is made by its four bigger members (Germany, France, United Kingdom, and Italy Moreover, research activities differ significantly per university unit and scientific field. Comparison of research activity of universities shows that each university publicizes almost 250 articles referring to social studies and more than 5,100 articles on sciences. Research activity and results This unit aims to examine to what extent research results (publications) offer substantial added value. Added value is measured by citations and by register patents. In this process, a definitive role is played by the existing funding status of university research in order to promote entrepreneurial activity and by the quantity of the research results produced. In essence, in this part we will analyze the relation between publications, citations and registered patents. Namely how different research systems "produce" different usable results (citations). Patenting and copyrights help academic institutions by protecting them from the competition created by the availability of their intellectual property. It has been found that the number of publications does not affect the creation of spin-off companies () and that patents are not the key factors for the prediction of the number of publications, but are positively linked to citations (Agrawal & Henderson, 2002). Through patenting, there is an increase in the interaction between scientists, who are active in the academic or industrial sector and in this way, the traditional scientific standards are enhanced. Moreover, if researchers are excluded from patents, then the technology dissemination mechanism will be characterised by ineffectiveness. Table 10 shows a clearly higher number of registered patents by countries of Northern Europe as to patents registering. It is indicative that these countries show particularly satisfactory research results on an international scale, as they exceed the respective dynamic of the USA (which in 2005 presented almost 53 patents per one million of population), but are clearly behind Japan (more than 110 patents per one million of population in 2005). Figure 3 depicts the relation between the domestic product per capita and the amount of expenditure for R&D. The number of patents registered shows the potential of production of applied research activity results. The production of basic research does not refer so much to the quantity of publications, but mainly to their quality. Therefore, for a more thorough analysis, we shall examine the relevant significance of scientific work, as resulting from the number of references (citations) they receive from other scientific works. Table 11 shows the index of the relevant "distinction" of scientific works of each country. Table 11. "Distinction" index of scientific works of each country 2 As to distinct and recognized scientific publications North European countries present the highest "distinction" index (but for Ireland). Academic spin offs and entrepreneurship An academic spin off company is established in order to commercially exploit an intellectual property produced within the framework of the academic community. Usually patents, copyrights and the appropriate legitimation mechanisms are created to protect spin off companies. Universities create secondary technological results that become the object of exploitation by new businesses (Shane, 2001a(Shane,, 2001b. In other words, academic spin offs are the externalities commercialised by businesses for which the university is the source of dissemination and for which it is not fully compensated. Spin off companies are the commercial aspect of scientific research, although studies on their establishment, the conditions of growth and comparative analysis between countries are scarce, particularly in the EU. Usually these concern case studies ( Rabinow, 1997;Tuunainen, 2005) based on qualitative methods. The issue of the production of basic applied research in Universities, of the transfer of the knowledge produced in Universities to the private sector and its effective commercialization, is an issue of concern for the academic community and scholars in recent years. Until the 1980's, mainly in the USA, the issue had been resolved based on the limiting version, namely the limitation of Universities to basic research and the promotion of "open science" (). "Open science" includes the acceptance of findings based on the impartiality of researchers, their systematic scepticism, and the minimization of copyright (communism of knowledge). Thus the activity of Universities referring to teaching, research, publication and public service or transfer activity, does not have the nature of commercialised relations. Moreover, there has been an effort to determine the reasons that some academic institutes exploit their intellectual property more in comparison to others. Basic reasons why this situation is shaped may be the availability of venture capital in universities, the commercial orientation of the university community, the intellectual superiority and the policy followed by the university community. Specifically in 101 universities in the world (530 spin off start ups), it was found that the factors associated with the quality of human resources as well as the ability of the university in finding funding sources increase the creation of new businesses (Gregorio & Shane, 2003). Finally, universities well established in the research sector present a larger number of spin off companies in comparison to "younger" universities that are characterised as less flexible in the process of taking business initiative (venture) (). After data accumulation by 47 academic spin off companies of the 8 greater Universities of Belgium, it seems that the policies implemented in academic institutes affect the growth potential of such businesses (Degroof & Edward, 2004). The establishment of a spin off company is not necessarily implemented when its founder leaves the academic institute or graduates. It may need some years and this is because it is necessary that he/she acquire more skills or because there is the need to find partners. However, this process may be accelerated if its founder has direct access to the university unit, which will offer them -even informally -support for the transfer of knowledge and technology (Mller, 2008). The moment of registering of a patent or license issuance for the exploitation of an invention is early and its commercial success from its immediate exploitation cannot be secured. Usually further improvement is needed as well as market data analysis (Jensen & Thursby, 2001). Besides, it has been found that it is not only the creation, but also the development process of this kind of businesses that play a significant role (). Indeed the participation of a member from the entrepreneurial world is deemed necessary as it will form the connecting link between science and market and will contribute to the minimization of the time between the registration of an idea and its commercial exploitation. It is particularly interesting to examine the classification of academic spin offs that operate in academic entrepreneurship: a) technology scouts: post-doctorate researchers who have excellent knowledge of technology but do not have adequate entrepreneurial knowledge, b) teams led by an experience professor who is in contact with public authorities, c) "forefront" teams who develop in high paces as they do have the necessary entrepreneurial cognitive background, d) teams offering support and consulting at the process of drafting the proposal for funding and finally, e) teams that include a network of external partners (banks, business funds investors, business partners). Libecap classified academic spin offs based on the kind of start-up policy: a) absence of start-up policy, b) minimum selectiveness/support, c) medium selectiveness/support, and d) full selectiveness/ support. It has been proven that the latter case is the best form which can exploit entrepreneurial opportunities with a high growth potential. However it is clarified that the latter form may be characterized as ideal but it is not directly feasible due to limited resources. Using the Robert & Malone model of support and selectiveness, it seems that if a University follows a low support/ low selectiveness policy (many spin offs with little support) and it is an academic institute that already has entrepreneurial activity, it has greater potential for entrepreneurial growth (e.g. MIT). On the contrary, a high support/ high selectiveness policy (few spin offs with great and orderly support for the University) is more appropriate for underdeveloped -as to entrepreneurial environment-universities (e.g. Yale). In this way, different approaches to technology transfer and commercialization may lead to similar positive effects for the local economy. In a business, the separation and selection among many ideas, information and proposals is a difficult process. The process is made even more difficult when it refers to an academic unit that produces knowledge on its own. Thus, as important it is for a business to develop mechanisms in the framework of entrepreneurship, it is equally important for an academic spin off. This position is enhanced as academic institutes do not operate as "business of business" but as "business of education" despite the entrepreneurial nature that they often may demonstrate. When the only commercial mechanisms they have are patents and licenses, the academic staff must develop their entrepreneurial skills and the knowledge "filter". Besides, the majority of academic staff has limited experience in the entrepreneurial sector, ideas are sometimes vague, they use academic terminology and address an unknown market. Differentiating the process of knowledge dissemination depending of the type of science it can be seen that the process is more implicit and less encoded in social sciences. On the contrary, in sciences the process is less implicit and more encoded, with expanded geographic proximity (). It has been noted that there are also differences between the motives given to researchers of various countries. Specifically in a survey held in Sweden it was noted that the motives for the commercialization of academic research results are different from those in USA. In the USA, the copyright of academic results belongs to academic units, while in Sweden it belongs to the researcher. Furthermore, in Sweden, academic institutes are funded by the state while in the USA mainly by the private sector 3. A corresponding survey held in academic spin offs in Finland showed that there is not a significant interaction between them and the academic institutes. The total of spin-offs under examination concerned small enterprises, unable to invest in research and development. Moreover, such enterprises do not need direct R&D inputs as they have the know-how when established. It is also very likely that they seek for partners in other scientific fields 4. However, the fear of technological backwardness for the economy of the USA in the 1980's led to the introduction of three basic instruments : The Bayh Dole Act that allowed Universities to licence the Federally financed R&D results to business, the Cooperative Research Act that allowed Universities and enterprises to organise technology-transfer alliances without undue fear of antitrust litigation and the Stevenson -Wedler Act to foster the exchange of scientific and technical personnel among universities, industry, and federal laboratories. The introduction of such instruments in the same time with the highlighting of the importance of the biotechnology sector in the relations between Universities and industries (;) created a new situation in the relations between Universities and industries throughout the 80's and the 90's at least in the USA, which however affected the relevant thinking internationally (European Commission, 1995 The new perception of University relations, the so-called "neotransferism", creates the conditions for a second revolution (the first referred to the integration of research in academic operation, apart from teaching). This perception includes the economic and social growth as part of the mission of academic institutes. The University technology transfer to industry those days can take four dimensions: a) industry -sponsored contact research, b) consulting, c) technology licensing, and d) technology development and commercialization. Each University, in the framework of national legislation in which it operates, chooses to enhance less or more one or more of the above dimensions. However, there is a remarkable difference among them. The two first could be deemed as of a nature that drastically limits the outflow of knowledge (the first one excludes it) while the third and fourth lead to an outflow at the cost of an induced inflow either to the University per se or to society. In the last 20 years, many Universities across the world (mainly in the USA and in Europe) boost the development of spin off companies. The 90's, with the magnification of the role of economy of knowledge and the rise of capital markets, magnified the significance of spin offs as a method of knowledge transfer from universities to enterprises. This process was particularly beneficial for the financial state of Universities. In 1996 the sale of equity in spin off companies by U.S. Universities totalled $25,3 mil (Bray & Lee, 2000). In the same decade, it was found that this methodology was more effective that that of technology transfer through licensing. In 1996, the average annual income from a traditional licence was $63.832 while the average value of equity sold was $691.121 (10 times more than the average annual income from a traditional license The establishment of spin off companies by academic institutes is implemented at a slow pace outside the USA. In most OECD countries besides USA, 25 spin off companies maximum are created each year whose size, revenue and products production is of small, while only a small percentage of those belongs to high tech category. Indeed most of them come from top Universities of the world while the supporting structures are costly. Spin offs contribute to national competitiveness, to the creation of jobs on a national level, while in the same time they ensure inflow to the academic community. The types of spin offs and the growth stages may differ (). A study conducted on 109 spin off companies of Cambridge University (years of establishment 1979 -2002) of which 18% were consulting companies, 34% technological, 21% products production and the remaining software development companies, showed that different types of spin offs have different needs and require different treatment by the state (Druilhe & Garnsey, 2004). (). The number of spin offs that are active in Greece is almost 10. Conclusion Activation of academic entrepreneurship is a phenomenon dealt at the two more mature phases of development of economic systems (efficiency driven and innovation driven) with an emphasis on the latter phase where further development of the growth depends on the commercialisation of new products of knowledge. Comprehension of all of the above conditions leads to the conclusion that the USA, compared to Europe, is characterised by an environment that is more favourable to academic entrepreneurship and that the European North is characterised by a more favourable environment in comparison to the European South. Entrepreneurial activity exploiting the conditions of asymmetrical information has the ability to identify new academic entrepreneurial opportunities. However, this presupposes an institutional (cultural and regulatory) framework that will reward and encourage this process. Certainly, the members of the academic community face the moral hazard of either concealing or exploiting the entrepreneurial opportunity, or of abandoning the main duty of research and knowledge dissemination. Growth conditions of academic entrepreneurship are affected by the burden of the transaction costs which has as crucial feature the uncertainty and the burden of operation of the entrepreneurial activity. The growth of social capital, of trust and of academic networks can have a positive effect on academic entrepreneurship. The manner in which property rights originating from research are produced and registered is equally important. Naturally, the way in which property rights on the production of university innovation are recognized and registered is important. The brave move implemented in the USA by which the property of the innovation was transferred from the sponsors to the producers, played a key role in the growth of the role of academic entrepreneurship in the growth of entrepreneurship and growth in the USA after 1990. Simultaneously, the cultural environment affects the growth of academic entrepreneurship on two levels: on the level or researchers and potential entrepreneurs and on the level of university administrations which also carry the viewpoints of society. Thus if a society has cultural characteristics that do not favor the growth of entrepreneurship (like the European South for instance) then there is no reason for us to believe that part of the society (such as the university community) will feel otherwise no matter how the existence of a higher educational level may differentiate the separate characteristics of the academic environment. On the other hand the effect will be graver on the way that university administrations deal with academic entrepreneurship. A negative entrepreneurial atmosphere in society is certainly creating a negative "welcome" atmosphere of academic entrepreneurial opportunities on the side of University administrations. Analyzing the relations between the academic system and research we discover the North countries have higher funding rate towards education system mainly through private funding. Despite this fact scientific publications in the North and the South are comparable, while the number of patents is much higher in the European North. The same also applies on publications distinction indexes. Namely in essence we realize that while scientific results are produced in the South, in the North they take a registered form (e.g. in the form of patents). This may means that the direction of scientific research in the South is not offered for further financial exploitation e.g. humanities, basic research not linked to commercial potential, etc. Finally, it all comes down to a low level of academic activity in the European South in comparison to the European North. The limited academic entrepreneurship of the South has a complex interpretational background, which is disseminated in all aspects of social and economic activity of an economy. This image also characterizes the hardships faced by economies in their transition to a growth stage based on innovation. |
/*!
* Copyright 2010 - 2013 Pentaho Corporation. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.apache.hadoop.hive.serde2.thrift;
import java.util.Properties;
import org.apache.hadoop.conf.Configuration;
import org.apache.thrift.TException;
/**
* An interface for TProtocols that need to have properties passed in to
* initialize them. e.g., separators for TCTLSeparatedProtocol. If there was a
* regex like deserializer, the regex could be passed in in this manner.
*/
public interface ConfigurableTProtocol {
/**
* Initialize the TProtocol.
*
* @param conf
* System properties
* @param tbl
* table properties
* @throws TException
*/
void initialize(Configuration conf, Properties tbl) throws TException;
}
|
async def connect(self):
await self.bot.wait_until_ready()
headers = {
'Authorization': self._auth,
'Num-Shards': self._shard_count,
'User-Id': self.bot.user.id
}
self._websocket = await websockets.connect(self._url, extra_headers=headers)
self._loop.create_task(self._lava_event_processor())
self._loop.create_task(self._discord_connection_state_loop())
logger.info('Successfully connected to Lavalink.') |
<gh_stars>0
import {FusionFunction} from './weight-function.interface';
import {WeightedFeatureCategory} from '../weighted-feature-category.model';
import {MediaObjectScoreContainer} from '../scores/media-object-score-container.model';
import {SegmentScoreContainer} from '../scores/segment-score-container.model';
import {MaxpoolFusionFunction} from './maxpool-fusion-function.model';
/**
* Averages per category on segment-level and maxpools on object-level
*/
export class AverageFusionFunction implements FusionFunction {
private _objectFusionFunction = new MaxpoolFusionFunction();
/**
* Calculates and returns the weighted score of a MediaObjectScoreContainer. This implementation
* returns the average score of any of the child segments!
*/
scoreForObject(features: WeightedFeatureCategory[], mediaObjectScoreContainer: MediaObjectScoreContainer): number {
return this._objectFusionFunction.scoreForObject(features, mediaObjectScoreContainer);
}
/**
* Calculates the best score per category and then normalizes by all weighted features
*/
scoreForSegment(categories: WeightedFeatureCategory[], segmentScoreContainer: SegmentScoreContainer): number {
let score = 0;
let total = 0;
categories.forEach((weightedFeatureCategory: WeightedFeatureCategory) => {
let bestScoreForCategory = 0;
segmentScoreContainer.scores.forEach((categoryMap, containerId) => {
if (categoryMap.has(weightedFeatureCategory)) {
const scoreForCategory = (categoryMap.get(weightedFeatureCategory) * weightedFeatureCategory.weightPercentage / 100);
bestScoreForCategory = Math.max(scoreForCategory, bestScoreForCategory);
}
});
/* This is 0 if there is no match for a given category */
score += bestScoreForCategory;
total += (weightedFeatureCategory.weightPercentage / 100);
});
return (score / total);
}
name(): string {
return 'average';
}
}
|
#include<bits/stdc++.h>
using namespace std;
#define test_case int t;cin>>t;while(t--)
#define ll long long
const double pi=acos(-1.0);
void RAmadAN()
{
/*
cout<<fixed<<setprecision(2);
itoa to convert any system itoa(n,bin,2)
*/
std::ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
}
long long gcd(long long a,long long b)
{
return a ? gcd(b%a,a):b;
}
long long lcm(long long a,long long b)
{
return a/gcd(a,b)*b;
}
long long fact(long long n)
{
long long f=1;
for(int i=2; i<=n; i++)
{
f*=i;
}
return f;
}
long long ncr(long long n,long long r)
{
return fact(n)/(fact(r)*fact(n-r));
}
long long npr(long long n,long long r)
{
return fact(n)/fact(n-r);
}
int dx_r[]= {1, 0, -1, 0, -1, 1, -1, 1};
int dy_c[]= {0, 1, 0, -1, -1, 1, 1, -1};
int main()
{
/*freopen("","r",stdin);
freopen("","w",stdout);*/
RAmadAN();
int a,b,c;
cin>>a>>b>>c;
c*=2;
cout<<(c<=a&&c<=b?"First":"Second");
return 0;
}
|
Primary intramucosal synovial sarcoma of the sigmoid colon in a patient with a germline mutation in the MSH2 gene: A case report Synovial sarcoma is a highgrade soft tissue sarcoma that occurs primarily in the deep soft tissue of extremities, and primary colorectal synovial sarcoma is extremely rare. In this report, we present a synovial sarcoma mostly located within the mucosa of the sigmoid colon. The patient was a man in his forties with a germline deletion in the MSH2 gene. He had experienced undifferentiated pleomorphic sarcoma of the left forearm 7 years before and adenocarcinoma of the transverse colon 6 years before, both of which were successfully treated and exhibited no recurrence to date. A surveillance colonoscopy for Lynch syndrome revealed the tumor which had a submucosal tumorlike appearance with central erosion and endoscopic resection was performed. Histologically, it was composed of monotonous proliferation of spindle cells arranged in cellular fascicles; these findings were compatible with monophasic fibrous synovial sarcoma. In the tumor cells, the presence of the SS18SSX1 fusion gene was confirmed. Protein expression of mismatch repair genes was intact in the tumor cells, indicating the association between microsatellite instability and synovial sarcoma was weak. The present case highlights a rare primary site of synovial sarcoma in a patient with Lynch syndrome. |
def sql_tableexists(self, table):
sql = f"""SELECT count(*) FROM sqlite_master WHERE type='table' AND name='{table}'"""
df = self.sql(sql)
return df.iloc[0, 0] > 0 |
<gh_stars>0
/**
*
*/
package com.ricex.aft.servlet.config;
import org.springframework.context.annotation.Configuration;
/** The Web config for the Servlet
*
* @author <NAME>
*
*/
@Configuration
public class WebConfig {
}
|
Mode conversion and transmission in spatially cyclic fields In a cold plasma, the 0 and X modes are determined by the orientation of the first-order electromagnetic fields with respect to the equilibrium magnetic field B0. In the particular case where the direction of B0 is a function of position the distinction between these types of waves is lost. In this paper, two semi-infinite regions of homogeneous cold plasma are connected by a finite zone in which the equilibrium magnetic field has a spatially periodic shear. This system is studied self-consistently to reveal the mode-con version and transmission characteristics of plasmas containing field structures of this kind, and preliminary calculations of the full coefficients are presented. The results thus obtained are directly relevant to situations where magnetic shear is important. |
Light heavyweight veterans Rashad Evans and Glover Teixeira led the reported payroll at UFC on FOX 19, scoring the card's only six-figure paydays for their main event fight, which Teixeira won via first-round knockout. The Florida Department of Business and Professional Regulation released the event's salary information on Monday.
Teixeira knocked Evans out cold with a thunderous combination in the opening round on Saturday night, inching closer towards contending for a second shot at the UFC light heavyweight title. The victory earned Teixeira a $120,000 purse, while Evans, a former UFC champion, picked up $150,000 in a losing effort.
UFC on FOX 19 took place April 16 at the Amalie Arena in Tampa, FL.
In addition to their commission-reported salaries, Teixeira, Michael Chiesa, Elizeu Zaleski, and Omari Akhmedov each earned $50,000 fight night bonuses for their performances.
A complete list of the UFC on FOX 19 salaries can be seen below. As always, these figures do not represent a fighter's total earnings, as certain sponsorship incomes and discretionary post-fight bonuses are not publicly disclosed.
Main card (FOX)
Glover Teixeira ($60,000 + $60,000 = $120,000) def. Rashad Evans ($150,000)
Rose Namajunas ($43,000 + $43,000 = $86,000) def. Tecia Torres ($20,000)
Khabib Nurmagomedov ($24,000 + $24,000 = $48,000) def. Darrell Horcher ($12,000)
Cub Swanson ($44,000 + $44,000 = $88,000) def. Hacran Dias ($16,000)
Preliminary card (FOX)
Michael Chiesa ($33,000 + $33,000 = $66,000) def. Beneil Dariush ($28,000)
Raquel Pennington ($20,000 + $20,000 = $40,000) def. Bethe Correia ($25,000)
Santiago Ponzinibbio ($16,000 + $16,000 = $32,000) def. Court McGee ($27,000)
Michael Graves ($12,000 + $12,000 = $24,000) def. Randy Brown ($12,000)
Preliminary card (UFC Fight Pass)
John Dodson ($35,000 + $35,000 = $70,000) def. Manny Gamburyan ($33,000)
Cezar Ferreira ($24,000 + $24,000 = $48,000) def. Oluwale Bamgbose ($12,000)
Elizeu Zaleski ($10,000 + $10,000 = $20,000) def. Omari Akhmedov ($18,000) |
Metastatic Prostate Cancer Synchronous with Male Breast Papillary Ductal Carcinoma in situ: Management Dilemma and Literature Review Prostate cancer is common in men, but tumour of the male breast is rare. For these two tumours to be presented synchronously in a male patient is even rarer. The focus of this paper is the case of a 72-year-old man diagnosed with papillary ductal carcinoma in situ after he presented with a unilateral breast mass associated with nipple discharge. Imaging staging for his breast tumour and subsequent prostate biopsy found an incidental synchronous asymptomatic prostate adenocarcinoma as well as bone metastases. He denies risk factors for malignancies and refuses genetic testing. The first part of our discussion will highlight the uncommon occurrence of male breast ductal carcinoma in situ and its management controversies. The subsequent part of our discussion will focus on the association between male breast cancer and prostate cancer, and implication of this on the future treatment of these patients. More importantly, our case will illustrate the challenges in managing dual primaries that present concurrently. Introduction Prostate cancer is the second most common cancer among men. Increasing age, black ethnicity, and a family history of malignancies, including those related to BRCA gene mutation, are the established risk factors. However, unlike prostate cancer and female breast carcinoma, male breast cancer is rare, accounting for <1% of all breast cancer. The strongest proven risk factors for male breast cancer are a history of breast cancer among first-degree relatives and history of hereditary cancer in the family, especially those that are related to BRCA2 mutation. Other risk factors for male breast cancer are thought to be due to an increase in the ratio of oestrogen to androgen in the body. These could be due to male patients taking hormonal treatment, especially of oestrogen-based hormones, those with liver disease, obesity, Klinefelter syndrome, and primary testicular disease such as orchitis, cryptorchidism, and testicular trauma. While a prospective study showed a possible link of smoking to an increased risk of male breast cancer, a retrospective analysis on a large US Veteran Affairs database including more than 4 million men disputed this finding. Is Prostate Cancer a Risk Factor for Male Breast Cancer? Interestingly, Davis et al. found that while having a history of prostate cancer may be associated with an increased risk of developing a second primary cancer in the urinary bladder, soft tissue including the heart, kidney, and endocrine system, it does not seem to increase the risk of developing a second primary in the male breast any more than that of the general male population. However, in prostate cancer patients harbouring an abnormal gene such as a BRCA2 gene mutation, the risk of developing breast cancer increases significantly. Is Male Breast Cancer a Risk Factor for Prostate Cancer? Abhyankar et al. looked at the SEER database of 5,753 male breast cancer cases diagnosed between 1988 and 2012. They found that 250 of these men developed prostate cancer during a median follow-up of 4.3 years. Given that prostate cancer is one of the most common cancers among men, the calculated risk of prostate cancer in patients with a previous history of male breast cancer is no higher than that of the general population. However, the risk of developing prostate cancer in their lifetime increases 1.9-fold if they also carry a BRCA gene mutation. The risk increases further to 2.64-fold if the mutated gene is BRCA2. Whether or not there is an association between prostate cancer and male breast cancer, it certainly is not straightforward and will be discussed further in the later part of this report, after our case presentation. Case Presentation A 72-year-old male presented to our centre with a 3-month history of slowly growing, painless right breast swelling associated with bloody nipple discharge. On clinical examination, there was a palpable firm right breast lump (2 2 cm) in the right retroareolar region with serous discharge from the nipple. Ultrasound of the right breast showed the presence of a cystic mass with a solid component within the retroareolar region, measuring 1 1 1.8 cm, which was classified as BIRADS 4. Tissue biopsy of the breast mass demonstrated sheets of mildly pleomorphic tumour cells arranged in a solid papillary architecture with low mitotic activity. p63 immunohistochemistry stain showed positive expression of myoepithelial cells at the periphery of the lesion and absent expression along the papillary fronds. A diagnosis of intrapapillary ductal carcinoma in situ (DCIS) was made. The tumour was also diffusely positive for oestrogen receptor (ER) and progesterone receptor (PR), but negative for human epidermal growth factor receptor 2 (HER2). These are demonstrated in Figure 1. Upon further questioning, the patient denied any risk factors for breast cancer. He has no family history of malignancies or genetic disorders such as Klinefelter syndrome. Apart from hypertension, hyperlipidaemia, and previous cerebrovascular disease from which he completely recovered, he denies any other medical problems, including those which are related to liver disease, thyroid disease, and testicular disease. He is a non-smoker and not particularly overweight. Subsequently, we proceeded with a computerised tomography (CT) scan for staging purposes. As shown in Figure 2, the scan revealed residual lesion in the right breast and unfortunately also an incidental finding of prostatic mass with bladder infiltration and local regional lymphadenopathy. The CT also showed lytic bony lesions at the L2 vertebrae body, pelvic bone, and left proximal femur. The bone scan shown in Figure 3 confirmed these lesions as metastases. His PSA at diagnosis (iPSA) was 430.7 ng/mL. A transrectal ultrasound-guided biopsy of the prostatic mass confirmed the diagnosis of prostatic adenocarcinoma with a Gleason score of 8 (4 + 4). The patient agreed to mastectomy of the right breast. The histopathology report of the residual breast mass was similar to the biopsy result of papillary DCIS which was ER/PR positive and HER2 negative. There was no microinvasive or invasive component. The surgical margin was clear. We did not perform axillary clearance or a sentinel node biopsy. We counselled the patient for genetic testing; however, he refused. The patient was started on anastrazole and subcutaneous leuprolide acetate for treatment of his breast tumour and metastatic prostate cancer. His PSA dropped significantly from 430.7 to 31.3 ng/ mL within 3 months after starting leuprolide injection. Management of Papillary DCIS in Men DCIS has been reported to represent only between 9 and 11% of all male breast cancer as male breast cancers are more commonly invasive in nature. Because of the rarity of male breast DCIS, its management is mostly extrapolated from that of the management of the female counterpart, with some notable differences in the surgical options as well as endocrine treatment, which will be discussed below. Papillary DCIS is the least common subtype of female breast DCIS, but it is the most common form of DCIS in male breast cancer. Nevertheless, as with other types of DCIS, untreated papillary DCIS has an increased risk of developing into invasive breast cancer. Therefore, surgical removal of the mass is the mainstay of treatment. For this, we feel that simple mastectomy without axillary surgery was justified as the best approach for our patient. An American Society of Clinical Oncology (ASCO) expert panel agrees that the surgical option for male breast cancer should be the same as the approach used for women. However, while the option of breast-conserving surgery (BCS) followed by radiotherapy should be discussed with patients, much like with female patients with DCIS, these options are often not practical in the majority of male breast DCIS. This is largely due to the obvious reason of a reduced amount of breast tissue in males compared to females for BCS to achieve a safe surgical margin. A large population-based study on male breast cancer reported high a rate of re-excision in patients with in situ disease who did not have a mastectomy. The rate was as high as 60%. While the no axillary surgery approach in our patient concurs with accepted international guidelines on the management of breast DCIS, such as those from the National Cancer Care Network (NCCN) and ASCO, due to the low rate of axillary metastases associated with DCIS, perhaps we should have considered sentinel lymph node biopsy in the same setting as mastectomy as there is a small possibility that an element of tumour invasiveness may be missed during biopsy. We were fortunate that the final mastectomy specimen of our patient did not reveal an invasive component. Our case concurs with literature findings that male breast cancer tumours tends to be ER/PR positive and HER2 negative. Evidence for the use of adjuvant endocrine treatment for ER-positive DCIS in female patients is well established. While use of adjuvant tamoxifen in invasive male breast cancer is justified based on the convergence of several retrospective studies on its benefit, we could not find evidence of adjuvant tamoxifen used for DCIS in male patients. The decision to embark on adjuvant endocrine treatment in our patient was due to several factors. With the presence of dual primaries, we suspected that our patient has an underlying genetic abnormality that is driving the cancer pathogenesis in him. If this is true, it would put him at higher risk of developing new contralateral breast cancer. For example, BRCA-associated male breast cancer has been reported to have poorer survival compared to its counterparts. Unfortunately, due to the patient's previous history of cerebrovascular accident, he would be at high risk of developing further thromboembolic complications from tamoxifen. The use of aromatase inhibitor alone in male breast cancer has been shown to be less effective than tamoxifen. However, a recently published result from a randomised phase II trial did show that aromatase inhibitor in combination with gonadotrophin-releasing hormone agonist (GnRHa) is more effective at reducing the level of estradiol hormone in male breast cancer patients as opposed to tamoxifen alone. Nevertheless, while the risk of aromatase inhibitor with stroke is less, the use of GnRHa does increase one's risk of stroke. Orchidectomy has been suggested as an alternative to the use of GnRHa in male breast cancer, but evidence is scarce and not enough to support the recommendation, even when it is shown to be less likely to cause stroke compared to GnRHa. The established benefit of GnRHa in effectively treating metastatic prostate cancer as well as its potential role in preventing the recurrence of breast cancer swayed the decision for the use of GnRHa with aromatase inhibitor in our patient. With recent mastectomy, orchidectomy was not considered acceptable by our patient at this moment in time, although it could perhaps be discussed again in the future. Synchronous Male Breast and Prostate Cancer It is most likely that our patient developed cancer in the prostate before the breast, given the advanced stage of prostate cancer as opposed to the early in situ stage of breast tumour at presentation. As we alluded to earlier, having prostate cancer per se does not increase the chance of developing breast cancer. As our patient denies other known risk factors for developing breast cancer, the only factor that was not investigated in him was genetic abnormalities connecting between the two primaries. It is unlikely that a germline mutation would manifest itself at an age as late as 72 years old, especially in someone with no family history of malignancies. Interestingly, up to 90% of metastatic prostate cancer patients harbour abnormal genes, either somatic or germline. Even though DNA damage repair (DDR) genes, including the BRCA gene, represent a quarter of abnormal genes in prostate cancer patients, the more common genetic abnormalities detected in them are in the AR, TP53, and RB1 genes. Furthermore, of the DDR genes, while BRCA2 mutation represents the most frequent event (up to 13% of cases), other abnormal DDR genes have also been detected in metastatic prostate cancer patients, albeit at much lower frequencies, such as the ATM, MSH2, BRCA1, FANCA, MLH1, CHEK, and PTEN genes. These other genes, such as p53, CHEK, and PTEN, also increase the risk for breast cancer. While it is tempting to blame a BRCA2 mutation as the culprit and contributory factor to our patient's dual primary in the breast and prostate, without definitive genetic testing this is only an assumption. It is not impossible that our patient harbours one of the least likely of the possible abnormal genes, or perhaps none at all. Knowing the exact genetic abnormality in a cancer patient is important in determining the prognosis, and will also have an impact on the surveillance strategy as well as treatment options. For example, castrate-resistant metastatic prostatic cancer patients who progressed after one of the new hormonal treatments would benefit from a targeted drug called olaparib if it is known that they also harbour abnormal DDR genes, especially BRCA1, BRCA2, and ATM. Conclusion Our case illustrates the importance of genetic testing in patients with dual primaries, especially so in prostate and male breast cancer as both has been associated with a high risk of harbouring numerous deleterious genetic abnormalities. Even though our patient is currently responding to treatment for his metastatic prostate cancer and his breast tumour is in remission, the exact knowledge of his underlying genetic abnormality would be important in deciding further treatment when the disease progresses. Furthermore, knowing which gene is abnormal would help in surveillance for the manifestation of another possible primary cancer associated with the specific abnormal gene. Unfortunately for now, the test is not accessible to many as it is non-reimbursable and the price is not affordable to many in our country. Much still needs to be done to increase the uptake of genetic testing among cancer patients. |
package org.sample;
import java.util.concurrent.TimeUnit;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Fork;
import org.openjdk.jmh.annotations.Measurement;
import org.openjdk.jmh.annotations.Mode;
import org.openjdk.jmh.annotations.OutputTimeUnit;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.State;
import org.openjdk.jmh.annotations.Warmup;
@State(Scope.Thread)
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
@Warmup(iterations = 3, time = 2, timeUnit = TimeUnit.SECONDS)
@Measurement(iterations = 5, time = 1, timeUnit = TimeUnit.SECONDS)
@Fork(1)
public class Inlining
{
}
|
<reponame>keithc-ca/aa
package com.cliffc.aa.type;
import com.cliffc.aa.util.SB;
import com.cliffc.aa.util.VBitSet;
import java.util.function.Predicate;
// Backwards liveness, used to gather forward use types in a reverse flow.
// Liveness is passed in TypeMems, because we support precise memory liveness.
// - TypeMem.DEAD - Value is dead
// - TypeMem.ALIVE - Value is simple, and fully alive
// - TypeMem.ESCAPE - Value is simple, and fully alive, and "escapes" into memory or a call argument
// - TypeMem[#alias]- Value is complex memory, and partially alive based on alias# and fields.
// - TypeMem[#alias]._fld = Type.XSCALAR - This field is dead
// - TypeMem[#alias]._fld = Type. SCALAR - This field is fully alive
// - TypeMem[#alias]._fld = Type.NSCALR - This field is partially alive: any display is dead, but all else is alive
public class TypeLive extends TypeObj<TypeLive> {
int _flags;
private TypeLive init(boolean any, int flags ) {
super.init("",any,any);
_flags = flags;
return this;
}
@Override int compute_hash() { return super.compute_hash() + _flags; }
@Override public boolean equals( Object o ) {
if( this==o ) return true;
if( !(o instanceof TypeLive) || !super.equals(o) ) return false;
return _flags==((TypeLive)o)._flags;
}
@Override public boolean cycle_equals( Type o ) { return equals(o); }
@Override public SB str( SB sb, VBitSet dups, TypeMem mem, boolean debug ) {
if( this==DEAD ) return sb.p("DEAD");
if( _any ) sb.p('~');
return sb.p(STRS[_flags]);
}
static { new Pool(TLIVE,new TypeLive()); }
private static TypeLive make( boolean any, int flags ) {
TypeLive t1 = POOLS[TLIVE].malloc();
return t1.init(any,flags).hashcons_free();
}
// Value is used as a call-argument, value-stored (address use is ok),
// returned, merged at a phi, folded into a funptr, etc.
private static final int FLAG_ESCAPE=1;
public boolean is_escape() { return (_flags&FLAG_ESCAPE)!=0; }
// Keeps all values alive
private static final int FLAG_WITH_DISP=2;
public boolean is_ret() { return (_flags&FLAG_WITH_DISP)!=0; }
static final TypeLive NO_DISP= make(false,0 ); // no escape, no disp
static final TypeLive ESC_DISP=make(false,FLAG_ESCAPE); // escape, no disp
static final TypeLive LIVE = make(false,FLAG_WITH_DISP); // Basic alive
static final TypeLive ESCAPE = make(false,FLAG_ESCAPE+FLAG_WITH_DISP); // Used as a call argument
public static final TypeLive LIVE_BOT=make(false,FLAG_ESCAPE+FLAG_WITH_DISP);
public static final TypeLive DEAD = LIVE_BOT.dual();
@Override protected TypeLive xdual() { return POOLS[TLIVE].<TypeLive>malloc().init(!_any,_flags); }
@Override protected Type xmeet( Type t ) {
switch( t._type ) {
case TLIVE: break;
case TARY:
case TSTR:
case TSTRUCT:return OBJ;
case TOBJ: return t.xmeet(this);
case TFUNSIG:
case TTUPLE:
case TFUNPTR:
case TMEMPTR:
case TFLT:
case TINT:
case TRPC:
case TMEM: return ALL;
default: throw typerr(t);
}
TypeLive ts = (TypeLive)t;
boolean any = _any&ts._any;
int f0 = _any ? 0 : _flags;
int f1 = ts._any ? 0 : ts._flags;
int flags = any ? (_flags&ts._flags) : (f0|f1);
return make(any,flags);
}
private static final TypeLive[] LIVES = new TypeLive[]{NO_DISP,ESC_DISP,LIVE,ESCAPE};
private static final String[] STRS = new String[]{"!dsp","esc!dsp","live","escp"};
public TypeLive lmeet( TypeLive lv ) {
if( this.above_center() ) return lv.above_center() ? (TypeLive)xmeet(lv) : lv;
if( lv .above_center() ) return this;
return LIVES[_flags|lv._flags];
}
// Widen (loss info), to make it suitable as the default function memory.
@Override public TypeObj crush() { return this; }
@Override public boolean may_be_con() { return false; }
@Override public boolean is_con() { return false; }
@Override public Type meet_nil(Type t) { return this; }
@Override public void walk( Predicate<Type> p ) { p.test(this); }
}
|
Army Reserve Specialist Joe Darby, Army Staff Sergeant Samuel Provance, and Marine Staff Sergeant Jim Massey are the kind of soldiers and marines we need to recruit in droves.
Darby, knowing what he was seeing in Abu Ghraib was wrong, said something about it and then took action to stop it. It worked.
Provance, after he was interviewed as part of the Army investigation into the abuses in part exposed by Darby’s actions, suspected a cover-up. He may have been wrong about that, but he followed his conscience in publicly saying what he heard in the 302nd Military Intelligence Battalion regarding abuses inside the prison. It worked.
After leaving the Marines, SSgt Jim Massey is speaking out about the actions he and his platoon took in Iraq, specifically in terms of civilian casualties and un-gentlemanly behavior on the battlefield. Massey’s participant account of what Iraq is really like on the ground obviously contradicts the official storyline. He is therefore a pariah.
Darby, Provance and Massey are notably NOT among the best loved of American soldiers and marines, at least within the higher reaches of the Department of Defense. If they were, you would hear about their public invitations to meet with and be congratulated by General Richard Myers and Secretary Rumsfeld. Instead, Darby has been threatened with prosecution for failing to report a crime, and Provance is now reportedly redlined for honors, awards and promotions, with his security clearance suspended. Massey is simply a guy who had problems, and still does, according to the official organs.
For those who understand how large governments tend to work, whether in the time of the Caesars and King Herod, or Stalin and Mao, or future/present times as envisioned by George Orwell, whom the state will love and whom it will hate is predictable and consistent.
The state will love the ones who do what they are told, quietly and without resistance or questions.
The state will adore the cravenly enthusiastic ones, who for a silvery piece of no-risk, no responsibility advantage over their neighbors, will do whatever the state asks, and even think up new tricks to please their master.
The state especially enjoys the morally minded ones who mistakenly put faith in the higher virtue of the state, and those who feel that somehow God guides the state in some special way unique from and above the way He guides the individual within the apparatus.
On the other hand, the state hates the noisy ones who think they are right, or have rights.
The state despises the backboned unimpressed ones, who quietly resist while doing the best work they can.
It becomes angry to the point of rage with those who suggest the state isn’t really all about all those virtues it keeps yacking about. Liberty, freedom, truth, justice and the American way, that kind of thing.
The state detests the independent ones, in part because it finds them so necessary to produce the wealth that fuels its coprophagic existence.
What is the secret of the Darbys, the Provances, and the Masseys? And if we knew those secrets, could we somehow grow more of these guys?
Instead of telling our children to try to behave like everyone else, keep their head down, don’t ask too many questions, fit in, even prescribing prescription drugs to soothe their advent into the group, maybe we should just say, "Tell me about it."
We might want to consider promoting thinking for oneself at an early age. As television induces intellectual passivity, perhaps we ought not let our children be entertained by it too often. And independence doesn’t mean mannerless children. As Claes Ryn recently pointed out, children with manners are in fact non-conforming oddities.
The public school system is dominated by the kinds of people the state likes. In particular, ber-patriotic feminized robots for whom an articulate challenge to state authority is far more sinful and dangerous than breaking any of the six or eight or ten commandments. Perhaps we ought to send our children forth only as if to battle, and barring that, find an alternative to a state indoctrination in the tender years before they are capable of fighting back.
Where did we find such men? Waynesville, North Carolina. Jenners, Pennsylvania. Williamsburg, Virginia.
I grew up in North Carolina, not far from Waynesville. My hometown of Brevard seemed small to me when I signed up with the Air Force. I bet Joe and Jimmy and Sam felt the same way at one time. But they brought the best part of community, neighborliness, and love of country with them to the Army, the Marines, to Iraq.
The state may continue to vilify them, but this will be of no account. Power that matters has never been in the wind, the earthquake or the fire, but in the still small voice. We learned this as children, reading about it as if a fable. Thanks to these humble men of honor, we have confirmation. |
<gh_stars>1-10
/**
*
* Copyright (C) 2010 Cloud Conscious, LLC. <<EMAIL>>
*
* ====================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ====================================================================
*/
package org.jclouds.azureblob.blobstore.functions;
import javax.inject.Inject;
import javax.inject.Singleton;
import org.jclouds.azureblob.domain.ContainerProperties;
import org.jclouds.blobstore.domain.MutableStorageMetadata;
import org.jclouds.blobstore.domain.StorageMetadata;
import org.jclouds.blobstore.domain.StorageType;
import org.jclouds.blobstore.domain.internal.MutableStorageMetadataImpl;
import org.jclouds.domain.Location;
import com.google.common.base.Function;
import com.google.common.base.Supplier;
/**
* @author <NAME>
*/
@Singleton
public class ContainerToResourceMetadata implements Function<ContainerProperties, StorageMetadata> {
private Supplier<Location> defaultLocation;
@Inject
ContainerToResourceMetadata(Supplier<Location> defaultLocation) {
this.defaultLocation = defaultLocation;
}
public StorageMetadata apply(ContainerProperties from) {
MutableStorageMetadata to = new MutableStorageMetadataImpl();
to.setName(from.getName());
to.setLocation(defaultLocation.get());
to.setETag(from.getETag());
to.setLastModified(from.getLastModified());
to.setUri(from.getUrl());
to.setType(StorageType.CONTAINER);
to.setUserMetadata(from.getMetadata());
return to;
}
}
|
<reponame>john-chidrupaya/openPOWERLINK_V2<gh_stars>0
/**
********************************************************************************
\file pcap-console.c
\brief Implementation of PCAP functions for console applications
This file provides functions which help console applciations using the PCAP
library.
\ingroup module_app_common
*******************************************************************************/
/*------------------------------------------------------------------------------
Copyright (c) 2014, Bernecker+Rainer Industrie-Elektronik Ges.m.b.H. (B&R)
Copyright (c) 2013, SYSTEC electronic GmbH
Copyright (c) 2013, Kalycito Infotech Private Ltd.All rights reserved.
All rights reserved.
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 the copyright holders 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 COPYRIGHT HOLDERS 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.
------------------------------------------------------------------------------*/
// todo how could we remove that?
#if (TARGET_SYSTEM == _WIN32_)
#define _WINSOCKAPI_ // prevent windows.h from including winsock.h
#endif // (TARGET_SYSTEM == _WIN32_)
//------------------------------------------------------------------------------
// includes
//------------------------------------------------------------------------------
#include <oplk/oplk.h>
#include <pcap.h>
//============================================================================//
// G L O B A L D E F I N I T I O N S //
//============================================================================//
//------------------------------------------------------------------------------
// const defines
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// module global vars
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// global function prototypes
//------------------------------------------------------------------------------
//============================================================================//
// P R I V A T E D E F I N I T I O N S //
//============================================================================//
//------------------------------------------------------------------------------
// const defines
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// local types
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// local vars
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// local function prototypes
//------------------------------------------------------------------------------
//============================================================================//
// P U B L I C F U N C T I O N S //
//============================================================================//
//------------------------------------------------------------------------------
/**
\brief Select PCAP device
With this function the PCAP device to be used for openPOWERLINK is selected
from a list of devices.
\param pDevName_p Pointer to store the device name which should be
used.
\return The function returns a tOplkError error code.
*/
//------------------------------------------------------------------------------
tOplkError selectPcapDevice(char* pDevName_p)
{
char sErr_Msg[ PCAP_ERRBUF_SIZE ];
pcap_if_t* alldevs;
pcap_if_t* seldev;
int i = 0;
int inum;
/* Retrieve the device list on the local machine */
if (pcap_findalldevs(&alldevs, sErr_Msg) == -1)
{
fprintf(stderr, "Error in pcap_findalldevs: %s\n", sErr_Msg);
return kErrorNoResource;
}
PRINTF("--------------------------------------------------\n");
PRINTF("List of Ethernet Cards Found in this System: \n");
PRINTF("--------------------------------------------------\n");
for (seldev = alldevs; seldev != NULL; seldev = seldev->next)
{
PRINTF("%d. ", ++i);
if (seldev->description)
{
PRINTF("%s\n %s\n", seldev->description, seldev->name);
}
else
{
PRINTF("%s\n", seldev->name);
}
}
if (i == 0)
{
PRINTF("\nNo interfaces found! Make sure pcap library is installed.\n");
return kErrorNoResource;
}
PRINTF("--------------------------------------------------\n");
PRINTF("Select the interface to be used for POWERLINK (1-%d):",i);
if (scanf("%d", &inum) == EOF)
{
pcap_freealldevs(alldevs);
return kErrorNoResource;
}
PRINTF("--------------------------------------------------\n");
if ((inum < 1) || (inum > i))
{
PRINTF("\nInterface number out of range.\n");
pcap_freealldevs(alldevs);
return kErrorNoResource;
}
/* Jump to the selected adapter */
for (seldev = alldevs, i = 0; i < (inum - 1); seldev = seldev->next, i++)
{ // do nothing
}
strncpy(pDevName_p, seldev->name, 127);
return kErrorOk;
}
//============================================================================//
// P R I V A T E F U N C T I O N S //
//============================================================================//
/// \name Private Functions
/// \{
///\}
|
"""
Extension functions for parsing sys.argv.
Commands:
get_args -- load all command-line arguments after the last --
into $arg1...$argN.
"""
from twill import log, namespaces, shell
__all__ = ['get_args']
def get_args(require=0):
""">> get_args [<require>]
Load the command line arguments after the last '--' into $arg1...$argN,
optionally requiring at least 'require' such arguments.
"""
global_dict, local_dict = namespaces.get_twill_glocals()
require = int(require)
if len(shell.twillargs) < require:
from twill.errors import TwillAssertionError
given = len(shell.twillargs)
raise TwillAssertionError(
f"too few arguments; {given} rather than {require}")
if shell.twillargs:
for n, arg in enumerate(shell.twillargs, 1):
global_dict[f"arg{n}"] = arg
n = len(shell.twillargs)
log.info("get_args: loaded %d args as $arg1..$arg%d.", n, n)
else:
log.info("no arguments to parse!")
|
The United Arab Emirates has said it will crack down on the trafficking of Asian child camel jockeys, a practice internationally condemned as a form of slavery.
Rights groups say several thousand boys, some as young as four, work as jockeys in the lucrative sport in the oil-rich Gulf Arab state.
They say the boys are kept in prison-like conditions where they are deliberately underfed to keep them light so the camels run faster. The children race at speeds of up to 50km an hour in the sport popular among Beduins.
A new law will tighten an existing ban on using boys under 16 or those weighing less than 45kg, the state news agency WAM reported on Monday.
The weight limit is aimed at preventing boys being brought in on false passports with the wrong age.
The children are often abducted or sold by their families. Most are from the Indian subcontinent.
"The desire at a high level to combat this is obvious, especially since it became clear that it was a bigger problem than we thought," said a government official in Dubai.
The new law will address "loopholes" in past legislation, he said, but did not elaborate.
Anyone violating the new regulations will face "stiff legal measures", WAM quoted UAE Deputy Prime Minister Shaikh Hamdan bin Zayid Al Nahyan as saying. He did not explain what these would be.
Air and sea ports will have strict instructions to prevent young boys entering the country for the sport, he said.
London-based Anti-Slavery International said last year it had photographs to prove young boys were still racing camels, despite a 2002 government ban. It called for proper inspections and prosecution of those trafficking and employing the boys.
"The desire at a high level to combat this is obvious, especially since it became clear that it was a bigger problem than we thought"
Rights group Amnesty International called on the UAE to fully uphold a global convention on the rights of children.
"More importantly the government has to open investigations into allegations raised by non-governmental organisations with respect to trafficking or the ill-treatment of these children," said spokeswoman Nicole Choueiry in London.
The United States has said it hopes UAE efforts to combat the trade will also encourage a similar ban in other Gulf countries, where thousands more boys are thought to work.
International scrutiny has led the UAE to set up a rehabilitation centre in the capital of Abu Dhabi for boy jockeys, the government official said. |
RELIGIOUS IDENTITIES IN LIQUID MODERNITY: POSTISLAM Postislam has been regarded as a new concept in need of a dire delineation. Basically, a Postislamic tendency is a paradigm of thought (philosophical, scientific, mystical, religious, theological2, etc.) that excessively transcends at least one of the three sources of Islams juridical Canons (i.e. Quran, Sunna, Ijma or consensus of Scholars). This paper provides a definition for the founding principles of Postislam. It shall examine this concept from a generic point of view. It will equally suggest a constellation of some central problems structuring an emergent system: Postislam. This tendency is positively inherent in potentiality (dunamis), in an Aristotelian sense, according to multiple forms of enunciations and semantic variations throughout the history of theology as well as the history of philosophy, theology, Islamic mystique and science. Postislam represents a potentiality devoid of a preexisting concept within Islam; it is an unnamed historical tenant, disseminated throughout a complex combination of theological and mystical first faltering steps. I will examine some of these instantiations, expressed essentially in Islamic theology (Avicennas Metaphysics of Emanation) and mystical tradition (i.e. Sufism in a general acceptance, and the nodal case of Al-Hallj, in particular). Then, by isolating the essence of Islams theological mystique (the structural duality between Shara and Haqqa, Law and Truth), in order to construct a synthetic deconstruction identified to the concept of Postislam as pure mysticism, or the possibility a of a permanent theophany, indefinitely experienced throughout ecstatic theopathy. We ought to, at this step, enunciate divers axioms based on this concept. As a sequel, I will discuss further philosophical counterpoints and limits to this construction. |
Comfort Driven Redesign Methods: An Application to MattressesProduction Systems The definitions of methods and tools used to evaluate how workers perceive the comfort during their activities remains an open problem at this time. Many researchers have dealt with that problem in the last twenty years, focusing their efforts primarily on the automotive sector and on VDT workstation comfort. This paper analyzes how workers position themselves at workstations used in industrial processes that sew together the edges of mattresses. The aim of the analysis is to determine whether workers can position themselves in ways that allow them to carry out activities in simple and economical ways. The Strain Index was used to identify the most critical and risky work phases in order to evaluate workers' risk of biomechanical overload. The OCRA checklist was used to evaluate the overall risk level associated with repeated completions of the total cycle of work and to develop a virtual-postural analysis to evaluate workers' perceived levels of discomfort. For the virtual-postural analysis, DELMIA software was used to virtually model a workstation, and records of activities and the postures associated with various repetitive actions were gathered in a non-invasive manner with cameras and video cameras. CaMAN software developed by the researchers from the Department of Industrial Engineering in Salerno (Italy) was used to calculate comfort indexes. An analysis of the comfort indexes was used to make as the basis for suggestions to correct workers' postures and for plans to redesign the workstations in order to improve ergonomics and allow workers to perceive them as more comfortable. |
<filename>android/src/com/freshplanet/ane/AirFacebook/functions/GetProfileFunction.java
package com.freshplanet.ane.AirFacebook.functions;
import com.adobe.fre.FREContext;
import com.adobe.fre.FREFunction;
import com.adobe.fre.FREObject;
import com.facebook.Profile;
import com.freshplanet.ane.AirFacebook.AirFacebookExtension;
public class GetProfileFunction implements FREFunction {
public FREObject call(FREContext context, FREObject[] args)
{
AirFacebookExtension.log("GetProfileFunction");
Profile profile = Profile.getCurrentProfile();
if (profile != null){
try {
FREObject result = FREObject.newObject("com.freshplanet.ane.AirFacebook.FBProfile", null);
result.setProperty("firstName", FREObject.newObject(profile.getFirstName()));
result.setProperty("lastName", FREObject.newObject(profile.getLastName()));
result.setProperty("linkUrl", FREObject.newObject(profile.getLinkUri().toString()));
result.setProperty("middleName", FREObject.newObject(profile.getMiddleName()));
result.setProperty("name", FREObject.newObject(profile.getName()));
result.setProperty("refreshDate", null);
result.setProperty("userID", FREObject.newObject(profile.getId()));
return result;
} catch(Exception e) {
e.printStackTrace();
AirFacebookExtension.log("GetProfileFunction ERROR " + e.getMessage());
return null;
}
}
return null;
}
}
|
N6-methyladenosine-related single-nucleotide polymorphism analyses identify oncogene RNFT2 in bladder cancer Background Single-nucleotide polymorphisms (SNPs) in N6-methyladenosine (m6A) related genetic locus play significant roles in tumorigenesis and development. The expression level of many oncogenes and tumour suppressor genes changed because of m6A-associated SNPs. In addition, the relationship between m6A-SNP and bladder cancer (BCa) has not been well studied. Methods We screened m6A-SNPs in BCa by combining m6A-SNPs data and GWAS-SNPs data. Expression quantitative trait loci (eQTL) and differential expression gene (DEGs) analyses were performed. In ring finger protein, transmembrane 2 (RNFT2), rs3088107 (C >G) was found to have significant eQTL signals and make RNFT2 gene differentially-regulated mostly in BCa. We validated the expression level of RNFT2 in 32 pairs of BCa tissues and eight BCa cell lines by quantitative real-time PCR (qRT-PCR). Functional assays were performed to investigate the role of rs3088107 and RNFT2 in BCa in vitro. Results We identified 673 m6A-SNPs, which were associated with BCa. Of these m6A-SNPs, 221 showed eQTL signals, amongst which, rs3088107 in RNFT2 showed significant eQTL signals. Results of bioinformatic analyses showed that 11 genes with m6A-SNPs had a differential expression level in BCa. RNFT2 was predicted to be significantly up-regulated in BCa. The qRT-PCR results validated that RNFT2 was highly expressed in our own BCa tissues and cell lines. High expression of RNFT2 also indicated a worse overall survival. We also revealed that rs3088107 (C >G) could inhibit the expression and m6A modification of RNFT2 by qRT-PCR, western-blot and m6A-RIP assays. Moreover, the results of functional assays indicated that RNFT2 promoted BCa cell proliferation and migration. Conclusion This research found that m6A-SNPs were associated with oncogene RNFT2 in BCa. Furthermore, m6A-SNPs showed great application potential as a new BCa diagnostic biomarker and prognostic indicator. Supplementary Information The online version contains supplementary material available at 10.1186/s12935-022-02701-z. with NMIBC have a higher 5-year survival rate than those with MIBC. However, NMIBC patients tend to relapse frequently, particularly those with high-grade urothelial carcinoma. At present, effective biomarkers in the diagnosis and treatment of BCa are still lacking. Etiological research has revealed that genetic variations play a crucial role in BCa tumorigenesis and development. As an important genetic variation, singlenucleotide polymorphisms (SNPs) cannot be ignored during BCa development. Considering the increasing number of in-depth research on genome-wide association studies (GWAS), numerous BCa-associated SNPs have been found. In 2008, many SNPs were found to be related to BCa by GWAS. Amongst these, rs9642880 on chromosome 8q24, which was located near the c-Myc gene, showed the most significant relevance. Based on previous studies, SNPs can affect gene expression in a number of ways. In addition to the effects of amino acids, some changes in post-transcriptional modifications cannot be ignored. N6-methyladenosine (m6A) modification, a methylation at the adenosine N6 position, is the abundant modification form in human. RNA m6A modification is dynamically regulated by demethylases (writers) and methyltransferases (erasers). The m6A modification can be recognised by a set of RNA-binding proteins (readers). The metabolism, function and localisation of RNA can be influenced by m6A modifications. By altering the expression and function of some oncogenes and tumour suppressor genes, m6A modifications can affect the occurrence and progression of multiple tumours. Many cancer-associated signalling pathways are activated and inhibited by m6A modifications. During the m6A modification process, the m6A regulators like METTL3/METTL14 proteins could recognize and methylate the DRACH motif (D = A, G, U; R = A, G; H = A, C, U) in RNA sequence, which we call m6A sites. However, when the base of DRACH motif has an SNP mutation, m6A regulators can't recognize these motifs properly and the process of m6A modification will be affected. Therefore, m6A-SNPs are considered as a critical type of genetic variations, which can affect the development of many diseases, particularly cancers. The identification of BCa associated with m6A-SNPs can provide comprehensive understanding of the underlying mechanism of BCa and help us to find effective diagnostic biomarkers and therapeutic targets. In this research, we identified 673 SNPs by combining m6A-SNPs data and BCa GWAS-SNPs data. After expression quantitative trait loci (eQTL) were performed, rs3088107 (C > G) in 3'-UTR region of Ring finger protein, transmembrane 2 (RNFT2) was found to have significant eQTL signals. The expression level of RNFT2 was found to be up-regulated in BCa by bioinformatic and experimental methods. And we also revealed that rs3088107 (C > G) could decrease the expression and m6A modification of RNFT2 by bioinformatic analyses and experiments. In vitro functional assays validated that RNFT2 could promote BCa cell proliferation and migration. Identification of BCa-associated m6A-SNPs We first searched for BCa-SNPs in the GWAS Catalog website (https:// www. ebi. ac. uk/ gwas/) to determine m6A-SNPs related to BCa. We downloaded the list of M6A-SNPs from the m6AVar database (http:// m6avar. renlab. org/ help. html) to identify M6A-SNPs amongst these SNPS. By combining the GWAS summary data set with the m6A-SNPS list and setting P < 0.05 as the filtering condition, we found the m6A-SNPs associated with BCa. Expression quantitative trait loci analysis of BCa-associated m6A-SNPs BCa-related m6A-SNPs may affect RNA modification; thus, they may take effect by regulating gene expression. We conducted a search of cis-eQTL analyses using public data through the HaploReg browser to find whether or not m6A-SNPs change the expression of local genes (https:// pubs. broad insti tute. org/ mamma ls/ haplo reg/ haplo reg. php). P < 0.05 was considered statistically significant. Differential expression analysis The corresponding genes of the identified eQTL m6A-SNPs were further evaluated on the basis of the differential expression between the BCa patients and control group. Thus, the GSE166716 (n = 24) datasets from the GEO database (https:// www. ncbi. nlm. nih. gov/ geo/) and the TCGA datasets were downloaded and analysed using R software. In addition, immunohistochemical datasets were retrieved from The Human Protein Atlas (HPA) database (https:// www. prote inatl as. org/). Patient samples and cell lines A total of 32 pairs of BCa tissues used in this study were obtained from patients who underwent radical surgery between 2014 to 2019 at the First Affiliated Hospital of Nanjing Medical University. All human-associated tissues used in this research were approved by the Ethics Committee of The First Affiliated Hospital of Nanjing Medical University. The informed consent has been signed by all patients before their tissues were acquired. The BCa cell lines (5637, BIU87, RT4, UMUC3, J82 and T24) and normal urothelial cell line (SV-HUC) were collected from the Type Culture Collection of the Chinese Academy of Sciences (Shanghai, China). Immunohistochemistry Paraffin-embedded tumors from BCa patients were sliced to 4 mm slides. The different grades of ethanol were used to rehydrate the tissue slides. Then we isolated the antigen by utilizing a microwave. The slides were dipped in 3% H 2 O 2 and then incubated with RNFT2 antibody at 4 °C overnight. The slides were treated with the HRPconjugated antibody. The results were observed with a microscope. The degree of positivity was identified by at least two pathologists according to the proportion of positive tumor cells. Cell culture and transfection UMUC3 and T24 cells were cultured in DMEM medium (Gibco, USA) with 10% foetal bovine serum (BI, Israel). We maintained the cells in a 37 °C constant-temperature incubator containing 5% CO 2. Rs3088107 wild (C) or mutant (G) vectors and RNFT2 small-interfering RNAs (siRNAs) were purchased from GenePharma (GenePharma, Shanghai, China). The UMUC3 and T24 cells grown to 60% confluence in sixwell plates were transfected with relative vectors or siRNAs by using the Lipofectamine 3000 kit (Invitrogen, USA). RNA isolation and quantitative real-time PCR (qRT-PCR) RNAs were extracted from BCa tissues and cells by using a Trizol reagent (Invitrogen, USA). Then, RNAs were reversely transcripted into cDNAs using HiScript II (Vazyme, China). QRT-PCR experiments were applied using the StepOne Plus Real-Time PCR system (Applied Biosystems, USA). -actin was used as internal control. The primers were purchased from TsingKe (TsingKe, Nanjing, China), which are listed in Additional file 1: Table S1. Protein extraction and Western-blot We lysed the cells or tissues via using RIPA buffer (Sigma, USA). We quantified the concentrations of protein extractions by bicinchoninic acid (BCA) assays (Beyotime, China). Then we isolated and transferred the protein to polyvinylidene fluoride (PVDF) membrane (Millipore, USA) via SDS-PAGE. After blocked by using 5% skim milk, the PVDF membrane was incubated with primary (Protech, USA) and secondary antibodies (Protech, USA). Chemiluminescence (Bio-Rad, USA) and Image Lab Software were used to evaluate the expression level of proteins. Prediction of m6A modification We predicted the m6A modification level of RNFT2 3'-UTR region with or without rs3088107 by using SRAMP database (http:// www. cuilab. cn/ sramp/). We imported the 3'-UTR sequence before and after rs3088107 occurrence into the database, which then could predict the m6A modification level based on the potential DRACH motif (D = A, G, U; R = A, G; H = A, C, U) in the sequence. M6A modifcation quantifcation of RNA We measured the total RNA m6A modification level by using the epiQuik m6A RNA methylation quantifcation kit (Epigentek Group Inc, USA). Specifically speaking, we added 200 ng RNA into each well loaded with binding solution. After incubating for 90 min, we added capture antibody reagent, detection antibody reagent and enhancer reagent into all wells in turn. The absorbance was measured with 450 nm wavelength. The m6A content of total RNA were calculated with a standard curve. M6A RNA immunoprecipitation assay (MeRIP) 293 T cells which transfected with either the rs3088107 wild (C) vectors or mutant (G) vectors were treated with DNase I (Sigma Aldrich, USA). Then we fragmented RNAs by sonication for 15 s on an ice water mixture. Immunoprecipitations of RNAs fragments were applied via anti-m6A antibody (1:1000, Abcam, USA) which was previously treated with protein A/G beads (Life Technologies, USA) by using Magna RIP Kit (Millipore, MA). We then treated the samples with Proteinase K (20 mg/ml) at 42 °C for 1.5 h. After washing the samples several times, the RNAs were extracted with phenol: chloroform: isoamyl alcohol. The qRT-PCR was used to assess the level of RNFT2, which normalizing to input. Cloning formation UMUC3 or T24 cells were seeded at 1000 cells per well in six-well plates. After 10 days, we fixed the cell colonies using 4% paraformaldehyde. Then, the fixed cell colonies were stained by 0.1% crystal violet. We calculated the cell colonies using Image J software. Scratch wound healing assay After being grown over 90% confluence in six-well plates, the monolayer UMUC3 or T24 cells were scraped off by using a 200 L pipette tip. Then, the cells were cultured in a serum-free medium. Cells were imaged using a microscope (Olympus, Japan) at 0 and 48 h. The migration rate was calculated using a formula based on the distance travelled by cells divided by the starting distance. Transwell assays A total of 20,000 UMUC3 or T24 cells were seeded in the upper chamber (Corning, USA) of the transwell system with 200 L of serum-free medium to investigate the migration ability. In the meantime, 600 L of medium with 10% FBS was added into the lower chamber. The cells of top chambers were fixed with 4% paraformaldehyde for 15 min after 48 h. Then, we stained the cells for 30 min by using 0.5% crystal violet. We visualised and photographed the cells in the upper chamber using an Olympus microscope. Statistical analysis SPSS version 22.0 (IBM Corp., Armonk, NY, USA) was used to analyse the data. The results were presented as mean ± standard deviation (means ± SD). We investigated the differences amongst different groups by using Student's t-test and one-way ANOVA test. The Kaplan-Meier method was used to analyse the overall survival. When P values were less than 0.05, the results were considered statistically significant. BCa-associated m6A-SNPs By taking the intersection of 9293071 BCa-SNPs downloaded from the GWAS Catalog website and 860176 m6A-SNPs downloaded from the m6AVar Database, a total of 673 BCa-associated m6A-SNPs were obtained (Fig. 1). The identities of the 9293071 BCa-SNPs and 860176 M6A-SNPs were listed in Additional file 2: Table S2. eQTL analysis In the next step, we performed eQTL analysis on the 673 BCa-associated m6A-SNPs. The results showed that 221 m6A-SNPs had significant eQTL signals including rs3088107 (P < 0.05, Additional file 3: Table S3, Additional file 4: Figure S1A). In addition, we found 89 BCa-associated m6A-SNPs located in introns, 34 located in CDS, 31 located in 3'-UTR, 15 located in exons and four located in 5-UTR (Additional file 4: Figure S1B). The top 20 m6A-SNPs with significant eQTL signals were shown in Table 1 by p-value ascending order, among which 17 m6A-SNPs led to a loss of m6A function, and three led to a gain of m6A function. Differential expression analysis The detailed positions and the local genes (the host genes where the SNPs occur) of the 221 BCa-m6A-SNPs were investigated by m6AVar database (Additional file 3: Table S3). We confirmed the expression levels of the local genes by integrating and analysing the TCGA BLCA (n = 19) and GSE166716 (n = 12) datasets. Eleven genes were dysregulated in both two datasets ( Fig. 2A). Amongst the 11 dysregulated genes with identified eQTL m6A-SNPs, three genes were up-regulated in BCa tissues, whereas eight were down-regulated ( Table 2). Ten of which had m6A function loss, whereas only one had m6A function gain (Table 2). Studies have shown that m6A modification affects the posttranscriptional modification and translation of genes by locating in the 3'-UTR region. Of the three upregulated genes, RNFT2 showed this potential. The detailed position of rs3088107 in chromosome 12 was investigated. And the result confirmed that it was located in the 3'-UTR region of the RNFT2 gene ( Fig. 2B and C). The expression of RNFT2 was found to be up-regulated in BCa tissues compared with normal tissues by analysing TCGA BLCA (n = 19) and GSE166716 (n = 12) datasets (Fig. 2D). The protein level of RNFT2 was confirmed to be up-regulated in BCa tissues compared with normal tissues by using the HPA database (Fig. 2E). And we also confirmed the expression level of RNFT2 in our own BCa samples by immunohistochemistry (IHC) method. The results showed RNFT2 was highly expressed in BCa tissues when compared with adjacent normal tissue (Fig. 2F). RNFT2 was up-regulated in BCa tissues and cell lines and associated with poor prognosis We detected the expression level of RNFT2 in 32 pairs of BCa tissues. The expression of RNFT2 was significantly up-regulated in BCa tissues compared with adjacent normal tissues ( Fig. 3A and B). Prognostic analysis was performed. And the high RNFT2 expression group showed poor overall survival (Fig. 3C). While there was no significant correlation between RNFT2 and other clinicopathological parameters like age, gender, tumor size, tumor node metastasis (TNM) stage, and Histological grade (Table 3). We also investigated the expression level of RNFT2 in BCa cell lines. We found that RNFT2 was up-regulated in six BCa cell lines when compared with normal urothelial cell line (SV-HUC) (Fig. 3D). SNP rs3088107 inhibited the expression and m6A modification of RNFT2 The occurrence rate of rs3088107 in 15 BCa samples were investigated by Sanger sequencing. Among them, 9 samples were C allele and 6 samples were G allele. Due to the limited sample size, the effect of rs3088107 on the expression of RNFT2 in BCa tissues and the prognosis of BCa patients did not show a significant trend. However, the mean expression of RNFT2 in samples with C Allele was higher than that in samples with G allele (Additional file 5: Figure S2A). The mean survival of patients with C allele was worse than that of patients with G allele (Additional file 5: Figure S2B). There was no significant correlation between rs3088107 and other clinicopathological parameters like age, gender, tumor size, TNM stage, and Histological grade (Table 4). We transfected the wild rs3088107 vectors (C) and mutant rs3088107 vectors (G) into the UMUC3 and T24 cells. After 48 h, we validated the expression of RNFT2 via qRT-PCR and western-blot. The results showed that UMUC3 and T24 cells transfected with wild vectors (C) had higher expression level of RNFT2 compared with cells transfected with mutant vectors (G) (Fig. 4A-B). Through analyzing by SRAMP, we found the m6A modification of RNFT2 3'-UTR region was decreased because of SNP rs3088107 (C > G) (Fig. 4C). Then we transfected the wild rs3088107 vectors (C) and mutant rs3088107 vectors (G) into the 293 T cells in order to perform the RNA m6A modification quantification assay and meRIP assay. The result of the m6A modification quantification assay showed that SNP rs3088107 (C > G) decreased the whole m6A modification level of RNA (Fig. 4D). And the result of meRIP indicated that SNP rs3088107 could inhibit the m6A modification of RNFT2 (Fig. 4E). SNP rs3088107 inhibited the proliferation and migration of BCa cells in vitro We transfected the wild rs3088107 vectors (C) and mutant rs3088107 vectors (G) into the UMUC3 and T24 cells. The results of CCK-8 assays revealed that the rs3088107 mutant (G allele) inhibit the proliferation ability of UMUC3 and T24 cells (Fig. 5A). Cloning formation experiments also indicated that rs3088107 mutant (G allele) could decrease the colony numbers of UMUC3 and T24 cells (Fig. 5B). In addition, we performed scratch wound healing assays and transwell assays. The results revealed that the rs3088107 mutant (G allele) could inhibit the migration rate of UMUC3 and T24cells ( Fig. 5C and D). RNFT2 promoted the proliferation and migration of BCa cells in vitro We transfected RNFT2 siRNAs into UMUC3 and T24 cells. The transfection efficiency was verified by qRT-PCR (Fig. 6A). We conducted functional assays to study the role of RNFT2 in vitro. The results of CCK-8 assays revealed that the knockdown of RNFT2 could inhibit the proliferation ability of UMUC3 and T24 cells (Fig. 6B). Cloning formation experiments also indicated that RNFT2 knockdown could decrease the colony numbers of UMUC3 and T24 cells (Fig. 6C). In addition, we performed scratch (See figure on next page.) Fig. 6 RNFT2 promoted the progression of UMUC3 and T24 cells in vitro. A The efficiency of RNFT2 si RNA transfection in UMUC3 and T24 cells (***P < 0.001, Student's t-test). B CCK8 assay showed RNFT2 knockdown could inhibit UMUC3 cells proliferation (**P < 0.05, Student's t-test). C Colony formation assay showed RNFT2 knockdown could inhibit UMUC3 and T24 cells colony formation (**P < 0.05, ***P < 0.001, Student's t-test). D Scratch wound healing assays indicated that RNFT2 knockdown could inhibit the migration rate of UMUC3 and T24 cells (*P < 0.05, **P < 0.01, ***P < 0.001, Student's t-test). E Transwell assays revealed that RNFT2 knockdown could inhibit the migration rate of UMUC3 and T24 cells (**P < 0.01, ***P < 0.001, Student's t-test). Data are mean ± SD, n = 3 wound healing assays and transwell assays. The results revealed that the knockdown of RNFT2 could inhibit the migration rate of UMUC3 and T24cells ( Fig. 6D and E). Discussion BCa is a common cancer in the urinary system, which is also considered as the most common malignancy worldwide. About 573,000 new cases were diagnosed with BCa, and 213,000 cases died of BCa every year. The occurrence and progression of BCa are a process of multimutation. At present, no suitable target has been found to guide the diagnosis and treatment of BCa. Given its high incidence and complex aetiology, finding effective diagnostic and therapeutic biomarkers is necessary. RNA modifications have been reported as targets of many cancer-related cascades, which play a crucial role in regulating gene expression. This process may result in tumorigenesis and metastasis. M6A is an important and dominant process in RNA modifications. M6A modification regulates molecular functions by mediating multiple steps of RNA processing such as RNA maturation, nuclear transport, RNA stability, splicing, translation and protein binding. In addition, many m6A modifications on tumour-related genes directly affect tumour development and drug resistance. Therefore, mutations occurring at the DRACH motif (D = A, G, U; R = A, G; H = A, C, U) may affect the entire modification and further interfere with the expression of some important genes. As a common form of genetic mutation, SNPs may occur at any region of genes. m6A-SNPs could occur in sites close to the methylation regions. It can also occur directly in the m6A modification sites. If m6A methylation was disturbed by SNP mutations, then many biological functions and pathways would be influenced. Many m6A-SNPs, which were missense mutations, could intervene the transcription process. Some m6A-SNPs appear in UTRs or regions near stop codons, which can affect the binding of transcriptional regulators and RNA-binding proteins. Consequently, the stability and nuclear transport will be affected by this process. Moreover, m6A-SNPs could change the amino acid sequence and alter the secondary structure of proteins. Therefore, m6A-SNPs are associated with many diseases, including cancers. Based on previous report, m6A-SNPs could inhibit the expression of SOD2 through binding hnRNPC. However, as a multi-gene mutated disease, several m6A-SNPs remain unclear in BCa. In this study, we screened out BCa-associated m6A-SNPs by integrating BLCA GWAS SNPs data and m6Avar data. In addition, a total of 673 m6A-SNPs was acquired, which were associated with BCa (P < 0.05). Further eQTL analysis was performed to screen for m6A-SNPs, which could influence the expression levels of local genes. A total of 221 BCa-associated m6A-SNPs showed significant eQTL signals. Amongst which, rs3088107 in Ring finger protein, transmembrane 2 (RNFT2) had significant eQTL signals, which means it can influence the expression of RNFT2. In order to figure out how rs3088107 regulated RNFT2, we performed necessary experiments. The results confirmed rs3088107 can attenuate the m6A modification and expression of RNFT2. The decreased expression of RNFT2 may be caused by m6A modification of 3'-UTR which could decrease the stability of mRNA induced by rs3088107. We confirmed the high expression level of RNFT2 in BCa tissues and cell lines. Further functional assays also indicated that RNFT2 could promote BCa cell proliferation and migration, while rs3088107 inhibited the proliferation and migration of BCa. So as a tumor suppressor SNP rs3088107 and an oncogene RNFT2 were identified. RNFT2, which is located on chromosome 12, encodes a protein formed with 444 amino acids. As a member of the ring finger family, RNFT2 was reported to participate in proteolytic process. Research on RNFT2 was limited at least for now. It has been revealed that RNFT2 could inhibit inflammation response via influencing ubiquitination of IL-3Ra. In the oncology field, the expression of RNFT2 in gastric cancer tissues was found positively associated with poor prognosis and high recurrence rates. While in BCa, the function of RNFT2 had not been studied before. Conclusions We demonstrated the role of RNFT2 as an oncogene in BCa for the first time. We confirmed that SNP rs3088107 (C > G) could interfere the m6A modification in RNFT2 which could furtherly inhibit the expression of it. Therefore, RNFT2, which has a functional m6A-SNP, shows significant application potential as a diagnostic and therapeutic target in BCa. |
#! /usr/bin/python3
# -*- coding: utf-8 -*-
# check_async_code.py
# A simple script to identify a common error which causes silent failures under
# MicroPython (issue #3241).
# This is where a task is declared with async def and then called as if it were
# a regular function.
# Copyright <NAME> 2017
# Issued under the MIT licence
import sys
import re
tasks = set()
mismatch = False
def pass1(part, lnum):
global mismatch
opart = part
sysnames = ('__aenter__', '__aexit__', '__aiter__', '__anext__')
# These are the commonest system functions declared with async def.
# Mimimise spurious duplicate function definition error messages.
good = True
if not part.startswith('#'):
mismatch = False
part = stripquotes(part, lnum) # Remove quoted strings (which might contain code)
good &= not mismatch
if part.startswith('async'):
pos = part.find('def')
if pos >= 0:
part = part[pos + 3:]
part = part.lstrip()
pos = part.find('(')
if pos >= 0:
fname = part[:pos].strip()
if fname in tasks and fname not in sysnames:
# Note this gives a false positive if a method of the same name
# exists in more than one class.
print('Duplicate function declaration "{}" in line {}'.format(fname, lnum))
print(opart)
print()
good = False
else:
tasks.add(fname)
return good
# Strip quoted strings (which may contain code)
def stripquotes(part, lnum=0):
global mismatch
for qchar in ('"', "'"):
pos = part.find(qchar)
if pos >= 0:
part = part[:pos] + part[pos + 1:] # strip 1st qchar
pos1 = part.find(qchar)
if pos > 0:
part = part[:pos] + part[pos1+1:] # Strip whole quoted string
part = stripquotes(part, lnum)
else:
print('Mismatched quotes in line', lnum)
mismatch = True
return part # for what it's worth
return part
def pass2(part, lnum):
global mismatch
opart = part
good = True
if not part.startswith('#') and not part.startswith('async'):
mismatch = False
part = stripquotes(part, lnum) # Remove quoted strings (which might contain code)
good &= not mismatch
for task in tasks:
sstr = ''.join((task, r'\w*'))
match = re.search(sstr, part)
if match is None: # No match
continue
if match.group(0) != task: # No exact match
continue
# Accept await task, await task(args), a = await task(args)
sstr = ''.join((r'.*await[ \t]+', task))
if re.search(sstr, part):
continue
# Accept await obj.task, await obj.task(args), a = await obj.task(args)
sstr = ''.join((r'.*await[ \t]+\w+\.', task))
if re.search(sstr, part):
continue
# Accept assignments e.g. a = mytask or
# after = asyncio.after if p_version else asyncio.sleep
# or comparisons thistask == thattask
sstr = ''.join((r'=[ \t]*', task, r'[ \t]*[^(]'))
if re.search(sstr, part):
continue
# Not awaited but could be passed to function e.g.
# run_until_complete(mytask(args))
sstr = ''.join((r'.*\w+[ \t]*\([ \t]*', task, r'[ \t]*\('))
if re.search(sstr, part):
sstr = r'run_until_complete|run_forever|create_task|NamedTask'
if re.search(sstr, part):
continue
print('Please review line {}: async function "{}" is passed to a function.'.format(lnum, task))
print(opart)
print()
good = False
continue
# func(mytask, more_args) may or may not be an error
sstr = ''.join((r'.*\w+[ \t]*\([ \t]*', task, r'[ \t]*[^\(]'))
if re.search(sstr, part):
print('Please review line {}: async function "{}" is passed to a function.'.format(lnum, task))
print(opart)
print()
good = False
continue
# Might be a method. Discard object.
sstr = ''.join((r'.*\w+[ \t]*\([ \t]*\w+\.', task))
if re.search(sstr, part):
continue
print('Please review line {}: async function "{}" is not awaited.'.format(lnum, task))
print(opart)
print()
good = False
return good
txt = '''check_async_code.py
usage: check_async_code.py sourcefile.py
This rather crude script is designed to locate a single type of coding error
which leads to silent runtime failure and hence can be hard to locate.
It is intended to be used on otherwise correct source files and is not robust
in the face of syntax errors. Use pylint or other tools for general syntax
checking.
It assumes code is written in the style advocated in the tutorial where coros
are declared with "async def".
Under certain circumstances it can produce false positives. In some cases this
is by design. Given an asynchronous function foo the following is correct:
loop.run_until_complete(foo())
The following line may or may not be an error depending on the design of bar()
bar(foo, args)
Likewise asynchronous functions can be put into objects such as dicts, lists or
sets. You may wish to review such lines to check that the intention was to put
the function rather than its result into the object.
A false positive which is a consequence of the hacky nature of this script is
where a task has the same name as a synchronous bound method of some class. A
call to the bound method will produce an erroneous warning. This is because the
code does not parse class definitions.
In practice the odd false positive is easily spotted in the code.
'''
def usage(code=0):
print(txt)
sys.exit(code)
# Process a line
in_triple_quote = False
def do_line(line, passn, lnum):
global in_triple_quote
ignore = False
good = True
# TODO The following isn't strictly correct. A line might be of the form
# erroneous Python ; ''' start of string
# It could therefore miss the error.
if re.search(r'[^"]*"""|[^\']*\'\'\'', line):
if in_triple_quote:
# Discard rest of line which terminates triple quote
ignore = True
in_triple_quote = not in_triple_quote
if not in_triple_quote and not ignore:
parts = line.split(';')
for part in parts:
# discard comments and whitespace at start and end
part = part.split('#')[0].strip()
if part:
good &= passn(part, lnum)
return good
def main(fn):
global in_triple_quote
good = True
try:
with open(fn, 'r') as f:
for passn in (pass1, pass2):
in_triple_quote = False
lnum = 1
for line in f:
good &= do_line(line, passn, lnum)
lnum += 1
f.seek(0)
except FileNotFoundError:
print('File {} does not exist.'.format(fn))
return
if good:
print('No errors found!')
if __name__ == "__main__":
if len(sys.argv) !=2:
usage(1)
arg = sys.argv[1].strip()
if arg == '--help' or arg == '-h':
usage()
main(arg)
|
The Challenge of Preventing Neonatal Bilirubin Encephalopathy: A New Nursing Protocol in the Well Newborn Nursery Jaundice is common in healthy newborn infants. It is the result of normal adaptive physiological processes and generally peaks in severity between 3 and 5 days after birth and then resolves over the next 7 to 10 days. When bilirubin rises to toxic levels, bilirubin encephalopathy and subsequent kernicterus can occur. Phototherapy is a well-established and safe treatment of neonatal jaundice. A recent increase nationwide in the number of infants with kernicterus has made prevention of severe hyperbilirubinemia a national priority. Clinical estimation of jaundice severity is notoriously inaccurate. This fact coupled with early discharge of newborns, often before bilirubin levels have peaked, makes hospital-based risk assessment an essential intervention before discharge. In 1994, the American Academy of Pediatrics (AAP) first published a clinical practice guideline to provide a framework for the prevention and management of hyperbilirubinemia. The guideline, however, has not reduced the number of cases of bilirubin-induced neurological damage. Consequently, in 2004, the AAP published new guidelines for the management of hyperbilirubinemia in newborn infants of 35 or more weeks of gestation. Key recommendations of the guideline include the following: 2. Establish nursery protocols for the identification and evolution of hyperbilirubinemia. 4. Recognize that visual estimation of the degree of jaundice can lead to errors, particularly in darkly pigmented infants. 5. Interpret all bilirubin levels according to the infant's age in hours. 6. Recognize that infants at less than 38 weeks' gestation, particularly those who are breastfed, are at higher risk of developing hyperbilirubinemia and require closer surveillance and monitoring. 7. Perform a systematic assessment on all infants before discharge for the risk of severe hyperbilirubinemia. 9. Provide appropriate follow-up based on the time of discharge and the risk assessment. |
It’s an expensive business, being alive. It takes a toll on hearts and pockets alike. And it’s especially costly if you’re compelled to live outside conventional structures. Freedom, as the novelist, playwright and essayist Deborah Levy observes, “is never free. Anyone who has struggled to be free knows how much it costs”.
In 2013, Levy published a slim, incendiary book, Things I Don’t Want to Know, a response to Orwell’s 1946 essay “Why I Write”. In it she grappled with her own biography, attempting to figure out in particular what it means to write from the “the suburb of femininity”, and how to reconcile the demands of motherhood with making art.
The Cost of Living is the sequel, the second in three planned volumes about the intertwining consequences of being a woman and a writer (also a mother, a daughter, a childhood exile from South Africa, none of which are simple roles). Now in her mid-fifties, we re-encounter Levy in the aftermath of a divorce – the exhausted, exhilarated survivor of a catastrophic shipwreck. “Now that I was no longer married to society,” she writes, “I was transitioning into something or someone else. What and who would that be?” This is a story, then, about gender and age, how the two can constrict and limit possibilities, and how it might be possible to construct a different kind of account.
Getting divorced means abandoning socially sanctioned structures – the scaffold of the marriage, the sanctuary of the family home – and entering strange, potentially perilous waters. Levy relinquishes her Victorian house and moves with her two teenaged daughters into a decaying apartment block on the top of a hill in north London. The heating doesn’t work; the building is in the midst of eternally delayed regeneration; the communal hallway carpets are covered in grey industrial plastic for three years – Levy nicknames them the Corridors of Love, and invests in halogen heaters.
She’s the most delicious narrator. The post-divorce landscape is well-trodden by memoirists, and what makes Levy remarkable, beyond the endless pleasures of her sentences, is her resourcefulness and wit. She’s ingenious, practical and drily amused, somehow outside herself enough to find the grim, telling humour in almost any situation. Her experience is interesting to her largely for what it reveals about society, rather than the other way round.
The plumbing breaks. Fine. Dressed in a black silk nightie, a French postman’s jacket and fur slippers, she sets to work with the Master Plunger, a gender-defiant shaman presiding over the city’s blocked pipes. A supermarket chicken falls off the back of her bike and is run over by a car in the pouring rain, hours after a catastrophic meeting. No problem. Roast it with rosemary (not for remembrance) and fill the house with women of all ages for a raucous, festive dinner.
Generosity begets generosity. As in a fairy tale, helpers emerge. Levy needs somewhere to write. Enter Celia, a fierce former bookseller and the widow of the poet Adrian Mitchell, who offers up an unglamorous garden shed, complete with a freezer containing 20 plastic tubs of quartered apples. Levy lugs in a few books and immediately sets about writing Hot Milk (later shortlisted for the 2016 Man Booker Prize).
Levy has always been exceptionally skilled at the symbolic, attentive to how we declare our deepest selves in our most casual actions and phrases. Perhaps it’s a legacy of her years as a playwright, but she knows how small items – a parakeet, a stray bee, a lolly – generate an atmosphere, making a Freudian weather of their own. This see-sawing, two-things-at-once capacity of objects to open up reservoirs of memory is part of what makes her writing so distinctive.
A natural surrealist, she provides slightly less information than you might expect, the enigmatic opposite of an over-share. It’s amazing the deft use to which she puts “um” and “yes”; the anti-sentimentalising impact of a cannily placed “etc”. Her style is basically parataxis, things lodged next to things, the junctions missing or cut out. It makes everything a bit jerky and fragile, and it is a good mode with which to regard the shattering or assembling of the self, which has been a preoccupation for Levy since her novels of the late 1980s and early 1990s, Beautiful Mutants and Swallowing Geography.
Shattering is a universal experience, but it also exposes power structures. You realise who is protected and who is marginal, who is listened to and who cannot be seen. Levy keeps encountering men who won’t look at their wives or speak their names; men who ask women they’ve never met before to do tasks for them; men who tell women they talk too much; who cannot believe they’re minor characters in someone else’s story.
There are better ways of being free. Levy presents it as a puzzle: not easy, not effortless, but full of joy. Cycling to a party 20 miles across London on her liberatory e-bike, her dress streaming behind her, an electronic screwdriver in her bag, she evokes the pleasure of slipping away from old roles, the glamour of self-sufficiency, of mutual aid. This is a manifesto for a risky, radical kind of life, out of your depth but swimming all the same. |
<filename>app/posts/post.service.ts
import {Injectable} from '@angular/core';
import {Http} from '@angular/http';
import {Observable} from 'rxjs/Observable';
import {Post} from './post';
import {Comment} from './comment';
import 'rxjs/add/operator/map';
@Injectable()
export class PostService {
private _url = "http://localhost:8001/posts";
constructor(private _http : Http) {
}
getAllPost(filter? : any) : Observable<Post[]> {
var url = this._url;
if (filter && filter.userId) {
url = url + '?userId=' + filter.userId;
}
return this._http.get(url)
.map(res => res.json());
}
getPost(post : Post) : Observable<Post> {
return this._http.get(this._url + '/' + post.id)
.map(res => res.json());
}
getCommentsForPost(postid : number) : Observable<Comment[]> {
return this._http.get(this._url + '/' + postid + '/comments')
.map(res => res.json());
}
getPostForUser(userid : number) : Observable<Post[]> {
return this._http.get(this._url + '?userId=' + userid)
.map(res => res.json());
}
}
|
Queer Theory, Late Capitalism, and Internalized Homophobia SUMMARY The emergence of queer theory represents a transformation in the approach to lesbian, gay, bisexual and transgendered peoples. It has claimed new ground for treating sexuality and gender as worthy subjects in their own rights, rather than offshoots of gay and lesbian studies or of general cultural theory. The author contends, however, that it is doubtful that this approach can lead to social change. Queer theory has dismissed the usefulness of the disciplines that were the foundation of the social movements that initiated gay and lesbian studies, such as political economy, and in doing so, it has surreptitiously mirrored the social relations of reproduction that constitute late capitalism. This mirroring has had unseen consequences for the individual in society, and with queer theory's insistence on the relativity of experience and the dismissal of identity, has set the stage for a benign reinforcement of internalized homophobia. The author argues that this approach can be mediated by recognizing that identity is fluid, and that by focusing on identifying with social movements rather than centering analyses on the problems associated with identifying as a particular category of status and being, we can refocus our energies on the building and maintenance of mutual support and collective recognition that can lead to resolving the stagnation now dominating attempts to develop coalitions around issues that matter. |
/// Adds a single byte to this `ByteSet`.
fn add_byte(&mut self, b: u8) {
let hi = b >> 4;
let lo = b & 0x0F;
self.hi.0 |= 1 << hi;
self.lo.0 |= 1 << lo;
} |
<filename>internal/cmd/redis.go
package cmd
import (
"github.com/spf13/cobra"
"github.com/craftcms/nitro/internal/nitro"
)
var redisCommand = &cobra.Command{
Use: "redis",
Short: "Enter a redis shell",
RunE: func(cmd *cobra.Command, args []string) error {
machine := flagMachineName
redisAction, err := nitro.Redis(machine)
if err != nil {
return err
}
return nitro.Run(nitro.NewMultipassRunner("multipass"), []nitro.Action{*redisAction})
},
}
|
package util
import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
func HasLabel(obj v1.Object, key, value string) bool {
labels := obj.GetLabels()
v, ok := labels[key]
return ok && v == value
}
func GetLabel(obj v1.Object, key string) (string, bool) {
labels := obj.GetLabels()
v, ok := labels[key]
return v, ok
}
func AddLabels(obj v1.Object, key, value string) {
labels := obj.GetLabels()
if len(labels) == 0 {
labels = make(map[string]string)
}
labels[key] = value
obj.SetLabels(labels)
}
func RemoveLabel(obj v1.Object, key string) {
labels := obj.GetLabels()
delete(labels, key)
}
|
The Effects of Prone Positioning on Intraabdominal Pressure and Cardiovascular and Renal Function in Patients with Acute Lung Injury To detect any harmful effects of prone positioning on intraabdominal pressure (IAP) and cardiovascular and renal function, we studied 16 mechanically ventilated patients with acute lung injury randomly in prone and supine positions, without minimizing the restriction of the abdomen. Effective renal blood flow index and glomerular filtration rate index were determined by the paraaminohippurate and inulin clearance techniques. Prone positioning resulted in an increase in IAP from 12 ± 4 to 14 ± 5 mm Hg (P < 0.05), Pao2/fraction of inspired oxygen from 220 ± 91 to 267 ± 82 mm Hg (P < 0.05), cardiac index from 4.1 ± 1.1 to 4.4 ± 0.7 L/min (P < 0.05), mean arterial pressure from 77 ± 10 to 82 ± 11 mm Hg (P < 0.01), and oxygen delivery index from 600 ± 156 to 648 ± 95 mL min−1 m−2 (P < 0.05). Renal fraction of cardiac output decreased from 19.1% ± 12.5% to 15.5% ± 8.8% (P < 0.05), and renal vascular resistance index increased from 11762 ± 6554 dynes s cm−5 m2 to 15078 ± 10594 dynes s cm−5 m2 (P < 0.05), whereas effective renal blood flow index, glomerular filtration rate index, filtration fraction, urine volume, fractional sodium excretion, and osmolar and free water clearances remained constant during prone positioning. Prone positioning, when used in patients with acute lung injury, although it is associated with a small increase in IAP, contributes to improved arterial oxygenation and systemic blood flow without affecting renal perfusion and function. Apparently, special support to allow free chest and abdominal movement seems unnecessary when mechanically ventilated, hemodynamically stable patients without abdominal hypertension are proned to improve gas exchange. |
<filename>src/app/pages/setup/suppliers-list/suppliers-list.component.ts
import { Component, OnInit } from '@angular/core';
import {LocalDataSource} from "ng2-smart-table";
import {NbDialogService} from "@nebular/theme";
import {ApiAuth} from "../../../@core/services/api.auth";
import {EditSupplierComponent} from "../edit-supplier/edit-supplier.component";
@Component({
selector: 'suppliers-list',
templateUrl: './suppliers-list.component.html',
styleUrls: ['./suppliers-list.component.scss']
})
export class SuppliersListComponent implements OnInit {
source: LocalDataSource = new LocalDataSource();
settings = {
mode: 'external',
add: {
addButtonContent: '<i class="nb-plus"></i>',
createButtonContent: '<i class="nb-checkmark"></i>',
cancelButtonContent: '<i class="nb-close"></i>',
confirmCreate: true,
},
edit: {
editButtonContent: '<i class="nb-edit"></i>',
saveButtonContent: '<i class="nb-checkmark"></i>',
cancelButtonContent: '<i class="nb-close"></i>',
confirmSave: true,
},
delete: {
deleteButtonContent: '<i class="nb-trash"></i>',
confirmDelete: true,
},
columns: {
supplierid: {
title: 'ID',
type: 'number',
editable: false,
addable: false,
},
suppliername: {
title: 'Supplier Name',
type: 'string',
},
phone: {
title: 'Phone',
type: 'string',
},
mobile: {
title: 'Mobile',
type: 'string',
},
email: {
title: 'Email',
type: 'string',
},
description: {
title: 'Description',
type: 'string',
},
},
actions: {
position: 'right',
add: true,
edit:true,
editable:false,
columnTitle: '',
},
};
constructor(private authService: ApiAuth,private dialogService: NbDialogService
) { }
ngOnInit() {
this.loadData();
}
loadData(): void {
try
{
this.authService.getSuppliersList().subscribe(data => {
this.source.load(data);
});
}
catch (e) {
console.log(e);
}
}
onDelete(event) {
if (window.confirm('Are you sure you want to delete?')) {
try {
this.authService.deleteSupplier(event.data).subscribe(data => {
console.log(data);
if(data.status==424){
alert("You can't delete this Supplier. Some payments link to him!!");
return;
}
alert("Supplier is deleted..");
this.loadData();
});
}
catch (e) {
console.log(e);
alert("Error at deleting process!! ");
}
}
else
{
// event.confirm.reject();
}
}
onDeleteConfirm(event) {
console.log("Delete Event In Console")
console.log(event);
if (window.confirm('Are you sure you want to delete?')) {
event.confirm.resolve();
} else {
event.confirm.reject();
}
}
onSaveConfirm(event) {
if (window.confirm('Are you sure you want to save?')) {
event.newData['firstName'] += ' + added in code';
event.confirm.resolve(event.newData);
} else {
event.confirm.reject();
}
}
onCreateConfirm(event) {
if (window.confirm('Are you sure you want to create?')) {
event.newData['firstName'] += ' + added in code';
event.confirm.resolve(event.newData);
} else {
event.confirm.reject();
}
}
checkResult(msg){
console.log(msg);
this.loadData();
}
editRow(event) {
this.dialogService.open(EditSupplierComponent, {
context: {
title: 'Edit Supplier: '+ event.data.suppliername,
supplier: event.data,
},
}).onClose.subscribe (name => name && this.checkResult(name));
//(name => this.result && console.log(name));
}
createRow(event: any) {
// console.log('on add event: ', event);
this.dialogService.open(EditSupplierComponent, {
context: {
title: 'Add New Supplier',
supplier: null,
},
}).onClose.subscribe (name => name && this.checkResult(name));
}
}
|
#pragma once
#include <mutex>
#include <random>
#include <deque>
#include <opencv2/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <x/eklt/error.h>
#include <x/eklt/types.h>
#include <easy/profiler.h>
#include <x/eklt/async_patch.h>
namespace x {
/**
* @brief The EkltPatch struct which corresponds to an image patch defined by its center (feature position) and
* dimension (patch size)
*/
struct EkltPatch : public AsyncPatch {
/**
* @brief EkltPatch constructor for patch. Is defined by its center, linear warping matrix, half size ( half the patch
* side length and the direction of optical flow in its region.
* @param center Position of the patch defined by the location of the associated corner
* @param warping Affine 3x3 matrix describing the current transformation taking pixels in the patch to the initial image.
* @param flow_angle Angle (rad) of the optical flow in the patch around the initial feature
* @param half_size half size of the patch side length
* @param t_init time stamp of the image where the corner was extracted
*/
EkltPatch(const cv::Point2d ¢er, double t_init, const x::Params ¶ms, const EventsPerformanceLoggerPtr& perf_logger)
: AsyncPatch(perf_logger)
, init_center_(center)
, flow_angle_(0)
, event_counter_(0)
, t_init_(t_init)
, tracking_quality_(1)
, color_(0, 0, 255)
, lost_(false)
, initialized_(false) {
warping_ = cv::Mat::eye(3, 3, CV_64F);
patch_size_ = params.eklt_patch_size;
half_size_ = (params.eklt_patch_size - 1) / 2;
batch_size_ = static_cast<size_t>(params.eklt_batch_size);
// update_rate_ = params.eklt_update_every_n_events;
auto grad = std::make_pair(cv::Mat::zeros(patch_size_, patch_size_, CV_64F),
cv::Mat::zeros(patch_size_, patch_size_, CV_64F));
reset(init_center_, t_init, grad);
}
// TODO find alternative to ros::Time::now().toSec() -- now -1
explicit EkltPatch(const x::Params ¶ms, const EventsPerformanceLoggerPtr& perf_logger) : EkltPatch(cv::Point2f(-1, -1), -1, params, perf_logger) {
// contstructor for initializing lost features
lost_ = true;
}
/**
* @brief contains checks if event is contained in square around the current feature position
*/
inline bool contains(double x, double y) const {
return half_size_ >= std::abs(x - getCenter().x) && half_size_ >= std::abs(y - getCenter().y);
}
/**
* @brief checks if 2x2 ((x,y) to (x+1,y+1)) update is within patch boundaries
*/
inline bool contains_patch_update(int x, int y) const {
return (((x + 1) < patch_size_) && (x >= 0) &&
((y + 1) < patch_size_) && (y >= 0));
}
/**
* @brief insert an event in the event frame of the patch, incrementing the corresponding pixel by the polarity of the
* event.
*/
inline void insert(const x::Event &event) {
event_buffer_.push_front(event);
if (event_buffer_.size() > batch_size_) {
event_buffer_.pop_back();
}
event_counter_++;
}
/**
* @brief updates patch center by warping init_center_ with the current warping parameters
*/
inline void updateCenter(double t) {
cv::Point2d new_center;
warpPixel(init_center_, new_center);
updateTrack(t, new_center);
}
/**
* @brief warpPixel applies the inverse of the linear warp to unwarped and writes to warped.
*/
inline void warpPixel(cv::Point2d unwarped, cv::Point2d &warped) {
// compute the position of the feature according to the warp (equation (8) in the paper)
cv::Mat W = warping_.inv();
warped.x = W.at<double>(0, 0) * unwarped.x + W.at<double>(0, 1) * unwarped.y + W.at<double>(0, 2);
warped.y = W.at<double>(1, 0) * unwarped.x + W.at<double>(1, 1) * unwarped.y + W.at<double>(1, 2);
}
/**
* @brief getEventFrame returns the event_frame (according to equation (2) in the paper and resets the counter.
*/
inline double getEventFrame(cv::Mat &event_frame) {
// EASY_BLOCK("Event accumulation");
// implements the function (2) in the paper
event_frame = cv::Mat::zeros(2 * half_size_ + 1, 2 * half_size_ + 1, CV_64F);
size_t iterations = batch_size_ < event_buffer_.size() ? batch_size_ - 1 : event_buffer_.size() - 1;
for (size_t i = 0; i < iterations; ++i) {
x::Event &e = event_buffer_[i];
// TODO(JN)
// heap corruption was occuring at the event_frame.at(y+1,x+1) line below
// the previous contains function didn't seem to account for +1 accesses:
// if (!contains(e.x, e.y))
// continue;
// the following solution is temporary and should be revisited
// e.x is uint16_t, half_size_ is int, center_.x is double
// what should the rounding policy be from dx to x? is float->int truncation fine?
double dx = e.x - getCenter().x + half_size_;
double dy = e.y - getCenter().y + half_size_;
int x = static_cast<int>(dx);
int y = static_cast<int>(dy);
if (!contains_patch_update(x, y)) {
continue;
}
double rx = dx - x;
double ry = dy - y;
int increment = e.polarity ? 1 : -1;
event_frame.at<double>(y + 1, x + 1) += increment * rx * ry;
event_frame.at<double>(y, x + 1) += increment * rx * (1 - ry);
event_frame.at<double>(y + 1, x) += increment * (1 - rx) * ry;
event_frame.at<double>(y, x) += increment * (1 - rx) * (1 - ry);
}
// timstamp the image at the middle of the event batch
event_counter_ = 0;
return 0.5 * (event_buffer_[0].ts + event_buffer_[iterations].ts);
}
/**
* @brief resets patch after it has been lost.
*/
inline void reset(const cv::Point2d &init_center, double t, const std::pair<cv::Mat, cv::Mat>& gradient_xy) {
// reset feature after it has been lost
event_counter_ = 0;
tracking_quality_ = 1;
lost_ = false;
initialized_ = false;
flow_angle_ = 0;
gradient_xy_ = gradient_xy;
resetTrack(t, init_center);
init_center_ = init_center;
t_init_ = t;
warping_ = cv::Mat::eye(3, 3, CV_64F);
event_buffer_.clear();
// set random color
static std::uniform_real_distribution<double> unif(0, 255);
static std::default_random_engine re;
color_ = cv::Scalar(unif(re), unif(re), unif(re));
assignNewId();
}
cv::Point2d init_center_;
cv::Mat warping_;
double flow_angle_;
int patch_size_;
int half_size_;
size_t event_counter_;
double t_init_;
double tracking_quality_;
cv::Scalar color_;
size_t batch_size_;
// int update_rate_;
bool lost_;
bool initialized_;
std::deque<x::Event> event_buffer_;
std::pair<cv::Mat, cv::Mat> gradient_xy_;
};
}
|
def _analyze_hyperparameters(model, loss, optimization, options, hparams, modifiers, ds_train, ds_dev, hist=pd.DataFrame()):
for modifier in modifiers:
modified_hparams = {**hparams, **modifier}
modified_hparams_without_regularization = _reset_regularization_hyperparameter(modified_hparams)
Theta = optimization(modified_hparams, ds_train)
E_train = _evaluate_loss(model, loss, options, modified_hparams_without_regularization, Theta, ds_train)
E_dev = _evaluate_loss(model, loss, options, modified_hparams_without_regularization, Theta, ds_dev)
hist = hist.append(
pd.DataFrame({"E_train": E_train, "E_dev": E_dev, **modifier}, index = [0]),
ignore_index=True
)
idx = hist["E_dev"].idxmin()
return (idx, hist) |
The Problem-Solving Box: A Novel Task for Assessing Executive Functions in 1.5- to 4-year-olds Executive Functions (EFs) underpin the ability to work towards goals by co-ordinating thought and action. Difficulties with EF are implicated in many neurodevelopmental disorders. Research into the early development and remediation of EF difficulties has been hampered by a scarcity of measures suitable for very young children. We introduce a novel problem-solving task involving a box containing 3 visible rewards. Retrieval of all 3 rewards requires generation of multiple strategies, inhibition of previously-successful strategies, and persistence despite set-backs. The task requires integrative application of EFs, and mirrors the un-structured nature of real-world tasks. Exploratory analysis of data from 110 typically-developing British and Swedish children who attempted this 5-minute task indicates the task is developmentally appropriate for 1.5- to 4-year-olds. Preschoolers were more successful problem-solvers than toddlers. Age-related improvements were observed for generativity and persistence, but age was not associated with perseveration. Boys achieve higher overall scores, and were less perseverative, than girls. The low social and language demands of the task, and the ability to identify areas of relative strength and weakness even when success is not fully achieved, are markers of the tasks potential as a dimensional measure of early EF skills. |
#include "PDACleaner.h"
#include "NFA.h"
#include "Sqs.h"
#include "BMap.h"
#include "StateVisitMap.h"
/**
* Removes all States from the StateSet and the final StateSet of PDA P
* that do not occur in any PDATransition in P.
*/
static void remove_unused_states(PDA *P) {
P->get_Q()->clear();
for (auto theta = P->get_Delta()->begin(); theta != P->get_Delta()->end(); theta++) {
State *q = (*theta)->get_q();
State *r = (*theta)->get_r();
P->get_Q()->add(q);
P->get_Q()->add(r);
}
P->get_F()->retain_all(P->get_Q());
}
/**
* Removes all PDATransitions marked as extensions from the set U.
*/
static void remove_extensions(PDATransitionSet *U) {
for (auto it = U->begin(); it != U->end();) {
if ((*it)->get_ext_status() != NO_EXTENSION) {
it = U->remove(*it);
} else {
it++;
}
}
}
/**
* Helper function to recursively find the epsilon transitions mentioned in the description
* of add_eps_transitions() (see below).
*/
static int add_eps_transitions_rec (std::size_t s_pos, State *x, SymbolString *sigma, State *q,
NFA *N, NFATransitionSet *E, NFATransitionSet *traversed, StateVisitMap *visited) {
if (visited->has_key(x)) {
return visited->get(x);
}
int path = 0;
for (auto it = N->get_Delta()->begin(); it != N->get_Delta()->end(); it ++) {
if (!(*it)->get_q()->equals(*x)) continue;
Symbol *a = (*it)->get_symbol();
State *r = (*it)->get_r();
if (a->equals(EPSILON)) {
if (s_pos == 0) continue;
if (traversed->contains(*it)) continue;
traversed->add(*it);
int res = add_eps_transitions_rec(s_pos, r, sigma, q, N, E, traversed, visited);
traversed->remove(*it);
if (res > 0) {
E->add(*it);
}
path += res;
}
if (sigma->length() > s_pos && a->equals(*sigma->symbol_at(s_pos))) {
s_pos++;
NFATransitionSet traversed_new;
StateVisitMap visited_new;
int res = add_eps_transitions_rec(s_pos, r, sigma, q, N, E, &traversed_new, &visited_new);
s_pos--;
path += res;
}
}
if (s_pos >= sigma->length() && x->equals(*q)) {
path = 1;
}
visited->put(x, path);
return path;
}
/**
* Find and add all epsilon transitions to E that occur in any path
* from x to q in N by sigma^R. The only restriction being that the first transition
* in the path should not be an epsilon transition.
*
* Corresponds to Algorithm 3 - Step 3 in the paper.
*/
static void add_eps_transitions(State *x,
SymbolString *sigma, State *q, NFA *N, NFATransitionSet *E) {
// The traversed set and visited map are needed in order to detect
// cycles during the recursive operation of finding the epsilon transitions.
NFATransitionSet traversed;
StateVisitMap visited;
add_eps_transitions_rec(0, x, sigma, q, N, E, &traversed, &visited);
}
/**
* Helper function to recursively find the epsilon-free path mentioned in the
* description of find_finishing_path() (see below).
*/
static int find_finishing_path_rec(State *y, SymbolString **tau, State **r, NFA *N) {
if (N->get_F()->contains(y)) {
*r = y->clone();
return 1;
}
for (auto it = N->get_Delta()->begin(); it != N->get_Delta()->end(); it ++) {
State *q = (*it)->get_q();
if (!q->equals(*y)) continue;
Symbol *a = (*it)->get_symbol();
if (a->equals(EPSILON)) continue;
State *y_1 = (*it)->get_r();
(*tau)->append(a);
int res = find_finishing_path_rec(y_1, tau, r, N);
if (res > 0) {
return 1;
}
(*tau)->truncate(1);
}
return 0;
}
/**
* For a given State y, determine SymbolString tau and State r such that am epsilon-free path
* (y, tau^R, r) exists in N.
*
* Corresponds to Algorithm 3 - Step 2 mentioned in the paper.
*/
static void find_finishing_path(State *y, SymbolString **tau, State **r, NFA *N) {
*tau = new SymbolString();
find_finishing_path_rec(y, tau, r, N);
SymbolString *tau_rev = (*tau)->reversed();
delete *tau;
*tau = tau_rev;
}
/**
* Determines which transitions in P_1 are non-finishing.
* Corresponds to Algorithm 3 (procedure backward) in the paper.
*/
static void backward(PDA *P_1, NFA *N, PDATransitionSet *U_2,
NFATransitionSet *E, NFATransitionSet *G, Sqs *sqs_map) {
PDATransitionSet *Delta = P_1->get_Delta();
NFATransitionSet *E_minus_G = E->difference(G);
while (!E_minus_G->is_empty()) {
// Step 1
NFATransition *x_eps_y = *E_minus_G->begin();
State *x = x_eps_y->get_q();
State *y = x_eps_y->get_r();
G->add(x_eps_y);
// Step 2
SymbolString *tau = nullptr;
State *r = nullptr;
find_finishing_path(y, &tau, &r, N);
// Step 3
for (auto theta = Delta->begin(); theta != Delta->end(); theta++) {
if (!(*theta)->get_r()->equals(*r)) continue;
if (!(*theta)->get_tau()->equals(*tau)) continue;
State *q = (*theta)->get_q();
SymbolString *sigma = (*theta)->get_sigma();
// Step 3.1
if (!sqs_map->get(q, sigma)->contains(x)) continue;
// Step 3.2
U_2->remove(*theta);
// Step 3.3
if (sigma->length() > 0) {
SymbolString *sigma_rev = sigma->reversed();
add_eps_transitions(x, sigma_rev, q, N, E);
delete sigma_rev;
}
}
delete tau;
delete r;
delete E_minus_G;
E_minus_G = E->difference(G);
}
delete E_minus_G;
}
/**
* Makes preparations for the backward procedure.
*/
static void non_finishing(PDA *P_1, NFA *N, Sqs *sqs_map, PDATransitionSet *U_2) {
State *m_0 = N->get_q_0();
State *q_f = *P_1->get_F()->begin();
NFATransition e(m_0, &EPSILON, q_f);
if (!N->get_Delta()->contains(&e)) {
// The language is empty, so all transitions are useless.
return;
}
NFATransitionSet E, G;
E.add(&e);
backward(P_1, N, U_2, &E, &G, sqs_map);
}
/**
* Establishes a path (y, a, z) in N and returns State y, which may be a newly created State.
* Corresponds to Algorithm 2 (step 4 of forward) described in the paper.
*/
static State * forward_4(SymbolString *a, State *z, NFA *N, BMap *b_map) {
int k = a->length();
if (k == 0)
return z->clone();
for (auto it = N->get_Delta()->begin(); it != N->get_Delta()->end(); it++) {
State *q = (*it)->get_q();
Symbol *symbol = (*it)->get_symbol();
State *r = (*it)->get_r();
if (symbol->equals(*a->symbol_at(k - 1)) && r->equals(*z)) {
SymbolString *truncated = a->truncated(1);
State *y = forward_4(truncated, q, N, b_map);
delete truncated;
return y;
}
}
State *n_1 = StateGenerator::get_state();
State *n_2 = z->clone();
for (int i = k - 1; i >= 0; i--) {
NFATransition t(n_1, a->symbol_at(i), n_2);
N->get_Q()->add(n_1);
b_map->get(n_1)->add(n_1);
N->get_Delta()->add(&t);
delete n_2;
n_2 = n_1;
if (i > 0)
n_1 = StateGenerator::get_state();
}
return n_1;
}
/**
* Determines the largest set of States in N, such that each of them can reach
* a state in the specified set via a path of epsilon transitions only.
*/
static StateSet * backwards_epsilon_closure(NFA *N, StateSet *set, BMap *b_map) {
StateSet *set_prime = set->clone();
for (auto it = set->begin(); it != set->end(); it++) {
set_prime->add_all(b_map->get(*it));
}
return set_prime;
}
/**
* Determines the sqs set for State q and SymbolString s.
* Enters this set into the pecified Sqs map.
*/
static void determine_Sqs(Sqs *sqs_map, State *q, SymbolString *s, NFA *N, BMap *b_map) {
SymbolString *s_reversed = s->reversed();
StateSet *set = sqs_map->get(q, s);
set->clear();
set->add(q);
for (int i = s_reversed->length() - 1; i >= 0; i--) {
StateSet *set_eps = backwards_epsilon_closure(N, set, b_map);
set->clear();
for (auto it = N->get_Delta()->begin(); it != N->get_Delta()->end(); it++) {
State *q = (*it)->get_q();
Symbol *symbol = (*it)->get_symbol();
State *r = (*it)->get_r();
if (symbol->equals(*s_reversed->symbol_at(i)) && set_eps->contains(r)) {
set->add(q);
}
}
delete set_eps;
}
delete s_reversed;
}
/**
* Detects unreachable transitions in P_0.
* Corresponds to Algorithm 1 (Procedure forward) described in the paper.
*/
static void forward(PDA *P_0, NFA *N, PDATransitionSet *U_1, Sqs *sqs_map, BMap *b_map) {
for (auto theta = P_0->get_Delta()->begin(); theta != P_0->get_Delta()->end(); theta++) {
State *q = (*theta)->get_q();
SymbolString *sigma = (*theta)->get_sigma();
SymbolString *tau = (*theta)->get_tau();
State *r = (*theta)->get_r();
if (!N->get_Q()->contains(q))
continue;
determine_Sqs(sqs_map, q, sigma, N, b_map);
StateSet *sqs = sqs_map->get(q, sigma);
if (sqs->size() == 0)
continue;
SymbolString *tau_reversed = tau->reversed();
if (U_1->contains(*theta)) {
U_1->remove(*theta);
State *tmp = forward_4(tau_reversed, r, N, b_map);
delete tmp;
N->get_Q()->add(r);
b_map->get(r)->add(r);
N->get_F()->add(r);
}
NFATransitionSet *Delta = N->get_Delta();
State *y = forward_4(tau_reversed, r, N, b_map);
for (auto x = sqs->begin(); x != sqs->end(); x++) {
NFATransition t(*x, &EPSILON, y);
if (!Delta->contains(&t)) {
Delta->add(&t);
// Merge BMap entries.
for (auto b_it = b_map->begin(); b_it != b_map->end(); b_it++) {
StateSet *b_set = b_it->second;
if (!b_set->contains(y))
continue;
b_set->add_all(b_map->get(*x));
}
}
}
delete y;
delete tau_reversed;
}
}
/**
* Builds the NFA N that represents all reachable configurations in P_0.
* Also removes reachable transitions from U_1, which in the end will
* contain all unreachable transitions of P_0.
*/
static NFA * build_NFA(PDA *P_0, PDATransitionSet *U_1, Sqs *sqs_map) {
BMap *b_map = new BMap();
// Initial state of the NFA
GeneratedState m_0("m_0");
// Stateset of the NFA
StateSet Q;
Q.add(&m_0);
b_map->get(&m_0)->add(&m_0);
Q.add(P_0->get_q_0());
b_map->get(P_0->get_q_0())->add(P_0->get_q_0());
// The NFA's input symbol's are P_0's stack symbols
SymbolSet *Sigma = P_0->get_Gamma()->clone();
// The NFA's transitions
NFATransitionSet Delta;
// Initially contains only one transition
Bottom b_0;
NFATransition t(&m_0, &b_0, P_0->get_q_0());
Delta.add(&t);
// The NFA's final states
StateSet F;
F.add(P_0->get_q_0());
NFA *old_N = nullptr;
NFA *N = new NFA(&Q, Sigma, &Delta, &m_0, &F);
delete Sigma;
do {
if (old_N != nullptr)
delete old_N;
old_N = N->clone();
sqs_map->clear();
forward(P_0, N, U_1, sqs_map, b_map);
} while (!N->equals(*old_N));
delete b_map;
delete old_N;
return N;
}
static PDA * simplify_PDA(PDA *P) {
Bottom b_0;
GeneratedState q_0_hat("q_0_hat");
GeneratedState q_e("q_e");
GeneratedState q_f("q_f");
SymbolString Z;
Z.append(&b_0);
StateSet F;
F.add(&q_f);
PDA *P_0 = new PDA("P_0", P->get_Q(), P->get_Gamma(), P->get_Delta(), &Z, &q_0_hat, &F);
// StateSet
P_0->get_Q()->add(&q_0_hat);
P_0->get_Q()->add(&q_e);
P_0->get_Q()->add(&q_f);
// SymbolSet
P_0->get_Gamma()->add(&b_0);
// Add necessary transitions to Delta
SymbolString empty_string;
PDATransition t(&q_0_hat, &empty_string, "", P->get_q_0(), P->get_Z(), START_UP);
P_0->get_Delta()->add(&t);
for (auto it = P->get_F()->begin(); it != P->get_F()->end(); it++) {
PDATransition t(*it, &empty_string, "", &q_e, &empty_string, CLOSE_DOWN);
P_0->get_Delta()->add(&t);
}
for (auto it = P->get_Gamma()->begin(); it != P->get_Gamma()->end(); it++) {
SymbolString pop;
pop.append(*it);
PDATransition t(&q_e, &pop, "", &q_e, &empty_string, CLOSE_DOWN);
P_0->get_Delta()->add(&t);
}
PDATransition r(&q_e, &Z, "", &q_f, &empty_string, CLOSE_DOWN);
P_0->get_Delta()->add(&r);
return P_0;
}
PDACleanerResult clean_PDA(PDA *P, bool clean) {
Sqs *sqs_map = new Sqs();
PDA *P_0 = simplify_PDA(P);
// As an over-approximation, U_1 initially contains all transitions in P_0
PDATransitionSet *U_1 = P_0->get_Delta()->clone();
// Build NFA of reachable configurations and only
// keep unreachable transitions in U_1.
NFA *N = build_NFA(P_0, U_1, sqs_map);
// Creating alias to be consistent with the notation in the paper.
PDA *P_1 = P_0;
// Remove unreachable transitions.
P_1->get_Delta()->remove_all(U_1);
// As an over-approximation, U_2 initially contains all transitions in P_1.
PDATransitionSet *U_2 = P_1->get_Delta()->clone();
// Determine all non-finishing transitions. Only these will be contained in U_2
// after the call returns.
non_finishing(P_1, N, sqs_map, U_2);
// Remove extension transitions from U_1 and U_2
remove_extensions(U_1);
remove_extensions(U_2);
PDACleanerResult result = { U_1, U_2, nullptr };
// Create a clean PDA, if requested
if (clean) {
PDA *P_clean = P->clone();
P_clean->get_Delta()->remove_all(U_1);
P_clean->get_Delta()->remove_all(U_2);
// Remove unused states
remove_unused_states(P_clean);
result.P_clean = P_clean;
}
delete sqs_map;
delete N;
delete P_1;
return result;
}
|
/*
* Copyright 2020 Huawei Technologies Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef __CRANE_CRANEREGISTRY_H__
#define __CRANE_CRANEREGISTRY_H__
#include <dirent.h>
#include <iostream>
#include <string>
#include <list>
#include <queue>
#include <memory>
#include <mutex>
#include <rapidjson/document.h>
#include <rapidjson/writer.h>
#include <rapidjson/stream.h>
#include "rapidjson/filewritestream.h"
#include "craneMacro.h"
#include "Log.h"
#include "Util.h"
#include "cranePlugin.h"
#include "AbsRegistry.h"
#include "DlLibrary.h"
#include "PluginInterfaceInfo.h"
#include "Wrapper.h"
using namespace std;
using namespace rapidjson;
namespace NS_CRANE {
class CraneRegistry {
public:
CraneRegistry() {
// Add add null swappable plugin instance in order to return it when cannot find instance by id.
_pluginSwappableInstanceMap.insert(
make_pair(NULL_PLUGIN_SWAPPABLE_ID,
make_pair(make_shared<Wrapper>(),
make_pair(NULL_PLUGIN_ID, NULL_PLUGIN_SWAPPABLE_ID))));
}
~CraneRegistry() {
cout<<"~CraneRegistry()"<<endl;
// Release the wrapped plugin instanse explicitly, before
// release the _pluginInstanceMap.
_pluginSwappableInstanceMap.clear();
// Release the plugin instance explicitly, before
// release the _pluginItfMap and _pluginLibMap.
_pluginInstanceMap.clear();
// TAKE CARE: itfMap must release before libMap, because itfMap contain the pointer of the plugin factory.
// When I release(::dlclose) the library first and then release pointer of the plugin factroy, process can
// not find memory of plugin factory.
_pluginItfMap.clear();
_pluginLibMap.clear();
}
/**
* @Descripttion: Initialize the crane system.
* @Param:
* @Return:
*/
unsigned craneInit(int argc, char** argv);
/**
* @Descripttion: Find plugin interface info from _pluginItfMap with plugin interface name.
* @Param: plugin interface name
* @Return: a copy of the shared_ptr<PluginInterfaceInfo>
*/
shared_ptr<PluginInterfaceInfo> findPluginItfInfo(const string&) const;
/**
* @Descripttion: Create a new Itf object through absolute library file name.
* @Param: absoluteFileName: Absolute library file name of the plugin.
* @Param[out]: desc: Description of the plugin.
* @Return: shared_ptr<PluginInterfaceInfo>
*/
shared_ptr<PluginInterfaceInfo> createItfInfo(const string& absoluteFileName, PluginDesc& desc);
/**
* @Descripttion: Create a new Itf object through absolute library file name.
* @Param: absoluteFileName: Absolute library file name of the plugin.
* @Return: shared_ptr<PluginInterfaceInfo>
*/
shared_ptr<PluginInterfaceInfo> createItfInfo(const string& absoluteFileName);
/**
* @Descripttion: Clear the data related with the plugin library file which has been load before.
* If the instance id is existed in the PluginInterfaceInfo, it will do nothing.
* 1. Clear the lib instance from registry's map.
* 2. Clear the absolute library file name from _pluginLibFileMap of the Itf instance.
* 3. Clear the plugin factory instance from _pluginFactoryList of the Itf instance.
* @Param: type: Interface name of the plugin
* @Param: pluginName: class name of the plugin
* @Return: CRANE_SUCC/CRANE_FAIL
*/
unsigned clearPlugin(const string& type, const string& pluginName);
/**
* Begin: Methods of the plugin instance management, which is related with
* PluginInstanceMap _pluginInstanceMap and PluginInterfaceInfo _pluginInstanceIdMap.
*/
/**
* @Descripttion: Insert the plugin id and plugin instance, itf type, pluginName
* into the _pluginInstanceMap.
* At the same time, insert the plugin id into plugin instance
* map of the pluginInterfaceInfo.
* @Param: id: plugin id.
* @Param: inst: plugin instance.
* @Param: itfType: interface type name of plugin instance.
* @Param: pluginName: implemention class name of the plugin.
* @Return: CRANE_SUCC/CRANE_FAIL
*/
unsigned addPluginInstance(const string& id,
shared_ptr<PluginBase> inst,
const string& itfType,
const string& pluginName);
/**
* @Descripttion: Clear the plugin id from plugin instance map and
* plugin id map in the PluginInterfaceInfo.
* @Param: id: plugin instance id.
* @Return: CRANE_SUCC/CRANE_FAIL
*/
unsigned delPluginInstance(const string& id);
/**
* @Descripttion: Whether the plugin id is exist in the pluginInstance map.
* @Param: id: plugin instance id.
* @Return: true/false
*/
bool isExistPluginInstance(const string& id);
/**
* @Descripttion: Get plugin id through interface type and plugin name.
* When there is more than one plugin id, then return the
* first one of list.
* @Param: itfType: interface type.
* @Param: pluginName: plugin implement class name.
* @Return: plugin instance id
*/
const string getPluginId(const string& itfType, const string& pluginName) const;
/**
* @Descripttion: Get the pair of interface type and class name of the plugin.
* @Param: id: plugin instance id.
* @Return: std::pair<type, pluginName>
*/
pair<string, string> getPluginItfAndImplName(const string& id);
/**
* @Descripttion: Get plugin instance through plugin instance id.
* @Param: id: plugin instance id.
* @Return: plugin instance
*/
shared_ptr<PluginBase> getPluginInstance(const string& id);
/**
* @Descripttion: Get plugin instance through type and plugin name.
* @Param: id: plugin instance id.
* @Return: plugin instance
*/
shared_ptr<PluginBase> getPluginInstance(const string& itfType,
const string& pluginName);
/**
* @Descripttion: Release the plugin instance by plugin id.
* If the plugin instance is not referd by other object, then
* delete the id from plugin instance id map of the pluginInterfaceInfo and
* release the entry in the plugin instance map.
* @Param: Instance id of the shared_ptr<PluginInterfaceInfo>
* @Return: NULL
*/
void relPluginInstance(const string& id);
/**
* @Descripttion: Release all plugin instances
* @Param: null
* @Return: NULL
*/
void relPluginInstance();
/**
* End: Methods of plugin instance management.
*/
/**
* Begin: Methods of the wrapped plugin instance management, which is
* related with PluginSwappableInstanceMap _pluginSwappableInstanceMap.
*/
/**
* @Descripttion: Insert the wrapped plugin instance into the map.
* @Param: id: Wrapped plugin id.
* @Param: wsp: Wrapped plugin instance.
* @Param: id: Wrapped plugin id.
* @Return: NULL
*/
unsigned addPluginSwappableInstance(const string& id,
shared_ptr<Wrapper> wsp,
const string& pluginId,
const string& description);
/**
* @Descripttion: Get the wrapped plugin instance from the map.
* If id is not existed in the map, then it return the
* Wrapper object created by default constructor which is
* fected by NULL_PLUGIN_SWAPPABLE_ID.
* @Param: id: Wrapped plugin id.
* @Return: the instance of wrapped plugin.
*/
shared_ptr<Wrapper> getPluginSwappableInstance(const string& id);
/**
* @Descripttion: Release the wrapped plugin instance from the map,
* if it is not referred by the others.
* It will try to release the plugin instance by plugin id,
* if it is not referred by the others.
* @Param: id: Wrapped plugin id.
* @Return: NULL
*/
void relPluginSwappableInstance(const string& id);
/**
* End: Methods of wrapped plugin instance management.
*/
protected:
/**
* @Descripttion: Add plugin interface info into the registry.
* @Param: instance of the shared_ptr<PluginInterfaceInfo>
* @Return: CRANE_SUCC/CRANE_FAIL
*/
unsigned registry_(shared_ptr<PluginInterfaceInfo>);
private:
using PluginInterfaceMap = map<string /*interface name*/,
shared_ptr<PluginInterfaceInfo>>;
PluginInterfaceMap _pluginItfMap; //map contain pair of interface name and interface instance.
using PluginLibMap = map<string /*libName*/,
unique_ptr<DlLibrary>>; //libName is ABCD which is extracted from libcranepluginABCD.so
PluginLibMap _pluginLibMap; //map contain pair of library file name and library handle.
using PluginInstanceMap = map<string /*plugin instance id*/,
pair<shared_ptr<PluginBase>/*plugin instance*/, pair<string/*interface name*/, string/*pluginName(class name of the plugin)*/>>>;
PluginInstanceMap _pluginInstanceMap; // Contained the plugin instance.
//using PluginSwappableInstanceMap = map<string /*id*/, pair<shared_ptr<Wrapper>, string>>;
//PluginSwappableInstanceMap _pluginSwappableInstanceMap;
using PluginSwappableInstanceMap = map<string /*wrapped plugin id*/,
pair<shared_ptr<Wrapper>, pair<string/*plugin id*/, string/*description*/>>>;
PluginSwappableInstanceMap _pluginSwappableInstanceMap;
static const string _CACHE_FILE;
static const string _CACHE_FILE_TMP;
string _crane_sys_plugin_path;
string _crane_app_plugin_path;
enum class _InitMode {
LIB_FILE = 0,
CACHE_FILE,
};
mutex _mtx;
list<string> _dlFiles; //library files.
unsigned _addPluginLibMap(unique_ptr<DlLibrary>);
/**
* @Descripttion: Remove the library from _pluginLibMap and close the handle of the library.
* @Param: filename: Absolate filename of the plugin library
* @Return: CRANE_SUCC/CRANE_FAIL
*/
unsigned _delPluginLibMap(const string& filename);
/**
* @Descripttion: Clear the plugin instance id from the plugin instance id map of
* the pluginInterfaceInfo.
* @Param: type: Interface name of the plugin.
* @Param: pluginName: class name of the plugin.
* @Param: id: plugin instance id.
* @Return: CRANE_SUCC/CRANE_FAIL
*/
unsigned _clearPluginIdInItfInfo(const string& type, const string& pluginName, const string& id);
bool _isValidLibName(const string& path);
/**
* @Descripttion: 扫描插件路径下的插件动态库文件,将剔除lib前缀和.so后缀的文件名写入dlFiles
* @Param: list: 动态库文件名列表
* @Param: folder: 动态库路径名称
* @Param: extension: 动态库后缀名
* @Param: recursive: 是否在动态库路径名下进行递归处理
* @Return: void
*/
void _listFiles(list<string>& list, const string& folder, const string& extension, bool recursive);
_InitMode _initMode();
void _initPluginPath();
unsigned _scan();
/**
* @Descripttion:
* @Param:
* @Return:
*/
unsigned _loadFromLib();
unsigned _createCacheFile();
/**
* @Descripttion: Just load the information from cach (json) file, which include the information of the interface and library file of the plugin.
* Plugin library and plugin factory will load when create the plugin instance at the first time.
* @Param: null
* @Return:
*/
unsigned _loadFromCache();
/**
* @Descripttion: Parse the cache file and fill the information of the interface and library file of the plugin into the registry.
* @Param: null
* @Return:
*/
unsigned _parseCacheFile();
};
}
#endif
|
package edu.mobydickens.books.config;
/**
* Created by 6586r on 11/18/2017.
*/
import edu.mobydickens.books.service.MobyDickensBooksUserDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.encoding.PlaintextPasswordEncoder;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.builders.WebSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
@Configuration
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
private MobyDickensBooksUserDetailsService mobyDickensBooksUserDetailsService;
@Override
public void configure(WebSecurity web) throws Exception {
web.ignoring().antMatchers("/css/**", "/images/**", "/img/**");
}
@Override
public void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
// public pages
.antMatchers("/", "/contact-us", "/search").permitAll()
// authenticated pages
.anyRequest().authenticated()
.and()
.formLogin()
.loginPage("/login")
.usernameParameter("username")
.passwordParameter("<PASSWORD>")
.defaultSuccessUrl("/",true)
.permitAll()
.and()
.logout()
.logoutRequestMatcher(new AntPathRequestMatcher("/logout"))
.logoutSuccessUrl("/logout-success")
.permitAll();
// make this all work
http.headers().frameOptions().disable();
http.csrf().disable();
}
@Override
public void configure(AuthenticationManagerBuilder aMB) throws Exception {
aMB.userDetailsService(mobyDickensBooksUserDetailsService)
.passwordEncoder(new PlaintextPasswordEncoder());
}
}
|
<filename>internal/effx/http.go
package effx
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"net/url"
"github.com/effxhq/effx-cli/discover"
"github.com/thoas/go-funk"
)
// New returns an effx Client encapsulating operations with the API
func New(cfg *Configuration) (*Client, error) {
if err := cfg.Validate(); err != nil {
return nil, err
}
return &Client{cfg}, nil
}
// SyncError contains information provided when an error occurs
type SyncError struct {
Message string `json:"message,omitempty"`
}
// SyncRequest contains a config blob for indexing.
type SyncRequest struct {
FileContents string `json:"fileContents,omitempty"`
Tags map[string]string `json:"tags,omitempty"`
Annotations map[string]string `json:"annotations,omitempty"`
}
// Client encapsulates communication with the API.
type Client struct {
cfg *Configuration
}
// IsFeatureDisabled returns if a given feature is disabled.
// example: LANGUAGE_DETECTION
func (c *Client) IsFeatureDisabled(feature string) bool {
return funk.ContainsString(c.cfg.Disable.Value(), feature)
}
// Sync attempts to synchronize provided contents with the upstream api.
func (c *Client) Sync(syncRequest *SyncRequest) error {
body, err := json.Marshal(syncRequest)
if err != nil {
return err
}
reader := bytes.NewReader(body)
endpoint := url.URL{
Scheme: "https",
Host: c.cfg.APIHost,
Path: "/v2/config",
}
req, err := http.NewRequest("PUT", endpoint.String(), reader)
if err != nil {
return err
}
req.Header.Add("content-type", "application/json")
req.Header.Add("x-effx-api-key", c.cfg.APIKey)
resp, err := http.DefaultClient.Do(req)
if err != nil {
return err
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusNoContent {
syncErr := &SyncError{}
err = json.NewDecoder(resp.Body).Decode(syncErr)
if err != nil {
return err
}
return fmt.Errorf(syncErr.Message)
}
return nil
}
// DetectServices attempts to detect services based on repo work dir.
func (c *Client) DetectServices(workDir string) error {
return discover.DetectServicesFromWorkDir(workDir, c.cfg.APIKey, "vcs-connect")
}
|
<filename>decorators.py
def get_params(args, only_args=False):
"""Returns bot and params separately
Gets the message text and splits it into command and text.
"""
update_msg = args[1].message
command_parms = update_msg.text.split(' ')[1:]
if only_args:
return_val = command_parms
else:
# returns bot (args[0]) and whatever params for the command
return_val = (args[0], update_msg, command_parms)
return return_val
def reply(func):
"""Command decorator function for text replies
Uses the reply_text function to return the value of wrapped function
"""
def command_parms(*args, **kwargs):
bot, update_msg, command_args = get_params(args)
update_msg.reply_text(func(bot, command_args))
return command_parms
def text(func):
"""Command decorator function for text replies
Uses the reply_text function to return the value of wrapped function
"""
def command_parms(*args, **kwargs):
bot, update_msg, command_args = get_params(args)
bot.send_message(update_msg.chat_id, func(bot, command_args))
return command_parms
|
. Surgery remains the only potentially curative treatment for liver metastases. After margin free resection, approximately 30% of the patients present long-term survival. Due to the metastases number and/or volume, only 10 to 15% of the patients are candidates for curative-intent surgery. Thus, the objectives of the diagnostic and therapeutic management are to select adequately the patients for surgery and to improve resection rate by the use of neoadjuvants methods. Positron emission tomography could improve the preoperative detection of hepatic and extrahepatic metastases leading to the exclusion of some patients from useless surgical exploration. For patients with initially resectable tumors, no benefit has been demonstrated for adjuvant chemotherapy. For non resectable metastases, two neoadjuvants methods should be evaluated, chemotherapy to reduce tumor volume and portal vein embolization of the tumor side to improve the hepatic functional reserve and allow larger resection. For non-accessible lesion, selective tumor destruction using radiofrequency offers promising perspectives. In conclusion, the multiplication of the diagnostic and therapeutic methods certainly improve the global management of patients with liver metastases but also makes more difficult the individual choice for the best treatment. For this reason, a multimodal approach is absolutely mandatory. |
Lithium superoxide encapsulated in a benzoquinone anion matrix. Lithium peroxide is the crucial storage material in lithium-air batteries. Understanding the redox properties of this salt is paramount toward improving the performance of this class of batteries. Lithium peroxide, upon exposure to p-benzoquinone (p-C6H4O2) vapor, develops a deep blue color. This blue powder can be formally described as {Li}0.7, though spectroscopic characterization indicates a more nuanced structural speciation. Infrared, Raman, electron paramagnetic resonance, diffuse-reflectance ultraviolet-visible and X-ray absorption spectroscopy reveal that the lithium salt of the benzoquinone radical anion forms on the surface of the lithium peroxide, indicating the occurrence of electron and lithium ion transfer in the solid state. As a result, obligate lithium superoxide is formed and encapsulated in a shell of Li with a core of Li2O2 Lithium superoxide has been proposed as a critical intermediate in the charge/discharge cycle of Li-air batteries, but has yet to be isolated, owing to instability. The results reported herein provide a snapshot of lithium peroxide/superoxide chemistry in the solid state with redox mediation. |
Political leaders have long invoked the grandchildren of tomorrow when speaking of the need to protect the environment. We are those grandchildren, and we are here now.
Families lost everything when Superstorm Sandy decimated their homes in Queens, NY in 2012. When heavily damaged public transportation shut down and obstructed work commutes, they struggled to get back on their feet. Neighbors with homes still standing went months without power, and years later face chronic respiratory illness due to mold exposures from water damage. Coastal communities like these will struggle to recover for years and will experience more extreme weather events in the future due to climate change.
Health-conscious consumers strive to buy “safe” and “natural” soaps, cosmetics, and other products. They trust these products for their labels, but don’t realize that even “non-toxic” nail polishes still contain toxic or otherwise unstudied chemicals. They don’t suspect that their “BPA-Free” reusable water bottle now simply contains a different, but strikingly similar, ingredient toxic to reproductive health: BPS. And they don’t know that most of the receipts they touch daily are not free of BPA. The health of consumers, as well as their future children, depends on a strengthening of regulation of chemicals in cosmetics and consumer products.
Farmers’ livelihoods and trans-generational relationships with Mother Nature hinge on the quality of the land and the weather. Recently, unpredictable rain patterns have forced farmers to endure potential crop damages from droughts or floods in any given year. Changing temperature patterns have altered the growing season and accommodated new pathogens, insects, and weeds that harm crops and animals. Because of these environmental challenges, farmers struggle to maintain their farms’ viability, adopt sustainable agricultural practices, and ensure the food security of their customers.
Residents of many towns with aging infrastructures do not suspect lead contamination of their drinking water or the indoor buildup of harmful pollutants from local traffic. They do not realize that their children’s stomachaches, learning difficulties, and asthma attacks are related to a toxic home, a place expected to be safe and free of such hazards. Many parents now prepare for the possibility of irreversible cognitive impairment and chronic disease in their children.
Native American tribes and environmental justice advocates recently traveled to Standing Rock to show solidarity with fellow clean water protectors over the Dakota Access Pipeline. They peacefully protested the unjust disregard of indigenous people’s water quality and health in the name of oil—a fuel of the past, not the future. Many were appalled to watch scenes of abuse and protests that evoked histories, lifetimes earlier, of the violations of their ancestors’ rights to safe, uncontaminated water. Native American water protectors and their ancestors envisioned the country moving forward in history, not backward.
The environment shapes millions of lives all across America. As trivial party politics obstruct urgently needed action on environmental health, real people experience real consequences. Health is a human right, not a partisan issue.
Our future is tightly intertwined with the actions or inactions that the government takes on environmental public health. To our current political leaders, we ask you to not shy away from dialogue about our environmental challenges. We ask you to advocate for a governmental foundation of environmental health protection that can catalyze problem-solving on these rising health issues. We ask you to defend our present and our future as you prepare to pass the baton to us.
As future leaders, we promise to pick up that baton, and run. We will sprint towards the finish line, faster and stronger than ever before. We are fiercely and passionately learning the science and equipping ourselves with the necessary tools so that we can deliver on the promise of a healthy future for our generation and those to come. We will get involved, we will stay involved, and we will strive forward. Because there is no other option. We are the future, and we are here now.
Anna Young an MS in Environmental Health student at the Harvard T.H. Chan School of Public Health.
Augusta Williams is a doctoral candidate (ScD) in Environmental Health at the Harvard T.H. Chan School of Public Health.
Yasamina McBride is an MS student at the University of Houston, and also affiliated with the Harvard T.H. Chan School of Public Health. |
<reponame>Losses/openapi-typescript-codegen
import type { OperationError } from './OperationError';
import type { OperationParameters } from './OperationParameters';
import type { OperationResponse } from './OperationResponse';
export interface Operation extends OperationParameters {
service: string;
name: string;
hookName: string;
summary: string | null;
description: string | null;
deprecated: boolean;
method: string;
path: string;
pathParameters: string[];
pathPattern: string;
errors: OperationError[];
results: OperationResponse[];
okResults: OperationResponse[];
errorResults: OperationResponse[];
responseHeader: string | null;
}
|
The Relationship between Gaming Addiction, Aggressive Behaviour and Narcissistic Personality Traits among University Students in Malaysia The impact of gaming addiction to all the university students in Malaysia have been concerned by the public as it can cause a lot of problem especially on violence behaviour and the development of narcissistic personality traits. This research aimed to examine the relationship between gaming addiction, aggressive behaviour and narcissistic personality traits among university students in Malaysia among university students in Malaysia. The target sample will be 100 university students between 18 to 30 years old from universities in Malaysia. The survey will include three instruments which are Internet Gaming Disorder Test questionnaire, Aggression Questionnaire and Narcissistic Personality Inventory. The result of data analysis showed that gaming addiction and aggressive behaviour have significantly positive correlation but there is no relationship found between gaming addiction and narcissistic personality traits. The implication of this research is gaming addiction might cause gamer that are addicted to possess aggressive behaviour. |
The long-shuttered Kentucky Fried Chicken fast food joint has been snapped up by Level One Holdings, which aims to build a six-story apartment building.
PARK SLOPE — A developer is aiming to give a long-abandoned fast-food joint on Fourth Avenue new life as a six-story apartment building.
Level One Holdings filed plans last week to raze 98 Fourth Ave., which was once a Kentucky Fried Chicken but has sat derelict for more than a decade, for the new project.
The decaying structure has become an eyesore and a haven for rodents, something the developer hopes to eradicate with the new housing, said a representative for Level One.
“A lot is up in the air right now, but zoning would allow for six stories and the hope is to build up to that," said Shlomi Avdoo, principal and co-founder for the developer. "We don't have a design yet, but it'll be a brand-new building."
It is unclear if the building will be made up of rentals or condos, but it will likely be some time before shovels hit the ground, Avdoo said. The property sits so close to the R subway line that engineers will have to survey how deep the building's foundation can safely go, he explained.
The former KFC at the site sat dormant for years after closing.
Locals who opposed the opening of the eatery to begin with feared it would simply be snapped up by another chain restaurant. But instead, the property sat idle and gradually fell into disrepair, according to Rob Perris, district manager of Community Board 2.
"They were not good neighbors," he said. "The site was not well maintained. It got to the point where we, the Brooklyn Borough President's office and the Park Slope Civic Council all tried to pressure the owner to maintain the site better."
The owner continued to sit on the property until Level One Holdings purchased the land earlier this year. Avdoo would not say how much Level One paid for the parcel.
A swanky new building would be a welcome change from the dilapidated blemish the property has become, said one local.
"That building has basically been reclaimed by the elements," said Park Slope resident Jake Pelham, who has lived in the area for six years. "I'm surprised it took this long, but I'm glad someone is bringing a little life back to that space." |
<reponame>MtzFranVictorManuel/AppGestorProyecto
package sgpca.uv.mx;
import java.io.IOException;
import java.net.URL;
import java.sql.Date;
import java.util.Optional;
import java.util.ResourceBundle;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Alert;
import javafx.scene.control.Button;
import javafx.scene.control.ButtonType;
import javafx.scene.control.DatePicker;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;
import javafx.stage.Stage;
import sgpca.uv.mx.bussinesslogic.ResearchProyectDAO;
import sgpca.uv.mx.domain.ResearchProyect;
public class ResearchProyectController implements Initializable {
@FXML
private TextField textFieldTitle;
@FXML
private DatePicker datePickerStartDate;
@FXML
private DatePicker datePickerFinishDate;
@FXML
private TextArea textFieldDescription;
@FXML
private TextField textFieldAssociates;
@FXML
private Button buttonSave;
@FXML
private Button buttonCancel;
@Override
public void initialize(URL url, ResourceBundle rb) {
}
@FXML
private void saveResearchProyect(ActionEvent event) {
if(!validateResearchTxf()){
emptyTxfAlert();
}else{
ResearchProyectDAO researchDAO = new ResearchProyectDAO();
ResearchProyect researchProyect;
String title, description, associates;
Date startDate, finishDate;
title = textFieldTitle.getText();
startDate = Date.valueOf(datePickerStartDate.getValue());
finishDate = Date.valueOf(datePickerFinishDate.getValue());
description = textFieldDescription.getText();
associates = textFieldAssociates.getText();
researchProyect = new ResearchProyect(title, description, startDate, finishDate);
researchDAO.saveResearchProyect(researchProyect);
confirmSaveResearchProyect();
cleanResearchProyectTxf();
closeWindow();
}
}
@FXML
private void cancelSaveResearchProyect(ActionEvent event) {
Alert saveAlert = new Alert(Alert.AlertType.CONFIRMATION);
saveAlert.setHeaderText(null);
saveAlert.setTitle("Exit");
saveAlert.setContentText("Cancel research proyect register?");
Optional<ButtonType> action = saveAlert.showAndWait();
if(action.get() == ButtonType.OK){
closeWindow();
}
}
private void confirmSaveResearchProyect(){
Alert saveAlert = new Alert(Alert.AlertType.INFORMATION);
saveAlert.setHeaderText(null);
saveAlert.setTitle("Research Proyect Saved");
saveAlert.setContentText("The research proyect has been saved");
saveAlert.showAndWait();
}
private void cleanResearchProyectTxf() {
textFieldTitle.setText("");
datePickerStartDate.setValue(null);
datePickerFinishDate.setValue(null);
textFieldDescription.setText("");
textFieldAssociates.setText("");
}
private boolean validateResearchTxf(){
boolean validTxf = true;
if(textFieldTitle.getText().isEmpty() || datePickerStartDate.getValue() == null || datePickerFinishDate.getValue() == null || textFieldDescription.getText().isEmpty() || textFieldAssociates.getText().isEmpty()){
validTxf = false;
}
return validTxf;
}
private void emptyTxfAlert() {
Alert emptyAlert = new Alert(Alert.AlertType.WARNING);
emptyAlert.setHeaderText(null);
emptyAlert.setTitle("Empty fields");
emptyAlert.setContentText("Complete all the fields");
emptyAlert.showAndWait();
}
public void closeWindow() {
try {
FXMLLoader loader = new FXMLLoader(getClass().getResource("ProyectListView.fxml"));
Parent root = loader.load();
ProyectListController controller = loader.getController();
Scene scene = new Scene(root);
Stage stage = new Stage();
stage.setScene(scene);
stage.setTitle("");
stage.show();
Stage myStage = (Stage) this.buttonCancel.getScene().getWindow();
myStage.close();
} catch (IOException e) {
System.out.println(e.getMessage());
}
}
}
|
Changing Words in a Changing World: A Source-Based and Process Approach to Teaching Vocabulary. A source-based approach to teaching vocabulary means starting with basic concepts that have been in human languages since their beginnings and then working with lexical and metaphorical extensions of these basic words. The purpose is not so much to teach children history, as it is to find groups of words. When words are taught in related groups, the meanings reinforce each other and'children gain insights into language as a system. Fundamental principles of the source-based approach include the following: words have multiple meanings; right answers are better than wrong answers; teachers should move from the known to the unknown; thinking skills are more important than memorization skills; language is a social phenomenon; and teachers need to recognize the difference between coincidental puns and metaphorical extensions. Includes three suggested readings and a sample chart from a lesson. (PM) Reproductions supplied by EDRS are the best that can be made from the original document. Changing Words in a Changing World: A Source-Based and Process Approach to Teaching Vocabulary. By Aileen and Don Nilsen Paper presented at the Annual International Reading Association Convention (48th, Orlando, FL, May 4-8, 2003) PERMISSION TO REPRODUCE AND DISSEMINATE THIS MATERIAL HAS BEEN GRANTED BY TO THE EDUCATIONAL RESOURCES INFORMATION CENTER (ERIC) 1 U.S. DEPARTMENT OF EDUCATION Office of Educational Research and Improvement EDUCATIONAL RESOURCES INFORMATION CENTER (ERIC) This document has been reproduced as received from the person or organization originating it. Minor changes have been made to improve reproduction quality. Points of view or opinions stated in this document do not necessarily represent official OERI position or policy. tr) c/) 2 BEST COPY AVAILABLE Changing Words in a Changing World: A Source-Based and Process Approach to Teaching Vocabulary Aileen and Don Nilsen Workshop on Sunday, May 5th 11:00 a.m. to 1:45 p.m. Peabody Orlando Hotel, Bayhill Suites I & II What Is a Source-Based Approach? A source-based approach to teaching vocabulary means starting with basic concepts that have been in human languages since their beginnings and then working with lexical and metaphorical extensions of these basic words. The purpose is not so much to teach children history as to find groups of words that can be taught as what are commonly referred to as webs, gestalts, ladders or scaffolding. When words are taught in related groups, the meanings reinforce each other and children gain insights into language as a system. A source-based approach works well with such basic topics as body parts (e.g., headquarters, footnotes, skeleton outlines, arterial highways, to shoulder a responsibility, and to back out of a commitment), farming (e.g., a fertile imagination, a cultivated person, a harrowing experience, a budding genius), and food (salt of the earth, a souped-up car, bringing home the bacon, and the cherry on top of the sundae). The authors of several recent vocabulary books have gone on record as supporting the teaching of related words. However, since they lack a systematic way of finding related words, they give a few examples and then leave classroom teachers to figure out their own sets of words. Few classroom teachers have the time or the training to do this except on an occasional basis. In the workshop, we will provide teachers with many word sets that can be used as the skeletons on which to build vocabulary lessons. And more importantly, we will introduce teachers to these fundamental principles of a source-based approach, which illustrate how teachers can lead children to the kind of intellectual growth that L. S. Vygotsky writes about and that current researchers in psychology and education hold up as being needed. Words have multiple meanings. English and reading teachers frequently tell students to "use the context" to figure out a word's meaning. Most students find this to be frustrating advice because rather than telling readers what a word means, context clues serve primarily to help students screen out meanings that do not make sense in a given context. Children who know only one meaning for a word, along with those who mistakenly believe that words have only one meaning, have no resources from which to choose an appropriate meaning. To illustrate, even such simple words as tooth and teeth have both basic and extended meanings. Children in kindergarten can understand the shape-based metaphors of the teeth in combs, saws, rakes, and gears, but it took a class discussion for our college students to figure out what was meant when the Arizona State Legislature was criticized for passing a bill with no teeth in it. The bill had no bite; it was not enforceable. In between these two levels of meaning, are such common allusions as having a sweet tooth, gritting your teeth, fighting tooth and nail, escaping by the skin of one's teeth, and going over something with a fine-toothed comb. In a source-based approach, this lesson on teeth would be followed by a lesson on dent, the French word for tooth as seen in dentist, orthodontist, dental |
<reponame>lemrey/zephyr
/*
* Copyright (c) 2017 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @addtogroup t_pinmux_basic
* @{
* @defgroup t_pinmux_gpio test_pinmux_gpio
* @brief TestPurpose: verify PINMUX works on GPIO port
* @details
* - Test Steps (Quark_se_c1000_devboard)
* -# Connect pin_53(GPIO_19) and pin_50(GPIO_16).
* -# Configure GPIO_19 as output pin and set init LOW.
* -# Configure GPIO_16 as input pin and set LEVEL HIGH interrupt.
* -# Set pin_50 to PINMUX_FUNC_A and test GPIO functionality.
* -# Set pin_50 to PINMUX_FUNC_B and test GPIO functionality.
* - Expected Results
* -# When set pin_50 to PINMUX_FUNC_A, pin_50 works as GPIO and gpio
* callback will be triggered.
* -# When set pin_50 to PINMUX_FUNC_B, pin_50 works as I2S and gpio
* callback will not be triggered.
* @}
*/
#include <gpio.h>
#include <pinmux.h>
#include <ztest.h>
#define PINMUX_NAME CONFIG_PINMUX_NAME
#if defined(CONFIG_BOARD_QUARK_SE_C1000_DEVBOARD)
#define GPIO_DEV_NAME DT_GPIO_QMSI_0_NAME
#define GPIO_OUT 15 /* GPIO15_I2S_RXD */
#define GPIO_IN 16 /* GPIO16_I2S_RSCK */
#define PIN_IN 50 /* GPIO16_I2S_RSCK */
#elif defined(CONFIG_BOARD_QUARK_SE_C1000_DEVBOARD_SS)
#define GPIO_DEV_NAME DT_GPIO_QMSI_SS_0_NAME
#define GPIO_OUT 4 /* GPIO_SS_AIN_12 */
#define GPIO_IN 5 /* GPIO_SS_AIN_13 */
#define PIN_IN 13 /* GPIO_SS_AIN_13 */
#elif defined(CONFIG_BOARD_ARDUINO_101)
#define GPIO_DEV_NAME DT_GPIO_QMSI_0_NAME
#define GPIO_OUT 16 /* IO8 */
#define GPIO_IN 19 /* IO4 */
#define PIN_IN 53 /* IO4 */
#elif defined(CONFIG_BOARD_ARDUINO_101_SSS)
#define GPIO_DEV_NAME DT_GPIO_QMSI_SS_0_NAME
#define GPIO_OUT 2 /* AD0 */
#define GPIO_IN 3 /* AD1 */
#define PIN_IN 11 /* AD1 */
#elif defined(CONFIG_BOARD_QUARK_D2000_CRB)
#define GPIO_DEV_NAME DT_GPIO_QMSI_0_NAME
#define GPIO_OUT 8 /* DIO7 */
#define GPIO_IN 9 /* DIO8 */
#define PIN_IN 9 /* DIO8 */
#endif
#define MAX_INT_CNT 10
static bool cb_triggered;
static void callback(struct device *dev,
struct gpio_callback *gpio_cb, u32_t pins)
{
static int cb_cnt;
TC_PRINT("callback triggered: %d\n", ++cb_cnt);
if (cb_cnt >= MAX_INT_CNT) {
cb_triggered = true;
gpio_pin_write(dev, GPIO_OUT, 0);
}
}
static int test_gpio(u32_t pin, u32_t func)
{
u32_t function;
struct gpio_callback gpio_cb;
struct device *pinmux = device_get_binding(PINMUX_NAME);
if (!pinmux) {
TC_PRINT("Cannot get PINMUX\n");
return TC_FAIL;
}
struct device *gpio_dev = device_get_binding(GPIO_DEV_NAME);
if (!gpio_dev) {
TC_PRINT("Cannot get GPIO device\n");
return TC_FAIL;
}
cb_triggered = false;
/* 1. Configure PIN_OUT and set init voltage */
if (gpio_pin_configure(gpio_dev, GPIO_OUT, GPIO_DIR_OUT)) {
TC_PRINT("PIN_OUT configure fail\n");
return TC_FAIL;
}
if (gpio_pin_write(gpio_dev, GPIO_OUT, 0)) {
TC_PRINT("Set PIN_OUT init LOW fail\n");
return TC_FAIL;
}
/* 2. Configure PIN_IN and set callback */
if (gpio_pin_configure(gpio_dev, GPIO_IN,
GPIO_DIR_IN | GPIO_INT | GPIO_INT_DEBOUNCE |
GPIO_INT_LEVEL | GPIO_INT_ACTIVE_HIGH)) {
TC_PRINT("PIN_IN configure fail\n");
return TC_FAIL;
}
gpio_init_callback(&gpio_cb, callback, BIT(GPIO_IN));
if (gpio_add_callback(gpio_dev, &gpio_cb)) {
TC_PRINT("Set PIN_IN callback fail\n");
return TC_FAIL;
}
gpio_pin_enable_callback(gpio_dev, GPIO_IN);
/* 3. Verify pinmux_pin_set() */
if (pinmux_pin_set(pinmux, pin, func)) {
TC_PRINT("Fail to set pin func, %u : %u\n", pin, func);
return TC_FAIL;
}
/* 4. Verify pinmux_pin_get() */
if (pinmux_pin_get(pinmux, pin, &function)) {
TC_PRINT("Fail to get pin func\n");
return TC_FAIL;
}
/* 5. Verify the setting works */
if (function != func) {
TC_PRINT("Error. PINMUX get doesn't match PINMUX set\n");
return TC_FAIL;
}
/* 6. Set PIN_OUT HIGH and verify pin func works */
if (gpio_pin_write(gpio_dev, GPIO_OUT, 1)) {
TC_PRINT("Set PIN_OUT HIGH fail\n");
return TC_FAIL;
}
k_sleep(1000);
if (cb_triggered) {
TC_PRINT("GPIO callback is triggered\n");
return TC_PASS;
} else {
TC_PRINT("GPIO callback is not triggered\n");
return TC_FAIL;
}
}
void test_pinmux_gpio(void)
{
zassert_true(test_gpio(PIN_IN, PINMUX_FUNC_A) == TC_PASS, NULL);
zassert_true(test_gpio(PIN_IN, PINMUX_FUNC_B) == TC_FAIL, NULL);
}
|
5. Studies on Specific Books This recent addition to the New Cambridge Bible Commentary series provides a very readable commentary on the book of Genesis. The work opens with a general introduction and helpful list of items for further reading on different aspects of Genesis. After this, each section of commentary is prefaced by the printing of the NRSV text (arguably a waste of paper, taking up about 80 pages altogether). The commentary attempts to do justice to both diachronic and synchronic aspects of the text and is very up-to-date in its bibliographical citations, which will be appreciated by scholars. Scattered throughout the work are sections devoted to relevant topics, e.g. The Role of Women in Genesis 23 and Genealogies in the Bible, which should prove helpful to the general reader. Inevitably, not all scholars will agree with all A.s conclusions. Thus, whilst I agree with him that J is a pre-exilic source, I cannot share his pre-exilic dating of P, and his view that the original Joseph story was a unity (though subsequently broken apart towards the end) does not do justice to some of the discrepancies within it. Again, the idea that Baal lies behind the serpent in Genesis 3 is highly dubious, as is the notion that the Joseph story has its likely setting in the Hyksos period. There are also occasions when a bit more explanation is called for, e.g. A. fails to discuss the different interpretations of the tree of the knowledge of good and evil. However, in general this is a commentary that will be appreciated by a wide range of readers. J. DAY |
<gh_stars>0
import codecs
import os.path
import pickle
import requests
import time
import json
from django.core.exceptions import ValidationError
def populate_series_item(series_obj):
try:
info = api_get_info(series_obj)
except Exception as e:
raise ValidationError(repr(e))
series_obj.title = info['title']['romaji']
series_obj.title_eng = info['title']['english'] if (info['title']['english'] is not None) else ''
series_obj.api_id = int(info['id'])
series_obj.series_type = info['type']
series_obj.synopsis = info['description']
series_obj.cover_link = info['coverImage']['large']
series_obj.ani_link = 'https://anilist.co/{0!s}/{1!s}'.format(str(series_obj.series_type), str(series_obj.api_id))
if info['idMal'] is not None:
series_obj.mal_link = 'https://myanimelist.net/{0!s}/{1!s}'.format(str(series_obj.series_type).lower(),
str(info['idMal']))
def api_get_info(series_obj):
query = '''
query ($id: Int) { # Define which variables will be used in the query (id)
Media (id: $id) { # Insert our variables into the query arguments (id) (type: ANIME is hard-coded in the query)
id
idMal
title {
romaji
english
}
type
description
coverImage {
large
}
}
}
'''
variables = {'id': series_obj.api_id}
url = 'https://graphql.anilist.co'
# Make the HTTP Api request
response = requests.post(url, json={'query': query, 'variables': variables})
return json.loads(response.content.decode("utf-8"))['data']['Media']
|
#pragma once
#include "hash.hpp"
#include "hex.hpp"
#include <array>
#include <cstdint>
|
package com.example.administrator.pull_listview;
import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.PopupWindow;
import android.widget.RelativeLayout;
import android.widget.TextView;
import java.util.ArrayList;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
/**
* Created by Administrator on 2017/7/31 0031.
*/
public class custom_Pull_ListView extends RelativeLayout {
@BindView(R.id.setting)
ImageView setting;
@BindView(R.id.edit)
EditText edit;
private PopupWindow popupWindow;
private ArrayList al = new ArrayList();
public custom_Pull_ListView(Context context) {
this(context,null);
}
public custom_Pull_ListView(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}
private void init() {
View view = LayoutInflater.from(getContext()).inflate(R.layout.custom_layout,this);
ButterKnife.bind(this);
mockData();
}
private void mockData() {
for (int i = 0; i <50 ; i++) {
al.add(String.valueOf(i));
}
}
@OnClick(R.id.setting)
public void onViewClicked() {
if(popupWindow == null){
int width = edit.getWidth();
int height = 300;
popupWindow = new PopupWindow(width,height);
/* TextView tv = new TextView(this);
tv.setBackgroundColor(Color.GREEN);*/
ListView lv = new ListView(getContext());
lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
//设置光标位置
String s = al.get(i) +"";
edit.setText(s);
edit.setSelection(s.length());
popupWindow.dismiss();
}
});
lv.setAdapter(baseAdapter);
popupWindow.setContentView(lv);
//获得焦点
popupWindow.setFocusable(true);
//消失popwindow
popupWindow.setOutsideTouchable(true);
//popupWindow.setBackgroundDrawable(new ColorDrawable());
}
//显示popWindow ,这个要放在最后面不然,上面的点击pop 外部不会响应事件
popupWindow.showAsDropDown(edit);
}
private BaseAdapter baseAdapter = new BaseAdapter() {
@Override
public int getCount() {
return al.size();
}
@Override
public Object getItem(int i) {
return null;
}
@Override
public long getItemId(int i) {
return 0;
}
@Override
public View getView(int i, View view, ViewGroup viewGroup) {
ViewHolder viewHolder;
if(view == null){
view = LayoutInflater.from(getContext()).inflate(R.layout.item_layout,null);
viewHolder = new ViewHolder(view);
view.setTag(viewHolder);
}else {
viewHolder = (ViewHolder) view.getTag();
}
final String data = al.get(i) +"";
viewHolder.num.setText(al.get(i)+"");
viewHolder.delate.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
al.remove(data);
notifyDataSetChanged();
}
});
return view;
}
};
public class ViewHolder{
ImageView delate;
TextView num;
public ViewHolder(View view){
delate = view.findViewById(R.id.delate);
num = view.findViewById(R.id.num);
}
}
}
|
FINANCIAL MANAGEMENT OF FARMERS ASSOCIATIONS FOR SMALL-SCALE GROWERS : LESSONS FROM THE MALELANE MILL CANE COMMITTEE There has recently been a lack of participation in projects aimed at small-scale farmers in the Malelane Mill Area. The authors believe that this problem is being experienced throughout the sugar industry. Investigations conducted by the Canegrowers Grower Support Officer indicated that a lack of institutional capacity at project level, to successfully and sustainably manage financial affairs, has contributed to the collapse of the small-scale projects. The ineffective management of communal accounts was a cause for concern, as free riding was evident. Some growers were subsidising others. To strengthen and tighten financial control, it was imperative to provide technical and material support to the project leadership. This was achieved by facilitating compulsory induction training on institutional governance and basic financial management to the project clerks and chairpersons. This was aimed at capacitating the leadership and promoting accountability. Clerks were provided with a template to capture monthly expenditure and balance against bank statements. The Mill Cane Committee (MCC) administrator captures the individual project templates and supervises this process monthly, and the MCC retains copies for record purposes. The implementation of these measures had a positive impact, as it immediately exposed growers who defaulted in paying their association charges. The project chairpersons are now able to present the consolidated financial report at the grower meetings and at the annual general meeting (AGM). The improved accountability by the leadership has minimised delays in routine maintenance and conducting emergency repairs. |
import { v4 as uuidv4 } from 'uuid';
import {
getNextPathToken,
isTokenEmpty,
NavigableContent,
SubStateCoreInfo,
TestLocation,
UsesLocation,
HookMap,
} from '@moxb/moxb';
import { inject, observer } from 'mobx-react';
import { renderSubStateCore } from './rendering';
import { UIFragmentSpec } from './UIFragmentSpec';
/**
* This is the full spec of the root-or-details component
*/
interface OwnProps<DataType> {
ifRoot: SubStateCoreInfo<UIFragmentSpec, DataType>;
ifDetails: SubStateCoreInfo<UIFragmentSpec, DataType>;
}
type ComponentProps<DataType> = UsesLocation & NavigableContent<UIFragmentSpec, DataType>;
export interface DetailProps {
token: string;
}
export function rootOrDetails<DataType>(ownProps: OwnProps<DataType>) {
const nodeId = uuidv4();
return inject('locationManager')(
observer((props: ComponentProps<DataType>) => {
const { navControl } = props;
// console.log('root-or-details navControl is', navControl);
const rootHooks = new HookMap();
const detailHooks = new HookMap();
const isRootActive = () => navControl.isActive() && isTokenEmpty(getNextPathToken(props));
const isDetailActive = () => navControl.isActive() && !isRootActive();
/**
* We register ourselves as a change interceptor,
* because we might have to hide some content
* on location changes, and we want to know about that
* in advance, so that we can suggest some questions to ask
* from the user.
*/
props.locationManager!.registerChangeInterceptor({
getId() {
return nodeId;
},
/**
* This is our "change interceptor" hook, that will be called by the
* `LocationManager`.
*/
// tslint:disable-next-line:cyclomatic-complexity
anyQuestionsFor(location: TestLocation): string[] {
const oldToken = getNextPathToken(props);
const oldRoot = isTokenEmpty(oldToken);
const newToken = location.pathTokens[props.parsedTokens!];
const newRoot = isTokenEmpty(newToken);
if (newRoot) {
if (oldRoot) {
// Staying at root, nothing to do.
} else {
// Going from detail to root.
// We would hide the detail, so check with it.
return detailHooks
.getAll()
.map((h) => (h.getLeaveQuestion ? h.getLeaveQuestion() : undefined))
.filter((q) => !!q) as string[];
}
} else {
if (oldRoot) {
// Going from root to detail.
// We would hide the root, so check with it.
return rootHooks
.getAll()
.map((h) => (h.getLeaveQuestion ? h.getLeaveQuestion() : undefined))
.filter((q) => !!q) as string[];
} else {
// Staying ad detail, nothing to do
}
}
return [];
},
});
const { ifRoot, ifDetails } = ownProps;
const token = getNextPathToken(props);
if (isTokenEmpty(token)) {
return renderSubStateCore({
state: ifRoot,
navigationContext: props,
checkCondition: true,
navControl: {
getParentName: () => 'rootOrDetail:root',
getAncestorNames: () => [...navControl.getAncestorNames(), 'rootOrDetail:root'],
isActive: isRootActive,
registerStateHooks: rootHooks.set,
unregisterStateHooks: rootHooks.reset,
},
});
} else {
const detailProps: DetailProps = {
token,
};
return renderSubStateCore({
state: ifDetails,
navigationContext: props,
tokenIncrease: 1,
extraProps: detailProps,
checkCondition: true,
navControl: {
getParentName: () => 'rootOrDetail:detail',
getAncestorNames: () => [...navControl.getAncestorNames(), 'rootOrDetail:detail'],
isActive: isDetailActive,
registerStateHooks: detailHooks.set,
unregisterStateHooks: detailHooks.reset,
},
});
}
})
);
}
|
package com.u2.day13.eight;
public class Car implements Vehicle {
@Override
public void transport() {
System.out.println("陆运");
}
}
|
The measurement of blood pressure by the linear method compared to the deflation methods differently modifies the pulse oximeter alarm frequency Background Noninvasive blood-pressure measurement device and pulse oximeter are important for patient monitoring. When these are placed on the same side, cuff inflation sometimes causes measurement failure by pulse oximeter. Objective The present study aimed to compare the pulse oximeter alarm frequency and pulse-wave disappearance duration between noninvasive blood-pressure measurement using the deflation method and that using the linear inflation method. Methods The study included 10 healthy subjects. The cuff for automatic sphygmomanometer was wrapped on one side of the upper arm and for pulse oximeter was attached to the thumb of the same side of upper limbs. Results The alarm frequency was 0 and 26% using the linear inflation and the deflation methods, respectively. Additionally, the pulse-wave disappearance duration was significantly longer using the deflation method than that using the linear inflation method (10.0 ± 1.5 vs 1.7 ± 0.8 s). With the linear inflation method, this duration was or less 3 s. In the deflation method, an excess pressure of 40 mmHg was used, which caused the alarm to turn on. Additionally, the heart rate was found to influence the alarm occurrence during measurement using the deflation method. Conclusion Heart rate may influence alarm occurrence during blood-pressure measurement using the step deflation method. Using the linear inflation method, the risks of alarm occurrence and measurement failure are low, even when the pulse oximeter and blood-pressure measurement cuffs are installed on the same side, suggesting that this method is suitable for clinical use. |
SINGAPORE (Reuters) - Boeing Co (BA.N) is hopeful that South Korea will decide on the purchase of the P-8 Poseidon maritime patrol aircraft by the end of the year, its head of defense sales said on Wednesday.
“That could very well be the next customer,” Boeing Vice President of Global Sales, Defense, Space & Security, Gene Cunningham, told Reuters at the Singapore Airshow.
In the Asia-Pacific region, Boeing has already sold the P-8 to India and Australia. |
Terrorism Threat in Doctrine Formulating of Military Campaign Scenario to Achieve National Security On Estimative Methodology Review Based on the estimation methodology on the potential of the war against terrorism on the transformation of doctrine, the conclusions based on the predictive analysis are: The potential for the war against terrorism has a very strong relevance to the prediction of changes in military campaign doctrine in the long term by producing new war strategies both in terms of ends-means-ways as a result of High Impact Low Probability, Through predictive analysis with extrapolation model, it is found that threats, strategic environment and tradition or history are variables that are expected to remain unchanged, especially in the short term in influencing the preparation of Military Campaign Doctrine, The Projection Model determines if Threat is the variable that changes the most so that it will affect changes in the Military Campaign Doctrine in the short to medium term, Looking for the best solution in realizing the best Military Campaign Doctrine. This can be followed by designing a simulation of the New War Strategy as a result of forecasting the Military Campaign Doctrine. Introduction The threat of terrorism is a hybrid threat that uses a combination of military and non-military methods in peacetime to achieve traditional military objectives and to conquest of the certain territorials and thereby changing the "facts on the ground" without triggering actual conflict. According to Michael Mazarr, from the National War College revealed that the war on peacetime terrorism aims to achieve military goals, namely battlefield control. It emphasizes the linearity between terrorism and the threat of Terrorism that "the goal of the war on Terrorism is to win a conclusive campaign through the use of force and some degree of violence, or to prepare some kind of decisive military action." The threat of terrorism is also mentioned as another concept of hybrid warfare as explained in Ministry of Defense Regulation number 19 of year 2015 regarding the Policy for the Implementation of National Defense namely that this form of war combines conventional war or threats, asymmetric, terrorist and cyber warfare, as well as diverse and dynamic criminals. In addition to these various combinations of threats, the war on terrorism can also take the form of an integrated attack between the use of Chemical, Biological, Radiological, Nuclear and Explosive (CBRNE), and information warfare. The government's seriousness in managing the country's defense and security is not only projected to face external enemies but also, prepare for the possibility of developing the problem of terrorism in the country. The purchase of Indonesian Armed Forces (TNI) weapons equipment in the last three years is also prepared for the possibility of facing the war. TNI readiness to face the threat of terrorism is a military strategy that combines conventional war, irregular war and terror threats, including further terror motives by utilizing social media, information to nuclear attacks, biological and chemical weapons, improvised explosive devices and information warfare. Faced with modern war doctrine and a complex spectrum of threats, it is deemed necessary if the Military Campaign as part of War Military Operations is time to transform with strategic objectives, one of which is the ability to deal with the threat of terrorism. As a basis for thinking and acting, of course, the Military Campaign must be based on a doctrine that can be adaptive to changing times and the mission objectives to be achieved, including in overcoming the threat of terrorism. In the future, the Military Campaign doctrine needs to be able to accommodate the way of acting in joint TNI operations to be deployed when facing threats in the category of terrorism threats. In order to predict the trend of the threat of terrorism, it is necessary to have the role of intelligence that will comprehensively analyze how relevant it will be in the future, so it is necessary to prepare an increasingly adaptive doctrine. The intelligence analysis process requires a special method known as Estimative Methodology where the predictive analysis presented regardless of the configuration will be able to accurately predict several key variables to be presented through several levels of analysis to customers as decision making material. Efforts to carry out predictive analysis of potential threats of terrorism in the future are important because terrorism itself has been classified as a Political Situation Issue Decomposition as one of the trends in world strategic political issues. The picture above describes that the threat of terrorism is included in the strategic intelligence issue whose data continues to be explored. This is relevant to the development of the main characteristics of the role of modern intelligence, namely: a. Analysis can take many forms by utilizing multiple sources in an effort to obtain more complete data and information. Some of the sources include special expertise from the academic, social media, or industrial domains. b. Analysis of any subject is an ongoing process. Customers are increasingly in need of intelligence support on a daily basis regarding several issues, both general and specific. Methodology Prediction in an intelligence product is a crucial thing needed by decision makers. Through the use of Estimative Methodology, various predictive analysis processes are carried out in order to obtain high validity and reliability of information so as to achieve a reliable level of analysis so that predictions on the future condition of an intelligence object can be estimated. Different estimation methods are used in different conditions. Several models of estimative methodology, one of which is applied to military intelligence through a predictive analysis process, include. a. Extrapolation Models. This prediction method is the most conservative method and is suitable for short-term hssr.ideasspread.org Humanities and Social Science Research Vol. 4, No. 3; estimation. In its simplest form, extrapolation, using historical performance as a basis, to indicate future directions. (Determining the estimated object variable extrapolated to the future without changing the variable). b. Projection Models. In this model, it is done by predicting various possible futures based on the assumption that the forces that have prevailed in the past will change, while extrapolation assumes that the forces do not change (Determining one variable that is considered the most dominant or most influential in the future). c. Model Forecasting (Forecasting). The prediction model in this intelligence activity is to determine the alternative future of the target, not just the most likely future. However, being able to formulate long-term alternatives and scenarios that are most likely to occur in the future (Determining new variables outside of existing variables but still having relevance among them). d. Of the three forecasting models that lead to the emergence of new variables when forecasting is carried out, the next step is to determine which of these variables has the greatest effect but has a low probability of occurrence (High Impact Low Probability). The result of High Impact Low Probability (HILP) is a Demonstration Scenario and the process to determine HILP is carried out through the following stages: 1) Determining the variables that are considered to have the most significant impact on the outcome because this will be analyzed continuously. 2) Develop a logical description of the analysis of several variables or forces that are expected to have the least impact. This is important in determining the indicators that need to be monitored during the predictive analysis process. 3) Determine the single most significant factor that can trigger a sudden and comprehensive change to the object of analysis. 4) Carry out a brainstorming process regarding the breadth of experience of each intelligence agent in an effort to find the most likely strengths or variables, which are unpredictable but can change the entire analysis result suddenly. 5) Always carry out monitoring of the indicators that have been determined to prevent them from getting out of the way of analysis. 6) Identify all of the estimated factors that will either lead to good or bad outcomes. Determining an estimate for future global conditions can be done by studying the strategic environment in the military, political and economic as well as social aspects which tend to change rapidly. These problems have a hssr.ideasspread.org Humanities and Social Science Research Vol. 4, No. 3; Published by IDEAS SPREAD strength component that can be identified using variants of the strategy methodology. Forecasts of changes in these forces are analyzed through trends and the resulting events then between one event/trend are linked together through techniques such as cross-impact analysis. The result is a "most likely" future forecast made in a scenario format. If the forecasts made work well, it will encourage policy makers to make decisions and for the intelligence world, will result in action in response to real and unreal threats. In order to get valid and reliable prediction results, several processes are carried out, including brainstorming. This step is very important in determining the six main questions on the object of estimation or called the Six-pointed Star which includes "Who, What, When, Where, Why and How".. In addition, through the brainstorming stage, it will be possible to determine the key assumption check stage, which is a hypothesis that has been declared true and is part of defining the problem or as a product of the final assessment. Result The existence of the threat of terrorism can be understood as part of a hybrid war that combines military and nonmilitary threats that occur in peacetime to achieve the goal of the threat in the form of the results of traditional military warfare, for example territorial control or conquest. The threat of terrorism in principle can achieve the objectives of conventional war without triggering actual conflict. Therefore, being faced with modern war doctrine and a complex spectrum of threats is necessary if the Military Campaign as part of War Military Operations is time to transform with strategic objectives, one of which is the ability to deal with the threat of terrorism. As a basis for thinking and acting, of course, the Military Campaign must be based on a doctrine that can be adaptive to the mission objectives to be achieved, including overcoming the threat of terrorism. In the future, the Military Campaign doctrine needs to be able to accommodate the way of acting in joint TNI operations to be deployed when facing threats in the category of terrorism threats. Therefore, it is necessary to make an effort or implement predictive analysis in order to determine the form of the military campaign doctrine in the future based on several variables that will be determined next. In carrying out Predictive Analysis, it is necessary to carry out several stages which will later be processed through several predictive analysis models, both extrapolation, projection and Forecast (Forecasting). The steps taken based on the research focus are the Dynamics of the Threat of Terrorism to the Transformation of the Doctrine of the Indonesian Military Campaign to Realize National Security, namely: a. Determining a condition of an entity whose existence can be predicted based on past conditions to the future. The entity that is focused here is the Military Campaign Doctrine. b. Determine the forces or several factors that affect the existence of the entity which in this case is the Military Campaign Doctrine. The forces or factors that influence it are the Threat Spectrum, the Dynamics of the Strategic Environment, and the Tradition or History of the Nation's Struggle (Thomas Aquinas and Hugo Grotius, 1631). These three factors will be used as variables that are fixed / will not change in the future even though their value will increase or decrease as an Extrapolation Model. c. In the three forces or factors, one factor is determined which is predicted to have the most dominant influence or experience the highest dynamics. It will be used predictive analysis with the Projection Model in this case is the Threat Spectrum. Vol. 4, No. 3; model is referred to as the Forecast Model. The forces that are estimated to appear are New War Strategies. Variable/ Model of Predictive Analysis The relationship between the variables and the predictive model of analysis can be seen in Figure 3. e. Determine predictions of the future state of the Military Campaign Doctrine as an entity or model target based on the assessment of each force. Each strength will be measured or weighed based on its weight. The dominant strength will be measured in this prediction through several estimation tools, including Regression and Monte Carlo Simulation. Discussion Based on the results of the predictive analysis above, it is found that from the three fixed variables used for extrapolation, one dominant variable will be obtained, namely Threat as a result of the projection. This indicates that the Military Campaign Doctrine in the future must be adaptive to the dynamics of threats that occur where the threat of terrorism is included. So it is appropriate if the potential threat of terrorism needs to be predicted in the future so that the doctrine that is prepared is in accordance with the needs of military operations. Specifically also obtained prediction results with forecasting that War Strategy will turn out to be a new variable that appears and is in accordance with the rules of predictive analysis, so this is an indication that for the future war strategy will continue to transform even though the possibility is small but the effect is very large (High Implact Low Probability ). This condition is very relevant because the battle strategy if predicted will not change much from the classical theory of strategy which states that "a coherent expression of a process that identifies the ends, ways, and means designed to achieve a certain goal. Mathematically, we might express this as "Strategy = Ends + Ways + Means." Ends are the objectives or desired outcomes of a given strategy. The term end-state is synonymous with ends. An end or ends comprises the goal of the strategy. Ways are actions". The next step after successfully determining a new variable from the forecasting model which is a variable with a High Impact Low Probability character, is to design a Demonstration Scenario. The scenario, which is the product of the High Impact Low Probability analysis, can be generated if an intelligence analyst is able to identify the High Impact Outcome and then determine a logical way to achieve it. There are several ways to get High Impact Outcome, one of them is by using an alternative version of the Demonstration Scenario, namely Branch-point Scenario. The main function of the demonstration scenario is to pay more attention to the results of the analysis of the branchpoint scenario than the final results of the analysis. So the new War Strategy as HILP, for an intelligence analyst will not focus on the War Strategy, but rather on how to realize the new war strategy because it has the greatest impact even though it is unlikely to have an effect on the military campaign doctrine that will later faced with the war against terrorism. The stages in getting the best scenario in determining the best Military Campaign Doctrine generally follow the following phases are a. Determining the Problem. This leads to "What question will the new Military Campaign Doctrine actually answer? b. Identify what factors will influence the preparation of the Military Campaign Doctrine. In this phase, intelligence analysis will determine the main factors and priorities in the preparation of the Military Campaign Doctrine. c. Identify the most feasible solution to implement. In principle, there are several more scenarios in it, namely: Emergency Scenario (Created by positioning intelligence analysts as opponents), What-if Scenario unlimited (unconstrained) and What-if Scenario limited (constrained). d. Looking for the best solution in realizing the best Military Campaign Doctrine. This can be followed by designing a simulation of the New War Strategy as a result of forecasting the Military Campaign Doctrine. Conclusion Based on the estimation methodology on the potential of the war against terrorism on the transformation of doctrine, the conclusions based on the predictive analysis are: a. The potential for the war against terrorism has a very strong relevance to the prediction of changes in military campaign doctrine in the long term by producing new war strategies both in terms of ends-means-ways as a result of High Impact Low Probability. b. Through predictive analysis with extrapolation model, it is found that threats, strategic environment and tradition or history are variables that are expected to remain unchanged, especially in the short term in influencing the preparation of Military Campaign Doctrine. c. The Projection Model determines if Threat is the variable that changes the most so that it will affect changes in the Military Campaign Doctrine in the short to medium term. d. If war strategy is indeed determined as HILP in changing the formulation of military campaign doctrine, then to realize effective anticipatory measures, a comprehensive simulation is needed so that the resulting doctrine will be adaptive to changes in threats, strategic environment, traditions or history and future war strategies. |
Activity of Fosfomycin Against The Spectrum of Uropathogens Causing Cystitis Urinary tract infections (UTIs) are the most frequent bacterial infections, commonly seen in females. High degree of antimicrobial resistance in uropathogens has challenged the use of therapeutic agents. Fosfomycin which is an old antibiotic with distinctive characteristics, seems to be a promising novel therapeutic agent with a good bactericidal activity towards multi-drug resistant (MDR) uropathogens. The main objective of the study is to evaluate the antibacterial activity of fosfomycin among uropathogens causing cystitis. The study was carried out between 2017-2018. A total of 2060 UTI suspects from outpatient department (OPDs) and inpatient department (IPDs) were screened. Out of 2060 screened patients 1658 were IPD patients and 402 were OPD patients. Patients midstream urine samples were collected aseptically and processed according to standard protocols. The frequency of extended-spectrum-beta lactamases (ESBLs) producer and carbapenem resistance were estimated respectively. Cultures with significant growth of uropathogens were identified and minimum inhibitory concentration (MIC) to fosfomycin was determined by agar dilution (AD) and by E-test methods. 184 out of 2060 (8.9%) urine samples showed significant growth of uropathogens. Uropathogenic Escherichia coli (UPEC) (64%,118/184) was found to be the mostly isolated uropathogen. Among these Gram-negative uropathogens, 80% were ESBLs producers, 43.2% were carbapenem-resistant and 78% isolates were found to be MDR. The fosfomycin susceptibility for UPEC was 95% by AD method. This study suggests that Fosfomycin is reasonably effective and can be used in the treatment of MDR uropathogens along with uncomplicated UTIs. |
<filename>android/app/src/main/cpp/VROSceneRendererARCore.h
//
// VROSceneRendererARCore.h
// ViroRenderer
//
// Created by <NAME> on 9/27/17.
// Copyright © 2017 Viro Media. 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.
#ifndef VRO_SCENE_RENDERER_ARCORE_H_ // NOLINT
#define VRO_SCENE_RENDERER_ARCORE_H_ // NOLINT
#include <EGL/egl.h>
#include <GLES2/gl2.h>
#include <jni.h>
#include <string>
#include <thread> // NOLINT
#include <vector>
#include <arcore/VROARSessionARCore.h>
#include "VROSceneRenderer.h"
#include "VRODriverOpenGLAndroid.h"
#include "vr/gvr/capi/include/gvr_audio.h"
#include "vr/gvr/capi/include/gvr_types.h"
class VROSurface;
class VROARCamera;
class VROARFrame;
class VRORendererConfiguration;
class VROARSessionARCore;
class VROSceneRendererARCore : public VROSceneRenderer, public std::enable_shared_from_this<VROSceneRendererARCore> {
public:
/*
Create a VROSceneRendererARCore.
@param gvr_audio_api The (owned) gvr::AudioApi context.
*/
VROSceneRendererARCore(VRORendererConfiguration config,
std::shared_ptr<gvr::AudioApi> gvrAudio);
virtual ~VROSceneRendererARCore();
/*
Inherited from VROSceneRenderer.
*/
void initGL();
void onDrawFrame();
void onTouchEvent(int action, float x, float y);
void onKeyEvent(int keyCode, int action) {} // Not Required
void onPinchEvent(int pinchState, float scaleFactor, float viewportX, float viewportY);
void onRotateEvent(int rotateState, float rotateRadians, float viewportX, float viewportY);
void setVRModeEnabled(bool enabled);
/*
Override so that this object can hold onto the VROSceneController as
well.
*/
void setSceneController(std::shared_ptr<VROSceneController> sceneController);
void setSceneController(std::shared_ptr<VROSceneController> sceneController, float seconds,
VROTimingFunctionType timingFunction);
std::shared_ptr<VROSceneController> getSceneController() { return _sceneController; };
/*
Activity lifecycle.
*/
void onStart() {}
void onPause();
void onResume();
void onStop() {}
void onDestroy();
/*
Surface lifecycle.
*/
void onSurfaceCreated(jobject surface) {}
void onSurfaceChanged(jobject surface, VRO_INT width, VRO_INT height);
void onSurfaceDestroyed() {}
/*
Set to true when ARCore is installed. Unlocks the renderer.
*/
void setARCoreSession(arcore::Session *session);
/*
Retrieves the texture ID used for the camera background.
*/
GLuint getCameraTextureId() const;
/*
AR hit test using point on the screen in 2D coordinate system.
*/
std::vector<std::shared_ptr<VROARHitTestResult>> performARHitTest(float x, float y);
/*
AR hit test using a ray from camera's position into the 3D scene.
*/
std::vector<std::shared_ptr<VROARHitTestResult>> performARHitTest(VROVector3f ray);
/*
AR hit test using a ray from origin to destination in the 3D scene.
*/
std::vector<std::shared_ptr<VROARHitTestResult>> performARHitTest(VROVector3f rayOrigin, VROVector3f rayDestination);
/*
Set the size of the parent view holding the AR screen. Invoked from ViroViewARCore.
*/
void setDisplayGeometry(int rotation, int width, int height);
/*
* Set camera's ArFocusMode as AUTO_FOCUS if enabled is true, else set to FIXED_FOCUS
*/
void setCameraAutoFocusEnabled(bool enabled);
/*
* Return true if camera's ArFocusMode is set to AUTO_FOCUS;
*/
bool isCameraAutoFocusEnabled();
/*
Set the anchor detection mode used by ARCore.
*/
void setAnchorDetectionTypes(std::set<VROAnchorDetection> types);
/*
This is a function that enables/disables tracking (for debug purposes!)
*/
void enableTracking(bool shouldTrack);
private:
void renderFrame();
void renderWithTracking(const std::shared_ptr<VROARCamera> &camera, const std::unique_ptr<VROARFrame> &frame,
VROViewport viewport);
void updateARBackground(std::unique_ptr<VROARFrame> &frame, bool forceReset);
void renderWaitingForTracking(VROViewport viewport);
void renderNothing();
void initARSession(VROViewport viewport, std::shared_ptr<VROScene> scene);
std::shared_ptr<VROSurface> _cameraBackground;
gvr::Sizei _surfaceSize;
bool _arcoreInstalled;
bool _destroyed;
// Detection types are only stored here so that they can be pushed to the ARScene when that
// is injected into the scene renderer (from there they are pushed into the VROARSession).
std::set<VROAnchorDetection> _detectionTypes;
std::shared_ptr<VRONode> _pointOfView;
std::shared_ptr<VROARSessionARCore> _session;
};
#endif // VRO_SCENE_RENDERER_ARCORE_H // NOLINT
|
from sys import stdin,stdout
from math import gcd, ceil, sqrt
ii1 = lambda: int(stdin.readline().strip())
is1 = lambda: stdin.readline().strip()
iia = lambda: list(map(int, stdin.readline().strip().split()))
isa = lambda: stdin.readline().strip().split()
mod = 1000000007
n = ii1()
arr1 = iia()
arr2 = iia()
num = set([*arr1, *arr2])
res = 0
for i in arr1:
for j in arr2:
if i ^ j in num:
res += 1
if res % 2 == 0:
print("Karen")
else:
print("Koyomi")
|
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* <p/>
* http://www.apache.org/licenses/LICENSE-2.0
* <p/>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.eagle.alert.engine.integration;
import org.apache.eagle.alert.coordination.model.Kafka2TupleMetadata;
import org.apache.eagle.alert.coordination.model.ScheduleState;
import org.apache.eagle.alert.coordination.model.SpoutSpec;
import org.apache.eagle.alert.coordination.model.internal.Topology;
import org.apache.eagle.alert.engine.coordinator.PolicyDefinition;
import org.apache.eagle.alert.engine.coordinator.Publishment;
import org.apache.eagle.alert.engine.coordinator.StreamDefinition;
import org.apache.eagle.alert.engine.coordinator.StreamingCluster;
import org.apache.eagle.alert.engine.model.AlertPublishEvent;
import org.apache.eagle.alert.service.IMetadataServiceClient;
import java.io.IOException;
import java.util.List;
@SuppressWarnings("serial")
public class MockMetadataServiceClient implements IMetadataServiceClient {
@Override
public List<SpoutSpec> listSpoutMetadata() {
return null;
}
@Override
public void close() throws IOException {
}
@Override
public ScheduleState getVersionedSpec(String version) {
return null;
}
@Override
public List<StreamingCluster> listClusters() {
return null;
}
@Override
public List<PolicyDefinition> listPolicies() {
return null;
}
@Override
public List<StreamDefinition> listStreams() {
return null;
}
@Override
public List<Kafka2TupleMetadata> listDataSources() {
return null;
}
@Override
public List<Publishment> listPublishment() {
return null;
}
@Override
public ScheduleState getVersionedSpec() {
return null;
}
@Override
public void addScheduleState(ScheduleState state) {
}
@Override
public List<Topology> listTopologies() {
return null;
}
@Override
public void addStreamingCluster(StreamingCluster cluster) {
}
@Override
public void addStreamingClusters(List<StreamingCluster> clusters) {
}
@Override
public void addTopology(Topology t) {
}
@Override
public void addTopologies(List<Topology> topologies) {
}
@Override
public void addPolicy(PolicyDefinition policy) {
}
@Override
public void addPolicies(List<PolicyDefinition> policies) {
}
@Override
public void addStreamDefinition(StreamDefinition streamDef) {
}
@Override
public void addStreamDefinitions(List<StreamDefinition> streamDefs) {
}
@Override
public void addDataSource(Kafka2TupleMetadata k2t) {
}
@Override
public void addDataSources(List<Kafka2TupleMetadata> k2ts) {
}
@Override
public void addPublishment(Publishment pub) {
}
@Override
public void addPublishments(List<Publishment> pubs) {
}
@Override
public void clear() {
}
@Override
public void clearScheduleState(int maxCapacity) {
}
@Override
public List<AlertPublishEvent> listAlertPublishEvent() {
return null;
}
@Override
public void addAlertPublishEvent(AlertPublishEvent event) {
}
@Override
public void addAlertPublishEvents(List<AlertPublishEvent> events) {
}
} |
Task dependency of the long-latency facilitatory effect on the soleus H-reflex by cerebellar transcranial magnetic stimulation We investigated whether cerebellar transcranial magnetic stimulation (C-TMS) facilitates the excitability of the ipsilateral soleus motoneuron pool in resting humans, and whether the facilitation is modulated by a task that promotes cerebellar activity. A test tibial nerve stimulus evoking the H-reflex from the right soleus muscle was delivered before or after conditioning C-TMS in prone individuals. The amplitude of the H-reflex was significantly increased at conditioning-test interstimulus intervals of 110, 120, and 130ms. Furthermore, we revealed that this facilitation effect was inhibited while the individuals tapped their right index finger. These findings indicate that C-TMS facilitates spinal motoneuronal excitability with an ∼100ms latency in resting humans, and that this cerebellar spinal facilitation is modulated by a task that might increase cerebellar activity. Cerebellar spinal facilitation could thus be useful for assessing the excitability of the cerebellum, or the cerebellar output to spinal motoneurons. |
<gh_stars>1-10
import flask
from coffeebuddy.model import User
class Color:
def __init__(self, r, g, b):
self.r = r
self.g = g
self.b = b
def __str__(self):
return f"rgb({self.r}, {self.g}, {self.b})"
def brighter(self, factor):
r = self.r + (255 - self.r) * factor
g = self.g + (255 - self.g) * factor
b = self.b + (255 - self.b) * factor
return Color(r, g, b)
def init():
@flask.current_app.route('/stats.html', methods=['GET', 'POST'])
def chart():
user = User.query.filter(User.tag == bytes.fromhex(flask.request.args['tag'])).first()
if user is None:
return flask.render_template('cardnotfound.html', uuid=flask.request.args['tag'])
if flask.request.method == 'POST':
if 'coffee' in flask.request.form:
return flask.redirect(f'coffee.html?tag={flask.request.args["tag"]}')
elif 'logout' in flask.request.form:
return flask.redirect('/')
berry = Color(171, 55, 122)
x = list(user.drink_days)
n = user.max_drinks_per_day
datasets = [
{
'x': x,
'y': [f'1970-01-01T{user.nth_drink(date, i).timestamp.time().isoformat()}' for date in x],
'fill': 'tozeroy',
'name': f'{i}. Coffee',
'mode': 'markers',
'fillcolor': str(berry.brighter(1 - i / n)),
'line': {
'color': str(berry),
},
}
for i in range(n, 0, -1)
]
return flask.render_template('stats.html', user=user, datasets=datasets)
|
. The Basel clinic for parents with infants and toddlers is a special interdisciplinary service. The authors present the concept and practice of treatment. Further they show the results of documentation and evaluation. In most cases regulation and sleeping disorders are treated. Temperament ratings made by the mothers of the treated children exhibit more difficult behaviour in comparison to a normal sample. These ratings had no correlation with the mothers' depression scores which rank much higher than the control group. The outcome ratings by the psychotherapists show that despite the short duration of the treatment and severe cases therapeutical success could be achieved. This outlines the importance of such specialized services for early infant crying and other disturbances of the early childhood. |
<reponame>liyuanxuan/blog-master
/*
* Copyright 2016 qyh.me
*
* 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 me.qyh.blog.plugin.wechat;
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Formatter;
import me.qyh.blog.core.exception.SystemException;
import me.qyh.blog.core.util.Jsons;
import me.qyh.blog.core.util.Jsons.ExpressionExecutor;
import me.qyh.blog.core.util.StringUtils;
public class WechatSupport {
private final String appid;
private final String appsecret;
private static final long TOKEN_EXPIRE_SEC = 7100 * 1000L;// 实际7200s
private static final long TICKET_EXPIRE_SEC = 7100 * 1000L;// 实际7200s
private final String tokenUrl = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s";
private final String ticketUrl = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=%s&type=jsapi";
private Token token;
private Ticket ticket;
WechatSupport(String appid, String appsecret) {
this.appid = appid;
this.appsecret = appsecret;
}
private void refreshToken() {
if (token != null && !token.overtime()) {
return;
}
synchronized (this) {
if (token != null && !token.overtime()) {
return;
}
String tokenUrl = String.format(this.tokenUrl, appid, appsecret);
ExpressionExecutor executor = read(tokenUrl);
String token = executor.execute("access_token")
.orElseThrow(() -> new SystemException("获取access_token失败:" + executor.toString()));
this.token = new Token(System.currentTimeMillis(), token);
}
}
private void refreshTicket() {
refreshToken();
if (ticket != null && !ticket.overtime()) {
return;
}
synchronized (this) {
if (ticket != null && !ticket.overtime()) {
return;
}
String ticketUrl = String.format(this.ticketUrl, token.getToken());
ExpressionExecutor executor = read(ticketUrl);
String ticket = executor.execute("ticket").orElseThrow(
() -> new SystemException("获取ticket失败,失败信息:" + executor.toString() + ",token :" + token));
this.ticket = new Ticket(System.currentTimeMillis(), ticket);
}
}
protected String createNoncestr() {
return StringUtils.uuid();
}
public Signature createSignature(String url) {
refreshTicket();
String noncestr = createNoncestr();
long timestamp = System.currentTimeMillis() / 1000L;
StringBuilder sb = new StringBuilder();
sb.append("jsapi_ticket=").append(ticket.getTicket());
sb.append("&noncestr=").append(noncestr);
sb.append("×tamp=").append(timestamp);
sb.append("&url=").append(url);
String signature = sha1(sb.toString());
return new Signature(noncestr, appid, timestamp, signature);
}
private String sha1(String str) {
try {
MessageDigest crypt = MessageDigest.getInstance("SHA-1");
crypt.reset();
crypt.update(str.getBytes("UTF-8"));
return byteToHex(crypt.digest());
} catch (NoSuchAlgorithmException | UnsupportedEncodingException e) {
throw new SystemException(e.getMessage(), e);
}
}
private String byteToHex(final byte[] hash) {
try (Formatter formatter = new Formatter()) {
for (byte b : hash) {
formatter.format("%02x", b);
}
return formatter.toString();
}
}
public final class Signature {
private final String noncestr;
private final String appid;
private final long timestamp;
private final String signature;
private Signature(String noncestr, String appid, long timestamp, String signature) {
super();
this.noncestr = noncestr;
this.appid = appid;
this.timestamp = timestamp;
this.signature = signature;
}
public String getNoncestr() {
return noncestr;
}
public String getAppid() {
return appid;
}
public long getTimestamp() {
return timestamp;
}
public String getSignature() {
return signature;
}
@Override
public String toString() {
return "Signature [noncestr=" + noncestr + ", appid=" + appid + ", timestamp=" + timestamp + ", signature="
+ signature + "]";
}
}
private final class Token {
private final long time;
private final String token;
public Token(long time, String token) {
super();
this.time = time;
this.token = token;
}
public String getToken() {
return token;
}
public boolean overtime() {
return System.currentTimeMillis() - time > TOKEN_EXPIRE_SEC;
}
}
private final class Ticket {
private final long time;
private final String ticket;
public Ticket(long time, String ticket) {
super();
this.time = time;
this.ticket = ticket;
}
public String getTicket() {
return ticket;
}
public boolean overtime() {
return System.currentTimeMillis() - time > TICKET_EXPIRE_SEC;
}
}
private ExpressionExecutor read(String url) {
ExpressionExecutor executor = Jsons.read(url);
Throwable ex = executor.getEx();
if (ex != null) {
throw new SystemException(ex.getMessage(), ex);
}
return executor;
}
}
|
// Processes buffered incoming characters from the host.
// Handles at most one command, to avoid delaying reports.
void PollHostLink()
{
char *rawstring;
rawstring = GetNextLine();
if (NULL != rawstring)
{
if (echo_active)
{
PrintString(rawstring);
PrintConstString("\r\n");
}
ProcessInputLine(rawstring);
DoneWithLine();
}
} |
Both Dietary Protein and Fat Increase Postprandial Glucose Excursions in Children With Type 1 Diabetes, and the Effect Is Additive OBJECTIVE To determine the separate and combined effects of high-protein (HP) and high-fat (HF) meals, with the same carbohydrate content, on postprandial glycemia in children using intensive insulin therapy (IIT). RESEARCH DESIGN AND METHODS Thirty-three subjects aged 817 years were given 4 test breakfasts with the same carbohydrate amount but varying protein and fat quantities: low fat (LF)/low protein (LP), LF/HP, HF/LP, and HF/HP. LF and HF meals contained 4 g and 35 g fat. LP and HP meals contained 5 g and 40 g protein. An individually standardized insulin dose was given for each meal. Postprandial glycemia was assessed by 5-h continuous glucose monitoring. RESULTS Compared with the LF/LP meal, mean glucose excursions were greater from 180 min after the LF/HP meal (2.4 mmol/L vs. 0.5 mmol/L ; P = 0.02) and from 210 min after the HF/LP meal (1.8 mmol/L vs. −0.5 mmol/L ; P = 0.01). The HF/HP meal resulted in higher glucose excursions from 180 min to 300 min (P < 0.04) compared with all other meals. There was a reduction in the risk of hypoglycemia after the HP meals (odds ratio 0.16 ; P < 0.001). CONCLUSIONS Meals high in protein or fat increase glucose excursions in youth using IIT from 3 h to 5 h postmeal. Protein and fat have an additive impact on the delayed postprandial glycemic rise. Protein had a protective effect on the development of hypoglycemia. C urrent management of people with type 1 diabetes (T1D) on intensive insulin therapy (IIT) advocates algorithms based on the carbohydrate content of the meal to calculate the prandial insulin dose. This approach is recommended as a means to improve glycemic control and allow greater dietary flexibility. Typically, these calculations do not take into account the protein and fat content of the meal. In recent years, novel algorithms have recommended counting fat and protein units, in addition to carbohydrate, in order to determine a supplementary insulin requirement for high-fat and -protein meals. However, increased postprandial hypoglycemia has been observed in children following these recommendations. A recent study showed that meals high in fat do require more insulin than lower-fat meals with the same carbohydrate content, supporting the need for alternative insulin dosing algorithms for high-fat (HF) meals. However, there is a general paucity of evidence regarding the impact of protein and fat on postprandial glycemia in patients utilizing IIT, and consistent clinical advice for optimal management of highprotein (HP) and HF meals is lacking. To date, protein has been considered together with fat in test meal studies, and controlled trials examining the effect of variations in protein content, independent of other macronutrients, on postprandial glucose levels have not been performed in individuals with T1D using insulin pump or multiple daily injection therapies. Therefore, this study was undertaken to examine the separate and combined effects of HP and HF meals, all with the same carbohydrate content, on postprandial glycemia in children and adolescents using IIT. RESEARCH DESIGN AND METHODSdThe study design was a four-by-four randomized crossover trial conducted at two pediatric centers in Australia (Princess Margaret Hospital in Perth and John Hunter Children's Hospital in Newcastle). Children and adolescents with T1D who had been diagnosed for.1 year and who had been treated with continuous subcutaneous insulin infusion or multiple daily injection ($4 injections/ day) for.6 months were recruited. Inclusion criteria included age between 8 and 17 years, glycated hemoglobin (HbA 1c ) #8.0% (64 mmol/mol), and BMI #97th percentile. Exclusion criteria were coexisting medical problems (including celiac disease), evidence of complications of diabetes (including gastroparesis), hyperlipidemia, and dietary restrictions. Ethics approval was obtained from the ethics committees of the Princess Margaret Children's Hospital and the John Hunter Children's Hospital. Written informed consent was gained from all participants and their parents. In the week leading up to the study, participants and their caregivers were contacted daily by telephone to review the subject's blood glucose level (BGL). Adjustments were made, if required, to the participant's insulin therapy to meet a prebreakfast target range of 4-8 mmol/L and to optimize each participant's insulin-to-carbohydrate ratio. If the subject's fasting glucose values were high (.12.0 mmol/L) or low (,3.6 mmol/L), participants were instructed to treat as normal, e.g., for hyperglycemia, administer a correction bolus. This study day was then excluded and repeated. Participants received their breakfast (test meal) under supervision by one of the two study centers over four consecutive mornings. Four standardized test meals of high-or low-fat and high-or low-protein content, all with the same carbohydrate amount, were given under supervision to each participant in random order over the four study days. Children were required to fast overnight for at least 10 h prior to breakfast, consume the test meal in 20 min, and fast for 5 h after completion of the test meal. Activity was standardized (sedentary) during the 5-h postprandial period for each participant. The insulin dose for each participant was determined for the carbohydrate content using each participant's individualized insulin-to-carbohydrate ratio. This dose then remained constant for each of the four test meals. The shortacting insulin bolus was administered 10 min prior to test meal consumption via subcutaneous injection or as a standard bolus via the insulin pump. In the event of hypoglycemia during the 5-h postprandial period, 15 g oral carbohydrate was given and analysis stopped at that point. Participants using continuous subcutaneous insulin infusion changed their infusion site on day 1 and day 3 of the study. Test meals Test meals consisted of pancakes varying in protein and fat content but identical in carbohydrate amount. The low-fat (LF) and HF meals contained 4 g fat and 35 g fat, respectively, and the low-protein (LP) meal and HP meals contained 5 g protein and 40 g protein, respectively. All meals contained the same amount of carbohydrate (30 g, 120 kcal). The total energy content of the four test meals was 180 kcal for the LF/LP meal, 330 kcal for the LF/HP meal, 460 kcal for the HF/LF meal, and 615 kcal for the HF/HP meal. Beneprotein (100% whey protein isolate) was used to increase the protein content of the meals without impacting the fat and carbohydrate quantities. See Table 1 for a detailed description of the meals. The fat and protein amounts were based on quantities in foods commonly consumed by children and adolescents with diabetes. A weight-based cut point for protein was derived from recommendations of upper levels of protein intakes for children. To ensure an appropriate protein amount for children #45 kg, 75% of the total serving for each pancake was provided. The reduction in the serving size for the smaller children resulted in all macronutrients being altered proportionally to provide 75% of the amount in the full serving. The meal types were given to patients in a random order, which was predetermined based on a generalized cyclic block design and was generated using Proc Plan in SAS v9.3, 2010 (SAS Institute, Cary, NC). Food was prepared under controlled conditions and weighed using Salter kitchen scales (accuracy 61 g, model 323; Salter, Kent, U.K.). Glucose measurement The iPro2 Continuous Glucose Monitoring System (CGMS; MedtronicMiniMed, Northbridge, CA) was used to record glucose levels in the participants over the 4 days of the study. Subjects attended the clinic on the day prior to the study Subjects #45 kg consumed 75% of the total serve for each test meal. commencement for insertion of CGMS. Participants were asked to record at least four capillary blood glucose measurements per day into their study diary to allow for calibration. At the completion of the study, data were downloaded from the CGMS using the Medtronic CareLinkiPro data system (Medtronic MiniMed). Statistical analysis The primary outcome measure was the glucose excursion at each 30-min interval from baseline to 300 min after each of the four test meals. This was calculated as the observed postprandial glucose level minus the subject's glucose level at baseline. Secondary outcomes included hypoglycemic event (defined as a capillary BGL,3.6 mmol/L), peak glucose excursion, and time to peak glucose excursion. Glucose excursion data for children who had a hypoglycemic event were not included after the time of the event. Differences in mean glucose excursions between meal groups at a single time point were tested using a generalized linear mixed model to account for the repeated measurements on the same children. The outcome in the model was glucose excursion, and the only predictor was meal type, which was included as a four-level factor. A second set of models was fitted to examine the interaction between the effect of fat and protein. This set of models had predictors of fat, protein, and the interaction of fat and protein. Generalized linear mixed models were also used to test for differences in mean peak glucose excursions and mean time to peak glucose excursions. Differences between meal types in the proportion of subjects who had a hypoglycemic event were examined using a logistic regression model within a generalized estimating equation framework. P values,0.05 were considered statistically significant. Data analysis was conducted using SAS (SAS Institute) and Stata statistical software, 2011, release 12 (StataCorp 2011, College Station, TX). RESULTSdThe mean (SD) age of the 33 children who completed the study was 12.2 (2.5) years, and 17 (52%) were female. Other baseline characteristics are presented in Table 2. The prebreakfast target range of 4-8 mmol/L was achieved on 78 days over the 132 study days. Ninety-seven percent of fasting glucose values (n = 128) were between 3.6 and 12.0 mmol/L, requiring 4 study days to be repeated because of high or low fasting glucose values. On each occasion, the day was successfully repeated. Nine children had incomplete study days where data from 1 day were excluded from the analysis due to an incomplete sensor reading over the 5-h postprandial period (n = 7) or failure to complete one of the test meals in 20 min (n = 2). Data from all of the other days (n = 123) were included in the analysis. Twelve children weighed #45 kg and were given 75% of the total meal serving. The outcome data for these children did not differ significantly from subjects who weighed.45 kg (P. 0.05). Figure 1 presents the mean postprandial glucose excursions by meal type at each time point (30-min increments from 0 to 300 min). Differences in mean glucose excursions between the test meals became apparent from~120 min after the meals, with a sustained and attenuated additive effect of the HF/HP meal. The mean glucose excursions after the LF/HP meal were significantly greater than the mean glucose excursions after the LF/LP meal commencing at 180 min (P = 0.02) and continuing to 300 min (P, 0.01) ( Table 3). The mean glucose excursions after the HF/LP meal were significantly higher than the glucose excursions after the LF/LP meal at 210 min (P = 0.01) and continuing to 300 min (P, 0.01). Postprandial glucose excursions The HF/HP meal resulted in significantly higher glucose excursions from 180 min to 300 min compared with all other meals (P, 0.04) (Fig. 1). Compared with the LF/LP meal, mean glucose excursions were significantly greater from 150 min after the HF/HP meal (P = 0.004) ( Table 3). At 300 min, the mean glucose excursion for the HF/HP meal was 5.4 mmol/L higher than for the LF/LP meal (P, 0.001). The HF/LP meal reduced the glucose excursion within the first 60-90 min after the meal compared with all other meals ( Table 3). The mean excursion at 60 min after the HF/LP meal was significantly lower than the excursion for the LF/LP meal (P = 0.009). This effect was only seen for the LP/HF meal. Beyond 120 min, the glycemic profiles after the HF/LP meal were similar to the profiles after the LF/HP meal (Fig. 1). There was no statistically significant interaction between the effects of the fat and protein on glucose excursions at all time points (P. 0.05), which is consistent with their effects being additive. The effects of protein and fat on glucose excursions were additive, as indicated by the lack of interaction of the two effects and as seen in Fig. 1. For example, at 180 Peak glucose excursion and time to peak glucose There was a significant difference in peak glucose excursions between meal types (P = 0.049), with the highest value recorded after the HF/HP meal. The mean peak glucose excursions from baseline for the LF/LP, LF/HP, HF/LP, and There was also a statistically significant difference in the time to mean peak glucose excursion between meal types (P, 0.001), with the longest time being observed after the HF/HP meal. The mean time to peak glucose excursion for the LF/ LP, LF/HP, HF/LP, and HF/HP meals, respectively, were 79 min (95% CI 68-89), 96 min min, 126 min min, and 143 min (112 to 174). Hypoglycemic events Twenty-nine symptomatic hypoglycemic events occurred in the 5-h postprandial period during the study. Fourteen occurred in the LF/LP group, 10 in the HF/ LP group, 4 in the LF/HP group, and 1 in the HF/HP group. There were no episodes of severe hypoglycemia. The number of hypoglycemic events differed significantly between the four meal types (P = 0.003). There was a statistically significant reduction in the odds of a hypoglycemic event when children consumed the HP meals (odds ratio 0.16 ; P, 0.001) but not when they consumed the HF meals (odds ratio 0.50 ; P = 0.08). CONCLUSIONSdThis study has demonstrated an effect of dietary protein independent of fat on postprandial glycemia in children with T1D. Importantly, the glycemic rise after protein was shown in meals of both HF and LF contents, with identical carbohydrate quantities. In addition, when a meal containing high levels of both protein and fat was eaten, the impact of protein and fat was additive and caused significantly higher glucose excursions between 3 and 5 h postprandially compared with meals of only HF or HP contents. An important finding of this study was that there were significantly higher glycemic excursions for the HP and HF meals compared with the LP/LF meal from~180 to 300 min postprandially. This late effect was increased and sustained when the HF and HP loads were combined. As expected, the HF meal initially reduced the glycemic excursion for up to 90 min after the meal. This is most likely due to the effect of fat in delaying gastric emptying and is consistent with studies in both adolescents with T1D and patients with type 2 diabetes. However in our study, the addition of protein to the HF meal prevented this, suggesting that protein may have a protective effect in the development of early postprandial hypoglycemia. The cause of the late sustained hyperglycemia noted when meals high in protein and fat are eaten has been postulated but is currently unknown. Protein may lead to delayed hyperglycemia by. Proposed mechanisms by which dietary fat and free fatty acids contribute to hyperglycemia are by impairing insulin sensitivity and enhancement of hepatic glucose production, along with delayed gastric emptying, which causes an increase in the peak time and amplitude of the glucose response. Further studies are required to fully elucidate the pathways of action. The results of this study have direct clinical translation. The protein, fat, and carbohydrate contents in this study were based on real meals commonly consumed by children and adolescents. For such meals, patients may be advised that significant hyperglycemia is likely to occur between 3 and 5 h after the meal, particularly accentuated and prolonged for the HF/HP meal. The findings of this study suggest the need for both prolonging insulin delivery by the use of a different wave form, such as a dual-wave bolus in those on pump therapy and that additional insulin is required to match the delayed hyperglycemia. Future studies are needed to determine an alternative insulin dosing algorithm to separately account for the fat and protein in HF/HP meals. Typically, insulin bolus dosing has been determined using the insulin-tocarbohydrate ratio. Our findings support recent evidence that dietary fat increases insulin requirements, but suggest that the additional insulin should be given by an extended insulin bolus or as a split bolus in order to prevent early hypoglycemia. This study also adds new data pointing to the need for additional insulin for HP meals independent of the fat content. A feature of insulin pump therapy that is potentially advantageous is the ability to vary the delivery of a bolus of insulin over time by use of a dual-wave or square-wave bolus. A dual-wave bolus has already been shown to limit glycemic excursions in pizza studies. The question of the optimal timing and distribution of the bolus in combined HF and HP meals, however, requires more investigation. Some centers have recently reported their experiences in pump patients of calculating fat and protein units and using these to determine insulin bolus dosing for the mixed meals. These studies provide some data using a normal-wave bolus given for carbohydrate and also a square-wave bolus with supplementary insulin for the fat and protein content. While reduced postprandial hyperglycemia has been noted, the rate of hypoglycemia using these calculations has been unacceptably high (33-35%). There has also been a lack of standardization of bolus types between the groups, which makes it difficult to compare the effect of additional insulin as opposed to the method of insulin delivery. Clearly, further studies are needed to refine and quantify the extra insulin that is required for HF or HP meals and to determine algorithms for the best dose and rate of insulin delivery over time. A limitation of the study was that we did not examine the effect of protein and fat beyond 5 h, although previous studies have noted an effect of HF/HP meals after this time period. During daylight hours, food is typically eaten so frequently that additional bolus doses of insulin within a few hours of the meal may correct the hyperglycemia. We therefore suggest that the composition of the evening meal is particularly important to consider in mealtime insulin calculations, as in the case of fasting overnight no additional insulin is given and prolonged hyperglycemia may result. Furthermore, our data from this and previous studies indicate that postprandial testing may be more appropriate at 3 h rather than 2 h after the meal, as the glycemic excursion from even those meals lower in fat and protein did not return to baseline until this time. In conclusion, this is the first study to demonstrate that the addition of protein and fat to meals containing the same carbohydrate amount results in prolonged postprandial hyperglycemia in children using IIT. When the protein and fat were consumed together, there was an additive effect on postprandial glycemia. Furthermore, the protein appeared to have a protective effect against hypoglycemia. This study provides supportive evidence that protein and fat should both be considered in insulin dosing. |
Amoebozoa
Morphology
Amoebozoa is a large and diverse group, but certain features are common to many of its members. The amoebozoan cell is typically divided into a granular central mass, called endoplasm, and a clear outer layer, called ectoplasm. During locomotion, the endoplasm flows forwards and the ectoplasm runs backwards along the outside of the cell. In motion, many amoebozoans have a clearly defined anterior and posterior and may assume a "monopodial" form, with the entire cell functioning as a single pseudopod. Large pseudopods may produce numerous clear projections called subpseudopodia (or determinate pseudopodia), which are extended to a certain length and then retracted, either for the purpose of locomotion or food intake. A cell may also form multiple indeterminate pseudopodia, through which the entire contents of the cell flow in the direction of locomotion. These are more or less tubular and are mostly filled with granular endoplasm. The cell mass flows into a leading pseudopod, and the others ultimately retract, unless the organism changes direction.
While most amoebozoans are "naked," like the familiar Amoeba and Chaos, or covered with a loose coat of minute scales, like Cochliopodium and Korotnevella, members of the order Arcellinida form rigid shells, or tests, equipped with a single aperture through which the pseudopods emerge. Arcellinid tests may be secreted from organic materials, as in Arcella, or built up from collected particles cemented together, as in Difflugia.
In all amoebozoa, the primary mode of nutrition is phagocytosis, in which the cell surrounds potential food particles with its pseudopods, sealing them into vacuoles within which they may be digested and absorbed. Some amoebozoans have a posterior bulb called a uroid, which may serve to accumulate waste, periodically detaching from the rest of the cell. When food is scarce, most species can form cysts, which may be carried aerially and introduce them to new environments. In slime moulds, these structures are called spores, and form on stalked structures called fruiting bodies or sporangia.
The majority of Amoebozoa lack flagella and more generally do not form microtubule-supported structures except during mitosis. However, flagella do occur among the Archamoebae, and many slime moulds produce biflagellate gametes. The flagellum is generally anchored by a cone of microtubules, suggesting a close relationship to the opisthokonts. The mitochondria in amoebozoan cells characteristically have branching tubular cristae. However, among the Archamoebae, which are adapted to anoxic or microaerophilic habitats, mitochondria have been lost.
Subphyla within Amoebozoa: Lobosa and Conosa
Traditionally all amoebozoa with lobose pseudopods were grouped together in the class Lobosea, placed with other amoeboids in the phylum Sarcodina or Rhizopoda, but these were considered to be unnatural groups. Structural and genetic studies identified the percolozoans and several archamoebae as independent groups. In phylogenies based on rRNA their representatives were separate from other amoebae, and appeared to diverge near the base of eukaryotic evolution, as did most slime molds.
However, revised trees by Cavalier-Smith and Chao in 1996 suggested that the remaining lobosans do form a monophyletic group, to which the Archamoebae and Mycetozoa were closely related, although the percolozoans were not. Subsequently, they emended the phylum Amoebozoa to include both the subphylum Lobosa and a new subphylum Conosa, comprising the Archamoebae and the Mycetozoa.
Recent molecular genetic data appear to support this primary division of the Amoebozoa into Lobosa and Conosa. The former, as defined by Cavalier-Smith and his collaborators, consists largely of the classic Lobosea: non-flagellated amoebae with blunt, lobose pseudopods (Amoeba, Acanthamoeba, Arcella, Difflugia etc.). The latter is made up of both amoeboid and flagellated cells, characteristically with more pointed or slightly branching subpseudopodia (Archamoebae and the Mycetozoan slime molds).
Fossil record
Vase-shaped microfossils (VSMs) discovered around the world show that amoebozoans have existed since the Neoproterozoic Era. The fossil species Melanocyrillium hexodiadema, Palaeoarcella athanata, and Hemisphaeriella ornata come from rocks 750 million years old. All three VSMs share a hemispherical shape, invaginated aperture, and regular indentations, that strongly resemble modern arcellinids, which are shell-bearing amoeboids. P. athanata in particular looks the same as the extant genus Arcella.
Meiosis
The recently available Acanthamoeba genome sequence revealed several orthologs of genes employed in meiosis of sexual eukaryotes. These genes included Spo11, Mre11, Rad50, Rad51, Rad52, Mnd1, Dmc1, Msh and Mlh. This finding suggests that Acanthamoeba is capable of some form of meiosis and may be able to undergo sexual reproduction.
In sexually reproducing eukaryotes, homologous recombination (HR) ordinarily occurs during meiosis. The meiosis-specific recombinase, Dmc1, is required for efficient meiotic HR, and Dmc1 is expressed in Entamoeba histolytica. The purified Dmc1 from E. histolytica forms presynaptic filaments and catalyzes ATP-dependent homologous DNA pairing and DNA strand exchange over at least several thousand base pairs. The DNA pairing and strand exchange reactions are enhanced by the eukaryotic meiosis-specific recombination accessory factor (heterodimer) Hop2-Mnd1. These processes are central to meiotic recombination, suggesting that E. histolytica undergoes meiosis.
Studies of Entamoeba invadens found that, during the conversion from the tetraploid uninucleate trophozoite to the tetranucleate cyst, homologous recombination is enhanced. Expression of genes with functions related to the major steps of meiotic recombination also increased during encystations. These findings in E. invadens, combined with evidence from studies of E. histolytica indicate the presence of meiosis in the Entamoeba. A comparative genetic analysis indicated that meiotic processes are present in all major amoebozoan lineages.
Since Amoebozoa diverged early from the eukaryotic family tree, these results also suggest that meiosis was present early in eukaryotic evolution.
Human health
Amoebiasis, also known as amebiasis or entamoebiasis, is an infection caused by any of the amoebozoans of the Entamoeba group. Symptoms are most common upon infection by Entamoeba histolytica. Amoebiasis can present with no, mild, or severe symptoms. Symptoms may include abdominal pain, mild diarrhoea, bloody diarrhea or severe colitis with tissue death and perforation. This last complication may cause peritonitis. People affected may develop anemia due to loss of blood.
Invasion of the intestinal lining causes amoebic bloody diarrhea or amoebic colitis. If the parasite reaches the bloodstream it can spread through the body, most frequently ending up in the liver where it causes amoebic liver abscesses. Liver abscesses can occur without previous diarrhea. Cysts of Entamoeba can survive for up to a month in soil or for up to 45 minutes under fingernails. It is important to differentiate between amoebiasis and bacterial colitis. The preferred diagnostic method is through faecal examination under microscope, but requires a skilled microscopist and may not be reliable when excluding infection. This method however may not be able to separate between specific types. Increased white blood cell count is present in severe cases, but not in mild ones. The most accurate test is for antibodies in the blood, but it may remain positive following treatment.
Prevention of amoebiasis is by separating food and water from faeces and by proper sanitation measures. There is no vaccine. There are two treatment options depending on the location of the infection. Amoebiasis in tissues is treated with either metronidazole, tinidazole, nitazoxanide, dehydroemetine or chloroquine, while luminal infection is treated with diloxanide furoate or iodoquinoline. For treatment to be effective against all stages of the amoeba may require a combination of medications. Infections without symptoms do not require treatment but infected individuals can spread the parasite to others and treatment can be considered. Treatment of other Entamoeba infections apart from E. histolytica is not needed.
Amoebiasis is present all over the world. About 480 million people are infected with what appears to be E. histolytica and these result in the death of between 40,000–110,000 people every year. Most infections are now ascribed to E. dispar. E. dispar is more common in certain areas and symptomatic cases may be fewer than previously reported. The first case of amoebiasis was documented in 1875 and in 1891 the disease was described in detail, resulting in the terms amoebic dysentery and amoebic liver abscess. Further evidence from the Philippines in 1913 found that upon ingesting cysts of E. histolytica volunteers developed the disease. It has been known since 1897 that at least one non-disease-causing species of Entamoeba existed (Entamoeba coli), but it was first formally recognized by the WHO in 1997 that E. histolytica was two species, despite this having first been proposed in 1925. In addition to the now-recognized E. dispar evidence shows there are at least two other species of Entamoeba that look the same in humans - E. moshkovskii and Entamoeba bangladeshi. The reason these species haven't been differentiated until recently is because of the reliance on appearance. |
poster="http://v.politico.com/images/1155968404/201606/1660/1155968404_4934983403001_4934977711001-vs.jpg?pubId=1155968404" true Clinton: Trump would 'turn back the clock' on abortion rights
Hillary Clinton attacked Donald Trump and fellow Republicans on Friday for trying to "reverse" the progress that women's advocates have made toward increasing access to abortion and contraception.
At a Planned Parenthood Action Fund event, Clinton at least twice mentioned Trump's comment earlier this year that he thought women who receive abortions should face "some form of punishment" if the practice becomes illegal. Trump later reversed his statement.
Story Continued Below
"When Donald Trump says 'Let’s make America great again,' that is code for 'Let’s take America backward,' back to a time when opportunity and dignity were reserved for some and not all," Clinton said. "Well, Donald, those days are over. We are not going to let Donald Trump or anyone else turn back the clock."
She said Trump wants to appoint Supreme Court justices who would overturn Roe v. Wade and to strip Planned Parenthood of funding. And Clinton said that even though Trump reversed his comment, he originally talked about punishment like it was "the most obvious thing in the world.”
“Anyone who wants to defund Planned Parenthood and wipe out safe, legal abortion has no idea what’s best for women,” she said. “And, after all, this is a man who has called women 'pigs,' 'dogs' and 'disgusting animals.' Kind of hard to imagine counting on him to respect our fundamental rights. When he says pregnant women are an inconvenience to their employer, what does that say about how he values women, our work, our contributions?"
The same day, Trump slammed Clinton's position on abortion during a speech at a Faith & Freedom Coalition conference.
“She will keep Obamacare in place, which puts medical decisions in the hands of government. Not good. Obamacare, we will repeal and replace," he said. "She'll restrict religious freedom with government mandates. She’ll push for federal funding of abortion on demand up until the moment of birth, which is where she is, as you know.” |
Step away from mass-produced adornments and show off your own exquisite sense of style!
Our selection of handmade large gauge jewelry for stretched ear lobe and other piercings (from 20 gauge all the way up to 2 inch diameter), organic body jewelry, fine sterling silver jewelry, ethnic & tribal jewelry, hair sticks & barrettes and other wearable art are personally selected to combine quality, tradition and style. We are excited to bring this collection to you from Southeast Asia, Africa, India, Eastern Europe, the Americas and around the world. We don't make this jewelry ourselves. We promote other people's creativity! We purchase directly from the artisans whenever possible to bring you a great value! This also ensures that the artisans receive fair pay for their talent, skill and time. Check out our great selection of earrings, bracelets, necklaces, pendants, brooches, rings and hair accessories! We are your retail and wholesale source for unique, high quality, hand crafted jewelry.
Our Natural Body Jewelry and Hair Accessories are 100% handmade from sustainable and renewable resources and fairly traded with small businesses! |
<filename>UVa 10222 decode the mad man/sample/sol.cpp<gh_stars>1-10
#include<iostream>
#include<cstdio>
using namespace std;
string s = "234567890-=@#$%^&*()_+ertyuiop[]ERTYUIOP{}dfghjkl;'DFGHJKL:cvbnm,./CVBNM<>?|\\\"";
string d = "`1234567890~!@#$%^&*()qwertyuiopqwertyuiopasdfghjklasdfghjkzxcvbnm,zxcvbnm,[[l";
int main()
{
int c;
while ((c = getchar()) != EOF)
{
int pos = s.find_first_of(c, 0);
if (pos == -1)putchar(c);
else putchar(d[pos]);
}
return 0;
} |
<filename>docker/flink-auto-scaling-prototype-image/java/flink-auto-scaling-prototype/flink-diagnostics-message/src/main/java/org/apache/flink/diagnostics/model/FlinkMetricsHeader.java<gh_stars>0
package org.apache.flink.diagnostics.model;
import com.linkedin.asc.model.MetricHeader;
import java.util.HashMap;
import lombok.EqualsAndHashCode;
import lombok.ToString;
/**
* TODO:
* 1. Do we need operator level information
* 2. Check whether we need to change this for k8s
*/
@ToString(callSuper=true)
@EqualsAndHashCode
public class FlinkMetricsHeader extends HashMap<String, String> implements MetricHeader {
private static final String JOB_NAME_KEY = "<job_name>";
private static final String JOB_ID_KEY = "<job_id>";
private static final String TM_ID_KEY = "<tm_id>";
//We assume that job name is the unique identifier of a Flink job
public String getJobId() {
return get(JOB_NAME_KEY);
}
//We assume that job id indicates two different deployments
@Override
public String getJobAttemptId() {
return get(JOB_ID_KEY);
}
//We assume one container only has one TM, so we can use the TM ID to name the container
@Override
public String getContainerName() {
return get(TM_ID_KEY);
}
public FlinkMetricsHeader(){
super();
}
}
|
import common from '../../Common/Simple.edit.data';
export default [
...common,
{
type: 'datagrid',
input: true,
label: 'Select List Items',
key: 'data.values',
tooltip: 'Values to use in the list. Labels are shown in the select field. Values are the corresponding values saved with the submission.',
weight: 10,
reorder: true,
defaultValue: [{ label: '', value: '' }],
components: [
{
label: 'Label',
key: 'label',
input: true,
type: 'textfield',
},
{
label: 'Value',
key: 'value',
input: true,
type: 'textfield',
allowCalculateOverride: true,
calculateValue: { _camelCase: [{ var: 'row.label' }] },
},
],
}
];
|
<filename>excercises/Week_1/E6.py
#!/usr/bin/env python
'''
Python for Network Engineers: P4NE - Bring it!
Excercise 6
'''
import yaml
import json
__author__ = "<NAME>"
__license__ = "GPL"
__version__ = "1.0"
__email__ = "Github - @vpalacio"
def main():
my_dict = {
'Course': 'P4NE',
'Instructor': '<NAME>',
'Student': '<NAME>',
'Month': 'April',
'Year': '2016',
'Motto': 'Bring the P4NE!'
}
my_list = [
'Python for Network Engineers',
100,
200,
my_dict,
'Excited',
'Yeah!'
]
with open("E6.yml", "w") as f:
f.write(yaml.dump(my_list, default_flow_style=False))
with open("E6.json", "w") as f:
json.dump(my_list, f)
if __name__ == '__main__':
main()
|
Robust model referenced control for vehicle rollover prevention with time-varying speed In this paper, an active steering control strategy is proposed to prevent rollover of a vehicle with a time-varying forward speed. The controller is designed with the aim of reducing the rollover index (RI) from an initial dangerous status to an absolutely safe status by active steering. The controller consists of two parts. The nominal control is firstly designed on the basis of the fundamental equation of constrained motion (FECM) of the vehicle, which will guarantee the nominal vehicle to track the desired states and thus rollover is prevented. To handle system uncertainties, compensatory sliding mode control (SMC) is proposed, by which the actual states are forced to track the desired ones. In the controller, the chattering problem can be alleviated by selecting a suitable performance function. To indicate the merits of the designed controller, simulation is conducted. Simulation results demonstrate that compared to conventional controllers, the proposed controller can prevent the vehicle from rollover with stronger robustness and without system chattering. |
Facilitating University Compliance Using Regulatory Policy Incentives Internal compliance programs have proliferated at colleges and universities in response to the federal governments regulatory expansion within higher education. Institutions increasingly utilize these programs in order to manage their myriad compliance obligations and the attendant increase in risk. Yet, even properly designed programs possess many areas of potential weakness that hinder their effectiveness. Concurrently, calls for regulatory reform have grown louder. Although several viable options have been proposed and should be taken seriously, none adequately leverage the compliance function so many universities have recently adopted. <br><br>Institutional policies are an inseparable component of an effective compliance program and their status as such justifies their inclusion as a central feature of higher education regulatory reform. In lieu of issuing mere affirmative or prohibitive compliance obligations, Congress and the Department of Education should strategically incentivize the development of university-level policies that address regulated issues in order to encourage the internal collaborative processes that lead to effective compliance outcomes. <br><br>In addition to examining the practical aspects and effects of compliance programs and institutional policies, this Article draws from institutional theory to demonstrate that the higher education sector benefits from the open exchange of policies and best practices among peer institutions. The federal governments use of regulatory policy incentives or mandates can facilitate this exchange and similar modeling behaviors, which in turn can increase efficiencies at the institutional level. In sum, this Article contends that a legal compliance mandate is more likely to be included within the scope of a universitys compliance program (formal or informal as it may be) and implemented effectively if it takes the form of a policy disclosure obligation originating in statute or regulation. |
Workflow interruptions, social stressors from supervisor(s) and attention failure in surgery personnel Workflow interruptions and social stressors among surgery personnel may cause attention failure at work that may increase rumination about work issues during leisure time. The test of these assumptions should contribute to the understanding of exhaustion in surgery personnel and patient safety. Workflow interruptions and supervisor-related social stressors were tested to predict attention failure that predicts work-related rumination during leisure time. One hundred ninety-four theatre nurses, anaesthetists and surgeons from a Swiss University hospital participated in a cross-sectional survey. The participation rate was 58%. Structural equation modelling confirmed both indirect paths from workflow interruptions and social stressors via attention failure on rumination (both p<0.05). An alternative model, assuming the reversed indirect causationfrom attention failure via workflow interruptions and social stressors on ruminationcould not be empirically supported. Workflow interruptions and social stressors at work are likely to trigger attention failure in surgery personnel. Work redesign and team intervention could help surgery personnel to maintain a high level of quality and patient safety and detach from work related issues to recover during leisure time. Introduction Surgery places high demands on quick decision-making and on the accomplished technical skills of the surgical team. A multidisciplinary surgical team includes surgeons, anesthesiologists, nurses, technicians, and other specialists. Members of the surgical team work hard and experience frequent stressors, such as overtime work, variable shift-work, high demands on concentration, and workflow interruptions 1). At the same time, leadership quality, close cooperation and teamwork are essential for surgical teams, leading to further demands and accumulating work stress on surgery personnel 2). Organizational stressors like social stressors at work and task stressors like workflow interruptions may distract attention from the primary task at hand. Social stressors at work are a very frustrating stressor that may cause sustained psychophysiological activation, including higher levels of rumination and increased heart rate. Sustained psychophysiological activation is related with increased mental and physiological load, and may thereby distract from the primary task at hand and also persist even after Industrial Health 2015, 53, 427-433 work is done, thereby impeding recovery from work 3). Like social stressors, we argue that task stressors (e.g., workflow interruptions) may also distract attention from the primary task at hand. As a consequence of workflow interruption, attention is shifted to the distraction and away from the current task. Moreover, the goal of the interrupted action and its position in the action sequence must be stored in working memory to restart the primary task correctly 6). The new goal of restarting the interrupted task at hand at a later time must be stored in prospective memory 7,8). Therefore, workflow interruptions distract from the primary task and also increase mental work load. Taken together, social stressors and task stressors are an avoidable threat to attention regulation in surgery personnel 9). The consequences of attention failure in surgery can be serious for patients and surgery personnel 2) who are dedicated to working reliably and responsibly and may start or keep ruminating about their attention failure and conflicts with supervisors even after work 5). Rumination after work impedes recovery in the evening and during sleep and may cause exhaustion 3). We postulate a correlation exists between interruptions and social stressors (Fig. 1). Interruptions and social stressors are different but have one similar important outcome: they both induce attention failure. Interruptions induce attention failure by increasing attention demands that are limited and social stressors induce attention failure by inducing attention-demanding thoughts about the social relationship with supervisors. Thus the model postulates both interruptions and social stressors directly influence attention failure at work. The current study tests attention failure as the critical link between workflow interruptions and supervisor-related social stressors at work and rumination after work. Study setting The present study was part of the larger and overarching project, Work & Cooperation in Anaesthesia and Surgery and Their Impact on Performance as well as on Health & Well-Being, which was conducted at a large Swiss university hospital. The aim of this larger project was to describe work conditions and well-being in surgery personnel and examine relationships to performance indicators not reported in this study. The goal was to derive guidance for work redesign and organizational restructuring of the surgery units to improve health and well-being of surgery personnel. The project goals and the design of the project were first presented to the hospital directors. Next, a Master degree study assistant distributed the questionnaires to all surgery personnel at the hospital and responded to questions. The questionnaires included postage-paid envelopes and could be sent anonymously to the study assistant. After two weeks, the same study assistant sent a written reminder to the surgery team. Study sample Before the questionnaires were distributed, potential participants gave their consent. In 2010, questionnaires were addressed to all surgery personnel at the hospital, including 335 employees (theatre nurses, anaesthetists, and surgeons). The response rate was 57.9% from 194 questionnaires returned. There were 51.5% female participants. Age was assessed in three categories −13.2% of participants were 30 yr old or younger, 73.2% ranged in age between 31 and 50 yr, and 13.1% were older than 50 yr. The percentage of working time spent in the surgery theatre ranged from 75 to 84%. Participants were anaesthetists (9.5%), anaesthesia nurses (18.5%), surgeons (19.6%), assistant surgeons (8.3%), surgical nurses (31.6%), nurses (10.1%), and technicians (2.4%). A total of 75.4% percent of the sample worked full-time, 14.3% worked between 80% of full-time and full-time, 6, 7% worked between 50% and 79% of full-time, and 3.6% worked less than 50% of full-time. The study was carried out in accordance with the Code of Ethics of the World Medical Association (Declaration of Helsinki) and was in accordance to the supervisors of the university hospital. Assessment of workflow interruptions Workflow interruptions were assessed with the Instrument for Stress-Oriented Task Analysis (ISTA) 10). The scale consisted of four self-report items with a 5-point Likert format (1=very rarely/never, 2=rarely, 3=occasionally, 4=often, 5=very often). The items used were "On average, how often are you interrupted by your supervisor during the course of your work activity? (e.g., by questions)", "How often are you interrupted by other colleagues during the course of your work activity?", "Do you often have to interrupt your current work activity because something important comes up?", and "How often does it occur that you must work at several tasks simultaneously, and must jump back and forth between these tasks?" Given the similar wording in the first two items, we allowed for correlated errors of measurement between these two items that were used as indicators in structural equation modelling 11). The internal consistency of the scale was satisfactory (Cronbach's alpha=0.81). Assessment of attention failure Attention failure was assessed with the subscale on attention failure from the Workplace Cognitive Failure Scale (WCFS) 12). The scale consisted of four self-report items with a 5-point Likert format (1=very rarely/never, 2=rarely, 3=occasionally, 4=often, 5=very often). The four items used in the study were (How often you) "Do not fully listen to instruction?", "Day-dream when you ought to be listening to somebody?", "Do not focus your full attention on work activities?", and "Are easily distracted by co-workers?" A fifth item of the original subscale was precluded from study. The item "Fail to notice postings or notices on the facilities bulletin board (s) or e-mail system" was not included in the analysis because in another study including surgery personnel it was rated unfit for important aspects of surgery work. The internal consistency of the scale was satisfactory (Cronbach's alpha=0.81). Assessment of social stressors at work Work-related social stressors were assessed with the scale by Frese and Zapf 13). The scale consisted of three items with a 5-point Likert format referring to social climate at work and conflicts with supervisors (1=strongly agree, 2=agree, 3=undecided, 4=disagree, 5=strongly disagree). The items used in the study were "My supervi-sor always assigns the pleasant tasks to particular people", "When an error occurs, the supervisor always blames us but never himself", and "Around here, one gets reprimanded even for little things". The item "My supervisor pushes all the time" was not included in analysis because in a test trial, some participants judged the item to have a rather positive meaning. The internal consistency of the scale was satisfactory (Cronbach's alpha=0.84). Assessment of rumination after work Rumination was assessed with a self-report scale from Mohr and colleagues 14). The survey consisted of three items scaled with a 7-point Likert format (1=agree strongly, 2=agree moderately, 3=agree slightly, 4=undecided, 5=disagree slightly, 6=disagree moderately, 7=disagree strongly). The survey asked the question, "How much do the following statements apply to you?" and used three items to gather measurements: "I have difficulty relaxing after work", "Even at home I often think of my problems at work", and "Even in my vacations I think about my problems at work". An advantage of the rumination scale is that standardization values are available 15). Thus, the mean values from this study can be directly compared with those provided by other samples. The internal consistency of the scale was satisfactory (Cronbach's alpha=0.87). Statistical analysis Structural equation modelling was used to model the latent path structure of the hypothesised model. Items of questionnaire instruments were used as indicators of latent variables. A scale-free least square method, which is appropriate for relatively small data set with non-normal distributions, was used for estimation. The indirect path hypotheses were tested through AMOS 18.0, which included a bootstrap test of the indirect effects. Preacher and Hayes proposed bootstrapping because it is more robust in small samples than other approaches 16). Bootstrapping, a nonparametric resampling procedure, is an additional method advocated for testing indirect effects that does not impose the assumption of the normality of the sampling distribution. Bootstrapping is a computationally intensive method that involves repeated sampling from the data set and estimating the indirect effect on each resampled data set. By repeating this process very often (we scheduled 10,000 times), an empirical approximation of the sampling distribution of the indirect (mediation) path is built and used to construct confidence intervals for the indirect effect. A test of a hypothesised structural equation model should also include a test of a plausible alternative model. An Industrial Health 2015, 53, 427-433 alternative approach is the person model, which postulates the opposite direction of causality, namely that attention failure is a stable individual characteristic of action regulation. The assumption in the person model is that attention failure induces workflow interruptions; that is, interruptions at work are self-induced by being inattentive and social conflicts with supervisors increase because individuals are criticized for being inattentive. Hence, interruptions and social stressors at work might then mediate the effects of attention failure on rumination. Because of the directional hypothesis, the 5% alpha level was one-tailed 17). Table 1 shows the mean values of rumination and other study variables. For rumination, normative data exist so that mean levels can be compared with other samples. Results showed the sum value of the rumination scale (M=8.6, SD=4.0) is lower than the level in a representative group of 1,389 hospital employees of comparable age between 30 and 40 yr (M=10.3, SD=4.6) 15). The mean level of workflow interruptions was 2.7 on the 5-point scale (SD=0.9) and social stressors from supervisors were low on average (M=2.0, SD=0.9). The mean level of attention failure was also low (M=1.9, SD=0.6). Table 2 shows correlations between all study variables. In line with the hypotheses, social stressors with supervisors, workflow interruptions, attention failure, and rumination were positively and significantly related. (Only the correlation between rumination and workflow interruptions was marginally significant, p=0.06). Test of indirect effects in structural equation analyses The hypothesised mediation model represented the empirical data very well ( 2 =47.25, 2 /df=0.68, p=0.98). The standardized root mean square residual (SRMR) is an absolute indicator of model fit and was 0.05. A value of 0.05 or below is considered a good fit 18) (zero indicates perfect fit). As shown in Fig. 2, significant direct paths were observed from workflow interruptions to attention failure (=0.36, p<0.01), from supervisor-induced social stressors to attention failure (=0.21, p<0.05) and from attention failure to rumination (=0.24, p<0.05). The test of indirect mediation effects using a bootstrapping approach within AMOS resulted in a significant indirect path from workflow interruptions → attention failure → rumination (=0.07, CI 90=0.013 to 0.138) and a significant indirect path from supervisor-induced social stressors → attention failure → rumination (=0.051, CI 90=0.007 to 0.108). The hypothesised model of indirect effect represented the empirical data well; however, alternative models may be equally good or even better. In the alternative person model the joint indirect path from attention failure via workflow interruptions and supervisor-induced social stressors to rumination was not significant (=0.01, CI 90=−0.051 to 0.092). Discussion Surgery personnel need competencies beyond skill, education, and expertise that can be described as nontechnical skills divided into interpersonal skills and cognitive skills 19). Interpersonal skills comprise sufficient, early, and clear communication, taking leadership, teamwork skills, adequate briefing, joint planning, sufficient time spent in team preparation, adequate resource management, seeking advice from other team members and giving feedback to them, actively coping with time pressure, one's own stress reactions and those of other team members, and taking short breaks to reduce fatigue and adequate workload distribution. Cognitive skills include high situation awareness, early anticipation of problems, continuous risk assessment, taking perspectives in decision making, good adaptive strategies that increase flexibility 19). The results of this study pertaining to interpersonal skills show that social stressors occurring from supervisor interaction are due to lack of leadership skills and poorly developed interpersonal skills that are likely to impede subordinate's attention to the primary task at hand. Good cognitive skills of leaders may also contribute to avoiding unnecessary interruptions. Good cognitive skills that include adequate situation awareness and anticipation of problems help to avoid misunderstanding and problems and thereby reduce unnecessary workflow interruptions 2). On the one hand, the low average levels of attention failure found in this study may reflect good competencies in attention regulation among surgery personnel. On the other hand, results show that attention failure is likely a consequence of social stressors from supervisors and supervisor-induced workflow interruptions. Thus, an intervention that addresses communication and cooperation on the team level may be fruitful even with skilled surgery personnel. Team communication and cooperation help to shape a shared mental model of the task. A good shared mental model was shown to contribute to increased necessary workflow interruptions and to fewer unnecessary interruptions 2). Communication has been listed among the three most frequent causes of errors for many types of sentinel events in health care 20). Both social stressors and unnecessary interruptions can be reduced when information and communication procedures are improved by team training 21). Team training should improve backup behaviour, closed-loop communication and other procedures of safe communication that are part of crew resource management (CRM) training that works well in aviation and health care 22). In addition, work and task redesign that results in the reduction of unnecessary workflow interruptions decreases attention demands by improving the ease of information availability (e.g. documentation of the steps of a surgical procedure, necessary medical devices for surgery, and use of the WHO surgical safety checklist 23) ). Another aim in task redesign should be to introduce mandatory attention checks that have to be done before proceeding with the task (e.g. pre-surgical verification of work flow). Task redesign should also comprise use of memory aid (e.g., electronic patient data available) and use of clear signals and distinctive choice alternatives (e.g., use of different plugs and sockets for different functions, use of distinctive labels for different medications, and distinctive labels for surgical accessories including loops, sutures, dressings, implants, etc.) 24). Results showed that rumination in surgery personnel was lower than in a representative group of 1,389 hospital employees of comparable age 15). The reason for this might be that after surgery has started, surgery personnel do not have much control on how and when and with whom they do the task 6). Many degrees of freedom and uncompleted tasks often trigger rumination after work, thus, having relatively little autonomy might correspond to less rumination. In addition, surgery personnel also have few unfinished tasks and goals, because they always finish the job before leaving work 6). Having completed tasks may also reduce rumination. CRM and task redesign can be expected to reduce work-related rumination during leisure time that impedes Industrial Health 2015, 53, 427-433 recovery because this study showed work conditions are indirectly linked to rumination, while the alternative person model showed no indirect link between attention failure via work conditions and rumination. Thus, CRM and task redesign can be expected to maintain and improve employee health and patient safety 22). Limitations Study limitations include the cross-sectional design and use of self-report questionnaires. Thus, further studies should be longitudinal and also include task observation 25,26). Individual differences in personality traits that are related to attention failure should be controlled for as potential confounders. For instance, further studies should control for individual differences in conscientiousness 27). Furthermore, this study was conducted in a large Swiss university hospital. Thus, the results found cannot be generalized and future studies should provide further empirical evidence for this pattern in other hospitals. Conclusion Employee health is related to patient safety 28). Accordingly, employee education, work stressors, hours of work, and working conditions could also be related to patient safety. Attention failure is common in the operating room and may result in errors, as operation personnel with lower hierarchy often experience social stressors and report that they are afraid to speak up about errors 29). It is known that nurses are afraid to challenge the surgeon, even in the face of observed errors, as nurses are often bullied by surgeons 30,31). All of this may jeopardize patient safety. The training of surgeons to do a preoperative briefing has resulted in preventing errors and improving patient safety because the operating personal was encouraged to speak up when errors occurred 29). Thus, attention failure seems to be a promising intervening cognitive process in cognitive-oriented research on workflow interruptions 1), leadership 2), and employee health and patient safety in surgery teams 27). CRM and task redesign may help to make hospitals safer places for surgery personnel and patients 2). |
Seasonal variation in biopharmaceutical activity and fatty acid content of endemic Fucus virsoides algae from Adriatic Sea Macroalgae from Fucus genus are a valuable source of bioactive components as they are abundant in complex polysaccharides, fatty acids and polyphenols. In this work, the biological activity and chemical composition of extracts and fractions obtained from endemic Fucus virsoides J. Agardh species collected in the summer and the fall were investigated. From dichloromethane:methanol (1 : 1) extract three fractions were made: petroleum-ether, ethyl-acetate and n-butanol. The aim of the study was to examine the influence of the seasonal variations on algal composition and activity. The significant seasonal variation in content and biological activity of Fucus virsoides samples was found. Fall extract and fractions exerted higher cytotoxic effects on cancer cell lines in comparison with summer extract and fractions. The examined extracts and fractions showed higher cytotoxic activity towards cancer cells compared to normal fibroblast MRC-5 cells. Morphological evaluation and cell cycle distribution analysis demonstrated their proapoptotic activity in human cervical adenocarcinoma HeLa cells. Fall extract and fractions better suppressed the migration and tube formation of EA.hy926 cells in comparison with summer extract and fractions. Fall extract and fractions were more potent in inhibition of -glucosidase enzymatic activity. Ethyl-acetate fractions, from both seasons, exhibited the best antibacterial and antifungal activity on all tested bacteria and fungi. In conclusion, the two fall fractions ethyl-acetate and petroleum-ether rich in polyphenols and polyunsaturated fatty acids were the most active and exhibited prominent anticancer and anti--glucosidase activities. |
//! A constructor.
/*!
This is a constructor method of GameObject class
@param rect It's a rectangulo, the space of the object displayed.
@param r It's the rotation indices of object
@param hs It's the hostspot of object,related to the boundaries
of the object
@param a
@warning Method that requires review of comment
*/
GameObject::GameObject (const Rect &rect,float r,Hotspot hs,bool a):
uid{goCount++},
pos{rect.x,rect.y},
size{rect.w,rect.h},
rotation{r},
hotspot{hs},
anchored{a} {
components.fill(nullptr);
entities[uid]=unique_ptr<GameObject>(this);
} |
#include <stdio.h>
#include <queue>
using namespace std;
pair<int, int> res;
int n, m, k;
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
bool vis[2001][2001];
queue<pair<int, int> > q;
void BFS() {
while(!q.empty()) {
int x, y, nx, ny;
x = q.front().first;
y = q.front().second;
q.pop();
if(vis[x][y]) continue;
vis[x][y] = true;
res.first = x;
res.second = y;
for(int i = 0; i < 4; i++) {
nx = x + dx[i];
ny = y + dy[i];
if(nx >= 0 && nx < n && ny >= 0 && ny < m && !vis[nx][ny])
q.push(make_pair(nx, ny));
}
}
}
int main() {
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
int a, b;
scanf("%d%d%d", &n, &m, &k);
while(k--) {
scanf("%d%d", &a, &b);
a--; b--;
q.push(make_pair(a, b));
}
BFS();
printf("%d %d", res.first + 1, res.second + 1);
}
|
# File automatically generated by mapry. DO NOT EDIT OR APPEND!
"""parses JSONable objects."""
import pathlib
import re
import typing
import some.graph
import some.graph.parse
def some_graph_from(
value: typing.Any,
ref: str,
errors: some.graph.parse.Errors
) -> typing.Optional[some.graph.SomeGraph]:
"""
parses SomeGraph from a JSONable value.
:param value: JSONable value
:param ref: reference to the value (e.g., a reference path)
:param errors: errors encountered during parsing
:return: parsed SomeGraph, or None if ``errors``
"""
if errors.full():
return None
if not isinstance(value, dict):
errors.add(
ref,
"Expected a dictionary, but got: {}".format(type(value)))
return None
graph = some.graph.parse.placeholder_some_graph()
##
# Parse some_path
##
value_0 = value.get(
'some_path',
None)
if value_0 is None:
errors.add(
ref,
'Property is missing: some_path')
else:
if not isinstance(value_0, str):
errors.add(
'/'.join((
ref, 'some_path')),
"Expected a string, but got: {}".format(
type(value_0)))
else:
if not re.match(
r'^/[a-zA-Z]+-[0-9]+$',
value_0):
errors.add(
'/'.join((
ref, 'some_path')),
'Expected to match ^/[a-zA-Z]+-[0-9]+$, but got: {}'.format(
value_0))
else:
graph.some_path = pathlib.Path(
value_0)
if errors.full():
return None
##
# Parse unconstrained_path
##
value_2 = value.get(
'unconstrained_path',
None)
if value_2 is None:
errors.add(
ref,
'Property is missing: unconstrained_path')
else:
if not isinstance(value_2, str):
errors.add(
'/'.join((
ref, 'unconstrained_path')),
"Expected a string, but got: {}".format(
type(value_2)))
else:
graph.unconstrained_path = pathlib.Path(
value_2)
if errors.full():
return None
if not errors.empty():
return None
return graph
|
<reponame>JT020Jad/OOP-Test-2021-Starter
package ie.tudublin;
import processing.core.PApplet;
public class Note extends PApplet
{
// Private fields
private char note;
private int duration;
// Constructor
public Note(char note, int duration)
{
this.note = note;
this.duration = duration;
}
// Generated toString() method
@Override
public String toString()
{
return "Note [duration=" + duration + ", note=" + note + "]";
}
public int getDuration()
{
return duration;
}
public void setDuration(int duration)
{
this.duration = duration;
}
public char getNote()
{
return note;
}
public void setNote(char note)
{
this.note = note;
}
} |
/**
* Prints the message, after adding indents and returns to a new line. This
* is the most commonly used method.
*/
private ItdSourceFileComposer appendFormalLine(final String message) {
appendIndent();
if (message != null && !"".equals(message)) {
pw.append(message);
content = true;
}
return newLine(false);
} |
#pragma once
#include "util.hh"
#include <unordered_map>
#include <memory>
#include <string>
#ifndef _WIN32
#include <sys/socket.h>
#include <netinet/in.h>
#endif
namespace uvgrtp {
// forward declarations
class rtp;
class zrtp;
class rtcp;
class srtp;
class srtcp;
class pkt_dispatcher;
class holepuncher;
class socket;
namespace frame {
struct rtp_frame;
};
namespace formats {
class media;
};
class media_stream {
public:
/// \cond DO_NOT_DOCUMENT
media_stream(std::string addr, int src_port, int dst_port, rtp_format_t fmt, int flags);
media_stream(std::string remote_addr, std::string local_addr, int src_port, int dst_port, rtp_format_t fmt, int flags);
~media_stream();
/* Initialize traditional RTP session
* Allocate Connection/Reader/Writer objects and initialize them
*
* Return RTP_OK on success
* Return RTP_MEMORY_ERROR if allocation failed
*
* Other error return codes are defined in {conn,writer,reader}.hh */
rtp_error_t init();
/* Initialize Secure RTP session
* Allocate Connection/Reader/Writer objects and initialize them
*
* Return RTP_OK on success
* Return RTP_MEMORY_ERROR if allocation failed
*
* TODO document all error codes!
*
* Other error return codes are defined in {conn,writer,reader,srtp}.hh */
rtp_error_t init(uvgrtp::zrtp *zrtp);
/// \endcond
/**
*
* \brief Add keying information for user-managed SRTP session
*
* \details For user-managed SRTP session, the media stream is not started
* until SRTP key has been added and all calls to push_frame() will fail
*
* Notice that if user-managed SRTP has been enabled during media stream creation,
* this function must be called before anything else. All calls to other functions
* will fail with ::RTP_NOT_INITIALIZED until the SRTP context has been specified
*
* \param key SRTP master key, default is 128-bit long
* \param salt 112-bit long salt
*
* \return RTP error code
*
* \retval RTP_OK On success
* \retval RTP_INVALID_VALUE If key or salt is invalid
* \retval RTP_NOT_SUPPORTED If user-managed SRTP was not specified in create_stream() */
rtp_error_t add_srtp_ctx(uint8_t *key, uint8_t *salt);
/**
* \brief Send data to remote participant with a custom timestamp
*
* \details If so specified either by the selected media format and/or given
* ::RTP_CTX_ENABLE_FLAGS, uvgRTP fragments the input data into RTP packets of 1500 bytes,
* or to any other size defined by the application using ::RCC_MTU_SIZE
*
* The frame is automatically reconstructed by the receiver if all fragments have been
* received successfully.
*
* \param data Pointer to data the that should be sent
* \param data_len Length of data
* \param flags Optional flags, see ::RTP_FLAGS for more details
*
* \return RTP error code
*
* \retval RTP_OK On success
* \retval RTP_INVALID_VALUE If one of the parameters are invalid
* \retval RTP_MEMORY_ERROR If the data chunk is too large to be processed
* \retval RTP_SEND_ERROR If uvgRTP failed to send the data to remote
* \retval RTP_GENERIC_ERROR If an unspecified error occurred
*/
rtp_error_t push_frame(uint8_t *data, size_t data_len, int flags);
/**
* \brief Send data to remote participant with a custom timestamp
*
* \details If so specified either by the selected media format and/or given
* ::RTP_CTX_ENABLE_FLAGS, uvgRTP fragments the input data into RTP packets of 1500 bytes,
* or to any other size defined by the application using ::RCC_MTU_SIZE
*
* The frame is automatically reconstructed by the receiver if all fragments have been
* received successfully.
*
* \param data Smart pointer to data the that should be sent
* \param data_len Length of data
* \param flags Optional flags, see ::RTP_FLAGS for more details
*
* \return RTP error code
*
* \retval RTP_OK On success
* \retval RTP_INVALID_VALUE If one of the parameters are invalid
* \retval RTP_MEMORY_ERROR If the data chunk is too large to be processed
* \retval RTP_SEND_ERROR If uvgRTP failed to send the data to remote
* \retval RTP_GENERIC_ERROR If an unspecified error occurred
*/
rtp_error_t push_frame(std::unique_ptr<uint8_t[]> data, size_t data_len, int flags);
/**
* \brief Send data to remote participant with a custom timestamp
*
* \details If so specified either by the selected media format and/or given
* ::RTP_CTX_ENABLE_FLAGS, uvgRTP fragments the input data into RTP packets of 1500 bytes,
* or to any other size defined by the application using ::RCC_MTU_SIZE
*
* The frame is automatically reconstructed by the receiver if all fragments have been
* received successfully.
*
* If application so wishes, it may override uvgRTP's own timestamp
* calculations and provide timestamping information for the stream itself.
* This requires that the application provides a sensible value for the ts
* parameter. If RTCP has been enabled, uvgrtp::rtcp::set_ts_info() should have
* been called.
*
* \param data Pointer to data the that should be sent
* \param data_len Length of data
* \param ts 32-bit timestamp value for the data
* \param flags Optional flags, see ::RTP_FLAGS for more details
*
* \return RTP error code
*
* \retval RTP_OK On success
* \retval RTP_INVALID_VALUE If one of the parameters are invalid
* \retval RTP_MEMORY_ERROR If the data chunk is too large to be processed
* \retval RTP_SEND_ERROR If uvgRTP failed to send the data to remote
* \retval RTP_GENERIC_ERROR If an unspecified error occurred
*/
rtp_error_t push_frame(uint8_t *data, size_t data_len, uint32_t ts, int flags);
/**
* \brief Send data to remote participant with a custom timestamp
*
* \details If so specified either by the selected media format and/or given
* ::RTP_CTX_ENABLE_FLAGS, uvgRTP fragments the input data into RTP packets of 1500 bytes,
* or to any other size defined by the application using ::RCC_MTU_SIZE
*
* The frame is automatically reconstructed by the receiver if all fragments have been
* received successfully.
*
* If application so wishes, it may override uvgRTP's own timestamp
* calculations and provide timestamping information for the stream itself.
* This requires that the application provides a sensible value for the ts
* parameter. If RTCP has been enabled, uvgrtp::rtcp::set_ts_info() should have
* been called.
*
* \param data Smart pointer to data the that should be sent
* \param data_len Length of data
* \param ts 32-bit timestamp value for the data
* \param flags Optional flags, see ::RTP_FLAGS for more details
*
* \return RTP error code
*
* \retval RTP_OK On success
* \retval RTP_INVALID_VALUE If one of the parameters are invalid
* \retval RTP_MEMORY_ERROR If the data chunk is too large to be processed
* \retval RTP_SEND_ERROR If uvgRTP failed to send the data to remote
* \retval RTP_GENERIC_ERROR If an unspecified error occurred
*/
rtp_error_t push_frame(std::unique_ptr<uint8_t[]> data, size_t data_len, uint32_t ts, int flags);
/**
* \brief Poll a frame indefinitely from the media stream object
*
* \return RTP frame
*
* \retval uvgrtp::frame::rtp_frame* On success
* \retval nullptr If an unrecoverable error happened
*/
uvgrtp::frame::rtp_frame *pull_frame();
/**
* \brief Poll a frame for a specified time from the media stream object
*
* \param timeout How long is a frame waited, in milliseconds
*
* \return RTP frame
*
* \retval uvgrtp::frame::rtp_frame* On success
* \retval nullptr If a frame was not received within the specified time limit
* \retval nullptr If an unrecoverable error happened
*/
uvgrtp::frame::rtp_frame *pull_frame(size_t timeout);
/**
* \brief Asynchronous way of getting frames
*
* \details Receive hook is an alternative to polling frames using uvgrtp::media_stream::pull_frame().
* Instead of application asking from uvgRTP if there are any new frames available, uvgRTP will notify
* the application when a frame has been received
*
* The hook should not be used for media processing as it will block the receiver from
* reading more frames. Instead, it should only be used as an interface between uvgRTP and
* the calling application where the frame hand-off happens.
*
* \param arg Optional argument that is passed to the hook when it is called, can be set to nullptr
* \param hook Function pointer to the receive hook that uvgRTP should call
*
* \return RTP error code
*
* \retval RTP_OK On success
* \retval RTP_INVALID_VALUE If hook is nullptr */
rtp_error_t install_receive_hook(void *arg, void (*hook)(void *, uvgrtp::frame::rtp_frame *));
/// \cond DO_NOT_DOCUMENT
/* If system call dispatcher is enabled and calling application has special requirements
* for the deallocation of a frame, it may install a deallocation hook which is called
* when SCD has processed the frame
*
* Return RTP_OK on success
* Return RTP_INVALID_VALUE if "hook" is nullptr */
rtp_error_t install_deallocation_hook(void (*hook)(void *));
/* If needed, a notification hook can be installed to uvgRTP that can be used as
* an information side channel to the internal state of the library.
*
* When uvgRTP encouters a situation it doesn't know how to react to,
* it calls the notify hook with certain notify reason number (src/util.hh).
* Upon receiving a notification, application may ignore it or act on it somehow
*
* Currently only one notification type is supported and only receiver uses notifications
*
* "arg" is optional argument that is passed to hook when it is called. It may be nullptr
*
* Return RTP_OK on success
* Return RTP_INVALID_VALUE if "hook" is nullptr */
rtp_error_t install_notify_hook(void *arg, void (*hook)(void *, int));
/// \endcond
/**
* \brief Configure the media stream, see ::RTP_CTX_CONFIGURATION_FLAGS for more details
*
* \return RTP error code
*
* \retval RTP_OK On success
* \retval RTP_INVALID_VALUE If the provided value is not valid for a given configuration flag
* \retval RTP_INVALID_VALUE If the provided configuration flag is not supported
* \retval RTP_GENERIC_ERROR If setsockopt(2) failed
*/
rtp_error_t configure_ctx(int flag, ssize_t value);
/// \cond DO_NOT_DOCUMENT
/* Setter and getter for media-specific config that can be used f.ex with Opus */
void set_media_config(void *config);
void *get_media_config();
/* Get unique key of the media stream
* Used by session to index media streams */
uint32_t get_key();
/// \endcond
/**
*
* \brief Get pointer to the RTCP object of the media stream
*
* \details This object is used to control all RTCP-related functionality
* and RTCP documentation can be found from \ref uvgrtp::rtcp
*
* \return Pointer to RTCP object
*
* \retval uvgrtp::rtcp* If RTCP has been enabled (RCE_RTCP has been given to uvgrtp::session::create_stream())
* \retval nullptr If RTCP has not been enabled
*/
uvgrtp::rtcp *get_rtcp();
private:
/* Initialize the connection by initializing the socket
* and binding ourselves to specified interface and creating
* an outgoing address */
rtp_error_t init_connection();
/* Create the media object for the stream */
rtp_error_t create_media(rtp_format_t fmt);
/* free all allocated resources */
rtp_error_t free_resources(rtp_error_t ret);
uint32_t key_;
uvgrtp::srtp *srtp_;
uvgrtp::srtcp *srtcp_;
uvgrtp::socket *socket_;
uvgrtp::rtp *rtp_;
uvgrtp::rtcp *rtcp_;
sockaddr_in addr_out_;
std::string addr_;
std::string laddr_;
int src_port_;
int dst_port_;
rtp_format_t fmt_;
int flags_;
/* Media context config (SCD etc.) */
rtp_ctx_conf_t ctx_config_;
/* Media config f.ex. for Opus */
void *media_config_;
/* Has the media stream been initialized */
bool initialized_;
/* Primary handler keys for the RTP packet dispatcher */
uint32_t rtp_handler_key_;
uint32_t zrtp_handler_key_;
/* RTP packet dispatcher for the receiver */
uvgrtp::pkt_dispatcher *pkt_dispatcher_;
/* Media object associated with this media stream. */
uvgrtp::formats::media *media_;
/* Thread that keeps the holepunched connection open for unidirectional streams */
uvgrtp::holepuncher *holepuncher_;
};
};
namespace uvg_rtp = uvgrtp;
|
A Political Economy of Social Discrimination From burqa ban to minaret ban, from right to detain suspected illegal immigrants to restricting the help to migrants, the number of social laws specifically targeting a tiny proportion of citizens has raised in recent years across Western democracies. These symbolic policies, we show, are far from being innocuous: they can have far reaching consequences for large parts of the population. By raising the salience of certain social traits (e.g., Muslim identity) these laws can create a labour market loaded in favor of the majority (e.g., the non-Muslims), yielding higher unemployment rates and spells for minority citizens. These deleterious effects arise even absent any form of bias against, or uncertainty about, minority workers. Instead they are fully driven by social expectations about behavior and are best understood as a form of social discrimination. Importantly, we establish conditions under which a plurality of the citizenry demands the implementation of symbolic policies anticipating their labor market consequences. We further highlight that the implementation of symbolic policies is always associated with less redistribution and can be coupled with lower tax rates. We discuss several policy recommendations to limit the possibility of social discrimination arising. |
ROME — Italy has returned to Iran a 17th century tombstone, featuring Arabic and Farsi inscriptions, that police found abandoned near a cemetery outside Rome.
Italy's carabinieri art squad organized a handover ceremony Monday to deliver the tombstone to Iranian Ambassador Jahanbakhsh Mozaffari.
Italy has been on a decades-long campaign to recover priceless artifacts that were looted from Italy and ended up in top-end museums and private collections around the globe. Police said the return of the tombstone was "evidence of the importance that Italy places on the culture of restitution."
Police didn't estimate the value of the tombstone, or explain how it was believed to have arrived in Italy. A statement said only that it had been abandoned near the Ferentino cemetery near Frosinone and was found in August 2015. |
Accumulation of catalytically active PKC into the nucleus of HL60 cell line plays a key role in the induction of granulocytic differentiation mediated by alltrans retinoic acid The effect of differentiating doses of alltrans retinoic acid (ATRA, 10−6m) and vitamin D3 (10−7m) was investigated on the nuclear levels of endogenous ceramide and protein kinase C (PKC) catalytic activity in HL60 myeloid cells. ATRA induced a parallel increase of ceramide and catalytically active PKC into the nuclear compartment of HL60 cells (peak at 72h). On the other hand, vitamin D3 increased the levels of nuclear ceramide and PKC activity to a lesser extent and with a delayed kinetics compared to ATRA (peak at 96h). |
import { Matcher } from '../matchers/Base'
import { PluginSmartEqRules, SmartEqRule } from '../plugins/types'
import { NonEmptyOnly } from '../types'
import { isIterableAndNotString } from './common'
type ErrorReasons = 'value mismatch' | 'prototype mismatch' | 'object possibly infinite'
export type SmartEqResult = { result: 'success' } | { result: 'error'; reason: ErrorReasons }
export function buildSmartEqResult(success: boolean, reason: ErrorReasons = 'value mismatch'): SmartEqResult {
if (success) {
return { result: 'success' }
} else {
return { result: 'error', reason }
}
}
// strict=false skips prototype check
export function smartEq(actual: any, expected: any, strict: boolean = true, seen: Set<any> = new Set()): SmartEqResult {
// handles recursive objects
if (seen.has(actual) && seen.has(expected)) {
return buildSmartEqResult(true)
}
seen.add(actual)
seen.add(expected)
if (expected instanceof Matcher) {
return buildSmartEqResult(expected.check(actual))
}
for (const rule of rulesRegisteredByPlugins) {
const ruleResult = rule(actual, expected, strict)
if (ruleResult) {
return ruleResult
}
}
if (actual instanceof Date) {
if (expected instanceof Date) {
return buildSmartEqResult(actual.getTime() === expected.getTime())
} else {
return buildSmartEqResult(false, 'prototype mismatch')
}
}
if (typeof actual === 'symbol') {
if (typeof expected === 'symbol') {
return smartEq(actual.toString(), expected.toString(), strict, seen)
} else {
return buildSmartEqResult(false, 'prototype mismatch')
}
}
if (isIterableAndNotString(actual)) {
if (isIterableAndNotString(expected)) {
const actualArray = Array.from(actual)
const expectedArray = Array.from(expected)
if (actualArray.length !== expectedArray.length) {
return buildSmartEqResult(false)
}
const equality = actualArray.map((v, i) => smartEq(v, expectedArray[i], strict, seen))
return buildSmartEqResult(!equality.some((eq) => eq.result === 'error'))
} else {
return buildSmartEqResult(false, 'prototype mismatch')
}
}
if (actual && actual instanceof Object) {
if (!expected) {
return buildSmartEqResult(false, 'prototype mismatch')
}
if (strict && Object.getPrototypeOf(actual) !== Object.getPrototypeOf(expected)) {
return buildSmartEqResult(false, 'prototype mismatch')
}
try {
if (typeof expected === 'object') {
const allKeys = Object.keys(actual).concat(Object.keys(expected))
const equality = allKeys.map((k) => {
if (!(k in expected && k in actual)) {
return buildSmartEqResult(false)
}
return smartEq(actual[k], expected[k], strict, seen)
})
return buildSmartEqResult(!equality.some((eq) => eq.result === 'error'))
}
} catch (err) {
if (err instanceof Error && err.name === 'RangeError' && err.message === 'Maximum call stack size exceeded') {
return buildSmartEqResult(false, 'object possibly infinite')
}
throw err
}
}
return buildSmartEqResult(Object.is(actual, expected), 'value mismatch')
}
const rulesRegisteredByPlugins: SmartEqRule<unknown, unknown>[] = []
export function loadSmartEqRules(rules: PluginSmartEqRules<never>): void {
const rulesArray: SmartEqRule<unknown, unknown>[] = Array.isArray(rules) ? rules : Object.values(rules)
rulesRegisteredByPlugins.push(...rulesArray)
}
export interface SmartEqRules {}
export declare namespace SmartEqRules {
export type Expected<TEqRule> = TEqRule extends SmartEqRule<any, infer TExpected> ? TExpected : never
}
export type ExpectedEqual<TActual> =
| TActual
| SmartEqRules.Expected<Extract<SmartEqRules[keyof SmartEqRules], SmartEqRule<TActual, never>>>
| NonEmptyOnly<TActual extends object ? { [K in keyof TActual]: ExpectedEqual<TActual[K]> } : never>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.