text
stringlengths
1
1.04M
language
stringclasses
25 values
package yaml_file import ( "bytes" "fmt" "io/ioutil" "text/template" "gopkg.in/yaml.v2" ) func parseTestDefinitionFile(absPath string) ([]Test, error) { data, err := ioutil.ReadFile(absPath) if err != nil { return nil, fmt.Errorf("failed to read file %s:\n%s", absPath, err) } var testDefinitions []TestDefinition // reading the test source file if err := yaml.Unmarshal(data, &testDefinitions); err != nil { return nil, fmt.Errorf("failed to unmarshall %s:\n%s", absPath, err) } var tests []Test for _, definition := range testDefinitions { if testCases, err := makeTestFromDefinition(definition); err != nil { return nil, err } else { tests = append(tests, testCases...) } } return tests, nil } func substituteArgs(tmpl string, args map[string]interface{}) (string, error) { compiledTmpl, err := template.New("").Parse(tmpl) if err != nil { return "", err } buf := &bytes.Buffer{} if err := compiledTmpl.Execute(buf, args); err != nil { return "", err } return buf.String(), nil } func substituteArgsToMap(tmpl map[string]string, args map[string]interface{}) (map[string]string, error) { res := make(map[string]string) for key, value := range tmpl { var err error res[key], err = substituteArgs(value, args) if err != nil { return nil, err } } return res, nil } // Make tests from the given test definition. func makeTestFromDefinition(testDefinition TestDefinition) ([]Test, error) { var tests []Test // test definition has no cases, so using request/response as is if len(testDefinition.Cases) == 0 { test := Test{TestDefinition: testDefinition} test.Request = testDefinition.RequestTmpl test.Responses = testDefinition.ResponseTmpls test.ResponseHeaders = testDefinition.ResponseHeaders test.BeforeScript = testDefinition.BeforeScriptParams.PathTmpl test.DbQuery = testDefinition.DbQueryTmpl test.DbResponse = testDefinition.DbResponseTmpl return append(tests, test), nil } var err error requestTmpl := testDefinition.RequestTmpl beforeScriptPathTmpl := testDefinition.BeforeScriptParams.PathTmpl requestURLTmpl := testDefinition.RequestURL queryParamsTmpl := testDefinition.QueryParams headersValTmpl := testDefinition.HeadersVal cookiesValTmpl := testDefinition.CookiesVal responseHeadersTmpl := testDefinition.ResponseHeaders // produce as many tests as cases defined for caseIdx, testCase := range testDefinition.Cases { test := Test{TestDefinition: testDefinition} test.Name = fmt.Sprintf("%s #%d", test.Name, caseIdx) // substitute RequestArgs to different parts of request test.RequestURL, err = substituteArgs(requestURLTmpl, testCase.RequestArgs) if err != nil { return nil, err } test.Request, err = substituteArgs(requestTmpl, testCase.RequestArgs) if err != nil { return nil, err } test.QueryParams, err = substituteArgs(queryParamsTmpl, testCase.RequestArgs) if err != nil { return nil, err } test.HeadersVal, err = substituteArgsToMap(headersValTmpl, testCase.RequestArgs) if err != nil { return nil, err } test.CookiesVal, err = substituteArgsToMap(cookiesValTmpl, testCase.RequestArgs) if err != nil { return nil, err } // substitute ResponseArgs to different parts of response test.Responses = make(map[int]string) for status, tpl := range testDefinition.ResponseTmpls { args, ok := testCase.ResponseArgs[status] if ok { // found args for response status test.Responses[status], err = substituteArgs(tpl, args) if err != nil { return nil, err } } else { // not found args, using response as is test.Responses[status] = tpl } } test.ResponseHeaders = make(map[int]map[string]string) for status, respHeaders := range responseHeadersTmpl { args, ok := testCase.ResponseArgs[status] if ok { // found args for response status test.ResponseHeaders[status], err = substituteArgsToMap(respHeaders, args) if err != nil { return nil, err } } else { // not found args, using response as is test.ResponseHeaders[status] = respHeaders } } test.BeforeScript, err = substituteArgs(beforeScriptPathTmpl, testCase.BeforeScriptArgs) if err != nil { return nil, err } test.DbQuery, err = substituteArgs(testDefinition.DbQueryTmpl, testCase.DbQueryArgs) if err != nil { return nil, err } // compile DbResponse if testCase.DbResponse != nil { // DbResponse from test case has top priority test.DbResponse = testCase.DbResponse } else { if len(testDefinition.DbResponseTmpl) != 0 { // compile DbResponse string by string for _, tpl := range testDefinition.DbResponseTmpl { dbResponseString, err := substituteArgs(tpl, testCase.DbResponseArgs) if err != nil { return nil, err } test.DbResponse = append(test.DbResponse, dbResponseString) } } else { test.DbResponse = testDefinition.DbResponseTmpl } } tests = append(tests, test) } return tests, nil }
go
<filename>src/main/resources/static/mas_json/2011_chi_-5309384004307438789.json<gh_stars>10-100 {"title": "Fitt's law as an explicit time/error trade-off.", "fields": ["data set", "power law", "trade off", "resource allocation", "fitts s law"], "abstract": "The widely-held view that Fitts' law expresses a speed/accuracy trade-off is presumably correct, but it is vague. We outline a simple resource-allocation theory of Fitts' law in which movement time and error trade for each other. The theory accounts quite accurately for the data of Fitts' (1954) seminal study, as well as some fresh data of our own. In both data sets we found the time/error trade-off to obey a power law. Our data, which we could analyze more thoroughly than Fitts', are consistent with a square-root function with a single adjustable constant. We suggest that the resource-allocation framework should help combine information and energy considerations to allow a more complete account of Fitts' law.", "citation": "Citations (19)", "year": "2011", "departments": ["T\u00e9l\u00e9com ParisTech", "T\u00e9l\u00e9com ParisTech", "T\u00e9l\u00e9com ParisTech"], "conf": "chi", "authors": ["<NAME>.....http://dblp.org/pers/hd/g/Guiard:Yves", "<NAME>.....http://dblp.org/pers/hd/o/Olafsdottir:Halla_B=", "<NAME>.....http://dblp.org/pers/hd/p/Perrault:Simon_T="], "pages": 10}
json
Even before the pandemic, the banking sector and the BFSI industry had begun to see the value of digitising processes in order to detect fraud, protect data, serve customers faster and minimise the prospect of human error. Post the pandemic, the need for radical digital transformation has gained even more urgency and as Alok Bansal, MD, Visionet Systems India and Global Head of BFSI business says, "In the post pandemic world, supply chains, services, systems and manual data processing have all been disrupted and I see the inevitable emergence of innovative technologies that can provide adaptive and flexible solutions in the BFSI sector. " Mr. Alok Bansal says that COVID-19's impact on industries, livelihoods and health markers is inestimable and the one way that people have continued to transact and communicate is through technology. He believes digitalisation plans have been accelerated to achieve goals that would have in ordinary circumstances taken years. He adds, "AI tools like Intelligent Document Processing (IDP) solutions have revolutionised the way unstructured and semi-structured information is processed and such innovations are helping us to scale up business opportunities, maximise productivity as well as revenue by saving valuable time and resources. Optimised technical proficiency is especially helpful in accelerating the mortgage process. Soon processing lengthy paperwork may become a thing of the past and lenders may increasingly opt for advanced digital Business Process Management (BPM) solutions. " He also believes with brick and mortar banking services interrupted, Conversational AI will plug in information gaps speedily and streamline the mortgage loan process. As a leading provider of BPM solutions, Visionet has recently developed a future ready, award-winning Intelligent Document Processing solution called DocVu. AI, which processes large volumes of data using Optical Character Recognition (OCR), Intelligent Character Recognition (ICR) and machine learning algorithms. Says Mr. Alok Bansal, "AI tools like DocVu. AI process data at a speed and a cost that cannot be achieved manually. The tool also makes classification and data extraction easier than ever before. It can serve businesses regardless of their size, with a fully integrated workflow engine and regulatory compliance. It helps mitigate losses, bolsters security and helps improve customer relationships. The future is right here, right now and we are ready for it. "
english
{ "id": "companion-potamus__DROPS__muddy-pelt", "type": "DROPS", "start": "companion-potamus", "end": "muddy-pelt" }
json
package org.lkpnotice.infra.architecture; /** * Created by jpliu on 2020/5/22. */ public class Main { }
java
<reponame>p0tr3c-terraform/driftctl {"Typ":"<KEY>==","Val":"eyJhY2NlbGVyYXRpb25fc3RhdHVzIjoiIiwiYWNsIjpudWxsLCJhcm4iOiJhcm46YXdzOnMzOjo6YnVja2V0LW1hcnRpbi10ZXN0LWRyaWZ0IiwiYnVja2V0IjoiYnVja2V0LW1hcnRpbi10ZXN0LWRyaWZ0IiwiYnVja2V0X2RvbWFpbl9uYW1lIjoiYnVja2V0LW1hcnRpbi10ZXN0LWRyaWZ0LnMzLmFtYXpvbmF3cy5jb20iLCJidWNrZXRfcHJlZml4IjpudWxsLCJidWNrZXRfcmVnaW9uYWxfZG9tYWluX25hbWUiOiJidWNrZXQtbWFydGluLXRlc3QtZHJpZnQuczMuZXUtd2VzdC0zLmFtYXpvbmF3cy5jb20iLCJjb3JzX3J1bGUiOltdLCJmb3JjZV9kZXN0cm95IjpudWxsLCJncmFudCI6W10sImhvc3RlZF96b25lX2lkIjoiWjNSMUszNjlHNUFWREciLCJpZCI6ImJ1Y2tldC1tYXJ0aW4tdGVzdC1kcmlmdCIsImxpZmVjeWNsZV9ydWxlIjpbXSwibG9nZ2luZyI6W10sIm9iamVjdF9sb2NrX2NvbmZpZ3VyYXRpb24iOltdLCJwb2xpY3kiOm51bGwsInJlZ2lvbiI6ImV1LXdlc3QtMyIsInJlcGxpY2F0aW9uX2NvbmZpZ3VyYXRpb24iOltdLCJyZXF1ZXN0X3BheWVyIjoiQnVja2V0T3duZXIiLCJzZXJ2ZXJfc2lkZV9lbmNyeXB0aW9uX2NvbmZpZ3VyYXRpb24iOltdLCJ0YWdzIjp7fSwidmVyc2lvbmluZyI6W3siZW5hYmxlZCI6ZmFsc2UsIm1mYV9kZWxldGUiOmZhbHNlfV0sIndlYnNpdGUiOltdLCJ3ZWJzaXRlX2RvbWFpbiI6bnVsbCwid2Vic2l0ZV9lbmRwb2ludCI6bnVsbH0=","Err":null}
json
Riadyh: The crown prince of Saudi Arabia on Wednesday called the killing of a prominent journalist at the Middle Eastern kingdom's consulate in the Turkish city of Istanbul a heinous crime that cannot be justified. Mohammed bin Salman told attendees at the Future Investment Initiative - popularly known as the "Davos in the Desert" summit - that the slaying of Washington Post columnist Jamal Khashoggi would not, however, drive a wedge between his country and Turkey, Efe reported. "The crime was really painful to all Saudis and I believe it is painful to every human in the world," the heir to the Saudi throne said at the economic forum being held in Riyadh. "It is a heinous crime that cannot be justified. " "Today, Saudi Arabia is carrying all legal actions to finalize investigations in cooperation with the Turkish government and bring the perpetrators to justice," Bin Salman added. This is the first time the prince has publicly addressed the case after Saudi Arabia admitted on Saturday that Khashoggi had died inside the Istanbul consulate, claiming that his death had resulted from a fistfight. The international community has overwhelmingly met this explanation with considerable skepticism. The remarks came a day after Turkish President Recep Tayyip Erdogan said that his government suspected the killing was premeditated and carried out by a 15-member hit squad flown in from the Arab country. Khashoggi, himself a member of the Saudi elite, had been mostly critical of the crown prince - often referred to as MbS - ever since the latter was made the heir apparent in June 2017. (IANS)
english
import { IActionPayload } from '@nx-ng-starter/client-util'; export interface IMdFilesState { mdFilePaths: string[]; filePath: string; } export type TSelectMdFilePayload = IActionPayload<Partial<IMdFilesState>>;
typescript
GUWAHATI: The Indian National Group of the International Association for Bridge and Structural Engineering (ING-IABSE) in association with Ministry of Road Transport & Highways, National Highways Authority of India and NHIDCL, organized a two day workshop on “Quality Assurance in Bridges and Flyovers - Design and Construction” on March 8 and 9 at Guwahati. The government of India has embarked upon a massive road development programme in the country through Ministry of Road Transport & Highways, National Highways Authority of India and NHIDCL. A large number of major bridges and flyovers are being constructed as a part of this programme, particularly in the Northeastern states, including Assam. While design and construction of these structures, which serve as vital links in the road network, are normally done by the experienced consultants, there are several areas of concern of the client and the users regarding their quality of design and construction, including use of materials and testing, keeping in view their long design service life of 100 years, based on limit state method of design. The objective of this workshop is to develop more awareness among the engineers of the state PWDs and other executing agencies about the importance of quality control and quality assurance in design and construction of these structures, keeping in view their long design service life. As per a press release, the knowledge and experiences gathered from various presentations in this workshop are expected to be utilized by the client engineers in monitoring the quality aspects of these structures.
english
Guys i need ur help ! ! ! ! I want to mod my cabinate & this is the first time i'm going to be doing that! ! ! ! So can u give me some advise ! ! ! ! & i want to cut the steel, so can u tell me how to do that ! ! ! For cutting steel u need a high speed saw or water jet or u can use a plasma cutter. There are more but these are widely used. Warning: Cutting should be done under some professional guidance if u don't know what to do. It may become lethal!
english
<gh_stars>0 .noScroll::-webkit-scrollbar { width: 0 !important }
css
<filename>_data/proposition/P_cosatanne0.json { "citations" : [ { "textCitation" : "[See cosatanne0 on Metamath](http://us.metamath.org/mpegif/cosatanne0.html)" } ], "names" : [ "cosatanne0" ], "language" : "METAMATH_SET_MM", "lookupTerms" : [ "#T_cA", "#T_wcel", "#T_cdm", "#T_catan", "#T_wi", "#T_ccos", "#T_cfv", "#T_catan", "#T_cfv", "#T_cA", "#T_wne", "#T_cc0" ], "metaLanguage" : "METAMATH", "remarks" : " The arctangent function has range contained in the domain of the tangent. (Contributed by <NAME>, 3-Apr-2015.) ", "statement" : "cosatanne0 $p |- ( A e. dom arctan -> ( cos ` ( arctan ` A ) ) =/= 0 ) $." }
json
<gh_stars>100-1000 { "schema_version": "1.2.0", "id": "GHSA-g9qh-rx87-crmv", "modified": "2022-05-03T03:25:28Z", "published": "2022-05-03T03:25:28Z", "aliases": [ "CVE-2011-0037" ], "details": "Microsoft Malware Protection Engine before 1.1.6603.0, as used in Microsoft Malicious Software Removal Tool (MSRT), Windows Defender, Security Essentials, Forefront Client Security, Forefront Endpoint Protection 2010, and Windows Live OneCare, allows local users to gain privileges via a crafted value of an unspecified user registry key.", "severity": [ ], "affected": [ ], "references": [ { "type": "ADVISORY", "url": "https://nvd.nist.gov/vuln/detail/CVE-2011-0037" }, { "type": "WEB", "url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/65626" }, { "type": "WEB", "url": "http://secunia.com/advisories/43468" }, { "type": "WEB", "url": "http://securitytracker.com/id?1025117" }, { "type": "WEB", "url": "http://www.microsoft.com/technet/security/advisory/2491888.mspx" }, { "type": "WEB", "url": "http://www.securityfocus.com/bid/46540" }, { "type": "WEB", "url": "http://www.vupen.com/english/advisories/2011/0486" } ], "database_specific": { "cwe_ids": [ "CWE-20" ], "severity": "HIGH", "github_reviewed": false } }
json
<reponame>ortaly/react-bootstrap-vs-material-ui /* * Bootstrap * * This is the first thing users see of our App, at the '/materialDesign' route * * NOTE: while this component should technically be a stateless functional * component (SFC), hot reloading does not currently support SFCs. If hot * reloading is not a necessity for you then you can refactor it and remove * the linting exception. */ import React from 'react'; import { FormattedMessage } from 'react-intl'; import messages from './messages'; import injectTapEventPlugin from 'react-tap-event-plugin'; import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'; import {FlatButton, RaisedButton, FloatingActionButton, Subheader, IconButton, LinearProgress, CircularProgress } from 'material-ui'; import ContentAdd from 'material-ui/svg-icons/content/add'; import StarBorder from 'material-ui/svg-icons/toggle/star-border'; import {GridList, GridTile} from 'material-ui/GridList'; export default class MaterialUi extends React.PureComponent { // eslint-disable-line react/prefer-stateless-function constructor(props){ super(props); injectTapEventPlugin(); this.state = { completed: 0, }; } componentDidMount() { this.timer = setTimeout(() => this.progress(5), 1000); } componentWillUnmount() { clearTimeout(this.timer); } progress(completed) { if (completed > 100) { this.setState({completed: 100}); } else { this.setState({completed}); const diff = Math.random() * 10; this.timer = setTimeout(() => this.progress(completed + diff), 1000); } } getRandomColor() { var letters = '<KEY>'; var color = '#'; for (var i = 0; i < 6; i++) { color += letters[Math.floor(Math.random() * 16)]; } return color; } render() { const RaisedButtonStyle = { margin: 12, }; const FloatingActionButtonStyle = { marginRight: 20, }; const marginElements = { marginTop: 20, marginBottom: 20 }; const gridStyles = { root: { display: 'flex', flexWrap: 'wrap', justifyContent: 'space-around', }, gridList: { width: 500, height: 450, overflowY: 'auto', }, gridTileStyle: { backgroundColor: 'red', color: 'red' } }; const preStyle = { display: 'block', padding: '9.5px', margin: '0 0 10px', fontSize: '13px', lineHeight: '1.42857143', color: '#333', wordBreak: 'break-all', wordWrap: 'break-word', backgroundColor: '#f5f5f5', border: '1px solid #ccc', borderRadius: '4px' } const tilesData = [ { img: 'images/grid-list/00-52-29-429_640.jpg', title: 'Breakfast', author: 'jill111', featured: true, }, { img: 'images/grid-list/burger-827309_640.jpg', title: 'Tasty burger', author: 'pashminu', }, { img: 'images/grid-list/camera-813814_640.jpg', title: 'Camera', author: 'Danson67', }, { img: 'images/grid-list/morning-819362_640.jpg', title: 'Morning', author: 'fancycrave1', featured: true, }, { img: 'images/grid-list/hats-829509_640.jpg', title: 'Hats', author: 'Hans', }, { img: 'images/grid-list/honey-823614_640.jpg', title: 'Honey', author: 'fancycravel', }, { img: 'images/grid-list/vegetables-790022_640.jpg', title: 'Vegetables', author: 'jill111', }, { img: 'images/grid-list/water-plant-821293_640.jpg', title: 'Water plant', author: 'BkrmadtyaKarki', }, ]; return ( <MuiThemeProvider> <div> <h1> <FormattedMessage {...messages.header} /> </h1> <h2> Buttons </h2> <h5> Flat Buttons: </h5> <div> <FlatButton label="Default" /> <FlatButton label="Primary" primary={true} /> <FlatButton label="Secondary" secondary={true} /> <FlatButton label="Disabled" disabled={true} /> <br /> <br /> <FlatButton label="Full width" fullWidth={true} /> </div> <br /> <pre style={preStyle}>{` <div> <FlatButton label="Default" /> <FlatButton label="Primary" primary={true} /> <FlatButton label="Secondary" secondary={true} /> <FlatButton label="Disabled" disabled={true} /> <FlatButton label="Full width" fullWidth={true} /> </div> `}</pre> <h5> Raised Buttons: </h5> <div> <RaisedButton label="Default" style={RaisedButtonStyle} /> <RaisedButton label="Primary" primary={true} style={RaisedButtonStyle} /> <RaisedButton label="Secondary" secondary={true} style={RaisedButtonStyle} /> <RaisedButton label="Disabled" disabled={true} style={RaisedButtonStyle} /> <br /> <br /> <RaisedButton label="Secondary Full width" secondary={true} fullWidth={true} /> </div> <br /> <pre style={preStyle}>{` <div> <RaisedButton label="Default" style={RaisedButtonStyle} /> <RaisedButton label="Primary" primary={true} style={RaisedButtonStyle} /> <RaisedButton label="Secondary" secondary={true} style={RaisedButtonStyle} /> <RaisedButton label="Disabled" disabled={true} style={RaisedButtonStyle} /> <br /> <br /> <RaisedButton label="Secondary Full width" secondary={true} fullWidth={true} /> </div> `}</pre> <h5>Action Buttons: </h5> <div style={marginElements}> <FloatingActionButton style={FloatingActionButtonStyle}> <ContentAdd /> </FloatingActionButton> <FloatingActionButton mini={true} style={FloatingActionButtonStyle}> <ContentAdd /> </FloatingActionButton> <FloatingActionButton secondary={true} style={FloatingActionButtonStyle}> <ContentAdd /> </FloatingActionButton> <FloatingActionButton mini={true} secondary={true} style={FloatingActionButtonStyle}> <ContentAdd /> </FloatingActionButton> <FloatingActionButton disabled={true} style={FloatingActionButtonStyle}> <ContentAdd /> </FloatingActionButton> <FloatingActionButton mini={true} disabled={true} style={FloatingActionButtonStyle}> <ContentAdd /> </FloatingActionButton> </div> <br /> <pre style={preStyle}>{` <div style={marginElements}> <FloatingActionButton style={FloatingActionButtonStyle}> <ContentAdd /> </FloatingActionButton> <FloatingActionButton mini={true} style={FloatingActionButtonStyle}> <ContentAdd /> </FloatingActionButton> <FloatingActionButton secondary={true} style={FloatingActionButtonStyle}> <ContentAdd /> </FloatingActionButton> <FloatingActionButton mini={true} secondary={true} style={FloatingActionButtonStyle}> <ContentAdd /> </FloatingActionButton> <FloatingActionButton disabled={true} style={FloatingActionButtonStyle}> <ContentAdd /> </FloatingActionButton> <FloatingActionButton mini={true} disabled={true} style={FloatingActionButtonStyle}> <ContentAdd /> </FloatingActionButton> </div> `}</pre> <h2> Grid List:</h2> <div style={gridStyles.root}> <GridList cols={2} cellHeight={200} padding={1} style={gridStyles.gridList} > {tilesData.map((tile) => ( <GridTile key={tile.img} title={tile.title} actionIcon={<IconButton><StarBorder color="white" /></IconButton>} actionPosition="left" titlePosition="top" titleBackground="linear-gradient(to bottom, rgba(0,0,0,0.7) 0%,rgba(0,0,0,0.3) 70%,rgba(0,0,0,0) 100%)" cols={tile.featured ? 2 : 1} rows={tile.featured ? 2 : 1} style={{backgroundColor: this.getRandomColor()}} > </GridTile> ))} </GridList> </div> <br /> <pre style={preStyle}>{` <GridList cols={2} cellHeight={200} padding={1} style={gridStyles.gridList} > {tilesData.map((tile) => ( <GridTile key={tile.img} title={tile.title} actionIcon={<IconButton><StarBorder color="white" /></IconButton>} actionPosition="left" titlePosition="top" titleBackground="linear-gradient(to bottom, rgba(0,0,0,0.7) 0%,rgba(0,0,0,0.3) 70%,rgba(0,0,0,0) 100%)" cols={tile.featured ? 2 : 1} rows={tile.featured ? 2 : 1} style={{backgroundColor: this.getRandomColor()}} > </GridTile> ))} </GridList> `}</pre> <h2> Progress Bar </h2> <h5>Circular Progress:</h5> <CircularProgress mode="determinate" value={this.state.completed} size={60} thickness={7} /> <h5>Linear Progress:</h5> <LinearProgress mode="determinate" value={this.state.completed} style={marginElements}/> <pre style={preStyle}>{` <CircularProgress mode="determinate" value={this.state.completed} size={60} thickness={7} /> <LinearProgress mode="determinate" value={this.state.completed} style={marginElements}/> `}</pre> </div> </MuiThemeProvider> ); } }
javascript
At the trailer launch of Pati Patni Aur Woh, one of its lead actors, Bhumi Pednekar famously claimed the film was not sexist. This was in response to the growing controversy ever since a clip featuring Kartik Aryan bemoaning the predicament of middle-class men went viral. In the dialogue that has since been changed (though director Mudassar Aziz maintains there was nothing wrong), he lamented how there was no right way for men to have sex with their wives: if they demand it, they are deemed beggars; if they don’t “give”, then they are accused of depriving her and if they somehow manage to “get it”, they are termed rapists. The original 1978 film itself was a deeply problematic comedy of a philandering man, which appears even more baffling when seen from today’s lens. Pednekar’s explanation then also sought to justify the existence of the film in the present day and age, it aimed at admitting that the fault might lie in the stars but the film does not reside in the same galaxy anymore. That, this was a cinematic rectification of its predecessor. Sadly it is not. In the Sanjeev Kumar starrer, his wife Sharda (Vidya Sinha) is a meek homemaker who remains blissfully unaware of her husband Ranjeet’s roving eye till she chances upon his handkerchief with a lipstick mark imprinted (in the exact shape of a pair of lips, no less) to be suspicious. Even then she is routinely fooled by him till she sees him with his secretary, Nirmala (Ranjeeta Kaur) in a garden. This “damning evidence” blows the lid. She throws a fit temporarily but quietly goes back to her previous subservient role, believing her remorseful husband and accepting her fate. In 2019, Vedika Tripathi (Pednekar) has a Master’s degree in Physics and promptly lists having sex as one of the things she enjoys in her first encounter with Abhinav Tyagi (Kartik Aaryan). She might be from Lucknow, but has aspirations of her own, and would rather visit the gym than rush to visit her husband at home after work. She does not overlook but looks through her husband and his lies. She does not stop at the threshold but takes a step forward and leaves him: Women empowerment 101. But the problem with the remake and Pednekar’s argument lies in both their (mis)identification of what made the original sexist in the first place. It was not the women but the man. Ranjeet, a successful Sales Manager, seemingly happy with his wife and children makes up a sob story about his fatally ill wife to gain sympathy and love of Nirmala. He does so not out of any aching dissatisfaction but to feel better about himself; to feel more of a man. Chintu Tyagi, on the other hand, is re-created more soberingly. Growing up, his will had been constantly stifled by his parents. They decided his career and wife for him. His alliance with Tapasya Singh (Ananya Panday) then is more an act of rebellion than deliberately cheating on his wife. And Aziz spends an awful amount of time underlining the difference in the intent behind their actions (which also includes another Kartik Aaryan monologue triggered by nothing in particular) possibly to reinstate that this is a different film. But this dissimilarity between the two protagonists is as flimsy as the moustache Aaryan dons in the film (which he later shaves off). The BR Chopra directorial feature had not stopped at merely depicting infidelity but had gone forth to present a deeply unrepentant man who refused to take responsibility for any of his actions till the end. He was even shown repeating his actions only to be told by his friend to check himself. Back then, this was supposed to be funny. The incredulous and inexplicable licensing that comes with the idea of #MenWillBeMen was perhaps even the norm. It was this that made the film sexist. In his retelling, Aziz tries to be woke (a little too hard) — the husband and wife refer to each other by their (sur)names- “Tripathi- Tyagi”, even their nameplate features both their names — but ultimately remains stubbornly tone-deaf and repeats the beat of the original down to his protagonist taking absolutely no accountability for his actions. The man here, a PWD officer in 2019, still gets away with cheating and lying, is forgiven by both – patni and woh – after duping one and assassinating the other’s character. All he had to do was show up drunk twice and run to the airport in calculated haste. The norm in this universe is still that #MenWillBeMen. In some ways, this remake is more woeful for it refuses to acknowledge the time it is situated in, and much like its protagonist, it also sloughs off responsibility. There is a particularly troubling bit where men in Tyagi’s office and his closest friend make allowances for his actions and are even complicit, thereby restating that some philandering comes as an unsaid perk with the gender. It is rather pitiful for it still intrinsically believes that it is the duty of women to prevent their husbands from straying and they ought to undertake strenuous physical and mental labour to ensure that. It is the kind of film that confuses short-lived rebellion with women empowerment and fools its characters (and actors) into believing that co-conspiring together against a man is sisterhood.
english
<reponame>marrus-sh/7c --- shorttitle: Guide slug: guide title: Reader's Guide --- <p> This Reader's Guide is presented to give readers a highly-structured overview of the content contained in this encyclopædia, by breaking it up into seven broad areas of knowledge and then further into fields and branches of study. It is not a comprehensive list of the articles available through this encyclopædia (for that, see the {% include link.html from=site.general of="index" %}), but it should be sufficient to get readers started in whichever subject-area they see fit to expore. <nav id="nature"> {% include heading.html level=3 section="nature" text="The Sevensi natural setting" %} <nav id="nature-overview"> {% include heading.html level=4 section="nature-overview" text="Overview of the land and its people" %} <nav id="nature-general"> {% include heading.html level=5 section="nature-general" text="General articles" %} <ul> <li> {% include link.html from=site.entries of="Continent" %} <li> {% include link.html from=site.entries of="population" %} </ul> </nav> <nav id="climate-phenomena"> {% include heading.html level=5 section="climate-phenomena" text="Climate and natural phenomena" %} <ul> <li> {% include link.html from=site.entries of="climate" %} <li> {% include link.html from=site.entries of="earthquakes" %} <li> {% include link.html from=site.entries of="hot_springs" %} <li> {% include link.html from=site.entries of="hurricanes" %} <li> {% include link.html from=site.entries of="volcanoes" %} </ul> </nav> </nav> <nav id="geography"> {% include heading.html level=4 section="geography" text="Geography" %} <nav id="regions"> {% include heading.html level=5 section="regions" text="Major regions" %} </nav> <nav id="landmarks"> {% include heading.html level=5 section="landmarks" text="Landmarks" %} </nav> <nav id="water"> {% include heading.html level=5 section="water" text="Rivers and bodies of water" %} </nav> <nav id="islands"> {% include heading.html level=5 section="islands" text="Important islands" %} </nav> </nav> <nav id="plants-animals"> {% include heading.html level=4 section="plants-animals" text="Plants and animals" %} <nav id="plants"> {% include heading.html level=5 section="plants" text="Plants" %} </nav> <nav id="animals"> {% include heading.html level=5 section="animals" text="Animals" %} </nav> </nav> </nav> <nav id="history"> {% include heading.html level=3 section="history" text="History" %} <nav id="history-overview"> {% include heading.html level=4 section="nature-overview" text="Overview of Sevensi history" %} <nav id="history-general"> {% include heading.html level=5 section="history-general" text="General articles" %} </nav> <nav id="periods"> {% include heading.html level=5 section="periods" text="Periods" %} </nav> <nav id="dynasties"> {% include heading.html level=5 section="dynasties" text="Dynasties" %} </nav> </nav> <nav id="prehistory-archaeology"> {% include heading.html level=4 section="prehistory-archaeology" text="Prehistory and Archæology" %} <nav id="prehistory"> {% include heading.html level=5 section="prehistory" text="Prehistory" %} </nav> <nav id="archaeology"> {% include heading.html level=5 section="archaeology" text="Archaeology" %} </nav> <nav id="protohistory"> {% include heading.html level=5 section="protohistory" text="Protohistory" %} </nav> </nav> <nav id="classical"> {% include heading.html level=4 section="classical" text="The Classical period" %} </nav> </nav> <nav id="society"> {% include heading.html level=3 section="society" text="Society" %} <i>Forthcoming.</i> </nav> <nav id="economy"> {% include heading.html level=3 section="economy" text="Economy" %} <i>Forthcoming.</i> </nav> <nav id="arts"> {% include heading.html level=3 section="arts" text="Arts and literature" %} <i>Forthcoming.</i> </nav> <nav id="culture"> {% include heading.html level=3 section="culture" text="Language and culture" %} <i>Forthcoming.</i> </nav> <nav id="life"> {% include heading.html level=3 section="life" text="Daily life" %} <i>Forthcoming.</i> </nav>
html
The Rourkela Steel Plant was adjudged with its best-ever 4. 75-star energy rating in the competition held by the Confederation of Indian Industry (CII) in September. The Rourkela Steel Plant of Steel Authority of India Limited (SAIL) bagged the Energy Conservation Award in the Eastern region ENCON Award 2021 competition. The Rourkela Steel Plant was adjudged with its best-ever 4. 75-star energy rating in the competition held by the Confederation of Indian Industry (CII) in September. The rating is also the best ever for SAIL. SR Suryawanshi, ED (Works), handed over the ENCON Award Certificate to Naresh Kumar, CGM (Utilities and Environment), KK Pandey, GM Incharge (EMD) and his team during an award ceremony held at the office of ED (Works) on November 5, 2021. Speaking at the occasion, Suryawanshi commended the efforts of the energy management department in reducing specific energy consumption patterns of the plant which has led to huge cost savings. Some of the activities undertaken by the department which helped in bagging the award were modification in BF gas grid along with Coke Ovens, Blast Furnace and Instrumentation Departments. These activities have resulted in retrieval of additional BF gas of about 70 000 Nm3/hr into the network. The additional BF gas allocation to Captive Power Plant -I and Power Blowing Station has led to reduction in boiler coal consumption of around 100004 Tons in CPP-I in 2020-21 over previous year. This has enabled to reduce Specific Energy consumption to 6. 19 Giga Cal/Ton of Crude Steel, which is best amongst SAIL plants.
english
/* Copyright Soramitsu Co., Ltd. 2016 All Rights Reserved. http://soramitsu.co.jp Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package io.soramitsu.examplepoint.view.dialog; import android.app.Activity; import android.app.Dialog; import android.content.DialogInterface; import android.support.v7.app.AlertDialog; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import io.soramitsu.examplepoint.R; import io.soramitsu.examplepoint.databinding.DialogBinding; import io.soramitsu.examplepoint.util.AndroidSupportUtil; public class ErrorDialog { private AlertDialog dialog; private DialogBinding dialogErrorBinding; public ErrorDialog(LayoutInflater inflater) { dialogErrorBinding = DialogBinding.inflate(inflater); } public void show(Activity activity, String message, final Dialog.OnClickListener onClickListener) { if (dialog != null && dialog.isShowing()) { return; } dialogErrorBinding.title.setText(activity.getApplicationContext().getString(R.string.error)); dialogErrorBinding.title.setTextColor( AndroidSupportUtil.getColor(activity.getApplicationContext(), R.color.colorAccent) ); dialogErrorBinding.message.setText(message); dialogErrorBinding.ok.setTextColor( AndroidSupportUtil.getColor(activity.getApplicationContext(), R.color.red600) ); dialogErrorBinding.ok.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { onClickListener.onClick(dialog, DialogInterface.BUTTON_POSITIVE); } }); ViewGroup parent = ((ViewGroup) dialogErrorBinding.root.getParent()); if (parent != null) { parent.removeView(dialogErrorBinding.root); } dialog = new AlertDialog.Builder(activity) .setView(dialogErrorBinding.root) .create(); dialog.show(); } }
java
<gh_stars>0 @(room: Individual, form: Form[RoomFormModel]) @import utils.semantic.{Individual, Resource, StringLiteral} @import utils.semantic.Vocabulary.{lwm, rdfs} @defining(form.fill(RoomFormModel(room.props.getOrElse(lwm.hasRoomId, List(StringLiteral(""))).head.value, room.props.getOrElse(lwm.hasName, List(StringLiteral(""))).head.value))) {f=> @helper.form(action = routes.RoomManagementController.roomEdit(room.uri.value)) { @helper.inputText(f("id"), '_label -> "Raumnummer:") @helper.inputText(f("name"), '_label -> "Bezeichnung:") <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Schließen</button> <button type="submit" class="btn btn-primary">Ändern</button> </div> } }
html
<reponame>ERiDeM/hockeyapp-api-wrapper 'use strict'; declare module HockeyAppModels { export enum Status { NonDownloable = 1, Downloable = 2 } export enum ReleaseType { Beta = 0, Store = 1, Alpha = 2, Enterprise = 3 } export interface IApp { id: number; title: string; bundle_identifier: string; public_identifier: string; device_family: string; minimum_os_version: string; release_type: ReleaseType; status: Status; platform: string; role: number; featured: boolean; created_at: Date; updated_at: Date; custom_release_type: string; visibility: string; owner: string; owner_token: string; company: string; } export interface IVersion { id: number; version: string; mandatory: boolean; config_url: string; download_url: string; timestamp: number; appsize: number; device_family: string; notes: string; shortversion: string; minimum_os_version: string; title: string; external: boolean; app_id: number; restricted_to_tags: boolean; status: Status; tags: Array<string>; expired_at: Date; created_at: Date; updated_at: Date; sdk_version: string; block_crashes: boolean; app_owner: string; } export interface IAppResponse { apps: Array<IApp>; status: string; } export interface IVersionResponse { app_versions: Array<IVersion>; status: string; } }
typescript
Since childhood, most of us have dealt with some degree of fear of the dark. It’s natural, and probably down to evolution, to fear not being able to see what might be coming for us – even though we know nothing is probably there. So, our natural inclination is to have some kind of light in our sleeping space. We might choose ambient light from outside, the glow of the television, or a small night light, but according to science, we should train ourselves to quit. That’s because the findings of a small-but-convincing study out of Northwestern University suggest that even a moderate amount of light in the room can have adverse effects on cardiovascular and metabolic health. Even Dr. Phyllis Zee, the study’s lead author, raised her eyebrows at the outcomes. “I was surprised that even this fairly, I would say, small amount of light just getting through the eyes to the brain still had such notable effect. The study joins other findings that suggests ambient light at night could have large negative impacts like exposing people to chronic disease. In it, participants spent one night sleeping in a dark room, and the following night slept in a room illuminated by an overhead light. Researchers ran tests while they snoozed, recording brainwaves, measuring heart rates, and drawing blood every couple of hours. In the morning, both groups received a big, sugary breakfast to see how their bodies responded to the spike in glucose – and the findings are more than a little interesting. The group who had been exposed to light overnight had shown elevated heart rates as they slept, and had more trouble regulating their blood sugar in the morning as well. There is evidence that light can disrupt our natural metabolism. The study’s participants believed they’d slept fine, and researchers failed to find suppressed melatonin levels. Melatonin is a hormone that helps with circadian rhythms and promotes sleep, but other studies have also linked diseases like cancer and diabetes to low melatonin levels in the past. Zee believes this only proves that the minimal light used in this particular study wasn’t bright enough to suppress melatonin levels. They do believe, however, that even the small amount of light they were using was enough to activate the body’s fight or flight response, which is supposed to chill out while we sleep. In a dark room, our heart rate and respiration would decrease. In the room with the light, our nervous system responded by staying more active and alert throughout the night. These findings are verified by Dr. Chris Colwell, who studies the mechanisms underlying circadian rhythms at UCLA. So, even though the findings of this small study were not dramatic, any changes to your good night’s sleep aren’t ideal. The lights could increase your risk of chronic illness. There are more than a few studies out there that confirm that disrupted sleep makes it harder for our bodies to regulate blood glucose levels. Colwell points out that this study only had people there one or two nights, and that in real life, harmful effects would be cumulative. “That’s going to increase the risk of chronic diseases like insulin resistance, diabetes, and other cardiometabolic problems,” confirms Dr. Charles Czeisler, chief of Brigham and Women’s Hospital’s Division of Sleep and Circadian Disorders. One large study that included over 40,000 women found that sleeping with the television or other light on was associated with an increased risk of gaining weight over a five-year period. Czeisler himself recently published a study of his own that also looked into the metabolic results of continued sleep disruption. In it, he and his team concluded that sleep deficiency and exposure to light while asleep are equally impactful – in a negative way – when we’re talking about health. Which is all to say, it might be time for most of us to rethink how we fall asleep – and stay asleep – even during those years when our sleep is regularly disrupted by children, etc. It matters to your day-to-day health more than we probably realize. Turning off the television, grabbing some blackout curtains, or overcoming that fear of the dark could be a small but significant way to make a big change.
english
<filename>autotest/gcore/vsis3.py #!/usr/bin/env pytest ############################################################################### # $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test /vsis3 # Author: <NAME> <even dot rouault at spatialys dot com> # ############################################################################### # Copyright (c) 2015, <NAME> <even dot rouault at spatialys dot com> # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the rights to use, copy, modify, merge, publish, distribute, sublicense, # and/or sell copies of the Software, and to permit persons to whom the # Software is furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # DEALINGS IN THE SOFTWARE. ############################################################################### import json import os.path import stat import sys from osgeo import gdal import gdaltest import webserver import pytest def open_for_read(uri): """ Opens a test file for reading. """ return gdal.VSIFOpenExL(uri, 'rb', 1) ############################################################################### def test_vsis3_init(): gdaltest.aws_vars = {} for var in ('AWS_SECRET_ACCESS_KEY', 'AWS_ACCESS_KEY_ID', 'AWS_TIMESTAMP', 'AWS_HTTPS', 'AWS_VIRTUAL_HOSTING', 'AWS_S3_ENDPOINT', 'AWS_REQUEST_PAYER', 'AWS_DEFAULT_REGION', 'AWS_DEFAULT_PROFILE', 'AWS_PROFILE', 'AWS_NO_SIGN_REQUEST'): gdaltest.aws_vars[var] = gdal.GetConfigOption(var) if gdaltest.aws_vars[var] is not None: gdal.SetConfigOption(var, "") # To avoid user AWS credentials in ~/.aws/credentials and ~/.aws/config # to mess up our tests gdal.SetConfigOption('CPL_AWS_CREDENTIALS_FILE', '') gdal.SetConfigOption('AWS_CONFIG_FILE', '') gdal.SetConfigOption('CPL_AWS_EC2_API_ROOT_URL', '') assert gdal.GetSignedURL('/vsis3/foo/bar') is None ############################################################################### # Test AWS_NO_SIGN_REQUEST=YES def test_vsis3_no_sign_request(): if not gdaltest.built_against_curl(): pytest.skip() with gdaltest.config_option('AWS_NO_SIGN_REQUEST', 'YES'): actual_url = gdal.GetActualURL('/vsis3/landsat-pds/L8/001/002/LC80010022016230LGN00/LC80010022016230LGN00_B1.TIF') assert actual_url == 'https://landsat-pds.s3.amazonaws.com/L8/001/002/LC80010022016230LGN00/LC80010022016230LGN00_B1.TIF' actual_url = gdal.GetActualURL('/vsis3_streaming/landsat-pds/L8/001/002/LC80010022016230LGN00/LC80010022016230LGN00_B1.TIF') assert actual_url == 'https://landsat-pds.s3.amazonaws.com/L8/001/002/LC80010022016230LGN00/LC80010022016230LGN00_B1.TIF' f = open_for_read('/vsis3/landsat-pds/L8/001/002/LC80010022016230LGN00/LC80010022016230LGN00_B1.TIF') if f is None: if gdaltest.gdalurlopen('https://landsat-pds.s3.amazonaws.com/L8/001/002/LC80010022016230LGN00/LC80010022016230LGN00_B1.TIF') is None: pytest.skip('cannot open URL') pytest.fail() gdal.VSIFCloseL(f) ############################################################################### # Test Sync() and multithreaded download def test_vsis3_sync_multithreaded_download(): if not gdaltest.built_against_curl(): pytest.skip() def cbk(pct, _, tab): assert pct >= tab[0] tab[0] = pct return True tab = [ -1 ] # Use a public bucket with /test_dummy/foo and /test_dummy/bar files with gdaltest.config_option('AWS_NO_SIGN_REQUEST', 'YES'): assert gdal.Sync('/vsis3/cdn.proj.org/test_dummy', '/vsimem/test_vsis3_no_sign_request_sync', options=['NUM_THREADS=2'], callback=cbk, callback_data=tab) assert tab[0] == 1.0 assert gdal.VSIStatL('/vsimem/test_vsis3_no_sign_request_sync/test_dummy/foo').size == 4 assert gdal.VSIStatL('/vsimem/test_vsis3_no_sign_request_sync/test_dummy/bar').size == 4 gdal.RmdirRecursive('/vsimem/test_vsis3_no_sign_request_sync') ############################################################################### # Test Sync() and multithreaded download and CHUNK_SIZE def test_vsis3_sync_multithreaded_download_chunk_size(): if not gdaltest.built_against_curl(): pytest.skip() def cbk(pct, _, tab): assert pct >= tab[0] tab[0] = pct return True tab = [ -1 ] # Use a public bucket with /test_dummy/foo and /test_dummy/bar files with gdaltest.config_option('AWS_NO_SIGN_REQUEST', 'YES'): assert gdal.Sync('/vsis3/cdn.proj.org/test_dummy', '/vsimem/test_vsis3_no_sign_request_sync', options=['NUM_THREADS=2', 'CHUNK_SIZE=3'], callback=cbk, callback_data=tab) assert tab[0] == 1.0 assert gdal.VSIStatL('/vsimem/test_vsis3_no_sign_request_sync/test_dummy/foo').size == 4 assert gdal.VSIStatL('/vsimem/test_vsis3_no_sign_request_sync/test_dummy/bar').size == 4 gdal.RmdirRecursive('/vsimem/test_vsis3_no_sign_request_sync') ############################################################################### # Error cases def test_vsis3_1(): if not gdaltest.built_against_curl(): pytest.skip() # Missing AWS_SECRET_ACCESS_KEY gdal.ErrorReset() with gdaltest.error_handler(): f = open_for_read('/vsis3/foo/bar') assert f is None and gdal.VSIGetLastErrorMsg().find('AWS_SECRET_ACCESS_KEY') >= 0 gdal.ErrorReset() with gdaltest.error_handler(): f = open_for_read('/vsis3_streaming/foo/bar') assert f is None and gdal.VSIGetLastErrorMsg().find('AWS_SECRET_ACCESS_KEY') >= 0 gdal.SetConfigOption('AWS_SECRET_ACCESS_KEY', 'AWS_SECRET_ACCESS_KEY') # Missing AWS_ACCESS_KEY_ID gdal.ErrorReset() with gdaltest.error_handler(): f = open_for_read('/vsis3/foo/bar') assert f is None and gdal.VSIGetLastErrorMsg().find('AWS_ACCESS_KEY_ID') >= 0 gdal.SetConfigOption('AWS_ACCESS_KEY_ID', 'AWS_ACCESS_KEY_ID') # ERROR 1: The AWS Access Key Id you provided does not exist in our records. gdal.ErrorReset() with gdaltest.error_handler(): f = open_for_read('/vsis3/foo/bar.baz') if f is not None or gdal.VSIGetLastErrorMsg() == '': if f is not None: gdal.VSIFCloseL(f) if gdal.GetConfigOption('APPVEYOR') is not None: return pytest.fail(gdal.VSIGetLastErrorMsg()) gdal.ErrorReset() with gdaltest.error_handler(): f = open_for_read('/vsis3_streaming/foo/bar.baz') assert f is None and gdal.VSIGetLastErrorMsg() != '' ############################################################################### def test_vsis3_start_webserver(): gdaltest.webserver_process = None gdaltest.webserver_port = 0 if not gdaltest.built_against_curl(): pytest.skip() (gdaltest.webserver_process, gdaltest.webserver_port) = webserver.launch(handler=webserver.DispatcherHttpHandler) if gdaltest.webserver_port == 0: pytest.skip() gdal.SetConfigOption('AWS_SECRET_ACCESS_KEY', 'AWS_SECRET_ACCESS_KEY') gdal.SetConfigOption('AWS_ACCESS_KEY_ID', 'AWS_ACCESS_KEY_ID') gdal.SetConfigOption('AWS_TIMESTAMP', '20150101T000000Z') gdal.SetConfigOption('AWS_HTTPS', 'NO') gdal.SetConfigOption('AWS_VIRTUAL_HOSTING', 'NO') gdal.SetConfigOption('AWS_S3_ENDPOINT', '127.0.0.1:%d' % gdaltest.webserver_port) def get_s3_fake_bucket_resource_method(request): request.protocol_version = 'HTTP/1.1' if 'Authorization' not in request.headers: sys.stderr.write('Bad headers: %s\n' % str(request.headers)) request.send_response(403) return expected_authorization_8080 = 'AWS4-HMAC-SHA256 Credential=AWS_ACCESS_KEY_ID/20150101/us-east-1/s3/aws4_request,SignedHeaders=host;x-amz-content-sha256;x-amz-date,Signature=38901846b865b12ac492bc005bb394ca8d60c098b68db57c084fac686a932f9e' expected_authorization_8081 = 'AWS4-HMAC-SHA256 Credential=AWS_ACCESS_KEY_ID/20150101/us-east-1/s3/aws4_request,SignedHeaders=host;x-amz-content-sha256;x-amz-date,Signature=9f623b7ffce76188a456c70fb4813eb31969e88d130d6b4d801b3accbf050d6c' if request.headers['Authorization'] != expected_authorization_8080 and request.headers['Authorization'] != expected_authorization_8081: sys.stderr.write("Bad Authorization: '%s'\n" % str(request.headers['Authorization'])) request.send_response(403) return request.send_response(200) request.send_header('Content-type', 'text/plain') request.send_header('Content-Length', 3) request.send_header('Connection', 'close') request.end_headers() request.wfile.write("""foo""".encode('ascii')) ############################################################################### # Test with a fake AWS server def test_vsis3_2(): if gdaltest.webserver_port == 0: pytest.skip() signed_url = gdal.GetSignedURL('/vsis3/s3_fake_bucket/resource') expected_url_8080 = 'http://127.0.0.1:8080/s3_fake_bucket/resource?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AWS_ACCESS_KEY_ID%2F20150101%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20150101T000000Z&X-Amz-Expires=3600&X-Amz-Signature=dca239dd95f72ff8c37c15c840afc54cd19bdb07f7aaee2223108b5b0ad35da8&X-Amz-SignedHeaders=host' expected_url_8081 = 'http://127.0.0.1:8081/s3_fake_bucket/resource?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AWS_ACCESS_KEY_ID%2F20150101%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20150101T000000Z&X-Amz-Expires=3600&X-Amz-Signature=ef5216bc5971863414c69f6ca095276c0d62c0da97fa4f6ab80c30bd7fc146ac&X-Amz-SignedHeaders=host' assert signed_url in (expected_url_8080, expected_url_8081) handler = webserver.SequentialHandler() handler.add('GET', '/s3_fake_bucket/resource', custom_method=get_s3_fake_bucket_resource_method) with webserver.install_http_handler(handler): f = open_for_read('/vsis3/s3_fake_bucket/resource') assert f is not None data = gdal.VSIFReadL(1, 4, f).decode('ascii') gdal.VSIFCloseL(f) assert data == 'foo' handler = webserver.SequentialHandler() handler.add('GET', '/s3_fake_bucket/resource', custom_method=get_s3_fake_bucket_resource_method) with webserver.install_http_handler(handler): f = open_for_read('/vsis3_streaming/s3_fake_bucket/resource') assert f is not None data = gdal.VSIFReadL(1, 4, f).decode('ascii') gdal.VSIFCloseL(f) assert data == 'foo' handler = webserver.SequentialHandler() def method(request): request.protocol_version = 'HTTP/1.1' if 'Authorization' not in request.headers: sys.stderr.write('Bad headers: %s\n' % str(request.headers)) request.send_response(403) return expected_authorization_8080 = 'AWS4-HMAC-SHA256 Credential=AWS_ACCESS_KEY_ID/20150101/us-east-1/s3/aws4_request,SignedHeaders=host;x-amz-content-sha256;x-amz-date;x-amz-security-token,Signature=464a21835038b4f4d292b6463b8a005b9aaa980513aa8c42fc170abb733dce85' expected_authorization_8081 = 'AWS4-HMAC-SHA256 Credential=AWS_ACCESS_KEY_ID/20150101/us-east-1/s3/aws4_request,SignedHeaders=host;x-amz-content-sha256;x-amz-date;x-amz-security-token,Signature=b10e91575186342f9f2acfc91c4c2c9938c4a9e8cdcbc043d09d59d9641ad7fb' if request.headers['Authorization'] != expected_authorization_8080 and request.headers['Authorization'] != expected_authorization_8081: sys.stderr.write("Bad Authorization: '%s'\n" % str(request.headers['Authorization'])) request.send_response(403) return request.send_response(200) request.send_header('Content-type', 'text/plain') request.send_header('Content-Length', 3) request.end_headers() request.wfile.write("""foo""".encode('ascii')) handler.add('GET', '/s3_fake_bucket_with_session_token/resource', custom_method=method) # Test with temporary credentials with gdaltest.config_option('AWS_SESSION_TOKEN', 'AWS_SESSION_TOKEN'): with webserver.install_http_handler(handler): f = open_for_read('/vsis3/s3_fake_bucket_with_session_token/resource') assert f is not None data = gdal.VSIFReadL(1, 4, f).decode('ascii') gdal.VSIFCloseL(f) handler = webserver.SequentialHandler() def method(request): request.protocol_version = 'HTTP/1.1' if 'Range' in request.headers: if request.headers['Range'] != 'bytes=0-16383': sys.stderr.write("Bad Range: '%s'\n" % str(request.headers['Range'])) request.send_response(403) return request.send_response(206) request.send_header('Content-type', 'text/plain') request.send_header('Content-Range', 'bytes 0-16383/1000000') request.send_header('Content-Length', 16384) request.send_header('Connection', 'close') request.end_headers() request.wfile.write(('a' * 16384).encode('ascii')) else: request.send_response(200) request.send_header('Content-type', 'text/plain') request.send_header('Content-Length', 1000000) request.send_header('Connection', 'close') request.end_headers() request.wfile.write(('a' * 1000000).encode('ascii')) handler.add('GET', '/s3_fake_bucket/resource2.bin', custom_method=method) with webserver.install_http_handler(handler): # old_val = gdal.GetConfigOption('GDAL_DISABLE_READDIR_ON_OPEN') # gdal.SetConfigOption('GDAL_DISABLE_READDIR_ON_OPEN', 'EMPTY_DIR') stat_res = gdal.VSIStatL('/vsis3/s3_fake_bucket/resource2.bin') # gdal.SetConfigOption('GDAL_DISABLE_READDIR_ON_OPEN', old_val) if stat_res is None or stat_res.size != 1000000: if stat_res is not None: print(stat_res.size) else: print(stat_res) pytest.fail() handler = webserver.SequentialHandler() handler.add('HEAD', '/s3_fake_bucket/resource2.bin', 200, {'Content-type': 'text/plain', 'Content-Length': 1000000, 'Connection': 'close'}) with webserver.install_http_handler(handler): stat_res = gdal.VSIStatL('/vsis3_streaming/s3_fake_bucket/resource2.bin') if stat_res is None or stat_res.size != 1000000: if stat_res is not None: print(stat_res.size) else: print(stat_res) pytest.fail() handler = webserver.SequentialHandler() def method(request): request.protocol_version = 'HTTP/1.1' if request.headers['Authorization'].find('us-east-1') >= 0: request.send_response(400) response = '<?xml version="1.0" encoding="UTF-8"?><Error><Message>bla</Message><Code>AuthorizationHeaderMalformed</Code><Region>us-west-2</Region></Error>' response = '%x\r\n%s\r\n0\r\n\r\n' % (len(response), response) request.send_header('Content-type', 'application/xml') request.send_header('Transfer-Encoding', 'chunked') request.send_header('Connection', 'close') request.end_headers() request.wfile.write(response.encode('ascii')) else: sys.stderr.write('Bad headers: %s\n' % str(request.headers)) request.send_response(403) handler.add('GET', '/s3_fake_bucket/redirect', custom_method=method) def method(request): request.protocol_version = 'HTTP/1.1' if request.headers['Authorization'].find('us-west-2') >= 0 and request.headers['Host'].startswith('127.0.0.1'): request.send_response(301) response = '<?xml version="1.0" encoding="UTF-8"?><Error><Message>bla</Message><Code>PermanentRedirect</Code><Endpoint>localhost:%d</Endpoint></Error>' % request.server.port response = '%x\r\n%s\r\n0\r\n\r\n' % (len(response), response) request.send_header('Content-type', 'application/xml') request.send_header('Transfer-Encoding', 'chunked') request.send_header('Connection', 'close') request.end_headers() request.wfile.write(response.encode('ascii')) else: sys.stderr.write('Bad headers: %s\n' % str(request.headers)) request.send_response(403) handler.add('GET', '/s3_fake_bucket/redirect', custom_method=method) def method(request): request.protocol_version = 'HTTP/1.1' if request.headers['Authorization'].find('us-west-2') >= 0 and request.headers['Host'].startswith('localhost'): request.send_response(200) request.send_header('Content-type', 'text/plain') request.send_header('Content-Length', 3) request.send_header('Connection', 'close') request.end_headers() request.wfile.write("""foo""".encode('ascii')) else: sys.stderr.write('Bad headers: %s\n' % str(request.headers)) request.send_response(403) handler.add('GET', '/s3_fake_bucket/redirect', custom_method=method) # Test region and endpoint 'redirects' with webserver.install_http_handler(handler): f = open_for_read('/vsis3/s3_fake_bucket/redirect') assert f is not None data = gdal.VSIFReadL(1, 4, f).decode('ascii') gdal.VSIFCloseL(f) if data != 'foo': if gdaltest.is_travis_branch('trusty'): pytest.skip('Skipped on trusty branch, but should be investigated') pytest.fail(data) # Test region and endpoint 'redirects' gdal.VSICurlClearCache() handler.req_count = 0 with webserver.install_http_handler(handler): f = open_for_read('/vsis3_streaming/s3_fake_bucket/redirect') assert f is not None data = gdal.VSIFReadL(1, 4, f).decode('ascii') gdal.VSIFCloseL(f) assert data == 'foo' handler = webserver.SequentialHandler() def method(request): # /vsis3_streaming/ should have remembered the change of region and endpoint if request.headers['Authorization'].find('us-west-2') < 0 or \ not request.headers['Host'].startswith('localhost'): sys.stderr.write('Bad headers: %s\n' % str(request.headers)) request.send_response(403) request.protocol_version = 'HTTP/1.1' request.send_response(400) response = 'bla' response = '%x\r\n%s\r\n0\r\n\r\n' % (len(response), response) request.send_header('Content-type', 'application/xml') request.send_header('Transfer-Encoding', 'chunked') request.send_header('Connection', 'close') request.end_headers() request.wfile.write(response.encode('ascii')) handler.add('GET', '/s3_fake_bucket/non_xml_error', custom_method=method) gdal.ErrorReset() with webserver.install_http_handler(handler): with gdaltest.error_handler(): f = open_for_read('/vsis3_streaming/s3_fake_bucket/non_xml_error') assert f is None and gdal.VSIGetLastErrorMsg().find('bla') >= 0 handler = webserver.SequentialHandler() response = '<?xml version="1.0" encoding="UTF-8"?><oops>' response = '%x\r\n%s\r\n0\r\n\r\n' % (len(response), response) handler.add('GET', '/s3_fake_bucket/invalid_xml_error', 400, {'Content-type': 'application/xml', 'Transfer-Encoding': 'chunked', 'Connection': 'close'}, response) gdal.ErrorReset() with webserver.install_http_handler(handler): with gdaltest.error_handler(): f = open_for_read('/vsis3_streaming/s3_fake_bucket/invalid_xml_error') assert f is None and gdal.VSIGetLastErrorMsg().find('<oops>') >= 0 handler = webserver.SequentialHandler() response = '<?xml version="1.0" encoding="UTF-8"?><Error/>' response = '%x\r\n%s\r\n0\r\n\r\n' % (len(response), response) handler.add('GET', '/s3_fake_bucket/no_code_in_error', 400, {'Content-type': 'application/xml', 'Transfer-Encoding': 'chunked', 'Connection': 'close'}, response) gdal.ErrorReset() with webserver.install_http_handler(handler): with gdaltest.error_handler(): f = open_for_read('/vsis3_streaming/s3_fake_bucket/no_code_in_error') assert f is None and gdal.VSIGetLastErrorMsg().find('<Error/>') >= 0 handler = webserver.SequentialHandler() response = '<?xml version="1.0" encoding="UTF-8"?><Error><Code>AuthorizationHeaderMalformed</Code></Error>' response = '%x\r\n%s\r\n0\r\n\r\n' % (len(response), response) handler.add('GET', '/s3_fake_bucket/no_region_in_AuthorizationHeaderMalformed_error', 400, {'Content-type': 'application/xml', 'Transfer-Encoding': 'chunked', 'Connection': 'close'}, response) gdal.ErrorReset() with webserver.install_http_handler(handler): with gdaltest.error_handler(): f = open_for_read('/vsis3_streaming/s3_fake_bucket/no_region_in_AuthorizationHeaderMalformed_error') assert f is None and gdal.VSIGetLastErrorMsg().find('<Error>') >= 0 handler = webserver.SequentialHandler() response = '<?xml version="1.0" encoding="UTF-8"?><Error><Code>PermanentRedirect</Code></Error>' response = '%x\r\n%s\r\n0\r\n\r\n' % (len(response), response) handler.add('GET', '/s3_fake_bucket/no_endpoint_in_PermanentRedirect_error', 400, {'Content-type': 'application/xml', 'Transfer-Encoding': 'chunked', 'Connection': 'close'}, response) gdal.ErrorReset() with webserver.install_http_handler(handler): with gdaltest.error_handler(): f = open_for_read('/vsis3_streaming/s3_fake_bucket/no_endpoint_in_PermanentRedirect_error') assert f is None and gdal.VSIGetLastErrorMsg().find('<Error>') >= 0 handler = webserver.SequentialHandler() response = '<?xml version="1.0" encoding="UTF-8"?><Error><Code>bla</Code></Error>' response = '%x\r\n%s\r\n0\r\n\r\n' % (len(response), response) handler.add('GET', '/s3_fake_bucket/no_message_in_error', 400, {'Content-type': 'application/xml', 'Transfer-Encoding': 'chunked', 'Connection': 'close'}, response) gdal.ErrorReset() with webserver.install_http_handler(handler): with gdaltest.error_handler(): f = open_for_read('/vsis3_streaming/s3_fake_bucket/no_message_in_error') assert f is None and gdal.VSIGetLastErrorMsg().find('<Error>') >= 0 # Test with requester pays handler = webserver.SequentialHandler() def method(request): if 'x-amz-request-payer' not in request.headers: sys.stderr.write('Bad headers: %s\n' % str(request.headers)) request.send_response(403) return expected_authorization_8080 = 'AWS4-HMAC-SHA256 Credential=AWS_ACCESS_KEY_ID/20150101/us-east-1/s3/aws4_request,SignedHeaders=host;x-amz-content-sha256;x-amz-date;x-amz-request-payer,Signature=cf713a394e1b629ac0e468d60d3d4a12f5236fd72d21b6005c758b0dfc7049cd' expected_authorization_8081 = 'AWS4-HMAC-SHA256 Credential=AWS_ACCESS_KEY_ID/20150101/us-east-1/s3/aws4_request,SignedHeaders=host;x-amz-content-sha256;x-amz-date;x-amz-request-payer,Signature=4756166679008a1a40cd6ff91dbbef670a71c11bf8e3c998dd7385577c3ac4d9' if request.headers['Authorization'] != expected_authorization_8080 and request.headers['Authorization'] != expected_authorization_8081: sys.stderr.write("Bad Authorization: '%s'\n" % str(request.headers['Authorization'])) request.send_response(403) return if request.headers['x-amz-request-payer'] != 'requester': sys.stderr.write("Bad x-amz-request-payer: '%s'\n" % str(request.headers['x-amz-request-payer'])) request.send_response(403) return request.send_response(200) request.send_header('Content-type', 'text/plain') request.send_header('Content-Length', 3) request.send_header('Connection', 'close') request.end_headers() request.wfile.write("""foo""".encode('ascii')) handler.add('GET', '/s3_fake_bucket_with_requester_pays/resource', custom_method=method) with gdaltest.config_option('AWS_REQUEST_PAYER', 'requester'): with webserver.install_http_handler(handler): with gdaltest.error_handler(): f = open_for_read('/vsis3/s3_fake_bucket_with_requester_pays/resource') assert f is not None data = gdal.VSIFReadL(1, 3, f).decode('ascii') gdal.VSIFCloseL(f) assert data == 'foo' # Test temporary redirect handler = webserver.SequentialHandler() class HandlerClass(object): def __init__(self, response_value): self.old_authorization = None self.response_value = response_value def method_req_1(self, request): if request.headers['Host'].find('127.0.0.1') < 0: sys.stderr.write('Bad headers: %s\n' % str(request.headers)) request.send_response(403) return self.old_authorization = request.headers['Authorization'] request.protocol_version = 'HTTP/1.1' request.send_response(307) response = '<?xml version="1.0" encoding="UTF-8"?><Error><Message>bla</Message><Code>TemporaryRedirect</Code><Endpoint>localhost:%d</Endpoint></Error>' % request.server.port response = '%x\r\n%s\r\n0\r\n\r\n' % (len(response), response) request.send_header('Content-type', 'application/xml') request.send_header('Transfer-Encoding', 'chunked') request.end_headers() request.wfile.write(response.encode('ascii')) def method_req_2(self, request): if request.headers['Host'].find('localhost') < 0: sys.stderr.write('Bad headers: %s\n' % str(request.headers)) request.send_response(403) return if self.old_authorization == request.headers['Authorization']: sys.stderr.write('Should have get a different Authorization. Bad headers: %s\n' % str(request.headers)) request.send_response(403) return request.protocol_version = 'HTTP/1.1' request.send_response(200) response = self.response_value request.send_header('Content-Length', len(response)) request.end_headers() request.wfile.write(response.encode('ascii')) h = HandlerClass('foo') handler.add('GET', '/s3_test_temporary_redirect_read/resource', custom_method=h.method_req_1) handler.add('GET', '/s3_test_temporary_redirect_read/resource', custom_method=h.method_req_2) with webserver.install_http_handler(handler): f = open_for_read('/vsis3/s3_test_temporary_redirect_read/resource') assert f is not None data = gdal.VSIFReadL(1, 3, f).decode('ascii') gdal.VSIFCloseL(f) assert data == 'foo' # Retry on the same bucket and check that the redirection was indeed temporary handler = webserver.SequentialHandler() h = HandlerClass('bar') handler.add('GET', '/s3_test_temporary_redirect_read/resource2', custom_method=h.method_req_1) handler.add('GET', '/s3_test_temporary_redirect_read/resource2', custom_method=h.method_req_2) with webserver.install_http_handler(handler): f = open_for_read('/vsis3/s3_test_temporary_redirect_read/resource2') assert f is not None data = gdal.VSIFReadL(1, 3, f).decode('ascii') gdal.VSIFCloseL(f) assert data == 'bar' ############################################################################### # Test re-opening after changing configuration option (#2294) def test_vsis3_open_after_config_option_chage(): if gdaltest.webserver_port == 0: pytest.skip() gdal.VSICurlClearCache() handler = webserver.SequentialHandler() handler.add('GET', '/test_vsis3_change_config_options/?delimiter=%2F', 403) handler.add('GET', '/test_vsis3_change_config_options/test.bin', 403) with webserver.install_http_handler(handler): with gdaltest.error_handler(): f = open_for_read('/vsis3/test_vsis3_change_config_options/test.bin') assert f is None # Does not attempt any network access since we didn't change significant # parameters f = open_for_read('/vsis3/test_vsis3_change_config_options/test.bin') assert f is None with gdaltest.config_option('AWS_ACCESS_KEY_ID', 'another_key_id'): handler = webserver.SequentialHandler() handler.add('GET', '/test_vsis3_change_config_options/?delimiter=%2F', 200, {'Content-type': 'application/xml'}, """<?xml version="1.0" encoding="UTF-8"?> <ListBucketResult> <Prefix></Prefix> <Contents> <Key>test.bin</Key> <LastModified>1970-01-01T00:00:01.000Z</LastModified> <Size>123456</Size> </Contents> </ListBucketResult> """) with webserver.install_http_handler(handler): f = open_for_read('/vsis3/test_vsis3_change_config_options/test.bin') assert f is not None gdal.VSIFCloseL(f) ############################################################################### # Test ReadDir() with a fake AWS server def test_vsis3_readdir(): if gdaltest.webserver_port == 0: pytest.skip() handler = webserver.SequentialHandler() def method(request): request.protocol_version = 'HTTP/1.1' if request.headers['Authorization'].find('us-east-1') >= 0: request.send_response(400) response = '<?xml version="1.0" encoding="UTF-8"?><Error><Message>bla</Message><Code>AuthorizationHeaderMalformed</Code><Region>us-west-2</Region></Error>' response = '%x\r\n%s\r\n0\r\n\r\n' % (len(response), response) request.send_header('Content-type', 'application/xml') request.send_header('Transfer-Encoding', 'chunked') request.end_headers() request.wfile.write(response.encode('ascii')) elif request.headers['Authorization'].find('us-west-2') >= 0: if request.headers['Host'].startswith('127.0.0.1'): request.send_response(301) response = '<?xml version="1.0" encoding="UTF-8"?><Error><Message>bla</Message><Code>PermanentRedirect</Code><Endpoint>localhost:%d</Endpoint></Error>' % request.server.port response = '%x\r\n%s\r\n0\r\n\r\n' % (len(response), response) request.send_header('Content-type', 'application/xml') request.send_header('Transfer-Encoding', 'chunked') request.end_headers() request.wfile.write(response.encode('ascii')) elif request.headers['Host'].startswith('localhost'): request.send_response(200) request.send_header('Content-type', 'application/xml') response = """<?xml version="1.0" encoding="UTF-8"?> <ListBucketResult> <Prefix>a_dir with_space/</Prefix> <NextMarker>bla</NextMarker> <Contents> <Key>a_dir with_space/resource3 with_space.bin</Key> <LastModified>1970-01-01T00:00:01.000Z</LastModified> <Size>123456</Size> </Contents> </ListBucketResult> """ request.send_header('Content-Length', len(response)) request.end_headers() request.wfile.write(response.encode('ascii')) else: sys.stderr.write('Bad headers: %s\n' % str(request.headers)) request.send_response(403) else: sys.stderr.write('Bad headers: %s\n' % str(request.headers)) request.send_response(403) handler.add('GET', '/s3_fake_bucket2/?delimiter=%2F&prefix=a_dir%20with_space%2F', custom_method=method) handler.add('GET', '/s3_fake_bucket2/?delimiter=%2F&prefix=a_dir%20with_space%2F', custom_method=method) handler.add('GET', '/s3_fake_bucket2/?delimiter=%2F&prefix=a_dir%20with_space%2F', custom_method=method) def method(request): # /vsis3/ should have remembered the change of region and endpoint if request.headers['Authorization'].find('us-west-2') < 0 or \ not request.headers['Host'].startswith('localhost'): sys.stderr.write('Bad headers: %s\n' % str(request.headers)) request.send_response(403) request.protocol_version = 'HTTP/1.1' request.send_response(200) request.send_header('Content-type', 'application/xml') response = """<?xml version="1.0" encoding="UTF-8"?> <ListBucketResult> <Prefix>a_dir with_space/</Prefix> <Contents> <Key>a_dir with_space/resource4.bin</Key> <LastModified>2015-10-16T12:34:56.000Z</LastModified> <Size>456789</Size> </Contents> <Contents> <Key>a_dir with_space/i_am_a_glacier_file</Key> <LastModified>2015-10-16T12:34:56.000Z</LastModified> <Size>456789</Size> <StorageClass>GLACIER</StorageClass> </Contents> <CommonPrefixes> <Prefix>a_dir with_space/subdir/</Prefix> </CommonPrefixes> </ListBucketResult> """ request.send_header('Content-Length', len(response)) request.end_headers() request.wfile.write(response.encode('ascii')) handler.add('GET', '/s3_fake_bucket2/?delimiter=%2F&marker=bla&prefix=a_dir%20with_space%2F', custom_method=method) with webserver.install_http_handler(handler): f = open_for_read('/vsis3/s3_fake_bucket2/a_dir with_space/resource3 with_space.bin') if f is None: if gdaltest.is_travis_branch('trusty'): pytest.skip('Skipped on trusty branch, but should be investigated') pytest.fail() gdal.VSIFCloseL(f) with webserver.install_http_handler(webserver.SequentialHandler()): dir_contents = gdal.ReadDir('/vsis3/s3_fake_bucket2/a_dir with_space') assert dir_contents == ['resource3 with_space.bin', 'resource4.bin', 'subdir'] assert gdal.VSIStatL('/vsis3/s3_fake_bucket2/a_dir with_space/resource3 with_space.bin').size == 123456 assert gdal.VSIStatL('/vsis3/s3_fake_bucket2/a_dir with_space/resource3 with_space.bin').mtime == 1 # Same as above: cached dir_contents = gdal.ReadDir('/vsis3/s3_fake_bucket2/a_dir with_space') assert dir_contents == ['resource3 with_space.bin', 'resource4.bin', 'subdir'] # ReadDir on something known to be a file shouldn't cause network access dir_contents = gdal.ReadDir('/vsis3/s3_fake_bucket2/a_dir with_space/resource3 with_space.bin') assert dir_contents is None # Test unrelated partial clear of the cache gdal.VSICurlPartialClearCache('/vsis3/s3_fake_bucket_unrelated') assert gdal.VSIStatL('/vsis3/s3_fake_bucket2/a_dir with_space/resource3 with_space.bin').size == 123456 dir_contents = gdal.ReadDir('/vsis3/s3_fake_bucket2/a_dir with_space') assert dir_contents == ['resource3 with_space.bin', 'resource4.bin', 'subdir'] # Test partial clear of the cache gdal.VSICurlPartialClearCache('/vsis3/s3_fake_bucket2/a_dir with_space') handler = webserver.SequentialHandler() handler.add('GET', '/s3_fake_bucket2/a_dir%20with_space/resource3%20with_space.bin', 400) handler.add('GET', '/s3_fake_bucket2/?delimiter=%2F&max-keys=100&prefix=a_dir%20with_space%2Fresource3%20with_space.bin%2F', 400) with webserver.install_http_handler(handler): gdal.VSIStatL('/vsis3/s3_fake_bucket2/a_dir with_space/resource3 with_space.bin') handler = webserver.SequentialHandler() handler.add('GET', '/s3_fake_bucket2/?delimiter=%2F&prefix=a_dir%2F', 200, {'Content-type': 'application/xml'}, """<?xml version="1.0" encoding="UTF-8"?> <ListBucketResult> <Prefix>a_dir/</Prefix> <Contents> <Key>a_dir/test.txt</Key> <LastModified>1970-01-01T00:00:01.000Z</LastModified> <Size>40</Size> </Contents> </ListBucketResult> """) with webserver.install_http_handler(handler): dir_contents = gdal.ReadDir('/vsis3/s3_fake_bucket2/a_dir') assert dir_contents == ['test.txt'] gdal.VSICurlClearCache() handler = webserver.SequentialHandler() handler.add('GET', '/s3_fake_bucket2/?delimiter=%2F&prefix=a_dir%2F', 200, {}, """<?xml version="1.0" encoding="UTF-8"?> <ListBucketResult> <Prefix>a_dir/</Prefix> <Contents> <Key>a_dir/resource4.bin</Key> <LastModified>2015-10-16T12:34:56.000Z</LastModified> <Size>456789</Size> </Contents> <Contents> <Key>a_dir/i_am_a_glacier_file</Key> <LastModified>2015-10-16T12:34:56.000Z</LastModified> <Size>456789</Size> <StorageClass>GLACIER</StorageClass> </Contents> <CommonPrefixes> <Prefix>a_dir/subdir/</Prefix> </CommonPrefixes> </ListBucketResult> """) with gdaltest.config_option('CPL_VSIL_CURL_IGNORE_GLACIER_STORAGE', 'NO'): with webserver.install_http_handler(handler): dir_contents = gdal.ReadDir('/vsis3/s3_fake_bucket2/a_dir') assert dir_contents == ['resource4.bin', 'i_am_a_glacier_file', 'subdir'] # Test CPL_VSIL_CURL_NON_CACHED for config_option_value in ['/vsis3/s3_non_cached/test.txt', '/vsis3/s3_non_cached', '/vsis3/s3_non_cached:/vsis3/unrelated', '/vsis3/unrelated:/vsis3/s3_non_cached', '/vsis3/unrelated:/vsis3/s3_non_cached:/vsis3/unrelated']: with gdaltest.config_option('CPL_VSIL_CURL_NON_CACHED', config_option_value): handler = webserver.SequentialHandler() handler.add('GET', '/s3_non_cached/test.txt', 200, {}, 'foo') with webserver.install_http_handler(handler): f = open_for_read('/vsis3/s3_non_cached/test.txt') assert f is not None, config_option_value data = gdal.VSIFReadL(1, 3, f).decode('ascii') gdal.VSIFCloseL(f) assert data == 'foo', config_option_value handler = webserver.SequentialHandler() handler.add('GET', '/s3_non_cached/test.txt', 200, {}, 'bar2') with webserver.install_http_handler(handler): size = gdal.VSIStatL('/vsis3/s3_non_cached/test.txt').size assert size == 4, config_option_value handler = webserver.SequentialHandler() handler.add('GET', '/s3_non_cached/test.txt', 200, {}, 'foo') with webserver.install_http_handler(handler): size = gdal.VSIStatL('/vsis3/s3_non_cached/test.txt').size if size != 3: print(config_option_value) pytest.fail(data) handler = webserver.SequentialHandler() handler.add('GET', '/s3_non_cached/test.txt', 200, {}, 'bar2') with webserver.install_http_handler(handler): f = open_for_read('/vsis3/s3_non_cached/test.txt') assert f is not None, config_option_value data = gdal.VSIFReadL(1, 4, f).decode('ascii') gdal.VSIFCloseL(f) assert data == 'bar2', config_option_value # Retry without option for config_option_value in [None, '/vsis3/s3_non_cached/bar.txt']: with gdaltest.config_option('CPL_VSIL_CURL_NON_CACHED', config_option_value): handler = webserver.SequentialHandler() if config_option_value is None: handler.add('GET', '/s3_non_cached/?delimiter=%2F', 200, {'Content-type': 'application/xml'}, """<?xml version="1.0" encoding="UTF-8"?> <ListBucketResult> <Prefix></Prefix> <Contents> <Key>test.txt</Key> <LastModified>1970-01-01T00:00:01.000Z</LastModified> <Size>40</Size> </Contents> <Contents> <Key>test2.txt</Key> <LastModified>1970-01-01T00:00:01.000Z</LastModified> <Size>40</Size> </Contents> </ListBucketResult> """) handler.add('GET', '/s3_non_cached/test.txt', 200, {}, 'foo') with webserver.install_http_handler(handler): f = open_for_read('/vsis3/s3_non_cached/test.txt') assert f is not None, config_option_value data = gdal.VSIFReadL(1, 3, f).decode('ascii') gdal.VSIFCloseL(f) assert data == 'foo', config_option_value handler = webserver.SequentialHandler() with webserver.install_http_handler(handler): f = open_for_read('/vsis3/s3_non_cached/test.txt') assert f is not None, config_option_value data = gdal.VSIFReadL(1, 4, f).decode('ascii') gdal.VSIFCloseL(f) # We should still get foo because of caching assert data == 'foo', config_option_value # List buckets (empty result) handler = webserver.SequentialHandler() handler.add('GET', '/', 200, {'Content-type': 'application/xml'}, """<?xml version="1.0" encoding="UTF-8"?> <ListAllMyBucketsResult> <Buckets> </Buckets> </ListAllMyBucketsResult> """) with webserver.install_http_handler(handler): dir_contents = gdal.ReadDir('/vsis3/') assert dir_contents == ['.'] gdal.VSICurlClearCache() # List buckets handler = webserver.SequentialHandler() handler.add('GET', '/', 200, {'Content-type': 'application/xml'}, """<?xml version="1.0" encoding="UTF-8"?> <ListAllMyBucketsResult> <Buckets> <Bucket> <Name>mybucket</Name> </Bucket> </Buckets> </ListAllMyBucketsResult> """) with webserver.install_http_handler(handler): dir_contents = gdal.ReadDir('/vsis3/') assert dir_contents == ['mybucket'] # Test temporary redirect handler = webserver.SequentialHandler() class HandlerClass(object): def __init__(self, response_value): self.old_authorization = None self.response_value = response_value def method_req_1(self, request): if request.headers['Host'].find('127.0.0.1') < 0: sys.stderr.write('Bad headers: %s\n' % str(request.headers)) request.send_response(403) return self.old_authorization = request.headers['Authorization'] request.protocol_version = 'HTTP/1.1' request.send_response(307) response = '<?xml version="1.0" encoding="UTF-8"?><Error><Message>bla</Message><Code>TemporaryRedirect</Code><Endpoint>localhost:%d</Endpoint></Error>' % request.server.port response = '%x\r\n%s\r\n0\r\n\r\n' % (len(response), response) request.send_header('Content-type', 'application/xml') request.send_header('Transfer-Encoding', 'chunked') request.end_headers() request.wfile.write(response.encode('ascii')) def method_req_2(self, request): if request.headers['Host'].find('localhost') < 0: sys.stderr.write('Bad headers: %s\n' % str(request.headers)) request.send_response(403) return if self.old_authorization == request.headers['Authorization']: sys.stderr.write('Should have get a different Authorization. Bad headers: %s\n' % str(request.headers)) request.send_response(403) return request.protocol_version = 'HTTP/1.1' request.send_response(200) request.send_header('Content-type', 'application/xml') response = self.response_value request.send_header('Content-Length', len(response)) request.end_headers() request.wfile.write(response.encode('ascii')) h = HandlerClass("""<?xml version="1.0" encoding="UTF-8"?> <ListBucketResult> <Prefix></Prefix> <CommonPrefixes> <Prefix>test</Prefix> </CommonPrefixes> </ListBucketResult> """) handler.add('GET', '/s3_test_temporary_redirect_read_dir/?delimiter=%2F', custom_method=h.method_req_1) handler.add('GET', '/s3_test_temporary_redirect_read_dir/?delimiter=%2F', custom_method=h.method_req_2) with webserver.install_http_handler(handler): dir_contents = gdal.ReadDir('/vsis3/s3_test_temporary_redirect_read_dir') assert dir_contents == ['test'] # Retry on the same bucket and check that the redirection was indeed temporary handler = webserver.SequentialHandler() h = HandlerClass("""<?xml version="1.0" encoding="UTF-8"?> <ListBucketResult> <Prefix>test/</Prefix> <CommonPrefixes> <Prefix>test/test2</Prefix> </CommonPrefixes> </ListBucketResult> """) handler.add('GET', '/s3_test_temporary_redirect_read_dir/?delimiter=%2F&prefix=test%2F', custom_method=h.method_req_1) handler.add('GET', '/s3_test_temporary_redirect_read_dir/?delimiter=%2F&prefix=test%2F', custom_method=h.method_req_2) with webserver.install_http_handler(handler): dir_contents = gdal.ReadDir('/vsis3/s3_test_temporary_redirect_read_dir/test') assert dir_contents == ['test2'] ############################################################################### # Test OpenDir() with a fake AWS server def test_vsis3_opendir(): if gdaltest.webserver_port == 0: pytest.skip() # Unlimited depth handler = webserver.SequentialHandler() handler.add('GET', '/vsis3_opendir/', 200, {'Content-type': 'application/xml'}, """<?xml version="1.0" encoding="UTF-8"?> <ListBucketResult> <Prefix/> <Marker/> <Contents> <Key>test.txt</Key> <LastModified>1970-01-01T00:00:01.000Z</LastModified> <Size>40</Size> </Contents> <Contents> <Key>subdir/</Key> <LastModified>1970-01-01T00:00:01.000Z</LastModified> <Size>0</Size> </Contents> <Contents> <Key>subdir/test.txt</Key> <LastModified>1970-01-01T00:00:01.000Z</LastModified> <Size>5</Size> </Contents> </ListBucketResult> """) with webserver.install_http_handler(handler): d = gdal.OpenDir('/vsis3/vsis3_opendir') assert d is not None entry = gdal.GetNextDirEntry(d) assert entry.name == 'test.txt' assert entry.size == 40 assert entry.mode == 32768 assert entry.mtime == 1 entry = gdal.GetNextDirEntry(d) assert entry.name == 'subdir' assert entry.mode == 16384 entry = gdal.GetNextDirEntry(d) assert entry.name == 'subdir/test.txt' entry = gdal.GetNextDirEntry(d) assert entry is None gdal.CloseDir(d) # Depth = 0 handler = webserver.SequentialHandler() handler.add('GET', '/vsis3_opendir/?delimiter=%2F', 200, {'Content-type': 'application/xml'}, """<?xml version="1.0" encoding="UTF-8"?> <ListBucketResult> <Prefix/> <Marker/> <Contents> <Key>test.txt</Key> <LastModified>1970-01-01T00:00:01.000Z</LastModified> <Size>40</Size> </Contents> <CommonPrefixes> <Prefix>subdir/</Prefix> </CommonPrefixes> </ListBucketResult> """) with webserver.install_http_handler(handler): d = gdal.OpenDir('/vsis3/vsis3_opendir', 0) assert d is not None entry = gdal.GetNextDirEntry(d) assert entry.name == 'test.txt' assert entry.size == 40 assert entry.mode == 32768 assert entry.mtime == 1 entry = gdal.GetNextDirEntry(d) assert entry.name == 'subdir' assert entry.mode == 16384 entry = gdal.GetNextDirEntry(d) assert entry is None gdal.CloseDir(d) # Depth = 1 handler = webserver.SequentialHandler() handler.add('GET', '/vsis3_opendir/?delimiter=%2F', 200, {'Content-type': 'application/xml'}, """<?xml version="1.0" encoding="UTF-8"?> <ListBucketResult> <Prefix/> <Marker/> <Contents> <Key>test.txt</Key> <LastModified>1970-01-01T00:00:01.000Z</LastModified> <Size>40</Size> </Contents> <CommonPrefixes> <Prefix>subdir/</Prefix> </CommonPrefixes> </ListBucketResult> """) with webserver.install_http_handler(handler): d = gdal.OpenDir('/vsis3/vsis3_opendir', 1) assert d is not None entry = gdal.GetNextDirEntry(d) assert entry.name == 'test.txt' assert entry.size == 40 assert entry.mode == 32768 assert entry.mtime == 1 entry = gdal.GetNextDirEntry(d) assert entry.name == 'subdir' assert entry.mode == 16384 handler = webserver.SequentialHandler() handler.add('GET', '/vsis3_opendir/?delimiter=%2F&prefix=subdir%2F', 200, {'Content-type': 'application/xml'}, """<?xml version="1.0" encoding="UTF-8"?> <ListBucketResult> <Prefix>subdir/</Prefix> <Marker/> <Contents> <Key>subdir/test.txt</Key> <LastModified>1970-01-01T00:00:01.000Z</LastModified> <Size>5</Size> </Contents> </ListBucketResult> """) with webserver.install_http_handler(handler): entry = gdal.GetNextDirEntry(d) assert entry.name == 'subdir/test.txt' entry = gdal.GetNextDirEntry(d) assert entry is None gdal.CloseDir(d) ############################################################################### # Test simple PUT support with a fake AWS server def test_vsis3_4(): if gdaltest.webserver_port == 0: pytest.skip() with webserver.install_http_handler(webserver.SequentialHandler()): with gdaltest.error_handler(): f = gdal.VSIFOpenL('/vsis3/s3_fake_bucket3', 'wb') assert f is None handler = webserver.SequentialHandler() handler.add('GET', '/s3_fake_bucket3/empty_file.bin', 200, {'Connection': 'close'}, 'foo') with webserver.install_http_handler(handler): assert gdal.VSIStatL('/vsis3/s3_fake_bucket3/empty_file.bin').size == 3 # Empty file handler = webserver.SequentialHandler() def method(request): if request.headers['Content-Length'] != '0': sys.stderr.write('Did not get expected headers: %s\n' % str(request.headers)) request.send_response(400) return request.send_response(200) request.send_header('Content-Length', 0) request.end_headers() handler.add('PUT', '/s3_fake_bucket3/empty_file.bin', custom_method=method) with webserver.install_http_handler(handler): f = gdal.VSIFOpenL('/vsis3/s3_fake_bucket3/empty_file.bin', 'wb') assert f is not None gdal.ErrorReset() gdal.VSIFCloseL(f) assert gdal.GetLastErrorMsg() == '' handler = webserver.SequentialHandler() handler.add('GET', '/s3_fake_bucket3/empty_file.bin', 200, {'Connection': 'close'}, '') with webserver.install_http_handler(handler): assert gdal.VSIStatL('/vsis3/s3_fake_bucket3/empty_file.bin').size == 0 # Invalid seek handler = webserver.SequentialHandler() with webserver.install_http_handler(handler): f = gdal.VSIFOpenL('/vsis3/s3_fake_bucket3/empty_file.bin', 'wb') assert f is not None with gdaltest.error_handler(): ret = gdal.VSIFSeekL(f, 1, 0) assert ret != 0 gdal.VSIFCloseL(f) # Invalid read handler = webserver.SequentialHandler() with webserver.install_http_handler(handler): f = gdal.VSIFOpenL('/vsis3/s3_fake_bucket3/empty_file.bin', 'wb') assert f is not None with gdaltest.error_handler(): ret = gdal.VSIFReadL(1, 1, f) assert not ret gdal.VSIFCloseL(f) # Error case handler = webserver.SequentialHandler() handler.add('PUT', '/s3_fake_bucket3/empty_file_error.bin', 403) with webserver.install_http_handler(handler): f = gdal.VSIFOpenL('/vsis3/s3_fake_bucket3/empty_file_error.bin', 'wb') assert f is not None gdal.ErrorReset() with gdaltest.error_handler(): gdal.VSIFCloseL(f) assert gdal.GetLastErrorMsg() != '' # Nominal case gdal.NetworkStatsReset() with gdaltest.config_option('CPL_VSIL_NETWORK_STATS_ENABLED', 'YES'): with webserver.install_http_handler(webserver.SequentialHandler()): f = gdal.VSIFOpenL('/vsis3/s3_fake_bucket3/another_file.bin', 'wb') assert f is not None assert gdal.VSIFSeekL(f, gdal.VSIFTellL(f), 0) == 0 assert gdal.VSIFSeekL(f, 0, 1) == 0 assert gdal.VSIFSeekL(f, 0, 2) == 0 assert gdal.VSIFWriteL('foo', 1, 3, f) == 3 assert gdal.VSIFSeekL(f, gdal.VSIFTellL(f), 0) == 0 assert gdal.VSIFWriteL('bar', 1, 3, f) == 3 handler = webserver.SequentialHandler() def method(request): if request.headers['Content-Length'] != '6': sys.stderr.write('Did not get expected headers: %s\n' % str(request.headers)) request.send_response(400) request.send_header('Content-Length', 0) request.end_headers() return request.wfile.write('HTTP/1.1 100 Continue\r\n\r\n'.encode('ascii')) content = request.rfile.read(6).decode('ascii') if content != 'foobar': sys.stderr.write('Did not get expected content: %s\n' % content) request.send_response(400) request.send_header('Content-Length', 0) request.end_headers() return request.send_response(200) request.send_header('Content-Length', 0) request.end_headers() handler.add('PUT', '/s3_fake_bucket3/another_file.bin', custom_method=method) gdal.ErrorReset() with webserver.install_http_handler(handler): gdal.VSIFCloseL(f) assert gdal.GetLastErrorMsg() == '' j = json.loads(gdal.NetworkStatsGetAsSerializedJSON()) #print(j) assert j == { "methods": { "PUT": { "count": 1, "uploaded_bytes": 6 } }, "handlers": { "vsis3": { "files": { "/vsis3/s3_fake_bucket3/another_file.bin": { "methods": { "PUT": { "count": 1, "uploaded_bytes": 6 } }, "actions": { "Write": { "methods": { "PUT": { "count": 1, "uploaded_bytes": 6 } } } } } }, "methods": { "PUT": { "count": 1, "uploaded_bytes": 6 } } } } } gdal.NetworkStatsReset() # Redirect case with webserver.install_http_handler(webserver.SequentialHandler()): f = gdal.VSIFOpenL('/vsis3/s3_fake_bucket3/redirect', 'wb') assert f is not None assert gdal.VSIFWriteL('foobar', 1, 6, f) == 6 handler = webserver.SequentialHandler() def method(request): request.protocol_version = 'HTTP/1.1' if request.headers['Authorization'].find('us-east-1') >= 0: request.send_response(400) response = '<?xml version="1.0" encoding="UTF-8"?><Error><Message>bla</Message><Code>AuthorizationHeaderMalformed</Code><Region>us-west-2</Region></Error>' response = '%x\r\n%s\r\n0\r\n\r\n' % (len(response), response) request.send_header('Content-type', 'application/xml') request.send_header('Transfer-Encoding', 'chunked') request.end_headers() request.wfile.write(response.encode('ascii')) elif request.headers['Authorization'].find('us-west-2') >= 0: if request.headers['Content-Length'] != '6': sys.stderr.write('Did not get expected headers: %s\n' % str(request.headers)) request.send_response(400) request.send_header('Content-Length', 0) request.end_headers() return request.wfile.write('HTTP/1.1 100 Continue\r\n\r\n'.encode('ascii')) content = request.rfile.read(6).decode('ascii') if content != 'foobar': sys.stderr.write('Did not get expected content: %s\n' % content) request.send_response(400) request.send_header('Content-Length', 0) request.end_headers() return request.send_response(200) request.send_header('Content-Length', 0) request.end_headers() else: sys.stderr.write('Bad headers: %s\n' % str(request.headers)) request.send_response(403) request.send_header('Content-Length', 0) request.end_headers() handler.add('PUT', '/s3_fake_bucket3/redirect', custom_method=method) handler.add('PUT', '/s3_fake_bucket3/redirect', custom_method=method) gdal.ErrorReset() with webserver.install_http_handler(handler): gdal.VSIFCloseL(f) assert gdal.GetLastErrorMsg() == '' ############################################################################### # Test simple PUT support with retry logic def test_vsis3_write_single_put_retry(): if gdaltest.webserver_port == 0: pytest.skip() with gdaltest.config_options({'GDAL_HTTP_MAX_RETRY': '2', 'GDAL_HTTP_RETRY_DELAY': '0.01'}): with webserver.install_http_handler(webserver.SequentialHandler()): f = gdal.VSIFOpenL('/vsis3/s3_fake_bucket3/put_with_retry.bin', 'wb') assert f is not None assert gdal.VSIFWriteL('foo', 1, 3, f) == 3 handler = webserver.SequentialHandler() def method(request): if request.headers['Content-Length'] != '3': sys.stderr.write('Did not get expected headers: %s\n' % str(request.headers)) request.send_response(400) request.send_header('Content-Length', 0) request.end_headers() return request.wfile.write('HTTP/1.1 100 Continue\r\n\r\n'.encode('ascii')) content = request.rfile.read(3).decode('ascii') if content != 'foo': sys.stderr.write('Did not get expected content: %s\n' % content) request.send_response(400) request.send_header('Content-Length', 0) request.end_headers() return request.send_response(200) request.send_header('Content-Length', 0) request.end_headers() handler.add('PUT', '/s3_fake_bucket3/put_with_retry.bin', 502) handler.add('PUT', '/s3_fake_bucket3/put_with_retry.bin', custom_method=method) with gdaltest.error_handler(): with webserver.install_http_handler(handler): gdal.VSIFCloseL(f) ############################################################################### # Test simple DELETE support with a fake AWS server def test_vsis3_5(): if gdaltest.webserver_port == 0: pytest.skip() with webserver.install_http_handler(webserver.SequentialHandler()): with gdaltest.error_handler(): ret = gdal.Unlink('/vsis3/foo') assert ret != 0 handler = webserver.SequentialHandler() handler.add('GET', '/s3_delete_bucket/delete_file', 200, {'Connection': 'close'}, 'foo') with webserver.install_http_handler(handler): assert gdal.VSIStatL('/vsis3/s3_delete_bucket/delete_file').size == 3 handler = webserver.SequentialHandler() with webserver.install_http_handler(handler): assert gdal.VSIStatL('/vsis3/s3_delete_bucket/delete_file').size == 3 handler = webserver.SequentialHandler() handler.add('DELETE', '/s3_delete_bucket/delete_file', 204) with webserver.install_http_handler(handler): ret = gdal.Unlink('/vsis3/s3_delete_bucket/delete_file') assert ret == 0 handler = webserver.SequentialHandler() handler.add('GET', '/s3_delete_bucket/delete_file', 404, {'Connection': 'close'}) handler.add('GET', '/s3_delete_bucket/?delimiter=%2F&max-keys=100&prefix=delete_file%2F', 404, {'Connection': 'close'}) with webserver.install_http_handler(handler): assert gdal.VSIStatL('/vsis3/s3_delete_bucket/delete_file') is None handler = webserver.SequentialHandler() handler.add('GET', '/s3_delete_bucket/delete_file_error', 200) handler.add('DELETE', '/s3_delete_bucket/delete_file_error', 403) with webserver.install_http_handler(handler): with gdaltest.error_handler(): ret = gdal.Unlink('/vsis3/s3_delete_bucket/delete_file_error') assert ret != 0 handler = webserver.SequentialHandler() handler.add('GET', '/s3_delete_bucket/redirect', 200) def method(request): request.protocol_version = 'HTTP/1.1' if request.headers['Authorization'].find('us-east-1') >= 0: request.send_response(400) response = '<?xml version="1.0" encoding="UTF-8"?><Error><Message>bla</Message><Code>AuthorizationHeaderMalformed</Code><Region>us-west-2</Region></Error>' response = '%x\r\n%s\r\n0\r\n\r\n' % (len(response), response) request.send_header('Content-type', 'application/xml') request.send_header('Transfer-Encoding', 'chunked') request.end_headers() request.wfile.write(response.encode('ascii')) elif request.headers['Authorization'].find('us-west-2') >= 0: request.send_response(204) request.send_header('Content-Length', 0) request.end_headers() else: sys.stderr.write('Bad headers: %s\n' % str(request.headers)) request.send_response(403) request.send_header('Content-Length', 0) request.end_headers() handler.add('DELETE', '/s3_delete_bucket/redirect', custom_method=method) handler.add('DELETE', '/s3_delete_bucket/redirect', custom_method=method) with webserver.install_http_handler(handler): ret = gdal.Unlink('/vsis3/s3_delete_bucket/redirect') assert ret == 0 ############################################################################### # Test DeleteObjects with a fake AWS server def test_vsis3_unlink_batch(): if gdaltest.webserver_port == 0: pytest.skip() def method(request): if request.headers['Content-MD5'] != 'Ze0X4LdlTwCsT+WpNxD9FA==': sys.stderr.write('Did not get expected headers: %s\n' % str(request.headers)) request.send_response(403) return content = request.rfile.read(int(request.headers['Content-Length'])).decode('ascii') if content != """<?xml version="1.0" encoding="UTF-8"?> <Delete xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <Object> <Key>foo</Key> </Object> <Object> <Key>bar/baz</Key> </Object> </Delete> """: sys.stderr.write('Did not get expected content: %s\n' % content) request.send_response(403) return request.protocol_version = 'HTTP/1.1' request.send_response(200) response = """<DeleteResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Deleted><Key>foo</Key></Deleted><Deleted><Key>bar/baz</Key></Deleted></DeleteResult>""" request.send_header('Content-Length', len(response)) request.send_header('Connection', 'close') request.end_headers() request.wfile.write(response.encode('ascii')) handler = webserver.SequentialHandler() handler.add('POST', '/unlink_batch/?delete', custom_method=method) handler.add('POST', '/unlink_batch/?delete', 200, {}, """<DeleteResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Deleted><Key>baw</Key></Deleted></DeleteResult>""") with gdaltest.config_option('CPL_VSIS3_UNLINK_BATCH_SIZE', '2'): with webserver.install_http_handler(handler): ret = gdal.UnlinkBatch(['/vsis3/unlink_batch/foo', '/vsis3/unlink_batch/bar/baz', '/vsis3/unlink_batch/baw']) assert ret handler = webserver.SequentialHandler() handler.add('POST', '/unlink_batch/?delete', 200, {}, """<DeleteResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Failed><Key>foo</Key></Failed></DeleteResult>""") with webserver.install_http_handler(handler): ret = gdal.UnlinkBatch(['/vsis3/unlink_batch/foo']) assert not ret ############################################################################### # Test RmdirRecursive() with a fake AWS server def test_vsis3_rmdir_recursive(): if gdaltest.webserver_port == 0: pytest.skip() handler = webserver.SequentialHandler() handler.add('GET', '/test_rmdir_recursive/?prefix=somedir%2F', 200, {'Content-type': 'application/xml'}, """<?xml version="1.0" encoding="UTF-8"?> <ListBucketResult> <Prefix>somedir/</Prefix> <Marker/> <Contents> <Key>somedir/test.txt</Key> <LastModified>1970-01-01T00:00:01.000Z</LastModified> <Size>40</Size> </Contents> <Contents> <Key>somedir/subdir/</Key> <LastModified>1970-01-01T00:00:01.000Z</LastModified> <Size>0</Size> </Contents> <Contents> <Key>somedir/subdir/test.txt</Key> <LastModified>1970-01-01T00:00:01.000Z</LastModified> <Size>5</Size> </Contents> </ListBucketResult> """) def method(request): content = request.rfile.read(int(request.headers['Content-Length'])).decode('ascii') if content != """<?xml version="1.0" encoding="UTF-8"?> <Delete xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <Object> <Key>somedir/test.txt</Key> </Object> <Object> <Key>somedir/subdir/</Key> </Object> </Delete> """: sys.stderr.write('Did not get expected content: %s\n' % content) request.send_response(403) return request.protocol_version = 'HTTP/1.1' request.send_response(200) response = """<DeleteResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Deleted><Key>somedir/test.txt</Key></Deleted><Deleted><Key>somedir/subdir/</Key></Deleted></DeleteResult>""" request.send_header('Content-Length', len(response)) request.send_header('Connection', 'close') request.end_headers() request.wfile.write(response.encode('ascii')) handler.add('POST', '/test_rmdir_recursive/?delete', custom_method=method) def method(request): content = request.rfile.read(int(request.headers['Content-Length'])).decode('ascii') if content != """<?xml version="1.0" encoding="UTF-8"?> <Delete xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <Object> <Key>somedir/subdir/test.txt</Key> </Object> <Object> <Key>somedir/</Key> </Object> </Delete> """: sys.stderr.write('Did not get expected content: %s\n' % content) request.send_response(403) return request.protocol_version = 'HTTP/1.1' request.send_response(200) response = """<DeleteResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Deleted><Key>somedir/subdir/test.txt</Key></Deleted><Deleted><Key>somedir/</Key></Deleted></DeleteResult>""" request.send_header('Content-Length', len(response)) request.send_header('Connection', 'close') request.end_headers() request.wfile.write(response.encode('ascii')) handler.add('POST', '/test_rmdir_recursive/?delete', custom_method=method) with gdaltest.config_option('CPL_VSIS3_UNLINK_BATCH_SIZE', '2'): with webserver.install_http_handler(handler): assert gdal.RmdirRecursive('/vsis3/test_rmdir_recursive/somedir') == 0 ############################################################################### # Test multipart upload with a fake AWS server def test_vsis3_6(): if gdaltest.webserver_port == 0: pytest.skip() with gdaltest.config_option('VSIS3_CHUNK_SIZE', '1'): # 1 MB with webserver.install_http_handler(webserver.SequentialHandler()): f = gdal.VSIFOpenL('/vsis3/s3_fake_bucket4/large_file.bin', 'wb') assert f is not None size = 1024 * 1024 + 1 big_buffer = 'a' * size handler = webserver.SequentialHandler() def method(request): request.protocol_version = 'HTTP/1.1' if request.headers['Authorization'].find('us-east-1') >= 0: request.send_response(400) response = '<?xml version="1.0" encoding="UTF-8"?><Error><Message>bla</Message><Code>AuthorizationHeaderMalformed</Code><Region>us-west-2</Region></Error>' response = '%x\r\n%s\r\n0\r\n\r\n' % (len(response), response) request.send_header('Content-type', 'application/xml') request.send_header('Transfer-Encoding', 'chunked') request.end_headers() request.wfile.write(response.encode('ascii')) elif request.headers['Authorization'].find('us-west-2') >= 0: response = '<?xml version="1.0" encoding="UTF-8"?><InitiateMultipartUploadResult><UploadId>my_id</UploadId></InitiateMultipartUploadResult>' request.send_response(200) request.send_header('Content-type', 'application/xml') request.send_header('Content-Length', len(response)) request.end_headers() request.wfile.write(response.encode('ascii')) else: sys.stderr.write('Bad headers: %s\n' % str(request.headers)) request.send_response(403) request.send_header('Content-Length', 0) request.end_headers() handler.add('POST', '/s3_fake_bucket4/large_file.bin?uploads', custom_method=method) handler.add('POST', '/s3_fake_bucket4/large_file.bin?uploads', custom_method=method) def method(request): if request.headers['Content-Length'] != '1048576': sys.stderr.write('Did not get expected headers: %s\n' % str(request.headers)) request.send_response(400) request.send_header('Content-Length', 0) request.end_headers() return request.send_response(200) request.send_header('ETag', '"first_etag"') request.send_header('Content-Length', 0) request.end_headers() handler.add('PUT', '/s3_fake_bucket4/large_file.bin?partNumber=1&uploadId=my_id', custom_method=method) with webserver.install_http_handler(handler): ret = gdal.VSIFWriteL(big_buffer, 1, size, f) assert ret == size handler = webserver.SequentialHandler() def method(request): if request.headers['Content-Length'] != '1': sys.stderr.write('Did not get expected headers: %s\n' % str(request.headers)) request.send_response(400) return request.send_response(200) request.send_header('ETag', '"second_etag"') request.send_header('Content-Length', 0) request.end_headers() handler.add('PUT', '/s3_fake_bucket4/large_file.bin?partNumber=2&uploadId=my_id', custom_method=method) def method(request): if request.headers['Content-Length'] != '186': sys.stderr.write('Did not get expected headers: %s\n' % str(request.headers)) request.send_response(400) request.send_header('Content-Length', 0) request.end_headers() return content = request.rfile.read(186).decode('ascii') if content != """<CompleteMultipartUpload> <Part> <PartNumber>1</PartNumber><ETag>"first_etag"</ETag></Part> <Part> <PartNumber>2</PartNumber><ETag>"second_etag"</ETag></Part> </CompleteMultipartUpload> """: sys.stderr.write('Did not get expected content: %s\n' % content) request.send_response(400) request.send_header('Content-Length', 0) request.end_headers() return request.send_response(200) request.send_header('Content-Length', 0) request.end_headers() handler.add('POST', '/s3_fake_bucket4/large_file.bin?uploadId=my_id', custom_method=method) gdal.ErrorReset() with webserver.install_http_handler(handler): gdal.VSIFCloseL(f) assert gdal.GetLastErrorMsg() == '' handler = webserver.SequentialHandler() handler.add('POST', '/s3_fake_bucket4/large_file_initiate_403_error.bin?uploads', 403) handler.add('POST', '/s3_fake_bucket4/large_file_initiate_empty_result.bin?uploads', 200) handler.add('POST', '/s3_fake_bucket4/large_file_initiate_invalid_xml_result.bin?uploads', 200, {}, 'foo') handler.add('POST', '/s3_fake_bucket4/large_file_initiate_no_uploadId.bin?uploads', 200, {}, '<foo/>') with webserver.install_http_handler(handler): for filename in ['/vsis3/s3_fake_bucket4/large_file_initiate_403_error.bin', '/vsis3/s3_fake_bucket4/large_file_initiate_empty_result.bin', '/vsis3/s3_fake_bucket4/large_file_initiate_invalid_xml_result.bin', '/vsis3/s3_fake_bucket4/large_file_initiate_no_uploadId.bin']: with gdaltest.config_option('VSIS3_CHUNK_SIZE', '1'): # 1 MB f = gdal.VSIFOpenL(filename, 'wb') assert f is not None with gdaltest.error_handler(): ret = gdal.VSIFWriteL(big_buffer, 1, size, f) assert ret == 0 gdal.ErrorReset() gdal.VSIFCloseL(f) assert gdal.GetLastErrorMsg() == '' handler = webserver.SequentialHandler() handler.add('POST', '/s3_fake_bucket4/large_file_upload_part_403_error.bin?uploads', 200, {}, '<?xml version="1.0" encoding="UTF-8"?><InitiateMultipartUploadResult><UploadId>my_id</UploadId></InitiateMultipartUploadResult>') handler.add('PUT', '/s3_fake_bucket4/large_file_upload_part_403_error.bin?partNumber=1&uploadId=my_id', 403) handler.add('DELETE', '/s3_fake_bucket4/large_file_upload_part_403_error.bin?uploadId=my_id', 204) handler.add('POST', '/s3_fake_bucket4/large_file_upload_part_no_etag.bin?uploads', 200, {}, '<?xml version="1.0" encoding="UTF-8"?><InitiateMultipartUploadResult><UploadId>my_id</UploadId></InitiateMultipartUploadResult>') handler.add('PUT', '/s3_fake_bucket4/large_file_upload_part_no_etag.bin?partNumber=1&uploadId=my_id', 200) handler.add('DELETE', '/s3_fake_bucket4/large_file_upload_part_no_etag.bin?uploadId=my_id', 204) with webserver.install_http_handler(handler): for filename in ['/vsis3/s3_fake_bucket4/large_file_upload_part_403_error.bin', '/vsis3/s3_fake_bucket4/large_file_upload_part_no_etag.bin']: with gdaltest.config_option('VSIS3_CHUNK_SIZE', '1'): # 1 MB f = gdal.VSIFOpenL(filename, 'wb') assert f is not None, filename with gdaltest.error_handler(): ret = gdal.VSIFWriteL(big_buffer, 1, size, f) assert ret == 0, filename gdal.ErrorReset() gdal.VSIFCloseL(f) assert gdal.GetLastErrorMsg() == '', filename # Simulate failure in AbortMultipart stage handler = webserver.SequentialHandler() handler.add('POST', '/s3_fake_bucket4/large_file_abortmultipart_403_error.bin?uploads', 200, {}, '<?xml version="1.0" encoding="UTF-8"?><InitiateMultipartUploadResult><UploadId>my_id</UploadId></InitiateMultipartUploadResult>') handler.add('PUT', '/s3_fake_bucket4/large_file_abortmultipart_403_error.bin?partNumber=1&uploadId=my_id', 403) handler.add('DELETE', '/s3_fake_bucket4/large_file_abortmultipart_403_error.bin?uploadId=my_id', 403) filename = '/vsis3/s3_fake_bucket4/large_file_abortmultipart_403_error.bin' with webserver.install_http_handler(handler): with gdaltest.config_option('VSIS3_CHUNK_SIZE', '1'): # 1 MB f = gdal.VSIFOpenL(filename, 'wb') assert f is not None, filename with gdaltest.error_handler(): ret = gdal.VSIFWriteL(big_buffer, 1, size, f) assert ret == 0, filename gdal.ErrorReset() with gdaltest.error_handler(): gdal.VSIFCloseL(f) assert gdal.GetLastErrorMsg() != '', filename # Simulate failure in CompleteMultipartUpload stage handler = webserver.SequentialHandler() handler.add('POST', '/s3_fake_bucket4/large_file_completemultipart_403_error.bin?uploads', 200, {}, '<?xml version="1.0" encoding="UTF-8"?><InitiateMultipartUploadResult><UploadId>my_id</UploadId></InitiateMultipartUploadResult>') handler.add('PUT', '/s3_fake_bucket4/large_file_completemultipart_403_error.bin?partNumber=1&uploadId=my_id', 200, {'ETag': 'first_etag'}, '') handler.add('PUT', '/s3_fake_bucket4/large_file_completemultipart_403_error.bin?partNumber=2&uploadId=my_id', 200, {'ETag': 'second_etag'}, '') handler.add('POST', '/s3_fake_bucket4/large_file_completemultipart_403_error.bin?uploadId=my_id', 403) # handler.add('DELETE', '/s3_fake_bucket4/large_file_completemultipart_403_error.bin?uploadId=my_id', 204) filename = '/vsis3/s3_fake_bucket4/large_file_completemultipart_403_error.bin' with webserver.install_http_handler(handler): with gdaltest.config_option('VSIS3_CHUNK_SIZE', '1'): # 1 MB f = gdal.VSIFOpenL(filename, 'wb') assert f is not None, filename ret = gdal.VSIFWriteL(big_buffer, 1, size, f) assert ret == size, filename gdal.ErrorReset() with gdaltest.error_handler(): gdal.VSIFCloseL(f) assert gdal.GetLastErrorMsg() != '', filename ############################################################################### # Test multipart upload with retry logic def test_vsis3_write_multipart_retry(): if gdaltest.webserver_port == 0: pytest.skip() with gdaltest.config_options({'GDAL_HTTP_MAX_RETRY': '2', 'GDAL_HTTP_RETRY_DELAY': '0.01'}): with gdaltest.config_option('VSIS3_CHUNK_SIZE', '1'): # 1 MB with webserver.install_http_handler(webserver.SequentialHandler()): f = gdal.VSIFOpenL('/vsis3/s3_fake_bucket4/large_file.bin', 'wb') assert f is not None size = 1024 * 1024 + 1 big_buffer = 'a' * size handler = webserver.SequentialHandler() response = '<?xml version="1.0" encoding="UTF-8"?><InitiateMultipartUploadResult><UploadId>my_id</UploadId></InitiateMultipartUploadResult>' handler.add('POST', '/s3_fake_bucket4/large_file.bin?uploads', 502) handler.add('POST', '/s3_fake_bucket4/large_file.bin?uploads', 200, {'Content-type': 'application/xml', 'Content-Length': len(response), 'Connection': 'close'}, response) handler.add('PUT', '/s3_fake_bucket4/large_file.bin?partNumber=1&uploadId=my_id', 502) handler.add('PUT', '/s3_fake_bucket4/large_file.bin?partNumber=1&uploadId=my_id', 200, {'Content-Length': '0', 'ETag': '"first_etag"', 'Connection': 'close'}, {}) with gdaltest.error_handler(): with webserver.install_http_handler(handler): ret = gdal.VSIFWriteL(big_buffer, 1, size, f) assert ret == size handler = webserver.SequentialHandler() handler.add('PUT', '/s3_fake_bucket4/large_file.bin?partNumber=2&uploadId=my_id', 200, {'Content-Length': '0', 'ETag': '"second_etag"', 'Connection': 'close'}, {}) handler.add('POST', '/s3_fake_bucket4/large_file.bin?uploadId=my_id', 502) handler.add('POST', '/s3_fake_bucket4/large_file.bin?uploadId=my_id', 200, {'Content-Length': '0', 'Connection': 'close'}, {}) with gdaltest.error_handler(): with webserver.install_http_handler(handler): gdal.VSIFCloseL(f) ############################################################################### # Test Mkdir() / Rmdir() def test_vsis3_7(): if gdaltest.webserver_port == 0: pytest.skip() handler = webserver.SequentialHandler() handler.add('GET', '/s3_bucket_test_mkdir/dir/', 404, {'Connection': 'close'}) handler.add('GET', '/s3_bucket_test_mkdir/?delimiter=%2F&max-keys=100&prefix=dir%2F', 404, {'Connection': 'close'}) handler.add('PUT', '/s3_bucket_test_mkdir/dir/', 200) with webserver.install_http_handler(handler): ret = gdal.Mkdir('/vsis3/s3_bucket_test_mkdir/dir', 0) assert ret == 0 assert stat.S_ISDIR(gdal.VSIStatL('/vsis3/s3_bucket_test_mkdir/dir').mode) dir_content = gdal.ReadDir('/vsis3/s3_bucket_test_mkdir/dir') assert dir_content == ['.'] # Try creating already existing directory handler = webserver.SequentialHandler() handler.add('GET', '/s3_bucket_test_mkdir/dir/', 416, {'Connection': 'close'}) with webserver.install_http_handler(handler): ret = gdal.Mkdir('/vsis3/s3_bucket_test_mkdir/dir', 0) assert ret != 0 handler = webserver.SequentialHandler() handler.add('DELETE', '/s3_bucket_test_mkdir/dir/', 204) with webserver.install_http_handler(handler): ret = gdal.Rmdir('/vsis3/s3_bucket_test_mkdir/dir') assert ret == 0 # Try deleting already deleted directory handler = webserver.SequentialHandler() handler.add('GET', '/s3_bucket_test_mkdir/dir/', 404) handler.add('GET', '/s3_bucket_test_mkdir/?delimiter=%2F&max-keys=100&prefix=dir%2F', 404, {'Connection': 'close'}) with webserver.install_http_handler(handler): ret = gdal.Rmdir('/vsis3/s3_bucket_test_mkdir/dir') assert ret != 0 # Try deleting non-empty directory handler = webserver.SequentialHandler() handler.add('GET', '/s3_bucket_test_mkdir/dir_nonempty/', 416) handler.add('GET', '/s3_bucket_test_mkdir/?delimiter=%2F&max-keys=100&prefix=dir_nonempty%2F', 200, {'Content-type': 'application/xml'}, """<?xml version="1.0" encoding="UTF-8"?> <ListBucketResult> <Prefix>dir_nonempty/</Prefix> <Contents> <Key>dir_nonempty/test.txt</Key> <LastModified>1970-01-01T00:00:01.000Z</LastModified> <Size>40</Size> </Contents> </ListBucketResult> """) with webserver.install_http_handler(handler): ret = gdal.Rmdir('/vsis3/s3_bucket_test_mkdir/dir_nonempty') assert ret != 0 # Try stat'ing a directory not ending with slash handler = webserver.SequentialHandler() handler.add('GET', '/s3_bucket_test_dir_stat/test_dir_stat', 400) handler.add('GET', '/s3_bucket_test_dir_stat/?delimiter=%2F&max-keys=100&prefix=test_dir_stat%2F', 200, {'Content-type': 'application/xml'}, """<?xml version="1.0" encoding="UTF-8"?> <ListBucketResult> <Prefix>test_dir_stat/</Prefix> <Contents> <Key>test_dir_stat/test.txt</Key> <LastModified>1970-01-01T00:00:01.000Z</LastModified> <Size>40</Size> </Contents> </ListBucketResult> """) with webserver.install_http_handler(handler): assert stat.S_ISDIR(gdal.VSIStatL('/vsis3/s3_bucket_test_dir_stat/test_dir_stat').mode) # Try ReadDi'ing a directory not ending with slash handler = webserver.SequentialHandler() handler.add('GET', '/s3_bucket_test_readdir/?delimiter=%2F&prefix=test_dirread%2F', 200, {'Content-type': 'application/xml'}, """<?xml version="1.0" encoding="UTF-8"?> <ListBucketResult> <Prefix>test_dirread/</Prefix> <Contents> <Key>test_dirread/test.txt</Key> <LastModified>1970-01-01T00:00:01.000Z</LastModified> <Size>40</Size> </Contents> </ListBucketResult> """) with webserver.install_http_handler(handler): assert gdal.ReadDir('/vsis3/s3_bucket_test_readdir/test_dirread') is not None # Try stat'ing a directory ending with slash handler = webserver.SequentialHandler() handler.add('GET', '/s3_bucket_test_dir_stat_2/test_dir_stat/', 400) handler.add('GET', '/s3_bucket_test_dir_stat_2/?delimiter=%2F&max-keys=100&prefix=test_dir_stat%2F', 200, {'Content-type': 'application/xml'}, """<?xml version="1.0" encoding="UTF-8"?> <ListBucketResult> <Prefix>test_dir_stat/</Prefix> <Contents> <Key>test_dir_stat/test.txt</Key> <LastModified>1970-01-01T00:00:01.000Z</LastModified> <Size>40</Size> </Contents> </ListBucketResult> """) with webserver.install_http_handler(handler): assert stat.S_ISDIR(gdal.VSIStatL('/vsis3/s3_bucket_test_dir_stat_2/test_dir_stat/').mode) # Try ReadDi'ing a directory ending with slash handler = webserver.SequentialHandler() handler.add('GET', '/s3_bucket_test_readdir2/?delimiter=%2F&prefix=test_dirread%2F', 200, {'Content-type': 'application/xml'}, """<?xml version="1.0" encoding="UTF-8"?> <ListBucketResult> <Prefix>test_dirread/</Prefix> <Contents> <Key>test_dirread/test.txt</Key> <LastModified>1970-01-01T00:00:01.000Z</LastModified> <Size>40</Size> </Contents> </ListBucketResult> """) with webserver.install_http_handler(handler): assert gdal.ReadDir('/vsis3/s3_bucket_test_readdir2/test_dirread') is not None ############################################################################### # Test handling of file and directory with same name def test_vsis3_8(): if gdaltest.webserver_port == 0: pytest.skip() handler = webserver.SequentialHandler() handler.add('GET', '/vsis3_8/?delimiter=%2F', 200, {'Content-type': 'application/xml'}, """<?xml version="1.0" encoding="UTF-8"?> <ListBucketResult> <Prefix></Prefix> <Contents> <Key>test</Key> <LastModified>1970-01-01T00:00:01.000Z</LastModified> <Size>40</Size> </Contents> <CommonPrefixes> <Prefix>test/</Prefix> </CommonPrefixes> </ListBucketResult> """) with webserver.install_http_handler(handler): listdir = gdal.ReadDir('/vsis3/vsis3_8', 0) assert listdir == ['test', 'test/'] handler = webserver.SequentialHandler() with webserver.install_http_handler(handler): assert not stat.S_ISDIR(gdal.VSIStatL('/vsis3/vsis3_8/test').mode) handler = webserver.SequentialHandler() with webserver.install_http_handler(handler): assert stat.S_ISDIR(gdal.VSIStatL('/vsis3/vsis3_8/test/').mode) ############################################################################### # Test vsisync() with SYNC_STRATEGY=ETAG def test_vsis3_sync_etag(): if gdaltest.webserver_port == 0: pytest.skip() gdal.VSICurlClearCache() options = ['SYNC_STRATEGY=ETAG'] with gdaltest.error_handler(): handler = webserver.SequentialHandler() with webserver.install_http_handler(handler): assert not gdal.Sync('/i_do/not/exist', '/vsis3/', options=options) with gdaltest.error_handler(): handler = webserver.SequentialHandler() handler.add('GET', '/do_not/exist', 404) handler.add('GET', '/do_not/?delimiter=%2F&max-keys=100&prefix=exist%2F', 404) handler.add('PUT', '/do_not/exist', 404) with webserver.install_http_handler(handler): assert not gdal.Sync('vsifile.py', '/vsis3/do_not/exist', options=options) handler = webserver.SequentialHandler() handler.add('GET', '/out/', 200) handler.add('GET', '/out/testsync.txt', 404) handler.add('GET', '/out/?delimiter=%2F&max-keys=100&prefix=testsync.txt%2F', 404) def method(request): if request.headers['Content-Length'] != '3': sys.stderr.write('Did not get expected headers: %s\n' % str(request.headers)) request.send_response(400) request.send_header('Content-Length', 0) request.end_headers() return request.wfile.write('HTTP/1.1 100 Continue\r\n\r\n'.encode('ascii')) content = request.rfile.read(3).decode('ascii') if content != 'foo': sys.stderr.write('Did not get expected content: %s\n' % content) request.send_response(400) request.send_header('Content-Length', 0) request.end_headers() return request.send_response(200) request.send_header('Content-Length', 0) request.send_header('ETag', '"acbd18db4cc2f85cedef654fccc4a4d8"') request.end_headers() handler.add('PUT', '/out/testsync.txt', custom_method=method) gdal.FileFromMemBuffer('/vsimem/testsync.txt', 'foo') def cbk(pct, _, tab): assert pct > tab[0] tab[0] = pct return True tab = [ 0 ] with webserver.install_http_handler(handler): assert gdal.Sync('/vsimem/testsync.txt', '/vsis3/out', options=options, callback=cbk, callback_data=tab) assert tab[0] == 1.0 # Re-try with cached ETag. Should generate no network access handler = webserver.SequentialHandler() with webserver.install_http_handler(handler): assert gdal.Sync('/vsimem/testsync.txt', '/vsis3/out', options=options) assert gdal.Sync('/vsimem/testsync.txt', '/vsis3/out/testsync.txt', options=options) gdal.VSICurlClearCache() # Other direction: S3 to /vsimem handler = webserver.SequentialHandler() handler.add('GET', '/out/testsync.txt', 206, { 'Content-Length' : '3', 'Content-Range': 'bytes 0-2/3', 'ETag' : '"acbd18db4cc2f85cedef654fccc4a4d8"' }, "foo") with webserver.install_http_handler(handler): assert gdal.Sync( '/vsis3/out/testsync.txt', '/vsimem/', options=options) # Shouldn't do any copy, but hard to verify with webserver.install_http_handler(webserver.SequentialHandler()): assert gdal.Sync( '/vsis3/out/testsync.txt', '/vsimem/', options=options) assert gdal.Sync( '/vsis3/out/testsync.txt', '/vsimem/testsync.txt', options=options) # Modify target file, and redo synchronization gdal.FileFromMemBuffer('/vsimem/testsync.txt', 'bar') handler = webserver.SequentialHandler() handler.add('GET', '/out/testsync.txt', 200, { 'Content-Length' : '3', 'ETag' : '"acbd18db4cc2f85cedef654fccc4a4d8"' }, "foo") with webserver.install_http_handler(handler): assert gdal.Sync( '/vsis3/out/testsync.txt', '/vsimem/', options=options) f = gdal.VSIFOpenL('/vsimem/testsync.txt', 'rb') data = gdal.VSIFReadL(1, 3, f).decode('ascii') gdal.VSIFCloseL(f) assert data == 'foo' # /vsimem to S3, but after cleaning the cache gdal.VSICurlClearCache() handler = webserver.SequentialHandler() handler.add('GET', '/out/', 200) handler.add('GET', '/out/testsync.txt', 206, { 'Content-Length' : '3', 'Content-Range': 'bytes 0-2/3', 'ETag' : '"acbd18db4cc2f85cedef654fccc4a4d8"' }, "foo") with webserver.install_http_handler(handler): assert gdal.Sync('/vsimem/testsync.txt', '/vsis3/out', options=options) gdal.Unlink('/vsimem/testsync.txt') # Directory copying gdal.VSICurlClearCache() gdal.Mkdir('/vsimem/subdir', 0) gdal.FileFromMemBuffer('/vsimem/subdir/testsync.txt', 'foo') handler = webserver.SequentialHandler() handler.add('GET', '/out/', 200, {}, """<?xml version="1.0" encoding="UTF-8"?> <ListBucketResult> <Prefix/> <Marker/> <IsTruncated>false</IsTruncated> <Contents> <Key>testsync.txt</Key> <LastModified>1970-01-01T00:00:01.000Z</LastModified> <Size>3</Size> <ETag>"acbd18db4cc2f85cedef654fccc4a4d8"</ETag> </Contents> </ListBucketResult> """) with webserver.install_http_handler(handler): assert gdal.Sync('/vsimem/subdir/', '/vsis3/out', options=options) gdal.RmdirRecursive('/vsimem/subdir') ############################################################################### # Test vsisync() with SYNC_STRATEGY=TIMESTAMP def test_vsis3_sync_timestamp(): if gdaltest.webserver_port == 0: pytest.skip() options = ['SYNC_STRATEGY=TIMESTAMP'] gdal.FileFromMemBuffer('/vsimem/testsync.txt', 'foo') # S3 to local: S3 file is older -> download gdal.VSICurlClearCache() handler = webserver.SequentialHandler() handler.add('GET', '/out/testsync.txt', 206, { 'Content-Length' : '3', 'Content-Range': 'bytes 0-2/3', 'Last-Modified': 'Mon, 01 Jan 1970 00:00:01 GMT' }, "foo") handler.add('GET', '/out/testsync.txt', 200, { 'Content-Length' : '3', 'Last-Modified': 'Mon, 01 Jan 1970 00:00:01 GMT' }, "foo") with webserver.install_http_handler(handler): assert gdal.Sync( '/vsis3/out/testsync.txt', '/vsimem/', options=options) # S3 to local: S3 file is newer -> do nothing gdal.VSICurlClearCache() handler = webserver.SequentialHandler() handler.add('GET', '/out/testsync.txt', 206, { 'Content-Length' : '3', 'Content-Range': 'bytes 0-2/3', 'Last-Modified': 'Mon, 01 Jan 2037 00:00:01 GMT' }, "foo") with webserver.install_http_handler(handler): assert gdal.Sync( '/vsis3/out/testsync.txt', '/vsimem/', options=options) # Local to S3: S3 file is older -> upload gdal.VSICurlClearCache() handler = webserver.SequentialHandler() handler.add('GET', '/out/testsync.txt', 206, { 'Content-Length' : '3', 'Content-Range': 'bytes 0-2/3', 'Last-Modified': 'Mon, 01 Jan 1970 00:00:01 GMT' }, "foo") handler.add('PUT', '/out/testsync.txt', 200) with webserver.install_http_handler(handler): assert gdal.Sync( '/vsimem/testsync.txt', '/vsis3/out/testsync.txt', options=options) # Local to S3: S3 file is newer -> do nothgin gdal.VSICurlClearCache() handler = webserver.SequentialHandler() handler.add('GET', '/out/testsync.txt', 206, { 'Content-Length' : '3', 'Content-Range': 'bytes 0-2/3', 'Last-Modified': 'Mon, 01 Jan 2037 00:00:01 GMT' }, "foo") with webserver.install_http_handler(handler): assert gdal.Sync( '/vsimem/testsync.txt', '/vsis3/out/testsync.txt', options=options) gdal.Unlink('/vsimem/testsync.txt') ############################################################################### # Test vsisync() with SYNC_STRATEGY=OVERWRITE def test_vsis3_sync_overwrite(): if gdaltest.webserver_port == 0: pytest.skip() options = ['SYNC_STRATEGY=OVERWRITE'] gdal.FileFromMemBuffer('/vsimem/testsync.txt', 'foo') # S3 to local: S3 file is newer gdal.VSICurlClearCache() handler = webserver.SequentialHandler() handler.add('GET', '/out/testsync.txt', 206, { 'Content-Length' : '3', 'Content-Range': 'bytes 0-2/3', 'Last-Modified': 'Mon, 01 Jan 2037 00:00:01 GMT' }, "foo") handler.add('GET', '/out/testsync.txt', 200, { 'Content-Length' : '3', 'Last-Modified': 'Mon, 01 Jan 2037 00:00:01 GMT' }, "foo") with webserver.install_http_handler(handler): assert gdal.Sync( '/vsis3/out/testsync.txt', '/vsimem/', options=options) # Local to S3: S3 file is newer gdal.VSICurlClearCache() handler = webserver.SequentialHandler() handler.add('GET', '/out/testsync.txt', 206, { 'Content-Length' : '3', 'Content-Range': 'bytes 0-2/3', 'Last-Modified': 'Mon, 01 Jan 2037 00:00:01 GMT' }, "foo") handler.add('PUT', '/out/testsync.txt', 200) with webserver.install_http_handler(handler): assert gdal.Sync( '/vsimem/testsync.txt', '/vsis3/out/testsync.txt', options=options) gdal.Unlink('/vsimem/testsync.txt') ############################################################################### # Test vsisync() with source and target in /vsis3 def test_vsis3_sync_source_target_in_vsis3(): if gdaltest.webserver_port == 0: pytest.skip() gdal.VSICurlClearCache() handler = webserver.SequentialHandler() handler.add('GET', '/in/testsync.txt', 200, { 'Content-Length' : '3', 'Content-Range': 'bytes 0-2/3', 'Last-Modified': 'Mon, 01 Jan 1970 00:00:01 GMT' }, "foo") handler.add('GET', '/out/', 200) handler.add('GET', '/out/testsync.txt', 200, { 'Content-Length' : '3', 'Last-Modified': 'Mon, 01 Jan 1970 00:00:01 GMT' }, "foo") def method(request): if request.headers['Content-Length'] != '0': sys.stderr.write('Did not get expected headers: %s\n' % str(request.headers)) request.send_response(400) return if request.headers['x-amz-copy-source'] != '/in/testsync.txt': sys.stderr.write('Did not get expected headers: %s\n' % str(request.headers)) request.send_response(400) return request.send_response(200) request.send_header('Content-Length', 0) request.end_headers() handler.add('PUT', '/out/testsync.txt', custom_method=method) with webserver.install_http_handler(handler): assert gdal.Sync( '/vsis3/in/testsync.txt', '/vsis3/out/') ############################################################################### # Test rename def test_vsis3_fake_rename(): if gdaltest.webserver_port == 0: pytest.skip() gdal.VSICurlClearCache() handler = webserver.SequentialHandler() handler.add('GET', '/test/source.txt', 206, { 'Content-Length' : '3', 'Content-Range': 'bytes 0-2/3' }, "foo") handler.add('GET', '/test/target.txt', 404) handler.add('GET', '/test/?delimiter=%2F&max-keys=100&prefix=target.txt%2F', 200) def method(request): if request.headers['Content-Length'] != '0': sys.stderr.write('Did not get expected headers: %s\n' % str(request.headers)) request.send_response(400) return if request.headers['x-amz-copy-source'] != '/test/source.txt': sys.stderr.write('Did not get expected headers: %s\n' % str(request.headers)) request.send_response(400) return request.send_response(200) request.send_header('Content-Length', 0) request.end_headers() handler.add('PUT', '/test/target.txt', custom_method=method) handler.add('DELETE', '/test/source.txt', 204) with webserver.install_http_handler(handler): assert gdal.Rename( '/vsis3/test/source.txt', '/vsis3/test/target.txt') == 0 ############################################################################### # Test rename def test_vsis3_fake_rename_dir(): if gdaltest.webserver_port == 0: pytest.skip() gdal.VSICurlClearCache() handler = webserver.SequentialHandler() handler.add('GET', '/test/source_dir', 404) handler.add('GET', '/test/?delimiter=%2F&max-keys=100&prefix=source_dir%2F', 200, {'Content-type': 'application/xml'}, """<?xml version="1.0" encoding="UTF-8"?> <ListBucketResult> <Prefix>source_dir/</Prefix> <Contents> <Key>source_dir/test.txt</Key> <LastModified>1970-01-01T00:00:01.000Z</LastModified> <Size>3</Size> </Contents> </ListBucketResult> """) handler.add('GET', '/test/target_dir/', 404) handler.add('GET', '/test/?delimiter=%2F&max-keys=100&prefix=target_dir%2F', 404) def method(request): if request.headers['Content-Length'] != '0': sys.stderr.write('Did not get expected headers: %s\n' % str(request.headers)) request.send_response(400) request.send_header('Content-Length', 0) request.end_headers() return request.wfile.write('HTTP/1.1 100 Continue\r\n\r\n'.encode('ascii')) request.send_response(200) request.send_header('Content-Length', 0) request.end_headers() handler.add('PUT', '/test/target_dir/', custom_method=method) def method(request): if request.headers['Content-Length'] != '0': sys.stderr.write('Did not get expected headers: %s\n' % str(request.headers)) request.send_response(400) return if request.headers['x-amz-copy-source'] != '/test/source_dir/test.txt': sys.stderr.write('Did not get expected headers: %s\n' % str(request.headers)) request.send_response(400) return request.send_response(200) request.send_header('Content-Length', 0) request.end_headers() handler.add('PUT', '/test/target_dir/test.txt', custom_method=method) handler.add('DELETE', '/test/source_dir/test.txt', 204) handler.add('GET', '/test/source_dir/', 404) handler.add('GET', '/test/?delimiter=%2F&max-keys=100&prefix=source_dir%2F', 404) with webserver.install_http_handler(handler): assert gdal.Rename( '/vsis3/test/source_dir', '/vsis3/test/target_dir') == 0 ############################################################################### # Test rename onto existing dir is not allowed def test_vsis3_fake_rename_on_existing_dir(): if gdaltest.webserver_port == 0: pytest.skip() gdal.VSICurlClearCache() handler = webserver.SequentialHandler() handler.add('GET', '/test/source.txt', 206, { 'Content-Length' : '3', 'Content-Range': 'bytes 0-2/3' }, "foo") handler.add('GET', '/test_target_dir/', 200) with webserver.install_http_handler(handler): assert gdal.Rename( '/vsis3/test/source.txt', '/vsis3/test_target_dir') == -1 ############################################################################### # Test Sync() and multithreaded download and CHUNK_SIZE def test_vsis3_fake_sync_multithreaded_upload_chunk_size(): if gdaltest.webserver_port == 0: pytest.skip() gdal.VSICurlClearCache() def cbk(pct, _, tab): assert pct >= tab[0] tab[0] = pct return True gdal.Mkdir('/vsimem/test', 0) gdal.FileFromMemBuffer('/vsimem/test/foo', 'foo\n') tab = [ -1 ] handler = webserver.SequentialHandler() handler.add('GET', '/test_bucket/?prefix=test%2F', 200) handler.add('GET', '/test_bucket/test', 404) handler.add('GET', '/test_bucket/?delimiter=%2F&max-keys=100&prefix=test%2F', 200) handler.add('GET', '/test_bucket/', 200) handler.add('GET', '/test_bucket/test/', 404) handler.add('PUT', '/test_bucket/test/', 200) def method(request): request.protocol_version = 'HTTP/1.1' response = '<?xml version="1.0" encoding="UTF-8"?><InitiateMultipartUploadResult><UploadId>my_id</UploadId></InitiateMultipartUploadResult>' request.send_response(200) request.send_header('Content-type', 'application/xml') request.send_header('Content-Length', len(response)) request.end_headers() request.wfile.write(response.encode('ascii')) handler.add('POST', '/test_bucket/test/foo?uploads', custom_method=method) def method(request): if request.headers['Content-Length'] != '3': sys.stderr.write('Did not get expected headers: %s\n' % str(request.headers)) request.send_response(400) request.send_header('Content-Length', 0) request.end_headers() return request.send_response(200) request.send_header('ETag', '"first_etag"') request.send_header('Content-Length', 0) request.end_headers() handler.add('PUT', '/test_bucket/test/foo?partNumber=1&uploadId=my_id', custom_method=method) def method(request): if request.headers['Content-Length'] != '1': sys.stderr.write('Did not get expected headers: %s\n' % str(request.headers)) request.send_response(400) request.send_header('Content-Length', 0) request.end_headers() return request.send_response(200) request.send_header('ETag', '"second_etag"') request.send_header('Content-Length', 0) request.end_headers() handler.add('PUT', '/test_bucket/test/foo?partNumber=2&uploadId=my_id', custom_method=method) def method(request): if request.headers['Content-Length'] != '186': sys.stderr.write('Did not get expected headers: %s\n' % str(request.headers)) request.send_response(400) request.send_header('Content-Length', 0) request.end_headers() return content = request.rfile.read(186).decode('ascii') if content != """<CompleteMultipartUpload> <Part> <PartNumber>1</PartNumber><ETag>"first_etag"</ETag></Part> <Part> <PartNumber>2</PartNumber><ETag>"second_etag"</ETag></Part> </CompleteMultipartUpload> """: sys.stderr.write('Did not get expected content: %s\n' % content) request.send_response(400) request.send_header('Content-Length', 0) request.end_headers() return request.send_response(200) request.send_header('Content-Length', 0) request.end_headers() handler.add('POST', '/test_bucket/test/foo?uploadId=my_id', custom_method=method) with gdaltest.config_option('VSIS3_SIMULATE_THREADING', 'YES'): with webserver.install_http_handler(handler): assert gdal.Sync('/vsimem/test', '/vsis3/test_bucket', options=['NUM_THREADS=1', 'CHUNK_SIZE=3'], callback=cbk, callback_data=tab) assert tab[0] == 1.0 gdal.RmdirRecursive('/vsimem/test') def test_vsis3_fake_sync_multithreaded_upload_chunk_size_failure(): if gdaltest.webserver_port == 0: pytest.skip() gdal.VSICurlClearCache() gdal.Mkdir('/vsimem/test', 0) gdal.FileFromMemBuffer('/vsimem/test/foo', 'foo\n') handler = webserver.SequentialHandler() handler.add('GET', '/test_bucket/?prefix=test%2F', 200) handler.add('GET', '/test_bucket/test', 404) handler.add('GET', '/test_bucket/?delimiter=%2F&max-keys=100&prefix=test%2F', 200) handler.add('GET', '/test_bucket/', 200) handler.add('GET', '/test_bucket/test/', 404) handler.add('PUT', '/test_bucket/test/', 200) def method(request): request.protocol_version = 'HTTP/1.1' response = '<?xml version="1.0" encoding="UTF-8"?><InitiateMultipartUploadResult><UploadId>my_id</UploadId></InitiateMultipartUploadResult>' request.send_response(200) request.send_header('Content-type', 'application/xml') request.send_header('Content-Length', len(response)) request.end_headers() request.wfile.write(response.encode('ascii')) handler.add('POST', '/test_bucket/test/foo?uploads', custom_method=method) def method(request): if request.headers['Content-Length'] != '3': sys.stderr.write('Did not get expected headers: %s\n' % str(request.headers)) request.send_response(400) request.send_header('Content-Length', 0) request.end_headers() return request.send_response(200) request.send_header('ETag', '"first_etag"') request.send_header('Content-Length', 0) request.end_headers() handler.add('PUT', '/test_bucket/test/foo?partNumber=1&uploadId=my_id', 400) handler.add('DELETE', '/test_bucket/test/foo?uploadId=my_id', 204) with gdaltest.config_options({'VSIS3_SIMULATE_THREADING': 'YES', 'VSIS3_SYNC_MULTITHREADING': 'NO'}): with webserver.install_http_handler(handler): with gdaltest.error_handler(): assert not gdal.Sync('/vsimem/test', '/vsis3/test_bucket', options=['NUM_THREADS=1', 'CHUNK_SIZE=3']) gdal.RmdirRecursive('/vsimem/test') ############################################################################### # Test reading/writing metadata def test_vsis3_metadata(): if gdaltest.webserver_port == 0: pytest.skip() gdal.VSICurlClearCache() # Read HEADERS domain handler = webserver.SequentialHandler() handler.add('GET', '/test_metadata/foo.txt', 200, {'foo': 'bar'}) with webserver.install_http_handler(handler): md = gdal.GetFileMetadata('/vsis3/test_metadata/foo.txt', 'HEADERS') assert 'foo' in md and md['foo'] == 'bar' # Read TAGS domain handler = webserver.SequentialHandler() handler.add('GET', '/test_metadata/foo.txt?tagging', 200, {}, """<Tagging><TagSet><Tag><Key>foo</Key><Value>bar</Value></Tag></TagSet></Tagging>""") with webserver.install_http_handler(handler): md = gdal.GetFileMetadata('/vsis3/test_metadata/foo.txt', 'TAGS') assert 'foo' in md and md['foo'] == 'bar' # Write HEADERS domain handler = webserver.SequentialHandler() def method(request): if request.headers['foo'] != 'bar': sys.stderr.write('Did not get expected headers: %s\n' % str(request.headers)) request.send_response(400) request.send_header('Content-Length', 0) request.end_headers() return request.send_response(200) request.end_headers() handler.add('PUT', '/test_metadata/foo.txt', custom_method=method) with webserver.install_http_handler(handler): assert gdal.SetFileMetadata('/vsis3/test_metadata/foo.txt', {'foo': 'bar'}, 'HEADERS') # Write TAGS domain handler = webserver.SequentialHandler() def method(request): request.wfile.write('HTTP/1.1 100 Continue\r\n\r\n'.encode('ascii')) content = request.rfile.read(int(request.headers['Content-Length'])).decode('ascii') if content != """<?xml version="1.0" encoding="UTF-8"?> <Tagging xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <TagSet> <Tag> <Key>foo</Key> <Value>bar</Value> </Tag> </TagSet> </Tagging> """: sys.stderr.write('Did not get expected content: %s\n' % content) request.send_response(400) request.send_header('Content-Length', 0) request.end_headers() return request.send_response(200) request.send_header('Content-Length', 0) request.end_headers() handler.add('PUT', '/test_metadata/foo.txt?tagging', custom_method=method) with webserver.install_http_handler(handler): assert gdal.SetFileMetadata('/vsis3/test_metadata/foo.txt', {'foo': 'bar'}, 'TAGS') # Write TAGS domain (wiping tags) handler = webserver.SequentialHandler() handler.add('DELETE', '/test_metadata/foo.txt?tagging', 204) with webserver.install_http_handler(handler): assert gdal.SetFileMetadata('/vsis3/test_metadata/foo.txt', {}, 'TAGS') # Error case with gdaltest.error_handler(): assert gdal.GetFileMetadata('/vsis3/test_metadata/foo.txt', 'UNSUPPORTED') == {} # Error case with gdaltest.error_handler(): assert not gdal.SetFileMetadata('/vsis3/test_metadata/foo.txt', {}, 'UNSUPPORTED') ############################################################################### # Test that we take into account directory listing to avoid useless # requests def test_vsis3_no_useless_requests(): if gdaltest.webserver_port == 0: pytest.skip() gdal.VSICurlClearCache() handler = webserver.SequentialHandler() handler.add('GET', '/no_useless_requests/?delimiter=%2F', 200, {'Content-type': 'application/xml'}, """<?xml version="1.0" encoding="UTF-8"?> <ListBucketResult> <Prefix></Prefix> <Contents> </Contents> </ListBucketResult> """) with webserver.install_http_handler(handler): assert gdal.VSIFOpenL('/vsis3/no_useless_requests/foo.txt', 'rb') is None assert gdal.VSIFOpenL('/vsis3/no_useless_requests/bar.txt', 'rb') is None assert gdal.VSIStatL('/vsis3/no_useless_requests/baz.txt') is None ############################################################################### # Test w+ access def test_vsis3_random_write(): if gdaltest.webserver_port == 0: pytest.skip() gdal.VSICurlClearCache() with gdaltest.error_handler(): assert gdal.VSIFOpenL('/vsis3/random_write/test.bin', 'w+b') is None with gdaltest.config_option('CPL_VSIL_USE_TEMP_FILE_FOR_RANDOM_WRITE', 'YES'): f = gdal.VSIFOpenL('/vsis3/random_write/test.bin', 'w+b') assert f assert gdal.VSIFWriteL('foo', 3, 1, f) == 1 assert gdal.VSIFSeekL(f, 0, 0) == 0 assert gdal.VSIFReadL(3, 1, f).decode('ascii') == 'foo' assert gdal.VSIFEofL(f) == 0 assert gdal.VSIFTellL(f) == 3 handler = webserver.SequentialHandler() handler.add('PUT', '/random_write/test.bin', 200, {}, expected_body=b'foo') with webserver.install_http_handler(handler): assert gdal.VSIFCloseL(f) == 0 ############################################################################### # Test w+ access def test_vsis3_random_write_failure_1(): if gdaltest.webserver_port == 0: pytest.skip() gdal.VSICurlClearCache() with gdaltest.config_option('CPL_VSIL_USE_TEMP_FILE_FOR_RANDOM_WRITE', 'YES'): f = gdal.VSIFOpenL('/vsis3/random_write/test.bin', 'w+b') assert f handler = webserver.SequentialHandler() handler.add('PUT', '/random_write/test.bin', 400, {}) with webserver.install_http_handler(handler): with gdaltest.error_handler(): assert gdal.VSIFCloseL(f) != 0 ############################################################################### # Test w+ access def test_vsis3_random_write_failure_2(): if gdaltest.webserver_port == 0: pytest.skip() gdal.VSICurlClearCache() with gdaltest.config_option('CPL_VSIL_USE_TEMP_FILE_FOR_RANDOM_WRITE', 'YES'): with gdaltest.config_option('VSIS3_CHUNK_SIZE_BYTES', '1'): f = gdal.VSIFOpenL('/vsis3/random_write/test.bin', 'w+b') assert f assert gdal.VSIFWriteL('foo', 3, 1, f) == 1 handler = webserver.SequentialHandler() handler.add('POST', '/random_write/test.bin?uploads', 400, {}) with webserver.install_http_handler(handler): with gdaltest.error_handler(): assert gdal.VSIFCloseL(f) != 0 ############################################################################### # Test w+ access def test_vsis3_random_write_gtiff_create_copy(): if gdaltest.webserver_port == 0: pytest.skip() gdal.VSICurlClearCache() handler = webserver.SequentialHandler() handler.add('GET', '/random_write/test.tif', 404, {}) handler.add('GET', '/random_write/?delimiter=%2F&max-keys=100&prefix=test.tif%2F', 404, {}) handler.add('GET', '/random_write/?delimiter=%2F', 404, {}) src_ds = gdal.Open('data/byte.tif') with gdaltest.config_option('CPL_VSIL_USE_TEMP_FILE_FOR_RANDOM_WRITE', 'YES'): with webserver.install_http_handler(handler): ds = gdal.GetDriverByName('GTiff').CreateCopy('/vsis3/random_write/test.tif', src_ds) assert ds is not None handler = webserver.SequentialHandler() handler.add('PUT', '/random_write/test.tif', 200, {}) with webserver.install_http_handler(handler): ds = None ############################################################################### # Read credentials from simulated ~/.aws/credentials def test_vsis3_read_credentials_file(): if gdaltest.webserver_port == 0: pytest.skip() gdal.SetConfigOption('AWS_SECRET_ACCESS_KEY', '') gdal.SetConfigOption('AWS_ACCESS_KEY_ID', '') gdal.SetConfigOption('CPL_AWS_CREDENTIALS_FILE', '/vsimem/aws_credentials') gdal.VSICurlClearCache() gdal.FileFromMemBuffer('/vsimem/aws_credentials', """ [unrelated] aws_access_key_id = foo aws_secret_access_key = bar [default] aws_access_key_id = AWS_ACCESS_KEY_ID aws_secret_access_key = AWS_SECRET_ACCESS_KEY [unrelated] aws_access_key_id = foo aws_secret_access_key = bar """) handler = webserver.SequentialHandler() handler.add('GET', '/s3_fake_bucket/resource', custom_method=get_s3_fake_bucket_resource_method) with webserver.install_http_handler(handler): f = open_for_read('/vsis3/s3_fake_bucket/resource') assert f is not None data = gdal.VSIFReadL(1, 4, f).decode('ascii') gdal.VSIFCloseL(f) assert data == 'foo' gdal.SetConfigOption('CPL_AWS_CREDENTIALS_FILE', '') gdal.Unlink('/vsimem/aws_credentials') ############################################################################### # Read credentials from simulated ~/.aws/config def test_vsis3_read_config_file(): if gdaltest.webserver_port == 0: pytest.skip() gdal.SetConfigOption('AWS_SECRET_ACCESS_KEY', '') gdal.SetConfigOption('AWS_ACCESS_KEY_ID', '') gdal.SetConfigOption('AWS_CONFIG_FILE', '/vsimem/aws_config') gdal.VSICurlClearCache() gdal.FileFromMemBuffer('/vsimem/aws_config', """ [unrelated] aws_access_key_id = foo aws_secret_access_key = bar [default] aws_access_key_id = AWS_ACCESS_KEY_ID aws_secret_access_key = AWS_SECRET_ACCESS_KEY region = us-east-1 [unrelated] aws_access_key_id = foo aws_secret_access_key = bar """) handler = webserver.SequentialHandler() handler.add('GET', '/s3_fake_bucket/resource', custom_method=get_s3_fake_bucket_resource_method) with webserver.install_http_handler(handler): f = open_for_read('/vsis3/s3_fake_bucket/resource') assert f is not None data = gdal.VSIFReadL(1, 4, f).decode('ascii') gdal.VSIFCloseL(f) assert data == 'foo' gdal.SetConfigOption('AWS_CONFIG_FILE', '') gdal.Unlink('/vsimem/aws_config') ############################################################################### # Read credentials from simulated ~/.aws/credentials and ~/.aws/config def test_vsis3_read_credentials_config_file(): if gdaltest.webserver_port == 0: pytest.skip() gdal.SetConfigOption('AWS_SECRET_ACCESS_KEY', '') gdal.SetConfigOption('AWS_ACCESS_KEY_ID', '') gdal.SetConfigOption('CPL_AWS_CREDENTIALS_FILE', '/vsimem/aws_credentials') gdal.SetConfigOption('AWS_CONFIG_FILE', '/vsimem/aws_config') gdal.VSICurlClearCache() gdal.FileFromMemBuffer('/vsimem/aws_credentials', """ [unrelated] aws_access_key_id = foo aws_secret_access_key = bar [default] aws_access_key_id = AWS_ACCESS_KEY_ID aws_secret_access_key = AWS_SECRET_ACCESS_KEY [unrelated] aws_access_key_id = foo aws_secret_access_key = bar """) gdal.FileFromMemBuffer('/vsimem/aws_config', """ [unrelated] aws_access_key_id = foo aws_secret_access_key = bar [default] aws_access_key_id = AWS_ACCESS_KEY_ID aws_secret_access_key = AWS_SECRET_ACCESS_KEY region = us-east-1 [unrelated] aws_access_key_id = foo aws_secret_access_key = bar """) handler = webserver.SequentialHandler() handler.add('GET', '/s3_fake_bucket/resource', custom_method=get_s3_fake_bucket_resource_method) with webserver.install_http_handler(handler): f = open_for_read('/vsis3/s3_fake_bucket/resource') assert f is not None data = gdal.VSIFReadL(1, 4, f).decode('ascii') gdal.VSIFCloseL(f) assert data == 'foo' gdal.SetConfigOption('CPL_AWS_CREDENTIALS_FILE', '') gdal.Unlink('/vsimem/aws_credentials') gdal.SetConfigOption('AWS_CONFIG_FILE', '') gdal.Unlink('/vsimem/aws_config') ############################################################################### # Read credentials from simulated ~/.aws/credentials and ~/.aws/config with # a non default profile def test_vsis3_read_credentials_config_file_non_default_profile(tmpdir): if gdaltest.webserver_port == 0: pytest.skip() gdal.SetConfigOption('AWS_SECRET_ACCESS_KEY', '') gdal.SetConfigOption('AWS_ACCESS_KEY_ID', '') gdal.SetConfigOption('CPL_AWS_CREDENTIALS_FILE', None) gdal.SetConfigOption('AWS_CONFIG_FILE', None) gdal.SetConfigOption('AWS_PROFILE', 'myprofile') os_aws = tmpdir.mkdir(".aws") gdal.VSICurlClearCache() os_aws.join('credentials').write(""" [unrelated] aws_access_key_id = foo aws_secret_access_key = bar [myprofile] aws_access_key_id = AWS_ACCESS_KEY_ID aws_secret_access_key = AWS_SECRET_ACCESS_KEY [default] aws_access_key_id = foo aws_secret_access_key = bar """) os_aws.join('config').write(""" [unrelated] aws_access_key_id = foo aws_secret_access_key = bar [profile myprofile] region = us-east-1 [default] aws_access_key_id = foo aws_secret_access_key = bar """) handler = webserver.SequentialHandler() handler.add('GET', '/s3_fake_bucket/resource', custom_method=get_s3_fake_bucket_resource_method) with webserver.install_http_handler(handler): with gdaltest.config_option( 'USERPROFILE' if sys.platform == 'win32' else 'HOME', str(tmpdir) ): f = open_for_read('/vsis3/s3_fake_bucket/resource') assert f is not None data = gdal.VSIFReadL(1, 4, f).decode('ascii') gdal.VSIFCloseL(f) assert data == 'foo' gdal.SetConfigOption('AWS_PROFILE', '') ############################################################################### # Read credentials from simulated ~/.aws/credentials and ~/.aws/config def test_vsis3_read_credentials_config_file_inconsistent(): if gdaltest.webserver_port == 0: pytest.skip() gdal.SetConfigOption('AWS_SECRET_ACCESS_KEY', '') gdal.SetConfigOption('AWS_ACCESS_KEY_ID', '') gdal.SetConfigOption('CPL_AWS_CREDENTIALS_FILE', '/vsimem/aws_credentials') gdal.SetConfigOption('AWS_CONFIG_FILE', '/vsimem/aws_config') gdal.VSICurlClearCache() gdal.FileFromMemBuffer('/vsimem/aws_credentials', """ [unrelated] aws_access_key_id = foo aws_secret_access_key = bar [default] aws_access_key_id = AWS_ACCESS_KEY_ID aws_secret_access_key = AWS_SECRET_ACCESS_KEY [unrelated] aws_access_key_id = foo aws_secret_access_key = bar """) gdal.FileFromMemBuffer('/vsimem/aws_config', """ [unrelated] aws_access_key_id = foo aws_secret_access_key = bar [default] aws_access_key_id = AWS_ACCESS_KEY_ID_inconsistent aws_secret_access_key = AWS_SECRET_ACCESS_KEY_inconsistent region = us-east-1 [unrelated] aws_access_key_id = foo aws_secret_access_key = bar """) gdal.ErrorReset() handler = webserver.SequentialHandler() handler.add('GET', '/s3_fake_bucket/resource', custom_method=get_s3_fake_bucket_resource_method) with webserver.install_http_handler(handler): with gdaltest.error_handler(): f = open_for_read('/vsis3/s3_fake_bucket/resource') assert f is not None assert gdal.GetLastErrorMsg() != '' data = gdal.VSIFReadL(1, 4, f).decode('ascii') gdal.VSIFCloseL(f) assert data == 'foo' gdal.SetConfigOption('CPL_AWS_CREDENTIALS_FILE', '') gdal.Unlink('/vsimem/aws_credentials') gdal.SetConfigOption('AWS_CONFIG_FILE', '') gdal.Unlink('/vsimem/aws_config') ############################################################################### # Read credentials from simulated EC2 instance def test_vsis3_read_credentials_ec2_imdsv2(): if gdaltest.webserver_port == 0: pytest.skip() if sys.platform not in ('linux', 'linux2', 'win32'): pytest.skip() gdal.SetConfigOption('CPL_AWS_CREDENTIALS_FILE', '') gdal.SetConfigOption('AWS_CONFIG_FILE', '') gdal.SetConfigOption('AWS_SECRET_ACCESS_KEY', '') gdal.SetConfigOption('AWS_ACCESS_KEY_ID', '') gdal.SetConfigOption('CPL_AWS_EC2_API_ROOT_URL', 'http://localhost:%d' % gdaltest.webserver_port) # Disable hypervisor related check to test if we are really on EC2 gdal.SetConfigOption('CPL_AWS_AUTODETECT_EC2', 'NO') gdal.VSICurlClearCache() handler = webserver.SequentialHandler() handler.add('PUT', '/latest/api/token', 200, {}, 'mytoken', expected_headers={'X-aws-ec2-metadata-token-ttl-seconds': '10'}) handler.add('GET', '/latest/meta-data/iam/security-credentials/', 200, {}, 'myprofile', expected_headers={'X-aws-ec2-metadata-token': 'mytoken'}) handler.add('GET', '/latest/meta-data/iam/security-credentials/myprofile', 200, {}, """{ "AccessKeyId": "AWS_ACCESS_KEY_ID", "SecretAccessKey": "AWS_SECRET_ACCESS_KEY", "Expiration": "3000-01-01T00:00:00Z" }""", expected_headers={'X-aws-ec2-metadata-token': 'mytoken'}) handler.add('GET', '/s3_fake_bucket/resource', custom_method=get_s3_fake_bucket_resource_method) with webserver.install_http_handler(handler): f = open_for_read('/vsis3/s3_fake_bucket/resource') assert f is not None data = gdal.VSIFReadL(1, 4, f).decode('ascii') gdal.VSIFCloseL(f) assert data == 'foo' # Set a fake URL to check that credentials re-use works gdal.SetConfigOption('CPL_AWS_EC2_API_ROOT_URL', '') handler = webserver.SequentialHandler() handler.add('GET', '/s3_fake_bucket/bar', 200, {}, 'bar') with webserver.install_http_handler(handler): f = open_for_read('/vsis3/s3_fake_bucket/bar') assert f is not None data = gdal.VSIFReadL(1, 4, f).decode('ascii') gdal.VSIFCloseL(f) assert data == 'bar' gdal.SetConfigOption('CPL_AWS_EC2_API_ROOT_URL', '') gdal.SetConfigOption('CPL_AWS_AUTODETECT_EC2', None) ############################################################################### # Read credentials from simulated EC2 instance that only supports IMDSv1 def test_vsis3_read_credentials_ec2_imdsv1(): if gdaltest.webserver_port == 0: pytest.skip() if sys.platform not in ('linux', 'linux2', 'win32'): pytest.skip() gdal.SetConfigOption('CPL_AWS_CREDENTIALS_FILE', '') gdal.SetConfigOption('AWS_CONFIG_FILE', '') gdal.SetConfigOption('AWS_SECRET_ACCESS_KEY', '') gdal.SetConfigOption('AWS_ACCESS_KEY_ID', '') gdal.SetConfigOption('CPL_AWS_EC2_API_ROOT_URL', 'http://localhost:%d' % gdaltest.webserver_port) # Disable hypervisor related check to test if we are really on EC2 gdal.SetConfigOption('CPL_AWS_AUTODETECT_EC2', 'NO') gdal.VSICurlClearCache() handler = webserver.SequentialHandler() handler.add('PUT', '/latest/api/token', 403, {}, expected_headers={'X-aws-ec2-metadata-token-ttl-seconds': '10'}) handler.add('GET', '/latest/meta-data/iam/security-credentials/', 200, {}, 'myprofile', unexpected_headers=['X-aws-ec2-metadata-token']) handler.add('GET', '/latest/meta-data/iam/security-credentials/myprofile', 200, {}, """{ "AccessKeyId": "AWS_ACCESS_KEY_ID", "SecretAccessKey": "AWS_SECRET_ACCESS_KEY", "Expiration": "3000-01-01T00:00:00Z" }""", unexpected_headers=['X-aws-ec2-metadata-token']) handler.add('GET', '/s3_fake_bucket/resource', custom_method=get_s3_fake_bucket_resource_method) with webserver.install_http_handler(handler): f = open_for_read('/vsis3/s3_fake_bucket/resource') assert f is not None data = gdal.VSIFReadL(1, 4, f).decode('ascii') gdal.VSIFCloseL(f) assert data == 'foo' gdal.SetConfigOption('CPL_AWS_EC2_API_ROOT_URL', '') gdal.SetConfigOption('CPL_AWS_AUTODETECT_EC2', None) ############################################################################### # Read credentials from simulated EC2 instance with expiration of the # cached credentials def test_vsis3_read_credentials_ec2_expiration(): if gdaltest.webserver_port == 0: pytest.skip() if sys.platform not in ('linux', 'linux2', 'win32'): pytest.skip() gdal.SetConfigOption('CPL_AWS_CREDENTIALS_FILE', '') gdal.SetConfigOption('AWS_CONFIG_FILE', '') gdal.SetConfigOption('AWS_SECRET_ACCESS_KEY', '') gdal.SetConfigOption('AWS_ACCESS_KEY_ID', '') gdal.SetConfigOption('CPL_AWS_EC2_API_ROOT_URL', 'http://localhost:%d' % gdaltest.webserver_port) # Disable hypervisor related check to test if we are really on EC2 gdal.SetConfigOption('CPL_AWS_AUTODETECT_EC2', 'NO') gdal.VSICurlClearCache() handler = webserver.SequentialHandler() handler.add('PUT', '/latest/api/token', 200, {}, 'mytoken', expected_headers={'X-aws-ec2-metadata-token-ttl-seconds': '10'}) handler.add('GET', '/latest/meta-data/iam/security-credentials/', 200, {}, 'myprofile', expected_headers={'X-aws-ec2-metadata-token': '<PASSWORD>'}) handler.add('GET', '/latest/meta-data/iam/security-credentials/myprofile', 200, {}, """{ "AccessKeyId": "AWS_ACCESS_KEY_ID", "SecretAccessKey": "AWS_SECRET_ACCESS_KEY", "Expiration": "1970-01-01T00:00:00Z" }""", expected_headers={'X-aws-ec2-metadata-token': '<PASSWORD>'}) handler.add('PUT', '/latest/api/token', 200, {}, '<PASSWORD>', expected_headers={'X-aws-ec2-metadata-token-ttl-seconds': '10'}) handler.add('GET', '/latest/meta-data/iam/security-credentials/myprofile', 200, {}, """{ "AccessKeyId": "AWS_ACCESS_KEY_ID", "SecretAccessKey": "AWS_SECRET_ACCESS_KEY", "Expiration": "1970-01-01T00:00:00Z" }""", expected_headers={'X-aws-ec2-metadata-token': '<PASSWORD>'}) handler.add('GET', '/s3_fake_bucket/resource', custom_method=get_s3_fake_bucket_resource_method) with webserver.install_http_handler(handler): f = open_for_read('/vsis3/s3_fake_bucket/resource') assert f is not None data = gdal.VSIFReadL(1, 4, f).decode('ascii') gdal.VSIFCloseL(f) assert data == 'foo' # Set a fake URL to demonstrate we try to re-fetch credentials gdal.SetConfigOption('CPL_AWS_EC2_API_ROOT_URL', 'http://localhost:%d/invalid' % gdaltest.webserver_port) handler = webserver.SequentialHandler() handler.add('PUT', '/invalid/latest/api/token', 404) handler.add('GET', '/invalid/latest/meta-data/iam/security-credentials/myprofile', 404) with webserver.install_http_handler(handler): with gdaltest.error_handler(): f = open_for_read('/vsis3/s3_fake_bucket/bar') assert f is None gdal.SetConfigOption('CPL_AWS_EC2_API_ROOT_URL', '') gdal.SetConfigOption('CPL_AWS_AUTODETECT_EC2', None) ############################################################################### def test_vsis3_stop_webserver(): if gdaltest.webserver_port == 0: pytest.skip() # Clearcache needed to close all connections, since the Python server # can only handle one connection at a time gdal.VSICurlClearCache() webserver.server_stop(gdaltest.webserver_process, gdaltest.webserver_port) ############################################################################### # Nominal cases (require valid credentials) def test_vsis3_extra_1(): if not gdaltest.built_against_curl(): pytest.skip() credentials_filename = gdal.GetConfigOption('HOME', gdal.GetConfigOption('USERPROFILE', '')) + '/.aws/credentials' # Either a bucket name or bucket/filename s3_resource = gdal.GetConfigOption('S3_RESOURCE') if not os.path.exists(credentials_filename): if gdal.GetConfigOption('AWS_SECRET_ACCESS_KEY') is None: pytest.skip('Missing AWS_SECRET_ACCESS_KEY') elif gdal.GetConfigOption('AWS_ACCESS_KEY_ID') is None: pytest.skip('Missing AWS_ACCESS_KEY_ID') if s3_resource is None: pytest.skip('Missing S3_RESOURCE') if '/' not in s3_resource: path = '/vsis3/' + s3_resource statres = gdal.VSIStatL(path) assert statres is not None and stat.S_ISDIR(statres.mode), \ ('%s is not a valid bucket' % path) readdir = gdal.ReadDir(path) assert readdir is not None, 'ReadDir() should not return empty list' for filename in readdir: if filename != '.': subpath = path + '/' + filename assert gdal.VSIStatL(subpath) is not None, \ ('Stat(%s) should not return an error' % subpath) unique_id = 'vsis3_test' subpath = path + '/' + unique_id ret = gdal.Mkdir(subpath, 0) assert ret >= 0, ('Mkdir(%s) should not return an error' % subpath) readdir = gdal.ReadDir(path) assert unique_id in readdir, \ ('ReadDir(%s) should contain %s' % (path, unique_id)) ret = gdal.Mkdir(subpath, 0) assert ret != 0, ('Mkdir(%s) repeated should return an error' % subpath) ret = gdal.Rmdir(subpath) assert ret >= 0, ('Rmdir(%s) should not return an error' % subpath) readdir = gdal.ReadDir(path) assert unique_id not in readdir, \ ('ReadDir(%s) should not contain %s' % (path, unique_id)) ret = gdal.Rmdir(subpath) assert ret != 0, ('Rmdir(%s) repeated should return an error' % subpath) ret = gdal.Mkdir(subpath, 0) assert ret >= 0, ('Mkdir(%s) should not return an error' % subpath) f = gdal.VSIFOpenL(subpath + '/test.txt', 'wb') assert f is not None gdal.VSIFWriteL('hello', 1, 5, f) gdal.VSIFCloseL(f) ret = gdal.Rmdir(subpath) assert ret != 0, \ ('Rmdir(%s) on non empty directory should return an error' % subpath) f = gdal.VSIFOpenL(subpath + '/test.txt', 'rb') assert f is not None data = gdal.VSIFReadL(1, 5, f).decode('utf-8') assert data == 'hello' gdal.VSIFCloseL(f) assert gdal.Rename(subpath + '/test.txt', subpath + '/test2.txt') == 0 f = gdal.VSIFOpenL(subpath + '/test2.txt', 'rb') assert f is not None data = gdal.VSIFReadL(1, 5, f).decode('utf-8') assert data == 'hello' gdal.VSIFCloseL(f) ret = gdal.Unlink(subpath + '/test2.txt') assert ret >= 0, \ ('Unlink(%s) should not return an error' % (subpath + '/test2.txt')) ret = gdal.Rmdir(subpath) assert ret >= 0, ('Rmdir(%s) should not return an error' % subpath) return f = open_for_read('/vsis3/' + s3_resource) assert f is not None, ('cannot open %s' % ('/vsis3/' + s3_resource)) ret = gdal.VSIFReadL(1, 1, f) gdal.VSIFCloseL(f) assert len(ret) == 1 # Same with /vsis3_streaming/ f = open_for_read('/vsis3_streaming/' + s3_resource) assert f is not None ret = gdal.VSIFReadL(1, 1, f) gdal.VSIFCloseL(f) assert len(ret) == 1 if False: # pylint: disable=using-constant-test # we actually try to read at read() time and bSetError = false # Invalid bucket : "The specified bucket does not exist" gdal.ErrorReset() f = open_for_read('/vsis3/not_existing_bucket/foo') with gdaltest.error_handler(): gdal.VSIFReadL(1, 1, f) gdal.VSIFCloseL(f) assert gdal.VSIGetLastErrorMsg() != '' # Invalid resource gdal.ErrorReset() f = open_for_read('/vsis3_streaming/' + gdal.GetConfigOption('S3_RESOURCE') + '/invalid_resource.baz') assert f is None, gdal.VSIGetLastErrorMsg() # Test GetSignedURL() signed_url = gdal.GetSignedURL('/vsis3/' + s3_resource) f = open_for_read('/vsicurl_streaming/' + signed_url) assert f is not None ret = gdal.VSIFReadL(1, 1, f) gdal.VSIFCloseL(f) assert len(ret) == 1 ############################################################################### def test_vsis3_cleanup(): for var in gdaltest.aws_vars: gdal.SetConfigOption(var, gdaltest.aws_vars[var]) gdal.SetConfigOption('CPL_AWS_CREDENTIALS_FILE', None) gdal.SetConfigOption('AWS_CONFIG_FILE', None) gdal.SetConfigOption('CPL_AWS_EC2_API_ROOT_URL', None)
python
Sanjeev Saxena, who has been named in the cash-for-votes scam that rocked Parliament in July 2008, was arrested by the Crime Branch of the Delhi Police on Sunday. “He was arrested in Delhi in the afternoon under the Prevention of Corruption Act. He will be produced in court on Monday,” a senior police officer said. The case pertains to the display of large amounts of cash in the Lok Sabha by some Members of Parliament during the debate on a vote of confidence sought by Prime Minister Manmohan Singh on July 22, 2008 after the Left parties withdrew support to his government over the India-U. S. nuclear deal. The Crime Branch registered a case under Section 12 of the Prevention of Corruption Act, based on the committee's report recommending a probe into the role of Sudheendra Kulkarni, political aide to the then Leader of the Opposition, L. K. Advani; Sohail Hindustani, a BJP Yuva Morcha activist; and Sanjeev Saxena, alleged to be an aide of the then Samajwadi Party general secretary Amar Singh. Wads of cash that were displayed were also handed over to the Crime Branch. The police obtained the original compact discs containing the “sting operation” carried out by a television news channel showing money changing hands for abstentions during the vote. The police received the Central Forensic Science Laboratory's report earlier this year, which said the contents of the discs had not been tampered with. The police questioned Hindustani, Saxena and Kulkarni on more than one occasion and examined the witnesses. Investigating the money trail, police carried out raids in Udaipur, Bhopal, Mysore, Lucknow, Gurgaon, Faridabad and other places.
english
print ("Enter a value" ) a = int (input()) print ("Enter b value" ) b = int (input()) print ("value of a is",a) print ("value of b is",b) print ("value of a+b value is", a+b) print ("value of a-b value is", a-b) print ("value of a*b value is", a*b) print ("value of a/b value is", a/b)
python
The consortium BlueCo which purchased Chelsea last year has reached an agreement to become shareholders of French club Racing Strasbourg, the Premier League club said on Thursday. The agreement will see BlueCo invest in Strasbourg’s first teams and academy while Marc Keller will remain the club’s president having been at the helm since 2012 when the club was at risk of being liquidated. Strasbourg have since moved up from the third tier to Ligue 1 where they have played for the last six seasons and also won the French League Cup in 2019. They finished 15th in Ligue 1 last season. “This is an important day for Racing (Club de Strasbourg). It’s something my shareholder friends and I have been thinking about for the past two years,” Keller said in a statement. “We’ve built a club that’s healthy at every level and well managed. Although there was no financial urgency, we were aware that we had reached the ceiling of our model. Details of the stake were not disclosed but The Guardian reported the consortium will have close to a 100% ownership having paid 75 million euros ($82. 13 million). Chelsea were taken over last year by an investment group led by Todd Boehly and Clearlake Capital after Roman Abramovich was forced to sell the Premier League club. “BlueCo plans to make an active contribution to the development of the model implemented by Marc Keller,” it said.
english
Sraboni Haralalka says: "In the competitive world of investment banking, what gives me an advantage is my background in humanities, experience in managing relationships, and knowledge of family office services. This unique blend helps me better understand the needs and challenges of promoters. I also recognise that behind every financial transaction lies a human story and am deeply aware that finance is not just about cold hard cash and profits but is intricately connected to people and each individual’s motivations." Taher Badshah says: "The beauty of our business is that every day is different and involves a lot of learning. Over the years, my role too, has transformed from research to portfolio management and further now to driving the business. This makes it exciting and challenging but also brings a different level of stress. The industry was always competitive, but the fast-changing configuration of markets and the regulatory landscape make it far more challenging." Infosys is seen reporting a 1.4% sequential rise in consolidated revenue in the September quarter to Rs 38,472.4 crore, according to the average of estimates given by nine brokerage firms. But on a year-on-year (YoY) basis, it is seen rising 5.3%. Amar Ambani attributes his interest in equity research to his late father's influence. He emphasizes the importance of analyzing business fundamentals and values, rather than being in love with finance itself. Ambani values the opportunity to manage a team and appreciates the leadership roles he has had in his career. In his current role at YES Securities, he is focused on building an institutional franchise and conducting comprehensive research. FPI purchases saw a sharp slowdown in the September quarter, as they net invested just Rs 21,900 crore or $2.6 billion in the secondary market, after pumping in Rs 1.02 lakh crore ($12 billion) in the preceding quarter, data by StockEdge showed. Foreign portfolio investors, which turned sellers in the domestic market early this month, remained so in the week gone by. So far in September, they have net sold Indian equities worth Rs 10,164 crore, according to NSDL data. In the cash market, FII sold shares to the tune of Rs 18,260 crore, so far this month. Understanding Tara's predicament, Maya replied, "Here's a trick. We can transform those calls and puts into debit spreads by selling some OTM options. This move turns the Straddle into an Iron Fly, just like we discussed in our last chat. But here's the catch – the potential profit is capped this way." “I always aspired to become a doctor. However, destiny had a different plan and I narrowly missed the Mumbai merit cut off,” says Dasgupta, who then found herself studying economics, maths and statistics, and pursuing Masters of Business Administration (MBA) at IIM Ahmedabad. Foreign institutional investors (FIIs) have spent nearly Rs 44,000 crore on Indian stocks since March, with more than a third of that amount used to purchase banks and other financial stocks, according to NSDL data. On the other hand, IT remained on the top of FII sell list in May but the selling intensity reduced to Rs 891 crore against Rs 4,908 crore in April. The Nifty IT index, however, gained 5.8% last month. While we select stocks based on our algorithms in a non-discretionary manner, we can divide the team using three major types of stocks. One kind is the opening stability kind of stock mostly in the largecap zone that are difficult to move but once they get going the momentum runs for a while. “I am a believer that loyalty does not give you the royalty. I may be loyal to the firm, but I have to do my hard work and contribute to the success of the responsibility we have,” says Bala, as he is fondly addressed, in a conversation with ETMarkets. Having started her journey researching on bond markets over 2 decades ago, Iyer went on to head the fixed income segment of India’s 5th largest asset management company, Kotak Mahindra AMC and served as the Chief Investment Officer for over a decade. “One can expect the cooling (AC manufacturers) stocks to remain in focus after the weather office forecasts heat waves as the hottest since February 1901 and summer has come earlier than usual,” he said. The total valuation of India’s stocks has dropped to $3.2 trillion, or 3.1% of the global share market capitalization. That proportion climbed to as high as 3.6% last year as the Asian nation overtook the UK to become the world’s fifth-largest equity market. "In money management, being independent is very important. Having an independent thought process is very important because most often we invest like a crowd or like a herd and herds in the long term do not make money. Retaining independence is important, independence comes from asking the right questions and this particular experience sometime in the year 2000 or 2001 was a very important starting point for me in the journey of asking the right questions about anything and everything." Keeping the inflation dynamics in mind, the central bank raised its projection on headline inflation based on the consumer price index for the current quarter and the next quarter by 10 basis points each to 6.6% and 5.9%, respectively. “Retail investors’ participation into these sectors (midcaps and smallcaps) have largely been aided through the IPOs which are back on track, as also with the basket-based portfolio opportunities that are provided by various platforms,” said Anand Varadarajan, director at Asit C. Mehta Financial Services. The BSE Sensex closed at 60,836.41, down 69.68 points or 0.11% from the previous close. The Nifty declined 0.17% or 30.15 points to end at 18,052.70 after losing more than 100 points at market opening. Both indices oscillated between gains and losses for most of the session with the Nifty briefly slipping below 18,000 in early trade.
english
EA Sports has recently released a new gameplay trailer for its highly anticipated UFC 5 game. The trailer features the voiceovers of lead producer Nate McDonald and UFC Hall of Famer Daniel Cormier, providing an in-depth overview of the game's gameplay and features. Check out the video below: This latest addition to the popular franchise is designed to capture the essence of MMA fighting, featuring realistic graphics, an authentic damage system, and improved gameplay mechanics. According to the game developers, EA Sports UFC 5 is powered by the Frostbite engine, known for its stunning visuals. It provides next-generation graphics upgrades for console gaming, including dynamic lighting, realistic character details, and detailed animations for hair and clothing, making the virtual octagon experience more immersive. However, the latest gameplay trailer of UFC 5 didn't quite meet the expectations of fight fans and gamers. Many of them turned to social media to express their dismay with what they perceived as underwhelming graphics and gameplay. Fans' reactions varied widely, painting a picture of their lukewarm reception to the trailer. One fan wrote: "Time to play ufc 2 for another 5 years" Another wrote: "That frostbite engine ain’t doing it’s job" Check out some more reactions below: "Hire THQ developers, its the only chance EA has to make a good game" "Can’t wait to try to grapple once, look like a wounded duck with cerebral palsy, and only stand and bang every single fight from then on." "Literally the same striking as UFC 4" "Bro I swear UFC 3 looked better than this" "N*ggas dropped UFC 4 remastered lmao" "Holy fu*k I can’t believe it’s the exact same animations as a game from 3 years ago. EA is the laziest company on earth 🤣" Is EA Sports UFC 5 on PS4? Since EA Sports announced UFC 5, the gaming community has been buzzing with speculation about whether the game will support cross-platform play. This new installment in the franchise has undergone significant changes, with the adoption of the Frostbite engine. This upgrade promises more responsive gameplay and an overall improved fighting experience, according to the game developers. However, UFC 5 will be exclusively available on the latest-generation consoles, specifically the PlayStation 5 and Xbox Series X|S. It's important to note that the game won't be accessible on the previous-generation PlayStation 4, and crossplay between PlayStation and Xbox won't be a feature of the game.
english
<gh_stars>0 {"monkberry.js":"sha256-o+KBJOVPEa19hq7OcoWTY6Pki4mKso3/Mv2j0xP5dUI=","monkberry.min.js":"sha256-7DROtiMRFdXCTUvBI4eb3KtZ0JMYL1L5jkZaHodItB8="}
json
Wizard of Oz: Magic Match is a free game for Android that belongs to the category Puzzle, and has been developed by Zynga. This game is available in English. What do you get when you mix Tetris, Jenga, and a dash of sorcery? 99 Bricks Wizard Academy.
english
import { Injectable } from "@angular/core"; import { HttpClient } from "@angular/common/http"; import { Observable } from "rxjs"; import { map } from 'rxjs/operators'; import { environment } from "../../environments/environment"; import { IMonth } from "./month.model"; @Injectable() export class DatesService { private apiAction: string = "dates"; constructor(private httpClient: HttpClient) { } getMonths(): Observable<IMonth[]> { return this.httpClient.get<IMonth[]>(environment.apiUrl + this.apiAction + "/months"); } }
typescript
Ireland and Scotland are engaged in a three-match One-Day International (ODI) series, as both sides prepare for the ICC World Cup 2015. These two teams played their first ODI at Dublin on Monday. Ireland cruised to a comfortable seven wicket victory over Scotland with 80 balls to spare. The Irish skipper, Kevin O’Brien, showed his class and composure and led his side from the front. Ireland had to chase down a modest total of 173 runs. Now, they gear up for the second ODI on Wednesday. The Irish side looks more balanced and settled compared to Scotland. The bowlers were right on the money from the beginning. They were troubling all the Scottish batsmen right through. Craig Young utilised the overhead conditions initially and ran through the top order. He picked up five wickets and he gave away only 46 runs in his allotted overs. He’s surely one of the players to watch out for in the next game. Andy McBrine, the young off spinner, was impressive as he too picked couple of wickets. The free live streaming of cricket matches is rapidly becoming a new rage in the online media and is catching up with lot of cricket fans. Catching the free live streaming of cricket matches on the internet, and watching this online is a safe bet if one is not near the television. This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful. Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings. If you disable this cookie, we will not be able to save your preferences. This means that every time you visit this website you will need to enable or disable cookies again.
english
<reponame>carceneaux-forks/alfred-workflows<filename>MediaManage/source/_licensed/rebulk/__init__.py #!/usr/bin/env python # -*- coding: utf-8 -*- """ Define simple search patterns in bulk to perform advanced matching on any string. """ # pylint:disable=import-self from .rebulk import Rebulk from .rules import Rule, CustomRule, AppendMatch, RemoveMatch, RenameMatch, AppendTags, RemoveTags from .processors import ConflictSolver, PrivateRemover, POST_PROCESS, PRE_PROCESS from .pattern import REGEX_ENABLED
python
<reponame>Fusion-Rom/android_external_chromium_org_third_party_WebKit /* * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. * Copyright (C) 2008, 2009, 2010, 2011 Google Inc. All rights reserved. * Copyright (C) 2011 <NAME>. * Copyright (C) 2011 Motorola Mobility. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "config.h" #include "core/editing/markup.h" #include "bindings/core/v8/ExceptionState.h" #include "core/CSSPropertyNames.h" #include "core/CSSValueKeywords.h" #include "core/HTMLNames.h" #include "core/css/CSSPrimitiveValue.h" #include "core/css/CSSValue.h" #include "core/css/StylePropertySet.h" #include "core/dom/CDATASection.h" #include "core/dom/ChildListMutationScope.h" #include "core/dom/Comment.h" #include "core/dom/ContextFeatures.h" #include "core/dom/DocumentFragment.h" #include "core/dom/ElementTraversal.h" #include "core/dom/ExceptionCode.h" #include "core/dom/NodeTraversal.h" #include "core/dom/Range.h" #include "core/editing/Editor.h" #include "core/editing/MarkupAccumulator.h" #include "core/editing/TextIterator.h" #include "core/editing/VisibleSelection.h" #include "core/editing/VisibleUnits.h" #include "core/editing/htmlediting.h" #include "core/frame/LocalFrame.h" #include "core/html/HTMLAnchorElement.h" #include "core/html/HTMLBRElement.h" #include "core/html/HTMLBodyElement.h" #include "core/html/HTMLDivElement.h" #include "core/html/HTMLElement.h" #include "core/html/HTMLQuoteElement.h" #include "core/html/HTMLSpanElement.h" #include "core/html/HTMLTableCellElement.h" #include "core/html/HTMLTableElement.h" #include "core/html/HTMLTextFormControlElement.h" #include "core/rendering/RenderObject.h" #include "platform/weborigin/KURL.h" #include "wtf/StdLibExtras.h" #include "wtf/text/StringBuilder.h" namespace blink { using namespace HTMLNames; static bool propertyMissingOrEqualToNone(StylePropertySet*, CSSPropertyID); class AttributeChange { ALLOW_ONLY_INLINE_ALLOCATION(); public: AttributeChange() : m_name(nullAtom, nullAtom, nullAtom) { } AttributeChange(PassRefPtrWillBeRawPtr<Element> element, const QualifiedName& name, const String& value) : m_element(element), m_name(name), m_value(value) { } void apply() { m_element->setAttribute(m_name, AtomicString(m_value)); } void trace(Visitor* visitor) { visitor->trace(m_element); } private: RefPtrWillBeMember<Element> m_element; QualifiedName m_name; String m_value; }; } // namespace blink WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::AttributeChange); namespace blink { static void completeURLs(DocumentFragment& fragment, const String& baseURL) { WillBeHeapVector<AttributeChange> changes; KURL parsedBaseURL(ParsedURLString, baseURL); for (Element* element = ElementTraversal::firstWithin(fragment); element; element = ElementTraversal::next(*element, &fragment)) { AttributeCollection attributes = element->attributes(); AttributeCollection::iterator end = attributes.end(); for (AttributeCollection::iterator it = attributes.begin(); it != end; ++it) { if (element->isURLAttribute(*it) && !it->value().isEmpty()) changes.append(AttributeChange(element, it->name(), KURL(parsedBaseURL, it->value()).string())); } } size_t numChanges = changes.size(); for (size_t i = 0; i < numChanges; ++i) changes[i].apply(); } class StyledMarkupAccumulator FINAL : public MarkupAccumulator { public: enum RangeFullySelectsNode { DoesFullySelectNode, DoesNotFullySelectNode }; StyledMarkupAccumulator(WillBeHeapVector<RawPtrWillBeMember<Node> >* nodes, EAbsoluteURLs, EAnnotateForInterchange, RawPtr<const Range>, Node* highestNodeToBeSerialized = 0); Node* serializeNodes(Node* startNode, Node* pastEnd); void appendString(const String& s) { return MarkupAccumulator::appendString(s); } void wrapWithNode(ContainerNode&, bool convertBlocksToInlines = false, RangeFullySelectsNode = DoesFullySelectNode); void wrapWithStyleNode(StylePropertySet*, const Document&, bool isBlock = false); String takeResults(); private: void appendStyleNodeOpenTag(StringBuilder&, StylePropertySet*, const Document&, bool isBlock = false); const String& styleNodeCloseTag(bool isBlock = false); virtual void appendText(StringBuilder& out, Text&) OVERRIDE; String renderedText(Node&, const Range*); String stringValueForRange(const Node&, const Range*); void appendElement(StringBuilder& out, Element&, bool addDisplayInline, RangeFullySelectsNode); virtual void appendElement(StringBuilder& out, Element& element, Namespaces*) OVERRIDE { appendElement(out, element, false, DoesFullySelectNode); } enum NodeTraversalMode { EmitString, DoNotEmitString }; Node* traverseNodesForSerialization(Node* startNode, Node* pastEnd, NodeTraversalMode); bool shouldAnnotate() const { return m_shouldAnnotate == AnnotateForInterchange || m_shouldAnnotate == AnnotateForNavigationTransition; } bool shouldApplyWrappingStyle(const Node& node) const { return m_highestNodeToBeSerialized && m_highestNodeToBeSerialized->parentNode() == node.parentNode() && m_wrappingStyle && m_wrappingStyle->style(); } Vector<String> m_reversedPrecedingMarkup; const EAnnotateForInterchange m_shouldAnnotate; RawPtrWillBeMember<Node> m_highestNodeToBeSerialized; RefPtrWillBeMember<EditingStyle> m_wrappingStyle; }; inline StyledMarkupAccumulator::StyledMarkupAccumulator(WillBeHeapVector<RawPtrWillBeMember<Node> >* nodes, EAbsoluteURLs shouldResolveURLs, EAnnotateForInterchange shouldAnnotate, RawPtr<const Range> range, Node* highestNodeToBeSerialized) : MarkupAccumulator(nodes, shouldResolveURLs, range) , m_shouldAnnotate(shouldAnnotate) , m_highestNodeToBeSerialized(highestNodeToBeSerialized) { } void StyledMarkupAccumulator::wrapWithNode(ContainerNode& node, bool convertBlocksToInlines, RangeFullySelectsNode rangeFullySelectsNode) { StringBuilder markup; if (node.isElementNode()) appendElement(markup, toElement(node), convertBlocksToInlines && isBlock(&node), rangeFullySelectsNode); else appendStartMarkup(markup, node, 0); m_reversedPrecedingMarkup.append(markup.toString()); if (node.isElementNode()) appendEndTag(toElement(node)); if (m_nodes) m_nodes->append(&node); } void StyledMarkupAccumulator::wrapWithStyleNode(StylePropertySet* style, const Document& document, bool isBlock) { StringBuilder openTag; appendStyleNodeOpenTag(openTag, style, document, isBlock); m_reversedPrecedingMarkup.append(openTag.toString()); appendString(styleNodeCloseTag(isBlock)); } void StyledMarkupAccumulator::appendStyleNodeOpenTag(StringBuilder& out, StylePropertySet* style, const Document& document, bool isBlock) { // wrappingStyleForSerialization should have removed -webkit-text-decorations-in-effect ASSERT(propertyMissingOrEqualToNone(style, CSSPropertyWebkitTextDecorationsInEffect)); if (isBlock) out.appendLiteral("<div style=\""); else out.appendLiteral("<span style=\""); appendAttributeValue(out, style->asText(), document.isHTMLDocument()); out.appendLiteral("\">"); } const String& StyledMarkupAccumulator::styleNodeCloseTag(bool isBlock) { DEFINE_STATIC_LOCAL(const String, divClose, ("</div>")); DEFINE_STATIC_LOCAL(const String, styleSpanClose, ("</span>")); return isBlock ? divClose : styleSpanClose; } String StyledMarkupAccumulator::takeResults() { StringBuilder result; result.reserveCapacity(totalLength(m_reversedPrecedingMarkup) + length()); for (size_t i = m_reversedPrecedingMarkup.size(); i > 0; --i) result.append(m_reversedPrecedingMarkup[i - 1]); concatenateMarkup(result); // We remove '\0' characters because they are not visibly rendered to the user. return result.toString().replace(0, ""); } void StyledMarkupAccumulator::appendText(StringBuilder& out, Text& text) { const bool parentIsTextarea = text.parentElement() && text.parentElement()->tagQName() == textareaTag; const bool wrappingSpan = shouldApplyWrappingStyle(text) && !parentIsTextarea; if (wrappingSpan) { RefPtrWillBeRawPtr<EditingStyle> wrappingStyle = m_wrappingStyle->copy(); // FIXME: <rdar://problem/5371536> Style rules that match pasted content can change it's appearance // Make sure spans are inline style in paste side e.g. span { display: block }. wrappingStyle->forceInline(); // FIXME: Should this be included in forceInline? wrappingStyle->style()->setProperty(CSSPropertyFloat, CSSValueNone); appendStyleNodeOpenTag(out, wrappingStyle->style(), text.document()); } if (!shouldAnnotate() || parentIsTextarea) MarkupAccumulator::appendText(out, text); else { const bool useRenderedText = !enclosingElementWithTag(firstPositionInNode(&text), selectTag); String content = useRenderedText ? renderedText(text, m_range) : stringValueForRange(text, m_range); StringBuilder buffer; appendCharactersReplacingEntities(buffer, content, 0, content.length(), EntityMaskInPCDATA); out.append(convertHTMLTextToInterchangeFormat(buffer.toString(), text)); } if (wrappingSpan) out.append(styleNodeCloseTag()); } String StyledMarkupAccumulator::renderedText(Node& node, const Range* range) { if (!node.isTextNode()) return String(); Text& textNode = toText(node); unsigned startOffset = 0; unsigned endOffset = textNode.length(); if (range && textNode == range->startContainer()) startOffset = range->startOffset(); if (range && textNode == range->endContainer()) endOffset = range->endOffset(); Position start = createLegacyEditingPosition(&textNode, startOffset); Position end = createLegacyEditingPosition(&textNode, endOffset); return plainText(Range::create(textNode.document(), start, end).get()); } String StyledMarkupAccumulator::stringValueForRange(const Node& node, const Range* range) { if (!range) return node.nodeValue(); String str = node.nodeValue(); if (node == range->endContainer()) str.truncate(range->endOffset()); if (node == range->startContainer()) str.remove(0, range->startOffset()); return str; } void StyledMarkupAccumulator::appendElement(StringBuilder& out, Element& element, bool addDisplayInline, RangeFullySelectsNode rangeFullySelectsNode) { const bool documentIsHTML = element.document().isHTMLDocument(); appendOpenTag(out, element, 0); const bool shouldAnnotateOrForceInline = element.isHTMLElement() && (shouldAnnotate() || addDisplayInline); const bool shouldOverrideStyleAttr = shouldAnnotateOrForceInline || shouldApplyWrappingStyle(element); AttributeCollection attributes = element.attributes(); AttributeCollection::iterator end = attributes.end(); for (AttributeCollection::iterator it = attributes.begin(); it != end; ++it) { // We'll handle the style attribute separately, below. if (it->name() == styleAttr && shouldOverrideStyleAttr) continue; appendAttribute(out, element, *it, 0); } if (shouldOverrideStyleAttr) { RefPtrWillBeRawPtr<EditingStyle> newInlineStyle = nullptr; if (shouldApplyWrappingStyle(element)) { newInlineStyle = m_wrappingStyle->copy(); newInlineStyle->removePropertiesInElementDefaultStyle(&element); newInlineStyle->removeStyleConflictingWithStyleOfElement(&element); } else newInlineStyle = EditingStyle::create(); if (element.isStyledElement() && element.inlineStyle()) newInlineStyle->overrideWithStyle(element.inlineStyle()); if (shouldAnnotateOrForceInline) { if (shouldAnnotate()) newInlineStyle->mergeStyleFromRulesForSerialization(&toHTMLElement(element)); if (&element == m_highestNodeToBeSerialized && m_shouldAnnotate == AnnotateForNavigationTransition) newInlineStyle->addAbsolutePositioningFromElement(element); if (addDisplayInline) newInlineStyle->forceInline(); // If the node is not fully selected by the range, then we don't want to keep styles that affect its relationship to the nodes around it // only the ones that affect it and the nodes within it. if (rangeFullySelectsNode == DoesNotFullySelectNode && newInlineStyle->style()) newInlineStyle->style()->removeProperty(CSSPropertyFloat); } if (!newInlineStyle->isEmpty()) { out.appendLiteral(" style=\""); appendAttributeValue(out, newInlineStyle->style()->asText(), documentIsHTML); out.append('\"'); } } appendCloseTag(out, element); } Node* StyledMarkupAccumulator::serializeNodes(Node* startNode, Node* pastEnd) { if (!m_highestNodeToBeSerialized) { Node* lastClosed = traverseNodesForSerialization(startNode, pastEnd, DoNotEmitString); m_highestNodeToBeSerialized = lastClosed; } if (m_highestNodeToBeSerialized && m_highestNodeToBeSerialized->parentNode()) { m_wrappingStyle = EditingStyle::wrappingStyleForSerialization(m_highestNodeToBeSerialized->parentNode(), shouldAnnotate()); if (m_shouldAnnotate == AnnotateForNavigationTransition) { m_wrappingStyle->style()->removeProperty(CSSPropertyBackgroundColor); m_wrappingStyle->style()->removeProperty(CSSPropertyBackgroundImage); } } return traverseNodesForSerialization(startNode, pastEnd, EmitString); } Node* StyledMarkupAccumulator::traverseNodesForSerialization(Node* startNode, Node* pastEnd, NodeTraversalMode traversalMode) { const bool shouldEmit = traversalMode == EmitString; WillBeHeapVector<RawPtrWillBeMember<ContainerNode> > ancestorsToClose; Node* next; Node* lastClosed = 0; for (Node* n = startNode; n != pastEnd; n = next) { // According to <rdar://problem/5730668>, it is possible for n to blow // past pastEnd and become null here. This shouldn't be possible. // This null check will prevent crashes (but create too much markup) // and the ASSERT will hopefully lead us to understanding the problem. ASSERT(n); if (!n) break; next = NodeTraversal::next(*n); bool openedTag = false; if (isBlock(n) && canHaveChildrenForEditing(n) && next == pastEnd) // Don't write out empty block containers that aren't fully selected. continue; if (!n->renderer() && !enclosingElementWithTag(firstPositionInOrBeforeNode(n), selectTag) && m_shouldAnnotate != AnnotateForNavigationTransition) { next = NodeTraversal::nextSkippingChildren(*n); // Don't skip over pastEnd. if (pastEnd && pastEnd->isDescendantOf(n)) next = pastEnd; } else { // Add the node to the markup if we're not skipping the descendants if (shouldEmit) appendStartTag(*n); // If node has no children, close the tag now. if (n->isContainerNode() && toContainerNode(n)->hasChildren()) { openedTag = true; ancestorsToClose.append(toContainerNode(n)); } else { if (shouldEmit && n->isElementNode()) appendEndTag(toElement(*n)); lastClosed = n; } } // If we didn't insert open tag and there's no more siblings or we're at the end of the traversal, take care of ancestors. // FIXME: What happens if we just inserted open tag and reached the end? if (!openedTag && (!n->nextSibling() || next == pastEnd)) { // Close up the ancestors. while (!ancestorsToClose.isEmpty()) { ContainerNode* ancestor = ancestorsToClose.last(); ASSERT(ancestor); if (next != pastEnd && next->isDescendantOf(ancestor)) break; // Not at the end of the range, close ancestors up to sibling of next node. if (shouldEmit && ancestor->isElementNode()) appendEndTag(toElement(*ancestor)); lastClosed = ancestor; ancestorsToClose.removeLast(); } // Surround the currently accumulated markup with markup for ancestors we never opened as we leave the subtree(s) rooted at those ancestors. ContainerNode* nextParent = next ? next->parentNode() : 0; if (next != pastEnd && n != nextParent) { Node* lastAncestorClosedOrSelf = n->isDescendantOf(lastClosed) ? lastClosed : n; for (ContainerNode* parent = lastAncestorClosedOrSelf->parentNode(); parent && parent != nextParent; parent = parent->parentNode()) { // All ancestors that aren't in the ancestorsToClose list should either be a) unrendered: if (!parent->renderer()) continue; // or b) ancestors that we never encountered during a pre-order traversal starting at startNode: ASSERT(startNode->isDescendantOf(parent)); if (shouldEmit) wrapWithNode(*parent); lastClosed = parent; } } } } return lastClosed; } static bool isHTMLBlockElement(const Node* node) { ASSERT(node); return isHTMLTableCellElement(*node) || isNonTableCellHTMLBlockElement(node); } static HTMLElement* ancestorToRetainStructureAndAppearanceForBlock(Element* commonAncestorBlock) { if (!commonAncestorBlock) return 0; if (commonAncestorBlock->hasTagName(tbodyTag) || isHTMLTableRowElement(*commonAncestorBlock)) return Traversal<HTMLTableElement>::firstAncestor(*commonAncestorBlock); if (isNonTableCellHTMLBlockElement(commonAncestorBlock)) return toHTMLElement(commonAncestorBlock); return 0; } static inline HTMLElement* ancestorToRetainStructureAndAppearance(Node* commonAncestor) { return ancestorToRetainStructureAndAppearanceForBlock(enclosingBlock(commonAncestor)); } static inline HTMLElement* ancestorToRetainStructureAndAppearanceWithNoRenderer(Node* commonAncestor) { HTMLElement* commonAncestorBlock = toHTMLElement(enclosingNodeOfType(firstPositionInOrBeforeNode(commonAncestor), isHTMLBlockElement)); return ancestorToRetainStructureAndAppearanceForBlock(commonAncestorBlock); } static bool propertyMissingOrEqualToNone(StylePropertySet* style, CSSPropertyID propertyID) { if (!style) return false; RefPtrWillBeRawPtr<CSSValue> value = style->getPropertyCSSValue(propertyID); if (!value) return true; if (!value->isPrimitiveValue()) return false; return toCSSPrimitiveValue(value.get())->getValueID() == CSSValueNone; } static bool needInterchangeNewlineAfter(const VisiblePosition& v) { VisiblePosition next = v.next(); Node* upstreamNode = next.deepEquivalent().upstream().deprecatedNode(); Node* downstreamNode = v.deepEquivalent().downstream().deprecatedNode(); // Add an interchange newline if a paragraph break is selected and a br won't already be added to the markup to represent it. return isEndOfParagraph(v) && isStartOfParagraph(next) && !(isHTMLBRElement(*upstreamNode) && upstreamNode == downstreamNode); } static PassRefPtrWillBeRawPtr<EditingStyle> styleFromMatchedRulesAndInlineDecl(const HTMLElement* element) { RefPtrWillBeRawPtr<EditingStyle> style = EditingStyle::create(element->inlineStyle()); // FIXME: Having to const_cast here is ugly, but it is quite a bit of work to untangle // the non-const-ness of styleFromMatchedRulesForElement. style->mergeStyleFromRules(const_cast<HTMLElement*>(element)); return style.release(); } static bool isPresentationalHTMLElement(const Node* node) { if (!node->isHTMLElement()) return false; const HTMLElement& element = toHTMLElement(*node); return element.hasTagName(uTag) || element.hasTagName(sTag) || element.hasTagName(strikeTag) || element.hasTagName(iTag) || element.hasTagName(emTag) || element.hasTagName(bTag) || element.hasTagName(strongTag); } static HTMLElement* highestAncestorToWrapMarkup(const Range* range, EAnnotateForInterchange shouldAnnotate, Node* constrainingAncestor) { Node* commonAncestor = range->commonAncestorContainer(); ASSERT(commonAncestor); HTMLElement* specialCommonAncestor = 0; if (shouldAnnotate == AnnotateForInterchange) { // Include ancestors that aren't completely inside the range but are required to retain // the structure and appearance of the copied markup. specialCommonAncestor = ancestorToRetainStructureAndAppearance(commonAncestor); if (Node* parentListNode = enclosingNodeOfType(firstPositionInOrBeforeNode(range->firstNode()), isListItem)) { if (blink::areRangesEqual(VisibleSelection::selectionFromContentsOfNode(parentListNode).toNormalizedRange().get(), range)) { ContainerNode* ancestor = parentListNode->parentNode(); while (ancestor && !isHTMLListElement(ancestor)) ancestor = ancestor->parentNode(); specialCommonAncestor = toHTMLElement(ancestor); } } // Retain the Mail quote level by including all ancestor mail block quotes. if (HTMLQuoteElement* highestMailBlockquote = toHTMLQuoteElement(highestEnclosingNodeOfType(firstPositionInOrBeforeNode(range->firstNode()), isMailHTMLBlockquoteElement, CanCrossEditingBoundary))) specialCommonAncestor = highestMailBlockquote; } Node* checkAncestor = specialCommonAncestor ? specialCommonAncestor : commonAncestor; if (checkAncestor->renderer()) { HTMLElement* newSpecialCommonAncestor = toHTMLElement(highestEnclosingNodeOfType(firstPositionInNode(checkAncestor), &isPresentationalHTMLElement, CanCrossEditingBoundary, constrainingAncestor)); if (newSpecialCommonAncestor) specialCommonAncestor = newSpecialCommonAncestor; } // If a single tab is selected, commonAncestor will be a text node inside a tab span. // If two or more tabs are selected, commonAncestor will be the tab span. // In either case, if there is a specialCommonAncestor already, it will necessarily be above // any tab span that needs to be included. if (!specialCommonAncestor && isTabHTMLSpanElementTextNode(commonAncestor)) specialCommonAncestor = toHTMLSpanElement(commonAncestor->parentNode()); if (!specialCommonAncestor && isTabHTMLSpanElement(commonAncestor)) specialCommonAncestor = toHTMLSpanElement(commonAncestor); if (HTMLAnchorElement* enclosingAnchor = toHTMLAnchorElement(enclosingElementWithTag(firstPositionInNode(specialCommonAncestor ? specialCommonAncestor : commonAncestor), aTag))) specialCommonAncestor = enclosingAnchor; return specialCommonAncestor; } // FIXME: Shouldn't we omit style info when annotate == DoNotAnnotateForInterchange? // FIXME: At least, annotation and style info should probably not be included in range.markupString() static String createMarkupInternal(Document& document, const Range* range, const Range* updatedRange, WillBeHeapVector<RawPtrWillBeMember<Node> >* nodes, EAnnotateForInterchange shouldAnnotate, bool convertBlocksToInlines, EAbsoluteURLs shouldResolveURLs, Node* constrainingAncestor) { ASSERT(range); ASSERT(updatedRange); DEFINE_STATIC_LOCAL(const String, interchangeNewlineString, ("<br class=\"" AppleInterchangeNewline "\">")); bool collapsed = updatedRange->collapsed(); if (collapsed) return emptyString(); Node* commonAncestor = updatedRange->commonAncestorContainer(); if (!commonAncestor) return emptyString(); document.updateLayoutIgnorePendingStylesheets(); HTMLBodyElement* body = toHTMLBodyElement(enclosingElementWithTag(firstPositionInNode(commonAncestor), bodyTag)); HTMLBodyElement* fullySelectedRoot = 0; // FIXME: Do this for all fully selected blocks, not just the body. if (body && areRangesEqual(VisibleSelection::selectionFromContentsOfNode(body).toNormalizedRange().get(), range)) fullySelectedRoot = body; HTMLElement* specialCommonAncestor = highestAncestorToWrapMarkup(updatedRange, shouldAnnotate, constrainingAncestor); StyledMarkupAccumulator accumulator(nodes, shouldResolveURLs, shouldAnnotate, updatedRange, specialCommonAncestor); Node* pastEnd = updatedRange->pastLastNode(); Node* startNode = updatedRange->firstNode(); VisiblePosition visibleStart(updatedRange->startPosition(), VP_DEFAULT_AFFINITY); VisiblePosition visibleEnd(updatedRange->endPosition(), VP_DEFAULT_AFFINITY); if (shouldAnnotate == AnnotateForInterchange && needInterchangeNewlineAfter(visibleStart)) { if (visibleStart == visibleEnd.previous()) return interchangeNewlineString; accumulator.appendString(interchangeNewlineString); startNode = visibleStart.next().deepEquivalent().deprecatedNode(); if (pastEnd && Range::compareBoundaryPoints(startNode, 0, pastEnd, 0, ASSERT_NO_EXCEPTION) >= 0) return interchangeNewlineString; } Node* lastClosed = accumulator.serializeNodes(startNode, pastEnd); if (specialCommonAncestor && lastClosed) { // Also include all of the ancestors of lastClosed up to this special ancestor. for (ContainerNode* ancestor = lastClosed->parentNode(); ancestor; ancestor = ancestor->parentNode()) { if (ancestor == fullySelectedRoot && !convertBlocksToInlines) { RefPtrWillBeRawPtr<EditingStyle> fullySelectedRootStyle = styleFromMatchedRulesAndInlineDecl(fullySelectedRoot); // Bring the background attribute over, but not as an attribute because a background attribute on a div // appears to have no effect. if ((!fullySelectedRootStyle || !fullySelectedRootStyle->style() || !fullySelectedRootStyle->style()->getPropertyCSSValue(CSSPropertyBackgroundImage)) && fullySelectedRoot->hasAttribute(backgroundAttr)) fullySelectedRootStyle->style()->setProperty(CSSPropertyBackgroundImage, "url('" + fullySelectedRoot->getAttribute(backgroundAttr) + "')"); if (fullySelectedRootStyle->style()) { // Reset the CSS properties to avoid an assertion error in addStyleMarkup(). // This assertion is caused at least when we select all text of a <body> element whose // 'text-decoration' property is "inherit", and copy it. if (!propertyMissingOrEqualToNone(fullySelectedRootStyle->style(), CSSPropertyTextDecoration)) fullySelectedRootStyle->style()->setProperty(CSSPropertyTextDecoration, CSSValueNone); if (!propertyMissingOrEqualToNone(fullySelectedRootStyle->style(), CSSPropertyWebkitTextDecorationsInEffect)) fullySelectedRootStyle->style()->setProperty(CSSPropertyWebkitTextDecorationsInEffect, CSSValueNone); accumulator.wrapWithStyleNode(fullySelectedRootStyle->style(), document, true); } } else { // Since this node and all the other ancestors are not in the selection we want to set RangeFullySelectsNode to DoesNotFullySelectNode // so that styles that affect the exterior of the node are not included. accumulator.wrapWithNode(*ancestor, convertBlocksToInlines, StyledMarkupAccumulator::DoesNotFullySelectNode); } if (nodes) nodes->append(ancestor); if (ancestor == specialCommonAncestor) break; } } // FIXME: The interchange newline should be placed in the block that it's in, not after all of the content, unconditionally. if (shouldAnnotate == AnnotateForInterchange && needInterchangeNewlineAfter(visibleEnd.previous())) accumulator.appendString(interchangeNewlineString); return accumulator.takeResults(); } String createMarkup(const Range* range, WillBeHeapVector<RawPtrWillBeMember<Node> >* nodes, EAnnotateForInterchange shouldAnnotate, bool convertBlocksToInlines, EAbsoluteURLs shouldResolveURLs, Node* constrainingAncestor) { if (!range) return emptyString(); Document& document = range->ownerDocument(); const Range* updatedRange = range; return createMarkupInternal(document, range, updatedRange, nodes, shouldAnnotate, convertBlocksToInlines, shouldResolveURLs, constrainingAncestor); } PassRefPtrWillBeRawPtr<DocumentFragment> createFragmentFromMarkup(Document& document, const String& markup, const String& baseURL, ParserContentPolicy parserContentPolicy) { // We use a fake body element here to trick the HTML parser to using the InBody insertion mode. RefPtrWillBeRawPtr<HTMLBodyElement> fakeBody = HTMLBodyElement::create(document); RefPtrWillBeRawPtr<DocumentFragment> fragment = DocumentFragment::create(document); fragment->parseHTML(markup, fakeBody.get(), parserContentPolicy); if (!baseURL.isEmpty() && baseURL != blankURL() && baseURL != document.baseURL()) completeURLs(*fragment, baseURL); return fragment.release(); } static const char fragmentMarkerTag[] = "webkit-fragment-marker"; static bool findNodesSurroundingContext(Document* document, RefPtrWillBeRawPtr<Comment>& nodeBeforeContext, RefPtrWillBeRawPtr<Comment>& nodeAfterContext) { for (Node* node = document->firstChild(); node; node = NodeTraversal::next(*node)) { if (node->nodeType() == Node::COMMENT_NODE && toComment(node)->data() == fragmentMarkerTag) { if (!nodeBeforeContext) nodeBeforeContext = toComment(node); else { nodeAfterContext = toComment(node); return true; } } } return false; } static void trimFragment(DocumentFragment* fragment, Comment* nodeBeforeContext, Comment* nodeAfterContext) { RefPtrWillBeRawPtr<Node> next = nullptr; for (RefPtrWillBeRawPtr<Node> node = fragment->firstChild(); node; node = next) { if (nodeBeforeContext->isDescendantOf(node.get())) { next = NodeTraversal::next(*node); continue; } next = NodeTraversal::nextSkippingChildren(*node); ASSERT(!node->contains(nodeAfterContext)); node->parentNode()->removeChild(node.get(), ASSERT_NO_EXCEPTION); if (nodeBeforeContext == node) break; } ASSERT(nodeAfterContext->parentNode()); for (RefPtrWillBeRawPtr<Node> node = nodeAfterContext; node; node = next) { next = NodeTraversal::nextSkippingChildren(*node); node->parentNode()->removeChild(node.get(), ASSERT_NO_EXCEPTION); } } PassRefPtrWillBeRawPtr<DocumentFragment> createFragmentFromMarkupWithContext(Document& document, const String& markup, unsigned fragmentStart, unsigned fragmentEnd, const String& baseURL, ParserContentPolicy parserContentPolicy) { // FIXME: Need to handle the case where the markup already contains these markers. StringBuilder taggedMarkup; taggedMarkup.append(markup.left(fragmentStart)); MarkupAccumulator::appendComment(taggedMarkup, fragmentMarkerTag); taggedMarkup.append(markup.substring(fragmentStart, fragmentEnd - fragmentStart)); MarkupAccumulator::appendComment(taggedMarkup, fragmentMarkerTag); taggedMarkup.append(markup.substring(fragmentEnd)); RefPtrWillBeRawPtr<DocumentFragment> taggedFragment = createFragmentFromMarkup(document, taggedMarkup.toString(), baseURL, parserContentPolicy); RefPtrWillBeRawPtr<Document> taggedDocument = Document::create(); taggedDocument->setContextFeatures(document.contextFeatures()); // FIXME: It's not clear what this code is trying to do. It puts nodes as direct children of a // Document that are not normally allowed by using the parser machinery. taggedDocument->parserTakeAllChildrenFrom(*taggedFragment); RefPtrWillBeRawPtr<Comment> nodeBeforeContext = nullptr; RefPtrWillBeRawPtr<Comment> nodeAfterContext = nullptr; if (!findNodesSurroundingContext(taggedDocument.get(), nodeBeforeContext, nodeAfterContext)) return nullptr; RefPtrWillBeRawPtr<Range> range = Range::create(*taggedDocument.get(), positionAfterNode(nodeBeforeContext.get()).parentAnchoredEquivalent(), positionBeforeNode(nodeAfterContext.get()).parentAnchoredEquivalent()); Node* commonAncestor = range->commonAncestorContainer(); HTMLElement* specialCommonAncestor = ancestorToRetainStructureAndAppearanceWithNoRenderer(commonAncestor); // When there's a special common ancestor outside of the fragment, we must include it as well to // preserve the structure and appearance of the fragment. For example, if the fragment contains // TD, we need to include the enclosing TABLE tag as well. RefPtrWillBeRawPtr<DocumentFragment> fragment = DocumentFragment::create(document); if (specialCommonAncestor) fragment->appendChild(specialCommonAncestor); else fragment->parserTakeAllChildrenFrom(toContainerNode(*commonAncestor)); trimFragment(fragment.get(), nodeBeforeContext.get(), nodeAfterContext.get()); return fragment; } String createMarkup(const Node* node, EChildrenOnly childrenOnly, WillBeHeapVector<RawPtrWillBeMember<Node> >* nodes, EAbsoluteURLs shouldResolveURLs, Vector<QualifiedName>* tagNamesToSkip) { if (!node) return ""; MarkupAccumulator accumulator(nodes, shouldResolveURLs); return accumulator.serializeNodes(const_cast<Node&>(*node), childrenOnly, tagNamesToSkip); } static void fillContainerFromString(ContainerNode* paragraph, const String& string) { Document& document = paragraph->document(); if (string.isEmpty()) { paragraph->appendChild(createBlockPlaceholderElement(document)); return; } ASSERT(string.find('\n') == kNotFound); Vector<String> tabList; string.split('\t', true, tabList); StringBuilder tabText; bool first = true; size_t numEntries = tabList.size(); for (size_t i = 0; i < numEntries; ++i) { const String& s = tabList[i]; // append the non-tab textual part if (!s.isEmpty()) { if (!tabText.isEmpty()) { paragraph->appendChild(createTabSpanElement(document, tabText.toString())); tabText.clear(); } RefPtrWillBeRawPtr<Text> textNode = document.createTextNode(stringWithRebalancedWhitespace(s, first, i + 1 == numEntries)); paragraph->appendChild(textNode.release()); } // there is a tab after every entry, except the last entry // (if the last character is a tab, the list gets an extra empty entry) if (i + 1 != numEntries) tabText.append('\t'); else if (!tabText.isEmpty()) paragraph->appendChild(createTabSpanElement(document, tabText.toString())); first = false; } } bool isPlainTextMarkup(Node* node) { ASSERT(node); if (!isHTMLDivElement(*node)) return false; HTMLDivElement& element = toHTMLDivElement(*node); if (!element.hasAttributes()) return false; if (element.hasOneChild()) return element.firstChild()->isTextNode() || element.firstChild()->hasChildren(); return element.hasChildCount(2) && isTabHTMLSpanElementTextNode(element.firstChild()->firstChild()) && element.lastChild()->isTextNode(); } static bool shouldPreserveNewline(const Range& range) { if (Node* node = range.firstNode()) { if (RenderObject* renderer = node->renderer()) return renderer->style()->preserveNewline(); } if (Node* node = range.startPosition().anchorNode()) { if (RenderObject* renderer = node->renderer()) return renderer->style()->preserveNewline(); } return false; } PassRefPtrWillBeRawPtr<DocumentFragment> createFragmentFromText(Range* context, const String& text) { if (!context) return nullptr; Document& document = context->ownerDocument(); RefPtrWillBeRawPtr<DocumentFragment> fragment = document.createDocumentFragment(); if (text.isEmpty()) return fragment.release(); String string = text; string.replace("\r\n", "\n"); string.replace('\r', '\n'); if (shouldPreserveNewline(*context)) { fragment->appendChild(document.createTextNode(string)); if (string.endsWith('\n')) { RefPtrWillBeRawPtr<HTMLBRElement> element = createBreakElement(document); element->setAttribute(classAttr, AppleInterchangeNewline); fragment->appendChild(element.release()); } return fragment.release(); } // A string with no newlines gets added inline, rather than being put into a paragraph. if (string.find('\n') == kNotFound) { fillContainerFromString(fragment.get(), string); return fragment.release(); } // Break string into paragraphs. Extra line breaks turn into empty paragraphs. Element* block = enclosingBlock(context->firstNode()); bool useClonesOfEnclosingBlock = block && !isHTMLBodyElement(*block) && !isHTMLHtmlElement(*block) && block != editableRootForPosition(context->startPosition()); bool useLineBreak = enclosingTextFormControl(context->startPosition()); Vector<String> list; string.split('\n', true, list); // true gets us empty strings in the list size_t numLines = list.size(); for (size_t i = 0; i < numLines; ++i) { const String& s = list[i]; RefPtrWillBeRawPtr<Element> element = nullptr; if (s.isEmpty() && i + 1 == numLines) { // For last line, use the "magic BR" rather than a P. element = createBreakElement(document); element->setAttribute(classAttr, AppleInterchangeNewline); } else if (useLineBreak) { element = createBreakElement(document); fillContainerFromString(fragment.get(), s); } else { if (useClonesOfEnclosingBlock) element = block->cloneElementWithoutChildren(); else element = createDefaultParagraphElement(document); fillContainerFromString(element.get(), s); } fragment->appendChild(element.release()); } return fragment.release(); } String urlToMarkup(const KURL& url, const String& title) { StringBuilder markup; markup.appendLiteral("<a href=\""); markup.append(url.string()); markup.appendLiteral("\">"); MarkupAccumulator::appendCharactersReplacingEntities(markup, title, 0, title.length(), EntityMaskInPCDATA); markup.appendLiteral("</a>"); return markup.toString(); } PassRefPtrWillBeRawPtr<DocumentFragment> createFragmentForInnerOuterHTML(const String& markup, Element* contextElement, ParserContentPolicy parserContentPolicy, const char* method, ExceptionState& exceptionState) { ASSERT(contextElement); Document& document = isHTMLTemplateElement(*contextElement) ? contextElement->document().ensureTemplateDocument() : contextElement->document(); RefPtrWillBeRawPtr<DocumentFragment> fragment = DocumentFragment::create(document); if (document.isHTMLDocument()) { fragment->parseHTML(markup, contextElement, parserContentPolicy); return fragment; } bool wasValid = fragment->parseXML(markup, contextElement, parserContentPolicy); if (!wasValid) { exceptionState.throwDOMException(SyntaxError, "The provided markup is invalid XML, and therefore cannot be inserted into an XML document."); return nullptr; } return fragment.release(); } PassRefPtrWillBeRawPtr<DocumentFragment> createFragmentForTransformToFragment(const String& sourceString, const String& sourceMIMEType, Document& outputDoc) { RefPtrWillBeRawPtr<DocumentFragment> fragment = outputDoc.createDocumentFragment(); if (sourceMIMEType == "text/html") { // As far as I can tell, there isn't a spec for how transformToFragment is supposed to work. // Based on the documentation I can find, it looks like we want to start parsing the fragment in the InBody insertion mode. // Unfortunately, that's an implementation detail of the parser. // We achieve that effect here by passing in a fake body element as context for the fragment. RefPtrWillBeRawPtr<HTMLBodyElement> fakeBody = HTMLBodyElement::create(outputDoc); fragment->parseHTML(sourceString, fakeBody.get()); } else if (sourceMIMEType == "text/plain") { fragment->parserAppendChild(Text::create(outputDoc, sourceString)); } else { bool successfulParse = fragment->parseXML(sourceString, 0); if (!successfulParse) return nullptr; } // FIXME: Do we need to mess with URLs here? return fragment.release(); } static inline void removeElementPreservingChildren(PassRefPtrWillBeRawPtr<DocumentFragment> fragment, HTMLElement* element) { RefPtrWillBeRawPtr<Node> nextChild = nullptr; for (RefPtrWillBeRawPtr<Node> child = element->firstChild(); child; child = nextChild) { nextChild = child->nextSibling(); element->removeChild(child.get()); fragment->insertBefore(child, element); } fragment->removeChild(element); } static inline bool isSupportedContainer(Element* element) { ASSERT(element); if (!element->isHTMLElement()) return true; HTMLElement& htmlElement = toHTMLElement(*element); if (htmlElement.hasTagName(colTag) || htmlElement.hasTagName(colgroupTag) || htmlElement.hasTagName(framesetTag) || htmlElement.hasTagName(headTag) || htmlElement.hasTagName(styleTag) || htmlElement.hasTagName(titleTag)) { return false; } return !htmlElement.ieForbidsInsertHTML(); } PassRefPtrWillBeRawPtr<DocumentFragment> createContextualFragment(const String& markup, Element* element, ParserContentPolicy parserContentPolicy, ExceptionState& exceptionState) { ASSERT(element); if (!isSupportedContainer(element)) { exceptionState.throwDOMException(NotSupportedError, "The range's container is '" + element->localName() + "', which is not supported."); return nullptr; } RefPtrWillBeRawPtr<DocumentFragment> fragment = createFragmentForInnerOuterHTML(markup, element, parserContentPolicy, "createContextualFragment", exceptionState); if (!fragment) return nullptr; // We need to pop <html> and <body> elements and remove <head> to // accommodate folks passing complete HTML documents to make the // child of an element. RefPtrWillBeRawPtr<Node> nextNode = nullptr; for (RefPtrWillBeRawPtr<Node> node = fragment->firstChild(); node; node = nextNode) { nextNode = node->nextSibling(); if (isHTMLHtmlElement(*node) || isHTMLHeadElement(*node) || isHTMLBodyElement(*node)) { HTMLElement* element = toHTMLElement(node); if (Node* firstChild = element->firstChild()) nextNode = firstChild; removeElementPreservingChildren(fragment, element); } } return fragment.release(); } void replaceChildrenWithFragment(ContainerNode* container, PassRefPtrWillBeRawPtr<DocumentFragment> fragment, ExceptionState& exceptionState) { ASSERT(container); RefPtrWillBeRawPtr<ContainerNode> containerNode(container); ChildListMutationScope mutation(*containerNode); if (!fragment->firstChild()) { containerNode->removeChildren(); return; } // FIXME: This is wrong if containerNode->firstChild() has more than one ref! if (containerNode->hasOneTextChild() && fragment->hasOneTextChild()) { toText(containerNode->firstChild())->setData(toText(fragment->firstChild())->data()); return; } // FIXME: No need to replace the child it is a text node and its contents are already == text. if (containerNode->hasOneChild()) { containerNode->replaceChild(fragment, containerNode->firstChild(), exceptionState); return; } containerNode->removeChildren(); containerNode->appendChild(fragment, exceptionState); } void replaceChildrenWithText(ContainerNode* container, const String& text, ExceptionState& exceptionState) { ASSERT(container); RefPtrWillBeRawPtr<ContainerNode> containerNode(container); ChildListMutationScope mutation(*containerNode); // FIXME: This is wrong if containerNode->firstChild() has more than one ref! Example: // <div>foo</div> // <script> // var oldText = div.firstChild; // console.log(oldText.data); // foo // div.innerText = "bar"; // console.log(oldText.data); // bar!?! // </script> // I believe this is an intentional benchmark cheat from years ago. // We should re-visit if we actually want this still. if (containerNode->hasOneTextChild()) { toText(containerNode->firstChild())->setData(text); return; } // NOTE: This method currently always creates a text node, even if that text node will be empty. RefPtrWillBeRawPtr<Text> textNode = Text::create(containerNode->document(), text); // FIXME: No need to replace the child it is a text node and its contents are already == text. if (containerNode->hasOneChild()) { containerNode->replaceChild(textNode.release(), containerNode->firstChild(), exceptionState); return; } containerNode->removeChildren(); containerNode->appendChild(textNode.release(), exceptionState); } void mergeWithNextTextNode(Text* textNode, ExceptionState& exceptionState) { ASSERT(textNode); Node* next = textNode->nextSibling(); if (!next || !next->isTextNode()) return; RefPtrWillBeRawPtr<Text> textNext = toText(next); textNode->appendData(textNext->data()); if (textNext->parentNode()) // Might have been removed by mutation event. textNext->remove(exceptionState); } String createStyledMarkupForNavigationTransition(Node* node) { node->document().updateLayoutIgnorePendingStylesheets(); StyledMarkupAccumulator accumulator(0, ResolveAllURLs, AnnotateForNavigationTransition, nullptr, 0); accumulator.serializeNodes(node, NodeTraversal::nextSkippingChildren(*node)); static const char* documentMarkup = "<!DOCTYPE html><meta name=\"viewport\" content=\"width=device-width, user-scalable=0\">"; return documentMarkup + accumulator.takeResults(); } }
cpp
package com.prowidesoftware.swift.model.mx.dic; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; /** * Scope * The Receiver of the MeetingInstruction or MeetingInstructionCancellationRequest sends the MeetingInstructionStatus message to the Sender of these messages. * The message gives the status of a complete message or of one or more specific instructions within the message. * Usage * The MeetingInstructionStatus message is used for four purposes. * First, it provides the status on the processing of a MeetingInstructionCancellationRequest message, ie, whether the request message is rejected or accepted. * Second, it is used to provide a global processing or rejection status of a MeetingInstruction message. * Third, it is used to provide a detailed processing or rejection status of a MeetingInstruction message, ie, for each instruction in the MeetingInstruction message the processing or rejection status is individually reported by using the InstructionIdentification element. This identification allows the receiver of the status message to link the status confirmation to its original instruction. * The blocking of securities should be confirmed via an MT 508 (Intra-Position Advice). * Fourth, it is used as a reminder to request voting instructions. This is done by indicating NONREF in the Identification element of the InstructionIdentification component and by using the status code NotReceived in the ProcessingStatus. * * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "MeetingInstructionStatusV02", propOrder = { "mtgInstrStsId", "instrId", "instrCxlId", "mtgRef", "rptgPty", "sctyId", "instrSts", "cxlSts" }) public class MeetingInstructionStatusV02 { @XmlElement(name = "MtgInstrStsId", required = true) protected MessageIdentification1 mtgInstrStsId; @XmlElement(name = "InstrId") protected MessageIdentification instrId; @XmlElement(name = "InstrCxlId") protected MessageIdentification instrCxlId; @XmlElement(name = "MtgRef", required = true) protected MeetingReference3 mtgRef; @XmlElement(name = "RptgPty", required = true) protected PartyIdentification9Choice rptgPty; @XmlElement(name = "SctyId", required = true) protected SecurityIdentification3 sctyId; @XmlElement(name = "InstrSts") protected InstructionStatus1Choice instrSts; @XmlElement(name = "CxlSts") protected CancellationStatus1Choice cxlSts; /** * Gets the value of the mtgInstrStsId property. * * @return * possible object is * {@link MessageIdentification1 } * */ public MessageIdentification1 getMtgInstrStsId() { return mtgInstrStsId; } /** * Sets the value of the mtgInstrStsId property. * * @param value * allowed object is * {@link MessageIdentification1 } * */ public MeetingInstructionStatusV02 setMtgInstrStsId(MessageIdentification1 value) { this.mtgInstrStsId = value; return this; } /** * Gets the value of the instrId property. * * @return * possible object is * {@link MessageIdentification } * */ public MessageIdentification getInstrId() { return instrId; } /** * Sets the value of the instrId property. * * @param value * allowed object is * {@link MessageIdentification } * */ public MeetingInstructionStatusV02 setInstrId(MessageIdentification value) { this.instrId = value; return this; } /** * Gets the value of the instrCxlId property. * * @return * possible object is * {@link MessageIdentification } * */ public MessageIdentification getInstrCxlId() { return instrCxlId; } /** * Sets the value of the instrCxlId property. * * @param value * allowed object is * {@link MessageIdentification } * */ public MeetingInstructionStatusV02 setInstrCxlId(MessageIdentification value) { this.instrCxlId = value; return this; } /** * Gets the value of the mtgRef property. * * @return * possible object is * {@link MeetingReference3 } * */ public MeetingReference3 getMtgRef() { return mtgRef; } /** * Sets the value of the mtgRef property. * * @param value * allowed object is * {@link MeetingReference3 } * */ public MeetingInstructionStatusV02 setMtgRef(MeetingReference3 value) { this.mtgRef = value; return this; } /** * Gets the value of the rptgPty property. * * @return * possible object is * {@link PartyIdentification9Choice } * */ public PartyIdentification9Choice getRptgPty() { return rptgPty; } /** * Sets the value of the rptgPty property. * * @param value * allowed object is * {@link PartyIdentification9Choice } * */ public MeetingInstructionStatusV02 setRptgPty(PartyIdentification9Choice value) { this.rptgPty = value; return this; } /** * Gets the value of the sctyId property. * * @return * possible object is * {@link SecurityIdentification3 } * */ public SecurityIdentification3 getSctyId() { return sctyId; } /** * Sets the value of the sctyId property. * * @param value * allowed object is * {@link SecurityIdentification3 } * */ public MeetingInstructionStatusV02 setSctyId(SecurityIdentification3 value) { this.sctyId = value; return this; } /** * Gets the value of the instrSts property. * * @return * possible object is * {@link InstructionStatus1Choice } * */ public InstructionStatus1Choice getInstrSts() { return instrSts; } /** * Sets the value of the instrSts property. * * @param value * allowed object is * {@link InstructionStatus1Choice } * */ public MeetingInstructionStatusV02 setInstrSts(InstructionStatus1Choice value) { this.instrSts = value; return this; } /** * Gets the value of the cxlSts property. * * @return * possible object is * {@link CancellationStatus1Choice } * */ public CancellationStatus1Choice getCxlSts() { return cxlSts; } /** * Sets the value of the cxlSts property. * * @param value * allowed object is * {@link CancellationStatus1Choice } * */ public MeetingInstructionStatusV02 setCxlSts(CancellationStatus1Choice value) { this.cxlSts = value; return this; } @Override public String toString() { return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE); } @Override public boolean equals(Object that) { return EqualsBuilder.reflectionEquals(this, that); } @Override public int hashCode() { return HashCodeBuilder.reflectionHashCode(this); } }
java
<gh_stars>0 from django.db import models from django.db.models.deletion import CASCADE from django.contrib.auth.models import User from cloudinary.models import CloudinaryField # Create your models here. class Profile(models.Model): """Model for handling User Profile""" user = models.OneToOneField(User, on_delete= models.CASCADE) username = models.CharField(max_length = 25) signup_date = models.DateTimeField(auto_now_add= True) profile_photo = CloudinaryField('images') followers = models.ManyToManyField(User, related_name='followers', blank= True) bio = models.CharField(max_length= 70) def __str__(self): return self.name def total_followers(self): """Method to return total numberof followers""" return self.followers.count() def save_profile(self): """Method to save profile to the database""" self.save() def delete_profile(self): """Method to delete profile from the database""" self.delete() def update_profile(self,new): """Method to update user profile Args: new([type]): [description] """ self.username = new.username self.bio = new.bio self.profile_photo = new.profile_pic self.save() @classmethod def get_following(cls,user): """Method to return all users a specific user is following """ following = user.followers.all() users = [] for profile in following: user = User.objects.get(profile = profile) users.append(user) return users @classmethod def search_profile(cls,search_term): """Method to return profiles with a provided search term""" profiles = cls.objects.filter(username_icontains = search_term) return profiles class Likes(models.Model): """Model for handling Image likes""" likes = models.IntegerField(default=0) class Image(models.Model): """Model for handling Image posts by users""" user = models.ForeignKey(User,on_delete= models.CASCADE) image = CloudinaryField('images') image_name = models.CharField(max_length= 25) caption = models.CharField(max_length= 100) profile = models.ForeignKey(Profile, on_delete=models.CASCADE, default= None) likes = models.ForeignKey(Likes, on_delete=CASCADE, default=None) comment = models.CharField(max_length= 120) time_posted = models.DateTimeField(auto_now_add= True) def __str__(self): return self.name def save_image(self): """Method to save Image to Database""" self.save() def delete_image(self): """Method to delete Image """ self.delete() def like_image(self,user): """Method to add user as an image liker""" self.likes.add(user) def get_total_likes(self): """Method to get the total number of likess on an Image""" return self.likes.count() def update_caption(self,caption): """Method to updat eimage captions in database""" self.caption = caption self.save() @classmethod def get_images(cls,users): """Method to get a specific image""" posts = [] for user in users: images = Image.objects.filter(user = user) for image in images: posts.append(image) return posts def get_comments(self): """Method to get all comments related to a post""" comments = Comments.objects.filter(image = self) return comments class Comments(models.Model): """Method to define attributes of a comment""" user = models.ForeignKey(User, on_delete=models.CASCADE) image = models.ForeignKey(Image,on_delete=models.CASCADE) comment = models.TextField() def __str__(self): return self.comment
python
A year ago, a 24-year-old college student named Anna Todd stumbled on a trove of feverish fan fiction about the boy band One Direction. It had been posted to Wattpad, a Toronto-based website and app that lets anyone write a story and comment on the stories of others. Entranced, Todd began concocting her own tale, a torrid romance between a sweet-hearted ingenue and a brooding version of One Direction singer Harry Styles. She typed the first 600 words into Wattpad and hit Publish. Soon comments began to flood in—mostly cheery praise, excitedly urging her on. Todd began tapping out 3,000 words a day, largely on her Samsung Galaxy smartphone, whenever she got a moment free. “I have written parts of chapters at the grocery store,” she tells me, laughing. “Even in traffic! If I'm stopped, of course.” Her fans became even more avid, offering editorial suggestions and creating Photoshopped illustrations of plot points. Within a year, Todd had written three books totaling more than 1 million words—a trilogy she called After. It's one of Wattpad's biggest hits. Collectively, Todd's stories have been read more than 800 million times, and visitors have left more than 3 million comments—sufficient attention that Simon & Schuster is publishing After in print this fall. This addictive approach to publishing drives a stunning amount of reading: 30 minutes a day for the average user, according to Wattpad CEO Allen Lau. And nearly 85 percent of it happens on mobile devices. The chapter-by-chapter approach also encourages authors to write on the go. They compose fully half of Wattpad's stories—200,000 new chapters a day—on smartphones or tablets. But it's the alchemical relationship between readers and authors that really propels Wattpad. Fiction is often romanticized as a solitary craft—the authors secluded in their aeries, away from worldly distraction—but Todd, like many Wattpad writers, says she couldn't have produced nearly so much without the daily encouragement, scrutiny, and (frankly) pressure from readers hungering to know where the story would go. In that sense Wattpad narratives are perhaps closer to other forms of serial writing—TV or comic books—than to modern literary novels. Is this good for “literary” fiction? Maybe, maybe not: Wattpad-style authoring may only work with genres like fan fiction, romance, and sci-fi. And some critics say that Wattpad's generally chipper feedback doesn't push writers to improve. (Todd herself winces when she looks back at her early work. “I'm very excited to edit it,” she says dryly.) But I'm a romantic about creativity. I like anything that encourages people to hit the keyboard—even the one in their pocket. The audience awaits.
english
<reponame>CESARBR/opencensus-website --- title: "Stackdriver (Tracing)" date: 2018-07-22T23:47:14-07:00 draft: false weight: 3 --- ![](/images/logo_gcp_vertical_rgb.png) - [Introduction](#introduction) - [Installing the exporter](#installing-the-exporter) - [Creating the exporter](#creating-the-exporter) - [Viewing your metrics](#viewing-your-metrics) - [Viewing your traces](#viewing-your-traces) - [References](#references) ## Introduction Stackdriver Trace is a distributed tracing system that collects latency data from your applications and displays it in the Google Cloud Platform Console. You can track how requests propagate through your application and receive detailed near real-time performance insights. Stackdriver Trace automatically analyzes all of your application's traces to generate in-depth latency reports to surface performance degradations, and can capture traces from all of your VMs, containers, or Google App Engine projects. OpenCensus Node.js has support for this exporter available, distributed through NPM package [@opencensus/exporter-stackdriver](https://www.npmjs.com/package/@opencensus/exporter-stackdriver) {{% notice tip %}} For assistance setting up Stackdriver, [Click here](/codelabs/stackdriver) for a guided codelab. {{% /notice %}} ## Installing the exporter Install OpenCensus Stackdriver Exporter with: {{<highlight bash>}} npm install @opencensus/nodejs npm install @opencensus/exporter-stackdriver {{</highlight>}} ## Creating the exporter To create the exporter, you'll need to: * Have a GCP Project ID * Have already enabled [Stackdriver Tracing](https://cloud.google.com/trace/docs/quickstart), if not, please visit the [Code lab](/codelabs/stackdriver) * Enable your [Application Default Credentials](https://cloud.google.com/docs/authentication/getting-started) for authentication with: {{<highlight bash>}} export GOOGLE_APPLICATION_CREDENTIALS=path/to/your/credential.json {{</highlight>}} To create the exporter, in code: {{<highlight javascript>}} var tracing = require('@opencensus/nodejs'); var stackdriver = require('@opencensus/exporter-stackdriver'); // Add your project id to the Stackdriver options var exporter = new stackdriver.StackdriverTraceExporter({projectId: "your-project-id"}); tracing.registerExporter(exporter).start(); {{</highlight>}} ## Viewing your traces Please visit [https://console.cloud.google.com/traces/traces](https://console.cloud.google.com/traces/traces) ## References Resource|URL ---|--- NPM: @opencensus/exporter-stackdriver|https://www.npmjs.com/package/@opencensus/exporter-stackdriver NPM: @opencensus/nodejs|https://www.npmjs.com/package/@opencensus/nodejs Github: OpenCensus for Node.js|https://github.com/census-instrumentation/opencensus-node/tree/master/packages/opencensus-nodejs
markdown
Don’t Miss Out on the Latest Updates. Subscribe to Our Newsletter Today! Class 12 Board Exam 2021: With no verdict from the government on the Class 12 board exams 2021, students have been left bereft with uncertainty, still hoping that the Education Ministry and CBSE decide to cancel exams amid the coronavirus pandemic. At a time like this, Congress General Secretary Priyanka Gandhi Vadra wrote a letter to Education Minister Ramesh Pokhriyal ‘Nishank’ questioning the need to hold board exams and subject thousands of students to the risk of coronavirus. Gandhi also shared the suggestions she received from several students and parents who had interacted with her on the matter in the past few days and noted it is ‘cruel and heartless to expect children not only to study and perform well in the board exams but even more so to subject themselves to crowded exam centres at which there is no guarantee for their health and safety’. To understand better what students want, India. com conducted a poll on Twitter asking users what they consider best for the students. So far, more than 90 per cent of the Twitter audience agree that children will be subjected to great injustice if they are pushed into giving board exams this year. Click on the Twitter post below to submit your vote. Meanwhile, Prime Minister Narendra Modi will chair an important meeting regarding Class 12 Board Examinations this evening, government sources told ANI. He will be briefed on all possible options, as a result of the extensive discussions with all states and other stakeholders. For breaking news and live news updates, like us on Facebook or follow us on Twitter and Instagram. Read more on Latest Exams & Results News on India. com.
english
<filename>tabs/child-navs/AppModule.ngfactory.d.ts /** * This file is generated by the Angular 2 template compiler. * Do not edit. */ import * as import0 from '@angular/core/src/linker/ng_module_factory'; import * as import1 from './AppModule'; import * as import41 from '@angular/core/src/di/injector'; import * as import67 from '@angular/core/src/linker/view'; import * as import68 from '@angular/core/src/linker/element'; import * as import69 from '@angular/core/src/linker/view_utils'; import * as import72 from '@angular/core/src/linker/component_factory'; export declare const AppModuleNgFactory: import0.NgModuleFactory<import1.AppModule>; export declare const Tab1NgFactory: import72.ComponentFactory<import1.Tab1>; export declare function viewFactory_Tab10(viewUtils: import69.ViewUtils, parentInjector: import41.Injector, declarationEl: import68.AppElement): import67.AppView<import1.Tab1>; export declare const Tab2NgFactory: import72.ComponentFactory<import1.Tab2>; export declare function viewFactory_Tab20(viewUtils: import69.ViewUtils, parentInjector: import41.Injector, declarationEl: import68.AppElement): import67.AppView<import1.Tab2>; export declare const Tab3NgFactory: import72.ComponentFactory<import1.Tab3>; export declare function viewFactory_Tab30(viewUtils: import69.ViewUtils, parentInjector: import41.Injector, declarationEl: import68.AppElement): import67.AppView<import1.Tab3>; export declare const SecondPageNgFactory: import72.ComponentFactory<import1.SecondPage>; export declare function viewFactory_SecondPage0(viewUtils: import69.ViewUtils, parentInjector: import41.Injector, declarationEl: import68.AppElement): import67.AppView<import1.SecondPage>; export declare const ThirdPageNgFactory: import72.ComponentFactory<import1.ThirdPage>; export declare function viewFactory_ThirdPage0(viewUtils: import69.ViewUtils, parentInjector: import41.Injector, declarationEl: import68.AppElement): import67.AppView<import1.ThirdPage>; export declare const FourthPageNgFactory: import72.ComponentFactory<import1.FourthPage>; export declare function viewFactory_FourthPage0(viewUtils: import69.ViewUtils, parentInjector: import41.Injector, declarationEl: import68.AppElement): import67.AppView<import1.FourthPage>; export declare const TabsPageNgFactory: import72.ComponentFactory<import1.TabsPage>; export declare function viewFactory_TabsPage0(viewUtils: import69.ViewUtils, parentInjector: import41.Injector, declarationEl: import68.AppElement): import67.AppView<import1.TabsPage>; export declare const E2EAppNgFactory: import72.ComponentFactory<import1.E2EApp>; export declare function viewFactory_E2EApp0(viewUtils: import69.ViewUtils, parentInjector: import41.Injector, declarationEl: import68.AppElement): import67.AppView<import1.E2EApp>;
typescript
Hyderabad: A five-year-old girl was raped by her neighbour on Saturday in Hyderabad. The accused has been arrested, according to the police. The minor, hailing from Nepal, was admitted to a hospital and later discharged once the hospital confirmed her as stable and out of danger. The girl's father is a security guard in Hyderabad. "He (accused) committed rape on a minor girl and the parents lodged a complaint. We arrested him and he will be presented before the magistrate," Deputy Commissioner of Police Yoganand said. Commenting on the minor's health, the DCP said the police is still awaiting the full medical opinion from the doctors, but the girls seems to be out of danger and is stable.
english
{"class":"DepictionStackView","tintColor":"#55c6d3","title":"Contact Support","views":[{"class":"DepictionMarkdownView","markdown":"If you need help with \"4Ders\", you can contact Ginsu, the developer, via e-mail."},{"class":"DepictionTableButtonView","title":"Email Developer","action":"mailto:<EMAIL>","openExternal":"true","tintColor":"#55c6d3"},{"class":"DepictionMarkdownView","markdown":"You can also contact Ginsu using the following sites:"},{"class":"DepictionTableButtonView","title":"Twitter","action":"https://twitter.com/ginsudev","openExternal":"true","tintColor":"#55c6d3"},{"class":"DepictionTableButtonView","title":"Discord","action":"https://discord.com/invite/BhdUyCbgkZ","openExternal":"true","tintColor":"#55c6d3"},{"class":"DepictionTableButtonView","title":"Website","action":"https://ginsu.dev","openExternal":"true","tintColor":"#55c6d3"},{"class":"DepictionMarkdownView","markdown":"Ginsu is the maintainer of the package \"4Ders\". Please contact them via email for any questions on this version of the package."},{"class":"DepictionTableButtonView","title":"Email Maintainer","action":"mailto:<EMAIL>","openExternal":"true","tintColor":"#55c6d3"},{"class":"DepictionMarkdownView","markdown":"If you found a mistake in the depiction or cannot download the package, you can reach out to the maintainer of the \"Ginsu Tweaks\" repo, Noah."},{"class":"DepictionTableButtonView","title":"Email Repo Maintainer","action":"mailto:<EMAIL>","openExternal":"true","tintColor":"#55c6d3"},{"class":"DepictionMarkdownView","markdown":"You can also contact the repo owner via the following sites:"},{"class":"DepictionTableButtonView","title":"Twitter","action":"https://twitter.com/ginsudev","openExternal":"true","tintColor":"#55c6d3"},{"class":"DepictionTableButtonView","title":"Discord","action":"https://discord.com/invite/BhdUyCbgkZ","openExternal":"true","tintColor":"#55c6d3"}]}
json
KPCC chief DKS also announced that a total of 100 congress MLAs and MLCs will paste the ‘PayCM’ posters across the city on Friday. Karnataka Congress chief DK Shivakumar has called for a protest on Friday against the ruling BJP government after the arrests of congress workers over the ‘PayCM’ posters that came up across the city on Wednesday. He also announced that a total of 100 congress MLAs and MLCs will paste the ‘PayCM’ posters across the city on Friday. After ‘PayCM’ posters cropped up in a few areas of Bengaluru on Wednesday, CM Bommai ruled out the move as a conspiracy to malign the image of Karnataka. “They are doing negative publicity on social media without any basis. Such systematic conspiracies are going on to defame me and the name of the state. I have instructed the concerned authorities to register a case and conduct a comprehensive investigation to find out who is behind this,” said CM Bommai on Thursday. The QR code that was used on these posters directs to the ‘40 percent sarkara’ website launched by the state Congress unit to address the grievances against corrupt leaders and officials.
english
{"name":"OSFIT","harga":" Rp. 108.900/ kemasan","golongan":"http://medicastore.com/image_banner/obat_bebas.gif","kandungan":"Ca karbonat 625 mg, Vit D3 100 ui, Mg Oksida 125 mg, Boron sitrat 13.9 mg, Zn sulfat monohidrat 10.3 mg, Kuprat sulfat 2 mg, kromium pikolinat 100.5 mcg, asam folat 100 mcg, Vit B6 2.5 mg, Vit B12 7.5 mcg, Silika 5 mg.","indikasi":"Suplemen untuk mempertahankan kesehatan tulang dan mengurangi risiko osteoporosis.","kontraindikasi":"","perhatian":"Interaksi Obat: Levodopa dan fenobarbital, neomisin, asam aminosalisilat, antagonis reseptor H2, kolkisin, suplemen Zn, antibiotik, suplemen Fe lainnya, kafein.","efeksamping":"","indeksamanwanitahamil":"","kemasan":"Kaplet 60 biji.","dosis":"Dua kaplet dua kali sehari.","penyajian":"Dikonsumsi bersamaan dengan makanan","pabrik":"<NAME>.","id":"10320","category_id":"11"}
json
8 So the Lord God says: “Because you have spoken false words and seen a lie, I am against you,” says the Lord God. 9 “My hand will be against those who see false dreams and speak false words. They will have no place in the gathering of My wise people. Their names will not be written down with the people of Israel. And they will not go into the land of Israel. Then you will know that I am the Lord God. 10 Because they have led My people the wrong way by saying, ‘Peace,’ when there is no peace, and because, when anyone builds a bad wall, they cover it with whitewash, 11 tell those who cover it with whitewash that it will fall! A flood of rain will come, and large hailstones will fall. And a strong wind will break out. 12 When the wall has fallen, will you not be asked, ‘Where is the covering you used to cover the wall?’” 13 So the Lord God says, “I will make a strong wind break out in My anger. There will also be a flood of rain in My anger, and large hailstones to destroy that wall. 14 I will break down the wall that you covered with whitewash. I will bring it down to the ground so that its base will be showing. And when it falls, you will be destroyed with it. Then you will know that I am the Lord. 15 I will send My anger upon the wall and upon those who have covered it with whitewash. And I will say to you, ‘The wall is gone and the ones who covered it are gone. 16 There are no more people of Israel who speak false words to Jerusalem in My name, and who see dreams of peace for her when there is no peace,’ says the Lord God. 13 The word of the Lord came to me: 2 “Son of man, prophesy against the prophets(A) of Israel who are now prophesying. Say to those who prophesy out of their own imagination:(B) ‘Hear the word of the Lord!(C) 3 This is what the Sovereign Lord says: Woe to the foolish[a] prophets(D) who follow their own spirit and have seen nothing!(E) 4 Your prophets, Israel, are like jackals among ruins. 5 You have not gone up to the breaches in the wall to repair(F) it for the people of Israel so that it will stand firm in the battle on the day of the Lord.(G) 6 Their visions are false(H) and their divinations a lie. Even though the Lord has not sent(I) them, they say, “The Lord declares,” and expect him to fulfill their words.(J) 7 Have you not seen false visions(K) and uttered lying divinations when you say, “The Lord declares,” though I have not spoken? 8 “‘Therefore this is what the Sovereign Lord says: Because of your false words and lying visions, I am against you,(L) declares the Sovereign Lord. 9 My hand will be against the prophets who see false visions and utter lying(M) divinations. They will not belong to the council of my people or be listed in the records(N) of Israel, nor will they enter the land of Israel. Then you will know that I am the Sovereign Lord.(O) 17 “Now, son of man, set your face(AC) against the daughters(AD) of your people who prophesy out of their own imagination. Prophesy against them(AE) 18 and say, ‘This is what the Sovereign Lord says: Woe to the women who sew magic charms on all their wrists and make veils of various lengths for their heads in order to ensnare people. Will you ensnare the lives of my people but preserve your own? 19 You have profaned(AF) me among my people for a few handfuls of barley and scraps of bread.(AG) By lying to my people, who listen to lies, you have killed those who should not have died and have spared those who should not live.(AH) Copyright © 1969, 2003 by Barbour Publishing, Inc. Holy Bible, New International Version®, NIV® Copyright ©1973, 1978, 1984, 2011 by Biblica, Inc.® Used by permission. All rights reserved worldwide. NIV Reverse Interlinear Bible: English to Hebrew and English to Greek. Copyright © 2019 by Zondervan.
english
{"id": "CSB353H1S20201", "code": "CSB353H1S", "name": "Plant-Microorganism Interactions and Plant Immunity", "description": "Plants have co-evolved with microbes ever since their first appearance on land, resulting in sophisticated strategies of pathogenicity, symbiosis, commensalisms and mutualism. This course presents an overview of these strategies with examples of bacteria, fungi, oomycetes and viruses that have evolved intimate associations with plants, and discusses plant immune systems.", "division": "Faculty of Arts and Science", "department": "Cell and Systems Biology", "prerequisites": "BIO230H1/BIO255H1", "exclusions": "CSB452H1", "level": 300, "campus": "UTSG", "term": "2020 Winter", "breadths": [4], "meeting_sections": [{"code": "L0101", "instructors": ["<NAME>"], "times": [{"day": "THURSDAY", "start": 54000, "end": 61200, "duration": 7200, "location": "SS 2117"}], "size": 150, "enrolment": 150}]}
json
Ted DiBiase Sr. made several WWE NXT appearances in 2021 as part of a storyline involving Cameron Grimes and LA Knight. During a recent podcast, the WWE Hall of Famer confirmed that Grimes' on-screen persona is more than just a gimmick. Grimes, who moved to SmackDown in the 2023 WWE Draft, reinvented his character in February 2021. The 29-year-old dubbed himself "the richest man in NXT" and bragged about his success in the stock market. He also began using the catchphrase, "To the moon!" On Everybody's Got A Pod, DiBiase Sr. said Grimes really did make a lot of money through investing: DiBiase Sr. was one of WWE's biggest names in the late 1980s and early 1990s. His rich character, known as The Million Dollar Man, was based on WWE Executive Chairman Vince McMahon. In 2021, Cameron Grimes discussed the progression of his character on Corey Graves' After The Bell podcast. He explained how his popular catchphrase, "To the moon!" is based on something people say in the stock market. The new SmackDown star recalled how fans online connected with the phrase, which encouraged him to say it more often: "I got into the stock market a little over a year ago," Grimes said. "And in stocks, 'To the moon!' is a big thing, because everybody wants money. And everybody wants to put money in something and watch that money go to the moon. So then I just started using it. And I used it one time, and it was another one of those things where someone did, 'To the moon!' [online]. I was like, 'Well, I've got something again here.'" (H/T 411mania) Grimes has recorded wins over Baron Corbin and Hit Row's Ashante Adonis since leaving NXT for SmackDown in May. What would you like to see next from Cameron Grimes? Let us know in the comments section below. Please credit Everybody's Got A Pod and give a H/T to Sportskeeda Wrestling for the transcription if you use the first set of quotes from this article.
english
Remote Desktop Control is an amazing, trial version Windows software, that is part of the category Networking software with subcategory Remote access. Having started its journey as an anti-rootkit application, UnHackMe is a software tool that helps you get rid of various malicious software from your computer. XSearch is an awesome, free Windows program, belonging to the category Software utilities with subcategory Files (more specifically Search Utilities). ProAm - Slow Motion Studio is a high-speed, inexpensive camera software system that can capture slow motion video up to 125fps. Macro PC Cleaner is a computer cleanup and performance increase software that keeps your PC running in tip-top shape.
english
<gh_stars>1-10 { "name": "@here/azure-servicebus-queue-trigger-functions", "version": "1.0.0", "private": true, "description": "Azure Serverless ServiceBus QueueTrigger Functions for HERE Location Suite APIs", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": { "name": "HERE Europe B.V.", "url": "https://here.com" }, "repository": { "type": "git", "url": "https://github.com/heremaps/here-azure-serverless.git", "directory": "code/hlsTemplateWebAppBackend" }, "keywords": [ "HERE Technologies", "ServiceBus", "Queue Trigger", "here", "Location", "Geocoder", "Routing", "Positioning", "Map", "Image", "Tile", "Fleet", "Telematics" ], "engines": { "node": "10.14.1" }, "dependencies": { "@azure/cosmos": "^2.1.2", "axios": "^0.18.1", "body-parser": "^1.18.3", "header-case-normalizer": "^1.0.3" }, "license": "Apache-2.0" }
json
<gh_stars>10-100 [ { "title": "frank-lam/2019_campus_apply", "url": "https://github.com/frank-lam/2019_campus_apply" }, { "title": "jantic/DeOldify", "url": "https://github.com/jantic/DeOldify", "lang": "JupyterNotebook" }, { "title": "scutan90/DeepLearning-500-questions", "url": "https://github.com/scutan90/DeepLearning-500-questions", "lang": "TeX" }, { "title": "GoogleChromeLabs/carlo", "url": "https://github.com/GoogleChromeLabs/carlo", "lang": "JavaScript" }, { "title": "deeppomf/DeepCreamPy", "url": "https://github.com/deeppomf/DeepCreamPy", "lang": "Python" }, { "title": "akveo/eva-icons", "url": "https://github.com/akveo/eva-icons", "lang": "TypeScript" }, { "title": "google-research/bert", "url": "https://github.com/google-research/bert", "lang": "Python" }, { "title": "rodrigo-brito/gocity", "url": "https://github.com/rodrigo-brito/gocity", "lang": "Go" }, { "title": "geekcomputers/Python", "url": "https://github.com/geekcomputers/Python", "lang": "Python" }, { "title": "glorious-codes/glorious-demo", "url": "https://github.com/glorious-codes/glorious-demo", "lang": "JavaScript" }, { "title": "Tencent/PocketFlow", "url": "https://github.com/Tencent/PocketFlow", "lang": "Python" }, { "title": "daviddao/awful-ai", "url": "https://github.com/daviddao/awful-ai" }, { "title": "leonardomso/33-js-concepts", "url": "https://github.com/leonardomso/33-js-concepts", "lang": "JavaScript" }, { "title": "wizicer/FinancialSupportForOpenSource", "url": "https://github.com/wizicer/FinancialSupportForOpenSource" }, { "title": "EventStore/EventStore", "url": "https://github.com/EventStore/EventStore", "lang": "C#" }, { "title": "justjavac/free-programming-books-zh_CN", "url": "https://github.com/justjavac/free-programming-books-zh_CN", "lang": "JavaScript" }, { "title": "dipakkr/A-to-Z-Resources-for-Students", "url": "https://github.com/dipakkr/A-to-Z-Resources-for-Students" }, { "title": "bgard6977/depends", "url": "https://github.com/bgard6977/depends", "lang": "Kotlin" }, { "title": "Snailclimb/JavaGuide", "url": "https://github.com/Snailclimb/JavaGuide", "lang": "Java" }, { "title": "airbnb/AloeStackView", "url": "https://github.com/airbnb/AloeStackView", "lang": "Swift" }, { "title": "muukii/Pixel", "url": "https://github.com/muukii/Pixel", "lang": "Swift" }, { "title": "kamranahmedse/pennywise", "url": "https://github.com/kamranahmedse/pennywise", "lang": "JavaScript" }, { "title": "chunqiuyiyu/ervy", "url": "https://github.com/chunqiuyiyu/ervy", "lang": "JavaScript" }, { "title": "ChrisKnott/Algojammer", "url": "https://github.com/ChrisKnott/Algojammer", "lang": "C++" }, { "title": "vuejs/vue", "url": "https://github.com/vuejs/vue", "lang": "JavaScript" } ]
json
import {Entity, Column, PrimaryGeneratedColumn, OneToOne} from "typeorm"; import { Zone } from "./zone.entity"; @Entity("Soil") export class Soil { @PrimaryGeneratedColumn() id: number; @Column() name: string; @OneToOne(_type => Zone, zone => zone.soil) zone: Zone; }
typescript
<gh_stars>100-1000 //package com.ray.library.zxinglibrary; // //import android.content.Context; //import android.content.Intent; //import android.os.AsyncTask; //import android.os.Bundle; //import android.os.Vibrator; //import android.text.TextUtils; //import android.view.View; //import android.view.ViewGroup; //import android.widget.ImageView; //import android.widget.LinearLayout; //import android.widget.TextView; //import android.widget.T; // //import com.luckytry.mipai.R; //import com.luckytry.mipai.base.ui.BaseActivity; //import com.luckytry.mipai.imgseletor.MultiImageSelector; //import com.luckytry.mipai.imgseletor.MultiImageSelectorActivity; //import com.luckytry.mipai.ui.home.activity.ScanResultActivity; //import com.luckytry.mipai.utils.L; // //import java.util.List; // //import butterknife.BindView; //import butterknife.ButterKnife; //import butterknife.OnClick; //import cn.bingoogolapple.qrcode.core.QRCodeView; //import cn.bingoogolapple.qrcode.zbar.ZBarView; //import cn.bingoogolapple.qrcode.zxing.QRCodeDecoder; // //public class CaptureActivity extends BaseActivity implements QRCodeView.Delegate { // private static final String TAG = "CaptureActivity"; // private static final int CHOICE_PIC=1; // // @BindView(R.id.tv_title) // TextView tvTitle; // @BindView(R.id.tv_action) // TextView tvAction; // @BindView(R.id.zxingview) // ZBarView mQRCodeView; // @BindView(R.id.liner_scan_phone) // LinearLayout liner_phone; // @BindView(R.id.liner_scan_client) // LinearLayout liner_client; // @BindView(R.id.liner_qr_mine) // LinearLayout liner_qr; // @BindView(R.id.qr_mine) // ImageView img_qr; // // public static void start(Context context) { // Intent i = new Intent(context, CaptureActivity.class); // context.startActivity(i); // } // // // @Override // protected int inflateContentView() { // return R.layout.activity_capture2; // } // // @Override // protected void initPresenter() { // // } // // @Override // protected void initView(Bundle savedInstanceState) { // ButterKnife.bind(this); // tvTitle.setText(R.string.scan_title); // tvAction.setText(R.string.scan_action); // setSelect(liner_phone,true); // mQRCodeView.setDelegate(this); // } // // @Override // protected void initEvents() { // //TOdo 待实现 餐机扫APP内二维码 // /* QRCodeUtil.createQRImage(this, takeQr, new Handler(new Handler.Callback() { // @Override // public boolean handleMessage(Message msg) { // if(msg.what==TAKE_QR_CODE){ // GlideUtils.load(CaptureActivity.this, QRCodeUtil.QR_PATH, img_qr); // } // return false; // } // }),TAKE_QR_CODE, QRCodeUtil.QR_PATH);*/ // } // // private void setSelect(ViewGroup viewGroup, boolean isSelected){ // for (int i = 0; i < viewGroup.getChildCount(); i++) { // viewGroup.getChildAt(i).setSelected(isSelected); // } // } // // // @OnClick({R.id.img_back, R.id.tv_action, R.id.liner_scan_phone,R.id.liner_scan_client}) // public void onViewClicked(View view) { // switch (view.getId()) { // case R.id.img_back: // finish(); // break; // case R.id.tv_action: // MultiImageSelector.create().single().start(this,CHOICE_PIC); // break; // case R.id.liner_scan_phone: // liner_qr.setVisibility(View.GONE); // mQRCodeView.setVisibility(View.VISIBLE); // setSelect(liner_phone,true); // setSelect(liner_client,false); // break; // case R.id.liner_scan_client: // liner_qr.setVisibility(View.VISIBLE); // mQRCodeView.setVisibility(View.GONE); // setSelect(liner_client,true); // setSelect(liner_phone,false); // break; // } // } // // @Override // protected void onStart() { // super.onStart(); // mQRCodeView.startCamera(); //// mQRCodeView.startCamera(Camera.CameraInfo.CAMERA_FACING_FRONT); // mQRCodeView.showScanRect(); // } // // // @Override // protected void onResume() { // super.onResume(); // mQRCodeView.startSpot(); // } // // @Override // protected void onStop() { // mQRCodeView.stopCamera(); // super.onStop(); // } // // @Override // protected void onDestroy() { // mQRCodeView.onDestroy(); // super.onDestroy(); // } // // private void vibrate() { // Vibrator vibrator = (Vibrator) getSystemService(VIBRATOR_SERVICE); // vibrator.vibrate(200); // } // // @Override // public void onScanQRCodeSuccess(String result) { // vibrate(); // mQRCodeView.startSpot(); // if (result.equals("")) { // T.makeText(CaptureActivity.this, "Scan failed!", T.LENGTH_SHORT).show(); // } else { // L.v(TAG,result); // ScanResultActivity.dealScanResult(this,result); // } // } // // @Override // public void onScanQRCodeOpenCameraError() { // L.e(TAG, "打开相机出错"); // } // // @Override // protected void onActivityResult(int requestCode, int resultCode, Intent data) { // super.onActivityResult(requestCode, resultCode, data); // if (requestCode == CHOICE_PIC && resultCode == RESULT_OK&&data!=null) { // List<String> mSelected =data.getStringArrayListExtra(MultiImageSelectorActivity.EXTRA_RESULT); // if (mSelected != null && mSelected.size() > 0) { // String url = mSelected.get(0); //// url="file://"+url; //// Bitmap barcode = BitmapFactory.decodeFile(url); // decodePicTask(url); // } // } // } // // private void decodePicTask(String picturePath){ // new DecodePicTask().execute(picturePath); // } // // private class DecodePicTask extends AsyncTask<String, Void, String> { // // @Override // protected String doInBackground(String... params) { // return QRCodeDecoder.syncDecodeQRCode(params[0]); //// return ""; // } // // @Override // protected void onPostExecute(String result) { // if (TextUtils.isEmpty(result)) { // T.makeText(CaptureActivity.this, "未发现二维码", T.LENGTH_SHORT).show(); // } else { // onScanQRCodeSuccess(result); // } // } // } //}
java
<reponame>allengwang/dianping-zebra<filename>zebra-api/src/main/java/com/dianping/zebra/group/monitor/GroupDataSourceMBean.java<gh_stars>1-10 package com.dianping.zebra.group.monitor; import com.dianping.zebra.group.config.datasource.entity.GroupDataSourceConfig; import java.util.Map; public interface GroupDataSourceMBean { public Map<String, SingleDataSourceMBean> getReaderSingleDataSourceMBean(); public SingleDataSourceMBean getWriteSingleDataSourceMBean(); public GroupDataSourceConfig getConfig(); }
java
Some trees are up to speed with dropping their leaves. Others are still hanging on, pretending that the inevitable winter season is not anywhere near. I guess people are just like that. Some seem to always be ready and on time when the seasons in their lives are changing. They are making room for next chapter, getting rid of old stuff they won’t need. Others, on the other hand, are waiting for the last minute, trying to embrace all the little moments before change, gathering last memories and souvenirs to hopefully take with when they will have to transition to the unknown.
english
The post How to Activate VET TV App on Xbox, Roku, Android TV appeared first on World Republic News. Veteran Entertainment Television, better known as VET TV, is an American vertically integrated OTT media service that specializes in “the production and distribution of comedy films and military television series, with the primary audience being the military and veteran community”. Today, VET TV is widely recognized for its original series and episodes such as Kill, Die, Laugh (2017), A Grunt’s Life (2017), The Let Down (2017), Meanwhile in the Barracks (2018), and Department of Offense (2018). If the Activation of the VET TV service via veterantv.tv/activate is something you’re eagerly looking forward to, rest assured that your favorite shows can be enjoyed on a larger screen. If you have a compatible Roku device, you can easily get started with the remarkable VET Tv programs. Follow these simple steps to activate VET Tv on Roku: - Boot up your Roku device to begin. - Press the Home icon or button on the Roku remote to access the home screen. - Navigate to the “Streaming Channels” option. - Select “Search channels” from the available options. - Use the on-screen instructions to type “VET television” in the search bar. - Locate the Veteran TV app on the screen. - Return to the home screen and find the installed app. - Open the app and enter your credentials. - Write down the provided activation code and use a separate device to visit the activation page – veterantv.tv/activate. If prompted, provide your login information if you haven’t logged in already. - Enter the activation code on the activation page. - Click “Activate” to complete the process. The VET Tv channel will load. Then, within moments, your Roku device will start streaming the popular programs. To watch VET Tv programs on your Xbox console, follow these steps: - Turn on your device and ensure it is connected to a high-speed internet connection. - Select the “Xbox app store” from the home screen. - Follow the on-screen instructions and search for “VET television”. - When the Veteran TV app appears, click “Download” to add the channel to your device. - Return to the home screen and launch the VET TV app. - The app will provide you with an activation code. Keep your login credentials handy as you will need them. - Save the activation code or keep the screen visible. - Access veterantv.tv/activate on another device connected to the same Wi-Fi network. - Enter the activation code and click the “Activate” button. - The VET Tv app will load and be ready to stream your favorite shows. Enjoy watching VET Tv on the big screen with your Xbox console! If you have an Android TV and need to activate the VET TV app, follow these simple steps: - Turn on your Android TV device to begin the activation process. - From the home screen, navigate to the “play store” application. - Locate the VET Television app by either searching or using the virtual keyboard to type its name. - Click the “Install” button to download and install the app. - Once installed, open the app and enter your credentials. - Click the “IDENTIFY” button to proceed. - You will receive an activation code, so take note of it along with the activation link. - On your computer or mobile phone, open a browser and go to veterantv.tv/activate. - Enter the activation code and, if necessary, your login credentials. - Click the “Activate” button to complete the activation process. After successful activation, you can start enjoying your favorite programs on VET Tv. If you encounter any technical difficulties or errors, you can troubleshoot them on your own or seek assistance from industry-trained professionals available 24/7. Don’t forget to register on VET Tv to join over 90,000 veterans and access all programs. Activate the VET Tv service and start watching your favorite veteran TV programs today! The post How to Activate VET TV App on Xbox, Roku, Android TV appeared first on World Republic News. The post How to Activate VET TV App on Xbox, Roku, Android TV has original source from World Republic News. How to Activate VET TV App on Xbox, Roku, Android TV was first posted on July 18, 2023 at 8:12 am.
english
{ "request" : { "url" : "/api/v1/users/00ucxvarj3CeuPe9B4h6/factors/uftcxwq29yX8VHljJ4h6/lifecycle/activate", "method" : "POST", "bodyPatterns" : [ { "equalToJson" : "{\"passCode\":\"807848\"}", "ignoreArrayOrder" : true, "ignoreExtraElements" : true } ] }, "response" : { "status" : 200, "body" : "{\"id\":\"uftcxwq29yX8VHljJ4h6\",\"factorType\":\"token:software:totp\",\"provider\":\"GOOGLE\",\"vendorName\":\"GOOGLE\",\"status\":\"ACTIVE\",\"created\":\"2021-06-14T23:09:39.000Z\",\"lastUpdated\":\"2021-06-14T23:09:40.000Z\",\"profile\":{\"credentialId\":\"<EMAIL>\"},\"_links\":{\"self\":{\"href\":\"https://hhs-prime.okta.com/api/v1/users/00ucxvarj3CeuPe9B4h6/factors/uftcxwq29yX8VHljJ4h6\",\"hints\":{\"allow\":[\"GET\",\"DELETE\"]}},\"verify\":{\"href\":\"https://hhs-prime.okta.com/api/v1/users/00ucxvarj3CeuPe9B4h6/factors/uftcxwq29yX8VHljJ4h6/verify\",\"hints\":{\"allow\":[\"POST\"]}},\"user\":{\"href\":\"https://hhs-prime.okta.com/api/v1/users/00ucxvarj3CeuPe9B4h6\",\"hints\":{\"allow\":[\"GET\"]}}}}" } }
json
Charges of etc. against [Shri Jyotirmoy Bosu] duced for the balance of Rs. 1,85,58,569.20. The Samaj has taken the stand before the Commission that the accounts of the Kosi project are outside the jurisdiction of this Commission. The Commission has discussed the question of jurisdiction at another place but suffice it to mention here that it is rather surprising that a society registered under the Societies Registration Act should have had no accounts for such large amounts. This is irrepsective of whether this Commission can examine those accounts or not. This evidence on the record of the Central Bharat Sevak Samaj also shows that they could not obtain the accounts of the Kosi unit even in 1962 or later. "If the Central Samaj claims credit for Kosi works, it should at least possess complete accounts." And that is under the convenership of Shri Lalit Narain Mishra. Shri Mishra does not even fight the Bihar Government audit. I will read out. He was opposed to auditing by Bihar Government. This is a letter written to Shri Binodanandan Jha on 9th November, 1961 by Shri L. N. Mishra, Deputy Minister, Labour, Employment and Planning of the Government of India. I quote: "On 9th November, 1961 Mr. L. N. Mishra, Deputy Minister, Labour, Employment & Planning of the Government of India also wrote to the Chief Minister that the Fund did not belong to the Government, that it was neither a grant nor a loan nor a subsidy given by the Government of India to the Bharat Sevak Samaj and that this was 100 per cent B.S.S. money earned by it. He contended that neither the Kosi Project nor any governmental agency had any right over monies of the Samaj. To quote his letter-" To that, this is the letter from which I am quoting another paragraph. This is from Shri L. N. Mishra to the Chief Shri 1. N. Mishra (M) Minister of Bihar Shri Binodanandan Jha: "It will not be proper and fair for the Government to take upon itself } the work of audit of the accounts of an independent organisation like the Bharat Sevak Samaj". Kosi Project or any Governmental Agency have no right in any of these accounts. To this he says: "Thus, the Bihar Unit of the Bharat Sevak Samaj neither submitted its accounts to the Bihar Government nor to this Commission on the ostensible plea that the money was its own and in the latter case that it was outside the jurisdiction of this Commission. So, in either case, there was a refusal to have the accounts checked up although these were the moneys, to say the least, placed with the Bihar Government, in trust for being expended for specific objects. Even the parent body, the Central Bharat Sevak Samaj, made vain efforts to get accounts from the Kosi Unit and they were put off by the latter." Now I come back to some other things. Here it is said-page 99, Vol. XI, para 29.101: "On February 7, 1956 this clause was amended the effect of which was that the whole amount was to be treated as community savings". hen, Sir, it says: a very interesting para"90 per cent of the value of the work executed will only be paid to the Unit Leader and the balance of value of work done will be deemed to have been surrendered to the Government. The latter amount wil be kept in deposit with the Government which will be spent on organisational expenditure of the Bharat Sevak Samaj and community development in a manner to be settled mutually between the Government and the Bharat Sevak Samaj. The Unit Leader shall not lay claim to the said amount kept in deposit and
english
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> <meta name="description" content=""> <meta name="author" content=""> <link rel="icon" href="../../favicon.ico"> <title>Starter Template for Bootstrap</title> <!-- Bootstrap core CSS --> <link href="css/bootstrap.min.css" rel="stylesheet"> <!-- IE10 viewport hack for Surface/desktop Windows 8 bug --> <link href="css/ie10-viewport-bug-workaround.css" rel="stylesheet"> <!-- Custom styles for this template --> <link href="css/starter-template.css" rel="stylesheet"> <!-- Just for debugging purposes. Don't actually copy these 2 lines! --> <!--[if lt IE 9]><script src="js/ie8-responsive-file-warning.js"></script><![endif]--> <script src="js/ie-emulation-modes-warning.js"></script> <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <nav class="navbar navbar-inverse navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#">Mixed Race USA</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li class="active"><a href="#">Home</a></li> <li><a href="#about">About</a></li> <li><a href="#contact">Contact</a></li> </ul> </div><!--/.nav-collapse --> </div> </nav> <h4>A Changing Demographic?</h4> <div class="container"> <div class="starter-template"> <br> <br> <h1>A Changing Demographic?</h1> <br> <h3><i> Which states have the highest population percentages <br> of people who categorize themselves as mixed race? </i></h3> <br> <p class = "lead"> Use the zoom in and zoom out features below to explore <br> a "heat map" showing which states have the highest percentages <br> of mixed race folks. Click on each state for actual percentages.<br> Don't forget Alaska, Hawaii, and Puerto Rico! Below the map,<br> I explore some related questions to this main question and map.</p> <br> <iframe width="500" height="300" scrolling="no" frameborder="no" src="https://fusiontables.google.com/embedviz?q=select+col0%3E%3E0+from+1pdZmVLFqMFgeVmv7uXMzl-Otm1qrSXWOudHo3tWt&amp;viz=MAP&amp;h=false&amp;lat=45.903908131663265&amp;lng=-115.61216937499995&amp;t=1&amp;z=3&amp;l=col0%3E%3E0&amp;y=2&amp;tmplt=2&amp;hml=KML"></iframe> <p> Data source: https://en.wikipedia.org/wiki/Demography_of_the_United_States<br> Conveying USA Census Data 2010. </p> <br> <p class="lead"><b> Why do some states like Hawaii have dramatically <br> higher percentages? </b></p> <p> Though they make one United States of America, each state has its own <br> unique history. Hawaii is an exceptionally unique case. In undergrad, I <br> learned that due to its proximity to Asia, Hawaii hosted many immigrants from Asia <br> who intermarried with each other and native Hawaiians. In fact, in the 1960s, <br> anthropologists studied the people of Hawaii idealizing the strength and attractive-<br> ness of mixed race folks on the islands, which might be considered today to be <br> idealized, reductionist classifications. The Hawaiian term "hapa" means "mixed race" <br> has been adopted into English American vernacular today. <br> </p> <br> <p class="lead"><b> What exactly is mixed race? </b></p> <p> Fasciatingly, most racial categories in the US census have not been contsant<br> throughout the country's history. For example, in the cirst census in 1870, the closest<br> categorization to what today is understood as "mixed race" was "mulatto", which meant<br> black and some other race. Other cateogires in that original census were: White, Black,<br> Indian, and Chinese. Meanwhile, come 1920, census race categories were the original <br> original categories plus Japanese, Filipino, Korean, and Hindu. Today, the race categories <br> offered are even more different. For more information, you can go this interesting page<br> by the Pew Research Center: <br> <br> <a href = "http://www.pewsocialtrends.org/interactives/multiracial-timeline/">http://www.pewsocialtrends.org/interactives/multiracial-timeline/</a><br> <br> It is interesting to consider the <b> data model </b> used by US census creators <br> and the political and social goals (use goals?) behind them. Is it a structured <br> dataset since the census comes up with the model? Or is it a semistructured set since <br> people fill out which racial category to which they belong on their census forms? <br> <br> It is also worthwhile considering the human agency and inconsistency in census racial<br> categorization. For instance, a person in 1870 may have been Chinese in the eyes of <br> the US government, but come 1920, that same person may have been Filipino. <br> </p> </div><!-- /.container --> <!-- Bootstrap core JavaScript ================================================== --> <!-- Placed at the end of the document so the pages load faster --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <script>window.jQuery || document.write('<script src="js/vendor/jquery.min.js"><\/script>')</script> <script src="js/bootstrap.min.js"></script> <!-- IE10 viewport hack for Surface/desktop Windows 8 bug --> <script src="js/ie10-viewport-bug-workaround.js"></script> </body> </html>
html
<reponame>childhealth/bloodspot-fhir "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const dummy_logger_service_1 = require("../testing/dummy.logger.service"); const local_file_input_channel_1 = require("./local.file.input.channel"); describe("LocalFileInputChannel", () => { let subject; const logger = new dummy_logger_service_1.DummyLoggerService(); describe("constructor(fileUrl)", () => { it("should throw error if it fileUrl cannot be found or cannot be read.", () => { expect(() => { subject = new local_file_input_channel_1.LocalFileInputChannel("RuBbIsH-NaMe-for-a-csv", logger); }).toThrow(new Error("Input file \"RuBbIsH-NaMe-for-a-csv\" not found.")); }); it("should set outcomes if given a good fileUrl to read", () => { subject = new local_file_input_channel_1.LocalFileInputChannel("./src/testing/NBBSTestfile.csv", logger); expect(subject.outcomes.length).toEqual(53); }); }); }); //# sourceMappingURL=local.file.input.channel.spec.js.map
javascript
When an actor of the caliber of Amitabh Bachchan appears in a lead role for a movie revolving completely around him, a film lover is never more happier. Especially so, when at least 3 movies with him as the lead protagonist [Black, Waqt, Sarkar] have struck gold at the box office in quick succession. Audience, that has been fed on Big B movies for around 3 decades now, certainly do not mind seeing him week after week now. And when a movie like 'Viruddh' arrives that gives him ample scope to be seen in each and every frame of the movie, the expectations are anyways sky high. Are these gargantuan expectations met? Does the movie turn out to be as good as everyone believed it would? And the most important question - does Amitabh Bachchan himself get a chance to do something different from what he has done over the decades? Answer to all these questions is "Yes to a good extent". No doubt 'Viruddh' could easily have been a classic [which it is not], but inspite of the blemishes [mainly in the pre-climax and climax], the movie never fails to grab your attention. If only writing during some of the post-interval portions could have been power-packed, 'Viruddh' may have been a landmark film for everyone involved. Mahesh Manjrekar has always delivered whenever it comes to directing a movie depicting reality. 'Vaastav' and 'Astitva' are great examples of such attempts. With 'Viruddh', he is back in form once again after delivering so called "commercial" duds like 'Rakth' and 'Padmashree Laloo Prasad Yadav'. Vidhyadhar Patwardhan [Amitabh Bahchan] and Sumi Patwardhan [Sharmila Tagore] are a happy and content retired couple who live in their 60s-constructed bungalow. While Vidhyadhar spent his life as an airport staffer, Sumi brings home the traits of a school principal, the position she held for 15 years. They love and care for each other and their simple day to day antics are straight out of everyday. Number of such sequences are very well embedded in the script that you never once realize watching a movie that was earlier thought to be a heavy-on-heart flick. First one hour is breezy enough that makes 'Viruddh' a light hearted entertainer journey. Ace in hand during the screenplay is narration by the couple's only Amar [John Abraham], who keeps appearing in fleeting shots till he is finally introduced as a London graduated son. And along comes his British girlfriend Jenny [Anusha]. Life couldn't have been better but little did one know that this would be only short-lived. On the eve of his birthday, Amar is accidentally killed in a scuffle with the Home Minister's wayward son Harshwardhan [Amitabh Dayal, last seen in 'Kagaar' in a lead role] outside a night club. Their world is shattered and the only redemption now is to see Harsh behind the bars. But the corrupt 'system' fails to hear their voice and instead label Amar and Jenny as drug peddlers. Jenny is put behind bars and now it is upto Vidhyadhar to secure her release and prove his son and daughter-in-law's innocence. How does Vidhyadhar manage to accomplish task? Does he continue to show faith in the law and wait for justice? Does his old age allow him to battle it out under such adverse circumstances? Does his friendly neighborhood garage owner Ali [Sanjay Dutt] help him accomplish his mission? Or is he forced to take law in his own hands? Is Amar finally proved innocent?
english
<reponame>ayrtonmassey/office-ui-fabric-react { "name": "@uifabric/hooks", "version": "1.0.0", "description": "Git hooks for OUFR", "private": true, "scripts": { "precommit": "cd .. && node hooks/node_modules/lint-staged/index.js" }, "license": "MIT", "devDependencies": { "husky": "^0.14.3", "lint-staged": "^7.0.5" } }
json
<gh_stars>1-10 CSDUID,RuralUrbanFlag,CSDpop2016,Period1,Period2,Period3,Period4,Period5,Period6,Period7,Period8 4705047,Rural,557.0,88,62.8,66.4,64.6,55.7,28.7,-999,-999
json
Google today announced that Google Fit, the company’s fitness tracking app that launched on Android back in 2014, is now available on iOS. It definitely took Google a while to bring the app to iOS. Until today, the only way to get your Fit data on your iPhone was in a special section of the Wear OS app on the iPhone. Without a Wear OS device, though, that section would’ve been empty. If you’ve seen the Fit app on Android, then the iOS version will look very familiar. It features the same focus on Move Minutes and Heart Point, as well as the ability to pick up different activities based on your movement. You can also connect the app with apps connected to Apple Health like Sleep Cycle, Nike Run Club or Headspace can also sync with Google Fit. Indeed, as a Google spokesperson told me, all of the movement data in the app also comes from Apple’s Health app — or from a Wear OS smartwatch, though few iOS users have opted to cross streams and use a Wear OS watch with their iPhones.
english
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getProjectionFromAST = getProjectionFromAST; exports.getProjectionFromASTquery = getProjectionFromASTquery; exports.getFlatProjectionFromAST = getFlatProjectionFromAST; exports.extendByFieldProjection = extendByFieldProjection; var _graphql = require("../graphql"); var _deepmerge = _interopRequireDefault(require("./deepmerge")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* eslint-disable no-param-reassign, no-lonely-if */ const FIELD = _graphql.Kind.FIELD, FRAGMENT_SPREAD = _graphql.Kind.FRAGMENT_SPREAD, INLINE_FRAGMENT = _graphql.Kind.INLINE_FRAGMENT; // export type ProjectionType = { [fieldName: string]: $Shape<ProjectionNode> | true }; // export type ProjectionNode = { [fieldName: string]: $Shape<ProjectionNode> } | true; function getProjectionFromAST(info, fieldNode) { if (!info) { return {}; } const queryProjection = getProjectionFromASTquery(info, fieldNode); const queryExtProjection = extendByFieldProjection(info.returnType, queryProjection); return queryExtProjection; } function getProjectionFromASTquery(info, fieldNode) { if (!info) { return {}; } let selections; // Array<FieldNode | InlineFragmentNode | FragmentSpreadNode>; if (fieldNode) { if (fieldNode.selectionSet) { selections = fieldNode.selectionSet.selections; } } else if (Array.isArray(info.fieldNodes)) { // get all selectionSets selections = info.fieldNodes.reduce((result, source) => { if (source.selectionSet) { result.push(...source.selectionSet.selections); } return result; }, []); } const projection = (selections || []).reduce((res, ast) => { switch (ast.kind) { case FIELD: { const value = ast.name.value; if (res[value]) { res[value] = (0, _deepmerge.default)(res[value], getProjectionFromASTquery(info, ast) || true); } else { res[value] = getProjectionFromASTquery(info, ast) || true; } return res; } case INLINE_FRAGMENT: return (0, _deepmerge.default)(res, getProjectionFromASTquery(info, ast)); case FRAGMENT_SPREAD: return (0, _deepmerge.default)(res, getProjectionFromASTquery(info, info.fragments[ast.name.value])); default: throw new Error('Unsuported query selection'); } }, {}); return projection; } function getFlatProjectionFromAST(info, fieldNodes) { const projection = getProjectionFromAST(info, fieldNodes) || {}; const flatProjection = {}; Object.keys(projection).forEach(key => { flatProjection[key] = !!projection[key]; }); return flatProjection; } // This method traverse fields and extends current projection // by projection from fields function extendByFieldProjection(returnType, projection) { let type = returnType; while (type instanceof _graphql.GraphQLList || type instanceof _graphql.GraphQLNonNull) { type = type.ofType; } if (!(type instanceof _graphql.GraphQLObjectType || type instanceof _graphql.GraphQLInterfaceType)) { return projection; } let proj = projection; Object.keys(proj).forEach(key => { const field = type._fields[key]; if (!field) return; if (field.projection) proj = (0, _deepmerge.default)(proj, field.projection); if (field.extensions && field.extensions.projection) { proj = (0, _deepmerge.default)(proj, field.extensions.projection); } proj[key] = extendByFieldProjection(field.type, proj[key]); }); return proj; }
javascript
<reponame>matheusjferreira/flutter-body-calc<filename>lib/i18n/en_US.json { "calculator_bmi": "Calculator BMI", "height": "Height", "weight": "Weight", "calculate": "Calculate", "about": "About", "table_bmi": "Table BMI", "about_the_project": "About the project", "body_calc": "BODY CALC", "about_project_text": "This project was born as a result of the study and improvement of knowledge of its developer.", "developer": "Developer:", "about_developer_text": "<NAME> is a student and application developer. Technologist in Systems Analysis and Development and student of several online courses.", "severe_thinness_result": "BMI: %s Severe Thinness", "moderate_thinness_result": "BMI: %s Moderate Thinness", "mild_thinness_result": "BMI: %s Mild Thinness", "normal_result": "BMI: %s Normal", "overweight_result": "BMI: %s Overweight", "obesity_class_i_result": "BMI: %s Obesity Class I", "obesity_class_ii_result": "BMI: %s Obesity Class II", "obesity_class_iii_result": "BMI: %s Obesity Class III", "category": "Category", "bmi_range": "BMI range kg/m²", "severe_thinness_table": "Severe Thinness", "moderate_thinness_table": "Moderate Thinness", "mild_thinness_table": "Mild Thinness", "normal_table": "Normal", "overweight_table": "Overweight", "obesity_class_i_table": "Obesity Class I", "obesity_class_ii_table": "Obesity Class II", "obesity_class_iii_table": "Obesity Class III" }
json
<reponame>delta-reporter/delta-reporter-testng-maven-plugin<filename>src/main/java/com/deltareporter/listener/service/impl/ProjectTypeServiceImpl.java<gh_stars>1-10 package com.deltareporter.listener.service.impl; import com.deltareporter.client.DeltaClient; import com.deltareporter.listener.service.ProjectTypeService; public class ProjectTypeServiceImpl implements ProjectTypeService { private final DeltaClient deltaClient; public ProjectTypeServiceImpl(DeltaClient deltaClient) { this.deltaClient = deltaClient; } public void initProject(String projectName) { this.deltaClient.initProject(projectName); } }
java
Day 7 of the French Open was a good one for the Indian contingent, with Sania Mirza and Rohan Bopanna winning their respective doubles matches. Mirza, along with her partner Lucie Hradecka, advanced to the third round of the women's doubles tournament with a straight-sets win over Tamara Zidansek and Kaja Juvan. It was a day of double delight for Rohan Bopanna as he extended his journey in the men's doubles as well as mixed doubles events. The 42-year-old, along with partner Matwe Middelkoop, saved five match points to stun second seeds Nikola Mektic and Mate Pavic to reach the quarterfinals. Bopanna and Andreja Klepac then sealed their place in the second round of the mixed doubles competition by eliminating Asia Muhammad and Lloyd Glasspool. Here are the results of the Indian players on Day 7 of the French Open: Tenth seeds Sania Mirza and Lucie Hradecka booked their place in the last 16 of the women's doubles tournament by overcoming the Slovenian duo of Tamara Zidansek and Kaja Juvan. The Indo-Czech pair won the opening set 6-3 before taking the second 6-4. In the third round, Sania Mirza and Lucie Hradecka will take on the eighth-seeded American pair of Coco Gauff and Jessica Pegula, both of whom are also in the last 16 of the women's singles. Rohan Bopanna and Matwe Middelkoop had a memorable outing as they ousted favorites Nikola Mektic and Mate Pavic to reach the quarterfinals of the men's doubles tournament. The match was tightly contested and lasted two hours and 36 minutes. The second-seeded pair from Croatia took the opening set in a tie-break before Bopanna and Middelkoop won the second set in similar fashion. Mektic and Pavic got an early break in the third set and were serving for the match at 5-4. However, the 16th seeds saved a match point and broke back to level the score at 5-5. Both pairs held serve thereafter and the set went to a 10-point tie-break. Mektic and Pavic looked in command and had three match points at 9-6. However, Bopanna and Middelkoop saved all three and went on to win the tie-break 12-10 to seal their place in the quarterfinals. The Indo-Dutch pair will take on Lloyd Glasspool and Harri Heliovaara for a place in the semifinals of the men's doubles competition. Rohan Bopanna and Andreja Klepac are seeded fifth in the mixed doubles competition and booked their place in the second round by beating Asia Muhammad and Lloyd Glasspool in straight sets. The Indo-Slovenian pair won the opening set 6-1 and got an early break in the second. Muhammad and Glasspool broke back to level the scores at 2-2. However, Bopanna and Klepac got the decisive break to lead 5-4 and held serve to win the match. The fifth seeds will square off against Lucie Hradecka and Gonzalo Escobar in the second round. The winner of the match will face third seeds Gabriela Dabrowski and John Peers. Women's doubles (second round): Men's doubles (third round): (16) Rohan Bopanna / Matwe Middelkoop def. (2) Nikola Mektic / Mate Pavic 6-7(5), 7-6(3), 7-6(10) Mixed doubles (first round):
english
India is among the 20 countries that have expressed interest in obtaining the new coronavirus vaccine announced by Russian President Vladimir Putin on Tuesday, news18. com reported. Putin on Tuesday announced world's first coronavirus vaccine 'Sputnik V' that is ready to use and works quite effectively. Making the big announcement, Putin said it forms a stable immunity against coronavirus informing that one of his daughters has already been vaccinated. Russia will launch mass production of the Sputnik V or Covid-19 vaccine in September. According to Russian government statement, Russia Development Investment Fund or RDIF (Russia’s sovereign wealth fund) finances the production of the Sputnik V in Russia on the basis of production capacities of its portfolio companies, R-Pharm and Binnopharm, a part of the Alium Group. clinical trials in different countries, including Saudi Arabia, UAE, Brazil, India and Philippines, and start mass production in other countries in partnership with local sovereign wealth funds, including India, South Korea and Brazil, as well as, in Saudi Arabia, Turkey and Cuba," said the statement, addinng that the plan is to ramp up the vaccine production to 200 million doses by the end of 2020, including 30 million doses in Russia. At least 20 countries had expressed interest in obtaining the Sputnik V, including UAE, Saudi Arabia, Indonesia, Philippines, Brazil, Mexico and India," added the statement. The vaccine was named 'Sputnik V' in reference to the 1957 launch of a Soviet satellite, which opened space to exploration by humans.
english
New Delhi: The Centre is unlikely to adopt an open-door policy for Chinese investments anytime soon. However, the government is reportedly considering opening the door to foreign direct investment (FDI) to a limited extent where local manufacturing units don’t have sufficient capacity or in sectors extremely crucial to India’s interests. Earlier, reports surfaced that the government was planning to start the process approve FDI proposals from Beijing on a “case-by-case” basis, lifting restrictions that were put in place to prevent opportunistic takeovers or acquisitions of Indian companies because of the pandemic. Worth mentioning here is that security clearance would continue to be compulsory in all cases, and as a part of a standard operating guideline all investment proposals from Beijing are to be examined by the ministry-concerned, Also, the proposals will get clearance those from entities or investors based elsewhere but sending funds through Hong Kong and those that entail small investments by Chinese investors. “Proposals are being examined as per three key guidelines. . . Any proposal entailing large investment would have to be in a critical area where there is minimal or negligible local presence,” a government official with knowledge of the matter told ET. He went on to add that these standard operating procedures(SOPs) direct the approval mechanism. Amid talks about putting a limit for Chinese investment, below which prior approval for sectors that are on the automatic approval route would be waived. No final decision, however, has been taken on setting such a cap, the business daily said. In April, the Department for the Promotion of Industry and Internal Trade (DPIIT) had issued guidelines mentioning that foreign investments from countries that share a border with India will require government approval from now on. The rules change in April had hit Chinese entities as they had emerged as a big source of flows in recent years, especially in the digital and technology sectors. Since April, the Centre had received over 120 FDI proposals worth about Rs 12,000 crore from China. Last year, tensions were running high between India and China along the border area, with reports of clashes between troops at multiple locations in Ladakh and one location in Sikkim. New Delhi and Beijing started disengagement last month, raising hopes of easing restrictions on Chinese FDI and quicker approval. That’s unlikely, as per people familiar with the matter, the financial daily mentioned.
english
<filename>src/main/webapp/scripts/xmodal-v1/xmodal-migrate.js /* * web: xmodal-migrate.js * XNAT http://www.xnat.org * Copyright (c) 2005-2017, Washington University School of Medicine and Howard Hughes Medical Institute * All Rights Reserved * * Released under the Simplified BSD. */ // helper functions for transitioning to new xmodal.js script if (typeof xmodal == 'undefined') { throw new Error('The xmodal.js file must be included before this one.'); } var xModal = xModal || {}; // NOTE: camel case "xModal" xModal.Modal = function( _opts ){ this._opts = _opts = _opts || {}; $.extend( true, this, _opts ); function isValue( a, b ){ var undefined; if (arguments.length !== 2) return; // need exactly TWO args if (a != undefined){ return (a.toString() === b.toString()); } return undefined; } // if there's a value that's NOT the 'default' // set the value to false this.scroll = !(_opts.scroll && _opts.scroll !== 'yes'); this.closeBtn = !(_opts.closeBtn && _opts.closeBtn !== 'show'); if (_opts.id && isValue(_opts.content,'static')) { this.template = _opts.id } if (_opts.id && isValue(_opts.content,'existing')){ this.template = _opts.id; this.padding = 0; this.footer = _opts.footer = false; } if (_opts.footer && _opts.footer !== 'show'){ this.footer = false; } else { this.footer={}; this.footer.buttons = !(_opts.footerButtons && _opts.footerButtons !== 'show'); this.footer.content = _opts.footerContent; this.footer.background = _opts.footerBackground; this.footer.border = _opts.footerBorder; if (_opts.footerHeight) { this.footer.height = _opts.footerHeight } } var opts = $.extend(true, {}, this, _opts); this.opts = opts; return xmodal.open(opts); }; function xModalOpenNew(opts){ return new xModal.Modal(opts); } function xModalCloseNew(id){ xmodal.close(id); } var xModalMessageCount = 0 ; function xModalMessage( title, message, label, options ){ xModalMessageCount++ ; var opts={}; opts.title = title || ' '; opts.content = message || ' '; opts.buttonLabel = label || 'OK'; $.extend(true, opts, options); return xmodal.message(opts); } function xModalConfirm(opts){ return xmodal.confirm(opts); } function xModalLoadingOpen(opts){ return xmodal.loading.open(opts.title, opts.id, opts); } function xModalLoadingClose(id){ xmodal.loading.close(id); } // replace old XNAT YUI loading dialogs? // these SHOULD work, but let's wait a bit //function openModalPanel(id, title, opts){ // //var opts = $.extend( true, { id: _id, title: _title }, _opts ); // // 'title' and 'id' are switched (because 'id' can be auto-generated); // xmodal.loading.open( title, id, opts ); //} //function closeModalPanel(id){ // xmodal.loading.close(id); //}
javascript
<filename>.cache/b3/3446e30e614c0242604d52d38925bb.json<gh_stars>0 {"id":"../node_modules/@restart/ui/esm/ssr.js","dependencies":[{"name":"/home/binh/projects/nearvember/guest-book/package.json","includedInParent":true,"mtime":1637584287199},{"name":"/home/binh/projects/nearvember/guest-book/node_modules/@restart/ui/package.json","includedInParent":true,"mtime":1637561363198},{"name":"@react-aria/ssr","loc":{"line":1,"column":52},"parent":"/home/binh/projects/nearvember/guest-book/node_modules/@restart/ui/esm/ssr.js","resolved":"/home/binh/projects/nearvember/guest-book/node_modules/@react-aria/ssr/dist/module.js"}],"generated":{"js":"\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"useSSRSafeId\", {\n enumerable: true,\n get: function () {\n return _ssr.useSSRSafeId;\n }\n});\nObject.defineProperty(exports, \"useIsSSR\", {\n enumerable: true,\n get: function () {\n return _ssr.useIsSSR;\n }\n});\nObject.defineProperty(exports, \"SSRProvider\", {\n enumerable: true,\n get: function () {\n return _ssr.SSRProvider;\n }\n});\n\nvar _ssr = require(\"@react-aria/ssr\");"},"sourceMaps":{"js":{"mappings":[{"generated":{"line":25,"column":0},"source":"../node_modules/@restart/ui/esm/ssr.js","original":{"line":1,"column":0}}],"sources":{"../node_modules/@restart/ui/esm/ssr.js":"import { useSSRSafeId, useIsSSR, SSRProvider } from '@react-aria/ssr';\nexport { useSSRSafeId, useIsSSR, SSRProvider };"},"lineCount":null}},"error":null,"hash":"c9134ebeb37b4b0f87f17ece810832be","cacheData":{"env":{}}}
json
We can aid! You can still click on the contribute button and after that allow us comprehend there's a worthwhile charity, such as Juvenile Law Center out there that that is not listed on our website. There are several worthwhile charities out there that are requiring your help, particularly in Glendale. It is a web directory site of local charities that might provide lorry donation programs in your location. Unlike various other comparable programs, funds are not raised to support 3rd celebration charities or companies. The Car Talk Vehicle contribution program will certainly offer funds to the California Public Radio station of your option. The profits of your Glendale, Arizona vehicle contributions will certainly assist our partners generate funds to receive their programs for the benefit of our professionals. Oftentimes, if the contributed automobile is not in terrific form to be used in their programs or perhaps cost auction, Glendale auto to charity programs could determine to take it somewhere where they can junk it. What is Pligg? Pligg is an open source content management system that lets you easily create your own user-powered website.
english
<reponame>akhilrawat001/guide-star-india-scraper-js<filename>JSONS/5114.json { "contacts": [], "guideStarURL": "http://www.guidestarindia.org/Summary.aspx?CCReg=5114", "name": "<NAME>", "primaryEmail": "<EMAIL>", "organisationType": [ "Direct Service" ], "telephone": [ "919919176717" ], "mainAddrress": { "state": "Uttar Pradesh", "address": [ "EWS- 296, Awas Vikas Colony", "Fatehpur", "Uttar Pradesh", "212601" ] }, "regiseredAddrress": { "state": "Uttar Pradesh", "address": [ "<NAME>, <NAME>", "Radha Nagar-Chhichhani Road, Post- Ramwan", "Fatehpur", "Uttar Pradesh", "212601" ] } }
json
{ "Rivets Bind": { "prefix": "rv-bind", "body": [ "rivets.bind(document.getElementsByTagName('body')[0], { data: this });" ], "description": "Rivets Bind to Body" }, "Rivets Formatters": { "prefix": "rv-formatters", "body": [ "rivets.formatters.ev = function (value,arg) { return eval(value + arg); }\nrivets.formatters.ev_string = function (value, arg) { let eval_string = \"'\" + value + \"'\" + arg; return eval(eval_string); }\n" ], "description": "Rivets Formatter Helpers" } }
json
<gh_stars>0 package alien4cloud.deployment.matching.services.policies; import org.alien4cloud.tosca.model.templates.PolicyTemplate; import org.alien4cloud.tosca.model.types.PolicyType; import org.springframework.stereotype.Component; import alien4cloud.deployment.matching.services.nodes.AbstractTemplateMatcher; import alien4cloud.model.orchestrators.locations.PolicyLocationResourceTemplate; /** * Matches a policy template against a list of resources. */ @Component public class PolicyMatcher extends AbstractTemplateMatcher<PolicyLocationResourceTemplate, PolicyTemplate, PolicyType> { }
java
The South Korean tech giant will offer credit and debit card services for Samsung Pay in the country, in cooperation with Axis Bank, HDFC Bank, ICICI Bank, State Bank of India, Standard Chartered, AMEX, and Citi. Samsung will add more local partners going forward, the company said. Consumers in India can also register Paytm, a popular local mobile payment service, to Samsung Pay for peer-to-peer (P2P) money transfers and to make QR and barcode payments. United Payments Interface-based P2P transactions offered by the National Payment Corporation of India will also be added later, the company said. Samsung Pay has now been launched in 12 countries in total. Besides India, it is available in South Korea, the US, China, Spain, Australia, Singapore, Brazil, Puerto Rico, Russia, Thailand, and most recently Malaysia, since last month. The company offers additional services optimized for local markets in the form of transportation cards, membership cards, gift cards, and ATMs. In Korea, it added shopping and rewards services earlier this month. Samsung has launched their Z series of Tizen-running phones in India, especially designed to cater to the market there. It launched an updated Z2 with 4G connectivity in India last August.
english
<reponame>noom1337/hawk-client package net.minecraft.world.storage; import java.io.File; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.MinecraftException; import net.minecraft.world.WorldProvider; import net.minecraft.world.chunk.storage.IChunkLoader; public class SaveHandlerMP implements ISaveHandler { private static final String __OBFID = "CL_00000602"; public IChunkLoader getChunkLoader(WorldProvider var1) { return null; } public void flush() { } public void saveWorldInfo(WorldInfo var1) { } public File getMapFileFromName(String var1) { return null; } public void saveWorldInfoWithPlayer(WorldInfo var1, NBTTagCompound var2) { } public File getWorldDirectory() { return null; } public void checkSessionLock() throws MinecraftException { } public String getWorldDirectoryName() { return "none"; } public IPlayerFileData getPlayerNBTManager() { return null; } public WorldInfo loadWorldInfo() { return null; } }
java
After spending some quality time with Doom's closed multiplayer beta, we felt that the first-person shooter was a great throwback to old school games. And we also feared it might not have enough content to sustain those weaned on modern-day shooters. It turns out publisher Bethesda felt the same. Not only did it announce an open beta for the game but revealed its post-launch plans for multiplayer too. "If you were unable to join us for our recent Doom closed multiplayer beta, you're in luck! From April 15 through 17, you'll be able to jump straight into the open beta - no code necessary. Simply download the beta and let the viscera fly. Like the closed beta, you'll have access to Team Deathmatch and Warpath on the Heatwave and Infernal maps," a post by Bethesda Content Manager Anne Lewis reads. (Also see: Doom Is (Finally) Out This May. Play These 5 Games First.) In addition to this, she also revealed what else you can expect to keep the game's multiplayer fresh after Doom is out on May 13. There will be a Season Pass consisting of three premium multiplayer downloadable content (DLC) packs. These will grant you access to new maps, hack modules, playable demons, and weapons among other things. The first DLC pack has no release date save for a summer window. It will have the following: Each DLC pack will be available for $14.99 (approximately Rs. 1,000) or can be bought altogether for $39.99 (around Rs. 2,661) via the game's Season Pass. As for India, the Season Pass for Doom is available for a steep Rs. 3,000 on Xbox One with no price on PS4 or PC at the moment. In the past Bethesda has priced DLC similarly across platforms for the country. Safe to say the Season Pass will have the same price on the PlayStation Store and Steam when it's available.
english
Tell us about your Reel Sister Karthika role ? Will Karthika Dominate you in the film ? Have you faced any problem from Kona venkat for using his name ? No. we have not faced any problem Brahmanandam suggested us kona venkat name for his Character . we informed about this to writer and producer kona venkat before shooting he accepted and given green signal then we went ahead. after receiving final copy we have shown our film to kona venkat he is extremely happy and he has not expressed any objection for using his name. My director B.Chinni has made 100%justice for the film. He has suggested Karthika for my sister role.i am sure he will not disappoint you (Audience) When your going to do Debut as Director ? Future Project ?
english
A special CBI court in Panchkula on Thursday sentenced Dera Sacha Sauda sect chief Gurmeet Ram Rahim Singh to life imprisonment in the murder case of journalist Ram Chander Chhatrapati. The court also sentenced his three close aides, Krishan Lal, Kuldeep Singh and Nirmal Singh, who were also found guilty of the murder of Chhatrapati in 2002, to life imprisonment. Ram Rahim's life imprisonment will begin after the completion of the 20-year jail term in the rape cases for which he was convicted earlier. CBI counsel H. P. S. Verma told media that Ram Rahim will have to remain in prison for life following Thursday's judgment. Ram Rahim and the three others were convicted by the CBI court on January 11. All the four were convicted under Section 302 (murder) and 120-B (criminal conspiracy) of the Indian Penal Code (IPC). The judgement came over 16 years after the murder of the journalist. "The punishment is satisfactory. We had to fight a lot to get him punished," Anshul Chhatrapati, son of the slain journalist told media after the sentencing. Ram Rahim is already lodged in Sunaria jail near Rohtak after his conviction on August 25, 2017 for the rape of two women disciples. He was sentenced to 20 years of rigorous imprisonment in the case. The judgement was delivered by judge Jagdeep Singh. The same judge had earlier convicted Ram Rahim in the rape case of two female disciples on August 25, 2017 and sentenced him to 20 years of rigorous imprisonment. The judge also imposed a fine of Rs 50,000 each on Ram Rahim and others. Ram Rahim and the three others were convicted by the CBI court on January 11. All the four were convicted under Section 302 (murder) and 120-B (criminal conspiracy) of the Indian Penal Code (IPC). The judgment came over 16 years after the murder of the journalist. Arguments of lawyers of the CBI, Chhatrapati's family and the sect chief were held for over two hours. The sentencing came over two hours after that. The counsel for Ram Rahim pleaded for a lesser sentence, citing the social work being done by the sect. Ram Rahim appeared before the court through video conferencing from the Sunaria Jail near Rohtak where he is lodged. The other three convicts appeared through video-conferencing from the Ambala jail. Sources said Ram Rahim, 51, looked pale as he appeared before the court. Chhatrapati's son Anshul had demanded capital punishment for the disgraced self-styled godman. Chhatrapati, who edited a newspaper in Sirsa, was shot five times on October 24, 2002. He died later that year on November 21 in a hospital in New Delhi. He had published the letter of a 'sadhvi' (female disciple) of the sect, in which she had highlighted her sexual exploitation by the sect chief, in his local vernacular newspaper 'Poora Sach'. The publication of the letter and other stories carried by Chhatrapati, which were critical of the activities of the sect and its chief, had upset Ram Rahim who asked his close aides to eliminate the journalist. Security was heightened in parts of Haryana and Punjab ahead of the sentencing. The Central Bureau of Investigation (CBI) court complex in Panchkula's Sector 1, adjoining Chandigarh, was a virtual fortress on Thursday with strict checking of all people and vehicles coming to the area. Anti-riot police was present in strength outside the court complex. The local administration imposed Section 144 Cr. PC in the area to prevent the assembly of five or more people. The area around the Sunaria Jail near Rohtak, where Ram Rahim is lodged, was completely sealed by security personnel. Security was tightened in Haryana's Sirsa town, around 260 km from here, where the sect's headquarters is located. Haryana Police personnel and three companies of paramilitary forces were statioed around the sect campus. The Punjab Police had also taken preventive security measures in the neighbouring state as the sect has lakhs of followers in Bathinda, Mansa, Moga and Sangrur. Ram Rahim's conviction on August 25, 2017, had led to violence in Panchkula and Sirsa, leaving 41 people dead and over 260 injured. The court on Wednesday allowed authorities in Haryana to produce the disgraced sect chief and three others before it through video- conferencing for their sentencing. Ram Rahim, who was patronized by political leaders and parties of Punjab and Haryana for nearly two decades due to his ability to shift votes of his followers, is now lodged in jail following his conviction on two counts of rape of his female disciples. The sect chief is also linked to the murder of former Dera manager Ranjit Singh (in July 2002). The matter is being heard by the CBI court. Ranjit Singh, who was believed to be privy to wrongdoing in the sect headquarters, was shot dead in July 2003. The sect chief suspected that Ranjit Singh was responsible for complaints of sexual exploitation of female disciples inside the sect campus coming out in the public.
english
// $(document).ready(function () { function showCart(cart) { $('#modal-cart .modal-body').html(cart); $('#modal-cart').modal(); } function getCart() { $.ajax({ url: '/cart/show-cart', type: 'GET', success: function (res) { if (!res) { alert('ERror'); } showCart(res); }, error: function () { alert('ERROR!'); } }); return false; } $('#modal-cart').on('click', '.item-delete', function () { var id = $(this).data('id'); $.ajax({ url: '/cart/del-item', data: {id: id}, type: 'GET', success: function (res) { if (!res) { alert('Нечего удалять'); } // console.log(res); showCart(res); }, error: function () { alert('ERROR!'); } }); }); function clearCart() { $.ajax({ url: '/cart/clear', type: 'GET', success: function (res) { if (!res) { alert('ERror'); } showCart(res); }, error: function () { alert('ERROR!'); } }); return false; } $('.item_add').on('click', function (e) { e.preventDefault(); var id = $(this).data('id'); var quantity = $('#quantity').val(); $.ajax({ url: '/cart/add', data: {id: id,quantity: quantity}, type: 'GET', success: function (res) { if (!res) { alert('Товара не существует'); } // console.log(res); showCart(res); }, error: function () { alert('ERROR!'); } }); }); // });
javascript
<gh_stars>0 # my-222222 this is a new line to my-website repo.
markdown
Mahendraganj, May 15: People irrespective of their cultural and religious background has been celebrating unity in diversity at the Dargah of Hazrat Shah Kamal Baba for centuries, along the India–Bangladesh border at Mahendraganj town of Meghalaya’s South West Garo Hills. The fencing has divided the two countries but the sentiments of the people are still united, which is displayed during the annual Dargah fair held on first and second Sunday in the month of May. While devotees from India can get a glimpse of the Dargah at Mahendraganj, the Bangladesh counterpart show their respect to Shah Kamal by observing prayer rituals on the other side of the border. The devotees visit the Dargah in the belief that their wishes would be fulfilled if they approach with a true heart. “My pregnt sister had made a prayer for the wellbeing of her child. In respect of the blessing we received from the Peer baba, we have come to offer food to the poor and needy at the Dargah and seek his blessings”, said Shamin Ahmed of Mankachar, Assam. The Pirsthan holds significance to Muslims and Hindus as well the local Garo, Hajong and Koch communities, who equally revere the place for its age old history and tradition. It is the burial place of the last remains of Shah Kamal and his Garo wife. Legend has it that during the rule of Raja Mahendra rayan – the Zamindar of Karaibari, a demon was creating havoc by killing and devouring the people of the village. Shah Kamal by his super tural power drove away the demon and restored peace in the kingdom. The Raja as a token of his gratitude doted 1280 bighas of land as a gift to Shah Kamal. After the death of Shah Kamal and his wife, the burial place was constructed on a hillock overlooking Bangladesh. “It is a unique place and the government of India should promote the destition and create amenities to facilitate tourism and maintain cleanliness”, said Thridha Rao Bandaru, a tourist from Andra Pradesh. Till 2000, visitors from Bangladesh were allotted to visit the Dargah. However, since 2001, security has been hiked up and no persons from across the border are allowed to enter for the annual fair. There was a conflict between India and Bangladesh for the Boraibari enclave at Mankachar in Assam in 2001, which led to the killing of 17 BSF personnel. Security and other concerns may have erected barriers in the passage of devotees from Bangladesh. But it has failed in breaking the bonds of friendship that still bind these people. “It is an interesting place along the India-Bangladesh border. An initiative to unite devotees from both the sides through mutual cooperation by addressing the security concern would have been great. Today, we see conflict in the me of religion and particularly Islam, such bonhomie would create mutual friendship between the two countries and the people”, said Altaf Ansari, a tourist from Delhi, who is in Garo hills to attend a training programme at North Eastern Hill University, Tura campus. In 16th century the Dargah was built. Locals believe that it was constructed in one night. The structure has resemblance to Moghul architecture. The shrine had no roof but later devotees put roof to protect it from rain. Earlier, the Dargah was outside the fencing as it is located within 150 yards from Zero line but in 2001 it was taken inside India. “Several flag meetings were held to fix this as there was strong opposition from Bangladesh. Sometimes the workers worked at night to avoid any unpleasant incident”, said Abdullah, the caretaker of the Dargah.
english
It’s been a roller-coaster season for Atletico Madrid and Diego Simeone. Their La Liga title defense started on a rather disappointing note in August last year. The Rojiblancos have failed to repeat the form that saw them clinch the 2020-21 Spanish league title. It has now been seven months since Atletico Madrid last won back-to-back matches in La Liga. Their inconsistency has seen the wheels fall off from their title challenge. It has not stopped there, with their qualification for the 2022-23 Champions League now in doubt. It was further compounded by their loss to Levante on Wednesday. Levante came into the match on the back of three consecutive defeats. Moreover, they were placed at the bottom of the table when they visited Wanda Metropolitano on Wednesday. Hence, for Atletico Madrid to lose that match is a matter of concern for Diego Simeone. Atletico had a chance to go three points ahead of Barcelona, but the loss to Levante now gives the Catalan the chance to race ahead instead. Both clubs currently have 39 points on the table, with Atletico having played one game more. Another sign of worry is that the Rojiblancos still boast of an excellent team at the Wanda Metropolitano. So the pressure is entirely on the manager to deliver the results on the pitch. Alternatively, it could be a sign that his time at the club is coming to an end. It was a golden chance for Atletico to put the pressure back on Barcelona, who are themselves on shaky grounds at the moment. However, the shock loss to Levante will only boost Barca to race ahead in the race for the final spot for Champions League football. In fact, the fifth place might also be conceded to Real Sociedad, who are on 38 points, having played one game less than Atletico (39 points). Simeone admitted that the team had a poor game. He said, as quoted by Football Espana: “We played a bad game. We lost a beautiful opportunity to move into a good situation in La Liga and we will have to make a doubt effort Defeats always hurt. It will always bother and hurt me. Today was relaxing and tomorrow we talk for a while to say what I think and to see what they feel." Simeone added:
english
The Union Budget is expected to focus on employment generation, increase in limits for basic tax exemption, standard deduction, medical expenses, rationalisation of tax rates and certain social security investments. Currently, Section 16(1A) of the IT Act provides for a standard deduction of Rs 50,000 from the salary income of a taxpayer. This deduction was enhanced from Rs 40,000 to 50,000 by the Finance Act 2019 and has not been increased since then. However, considering the rising inflation and cost of living, there is a need to increase such standard deduction for the salaried personnel from Rs 50,000 to Rs 60,000 in case there is no increase in the basic exemption limit, said Suresh Surana, Founder - RSM India. Currently, section 80TTA provides deduction up to Rs 10,000 p. a. only with respect to the interest from savings bank accounts with banks/co-operative society/post office. However, for the purpose of enabling majority of taxpayers to avail this tax benefit, the existing scope of the said section needs to be expanded in order to cover other types of interest such as interest on bank/post office term deposits, recurring deposit etc. Moreover, such threshold limit of Rs 10,000 also needs to be enhanced to Rs 20,000 as there was no change in the limit since its introduction by Finance Act 2012, Surana added. There are numerous exemptions available with negligible upper limits such as Children Education Allowance (Rs. 100 pm per child), Children Hostel Expenditure Allowance (Rs 300 pm per child). The limit with respect to such deductions is not in consonance with the present education cost and needs to be adjusted for inflation and accordingly, enhanced. Further, the exemption limit of Rs 1,500 u/s 10(32) applicable at the time of clubbing of minor's income under section 64(1A) was last revised in 1993 and thus, an upper revision in the same is long overdue. Such exemption limit may be hiked to Rs 15,000 considering the inflation in last 28 years. It may be worthwhile to consolidate all deductions pertaining to the children in one single consolidated deduction of Rs 20,000 per child, Surana added. The threshold limit of Rs 10,000 for payment of advance tax was last amended by Finance Act, 2009. Considering the inflation in the economy over the last 12 years as well as reducing compliance burden, there is a need to increase the threshold limit from the present Rs 10,000 to Rs 30,000. (Only the headline and picture of this report may have been reworked by the Business Standard staff; the rest of the content is auto-generated from a syndicated feed. )
english
<reponame>Smohamedl/hospitalsystem {"remainingRequest":"/Users/mouhamedoumarou/git/hospitalsystem/node_modules/thread-loader/dist/cjs.js??ref--9-2!/Users/mouhamedoumarou/git/hospitalsystem/node_modules/ts-loader/index.js??ref--9-3!/Users/mouhamedoumarou/git/hospitalsystem/node_modules/eslint-loader/dist/cjs.js!/Users/mouhamedoumarou/git/hospitalsystem/src/main/webapp/app/layouts/navbar/navbar.route.ts","dependencies":[{"path":"/Users/mouhamedoumarou/git/hospitalsystem/src/main/webapp/app/layouts/navbar/navbar.route.ts","mtime":1582318110869},{"path":"/Users/mouhamedoumarou/git/hospitalsystem/node_modules/angular2-template-loader/index.js","mtime":1486570058000},{"path":"/Users/mouhamedoumarou/git/hospitalsystem/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/Users/mouhamedoumarou/git/hospitalsystem/node_modules/thread-loader/dist/cjs.js","mtime":499162500000},{"path":"/Users/mouhamedoumarou/git/hospitalsystem/node_modules/ts-loader/index.js","mtime":499162500000},{"path":"/Users/mouhamedoumarou/git/hospitalsystem/node_modules/eslint-loader/dist/cjs.js","mtime":499162500000}],"contextDependencies":[],"result":[{"type":"Buffer","data":"base64:aW1wb3J0IHsgTmF2YmFyQ29tcG9uZW50IH0gZnJvbSAnLi9uYXZiYXIuY29tcG9uZW50JzsKZXhwb3J0IGNvbnN0IG5hdmJhclJvdXRlID0gewogICAgcGF0aDogJycsCiAgICBjb21wb25lbnQ6IE5hdmJhckNvbXBvbmVudCwKICAgIG91dGxldDogJ25hdmJhcicKfTsK"},{"version":3,"file":"/Users/mouhamedoumarou/git/hospitalsystem/src/main/webapp/app/layouts/navbar/navbar.route.ts","sourceRoot":"","sources":["/Users/mouhamedoumarou/git/hospitalsystem/node_modules/eslint-loader/dist/cjs.js!/Users/mouhamedoumarou/git/hospitalsystem/src/main/webapp/app/layouts/navbar/navbar.route.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,CAAC,MAAM,WAAW,GAAU;IAChC,IAAI,EAAE,EAAE;IACR,SAAS,EAAE,eAAe;IAC1B,MAAM,EAAE,QAAQ;CACjB,CAAC","sourcesContent":["import { Route } from '@angular/router';\n\nimport { NavbarComponent } from './navbar.component';\n\nexport const navbarRoute: Route = {\n path: '',\n component: NavbarComponent,\n outlet: 'navbar'\n};\n"]}]}
json
Dancer turned actor Nora Fatehi has created an indelible mark on the film industry with her breathtaking moves in innumerable hit songs. However, it would be unjustifiable to not look at her incredible sartorial moments too. The star’s wardrobe has a range of choices, varying from bespoke ethnic looks to sizzling red-carpet-worthy dresses and casual attires. Nora recently starred in a photo shoot for which she draped herself in an exquisite chikankari saree and made netizens fall in love with her beauty. The star’s look in traditional attires have been creating quite a buzz this past week, and these ethereal six yards seems to be the latest addition to the list.
english
<gh_stars>1-10 .type-shop_order .column-order_actions a.button.wpo_wcpdf { float: left; width: 26px; height: 26px; padding: 3px 2px; }
css
import { Injectable } from "@angular/core"; import { HttpClient } from "@angular/common/http"; import { environment } from "../../environments/environment"; @Injectable() export class ConfigurationService { private apiUrl = environment.apiBaseUrl + "api/v1/configuration/"; constructor(private httpClient: HttpClient) {} public activateCollection(settings: AccountConfiguration): Promise<void> { return this.httpClient .post(`${this.apiUrl}${settings.collectionId}`, settings) .toPromise() .then(_ => {}); } public activateStatusPolicy( collectionId: string, projectId: string, repositoryId: string, statusPolicyName: string ): Promise<void> { return this.httpClient .post(`${this.apiUrl}${collectionId}/${projectId}/${repositoryId}/${statusPolicyName}`, {}) .toPromise() .then(_ => {}); } public deactivateStatusPolicy( collectionId: string, projectId: string, repositoryId: string, statusPolicyName: string ): Promise<void> { return this.httpClient .delete(`${this.apiUrl}${collectionId}/${projectId}/${repositoryId}/${statusPolicyName}`) .toPromise() .then(_ => {}); } public reactivateProject(collectionId: string, projectId: string): Promise<void> { return this.httpClient .post(`${this.apiUrl}${collectionId}/${projectId}`, {}) .toPromise() .then(_ => {}); } public getRepositoryStatus(collectionId: string, projectId: string, repositoryId: string): Promise<RepositoryStatus> { return this.httpClient .get(`${this.apiUrl}${collectionId}/${projectId}/${repositoryId}`) .toPromise() .then(s => s as RepositoryStatus); } public getProjectStatus(collectionId: string, projectId: string): Promise<ProjectStatus> { return this.httpClient .get(`${this.apiUrl}${collectionId}/${projectId}`) .toPromise() .then(s => s as ProjectStatus); } public getCollectionStatus(collectionId: string): Promise<CollectionStatus> { return this.httpClient .get(`${this.apiUrl}${collectionId}`) .toPromise() .then(s => s as CollectionStatus); } }
typescript
We take a closer look at How Big is Shapoorji Pallonji Group. The sudden demise of Cyrus Mistry has shocked everyone around. We journey back to the year 1865 to understand the roots of Shapoorji Pallonji Group. That year, the young Pallonji Mistry founded a small construction company called 'Littlewood Pallonji'. Their first project was the construction of pavement at Chowpatty, at a project cost of Rs. 2000, a huge amount at that time. At this point, the group owns about 18% stake in Tata Sons, making the group the largest individual non-trust shareholder of the gigantic conglomerate, Tata Group.
english
package rp.config; import lejos.robotics.RegulatedMotor; /** * A class to store configuration information for a wheeled robot. You could * subclass this to also contain information about sensor ports. * * @author <NAME> * */ public class WheeledRobotConfiguration extends MobileRobotConfiguration implements WheeledRobotDescription { private final float m_wheelDiameter; private final RegulatedMotor m_leftWheel; final RegulatedMotor m_rightWheel; public float getWheelDiameter() { return m_wheelDiameter; } public float getTrackWidth() { return m_trackWidth; } public RegulatedMotor getLeftWheel() { return m_leftWheel; } public WheeledRobotConfiguration(float _wheelDiameter, float _trackWidth, float _robotLength, RegulatedMotor _leftWheel, RegulatedMotor _rightWheel) { super(_trackWidth, _robotLength); m_wheelDiameter = _wheelDiameter; m_leftWheel = _leftWheel; m_rightWheel = _rightWheel; } @Override public RegulatedMotor getRightWheel() { return m_rightWheel; } }
java
<filename>src/config/types.ts export const SUPPORT_TYPES = { address: { value: [ 'address', 'lookupsource', 'reporter', 'validatorid', 'accountid', 'accountidof', '<lookup as staticlookup>::source', 'vec<address>', 'vec<lookupsource>', 'vec<reporter>', 'vec<validatorid>', 'vec<accountid>', 'vec<accountidof>', 'vec<<lookup as staticlookup>::source>', 'compact<address>', 'compact<lookupsource>', 'compact<reporter>', 'compact<validatorid>', 'compact<accountid>', 'compact<accountidof>', 'compact<<lookup as staticlookup>::source>', 'option<address>', 'option<lookupsource>', 'option<reporter>', 'option<validatorid>', 'option<accountid>', 'option<accountidof>', 'option<<lookup as staticlookup>::source>', ], }, balance: { value: [ 'ringbalance', 'ktonbalance', 'balance', 'balanceof', 'vec<balance>', 'vec<balanceof>', 'compact<balance>', 'compact<balanceof>', 'option<balance>', 'option<balanceof>', ], }, good_judgements: { value: ['reasonable', 'known good', 'knowngood'], }, kton_balance: { value: ['ktonbalance'], }, bond_extrinsic: { value: ['bond', 'unbond', 'bond_extra'], }, kton_bond_event: { value: ['bondkton', 'unbondkton'], }, bond_event: { value: ['bonded', 'unbonded', 'bondring', 'bondkton', 'unbondring', 'unbondkton'], }, };
typescript
<gh_stars>0 # Authors: <NAME>, <NAME> # License: BSD 3 clause import time import matplotlib.pyplot as plt import numpy as np from sklearn.cluster import AgglomerativeClustering from sklearn.neighbors import kneighbors_graph # Generate sample data n_samples = 1500 np.random.seed(0) t = 1.5 * np.pi * (1 + 3 * np.random.rand(1, n_samples)) x = t * np.cos(t) y = t * np.sin(t) X = np.concatenate((x, y)) X += .7 * np.random.randn(2, n_samples) X = X.T # Create a graph capturing local connectivity. Larger number of neighbors # will give more homogeneous clusters to the cost of computation # time. A very large number of neighbors gives more evenly distributed # cluster sizes, but may not impose the local manifold structure of # the data knn_graph = kneighbors_graph(X, 30, include_self=False) for connectivity in (None, knn_graph): for n_clusters in (30, 3): plt.figure(figsize=(10, 4)) for index, linkage in enumerate(('average', 'complete', 'ward', 'single')): plt.subplot(1, 4, index + 1) model = AgglomerativeClustering(linkage=linkage, connectivity=connectivity, n_clusters=n_clusters) t0 = time.time() model.fit(X) elapsed_time = time.time() - t0 plt.scatter(X[:, 0], X[:, 1], c=model.labels_, cmap=plt.cm.nipy_spectral) plt.title('linkage=%s\n(time %.2fs)' % (linkage, elapsed_time), fontdict=dict(verticalalignment='top')) plt.axis('equal') plt.axis('off') plt.subplots_adjust(bottom=0, top=.89, wspace=0, left=0, right=1) plt.suptitle('n_cluster=%i, connectivity=%r' % (n_clusters, connectivity is not None), size=17) plt.show()
python
/* ************************************************************************* * Copyright (c) 2007, 2008 IBM Corporation and others. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html * * Contributors: IBM Corporation - initial API and implementation * Actuate Corporation - re-factored to a generic component * ************************************************************************* */ package org.eclipse.datatools.connectivity.ui.wizards; import java.util.Properties; import org.eclipse.datatools.connectivity.drivers.jdbc.IJDBCConnectionProfileConstants; import org.eclipse.datatools.connectivity.internal.ui.ConnectivityUIPlugin; import org.eclipse.datatools.connectivity.internal.ui.DelimitedStringList; import org.eclipse.jface.dialogs.DialogPage; import org.eclipse.swt.SWT; import org.eclipse.swt.events.ModifyEvent; import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; /** * A generic pane that collects user input of optional properties in delimited name-value pairs. */ public class OptionalPropertiesPane extends Composite implements ModifyListener { protected boolean isReadOnly = false; protected DelimitedStringList delimitedStringControl; protected Properties properties; /** * Constructor. * @param parent a widget which will be the parent of the new instance (cannot be null) * @param style the style of widget to construct * @param isReadOnly true to use read-only controls; false otherwise */ public OptionalPropertiesPane( Composite parent, int style, boolean isReadOnly ) { super(parent, style); Composite parentComposite = this; this.isReadOnly = isReadOnly; GridLayout layout = new GridLayout(); layout.numColumns = 1; setLayout( layout ); Label optionalPropertiesLabel = new Label( parentComposite, SWT.NULL ); GridData gdata = new GridData( GridData.FILL_HORIZONTAL ); gdata.horizontalSpan = 2; optionalPropertiesLabel.setLayoutData( gdata ); optionalPropertiesLabel.setText( ConnectivityUIPlugin.getDefault() .getResourceString( "CommonDriverUIContributor.optionalProps.label" ) ); //$NON-NLS-1$ delimitedStringControl = new DelimitedStringList( parentComposite, SWT.NONE, isReadOnly ); GridData gd = new GridData( GridData.FILL_HORIZONTAL ); gd.horizontalSpan = 2; delimitedStringControl.setLayoutData( gd ); addListeners(); } /** * Passes in the IDriverUIContributorInformation to this pane for the properties information. * This method must be called by the client of this pane. * @param contributorInformation cannot be null */ public void setDriverUIContributorInformation( IDriverUIContributorInformation contributorInformation) { this.properties = contributorInformation.getProperties(); } protected void addListeners() { delimitedStringControl.addModifyListener( this ); } protected void removeListeners() { delimitedStringControl.removeModifyListener( this ); } /** * Indicates whether all the controls in this pane are in a valid state. * @param page the dialog page to display an error message if controls are not valid * @return true if controls are valid; false otherwise */ public boolean validateControl( DialogPage page ) { boolean isValid = true; if ( delimitedStringControl.getWarning() != null ) { page.setErrorMessage( delimitedStringControl.getWarning() ); isValid = false; } return isValid; } /* (non-Javadoc) * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent) */ public void modifyText( ModifyEvent e ) { if( isReadOnly ) return; // optional properties are updated directly in this.properties, and are not included in // the parent contributor's generated URL setConnectionInformation(); } /** * Loads and displays the connection property values found in the Properties specified by * {@link #setDriverUIContributorInformation(IDriverUIContributorInformation)}. */ public void loadProperties() { removeListeners(); String propertyList = properties.getProperty( IJDBCConnectionProfileConstants.CONNECTION_PROPERTIES_PROP_ID); if( propertyList != null ) delimitedStringControl.setSelection( propertyList ); addListeners(); } /** * Updates the connection property values in the Properties specified by * {@link #setDriverUIContributorInformation(IDriverUIContributorInformation)}. */ public void setConnectionInformation() { properties.setProperty( IJDBCConnectionProfileConstants.CONNECTION_PROPERTIES_PROP_ID, delimitedStringControl.getSelection() ); } }
java
Best ByThe length of time for "Best By" date depends on the type of product, as well as the brand. Perishable items (such as flax oils or certain probiotics) generally have shorter "Best By" dates. Although our warehouse is fully air-conditioned, these more fragile items are put in cold storage (freezer or refrigeration unit) for maximum freshness. Our receiving department does its best to verify and then enter the correct "Best By" dates for all incoming products. However, discrepancies do occur from time to time. This being said, the exceptionally high turnover at iHerb ensures that our inventory is among the freshest in the industry. Shipping Weight: Shipping WeightThe Shipping Weight includes the product, protective packaging material and the actual shipping box. In addition, the Shipping Weight may be adjusted for the Dimensional Weight (e.g. length, width & height) of a package. It is important to note that certain types of products (e.g. glass containers, liquids, fragile, refrigerated or ice packed) will often require protective packaging material. As such, these products will reflect a higher Shipping Weight compared to the unprotected product. Product rank: Nutritional support for healthy digestive function and overall well-being. As a dietary supplement, chew two tablets as needed. Natural sweeteners (non-gmo cane sugar, fructose), stearic acid, magnesium stearate, saw palmetto berry, peppermint leaf, fennel seed, natural flavors, ginger (Zingiber officinale root), rosemary leaf and catnip (Nepeta cataria). Free from artificial colors and artificial preservatives. Free from all of the major allergens identified in the U.S. Food Allergen Labeling and Consumer Protection Act. Keep tightly closed in a cool, dry place and out of reach of children. If symptoms of digestive discomfort persist, discontinue use and consult a physician. Not to be used by children under 12 unless recommended by a physician. While iHerb strives to ensure the accuracy of its product images and information, some manufacturing changes to packaging and/or ingredients may be pending update on our site. Although items may occasionally ship with alternate packaging, freshness is always guaranteed. We recommend that you read labels, warnings and directions of all products before use and not rely solely on the information provided by iHerb. |Bromelain (from pineapple fruit) |Papain (from papaya fruit) |Amylase (from Aspergillus oryzae) |Lipase (from Aspergillus niger) |**Percent Daily Values are based on a 2,000 calorie diet. †Daily Value not established.
english
<gh_stars>0 /** * */ package com.smthit.lang.fluent.validator; import com.baidu.unbiz.fluentvalidator.ValidatorContext; import com.baidu.unbiz.fluentvalidator.ValidatorHandler; import lombok.Data; /** * @author Bean * */ @Data public class LengthValidator extends ValidatorHandler<String> { private int min = 0; private int max = Integer.MAX_VALUE; public LengthValidator(int min, int max) { this.min = min; this.max = max; } @Override public boolean validate(ValidatorContext context, String t) { return super.validate(context, t); } }
java
Mumbai: At its first bi-monthly monetary policy review of the fiscal slated for Thursday, the RBI is expected to cut its key lending rate by another 25 basis points (bps) in view of both low inflation and slowing industrial production. At its final bi-monthly policy review of the last fiscal in February, the central bank's Monetary Policy Committee (MPC), presided over for the first time by bank Governor Shaktikanta Das, voted to lower its repo, or short-term lending rate for commercial banks, by 25 bps to 6. 25 per cent. It was the first repo cut in one and a half years. At the same time, the RBI changed its monetary policy stance from one of "calibrated tightening" to "neutral". While the MPC delivered a surprise repo rate cut in a 4-2 split vote, members unanimously agreed to the change in policy stance. In terms of inflation, both retail and wholesale prices have shown a declining trend on a year-on-year basis. Besides, there has been a sharp decline in manufacturing output, which slowed industrial production in January to 1. 7 per cent. “Low inflation has opened up room for the Reserve Bank of India to adopt a more accommodative stance to support faltering growth. The real question is how deep or shallow this rate cut cycle is going to be,” an HDFC report said. (IANS)
english
<reponame>dwillis/wbb-rosters<gh_stars>0 [{"team_id": 316, "team": "Jacksonville", "id": "1955", "name": "<NAME>", "year": "Freshman", "hometown": "Atlanta, Ga. (Jonesboro)", "high_school": null, "previous_school": null, "height": null, "position": "Forward", "jersey": "1", "url": "/sports/womens-basketball/roster/kimberly-dawkins/1955", "season": "2013-14"}, {"team_id": 316, "team": "Jacksonville", "id": "1959", "name": "<NAME>", "year": "Freshman", "hometown": "Gainesville, Fla. (Gainesville)", "high_school": null, "previous_school": null, "height": "5'8\"", "position": "Guard", "jersey": "3", "url": "/sports/womens-basketball/roster/deja-mcphee/1959", "season": "2013-14"}, {"team_id": 316, "team": "Jacksonville", "id": "1953", "name": "<NAME>", "year": "Senior", "hometown": "Vero Beach, Fla. (Vero Beach)", "high_school": null, "previous_school": null, "height": "5'10\"", "position": "Forward", "jersey": "5", "url": "/sports/womens-basketball/roster/jade-cargill/1953", "season": "2013-14"}, {"team_id": 316, "team": "Jacksonville", "id": "1950", "name": "<NAME>", "year": "Sophomore", "hometown": "Decatur, Ga. (Decatur)", "high_school": null, "previous_school": null, "height": "5'10\"", "position": "Guard", "jersey": "10", "url": "/sports/womens-basketball/roster/queen-alford/1950", "season": "2013-14"}, {"team_id": 316, "team": "Jacksonville", "id": "1960", "name": "<NAME>", "year": "Senior", "hometown": "Wildwood, Fla. (Wildwood)", "high_school": null, "previous_school": null, "height": "5'5\"", "position": "Guard", "jersey": "11", "url": "/sports/womens-basketball/roster/ronisha-mitchell/1960", "season": "2013-14"}, {"team_id": 316, "team": "Jacksonville", "id": "1957", "name": "<NAME>'", "year": "Redshirt Sophomore", "hometown": "Pensacola, Fla. (Pensacola)", "high_school": null, "previous_school": null, "height": "5'4\"", "position": "Guard", "jersey": "12", "url": "/sports/womens-basketball/roster/ladeyah-forte-/1957", "season": "2013-14"}, {"team_id": 316, "team": "Jacksonville", "id": "1954", "name": "<NAME>", "year": "Junior", "hometown": "Weston, Fla. (UNC Greensboro)", "high_school": null, "previous_school": null, "height": "5'8\"", "position": "Guard", "jersey": "15", "url": "/sports/womens-basketball/roster/april-carson/1954", "season": "2013-14"}, {"team_id": 316, "team": "Jacksonville", "id": "1958", "name": "<NAME>", "year": "Senior", "hometown": "San Antonio, Texas (Judson)", "high_school": null, "previous_school": null, "height": "5'9\"", "position": "Guard", "jersey": "20", "url": "/sports/womens-basketball/roster/ciara-mclee/1958", "season": "2013-14"}, {"team_id": 316, "team": "Jacksonville", "id": "1956", "name": "<NAME>", "year": "Senior", "hometown": "Miami. Fla. (Santa Fe)", "high_school": null, "previous_school": null, "height": "5'8\"", "position": "Guard", "jersey": "21", "url": "/sports/womens-basketball/roster/stephanie-edwards/1956", "season": "2013-14"}, {"team_id": 316, "team": "Jacksonville", "id": "1961", "name": "<NAME>", "year": "Freshman", "hometown": "Jacksonville, Fla. (Ribault)", "high_school": null, "previous_school": null, "height": "5'8\"", "position": "Guard", "jersey": "22", "url": "/sports/womens-basketball/roster/sherranda-reddick/1961", "season": "2013-14"}, {"team_id": 316, "team": "Jacksonville", "id": "1951", "name": "<NAME>", "year": "Junior", "hometown": "Freeport, Bahamas", "high_school": null, "previous_school": null, "height": "5'9\"", "position": "Guard", "jersey": "23", "url": "/sports/womens-basketball/roster/ariel-brown/1951", "season": "2013-14"}, {"team_id": 316, "team": "Jacksonville", "id": "1952", "name": "<NAME>", "year": "Sophomore", "hometown": "Haines City, Fla. (Haines City)", "high_school": null, "previous_school": null, "height": "5'11\"", "position": "Forward", "jersey": "24", "url": "/sports/womens-basketball/roster/briona-brown/1952", "season": "2013-14"}, {"team_id": 316, "team": "Jacksonville", "id": "1962", "name": "<NAME>", "year": "Senior", "hometown": "Atlanta, Ga. (Atlanta International School)", "high_school": null, "previous_school": null, "height": "6'3\"", "position": "Center", "jersey": "32", "url": "/sports/womens-basketball/roster/madison-scott/1962", "season": "2013-14"}, {"team_id": 316, "team": "Jacksonville", "id": "1963", "name": "<NAME>", "year": "Freshman", "hometown": "Port-Au-Prince, Haiti (Paulding County)", "high_school": null, "previous_school": null, "height": "6'2\"", "position": "Center", "jersey": "42", "url": "/sports/womens-basketball/roster/jenny-vernet/1963", "season": "2013-14"}]
json
<reponame>joanmrc1/dogo-mobile import { createActions, createReducer } from 'reduxsauce'; export const { Types, Creators } = createActions({ asyncVermifugation: ['vermifuge', 'petId', 'weight', 'dateOfAppointment', 'repeatIn'] }); console.tron.log(Types); const INITIAL_STATE = {}; export default createReducer(INITIAL_STATE, {});
javascript
The government’s move to include iron and steel products under the tax refund scheme — RoDTEP — will help Indian steel players to expand global footprint, Union minister Jyotiraditya Scindia said on Thursday. The move follows removal of export duty on steel products to nil effective November 19, 2022, the steel minister said terming it a “progressive decision”. The government on Wednesday extended export benefits under the tax refund scheme to products of iron and steel along with chemicals, pharmaceuticals for a specified period with a view to boost shipments of these goods, amidst exports growth recording a contraction of 16.65 per cent in October. These sectors were left out in the earlier exercise which was conducted in August 2021. Under the Remission of Duties and Taxes on Exported Products (RoDTEP) Scheme, benefits will be given to exports made during December 15 this year till September 30 next year. “A welcome move following the removal of export duty on steel products. This would boost steel exports, helping our players expand their footprint in international markets. Thank you, @narendramodi Ji, @nsitharaman ji & @PiyushGoyal Ji for the progressive decision!,” he said.
english
Amitabh Bachchan was charged on Monday after it was assumed that he had sung India‘s national anthem incorrectly during the crucial India vs Pakistan, Super 10 Group 2, Match 19 at the historic Eden Gardens in Kolkata on Saturday. A complaint regarding the actor was filed at the Ashok Nagar Police Station in New Delhi. It was also reported earlier, that Amitabh had charged Rs. 4 crore for his appearance in the Indo-Pak tie at Eden and to sing the national anthem. However, later Cricket Association of Bengal (CAB) president Sourav Ganguly cleared the air by rubbishing those reports and said that instead Amitabh had invested Rs. 30 lakhs from his own pocket to travel and stay in the ‘City of Joy’. This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful. Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings. If you disable this cookie, we will not be able to save your preferences. This means that every time you visit this website you will need to enable or disable cookies again.
english