text
stringlengths 1
964k
| meta
dict |
|---|---|
Receive the latest national-international updates in your inbox
A growing Powerball jackpot triggers long lines for lottery tickets. Wednesday night's drawing for the $425 million jackpot is set to be the third largest in Powerball history. (Published Wednesday, Aug. 7, 2013)
A Minnesota man came forward Thursday to claim one of three winning tickets in the $448 million Powerball jackpot.
The man was at lottery headquarters in Roseville, Minn., where officials were verifying the ticket, Ed Van Petten, executive director of the Minnesota Lottery said. If the ticket is proved valid, an announcement could come later in the day.
State lottery officials did not provide further information about the man.
Three winning Powerball tickets were sold - two in New Jersey and one in Minnesota - for the $448 million Powerball jackpot - one of the largest in American history. The winning numbers were drawn Wednesday night at 10:59 p.m. ET.
Just before the Wednesday night drawing, Powerball officials announced that the jackpot had increased from $425 million to $448 million - the fourth largest lotto jackpot ever. The winning tickets were sold at a Super Stop n Shop in South Brunswick, N.J., at Acme Markets #7858 in Little Egg Harbor, N.J., and in Anoka County, Minn., part of greater Minneapolis-St. Paul, lottery officials announced Thursday.
The jackpot started as a $40 million prize on June 26 and is the result of 12 draws without a jackpot winner.
The biggest jackpot in American history was $656 million, divided among three winners last year in Illinois, Kansas and Maryland, according to NBC News. That was a Mega Millions win, which is also played in 43 states.
The largest Powerball payout was in May, when an 84-year-old Florida widow named Gloria McKenzie hit the $590 million jackpot.
In November 2012, winners in Missouri and Arizona split a $587 million Powerball prize.
Powerball is played in 43 states plus Washington, D.C., and the U.S. Virgin Islands.
Odds of winning the jackpot prize are one in 175,223,510, and overall odds of winning any prize are one in 32.
|
{
"pile_set_name": "Pile-CC"
}
|
Q:
Who is Mr. Gold in the movie Revolver?
I have loved the movie Revolver and I cannot control my urge of fully understand it. From what I could make out of the movie, it is purely an analogy to chess. The characters of the movie are all pieces of the chessboard.
So who is Mr. Gold? Please give valid explanations to your theory!
A:
From the Wikipedia page on the movie:
Sam Gold is seen to be the 'king' in this chess game of gang warfare.
He is the ultimate figure that all men are supposedly aspiring to be.
Sam Gold is revealed to be an ultimately powerless cipher, whose power
is granted only by those who invest in him. He represents ego and
self-investment. He is the personification of greed
A:
The movie isn't an analogy to chess. The movie is about the illusion that imprisons every one of us.
Deep beneath the films violence, blood and grit, lurks a spiritual and enlightening message - a message echoed throughout time by revered figures such as Buddha and Bodhidharma, a message also echoed in Kabbalah (which is probably where Guy Ritchie drew his inspiration from, as his then-wife, Madonna, is heavily into Kabbalah). And that message is this: we are not our ego; the ego, far from being our friend, is responsible for most of our pain and misery; the ego is a product of the mind and creates the illusion of separation, the ego is a prison, a prison that very few people recognise as such.
To answer your question: Mr. Gold is everyone's ego. In Jake's case, Mr. Gold is the part of Jake who wants to kill Macha.
|
{
"pile_set_name": "StackExchange"
}
|
123 Cal.App.2d 345 (1954)
C. DANIELS, Respondent,
v.
ROY W. PITMAN, Appellant.
Civ. No. 19838.
California Court of Appeals. Second Dist., Div. Two.
Feb. 18, 1954.
Samuel A. Rosenthal and Norman Warren Alschuler for Appellant.
Jacob Paull for Respondent.
McCOMB, J.
Defendant appeals from orders denying (1) his motion to set aside a default judgment pursuant to the provisions of section 473 of the Code of Civil Procedure, and (2) his motion to reconsider the previous order.
Facts: Plaintiff commenced an action to recover the sum of $4,000 representing a balance of defendant's indebtedness of $7,000 to plaintiff's assignor which was evidenced by a writing executed by defendant.
The case was originally set for trial July 27, 1951, but due to the fact that certain depositions had not been returned it was ordered off calendar. *346
April 1, 1952, the commissioner appointed to take the depositions wrote a letter to the attorney of record for defendant enclosing copies of the interrogatories and cross-interrogatories put to the witnesses, and advising him that the original interrogatories had been transmitted to the clerk of the court. Thereupon plaintiff made a motion to have the case restored to the trial calendar and an order was entered setting the trial for July 31, 1952.
Notice of motion to restore the case to the calendar was mailed to the attorney of record for defendant enclosed in an envelope containing plaintiff's attorney's return address. The same was never returned to plaintiff's attorney by the post office department. On April 17, 1952, plaintiff's attorney received a telephone call from a woman who represented that she was Mrs. Rollinson, the wife of defendant's attorney. She stated that her husband was due to come out of the hospital in about a week, and that it would take a little time for his recovery, and on that basis requested a continuance of the hearing of the motion to restore the case to the calendar. Plaintiff's attorney advised her that since the case would be set for trial for sometime in the future no purpose would be served in continuing the hearing; that after the trial date had been set, notice of trial would be mailed to the attorney for defendant and if for any reason his health would not permit his trying the case on that date, plaintiff's attorney would be willing to discuss with him a continuance of the trial.
On April 10, 1952, in addition to mailing to the attorney for defendant a copy of the notice of motion to restore the case to the calendar, there was mailed under separate cover a copy of a notice to produce. This document was never returned by the post office department to plaintiff's attorney.
April 18, 1952, a written notice of trial, indicating the case had been reset for trial on July 31, 1952, was mailed to the attorney for defendant at his office address enclosed in an envelope which bore the return address of plaintiff's attorney. This document was not returned to the attorney for plaintiff by the post office department, nor did plaintiff's attorney hear from defendant or his attorney between April 18, 1952, and the time that a default judgment was rendered against defendant on July 31, 1952.
It likewise appears that on or about March 12, 1952, defendant visited the attorney for plaintiff without any prior notice, representing that he was visiting such attorney with the *347 knowledge and acquiescence of his own counsel. Defendant stated that the purpose of his visit was to ascertain the address of plaintiff's assignor, since he was desirous of discussing with the assignor a business deal similar to the one which resulted in his executing the written acknowledgment of indebtedness for $7,000, and that by such meeting he could in all probability work out a solution to the satisfaction of all persons concerned. The attorney for plaintiff referred defendant to the attorney for plaintiff's assignors from whom he might obtain the address he desired and stated to defendant that he doubted that any business transaction could be consummated with plaintiff's assignor in view of the pendency of the present action, and that if defendant desired to enter into any further negotiations he would first have to make a disposition of the pending action. He further advised defendant that in spite of the fact he was contemplating contacting plaintiff's assignor he would proceed with the pending action as soon as the depositions were received, and that, in all probability, based upon a motion which would then have to be made to restore the case to the calendar, the trial would probably take place sometime in June or July of 1952.
On August 8, 1952, a copy of the memorandum of costs and disbursements together with a copy of notice of entry of judgment were mailed to the attorney for defendant in an envelope which bore plaintiff's attorney's return address. This envelope was not returned by the post office department. Defendant admitted that he had learned of the judgment on or about August 20, 1952.
Defendant's original motion was based upon two grounds: 1. Mistake, inadvertence, surprise and excusable neglect; and 2. Extrinsic fraud of plaintiff and plaintiff's attorney.
No facts were shown to establish any fraud. Therefore we need not consider the correctness of the court's ruling as to the second ground. We, of course, must disregard any statements in defendant's affidavits contradictory of those of plaintiff's affidavit, since, when there is substantial conflict in the facts presented by affidavits, the determination of the controverted facts by the trial court will not be disturbed on appeal. (Baratti v. Baratti, 109 Cal.App.2d 917, 922 [12] [242 P.2d 22]; Reeves v. Reeves, 34 Cal.2d 355, 360 et seq. [209 P.2d 937].)
We are thus presented with this sole question:
Under the foregoing facts did the trial court abuse its *348 discretion in denying defendant's motions to set aside the default judgment entered against him?
No. [1] Mr. Justice Traynor, in Coyne v. Krempels, 36 Cal.2d 257, 263 [8] [223 P.2d 244], thus accurately states the rule: "A motion for relief under section 473 is addressed to the sound discretion of the trial court and in the absence of a clear showing of abuse thereof the exercise of that discretion will not be disturbed on appeal."
[2] It is likewise settled that in the exercise of its discretion under section 473 of the Code of Civil Procedure, in setting aside a default judgment, it should appear that something more than mere inadvertence or neglect without reasonable excuse or justification existed, and that the inadvertence or neglect in question is not the result of mere forgetfulness or neglect but is based on other circumstances which would make the neglect excusable. In the instant case the above facts are supported by affidavits in opposition to defendant's motions and such facts do not show any excusable mistake, surprise or neglect. Therefore the trial court did not abuse its discretion in concluding that no proper showing of inadvertence or excusable neglect had been made.
The orders are and each is affirmed.
Moore, P. J., and Fox, J., concurred.
|
{
"pile_set_name": "FreeLaw"
}
|
US Capital Partners Engaged as Strategic Advisor in $100 Million Debt and Equity Raise for Midwest BioEnergy
Private investment bank backs next-generation waste-to-value company in the development of a new biogas-to-ammonia plant in collaboration with the City of Monmouth, Illinois.
SAN FRANCISCO, May 2014 – US Capital Partners, LLC has been engaged by Midwest BioEnergy, Ltd. as its strategic advisor in the raising of debt and equity project financing of up to $100 million. The financing will include an initial $10 million in corporate financing and up to $20 million in debt and equity financing for a new bio-gas-to-ammonia plant in Monmouth, Illinois, to be developed by the company’s subsidiary Midwest Ammonia, LLC (“Midwest”).
“We are extremely pleased to be taking a strategic investment banking role in this important new clean-tech project, which will reduce carbon emissions and create about 160 jobs in the local community,” said Jeffrey Sweeney, CEO and Managing Director at US Capital Partners. “Our Clean Technology and Renewables group is comprised of industry experts with decades of experience in the field. We look forward to applying the group’s strong focus on strategic, innovative solutions and on speed and excellence of execution to provide best-in-class project financing for Midwest.”
About Midwest Ammonia and Midwest BioEnergy
Midwest Ammonia, LLC, a subsidiary of Illinois-based Midwest BioEnergy, Ltd., is a next generation waste-to-value company developing a new plant for turning wastewater treatment gases regulated by federal watchdogs into anhydrous am¬monia for use as fertilizer. In collaboration with the City of Monmouth, Illinois, Midwest plans to build the renewable fertilizer plant at the wastewater treatment site north of the town. Monmouth City Council recently approved a bid that puts in motion the new waste-to-value project, which is expected to produce 7,500 st/y of anhydrous ammonia, reduce carbon emissions, and create a new revenue source for the city..
About US Capital Partners, LLC
Since 1998, US Capital Partners (www.uscapitalpartners.net) has been providing innovative and reliable advisory, lending, equity financing, and debt re-structuring services to businesses across the United States and abroad. US Capital Partners is a private investment bank, direct lender, co-lender, and lead financial arranger that specializes in debt and equity for small to middle market private and public companies. The firm’s innovative approach and balance sheet allow it to provide the best financing options available for its clients.
To learn more about this recent engagement or about how your business can secure the investment banking services it needs, email Jeffrey Sweeney, CEO and Managing Director, at jsweeney@uscapitalpartners.net or call (415) 889-1010.
|
{
"pile_set_name": "Pile-CC"
}
|
Responses of parasitoids to saproxylic hosts and habitat: a multi-scale study using experimental logs.
Species belonging to higher trophic levels are particularly vulnerable to habitat loss and consequential host population declines, but detection of effects depends on observation scale. We investigated the effects of habitat and host availability at multiple scales on parasitoids of early successional saproxylic beetles in middle boreal Sweden, where forestry has led to habitat fragmentation and coarse woody debris (CWD) loss. Parasitoid wasps and beetle hosts were collected from nine locations, each containing three spruce-dominated stand types (clear-cut, mature managed and unmanaged stands), using emergence traps on experimental CWD. We measured local CWD volumes and determined the availability of forests of a suitable age within the landscape. We tested parasitoid responses to stand type, CWD volume, abundance of known and probable hosts and longitude. Additionally, we tested whether parasitoids responded to the area of habitat of a suitable age within radii from 0.2 to 10 km. Stand type appeared in best-fit models for all common species, suggesting that wasps respond strongly to habitat at local scales. Longitude (largely climate) featured commonly, but CWD volume was never significant. Host abundance appeared in best-fit models for three of five common species, proving significant only for Bracon obscurator, the abundance of which correlated with that of Orthotomicus laricis at both trap and site levels. Rhimphoctona spp. also correlated significantly with its known host Tetropium castaneum at the trap level. B. obscurator responded to habitat area at scales of 0.6-1 km and Cosmophorus regius responded at radii greater than 7 km, while the larger species did not respond strongly to habitat area. The role of habitat area at greater scales thus varied greatly amongst species, but our data suggest that dispersal of these common early successional species may not be strongly restricted at the current scale of fragmentation of their boreal habitats.
|
{
"pile_set_name": "PubMed Abstracts"
}
|
Nayana Fernando
Nayana Fernando (full name Palamandadige Nayana Priyanjana Fernando; born 14 October 1988) is a Sri Lankan cricketer. He is a right-handed batsman and right-arm bowler who plays for Moratuwa Sports Club. He was born in Panadura.
Fernando, who has played with Moratuwa Under-23s since 2007, made his List A debut during the 2009-10 season, against Police Sports Club, scoring 26 runs in his debut innings, though he followed this up with a golden duck in his next match.
External links
Nayana Fernando at Cricket Archive
Category:1988 births
Category:Living people
Category:Sri Lankan cricketers
Category:Moratuwa Sports Club cricketers
Category:Panadura
|
{
"pile_set_name": "Wikipedia (en)"
}
|
AGO Opinion 82174
You have submitted to us a proposed bill which would amend Neb. Rev. Stat. §77-202 (Supp. 1980) by adding the following to the list of properties exempted from taxation by that section:
Transmission and distribution lines, transformers and associated substation facilities within" the State of Nebraska owned by non-profit cooperative corporations and associations and used or useful for the transmission and distribution of electric power and energy, except that such lines, transformers and facilities which were assessed during 1979 shall continue to be assessed and taxed based upon the 1979 assessments with respect to such property.
You have asked our opinion as to the constitutionality of such an amendment. We believe that an exemption of personal property of this kind could be sustained, but that the proposal contains two provisions which cannot.
We construe the exemption to apply only to personal property, although the term "associated substation facilities" is somewhat unclear to us. This exemption, to be valid, must be authorized by the provision of Article VIII, Section 2 of the Nebraska Constitution permitting the Legislature to classify personal property in such manner as as it sees fit, and to exempt any of such classes, or to exempt all personal property. Clearly, real estate could not be exempted under such a provision, and we construe your proposed bill to pertain only to personal property.
One question that must be answered is whether the classification is reasonable. While Article VIII, Section 2 authorizes the Legislature to classify personal property "as it sees fit," we are confident that the Supreme Court would require that the classification be reasonable. Unreasonable classification is prohibited by Article III, Section 18 of the Constitution, and it would require extraordinarily explicit language in the Constitution to convince the court that what it considered unreasonable classification was to be authorized. Even then, such classification would probably run afoul of the Equal Protection Clause of the Fourteenth Amendment to the Federal Constitution.
The first classification we will consider is that between property owned by "non-profit cooperative corporations and associations" and others. The property owned by the nonprofit organization would be exempt, while similar property owned by other persons or entities would not. We believe this is reasonable classification. The Legislature is given a wide range of discretion in classifying, and it appears to us that there are differences between non-profit corporations and associations, on the one hand, and private persons or profit-making corporations, on the other, to justify different treatment of them in this way.
We recognize that in State ex rel. Meyer v. Story, 173 Neb. 741, 14 N.W.2d 769 (1962), the court said that the provision authorizing the Legislature to provide a different method of taxing motor vehicles did not authorize it to provide a different method of taxing motor vehicle dealers. However, we believe the case can be distinguished, because the constitutional provision being construed in Story did not have the specific classification authority we are dealing with, and furthermore, it is, perhaps, more reasonable to treat nonprofit organizations differently from other entities than it is to pick out a class of profit-making corporations or persons, such as motor vehicle dealers, for special treatment.
The other classification involved is that between lines, transformers, and facilities assessed during 1979, and similar property not assessed during that year. We find it difficult to justify such a classification. Exactly why property which has been, or will be, acquired after January 1, 1979, should now be exempt from taxation, but similar property acquired before January I, 1979, should be taxed escapes us. There is nothing which "naturally suggests the justice or expediency of diverse legislation with respect to the objects classified." See Shear v. County Board of Commissioners, 187 Neb. 849, 195 N.W.2d 151 (1972). Stahmer v. State, 192 Neb. 63, 218 N.W.2d 893 (1974) casts some doubt as to whether Article III,~ Section 18 applies to the classification of personal property under Article VIII, Section 2, but, as we indicated above, we cannot believe that the court would sustain a completely baseless classification, and even if Article III, Section 18 does not apply, the Equal Protection Clause does. We therefore doubt the validity of such a provision.
The bill would also provide that the property not exempted should continue to be assessed based upon the 1979 assessment. If this means that it shall continue, for as long as it is owned and used, to be assessed at the value ascribed to it as of January I, 1979, it clearly violates the uniformity provisions of Article VIII, Section 1 of the Constitution. If it continues to be taxable, it must be taxed uniformly with other taxable property, and this uniformity includes uniformity in valuation.
We therefore conclude that it would be difficult to defend your proposed legislation in its present form.
|
{
"pile_set_name": "Pile-CC"
}
|
{#sp1 .678}
{#sp2 .679}
{#sp3 .680}
{#sp4 .681}
|
{
"pile_set_name": "PubMed Central"
}
|
Factors associated with mortality risk in critical care patients treated with veno-arterial extracorporeal membrane oxygenation.
To identify factors associated with mortality in patients treated with veno-arterial extracorporeal membrane oxygenation (VA-ECMO) and to validate the discrimination of the risk assessment tools to predict mortality. VA-ECMO is a rescue therapy for patients with life-threatening cardiac failure, but mortality remains high. In this retrospective study, we reviewed the medical records of adult patients who underwent VA-ECMO in an intensive care unit of a university hospital, between 2009 and 2013. VA-ECMO was performed in 89 patients, with a median duration of 116 h. The survival rate until hospital discharge was 27%. The pre-ECMO simplified acute physiology score (SAPS) II and diabetes mellitus were significant predictors of hospital mortality. The optimal prognostic SAPS II score was 81 overall, 80 in patients with diabetes, and 84 in those without diabetes. Our findings indicate that high pre-ECMO SAPS II score and diabetes are risk factors for mortality in patients who undergo VA-ECMO.
|
{
"pile_set_name": "PubMed Abstracts"
}
|
Q:
Android - CSV multiple lines post to PHP server
I'm writing an Android app that posts some CSV formatted data to a PHP server.
If I only post one row, the server reads it correctly and does what it needs to do. However, I'm unable to post multiple lines. I have the CSV data in a .txt file and I read this data into a string and send that string using HttpURLConnection. The issue is that while it'll look fine looking at the .txt file in my phone, the server does not interpret "\n" or "\r\n" correctly and won't update at all. My guess is that it interprets the entire string as one line or something along those lines.
Each line sent is read like this:
list($value1, $value2, $value3) = explode(",", $datarec);
Is there some sort of newline character that PHP can recognize? Apparently, it doesn't recognize \n or \r\n.
I currently have the content-type set to text/csv but I've also tried text/html and using br/> instead.
conn.setRequestProperty("Content-Type", "text/csv");
A:
So here I prefer is to use NameValuePair. Each line, you combine to a string and create it as a NameValuePair, like
List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("line1", "string1string2string3"));
And send it .
Refer to Add parameters to URLconnection and use of namevaluepair for more information.
|
{
"pile_set_name": "StackExchange"
}
|
//
// AppDelegate.swift
// EmojiArt
//
// Created by CS193p Instructor.
// Copyright © 2017 CS193p Instructor. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
// provided by the Document Template
// implements a method that gets called by other apps
// (like the Files app)
// if another app wants to open a document in your app
// only works for documents that are defined as Exported UTIs in Project Settings/Target/Info
// simply asks the DocumentBrowserViewController to show the document
func application(_ app: UIApplication, open inputURL: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
// Ensure the URL is a file URL
guard inputURL.isFileURL else { return false }
// Reveal / import the document at the URL
guard let documentBrowserViewController = window?.rootViewController as? DocumentBrowserViewController else { return false }
documentBrowserViewController.revealDocument(at: inputURL, importIfNeeded: true) { (revealedDocumentURL, error) in
if let error = error {
// Handle the error appropriately
print("Failed to reveal the document at URL \(inputURL) with error: '\(error)'")
return
}
// Present the Document View Controller for the revealed URL
documentBrowserViewController.presentDocument(at: revealedDocumentURL!)
}
return true
}
}
|
{
"pile_set_name": "Github"
}
|
Sandra Bullock & Benedict Cumberbatch - BAFTA Tea Party 2014
About this photo set:
Sandra Bullock is classy chic while attending the 2014 BAFTA LA Awards Season Tea Party at the Four Seasons Hotel on Saturday (January 11) in Beverly Hills, Calif.… Read More Here
|
{
"pile_set_name": "Pile-CC"
}
|
Channel Islands credit ratings downgraded to AA Published duration 12 February 2016
image caption Jersey Treasury Minister, Senator Alan Maclean, said the reasons for the drop were out of the island's control
The Jersey and Guernsey credit ratings have been downgraded for the first time from AA+ to AA by international credit rating agency Standard and Poor's.
The agency blamed rising regulatory complexity and greater focus on low tax regimes by the G10 on the drop.
It also said the outlook was negative due to the risk to the finance industry if the UK voted to leave the EU.
In November Standard and Poor's reversed a decision to downgrade Guernsey's rating after an appeal.
The appeal had been made then by Guernsey Treasury and Resources.
Jersey was given its first credit rating - of AA+ in 2014 - so it could borrow money to build more social housing.
Jersey and Guernsey have confirmed that they have no intention of appealing this decision which is based on a revised approach by Standard and Poor's as to how they now assess future risks for small sovereign states compared to larger countries.
Jersey treasury minister Senator Alan Maclean said the rating change did not reflect any decline in the economy which is performing better now than at anytime since the financial crisis began in 2008.
He said: "We are clearly disappointed that Jersey and Guernsey and other small sovereign states are all now being assessed in a different way by Standard and Poor's and that this recalibration has resulted in all the credit ratings being lowered. The UK also had its rating revised to negative in June 2015 to reflect the possible impact of it leaving the EU.
|
{
"pile_set_name": "OpenWebText2"
}
|
Fine-needle aspiration cytology of seminoma: a review of 16 cases.
We report the cytomorphologic features of 16 fine-needle aspiration (FNA) biopsies of seminoma obtained from 16 male patients. The aspirates included two primary gonadal tumors (one occurring in a cryptorchid testis), two primary mediastinal tumors, and 12 metastases (two with unknown primaries). Analysis of the aspirates revealed a primarily dispersed cell population of large cells with scant to moderately abundant cytoplasm. The nuclei were round to slightly irregular, had finely granular chromatin, and had either one central prominent nucleolus or two to three smaller nucleoli. Variable numbers of lymphocytes and plasma cells were intermingled with the tumor cells. Only a few cases had epithelioid histiocytes or the characteristic "tigroid" background. The cytologic features of the metastases were distinctive and were considered diagnostic for therapeutic management. In six cases, an initial diagnosis of seminoma by FNA biopsy identified the neoplasm as germ cell in origin rather than other neoplasms in the differential diagnosis, thereby expediting therapeutic management.
|
{
"pile_set_name": "PubMed Abstracts"
}
|
[Histogenesis of the immune system of the "nude" mouse. Postnatal development of the thymus: a light microscopical study (author's transl)].
Mice homozygous for the mutation "nude" display a dysgenetic thymus (Pantelouris, 1968). The anterior mediastinum of these animals contains a rudimentary epithelial organ (pantelouris and Hair, 1970), which has been assumed to represent not a maldeveloped thymus, but rather a remnant of the parathyroid gland or of the ultimobranchial body (Wortis et al., 1971). We have investigated the development of the thymus in homo- and heterozygous nude by both light and electron microscopy. This paper describes the light microscopical findings in embryos and fetuses from the 11th up to the 18th day post conceptionem (pc). Homo- and heterozygous nude (nu/nu + nu/+) mice with the genetic background BALB/c were kept under specific pathogen-free (spf) conditions. Virgin nu/+ females were mated with nu/nu males. In addition, homozygous females were mated with homozygous males in order to investigate 11-day-old homozygous embryos. The embryos and fetuses were fixed in Bouin's solution and embedded in paraffin wax. Serial frontal sections (5mu) were stained with hematoxylin and eosin. Up to the 12th day pc, the thymus anlage of the n/nu embryo is indistinguishable from that of the nu/+ animal. The paired anlage develops from the epithelium of the ventral and dorsal diverticles of the 3rd pharyngeal pouch, and from the ectodermal vesicula cervicalis. In the nu/+ embryo, the thymic epithelium begins to proliferate between the 12th day and 13th day pc. In the central part of the anlage, the epithelial cells dissociate and begin to form a reticulum. At the same time, blood vessels from the surrounding mesenchyme invade the anlage. From the 14th day onwards, lymphoblasts are recognizable..
|
{
"pile_set_name": "PubMed Abstracts"
}
|
Q:
writing .csv files from for loops and lists
I am new to python but I have searched on Stack Overflow, google, and CodeAcademy for an answer or inspiration for my obviously very simple problem. I thought finding a simple example where a for loop is used to save every interation would be easy to find but I've either missed it or don't have the vocab to ask the right question. So please don't loudly sigh in front of your monitor at this simple question. Thanks.
I would like to simply write a csv file with each iteration of the two print lines on the code below in a seperate column. so an output example might look like:
##################
andy.dat, 8
brett.dat, 9
candice.dat, 11
#################
the code I have so far is:
import sys
import os.path
image_path = "C:\\"
for filename in os.listdir (image_path):
print filename
print len(filename)
If I try to do
x = filename
then I only get the last interation of the loop written to x. How do I write all of them to x using a for loop? Also, how to write it as a column in a csv with the print result of len(filename) next to it? Thanks.
A:
Although for this task you don't need it, I would take advantage of standard library modules when you can, like csv. Try something like this,
import os
import csv
csvfile = open('outputFileName.csv', 'wb')
writer = csv.writer(csvfile)
for filename in os.listdir('/'): # or C:\\ if on Windows
writer.writerow([filename, len(filename)])
csvfile.close()
|
{
"pile_set_name": "StackExchange"
}
|
National Counter Terrorism Policing Network
The National Counter Terrorism Policing Network (NCTPN) (also known as the Police Counter-Terrorism Network) is the national collaboration of police forces in the United Kingdom working to prevent, deter and investigate terrorism in the United Kingdom. The Network is governed by the National Police Collaboration Agreement Relating to Counter Terrorism Activities Made Under Section 22A of the Police Act 1996. The Network is accountable to the United Kingdom Government and the National Police Chiefs' Council Counter Terrorism Coordination Committee which is chaired by the Metropolitan Police Service Assistant Commissioner of Specialist Operations (ACSO) who also acts as the National Lead for Counter Terrorism Policing. The Network is also functionally coordinated by the Senior National Coordinator for Counter Terrorism who is usually a Metropolitan Police Service Deputy Assistant Commissioner co-located within the Counter Terrorism Command.
The Network stretches across the United Kingdom and sees specialist officers and staff working with the Home Office, MI5 and other intelligence, security and criminal justice agencies around the world. It is made up of dedicated Regional Counter Terrorism Units and national police units and is responsible for the delivery of the policing contribution to the CONTEST strategy.
The Australian Federal Police's Joint Counter Terrorism Teams, Canada's Integrated National Security Enforcement Teams, and the United States' Joint Terrorism Task Force model can be seen as analogous to the National Counter Terrorism Policing Network.
Counter Terrorism Coordination Committee
The Counter Terrorism Coordination Committee (CTCC) of the National Police Chiefs' Council is a national coordination body made of chief officers of the nine regional lead counter terrorism police forces and other thematic leads alongside senior representatives of government departments and other agencies including the Home Office and MI5. It is chaired by Metropolitan Police Service Assistant Commissioner of Specialist Operations Mark Rowley with the vice chair being West Midlands Police Chief Constable David Thompson.
The CTCC is the focal point for on counter terrorism policing and related issues and is responsible for developing national counter terrorism and domestic extremism strategic policy through the National Counter Terrorism Policing Headquarters (NCTPHQ). The CTCC also liaises with government and other partners on behalf of UK police forces. The CTCC is also staffed by a small number of chief police officers dedicated full-time to providing strategic direction and coordination relating to particular counter terrorism policing themes.
The National Counter Terrorism Policing Senior Leadership as defined by the National Counter Terrorism Collaboration Agreement as the CTCC Chair, Vice Chair(s)s, the Senior National Coordinator, the Director of Counter Terrorism Strategy and Policy, the Director of Counter Terrorism Resources, the National Coordinator Protect and Prepare, the National Coordinator Prevent, and the National Coordinator Pursue who is the concurrent Deputy Senior National Coordinator.
National Counter Terrorism Policing Headquarters
The National Counter Terrorism Policing Headquarters (NCTPHQ) is responsible for developing policy and strategy and providing a single national counter terrorism policing voice on behalf of the National Counter Terrorism Policing Network. The NCTPHQ also coordinates national projects and programmes, provides administrative and support services to the national network, advises the government on budgets and resourcing for counter terrorism policing in England and Wales.
National Counter Terrorism Policing Operations Centre
Within the NCTPHQ is the National Counter Terrorism Policing Operations Centre (NCTPOC) serving as the central operational command made up of units that provide operational support to the National Counter Terrorism Policing Network. Teams within the Operations Centre are:
Ports Team
Intelligence Team
Firearms Suppression Team
Coordination Centre
Senior National Coordinator for Counter Terrorism
The Senior National Coordinator for Counter Terrorism (SNC) is responsible for coordinating counter terrorism investigations and prevention activities for the National Counter Terrorism Policing Network. The SNC is usually a concurrent Metropolitan Police Service Counter Terrorism Command Deputy Assistant Commissioner and is aided by the Deputy Senior Coordinator for Counter Terrorism from outside the Metropolitan Police. In March 2018 Neil Basu (former Deputy Assistant Commissioner and SNC) was promoted to Assistant Commissioner and in May 2018 Dean Haydon, new Deputy Assistant Commissioner, was appointed as a new SNC.
Regional Counter Terrorism Units
The National Counter Terrorism Policing Network is made up of eleven Regional Counter Terrorism Units (CTUs) and Regional Counter Terrorism Intelligence Units (CTIUs) which bring together intelligence, operations and investigation functions around the United Kingdom to help prevent, disrupt and prosecute terrorist activities. Units are regionally based and resourced by regional police forces and are composed of detectives, financial and cyber investigators, community contact teams, intelligence analysts, and forensic specialists. Each CTU provides coordination and specialist support for their respective regions. The CTUs are located as follows:
North West Counter Terrorism Unit led by the Greater Manchester Police with Cheshire Constabulary, Cumbria Constabulary, Isle of Man Constabulary, Lancashire Constabulary, and Merseyside Police.
North East Counter Terrorism Unit led by the West Yorkshire Police with Cleveland Police, Durham Constabulary, Humberside Police, Northumbria Police, North Yorkshire Police, and South Yorkshire Police.
South East Counter Terrorism Unit led by the Thames Valley Police for Hampshire Constabulary, Kent Police, Surrey Police, and Sussex Police.
West Midlands Counter Terrorism Unit led by the West Midlands Police with Staffordshire Police, Warwickshire Police, and West Mercia Police.
Counter Terrorism Command led by the Metropolitan Police Service with City of London Police.
Eastern Region Counter Terrorism Unit
The Regional Counter Terrorism Intelligence Units are also resourced by the police forces in their respective areas and carry out primarily intelligence gathering operations. The CTIUs are located as follows:
South West Counter Terrorism Intelligence Unit led by the Avon and Somerset Police with Devon and Cornwall Police, Dorset Police, Gloucestershire Constabulary, Wiltshire Police, States of Guernsey Police Service, and States of Jersey Police.
Welsh Extremism and Counter Terrorism Unit led by the South Wales Police with Dyfed–Powys Police, Gwent Police, and North Wales Police.
Eastern Counter Terrorism Intelligence Unit led by the Bedfordshire Police with Essex Police, Cambridgeshire Constabulary, Hertfordshire Constabulary, Suffolk Constabulary, and Norfolk Constabulary.
East Midlands Counter Terrorism Intelligence Unit led by the Derbyshire Police with Leicestershire Police, Lincolnshire Police, Northamptonshire Police, and Nottinghamshire Police.
Scotland Counter Terrorism Intelligence Unit led by the Police Scotland.
Northern Ireland Counter Terrorism Intelligence Unit led by the Police Service of Northern Ireland.
Special Branches
In addition to the regional counter terrorism units, local Special Branches assist in protecting national security and are in some police forces managed and tasked by the regional counter terrorism units.
See also
Office for Security and Counter-Terrorism
National Counter Terrorism Security Office
Counter Terrorism Internet Referral Unit
National Domestic Extremism and Disorder Intelligence Unit
CONTEST
Operation Temperer
United Kingdom National Security Council
United Kingdom National Security Strategy
Joint Terrorism Analysis Centre
Civil Contingencies Secretariat
Cabinet Office Briefing Room
National Crime Agency
Home Office Minister of State for Security
Metropolitan Police Service
Specialist Operations
Counter Terrorism Command
Protection Command
Counter Terrorist Specialist Firearms Officer
Authorised Firearms Officer and Armed Response Vehicle
United Kingdom Special Forces
United Kingdom intelligence agencies
United Kingdom law enforcement agencies
References
External links
UK Counter Terrorism Police
MI5
Category:Counter-terrorism in the United Kingdom
Category:Terrorism in the United Kingdom
Category:Metropolitan Police
Category:Government of the United Kingdom
Category:Law enforcement agencies of the United Kingdom
Category:National police forces of the United Kingdom
Category:Specialist police agencies of the United Kingdom
|
{
"pile_set_name": "Wikipedia (en)"
}
|
Q:
Want a message to come up and then go - html? css? java?
Good day to all of you!
I am working on a site in all European languages. After you click enter on the home page a map loads (that's page 2) and obviously a click on a country takes you to that countries' language. It's a super cool map but it takes 2 seconds to load. If you're on a slow connection, longer.
On that page I want to add one line of text.
European map loading, ONE second please!
So after you click enter on the main page and go to page 2 (the map page) the page doesn't stay black for 2 seconds but the above line shows up in white AND disappears after 2 seconds (without clicking or anything).
Is there anyone out there who can give me a code for that so I can paste it into an empty html page and try out?
Thank you,
Marc
A:
Try this.
Use some basic vanilla javascript
Set a timeout for 2 seconds to display the text, after 2 seconds remove the text and load the map.
I attached a sample here, but you'll want to do some research on event handling in javascript: https://jsbin.com/zegozemiwe/edit?html,js,output
Edit The same concept still applies but rather than a button click bind directly to the load event for the page.
Snippet added to post here:
function makeText() {
console.log('title');
document.getElementById("result").innerHTML = "European map loading, ONE second please!";
setTimeout(function() {
document.getElementById("result").innerHTML = "";
}, 2000)
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body onload="makeText()">
<!--Use the above call for the loading of the page, use the below call for execution on click-->
<button onclick="makeText()">
Click to prompt
</button>
<p id='result'>
</p>
</body>
</html>
|
{
"pile_set_name": "StackExchange"
}
|
The genus Bifidobacterium is one of the most commonly used types of bacteria cultures in the dairy industry for fermenting a variety of dairy products. Ingestion of Bifidobacterium-containing products furthermore has a health-promoting effect. This effect is not only achieved by a lowered pH of the intestinal contents but also by the ability of Bifidobacterium to repopulate the intestinal flora in individuals who have had their intestinal flora disturbed by, for example, intake of antibiotics. Bifidobacterium furthermore has the potential of outcompeting potential harmful intestinal micro-organisms.
Galacto-oligosaccharides are known to enhance the growth of Bifidobacterium. This effect is likely achieved through the unique ability of Bifidobacterium to exploit galacto-oligosaccharides as a carbon source. Dietary supplement of galacto-oligosaccharides is furthermore thought to have a number of long-term disease protecting effects. For example, galacto-oligosaccharide intake has been shown to be highly protective against development of colorectal cancer in rats (Wijnands, et al., 1999). There is therefore a great interest in developing cheap and efficient methods for producing galacto-oligosaccharides for use in the industry for improving dietary supplements and dairy products.
The enzyme β-galactosidase (EC 3.2.1.23) usually hydrolyzes lactose to the monosaccharides D-glucose and D-galactose. In the normal enzyme reaction of β-galactosidases, the enzyme hydrolyzes lactose and transiently binds the galactose monosaccharide in a galactose-enzyme complex that transfers galactose to the hydroxyl group of water, resulting in the liberation of D-galactose and D-glucose. However, at high lactose concentrations some β-galactosidases are able to transfer galactose to the hydroxyl groups of D-galactose or D-glucose in a process called transgalactosylation, whereby galacto-oligosaccharides are produced.
Enzymes capable of transgalactosylation have been isolated from a wide range of micro-organisms, including bacteria and yeasts. The observation that galacto-oligosaccharides enhance the growth of health-promoting Bifidobacterium has stimulated investigations of Bifidobacterium and their β-galactosidase enzymes. Two DNA sequences of B. breve and B. longum β-galactosidase genes have been deposited in GeneBank (accession numbers E5040 and AJ242596, respectively). Dumortier et al. (1994) have reported that B. bifidum DSM 20215 contains three β-galactosidases and one of these enzymes has trans-galactosylating properties. However, no identification of the enzyme possessing this activity or any sequence of the enzyme or the corresponding gene from B. bifidum DSM 20215 has been published.
Production-of galacto-o-ligosaccharides by-the use of β-galactosidases has been reported in several papers. For example, β-galactosidase from E. coli has been shown to produce oligosaccharides at high lactose concentrations (0.5 M or approximately 20% lactose; Huber et al. 1976) Various thermophilic microorganisms have been shown to produce oligosaccharides at high temperatures and high lactose concentrations, e.g. Sterigmatomyces elviae can produce 39% oligosaccharides from 20% lactose at 60° C. (Onishi & Tanaka, 1995), and Saccharopolyspora rectivirgula can synthesize 41% oligosaccharides in 1.75 M lactose at 70° C. (Nako et al., 1994).
However, the enzymes described above all have the drawbacks of requiring either high temperatures or high lactose concentrations or both in order to exhibit significant transgalactosylase activity. There is thus a need for developing cheaper and more efficient methods of producing galacto-oligosaccharides for use in the industry.
|
{
"pile_set_name": "USPTO Backgrounds"
}
|
O objetivo do fotógrafo Rafael Carvalho era capturar em imagens o que o gabinete de “transição governamental” do presidente eleito brasileiro Jair Bolsonaro anda a preparar, mas nas redes sociais as fotografias foram partilhadas como se tivessem sido tiradas como forma de protesto. Com as frases de fundo de “transição governamental”, o enquadramento de algumas fotografias com a cara de Bolsonaro e futuros ministros criou as palavras “traição”, “anta” ou “verme”.
“O meu trabalho na transição é voluntário, publiquei mais de 2.600 fotos e estão, infelizmente, falando dessas”, contou Rafael Carvalho à revista Veja, que avançou a notícia. As fotografias foram inicialmente partilhadas no Flickr numa página oficial do Governo de Transição, mas as que tinham ângulos que criavam as palavras polémicas rapidamente ficaram virais no Twitter.
O YouTuber brasileiro Filipe Neto, que tem mais de 28 milhões de seguidores no YouTube e 8 milhões no Twitter, foi uma das pessoas que partilharam as polémicas fotografias.
Parabéns ao fotógrafo Rafael Carvalho. Ele foi contratado pela equipe Bolsonaro para ser o fotógrafo nesse período de transição. Aí ele foi e fez isso. HHAHAHHAHAHAHHAHAHHAHAHHAHAHHAHAHHAHAHAHAHHAHAHHAHAHHAHAHAHHAHAHAHHAHAHHAHA pic.twitter.com/bZnbH8rX74 — Felipe Neto (@felipeneto) December 24, 2018
Outros utilizadores da rede social fizeram o mesmo.
O fotógrafo da equipe do Bolsonaro tá de sacanagem ou tá com salário atrasado. #Anta #TraiçãoGoverna #Transão #CadeOQueiroz pic.twitter.com/TMvjr6edvs — O mundo muda, só não mudam meus princípios! (@vando_correia) December 24, 2018
Apesar de alguns enquadramentos de fotografias criarem as palavras ofensivas para os políticos que aparecem nas imagens, muitas foram cortadas de forma a salientar as ofensas que surgem no fundo. Em cima, vemos um exemplo de um imagem editada. Em baixo, a mesma imagem completa, apesar de ainda se poder ler “verme” no fundo, fica menos percetível quando surge completa como foi partilhada no Flickr.
Gustavo Lopes, coordenador de comunicação do gabinete de transição governamental defendeu o fotógrafo, afirmando: “o Rafael é um profissional excelente e tem feito um ótimo trabalho”. Quanto às fotografias, o responsável de comunicação da equipa de Bolsonaro disse ainda: “o nosso foco principal é mostrar à sociedade o trabalho desenvolvido no gabinete de transição, de forma transparente”.
Jair Bolsonaro vai tomar posse como Presidente do Brasil a 1 de janeiro de 2019.
|
{
"pile_set_name": "OpenWebText2"
}
|
Intraradicular disc herniations in the lumbar spine and a new classification of intradural disc herniations.
A case report of intraradicular disc herniation. Intraradicular disc herniation is a special type of intradural disc herniations. In this report, we present the tenth case of intraradicular lumbar disc herniation and suggest a new classification for intradural disc herniations. A 32-year-old male was admitted to hospital having experienced pain in the lower back and right leg for 1 month prior to admission. Neurological examination revealed weakness of the extensor hallucis longus, positive Laségue's sign, decreased ankle reflex in his right lower extremity, and bilateral paravertebral muscle spasm. Magnetic resonance imaging (MRI) revealed a disc herniation with a posterolateral extruded fragment on the right at the level of the L5-S1 space. He underwent L5 laminectomy. During the operation, the right S1 root was found to be swollen and immobile. A longitudinal incision was made in the dura of the right S1 root and an intradural free disc fragment was removed, and the S1 root was relieved. The patient was free of pain postoperatively. We suggest a new classification for intradural disc herniations with this unusual case presentation and review the literature for pathogenesis, clinical picture, diagnosis and treatment.
|
{
"pile_set_name": "PubMed Abstracts"
}
|
With the risk of a national debt crisis lurking over the nation, former Federal Reserve chairman Alan Greenspan can't agree with continuing vast tax cuts for America's richest taxpayers.
Appearing on MSNBC's Meet The Press on Sunday, Greenspan was trenchant, saying that Bush-era tax cuts, extended last year by the Obama administration, must be allowed to expire with the federal deficit, once tomorrow's problem, quickly developing into a threat to today's economy.
"I think this crisis is so imminent and so difficult that I think we have to allow the so-called Bush tax cuts all to expire," Greenspan said. "That is a very big number," he continued, adding that taxes should return to the higher levels instituted by the Clinton administration in the 1990s not just for the wealthiest taxpayers, but for all Americans.
Last November, the Obama administration accepted an across-the-board, temporary continuation of steep Bush-era tax cuts, including those for the wealthiest taxpayers, largely to protect middle-class tax payers also included in the legislation. The estimated cost of just the portion of the tax cuts that would apply to the richest Americans is $42 billion this fiscal year, more than the $38 billion value of the savings from the federal budget cuts lawmakers approved last week.
On Wednesday, in an attempt to address the nation's mounting federal debt crisis, President Barack Obama outlined a 12-year, $4 trillion deficit-reduction plan. As the U.S. approaches the $14.3 trillion debt ceiling, which the Treasury Department estimates will be hit by May 16, Treasury Secretary Timothy Geithner said he expects Congress to increase the debt limit, allowing the country to borrow more money.
During the same broadcast on Sunday, Geithner reiterated his confidence that certain congressional lawmakers would come together to raise the nation's debt limit, labeling it "absolutely essential to [preserving] the creditworthiness of the United States of America" and warning of dire consequences if politicians couldn't get the deal done.
"If you allow people to start to doubt whether the United States of America will meet its obligations, that would be catastrophic," Geithner continued. "[W]e can't take that risk."
Watch Alan Greenspan's entire MSNBC interview here:
|
{
"pile_set_name": "OpenWebText2"
}
|
.rst-content .toggle {
background: none repeat scroll 0 0 #e7f2fa;
padding: 12px;
line-height: 24px;
margin-bottom: 24px;
}
.rst-content .toggle .admonition-title {
display: block;
clear: both;
cursor: pointer;
}
.rst-content .toggle .admonition-title:after {
content: " ▶";
}
.rst-content .toggle .admonition-title.open:after {
content: " ▼";
}
.rst-content .toggle p:last-child {
margin-bottom: 0;
}
|
{
"pile_set_name": "Github"
}
|
Q:
Parse Ksop Response - Android
How should iparse the following ksoap web service response.
(I am new to this part in android).
This is response obtained from my ksop response to web service.
I am reunning this on android 4.1 device.
<?xml version = "1.0" encoding = "UTF-8" ?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<GetNearestStationsResponse xmlns="http://tempuri.org/">
<GetNearestStationsResult>
<StationsCloseBy xmlns="">
<Station Station_id="332"
Station_Name="דוד המלך 30"
Eng_Station_Name="30 David Hamellech St."
Description="דוד המלך 30 מול הרבנות בשדרה"
Eng_Address="David ha-Melekh 30 opposite the Rabbinate"
Latitude="32.080000"
Longitude="34.785400"
DistanceFromStationInMeters="61"
Timestamp="2013-01-30T11:05:03.320"
NumOfAvailableBikes="5"
NumOfAvailableDocks="15"
IsActive="1"
Station_picture=""
Station_Phone="*6070"
Telefax="" />
<Station Station_id="331"
Station_Name="כיכר רבין"
Eng_Station_Name="Rabin Square"
Description="כיכר רבין מול אבן גבירול 76 -תחנה עירייה"
Eng_Address="Kikar Rabin, opposite Ibn Gabirol 76 - municipality station"
Latitude="32.081000"
Longitude="34.781100"
DistanceFromStationInMeters="360"
Timestamp="2013-01-30T11:05:03.320"
NumOfAvailableBikes="12"
NumOfAvailableDocks="16"
IsActive="1"
Station_picture=""
Station_Phone="*6070"
Telefax="" />
<Station Station_id="333"
Station_Name="ויצמן 15-איכילוב"
Eng_Station_Name="15 weizman st. Ichilov Hospital"
Description="ויצמן 15 איכילוב במדרכה מול בית החולים"
Eng_Address="Weizman 11 - Hospital"
Latitude="32.081100"
Longitude="34.788800"
DistanceFromStationInMeters="391"
Timestamp="2013-01-30T11:05:03.320"
NumOfAvailableBikes="6"
NumOfAvailableDocks="14"
IsActive="1"
Station_picture=""
Station_Phone="*6070"
Telefax="" />
<Station Station_id="345"
Station_Name="ויצמן 1 - בית המשפט"
Eng_Station_Name="1 Weizman St. - Court Justice Hall"
Description="ויצמן 1 בית המשפט"
Eng_Address="Weizman 1 - Court Justice Hall"
Latitude="32.077200"
Longitude="34.788400"
DistanceFromStationInMeters="476"
Timestamp="2013-01-30T11:05:03.320"
NumOfAvailableBikes="4"
NumOfAvailableDocks="24"
IsActive="1"
Station_picture=""
Station_Phone="*6070"
Telefax="" />
<Station Station_id="342"
Station_Name="שאול המלך 21 קאמרי"
Eng_Station_Name="21 Sauol Hamelekh- Hakameri"
Description="שאול המלך 21 קאמרי -במדרכה מימין למדרגות כניסה מערבית"
Eng_Address="Shaul ha-Melekh 21 Hakameri - on the sidewalk to the right of the west entrance stairs"
Latitude="32.075900"
Longitude="34.785100"
DistanceFromStationInMeters="478"
Timestamp="2013-01-30T11:05:03.320"
NumOfAvailableBikes="8"
NumOfAvailableDocks="12"
IsActive="1"
Station_picture=""
Station_Phone="*6070"
Telefax="" />
<Station Station_id="381"
Station_Name="פרישמן 77"
Eng_Station_Name="77 Frishman St."
Description="פרישמן 77-שדרות חן"
Eng_Address="77 Frishman St."
Latitude="32.079500"
Longitude="34.779700"
DistanceFromStationInMeters="488"
Timestamp="2013-01-30T11:05:03.320"
NumOfAvailableBikes="10"
NumOfAvailableDocks="10"
IsActive="1"
Station_picture=""
Station_Phone="*6070"
Telefax="" />
<Station Station_id="323"
Station_Name="תשח 2"
Eng_Station_Name="2 Tashah St."
Description="תשח 2 במדרכה"
Eng_Address="Tashakh 2 on the sidewalk"
Latitude="32.084700"
Longitude="34.786700"
DistanceFromStationInMeters="530"
Timestamp="2013-01-30T11:05:03.320"
NumOfAvailableBikes="6"
NumOfAvailableDocks="14"
IsActive="1"
Station_picture=""
Station_Phone="*6070"
Telefax="" />
<Station Station_id="324"
Station_Name="אבן גבירול 106 -בית הדואר"
Eng_Station_Name="106 Ibn Gvirol St. - Post Office"
Description="אבן גבירול 106 - בית הדואר במדרכה"
Eng_Address="Ibn Gabirol 106 - Post Office, on the sidewalk"
Latitude="32.084300"
Longitude="34.781600"
DistanceFromStationInMeters="546"
Timestamp="2013-01-30T11:05:03.320"
NumOfAvailableBikes="9"
NumOfAvailableDocks="8"
IsActive="1"
Station_picture=""
Station_Phone="*6070"
Telefax="" />
<Station Station_id="346"
Station_Name="אבן גבירול 28"
Eng_Station_Name="28 Ibn Gabirol St."
Description="אבן גבירול 28 לונדון מיניסטור מאחורי ספסל ארוך דרום לכניסה"
Eng_Address="Ibn Gabirol 28, London Ministore behind the long bench south of the entrance"
Latitude="32.075000"
Longitude="34.781800"
DistanceFromStationInMeters="642"
Timestamp="2013-01-30T11:05:03.320"
NumOfAvailableBikes="12"
NumOfAvailableDocks="8"
IsActive="1"
Station_picture=""
Station_Phone="*6070"
Telefax="" />
<Station Station_id="344"
Station_Name="נצח ישראל 4 פינת מסריק"
Eng_Station_Name="4 Netsakh Yisrael St./ Masaryk"
Description="נצח ישראל 4 פינת מסריק - תחנה בחניה בכביש "
Eng_Address="Netsakh Yisrael 4 corner of Masaryk - station at the roadside parking"
Latitude="32.077900"
Longitude="34.778300"
DistanceFromStationInMeters="665"
Timestamp="2013-01-30T11:05:03.320"
NumOfAvailableBikes="8"
NumOfAvailableDocks="12"
IsActive="1"
Station_picture=""
Station_Phone="*6070"
Telefax="" />
</StationsCloseBy>
</GetNearestStationsResult>
</GetNearestStationsResponse>
</soap:Body>
</soap:Envelope>
Assumging:
envelope.bodyIn is Valid
Note1 -
SoapObject response = (SoapObject) envelope.bodyIn;
int propertyCount = response.getPropertyCount();
String pro = response.getPropertyAsString(0);
Running the code above gives:
propertyCount=1
pro =
anyType{StationsCloseBy=anyType{Station=anyType{}; Station=anyType{}; Station=anyType{}; Station=anyType{}; Station=anyType{}; Station=anyType{}; Station=anyType{}; Station=anyType{}; Station=anyType{}; Station=anyType{}; Station=anyType{}; Station=anyType{}; Station=anyType{}; Station=anyType{}; Station=anyType{}; Station=anyType{}; Station=anyType{}; Station=anyType{}; Station=anyType{}; Station=anyType{}; }; }
Note2 - ksoap response was chopped (i have removed Additional Stations tags since it does not make any difference, it caontians same fields with different data)
Any help will be appreciated!
Thanks!
A:
Maybe this piece of my code will help you to find out how to do it, is in Spanish, I am sorry about the Spanish.
This code only retrieves properties from an XML but for attributes is quite the same.
Good luck!
public static ListaDocumentosPentsFirmante RetrieveFromSoap(SoapObject soap){
SoapObject root = (SoapObject) soap.getProperty("getListaPendientesFirmanteResponse");
ListaDocumentosPentsFirmante pagina_doc = new ListaDocumentosPentsFirmante();
ArrayList<DocumentoBandejaFirmanteBean> lista_doc= new ArrayList<DocumentoBandejaFirmanteBean>();
/* Parsing every doc entry*/
for (int i = 0; i < root.getPropertyCount(); i++){
Object property = root.getProperty(i);
if(property instanceof SoapObject){
SoapObject category_list = (SoapObject) property;
DocumentoBandejaFirmanteBean doc= new DocumentoBandejaFirmanteBean();
//En caso de no existis?
if (category_list.hasProperty("codigoDocumento"))
doc.setCodigoDocumento(Long.parseLong(category_list.getProperty("codigoDocumento").toString()));
if (category_list.hasProperty("nombreDocumento"))
doc.setNombreDocumento(category_list.getProperty("nombreDocumento").toString());
if (category_list.hasProperty("nombreSolicitante"))
doc.setNombreSolicitante(category_list.getProperty("nombreSolicitante").toString());
if (category_list.hasProperty("revisado"))
doc.setRevisado(Boolean.valueOf(category_list.getProperty("revisado").toString()));
if (category_list.hasProperty("clasificado"))
doc.setClasificado(Boolean.valueOf( category_list.getProperty("clasificado").toString()));
if (category_list.hasProperty("tieneAnexos"))
doc.setTieneAnexos(Boolean.valueOf( category_list.getProperty("tieneAnexos").toString()));
if (category_list.hasProperty("nombreTipoDocumento"))
doc.setNombreTipoDocumento(category_list.getProperty("nombreTipoDocumento").toString());
if (category_list.hasProperty("nombreUnidadAdministrativa"))
doc.setNombreUnidadAdministrativa(category_list.getProperty("nombreUnidadAdministrativa").toString());
if (category_list.hasProperty("prioridad"))
doc.setPrioridad(Integer.parseInt(category_list.getProperty("prioridad").toString()));
//Date mdFechaAlta = DateFormat.parse(category_doc.getProperty("CATEGORY").toString());
lista_doc.add(doc);
}
}
pagina_doc.setDocumentos(lista_doc);
pagina_doc.setPaginaActual(Integer.parseInt(root.getProperty("paginaActual").toString()));
pagina_doc.setTotalDocumentos(Integer.parseInt(root.getProperty("totalDocumentos").toString()));
pagina_doc.setTotalPaginas(Integer.parseInt(root.getProperty("totalPaginas").toString()));
return pagina_doc;
}
|
{
"pile_set_name": "StackExchange"
}
|
[Justifications for formula supplementation in low-risk newborns at a Baby-Friendly Hospital].
The Baby-Friendly Hospital Initiative recommends not giving newborn infants any food or drink other than breast milk unless medically indicated. This study investigated the prevalence and alleged reasons for giving formula supplementation to rooming-in newborns at a Baby-Friendly Hospital. Participants were 300 formula-supplemented, exclusively rooming-in newborns at a Baby-Friendly Hospital in Rio de Janeiro, Brazil. Reasons for formula supplementation were classified as acceptable or unacceptable in accordance with the WHO/UNICEF Baby-Friendly Hospital Initiative guidelines. A supplementation prevalence of 33.3% was found. The main allegations were: hypogalactia/ agalactia (36.8%), conditions involving risk of hypoglicemia (21.1%), cesarean section (7.9%), stomatognathic system-related conditions (7.4%), maternal conditions (6.3%), and absence of maternal HIV serology (4.5%). Cesarean section was associated with a higher risk of supplementation (RP = 2.1; 95%CI: 1.77-2.55) as compared to vaginal delivery. Supplementation prevalence was high, and only 9% of the allegations were justified.
|
{
"pile_set_name": "PubMed Abstracts"
}
|
/**
* Copyright (c) 2010-2020 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.lcn.internal.connection;
import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.binding.lcn.internal.common.LcnAddrGrp;
import org.openhab.binding.lcn.internal.common.LcnException;
import org.openhab.binding.lcn.internal.common.PckGenerator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* This state discovers the LCN segment couplers.
*
* After the authorization against the LCN-PCK gateway was successful, the LCN segment couplers are discovery, to
* retrieve the segment ID of the local segment. When no segment couplers were found, a timeout sets the local segment
* ID to 0.
*
* @author Fabian Wolter - Initial Contribution
*/
@NonNullByDefault
public class ConnectionStateSegmentScan extends AbstractConnectionState {
private final Logger logger = LoggerFactory.getLogger(ConnectionStateSegmentScan.class);
public static final Pattern PATTERN_SK_RESPONSE = Pattern
.compile("=M(?<segId>\\d{3})(?<modId>\\d{3})\\.SK(?<id>\\d+)");
private final RequestStatus statusSegmentScan = new RequestStatus(-1, 3, "Segment Scan");
public ConnectionStateSegmentScan(ConnectionStateMachine context) {
super(context);
}
@Override
public void startWorking() {
statusSegmentScan.refresh();
addTimer(getScheduler().scheduleWithFixedDelay(this::update, 0, 500, TimeUnit.MILLISECONDS));
}
private void update() {
long currTime = System.nanoTime();
try {
if (statusSegmentScan.shouldSendNextRequest(connection.getSettings().getTimeout(), currTime)) {
connection.queueDirectly(new LcnAddrGrp(3, 3), false, PckGenerator.segmentCouplerScan());
statusSegmentScan.onRequestSent(currTime);
}
} catch (LcnException e) {
// Give up. Probably no segments available.
connection.setLocalSegId(0);
logger.debug("No segment couplers detected");
nextState(ConnectionStateConnected::new);
}
}
@Override
public void onPckMessageReceived(String data) {
Matcher matcher = PATTERN_SK_RESPONSE.matcher(data);
if (matcher.matches()) {
// any segment coupler answered
if (Integer.parseInt(matcher.group("segId")) == 0) {
// local segment coupler answered
connection.setLocalSegId(Integer.parseInt(matcher.group("id")));
logger.debug("Local segment ID is {}", connection.getLocalSegId());
nextState(ConnectionStateConnected::new);
}
}
parseLcnBusDiconnectMessage(data);
}
}
|
{
"pile_set_name": "Github"
}
|
Permanent Euro Fix Germany to Contribute 22 Billion Euros to New Fund
The European Union means business when it comes to saving the common currency. Finance ministers agreed on Monday to furnish the new permanent bailout fund with 80 billion euros, with the ability to call on 620 billion euros more should the need arise. The deal paves the way for agreement at an EU summit later this week.
|
{
"pile_set_name": "OpenWebText2"
}
|
A variety of bill or currency validation and stacking techniques are known in the prior art, including the following U.S. Pat. Nos. 4,628,194 (METHOD AND APPARATUS FOR CURRENCY VALIDATION), 4,722,519 (STACKER APPARATUS), 4,765,607 (STACKER APPARATUS), 4,775,824 (MOTOR CONTROL FOR BANKNOTE HANDLING APPARATUS), 5,209,395 (METHOD AND APPARATUS FOR A LOCKABLE, REMOVABLE CASSETTE, FOR SECURELY STORING CURRENCY), 5,222,584 (CURRENCY VALIDATOR) AND 5,209,335 (SECURITY ARRANGEMENT FOR USE WITH A LOCKABLE, REMOVABLE CASSETTE), all of which are assigned to the assignee of the present invention and incorporated by reference herein.
In applications where security and accountability are of particular concern, such as in the gaming industry and in certain fields of the vending industry, a number of features are particularly desirable. For example, easy front access without the use of tools to clear any currency jams or to clean the unit is desirable to ease service and minimize the downtime of units which may typically be employed in slot machines. Such easy front access is particularly advantageous for slot machines because they are typically arranged side by side and back to back or alternatively are placed side by side with their backs against a wall.
A cash or currency storage cassette should provide tamper evident security so that while a locked cassette may not survive a crowbar, torch, or the like, currency cannot be removed by an unauthorized person without telltale evidence of tampering. The cassette should also be readily lockable and removable, and upon its removal, no access to the currency validation or other electronics should be provided. Similarly, removal of the currency validator should not allow access to any money stored in the lockable removable currency cassette.
When the cassette is removed, the currency validator should not accept currency. Thus, it is highly desirable to be able to sense removal of the currency cassette. In addition, the currency cassette should have as few electronic or electrical components as possible to prevent tampering by persons charged with collecting the currency cassette, and should be robust in its design so as to include no delicate mechanical components which could be readily tampered with or which would necessitate frequent service.
Further, an accurate currency count must be maintained. To this end, each time a piece of currency is pushed into or stored in the currency cassette it must be counted so that any discrepancies between the currency found in the cassette when it is opened by an authorized person, and the currency count maintained by a slot machine with which the cassette is used, may be readily detected.
One existing product employed in slot machines attempts to provide many of the above desirable features. This product, however, includes a gear driven currency transport arrangement which is susceptible to poor gear alignment. The currency transport drive used in its currency cassette also drives its currency pusher arrangement. As a result, a gear which drives the currency cassette transport may not rotate to achieve alignment as readily as desireable. Also, the gear teeth which must mesh are fairly blunt to provide optimal torque consistent with standard gear tooth design principles; however, the bluntness of these teeth is such that the possibility of tooth head against tooth head interference is increased. When such interference occurs, jiggling and manipulation must be resorted to in an attempt to achieve proper meshing and alignment. Alternatively, if one attempts to force the teeth to mesh, damage to the unit may occur.
In an effort to provide tamper evident security, this product provides a lockable removable cassette made out of metal which is riveted or welded. This patent, however, has a relatively complex structure which tends to result in higher cost of manufacture and a higher cost of repair.
Further, this product includes an optical source and sensor to detect stacking of currency in the cassette, and an electronic connecting plug that must be connected to a utility plug in the currency validation portion of the unit. The sensing arrangement reduces the maximum available width of cassette which can fit within a given outer form factor. This limitation prevents widening the cassette adapted to accept U.S. currency, for example, to accept both U.S. currency and a wider currency such as Canadian currency for example.
This product also employs two separately driven currency transports requiring two power supplies. The two separate drives may not be perfectly synchronized resulting in currency buckling or jamming.
A secure product which is easier and less expensive to manufacture, as well as easier to service or repair, is highly desirable.
|
{
"pile_set_name": "USPTO Backgrounds"
}
|
Functionality of natural killer cells from end-stage cancer patients exposed to coherent electromagnetic fields.
The main objective of our study is to investigate whether an enhancement of the immune system in end-stage cancer patients is achieved by exposure to coherent electromagnetic fields. For this reason, 15 end-stage cancer patients were exposed at low intensity, coherent electromagnetic fields at radiofrequencies ranging from 600 kHz-729 Hz, for 8 h/day, 6 days/week for 4 weeks. NKs number and cytotoxicity of NK T-lymphocytes versus K562 cancer cell line were estimated by flow cytometry, before and after exposure. Data showed that the exposure of the end-stage cancer patients to the coherent electromagnetic fields resulted in a significant increase of the number and the cytotoxicity of the NK T-lymphocytes against cancer cells, in all patients. Exposure to coherent EMFs at radiofrequencies increases the number and cytotoxicity of NK T-lymphocytes, which may contribute to the improvement of cancer patients' status.
|
{
"pile_set_name": "PubMed Abstracts"
}
|
Featured Shows
Weekday
Weekend
When bad analogies go horribly awry
09/13/12 09:57 AMUpdated 08/07/13 08:15 AM
When bad analogies go horribly awry
Getty Images
As we talked about a couple of months ago, Senate Minority Whip Jon Kyl (R-Ariz.) isn’t exactly going out on top of his game. The far-right Arizonan is wrapping up his lengthy congressional career at the end of the year, but he’s departing on the heels of several sour notes, which have made him appear, at various times, dishonest, confused, and obstinate.
Senator Jon Kyl of Arizona, the second ranking Republican, lambasted the embassy statement, which was released before the deaths in Benghazi and was critical of the anti-Islamic video.
“I don’t know if you’ve ever been involved in victims’ rights, but this is like a judge telling the woman that got raped, ‘you asked for it because of the way you dressed,’ ” Mr. Kyl said. “That’s the same thing. ‘Well America, you should be the ones to apologize. You should have known this would happen’,” he said. “For a member of our State Department to put out a statement like that, it had to be cleared by somebody. They don’t just do that at the spur of the moment.”
In context, Kyl was trying to condemn a statement from the U.S. Embassy in Cairo, which, six hours before Egyptian protests, criticized anti-Muslim bigotry in a fringe YouTube video. It was consistent with a bipartisan tradition of diplomacy that was common throughout the Bush/Cheney era.
It didn’t say America apologizes; it didn’t say America should apologize; and it didn’t say we “should have known this would happen.” (Kyl didn’t specify what “this” he was referring to.)
And for crying out loud, it’s no way similar to saying rape victims deserved to be attacked based on their clothing. Go ahead and read the statement – it’s about respect for religious diversity; not blaming anyone for attacks that hadn’t taken place yet.
Indeed, given that it came hours before the protests, Kyl’s rape analogy is strikingly dumb, but his incoherent chronology is obvious nonsense.
|
{
"pile_set_name": "Pile-CC"
}
|
Q:
Why are the angle brackets before the return type omitted sometimes from the definition of a generic method
I was reading Effective Java chapter 5 about generics, in particular the items on preferring generic methods. I noticed that sometimes the type parameter(between angle brackets) in the method declaration before the return type is sometimes omitted. There are many cases like that, but for example on page 135 of the second edition:
public void popAll(Collection<E> dst) {
while (!isEmpty())
dst.add(pop());
}
On the other hand, I have seen similar generic methods with the declaration
public <E> void ...
Is the first one a typo? If not when can I omit the brackets from the declaration?
Thanks
A:
The difference is that in the first case the whole class is declared generic whereas in the second case only the method is generic.
A:
E is a type variable -- it stands in for some other type, like String or Integer. So just as you can't understand dst.add(pop()) without knowing where and how dst was defined, you can't understand a method declaration like popAll(Collection<E> dst) without knowing where and how the type variable E is defined. In the case of popAll, the type variable E is defined at the class level: Stack<E>: it's the type of the elements in the stack. You'll often even see it javadoc'd:
/**A Stack of elements
*
*@param E The type of elements in the stack */
public class Stack<E>{
public void popAll(Collection<E> dst){ ... }
}
On the other hand, when you see a method declaration like public <E> void ..., the type variable E is being declared (not referenced from some enclosing scope like the enclosing class). In fact most times when you see a method with its own type variable, it's a static method, so there is no enclosing instance of the class to establish the value of E.
In both cases, what is the E type variable doing? It's telling us how two different types have to relate to each other. In popAll, it's telling us that the element type of the collection you want to put the popped elements into has to match the element type of the stack you're popping them from.
Similarly, take the example from page 136:
public class ListUtils{
public static <E> E reduce(List<E> list, Function<E> f, E initVal);
}
Here, the E type variable tells us that the element type of list has to match the argument type of f and the type of initVal. The surrounding class does not define E for us, it's only meaningful in the scope of the reduce method declaration.
|
{
"pile_set_name": "StackExchange"
}
|
Shadow depth cues and endoscopic task performance.
A shadow-inducing laparoscopic system improves task performance. Experimental study was carried out using the Dundee Endoscopic Psychomotor Tester for objective assessment of task performance. The standard exercise consisted of passing a probe through 37 holes on the target plate in a random order. Shadow was induced by using separate ports for illumination and imaging of the target plate. Light direction-to-target (LDT) angles of 90 degrees, 75 degrees, and 60 degrees were investigated with each of the 90 degrees and 75 degrees optical axis-to-target view angles. Research laboratory at the Surgical Skills Unit, Ninewells Hospital. Twenty medical students with no previous exposure to laparoscopic surgery. Success score, execution time, the force applied on the target, and angular deviations of the probe. With a 90 degrees optical axis-to-target angle, there was improvement in the success score using either 75 degrees or 60 degrees LDT angles compared with a 90 degrees LDT angle (P =.02, P =.01, respectively), but the execution time became longer (P =.008, P =.03, respectively). With a 75 degrees optical axis-to-target angle, there was improvement in the success score (P<.001), execution time (P<.001, P =.03, respectively), and horizontal and vertical deviations (P<.001) on using either 90 degrees or 60 degrees LDT angles compared with a 75 degrees LDT angle. Endoscopic task performance significantly improves with a system that provides illumination and shadows in the operative field.
|
{
"pile_set_name": "PubMed Abstracts"
}
|
The instant invention relates generally to window covering devices and more specifically it relates to a screen and storm window cover.
Numerous window covering devices have been provided in prior art that are adapted to be removably mounted to existing windows to act as screen or storm windows. For example, U.S. Pat. Nos. 3,251,399: 4,068,428 and 4,249,589 are all illustrative of such prior art. While these units may be suitable for the particular purpose to which they address, they would not be as suitable for the purpose of the present invention as heretofore described.
|
{
"pile_set_name": "USPTO Backgrounds"
}
|
Q:
Toggle between UIviews in Xcode
I am a newbie in xcode and still learning its very basics. If my question feels too basic, please bear with me.
I have a view, which is my main view. When user clicks on a button (Options Button), I want to go to a second view. Here user can select one option from many available.
Once user selected his option, I want to send this value back to first view and resume processing from where it was (when user clicked the Options Button).
Important - User will be moving from view1 to view2 in the mid of processing. I have to join back from view2 to view1 and resume from exactly where I left off... this means, i need all variable values to be available.
A:
A push segue won't create a new version of the parent view controller. Are you starting the session processing in viewDidLoad or in viewDidAppear / viewWillAppear? Are you stopping processing in viewWillDisappear? In viewWillDisappear, you can check the navigation controller's stack to see if your parent view has been covered or is being popped from the stack using this code snippet:
- (void)viewWillDisappear:(BOOL)animated {
if ([[[self navigationController] viewControllers] indexOfObject:self] == NSNotFound) {
// we are disappearing. Clean up the session.
...
}
[super viewWillDisappear:animated];
}
You can store (limited amounts of) state in the view controller, using UIViewController's encodeRestorableStateWithCoder: method - check the documentation. I don't use it myself but it could help.
By the way, you may find it easier to use UIViewController's done:, reset: and canPerformUnwindSegueAction:fromViewController:withSender: rather than create delegate protocols. Unwind segues were introduced in iOS 6 and require less code than delegates.
|
{
"pile_set_name": "StackExchange"
}
|
File syncing, or making the most up-to-date version of your files available to you anytime, anywhere, somewhat effortlessly, has singlehandedly changed basic workflows for people who have multiple computers and mobile devices. Say you have files on your office computer than you want to edit from home. A file-syncing service puts those files in your hands without requiring you to lug home a clunky laptop or worry about emailing files to yourself, which is sloppy and error-prone. And with half a dozen very good file-syncing services available, finding the one that meets your needs can eat up precious time.
//Compare Similar Products
Box, formerly Box.net and now sometimes referred to as Box.com, deserves serious consideration by anyone looking for a file-syncing service. Although its fee-based version for businesses offers a more enticing proposition than its free Personal edition. (This review considers the latter.) Boxhas a few unique features that you won't find in other file-syncing services, as well as a decent 5GB of free storage space to start. A paid account will buy you more space and several additional security and collaboration features, but at a much higher price than what'll pay for most other services (more pricing details below).
Because Box has some online document creation and editing capabilities, it's more closely comparable with Google Drive (formerly Google Docs, and now with localized syncing included) and SkyDrive than Dropbox or SugarSync. Head-to-head, Box just can't beat Google or SkyDrive. Historically, it didn't have to, though. Box was a great solution to tough problem before Google Drive existed and before SkyDrive reached its current and mature iteration. Box can actually integrate with Google Drive, but why would you need it to when Google can take now care of all your file-syncing and online document creation and editing problems on its own?
Neither Dropbox nor SugarSync offers online document creation and editing, but for their stated purpose (file-syncing), they both work smoothly and across a multitude of devices. Box sits somewhere between those two options and Google Drive, not quite reaching the bar set by Google, but exceeding the capabilities of Dropbox and SugarSync.
The BasicsA Box account starts with creating a login and downloading some light apps to the devices that you want to synchronize. You can download and install the desktop apps, Box Sync for Windows or Mac, to sync local files on your computer, and on mobile devices, it's compatible with Android, BlackBerry, iOS, and Windows Phone.
The installed Box worked fairly seamlessly on the Mac where I installed it, showing up as Box Documents which contained a folder called Default Sync Folder (in the directory /users/name/Box Documents). This set up mirrors Dropbox in some sense. Both find a default location and put a folder there for you. End of story. SugarSync, on the other hand, lets you choose which folders you want to sync (in addition to giving you one dedicated SugarSync folder). Anyone who is familiar with the ins and outs of file syncing will likely prefer SugarSync's method, but the simpler solution works, too.
When Box is syncing your files, you'll see a little orange syncing image on the left side of the file or folder icon (see the slideshow). When a file or folder has fully synced, the tiny icon for it will have a blue circle with white checkmark.
Anything put into the synced folder becomes accessible via Box's Web app, and also synchronized across other devices on which you install Box. If you don't have one of your connected devices with you, your files are still accessible via the Box website. From there, you can download files, upload new versions (if you're working on a shared or public computer, for example), create new Web files either with Box's document editor or Google's, share files, add tags, and more.
Box's ability to create files right from the website would be a huge deal if it weren't already available in Google Drive and SkyDrive. Google Drive and SkyDrive both have more file formats, plus thorough exporting capabilities, so you can export a spreadsheet, for example, from Google Drive or SkyDrive to .xlsx, .txt, .csv, .pdf, and so forth. Box doesn't.
Box in Use When I first started syncing files on the Mac where I had installed the syncing app, I dumped them into the Box Document area, which shows up in the Finder window under Favorites, alongside Applications, Downloads, Music, and Pictures. It's not a folder you can move. I balked when the files jumped into the Default Sync Folder (a folder that's automatically created within the Box Document space) all on their own. I guess Box wants you to keep your files tidy in a folder, but I'm the kind of user who wants to know exactly where my data is stored, which is part of the appeal of SugarSync. SugarSync gives you the keys to the car, whereas Dropbox and Box play chauffer (well, their default settings do anyway).
Jill Duffy is a writer and senior analyst, specializing in productivity apps and software, iOS, as well as apps and gadgets for health and fitness. She writes the weekly Get Organized column, with tips on...
Automatic Renewal Program: Your subscription will continue without interruption for as long as you wish, unless
you instruct us otherwise. Your subscription will automatically renew at the end of the term unless you authorize
cancellation. Each year, you'll receive a notice and you authorize that your credit/debit card will be charged the
annual subscription rate(s). You may cancel at any time during your subscription and receive a full refund on all
unsent issues. If your credit/debit card or other billing method can not be charged, we will bill you directly instead. Contact Customer Service
//our current issue
Select Term:
24 issues for $29.99 ONLY $1.25 an issue! Lock in Your Savings!
12 issues for $19.99ONLY $1.67 an issue!
State
Country
This transaction is secure
Automatic Renewal Program: Your subscription will continue without interruption for as long as you wish, unless
you instruct us otherwise. Your subscription will automatically renew at the end of the term unless you authorize
cancellation. Each year, you'll receive a notice and you authorize that your credit/debit card will be charged the
annual subscription rate(s). You may cancel at any time during your subscription and receive a full refund on all
unsent issues. If your credit/debit card or other billing method can not be charged, we will bill you directly instead. Contact Customer Service
|
{
"pile_set_name": "Pile-CC"
}
|
An enantioselective inverse-electron-demand imino Diels-Alder reaction.
The imino Diels-Alder reaction is an efficient method for the synthesis of aza-heterocycles. While different stereo- and enantioselective inverse-electron-demand imino Diels-Alder (IEDIDA) reactions have been reported before, IEDIDA reactions including electron-deficient dienes are unprecedented. The first enantioselective IEDIDA reaction between electron-poor chromone dienes and cyclic imines, catalyzed by zinc/binol complexes is described. The novel reaction provides a facile entry to a natural product inspired collection of ring-fused quinolizines including a potent modulator of mitosis.
|
{
"pile_set_name": "PubMed Abstracts"
}
|
Resources
Explore the many opportunities for personal growth and social connection our parish has to offer by visiting the pages of the dozens of organizations that meet on our campus. If you're looking for a specific organization, you can use the search box.
|
{
"pile_set_name": "Pile-CC"
}
|
Carlton Hayes Hospital
Carlton Hayes Hospital, Narborough, Leicestershire was the psychiatric hospital of Leicestershire from 1907 to 1995.
History
The complex was built to the designs of Samuel Perkins Pick (1858-1919), a well-known Leicester architect, in the Art Nouveau style as the Leicestershire County Asylum and was officially opened on 1 October 1907. It became known as the Leicestershire and Rutland Mental Hospital in 1914.
Significant extensions designed by William Keay were completed in the 1930s. It became Carlton Hayes Hospital in 1939 and joined the National Health Service in 1948. Philip Larkin's mother was a patient in the hospital in 1956: he described it as "large and dingy as a London terminus".
The complex was demolished after 1996, and the site redeveloped by the Alliance & Leicester Building Society for their new headquarters.
References
Category:Former psychiatric hospitals in England
Category:Hospital buildings completed in 1904
Category:Hospitals in Leicestershire
Category:History of Leicestershire
Category:Defunct hospitals in England
Category:Hospitals established in 1904
Category:1904 establishments in England
Category:1995 disestablishments in England
Category:Hospitals disestablished in 1995
Category:History of mental health in the United Kingdom
|
{
"pile_set_name": "Wikipedia (en)"
}
|
Smoke or Fog Machine Photography Studio Fun
Using a Fog Machine to create atmospheric effects
After cleaning out the garage recently I came across a fog machine that I had stored way back among the Halloween party decorations.
I haven’t used it in year and also tossed it in the tag sale pile but then it hit me, why not use it in my photography studio for some atmospheric, book cover images?
So I’ve been experimenting recently. The smoke machine or fog machine I have uses “fog juice” and a heating element to create a smoky fog that lifts into the air. Unlike dry ice which creates vapor that drops to the ground.
This fog machine is good for a small production or party use. Here are some of the answers to questions I had before I bought the machine. Hope this will help you: 1. The size of the machine is 8.5″ x 6″ x 6″ 2. There is a bottle in the back where you pour the fog juice in 3. On the right side, there is a slot, so you can see the level of the liquid 4. On the left side, on top is the plug in for the remote control; below that is the fuse; and on the bottom is the power cable. 5. The power cable is 6′ long 6. The remote control has a 10′ long cable. On the remote control, there is a light on top with an on/off switch on the bottom. 7. According to the specs, the container in the fog machine can hold 1 pint of juice. 8. To create fog, fill the tank with juice, plug in the machine, in about 4 minutes the light on the remote control will light up, signaling the machine is hot enough to use. Press and hold the spring loaded on/off switch will release fog from the nozzle. 9. When the juice is heated up, you can release 40 seconds of fog before it need to reheat the element again, which takes about 3 minutes. 10. I have filled half the tank with juice, it lasted me for a good hour of use.
Get the best fog juice for your machine. Some fog juice is designed to dissipate quickly to fill a stage area with clouds so lights and lasers can be seen better. Other formula’s of fog juice are designed to say on the ground for spooky graveyard like effects. These effects are typically better with more expensive fog machines that include a chilling element (ice bin) to create cold air to keep the fog low on the ground.
Keep in mind that when photographing fog or smoke say from a extinguished candle, incense burner or even cigar smoke or vapor from an e-cigarette, the lighting makes a big difference.
Flash strobes will freeze the smoke or fog while a long exposure will even it out.The following images were created with smoke from a incense and studio strobe lights.
The smoke and steam of this image was captured separately and then added in Photoshop.
The steamy, foggy atmosphere in this steam train images was a combination of cloud and fog images.
|
{
"pile_set_name": "Pile-CC"
}
|
Polycarbonates (PC) are synthetic thermoplastic resins derived from bisphenols and phosgenes, or their derivatives. They are linear polyesters of carbonic acid and can be formed from dihydroxy compounds and carbonate diesters, or by ester interchange. Polymerization may be in aqueous, interfacial, or in nonaqueous solution. Polycarbonates are a useful class of polymers having many desired properties. They are highly regarded for optical clarity and enhanced impact resistance and ductility at room temperature or below.
Impact modifiers are incorporated into polymeric resins to improve the impact strength of finished articles made from such resins. Exemplary impact modifiers include acrylonitrile-butadiene-styrene (ABS) and methacrylate-butadiene-styrene (MBS) polymers. ABS and MBS polymers are synthetic thermoplastic resins made by polymerizing acrylonitrile or methacrylate, respectively, with styrene in the presence of polybutadiene. The properties of ABS and MBS can be modified by varying the relative proportions of the basic components, the degree of grafting, the molecular weight, etc. Overall, ABS and MBS are generally strong, and lightweight thermoplastics.
Flame retardant (FR) polycarbonate/acrylonitrile-butadiene-styrene blends are used in a variety of applications such as computer and business equipment, battery chargers, industrial housings, etc. These amorphous thermoplastic blends have many desired properties and/or characteristics, including high impact strength, heat resistance, good processability, weather and ozone resistance, good ductility, electrical resistance, aesthetic characteristics, etc. However, when making thin-walled parts, it is generally beneficial to provide a flow promoter to lower the melt viscosity and better enable the composition to be formed into a thin-walled part using a molding process. For non-flame retardant compositions, the use of a flow promoter is not problematic. However, as many flow promoters can themselves be flammable, their use in flame retardant compositions has been limited.
Accordingly, it would be beneficial to provide a flame retardant polycarbonate resin composition that includes flow promoters to help produce thin-walled parts but that does not have the issues associated with flame retardance and/or impact properties. It would also be beneficial to provide a flame retardant polycarbonate resin composition that has improved physical properties, such as heat deflection temperature, modulus and/or impact strength, despite the inclusion of a flow promoter.
|
{
"pile_set_name": "USPTO Backgrounds"
}
|
Show HN: How to Setup Node.js App Automated Deployment and CI with PM2 for MVP's - niftylettuce
http://niftylettuce.com/posts/automated-node-app-ci-graceful-zerodowntime-github-pm2/
======
nodesocket
pm2 is by far the best node process manager. It is excellent.
Though I don't use pm2 for deployments. I create new servers (immutable
infrastructure) on AWS every deploy, and use NGINX Plus dynamic upstream to
add the new backends and remove the old ones. There is something pleasing
about creating new servers and destroying old servers every deploy.
Also check out Drone
([https://github.com/drone/drone](https://github.com/drone/drone)) for all
your CI and deployment needs. It uses Docker and written in go.
~~~
smaili
Launching new instances on a per deploy basis is one of the most absurd things
I've ever heard.
~~~
adrianpike
Serious question, why do you think that? I'm not that familiar with why this
would be super wasteful and would love to learn more.
~~~
cosmie
I wouldn't say it's super wasteful, but there is waste involved since he's on
AWS. AWS bills EC2 usage hourly, and doesn't do fractional billing. If you
deploy, then 5 minutes later deploy again (and provision a new instance and
destroy the first) you'll still pay for the full hour of that first instance.
So every deploy incurs that usage rounding. Depending on the frequency of
deploys and the number of servers being deployed to, that adds up.
------
lioeters
Thank you for taking the time to write such a helpful, detailed article. With
links/references, screenshots, and fool-proof instructions, it's been
educational to follow along.
I'd used Jenkins before (that someone else had set up) and was familiar with
much of the other parts (DigitalOcean, Node.js, PM2, etc.), but had never
properly learned how to set up CI for myself. This article was a great
introduction.
Now studying your Rapid MVP Standards document
([https://github.com/niftylettuce/rapid-mvp-
standards](https://github.com/niftylettuce/rapid-mvp-standards)). I appreciate
you sharing your experience and knowledge!
~~~
niftylettuce
You are welcome. Thank you for the kind words. My email is
niftylettuce@gmail.com if you'd like to get in touch or ask questions, or if I
can help somehow.
------
azurelogic
I just use Codeship's free plan for CI/CD. I embedded the deploy script in my
repo and use Codeship to run it via SSH. Works great and costs $0.
------
vonklaus
looks good, I've been trying to find a free CI(never used one) but they're
usually non-trivial to set up or cost money. This looks like a decent write up
and semaphore seems pretty user friendly, just wish they had gitlab support.
------
benatkin
PM2 is under the AGPL. Could this be an issue on a non-AGPL project?
|
{
"pile_set_name": "HackerNews"
}
|
What Makes PEP Special?
There are so many things that make PEP for
Seniors so special. Our caring staff of trained professionals work
together as a team to provide exceptional service to each and every
senior in our program. Plus, in addition to the many other services and
programs that we offer, PEP provides:
Volunteer Opportunities. Please contact PEP if you are interested in learning more.
Intergenerational Programming.
Provides an opportunity for PEP seniors to participate in a variety of
activities with children and young adults in the Parkchester community.
Chore Service.
PEP partners with a local agency to provide limited assistance with
light housekeeping and laundry at a discounted rate for seniors in
Parkchester.
Errand Service. YAI/National Institute for People with Disabilities provides shopping service for a number of our homebound seniors.
Download Our Newsletter
PEP Talks is PEP for Seniors' monthly newsletter, distributed to approximately 12,000 households in the Parkchester Condominiums, and to a few other places in the community. Please click here (PDF, 829.6KB) to download our most recent issue.
Calendar of Activities
If you reside in the Parkchester Condominiums and are 60 years of age or older, you are eligible to receive services from PEP. If you do not reside in the Parkchester Condominiums, you are not eligible to receive our Social Work or Nursing services, but we encourage you to join us for activities, lectures and classes. Please click here (PDF, 35KB) to view the course schedule for this month.
|
{
"pile_set_name": "Pile-CC"
}
|
In its latest annual summary published at the end of June, the IIF found that total nominal global debt had risen to a new all time high of $217 trillion, or 327% of global GDP...
... largely as a result of an unprecedented increase in emerging market leverage.
While the continued growth in debt in zero interest rate world is hardly surprising, what was notable is that debt within the developed world appeared to have peaked, if not declined modestly in the latest 5 year period. However, it now appears that contrary to previous speculation of potential deleveraging among EM nations, not only was this conclusion incorrect, but that developed nations had been stealthily piling on just as much debt, only largely hidden from the public eye, in the form of swaps and forwards.
According to a just released analysts by the Bank of International Settlements, "FX swaps and forwards: missing global debt?" non-banks institutions outside the United States owe large sums of dollars off-balance sheet through instruments such as FX swaps and forwards. The BIS then calculates what balance sheets would look like if borrowing through such derivative instruments was recorded on-balance sheet, as functionally equivalent repo debt, and calculates that the total "is of a size similar to, and probably exceeding, the $10.7 trillion of on-balance sheet dollar debt", potentially as much as $13-14 trillion.
* * *
The BIS then provides substantial background data on who, where and how uses FX swaps (as both a lender and borrower), as well as where this "missing debt" can be found when looking away from the balance sheet. Here are the details:
Every day, trillions of dollars are borrowed and lent in various currencies. Many deals take place in the cash market, through loans and securities. But foreign exchange (FX) derivatives, mainly FX swaps, currency swaps and the closely related forwards, also create debt-like obligations. For the US dollar alone, contracts worth tens of trillions of dollars stand open and trillions change hands daily. And yet one cannot find these amounts on balance sheets. This debt is, in effect, missing. As a result, we know little about it. How much is owed, by whom and for what purpose: trade hedging, asset-liability management, market-making? What does it imply for measures of international credit like the BIS global liquidity indicators (GLIs)? Answers to these questions can inform assessments of global financing conditions and financial stability. For instance, serious strains seized the FX swap market during the Great Financial Crisis (GFC). In response, central banks had to replace lost dollar funding that financed dollar assets. This special feature frames the issues and suggests some answers. To do so, it breaks ground in combining data on the aggregate amount of outstanding derivatives contracts (from the BIS derivatives statistics) with information from the international banking statistics and from ad hoc surveys to form a view of the size, geography and use of the missing foreign currency debt. The more detailed analysis focuses on the dollar segment, given the currency's outsize role in the foreign exchange and other financial markets. The debt remains obscured from view. Accounting conventions leave it mostly off-balance sheet, as a derivative, even though it is in effect a secured loan with principal to be repaid in full at maturity. Only footnotes to the accounts report it.
To be sure, the main reason to resort to derivatives such as swaps and forwards is precisely to keep it as obscure and hidden from the public eye as possible. Further complicating matters is the ongoing debate of just what happens when gross derivative notional collapses to net, and just where the liability resides. What is publicly known and disclosed largely remains in the domain of gross notionals; the BIS summarizes it as follows:
The outstanding amounts of FX swaps/forwards and currency swaps stood at $58 trillion at end-December 2016 (Graph 1, left-hand panel). For perspective, this figure approaches that of world GDP ($75 trillion), exceeds that of global portfolio stocks ($44 trillion) or international bank claims ($32 trillion), and is almost triple the value of global trade ($21 trillion). The outstanding amount has quadrupled since the early 2000s but has grown unevenly (Graph 1, left-hand panel). After tripling in the five years to 2007, it fell back sharply during the GFC, even more than international bank credit. This most likely reflected a reduction in hedging needs, as both trade and asset prices collapsed.
Another problem with such debt-masking derivatives is that they are largely short-term in nature, a problem which violently emerged during the Global Financial Crisis when an overnight freeze in shadow banking and other non-bank lending conduits effectively resulted in a liquidity crunch for many of the world's largest financial institutions, forcing central banks around the globe to step in and provide trillions in short-term funding.
The maturity of the instruments is largely short-term (Graph 1, centre and right-hand panel). At end-2016, three quarters of positions had a maturity of less than one year and only a few percentage points exceeded five years. Turnover data show that the modal forward (a customer-facing instrument) matures between one week and one year while the modal swap (an inter-dealer instrument) within a week (BIS (2016)). The long-term share has risen since the 2000s, as capital markets have boomed.
In terms of currency distribution, it's all about the US dollar, or as the BIS puts it, "the dollar reigns supreme in FX swaps and forwards. Its share is no less than 90% (Graph 2), and 96% among dealers (Table 1)."
Both exceed its share in denominating global trade (about half) or in holdings of official FX reserves (two thirds). In fact, the dollar is the main currency in swaps/forwards against every currency. For instance, it predominates in forwards in the Norwegian krone, the Swedish krona and the Polish zloty, currencies that trade in the spot market more against the euro
With north of $50 trillion in total notional FX derivatives, it is hardly surprising that the daily trading volumes are massive: while outstanding amounts lump FX swaps with forwards, turnover data show that FX swaps are the instrument of choice. Swaps/forwards and currency swaps amounted to over $3 trillion per day in 2016, over 60% of total FX turnover. Of that, FX swaps accounted for three quarters, forwards for 22% and currency swaps for the rest.
The next question is who are the counterparties reliant on such FX exposure.
According to the BIS, the counterparty breakdown of outstanding amounts provides a big-picture indication of obligors and, indirectly, uses (Table 1). Reporting dealer positions vis-à-vis customers amount to $33 trillion, or over half (57%) of the total; the rest, $25 trillion, are positions among reporting institutions themselves ("inter-dealer"). This large share is a trademark of decentralised, over-the-counter (OTC) markets. Non-dealer financial firms bulk large among customers, with a share of about 80%.
A further breakdown of the client base reveals widespread usage among both non-financial, non-bank financial as well as bank entities. A quick summary of each category, as well as their principal considerations:
Non-financial customers: international trade and liability hedging . Apart from speculative use, the non-financial sector employs FX forwards and currency swaps to hedge international trade and foreign currency bonds, notably those issued to cheapen funding costs. Since most international trade contracts are short-term, forwards serve as hedges. One can relate non-financial FX swaps/forwards and currency swaps, in an admittedly stylised fashion, to international trade and bond issuance, respectively. If firms use $5.1 trillion of short-term FX forwards to hedge global trade of $21 trillion, then the ratio implies that importers and exporters hedge at most three months' trade. Similarly, if firms and governments use $2.4 trillion of currency swaps to hedge $4.8 trillion of international bonds, then they hedge half or less.
Apart from speculative use, the non-financial sector employs FX forwards and currency swaps Since most international trade contracts are short-term, forwards serve as hedges. One can relate non-financial FX swaps/forwards and currency swaps, in an admittedly stylised fashion, to international trade and bond issuance, respectively. If firms use $5.1 trillion of short-term FX forwards to hedge global trade of $21 trillion, Similarly, if firms and governments use $2.4 trillion of currency swaps to hedge $4.8 trillion of international bonds, then they hedge half or less. Non-bank financial customers: hedging assets and liabilities . Other non-bank financial firms come in two groups. The first comprises institutional investors, asset managers and hedge funds that use FX forwards to hedge their holdings and to take positions . The second includes non-bank financial firms that use currency swaps to hedge their FX bonds . A quick look at the two groups: institutional investors and asset managers use outright forwards (90% and 69%, respectively), followed by FX swaps (48% and 33%) and, to a lesser extent, currency swaps (37% and 19%). Hedge ratios vary by asset class. Those for foreign currency bonds range from 50 to 100%; those for foreign equities 20 to 60%. Heavy use of FX forwards widens maturity mismatches . The $6.6 trillion in currency swaps that non-bank financial firms have contracted stand at almost 80% of their outstanding international debt securities.
Other non-bank financial firms come in two groups. . . A quick look at the two groups: institutional investors and asset managers use outright forwards (90% and 69%, respectively), followed by FX swaps (48% and 33%) and, to a lesser extent, currency swaps (37% and 19%). Hedge ratios vary by asset class. Those for foreign currency bonds range from 50 to 100%; those for foreign equities 20 to 60%. . The $6.6 trillion in currency swaps that non-bank financial firms have contracted stand at almost 80% of their outstanding international debt securities. Banks: FX swaps were a key part of non-US banks' total US dollar funding, amounting to an estimated $0.6 trillion, roughly 6% of the total in March 2017. The rest, about $9.4 trillion, mostly took the form of deposits from US and non-US non-banks (red and blue areas), and dollar debt securities (yellow area).
Drilling down into the last category, which is of most relevance for the topic of "masking" debt exposure, the BIS writes that banking systems can be sorted into US dollar net borrowers and lenders via FX swaps (Graphs 5 and 6). As noted, net borrowers' balance sheets show more dollar assets than liabilities, offset by missing off-balance sheet dollar debt. Net borrower banks use these dollars, along with those from FX reserve managers (red lines), to fund claims on non-banks (green lines) and other banks (solid and dashed blue lines).
Based on the chart above:
Japanese banks had by far the largest on-balance sheet mismatch in dollar positions at end-Q1 2017 (top right-hand panel). They were net borrowers of an estimated $1 trillion via FX swaps.Borio et al (2016) argue that constraints on global banks' balance sheets, combined with increasing demand for cross-currency funding by Japanese banks, pension funds and other non-bank financial entities, led the yen/dollar basis to widen after 2014.
(top right-hand panel). They were net borrowers of an estimated $1 trillion via FX swaps.Borio et al (2016) argue that constraints on global banks' balance sheets, combined with increasing demand for cross-currency funding by Japanese banks, pension funds and other non-bank financial entities, led the yen/dollar basis to widen after 2014. Several large European banking systems also draw dollars from the FX swap market to fund their international dollar positions (top centre panel). Pre-GFC, German, Dutch, UK and Swiss banks, in particular, had funded their growing dollar books via interbank loans (blue lines) and FX swaps (shaded area). The meltdown in dollar-denominated structured products during the crisis caused funding markets to seize up and banks to scramble for dollars. Markets calmed only after coordinated central bank swap lines to supply dollars to non-US banks became unlimited in October 2008. Post-GFC, these European banks' aggregate dollar borrowing via FX swaps declined, along with the size of their dollar assets. In particular, German, Swiss and UK banks reduced their combined reliance on FX swaps from $580 billion in 2007 to less than $130 billion by end-Q1 2017.
(top centre panel). Pre-GFC, German, Dutch, UK and Swiss banks, in particular, had funded their growing dollar books via interbank loans (blue lines) and FX swaps (shaded area). The meltdown in dollar-denominated structured products during the crisis caused funding markets to seize up and banks to scramble for dollars. Markets calmed only after coordinated central bank swap lines to supply dollars to non-US banks became unlimited in October 2008. In particular, German, Swiss and UK banks reduced their combined reliance on FX swaps from $580 billion in 2007 to less than $130 billion by end-Q1 2017. Australian banks (bottom left-hand panel), have relied on direct dollar interbank and bond borrowing (blue line) to fund mostly Australian dollar investments at home, and with an estimated $200 billion in FX swaps hedging the currency risk. Selected European and non-European banking systems add almost $300 billion to this total.
To summarize, non-US banks' net dollar lending through the FX swap market falls short of their net borrowing, with the gap widening over time (Graph 6, right-hand panel); dollar borrowing against other major currencies, like the yen and the euro (left-hand panel), exceeds dollar lending against secondary and emerging market currencies (centre panel).
* * *
Now that we know the borrowers, who are the lenders to non-US banks vis FX swaps? Four candidates are: US banks, central banks, European agencies and supranational organisations, and private non-banks. All of these appear to provide some funding, with US banks and central banks together closing about half the gap.
As regards the first candidate, US banks naturally lend dollars via FX swaps : $150 billion in the latest data . This figure combines positions from offices outside and inside the United States.
: . This figure combines positions from offices outside and inside the United States. Second, central banks lend dollars via FX swaps against either their own currency or third currencies . Against their own currency, some Asian central banks provide about $200 billion in swaps as they manage the domestic liquidity consequences of FX reserve accumulation (Graph 8, left-hand panel). They first buy dollars spot (increase their FX reserves) and then drain domestic liquidity by swapping (lending) the dollars for (against) domestic currency. On net, however, central banks' dollar supply against their own currencies is close to zero, since other central banks are actually borrowing dollars via FX swaps. They do so in order to finance their accumulation of FX reserves without incurring currency risk ("borrowed reserves"). Against foreign currencies, some central banks lend dollars via swaps in the management of their FX reserve portfolio. For instance, the Reserve Bank of Australia swaps US dollars for yen (Debelle (2017)). We estimate that such operations by reserve managers sum to at least $300 billion
. Against their own currency, some Asian central banks provide about $200 billion in swaps as they manage the domestic liquidity consequences of FX reserve accumulation (Graph 8, left-hand panel). On net, however, central banks' dollar supply against their own currencies is close to zero, since other central banks are actually borrowing dollars via FX swaps. They do so in order to finance their accumulation of FX reserves without incurring currency risk ("borrowed reserves"). Against foreign currencies, some central banks lend dollars via swaps in the management of their FX reserve portfolio. For instance, the Reserve Bank of Australia swaps US dollars for yen (Debelle (2017)). We estimate that such operations by reserve managers sum to at least $300 billion
Third, European supranationals and agencies have opportunistically borrowed dollars to swap into euros to lower their funding costs. While their operations mostly require euros, they have done so to take advantage of the breakdown in covered interest parity. Five European supranationals and agencies together had over $400 billion in dollar debt in June 2017 . These alone have provided $300 billion in swaps against the euro.
While their operations mostly require euros, they have done so to take advantage of the breakdown in covered interest parity. . These alone have provided $300 billion in swaps against the euro. Fourth, non-bank private sector entities can provide hundreds of billions of dollars. Like US banks, US-based asset managers are obvious candidates. In June 2014, the then largest US bond fund, PIMCO's Total Return Fund, reported $101 billion in currency forwards, no less than 45% of its net assets. Since the overall US holdings of foreign currency bonds were $600 billion at end-2015, a 50% hedge ratio would extrapolate to $300 billion. On the equity side, US investors' hedge ratios are thought to be 40-50% for advanced economy equities. In addition, US firms that hold cash in offshore affiliates to avoid US corporate tax on repatriated earnings could be sizeable lenders as well.
* * *
Putting the above together, the BIS calculates that according to its estimates of "on-balance sheet" dollar debt equivalents of non-banks outside the United State, such cash market obligations, both bank loans and bonds, totalled $10.7 trillion at end-March 2017. The BIS then calculates the corresponding additional debt borrowed through the FX derivatives markets, i.e. "off balance sheet": it finds the answer to be in a similar magnitude: "the missing debt amounts to some $13-14 trillion."
Here's the calculation:
First, the BIS OTC derivatives statistics report total dollar-denominated forwards and swaps outstanding vis-à-vis customers (our proxy for non-banks) of $28 trillion (in parentheses in Table 1). Second, we need to make an assumption about the direction of non-banks' positions. We could assume that the amount of dollars lent and borrowed through derivatives by customers is matched. This would require reporting dealers, as a sector, to be also balanced: data slippage aside, customers and dealers make up the whole market. If so, to obtain the total amount of non-banks' gross dollar borrowing through FX forwards, one would divide by two. This gives $14 trillion. The previous section, however, suggested that banks as a whole use the market for net dollar borrowing. If so, one could subtract that amount from the total before dividing. Even then, an upper estimate of the banks' net position would be, say, $2 trillion. This would imply (after dividing the remaining amount by two) a lower amount of non-bank dollar borrowing of $13 trillion. Finally, we need to estimate the fraction of that debt held by non-US residents. If US residents use the bulk of their derivatives for hedging purposes, the amount would be small.
Why is this number important? The BIS' Claudio Borio writes that "regardless of whether the off-balance sheet debt is currency-matched or not, it has to be repaid when due and this can raise risk. To be sure, such risk is mitigated by the other currency received at maturity. Most maturing dollar forwards are probably repaid by a new swap of the currency received for the needed dollars. This new swap rolls the forward over, borrowing dollars to repay dollars."
In other words, the bucket can be kicked indefinitely... unless there is a sharp discontinuity in the value of the dollar, such as what happened during the 2008 financial crisis, forcing the Fed to become a US dollar provider, both on and off balance sheet, of last resort, to avoid a collapse of the financial system which effectively has a massive, multi-trillion dollar bet on its books at any given moment.
Borio confirms as much in the following paragraph:
Even so, strains can arise. In particular, the short maturity of most FX swaps and forwards can create big maturity mismatches and hence generate large liquidity demands, especially during times of stress. Most spectacular was the funding squeeze suffered by many European banks during the GFC. Indeed, in response, the Swedish bank supervisor has applied liquidity requirements separately to banks' dollar and euro positions (Jönsson (2014)). But non-banks may also face similar problems when they run such mismatches, both on- and off-balance sheet. During the GFC, central banks extraordinarily extended dollar credit to non-banks in Brazil ($10 billion programme) and Russia ($50 billion). Moreover, even sound institutional investors may face difficulties. If they have trouble rolling over their hedges because of problems among dealers, they could be forced into fire sales,
Going back to the core point of the article, namely the ability of financial and non-bank entities to transform trillions in dollar obligations from on to off-balance sheet debt, in the process obfuscate funding needs and risk exposure, the BIS concludes as follows:
Obligations to pay dollars incurred through FX swaps/forwards and currency swaps are functionally equivalent to secured debt. In contrast to other derivatives, agents must repay the principal at maturity, not just the replacement value of the position. Moreover, they could replicate those positions through transactions in the cash and securities markets that would show up on-balance sheet. But because of accounting conventions, this debt does not appear on the balance sheet: it has gone missing.
This is a major problem for the regulator of global central banks which admits that this attempt to mask exposure, "greatly complicates any assessment of the missing debt's total amount and distribution, and hence of its implications for financial stability." While the BIS concedes that much more analysis will be necessary before making definitive policy recommendations, the implicit message is that the next time a USD funding crisis strikes, in addition to the trillions in dollar exposure already known, the world will be faced with a USD shortfall potentially as great as $14 trillion. All that would be needed is a sharp repricing in the US dollar, which in turn would likely be catalyzed by another financial crisis. The result would be another central bank firedrill, in which the Fed will have to double down on its emergency global bailout last observed in the days after the Lehman failure, and which we descibed in October 2009 in "How The Federal Reserve Bailed Out The World".
The only difference is that next time, the total dollar injection required will be far, far greater...
|
{
"pile_set_name": "OpenWebText2"
}
|
#This is the resource bundle for the sap.ui.rta library
#
#XFLD
MAA_DIALOG_ICON=Icon
#XFLD
MAA_DIALOG_DESCRIPTION=Descriere
#XFLD
MAA_DIALOG_COPY_ID_ACTION=Copiere ac\u021Biune ID
#XFLD
MAA_DIALOG_ADAPT_UI_ACTION=Adaptare ac\u021Biune UI
#XFLD
MAA_DIALOG_SAVE_AS_ACTION=Salvare ca ac\u021Biune
#XFLD
MAA_DIALOG_ACTIONS=Ac\u021Biuni
#XFLD
MAA_DIALOG_DELETE_APPVAR=\u0218tergere variant\u0103 aplica\u021Bie
#XFLD
MAA_DIALOG_ADAPT_UI=Ajustare UI
#XFLD
MAA_CURRENTLY_ADAPTING=Ajustare \u00EEn prezent
#XFLD
MAA_OPERATION_IN_PROGRESS=Opera\u021Bie \u00EEn desf\u0103\u0219urare
#XFLD
MAA_NEW_APP_VARIANT=Abia creat
#XFLD
MAA_ORIGINAL_TYPE=Aplica\u0163ie original\u0103
#XFLD
MAA_APP_VARIANT_TYPE=Variant\u0103 apl.
#XFLD
MAA_CURRENT_APP_STATUS=Stare curent\u0103
#XFLD
MAA_DIALOG_SAVE_AS_APP=Salvare ca
#XTOL: Tooltip for Button 'Save As' of the App variant overview list
TOOLTIP_MAA_DIALOG_SAVE_AS_APP=Creare variant\u0103 de aplica\u021Bie nou\u0103
#XTOL: Tooltip for Button 'Copy ID'
TOOLTIP_MAA_DIALOG_COPY_ID=Copiere ID variant\u0103 aplica\u021Bie pe clipboard
#XFLD
MAA_DIALOG_COPY_ID=Copiere ID
#XFLD
MAA_DIALOG_APP_TYPE=Tip de aplica\u021Bie
#XFLD
MAA_DIALOG_TITLE=Titlu
#XFLD
MAA_DIALOG_SUBTITLE=Subtitlu
#XTOL: Tooltip for deletion of app variant button
TOOLTIP_DELETE_APP_VAR=Consulta\u021Bi-v\u0103 cu administratorul dvs. de con\u021Binut pentru a \u0219terge map\u0103rile \u021Bint\u0103 pentru aceast\u0103 variant\u0103 de aplica\u021Bie. Ulterior, ve\u021Bi putea \u0219terge varianta de aplica\u021Bie.
#XMSG: Info Message displayed when a key user wants to delete the app variant on any platform (e.g. on S/4HANA on Premise or S/4HANA Cloud)
MSG_APP_VARIANT_DELETE_CONFIRMATION=Sigur dori\u021Bi s\u0103 \u0219terge\u021Bi aceast\u0103 variant\u0103 de aplica\u021Bie?\nRe\u021Bine\u021Bi c\u0103 aceast\u0103 ac\u021Biune va \u0219terge varianta de aplica\u021Bie pentru to\u021Bi utilizatorii.
#XTOL: Tooltip for Adapt UI button when app variant status is running
TOOLTIP_ADAPTUI_STATUS_RUNNING=Opera\u021Bia este executat\u0103 \u00EEn background.
#XTOL: Tooltip for Adapt UI button on Cloud systems when when app variant status is published but button is still disabled
TOOLTIP_ADAPTUI_STATUS_PUBLISHED=\u00CEmprosp\u0103ta\u021Bi browser-ul pentru a activa aceast\u0103 op\u021Biune.
#XTOL: Tooltip for Adapt UI button when app variant status is unpublished
TOOLTIP_ADAPTUI_STATUS_UNPBLSHD_ERROR=Verifica\u021Bi de ce a e\u0219uat alocarea catalogului.
#XTOL: Tooltip for Adapt UI button on onPrem systems when button is disabled
TOOLTIP_ADAPTUI_ON_PREMISE=Solicita\u021Bi-i administratorului de con\u021Binut s\u0103 creeze map\u0103rile \u021Bint\u0103 pentru varianta de aplica\u021Bie.
|
{
"pile_set_name": "Github"
}
|
An evolution from the wind stopper fleeces these jackets use innovative designs and technologies like Gore-Tex Windstopper, Schoeller Nanosphere and Fortius to give you the ideal balance between wind and water resistance and optimum breathability.
Our selection of men’s and women’s jackets from Arc’teryx, Black Diamond, The North Face, Berghaus and Rab can be used as a standalone jackets or mid layers. These jackets are ideal for walking, skiing, climbing and going to the pub but really come into their own when used for High intensity activities like Ski-touring, alpine mountaineering, running and cycling.
|
{
"pile_set_name": "Pile-CC"
}
|
Sorry Not Sorry
10 Days
Sometimes there are things that just need to be said. This Bible plan walks through some of the values that tend to get lost in the local church because, over time, we tend to make church all about ourselves. It's time to get back to the basics. Buckle up: this might hurt a little. Sorry, not sorry.
Publisher
We would like to thank Journey Church for providing this plan. For more information, please visit: http://JRNY.church
|
{
"pile_set_name": "Pile-CC"
}
|
When does the concerts start this year 2010? What is the line up. It is such a treat to bring out the family and enjoy a day out that has been none eventful in years past. Hats off to Desley. She is fulfilling her calling.
I agree completely. When I pulled up & saw how dead it was I almost turned around and went back home. There was no one there to meet me, & no one showed up see me, the other performers I saw as I was driving down the street were playing to empty sidewalks too. So at least I know it had nothing to do with me or my music.
I saw no evidence of any "Dedication and hard work" the headline for this article should have been "Why anything worth doing is worth doing right. The failed Laurel Street Festival"
There are many ways to get the word for events that don't cost anything. It just seemed like no one could be bothered.
I volunteered to play at a struggling street festival because I believed in the cause but I am not a street musician & didn't like being treated as one!!!
They should have canceled this event. We just got back and there was not a single person there. We were among the few performers who set up on the sidewalks with no. tables, no chairs, no staff, no stage or infrastructure what so ever, and most important no audiences. Quite a depressing scene. We should have just gone to play at Bart station we would have been much more appreciated there. To call this a festival is an extreme stretch.
This was an event that was bare bones at it's best last year anyway. But at least we had a table a tarp and there were people who knew about it. They made no effort to get the word out, they didn't even bother posting the lineup on the Laurel Association's website.
My message to the organizers "Next year don't sucker musician's into showing up to a street fest that doesn't exist!!!!"
i highly recommend this critical and important play! i saw it twice. as a palestinian american, i appreciate jennifer's refusal to mince her words. she is unabashed in her presentation of how her life has transpired.
"ambitious plans for the place"?
springfest has been run the same for as long as anyone can remember. having experienced them over the years, they are exactly the same, as the organizers do not come up with new ways of holding the fair, and its only the various groups that keep this great festival alive!
Hip Hop has some roots in disco, so why are you hating on it? Hip Hop, Soul, Funk, Disco and R&B remain part of the same musical continuum/tradition. The true enemy of music is the monopolization of the industry and the overbearing weight of crass commercialism. Hip Hop has also been part of the curriculum at Cal for well more than a decade. Also, the OG scene in the Bay flourished/revolved around artists like Too Short, Del tha Funky Homosapien, Tupac and Digital Underground. If you're going to write about Hip Hop and the Bay Area music scene, please get it right. Nothin' but love for DJ Zita and La Pena. See you Saturday night.
yeah. i feel the point above.
i also want to add that hella gay, certainly hella hoppin', is also a scene of hipsters that sorely represent oakland's gentrification. tooooooooo many white people for a spot in downtown oakland. i don't know. great event. good idea. music is so-so. people wathcing fun. whiteness, bothersome.
Sad that, for what's supposed to be a party which celebrates LGBT, these producers and New Parish are presenting a member of Le Tigre, a band which has played at the exclusionist Michigan Womyn's Music Festival and continues to not really support the womanhood of trans women. Moreover, Kathleen Hanna (the lead singer of Le Tigre) referred to the transpeople and allies at Camp Trans who have been peacefully protesting the bigoted policy of MichFest as "terrorists." We all make mistakes and, hopefully, evolve, but I've seen no sign members of Le Tigre truly regret playing at MichFest nor have changed their bigoted views towards trans women, perhaps the most vulnerable group in the LGBT community. JD Samson's event should be boycotted not celebrated.
Went as often as I could in the eighties. Disappointed that UC Theater shut down, not just because of no more Rocky. Glad to see that the Grand Lake and its very progressive owner are showing it. Long live lips! :)
I AGREE 100% WITH THE ABOVE WRITER. IT TOOK ME 15 MINUTES TO EVEN FIND THIS PAGE - WHICH ISN'T EVEN VERY INFORMATIVE (& I was starting from the East Bay Express Home Page!). PULL YOUR SOCKS UP AND GET THE EVENT LINE-UP PUBLICISED & LINKED TO DIRECTLY FROM YOUR HOME PAGE!
Richard
Where's the event lineup at a glance on the website?
When I went to http://www.eastbayexpress.com/ebx/BestOf I expected all the handy info about this event to be readily find-able
No "Welcome!"
No About your hosts for the evening
No "EVENT LINEUP AT A GLANCE"
No Party Map
more lots of no
According to your website this event doesn't exist. The links to info would fit well right above the Best Of list. Right?
At least put a link on the home page to a basic page with the above info
|
{
"pile_set_name": "Pile-CC"
}
|
Q:
How to poll to WebMethod using Jquery/Javascript
Can anyone tell me about how to poll to webMethod on specific interval using Javascript/JQuery ? I tried setInterval & setTimeOut but non of them is working for me. My application generates reports on user's request. since the report generation is taking 10-15 minutes I dont want to block UI thread so I create a reportID on button click from javascript and using _dopostback to call button click event and pass the reportID to it. C# button click event calls generate_report() function using Delegate/BeginInvoke and now I want to poll to WebMethod I have created inorder to get the report... here is a code snippet..
$("#btn1").click(function () {
var ReportID = generateReportID();
__doPostBack("<%= btnGenerate.UniqueID %>", ReportID);
IntervalID = setInterval(function () { Poll(ReportID); }, 30000);
});
function Poll(id) {
$.ajax({
type: "POST",
url: "Default.aspx/WebMethod",
data: "{'ReportID','" + id + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (response) {
// Check if report is ready
// If not poll again after 30 secs
// If report is ready Get the Report and clearInterval
},
failure: function (error) {
}
});
};
[WebMethod]
public static string WebMethod(string ReportID)
{
if (ResultSet.ContainsKey(int.Parse(ReportID)))
{
return "Ready";
}
else
{
return "NotReady";
}
}
So On button click how do I start poll to this web method after every 30 secs till report is "Ready" and clear the interval after once its ready. ??
A:
SetInterval was working fine, PostBack was the culprit.... subsequent postbacks i.e. button clicks would kill the previous setintervals.... so now I pass all the ReportIDs to codebehind on button click function and setIntevals using client script
Page.ClientScript.RegisterStartupScript(typeof(Page), "test" + UniqueID, "setInterval(function () { Poll(ReportID); }, 30000);", true);
alternative to send ReportIDs to code behind functions and looping through and setting interval foreach ReportIDs using client script, one can also save ReportIDs in localStorage so that its available in subsequent postbacks.
NOTE : Thanks a tonn for your help @Krzysztof Safjanowski
|
{
"pile_set_name": "StackExchange"
}
|
Prenatal diagnosis of persistent left and absent right superior vena cava.
We report a case of persistent left superior vena cava (LSVC) with absent right superior vena cava (RSVC) diagnosed prenatally. At 27 weeks' gestation, routine fetal ultrasonography showed an abnormal four-chamber view. Fetal echocardiography revealed a markedly enlarged coronary sinus in the four-chamber view. An absent RSVC and a persistent LSVC were demonstrated in the three-vessel view. No additional cardiac malformations were seen before birth. Postnatal imaging confirmed the prenatal diagnosis. The combination of persistent LSVC and absent RSVC without any other cardiac malformations is an extremely rare cardiac anomaly and less commonly detected in utero. Identification of a dilated coronary sinus in the four-chamber view, with atypical features in the three-vessel view, may lead to the antenatal diagnosis of this condition.
|
{
"pile_set_name": "PubMed Abstracts"
}
|
/* -*- c-basic-offset: 8; -*-
*
* Copyright (c) 1993 W. Richard Stevens. All rights reserved.
* Permission to use or modify this software and its documentation only for
* educational purposes and without fee is hereby granted, provided that
* the above copyright notice appear in all copies. The author makes no
* representations about the suitability of this software for any purpose.
* It is provided "as is" without express or implied warranty.
*/
#include <stdio.h>
#include "sock.h"
void
sink_udp(int sockfd) /* TODO: use recvfrom ?? */
{
int n, flags;
if (pauseinit)
sleep_us(pauseinit*1000);
for ( ; ; ) { /* read until peer closes connection; -n opt ignored */
/* msgpeek = 0 or MSG_PEEK */
flags = msgpeek;
oncemore:
if ( (n = recv(sockfd, rbuf, readlen, flags)) < 0) {
err_sys("recv error");
} else if (n == 0) {
if (verbose)
fprintf(stderr, "connection closed by peer\n");
break;
#ifdef notdef /* following not possible with TCP */
} else if (n != readlen)
err_quit("read returned %d, expected %d", n, readlen);
#else
}
#endif
if (verbose) {
fprintf(stderr, "received %d bytes%s\n", n,
(flags == MSG_PEEK) ? " (MSG_PEEK)" : "");
if (verbose > 1) {
fprintf(stderr, "printing %d bytes\n", n);
rbuf[n] = 0; /* make certain it's null terminated */
fprintf(stderr, "SDAP header: %lx\n", *((long *) rbuf));
fprintf(stderr, "next long: %lx\n", *((long *) rbuf+4));
fputs(&rbuf[8], stderr);
}
}
if (pauserw)
sleep_us(pauserw*1000);
if (flags != 0) {
flags = 0; /* avoid infinite loop */
goto oncemore; /* read the message again */
}
}
if (pauseclose) {
if (verbose)
fprintf(stderr, "pausing before close\n");
sleep_us(pauseclose*1000);
}
if (close(sockfd) < 0)
err_sys("close error");
}
|
{
"pile_set_name": "Github"
}
|
NONPRECEDENTIAL DISPOSITION
To be cited only in accordance with
Fed. R. App. P. 32.1
United States Court of Appeals
For the Seventh Circuit
Chicago, Illinois 60604
Submitted October 16, 2009
Decided June 15, 2010
Before
JOEL M. FLAUM, Circuit Judge
MICHAEL S. KANNE, Circuit Judge
TERENCE T. EVANS, Circuit Judge
No. 08-3753
UNITED STATES OF AMERICA, Appeal from the United States
Plaintiff-Appellee, District Court for the
Northern District of Indiana.
v.
No. 06 CR 00023
VERNELL A. BROWN,
Defendant-Appellant. Theresa L. Springman, District Judge.
ORDER
On May 24, 2006, Vernell Brown was indicted, along with Marlyn Barns, Melvin
08-3753 Page 2
Taylor, Michael Alexander, Theodis Armstead, and Herbert Hightower, for conspiracy
to possess with intent to distribute more than five kilograms of cocaine, in violation of
21 U.S.C. § 846. Brown initially proceeded to trial with Barnes, Taylor and Armstead.
However, several days into the trial, the district court stopped the proceeding and
declared a mistrial to allow Brown, Taylor, and Armstead to sever their case from
Barnes. Brown pleaded guilty before proceeding to trial again. As part of the plea
agreement, the government agreed to recommend a sentence at the low-end of the
guideline range or at the statutory minimum of 120 months if the guidelines fell below
the minimum. The district court sentenced Brown to 120 months, the statutory
minimum. Brown now appeals, but his appointed counsel has moved to withdraw
because he cannot identify any nonfrivolous argument to pursue on appeal. See Anders
v. California, 386 U.S. 738, 744 (1967). Brown opposes counsel’s motion. See CIR. R.
51(b). We confine our review to the potential issues identified in counsel’s facially
adequate brief and Brown’s response. See United States v. Schuch, 289 F.3d 968 (7th Cir.
2002); CIR. R. 51(b).
On May 5, 2006, the six individuals indicted in this case were arrested as they
arrived at the site of a planned drug heist where they intended to steal numerous
kilograms of cocaine. Unknown to the defendants, the couriers for the target drug
shipment, who orchestrated this drug heist with the defendants, were a confidential
08-3753 Page 3
informant and an undercover agent. The shipment of drugs did not exist. All of the
planning meetings and pre-heist preparations were captured on audio and video tapes.
Alexander and Hightower pleaded guilty early on in the proceedings. The remaining
defendants, including Brown, proceeded to trial. Shortly before the beginning of the
trial, the government filed a motion pursuant to 21 U.S.C. § 851(a)(1) informing Brown
that the government intended to enhance his sentence based on his prior conviction for
possession of a narcotic controlled substance in the state of Michigan which resulted in
an eighteen-month sentence. Brown did not raise any objections to this motion. Early
in the trial, Armstead, Brown, and Taylor moved for a mistrial because Barnes agreed to
testify on their behalf. The district court granted the mistrial and severed the
defendants’ trials. Barnes proceeded to trial alone and was found guilty.
In March 2008, shortly before his trial was scheduled to start again, Brown
entered into a plea agreement with the government. One key component of the plea
agreement was that it allowed Brown to plead guilty to an amount of drugs less than
what the indictment charged. This reduction in drug quantity decreased the statutory
mandatory minimum sentence from twenty years to ten years. Under the drug quantity
in the plea agreement the statutory maximum sentence remained life in prison. The
government agreed to recommend that the district court sentence Brown at the low end
of the guidelines range or to the statutory minimum of 120 months if the guidelines
08-3753 Page 4
range did not meet that minimum. In the plea agreement, Brown acknowledged that
the minimum sentence he could receive was ten years because he had a prior conviction
for a felony drug offense which had become final before the time of the agreement.
Brown made the same acknowledgment in open court during his change of plea
hearing. The plea agreement also contained an express waiver of Brown’s appeal
rights: “I expressly waive my right to appeal or to contest my conviction and my
sentence and any restitution order imposed or the manner in which my conviction or
sentence or the restitution order was determined or imposed, to any Court on any
ground, including any claim of ineffectively assistance of counsel unless the claimed
ineffective assistance of counsel relates directly to this waiver or its negotiation.”
In May 2008, approximately two months after entering a plea of guilty, Brown
moved to withdraw his guilty plea. Brown stated that he was withdrawing his plea and
all prior testimony because he entered the guilty plea “under duress and feared life long
imprisonment.” After several months of hearings, affidavits, and briefing, the district
court found that Brown was not coerced into entering the plea agreement. In assessing
Brown’s argument, the district court analyzed the potential sentences Brown could have
faced had he gone to trial and the sentencing recommendations in the plea agreement.
The district court found that Brown’s attorney was correct in telling Brown that if a jury
found him guilty and held him responsible for the amount of drugs charged in the
08-3753 Page 5
indictment, Brown would face a minimum twenty-year sentence and could face life in
prison. The district court based its calculations of the minimum and maximum
sentences on the government’s notice under 21 U.S.C. § 851 seeking an increased
statutory minimum sentence due to Brown’s prior possession conviction in Michigan.
In the brief filed pursuant to Anders, counsel first asserts that Brown cannot raise any
meritorious argument challenging his conviction because he entered into an
unconditional, knowing, and voluntary plea of guilty pursuant to a plea agreement.
Brown’s reply makes two arguments that are intertwined and both attack the validity of
the plea agreement as a knowing and voluntary waiver of his rights. The standard of
review applicable to whether a guilty plea is knowing and voluntary is “whether
looking at the total circumstances surrounding the plea, the defendant was informed of
his or her rights.” United States v. Mitchell, 58 F.3d 1221, 1224 (7th Cir. 1995). In
reviewing whether a defendant was informed of his rights and the subsequent plea
agreement was voluntary, we review the plea under the requirements of Federal Rule of
Criminal Procedure 11. To comport with Rule 11, the district court must advise the
defendant of his constitutional rights, the charges against him, the factual bases for the
plea, and the minimum and maximum penalties. United States v. Garcia, 35 F.3d 1125,
1132 (7th Cir. 1994). These safeguards help ensure that the defendant’s plea is knowing
and voluntary. Id.
08-3753 Page 6
Brown argues that he did not waive his right to appeal because his plea of guilty
was not knowing and voluntary. He asserts that his counsel and the district court
misinformed him about the statutory minimum and maximum penalties because his
sentence should not have been enhanced under 21 U.S.C. § 841 on the basis of his
Michigan conviction. This argument is unavailing. Prior to trial, the government filed a
motion pursuant to 21 U.S.C. § 851 informing Brown of the government’s intention to
seek an enhanced sentence based on Brown’s prior conviction for possession of cocaine
in Michigan. At that time, Brown did not object. While there is some discrepancy
regarding whether Brown’s eighteen-month sentence was for incarceration or
probation, there is no argument in the record to counter the government’s assertion that
the Michigan conviction was a state felony conviction. Brown contends that because the
federal system does not treat mere possession as a felony, a felony conviction for simple
possession in state court cannot be used to enhance the statutory minimum sentence
under 21 U.S.C. § 841(b)(1)(B). We are not aware of any court holding that a state felony
drug conviction for possession does not trigger the increased mandatory minimum in
21 U.S.C. § 841(b)(1)(B) because simple possession is not a felony in the federal system.
Based on the record before us and the prevailing state of the law known to defense
counsel and the district court at the time of the plea agreement, Brown did not receive
misinformation about his potential sentencing liability. Therefore, his argument that he
08-3753 Page 7
was coerced into pleading guilty due to misinformation about the potential sentences he
faced is without merit.
Counsel also asserts that Brown cannot raise any appealable issues with regard
to the district court’s denial of his motion to withdraw his plea of guilty. “A defendant
does not have an absolute right to withdraw a plea before sentencing, although the
court may allow him to do so if he has a fair and just reason for doing so.” United States
v. Chavers, 515 F.3d 722, 724 (7th Cir. 2008). We agree with counsel that Brown did not
demonstrate a fair and just reasons for withdrawing his plea of guilty. Brown argued
that he entered into his plea agreement under duress because he was afraid of receiving
a life sentence. However, the district court properly found that defense counsel’s
candid evaluation of Brown’s potential sentencing liability if he went to trial was not
coercion nor did it create impermissible duress. Therefore, any argument that the
district court erred by not allowing Brown to withdraw his guilty plea would be
frivolous.
Lastly, counsel asserts that any argument challenging Brown’s sentence would
be frivolous because Brown specifically waived his right to appeal his sentence. When a
defendant enters into a knowing and voluntary plea of guilty pursuant to a plea
agreement that contains an explicit waiver of the defendant’s right to appeal his
sentence, this Court will honor that waiver and refuse to review the sentence, unless the
08-3753 Page 8
sentence ultimately received was in excess of the statutory maximum sentence or was
the result of the district court’s reliance on a constitutionally impermissible factor such
as race. Jones v. United States, 167 F.3d 1142, 1144 (7th Cir. 1998). The waiver in the plea
agreement was explicit and, for the reasons discussed above, we agree with the district
court that it was entered into voluntarily and knowingly. The sentence does not exceed
the statutory maximum and there is no evidence that the district court relied on
impermissible factors in coming to a sentence. Therefore, in light of this explicit waiver,
any argument regarding the sentence would be frivolous.
For the reasons set forth above, we GRANT the motion to withdraw and
DISMISS Brown’s appeal.
|
{
"pile_set_name": "FreeLaw"
}
|
# Copyright (c) 2010-2012 OpenStack Foundation
#
# 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 io
import json
import unittest
import os
from contextlib import contextmanager
from hashlib import md5
import time
import pickle
import mock
from six.moves import urllib
from swift.common import direct_client
from swift.common.direct_client import DirectClientException
from swift.common.exceptions import ClientException
from swift.common.header_key_dict import HeaderKeyDict
from swift.common.utils import Timestamp, quote
from swift.common.swob import RESPONSE_REASONS
from swift.common.storage_policy import POLICIES
from six.moves.http_client import HTTPException
from test.unit import patch_policies, debug_logger
class FakeConn(object):
def __init__(self, status, headers=None, body='', **kwargs):
self.status = status
try:
self.reason = RESPONSE_REASONS[self.status][0]
except Exception:
self.reason = 'Fake'
self.body = body
self.resp_headers = HeaderKeyDict()
if headers:
self.resp_headers.update(headers)
self.etag = None
def _update_raw_call_args(self, *args, **kwargs):
capture_attrs = ('host', 'port', 'method', 'path', 'req_headers',
'query_string')
for attr, value in zip(capture_attrs, args[:len(capture_attrs)]):
setattr(self, attr, value)
return self
def getresponse(self):
if self.etag:
self.resp_headers['etag'] = str(self.etag.hexdigest())
if isinstance(self.status, Exception):
raise self.status
return self
def getheader(self, header, default=None):
return self.resp_headers.get(header, default)
def getheaders(self):
return self.resp_headers.items()
def read(self, amt=None):
if isinstance(self.body, io.BytesIO):
return self.body.read(amt)
elif amt is None:
return self.body
else:
return Exception('Not a StringIO entry')
def send(self, data):
if not self.etag:
self.etag = md5()
self.etag.update(data)
@contextmanager
def mocked_http_conn(*args, **kwargs):
fake_conn = FakeConn(*args, **kwargs)
mock_http_conn = lambda *args, **kwargs: \
fake_conn._update_raw_call_args(*args, **kwargs)
with mock.patch('swift.common.bufferedhttp.http_connect_raw',
new=mock_http_conn):
yield fake_conn
@patch_policies
class TestDirectClient(unittest.TestCase):
def setUp(self):
self.node = json.loads(json.dumps({ # json roundtrip to ring-like
'ip': '1.2.3.4', 'port': '6200', 'device': 'sda',
'replication_ip': '1.2.3.5', 'replication_port': '7000'}))
self.part = '0'
self.account = u'\u062a account'
self.container = u'\u062a container'
self.obj = u'\u062a obj/name'
self.account_path = '/sda/0/%s' % urllib.parse.quote(
self.account.encode('utf-8'))
self.container_path = '/sda/0/%s/%s' % tuple(
urllib.parse.quote(p.encode('utf-8')) for p in (
self.account, self.container))
self.obj_path = '/sda/0/%s/%s/%s' % tuple(
urllib.parse.quote(p.encode('utf-8')) for p in (
self.account, self.container, self.obj))
self.user_agent = 'direct-client %s' % os.getpid()
class FakeTimeout(BaseException):
def __enter__(self):
return self
def __exit__(self, typ, value, tb):
pass
patcher = mock.patch.object(direct_client, 'Timeout', FakeTimeout)
patcher.start()
self.addCleanup(patcher.stop)
def test_gen_headers(self):
stub_user_agent = 'direct-client %s' % os.getpid()
headers = direct_client.gen_headers(add_ts=False)
self.assertEqual(dict(headers), {
'User-Agent': stub_user_agent,
'X-Backend-Allow-Reserved-Names': 'true',
})
with mock.patch('swift.common.utils.Timestamp.now',
return_value=Timestamp('123.45')):
headers = direct_client.gen_headers()
self.assertEqual(dict(headers), {
'User-Agent': stub_user_agent,
'X-Backend-Allow-Reserved-Names': 'true',
'X-Timestamp': '0000000123.45000',
})
headers = direct_client.gen_headers(hdrs_in={'x-timestamp': '15'})
self.assertEqual(dict(headers), {
'User-Agent': stub_user_agent,
'X-Backend-Allow-Reserved-Names': 'true',
'X-Timestamp': '15',
})
with mock.patch('swift.common.utils.Timestamp.now',
return_value=Timestamp('12345.6789')):
headers = direct_client.gen_headers(hdrs_in={'foo-bar': '63'})
self.assertEqual(dict(headers), {
'User-Agent': stub_user_agent,
'Foo-Bar': '63',
'X-Backend-Allow-Reserved-Names': 'true',
'X-Timestamp': '0000012345.67890',
})
hdrs_in = {'foo-bar': '55'}
headers = direct_client.gen_headers(hdrs_in, add_ts=False)
self.assertEqual(dict(headers), {
'User-Agent': stub_user_agent,
'Foo-Bar': '55',
'X-Backend-Allow-Reserved-Names': 'true',
})
with mock.patch('swift.common.utils.Timestamp.now',
return_value=Timestamp('12345')):
headers = direct_client.gen_headers(hdrs_in={'user-agent': '32'})
self.assertEqual(dict(headers), {
'User-Agent': '32',
'X-Backend-Allow-Reserved-Names': 'true',
'X-Timestamp': '0000012345.00000',
})
hdrs_in = {'user-agent': '47'}
headers = direct_client.gen_headers(hdrs_in, add_ts=False)
self.assertEqual(dict(headers), {
'User-Agent': '47',
'X-Backend-Allow-Reserved-Names': 'true',
})
for policy in POLICIES:
for add_ts in (True, False):
with mock.patch('swift.common.utils.Timestamp.now',
return_value=Timestamp('123456789')):
headers = direct_client.gen_headers(
{'X-Backend-Storage-Policy-Index': policy.idx},
add_ts=add_ts)
expected = {
'User-Agent': stub_user_agent,
'X-Backend-Storage-Policy-Index': str(policy.idx),
'X-Backend-Allow-Reserved-Names': 'true',
}
if add_ts:
expected['X-Timestamp'] = '0123456789.00000'
self.assertEqual(dict(headers), expected)
def test_direct_get_account(self):
def do_test(req_params):
stub_headers = HeaderKeyDict({
'X-Account-Container-Count': '1',
'X-Account-Object-Count': '1',
'X-Account-Bytes-Used': '1',
'X-Timestamp': '1234567890',
'X-PUT-Timestamp': '1234567890'})
body = b'[{"count": 1, "bytes": 20971520, "name": "c1"}]'
with mocked_http_conn(200, stub_headers, body) as conn:
resp_headers, resp = direct_client.direct_get_account(
self.node, self.part, self.account, **req_params)
try:
self.assertEqual(conn.method, 'GET')
self.assertEqual(conn.path, self.account_path)
self.assertEqual(conn.req_headers['user-agent'],
self.user_agent)
self.assertEqual(resp_headers, stub_headers)
self.assertEqual(json.loads(body), resp)
self.assertIn('format=json', conn.query_string)
for k, v in req_params.items():
if v is None:
self.assertNotIn('&%s' % k, conn.query_string)
else:
self.assertIn('&%s=%s' % (k, v), conn.query_string)
except AssertionError as err:
self.fail('Failed with params %s: %s' % (req_params, err))
test_params = (dict(marker=marker, prefix=prefix, delimiter=delimiter,
limit=limit, end_marker=end_marker, reverse=reverse)
for marker in (None, 'my-marker')
for prefix in (None, 'my-prefix')
for delimiter in (None, 'my-delimiter')
for limit in (None, 1000)
for end_marker in (None, 'my-endmarker')
for reverse in (None, 'on'))
for params in test_params:
do_test(params)
def test_direct_client_exception(self):
stub_headers = {'X-Trans-Id': 'txb5f59485c578460f8be9e-0053478d09'}
body = 'a server error has occurred'
with mocked_http_conn(500, stub_headers, body):
with self.assertRaises(ClientException) as raised:
direct_client.direct_get_account(self.node, self.part,
self.account)
self.assertEqual(raised.exception.http_status, 500)
expected_err_msg_parts = (
'Account server %s:%s' % (self.node['ip'], self.node['port']),
'GET %r' % self.account_path,
'status 500',
)
for item in expected_err_msg_parts:
self.assertIn(item, str(raised.exception))
self.assertEqual(raised.exception.http_host, self.node['ip'])
self.assertEqual(raised.exception.http_port, self.node['port'])
self.assertEqual(raised.exception.http_device, self.node['device'])
self.assertEqual(raised.exception.http_status, 500)
self.assertEqual(raised.exception.http_reason, 'Internal Error')
self.assertEqual(raised.exception.http_headers, stub_headers)
def test_direct_get_account_no_content_does_not_parse_body(self):
headers = {
'X-Account-Container-Count': '1',
'X-Account-Object-Count': '1',
'X-Account-Bytes-Used': '1',
'X-Timestamp': '1234567890',
'X-Put-Timestamp': '1234567890'}
with mocked_http_conn(204, headers) as conn:
resp_headers, resp = direct_client.direct_get_account(
self.node, self.part, self.account)
self.assertEqual(conn.method, 'GET')
self.assertEqual(conn.path, self.account_path)
self.assertEqual(conn.req_headers['user-agent'], self.user_agent)
self.assertDictEqual(resp_headers, headers)
self.assertEqual([], resp)
def test_direct_get_account_error(self):
with mocked_http_conn(500) as conn:
with self.assertRaises(ClientException) as raised:
direct_client.direct_get_account(
self.node, self.part, self.account)
self.assertEqual(conn.method, 'GET')
self.assertEqual(conn.path, self.account_path)
self.assertEqual(raised.exception.http_status, 500)
self.assertTrue('GET' in str(raised.exception))
def test_direct_delete_account(self):
part = '0'
account = 'a'
mock_path = 'swift.common.bufferedhttp.http_connect_raw'
with mock.patch(mock_path) as fake_connect:
fake_connect.return_value.getresponse.return_value.status = 200
direct_client.direct_delete_account(self.node, part, account)
args, kwargs = fake_connect.call_args
ip = args[0]
self.assertEqual(self.node['ip'], ip)
port = args[1]
self.assertEqual(self.node['port'], port)
method = args[2]
self.assertEqual('DELETE', method)
path = args[3]
self.assertEqual('/sda/0/a', path)
headers = args[4]
self.assertIn('X-Timestamp', headers)
self.assertIn('User-Agent', headers)
def test_direct_delete_account_replication_net(self):
part = '0'
account = 'a'
mock_path = 'swift.common.bufferedhttp.http_connect_raw'
with mock.patch(mock_path) as fake_connect:
fake_connect.return_value.getresponse.return_value.status = 200
direct_client.direct_delete_account(
self.node, part, account,
headers={'X-Backend-Use-Replication-Network': 't'})
args, kwargs = fake_connect.call_args
ip = args[0]
self.assertEqual(self.node['replication_ip'], ip)
self.assertNotEqual(self.node['ip'], ip)
port = args[1]
self.assertEqual(self.node['replication_port'], port)
self.assertNotEqual(self.node['port'], port)
method = args[2]
self.assertEqual('DELETE', method)
path = args[3]
self.assertEqual('/sda/0/a', path)
headers = args[4]
self.assertIn('X-Timestamp', headers)
self.assertIn('User-Agent', headers)
def test_direct_delete_account_failure(self):
part = '0'
account = 'a'
with mocked_http_conn(500) as conn:
with self.assertRaises(ClientException) as raised:
direct_client.direct_delete_account(self.node, part, account)
self.assertEqual(self.node['ip'], conn.host)
self.assertEqual(self.node['port'], conn.port)
self.assertEqual('DELETE', conn.method)
self.assertEqual('/sda/0/a', conn.path)
self.assertIn('X-Timestamp', conn.req_headers)
self.assertIn('User-Agent', conn.req_headers)
self.assertEqual(raised.exception.http_status, 500)
def test_direct_head_container(self):
headers = HeaderKeyDict(key='value')
with mocked_http_conn(200, headers) as conn:
resp = direct_client.direct_head_container(
self.node, self.part, self.account, self.container)
self.assertEqual(conn.host, self.node['ip'])
self.assertEqual(conn.port, self.node['port'])
self.assertEqual(conn.method, 'HEAD')
self.assertEqual(conn.path, self.container_path)
self.assertEqual(conn.req_headers['user-agent'],
self.user_agent)
self.assertEqual(headers, resp)
def test_direct_head_container_replication_net(self):
headers = HeaderKeyDict(key='value')
with mocked_http_conn(200, headers) as conn:
resp = direct_client.direct_head_container(
self.node, self.part, self.account, self.container,
headers={'X-Backend-Use-Replication-Network': 'on'})
self.assertEqual(conn.host, self.node['replication_ip'])
self.assertEqual(conn.port, self.node['replication_port'])
self.assertNotEqual(conn.host, self.node['ip'])
self.assertNotEqual(conn.port, self.node['port'])
self.assertEqual(conn.method, 'HEAD')
self.assertEqual(conn.path, self.container_path)
self.assertEqual(conn.req_headers['user-agent'],
self.user_agent)
self.assertEqual(headers, resp)
def test_direct_head_container_error(self):
headers = HeaderKeyDict(key='value')
with mocked_http_conn(503, headers) as conn:
with self.assertRaises(ClientException) as raised:
direct_client.direct_head_container(
self.node, self.part, self.account, self.container)
# check request
self.assertEqual(conn.host, self.node['ip'])
self.assertEqual(conn.port, self.node['port'])
self.assertEqual(conn.method, 'HEAD')
self.assertEqual(conn.path, self.container_path)
self.assertEqual(conn.req_headers['user-agent'], self.user_agent)
self.assertEqual(raised.exception.http_status, 503)
self.assertEqual(raised.exception.http_headers, headers)
self.assertTrue('HEAD' in str(raised.exception))
def test_direct_head_container_deleted(self):
important_timestamp = Timestamp.now().internal
headers = HeaderKeyDict({'X-Backend-Important-Timestamp':
important_timestamp})
with mocked_http_conn(404, headers) as conn:
with self.assertRaises(ClientException) as raised:
direct_client.direct_head_container(
self.node, self.part, self.account, self.container)
self.assertEqual(conn.host, self.node['ip'])
self.assertEqual(conn.port, self.node['port'])
self.assertEqual(conn.method, 'HEAD')
self.assertEqual(conn.path, self.container_path)
self.assertEqual(conn.req_headers['user-agent'], self.user_agent)
self.assertEqual(raised.exception.http_status, 404)
self.assertEqual(raised.exception.http_headers, headers)
def test_direct_get_container(self):
def do_test(req_params):
headers = HeaderKeyDict({'key': 'value'})
body = (b'[{"hash": "8f4e3", "last_modified": "317260", '
b'"bytes": 209}]')
with mocked_http_conn(200, headers, body) as conn:
resp_headers, resp = direct_client.direct_get_container(
self.node, self.part, self.account, self.container,
**req_params)
try:
self.assertEqual(conn.method, 'GET')
self.assertEqual(conn.path, self.container_path)
self.assertEqual(conn.req_headers['user-agent'],
self.user_agent)
self.assertEqual(headers, resp_headers)
self.assertEqual(json.loads(body), resp)
self.assertIn('format=json', conn.query_string)
for k, v in req_params.items():
if v is None:
self.assertNotIn('&%s' % k, conn.query_string)
else:
self.assertIn('&%s=%s' % (k, v), conn.query_string)
except AssertionError as err:
self.fail('Failed with params %s: %s' % (req_params, err))
test_params = (dict(marker=marker, prefix=prefix, delimiter=delimiter,
limit=limit, end_marker=end_marker, reverse=reverse)
for marker in (None, 'my-marker')
for prefix in (None, 'my-prefix')
for delimiter in (None, 'my-delimiter')
for limit in (None, 1000)
for end_marker in (None, 'my-endmarker')
for reverse in (None, 'on'))
for params in test_params:
do_test(params)
def test_direct_get_container_no_content_does_not_decode_body(self):
headers = {}
body = ''
with mocked_http_conn(204, headers, body) as conn:
resp_headers, resp = direct_client.direct_get_container(
self.node, self.part, self.account, self.container)
self.assertEqual(conn.req_headers['user-agent'], self.user_agent)
self.assertEqual(headers, resp_headers)
self.assertEqual([], resp)
def test_direct_delete_container(self):
with mocked_http_conn(200) as conn:
direct_client.direct_delete_container(
self.node, self.part, self.account, self.container)
self.assertEqual(conn.host, self.node['ip'])
self.assertEqual(conn.port, self.node['port'])
self.assertEqual(conn.method, 'DELETE')
self.assertEqual(conn.path, self.container_path)
def test_direct_delete_container_replication_net(self):
with mocked_http_conn(200) as conn:
direct_client.direct_delete_container(
self.node, self.part, self.account, self.container,
headers={'X-Backend-Use-Replication-Network': '1'})
self.assertEqual(conn.host, self.node['replication_ip'])
self.assertEqual(conn.port, self.node['replication_port'])
self.assertNotEqual(conn.host, self.node['ip'])
self.assertNotEqual(conn.port, self.node['port'])
self.assertEqual(conn.method, 'DELETE')
self.assertEqual(conn.path, self.container_path)
def test_direct_delete_container_with_timestamp(self):
# ensure timestamp is different from any that might be auto-generated
timestamp = Timestamp(time.time() - 100)
headers = {'X-Timestamp': timestamp.internal}
with mocked_http_conn(200) as conn:
direct_client.direct_delete_container(
self.node, self.part, self.account, self.container,
headers=headers)
self.assertEqual(conn.host, self.node['ip'])
self.assertEqual(conn.port, self.node['port'])
self.assertEqual(conn.method, 'DELETE')
self.assertEqual(conn.path, self.container_path)
self.assertTrue('X-Timestamp' in conn.req_headers)
self.assertEqual(timestamp, conn.req_headers['X-Timestamp'])
def test_direct_delete_container_error(self):
with mocked_http_conn(500) as conn:
with self.assertRaises(ClientException) as raised:
direct_client.direct_delete_container(
self.node, self.part, self.account, self.container)
self.assertEqual(conn.host, self.node['ip'])
self.assertEqual(conn.port, self.node['port'])
self.assertEqual(conn.method, 'DELETE')
self.assertEqual(conn.path, self.container_path)
self.assertEqual(raised.exception.http_status, 500)
self.assertTrue('DELETE' in str(raised.exception))
def test_direct_put_container(self):
body = b'Let us begin with a quick introduction'
headers = {'x-foo': 'bar', 'Content-Length': str(len(body)),
'Content-Type': 'application/json',
'User-Agent': 'my UA'}
with mocked_http_conn(204) as conn:
rv = direct_client.direct_put_container(
self.node, self.part, self.account, self.container,
contents=body, headers=headers)
self.assertEqual(conn.host, self.node['ip'])
self.assertEqual(conn.port, self.node['port'])
self.assertEqual(conn.method, 'PUT')
self.assertEqual(conn.path, self.container_path)
self.assertEqual(conn.req_headers['Content-Length'],
str(len(body)))
self.assertEqual(conn.req_headers['Content-Type'],
'application/json')
self.assertEqual(conn.req_headers['User-Agent'], 'my UA')
self.assertTrue('x-timestamp' in conn.req_headers)
self.assertEqual('bar', conn.req_headers.get('x-foo'))
self.assertEqual(md5(body).hexdigest(), conn.etag.hexdigest())
self.assertIsNone(rv)
def test_direct_put_container_chunked(self):
body = b'Let us begin with a quick introduction'
headers = {'x-foo': 'bar', 'Content-Type': 'application/json'}
with mocked_http_conn(204) as conn:
rv = direct_client.direct_put_container(
self.node, self.part, self.account, self.container,
contents=body, headers=headers)
self.assertEqual(conn.host, self.node['ip'])
self.assertEqual(conn.port, self.node['port'])
self.assertEqual(conn.method, 'PUT')
self.assertEqual(conn.path, self.container_path)
self.assertEqual(conn.req_headers['Transfer-Encoding'], 'chunked')
self.assertEqual(conn.req_headers['Content-Type'],
'application/json')
self.assertTrue('x-timestamp' in conn.req_headers)
self.assertEqual('bar', conn.req_headers.get('x-foo'))
self.assertNotIn('Content-Length', conn.req_headers)
expected_sent = b'%0x\r\n%s\r\n0\r\n\r\n' % (len(body), body)
self.assertEqual(md5(expected_sent).hexdigest(),
conn.etag.hexdigest())
self.assertIsNone(rv)
def test_direct_put_container_fail(self):
with mock.patch('swift.common.bufferedhttp.http_connect_raw',
side_effect=Exception('conn failed')):
with self.assertRaises(Exception) as cm:
direct_client.direct_put_container(
self.node, self.part, self.account, self.container)
self.assertEqual('conn failed', str(cm.exception))
with mocked_http_conn(Exception('resp failed')):
with self.assertRaises(Exception) as cm:
direct_client.direct_put_container(
self.node, self.part, self.account, self.container)
self.assertEqual('resp failed', str(cm.exception))
def test_direct_put_container_object(self):
headers = {'x-foo': 'bar'}
with mocked_http_conn(204) as conn:
rv = direct_client.direct_put_container_object(
self.node, self.part, self.account, self.container, self.obj,
headers=headers)
self.assertEqual(conn.host, self.node['ip'])
self.assertEqual(conn.port, self.node['port'])
self.assertEqual(conn.method, 'PUT')
self.assertEqual(conn.path, self.obj_path)
self.assertTrue('x-timestamp' in conn.req_headers)
self.assertEqual('bar', conn.req_headers.get('x-foo'))
self.assertIsNone(rv)
def test_direct_put_container_object_error(self):
with mocked_http_conn(500) as conn:
with self.assertRaises(ClientException) as raised:
direct_client.direct_put_container_object(
self.node, self.part, self.account, self.container,
self.obj)
self.assertEqual(conn.host, self.node['ip'])
self.assertEqual(conn.port, self.node['port'])
self.assertEqual(conn.method, 'PUT')
self.assertEqual(conn.path, self.obj_path)
self.assertEqual(raised.exception.http_status, 500)
self.assertTrue('PUT' in str(raised.exception))
def test_direct_delete_container_object(self):
with mocked_http_conn(204) as conn:
rv = direct_client.direct_delete_container_object(
self.node, self.part, self.account, self.container, self.obj)
self.assertEqual(conn.host, self.node['ip'])
self.assertEqual(conn.port, self.node['port'])
self.assertEqual(conn.method, 'DELETE')
self.assertEqual(conn.path, self.obj_path)
self.assertIsNone(rv)
def test_direct_delete_container_obj_error(self):
with mocked_http_conn(500) as conn:
with self.assertRaises(ClientException) as raised:
direct_client.direct_delete_container_object(
self.node, self.part, self.account, self.container,
self.obj)
self.assertEqual(conn.host, self.node['ip'])
self.assertEqual(conn.port, self.node['port'])
self.assertEqual(conn.method, 'DELETE')
self.assertEqual(conn.path, self.obj_path)
self.assertEqual(raised.exception.http_status, 500)
self.assertTrue('DELETE' in str(raised.exception))
def test_direct_head_object(self):
headers = HeaderKeyDict({'x-foo': 'bar'})
with mocked_http_conn(200, headers) as conn:
resp = direct_client.direct_head_object(
self.node, self.part, self.account, self.container,
self.obj, headers=headers)
self.assertEqual(conn.host, self.node['ip'])
self.assertEqual(conn.port, self.node['port'])
self.assertEqual(conn.method, 'HEAD')
self.assertEqual(conn.path, self.obj_path)
self.assertEqual(conn.req_headers['user-agent'], self.user_agent)
self.assertEqual('bar', conn.req_headers.get('x-foo'))
self.assertIn('x-timestamp', conn.req_headers)
self.assertEqual(headers, resp)
def test_direct_head_object_error(self):
with mocked_http_conn(500) as conn:
with self.assertRaises(ClientException) as raised:
direct_client.direct_head_object(
self.node, self.part, self.account, self.container,
self.obj)
self.assertEqual(conn.host, self.node['ip'])
self.assertEqual(conn.port, self.node['port'])
self.assertEqual(conn.method, 'HEAD')
self.assertEqual(conn.path, self.obj_path)
self.assertEqual(raised.exception.http_status, 500)
self.assertTrue('HEAD' in str(raised.exception))
def test_direct_head_object_not_found(self):
important_timestamp = Timestamp.now().internal
stub_headers = {'X-Backend-Important-Timestamp': important_timestamp}
with mocked_http_conn(404, headers=stub_headers) as conn:
with self.assertRaises(ClientException) as raised:
direct_client.direct_head_object(
self.node, self.part, self.account, self.container,
self.obj)
self.assertEqual(conn.host, self.node['ip'])
self.assertEqual(conn.port, self.node['port'])
self.assertEqual(conn.method, 'HEAD')
self.assertEqual(conn.path, self.obj_path)
self.assertEqual(raised.exception.http_status, 404)
self.assertEqual(
raised.exception.http_headers['x-backend-important-timestamp'],
important_timestamp)
def test_direct_get_object(self):
contents = io.BytesIO(b'123456')
with mocked_http_conn(200, body=contents) as conn:
resp_header, obj_body = direct_client.direct_get_object(
self.node, self.part, self.account, self.container, self.obj)
self.assertEqual(conn.host, self.node['ip'])
self.assertEqual(conn.port, self.node['port'])
self.assertEqual(conn.method, 'GET')
self.assertEqual(conn.path, self.obj_path)
self.assertEqual(obj_body, contents.getvalue())
def test_direct_get_object_error(self):
with mocked_http_conn(500) as conn:
with self.assertRaises(ClientException) as raised:
direct_client.direct_get_object(
self.node, self.part,
self.account, self.container, self.obj)
self.assertEqual(conn.host, self.node['ip'])
self.assertEqual(conn.port, self.node['port'])
self.assertEqual(conn.method, 'GET')
self.assertEqual(conn.path, self.obj_path)
self.assertEqual(raised.exception.http_status, 500)
self.assertTrue('GET' in str(raised.exception))
def test_direct_get_object_chunks(self):
contents = io.BytesIO(b'123456')
with mocked_http_conn(200, body=contents) as conn:
resp_header, obj_body = direct_client.direct_get_object(
self.node, self.part, self.account, self.container, self.obj,
resp_chunk_size=2)
self.assertEqual(conn.host, self.node['ip'])
self.assertEqual(conn.port, self.node['port'])
self.assertEqual('GET', conn.method)
self.assertEqual(self.obj_path, conn.path)
self.assertEqual([b'12', b'34', b'56'], list(obj_body))
def test_direct_post_object(self):
headers = {'Key': 'value'}
resp_headers = []
with mocked_http_conn(200, resp_headers) as conn:
direct_client.direct_post_object(
self.node, self.part, self.account, self.container, self.obj,
headers)
self.assertEqual(conn.host, self.node['ip'])
self.assertEqual(conn.port, self.node['port'])
self.assertEqual(conn.method, 'POST')
self.assertEqual(conn.path, self.obj_path)
for header in headers:
self.assertEqual(conn.req_headers[header], headers[header])
def test_direct_post_object_error(self):
headers = {'Key': 'value'}
with mocked_http_conn(500) as conn:
with self.assertRaises(ClientException) as raised:
direct_client.direct_post_object(
self.node, self.part, self.account, self.container,
self.obj, headers)
self.assertEqual(conn.host, self.node['ip'])
self.assertEqual(conn.port, self.node['port'])
self.assertEqual(conn.method, 'POST')
self.assertEqual(conn.path, self.obj_path)
for header in headers:
self.assertEqual(conn.req_headers[header], headers[header])
self.assertEqual(conn.req_headers['user-agent'], self.user_agent)
self.assertTrue('x-timestamp' in conn.req_headers)
self.assertEqual(raised.exception.http_status, 500)
self.assertTrue('POST' in str(raised.exception))
def test_direct_delete_object(self):
with mocked_http_conn(200) as conn:
resp = direct_client.direct_delete_object(
self.node, self.part, self.account, self.container, self.obj)
self.assertEqual(conn.host, self.node['ip'])
self.assertEqual(conn.port, self.node['port'])
self.assertEqual(conn.method, 'DELETE')
self.assertEqual(conn.path, self.obj_path)
self.assertIsNone(resp)
def test_direct_delete_object_with_timestamp(self):
# ensure timestamp is different from any that might be auto-generated
timestamp = Timestamp(time.time() - 100)
headers = {'X-Timestamp': timestamp.internal}
with mocked_http_conn(200) as conn:
direct_client.direct_delete_object(
self.node, self.part, self.account, self.container, self.obj,
headers=headers)
self.assertEqual(conn.host, self.node['ip'])
self.assertEqual(conn.port, self.node['port'])
self.assertEqual(conn.method, 'DELETE')
self.assertEqual(conn.path, self.obj_path)
self.assertTrue('X-Timestamp' in conn.req_headers)
self.assertEqual(timestamp, conn.req_headers['X-Timestamp'])
def test_direct_delete_object_error(self):
with mocked_http_conn(503) as conn:
with self.assertRaises(ClientException) as raised:
direct_client.direct_delete_object(
self.node, self.part, self.account, self.container,
self.obj)
self.assertEqual(conn.method, 'DELETE')
self.assertEqual(conn.path, self.obj_path)
self.assertEqual(raised.exception.http_status, 503)
self.assertTrue('DELETE' in str(raised.exception))
def test_direct_get_suffix_hashes(self):
data = {'a83': 'c130a2c17ed45102aada0f4eee69494ff'}
body = pickle.dumps(data)
with mocked_http_conn(200, {}, body) as conn:
resp = direct_client.direct_get_suffix_hashes(self.node,
self.part, ['a83'])
self.assertEqual(conn.method, 'REPLICATE')
self.assertEqual(conn.path, '/sda/0/a83')
self.assertEqual(conn.host, self.node['replication_ip'])
self.assertEqual(conn.port, self.node['replication_port'])
self.assertEqual(data, resp)
def _test_direct_get_suffix_hashes_fail(self, status_code):
with mocked_http_conn(status_code):
with self.assertRaises(DirectClientException) as cm:
direct_client.direct_get_suffix_hashes(
self.node, self.part, ['a83', 'b52'])
self.assertIn('REPLICATE', cm.exception.args[0])
self.assertIn(quote('/%s/%s/a83-b52'
% (self.node['device'], self.part)),
cm.exception.args[0])
self.assertIn(self.node['replication_ip'], cm.exception.args[0])
self.assertIn(self.node['replication_port'], cm.exception.args[0])
self.assertEqual(self.node['replication_ip'], cm.exception.http_host)
self.assertEqual(self.node['replication_port'], cm.exception.http_port)
self.assertEqual(self.node['device'], cm.exception.http_device)
self.assertEqual(status_code, cm.exception.http_status)
def test_direct_get_suffix_hashes_503(self):
self._test_direct_get_suffix_hashes_fail(503)
def test_direct_get_suffix_hashes_507(self):
self._test_direct_get_suffix_hashes_fail(507)
def test_direct_put_object_with_content_length(self):
contents = io.BytesIO(b'123456')
with mocked_http_conn(200) as conn:
resp = direct_client.direct_put_object(
self.node, self.part, self.account, self.container, self.obj,
contents, 6)
self.assertEqual(conn.host, self.node['ip'])
self.assertEqual(conn.port, self.node['port'])
self.assertEqual(conn.method, 'PUT')
self.assertEqual(conn.path, self.obj_path)
self.assertEqual(md5(b'123456').hexdigest(), resp)
def test_direct_put_object_fail(self):
contents = io.BytesIO(b'123456')
with mocked_http_conn(500) as conn:
with self.assertRaises(ClientException) as raised:
direct_client.direct_put_object(
self.node, self.part, self.account, self.container,
self.obj, contents)
self.assertEqual(conn.host, self.node['ip'])
self.assertEqual(conn.port, self.node['port'])
self.assertEqual(conn.method, 'PUT')
self.assertEqual(conn.path, self.obj_path)
self.assertEqual(raised.exception.http_status, 500)
def test_direct_put_object_chunked(self):
contents = io.BytesIO(b'123456')
with mocked_http_conn(200) as conn:
resp = direct_client.direct_put_object(
self.node, self.part, self.account, self.container, self.obj,
contents)
self.assertEqual(conn.host, self.node['ip'])
self.assertEqual(conn.port, self.node['port'])
self.assertEqual(conn.method, 'PUT')
self.assertEqual(conn.path, self.obj_path)
self.assertEqual(md5(b'6\r\n123456\r\n0\r\n\r\n').hexdigest(), resp)
def test_direct_put_object_args(self):
# One test to cover all missing checks
contents = ""
with mocked_http_conn(200) as conn:
resp = direct_client.direct_put_object(
self.node, self.part, self.account, self.container, self.obj,
contents, etag="testing-etag", content_type='Text')
self.assertEqual(conn.host, self.node['ip'])
self.assertEqual(conn.port, self.node['port'])
self.assertEqual('PUT', conn.method)
self.assertEqual(self.obj_path, conn.path)
self.assertEqual(conn.req_headers['Content-Length'], '0')
self.assertEqual(conn.req_headers['Content-Type'], 'Text')
self.assertEqual(md5(b'0\r\n\r\n').hexdigest(), resp)
def test_direct_put_object_header_content_length(self):
contents = io.BytesIO(b'123456')
stub_headers = HeaderKeyDict({
'Content-Length': '6'})
with mocked_http_conn(200) as conn:
resp = direct_client.direct_put_object(
self.node, self.part, self.account, self.container, self.obj,
contents, headers=stub_headers)
self.assertEqual(conn.host, self.node['ip'])
self.assertEqual(conn.port, self.node['port'])
self.assertEqual('PUT', conn.method)
self.assertEqual(conn.req_headers['Content-length'], '6')
self.assertEqual(md5(b'123456').hexdigest(), resp)
def test_retry(self):
headers = HeaderKeyDict({'key': 'value'})
with mocked_http_conn(200, headers) as conn:
attempts, resp = direct_client.retry(
direct_client.direct_head_object, self.node, self.part,
self.account, self.container, self.obj)
self.assertEqual(conn.method, 'HEAD')
self.assertEqual(conn.path, self.obj_path)
self.assertEqual(conn.req_headers['user-agent'], self.user_agent)
self.assertEqual(headers, resp)
self.assertEqual(attempts, 1)
def test_retry_client_exception(self):
logger = debug_logger('direct-client-test')
with mock.patch('swift.common.direct_client.sleep') as mock_sleep, \
mocked_http_conn(500) as conn:
with self.assertRaises(direct_client.ClientException) as err_ctx:
direct_client.retry(direct_client.direct_delete_object,
self.node, self.part,
self.account, self.container, self.obj,
retries=2, error_log=logger.error)
self.assertEqual('DELETE', conn.method)
self.assertEqual(err_ctx.exception.http_status, 500)
self.assertIn('DELETE', err_ctx.exception.args[0])
self.assertIn(self.obj_path,
err_ctx.exception.args[0])
self.assertIn(self.node['ip'], err_ctx.exception.args[0])
self.assertIn(self.node['port'], err_ctx.exception.args[0])
self.assertEqual(self.node['ip'], err_ctx.exception.http_host)
self.assertEqual(self.node['port'], err_ctx.exception.http_port)
self.assertEqual(self.node['device'], err_ctx.exception.http_device)
self.assertEqual(500, err_ctx.exception.http_status)
self.assertEqual([mock.call(1), mock.call(2)],
mock_sleep.call_args_list)
error_lines = logger.get_lines_for_level('error')
self.assertEqual(3, len(error_lines))
for line in error_lines:
self.assertIn('500 Internal Error', line)
def test_retry_http_exception(self):
logger = debug_logger('direct-client-test')
with mock.patch('swift.common.direct_client.sleep') as mock_sleep, \
mocked_http_conn(HTTPException('Kaboom!')) as conn:
with self.assertRaises(HTTPException) as err_ctx:
direct_client.retry(direct_client.direct_delete_object,
self.node, self.part,
self.account, self.container, self.obj,
retries=2, error_log=logger.error)
self.assertEqual('DELETE', conn.method)
self.assertEqual('Kaboom!', str(err_ctx.exception))
self.assertEqual([mock.call(1), mock.call(2)],
mock_sleep.call_args_list)
error_lines = logger.get_lines_for_level('error')
self.assertEqual(3, len(error_lines))
for line in error_lines:
self.assertIn('Kaboom!', line)
class TestUTF8DirectClient(TestDirectClient):
def setUp(self):
super(TestUTF8DirectClient, self).setUp()
self.account = self.account.encode('utf-8')
self.container = self.container.encode('utf-8')
self.obj = self.obj.encode('utf-8')
if __name__ == '__main__':
unittest.main()
|
{
"pile_set_name": "Github"
}
|
Flurbiprofen (Ansaid) cross-sensitivity in an aspirin-sensitive asthmatic patient.
Flurbiprofen (Ansaid) is a newly released nonsteroidal antiinflammatory drug (NSAID) that is a potent inhibitor of prostaglandin synthesis. We report the first case (to our knowledge) of a flurbiprofen-induced asthmatic reaction confirmed by single-blind oral challenges. Cross-sensitivity and cross-desensitization between aspirin (ASA) and flurbiprofen were also demonstrated in this patient with rhinosinusitis and asthma, thus reinforcing the observation that NSAIDs capable of cyclooxygenase inhibition crossreact with ASA in producing characteristic respiratory reactions.
|
{
"pile_set_name": "PubMed Abstracts"
}
|
Choose your preferred view mode
Please select whether you prefer to view the MDPI pages with a view tailored for mobile displays or to view the MDPI
pages in the normal scrollable desktop version. This selection will be stored into your cookies and used automatically
in next visits. You can also change the view style at any point from the main header when using the pages with your
mobile device.
Simple Summary
This study analyzed the membership of animal experimentation oversight committees at leading U.S. research institutions. We found the leadership and general membership of these committees to be dominated by animal researchers and the remainder of the committees to be largely comprised of other institutional representatives. These arrangements may contribute to previously-documented committee biases in favor of approving animal experiments and dilute input from the few members representing animal welfare and the interests of the general public.
Abstract
Institutional Animal Care and Use Committees (IACUCs) were created to review, approve and oversee animal experiments and to balance the interests of researchers, animals, institutions and the general public. This study analyzed the overall membership of IACUCs at leading U.S. research institutions. We found that these committees and their leadership are comprised of a preponderance of animal researchers, as well as other members who are affiliated with each institution; some of whom also work in animal laboratories. This overwhelming presence of animal research and institutional interests may dilute input from the few IACUC members representing animal welfare and the general public, contribute to previously-documented committee bias in favor of approving animal experiments and reduce the overall objectivity and effectiveness of the oversight system.
View Full-Text
|
{
"pile_set_name": "Pile-CC"
}
|
Q:
Is "Заходи, покажешь X" {Imperative + Future} an equivalent of "come and show me X" {Imperative + Imperative} in English?
1) Заходи как-нибудь, покажешь фотки! {Imperative + Future}
I'm assuming this phrase means "come and show me the photos sometime". In English, both "come" and "show" are in Imperative, while in Russian it takes the form of "Imperative + Future".
I wonder if "Заходи, покажешь X" is the construction commonly used to express the idea of "come and do something". Do the following alternatives sound odd?
2) Заходи как-нибудь, покажи фотки! {Imperative + Imperative}
3) Заходи как-нибудь показать фотки! {Imperative + Infinitive} -- similar to "come to show"
On another note: Is it unusual to use the perfective "зайти" here?
4) Зайди как-нибудь, покажешь фотки! {Perfective Imperative + Perfective Future}
{vs}: Заходи как-нибудь, покажешь фотки! {Imperfective Imperative + Perfective Future}
A:
I'm assuming this phrase means "come and show me the photos sometime"
Your assumption is correct.
I wonder if "Заходи, покажешь X" is the construction commonly used...
Yes, it is quite a usual way to say this.
Do the following alternatives sound odd?
Заходи как-нибудь, покажи фотки!
I can think of a situation wherein someone would use these words, but it would be most likely without как-нибудь, but with сейчас/сегодня/через час as the second imperative makes it like the action should not be in an uncertain future, but soon. But overall I would not suggest preferring it as it is quite colloquial to my ear.
Заходи как-нибудь показать фотки!
Sounds alright. Grammatically correct and as good as the {Imperative + Future} one.
On another note: Is it unusual to use the perfective "зайти" here?
It is not unusual and completely correct but it sounds more 'demanding', if you're not very close with this person I wouldn't suggest using it.
A:
All these sentences are valid meaning you invite someone to come to your place and show some pictures.
Заходи как-нибудь, покажешь фотки! {Imperative + Future} (come and you will/can show)
Заходи как-нибудь, покажи фотки! {Imperative + Imperative}(come and show)
3.Заходи как-нибудь показать фотки! {Imperative + Infinitive} (come in order to show--purpose )
And the same forms are valid with the perfective imperative as well, with no difference in meaning.
Зайди как-нибудь, покажешь фотки! Зайди как‐нибудь показать фотки. Зайди как‐нибудь, покажи фотки.
All are equally used, we don't have any preference.
Besides you can use different verbs in both parts.
Приходи/приди/забеги/забегай/загляни/заскочи, etc.
|
{
"pile_set_name": "StackExchange"
}
|
Q:
Filtering data in python
I am working on a web crawler for python that gathers information on posts by users on a site and compares their scores for posts all provided users participate in. It is currently structured so that I receive the following data:
results is a dictionary indexed by username that contains dictionaries of each user's history in a post, points key value structure.
common is a list that starts with all the posts in the dictionary of the first user in results. This list should be filtered down to only the posts all users have in common
points is a dictionary indexed by username that keeps a running total of points on shared posts.
My filtering code is below:
common = list(results.values()[0].keys())
for user in results:
for post_hash in common:
if post_hash not in results[user]:
common.remove(post_hash)
else:
points[user] += results[user][post_hash]
The issue I'm encountering is that this doesn't actually filter out posts that aren't shared, and thus, doesn't provide accurate point values.
What am I doing wrong with my structure, and is there any easier way to find only the common posts?
A:
I think you may have two issues:
Using a list for common means that when you remove an item via common.remove, it will only remove the first item it finds (there could be more)
You're not just adding points for posts shared by all users - you're adding points for users as you encounter them - before you know if that post is shared by everyone or not
Without some actual data to play with, it's a little difficult to write working code, but try this:
# this should give us a list of posts shared by all users
common = set.intersection(*[set(k.keys()) for k in results.values()])
# there's probably a more efficient (functional) way of summing the points
# by user instead of looping, but simple is good.
for user in results:
for post_hash in common:
points[user] += results[user][post_hash]
|
{
"pile_set_name": "StackExchange"
}
|
Q:
Burninate the "tourist" tag?
I've just noticed that a tourist tag has snuck in. It's on five questions.
Well apart from the fact it should be 'tourists' or 'tourism' it's probably far too broad to be of any use.
In the question I first spotted it in my guess is that somebody typed "tourist visas" into the tag area. Since tags can't contain spaces and both "tourist" and "visas" already existed as tags, the system happily added them.
I'd be surprised if less than half the questions here are about tourism. Probably most of the questions not about business travel.
In any case for the two more specific fields that come to mind we already have better specific tags: sightseeing and tourist-visas.
What think ye?
A:
Burn it with fire. It's prone to misuse, has very little value, and as you've noted, better specific tags are available.
|
{
"pile_set_name": "StackExchange"
}
|
Talk of the Townhttp://talkofthetown.ie
Dundalk - as it happens!Tue, 03 Mar 2015 22:59:00 +0000enhourly1http://wordpress.com/http://s2.wp.com/i/buttonw-com.pngTalk of the Townhttp://talkofthetown.ie
Carrick Road out of Dundalk closed due to road crashhttp://talkofthetown.ie/2015/03/03/carrick-road-out-of-dundalk-closed-due-to-road-crash/
http://talkofthetown.ie/2015/03/03/carrick-road-out-of-dundalk-closed-due-to-road-crash/#commentsTue, 03 Mar 2015 22:39:44 +0000http://talkofthetown.ie/?p=18712]]>
A road traffic accident has taken place on the Carrick Road out of Dundalk just before 10pm this evening with the road closed as a result.
Motorists are urged to avoid the area, with diversions in place as Gardai have closed the road from just before the top of the Ecco Road, which has also been closed off at the Carrick Road end.
The area just over the bridge at the Clarke Train Station is where the incident occurred with access in and out of town from the Ard Easmuinn/Mount Avenue, Dundalk and Carrickmacross directions all affected.
It is understood that a BMW car has been written off with Dundalk Fire Service and the ambulance service attending the scene.
]]>http://talkofthetown.ie/2015/03/03/carrick-road-out-of-dundalk-closed-due-to-road-crash/feed/1talkofthetowndundalk16191_898149446903136_7724339396150750029_nScreen Shot 2015-03-03 at 22.52.04Almost €1.3m lost on “obsolete” equipment for cross-border broadband projecthttp://talkofthetown.ie/2015/03/03/almost-e1-3m-lost-on-obsolete-equipment-for-cross-border-broadband-project/
http://talkofthetown.ie/2015/03/03/almost-e1-3m-lost-on-obsolete-equipment-for-cross-border-broadband-project/#commentsTue, 03 Mar 2015 15:00:50 +0000http://talkofthetown.ie/?p=18709]]>A cross-border broadband project that was to provide faster internet to a number of locations, including Dundalk, had €1.3m worth of equipment bought for it despite the fact it was only worth €30,000.
That’s according to Northern Ireland’s auditor, who found that the “virtually obsolete” Nortel racks were never used and Northern Ireland’s Enterprise Department lost €2m after the EU withdrew.
The company behind the ambitious plan, Bytel, aimed to provide faster internet connections to homes in Belfast, Craigavon, Armagh, Dundalk and Dublin.
Comptroller and auditor general Kieran Donnelly said: “Bytel shows what can go wrong when projects like this are not handled properly.
“I have serious concerns over how it was managed and the legitimacy of the grant payments made. The response to whistleblowers fell well short of the standard required and a robust investigation took too long to complete.”
Although ineligible for funding, €1.3 million was given for equipment that was never used in the project, the audit office said.
The racks were bought by Bytel, a Belfast IT company, for €1.3 million from a “related” company.
The audit report added: “Evidence suggests that this equipment cost €30,000. The racks were never used for the project.”
It said a whistleblower’s concerns, which alerted Stormont’s Enterprise Department to the true cost in 2008, were not brought to the attention of European funders until 2011.
The project, approved in 2004, was to be funded by the EU. However, Europe withdrew because of irregular expenditure and Northern Ireland’s Department of Enterprise, Trade and Investment lost €2 million of EU funding and the Republic’s Department of Communications, Energy and Natural Resources lost €1.8 million, the audit office report said.
Part of the proposed development would be located on lands to the rear of St Paul’s Church in Haynestown
Over 1,000 new homes are being planned for a new village type development at Haggardstown and Haynestown, just outside Dundalk.
Dublin-based Groveview Builders Ltd have applied for planning permission to construct a residential and mixed use development on the outskirts of the town consisting of 1,450 dwellings.
Plans for the massive development first came to light in 2003 but are now being reconsidered due to the ongoing demand for property in the area.
A report earlier this week said there was a need for 1,100 new homes in Dundalk, with that area in particular demand due to the number of jobs recently created in the Xerox Technology Park by companies such as PayPal, eBay and National Pen.
The larger of two developments planned by Groveview is a retail, commercial and residential development located from the Clermont Road to the Marlbog Road. Access to the new village-type development would be via the Clermont Road, the Marlbog Road and the Dublin Road.
It would comprise of 779 houses, 285 apartments in 28 three storey blocks, 76 commercial units comprising offices, financial institution retail units, a mini market, a pub and restaurant, a crèche, a community facility centre and a reserved site for a new primary school.
There would also be five reserved sites for crèches and a proposed distributor road to be located to the west of the site. A further distributor road would be built to accommodate a dormer house on Chapel Road.
As part of the development agri buildings would be demolished and underground car parking installed, as well as other site developments such as landscaping, the installation of a pumping station, outfall foul and surface water sewers and boundary and surface treatments.
The company, run by developer brothers Michael and Cathal Cannon, previously won a planning appeal in 2010 to build 257 homes in Haynestown after Louth County Council had initially refused them planning permission.
They have now sought permission to build these again, in addition to the above development.
The development consists of 257 dwellings (in lieu of 285 number previously approved dwellings in sector one of approved development under planning register reference number 03/1754).
In total this section would consist of 61 two bed two storey dwellings, 100 three bed two storey dwellings, 62 three bed two storey dwellings and 34 four bed two storey dwellings, with an option four bed two storey dwelling without the ground floor extension.
The total area of lands the subject of this application is circa 8.11 hectares located to the west of the Dublin Road, south of the Marlbog Road, north of the Clermont Road and east of new distributor road (currently under construction) at Haynestown.
The council will decide on the applications by mid-April.
]]>http://talkofthetown.ie/2015/03/03/new-village-type-development-planned-for-just-outside-dundalk/feed/1talkofthetowndundalkPart of the proposed development would be located on lands to the rear of St Paul's Church in HaynestownSenator Moran seeking feedback from local Special Needs Assistantshttp://talkofthetown.ie/2015/03/03/senator-moran-seeking-feedback-from-local-special-needs-assistants/
http://talkofthetown.ie/2015/03/03/senator-moran-seeking-feedback-from-local-special-needs-assistants/#commentsTue, 03 Mar 2015 11:29:52 +0000http://talkofthetown.ie/?p=18701]]>
Senator Mary Moran
Senator Mary Moran is seeking the thoughts and opinions of local Special Needs Assistants as rapporteur for the Joint Oireachtas Committee on Education and Social Protections’ report on ‘The Role of the SNA’.
The former St Vincent’s schoolteacher said: “Since being appointed committee rapporteur I have been actively engaging with various stakeholders in this area including SNAs to better inform the findings of this report. I have recently published a 10-question online survey on Survey Monkey titled ‘Role of the Special Needs Assistant – SNA Survey‘.
“I am encouraging Special Needs Assistants in Co Louth to fill in the survey at their earliest opportunity. The survey is anonymous and the data compiled will be used in the committee report.
“I believe it is crucial to have as much input from SNAs as possible in order to better establish the role as prescribed and the role in practice as well as the best way to go forward. I will continue to engage with the various educational stakeholders across the country regarding the role of the SNA over the coming weeks and would encourage anyone interested in discussing this report further to contact me on 042 932 9052 or mary.moran@oir.ie.”
]]>http://talkofthetown.ie/2015/03/03/senator-moran-seeking-feedback-from-local-special-needs-assistants/feed/1talkofthetowndundalkSenator Mary MoranMcMillan the favourite to be Dundalk’s top scorer this yearhttp://talkofthetown.ie/2015/03/03/mcmillan-the-favourite-to-be-dundalks-top-scorer-this-year/
http://talkofthetown.ie/2015/03/03/mcmillan-the-favourite-to-be-dundalks-top-scorer-this-year/#commentsTue, 03 Mar 2015 10:20:25 +0000http://talkofthetown.ie/?p=18699]]>The new SSE Airtricity League Premier Division season gets underway on Friday night with champions Dundalk hosting Longford Town at Oriel Park.
The new campaign also brings about a new betting market with Paddy Power backing the club’s new number nine David McMillan to follow in his predecessor Pat Hoban’s footsteps by being the league’s leading scorer this season.
The former UCD striker is 12/1 to be the league’s leading marksman, with new signing Ronan Finn next in the betting at 20/1.
Richie Towell and Kurtis Byrne are both 22/1 while defender Brian Gartland – who plundered eight in the league last season – is 40/1.
New signing Jake Kelly is 50/1, while former Lilywhite Mark Griffin – now at Bohemians – is 100/1.
Christy Fagan is the 4/1 favourite for top scorer with Danny North (Shamrock Rovers) 10/1 and Ciaran Kilduff (St Patrick’s Athletic), Conan Byrne (St Patrick’s Athletic) and Mark O’Sullivan (Cork City) all 12/1. You can view the full betting market here.
Meanwhile Dundalk are 11/4 joint second favourites with Shamrock Rovers to lift the title, with St Patrick’s Athletic the 5/2 favourites.
Local estate agents DNG Duffy look set to relocate their offices to the former Planet video store at 66-67 Park Street.
Currently based at 18 Park Street, facing Jimmy’s Bar, owner Keith Duffy has just applied for planning permission to carry out alterations to the shop front of the recently bought building which he is believed to have purchased.
He has also sought planning permission for two projecting signs and the “relocation of office/financial and professional services use from 18 Park Street to 66-67 Park Street.”
The purchase of the former Planet video store, which has been lying idle for some years, included two units on Gray’s Lane, neither of which are part of the planning application to Louth County Council.
A new online fashion brand with origins in Dundalk has launched recently.
FROWW is an exciting new ready-to-wear clothing brand that is inspired by models, bloggers, celebrities and fashion editors.
The name FROWW comes from the acronym ’Frow’ which stands for the ‘front row’ in fashion.
The brand was created by sisters Áine and Eilis McDonnell, who hail from the local village of Knockbridge. With a serious passion for fashion, their aim is to create ready-to-wear collections that combine the hottest trends and unique designs.
FROWW.com offers an exclusive high quality range of clothing, from chic dresses and chunky knitwear to must-have tops.
Team FROWW are setting out to give luxe fabrics and cool cuts with an affordable price tag… And, judging by the huge interest in their launch, the London label looks set to explode and become a new favourite online shopping destination.
You can connect with FROWW via Facebook, Twitter and Instagram as well as signing up for their email newsletter for more inside fashion tips and key catwalk looks.
With Ireland and international delivery options, including next day delivery throughout Ireland, it couldn’t be easier to get the latest, hottest fashions from FROWW.com.
FROWW.com are also currently collabrating with Ireland’s top fashion blogger sosueme.ie. They have 250 £20 vouchers up for grabs along with a beauty hamper worth €100. To enter click here.
Major work is being planned for St Oliver Plunkett’s Church in Blackrock.
Louth County Council has granted planning permission to Parish Priest Fr Padraig Keenan to construct a new site entrance to the church, located on the southside of the building at the position of the present confessional.
The existing confessional structure would be demolished and re-configured to form an ambulant and wheel chair accessible single storey porch with new glazed doors and screens.
Additional space would also be allocated in the Nave to allow for improved circulation for safe entry and exit.
Other works will include the upgrading of the mechanical and electrical system of the buildings and the re-decoration of all spaces.
There will also be alterations to the existing Sanctuary with a relocation planned of the existing Altar and the reinstatement and restoration of existing mosaic floor at the altar rails.
Alterations will also be made to the Sacristy building with a porch added to the main entrance door and the existing PVC windows replaced with hardwood.
It is also planned to relocate the existing plant room to a new detached single storey A-pitched structure to the rear of the Sacristy.
This building will also accommodate a wheelchair accessible toilet and bunded oil storage room. The existing oil storage tank to the rear of the church would be removed.
On the ground works would include a new layout of the existing car park to include an additional two disabled car parking spaces and improved pedestrian access.
|
{
"pile_set_name": "Pile-CC"
}
|
The video (above) shows a version of the Channel with several islands removed, according to a campaign launched by Sum Of Us and LeadNow.ca. The two groups are trying to pressure Enbridge to remove the video.
In the lead-in to their animated video, Enbridge states, “This animation is meant for illustrative purposes only. It is meant to be broadly representational, not to scale.”
|
{
"pile_set_name": "Pile-CC"
}
|
Hong Kong democracy activist Joshua Wong was among three pro-democracy figures arrested on Thursday and Friday, ahead of another weekend of planned protests in the Chinese-ruled region which is grappling with its biggest political crisis since its handover to Beijing more than two decades ago.
Wong was "suddenly pushed into a private car on the street," on Friday, according to the official Twitter account of his political party, Demosisto, which advocates for greater democracy in Hong Kong.
The party said Wong had been taken to the police headquarters in Wan Chai — a busy commercial area — and that its lawyers were working on the case.
Wong, the face of Hong Kong's push for full democracy during protests in 2014 that paralyzed parts of the city for 79 days, was released from jail in June after serving a five-week term for contempt of court.
Wong's last tweet reiterated the protesters' five demands.
Being Born in uncertain times carries-certain responsibilities. Five Demands, Not One Less. <a href="https://t.co/09gJlPn8WL">https://t.co/09gJlPn8WL</a><br><br>HONG KONG DEMOCRATIC MOVEMENT 2019 —@joshuawongcf
Demosisto later reported that another member of the group, Agnes Chow, was also detained on Friday.
SITUATION UPDATE: Our member <a href="https://twitter.com/chowtingagnes?ref_src=twsrc%5Etfw">@chowtingagnes</a> has also been arrested this morning. She is being sent to the Wan Chai police headquarters, where <a href="https://twitter.com/joshuawongcf?ref_src=twsrc%5Etfw">@joshuawongcf</a> is currently detained. —@demosisto
The Hong Kong Free Press reported that Andy Chan, the leader of the banned pro-independence Hong Kong National Party, had been detained at the airport on Thursday while trying to board a flight to Japan.
The newspaper cited a police spokesperson who said Chan was arrested on suspicion of rioting and assaulting a police officer.
Hong Kong police later said Wong and Chow were were arrested for role in a June 21 police station protest. Both face potential charges of participating in the demonstration and inciting others to join it. Wong also is being investigated on suspicion of organizing it.
Police also confirmed the arrest of Demosisto member, Agnes Chow. (Issei Kato/Reuters)
Police have refused permission for a pro-democracy march on Saturday and an appeal by organizers to allow the demonstration to proceed was turned down on Friday.
The Civil Human Rights Front, the organizer of previous mass protests, said it would comply with the order and cancel the march from Hong Kong's central business district to Beijing's main representative Liaison Office in the city.
Unrest in Hong Kong escalated in mid-June over a now-suspended extradition bill that would have allowed people to be sent to mainland China for trial in Communist Party-controlled courts.
It has since evolved into calls for greater democracy under the "one country, two systems" formula, which guarantees freedoms not enjoyed on the mainland, including an independent judiciary.
On Thursday, China brought fresh troops into Hong Kong in what it described as a routine rotation of the garrison.
Andy Chan, founder of the Hong Kong National Party, seen here in August 2018, was reportedly detained at the airport Thursday while trying to board a flight to Japan. (Paul Yeung/Reuters)
Chinese state media stressed the troop movement was routine and Asian and Western diplomats watching the People's Liberation Army forces in the former British colony had been expecting it.
Chinese soldiers stationed in Hong Kong are not there merely for symbolic purposes and they will have "no reason to sit on their hands" if the situation there worsens, an editorial in the China Daily newspaper said on Friday.
Police have refused permission for a pro-democracy march on Saturday, but organizers have appealed against the decision.
The protest would mark five years since Beijing ruled out universal suffrage for Hong Kong and comes as Hong Kong faces its first recession in a decade, with all its pillars of growth under stress.
|
{
"pile_set_name": "OpenWebText2"
}
|
Max Pacioretty, NHL lockout player from the Montreal Canadien's is presented as the new player of Swiss ice hockey club HC Ambri-Piotta, Wednesday, Sept. 2012, in Ascona, Switzerland. Because of an NHL lockout, several players are seeking work in Switzerland, and sign temporary contracts with Swiss ice hockey clubs.Karl Mathis
/ AP Photo/Keystone,
Alex Ovechkin of the Washington Capitals is playing with his old team, Dynamo Moscow. He has suggested that he may stay in his native Russia even after the NHL lockout is over. “As to the future, it will depend on what kind of conditions there will be in the NHL with the new CBA,” said Ovechkin to the Russian news agency RIA Novosti. “If our contracts get slashed, I will have to think whether to return there or not. I won’t rule out staying in the KHL, even past this season.”Greg Fiume
/ Getty Images
Vancouver native Evander Kane #9 of the Winnipeg Jets Winnipeg Jets became the North American to join the Kontinental Hockey League. Kane is playing with Dinamo Minsk in Belarus. "They love their hockey here," said Kane on Twitter. "Can't wait to play!"Marianne Helm
/ Getty Images
Almost Done!
Postmedia wants to improve your reading experience as well as share the best deals and promotions from our advertisers with you. The information below will be used to optimize the content and make ads across the network more relevant to you. You can always change the information you share with us by editing your profile.
By clicking "Create Account", I hearby grant permission to Postmedia to use my account information to create my account.
I also accept and agree to be bound by Postmedia's Terms and Conditions with respect to my use of the Site and I have read and understand Postmedia's Privacy Statement. I consent to the collection, use, maintenance, and disclosure of my information in accordance with the Postmedia's Privacy Policy.
Postmedia wants to improve your reading experience as well as share the best deals and promotions from our advertisers with you. The information below will be used to optimize the content and make ads across the network more relevant to you. You can always change the information you share with us by editing your profile.
By clicking "Create Account", I hearby grant permission to Postmedia to use my account information to create my account.
I also accept and agree to be bound by Postmedia's Terms and Conditions with respect to my use of the Site and I have read and understand Postmedia's Privacy Statement. I consent to the collection, use, maintenance, and disclosure of my information in accordance with the Postmedia's Privacy Policy.
|
{
"pile_set_name": "Pile-CC"
}
|
Create a Project using Eclipse
1. File - > New or Right Click on the Project Explorer Pane and Select New . Select Android Application Project.
2. You will get a window as shown below.
3. Fill the details
a) Application Name : This will be the name that appears to the user.
b) Project Name : This is the name of the project directory which will be visible in eclipse .
c) Package Name : This is the package namespace of your app. Make sure you use a proper package name . Your package name must be unique across all packages installed on the Android system .
d) Minimum Required SDK - It is the lowest of version of Android that your app supports.
e) Target SDK - It indicates the highest version of Android your app has been tested on. Please select the latest version supported to take the maximum advantage . f) Compile with - indicates the highest version of Android against which you are going to compile your app. Set it to the latest versions to take maximum advantage of the sdk .
|
{
"pile_set_name": "Pile-CC"
}
|
Star Wars: Episode VII Set to Begin Filming May 13 in Abu Dhabi.
Star Wars: Episode VII reportedly begins filming this Tuesday, May 13, in Abu Dhabi, with production said to continue there until at least the end of May.
According to sources for The National, “the sets are getting closer to completion, with a ‘whole world’ having been built on an otherworldly salt lake at one location, a ‘shuttle-like’ spacecraft, a large tower, a ‘big, centuries-old-looking market’, something the crew are reportedly referring to as the ‘alien house’ and 10 to 15 ‘really fast buggies’ powered by jet engines.”
The site also reports that two truckloads of explosives were brought in to create a big crater in the desert. And to keep any onlookers from trying to get close enough to the remote desert location to snap photos, the police and army are checking all vehicles approaching the vicinity to make sure they belong there.
Crew members and some of the cast are said to have checked into their hotels in Abu Dhabi last week.
|
{
"pile_set_name": "Pile-CC"
}
|
Q:
How to select files based on timestamp of 15 minutes interval using Shell Script
I am trying to grep some data from log files (based on timestamp). I need to pick files from 15 minutes of interval, 4 times in each hour. I am able to do that for 10 minutes but for 15 minutes I my logic failed everytime.
This is my first shell script so there must be some issues. Please guide me.
while [ ${HR} -lt 24 ]
do
MI=0
COUNT=1
if [ $HR -le 9 ]
then
Bhr=0$HR
else
Bhr=$HR
fi
while [ $COUNT -lt 4 ]
do
Bsp=$MI*
fname="TSG_${dt}_${Bhr}_${Bsp}.log.gz"
echo $fname
MINUTE=15
MINUTE=`expr $MINUTE \* $COUNT`
echo "processing on" Date ${dt} Hour $HR Minute ${MINUTE}
resp=`zgrep "AUTHENTICATION_RESPONSE" ${fname} 2>/dev/null | wc -l`
rejections=`zgrep -i "tsgWorker for Dynamic authentication rejection" ${fname} 2>/dev/null | wc -l`
sec1=`zgrep "AUTHENTICATION_RESPONSE" ${fname} 2>/dev/null | zgrep "diffTime:1-"| wc -l`
sec2=`zgrep "AUTHENTICATION_RESPONSE" ${fname} 2>/dev/null | zgrep "diffTime:2-"| wc -l`
sec3=`zgrep "AUTHENTICATION_RESPONSE" ${fname} 2>/dev/null | zgrep "diffTime:3-"| wc -l`
sec4=`zgrep "AUTHENTICATION_RESPONSE" ${fname} 2>/dev/null | zgrep "diffTime:4-"| wc -l`
sec5=`zgrep "AUTHENTICATION_RESPONSE" ${fname} 2>/dev/null | zgrep "diffTime:5-"| wc -l`
sec6=`zgrep "AUTHENTICATION_RESPONSE" ${fname} 2>/dev/null | zgrep "diffTime:6-"| wc -l`
sec7=`zgrep "AUTHENTICATION_RESPONSE" ${fname} 2>/dev/null | zgrep "diffTime:7-"| wc -l`
sec8=`zgrep "AUTHENTICATION_RESPONSE" ${fname} 2>/dev/null | zgrep "diffTime:8-"| wc -l`
sec9=`zgrep "AUTHENTICATION_RESPONSE" ${fname} 2>/dev/null | zgrep "diffTime:9-"| wc -l`
sec10=`zgrep "AUTHENTICATION_RESPONSE" ${fname} 2>/dev/null | zgrep "diffTime:1.-"| wc -l`
sec20=`zgrep "AUTHENTICATION_RESPONSE" ${fname} 2>/dev/null | zgrep "diffTime:2.-"| wc -l`
sec30=`zgrep "AUTHENTICATION_RESPONSE" ${fname} 2>/dev/null | zgrep "diffTime:3.-"| wc -l`
echo $ddt $Bhr $MINUTE, "Authentication", $sec1, $sec2, $sec3, $sec4, $sec5, $sec6, $sec7, $sec8, $sec9, $sec10, $sec20, $sec30, $rejections >> $OUTPUTFILE
MI=$(((MI/15)*15))
if [ $MI -le 15 ]
then
MI=`expr $MI + 1`
else
COUNT=`expr $COUNT + 1`
fi
done
HR=`expr $HR + 1`
done
A:
I'm assuming your shell is bash. I'm going to use bash's extended globbing to capture a list of files in the range of minutes, and store into an array
min=$( date +%_M ) # the underscore replaces leading 0 with space
shopt -s extglob
if (( 0 <= min && min < 15 )); then
files=( TSG_${dt}_${hr}_+(0[0-9]|1[0-4]).log.gz )
elif (( 15 <= min && min < 30 )); then
files=( TSG_${dt}_${hr}_+(1[5-9]|2[0-9]).log.gz )
elif (( 30 <= min && min < 45 )); then
files=( TSG_${dt}_${hr}_+(3[0-9]|4[0-4]).log.gz )
elif (( 45 <= min && min <= 59 )); then
files=( TSG_${dt}_${hr}_+(4[5-9]|5[0-9]).log.gz )
fi
for file in "${files[@]}"; do
: do something with "$file"
done
# or do something with all the files:
output=$( zcat "${files[@]}" | grep ... )
Be consistent with your variable names: either use lower case or upper. But don't use upper ;) -- one day you'll say PATH=something and your script will stop working.
|
{
"pile_set_name": "StackExchange"
}
|
Primary colonic epithelial cell culture of the rabbit producing prostaglandins.
We have established primary colonic epithelial cell culture from adult rabbits and examined effects of anti-inflammatory drugs on prostaglandin (PG) E2 production. Colonic epithelium of adult rabbits was scraped and minced into small pieces. They were incubated for isolation in Hanks' balanced salt solution with 0.35% collagenase and Earle's solution with 1 mM EDTA. Isolated cells were cultured in Coon's modified Ham's F-12 medium with 10% fetal bovine serum and antibiotics on collagen coated cell wells. The medium was refed twice a week. The production of PGs was assessed by high pressure liquid chromatography (HPLC). PGE2 and PGF2 alpha were measured by radioimmunoassay. Within 24 hours after inoculation, the cell clumps attached to the surface of the wells and cells began to spread out and grow. Monolayer cultures became confluent in 4 days. Phase contrast microscopy showed that these cells consisted of a homogeneous population of epithelial cells with large oval nuclei, polyhedral shape, and organized sheet-like growth pattern. HPLC profile showed synthesis of 6-keto-PGF1 alpha, thromboxane B2, PGF2 alpha, PGE2, and PGD2 by cultured cells. Quantitatively, 117 +/- 7 ng/mg-protein/hour PGE2 and 7.4 +/- 0.7 ng/mg-protein/hour PGF2 alpha were produced. While hydrocortisone (10(-4) - 10(-2) M) did not show a significant effect on PGE2 production, indomethacin (10(-8) - 10(-6) M), and 5-aminosalicylic acid (2X10(-4)-5X10(-3) M) inhibited PGE2 production. We have established relatively convenient procedure for primary culture of colonic epithelial cells from adult rabbits. Different actions of anti-inflammatory drugs on PGE2 synthesis suggest that these cultured cells might be a good tool for the various cellular functional studies of normal colonic epithelial cells.
|
{
"pile_set_name": "PubMed Abstracts"
}
|
"It was a horrible statement. I was actually surprised by it," Trump said of his own remarks. | Getty Trump: I never thought Cruz's father had anything to do with JFK assassination
Donald Trump does not believe Ted Cruz's father had anything to do with the assassination of President John F. Kennedy.
"No, I don't," the presumptive Republican nominee said during an interview with CNN's Wolf Blitzer aired Wednesday.
Blitzer noted that Trump's past reference to the fact came from a National Enquirer story.
"Of course I don't think that," Trump said, a day after accusing Rafael Cruz in a telephone interview with Fox News of being with Kennedy assassin Lee Harvey Oswald handing out pro-Castro pamphlets in New Orleans in 1963.
Blitzer then said that Trump, as the presumptive Republican nominee, should not be trafficking in conspiracy theories.
"No, I wasn't. Not at the time," Trump said about his status when he made the allegations Tuesday morning, despite the fact that the candidate had declared himself the presumptive nominee after his string of victories on April 26.
"Here is what happened. Ted Cruz's father seems like a nice guy, I don't know him, but seems like a nice guy, he made horrible statements about me, you know, pray — praying for bad things to happen to me. Okay, essentially. I said that's horrible. And I was on a show, one of your competitors, and they showed me the clip. I said, wow, that's horrible," Trump said, in reference to the Fox News interview. "It's not just a one-way street, you know, where I do something. It was a horrible statement. I was actually surprised by it."
Blitzer pressed, asking Trump if the presumptive nominee should be held to a higher standard. Trump's response: I wasn't the presumptive nominee at that time.
"First of all, I wasn't at the time. I didn't know if I was going to win Indiana or not, it ended up being a landslide, it was a tremendous victory, much bigger than anybody anticipated including myself. They're incredible people out there. This was in the morning," Trump said. "Now, by the afternoon it looked like I was going to win and then a little bit later it looked like I was going to win big. So I was not a presumptive winner at that time, I was going against them, they were going against me.:
"Bottom line you don't believe in that conspiracy," Blitzer asked.
"Of course I don't believe it," Trump said. "I didn't believe it, but I did say let people read it."
|
{
"pile_set_name": "OpenWebText2"
}
|
I was watching a lecture on the Sharing Economy by Michael Munger, and someone asked a great question at the end.
They wanted to know if this trend of companies like Airbnb, Uber, and Zipcar was going to create more big companies or help grow small businesses.
The speaker’s answer was that there is a distinction between big companies and valuable companies. Many businesses in the Sharing Economy space have a very high valuation but few actual employees. Some, like Uber, Lyft, and Instacart, hire thousands of contractors, which helps them to scale and spread quickly.
Because of this trend, the speaker argues that we may see traditional employment disappear, as he says —
“Productivity destroys employment…So what we may have to rethink is our commitment to a successful economy producing jobs, and thinking instead that a successful economy produces satisfaction. Jobs are a means to an end. And so, for a lot of young people, I think that the idea that you could work 20 hours a week and still have a satisfactory life sounds pretty good.”
But one point of concern is that these companies could be taking advantage of independent contractors. Those involved in the Sharing Economy may have to depend on inconsistent hours, unreliable income, a lack of insurance, and other factors that workers in traditional jobs wouldn't have to worry about.
How can the government and the Sharing Economy work together in a way that is fair and beneficial to both the average worker and the average consumer?
We’re in the midst of rapidly transforming times, and regulation is struggling to keep up with the pace. Hopefully we can find a diplomatic way to navigate through this uncharted territory.
|
{
"pile_set_name": "OpenWebText2"
}
|
011217 Egyptian Theatre (MA)
Matthew Apgar - mapgar@shawmedia.com
The Egyptian Theatre facade stands tall in downtown DeKaln on Wednesday, Jan. 12, 2017. The historic theatre was recently part of a long study that suggested the city of DeKalb take over its ownership, turn it into a performing arts center, and invest $250,000 per year into it.
|
{
"pile_set_name": "Pile-CC"
}
|
More than 70 Humber College students at a campus residence fell ill Thursday night with some type of gastrointestinal illness, but the cause of the sudden outbreak remains unknown.
The students all live at the one residence on the north campus at Highway 27 and Finch, and started reporting feeling ill late in the afternoon, according to Andrew Leopold, director of communications.
More students fell ill as the evening wore on, he told CBC Toronto early Friday morning.
The school's dean of students later told reporters that of the 77 students in total who got sick, 30 were taken to hospital.
"All students who were transported were treated and released and returned to residence throughout the night," Jen McMillen told reporters outside the school.
Toronto Public Health investigating
The students were all suffering from symptoms like vomiting and abdominal pain, she said. Some of the school staff members who were helping students at the residence through the night have also developed the symptoms, according to McMillen.
More than 70 Humber College students at a campus residence fell ill Thursday night with some type of gastrointestinal illness, but the cause of the sudden outbreak remains unknown. 0:24
The source of the illness has not yet been determined, she said when asked whether food poisoning may be to blame. To her knowledge, food was still being served on campus.
The school notified Toronto Public Health (TPH), McMillen said. The city agency focused on food poisoning when addressing CBC's questions on Friday.
Dr. Michael Finkelstein, associate medical officer of health, said TPH has opened an investigation, which includes speaking to officials at the hospital where students were treated, as well as health-care personnel at the school.
"TPH will be reaching out to the students who reported that they were ill today to gather more information such as where they ate and what food they ate before they became ill and if they attended any specific functions where food was served before they became ill," Finkelstein said in a statement provided to CBC.
'Nobody wants to come out of their rooms'
Students who were outside the residence Friday described the atmosphere in the building.
"Nobody wants to come out of their rooms," Duncan Lotoski told CBC.
Lotoski was in bed around 9:30 p.m. ET when he noticed flashing lights through his window. When he looked out, he saw a number of ambulances.
"Then you hear supervisors in the halls handing out masks saying, 'Wash your hands, wash your hands,'" he said. "I just stayed in my room for the rest of the night."
Jazz McClean said friends who have fallen ill are convinced they got food poisoning.
"It was wild," he said of what it was like inside the residence building overnight. "There were people on the floor."
Meanwhile, classes and other services on campus were not affected on Friday, McMillen said.
Students are being instructed to rest, drink lots of fluids and to "practice good hygiene," she said.
|
{
"pile_set_name": "OpenWebText2"
}
|
We must learn lessons from the absence of any positive Brexit vision
We must learn lessons from the absence of any positive Brexit vision
Letters
ROBIN McAlpine’s article (If you are agonising over when the next independence referendum should be held, you are asking the wrong question, January 27) and the follow-ups are very welcome. Reaching out and appealing to potential new pro-indy voters is obviously fundamental to getting us (well) over the 50% mark. Equally vital are the practicalities of keeping the 45%. After all, we should take nothing for granted!
The questions of how and when to “engage” are paramount, but so too is what we say. Just what are the pro-indy messages? The actual indyref2 date should identify the tangible timetable for end-game campaigning, and not be the starting gun. So, let’s be honest, if we are not consistently 50% and more in the polls at this stage, what needs to change?
McAlpine mentioned a “position of strength”. Grassroots indy never stopped, never went away and that is a major component of our strength we need to exploit and progress. I do believe, though, that “presence” alone is not sufficient. I’ll continue to march, be on stalls, deliver leaflets, whatever, but much more is needed. We have to be positively talking up Scotland not just from the heart, but from an “informed” base. And I think we can learn from PM May and what she and her government haven’t done over the last two years or so.
At no stage have I seen her, her government, or even a “front” organisation engage along the lines of any benefits post-Brexit. They’ve been too busy infighting and pushing Project Fear, so much so that they haven’t even been able to do the day job of governing. Just imagine if there had been a positive message about post-Brexit: say socio-economic change in deprived, stagnating communities? Not aspirational, but examples: opening up debates at local meetings, discussion groups, plans with pros and cons. OK, the message on the bus was a bad move, but they could have learnt from that, moving on with ideas for real change whilst seeking views, comments, and alternatives, but always with a belief in the positive that they were promoting.
I doubt if any such campaign and messaging would have worked here even if they had tried. We’re too savvy in Scotland to trust a Tory. But that lack of vision and beneficial change has helped cement Brexit paralysis within all the Unionist parties, and led to entrenchment in the voters. Neither camp is willing to listen, far less change, apart from those few self-interested MPs seeking to ensure party unity.
We need to be showing, saying, telling, how an indy Scotland will be different, and not merely offering a wish list of change; no-one, not even rUK, “wants” austerity; we all abhor food banks, but how do we grow the economy, how do we move away from in-work poverty? If that’s a plus coming from independence, spell it out.
If we’re hoping to engage with new, first-time younger voters come indyref 2, what’s indy Scotland going to do for them? Shoving a registration form into someone’s hand isn’t sufficient in itself. Neither is a mantra of “vote, make a difference, ensure your voice is heard”.’
In light of our democratic voices being dismissed over the last voting occasions, where are those constructive alternatives, the reasons to vote and vote for indy? Lesley Riddoch’s most recent contributions via her excellent films are superb examples of reaching out and engaging. Yes, expensive to produce, but with a long pertinent shelf life. Since we can’t command newsprint, TV, media the way that pro-Union can, how can we use what passes for “alternatives”? White Papers and reports can make good reference points, but they’re not necessarily persuasive in their own right, nor do they make “light” reading. Perhaps the time has come for “papers” or “pamphlets” addressing separate issues such as the economy and migration. Or being able to respond to a current topic, ie “Should we be rethinking cross-channel ferries from Scotland to mainland Europe: pros and cons”.
It’s not just the political vision we need, bringing with it as it will do its party-political baggage. It’s not a future Scotland for and by politicians. It’s being able to show what Scotland could look like in the future, one the people can help shape with their pro-indy vote. Perhaps the Scottish Independence Convention, CommonWeal or others in the indy movement will produce “articles” that will stimulate discussion, fire up public meetings, provide the foot sore volunteers with more “leaflets”.
We don’t need a fixed campaign timetable to do so, but we do need to be able to demonstrate the positives of why it is worth continuing to work towards independence.
This website and associated newspapers adhere to the Independent Press Standards Organisation's Editors' Code of Practice. If you have a complaint about the editorial content which relates to inaccuracy or intrusion, then please contact the editor here. If you are dissatisfied with the response provided you can contact IPSO here
|
{
"pile_set_name": "Pile-CC"
}
|
#include "stdafx.h"
#include "resource.h"
#include "SmartRenameUI.h"
#include <commctrl.h>
#include <Shlobj.h>
#include <helpers.h>
#include <settings.h>
#include <windowsx.h>
extern HINSTANCE g_hInst;
int g_rgnMatchModeResIDs[] =
{
IDS_ENTIREITEMNAME,
IDS_NAMEONLY,
IDS_EXTENSIONONLY
};
enum
{
MATCHMODE_FULLNAME = 0,
MATCHMODE_NAMEONLY,
MATCHMODE_EXTENIONONLY
};
struct FlagCheckboxMap
{
DWORD flag;
DWORD id;
};
FlagCheckboxMap g_flagCheckboxMap[] =
{
{ UseRegularExpressions, IDC_CHECK_USEREGEX },
{ ExcludeSubfolders, IDC_CHECK_EXCLUDESUBFOLDERS },
{ EnumerateItems, IDC_CHECK_ENUMITEMS },
{ ExcludeFiles, IDC_CHECK_EXCLUDEFILES },
{ CaseSensitive, IDC_CHECK_CASESENSITIVE },
{ MatchAllOccurrences, IDC_CHECK_MATCHALLOCCURRENCES },
{ ExcludeFolders, IDC_CHECK_EXCLUDEFOLDERS },
{ NameOnly, IDC_CHECK_NAMEONLY },
{ ExtensionOnly, IDC_CHECK_EXTENSIONONLY }
};
struct RepositionMap
{
DWORD id;
DWORD flags;
};
enum
{
Reposition_None = 0,
Reposition_X = 0x1,
Reposition_Y = 0x2,
Reposition_Width = 0x4,
Reposition_Height = 0x8
};
RepositionMap g_repositionMap[] =
{
{ IDC_SEARCHREPLACEGROUP, Reposition_Width },
{ IDC_OPTIONSGROUP, Reposition_Width },
{ IDC_PREVIEWGROUP, Reposition_Width | Reposition_Height },
{ IDC_EDIT_SEARCHFOR, Reposition_Width },
{ IDC_EDIT_REPLACEWITH, Reposition_Width },
{ IDC_LIST_PREVIEW, Reposition_Width | Reposition_Height },
{ IDC_STATUS_MESSAGE, Reposition_Y },
{ ID_RENAME, Reposition_X | Reposition_Y },
{ ID_ABOUT, Reposition_X | Reposition_Y },
{ IDCANCEL, Reposition_X | Reposition_Y }
};
inline int RECT_WIDTH(RECT& r) { return r.right - r.left; }
inline int RECT_HEIGHT(RECT& r) { return r.bottom - r.top; }
#define MAX_INPUT_STRING_LEN 1024
// IUnknown
IFACEMETHODIMP CSmartRenameUI::QueryInterface(__in REFIID riid, __deref_out void** ppv)
{
static const QITAB qit[] =
{
QITABENT(CSmartRenameUI, ISmartRenameUI),
QITABENT(CSmartRenameUI, ISmartRenameManagerEvents),
QITABENT(CSmartRenameUI, IDropTarget),
{ 0 },
};
return QISearch(this, qit, riid, ppv);
}
IFACEMETHODIMP_(ULONG) CSmartRenameUI::AddRef()
{
return InterlockedIncrement(&m_refCount);
}
IFACEMETHODIMP_(ULONG) CSmartRenameUI::Release()
{
long refCount = InterlockedDecrement(&m_refCount);
if (refCount == 0)
{
delete this;
}
return refCount;
}
HRESULT CSmartRenameUI::s_CreateInstance(_In_ ISmartRenameManager* psrm, _In_opt_ IDataObject* pdo, _In_ bool enableDragDrop, _Outptr_ ISmartRenameUI** ppsrui)
{
*ppsrui = nullptr;
CSmartRenameUI *prui = new CSmartRenameUI();
HRESULT hr = prui ? S_OK : E_OUTOFMEMORY;
if (SUCCEEDED(hr))
{
// Pass the ISmartRenameManager to the ISmartRenameUI so it can subscribe to events
hr = prui->_Initialize(psrm, pdo, enableDragDrop);
if (SUCCEEDED(hr))
{
hr = prui->QueryInterface(IID_PPV_ARGS(ppsrui));
}
prui->Release();
}
return hr;
}
// ISmartRenameUI
IFACEMETHODIMP CSmartRenameUI::Show(_In_opt_ HWND hwndParent)
{
return _DoModeless(hwndParent);
}
IFACEMETHODIMP CSmartRenameUI::Close()
{
_OnCloseDlg();
return S_OK;
}
IFACEMETHODIMP CSmartRenameUI::Update()
{
return S_OK;
}
IFACEMETHODIMP CSmartRenameUI::get_hwnd(_Out_ HWND* hwnd)
{
*hwnd = m_hwnd;
return S_OK;
}
IFACEMETHODIMP CSmartRenameUI::get_showUI(_Out_ bool* showUI)
{
// Let callers know that it is OK to show UI (ex: progress dialog, error dialog and conflict dialog UI)
*showUI = true;
return S_OK;
}
// ISmartRenameManagerEvents
IFACEMETHODIMP CSmartRenameUI::OnItemAdded(_In_ ISmartRenameItem*)
{
return S_OK;
}
IFACEMETHODIMP CSmartRenameUI::OnUpdate(_In_ ISmartRenameItem*)
{
UINT itemCount = 0;
if (m_spsrm)
{
m_spsrm->GetItemCount(&itemCount);
}
m_listview.RedrawItems(0, itemCount);
_UpdateCounts();
return S_OK;
}
IFACEMETHODIMP CSmartRenameUI::OnError(_In_ ISmartRenameItem*)
{
return S_OK;
}
IFACEMETHODIMP CSmartRenameUI::OnRegExStarted(_In_ DWORD threadId)
{
m_disableCountUpdate = true;
m_currentRegExId = threadId;
_UpdateCounts();
return S_OK;
}
IFACEMETHODIMP CSmartRenameUI::OnRegExCanceled(_In_ DWORD threadId)
{
if (m_currentRegExId == threadId)
{
m_disableCountUpdate = false;
_UpdateCounts();
}
return S_OK;
}
IFACEMETHODIMP CSmartRenameUI::OnRegExCompleted(_In_ DWORD threadId)
{
// Enable list view
if (m_currentRegExId == threadId)
{
m_disableCountUpdate = false;
_UpdateCounts();
}
return S_OK;
}
IFACEMETHODIMP CSmartRenameUI::OnRenameStarted()
{
// Disable controls
EnableWindow(m_hwnd, FALSE);
return S_OK;
}
IFACEMETHODIMP CSmartRenameUI::OnRenameCompleted()
{
// Enable controls
EnableWindow(m_hwnd, TRUE);
// Close the window
PostMessage(m_hwnd, WM_CLOSE, (WPARAM)0, (LPARAM)0);
return S_OK;
}
// IDropTarget
IFACEMETHODIMP CSmartRenameUI::DragEnter(_In_ IDataObject* pdtobj, DWORD /* grfKeyState */, POINTL pt, _Inout_ DWORD* pdwEffect)
{
if (m_spdth)
{
POINT ptT = { pt.x, pt.y };
m_spdth->DragEnter(m_hwnd, pdtobj, &ptT, *pdwEffect);
}
return S_OK;
}
IFACEMETHODIMP CSmartRenameUI::DragOver(DWORD /* grfKeyState */, POINTL pt, _Inout_ DWORD* pdwEffect)
{
if (m_spdth)
{
POINT ptT = { pt.x, pt.y };
m_spdth->DragOver(&ptT, *pdwEffect);
}
return S_OK;
}
IFACEMETHODIMP CSmartRenameUI::DragLeave()
{
if (m_spdth)
{
m_spdth->DragLeave();
}
return S_OK;
}
IFACEMETHODIMP CSmartRenameUI::Drop(_In_ IDataObject* pdtobj, DWORD, POINTL pt, _Inout_ DWORD* pdwEffect)
{
if (m_spdth)
{
POINT ptT = { pt.x, pt.y };
m_spdth->Drop(pdtobj, &ptT, *pdwEffect);
}
EnableWindow(GetDlgItem(m_hwnd, ID_RENAME), TRUE);
EnableWindow(m_hwndLV, TRUE);
// Populate the manager from the data object
if (m_spsrm)
{
_EnumerateItems(pdtobj);
}
return S_OK;
}
HRESULT CSmartRenameUI::_Initialize(_In_ ISmartRenameManager* psrm, _In_opt_ IDataObject* pdo, _In_ bool enableDragDrop)
{
// Cache the smart rename manager
m_spsrm = psrm;
// Cache the data object for enumeration later
m_spdo = pdo;
m_enableDragDrop = enableDragDrop;
HRESULT hr = CoCreateInstance(CLSID_DragDropHelper, NULL, CLSCTX_INPROC, IID_PPV_ARGS(&m_spdth));
if (SUCCEEDED(hr))
{
// Subscribe to smart rename manager events
hr = m_spsrm->Advise(this, &m_cookie);
}
if (FAILED(hr))
{
_Cleanup();
}
return hr;
}
HRESULT CSmartRenameUI::_InitAutoComplete()
{
HRESULT hr = S_OK;
if (CSettings::GetMRUEnabled())
{
hr = CoCreateInstance(CLSID_AutoComplete, NULL, CLSCTX_INPROC, IID_PPV_ARGS(&m_spSearchAC));
if (SUCCEEDED(hr))
{
hr = CRenameMRUSearch_CreateInstance(&m_spSearchACL);
if (SUCCEEDED(hr))
{
hr = m_spSearchAC->Init(GetDlgItem(m_hwnd, IDC_EDIT_SEARCHFOR), m_spSearchACL, nullptr, nullptr);
if (SUCCEEDED(hr))
{
hr = m_spSearchAC->SetOptions(ACO_AUTOSUGGEST | ACO_AUTOAPPEND | ACO_UPDOWNKEYDROPSLIST);
}
}
}
if (SUCCEEDED(hr))
{
hr = CoCreateInstance(CLSID_AutoComplete, NULL, CLSCTX_INPROC, IID_PPV_ARGS(&m_spReplaceAC));
if (SUCCEEDED(hr))
{
hr = CRenameMRUReplace_CreateInstance(&m_spReplaceACL);
if (SUCCEEDED(hr))
{
hr = m_spReplaceAC->Init(GetDlgItem(m_hwnd, IDC_EDIT_REPLACEWITH), m_spReplaceACL, nullptr, nullptr);
if (SUCCEEDED(hr))
{
hr = m_spReplaceAC->SetOptions(ACO_AUTOSUGGEST | ACO_AUTOAPPEND | ACO_UPDOWNKEYDROPSLIST);
}
}
}
}
}
return hr;
}
void CSmartRenameUI::_Cleanup()
{
if (m_spsrm && m_cookie != 0)
{
m_spsrm->UnAdvise(m_cookie);
m_cookie = 0;
m_spsrm = nullptr;
}
m_spdo = nullptr;
m_spdth = nullptr;
if (m_enableDragDrop)
{
RevokeDragDrop(m_hwnd);
}
}
void CSmartRenameUI::_EnumerateItems(_In_ IDataObject* pdtobj)
{
// Enumerate the data object and popuplate the manager
if (m_spsrm)
{
m_disableCountUpdate = true;
EnumerateDataObject(pdtobj, m_spsrm);
m_disableCountUpdate = false;
UINT itemCount = 0;
m_spsrm->GetItemCount(&itemCount);
m_listview.SetItemCount(itemCount);
_UpdateCounts();
}
}
HRESULT CSmartRenameUI::_ReadSettings()
{
// Check if we should read flags from settings
// or the defaults from the manager.
DWORD flags = 0;
if (CSettings::GetPersistState())
{
flags = CSettings::GetFlags();
m_spsrm->put_flags(flags);
wchar_t buffer[MAX_INPUT_STRING_LEN];
buffer[0] = L'\0';
CSettings::GetSearchText(buffer, ARRAYSIZE(buffer));
SetDlgItemText(m_hwnd, IDC_EDIT_SEARCHFOR, buffer);
buffer[0] = L'\0';
CSettings::GetReplaceText(buffer, ARRAYSIZE(buffer));
SetDlgItemText(m_hwnd, IDC_EDIT_REPLACEWITH, buffer);
}
else
{
m_spsrm->get_flags(&flags);
}
_SetCheckboxesFromFlags(flags);
return S_OK;
}
HRESULT CSmartRenameUI::_WriteSettings()
{
// Check if we should store our settings
if (CSettings::GetPersistState())
{
DWORD flags = 0;
m_spsrm->get_flags(&flags);
CSettings::SetFlags(flags);
wchar_t buffer[MAX_INPUT_STRING_LEN];
buffer[0] = L'\0';
GetDlgItemText(m_hwnd, IDC_EDIT_SEARCHFOR, buffer, ARRAYSIZE(buffer));
CSettings::SetSearchText(buffer);
if (CSettings::GetMRUEnabled() && m_spSearchACL)
{
CComPtr<ISmartRenameMRU> spSearchMRU;
if (SUCCEEDED(m_spSearchACL->QueryInterface(IID_PPV_ARGS(&spSearchMRU))))
{
spSearchMRU->AddMRUString(buffer);
}
}
buffer[0] = L'\0';
GetDlgItemText(m_hwnd, IDC_EDIT_REPLACEWITH, buffer, ARRAYSIZE(buffer));
CSettings::SetReplaceText(buffer);
if (CSettings::GetMRUEnabled() && m_spReplaceACL)
{
CComPtr<ISmartRenameMRU> spReplaceMRU;
if (SUCCEEDED(m_spReplaceACL->QueryInterface(IID_PPV_ARGS(&spReplaceMRU))))
{
spReplaceMRU->AddMRUString(buffer);
}
}
}
return S_OK;
}
void CSmartRenameUI::_OnCloseDlg()
{
if (m_modeless)
{
DestroyWindow(m_hwnd);
}
else
{
EndDialog(m_hwnd, 1);
}
}
void CSmartRenameUI::_OnDestroyDlg()
{
_Cleanup();
if (m_modeless)
{
PostQuitMessage(0);
}
}
void CSmartRenameUI::_OnRename()
{
if (m_spsrm)
{
m_spsrm->Rename(m_hwnd);
}
// Persist the current settings. We only do this when
// a rename is actually performed. Not when the user
// closes/cancels the dialog.
_WriteSettings();
}
void CSmartRenameUI::_OnAbout()
{
// Launch github page
SHELLEXECUTEINFO info = {0};
info.cbSize = sizeof(SHELLEXECUTEINFO);
info.lpVerb = L"open";
info.lpFile = L"http://www.github.com/chrdavis";
info.nShow = SW_SHOWDEFAULT;
ShellExecuteEx(&info);
}
HRESULT CSmartRenameUI::_DoModal(__in_opt HWND hwnd)
{
m_modeless = false;
HRESULT hr = S_OK;
INT_PTR ret = DialogBoxParam(g_hInst, MAKEINTRESOURCE(IDD_MAIN), hwnd, s_DlgProc, (LPARAM)this);
if (ret < 0)
{
hr = HRESULT_FROM_WIN32(GetLastError());
}
return hr;
}
HRESULT CSmartRenameUI::_DoModeless(__in_opt HWND hwnd)
{
m_modeless = true;
HRESULT hr = S_OK;
if (NULL != CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_MAIN), hwnd, s_DlgProc, (LPARAM)this))
{
ShowWindow(m_hwnd, SW_SHOWNORMAL);
MSG msg;
while (GetMessage(&msg, NULL, 0, 0))
{
if (!IsDialogMessage(m_hwnd, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
DestroyWindow(m_hwnd);
m_hwnd = NULL;
}
else
{
hr = HRESULT_FROM_WIN32(GetLastError());
}
return hr;
}
INT_PTR CSmartRenameUI::_DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
INT_PTR bRet = TRUE; // default for all handled cases in switch below
switch (uMsg)
{
case WM_INITDIALOG:
_OnInitDlg();
break;
case WM_COMMAND:
_OnCommand(wParam, lParam);
break;
case WM_NOTIFY:
bRet = _OnNotify(wParam, lParam);
break;
case WM_THEMECHANGED:
_OnSize(SIZE_RESTORED);
break;
case WM_SIZE:
_OnSize(wParam);
break;
case WM_GETMINMAXINFO:
_OnGetMinMaxInfo(lParam);
break;
case WM_CLOSE:
_OnCloseDlg();
break;
case WM_DESTROY:
_OnDestroyDlg();
break;
default:
bRet = FALSE;
}
return bRet;
}
void CSmartRenameUI::_OnInitDlg()
{
m_hwndLV = GetDlgItem(m_hwnd, IDC_LIST_PREVIEW);
m_listview.Init(m_hwndLV);
if (m_spdo)
{
// Populate the manager from the data object
_EnumerateItems(m_spdo);
}
// Initialize from stored settings
_ReadSettings();
// Load the main icon
LoadIconWithScaleDown(g_hInst, MAKEINTRESOURCE(IDI_RENAME), 32, 32, &m_iconMain);
// Update the icon associated with our main app window
SendMessage(m_hwnd, WM_SETICON, (WPARAM)ICON_SMALL, (LPARAM)m_iconMain);
SendMessage(m_hwnd, WM_SETICON, (WPARAM)ICON_BIG, (LPARAM)m_iconMain);
// TODO: put this behind a setting?
if (m_enableDragDrop)
{
RegisterDragDrop(m_hwnd, this);
}
RECT rc = { 0 };
GetWindowRect(m_hwnd, &rc);
m_initialWidth = RECT_WIDTH(rc);
m_initialHeight = RECT_HEIGHT(rc);
m_lastWidth = m_initialWidth;
m_lastHeight = m_initialHeight;
_InitAutoComplete();
// Disable rename button by default. It will be enabled in _UpdateCounts if
// there are tiems to be renamed
EnableWindow(GetDlgItem(m_hwnd, ID_RENAME), FALSE);
// Update UI elements that depend on number of items selected or to be renamed
_UpdateCounts();
m_initialized = true;
}
void CSmartRenameUI::_OnCommand(_In_ WPARAM wParam, _In_ LPARAM lParam)
{
switch (LOWORD(wParam))
{
case IDOK:
case IDCANCEL:
_OnCloseDlg();
break;
case ID_RENAME:
_OnRename();
break;
case ID_ABOUT:
_OnAbout();
break;
case IDC_EDIT_REPLACEWITH:
case IDC_EDIT_SEARCHFOR:
if (GET_WM_COMMAND_CMD(wParam, lParam) == EN_CHANGE)
{
_OnSearchReplaceChanged();
}
break;
case IDC_CHECK_CASESENSITIVE:
case IDC_CHECK_ENUMITEMS:
case IDC_CHECK_EXCLUDEFILES:
case IDC_CHECK_EXCLUDEFOLDERS:
case IDC_CHECK_EXCLUDESUBFOLDERS:
case IDC_CHECK_MATCHALLOCCURRENCES:
case IDC_CHECK_USEREGEX:
case IDC_CHECK_EXTENSIONONLY:
case IDC_CHECK_NAMEONLY:
if (BN_CLICKED == HIWORD(wParam))
{
_ValidateFlagCheckbox(LOWORD(wParam));
_GetFlagsFromCheckboxes();
}
break;
}
}
BOOL CSmartRenameUI::_OnNotify(_In_ WPARAM wParam, _In_ LPARAM lParam)
{
bool ret = FALSE;
LPNMHDR pnmdr = (LPNMHDR)lParam;
LPNMLISTVIEW pnmlv = (LPNMLISTVIEW)pnmdr;
NMLVEMPTYMARKUP* pnmMarkup = NULL;
if (pnmdr)
{
BOOL checked = FALSE;
switch (pnmdr->code)
{
case HDN_ITEMSTATEICONCLICK:
if (m_spsrm)
{
m_listview.ToggleAll(m_spsrm, (!(((LPNMHEADER)lParam)->pitem->fmt & HDF_CHECKED)));
_UpdateCounts();
}
break;
case LVN_GETEMPTYMARKUP:
pnmMarkup = (NMLVEMPTYMARKUP*)lParam;
pnmMarkup->dwFlags = EMF_CENTERED;
LoadString(g_hInst, IDS_LISTVIEW_EMPTY, pnmMarkup->szMarkup, ARRAYSIZE(pnmMarkup->szMarkup));
ret = TRUE;
break;
case LVN_BEGINLABELEDIT:
ret = TRUE;
break;
case LVN_KEYDOWN:
if (m_spsrm)
{
m_listview.OnKeyDown(m_spsrm, (LV_KEYDOWN*)pnmdr);
_UpdateCounts();
}
break;
case LVN_GETDISPINFO:
if (m_spsrm)
{
m_listview.GetDisplayInfo(m_spsrm, (LV_DISPINFO*)pnmlv);
}
break;
case NM_CLICK:
{
if (m_spsrm)
{
m_listview.OnClickList(m_spsrm, (NM_LISTVIEW*)pnmdr);
_UpdateCounts();
}
break;
}
}
}
return ret;
}
void CSmartRenameUI::_OnGetMinMaxInfo(_In_ LPARAM lParam)
{
if (m_initialWidth)
{
// Prevent resizing the dialog less than the original size
MINMAXINFO* pMinMaxInfo = reinterpret_cast<MINMAXINFO*>(lParam);
pMinMaxInfo->ptMinTrackSize.x = m_initialWidth;
pMinMaxInfo->ptMinTrackSize.y = m_initialHeight;
}
}
void CSmartRenameUI::_OnSize(_In_ WPARAM wParam)
{
if ((wParam == SIZE_RESTORED || wParam == SIZE_MAXIMIZED) && m_initialWidth)
{
// Calculate window size change delta
RECT rc = { 0 };
GetWindowRect(m_hwnd, &rc);
const int xDelta = RECT_WIDTH(rc) - m_lastWidth;
m_lastWidth += xDelta;
const int yDelta = RECT_HEIGHT(rc) - m_lastHeight;
m_lastHeight += yDelta;
for (UINT u = 0; u < ARRAYSIZE(g_repositionMap); u++)
{
_MoveControl(g_repositionMap[u].id, g_repositionMap[u].flags, xDelta, yDelta);
}
m_listview.OnSize();
}
}
void CSmartRenameUI::_MoveControl(_In_ DWORD id, _In_ DWORD repositionFlags, _In_ int xDelta, _In_ int yDelta)
{
HWND hwnd = GetDlgItem(m_hwnd, id);
UINT flags = SWP_NOOWNERZORDER | SWP_NOZORDER | SWP_NOACTIVATE;
if (!((repositionFlags & Reposition_X) || (repositionFlags & Reposition_Y)))
{
flags |= SWP_NOMOVE;
}
if (!((repositionFlags & Reposition_Width) || (repositionFlags & Reposition_Height)))
{
flags |= SWP_NOSIZE;
}
RECT rcWindow = { 0 };
GetWindowRect(hwnd, &rcWindow);
int cx = RECT_WIDTH(rcWindow);
int cy = RECT_HEIGHT(rcWindow);
MapWindowPoints(HWND_DESKTOP, GetParent(hwnd), (LPPOINT)&rcWindow, 2);
int x = rcWindow.left;
int y = rcWindow.top;
if (repositionFlags & Reposition_X)
{
x += xDelta;
}
if (repositionFlags & Reposition_Y)
{
y += yDelta;
}
if (repositionFlags & Reposition_Width)
{
cx += xDelta;
}
if (repositionFlags & Reposition_Height)
{
cy += yDelta;
}
SetWindowPos(hwnd, NULL, x, y, cx, cy, flags);
RedrawWindow(hwnd, NULL, NULL, RDW_INVALIDATE);
}
void CSmartRenameUI::_OnSearchReplaceChanged()
{
// Pass updated search and replace terms to the ISmartRenameRegEx handler
CComPtr<ISmartRenameRegEx> spRegEx;
if (m_spsrm && SUCCEEDED(m_spsrm->get_renameRegEx(&spRegEx)))
{
wchar_t buffer[MAX_INPUT_STRING_LEN];
buffer[0] = L'\0';
GetDlgItemText(m_hwnd, IDC_EDIT_SEARCHFOR, buffer, ARRAYSIZE(buffer));
spRegEx->put_searchTerm(buffer);
buffer[0] = L'\0';
GetDlgItemText(m_hwnd, IDC_EDIT_REPLACEWITH, buffer, ARRAYSIZE(buffer));
spRegEx->put_replaceTerm(buffer);
}
}
DWORD CSmartRenameUI::_GetFlagsFromCheckboxes()
{
DWORD flags = 0;
for (int i = 0; i < ARRAYSIZE(g_flagCheckboxMap); i++)
{
if (Button_GetCheck(GetDlgItem(m_hwnd, g_flagCheckboxMap[i].id)) == BST_CHECKED)
{
flags |= g_flagCheckboxMap[i].flag;
}
}
// Ensure we update flags
if (m_spsrm)
{
m_spsrm->put_flags(flags);
}
return flags;
}
void CSmartRenameUI::_SetCheckboxesFromFlags(_In_ DWORD flags)
{
for (int i = 0; i < ARRAYSIZE(g_flagCheckboxMap); i++)
{
Button_SetCheck(GetDlgItem(m_hwnd, g_flagCheckboxMap[i].id), flags & g_flagCheckboxMap[i].flag);
}
}
void CSmartRenameUI::_ValidateFlagCheckbox(_In_ DWORD checkBoxId)
{
if (checkBoxId == IDC_CHECK_NAMEONLY)
{
if (Button_GetCheck(GetDlgItem(m_hwnd, IDC_CHECK_NAMEONLY)) == BST_CHECKED)
{
Button_SetCheck(GetDlgItem(m_hwnd, IDC_CHECK_EXTENSIONONLY), FALSE);
}
}
else if (checkBoxId == IDC_CHECK_EXTENSIONONLY)
{
if (Button_GetCheck(GetDlgItem(m_hwnd, IDC_CHECK_EXTENSIONONLY)) == BST_CHECKED)
{
Button_SetCheck(GetDlgItem(m_hwnd, IDC_CHECK_NAMEONLY), FALSE);
}
}
}
void CSmartRenameUI::_UpdateCounts()
{
// This method is CPU intensive. We disable it during certain operations
// for performance reasons.
if (m_disableCountUpdate)
{
return;
}
UINT selectedCount = 0;
UINT renamingCount = 0;
if (m_spsrm)
{
m_spsrm->GetSelectedItemCount(&selectedCount);
m_spsrm->GetRenameItemCount(&renamingCount);
}
if (m_selectedCount != selectedCount ||
m_renamingCount != renamingCount)
{
m_selectedCount = selectedCount;
m_renamingCount = renamingCount;
// Update selected and rename count label
wchar_t countsLabelFormat[100] = { 0 };
LoadString(g_hInst, IDS_COUNTSLABELFMT, countsLabelFormat, ARRAYSIZE(countsLabelFormat));
wchar_t countsLabel[100] = { 0 };
StringCchPrintf(countsLabel, ARRAYSIZE(countsLabel), countsLabelFormat, selectedCount, renamingCount);
SetDlgItemText(m_hwnd, IDC_STATUS_MESSAGE, countsLabel);
// Update Rename button state
EnableWindow(GetDlgItem(m_hwnd, ID_RENAME), (renamingCount > 0));
}
}
void CSmartRenameListView::Init(_In_ HWND hwndLV)
{
if (hwndLV)
{
m_hwndLV = hwndLV;
EnableWindow(m_hwndLV, TRUE);
// Set the standard styles
DWORD dwLVStyle = (DWORD)GetWindowLongPtr(m_hwndLV, GWL_STYLE);
dwLVStyle |= LVS_ALIGNLEFT | LVS_REPORT | LVS_SHAREIMAGELISTS | LVS_SINGLESEL;
SetWindowLongPtr(m_hwndLV, GWL_STYLE, dwLVStyle);
// Set the extended view styles
ListView_SetExtendedListViewStyle(m_hwndLV, LVS_EX_CHECKBOXES | LVS_EX_DOUBLEBUFFER | LVS_EX_AUTOSIZECOLUMNS);
// Get the system image lists. Our list view is setup to not destroy
// these since the image list belongs to the entire explorer process
HIMAGELIST himlLarge;
HIMAGELIST himlSmall;
if (Shell_GetImageLists(&himlLarge, &himlSmall))
{
ListView_SetImageList(m_hwndLV, himlSmall, LVSIL_SMALL);
ListView_SetImageList(m_hwndLV, himlLarge, LVSIL_NORMAL);
}
_UpdateColumns();
}
}
void CSmartRenameListView::ToggleAll(_In_ ISmartRenameManager* psrm, _In_ bool selected)
{
if (m_hwndLV)
{
UINT itemCount = 0;
psrm->GetItemCount(&itemCount);
for (UINT i = 0; i < itemCount; i++)
{
CComPtr<ISmartRenameItem> spItem;
if (SUCCEEDED(psrm->GetItemByIndex(i, &spItem)))
{
spItem->put_selected(selected);
}
}
RedrawItems(0, itemCount);
}
}
void CSmartRenameListView::ToggleItem(_In_ ISmartRenameManager* psrm, _In_ int item)
{
CComPtr<ISmartRenameItem> spItem;
if (SUCCEEDED(psrm->GetItemByIndex(item, &spItem)))
{
bool selected = false;
spItem->get_selected(&selected);
spItem->put_selected(!selected);
RedrawItems(item, item);
}
}
void CSmartRenameListView::OnKeyDown(_In_ ISmartRenameManager* psrm, _In_ LV_KEYDOWN* lvKeyDown)
{
if (lvKeyDown->wVKey == VK_SPACE)
{
int selectionMark = ListView_GetSelectionMark(m_hwndLV);
if (selectionMark != -1)
{
ToggleItem(psrm, selectionMark);
}
}
}
void CSmartRenameListView::OnClickList(_In_ ISmartRenameManager* psrm, NM_LISTVIEW* pnmListView)
{
LVHITTESTINFO hitinfo;
//Copy click point
hitinfo.pt = pnmListView->ptAction;
//Make the hit test...
int item = ListView_HitTest(m_hwndLV, &hitinfo);
if (item != -1)
{
if ((hitinfo.flags & LVHT_ONITEM) != 0)
{
ToggleItem(psrm, item);
}
}
}
void CSmartRenameListView::UpdateItemCheckState(_In_ ISmartRenameManager* psrm, _In_ int iItem)
{
if (psrm && m_hwndLV && (iItem > -1))
{
CComPtr<ISmartRenameItem> spItem;
if (SUCCEEDED(psrm->GetItemByIndex(iItem, &spItem)))
{
bool checked = ListView_GetCheckState(m_hwndLV, iItem);
spItem->put_selected(checked);
UINT uSelected = (checked) ? LVIS_SELECTED : 0;
ListView_SetItemState(m_hwndLV, iItem, uSelected, LVIS_SELECTED);
// Update the rename column if necessary
int id = 0;
spItem->get_id(&id);
RedrawItems(id, id);
}
// Get the total number of list items and compare it to what is selected
// We need to update the column checkbox if all items are selected or if
// not all of the items are selected.
bool checkHeader = (ListView_GetSelectedCount(m_hwndLV) == ListView_GetItemCount(m_hwndLV));
_UpdateHeaderCheckState(checkHeader);
}
}
#define COL_ORIGINAL_NAME 0
#define COL_NEW_NAME 1
void CSmartRenameListView::GetDisplayInfo(_In_ ISmartRenameManager* psrm, _Inout_ LV_DISPINFO* plvdi)
{
UINT count = 0;
psrm->GetItemCount(&count);
if (plvdi->item.iItem < 0 || plvdi->item.iItem > static_cast<int>(count))
{
// Invalid index
return;
}
CComPtr<ISmartRenameItem> renameItem;
if (SUCCEEDED(psrm->GetItemByIndex((int)plvdi->item.iItem, &renameItem)))
{
if (plvdi->item.mask & LVIF_IMAGE)
{
renameItem->get_iconIndex(&plvdi->item.iImage);
}
if (plvdi->item.mask & LVIF_STATE)
{
plvdi->item.stateMask = LVIS_STATEIMAGEMASK;
bool isSelected = false;
renameItem->get_selected(&isSelected);
if (isSelected)
{
// Turn check box on
plvdi->item.state = INDEXTOSTATEIMAGEMASK(2);
}
else
{
// Turn check box off
plvdi->item.state = INDEXTOSTATEIMAGEMASK(1);
}
}
if (plvdi->item.mask & LVIF_PARAM)
{
int id = 0;
renameItem->get_id(&id);
plvdi->item.lParam = static_cast<LPARAM>(id);
}
if (plvdi->item.mask & LVIF_INDENT)
{
UINT depth = 0;
renameItem->get_depth(&depth);
plvdi->item.iIndent = static_cast<int>(depth);
}
if (plvdi->item.mask & LVIF_TEXT)
{
PWSTR subItemText = nullptr;
if (plvdi->item.iSubItem == COL_ORIGINAL_NAME)
{
renameItem->get_originalName(&subItemText);
}
else if (plvdi->item.iSubItem == COL_NEW_NAME)
{
DWORD flags = 0;
psrm->get_flags(&flags);
bool shouldRename = false;
if (SUCCEEDED(renameItem->ShouldRenameItem(flags, &shouldRename)) && shouldRename)
{
renameItem->get_newName(&subItemText);
}
}
StringCchCopy(plvdi->item.pszText, plvdi->item.cchTextMax, subItemText ? subItemText : L"");
CoTaskMemFree(subItemText);
subItemText = nullptr;
}
}
}
void CSmartRenameListView::OnSize()
{
RECT rc = { 0 };
GetClientRect(m_hwndLV, &rc);
ListView_SetColumnWidth(m_hwndLV, 0, RECT_WIDTH(rc) / 2);
ListView_SetColumnWidth(m_hwndLV, 1, RECT_WIDTH(rc) / 2);
}
void CSmartRenameListView::RedrawItems(_In_ int first, _In_ int last)
{
ListView_RedrawItems(m_hwndLV, first, last);
}
void CSmartRenameListView::SetItemCount(_In_ UINT itemCount)
{
ListView_SetItemCount(m_hwndLV, itemCount);
}
void CSmartRenameListView::_UpdateColumns()
{
if (m_hwndLV)
{
// And the list view columns
int iInsertPoint = 0;
LV_COLUMN lvc = { 0 };
lvc.mask = LVCF_FMT | LVCF_ORDER | LVCF_WIDTH | LVCF_TEXT;
lvc.fmt = LVCFMT_LEFT;
lvc.iOrder = iInsertPoint;
wchar_t buffer[64] = { 0 };
LoadString(g_hInst, IDS_ORIGINAL, buffer, ARRAYSIZE(buffer));
lvc.pszText = buffer;
ListView_InsertColumn(m_hwndLV, iInsertPoint, &lvc);
iInsertPoint++;
lvc.iOrder = iInsertPoint;
LoadString(g_hInst, IDS_RENAMED, buffer, ARRAYSIZE(buffer));
lvc.pszText = buffer;
ListView_InsertColumn(m_hwndLV, iInsertPoint, &lvc);
// Get a handle to the header of the columns
HWND hwndHeader = ListView_GetHeader(m_hwndLV);
if (hwndHeader)
{
// Update the header style to allow checkboxes
DWORD dwHeaderStyle = (DWORD)GetWindowLongPtr(hwndHeader, GWL_STYLE);
dwHeaderStyle |= HDS_CHECKBOXES;
SetWindowLongPtr(hwndHeader, GWL_STYLE, dwHeaderStyle);
_UpdateHeaderCheckState(TRUE);
}
_UpdateColumnSizes();
}
}
void CSmartRenameListView::_UpdateColumnSizes()
{
if (m_hwndLV)
{
RECT rc;
GetClientRect(m_hwndLV, &rc);
ListView_SetColumnWidth(m_hwndLV, 0, (rc.right - rc.left) / 2);
ListView_SetColumnWidth(m_hwndLV, 1, (rc.right - rc.left) / 2);
}
}
void CSmartRenameListView::_UpdateHeaderCheckState(_In_ bool check)
{
// Get a handle to the header of the columns
HWND hwndHeader = ListView_GetHeader(m_hwndLV);
if (hwndHeader)
{
wchar_t buffer[MAX_PATH] = { 0 };
// Retrieve the existing header first so we
// don't trash the text already there
HDITEM hdi = { 0 };
hdi.mask = HDI_FORMAT | HDI_TEXT;
hdi.pszText = buffer;
hdi.cchTextMax = ARRAYSIZE(buffer);
Header_GetItem(hwndHeader, 0, &hdi);
// Set the first column to contain a checkbox
hdi.fmt |= HDF_CHECKBOX;
hdi.fmt |= (check) ? HDF_CHECKED : 0;
Header_SetItem(hwndHeader, 0, &hdi);
}
}
|
{
"pile_set_name": "Github"
}
|
Q:
python kivy add text inside rectangle
How can I add text inside a rectangle? I am using the code below and added a label inside the canvas hoping that it will display inside the rectangle.
import kivy
from kivy.app import App
from kivy.uix.anchorlayout import AnchorLayout
from kivy.uix.gridlayout import GridLayout
from kivy.uix.label import Label
from kivy.uix.video import Video
from kivy.uix.relativelayout import RelativeLayout
from kivy.graphics import *
class MyApp(App):
def build(self):
r = AnchorLayout()
f = RelativeLayout()
g = GridLayout(cols=3, rows=5)
v = Video(source='driver.mp4', state='play', options={'eos':'loop'})
l1 = Label(text="jenkins", font_size=32)
l2 = Label(text="git", font_size=32)
f.add_widget(v)
f.add_widget(g)
g.add_widget(l1)
g.add_widget(l2)
with g.canvas:
Color(.4, .1, .1)
Rectangle(pos=(100,10), size=(100,100))
Label(text="KSHK")
return f
if __name__ == "__main__":
MyApp().run()
update:
this does not align the text in the center of ColoredLabel
import kivy
from kivy.app import App
from kivy.uix.anchorlayout import AnchorLayout
from kivy.uix.gridlayout import GridLayout
from kivy.uix.label import Label
from kivy.uix.video import Video
from kivy.uix.relativelayout import RelativeLayout
from kivy.graphics import *
from kivy.lang import Builder
from kivy.uix.boxlayout import BoxLayout
from random import random
from kivy.properties import ListProperty
kv = '''
<ColoredLabel>:
background_color:
canvas.before:
Color:
rgba: self.background_color
Rectangle:
pos: (10,10)
size: (100,100)
'''
Builder.load_string(kv)
class ColoredLabel(Label):
background_color = ListProperty((0,0,0,1))
class MyApp(App):
def build(self):
f = AnchorLayout()
g = GridLayout(cols=2, rows=2)
layout = BoxLayout(size_hint=(1, None), height=50)
v = Video(source='driver.mp4', state='play', options={'eos':'loop'})
l1 = Label(text="jenkins", font_size=32)
l2 = Label(text="git", font_size=32)
f.add_widget(v)
label = ColoredLabel(text="Hello World!", background_color=(random(), random(), random(), 1))
g.add_widget(label)
f.add_widget(g)
return f
if __name__ == "__main__":
MyApp().run()
A:
Use Label with custom background color then place it inside your layout. For example:
from kivy.uix.label import Label
from kivy.uix.boxlayout import BoxLayout
from kivy.properties import ListProperty
from kivy.app import App
from kivy.lang import Builder
from random import random
kv = '''
<ColoredLabel>:
background_color:
canvas.before:
Color:
rgba: self.background_color
Rectangle:
pos: self.pos
size: self.size
'''
Builder.load_string(kv)
class ColoredLabel(Label):
background_color = ListProperty((0, 0, 0, 1))
class TestApp(App):
def build(self):
layout = BoxLayout(size_hint=(1, None), height=50)
for label in ('a', 'b', 'c', 'd'):
label = ColoredLabel(text=label, background_color=(random(), random(), random(), 1))
layout.add_widget(label)
return layout
if __name__ == '__main__':
TestApp().run()
update
Fixing issue from OP:
import kivy
from kivy.app import App
from kivy.uix.anchorlayout import AnchorLayout
from kivy.uix.gridlayout import GridLayout
from kivy.uix.label import Label
from kivy.uix.video import Video
from kivy.uix.relativelayout import RelativeLayout
from kivy.graphics import *
from kivy.lang import Builder
from kivy.uix.boxlayout import BoxLayout
from random import random
from kivy.properties import ListProperty
kv = '''
<ColoredLabel>:
size: (100,100)
pos: (10,10) # no effect
background_color:
canvas.before:
Color:
rgba: self.background_color
Rectangle:
pos: self.pos
size: self.size
'''
Builder.load_string(kv)
class ColoredLabel(Label):
background_color = ListProperty((0,0,0,1))
class MyApp(App):
def build(self):
f = AnchorLayout()
g = GridLayout(cols=2, rows=2)
layout = BoxLayout(size_hint=(1, None), height=50)
# v = Video(source='driver.mp4', state='play', options={'eos':'loop'})
l1 = Label(text="jenkins", font_size=32)
l2 = Label(text="git", font_size=32)
# f.add_widget(v)
label = ColoredLabel(text="Hello World!", size_hint=(None, None), background_color=(random(), random(), random(), 1))
g.add_widget(label)
f.add_widget(g)
return f
if __name__ == "__main__":
MyApp().run()
Notice that Rectange of ColoredLabel needs to have pos: self.pos and size: self.size to draw in place where the label actually is. That's why I changed size of Label itself in the level above. Canvas size is binded to it. As for position, it's controlled by the Layout in which ColoredLabel is placed, so changing it from ColoredLabel class doesn't change much. Compare it with FloatLayout:
import kivy
from kivy.app import App
from kivy.uix.anchorlayout import AnchorLayout
from kivy.uix.gridlayout import GridLayout
from kivy.uix.label import Label
from kivy.uix.video import Video
from kivy.uix.relativelayout import RelativeLayout
from kivy.graphics import *
from kivy.lang import Builder
from kivy.uix.boxlayout import BoxLayout
from random import random
from kivy.properties import ListProperty
from kivy.uix.floatlayout import FloatLayout
kv = '''
<ColoredLabel>:
size: (150, 200)
pos: (50, 150)
background_color:
canvas.before:
Color:
rgba: self.background_color
Rectangle:
pos: self.pos
size: self.size
'''
Builder.load_string(kv)
class ColoredLabel(Label):
background_color = ListProperty((0,0,0,1))
class MyApp(App):
def build(self):
f = FloatLayout()
label = ColoredLabel(text="Hello World!", size_hint=(None, None), background_color=(random(), random(), random(), 1))
f.add_widget(label)
return f
if __name__ == "__main__":
MyApp().run()
In this case changing pos inside of ColoredLabel actually has an effect.
|
{
"pile_set_name": "StackExchange"
}
|
タレントの ローラ がインスタグラムで披露した手料理の写真が、物議を醸している。ローラは18日にインスタグラムを更新し、「昨日はロスのお友達をご招待して、日本食を作ったよ! みんな、豚汁や肉じゃがなど食べたことがなくて、すごくよろこんでた」「なんだか、うれしかったぁ。和食はいいなぁ」とコメントし、広いテーブルに並べられた手料理の写真を披露。豚汁や、肉じゃがのほか、唐揚げや、いなり寿司などが写真に収められていた。この投稿にファンからは、「すごいおいしそう!」「和食の手料理でおもてなしなんて素敵」といった声が集まっていたものの、「ヴィーガンだと思っていました…」「ローラちゃんは嗜好品のために動物を苦しめたりしないって思ってました」「ヴィーガンじゃなかったの?」といった指摘も寄せられている。「実は、先月あたりからインスタグラムのストーリーズの中で、ヴィーガンのための食事を作ったり、ヴィーガン用のスナックを食べている自身の写真をアップしていたローラ。また、『仮に肉類と乳製品の使用を全てやめれば、世界の75%以上の農場が不要になる』などヴィーガンのメリットを説明しつつ、『少しずつ試してみよう!』と呼びかけていました。このことから、ローラがヴィーガンに転向したと感じていたファンも多く、嘆く声が寄せられてしまったようです」(芸能ライター)また、ネット上からも「今日はたまたまヴィーガンの日やなかったのかな?」「ヴィーガンは素晴らしいと言っただけで自分がヴィーガンになるとは言ってない叙述トリック」など揶揄する声も寄せられている。ローラの呼びかけでヴィーガンになったファンは、今回のローラの行動に困惑してしまったようだ。記事内の引用についてローラ公式インスタグラムより https://www.instagram.com/rolaofficial
|
{
"pile_set_name": "OpenWebText2"
}
|
// Copyright (C) 2019 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: Computed values as accessor property names (string literal 'default')
template: default
info: |
12.2.6.7 Runtime Semantics: Evaluation
[...]
ComputedPropertyName : [ AssignmentExpression ]
1. Let exprValue be the result of evaluating AssignmentExpression.
2. Let propName be ? GetValue(exprValue).
3. Return ? ToPropertyKey(propName).
---*/
//- declareWith
'default'
//- referenceWith
'default'
|
{
"pile_set_name": "Github"
}
|
It’s been a rough recovery for American labor. In the aftermath of the 2007 financial meltdown and the deep recession that followed it, unions have bled more than 1.3 million members. Sharp declines in construction, manufacturing, and transportation jobs have battered private labor; tax shortfalls and high costs have led state and local governments to pare budgets, and hence public-union jobs. Meantime, unions face growing public resentment. Four states in recent years have adopted right-to-work policies, which let workers opt out of joining unions. Polls show that the public is increasingly questioning the efforts of labor groups and the economic toll they impose. Government unions may have dodged a bullet in late March, when an evenly divided Supreme Court refused to overturn state laws that allow obligatory worker fees, but unions have recently lost other key court cases, undermining their ability to organize.
The Great Recession and the underwhelming Obama recovery have, in other words, reshaped the map of labor in the United States. Private unions began to rally somewhat in 2012 but thus far have regained only 42 percent of the members they lost. A disproportionate share of that rebound, moreover, has occurred in right-to-work states—not because these states are welcoming labor environments but because they’ve done better economically than union-friendly states. Public unions have yet to boost their rolls, six years after the recession ended. It was commonly observed, after 2009, that government unions had grown larger in membership than private ones—but this advantage proved short-lived. Three years ago, private unions regained their old lead.
Unions typically lose members in recessions. But years into an economic recovery, the striking decline in government-union membership and the limited recovery of private unions bode poorly for the labor movement. And with America perhaps facing another economic slowdown, things could soon get worse for unions.
America lost about 8.7 million private-sector jobs by the nadir of the economic downturn that began in late 2007 and continued until mid-2009. Private-sector union membership began dropping in late 2007, too, but it kept on falling for another two years after the recession ended. By the time membership started rising again, in 2012, private unions had shed 15 percent of their membership, or 1.2 million people. Since then, though the nation has regained all the jobs lost in the recession and added 5 million more, private labor unions remain 700,000 members short of their 2008 enrollment, according to unionstats.com.
The unions’ most significant shrinkage has come in strong labor states. Of the 28 states at the start of the recession deemed union-friendly—that is, they had laws that compelled workers in unionized businesses to pay dues or fees to the union—all but six have fewer private-sector labor jobs today than they did in 2008. California has led the negative trend, with a staggering 181,305-member decline in private unions as of the end of 2015. New Jersey’s private-union rolls have fallen 79,840, Pennsylvania’s have slumped 71,801, and Illinois’s are down 69,614. The massive losses in these states more than offset labor’s one bright spot: 141,000 new union jobs in New York. In total, the compulsory-unionization states have accounted for approximately 675,000 of lost private-sector union jobs. True, three of these states have recently turned right-to-work, ending mandatory union dues, but two—Indiana and Michigan—sustained all their private-union losses while labor-friendly laws remained in place. Only in Wisconsin did union losses pile up after right-to-work went into effect, which happened last year. Private-unionization rates in pro-labor states plummeted. In Missouri, for example, unionization has fallen from 9.3 percent of private workers to 6.6 percent since 2008, while in California it dropped from 10.7 percent to 8.7 percent.
States with laws less friendly to unions, ironically, have been better for union jobs. Thirteen of the 22 states that were right-to-work in 2008 have more private-union jobs today. The biggest gainers include Florida (up 81,174), Texas (31,456), Virginia (16,313), and Louisiana (13,070). Most of these states have low levels of union penetration, however, and the gains have altered that fact only slightly. In Texas, just 2.5 percent of private-sector workers are unionized, the same level as in 2008, all the new jobs notwithstanding. Nebraska, Mississippi, and Georgia saw their unionization rates climb just 0.03 percentage points or less since 2008, despite union membership increases in each state; labor groups still enroll less than 5 percent of private workers in the three states. The unionization rate in Florida did rise by a full percentage point, but even with that rise, only 3.3 percent of the state’s private workforce belongs to unions, well below the national average of 6.7 percent.
Some of the recent rebound in private-union employment in right-to-work states owes to job growth. States that began 2008 with right-to-work laws have 41 percent of America’s population but have generated 60 percent of the nation’s new private-sector employment above the prerecession employment peak. And right-to-work states have added more blue-collar work, while the jobs being added in union-friendly states have largely been in industries not heavily unionized, like high technology in California. Since 2010, when manufacturing job losses bottomed out, the sector has regained 821,000 of the 2.3 million jobs lost during the downturn, according to the Bureau of Labor Statistics; nearly seven in ten of those positions have been in right-to-work states, including Florida, Georgia, and Texas. One consequence is that manufacturing unions in these states have rebuilt their memberships more successfully than their counterparts in compulsory-unionization states.
In the face of this evidence, labor unions have nonetheless blamed antiunion forces for their misfortune. “We recognize . . . that right-wing billionaires’ extremist policies, a rapacious Wall Street and insufficient advocacy from political leaders thwarted further progress,” AFL-CIO president Richard Trumka said in early 2015 about the slow recovery of union rolls. The union’s membership, which had peaked at 13.7 million in 2005, was 12.5 million at the end of last year.
To speak of any recovery of private-union membership is somewhat misleading, since nongovernment labor positions created over the last few years are mostly in industries that didn’t lose employment during the recession—indeed, in industries not traditionally associated with labor. Health care, professional and technical services, and real-estate leasing and services have all seen expansion in unionized jobs and, with the exception of health care, an increase in the percentage of workers unionized, too, though from single-digit levels. These industries typically share two characteristics that help unions. First, they involve service work that isn’t easily outsourced overseas. Second, in many instances, the work is connected to government, either through direct funding or through heavy regulation, which makes employers more likely to cooperate with unionization efforts, so as to build lobbying alliances for favorable government treatment.
Organizing campaigns for health-care workers in California illustrate how this process works. In 2003, the Service Employees International Union (SEIU) launched a drive to unionize private nursing homes, many of which had patients with bills that state Medicaid programs were paying. The union made a pact with the owners of 42 nursing homes, telling them that it would push the state legislature for more funding if the owners didn’t try to block their unionization drive. The SEIU won thousands of new members, and the alliance subsequently gained $2 billion in extra Medicaid reimbursements for nursing homes over a two-year period.
Health-care unions have also turned to friendly politicians to help boost enrollment. In several states, Democratic governors have signed executive orders designating government-paid, home health-care workers as state workers, not independent contractors, as they’d previously been categorized. This allows unions to organize those workers into bargaining units, which isn’t possible with independent contractors. In Illinois, for example, Governors Rod Blagojevich and Pat Quinn enacted a series of such orders, resulting in the local SEIU unit signing up roughly 24,000 home health-care-worker members. The organizing drive and election proved controversial, however; many of the workers later said that they knew nothing about these efforts. Home health care has been among the fastest-growing areas of unionization, with 111,000 workers now in unions around the country—a 44 percent increase since 2008.
But labor’s new strategy may be only so effective. In June 2014, the Supreme Court overturned the Illinois directives after several workers sued the state, arguing that they weren’t really state employees—because they were hired and fired by those they worked for, not by Illinois. Since the Court’s decision, the Washington Times has reported, at least 8,000 dues-paying Illinois home health-care workers have left the union.
Unions that represent grocery stores have lost 103,000 workers, a decline of 20 percent, since 2008.
Other major organizing campaigns have also faltered in the post-2008 recovery. Over the last several years, unions have targeted fast-food workers with a highly visible “Fast Food Forward” drive, featuring rallies and sporadic strikes. The campaign’s impact has been nominal, at best. Though union rolls in restaurants rose by 13 percent, or 15,000 members, since 2008, that’s a small chunk of the more than 600,000 new jobs generated by fast-food and other limited-service restaurants over that period. Fast food’s unionization rate, meantime, remains a mere 1.6 percent. So far, the campaign’s failure mirrors unions’ other recent flubs—most notably, the ten-year-plus push to organize Wal-Mart and other discount stores, which has yielded few victories.
Indeed, retailing unions, which 30 years ago claimed some 1.25 million organized workers, have yet to regain the jobs lost from the latest downturn. Unions now count only slightly more than 750,000 retail members. More worrying still for labor, retailing’s most unionized sector—supermarkets and grocery stores—continues to shed members rapidly. Unions that represent grocery stores have lost 103,000 workers, a decline of 20 percent, since 2008; the unionization rate shrank to 15.5 percent from 20.6 percent, as the spread of nonunionized food stores—from high-end Whole Foods, which has vigorously resisted organizing efforts, to Wal-Mart super-grocery centers—has eaten into the business of unionized chains.
Trumka is right about one thing: unions haven’t won many friends in recent years. Since 2012, four states—Indiana, Michigan, Wisconsin, and, most recently, West Virginia—have adopted right-to-work laws. The surge began when Indiana governor Mitch Daniels, in the last year of his second term, responded to pressure from members of the Republican-controlled state legislature to sign a right-to-work bill. Daniels had shown little interest in passing such a law during most of his tenure, but he has admitted that it sparked renewed business interest in the state: “I may have underestimated the impact,” Daniels said. “We have had a flood of calls and inquiries, starting literally the day I signed the bill.” Michigan quickly followed suit, and then Wisconsin in 2015. In early 2016, West Virginia’s Republican-controlled legislature passed a right-to-work law over Governor Earl Ray Tomblin’s veto.
In general, employees’ freedom in right-to-work states to opt out of union membership restrains labor’s growth; right-to-work states have, on average, only about a 4 percent rate of unionization in the private sector, compared with 9 percent in compulsory-unionization states. The rapid addition of new right-to-work states since 2012—it had taken a half-century for the previous group of four states (Wyoming, Louisiana, Idaho, and Oklahoma) to adopt the policy—reflects changing attitudes toward unions. A 2014 Gallup poll found that 53 percent of Americans approved of unions—down from about 70 percent in the late 1960s. More significantly, 71 percent also supported giving workers a choice of whether to join a union, something that unions themselves fight against vigorously. “Americans . . . are clearly less supportive of labor unions, and somewhat more supportive of right-to-work laws, than in the past,” Gallup’s Jeffrey Jones said.
Union members might also begin wondering whether labor leaders are their own worst enemies. One of the movement’s biggest campaigns these days, for instance, is to get states and the federal government to hike up the minimum wage. Successful efforts in 12 states in 2014 and 2015 are raising rates—in some cases, dramatically. California and New York enacted laws that will eventually move their minimum wages to $15 an hour. Unions argue that a higher minimum wage helps lift workers out of poverty, but research shows that it also destroys jobs or drives them to less expensive environments. Writing recently in the Wall Street Journal, the chief executive officer of CKE Restaurants, Andy Puzder, described growing automation in his business and attributed it to the rising price of employing workers: “Dramatic increases in labor costs have a significant effect on the restaurant industry, where profit margins are pennies on the dollar and labor makes up about a third of total expenses,” he explained. Shortly after California governor Jerry Brown signed the state’s latest minimum-wage boost, Los Angeles–based American Apparel said that it might relocate 500 jobs—not overseas but to another state. Apparel manufacturing has lost 71,000 jobs in California in the last 25 years, a 60 percent decline, and American Apparel was one of the few major employers still in the state.
And from the looks of things, union jobs are particularly at risk. The 28 states that since 2008 have raised their minimum wages faster than the federal wage floor increased have borne the vast majority of private-union job losses—560,000 in total. That’s more than three times the losses in states where the minimum wage rose merely at the federal rate, a boost of 70 cents per hour over that time period.
As tough as the post-2008 period has been for private unions, their public-sector counterparts have had it even worse. State and local budgets have remained under intense pressure since the recession, as tax revenues have grown only haltingly and government costs—especially employee costs—have risen fast, producing a near-continuous squeeze on finances. In response, state and local governments have slashed about 700,000 jobs. Unionized government workers bore the brunt of cuts, with membership down about 660,000 workers, or 8 percent, since 2008.
Most of the lost jobs were municipal—that is, held by workers employed by towns, counties, cities, and school districts. That’s not surprising: local government budgets are largely made up of employee costs. The typical school district budget, for instance, is composed of 80 percent personnel costs, leaving administrators few alternatives but to lay off workers during major fiscal nosedives. As in the private sector, labor-friendly states have taken some of the biggest losses in government-union rolls. Just eight states, led by New York—with the highest rate of public unionization in the country—and including California, Ohio, Washington, Massachusetts, New Jersey, Pennsylvania, and Illinois have accounted for nearly 427,000 lost government-union jobs, 66 percent of the total national reduction in the public sector. Just six of the 24 compulsory-unionization states have more government-union jobs today than in 2008.
Public-sector unions have also taken significant hits in two states that have adopted right-to-work rules during the last five years—Wisconsin and Michigan. Wisconsin passed a law in 2011 eliminating mandatory fees for government workers who don’t want to belong to a union and narrowing collective bargaining for many government workers. Unions have subsequently lost nearly 74,000 members in Wisconsin, where previously nearly half of all government workers were unionized. Michigan saw a drop of about 25,000 government-union jobs after the state adopted a right-to-work law in 2012.
Some of the nation’s most politically muscular labor organizations haven’t escaped these trends. The National Education Association, America’s largest labor group, has seen its membership fall by 282,000 since its 2009 high, according to the Department of Labor. Education Intelligence Agency (EIA), a blog that closely follows teachers’ unions, has counted 22 state NEA affiliates with fewer members today than they had 20 years ago. Meanwhile, 17 state teachers’-union locals operated in the red during the 2014 school year, the latest for which data are available, EIA reports. The American Federation of State, County and Municipal Workers, which represents the largest number of noneducation public workers, has lost 196,000 members. Neither NEA nor AFSCME has avoided shrinking membership in any of the last five years.
The outlook going forward isn’t much more promising for government unions—especially because the country may be nearing another economic downturn after more than six years of expansion. If so, local governments are in the weakest position in decades to withstand such a storm. State and local collections of property, income, and sales taxes peaked before the downturn at $1.22 trillion, before falling off a cliff and then recovering only slowly. By the end of 2015, taxes brought in $1.33 trillion in revenue, which represents an average annual growth rate of just 1.25 percent since 2008. The skyrocketing price of benefits negotiated by workers has made it hard to reduce costs, even when governments have reduced their workforce. Rising pension bills are a key reason. Since the financial crisis, annual contributions by state and local governments, including schools, into underfunded pension systems have risen by about $47.8 billion, or 64 percent, to $121 billion, even as government payrolls have shrunk. And paying down retirement-related debts in some states will require years of higher contributions. Union-friendly states will face the greatest financial squeeze. A new study on government pension debt by the Stanford Institute for Economic Policy Research shows that nine of the ten states with the greatest unfunded pension liabilities are union-friendly environments, including Illinois, California, and New Jersey. At the same time, state tax collections have started to slow again, apparently because of a weakening economy. The Rockefeller Institute for Government predicts that tax revenues will likely deteriorate throughout 2016 and 2017.
Further, with budgets pressured, public opinion has turned against many government unions. Recent polling by Harvard’s Program on Education Policy and Governance, for instance, found that only 30 percent of those surveyed say that teachers’ unions have a positive impact on schools, while 39 percent view their influence as a negative. Some opponents have taken the case against unions into the courts. In 2012, the parents of nine California public schoolchildren filed a case arguing that the state’s teacher-tenure laws, which grant many teachers virtually permanent employment, regardless of their abilities, violated children’s right to receive an adequate education. A California superior court ruled for the plaintiffs in 2014, but an appeals court overturned that verdict. Now the state’s supreme court must weigh in. A ruling against the union threatens to upend the entire union-backed regime of teacher job security in the state, and could spark copycat suits elsewhere.
Government unions narrowly escaped a potentially far more damaging outcome in March, when the Supreme Court failed to overturn a nearly 40-year-old ruling that lets unions collect mandatory fees from workers. In Friedrichs v. California Teachers Association, ten teachers objecting to forced fees sued the California teachers’ union. All indications during Supreme Court oral arguments in January suggested that a majority of justices were sympathetic to the plaintiffs. But the untimely February death of originalist justice Antonin Scalia resulted in a 4-4 split in Friedrichs, protecting the fees—at least for now. The lawyers for the Friedrichs plaintiffs have refiled the case, however, and other workers unwillingly paying fees may sue on their own. “We can’t leave this issue for another time,” says Terry Pell, president of the Center for Individual Rights, the public-interest law firm that brought the case. “The Court has already agreed to decide this case and it should hold the case until it can issue a definitive decision.”
If Scalia’s eventual replacement (whoever that may be) sees the issue in the same way as the Court’s conservative judges, these kinds of fees may yet disappear. The sudden fleeing of workers from labor’s rolls in places like Wisconsin and Michigan after they ended compulsory unionization suggests what might then be in store for public unions. Such a scenario could make organized labor’s recent struggles seem mild by comparison.
Top Photo: Jim West/The Image Works
|
{
"pile_set_name": "OpenWebText2"
}
|
#include <sys/types.h>
#define KB ((off_t)1024)
#define MB ((off_t)1024 * KB)
#define GB ((off_t)1024 * MB)
#define TB ((off_t)1024 * GB)
int t2[(((64 * GB -1) % 671088649) == 268434537)
&& (((TB - (64 * GB -1) + 255) % 1792151290) == 305159546)? 1: -1];
int main()
{
;
return 0;
}
|
{
"pile_set_name": "Github"
}
|
I have a meeting at EECC which is scheduled from 1130-130, but there is a
risk it will run long. 300 would be better.
Thanks for setting this up.
Kay
From: Kathleen Carnahan 01/29/2001 08:02 AM
To: Kay Mann/Corp/Enron@Enron, Fred Mitro/HOU/ECT@ECT, Rusty
Stevens/Corp/Enron@ENRON
cc:
Subject: Meeting with Herman Manis
Herman can meet with us at 2:00 today in his office EB 3394. Please let me
know if this time isa okay with you and I will call him to confirm it.
Thanks.
Kathleen
|
{
"pile_set_name": "Enron Emails"
}
|
RIGA, April 6 (LETA) - The Latvian National Armed Forces observed movement of Russian naval ships in Latvia's exclusive economic zone in the Baltic Sea where Russia said it would be conducting missile tests but no missiles were fired.
Russia previously notified the Latvian authorities that the Russian Navy will be performing missile tests over Latvia's exclusive economic zone in the Baltic Sea from April 4 to 6.
The Latvian Defense Ministry spokesman, Kaspars Galkins, told LETA the no missiles had been fired in the given territory in Latvia's exclusive economic zone from April 4 till Friday evening.
"The Latvian naval ships have been patrolling the Baltic Sea since Russia announced the planned missile tests and are still patrolling now. We can confirm that we have observed movement of Russian ships in the Baltic Sea near Latvian borders but no shooting," he said.
It is possible that Russia had announced the missile tests with the intention of testing Latvia's response, Galkins said.
However, the Latvian Defense Ministry has no information about whether Russia had fired any missiles near Poland or Sweden, the spokesman said.
Russia has also failed to provide detailed information to Latvia about the weaponry to be used during the exercises and the safety arrangements, saying only that it was a scheduled exercise.
Responding to Russia's request, the Latvian Civil Aviation Agency (CAA) agreed to close part of Latvian airspace in an 18-kilometer altitude and 40 kilometers from Latvia's seacoast where the Russian Navy was planning to fire the missiles. CAA director Maris Gorodcovs said the closure of airspace was a standard procedure to be carried out after receiving respective information from the armed forces. However, no such activities have taken place in Latvia until now, he said.
The Latvian Defense Ministry said previously that, although international agreements do not prohibit Russia from holding such exercises in the given territory, such activities are provocative and can be regarded as a demonstration of force. Moreover, such missile tests can threaten traffic of civilian ships and aircraft in the area.
|
{
"pile_set_name": "OpenWebText2"
}
|
State of American Business" address Wednesday morning.
After eight years of a Democratic president who implemented, in the face of unprecedented levels of political opposition, a series of powerful industry regulations-from Obamacare and Dodd-Frank to the Clean Power Plan, the fiduciary rule, and a new overtime threshold-the GOP has secured full control of the federal government. And the Chamber of Commerce could not be more excited.
"We see a once-in-a-generation opportunity to enact major reforms that could transform the American economy from a low-growth to a high-growth economy," Donohue pronounced to a room packed full of business leaders.
Donohue pledged the chamber would pursue only those policies and reforms that meet its cultish adherence to "growth"-that is, expansive tax cuts and deregulation for corporations, at the expense of workers and consumers. "Growth is a choice-and not always an easy choice," Donohue continued. "It's tempting, especially in politics, to put other priorities ahead of growth-priorities that may please the voters or satisfy the demands of one constituency or another."
Despite initial concerns that a Trump presidency would be hostile to the chamber's mission of international trade and free markets, Donohue seems-at least outwardly-confident that the White House will be a fruitful partner.
The chamber's top priority going into the 2017 will be overturning the regulatory executive actions of Obama's presidency. The chamber, along with most Republicans, wants Trump to immediately undo Obama's orders and get to work on killing the overtime rule (which doubled the salary threshold), the Clean Power Plan, and Net Neutrality. The chamber also pledged to continue challenging those regulations in the courts.
"There is no justification for the regulatory overkill we have seen over the last eight years," Donohue said. "An unelected fourth branch of government-the regulatory branch-is holding our small-business sector back while imposing unnecessary costs on larger companies, too." (Actually, the officials of the "unelected regulatory branch" are appointed by the elected president and confirmed by the elected Congress. If Donohue believes that doesn't make them a legitimate part of the government, the chamber should oppose all of Trump's appointees.)
Donohue particularly singled out Obamacare and Dodd-Frank for repeal. Regardless of how it gets replaced, the group wants Obamacare's employer mandate abolished, and with it the health insurance tax, the medical device tax, and the Cadillac tax.
The chamber also wants to roll back Obama's financial regulations stemming from the passage of Dodd-Frank, including rules that limit banks from engaging in certain types of risky speculative investments and that require banks to adhere to stronger capital requirements. Additionally, it wants Congress to undercut the independent power of the Consumer Financial Protection Bureau.
A sweeping attack on financial, labor, health, consumer, and environmental regulations is just the beginning.
The chamber also wants a complete neutering of the federal regulatory agencies, through new legislation that would further bog down the rulemaking process with dozens of delaying requirements, and would give Congress near-complete veto power over the executive branch's regulatory authority.
Of course, a true trickle-down agenda wouldn't be complete without tax cuts. "A real chance at major tax reform only comes around once in a generation, if you're lucky," Donohue said. "We might get lucky this year and next."
Your donation keeps this site free and open for all to read. Give what you can... SUPPORT THE PROSPECT
"Tax reform," of course, is Chamber-speak for tax cuts for corporations and the wealthy. As a sacrifice at the altar of "growth," the chamber wants corporate and individual tax rates drastically cut down, capital gains taxes slashed, and wants to permit corporations to bring back, tax-free, the billions in profits they've stashed abroad.
The U.S. Chamber of Commerce is one of the most powerful forces in Washington. In 2016, it spent nearly $80 million on lobbying. During the 2016 election cycle, it spent $30 million on 16 House and Senate races-all of which went to Republicans, the first-ever electoral sweep for the chamber's picks. In 2017, the chamber could become an even more powerful presence on the Hill, as regulatory rollbacks and tax cuts top the GOP's agenda.
Donohue also issued a clear threat to Democrats who, in the Senate, could block the most drastic deregulatory measures. "We believe many Democrats will want to be constructively involved as well. After all, 25 Democratic senators are up for re-election in two years," Donohue pointed out. "That's one good reason to be constructive rather than obstructive."
For its strong-armed commitment to gutting business regulations and heaping tax breaks to the top-with blatant disregard for workers, consumers, and the public good-we dub the U.S. Chamber of Commerce our Trickle Downer of the Week.
|
{
"pile_set_name": "OpenWebText2"
}
|
Chef Aviv Moshe and three partners opened Messa in 2004, aiming to redefine the White City’s dining experience.
Tony Blair, Pink and Jean-Claude Van Damme are among a roster of celebs who’ve sampled Chef Aviv Moshe’s dishes at Messa near the Tel Aviv Cinematheque — intrigued, no doubt, by the eatery’s inclusion on the 2005 Condé Nast Traveler global Hot Tables list, and recommendations by Italian and French restaurant critics including Gilles Pudlowski.
After eight years, Messa is still getting attention. In June, The Address magazine included Messa as one of nine “must to-do list” destinations. The Lonely Planet review gushes: “More than a restaurant with impeccable haute cuisine, Messa has a magical quality that raises the restaurant experience to a new level. … Following your meal, spare time for a drink in the stunning jet-black bar.”
Spread the Word• Email this article to friends or colleagues• Share this article on Facebook or Twitter• Write about and link to this article on your blog• Local relevancy? Send this article to your local press
Chef Moshe tells ISRAEL21c he fashioned Messa like upscale bar-restaurants in London and New York – the cities where he dreams of expanding his brand – combining a high level of food, design and atmosphere. Daringly, he installed one long dining table so that disparate patrons can mingle.
The most popular choices at this non-kosher chef restaurant are seafood couscous in crab and lemon thyme broth, crab gnocchi, goose-liver carpaccio, and an appetizer of goose liver coated in Valrhona white chocolate.
Moshe explains that the menu has swelled to 35 first courses and close to 30 main dishes “because our regular customers don’t want us to take anything off the menu, and we’re always ready to add more.” Fortunately, the restaurant has a large staff of 125 people to handle all that volume.
Grandma’s kitchen
Now 38, the Jerusalem-born chef of Kurdish ancestry has no formal training. Moshe served as a cook in the army and began his culinary career in 1992 at Château Ein Karem in Jerusalem, which set him on a course of exploring French cuisine. Today his style is a cross between Provencal and Grandma.
“Most of my free time, I used to spend at my grandma’s kitchen,” he says. She did not use recipes, so young Aviv watched her carefully to learn how traditional North African spices — the Moroccan blend ras el-hanout, cumin, paprika, turmeric and coriander — could pair up with such classic Middle-Eastern staples as eggplant, tahini, olive oil, the yogurt-like labane and pomegranate.
“Jerusalem is blessed with many kinds of herbs and spices that grow in almost every backyard,” says the bachelor chef who also enjoys soccer, fashion, sports cars and visual arts.
Goose-liver Carpaccio is a popular Messa dish.
Moshe credits his mentor Shalom Kadosh, and TV cooking shows, with attracting the respect of foreign chefs for their Israeli counterparts in the past few years. He worked with Kadosh in 1996 at the Jerusalem Sheraton, which gave him the skills and confidence to create his first signature menu at Grappa, then one of the capital city’s trendiest eateries. In 1999, Moshe moved over to the critically acclaimed Hanevi’im 54, his only kosher establishment thus far.
He detects a difference in the atmosphere between kosher and non-kosher restaurants. “Generally in kosher restaurants, the patrons come for the dining experience, while in non-kosher restaurants they come for the whole experience of ‘going out’ — not just for the food.”
A culinary focal point
But the food is, of course, front and center. Moshe began spreading his culinary wings at Tel Aviv’s now-defunct Baraka, which he transformed from a Moroccan restaurant to a chef’s restaurant.
With no formal training, Aviv Moshe built one of Israel’s most famed restaurants.
“In Tel Aviv, I started to use different products like red tuna, king crab, lamb chop, foie gras. I’ve combined these products and the knowledge I gained during all of my cooking years, into my personal kitchen in Messa,” he says.
Moshe and three partners opened Messa in 2004 in the hope of redefining the Tel Aviv dining experience. It rapidly became one of the most successful culinary focal points in the city, frequented by personalities including Paul Anka, Pep Guardiola, Suzanne Vega, Gérard Depardieu, Rudolph Giuliani, Roberto Cavalli and Ron Lauder.
Aviv defines the 200-seat restaurant’s cuisine as “thrilling, far from simple and with a subtext of Mother’s kitchen.” One of his personal favorites is watermelon sashimi.
Here is what The Address had to say about Messa: “A must for any food lover, the haute cuisine restaurant comes with an impeccable gourmet menu, glitzy setting and very beautiful people. … The glamorous white-on-white dining hall is simply breathtaking. Lined with white upholstered armchairs, it showcases polished white marble floors, drapes and a long white communal table with a burl-wood top that runs down the center of the dining room. … The food’s creativity and innovation are courtesy of Aviv Moshe, who makes every meal a culinary treat.”
Comments
Abigail Klein Leichman is a writer and associate editor at ISRAEL21c. Prior to moving to Israel in 2007, she was a specialty writer and copy editor at a daily newspaper in New Jersey and has freelanced for a variety of newspapers and periodicals since 1984.
|
{
"pile_set_name": "Pile-CC"
}
|
[Pediatric femoral shaft fracture: effect of treatment procedure on results with reference to somatic and psychological aspects].
When treating femoral shaft fractures in children both somatic (axial/rotational misalignment) and psychological sequelae of the treatment have to be taken into consideration. We performed a retrospective study on the somatic and psychological outcome in 38 children under the age of 10 years with femoral fractures from 1989 to 1991. Twenty-four were treated conservatively (i.e. by traction), while 14 had surgery. Average time in hospital was significantly shorter in the operative group (9 days) than in the conservative group (37 days). The rate of rotational misalignment > 10 degrees was 14% after operation and 45% after traction. Psychological evaluation revealed a positive influence on intellectual development in 21% of conservatively treated children but there were disturbances in motor development (37%), family environment (17%) and general health (25%) in this group. Operative treatment was superior in causing no adverse effects in these fields. We therefore recommend surgery for femoral fractures in children older than 3 years.
|
{
"pile_set_name": "PubMed Abstracts"
}
|
[
{
"name": "Container",
"categories": [
"Basics"
],
"subcategories": [
"拥有单个子元素的布局widget"
],
"description": "一个拥有绘制、定位、调整大小的 widget。",
"link": "https://docs.flutter.io/flutter/widgets/Container-class.html",
"image": "<svg viewBox='0 0 100 100'><defs><marker id='arrow-container-1' orient='auto-start-reverse' viewBox='0 0 1 1' markerWidth='3' markerHeight='3' refX='0.5' refY='0.5'><path d='M 1 0.5 L 0.5 0 L 0.5 1 z' fill='#f50057'/></marker><marker id='arrow-container-2' orient='auto-start-reverse' viewBox='0 0 1 1' markerWidth='3' markerHeight='3' refX='0.5' refY='0.5'><path d='M 1 0.5 L 0.5 0 L 0.5 1 z' fill='#ffffff'/></marker><filter id='shadow-container' x='-50%' y='-50%' width='200%' height='200%'><feGaussianBlur stdDeviation='4'/></filter><linearGradient id='gradient-container' x1='0' y1='0.2' x2='0.4' y2='0.9'><stop offset='55%' stop-color='#ffffff'/><stop offset='100%' stop-color='#fdccdd'/></linearGradient></defs><rect x='0' y='0' width='100' height='100' fill='#3949ab'/><rect x='15' y='25' width='70' height='47.5' rx='10' ry='10' fill='#000000' filter='url(#shadow-container)'/><rect x='15' y='25' width='70' height='47.5' rx='10' ry='10' fill='url(#gradient-container)' stroke-width='5' stroke='#3b75ad'/><rect x='30' y='40' width='40' height='30' fill='#4dd0e1'/><line x1='20' y1='55' x2='27' y2='55' stroke='#f50057' stroke-width='2' marker-start='url(#arrow-container-1)' marker-end='url(#arrow-container-1)'/><line x1='73' y1='55' x2='80' y2='55' stroke='#f50057' stroke-width='2' marker-start='url(#arrow-container-1)' marker-end='url(#arrow-container-1)'/><line x1='50' y1='30' x2='50' y2='37' stroke='#f50057' stroke-width='2' marker-start='url(#arrow-container-1)' marker-end='url(#arrow-container-1)'/><line x1='50' y1='78' x2='50' y2='82' stroke='#f50057' stroke-width='2' marker-start='url(#arrow-container-1)' marker-end='url(#arrow-container-1)'/><line x1='16' y1='17.5' x2='85' y2='17.5' stroke='#ffffff' stroke-width='2' marker-start='url(#arrow-container-2)' marker-end='url(#arrow-container-2)'/><line x1='7.5' y1='26' x2='7.5' y2='72' stroke='#ffffff' stroke-width='2' marker-start='url(#arrow-container-2)' marker-end='url(#arrow-container-2)'/></svg>"
},
{
"name": "Row",
"description": "在水平方向上排列子widget的列表。",
"categories": [
"Basics"
],
"subcategories": [
"拥有多个子元素的布局widget"
],
"link": "https://docs.flutter.io/flutter/widgets/Row-class.html",
"image": "<svg viewBox='0 0 100 100'><rect x='0' y='0' width='100' height='100' fill='#3949ab'/><rect x='10' y='30' width='80' height='40' fill='#ffffff'/><rect x='15' y='40' width='20' height='20' fill='#4dd0e1'/><rect x='40' y='35' width='30' height='30' fill='#4dd0e1'/></svg>"
},
{
"name": "Column",
"description": "在垂直方向上排列子widget的列表。",
"categories": [
"Basics"
],
"subcategories": [
"拥有多个子元素的布局widget"
],
"link": "https://docs.flutter.io/flutter/widgets/Column-class.html",
"image": "<svg viewBox='0 0 100 100'><rect x='0' y='0' width='100' height='100' fill='#3949ab'/><rect x='30' y='10' width='40' height='80' fill='#ffffff'/><rect x='40' y='15' width='20' height='20' fill='#4dd0e1'/><rect x='35' y='40' width='30' height='30' fill='#4dd0e1'/></svg>"
},
{
"name": "Image",
"description": "一个显示图片的widget",
"categories": [
"Basics",
"Assets, Images, and Icons"
],
"subcategories": [
"信息展示"
],
"link": "https://docs.flutter.io/flutter/widgets/Image-class.html",
"image": "<svg viewBox='0 0 100 100'><rect x='0' y='0' width='100' height='100' fill='#3949ab'/><rect x='20' y='20' width='60' height='60' fill='#ffffff'/><image x='22.5' y='22.5' width='55' height='55' xlink:href='/images/owl.jpg'/></svg>"
},
{
"name": "Text",
"description": "单一格式的文本",
"categories": [
"Basics",
"Text"
],
"subcategories": [],
"link": "https://docs.flutter.io/flutter/widgets/Text-class.html",
"image": "<svg viewBox='0 0 100 100'><rect x='0' y='0' width='100' height='100' fill='#3949ab'/><rect x='20' y='30' width='60' height='40' fill='#ffffff'/><text x='50' y='60' text-anchor='middle' font-family='Roboto' font-size='25' fill='#3b75ad'>Abc</text></svg>"
},
{
"name": "Icon",
"description": "A Material Design icon.",
"categories": [
"Basics",
"Assets, Images, and Icons"
],
"subcategories": [
"信息展示"
],
"link": "https://docs.flutter.io/flutter/widgets/Icon-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "RaisedButton",
"description": "Material Design中的button, 一个凸起的材质矩形按钮",
"categories": [
"Basics"
],
"subcategories": [
"按钮"
],
"link": "https://docs.flutter.io/flutter/material/RaisedButton-class.html",
"image": "<img alt='' src='https://material-design.storage.googleapis.com/publish/material_v_9/0B7WCemMG6e0VbDh6YmNiYVc3SHM/components_buttons_usage2.png'>"
},
{
"name": "Scaffold",
"sample": "Scaffold_index",
"description": "Material Design布局结构的基本实现。此类提供了用于显示drawer、snackbar和底部sheet的API。",
"categories": [
"Basics"
],
"subcategories": [
"App结构和导航"
],
"link": "https://docs.flutter.io/flutter/material/Scaffold-class.html",
"image": "<img alt='' src='https://storage.googleapis.com/material-design/publish/material_v_11/assets/0Bx4BSt6jniD7T0hfM01sSmRyTG8/layout_structure_regions_mobile.png'>"
},
{
"name": "Appbar",
"sample": "AppBar_index",
"description": "一个Material Design应用程序栏,由工具栏和其他可能的widget(如TabBar和FlexibleSpaceBar)组成。",
"categories": [
"Basics"
],
"subcategories": [
"App结构和导航"
],
"link": "https://docs.flutter.io/flutter/material/AppBar-class.html",
"image": "<img alt='' src='https://material-design.storage.googleapis.com/publish/material_v_9/0B7WCemMG6e0VclpfSFpuelBGR1k/components_toolbars.png'>"
},
{
"name": "FlutterLogo",
"description": "Flutter logo, 以widget形式. 这个widget遵从IconTheme。",
"categories": [
"Basics"
],
"subcategories": [],
"link": "https://docs.flutter.io/flutter/material/FlutterLogo-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "Stack",
"description": "可以允许其子widget简单的堆叠在一起",
"categories": [
"Stack"
],
"subcategories": [
"拥有多个子元素的布局widget"
],
"link": "https://docs.flutter.io/flutter/widgets/Stack-class.html",
"image": "<svg viewBox='0 0 100 100'><rect x='0' y='0' width='100' height='100' fill='#3949ab'/><rect x='10' y='10' width='80' height='80' fill='#ffffff'/><rect x='25' y='25' width='40' height='30' fill='#3b75ad'/><rect x='45' y='35' width='30' height='30' fill='#4dd0e1'/><rect x='40' y='50' width='10' height='10' fill='#f50057'/></svg>"
},
{
"name": "Placeholder",
"description": "一个绘制了一个盒子的的widget,代表日后有widget将会被添加到该盒子中",
"categories": [
"Basics"
],
"subcategories": [],
"link": "https://docs.flutter.io/flutter/widgets/Placeholder-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "BottomNavigationBar",
"description": "底部导航条,可以很容易地在tap之间切换和浏览顶级视图。",
"categories": [],
"subcategories": [
"App结构和导航"
],
"link": "https://docs.flutter.io/flutter/material/BottomNavigationBar-class.html",
"image": "<img alt='' src='https://material-design.storage.googleapis.com/publish/material_v_9/0B7WCemMG6e0VWG5nei0wWXpoczA/components_bottom_navigation.png'>"
},
{
"name": "TabBar",
"sample": "TabBar_index",
"description": "一个显示水平选项卡的Material Design widget。",
"categories": [],
"subcategories": [
"App结构和导航"
],
"link": "https://docs.flutter.io/flutter/material/TabBar-class.html",
"image": "<img alt='' src='https://material-design.storage.googleapis.com/publish/material_v_9/0B7WCemMG6e0VaWdBdnhMT3ViXzQ/components_tabs.png'>"
},
{
"name": "TabBarView",
"sample": "TabBarView_index",
"description": "显示与当前选中的选项卡相对应的页面视图。通常和TabBar一起使用。",
"categories": [],
"subcategories": [
"App结构和导航"
],
"link": "https://docs.flutter.io/flutter/material/TabBarView-class.html",
"image": "<img alt='' src='https://storage.googleapis.com/material-design/publish/material_v_11/assets/0B7WCemMG6e0VaWdBdnhMT3ViXzQ/components_tabs.png'>"
},
{
"name": "MaterialApp",
"description": "一个方便的widget,它封装了应用程序实现Material Design所需要的一些widget。",
"categories": [],
"subcategories": [
"App结构和导航"
],
"link": "https://docs.flutter.io/flutter/material/MaterialApp-class.html",
"image": "<img alt='' src='https://storage.googleapis.com/material-design/publish/material_v_11/assets/0Bx4BSt6jniD7Y1huOXVQdlFPMmM/materialdesign_introduction.png'>"
},
{
"name": "WidgetsApp",
"description": "一个方便的类,它封装了应用程序通常需要的一些widget。",
"categories": [],
"subcategories": [
"App结构和导航"
],
"link": "https://docs.flutter.io/flutter/widgets/WidgetsApp-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "Drawer",
"description": "从Scaffold边缘水平滑动以显示应用程序中导航链接的Material Design面板。",
"categories": [],
"subcategories": [
"App结构和导航"
],
"link": "https://docs.flutter.io/flutter/material/Drawer-class.html",
"image": "<img alt='' src='https://storage.googleapis.com/material-design/publish/material_v_11/assets/0B7WCemMG6e0VaDhWUXJTTng4ZGs/patterns_navigation_drawer.png'>"
},
{
"name": "FloatingActionButton",
"description": "一个圆形图标按钮,它悬停在内容之上,以展示应用程序中的主要动作。FloatingActionButton通常用于Scaffold.floatingActionButton字段。",
"categories": [],
"subcategories": [
"按钮"
],
"link": "https://docs.flutter.io/flutter/material/FloatingActionButton-class.html",
"image": "<img alt='' src='https://material-design.storage.googleapis.com/publish/material_v_9/0B7WCemMG6e0VN20tOXJoUjVxQjg/components_buttons_fab.png'>"
},
{
"name": "FlatButton",
"description": "一个扁平的Material按钮",
"categories": [],
"subcategories": [
"按钮"
],
"link": "https://docs.flutter.io/flutter/material/FlatButton-class.html",
"image": "<img alt='' src='https://material-design.storage.googleapis.com/publish/material_v_9/0B7WCemMG6e0VNDg3V3ZjU2hsNGc/components_buttons_usage3.png'>"
},
{
"name": "IconButton",
"sample": "IconButton_index",
"description": "一个Material图标按钮,点击时会有水波动画",
"categories": [],
"subcategories": [
"按钮"
],
"link": "https://docs.flutter.io/flutter/material/IconButton-class.html",
"image": "<img alt='' src='https://storage.googleapis.com/material-design/publish/material_v_11/assets/0B_udO5B8pzrzdXVuTlBoOTBjcU0/components_buttons_other1.png'>"
},
{
"name": "PopupMenuButton",
"sample": "PopupMenuButton_index",
"description": "当菜单隐藏式,点击或调用onSelected时显示一个弹出式菜单列表",
"categories": [],
"subcategories": [
"按钮"
],
"link": "https://docs.flutter.io/flutter/material/PopupMenuButton-class.html",
"image": "<img alt='' src='https://storage.googleapis.com/material-design/publish/material_v_11/assets/0B7WCemMG6e0VakJ6a0F2MFJaaDQ/components_menus.png'>"
},
{
"name": "ButtonBar",
"description": "水平排列的按钮组",
"categories": [],
"subcategories": [
"按钮"
],
"link": "https://docs.flutter.io/flutter/material/ButtonBar-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "TextField",
"description": "文本输入框",
"categories": [],
"subcategories": [
"输入框和选择框"
],
"link": "https://docs.flutter.io/flutter/material/TextField-class.html",
"image": "<img alt='' src='https://material-design.storage.googleapis.com/publish/material_v_9/0B7WCemMG6e0VbURLNTM0N0R6eUE/components_text_fields.png'>"
},
{
"name": "Checkbox",
"description": "复选框,允许用户从一组中选择多个选项。",
"categories": [],
"subcategories": [
"输入框和选择框"
],
"link": "https://docs.flutter.io/flutter/material/Checkbox-class.html",
"image": "<img alt='' src='https://storage.googleapis.com/material-design/publish/material_v_9/0Bx4BSt6jniD7T2xGbGo0cUlPVG8/components_switches_check1.png'>"
},
{
"name": "Radio",
"description": "单选框,允许用户从一组中选择一个选项。 ",
"categories": [],
"subcategories": [
"输入框和选择框"
],
"link": "https://docs.flutter.io/flutter/material/Radio-class.html",
"image": "<img alt='' src='https://storage.googleapis.com/material-design/publish/material_v_9/0Bx4BSt6jniD7Z1NaaXh2ZkpDRkE/components_switches_radio1.png'>"
},
{
"name": "Switch",
"description": "On/off 用于切换一个单一状态",
"categories": [],
"subcategories": [
"输入框和选择框"
],
"link": "https://docs.flutter.io/flutter/material/Switch-class.html",
"image": "<img alt='' src='https://storage.googleapis.com/material-design/publish/material_v_9/0Bx4BSt6jniD7NDg4aGIzVXYxVEE/components_switches_switch1.png'>"
},
{
"name": "Slider",
"description": "滑块,允许用户通过滑动滑块来从一系列值中选择。",
"categories": [],
"subcategories": [
"输入框和选择框"
],
"link": "https://docs.flutter.io/flutter/material/Slider-class.html",
"image": "<img alt='' src='https://material-design.storage.googleapis.com/publish/material_v_9/0B7WCemMG6e0VTmJrQUYzajFIclE/components_sliders.png'>"
},
{
"name": "Date & Time Pickers",
"description": "日期&时间选择器",
"categories": [],
"subcategories": [
"输入框和选择框"
],
"link": "https://docs.flutter.io/flutter/material/showDatePicker.html",
"image": "<img alt='' src='https://material-design.storage.googleapis.com/publish/material_v_9/0B7WCemMG6e0VY2h4WElGdEhPb2c/components_pickers.png'>"
},
{
"name": "SimpleDialog",
"description": "简单对话框可以显示附加的提示或操作",
"categories": [],
"subcategories": [
"对话框、Alert、Panel"
],
"link": "https://docs.flutter.io/flutter/material/SimpleDialog-class.html",
"image": "<img alt='' src='https://material-design.storage.googleapis.com/publish/material_v_9/0B7WCemMG6e0VVGNnN3NvMGdoQTg/components_dialogs.png'>"
},
{
"name": "AlertDialog",
"description": "一个会中断用户操作的对话款,需要用户确认",
"categories": [],
"subcategories": [
"对话框、Alert、Panel"
],
"link": "https://docs.flutter.io/flutter/material/AlertDialog-class.html",
"image": "<img alt='' src='https://material-design.storage.googleapis.com/publish/material_v_9/0Bzhp5Z4wHba3TzFHYVlrbWF2bnM/components_alerts_1.png'>"
},
{
"name": "BottomSheet",
"description": "BottomSheet是一个从屏幕底部滑起的列表(以显示更多的内容)。你可以调用showBottomSheet()或showModalBottomSheet弹出",
"categories": [],
"subcategories": [
"对话框、Alert、Panel"
],
"link": "https://docs.flutter.io/flutter/material/BottomSheet-class.html",
"image": "<img alt='' src='https://material-design.storage.googleapis.com/publish/material_v_9/0B7WCemMG6e0VVWZzZ1FIN09XWGc/components_bottom_sheets.png'>"
},
{
"name": "ExpansionPanel",
"description": "Expansion panels contain creation flows and allow lightweight editing of an element. The ExpansionPanel widget implements this component.",
"categories": [],
"subcategories": [
"对话框、Alert、Panel"
],
"link": "https://docs.flutter.io/flutter/material/ExpansionPanel-class.html",
"image": "<img alt='' src='https://material-design.storage.googleapis.com/publish/material_v_9/0B7WCemMG6e0VOXF3eEJ3azZMSjg/components_expansion_panels.png'>"
},
{
"name": "SnackBar",
"description": "具有可选操作的轻量级消息提示,在屏幕的底部显示。",
"categories": [],
"subcategories": [
"对话框、Alert、Panel"
],
"link": "https://docs.flutter.io/flutter/material/SnackBar-class.html",
"image": "<img alt='' src='https://material-design.storage.googleapis.com/publish/material_v_9/0B7WCemMG6e0VSjZkendtc19iZ2M/components_snackbars.png'>"
},
{
"name": "Chip",
"description": "标签,一个Material widget。 它可以将一个复杂内容实体展现在一个小块中,如联系人。",
"categories": [],
"subcategories": [
"信息展示"
],
"link": "https://docs.flutter.io/flutter/material/Chip-class.html",
"image": "<img alt='' src='https://material-design.storage.googleapis.com/publish/material_v_9/0B7WCemMG6e0VM1VORGxxWUx5U0E/components_chips.png'>"
},
{
"name": "Tooltip",
"description": "一个文本提示工具,帮助解释一个按钮或其他用户界面,当widget长时间按下时(当用户采取其他适当操作时)显示一个提示标签。",
"categories": [],
"subcategories": [
"信息展示"
],
"link": "https://docs.flutter.io/flutter/material/Tooltip-class.html",
"image": "<img alt='' src='https://material-design.storage.googleapis.com/publish/material_v_9/0B7WCemMG6e0VZ1JKMzJFcmhOWkk/components_tooltips.png'>"
},
{
"name": "DataTable",
"description": "数据表显示原始数据集。它们通常出现在桌面企业产品中。DataTable Widget实现这个组件",
"categories": [],
"subcategories": [
"信息展示"
],
"link": "https://docs.flutter.io/flutter/material/DataTable-class.html",
"image": "<img alt='' src='https://material-design.storage.googleapis.com/publish/material_v_9/0B7WCemMG6e0VWTJHMmJZdWZ5LU0/components_data_tables.png'>"
},
{
"name": "Card",
"description": "一个 Material Design 卡片。拥有一个圆角和阴影 ",
"categories": [],
"subcategories": [
"信息展示"
],
"link": "https://docs.flutter.io/flutter/material/Card-class.html",
"image": "<img alt='' src='https://material-design.storage.googleapis.com/publish/material_v_9/0B7WCemMG6e0VR0ptbC1RV1NLNlk/components_cards.png'>"
},
{
"name": "LinearProgressIndicator",
"description": "一个线性进度条,另外还有一个圆形进度条CircularProgressIndicator",
"categories": [],
"subcategories": [
"信息展示"
],
"link": "https://docs.flutter.io/flutter/material/LinearProgressIndicator-class.html",
"image": "<img alt='' src='https://material-design.storage.googleapis.com/publish/material_v_9/0B7WCemMG6e0VWkJiRjRLbzRNS3M/components_progress_and_activity.png'>"
},
{
"name": "ListTile",
"description": "一个固定高度的行,通常包含一些文本,以及一个行前或行尾图标。",
"categories": [],
"subcategories": [
"布局"
],
"link": "https://docs.flutter.io/flutter/material/ListTile-class.html",
"image": "<img alt='' src='https://material-design.storage.googleapis.com/publish/material_v_9/0Bx4BSt6jniD7UUw0bzVwU2lMUHc/components_lists_keylines_single10.png'>"
},
{
"name": "Stepper",
"description": "一个Material Design 步骤指示器,显示一系列步骤的过程",
"categories": [],
"subcategories": [
"布局"
],
"link": "https://docs.flutter.io/flutter/material/Stepper-class.html",
"image": "<img alt='' src='https://material-design.storage.googleapis.com/publish/material_v_9/0B7WCemMG6e0VTndyUnNCR2tQREE/components_steppers.png'>"
},
{
"name": "Divider",
"description": "一个逻辑1像素厚的水平分割线,两边都有填充",
"categories": [],
"subcategories": [
"布局"
],
"link": "https://docs.flutter.io/flutter/material/Divider-class.html",
"image": "<img alt='' src='https://material-design.storage.googleapis.com/publish/material_v_9/0B7WCemMG6e0VUVlmbHM1Q013RU0/components_dividers.png'>"
},
{
"name": "CupertinoActivityIndicator",
"description": "一个iOS风格的loading指示器。显示一个圆形的转圈菊花",
"categories": [
"Cupertino (iOS-style widgets)"
],
"subcategories": [],
"link": "https://docs.flutter.io/flutter/cupertino/CupertinoActivityIndicator-class.html",
"image": "<img alt='' src='/images/widget-catalog/cupertino-activity-indicator.png'>"
},
{
"name": "CupertinoAlertDialog",
"description": "iOS风格的alert dialog.",
"categories": [
"Cupertino (iOS-style widgets)"
],
"subcategories": [],
"link": "https://docs.flutter.io/flutter/cupertino/CupertinoAlertDialog-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "CupertinoButton",
"description": "iOS风格的button.",
"categories": [
"Cupertino (iOS-style widgets)"
],
"subcategories": [],
"link": "https://docs.flutter.io/flutter/cupertino/CupertinoButton-class.html",
"image": "<img alt='' src='/images/widget-catalog/cupertino-button.png'>"
},
{
"name": "CupertinoDialog",
"description": "iOS风格的对话框",
"categories": [
"Cupertino (iOS-style widgets)"
],
"subcategories": [],
"link": "https://docs.flutter.io/flutter/cupertino/CupertinoDialog-class.html",
"image": "<img alt='' src='/images/widget-catalog/cupertino-dialog.png'>"
},
{
"name": "CupertinoDialogAction",
"description": "通常用于CupertinoAlertDialog的一个button",
"categories": [
"Cupertino (iOS-style widgets)"
],
"subcategories": [],
"link": "https://docs.flutter.io/flutter/cupertino/CupertinoDialogAction-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "CupertinoSlider",
"description": "从一个范围中选一个值.",
"categories": [
"Cupertino (iOS-style widgets)"
],
"subcategories": [],
"link": "https://docs.flutter.io/flutter/cupertino/CupertinoSlider-class.html",
"image": "<img alt='' src='/images/widget-catalog/cupertino-slider.png'>"
},
{
"name": "CupertinoSwitch",
"description": "iOS风格的开关. 用于单一状态的开/关",
"categories": [
"Cupertino (iOS-style widgets)"
],
"subcategories": [],
"link": "https://docs.flutter.io/flutter/cupertino/CupertinoSwitch-class.html",
"image": "<img alt='' src='/images/widget-catalog/cupertino-switch.png'>"
},
{
"name": "CupertinoPageTransition",
"description": "提供iOS风格的页面过度动画",
"categories": [
"Cupertino (iOS-style widgets)"
],
"subcategories": [],
"link": "https://docs.flutter.io/flutter/cupertino/CupertinoPageTransition-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "CupertinoFullscreenDialogTransition",
"description": "一个iOS风格的过渡,用于调用全屏对话框。",
"categories": [
"Cupertino (iOS-style widgets)"
],
"subcategories": [],
"link": "https://docs.flutter.io/flutter/cupertino/CupertinoFullscreenDialogTransition-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "CupertinoNavigationBar",
"description": "iOS风格的导航栏. 通常和CupertinoPageScaffold一起使用。",
"categories": [
"Cupertino (iOS-style widgets)"
],
"subcategories": [],
"link": "https://docs.flutter.io/flutter/cupertino/CupertinoNavigationBar-class.html",
"image": "<img alt='' src='/images/widget-catalog/cupertino-nav-bar.png'>"
},
{
"name": "CupertinoTabBar",
"description": "iOS风格的底部选项卡。 通常和CupertinoTabScaffold一起使用。",
"categories": [
"Cupertino (iOS-style widgets)"
],
"subcategories": [],
"link": "https://docs.flutter.io/flutter/cupertino/CupertinoTabBar-class.html",
"image": "<img alt='' src='/images/widget-catalog/cupertino-tab-bar.png'>"
},
{
"name": "CupertinoPageScaffold",
"description": "一个iOS风格的页面的基本布局结构。包含内容和导航栏",
"categories": [
"Cupertino (iOS-style widgets)"
],
"subcategories": [],
"link": "https://docs.flutter.io/flutter/cupertino/CupertinoPageScaffold-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "CupertinoTabScaffold",
"description": "标签式iOS应用程序的结构。将选项卡栏放在内容选项卡之上",
"categories": [
"Cupertino (iOS-style widgets)"
],
"subcategories": [],
"link": "https://docs.flutter.io/flutter/cupertino/CupertinoTabScaffold-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "CupertinoTabView",
"description": "支持选项卡间并行导航项卡的根内容。通常与CupertinoTabScaffolde一起使用",
"categories": [
"Cupertino (iOS-style widgets)"
],
"subcategories": [],
"link": "https://docs.flutter.io/flutter/cupertino/CupertinoTabView-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "Padding",
"description": "一个widget, 会给其子widget添加指定的填充",
"categories": [
"Styling"
],
"subcategories": [
"拥有单个子元素的布局widget"
],
"link": "https://docs.flutter.io/flutter/widgets/Padding-class.html",
"image": "<svg viewBox='0 0 100 100'><defs><marker id='arrow-padding' orient='auto-start-reverse' viewBox='0 0 1 1' markerWidth='3' markerHeight='3' refX='0.5' refY='0.5'><path d='M 1 0.5 L 0.5 0 L 0.5 1 z' fill='#f50057'/></marker></defs><rect x='0' y='0' width='100' height='100' fill='#3949ab'/><rect x='10' y='20' width='80' height='60' fill='#ffffff'/><rect x='25' y='30' width='50' height='30' fill='#4dd0e1'/><line x1='13' y1='45' x2='22' y2='45' stroke='#f50057' stroke-width='2' marker-start='url(#arrow-padding)' marker-end='url(#arrow-padding)'/><line x1='78' y1='45' x2='87' y2='45' stroke='#f50057' stroke-width='2' marker-start='url(#arrow-padding)' marker-end='url(#arrow-padding)'/><line x1='50' y1='23' x2='50' y2='27' stroke='#f50057' stroke-width='2' marker-start='url(#arrow-padding)' marker-end='url(#arrow-padding)'/><line x1='50' y1='63' x2='50' y2='77' stroke='#f50057' stroke-width='2' marker-start='url(#arrow-padding)' marker-end='url(#arrow-padding)'/></svg>"
},
{
"name": "Center",
"description": "将其子widget居中显示在自身内部的widget",
"categories": [
],
"subcategories": [
"拥有单个子元素的布局widget"
],
"link": "https://docs.flutter.io/flutter/widgets/Center-class.html",
"image": "<svg viewBox='0 0 100 100'><defs><marker id='arrow-center' orient='auto-start-reverse' viewBox='0 0 1 1' markerWidth='3' markerHeight='3' refX='0.5' refY='0.5'><path d='M 1 0.5 L 0.5 0 L 0.5 1 z' fill='#f50057'/></marker></defs><rect x='0' y='0' width='100' height='100' fill='#3949ab'/><rect x='10' y='20' width='80' height='60' fill='#ffffff'/><rect x='25' y='35' width='50' height='30' fill='#4dd0e1'/><line x1='10' y1='50' x2='22' y2='50' stroke='#f50057' stroke-width='2' marker-end='url(#arrow-center)'/><line x1='90' y1='50' x2='78' y2='50' stroke='#f50057' stroke-width='2' marker-end='url(#arrow-center)'/><line x1='50' y1='20' x2='50' y2='32' stroke='#f50057' stroke-width='2' marker-end='url(#arrow-center)'/><line x1='50' y1='80' x2='50' y2='68' stroke='#f50057' stroke-width='2' marker-end='url(#arrow-center)'/></svg>"
},
{
"name": "Align",
"description": "一个widget,它可以将其子widget对齐,并可以根据子widget的大小自动调整大小。",
"categories": [
],
"subcategories": [
"拥有单个子元素的布局widget"
],
"link": "https://docs.flutter.io/flutter/widgets/Align-class.html",
"image": "<svg viewBox='0 0 100 100'><defs><marker id='arrow-align' orient='auto-start-reverse' viewBox='0 0 1 1' markerWidth='3' markerHeight='3' refX='0.5' refY='0.5'><path d='M 1 0.5 L 0.5 0 L 0.5 1 z' fill='#f50057'/></marker></defs><rect x='0' y='0' width='100' height='100' fill='#3949ab'/><rect x='10' y='20' width='80' height='60' fill='#ffffff'/><rect x='15' y='50' width='50' height='30' fill='#4dd0e1'/><line x1='10' y1='65' x2='12' y2='65' stroke='#f50057' stroke-width='2' marker-end='url(#arrow-align)'/><line x1='90' y1='65' x2='68' y2='65' stroke='#f50057' stroke-width='2' marker-end='url(#arrow-align)'/><line x1='40' y1='20' x2='40' y2='47' stroke='#f50057' stroke-width='2' marker-end='url(#arrow-align)'/></svg>"
},
{
"name": "FittedBox",
"description": "按自己的大小调整其子widget的大小和位置。",
"categories": [
],
"subcategories": [
"拥有单个子元素的布局widget"
],
"link": "https://docs.flutter.io/flutter/widgets/FittedBox-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "AspectRatio",
"description": "一个widget,试图将子widget的大小指定为某个特定的长宽比",
"categories": [
],
"subcategories": [
"拥有单个子元素的布局widget"
],
"link": "https://docs.flutter.io/flutter/widgets/AspectRatio-class.html",
"image": "<svg viewBox='0 0 100 100'><defs><marker id='arrow-aspect-ratio' orient='auto-start-reverse' viewBox='0 0 1 1' markerWidth='3' markerHeight='3' refX='0.5' refY='0.5'><path d='M 1 0.5 L 0.5 0 L 0.5 1 z' fill='#ffffff'/></marker></defs><rect x='0' y='0' width='100' height='100' fill='#3949ab'/><rect x='25' y='35' width='50' height='30' fill='#ffffff'/><rect x='27.5' y='37.5' width='45' height='25' fill='#4dd0e1'/><line x1='31' y1='41' x2='69' y2='59' stroke='#ffffff' stroke-width='2' marker-start='url(#arrow-aspect-ratio)' marker-end='url(#arrow-aspect-ratio)'/></svg>"
},
{
"name": "ConstrainedBox",
"description": "对其子项施加附加约束的widget",
"categories": [
],
"subcategories": [
"拥有单个子元素的布局widget"
],
"link": "https://docs.flutter.io/flutter/widgets/ConstrainedBox-class.html",
"image": "<svg viewBox='0 0 100 100'><defs><marker id='arrow-constrained-box' orient='auto-start-reverse' viewBox='0 0 1 1' markerWidth='3' markerHeight='3' refX='0.5' refY='0.5'><path d='M 1 0.5 L 0.5 0 L 0.5 1 z' fill='#ffffff'/></marker></defs><rect x='0' y='0' width='100' height='100' fill='#3949ab'/><rect x='20' y='30' width='50' height='40' fill='#ffffff'/><rect x='22.5' y='32.5' width='45' height='35' fill='#4dd0e1'/><path d='M63 23 v 40' stroke='#ffffff' stroke-width='1' stroke-linecap='round' stroke-dasharray='0.5 3.1' fill='transparent'/><path d='M77 23 v 54' stroke='#ffffff' stroke-width='1' stroke-linecap='round' stroke-dasharray='0.5 3.1' fill='transparent'/><path d='M13 63 h 50' stroke='#ffffff' stroke-width='1' stroke-linecap='round' stroke-dasharray='0.5 3.1' fill='transparent'/><path d='M13 77 h 64' stroke='#ffffff' stroke-width='1' stroke-linecap='round' stroke-dasharray='0.5 3.1' fill='transparent'/><path d='M50 25 L60 25' stroke='#ffffff' stroke-width='2' marker-end='url(#arrow-constrained-box)'/><path d='M90 25 L80 25' stroke='#ffffff' stroke-width='2' marker-end='url(#arrow-constrained-box)'/><path d='M15 50 L15 60' stroke='#ffffff' stroke-width='2' marker-end='url(#arrow-constrained-box)'/><path d='M15 90 L15 80' stroke='#ffffff' stroke-width='2' marker-end='url(#arrow-constrained-box)'/></svg>"
},
{
"name": "Baseline",
"description": "根据子项的基线对它们的位置进行定位的widget。",
"categories": [
],
"subcategories": [
"拥有单个子元素的布局widget"
],
"link": "https://docs.flutter.io/flutter/widgets/Baseline-class.html",
"image": "<svg viewBox='0 0 100 100'><defs><marker id='arrow-baseline' orient='auto-start-reverse' viewBox='0 0 1 1' markerWidth='3' markerHeight='3' refX='0.5' refY='0.5'><path d='M 1 0.5 L 0.5 0 L 0.5 1 z' fill='#ffffff'/></marker></defs><rect x='0' y='0' width='100' height='100' fill='#3949ab'/><rect x='20' y='20' width='60' height='50' fill='#ffffff'/><rect x='20' y='45' width='60' height='30' fill='#4dd0e1'/><line x1='85' y1='20' x2='85' y2='66' stroke='#ffffff' stroke-width='2' marker-end='url(#arrow-baseline)'/><line x1='15' y1='20' x2='15' y2='66' stroke='#ffffff' stroke-width='2' marker-end='url(#arrow-baseline)'/><line x1='10' y1='70' x2='90' y2='70' stroke='#ffffff' stroke-width='2'/><text x='50' y='69' text-anchor='middle' font-family='Roboto' font-size='25' fill='#3b75ad'>Abc </text></svg>"
},
{
"name": "FractionallySizedBox",
"description": "一个widget,它把它的子项放在可用空间的一小部分。关于布局算法的更多细节,见RenderFractionallySizedOverflowBox",
"categories": [
],
"subcategories": [
"拥有单个子元素的布局widget"
],
"link": "https://docs.flutter.io/flutter/widgets/FractionallySizedBox-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "IntrinsicHeight",
"description": "一个widget,它将它的子widget的高度调整其本身实际的高度",
"categories": [
],
"subcategories": [
"拥有单个子元素的布局widget"
],
"link": "https://docs.flutter.io/flutter/widgets/IntrinsicHeight-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "IntrinsicWidth",
"description": "一个widget,它将它的子widget的宽度调整其本身实际的宽度",
"categories": [
],
"subcategories": [
"拥有单个子元素的布局widget"
],
"link": "https://docs.flutter.io/flutter/widgets/IntrinsicWidth-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "LimitedBox",
"description": "一个当其自身不受约束时才限制其大小的盒子",
"categories": [
],
"subcategories": [
"拥有单个子元素的布局widget"
],
"link": "https://docs.flutter.io/flutter/widgets/LimitedBox-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "Offstage",
"description": "一个布局widget,可以控制其子widget的显示和隐藏。",
"categories": [
],
"subcategories": [
"拥有单个子元素的布局widget"
],
"link": "https://docs.flutter.io/flutter/widgets/Offstage-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "OverflowBox",
"description": "对其子项施加不同约束的widget,它可能允许子项溢出父级。",
"categories": [
],
"subcategories": [
"拥有单个子元素的布局widget"
],
"link": "https://docs.flutter.io/flutter/widgets/OverflowBox-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "SizedBox",
"description": "一个特定大小的盒子。这个widget强制它的孩子有一个特定的宽度和高度。如果宽度或高度为NULL,则此widget将调整自身大小以匹配该维度中的孩子的大小。",
"categories": [
],
"subcategories": [
"拥有单个子元素的布局widget"
],
"link": "https://docs.flutter.io/flutter/widgets/SizedBox-class.html",
"image": "<svg viewBox='0 0 100 100'><defs><marker id='arrow-sized-box' orient='auto-start-reverse' viewBox='0 0 1 1' markerWidth='3' markerHeight='3' refX='0.5' refY='0.5'><path d='M 1 0.5 L 0.5 0 L 0.5 1 z' fill='#ffffff'/></marker></defs><rect x='0' y='0' width='100' height='100' fill='#3949ab'/><rect x='25' y='35' width='50' height='30' fill='#ffffff'/><rect x='27.5' y='37.5' width='45' height='25' fill='#4dd0e1'/><line x1='28' y1='30' x2='72' y2='30' stroke='#ffffff' stroke-width='2' marker-start='url(#arrow-sized-box)' marker-end='url(#arrow-sized-box)'/><line x1='20' y1='38' x2='20' y2='62' stroke='#ffffff' stroke-width='2' marker-start='url(#arrow-sized-box)' marker-end='url(#arrow-sized-box)'/></svg>"
},
{
"name": "SizedOverflowBox",
"description": "一个特定大小的widget,但是会将它的原始约束传递给它的孩子,它可能会溢出。",
"categories": [
],
"subcategories": [
"拥有单个子元素的布局widget"
],
"link": "https://docs.flutter.io/flutter/widgets/SizedOverflowBox-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "Transform",
"description": "在绘制子widget之前应用转换的widget。",
"categories": [
],
"subcategories": [
"拥有单个子元素的布局widget"
],
"link": "https://docs.flutter.io/flutter/widgets/Transform-class.html",
"image": "<svg viewBox='0 0 100 100'><rect x='0' y='0' width='100' height='100' fill='#3949ab'/><rect x='17.5' y='42.5' width='50' height='30' fill='#ffffff'/><rect x='20' y='45' width='45' height='25' fill='#3b75ad'/><rect x='20' y='45' width='45' height='25' fill='#4dd0e1' transform='translate(15 -5) rotate(-23) skewX(-10)'/></svg>"
},
{
"name": "CustomSingleChildLayout",
"description": "一个自定义的拥有单个子widget的布局widget",
"categories": [
],
"subcategories": [
"拥有单个子元素的布局widget"
],
"link": "https://docs.flutter.io/flutter/widgets/CustomSingleChildLayout-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "IndexedStack",
"description": "从一个子widget列表中显示单个孩子的Stack",
"categories": [
],
"subcategories": [
"拥有多个子元素的布局widget"
],
"link": "https://docs.flutter.io/flutter/widgets/IndexedStack-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "Flow",
"description": "一个实现流式布局算法的widget",
"categories": [
],
"subcategories": [
"拥有多个子元素的布局widget"
],
"link": "https://docs.flutter.io/flutter/widgets/Flow-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "Table",
"description": "为其子widget使用表格布局算法的widget",
"categories": [
],
"subcategories": [
"拥有多个子元素的布局widget"
],
"link": "https://docs.flutter.io/flutter/widgets/Table-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "Wrap",
"description": "可以在水平或垂直方向多行显示其子widget。",
"categories": [
],
"subcategories": [
"拥有多个子元素的布局widget"
],
"link": "https://docs.flutter.io/flutter/widgets/Wrap-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "ListBody",
"description": "一个widget,它沿着一个给定的轴,顺序排列它的子元素",
"categories": [
],
"subcategories": [
"拥有多个子元素的布局widget"
],
"link": "https://docs.flutter.io/flutter/widgets/ListBody-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "ListView",
"sample": "ListView_index",
"description": "可滚动的列表控件。ListView是最常用的滚动widget,它在滚动方向上一个接一个地显示它的孩子。在纵轴上,孩子们被要求填充ListView。",
"categories": [
],
"subcategories": [
"拥有多个子元素的布局widget"
],
"link": "https://docs.flutter.io/flutter/widgets/ListView-class.html",
"image": "<svg viewBox='0 0 100 100'><filter id='inset-shadow-block' x='-50%' y='-50%' width='200%' height='200%'><feComponentTransfer in='SourceAlpha'><feFuncA type='table' tableValues='1 0' /></feComponentTransfer><feGaussianBlur stdDeviation='2' result='Blur'/><feFlood flood-color='#666666' result='color'/><feComposite in2='Blur' operator='in'/><feComposite in2='SourceAlpha' operator='in' /><feMerge><feMergeNode /></feMerge></filter><rect x='0' y='0' width='100' height='100' fill='#3949ab'/><rect x='30' y='10' width='40' height='80' fill='#ffffff'/><rect x='35' y='10' width='30' height='15' fill='#4dd0e1'/><rect x='35' y='30' width='30' height='20' fill='#4dd0e1'/><rect x='35' y='55' width='30' height='5' fill='#4dd0e1'/><rect x='35' y='65' width='30' height='15' fill='#4dd0e1'/><rect x='35' y='85' width='30' height='5' fill='#4dd0e1'/><rect x='30' y='10' width='40' height='80' fill='#ffffff' filter='url(#inset-shadow-block)'/></svg>"
},
{
"name": "CustomMultiChildLayout",
"description": "使用一个委托来对多个孩子进行设置大小和定位的小部件",
"categories": [
],
"subcategories": [
"拥有多个子元素的布局widget"
],
"link": "https://docs.flutter.io/flutter/widgets/CustomMultiChildLayout-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "LayoutBuilder",
"description": "构建一个可以依赖父窗口大小的widget树。",
"categories": [
],
"subcategories": [
"Layout helpers"
],
"link": "https://docs.flutter.io/flutter/widgets/LayoutBuilder-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "RichText",
"description": "一个富文本Text,可以显示多种样式的text。",
"categories": [
"Text"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/RichText-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "DefaultTextStyle",
"description": "文字样式,用于指定Text widget的文字样式",
"categories": [
"Text"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/DefaultTextStyle-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "RawImage",
"description": "一个直接显示dart:ui.Image的widget",
"categories": [
"Assets, Images, and Icons"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/RawImage-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "AssetBundle",
"description": "包含应用程序可以使用的资源,如图像和字符串。对这些资源的访问是异步,所以他们可以来自网络(例如,从NetworkAssetBundle)或从本地文件系统,这并不会挂起用户界面。",
"categories": [
"Assets, Images, and Icons"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/services/AssetBundle-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "Form",
"description": "一个可选的、用于给多个TextField分组的widget",
"categories": [
"Input"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/Form-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "FormField",
"description": "一个单独的表单字段。此widget维护表单字段的当前状态,以便在UI中直观地反映更新和验证错误。",
"categories": [
"Input"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/FormField-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "RawKeyboardListener",
"description": "每当用户按下或释放键盘上的键时调用回调的widget。",
"categories": [
"Input"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/RawKeyboardListener-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "AnimatedContainer",
"description": "在一段时间内逐渐改变其值的容器。",
"categories": [
"Animation and Motion"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/AnimatedContainer-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "AnimatedCrossFade",
"description": "一个widget,在两个孩子之间交叉淡入,并同时调整他们的尺寸",
"categories": [
"Animation and Motion"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/AnimatedCrossFade-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "Hero",
"description": "将其子项标记为hero动画候选的widget。",
"categories": [
"Animation and Motion"
],
"subcategories": [
"Routing"
],
"link": "https://docs.flutter.io/flutter/widgets/Hero-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "AnimatedBuilder",
"description": "用于构建动画的通用小部件。AnimatedBuilder在有多个widget希望有一个动画作为一个较大的建造函数部分时会非常有用。要使用AnimatedBuilder,只需构建widget并将其传给builder函数即可。",
"categories": [
"Animation and Motion"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/AnimatedBuilder-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "Draggable",
"description": "一个可拖动的widget",
"categories": [
],
"subcategories": [
"Touch interactions"
],
"link": "https://docs.flutter.io/flutter/widgets/Draggable-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "LongPressDraggable",
"description": "可以使其子widget在长按时可拖动",
"categories": [
"交互Widget"
],
"subcategories": [
"Touch interactions"
],
"link": "https://docs.flutter.io/flutter/widgets/LongPressDraggable-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "GestureDetector",
"description": "一个检测手势的widget",
"categories": [
"交互Widget"
],
"subcategories": [
"Touch interactions"
],
"link": "https://docs.flutter.io/flutter/widgets/GestureDetector-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "DragTarget",
"description": "一个拖动的目标widget,在完成拖动时它可以接收数据",
"categories": [
"交互Widget"
],
"subcategories": [
"Touch interactions"
],
"link": "https://docs.flutter.io/flutter/widgets/DragTarget-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "Dismissible",
"description": "可以在拖动时隐藏的widget",
"categories": [
"交互Widget"
],
"subcategories": [
"Touch interactions"
],
"link": "https://docs.flutter.io/flutter/widgets/Dismissible-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "IgnorePointer",
"description": "在hit test中不可见的widget。当ignoring为true时,此widget及其子树不响应事件。但它在布局过程中仍然消耗空间,并像往常一样绘制它的孩子。它是无法捕获事件对象、因为它在RenderBox.hitTest中返回false ",
"categories": [
"交互Widget"
],
"subcategories": [
"Touch interactions"
],
"link": "https://docs.flutter.io/flutter/widgets/IgnorePointer-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "AbsorbPointer",
"description": "在hit test期间吸收(拦截)事件。当absorbing为true时,此小部件阻止其子树通过终止命中测试来接收指针事件。它在布局过程中仍然消耗空间,并像往常一样绘制它的孩子。它只是防止其孩子成为事件命中目标,因为它从RenderBox.hitTest返回true。",
"categories": [
"交互Widget"
],
"subcategories": [
"Touch interactions"
],
"link": "https://docs.flutter.io/flutter/widgets/AbsorbPointer-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "Navigator",
"description": "导航器,可以在多个页面(路由)栈之间跳转。",
"categories": [
"交互Widget"
],
"subcategories": [
"Routing"
],
"link": "https://docs.flutter.io/flutter/widgets/Navigator-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "Theme",
"description": "将主题应用于子widget。主题描述了应用选择的颜色和字体。",
"categories": [
"Styling"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/material/Theme-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "MediaQuery",
"description": "建立一个子树,在树中媒体查询解析不同的给定数据",
"categories": [
"Styling"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/MediaQuery-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "ListView",
"description": "一个可滚动的列表",
"categories": [
"Scrolling"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/ListView-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "NestedScrollView",
"description": "一个可以嵌套其它可滚动widget的widget",
"categories": [
"Scrolling"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/NestedScrollView-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "GridView",
"description": "一个可滚动的二维空间数组",
"categories": [
"Scrolling"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/GridView-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "SingleChildScrollView",
"description": "有一个子widget的可滚动的widget,子内容超过父容器时可以滚动。",
"categories": [
"Scrolling"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/SingleChildScrollView-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "Scrollable",
"description": "实现了可滚动widget的交互模型,但不包含UI显示相关的逻辑",
"categories": [
"Scrolling",
"交互Widget"
],
"subcategories": [
"Touch interactions"
],
"link": "https://docs.flutter.io/flutter/widgets/Scrollable-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "Scrollbar",
"description": "一个Material Design 滚动条,表示当前滚动到了什么位置",
"categories": [
"Scrolling"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/material/Scrollbar-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "CustomScrollView",
"description": "一个使用slivers创建自定义的滚动效果的ScrollView",
"categories": [
"Scrolling"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/CustomScrollView-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "NotificationListener",
"description": "一个用来监听树上冒泡通知的widget。",
"categories": [
"Scrolling"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/NotificationListener-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "ScrollConfiguration",
"description": "控制可滚动组件在子树中的表现行为",
"categories": [
"Scrolling"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/ScrollConfiguration-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "RefreshIndicator",
"description": "Material Design下拉刷新指示器,包装一个可滚动widget",
"categories": [
"Scrolling"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/material/RefreshIndicator-class.html",
"image": "<img alt='' src='https://storage.googleapis.com/material-design/publish/material_v_12/assets/0B7WCemMG6e0VS2kzSmZwNnNKQVk/patterns-swipe-to-refresh.png'>"
},
{
"name": "Opacity",
"description": "使其子widget透明的widget。",
"categories": [
"Painting and effects"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/Opacity-class.html",
"image": "<svg viewBox='0 0 100 100'><rect x='0' y='0' width='100' height='100' fill='#3949ab'/><rect x='10' y='10' width='60' height='60' fill='#3b75ad'/><rect x='20' y='30' width='70' height='50' fill='#ffffff' opacity='0.8'/></svg>"
},
{
"name": "Transform",
"description": "在绘制子widget之前应用转换的widget。",
"categories": [
"Painting and effects"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/Transform-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "DecoratedBox",
"description": "在孩子绘制之前或之后绘制装饰的widget。",
"categories": [
"Painting and effects"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/DecoratedBox-class.html",
"image": "<svg viewBox='0 0 100 100'><defs><filter id='shadow-decorated-box' x='-50%' y='-50%' width='200%' height='200%'><feGaussianBlur stdDeviation='4'/></filter><linearGradient id='gradient-decorated-box' x1='0' y1='0' x2='0.5' y2='1'><stop offset='50%' stop-color='#ffffff'/><stop offset='100%' stop-color='#f50057'/></linearGradient></defs><rect x='0' y='0' width='100' height='100' fill='#3949ab'/><rect x='25' y='25' width='50' height='50' rx='10' ry='10' fill='#000000' filter='url(#shadow-decorated-box)'/><rect x='25' y='25' width='50' height='50' rx='10' ry='10' fill='url(#gradient-decorated-box)' stroke-width='5' stroke='#4dd0e1'/></svg>"
},
{
"name": "FractionalTranslation",
"description": "绘制盒子之前给其添加一个偏移转换",
"categories": [
"Painting and effects"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/FractionalTranslation-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "RotatedBox",
"description": "可以延顺时针以90度的倍数旋转其子widget",
"categories": [
"Painting and effects"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/RotatedBox-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "ClipOval",
"description": "用椭圆剪辑其孩子的widget",
"categories": [
"Painting and effects"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/ClipOval-class.html",
"image": "<svg viewBox='0 0 100 100'><defs><clipPath id='clip-oval'><circle cx='40' cy='50' r='30'/></clipPath></defs><rect x='0' y='0' width='100' height='100' fill='#3949ab'/><rect x='30' y='10' width='60' height='50' fill='#4dd0e1' opacity='0.05'/><circle cx='40' cy='50' r='30' fill='#ffffff'/><rect x='30' y='10' width='60' height='50' fill='#4dd0e1' clip-path='url(#clip-oval)'/></svg>"
},
{
"name": "ClipPath",
"description": "用path剪辑其孩子的widget",
"categories": [
"Painting and effects"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/ClipPath-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "ClipRect",
"description": "用矩形剪辑其孩子的widget",
"categories": [
"Painting and effects"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/ClipRect-class.html",
"image": "<svg viewBox='0 0 100 100'><defs><clipPath id='clip-rect'><rect x='10' y='20' width='60' height='60'/></clipPath></defs><rect x='0' y='0' width='100' height='100' fill='#3949ab'/><rect x='30' y='10' width='60' height='50' fill='#4dd0e1' opacity='0.05'/><rect x='10' y='20' width='60' height='60' fill='#ffffff'/><rect x='30' y='10' width='60' height='50' fill='#4dd0e1' clip-path='url(#clip-rect)'/></svg>"
},
{
"name": "CustomPaint",
"description": "提供一个画布的widget,在绘制阶段可以在画布上绘制自定义图形",
"categories": [
"Painting and effects"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/CustomPaint-class.html",
"image": "<svg viewBox='0 0 100 100'><rect x='0' y='0' width='100' height='100' fill='#3949ab'/><rect x='20' y='20' width='60' height='60' fill='#ffffff'/><ellipse cx='40' cy='35' rx='10' ry='10' stroke-width='5' stroke='#4dd0e1' fill='transparent'/><ellipse cx='20' cy='71' rx='15' ry='20' stroke-width='5' stroke='#4dd0e1' fill='transparent' transform='rotate(-25)'/></svg>"
},
{
"name": "BackdropFilter",
"description": "一个widget,它将过滤器应用到现有的绘图内容,然后绘制孩子。这种效果是比较昂贵的,尤其是如果过滤器是non-local,如blur。",
"categories": [
"Painting and effects"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/BackdropFilter-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "Semantics",
"description": "一个widget,用以描述widget树的具体语义。使用辅助工具、搜索引擎和其他语义分析软件来确定应用程序的含义。",
"categories": [
"Accessibility"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/Semantics-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "MergeSemantics",
"description": "合并其后代语义的widget。",
"categories": [
"Accessibility"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/MergeSemantics-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "ExcludeSemantics",
"description": "删除其后代所有语义的widget",
"categories": [
"Accessibility"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/ExcludeSemantics-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "FutureBuilder",
"description": "基于与Future交互的最新快照来构建自身的widget",
"categories": [
"Async"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/FutureBuilder-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "StreamBuilder",
"description": "基于与流交互的最新快照构建自身的widget",
"categories": [
"Async"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/StreamBuilder-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "DecoratedBoxTransition",
"description": "DecoratedBox的动画版本,可以给它的Decoration不同属性使用动画",
"categories": [
"Animation and Motion"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/DecoratedBoxTransition-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "FadeTransition",
"description": "对透明度使用动画的widget",
"categories": [
"Animation and Motion"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/FadeTransition-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "PositionedTransition",
"description": "Positioned的动画版本,它需要一个特定的动画来将孩子的位置从动画的生命周期的起始位置移到结束位置。 ",
"categories": [
"Animation and Motion"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/PositionedTransition-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "RotationTransition",
"description": "对widget使用旋转动画",
"categories": [
"Animation and Motion"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/RotationTransition-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "ScaleTransition",
"description": "对widget使用缩放动画",
"categories": [
"Animation and Motion"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/ScaleTransition-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "SizeTransition",
"description": "Animates its own size and clips and aligns the child.",
"categories": [
"Animation and Motion"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/SizeTransition-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "SlideTransition",
"description": "对相对于其正常位置的某个位置之间使用动画",
"categories": [
"Animation and Motion"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/SlideTransition-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "AnimatedDefaultTextStyle",
"description": "在文本样式切换时使用动画",
"categories": [
"Animation and Motion"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/AnimatedDefaultTextStyle-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "AnimatedListState",
"sample": "AnimatedListState_index",
"description": "动画列表的state",
"categories": [
"Animation and Motion"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/AnimatedListState-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "AnimatedModalBarrier",
"description": "一个阻止用户与widget交互的widget",
"categories": [
"Animation and Motion"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/AnimatedModalBarrier-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "AnimatedOpacity",
"description": "Opacity的动画版本,在给定的透明度变化时,自动地在给定的一段时间内改变孩子的Opacity",
"categories": [
"Animation and Motion"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/AnimatedOpacity-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "AnimatedPhysicalModel",
"description": "PhysicalModel的动画版本",
"categories": [
"Animation and Motion"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/AnimatedPhysicalModel-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "AnimatedPositioned",
"description": "动画版本的Positioned,每当给定位置的变化,自动在给定的时间内转换孩子的位置。",
"categories": [
"Animation and Motion"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/AnimatedPositioned-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "AnimatedSize",
"description": "动画widget,当给定的孩子的大小变化时,它自动地在给定时间内转换它的大小。",
"categories": [
"Animation and Motion"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/AnimatedSize-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "AnimatedWidget",
"description": "当给定的Listenable改变值时,会重新构建该widget",
"categories": [
"Animation and Motion"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/AnimatedWidget-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
},
{
"name": "AnimatedWidgetBaseState",
"description": "具有隐式动画的widget的基类",
"categories": [
"Animation and Motion"
],
"subcategories": [
],
"link": "https://docs.flutter.io/flutter/widgets/AnimatedWidgetBaseState-class.html",
"image": "<img alt='' src='/images/catalog-widget-placeholder.png'>"
}
]
|
{
"pile_set_name": "Github"
}
|
Delivered on December 15, 2010, at the Washington State Convention Center in Seattle, Washington, as part of the Continuing Legal Education seminar (CLE) "Attorney's Guide to Legal Research Strategies On- and Offline." ...more
Under the newly announced guidelines, certain DRM circumvention is permissible as long as it is for a purpose otherwise permitted by copyright law. Highly valuable to educational institutions, students, documentery...more
|
{
"pile_set_name": "Pile-CC"
}
|
Q:
What are the impacts of allowing a Warcaster to cast spells with material components while wielding a shield and spear?
The general consensus on this site is that the Warcaster feat does not grant the ability to cast spells with material components when wielding two pieces of equipment because the caster needs a free hand to interact with their arcane focus or pouch.
Assuming the spellcaster is using an arcane focus, would there be significant balance ramifications to lifting this limitation?
This would essentially amount to saying that the Warcaster feat grants the spellcaster the dexterity to interact with their arcane focus when wielding two pieces of equipment.
In my experience, I've found that material components are functionally equivalent to somatic components in every case except those where GP-equivalent components are consumed. So right now I can't see any immediate negative effects of lifting this limitation. Am I missing anything?
For additional context, the spellcaster in question is a Warlock in my campaign that's using a combination of the Warcaster and Polearm Master feats while wielding a shield and spear.
Additionally, my group tends to be very flexible and lax with components, typically treating them as little more than "flavored" somatic components, except in the case where the components are consumed.
A:
The solution to your problem is Ruby of the Warmage.
This is a Common magical item (from Xanathar's Guide to Everything). When it is inserted into a weapon (the spear) and the attunement is completed, the weapon acts as a spell focus.
That way, you don't have to mess with any of the rules or feats or spell casting features.
For additional context, the spellcaster in question is a Warlock in my
campaign that's using a combination of the Warcaster and Polearm
Master feats while wielding a shield and spear.
Clerics and Paladins don't have this problem, since they can use their shield as a holy symbol, but your Warlock is not able to do that. A few other points:
The Warlock takes the Improved Pact weapon invocation which allows the use of a weapon as a spell casting focus.
If there are Artificers in your campaign - Artificers can have a common magical item (including the ruby or the war mage) as one of their infusions from the Artificer class feature Replicate Magic Item. They can give it to other party members.
Given the mechanical solution ...
... it would not be game breaking to "just do it" at your table.
Experience. I have only been at two tables where material component requirements have been strictly enforced, and two where they were now and again raised by the DM, though mostly those had to do with the costly / consumed material components. At a couple of tables they were virtually ignored and we didn't miss them. It didn't seem to have much, if any, impact on play other than avoiding the occasional "what hand is your focus in?" question from a DM. At a stricter table, being unable to use a weapon or a shield may have a greater impact on play during combat.
A couple of ways ahead:
You may choose to reduce attunement slots by one if you want to roughly reflect the "penalty" that the Ruby of the War Mage attunement slot costs.
However, as your table seems to be quite flexible
The attunement slot "penalty" doesn't seem to fit your table's
style, so I'd recommend against it.
Additionally, my group tends to be very flexible and lax with components, typically treating them as little more than "flavored" somatic components, except in the case where the components are consumed.
|
{
"pile_set_name": "StackExchange"
}
|
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by jni4net. See http://jni4net.sourceforge.net/
// Runtime Version:2.0.50727.5446
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace java.lang {
#region Component Designer generated code
[global::net.sf.jni4net.attributes.JavaClassAttribute()]
[global::System.SerializableAttribute()]
public partial class ClassNotFoundException : global::java.lang.Exception {
internal new static global::java.lang.Class staticClass;
internal static global::net.sf.jni4net.jni.MethodId j4n_getException0;
internal static global::net.sf.jni4net.jni.MethodId j4n__ctorClassNotFoundException1;
internal static global::net.sf.jni4net.jni.MethodId j4n__ctorClassNotFoundException2;
internal static global::net.sf.jni4net.jni.MethodId j4n__ctorClassNotFoundException3;
[global::net.sf.jni4net.attributes.JavaMethodAttribute("(Ljava/lang/String;)V")]
public ClassNotFoundException(global::java.lang.String par0) :
base(((global::net.sf.jni4net.jni.JNIEnv)(null))) {
global::net.sf.jni4net.jni.JNIEnv @__env = global::net.sf.jni4net.jni.JNIEnv.ThreadEnv;
using(new global::net.sf.jni4net.jni.LocalFrame(@__env, 12)){
@__env.NewObject(global::java.lang.ClassNotFoundException.staticClass, global::java.lang.ClassNotFoundException.j4n__ctorClassNotFoundException1, this, global::net.sf.jni4net.utils.Convertor.ParStrongCp2J(par0));
}
}
[global::net.sf.jni4net.attributes.JavaMethodAttribute("(Ljava/lang/String;Ljava/lang/Throwable;)V")]
public ClassNotFoundException(global::java.lang.String par0, global::java.lang.Throwable par1) :
base(((global::net.sf.jni4net.jni.JNIEnv)(null))) {
global::net.sf.jni4net.jni.JNIEnv @__env = global::net.sf.jni4net.jni.JNIEnv.ThreadEnv;
using(new global::net.sf.jni4net.jni.LocalFrame(@__env, 14)){
@__env.NewObject(global::java.lang.ClassNotFoundException.staticClass, global::java.lang.ClassNotFoundException.j4n__ctorClassNotFoundException2, this, global::net.sf.jni4net.utils.Convertor.ParStrongCp2J(par0), global::net.sf.jni4net.utils.Convertor.ParFullC2J<global::java.lang.Throwable>(@__env, par1));
}
}
[global::net.sf.jni4net.attributes.JavaMethodAttribute("()V")]
public ClassNotFoundException() :
base(((global::net.sf.jni4net.jni.JNIEnv)(null))) {
global::net.sf.jni4net.jni.JNIEnv @__env = global::net.sf.jni4net.jni.JNIEnv.ThreadEnv;
using(new global::net.sf.jni4net.jni.LocalFrame(@__env, 10)){
@__env.NewObject(global::java.lang.ClassNotFoundException.staticClass, global::java.lang.ClassNotFoundException.j4n__ctorClassNotFoundException3, this);
}
}
protected ClassNotFoundException(global::net.sf.jni4net.jni.JNIEnv @__env) :
base(@__env) {
}
protected ClassNotFoundException(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) :
base(info, context) {
}
public new static global::java.lang.Class _class {
get {
return global::java.lang.ClassNotFoundException.staticClass;
}
}
private static void InitJNI(global::net.sf.jni4net.jni.JNIEnv @__env, java.lang.Class @__class) {
global::java.lang.ClassNotFoundException.staticClass = @__class;
global::java.lang.ClassNotFoundException.j4n_getException0 = @__env.GetMethodID(global::java.lang.ClassNotFoundException.staticClass, "getException", "()Ljava/lang/Throwable;");
global::java.lang.ClassNotFoundException.j4n__ctorClassNotFoundException1 = @__env.GetMethodID(global::java.lang.ClassNotFoundException.staticClass, "<init>", "(Ljava/lang/String;)V");
global::java.lang.ClassNotFoundException.j4n__ctorClassNotFoundException2 = @__env.GetMethodID(global::java.lang.ClassNotFoundException.staticClass, "<init>", "(Ljava/lang/String;Ljava/lang/Throwable;)V");
global::java.lang.ClassNotFoundException.j4n__ctorClassNotFoundException3 = @__env.GetMethodID(global::java.lang.ClassNotFoundException.staticClass, "<init>", "()V");
}
[global::net.sf.jni4net.attributes.JavaMethodAttribute("()Ljava/lang/Throwable;")]
public virtual global::java.lang.Throwable getException() {
global::net.sf.jni4net.jni.JNIEnv @__env = this.Env;
using(new global::net.sf.jni4net.jni.LocalFrame(@__env, 10)){
return global::net.sf.jni4net.utils.Convertor.FullJ2C<global::java.lang.Throwable>(@__env, @__env.CallObjectMethodPtr(this, global::java.lang.ClassNotFoundException.j4n_getException0));
}
}
new internal sealed class ContructionHelper : global::net.sf.jni4net.utils.IConstructionHelper {
public global::net.sf.jni4net.jni.IJvmProxy CreateProxy(global::net.sf.jni4net.jni.JNIEnv @__env) {
return new global::java.lang.ClassNotFoundException(@__env);
}
}
}
#endregion
}
|
{
"pile_set_name": "Github"
}
|
/*
*
* Copyright 2015 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#include <grpc/support/port_platform.h>
#include "src/core/lib/security/credentials/oauth2/oauth2_credentials.h"
#include <string.h>
#include "src/core/lib/security/util/json_util.h"
#include "src/core/lib/surface/api_trace.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
//
// Auth Refresh Token.
//
int grpc_auth_refresh_token_is_valid(
const grpc_auth_refresh_token* refresh_token) {
return (refresh_token != nullptr) &&
strcmp(refresh_token->type, GRPC_AUTH_JSON_TYPE_INVALID);
}
grpc_auth_refresh_token grpc_auth_refresh_token_create_from_json(
const grpc_json* json) {
grpc_auth_refresh_token result;
const char* prop_value;
int success = 0;
memset(&result, 0, sizeof(grpc_auth_refresh_token));
result.type = GRPC_AUTH_JSON_TYPE_INVALID;
if (json == nullptr) {
gpr_log(GPR_ERROR, "Invalid json.");
goto end;
}
prop_value = grpc_json_get_string_property(json, "type");
if (prop_value == nullptr ||
strcmp(prop_value, GRPC_AUTH_JSON_TYPE_AUTHORIZED_USER)) {
goto end;
}
result.type = GRPC_AUTH_JSON_TYPE_AUTHORIZED_USER;
if (!grpc_copy_json_string_property(json, "client_secret",
&result.client_secret) ||
!grpc_copy_json_string_property(json, "client_id", &result.client_id) ||
!grpc_copy_json_string_property(json, "refresh_token",
&result.refresh_token)) {
goto end;
}
success = 1;
end:
if (!success) grpc_auth_refresh_token_destruct(&result);
return result;
}
grpc_auth_refresh_token grpc_auth_refresh_token_create_from_string(
const char* json_string) {
char* scratchpad = gpr_strdup(json_string);
grpc_json* json = grpc_json_parse_string(scratchpad);
grpc_auth_refresh_token result =
grpc_auth_refresh_token_create_from_json(json);
if (json != nullptr) grpc_json_destroy(json);
gpr_free(scratchpad);
return result;
}
void grpc_auth_refresh_token_destruct(grpc_auth_refresh_token* refresh_token) {
if (refresh_token == nullptr) return;
refresh_token->type = GRPC_AUTH_JSON_TYPE_INVALID;
if (refresh_token->client_id != nullptr) {
gpr_free(refresh_token->client_id);
refresh_token->client_id = nullptr;
}
if (refresh_token->client_secret != nullptr) {
gpr_free(refresh_token->client_secret);
refresh_token->client_secret = nullptr;
}
if (refresh_token->refresh_token != nullptr) {
gpr_free(refresh_token->refresh_token);
refresh_token->refresh_token = nullptr;
}
}
//
// Oauth2 Token Fetcher credentials.
//
static void oauth2_token_fetcher_destruct(grpc_call_credentials* creds) {
grpc_oauth2_token_fetcher_credentials* c =
reinterpret_cast<grpc_oauth2_token_fetcher_credentials*>(creds);
GRPC_MDELEM_UNREF(c->access_token_md);
gpr_mu_destroy(&c->mu);
grpc_pollset_set_destroy(grpc_polling_entity_pollset_set(&c->pollent));
grpc_httpcli_context_destroy(&c->httpcli_context);
}
grpc_credentials_status
grpc_oauth2_token_fetcher_credentials_parse_server_response(
const grpc_http_response* response, grpc_mdelem* token_md,
grpc_millis* token_lifetime) {
char* null_terminated_body = nullptr;
char* new_access_token = nullptr;
grpc_credentials_status status = GRPC_CREDENTIALS_OK;
grpc_json* json = nullptr;
if (response == nullptr) {
gpr_log(GPR_ERROR, "Received NULL response.");
status = GRPC_CREDENTIALS_ERROR;
goto end;
}
if (response->body_length > 0) {
null_terminated_body =
static_cast<char*>(gpr_malloc(response->body_length + 1));
null_terminated_body[response->body_length] = '\0';
memcpy(null_terminated_body, response->body, response->body_length);
}
if (response->status != 200) {
gpr_log(GPR_ERROR, "Call to http server ended with error %d [%s].",
response->status,
null_terminated_body != nullptr ? null_terminated_body : "");
status = GRPC_CREDENTIALS_ERROR;
goto end;
} else {
grpc_json* access_token = nullptr;
grpc_json* token_type = nullptr;
grpc_json* expires_in = nullptr;
grpc_json* ptr;
json = grpc_json_parse_string(null_terminated_body);
if (json == nullptr) {
gpr_log(GPR_ERROR, "Could not parse JSON from %s", null_terminated_body);
status = GRPC_CREDENTIALS_ERROR;
goto end;
}
if (json->type != GRPC_JSON_OBJECT) {
gpr_log(GPR_ERROR, "Response should be a JSON object");
status = GRPC_CREDENTIALS_ERROR;
goto end;
}
for (ptr = json->child; ptr; ptr = ptr->next) {
if (strcmp(ptr->key, "access_token") == 0) {
access_token = ptr;
} else if (strcmp(ptr->key, "token_type") == 0) {
token_type = ptr;
} else if (strcmp(ptr->key, "expires_in") == 0) {
expires_in = ptr;
}
}
if (access_token == nullptr || access_token->type != GRPC_JSON_STRING) {
gpr_log(GPR_ERROR, "Missing or invalid access_token in JSON.");
status = GRPC_CREDENTIALS_ERROR;
goto end;
}
if (token_type == nullptr || token_type->type != GRPC_JSON_STRING) {
gpr_log(GPR_ERROR, "Missing or invalid token_type in JSON.");
status = GRPC_CREDENTIALS_ERROR;
goto end;
}
if (expires_in == nullptr || expires_in->type != GRPC_JSON_NUMBER) {
gpr_log(GPR_ERROR, "Missing or invalid expires_in in JSON.");
status = GRPC_CREDENTIALS_ERROR;
goto end;
}
gpr_asprintf(&new_access_token, "%s %s", token_type->value,
access_token->value);
*token_lifetime = strtol(expires_in->value, nullptr, 10) * GPR_MS_PER_SEC;
if (!GRPC_MDISNULL(*token_md)) GRPC_MDELEM_UNREF(*token_md);
*token_md = grpc_mdelem_from_slices(
grpc_slice_from_static_string(GRPC_AUTHORIZATION_METADATA_KEY),
grpc_slice_from_copied_string(new_access_token));
status = GRPC_CREDENTIALS_OK;
}
end:
if (status != GRPC_CREDENTIALS_OK && !GRPC_MDISNULL(*token_md)) {
GRPC_MDELEM_UNREF(*token_md);
*token_md = GRPC_MDNULL;
}
if (null_terminated_body != nullptr) gpr_free(null_terminated_body);
if (new_access_token != nullptr) gpr_free(new_access_token);
if (json != nullptr) grpc_json_destroy(json);
return status;
}
static void on_oauth2_token_fetcher_http_response(void* user_data,
grpc_error* error) {
GRPC_LOG_IF_ERROR("oauth_fetch", GRPC_ERROR_REF(error));
grpc_credentials_metadata_request* r =
static_cast<grpc_credentials_metadata_request*>(user_data);
grpc_oauth2_token_fetcher_credentials* c =
reinterpret_cast<grpc_oauth2_token_fetcher_credentials*>(r->creds);
grpc_mdelem access_token_md = GRPC_MDNULL;
grpc_millis token_lifetime;
grpc_credentials_status status =
grpc_oauth2_token_fetcher_credentials_parse_server_response(
&r->response, &access_token_md, &token_lifetime);
// Update cache and grab list of pending requests.
gpr_mu_lock(&c->mu);
c->token_fetch_pending = false;
c->access_token_md = GRPC_MDELEM_REF(access_token_md);
c->token_expiration = status == GRPC_CREDENTIALS_OK
? grpc_core::ExecCtx::Get()->Now() + token_lifetime
: 0;
grpc_oauth2_pending_get_request_metadata* pending_request =
c->pending_requests;
c->pending_requests = nullptr;
gpr_mu_unlock(&c->mu);
// Invoke callbacks for all pending requests.
while (pending_request != nullptr) {
if (status == GRPC_CREDENTIALS_OK) {
grpc_credentials_mdelem_array_add(pending_request->md_array,
access_token_md);
} else {
error = GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
"Error occured when fetching oauth2 token.", &error, 1);
}
GRPC_CLOSURE_SCHED(pending_request->on_request_metadata, error);
grpc_polling_entity_del_from_pollset_set(
pending_request->pollent, grpc_polling_entity_pollset_set(&c->pollent));
grpc_oauth2_pending_get_request_metadata* prev = pending_request;
pending_request = pending_request->next;
gpr_free(prev);
}
GRPC_MDELEM_UNREF(access_token_md);
grpc_call_credentials_unref(r->creds);
grpc_credentials_metadata_request_destroy(r);
}
static bool oauth2_token_fetcher_get_request_metadata(
grpc_call_credentials* creds, grpc_polling_entity* pollent,
grpc_auth_metadata_context context, grpc_credentials_mdelem_array* md_array,
grpc_closure* on_request_metadata, grpc_error** error) {
grpc_oauth2_token_fetcher_credentials* c =
reinterpret_cast<grpc_oauth2_token_fetcher_credentials*>(creds);
// Check if we can use the cached token.
grpc_millis refresh_threshold =
GRPC_SECURE_TOKEN_REFRESH_THRESHOLD_SECS * GPR_MS_PER_SEC;
grpc_mdelem cached_access_token_md = GRPC_MDNULL;
gpr_mu_lock(&c->mu);
if (!GRPC_MDISNULL(c->access_token_md) &&
(c->token_expiration - grpc_core::ExecCtx::Get()->Now() >
refresh_threshold)) {
cached_access_token_md = GRPC_MDELEM_REF(c->access_token_md);
}
if (!GRPC_MDISNULL(cached_access_token_md)) {
gpr_mu_unlock(&c->mu);
grpc_credentials_mdelem_array_add(md_array, cached_access_token_md);
GRPC_MDELEM_UNREF(cached_access_token_md);
return true;
}
// Couldn't get the token from the cache.
// Add request to c->pending_requests and start a new fetch if needed.
grpc_oauth2_pending_get_request_metadata* pending_request =
static_cast<grpc_oauth2_pending_get_request_metadata*>(
gpr_malloc(sizeof(*pending_request)));
pending_request->md_array = md_array;
pending_request->on_request_metadata = on_request_metadata;
pending_request->pollent = pollent;
grpc_polling_entity_add_to_pollset_set(
pollent, grpc_polling_entity_pollset_set(&c->pollent));
pending_request->next = c->pending_requests;
c->pending_requests = pending_request;
bool start_fetch = false;
if (!c->token_fetch_pending) {
c->token_fetch_pending = true;
start_fetch = true;
}
gpr_mu_unlock(&c->mu);
if (start_fetch) {
grpc_call_credentials_ref(creds);
c->fetch_func(grpc_credentials_metadata_request_create(creds),
&c->httpcli_context, &c->pollent,
on_oauth2_token_fetcher_http_response,
grpc_core::ExecCtx::Get()->Now() + refresh_threshold);
}
return false;
}
static void oauth2_token_fetcher_cancel_get_request_metadata(
grpc_call_credentials* creds, grpc_credentials_mdelem_array* md_array,
grpc_error* error) {
grpc_oauth2_token_fetcher_credentials* c =
reinterpret_cast<grpc_oauth2_token_fetcher_credentials*>(creds);
gpr_mu_lock(&c->mu);
grpc_oauth2_pending_get_request_metadata* prev = nullptr;
grpc_oauth2_pending_get_request_metadata* pending_request =
c->pending_requests;
while (pending_request != nullptr) {
if (pending_request->md_array == md_array) {
// Remove matching pending request from the list.
if (prev != nullptr) {
prev->next = pending_request->next;
} else {
c->pending_requests = pending_request->next;
}
// Invoke the callback immediately with an error.
GRPC_CLOSURE_SCHED(pending_request->on_request_metadata,
GRPC_ERROR_REF(error));
gpr_free(pending_request);
break;
}
prev = pending_request;
pending_request = pending_request->next;
}
gpr_mu_unlock(&c->mu);
GRPC_ERROR_UNREF(error);
}
static void init_oauth2_token_fetcher(grpc_oauth2_token_fetcher_credentials* c,
grpc_fetch_oauth2_func fetch_func) {
memset(c, 0, sizeof(grpc_oauth2_token_fetcher_credentials));
c->base.type = GRPC_CALL_CREDENTIALS_TYPE_OAUTH2;
gpr_ref_init(&c->base.refcount, 1);
gpr_mu_init(&c->mu);
c->token_expiration = 0;
c->fetch_func = fetch_func;
c->pollent =
grpc_polling_entity_create_from_pollset_set(grpc_pollset_set_create());
grpc_httpcli_context_init(&c->httpcli_context);
}
//
// Google Compute Engine credentials.
//
static grpc_call_credentials_vtable compute_engine_vtable = {
oauth2_token_fetcher_destruct, oauth2_token_fetcher_get_request_metadata,
oauth2_token_fetcher_cancel_get_request_metadata};
static void compute_engine_fetch_oauth2(
grpc_credentials_metadata_request* metadata_req,
grpc_httpcli_context* httpcli_context, grpc_polling_entity* pollent,
grpc_iomgr_cb_func response_cb, grpc_millis deadline) {
grpc_http_header header = {(char*)"Metadata-Flavor", (char*)"Google"};
grpc_httpcli_request request;
memset(&request, 0, sizeof(grpc_httpcli_request));
request.host = (char*)GRPC_COMPUTE_ENGINE_METADATA_HOST;
request.http.path = (char*)GRPC_COMPUTE_ENGINE_METADATA_TOKEN_PATH;
request.http.hdr_count = 1;
request.http.hdrs = &header;
/* TODO(ctiller): Carry the resource_quota in ctx and share it with the host
channel. This would allow us to cancel an authentication query when under
extreme memory pressure. */
grpc_resource_quota* resource_quota =
grpc_resource_quota_create("oauth2_credentials");
grpc_httpcli_get(
httpcli_context, pollent, resource_quota, &request, deadline,
GRPC_CLOSURE_CREATE(response_cb, metadata_req, grpc_schedule_on_exec_ctx),
&metadata_req->response);
grpc_resource_quota_unref_internal(resource_quota);
}
grpc_call_credentials* grpc_google_compute_engine_credentials_create(
void* reserved) {
grpc_oauth2_token_fetcher_credentials* c =
static_cast<grpc_oauth2_token_fetcher_credentials*>(
gpr_malloc(sizeof(grpc_oauth2_token_fetcher_credentials)));
GRPC_API_TRACE("grpc_compute_engine_credentials_create(reserved=%p)", 1,
(reserved));
GPR_ASSERT(reserved == nullptr);
init_oauth2_token_fetcher(c, compute_engine_fetch_oauth2);
c->base.vtable = &compute_engine_vtable;
return &c->base;
}
//
// Google Refresh Token credentials.
//
static void refresh_token_destruct(grpc_call_credentials* creds) {
grpc_google_refresh_token_credentials* c =
reinterpret_cast<grpc_google_refresh_token_credentials*>(creds);
grpc_auth_refresh_token_destruct(&c->refresh_token);
oauth2_token_fetcher_destruct(&c->base.base);
}
static grpc_call_credentials_vtable refresh_token_vtable = {
refresh_token_destruct, oauth2_token_fetcher_get_request_metadata,
oauth2_token_fetcher_cancel_get_request_metadata};
static void refresh_token_fetch_oauth2(
grpc_credentials_metadata_request* metadata_req,
grpc_httpcli_context* httpcli_context, grpc_polling_entity* pollent,
grpc_iomgr_cb_func response_cb, grpc_millis deadline) {
grpc_google_refresh_token_credentials* c =
reinterpret_cast<grpc_google_refresh_token_credentials*>(
metadata_req->creds);
grpc_http_header header = {(char*)"Content-Type",
(char*)"application/x-www-form-urlencoded"};
grpc_httpcli_request request;
char* body = nullptr;
gpr_asprintf(&body, GRPC_REFRESH_TOKEN_POST_BODY_FORMAT_STRING,
c->refresh_token.client_id, c->refresh_token.client_secret,
c->refresh_token.refresh_token);
memset(&request, 0, sizeof(grpc_httpcli_request));
request.host = (char*)GRPC_GOOGLE_OAUTH2_SERVICE_HOST;
request.http.path = (char*)GRPC_GOOGLE_OAUTH2_SERVICE_TOKEN_PATH;
request.http.hdr_count = 1;
request.http.hdrs = &header;
request.handshaker = &grpc_httpcli_ssl;
/* TODO(ctiller): Carry the resource_quota in ctx and share it with the host
channel. This would allow us to cancel an authentication query when under
extreme memory pressure. */
grpc_resource_quota* resource_quota =
grpc_resource_quota_create("oauth2_credentials_refresh");
grpc_httpcli_post(
httpcli_context, pollent, resource_quota, &request, body, strlen(body),
deadline,
GRPC_CLOSURE_CREATE(response_cb, metadata_req, grpc_schedule_on_exec_ctx),
&metadata_req->response);
grpc_resource_quota_unref_internal(resource_quota);
gpr_free(body);
}
grpc_call_credentials*
grpc_refresh_token_credentials_create_from_auth_refresh_token(
grpc_auth_refresh_token refresh_token) {
grpc_google_refresh_token_credentials* c;
if (!grpc_auth_refresh_token_is_valid(&refresh_token)) {
gpr_log(GPR_ERROR, "Invalid input for refresh token credentials creation");
return nullptr;
}
c = static_cast<grpc_google_refresh_token_credentials*>(
gpr_zalloc(sizeof(grpc_google_refresh_token_credentials)));
init_oauth2_token_fetcher(&c->base, refresh_token_fetch_oauth2);
c->base.base.vtable = &refresh_token_vtable;
c->refresh_token = refresh_token;
return &c->base.base;
}
static char* create_loggable_refresh_token(grpc_auth_refresh_token* token) {
if (strcmp(token->type, GRPC_AUTH_JSON_TYPE_INVALID) == 0) {
return gpr_strdup("<Invalid json token>");
}
char* loggable_token = nullptr;
gpr_asprintf(&loggable_token,
"{\n type: %s\n client_id: %s\n client_secret: "
"<redacted>\n refresh_token: <redacted>\n}",
token->type, token->client_id);
return loggable_token;
}
grpc_call_credentials* grpc_google_refresh_token_credentials_create(
const char* json_refresh_token, void* reserved) {
grpc_auth_refresh_token token =
grpc_auth_refresh_token_create_from_string(json_refresh_token);
if (grpc_api_trace.enabled()) {
char* loggable_token = create_loggable_refresh_token(&token);
gpr_log(GPR_INFO,
"grpc_refresh_token_credentials_create(json_refresh_token=%s, "
"reserved=%p)",
loggable_token, reserved);
gpr_free(loggable_token);
}
GPR_ASSERT(reserved == nullptr);
return grpc_refresh_token_credentials_create_from_auth_refresh_token(token);
}
//
// Oauth2 Access Token credentials.
//
static void access_token_destruct(grpc_call_credentials* creds) {
grpc_access_token_credentials* c =
reinterpret_cast<grpc_access_token_credentials*>(creds);
GRPC_MDELEM_UNREF(c->access_token_md);
}
static bool access_token_get_request_metadata(
grpc_call_credentials* creds, grpc_polling_entity* pollent,
grpc_auth_metadata_context context, grpc_credentials_mdelem_array* md_array,
grpc_closure* on_request_metadata, grpc_error** error) {
grpc_access_token_credentials* c =
reinterpret_cast<grpc_access_token_credentials*>(creds);
grpc_credentials_mdelem_array_add(md_array, c->access_token_md);
return true;
}
static void access_token_cancel_get_request_metadata(
grpc_call_credentials* c, grpc_credentials_mdelem_array* md_array,
grpc_error* error) {
GRPC_ERROR_UNREF(error);
}
static grpc_call_credentials_vtable access_token_vtable = {
access_token_destruct, access_token_get_request_metadata,
access_token_cancel_get_request_metadata};
grpc_call_credentials* grpc_access_token_credentials_create(
const char* access_token, void* reserved) {
grpc_access_token_credentials* c =
static_cast<grpc_access_token_credentials*>(
gpr_zalloc(sizeof(grpc_access_token_credentials)));
GRPC_API_TRACE(
"grpc_access_token_credentials_create(access_token=<redacted>, "
"reserved=%p)",
1, (reserved));
GPR_ASSERT(reserved == nullptr);
c->base.type = GRPC_CALL_CREDENTIALS_TYPE_OAUTH2;
c->base.vtable = &access_token_vtable;
gpr_ref_init(&c->base.refcount, 1);
char* token_md_value;
gpr_asprintf(&token_md_value, "Bearer %s", access_token);
grpc_core::ExecCtx exec_ctx;
c->access_token_md = grpc_mdelem_from_slices(
grpc_slice_from_static_string(GRPC_AUTHORIZATION_METADATA_KEY),
grpc_slice_from_copied_string(token_md_value));
gpr_free(token_md_value);
return &c->base;
}
|
{
"pile_set_name": "Github"
}
|
Cardiovascular risk markers among obese women using the levonorgestrel-releasing intrauterine system: A randomised controlled trial.
According to international guidelines, women with obesity without other comorbidities can safely use any hormonal contraceptive (HC). However, limited information is available about contraceptive safety for women with obesity since obesity is an exclusion criterion of most contraceptive clinical trials. As such little is known about the possible risks of HC exposure for women with obesity without comorbidities. One way to assess possible long-term risks in this population, even prior to the development of any clinical disease, is to measure alterations in subclinical atherosclerosis markers. We evaluated the effects of the levonorgestrel-releasing intrauterine system (LNG-IUS) on subclinical markers of cardiovascular risk in women with obesity. This is a randomised clinical trial in which 106 women with obesity [body mass index (BMI)≥30kg/m2] were randomised to the LNG-IUS (n=53) or to non-hormonal methods (n=53) and followed for 12 months. We evaluated waist circumference (WC), blood pressure, blood glucose, insulin, lipid profile, and endothelial function markers (carotid intima-media thickness, brachial artery flow-mediated dilation, and carotid arterial stiffness). At 12 months, BMI (p=0.005), WC (p=0.045), and glucose levels (p=0.015) were significantly lower in the LNG-IUS group than in the control group. We did not find any clinically relevant changes in subclinical markers of cardiovascular risk among with obesity women at 12 months after LNG-IUS placement compared to users of non-hormonal contraceptive methods.
|
{
"pile_set_name": "PubMed Abstracts"
}
|
Grand Theft Auto V
The fifth installment of Rockstar's Grand Theft Auto series promises to be, fittingly, five times the size of Red Dead Redemption's open world, suggesting at least five cousins who insist on playing pool with you while you're trying to do something, who then get five times as mad when you turn them down. Or maybe not: The latest chapter in the series marks a return to the California stand-in of San Andreas—specifically the faux-L.A. of Los Santos, with its sprawling hills, beaches, and tennis courts where you can slaughter people—and with three playable protagonists with varying degrees of sociopathic tendencies, it's probable you'll be way too busy pulling off elaborate heists and flying jets and stuff to bother with trying to foster friendships. (Still, the family of that one "retired" bank robber guy looks kinda needy.)
|
{
"pile_set_name": "Pile-CC"
}
|
Missense mutations in the rod domain of the lamin A/C gene as causes of dilated cardiomyopathy and conduction-system disease.
Inherited mutations cause approximately 35 percent of cases of dilated cardiomyopathy; however, few genes associated with this disease have been identified. Previously, we located a gene defect that was responsible for autosomal dominant dilated cardiomyopathy and conduction-system disease on chromosome 1p1-q21, where nuclear-envelope proteins lamin A and lamin C are encoded by the LMNA (lamin A/C) gene. Mutations in the head or tail domain of this gene cause Emery-Dreifuss muscular dystrophy, a childhood-onset disease characterized by joint contractures and in some cases by abnormalities of cardiac conduction during adulthood. We evaluated 11 families with autosomal dominant dilated cardiomyopathy and conduction-system disease. Sequences of the lamin A/C exons were determined in probands from each family, and variants were confirmed by restriction-enzyme digestion. The genotypes of the family members were ascertained. Five novel missense mutations were identified: four in the alpha-helical-rod domain of the lamin A/C gene, and one in the lamin C tail domain. Each mutation caused heritable, progressive conduction-system disease (sinus bradycardia, atrioventricular conduction block, or atrial arrhythmias) and dilated cardiomyopathy. Heart failure and sudden death occurred frequently within these families. No family members with mutations had either joint contractures or skeletal myopathy. Serum creatine kinase levels were normal in family members with mutations of the lamin rod but mildly elevated in some family members with a defect in the tail domain of lamin C. Genetic defects in distinct domains of the nuclear-envelope proteins lamin A and lamin C selectively cause dilated cardiomyopathy with conduction-system disease or autosomal dominant Emery-Dreifuss muscular dystrophy. Missense mutations in the rod domain of the lamin A/C gene provide a genetic cause for dilated cardiomyopathy and indicate that this intermediate filament protein has an important role in cardiac conduction and contractility.
|
{
"pile_set_name": "PubMed Abstracts"
}
|
---
abstract: 'We show that if a polarised manifold admits an extremal metric then it is K-polystable relative to a maximal torus of automorphisms.'
address:
- 'Department of Pure Mathematics and Mathematical Statistics, University of Cambridge, Wilberforce Road, Cambridge CB3 0WB, UK'
- 'Columbia University, Department of Mathematics, 2990 Broadway New York, NY 10027, USA'
author:
- 'J. Stoppa and G. Székelyhidi^^'
title: 'Relative K-stability of extremal metrics'
---
Introduction
============
Calabi [@Cal82] introduced the notion of extremal metrics as candidates for canonical representatives of Kähler classes on compact Kähler manifolds. Unfortunately not all Kähler manifolds admit extremal metrics (eg. Levine [@Lev]) and even if they do, they may not admit them in all Kähler classes (see eg. Apostolov, Calderbank, Gauduchon, Tønnesen-Friedman [@ACGT3]). This makes the question of existence of extremal metrics quite delicate and there is now a vast literature on the topic. We refer to Phong-Sturm [@PS] for a recent survey and an extensive bibliography.
By definition an extremal metric is a Kähler metric whose scalar curvature has holomorphic gradient vector field. Thus, special cases are constant scalar curvature Kähler (or cscK) metrics and Kähler-Einstein metrics. While one can study these metrics in arbitrary Kähler classes, perhaps the most interesting case is when the Kähler class is the first Chern class of an ample line bundle. Indeed, existence of a cscK metric on a manifold $M$ in the Kähler class $c_1(L)$ for an ample line bundle $L$, is expected to be closely related to algebro-geometric properties of the polarised manifold $(M,L)$. This is expressed by the following.
\[conj:1\] The manifold $M$ admits a cscK metric in the class $c_1(L)$ if and only if the pair $(M,L)$ is K-polystable.
The notion of K-polystability will be recalled below. Building on the K-semistability proved by Donaldson [@Don05] and on the work of Arezzo-Pacard [@AP06] on blowing up cscK metrics, the first named author completed the proof of one direction of this conjecture, under the assumption that the automorphism group of $(M,L)$ is discrete.
If $M$ admits a cscK metric in $c_1(L)$ and $\mathrm{Aut}(M,L)$ is discrete, then $(M,L)$ is K-polystable.
Using a different approach, this was recently extended to manifolds with not necessarily discrete automorphism groups by Mabuchi [@Mab1], [@Mab2]. The aim of the present paper is to generalise this theorem to the case of extremal metrics. In this case the conjecture analogous to Conjecture \[conj:1\] was formulated by the second named author in [@GSz04].
\[conj:2\] The manifold $M$ admits an extremal metric in the class $c_1(L)$ if and only if the pair $(M,L)$ is K-polystable relative to a maximal torus of automorphisms of $(M,L)$.
By generalising the approach in [@Sto08] we obtain the following, which is the main result of this paper.
\[thm:main\] If $M$ admits an extremal metric in $c_1(L)$ then $(M,L)$ is K-polystable relative to a maximal torus of automorphisms of $(M,L)$.
In particular the theorem applies when $M$ admits a cscK metric and has continuous automorphisms, proving that $M$ is K-polystable with respect to all test- configurations that commute with a maximal torus of automorphisms, but note that this is a priori a weaker condition than K-polystability (see the next section for the detailed definitions).
Note that by an example in [@ACGT3] relative K-polystability may not be sufficient to ensure the existence of an extremal metric, so it is likely that the conjectures \[conj:1\] and \[conj:2\] have to be refined.
Acknowledgements {#acknowledgements .unnumbered}
----------------
We would like to thank Julius Ross and Richard Thomas for helpful discussions. The second named author would also like to thank D. H. Phong for his encouragement and support.
Relative K-polystability
========================
In this section we recall the notion of relative K-polystability following [@GSz04]. This is a modification of the notion of K-polystability introduced by Donaldson [@Don02].
Suppose that $(V,L)$ is a polarised scheme of dimension $n$, with a $\mathbf{C}^*$ action $\alpha$. Let us write $A_k$ for the infinitesimal generator of the action of $\alpha$ on $H^0(V,L^k)$, and write $d_k$ for the dimension of $H^0(V,L^k)$. Then $d_k$ is a polynomial of degree $n$ and $\mathrm{Tr}(A_k)$ is a polynomial of degree $n+1$ for sufficiently large $k$, so we can write $$\begin{aligned}
d_k &= c_0k^n + c_1k^{n-1} + O(k^{n-2}),\\
\mathrm{Tr}(A_k) &= a_0k^{n+1} + a_1k^n + O(k^{n-1}),\\
\end{aligned}$$ Donaldson’s Futaki invariant is defined to be $$F(\alpha) = \frac{c_1}{c_0}a_0 - a_1.$$ Sometimes we will write $F(V,L,\alpha)$ to emphasize the space that $\alpha$ is acting on.
Suppose in addition that we have a $\mathbf{C}^*$-action $\beta$ acting on $(V,L)$ which commutes with $\alpha$, and write $B_k$ for the infinitesimal generator of the action on $H^0(V,L^k)$. Then $\mathrm{Tr}(A_kB_k)$ is a polynomial of degree $k+2$ for sufficiently large $k$, and we define the inner product $\langle\alpha,\beta\rangle$ to be the leading coefficient in the expansion $$\mathrm{Tr}(A_kB_k) - \frac{\mathrm{Tr}(A_k)\mathrm{Tr}(B_k)}{d_k} =
\langle \alpha,\beta\rangle k^{n+2} + O(k^{n+1}).$$ When $V$ is a smooth manifold, then this inner product can also be computed differential geometrically. It was originally introduced in this form by Futaki-Mabuchi [@FM].
To define the relative Futaki invariant, suppose that we have a torus action $T$ on $(V,L)$ commuting with $\alpha$. Let us write $\overline{\alpha}$ for the projection of $\alpha$ orthogonal to $T$, with respect to the inner product we defined. Then we define the relative Futaki invariant $F_T(\alpha)$ by $$F_T(\alpha) = F(\overline{\alpha}).$$ Equivalently if $\beta_1,\ldots,\beta_d$ is a basis of $\mathbf{C}^*$-actions generating the torus $T$, then $$F_T(\alpha) = F(\alpha) - \sum_{i=1}^d \frac{\langle
\alpha,\beta_i\rangle}{\langle \beta_i,\beta_i\rangle} F(\beta_i).$$
It will be convenient for us to extend these definitions to $\mathbf{Q}$-line bundles using the relation $$F(V,L^r,\alpha) = r^n F(V,L,\alpha),$$ which the reader can readily verify. It will also be useful to allow rational multiples of $\mathbf{C}^*$-actions. For this we use the relation $$F(V,L,r\alpha) = r F(V,L,\alpha).$$ We next recall the notion of a test-configuration from [@Don02] with the necessary modification for relative stability.
A *test-configuration for $(X,L)$* consists of a $\mathbf{C}^*$-equivariant flat family of schemes $\pi:\mathcal{X}\to\mathbf{C}$ (where $\mathbf{C}^*$ acts on $\mathbf{C}$ by multiplication) and a $\mathbf{C}^*$-equivariant, relatively ample $\mathbf{Q}$-line bundle $\mathcal{L}$ over $\mathcal{X}$. We require that the fibres $(\mathcal{X}_t,\mathcal{L}|_{\mathcal{X}_t})$ are isomorphic to $(X,L)$ for $t\not=0$, where $\mathcal{X}_t=\pi^{-1}(t)$. The test-configuration is called a *product configuration* if $\mathcal{X} = X\times\mathbf{C}$.
We say that the test-configuration is *compatible with a torus $T$ of automorphisms of $(X,L)$*, if there is a torus action on $(\mathcal{X},\mathcal{L})$ which preserves the fibres of $\pi:\mathcal{X}\to\mathbf{C}$, commutes with the $\mathbf{C}^*$-action, and restricts to $T$ on $(\mathcal{X}_t,\mathcal{L}|_{\mathcal{X}_t})$ for $t\not=0$.
Note that given a test-configuration $(\mathcal{X},\mathcal{L})$, there is an induced $\mathbf{C}^*$-action $\alpha$ on the central fibre $(\mathcal{X}_0,\mathcal{L}|_{\mathcal{X}_0})$. We will write $F(\mathcal{X},\mathcal{L})$ for the Futaki invariant of this induced action $\alpha$. With these preliminaries we can state the main definition.
\[def:kstable\] A polarised variety $(X,L)$ is *K-semistable relative to a torus $T$ of automorphisms* if $F_T(\mathcal{X},\mathcal{L})\geqslant 0$ for all test-configurations compatible with the torus. If in addition equality holds only for the product configuration, then $(X,L)$ is *K-polystable* relative to the torus $T$.
If we have two tori $T'\subset T$ acting on $(X,L)$, then K-polystability relative to $T$ is a weaker condition than relative to $T'$, since there are fewer test-configurations compatible with a larger torus. Thus, the weakest notion is K-polystability relative to a maximal torus of automorphisms. The strongest notion is K-polystability relative to the extremal $\mathbf{C}^*$-action. This is a $\mathbf{C}^*$-action $\chi$ defined by Futaki-Mabuchi [@FM] as follows. Fix a maximal torus of automorphisms $T$, and write $\mathfrak{t}$ for its Lie algebra. The Futaki invariant gives a linear map $\mathfrak{t}\mapsto\mathbf{C}$, and $\chi$ is dual to this map under the inner product on $\mathfrak{t}$. This gives a $\mathbf{C}^*$-action on $(X,L)$, unique up to conjugation. In particular if the Futaki invariant of any $\mathbf{C}^*$-action on $(X,L)$ vanishes, then $\chi=0$, and K-polystability relative to $\chi$ is simply K-polystability.
It would be interesting to strengthen the conclusion of Theorem \[thm:main\] to K-polystability relative to the extremal $\mathbf{C}^*$-action. Note that the analogous statement is true in finite dimensional geometric invariant theory, by Theorem 3.5 in [@GSz04] (the same proof works if we replace the maximal torus with any torus containing the extremal $\mathbf{C}^*$-action).
We next recall the two theorems that we will use in the next section.
\[thm:semistab\] If $M$ admits an extremal metric in $c_1(L)$ then $(M,L)$ is K-semistable relative to a maximal torus of automorphisms.
This follows easily from Donaldson’s lower bound for the Calabi functional [@Don05]. For details see [@GSzThesis]. For the convenience of the reader we outline the argument here. Donaldson’s lower bound tells us that for any test-configuration, if $\alpha$ is the induced $\mathbf{C}^*$-action on the central fiber, then $$\label{eq:skd}
\inf_{\omega\in c_1(L)} c_n\Vert S(\omega) - \hat{S}\Vert_{L^2}
\geqslant \frac{-F(\alpha)}{\Vert\alpha\Vert},$$ where $c_n$ is a constant depending only on the dimension, $\Vert\alpha\Vert=\langle\alpha,\alpha\rangle^{1/2}$ using the inner product defined above, and $\hat{S}$ is the average of the scalar curvature $S(\omega)$. Moreover, if $\omega$ is an extremal metric, then $$\label{eq:ext}
c_n\Vert S(\omega) - \hat{S}\Vert_{L^2} = \frac{ F(\chi) }{\Vert
\chi\Vert} = \Vert\chi\Vert,$$ where $\chi$ is the extremal vector field on $(M,L)$. We are using here that $F(\chi)=\langle\chi,\chi\rangle$ by definition of the extremal vector field. It follows from (\[eq:skd\]) and (\[eq:ext\]) that if $M$ admits an extremal metric in $c_1(L)$ then $$\label{eq:lower}
\frac{F(\alpha)}{\Vert \alpha\Vert} \geqslant -\Vert\chi\Vert$$ for all test-configurations.
Suppose now that $M$ admits an extremal metric in $c_1(L)$, and we have a test-configuration for $(M,L)$ which is compatible with a maximal torus of automorphisms $T$. Write $\alpha$ for the induced $\mathbf{C}^*$-action on the central fiber. By twisting the $\mathbf{C}^*$-action on the total space by the projection of $\alpha$ onto $T$ if necessary, we can assume that $\alpha$ is orthogonal to $T$. We want to show that $F(\alpha)\geqslant 0$. Suppose on the contrary that $F(\alpha) < 0$, and let $\mu>0$ satisfy $F(\mu\alpha) =
-\Vert\mu\alpha\Vert^2$. By pulling back the test-configuration under a base change $z\mapsto z^r$, and twisting the action on the total space by the inverse of $\chi$, we obtain a test-configuration for $(M,L)$ such that the action on the central fiber is $r(\mu\alpha-\chi)$, where $r$ is large enough to make this a genuine $\mathbf{C}^*$-action. From (\[eq:lower\]) we know that $$\frac{F(\mu\alpha - \chi)}{\Vert \mu\alpha-\chi\Vert} =
\frac{F(r(\mu\alpha-\chi))}{\Vert r(\mu\alpha-\chi)\Vert} \geqslant
-\Vert\chi\Vert.$$ But at the same time $$F(\mu\alpha - \chi) = -\Vert\mu\alpha\Vert^2 - \Vert\chi\Vert^2
= -\Vert \mu\alpha - \chi\Vert^2,$$ since $\alpha$ is orthogonal to $\chi$. So $$\frac{F(\mu\alpha - \chi)}{\Vert\mu\alpha - \chi\Vert} = -\Vert
\mu\alpha - \chi\Vert < -\Vert\chi\Vert.$$ This contradiction shows that $(M,L)$ is K-polystable relative to $T$. The same argument also shows that $(M,L)$ is K-polystable relative to the extremal $\mathbf{C}^*$-action.
\[thm:APS\] Suppose that $M$ admits an extremal metric in $c_1(L)$, and let $T$ be a maximal torus of automorphisms of $(M,L)$. If $p\in M$ is a fixed point of $T$, then the blowup $\mathrm{Bl}_p M$ of $M$ at $p$ admits an extremal metric in the class $c_1(\pi^*L - {\varepsilon}E)$ for sufficiently small ${\varepsilon}>0$. Here $\pi$ is the blowdown map, and $E$ is the exceptional divisor.
This follows from [@APS] Theorem 2.1. Indeed we can choose an extremal metric $\omega$ on $M$ such that the isometry group of $\omega$ contains a compact maximal torus $T_\mathbf{R}$, which is contained in the complex torus $T$. In the notation of [@APS] we let $K=T_\mathbf{R}$, and let $\mathfrak{k}$ be its Lie algebra. Since $K$ is a maximal torus, any $K$-invariant holomorphic hamiltonian vector field lies in $\mathfrak{k}$. Moreover if we write $S(\omega)$ for the scalar curvature then by Calabi’s theorem [@Cal85] the vector field $J\nabla S(\omega)$ lies in the center of the Lie algebra of Killing fields, so it also lies in $\mathfrak{k}$. This allows us to apply [@APS] Theorem 2.1, and we get the stated result.
Proof of Theorem \[thm:main\]
=============================
Let us suppose that $M$ admits an extremal metric in $c_1(L)$ and choose a maximal torus $T\subset \mathrm{Aut}(M,L)$. From Theorem \[thm:semistab\] we know that if $(\mathcal{X},\mathcal{L})$ is a test-configuration for $(M,L)$ compatible with $T$, then the relative Futaki invariant satisfies $F_T(\mathcal{X})\geqslant0$. Suppose then that $F_T(\mathcal{X})=0$.
We can assume that $M\subset\mathbf{P}(V)$, where $V=H^0(M,L)^*$. Moreover the torus $T$ acts on $\mathbf{P}(V)$, preserving $M$. In addition there is an extra $\mathbf{C}^*$-action $\alpha$ on $\mathbf{P}(V)$, commuting with the $T$-action and such that the flat closure of the family $t\mapsto
\alpha(t)\cdot M$ across $t=0$ is the test-configuration $\mathcal{X}$. Let us write $(M_0,L_0)$ for the central fiber of the test-configuration. Then we have both $\alpha$ and the torus $T$ acting on $(M_0,L_0)$. By twisting the action on the total space by the orthogonal projection of $\alpha$ onto $T$ (which does not change the relative Futaki invariant), we can assume that $\langle\alpha, T\rangle=0$. In this case $$F_T(\mathcal{X},\mathcal{L}) = F(M_0,L_0,\alpha).$$ We now look at the weight decomposition under $\alpha$ given by $$V = \bigoplus_i V_{m_i},$$ where $m_0 < m_1 <\ldots < m_L$ for some $L>0$, and consider the least $l\geqslant 0$ such that $$\mathrm{red}(M_0)\subset \mathbf{P}\big(\bigoplus_{i\leqslant l}
V_{m_i}\big).$$ It is proved in [@Sto08] section 3 that if $l=0$, so that $\alpha$ acts trivially on $\mathrm{red}(M_0)$, then either $\mathcal{X}$ is a product test-configuration, or $F(M_0,L_0,\alpha)>0$, which is a contradiction. On the other hand, if $l>0$, then consider the repulsive fixed point set $$M_0' = \mathrm{red}(M_0)\cap \mathbf{P}(V_{m_l}).$$ The set of points $p\in M$ for which the limit $$q = \lim_{t\to 0} \alpha(t)p$$ is in $M_0'$ is precisely $$M' = M \cap \mathbf{P}\left(\bigoplus_{i\geqslant l} V_{m_i}\right).$$ This is a closed $T$-invariant set, so it contains a point $p$ fixed by $T$. To see this, we can take a basis of $\mathbf{C}^*$-actions $\beta_i$ generating the torus $T$, and then given any point $p$ in $M'$ we can inductively move it to a fixed point of $\beta_i$ by taking the limit of $\beta_i(t)p$ as $t\to 0$. Doing this for each $i$, we end up with a fixed point of $T$. The corresponding limit $q$ will then be a $T$-invariant, repulsive fixed point of $\alpha$ in $\mathrm{red}(M_0)$.
Letting $Z\subset \mathcal{X}$ be the closure of the orbit of $p$ under $\alpha$, we obtain a test-configuration $$(\widehat{\mathcal{X}}, \widehat{\mathcal{L}}) =
(\mathrm{Bl}_Z\mathcal{X}, \phi^*\mathcal{L} - {\varepsilon}E)$$ for the polarised manifold $(\mathrm{Bl}_p M,
\phi^*L - {\varepsilon}E)$, where $\phi\!: \widehat{\mathcal{X}}\to\mathcal{X}$ is the blowdown. The only nontrivial thing to check is flatness of the composition $\pi\circ \phi\!:\widehat{\mathcal{X}}\to \mathcal{X}\to
\mathbf{C}$. This holds because blowing up $Z \subset \mathcal{X}$ does not introduce new associated points (i.e. embedded schemes) of $\mathcal{X}$, only the Cartier exceptional divisor $E$ (for details see the proof of Proposition 2.13 of [@Sto08]).
For suitably small ${\varepsilon}> 0$ the test-configuration $(\widehat{\mathcal{X}}, \widehat{\mathcal{L}})$ will have negative Futaki invariant, and in fact it will even have negative Futaki invariant relative to $T$. This follows from the lemma below and its corollary.
At the same time from Theorem \[thm:APS\] we know that $\mathrm{Bl}_pM$ admits an extremal metric in the class $c_1(\phi^*L -
{\varepsilon}E)$ for suitably small ${\varepsilon}$ since $p$ is fixed by the torus $T$, which is a maximal torus of automorphisms of $M$. This contradicts Theorem \[thm:semistab\], and completes the proof of the main theorem.
Let $(\mathcal{X},\mathcal{L})$ be a test-configuration for $(M,L)$ compatible with a torus $T$ of automorphisms, and suppose that the induced action $\alpha$ on the central fiber satisfies $\langle\alpha,T\rangle = 0$. Let $\widehat{\mathcal{X}}$ be given by the blowup of a $T$-invariant section as described above. Then $$F(\widehat{\mathcal{X}},\widehat{\mathcal{L}}) =
F(\mathcal{X},\mathcal{L}) + \left(\lambda(q) -
\frac{b_0}{a_0}\right)
\frac{{\varepsilon}^{n-1}}{2(n-2)!} + O({\varepsilon}^n),$$ and $$\langle\hat{\alpha}, \hat{T}\rangle = O({\varepsilon}^n),$$ where we use the $\mathbf{Q}$-polarization $\widehat{\mathcal{L}}=\phi^*\mathcal{L} - {\varepsilon}E$ on $\widehat{\mathcal{X}}$ for some small rational ${\varepsilon}>0$, and $\hat{\alpha}, \hat{T}$ are the actions of $\alpha$ and $T$ lifted to the blowup. It follows that the relative Futaki invariants satisfy $$F_{T}(\widehat{\mathcal{X}},\widehat{\mathcal{L}})
= F_T(\mathcal{X},\mathcal{L}) +
\left(\lambda(q) - \frac{b_0}{a_0}\right)
\frac{{\varepsilon}^{n-1}}{2(n-2)!} +
O({\varepsilon}^n).$$ Here $\lambda(q)$ is the weight of $\alpha$ on the fiber $L_{0,q}$, and $a_0, b_0$ are defined by the expansions of the dimension and weight on $H^0(M_0,L^k_0)$ calculated at the central fiber of $\mathcal{X}$ as usual: $$\begin{aligned}
d_k &= a_0k^n + a_1k^{n-1} + \ldots, \\
w_k &= b_0k^{n+1} + b_1k^n + \ldots.
\end{aligned}$$
The central fibre of $\widehat{\mathcal{X}}$ will not in general be isomorphic to $\widehat{M}_0 := \mathrm{Bl}_{q} M_0$. In fact it will contain another large component $P$ glued to $\widehat{M}_0$ along the exceptional divisor $E'$ for the morphism $\widehat{M}_0 \to
M_0$, as we now explain.
By [@hart], II Corollary 7.15, there is a closed immersion $\widehat{M}_0 \hookrightarrow \widehat{\mathcal{X}}_0$ induced by the closed immersion $M_0 \subset \mathcal{X}$ under blowing up $Z$. Let $\mathcal{I}_q \subset \mathcal{O}_{M_0}$ denote the ideal sheaf of $q
\in M_0$. By the algebraic definition of blowing up we have $\widehat{M}_0 \cong \mathrm{Proj} \bigoplus_{k {\geqslant}0}
\mathcal{I}^k_q$. On the other hand the generic fibre of $\widehat{\mathcal{X}}$ is $\mathrm{Proj} \bigoplus_{k {\geqslant}0}
\mathcal{I}^k_p$, where $\mathcal{I}_p$ is the ideal of the smooth point $p \in M$. Thus by the numerical criterion for flatness when the Hilbert-Samuel polynomial for $p \in M$ is larger that that of $q \in
M_0$ (i.e. when $q$ is singular enough as a point of $M_0$) there will be an additional component $P$ in the central fibre, given by the closure of $\widehat{\mathcal{X}}_0\setminus\widehat{M}_0$. A simple example has been suggested by S. Donaldson: when $q$ is an isolated threefold ordinary double point inside the central fibre one has $P
\cong \mathbf{P}^3$ glued in along a smooth quadric. Note that this is different from the situation described in [@jag] section 2, where the central fibre of the original test configuration is smooth (isomorphic to $M$), but one blows up $0-$cycles instead of just a point. In any case the restriction $\widehat{\mathcal{L}}_{0|_{\widehat{M}_0}}$ is just $\phi^*L_0 - {\varepsilon}E'$.
Taking this information into account we now compute the Donaldson-Futaki invariant for the action $\alpha$ on the central fiber $\widehat{\mathcal{X}}_0$. In the calculations that follow ${\varepsilon}$ is a fixed positive rational number, and we tacitly restrict to those $k \gg 1$ for which ${\varepsilon}k$ is an integer. We also suppress pullbacks like $\pi^*$ or $\phi^*$ when this causes no confusion. By flatness, using the Riemann-Roch theorem we have $$\label{eq:RR}
\begin{aligned}
h^0(\widehat{\mathcal{X}}_0, \widehat{\mathcal{L}}^k_0) &= h^0(\mathrm{Bl}_p M, L^k - k{\varepsilon}E)\\
&= h^0(M, L^k) - \frac{{\varepsilon}^n}{n!}k^n -\frac{{\varepsilon}^{n-1}}{2(n-2)!}k^{n-1} + \ldots.
\end{aligned}$$ Using the restriction $\mathbf{C}^*$-equivariant exact sequence $$\label{eq:restrict}
0 \longrightarrow
H^0_P(\mathcal{I}^{k{\varepsilon}}_{E'}\widehat{\mathcal{L}}^k_{0|_P})\longrightarrow
H^0_{\widehat{\mathcal{X}}_0}(\widehat{\mathcal{L}}^k_0) \longrightarrow
H^0_{\widehat{M}_0}(L^k_0 - k{\varepsilon}E')\longrightarrow 0$$ which holds for large $k \gg 1$, we find $$\mathrm{Tr}(H^0_{\widehat{\mathcal{X}}_0}(\widehat{\mathcal{L}}^k_0)) = \mathrm{Tr}(H^0_{\widehat{M}_0}(L^{k}_0 - k{\varepsilon}E')) + \mathrm{Tr}(H^0_P(\mathcal{I}^r_{E'}\widehat{\mathcal{L}}^k_{0|_P})).$$ Note that $H^0_{\widehat{M}_0}(L^{k}_0 - k{\varepsilon}E') \cong
H^0_{M_0}(\mathcal{I}^{k {\varepsilon}}_{q} L^{k}_0)$ so the first term in the formula above equals $\mathrm{Tr}(H^0_{M_0}(L^k_0))
-\mathrm{Tr}(H^0(\mathcal{O}_{k {\varepsilon}q} \otimes L^{k}_0|_q))$. From the exact sequence $$0\longrightarrow \mathcal{I}_q^{k{\varepsilon}}L_0^k\longrightarrow
L_0^k\longrightarrow \mathcal{O}_{k{\varepsilon}q}\otimes
L_0^k|_q\longrightarrow 0,$$ together with (\[eq:RR\]) and (\[eq:restrict\]) we see that the length of the $\mathcal{O}_{M_0}-$module $\mathcal{O}_{k{\varepsilon}q}$ is given by $$h^0_{P}(\mathcal{I}^{k{\varepsilon}}_{E'}\widehat{\mathcal{L}}^k_{0|_P}) + \frac{{\varepsilon}^n}{n!}k^n +
\frac{{\varepsilon}^{n-1}}{2(n-2)!}k^{n-1} + O(k^{n-2}).$$ It follows that the weight of the action on $\mathcal{O}_{k{\varepsilon}q}\otimes L^k|_q$ is given by $$\begin{aligned}
w(\mathcal{O}_{k{\varepsilon}q}\otimes L^k|_p) &= w(\mathcal
{O}_{k{\varepsilon}q}) + k\lambda(q)\mathrm{len}(\mathcal{O}_{k{\varepsilon}q}) \\
&= k\lambda(q)h^0_{P}(\mathcal{I}^{k{\varepsilon}}_{E'}\widehat{\mathcal{L}}^k_{0|_P}) \\&+ \left(c_0{\varepsilon}^{n+1} + \lambda(q)
\frac{{\varepsilon}^n}{n!}\right)k^{n+1} +
\left(c_1{\varepsilon}^n +
\lambda(q)\frac{{\varepsilon}^{n-1}}{2(n-2)!}\right)k^n + \ldots,
\end{aligned}$$ where $c_0, c_1$ are given by the expansion $$w(\mathcal{O}_{k{\varepsilon}q}) = c_0(k{\varepsilon})^{n+1} +
c_1(k{\varepsilon})^n +
\ldots.$$ Similarly $\mathcal{I}^{k{\varepsilon}}_{E'}\widehat{\mathcal{L}}^k_{0|_P}
\cong \mathcal{L}_0^{k}|_q \otimes
\mathcal{I}^{k{\varepsilon}}_{E'}\mathcal{O}(-k E)|_P$ and the action on the latter factor has vanishing weight, so one has $$\mathrm{Tr}(H^0_{P}(\mathcal{I}^{k{\varepsilon}}_{E'}\widehat{\mathcal{L}}^k_{0|_P})) = k\lambda(q)h^0_{P}(\mathcal{I}^{k{\varepsilon}}_{E'}\widehat{\mathcal{L}}^k_{0|_P}).$$ After a simple cancellation we find $$\begin{aligned}
\hat{a}_0 &= a_0 + O({\varepsilon}^n) \\
\hat{a}_1 &= a_1 - \frac{{\varepsilon}^{n-1}}{2(n-2)!} \\
\hat{b}_0 &= b_0 + O({\varepsilon}^n) \\
\hat{b}_1 &= b_1 -
\lambda(q)\frac{{\varepsilon}^{n-1}}{2(n-2)!},
\end{aligned}$$ where $\hat{a}_i, \hat{b}_i$ are computed on $\widehat{\mathcal{X}}$. Using the formula $F(\widehat{\mathcal{X}}) = \displaystyle{\frac{\hat{a}_1}{\hat{a}_0}}\hat{b}_0
- \hat{b}_1$ we get $$F(\widehat{\mathcal{X}}) = F(\mathcal{X}) + \left(\lambda(q) - \frac{b_0}{a_0}\right)
\frac{{\varepsilon}^{n-1}}{2(n-2)!} + O({\varepsilon}^n).$$
Now let $\beta$ be any $\mathbf{C}^*$-action in the torus $T$. To compute the inner product $\langle \hat{\alpha}, \hat{\beta}\rangle$, let us write $A_k, B_k$ for the infinitesimal generators of the actions $\alpha,\beta$ on $H^0(M_0, L^k_0)$, and write $\hat{A}_k,
\hat{B}_k$ for the infinitesimal actions of the corresponding actions on $H^0(\widehat{\mathcal{X}}_0, \widehat{\mathcal{L}}^k_0)$. The inner product $\langle\hat{\alpha},\hat{\beta}\rangle$ is the leading order term in $$\label{product}
\mathrm{Tr}(\hat{A}_k\hat{B}_k) -
\frac{\mathrm{Tr}(\hat{A}_k)
\mathrm{Tr}(\hat{B}_k)}{\hat{d}_k}.$$ Since the actions $\alpha, \beta$ commute, we can use precisely the same exact sequences as before to compute $$\begin{aligned}
\mathrm{Tr}(A_kB_k) - \mathrm{Tr}(\hat{A}_k\hat{B}_k) &=
\lambda_{\alpha}(p)\lambda_{\beta}(p)(\mathrm{len}(\mathcal{O}_{
k{\varepsilon}p}) - h^0_{P}(\mathcal{I}^{k{\varepsilon}}_{E'}\widehat{\mathcal{L}}^k_{0|_P})) + d_0 k^{n+2}\\ &+
\mathrm{Tr}(A'_{k{\varepsilon}}B'_{k{\varepsilon}}),\end{aligned}$$ where $A'_{k{\varepsilon}}$ and $B'_{k{\varepsilon}}$ are the infinitesimal generators of the actions $\alpha,\beta$ on $\mathcal{O}_{k{\varepsilon}p}$. We have an expansion $$\mathrm{Tr}(A'_{k{\varepsilon}}B'_{k{\varepsilon}}) = c_0' ({\varepsilon}k)^{n+2} + O(k^{n+1}).$$ So up to terms of order ${\varepsilon}^n$, the leading order term in is the same as that in $$\mathrm{Tr}(A_kB_k) -
\frac{\mathrm{Tr}(A_k)\mathrm{Tr}(B_k)}{ d_k},$$ which is just $\langle\alpha,\beta\rangle = 0$. This shows $\langle\hat{\alpha},\hat{\beta}\rangle = O({\varepsilon}^n)$. A similar computation of the inner product on the blowup is in [@DV].
The statement about the relative Futaki invariants now follows from the definition $$F_T(\widehat{\mathcal{X}},\hat{\alpha}) =
F(\widehat{\mathcal{X}},\hat{\alpha}) - \sum_{i=1}^d\frac{\langle
\hat{\alpha},\hat{\beta}_i\rangle}{\langle\hat{\beta}_i,
\hat{\beta}_i\rangle}
F(\widehat{\mathcal{X}},\hat{\beta}_i),$$ where the $\mathbf{C}^*$-actions $\beta_i$ generate the torus $T$.
Following the notation above, if $q \in M_0$ is a repulsive fixed point for $\alpha$ then $F(\widehat{\mathcal{X}}) < F(\mathcal{X})$ for ${\varepsilon}$ small enough.
It remains to prove that the highest order correction term $$\left(\lambda(q) - \frac{b_0}{a_0}\right)
\frac{{\varepsilon}^{n-1}}{2(n-2)!}$$ is negative. It is proved is [@jag] section 4 that, possibly after a fixed basechange of the test-configuration, the coefficient $\lambda(q) - \frac{b_0}{a_0}$ is integral and equals minus the Hilbert-Mumford weight of $q$ under the induced action of $\alpha$ on $\mathbf{P}(V)$. The Hilbert-Mumford criterion combined with a local computation then shows that the weight of such a repulsive fixed point must be positive (for details see the proof of Theorem 1.2 in [@Sto08]).
Alternatively we can give a self-contained proof as follows. Let $M_0$ be the central fiber of our test-configuration and suppose that $q$ is a repulsive fixed point with weight $m_l$ and also let $r$ be a point in $\mathrm{red}(M_0)\cap \mathbf{P}(V_{m_0})$, ie. a lowest weight invariant point. Then as in the Futaki invariant calculation we have the exact sequence $$0\longrightarrow \mathcal{I}^{k{\varepsilon}}_{r} L^k_0 \longrightarrow L^k_0
\longrightarrow \mathcal{O}_{{\varepsilon}k r}\otimes L^k_0|_r \longrightarrow
0.$$ Write $-\lambda$ for the weight $m_l$, so $\lambda(q)=\lambda$ and $m_0\leqslant-\lambda-1$. The weights on $L_0$ are the opposite by duality and they are all at least $\lambda$. Using the notation from the proof of Theorem \[thm:main\], from the exact sequence we have $$\label{eq:weight}\begin{aligned}
w_k &= w(\mathcal{I}^{k{\varepsilon}}_{r}L^k) +
w(\mathcal{O}_{{\varepsilon}k r}) -km_0\,\mathrm{len}(\mathcal{O}_{{\varepsilon}k
r}) \\
&\geqslant k\lambda \big(d_k - \mathrm{len}(\mathcal{O}_{{\varepsilon}kr})\big) +
w(\mathcal{O}_{{\varepsilon}k r}) +
k(\lambda+1)\mathrm{len}(\mathcal{O}_{{\varepsilon}kr}) \\
&= k\lambda d_k + k\mathrm{len}(\mathcal{O}_{{\varepsilon}kr}) +
w(\mathcal{O}_{{\varepsilon}kr}).
\end{aligned}$$ Now we need the expansions $$\begin{gathered}
\mathrm{len}(\mathcal{O}_{{\varepsilon}kr}) = c({\varepsilon}k)^n + O(k^{n-1}) \\
w(\mathcal{O}_{{\varepsilon}kr}) = c'({\varepsilon}k)^{n+1} + O(k^n).
\end{gathered}$$ It is important here that $c > 0$. This follows from [@hart], III Corollary 9.6. Then looking at the $k^{n+1}$ term in (\[eq:weight\]) we get $$b_0 \geqslant \lambda a_0 + c{\varepsilon}^n + c'{\varepsilon}^{n+1}.$$ When ${\varepsilon}$ is chosen sufficiently small we get the required inequality $ \frac{b_0}{a_0} > \lambda$.
[10]{}
V. Apostolov, D. M. J. Calderbank, P. Gauduchon and C. W. Tønnesen-Friedman, *Hamiltonian 2-forms in [K]{}ähler geometry [III]{}, extremal metrics and stability*, Invent. Math. **173** (2008), no. 3, 547–601.
C. Arezzo and F. Pacard, *Blowing up and desingularizing constant scalar curvature [K]{}ähler manifolds*, Acta Math. **196** (2006), no. 2, 179–228.
C. Arezzo, F. Pacard and M. Singer, *Extremal metrics on blow ups*, arXiv:math/0701028.
E. Calabi, *Extremal [K]{}ähler metrics*, Seminar on Differential Geometry (S. T. Yau, ed.), Princeton, 1982.
, *Extremal Kähler metrics II*, in Differential Geometry and Complex Analysis, eds. I. Chavel and H.M. Farkas, Springer Verlag (1985), 95–114.
A. Della Vedova, *CM-stability of blow-ups and canonical metrics*, arXiv:0810.5584
S. K. Donaldson, *Scalar curvature and stability of toric varieties*, J. Differential Geom. **62** (2002), 289–349.
, *Lower bounds on the [C]{}alabi functional*, J. Differential Geom. **70** (2005), no. 3, 453–472.
A. Futaki and T. Mabuchi, *Bilinear forms and extremal [K]{}ähler vector fields associated with [K]{}ähler classes*, Math. Ann. **301** (1995), no. 2, 199–210.
R. Hartshorne *Algebraic Geometry*, Springer-Verlag, Heidelberg 1977.
M. Levine, *A remark on extremal [K]{}ähler metrics*, J. Differential Geom. **21** (1985), no. 1, 73–77.
T. Mabuchi, *K-stability of constant scalar curvature polarization*, arXiv:0812.4093.
, *A stronger concept of [K]{}-stability*, arXiv:0910.4617.
J. Stoppa, *K-stability of constant scalar curvature [K]{}ähler manifolds*, Advances in Mathematics **221** no. 4 (2009), 1397–1408.
, *Unstable blowups*, Journal of Algebraic Geometry **19** (2010), 1-17.
G. Székelyhidi, *Extremal metrics and ${K}$-stability*, Ph.D. thesis, Imperial College, London, 2006.
, *Extremal metrics and ${K}$-stability*, Bull. Lond. Math. Soc. **39** (2007), no. 1, 76–84.
D. H. Phong and J. Sturm, *Lectures on Stability and Constant Scalar Curvature*, in Current Developments in Mathematics 2007, International Press, arXiv:0801.4179.
G. Tian, *Kähler-[E]{}instein metrics with positive scalar curvature*, Invent. Math. **137** (1997), 1–37.
S.-T. Yau, *Open problems in geometry*, Proc. Symposia Pure Math. **54** (1993), 1–28.
|
{
"pile_set_name": "ArXiv"
}
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: https://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") { // CommonJS
mod(require("../../lib/codemirror"));
} else if (typeof define == "function" && define.amd) { // AMD
define(["../../lib/codemirror"], mod);
} else { // Plain browser env
mod(CodeMirror);
}
})(function(CodeMirror) {
"use strict";
var TOKEN_STYLES = {
addition: "positive",
attributes: "attribute",
bold: "strong",
cite: "keyword",
code: "atom",
definitionList: "number",
deletion: "negative",
div: "punctuation",
em: "em",
footnote: "variable",
footCite: "qualifier",
header: "header",
html: "comment",
image: "string",
italic: "em",
link: "link",
linkDefinition: "link",
list1: "variable-2",
list2: "variable-3",
list3: "keyword",
notextile: "string-2",
pre: "operator",
p: "property",
quote: "bracket",
span: "quote",
specialChar: "tag",
strong: "strong",
sub: "builtin",
sup: "builtin",
table: "variable-3",
tableHeading: "operator"
};
function startNewLine(stream, state) {
state.mode = Modes.newLayout;
state.tableHeading = false;
if (state.layoutType === "definitionList" && state.spanningLayout &&
stream.match(RE("definitionListEnd"), false))
state.spanningLayout = false;
}
function handlePhraseModifier(stream, state, ch) {
if (ch === "_") {
if (stream.eat("_"))
return togglePhraseModifier(stream, state, "italic", /__/, 2);
else
return togglePhraseModifier(stream, state, "em", /_/, 1);
}
if (ch === "*") {
if (stream.eat("*")) {
return togglePhraseModifier(stream, state, "bold", /\*\*/, 2);
}
return togglePhraseModifier(stream, state, "strong", /\*/, 1);
}
if (ch === "[") {
if (stream.match(/\d+\]/)) state.footCite = true;
return tokenStyles(state);
}
if (ch === "(") {
var spec = stream.match(/^(r|tm|c)\)/);
if (spec)
return tokenStylesWith(state, TOKEN_STYLES.specialChar);
}
if (ch === "<" && stream.match(/(\w+)[^>]+>[^<]+<\/\1>/))
return tokenStylesWith(state, TOKEN_STYLES.html);
if (ch === "?" && stream.eat("?"))
return togglePhraseModifier(stream, state, "cite", /\?\?/, 2);
if (ch === "=" && stream.eat("="))
return togglePhraseModifier(stream, state, "notextile", /==/, 2);
if (ch === "-" && !stream.eat("-"))
return togglePhraseModifier(stream, state, "deletion", /-/, 1);
if (ch === "+")
return togglePhraseModifier(stream, state, "addition", /\+/, 1);
if (ch === "~")
return togglePhraseModifier(stream, state, "sub", /~/, 1);
if (ch === "^")
return togglePhraseModifier(stream, state, "sup", /\^/, 1);
if (ch === "%")
return togglePhraseModifier(stream, state, "span", /%/, 1);
if (ch === "@")
return togglePhraseModifier(stream, state, "code", /@/, 1);
if (ch === "!") {
var type = togglePhraseModifier(stream, state, "image", /(?:\([^\)]+\))?!/, 1);
stream.match(/^:\S+/); // optional Url portion
return type;
}
return tokenStyles(state);
}
function togglePhraseModifier(stream, state, phraseModifier, closeRE, openSize) {
var charBefore = stream.pos > openSize ? stream.string.charAt(stream.pos - openSize - 1) : null;
var charAfter = stream.peek();
if (state[phraseModifier]) {
if ((!charAfter || /\W/.test(charAfter)) && charBefore && /\S/.test(charBefore)) {
var type = tokenStyles(state);
state[phraseModifier] = false;
return type;
}
} else if ((!charBefore || /\W/.test(charBefore)) && charAfter && /\S/.test(charAfter) &&
stream.match(new RegExp("^.*\\S" + closeRE.source + "(?:\\W|$)"), false)) {
state[phraseModifier] = true;
state.mode = Modes.attributes;
}
return tokenStyles(state);
};
function tokenStyles(state) {
var disabled = textileDisabled(state);
if (disabled) return disabled;
var styles = [];
if (state.layoutType) styles.push(TOKEN_STYLES[state.layoutType]);
styles = styles.concat(activeStyles(
state, "addition", "bold", "cite", "code", "deletion", "em", "footCite",
"image", "italic", "link", "span", "strong", "sub", "sup", "table", "tableHeading"));
if (state.layoutType === "header")
styles.push(TOKEN_STYLES.header + "-" + state.header);
return styles.length ? styles.join(" ") : null;
}
function textileDisabled(state) {
var type = state.layoutType;
switch(type) {
case "notextile":
case "code":
case "pre":
return TOKEN_STYLES[type];
default:
if (state.notextile)
return TOKEN_STYLES.notextile + (type ? (" " + TOKEN_STYLES[type]) : "");
return null;
}
}
function tokenStylesWith(state, extraStyles) {
var disabled = textileDisabled(state);
if (disabled) return disabled;
var type = tokenStyles(state);
if (extraStyles)
return type ? (type + " " + extraStyles) : extraStyles;
else
return type;
}
function activeStyles(state) {
var styles = [];
for (var i = 1; i < arguments.length; ++i) {
if (state[arguments[i]])
styles.push(TOKEN_STYLES[arguments[i]]);
}
return styles;
}
function blankLine(state) {
var spanningLayout = state.spanningLayout, type = state.layoutType;
for (var key in state) if (state.hasOwnProperty(key))
delete state[key];
state.mode = Modes.newLayout;
if (spanningLayout) {
state.layoutType = type;
state.spanningLayout = true;
}
}
var REs = {
cache: {},
single: {
bc: "bc",
bq: "bq",
definitionList: /- .*?:=+/,
definitionListEnd: /.*=:\s*$/,
div: "div",
drawTable: /\|.*\|/,
foot: /fn\d+/,
header: /h[1-6]/,
html: /\s*<(?:\/)?(\w+)(?:[^>]+)?>(?:[^<]+<\/\1>)?/,
link: /[^"]+":\S/,
linkDefinition: /\[[^\s\]]+\]\S+/,
list: /(?:#+|\*+)/,
notextile: "notextile",
para: "p",
pre: "pre",
table: "table",
tableCellAttributes: /[\/\\]\d+/,
tableHeading: /\|_\./,
tableText: /[^"_\*\[\(\?\+~\^%@|-]+/,
text: /[^!"_=\*\[\(<\?\+~\^%@-]+/
},
attributes: {
align: /(?:<>|<|>|=)/,
selector: /\([^\(][^\)]+\)/,
lang: /\[[^\[\]]+\]/,
pad: /(?:\(+|\)+){1,2}/,
css: /\{[^\}]+\}/
},
createRe: function(name) {
switch (name) {
case "drawTable":
return REs.makeRe("^", REs.single.drawTable, "$");
case "html":
return REs.makeRe("^", REs.single.html, "(?:", REs.single.html, ")*", "$");
case "linkDefinition":
return REs.makeRe("^", REs.single.linkDefinition, "$");
case "listLayout":
return REs.makeRe("^", REs.single.list, RE("allAttributes"), "*\\s+");
case "tableCellAttributes":
return REs.makeRe("^", REs.choiceRe(REs.single.tableCellAttributes,
RE("allAttributes")), "+\\.");
case "type":
return REs.makeRe("^", RE("allTypes"));
case "typeLayout":
return REs.makeRe("^", RE("allTypes"), RE("allAttributes"),
"*\\.\\.?", "(\\s+|$)");
case "attributes":
return REs.makeRe("^", RE("allAttributes"), "+");
case "allTypes":
return REs.choiceRe(REs.single.div, REs.single.foot,
REs.single.header, REs.single.bc, REs.single.bq,
REs.single.notextile, REs.single.pre, REs.single.table,
REs.single.para);
case "allAttributes":
return REs.choiceRe(REs.attributes.selector, REs.attributes.css,
REs.attributes.lang, REs.attributes.align, REs.attributes.pad);
default:
return REs.makeRe("^", REs.single[name]);
}
},
makeRe: function() {
var pattern = "";
for (var i = 0; i < arguments.length; ++i) {
var arg = arguments[i];
pattern += (typeof arg === "string") ? arg : arg.source;
}
return new RegExp(pattern);
},
choiceRe: function() {
var parts = [arguments[0]];
for (var i = 1; i < arguments.length; ++i) {
parts[i * 2 - 1] = "|";
parts[i * 2] = arguments[i];
}
parts.unshift("(?:");
parts.push(")");
return REs.makeRe.apply(null, parts);
}
};
function RE(name) {
return (REs.cache[name] || (REs.cache[name] = REs.createRe(name)));
}
var Modes = {
newLayout: function(stream, state) {
if (stream.match(RE("typeLayout"), false)) {
state.spanningLayout = false;
return (state.mode = Modes.blockType)(stream, state);
}
var newMode;
if (!textileDisabled(state)) {
if (stream.match(RE("listLayout"), false))
newMode = Modes.list;
else if (stream.match(RE("drawTable"), false))
newMode = Modes.table;
else if (stream.match(RE("linkDefinition"), false))
newMode = Modes.linkDefinition;
else if (stream.match(RE("definitionList")))
newMode = Modes.definitionList;
else if (stream.match(RE("html"), false))
newMode = Modes.html;
}
return (state.mode = (newMode || Modes.text))(stream, state);
},
blockType: function(stream, state) {
var match, type;
state.layoutType = null;
if (match = stream.match(RE("type")))
type = match[0];
else
return (state.mode = Modes.text)(stream, state);
if (match = type.match(RE("header"))) {
state.layoutType = "header";
state.header = parseInt(match[0][1]);
} else if (type.match(RE("bq"))) {
state.layoutType = "quote";
} else if (type.match(RE("bc"))) {
state.layoutType = "code";
} else if (type.match(RE("foot"))) {
state.layoutType = "footnote";
} else if (type.match(RE("notextile"))) {
state.layoutType = "notextile";
} else if (type.match(RE("pre"))) {
state.layoutType = "pre";
} else if (type.match(RE("div"))) {
state.layoutType = "div";
} else if (type.match(RE("table"))) {
state.layoutType = "table";
}
state.mode = Modes.attributes;
return tokenStyles(state);
},
text: function(stream, state) {
if (stream.match(RE("text"))) return tokenStyles(state);
var ch = stream.next();
if (ch === '"')
return (state.mode = Modes.link)(stream, state);
return handlePhraseModifier(stream, state, ch);
},
attributes: function(stream, state) {
state.mode = Modes.layoutLength;
if (stream.match(RE("attributes")))
return tokenStylesWith(state, TOKEN_STYLES.attributes);
else
return tokenStyles(state);
},
layoutLength: function(stream, state) {
if (stream.eat(".") && stream.eat("."))
state.spanningLayout = true;
state.mode = Modes.text;
return tokenStyles(state);
},
list: function(stream, state) {
var match = stream.match(RE("list"));
state.listDepth = match[0].length;
var listMod = (state.listDepth - 1) % 3;
if (!listMod)
state.layoutType = "list1";
else if (listMod === 1)
state.layoutType = "list2";
else
state.layoutType = "list3";
state.mode = Modes.attributes;
return tokenStyles(state);
},
link: function(stream, state) {
state.mode = Modes.text;
if (stream.match(RE("link"))) {
stream.match(/\S+/);
return tokenStylesWith(state, TOKEN_STYLES.link);
}
return tokenStyles(state);
},
linkDefinition: function(stream, state) {
stream.skipToEnd();
return tokenStylesWith(state, TOKEN_STYLES.linkDefinition);
},
definitionList: function(stream, state) {
stream.match(RE("definitionList"));
state.layoutType = "definitionList";
if (stream.match(/\s*$/))
state.spanningLayout = true;
else
state.mode = Modes.attributes;
return tokenStyles(state);
},
html: function(stream, state) {
stream.skipToEnd();
return tokenStylesWith(state, TOKEN_STYLES.html);
},
table: function(stream, state) {
state.layoutType = "table";
return (state.mode = Modes.tableCell)(stream, state);
},
tableCell: function(stream, state) {
if (stream.match(RE("tableHeading")))
state.tableHeading = true;
else
stream.eat("|");
state.mode = Modes.tableCellAttributes;
return tokenStyles(state);
},
tableCellAttributes: function(stream, state) {
state.mode = Modes.tableText;
if (stream.match(RE("tableCellAttributes")))
return tokenStylesWith(state, TOKEN_STYLES.attributes);
else
return tokenStyles(state);
},
tableText: function(stream, state) {
if (stream.match(RE("tableText")))
return tokenStyles(state);
if (stream.peek() === "|") { // end of cell
state.mode = Modes.tableCell;
return tokenStyles(state);
}
return handlePhraseModifier(stream, state, stream.next());
}
};
CodeMirror.defineMode("textile", function() {
return {
startState: function() {
return { mode: Modes.newLayout };
},
token: function(stream, state) {
if (stream.sol()) startNewLine(stream, state);
return state.mode(stream, state);
},
blankLine: blankLine
};
});
CodeMirror.defineMIME("text/x-textile", "textile");
});
|
{
"pile_set_name": "Github"
}
|
The role of monocyte/macrophages as vehicles of dissemination of Simkania negevensis: an in vitro simulation model.
Exposure to Simkania negevensis (Sn), an intracellular microorganism that has been associated with respiratory tract infections in infants and adults, is prevalent. Sn can multiply within free-living amoebae and has been detected in domestic water supplies, which may constitute a source of infection with the organism. Its path of transport from its portal of entry to the body to its target organs is unknown. In this study, the possibility that monocytes/macrophages may serve as vehicles of transmission was examined. In vitro cocultivation of Sn-infected Acanthamoeba polyphaga with the monocyte/macrophage cell line U937 resulted in the death of the amoebae and infection of the U937 cells. Sn entered and multiplied in U937 cells within short periods of time, and the microorganism could be transferred from U937 cells to cell cultures of various origins. Uninfected monocyte/macrophages could become infected when in contact with either actively or persistently Sn-infected cell cultures. Persistently infected cultures in contact with uninfected U937 cells became actively infected. The results of this study provide a basis for determination of the molecular mechanisms of monocyte/macrophage-cell interactions in transfer of infection and may contribute to a better understanding of the pathogenesis of Sn infections in vivo.
|
{
"pile_set_name": "PubMed Abstracts"
}
|
@import "sass/card";
:host {
user-select: auto;
}
#press-content {
background: #F7FCFB;
-webkit-font-smoothing: antialiased;
}
.clearfix {
&:after {
content: '';
display: table;
clear: both;
}
}
.square {
&:before {
content: "";
display: block;
padding-top: 100%;
}
}
.rect {
&:before {
content: "";
display: block;
padding-top: 20%;
}
}
#press-banner {
display: block;
height: 315px;
}
a {
color: #00ACC1;
opacity: 1;
text-decoration: none;
transition: opacity .3s;
&:hover {
opacity: 0.75;
}
}
h1 {
margin: 0;
padding: 0;
font-family: 'Lobster', sans-serif;
font-size: 115px;
font-weight: normal;
margin: 10px;
float: left;
color: #fff;
&::first-letter {
font-size: 161px;
vertical-align: middle;
}
}
h2 {
margin: 0;
padding: 0;
font-family: 'Lobster', sans-serif;
font-weight: normal;
font-size: 48px;
color: #9575CD;
}
h3 {
margin: 0;
padding: 0;
font-weight: 600;
font-size: 30px;
color: #fff;
}
h4 {
margin: 0;
padding: 0;
font-size: 22px;
}
p {
font-size: 16px;
font-wight: normal;
line-height: 28px;
}
ul {
font-size: 16px;
font-wight: normal;
line-height: 24px;
}
#press-hero {
background: url(img/bg-press-page-hero.png) 50% 100% no-repeat;
background-size: cover;
height: 1000px;
padding: 20px 0 0 0;
width: 100%;
.press-header, .press-description {
box-sizing: border-box;
margin: 0 auto;
max-width: 1010px;
padding: 0 30px;
}
.press-header {
background: url(img/title-bg-swirl_2x.png) center/contain no-repeat;
padding: 30px 0 50px 0;
text-align: center;
width: 100%;
.press-title {
@extend .clearfix;
display: inline-block;
transform: rotate(-5deg);
}
}
h3 {
margin-top: -10px;
color: #fff;
}
.press-description {
@extend .clearfix;
p {
color: rgba(38, 50, 56, 0.8);
font-weight: 300;
}
}
.press-description-left {
float: left;
padding: 30px 0 0 0;
width: 26%;
.square {
background: url(img/illust-reporter_2x.png) 50% 50% no-repeat;
background-size: contain;
width: 100%;
}
}
.press-description-right {
float: left;
width: 74%;
}
}
#press-intro {
display: flex;
align-items: stretch;
a {
color: #fff;
text-decoration: underline;
}
h2, {
color: #fff;
}
p, ul {
color: #fff;
}
ul {
text-align: left;
li {
margin-bottom: 10px;
}
}
.press-intro-inner {
text-align: center;
width: 75%;
}
.press-intro-col {
display: flex;
justify-content: center;
padding: 25px 0;
width: 50%;
.rect {
margin: 5% 0;
width: 100%;
}
}
.press-intro-left {
background: #17CC82;
.rect {
background: url(img/illust-educational_2x.png) 50% 50% no-repeat;
background-size: contain;
}
}
.press-intro-right {
background: #9575CD;
.rect {
background: url(img/illust-new-in2015_2x.png) 50% 50% no-repeat;
background-size: contain;
}
}
}
#press-primary {
text-align: center;
padding: 100px 0 0 0;
h2 {
margin-bottom: 50px;
}
.press-primary-inner {
margin: 0 auto;
overflow: auto;
padding: 0 0 10px;
width: 1010px;
display: flex;
flex-wrap: wrap;
justify-content: center;
}
p {
min-height: 144px;
}
.press-card-links {
a {
float: left;
width: 50%;
}
}
}
#press-secondary {
padding: 100px 0 100px 0;
text-align: center;
h2 {
margin-bottom: 25px;
}
.press-card-container {
display: flex;
flex-wrap: wrap;
align-items: flex-start;
justify-content: space-between;
}
.press-card {
width: calc(33% - 30px);
.press-card-img {
height: 175px;
}
}
.press-secondary-inner {
margin: 0 auto;
overflow: auto;
width: 1010px;
.press-card-tabs {
padding-bottom: 50px;
button {
font: inherit;
border: none;
cursor: pointer;
font-size: 14px;
font-weight: 600;
padding: 20px;
position: relative;
text-transform: uppercase;
z-index: 1;
display: inline-block;
border-radius: 8px;
background: transparent;
color: #9575CD;
&.active {
background: #9575CD;
color: white;
}
}
}
}
}
#press-embed {
background: #9575CD;
padding: 100px 0;
text-align: center;
.press-embed-inner {
margin: 0 auto;
width: 640px;
}
a {
color: #80DEEA;
text-decoration: none;
}
p {
color: #fff;
}
.rect {
background: url(img/illust-embed_2x.png) 50% 50% no-repeat;
background-size: contain;
}
}
#press-device {
padding: 50px 0;
text-align: center;
h3, h4, p {
color: #607D8B;
}
h3 {
font-weight: 600;
}
p {
font-size: 16px;
line-height: 24px;
}
a {
font-size: 16px;
}
.press-device-grid {
margin: 0 auto;
max-width: 1010px;
display: flex;
flex-wrap: wrap;
align-items: flex-start;
justify-content: center;
.press-device-square {
will-change: transform; // avoid chrome hiding this layer
padding: 0 15px 30px;
text-align: center;
box-sizing: border-box;
width: 25%;
min-width: 240px;
.square {
background: transparent center/contain no-repeat;
width: 128px;
margin: 25px auto;
}
}
}
}
#press-footer {
will-change: transform; // avoid chrome hiding this layer
background: #17CC82;
text-align: center;
padding: 100px;
p {
color: #fff;
padding-bottom: 25px;
font-size: 16px;
}
a {
background: #FFBE26;
border: none;
border-radius: 5px;
color: #fff;
font-size: 16px;
font-weight: bold;
height: 50px;
opacity: 1;
padding: 15px 35px;
text-decoration: none;
transition: background .3s;
width: 250px;
&:hover {
background: #ffd54f;
}
}
}
@import "sass/responsive";
|
{
"pile_set_name": "Github"
}
|
Comparison of forces acting on maxillary incisors during tracheal intubation with different laryngoscopy techniques: a blinded manikin study.
Dental trauma is a common complication of tracheal intubation. As existing evidence is insufficient to validly assess the impact of different laryngoscopy techniques on the incidence of dental trauma, the force exerted onto dental structures during tracheal intubation was investigated. An intubation manikin was equipped with hidden force sensors in all maxillary incisors. Dental force was measured while 104 anaesthetists performed a series of tracheal intubations using direct laryngoscopy with a Macintosh blade, and videolaryngoscopy with a C-MAC® , or the hyperangulated GlideScope® or KingVision® laryngoscopes in both normal and difficult airway conditions. A total of 624 tracheal intubations were analysed. The median (IQR [range]) peak force of direct laryngoscopy in normal airways was 21.1 (14.0-32.8 [2.3-127.6]) N and 29.3 (17.7-44.8 [3.3-97.2]) N in difficult airways. In normal airways, these were lower with the GlideScope and KingVision hyperangulated laryngoscopes, with a reduction of 4.6 N (p = 0.006) and 10.9 N (p < 0.001) compared with direct laryngoscopy, respectively. In difficult airways, these were lower with the GlideScope and KingVision hyperangulated laryngoscopes, with a reduction of 9.8 N (p < 0.001) and 17.6 N (p < 0.001) compared with direct laryngoscopy, respectively. The use of the C-MAC did not have an impact on the median peak force. Although sex of anaesthetists did not affect peak force, more experienced anaesthetists generated a higher peak force than less experienced providers. We conclude that hyperangulated videolaryngoscopy was associated with a significantly decreased force exerted on maxillary incisors and might reduce the risk for dental injury in clinical settings.
|
{
"pile_set_name": "PubMed Abstracts"
}
|
For those who enjoy Nike’s technologically simple running models, the Challenger surely fits the bill. Featuring a simple style and tooling, the tonal gray/white materials that comprise the upper are meshed with a two-tone outsole. Available now at Schuh-You.
|
{
"pile_set_name": "Pile-CC"
}
|
Effects of intensive arm training with an electromechanical orthosis in chronic stroke patients: a preliminary study.
To evaluate the use of an electromechanical device, comprising an exoskeleton, a static orthosis, and a glove, for functional rehabilitation of the elbow and hand in patients with hemiparesis, and to compare it with physical therapy rehabilitation. Pretest-posttest design. Rehabilitation laboratory. Volunteer sample of persons (N=12) with persistent hemiparesis from a single, unilateral stroke within the past 3 to 36 months. The volunteers were randomly divided into 2 groups. One group was treated with a conventional program of physiotherapy, and another group participated in a training program in which an electromechanical orthosis was used. All volunteers received 24 sessions, held 3 times a week for 8 weeks. Modified Ashworth Scale (MAS), Fugl-Meyer Assessment (FMA), and electromyogram (EMG) amplitude. No statistical difference was found in the initial and final values of the MAS. Both groups showed a significant increase for the total scores of the FMA. However, only the group treated with the orthosis showed an increase in FMA scores related to the wrist and hand joint. The EMG analysis showed increased EMG amplitudes for all muscles in the group treated with the orthosis, whereas the group treated with physiotherapy showed gains in electromyographic activity only in the extensor digitorum communis. Intergroup comparison showed that the initial FMA scores of the wrist/hand were higher in the group treated with physiotherapy. However, after training, the scores in the group that used the orthosis were equivalent to those of the physiotherapy group. The results suggest that this device can be an auxiliary tool to help the conventional rehabilitation program of motor function of the affected upper extremity.
|
{
"pile_set_name": "PubMed Abstracts"
}
|
Types of Different Poker Chips
Poker chips come in all shapes and sizes and are an essential part of any poker game, be it Texas Hold'em, Omaha or 5 Card Draw. Understanding the different types of poker chips will help you determine which chips land-based casinos prefer as well as which chips to purchase for poker games at home. Let’s start by looking at the different types of poker chips available:
Plastic Poker Chips
Plastic chips are the most inexpensive poker chips available. Although there are many different types of plastic chips on the market, “dice chips” are quite easily the most popular and have a ring of card suits or dice around the edges. In most cases, plastic chips will contain a metal insert in the middle to give them added weight and will often have a slippery plastic feel and have a slight metallic clink compared to quality poker chips. Plastic poker chips are additionally available in a variety of colors than what’s needed and, although they are much cheaper than other poker chips, they do get the job done,
especially when used as home poker chips. For the more discerning poker player, however, nothing but the best will do, such as ceramic or clay chips.
Ceramic Poker Chips
Ceramic poker chips are casino grade poker chips and are 8 to 11.5 grams in weight and about 39mm in diameter. These chips are often made from a special resin similar to ceramic or porcelain using injection moulding. The most basic characteristic of ceramic poker chips is their designs, which are printed directly to the ceramic to prevent peeling or fading. As a result, ceramic chips are fully customizable to suit the needs of the land-based casino. What’s more, land-based casinos often prefer ceramic chips to clay chips because of their durability. It’s worth mentioning that ceramic chips are available to the home poker market, offering discerning poker players a much more sophisticated alternative to plastic sets.
Clay Poker Chips
Clay chips are the most esteemed of all poker chips and are synonymous with professional casino quality and texture. The basic design of clay poker chips includes a depressed round middle, or inlay, while the outside comprises of special mould designs. Clay poker chips can sometimes be striped around the edges with contrasting colors to the colors to the main colors of the chip. The clay poker chips used at land-based casinos generally are not pure clay anymore; they are made from a composition of clay and other materials, including chalk and sand, which are manufactured under extreme heat to bind the materials together. Why, you ask? Traditional clay poker chips are rather expensive to manufacture and are more likely to develop dents and other disfigurements.
Colors and Variations
There is no universal or standard color scheme for poker chips, nor will you find two land-based casinos with the same designs and variations. The colors found in the typical home set include white, black, red, green and blue, while other lower cost plastic sets have included pink, yellow, orange and gray. Some land-based casinos, especially those located in Las Vegas, embed their poker chips with ID tags to better keep track of them while making chips harder to counterfeit. Also, it is not uncommon for casinos to introduce “limited edition” poker chips, including metal poker chips, in order to encourage poker players to keep them as souvenirs, at a profit to the casino of course.
Poker Chips at the WSOP
The WSOP uses Paulson chips, amongst others. These are unslugged clay chips that weigh around 10 grams. During the 2016 main event, the yellow 1,000,000 poker was introduced, which was about 5mm larger in diameter.
Will poker chips from Paulson be used again at the 2017 World Series of Poker? More importantly, who will win the 2017 main event?
According to the WSOP website, the $10,000 buy in No-Limit Hold’em WSOP Main Event World Championship will kick-off on 8 July. The Main Event will play down to a final table of nine on 17 July, when a new champion will be decided. Check out the odds of winning as well as the odds of popular poker players at this year’s Main Event.
In 2016, the WSOP Main Event was won by Qui Nguyen, which earned him his first WSOP bracelet and $8,005,310 in winnings. At the time, very few expected Nguyen, a Las Vegas resident, to outplay his opponents, especially considering that he had had only one previous WSOP cash-in, while his biggest live tournament cash before the 2016 WSOP was for $9,029. In comparison to his final table opponents, most notably Cliff Josephy, with two WSOP bracelets and 17 previous WSOP cashes, Nguyen did what no-one expected: he became the champion after an intense eight-hour heads up match against second place runner-up, Gordon Vayo. Will Qui Nguyen be able to repeat his 2016 success? Only the cards (and chips) will tell!
This website written by David Spragg. Also trading on Ebay as
marlowpokerchips and marlowcasinochips.
|
{
"pile_set_name": "Pile-CC"
}
|
MANILA — Six soldiers were killed on Tuesday in the first major attack by Communist rebels in the Philippines since the 50th anniversary of their guerrilla movement last month, the military said.
The soldiers were checking on reports of guerrilla activity before dawn in the central island province of Samar when they struck an improvised land mine planted by rebels, said Col. Noel Detoyato, a spokesman for the army. He said an hourlong gun battle followed, during which soldiers believe some of the rebels were wounded.
“All of our casualties were caused by the improvised explosive device,” Colonel Detoyato said. “It was a powerful blast.” Six soldiers were wounded in addition to those killed, he said.
The New People’s Army, the armed wing of the underground Communist Party of the Philippines, claimed responsibility for the attack, saying it was carried out because the military “has a long and bloody trail of human rights violations” on Samar, a stronghold of the Communist movement. Samar was struck by a powerful earthquake on Tuesday afternoon.
|
{
"pile_set_name": "OpenWebText2"
}
|
Q:
Storing fish shell aliases in another file
I have a config.fish in ~/.config/fish. While editing my fish_prompt I accidentally deleted my aliases once. I did have backup, but I want to store all aliases separately from now on. Also, how can I auto-load all of my aliases when I source the newly-edited config.fish?
I have alias update="source ~/.config/fish/config.fish". So if I make change to the location of my config.fish and edit the alias as necessary, next time I update the updated alias should reflect in the updated config. How can I do this?
A:
There are a few things fish offers here:
Files in ~/.config/fish/functions named after a function (plus a ".fish" ending) will be autoloaded once that function is called
Files in ~/.config/fish/conf.d/ (with a ".fish" ending) will be sourced before config.fish
So you can either put your functions/aliases in a function file each, or put them in files in conf.d in whatever grouping you want.
Also you can put your fish_prompt in its own file - ~/.config/fish/functions/fish_prompt.fish
(also "alias" is simply a cheesy helper function to make functions - the core shell has no concept of aliases)
|
{
"pile_set_name": "StackExchange"
}
|
Q:
Why is this theorem attributed to J.-P. Serre?
Page $117$ of Atiyah, MacDonald's Introduction to Commutative Algebra text has the following theorem. Let $P(M,t)$ denote the Poincare- series of $M$.
$\textbf{Theorem.}$ $\bigl(\mathsf{Hilbert-Serre}\bigr)$. $P(M,t)$ is a rational function in $t$ of the form $f(t)/\prod_{i=1}^{s} (1-t^{k_i})$, where $f(t) \in \mathbf{Z}[t]$.
This theorem appears in the section of the book called Hilbert-Functions (page 116), so one understands that it could have possibly been discovered by Hilbert.
But why is the above theorem attributed to J.-P. Serre? References about when Serre was credited to the above theorem would be helpful.
A:
I don't know what Atiyah-Macdonald were thinking, but I can tell you a theorem which is attributed to Serre (correctly, I think), and is relevant to this question.
Let $M$ be a finitely-generated graded $k[x_0, x_1, \ldots, x_n]$ module. Let $H^0(M)$, $H^1(M)$, ..., $H^n(M)$ be the local cohomology modules of $M$ with respect to the maximal ideal $\langle x_0,\ldots, x_n \rangle$. These are graded modules which satisfy the following properties:
Theorem: For all integers $d$, the function
$$\dim M_d - \sum_{r=0}^n (-1)^r \dim H^r(M)_d$$
is polynomial in $d$.
Theorem (Serre vanishing) For $d$ sufficiently large, $H^r(M)_d=0$.
So Serre vanishing separates Hilbert's theorem into two parts: A certain function is a polynomial for all $d$, and that function is equal to the Hilbert function for large $d$.
I'm presenting this using the language of commutative algebra, which I don't think is the language Serre used. In sheaf cohomology language, let $\mathcal{M}$ be the sheaf on $\mathbb{P}^{n-1}$ corresponding to $M$ and let $\mathcal{H}^r(M) = \bigoplus_{d=-\infty}^{\infty} H^r(\mathbb{P}^{n-1}, \mathcal{M} \otimes \mathcal{O}(-d))$. Then the relation between sheaf cohomology and local cohomology is that
$$\mathcal{H}^r(M) \cong H^{r+1}(M)$$
for $r \geq 1$ and there is a short exact sequence
$$0 \to H^0(M) \to M \to \mathcal{H}^0(M) \to H^1(M) \to 0.$$
In this language, Serre vanishing says that, for $d$ large, $\mathcal{H}^r(M)_d=0$ for $r>0$ and $M_d \cong \mathcal{H}^0(M)_d$; this is how the result is usually stated.
The first theorem in this language is that $\dim \sum_{r=0}^{n-1} (-1)^r \mathcal{H}^r(M)_d$ is a polynomial in $d$.
|
{
"pile_set_name": "StackExchange"
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.