content
stringlengths
7
2.61M
The Courier-Post Athletes of the Week feature is sponsored by HOMEBANK, with locations in Hannibal, Palmyra, West Quincy, Quincy and Centralia. Hays stepped up as a go-to scorer for Monroe City last week on its run to the Class 3 District 8 championship. The junior guard netted 15 points against Hallsville in the semifinals before dropping 20 more against Clark County on Saturday in the title game. Hays is a key leader for the Panthers on both ends of the floor. Bigsby came through with a career outing of 22 points and 10 rebounds Monday to lead Hannibal to a 72-64 win over Liberty-Wentzville in the first round of the Class 4 District 8 tourney. The junior forward knocked down four 3-pointers in the opening half. She also led Hannibal with 10 points in a loss to St. Dominic one day later.
<reponame>brianwgoldman/DeepNK // <NAME> #ifndef OUTPUTNODE_H_ #define OUTPUTNODE_H_ #include "Configuration.h" #include "Matrix.h" #include "QualityMeasures.h" // This is a default OutputNode. I'll likely end up subclassing it to make it polymorphic class OutputNode { vector<size_t> indexes; vector<value_type> weights; label_type target; value_type threshold; public: OutputNode() = default; void setup(const Configuration& config, const size_t position, const size_t n, const size_t k, Random& random); virtual ~OutputNode() = default; value_type score(const Matrix& inputs, const vector<size_t>& active, const vector<label_type>& labels); void configure(const vector<size_t>& active); vector<label_type> test(const Matrix& inputs) const; }; #endif /* OUPUTNODE_H_ */
<gh_stars>0 #!/usr/local/bin/python import sys import os if len(sys.argv) <=2: print "Usage: DirectoryName progName" sys.exit(0) #Create directory newpath = r'src/'+sys.argv[1] if not os.path.exists(newpath): os.makedirs(newpath) #Create c++ file cppFile = open(newpath+"/"+sys.argv[2]+".cpp",'w') content="\ /*\n\ ID: hwchiu1\n\ PROG: "+sys.argv[2]+"\n\ LANG: C++\n\ */\n\ #include <iostream>\n\ #include <fstream>\n\ #include <string>\n\ using namespace std;\n\ int main() {\n\ ofstream fout (\""+sys.argv[2]+".out\");\n\ ifstream fin (\""+sys.argv[2]+".in\");\n\ return 0;\n\ }" cppFile.write(content) cppFile.close() #Create input file inputFile = open(newpath+"/"+sys.argv[2]+".in",'w') inputFile.close() #Create MakeFile makeFile = open(newpath+"/Makefile",'w') content="\ NAME := "+sys.argv[2]+"\n\ SRC := ${NAME}.cpp\n\ OUTPUT := ${NAME}.out\n\ CXX := clang++\n\ RM := /bin/rm\n\ \n\ all: install\n\ \n\ install: ${src}\n\ \t@${CXX} -o ${NAME} -O2 ${SRC}\n\ \n\ clean:\n\ \t@${RM} -f ${OUTPUT} ${NAME}\n\ " makeFile.write(content) makeFile.close();
/** * Created by sorin.teican on 12-Jan-17. */ public class AuthenticatorIndexOps { private static long insertAuthenticatorIndex(final SQLiteOpenHelper _db, final AuthenticatorIndex authenticatorIndex) { SQLiteDatabase db = _db.getWritableDatabase(); ContentValues values = new ContentValues(); values.put(AuthenticatorIndexContract.AuthenticatorIndexEntry.COLUMN_NAME_AAID, authenticatorIndex.AAID); values.put(AuthenticatorIndexContract.AuthenticatorIndexEntry.COLUMN_NAME_INDEX, authenticatorIndex.index); values.put(AuthenticatorIndexContract.AuthenticatorIndexEntry.COLUMN_NAME_TYPE, authenticatorIndex.type); return db.insert(AuthenticatorIndexContract.AuthenticatorIndexEntry.TABLE_NAME, null, values); } private static AuthenticatorIndex getAuthenticatorIndex(final SQLiteOpenHelper _db, final String AAID) { SQLiteDatabase db = _db.getReadableDatabase(); String[] projection = { AuthenticatorIndexContract.AuthenticatorIndexEntry.COLUMN_NAME_AAID, AuthenticatorIndexContract.AuthenticatorIndexEntry.COLUMN_NAME_INDEX, AuthenticatorIndexContract.AuthenticatorIndexEntry.COLUMN_NAME_TYPE, }; String selection = AuthenticatorIndexContract.AuthenticatorIndexEntry.COLUMN_NAME_AAID + " = ?"; String[] selectionArgs = { AAID }; Cursor c = db.query( AuthenticatorIndexContract.AuthenticatorIndexEntry.TABLE_NAME, // The table to query. projection, // The columns to return. selection, // The columns for the WHERE clause. selectionArgs, // The values for the WHERE clause. null, // don`t group the rows. null, // don`t filter by row groups. null // the sort order. ); if (!c.moveToFirst()) return null; AuthenticatorIndex index = new AuthenticatorIndex(); index.AAID = AAID; index.index = c.getInt(c.getColumnIndex(AuthenticatorIndexContract.AuthenticatorIndexEntry.COLUMN_NAME_INDEX)); index.type = c.getInt(c.getColumnIndex(AuthenticatorIndexContract.AuthenticatorIndexEntry.COLUMN_NAME_TYPE)); c.close(); return index; } private static List<AuthenticatorIndex> getAllIndexes(final SQLiteOpenHelper _db) { SQLiteDatabase db = _db.getReadableDatabase(); String[] projection = { AuthenticatorIndexContract.AuthenticatorIndexEntry.COLUMN_NAME_AAID, AuthenticatorIndexContract.AuthenticatorIndexEntry.COLUMN_NAME_INDEX, AuthenticatorIndexContract.AuthenticatorIndexEntry.COLUMN_NAME_TYPE, }; Cursor c = db.query( AuthenticatorIndexContract.AuthenticatorIndexEntry.TABLE_NAME, // The table to query. projection, // The columns to return. null, // The columns for the WHERE clause. null, // The values for the WHERE clause. null, // don`t group the rows. null, // don`t filter by row groups. null // the sort order. ); List<AuthenticatorIndex> indexes = new ArrayList<>(); if (c.moveToFirst()) { do { AuthenticatorIndex index = new AuthenticatorIndex(); index.AAID = c.getString(c.getColumnIndex(AuthenticatorIndexContract.AuthenticatorIndexEntry.COLUMN_NAME_AAID)); index.index = c.getInt(c.getColumnIndex(AuthenticatorIndexContract.AuthenticatorIndexEntry.COLUMN_NAME_INDEX)); index.type = c.getInt(c.getColumnIndex(AuthenticatorIndexContract.AuthenticatorIndexEntry.COLUMN_NAME_TYPE)); indexes.add(index); } while (c.moveToNext()); } c.close(); return indexes; } private static void deleteIndex(final SQLiteOpenHelper _db, final String AAID) { SQLiteDatabase db = _db.getWritableDatabase(); String selection = AuthenticatorIndexContract.AuthenticatorIndexEntry.COLUMN_NAME_AAID + " LIKE ?"; String[] selectionArgs = { AAID }; db.delete(AuthenticatorIndexContract.AuthenticatorIndexEntry.TABLE_NAME, selection, selectionArgs); } public static class InsertIndexOp extends AsyncTask<AuthenticatorIndex, Void, Long> { private SQLiteOpenHelper _db; private boolean _done; private Long _result; public InsertIndexOp(final SQLiteOpenHelper db) { _db = db; } @Override protected Long doInBackground(AuthenticatorIndex... params) { Long id = insertAuthenticatorIndex(_db, params[0]); _result = id; _done = true; return id; } @Override protected void onPostExecute(Long result) { _result = result; _done = true; } public boolean isDone() { return _done; } public long getResult() { return _result; } } public static class GetIndexOp extends AsyncTask<String, Void, AuthenticatorIndex> { private SQLiteOpenHelper _db; private boolean _done = false; private AuthenticatorIndex _result = null; public GetIndexOp(final SQLiteOpenHelper db) { _db = db; } @Override protected AuthenticatorIndex doInBackground(String... params) { _done = true; return null; } @Override protected void onPostExecute(AuthenticatorIndex result) { _result = result; _done = true; } public boolean isDone() { return _done; } public AuthenticatorIndex getResult() { return _result; } } public static class GetAllIndexesOp extends AsyncTask<Void, Void, List<AuthenticatorIndex>> { private SQLiteOpenHelper _db; private boolean _done = false; private List<AuthenticatorIndex> _result = null; public GetAllIndexesOp(final SQLiteOpenHelper db) { _db = db; } @Override protected List<AuthenticatorIndex> doInBackground(Void... params) { _result = getAllIndexes(_db); _done = true; return _result; } @Override protected void onPostExecute(List<AuthenticatorIndex> result) { _result = result; _done = true; } public boolean isDone() { return _done; } public List<AuthenticatorIndex> getResult() { return _result; } } public static class DeleteIndexOp extends AsyncTask<String, Void, Void> { private SQLiteOpenHelper _db; private boolean _done = false; public DeleteIndexOp(final SQLiteOpenHelper db) { _db = db; } @Override protected Void doInBackground(String... params) { deleteIndex(_db, params[0]); _done = true; return null; } @Override protected void onPostExecute(Void result) { _done = true; } public boolean isDone() { return _done; } } }
Edgelight: combination of sensitive crack detection and luminescence measurements We present a measurement technique that we call edgelight, which allows a very sensitive detection of cracks in solar wafers and cells. For polycrystalline material, we found to be able to detect much smaller cracks than possible with conventional equipment. The technique is based on darkfield illumination with the illuminating light entering the wafer (or the cell) from the edges and being kept inside the wafer by total internal reflection. As detector, an infrared linescan camera is used, giving high resolution images. In this configuration, even small cracks appear with high contrast, whereas the grain structure is not visible. In the same setup, photoluminescence or electroluminescence can be recorded in the same run in order to gain information on electronic properties. For the case of photoluminescence, only the scan line needs to be irradiated by the optical excitation source. Consequently, the necessary optical power can be lower and/or exposure times can be shorter. The combination of several measurement channels (crack detection, luminescence) with different light/excitation sources and a single camera is achieved by a special application software for an field programmable gate array (FPGA) frame grabber. The integration of the two measurements principles in a single setup allows simultaneous determination of mechanical stability and electronic quality properties. The setup was proven to work under inline conditions. Copyright © 2012 John Wiley & Sons, Ltd.
<filename>backend/src/main/java/com/jitterted/tddgame/adapter/vue/GameController.java package com.jitterted.tddgame.adapter.vue; import com.jitterted.tddgame.domain.CardId; import com.jitterted.tddgame.domain.Game; import com.jitterted.tddgame.domain.GameService; import com.jitterted.tddgame.domain.Player; import com.jitterted.tddgame.domain.PlayerId; import com.jitterted.tddgame.domain.User; import com.jitterted.tddgame.domain.port.GameStateChannel; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping("/api/game/players") public class GameController { private final GameService gameService; private final GameStateChannel gameStateChannel; @Autowired public GameController(GameService gameService, GameStateChannel gameStateChannel) { this.gameService = gameService; this.gameStateChannel = gameStateChannel; } @PostMapping public PlayerIdDto connectUserToPlayerInGame(@RequestBody UserDto user) { System.out.println("Received connect for user: " + user.getUserName()); Player assignedPlayer = gameService.assignNextAvailablePlayerToUser(new User(user.getUserName())); gameStateChannel.playerActed(gameService.currentGame()); return PlayerIdDto.from(assignedPlayer.id()); } @GetMapping("{playerId}") public PlayerGameView playerGameView(@PathVariable("playerId") String playerIdString) { PlayerId playerId = PlayerId.of(Integer.parseInt(playerIdString)); return PlayerGameView.from(gameService.currentGame(), playerId); } @PostMapping("{playerId}/discards") public void discard(@PathVariable("playerId") String playerIdString, @RequestBody DiscardAction discardAction) { PlayerId playerId = PlayerId.of(Integer.parseInt(playerIdString)); discardAction.executeFor(playerId, gameService); } @PostMapping("{playerId}/plays") public void playCard(@PathVariable("playerId") String playerIdString, @RequestBody PlayCardAction playCardAction) { PlayerId playerId = PlayerId.of(Integer.parseInt(playerIdString)); gameService.currentGame().playCardFor(playerId, CardId.of(playCardAction.getId())); gameStateChannel.playerActed(gameService.currentGame()); } @PostMapping("{playerId}/actions") public void handleAction(@PathVariable("playerId") String playerIdString, @RequestBody PlayerAction playerAction) { PlayerId playerId = PlayerId.of(Integer.parseInt(playerIdString)); playerAction.executeFor(playerId, gameService); gameStateChannel.playerActed(gameService.currentGame()); } @PostMapping("{playerId}/test-result-card-draws") public ResponseEntity<Void> handleDrawTestResultCard(@PathVariable("playerId") String playerIdString) { PlayerId playerId = PlayerId.of(Integer.parseInt(playerIdString)); Game game = gameService.currentGame(); game.drawTestResultCardFor(playerId); gameStateChannel.testResultCardDrawn(game.drawnTestResultCard()); return ResponseEntity.noContent().build(); } @PostMapping("{playerId}/test-result-card-discards") public ResponseEntity<Void> handleDiscardTestResultCard(@PathVariable("playerId") String playerIdString) { PlayerId playerId = PlayerId.of(Integer.parseInt(playerIdString)); Game game = gameService.currentGame(); game.discardTestResultCardFor(playerId); gameStateChannel.testResultCardDiscarded(playerId); return ResponseEntity.noContent().build(); } }
"The longer you can look back, the farther you can look forward." I'd like to quote an Englishman (Winston Churchill) when it comes to talking about the current governance of the UCI. Related Articles Marc Madiot Blog: The new WorldTour calendar is unacceptable Madiot and LNC could take UCI to CAS over 2017 WorldTour calendar Tour of Guangxi added to 2017 WorldTour calendar TJ Sport team in race against time to secure WorldTour licence FDJ outline 2017 season objectives I've noticed that president Brian Cookson had time to travel to China to launch a new WorldTour race (the Tour of Guangxi) but he continues to snub the French race organizers. Most of them are volunteers, they spend lengthy hours collecting money from local shops to finance category 1 races and they'd like to know why the UCI has increased their race taxes by 20% for next year, what for and with what is the return for them. I went to the recent WorldTour seminar in Mallorca with the hope of getting answers to the numerous questions raised recently by the extension of the WorldTour to 38 races instead of 27. But we, the team managers, didn't get a chance to ask anything. At least I manage to understand why this event took place in Mallorca when I saw some UCI officials and race organizers riding their bikes. There was also no debate over the request by Flanders Classics, ASO and RCS to reduce the number of riders per team. On that topic, I've read some nonsense comments by some of my colleagues who said it would jeopardize jobs for riders and staff. The same people were saying that we don't have enough riders to take part in all the new WorldTour races. One rider less per team in Grand Tours and Classics would enable us to take part in more races. WorldTour or not, we're always sorry to decline invites to many great races during the season. Luckily, the new WorldTour events aren't compulsory. The Tour of Guangxi is not part of FDJ's plan for 2017. Paris-Tours and Il Lombardia remain the best way to conclude the season in my mind. I have nothing against the globalization of the sport but the lessons of the Tour of Beijing (2011-14) do not seem to have been learned. At the beginning of this year Mr. Cookson declared that the WorldTour would return to China but through the promotion of an existing event and certainly not with the creation of a new event. These are the rules of the WorldTour: a race has to be organized for at least two years before being promoted to WorldTour level. But once again the UCI doesn't respect its own rules. China might be a new market for cycling but the sport isn't different there: it will not work without the development of competitive local cyclists. This year, six Chinese riders lined up at the Tour of Qinghai Lake, eight at the Tour of Taihu Lake! Is the UCI doing anything to help the Chinese to get a start in international races in China? How can those riders improve if they don't even start? When we ask Mr. Cookson to not forget the grassroots of the sport, it's not only about France, the founding country of bike races and the UCI, it's everywhere. I've just been re-elected as president of the French National Cycling League. The members asked me to run for a third term and voted unanimously for me. My role consists of maintaining and reinforcing the cohesion between race organizers, riders and teams. France hosted 22.5% of the international racing days in category 1 and above in 2016. We'll be losing a few next year, starting with the Criterium International. Economically, times are hard but unfortunately, the UCI knows how to increase taxes but not to listen to people, except for the Chinese. They must have something we don't....
Uncovering Wounds, Countering Obliviousness: Tragedy of Humanity in Herztier, a Novel by Herta Mller The research is financed by Directorate General of Higher Education Ministry of Research an Technology as the organizer of BPPDN. Abstract Fictional works from Herta Muller are regarded as documentations and information sources of socio-political life in Romania during the dictator Ceausescu regime from 1967 to 1989. Mullers novel Herztier is considered as the most concrete in representing the tragedy of humanity under the practice of totalitarian system power. This study aims to investigate the tragedy of humanity represented in the novel Herztier, and the intentions the author, Herta Muller, wants to achieve through those representations. To understand and achieve profound result, study were performed on Herztier and the social and political contexts relevant to the novel. Therefore, as the theoretical basis, the Stanzel theory of narrative and van Dijk theory of critical discourse analysis are used. By the combination of these theories, the narrative reconstruction, directed at the narrator elements, narrative perspective, narrative intonation, and linguistic choices, also the contexts related to the socio-political facts in Romania during the reign of Ceausescu. The analysis shows two findings. First, the tragedy of humanity shown in Herztier are represented by a first person narrator. Second, through the novel-imaginative fictional stories-, the author tries to provide a means to fight the oblivion about bad events in life and to raise the awareness of the readers about the true reality. The public awareness of reality, in the future, can move them to actively participate in the struggle for a just society. Keywords: tragedy of humanity, totalitarian system power, narrative situations, critical discourse analysis DOI : 10.7176/JLLL/60-07 Publication date :September 30 th 2019
/* Multiply a new matrix into the old one from a non-OGL source */ void TransMatrix::multTransformMatrix(float* matrix) { float* newMatrix; float* transpose = this->Transpose(); newMatrix = mult4x4(matrix, transpose); for (int i = 0; i < 4; i++) { for (int j = 0; j < 4; j++) { TransformationMatrix[i + 4*j] = newMatrix[4*i + j]; } } delete[] transpose; delete[] newMatrix; return; }
Gulf States Utilities Entergy Texas (formerly Gulf States Utilities (GSU)) is an electric power generation and distribution company headquartered in The Woodlands, Texas. The company was founded in 1911 as Eastern Texas Electric, a holding company for Stone & Webster. On August 25, 1925, Gulf States Utilities Company was incorporated in the state of Texas. The company grew and in 1979 moved its headquarters into the Edison Plaza office tower, which is still the tallest building in Beaumont. Its older headquarters, the Liberty-Pearl building (Formerly the Edson Hotel from 1929 to 1955), which still houses a lot of its telecomm equipment including the microwave radio systems, is still the second tallest building in Beaumont. Also in the late 1970s, construction began on the River Bend Station nuclear power plant. Cost overruns on the nuclear plant, high interest rates of 24-30%, a CEO of GSU who wanted a "nuke plant in the company" and a downturn in the regional economy in the early to mid-1980s nearly drove GSU into bankruptcy. In fact, trading of company stock was halted on the New York Stock Exchange one day as it tumbled down over 75% and eventually stopped at less than $2 a share. Former chief financial officer, Joseph L. Donnelly, Jr., has been credited with preventing the company from filing for Chapter 11 and was its CEO. (see link below) GSU was absorbed by Entergy Corporation January 1, 1994 after first accepting a $19 per share offer from SWEPCO. Entergy's CEO at the time, Edwin Lupeburger, demanded another shot at buying GSU. The Entergy Board of Directors had a late night conference call and the next morning, tendered a $20 per share offer to GSU. GSU then had to pay SWEPCO a reported $10million to back out of the deal with them. At the time, GSU had 578,000 customers across southern Louisiana and East Texas. Edison Plaza was used by Entergy as its Texas headquarters. In 1999, Joe Domino, a well-respected longtime employee who started as an engineer and later served as Sabine Station plant (near Bridge City) manager, began his 14 year tenure as president of Entergy Texas. The River Bend Station continued to be a thorn in the side of its new owners due to lawsuits by the project's investors and fines levied by the Nuclear Regulatory Commission over safety problems at the plant. Gulf States Utilities is still a legally incorporated entity in the state of Texas. However, recently Entergy changed GSU's Texas name from Entergy Gulf States to Entergy Texas, Inc. and merged the GSU Louisiana service territory with its Entergy-Louisiana unit. Entergy Texas notified the Public Utility Commission of Texas that it would not be joining the Texas Interconnection operated by ERCOT, but would stay regulated and part of the massive Eastern Interconnection (one of the two major power grids in the US besides Texas' own which covers 75% of the state and has only DC Direct Current ties to other states). Only ONE time was the tie connection in Dayton, Texas between GSU/Entergy and the Texas Interconnection (via CenterPoint Energy) ever used; after Hurricane Ike to provide power to the water pumps along the north side of Lake Houston and other affected areas. This was done after Texas Governor Rick Perry ordered CenterPoint to request Entergy to close the tie. In 2013, Joe Domino was replaced by Sallie Rainer, which began the transition of Entergy Texas to The Woodlands.
Tired of playing video games now that the sun is starting to make regular appearances and the outside world is looking more inviting? Good news! Now there’s a computer program that can play your video games for you! Computer scientist Tom Murphy has developed an artificial intelligence that can play NES games like Super Mario Bros. all by itself. It doesn’t even have to trade off the controller with its kid brother every other life. Murphy presented a paper outlining his work earlier this month at SIGBOVIK, the conference of the Association for Computational Heresy. Now, you can see a video version of the paper — entitled “The First Level of Super Mario Bros. is Easy with Lexicographic Orderings and Time Travel. . . after that it gets a little tricky” — in which Murphy breaks down his work and explains how a computer can be much better at Super Mario Bros. than an eight-year-old Ian Chant ever was. Murphy has dubbed his creation Playfun, and it works by copying Murphy’s own movements in a brief play test, and then extrapolating them out over the rest of the game. To teach Playfun how to play a game, Murphy plays it himself for a while, recording his inputs to offer the program a blueprint and teaching it what its goals should be in the game. It doesn’t just copy Murphy’s movements, though. It learns what his goals are while he’s playing the game — stomping on a goomba, getting a higher score, getting to a new level, or just not falling down a bottomless hole — and then works out the best ways to achieve those goals, meaning it can play through a game farther than Murphy’s training round lasted. As you can see in the video below, Playfun is much better at playing straightforward side-scrollers like Super Mario Bros. than it is at figuring out the strategy behind more abstract endeavors like Tetris. That said, it does play a pretty wicked round of Bubble Bobble as well. While it’s only capable of playing NES games right now — and it’s not even, like, super great at those — we can consider the genie out of the bottle. In just a few short years, bots will no doubt dominate competitive League of Legends play, though training them to properly berate new players with a never ending string of slurs and insults will probably take another year or two. (via Walyou) Relevant to your interests
Members of Castle Vintage Club, which is based in and around Taghmon, presented a cheque for €13,050 to The Friends of St Luke's Hospital, proceeds of a Tractor Run to Donegal. Almost 40 tractor enthusiasts took to the road on the May Bank Holiday weekend with the aim of raising much needed cash for the hospital. The group drove to Portaoise on the first day, to Carrick-on-Shannon the second day, and topped off the 380 km journey, reaching Donegal on the third day. Club volunteers collected in various locations along the way. Over the years, the club has raised massive amounts of money for various charities. In the 12 years since the club was founded, approximately €300,000 has been donated to different causes. The club will hold their annual barbecue on July 7 in Rochford's in Camross, starting at 9.30 p.m. There will be live music and great food on offer. All are welcome.
Herb Formula ZhenRongDan Balances Sex Hormones, Modulates Organ Atrophy, and Restores ER and ER Expressions in Ovariectomized Rats Herb mixtures are widely used for treatment of the menopausal syndrome long before the hormonal therapy. However, there is insufficient data for herb remedies in treating menopausal syndromes. Here we aim to investigate the effect of ZhenRongDan (ZRD) in balancing female hormones, regulating expression of estrogen receptors (ERs), and preventing organ atrophy in menopausal rats. Rats that underwent bilateral ovariectomy were used in the experiments; the effects of ZRD on serum follicle-stimulating hormone (FSH), luteinizing hormone (LH), prolactin (PRL), and estradiol (E2) levels were observed. Histology of vagina and ERs expression in vagina, uterus, and adrenal gland were also examined. ELISAs were used to analyze the changes of FSH, LH, PRL, and E2 in serum, and the morphological changes of the cervical epithelium cells were observed by Hematoxylin & Eosin (H&E) staining. Immunohistochemistry and western blot were applied to detect estrogen receptors subtypes alpha (ER) and beta (ER) expression in vagina, uterus, and adrenal gland. We found that ZRD could significantly reduce the weight of the adrenal gland and increase the weight of the uterus. It could decrease the release of FSH and LH as well as increasing E2 and PRL levels. Furthermore, ZRD could improve the number of cervical vaginal epithelial cells and increase the thickness of the vaginal wall. And the altered expressions of ER and ER are also restored by ZRD. ZRD could obviously relieve the endocrine disorders, modulate organ atrophy, and restore ER and ER expression in the ovariectomized rat model. Introduction Menopausal syndrome refers to a series of symptoms of women with the disorder of autonomic nervous system caused by the fluctuation of estrogen level. The main pathogenesis is the decrease of estrogen secretion caused by the decline of ovarian function and the dysfunction of hypothalamic-pituitary-ovarian axis. Since the longterm use of estrogen could increase the incidence of breast cancer or endometrial cancer, hormone replacement therapy was restricted for use. Traditional Chinese medicine (TCM) is an important aspect of alternative therapy for menopausal syndrome. Though many herbs are effective in the treatment of menopausal syndrome with different mechanisms, the Chinese herb mixture has been used to treat menopausal syndrome for thousands of years. According to the TCM theory, menopausal syndrome is caused by kidney-liver weakness based on yinyang imbalance and organ disharmony. However, the gap between the traditional complementary alternative medicine and the conventional main stream western medicine needs to be filled by more experimental and clinical research. Thus it would be necessary to evaluate these Chinese herbs and make them working better in menopausal patients. Chinese herb mixture often acts like a super "cocktail". Hence, an acknowledged evaluation system and appropriate parameters are needed to objectively evaluate the effect of these herbs. Here we introduce a herb mixture named ZRD developed from the classic herb formula Siwu decoction. Siwu decoction usually contains the following four herbs: Radix rehmanniae, Radix Paeoniae alba, Angelica sinensis, and Ligusticum chuanxiong Hort. Siwu decoction 2 Evidence-Based Complementary and Alternative Medicine is a gold formula widely used for treating gynecological diseases. It has been applied since the late Tang dynasty and its bioactive constituents have been recently elucidated. ZRD is based on Siwu decoction and consists of 17 kinds of medicinal herbs, which has been approved by China Food & Drug Administration as a traditional formula in treating menopausal syndromes. These herb mixtures are composed to tonify the liver and kidney, nourish deficient in organs, and finally balance yin and yang. However, its working mechanism has not yet been elucidated. Previously, our group reported the effect of ZRD on behavior in menopausal mice, exhibiting strong potential in alleviating menopausal symptoms. Thus we explore the mechanism of ZRD further. Since they are central in physiological and pathological process, we evaluate the effect of ZRD in regulating sex hormone levels of menopausal rats. Meanwhile, its impact on the expression of ER and ER is addressed as estrogen receptors are vital for the development and function of the female organ. The influence of ZRD on adrenal gland and climacteric rats' uterine weight is also elucidated. Herb Contents. ZRD is a herb mixture of TCM consisting of 17 herbs. The details of ZRD are listed in Table 1. Basic information such as Chinese name, Latin name, English name, and the part used in the mixture is covered. Animals and Treatment. All animal experiments comply with the ARRIVE guidelines and were carried out in accordance with the UK Animals (Scientific Procedures) Act, 1986, and associated guidelines, EU Directive 2010/63/EU for animal experiments. The protocol was approved by the Laboratory Animal Welfare and Ethics Committee of the Third Military Medical University (SYSK-PLA-20120013, 2015.11.17). All efforts were made to minimize animal suffering and to reduce the number of animals used. Three-month old female Sprague-Dawley rats with the weights 180∼220 g were obtained from the Experimental Animal Center of Third Military Medical University, China. A total of 82 specific pathogen free Sprague-Dawley female rats were used. All rats underwent bilateral ovariectomy as previously described except the sham group. All OVX rats were checked by daily vaginal epithelial cell smear analysis, in which 5 consecutive days of leukocytes were indicative of constant diestrus and successful ovariectomy. After acclimatization for a week, the rats were randomly divided into 5 groups: rats that underwent sham-operation (sham); OVX without treatment (OVX); OVX rats treated with ZRD 3.6 g/kg, 0.01 ml/g (ZRD); OVX rats treated with Tai tai-le (one of the most popular commercial decoctions in China) 7.79 g/kg, 0.01 ml/g (TTL); and OVX rats tested with estradiol valerate 800 ug/kg, 0.01 ml/g (EV). Untreated control OVX rats and sham-operated rats received distilled water only. TTL and EV were used as the positive control. Dose calculations followed guidelines correlating dose equivalents between humans and laboratory animals, on the basis of ratios of body surface area. In our previous work, we found that ZRD exerts the best effect at the middle dose (5.2 g/kg) in mice, in contrast to the low dose (1.73 g/kg) and high dose (15.2 g/kg). Thus, rats in ZRD group were treated at the dose of 3.6 g/kg, which is equivalent to the middle dose in mice. All the above groups toke intragastric drug at approximately 16:00 ∼ 18:00 pm every day for one month. All animals were maintained on the 12 h light/dark cycle under constant temperature (24 ± 2 ∘ C) and humidity (55 ± 5%), being allowed free access to food and water. 2.3. Analysis of Tissue and Serum. Animals were executed by cervical dislocation after one-month treatment. In sham group, all rats were in the estrus stage. Blood was collected from heart for analysis of serum E2, FSH, PRL, and LH levels by enzyme-linked immunosorbent assay (ELISA) (USCN, USA). The sensitivities of the four ELISAs were 1.0 pg/mL, 1.0 ng/mL, 1.0 ng/mL, and 1.0 pg/mL, respectively. And the antibody did not cross-react with other estrogen-like substances. The uterus and adrenal gland were removed and weighed. The left horns of the uterus and the mammary gland were stored at -80 ∘ C and the rest of vagina was fixed with 4% polyoxymethylene for 24 h. The samples were embedded in paraffin and prepared for cross sections. 4 mm thick sections were cut, mounted, and stained with H&E for microscopy. The observation of the vaginal epithelial thickness was performed on a selected single slide in each animal. With randomly selected six areas from each tissue section, the average thickening value of vaginal epithelial cells was measured by the Image-Pro Plus 6.0 system image analysis software. 2.4. Immunohistochemistry. Immunohistochemistry procedure followed previously reported methods. Briefly, 4 mm thick tissue section of vagina was mounted on polylysine-coated slides. The paraffin sections were dewaxed and incubated for 10 min with 3% hydrogen peroxide. Each section was incubated with blocking serum (Vectastain, ABC Kit) at room temperature for 30 min and then overnight at 4 ∘ C with rabbit anti-ER polyclonal antibody (Abcam Biotechnology, UK) and rabbit anti-ER polyclonal antibody (Abcam Biotechnology, UK), respectively. Sections incubated in phosphate-buffered saline without antibody served as negative controls. Positive control experiments for ER and ER were performed in adult Sprague-Dawley female rat's uterus. After incubation with biotinylated secondary antibody, sections were incubated with avidin-biotin complex reagent containing horseradish peroxidase for 30 min. The sections were then stained with 3,3'-diaminobenzidine (Sigma, USA). The Image-Pro Plus 6.0 System image analysis software was used for quantitative analysis. Western Blot. Uterus was resuspended in lysis buffer (50 mM Tris, pH 8.0, 150 mM NaCl, 5 m MEDTA, 0.1% sodium dodecyl sulfate, 0.5% NP-40) containing 10 mM phenylmethylsulfonyl fluoride and 2 mg/mL aprotinin. The protein was obtained to detect the levels of ER and ER in target tissue by western blot. Western blot protocol and semiquantitative analysis were carried out as described in. The rabbit anti-ER polyclonal antibody (Abcam Evidence-Based Complementary and Alternative Medicine 3 Biotechnology, UK) or rabbit anti-ER polyclonal antibody (Abcam Biotechnology, UK) was used. The experiment was done in triplicate. The relative quantity of each antibody was measured by Quantity One software. The density ratio of protein to GAPDH (Sangon Biotech, Shanghai, China) was calculated from the band density. 2.6. Statistical Analysis. The SPSS version 13.0 for Windows software (SPSS Inc., Chicago, USA) was used for statistical analysis. All data were expressed as the mean standard deviation and were analyzed by one-way analysis of variance (ANOVA). Differences were considered statistically significant when the -value was less than 0.05. Effect of ZRD on Uterine and Adrenal Gland Weights. Uterus and adrenal gland weights largely reflect the alteration of female function. To this end, we measured the uterine and adrenal glands weight in each group. The weights of uterus and adrenal gland were measured at the end of the one-month treatment period. As shown in Figure 1, the mean uterine index of OVX rats was significantly reduced ( < 0.001) compared with sham group. In contrast, the mean adrenal gland index was increased slightly. Further, the mean uterine indexes of rats in the ZRD group, TTL group, and EV group were increased compared to that of the rats in the OVX group, with the mean uterine index of EV group being statistically significant ( < 0.001). And the adrenal indexes in both ZRD and EV groups were slightly decreased compared with the OVX rats. As expected, TTL group's adrenal index was decreased significantly ( < 0.001). ZRD Regulates the Levels of FSH, LH, PRL, and E2 in Serum. Hormones such as FSH, LH, PRL, and E2 play critical role in regulating functions in female. The reproductive endocrinology undergoes menopausal transition in the hormone patterns during menopause. To elucidate the sex hormone changes in each group, we then test the levels of each serotonin in the rats' serum. As shown in Figure 2, ovariectomy resulted in lowered PRL and E2 level, but higher LH level and significantly elevated FSH ( < 0.05) levels in serum compared with sham group. When those OVX rats were given ZRD, TTL, and EV for one month, hormones in serum were regulated towards the normal status. Compared with the OVX rats, serum LH levels in ZRD and EV groups were decreased ( < 0.01, < 0.05). Further, serum FSH and LH levels in TTL group were both significantly decreased ( < 0.01, < 0.001). Similarly, the levels of PRL in serum of ZRD, TTL, and EV groups were slightly increased compared with the OVX rats. And serum E2 levels of rats in ZRD group were slightly increased compared with that of OVX rats ( = 0.073). and vaginal atrophy is a common symptom of postmenopausal estrogen deficiency. To prove that ZRD could benefit the vagina function, we examined the morphology of vagina by immunohistology. OVX control group showed atrophic vaginal epitheliums composed of a few layers of flattened cells. However, one-month administration of ZRD at all doses caused a complete reversal of the vaginal atrophy. This effect was accompanied by hyperplasia and hypertrophy of vaginal epithelium. As shown in Figure 3, the vaginal mucosa overlying in sham group shows thicker stratified squamous epithelium. Compared to sham group, we observe vaginal atrophy and vaginal epithelial thinning in OVX model group, with low degree of diversification. However, the vaginal epithelium was thickening and vaginal epithelial cells were all increased in ZRD, TTL, and EV groups compared with the OVX model group. Furthermore, the vaginal walls were significantly thicker than that of OVX rats ( < 0.001). Expression of ER and ER in Vagina. ERs were localized mainly in the superficial layer of the stratified squamous epithelium, blood vessel walls, and muscle fibers of the vagina. The overall proliferative response to E2 is the result of a balance between ER and ER signaling. To assess the alteration of ERs in response to different treatment, we then detect ER and ER levels in vagina by immunohistochemistry. As shown in Figure 4, representative sections of the expressions of ER and ER in the vagina from each group and quantitative analysis were shown. Importantly, the expressions of ER and ER in the vagina epithelium of OVX rats were both significantly decreased compared to the sham group ( < 0.05, < 0.001). As expected, the vagina epithelium expressions of ER in ZRD, TTL, and EV groups were significantly higher compared with that of the OVX group ( < 0.01, < 0.001, and < 0.001, respectively). In addition, the vagina epithelial expression of ER in ZRD group was increased compared with that of the OVX model group ( < 0.05), consistent with that of EV group ( < 0.01). We also performed the negative and positive control experiment for ER and ER (data not shown). Protein Levels of ER and ER in Uterus and Adrenal Gland. Further evidence for the interaction of the ZRD with the ER system was sought by determining the effects on ERs expressions in target tissues by western blot. To this end, the expressions of ERs in the uterus and adrenal gland were shown in Figure 5. Compared with the sham group, the expressions of ER and ER were significantly decreased in the uterus and adrenal gland of OVX rats. Significantly, the expression of ER in the uterus and the expression of ER in the adrenal gland were most decreased ( < 0.001) (Figures 5(b) and 5(f)). Moreover, the expressions of ER and ER in ZRD group were both increased in the uterus and adrenal glands, with the expression of ER ( < 0.001) and ER ( < 0.01) in the uterus significantly increased. And the expressions of ER and ER in the adrenal glands were increased, but there was no significant difference. Discussion Alternative medicine especially traditional oriental medicine called much attention in battle with certain ailments. Interestingly, herbs are usually very useful in treating disorders that lack obvious pathological alterations such as menopausal syndrome. Previously, natural product such as soybean extract is reported to proliferate the vagina of adult rats and could lower the cancer risk comparing to estrogen treatment. Moreover, medicinal plants such as sage herb and lemon balm were found to play an imperative role in the treatment of acute menopausal syndrome. However, the major concerns about the application of herb mixture are the safety and its unclear working mechanism. Thus, to elucidate the working mechanism would popularize herbs in future medication. Here our study provides new evidence suggesting that ZRD might relieve menopausal disorders in rats. Importantly, ZRD showed strong potential in relieving menopausal symptoms. Frequently reported symptoms of a menopausal syndrome include hot flashes, night sweats, menstrual irregularities, vaginal dryness, nervous tension, headaches, insomnia, and lack of energy, which are quite annoying. Previously we reported that ZRD could relieve some menopausal symptoms in mice. As expected, the independent activity time, grip strength time, sleeping time, thymus coefficient, and spleen coefficient were significantly decreased in ZRD treated mice compared with the young mice. On the contrary, the khan point and fat coefficients were significantly increased by ZRD. These results implicated that ZRD could calm and ease the menopausal mice, inhibit the menopausal obesity, improve the immunity, and relieve fatigue. Besides, our new finding showed that ZRD could increase the weight of the uterus and reduce the weights of the adrenal gland in OVX rats (Figure 1). Results from each antibody were normalized against the level of GAPDH signal detected. Each experiment was repeated for three times. ( # < 0.05, ### < 0.001, compared with the sham group; * * < 0.01, * * * < 0.001, compared with the OVX group; one-way ANOVA.) Moreover, ZRD could improve vaginal wall thickening and mucosa thickening and relieve atrophy, which was similar to TTL and EV groups as shown (Figure 3). Serum E2 levels were also elevated by ZRD (Figure 2(d)). These imply that ZRD might exert estrogenic effects through increasing the level of E2 and improving the uterine and vaginal tissue nutrition. Hence, ZRD might be a good choice for patients of genitourinary syndrome with bothersome symptoms such as vaginal dryness, itching, or dyspareunia. Evidence-Based Furthermore, ZRD showed excellent function in regulating the disturbance in hormones secretion. The onset of menopause is associated with a dramatic change in hormonal levels, a decrease in estrogen, and an increase in FSH and LH hormones, which causes permanent amenorrhea. Under physiological condition, estrogen is mainly regulated by the hypothalamic-pituitary-ovarian axis (HPOA). Hypothalamic secretion of Luteinizing Hormone Releasing Hormone (LHRH) stimulates the pituitary secretion of FSH and LH, and FSH and LH promote the ovary secretion of estrogen (E2). Meanwhile, E2 regulates pituitary secretion of FSH and LH in negative feedback. The increased releasing of hormone LHRH results in increased secretion of FSH and LH, so the levels of FSH and LH in serum were higher in menopausal female rats. Indeed, we found that ZRD could reduce the levels of FSH and LH in serum of OVX rats, while increasing E2 levels ( Figure 2). Thus ZRD might relieve the disorders of menopausal syndrome by the HPOA. In addition, the restoration of ER and ER expression might account for ZRD's protective effect. Estrogen binds to estrogen receptors and exerts its impact on reproductive system. Meanwhile, ER and ER modulate the physiological functions of estrogenic compounds by regulating transcription of specific target genes. These two ERs share some common physiological roles, for example, in the development and function of the ovaries. Here we found that the expressions of estrogen receptors were greatly decreased in OVX rats and ZRD could increase the expression of ER and ER both in the uterus and vagina ( Figures 4 and 5). ER is present mainly in uterus and ovary, showing a more prominent role in uterus. Hence the increased vaginal epithelial thickness might result from increased ER expression by ZRD. However, since it seems to have a more profound effect on the central nervous and immune systems, the increased expression of ER might account for the ZRD's protective effect in our previous report. Consistently, recent report found that glycyrrhizae radix, cinnamomi cortex, Evodiae fructus, and Zingiberis rhizoma demonstrate ER -dependent estrogenic activity and their combined use could produce synergistic ER -dependent estrogenic activity. In addition, the estrogen-stimulating bioactive proteins isolated from Dioscorea species could upregulate the protein expression of ER and its translational levels, potentially reducing the risk of ovarian cancer. These results scientifically support the traditional use of Chinese medicine for relieving menopausal syndrome or treating other female aging disorders, and progress in analysis techniques would widely spread its potential clinical use in the future. Conclusions In summary, our present and previous study provide remarkable insight into the protective effect of ZRD on menopausal syndrome at molecular, morphological, and behavioral levels. Our work indicates that ZRD would be a new choice for menopausal patients. Next we would explore the constituents of ZRD and investigate their effects on expression of relevant genes and signaling pathways in future.
""" A basic Zinc view for the neon application. """ from setuptools import setup, find_packages classifiers = """\ Development Status :: 1 - Planning Intended Audience :: Developers Intended Audience :: Education Intended Audience :: Science/Research License :: OSI Approved :: Apache Software License Programming Language :: Python Operating System :: Microsoft :: Windows Operating System :: Unix Operating System :: MacOS :: MacOS X Topic :: Scientific/Engineering :: Medical Science Apps. Topic :: Scientific/Engineering :: Visualization Topic :: Software Development :: Libraries :: Python Modules """ doc_lines = __doc__.split("\n") setup( name='neon.extension.zincbasicview', version='0.1.0.dev', author='<NAME>', author_email='<EMAIL>', packages=find_packages('src'), package_dir={'': 'src'}, platforms=['any'], url='http://pypi.python.org/pypi/neon.extension.zincbasicview/', license='Apache Software License', description=doc_lines[0], classifiers=filter(None, classifiers.split("\n")), long_description=open('README.rst').read(), requires=['PySide2'], )
// Problem Link: https://www.hackerrank.com/contests/projecteuler/challenges/euler019/problem #include <iostream> #include <vector> #include <map> #include <string> using namespace std; int isleap(long long Y) { if (Y%4==0 && Y%100!=0 || Y%400==0) return 1; return 0; } int num(int m ,long long y) { int num[] = {31, 28+isleap(y), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; return num[m]; } int main() { int T; cin >> T; while (T--) { long long Y1, Y2; int M1, M2, D1, D2, day=1, count = 0; cin >> Y1 >> M1 >> D1 >> Y2 >> M2 >> D2; for (int i=0; i<(Y1-1900)%400; i++) day = (day + 1 + isleap(i+1900))%7;; for (long long y=Y1; y<=Y2; y++) { for (int m=1; m<=12; m++) { if ((y==Y1 && m < M1) || (y==Y2 && m>M2)) { day = (day + num(((m-1)+12)%12, y))%7; continue; } if (y==Y1 && m==M1) { if (D1==1 && day==0) count++; day = (day + num(((m-1)+12)%12, y))%7; continue; } if (day==0) count++; day = (day + num(((m-1)+12)%12, y))%7; } } cout << count << endl; } return 0; }
""" SOILICE to mrfso converter """ from __future__ import absolute_import, division, print_function, unicode_literals import cmor import logging import numpy as np from e3sm_to_cmip.lib import handle_variables # list of raw variable names needed RAW_VARIABLES = [str('SOILICE')] VAR_NAME = str('mrfso') VAR_UNITS = str('kg m-2') TABLE = str('CMIP6_Lmon.json') def write_data(varid, data, timeval, timebnds, index, **kwargs): """ mrfso = verticalSum(SOILICE, capped_at=5000) """ # we only care about data with a value greater then 0 mask = np.greater(data['SOILICE'][index, :], 0.0) # sum the data over the levgrnd axis outdata = np.sum( data['SOILICE'][index, :], axis=0) # replace all values greater then 5k with 5k capped = np.where( np.greater(outdata, 5000.0), 5000.0, outdata) outdata = np.where( mask, capped, outdata) if kwargs.get('simple'): return outdata cmor.write( varid, outdata, time_vals=timeval, time_bnds=timebnds) def handle(infiles, tables, user_input_path, **kwargs): return handle_variables( metadata_path=user_input_path, tables=tables, table=kwargs.get('table', TABLE), infiles=infiles, raw_variables=RAW_VARIABLES, write_data=write_data, outvar_name=VAR_NAME, outvar_units=VAR_UNITS, serial=kwargs.get('serial'), logdir=kwargs.get('logdir'), simple=kwargs.get('simple'), outpath=kwargs.get('outpath')) # ------------------------------------------------------------------
Functionally layered dendrimers: a new building block and its application to the synthesis of multichromophoric light-harvesting systems. A divergent synthesis of internally functionalized dendrimers based on a modular functional monomer has been developed. This strategy was applied to the construction of a light-harvesting dendrimer containing one set of naphthopyranone dyes located at the interior and another set of coumarin chromophores located in the adjacent outer layer surrounding a porphyrin acceptor. Quantitative energy transfer from both donor pigments is observed, giving rise to exclusive emission from the porphyrin core over all excitation wavelengths.
Beyond master distillers and brand ambassadors, many figures instrumental to the whisky industry rarely see their stories told. Yet, the stories are there and each one helps shed light on each category’s success. This particular tale delves into Japanese whisky and Japan’s traditional spirit, shochu, and the oak casks that encase the two. This is the tale of Hirotsugu Hayasaka, one of the oldest and most well-known coopers in Japan who witnessed the fall of Japanese whisky first-hand. I meet Hayasaka-san on a sunny day outside Kagoshima city in Kyushu, Japan’s westernmost island. He’s working in his cooperage. Hayasaka-san may be employed by Satsuma Shuzo Co., one of Japan’s most successful shochu makers, but he’s about much more than spirits and casks. On our way to the distillery's cooperage, we drive by the cooper’s handmade, gorgeous log house. Anything to do with wood, he can build. Hayasaka-san is a cheerful, happy man, outgoing and welcoming. Appreciative of my interest in whisky and wood, he happily tells me his colourful story in the industry. While Hayasaka-san now works in shochu, he was previously the head cooper at Nikka Whisky. He first came into contact with the company when he was in elementary school in Miyagi, when Nikka bought the field next to his home to build the Miyagikyo site. Years later, seeing that coopers were few and in between in Japan, Hayasaka-san decided to become a cooper as he’d always been good with his hands. He started with the company and in just 6 years he became one of the head coopers at Nikka, at a time when Japanese whisky was at its best. From American oak to mizunara, Hayasaka-san built the casks responsible for holding some of Nikka’s most famed expressions. Speaking on wood, however, he immediately shrugs off mizunara, stating the difficulties in working with Japan’s oak. ‘It leaks,’ he says laughing. Hayasaka-san isn't one to hide his opinion. ‘And most mizunara used nowadays is too young. Hokkaido mizunara is better due to the cold climate, but it’s still hard to work with. White oak is the best, I’ve always thought that.’ I ask him about the recent experimentation taking place in Japan around new types of wood, sakura (cherry tree) wood, Japanese cedar, Japanese chestnut. To each wood type I mention he shakes his head. From a seasoned cooper’s eyes, white oak reigns supreme. Meeting Hayasaka-san is a privilege for several different reasons. The obvious one is that he has been instrumental in shaping the art of coopering in Japan, directly affecting the booming Japanese whisky industry. However, what truly leaves me in awe is that this man was there to experience the crash of Japanese whisky consumption in Japan post-WWII and subsequently, the rise of shochu. Hayasaka-san worked at Nikka for 16 years and while he was kept busy during the domestic whisky boom, when shochu came along, he had to look elsewhere. For those who don’t know, Nikka halted production for several years after whisky consumption started plummeting in the 80s. Times were tough, and many had to change their career path in order to make ends meet. Hayasaka-san moved over to the shochu industry and has worked for Satsuma Shuzo for 17 years. Yet, to this day, he remains a huge fan of Nikka, the Super Nikka expression, in particular, is a favourite. Over in the shochu industry, Hayasaka-san’s coopering skills helped raise the quality of barrel-aged shochu expressions by Satsuma Shuzo, pulling up the industry’s standards as a whole. Barrel-aged shochu is still a highly underappreciated category, but luckily some forward-thinking figures in Japan are doing all they can to show the world how great barrel-aged shochu can be. Hayasaka-san believes that if cask quality is focused on, barrel-aged shochu can make a true mark across the world. But sadly, he’ll be watching from the sidelines. Hayasaka-san will retire at the end of summer 2018, next month. He has trained his apprentice into a fully-fledged cooper, and he’ll be taking over the operations at Satsuma Shuzo. Living in his log house just down the road, however, he won’t be too far if the new guy needs a hand. The great Japanese cooper may be retiring, but after meeting him it’s clear he still has a whole lot of energy in him to keep building. From log houses to golf course signs, who knows what’s coming next.
There’s been a fair amount of Trump-supporter braggadocio regarding the President-elect’s nomination of Gen. James “Mad Dog” Mattis as the new Defense Secretary – an admirable choice, certainly. If Mad Dog can navigate the machinations of the Pentagon as well as he did the battlefield we’re in for a rejuvenation of America’s military that should be a major reversal of its downward fortunes over the past few decades. I hope that Mr. Trump fully appreciates the magnitude of the task he has set before Gen. Mattis. That task that has grown steadily in size and complexity since the end of the end of the Bush I administration. It’s not just a matter of budget and resource allocation. Much has been done with the intention of diminishing, if not eliminating, the traditions and esprit-de-corps of all the armed services. An early example is what happened in the wake of a 1991 convention in Las Vegas following the prosecution of the Gulf War. Several Navy officers had their careers sunk in what became the “Tailhook Witch-Hunt” as recounted in the October 1993 issue of Heterodoxy. This is but one of many ventures into the transformation of the military into post-modern, politically-correct, feminist-beholden, open-homosexuality organizations. The 2008 PBS mini-series “Carrier”, whether intentionally or not, gives our potential foes an insight into just how far the emasculation of our armed services has gone. A few extracted bits may be seen here. Not sure I buy premise that there is a pilot shortage. I recall recently reading that maintainers say they have a serious shortage of trained personnel. And I have heard logistics guys say they do not have enough parts, fuel and people. And complaints earlier this year about munitions shortages resulting in combat sorties flown with sub-optimal ordnance loads. Lastly, senior Air Force leaders are continually arguing for additional airframes. Altogether, situation appears to result in complaints that pilots in non-combat assignments are flying only once per week or less. And apparently, some of those graduating UPT are put on the shelf for a year because there are no cockpits available. Real problem in my mind is that our national strategy leads to a force structure that leads to a budget requirement and that amount is simply not available. As the country is apparently unwilling to cough-up more for defense spending, the hard requirement should be to reduce the strategy and force structure such that a balance is struck between the elements competing for the funds made available. The solution lies not so much in more pilots but in the need for a strong National Command Authority prepared to re-set national strategy and enforce budget constraints, and an armed services leadership prepared to balance requirements based upon available funding. The Air Force’s conventional combat readiness and capacity appear rather stunted. Nuclear strike forces? Well, USAF’s Minuteman III missile force has now been de-MIRVed in conformance with our nuclear weapons agreements with the Soviets/Russians. The Minuteman IIIs were once each armed with three nuclear warheads but now sport only one. Additionally, as announced in the 2010 Nuclear Posture Review, “… the intercontinental ballistic missile warheads now are targeted on open oceans — not Russian or Chinese cities — in case of an accidental launch, senior administration officials said in releasing the report.” That’s sure to put fear caution whatever into the hearts of our adversaries. We’ve also been decommissioning advanced, nuclear-capable cruise missiles that are aircraft launched. Meanwhile, the Russians have tested a ground-launched, nuclear-capable cruise missile, said item being specifically prohibited by treaty. The Russians and Chinese have both developed and are deploying or will deploy advanced ICBMs as well as maneuverable hypersonic glide vehicles for nuke delivery that are very difficult to intercept with our current ABM technology. Both are advancing their anti-satellite capabilities. The Cold War arms race didn’t end. It’s accelerating. America? Over the last 10+ years there have been several controversies targeting the Air Force over its command and control – or lack thereof – of the USAF nuclear strike force, including both missile and aircraft delivered warheads. Two of these led to the dismissal of the Air Force Secretary and USAF Chief of Staff by then Defense Secretary Robert Gates. There was also a problem with missile alert crews sleeping with the missile silo blast door open. A SAC wing flunked its ORI (Operational Readiness Inspection) re-inspection ostensibly because of improperly filled-out paperwork. USAF’s nuclear command and control sins may be manifold, but where do we stand in correcting them now that the headlines have faded well into the past? Procurement of military materiel from foreign suppliers is an issue even less publicized. The idea of buying a new USAF aerial tanker from Airbus didn’t seem like a very good idea to Mr. Gaffney who detailed some of the shenanigans involved in the bidding process. There was also a problem with counterfeit chips from the Chinese ending up in our military aircraft as was revealed by Dr. Joel F. Brenner, National Counterintelligence Executive, in a 2009 address. Have we ever held the Chinese accountable? Have we held anyone accountable for any of this? Other than the chaps Mr. Gates tossed? We have some very serious problems concerning America’s Air Force and our military in general. I wish President Trump and General Mattis the best in addressing those problems, however serious and pervasive they may be. They’ll need all the support they can get from the American people if the job’s to be done well.
import { IAction } from '../../../types/action'; import { FETCH_RESOURCES_SUCCESS, FETCH_RESOURCES_PENDING, FETCH_RESOURCES_ERROR, RESOURCEPATHS_ADD_SUCCESS, RESOURCEPATHS_DELETE_SUCCESS } from '../redux-constants'; import { IResource } from '../../../types/resources'; import { IRootState } from '../../../types/root'; import { IRequestOptions } from '../../../types/request'; export function fetchResourcesSuccess(response: object): IAction { return { type: FETCH_RESOURCES_SUCCESS, response }; } export function fetchResourcesPending(): any { return { type: FETCH_RESOURCES_PENDING }; } export function fetchResourcesError(response: object): IAction { return { type: FETCH_RESOURCES_ERROR, response }; } export function addResourcePaths(response: object): IAction { return { type: RESOURCEPATHS_ADD_SUCCESS, response }; } export function removeResourcePaths(response: object): IAction { return { type: RESOURCEPATHS_DELETE_SUCCESS, response }; } export function fetchResources(): Function { return async (dispatch: Function, getState: Function) => { try { const { devxApi }: IRootState = getState(); const resourcesUrl = `${devxApi.baseUrl}/openapi/tree`; const headers = { 'Content-Type': 'application/json' }; const options: IRequestOptions = { headers }; dispatch(fetchResourcesPending()); const response = await fetch(resourcesUrl, options); if (response.ok) { const resources = await response.json() as IResource; return dispatch(fetchResourcesSuccess(resources)); } throw response; } catch (error) { return dispatch(fetchResourcesError({ error })); } }; }
P-119Oxidative stress in the native semen versus strict sperm morphology as predictors of fertilization in couples undergoing IVF Is oxidative stress in the native semen a better predictor of fertilization that strict sperm morphology in couples undergoing IVF? Compared to strict sperm morphology, oxidative stress in the native semen is a better predictor of fertilization than strict sperm morphology in couples undergoing IVF Oxidative stress (OS) in native semen was studied before by measuring oxidative-reductive potential (ORP) and was found to be a good predictor of fertilization in-vitro with a cut-off point of 1.34 mV/106 sperm/mL below which the fertilizing capacity of the sperm is diminished. Similarly, strict sperm morphology (SM) was shown to be a good predictor of fertilization with a cut-off point around 4%. However, the superiority of either of these parameters as a better predictor of fertilization needs to be determined and one of the best methods to test this theory is in the IVF model (not the ICSI model). This prospective cohort study was conducted between September 2017 and December 2018. Couples with unexplained infertility were treated for one cycle of combined IVF/ICSI if 12 oocytes or more were retrieved. If good embryos resulted from IVF, 2 were transferred. If no fertilization occurred from IVF, 2 embryos resulting from ICSI were transferred. All remaining embryos were frozen. A total of 108 couples were enrolled but only 25 fulfilled the criteria and completed the study. A total of 575 oocytes were retrieved from the 25 patients (mean ± SD = 20.5 ± 5.6 oocyte/cycle) but only 3 to 5 oocytes per patient were inseminated by conventional IVF and the rest with ICSI. OS was determined in native semen by measuring oxidative reduction potential (ORP) using the MiOXYS system and the results correlated with the fertilization rate (FR) in the IVF-fertilized oocytes. Strict morphology of the same sample was also determined. Out of the 108 oocytes inseminated with conventional IVF, 36 reached the 2PN stage (FR = 33.3%). The mean (± SD) ORP in the native semen in couples with = >50% IVF fertilization was 1.02 ± 0.1 mV/106 sperm/mL which is significantly lower than in couples with <50% fertilization (2.05 ± 0.7 mV/106 sperm/mL) (P < 0.02). The sensitivity, specificity, PPV, NPV, +LR and LR of the ORP assay in predicting = >50% fertilization were 70.0%, 60.0%, 53.8%, 75.0%, 0.80 and 0.20 respectively. On the contrary, the mean (± SD) SM in the native semen in couples with = >50% IVF fertilization was 9.0 ± 4.74 which is slightly (but insignificantly) higher than in couples with <50% fertilization (8.5333 ± 5.25) (P > 0.5). The sensitivity, specificity, PPV, NPV, +LR and LR of SM in predicting = >50% IVF fertilization were 40.0%, 80.0%, 57.1%, 66.7%, 2.00 and 0.75 respectively. The AUC for ORP was equal to 0.854167 with a cut-off point at 1.5692 mV/106 sperm/ml. On the contrary, the AUC for SM was equal to 0.5367 with a cut-off point at 8, denoting that ORP in the native semen is a better predictor of fertilization in IVF compared to SM. The small sample size of this study can be considered a limitation but these early results can be further confirmed by larger prospective studies involving couples with various causes of infertility, although the criteria required for the recruitment of these couples are not easy to fulfill. Measurement of ORP in semen should be added as a parameter to evaluate the fertilizing capacity of the sperm in routine sperm analysis. This can help clinicians treating couples with unexplained or male factor infertility determine whether anti-oxidant therapy, IUI, IVF or ICSI is the best management option. No applicable
/* Copyright 2016 CyberTech Labs Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "createSensorCommand.h" using namespace twoDModel::commands; CreateSensorCommand::CreateSensorCommand(model::SensorsConfiguration &configurator , const QString &robotModel , const kitBase::robotModel::PortInfo &port , const kitBase::robotModel::DeviceInfo &device , const QPointF &position , const qreal direction) : mImpl(configurator, robotModel, port, device, position, direction) { } bool CreateSensorCommand::execute() { mImpl.create(); return true; } bool CreateSensorCommand::restoreState() { mImpl.remove(); return true; }
Performance evaluation of a probabilistic replica selection algorithm When executing time-sensitive distributed applications, a middleware that provides dependability and timeliness is faced with the important problem of preventing timing failures both under normal conditions and when the quality of service is degraded due to replica failures and transient overload on the server. To address this problem, we have designed a probabilistic model-based replica selection algorithm that allows a middleware to choose a set of replicas to service a client based on their ability to meet a client's timeliness requirements. This selection is done based on the prediction made by a probabilistic model that uses the performance history of replicas as inputs. In this paper, we describe the experiments we have conducted to evaluate the ability of this dynamic selection algorithm to meet a client's timing requirements, and compare it with that of a static and round-robin selection scheme under different scenarios.
def commit_transfer(originator, beneficiary, reference, amount): new_event = db_helper.add_new_event('transfer') originator_transaction = { "originator": originator['account_number'], "beneficiary": beneficiary['account_number'], "reference": reference, "event_id": new_event['event_id'], "amount": -amount} beneficiary_transaction = { "originator": beneficiary['account_number'], "beneficiary": originator['account_number'], "reference": reference, "event_id": new_event['event_id'], "amount": amount } db_helper.add_new_transaction(originator_transaction) db_helper.add_new_transaction(beneficiary_transaction) db_helper.update_account_balance(originator['account_number'], adjusted_balance(originator['account_number']) - amount, new_event['event_id'], new_event['timestamp']) db_helper.update_account_balance(beneficiary['account_number'], adjusted_balance(beneficiary['account_number']) - amount, new_event['event_id'], new_event['timestamp']) db_helper.add_new_balance(new_event['event_id'], originator['balance'], originator['account_number']) db_helper.add_new_balance(new_event['event_id'], beneficiary['balance'], beneficiary['account_number']) return originator_transaction['event_id']
Sertindole: efficacy and safety in schizophrenia Sertindole is an antipsychotic drug with affinity for dopamine D2, serotonin 5-HT2A and 5-HT2C, and 1-adrenoreceptors. Preclinical studies suggest that sertindole acts preferentially on limbic and cortical dopaminergic neurons and clinical trials have confirmed that sertindole is effective at a low dopamine D2 occupancy level. The active substance has a long half-life. Oral administration once daily yields highly stable plasma levels. These features may explain the clinically observed low frequency of extrapyramidal side effects, including tardive dyskinesia. In contrast to most antipsychotics, sertindole seems to be void of sedative effects. However, although not strictly proven by objective neuropsychological tests, this asset of sertindole does not add to the cognitive problems inherent in schizophrenia. Administration of sertindole is more often associated with prolongation of QTc compared with most other currently used antipsychotics. However, large cohort analyses do not suggest that all-cause mortality is higher with sertindole than with, for example, risperidone or olanzapine. The effective antipsychotic dose range of sertindole is 12 20 mg/day, with small variations among patients. The frequency of most adverse events, for example extrapyramidal symptoms and somnolence, with such a dose does not differ from placebo. Three side effects have been more common than with placebo/haloperidol in short-term studies: weight gain, rinithis and a decreased ejaculation volume. Two head-to-head comparisons (one in treatment-resistant patients) of sertindole and risperidone showed equivalent effects on positive symptoms. For negative symptoms, one study obtained equivalent effects and one a superior effect of sertindole. Sertindole should not be used as first-line treatment for first-episode patients with schizophrenia because of the QTc prolongation. It has a side-effect profile that makes it an interesting alternative for many patients who do not respond well to the initial choice of antipsychotic drug.
Replacement of dietary saturated fat with monounsaturated fat: effect on atherogenesis in cholesterol-fed rabbits clamped at the same plasma cholesterol level The aim was to compare the effect on atherogenesis of dietary monounsaturated and saturated fatty acids in cholesterol-clamped rabbits. To obtain an average plasma cholesterol concentration of 20 mmol/l in each rabbit during the 13-week cholesterol-feeding period, dietary cholesterol was adjusted weekly. The amount of fat fed daily was 10 g per rabbit in Expts A (n 23), C (n 36), and D (n 58) and 5 g per rabbit in Expt B (n 24). The source of monounsaturated fatty acids was olive oil in all four experiments. The source of saturated fatty acids was butter in Expt A, lard in Expt B, coconut oil in Expt C, and butter or lard in Expt D. Generally, olive oil-fed groups received more cholesterol and tended to have more cholesterol in VLDL and less in LDL compared with groups receiving saturated fat. Analysis of variance of the combined results of all four experiments showed that, in comparison with saturated fat, olive oil lowered aortic cholesterol by 13 (−930, 95% confidence interval) % in the aortic arch, and by 10 (−1026) % in the thoracic aorta, which was not significant. In the comparison with olive oil, no differences in effects on aortic cholesterol content were detected between butter, lard and coconut oil. These findings do not support the view that replacement of dietary saturated fat with olive oil has a major impact on the development of atherosclerosis in addition to that accounted for by changes in plasma cholesterol levels.
<filename>ch-poetry-nlg/corpus.py import torch from const import * def word2idx(sents, word2idx): return [[word2idx[w] if w in word2idx else UNK for w in s] for s in sents] class Dictionary(object): def __init__(self): self.word2idx = { WORD[UNK]: UNK } self.idx = len(self.word2idx) def add(self, word): if self.word2idx.get(word) is None: self.word2idx[word] = self.idx self.idx += 1 def __call__(self, sents, min_count): words = [word for sent in sents for word in sent] word_count = {w: 0 for w in set(words)} for w in words: word_count[w]+=1 ignored_word_count = 0 for word, count in word_count.items(): if count <= min_count: ignored_word_count += 1 continue self.add(word) return ignored_word_count def __len__(self): return self.idx def __str__(self): return "%s(size = %d)".format(self.__class__.__name__, len(self.idx)) class Corpus(object): def __init__(self, save_data, max_len=20, min_word_count=0): self._save_data = save_data self._max_len = max_len self._min_word_count = min_word_count self.sents = None self.valid_sents = None self.dict = Dictionary() self.is_ch = lambda w: (w >= '\u4e00' and w<='\u9fa5') or w == " " def parse(self): sents, ignore_count = [], 0 for sentences in open("data/poetry"): sentences = sentences.strip() words = [w for w in sentences if self.is_ch(w)] if len(words) != self._max_len: ignore_count += 1 continue sents.append(words) print("Data`s length not eq {} - [{}]".format(self._max_len, ignore_count)) print("Data`s length eq {} - [{}]".format(self._max_len, len(sents))) word_ignore = self.dict(sents, self._min_word_count) if word_ignore != 0: print("Ignored word counts - [{}]".format(word_ignore)) self.sents = sents def save(self): data = { 'max_word_len': self._max_len, 'dict': { 'src': self.dict.word2idx, 'src_size': len(self.dict), }, 'train': word2idx(self.sents, self.dict.word2idx) } torch.save(data, self._save_data) print('word length - [{}]'.format(len(self.dict))) def process(self): self.parse() self.save() if __name__ == "__main__": import argparse parser = argparse.ArgumentParser(description='Chinese Poetry NLG') parser.add_argument('--save-data', type=str, default='data/ch_pro_nlg.pt', help='path to save processed data') args = parser.parse_args() corpus = Corpus(args.save_data) corpus.process()
#pragma once #include "common/base.h" #include <algorithm> #include <vector> namespace heap { class BucketUKeyMap { public: static const unsigned not_in_queue = -1u; using TValue = unsigned; using TSelf = BucketUKeyMap; struct TData { unsigned priority; unsigned key; }; struct Position { unsigned priority = not_in_queue; unsigned index = not_in_queue; }; protected: std::vector<Position> queue_position; std::vector<std::vector<unsigned>> queue; unsigned top_priority = not_in_queue; unsigned size = 0; protected: void ResetHeapPosition(unsigned ukey_size) { queue_position.clear(); queue_position.resize(ukey_size); } public: explicit BucketUKeyMap(unsigned ukey_size) { ResetHeapPosition(ukey_size); } BucketUKeyMap(const std::vector<unsigned>& v, bool skip_heap) { ResetHeapPosition(v.size()); if (skip_heap) { for (unsigned i = 0; i < v.size(); ++i) queue_position[i].priority = v[i]; } else { for (unsigned i = 0; i < v.size(); ++i) { unsigned p = v[i]; AdjustQueueSize(p); queue_position[i].priority = p; queue_position[i].index = queue[p].size(); queue[p].push_back(i); } size = v.size(); ResetPriority(); } } bool Empty() const { return Size() == 0; } unsigned Size() const { return size; } unsigned UKeySize() const { return unsigned(queue_position.size()); } bool HasKey(unsigned key) const { return queue_position[key].index != not_in_queue; } unsigned GetPriority(unsigned key) const { return queue_position[key].priority; } public: void AddNewKey(unsigned key, unsigned priority, bool skip_heap = false) { assert(queue_position[key].index == not_in_queue); AddNewKeyI(key, priority, skip_heap); } void SetPriority(unsigned key, unsigned new_priority) { if (queue_position[key].index == not_in_queue) AddNewKeyI(key, new_priority, false); else SetPriorityI(key, new_priority); } void DecreasePriorityIfLess(unsigned key, unsigned new_priority) { if (new_priority < queue_position[key].priority) SetPriority(key, new_priority); } void Add(const TData& x) { SetPriority(x.key, x.priority); } unsigned TopPriority() const { return top_priority; } unsigned TopKey() const { return queue[top_priority].back(); } TData Top() const { return {TopPriority(), TopKey()}; } void Pop() { DeleteKey(TopKey()); } unsigned ExtractKey() { unsigned t = TopKey(); Pop(); return t; } unsigned ExtractPriority() { unsigned t = TopPriority(); Pop(); return t; } TData Extract() { TData t = Top(); Pop(); return t; } void DeleteKey(unsigned key) { DeleteI(queue_position[key]); queue_position[key].index = not_in_queue; } protected: void AdjustQueueSize(unsigned k) { if (queue.size() <= k) queue.resize(k + 1); } void ShiftPriority() { for (; queue[top_priority].size() == 0;) ++top_priority; } void ResetPriority() { if (Empty()) { top_priority = -1u; } else { top_priority = 0; ShiftPriority(); } } void AddNewKeyI(unsigned key, unsigned priority, bool skip_heap) { queue_position[key].priority = priority; if (!skip_heap) { AdjustQueueSize(priority); queue_position[key].index = queue[priority].size(); queue[priority].push_back(key); ++size; top_priority = std::min(top_priority, priority); } } void SetPriorityI(unsigned key, unsigned new_priority) { Position old = queue_position[key]; if (old.priority != new_priority) { AddNewKeyI(key, new_priority, false); DeleteI(old); } } void DeleteI(const Position& pos) { assert(pos.index != not_in_queue); if (pos.index == queue[pos.priority].size() - 1) { queue[pos.priority].pop_back(); } else { queue[pos.priority][pos.index] = queue[pos.priority].back(); queue_position[queue[pos.priority].back()].index = pos.index; queue[pos.priority].pop_back(); } --size; ShiftPriority(); } }; } // namespace heap
package com.javarush.task.task22.task2201; /* Строки нитей или строковые нити? Вот в чем вопрос */ public class Solution { public static final String FIRST_THREAD_NAME = "1#"; public static final String SECOND_THREAD_NAME = "2#"; private Thread thread1; private Thread thread2; private Thread thread3; public Solution() { initThreads(); } public static void main(String[] args) { new Solution(); } protected void initThreads() { this.thread1 = new Thread(new Task(this, "A\tB\tC\tD\tE\tF\tG\tH\tI"), FIRST_THREAD_NAME); this.thread2 = new Thread(new Task(this, "J\tK\tL\tM\tN\tO\tP\tQ\tR\tS\tT\tU\tV\tW\tX\tY\tZ"), SECOND_THREAD_NAME); this.thread3 = new Thread(new Task(this, "\t\t"), "3#"); Thread.setDefaultUncaughtExceptionHandler(new OurUncaughtExceptionHandler()); this.thread1.start(); this.thread2.start(); this.thread3.start(); } public synchronized String getPartOfString(String string, String threadName) { int first = string.indexOf('\t'); int last = string.lastIndexOf('\t'); String result; try { result = string.substring(first + 1, last); } catch (StringIndexOutOfBoundsException e) { throw this.getException(threadName, e); } return result; } private RuntimeException getException(String threadName, StringIndexOutOfBoundsException e) { RuntimeException thrown; switch (threadName) { case FIRST_THREAD_NAME: thrown = new StringForFirstThreadTooShortException(e); break; case SECOND_THREAD_NAME: thrown = new StringForSecondThreadTooShortException(e); break; default: thrown = new RuntimeException(e); } return thrown; } }
/* * Copyright (c) 2012 ASMlover. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list ofconditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materialsprovided with the * distribution. * * 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 <stdarg.h> #include <string.h> #include "../inc/config.h" #include "../inc/assert.h" #include "../inc/memory.h" #include "../inc/bit.h" struct lBit { unsigned char* bytes; unsigned long* dwords; int size; }; #define BITS_PER_DWORD (8 * sizeof(unsigned long)) #define NUM_OF_DWORDS(len) ((((len) + BITS_PER_DWORD - 1) & (~(BITS_PER_DWORD - 1))) / BITS_PER_DWORD) #define NUM_OF_BYTES(len) ((((len) + 8 - 1) & (~(8 - 1))) / 8) #define SET_OPERATIONS(B1, B2, op)\ {\ int i;\ struct lBit* B;\ assert((B1)->size == (B2)->size);\ B = bit_create((B1)->size);\ for (i = NUM_OF_DWORDS((B1)->size); --i >= 0; )\ B->dwords[i] = (B1)->dwords[i] op (B2)->dwords[i];\ return B;\ }\ static unsigned char msbmask[] = { 0xFF, 0xFE, 0xFC, 0xF8, 0xF0, 0xE0, 0xC0, 0x80 }; static unsigned char lsbmask[] = { 0x01, 0x03, 0x07, 0x0F, 0x1F, 0x3F, 0x7F, 0xFF }; static struct lBit* bit_copy(struct lBit* B) { struct lBit* copy_B; assert(NULL != B); copy_B = bit_create(B->size); if (B->size > 0) memcpy(copy_B->bytes, B->bytes, NUM_OF_BYTES(B->size)); return copy_B; } void* bit_create(int size) { struct lBit* object; assert(size >= 0); NEW0(object); if (size > 0) object->dwords = CALLOC(NUM_OF_DWORDS(size), sizeof(unsigned long)); else object->dwords = NULL; object->bytes = (unsigned char*)object->dwords; object->size = size; return object; } void bit_release(void** B) { assert(NULL != *B); FREE(((struct lBit*)*B)->dwords); FREE(*B); } int bit_size(void* B) { return (NULL != B ? ((struct lBit*)B)->size : ERROR_LEN); } int bit_count(void* P) { int count = 0, bits; struct lBit* B = (struct lBit*)P; static char count_list[] = { 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4 }; if (NULL != B) { for (bits = NUM_OF_BYTES(B->size); --bits >= 0; ) { unsigned char c = B->bytes[bits]; count += count_list[c & 0xF] + count_list[c >> 4]; } return count; } return 0; } void bit_clear(void* B) { bit_clear_range(B, 0, bit_size(B) - 1); } int bit_set(void* P, int i, int val) { int old_bit; struct lBit* B = (struct lBit*)P; assert(NULL != B && (0 == val || 1 == val) && 0 <= i && i < B->size); old_bit = ((B->bytes[i / 8] >> (i % 8)) & 1); if (1 == val) B->bytes[i / 8] |= (1 << (i % 8)); else B->bytes[i / 8] &= ~(1 << (i % 8)); return old_bit; } int bit_get(void* P, int i) { struct lBit* B = (struct lBit*)P; assert(NULL != B && 0 <= i && i < B->size); return ((B->bytes[i / 8] >> (i % 8)) & 1); } void bit_clear_range(void* P, int beg, int end) { struct lBit* B = (struct lBit*)P; assert(NULL != B && 0 <= beg && end < B->size && beg <= end); if (beg / 8 < end / 8) { int i; B->bytes[beg / 8] &= ~msbmask[beg % 8]; for (i = beg / 8 + 1; i < end / 8; ++i) B->bytes[i] = 0; B->bytes[end / 8] &= ~lsbmask[end % 8]; } else B->bytes[beg / 8] &= ~(msbmask[beg % 8] & lsbmask[end % 8]); } void bit_set_range(void* P, int beg, int end) { struct lBit* B = (struct lBit*)P; assert(NULL != B && 0 <= beg && end < B->size && beg <= end); if (beg / 8 < end / 8) { int i; B->bytes[beg / 8] |= msbmask[beg % 8]; for (i = beg / 8 + 1; i < end / 8; ++i) B->bytes[i] = 0xFF; B->bytes[end / 8] |= lsbmask[end % 8]; } else B->bytes[beg / 8] |= (msbmask[beg % 8] & lsbmask[end % 8]); } void bit_not_range(void* P, int beg, int end) { struct lBit* B = (struct lBit*)P; assert(NULL != B && 0 <= beg && end < B->size && beg <= end); if (beg / 8 < end / 8) { int i; B->bytes[beg / 8] ^= msbmask[beg % 8]; for (i = beg / 8 + 1; i < end / 8; ++i) B->bytes[i] ^= 0xFF; B->bytes[end / 8] ^= lsbmask[end % 8]; } else B->bytes[beg / 8] ^= (msbmask[beg % 8] & lsbmask[end % 8]); } int bit_lt(void* P1, void* P2) { int i, ret = 0; struct lBit* B1 = (struct lBit*)P1; struct lBit* B2 = (struct lBit*)P2; assert(NULL != B1 && NULL != B2 && B1->size == B2->size); for (i = NUM_OF_DWORDS(B1->size); --i >= 0; ) { if (0 != (B1->dwords[i] & ~B2->dwords[i])) return 0; else if (B1->dwords[i] != B2->dwords[i]) ret |= 1; } return ret; } int bit_eq(void* P1, void* P2) { int i; struct lBit* B1 = (struct lBit*)P1; struct lBit* B2 = (struct lBit*)P2; assert(NULL != B1 && NULL != B2 && B1->size == B2->size); for (i = NUM_OF_DWORDS(B1->size); --i >= 0; ) { if (B1->dwords[i] != B2->dwords[i]) return 0; } return 1; } int bit_leq(void* P1, void* P2) { int i; struct lBit* B1 = (struct lBit*)P1; struct lBit* B2 = (struct lBit*)P2; assert(NULL != B1 && NULL != B2 && B1->size == B2->size); for (i = NUM_OF_DWORDS(B1->size); --i >= 0; ) { if (0 != (B1->dwords[i] & ~B2->dwords[i])) return 0; } return 1; } void bit_for_each(void* P, void (*visit)(int, int, void*), void* arg) { int i; struct lBit* B = (struct lBit*)P; if (NULL == B || NULL == visit) return; for (i = 0; i < B->size; ++i) visit(i, ((B->bytes[i / 8] >> (i % 8)) & 1), arg); } void* bit_union(void* B1, void* B2) { if (NULL == B1 && NULL == B2) return NULL; else if (NULL == B1) return bit_copy(B2); else if (NULL == B2) return bit_copy(B1); else SET_OPERATIONS((struct lBit*)B1, (struct lBit*)B2, |) } void* bit_inter(void* B1, void* B2) { if (NULL == B1 && NULL == B2) return NULL; else if (NULL == B1) return bit_create(((struct lBit*)B2)->size); else if (NULL == B2) return bit_create(((struct lBit*)B1)->size); else SET_OPERATIONS((struct lBit*)B1, (struct lBit*)B2, &) } void* bit_minus(void* B1, void* B2) { if (NULL == B1 && NULL == B2) return NULL; else if (NULL == B1) return bit_create(((struct lBit*)B2)->size); else if (NULL == B2) return bit_copy(B1); else SET_OPERATIONS((struct lBit*)B1, (struct lBit*)B2, & ~) } void* bit_diff(void* B1, void* B2) { if (NULL == B1 || NULL == B2) return NULL; else if (NULL == B1) return bit_copy(B2); else if (NULL == B2) return bit_copy(B1); else SET_OPERATIONS((struct lBit*)B1, (struct lBit*)B2, ^) }
Increase in preexisting cellular antigen-combining groups at different times after infection with different viruses. During the course of experiments designed to determine whether infection of normal cells with certain strains of Herpesvirus hominis (HSV) gives rise to a specific neoantigen, presumably characteristic for human malignant cells ("HeLa G"), it was found that the seeming appearance of such a new antigen actually represents only an increase in concentration of previously existing normal antigen groups. The complement fixation tests for this antigen were carried out with antibody prepared by McKenna against a fraction, purified with the fluorocarbon genetron, from HeLa cells. This antibody reacted with extracts of tissue culture cells derived from various human malignant tumors and from the spontaneously transformed WISH cell line, originally derived from normal human amnion, but not with cells derived from early-passage cultures of normal human kidney, or from primary cultures of young rabbit kidney or new-born guinea pig kidney. Infection of rabbit and guinea pig kidney tissue culture cells with HSV strains derived from brain or lip lesions at a high input multiplicity of virus failed to yield the "G" antigen. Infection of human kidney tissue culture cells with the same HSV strains yielded two units of the "G" antigen at 6 hr and 32 units at 24 hr. The conclusion that this was, nevertheless, not a new antigen, but only an increase in amount of preexisting antigen, was based on the demonstration that absorption of the anti-"HeLa G" globulin with uninfected human kidney tissue culture cells completely removed the antibody for the "G" antigen formed during the course of infection with HSV and also that present in uninfected WISH and HEp2 cells. Infection by the same HSV strains of the human WISH cells which have a small amount of preexisting "G" antigen resulted in an increase which was maximal at 24 hr. Infection of WISH cells with vaccinia virus resulted in a rapid increase of "G" antigen, which was demonstrable at 10 min but not at 3, 6, and 24 hr. Absorption of the anti-"HeLa G" globulin with uninfected WISH cells removed the antibody for the G antigen present in the WISH cells before infection as well as after infection with the herpes and vaccinia viruses, and also the antigen present in human tissue culture cells of malignant origin.
The Big Red struggled to keep Princeton at bay throughout the first half; Princeton's lead at the half was the largest it has ever had over a Division I opponent during the years Head Coach Mitch Henderson has led the Tigers. The Orange and Black followed up the 53 points racked up the points in the first half, with a strong 31 additional points scored in the second half. Junior guard Devin Canaday drained three of the seven Tiger three-pointers during the first and second quarters, and Canaday landed a full 17 points by the end of the first half, leading the roster in points. In total, 16 Tigers hit the court, and 12 of them scored. By the second half, many players left the Tigers’ bench for the court, but had little effect on the difference as the Tigers kept the heat on until the clock ran out. With one minute left, the Tigers led 89 to 54. The final score? 91-54. The win brings the Tigers’ at-home win tally to 4-2. Overall, Princeton is 9-8 this season, and the team will next compete at home on Jan. 28 versus the Rowan University Profs.
Behavioral oscillations: hidden temporal dynamics in visual attention. Neuronal oscillations are widely known to contribute to various aspects of cognition, but most associated evidence is based upon post-hoc relationships between recorded brain dynamics and behavior. It remains largely unknown whether brain oscillations causally mediate behavior and can be directly manifested in behavioral performances. Interestingly, several recent psychophysical studies, by employing a time-resolved measurement, revealed rhythmic fluctuations (Landau & Fries, 2012; ) and even neurophysiologically relevant spectrotemporal dynamics () directly in behavior. In this talk, I will present our recent studies in which we examined fine temporal dynamics of behavioral performances in various classical visual paradigms. Together, the results suggest that behavioral data, instead of being sluggish and unable to reflect underlying neuronal dynamics, actually contain rich temporal structures (i.e., 'behavioral oscillations', ), in a somewhat neurophysiology relevant manner. I propose that these new 'behavioral oscillations' findings, in combination with well-established neuronal oscillation work, speak to an oscillation-based temporal organization mechanism in visual attention.
<reponame>UlordChain/ux-wallet package one.ulord.upaas.uxtoken.wallet.address; import org.apache.poi.xssf.usermodel.XSSFRow; import org.apache.poi.xssf.usermodel.XSSFSheet; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.List; public class ImportExcel { public List<AddressTarget> getAllByExcel(File file) throws IOException { List<AddressTarget> list = new ArrayList<>(); XSSFWorkbook workbook = null; try { // 获取Excel对象 workbook = new XSSFWorkbook(file); // 获取选项卡对象 第0个选项卡 XSSFSheet sheet = workbook.getSheetAt(0); // 循环选项卡中的值 for (int rowNum = 0; rowNum <= sheet.getLastRowNum(); rowNum++) { // 获取单元格对象,然后取得单元格的值,并设置到对象中 XSSFRow row = sheet.getRow(rowNum); String address = row.getCell(0).getStringCellValue(); if (!address.startsWith("0x")) continue; String amount = row.getCell(1).getRawValue(); AddressTarget person = new AddressTarget(address, amount); list.add(person); } } catch (Exception e) { e.printStackTrace(); } finally { if (workbook != null){ workbook.close(); } } return list; } }
Transient cortical blindness, a rare complication during cerebral digital subtraction angiography: A case report and literature review Abstract Transient cortical blindness (TCB) is a rare consequence of cerebral angiography with no recognized cause. TCB was observed in a patient with a wideneck cavernous aneurysm during digital subtraction angiography. One hour after angiography, vision returned spontaneously, with no neurological damage. An MRI was performed three hours after the incident and revealed no abnormalities. | INTRODUCTION Transient cortical blindness (TCB) is associated with the loss of perceived vision, normal fundi, normal papillary reflexes, and unaltered extraocular movements. 1,2 It is a rare but a known complication of cerebral and coronary angiography following the administration of contrast medium with a reported incidence of 0.3%-1%. 3 Due to the introduction of newer contrast agents, Till et al. recently reported a 0.2% incidence. 4 The incidence of TCB in vertebral angiography is greater relative to the cardiac angiography. 5 Symptoms may appear immediately after a contrast medium injection and disappear within 24 h. We present a case of TCB with DSA and MRI findings. | CASE REPORTS Two episodes of right retro-orbital pain with loss of vision in the right eye were reported by a 42-year-old male patient with a BMI of 25 kg/m 2. There has been no previous history of headaches, nystagmus, or strabismus. There has been no loss of consciousness. He had never suffered a head injury before. There is no history of diabetes or high triglycerides. He was a newly diagnosed essential hypertensive who was taking 5 mg amlodipine. His blood pressure at the time of admission was 135/80 mmHg. Due to the previous cerebral flow diverter, he was on daily Plavix 75 mg and Aspirin 75 mg. There is no history of aneurysms in the family. Extraocular muscles were normal, and there was no cranial nerve palsy on physical examination. Pupils were equal and reactive to light and accommodation. There was no additional sign of a neurological deficit. A massive right cavernous saccular aneurysm was diagnosed during his admission magnetic resonance cerebral angiography (Figure 1). To exclude the aneurysm from the parent artery, a 42.5 35 mm pipeline flex embolization device (PED) (Intracranial flow diverter stent) was deployed across the cavernous internal carotid artery aneurysmal neck 24 h later. There was no immediate difficulty. For the past 6 months, no reaction to the contrast medium has been reported. After 24 h on prasugrel, the patient was discharged. The patient reported that his symptoms had improved and that he had no new ones. PED stent migration was visible on follow-up skull radiographs at one and 6 months. A 6-month follow-up digital subtraction angiography of the right internal carotid artery and vertebral artery was performed utilizing a right radial artery approach with a 5F DAV catheter. The angiography was performed with 0.5 ml/kg of Omnipaque 300 mg/ml contrast medium diluted to 50% with normal saline. The internal carotid angiography revealed a proximally migrated stent into the aneurysm sac ( Figure 2) with no contrast medium extravasation. The patient became unexpectedly combative during the same procedure, when the right vertebral artery was canulated and contrast medium was injected. He had a brief tonic seizure (lasting about 30 s), followed by horizontal nystagmus, tinnitus, loss of vision, and incomprehensible speech. He remained calm, intelligible in speaking, and progressively recovered his vision over the course of an hour after the seizure. The procedure was canceled. His blood pressure was constant between 140/80 and 145/84 mmHg during and after the surgery. His electrolytes and renal function were both within normal ranges. The angiograms in the vertebrobasilar and internal carotid artery areas revealed no vascular occlusion or spasm. Within 2 h of angiography, brain magnetic resonance imaging revealed nonspecific patchy T1-weighted hypo-intensities and T2-weighted hyper-intensities in the periventricular areas. On diffusion weighted images and apparent diffusion coefficient, there was no restricted diffusion ( Figure 3). Because the non-contrast pictures were non-specific, gadolinium was not used. The authors decided against using a CT scan of the brain because they believed T2-weighted MRI images were more sensitive to fluid-related abnormalities and would expose the patient to less radiation. After a 24-h observation period, the patient was discharged. His 3 months post-event review were uneventful (Table 1). | DISCUSSION Transient cortical blindness is a dramatic complication of coronary and cerebral angiography. It is extremely rare, and our hospital has performed 61 cerebral angiograms over the course of the past 2 years, but this is the very first example of it that we have seen (0.02%). This is in line with the findings of recently published research that can be attributed to more modern contrast agents. 4 The symptoms of TCB can begin as soon as the contrast agent is injected, and they can take up to 24 h to appear. 5 Bilateral visual loss has been reported in a number of case reports as noted in the current case. The index case experienced in addition, tonic seizure, tinnitus, horizontal nystagmus, and incoherent speech. The recovery of normal vision and symptoms may range from few hours, as in the index case of 1 h to about 5 days. 2,7,9 An embolism is a relatively uncommon complication that can arise from cerebral angiography. It causes cortical ischemia, which is often unilateral. When considering the clinical context of angiography, bilateral cortical blindness is not likely to be due to bilateral embolic infarction. However, it is absolutely necessary to rule out the possibility of a hemorrhagic or embolic infarction by using CT and/or MRI, with negative MRI in this particular case. After cerebral angiography, there have been two primary hypotheses proposed for TCB, both of which are very speculative and highly contentious. The vast majority of authors are of the opinion that the neurotoxic impact of the contrast agent is responsible for osmotic rupture of the blood brain barrier (BBB). 10 This hypothesis appears to be supported by the vulnerability of various sympathetic innervation of the posterior circulation to rupture of the blood brain barrier. 11 If a contrast agent such as Omnipaque is not diluted, it will become hyperosmotic to the blood and may exacerbate the breakdown of the blood-brain barrier. It is anticipated that a higher dose of contrast medium may prolong the exposure duration of the cerebrovascular endothelium to the agent by increasing the exposure time. This would ultimately result in a malfunction of the BBB, which would further increase the transfer of contrast material. 2 Table 2 shows previous literature on the type of contrast medium and clinical presentation of patients with TCB during carotid and vertebral angiography. The second hypothesis is known as PRES, which refers to posterior reversible leukoencephalopathy syndrome. 2 It is a neurotoxic state that develops as a result of the failure of the posterior circulation to auto-regulate in response to sudden shifts in blood pressure. Without infarction, hyperperfusion can occur, which leads to a rupture of the blood-brain barrier (BBB) and vasogenic edema in the periventricular and perivascular areas. This often occurs in the parieto-occipital regions of the brain. 17 Chronic hypertension could weaken the cerebral arterioles and eventually lead to underperfusion, resulting in brain ischemia and in due course vasogenic edema. 18 Li et al. showed that the rate of hypertension and diabetes were higher in the patients with TCB even though the association does not reach statistical significance. 18 They also showed using logistic regression analysis, patients with low weight who receive higher doses of contrast medium and those with posterior circulation injection have a higher risk of developing TCB than those with lower doses and anterior circulation injection. 18 The index case has a 5-year history of chronic hypertension and TCB occurred during vertebral injection. Yazici et al 19 and Frantz 20 reviewed a total of 33 patients who had transient cortical blindness following coronary angiography and showed that 17 patients had bypass graft and nine patients had chronic arterial hypertension, strengthening the argument of hypertension, and bypass graft as risk factors. Approximately 50% of people diagnosed with TCB exhibit normal findings on CT scans. Tong et al. discovered, after reviewing 12 cases, that 50% of the patients exhibited extravasation of contrast medium into the subarachnoid spaces and predominantly occipital lobe white matter changes, either unilaterally or bilaterally. 21 The MRI is more sensitive than other imaging modalities, notably the FLAIR (fluid-attenuated inversion recovery) and DWI (diffusion weighted imaging) images. These images show significant signal changes in the parieto-occipital white matter and sometimes patchy contrast enhancement. Posterior reversible leukoencephalopathy syndrome exhibits the characteristics that are comparable with these. 7 The MRI of the brain performed for the index case within 2 h of the incidence showed patchy periventricular T2high signal intensities. Because the condition resolves on its own, medical intervention is rarely necessary. TCB is a diagnosis of exclusion, some authors recommend that steroid treatment, anticoagulation, and hydration be administered before the patient's vision is restored. 21 Steroids will reduce the vasogenic edema and stabilize the BBB. Our patient did not receive any specific treatment; however, we ensured that the airway was patent, blood pressure and pulse were normal, and his random blood sugar was 8 mmol/L. He complained of headache for which 1 g paracetamol was administered orally. | CONCLUSION The diagnosis of TCB is one of exclusion. It is a serious and unusual complication that can occur during cerebral and coronary angiograms. Neurotoxicity of the contrast medium as well as PRES have been proposed as possible causes, despite the fact that this is contentious. Chronic hypertension, receiving a large dosage of contrast medium, and having a vertebral angiography are all independent risk factors. The condition exhibits complete recovery within hours to days, with no vestige of neurological deficit remaining after recovery. It is necessary to treat it with supportive therapy, but there is no evidence to support the use of steroids. Computed tomography, magnetic resonance imaging, and angiography should all be performed immediately in order to rule out the possibility of embolic infarction as a complication of angiography. Radiologists and radiographers need to be aware of TCB, so that they can avoid unnecessary procedures in light of the dramatic presentation of the index case. AUTHOR CONTRIBUTIONS B Sarkodie and E Jackson performed the digital subtraction angiography. B Jimah and D Anim reviewed the MRI. B Jimah prepared the manuscript. E. Brakohiapa critically reviewed and revised the manuscript. All authors read and approved the final version of the manuscript.
<filename>nrf5340-app-pac/src/qspi_ns/dpmdur.rs #[doc = "Register `DPMDUR` reader"] pub struct R(crate::R<DPMDUR_SPEC>); impl core::ops::Deref for R { type Target = crate::R<DPMDUR_SPEC>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } impl core::convert::From<crate::R<DPMDUR_SPEC>> for R { fn from(reader: crate::R<DPMDUR_SPEC>) -> Self { R(reader) } } #[doc = "Register `DPMDUR` writer"] pub struct W(crate::W<DPMDUR_SPEC>); impl core::ops::Deref for W { type Target = crate::W<DPMDUR_SPEC>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } impl core::ops::DerefMut for W { #[inline(always)] fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 } } impl core::convert::From<crate::W<DPMDUR_SPEC>> for W { fn from(writer: crate::W<DPMDUR_SPEC>) -> Self { W(writer) } } #[doc = "Field `ENTER` reader - Duration needed by external flash to enter DPM. Duration is given as ENTER * 256 * 62.5 ns."] pub struct ENTER_R(crate::FieldReader<u16, u16>); impl ENTER_R { pub(crate) fn new(bits: u16) -> Self { ENTER_R(crate::FieldReader::new(bits)) } } impl core::ops::Deref for ENTER_R { type Target = crate::FieldReader<u16, u16>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } #[doc = "Field `ENTER` writer - Duration needed by external flash to enter DPM. Duration is given as ENTER * 256 * 62.5 ns."] pub struct ENTER_W<'a> { w: &'a mut W, } impl<'a> ENTER_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { self.w.bits = (self.w.bits & !0xffff) | ((value as u32) & 0xffff); self.w } } #[doc = "Field `EXIT` reader - Duration needed by external flash to exit DPM. Duration is given as EXIT * 256 * 62.5 ns."] pub struct EXIT_R(crate::FieldReader<u16, u16>); impl EXIT_R { pub(crate) fn new(bits: u16) -> Self { EXIT_R(crate::FieldReader::new(bits)) } } impl core::ops::Deref for EXIT_R { type Target = crate::FieldReader<u16, u16>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } #[doc = "Field `EXIT` writer - Duration needed by external flash to exit DPM. Duration is given as EXIT * 256 * 62.5 ns."] pub struct EXIT_W<'a> { w: &'a mut W, } impl<'a> EXIT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { self.w.bits = (self.w.bits & !(0xffff << 16)) | (((value as u32) & 0xffff) << 16); self.w } } impl R { #[doc = "Bits 0:15 - Duration needed by external flash to enter DPM. Duration is given as ENTER * 256 * 62.5 ns."] #[inline(always)] pub fn enter(&self) -> ENTER_R { ENTER_R::new((self.bits & 0xffff) as u16) } #[doc = "Bits 16:31 - Duration needed by external flash to exit DPM. Duration is given as EXIT * 256 * 62.5 ns."] #[inline(always)] pub fn exit(&self) -> EXIT_R { EXIT_R::new(((self.bits >> 16) & 0xffff) as u16) } } impl W { #[doc = "Bits 0:15 - Duration needed by external flash to enter DPM. Duration is given as ENTER * 256 * 62.5 ns."] #[inline(always)] pub fn enter(&mut self) -> ENTER_W { ENTER_W { w: self } } #[doc = "Bits 16:31 - Duration needed by external flash to exit DPM. Duration is given as EXIT * 256 * 62.5 ns."] #[inline(always)] pub fn exit(&mut self) -> EXIT_W { EXIT_W { w: self } } #[doc = "Writes raw bits to the register."] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { self.0.bits(bits); self } } #[doc = "Set the duration required to enter/exit deep power-down mode (DPM).\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dpmdur](index.html) module"] pub struct DPMDUR_SPEC; impl crate::RegisterSpec for DPMDUR_SPEC { type Ux = u32; } #[doc = "`read()` method returns [dpmdur::R](R) reader structure"] impl crate::Readable for DPMDUR_SPEC { type Reader = R; } #[doc = "`write(|w| ..)` method takes [dpmdur::W](W) writer structure"] impl crate::Writable for DPMDUR_SPEC { type Writer = W; } #[doc = "`reset()` method sets DPMDUR to value 0xffff_ffff"] impl crate::Resettable for DPMDUR_SPEC { #[inline(always)] fn reset_value() -> Self::Ux { 0xffff_ffff } }
Artwork by Calvin Carter photos provided by Calvin Carter. The Beaumont Art League is expanding its offerings with art classes taught by local artist Calvin Carter. The class is designed for beginning to intermediate students, and will cover a variety of techniques used in painting in drawing, like charcoal, watercolor, acrylic and oils. Sessions are Thursdays from 6 p.m. to 8 p.m. starting Jan. 11 through Feb. 22 and will include a lecture, demonstration and hands-on work. Classes cost $100 per month. If a students signs up for both months, he or she will receive a $20 discount. Visit the Beaumont Art League's Facebook page, "Beaumont Art League," or call (409) 833-4179 for more.
/* * Converts string to multirange. * * We expect curly brackets to bound the list, with zero or more ranges * separated by commas. We accept whitespace anywhere: before/after our * brackets and around the commas. Ranges can be the empty literal or some * stuff inside parens/brackets. Mostly we delegate parsing the individual * range contents to range_in, but we have to detect quoting and * backslash-escaping which can happen for range bounds. Backslashes can * escape something inside or outside a quoted string, and a quoted string * can escape quote marks with either backslashes or double double-quotes. */ Datum multirange_in(PG_FUNCTION_ARGS) { char *input_str = PG_GETARG_CSTRING(0); Oid mltrngtypoid = PG_GETARG_OID(1); Oid typmod = PG_GETARG_INT32(2); TypeCacheEntry *rangetyp; int32 ranges_seen = 0; int32 range_count = 0; int32 range_capacity = 8; RangeType *range; RangeType **ranges = palloc(range_capacity * sizeof(RangeType *)); MultirangeIOData *cache; MultirangeType *ret; MultirangeParseState parse_state; const char *ptr = input_str; const char *range_str_begin = NULL; int32 range_str_len; char *range_str; cache = get_multirange_io_data(fcinfo, mltrngtypoid, IOFunc_input); rangetyp = cache->typcache->rngtype; while (*ptr != '\0' && isspace((unsigned char) *ptr)) ptr++; if (*ptr == '{') ptr++; else ereport(ERROR, (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("malformed multirange literal: \"%s\"", input_str), errdetail("Missing left brace."))); parse_state = MULTIRANGE_BEFORE_RANGE; for (; parse_state != MULTIRANGE_FINISHED; ptr++) { char ch = *ptr; if (ch == '\0') ereport(ERROR, (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("malformed multirange literal: \"%s\"", input_str), errdetail("Unexpected end of input."))); if (isspace((unsigned char) ch)) continue; switch (parse_state) { case MULTIRANGE_BEFORE_RANGE: if (ch == '[' || ch == '(') { range_str_begin = ptr; parse_state = MULTIRANGE_IN_RANGE; } else if (ch == '}' && ranges_seen == 0) parse_state = MULTIRANGE_FINISHED; else if (pg_strncasecmp(ptr, RANGE_EMPTY_LITERAL, strlen(RANGE_EMPTY_LITERAL)) == 0) { ranges_seen++; ptr += strlen(RANGE_EMPTY_LITERAL) - 1; parse_state = MULTIRANGE_AFTER_RANGE; } else ereport(ERROR, (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("malformed multirange literal: \"%s\"", input_str), errdetail("Expected range start."))); break; case MULTIRANGE_IN_RANGE: if (ch == ']' || ch == ')') { range_str_len = ptr - range_str_begin + 1; range_str = pnstrdup(range_str_begin, range_str_len); if (range_capacity == range_count) { range_capacity *= 2; ranges = (RangeType **) repalloc(ranges, range_capacity * sizeof(RangeType *)); } ranges_seen++; range = DatumGetRangeTypeP(InputFunctionCall(&cache->typioproc, range_str, cache->typioparam, typmod)); if (!RangeIsEmpty(range)) ranges[range_count++] = range; parse_state = MULTIRANGE_AFTER_RANGE; } else { if (ch == '"') parse_state = MULTIRANGE_IN_RANGE_QUOTED; else if (ch == '\\') parse_state = MULTIRANGE_IN_RANGE_ESCAPED; } break; case MULTIRANGE_IN_RANGE_ESCAPED: parse_state = MULTIRANGE_IN_RANGE; break; case MULTIRANGE_IN_RANGE_QUOTED: if (ch == '"') if (*(ptr + 1) == '"') { ptr++; } else parse_state = MULTIRANGE_IN_RANGE; else if (ch == '\\') parse_state = MULTIRANGE_IN_RANGE_QUOTED_ESCAPED; break; case MULTIRANGE_AFTER_RANGE: if (ch == ',') parse_state = MULTIRANGE_BEFORE_RANGE; else if (ch == '}') parse_state = MULTIRANGE_FINISHED; else ereport(ERROR, (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("malformed multirange literal: \"%s\"", input_str), errdetail("Expected comma or end of multirange."))); break; case MULTIRANGE_IN_RANGE_QUOTED_ESCAPED: parse_state = MULTIRANGE_IN_RANGE_QUOTED; break; default: elog(ERROR, "unknown parse state: %d", parse_state); } } while (*ptr != '\0' && isspace((unsigned char) *ptr)) ptr++; if (*ptr != '\0') ereport(ERROR, (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("malformed multirange literal: \"%s\"", input_str), errdetail("Junk after closing right brace."))); ret = make_multirange(mltrngtypoid, rangetyp, range_count, ranges); PG_RETURN_MULTIRANGE_P(ret); }
1. Field of the Invention The present invention relates to a method for transferring charge and a charge transfer device, and more specifically to a multiline reading CCD (charge coupled device) register for reading signals from pixels (picture elements) arranged at fine pitches (intervals). In addition, the present invention relates to a solid-state image sensing device including the same charge transfer device. 2. Description of the Prior Art The charge transfer device such as the CCD register is now widely used as signal charge transfer sections for the solid-state image sensing device. In particular, the multiline reading CCD register has become important more and more, because of its adaptability to a high resolution image sensor of fine pitch. A conventional structure of a charge transfer device will be described hereinbelow by taking the case of a CCD linear image sensor using the multiline reading CCD register. FIG. 1 is a plan view showing an example of the conventional CCD linear image sensor formed on a semiconductor substrate. In the drawing, there is shown a two-line reading CCD register, by which signal charges generated by pixels 1 arranged in a row (i.e. a photoelectric conversion section) are read by two CCD registers 3 and 5. A shift gate 2 is disposed so as to correspond to all the pixels, and transfer gates 4 are arranged alternately along a row of the pixels 1 so as to correspond to every other pixel. When predetermined driving pulses are applied to respective transfer electrodes of the respective sections, signal charges are transferred from the pixels 1 of odd numbers to the outer CCD register 5 and from the pixels 1 of even numbers to the inner CCD register 3, as shown by dashed arrows in FIG. 1. The transferred charges are outputted to the outside through output buffers 6 and 7, respectively. In the structure as described above, since twice the number of signal charges can be transferred by the use of the two CCD registers of the same pitch, it is possible to arrange the pixels at double the pitch. In other words, in the linear image sensor using the multiline reading CCD register, it is possible to increase the pixel density in an arrangement. FIGS. 2 and 3 are cross-sectional views showing the CCD linear image sensor, taken along the lines A--A' and B--B' both shown in FIG. 1. In FIGS. 2 and 3, a potential distribution diagram is also shown, respectively. Further, FIG. 4 is an enlarged view showing the essential portions of the solid-state image sensing device of the CCD linear image sensor. Further, FIG. 5 is a drive timing chart between the transfer times t1 and t5, during which a predetermined signal charge is transferred in the CCD linear image sensor. The shift gate 2 and the transfer gate 4 are connected to exclusive drive pulse wires SH and TG, respectively, and drive pulse wires .PHI.1 and .PHI.2 are connected to the transfer electrodes of the CCD registers 3 and 5 alternately. For example, as shown in FIG. 4, the drive pulse wire .PHI.1 is connected to the transfer electrodes at the cross section taken along the line A--A' shown in FIG. 1, and the drive pulse wire .PHI.2 is connected to the transfer electrodes at the cross section taken along the line B--B' shown in FIG. 1. First, at the time t1, the signal charges are stored in the pixels 1. At the succeeding time t2, a pulse voltage is applied to the shift gate 2 to open the gate, so that the signal charges are transferred from the pixels 1 to the shift gate 2. Thereafter, at the time t3, the transferred signal charges are shifted to the CCD registers 31 and 32, respectively. Further, at the time t4, only the signal charge in the CCD register 31 is shifted to the transfer gate 4, and further to the CCD register 51 at the time t5. After that, the signal charges are transferred within the CCD by two-phase pulses and then outputted to the outside. The problem involved in the conventional multiline reading CCD register is that the signal charges remain without being transferred during the transfer operation between the registers. In case the signal charges remain without being transferred, vertical strips appear on the display plane, so that the picture quality is deteriorated markedly. In addition, in case only one bit remains in one line, the IC is defective, thus resulting in the cause of a drop in IC production yield. The reason why the charges remain is that the channel width is narrowed at the output side of the first register so that the barrier is produced due to the narrow channel effect or the charges remain in the channel due to contamination. Although these problems have been solved to some extent by improving the pattern design and the manufacturing process of the charge transfer device, it is extremely difficult to perfectly eliminate the remaining charges in the line. In addition, since the quantity of charges to be processed decreases with increasing sensitivity of the image sensing device and also the number of signals increases with increasing number of pixels, there exists a problem in that the probability of occurrence of the remaining charges increases.
Cell culture of rabbit meniscal fibrochondrocytes: Proliferative and synthetic response to growth factors and ascorbate This study was undertaken to determine whether the cells of the fibrocartilaginous meniscal substance are capable of proliferation and matrix synthesis. Cells were isolated from the fibrocartilaginous menisci of young New Zealand white rabbits, and grown in two alternative culture regimens differing only in the basal nutrient medium used to initiate primary monolayer growth. Under each culture regimen, the cells attached and proliferated both initially and after passage into secondary (2°) culture. Differences were noted in cell morphology and time to reach confluence in primary (1°) culture. Upon passage into 2° culture, the fibrochondrocytes assumed two distinct morphological changes were accompanied by differences in the population doubling time and incorporation of 35SO4 into sulfated proteoglycans. The proliferation of both fibrochondrocyte subtypes was stimulated by the addition of either pituitary fibroblast growth factor (FGF) or human platelet lysate in a dosedependent manner. Both FGF (10 ng/ml) and ascorbate (40 g/ml) decreased 35sulfate incorporation, whereas only ascorbate was found to alter the amount of sulfated glycosaminogly can in the pericellular coat. We conclude that the fibrochondrocytes of the meniscal substance are capable of replication and synthesis of matrix macromolecules if given the proper stimuli. Additionally, there may be two subpopulations of fibrochondrocytes that can be distinguished by their in vitro behavior.
The comedian’s take on the late president might seem tame by today’s standards, but it seized on the little details to deliver incisive satire. “The way to do the president is to start out with Mister Rogers,” Dana Carvey told White House staffers in 1992, making a surprise appearance at their Christmas party as George H. W. Bush prepared to leave office. “Then you add a little John Wayne … you put ’em together, you’ve got George Herbert Walker Bush.” It was the beginning of a friendship between the comedian and Bush, whom Carvey impersonated on Saturday Night Live for his entire tenure on the show (1986 to 1993). Bush, who died last Friday and was honored on SNL the next night, was hardly the most dynamic president, or the most gaffe-prone. Yet Carvey’s impression was arguably the show’s most acclaimed, finding cutting satire in Bush’s patrician manner. When Carvey joined SNL, the show was emerging from a creative period that had been light on politics in the absence of producer Lorne Michaels, who left the program from 1980 to 1985. After Michaels’s return, the show’s topical commentary grew more pointed, first with Phil Hartman’s brilliant work as Ronald Reagan, and then, as the country geared up for the 1988 election, with Carvey as Bush. Carvey had made an immediate impression on viewers with his Church Lady character, a stern and pious woman who sat behind a desk and lectured her audience and guests on morality. It was an apt audition for the presidency. At the time, Bush was well known to the public, but he lacked the things SNL actors might seize on for an impression, such as a twangy accent, a propensity for malapropisms, or a reputation for scandal. Bush wasn’t a strong personality. In SNL’s early days, Chevy Chase handled a similar issue with Gerald Ford by exaggerating that president’s reputation as a klutz (largely based on an incident in which Ford fell down the stairs of Air Force One) and by turning every sketch into a slapstick routine. Carvey’s approach with Bush was more focused, and ultimately more devastating. The impression remains my favorite of SNL’s presidents because of how Carvey’s work relied not just on easy catchphrases, but also on the darkly funny scripts he was reading, which epitomized the bland malevolence of American politics in the 1980s and early ’90s. In a 1991 sketch, Carvey’s Bush gave a holiday-season address and tried to assure the American people, through his signature emphatic hand gestures, not to worry about the sluggish economy. “I’m not afraid to say ‘recession.’ Recession! Recession! Heck, I’ll say it all day,” he said. “We’re not in a recession. We’re not even in a downturn here; we’re more in sort of a hovering action, there,” he added, swirling his hands around the desk. Compared with the high-concept, star-laden political sketches of SNL today, it seems tame. Bush himself appreciated the satire while understanding the extent to which it defined him in the public eye—“I don’t dare move my hands,” he joked in 1992 when appearing with Carvey at the White House. The elder Bush was certainly the last president to form a personal connection with his SNL impersonator (Ford and Chase previously also forged a friendship). “The fact that we can laugh at each other is a very fundamental thing,” Bush told his staff at that Christmas party. His good-sport attitude epitomized the gentler image of Bush post-presidency as a leader who was praised for his civility and friendliness, downplaying the less savory aspects of his leadership (such as the drug-trafficking photo op that Carvey so perfectly mocked).
<filename>Account.java<gh_stars>0 import java.lang.*; public class Account { private String accountNumber; private double balance; public Account() { System.out.println("Empty-Account"); } public Account(String accountNumber, double balance) { System.out.println("Para- Account"); this.accountNumber = accountNumber; this.balance= balance; } public void setAccountNumber(String accountNumber) { this.accountNumber=accountNumber; } public void setBalance(double balance) { this.balance=balance; } public String getAccountNumber( ) { return this.accountNumber; } public double getBalance( ) { return this.balance; } public void depositMoney(double amount) { if(amount>0) { balance = balance + amount; System.out.println("Amount Deposited"); } else { System.out.println("Can Not Deposit"); } } public void withdrawMoney(double amount) { if(amount>500 && amount<=balance) { balance = balance - amount; System.out.println("Amount Withdrawn"); } else { System.out.println("Can Not Withdrawn"); } } public void showDetails() { System.out.println("Account Number: "+accountNumber); System.out.println("Account Balance: "+balance); } }
/** * 全局注入svg图片 */ const context = (require as any).context('./svg', false, /\.svg$/) context.keys().map(context)
// Diff consumes the entire reader streams into memory before generating a diff // which then gets filled into the buffer. This implementation stores and // manipulates all three values in memory. func (diff *differ) Diff(out io.Writer, a io.ReadSeeker, b io.ReadSeeker) error { var src, dst []byte var err error if src, err = ioutil.ReadAll(a); err != nil { return err } if dst, err = ioutil.ReadAll(b); err != nil { return err } d := difflib.UnifiedDiff{ A: difflib.SplitLines(string(src)), B: difflib.SplitLines(string(dst)), Context: 3, } return difflib.WriteUnifiedDiff(out, d) }
<gh_stars>1-10 // A simple PTX driver for the nRF24L01+ // with fixed payload length #ifndef NRF24L01P_PTX_H #define NRF24L01P_PTX_H #include "nRF24L01P.h" class nRF24L01P_PTX { public: nRF24L01P_PTX(nRF24L01P &Device_, PinName CE_, PinName Int_); nRF24L01P_PTX(nRF24L01P &Device_, PinName CE_); // Initialize the device for transmitting. There must be a delay of // at least 100ms from initial power on before this function is called. void initialize(); // Set the channel number, 0 .. 125 void set_channel(int Channel); // sets the data rate in Kbps, valid values are 250 (nRF24L01+ only), 1000, 2000 void set_data_rate(int Rate); // Set the transmitter power in dB. Valid values are -18, -12, -6, 0 void SetTransmitPower(int Power); // Set the 40-bit destination address void SetDestinationAddress(uint64_t Address); // Power up ready to transmit. There is a delay of Tpd2stby_us // after PowerUp() before a packet can be transmitted. This // is handled automatically with a timer, so that TransmitPacket() // will block until the device is ready. void power_up(); // Powers down the device. PowerUp must be called before a packet can be transmitted. void PowerDown(); // Returns true if the device is ready to transmit a packet, ie // powered on and not busy bool IsReadyTransmit(); // Does the actual transmit of a packet, in blocking mode. // Returns 0 on success. // Returns -1 if the packet wasn't successfully acknowledged. int TransmitPacket(char *Buf, int Size); int TransmitPacket(uint8_t *Buf, int Size); // Transmits a packet in non-blocking mode. // returns 0 if the packet was successful, -1 on some error (eg // if the device isn't ready to transmit). int TransmitPacketNonBlocking(char *Buf, int Size); // For nonblocking mode, returns false if there is still a pending // packet waiting to send. Returns true if the packet has been // sent or there was some error (eg max retries was hit). bool IsTransmitFinished(); // For nonblocking mode, complete the transmission process. If // IsTransmitFinished() is false, then this call is blocking. // returns 0 if the packet was sent successfully, -1 if it wasn't. int TransmitComplete(); DigitalOut CE; private: void IntHandler(); void ReadyInitialize(); void ReadyStandby(); nRF24L01P &Device; // InterruptIn Int; // Timeout PowerOnTimer; // Timeout InitializeTimer; int volatile Status; }; #endif
def storagegroup_list_ports(cmd_ctx, storagegroup): cmd_ctx.execute_cmd( lambda: cmd_storagegroup_list_ports(cmd_ctx, storagegroup))
// Copyright 2020 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package proxydir provides functions for writing module data to a directory // in proxy format, so that it can be used as a module proxy by setting // GOPROXY="file://<dir>". package proxydir import ( "archive/zip" "fmt" "io" "io/ioutil" "os" "path/filepath" "strings" "golang.org/x/tools/internal/testenv" ) // WriteModuleVersion creates a directory in the proxy dir for a module. func WriteModuleVersion(rootDir, module, ver string, files map[string][]byte) (rerr error) { dir := filepath.Join(rootDir, module, "@v") if err := os.MkdirAll(dir, 0755); err != nil { return err } // The go command checks for versions by looking at the "list" file. Since // we are supporting multiple versions, create this file if it does not exist // or append the version number to the preexisting file. f, err := os.OpenFile(filepath.Join(dir, "list"), os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) if err != nil { return err } defer checkClose("list file", f, &rerr) if _, err := f.WriteString(ver + "\n"); err != nil { return err } // Serve the go.mod file on the <version>.mod url, if it exists. Otherwise, // serve a stub. modContents, ok := files["go.mod"] if !ok { modContents = []byte("module " + module) } if err := ioutil.WriteFile(filepath.Join(dir, ver+".mod"), modContents, 0644); err != nil { return err } // info file, just the bare bones. infoContents := []byte(fmt.Sprintf(`{"Version": "%v", "Time":"2017-12-14T13:08:43Z"}`, ver)) if err := ioutil.WriteFile(filepath.Join(dir, ver+".info"), infoContents, 0644); err != nil { return err } // zip of all the source files. f, err = os.OpenFile(filepath.Join(dir, ver+".zip"), os.O_CREATE|os.O_WRONLY, 0644) if err != nil { return err } defer checkClose("zip file", f, &rerr) z := zip.NewWriter(f) defer checkClose("zip writer", z, &rerr) for name, contents := range files { zf, err := z.Create(module + "@" + ver + "/" + name) if err != nil { return err } if _, err := zf.Write(contents); err != nil { return err } } return nil } func checkClose(name string, closer io.Closer, err *error) { if cerr := closer.Close(); cerr != nil && *err == nil { *err = fmt.Errorf("closing %s: %v", name, cerr) } } // ToURL returns the file uri for a proxy directory. func ToURL(dir string) string { if testenv.Go1Point() >= 13 { // file URLs on Windows must start with file:///. See golang.org/issue/6027. path := filepath.ToSlash(dir) if !strings.HasPrefix(path, "/") { path = "/" + path } return "file://" + path } else { // Prior to go1.13, the Go command on Windows only accepted GOPROXY file URLs // of the form file://C:/path/to/proxy. This was incorrect: when parsed, "C:" // is interpreted as the host. See golang.org/issue/6027. This has been // fixed in go1.13, but we emit the old format for old releases. return "file://" + filepath.ToSlash(dir) } }
<filename>tools/ldgen/test/test_fragments.py #!/usr/bin/env python # # Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # import unittest import sys from pyparsing import ParseException from pyparsing import restOfLine try: import fragments except ImportError: sys.path.append('../') import fragments from sdkconfig import SDKConfig class FragmentTest(unittest.TestCase): def parse(self, text): self.parser.ignore("#" + restOfLine) fragment = self.parser.parseString(text, parseAll=True) return fragment[0] class SectionsTest(FragmentTest): def setUp(self): self.parser = fragments.Sections.get_fragment_grammar() def test_valid_entries(self): valid_entries = """ [sections:test] entries: .section1 .section2 # Section 3 should not exist # section3 .section4 # This is a comment .section5 """ sections = self.parse(valid_entries) self.assertEqual("test", sections.name) entries = sections.entries expected = { ".section1", ".section2", ".section4", ".section5" } self.assertEqual(set(entries), expected) def test_blank_entries(self): blank_entries = """ [sections:test] entries: """ with self.assertRaises(ParseException): self.parse(blank_entries) def test_invalid_names(self): with_spaces = """ [sections:invalid name 1] entries: """ begins_with_number = """ [sections:2invalid_name] entries: """ with_special_character = """ [sections:invalid_name~] entries: """ with self.assertRaises(ParseException): self.parse(with_spaces) with self.assertRaises(ParseException): self.parse(begins_with_number) with self.assertRaises(ParseException): self.parse(with_special_character) def test_non_existent_entries(self): misspelled_entries_field = """ [sections:test] entrie: .section1 """ missing_entries_field = """ [sections:test] """ with self.assertRaises(ParseException): self.parse(misspelled_entries_field) with self.assertRaises(ParseException): self.parse(missing_entries_field) def test_duplicate_entries(self): duplicate_entries = """ [sections:test] entries: .section1 .section3 .section1 .section1 .section2 .section3 .section1 """ sections = self.parse(duplicate_entries) entries = sections.entries expected = { ".section1", ".section2", ".section3", } self.assertEqual(set(entries), expected) class SchemeTest(FragmentTest): def setUp(self): self.parser = fragments.Scheme.get_fragment_grammar() def test_valid_entries(self): valid_entries = """ [scheme:test] entries: sections1 -> target1 sections2 -> target2 """ scheme = self.parse(valid_entries) entries = scheme.entries expected = { ("sections1", "target1"), ("sections2", "target2") } self.assertEqual(entries, expected) def test_duplicate_same_mapping(self): duplicate_entries = """ [scheme:duplicate_same_mapping] entries: sections1 -> target1 sections2 -> target2 sections1 -> target1 """ scheme = self.parse(duplicate_entries) entries = scheme.entries expected = { ("sections1", "target1"), ("sections2", "target2") } self.assertEqual(len(entries), 2) self.assertEqual(entries, expected) def test_invalid_separator(self): wrong_character = """ [scheme:test] entries: sections1, target1 """ single_word = """ [scheme:test] entries: sections1 """ with self.assertRaises(ParseException): self.parse(wrong_character) with self.assertRaises(ParseException): self.parse(single_word) def test_blank_entries(self): blank_entries = """ [scheme:test] entries: """ with self.assertRaises(ParseException): self.parse(blank_entries) def test_non_existent_entries(self): misspelled_entries_field = """ [scheme:test] entrie: section -> target """ missing_entries_field = """ [scheme:test] """ with self.assertRaises(ParseException): self.parse(misspelled_entries_field) with self.assertRaises(ParseException): self.parse(missing_entries_field) class MappingTest(FragmentTest): def setUp(self): self.parser = fragments.Mapping.get_fragment_grammar() def parse_expression(self, expression): parser = SDKConfig.get_expression_grammar() return parser.parseString(expression, parseAll=True) def test_valid_grammar(self): valid_entries = """ [mapping] archive: lib.a entries: obj:symbol (noflash) # Comments should not matter obj (noflash) # Nor should whitespace obj : symbol_2 ( noflash ) obj_2 ( noflash ) * (noflash) """ mapping = self.parse(valid_entries) self.assertEqual("lib.a", mapping.archive) self.assertEqual("lib_a", mapping.name) entries = mapping.entries expected = [("default", { ("obj", "symbol", "noflash"), ("obj", None, "noflash"), ("obj", "symbol_2", "noflash"), ("obj_2", None, "noflash"), ("*", None, "noflash") })] self.assertEqual(entries, expected) def test_invalid_grammar(self): with_fragment_name = """ [mapping:name] archive: lib.a entries: obj:symbol (noflash) """ missing_archive = """ [mapping:name] entries: obj:symbol (noflash) """ misspelled_archive = """ [mapping:name] archi: lib.a entries: obj:symbol (noflash) """ missing_entries = """ [mapping] archive: lib.a """ misspelled_entries = """ [mapping] archive: lib.a entrie: obj:symbol (noflash) """ missing_symbols = """ [mapping] archive: lib.a entries: obj: (noflash) """ missing_scheme_1 = """ [mapping] archive: lib.a entries: obj: () """ missing_scheme_2 = """ [mapping] archive: lib.a entries: obj:symbol """ missing_entity = """ [mapping] archive: lib.a entries: (noflash) """ wilcard_symbol = """ [mapping] archive: lib.a entries: obj:* (noflash) """ empty_object_with_symbol = """ [mapping] archive: lib.a entries: :symbol (noflash) """ wildcard_object_with_symbol = """ [mapping] archive: lib.a entries: *:symbol (noflash) """ empty_definition = """ [mapping] """ with self.assertRaises(ParseException): self.parse(with_fragment_name) with self.assertRaises(ParseException): self.parse(missing_archive) with self.assertRaises(ParseException): self.parse(misspelled_archive) with self.assertRaises(ParseException): self.parse(missing_entries) with self.assertRaises(ParseException): self.parse(misspelled_entries) with self.assertRaises(ParseException): self.parse(missing_symbols) with self.assertRaises(ParseException): self.parse(missing_scheme_1) with self.assertRaises(ParseException): self.parse(missing_scheme_2) with self.assertRaises(ParseException): self.parse(missing_entity) with self.assertRaises(ParseException): self.parse(wilcard_symbol) with self.assertRaises(ParseException): self.parse(empty_object_with_symbol) with self.assertRaises(ParseException): self.parse(wildcard_object_with_symbol) with self.assertRaises(ParseException): self.parse(empty_definition) def test_explicit_blank_default_w_others(self): expl_blnk_w_oth = """ [mapping] archive: lib.a entries: : CONFIG_A = y obj_a (noflash) : default """ mapping = self.parse(expl_blnk_w_oth) entries = mapping.entries expected = [(entries[0][0], { ("obj_a", None, "noflash"), }), ("default", set())] self.assertEqual(entries, expected) def test_implicit_blank_default_w_others(self): impl_blnk_w_oth = """ [mapping] archive: lib.a entries: : CONFIG_A = y obj_a (noflash) """ mapping = self.parse(impl_blnk_w_oth) entries = mapping.entries expected = [(entries[0][0], { ("obj_a", None, "noflash"), }), ("default", set())] self.assertEqual(entries, expected) def test_explicit_blank_default(self): expl_blnk_def = """ [mapping] archive: lib.a entries: : default """ mapping = self.parse(expl_blnk_def) entries = mapping.entries expected = [("default", set())] self.assertEqual(entries, expected) def test_implicit_blank_default(self): impl_blnk_def = """ [mapping] archive: lib.a entries: : default """ mapping = self.parse(impl_blnk_def) entries = mapping.entries expected = [("default", set())] self.assertEqual(entries, expected) def test_multiple_entries(self): multiple_entries = """ [mapping] archive: lib.a entries: : CONFIG_A = y obj_a1 (noflash) obj_a2 (noflash) : CONFIG_B = y obj_b1 (noflash) obj_b2 (noflash) obj_b3 (noflash) : CONFIG_C = y obj_c1 (noflash) """ mapping = self.parse(multiple_entries) entries = mapping.entries expected = [(entries[0][0], { ("obj_a1", None, "noflash"), ("obj_a2", None, "noflash"), }), (entries[1][0], { ("obj_b1", None, "noflash"), ("obj_b2", None, "noflash"), ("obj_b3", None, "noflash"), }), (entries[2][0], { ("obj_c1", None, "noflash"), }), ("default", set())] self.assertEqual(entries, expected) def test_blank_entries(self): blank_entries = """ [mapping] archive: lib.a entries: : CONFIG_A = y obj_a (noflash) : CONFIG_B = y : CONFIG_C = y obj_c (noflash) : CONFIG_D = y : CONFIG_E = y : default obj (noflash) """ mapping = self.parse(blank_entries) entries = mapping.entries expected = [(entries[0][0], { ("obj_a", None, "noflash") }), (entries[1][0], set()), (entries[2][0], { ("obj_c", None, "noflash") }), (entries[3][0], set()), (entries[4][0], set()), ("default", { ("obj", None, "noflash") })] self.assertEqual(entries, expected) def test_blank_first_condition(self): blank_first_condition = """ [mapping] archive: lib.a entries: obj_a (noflash) : CONFIG_B = y obj_b (noflash) """ with self.assertRaises(ParseException): self.parse(blank_first_condition) def test_nonlast_default(self): nonlast_default_1 = """ [mapping] archive: lib.a entries: : default obj_a (noflash) : CONFIG_A = y obj_A (noflash) """ nonlast_default_2 = """ [mapping] archive: lib.a entries: : CONFIG_A = y obj_A (noflash) : default obj_a (noflash) : CONFIG_B = y obj_B (noflash) """ nonlast_default_3 = """ [mapping] archive: lib.a entries: : CONFIG_A = y obj_A (noflash) : obj_a (noflash) : CONFIG_B = y obj_B (noflash) """ with self.assertRaises(ParseException): self.parse(nonlast_default_1) with self.assertRaises(ParseException): self.parse(nonlast_default_2) with self.assertRaises(ParseException): self.parse(nonlast_default_3) def test_duplicate_default(self): duplicate_default_1 = """ archive: lib.a entries: : CONFIG_A = y obj_A (noflash) : default obj_a (noflash) : CONFIG_B = y obj_B (noflash) : default obj_a (noflash) """ duplicate_default_2 = """ archive: lib.a entries: : CONFIG_A = y obj_A (noflash) : CONFIG_B = y obj_a (noflash) : default obj_B (noflash) : obj_a (noflash) """ with self.assertRaises(ParseException): self.parse(duplicate_default_1) with self.assertRaises(ParseException): self.parse(duplicate_default_2) if __name__ == "__main__": unittest.main()
<reponame>alphafoobar/java-code-kata package nz.io; import static java.util.Collections.emptyList; import static nz.io.DataReader.readData; import static org.assertj.core.api.Assertions.assertThat; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; class DataReaderTest { @Test @DisplayName("Handle unknown file") void testEmptyFile() { assertThat(readData("unknown")).isEqualTo(emptyList()); } }
Q: I have a telephoto lens made to screw on to another lens. Which one should I attach it to? I have a prime lens, a zoom lens and a telephoto lens. My Telephoto lens is made to screw onto another lens. Should I attach it to the prime lens or does it matter? A: The lens you have that goes on the front of another lens is not, technically, a a telephoto lens. That's a specific kind of lens design made to give a narrow field of view. Usually, when we use the term "telephoto lens", we mean any lens with a narrow field of view (a focal length of 100mm or higher, give or take.) What you have is a "secondary" lens, sometimes called a "frontside teleconverter". As a general rule, these are of very low quality and might be worse than just taking your photograph with the basic lens and cropping. See Is it worth buying cheap lens attachments for my camera? for more. All that said, you ask: Should I attach it to the prime lens or does it matter? Well... it's probably meant to attach to the filter threads on your "real" (non-secondary) lenses. If it fits on both, give it a try — there's nothing to lose (except the image quality of your shots). But, lenses have different filter thread diameters, and you'll need to match that of your secondary lens to that of your other lenses. See How do I find the right size of filters for a lens? for how to figure that out.
<reponame>prasannadigital/Beauty-Pass import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; import { CardsComponent } from './cards.component'; import { FormsComponent } from './forms.component'; import { SwitchesComponent } from './switches.component'; import { TablesComponent } from './tables.component'; import { TabsComponent } from './tabs.component'; import { CarouselsComponent } from './carousels.component'; import { CollapsesComponent } from './collapses.component'; import { PaginationsComponent } from './paginations.component'; import {PopoversComponent} from './popovers.component'; import {ProgressComponent} from './progress.component'; import {TooltipsComponent} from './tooltips.component'; const routes: Routes = [ { path: '', data: { title: 'Reports' }, children: [ { path: 'voucher', component: CardsComponent, data: { title: 'Voucher-Reports' } }, { path: 'forms', component: FormsComponent, data: { title: 'Forms' } }, { path: 'logs', component: SwitchesComponent, data: { title: 'Log-Reports' } }, { path: 'tables', component: TablesComponent, data: { title: 'Tables' } }, { path: 'tabs', component: TabsComponent, data: { title: 'Tabs' } }, { path: 'user-activity', component: CarouselsComponent, data: { title: 'User-Activity' } }, { path: 'collapses', component: CollapsesComponent, data: { title: 'Collapses' } }, { path: 'paginations', component: PaginationsComponent, data: { title: 'Pagination' } }, { path: 'popovers', component: PopoversComponent, data: { title: 'Popover' } }, { path: 'perks', component: ProgressComponent, data: { title: 'Perk-Reports' } }, { path: 'tooltips', component: TooltipsComponent, data: { title: 'Tooltips' } } ] } ]; @NgModule({ imports: [RouterModule.forChild(routes)], exports: [RouterModule] }) export class BaseRoutingModule {}
The Role of Wearable Technologies in Supply Chain Collaboration: A Case of Pharmaceutical Industry The technological transformation has led to the introduction of mini computers as wearable computers which facilitate users to use the Internet, different applications, messaging, and for calls all on one platform. The focus of these wearable computers in earlier studies has been on consumers and technical aspects, and their application has not been explored from an organizational perspective. This means that the recent introduction of wearable technology has great potential, which is untapped in the organizational context, especially for supply chain collaboration (SC). In this study, wearable technology is thought to offer huge potential for organizations in SC. Therefore, the purpose of this study is to empirically examine the role of wearable technology i.e. Smartwatch in enhancing collaboration among supply chain members with mediating roles of green training (GT) and emotional intelligence (EI). The population of this study is the pharmaceutical industry in Pakistan. Simple random sampling method has been used to collect data from 150 sample size. Data have been collected through offline and online survey method. Data have been analyzed through partial least squarestructure equation modeling (PLSSEM) technique. The results of this study have empirically tested the established conceptual framework. Continuance intention to use smartwatch has a positive effect on SC. Furthermore, GT and EI have mediating roles between continuance intention to use smartwatch and SC. It is concluded that the continuance intention to use smartwatch will increase SC. GT and EI will strengthen the relationship between continuance intention to use smartwatch and SC. The use of wearable technology will motivate employees to communicate rapidly and to monitor their supply chain activities using web-based and other applications. This study has practical implications in organizations and theoretical contribution to literature.
import { Component, OnInit } from '@angular/core'; import { LoggerService } from '../../core/logger.service'; import { User } from '../../shared/models/user.model'; @Component({ selector: 'app-dashboard', templateUrl: './dashboard.component.html', styleUrls: ['./dashboard.component.scss'] }) export class DashboardComponent implements OnInit { public loggedUser: User; constructor( private loggerService: LoggerService ) { }; ngOnInit(): void { this.loggedUser = JSON.parse(localStorage.getItem('user')); }; logout() { this.loggerService.logout(); }; /* ngOnDestroy(): void { //Called once, before the instance is destroyed. //Add 'implements OnDestroy' to the class. console.log('El user antes de unsuscribe es ', this.loggerService.userValue); this.loggerService.userSubjectValue.next(null); this.loggerService.userSubjectValue.complete(); console.log('El user después de unsuscribe es ', this.loggerService.userValue); } */ }
European Council President Donald Tusk lists US President, terror, radical Islam as threats to EU, says Union must remain. European Council President Donald Tusk called US President Donald Trump an 'existential threat' to Europe Tuesday. Tusk wrote an open letter to the leaders of 27 Council member states, in which he listed the US President as a "threat" to the European Union alongside China, Russia, radical Islam, war, and terrorism. “Particularly the change in Washington puts the European Union in a difficult situation; with the new administration seeming to put into question the last 70 years of American foreign policy,” Tusk said. Many European leaders have condemned President Trump's executive order banning nationals of seven countries from entering to the US.
<reponame>code-master5/Courseworks #pragma once template <class T> class Accum { private: T total; public: Accum(T start): total(start) {}; T operator+=(T const& t){return total = total + t;}; T GetTotal() const {return total;} }; template <> class Accum<Person> { private: int total; public: Accum(int start) : total(start) {}; int operator+=(Person const& t) { return total = total + t.GetNumber(); }; int GetTotal() const { return total; } };
package main import ( "github.com/gobuffalo/plush" "github.com/markbates/inflect" ) var defaultRuleset = inflect.NewDefaultRuleset() // render renders the template using the definition. func render(template string, def definition, params map[string]interface{}) (string, error) { ctx := plush.NewContext() ctx.Set("camelize_down", camelizeDown) ctx.Set("def", def) ctx.Set("params", params) s, err := plush.Render(string(template), ctx) if err != nil { return "", err } return s, nil } // camelizeDown converts a name or other string into a camel case // version with the first letter lowercase. "ModelID" becomes "modelID". func camelizeDown(s string) string { if s == "ID" { return "id" // note: not sure why I need this, there's a lot that deals with // accronyms in the dependency packages but they don't seem to behave // as expected in this case. } return defaultRuleset.CamelizeDownFirst(s) }
def __sort(self, feature, num_blocks, assignment): vec = np.zeros_like(feature) for x in range(0, num_blocks): part = self.__get_block(feature, assignment[x]) for l in range(0, part.shape[0]): vec[x * self.block_size + l] = part[l] return vec
package telemetry import ( "fmt" "io/ioutil" "net/http" "strings" "testing" "time" ) func TestServe(t *testing.T) { c := NewCounter("test_counter", "Testing the counter") telemetry := NewTelemetry() _ = telemetry.Register(c) incTimes := 5 for i := 0; i < incTimes; i++ { c.Inc() } done := make(chan struct{}) go func(d chan struct{}) { go func() { _ = telemetry.Serve() }() <-d telemetry.server.Close() }(done) time.Sleep(5 * time.Second) resp, err := http.Get("http://localhost:8080/metrics") if err != nil { t.Log(err) } if resp.StatusCode != 200 { t.Logf("Wrong status code. Expected: 200, got: %d", resp.StatusCode) t.Fail() } close(done) defer resp.Body.Close() body, err := ioutil.ReadAll(resp.Body) if err != nil { t.Log(err) t.Fail() } expected := fmt.Sprintf("test_counter %d", incTimes) if !strings.Contains(string(body), expected) { t.Log("Response:", string(body)) t.Logf("Response did not contain expected metric: %s", expected) t.Fail() } }
President Donald Trump on Wednesday tempered his threat to pull the United States out of NAFTA after an eleventh-hour phone call with leaders from Canada and Mexico who informed him of the consequences of abandoning a trade deal worth more than $1 trillion. The White House issued a statement late Wednesday night saying Trump “agreed not to terminate NAFTA at this time” after a brief phone conversation with Mexican President Enrique Peña Nieto and Canadian Prime Minister Justin Trudeau. Trump instead said he would renegotiate the trade deal. So just how close did Trump come to pulling the U.S. out of the North America Free Trade Agreement? Here’s a brief timeline of events. 2016 In an interview with CNN’s Chris Cuomo on May 9, 2016, Trump derided NAFTA and blamed former President Bill Clinton for signing the agreement. The agreement was actually signed by his predecessor, George H.W. Bush in 1992 and went into effect in 1994 after Clinton signed the NAFTA bill Congress passed into law. “These trade deals have sucked everything out of our country,” Trump told Cuomo. “NAFTA is the worst deal, one of the worst deals our country's ever made from an economic standpoint. One of the worst deals ever.” On numerous occasions during the presidential race in 2016, Trump described NAFTA as a “total disaster,” “one of the worst deals ever” and a “terrible” one for the U.S. and American workers. A number of times he said he would either “get rid of it” or “terminate it” or “renegotiate” it. The New York Daily News has a comprehensive list of Trump’s remarks on NAFTA, but here are just two out of several tweets Trump sent during the campaign. January In a series of tweets that ended in the cancellation of a meeting between Trump and the Mexican president in January, Trump called NAFTA a “one-sided deal” that benefits Mexico and not the U.S. Monday and Tuesday Because Trump has traditionally complained about NAFTA in terms of trade with Mexico, this week he surprised many when he shifted his attention to Canada. On Monday, Politico reported that the Commerce Department announced it would issue tariffs on more than $5 billion worth of lumber imports from Canada. The next day, Trump complained about Canadian policies that have reportedly blocked American dairy exports at the northern border. Wednesday Trump’s head of his National Trade Council, Peter Navarro, and chief strategist Steve Bannon reportedly drafted an executive order on Wednesday that would have led to the U.S. pulling out of NAFTA, Politico reported. News of the order spooked high-ranking Republicans who then urged the White House to hold off on such an order. Among those who discouraged Trump from signing the order was Sen. John McCain, R-Arizona, who on Wednesday tweeted, “Withdrawing from #NAFTA would be a disaster for #Arizona jobs & economy — @POTUS shouldn’t abandon this vital trade agreement.” Several other Republicans also echoed McCain’s concerns, including Sen. Ben Sasse, R-Nebraska, who in a statement said “Scrapping NAFTA would be a disastrously bad idea.” Wednesday night It all came to a screeching halt late Wednesday evening after Trudeau and Peña Nieto called Trump to talk him out of singing such an order. Canadian reporter Cormac Mac Sweeney on Thursday tweeted that Trudeau said the U.S. president was ready to pull out. At 10:30 p.m. local time in Washington D.C., the White House issued a statement saying the U.S. agreed not to terminate NAFTA, as several journalists reported late in the day. Thursday On Thursday, Trump admitted that he would “terminate NAFTA as of two or three days from now” but was swayed by the calls from Trudeau and Peña Nieto who urged him to “please renegotiate.” “I decided rather than terminating NAFTA, which would be a pretty big, you know, shock to the system, we will renegotiate,” Trump told reporters. “Now, if I’m unable to make a fair deal, if I’m unable to make a fair deal for the United States, meaning a fair deal for our workers and our companies, I will terminate NAFTA. But we’re going to give renegotiation a good, strong shot.” NAFTA lives to see another day, but for how long remains to be seen. Will Trump manage to renegotiate NAFTA to benefit the U.S. as he has promised or is this the beginning of the end for the trade deal? Should the U.S. exit NAFTA anyway? Share your thoughts on this fascinating story. Have some thoughts to share? Join me in a conversation: Shoot me a private email with your thoughts or ideas on a different approach to this story. As always, you can also send us a tweet. Email: luis.gomez@sduniontribune.com
Long-term persistence and spectral blue shifting of quantum dots in vivo. Quantum dots are a powerful fluorophore family with desirable attributes for fluorescence imaging. They have been used in several animal models with direct clinical relevance, including sentinel lymph node mapping, tracing vasculature and lymphatics, and targeting specific lesions for diagnosis and removal. Despite significant interest for use in translational applications, little is known about the persistence and long-term fate of quantum dots in vivo. We have observed fluorescence of quantum dots injected into Balb/c and nude mice for up to two-years post injection using both whole-body and microscopic fluorescence techniques. Two-photon spectral microscopy was used to verify the existence of quantum dots within two-year tissues, but also revealed a range of significantly blue-shifted emission peaks with increased bandwidths. Systemically administered quantum dots persist and retain fluorescence for up to two-years in vivo, but with significantly blue-shifted emission.
<filename>src/domain/home/moreInfo/__tests__/MoreInfoLinkList.test.tsx<gh_stars>0 import toJson from 'enzyme-to-json'; import { shallow } from 'enzyme'; import { moreInfoLinks } from '../constants/MoreInfoConstants'; import MoreInfoLinkList from '../MoreInfoLinkList'; it('renders snapshot correctly', () => { const mainPartnersLogoList = shallow( <MoreInfoLinkList links={moreInfoLinks} /> ); expect(toJson(mainPartnersLogoList)).toMatchSnapshot(); });
Development and application of automatic nasal CPAP calibration procedures for use in the unsupervised home environment. Since January 1991, the Clinical Monitoring Center in Palo Alto, California, has treated patients with obstructive sleep apnea using two automatic nasal continuous positive airway pressure (CPAP) calibration procedures. Most procedures used the HMS-4000 portable physiological monitoring and actuating system manufactured by Vitalog Monitoring, Inc., along with the Respironics, Inc., BIPAP-STD equipment (set in the CPAP mode). More recently, the smaller HMS5000 monitor has been used. The recordings were carried out in the unsupervised home environment. The Vitalog monitors were used to record up to 14 channels of physiological data (including the airflow from the CPAP equipment and the pressure in the CPAP mask) while automatically adjusting the CPAP pressure. The objectives were to obtain statistically significant amounts of physiological data just below, at and just above the optimum pressure settings; to obtain this data in all sleeping positions and sleep states; to obtain such information at the time of the initial treatment with nasal CPAP and then to re-evaluate the patients when they had become habituated to the equipment and their physiology had returned to normal.
import time import json from mock import patch from django.utils import timezone from django.core.urlresolvers import reverse from django.test import override_settings from seahub.test_utils import BaseTestCase from seahub.invitations.models import Invitation from seahub.api2.permissions import CanInviteGuest from seahub.base.accounts import UserPermissions from seahub.invitations import models @patch('seahub.api2.endpoints.admin.invitations.ENABLE_GUEST_INVITATION', True) class InvitationsTest(BaseTestCase): def setUp(self): self.url = reverse('api-v2.1-admin-invitations') @patch.object(CanInviteGuest, 'has_permission') @patch.object(UserPermissions, 'can_invite_guest') def test_can_del_all_expired_invitation(self, mock_has_permission, mock_can_invite_guest): self.login_as(self.admin) mock_has_permission = True mock_can_invite_guest = True invitations_number = len(Invitation.objects.all()) self._add_invitations('<EMAIL>') self._add_invitations('<EMAIL>') new_invitations_number = len(Invitation.objects.all()) self.assertEqual(2, new_invitations_number-invitations_number) time.sleep(2) resp = self.client.delete(self.url+"?type=expired") self.assertEqual(200, resp.status_code) self.assertEqual(invitations_number, len(Invitation.objects.all())) def _add_invitations(self, email): entry = models.Invitation(token=models.gen_token(max_length=32), inviter=self.admin, accepter=email, invite_type=models.GUEST, expire_time=timezone.now()) entry.save() def test_get_invitations(self): self.login_as(self.admin) resp = self.client.get(self.url) self.assertEqual(200, resp.status_code) json_resp = json.loads(resp.content) assert type(json_resp['invitation_list']) is list def test_no_permission(self): self.logout() self.login_as(self.admin_cannot_manage_user) resp = self.client.get(self.url) self.assertEqual(403, resp.status_code) def test_get_invitations_permision_denied(self): self.login_as(self.user) resp = self.client.get(self.url) self.assertEqual(403, resp.status_code) def test_invalid_args(self): self.login_as(self.admin) resp = self.client.delete(self.url+"?type=expired122") self.assertEqual(400, resp.status_code) @patch('seahub.api2.endpoints.admin.invitations.ENABLE_GUEST_INVITATION', True) class InvitationTest(BaseTestCase): def setUp(self): pass def _add_invitations(self, email): token = models.gen_token(max_length=32) entry = models.Invitation(token=token, inviter=self.admin, accepter=email, invite_type=models.GUEST, expire_time=timezone.now()) entry.save() return token def _remove_invitation(self, token): invitation = Invitation.objects.get(token=token) invitation.delete() def test_can_delete(self): self.login_as(self.admin) token = self._add_invitations('<EMAIL>') url = reverse('api-v2.1-admin-invitation', args=[token]) resp = self.client.delete(url) self.assertEqual(200, resp.status_code) def test_delete_share_link_with_invalid_permission(self): self.login_as(self.user) token = self._add_invitations('<EMAIL>') url = reverse('api-v2.1-admin-invitation', args=[token]) resp = self.client.delete(url) self.assertEqual(403, resp.status_code) self._remove_invitation(token)
Small intestinal incarceration through the lateral ligament of the urinary bladder in a horse. Small intestinal incarceration through the lateral ligament of the urinary bladder was diagnosed in a 14-year-old, 569-kg, castrated Quarter Horse. The incarceration was corrected by ventral midline celiotomy. Approximately 70 cm of the middle portion of the jejunum was resected and end-to-end, single-layer anastomosis was performed. After surgery, the horse developed signs of adynamic ileus and lameness in the right forelimb. The horse developed laminitis in all 4 feet within 24 hours of surgery. The horse was euthanatized because of poor prognosis for survival. At necropsy, a 4.5-cm rent was found in the left lateral ligament of the urinary bladder. The cause of the rent in the ligament of this horse was not determined.
from jupyterprobe.jupyterprobe import Probe
<reponame>larrylindsey/neuroglancer /** * @license * Copyright 2018 Google 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. */ /** * @file Support for rendering bounding box annotations. */ import {AnnotationType, AxisAlignedBoundingBox} from 'neuroglancer/annotation'; import {AnnotationRenderContext, AnnotationRenderHelper, registerAnnotationTypeRenderHandler} from 'neuroglancer/annotation/type_handler'; import {BoundingBoxCrossSectionRenderHelper, vertexBasePositions} from 'neuroglancer/sliceview/bounding_box_shader_helper'; import {SliceViewPanelRenderContext} from 'neuroglancer/sliceview/panel'; import {tile2dArray} from 'neuroglancer/util/array'; import {mat4, projectPointToLineSegment, vec3} from 'neuroglancer/util/geom'; import {Buffer, getMemoizedBuffer} from 'neuroglancer/webgl/buffer'; import {CircleShader, VERTICES_PER_CIRCLE} from 'neuroglancer/webgl/circles'; import {GL} from 'neuroglancer/webgl/context'; import {LineShader, VERTICES_PER_LINE} from 'neuroglancer/webgl/lines'; import {dependentShaderGetter, ShaderBuilder, ShaderProgram} from 'neuroglancer/webgl/shader'; const EDGES_PER_BOX = 12; const CORNERS_PER_BOX = 8; const FULL_OBJECT_PICK_OFFSET = 0; const CORNERS_PICK_OFFSET = FULL_OBJECT_PICK_OFFSET + 1; const EDGES_PICK_OFFSET = CORNERS_PICK_OFFSET + CORNERS_PER_BOX; const FACES_PICK_OFFSET = EDGES_PICK_OFFSET + EDGES_PER_BOX; const PICK_IDS_PER_INSTANCE = FACES_PICK_OFFSET + 6; const edgeBoxCornerOffsetData = Float32Array.from([ // a1 0, 0, 0, // b1 0, 0, 1, // c1 EDGES_PICK_OFFSET + 0, // a2 1, 0, 0, // b2 1, 0, 1, // c2 EDGES_PICK_OFFSET + 1, // a3 0, 1, 0, // b3 0, 1, 1, // c3 EDGES_PICK_OFFSET + 2, // a4 1, 1, 0, // b4 1, 1, 1, // c4 EDGES_PICK_OFFSET + 3, // a5 0, 0, 0, // b5 0, 1, 0, // c5 EDGES_PICK_OFFSET + 4, // a6 0, 0, 1, // b6 0, 1, 1, // c6 EDGES_PICK_OFFSET + 5, // a7 1, 0, 0, // b7 1, 1, 0, // c7 EDGES_PICK_OFFSET + 6, // a8 1, 0, 1, // b8 1, 1, 1, // c8 EDGES_PICK_OFFSET + 7, // a9 0, 0, 0, // b9 1, 0, 0, // c9 EDGES_PICK_OFFSET + 8, // a10 0, 0, 1, // b10 1, 0, 1, // c10 EDGES_PICK_OFFSET + 9, // a11 0, 1, 0, // b11 1, 1, 0, // c11 EDGES_PICK_OFFSET + 10, // a12 0, 1, 1, // b12 1, 1, 1, // c12 EDGES_PICK_OFFSET + 11 ]); abstract class RenderHelper extends AnnotationRenderHelper { defineShader(builder: ShaderBuilder) { super.defineShader(builder); // Position of point in camera coordinates. builder.addAttribute('highp vec3', 'aLower'); builder.addAttribute('highp vec3', 'aUpper'); } enable(shader: ShaderProgram, context: AnnotationRenderContext, callback: () => void) { super.enable(shader, context, () => { const {gl} = shader; const aLower = shader.attribute('aLower'); const aUpper = shader.attribute('aUpper'); context.buffer.bindToVertexAttrib( aLower, /*components=*/3, /*attributeType=*/WebGL2RenderingContext.FLOAT, /*normalized=*/false, /*stride=*/4 * 6, /*offset=*/context.bufferOffset); context.buffer.bindToVertexAttrib( aUpper, /*components=*/3, /*attributeType=*/WebGL2RenderingContext.FLOAT, /*normalized=*/false, /*stride=*/4 * 6, /*offset=*/context.bufferOffset + 4 * 3); gl.vertexAttribDivisor(aLower, 1); gl.vertexAttribDivisor(aUpper, 1); callback(); gl.vertexAttribDivisor(aLower, 0); gl.vertexAttribDivisor(aUpper, 0); gl.disableVertexAttribArray(aLower); gl.disableVertexAttribArray(aUpper); }); } } class PerspectiveViewRenderHelper extends RenderHelper { private lineShader = this.registerDisposer(new LineShader(this.gl, EDGES_PER_BOX)); private edgeBoxCornerOffsetsBuffer = this.registerDisposer(Buffer.fromData( this.gl, tile2dArray( edgeBoxCornerOffsetData, /*majorDimension=*/7, /*minorTiles=*/1, /*majorTiles=*/VERTICES_PER_LINE))); private edgeShaderGetter = dependentShaderGetter(this, this.gl, (builder: ShaderBuilder) => { this.defineShader(builder); this.lineShader.defineShader(builder); // XYZ corners of box ranging from [0, 0, 0] to [1, 1, 1]. builder.addAttribute('highp vec3', 'aBoxCornerOffset1'); // Last component of aBoxCornerOffset2 is the edge index. builder.addAttribute('highp vec4', 'aBoxCornerOffset2'); builder.setVertexMain(` vec3 vertexPosition1 = mix(aLower, aUpper, aBoxCornerOffset1); vec3 vertexPosition2 = mix(aLower, aUpper, aBoxCornerOffset2.xyz); emitLine(uProjection, vertexPosition1, vertexPosition2); ${this.setPartIndex(builder, 'uint(aBoxCornerOffset2.w)')}; `); builder.setFragmentMain(` emitAnnotation(vec4(vColor.rgb, getLineAlpha())); `); }); private circleShader = this.registerDisposer(new CircleShader(this.gl, CORNERS_PER_BOX)); private boxCornerOffsetsBuffer = this.registerDisposer(Buffer.fromData( this.gl, tile2dArray( vertexBasePositions, /*majorDimension=*/3, /*minorTiles=*/1, /*majorTiles=*/VERTICES_PER_CIRCLE))); private cornerShaderGetter = dependentShaderGetter(this, this.gl, (builder: ShaderBuilder) => { this.defineShader(builder); this.circleShader.defineShader(builder, this.targetIsSliceView); // XYZ corners of box ranging from [0, 0, 0] to [1, 1, 1]. builder.addAttribute('highp vec3', 'aBoxCornerOffset'); builder.setVertexMain(` vec3 vertexPosition = mix(aLower, aUpper, aBoxCornerOffset); emitCircle(uProjection * vec4(vertexPosition, 1.0)); uint cornerIndex = uint(aBoxCornerOffset.x + aBoxCornerOffset.y * 2.0 + aBoxCornerOffset.z * 4.0); uint cornerPickOffset = ${CORNERS_PICK_OFFSET}u + cornerIndex; ${this.setPartIndex(builder, 'cornerPickOffset')}; `); builder.setFragmentMain(` vec4 borderColor = vec4(0.0, 0.0, 0.0, 1.0); emitAnnotation(getCircleColor(vColor, borderColor)); `); }); drawEdges(context: AnnotationRenderContext) { const shader = this.edgeShaderGetter(context.renderContext.emitter); const {gl} = this; this.enable(shader, context, () => { const aBoxCornerOffset1 = shader.attribute('aBoxCornerOffset1'); const aBoxCornerOffset2 = shader.attribute('aBoxCornerOffset2'); this.edgeBoxCornerOffsetsBuffer.bindToVertexAttrib( aBoxCornerOffset1, /*components=*/3, /*attributeType=*/WebGL2RenderingContext.FLOAT, /*normalized=*/false, /*stride=*/4 * 7, /*offset=*/0); this.edgeBoxCornerOffsetsBuffer.bindToVertexAttrib( aBoxCornerOffset2, /*components=*/4, /*attributeType=*/WebGL2RenderingContext.FLOAT, /*normalized=*/false, /*stride=*/4 * 7, /*offset=*/4 * 3); const lineWidth = context.renderContext.emitColor ? 1 : 5; this.lineShader.draw(shader, context.renderContext, lineWidth, 1, context.count); gl.disableVertexAttribArray(aBoxCornerOffset1); gl.disableVertexAttribArray(aBoxCornerOffset2); }); } drawCorners(context: AnnotationRenderContext) { const shader = this.cornerShaderGetter(context.renderContext.emitter); const {gl} = this; this.enable(shader, context, () => { const aBoxCornerOffset = shader.attribute('aBoxCornerOffset'); this.boxCornerOffsetsBuffer.bindToVertexAttrib( aBoxCornerOffset, /*components=*/3, /*attributeType=*/WebGL2RenderingContext.FLOAT, /*normalized=*/false); this.circleShader.draw( shader, context.renderContext, {interiorRadiusInPixels: 1, borderWidthInPixels: 0, featherWidthInPixels: 1}, context.count); gl.disableVertexAttribArray(aBoxCornerOffset); }); } draw(context: AnnotationRenderContext) { this.drawEdges(context); this.drawCorners(context); } } function getBaseIntersectionVertexIndexArray() { return new Float32Array([0, 1, 2, 3, 4, 5]); } function getIntersectionVertexIndexArray() { return tile2dArray( getBaseIntersectionVertexIndexArray(), /*majorDimension=*/1, /*minorTiles=*/1, /*majorTiles=*/VERTICES_PER_LINE); } class SliceViewRenderHelper extends RenderHelper { private lineShader = new LineShader(this.gl, 6); private intersectionVertexIndexBuffer = getMemoizedBuffer( this.gl, WebGL2RenderingContext.ARRAY_BUFFER, getIntersectionVertexIndexArray) .value; private filledIntersectionVertexIndexBuffer = getMemoizedBuffer( this.gl, WebGL2RenderingContext.ARRAY_BUFFER, getBaseIntersectionVertexIndexArray) .value; private boundingBoxCrossSectionHelper = this.registerDisposer(new BoundingBoxCrossSectionRenderHelper(this.gl)); constructor(public gl: GL) { super(gl); } private faceShaderGetter = dependentShaderGetter(this, this.gl, (builder: ShaderBuilder) => { super.defineShader(builder); this.boundingBoxCrossSectionHelper.defineShader(builder); this.lineShader.defineShader(builder); builder.addAttribute('highp float', 'aVertexIndexFloat'); builder.setVertexMain(` int vertexIndex1 = int(aVertexIndexFloat); int vertexIndex2 = vertexIndex1 == 5 ? 0 : vertexIndex1 + 1; vec3 vertexPosition1 = getBoundingBoxPlaneIntersectionVertexPosition(aUpper - aLower, aLower, aLower, aUpper, vertexIndex1); vec3 vertexPosition2 = getBoundingBoxPlaneIntersectionVertexPosition(aUpper - aLower, aLower, aLower, aUpper, vertexIndex2); emitLine(uProjection, vertexPosition1, vertexPosition2); ${this.setPartIndex(builder)}; `); builder.setFragmentMain(` emitAnnotation(vec4(vColor.rgb, vColor.a * getLineAlpha())); `); }); private fillShaderGetter = dependentShaderGetter(this, this.gl, (builder: ShaderBuilder) => { super.defineShader(builder); this.boundingBoxCrossSectionHelper.defineShader(builder); builder.addAttribute('highp float', 'aVertexIndexFloat'); builder.addUniform('highp float', 'uFillOpacity'); builder.setVertexMain(` int vertexIndex = int(aVertexIndexFloat); vec3 vertexPosition = getBoundingBoxPlaneIntersectionVertexPosition(aUpper - aLower, aLower, aLower, aUpper, vertexIndex); gl_Position = uProjection * vec4(vertexPosition, 1); ${this.setPartIndex(builder)}; `); builder.setFragmentMain(` emitAnnotation(vec4(vColor.rgb, uFillOpacity)); `); }); draw(context: AnnotationRenderContext&{renderContext: SliceViewPanelRenderContext}) { const fillOpacity = context.annotationLayer.state.fillOpacity.value; const shader = (fillOpacity ? this.fillShaderGetter : this.faceShaderGetter)( context.renderContext.emitter); let {gl} = this; this.enable(shader, context, () => { this.boundingBoxCrossSectionHelper.setViewportPlane( shader, context.renderContext.sliceView.viewportAxes[2], context.renderContext.sliceView.centerDataPosition, context.annotationLayer.state.globalToObject); const aVertexIndexFloat = shader.attribute('aVertexIndexFloat'); (fillOpacity ? this.filledIntersectionVertexIndexBuffer : this.intersectionVertexIndexBuffer) .bindToVertexAttrib( aVertexIndexFloat, /*components=*/1, /*attributeType=*/WebGL2RenderingContext.FLOAT, /*normalized=*/false); if (fillOpacity) { gl.uniform1f(shader.uniform('uFillOpacity'), fillOpacity); gl.drawArraysInstanced(WebGL2RenderingContext.TRIANGLE_FAN, 0, 6, context.count); } else { const lineWidth = context.renderContext.emitColor ? 1 : 5; this.lineShader.draw(shader, context.renderContext, lineWidth, 1.0, context.count); } gl.disableVertexAttribArray(aVertexIndexFloat); }); } } function getEdgeCorners(corners: Float32Array, edgeIndex: number) { const i = edgeIndex * 7; const cA = vec3.create(), cB = vec3.create(); for (let j = 0; j < 3; ++j) { const ma = edgeBoxCornerOffsetData[i + j]; const mb = edgeBoxCornerOffsetData[i + j + 3]; const a = Math.min(corners[j], corners[j + 3]), b = Math.max(corners[j], corners[j + 3]); cA[j] = (1 - ma) * a + ma * b; cB[j] = (1 - mb) * a + mb * b; } return {cornerA: cA, cornerB: cB}; } function snapPositionToEdge( position: vec3, objectToData: mat4, corners: Float32Array, edgeIndex: number) { let edgeCorners = getEdgeCorners(corners, edgeIndex); vec3.transformMat4(edgeCorners.cornerA, edgeCorners.cornerA, objectToData); vec3.transformMat4(edgeCorners.cornerB, edgeCorners.cornerB, objectToData); projectPointToLineSegment(position, edgeCorners.cornerA, edgeCorners.cornerB, position); } function snapPositionToCorner( position: vec3, objectToData: mat4, corners: Float32Array, cornerIndex: number) { const i = cornerIndex * 3; for (let j = 0; j < 3; ++j) { const m = vertexBasePositions[i + j]; const a = Math.min(corners[j], corners[j + 3]), b = Math.max(corners[j], corners[j + 3]); position[j] = (1 - m) * a + m * b; } vec3.transformMat4(position, position, objectToData); } registerAnnotationTypeRenderHandler(AnnotationType.AXIS_ALIGNED_BOUNDING_BOX, { bytes: 6 * 4, serializer: (buffer: ArrayBuffer, offset: number, numAnnotations: number) => { const coordinates = new Float32Array(buffer, offset, numAnnotations * 6); return (annotation: AxisAlignedBoundingBox, index: number) => { const {pointA, pointB} = annotation; const coordinateOffset = index * 6; coordinates[coordinateOffset] = Math.min(pointA[0], pointB[0]); coordinates[coordinateOffset + 1] = Math.min(pointA[1], pointB[1]); coordinates[coordinateOffset + 2] = Math.min(pointA[2], pointB[2]); coordinates[coordinateOffset + 3] = Math.max(pointA[0], pointB[0]); coordinates[coordinateOffset + 4] = Math.max(pointA[1], pointB[1]); coordinates[coordinateOffset + 5] = Math.max(pointA[2], pointB[2]); }; }, sliceViewRenderHelper: SliceViewRenderHelper, perspectiveViewRenderHelper: PerspectiveViewRenderHelper, pickIdsPerInstance: PICK_IDS_PER_INSTANCE, snapPosition: (position, objectToData, data, offset, partIndex) => { const corners = new Float32Array(data, offset, 6); if (partIndex >= CORNERS_PICK_OFFSET && partIndex < EDGES_PICK_OFFSET) { snapPositionToCorner(position, objectToData, corners, partIndex - CORNERS_PICK_OFFSET); } else if (partIndex >= EDGES_PICK_OFFSET && partIndex < FACES_PICK_OFFSET) { snapPositionToEdge(position, objectToData, corners, partIndex - EDGES_PICK_OFFSET); } else { // vec3.transformMat4(position, annotation.point, objectToData); } }, getRepresentativePoint: (objectToData, ann, partIndex) => { let repPoint = vec3.create(); // if the full object is selected pick the first corner as representative if (partIndex === FULL_OBJECT_PICK_OFFSET) { vec3.transformMat4(repPoint, ann.pointA, objectToData); } else if (partIndex >= CORNERS_PICK_OFFSET && partIndex < EDGES_PICK_OFFSET) { // picked a corner // FIXME: figure out how to return corner point vec3.transformMat4(repPoint, ann.pointA, objectToData); } else if (partIndex >= EDGES_PICK_OFFSET && partIndex < FACES_PICK_OFFSET) { // FIXME: can't figure out how to resize based upon edge grabbed vec3.transformMat4(repPoint, ann.pointA, objectToData); // snapPositionToCorner(repPoint, objectToData, corners, 5); } else { // for now faces will move the whole object so pick the first corner vec3.transformMat4(repPoint, ann.pointA, objectToData); } return repPoint; }, updateViaRepresentativePoint: (oldAnnotation: AxisAlignedBoundingBox, position: vec3, dataToObject: mat4, partIndex: number) => { let newPt = vec3.transformMat4(vec3.create(), position, dataToObject); let baseBox = {...oldAnnotation}; // if the full object is selected pick the first corner as representative let delta = vec3.sub(vec3.create(), oldAnnotation.pointB, oldAnnotation.pointA); if (partIndex === FULL_OBJECT_PICK_OFFSET) { baseBox.pointA = newPt; baseBox.pointB = vec3.add(vec3.create(), newPt, delta); } else if (partIndex >= CORNERS_PICK_OFFSET && partIndex < EDGES_PICK_OFFSET) { // picked a corner baseBox.pointA = newPt; baseBox.pointB = vec3.add(vec3.create(), newPt, delta); } else if (partIndex >= EDGES_PICK_OFFSET && partIndex < FACES_PICK_OFFSET) { baseBox.pointA = newPt; baseBox.pointB = vec3.add(vec3.create(), newPt, delta); } else { // for now faces will move the whole object so pick the first corner baseBox.pointA = newPt; baseBox.pointB = vec3.add(vec3.create(), newPt, delta); } return baseBox; } });
Achievable Sum Rate and Outage Capacity of GFDM Systems with MMSE Receivers This paper investigates the achievable sum rate and the outage capacity of generalized frequency division multiplexing systems (GFDMs) with minimum mean-square error (MMSE) receivers over frequency-selective Rayleigh fading channels. To this end, a Gamma-based approximation approach for the probability density function of the signal-to-interference-plus-noise ratio is presented, based on which accurate analytical formulations for the achievable sum rate and outage capacity are proposed. The accuracy of our analysis is corroborated through Monte Carlo simulation assuming different GFDM parameters. Illustrative numerical results are depicted in order to reveal the impact of the key system parameters, such as the number of subcarriers, number of subsymbols, and roll-off factors, on the overall system performance.
Tesla Motors Inc. shares turned higher Monday after Chief Executive Elon Musk tweeted the electric-car maker will unveil a "major new product line" on April 30 at its Hawthorne, Calif., design studio. Musk said the new product isn&apos;t a car, but kept mum on any other details. Last year, a couple of Musk&apos;s tweets set off weeks of speculation surrounding Tesla&apos;s Model S, and the new features turned out to be souped-up versions of the luxury sedan. Tesla shares traded as low as $181.80 on Monday.
Stability of the expression of the maize productivity parameters by AMMI models and GGE-biplot analysis The objective of this study was to estimate genotype by locality, by year, by treatments (GLxYxT) interaction using AMMI model, to identify maize genotypes with stable number of rows of grains performance in different growing seasons. The trials conducted with seven maize lines/genotypes, four treatments, two years and at the two locations. The results showed that the influence of genotype (G), year (Y), locality (L), and GL, GT, GLT, GYT, GYLT interaction on maize number of rows of grains were significant (p<0.01). The genotype share in the total phenotypic variance for the grains number rows of was 53.50%, and the interaction was 21.15%. The results also show that the sums of the squares of the first and second major components (PC1 and PC2) constitute 100% of the sum of the squares of the interaction GL. The first PC1 axis belongs to all 100%, which points to the significance of the genotype in the total variation and significance of the genotype for overall interaction with other observed sources of variability. The highest stability in terms of expression of the grains number of rows had the genotype L-6, followed by the genotypes L-4, L-5 and L-3. The lowest stability was demonstrated by the genotypes L-2 and L-1, which confirmed that these genotypes are not important for further selection in terms of this trait.
The Tragedy of Aim Csaire This chapter examines the forms of classicism that proliferate in the writings of the Martinican poet-politician Aim Csaire (19132008), focusing in particular on his 1963 drama The Tragedy of King Christopher. The classical form of tragedy, mediated through Nietzsche, provides Csaire with a way of reconsidering the reverberations of the Haitian revolution throughout the black Atlantic as a foundational event of black identity. Csaire uses tragedy to dramatize the story of Henri Christophe, the creator of a monarchy in the northern part of Haiti in the early nineteenth century, as a way of instructing his audience on the urgent issue of black political organization in the mid-twentieth century.
The Procoagulant Properties of Hyaluronic Acid-Collagen (I)/Chitosan Complex Film Biomaterial-induced human platelet activation remains one of the most crucial factors to determine the procoagulant properties of the biomaterial. In this experiment, a new type of biomacromolecule complex film (hyaluronic acid-collagen (I)/chitosan, HCC) was prepared using the electrostatic self-assembly method. Then the procoagulant properties of this complex film were characterized. Based on the nano-resolution of atomic force microscopy, the platelet-derived microparticles (PMPs) that present the activation of platelets were clearly visualized on the membrane surface of platelets for the first time, and the measurement indicated that the size of PMPs is around 50110 nm. Furthermore, the results of AFM measurement were confirmed by flow cytometry analysis. The expression of CD62P (P-selectin) dramatically increased after the platelet-rich plasma interacted with the biomaterial solution. From the results, we could draw the conclusion that this biomacromolecule complex film has promising procoagulant properties, and has the potential to be practically used as procoagulant material.
Researchers confirm biodegradability of PCBs Heavily substituted polychlorinated biphenyls (PCBs), which have the reputation of being extraordinarily persistent in the environment, have now for the first time been proven to be biodegradable. Michigan State University researchers have confirmed in their lab the hypothesis of General Electric scientists that anaerobic bacteria are dechlorinating PCBs in Hudson River sediments. But New York State environmental officials, calling the outcome of biodegradation too uncertain, are nearing a decision to purge a 40-mile stretch of the river of PCBs by dredging. The upper Hudson River is contaminated with PCBs, much of them discharged from GE capacitor factories in the 1950s and 1960s. Researchers at GE's R&D Center in Schenectady, N.Y., proposed last year that anaerobic microorganisms in the muddy bottom are dechlorinating and detoxifying the most highly substituted PCBs. Their report was met with skepticism by New York State scientists. Proof that microbes are changing the composition of the PCB mixtures co...
I. Field The following description relates generally to wireless communications, and more particularly to a repeater in a time-division duplex (TDD) environment. II. Background In the not too distant past mobile communication devices in general, and mobile telephones in particular, were luxury items only affordable to those with substantial income. Further, these mobile telephones were significant in size, rendering them inconvenient for extended portability. For example, in contrast to today's mobile telephones (and other mobile communication devices), mobile telephones of the recent past could not be placed into a user's pocket or handbag without causing extreme discomfort. In addition to deficiencies associated with mobile telephones, wireless communications networks that provided services for such telephones were unreliable, covered insufficient geographical areas, were associated with inadequate bandwidth, and were associated with various other deficiencies. In contrast to the above-described mobile telephones, mobile telephones and other devices that utilize wireless networks are now commonplace. Today's mobile telephones are extremely portable and inexpensive. For example, a typical modern mobile telephone can easily be placed in a handbag without a user thereof noticing existence of the telephone. Furthermore, wireless service providers often offer sophisticated mobile telephones at no cost to persons who subscribe to their wireless service. Numerous towers that transmit and/or relay wireless communications have been constructed over the last several years, thus providing wireless coverage to significant portions of the United States (as well as several other countries). Accordingly, millions (if not billions) of individuals own and utilize mobile telephones. The aforementioned technological advancements are not limited solely to mobile telephones, as data other than voice data can be received and transmitted by devices equipped with wireless communication hardware and software. For instance, several major metropolitan areas have implemented or are planning to implement citywide wireless networks, thereby enabling devices with wireless capabilities to access a network (e.g., the Internet) and interact with data resident upon such network. Moreover, data can be exchanged between two or more devices by way of a wireless network. Given continuing advancement in technology, a number of users, devices, and data types exchanged wirelessly can be expected to continue to increase at a rapid rate. Time division duplex (TDD) is one exemplary protocol that is currently utilized in wireless environments to transmit and receive voice communications and other data. Bi-directional communications between a user terminal and a base station occur within TDD systems over a same frequency during disparate time slots (e.g., an RF channel center frequency is substantially similar in a forward and reverse link). More specifically, when the base station is delivering data to the user terminal, the user terminal listens and does not communicate with the base station. Similarly, when the user terminal is delivering data to the base station, the base station listens and does not attempt to deliver data to the user terminal. Thus, in TDD systems, a user terminal and a base station do not simultaneously deliver data to one another over a same frequency. In some wireless protocols, wireless repeaters are employed between mobile communication units (e.g., cellular phones, personal digital assistants, . . . ) and base stations to extend communication range there between. Repeaters receive signals between a base station and a user terminal, amplify the received signals, and re-transmit such signals. Repeaters can be employed to provide communication service to a coverage hole, which was previously not serviced by the base station. Repeaters can also augment coverage area of a sector by shifting the location of a coverage area or altering shape of the coverage area. Accordingly, repeaters are often highly desirably for utilization in wireless communications environments. Various difficulties exist, however, with respect to utilizing repeaters within TDD systems. In particular, continuously amplifying signals in both directions in TDD systems would cause the repeater to oscillate; thus, the repeater would fail to amplify an intended signal and create interference within a wireless system. Without aid of repeaters, however, potential of TDD systems cannot be fully reached.
Q: Time Zone is a Region: what is the Word for 'currently using Daylight Savings' or not? The current Wikipedia entry for 'Time zone' starts with: A time zone is a region that observes a uniform standard time for legal, commercial, and social purposes. Informally though people (and computers) tend to say things like: "My current time zone is British Summer Time". But actually the 'Time zone' is (in the short-term, barring politcal changes etc) actually a fixed region that doesn't change with the change of seasons. Assuming my understanding and reasoning here is good: is there a more accurate word/phrase to replace 'time zone' in the sentence "My current timezone is ..." Windows 7 does this by saying (to the effect of) "My time zone is UTC, and daylight savings are currently in play". What should people say ? A: An article that might interest you: http://www.timeanddate.com/time/united-kingdom-bst.html According to them BST is a time zone. So it would be correct to say "my current time zone is BST" during the summer and "my current time zone is GMT " in the winter. Apparently a time zone does not have to apply all year long to a region to be considered as such.
Graph-based Conservative Surface Reconstruction We propose a new approach for reconstructing a 2-manifold from a point sample in R3. Compared to previous algorithms, our approach is novel in that it throws away geometry information early on in the reconstruction process and mainly operates combinatorially on a graph structure. Furthermore, it is very conservative in creating adjacencies between samples in the vicinity of slivers, still we can prove that the resulting reconstruction faithfully resembles the original 2-manifold. While the theoretical proof requires an extremely high sampling density, our prototype implementation of the approach produces surprisingly good results on typical sample sets.
/// Put an allocation back onto the free list pub unsafe fn push(&mut self, vaddr: *mut u8) { // We're about to push to the free list, adjust the stats GLOBAL_ALLOCATOR.free_list.fetch_add(self.size as u64, Ordering::SeqCst); if self.size <= core::mem::size_of::<usize>() * 2 { // If the free list is too small to contain our stack free list, // then just directly use a linked list // Write the old head into the newly freed `vaddr` let vaddr = vaddr as *mut FreeListNode; (*vaddr).next = self.head; // Update the head self.head = vaddr as usize; } else { // Check if there is room for this allocation in the free stack, // or if we need to create a new stack if self.head == 0 || (*(self.head as *const FreeListNode)).free_slots == 0 { // No free slots, create a new stack out of the freed vaddr let vaddr = &mut *(vaddr as *mut FreeListNode); // Set the number of free slots to the maximum size, as all // entries are free in the stack // This is the size of the allocation, minus the 2 `usize` // header (in entries) vaddr.free_slots = (self.size / core::mem::size_of::<usize>()) - 2; // Update the next to point to the old head vaddr.next = self.head; // Establish this as the new free list head self.head = vaddr as *mut FreeListNode as usize; } else { // There's room in the current stack, just throw us in there let fl = &mut *(self.head as *mut FreeListNode); // Decrement the number of free slots fl.free_slots -= 1; // Store our newly freed virtual address into this slot *fl.free_addrs.as_mut_ptr().offset(fl.free_slots as isize) = vaddr; } } }
1. Field of the Invention The present invention relates generally to the field of logarithmic amplifiers. More particularly, the present invention relates to a high performance, low power logarithmic amplifier cell for use in a multi-stage logarithmic amplifier providing accurate logarithmic intercept and slope response. 2. Discussion of the Related Art Until recently, logarithmic amplifiers were practically unavailable which are useful for both low frequency and high frequency applications, and which are inherently free of sensitivity to temperature variations and production tolerances of the devices comprising the active elements so as to provide high accuracy log-law performance over a wide temperature range and in the presence of large production variations. U.S. Pat. Nos. 4,929,909 and 4,990,803 (hereafter "the '909 patent" and "the '803 patent", respectively), assigned to the same assignee as the present invention and incorporated herein by reference, describe a logarithmic amplifier which does not suffer from the above-noted limitations. FIG. 1 is a block diagram of the logarithmic amplifier disclosed in the '803 patent. The amplifier includes a plurality of amplifier/limiter/detector stages (hereinafter referred to as "gain" stages or "logarithmic amplifier gain stages") 100-1 through 100-n, a gain bias generator 102, a scale bias generator 104, and an offset generator 106, which are common to all gain stages. All of the gain stages working together produce a logarithmic output signal corresponding to the input signal. FIG. 2 is a block diagram for each of the gain stages 100-1 through 100-n. Each gain stage 100-i includes an emitter follower 112-i, having a differential input and balanced output, a full-wave detector 114-i, and a limiting amplifier 116-i. The emitter follower 112-i introduces a slight gain loss of approximately 0.07 dB. The limiting amplifier 116-i can be designed to provide a gain of 10.07 dB, so that the overall stage gain is 10 dB. Although the logarithmic amplifier of the '909 and '803 patents performs well, that demodulating logarithmic amplifier requires relatively complicated gain stages having a relatively large number of active components, both positive and negative power supplies and requires approximately 300 milliwatts of power for a ten stage amplifier.
Theory of mind deficits in euthymic patients with bipolar I disorder. Theoretical background and guidelines for neuroimaging research. In this paper, we review the literature about the theory of mind (ToM) deficits in patients with bipolar disorder. According to several studies, bipolar patients have remarkable ToM deficits not only in manic and depressive periods, but even in remission. However, results on the association with the symptom severity and basic neurocognitive (especially executive) functions are controversial. Taken together, ToM deficits seem to be state dependent trait markers of the bipolar disorder. Some authors suggest that ToM deficits can influence the functional outcome. Therefore, the better understanding of ToM deficits in bipolar disorder is of particular importance. In the second part of the paper we review the methodological issues, and provide a possible guideline for the study of ToM in bipolar disorders. Illness specific considerations of the neuroimaging research, the ToM task used in the experiment, the experimental design, and the data analysis are particularly emphasized.
Benzophenones from Betula alnoides with Antiausterity Activities against the PANC-1 Human Pancreatic Cancer Cell Line. The antiausterity strategy is a promising approach for the discovery of lead compounds with unprecedented anticancer activities by targeting the tolerance of cancer cells to nutrition starvation. These agents are selectively cytotoxic under the tumor microenvironment-mimicking condition of nutrition starvation, without apparent toxicity in the normal nutrient-rich condition. In this study, an ethanol extract of Betula alnoides showed antiausterity activity against PANC-1 human pancreatic cancer cells under nutrient-deprived conditions, with a PC50 value of 13.2 g/mL. Phytochemical investigation of this active extract led to the isolation of eight benzophenones, including six new compounds, named betuphenones A-F, and three known xanthones. The structure elucidation of the new compounds was achieved by HRFABMS, NMR, and ECD spectroscopic analyses. A plausible biogenetic pathway of the new compounds was proposed. Compounds 1-7 displayed antiausterity activity with PC50 values of 4.9-8.4 M. Moreover, compounds 2 and 7 induced alterations in PANC-1 cell morphology under nutrient-deprived conditions and also inhibited PANC-1 colony formation under nutrient-rich conditions.
// NewWithOptions creates a new Keychain with a given store used to // persist generated keys and together with custom options func NewWithOptions(store store.Store, options Options) Keychain { if options.RotationFrequency == 0 { options.RotationFrequency = defaultOptions.RotationFrequency } if options.VerificationPeriod == 0 { options.VerificationPeriod = options.RotationFrequency * 2 } if options.VerificationPeriod < options.RotationFrequency { panic("VerificationPeriod must be at >= RotationFrequency") } if options.KeySize == 0 { options.KeySize = defaultOptions.KeySize } if options.IDAlphabet == "" { options.IDAlphabet = defaultOptions.IDAlphabet } if options.IDLength == 0 { options.IDLength = defaultOptions.IDLength } keychain := &ring{ store: store, options: options, rotatehOnce: &once.ValueError{}, } keychain.initialize() return keychain }
Chemotherapeutic tumour targeting using clostridial spores. The toxicity associated with conventional cancer chemotherapy is primarily due to a lack of specificity for tumour cells. In contrast, intravenously injected clostridial spores exhibit a remarkable specificity for tumours. This is because, following their administration, clostridial spores become exclusively localised to, and germinate in, the hypoxic/necrotic tissue of tumours. This unique property could be exploited to deliver therapeutic agents to tumours. In particular, genetic engineering could be used to endow a suitable clostridial host with the capacity to produce an enzyme within the tumour which can metabolise a systemically introduced, non-toxic prodrug into a toxic metabolite. The feasibility of this strategy (clostridial-directed enzyme prodrug therapy, CDEPT) has been demonstrated by cloning the Escherichia coli B gene encoding nitroreductase (an enzyme which converts the prodrug CB1954 to a highly toxic bifunctional alkylating agent) into a clostridial expression vector and introducing the resultant plasmid into Clostridium beijerinckii (formerly C. acetobutylicum) NCIMB 8052. The gene was efficiently expressed, with recombinant nitroreductase representing 8% of the cell soluble protein. Following the intravenous injection of the recombinant spores into mice, tumour lysates have been shown, by Western blots, to contain the E. coli-derived enzyme.
Q: Why does Orthodoxy hold that the Torah has not changed? King David c. 1040–970 BCE, indeed any of the ancient Jewish kings, if presented with a modern Sefer Torah would not have been able to read it. The masoretic text we now have, written between the 7th and 10th centuries CE (see: wikipedia), uses an entirely different alphabet -- with, using round numbers 1,400 years between them. The accepted answer here (currently approved by 13 people) states "There are various proofs that the Torah we have is essentially identical to the original (with some minor spelling variants)." But there appears to be demonstrable evidence of "change" in the alphabet, which would strongly indicate the probability of (potentially significant) change to the text itself. Why then, does Orthodoxy hold that the Torah has not changed? A: First of all, the dilemma presented by this question is based on an equivocal use of the word "change". The Orthodox position that the Torah we have today is the same as it was given to Moses refers to the content of the Torah. Our Sifrei Torah display a diversity of styles with regard to the script and are not presumed to be visually identical with the original Torah. Secondly, while there is traditional support for the academic position that the current script used was adopted at a later period I do not believe the evidence is so conclusive as to rule out the more "conservative" tradition that our script dates back to Sinai. While it would probably be more appropriate from a dispassionate academic standpoint to adopt the former position, I do not see any reason that a private individual should find it strong enough to overwhelm a viewpoint received through tradition.
The story of Dr Jekyll, Mr Hyde and Fanny, the angry wife who burned the first draft One of the enduring mysteries of English literature was solved last night when it emerged that the first, impassioned draft of Robert Louis Stevenson's Dr Jekyll and Mr Hyde was destroyed by the author's wife. Fanny Stevenson burned it after dismissing it to a friend as "a quire full of utter nonsense". She said - of what became the world's most admired and profound horror story - "He said it was his greatest work. I shall burn it after I show it to you". Stevenson, an invalid almost deranged by tuberculosis and the effects of medicinal cocaine, had to spend the next three days feverishly rewriting and redrafting the 30,000-word story by hand. Within weeks, the new version of his pioneering novel about split personality was in print. Despite Fanny's view, it was an instant bestseller. Sermons were preached on it in thousands of churches, including St Paul's cathedral, London. It was pirated in the US and in translation. It rescued the Stevensons from acute debt. For the first time, the couple had enough money to live comfortably. Some 115 years later, Fanny's deed has been disclosed in a two-page letter on pages torn from a notebook. It was written by her in 1885 to Stevenson's close friend and fellow poet WE Henley. Henley, who was one-legged, was the model for Long John Silver in Treasure Island. He is still known for the lines: "I am the master of my fate,/I am the captain of my soul". 'Distasteful' The letter is expected to fetch some £1,500 at auction at Phillips in London on November 17. Yesterday, Liz Merry head of Phillips's book department, said the writer's wife apparently threw the manuscript on the fire because "she considered Dr Jekyll and the duality of man rather distasteful. "It's my belief that she thought Dr Jekyll, which was partly based on a dream, was not worthy of him. She was also uneasy because he was writing it for a "shilling shocker" series of novels. It is ironic that it turned out to be one of his most successful books." But other sources believe Fanny acted in a spirit of literary criticism rather than artistic vandalism. One biographer says she felt the first draft did not sufficiently bring out the theme of allegory which was to make the story so compelling to psychologists like Sigmund Freud. Despite the Hollywood films which have been based on it, Stevenson's atmospheric novel contains no sex and little violence, though these are strongly implied. But what is clear is that Fanny, with creditors at their door, was in despair about her sick husband's ability to produce publishable work. In an earlier letter, she wrote: "Louis is possessed of a story that he will try to work at. To stop him seems to annoy him to such a degree that I am letting him alone as the better alternative; but I fear it will only be energy wasted - as all his late work has been." The Scots author was recovering at the time from a haemorrhage and from the death of a close friend. He said he he wrote out of hunger and the need to survive "a few years more" to support his family. The germ of Dr Jekyll and Mr Hyde came to him in a cocaine-induced nightmare in their Bournemouth home. His screams aroused Fanny, who indignantly woke him. "Why did you wake me?" he said. "I was dreaming a fine bogey tale." Dawn found him writing frantically to capture and elaborate the dream on paper. He wrote the first draft in three days at an extraordinary rate of 10,000 words a day. Stephen King, the most modern prolific horror author, is content if he can achieve 1,000 words a day. But scholars knew before yesterday that Fanny disliked the first draft. Before her letter was discovered, the Stevenson scholar, Alanna Knight, wrote: "Angrily, Stevenson threw it on the fire. For the next three days the family walked on tiptoe glimpsing him sitting up in bed, surrounded by written and torn-up pages". Together, the first and final drafts took him a total of six days. Fanny wrote afterwards: "That an invalid in my husband's condition performed the manual labour alone seems incredible. He was suffering from continual haemorrhages and hardly allowed to speak, his conversation carried on by means of a slate and pencil." Stevenson himself told a critic dourly: "The wheels of Byles the Butcher [a joking reference to his creditors, taken from George Eliot's novel Middlemarch] drive exceedingly swiftly." Of his story, with its haunted moral that "man is not truly one, but truly two", he wrote to a friend: "I send you herewith a Gothic gnome, interesting I think, and he came out of a deep mine, where he guards the fountain of tears." Gone forever, lost treasures Sir Richard Burton (1821-1890) The Victorian explorer and Orientalist, was known as an expert on every scholarly subject "including pornography" - he translated the Kama Sutra and, from rare Arabic manuscripts, The Perfumed Garden. His more explicit writings were burned by his widow, Isobel, after his death. Philip Larkin (1922-1985) The publicly reticent poet, in one of the greatest losses to 20th century biography, left a will asking his companion, Monica Jones, to burn all of his personal diaries after his death in 1985. However, his indiscreet letters have survived Camille Claudel (1864-1943) The admired sculptor was the mistress of Auguste Rodin for 15 years. Her feelings of injustice at his hands led her frequently to destroy all the work in her studio. Taken by force to an asylum in 1913, where she died Nikolai Gogol (1809-1852) The Russian dramatist and novelist fell victim to the "spiritual sadism" of an extreme Moscow priest, Father Matyev Konstantinovsky. Ten days before Gogol's death in 1852, while mentally unbalanced, he burned the final volume of his masterpiece, Dead Souls, at the priest's order Dante Gabriel Rossetti (1828-1882) The poet and painter was so distressed by the suicide of his wife Elizabeth Siddal from an overdose of laudanum in 1862 that he buried all his manuscripts with her. Later he changed his mind and had her body exhumed to recover them. He justified this volte face by telling a friend, "Art was the only thing for which she felt very seriously"
Predict the Protein-protein Interaction between Virus and Host through Hybrid Deep Neural Network Viral infection has been considered as a threat to human health for many years, where protein-protein interactions (PPIs) between viruses and hosts is involved. Researching the PPI between the virus and the host is conducive to understanding the mechanism of virus infection and the development of new drugs. Currently, most of the existing studies based on sequence only focus on extracting sequence features from original amino acid sequences, whereas the redundancy and noise of the features are neglected.In this paper, we employed Ll-regularized logistic regression to obtain efficacious sequence features related to PPIs without losing accuracy and generalization. A hybrid deep learning framework which combines convolutional neural network together with a long short term memory network to extract more hidden high-level features was designed to extract more latent features. As it is demonstrated in experiments results, the proposed framework is superior to the current advanced framework in both benchmark data and independent testing and is promising for identifying virus-host interactions.
Magnesium Attenuates a Striatal Dopamine Increase Induced by Anoxia in the Neonatal Rat Brain: An in Vivo Microdialysis Study We evaluated the effects of magnesium on extracellular dopamine (DA) and its metabolites in the striatum of 5-d-old rats submitted to 16 min of anoxia using microdialysis and HPLC. Rat pups were divided into three groups and received either 1) intrastriatal perfusion (IS) of MgSO4,2) intraperitoneal injection (IP) of MgSO4, and 3) NaCl and Ringer's solution, respectively in place of MgSO4. After stabilization, Mg2+, saline, and Ringer's solution were administered; then, 114 animals were exposed to 100% nitrogen for 16 min. Anoxia induced a DA surge, an acutely marked increase of DA, in both the control and the IP group. In contrast, the DA surge was significantly suppressed in the IS group(p < 0.01, analysis of variance). During anoxia, the plasma Mg2+ in the IP group, but not in the IS group, maintained a significantly higher level compared with the basal level. On the other hand, Mg2+ in the perfusates in the IS group, but not in the IP group, maintained a significantly high level during anoxia. Alterations induced by anoxia in other metabolites, 3,4-dihydroxyphenylacetic acid, homovanillic acid, norepinephrine, and 5-hydroxyindole-3-acetic acid, did not significantly differ among the three groups. We propose that elevated levels of Mg2+ in the striatum had inhibitory effects on the DA surge during anoxia.
def licenseFromAltName(self, altName: str) -> License | None: for lice in self.licenses: for name in lice.altNames: if altName.lower() == name.lower(): return lice return None
Offshore petroleum drilling and production has become a significant industry worldwide. Many techniques have been developed to achieve what, at first, seemed impossible; the drilling and production of petroleum reserves from beneath the sea floor to a platform on the surface. One significant design which has found great success in offshore petroleum production is the tension leg platform (TLP). In this design, a platform is literally secured to the sea floor through a number of tethers which extend vertically from the sea floor to the platform floating on the surface. The tethers are kept in tension by the buoyancy of the platform. Tidal motion and wave action are compensated for by lateral movement of the platform and tethers. Vertical movements, normally associated with heave, pitch and roll motions of the sea, are eliminated by the combined buoyancy of the platform and tethers. Typically, latching structure is permanently mounted on the sea floor for receiving the tethers with some mechanism to accommodate pivotal movement of the tethers. The platform is then put in place with the tethers latched to the sea floor structure. The platform can remain in place for many years during drilling and production, but it is anticipated that the platform and tethers will eventually be unlatched from the sea floor mounted latching structure for reuse elsewhere, or scrapping. Several designs have been proposed for latching mechanisms to secure tethers to the sea floor receptacle mechanisms. One is disclosed in U.S. Pat. No. 4,498,814 issued Feb. 12, 1985 and assigned to Vickers. The design includes a collet configuration with shoulder blocks which are deployed into contact with a mooring sleeve at the sea floor. A flexible joint permits angular or torsional movement of the tether. However, this design requires hydraulic actuation to unlatch the tether. Hydraulic actuation of necessity requires a pressurized hydraulic line to extend from the connector at the sea floor to the surface where the hydraulic pump and control circuitry is situated. The hydraulic line is typically routed through the hollow interior of the tether. If portions of the tether interior are designed to be dry to increase buoyancy, it requires substantial effort to seal the line at the bottom bulkhead perforation at the lower end of the tether. If inspection tools are run through the tether interior, they can foul and damage the hydraulic line going to the connector. This reliance on hydraulic operation creates a question as to the reliability of releasing the connector over the long service life demanded of this type of system. Any seals employed can easily deteriorate and fail over a span which could be as long as 30 years. As the working components of the connector are internal within the latch body and hidden from exterior view, the analysis or identification of any mechanical or hydraulic problems by visual inspection become virtually impossible. Another design for a TLP connector is disclosed in U.S. Pat. No. 4,439,055, issued Mar. 27, 1984 and assigned on its face to Vetco Offshore, Inc. The design of this patent relies upon a series of latch dogs with attached shoulder blocks. The latch dogs are mounted at the lower end of the tether and are held in the retracted position as the lower end of the tether is stabbed into a cavity in the sea floor mounted structure. Each of the dogs is pivoted to the tether. As the tether is stabbed into the sea floor structure, a running tool releases the dogs to pivot against a receptacle load ring to secure the tether. To release the tether, a release tool is run down the bore of the tether to retract the dogs. The design is incompatible with a tether having a dry interior, since the release tool must move from the surface to the connector within the tether. Again, visual inspection and verification of the latch is difficult. To add further complications to the connector design, the industry requires a secondary unlatch technique to exist, if the primary unlatching technique fails.
<reponame>UDA-EJIE/json-i18n-editor<filename>src/main/java/com/ejie/uda/jsonI18nEditor/TranslationTree.java package com.ejie.uda.jsonI18nEditor; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.util.Enumeration; import java.util.List; import javax.swing.Icon; import javax.swing.ImageIcon; import javax.swing.JTree; import javax.swing.event.TreeExpansionEvent; import javax.swing.event.TreeWillExpandListener; import javax.swing.tree.DefaultTreeCellRenderer; import javax.swing.tree.ExpandVetoException; import javax.swing.tree.TreeModel; import javax.swing.tree.TreePath; import com.ejie.uda.jsonI18nEditor.util.TranslationKeys; import com.google.common.collect.Lists; /** * This class represents a tree view for the translation keys. * * @author Jacob */ public class TranslationTree extends JTree { private final static long serialVersionUID = -2888673305196385241L; private final Editor editor; public TranslationTree(Editor editor) { super(new TranslationTreeModel()); this.editor = editor; setupUI(); } @Override public void setModel(TreeModel model) { super.setModel(model); Object root = model.getRoot(); if (root != null) { setSelectedNode((TranslationTreeNode) root); } } @Override public void setEditable(boolean editable) { this.editable = editable; } public void collapseAll() { for (int i = getRowCount(); i >= 0; i--) { collapseRow(i); } } public void expandAll() { for (int i = 0; i < getRowCount(); i++) { expandRow(i); } } public void expand(List<TranslationTreeNode> nodes) { nodes.forEach(n -> expandPath(new TreePath(n.getPath()))); } public TranslationTreeNode addNodeByKey(String key) { TranslationTreeModel model = (TranslationTreeModel) getModel(); TranslationTreeNode node = model.getNodeByKey(key); if (node == null) { TranslationTreeNode parent = (TranslationTreeNode) model.getClosestParentNodeByKey(key); String newKey = TranslationKeys.childKey(key, parent.getKey()); String restKey = TranslationKeys.create(TranslationKeys.subParts(newKey, 1)); String name = TranslationKeys.firstPart(newKey); List<String> keys = restKey.isEmpty() ? Lists.newArrayList() : Lists.newArrayList(restKey); node = new TranslationTreeNode(name, keys); model.insertNodeInto(node, parent); setSelectedNode((TranslationTreeNode) node.getFirstLeaf()); } else { setSelectedNode(node); } return node; } public void removeNodeByKey(String key) { TranslationTreeModel model = (TranslationTreeModel) getModel(); TranslationTreeNode node = model.getNodeByKey(key); if (node != null) { model.removeNodeFromParent(node); } } public TranslationTreeNode getNodeByKey(String key) { TranslationTreeModel model = (TranslationTreeModel) getModel(); return model.getNodeByKey(key); } public List<TranslationTreeNode> getExpandedNodes() { TranslationTreeNode node = (TranslationTreeNode) getModel().getRoot(); return getExpandedNodes(node); } public List<TranslationTreeNode> getExpandedNodes(TranslationTreeNode node) { List<TranslationTreeNode> expandedNodes = Lists.newLinkedList(); Enumeration<TreePath> expandedChilds = getExpandedDescendants(new TreePath(node.getPath())); if (expandedChilds != null) { while (expandedChilds.hasMoreElements()) { TreePath path = expandedChilds.nextElement(); TranslationTreeNode expandedNode = (TranslationTreeNode) path.getLastPathComponent(); if (!expandedNode.isRoot()) { // do not return the root node expandedNodes.add(expandedNode); } } } return expandedNodes; } public void renameNodeByKey(String key, String newKey) { duplicateNodeByKey(key, newKey, false); } public void duplicateNodeByKey(String key, String newKey) { duplicateNodeByKey(key, newKey, true); } public TranslationTreeNode getSelectedNode() { return (TranslationTreeNode) getLastSelectedPathComponent(); } public void setSelectedNode(TranslationTreeNode node) { TreePath path = new TreePath(node.getPath()); setSelectionPath(path); scrollPathToVisible(path); } public void clear() { setModel(new TranslationTreeModel()); } private void setupUI() { // DefaultTreeCellRenderer renderer = (DefaultTreeCellRenderer) getCellRenderer(); // DefaultTreeCellRenderer renderer = new DefaultTreeCellRenderer(); Icon emptyIcon = getResourceImage("images/warning.png"); DefaultTreeCellRenderer renderer =(DefaultTreeCellRenderer) new ResourceTreeCellRenderer(editor, emptyIcon); renderer.setLeafIcon(null); renderer.setClosedIcon(null); renderer.setOpenIcon(null); setCellRenderer(renderer); addMouseListener(new TranslationTreeMouseListener()); addTreeWillExpandListener(new TranslationTreeExpandListener()); setEditable(false); // Remove F2 keystroke binding getActionMap().getParent().remove("startEditing"); } private void duplicateNodeByKey(String key, String newKey, boolean keepOld) { TranslationTreeModel model = (TranslationTreeModel) getModel(); TranslationTreeNode node = model.getNodeByKey(key); TranslationTreeNode newNode = model.getNodeByKey(newKey); List<TranslationTreeNode> expandedNodes = null; if (keepOld) { node = node.cloneWithChildren(); } else { expandedNodes = getExpandedNodes(node); model.removeNodeFromParent(node); } if (node.isLeaf() && newNode != null) { model.removeNodeFromParent(newNode); newNode = null; } if (newNode != null) { model.insertDescendantsInto(node, newNode); node = newNode; } else { TranslationTreeNode parent = addNodeByKey(TranslationKeys.withoutLastPart(newKey)); node.setName(TranslationKeys.lastPart(newKey)); model.insertNodeInto(node, parent); } if (expandedNodes != null) { expand(expandedNodes); } setSelectedNode(node); } private class TranslationTreeExpandListener implements TreeWillExpandListener { @Override public void treeWillExpand(TreeExpansionEvent event) throws ExpandVetoException {} @Override public void treeWillCollapse(TreeExpansionEvent e) throws ExpandVetoException { // Prevent root key from being collapsed if (e.getPath().getPathCount() == 1) { throw new ExpandVetoException(e); } } } private class TranslationTreeMouseListener extends MouseAdapter { @Override public void mouseReleased(MouseEvent e) { if (e.isPopupTrigger() && isEditable()) { showPopupMenu(e); } } @Override public void mousePressed(MouseEvent e) { if (e.isPopupTrigger() && isEditable()) { showPopupMenu(e); } } private void showPopupMenu(MouseEvent e) { TreePath path = getPathForLocation(e.getX(), e.getY()); if (path == null) { setSelectionPath(null); TranslationTreeMenu menu = new TranslationTreeMenu(editor, TranslationTree.this); menu.show(e.getComponent(), e.getX(), e.getY()); } else { setSelectionPath(path); TranslationTreeNode node = getSelectedNode(); TranslationTreeNodeMenu menu = new TranslationTreeNodeMenu(editor, node); menu.show(e.getComponent(), e.getX(), e.getY()); } } } private Icon getResourceImage(String path) { return new ImageIcon(getClass().getClassLoader().getResource(path)); } }
// // Copyright (c) 2017 Regents of the SIGNET lab, University of Padova. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. Neither the name of the University of Padova (SIGNET lab) nor the // names of its contributors may be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /** * @file uw-mac-DACAP-alter.cpp * @author <NAME> * @version 1.0.0 * * \brief Provides the implementation of DACAP class * */ #include "uw-mac-DACAP-alter.h" #include <mac.h> #include <cmath> #include <iostream> #include <iomanip> #include <rng.h> //#include <ip-clmsg.h> //#include <mll-clmsg.h> #include <stdio.h> #include <stdlib.h> static const double prop_speed = 1500.0; /** * Enumeration that represent the possible state of the protocol */ enum { NOT_SET = -1, NO_ACK_MODE = 1, ACK_MODE, RTS_PKT, CTS_PKT, WRN_PKT, DATA_PKT, ACK_PKT, STATE_IDLE, STATE_WAIT_CTS, STATE_DEFER_DATA, STATE_SEND_DATA, STATE_WAIT_ACK, STATE_BACKOFF, STATE_CTS_RECEIVED, STATE_WAIT_DATA, STATE_DATA_RECEIVED, STATE_SEND_ACK, STATE_SEND_RTS, STATE_SEND_CTS, STATE_WAIT_WRN, STATE_SEND_WRN, STATE_WAIT_XCTS, STATE_WAIT_XDATA, STATE_WAIT_XACK, STATE_WAIT_XWRN, STATE_RECONTEND_WINDOW, REASON_DEFER, REASON_NOACK, REASON_NODATA, REASON_NOCTS, REASON_CTS_RECEIVED, REASON_ACK_RECEIVED, REASON_RTS_RECEIVED, REASON_DATA_RECEIVED, REASON_WRN_RECEIVED, REASON_BACKOFF_END, REASON_DEFER_END, REASON_DATA_SENT, REASON_ACK_SENT, REASON_BACKOFF_PENDING, REASON_RTS_SENT, REASON_CTS_SENT, REASON_INTERFERENCE, REASON_TX_ENDED, REASON_DATA_PENDING, REASON_NOWRN, REASON_WRN_END, REASON_SAME_RTS_RECEIVED, REASON_MAX_TX_TRIES, REASON_XACK_END, REASON_WAIT_RECONTEND_END, REASON_XCTS_END, REASON_XDATA_END, REASON_XRTS_RX, REASON_XCTS_RX, REASON_XDATA_RX, REASON_XACK_RX, REASON_WAIT_XWRN_END }; extern packet_t PT_DACAP; /** * Class that represent the binding of the protocol with tcl */ static class DACAPModuleClass : public TclClass { public: /** * Constructor of the class */ DACAPModuleClass() : TclClass("Module/UW/DACAP") { } TclObject * create(int, const char *const *) { return (new MMacDACAP()); } } class_module_dacap; void DACAPBTimer::expire(Event *e) { if (module->debug_) cout << NOW << " MMacDACAP(" << module->addr << ") backoff expired, current state = " << module->info[module->curr_state] << endl; module->last_reason = REASON_BACKOFF_END; module->exitBackoff(); if (module->curr_state == STATE_BACKOFF) { if (module->debug_) cout << NOW << " MMacDACAP(" << module->addr << ") next state = " << module->info[STATE_IDLE] << endl; module->stateIdle(); } } void DACAPTimer::expire(Event *e) { switch (module->curr_state) { case (STATE_RECONTEND_WINDOW): { if (module->debug_) cout << NOW << " MMacDACAP(" << module->addr << ") timer expire() current state = " << module->info[module->curr_state] << " Recontend Window expired, next state = " << module->info[STATE_IDLE] << endl; module->last_reason = REASON_WAIT_RECONTEND_END; module->stateIdle(); } break; case (STATE_WAIT_CTS): { if (module->debug_) cout << NOW << " MMacDACAP(" << module->addr << ") timer expire() current state = " << module->info[module->curr_state] << " handshake not completed, next state = " << module->info[STATE_BACKOFF] << endl; module->last_reason = REASON_NOCTS; module->stateBackoff(); } break; case (STATE_WAIT_WRN): { if (module->defer_data == false) { if (module->debug_) cout << NOW << " MMacDACAP(" << module->addr << ") timer expire() current state = " << module->info[module->curr_state] << " warning not received, next state = " << module->info[STATE_SEND_DATA] << endl; module->last_reason = REASON_NOWRN; module->stateSendData(); } else { if (module->debug_) cout << NOW << " MMacDACAP(" << module->addr << ") timer expire() current state = " << module->info[module->curr_state] << " warning received, next state = " << module->info[STATE_DEFER_DATA] << endl; module->last_reason = REASON_WRN_RECEIVED; module->stateDeferData(); } } break; case (STATE_DEFER_DATA): { if (module->debug_) cout << NOW << " MMacDACAP(" << module->addr << ") timer expire() current state = " << module->info[module->curr_state] << " defer data complete, next state = " << module->info[STATE_SEND_DATA] << endl; module->last_reason = REASON_DEFER_END; module->stateSendData(); } break; case (STATE_WAIT_ACK): { if (module->debug_) cout << NOW << " MMacDACAP(" << module->addr << ") timer expire() current state = " << module->info[module->curr_state] << " ack not received, next state = " << module->info[STATE_BACKOFF] << endl; module->last_reason = REASON_NOACK; module->stateBackoff(); } break; case (STATE_BACKOFF): { if (module->debug_) cout << NOW << " MMacDACAP(" << module->addr << ") timer expire() current state = " << module->info[module->curr_state] << " backoff expired, next state = " << module->info[STATE_IDLE] << endl; module->last_reason = REASON_BACKOFF_END; module->exitBackoff(); module->stateIdle(); } break; case (STATE_WAIT_DATA): { if (module->debug_) cout << NOW << " MMacDACAP(" << module->addr << ") timer expire() current state = " << module->info[module->curr_state] << " data not received, next state = " << module->info[STATE_IDLE] << endl; module->last_reason = REASON_NODATA; module->stateIdle(); } break; case (STATE_SEND_WRN): { if (module->debug_) cout << NOW << " MMacDACAP(" << module->addr << ") timer expire() current state = " << module->info[module->curr_state] << " send WRN Window ended, next state = " << module->info[STATE_WAIT_DATA] << endl; module->last_reason = REASON_WRN_END; module->stateWaitData(); } break; case (STATE_WAIT_XCTS): { if (module->debug_) cout << NOW << " MMacDACAP(" << module->addr << ") timer expire() current state = " << module->info[module->curr_state] << " , next state = " << module->info[STATE_WAIT_XWRN] << endl; module->last_reason = REASON_XCTS_END; module->stateWaitXWarning(); } break; case (STATE_WAIT_XWRN): { if (module->debug_) cout << NOW << " MMacDACAP(" << module->addr << ") timer expire() current state = " << module->info[module->curr_state] << " , next state = " << module->info[STATE_WAIT_XDATA] << endl; module->last_reason = REASON_WAIT_XWRN_END; module->stateWaitXData(); } break; case (STATE_WAIT_XDATA): { module->last_reason = REASON_XDATA_END; if (module->op_mode == ACK_MODE) { module->stateWaitXAck(); if (module->debug_) cout << NOW << " MMacDACAP(" << module->addr << ") timer expire() current state = " << module->info[module->curr_state] << " , next state = " << module->info[STATE_WAIT_XACK] << endl; } else { module->stateIdle(); if (module->debug_) cout << NOW << " MMacDACAP(" << module->addr << ") timer expire() current state = " << module->info[module->curr_state] << " , next state = " << module->info[STATE_IDLE] << endl; } } break; case (STATE_WAIT_XACK): { if (module->debug_) cout << NOW << " MMacDACAP(" << module->addr << ") timer expire() current state = " << module->info[module->curr_state] << " , next state = " << module->info[STATE_IDLE] << endl; module->last_reason = REASON_XACK_END; module->stateIdle(); } break; default: { cout << NOW << " MMacDACAP(" << module->addr << ") timer expire() logical error, current state = " << module->info[module->curr_state] << endl; exit(1); } break; } } int MMacDACAP::u_pkt_id; // int MMacDACAP::u_data_id; map<int, string> MMacDACAP::info; MMacDACAP::MMacDACAP() : timer(this) , backoff_timer(this) , txsn(1) , u_data_id(0) , backoff_counter(0) , RTS_sent_time(NOT_SET) , session_distance(NOT_SET) , curr_dest_addr(NOT_SET) , sleep_node_1(NOT_SET) , sleep_node_2(NOT_SET) , backoff_duration(NOT_SET) , backoff_start_time(NOT_SET) , backoff_remaining(NOT_SET) , last_reason(NOT_SET) , backoff_first_start(NOT_SET) , curr_data_pkt(0) , TxActive(false) , RxActive(false) , defer_data(false) , session_active(false) , backoff_pending(false) , warning_sent(false) , backoff_freeze_mode(false) , print_transitions(false) , has_buffer_queue(false) , multihop_mode(false) , curr_state(STATE_IDLE) , prev_state(STATE_IDLE) , op_mode(ACK_MODE) , wrn_pkts_tx(0) , wrn_pkts_rx(0) , rts_pkts_tx(0) , rts_pkts_rx(0) , cts_pkts_tx(0) , cts_pkts_rx(0) , sum_defer_time(0) , defer_times_no(0) , last_data_id_tx(NOT_SET) , last_data_id_rx(NOT_SET) , start_tx_time(0) , srtt(0) , sumrtt(0) , sumrtt2(0) , rttsamples(0) { u_pkt_id = 0; bind("t_min", (double *) &t_min); bind("T_W_min", (double *) &T_W_min); bind("delta_D", (double *) &delta_D); bind("delta_data", (double *) &delta_data); bind("max_prop_delay", (double *) &max_prop_delay); bind("CTS_size", (int *) &CTS_size); bind("RTS_size", (int *) &RTS_size); bind("WRN_size", (int *) &WRN_size); bind("HDR_size", (int *) &HDR_size); bind("ACK_size", (int *) &ACK_size); bind("backoff_tuner", (double *) &backoff_tuner); bind("wait_costant", (double *) &wait_costant); bind("debug_", (int *) &debug_); // degug mode bind("max_payload", (int *) &max_payload); bind("max_tx_tries", (double *) &max_tx_tries); bind("buffer_pkts", (int *) &buffer_pkts); bind("alpha_", (double *) &alpha_); bind("max_backoff_counter", (double *) &max_backoff_counter); if (buffer_pkts > 0) has_buffer_queue = true; if (max_tx_tries <= 0) max_tx_tries = HUGE_VAL; if (max_backoff_counter <= 0) max_backoff_counter = HUGE_VAL; if (info.empty()) initInfo(); } MMacDACAP::~MMacDACAP() { } // TCL command interpreter int MMacDACAP::command(int argc, const char *const *argv) { Tcl &tcl = Tcl::instance(); if (argc == 2) { if (strcasecmp(argv[1], "printTransitions") == 0) { print_transitions = true; if (print_transitions) fout.open("/tmp/DACAPstateTransitions.txt", ios_base::app); return TCL_OK; } else if (strcasecmp(argv[1], "setAckMode") == 0) { op_mode = ACK_MODE; return TCL_OK; } else if (strcasecmp(argv[1], "setNoAckMode") == 0) { op_mode = NO_ACK_MODE; return TCL_OK; } else if (strcasecmp(argv[1], "setBackoffFreeze") == 0) { backoff_freeze_mode = true; return TCL_OK; } else if (strcasecmp(argv[1], "setBackoffNoFreeze") == 0) { backoff_freeze_mode = false; return TCL_OK; } else if (strcasecmp(argv[1], "setMultiHopMode") == 0) { multihop_mode = true; return TCL_OK; } else if (strcasecmp(argv[1], "getQueueSize") == 0) { tcl.resultf("%d", getQueueSize()); return TCL_OK; } else if (strcasecmp(argv[1], "getMeanDeferTime") == 0) { tcl.resultf("%f", getMeanDeferTime()); return TCL_OK; } else if (strcasecmp(argv[1], "getTotalDeferTimes") == 0) { tcl.resultf("%d", getTotalDeferTimes()); return TCL_OK; } else if (strcasecmp(argv[1], "getWrnPktsTx") == 0) { tcl.resultf("%d", getWrnPktsTx()); return TCL_OK; } else if (strcasecmp(argv[1], "getWrnPktsRx") == 0) { tcl.resultf("%d", getWrnPktsRx()); return TCL_OK; } else if (strcasecmp(argv[1], "getRtsPktsTx") == 0) { tcl.resultf("%d", getRtsPktsTx()); return TCL_OK; } else if (strcasecmp(argv[1], "getRtsPktsRx") == 0) { tcl.resultf("%d", getRtsPktsRx()); return TCL_OK; } else if (strcasecmp(argv[1], "getCtsPktsTx") == 0) { tcl.resultf("%d", getCtsPktsTx()); return TCL_OK; } else if (strcasecmp(argv[1], "getCtsPktsRx") == 0) { tcl.resultf("%d", getCtsPktsRx()); return TCL_OK; } else if (strcasecmp(argv[1], "getUpLayersDataRx") == 0) { tcl.resultf("%d", getUpLayersDataPktsRx()); return TCL_OK; } } else if (argc == 3) { if (strcasecmp(argv[1], "setMacAddr") == 0) { addr = atoi(argv[2]); if (debug_) cout << "DACAP MAC address of current node is " << addr << endl; return TCL_OK; } } return MMac::command(argc, argv); } int MMacDACAP::crLayCommand(ClMessage *m) { switch (m->type()) { // case whatever: // return 0; // break; default: return Module::crLayCommand(m); } } void MMacDACAP::initInfo() { if (system(NULL)) { system("rm -f /tmp/DACAPstateTransitions.txt"); if (print_transitions) system("touch /tmp/DACAPstateTransitions.txt"); } info[STATE_IDLE] = "Idle State"; info[STATE_WAIT_CTS] = "Wait CTS State"; info[STATE_DEFER_DATA] = "Defer Data State"; info[STATE_SEND_DATA] = "Send Data State"; info[STATE_WAIT_ACK] = "Wait ACK State"; info[STATE_BACKOFF] = "Backoff State"; info[STATE_CTS_RECEIVED] = "CTS Received State"; info[STATE_WAIT_DATA] = "Wait Data State"; info[STATE_DATA_RECEIVED] = "Data Received State"; info[STATE_SEND_ACK] = "Send ACK State"; info[STATE_SEND_RTS] = "Send RTS State"; info[STATE_SEND_CTS] = "Send CTS State"; info[STATE_WAIT_WRN] = "Wait WRN Window State"; info[STATE_SEND_WRN] = "Send WRN Window State"; info[STATE_WAIT_XCTS] = "Wait XCTS State"; info[STATE_WAIT_XDATA] = "Wait XDATA State"; info[STATE_WAIT_XACK] = "Wait XACK State"; info[STATE_WAIT_XWRN] = "Wait XWRN State"; info[STATE_RECONTEND_WINDOW] = "Wait Recontend Window State"; info[RTS_PKT] = "RTS pkt"; info[CTS_PKT] = "CTS pkt"; info[WRN_PKT] = "Warning pkt"; info[DATA_PKT] = "Data pkt"; info[ACK_PKT] = "ACK pkt"; info[REASON_DEFER] = "xCTS, or xRTS received"; info[REASON_NOACK] = "ACK timeout"; info[REASON_NODATA] = "Data timeout"; info[REASON_NOCTS] = "CTS timeout"; info[REASON_CTS_RECEIVED] = "CTS received"; info[REASON_ACK_RECEIVED] = "ACK received"; info[REASON_RTS_RECEIVED] = "RTS received"; info[REASON_DATA_RECEIVED] = "DATA received"; info[REASON_WRN_RECEIVED] = "WRN received"; info[REASON_BACKOFF_END] = "Backoff ended"; info[REASON_DEFER_END] = "Defer time elapsed"; info[REASON_DATA_SENT] = "Data sent"; info[REASON_BACKOFF_PENDING] = "Backoff pending"; info[REASON_ACK_SENT] = "ACK sent"; info[REASON_RTS_SENT] = "RTS sent"; info[REASON_CTS_SENT] = "CTS sent"; info[REASON_INTERFERENCE] = "xRTS or xCTS received"; info[REASON_TX_ENDED] = "Interfering trasmission ended"; info[REASON_DATA_PENDING] = "Data from upper layers pending in queue"; info[REASON_NOWRN] = "Wait WRN Window ended with no WRN"; info[REASON_WRN_END] = "Send WRN window ended"; info[REASON_SAME_RTS_RECEIVED] = "RTS received for the same current DATA pkt"; info[REASON_MAX_TX_TRIES] = "DATA dropped due to max tx rounds"; info[REASON_XCTS_END] = "xCTS wait window ended"; info[REASON_XDATA_END] = "xDATA wait window ended"; info[REASON_XACK_END] = "xACK wait window ended"; info[REASON_XACK_RX] = "xACK received"; info[REASON_XCTS_RX] = "xCTS received"; info[REASON_XDATA_RX] = "xDATA received"; info[REASON_XRTS_RX] = "xRTS received"; info[REASON_WAIT_XWRN_END] = "xWRN wait window ended"; info[REASON_WAIT_RECONTEND_END] = "Recontend window ended"; } double MMacDACAP::computeTxTime(int type) { double duration; Packet *temp_data_pkt; if (type == DATA_PKT) { if (!Q.empty()) { temp_data_pkt = (Q.front())->copy(); hdr_cmn *ch = HDR_CMN(temp_data_pkt); ch->size() = HDR_size + ch->size(); } else { temp_data_pkt = Packet::alloc(); hdr_cmn *ch = HDR_CMN(temp_data_pkt); ch->size() = HDR_size + max_payload; } } else if (type == RTS_PKT) { temp_data_pkt = Packet::alloc(); hdr_cmn *ch = HDR_CMN(temp_data_pkt); ch->size() = RTS_size; } else if (type == CTS_PKT) { temp_data_pkt = Packet::alloc(); hdr_cmn *ch = HDR_CMN(temp_data_pkt); ch->size() = CTS_size; } else if (type == ACK_PKT) { temp_data_pkt = Packet::alloc(); hdr_cmn *ch = HDR_CMN(temp_data_pkt); ch->size() = ACK_size; } else if (type == WRN_PKT) { temp_data_pkt = Packet::alloc(); hdr_cmn *ch = HDR_CMN(temp_data_pkt); ch->size() = WRN_size; } duration = Mac2PhyTxDuration(temp_data_pkt); Packet::free(temp_data_pkt); return (duration); } double MMacDACAP::computeWaitTime(int mode, double distance) { double t_data = computeTxTime(DATA_PKT); if (debug_) { cout << NOW << " MMacDACAP(" << addr << ")::computeWaitTime() tx duration = " << t_data << endl; } double T_w; double t_1 = (t_min - min((delta_D / prop_speed), min(t_data, 2.0 * max_prop_delay - t_min))) / 2.0; double t_2 = (t_min - delta_data) / 2.0; double t_3 = min(t_1, (t_min + T_W_min - (2.0 * delta_D / prop_speed)) / 4.0); if (mode == NO_ACK_MODE) { if ((distance / prop_speed) < t_1) { T_w = t_min - (2.0 * distance / prop_speed); } else { T_w = 2.0 * (distance + delta_D) / prop_speed - t_min; } if (T_w < (2.0 * delta_D / prop_speed)) T_w = 2.0 * delta_D / prop_speed; } else { if (((distance / prop_speed) < t_2) && ((distance / prop_speed) > t_1)) { T_w = (2.0 * (distance + delta_D) / prop_speed) - t_min; } else if ((distance / prop_speed) > max(t_2, t_3)) { T_w = (2.0 * (distance + delta_D) / prop_speed) - T_W_min; } else { T_w = t_min - 2.0 * (distance / prop_speed); } if (T_w < (max((2.0 * delta_D / prop_speed), T_W_min))) T_w = max((2 * delta_D / prop_speed), T_W_min); } return (T_w); } inline void MMacDACAP::exitBackoff() { if (backoff_freeze_mode == true) timer.force_cancel(); backoff_timer.force_cancel(); backoffEndTime(); backoff_pending = false; backoff_start_time = NOT_SET; backoff_duration = NOT_SET; backoff_remaining = NOT_SET; backoff_duration = NOT_SET; backoff_first_start = NOT_SET; } void MMacDACAP::exitSleep() { sleep_node_1 = NOT_SET; sleep_node_2 = NOT_SET; } inline void MMacDACAP::freezeBackoff() { timer.force_cancel(); double elapsed_time = NOW - backoff_start_time; backoff_pending = true; if (backoff_start_time == NOT_SET) { cout << NOW << " MMacDACAP(" << addr << ")::freezeBackoff() error, backoff start time not set " << endl; exit(1); } backoff_remaining = backoff_duration - elapsed_time; if (backoff_remaining < (-0.3)) { cout << NOW << " MMacDACAP(" << addr << ")::freezeBackoff() error, backoff elapsed time = " << elapsed_time << " > backoff duration = " << backoff_duration << " !!" << endl; exit(1); } else { backoff_remaining = abs(backoff_duration - elapsed_time); if (debug_) { cout << NOW << " MMacDACAP(" << addr << ")::freezeBackoff() elapsed time = " << elapsed_time << " < backoff duration = " << backoff_duration << ", remaining backoff = " << backoff_remaining << endl; } } } double MMacDACAP::getRecontendTime() { double random = RNG::defaultrng()->uniform_double(); while (random == 0) { random = RNG::defaultrng()->uniform_double(); } return (random * 2.0 * max_prop_delay + wait_costant); } double MMacDACAP::getBackoffTime() { incrTotalBackoffTimes(); double random = RNG::defaultrng()->uniform_double(); double duration; while (random == 0) { random = RNG::defaultrng()->uniform_double(); } if (backoff_counter > max_backoff_counter) backoff_counter = max_backoff_counter; random = backoff_tuner * random * 2.0 * max_prop_delay * pow(2.0, (double) backoff_counter); if (debug_) { cout << NOW << " MMacDACAP(" << addr << ")::getBackoffTime() backoff time = " << random << " s " << endl; } duration = random; return duration; } void MMacDACAP::recvFromUpperLayers(Packet *p) { if (((has_buffer_queue == true) && (Q.size() < buffer_pkts)) || (has_buffer_queue == false)) { incrUpperDataRx(); waitStartTime(); initPkt(p, DATA_PKT); Q.push(p); if ((curr_state == STATE_IDLE) && (session_active == false) && (RxActive == false)) // se sono libero comincio handshake { last_reason = REASON_DATA_PENDING; stateSendRTS(); } else { } } else { incrDiscardedPktsTx(); drop(p, 1, DACAP_DROP_REASON_BUFFER_FULL); } } void MMacDACAP::initPkt(Packet *p, int type) { hdr_cmn *ch = hdr_cmn::access(p); hdr_dacap *dacaph = HDR_DACAP(p); hdr_mac *mach = HDR_MAC(p); dacaph->sn = txsn; txsn++; dacaph->ts = Scheduler::instance().clock(); dacaph->dacap_type = type; dacaph->tx_tries = 0; int curr_size = ch->size(); if (type != DATA_PKT) { ch->timestamp() = dacaph->ts; ch->ptype() = PT_DACAP; if (curr_data_pkt != 0) dacaph->data_sn = HDR_DACAP(curr_data_pkt)->data_sn; else dacaph->data_sn = u_data_id; } else { dacaph->orig_type = ch->ptype(); ch->ptype() = PT_DACAP; } switch (type) { case (RTS_PKT): { ch->size() = RTS_size; ch->uid() = u_pkt_id++; mach->set(MF_CONTROL, addr, curr_dest_addr); } break; case (CTS_PKT): { ch->size() = CTS_size; ch->uid() = u_pkt_id++; mach->set(MF_CONTROL, addr, curr_dest_addr); } break; case (WRN_PKT): { ch->size() = WRN_size; ch->uid() = u_pkt_id++; mach->set(MF_CONTROL, addr, curr_dest_addr); } break; case (DATA_PKT): { ch->size() = curr_size + HDR_size; dacaph->data_sn = u_data_id++; mach->macSA() = addr; } break; case (ACK_PKT): { ch->size() = CTS_size; ch->uid() = u_pkt_id++; mach->set(MF_CONTROL, addr, curr_dest_addr); } break; } } void MMacDACAP::Phy2MacEndTx(const Packet *p) { TxActive = false; switch (curr_state) { case (STATE_SEND_DATA): { if ((debug_ > 0) && (op_mode == ACK_MODE)) cout << NOW << " MMacDACAP(" << addr << ")::Phy2MacEndTx() DATA sent, from " << info[curr_state] << " to " << info[STATE_WAIT_ACK] << endl; else if ((debug_ > 0) && (op_mode == NO_ACK_MODE)) cout << NOW << " MMacDACAP(" << addr << ")::Phy2MacEndTx() DATA sent, from " << info[curr_state] << " to " << info[STATE_IDLE] << endl; last_reason = REASON_DATA_SENT; if (op_mode == ACK_MODE) stateWaitACK(); else if ((multihop_mode == true) && (Q.size() > 0)) stateRecontendWindow(); else stateIdle(); } break; case (STATE_WAIT_DATA): { } break; case (STATE_SEND_ACK): { if (backoff_pending == true) { if (debug_) cout << NOW << " MMacDACAP(" << addr << ")::Phy2MacEndTx() ack sent and backoff pending, " "from " << info[curr_state] << " to " << info[STATE_BACKOFF] << endl; last_reason = REASON_BACKOFF_PENDING; stateBackoff(); return; } else { if (debug_) cout << NOW << " MMacDACAP(" << addr << ")::Phy2MacEndTx() ack sent, from " << info[curr_state] << " to " << info[STATE_IDLE] << endl; last_reason = REASON_ACK_SENT; stateIdle(); } } break; case (STATE_SEND_RTS): { if (debug_) cout << NOW << " MMacDACAP(" << addr << ")::Phy2MacEndTx() RTS sent, from " << info[curr_state] << " to " << info[STATE_WAIT_CTS] << endl; last_reason = REASON_RTS_SENT; stateWaitCTS(); } break; case (STATE_SEND_CTS): { if (debug_) cout << NOW << " MMacDACAP(" << addr << ")::Phy2MacEndTx() CTS sent, from " << info[curr_state] << " to " << info[STATE_SEND_WRN] << endl; last_reason = REASON_CTS_SENT; stateSendWarning(); } break; case (STATE_SEND_WRN): { } break; default: { cout << NOW << " MMacDACAP(" << addr << ")::Phy2MacEndTx() logical error, current state = " << info[curr_state] << endl; exit(1); } break; } } void MMacDACAP::Phy2MacStartRx(const Packet *p) { RxActive = true; } void MMacDACAP::Phy2MacEndRx(Packet *p) { hdr_cmn *ch = HDR_CMN(p); packet_t rx_pkt_type = ch->ptype(); if (rx_pkt_type != PT_DACAP) { drop(p, 1, DACAP_DROP_REASON_UNKNOWN_TYPE); return; } hdr_dacap *dacaph = HDR_DACAP(p); hdr_mac *mach = HDR_MAC(p); hdr_MPhy *ph = HDR_MPHY(p); int source_mac = mach->macSA(); double tx_time = ph->txtime; double rx_time = ph->rxtime; double diff_time = rx_time - tx_time; double distance = diff_time * prop_speed; if (ch->error()) { drop(p, 1, "ERR"); incrErrorPktsRx(); return; } else { if (debug_) cout << NOW << " MMacDACAP(" << addr << ")::Phy2MacEndRx() " << info[curr_state] << ", received a pkt type = " << info[dacaph->dacap_type] << ", src addr = " << mach->macSA() << " dest addr = " << mach->macDA() << ", estimated distance between nodes = " << distance << " m " << endl; switch (curr_state) { case (STATE_IDLE): { rxStateIdle(p); } break; case (STATE_RECONTEND_WINDOW): { rxStateRecontendWindow(p); } break; case (STATE_WAIT_CTS): { rxStateWaitCTS(p); } break; case (STATE_WAIT_WRN): { rxStateWaitWarning(p); } break; case (STATE_WAIT_ACK): { rxStateWaitACK(p); } break; case (STATE_BACKOFF): { rxStateBackoff(p); } break; case (STATE_WAIT_DATA): { rxStateWaitData(p); } break; case (STATE_SEND_WRN): { rxStateSendWarning(p); } break; case (STATE_WAIT_XCTS): { rxStateWaitXCts(p); } break; case (STATE_WAIT_XWRN): { rxStateWaitXWarning(p); } break; case (STATE_WAIT_XDATA): { rxStateWaitXData(p); } break; case (STATE_WAIT_XACK): { rxStateWaitXAck(p); } break; default: { if (debug_) cout << NOW << " MMacDACAP(" << addr << ")::Phy2MacEndRx() dropping pkt, wrong state" << endl; Packet::free(p); return; } break; } } } void MMacDACAP::setBackoffNodes(double node_a, double node_b) { if ((sleep_node_1 == NOT_SET) && (sleep_node_2 == NOT_SET)) { sleep_node_1 = node_a; sleep_node_2 = node_b; } if (debug_) { cout << NOW << " MMacDACAP(" << addr << ")::setBackoffNodes() mac addr involved = " << sleep_node_1 << " , " << sleep_node_2 << " . next state = " << info[STATE_BACKOFF] << endl; } } void MMacDACAP::txAck() { Packet *ack_pkt = Packet::alloc(); initPkt(ack_pkt, ACK_PKT); incrCtrlPktsTx(); incrAckPktsTx(); Mac2PhyStartTx(ack_pkt); TxActive = true; } void MMacDACAP::txData() { Packet *data_pkt = (Q.front())->copy(); if ((op_mode == NO_ACK_MODE)) queuePop(true); incrDataPktsTx(); Mac2PhyStartTx(data_pkt); TxActive = true; } void MMacDACAP::txRts() { Packet *rts_pkt = Packet::alloc(); // IpClMsgUpdRoute m(curr_data_pkt); // sendSyncClMsg(&m); // MllClMsgUpdMac m2(curr_data_pkt); // sendSyncClMsg(&m2); hdr_mac *mach = HDR_MAC(curr_data_pkt); curr_dest_addr = mach->macDA(); initPkt(rts_pkt, RTS_PKT); incrCtrlPktsTx(); incrRtsPktsTx(); TxActive = true; start_tx_time = NOW; // we set curr RTT Mac2PhyStartTx(rts_pkt); } void MMacDACAP::txCts() { Packet *cts_pkt = Packet::alloc(); initPkt(cts_pkt, CTS_PKT); incrCtrlPktsTx(); incrCtsPktsTx(); Mac2PhyStartTx(cts_pkt); TxActive = true; } void MMacDACAP::txWrn() { warning_sent = true; Packet *wrn_ptk = Packet::alloc(); initPkt(wrn_ptk, WRN_PKT); Mac2PhyStartTx(wrn_ptk); incrWrnPktsTx(); TxActive = true; } void MMacDACAP::rxStateIdle(Packet *p) { RxActive = false; hdr_dacap *dacaph = HDR_DACAP(p); hdr_mac *mach = HDR_MAC(p); hdr_MPhy *ph = HDR_MPHY(p); int source_mac = mach->macSA(); int dest_mac = mach->macDA(); int pkt_type = dacaph->dacap_type; int pkt_data_sn = dacaph->data_sn; double tx_time = ph->txtime; double rx_time = ph->rxtime; double diff_time = rx_time - tx_time; double distance = diff_time * prop_speed; Packet::free(p); if (dest_mac == addr) { // RTS for me if (pkt_type == RTS_PKT) { incrCtrlPktsRx(); incrRtsPktsRx(); curr_dest_addr = source_mac; session_active = true; session_distance = distance; if (last_data_id_rx != pkt_data_sn) last_data_id_rx = pkt_data_sn; last_reason = REASON_RTS_RECEIVED; if (debug_) cout << NOW << " MMacDACAP(" << addr << ")::rxStateIdle() next state = " << info[STATE_SEND_CTS] << endl; stateSendCTS(); return; } } else { // not for me if (pkt_type == RTS_PKT) { incrXCtrlPktsRx(); setBackoffNodes(source_mac, dest_mac); last_reason = REASON_XRTS_RX; stateWaitXCts(); return; } else if (pkt_type == CTS_PKT) { incrXCtrlPktsRx(); setBackoffNodes(source_mac, dest_mac); last_reason = REASON_XCTS_RX; stateWaitXWarning(); return; } else if (pkt_type == DATA_PKT) { incrXDataPktsRx(); setBackoffNodes(source_mac, dest_mac); last_reason = REASON_XDATA_RX; stateWaitXAck(); return; } } } void MMacDACAP::rxStateBackoff(Packet *p) { RxActive = false; hdr_dacap *dacaph = HDR_DACAP(p); hdr_mac *mach = HDR_MAC(p); hdr_MPhy *ph = HDR_MPHY(p); int source_mac = mach->macSA(); int dest_mac = mach->macDA(); int pkt_type = dacaph->dacap_type; int pkt_data_sn = dacaph->data_sn; double tx_time = ph->txtime; double rx_time = ph->rxtime; double diff_time = rx_time - tx_time; double distance = diff_time * prop_speed; Packet::free(p); if (dest_mac == addr) { // for me if (pkt_type == RTS_PKT) { // RTS incrCtrlPktsRx(); incrRtsPktsRx(); session_distance = distance; curr_dest_addr = source_mac; if (last_data_id_rx != pkt_data_sn) last_data_id_rx = pkt_data_sn; last_reason = REASON_RTS_RECEIVED; session_active = true; if (backoff_freeze_mode == true) freezeBackoff(); else exitBackoff(); if (debug_) cout << NOW << " MMacDACAP(" << addr << ")::rxStateBackoff() next state = " << info[STATE_SEND_CTS] << endl; stateSendCTS(); return; } } else { if (pkt_type == RTS_PKT) { incrXCtrlPktsRx(); setBackoffNodes(source_mac, dest_mac); last_reason = REASON_XRTS_RX; if (debug_) cout << NOW << " MMacDACAP(" << addr << ")::rxStateBackoff() next state = " << info[STATE_WAIT_XCTS] << endl; stateWaitXCts(); return; } else if (pkt_type == CTS_PKT) { incrXCtrlPktsRx(); setBackoffNodes(source_mac, dest_mac); last_reason = REASON_XCTS_RX; if (debug_) cout << NOW << " MMacDACAP(" << addr << ")::rxStateBackoff() next state = " << info[STATE_WAIT_XWRN] << endl; stateWaitXWarning(); return; } else if (pkt_type == DATA_PKT) { incrXDataPktsRx(); setBackoffNodes(source_mac, dest_mac); last_reason = REASON_XDATA_RX; if (debug_) cout << NOW << " MMacDACAP(" << addr << ")::rxStateBackoff() next state = " << info[STATE_WAIT_XACK] << endl; stateWaitXAck(); return; } } } void MMacDACAP::rxStateWaitCTS(Packet *p) { RxActive = false; hdr_dacap *dacaph = HDR_DACAP(p); hdr_mac *mach = HDR_MAC(p); hdr_MPhy *ph = HDR_MPHY(p); int source_mac = mach->macSA(); int dest_mac = mach->macDA(); int pkt_type = dacaph->dacap_type; int pkt_data_sn = dacaph->data_sn; double tx_time = ph->txtime; double rx_time = ph->rxtime; double diff_time = rx_time - tx_time; double distance = diff_time * prop_speed; Packet::free(p); if ((dest_mac != addr) && (pkt_type == CTS_PKT)) { incrXCtrlPktsRx(); if ((op_mode == NO_ACK_MODE) && (diff_time < t_min)) { if (debug_) { cout << NOW << " MMacDACAP(" << addr << ")::rxStateWaitCTS() diff time = " << diff_time << " < t_min = " << t_min << " ; Defering data " << endl; } defer_data = true; return; } else if ((op_mode == ACK_MODE) && (diff_time < T_W_min)) { // ack if (debug_) { cout << NOW << " MMacDACAP(" << addr << ")::rxStateWaitCTS() diff time = " << diff_time << " < T_W_min = " << T_W_min << " ; Defering data " << endl; // waitForUser(); } defer_data = true; return; } } else if ((dest_mac != addr) && (pkt_type == RTS_PKT)) { // xRTS incrXCtrlPktsRx(); if ((op_mode == ACK_MODE) && (diff_time < max_prop_delay)) { // ack if (debug_) { cout << NOW << " MMacDACAP(" << addr << ")::rxStateWaitCTS() diff time = " << diff_time << " < max_prop_delay = " << max_prop_delay << " ; Defering data " << endl; } defer_data = true; return; } } else if ((dest_mac == addr) && (source_mac == curr_dest_addr) && (pkt_type == CTS_PKT)) { // CTS for me incrCtrlPktsRx(); incrCtsPktsRx(); session_distance = distance; last_reason = REASON_CTS_RECEIVED; if (debug_) cout << NOW << " MMacDACAP(" << addr << ")::rxStateWaitCTS() next state = " << info[STATE_WAIT_WRN] << endl; stateWaitWarning(); return; } } void MMacDACAP::rxStateWaitACK(Packet *p) { RxActive = false; hdr_dacap *dacaph = HDR_DACAP(p); hdr_mac *mach = HDR_MAC(p); hdr_MPhy *ph = HDR_MPHY(p); int source_mac = mach->macSA(); int dest_mac = mach->macDA(); int pkt_type = dacaph->dacap_type; int pkt_data_sn = dacaph->data_sn; double tx_time = ph->txtime; double rx_time = ph->rxtime; double diff_time = rx_time - tx_time; double distance = diff_time * prop_speed; Packet::free(p); if ((dest_mac == addr) && (source_mac == curr_dest_addr) && (pkt_type == ACK_PKT)) { // ACK incrCtrlPktsRx(); incrAckPktsRx(); queuePop(true); if (backoff_pending == false) { if (debug_) cout << NOW << " MMacDACAP(" << addr << ")::rxStateWaitACK() next state = " << info[STATE_IDLE] << endl; last_reason = REASON_ACK_RECEIVED; if ((multihop_mode == true) && (Q.size() > 0)) stateRecontendWindow(); else stateIdle(); } else { if (debug_) cout << NOW << " MMacDACAP(" << addr << ")::rxStateWaitACK() next state = " << info[STATE_BACKOFF] << endl; last_reason = REASON_BACKOFF_PENDING; stateBackoff(); } } } void MMacDACAP::rxStateWaitData(Packet *p) { RxActive = false; hdr_dacap *dacaph = HDR_DACAP(p); hdr_mac *mach = HDR_MAC(p); hdr_MPhy *ph = HDR_MPHY(p); int source_mac = mach->macSA(); int dest_mac = mach->macDA(); int pkt_type = dacaph->dacap_type; int pkt_data_sn = dacaph->data_sn; double tx_time = ph->txtime; double rx_time = ph->rxtime; double diff_time = rx_time - tx_time; double distance = diff_time * prop_speed; if ((dest_mac == addr) && (source_mac == curr_dest_addr) && (pkt_type == DATA_PKT)) { // DATA for me if (debug_) cout << NOW << " MMacDACAP(" << addr << ")::rxStateWaitData() next state = " << info[STATE_DATA_RECEIVED] << endl; last_reason = REASON_DATA_RECEIVED; stateDataReceived(p); return; } Packet::free(p); if ((dest_mac == addr) && (source_mac == curr_dest_addr) && (pkt_type == RTS_PKT) && (last_data_id_rx == pkt_data_sn)) { incrCtrlPktsRx(); incrRtsPktsRx(); curr_dest_addr = source_mac; session_active = true; session_distance = distance; last_reason = REASON_SAME_RTS_RECEIVED; stateSendCTS(); return; } } void MMacDACAP::rxStateWaitXCts(Packet *p) { RxActive = false; hdr_dacap *dacaph = HDR_DACAP(p); hdr_mac *mach = HDR_MAC(p); hdr_MPhy *ph = HDR_MPHY(p); int source_mac = mach->macSA(); int dest_mac = mach->macDA(); int pkt_type = dacaph->dacap_type; int pkt_data_sn = dacaph->data_sn; double tx_time = ph->txtime; double rx_time = ph->rxtime; double diff_time = rx_time - tx_time; double distance = diff_time * prop_speed; Packet::free(p); if ((dest_mac != addr) && ((source_mac == sleep_node_1) || (source_mac == sleep_node_2))) { if (((pkt_type == ACK_PKT) && (op_mode == ACK_MODE)) || ((pkt_type == DATA_PKT) && (op_mode == NO_ACK_MODE))) { if (pkt_type == ACK_PKT) incrXCtrlPktsRx(); else incrXDataPktsRx(); if (debug_) { cout << NOW << " MMacDACAP(" << addr << ")::rxStateWaitXCts() DATA or ACK received " << "from nodes involved. quitting sleep. next state = " << info[STATE_IDLE] << endl; } exitSleep(); last_reason = REASON_TX_ENDED; stateIdle(); return; } else if (pkt_type == CTS_PKT) { incrXCtrlPktsRx(); last_reason = REASON_XCTS_RX; if (debug_) cout << NOW << " MMacDACAP(" << addr << ")::rxStateWaitXCts() next state = " << info[STATE_WAIT_XWRN] << endl; stateWaitXWarning(); return; } else if (pkt_type == DATA_PKT) { incrXDataPktsRx(); last_reason = REASON_XDATA_RX; if (debug_) cout << NOW << " MMacDACAP(" << addr << ")::rxStateWaitXCts() next state = " << info[STATE_WAIT_XACK] << endl; stateWaitXAck(); return; } } } void MMacDACAP::rxStateWaitXData(Packet *p) { RxActive = false; hdr_dacap *dacaph = HDR_DACAP(p); hdr_mac *mach = HDR_MAC(p); hdr_MPhy *ph = HDR_MPHY(p); int source_mac = mach->macSA(); int dest_mac = mach->macDA(); int pkt_type = dacaph->dacap_type; int pkt_data_sn = dacaph->data_sn; double tx_time = ph->txtime; double rx_time = ph->rxtime; double diff_time = rx_time - tx_time; double distance = diff_time * prop_speed; Packet::free(p); // rilascio il pkt if ((dest_mac != addr) && ((source_mac == sleep_node_1) || (source_mac == sleep_node_2))) { if (((pkt_type == ACK_PKT) && (op_mode == ACK_MODE)) || ((pkt_type == DATA_PKT) && (op_mode == NO_ACK_MODE))) { if (pkt_type == ACK_PKT) incrXCtrlPktsRx(); else incrXDataPktsRx(); if (debug_) { cout << NOW << " MMacDACAP(" << addr << ")::rxStateWaitXData() DATA or ACK received " << "from nodes involved. quitting sleep. next state = " << info[STATE_IDLE] << endl; // waitForUser(); } exitSleep(); last_reason = REASON_TX_ENDED; stateIdle(); // esco da backoff return; } else if (dacaph->dacap_type == DATA_PKT) { incrXDataPktsRx(); last_reason = REASON_XDATA_RX; if (debug_) cout << NOW << " MMacDACAP(" << addr << ")::rxStateWaitXData() next state = " << info[STATE_WAIT_XACK] << endl; stateWaitXAck(); return; } } } void MMacDACAP::rxStateWaitXAck(Packet *p) { RxActive = false; hdr_dacap *dacaph = HDR_DACAP(p); hdr_mac *mach = HDR_MAC(p); hdr_MPhy *ph = HDR_MPHY(p); int source_mac = mach->macSA(); int dest_mac = mach->macDA(); int pkt_type = dacaph->dacap_type; int pkt_data_sn = dacaph->data_sn; double tx_time = ph->txtime; double rx_time = ph->rxtime; double diff_time = rx_time - tx_time; double distance = diff_time * prop_speed; Packet::free(p); if ((dest_mac != addr) && ((source_mac == sleep_node_1) || (source_mac == sleep_node_2))) { if (((pkt_type == ACK_PKT) && (op_mode == ACK_MODE)) || ((pkt_type == DATA_PKT) && (op_mode == NO_ACK_MODE))) { if (pkt_type == ACK_PKT) incrXCtrlPktsRx(); else incrXDataPktsRx(); if (debug_) { cout << NOW << " MMacDACAP(" << addr << ")::rxStateWaitXAck() DATA or ACK received " << "from nodes involved. quitting sleep. next state = " << info[STATE_IDLE] << endl; // waitForUser(); } exitSleep(); last_reason = REASON_TX_ENDED; stateIdle(); // esco da backoff } } } void MMacDACAP::rxStateWaitXWarning(Packet *p) { RxActive = false; hdr_dacap *dacaph = HDR_DACAP(p); hdr_mac *mach = HDR_MAC(p); hdr_MPhy *ph = HDR_MPHY(p); int source_mac = mach->macSA(); int dest_mac = mach->macDA(); int pkt_type = dacaph->dacap_type; int pkt_data_sn = dacaph->data_sn; double tx_time = ph->txtime; double rx_time = ph->rxtime; double diff_time = rx_time - tx_time; double distance = diff_time * prop_speed; Packet::free(p); if ((dest_mac != addr) && ((source_mac == sleep_node_1) || (source_mac == sleep_node_2))) { if (((pkt_type == ACK_PKT) && (op_mode == ACK_MODE)) || ((pkt_type == DATA_PKT) && (op_mode == NO_ACK_MODE))) { if (pkt_type == ACK_PKT) incrXCtrlPktsRx(); else incrXDataPktsRx(); if (debug_) { cout << NOW << " MMacDACAP(" << addr << ")::rxStateWaitXWarning() DATA or ACK received " << "from nodes involved. quitting sleep. next state = " << info[STATE_IDLE] << endl; // waitForUser(); } exitSleep(); last_reason = REASON_TX_ENDED; stateIdle(); // esco da backoff return; } else if (dacaph->dacap_type == DATA_PKT) { incrXDataPktsRx(); last_reason = REASON_XDATA_RX; if (debug_) cout << NOW << " MMacDACAP(" << addr << ")::rxStateWaitXWarning() next state = " << info[STATE_WAIT_XACK] << endl; stateWaitXAck(); return; } } } void MMacDACAP::rxStateWaitWarning(Packet *p) { RxActive = false; hdr_dacap *dacaph = HDR_DACAP(p); hdr_mac *mach = HDR_MAC(p); hdr_MPhy *ph = HDR_MPHY(p); int source_mac = mach->macSA(); int dest_mac = mach->macDA(); int pkt_type = dacaph->dacap_type; int pkt_data_sn = dacaph->data_sn; double tx_time = ph->txtime; double rx_time = ph->rxtime; double diff_time = rx_time - tx_time; double distance = diff_time * prop_speed; Packet::free(p); if ((dest_mac != addr) && (source_mac == CTS_PKT)) { // xCTS incrXCtrlPktsRx(); if ((op_mode == NO_ACK_MODE) && (diff_time < t_min)) { // no ack if (debug_) { cout << NOW << " MMacDACAP(" << addr << ")::rxStateWaitWarning() diff time = " << diff_time << " < t_min = " << t_min << " ; Defering data " << endl; } defer_data = true; return; } else if ((op_mode == ACK_MODE) && (diff_time < T_W_min)) { // condizione ack if (debug_) { cout << NOW << " MMacDACAP(" << addr << ")::rxStateWaitWarning() diff time = " << diff_time << " < T_W_min = " << T_W_min << " ; Defering data " << endl; } defer_data = true; return; } } else if ((dest_mac != addr) && (pkt_type == RTS_PKT)) { // xRTS incrXCtrlPktsRx(); if ((op_mode == ACK_MODE) && (diff_time < max_prop_delay)) { // ack if (debug_) { cout << NOW << " MMacDACAP(" << addr << ")::rxStateWaitWarning() diff time = " << diff_time << " < max_prop_delay = " << max_prop_delay << " ; Defering data " << endl; // waitForUser(); } defer_data = true; return; } } else if ((dest_mac == addr) && (source_mac == curr_dest_addr) && (pkt_type == WRN_PKT)) { // WRN incrWrnPktsRx(); if (debug_) { cout << NOW << " MMacDACAP(" << addr << ")::rxStateWaitWarning() WRN received, defering data " << endl; } defer_data = true; return; } } void MMacDACAP::rxStateSendWarning(Packet *p) { RxActive = false; hdr_dacap *dacaph = HDR_DACAP(p); hdr_mac *mach = HDR_MAC(p); hdr_MPhy *ph = HDR_MPHY(p); int source_mac = mach->macSA(); int dest_mac = mach->macDA(); int pkt_type = dacaph->dacap_type; int pkt_data_sn = dacaph->data_sn; double tx_time = ph->txtime; double rx_time = ph->rxtime; double diff_time = rx_time - tx_time; double distance = diff_time * prop_speed; if ((dest_mac == addr) && (source_mac == curr_dest_addr) && (pkt_type == DATA_PKT)) { // ricevo DATA x me if (debug_) { cout << NOW << " MMacDACAP(" << addr << ")::rxStateSendWarning() DATA received in " << info[curr_state] << " logical error!!!! " << endl; waitForUser(); } last_reason = REASON_DATA_RECEIVED; stateDataReceived(p); return; } Packet::free(p); if ((dest_mac == addr) && (source_mac == curr_dest_addr) && (pkt_type == RTS_PKT) && (last_data_id_rx == pkt_data_sn)) { incrCtrlPktsRx(); incrRtsPktsRx(); curr_dest_addr = source_mac; session_active = true; session_distance = distance; last_reason = REASON_SAME_RTS_RECEIVED; stateSendCTS(); return; } else if ((dest_mac != addr) && (pkt_type == RTS_PKT)) { if (diff_time < (2 * max_prop_delay - t_min)) { incrXCtrlPktsRx(); if (debug_) { cout << NOW << " MMacDACAP(" << addr << ")::rxStateSendWarning() difference time = " << diff_time << " < " << (2 * max_prop_delay - t_min) << " sending a warning " << endl; } txWrn(); return; } } else if ((dest_mac != addr) && (pkt_type == CTS_PKT)) { // ricevo xCTS if ((diff_time < (2 * max_prop_delay - T_W_min)) && (op_mode == ACK_MODE)) { // se è ack mode incrXCtrlPktsRx(); if (debug_) { cout << NOW << " MMacDACAP(" << addr << ")::rxStateSendWarning() difference time = " << diff_time << " < " << (2 * max_prop_delay - T_W_min) << " sending a warning " << endl; } txWrn(); return; } } } void MMacDACAP::rxStateRecontendWindow(Packet *p) { RxActive = false; hdr_dacap *dacaph = HDR_DACAP(p); hdr_mac *mach = HDR_MAC(p); hdr_MPhy *ph = HDR_MPHY(p); int source_mac = mach->macSA(); int dest_mac = mach->macDA(); int pkt_type = dacaph->dacap_type; int pkt_data_sn = dacaph->data_sn; double tx_time = ph->txtime; double rx_time = ph->rxtime; double diff_time = rx_time - tx_time; double distance = diff_time * prop_speed; Packet::free(p); if (dest_mac == addr) { // RTS for me if (pkt_type == RTS_PKT) { incrCtrlPktsRx(); incrRtsPktsRx(); curr_dest_addr = source_mac; session_active = true; session_distance = distance; if (last_data_id_rx != pkt_data_sn) last_data_id_rx = pkt_data_sn; last_reason = REASON_RTS_RECEIVED; if (debug_) cout << NOW << " MMacDACAP(" << addr << ")::rxStateRecontendWindow() next state = " << info[STATE_SEND_CTS] << endl; stateSendCTS(); return; } } else { if (dacaph->dacap_type == RTS_PKT) { incrXCtrlPktsRx(); setBackoffNodes(source_mac, dest_mac); last_reason = REASON_XRTS_RX; if (debug_) cout << NOW << " MMacDACAP(" << addr << ")::rxStateRecontendWindow() next state = " << info[STATE_WAIT_XCTS] << endl; stateWaitXCts(); return; } else if (pkt_type == CTS_PKT) { incrXCtrlPktsRx(); setBackoffNodes(source_mac, dest_mac); last_reason = REASON_XCTS_RX; if (debug_) cout << NOW << " MMacDACAP(" << addr << ")::rxStateRecontendWindow() next state = " << info[STATE_WAIT_XWRN] << endl; stateWaitXWarning(); return; } else if (pkt_type == DATA_PKT) { incrXDataPktsRx(); setBackoffNodes(source_mac, dest_mac); last_reason = REASON_XDATA_RX; if (debug_) cout << NOW << " MMacDACAP(" << addr << ")::rxStateRecontendWindow() next state = " << info[STATE_WAIT_XACK] << endl; stateWaitXAck(); return; } } } void MMacDACAP::stateIdle() { timer.force_cancel(); refreshState(STATE_IDLE); printStateInfo(); warning_sent = false; session_active = false; defer_data = false; curr_dest_addr = NOT_SET; exitSleep(); if (!Q.empty()) { if (HDR_DACAP(Q.front())->data_sn != last_data_id_tx) { session_distance = NOT_SET; backoff_counter = 0; last_data_id_tx = HDR_DACAP(Q.front())->data_sn; } if (HDR_DACAP(Q.front())->tx_tries < max_tx_tries) { last_reason = REASON_DATA_PENDING; HDR_DACAP(Q.front())->tx_tries++; stateSendRTS(); } else { queuePop(false); incrDroppedPktsTx(); last_reason = REASON_MAX_TX_TRIES; if (debug_) cout << NOW << " MMacDACAP(" << addr << ")::stateIdle() dropping pkt, max tx tries reached" << endl; stateIdle(); } } } void MMacDACAP::stateSendRTS() { session_active = true; timer.force_cancel(); refreshState(STATE_SEND_RTS); printStateInfo(); curr_data_pkt = Q.front(); txRts(); } void MMacDACAP::stateBackoff() { timer.force_cancel(); refreshState(STATE_BACKOFF); warning_sent = false; defer_data = false; if (backoff_pending == false) { if (debug_) cout << NOW << " MMacDACAP(" << addr << ")::stateBackoff() starting a new backoff" << endl; backoffStartTime(); backoff_duration = getBackoffTime(); backoff_start_time = NOW; if ((prev_state == STATE_WAIT_CTS) || (prev_state == STATE_WAIT_ACK)) backoff_counter++; if (backoff_freeze_mode == true) timer.resched(backoff_duration); else backoff_timer.resched(backoff_duration); } else if (backoff_freeze_mode == true) { // backoff freeze mode on, we need // to restore freezed backoff if (backoff_remaining == NOT_SET) { cout << NOW << " MMacDACAP(" << addr << ")::stateBackoff() error!!! backoff remaining not set!!!" << endl; exit(1); } if (debug_) cout << NOW << " MMacDACAP(" << addr << ")::stateBackoff() continuing previous backoff, " << " time remaining = " << backoff_remaining << " s" << endl; backoff_start_time = NOW; backoff_duration = backoff_remaining; timer.resched(backoff_remaining); } // no freeze,backoff pending and timer already counting, we wait for an // event printStateInfo(backoff_duration); } void MMacDACAP::stateWaitXCts() { timer.force_cancel(); refreshState(STATE_WAIT_XCTS); printStateInfo(); timer.resched(2.0 * max_prop_delay + computeTxTime(CTS_PKT)); } void MMacDACAP::stateWaitXData() { timer.force_cancel(); refreshState(STATE_WAIT_XDATA); printStateInfo(); timer.resched(2.0 * max_prop_delay + computeTxTime(DATA_PKT) + computeWaitTime(op_mode, ((max_prop_delay * 2.0) * 1500.0))); } void MMacDACAP::stateWaitXAck() { timer.force_cancel(); refreshState(STATE_WAIT_XACK); printStateInfo(); timer.resched(2.0 * max_prop_delay + computeTxTime(ACK_PKT)); } void MMacDACAP::stateWaitXWarning() { timer.force_cancel(); refreshState(STATE_WAIT_XWRN); printStateInfo(); if (op_mode == ACK_MODE) timer.resched(3.0 * max_prop_delay - T_W_min + computeTxTime(WRN_PKT) + computeTxTime(RTS_PKT) + wait_costant); else timer.resched(3.0 * max_prop_delay - t_min + computeTxTime(WRN_PKT) + computeTxTime(RTS_PKT) + wait_costant); } void MMacDACAP::stateWaitWarning() { timer.force_cancel(); refreshState(STATE_WAIT_WRN); printStateInfo(); if (op_mode == ACK_MODE) timer.resched(2.0 * max_prop_delay - T_W_min + computeTxTime(WRN_PKT) + wait_costant); else timer.resched(2.0 * max_prop_delay - t_min + computeTxTime(WRN_PKT) + wait_costant); } void MMacDACAP::stateSendWarning() { timer.force_cancel(); refreshState(STATE_SEND_WRN); printStateInfo(); // timer.resched(2 * max_prop_delay - min(T_W_min,t_min) + // computeTxTime(WRN_PKT) + wait_costant); if (op_mode == ACK_MODE) timer.resched(2.0 * max_prop_delay - T_W_min + wait_costant); else timer.resched(2.0 * max_prop_delay - t_min + wait_costant); } void MMacDACAP::stateWaitCTS() { timer.force_cancel(); refreshState(STATE_WAIT_CTS); printStateInfo(); timer.resched(2.0 * max_prop_delay + computeTxTime(CTS_PKT) + computeTxTime(RTS_PKT) + wait_costant); } void MMacDACAP::stateWaitData() { timer.force_cancel(); refreshState(STATE_WAIT_DATA); double delay; printStateInfo(); timer.resched(2.0 * max_prop_delay + computeTxTime(DATA_PKT) + computeWaitTime(op_mode, (max_prop_delay * 2.0) * 1500.0) + wait_costant); } void MMacDACAP::stateWaitACK() { timer.force_cancel(); refreshState(STATE_WAIT_ACK); printStateInfo(); timer.resched(2.0 * max_prop_delay + computeTxTime(ACK_PKT) + computeTxTime(DATA_PKT) + wait_costant); } void MMacDACAP::stateDeferData() { timer.force_cancel(); refreshState(STATE_DEFER_DATA); incrTotalDeferTimes(); double defer_delay = computeWaitTime(op_mode, session_distance); deferEndTime(defer_delay); if (debug_) { cout << NOW << " MMacDACAP(" << addr << ")::stateDeferData() defer delay = " << defer_delay << endl; } if (debug_) printStateInfo(defer_delay); timer.resched(defer_delay); } void MMacDACAP::stateSendData() { timer.force_cancel(); refreshState(STATE_SEND_DATA); defer_data = false; printStateInfo(); txData(); } void MMacDACAP::stateCTSReceived() { timer.force_cancel(); refreshState(STATE_CTS_RECEIVED); printStateInfo(); if (defer_data == true) stateDeferData(); else stateSendData(); } void MMacDACAP::stateDataReceived(Packet *data_pkt) { timer.force_cancel(); refreshState(STATE_DATA_RECEIVED); printStateInfo(); incrDataPktsRx(); hdr_cmn *ch = hdr_cmn::access(data_pkt); hdr_dacap *dacaph = HDR_DACAP(data_pkt); ch->ptype() = dacaph->orig_type; ch->size() = ch->size() - HDR_size; sendUp(data_pkt); if (op_mode == ACK_MODE) stateSendAck(); else stateIdle(); } void MMacDACAP::stateSendAck() { timer.force_cancel(); refreshState(STATE_SEND_ACK); printStateInfo(); txAck(); } void MMacDACAP::stateSendCTS() { timer.force_cancel(); refreshState(STATE_SEND_CTS); printStateInfo(); txCts(); } void MMacDACAP::stateRecontendWindow() { timer.force_cancel(); refreshState(STATE_RECONTEND_WINDOW); double delay = getRecontendTime(); printStateInfo(delay); timer.resched(delay); } void MMacDACAP::printStateInfo(double delay) { if (debug_) cout << NOW << " MMacDACAP(" << addr << ")::printStateInfo() " << "from " << info[prev_state] << " to " << info[curr_state] << " reason: " << info[last_reason] << endl; if (print_transitions) { if (curr_state == STATE_BACKOFF) { fout << left << setw(10) << NOW << " MMacDACAP(" << addr << ")::printStateInfo() " << "from " << info[prev_state] << " to " << info[curr_state] << " reason: " << info[last_reason] << ". Backoff duration = " << delay << "; backoff cnt = " << backoff_counter << endl; } else if (curr_state == STATE_DEFER_DATA) { fout << left << setw(10) << NOW << " MMacDACAP(" << addr << ")::printStateInfo() " << "from " << info[prev_state] << " to " << info[curr_state] << " reason: " << info[last_reason] << ". Defering delay = " << delay << endl; } else if (curr_state == STATE_RECONTEND_WINDOW) { fout << left << setw(10) << NOW << " MMacDACAP(" << addr << ")::printStateInfo() " << "from " << info[prev_state] << " to " << info[curr_state] << " reason: " << info[last_reason] << ". Waiting delay = " << delay << endl; } else { fout << left << setw(10) << NOW << " MMacDACAP(" << addr << ")::printStateInfo() " << "from " << info[prev_state] << " to " << info[curr_state] << " reason: " << info[last_reason] << endl; } } } inline void MMacDACAP::waitForUser() { std::string response; std::cout << "Press Enter to continue"; std::getline(std::cin, response); }
/* Copyright (c) 2015-2018, Linaro Limited * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ /** * @file * * ODP packet descriptor */ #ifndef ODP_API_ABI_PACKET_H_ #define ODP_API_ABI_PACKET_H_ #ifdef __cplusplus extern "C" { #endif #include <odp/api/std_types.h> #include <odp/api/plat/strong_types.h> /** @ingroup odp_packet * @{ */ typedef ODP_HANDLE_T(odp_packet_t); #define ODP_PACKET_INVALID _odp_cast_scalar(odp_packet_t, 0) #define ODP_PACKET_OFFSET_INVALID 0xffff typedef uint8_t odp_packet_seg_t; /* or it will be provided by packet_inlines.h */ #define _ODP_HAVE_PACKET_SEG_NDX 1 static inline uint8_t _odp_packet_seg_to_ndx(odp_packet_seg_t seg) { return (uint8_t)seg; } static inline odp_packet_seg_t _odp_packet_seg_from_ndx(uint8_t ndx) { return (odp_packet_seg_t)ndx; } #define ODP_PACKET_SEG_INVALID ((odp_packet_seg_t)-1) typedef uint8_t odp_proto_l2_type_t; #define ODP_PROTO_L2_TYPE_NONE 0 #define ODP_PROTO_L2_TYPE_ETH 1 typedef uint8_t odp_proto_l3_type_t; #define ODP_PROTO_L3_TYPE_NONE 0 #define ODP_PROTO_L3_TYPE_ARP 1 #define ODP_PROTO_L3_TYPE_RARP 2 #define ODP_PROTO_L3_TYPE_MPLS 3 #define ODP_PROTO_L3_TYPE_IPV4 4 #define ODP_PROTO_L3_TYPE_IPV6 6 typedef uint8_t odp_proto_l4_type_t; /* Numbers from IANA Assigned Internet Protocol Numbers list */ #define ODP_PROTO_L4_TYPE_NONE 0 #define ODP_PROTO_L4_TYPE_ICMPV4 1 #define ODP_PROTO_L4_TYPE_IGMP 2 #define ODP_PROTO_L4_TYPE_IPV4 4 #define ODP_PROTO_L4_TYPE_TCP 6 #define ODP_PROTO_L4_TYPE_UDP 17 #define ODP_PROTO_L4_TYPE_IPV6 41 #define ODP_PROTO_L4_TYPE_GRE 47 #define ODP_PROTO_L4_TYPE_ESP 50 #define ODP_PROTO_L4_TYPE_AH 51 #define ODP_PROTO_L4_TYPE_ICMPV6 58 #define ODP_PROTO_L4_TYPE_NO_NEXT 59 #define ODP_PROTO_L4_TYPE_IPCOMP 108 #define ODP_PROTO_L4_TYPE_SCTP 132 #define ODP_PROTO_L4_TYPE_ROHC 142 typedef enum { ODP_PACKET_GREEN = 0, ODP_PACKET_YELLOW = 1, ODP_PACKET_RED = 2, ODP_PACKET_ALL_COLORS = 3, } odp_packet_color_t; #define ODP_NUM_PACKET_COLORS 3 #define _ODP_INLINE static inline #include <odp/api/plat/packet_inlines.h> #include <odp/api/plat/packet_inlines_api.h> /** * @} */ #ifdef __cplusplus } #endif #endif
The impact of two-child policy on household savings in China and mechanisms ABSTRACT One-child policy has been accused of causing high saving rates in China, and this article provides direct evidences for the economic impact of the two-child policy on savings. Using China Migrants Dynamic Survey, we find the two-child policy significantly reduces the household saving rates by 1.96 percentage points in average and by 4.88 percentage points if the rural and ethnic minority groups excluded, and we also use IV and propensity score matching (PSM) estimation methods to test the robustness. Furthermore, the study shows that the two-child policy has a heterogeneous effect on the saving rates decreasing, which mainly occurs in the local hukou population group. From this perspective, the policy has a comprehensive and sustainable impact. Through mechanism analysis, we clarify that the two-child policy affects savings by increasing expenditure insignificantly; in addition to the direct effect, it mainly affects savings by transiently reducing family income. Abbreviations: IV: Instrumental variables; PSM: Propensity score matching; CPI: Consumer price index; OLS: Ordinary least squares
<filename>model/model.go<gh_stars>0 package model import ( "github.com/jinzhu/gorm" _ "github.com/jinzhu/gorm/dialects/mysql" // 不导入模块,仅执行该模块的init函数。 ) type Employee struct { gorm.Model Name string `gorm:"unique" json:"name"` City string `json:"city"` Age string `json:"age"` Status bool `json:"status"` } func (e *Employee) Disable() { e.Status = false } func (e *Employee) Enable() { e.Status = true } // DBMigrate将会创建表,若有必要,还会创建某些关系。 func DBMigrate(db *gorm.DB) *gorm.DB { db.AutoMigrate(&Employee{}) return db }
Study of the antineoplastic effect of modulating apoptosis-related noncoding RNA in human hepatocellular carcinoma cell line (HepG2) MiR-421 is considered an important molecule that can prevent tumor growth. Bioinformatics analysis indicated that mRNA caspase-3 gene is a target gene of miR-421. The current study aimed to explore the functional role of miR-421 in hepatocellular carcinoma (HCC) and explore the interaction between miR-421 and caspase-3. To validate bioinformatics data, RT-qPCR was used to detect the expression of miR-421 and caspase-3 in 10 HCC tissues. The results showed miR-421 expression was significantly higher in HCC than non HCC liver tissues (P<0.01), nevertheless caspase-3 gene expression was markedly lower in HCC than non HCC liver tissues (P<0.01). Besides, miR-421 expression was negatively associated with caspase-3 expression. MiR-421 mimic and inhibitor was transfected into HCC cell lines (HepG2). Proliferation assay, showed that low-expression of miR-421 inhibited the proliferation of HCC cells. RT-qPCR was worked for detection the expression levels of miR-421 and caspase-3 in HepG2 cells before and after transfection. The results showed that miR-421 expression in HepG2 cells was significantly lower in miR-421 inhibitor transfected group than in mimic- transfected and control groups (Mock) (P≤ 0.05), and caspase-3 gene expression in HCC tissues was markedly higher in inhibitor transfected group than those transfected by mimic and control group (Mock) (P≤0.05). Thus, miR-421 inhibitor may inhibit the proliferation of HCC cells via over- expression of caspase-3.
Cloning of Chlamydomonas p60 katanin and localization to the site of outer doublet severing during deflagellation. Katanin, a heterodimeric microtubule-severing protein that localizes to sites of microtubule organization, can mediate in vitro the ATP-dependent disassembly of both taxol-stabilized microtubules and axonemal doublet microtubules. In the unicellular biflagellate alga Chlamydomonas, katanin has been implicated in deflagellation, a highly specific process that involves a Ca(2+)-signal transduction pathway starting at the plasma membrane and culminating in the severing of axonemal outer doublet microtubules and excision of both flagella from the cell body. Previously, we showed that the microtubule severing activity of deflagellation and katanin's 60 kD catalytic subunit (termed p60) purified with the flagellar basal body complex (FBBC). Additional evidence supporting the involvement of katanin in deflagellation came from the observation that an antibody against human p60 katanin significantly inhibited FBBC-associated microtubule-severing activity. Here we report the cloning of p60 katanin from Chlamydomonas reinhardtii. Immunogold electron microscopy places Chlamydomonas p60 at several locations within the basal body apparatus and associated structures. Importantly, we find a dense accumulation of colloidal gold labeling the distal end of the flagellar transition zone, the site of outer doublet severing during deflagellation. These results suggest that, in addition to a potential involvement in the deflagellation pathway, katanin-mediated microtubule-severing may be associated with multiple processes in Chlamydomonas.
Targeted Treatment Cancer research is an area of medical science that, rightfully, gets considerable attention. There are nearly 14.5 million Americans with a history of cancer and with more than 13 million estimated new cancer cases each year. It’s no wonder even artificial intelligence (AI) has gotten into the field. Researchers from the University of Michigan are not getting left behind, with a groundbreaking method that has the potential to eliminate tumors. This new technology uses nano-sized discs, about 10 nm to be exact, to teach the body to kill cancer cells. “We are basically educating the immune system with these nanodiscs so that immune cells can attack cancer cells in a personalized manner,” said James Moon from the University of Michigan. Each of these ‘nanodiscs’ is full of neoantigens (tumor-specific mutations) that teach the immune system’s T-cells to recognize each neoantigen and kill them. These work hand-in-hand with immune checkpoint inhibitors that boost the responses of T-cells — forming an anti-cancer system in the body that wipes out tumors and potentially keeps them from reemerging. “The idea is that these vaccine nanodiscs will trigger the immune system to fight the existing cancer cells in a personalized manner,” Moon added. The study is published in the journal Nature Materials.
/* * (C) Copyright IBM Corp. 2021 * * SPDX-License-Identifier: Apache-2.0 */ package com.ibm.cohort.cql.spark.optimizer; import org.hl7.elm.r1.AliasedQuerySource; /** * Maintains the state for an aliased query source. This * can be a simple expression alias such as <code>[Encounter] e</code> * or a more complex expression such as the <code>with</code> or <code>without</code> * clauses of a query. */ public class QueryAliasContext { private AliasedQuerySource aliasedQuerySource; public QueryAliasContext(AliasedQuerySource elm) { this.aliasedQuerySource = elm; } public String getAlias() { return aliasedQuerySource.getAlias(); } public AliasedQuerySource getAliasedQuerySource() { return this.aliasedQuerySource; } }
The association between undiagnosed diabetes and cognitive function: findings from the China health and retirement longitudinal study Background The cognitive function of people with diabetes has gained an increasing interest in recent years, and this study focuses on exploring the relationship between undiagnosed diabetes and cognitive function among the middle-aged and elderly people in China. Methods The data came from the China Health and Retirement Longitudinal Study (CHARLS) which was conducted between July and October 2015. 9855 subjects were enrolled in the study. Executive function and episodic memory were used to assess cognitive function. The subjects were divided into three groups: no diabetes, diagnosed diabetes, and undiagnosed diabetes, and weighted multiple linear regression models were established to evaluate the association of undiagnosed diabetes with cognitive function. Results After controlling for covariates, undiagnosed diabetes was statistically associated with executive function (=−0.215, P<0.01). In the age group of ≥65years, undiagnosed diabetes was statistically associated with executive function (=−0.358, P<0.01) and episodic memory (=−0.356, P<0.01). When adjusting for confounders, no statistically significant associations were found between diagnosed diabetes and cognitive function except in 45-54 age group (=0.374, P<0.05). Conclusions The cross-sectional study suggested that undiagnosed diabetes was linked to poor cognitive function, especially in the elderly population. Timely diagnosis and active treatment of diabetes are important to reduce the occurrence of cognitive impairment. Further prospective cohort studies are required to articulate the association between undiagnosed diabetes and cognitive function..9% (700 million) by 2045. However, more than half (50.1%) of people living with hyperglycemia were unaware that they had diabetes in 2019, compared to 49.7% in 201 7. With the accelerating pace of population aging and the increasing prevalence of diabetes mellitus, complications of diabetes mellitus, especially the central nervous system impairment, have attracted more and more attention from the scientific community. Cognitive dysfunction is generally defined as different degrees of cognitive impairment from mild cognitive dysfunction, a syndrome defined as cognitive decline greater than expected for an individual's age and education level but not interfering notably with activities of daily life, to dementia which may disallow a patient to function without assistance. A variety of factors have been shown to influence cognitive function. The relationship between diabetes and cognition has been reported extensively in many studies. However, relatively few studies have been reported paying attention to the effect of undiagnosed diabetes on the relationship between diabetes and cognitive function among the middle-aged and elderly people in China. Furthermore, recent evidence indicated that undiagnosed diabetes could moderate the relationship between diabetes mellitus and cognitive function among Brazilian adults. When undiagnosed diabetes was not correctly classified as either non-diabetes or self-reported diabetes, the relationship was attenuated, or became not statistically significant. Individuals not aware of hyperglycemia have a greater risk of neurocognitive dysfunction than patients having been diagnosed with diabetes. Accordingly, earlier identification and intervention of diabetes mellitus, especially the undiagnosed diabetes, is of great significance to prevent the deterioration of cognitive function. Considering the high prevalence of diabetes and large number of undiagnosed diabetes in China, it is of great importance to differentiate the undiagnosed diabetes from the people without diabetes and explore the potential association between undiagnosed diabetes and cognitive function based on a nationally representative health survey and blood test data. In addition, further confirmation of the relationship between different diabetes status and cognitive function was also performed in age-stratified subsamples. The findings may be helpful to alert national health authorities to enhance diabetic screening, promote health education, and improve the cognitive well-being among the middle-aged and elderly population. Data source and study design The data utilized in this study came from the 2015 wave of the China Health and Retirement Longitudinal Study (CHARLS), a nationally representative research design of middle-aged and elderly people in China. The project was first conducted in June 2011-March 2012 and attempted to provide a wide range of data from socioeconomic characteristics to health conditions. CHARLS baseline survey was carried out in 150 counties/districts, 450 villages/ urban communities using multistage probability sampling. The detailed description of the CHARLS survey design and data collection strategy had been published previously. A second follow-up survey including questionnaires, physical examinations, and blood samples was conducted between July and October 2015. Further information of the blood collection, blood bioassays and descriptive summaries was available elsewhere. The data is available freely at http:// charls. pku. edu. cn/. Participants included in the study should have complete information of demographic background, cognitive function measurement, blood glucose, glycated hemoglobin, blood lipid examination, blood pressure, BMI, self-rated health status, and depression assessment. Exclusion criteria for this study were: having brain damage or mental retardation, having memory-related diseases such as AD, brain atrophy, Parkinson's disease, having emotional, nervous, or psychiatric problems. Ultimately, 9855 subjects were included in this study, and they were separated into three groups according to the diabetes status, including 8093 participants without diabetes, 894 participants having been diagnosed with diabetes by a physician or a medical professional, and 868 participants having not yet reported being diagnosed with diabetes but meeting diagnostic criteria. More details about the selection of respondents were presented in Fig. 1. This study was a secondary analysis of a public database. The original CHARLS was approved by the Ethical Review Committee of Peking University (IRB00001052-11015), and all participants signed the informed consent at the time of participation. The research has been performed in accordance with the Declaration of Helsinki. Definition of diabetes status According to the American Diabetes Association, the diagnostic criteria for diabetes mellitus were defined as fasting plasma glucose (FPG) levels ≥126 mg/dL or 2-h plasma glucose (2-h PG) levels in an oral glucose tolerance test ≥200 mg/dL, glycated hemoglobin levels ≥6.5%, classic symptoms of hyperglycemia or hyperglycemic crisis, a random plasma glucose ≥200 mg/dL. The CHARLS survey also had three questions concerning diabetes:" have you been diagnosed with diabetes or high blood sugar by a doctor?", "How did you know that you had diabetes, through routine or CHARLS physical examination, or any other?", and "Are you now taking any of the following treatments to treat diabetes?". All participants enrolled in the study were classified into three groups: no diabetes; diagnosed diabetes; undiagnosed diabetes. Subjects who had been diagnosed with diabetes by a physician or taking antidiabetic treatments were categorized into "diagnosed diabetes" group. " Undiagnosed diabetes" group included the individuals fulfilling blood test criteria but without a history of physician diagnosis or taking medication. The remaining subjects were classified into "no diabetes" group. Measurement of cognitive function Based on the design of the American Health Retirement Study (HRS), two core dimensions of cognitive function were assessed in CHARLS, including executive function and episodic memory. The evaluation of executive function was based on the Telephone Interview of Cognitive Status (TICS-10) and figure redrawing. TICS is a reliable and welldeveloped screening method of cognitive function, which consists of five items on time orientation and five items on the serial-7 s test. The participants were asked to answer today's date (the month, day, and year), the day of the week, the current season of the year, and then serially subtract 7 from 100 for five times. A score of one was given for each correct answer, while zero for the incorrect. The total TICS scores range from 0 to 10 (Cronbach's alpha = 0.8). For the figure redrawing test, interviewees would receive one point if they successfully replicate a picture of two overlapped pentagons shown to them, and zero point if they failed to complete the task. Individual scores were the sum of correct answers, and the measure of executive function theoretically ranges from 0 to 11. The other cognitive performance was episodic memory evaluated through immediate recall and delayed recall. The immediate word recall test was measured first when ten commonly used words were presented to participants. After completing a 10-item questionnaire on depression, the subjects were again instructed to recall as many of the target words as possible in whatever order. Correctly recalling a word was awarded one point, otherwise, awarded zero. Episodic memory was evaluated by calculating the average score of immediate recall and delayed recall, and the word-recall scores range from 0 to10. Covariates Covariates considered in this study included sociodemographic characteristics, health behaviors, and cognition-related health condition. Sociodemographic characteristics of the participants mainly included gender, age, marital status, the highest level of education, and living areas; health behaviors included smoking habits and alcohol consumption status; the health condition included self-rated health status, BMI level, hypertension, dyslipidemia, and depression. To examine the effect of age, all participants were divided into three groups: 45-54, 55-64, and ≥ 65 years. Education level was categorized into four groups: illiterate/semi-literate, primary education, middle school education, and high school education or above. Marital status was classified as married or cohabitated, widowed, and other status (including never married, divorced, or separated). Smokers were defined as having smoked more than 100 cigarettes including currently smoking and having quitted, and nonsmokers referred to never smoking. Drinkers were defined as ever drinking alcoholic beverages in the past year, and nondrinkers referred to drinking no alcohol. Based on the Chinese criteria of weight for adults, BMI was classified into the following groups: underweight (<18.5 kg/m 2 ), normal weight (18.5-23.9 kg/m 2 ), overweight (24.0-27.9 kg/m 2 ), and obesity (≥28.0 kg/m 2). Blood pressure of the participants was measured three times using the Omron HEM-7200 monitor. According to reference standards established by World Health Organization, hypertension was defined as mean systolic blood pressure (SBP) ≥140 mmHg and/or mean diastolic blood pressure (DBP) ≥90 mmHg, taking self-reported physician diagnosis of hypertension into consideration. The Center for Epidemiologic Study Depression Scale (CESD) was adopted as an instrument of depression evaluation in this study. CESD-10 was a short, valid, and reliable scale designed to assess mental disorders for the population in China. 10 questions about the number of negative feelings during the previous week were asked by the interviewers, each term including four grades: 0 (<1 day), 1 (1-2 days), 2 (3-4 days), and 3 (5-7 days). The range of depression scores was 0-30. For present study, a score equal or greater 12 indicated having depression. The lipids including total cholesterol, HDL-cholesterol, LDL-cholesterol, and Triglycerides were measured at Clinical Laboratory of Capital Medical University. Based on the Guidelines for the Prevention and Treatment of Dyslipidemia in China, dyslipidemia was defined as TC ≥ 6.216 mmol/L, LDL ≥ 4.138 mmol/L, TG ≥ 2.250 mmol/L, or HD ≤ 1.036 mmol/L. Participants were considered as dyslipidemia when the ratio of total cholesterol to HDL cholesterol ≥5.0 in this study. Individual subjective perception of current health status was also assessed by ranking from 1 (poor), 2 (fair), to 3 (good). Statistical analysis Descriptive statistics were calculated for sociodemographic characteristics, health behaviors, and health conditions. Continuous data were reported as mean ± standard deviation, and categorical data were reported as numbers and proportions. Differences between groups were tested using analysis of variance (ANOVA) or Kruskal-Wallis H test for continuous variables and chi-square test for categorical variables. Taking into account the multistage sampling and nonresponse, weighted multiple linear regression models were conducted to determine the potential relationship between undiagnosed diabetes and cognitive function. Baseline models only including covariates were built to screen the significant characteristics. The establishment of crude models was to initially explore the possible relationship between undiagnosed diabetes and cognition. Then, we fit multiple linear regression models controlling for all significant confounding variables to better assess the association of undiagnosed diabetes with cognitive function. In addition, subgroup analyses were carried out to explore heterogeneity. Participants were classified into three groups (45-54,55-64, and ≥ 65 years), and linear regression models were separately constructed to examine whether the relationship was age-dependent. All analyses were conducted in Stata 15.0 (STATA Corporation, College Station, TX, USA), and P < 0.05 was regarded as statistically significant. Subjects characteristics The sociodemographic and health characteristics of the whole sample and the different groups were summarized in Table 1. The mean age of the whole subjects was 60.95 years. More than half of the participants were female (53.41%), more participants (83.11%) were married or living together, and 43.32% of the participants were illiterate or semi-literate. Of the 9855 subjects eventually enrolled in the study, 894 were diagnosed with diabetes, while 868 were not undetected. Compared to nondiabetics, participants with diagnosed or undiagnosed diabetes were more likely to suffer from hypertension (P < 0.001), dyslipidemia (P < 0.001), and depression (P < 0.01). People with undiagnosed diabetes showed poorer cognitive function than those who had been diagnosed with diabetes, with an average score Table 2 showed the relationship between cognitive function and covariates. Being female, the elderly, and living in rural tended to have lower score both in executive function and episodic memory (P < 0.001). The participants with hypertension or depression performed worse cognitive function (P < 0.001). The people with dyslipidemia performed poor episodic memory (P < 0.05), but the difference in executive function was not statistically significant (P > 0.05). People having a history of alcohol intake and good self-rated health could get higher scores of episodic memory (P < 0.01). Covariates and cognition The higher the level of education, the better the cognitive function (P < 0.001). Diabetes Status and Cognition We constructed crude models and multiple linear regression models to assess the association between undiagnosed diabetes and cognitive function. The results were presented in Table 3. After adjusting for potential confounding variables discussed in the Table 2, subjects with undiagnosed diabetes showed lower executive function scores compared with nondiabetics(P < 0.01). However, this study did not find the statistical association between undiagnosed diabetes and episodic memory based on the full sample (P > 0.05). Subgroup analysis Weighted linear regression models were constructed to analyze the relationship between undiagnosed diabetes and cognition function in age-stratified subsamples. As demonstrated in Table 4, in the age stratum of ≥65 years, after adjusting for potential confounding variables, the subjects with undiagnosed diabetes performed worse cognitive scores both in executive function and episodic memory compared with the nondiabetics (P < 0.01). In addition, significant differences in episodic memory performance were found between undiagnosed diabetes and diagnosed diabetes (P < 0.05). No such differences were noted in any other age group. However, the estimated coefficient of diagnosed DM in adjusted model was 0.374 (P < 0.05) within the 45-54 years of age group. Discussion In the present study, we explored the association between undiagnosed diabetes and cognitive function including executive function and episodic memory based on a nationally representative research of 9855 participants aged 45 years and older in China. Findings showed a high proportion (49.3%) of undiagnosed diabetes among the diabetic population, which was similar to the prevalence reported by the IDF Diabetes Atlas and other studies. Mainly, people with undiagnosed diabetes performed worse cognitive function than those who were diagnosed with diabetes and nondiabetics, especially individuals older than 65 years. Characteristics Executive Function (t) Episodic Memory (t) Gender ("female" as reference) 0.674 *** (9. Substantial evidence on the relationship between diabetes and cognitive impairment had been reported. Diabetes could predict increased incidence of cognitive impairment and dementia. Based on a cohort study, Rawlings et al. found that diabetes in midlife was associated with a 19% greater cognitive decline over 20 years. The pathophysiological mechanisms of cognitive impairment are still obscure, and diabetes is a risk factor for cognitive dysfunction. It is likely that hyperglycemia, insulin resistance, diabetic complications, and brain structural changes play significant roles in the pathogenic process. However, this study did not provide adequate evidence to support such hypothesis that people with diabetes had a higher risk of developing cognitive impairment (executive function and episodic memory), even after adjusting for potential confounders that could be related to cognitive function (i.e., age, gender, marriage, education, health status, and other factors). This finding was consistent with previous research. Patients with diabetes were not subjected to cognitive impairment considering that treatment for diabetes might reduce the risk of dementia. Individuals diagnosed with diabetes were treated with medication (such as metformin and ranolazine) or changing behaviors and lifestyle, and all of them could slow down the process of cognitive deterioration. Zhang li et al. also reported that untreated diabetes and HbA1c were the potential risk factor for cognitive impairment using the baseline data of CHARLS, and suggested that more longitudinal studies were needed to confirm the effect. In our study of full sample (n = 9855), we found the significant relationship between undiagnosed diabetes and executive function based on multiple linear regression analysis controlling for other confounding factors. When compared to participants without diabetes and diagnosed with diabetes, participants having not yet reported being diagnosed with diabetes showed worse executive function (P < 0.01). Undiagnosed diabetes was a potential risk factor for cognitive impairment, especially for executive function. In the same line, previous studies also revealed the effect of undiagnosed diabetes on the association between diabetes and cognitive function. According to the research of Cochar-Soares et al., when undiagnosed diabetics were misidentified as diabetics or Table 3 Association between different diabetes status and cognition Adjusted model: adjusting significant covariates mentioned in Table 2 Statistical significance test: ** P < 0.01, * P < 0.05 Crude model (t) Adjusted model (t) Crude model (t) Adjusted model (t) Diabetes Table 4 Association between diabetes status and cognition among different age groups Adjusted model: controlling for significant covariates except age group mentioned in Table 2 Statistical significance test: *** P < 0.001, ** P < 0.01, * P < 0.05 nondiabetics, the strength of the relationship between diabetes and impaired memory could been attenuated. Analogously, in a cross-sectional study of 1033 Mexicans aged ≥50 years, Brian Downer et al. reported the similar underestimated association. The association of diabetes with cognitive impairment decreased by 6.3% when undiagnosed diabetics were considered as nondiabetics and by 30.4% when undiagnosed diabetics were categorized as the diabetics. However, interestingly, the association between undiagnosed diabetes and episodic memory was not found in present study (P > 0.05). The dissimilarity in the relationship between diabetes and cognitive function may be affected by the differences in sociodemographic characteristics among different regions or countries. Episodic memory was evaluated by immediate word recall and delayed word recall, obviously, which depended largely on the age and the education level of the participants. In the current study, we concluded that age was the factor negatively influencing episodic memory, and the older the age, the poor the episodic memory. Furthermore, people with a higher level of education were more likely to have better memory. These findings suggested that further studies were required to articulate their associations. Additionally, to examine whether the relationship between undiagnosed diabetes and cognitive function was age-dependent, the participants were classified into three age strata (45-54, 55-64, and ≥ 65 years), and weighted multiple linear regression models were performed separately in the three groups. In the age group of ≥65 years, a similar conclusion was found that people with undiagnosed diabetes showed poorer executive function than those without diabetes. But statistically significant difference in episodic memory performance between undiagnosed diabetes and non-diabetes was also demonstrated. Combining previous results, our study provided some additional evidence to support the association between undiagnosed diabetes and cognitive function, especially in elderly population. In 45-54 age group and 55-64 age group, participants with undiagnosed diabetes failed to show any such difference in the domain of executive function and episodic memory compared to nondiabetics and diabetics. There had been evidence to support that cognitive impairment was associated both with diabetes duration, but also with age. As expected, patients being older or having a longer duration of diabetes mellitus tended to preform worse cognitive function. This suggested that prevention and control of diabetes mellitus in middle age may help to retard cognitive decline later in life. From this point, early screening and diagnosis of this metabolic disturbance could provide an effective way to promote cognitive health of diabetic people. In the three age groups, we did not arrive at the conclusion that people with diabetes performed worse cognitive function than those without diabetes, and this was consistent with the results based on the whole sample. Even in the 45-55 age group, patients diagnosed with diabetes showed better executive function than those without diabetes. Therefore, more in-deep research should be conducted to elaborate the association between diabetes and cognition. Variable of interest Executive Function There were some limitations in our study. First, the present results were based on the cross-sectional study design, and causal relationship between undiagnosed diabetes and cognitive function could not be inferred. Therefore, prospective longitudinal studies are needed to confirm the effect of undiagnosed diabetes on cognitive impairment in the near future. Second, although we adjusted for substantial confounding variables, the possibility of residual confounders remained in our analysis. Third, the data could be prone to recall bias and measurement error. Recall bias was intrinsic in the fact that frequent and severe conditions were more likely to be remembered. Measure error was possible in height, weight and blood test. Other limitations including some missing data for variables of interest in CHARLS questionnaire might cause sampling bias. Despite above limitations, the study also has a number of key strengths. First, the findings were based on a nationally representative research design of middleaged and elderly people in China, which provided a large sample size and good representativeness for our research. Second, strict quality control and standardized measurement were performed in every stage of the research process, so the quality of current study can be guaranteed. Conclusions To conclude, the cross-sectional study suggested that undiagnosed diabetes was the potential risk factor for cognitive dysfunction, especially in the age group of ≥65 years old. In addition, we did not notice that people with diabetes performed worse cognitive function than those without diabetes. Based on current studies, it is an important point that timely diagnosis, early prevention and the optimum treatment of diabetes may contribute to slowing the progress of cognitive deterioration. Thus, governments, communities and public health departments should enhance the diagnosis, treatment, and prevention of diabetes mellitus. Given the large proportion of undiagnosed diabetes and complexity of diabetes complications, more observational, experimental and clinical studies remain to be developed with larger sample sizes, longer follow-up, and more detailed measurements of cognitive function.
Reggie Bush said Wednesday that the Detroit Lions' lack of discipline has hurt the team during a span in which it has lost four of five games and ceded control of its playoff destiny. "It could be from penalties or it could be from turnovers or it could be from how we finished the games in fourth quarters," the running back said. "It's not one specific play or moment in a game. It's the total game. It's how we play." Bush, however, pinned the team's discipline problems on the players and not coach Jim Schwartz, whom he called a "disciplinarian." "It's not a coaches' thing. It's a players' thing. We can do a better job all across the board," Bush said. "As far as an offense standpoint, turn the ball over and that's the discipline issue, and that's something we have to correct, because obviously, as you see, it'll lose you games." Schwartz said Wednesday that he wasn't aware of Bush's comments but that he doesn't believe the Lions have a discipline problem. Receiver Nate Burleson agreed that the onus falls on the players to fix their issues.
The Mission Accessible Near-Earth Objects Survey: Four years of photometry Over 4.5 years, the Mission Accessible Near-Earth Object Survey (MANOS) assembled 228 Near-Earth Object (NEO) lightcurves. We report rotational lightcurves for 82 NEOs, constraints on amplitudes and periods for 21 NEOs, lightcurves with no detected variability within the image signal to noise and length of our observing block for 30 NEOs, and 10 tumblers. We uncovered 2 ultra-rapid rotators with periods below 20s; 2016MA with a potential rotational periodicity of 18.4s, and 2017QG$_{18}$ rotating in 11.9s, and estimate the fraction of fast/ultra-rapid rotators undetected in our project plus the percentage of NEOs with a moderate/long periodicity undetectable during our typical observing blocks. We summarize the findings of a simple model of synthetic NEOs to infer the object morphologies distribution using the measured distribution of lightcurve amplitudes. This model suggests a uniform distribution of axis ratio can reproduce the observed sample. This suggests that the quantity of spherical NEOs (e.g., Bennu) is almost equivalent to the quantity of highly elongated objects (e.g., Itokawa), a result that can be directly tested thanks to shape models from Doppler delay radar imaging analysis. Finally, we fully characterized 2 NEOs as appropriate targets for a potential robotic/human mission: 2013YS$_{2}$ and 2014FA$_{7}$ due to their moderate spin periods and low $\Delta v$. Our MANOS project started about 4.5 years ago and aspires to characterize mission accessible NEOs. Our project is designed to fully characterize NEOs, providing rotational lightcurves, visible and/or near-infrared reflectance spectra and astrometry. Such an exhaustive study will give us the opportunity to derive general properties regarding compositions, and rotational characteristics. Because existing physical characterization surveys have primarily centered on the largest NEOs with size above 1 km, MANOS mainly targets sub-km NEOs (;;;). Our project is split in two main parts: i) spectroscopy to provide surface composition, spectral type, taxonomic albedo and infer the object's size, and ii) photometry to provide rotational properties and astrometry. Below, we center our attention on the rotational characteristics of the MANOS NEOs extracted from the photometry. Here we present new data combined with results from Thirouin et al.. Thanks to this homogeneous sample of 228 NEOs, we can perform statistical studies and understand the rotational characteristics of the small NEOs in comparison to the larger NEOs. Following, we briefly present our survey strategy and data analysis, in addition to present our lightcurves. Sections 5 and 6 are for our results derived from lightcurves and their implications. Section 7 details our simple model to create three synthetic population of lightcurves assuming different axis ratio distribution for comparison with the literature and our observations. The last section summarizes our conclusions. MANOS: OBSERVING PLAN, FACILITIES, DATA ANALYSIS In approximately 4.5 years, MANOS observed 308 NEOs for lightcurves (86 objects in Thirouin et al., 142 here, and the remainder will be reported in a future work). Figure 1 summarizes the objects observed by MANOS with NEOs from the LCDB 1 (). The LCDB contains 1,359 entries for NEOs, and 1,147 have a rotation estimate (objects with a constraint for the period are not considered). The LCDB distribution peaks at H∼17 mag (i.e., NEO with a diameter of D∼1 km for a geometric albedo of 20%, Pravec & Harris ), whereas for the MANOS sample the peak is at H∼24 mag (i.e., D∼45 m). MANOS employs a set of 1 to 4 m telescopes for photometric purposes: 1.3 m Small and Moderate Aperture Research Telescope System (SMARTS) telescope at CTIO, the 2.1 m and the 4 m Mayall telescopes at Kitt Peak Observatory, the 4.1 m Southern Astrophysical Research (SOAR) telescope, and the Lowell's Observatory 4.3 m Discovery Channel Telescope (DCT). A complete description of these facilities, used instruments and filters is available in Thirouin et al.. In January 2016, Mosaic-1.1 was replaced by Mosaic-3 at the Mayall telescope. This new instrument is also a wide field imager with four 40964096 CCDs for a 36 36 field of view and 0.26 /pixel as scale. Our observing method and data reduction/analysis is summarized in Thirouin et al.. Periodograms are in Appendix A whereas the lightcurves 2 are in Appendix B. Typical photometric error bars are ±0.02-0.05 mag, but can be larger in some cases especially with small facilities, faint objects or fast moving objects. MANOS: PHOTOMETRY SUMMARY For this work, we classified the lightcurves in four main categories: i) full lightcurve with a minimum of one entire rotation or a large portion of the lightcurve to estimate a periodicity, ii) partial lightcurve showing a decrease or increase of the visual magnitude, but with not enough data for a period estimate, iii) flat lightcurve with no obvious increase/decrease in variability and no period detected, and iv) potential tumblers with or without the primary period (or shortest period, Pravec et al. ). We have full lightcurves for 82 NEOs 3 (∼57% of our dataset), lower limits for periodicity and amplitude for 21 NEOs (∼15%), flat lightcurves for 30 NEOs (∼21%), and 10 NEOs are potential tumblers (∼7%) (see Figure 2). We present two lightcurves (one flat and one full) for 2014 WU 200. This case will be discussed below. MANOS found the fastest known so far rotator: 2017 QG 18 with a rotation of 11.9 s. This object was imaged at DCT in August 2017, and the lightcurve has a variability of about 0.21 mag. The typical photometry error bar is 0.05 mag. We discovered the potential ultra-rapid rotator: 2016 MA. MANOS observed this object in June 2016, and measured a short period of 18.4 s. The typical photometry error bar is 0.05 mag. The lightcurve displays low variability with a full amplitude of 0.12 mag. Unfortunately, the confidence level of this periodicity is low (i.e., <99.9% confidence level stated for a period estimate) and more data are required to infer if 2016 MA is a ultra-rapid rotator or not. In summary, MANOS discovered four ultra-rapid rotators with periodicities below 20 s: 2014RC, 2015SV 6, 2016MA, and 2017QG 18 (Thirouin et al. (2016, and this work). Asymmetric/Symmetric and Complex lightcurves Only three NEOs display a symmetric lightcurve: 2014 UD 57, 2014 WF 201, and 2017 LD, whereas 66 have a bimodal lightcurve with two different peaks 4 (i.e. asymmetric curve). Majority of the MANOS NEOs has an asymmetry <0.2 mag, but sometimes, the difference is higher: 2013 SR and 2015 KQ 120 with an asymmetry of ∼0. Reasons fr this morphology are: i) complex shape (NEOs far from spherical/ellipsoidal shapes), and/or ii) albedo contrast, and/or iii) satellite. More observations in different geometries will be useful for shape modeling and to probe for a companion. Unfortunately, most of them won't be brighter than 21 mag in the upcoming decade. Partial lightcurves Twenty-one objects display an increase/decrease in magnitude (red arrows Figure 2). We did not calculate a secure periodicity because our observations spanned less than 50% of the NEO's rotation. For example, 2016 JD 18 was imaged with Lowell's DCT for a span of ∼0.5 h. The partial lightcurve presents a large amplitude of ∼1.2 mag and a feature possibly suggesting a complex shape. Tumblers We found ten potential tumblers: YG, 2014DJ 80, 2015CG, 2015HB 177, 2015LJ, 2016FA, 2016RD 34, 2017EE 3, 2017, and 2017 QW 1. We derive their main periodicities and report them in Table 1. For three of them, we are not capable to deduce the main period. In all cases, our data were insufficient to derive the second period with the Pravec et al. technique. 3 We have 2 lightcurves for 2014 WU 200. Only the full lightcurve is considered for these estimates. 4 Tumblers are not considered in this subsection Flat lightcurves Thirty objects have no detected periodicity in the measured photometry. These flat lightcurves can be due to: i) a long/very long periodicity which was not detected over our observing window, ii) a rapid rotation consistent with the exposing time, iii) a (nearly) pole-on configuration, or iv) a NEO with a spheroidal shape. Below, we discuss these four scenarios by assuming that all small NEOs are fast rotators and large NEOs are slow rotator. Such an assumption is based on the well known rotational period-size relation (Figure 2), but it is important to emphasize that our assumption may not be right for all objects as some small objects have been found to be slow rotators (). Thus, MANOS can be identifying slow or fast rotator in the small size range. Slow rotators As we only dedicate a short observing block per object (typically ∼2-3 h, or shorter in case of weather or technical issues), we are biased against long rotational periods (typically, longer than 5-6 h). Five objects from this work and Thirouin et al. were observed by other teams that derived the following rotation periods: 1994 CJ 1 (∼30 h, Warner ). For 2014 SM 143, the Warner observations and ours are separated by about 8-10 days. In both cases, data were obtained at high phase angle (>50 ). We observed 2014 SM 143 over ∼2.5 h with a typical photometric error bar of 0.1 mag and should have detected such a period, assuming that the period derived by Warner is correct. However, Warner presented a noisy photometry and their period spectrum showed several solutions that were marginally significant. Therefore, authors not confident about their results, and the reported period could be wrong. Our results about 2014 SM 143 are available in Thirouin et al.. In conclusion, 19 large objects (D 100 m) in the full MANOS sample are potential slow rotators (i.e,. ∼8% of the full sample reported in Thirouin et al. and here). Thus, we estimate that at least 43% of our flat lightcurves from this work and our previous paper are caused by slow rotation undetectable over our typical observing blocks. It is crucial to mention that for this estimate, we consider that all large objects are slow rotators which may not be the case for all of them. Pole-on orientation Pole orientations are known for a handful of large NEOs with diameters of several km (e.g., La Spina et al. ;Vokrouhlick et al. ; Benner et al. ). Shape modeling with radar observations and/or lightcurves obtained at different epochs are required to estimate the pole orientation. MANOS targets typically fade in a matter of hours or days, and their next optical window is often decades away, so lightcurves at different epochs/observing geometries are generally not feasible. For fast and small rotators, radar techniques cannot construct the object's shape, and thus no pole orientation is derived. The pole orientation distribution of large objects in the main belt of asteroids (MBAs) is isotropic whereas small MBAs and NEOs (D<30 km) have preferentially retrograde/prograde rotation (;;La ). Vokrouhlick et al. report 38 pole solutions with an excess of retrograde-rotating NEOs, and noticed a clear deficit of small MBAs and NEOs with a pole orientation of 0. The MANOS set is mostly composed of NEOs in the sub-100m range, and unfortunately, there is no comprehensive information about pole-orientation for this size-range. However, if the sub-100m NEOs follow the same trend as small main belt asteroids and large NEOs, then we expect an excess of small bodies with a pole orientation of ∼±90. If the rotation axis of an elongated NEO and the sight line are (nearly-) aligned, the brightness variation due to its rotation will be undetectable. Depending of the aspect angle (), the lightcurve amplitude of an elongated object (a>b>c) is: ∆m = 2.5 log 2 cos 2 + 2c2 sin 2 a 2 cos 2 +c 2 sin 2 where=a/b,b=1, andc=c/b. The likelihood to observe an object pole-on is P = 1-cos (Lacerda & Luu ). As an example, the probability of viewing a small body with a pole-on orientation ± 5 is <1%. Therefore, we estimate that only a few if any of our flat lightcurves are due to a pole-on orientation. Spherical objects Using the previous equation, the largest amplitude will be at =90, and the smallest at =0 and 180. At =90, ∆m=2.5 log(). Therefore, the brightness variability of an almost spherical object will be flat. As said, shape modeling using radar observations and/or lightcurves at different epochs are required to derive the object's shape. However, there are very few shape models available for sub-100m NEO (). Several NEOs with D>200 m have an oblate shape with ridge at the equator or a diamond shape, and they are predicted to be relatively common (). Objects like Bennu, 2008EV 5, 2004DC, 1999KW 4, and 1994 CC have an oblate shape based on radar observations, and a low to moderate lightcurve amplitude with periods longer than 2 h (;;;Taylor 2009;;;;). Assuming that small NEOs are following the same tendency as NEOs with D>200 m, some MANOS NEOs are potentially oblate. Oblate objects appear to have long rotational periods that are consistent with/longer than the length of our runs. Therefore, some of our flat lightcurves are potentially caused by oblate objects. Unfortunately, as there is no estimate for the quantity of oblate rotators (independent of size) or if small NEOs have the tendency to be oblate, we cannot propose a clear percentage. Fast rotators The periodicities of small NEOs (D<100m) may be undetected as a result of "long" exposure times. For example, we report two lightcurves for 2014 WU 200. One of the lightcurves is flat, but the second displays periodic photometric variations. The first lightcurve was obtained on November 26 th 2014 at DCT. The visual magnitude of 2014 WU 200 was 20.7 mag (MPC estimate). Due to the faintness and bad atmospheric conditions, we selected an exposing time of 45-55 s (+read-out of 13 s). The typical photometry error bar was 0.03 mag for the DCT data. We re-observed with the Mayall telescope this object few days later when the magnitude was 20.1 mag (MPC estimate). In this case, we employed 10 s as exposure time (+11 s of read-out time), and we favored a rotation of ∼64 s. The typical photometry error bar was 0.05 mag for the Mayall data. Therefore, the exposing time used at DCT was too long to derive such a short period. Some of our objects with flat lightcurves were imaged with exposing times between 30 s to 300 s. These values were selected for a decent signal to noise, but these times may not have been optimal to sample the lightcurve and so no periodic photometric variations were detected. We estimate that 23 MANOS NEOs are maybe fast to ultra-rapid rotators whose rotation was undetected due to a "long" exposing time and/or the bad weather conditions 5. Small NEOs are commonly rotating fast (Figure 2), and if so, 52% of our flat lightcurves from this work and Thirouin et al. are potentially due to small ultra-rapid/fast rotators. For fast/ultra-rapid NEOs rotating in few seconds or few minutes, the exposure time is important. Following, the optimum exposure time (T opt exp ) to detect a lightcurve with two harmonics is: with P as the object's periodicity (Section 2 of ). This relation is based on theory and does not reflect a specific observing strategy. Because we know the exposing time during our observations, we can figure out the detectable rotational period. For example, with T exp =11 s, we will perfectly sample the lightcurve of a small body rotating in 1 min or more. In this case, an object rotating in 1 min will have a flat lightcurve and thus its rotation will be undetectable. In Figure 3, the continuous line is for Equation 2 for a perfectly sampled two harmonic lightcurve. Data points are MANOS NEOs imaged with our 4-m facilities. Objects below the continuous line have over-sampled lightcurves whereas above this line the lightcurves are under-sampled. The dash line in Figure 3 represents an empirical upper limit to the period-exposure time relationship using the MANOS dataset and can be articulated as: This relation would converge to Nyquist sampling theory in a regime of infinite signal-to-noise-ratio. For the smallest objects, and thus potentially fast to ultra-rapid rotators, using Equation 3 we can identify the rotational period to which we were sensitive based on object-specific exposure time. Using Equation 2, and Equation 3, we have two lower limits for the potential rotational periods.Therefore, if these objects have a rotational period between these two estimates, we should have detected it. In conclusion, the rotational period is likely shorter than the estimate and thus we undetected it in our observing block (assuming that the objects have a two harmonics lightcurve). But, it is also important to emphasize that some small objects (sub-100m objects), even if they are expected to rotate fast, some might be slow rotators ( Figure 2). PHYSICAL CONSTRAINTS A strenghtless rubble-pile will not be able to rotate faster than about 2.2 h without breaking up (). But, most small NEOs have rotational periods of a few seconds or minutes. Therefore, an explanation of these rapid rotations is that NEOs are bound with tensile strength and/or cohesive instead of just gravity. Using Holsapple (2004Holsapple (, 2007, we calculated the maximum spin limits assuming different densities and tensile strength coefficients for the NEO population. Following Richardson et al., we considered a friction angle of 40, and moderately elongated ellipsoids (c/a=b/a=0.7). We used two values for the density; 2 (Itokawa ()) and 5 g cm −3 (density of a stony-iron object (Carry 2012)), and two tensile strength coefficients, 10 5, and 10 6 N m −3/2 (range of tensile strengths for Almahata Sitta, Kwiatkowski et al. ). Five MANOS targets require a tensile strength coefficient between 10 5 -10 6 N m −3/2 : 2014 FR 52, 2014 PR 62, 2015 RF 36, 2016 AD 166, and 2016 AO 131. POTENTIAL MISSION TARGETS One of our goals is to find favorable target(s) for a future mission to a NEO, and thus mission accessibility is one of our selection criteria (;;). For this purpose, we estimate the velocity change for a Hohmann transfer orbit also known as ∆v. A rough guess of the ∆v is estimated with the Shoemaker & Helin protocol (∆v SH ). In order to obtain an accurate estimate, one can use the Near-Earth Object Human Space Flight Accessible Targets Study (NHATS) orbital integration, ∆v N HAT S 7. NHATS uses specific constraints to compute the ∆v N HAT S : i) Launch before 2040, ii) Total mission duration ≤450 days, and iii) Number of days spent at the object ≥8 days. The NHATS limit is ∆v N HAT S of 12 km s −1. Several of our targets are not following these criteria and so, no ∆v N HAT S are available for them (Table 1). According to NHATS, 78 MANOS NEOs are accessible by a spacecraft (Table 2, and Table 2 in Thirouin et al. ). For diverse reasons, Abell et al. consider that the best target for a mission should have a moderate to slow rotation (P>1 h). Only 9 MANOS NEOs have such a long rotation, have a ∆v N HAT S ≤ 12 km s −1 ; and have been observed for spectroscopy (Table 2, and Table 2 in Thirouin et al. ). We will present spectral results for these objects in future publication(s). Finally, we note that several non-fully characterized MANOS NEOs have a new optical window in the upcoming years or decades. For example, the low ∆v N HAT S and slow rotator 2013 XX 8 (spectral type unknown) will have a new optical window in 04/2019 and thus we will have an opportunity to fully characterize this potential target. MANOS+LCDB VERSUS SYNTHETIC POPULATION In this section, we aim to compare our results to a synthetic population of NEOs to identify biases regarding our measured amplitude distribution and to constrain the distribution of morphologies in the NEO population. In a first step, we create 10,000 synthetic objects and calculate their lightcurve amplitude versus aspect angle. In a second step, we "observationally sample" this synthetic population based on prescribed phase angles, in order to compare our synthetic population with the MANOS+LCDB data set. Step 1: -Assuming that NEOs are prolate ellipsoids (with b=c) at a phase angle of 0, the amplitude varies as: where is the aspect angle, and b/a is the elongation of the object (Michalowski & Velichko 1990). The aspect angle is: where p and p are the object's north pole ecliptic latitude and longitude, and g and g are the object geocentric ecliptic coordinates (Michalowski & Velichko 1990). We use Equation 5 to generate the lightcurve amplitude of 10,000 synthetic objects. The only two free parameters in this equation are the axis ratio b/a and the viewing angle. In theory, the axis ratio b/a varies from 0 to 1. However, for objects visited by spacecraft, Eros 8 is the most elongated with a ratio b/a=0.32 (). Thus, we limit the axis ratio b/a between 0.32 and 1 (spherical object). We considered three possible axis distributions for our synthetic population: i) a uniform distribution of b/a, ii) one distribution with an excess of spheroidal objects and iii) one with an excess of elongated objects ( Figure 5, upper panel). The second parameter is the aspect angle ranging from from 0 to 90 (absolute value). La Spina et al. ;Vokrouhlick et al. noticed an excess of retrograde-rotating NEOs (based on a limited sample) which would imply that the observed distribution of pole orientations is not uniform. We updated the distribution of poles reported in Vokrouhlick et al. with newest results from the LCDB (multiple systems have been excluded from the distribution as we do not expect any small NEO as binary/multiple, Margot et al. ). With the newest results, the pole distribution is still consistent with the Vokrouhlick et al. result. Using our updated pole distribution, we created a non-uniform distribution of pole orientation and thus a distribution of ( p ; p ). Even though most of the objects with a known pole orientation are large objects, and we assume that the pole orientation of the small objects is similar that of large objects. This assumption might be wrong and will need to be tested once more pole orientations of small objects are known. The typical uncertainty on pole orientation is about ±10 based on radar and lightcurve inversion results, so we estimated the number of objects within a grid of 10 10. We use the number density of objects in this grid of pole coordinates to randomly assign a pole orientation to each of our 10,000 synthetic objects. Equation 6 also depends on the geocentric ecliptic coordinates ( g ; g ). For the MANOS sample, we use the zero phase of our lightcurve to estimate the ( g ; g ) of our objects. In order to present the most accurate sample, we also incorporated the LCDB objects with H>20 mag. Unfortunately, authors generally did not report the zero phase timing of their lightcurves. So, we used approximate coordinates for those objects based on the observing nights reported in the literature. Once ( g ; g ) are estimated for the MANOS+LCDB sample, we created a grid of geocentric ecliptic coordinates of 10 10. Such a grid allowed us to take into account the approximate coordinates of the LCDB objects 9. Therefore, we created a distribution of ( g ; g ) based on the observations from the MANOS+LCDB sample (Figure 4, upper plot). Using this and the distribution of ( p ; p ), we calculated the distribution of aspect angles (Equation 6) which is then used as input to Equation 5 to calculate a synthetic population of lightcurve amplitudes at zero phase. Step 2: -As the aspect angles of our observed sample are unknown, we cannot compare directly our dataset and the synthetic population. However, we can effectively observe our synthetic objects by assigning a phase angle based on the observed distribution of phase angles for MANOS+LCDB objects. By merging Equation 4 and Equation 5, we estimate the lightcurve amplitude of our synthetic population at these prescribed phase angles. In Figure 4, we plot the MANOS sample and the LCDB objects with a H>20 mag and a phase angle lower than 100. We limit this analysis to small objects observed at a phase angle between 0 and 100 in order to mimic the MANOS sample. Based on Figure 4 (lower plot), it is obvious that the MANOS and LCDB observations are not uniform with phase angle. In fact, both data sets have an excess of objects observed at low/moderate phase angle (up to ∼40 ), and only an handful of objects are observed at high phase angle (>80 ). Drawing from the distribution of MANOS+LCDB objects, we create a non-uniform distribution of phase angles for our synthetic population (Figure 4, lower panel), and then calculate the amplitude of our 10,000 synthetic objects. In Figure 5 (lower panel), we plot the normalized histogram of lightcurve amplitude for the synthetic population and the MANOS+LCDB samples. Error bars are 1/N with N being the number of objects per bin. We limit our distribution to lightcurve amplitude up to 1.5 mag as only a handful of objects with higher lightcurve amplitude are reported. Generally, low lightcurve amplitude objects are difficult to obtain as they require a large amount of observing time under good weather conditions. In addition, observers have the tendency to not report or publish flat lightcurves. Therefore, there is a clear bias in the LCDB regarding these low amplitude objects, and thus we do not take into account objects with a lightcurve amplitude <0.1 mag. In Figure 5 (lower panel), we plot our three synthetic populations (uniform distribution of b/a, an excess of spherical objects and an excess of elongated objects) for amplitudes between 0.1 mag and 1.5 mag. In order to compare the simulated population and the observed sample, we calculate the 2 per degree of freedom: 9 In case of observations during close approach, some objects may move more than 10 10 and thus are not in the right grid, however it is a small number of objects and this will not change the main conclusion of our simulations. where is the degree of freedom, ∆m i are the observed data, f(∆ m i ) are the simulated results, and i are the uncertainties (i is the index of the bin and n is the bin number). Comparing the MANOS+LCDB data with the excess of elongated object distribution, we find a 2 / of 2.67. The MANOS+LCDB sample compared to the excess of spherical object distribution gives us a 2 / of 1.17, whereas compared to the uniform distribution the 2 / is 0.31. This suggests that a uniform distribution of b/a best fits the observed sample. Our model assumes a basic uniform distribution of b/a for prolate ellipsoids. Future improvements to this model could employ more realistic shapes based on radar observations and/or lightcurve inversion. SUMMARY/CONCLUSIONS We report full lightcurves for 57% of our sample (82 NEOs), and constraints for the amplitude and period are reported for 21 NEOs. Thirty NEOs do not exhibit any periodic variability in their lightcurves. We also report 10 potential tumblers. MANOS found a potential new ultra-rapid rotator: 2016 MA. This object has a potential periodicity of 18.4 s. The confidence level of this periodicity is low and more data are required to confirm this result. Unfortunately, there is no optical window to re-observe this object until 2025, and even then it only reaches V∼22.5 mag. We also uncovered the fastest rotator to date, 2017 QG 18 rotating in 11.9 s. Several MANOS targets display a flat lightcurve. Because of the well known relation between size and rotational period, we can infer that large objects (D>100 m) are slow rotators and their rotational periods were undetected during the amount of observing time dedicated. Based on this size dependent cut, we estimate that 43% of our flat lightcurves are slow rotators with a rotational period longer than our observing blocks. A flat lightcurve of a small NEO can be attributed to fast/ulra-rapid rotation which goes undetected because of the long exposing time used to retrieve a good signal-to-noise ratio. We suggest that 52% of our flat lightcures are potential fast/ultra-rapid rotators. We use the size of the object as a main criteria for these findings. This is an acceptable approximation, but may not be true for all the objects. We present a simple model to constrain the lightcurve amplitude distribution within the NEO population. One of the main parameters of our model is the b/a axis ratio of an object. We create several axis distributions, using an uniform distribution as well as an excess of spherical and elongated objects. Assuming that the pole orientation distribution reported in Vokrouhlick et al. is representative of the NEO population, we generate 10,000 synthetic ellipsoids. We inferred that an uniform distribution of b/a best matches the observed sample. This suggests that the number of spherical NEOs is roughly equivalent to the number of highly elongated objects. A total of 78 MANOS objects are mission accessible according to NHATS which assumes a launch before 2040. However, considering only fully characterized objects, and NEOs rotating in more than 1 h, our sample of viable mission targets is reduced to 9 objects: 2002 DU 3, 2010 AF 30, 2013 NJ, 2013 YS 2, 2014 FA 7, 2014 FA 44, 2014 YD, 2015 FG 36, and 2015 OV. Two of these 9 objects will be bright enough during their next observing windows for new and complementary observations: 2013 YS 3 will have a V∼18 mag in December-January 2020, and the visual magnitude of 2002 DU 3 will be 20.6 mag in November 2018. Authors acknowledge the referee for useful comments to improve this work. Lowell operates the Discovery Channel Telescope (DCT) in partnership with Boston University, the University of Mary-land, the University of Toledo, Northern Arizona University and Yale University. Partial support of the DCT was provided by Discovery Communications. LMI was built by Lowell Observatory using funds from the National Science Foundation (AST-1005313). This work is also based on observations obtained at the Southern Astrophysical Research (SOAR) telescope, which is a joint project of the Ministrio da Cincia, Tecnologia, e Inovao (MCTI) da Repblica Federativa do Brasil, the U.S. National Optical Astronomy Observatory (NOAO), the University of North Carolina at Chapel Hill (UNC), and Michigan State University (MSU). We also used the 1.3 m SMARTS telescope operated by the SMARTS Consortium. This work is based in part on observations at Kitt Peak National Observatory, National Optical Astronomy Observatory (NOAO Prop. ID:2013B-0270), which is operated by the Association of Universities for Research in Astronomy (AURA) under cooperative agreement with the National Science Foundation. This research has made use of data and/or services provided by the International Astronomical Union's Minor Planet Center. Authors acknowledge support from NASA NEOO grants NNX14AN82G, and NNX17AH06G. D. Polishook is grateful to the Ministry of Science, Technology and Space of the Israeli government for their Ramon fellowship for post-docs. a MANOS obtained spectra and lightcurves for two good spacecraft targets (italic/bold), but we also summarize all NEOs with a rotational period longer than 1 h. For completeness purposes, ∆v SH and ∆v N HAT S following the Shoemaker & Helin protocol and the NHATS parameters are summarized. The start of the next opportunity to observe these objects according to NHATS is also shown (https://cneos.jpl.nasa.gov/nhats/). b =2 g cm −3, =10 5 N m −3/2 b =2 g cm −3, =10 6 N m −3/2 b =5 g cm −3, =10 5 N m −3/2 b =5 g cm −3, =10 6 N m −3/2 Figure 2. MANOS objects with a full lightcurve (red squares), NEOs with a lower limit to their rotations (red arrows), and tumblers (gray asterisks) are plotted. The red continuous line is the spin barrier at ∼2.2 h. Blue and green lines are the maximum spin limits assuming different densities and tensile strength coefficients. NEOs from the LCDB are also plotted (green circles). Under-sampled Perfectly sampled Over-sampled Figure 3. Red squares are the MANOS objects with a rotational period estimate. The blue continuous line indicates the relation between exposure time and rotational period for a perfectly sampled lightcurve with two harmonics. Objects below this line have an over-sampled lightcurve, and objects above it have an under-sampled lightcurve. Some MANOS objects have an under-sampled lightcurve, but we were able to derive their rotational period. See Section 4 for more details. Figure 4. We used the MANOS+LCDB sample (red squares+blue circles) to create a distribution of geocentric ecliptic coordinates for our synthetic population (black dots). As the aspect angle is unknown for our objects, we express the lightcurve amplitude as a function of phase angle. Following the procedure presented in Section 7, the lower panel reports the lightcurve amplitude biased by phase angle of our synthetic population in the case of an uniform distribution of axis ratio. We overplotted the MANOS and LCDB samples for comparison. The synthetic population and the observations are in agreement. APPENDIX APPENDIX B Lightcurves of objects reported in this work.
Prevalence, healthcare resource utilization and overall burden of fungal meningitis in the United States Purpose. Previous epidemiological and cost studies of fungal meningitis have largely focused on single pathogens, leading to a poor understanding of the disease in general. We studied the largest and most diverse group of fungal meningitis patients to date, over the longest followup period, to examine the broad impact on resource utilization within the United States. Methodology. The Truven Health Analytics MarketScan database was used to identify patients with a fungal meningitis diagnosis in the United States between 2000 and 2012. Patients with a primary diagnosis of cryptococcal, Coccidioides, Histoplasma, or Candida meningitis were included in the analysis. Data concerning healthcare resource utilization, prevalence and length of stay were collected for up to 5 years following the original diagnosis. Results. Cryptococcal meningitis was the most prevalent type of fungal meningitis (70.1 % of cases over the duration of the study), followed by coccidioidomycosis (16.4 %), histoplasmosis (6.0 %) and candidiasis (7.6 %). Cryptococcal meningitis and candidiasis patients accrued the largest average charges ($103 236 and $103 803, respectively) and spent the most time in the hospital on average (70.6 and 79 days). Coccidioidomycosis and histoplasmosis patients also accrued substantial charges and time in the hospital ($82 439, 48.1 days; $78 609, 49.8 days, respectively). Conclusion. Our study characterizes the largest longitudinal cohort of fungal meningitis in the United States. Importantly, the health economic impact and longterm morbidity from these infections are quantified and reviewed. The healthcare resource utilization of fungal meningitis patients in the United States is substantial.