content
stringlengths 7
2.61M
|
---|
Analysis of range migration and Doppler history for an airborne passive bistatic SAR radar This paper presents an analysis of range migration and Doppler frequency rate-of-change for an airborne passive bistatic radar (PBR) utilizing the synthetic aperture radar (SAR) technique in the imaging of ground objects. The study was carried out for PBR using the Digital Video Broadcasting - Terrestrial (DVB-T) transmitter as an illuminator of opportunity. The results obtained have been verified using both simulated and real data gathered by a PBR mounted on an airborne platform.
|
<filename>src/test/java/edu/stanford/protege/webprotege/common/DictionaryLanguageFilter_TestCase.java
package edu.stanford.protege.webprotege.common;
import edu.stanford.protege.webprotege.common.DictionaryLanguage;
import edu.stanford.protege.webprotege.common.DictionaryLanguageFilter;
import edu.stanford.protege.webprotege.common.LangTagFilter;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
import org.springframework.boot.test.context.SpringBootTest;
import static edu.stanford.protege.webprotege.common.DictionaryLanguageFilter.EmptyLangTagTreatment.EXCLUDE_EMPTY_LANG_TAGS;
import static edu.stanford.protege.webprotege.common.DictionaryLanguageFilter.EmptyLangTagTreatment.INCLUDE_EMPTY_LANG_TAGS;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.mockito.Mockito.when;
@SpringBootTest
public class DictionaryLanguageFilter_TestCase {
public static final String LANG_TAG = "en";
public static final String EMPTY_LANG_TAG = "";
@Mock
private LangTagFilter langTagFilter;
@Mock
private DictionaryLanguage dictionaryLanguage;
@BeforeEach
public void setUp() throws Exception {
}
@Test
public void shouldIncludeEmptyLangTag() {
when(dictionaryLanguage.getLang())
.thenReturn(EMPTY_LANG_TAG);
DictionaryLanguageFilter filter = DictionaryLanguageFilter.get(langTagFilter, INCLUDE_EMPTY_LANG_TAGS);
assertThat(filter.isIncluded(dictionaryLanguage), is(true));
}
@Test
public void shouldNotIncludeEmptyLangTag() {
when(dictionaryLanguage.getLang())
.thenReturn(EMPTY_LANG_TAG);
DictionaryLanguageFilter filter = DictionaryLanguageFilter.get(langTagFilter, EXCLUDE_EMPTY_LANG_TAGS);
assertThat(filter.isIncluded(dictionaryLanguage), is(false));
}
@Test
public void shouldIncludeNonEmptyLangTag() {
when(dictionaryLanguage.getLang())
.thenReturn(LANG_TAG);
when(langTagFilter.isIncluded(LANG_TAG))
.thenReturn(true);
DictionaryLanguageFilter filter = DictionaryLanguageFilter.get(langTagFilter, EXCLUDE_EMPTY_LANG_TAGS);
assertThat(filter.isIncluded(dictionaryLanguage), is(true));
}
@Test
public void shouldNotIncludeNonEmptyLangTag() {
when(dictionaryLanguage.getLang())
.thenReturn(LANG_TAG);
when(langTagFilter.isIncluded(LANG_TAG))
.thenReturn(false);
DictionaryLanguageFilter filter = DictionaryLanguageFilter.get(langTagFilter, EXCLUDE_EMPTY_LANG_TAGS);
assertThat(filter.isIncluded(dictionaryLanguage), is(false));
}
}
|
A Coligny teenager was allegedly killed for about R60 worth of sunflower heads, the North West High Court heard on Thursday.
Phillip Schutte, the man accused of throwing out Matlhomola Mosweu from a moving bakkie, said the boy had five or six sunflower heads on his hands when he and his co-accused apprehended him.
Schutte said this after Judge Ronald Hendricks asked him how many sunflower heads the teen had. Schutte told the court that Mosweu and his friends dropped the alleged stolen sunflower heads and ran away after realising that they (he and co-accused Pieter Doorewaard) had seen them.
He said Doorewaard, however, stopped them in their tracks and loaded them into the bakkie the two were travelling in.
“Would you pay a lot of money for those sunflower heads?” judge Hendricks asked. “If I can estimate, it's approximately R50 or R60,” Schutte replied.
Schutte and Doorewaard are accused of killing Mosweu by throwing him out of a moving bakkie in April 20 last year. The case was postponed to September 25 to allow a counsel to prepare for arguments. Their R5000 bail was extended.
One of the two farm workers accused of the murder of a Coligny teenager did not see the logic behind taking the severely injured boy to the clinic.
|
Duration and developmental timing of poverty and children's cognitive and social development from birth through third grade. Relations of duration and developmental timing of poverty to children's development from birth to age 9 were examined by comparing children from families who were never poor, poor only during the child's infancy (0-3 years of age), poor only after infancy (4-9 years of age), and chronically poor. Chronically poor families provided lower quality childrearing environments, and children in these families showed lower cognitive performance and more behavior problems than did other children. Any experience of poverty was associated with less favorable family situations and child outcomes than never being poor. Being poor later tended to be more detrimental than early poverty. Mediational analyses indicated that poverty was linked to child outcomes in part through less positive parenting.
|
def add_parameters(self,template_file,in_file,pst_path=None):
assert os.path.exists(template_file)
parnme = pst_utils.parse_tpl_file(template_file)
new_parnme = [p for p in parnme if p not in self.parameter_data.parnme]
if len(new_parnme) == 0:
warnings.warn("no new parameters found in template file {0}".format(template_file))
new_par_data = None
else:
new_par_data = pst_utils.populate_dataframe(new_parnme,pst_utils.pst_config["par_fieldnames"],
pst_utils.pst_config["par_defaults"],
pst_utils.pst_config["par_dtype"])
new_par_data.loc[new_parnme,"parnme"] = new_parnme
self.parameter_data = self.parameter_data.append(new_par_data)
if pst_path is not None:
template_file = os.path.join(pst_path,os.path.split(template_file)[-1])
in_file = os.path.join(pst_path, os.path.split(in_file)[-1])
self.template_files.append(template_file)
self.input_files.append(in_file)
return new_par_data
|
Shayne Gostisbehere has graduated from a nice rookie story to a Philadelphia Flyers phenomenon. The 22-year-old defenseman holds the NHL record for most points in consecutive games by a rookie defenseman with 15.
He is shooting up the rookie points race, with 37 in 47 games. Entering Friday's games, that was good for No. 5 among rookies (tied with Arizona's Anthony Duclair, who has played 19 more games) with everyone ahead of him playing at least 60 games. They're also all forwards.
He should be a Calder Trophy finalist and a strong finish could push him to the top of that race.
Editor's Picks Big weekend ahead for the NHL at Sloan Craig Custance previews hockey panels at this weekend's Sloan Analytics conference and answers questions about goalies and Gostisbehere in the mailbag
Hockey Today Flyers C Sean Couturier chats with Scott Burnside about getting adjusted to new coach Dave Hakstol, the progress of Shayne Gostisbehere, Philadelphia's sense of urgency in the playoff race and making the World Cup "North America" roster.
Morning 3-on-3: Who should win the Calder Trophy? Artemi Panarin and Dylan Larkin are 1-2 in rookie goals, but are they the Calder Trophy leaders? We debate Panarin's status as the favorite and whether Connor McDavid might get into the mix. 2 Related
Most important to him, he has helped push the Flyers back into the playoff picture, as they sit just three points out of a postseason spot.
The player called "Ghost" talked to ESPN.com's Craig Custance about the wild ride and his hopes of reaching the postseason in his rookie season.
Custance: You've now moved from NHL rookie to folk hero. How has this ride been for you?
Gostisbehere: It's definitely been a wild ride. It's pretty crazy. If someone told me this was going to happen at the beginning of the year, I'd have said, 'You're pretty crazy.' It's been a fun ride and to experience it with my teammates, coaches and everything has been a lot of fun.
Custance: What was the one point this season where you were like, 'I can't believe this is happening?'
Gostisbehere: Just when you get called up and you're in the NHL and you're scoring goals and doing stuff that you know you're typically not supposed to be doing. I think some of the OT winners, I've been like, 'What is going on?' It's a wild ride. It's crazy. It's been a lot of fun for sure.
Custance: Is it true that every single one of your goals has tied the score or given the Flyers the lead? Can that be right?
Gostisbehere: I think so. I haven't looked too much into it. I believe so.
Custance: Has that always been the case with you? Have you always had a penchant for big goals?
Gostisbehere: Every time I'm on the ice, I'm just trying to help my team. If it's in the D-zone, helping my team get out of the D-zone. If it's the offensive zone, trying to score. Just going out there trying to do whatever I can to help my team.
Custance: When was the moment you knew you were in the NHL to stay?
Gostisbehere: I really don't know. This whole experience has been a whirlwind for me. You can ask anyone, I'm just happy to be here. It's been a special ride but it's something you look at where you don't want short-term success, you want long-term success. You want to stay within yourself and have fun doing it.
Shayne Gostisbehere is averaging 19:33 of ice time on the Flyers' blue line. Len Redkoles/Getty Images
Custance: Your coach Dave Hakstol doesn't seem like the kind of guy who is throwing out a lot of bouquets of praise publicly. Is he the same way privately?
Gostisbehere: He's that kind of guy. He's an all-business guy. He expects a lot from his players. He's going to be ready, so you'd better be ready. He's an all-business sort of man. We kind of like it that way. He's been great with us. He says the right things at the right time. He's pulling on the same side of the rope as us and it's shown, for sure. He's doing a great job.
Custance: From the outside, this was viewed as a transition year for the Flyers. I'm not sure many of us predicted you guys in a playoff spot. What has kept you in the race?
Gostisbehere: To be honest, we're a hungry team. Every time we're out there, we're clawing. It's a dog fight. We want to be a team that teams say, 'Aw, crap, we have to play them tonight. They're a hard team to play against.' That's the type of team we are, we're hard-nosed, we're gritty, we're hard to play against. It's something that's instilled not only in this team but the Flyers organization.
Custance: You suffered a torn ACL last season early on in your transition to becoming a pro. What was the hardest part about that process?
Gostisbehere: It was pretty hard. Your first year pro, you've only played seven games. The whole time during the rehab, I believed I would come back and play a little bit at the end of the year. Toward the end of my rehab, the Phantoms weren't making the playoffs. The risk of playing was not worth the reward. It was just smart to shut me down for the rest of the year and focus on my rehab and have a good summer and focus on this year. At the time, I was a little upset because I wanted to play; I can't thank the Flyers organization enough for making me realize there's a bigger picture and bright future. They really helped me through that.
Custance: What were those conversations like?
Gostisbehere: [The knee] wasn't fully 100 percent but I could definitely play. It was the sort of thing where you could still get hurt. The risk just wasn't worth the reward.
Custance: We're seeing more American players in the NHL come from non-traditional states, including you. How was the hockey scene growing up in Florida?
Gostisbehere: Fortunately for me, there are a lot of ex-NHL players who retired to Florida. For a good four to five years, I had a man by the name of Ray Sheppard -- he played for the Panthers, played for the Red Wings a bit -- he was my coach for four or five years. He molded us to be little mini-pros. He took us to the best tournaments. He gave us the chance to play against the best hockey players our age. We didn't win a lot but it was just good to experience that, to get out there and play with the best.
Shayne Gostisbehere won the NCAA championship with Union College in 2014. Eric Hartline/USA TODAY Sports
Custance: What did Ray teach you to prepare you for this moment?
Gostisbehere: I would say just being a pro and realizing you can't get complacent. It can be taken from you any day. You have to work hard for anything you get no matter where you are, you can get noticed.
Custance: Man, that's great exposure to have a player of that caliber guide you at that age.
Gostisbehere: Yeah, we were a tremendously lucky little group there. We had some guys do great things from that team.
Custance: You're one of a few high-profile players in the Calder race, along with Jack Eichel and Dylan Larkin, who took the college path to the NHL. What did you learn at Union to prepare you for the next step?
Gostisbehere: College, it matures you in such a way that you're prepared for adulthood and the adult life. Even the pro life. At my school, I know the coaches don't only recruit for hockey skill, they recruit for character as well. A big thing on my team at Union and our success was how humble we were. We just took care of business on the ice, that's what we used as our talking, our play. That was just huge for us. That's what college teaches you. You realize you come from humble roots, you stick to those roots and remember what got you there.
Custance: Is it hard to stay humble when you're breaking every Flyers rookie defenseman record?
Gostisbehere: (Laughs) It's not hard for me. I've got a good support team, with my girlfriend and my family and even my teammates make sure my helmet still fits at the end of the day. They're good guys. I'm definitely not worried about it. You have to stay humble, stay within yourself and remember what got you here.
Custance: What's the worst butchering of your last name you've heard?
Gostisbehere: Oh, there's a bunch. I don't know. Something that ends with a Berry. That happens a lot. It's pretty bad.
Custance: You think the Ghost-Bear Twitter emoticons will help people? That seems to simplify things.
Gostisbehere: Yeah, there are some visual learners out there. That'll be pretty cool.
Custance: Have you seen the Flyers jersey that has the Ghost and Bear emoticon instead of the nameplate?
Gostisbehere: Yeah, I saw that yesterday. A couple of my buddies texted it to me. I had a good laugh. I thought it was hilarious.
Custance: Have you been able to take a moment to enjoy this ride in the middle of a pressure-filled playoff race?
Gostisbehere: Yeah, you take everything in stride here. The limelight is going to happen, it's all in how you deal with it. It's important just to remember where you came from, remember what got you here and never steer away from that.
|
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.harmony.luni.internal.locale;
public class Country_es extends java.util.ListResourceBundle {
protected Object[][] getContents() {
Object[][] contents = {
{"AE","Emiratos \u00c1rabes Unidos",},
{"AF","Afganist\u00e1n",},
{"AI","Anguila",},
{"AN","Antillas Holandesas",},
{"AZ","Azerbaiy\u00e1n",},
{"BA","Bosnia y Hercegovina",},
{"BE","B\u00e9lgica",},
{"BH","Bahr\u00e1in",},
{"BJ","Ben\u00edn",},
{"BM","Bermudas",},
{"BN","Brun\u00e9i",},
{"BR","Brasil",},
{"BT","But\u00e1n",},
{"BY","Bielorrusia",},
{"BZ","Belice",},
{"CA","Canad\u00e1",},
{"CF","Rep\u00fablica Centroafricana",},
{"CH","Suiza",},
{"CI","<NAME>",},
{"CM","Camer\u00fan",},
{"CS","Serbia y Montenegro",},
{"CV","Cabo Verde",},
{"CY","Chipre",},
{"CZ","Chequia",},
{"DE","Alemania",},
{"DK","Dinamarca",},
{"DO","Rep\u00fablica Dominicana",},
{"DZ","Argelia",},
{"EG","Egipto",},
{"EH","Sahara Occidental",},
{"ES","Espa\u00f1a",},
{"ET","Etiop\u00eda",},
{"FI","Finlandia",},
{"FR","Francia",},
{"GA","Gab\u00f3n",},
{"GB","Reino Unido",},
{"GF","Guayana Francesa",},
{"GP","Guadalupe",},
{"GQ","Guinea Ecuatorial",},
{"GR","Grecia",},
{"HR","Croacia",},
{"HT","Hait\u00ed",},
{"HU","Hungr\u00eda",},
{"IE","Irlanda",},
{"IR","Ir\u00e1n",},
{"IS","Islandia",},
{"IT","Italia",},
{"JO","Jordania",},
{"JP","Jap\u00f3n",},
{"KE","Kenia",},
{"KG","Kirguizist\u00e1n",},
{"KH","Camboya",},
{"KM","Comores",},
{"KP","Corea del Norte",},
{"KR","Corea del Sur",},
{"KZ","Kazajst\u00e1n",},
{"LB","L\u00edbano",},
{"LT","Lituania",},
{"LU","Luxemburgo",},
{"LV","Letonia",},
{"LY","Libia",},
{"MA","Marruecos",},
{"MC","M\u00f3naco",},
{"MD","Moldavia",},
{"ML","Mal\u00ed",},
{"MO","<NAME>.",},
{"MQ","Martinica",},
{"MU","Mauricio",},
{"MX","M\u00e9xico",},
{"MY","Malasia",},
{"NC","Nueva Caledonia",},
{"NE","N\u00edger",},
{"NL","Holanda",},
{"NO","Noruega",},
{"NZ","Nueva Zelanda",},
{"OM","Om\u00e1n",},
{"PA","Panam\u00e1",},
{"PE","Per\u00fa",},
{"PF","Polinesia Francesa",},
{"PG","Pap\u00faa New Guinea",},
{"PH","Filipinas",},
{"PK","Paquist\u00e1n",},
{"PL","Polonia",},
{"RO","Rumania",},
{"RU","Rusia",},
{"RW","Ruanda",},
{"SA","Arabia Saudita",},
{"SD","Sud\u00e1n",},
{"SE","Suecia",},
{"SG","Singapur",},
{"SI","Eslovenia",},
{"SK","Eslovaquia",},
{"SL","Sierra Leona",},
{"SR","Surinam",},
{"SY","Siria",},
{"SZ","Suazilandia",},
{"TF","Territorios Franceses del Sur",},
{"TH","Tailandia",},
{"TJ","Tayikist\u00e1n",},
{"TM","Turkmenist\u00e1n",},
{"TN","T\u00fanez",},
{"TP","Timor Oriental",},
{"TR","Turqu\u00eda",},
{"TT","Trinidad y Tobago",},
{"TW","Taiw\u00e1n",},
{"UA","Ucrania",},
{"US","Estados Unidos",},
{"UZ","Uzbekist\u00e1n",},
{"VA","Ciudad del Vaticano",},
{"VG","Islas V\u00edrgenes Brit\u00e1nicas",},
{"VI","Islas V\u00edrgenes Americanas",},
{"ZA","Sud\u00e1frica",},
};
return contents;
}
}
|
Emotion Analysis From Turkish Tweets Using Deep Neural Networks Text data analysis of social media is becoming more and more important since it includes the most recent information on what people think about. Likewise, emotion is one of the most valuable parts of human communication, emotion analysis is a type of information extraction process which identifies the emotional states of a given text. In this study, we investigated the performance of deep neural networks on emotion analysis from Turkish tweets. For this, we examined three different deep learning architectures including artificial neural network (ANN), convolutional neural network (CNN) and recurrent neural network (RNN) with long short-term memory (LSTM). Besides, we curated a dataset of Turkish tweets and annotated each tweet automatically for six emotion categories using a lexicon-based approach. For the evaluation, we conducted a set of experiments for each architecture. The results showed that the lexicon-based automatic annotation of tweets is valid. Secondly, ANN produced the worst result as expected, and CNN resulted in the highest score of 0.74 in terms of accuracy measure. Experiments also showed that our proposed approach for emotion analysis of tweets in Turkish performs better than state-of-the-art in this topic.
|
Implications of Bacteriuria in Myelomeningocele Patients at Time of Urodynamic Testing. Objective: To identify those myelomeningocele (MMC) patients at risk for post-urodynamic study (UDS) complications. We hypothesized that patients who manage their bladder with clean intermittent catheterization (CIC) would have a greater risk of post-instrumentation complications due to higher rates of bacteriuria compared to those who freely void (FV). Design/Methods: Urine was collected from patients with MMC without augmentation cystoplasty undergoing routine renal ultrasound or urodynamic study (UDS). Samples were divided into those with bacteriuria (urine culture ≥10,000 colony-forming units) and those without. Post-UDS complications were evaluated and compared between CIC and FV patients. Results: A total of 91 urine samples from 82 total MMC patients were included for evaluation. Significantly more patients on CIC than those who FV had bacteriuria (67% vs 33%, p =.0457). From these urine samples, 54 were obtained at time of UDS of which 45 were from patients on CIC and 9 from FV patients. More patients on CIC had bacteriuria at the time of UDS than those who FV (60% vs 33%, respectively), but this did not reach significance (p =.1416). No patient with bacteriuria on CIC had a complication after UDS while one FV patient with bacteriuria developed post-UDS pyelonephritis. Conclusion: MMC patients with bacteriuria on CIC did not have post-UDS complications. Patients with bacteriuria who FV may be at particular risk for post-instrumentation UTI, providing guidance as to which MMC patients should undergo urine testing prior to UDS in order to prevent post-instrumentation pyelonephritis.
|
THEORETICAL AND EXPERIMENTAL STUDIES OF METHODS OF THERMOCHEMICAL PROCESSING OF MUNICIPAL SOLID WASTES Thermodynamic analysis of thermochemical processing of MSW of Ukrainian origin is performed. The software TERRA was used for calculations, with the help of which the equilibrium indicators of the reaction products were calculated. It is shown that the accuracy of the calculation results is determined by the accuracy of the used value of the lower calorific value. Control calculations were performed for the following substances: pure carbon, glucose, cellulose, polyethylene. Thermodynamic analysis of the possibilities of thermochemical utilization was performed on the basis of studies of the composition of MSW obtained directly from landfills in Ukraine. It is shown that the adiabatic temperature significantly depends on the content of oxides ash components and their chemical composition. For experimental researches the laboratory installation was developed and constructed. Measurement of temperature, weight and composition of gas during researches was carried out by means of system on the basis of personal computer using the module of connection of territorial-distribution sensors I-7018 and I-7520 isolated module of a converter of communication channel SR-232/RS-485. For the first time, a combination of thermogravity analysis with a possibility of chromatographic control of a composition of the gas phase at all stages of heat treatment was proposed for studies of MSW heat treatment. For the first time, kinetic studies of wood gasification were performed using gravimetric analysis with simultaneous determination of the gas phase composition. Bibl. 14, Fig. 4, Tab. 2.
|
Last summer's peaceful mass demonstrations in Israel protested economic hardships resulting from excessive government interference in the economy.
The protests were ignited by Izhak Elrov, a young religious father who started a Facebook page calling for the boycott of one consumer item, cottage cheese, which was selling in Israel for double what it cost abroad. Mr. Elrov protested that price-gouging by Israeli monopolies had inflated the price of most consumer goods and services by 100% to 300% over average European and American prices. One hundred thousand Israelis "liked" his page. Hundreds picketed supermarkets.
Mr. Elrov's one-issue boycott eventually was taken over by populist groups demanding cheap housing and free preschool education, then it was seized upon by well-funded leftist political groups pushing an "Occupy Wall Street" anticapitalist agenda and trying to unseat Benjamin Netanyahu's pro-market government. By summer's end, the protests had fizzled, with many Israelis disenchanted by these hidden agendas.
But the core truth of Mr. Elrov's lament remained. Even before the cottage-cheese boycott, the prime minister had appointed a commission to deal with Israel's extraordinary concentration of political and economic power. The latter had become the center of public furor after an April 2010 Bank of Israel report affirmed that "some 20 family business groups, structured as pyramids, control some 25% of firms listed for trading, about half of the market share." The report also noted that a mere handful of business groups received over 60% of Israel's available credit, which they invested in highly leveraged and speculative real-estate ventures.
Clearly, such concentration creates great risk for Israeli financial markets. It also denies small and medium-size businesses access to credit, blocking Israel's engines of growth. Two major regions, the southern Negev and the northern Galilee, with mostly small businesses, have suffered a permanent credit crunch. Living on average monthly salaries of $2,400, according to official figures, and having to pay for most consumer goods and services at prices similar to those in New York City, most Israeli families have difficulty making ends meet.
Unfortunately, political necessity dictated that the commission Mr. Netanyahu charged to investigate these problems was composed partly of regulators who had failed in the past to tackle excessive concentration. One result is that its final recommendations, released last month, did not call for banning all pyramid-structured holding companies. The commission called for a separation of ownership between financial and nonfinancial firms. But it fixed too high a threshold—an annual turnover of $1.6 billion dollars—for the separation. Still, even these limited recommendations could improve Israeli credit allocation and competitiveness.
Following last summer's protests, Mr. Netanyahu appointed another commission, this one to deal with issues of preschool education, cheaper housing and lower consumer prices. As a result, "free" elementary school education was extended to children ages 3 to 6.
Mr. Netanyahu's government recently appointed a legal group to draft legislation based on the recommendations of "the anti-concentration" commission. But that group is composed mostly of the same regulators who are halfhearted about reform. And if the recommendations get to legislators, they will face a tough battle in the parliament, where the tycoons and their powerful lobbyists will fight them.
Strong vested interests blocking progress are not unique to Israel. Everywhere, powerful elites manage to erect entry barriers that cut competition, reduce efficiency and lower productivity. Generally impoverished Islamic countries are extreme examples of the ravages caused by such entrenched elites.
Mr. Netanyahu, Israel's first prime minister to understand economics, realized that economic viability is essential to Israel's survival and initiated bold reforms. He faces resistance from his bureaucracy and some coalition partners serving the tycoons and their lobbyists. Despite this and great challenges such as Iran and the prospect of new elections, Mr. Netanyahu could still convene a special session of parliament before the fall elections and pass the reforms he deems essential.
Mr. Doron is founder-director of The Israel Center for Social & Economic Progress (ICSEP), a public policy think tank, and a fellow of the Middle East Forum.
|
/**
* Show the user's previous submissions.
*
* @param context
* current context
* @param request
* current servlet request object
* @param response
* current servlet response object
*/
private void showPreviousSubmissions(Context context,
HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException, SQLException,
AuthorizeException
{
List<Item> subList = new LinkedList<Item>();
ItemIterator subs = Item.findBySubmitter(context, context
.getCurrentUser());
try
{
while (subs.hasNext())
{
subList.add(subs.next());
}
}
finally
{
if (subs != null)
{
subs.close();
}
}
Item[] items = new Item[subList.size()];
for (int i = 0; i < subList.size(); i++)
{
items[i] = subList.get(i);
}
log.info(LogManager.getHeader(context, "view_own_submissions", "count="
+ items.length));
request.setAttribute("user", context.getCurrentUser());
request.setAttribute("items", items);
JSPManager.showJSP(request, response, "/mydspace/own-submissions.jsp");
}
|
<gh_stars>1-10
// Copyright (C) 2012 <NAME>
// Copyright (C) 2012 <NAME>
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//! \addtogroup spop_min
//! @{
template<typename T1>
inline
void
spop_min::apply(SpMat<typename T1::elem_type>& out, const SpOp<T1,spop_min>& in)
{
arma_extra_debug_sigprint();
typedef typename T1::elem_type eT;
const uword dim = in.aux_uword_a;
arma_debug_check((dim > 1), "min(): incorrect usage. dim must be 0 or 1");
const SpProxy<T1> p(in.m);
if(p.is_alias(out) == false)
{
spop_min::apply_noalias(out, p, dim);
}
else
{
SpMat<eT> tmp;
spop_min::apply_noalias(tmp, p, dim);
out.steal_mem(tmp);
}
}
template<typename T1>
inline
void
spop_min::apply_noalias
(
SpMat<typename T1::elem_type>& result,
const SpProxy<T1>& p,
const uword dim,
const typename arma_not_cx<typename T1::elem_type>::result* junk
)
{
arma_extra_debug_sigprint();
arma_ignore(junk);
typedef typename T1::elem_type eT;
if(dim == 0)
{
// minimum in each column
result.set_size(1, p.get_n_cols());
if(p.get_n_nonzero() == 0)
{
return;
}
typename SpProxy<T1>::const_iterator_type it = p.begin();
uword cur_col = it.col();
uword elem_in_col = 1;
eT cur_min = (*it);
++it;
while(it != p.end())
{
if(it.col() != cur_col)
{
// was the column full?
if(elem_in_col == p.get_n_rows())
{
result.at(0, cur_col) = cur_min;
}
else
{
result.at(0, cur_col) = std::min(eT(0), cur_min);
}
cur_col = it.col();
elem_in_col = 0;
cur_min = (*it);
}
else
{
cur_min = std::min(cur_min, *it);
}
++elem_in_col;
++it;
}
if(elem_in_col == p.get_n_rows())
{
result.at(0, cur_col) = cur_min;
}
else
{
result.at(0, cur_col) = std::min(eT(0), cur_min);
}
}
else
{
// minimum in each row
result.set_size(p.get_n_rows(), 1);
if(p.get_n_nonzero() == 0)
{
return;
}
typename SpProxy<T1>::const_row_iterator_type it = p.begin_row();
uword cur_row = it.row();
uword elem_in_row = 1;
eT cur_min = (*it);
++it;
while(it.pos() < p.get_n_nonzero())
{
if(it.row() != cur_row)
{
// was the row full?
if(elem_in_row == p.get_n_cols())
{
result.at(cur_row, 0) = cur_min;
}
else
{
result.at(cur_row, 0) = std::min(eT(0), cur_min);
}
cur_row = it.row();
elem_in_row = 0;
cur_min = (*it);
}
else
{
cur_min = std::min(cur_min, *it);
}
++elem_in_row;
++it;
}
if(elem_in_row == p.get_n_cols())
{
result.at(cur_row, 0) = cur_min;
}
else
{
result.at(cur_row, 0) = std::min(eT(0), cur_min);
}
}
}
template<typename T1>
inline
void
spop_min::apply_noalias
(
SpMat<typename T1::elem_type>& result,
const SpProxy<T1>& p,
const uword dim,
const typename arma_cx_only<typename T1::elem_type>::result* junk
)
{
arma_extra_debug_sigprint();
arma_ignore(junk);
typedef typename T1::elem_type eT;
typedef typename get_pod_type<eT>::result T;
if(dim == 0)
{
// minimum in each column
result.set_size(1, p.get_n_cols());
if(p.get_n_nonzero() == 0)
{
return;
}
typename SpProxy<T1>::const_iterator_type it = p.begin();
uword cur_col = it.col();
uword elem_in_col = 1;
eT cur_min_orig = *it;
T cur_min_abs = std::abs(cur_min_orig);
++it;
while(it != p.end())
{
if(it.col() != cur_col)
{
// was the column full?
if(elem_in_col == p.get_n_rows())
{
result.at(0, cur_col) = cur_min_orig;
}
else
{
eT val1 = eT(0);
result.at(0, cur_col) = ( std::abs(val1) < cur_min_abs ) ? val1 : cur_min_orig;
}
cur_col = it.col();
elem_in_col = 0;
cur_min_orig = *it;
cur_min_abs = std::abs(cur_min_orig);
}
else
{
eT val1_orig = *it;
T val1_abs = std::abs(val1_orig);
if( val1_abs < cur_min_abs )
{
cur_min_abs = val1_abs;
cur_min_orig = val1_orig;
}
}
++elem_in_col;
++it;
}
if(elem_in_col == p.get_n_rows())
{
result.at(0, cur_col) = cur_min_orig;
}
else
{
eT val1 = eT(0);
result.at(0, cur_col) = ( std::abs(val1) < cur_min_abs ) ? val1 : cur_min_orig;
}
}
else
{
// minimum in each row
result.set_size(p.get_n_rows(), 1);
if(p.get_n_nonzero() == 0)
{
return;
}
typename SpProxy<T1>::const_row_iterator_type it = p.begin_row();
uword cur_row = it.row();
uword elem_in_row = 1;
eT cur_min_orig = *it;
T cur_min_abs = std::abs(cur_min_orig);
++it;
while(it.pos() < p.get_n_nonzero())
{
if(it.row() != cur_row)
{
// was the row full?
if(elem_in_row == p.get_n_cols())
{
result.at(cur_row, 0) = cur_min_orig;
}
else
{
eT val1 = eT(0);
result.at(cur_row, 0) = ( std::abs(val1) < cur_min_abs ) ? val1 : cur_min_orig;
}
cur_row = it.row();
elem_in_row = 0;
cur_min_orig = *it;
cur_min_abs = std::abs(cur_min_orig);
}
else
{
eT val1_orig = *it;
T val1_abs = std::abs(val1_orig);
if( val1_abs < cur_min_abs )
{
cur_min_abs = val1_abs;
cur_min_orig = val1_orig;
}
}
++elem_in_row;
++it;
}
if(elem_in_row == p.get_n_cols())
{
result.at(cur_row, 0) = cur_min_orig;
}
else
{
eT val1 = eT(0);
result.at(cur_row, 0) = ( std::abs(val1) < cur_min_abs ) ? val1 : cur_min_orig;
}
}
}
template<typename T1>
inline
typename T1::elem_type
spop_min::vector_min
(
const T1& x,
const typename arma_not_cx<typename T1::elem_type>::result* junk
)
{
arma_extra_debug_sigprint();
arma_ignore(junk);
typedef typename T1::elem_type eT;
const SpProxy<T1> p(x);
if(p.get_n_nonzero() == 0)
{
return eT(0);
}
if(SpProxy<T1>::must_use_iterator == false)
{
// direct access of values
if(p.get_n_nonzero() == p.get_n_elem())
{
return op_min::direct_min(p.get_values(), p.get_n_nonzero());
}
else
{
return std::min(eT(0), op_min::direct_min(p.get_values(), p.get_n_nonzero()));
}
}
else
{
// use iterator
typename SpProxy<T1>::const_iterator_type it = p.begin();
eT result = (*it);
++it;
while(it != p.end())
{
if((*it) < result)
{
result = (*it);
}
++it;
}
if(p.get_n_nonzero() == p.get_n_elem())
{
return result;
}
else
{
return std::min(eT(0), result);
}
}
}
template<typename T1>
inline
typename T1::elem_type
spop_min::vector_min
(
const T1& x,
const typename arma_cx_only<typename T1::elem_type>::result* junk
)
{
arma_extra_debug_sigprint();
arma_ignore(junk);
typedef typename T1::elem_type eT;
typedef typename get_pod_type<eT>::result T;
const SpProxy<T1> p(x);
if(p.get_n_nonzero() == 0)
{
return eT(0);
}
if(SpProxy<T1>::must_use_iterator == false)
{
// direct access of values
if(p.get_n_nonzero() == p.get_n_elem())
{
return op_min::direct_min(p.get_values(), p.get_n_nonzero());
}
else
{
const eT val1 = eT(0);
const eT val2 = op_min::direct_min(p.get_values(), p.get_n_nonzero());
return ( std::abs(val1) < std::abs(val2) ) ? val1 : val2;
}
}
else
{
// use iterator
typename SpProxy<T1>::const_iterator_type it = p.begin();
eT best_val_orig = *it;
T best_val_abs = std::abs(best_val_orig);
++it;
while(it != p.end())
{
eT val_orig = *it;
T val_abs = std::abs(val_orig);
if(val_abs < best_val_abs)
{
best_val_abs = val_abs;
best_val_orig = val_orig;
}
++it;
}
if(p.get_n_nonzero() == p.get_n_elem())
{
return best_val_orig;
}
else
{
const eT val1 = eT(0);
return ( std::abs(val1) < best_val_abs ) ? val1 : best_val_orig;
}
}
}
//! @}
|
from django.test import TestCase
from smartfields.dependencies import FileDependency
class MiscTestCase(TestCase):
def test_file_dependency(self):
self.assertEqual(
FileDependency(storage='foo', upload_to='somewhere', keep_orphans=True),
FileDependency(storage='foo', upload_to='somewhere', keep_orphans=True)
)
|
package br.com.sicredi.jobs;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.stereotype.Component;
/**
* Componente de envio e recebimento de mensagens jms
* Para fins de teste, esse componente envia e recebe a mensagem
* @author lucaskoch
*
*/
@Component
public class PollVoteJob {
@Autowired
private JmsTemplate jmsTemplate;
public void sendMessage(String message) {
jmsTemplate.convertAndSend("queue.poll", message);
}
@JmsListener(destination = "queue.poll")
public void onReceiverQueue(String message) {
System.out.println( "Recebendo mensagem : " + message );
}
}
|
DNA fingerprinting and electrophoretic karyotype of environmental and clinical isolates of Candida parapsilosis The endonuclease restriction pattern (DNA fingerprinting) and the electrophoretic karyotype of 16 Candida parapsilosis isolates from environmental and clinical sources were investigated. DNA from both whole cells and separated mitochondria was digested with enzymes, including EcoRI, BamHI, KpnI, BglII, HpaII, PvuII, and HindIII. Regardless of their source and pathogenic properties, all isolates showed a uniform, reproducible, and overlapping whole-cell DNA fingerprinting with each endonuclease digest. Mitochondrial DNA fragments were, in all cases, major contributors to the total cellular DNA restriction pattern. In contrast, the electrophoretic karyotype generated by rotating field gel electrophoresis (RFGE) or contour clamped homogeneous field electrophoresis (CHEF) showed a remarkable polymorphism among the isolates. This polymorphism concerned the smaller molecular size section of the karyotype (range, 1.8 to 0.7 Mb), where at least two to five chromosomal bands could be consistently detected by both RFGE and CHEF. Larger (greater than or equal to 3.0 to 1.9 Mb) chromosome-sized DNA bands (four in CHEF and three in RFGE) were quite distinct and common to all isolates. Thus, seven karyotype classes could be defined, on the basis of both the number and size of putative chromosomes. The three categories of isolates (soil, vaginal, and hematological) were not randomly distributed among the seven classes. In particular, the four hematological isolates had a karyotype pattern which was clearly distinct from that shown by the three environmental isolates, and of the nine vaginal isolates only one shared a class with isolates from another source (soil). Although tentative, the classification was totally consistent with the independent and reproducible results obtained by the two pulse-field electrophoretic techniques employed. It is suggested that the electrophoretic analysis of the karyotype might be particularly useful for epidemiological and pathogenicity studies on biotypes of C. parapsilosis.
|
"War on Christmas" and "holiday tree" redirect here. For the brief cessation of hostilities during World War I, see Christmas truce
Bezbozhnik, published by the [1] A 1931 edition of the Soviet magazine, published by the League of Militant Atheists , depicting an Orthodox Christian priest being forbidden to take home a tree for the celebration of Christmastide, which was banned under the Marxist–Leninist doctrine of state atheism
Christmas is the Christian celebration of the birth of Jesus Christ held annually on 25 December. Through its multi-century history, it has been the subject of several reformations, both religious and secular.
In the 17th century, the Puritans had laws forbidding the celebration of Christmas, unlike the Catholic Church or the Anglican Church, the latter from which they separated.[2] With the atheistic Cult of Reason in power during the era of Revolutionary France, Christian Christmas religious services were banned and the three kings cake was forcibly renamed the "equality cake" under anticlerical government policies.[3][4] Later, in the 20th century, Christmas celebrations were prohibited under the doctrine of state atheism in the Soviet Union.[5][6] In Nazi Germany, organized religion as a whole was attacked as an enemy of the state and Christmas celebrations corrupted so as to serve the Party's racist ideology.[7]
Modern-day controversy, often associated with use of the term "war on Christmas", occurs mainly in countries such as the United States,[8][9] Canada,[10][11] and to a much lesser extent the United Kingdom.[12] Some opponents have denounced the generic term "Holidays" and avoidance of using the term "Christmas" as being politically correct.[12][13][14] This often involves objections to government or corporate efforts to acknowledge Christmas in a way that is multiculturally sensitive.[15]
History [ edit ]
Christus Sol (Christ the Sun) in Mausoleum M in the third-century necropolis under [16] Mosaic of Jesus as(Christ the Sun) in Mausoleum M in the third-century necropolis under St Peter's Basilica in Rome.
Sextus Julius Africanus, a historian of the second century, maintained that Jesus of Nazareth was conceived on March 25, which the Christian Church came to celebrate as the Feast of the Annunciation.[17] With the term of a pregnancy being nine months, Sextus Julius Africanus held that Jesus was born on December 25, which the Western Christian Church established as Christmas.[17] Recorded in Sextus Julius Africanus's Chronographiai (AD 221), this thesis is corroborated by an interpretation of Gospel of Luke that places the appearance of Gabriel to Zechariah on the observance of Yom Kippur that occurs around October, as "the worshipers were praying outside of the Temple and not within" for "only the priest could enter the Temple at this time to conduct the proper rituals"; because Jesus was six months younger than his cousin John the Baptist, Jesus was conceived in March and born in late December.[18]
In AD 274, Emperor Aurelian made a festival for Sol Invictus ("The Unconquered Sun"), originally a Syrian deity who was later adopted as the chief deity of the Roman Empire.[19] While some writers believe that this may have influenced the Christian feast of Christmas, other historians such as Louis Duchesne, Hieronymus Engberding and Thomas Talley maintain that the Christian feast of Christmas was already being celebrated and that Aurelian established Dies Natalis Solis Invicti in order to compete with the Christian feast of Christmas.[19][20]
The Christian Council of Tours of 567 established Advent as the season of preparation for Christmas, as well as the season of Christmastide, declaring "the twelve days between Christmas and Epiphany to be one unified festal cycle", thus giving significance to both December 25 and January 6, a solution that would "coordinate the solar Julian calendar with the lunar calendars of its provinces in the east".[21][22][23]
In Christian belief, the teaching that God came into the world in the form of man to atone for the sins of humanity, rather than the exact birth date, is considered to be the primary purpose in celebrating Christmas; the exact date of the birth of Jesus of Nazareth is considered a non-issue.[24][25][26]
During the winter, the burning of logs was a common practice among many cultures across Northern Europe. In Scandinavia, this was known as the yule log and originally had a pagan significance; after the Christianization of Scandinavia, it may have been incorporated into the Christian celebration of Christmas there, with the pagan significance no longer remaining.[27] However, as there are no existing references to a Christmas log prior to the 16th century, the burning of the Christmas block may have been an early modern invention by Christians unrelated to the pagan practice.[28]
Many other Advent and Christmastide customs developed within the context of Christianity, such as the lighting of the Advent wreath (invented by Lutherans in the 16th century Germany),[29] the marking of an Advent calendar (first used by Lutherans in the 19th century),[30] the lighting of a Christingle (invented by Moravians in 19th century Britain),[31] and the viewing of a Nativity play (first enacted by Catholic monks in 11th century Italy).[32]
Puritan era [ edit ]
Prior to the Victorian era, Christmas in the United States was primarily a religious holiday observed by Christians of the Roman Catholic, Episcopalian, and Lutheran denominations. Its importance was often considered secondary to that of Epiphany and Easter.
The Puritans, on the other hand, objected to the Christian feast of Christmas,[33] during the English Interregnum, when England was ruled by a Puritan Parliament.[34] Puritans sought to remove elements they viewed as unbiblical, from their practice of Christianity, including those feasts established by the Anglican Church.[35] In 1647, the Puritan-led English Parliament banned the celebration of Christmas, replacing it with a day of fasting and considering it "a popish festival with no biblical justification", and a time of wasteful and immoral behaviour.[36] Protests followed as pro-Christmas rioting broke out in several cities and for weeks Canterbury was controlled by the rioters, who decorated doorways with holly and shouted royalist slogans.[37] The book The Vindication of Christmas (London, 1652) argued against the Puritans, and makes note of Old English Christmas traditions, dinner, roast apples on the fire, card playing, dances with "plow-boys" and "maidservants", old Father Christmas and carol singing.[38] The Restoration of King Charles II in 1660 ended the ban. Poor Robin's Almanack contained the lines: "Now thanks to God for Charles return, / Whose absence made old Christmas mourn. / For then we scarcely did it know, / Whether it Christmas were or no."[39] Many clergymen still disapproved of Christmas celebration. In Scotland, the Presbyterian Church of Scotland also discouraged observance of Christmas. James VI commanded its celebration in 1618, but attendance at church was scant.[40]
In Colonial America, the Pilgrims of New England disapproved of Christmas.[41] The Plymouth Pilgrims put their loathing for the day into practice in 1620 when they spent their first Christmas Day in the New World building their first structure in the New World – thus demonstrating their complete contempt for the day.[41] Non-Puritans in New England deplored the loss of the holidays enjoyed by the laboring classes in England.[42] Christmas observance was outlawed in Boston in 1659.[43][44][45] The ban by the Puritans was revoked in 1681 by an English appointed governor, Edmund Andros, however it was not until the mid-19th century that celebrating Christmas became fashionable in the Boston region.[46] By the Declaration of Independence in 1776, it was not widely celebrated in the US.[44]
19th century [ edit ]
With the appearance of the Oxford Movement in the Anglican Church, a revival in the traditional rituals and religious observances associated with Christmastide occurred.[47] This ushered in "the development of richer and more symbolic forms of worship, the building of neo-Gothic churches, and the revival and increasing centrality of the keeping of Christmas itself as a Christian festival" as well as "special charities for the poor" in addition to "special services and musical events".[48] Historian Ronald Hutton believes that the current state of observance of Christmas is largely the result of a mid-Victorian revival of the holiday, spearheaded by Charles Dickens, who "linked worship and feasting, within a context of social reconciliation".[49] Dickens was not the first author to celebrate Christmastide in literature, but it was he who superimposed his humanitarian vision of the holiday upon the public, an idea that has been termed as Dickens' "Carol Philosophy".[50]
Modern celebrations of Christmas include more commercial activity in comparison with those of the past.
Historian Stephen Nissenbaum contends that the modern celebration in the United States was developed in New York State from defunct and imagined Dutch and English traditions in order to refocus the holiday from one where groups of young men went from house to house demanding alcohol and food into one centered on the happiness of children. He notes that there was a deliberate effort to prevent children from becoming greedy in response.[51] Christmas was not proclaimed a holiday by the United States Congress until 1870.[44]
20th century [ edit ]
In the early 20th century, Christian writers such as C. S. Lewis noted what he saw as a distinct split between the religious and commercialized observance of Christmas, the latter of which he deplored.[52] In Xmas and Christmas: A Lost Chapter from Herodotus, Lewis gives a satire of the observance of two simultaneous holidays in "Niatirb" ("Britain" spelled backwards) from the supposed view of the ancient Greek historian Herodotus (484–425 BC). One of the holidays, "Exmas", is observed by a flurry of compulsory commercial activity and expensive indulgence in alcoholic beverages. The other, "Crissmas", is observed in Niatirb's temples. Lewis's narrator asks a priest why they kept Crissmas on the same day as Exmas. He receives the reply:
"It is not lawful, O Stranger, for us to change the date of Crissmas, but would that Zeus would put it into the minds of the Niatirbians to keep Exmas at some other time or not to keep it at all. For Exmas and the Rush distract the minds even of the few from sacred things. And we indeed are glad that men should make merry at Crissmas; but in Exmas there is no merriment left." And when I asked him why they endured the Rush, he replied, "It is, O Stranger, a racket..."[53]
The Soviet Union (until 1936), and certain other Communist regimes, banned overtly religious Christmas observances in accordance with the Marxist–Leninist doctrine of state atheism.[1] In 1920s USSR, the League of Militant Atheists encouraged school pupils to campaign against Christmas traditions, such as the Christmas tree, and encouraged them to spit on crucifixes as protest against this holiday; the League established an antireligious holiday to be the 31st of each month as a replacement.[54][55]
Most customs traditionally associated with Christmas, such as decorated trees, presents, and Ded Moroz (Father Frost), were later reinstated in Soviet society, but tied to New Year's Day instead; this tradition remains as of the present day.[56] It should, however, be noted that most Russian Christians are of the Orthodox community, whose religious festivals (Christmas, Easter etc.) do not necessarily coincide precisely with those of the main western Christian churches (Catholic or Protestant), because of continued connection of the church calendar to the Julian calendar.
Likewise, in Nazi Germany, "because Nazi ideologues saw organized religion as an enemy of the totalitarian state, propagandists sought to deemphasize—or eliminate altogether—the Christian aspects of the holiday" and as a result "propagandists tirelessly promoted numerous Nazified Christmas songs, which replaced Christian themes with the regime's racial ideologies."[7]
Present-day controversy [ edit ]
United States [ edit ]
The expression "the War on Christmas" has been used in the media to denote Christmas-related controversies.[57] The term gained notability due in part to its use by conservative commentators such as Peter Brimelow and Bill O'Reilly beginning in the early 2000s.[58][59][60]
The claim of Brimelow, O'Reilly and others was that any specific mention of the term "Christmas" or its religious aspects was being increasingly censored, avoided, or discouraged by a number of advertisers, retailers, government (prominently schools), and other public and secular organizations. In the United States and Canada, where the use of the term "Holidays" is most prevalent, opponents have denounced its usage and avoidance of using the term "Christmas" as being politically correct.[12][13][14]
Jeff Schweitzer, a commentator for The Huffington Post, addressed the position of commentators such as O'Reilly, stating that "There is no war on Christmas; the idea is absurd at every level. Those who object to being forced to celebrate another's religion are drowning in Christmas in a sea of Christianity dominating all aspects of social life. An 80 percent majority can claim victimhood only with an extraordinary flight from reality."[61]
Heather Long, an American columnist for The Guardian, addressed the "politically correct" question in America over use of the term "holidays", writing, "people who are clearly celebrating Christmas in their homes tend to be conflicted about what to say in the workplace or at school. No one wants to offend anyone or make assumptions about people's religious beliefs, especially at work."[12]
Christmas Day is recognized as an official federal holiday by the United States government.[62] The American Civil Liberties Union argues that government-funded displays of Christmas imagery and traditions violate the U.S. Constitution—specifically the First Amendment, which prohibits the establishment by Congress of a national religion; on the other hand the Alliance Defending Freedom, an organization promoting the principle of religious freedom, believes that Christmas displays are consistent with the First Amendment, as well as court rulings that have repeatedly upheld accommodationism.[63] The debate over whether religious displays should be placed within public schools, courthouses, and other government buildings has been heated in recent years.[64]
In some cases, popular aspects of Christmas, such as Christmas trees, lights, and decorating are still prominently showcased, but are associated with unspecified "holidays" rather than with Christmas.[13] The controversy also includes objections to policies that prohibit government or schools from forcing unwilling participants to take part in Christmas ceremonies. In other cases, the Christmas tree,[65] as well as Nativity scenes, have not been permitted to be displayed in public settings altogether.[66] Also, several US chain retailers, such as Walmart, Macy's, and Sears, have experimented with greeting their customers with "Happy Holidays" or "Season's Greetings" rather than with "Merry Christmas".[67][68]
Supreme Court rulings, starting with Lynch v. Donnelly in 1984, have permitted religious themes in government-funded Christmas displays that had "legitimate secular purposes". Since these rulings have been splintered and have left governments uncertain of their limits, many such displays have included secular elements such as reindeer, snowmen and elves along with the religious elements.[69] Other recent court cases have brought up additional issues such as the inclusion of Christmas carols in public school performances, but none of these cases have reached the Supreme Court of the United States.
A controversy regarding these issues arose in 2002, when the New York City public school system banned the display of Nativity scenes but allowed the display of less overtly religious symbols such as Christmas trees, Hanukkah menorahs, and the Muslim star and crescent.[70] The school system successfully defended its policy in Skoros v. City of New York (2006).[71]
Retailer controversies [ edit ]
Since at least 2005, religious conservative groups and media in the United States, such as the American Family Association (AFA) and Liberty Counsel, have called for boycotts of various prominent secular organizations, particularly retail giants, demanding that they use the term "Christmas" rather, than solely "holiday" in their print, TV, online, and in-store marketing and advertising. This was also seen by some as containing a hidden anti-Jewish message. All of the major retailers named denied the charges.[72][73]
2000s [ edit ]
The Sears Holdings Corporation (which owns Sears and Kmart) altered their marketing policies from using the term "holiday" to using the term "Christmas". The change of policy included the distribution of "Merry Christmas" signs to stores nationwide, and the changing of the term "holiday" to "Christmas" on their website and in stores. [74] [75]
In 2005, Walmart was criticized by the Catholic League for avoiding the word "Christmas" in any of their marketing efforts. [9] The company had downplayed the term "Christmas" in much of its advertising for several years. [76] This caused some backlash among the public, prompting some groups to pass around petitions and threaten boycotts against the company, as well as several other prominent retailers that practiced similar obscurations of the holiday. [9] In 2006, in response to the public outcry, Wal-Mart announced that they were amending their policy and would be using "Christmas" rather than "holiday". Among the changes, they noted that the former "Holiday Shop" would become the "Christmas Shop", and that there would be a "countin' down the days to Christmas" feature. [9]
The company had downplayed the term "Christmas" in much of its advertising for several years. This caused some backlash among the public, prompting some groups to pass around petitions and threaten boycotts against the company, as well as several other prominent retailers that practiced similar obscurations of the holiday. In 2006, in response to the public outcry, Wal-Mart announced that they were amending their policy and would be using "Christmas" rather than "holiday". Among the changes, they noted that the former "Holiday Shop" would become the "Christmas Shop", and that there would be a "countin' down the days to Christmas" feature. In 2005, Target Corporation was criticized by the American Family Association for their decision not to use the term "Christmas" in any of their in-store, online, or print advertising. [77] The AFA initiated a nationwide boycott of the Target Corporation, resulting in over 700,000 petition signatures. Within a week of initiating the boycott, the AFA received an official letter from Target which indicated that they would begin incorporating the term "Christmas" in their advertising: "Over the course of the next few weeks, our advertising, marketing and merchandising will become more specific to the holiday that is approaching—referring directly to holidays like Christmas and Hanukkah. For example, you will see reference to Christmas in select television commercials, circulars and in-store signage." [78]
The AFA initiated a nationwide boycott of the Target Corporation, resulting in over 700,000 petition signatures. Within a week of initiating the boycott, the AFA received an official letter from Target which indicated that they would begin incorporating the term "Christmas" in their advertising: "Over the course of the next few weeks, our advertising, marketing and merchandising will become more specific to the holiday that is approaching—referring directly to holidays like Christmas and Hanukkah. For example, you will see reference to Christmas in select television commercials, circulars and in-store signage." When it was revealed in November 2006 that Wal-Mart would be using the term "Christmas" in their advertising campaign, an article about the issue initiated by USA Today pointed out that Best Buy Corporation would be among the retailers that would not be using "Christmas" at all in their advertising that year. Dawn Bryant, a Best Buy spokeswoman, stated: "We are going to continue to use the term holiday because there are several holidays throughout that time period, and we certainly need to be respectful of all of them." [79] [80] The AFA launched a campaign against Best Buy's policy. [81] In reaction to the same policy, the Catholic League placed Best Buy on its 2006 Christmas Watch List. [82]
pointed out that Best Buy Corporation would be among the retailers that would not be using "Christmas" at all in their advertising that year. Dawn Bryant, a Best Buy spokeswoman, stated: "We are going to continue to use the term holiday because there are several holidays throughout that time period, and we certainly need to be respectful of all of them." The AFA launched a campaign against Best Buy's policy. In reaction to the same policy, the Catholic League placed Best Buy on its 2006 Christmas Watch List. In late October 2008, U.S. hardware retailer The Home Depot was criticized by the AFA for using terms such as "holiday" and "Hanukkah" on their website, but avoiding the term "Christmas". [83] The retailer responded by saying they will be adjusting their website to make references to Christmas more prominent. [84] Snopes.com later stated that the AFA's characterization of Home Depot's advertising was false, as the retailer's advertising had initially included several instances of the word "Christmas". [85]
The retailer responded by saying they will be adjusting their website to make references to Christmas more prominent. Snopes.com later stated that the AFA's characterization of Home Depot's advertising was false, as the retailer's advertising had initially included several instances of the word "Christmas". On 11 November 2009, the AFA called for a "limited two-month boycott" of Gap, Inc over what they claimed was the "company's censorship of the word 'Christmas.'"[86] In an advertising campaign launched by Gap on 12 November, the term "Christmas" was both spoken and printed on their website at least once, and a television ad entitled "Go Ho Ho" featured lyrics such as "Go Christmas, Go Hanukkah, Go Kwanzaa, Go Solstice" and "whatever holiday you Wanna-kah".[87] On 17 November, AFA responded to this campaign by condemning the ads for references to the "pagan holiday" of solstice, and declined to call off the boycott.[88] On 24 November, the AFA ended the boycott, after learning from Gap's corporate vice president of communications that the company planned to launch a new commercial with a "very strong Christmas theme".[89]
2010s [ edit ]
Canada [ edit ]
In 2007, a controversy arose[10] when a public school in Ottawa, Ontario, planned to have the children in its primary choir sing a version of the song "Silver Bells" with the word "Christmas" replaced by "festive"; the concert also included the songs "Candles of Christmas" and "It's Christmas" with the original lyrics. In 2011, in Embrun, Ontario, near Ottawa, some parents were displeased when a school replaced the Christmas concert it had held in previous years with a craft sale and winter concert scheduled for February.[100]
United Kingdom [ edit ]
In the United Kingdom there have been some controversies, one of the most famous being the temporary promotion of the phrase Winterval for a whole season of events (including Christmas festivities) by Birmingham City Council in the late 1990s. This remains a controversial example of "Christmas controversy", with critics attacking the use of the word "Winterval" as being political correctness gone mad, accusing council officials of trying to take the Christ out of Christmas.[101] The council responded to the criticism by stating that Christmas-related words and symbols were prominent in its publicity material: "...there was a banner saying Merry Christmas across the front of the council house, Christmas lights, Christmas trees in the main civil squares, regular carol-singing sessions by school choirs, and the Lord Mayor sent a Christmas card with a traditional Christmas scene wishing everyone a Merry Christmas"...[102]
In November 2009 the city council of Dundee was accused of banning Christmas because it promoted its celebrations as the Winter Night Light festival, initially with no specific references to Christianity. Local church leaders were invited to participate in the event, and they did.[103]
Due to the changing religious landscape of the UK, Christmas cards featuring religious imagery, such as the Nativity scene or the Virgin and Child, have become less common in major retailers. However, they are still readily available from smaller shops, or those linked to church groups and charities. The Church of England complained in 2004 when religious images were removed from the annual tradition of special postage stamps around Christmas.[104]
South Africa [ edit ]
The Christian holidays of Christmas Day and Good Friday remained in secular post-apartheid South Africa's calendar of public holidays. The Commission for the Promotion and Protection of the Rights of Cultural, Religious and Linguistic Communities (CRL Rights Commission), a chapter nine institution established in 2004, held countrywide consultative public hearings in June and July 2012 to assess the need for a review of public holidays following the receipt of complaints from minority groups about unfair discrimination. The CRL Rights Commission stated that they would submit their recommendations to the Department of Home Affairs, the Department of Labour, various Portfolio Committees and the Office of the Presidency by October 2012.[105][106][107] The CRL Rights Commission published its recommendations on 17 April 2013, including the scrapping of some existing public holidays to free up days for some non-Christian religious public holidays.[108][109]
Norway [ edit ]
The common practice of schoolchildren visiting local churches for Christmas services in December is opposed by the Norwegian Humanist Association, the Children's Ombudsman and by the Union of Education.[110] There have been several local controversies over the issue. The political parties have mostly been in favor of this being decided by the schools themselves, but the government has underlined that schools who participate in Christmas services must offer an alternative for pupils who don't want to attend and that services must not take place on the day that marks the closing of schools before the Christmas holiday. The Solberg's Cabinet says in its government declaration that it looks positively upon schools taking part in services in churches before religious holidays.[111]
According to a 2013 poll by Norstat for Vårt Land, 68% of Norwegians support having school-arranged Christmas services while 14% are opposed. 17% do not hold any opinion on the issue.[110]
Sweden [ edit ]
A school law in 2011, which explicitly stated that public schools should be non-confessional, led to debate over what this meant for the tradition that schools gather in churches in December to celebrate Advent, Lucia or Christmas. 80,000 Swedes signed a 2012 protest letter (Adventsuppropet) initiated by the newspaper Dagen to Minister for Education Jan Björklund, in which they demanded that school visits to churches should still be allowed to include religious rituals.[112] The minister clarified that church visits before Christmas might include singing of Christmas hymns and a priest talking about the Christmas gospel while on the other side common prayers and reading a Confession of Faith would violate the law.[113]
In 2012, Sveriges Radio reported that about one in six schools had changed the way they mark Christmas traditions as a result of the new law.[114]
Christmas tree [ edit ]
In 2007, U.S. hardware store chain Lowe's published a catalog that accidentally referred to Christmas trees as "Family trees"
Since the 1980s,[115] there have been several instances in both the United States and Canada when official public mentions and references to what are commonly called Christmas trees were referred to as "holiday trees". Reaction to such nomenclature has been mixed.
One of the most prominent Christmas tree controversies came in 2005, when the city of Boston labeled their official decorated tree as a holiday tree, and the subsequent response from the Nova Scotian tree farmer who donated the tree was that he would rather have put the tree in a wood chipper than have it named a "holiday" tree.[8]
In 2009 in West Jerusalem, the Lobby for Jewish Values, with support of the Jerusalem Rabbinate, handed out fliers condemning Christmas and called for a boycott of "restaurants and hotels that sell or put up Christmas trees and other 'foolish' Christian symbols".[116]
The Brussels Christmas tree in the Belgian capital sparked controversy in December 2012, as it was part of renaming the Christmas Market as "Winter Pleasures".[117] Local opposition saw it as appeasement of the Muslim minority in the city.[118]
Resurgence of "Christmas tree" [ edit ]
Efforts have also been made to rename official public holiday trees as "Christmas trees". In 2002, a bill was introduced in the California Senate to rename the State Holiday Tree the California State Christmas Tree;[119] while this measure did not pass, at the official lighting of the tree on 4 December 2007, California Governor Arnold Schwarzenegger referred to the tree as a Christmas tree in his remarks and in the press release his office issued after the ceremony.[120] Schwarzenegger had previously ended the secular practice of calling it a "holiday tree" in 2004 during the 73rd annual lighting. The name change was in honor of the late Senator William "Pete" Knight. Schwarzenegger said at Knight's funeral that he would change the name back to Christmas tree. Knight had lobbied unsuccessfully to change the name after Governor Davis decided to call it a holiday tree.[121]
The Michigan Senate had a debate in 2005 over whether the decorated tree in front of the Michigan Capitol would continue to be called a holiday tree (as it had been since the early 1990s) or named a Christmas tree. The question was revisited in 2006, when the bipartisan Michigan Capitol Committee voted unanimously to use the term Christmas tree.[122] And in 2007, Wisconsin lawmakers considered whether to rename the tree in the Wisconsin Capitol rotunda, a holiday tree since 1985, the Wisconsin State Christmas Tree.[123]
Rejection among certain groups [ edit ]
Atheism [ edit ]
Under the state atheism of the former Eastern Bloc, Christmas was banned, along with other Christian holidays.[124] The League of Militant Atheists organized alternate festivals "specifically to denigrate religious holidays" in the USSR.[124] In the United States, some atheists may choose to celebrate Christmas fully, while others celebrate only portions of the holiday, and others reject it completely.[125] Some atheist groups who oppose the celebration of Christmas have established alternate celebrations to the Christian observance of Christmas, such as HumanLight.[125] In China, which is officially an atheist state, some officials in 2018 raided Christian churches just prior to Christmas and forced them to close.[126][127][128]
Islam [ edit ]
The celebration of Christmas has occasionally been criticized by Muslims in Turkey. Turkey has adopted a secular version of Christmas and a Santa Claus figure named Noel Baba (from the French Père Noël). During the 2013 holiday season, a Muslim youth group launched an anti-Santa Claus campaign, protesting against the celebration of Christmas in the country.[129] In December 2015, political and religious activists organized protests against the growing influence of Christmas and Santa Claus in Turkish society.[130]
Restorationist Movement [ edit ]
Some Churches, sects, and communities of the Restoration Movement reject the observance of Christmas for theological reasons; these include Jehovah's Witnesses,[131] Armstrongites,[132] the True Jesus Church, Church of God (7th-Day), the Iglesia ni Cristo, the Christian Congregation in Brazil, the Christian Congregation in the United States, the Churches of Christ, as well as certain reformed and fundamentalist churches of various persuasions, including some Independent Baptists[133] and Oneness Pentecostals.[134][135][136][137][138]
Xmas [ edit ]
The December 1957 News and Views published by the Church League of America, a conservative organization co-founded in 1937 by George Washington Robnett,[139] attacked the use of Xmas in an article titled "X=The Unknown Quantity". The claims were picked up later by Gerald L. K. Smith, who in December 1966 claimed that Xmas was a "blasphemous omission of the name of Christ" and that "'X' is referred to as being symbolical of the unknown quantity." Smith further argued that Jews introduced Santa Claus to suppress the New Testament accounts of Jesus, and that the United Nations, at the behest of "world Jewry", had "outlawed the name of Christ".[140] There is, however, a well documented history of use of Χ (actually a chi) as an abbreviation for "Christ" (Χριστός) and possibly also a symbol of the cross.[141][142] The abbreviation appears on many Orthodox Christian religious icons.
See also [ edit ]
References [ edit ]
|
/**
* Executes the specified update using a connection from the connection pool.
*
* @return the number of rows affected
* @throws ServiceException if the update cannot be executed
*/
public static int executeUpdate(String sql, Object param)
throws ServiceException {
Object[] params = { param };
return executeUpdate(sql, params);
}
|
Joris-Jan van‘t Land has been going through a lot recently. Between the imprisonment of Bohemia Interactive devs in Greece and the closed beta for the upcoming ARMA 3, he’s been a busy man. van’t Land is the Project Lead on the upcoming military first person shooter and we had a chance to chat with him about a few things. In particular, about the PC market, its rise over the past few years and about the success of ARMA 3.
van’t Land responded, stating that, “We certainly hope to be releasing a game and platform that, just like Arma 2, can survive, grow, evolve and expand over the next couple of years. It will be interesting to see how the next cycle of consoles affects things, but generally we don’t believe they will offer some of the things that make the PC so appealing for many: flexibility, tinkering, modding and customization.
“It is also a difficult market. We have to constantly re-evaluate our business models and tackle challenges intelligently, so we can survive, adapt, win.
“It will be interesting to see how the next cycle of consoles affects things, but generally we don’t believe they will offer some of the things that make the PC so appealing ”
Some strong opinions, especially concerning the upcoming PS4 and Xbox 720 consoles. But then, given NVidia’s comments on the matter about how the upcoming consoles will be outdated by the time they release and how PCs are continuously evolving, not to mention the modding community being non-existent on consoles, van’t Land has a point.
ARMA 3 is currently set to release for PC in Q3 of 2013.
|
/**
* This method extracts metadata from the XDS classification element given the slotname of the metadata item.
*
* @param classifications A list of classifications to search through.
* @param classificationSchemeUUID The classification scheme idendifier to search for.
* @param slotName The name of the metadata item within the classification element.
* @param valueIndex In case there are multiple values for the metadata item, the option to choose a single value or
* all values (i.e. -1).
* @return Returns the value of the metadata item found in the XDS classification element given the slotname.
*/
private String extractClassificationMetadata(
List<oasis.names.tc.ebxml_regrep.xsd.rim._3.ClassificationType> classifications,
String classificationSchemeUUID, String slotName, int valueIndex) {
String classificationValue = null;
for (oasis.names.tc.ebxml_regrep.xsd.rim._3.ClassificationType classification : classifications) {
String classificationSchemeName = classification.getClassificationScheme();
if (classificationSchemeUUID.equals(classificationSchemeName)) {
classificationValue = extractMetadataFromSlots(classification.getSlot(), slotName, valueIndex);
break;
}
}
return classificationValue;
}
|
Metal-dependent self-assembly of a microbial surfactant. Small-angle neutron scattering (SANS), cryogenic transmission electron microscopy (cryo-TEM), and dynamic light scattering (DLS) were used to study the metal-dependent phase behavior of microbially produced surfactants-marinobactins B, D, and E (MB, MD, and ME). Marinobactins A-E are siderophores that facilitate Fe(III) acquisition by the source bacterium through the coordination of Fe(III) by the peptidic headgroup. All of the marinobactins have the same six amino acid headgroup but differ in the length and saturation of the monoalkyl fatty acid tail. Fe(III) coordinated to ME (Fe(III)-ME) was found to form micelles with a diameter of approximately 3.5 nm that underwent a supramolecular transformation to produce a monodisperse population of vesicles with an average diameter ranging from approximately 90 to 190 nm upon addition of Cd(II), Zn(II), or La(III). SANS profiles of the transition-metal-induced phase exhibit a Bragg peak at QB approximately 0.11-0.12 A-1 and were fit to a SANS model for multilamellar vesicles that have an interbilayer repeat distance of 2pi/QB approximately 5.6-5.0 nm. Cryo-TEM images of the Zn(II)-induced phase reveals the presence of approximately 100 nm diameter approximately spherical aggregates of uniform electron density. The temperature dependence of the Zn(II)-induced transformation was also investigated as a function of the length and degree of unsaturation of the Fe(III)-marinobactin fatty acid tail. The Cd(II)-, Zn(II)-, and La(III)-induced phase changes have features that are similar to those of the previously reported Fe(III)-induced micelle-to-vesicle transition, and this observation has opened questions regarding the role that Cd(II) and Zn(II) may play in bacterial iron uptake.
|
Meta self-description and self-psychologism as meta-poetic principles of A. I. Solzhenitsyn The autobiographical character of Solzhenitsyns oeuvre, inseparable nature of ethical and aesthetic views, have shaped the authors unique aesthetics. From the point of view of the author of this article, eliciting the meta-poetic principles defines the way of comprehension of Solzhenitsyns artistic world, of his phenomenon. The article presents the analysis of two of Solzhenitsyns significant meta-poetic principles: self-meta-description and self-psychologism. The research is based on Diary R-17 which should be introduced into the readers and researchers circulation as an important key to understanding Solzhenitsyns artistic method. An insight into the French edition of the Diary has allowed the author of this article to trace the stages of working on The Red Wheel, and to regard Solzhenitsyns creative laboratory as a whole. At the same time the diary records broaden the readers understanding not only of the ways of creating a historical novel, but of the writers biography, of his reading range and literary context, of his predecessors in the genre of historical narrative, of the writers techniques and methods. The article turns the spotlight on the fact that Solzhenitsyn does not bestow his biography on characters close to him, he imparts to them the train of his thoughts, the capacity for Tolstoys soul dialectics, making them the authors self-psychological counterparts. This article is a part of a substantial research of Solzhenitsyns system of meta-poetic principles, including the world vision on the functions and the responsibility of the artist and the art to the world; on the judgement on the creative work of other authors. The author of the article has an objective to understand the writers aesthetics, that was formed under the influence of a vital aspiration to record the history of the Russian revolution, to tell the hidden truth about the history of Russia.
|
In manufacturing semiconductor devices, resist patterns have been required to be made minute enough to meet increased integration density and highly accelerated processing speed in LSIs. Resist patterns are normally formed in photo-lithographic processes from, for example, positive-working type resists, whose solubility to alkaline developers are increased by exposure to light. Accordingly, the resists in the areas exposed to light are removed away with the alkaline developers to form positive resist patterns. However, the fineness of the resultant patterns greatly depends on the exposure methods and light sources, and hence in order to stably produce fine resist patterns, a huge investment is necessary to install special and expensive facilities and equipment needed for the exposure methods and light sources capable of ensuring the fineness.
In view of that, there are various techniques studied for further miniaturizing resist patterns formed beforehand by conventional methods. For example, they include a practical method in which a resist pattern stably produced by a conventional method is coated with a composition comprising a water-soluble resin and optional additives so as to fatten or thicken the resist pattern and thereby to reduce the diameter of holes and/or the width of furrow lines separating the ridges in the pattern.
The composition containing a polymer comprising a repeating unit with nitrogen is known to interact with residual acid in the resist pattern to fatten the resist pattern and to form a desired fine space pattern (US 2006/0088788 A1, Japanese Patent Application Laid Open (JP-A) No. 2013-83818). Furthermore, a nitrogen heteroaromatic ring unit in the polymer of the composition is known to improve a dry etching resistance of the resist pattern (Japanese Patent Application Laid Open (JP-A) No. 2003-84457).
However, the composition of aqueous solution has an issue on coatability. Surfactant is inevitable for the composition to come into use. Moreover, the type of chemical agents that can be linked to a coater/developer track to be used in semiconductor process at present is limited to resist materials and rinse solutions, and it is very difficult to set up a new process line for a new chemical agent. In the conventional semiconductor process, it is not based on the assumption that an aqueous solution material is applied over a surface of a resist pattern, and thus it is also difficult to use such an aqueous solution material because of the necessity of a new control for waste fluid.
With the use of an organic solvent composition using novolac resin or p-hydroxystyrene-styrene copolymer described in Japanese Patent Application Laid Open (JP-A) No. 2013-145290, it has been known that the use of the organic solvent composition is not sufficient in thickening a negative-tone resist pattern.
|
Impact Angle Constrained Three-Dimensional Integrated Guidance and Control Based on Fractional Integral Terminal Sliding Mode Control In this paper, considering a class of skid-to-turn (STT) missile with impact angle constraint to intercept the maneuvering target, a three-dimensional integrated guidance and control law based on the fractional integral terminal sliding mode control (FITSMC) scheme is proposed. Firstly, a three-dimensional integrated guidance and control model is established for missile-target relative motion and nonlinear missile dynamics with multiple system uncertainties and unknown disturbances. Secondly, in order to achieve the desired impact angle in finite-time without singularity, a novel nonsingular FITSMC scheme is employed to construct the sliding surface, and a modified filter is applied to dynamic surface control design. Also, an extended state observer is introduced to estimate and compensate the system uncertainties and unknown disturbances. Then, a robust integrated guidance and control scheme with impact angle constraint is developed using aforementioned techniques. Furthermore, the finite-time stability of the closed-loop system is proven based on Lyapunov theory. Finally, the effectiveness and robustness of the proposed integrated guidance and control algorithm are verified through numerical simulations.
|
. It is reported on alterations of ECG and blood pressure appearing in 51 patients during endoscopic examination of the stomach. Above all, these alterations consisted of repolarisation disturbances with a partial preterminal negative T and isolated supraventricular extrasystoles. Atrioventricular blocks or spreading of the QRS-complex were not observed. In all patients a distinct increase in frequency was present while the endoscope was introduced. Since regression of all these alterations would occur after examination, a vegetative-functional stimulus might be the inducing factor. In endoscopic examinations the risk of any incidents appearing in connection with the system of coronary circulation is minimal. In patients with considerable previous damage of the heart caution is advised.
|
/* ----------------------------------------------------------------------------
* Copyright (c) Huawei Technologies Co., Ltd. 2021-2021. All rights reserved.
* Description: Openssl Demo Implementation
* Author: Huawei LiteOS Team
* Create: 2021-03-10
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
* to endorse or promote products derived from this software without specific prior written
* permission.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* --------------------------------------------------------------------------- */
#include "openssl_demo.h"
#include "stdio.h"
#include "stdlib.h"
#include "los_base.h"
#include "los_task.h"
#include "los_config.h"
#include "los_typedef.h"
#include "openssl/md5.h"
#include "openssl/des.h"
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif /* __cplusplus */
#endif /* __cplusplus */
#define OPENSSL_TASK_PRIORITY 6
#define OPENSSL_TASK_STACK_SIZE 0x2000
#define MD5_ENCRYDATA "MD5 test for liteos"
#define MD5_OUTLEN 16
#define DESCBC_ENCRYDATA "DES-CBC test for liteos"
#define DESCBC_DATALEN 23
#define SECTION_SIZE 8
STATIC UINT32 g_demoTaskId;
VOID MD5_Demo(VOID)
{
UINT32 i;
MD5_CTX md;
UINT8 strOut[MD5_OUTLEN];
(VOID)MD5_Init(&md);
(VOID)MD5_Update(&md, MD5_ENCRYDATA, strlen(MD5_ENCRYDATA));
(VOID)MD5_Final(strOut, &md);
printf("Data:%s\nEncrypt:", MD5_ENCRYDATA);
for (i = 0; i < MD5_OUTLEN; i++) {
printf("%02X", strOut[i]);
}
}
STATIC INT32 DES_CBC_Demo(VOID)
{
INT32 i;
INT32 ret;
INT32 len;
INT32 strKey = {0};
DES_key_schedule ks;
UINT8 src[] = DESCBC_ENCRYDATA;
DES_cblock ivec;
ret = memset_s(ivec, sizeof(ivec), 0, sizeof(ivec));
if (ret != EOK) {
return ret;
}
DES_set_key_unchecked((const_DES_cblock*)strKey, &ks);
len = (DESCBC_DATALEN / SECTION_SIZE + (DESCBC_DATALEN % SECTION_SIZE ? 1 : 0)) * SECTION_SIZE;
UINT8 dst[len];
(void)memset_s(dst, sizeof(dst), 0, sizeof(dst));
DES_cbc_encrypt(src, dst, (INT64)sizeof(src), &ks, (DES_cblock*)ivec, DES_ENCRYPT);
printf("\nData:%s\nEncrypt:", DESCBC_ENCRYDATA);
for (i = 0; i < len; i++) {
printf("%02X", dst[i]);
}
ret = memset_s(src, sizeof(src), 0, sizeof(src));
if (ret != EOK) {
return ret;
}
DES_cbc_encrypt(dst, src, len, &ks, (DES_cblock*)ivec, DES_DECRYPT);
printf("\nDecrypt:%s\n", src);
return LOS_OK;
}
STATIC INT32 DemoTaskEntry(VOID)
{
INT32 ret;
printf("Openssl demo task start to run.\n");
MD5_Demo();
ret = DES_CBC_Demo();
if (ret != LOS_OK) {
printf("DES-CBC demo failed.\n");
}
printf("Openssl demo task finished.\n");
return LOS_OK;
}
VOID OpensslDemoTask(VOID)
{
UINT32 ret;
TSK_INIT_PARAM_S taskInitParam;
ret = (UINT32)memset_s(&taskInitParam, sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S));
if (ret != EOK) {
return;
}
taskInitParam.pfnTaskEntry = (TSK_ENTRY_FUNC)DemoTaskEntry;
taskInitParam.uwStackSize = OPENSSL_TASK_STACK_SIZE;
taskInitParam.pcName = "OpensslDemoTask";
taskInitParam.usTaskPrio = OPENSSL_TASK_PRIORITY;
taskInitParam.uwResved = LOS_TASK_STATUS_DETACHED;
ret = LOS_TaskCreate(&g_demoTaskId, &taskInitParam);
if (ret != LOS_OK) {
printf("Create Openssl demo task failed.\n");
}
}
#ifdef __cplusplus
#if __cplusplus
}
#endif /* __cplusplus */
#endif /* __cplusplus */
|
import control
import numpy as np
import scipy.linalg
def solve_riccati(A, B, Q, R):
"""
Solves discrete ARE, returns gain matrix K s.t. u = +K*x
Faster implementation than control.dlqr for systems with large n (state_dim)
"""
n = A.shape[0]
m = B.shape[1]
P = np.zeros((n, n))
L = np.linalg.solve(R + B.T @ P @ B, B.T @ P @ A)
Lold = np.infty * np.ones((m, n))
while (np.linalg.norm(L - Lold)) > 1e-4:
Lold = L
P = A.T @ P @ A - A.T @ P @ B @ np.linalg.inv(R + B.T @ P @ B) @ (B.T @ P @ A) + Q
L = -np.linalg.solve(R + B.T @ P @ B, B.T @ P @ A)
return L, P
def dare(Ad, Bd, Q, R):
"""
Solves discrete ARE, returns gain matrix K s.t. u = +K*x,
for testing against solve_riccati
"""
P = scipy.linalg.solve_discrete_are(Ad, Bd, Q, R)
K = -scipy.linalg.inv(Bd.T @ P @ Bd + R) @ (Bd.T @ P @ Ad)
return K, P
class DLQR:
"""
Infinite horizon discrete LQR framework, which can be used effectively for setpoint regulation
"""
def __init__(self, dt, model, cost_params):
self.dt = dt
self.model = model
self.cost_params = cost_params
def compute_policy(self, target):
u_nom = np.atleast_1d(target.u)
x_nom = target.x
K = self.compute_gain_matrix(target.A, target.B, self.cost_params.Q, self.cost_params.R)
return x_nom, u_nom, K
def compute_gain_matrix(self, A, B, Q, R):
Ad, Bd, _ = self.model.discretize_dynamics(A_c=A, B_c=B, d_c=np.zeros(self.model.get_state_dim()), dt=self.dt)
K, _ = solve_riccati(Ad, Bd, Q, R)
return K
class CLQR(DLQR):
"""
This is an infinite horizon continuous LQR framework, which can be used effectively for setpoint regulation
"""
def compute_gain_matrix(self, A, B, Q, R):
K, _, _ = control.lqr(A, B, Q, R) # in addition to control pkg, slycot needs to be installed
return np.asarray(K)
|
<reponame>unity3d-jp/USD
//
// Copyright 2016 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//
#include "pxr/imaging/hd/rprim.h"
#include "pxr/imaging/hd/changeTracker.h"
#include "pxr/imaging/hd/drawItem.h"
#include "pxr/imaging/hd/instancer.h"
#include "pxr/imaging/hd/repr.h"
#include "pxr/imaging/hd/renderIndex.h"
#include "pxr/imaging/hd/resourceRegistry.h"
#include "pxr/imaging/hd/sceneDelegate.h"
#include "pxr/imaging/hd/tokens.h"
#include "pxr/imaging/hd/vtBufferSource.h"
HdRprim::HdRprim(HdSceneDelegate* delegate, SdfPath const& id,
SdfPath const& surfaceShaderID, SdfPath const& instancerID)
: _delegate(delegate)
, _id(id)
, _instancerID(instancerID)
, _surfaceShaderID(surfaceShaderID)
, _sharedData(HdDrawingCoord::DefaultNumSlots,
/*hasInstancer=*/(not instancerID.IsEmpty()),
/*visible=*/true)
{
_sharedData.rprimID = id;
}
HdRprim::~HdRprim()
{
/*NOTHING*/
}
std::vector<HdDrawItem>*
HdRprim::GetDrawItems(TfToken const &defaultReprName, bool forced)
{
// note: GetDrawItems is called at execute phase.
// All required dirtyBits should have cleaned at this point.
HdChangeTracker::DirtyBits dirtyBits(HdChangeTracker::Clean);
TfToken reprName = _GetReprName(defaultReprName, forced, &dirtyBits);
return _GetRepr(reprName, &dirtyBits)->GetDrawItems();
}
void
HdRprim::Sync(TfToken const &defaultReprName, bool forced,
HdChangeTracker::DirtyBits *dirtyBits)
{
TfToken reprName = _GetReprName(defaultReprName,
forced, dirtyBits);
_GetRepr(reprName, dirtyBits);
// Check if the rprim has a new surface shader associated to it,
// if so, we will request the binding from the delegate and set it up in
// this rprim.
if(*dirtyBits & HdChangeTracker::DirtySurfaceShader) {
VtValue shaderBinding =
_delegate->Get(GetId(), HdShaderTokens->surfaceShader);
if(shaderBinding.IsHolding<SdfPath>()){
SetSurfaceShaderId(shaderBinding.Get<SdfPath>());
} else {
SetSurfaceShaderId(SdfPath());
}
*dirtyBits &= ~HdChangeTracker::DirtySurfaceShader;
}
// all scene-based dirty bits should have been cleared or handed off to
// repr-specific dirty bits. Otherwise sceneDelegate may be asked multiple
// times for same data.
*dirtyBits &= ~(HdChangeTracker::AllSceneDirtyBits);
}
TfToken
HdRprim::_GetReprName(TfToken const &defaultReprName, bool forced,
HdChangeTracker::DirtyBits *dirtyBits)
{
// resolve reprName
// if not forced, the prim's authored reprname wins.
// otherewise we respect defaultReprName (used for shadowmap drawing etc)
if (not forced) {
SdfPath const& id = GetId();
if (HdChangeTracker::IsReprDirty(*dirtyBits, id)) {
_authoredReprName = _delegate->GetReprName(id);
}
if (not _authoredReprName.IsEmpty()) {
return _authoredReprName;
}
}
return defaultReprName;
}
GfRange3d
HdRprim::GetExtent()
{
return _delegate->GetExtent(GetId());
}
void
HdRprim::_UpdateVisibility(HdChangeTracker::DirtyBits *dirtyBits)
{
if (HdChangeTracker::IsVisibilityDirty(*dirtyBits, GetId())) {
_sharedData.visible = _delegate->GetVisible(GetId());
}
}
bool
HdRprim::IsInCollection(TfToken const& collectionName)
{
return _delegate->IsInCollection(_id, collectionName);
}
void
HdRprim::SetSurfaceShaderId(SdfPath const& surfaceShaderId)
{
if (_surfaceShaderID != surfaceShaderId)
{
_surfaceShaderID = surfaceShaderId;
// The batches need to be verified and rebuilt if necessary.
_GetChangeTracker().MarkShaderBindingsDirty();
}
}
bool
HdRprim::IsDirty()
{
return _delegate->GetRenderIndex().GetChangeTracker().IsRprimDirty(_id);
}
void
HdRprim::SetPrimId(int32_t primId)
{
_primId = primId;
// Don't set DirtyPrimID here, to avoid undesired variability tracking.
}
HdSceneDelegate*
HdRprim::GetDelegate() {
return _delegate;
}
HdRenderIndex&
HdRprim::_GetRenderIndex() {
return _delegate->GetRenderIndex();
}
HdRenderIndex const&
HdRprim::_GetRenderIndex() const {
return _delegate->GetRenderIndex();
}
int
HdRprim::GetInitialDirtyBitsMask() const
{
return _GetInitialDirtyBits();
}
HdChangeTracker&
HdRprim::_GetChangeTracker() {
return _GetRenderIndex().GetChangeTracker();
}
void
HdRprim::_PopulateConstantPrimVars(HdDrawItem *drawItem,
HdChangeTracker::DirtyBits *dirtyBits)
{
HD_TRACE_FUNCTION();
HD_MALLOC_TAG_FUNCTION();
SdfPath const& id = GetId();
HdSceneDelegate* delegate = GetDelegate();
HdResourceRegistry *resourceRegistry = &HdResourceRegistry::GetInstance();
// XXX: this should be in a different method
_sharedData.surfaceShader = _GetRenderIndex().GetShader(_surfaceShaderID);
// update uniforms
HdBufferSourceVector sources;
if (HdChangeTracker::IsTransformDirty(*dirtyBits, id)) {
GfMatrix4d transform = delegate->GetTransform(id);
_sharedData.bounds.SetMatrix(transform); // for CPU frustum culling
HdBufferSourceSharedPtr source(new HdVtBufferSource(
HdTokens->transform,
transform));
sources.push_back(source);
source.reset(new HdVtBufferSource(HdTokens->transformInverse,
transform.GetInverse()));
sources.push_back(source);
// if this is a prototype (has instancer),
// also push the instancer transform separately.
if (not _instancerID.IsEmpty()) {
// gather all instancer transforms in the instancing hierarchy
VtMatrix4dArray rootTransforms = _GetInstancerTransforms();
VtMatrix4dArray rootInverseTransforms(rootTransforms.size());
bool leftHanded = transform.IsLeftHanded();
for (size_t i = 0; i < rootTransforms.size(); ++i) {
rootInverseTransforms[i] = rootTransforms[i].GetInverse();
// flip the handedness if necessary
leftHanded ^= rootTransforms[i].IsLeftHanded();
}
source.reset(new HdVtBufferSource(
HdTokens->instancerTransform,
rootTransforms, /*staticArray=*/true));
sources.push_back(source);
source.reset(new HdVtBufferSource(
HdTokens->instancerTransformInverse,
rootInverseTransforms, /*staticArray=*/true));
sources.push_back(source);
// XXX: It might be worth to consider to have isFlipped
// for non-instanced prims as well. It can improve
// the drawing performance on older-GPUs by reducing
// fragment shader cost, although it needs more GPU memory.
// set as int (GLSL needs 32-bit align for bool)
source.reset(new HdVtBufferSource(
HdTokens->isFlipped, VtValue(int(leftHanded))));
sources.push_back(source);
}
}
if (HdChangeTracker::IsExtentDirty(*dirtyBits, id)) {
_sharedData.bounds.SetRange(GetExtent());
GfVec3d const & localMin = drawItem->GetBounds().GetBox().GetMin();
HdBufferSourceSharedPtr sourceMin(new HdVtBufferSource(
HdTokens->bboxLocalMin,
VtValue(GfVec4f(
localMin[0],
localMin[1],
localMin[2], 0))));
sources.push_back(sourceMin);
GfVec3d const & localMax = drawItem->GetBounds().GetBox().GetMax();
HdBufferSourceSharedPtr sourceMax(new HdVtBufferSource(
HdTokens->bboxLocalMax,
VtValue(GfVec4f(
localMax[0],
localMax[1],
localMax[2], 0))));
sources.push_back(sourceMax);
}
if (HdChangeTracker::IsPrimIdDirty(*dirtyBits, id)) {
GfVec4f primIdColor;
int32_t primId = GetPrimId();
HdBufferSourceSharedPtr source(new HdVtBufferSource(
HdTokens->primID,
VtValue(primId)));
sources.push_back(source);
}
if (HdChangeTracker::IsAnyPrimVarDirty(*dirtyBits, id)) {
TfTokenVector primVarNames = delegate->GetPrimVarConstantNames(id);
sources.reserve(sources.size()+primVarNames.size());
TF_FOR_ALL(nameIt, primVarNames) {
if (HdChangeTracker::IsPrimVarDirty(*dirtyBits, id, *nameIt)) {
VtValue value = delegate->Get(id, *nameIt);
// XXX Hydra doesn't support string primvar yet
if (value.IsHolding<std::string>()) continue;
if (!value.IsEmpty()) {
HdBufferSourceSharedPtr source(
new HdVtBufferSource(*nameIt, value));
// if it's an unacceptable type, skip it (e.g. std::string)
if (source->GetNumComponents() > 0) {
sources.push_back(source);
}
}
}
}
}
// return before allocation if it's empty.
if (sources.empty())
return;
// Allocate a new uniform buffer if not exists.
if (not drawItem->GetConstantPrimVarRange()) {
// establish a buffer range
HdBufferSpecVector bufferSpecs;
TF_FOR_ALL(srcIt, sources) {
(*srcIt)->AddBufferSpecs(&bufferSpecs);
}
HdBufferArrayRangeSharedPtr range =
resourceRegistry->AllocateShaderStorageBufferArrayRange(
HdTokens->primVar, bufferSpecs);
TF_VERIFY(range->IsValid());
_sharedData.barContainer.Set(
drawItem->GetDrawingCoord()->GetConstantPrimVarIndex(), range);
}
TF_VERIFY(drawItem->GetConstantPrimVarRange()->IsValid());
resourceRegistry->AddSources(
drawItem->GetConstantPrimVarRange(), sources);
}
void
HdRprim::_PopulateInstancePrimVars(HdDrawItem *drawItem,
HdChangeTracker::DirtyBits *dirtyBits,
int instancePrimVarSlot)
{
HD_TRACE_FUNCTION();
HD_MALLOC_TAG_FUNCTION();
SdfPath const& id = GetId();
if (_instancerID.IsEmpty()) {
return;
}
HdInstancerSharedPtr instancer = _GetRenderIndex().GetInstancer(_instancerID);
if (not TF_VERIFY(instancer)) return;
HdDrawingCoord *drawingCoord = drawItem->GetDrawingCoord();
// populate INSTANCE PRIVARS first so that we can detect inconsistency
// between the number of instances and instance primvars.
/* INSTANCE PRIMVARS */
// we always call GetInstancePrimVars so that HdInstancer updates
// instance primvars if needed.
// populate all instance primvars by backtracing hierarachy
int level = 0;
HdInstancerSharedPtr currentInstancer = instancer;
while (currentInstancer) {
// allocate instance primvar slot in the drawing coordinate.
drawingCoord->SetInstancePrimVarIndex(level,
instancePrimVarSlot + level);
_sharedData.barContainer.Set(
drawingCoord->GetInstancePrimVarIndex(level),
currentInstancer->GetInstancePrimVars(level));
// next
currentInstancer
= _GetRenderIndex().GetInstancer(currentInstancer->GetParentId());
++level;
}
/* INSTANCE INDICES */
if (HdChangeTracker::IsInstanceIndexDirty(*dirtyBits, id)) {
_sharedData.barContainer.Set(
drawingCoord->GetInstanceIndexIndex(),
instancer->GetInstanceIndices(id));
}
TF_VERIFY(drawItem->GetInstanceIndexRange());
}
VtMatrix4dArray
HdRprim::_GetInstancerTransforms()
{
SdfPath const& id = GetId();
SdfPath instancerID = _instancerID;
VtMatrix4dArray transforms;
HdSceneDelegate* delegate = GetDelegate();
while (not instancerID.IsEmpty()) {
transforms.push_back(delegate->GetInstancerTransform(instancerID, id));
HdInstancerSharedPtr instancer
= _GetRenderIndex().GetInstancer(instancerID);
if (instancer) {
instancerID = instancer->GetParentId();
} else {
instancerID = SdfPath();
}
}
return transforms;
}
int
HdRprim::GetDirtyBitsMask(TfToken const &reprName)
{
int mask =
HdChangeTracker::DirtyVisibility
| HdChangeTracker::DirtyExtent
| HdChangeTracker::DirtyTransform
| HdChangeTracker::DirtyPrimID
| HdChangeTracker::DirtyInstancer
| HdChangeTracker::DirtyInstanceIndex
| HdChangeTracker::DirtySurfaceShader;
return mask;
}
|
ORLANDO, Fla. - A house along Bumby Avenue that has been a source of frustration to neighbors in Audubon Park for years is on the market.
Neighbors have filed complaints to code enforcement officers about a peacock problem at the home of Michael Housel.
Leticia Pence, who lives across the street from Housel, said she has been dealing with more than two dozens peacocks howling and shrieking at all hours of the day and night.
"They are very obnoxious. They are very loud. They are very destructive," Pence said.
Over the years, records show neighbors have lodged repeated complaints with the city of Orlando about the issue. The property has been the focus of multiple code-enforcement complaints dating back to 2012.
"I have had to replace my roof," Pence said. "I've had to get a new car. I've had to replace my plants a million times. It's been absolutely horrid."
Pence and some neighbors said they were ecstatic when they learned Housel's house, known as "the peacock house," was up for sale.
"I'm just happy that he is going to be gone and hopefully just take his peacocks with him," Pence said.
Housel's next-door neighbor, Lin Lin, said he hasn't complained about the peacocks and peahens roaming on his property because he wants to keep the peace.
"He is my neighbor, so I can't say nothing," Lin said.
Housel refused to answer our questions about the pending sale and turned us away.
"Get off! You understand me!" Housel said.
|
A comparative study on fabrication techniques for on-chip microelectrodes. This paper presents an experimental study on different microelectrode fabrication techniques, with particular focus on the robustness of the surface insulation towards typical working conditions required in lab-on-a-chip applications. Pt microelectrodes with diameters of 50 m, 100 m and 200 m are patterned on a Si substrate with SiO film. Sputtered SiO, low-pressure chemical vapor deposition (LPCVD) low-temperature oxide (LTO), Parylene C, SU-8, and dry-film were deposited and patterned on top of the chips as the passivation layer. This paper provides the detailed fabrication processes, the adhesion enhancement strategies, and the major advantages and disadvantages of each fabrication technique. Firstly, the quality and adhesion strength of the passivations were investigated by means of hydrolysis tests, in which sputtered SiO and dry-film resist showed serious delamination issues and LTO showed minor defects. Secondly, the reliability of the microelectrodes was tested by impedance measurements after overnight ethanol incubation and self-assembled monolayer (SAM) formation. Thirty chips, representing a total of 300 electrodes, were measured, and statistical analyses of the results were conducted for each passivation technique. All of the electrodes passivated with these five techniques showed consistent impedance values after ethanol incubation. On the other hand, only LTO, Parylene C, and SU-8 ensured uniform electrical behavior after SAM formation. Having used both hydrolysis and impedance tests to verify the superior quality of the Parylene-based passivation, electrochemical experiments were performed to study the long-term stability of the passivation layer. Finally, the electrodes were incubated with electroactive alkanethiols functionalized with ferrocene. Square-wave voltammetry measurements demonstrated reproducible results on electrochemical label detection, which confirms the suitability of the Parylene passivation for charge-transfer-based measurements.
|
# -*- encoding: utf-8 -*-
import pytz
from datetime import datetime
TZ_UTC = pytz.UTC
def print_(msg):
""" Exibe uma mensagem no terminal com a data atual. """
dt = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
print('[%s] %s' % (dt, msg))
def dt_to_naive(dt):
""" Adiciona o timezone UTC no datetime.
* Não é feita conversão da data. Apenas é alterado o tzinfo.
"""
if dt is not None and not dt.tzinfo:
dt = TZ_UTC.localize(dt)
return dt
|
A suspected gunman is dead after a rampage through downtown Austin on Friday morning that left more than 100 rounds in the U.S. Federal Courthouse, the Consulate General of Mexico, a BB&T Bank and the Austin Police Department headquarters.
Though the investigation, which is led by FBI Special Agent Dan Powers and Austin Police Department, is still ongoing, APD Police Chief Art Acevedo gave a press conference to elaborate on the timeline of events. Beginning at 2:22 am, emergency dispatchers started receiving reports of a gunman in the vicinity of the Federal Courthouse near Fourth and Nueces streets. These were corroborated by patrol officers who also reported hearing gunfire in the area.
Acevedo also noted that the officer was holding the horse steady in one hand while firing with the other.
At 2:24 am, APD received more reports of gunfire from a possible automatic weapon. This was followed five minutes later at 2:29 am with a report of shots fired at the Mexican Consulate on Baylor Street near West Fifth Street. A later investigation found what Acevedo described as a "small, green cylinder" had been set on fire near the consulate. It was extinguished and did minimal damage to the building.
At 2:32 am, Austin Police Department headquarters came under fire. "An Austin police sergeant who was in process of loading horses from mounted patrol saw the gunman and heard gunfire," said Acevedo. At 2:33 am, the sergeant, a 15-year veteran of the force, returned gunfire and the suspect was killed. Acevedo said it was unclear if the bullet that killed the suspect was from the officer's gun or if it was self-inflicted.
The officer has been placed on administrative leave with pay, per APD policy. Acevedo also noted that the officer was holding the horse steady in one hand while firing with the other.
At 2:34 am, emergency services was called to respond and patrol officers went to grab the suspect. At this point, officers noted that the suspect was wearing an unidentifiable vest and also reported "cylinders" in the suspect's vehicle. The officers disengaged the suspect and called for a bomb squad. At 2:40 am the bomb squad responded, APD headquarters was evacuated and at 2:41 am, I-35 and the streets surrounding the department's downtown headquarters were shut down.
The bomb squad was later able to determine there was no bomb and I-35 was reopened around 6:30 am.
The suspect has been identified as 49-year-old Larry Steven McQuilliams. He is a resident of Austin. Police are unsure of motive.
"I give thanks that no one but the suspect is injured or deceased," Acevedo said. "We should all take a lot of comfort [in that]."
|
Utility of Next Generation Sequencing in the Workup and Diagnosis of Myeloproliferative neoplasm in the Peripheral Blood: A single institution experience In patients with suspicion of Myeloproliferative neoplasm (MPN) and negative for BCR-ABL1, NCCN guideline currently recommends two molecular workup pathways in peripheral blood: 1) a multi-step reflex mutation testing algorithm including JAK2 V617F, CALR, MPL, JAK2 exon12 or 2) a multigene Next Generation Sequencing (NGS) panel that includes at least JAK2, CALR and MPL genes. Here we report the clinical utilization and impact of a NGS based MPN diagnosis assay. Total of 690 consecutive cases at Geisinger between 2019 and 2021 were included in this study. Patients CBC showed chronic cytosis in either single or multi-lineage myelopoiesis and was clinically suspicious for MPNs. For BCR-ABL1 negative cases, NGS based MPN diagnostic assay was performed, which include the four disease defining genes recommended by NCCN guideline: JAK2, CALR, MPL, CSF3R as well as three additional genes NRAS, PPM1D and TP53. Variants are classified in to four tiers based on their level of clinical significance. Among all cases tested, 25 out of 690 cases (3.6%) were positive for BCR-ABL1 transcript. 20.9% (139 out of 665 BCR-ABL1 negative cases) had at least one variant detected, which included 73 variants in Tier I category (11.0%), 6 variants in Tier II (0.9%), 57 variants in Tier III (8.6%) and 3 variants in Tier IV(0.5%). Among all disease defining mutations, JAK2 V617F was the most commonly detected mutation (59 cases and 8.8%), followed by CALR indel mutations (13 cases and 2.0%). In addition, double variants were detected in total 7 cases (1.0%). Comparing to the conventional multi-step sequential workup for MPN diagnosis, the multi-gene NGS panel provides a cost-effective and time- saving solution. When detected concurrently with the disease defining mutations, NRAS, PPM1D and TP53 could provide not only additional prognostic information but also may suggest pending progression in myeloproliferative neoplasms.
|
package linkedList;
public class SingleCircularLinkedListMain {
public static void main(String[] args) {
SingleCircularLinkedList list = new SingleCircularLinkedList();
list.createSingleLinkedList(5);
list.insertInLinkedList(10, 1);
list.insertInLinkedList(20, 2);
list.insertInLinkedList(30, 3);
list.insertInLinkedList(40, 4);
System.out.println("Linked List now: ");
list.traverseLinkedList();
list.insertInLinkedList(35, 4);
list.traverseLinkedList();
list.insertInLinkedList(1, 0);
list.traverseLinkedList();
list.insertInLinkedList(100, 10);
list.traverseLinkedList();
list.printHeadUsingTail();
System.out.println("Searching the node having value 40: ");
list.searchNode(40);
System.out.println("\n\nSearching the node having value 200: ");
list.searchNode(200);
System.out.println("\n\nDeleting the node having location = 2: ");
System.out.println("Before deletion...");
list.traverseLinkedList();
list.deletionOfNode(2);
System.out.println("After deletion...");
list.traverseLinkedList();
System.out.println("\n\nDeleting the node having location = 0: ");
System.out.println("Before deletion...");
list.traverseLinkedList();
list.deletionOfNode(0);
System.out.println("After deletion...");
list.traverseLinkedList();
System.out.println("\n\nDeleting the node having location = 15: ");
System.out.println("Before deletion...");
list.traverseLinkedList();
list.deletionOfNode(15);
System.out.println("After deletion...");
list.traverseLinkedList();
System.out.println("\n\nDeleting the node having location = 15: ");
System.out.println("Before deletion...");
list.traverseLinkedList();
list.deletionOfNode(15);
System.out.println("After deletion...");
list.traverseLinkedList();
list.deleteLinkedList();
list.traverseLinkedList();
}//end of Main method
}//end of Class
|
<reponame>jstokes/secure-data-service
/*
* Copyright 2012-2013 inBloom, Inc. and its affiliates.
*
* 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.slc.sli.sif.domain.converter;
import java.util.HashMap;
import java.util.Map;
import openadk.library.common.ExitType;
import openadk.library.common.ExitTypeCode;
import org.springframework.stereotype.Component;
/**
* A customized converter to convert SIF ExitType to SLI ExitType enumeration.
*
* SLI values:
* Student is in a different public school in the same local education agency
* Transferred to a public school in a different local education agency in the same state
* Transferred to a public school in a different state
* Transferred to a private, non-religiously-affiliated school in the same local education agency
* Transferred to a private, non-religiously-affiliated school in a different local education agency in the same state
* Transferred to a private, non-religiously-affiliated school in a different state
* Transferred to a private, religiously-affiliated school in the same local education agency
* Transferred to a private, religiously-affiliated school in a different local education agency in the same state
* Transferred to a private, religiously-affiliated school in a different state
* Transferred to a school outside of the country
* Transferred to an institution
* Transferred to home schooling
* Transferred to a charter school
* Graduated with regular, advanced, International Baccalaureate, or other type of diploma
* Completed school with other credentials
* Died or is permanently incapacitated
* Withdrawn due to illness
* Expelled or involuntarily withdrawn
* Reached maximum age for services
* Discontinued schooling
* Completed grade 12, but did not meet all graduation requirements
* Enrolled in a postsecondary early admission program, eligible to return
* Not enrolled, unknown status
* Student is in the same local education agency and receiving education services, but is not assigned to a particular school
* Enrolled in an adult education or training program
* Completed a state-recognized vocational education program
* Not enrolled, eligible to return
* Enrolled in a foreign exchange program, eligible to return
* Withdrawn from school, under the age for compulsory attendance; eligible to return
* Exited
* Student is in a charter school managed by the same local education agency
* Completed with a state-recognized equivalency certificate
* Removed by Child Protective Services
* Transferred to a private school in the state
* Graduated outside of state prior to enrollment
* Completed equivalency certificate outside of state
* Enrolled in University High School Diploma Program
* Court ordered to a GED program, has not earned a GED
* Incarcerated in a state jail or federal penitentiary as an adult
* Graduated from another state under Interstate Compact on Educational Opportunity for Military Children
* Dropout
* End of school year
* Invalid enrollment
* No show
* Other
*/
@Component
public class ExitTypeConverter {
private static final Map<ExitTypeCode, String> EXIT_TYPE_CODE_MAP = new HashMap<ExitTypeCode, String>();
static {
EXIT_TYPE_CODE_MAP.put(ExitTypeCode._1907_TRANSFERRED_IN_LEA, "Student is in a different public school in the same local education agency");
EXIT_TYPE_CODE_MAP.put(ExitTypeCode._1908_TRANSFERRED_IN_STATE, "Transferred to a public school in a different local education agency in the same state");
EXIT_TYPE_CODE_MAP.put(ExitTypeCode._1909_TRANSFERRED_DIFFERENT_STATE, "Transferred to a public school in a different state");
EXIT_TYPE_CODE_MAP.put(ExitTypeCode._1910_TRANSFERRED_PRIVATE_IN_LEA, "Transferred to a private, non-religiously-affiliated school in the same local education agency");
EXIT_TYPE_CODE_MAP.put(ExitTypeCode._1911_TRANSFERRED_PRIVATE_IN_STATE, "Transferred to a private, non-religiously-affiliated school in a different local education agency in the same state");
EXIT_TYPE_CODE_MAP.put(ExitTypeCode._1912_TRANSFERRED_PRIVATE_IN_COUNTRY, "Transferred to a private, non-religiously-affiliated school in a different state");
EXIT_TYPE_CODE_MAP.put(ExitTypeCode._1913_TRANSFERRED_RELIGEOUS_IN_LEA, "Transferred to a private, religiously-affiliated school in the same local education agency");
EXIT_TYPE_CODE_MAP.put(ExitTypeCode._1914_TRANSFERRED_RELIGEOUS_IN_STATE, "Transferred to a private, religiously-affiliated school in a different local education agency in the same state");
EXIT_TYPE_CODE_MAP.put(ExitTypeCode._1915_TRANSFERRED_RELIGEOUS_IN_COUNTRY, "Transferred to a private, religiously-affiliated school in a different state");
EXIT_TYPE_CODE_MAP.put(ExitTypeCode._1916_TRANSFERRED_OUT_OF_COUNTRY, "Transferred to a school outside of the country");
EXIT_TYPE_CODE_MAP.put(ExitTypeCode._1917_TRANSFERRED_TO_AN_INSTITUTION, "Transferred to an institution");
EXIT_TYPE_CODE_MAP.put(ExitTypeCode._1918_TRANSFERRED_TO_HOME_SCHOOLING, "Transferred to home schooling");
EXIT_TYPE_CODE_MAP.put(ExitTypeCode._1919_TRANSFERRED_TO_A_CHARTER, "Transferred to a charter school");
EXIT_TYPE_CODE_MAP.put(ExitTypeCode._1921_GRADUATED_WITH_DEGREE, "Graduated with regular, advanced, International Baccalaureate, or other type of diploma");
EXIT_TYPE_CODE_MAP.put(ExitTypeCode._1922_COMPLETED_SCHOOL_WITH_OTHER, "Completed school with other credentials");
EXIT_TYPE_CODE_MAP.put(ExitTypeCode._1923_DIED_OR_INCAPACITATED, "Died or is permanently incapacitated");
EXIT_TYPE_CODE_MAP.put(ExitTypeCode._1924_WITHDRAWN_ILLNESS, "Withdrawn due to illness");
EXIT_TYPE_CODE_MAP.put(ExitTypeCode._1925_EXPELLED_OR_INVOLUNTARY, "Expelled or involuntarily withdrawn");
EXIT_TYPE_CODE_MAP.put(ExitTypeCode._1926_REACHED_MAXIMUM_AGE, "Reached maximum age for services");
EXIT_TYPE_CODE_MAP.put(ExitTypeCode._1927_DISCONTINUED_SCHOOLING, "Discontinued schooling");
EXIT_TYPE_CODE_MAP.put(ExitTypeCode._1928_COMPLETED_GRADE_12_NOT_GRADUATED, "Completed grade 12, but did not meet all graduation requirements");
EXIT_TYPE_CODE_MAP.put(ExitTypeCode._1930_ENROLLED_IN_A_POSTSECONDARY, "Enrolled in a postsecondary early admission program, eligible to return");
EXIT_TYPE_CODE_MAP.put(ExitTypeCode._1931_NOT_ENROLLED_UNKNOWN, "Not enrolled, unknown status");
EXIT_TYPE_CODE_MAP.put(ExitTypeCode._3499_STUDENT_IS_IN_THE_SAME_LOCAL, "Student is in the same local education agency and receiving education servi, but is not assigned to a particular school");
EXIT_TYPE_CODE_MAP.put(ExitTypeCode._3500_ENROLLED_IN_AN_ADULT, "Enrolled in an adult education or training program");
EXIT_TYPE_CODE_MAP.put(ExitTypeCode._3501_COMPLETED_A_STATE_RECOGNIZED, "Completed a state-recognized vocational education program");
EXIT_TYPE_CODE_MAP.put(ExitTypeCode._3502_NOT_ENROLLED_ELIGIBLE_TO, "Not enrolled, eligible to return");
EXIT_TYPE_CODE_MAP.put(ExitTypeCode._3503_ENROLLED_IN_A_FOREIGN, "Enrolled in a foreign exchange program, eligible to return");
EXIT_TYPE_CODE_MAP.put(ExitTypeCode._3504_WITHDRAWN_FROM_SCHOOL_UNDER, "Withdrawn from school, under the age for compulsory attendance; eligible to return");
EXIT_TYPE_CODE_MAP.put(ExitTypeCode._3505_EXITED, "Exited");
EXIT_TYPE_CODE_MAP.put(ExitTypeCode._3508_STUDENT_IS_IN_A_CHARTER, "Student is in a charter school managed by the same local education agency");
EXIT_TYPE_CODE_MAP.put(ExitTypeCode._3509_COMPLETED_WITH_A_STATE, "Completed with a state-recognized equivalency certificate");
EXIT_TYPE_CODE_MAP.put(ExitTypeCode._9999_OTHER, "Other");
}
public String convert(ExitType exitType) {
if (exitType == null) {
return null;
}
return toSliExitType(ExitTypeCode.wrap(exitType.getCode()));
}
private String toSliExitType(ExitTypeCode exitTypeCode) {
String mapping = EXIT_TYPE_CODE_MAP.get(exitTypeCode);
return mapping == null ? "Other" : mapping;
}
}
|
<reponame>tbrown122387/ssme
#ifndef ADA_PMMH_MVN_H
#define ADA_PMMH_MVN_H
#include <vector>
#include <Eigen/Dense>
#include <iostream> // ofstream
#include <fstream> // ofstream
#include <pf/rv_eval.h>
#include <pf/rv_samp.h>
#include <ssme/utils.h> // readInData
#include <ssme/parameters.h>
#include <ssme/thread_pool.h>
/**
* @class ada_pmmh_mvn
* @author Taylor
* @file ada_pmmh_mvn.h
* @brief Performs (possibly-adaptive) particle marginal Metropolis-Hastings sampling, using a
* multivariate normal distribution as the parameter proposal. This samples on the transformed
* space, but it writes out the untransformed/constrained samples to the output. The
* priors requested by the user are for the (hopefully more convenient) un-transformed
* or constrained space. This means that the user never has to worry about handling any
* kind of Jacobian--just specify a prior on the familiar space, and a function that
* approximates log-likelihoods.
*/
template<size_t numparams, size_t dimobs, size_t numparts, typename float_t>
class ada_pmmh_mvn{
public:
using osv = Eigen::Matrix<float_t,dimobs,1>;
using psv = Eigen::Matrix<float_t,numparams,1>;
using psm = Eigen::Matrix<float_t,numparams,numparams>;
using dyn_data_t = param::pack<float_t,numparams>;
using static_data_t = std::vector<osv>;
/**
* @brief Constructs algorithm object
* @param start_trans_theta the initial transformed parameters you want to start sampling from.
* @param num_mcmc_iters the number of MCMC iterations you want to do.
* @param data_file the location of the observed time series data (input).
* @param samples_file the location where you want to store the theta samples (output).
* @param messages_file the location where you want to store the messages (output).
* @param mc stands for multicore. true or false if you want to use extra cores.
* @param t0 iteration you start adapting
* @param t1 iteration you stop adapting
* @param C0 initial covariance matrix for proposal distribution.
* @param print_to_console true if you want to see messages in real time
* @param print_every_k print messages and samples every (this number) iterations
*/
ada_pmmh_mvn(const psv &start_trans_theta,
std::vector<std::string> tts,
const unsigned int &num_mcmc_iters,
const unsigned int &num_pfilters,
const std::string &data_file,
const std::string &sample_file_base_name,
const std::string &message_file_base_name,
const bool &mc,
const unsigned int &t0,
const unsigned int &t1,
const psm &C0,
bool print_to_console,
unsigned int print_every_k);
// TODO: describe formatting rules (e.g. column orders, column names, etc.
// )
/**
* @brief Get the current proposal distribution's covariance matrix.
* @return the covariance matrix of q(theta' | theta)
*/
psm get_ct() const;
/**
* @brief starts the sampling
*/
void commence_sampling();
/**
* @brief Evaluates the log of the model's prior
* @param theta the parameters argument
* @return the log of the prior density
*/
virtual float_t log_prior_eval(const param::pack<float_t,numparams>& theta) = 0;
/**
* @brief Evaluates (approximates) the log-likelihood with a particle filter
* @param theta the parameters with which to run the particle filter
* @param data the observed data with which to run the particle filter
* @return the evaluation of the approx. log likelihood
*/
virtual float_t log_like_eval(const param::pack<float_t,numparams>& theta,
const std::vector<osv> &data) = 0;
private:
dyn_data_t m_current_theta;
std::vector<std::string> m_tts;
psm m_sigma_hat; // for transformed parameters; n-1 in the denominator.
psv m_mean_trans_theta;
float_t m_ma_accept_rate;
unsigned int m_t0; // the time it starts adapting
unsigned int m_t1; // the time it stops adapting
psm m_Ct;
rvsamp::MVNSampler<numparams,float_t> m_mvn_gen;
std::ofstream m_samples_file_stream;
std::ofstream m_message_stream;
unsigned int m_num_mcmc_iters;
unsigned int m_iter; // current iter
float_t m_sd; // perhaps there's a better name for this
float_t m_eps;
bool m_print_to_console;
unsigned int m_print_every_k;
/* thread pool (its function can only take one parameter) */
thread_pool<dyn_data_t, static_data_t, float_t> m_pool;
/* changing MCMC state variables */
float_t m_old_log_like;
float_t m_new_log_like;
float_t m_old_log_prior;
float_t m_new_log_prior;
float_t m_log_accept_prob;
bool m_accepted;
void update_moments_and_Ct(const dyn_data_t& new_theta);
psv q_samp(const dyn_data_t& old_theta);
float_t log_q_eval(const dyn_data_t& oldParams, const dyn_data_t& new_params);
// TODO: https://eigen.tuxfamily.org/dox/TopicFunctionTakingEigenTypes.html
void record_params();
void record_iter_num();
void record_messages();
float_t pool_func(dyn_data_t param, static_data_t obs_data)
{
return log_like_eval(param, obs_data);
}
};
template<size_t numparams, size_t dimobs, size_t numparts, typename float_t>
ada_pmmh_mvn<numparams,dimobs,numparts,float_t>::ada_pmmh_mvn(
const psv &start_trans_theta,
std::vector<std::string> tts,
const unsigned int &num_mcmc_iters,
const unsigned int &num_pfilters,
const std::string &data_file,
const std::string &sample_file_base_name,
const std::string &message_file_base_name,
const bool &mc,
const unsigned int &t0,
const unsigned int &t1,
const psm &C0,
bool print_to_console,
unsigned int print_every_k)
: m_current_theta(start_trans_theta, tts)
, m_tts(tts)
, m_sigma_hat(psm::Zero())
, m_mean_trans_theta(psv::Zero())
, m_ma_accept_rate(0.0)
, m_t0(t0), m_t1(t1)
, m_Ct(C0)
, m_num_mcmc_iters(num_mcmc_iters)
, m_iter(0)
, m_sd(2.4*2.4/numparams)
, m_eps(.01)
, m_print_to_console(print_to_console)
, m_print_every_k(print_every_k)
, m_pool(std::bind(&ada_pmmh_mvn<numparams,dimobs,numparts,float_t>::pool_func,
this,
std::placeholders::_1,
std::placeholders::_2),
num_pfilters,
mc)
, m_log_accept_prob(-std::numeric_limits<float_t>::infinity())
{
static_data_t tmp_data = utils::read_data<dimobs,float_t>(data_file);
m_pool.add_observed_data( tmp_data );
std::string samples_file = utils::gen_string_with_time(sample_file_base_name);
m_samples_file_stream.open(samples_file);
std::string messages_file = utils::gen_string_with_time(message_file_base_name);
m_message_stream.open(messages_file);
}
template<size_t numparams, size_t dimobs, size_t numparts, typename float_t>
void ada_pmmh_mvn<numparams,dimobs,numparts,float_t>::update_moments_and_Ct(const param::pack<float_t,numparams>& new_theta)
{
// if m_iter = 1, that means we're on iteration 2,
// but we're calling this based on the previous iteration,
// so that's iteration 1, think of n as the actual
// number of iterations that have happened then (not counting from 0)
// On the other hand, yu might not want to count the first iteration,
// though, because we didn't "propose" anything and probabilistically accept/reject it
psv new_trans_theta = new_theta.get_trans_params();
if(m_iter == 1){
// at the moment m_meanTransTheta is zero, so we add m_currentTransTheta
// we'll also leave m_sigma_hat to be zero for the time being
m_mean_trans_theta += new_trans_theta;
}else if(m_iter == 2){
// at the beginning of this call, m_mean_trans_theta is x1*x1^T and m_sigma_hat is zero
// this is a an algebraically simplified version of the split up non-recursive formula
m_sigma_hat = m_mean_trans_theta*m_mean_trans_theta.transpose()
+ new_trans_theta * new_trans_theta.transpose()
- m_mean_trans_theta * new_trans_theta.transpose()
- new_trans_theta * m_mean_trans_theta.transpose();
m_sigma_hat *= .5;
m_mean_trans_theta = .5* m_mean_trans_theta + .5*new_trans_theta;
}else if( m_iter > 2){
// regular formula. see
// https://stats.stackexchange.com/questions/310680/sequential-recursive-online-calculation-of-sample-covariance-matrix/310701#310701
m_sigma_hat = m_sigma_hat*(m_iter-2.0)/(m_iter-1.0)
+ (new_trans_theta - m_mean_trans_theta)*(new_trans_theta - m_mean_trans_theta).transpose()/m_iter;
m_mean_trans_theta = ((m_iter-1.0)*m_mean_trans_theta + new_trans_theta)/m_iter;
}else{
std::cerr << "something went wrong\n";
}
// now update Ct
if( (m_t1 > m_iter) && (m_iter > m_t0) ) // in window, so we want to adjust Ct
m_Ct = m_sd * ( m_sigma_hat + m_eps * psm::Identity() );
}
template<size_t numparams, size_t dimobs, size_t numparts, typename float_t>
auto ada_pmmh_mvn<numparams,dimobs,numparts,float_t>::get_ct() const -> psm
{
return m_Ct;
}
template<size_t numparams, size_t dimobs, size_t numparts, typename float_t>
auto ada_pmmh_mvn<numparams,dimobs,numparts,float_t>::q_samp(const param::pack<float_t,numparams>& old_params) -> psv
{
// assumes that Ct has already been updated
// recall that we are sampling on the transformed/unconstrained space
psv old_trans_params = old_params.get_trans_params();
m_mvn_gen.setMean(old_trans_params);
m_mvn_gen.setCovar(m_Ct);
return m_mvn_gen.sample();
}
template<size_t numparams, size_t dimobs, size_t numparts, typename float_t>
void ada_pmmh_mvn<numparams,dimobs,numparts,float_t>::record_params()
{
if( m_iter % m_print_every_k == 0){
if(m_samples_file_stream.is_open()){
Eigen::Matrix<float_t,numparams,1> p = m_current_theta.get_untrans_params();
for(size_t i = 0; i < numparams; ++i){
if( i == 0)
m_samples_file_stream << p(i);
else
m_samples_file_stream << "," << p(i);
}
m_samples_file_stream << "\n";
}else{
std::cerr << "tried to write to a closed ofstream! " << "\n";
m_message_stream << "tried to write to a closed ofstream! " << "\n";
}
}
}
template<size_t numparams, size_t dimobs, size_t numparts, typename float_t>
void ada_pmmh_mvn<numparams,dimobs,numparts,float_t>::record_iter_num()
{
if(m_iter % m_print_every_k == 0){
m_message_stream << "Iter number: " << m_iter + 1 << "\n";
if(m_print_to_console)
std::cout << "Iter number: " << m_iter + 1 << "\n";
}
}
template<size_t numparams, size_t dimobs, size_t numparts, typename float_t>
void ada_pmmh_mvn<numparams,dimobs,numparts,float_t>::record_messages()
{
// format:
// iter number, acceptance rate, old_ll, new_ll, old log prior, new log prior, accept probability, outcome
m_message_stream << m_iter+1 << ", " << m_ma_accept_rate << ", " << m_old_log_like << ", "
<< m_new_log_like << ", " << m_old_log_prior << ", " << m_new_log_prior << ", "
<< m_log_accept_prob << ", " << m_accepted << "\n";
if(m_print_to_console){
std::cout << m_iter+1 << ", " << m_ma_accept_rate << ", " << m_old_log_like << ", "
<< m_new_log_like << ", " << m_old_log_prior << ", " << m_new_log_prior << ", "
<< m_log_accept_prob << ", " << m_accepted << "\n";
}
}
template<size_t numparams, size_t dimobs, size_t numparts, typename float_t>
void ada_pmmh_mvn<numparams,dimobs,numparts,float_t>::commence_sampling()
{
// random number stuff to decide on whether to accept or reject
rvsamp::UniformSampler<float_t> runif;
psv proposed_trans_theta;
while(m_iter < m_num_mcmc_iters) // every iteration
{
if(m_iter > 0) {
// update sample moments (with the parameters that were just accepted) and Ct so we can q_samp()
update_moments_and_Ct(m_current_theta);
// propose a new theta
proposed_trans_theta = q_samp(m_current_theta);
dyn_data_t proposed_theta(proposed_trans_theta, m_tts);
m_new_log_prior = log_prior_eval(proposed_theta) + proposed_theta.get_log_jacobian();
m_new_log_like = m_pool.work(proposed_theta);
// decide whether to accept or reject
m_log_accept_prob = m_new_log_prior + m_new_log_like - m_old_log_prior - m_old_log_like;
float_t log_uniform_draw = std::log(runif.sample());
m_accepted = log_uniform_draw < m_log_accept_prob; // TODO: verify that everything compared to a NaN is false!
if(m_accepted){
m_ma_accept_rate = 1.0/(m_iter+1.0) + m_iter*m_ma_accept_rate/(m_iter+1.0);
m_current_theta = proposed_theta;
m_old_log_prior = m_new_log_prior;
m_old_log_like = m_new_log_like;
}else{
m_ma_accept_rate = 0.0/(m_iter+1.0) + m_iter*m_ma_accept_rate/(m_iter+1.0);
if( std::isnan(m_log_accept_prob) ) {
std::cerr << "accept proability had a nan in it\n";
}
}
}else{ // first iteration
m_old_log_like = m_pool.work(m_current_theta);
m_old_log_prior = log_prior_eval(m_current_theta) + m_current_theta.get_log_jacobian();
}
record_params();
record_messages();
m_iter++;
} // while(m_iter < m_num_mcmc_iters) // every iteration
}
#endif //ADA_PMMH_MVN_H
|
/*
* DO NOT EDIT. THIS FILE IS GENERATED FROM ../../../dist/idl\nsIStreamTransportService.idl
*/
#ifndef __gen_nsIStreamTransportService_h__
#define __gen_nsIStreamTransportService_h__
#ifndef __gen_nsISupports_h__
#include "nsISupports.h"
#endif
/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
class nsITransport; /* forward declaration */
class nsIInputStream; /* forward declaration */
class nsIOutputStream; /* forward declaration */
/* starting interface: nsIStreamTransportService */
#define NS_ISTREAMTRANSPORTSERVICE_IID_STR "5e0adf7d-9785-45c3-a193-04f25a75da8f"
#define NS_ISTREAMTRANSPORTSERVICE_IID \
{0x5e0adf7d, 0x9785, 0x45c3, \
{ 0xa1, 0x93, 0x04, 0xf2, 0x5a, 0x75, 0xda, 0x8f }}
class NS_NO_VTABLE nsIStreamTransportService : public nsISupports {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISTREAMTRANSPORTSERVICE_IID)
/* nsITransport createInputTransport (in nsIInputStream aStream, in long long aStartOffset, in long long aReadLimit, in boolean aCloseWhenDone); */
NS_IMETHOD CreateInputTransport(nsIInputStream *aStream, int64_t aStartOffset, int64_t aReadLimit, bool aCloseWhenDone, nsITransport * *_retval) = 0;
/* nsITransport createOutputTransport (in nsIOutputStream aStream, in long long aStartOffset, in long long aWriteLimit, in boolean aCloseWhenDone); */
NS_IMETHOD CreateOutputTransport(nsIOutputStream *aStream, int64_t aStartOffset, int64_t aWriteLimit, bool aCloseWhenDone, nsITransport * *_retval) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIStreamTransportService, NS_ISTREAMTRANSPORTSERVICE_IID)
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSISTREAMTRANSPORTSERVICE \
NS_IMETHOD CreateInputTransport(nsIInputStream *aStream, int64_t aStartOffset, int64_t aReadLimit, bool aCloseWhenDone, nsITransport * *_retval) override; \
NS_IMETHOD CreateOutputTransport(nsIOutputStream *aStream, int64_t aStartOffset, int64_t aWriteLimit, bool aCloseWhenDone, nsITransport * *_retval) override;
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSISTREAMTRANSPORTSERVICE(_to) \
NS_IMETHOD CreateInputTransport(nsIInputStream *aStream, int64_t aStartOffset, int64_t aReadLimit, bool aCloseWhenDone, nsITransport * *_retval) override { return _to CreateInputTransport(aStream, aStartOffset, aReadLimit, aCloseWhenDone, _retval); } \
NS_IMETHOD CreateOutputTransport(nsIOutputStream *aStream, int64_t aStartOffset, int64_t aWriteLimit, bool aCloseWhenDone, nsITransport * *_retval) override { return _to CreateOutputTransport(aStream, aStartOffset, aWriteLimit, aCloseWhenDone, _retval); }
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSISTREAMTRANSPORTSERVICE(_to) \
NS_IMETHOD CreateInputTransport(nsIInputStream *aStream, int64_t aStartOffset, int64_t aReadLimit, bool aCloseWhenDone, nsITransport * *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->CreateInputTransport(aStream, aStartOffset, aReadLimit, aCloseWhenDone, _retval); } \
NS_IMETHOD CreateOutputTransport(nsIOutputStream *aStream, int64_t aStartOffset, int64_t aWriteLimit, bool aCloseWhenDone, nsITransport * *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->CreateOutputTransport(aStream, aStartOffset, aWriteLimit, aCloseWhenDone, _retval); }
#if 0
/* Use the code below as a template for the implementation class for this interface. */
/* Header file */
class nsStreamTransportService : public nsIStreamTransportService
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISTREAMTRANSPORTSERVICE
nsStreamTransportService();
private:
~nsStreamTransportService();
protected:
/* additional members */
};
/* Implementation file */
NS_IMPL_ISUPPORTS(nsStreamTransportService, nsIStreamTransportService)
nsStreamTransportService::nsStreamTransportService()
{
/* member initializers and constructor code */
}
nsStreamTransportService::~nsStreamTransportService()
{
/* destructor code */
}
/* nsITransport createInputTransport (in nsIInputStream aStream, in long long aStartOffset, in long long aReadLimit, in boolean aCloseWhenDone); */
NS_IMETHODIMP nsStreamTransportService::CreateInputTransport(nsIInputStream *aStream, int64_t aStartOffset, int64_t aReadLimit, bool aCloseWhenDone, nsITransport * *_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* nsITransport createOutputTransport (in nsIOutputStream aStream, in long long aStartOffset, in long long aWriteLimit, in boolean aCloseWhenDone); */
NS_IMETHODIMP nsStreamTransportService::CreateOutputTransport(nsIOutputStream *aStream, int64_t aStartOffset, int64_t aWriteLimit, bool aCloseWhenDone, nsITransport * *_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* End of implementation class template. */
#endif
#endif /* __gen_nsIStreamTransportService_h__ */
|
Cinema Context and the genes of film history Cinema Context (www.cinemacontext.nl) is a website and tool for researching the history of film culture in the Netherlands. It provides basic information about the Who, What, Where and When of film exhibition and distribution, from its origins to the present. At the same time the site allows researchers to analyse the available data and to study patterns and networks, the DNA of film culture. This paper reports on the purpose and structure of this instrument, and demonstrates its analytical powers with a few examples. It will comment on the impact of digitization on film history and how this can contribute to the sharing of knowledge.
|
DEVELOPMENT OF AN AUTOMATED COMBINE GUIDANCE SYSTEM Summary: A machine vision-based automated corn harvester has been developed at the University of Illinois. The automated combine was field tested during 1999. Key modifications to the vehicle included upgrades to the electrical system and the hydraulic system. The basic guidance methodology utilized fuzzy logic to a) determine when to stop processing b) to evaluate image processing results and c) to calculate an overall vehicle steering command. The results from the steering subsystem identification are presented along with a brief description of the harvest results from the 1999 season.
|
THE DEVELOPMENT AND RESEARCH TREND OF USING DSAS TOOL FOR SHORELINE CHANGE ANALYSIS: A SCIENTOMETRIC ANALYSIS The sensitivity of research on shoreline monitoring of coastal erosion is justified due to high density population, climate changes impacts, and intensified development, which are squeezing the ecosystem of coastal zones around the world. The budding fields of optical remote sensing such source medium and high-resolution satellite imagery in conjunction with avenue programming of Digital Shoreline Analysis System (DSAS) are widely used extended tools for analyzing the rate of coastal erosion and deposition. Although, there is a geometric growth in the research published documents in the last decades after the start of DSAS in 1990, but its broad insight into global peer groups, its scientometrics, pattern and trends in research activities in monitoring coastal erosion or shoreline change is missing. To breach this gap, 99 bibliographic records published in the Web of Science core collection for the period of 19942019 were analyzed using the VOSviewer software. Further, the analysis about global insight of research activities using DSAS in shoreline change analysis focused on (i) general scientometric characteristics of published output, (ii) experts in research themes and their cooperation, (iii) publishable journal list, (iv) institutional distribution and international collaboration, and (v) potential hotspot areas. This systematic analysis of the theme, graphically using rigorous scientmetric tools, will help coastal researchers to visualize the current research trends and prospective guideline for future research. The output of the present study will provide a robust road map to early carrier researchers for their advance inquiry in these fields in coming days.
|
Spatial dependence of 2MASS luminosity and mass functions in the old open cluster NGC 188 Luminosity and mass functions in the old open cluster NGC 188 are analysed by means of J and H 2MASS pho- tometry, which provides uniformity and spatial coverage for a proper background subtraction. With an age of about 6-8 Gyr, NGC 188 is expected to be suffering the effects of advanced dynamical evolution. Indeed, previous works in optical bands have suggested the presence of mass segregation. Within the uncertainties, the observed projected radial density profile of NGC 188 departs from the two-parameter King model in two inner regions, which reflects the non-virialized dynamical state and possibly, some degree of non-sphericity in the spatial shape of this old open cluster. Fits with two and three-parameter King models to the radial distribution of stars resulted in a core radius Rcore = 1.3 ± 0.1 pc and a tidal radius Rtidal = 21 ± 4 pc, about twice as large as the visual limiting radius. The concentration parameter c = 1.2 ± 0.1 of NGC 188 makes this open cluster structurally comparable to the loose globular clusters. The present 2MASS analysis resulted in significant slope variations with distance in the mass function (m) ∝ m −(1+), being flat in the central parts ( = 0.6 ± 0.7) and steep in the cluster outskirts ( = 7.2 ± 0.6). The overall mass function has a slope = 1.9 ± 0.7, slightly steeper than a standard Salpeter mass function. In this context, NGC 188 is similar to the 3.2 Gyr, dynamically evolved open cluster M 67. Solar metallicity Padova isochrone fits to the near- infrared colour-magnitude diagram of NGC 188 resulted in an age of 7.0 ± 1.0 Gyr. The best fit, obtained with the 7.1 Gyr isochrone, produced a distance modulus (m − M)0 = 11.1 ± 0.1, E(B − V) = 0.0, and a distance to the Sun d� = 1.66 ± 0.08 kpc. The observed stellar mass (in the range 0.98 M� −1.08 M� ) in NGC 188 is mobs = 380 ± 12 M�. A simple extrapolation of the observed overall mass function to stars with 0.08 Mresulted in a total present mass of mtot ∼ (1.8 ± 0.7) 10 4 M�.O n the other hand, for a more realistic initial mass function which flattens in the low-mass range, the total mass in NGC 188 drops to mtot ∼ (3.8 ± 1.6) 10 3 M�. Since mass-loss processes such as evaporation and tidal stripping have been occurring in this old open cluster for about 7 Gyr, the primordial mass in NGC 188 must have been significantly larger than ∼4 10 3 M�.W e also examined the consequences of the presence of unresolved binaries and concluded that, even if dominant in the CMD, binaries alone are not responsible for the flat central mass function, which supports the mass-segregation scenario.
|
<filename>server/mid/err.go
//
// Go-FTL
//
// Copyright (C) <NAME>, 2014-2016
//
// Do not remove the following lines - used in auto-update.
// Version: 0.5.9
// BuildNo: 1811
// FileId: 1197
//
package mid
import "errors"
var FtlConfigError = errors.New("Invalid type supplied to configuration function")
var ErrNonMidBufferWriter = errors.New("Invalid type - needs to be a goftlmux.MidBuffer")
var ErrInvalidConfiguration = errors.New("Invalid Configuration")
var ErrInternalError = errors.New("Internal Error")
var ErrMuxError = errors.New("Mux reported an error")
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from telegram.ext import Updater, CommandHandler, Filters, InlineQueryHandler
from tkuosc_bot.commands.basic import help_, start
from tkuosc_bot.commands.conversations.flow import check_in_handler, payment_handler, got_drinks_handler, \
checkout_handler
from tkuosc_bot.commands.conversations.meet import create_meet_handler, confirm_button, close_button, end_order
from tkuosc_bot.commands.conversations.order import start_order
from tkuosc_bot.commands.debug import getcid, getmid, error, adding_admin, power_of_king
def main(token, webhook_url_path):
updater = Updater(token, workers=64)
# under develop instruction
# updater.dispatcher.add_handler(CommandHandler('test', test, pass_job_queue=True))
# Basic commands
updater.dispatcher.add_handler(CommandHandler('start', start, Filters.private, pass_args=True))
updater.dispatcher.add_handler(CommandHandler('help', help_))
# Create meet up conversation
updater.dispatcher.add_handler(create_meet_handler)
# No more drinks ordering
updater.dispatcher.add_handler(confirm_button)
updater.dispatcher.add_handler(end_order)
updater.dispatcher.add_handler(close_button)
# Ordering conversation
updater.dispatcher.add_handler(start_order)
# The flow of getting drinks
updater.dispatcher.add_handler(check_in_handler)
updater.dispatcher.add_handler(payment_handler)
updater.dispatcher.add_handler(got_drinks_handler)
updater.dispatcher.add_handler(checkout_handler)
# Debug commands
# updater.dispatcher.add_handler(CommandHandler('getme', getme))
updater.dispatcher.add_handler(CommandHandler('getcid', getcid))
updater.dispatcher.add_handler(CommandHandler('getmid', getmid))
# The method of adding admin
updater.dispatcher.add_handler(InlineQueryHandler(power_of_king))
updater.dispatcher.add_handler(adding_admin)
# updater.dispatcher.add_handler(CommandHandler('user_data', user_data_, pass_user_data=True))
# updater.dispatcher.add_handler(CommandHandler('chat_data', chat_data_, pass_chat_data=True))
# updater.dispatcher.add_handler(CommandHandler('chat_member', chat_member))
# updater.dispatcher.add_handler(CommandHandler('user', user))
# Admin commands
# updater.dispatcher.add_handler(CommandHandler('lsop', lsop))
# updater.dispatcher.add_handler(CommandHandler('addop', addop, pass_args=True))
# updater.dispatcher.add_handler(CommandHandler('deop', deop, pass_args=True))
# Error handler, must at the end
updater.dispatcher.add_error_handler(error)
# Start the Bot
updater.start_webhook(listen='127.0.0.1',
port=9900,
url_path=webhook_url_path)
updater.bot.set_webhook(webhook_url=f'https://bot.allen0099.io/{webhook_url_path}')
# Run the bot until the user presses Ctrl-C or the process receives SIGINT,
# SIGTERM or SIGABRT
updater.idle()
if __name__ == '__main__':
import os
TOKEN = os.environ.get('TOKEN', False) or input(
'It seems like you don\'t have environment variable `TOKEN`.\nPlease enter it below:\n')
# TODO hide the input TOKEN
webhook_url_path = os.environ.get('RAND_PATH', False)
if TOKEN and webhook_url_path:
main(TOKEN, webhook_url_path)
|
Hairy Cell Leukemia: An Ultrastructural Study of Hairy Cells before and after Interferon Therapy Aims and background To test the diagnostic relevance of the presence of ribosome-lamellae complexes (RLC) in 18 hairy cell leukemia (HCL) cases, and to correlate clinical response to interferon (IFN) therapy with hairy cell ultrastructural modifications in 5 of these cases. Methods Peripheral blood samples of 18 HCL patients were studied by transmission electron microscopy. Five of these patients received IFN treatment and subsequently were evaluated at different intervals for ultrastructural modifications of the peripheral blood. Results RLC were observed in 66.66% of our 18 HCL patients, but in less than 1% of all the cases contained in the files (consisting of over 8,000 cases) of our Electron Microscopy Unit. The microvilli disappeared after IFN therapy in the patients who did not display RLC before therapy (2 cases), whereas they were fewer, shortened and blunted, but still evident, in the cases where RLC had been observed before therapy (3 cases). Moreover, in the HCL cases with pre-therapy RLC, neoplastic cells still synthesized RLC after IFN treatment, but their morphologic aspect was immature. Conclusions Our study suggests that: 1) the presence of RLC, when associated to the hairy aspect of the cells, has considerable diagnostic value even though RLC are observed in other rare neoplastic and non-neoplastic conditions; 2) HCL cases with pre-therapy RLC exhibited a morphologic response to IFN therapy different from that of cases without pre-therapy RLC; 3) the quantitative and qualitative modifications of RLC following IFN treatment, as yet unexplained, are probably related to IFN action, in line with a previous report.
|
Planar cyclotron motion in unidirectional superlattices defined by strong magnetic and electric fields: Traces of classical orbits in the energy spectrum We compare the quantum and the classical description of the two-dimensional motion of electrons subjected to a perpendicular magnetic field and a one-dimensional lateral superlattice defined by spatially periodic magnetic and electric fields of large amplitudes. We explain in detail the complicated energy spectra, consisting of superimposed branches of strong and of weak dispersion, by the correspondence between the respective eigenstates and the ``channeled'' and ``drifting'' orbits of the classical description. I. INTRODUCTION In the last decade there has been a constant interest in the transport properties of the periodically modulated two dimensional electron gas (2DEG). In particular, in the presence of a lateral modulation of a onedimensional character the resistivity may be strongly anisotropic, which essentially reflects the anisotropy of the electronic states. Two types of modulations can be achieved in the experimental devices: electrostatic potential modulations 1-4 and, more recently, magnetic field modulations. Weak modulations of both types lead already to pronounced magnetoresistance effects in the presence of an average magnetic field B 0 applied perpendicular to the 2DEG. These effects occur at low and intermediate B 0 values, well below the magnetic quantum regime where Shubnikov-de Haas oscillations appear. At very small values of B 0 a pronounced positive magnetoresistance is observed, followed at intermediate B 0 values by the "Weiss oscillations" due to commensurability effects. Both effects are adequately understood within a classical transport calculation based on Boltzmann's equation, and can be traced back to the predominance of different types of classical trajectories. The positive magnetoresistance is understood as caused by "channeled orbits" which exist if the modulation is sufficiently strong or, equivalently, the average magnetic field is sufficiently small. For electric modulation they occur near the minima of the modulation potential ("open" orbits 10 ), and for magnetic modulation near the lines of vanishing total magnetic field ("snake" orbits 12 ). They are always confined within a single period of the modulation, which we choose in x direction. They are wavy trajectories allowing for fast motion of electrons with velocities within small angles around the direction of translational invariance (y direction). These channeled orbits occur in addition to the "drifting orbits", which are self-intersecting trajectories with loops (along each of which the direction of the velocity changes by 2), so that usually a low drift velocity in y direction results. For sufficiently small B 0, drifting orbits may extend over many periods of the modulation. At sufficiently large B 0 (sufficiently small modulation amplitudes) only the drifting orbits survive. The "Weiss oscillations" manifest a commensurability effect depending on the ratio of the extent of drifting orbits (at the Fermi energy) and the modulation period. With increasing modulation strength, the positive magnetoresistance becomes more pronounced and extends to larger B 0 values, suppressing progressively the low-B 0 Weiss oscillations. 10 This effect is well understood within the classical calculation 11, if both types of trajectories are adequately included, and it has recently also been obtained by a quantum calculation for a strong modulation 13. A qualitatively new type of magnetoresistance effect has recently been observed by Ye et al. 14 on samples with an extremely strong magnetic modulation. Samples with a surface array of ferromagnetic micro-strips were measured in tilted magnetic fields, so that the applied magnetic field had a large component parallel to the surface, producing a large magnetization of the ferromagnetic strips, while only the small perpendicular component determined the average magnetic field B 0 in the 2DEG. In this way a huge positive magnetoresistance with superimposed Shubnikov-de Haas like oscillations was obtained at low values of the average magnetic field, at which no magnetic quantum effects should be expected for weak modulation. 14 It rather seems that the quantum oscillations are induced by the large-amplitude periodic magnetic modulation field. Such conditions require a quantum transport theory and, as a first step, the understanding of the quantum electronic states of a 2DEG with a strong magnetic modulation. This is the motivation of the present work. Channeled and drifting quantum states in linearly varying magnetic field are already discussed by other authors. 12,15 The Schrdinger equation for periodic magnetic fields alternating in sign, has been solved previously, but only for the case when the average field is zero 16. In the present paper we shall study the quantum electronic states in strong periodic magnetic fields with a non-vanishing average, and compare it with the case of a strong electric modulation. In both situations, rather complicated energy spectra are obtained, with striking qualitative similarities and quantitative differences. For the case of strong electric modulation, such a complicated energy spectrum has recently been published 13, but without an attempt of an explanation. We will demonstrate in this paper that a close comparison with classical motion leads to a detailed and intuitive understanding of these spectra and the corresponding eigenstates. In Sec. II we start with some general remarks on the relation between quantum and classical description of the 2D electron motion in 1D lateral superlattices, and we introduce suitable reduced units. In Sec. III we focus on the effect of a simple harmonic magnetic modulation of arbitrary strength. In Sec. IV we include an electric modulation, which requires a somewhat different analytical procedure. The inclusion of electric modulation seems also necessary from the experimental point of view, since the ferromagnetic strips on the sample surface introduce a periodic stress field in the sample, which acts as an electric modulation on the 2DEG. Finally, in Sec. V we summarize the essential features derived in the paper and extend the discussion beyond the model of simple harmonic modulations. Some of the present results have been recently published in a preliminary form. 17 II. GENERAL REMARKS We consider a (non-interacting) 2DES in the x-y plane subjected to a magnetic field with z component B z (x) = B 0 + B m (x) and an electrostatic field in x direction leading to a potential energy U (x). Our aim is a close comparison of the classical and the quantum description of the electron motion (in terms of orbits and wavefunctions, respectively) in such fields, especially in the case that U (x) and B m (x) are periodic in x with the same period a and vanishing average values. To evidence the translation invariance in y direction in the (either classical or quantum) Hamiltonian we describe B z (x) by an x-dependent vector potential. Then y is a cyclic variable and the canonical momentum p y is conserved, and one obtains an (onedimensional) effective Hamiltonian H(X 0 ) = p 2 x /2m + V (x; X 0 ). For B 0 = 0, the effective potential can be written where X 0 = −p y /eB 0 is the center coordinate of the effective potential and 0 = eB 0 /m is the cyclotron frequency, both in the absence of modulation. In the quantum description, the reduction to a onedimensional problem is achieved by the product ansatz n,X0 (x, y) = L −1/2 y exp(ip y y/h) n,X0 (x) for the energy eigenfunctions, where L y is a normalization length, and the discrete quantum number n = 0, 1, 2,... counts the nodes of the reduced wavefunction n,X0 (x). If U (x) and A m (x) are bounded, the n,X0 (x) drop Gaussian-like for |x| → ∞, and for a fixed value of the quasi-continuous quantum number X 0 the energy spectrum E n (X 0 ) is discrete. In the classical description, we use the equation mv y = p y +eA(x), which may also be derived directly from Newton's equation, to eliminate the velocity v y. The effective motion in x direction is determined by H(X 0 ) = E. Similar to the wavefunctions, the orbits for given constants of motion, X 0 and E, are bounded in x direction, however the energy E is a continuous variable. For a given E = E F, each position x (with U (x) < E F ) is the turning point of two orbits which are characterized by the center coordinates 11 Here R 0 = v F / 0 is the cyclotron radius of electrons moving with energy E F = mv 2 F /2 in the magnetic field B 0. For given E F and X 0, orbits exist in intervals in which This allows a convenient classification of the possible orbits at fixed energy E F and for varying X 0. 11 Of course, the same classification can also be done by directly investigating the effective potential. This may be preferred if one is interested in orbits at different energies but the same X 0. The calculation of the orbits is a simple textbook problem, but must in general be done numerically. In accordance with the translational symmetry of the problem, we will in the following not distinguish orbits which differ only by a rigid shift in y direction. If an electron is at time t i at position (x i, y i ) on an orbit characterized by the constants of motion E F and X 0, with turning points x l and x r (x l < x i < x r ), it moves towards one of the turning points so that at time it is at position (x, y(x; X 0, E F )), with where |v ]. If at one of the turning points x l or x r, where v x (x; X 0, E F ) = 0, the derivative ∂V (x; X 0 )/∂x vanishes, we call this turning point and this orbit "critical". At critical turning points the integrals and diverge, so that the critical orbits there asymptotically approach straight lines parallel to the y axis. For non-critical orbits the integrals and converge as x approaches the turning points, and the total orbit can be composed out of rightrunning (v x > 0) and left-running (v x < 0) pieces with finite traverse time T (X 0, E F ) = xr x l dx/|v x (x; X 0, E F )|. The probability density of finding the electron at position. This is the classical analog to | n,X0 (x)| 2. If U (x) = U (x + a) and B m (x) = B m (x + a) are periodic with period a, as we will assume in the following, the effective potential, Eq., has the symmetry V (x + a; X 0 + a) = V (x; X 0 ). As a consequence, the energy spectrum is also periodic, E n (X 0 + a) = E n (X 0 ), and can be restricted to the "first Brillouin zone" 0 ≤ X 0 ≤ a. The eigenfunctions can be taken to satisfy n,X0+a (x) = n,X0 (x − a). The corresponding classical symmetry is that an orbit characterized by E F and X 0 + a differs from that characterized by E F and X 0 only by a rigid shift of amount a in x direction. The dispersion of the energy bands E n (X 0 ) implies a group velocity in y direction, n, X 0 |v y |n, which is the expectation value of the velocity operator in the energy eigenstate n,X0. It is the quantum equivalent to the classical drift velocity, i.e. the average velocity (in y direction) along the corresponding classical orbit. The drift velocity in x direction vanishes, since the orbits are bounded in x direction. A. Suitable units For an economic comparison of classical and quantum aspects it is important to use suitable length and energy units, which are meaningful for both the quantum description and the classical limit. Doing so, we will see that the classical features depend on fewer scaled parameters than the quantum ones. To be specific but still rather general, we assume in the following periodic modulations of the form B m (x) = B 0 m b(Kx) and U (x) = V 0 u(Kx) for the magnetic and the electric modulation, respectively, where b() and u() are dimensionless periodic functions with period 2 and vanishing average values. Thus B m (x) and U (x) have the same period a = 2/K, but may have different shapes and phases. In the numerical examples we will use for both b() and u() simple cosines, eventually with a phase shift. The average magnetic field B 0 sets, with the magnetic length l 0 = h/(m 0 ) and the cyclotron energyh 0, both a length and an energy scale, which are useful for quantum calculations, but have no meaning for the classical motion. For the discussion of commensurability effects, such as the Weiss oscillations, the cyclotron orbits must be compared with the period a of the modulation. Therefore a is a natural choice for the lengths unit. The choice of a suitable energy unit is motivated as follows. Classically, B 0 determines only the cyclotron frequency 0, and one needs an independent length l to define an energy scale V mag = m 2 0 l 2 /2. Using l as length unit, we may define dimensionless variables = x/l and 0 = X 0 /l. The effective potential, Eq., then can be written as V (x; where, and w = V 0 /V mag. In the quantum description, the kinetic energy operator −(h 2 /2m)d 2 /dx 2 = −E l d 2 /d 2, introduces a new energy scale E l =h 2 /(2ml 2 ), which has no classical analog. Introducing the energy ratio = E l /V mag, we write the effective Schrdinger equation as with n ( 0 ) = E n (X 0 )/V mag and n,0 () = √ l n,X0 (x). If we would take l = l 0, we had V mag = E l =h 0 /2 and thus simply = 1. The effective potential Eq. would then depend on the constant of motion 0 and, in addition, on three dimensionless model parameters, s, w, and Kl 0. To specify an eigenstate or, in the classical description, a trajectory, one further needs an energy value as a second constant of motion. A description that, for fixed constants of motion, needs three parameters to specify the effective potential and, furthermore, relies on l 0 andh 0, which have no meaning in classical mechanics, is rather clumsy and not acceptable. Instead we take l = 1/K and, therefore, V mag = V cyc, where V cyc = m 2 0 /(2K 2 ) is the energy of a classical cyclotron orbit of radius 1/K in the homogeneous magnetic field B 0. Now the effective potential Eq. depends only on the two dimensionless modulation strengths s and w = V 0 /V cyc, which both are well defined within the classical approach. Also the constants of motion, 0 = KX 0 and = E/V cyc = (KR 0 ) 2, including the dimensionless version of Eq., remain meaningful in the classical limit. This choice of units will also be very useful for a systematic discussion of the quantum mechanical energy spectra. Quantum mechanics enters the effective Schrdinger equation only via the parameter = (l 0 K) 4, which scales the kinetic energy. It determines the only true quantum aspect of the spectrum, namely the spacing of the energy levels n ( 0 ). We will see in Sec. III B that all the essential structural features of the energy spectrum, e.g. the complicated back-folded structure due to the coexistence of "channeled" and "drifting" states, are determined solely by the "classical" parameters s and w. The density of the quantized levels n ( 0 ), on the other hand, increases with increasing ratio a/l 0. As a simple example one may consider the well known case of a weak electric or magnetic cosine modulation, which leads to modified Landau bands of oscillatory width. 2,4,18,19 The band width assumes minima near the "flat band" energies E ± = m( 0 a) 2 ( ± 1/4)/8, with "+" ("−") for magnetic (electric) modulation and = 1, 2,.... These flat band energies are distinct multiples of our energy unit V cyc, and occur at ± = 2 ( ± 1/4), independent of the special values of the model parameters B 0 and a. The level spacing, on the other hand, is of the orderh 0 and depends in our units onh III. MAGNETIC COSINE MODULATION We first consider a pure magnetic modulation, For s = 0 one obtains the well known Landau levels and the Landau oscillator wave functions, f nX0 (x). We use the set f nX0 as the basis of our Hilbert space in order to obtain numerical solutions for s = 0, by numerical diagonalization of H(X 0 ). The electron effective mass is that of GaAs, m = 0.067m 0. We further assume spin degeneracy. For the numerical parameters chosen here the size of the basis will vary between 150-300 Landau levels. Before discussing the numerical results we summarize some properties of the effective potential and of Eq., which now reduces to For a fixed 0 the local extrema of the effective potential, given by ∂V (, 0 )/∂ = 0, are the points where the total magnetic field is zero, i. e. the roots of and the points where the effective potential is zero, i. e. the roots of An important aspect for the following discussion is that the roots of the first kind, Eq., if existent, are independent of 0, while those of the second kind, Eq., do depend on 0. We will see that orbits with values near roots of the first kind are channeled, while those with values near roots of the second kind are drifting orbits. The analytic dependence of the effective potential on the relevant position coordinate is determined by the modulation strength s. Therefore the number of its possible zeroes, the classification of orbits and the energy spectrum depend critically on the parameter s. To demonstrate this, we choose in the following examples b() = cos, and consequently a() = sin. A. Weak modulation, s ≤ 1 For s < 1, the effective potential has exactly one minimum of the second kind for each value 0, which is due to the confinement by the average magnetic field. The functions ± 0 () in equation have no extrema. For each value 0 they determine exactly one orbit, which is a drifting cyclotron orbit. By this we mean a selfintersecting orbit consisting of loops along each of which the azimuth angle in velocity space, = arctan(v y /v x ) increases by 2. A typical example is illustrated in Fig. 1 for s = 0.5, 0 = /2 (i.e. X 0 = a/4), and two energy values E F. Figure 1(a) shows the effective potential. For a given energy Figure 1(b) shows the location of the turning points as the crossing points of the horizontal line 0 = /2 with the functions ± 0 (). The corresponding drifting orbit exists in the interval with The orbits in real space are illustrated in Fig. 1(c). In Fig. 2 we plot the corresponding quantities for s = 0.5 and 0 = (i.e. X 0 = a/2). In this case the effective potential is symmetric with respect to the center coordinate X 0. As a consequence, the orbits are closed and their drift velocity in y direction is zero. For small energies, E F /V cyc = (KR 0 ) 2 < 2 (i.e. 2R 0 < a), the extents of the orbits in x direction are smaller than a modulation period and essentially determined by the local values of the total magnetic field. At high energies, E F /V cyc ≫ 1, the orbits extend over several periods of the modulation and the extent of an orbit, i.e., the width of the effective potential valley at the corresponding energy, is determined by the cyclotron radius in the average magnetic field (x r − x l ≈ 2R 0 ). In Fig. 3(a) we display the first 50 energy bands E n0 calculated from the (first 150) original, degenerated Landau levels, for s=0.5. The level spacing of the lowest energy bands is seen to follow the local value of the total magnetic field, Fig. 3(b). This is expected from the local approximation E n0 ≈ (n + 1/2)heB( 0 )/m, which is valid if the extent of the wavefunctions n,X0 (x) is smaller than the modulation period. With our energy unit V cyc the apparent level spacing of energies which are independent of the period a becomes proportional to √. For example, if the local approximation E n0 ≈ (n + 1/2)h( 0 ) holds for E n0 < 4V cyc, as in Fig. 3(a), this implies that it holds for n + 1 Thus, the number of bands which are well described by the local approximation increases quadratically with increasing modulation period a. The local approximation fails at higher energies when the width of the wavefunctions becomes larger than the period of the modulation, and the structure of the energy spectrum changes. Indeed it is well known from the limit of very weak magnetic modulation, s ≪ 1, that in contrast to this local approximation the bands become flat at the energies E /V cyc = 2 ( + 1/4), for = 1, 2,.... 18,19,6 These flat band conditions are the quantum equivalents to the classical commensurability conditions leading to the Weiss oscillations in magnetotransport, and do not change their positions in a plot like Fig. 3(a), even if we change the modulation period. A larger modulation period a just leads to a higher density of the energy bands. In Fig. 3(c) we plot for 0 = /2 the effective potential and the square of the energy eigenfunctions for the energy values considered in Fig. 1. Width and location of the wavefunctions in the effective potential is in close agreement with that of the corresponding classical orbits. In Fig. 3(d) we plot the corresponding quantities for the symmetric situation 0 =, to be compared with Fig. 2. These wavefunctions belong to (relative) extrema of the energy bands, and thus have zero group velocity, in agreement with the zero drift velocity of the corresponding classical orbits. The wavefunctions in Fig. 3(c) belong to finite energy dispersion and describe motion in the positive (n=3) and the negative (n=43) y direction, respectively, in agreement with the correponding classical orbits in Fig. 1. For large quantum numbers n and weak modulation the group velocities can be shown to reduce quantitatively to the drift velocities of the corresponding classical orbits. In Fig. 4 we consider the "critical" situation s = 1. The derivatives ± 0 ( ex ) = 0 and ± 0 ( ex ) = 0 vanish for ex = (2p + 1) (p integer), i.e. for the positions where the magnetic field vanishes, Eq.. For all values of 0 the effective potential becomes flat at these points ex (see Fig. 4(c)). The classical situation is as for s < 1 with the exception that for 0 = ex ± KR 0 there are "critical" orbits which asymptotically approach straight lines parallel to the y axis on their left (for +) or their right (for −) side, where B(x) = 0. The dashed lines plotted over the energy spectrum of Fig. 4(a) show the evolution of the flat regions of the effective potential with 0, i.e. the parabolas resulting from V ( ex ; 0 ) with p = 0 and p = ±1. In the first Brillouin zone these lines are seen as the back-folding of the lowest parabola centered on ex with p = 0, and they are an indication of a kind of a free electron motion along the lines where the magnetic field is zero. Close to these parabolas the energy bands have large dispersion near inflexion points, and the energy separation between adjacent bands is minimum. Similar features have been obtained in the energy spectra for single magnetic wells by Peeters and Matulis. 20 In other words, such states experience a weak effective magnetic field, due to the constant effective potential over a substantial spatial region. The wavefunctions corresponding to states with large energy dispersion have large amplitudes at the positions of flat effective potential (vanishing total magnetic field). This is demonstrated for two selected states in Fig. 4(b), together with the probability distributions of the corresponding classical orbits. The effective potentials together with the corresponding classical orbits are plotted in Fig. 4(c). The trajectory corresponding to the state (n=5, 0 =0.50) is close to a critical orbit with a critical right turning point. This leads to an enhanced probability density near that point, which is also reflected in the quantum mechanical probability density. We will see that for slightly stronger modulation a new type of nearly free motion occurs with energies close to the parabolas V ( ex ; 0 ) in the energy spectrum. In Fig. 5 we show, for s = 2 , an example where the effective potential has a single zero near /2 = 0.1, so that for sufficiently low energy only a single drifting orbit exists. The number and the type of the possible orbits depend on the energy. At the highest energy shown in Fig. 5(a) two orbits exist (solid lines in Fig. 5(d)). There is a drifting cyclotron orbit extending over more than two periods of the modulation, with the left turning point on + 0 () (uppermost curve in Fig. 5(c)) near /2 = −1.1, and the right turning point on − 0 () (bottom curve in Fig. 5(c)) near /2 = 1.3. Near the relative minimum of − 0 () close to /2 = 1.7, which corresponds to a relative minimum of the effective potential (thick dashed line in Fig. 5(a)), there exists a "channeled orbit" moving in positive y direction. We define channeled orbits as trajectories which have both turning points either on + 0 () or on − 0 (), in contrast to the drifting orbits with one turning point on + 0 () and the other on − 0 (). In contrast to the self-intersecting drifting orbits, the channeled orbits are always confined to less than a single modulation period, and they move without self-intersections in a relatively narrow interval of angles around the positive or the negative y direction . Note that the curvature of the trajectories changes sign at the positions where the total magnetic field vanishes, see Fig. 5(b). If we lower the energy to E/V cyc = 40, we arrive in Fig. 5 at a situation where only a single drifting orbit exists (dashed lines). In general, the extent in direction of the drifting orbits decreases with decreasing energy. At the lowest energy indicated in Fig. 5 (lowest dotted line in (a) and innermost lines in (c)), we have again a drifting orbit near /2 = 0.1 and a channeled orbit around /2 = 0.6. At this low energy, the extent of the drifting orbit is considerably smaller than the modulation period. In Fig. 6 we show, for the same modulation strength, s = 2, a situation, 0 =, where the effective potential has three zeroes, as is emphasized in the inset of Fig. 6(a). These zeroes are separated by two shallow maxima. If a (positive) E value below these maxima is chosen, one finds three narrow drifting cyclotron orbits located around the zeroes of the effective potential (solid lines). For higher energies one may find either one drifting and two channeled orbits (dotted lines) or a single drifting orbit (e.g. for 0.5 < E/V cyc < 30, not indicated in the figure). Actually the "drifting" orbits located around = have zero drift velocity due to symmetry reasons. In summary, for 0 < g(s) < we find for given values of the constants of motion, 0 and E, at least one and at most three orbits. For larger values of s = B 0 m /B 0, more orbits may exist for a given pair of 0 and E values. A careful analysis of the extrema of the functions ± 0 () shows, e.g., that for < g(s) < 2 between three and five orbits belong to the same pair of 0 and E. We will come back to this case below. Apparently the plots of the effective potential V (; 0 ) are very useful to see which orbits are possible for a fixed value of the center coordinate 0 and different energies. Channeled orbits exist in side valleys near relative minima of V (; 0 ). If, on the other hand, the energy of the motion is given, the plots of the locations of turning points ± 0 () is very useful to classify the possible orbits for different values of 0. Channeled orbits exist near relative minima of − 0 () and relative maxima of + 0 (). Quantum calculation The energy spectra become more complicated in the case s > 1, Fig. 7 and 8. Regions of different character can be distinguished in these spectra. Areas, where the energy bands are nearly parallel lines with low dispersion (region I), alternate with regions, where steep bands with large dispersion seem to cross bands with weak dispersion (region II). In fact the energy bands never cross each other and the apparent intersections are anti-crossing points with exponetially small gaps. The boundaries of these regions are given by classical values only. If the energy is scaled by the classical cyclotron energy V cyc, for fixed modulation strength s the regions II are surrounded by the parabolas E = V ( (p) min ; 0 ) and E = V ( (p) max ; 0 ) which, for | p |≤ 2, are indicated by dashed lines in the spectra. For any fixed 0 such a pair of parabolas gives the minimum and the maximum value of a certain side valley of the effective potential V (; 0 ) (extrema of the first kind, see Eq. ). The energy interval in between these values indicates the depth of that valley, i.e. an energy range in which classically channeled orbits exist, in addition to the drifting orbits. In Fig. 7(b) the effective potential is plotted for the symmetric case 0 = (dotted line), corresponding to the classical situation described in Fig. 6. Also shown are the states for n = 0 (lower solid line) and for n = 20 (upper solid line) and n = 22 (upper dashed line). Apparently, state n = 20 corresponds to a classical drifting orbit, whereas n = 22 is the symmetric superposition of two states corresponding to channeled orbits in the side valleys. The latter has practically the same energy as the corresponding antisymmetric superposition (n = 21), which is not shown. On the scale of Fig. 7(a), all states n = 20, 21, and 22 seem to have the same energy, E/V cyc ≈ 38. The states n = 21 and 22 are hybridizations of states belonging to the branches with high energy dispersion and opposite sign of the group velocity Figure 7(c) shows the effective potential for the asymmetric case 0 /2 = 0.2, corresponding to the classical situation described in Fig. 5. Here we show six states, the ground state n = 0 located near the zero of the effective potential, the two "channeled" states "bound" in the potential valley around /2 = 0.6, the extended "drifting" state n = 25 near E = 40V cyc, the extended state n = 44, and the localized "channeled" state n = 45. The energies of all these states are indicated in Fig.7(a). The states which extend over more than a period of the modulation belong to weakly dispersive energy bands and correspond to the classical drifting orbits. The states belonging to the energy branches with strong dispersion have large amplitudes in side valleys of the effective potential and vanish practically outside these valleys. They correspond to classical channeled orbits. The apparent number of nodes of the large-amplitude parts of these "channeled" states increases with energy as if they were truly bound states in these narrow valleys. Note, however, that the wave functions of channeled states still have n nodes, but the corresponding oscillations are not observable at the scale of the figure. Outside the valleys, the maxima in between the nodes are a few orders of magnitude smaller than the main peaks inside the valleys. The number of quantized states within a given valley of the effective potential depends on the average magnetic field and the period of the magnetic modulation, even if the parameters V cyc and s are fixed. In Fig.7 the period a, or the field B 0, is too small to have states quantized in the low-energy triple minimum of the effective potential for the symmetric case of Fig.7(b) (see also Fig.6). To investigate this situation, we show in Fig.8(a) a denser spectrum for the same modulations strength s = 2. In Fig.8(b) the spectrum near 0 = is enlarged. Five energy values are indicated, and in Fig.8(c) the corresponding (squares of the) wavefunctions are plotted for the states n = 0, 2, 3, 4, and 5, together with the effective potential. The antisymmetric state n = 1, which is nearly degenerate with n = 2, is not shown. This demonstrates that all the classical features have their quantum analog, provided the model parameters (here ) are suitably chosen. For the magnetic cosine modulation, the depth of the valleys of the effective potential, increases with the energy (i.e. with |p| for fixed 0 ), and thus more and more channeled states appear at higher energies. For sufficiently high energies the strips with channeled states in the energy spectra may thus extend over the whole Brillouin zone. This will also happen for sufficiently large s. The energy dispersion of the channeled states depends strongly, nearly quadratically, on 0 according to Eq., which expresses the nearly free motion of the electrons on channeled orbits in y direction. For s > 1 and g(s) <, the area of the regions II of the spectrum increases with increasing s, and the area of the regions I shrinks accordingly. For g(s) =, one has V ( max ; 0 ) and the corresponding parabolas coincide, leaving no room for regions I. If the modulation is so large that g(s) ≥, drifting and channeled states coexist everywhere in the spectrum. In Fig. 9 we have chosen s = 5, corresponding to g(s) = 3.53. Close to the edges of the Brillouin zone, e.g. for 0 /2 = 0.016, Fig. 9(c), we can identify channeled, e.g. n = 22 and n = 16, and drifting states, e.g. n = 19. But now these drifting states are relatively narrow, confined in local minima of the effective potential and not in the wide potential well centered around 0, which is given by the confinement due to the average magnetic field. This case is already known from the discussion of Fig. 6. The local minimum of the effective potential at = 0 is a minimum of the second kind, with vanishing potential. Consequently, these drifting states are similar to weakly perturbed Landau levels with energy gapsheB( 0 )/m, as can be observed by a careful look at Fig. 9(a). In the center of the Brillouin zone say for 0 /2 = 0.493, Fig. 9(d), the effective potential has three zeroes of the second kind (see Eq.) near = 0. We therefore can find similar narrow drifting states, like n = 5 and n = 6, but also wide drifting states at higher energies, like n = 17 and channeled states in local minima of first kind, like n = 7. As in the classical picture, the velocity of these narrow drifting states is in general lower than that of the channeled states. IV. MIXED HARMONIC MODULATIONS For sufficiently strong mixed electric and magnetic modulations one expects a similar situation as for the strong magnetic modulation, with a coexistence of channeled and drifting orbits, and their quantum analogs. In the presence of an electric modulation, we have no explicit analytic expressions for the minima of the effective potential, Eq., not even for simply harmonic modulations. Nevertheless, a qualitative understanding of the classical and the corresponding quantum mechanical motion is possible. For a given constant of motion 0 the effective potential has side valleys with possible channeled orbits, if ∂V (; 0 )/∂ = 0 has more than one solution. This is the case, if the function with w = V 0 /V cyc, assumes the value 0 () = 0 at more than one value. At such values the effective potential has extrema with the values To be specific, we choose for the following b() = cos, a() = sin and u() = cos( + s ). Apparently, Eqs. and provide a parametric representation of the possible relative extrema of the effective potential in the energy-versus- 0 diagram, similar to the dashed lines in Figs. 7 and 8 which define the regions II where "channeled" states coexist with "drifting" ones. Due to the symmetries 0 ( + 2) = 0 () + 2 and V ( + 2; 0 ( + 2)) = V (; 0 ()), it is sufficient to consider only one period 0 ≤ ≤ 2 of the parameter, provided the 0 () values are back-folded into the first Brillouin zone. For strong magnetic modulation (s > 1) the denominators in Eqs. and lead to poles. Then the regions of type II extend to arbitrary high energies, similar to the case of pure magnetic modulation. A qualitatively different behavior is obtained for weak magnetic, but arbitrarily strong electric modulation, since then the denominators of Eqs. and remain positive (for s < 1). Consequently, for given values of w, s, and s the possible values of V (; 0 ()), Eq., are bound and channeled orbits can exist only below a certain energy. A. Pure electric modulation As a particularly simple example we consider a pure electric cosine modulation, s = 0, s = 0. For weak modulation (w < 2) the function 0 () of Eq. has a unique inverse, i.e. the effective potential V (; 0 ) has for all values of 0 only a single extremum, namely the absolute minimum, and no "channeled" states should be expected. The energy spectra for this weak-modulation limit are well known 2,3,13 and will not be reproduced here. Apart from a phase shift, they look similar to Fig. 3(a) but with flat bands near E/V cyc = 2 ( − 1/4), for = 1, 2,.... The corresponding classical trajectories at sufficiently high energies are drifting cyclotron orbits. At very low energies, E < V 0 = wV cyc, a peculiarity occurs, since then the classical trajectories are captured within a single valley of the electric potential, with turning points given by Eq. in the interval c ≤ ≤ 2 − c (modulo 2) with c = arccos(E/V 0 ) > 0. For 0 values in the interval c < 0 < 2 − c these trajectories are self-intersecting drifting orbits, whereas for 0 < c and 0 > 2 − c there exist channeled orbits with v y > 0 and v y < 0, respectively. The orbit with 0 = c approaches the left turning point at = c with a tangent parallel to the x axis, and that with 0 = 2 − c does the same at the right turning point = 2 − c. This peculiar low-energy behavior is, of course, not restricted to the weak modulation limit, but occurs always when the trajectories are captured in a minimum of the electric potential, i.e. for E < V 0. It is demonstrated in Fig. 10(b), and will not be discussed further. In previous work 10, 11 it was pointed out that, for given modulation period a and strength V 0 and given energy E = E F, channeled orbits can exist only if the magnetic field B 0 is smaller than a critical field B crit. Solving E F /V cyc = 1 + w 2 /4 for E F > V 0 = wV cyc and w > 2 with respect to the magnetic field, one obtains the known result 11 B. Weak magnetic modulation If a magnetic modulation is added to an electric one, very complicated interference effects may result. Only if the phase shift s is zero or, the resulting energy spectrum will be symmetric in 0. Even in that case, the distribution of channeled states (regions II) in the E- 0 diagram may become rather complicated, especially at low energies. For the mixed case channeled states may occur even if the modulation parameters w and s are not large enough to produce them for the pure electric and the pure magnetic modulation of these strengths. For weak magnetic modulation, 0 < s < 1, and arbitrary strength of the electric modulation, channeled states can exist only below a certain energy, as in the pure electric modulation case. For arbitrary phase shift s the energy spectrum may be so asymmetric that in a certain energy range only channeled orbits exist which carry current in one (say the positive y-) direction, but no channeled orbits carrying current in the opposite direction. Such a situation is presented in Fig. 11. The regions II, where channeled and drifting states coexist, is again calculated from Eqs. and, i.e. from purely classical arguments. If a 2DEG is subjected to such an asymmetric mixed modulation, it may happen that in the thermal equilibrium the channeled states carry a finite current. Of course, this current must be compensated by a corresponding opposite current carried by the drifting states. For large magnetic modulation, s > 1, and arbitrary electric modulation, the magnetic modulation dominates the energy spectra at large energies. The regions II with channeled states become more and more important, as can be seen from the pole structure of Eqs. and. For very weak electric modulation, the results reduce to those of the pure magnetic modulation, apart from some peculiarities at very low energies, where additional regions of channeled orbits may exist. In magnetically modulated systems prepared by deposition of magnetic micro-strips there is always an induced electric modulation due to the interface stress between the ferromagnets and the semiconductor. 6 The phase shift with respect to the magnetic modulation occurs when the external magnetic field is tilted. 21 Nevertheless, in the known experimental situations the stress potential amplitude is presumably much weaker than our bare potential. V. SUMMARY AND DISCUSSION We have discussed in detail the quantum electronic states and energy spectra E n (X 0 ) of a 2DEG in strong one-dimensional magnetic and electric superlattices, and in a non-vanishing average external magnetic field. By comparing the quantum results with the corresponding characteristics of the classical motion, we achieved a detailed and intuitive understanding of the energy spectra and eigenstates. We found that the complicated parts of the energy spectra ("regions II"), where branches with strong dispersion coexist with those of low dispersion, coincide with the areas in the E − X 0 diagram in which classically "channeled" orbits exist. For a systematic investigation of the possible energy spectra and eigen states, and of the corresponding types of classical trajectories, it is useful to exploit the scaling properties of the Hamiltonian. Then it is not necessary to vary independently all the basic model paramaters, i.e. the strengths B 0 m and V 0 of magnetic and electric modulation, the modulation period a, and the average magnetic field B 0. If one uses suitable units for energy and length, V cyc and a/2, respectively, one obtains the same classical results and the same gross features of the energy spectra (the same position of the regions II), if one changes the four parameters B 0 m, V 0, a, and B 0 in such a manner that the two reduced modulation strengths s = B 0 m /B 0 and w = V 0 /V cyc remain constant. For different parameter sets with the same values of s and w, only the density of the energy bands is different in the plot of E n (X 0 )/V cyc versus KX 0, not its overall appearance. This is illustrated by Figs. 7(a) and 8(a), for which the regions II coincide. The reason for this behaviour is that, in these energy and length units, the effective potential is invariant under the scaling transformation B 0 m → B 0 m, B 0 → B 0, a → a and V 0 → 2 2 V 0, for arbitrary positive and. To leave the quantum result exactly unchanged under a change of the four model parameters, one has to keep = (l 0 K) 4 also unchanged. This is because only with the restriction = 1/ √ the kinetic energy operator is also independent of the scaling parameter . Thus, in the suitable units, the exact quantum result depends only on three independent parameters instead of four, and the characteristic classical features depend only on two. There is a close correspondence between the quantum states belonging to strong-dispersion branches of the energy spectrum and the classical channeled orbits. These orbits occur near lines of vanishing total magnetic field or near minima of the electric modulation potential and are restricted to individual side valleys of the effective potential. They are always restricted to a part of a single modulation period in x direction and represent a fast motion along (wavy) lines without self-intersections in positive or negative y direction. The corresponding quantum states are also essentially confined to the same space region and belong to energy branches with strong dispersion. At a given value of the constant of motion X 0, channeled orbits exist in energy intervals bounded by adjacent relative minima and maxima of the effective potential, defining bottom and top of the corresponding side valley. Plotting these classically defined extrema versus X 0, one obtains the boundaries of the regions II of the quantum energy spectrum. Classically, for each channeled orbit there exists a "drifting" orbit with the same constants of motion X 0 and E. These drifting orbits are self-intersecting trajectories which, for sufficiently large energy, extend over more than one modulation period in x direction and drift slowly in y direction. The corresponding quantum states belong to low-dispersion branches of the energy spectrum. Quantum mechanically, the channeled states do not appear at exactly the same energies as the drifting states, and they usually have a larger energy spacing than the latter, since they are confined to a narrower effective potential well. We have demonstrated these features by model calculations based on simple harmonic modulation fields. Qualitatively the obtained results and the methods to derive them can easily be extended to more general modulation fields, containing higher harmonics. This will be necessary, if the distance of the 2DEG from the sample surface is not much larger than the period of the surface structure creating the modulation. 21 Anharmonic effective modulation potentials may also result from nonlinear screening effects, even if the bare modulation potential is harmonic. 22,23 We have also performed several additional calculations and consistency checks which are not documented in the main text. E.g., we have checked the equivalence of classical drift velocity and quantum group velocity beyond the analytically accessible case of very weak modulation fields. For some examples with strong modulation, we evaluated the quantum mechanical group velocity along several energy bands E n (X 0 ) and compared the result with the drift velocity of the corresponding classical trajectories with the same energy and X 0 values. For most parts of the bands the two velocities agreed perfectly. A systematic deviation was observed only in parameter regimes where the classical trajectories are close to critical orbits, which have no quantum analog. Near the critical orbits the modulus of the classical drift velocity increases rather rapidly, whereas the quantum mechanical group velocity shows no anomaly. We have also extended the band structure calculations to very strong magnetic modulation (B 0 m /B 0 = 20). While at high energies a complicated superpositon of bands with steep and with flat dispersions, similar to that in Fig. 9(a), was obtained, the bands at low energies tend to cluster into groups separated by relatively large gaps. The low-energy part of the spectrum was already reminiscent of the spectrum for vanishing average magnetic field, where one obtains a one-dimensional Bloch energy spectrum for each value of p y = −eB 0 X 0. 16 Concerning previous and forthcoming transport calculations, we conclude from the close correspondence of the quantum and the classical approach, that at weak average magnetic fields the classical calculations are appropriate, provided the modulation fields are not too strong. For the very strong magnetic modulation mentioned in the introduction, it may however happen, that the energy level spacing of "channeled orbits" exceeds the thermal energy k B T in a regime whereh 0 ≪ k B T. Then we would expect modulation induced quantum effects in the positive-magnetoresistance regime at low B 0. 2. As Fig. 1, but 0/2 = 1/2. The effective potential is symmetric and therefore the guiding center of these drifting orbits does not drift in (c). The outermost pair of lines belongs to the largest, the innermost pair to the smallest EF value. The constant of motion 0 appears as a horizontal line in this plot (0/2 = 0.2 is indicated). Orbits with fixed energy (i. e. fixed curves ± 0 ()) and this value of 0 exist in intervals with − 0 () ≤ 0 ≤ + 0 (). Orbits, plotted in (d), with one turning point on − 0 () and the other on + 0 () are drifting orbits, the others are channeled orbits (see text). FIG. 6. As in Fig. 5 but for s = 2, and 0/2 = 0.5. Horizontal lines in (a) are for EF/Vcyc = 40 and EF/Vcyc = 0.3. The inset shows V (; 0) enlarged between = 0 and = 2, where it has three zeroes. (c): For both indicated energies there exist three orbits, one drifting and two channeled orbits for EF/Vcyc = 40, and three drifting orbits for EF/Vcyc = 0.3, plotted in (d). Since the effective potential is symmetric, there is no guiding center drift for the central drifting orbits.
|
<filename>src/main/java/genome/view/element/HistogramBinElement.java
/*
* ngsv
* https://github.com/xcoo/ngsv
* Copyright (C) 2012, Xcoo, Inc.
*
* 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 genome.view.element;
import genome.config.ViewerConfig;
import genome.data.HistogramBin;
import casmi.graphics.color.RGBColor;
import casmi.graphics.element.Box;
public class HistogramBinElement extends Box implements ScalableElement {
public static final double MAX_HEIGHT = 100.0;
private double initialBaseX;
private double baseX;
private double baseY;
private String name;
private double scale;
private double initialScale;
public HistogramBinElement(HistogramBin hb, double initialScale, long binSize, long maxValue) {
this(hb.getValue(), hb.getPosition(), initialScale, binSize, maxValue);
}
public HistogramBinElement(long value, long position, double initialScale, long binSize,
long maxValue) {
super(binSize * initialScale, Math.log(value) / Math.log(maxValue) * MAX_HEIGHT, 50.0);
this.setPosition(position + binSize / 2.0,
Math.log(value) / Math.log(maxValue) / 2.0 * MAX_HEIGHT);
this.setStroke(true);
this.setStrokeColor(new RGBColor(ViewerConfig.getInstance().getHistogramStrokeColor()));
this.setFillColor(new RGBColor(ViewerConfig.getInstance().getHistogramFillColor()));
this.initialScale = initialScale;
this.scale = initialScale;
this.name = String.format("%d (%d - %d)", value, position, position + binSize);
this.baseX = position + binSize / 2.0;
this.initialBaseX = this.baseX;
this.baseY = Math.log(value) / Math.log(maxValue) / 2.0 * MAX_HEIGHT;
}
public String getName() {
return name;
}
@Override
public double getBaseX() {
return baseX;
}
@Override
public double getBaseY() {
return baseY;
}
public double getScale() {
return scale;
}
@Override
public void setScale(double scale) {
this.scale = scale;
this.setScaleX(this.scale / this.initialScale);
this.baseX = this.initialBaseX * scale;
}
}
|
Specific in vitro IgG subclass synthesis and lymphocyte proliferation responses in herpes virus encephalitis Cerebrospinal fluid, peripheral blood lymphocytes (PBL) and sera from 5 patients with herpes simplex encephalitis (HSVE), 3 with varicellae zoster (VZV) meningoencephalitis and 5 with encephalitis of unknown origin (NUD) were analyzed. Lymphocytes from both blood and CSF were shown to synthesize antiVZV IgG subclasses in VZV meningoencephalitis and antiHSV IgG subclasses in HSVE. The subclass patterns of CSF and in vitro synthesized antiviral IgG were similar, suggesting that a considerable portion of the antiviral IgG subclasses detected are synthesized in the CNS compartment. Antigen presentation in vitro seemed to produce a heterologous IgG4 and/or 3 response in 3 patients. Lymphocyte proliferation was detectable in response to HSV and VZV, respectively.
|
Effect of Rho-associated kinase inhibition on actin cytoskeleton structure and calcium response in glioma C6 cells. The role of actin cytoskeleton functional state in glioma C6 cell morphology and calcium signaling was investigated through modification of myosin II activity by blocking Rho-associated kinase with the specific inhibitor Y-27632. Treatment of glioma C6 cells with ROCK inhibitor resulted in actin cytoskeleton reorganization and also in the changed shape and distribution of mitochondria. Changes in the distribution of ER, the main calcium store in glioma C6 cells, were not visible. The inhibition of myosin II activity influences the first phase of calcium signaling evoked by agonist, and both phases of thapsigargin-evoked calcium response. We suggest that the observed increase in Ca2+ release from intracellular stores induced by IP3 formation as well as inhibition of SERCA ATPase is at least in part related to severely affected mitochondria. Enhancement of capacitative calcium entry evoked by thapsigargin is probably associated with the reorganization of the acto-myosin II system. ATP-induced calcium response presents no changes in the second phase. We observed that ATP stimulation of Y-27632 pretreated cells leads to immediate morphological rearrangement of glioma C6 cells. It is a consequence of actin cytoskeleton reorganization: formation of stress fibers and relocation of phosphorylated myosin II to actin filaments. It seems that the agonist-evoked strong calcium signal may be sufficient for myosin II activation and the stress fiber organization. This is the first work showing the dependence between the functional state of the acto-myosin II system and calcium signaling stressing the reversible character of this relationship.
|
Thermal Decomposition of KClO4 Catalyzed with Pure and Doped Manganese Oxide Catalysts The thermal decomposition of KClOi in air had been studied using DTA and TGA. The effect of the pure and doped manganese oxide in the course of the decomposition reaction was attributed to abstraction of the atomic oxygen from KCIO4. It was found that the chemisorbed surface oxygen has an initiation effect. On the basis of the positive holes concentration created by doping of manganese oxide with Li+ or Al3* ions, the high activity of the Li doped catalyst was explained. Introduction The thermal decomposition of KCIO4 has much interest in the field of solid and liquid state reactions. Freeman et al.1 had studied this decomposition reaction using pure and doped MgO. The effect of M71O22 has been attributed to the abstraction of atomic oxygen. Cupric oxide3 has the same effect of decreasing the thermal stability of KClOi. The present work is aimed at the interpretation of the effect of doping on the activity of the manganese oxide catalyst as well as on the mechanism of the decomposition reaction.
|
<gh_stars>0
import os
from datetime import timedelta
class Config:
HOST = "0.0.0.0"
PORT = "5001"
DEBUG = True
RUN_SETTING = {
"host": HOST,
"port": PORT,
"debug": DEBUG
}
SECRET_KEY = os.getenv('SECRET_KEY')
MONGODB_USERNAME = os.getenv('MONGODB_USERNAME')
MONGODB_PASSWORD = os.getenv('<PASSWORD>')
JWT_HEADER_TYPE = 'JWT'
JWT_ACCESS_TOKEN_EXPIRES = timedelta(minutes=30)
JWT_REFRESH_TOKEN_EXPIRES = timedelta(hours=1)
S3_BUCKET = os.environ.get("S3_BUCKET_NAME")
S3_LOCATION = "ap-northeast-2"
S3_KEY = os.environ.get("S3_ACCESS_KEY")
S3_SECRET = os.environ.get("S3_SECRET_ACCESS_KEY")
S3_URL = f"http://{S3_LOCATION}.s3.amazonaws.com/{S3_BUCKET}"
JSON_AS_ASCII = False
|
Modeling fragmentation of the self-gravitating molecular layer by smoothed particle hydrodynamics We revisit the modeling of ion-neutral (or ambipolar) diffusion with two fluid smoothed particle hydrodynamics, as discussed by Hosking&Whitworth. Some parts of the technique are optimized to testify the pioneer works on behavior of the ambipolar diffusion in an isothermal self-gravitating layer. The frictional heating by ambipolar diffusion is examined, and its effect on fragmentation of the layer is studied. The results are compared to the thermal phases of instability as obtained by Nejad-Asghar. Introduction Ambipolar diffusion was first proposed in an astrophysical context by Mestel & Spitzer as a mechanism for removing magnetic flux and hence magnetic pressure from collapsing protostellar cores. Likewise, ion-neutral friction has long been considered to be a source of heating mechanism in molecular clouds (e.g., Scalo 1977). Padoan et al. show that ambipolar drift heating is a strong function of position in a turbulent cloud, and its average value can be significantly larger than the average cosmic ray heating rate. Ambipolar diffusion has recently been invoked as a source of thermal instability in molecular clouds for formation of small-scale condensations (Nejad-Asghar 2007). Many authors have developed computer codes that attempt to model ambipolar diffusion. Black & Scot used a two-dimensional, deformable-grid algorithm to follow the collapse of isothermal, nonrotating magnetized cloud. The three-dimensional work of MacLow et al. treats the two-fluid model in a version of the zeus magnetohydrodynamic code. An algorithm capable of using the smoothed particle hydrodynamics (SPH) to implement the ambipolar diffusion in a fully three-dimensional, self-gravitating system was developed by Hosking & Whitworth (2004, hereafter HW). They described the SPH implementation of two-fluid technique that was tested by modeling the evolution of a dense core, which is initially thermally supercritical but magnetically subcritical. In this paper, we optimize the two-fluid SPH implementation of the ambipolar diffusion in one dimensional layer. Formulation of the ambipolar diffusion in an isothermal self-gravitating layer is obtained in section 2. We re-formulate the optimized two-fluid SPH technique in section 3. Furthermore, we deal with some prospects of the fragmentation of the layer via thermal instability. 2 Isothermal molecular layer Considering a plane-parallel self-gravitating layer of lightly ionized isothermal molecular gas, all variables are functions of distance z to the central plane and time t only. We consider the molecular cloud as global neutral which consists of a mixture of atomic and molecular hydrogen, helium, and traces of other rare molecules. In reality, the gas in this case is very weakly ionized. The magnetic field is frozen only to the ions, so that diffusion of the field relative to the neutral gas must continuously insert a drag force (per unit volume) where /kg.s m 10 5. 3 3 10 ≈ AD represents the collision drag coefficient and i is the ion density. The exact fraction of the total fluid that is ionized depends upon many factors (e.g. the neutral density, the cosmic ray ionization rate, how efficiently ionized metals are depleted on to dust grains). Many analytical models have been developed to determine the variation of the ion density with neutral density by considering ionization balance in typical molecular cloud environments. Here, we use the expression employed by Fiedler & Mouschovias, which states that for -3 8 m 10 10 < < n, ) ( where in standard ionized equilibrium state, It is a good approximation to treat the charged particles as a single fluid, therefore, the drift velocity is given by which is obtained by assumption that the pressure and gravitational force on the charged fluid component are negligible compared to the Lorentz force because of the low ionization fraction. In this way, the magnetic fields are directly evolved by charged fluid component, as follows: The ion density is negligible in comparison to the neutral density, thus, the mass conservation is given by The momentum equation then becomes is the pressure ( a is the isothermal sound speed) and the gravitational acceleration g obeys the poisson's g Following the many previous treatments, a further simplification is possible if we introduce the surface density between mid-plane and 0 > z as By transformation from ), ( t z to ), ( t, the drift velocity is given by and the equation becomes With the above, field equation can be integrated to give G respectively. The layer is assumed to be in quasi-magnetohydrostatic equilibrium at all times, supported against its own self-gravity by the magnetic gas pressure. The loss of flux from ambipolar diffusion is exactly compensated for by the compression of the layer which is necessary to maintain equilibrium. In this approximation, the left-hand side of equation is zero, and we may integrate the force balance to obtain where integration constant ∞ is the value of at ∞ = z (where is zero). Following the work of Shu, we introduce the non-dimension quantities so that we rewrite the basic equations, and as follows: and the drift velocity as Here, a natural family of initial states is generated by assuming that the initial ratio of magnetic to gas pressure is everywhere a constant, 0. Then one finds from equations, and ) is the central density of the layer at 0 = t, and Figure 1 shows the initial neural density, ion density, and drift velocity in the cloud and outercloud medium for to that case with 0 0 = (Fig. 2b), and the drift velocity gradually settles. Two-fluid SPH construction In two-fluid SPH technique of HW, the initial SPH particles are represented by two sets of molecular particles: magnetized ion SPH particles and non-magnetized neutral SPH particles. In this method, for each SPH particle we must create two separate neighbor lists: one for neighbors of the same species and another for those of different species. Consequently, each particle must have two different smoothing lengths. In the following sections we refer to neutral particles as and, and ion particles as a and b, the subscripts 1 and 2 refer to both ions and neutral particles. We adopt the usual smoothing spline-based kernel (Monaghan & Lattanzio 1985) and apply the symmetrized form proposed by Hernquist & Katz. We update the adaptive smoothing length according to the octal-tree based nearest neighbor search algorithm (NNS The initial conditions for this simulation are a density given by equation, with a parallel magnetic field directed perpendicular to the z-axis so that the initial ratio of magnetic to gas pressure is everywhere a constant ( 1 0 = ). The central density is assumed to be ] [ 56 t (equivalent to ), a chore that took about 10 hours on a 3.6 GHz (Pentium IV) processor. Figure 3 presents the diffusion of the magnetic field profile which accurately matches with Fig. 2 of this paper and/or Figure 1 of Shu. The energy equation follows from the first law of thermodynamics, that is where is the polytropic index, and ), ( T is the net cooling function. Nejad-Asghar has considered a constant initial form of the temperature profile in the layer, and has solved numerically the nonlinear isobaric energy equation with approximation that the dynamics of the layer is solely determined by the isothermal equations as outlined by Shu. In this way, a large temperature gradient was created with time at the interfaces between different isobaric unstable thermal phases. In the context of his thermal instability analysis in the molecular layer, he found that the isobaric thermal instability can occur in some regions of it; therefore it may produce the layer fragmentation and formation of the spherical AUscale condensations. Trusting on the two-fluid SPH code, we can go ahead to study the thermal phases of the aforementioned molecular layer. Running this process by smoothed particle hydrodynamics is a future work of the authors. Furthermore, the macro-velocity fields in the molecular clouds are highly turbulent and supersonic (Larson 1981). It is then of uppermost importance to consider both collision and merger of the formed condensations. Merging is possibly the main onset mechanism to form dense cores, which likely evolves to star formation.
|
package test
import (
"context"
"fmt"
"os"
"path/filepath"
"testing"
nested "github.com/antonfisher/nested-logrus-formatter"
"github.com/networkservicemesh/sdk/pkg/tools/spire"
"github.com/sirupsen/logrus"
"github.com/spiffe/go-spiffe/v2/workloadapi"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
)
type NsmgrTestSuite struct {
suite.Suite
ctx context.Context
cancel context.CancelFunc
spireErrCh <-chan error
}
func (f *NsmgrTestSuite) SetupSuite() {
logrus.SetFormatter(&nested.Formatter{})
logrus.SetLevel(logrus.TraceLevel)
f.ctx, f.cancel = context.WithCancel(context.Background())
// Run spire
executable, err := os.Executable()
require.NoError(f.T(), err)
reuseSpire := os.Getenv(workloadapi.SocketEnv) != ""
if !reuseSpire {
f.spireErrCh = spire.Start(
spire.WithContext(f.ctx),
spire.WithEntry("spiffe://example.org/nsmgr", "unix:path:/bin/nsmgr"),
spire.WithEntry("spiffe://example.org/nsmgr.test", "unix:uid:0"),
spire.WithEntry(fmt.Sprintf("spiffe://example.org/%s", filepath.Base(executable)),
fmt.Sprintf("unix:path:%s", executable),
),
)
}
}
func (f *NsmgrTestSuite) TearDownSuite() {
f.cancel()
if f.spireErrCh != nil {
for {
_, ok := <-f.spireErrCh
if !ok {
break
}
}
}
}
// In order for 'go test' to run this suite, we need to create
// a normal test function and pass our suite to suite.Run
func TestRegistryTestSuite(t *testing.T) {
suite.Run(t, new(NsmgrTestSuite))
}
|
Lewis acid-promoted carbon-carbon bond cleavage of aziridines: divergent cycloaddition pathways of the derived ylides. Lewis acids are shown to cleave the carbon-carbon bond of activated aziridines at ambient temperature. The derived metal-coordinated azomethine ylides undergo cycloaddition reactions with electron-rich alkenes. Cyclic alkenes afford products that are formally adducts most likely derived from a Mannich-type addition to the ylide, followed by intramolecular Friedel-Crafts alkylation. Alternatively, acyclic alkenes undergo cycloaddition to give new pyrrolidine products.
|
/*
ListKafkaConsumerLags List Consumer Lags
[](#section/Versioning/API-Lifecycle-Policy)
Returns a list of consumer lags of the consumers belonging to the
specified consumer group.
@param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param clusterId The Kafka cluster ID.
@param consumerGroupId The consumer group ID.
@return ApiListKafkaConsumerLagsRequest
*/
func (a *ConsumerGroupV3ApiService) ListKafkaConsumerLags(ctx _context.Context, clusterId string, consumerGroupId string) ApiListKafkaConsumerLagsRequest {
return ApiListKafkaConsumerLagsRequest{
ApiService: a,
ctx: ctx,
clusterId: clusterId,
consumerGroupId: consumerGroupId,
}
}
|
// SetNillableDeviceID sets the "device" edge to the Device entity by ID if the given value is not nil.
func (su *SessionUpdate) SetNillableDeviceID(id *schema.ID) *SessionUpdate {
if id != nil {
su = su.SetDeviceID(*id)
}
return su
}
|
Organotypic Culture Method to Study the Development Of Embryonic Chicken Tissues. The embryonic chicken is commonly used as a reliable model organism for vertebrate development. Its accessibility and short incubation period makes it ideal for experimentation. Currently, the study of these developmental pathways in the chicken embryo is conducted by applying inhibitors and drugs at localized sites and at low concentrations using a variety of methods. In vitro tissue culturing is a technique that enables the study of tissues separated from the host organism, while simultaneously bypassing many of the physical limitations present when working with whole embryos, such as the susceptibility of embryos to high doses of potentially lethal chemicals. Here, we present an organotypic culturing protocol for culturing the embryonic chicken half head in vitro, which presents new opportunities for the examination of developmental processes beyond the currently established methods.
|
This is the holdover weekend box office news, so basically anything not involving Ant-Man, Trainwreck, and the handful of smaller-scale debuts.
Minions took a hit from Ant-Man this weekend, dropping a big (for animation) 57% from last weekend. Sadly those yellow henchmen may not have the legs required to break $400 million domestic. Yes, I'm being a little facetious. The Despicable Me spin-off earned another $50.2m in its second weekend, bringing its domestic total to $216m domestic. There will be an absolute onslaught of family-friendly PG-13 blockbuster fare over the next six weeks, so it will be interesting to see how the Minions manage after this not unexpected second-weekend drop.
Assuming the film doesn't utterly collapse against the likes of Pixels in the coming weeks, we're still looking at a movie that ends up at around $320m domestic and bazillions more worldwide (it has $625m as of today). The picture made $55m just on Monday-through-Thursday which shows the strength of summer weekdays when it comes to kid-friendly films, but you already knew that. It is another smash hit for Universal which just crossed the $5 billion mark in worldwide box office in record time. After this week's $30m debut for Trainwreck is Straight Outta Compton next month, which smells like one of those "No one could have seen this coming!" smash that we all should have seen coming.
After that comes what is my most anticipated movie of 2015, M. Night Shyamalan's would-be comeback movie The Visit. If Universal and friends are reading this, please sneak me into that one as early as possible, as I have jury duty the week it opens and I don't want to have to race from the court to a press screening if it can be helped. Yes I wrote that yesterday but it bears repeating for added sympathy.
Walt Disney's Inside Out grossed $11.6 million for the weekend (-34%) while crossing the $300m domestic mark in the bargain. With $306.3m domestic thus far, it has a shot of catching the original $339m total of Finding Nemo and will all-but-surely cross the $321m cume of Shrek the Third. It will be interesting to see if Minions can top Inside Out since the loser will sadly be sent to Wayward Pines (no spoilers please, I'm a couple episodes behind). Inside Out has earned $490m worldwide thus far.
Speaking of Universal, Jurassic World earned another $11.3 million (-37%) to bring its domestic cume to $611.135m. In terms of overseas figures, it topped $1.5 billion worldwide and topped Furious 7 (that distributor must be pissed) and will soon pass The Avengers as the "biggest movie not directed by James Cameron" right around when it tops the Marvel superhero epic in America ($623m) as well. So yeah, expect director Colin Treverrow to be "rumored" for every would-be franchise under the sun. It has now earned $1.513b worldwide.
Terminator Genisys dropped another 60% this weekend for an estimated $5.4 million gross. The sci-fi sequel has now earned $80.64m in America. Overseas may salvage this one, but it won't top $95m domestic, and I have a tough time seeing a sequel for Paramount/Viacom Inc. in these circumstances. If Schwarzenegger wants to do something for the fans, I suggest a halfway decent True Lies blu-ray, or maybe (crosses fingers) a feature-packed release for my favorite Arnold adventure, Kindergarten Cop. Of course, if it does goes nuts overseas, then that will be a worthwhile conversation.
Magic Mike XXL earned $4.5 million on weekend three for a 53% drop. That tumble us partially because of Trainwreck and partially because of losing 799 screens. Anyway, the $14m Channing Tatum sequel will have a new cume of $58.636m, which means we may yet get Magic Mike: The Way of All Flesh in a couple years. The Gallows took the usual horror movie tumble, earning $4m (-49%) for a new $18m cume. Of course this one cost pennies, so Warner Bros./Time Warner Inc. will be okay.
Ted 2 is continuing to make me look bad for arguing that it wasn't quite a flop yet after its $33 million debut weekend, as it earned just $2.681m yesterday (-59%) for a $77.438m domestic cume and $143.4m worldwide. It looks like an $85m total in the end with hopefully around $200m worldwide. Come what may, I'd rather be wrong in defense of a film than in attacking it. Speaking of misses, Ryan Reynolds's Self/Less earned $2.292m (-58%) on its second weekend for a new $10.35m domestic total. But remember, Ryan Reynolds is a movie star!
Meanwhile, Max earned $1.9 million for its third weekend for a $37.916m cume while Spy should end the weekend with $1.5m (-51%) and a $106.6m domestic cume and $220m worldwide. Amy expanded to 690 theaters. The documentary should earn around $1.1m (-39%) for the weekend and end with a new $4.172m domestic cume. Finally, Baahubali grossed around $1.15m on its second weekend (-62%, but a still decent $6,244 p.s.a.) for solid $6.1m domestic cume.
And that's the news for this weekend. Join me next weekend for a crowded field, as Southpaw, The Vatican Tapes, and John Green's Paper Towns go up against the Adam Sandler video game sci-fi action comedy Pixels. In the meantime, enjoy this Rentrak top-ten list:
|
For the next two weeks, diplomats from more than 190 countries will gather near Paris to hammer out a new international agreement on climate change. This conference, known as COP21, is getting heavily hyped: We're already seeing chatter about whether this is our last chance to "save the world" or keep us below 2°C of global warming.
But that's ... the wrong way to think about what's going on in Paris. These climate talks, by themselves, won't fix global warming. They can't do that. They're not designed to do that. The actual goal is much more modest: to add structure and momentum to efforts that are already underway, in legislatures and laboratories and cities and boardrooms around the world, to reduce greenhouse gas emissions.
That may sound like hair-splitting, but it's a crucial distinction for understanding what these talks are all about. It's why many onlookers think a deal is vitally important, and others say it'll be a massive disappointment. Both things, in a way, are true.
The Paris talks will be very different from climate conferences of yore, when negotiators would try to craft binding global treaties that required nations to cut their emissions by set amounts, imposed from on high. See, for example, the 1997 Kyoto Protocol. That was a grand plan to save the world. And it failed, spectacularly. The US Senate refused to ratify Kyoto. Canada pulled out. And, crucially, fast-growing China and India never acceded to cuts. Emissions soared in the years after Kyoto:
The lesson learned was that no fancy UN accord could ever force countries to make wrenching changes to their energy systems that they didn't want to make.
So in recent years, the UN climate talks have shifted to a radically new model. Each country will start off by deciding for itself how it plans to tackle greenhouse gas emissions, taking into account its own unique domestic situation. This "bottom-up" structure has led to universal participation, which is no small thing. Since 2014, every single major emitter has submitted a climate pledge to the UN. Some highlights:
The United States is vowing to cut its greenhouse gas emissions at least 26 percent below 2005 levels by 2025, through policies like the Clean Power Plan to decarbonize power plants.
The European Union will cut emissions 40 percent below 1990 levels by 2030.
China has vowed that its emissions will peak around 2030 and that it will get about 20 percent of its electricity from carbon-free sources by then.
Brazil will cut emissions 37 percent below 2005 levels by 2025, with an emphasis on curbing illegal deforestation in the Amazon.
India will continue to reduce its carbon intensity, or CO2 output per unit of economic activity, in line with historic levels (though overall emissions will grow).
You can find a full list of these pledges, known in UN-speak as "Intended Nationally Determined Contributions" (INDCs), here.
Two realities: These pledges are plausible, and they are laughably inadequate
These individual pledges, which have already been designed and submitted, are the backbone of any new global agreement; they'll do virtually all the heavy lifting. They also have two notable features:
First, the pledges are plausible. They weren't dreamed up by remote UN bureaucrats. They were all freely submitted by national governments, based on what was deemed politically realistic and technologically feasible. The US pledge, for example, is rooted in the Obama administration's understanding of what's possible through existing executive authority. It doesn't assume Congress will miraculously pass new bills.
Second, these pledges are laughably inadequate to the task of preventing severe global warming. If you assume every country follows its pledge to the letter, global emissions will keep rising through 2030, and we'll be setting ourselves up for around 3°C of global warming by century's end. Happily, that's a major improvement over the end-times-ish 4°C rise we used to be on track for. Not so happily, it means we'll likely be zipping past the 2°C global warming mark, which has long been deemed unacceptably risky. Not good.
That's where these Paris talks come in. Over the next two weeks, negotiators will try to add support structures that, they hope, will allow these pledges to get stronger over time. They'll create transparency and verification mechanisms so that everyone can see whether countries are following through. They'll haggle over financing to help poorer nations. They'll discuss formal review process, allowing the pledges to be revisited and boosted in regular intervals.
There are no guarantees this will work. But, as political scientist David Victor explained, the idea is you start with what's plausible and try to iterate from there, through cooperation and political persuasion.
Or, if you like metaphors: Think of the countries making climate pledges as a bunch of out-of-shape slobs trying (and failing miserably) to qualify for a relay event. A Paris deal won't be able to force these people to train harder. But it can put their names up on a whiteboard, track their progress, work out gym subsidies for those who can't afford it, and facilitate peer pressure. Obviously the exercise is the crucial part, and that ultimately depends on each individual. But that other stuff can help.
So it's worth keeping these talks in perspective. A strong agreement out of Paris could help support ongoing efforts to reduce fossil fuel emissions and curb deforestation. But whether Earth warms 2°C or 2.5°C or 3°C won't be decided by these talks. That will depend on what future policies get enacted by individual countries, on how quickly we switch over to alternative energy sources, on how technology evolves. Tackling climate change is a vast, herculean task, the work of generations — and it will remain so no matter what happens in Paris.
Okay. So what should I watch for in the Paris climate talks?
There's going to be endless bickering in the next two weeks over a slew of issues. Some of it will matter; a lot of it simply won't. Ultimately, the key thing to watch is whether a final deal helps countries build on the climate pledges they've already made.
Before the Paris talks began, negotiators had already whittled down a draft agreement to about 50 pages, with a number of key issues left to be decided. Here are two important questions that are worth watching:
1) How often will pledges get reviewed and strengthened? Again, if you add up all of the world's current pledges, global emissions will keep rising through 2030 and the world will heat up by 3°C or so by century's end. That's bad. So, ideally, a final deal at Paris will set forth a structure whereby countries can periodically revisit and ratchet up those pledges.
The precise details matter quite a bit. US negotiators have pushed for a five-year review cycle; India has proposed a looser 10-year review cycle. There's also the question of whether countries would be pressured to strengthen their pledges during each subsequent review, to take into account, say, advances in renewable energy technology or faster-than-expected progress. See John Upton's piece at Climate Central for more on this debate.
Meanwhile, those pledges are worthless if they can't be verified in a transparent and consistent way. China's coal statistics are notoriously unreliable, for instance. Fixing stuff like that will be an important part of any final deal.
2) What sort of financing will be available to poor countries? In every climate conference, poor countries point out that they need help to decarbonize their economies and adapt to climate change. And since rich countries are responsible for the vast majority of carbon dioxide already in the atmosphere, it's only fair that they pony up. Most everyone agrees on this general principle. It's just hard to shake loose the funds.
Back in the 2009 Copenhagen climate talks, wealthy countries agreed to provide $100 billion annually in public and private money by 2020. A recent OECD report argues that they're now providing about $62 billion annually, but some critics accuse them of double-counting existing aid and loans. And poorer countries are now asking for even more in climate aid. India, for instance, has been told that it can't get rich the way the US, Europe, or China did — by burning lots and lots of coal. So, in turn, India has said it will need more than $160 billion per year in outside investment to make up the difference.
This is one place where the climate talks really could stumble. It's also one of the few places where congressional Republicans determined to sabotage a climate deal in Paris could actually matter. President Obama has promised that the US government will chip in $3 billion over four years to the UN's Green Climate Fund. But he has to ask Congress for that money, and the GOP seems unlikely to oblige.
--------
Climate talk aficionados will notice I left out reams of topics that will no doubt get plenty of press these next two weeks. But as Michael Levi nicely explains, most of this stuff is a bit of a sideshow.
For instance, the European Union and United States have been squabbling over whether the Paris agreement will be "legally binding" or not. The Obama administration's view is that the verification and review mechanisms should have legal force but the pledges themselves shouldn't. This way, the deal doesn't have to get ratified by the US Senate (which will never happen). You can read all about this dispute at Carbon Brief, but spoiler: Europe is not going to block a final deal over this issue. The US will win. Feel free to skip past this melodrama.
What counts as "success" or "failure" for these talks?
It really depends on what you're expecting.
If you're expecting a Paris climate deal that will lead to a world powered by 100 percent renewables or keep global warming below 2°C ... well, you're going to be disappointed. The current pledges don't add up to 2°C, as just about everyone and their climate-modeler aunt has now pointed out. And a Paris deal will be built around those current pledges.
Likewise, if you were hoping that countries would agree to a global carbon tax in Paris, as climate scientist James Hansen has been urging ... well, that's not going to happen either.
Instead, what the people involved in these talks are hoping for is something more subtle. A successful deal would mean that for the first time, countries are all working together on climate change, with every nation now crafting plans to address the issue. True, many of those plans are meager, but they're a starting point. Importantly, it would be a signal to investors and policymakers that climate action has momentum behind it, that decarbonization is the future. It would energize future talks. It would inspire additional commitments, such as Bill Gates's pledge to finance the world's largest clean energy R&D fund.
For many, a successful Paris deal will also have clear verification measures for existing climate pledges, as well as a frequent review process to allow those pledges to get stronger iteratively. This three-page brief from the Center for Climate and Energy Solutions offers a pretty realistic overview of what a "strong" deal would look like.
That leaves a question: Could future ratcheting and subsequent, increasingly ambitious global agreements keep us below 2°C? In theory, sure. But it would require a big ratchet. A new report from MIT and Climate Interactive looks at how national pledges would have to change between now and 2030 to stay below 2°C:
So, for instance, China would have to bolster its policies to ramp up low-carbon energy and phase out coal so that emissions peak by 2025 instead of 2030. The United States would have to cut deeply by 2030. It would take sweeping efforts to decarbonize homes, vehicles, power plants, and factories. Cleantech would have to proliferate far more rapidly. It's a heavy lift.
But that would be true with or without an agreement in Paris. If these talks collapse, if no deal emerges, the alternative is ... well, nothing really. The status quo. A period of drift and aimlessness on one of the most important questions facing the planet today. "This is it, my friends," Christiana Figueres, who chairs the UN Framework Convention of Climate Change, reportedly said last year. "I guarantee you, if we do not succeed in 2015 ... it will take 10 years to get everyone around the table again."
What else should I read on the Paris climate talks?
|
/**
* Our custom {@link CamelContextLifecycle} which allows us to enlist beans in the {@link JndiContext}
* so the Camel application can lookup the beans in the {@link org.apache.camel.spi.Registry}.
* <p/>
* We can of course also do other kind of custom logic as well.
*/
public class MyLifecycle implements CamelContextLifecycle<SimpleRegistry> {
@Override
public void beforeStart(ServletCamelContext camelContext, SimpleRegistry registry) throws Exception {
// enlist our bean(s) in the registry
registry.put("myBean", new HelloBean());
}
@Override
public void afterStart(ServletCamelContext camelContext, SimpleRegistry registry) throws Exception {
// noop
}
@Override
public void beforeStop(ServletCamelContext camelContext, SimpleRegistry registry) throws Exception {
// noop
}
@Override
public void afterStop(ServletCamelContext camelContext, SimpleRegistry registry) throws Exception {
// unbind our bean when Camel has been stopped
registry.remove("myBean");
}
@Override
public void beforeAddRoutes(ServletCamelContext camelContext, SimpleRegistry registry) throws Exception {
// noop
}
@Override
public void afterAddRoutes(ServletCamelContext camelContext, SimpleRegistry registry) throws Exception {
// noop
}
}
|
/* infinite loop in a for loop body*/
void foo()
{
int i;
for(i=0;i!=5;i++) {
more:
if (i == 3)
printf("%d",i);
goto more;
}
printf("Exit with %d",i);
}
|
John Cotter, The Canadian Press
EDMONTON -- A review board has upheld the firing of a former army sniper from the Edmonton Police Service for urinating on another officer and other misconduct, but the case may not be over yet.
Const. Rob Furlong, a decorated veteran of the war in Afghanistan, was fired in March 2012 by a senior officer after pleading guilty to two of four charges at a disciplinary hearing.
A few months later the Law Enforcement Review Board ruled the punishment was too harsh.
It ordered Furlong reinstated with a temporary demotion, noting that he had entered an alcohol treatment program.
Edmonton Police Chief Rod Knecht filed an appeal that argued the decision to dismiss Furlong was reasonable.
The Alberta Court of Appeal then sent the case back to the board for reconsideration.
In its ruling made public Tuesday, the Law Enforcement Review Board said the decision by the senior officer to fire Furlong for his misconduct during a night of heavy drinking at a police training event in Sept. 2011 was acceptable.
"The presiding officers' decision that the appellant be dismissed immediately from the Edmonton Police Service is affirmed and the appeal is dismissed," a three-member panel wrote.
"We conclude, after very careful deliberation, that the presiding officers' decision on penalty was reasonable -- it was a decision that was available to him in light of the facts as he found them and in light of the law."
Furlong, who served with the Princess Patricia's Canadian Light Infantry, was lauded in 2002 for shooting a Taliban fighter at a range of 2.43 kilometres -- the longest sniper kill recorded at the time.
Furlong, who has been suspended from the police service without pay, was not immediately available for comment.
Sgt. Tony Simioni, president of the Edmonton Police Association, which represents officers, said Furlong is very disappointed with the latest ruling and is seeking leave to challenge it at the Alberta Court of Appeal.
"He is obviously concerned about the overturning of the decision and we are going to support him through this process to the very end," Simioni said.
Knecht was not immediately available for comment Tuesday.
Last April Knecht issued a written statement about the Furlong case.
In it he said the citizens of Edmonton have high standards and expectations of police, and that it is essential for the police to maintain the public trust.
|
Haploidentical Stem Cell Transplant With Post-transplant Cyclophosphamide for Chediak-Higashi Syndrome: A Very Rare Case Report Chediak-Higashi syndrome is a rare immunodeficiency disorder for which hematopoietic stem cell transplant (HSCT) is the only curative treatment option. HSCT only corrects the hematologic and immunologic manifestations of the disease but neurologic complications may still progress after transplant. Haploidentical HSCT (haplo-HSCT) has evolved as a feasible alternative for patients with primary immunodeficiency. More recently, there has been use of haplo-HSCT with post-transplant cyclophosphamide. However, only 4 cases of Chediak-Higashi syndrome have been reported using this approach. Here, the authors describe a case of a 17-month-old boy who was successfully treated by haplo-HSCT with reduced-toxicity conditioning (fludarabine/treosulfan/melphalan) and post-transplant cyclophosphamide.
|
/**
* virLogGetDefaultPriority:
*
* Returns the current logging priority level.
*/
virLogPriority
virLogGetDefaultPriority(void)
{
return virLogDefaultPriority;
}
|
Detecting elliptical structures in underwater images In this paper, the problem of detecting particular underwater structures, e.g., anodes used to join together separated sections of a pipeline, from visual images is addressed. Images are acquired by an autonomous underwater vehicle during sea-bottom surveys for pipeline inspection. Anodes with different characteristics, e.g., material, size, color, etc., can be found on the same pipeline but all are characterized by the same visual feature, i.e., an elliptical arc. To this end, a voting-based method able to detect elliptical arcs on the image plane is used to locate accurately anodes along the pipeline. Three dimensional (3D) geometric information about the scene, e.g., 3D equations of the pipeline borders, is used to reduce from 5 to 2 the dimensions of the parametric space needed for ellipse detection. Then, among the instances of detected ellipses on the image plane, false elliptical arcs, which are not compatible with the 3D scene geometry, are eliminated. Finally, the detection of consecutive true elliptical arcs over a long image sequence is used to infer the presence of an anode. Experimental tests on large sets of real underwater images have been performed to evaluate the effectiveness and the robustness of the method.
|
Re "Adopted Dogs, Cats Have Microchips," June 20: I wonder if it would be possible or practical to implant microchips in patients with Alzheimer's disease. I know of several cases, personally, in which a patient has wandered away from home or a care facility.
An implanted microchip would provide a means of identification to restore the confused elderly people to their homes.
|
class Solution:
def removeDuplicates(self, nums: List[int]) -> int:
if len(nums) < 2:
return len(nums)
start = 0
moving = 1
while moving < len(nums):
while moving < len(nums) and nums[start] == nums[moving]:
moving += 1
if moving == len(nums):
break
nums[start + 1] = nums[moving]
start += 1
moving += 1
return start + 1
|
<filename>fruit/fruit_store/showcenter/apps.py
from django.apps import AppConfig
class ShowcenterConfig(AppConfig):
name = 'showcenter'
|
from fastapi_users.password import PasswordHelper
from passlib.context import CryptContext
context = CryptContext(schemes=["argon2", "bcrypt"], deprecated="auto")
password_helper = PasswordHelper(context)
|
/*
** Miscellaneous object handling.
** Copyright (C) 2005-2015 <NAME>. See Copyright Notice in luajit.h
*/
#define lj_obj_c
#define LUA_CORE
#include "lj_obj.h"
/* Object type names. */
LJ_DATADEF const char *const lj_obj_typename[] = { /* ORDER LUA_T */
"no value", "nil", "boolean", "userdata", "number", "string",
"table", "function", "userdata", "thread", "proto", "cdata"
};
LJ_DATADEF const char *const lj_obj_itypename[] = { /* ORDER LJ_T */
"nil", "boolean", "boolean", "userdata", "string", "upval", "thread",
"proto", "function", "trace", "cdata", "table", "userdata", "number"
};
/* Compare two objects without calling metamethods. */
int lj_obj_equal(cTValue *o1, cTValue *o2)
{
if (itype(o1) == itype(o2)) {
if (tvispri(o1))
return 1;
if (!tvisnum(o1))
return gcrefeq(o1->gcr, o2->gcr);
} else if (!tvisnumber(o1) || !tvisnumber(o2)) {
return 0;
}
return numberVnum(o1) == numberVnum(o2);
}
|
#pragma once
#include <stdint.h>
namespace apic {
struct trampoline_data {
uint8_t status;
uint64_t pagetable;
uint64_t idt;
uint64_t gdt;
uint64_t stack_ptr;
uint64_t entry;
} __attribute__ ((packed));
enum ap_status {
incpp = 1
};
extern bool cpu_started[256];
extern int bsp_id;
extern "C" void ap_trampoline();
extern "C" void ap_trampoline_64();
extern "C" void ap_trampoline_data();
void lapic_write(uint64_t reg, uint32_t value);
uint32_t lapic_read(uint64_t reg);
void lapic_wait();
void lapic_eoi();
void lapic_enable();
void lapic_ipi(uint8_t lapic_id, uint8_t vector);
void ap_trampoline_c();
void smp_spinup();
void setup();
#define LAPIC_ID(vaiable_name) \
volatile unsigned char vaiable_name = 0; \
{\
__asm__ __volatile__ ("mov $1, %%eax; cpuid; shrl $24, %%ebx;": "=b"(vaiable_name) : : ); \
}
#define SMP_TRAMPOLINE_PAGE 1
#define SMP_TRAMPOLINE_ADDR (SMP_TRAMPOLINE_PAGE * 0x1000)
}
|
// Returns a random element from the given slice
func chooseRandomElementFromSlice(slice []string) string {
if len(slice) > 0 {
nBig, err := rand.Int(rand.Reader, big.NewInt(int64(len(slice))))
if err != nil {
panic("failed to generate random number")
}
return slice[nBig.Int64()]
}
return ""
}
|
An Experimental Technique on the Dynamic Strength of Adhesively Bonded Single Lap Joints This paper reported an experimental technique on the shear strength of adhesively bonded single lap joints subjected to impact loads by means of a split Hopkinson tensile bar. The experiments were conducted at two velocities (V = 20 m/s, 7 m/s) and testing temperatures ranging from −40°C to 80°C. The results indicated that the shear strength of the specimen decreased with the increase of temperature and increased with the increase of velocity. The strength degradation from room temperature to high temperature was more severe than that from low temperature to room temperature. The effects of the pins, thermal stress and peel stress were also examined and found to have limited effects on the determination of the shear strength of the joints. It was concluded that the shear strength of the adhesively bonded single lap joints under impact loads can be determined by this experimental technique.
|
With the 300MW coal power plant at Norachcholai having broken down last Friday, the third such major breakdown since its commissioning last year, the Ceylon Electricity Board is now hard pressed to find an alternate power source to meet the shortfall.
The Power and Energy Ministry early this week said that the plant would be back in operation by the first week of February, but yesterday they said it would take two weeks. However, officials at the plant said they were still not in a position to give an exact date for the resumption of electricity generation.
A senior engineer said that six million units that Norachcholai produced per a day now had to come from hydro or thermal power. Under present conditions the CEB was making use of the full capacity of all its plants to meet the demand and going at the present rate they could go on till April even without rainfall.
However, if the Norachchoali plant continued to be dysfunctional for more than three weeks or so, the situation would turn from bad to worse. "In that case, probably, emergency power purchases from the private sector is the only solution," he added.
A majority of the members of the powerful Engineers Union, however would not support the purchase of costly emergency power till their demands were settled. Engineers were keen on a ratio between the highest and lowest salary levels and an injustice caused to a senior Assistant General Manager.
Fearing a serious supply shortage in the first half of 2012, the CEB Board last month decided to call tenders for supplying 100MW of emergency power from March 2012.
The Island reliably learns that CEB General Manager Nihal Wickramasooriya informed the Ministry of Power and Energy, by letter dated December 9, 2011, that the emergency power purchases would cost around Rs. 13,000 million based on auto diesel and Rs. 8,000 million if heavy fuel oil (HFO) was used.
However, a number of senior Cabinet Ministers have said the amount was too much of a burden on the Treasury. Even President Mahinda Rajapaksa was not happy over the rush for emergency power purchases, according to officials.
Since its commissioning in March 2011 the Norachcholai coal power plant built by the Chinese has had several breakdowns.
In his address at the elaborate opening ceremony of the Norachcholai coal power plant last year, Power and Energy Minister assured the nation that power cuts were a thing of history and would be removed permanently from the vocabulary.
However, within a few short months of this promise, the CEB was forced to shed loads in mid-2011, following the highest rainfall recorded in history in the previous year. These unannounced power cuts were a direct result of the CEB’s wrong policy of maximizing hydro generation in the first four months of 2011, without making use of cheap thermal power made available by several private power plants.
The CEB last used emergency power in early 2002. According to a document circulated by Minister Ranawaka, last year, the CEB had been making profits steadily until 1996. It was in 1996 that CEB resorted to purchasing emergency power for the first time (from Aggreko).
Power and Energy Media Secretary Dhanushka Ramananayake, told us to contact, CEB Chairman, Professor, Wimaladhrma Aberwickrema, who didn’t answer the phone.
CEB Working Director Pasan Gunasena said that they had called for tenders. However, he was not informed of the present need for emergency power.
He said that he was not aware of the grievances of the engineers. Usually discussions take place between Engineers Union and the General Manager.
|
from datetime import datetime
import pandas as pd
from typing import Any, Dict, List, Tuple
class CredData():
"""
Parses information from Sourcecred
- Works with TimelineCred data format (sourcecred <= v0.7x)
"""
def __init__(self, cred_data, accounts_data):
self.cred_json_data = cred_data
self.weighted_graph = cred_data[1]['weightedGraph'][1]
self.cred_data = cred_data[1]['credData']
self.accounts_data = accounts_data
self.cache = {
'df': None,
'df_rank': None,
'df_grain': None,
'df_accounts': None,
'df_cred_ot': None,
'df_cred_eflow': None,
'df_cred_nflow': None,
}
def get_weighted_graph(self, data) -> Dict[str, Any]:
"""
Weighted graph from CredResult JSON data
"""
return self.weighted_graph
def get_cred_data(self) -> Dict[str, Any]:
"""
Raw CredResult JSON data
"""
return self.cred_data
def get_node(self, i: int) -> Dict[str, Any]:
"""
Returns specifc node's information
"""
node = dict()
address = self.weighted_graph['graphJSON'][1]['sortedNodeAddresses'][i]
node['address.source'] = f'{address[0]}/{address[1]}'
node['address.nodeType'] = address[2]
node['address.id'] = address[3]
node['totalCred'] = self.cred_data['nodeSummaries'][i]['cred']
node['credOverTime'] = self.cred_data['nodeOverTime'][i]['cred'] if self.cred_data['nodeOverTime'][i] else []
node['description'] = self.weighted_graph['graphJSON'][1]['nodes'][i]['description']
node['timestamp'] = self.weighted_graph['graphJSON'][1]['nodes'][i]['timestampMs']
node['user'] = self.weighted_graph['graphJSON'][1]['nodes'][i]['description'] if node['address.nodeType'] == 'IDENTITY' else None
return node
@property
def total_nodes(self) -> int:
"""
Total amount of nodes (users, posts, etc) in the graph
"""
return len(self.cred_data['nodeSummaries'])
@property
def nodes(self) -> List[Any]:
"""
Returns all nodes in the graph
"""
return [self.get_node(i) for i in range(self.total_nodes)]
@property
def intervals(self, to_datetime=False) -> List[Any]:
"""
Returns timestamp intervals where cred was computed
"""
return self.cred_data['intervals']
def get_dt_intervals(self) -> List[Any]:
"""
Return intervals in datetime format
"""
return [datetime.fromtimestamp(interval[('endTimeMs')] / 1000) for interval in self.intervals]
@property
def distributed_cred(self) -> float:
"""
Returns total distributed cred
"""
if self.cache['df'] is None:
self.to_df()
return self.cache['df'].totalCred.sum()
@property
def distributed_grain(self) -> float:
"""
Returns total distributed grain
"""
if self.cache['df_grain'] is None:
self.get_grain_distribution()
return self.cache['df_grain'].amount.sum()
@property
def accounts(self) -> pd.DataFrame:
"""
Returns user accounts info from 'output/accounts.json' file
"""
if self.cache['df_accounts'] is None:
self.cache['df_accounts'] = pd.json_normalize(self.accounts_data['accounts'])
self.cache['df_accounts']['account.balance'] = self.cache['df_accounts']['account.balance'].map(float) / 1e18
self.cache['df_accounts']['account.paid'] = self.cache['df_accounts']['account.paid'].map(float) / 1e18
return self.cache['df_accounts']
def get_user_nodes(self) -> pd.DataFrame:
"""
Returns user nodes in the graph
"""
if self.cache['df'] is None:
self.to_df()
return self.cache['df'][self.cache['df']['address.nodeType'] == 'IDENTITY']
def get_user_ranking(self) -> pd.DataFrame:
"""
Returns the user raking by total amount of cred gained so far
"""
if self.cache['df_rank'] is None:
# self.cache['df_rank'] = self.get_user_nodes().sort_values('totalCred', ascending=False).reset_index(drop=True)
# distributed_cred = self.cache['df_rank'].totalCred.sum()
# self.cache['df_rank']['credShare'] = (self.cache['df_rank'].totalCred / distributed_cred) * 100
df_rank_p = self.get_user_nodes()[['address.id', 'totalCred', 'credOverTime']]
distributed_cred = df_rank_p.totalCred.sum()
df_rank_p['credShare'] = (df_rank_p.totalCred / distributed_cred) * 100
df_rank_p.set_index('address.id', inplace=True)
df_acc_p = self.accounts[['account.identity.id',
'account.identity.name',
'account.identity.subtype',
'account.active',
'account.balance',
'account.paid'
]]
self.cache['df_rank'] = df_acc_p.join(df_rank_p,
on='account.identity.id',
how='inner'
).sort_values('totalCred', ascending=False).reset_index(drop=True)
self.cache['df_rank'].columns = ['id', 'user', 'type', 'active', 'grainBalance', 'grainPaid', 'totalCred', 'credOverTime', 'credShare']
return self.cache['df_rank']
def get_grain_distribution(self) -> pd.DataFrame:
"""
Returns the history of grain distribution
"""
if self.cache['df_grain'] is None:
grain_history = [acc for acc in self.accounts_data['accounts'] if 'allocationHistory' in acc['account']]
if len(grain_history) > 0:
grain_distribution = [{'credTimestampMs': record['credTimestampMs'], 'amount': int(record['grainReceipt']['amount']) / 1e18} \
for acc in grain_history for record in acc['account']['allocationHistory']]
self.cache['df_grain'] = pd.json_normalize(grain_distribution)
self.cache['df_grain']['credTimestampMs'] = pd.to_datetime(self.cache['df_grain']['credTimestampMs'], unit='ms')
else:
# zeros
self.cache['df_grain'] = pd.DataFrame([self.get_dt_intervals(), [0.] * len(self.intervals)]).T
self.cache['df_grain'].columns = ['credTimestampMs', 'amount']
return self.cache['df_grain']
def get_cred_over_time(self) -> pd.DataFrame:
"""
Returns distributed cred summary over all intervals
"""
if self.cache['df_cred_ot'] is None:
if self.cache['df'] is None:
self.to_df()
self.cache['df_cred_ot'] = pd.DataFrame([self.get_dt_intervals(),
pd.DataFrame(self.cache['df'].credOverTime.to_list()).sum()
]).T
self.cache['df_cred_ot'].columns = ['credTimestampMs', 'amount']
self.cache['df_cred_ot'].set_index('credTimestampMs', drop=True, inplace=True)
return self.cache['df_cred_ot']
def to_df(self) -> pd.DataFrame:
"""
Retuns all nodes data as a DataFrame
"""
if self.cache['df'] is None:
self.cache['df'] = pd.json_normalize(self.nodes)
self.cache['df'].timestamp = pd.to_datetime(self.cache['df'].timestamp, unit='ms')
# distributedCred = self.df.totalCred.sum()
# self.df['credShare'] = self.df.totalCred / distributedCred
return self.cache['df']
def get_cred_flow_from_graph(self) -> Tuple[pd.DataFrame, pd.DataFrame]:
"""
Gets cred flow through nodes & edges in the cred graph.
"""
if self.cache['df_cred_eflow'] is None:
def set_plugin(label):
for prefix, plugin in plugin_prefixes.items():
if label.startswith(prefix):
return plugin
return 'Not Found'
# PREPROCESSING
plugin_meta = dict()
edges = []
nodes = []
# edges_weights = dict()
# nodes_weights = dict()
for plugin in self.cred_json_data[1]['plugins'][1]:
plugin_meta[plugin['name']] = {
'nodePrefix': plugin['nodePrefix'],
'edgePrefix': plugin['edgePrefix'],
'edgeTypes': [{'prefix': et['prefix'], 'weight': et['defaultWeight']} for et in plugin['edgeTypes']],
'nodeTypes': [{'prefix': nt['prefix'], 'weight': nt['defaultWeight']} for nt in plugin['nodeTypes']],
}
edges.extend([et['prefix'] for et in plugin_meta[plugin['name']]['edgeTypes']])
# for et in plugin_meta[plugin['name']]['edgeTypes']:
# edges_weights[et['prefix']] = et['weight']
nodes.extend([nt['prefix'] for nt in plugin_meta[plugin['name']]['nodeTypes']])
# for nt in plugin_meta[plugin['name']]['nodeTypes']:
# nodes_weights[nt['prefix']] = nt['weight']
plugin_prefixes = {plugin_meta[p_name]['nodePrefix'].replace('\x00', ''): p_name for p_name in plugin_meta}
plugin_prefixes.update({plugin_meta[p_name]['edgePrefix'].replace('\x00', ''): p_name for p_name in plugin_meta})
# EDGES
df_ew = pd.DataFrame([self.weighted_graph['weightsJSON'][1]['edgeWeights'].keys(),
[v['backwards'] for v in self.weighted_graph['weightsJSON'][1]['edgeWeights'].values()],
[v['forwards'] for v in self.weighted_graph['weightsJSON'][1]['edgeWeights'].values()]
]).T
df_ew.columns = ['edge', 'backward', 'forward']
cred_edges = dict()
for e in edges:
cred_edges[e.replace('\x00', '')] = [
df_ew[df_ew.edge.str.startswith(e)].backward.sum(),
df_ew[df_ew.edge.str.startswith(e)].forward.sum()
]
self.cache['df_cred_eflow'] = pd.json_normalize(cred_edges).T
self.cache['df_cred_eflow']['backward'] = self.cache['df_cred_eflow'].iloc[:,0].apply(lambda x: x[0])
self.cache['df_cred_eflow']['forward'] = self.cache['df_cred_eflow'].iloc[:,0].apply(lambda x: x[1])
self.cache['df_cred_eflow']['plugin'] = self.cache['df_cred_eflow'].index.map(set_plugin)
self.cache['df_cred_eflow'].drop(columns=[0], inplace=True)
# NODES
df_nw = pd.DataFrame([self.weighted_graph['weightsJSON'][1]['nodeWeights'].keys(),
self.weighted_graph['weightsJSON'][1]['nodeWeights'].values()
]).T
df_nw.columns = ['node', 'weight']
cred_nodes = dict()
for n in nodes:
cred_nodes[n.replace('\x00', '')] = df_nw[df_nw.node.str.startswith(n)].weight.sum()
self.cache['df_cred_nflow'] = pd.json_normalize(cred_nodes).T
self.cache['df_cred_nflow'].columns = ['weight']
self.cache['df_cred_nflow']['plugin'] = self.cache['df_cred_nflow'].index.map(set_plugin)
return (self.cache['df_cred_nflow'], self.cache['df_cred_eflow'])
def __repr__(self) -> str:
return "<{} - ({} nodes & {} distributed CRED)>".format(self.__class__.__name__, self.total_nodes, self.distributed_cred)
|
FOX via Getty Images Astrophysicists probe the nature of our universe — a place too vast and grand for a single human mind to fully comprehend — and while that might make some feel small, Neil deGrasse Tyson has said time and again that the knowledge he's acquired over the years as an astrophysicist makes him feel not small, but big.
To deGrasse Tyson, knowledge is essential to leading a prosperous, meaningful life.
Even after publishing nearly a dozen books, narrating the hit series Cosmos: A Spacetime Odyssey, and directing the Hayden Planetarium in New York, deGrasse Tyson still tries to learn something new every day, he recently told 60 Minutes correspondent Charlie Rose.
Here are some of the few, but fundamentally important, life lessons that he says are his constant sources of inspiration.
"One of them is every day try to lessen the suffering of others by however amount," he told Rose.
The way deGrasse Tyson does this is through his role as a science educator.
As host of the widely-popular podcast StarTalk Radio and Cosmos star, deGrasse Tyson strives to make the wonders of the universe accessible to all.
If you understand your connection to the universe — that we are all made of the same stuff as the tens of billions of stars in our galaxy — then that knowledge gives you a sense of relevance and connection that you might never feel otherwise. And, according to deGrasse Tyson, feeling relevant in the world is what we, as a species, look for in life.
"Also I try to learn something today that I did not know yesterday," he told Rose. "Why not? There's so much to learn."
This is good advice for us all. In fact, experts say learning something new everyday will make you smarter overall and protect your brain from some of the negative aspects of normal aging.
Learning new things isn't just important for the brain, however. Several studies have found that people who regularly experience awe in their lives generally feel less stressed, more humble, and more satisfied too. So it's in our best interest to seek out those special quirks that awe and inspire us as we learn more about life and the universe.
Last, but not least, deGrasse Tyson tries to live his life by following the advice of a 19th Century American politician and educator, Horace Mann: "Be ashamed to die until you've scored some victory for humanity."
DeGrasse Tyson reiterated Mann's words with his own.
"You want the world to be a slightly better place for you having lived in it," he told Rose. "If you have the power and the influence to make it a slightly better place and you don't, what kind of life is that?"
When deGrasse Tyson saw Mann's quote for the first time, he decided that he would strive to one day deserve those words as his epitaph.
We think he's doing a pretty good job so far.
|
package seedu.pivot.storage;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
import seedu.pivot.storage.testutil.ReferenceStorageStub;
public class ReferenceStorageTest {
@TempDir
public Path testFolder;
private ReferenceStorage referenceStorage;
private Path getTempFilePath(String fileName) {
return testFolder.resolve(fileName);
}
@Test
public void constructor_success() throws IOException {
ReferenceStorage referenceStorage = new ReferenceStorageStub(getTempFilePath("./tests"));
assertTrue(Files.exists(getTempFilePath("tests")));
}
@Test
public void addTestFile_success() throws IOException {
ReferenceStorage referenceStorage = new ReferenceStorageStub(getTempFilePath("./testDir"));
assertFalse(Files.exists(getTempFilePath("./testDir/testFile.txt")));
referenceStorage.addTestFile();
assertTrue(Files.exists(getTempFilePath("./testDir/testFile.txt")));
}
}
|
There is talk in California of what you could call a radical idea for the cash-poor state to raise money. It's controversial, but proponents say the plan could smoke out more than a billion dollars for the state, as CBS News correspondent John Blackstone reports.
It is an unusual commercial: taxpayers demanding a new tax. It's an offer by marijuana users to help the state's battered budget.
"We're marijuana consumers. We want to pay our fair share."
It's estimated that $14 billion worth of marijuana is sold illegally in the state. Making it legal and taxing it at $50 dollars an ounce would bring in approximately $1.4 billion a year. Assemblyman Tom Ammiano has been pushing the idea.
"I thought it was high time - no pun intended - that this was on the table," he said.
As many see it, marijuana is already virtually legal in California where state law allows it for medical use.
At one Los Angeles dispensary, The Farmacy, the cannabis comes in buds so you can smoke it of course, but you don't have to. There's also cookies and candy bars, also drinks with cannabis as the active ingredient, and gelato - so you can take your medicine like ice cream or lollipops.
One dispensary gave out free pot to anyone with a valid prescription. The line was out the door.
While many doctors say marijuana has valid medical uses, like treating nausea in chemotherapy patients, critics say California's medical marijuana dispensaries sell the drug to almost anyone.
Will any state legalize marijuana by the end of 2009?
"That system is a sham," said Bernard Melekian of the California Police Chiefs Association. "98 percent of the people who are acquiring marijuana at these dispensaries do not appear to have the conditions for which the law was intended to apply."
At a dispensary in L.A., users claim a wide array of ailments - chronic neck pain, an ankle injury that required 10 screws and a metal plate, and so forth.
In Oakland, a patient named Charles says marijuana is good for his mental health. "It relieves my anxiety and allows me to cope," he said.
Users in Oakland now pay a special city tax on medical marijuana - a first in the state, but maybe not the last. Marijuana tax promoters say a lot of potential revenue is just going up in smoke.
|
Evidence Packet Dampening Processes of Radicalization at the Individual and Societal Level This paper describes theories that explain why individuals participate in politically violent groups. Some theories suggest that individuals turn to radical means, such as violence, because they possess certain characteristics and/or have undergone particular experiences, which make them more prone to employ political violence. Other theories suggest that an individuals ideological beliefs, level of education and income affect participation in groups that employ political violence. It is important to note that most of the theories described below are about why individuals participate in extremist organizations. In several instances we highlight findings about why civilians might support but not necessary participate in a political violence-producing group.
|
LOS ANGELES—Concerned moviegoing citizens across the nation issued an urgent appeal to Hollywood studios this week to make more films in which a guy is shot multiple times in the chest and then, later on, is revealed to have been wearing a bulletproof vest the whole time. “There need to be a lot more movies where the main guy gets shot a bunch and we think he’s dead, but after a little while he gets back up because he’s actually still alive,” said Little Rock, AR resident Sarah Greene, echoing the sentiments of millions of Americans as she further stipulated that the individual must at some point rip open his shirt to show the audience the vest and the flattened bullets embedded within it. “And the movies better show somebody holding the guy’s head in their lap and crying because they think he’s been killed. Or they should have a part where, after the guy’s been shot, he lifts his gun up out of nowhere and shoots the guy who shot him—right before that guy is about to shoot someone else.” The nation’s movie viewers also demanded more ending scenes in which the action subsides for a moment before a good guy shoots a bad guy we thought was already dead even though he really wasn’t.
Advertisement
|
package models
import (
"encoding/json"
"io/ioutil"
"log"
)
func NewItems() Items {
items := make(Items)
return items
}
// returns JSON string
func (items Items) String() string {
b, err := json.Marshal(items)
if err != nil {
log.Println(err)
}
s := string(b[:])
return s
}
// Load items from JSON.
// clobbers current Items
func (items *Items) LoadJSON(s string) error {
err := json.Unmarshal([]byte(s), items)
if err != nil {
return err
}
return nil
}
// Store all the items as JSON in a file
func (items Items) Store(filename string) error {
b, err := json.Marshal(items)
if err != nil {
return err
}
err = ioutil.WriteFile(filename, b, 0644)
if err != nil {
return err
}
return nil
}
|
The family of a pioneering surgeon has funded new equipment to support the work of the current team of breast care doctors at Lynn’s Queen Elizabeth Hospital.
Mike Hudson, who died in 2017, aged 81, played a leading role in the creation of a multi-disciplinary unit at the hospital when national screening programmes began in the early 1990s.
Now, donations from his funeral have been used to pay for a specialist headworn light which surgeons can wear during operations.
And members of Mr Hudson’s family have been to the hospital to see the equipment for themselves.
His widow, Sally, said: “Mike was well-known and much loved so we felt it was important for the money to go towards something special for the Unit and its patients.
“As a surgeon, Mike will be fondly remembered for fiddling with the overhead lights in theatre so he would think this head torch is a great idea.
Mr Hudson worked in the QEH unit having previously written academic papers on the benefits of screening programmes after winning a scholarship to study in America in the 1970s.
Consultant oncoplastic breast surgeon Amy Burger said the device was already making a big difference to the work of her and her colleagues.
She said: “We are incredibly grateful to Mike’s family for the donation which has allowed us to buy this light.
“The light has made a big difference to intricate surgery, particularly reconstructive operations, as the powerful beam follows the line of my eyesight.
|
package org.vaadin.viritin.layouts;
import org.vaadin.viritin.fluency.ui.FluentPanel;
import com.vaadin.ui.Component;
import com.vaadin.ui.Panel;
/**
* Fluent Panel
*/
public class MPanel extends Panel implements FluentPanel<MPanel> {
private static final long serialVersionUID = -7384406421724902867L;
public MPanel() {
super();
}
public MPanel(Component content) {
super(content);
}
public MPanel(String caption) {
super(caption);
}
public MPanel(String caption, Component content) {
super(caption, content);
}
}
|
Inspectors have issued their most scathing report on a Scottish school after witnessing a gang fight and hearing how pupils were concerned for the personal safety.
Officials who arrived unannounced at Musselburgh Grammar School said they felt obliged to extend their visit amid serious doubts over standards of discipline and security.
Inspectors said they witnessed "a fight between rival gangs at the entrance area of the school" in East Lothian and were aware of other "serious incidents".
And in a survey of pupils' views, one third of those who responded "expressed concerns about their safety in school".
A similar number said the school - which is a comprehensive, though it has retained its historical name - failed to deal effectively with the problem of bullying and parents also complained about poor behaviour.
The inspectors said: "The serious incidents in and around the school had a disturbing effect on its general atmosphere."
They also cited difficulty by some staff in dealing with pupils "who presented severe behavioural problems and a larger group of pupils who displayed minor but more persistent problems including an unwillingness to work".
Half of those parents interviewed "felt the school did not have a good reputation in the community".
The HM Inspectors of Schools report identifies major weaknesses in safety, security, care and welfare - although the staff are praised for trying to cope with what are described as unusually difficult challenges.
East Lothian Council and the school's headteacher, Terry Christie - who is also the manager of Alloa Athletic Football Club - say the report is unfair in its representation of the school.
But the inspectors say they want action taken immediately.
They call for improvements in security and pupil safety "as a matter of urgency" and want the headteacher and staff to develop a strategy for dealing with "serious weaknesses in the school's ethos and arrangements for care and welfare".
Scotland's Chief Inspector of Schools, Douglas Osler, said the decision to turn up at the school without prior warning had not indicated prior concern over standards at the school.
"There has always been a view with perhaps some of our inspections we should turn up unannounced, partly because it relieves the stress on teachers in the preparation period," he said.
"And also because it allows us to compare with inspections that are announced."
East Lothian Council Leader, Norman Murray, said measures are already being taken to improve pupil safety and he expressed unhappiness at the way the school has been portrayed to the media.
He said: "We are improving security at the school and are looking very closely at installing closed circuit television. That's not an over-reaction to the situation we were looking at doing that anyway.
"But I do want to get away from the idea that Musselburgh Grammar and Musselburgh itself is a lawless town."
|
Consanguineous Marriage and Intellectual and Developmental Disabilities among Arab Bedouins Children of the Negev Region in Southern Israel: A Pilot Study In this article, we present data from two special education schools that serve the Arab Bedouin population in the Negev region in southern Israel. Data were collected on 221 children (53.8% female and 46.2% male) with moderate and severe intellectual and developmental disability (IDD) in order to assess the extent of consanguineous background in these children. Findings showed that 61.5% of all the participants were offspring of parents who were biologically related, both first and second cousins. Almost 70% of the participants were diagnosed with moderate IDD, 20% with severe IDD, and 10% diagnosed with other developmental disorders. It is recommended to further investigate this population for a more detailed history and specific genetic disorders for appropriate genetic counseling for those already married and also to focus public health efforts to decrease the rate of marriages between relatives. Consanguinity is a well-known risk factor for genetic disorders, including diseases and syndromes that present with intellectual and developmental disabilities. This is due to autosomal recessive disorders and also other inherited disorders. The vast majority of the behavioral genetics studies, which for the most part have focused on twins and adoptees have been conducted in highly industrialized western societies such as the United States and Northern European countries. Despite the important and influential research undertaken on the impact of genetics and consanguineous marriage and the extent to which public awareness has been raised by these findings, only a limited number of investigations have been carried out in collective, non-western societies (e.g., Africa, Asia, and the Middle East) and there is scant empirical evidence regarding the genetic influence of consanguineous marriage in these societies. In these societies, consanguineous marriage is a common feature. There is, for example, a long tradition of such marriages in Japan, India, Sudani tribes, and Arab societies (38). Consanguineous marriage is also commonplace in the population of about 200,000 Bedouin Arabs living in the Negev desert in the south of Israel. Studies conducted in Indian rural and urban populations showed a higher frequency of consanguineous marriages in rural compared with urban communities. One study showed that about 50% of all marriages in the rural population were consanguineous marriages with 52.6% of these consanguineous marriages involving first cousin; whereas, in the urban area, consanguineous marriages accounted for about 30% of the total number of marriages, with 60.9% of these marriages involving first cousin relationships. Research indicates that a large segment of the world population practices certain forms of inbreeding. According to Bittles, 2050% of all marriages occur between biologically related people in parts of Central, South, and West Asia and North Africa. The most popular matches are between first cousins, double first cousins (where the spouses share both sets of grandparents), or uncles and nieces. Although less than 1% of marriages are consanguineous in North America and Europe, up to 10% of marriages in East and West Africa and South America are between kin. The percentages could also be high in rapidly growing populations in Middle Africa, the Caribbean, Central America, East Asia, and Southeast Asia, for which no reliable figures exist. Changes in culture and the influence of the Western World also affect the rate of consanguineous marriage resulting in a decrease today. Among parents of 14,237 newborns in Bahrain in 20082009, the total consanguinity and first cousin marriage rates over a period of 4months in 2008 were 10.9 and 6.9% respectively; while during all of 2009 the rates were 11.4 and 6.8% respectively. Compared with earlier data, first cousin marriage rates in Bahrain declined from 24% to nearly 7%. INTRODUCTION In this article, we present data from two special education schools that serve the Arab Bedouin population in the Negev region in southern Israel. Data were collected on 221 children (53.8% female and 46.2% male) with moderate and severe intellectual and developmental disability (IDD) in order to assess the extent of consanguineous background in these children. Findings showed that 61.5% of all the participants were offspring of parents who were biologically related, both first and second cousins. Almost 70% of the participants were diagnosed with moderate IDD, 20% with severe IDD, and 10% diagnosed with other developmental disorders. It is recommended to further investigate this population for a more detailed history and specific genetic disorders for appropriate genetic counseling for those already married and also to focus public health efforts to decrease the rate of marriages between relatives. Consanguinity is a well-known risk factor for genetic disorders, including diseases and syndromes that present with intellectual and developmental disabilities. This is due to autosomal recessive disorders and also other inherited disorders. The vast majority of the behavioral genetics studies, which for the most part have focused on twins and adoptees have been conducted in highly industrialized western societies such as the United States and Northern European countries. Despite the important and influential research undertaken on the impact of genetics and consanguineous marriage and the extent to which public awareness has been raised by these findings, only a limited number of investigations have been carried out in collective, non-western societies (e.g., Africa, Asia, and the Middle East) and there is scant empirical evidence regarding the genetic influence of consanguineous marriage in these societies. In these societies, consanguineous marriage is a common feature. There is, for example, a long tradition of such marriages in Japan, India, Sudani tribes, and Arab societies. Consanguineous marriage is also commonplace in the population of about 200,000 Bedouin Arabs living in the Negev desert in the south of Israel. Studies conducted in Indian rural and urban populations showed a higher frequency of consanguineous marriages in rural compared with urban communities. One study showed that about 50% of all marriages in the rural population were consanguineous marriages with 52.6% of these consanguineous marriages involving first cousin; whereas, in the urban area, consanguineous marriages accounted for about 30% of the total number of marriages, with 60.9% of these marriages involving first cousin relationships. Research indicates that a large segment of the world population practices certain forms of "inbreeding." According to Bittles, 20-50% of all marriages occur between biologically related people in parts of Central, South, and West Asia and North Africa. The most popular matches are between first cousins, double first cousins (where the spouses share both sets of grandparents), or uncles and nieces. Although less than 1% of marriages are consanguineous in North America and Europe, up to 10% of marriages in East and West Africa and South America are between kin. The percentages could also be high in rapidly growing populations in Middle Africa, the Caribbean, Central America, East Asia, and Southeast Asia, for which no reliable figures exist. Changes in culture and the influence of the Western World also affect the rate of consanguineous marriage resulting in a decrease today. Among parents of 14,237 newborns in Bahrain in 2008-2009, the total consanguinity and first cousin marriage rates over a period of 4 months in 2008 were 10.9 and 6.9% respectively; www.frontiersin.org while during all of 2009 the rates were 11.4 and 6.8% respectively. Compared with earlier data, first cousin marriage rates in Bahrain declined from 24% to nearly 7%. A PILOT STUDY The pilot study was conducted in two special education schools in the south of Israel and included 221 children with moderate and severe intellectual disability (aged 6-18 years). The data collection was conducted via records from the schools on age, gender, genetic relation between parents, and the degree of intellectual disability. In Israel, children are sent to special schools after standard assessment procedures and following the recommendations of local professional committees that review the children's records, tests, and assessments. This study was performed with the approval of the IRB of the Negev Regional Center for Research Development, Beer-Sheva, Israel. RESULTS The sample size included all 221children enrolled in both schools, of them 119 (54%) were boys and 102 (46%) were girls. All children in these schools were diagnosed with intellectual disability and no borderline children were enrolled in both schools. Almost 70% (69.7%) of the children had moderate intellectual disability, about 20% (20.4%) severe, and 10% of the participants with other developmental disorder. One hundred thirty-six (61.5%) of these children were offspring of consanguineous marriages. DISCUSSION This initial screening clearly indicates that the vast majority of the study population was children of consanguineous couples. This puts the offspring's health at risk and raises the question about the public awareness of the genetic risks of consanguineous marriages for cultural and socio-economic motives. Since this part of the Arab population (Arab Bedouins of the Negev) is a traditional population, it is important to work on public health efforts to decrease the incidence of consanguineous couples. As many of these marriages are set between the parents of the young couples, a better understanding of the possible consequences of marriage within the family may prevent such marriages to be set, hence preventing disorders in the offspring. The findings of the present study are similar to findings from other studies indicating that intellectual and developmental disabilities in addition to other genetic disorders are most likely to occur among inbred offspring and the risk is significantly higher than in nonconsanguineous families. Although most researchers accept the causal role of genetics, the exact genetic link and how it operates needs more investigations. Researchers in Israel identified a protein-truncating mutation, G408fsX437, in the gene CC2D1A on chromosome 19p13.12 in nine consanguineous Israeli Arab families with severe autosomal recessive disease and intellectual disability. The subjects tested were healthy women who were invited to undergo the genetic screening test as a part of their routine pregnancy monitoring and 117 reported a family history positive for intellectual disability. About 524 pregnant or pre-conceptional women were tested and found 47 carriers (approximately 1/11), whose spouses were then recommended to undergo testing. Eight carrier couples were identified, who were given genetic counseling and offered prenatal diagnosis. Of all the marriages, 28.6% were consanguineous; 16.5% of the total was between first cousins. The high prevalence of the mutation can be explained both by the founder effect owing to the generally high consanguinity rate among the inhabitants of the village, and also because two families with excessive numbers of offspring with intellectual disability were unacceptable as marriage partners by the rest of the families. In Jordan, 20-30% of all marriages are cousin mating and 69% of these are first cousin. Among families of first cousin mating, about 30% had the highest rate of autosomal recessive conditions for different genetic disorders, such as sporadic undiagnosed cases of intellectual disability, congenital anomalies, and dimorphism in which they may have autosomal recessive etiology. In Qatar, a study of 1,515 women found 54% consanguineous marriages and the most common form again between first cousins. Inbred children of these women had a significantly higher rate of asthma, intellectual disability, epilepsy, and diabetes compared with children of nonconsanguineous couples. A recent study from Brazil in a house-to-house population-based survey in the state of Paraba, 20,462 couples were interviewed regarding kinship relation, number of siblings, and offspring affected by intellectual or physical disabilities. The rate of consanguineous unions in the communities ranged from 6 to 41%. The overall average inbreeding coefficient (F ) was 0.00602 ± 0.00253, ranging from 0.00134 to 0.01182. Communities situated on the backlands had an increased average value of F compared to those closer to the seashore (P = 0.024). The average rate of disabled offspring varied from 2.96 ± 0.68% for unrelated unions to 10.44 ± 16.86% for related couples at the level of double first cousins or uncle-niece. The above research examples show that marriage in the family increases the risk of disability. The Bedouin Arabs of the Negev in southern Israel have practiced cousinmarriages for generations as a part of their cultural tradition. The exact rate of consanguineous marriages in this population is unknown. According to behavioral genetics theory, this type marriage puts the offspring at risk for a variety of genetically influenced disorders. Consequently, such children are likely to have lower cognitive ability including different degrees of IDDs in addition to genetic disease along with these disorders. In conclusion, it is recommended to further investigate this population for a more detailed history and specific genetic disorders for appropriate genetic counseling for those already married and also to focus public health efforts to decrease the rate of marriages between relatives.
|
/**
*
* @author Christian Beikov
* @since 1.2.0
*/
public class GroupByTest extends AbstractCoreTest {
@Test
public void simpleGroupBy() {
BlazeCriteriaQuery<Long> cq = BlazeCriteria.get(cbf, Long.class);
BlazeCriteriaBuilder cb = cq.getCriteriaBuilder();
Root<Document> root = cq.from(Document.class, "document");
cq.select(cb.count(root.get(Document_.id)));
cq.groupBy(root.get(Document_.age));
CriteriaBuilder<?> criteriaBuilder = cq.createCriteriaBuilder(em);
assertEquals("SELECT COUNT(document.id) FROM Document document GROUP BY document.age", criteriaBuilder.getQueryString());
}
@Test
public void groupByWithHaving() {
BlazeCriteriaQuery<Tuple> cq = BlazeCriteria.get(cbf, Tuple.class);
BlazeCriteriaBuilder cb = cq.getCriteriaBuilder();
Root<Document> root = cq.from(Document.class, "document");
cq.multiselect(root.get(Document_.age), cb.count(root.get(Document_.id)));
cq.groupBy(root.get(Document_.age));
cq.having(cb.gt(cb.count(root.get(Document_.id)), 1));
CriteriaBuilder<?> criteriaBuilder = cq.createCriteriaBuilder(em);
assertEquals("SELECT document.age, COUNT(document.id) FROM Document document GROUP BY document.age HAVING COUNT(document.id) > 1L", criteriaBuilder.getQueryString());
}
}
|
Polyphenol-rich sorghum brans alter colon microbiota and impact species diversity and species richness after multiple bouts of dextran sodium sulfate-induced colitis. The microbiota affects host health, and dysbiosis is involved in colitis. Sorghum bran influences butyrate concentrations during dextran sodium sulfate (DSS) colitis, suggesting microbiota changes. We aimed to characterize the microbiota during colitis, and ascertain if polyphenol-rich sorghum bran diets mitigate these effects. Rats (n = 80) were fed diets containing 6% fiber from cellulose, or Black (3-deoxyanthocyanins), Sumac (condensed tannins), or Hi Tannin black (both) sorghum bran. Inflammation was induced three times using 3% DSS for 48 h (40 rats, 2 week separation), and the microbiota characterized by pyrosequencing. The Firmicutes/Bacteroidetes ratio was higher in Cellulose DSS rats. Colonic injury negatively correlated with Firmicutes, Actinobacteria, Lactobacillales and Lactobacillus, and positively correlated with Unknown/Unclassified. Post DSS#2, richness was significantly lower in Sumac and Hi Tannin black. Post DSS#3 Bacteroidales, Bacteroides, Clostridiales, Lactobacillales and Lactobacillus were reduced, with no Clostridium identified. Diet significantly affected Bacteroidales, Bacteroides, Clostridiales and Lactobacillus post DSS#2 and #3. Post DSS#3 diet significantly affected all genus, including Bacteroides and Lactobacillus, and diversity and richness increased. Sumac and Hi Tannin black DSS had significantly higher richness compared to controls. Thus, these sorghum brans may protect against alterations observed during colitis including reduced microbial diversity and richness, and dysbiosis of Firmicutes/Bacteroidetes.
|
<reponame>dblandan/OpenNMT-tf
import tensorflow as tf
import numpy as np
from opennmt.layers import transformer
class TransformerTest(tf.test.TestCase):
def testTileSequenceLength(self):
num_heads = 2
length = [5, 3, 7]
tiled_length = transformer.tile_sequence_length(length, num_heads)
with self.test_session() as sess:
tiled_length = sess.run(tiled_length)
self.assertAllEqual([5, 5, 3, 3, 7, 7], tiled_length)
def testBuildSequenceMask(self):
num_heads = 4
length = [5, 3, 7]
expected = [
[1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0],
[1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0],
[1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]]
mask = transformer.build_sequence_mask(tf.constant(length), num_heads=num_heads)
with self.test_session() as sess:
mask = sess.run(mask)
mask = np.reshape(mask, (len(length), num_heads, max(length)))
mask = np.transpose(mask, (1, 0, 2))
for b in range(len(length)):
self.assertAllEqual(expected, mask[b])
def testBuildSequenceMaskWithMaxLen(self):
num_heads = 4
length = [5, 3, 6]
maximum_length = 7
expected = [
[1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0],
[1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0],
[1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0]]
mask = transformer.build_sequence_mask(
tf.constant(length), num_heads=num_heads, maximum_length=maximum_length)
with self.test_session() as sess:
mask = sess.run(mask)
mask = np.reshape(mask, (len(length), num_heads, maximum_length))
mask = np.transpose(mask, (1, 0, 2))
for b in range(len(length)):
self.assertAllEqual(expected, mask[b])
def testBuildFutureMask(self):
num_heads = 4
length = [2, 4, 3]
expected = [
[[1.0, 0.0, 0.0, 0.0],
[1.0, 1.0, 0.0, 0.0],
[1.0, 1.0, 0.0, 0.0],
[1.0, 1.0, 0.0, 0.0]],
[[1.0, 0.0, 0.0, 0.0],
[1.0, 1.0, 0.0, 0.0],
[1.0, 1.0, 1.0, 0.0],
[1.0, 1.0, 1.0, 1.0]],
[[1.0, 0.0, 0.0, 0.0],
[1.0, 1.0, 0.0, 0.0],
[1.0, 1.0, 1.0, 0.0],
[1.0, 1.0, 1.0, 0.0]]]
mask = transformer.build_future_mask(tf.constant(length), num_heads=num_heads)
with self.test_session() as sess:
mask = sess.run(mask)
mask = np.transpose(mask, (1, 0, 2, 3))
for b in range(len(length)):
self.assertAllEqual(expected, mask[b])
def testBuildFutureMaskWithMaxLen(self):
num_heads = 4
length = [2, 4, 3]
maximum_length = 5
expected = [
[[1.0, 0.0, 0.0, 0.0, 0.0],
[1.0, 1.0, 0.0, 0.0, 0.0],
[1.0, 1.0, 0.0, 0.0, 0.0],
[1.0, 1.0, 0.0, 0.0, 0.0],
[1.0, 1.0, 0.0, 0.0, 0.0]],
[[1.0, 0.0, 0.0, 0.0, 0.0],
[1.0, 1.0, 0.0, 0.0, 0.0],
[1.0, 1.0, 1.0, 0.0, 0.0],
[1.0, 1.0, 1.0, 1.0, 0.0],
[1.0, 1.0, 1.0, 1.0, 0.0]],
[[1.0, 0.0, 0.0, 0.0, 0.0],
[1.0, 1.0, 0.0, 0.0, 0.0],
[1.0, 1.0, 1.0, 0.0, 0.0],
[1.0, 1.0, 1.0, 0.0, 0.0],
[1.0, 1.0, 1.0, 0.0, 0.0]]]
mask = transformer.build_future_mask(
tf.constant(length), num_heads=num_heads, maximum_length=maximum_length)
with self.test_session() as sess:
mask = sess.run(mask)
mask = np.transpose(mask, (1, 0, 2, 3))
for b in range(len(length)):
self.assertAllEqual(expected, mask[b])
def testSplitHeads(self):
batch_size = 3
length = [5, 3, 7]
num_heads = 8
depth = 20
inputs = tf.placeholder_with_default(
np.random.randn(batch_size, max(length), depth * num_heads).astype(np.float32),
shape=(None, None, depth * num_heads))
outputs = transformer.split_heads(inputs, num_heads)
static_shape = outputs.get_shape().as_list()
self.assertEqual(num_heads, static_shape[1])
self.assertEqual(depth, static_shape[-1])
with self.test_session() as sess:
outputs = sess.run(outputs)
self.assertAllEqual([batch_size, num_heads, max(length), depth], outputs.shape)
def testCombineHeads(self):
batch_size = 3
length = [5, 3, 7]
num_heads = 8
depth = 20
inputs = tf.placeholder_with_default(
np.random.randn(batch_size, num_heads, max(length), depth).astype(np.float32),
shape=(None, num_heads, None, depth))
outputs = transformer.combine_heads(inputs)
static_shape = outputs.get_shape().as_list()
self.assertEqual(depth * num_heads, static_shape[-1])
with self.test_session() as sess:
outputs = sess.run(outputs)
self.assertAllEqual([batch_size, max(length), depth * num_heads], outputs.shape)
def testSplitAndCombineHeads(self):
batch_size = 3
length = [5, 3, 7]
num_heads = 8
depth = 20
inputs = tf.placeholder_with_default(
np.random.randn(batch_size, max(length), depth * num_heads).astype(np.float32),
shape=(None, None, depth * num_heads))
split = transformer.split_heads(inputs, num_heads)
combined = transformer.combine_heads(split)
with self.test_session() as sess:
inputs, combined = sess.run([inputs, combined])
self.assertAllEqual(inputs, combined)
def testScaledDotAttention(self):
batch_size = 3
num_heads = 8
values_length = [5, 3, 7]
queries_length = [8, 6, 10]
depth = 20
queries = tf.placeholder_with_default(
np.random.randn(batch_size, num_heads, max(queries_length), depth).astype(np.float32),
shape=(None, num_heads, None, depth))
values = tf.placeholder_with_default(
np.random.randn(batch_size, num_heads, max(values_length), depth).astype(np.float32),
shape=(None, num_heads, None, depth))
keys = values
mask = transformer.build_sequence_mask(values_length, num_heads=num_heads)
context, attn = transformer.dot_product_attention(
queries,
keys,
values,
tf.estimator.ModeKeys.PREDICT,
mask=mask)
with self.test_session() as sess:
context, attn = sess.run([context, attn])
self.assertTupleEqual(
(batch_size, num_heads, max(queries_length), depth), context.shape)
self.assertTupleEqual(
(batch_size, num_heads, max(queries_length), max(values_length)), attn.shape)
for i in range(batch_size):
length = values_length[i]
padding_length = max(values_length) - length
if padding_length > 0:
self.assertEqual(0.0, np.sum(attn[i, :, :, length:max(values_length)]))
def testMaskedScaledDotAttention(self):
batch_size = 3
num_heads = 8
queries_length = [8, 6, 10]
depth = 20
queries = tf.placeholder_with_default(
np.random.randn(batch_size, num_heads, max(queries_length), depth).astype(np.float32),
shape=(None, num_heads, None, depth))
mask = transformer.build_future_mask(queries_length, num_heads=num_heads)
context, attn = transformer.dot_product_attention(
queries,
queries,
queries,
tf.estimator.ModeKeys.PREDICT,
mask=mask)
with self.test_session() as sess:
context, attn = sess.run([context, attn])
illegal_connections = np.triu_indices(max(queries_length), 1)
for i in range(batch_size):
for h in range(num_heads):
self.assertEqual(0.0, np.sum(attn[i, h][illegal_connections]))
if __name__ == "__main__":
tf.test.main()
|
Scores will be continuously updated throughout the night.
It's Week 3 of the high school football season, and the Citizen-Times is gearing up for another great Friday night of coverage.
Scores here will be continually updated throughout the evening.
More: 'Game inside the game': Could payout top $20K for Tuscola-Pisgah football 50/50 drawing?
|
FIG. 51 is a circuit diagram showing the construction of a battery pack according to background art. A battery pack 1001 shown in FIG. 51 is provided with a protection circuit 1002 and a secondary battery 1003. The secondary battery 1003 is, for example, a rechargeable secondary battery such as a lithium ion secondary battery, a lithium polymer secondary battery, a nickel-metal-hydride secondary battery or a nickel-cadmium secondary battery. In the case of overcharging or excessive discharge current, such a secondary battery might have characteristics thereof such as cycle life degraded or might undergo expansion, deformation and the like. Accordingly, the battery pack 1001 is provided with the protection circuit 1002 for protecting the secondary battery 1003 from overcharging or excessive discharge current (see, for example, patent documents 1, 2).
The protection circuit 1002 includes external connection terminals 1004, 1005, FETs (Field Effect Transistor) 1006, 1007, reference voltage generators 1008, 1009, comparators 1010, 1111, a resistor 1112 and a logic circuit 1013.
The external connection terminals 1004, 1005 are connection terminals for connecting a charger for charging the secondary battery 1003 and for connecting a power source for driving a mobile device such as a mobile phone or a digital camera, an electric tool, a robot or an electric automobile that is driven by a discharge current from the secondary battery 1003. The external connection terminal 1004, the secondary battery 1003, the FET 1006, the FET 1007 and the external connection terminal 1005 are connected in series.
The FET 1006 is oriented such that an anode of a parasite diode is connected to the secondary battery 1003, whereas the FET 1007 is oriented such that an anode of a parasitic diode is connected to the external connection terminal 1005. The FET 1006 is used as a switch for protection from excessive discharge for cutting off a discharge current if the discharge current of the secondary battery 1003 becomes excessive, whereas the FET 1007 is used as a switch for protection from overcharging for cutting off a charge current if the secondary battery 1003 is overcharged.
Further, a positive electrode terminal of the secondary battery 1003 is connected to a plus terminal of the comparator 1010, a reference voltage Vref1 outputted from the reference voltage generator 1008 is applied to a minus terminal of the comparator 1010, and an output terminal of the comparator 1010 is connected to the logic circuit 1013. A voltage for detecting the overcharging of the secondary battery 1003 is set as the reference voltage Vref1. The comparator 1010 outputs a detection signal representing overcharging to the logic circuit 1013 if the secondary battery 1003 is charged by an unillustrated charger connected to the external connection terminals 1004, 1005 and a terminal voltage of the secondary battery 1003 exceeds the reference voltage Vref1.
Further, a connection point of the FETS 1006, 1007 is connected to a minus terminal of the comparator 1111 via the resistor 1112, and a reference voltage Vref2 outputted from the reference voltage generator 1009 is applied to a plus terminal of the comparator 1111. Thus, a voltage drop caused by the on-resistance of the FET 1006 resulting from the flow of a discharge current from the secondary battery 1003 is applied to the minus terminal of the comparator 1111 via the resistor 1112. The reference voltage Vref2 is set to a voltage corresponding to a voltage drop caused by the on-resistance of the FET 1006, for example, in the case where a maximum discharge current within such a range as not to cause the characteristic degradation of the secondary battery 1003 flows through the FET 1006.
The comparator 1111 detects an increase of the voltage drop in the FET 1006 and outputs a detection signal representing overcurrent discharge to the logic circuit 1013, for example, if the external connection terminals 1004, 1005 are short-circuited together due to the contact with a metal piece or the breakdown of a load device connected to the external connection terminals 1004, 1005 and an excessive discharge current flows from the secondary battery 1003.
The logic circuit 1013 turns the FET 1007 off to stop the charging of the secondary battery 1003 if a detection signal representing overcharging is outputted from the comparator 1010 while turning the FET 1006 off to stop the discharge of the secondary battery 1003 if a detection signal representing overcurrent discharge is outputted from the comparator 1111. In this way, the protection circuit 1002 protects the secondary battery 1003 from overcharging and overcurrent discharge.
Further, a known protection circuit for protecting a secondary battery from overcharging and overcurrent discharge in this way is such as in a battery pack 1021 shown in FIG. 52 in which a secondary battery 1022 and a bimetal switch 1023 are connected in series. If the bimetal switch 1023 is heated due to the heat generation of the secondary battery 1022 or the heat generation of the bimetal switch 1023 itself resulting from overcharging, for example, in the case of the breakdown of a charger 1026 connected with external connection terminals 1024, 1025, this protection circuit cuts off a charge current by turning the bimetal switch 1023 off to protect the secondary battery 1022.
Another known protection circuit is such as in a battery pack 1031 shown in FIG. 53 in which a PTC (Positive Temperature Coefficient) element 1032 in the form of a thermistor that is turned off in the case of exceeding a specified temperature is used, a secondary battery 1033 and the PTC element 1032 are connected in series. If the PTC element 1032 is heated due to the heat generation of the secondary battery 1032 or the heat generation of the PTC element 1033 itself resulting from overcharging, for example, in the case of the breakdown of a charger 1036 connected with external connection terminals 1034, 1035, this protection circuit cuts off a charge current by turning the PTC element 1032 off to protect the secondary battery 1032.
FIG. 54 is a circuit diagram showing another construction of a battery pack according to background art. A battery pack 1141 shown in FIG. 54 is a battery pack used in an electric apparatus, in which a large load current, e.g. 100 A (1 kW) flows such as an electric tool, an electric automobile or a robot. The battery pack 1141 is provided with a protection circuit 1142 and secondary batteries 1143 to 1146. A plurality of secondary batteries 1143 to 1146 are similar to the secondary battery 1003 in the battery pack 1001 and are connected in series to increase an output power.
The protection circuit 1142 is provided with external connection terminals 1147, 1148, FETs 1149, 1150, reference voltage generators 1151 to 1159, comparators 1160 to 1168, AND gates 1169, 1170, a resistor 1171 and a logic circuit 1172.
The external connection terminals 1147, 1148 are connection terminals similar to the external connection terminals 1004, 1005 in the battery pack 1001. The external connection terminal 1147, the secondary batteries 1143 to 1146, the FET 1149, the FET 1150 and the external connection terminal 1148 are connected in series.
The FET 1149 is used as a switch for protection from excessive discharge for cutting off discharge currents similar to the FET 1006 in the battery pack 1001 if discharge currents of the secondary batteries 1143 to 1146 become excessive, whereas the FET 1150 is used as a switch for protection from overcharging for cutting off charge currents similar to the FET 1007 in the battery pack 1001 if the secondary batteries 1143 to 1146 are overcharged.
The comparators 1160, 1162, 1164 and 1166 are for detecting the overcharging of the secondary batteries 1143, 1144, 1145 and 1146, and the comparators 1161, 1163, 1165 and 1167 are for detecting the excessive discharge of the secondary batteries 1143, 1144, 1145 and 1146.
Output voltages of the secondary batteries 1143, 1144, 1145 and 1146 and reference voltages outputted from the reference voltage generators 1151, 1152, 1153 and 1154 are compared by the comparators 1160, 1162, 1164 and 1166, and signals representing the comparison results are outputted to the AND gate 1169. If the output voltages of the secondary batteries 1143, 1144, 1145 and 1146 exceed the respective reference voltages, overcharging is detected and a low-level output voltage of the AND gate 1169 is outputted to the logic circuit 1172, which in turn turns the FET 1150 off to protect the secondary batteries 1143, 1144, 1145 and 1146 from overcharging.
Similarly, output voltages of the secondary batteries 1143, 1144, 1145 and 1146 and reference voltages outputted from the reference voltage generators 1155, 1156, 1157 and 1158 are compared by the comparators 1161, 1163, 1165 and 1167, and signals representing the comparison results are outputted to the AND gate 1170. If the output voltages of the secondary batteries 1143, 1144, 1145 and 1146 fall below the respective reference voltages, excessive discharge is detected and a high-level output voltage of the AND gate 1169 is outputted to the logic circuit 1172, which in turn turns the FET 1149 off to protect the secondary batteries 1143, 1144, 1145 and 1146 from excessive discharge.
Further, a connection point of the FETs 1149 and 1150 is connected to a plus terminal of the comparator 1168 via the resistor 1171, and a reference voltage outputted from the reference voltage generator 1159 is applied to a minus terminal of the comparator 1168. Thus, the discharge currents from the secondary batteries 1143 to 1146 flow through the FET 1149 and a voltage drop caused by the on-resistance of the FET 1149 is applied to the plus terminal of the comparator 1168 via the resistor 1171. The reference voltage generator 1159 is set to generate a voltage corresponding to a voltage drop caused by the on-resistance of the FET 1149, for example, if a maximum discharge current within such a range as not to cause the characteristic degradation of the secondary batteries 1143 to 1146 flows through the FET 1149.
Upon the flow of excessive discharge currents from the secondary batteries 1143 to 1146, the comparator 1168 detects an increase in the voltage drop in the FET 1149 and outputs a detection signal representing overcurrent discharge to the logic circuit 1172.
Upon the output of the detection signal representing overcurrent discharge from the comparator 1168, the logic circuit 1172 turns the FET 1149 off to stop the discharge of the secondary batteries 1143 to 1146. In this way, the protection circuit 1142 protects the secondary batteries 1143 to 1146 from excessive charging and discharging and overcurrent discharge.
However, the protection circuit 1002 shown in FIG. 51 cannot cut off the discharge current and the charge current having different directions of current flows by one FET since the FET includes a parasitic diode, and it has been necessary to provide the FET 1006 for cutting off the discharge current and the FET 1007 for cutting off the charge current. Further, the reference voltage generator 1008 and the comparator 1010 are necessary to detect overcharging; the reference voltage generator 1009, the comparator 1111, and the resistor 1112 are necessary to detect the excessive discharge current; and the logic circuit 1013 is necessary to turn the two FETS 1006, 1007 on and off in accordance with the output signals of the comparators 1010, 1111. This has caused inconvenience of increasing the circuit size of the protection circuit 1002.
Particularly if it is necessary to cause a large load current to flow as in the battery pack 1141 shown in FIG. 54, transistors with a large current rating need to be used as the FETs 1149, 1150, which has caused inconvenience of enlarging the FETs 1149, 1150 and increasing costs. Further, if the output voltage is increased by connecting the secondary batteries in series, the withstand voltages of the FETs 1149, 1150 need to be increased. However, since the transistors having high withstand voltages tend to increase the on-resistances, there has been inconvenience of increasing power losses in the FETs 1149, 1150.
Further, in a construction for protecting the secondary battery from overcharging by connecting a temperature switch, which operates with temperature, such as a bimetal switch or a PTC element with the secondary battery in series as shown in FIGS. 52 and 53, accuracy in detecting overcharging is low. Thus, if the secondary battery continues to be charged with such a charge current as not to suddenly increase temperature as in the case where a battery pack is charged, for example, using a charger having poor accuracy in controlling the charging voltage, the secondary battery is overcharged without the temperature switch operating, thereby causing inconvenience of degrading the characteristics of the secondary battery and leading to a likelihood of expanding or deforming the battery.
Patent Document 1: Japanese Unexamined Patent Publication No. H04-75430
Patent Document 2: Japanese Unexamined Patent Publication No. H11-262270
|
#include <stdbool.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <libmseed.h>
#include "validator.h"
#include "warnings.h"
#include <errno.h>
#include <string.h>
#include <time.h>
#include <libmseed.h>
#include <unpack.h>
#include <mseedformat.h>
bool check_payloads(struct warn_options_s *options, FILE *input, uint32_t payload_len, uint8_t payload_fmt, char* file_name,uint8_t verbose)
{
//Return value, initial state assumes valid payload
bool answer = true;
//TODO incomplete, solution to verify data payload without libmseed functions
char *buffer = (char *) calloc(payload_len +1, sizeof(char));
if (payload_len > fread(buffer, sizeof(char), payload_len, input))
{
ms_log(2,"Error: failed to read record data payload into buffer\n");
answer = false;
}
#if 0
switch (payload_fmt)
{
case 0: /* text */
/* if this was succesfull but already made false we need to keep */
answer = check_payload_text(options, payload_len, buffer)? answer : false;
break;
case 1: /* 16-bit, integer, little-endian*/
case 3: /* 32-bit, integer, little-endian*/
case 4: /* IEEE 32-bit floats, little-endian */
case 5: /* IEEE 64-bit floats (double), little-endian */
case 10: /* Steim-1 integer compressin, big-endian */
case 11: /* Steim-2 integer compressin, big-endian */
case 19: /* Steim-3 integer compressin, big-endian */
case 53: /* 32-bit integer, little-endian, general compressor */
case 54: /* 32-bit IEEE floats, little-endian, general compressor */
case 55: /* 64-bit IEEE floats, little-endian, general compressor */
break;
default:
/* invalid payload type */
answer = false;
break;
}
#endif
if (buffer)
{
free(buffer);
}
//End of incomplete solution, see prev TODO
//Solution using libmseed builtin functions to
bool print_data = false;
if(verbose > 2)
{
print_data = true;
}
//Decode and check using libmseed's functions
MS3Record *msr = NULL;
MS3Record *msrOut = NULL;
int retcode;
int ierr;
uint32_t flags;
//unpack data payload, check CRC
flags |= MSF_UNPACKDATA;
flags |= MSF_VALIDATECRC;
while ((ms3_readmsr (&msr, file_name, 0, NULL, 0, verbose) == MS_NOERROR ))
{
//msr3_print (msr, verbose);
//TODO get status message
if (msr->formatversion == 3)
{
ms_log (0, "Unpacking data for verification\n");
ierr = msr3_unpack_mseed3(msr->record, msr->reclen,&msrOut, flags, verbose);
//ierr = msr3_parse(msr->record, msr->reclen,&msrOut, flags, ppackets);
//ierr = ms_parse_raw3 (msr->record, msr->reclen, ppackets);
if(ierr != MS_NOERROR)
{
//TODO more verbose error output
ms_log(2,"Error: Format 3 payload parsing failed. ms_unpack_mseed3 returned: %d\n", ierr);
answer = false;
} else
{
ms_log(0,"Data unpacked successfully\n");
}
}
else
{
ms_log(2,"Error: Format version not version 3, read as version: %d",msr->formatversion);
ms_log(2,"Attepting to parse as format 2");
ierr = msr3_unpack_mseed2 (msr->record, msr->reclen,&msrOut, flags, verbose);
if(ierr > 0)
{
ms_log(2,"Error: Format 2 payload parsing failed. ms_unpack_mseed2 returned: %d\n", ierr);
answer = false;
}
}
if (msrOut->numsamples > 0 && print_data)
{
int line, col, cnt, samplesize;
int lines = (msrOut->numsamples / 6) + 1;
void *sptr;
if ((samplesize = ms_samplesize (msrOut->sampletype)) == 0)
{
ms_log (2, "Unrecognized sample type: '%c'\n", msrOut->sampletype);
answer = false;
}
if (msrOut->sampletype == 'a')
{
char *ascii = (char *)msrOut->datasamples;
int length = msrOut->numsamples;
ms_log (0, "ASCII Data:\n");
/* Print maximum log message segments */
while (length > (MAX_LOG_MSG_LENGTH - 1))
{
ms_log (0, "%.*s", (MAX_LOG_MSG_LENGTH - 1), ascii);
ascii += MAX_LOG_MSG_LENGTH - 1;
length -= MAX_LOG_MSG_LENGTH - 1;
}
/* Print any remaining ASCII and add a newline */
if (length > 0)
{
ms_log (0, "%.*s\n", length, ascii);
}
else
{
ms_log (0, "\n");
}
}
else
{
for (cnt = 0, line = 0; line < lines; line++) {
for (col = 0; col < 6; col++) {
if (cnt < msrOut->numsamples) {
sptr = (char *) msrOut->datasamples + (cnt * samplesize);
if (msrOut->sampletype == 'i')
ms_log(0, "%10d ", *(int32_t *) sptr);
else if (msrOut->sampletype == 'f')
ms_log(0, "%10.8g ", *(float *) sptr);
else if (msrOut->sampletype == 'd')
ms_log(0, "%10.10g ", *(double *) sptr);
cnt++;
}
}
ms_log(0, "\n");
}
}
} else if(!msrOut->numsamples > 0) // if numsamples is <= 0 // if numsamples is <= 0
{
ms_log(0,"No samples found, Num samples = %d\n", msrOut->numsamples);
}
}
return answer;
}
#if 0
/***************************************************************************
* lmtestparse.c
*
* A program for libmseed parsing tests.
*
* Written by <NAME>, IRIS Data Management Center
***************************************************************************/
static int testFile (char* file_name,int argc, char **argv);
static int parameter_proc (int argcount, char **argvec);
static void print_stderr (char *message);
static void usage (void);
/* Binary I/O for Windows platforms */
#ifdef LMP_WIN
unsigned int _CRT_fmode = _O_BINARY;
#endif
int testFile (char* file_name,int argc, char **argv)
{
static flag verbose = 3;
static flag ppackets = 1;
static flag basicsum = 1;
static flag tracegap = 0;
static int printraw = 0;
static int printdata = 0;
static int reclen = -1;
static char *inputfile = 0;
static double timetol = -1.0; /* Time tolerance for continuous traces */
static double sampratetol = -1.0; /* Sample rate tolerance for continuous traces */
MS3TraceList *mstl = 0;
MS3Record *msr = 0;
uint32_t flags = 0;
int64_t totalrecs = 0;
int64_t totalsamps = 0;
int retcode;
/* Redirect libmseed logging facility to stderr for consistency */
//ms_loginit (print_stderr, NULL, print_stderr, NULL);
/* Process given parameters (command line and parameter file) */
// if (parameter_proc (argc, argv) < 0)
// return -1;
inputfile = file_name;
/* Validate CRC and unpack data samples */
flags |= MSF_VALIDATECRC;
//if (printdata)
flags |= MSF_UNPACKDATA;
//if (tracegap)
mstl = mstl3_init (NULL);
/* Loop over the input file */
while (ms3_readmsr (&msr, inputfile, NULL, NULL, flags, verbose))
{
totalrecs++;
totalsamps += msr->samplecnt;
if (tracegap)
{
mstl3_addmsr (mstl, msr, 0, 1, timetol, sampratetol);
}
else
{
if ( printraw )
{
if (msr->formatversion == 3)
ms_parse_raw3 (msr->record, msr->reclen, ppackets);
else
ms_parse_raw2 (msr->record, msr->reclen, ppackets, -1);
}
else
{
msr3_print (msr, ppackets);
}
if (printdata && msr->numsamples > 0)
{
int line, col, cnt, samplesize;
int lines = (msr->numsamples / 6) + 1;
void *sptr;
if ((samplesize = ms_samplesize (msr->sampletype)) == 0)
{
ms_log (2, "Unrecognized sample type: '%c'\n", msr->sampletype);
}
if (msr->sampletype == 'a')
{
char *ascii = (char *)msr->datasamples;
int length = msr->numsamples;
ms_log (0, "ASCII Data:\n");
/* Print maximum log message segments */
while (length > (MAX_LOG_MSG_LENGTH - 1))
{
ms_log (0, "%.*s", (MAX_LOG_MSG_LENGTH - 1), ascii);
ascii += MAX_LOG_MSG_LENGTH - 1;
length -= MAX_LOG_MSG_LENGTH - 1;
}
/* Print any remaining ASCII and add a newline */
if (length > 0)
{
ms_log (0, "%.*s\n", length, ascii);
}
else
{
ms_log (0, "\n");
}
}
else
for (cnt = 0, line = 0; line < lines; line++)
{
for (col = 0; col < 6; col++)
{
if (cnt < msr->numsamples)
{
sptr = (char *)msr->datasamples + (cnt * samplesize);
if (msr->sampletype == 'i')
ms_log (0, "%10d ", *(int32_t *)sptr);
else if (msr->sampletype == 'f')
ms_log (0, "%10.8g ", *(float *)sptr);
else if (msr->sampletype == 'd')
ms_log (0, "%10.10g ", *(double *)sptr);
cnt++;
}
}
ms_log (0, "\n");
/* If only printing the first 6 samples break out here */
if (printdata == 1)
break;
}
}
}
}
if (retcode != MS_ENDOFFILE)
ms_log (2, "Cannot read %s: %s\n", inputfile, ms_errorstr (retcode));
if (tracegap)
mstl3_printtracelist (mstl, 0, 1, 1);
/* Make sure everything is cleaned up */
ms3_readmsr (&msr, NULL, NULL, NULL, flags, 0);
if (mstl)
mstl3_free (&mstl, 0);
if (basicsum)
ms_log (1, "Records: %" PRId64 ", Samples: %" PRId64 "\n",
totalrecs, totalsamps);
return 0;
} /* End of main() */
/***************************************************************************
* parameter_proc():
* Process the command line parameters.
*
* Returns 0 on success, and -1 on failure
***************************************************************************/
static int
parameter_proc (int argcount, char **argvec)
{
#if 0
int optind;
/* Process all command line arguments */
for (optind = 1; optind < argcount; optind++)
{
if (strcmp (argvec[optind], "-V") == 0)
{
// ms_log (1, "%s version: %s\n", PACKAGE, VERSION);
exit (0);
}
else if (strcmp (argvec[optind], "-h") == 0)
{
usage ();
exit (0);
}
else if (strncmp (argvec[optind], "-v", 2) == 0)
{
// verbose += strspn (&argvec[optind][1], "v");
}
else if (strncmp (argvec[optind], "-p", 2) == 0)
{
// ppackets += strspn (&argvec[optind][1], "p");
}
else if (strncmp (argvec[optind], "-z", 2) == 0)
{
// printraw = 1;
}
else if (strncmp (argvec[optind], "-d", 2) == 0)
{
// printdata = 1;
}
else if (strncmp (argvec[optind], "-D", 2) == 0)
{
// printdata = 2;
}
else if (strncmp (argvec[optind], "-tg", 3) == 0)
{
// tracegap = 1;
}
else if (strcmp (argvec[optind], "-s") == 0)
{
// basicsum = 1;
}
else if (strcmp (argvec[optind], "-r") == 0)
{
reclen = atoi (argvec[++optind]);
}
else if (strncmp (argvec[optind], "-", 1) == 0 &&
strlen (argvec[optind]) > 1)
{
ms_log (2, "Unknown option: %s\n", argvec[optind]);
exit (1);
}
else if (inputfile == 0)
{
inputfile = argvec[optind];
}
else
{
ms_log (2, "Unknown option: %s\n", argvec[optind]);
exit (1);
}
}
/* Make sure an inputfile was specified */
if (!inputfile)
{
ms_log (2, "No input file was specified\n\n");
ms_log (1, "%s version %s\n\n", PACKAGE, VERSION);
ms_log (1, "Try %s -h for usage\n", PACKAGE);
exit (1);
}
/* Report the program version */
if (verbose)
ms_log (1, "%s version: %s\n", PACKAGE, VERSION);
#endif
return 0;
} /* End of parameter_proc() */
/***************************************************************************
* print_stderr():
* Print messsage to stderr.
***************************************************************************/
static void
print_stderr (char *message)
{
fprintf (stderr, "%s", message);
} /* End of print_stderr() */
#endif
|
Assessment of Screen-Covered Grooved Sodium Heat Pipes for Microreactor Applications Abstract New nuclear reactor designs that incorporate heat pipes are being investigated for possible near-term deployment in terrestrial applications. This study explores the use of screen-covered axially grooved sodium heat pipes and their applicability for providing heat removal for microreactors. A sodium working fluid is appropriate for microreactors operating in the 5 to 20 MW(thermal) range at approximately 650°C. HTPIPE, a legacy software code, was validated for the case of screen-covered grooves and used to perform steady-state analyses to determine the performance limits of a proposed heat pipe design. The performance limits of a sodium heat pipe with a screen-covered square grooved wick structure is compared to that of an equivalent heat pipe with an annular wick. In a horizontal orientation at an operating temperature of 650°C,the performance limits for the heat pipe with an annular wick configuration are 15% higher than for the screen-covered grooved wick. At operating temperatures below 777°C, the annular wick outperforms the screen-covered grooved wick, and at temperatures above 777°C, the screen-covered grooved wick outperforms the annular wick. However, the marginal performance gain at higher temperatures may not justify the use of heat pipes with a screen-covered grooved wick structure due to increased manufacturing costs.
|
/* libscratch - Multipurpose objective C++ library.
Copyright (c) 2015 <NAME> <<EMAIL>>
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
*/
#include "CFileStream.h"
SCRATCH_NAMESPACE_BEGIN;
FileStream::FileStream(void)
{
fs_pfh = NULL;
}
FileStream::~FileStream(void)
{
Close();
}
ULONG FileStream::Size()
{
ULONG ulPos = Location();
Seek(0, SEEK_END);
ULONG ulSize = Location();
Seek(ulPos, SEEK_SET);
return ulSize;
}
ULONG FileStream::Location()
{
return ftell(fs_pfh);
}
void FileStream::Seek(ULONG ulPos, INDEX iOrigin)
{
fseek(fs_pfh, ulPos, iOrigin);
}
BOOL FileStream::AtEOF()
{
return feof(fs_pfh) > 0;
}
BOOL FileStream::Open(const char* szFileName, const char* szMode)
{
// must not already have a handle open
ASSERT(fs_pfh == NULL);
// open file
FILE* pfh = fopen(szFileName, szMode);
// it might not exist
if(pfh == NULL) {
return FALSE;
}
// remember info
fs_strFileName = szFileName;
fs_pfh = pfh;
// success
return TRUE;
}
void FileStream::OpenStdout()
{
fs_strFileName = "stdout";
fs_pfh = stdout;
}
void FileStream::OpenStdin()
{
fs_strFileName = "stdin";
fs_pfh = stdin;
}
void FileStream::OpenStderr()
{
fs_strFileName = "stderr";
fs_pfh = stderr;
}
void FileStream::Close(void)
{
// close the file handle
if(fs_pfh != NULL) {
fclose(fs_pfh);
fs_pfh = NULL;
}
}
void FileStream::Write(const void* p, ULONG iLen)
{
fwrite(p, 1, iLen, fs_pfh);
}
int FileStream::Read(void* pDest, ULONG iLen)
{
return fread(pDest, 1, iLen, fs_pfh);
}
SCRATCH_NAMESPACE_END;
|
Gefitinib in Combination with Gemcitabine and Carboplatin in Never Smokers with Non-small Cell Lung Carcinoma: A Retrospective Analysis Introduction: Randomized placebo-controlled phase III trials failed to show a survival benefit with the addition of gefitinib to platinum-based combination chemotherapy as first-line therapy in unselected patients with advanced non-small cell lung cancer (NSCLC). We conducted a retrospective analysis of the outcome in never smokers with advanced NSCLC who received gemcitabine-carboplatin-gefitinib (GCI) as first-line therapy and compared these patients with a historical control group who received gemcitabine-carboplatin (GC) alone in our center. Methods: Never-smoker patients with chemonaive stage IIIB or IV NSCLC were treated with GCI. These patients were compared with a historical control group of never smokers who had been treated with GC alone as the first-line therapy. Results: A total of 80 patients were reviewed: 51 patients were treated with GCI and 29 with GC. Most patients were women, and adenocarcinoma was the most common histologic subtype. The response rate for patients in the GCI group was 62.7% (95% confidence interval = 48.0875.87), which was higher than that of the GC group, 27.6% (95% CI = 12.7347.24). The GCI group showed a significant improvement in progression-free survival compared with the GC group (hazard ratio of 0.19, 95% CI = 0.1050.351, p < 0.001). The median overall survival for the patients on GCI was 20.5 months compared 14.1 months (p = 0.05) for patients on GC. Conclusion: The addition of gefitinib to first-line chemotherapy improved progression-free survival and overall survival when used as a first-line therapy in never smokers with advanced NSCLC in this retrospective study. A prospective randomized phase III study is needed to confirm this finding.
|
//===--- FunctionSignatureOptUtils.h ----------------------------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
#ifndef SWIFT_SIL_FUNCTIONSIGOPTUTILS_H
#define SWIFT_SIL_FUNCTIONSIGOPTUTILS_H
#include "swift/SIL/SILInstruction.h"
#include "swift/SIL/SILValue.h"
#include "swift/SIL/SILArgument.h"
#include "swift/SIL/SILFunction.h"
#include "swift/SIL/SILDebugScope.h"
#include "swift/SIL/Projection.h"
#include "swift/SILOptimizer/Analysis/Analysis.h"
#include "swift/SILOptimizer/Analysis/AliasAnalysis.h"
#include "swift/SILOptimizer/Analysis/ARCAnalysis.h"
#include "swift/SILOptimizer/Analysis/CallerAnalysis.h"
#include "swift/SILOptimizer/Analysis/RCIdentityAnalysis.h"
#include "swift/SILOptimizer/Utils/Local.h"
#include "swift/SILOptimizer/PassManager/PassManager.h"
namespace swift {
/// A structure that maintains all of the information about a specific
/// SILArgument that we are tracking.
struct ArgumentDescriptor {
/// The argument that we are tracking original data for.
SILFunctionArgument *Arg;
/// Parameter Info.
SILParameterInfo PInfo;
/// The original index of this argument.
unsigned Index;
/// The original decl of this Argument.
const ValueDecl *Decl;
/// Was this parameter originally dead?
bool IsEntirelyDead;
/// Should the argument be exploded ?
bool Explode;
/// This parameter is owned to guaranteed.
bool OwnedToGuaranteed;
/// Is this parameter an indirect result?
bool IsIndirectResult;
/// If non-null, this is the release in the return block of the callee, which
/// is associated with this parameter if it is @owned. If the parameter is not
/// @owned or we could not find such a release in the callee, this is null.
ReleaseList CalleeRelease;
/// The same as CalleeRelease, but the release in the throw block, if it is a
/// function which has a throw block.
ReleaseList CalleeReleaseInThrowBlock;
/// The projection tree of this arguments.
ProjectionTree ProjTree;
ArgumentDescriptor() = delete;
/// Initialize this argument descriptor with all information from A that we
/// use in our optimization.
///
/// *NOTE* We cache a lot of data from the argument and maintain a reference
/// to the original argument. The reason why we do this is to make sure we
/// have access to the original argument's state if we modify the argument
/// when optimizing.
ArgumentDescriptor(SILFunctionArgument *A)
: Arg(A), PInfo(A->getKnownParameterInfo()), Index(A->getIndex()),
Decl(A->getDecl()), IsEntirelyDead(false), Explode(false),
OwnedToGuaranteed(false), IsIndirectResult(A->isIndirectResult()),
CalleeRelease(), CalleeReleaseInThrowBlock(),
ProjTree(A->getModule(), A->getType()) {}
ArgumentDescriptor(const ArgumentDescriptor &) = delete;
ArgumentDescriptor(ArgumentDescriptor &&) = default;
ArgumentDescriptor &operator=(const ArgumentDescriptor &) = delete;
ArgumentDescriptor &operator=(ArgumentDescriptor &&) = default;
/// \returns true if this argument's convention is P.
bool hasConvention(SILArgumentConvention P) const {
return Arg->hasConvention(P);
}
bool canOptimizeLiveArg() const {
return Arg->getType().isObject();
}
/// Return true if it's both legal and a good idea to explode this argument.
bool shouldExplode(ConsumedArgToEpilogueReleaseMatcher &ERM) const {
// We cannot optimize the argument.
if (!canOptimizeLiveArg())
return false;
// See if the projection tree consists of potentially multiple levels of
// structs containing one field. In such a case, there is no point in
// exploding the argument.
//
// Also, in case of a type can not be exploded, e.g an enum, we treat it
// as a singleton.
if (ProjTree.isSingleton())
return false;
// If this argument is @owned and we can not find all the releases for it
// try to explode it, maybe we can find some of the releases and O2G some
// of its components.
//
// This is a potentially a very profitable optimization. Ignore other
// heuristics.
if (hasConvention(SILArgumentConvention::Direct_Owned) &&
ERM.hasSomeReleasesForArgument(Arg))
return true;
size_t explosionSize = ProjTree.liveLeafCount();
return explosionSize >= 1 && explosionSize <= 3;
}
llvm::Optional<ValueOwnershipKind>
getTransformedOwnershipKind(SILType SubTy) {
if (IsEntirelyDead)
return None;
if (SubTy.isTrivial(Arg->getModule()))
return Optional<ValueOwnershipKind>(ValueOwnershipKind::Trivial);
if (OwnedToGuaranteed)
return Optional<ValueOwnershipKind>(ValueOwnershipKind::Guaranteed);
return Arg->getOwnershipKind();
}
};
/// A structure that maintains all of the information about a specific
/// direct result that we are tracking.
struct ResultDescriptor {
/// The original parameter info of this argument.
SILResultInfo ResultInfo;
/// If non-null, this is the release in the return block of the callee, which
/// is associated with this parameter if it is @owned. If the parameter is not
/// @owned or we could not find such a release in the callee, this is null.
llvm::SmallSetVector<SILInstruction *, 1> CalleeRetain;
/// This is owned to guaranteed.
bool OwnedToGuaranteed;
/// Initialize this argument descriptor with all information from A that we
/// use in our optimization.
///
/// *NOTE* We cache a lot of data from the argument and maintain a reference
/// to the original argument. The reason why we do this is to make sure we
/// have access to the original argument's state if we modify the argument
/// when optimizing.
ResultDescriptor() {}
ResultDescriptor(SILResultInfo RI)
: ResultInfo(RI), CalleeRetain(), OwnedToGuaranteed(false) {}
ResultDescriptor(const ResultDescriptor &) = delete;
ResultDescriptor(ResultDescriptor &&) = default;
ResultDescriptor &operator=(const ResultDescriptor &) = delete;
ResultDescriptor &operator=(ResultDescriptor &&) = default;
/// \returns true if this argument's ParameterConvention is P.
bool hasConvention(ResultConvention R) const {
return ResultInfo.getConvention() == R;
}
};
/// Returns true if F is a function which the pass know show to specialize
/// function signatures for.
bool canSpecializeFunction(SILFunction *F,
const CallerAnalysis::FunctionInfo *FuncInfo,
bool OptForPartialApply);
/// Return true if this argument is used in a non-trivial way.
bool hasNonTrivialNonDebugUse(SILArgument *Arg);
} // end namespace swift
#endif
|
def interp(self, name=None, ys=None, xs=None, nodes=None, kind='linear', axis=0):
if not isinstance(ys, Iterable):
raise ValueError('ys must be provided as an Iterable of length at least 2.')
if nodes not in ('col', 'all', 'state_disc', 'state_input', 'control_disc',
'control_input', 'segment_ends', None):
raise ValueError("nodes must be one of 'col', 'all', 'state_disc', "
"'state_input', 'control_disc', 'control_input', 'segment_ends', or "
"None.")
if xs is None:
if len(ys) != 2:
raise ValueError('xs may only be unspecified when len(ys)=2')
if kind != 'linear':
raise ValueError('kind must be linear when xs is unspecified.')
xs = [-1, 1]
elif len(xs) != np.prod(np.asarray(xs).shape):
raise ValueError('xs must be viewable as a 1D array')
gd = self.options['transcription'].grid_data
if nodes is None:
if name is None:
raise ValueError('nodes for interpolation were not specified but the name of the '
'variable to be interpolated was not provided.\nPlease specify '
'the name of the interpolated variable or a node subset.')
elif name in self.state_options:
node_locations = gd.node_ptau[gd.subset_node_indices['state_input']]
elif name in self.control_options:
node_locations = gd.node_ptau[gd.subset_node_indices['control_input']]
elif name in self.polynomial_control_options:
node_locations, _ = lgl(self.polynomial_control_options[name]['order'] + 1)
else:
raise ValueError('Could not find a state, control, or polynomial control named '
f'{name} to be interpolated.\nPlease explicitly specified the '
f'node subset onto which this value should be interpolated.')
else:
node_locations = gd.node_ptau[gd.subset_node_indices[nodes]]
_xs = np.asarray(xs).ravel()
m = 2.0 / (_xs[-1] - _xs[0])
b = 1.0 - (m * _xs[-1])
taus = m * _xs + b
interpfunc = interpolate.interp1d(taus, ys, axis=axis, kind=kind,
bounds_error=False, fill_value='extrapolate')
res = np.atleast_2d(interpfunc(node_locations))
if res.shape[0] == 1:
res = res.T
return res
|
// that is equal or later to the proposed new item, then nothing is written.
public static RelayItem submit_relay_item (String relay_id, long relay_time, MarshalWriter details, boolean f_force, long relay_stamp) {
RelayItem relit = build_relay_item (relay_id, relay_time, details);
if (submit_relay_item (relit, f_force, relay_stamp) <= 0) {
relit = null;
}
return relit;
}
|
Sodium valproate and clonazepam for treatment-resistant panic disorder. Sodium valproate (VA) and clonazepam (CLZ) were combined in the treatment of 4 patients with panic disorders (PD) who were resistant to several antipanic drug treatments. A significant improvement was found in the symptomatology of these patients, but relapses occurred when CLZ dosage was reduced. A potentiation of the GABAergic properties of VA and clonazepam is postulated. This combined treatment could be advantageous for some treatment-resistant PD patients but needs to be studied further.
|
The present invention relates generally to railroad brake monitoring systems, and more specifically to a monitoring and diagnostic system for a pneumatic only brakes on a rail car.
Portable single car testers are known. These are used for cars that were not connected to a train. They put the brake valve and the brake system on the car through various tests by manipulating the valves and making various measurements at various points including the brake pipe pressure and brakes cylinder pressure. Typical examples are shown in U.S. Pat. Nos. 5,808,909, 6,094,977 and 6,269,682. An interface for connection to an electronically controlled pneumatic (ECP) brake system is described in the U.S. Pat. No. 5,808,909.
Electric pneumatic brake systems are either stand alone electronic valves which are connected by wire or radio to the locomotive and receives braking signals electrically to control the brakes by controlling the air to and from the brake cylinder. The ECP system may also include an overlay or a pilot adaptor wherein a standard pneumatic valve is manipulated by the solenoids to perform its normal function while the brake pipe is still charged. Typical adaptor systems are shown by U.S. Pat. Nos. 5,390,988 and 5,676,431
U.S. Pat. No. 2,993,199 is a train inspection apparatus which determines whether a light or a full brake has been applied or whether the brakes have been released. This is an electrical polling system for a wired train. U.S. Pat. No. 2,993,199 and U.S. Pat. No. 5,390,988 monitor the brake cylinder pressure which is reported to the head end for the locomotive engineer. U.S. Pat. No. 5,676,431 includes a transducer for brake pipe, brake cylinder, and auxiliary reservoir and uses information to initiate braking electric pneumatically as well as addressing stuck brakes.
U.S. Pat. No. 5,862,048 is a microprocessor electric-pneumatic locomotive brake control and train monitoring system. This is an electric pneumatic brake system on the car with sensors whose valves are transmitted back to the head end processor in the locomotive. The braking diagnostic functions include stuck brake identification, release while the train is in motion, collective gradual release of train brakes, out of tolerance brake cylinder pressures, accelerated direct release brakes, the source of emergencies, wheel off detection, wheel identification by number and location, status of every train vehicle, box detection, and sliding flat wheels. This information and sensors are part of the EPC brake control system.
U.S. Pat. No. 6,175,784 is a remotely operated rail car status monitor and control system. The hand brake status and release monitor determines and reports the status of the hand brake and an operator releases the hand brake. The monitor also includes a plurality of sensors which includes a slide wheel sensor and train handling sensor. The train handling sensor identifies impact. The car monitoring device responds to a wakeup signal from a hand held data terminal.
U.S. Pat. No. 6,837,550 is a brake system diagnostic using a hand-held radio device. The car brake system includes a radio based feed valve which includes a sensor to measure different pressures in the brake system. The hand-held device retrieves brake system data and information from the radio based feed valve and interprets the retrieved data and information. Maintenance is performed based on the interpretation of the data and information.
A brake system diagnostic and reporting system for a pneumatic only brake valve on a rail car according to the present disclosure includes a brake pipe transducer for measuring brake pipe pressure; and a brake cylinder transducer for measuring brake cylinder pressure. A processor receives measurements from the transducers, compares the measurements against stored brake performance profiles, determines brake status from the comparison and prepares an event report for preselected brake statuses. A wireless transmitter connected to the processor transmits the report. An energy storage device powers the processor and transmitter.
The system may include a geographic location system for determining the location of the rail car connected to the processor; and the processor provides time and location with the event report. The location system may be a global positioning system which provides location and speed and the processor provides speed with the event report. The system may include an accelerometer connected to the processor and the processor provides measurements from the accelerometer with the event report.
The processor may determine at least two of the following brake statuses: good; degradation requiring notice at maintenance; degradation requiring notice at destination; and failure. The processor may determine one or more of the following faults: brake valve failure; slow to apply; slow to release; and failure to release. The processor stores a moving window of measurements from the transducers and provides at least a portion of the window before the event with the event report.
The brake pipe transducer is connected to one of the following: the brake pipe and a brake pipe test port on the brake valve; and wherein the brake cylinder transducer is connected to one of the following: the brake cylinder, a brake cylinder output port of the brake valve, and a brake cylinder test port on the brake valve. If the car includes an empty/load device connecting the brake valve to the brake cylinder, the brake cylinder transducer may also be connected to a brake cylinder output port of the empty/load device.
Other objects, advantages and novel features of the present invention will become apparent from the following detailed description of the invention when considered in conjunction with the accompanying drawings.
|
ACLU has planned a press conference at the Amazon Spheres urging the company to stop providing police with facial-recognition technology.
Amazon is taking more heat for selling its facial recognition software to local law enforcement agencies.
The American Civil Liberties Union is holding a press conference at Amazon’s Seattle headquarters Monday afternoon where the group will deliver a petition with more than 150,000 signatures asking Amazon to stop the practice. The event comes a few days after nearly 20 groups of Amazon shareholders sent a letter asking the company to stop providing police with its Rekognition software.
Amazon first introduced its image recognition service in 2016 and enhanced to handle video recognition last year at AWS re:Invent 2017. The company says Rekognition “provides highly accurate facial analysis and facial recognition” but the ACLU claims the software is biased against people of color. Amazon lists the Washington County Sheriff Office as one of its customers on the Rekognition website.
Amazon could not immediately be reached for comment but one of the company’s AI executives, Matt Wood, did share some thoughts about the controversy when the ACLU first raised issues with Rekognition a few weeks ago.
|
Douglas Johnston, Lord Johnston
Education
Johnston's father Joseph was also an Advocate; he was born in Aberdeen and educated at Aberdeen Grammar School. He then went on to St John's College, Oxford followed by the University of Edinburgh at both of which he studied law. He was called to the Bar in England by the Inner Temple in 1931, and to the Scottish Bar in 1932.
Career
On 4 April 1936 Johnston married Doris Isobel Kidd, the daughter of James Kidd who was Conservative Member of Parliament for Linlithgowshire from 1918 to 1928. They had two sons and two daughters. During the Second World War he served in the army; on his return he was promoted to be an Advocate Depute, a crown prosecutor, in 1945. He was made a Scottish King's Counsel in October 1947.
Political career
Johnston had become a supporter of the Labour Party and on 29 October 1947 he was appointed as Solicitor General for Scotland, a government position. He was not then a Member of Parliament but when the constituency of Paisley was vacated by Viscount Corvedale on inheriting his father's Earldom, Johnston was selected to follow him as Labour candidate on 8 January 1948. In the ensuing by-election he faced a straight fight with J.M. MacCormick, a Glasgow solicitor who had been a prominent Scottish Nationalist and was adopted as candidate both by the Conservatives and Liberals. Johnston won by 6,545 votes.
Johnston retained his government post until Labour went out of office in 1951. He then became an opposition front-bencher. In May 1954 he moved the rejection of the Town and Country Planning (Scotland) Bill on the grounds that it burdened the community with the cost of compensating landowners for the loss of land value. He was not a prominent figure, concentrating on the details of policy. In the meantime he kept up his practice at the Scottish Bar, often appearing at public inquiries.
Judicial post
In January 1961, Johnston was named as a Senator of the College of Justice, a judicial post, an appointment which vacated his Parliamentary seat. He took the judicial title of Lord Johnston. In December 1963 he found that the national joint council responsible for setting teachers' salaries had not been properly constituted, and awarded the schoolteachers who had brought the case their expenses. He was appointed as Chairman of the Royal Fine Art Commission for Scotland in 1965.
After the conviction of three Glasgow youths who had killed a man in a street fight in 1977, Johnston decided to defer the sentencing for 12 months. This action was criticised by the Scottish Police Federation. Johnston retired in 1978.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.