text
stringlengths
1
1.04M
language
stringclasses
25 values
<reponame>lightscript/parser { "_comment": "LightScript+TypeScript is temporarily disabled", "banPlugins": ["lscCoreSyntax", "bangCall"], "sourceType": "module", "plugins": ["typescript"] }
json
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const Expression_1 = require("./Expression"); exports.BinaryExpressionBase = Expression_1.Expression; class BinaryExpression extends exports.BinaryExpressionBase { /** * Gets the left side of the binary expression. */ getLeft() { return this._getNodeFromCompilerNode(this.compilerNode.left); } /** * Gets the operator token of the binary expression. */ getOperatorToken() { return this._getNodeFromCompilerNode(this.compilerNode.operatorToken); } /** * Gets the right side of the binary expression. */ getRight() { return this._getNodeFromCompilerNode(this.compilerNode.right); } } exports.BinaryExpression = BinaryExpression;
javascript
Snapchat users were highly alarmed when the application’s AI posted a strange story of an alleged “wall or ceiling”, raising users’ possible doubts about the AI chatbot’s consciousness gain. The AI post was later confirmed to have happened because of a temporary outage, which has been fixed now. With AI’s tremendous surge in popularity over the past year, it is becoming a very serious global worry. Due to tools like Siri, Alexa, and Cortana as well as prominent appearances in movies like the Terminator saga, AI has long been on people’s minds. With the emergence of tools like ChatGPT, there is now a worry that AI may become overly strong or be utilised unethically. Hollywood writers have partially reacted to this by going on strike, as some fear that studios may decide to use AI to compose scripts. Additionally, earlier this year, AI was introduced to Snapchat. It is shown at the top of everyone’s chat feed and is available for communication. But when Snapchat users noticed the AI submitted its first story today, something strange happened. It was difficult to discern if it was a video of a wall or ceiling. Users naturally started to wonder what the AI was doing as it had never done this before, but it started to ignore them, which was something it had never done before. Others began to get boilerplate replies from the AI that said it “doesn’t understand” or had “experienced a technical issue.” The Snapchat Story was erased by the AI after over an hour of bewilderment. Users of Snapchat turned to other social media sites to express their worry and even dread over this. According to some theories, AI has advanced, gaining greater consciousness.
english
The Washington Wizards will host defending champions Milwaukee Bucks in an exciting 2021-22 NBA season game at Capital One Arena on Sunday. The Wizards bounced back from a two-game skid in their previous outing against the Memphis Grizzlies. They defeated Ja Morant and co. 115-87. Seven players scored in double-digits. Montrezl Harrell scored a team-high 18 points, while Bradley Beal had 17 on the night. Meanwhile, the Bucks endured a 113-98 loss against the New York Knicks in their last game. They blew a 21-point lead after a dismal second-half showing. Giannis Antetokounmpo led the charge with 25 points, while Grayson Allen had 22 points. The Milwaukee Bucks will continue to be without Donte DiVincenzo (ankle surgery), Brook Lopez (back tightness) and Khris Middleton (Covid-19 protocols). Grayson Allen was the latest to join the injury report and is listed as questionable because of illness. The Washington Wizards have listed four players on their injury report. They are Davis Bertans, Thomas Bryant, Rui Hachimura and Cassius Winston. Bertans is out because of an ankle sprain, while Bryant is recovering from an ACL injury. Hachimura is not with the team and Winston has endured a hamstring injury. With regular starters Khris Middleton and Brook Lopez still out, the Milwaukee Bucks will continue to work with a makeshift lineup. Jrue Holiday and Grayson Allen could start in the backcourt, while Giannis Antetokounmpo, Pat Connaughton and Thanasis Antetokounmpo are likely to complete the rest of the lineup. Bobby Portis, George Hill and Jordan Nwora could play the most minutes off the bench. The Washington Wizards are not expected to make any changes to their regular starting lineup. Spencer Dinwiddie and Bradley Beal will likely start as guards, while Kentavious Caldwell-Pope, Kyle Kuzma and Daniel Gafford will complete the rest of the lineup. Montrezl Harrell, Raul Neto and Deni Avdija will likely play the most minutes off the bench. Point Guard - Jrue Holiday | Shooting Guard - Grayson Allen | Small Forward - Pat Connaughton | Power Forward - Thanasis Antetokounmpo | Center - Giannis Antetokounmpo. Point Guard - Spencer Dinwiddie | Shooting Guard - Bradley Beal | Small Forward - Kentavious Caldwell-Pope | Power Forward - Kyle Kuzma | Center - Daniel Gafford. Check out all NBA Trade Deadline 2024 deals here as big moves are made!
english
vti_encoding:SR|utf8-nl vti_timelastmodified:TR|19 Dec 2013 15:34:30 -0000 vti_extenderversion:SR|12.0.0.6500 vti_author:SR|OMCLIENT1\\User vti_modifiedby:SR|OMCLIENT1\\User vti_timecreated:TR|19 Dec 2013 15:34:30 -0000 vti_cacheddtm:TX|19 Dec 2013 15:34:30 -0000 vti_filesize:IR|230 vti_backlinkinfo:VX|demos/popup-image-scaling/index.html
javascript
#!/usr/bin/env python3 import os from setuptools import setup, find_packages from setuptools.command.build_py import build_py from setuptools.command.sdist import sdist from setuptools.command.develop import develop import versioneer PACKAGE_NAME = 'opsdroid' HERE = os.path.abspath(os.path.dirname(__file__)) README = open(os.path.join(HERE, 'README.md'), encoding="utf8").read() PACKAGES = find_packages(exclude=['tests', 'tests.*', 'modules', 'modules.*', 'docs', 'docs.*']) # For now we simply define the install_requires based on the contents # of requirements.txt. In the future, install_requires may become much # looser than the (automatically) resolved requirements.txt. with open(os.path.join(HERE, 'requirements.txt'), 'r') as fh: REQUIRES = [line.strip() for line in fh] class Develop(develop): """Custom `develop` command to always build mo files on install -e.""" def run(self): self.run_command('compile_catalog') develop.run(self) # old style class class BuildPy(build_py): """Custom `build_py` command to always build mo files for wheels.""" def run(self): self.run_command('compile_catalog') build_py.run(self) # old style class class Sdist(sdist): """Custom `sdist` command to ensure that mo files are always created.""" def run(self): self.run_command('compile_catalog') sdist.run(self) # old style class setup( name=PACKAGE_NAME, version=versioneer.get_version(), license='Apache License 2.0', url='https://opsdroid.github.io/', download_url='https://github.com/opsdroid/opsdroid/releases', author='<NAME>', author_email='<EMAIL>', description='An open source ChatOps bot framework.', long_description=README, packages=PACKAGES, include_package_data=True, zip_safe=False, platforms='any', classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Console', 'Framework :: AsyncIO', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'Intended Audience :: Information Technology', 'License :: OSI Approved :: Apache Software License', 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3 :: Only', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Topic :: Communications :: Chat', 'Topic :: Scientific/Engineering :: Artificial Intelligence', 'Topic :: Software Development :: Libraries :: Python Modules' ], install_requires=REQUIRES, dependency_links=[ "git+https://github.com/opsdroid/aioslacker.git@26fb78de6e9fedfaab650ea5c3b87b33c4fc9657#egg=aioslacker==0.0.10" ], test_suite='tests', keywords=[ 'bot', 'bot-framework', 'opsdroid', 'botkit', 'python3', 'asyncio', 'chatops', 'devops', 'nlu' ], setup_requires=['Babel'], cmdclass=versioneer.get_cmdclass({'sdist': Sdist, 'build_py': BuildPy, 'develop': Develop}), entry_points={ 'console_scripts': [ 'opsdroid = opsdroid.__main__:main' ] }, )
python
After Kumble stepped down from the post, citing 'untenable' differences with the current team captain Virat Kohli, Ravi Shastri is appeared to be front-runner for this position of coach. Shastri had applied for the position last year too but Kumble was favoured over him. Internet calls 'Cham Cham' girl Shraddha Kapoor the reason for rains at IPL Finale; Actress reacts! Nushrratt Bharuccha tops the popular Indian celebrities list by IMDb!
english
With the ongoing oxygen crisis in parts of the country remaining tight at a time when supply has increased exponentially but logistics are an ailing issue, Megastar Chiranjeevi has decided to set up Oxygen Banks in the Telugu States. It's learned that the legendary actor will reach out to the oxygen needs in Telangana and Andhra Pradesh. A source has revealed that the Oxygen Banks will be monitored by Ram Charan. The father-son duo will be mobilizing the manpower of their fans associations. The President of the respective district fans association will look after the logistics. As per the official sources, the banks will be operated from the last week of this month. The die-hard fans of the Mega family have expressed their happiness over the development. The Chiru-Charan duo have joined hands with their fans to save lives. Chiru was moved by the death of a patient for want of blood in 1998 and the incident triggered the thought of launching a blood bank. In the time of covid crisis, he is now starting the bank of a different kind. Of late, the 'Acharya' actor has been in the news for rendering financial assistance to the needy in the film industry. Last year, he fronted the Corona Crisis Charity. Follow us on Google News and stay updated with the latest!
english
{"AuthorName":"","IDEA_Path":"/Applications/Cardea-IU-130.1619.app/Contents/MacOS/idea","DefaultEditor":"Visual Studio Code","IDEA_Flixel_Engine_Library":"Flixel Engine","IDEA_Flixel_Addons_Library":"Flixel Addons","IDEAutoOpen":true,"IDEA_flexSdkName":"flex_4.6"}
json
Bismillah hir-Rahman nir-Rahim ! (Fatwa: 23/23/M=03/1435) It is makrooh tahrimi for male to wear jubbah etc below ankles. Hadith warns on wearing lungi or pyjama etc below the ankles. Committing makrooh act during salah is even worse. You may wear it if you cut it short from the end or fold it and stitch. Darul Ifta,
english
{ "vorgangId": "217361", "VORGANG": { "WAHLPERIODE": "8", "VORGANGSTYP": "Rechtsverordnung", "TITEL": "Achte Verordnung zur Änderung von Rechtsvorschriften zum Saatgutverkehrsgesetz (G-SIG: 00021753)", "INITIATIVE": "Bundesministerium für Ernährung, Landwirtschaft und Forsten", "AKTUELLER_STAND": "Abgeschlossen - Ergebnis siehe Vorgangsablauf", "SIGNATUR": "", "GESTA_ORDNUNGSNUMMER": "", "WICHTIGE_DRUCKSACHE": { "DRS_HERAUSGEBER": "BR", "DRS_NUMMER": "532/79", "DRS_TYP": "Verordnung" }, "PLENUM": { "PLPR_KLARTEXT": "BR-Sitzung", "PLPR_HERAUSGEBER": "BR", "PLPR_NUMMER": "481", "PLPR_SEITEN": "420A", "PLPR_LINK": "http://dipbt.bundestag.de:80/dip21/brp/481.pdf#P.420" }, "EU_DOK_NR": "", "VERKUENDUNG": "Verordnung vom 21.12.1979 - Bundesgesetzblatt Teil I 1979 Nr.7729.12.1979 S. 2379 https://www.bgbl.de/xaver/bgbl/start.xav?startbk=Bundesanzeiger_BGBl&start=//*[@attr_id='bgbl179s2379.pdf']", "SCHLAGWORT": [ "Mais", { "_fundstelle": "true", "__cdata": "Saatgutverkehrsgesetz" } ], "ABSTRAKT": "Anpassung der Saatgutverordnung - Landwirtschaft an die Erfordernisse der Praxis in der Saatgutvermehrung und -aufbereitung sowie des -Vertriebs; Änderungen im Hinblick auf die Teilnahme der Deutschen Saatgutwirtschaft am OECD-System für sortenmäßige Zertifizierung von Maissaatgut " }, "VORGANGSABLAUF": { "VORGANGSPOSITION": [ { "ZUORDNUNG": "BR", "URHEBER": "Verordnung, Urheber : Bundesministerium für Ernährung, Landwirtschaft und Forsten ", "FUNDSTELLE": "31.10.1979 - BR-Drucksache 532/79", "ZUWEISUNG": { "AUSSCHUSS_KLARTEXT": "Agrarausschuss", "FEDERFUEHRUNG": "federf&uuml;hrend" } }, { "ZUORDNUNG": "BR", "URHEBER": "BR-Sitzung", "FUNDSTELLE": "21.12.1979 - BR-Plenarprotokoll 481, S. 420A", "FUNDSTELLE_LINK": "http://dipbt.bundestag.de:80/dip21/brp/481.pdf#P.420", "BESCHLUSS": { "BESCHLUSSSEITE": "420A", "BESCHLUSSTENOR": "Zustimmung gem.Art.80 Abs.2 GG" } }, { "ZUORDNUNG": "BR", "URHEBER": "Beschlussdrucksache, Urheber : Bundesrat ", "FUNDSTELLE": "21.12.1979 - BR-Drucksache 532/79(B)" } ] } }
json
<filename>css/cover-letters.css #letter-body h6, { color: hsl(200, 25%, 25%); } #letter-body p { margin-top:1rem; margin-bottom:2.2rem; } #letter-body .signature { color: hsl(200,15%,35%); font-size:1.06em; font-weight: bold; padding-bottom: 0; } #letter-body .recipient { margin-bottom: 5rem; margin-top: 4rem; }
css
Sydney, Jan 2: Australia speedster Pat Cummins has rubbished talks of his elevation as the future Test skipper while hailing the incumbent Tim Paine of doing a “brilliant job”. Cummins, who starred with both bat and ball, taking career-best figures of 6/27 in the second innings and registering another career-best 63 with the willow, albeit in a losing cause in the Boxing Day Test against India at the Melbourne Cricket Ground (MCG), drew calls from leg-spin legend Shane Warne that the 25-year-old pacer evokes captaincy material. Cummins, who rose to No.3 on the ICC Test blowing rankings after his MCG haul of 9/99, said he is more focussed on improving his individual game at the moment. “I feel like I’m too busy in the game bowling and when I’m batting putting all my effort into that. And when I’m not doing it I’m usually off with the fairies trying to recover. “So, I don’t think I would make a very good captain at the moment,” he added. Cummins, however, did not rule out the possibility of appointing a fast bowler as the captain and in such a scenario has backed Josh Hazlewood for the vice captain’s role. “I think someone like Josh Hazlewood at the moment has an enhanced role as vice captain, he’s always thinking about the game when he’s out there fielding. “When he’s batting in the sheds he is always watching and thinking things through. Maybe it’s different personalities, but I see no reason why a bowler can’t be a captain,” Cummins said.
english
Mishan Impossible starring Taapsee Pannu, Harsh Roshan, Bhanu Prakash, Jayateertha Molugu, Hareesh Peradi, Ravindra Vijay, and others, was released yesterday on 1st April and received mixed response by the movie lovers and the critics on its opening day. Now according to the latest report, Mishan Impossible has become the latest victim of the piracy as it has been leaked online and is available for the free download. After Agent Sai Srinivasa Athreya director Swaroop has directed Taapsee Pannu starrer Mishan Impossible. The notorious film piracy site, Tamilrockers, has now made several links available to download Taapsee Pannu starrer Mishan Impossible for free in HD quality. The movie is also available on Telegram and Movierulz. The leak is an issue of concern for the makers as it may affect the box office collections. Row Swaroop magnum opus has become the latest target of piracy sites such as the TamilRockers, Filmywap, Movierulz among others. This is not the first time the piracy website leaked a film online. Earlier, films and shows such as RRR, Love Story, Rowdy boys, Vakeel Saab, Pushpa: The Rise, Godzilla vs. Kong, The Big Bull, Joji, Rang De, Mumbai Saaga, Jathi Ratnalu, Ashram 2, Ludo, Chhalaang, among others became the target of the piracy sites.
english
{ "701806f-a": { "width": 600, "thumb_url": "http://oldnyc-assets.nypl.org/thumb/701806f-a.jpg", "image_url": "http://oldnyc-assets.nypl.org/600px/701806f-a.jpg", "title": "", "date": "1940", "text": "Soundview Avenue, at the N. E. corner of Randall Avenue, showing the Franciscan Friary. On the right is Public School No. 69.\nAugust 21, 1940\nP. L. Sperr\n", "folder": "Soundview Avenue & Randall Avenue, Bronx, NY", "height": 404, "original_title": "Bronx: Soundview Avenue - Randall Avenue", "years": [ "1940" ] } }
json
{ "editor.renderWhitespace": "all", "editor.wordWrap": "off", "editor.defaultFormatter": "esbenp.prettier-vscode", "editor.formatOnSave": true, "[markdown]": { "editor.formatOnSave": false, "editor.wordWrap": "on" }, "[javascriptreact]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, "typescript.suggest.completeJSDocs": false, "eslint.validate": [ "javascript", "javascriptreact", "typescript", "typescriptreact" ], "eslint.workingDirectories": [ { "mode": "auto" } ], "search.exclude": { "**/node_modules": true, "**/.next": true, "**/.storybook": true, "**/ursys/server": true, "**/ursys/client": true, "**/package-lock.json": true } }
json
Lady Gaga took some time out to shop as well in Dilli Haat. Lady Gaga came in to perform for the F1 After Party at Arjun Rampal's club - Lap. He came in to promote Mission Impossible 4 that also starred Anil Kapoor. Singer Akon was in India to record his two songs - Chammak Challo' and 'Criminal' for the movie 'RA. One' with Shah Rukh Khan. Metallica was in India in November to kick start the F1 clebration. s The Delhi concert was cancelled but Bangalore got a chance to see them perform. Rowan Atkinson was in India for the F1 Grand Prix. Tom Cruise was the last celebrity to visit India. Katy Perry had her 'marriage' trip to India in 2010. But she made another visit in 2011. Katy Perry ad Russel Brand were here in India in 2011 for a visit. Judi dench was here to shoot for her next movie 'The Best Exotic Marigold Hotel'. The movie also stars Dev Patel and Tara Desae. Hugh Jackman was in India for FICCI Frames. Shakira was in India to perform for a private party. Paris Hilton was in India to promote her line of handbags. Pitbull was in India for a three day tour. Quite a few international celebrities dropped in to India this year.
english
What are you trying to say? in Different Languages: Please find below many ways to say What are you trying to say? in different languages. This page features translation of the word "What are you trying to say?" to over 100 other languages. We also invite you to listen to audio pronunciation in more than 40 languages, so you could learn how to pronounce What are you trying to say? and how to read it. |Ways to say What are you trying to say? |Kurdish (Kurmanji) |Hûn hewl didin çi bêjin? |سعی می کنید چه چیزی را بیان کنید؟ |Ways to say What are you trying to say? |Kion vi provas diri? |Kisa w ap eseye di? |Dic quid me temptatis? "What are you trying to say? in Different Languages." In Different Languages, https://www.indifferentlanguages.com/words/what_are_you_trying_to_say%3F. Accessed 07 Oct 2023. Dictionary Entries near What are you trying to say?
english
<gh_stars>0 package principals import ( "context" "github.com/spf13/viper" ) // Principals is the interface that wrap the get of SMK Principals. type Principals interface { Init(config *viper.Viper) error Get(ctx context.Context, payload []byte) (context.Context, []string, error) }
go
<filename>test/e2e/widgets/search-bar.page.ts import {browser, protractor, element, by} from 'protractor'; const EC = protractor.ExpectedConditions; const common = require('../common.js'); const delays = require('../config/delays'); /** * @author <NAME> */ export class SearchBarPage { // elements public static getSelectedTypeFilterButton() { return element(by.css('#filter-button type-icon')); } public static getSearchBarInputField() { return element(by.id('object-search')); } // text public static getSearchBarInputFieldValue() { return SearchBarPage.getSearchBarInputField().getAttribute('value'); } public static getSelectedTypeFilterCharacter() { browser.wait(EC.presenceOf(SearchBarPage.getSelectedTypeFilterButton()), delays.ECWaitTime); return SearchBarPage.getSelectedTypeFilterButton().element(by.css('.character')).getText(); } // click public static clickChooseTypeFilter(typeName) { common.click(element(by.id('searchfilter'))); common.click(element(by.id('choose-type-option-' + typeName))); } public static clickSearchBarInputField() { return common.click(SearchBarPage.getSearchBarInputField()); } // type in public static typeInSearchField(text) { return common.typeIn(SearchBarPage.getSearchBarInputField(), text); } }
typescript
263 (60. 4 ov) 237 (52. 3 ov) 331/9 (50. 0 ov) 189 (43. 2 ov) Eight-wicket win helps India take unassailable lead in three-match series. Sravanthi Naidu's four wicket haul lead the way in India's victory against the hosts. The International Cricket Council (ICC) on Tuesday announced a revised schedule for the Women's World Twenty20 Qualifier in Dublin this year which will now see top three teams from the event advancing to next year's World Twenty20 in Bangladesh instead of one. The Indian women's cricket team rode on a disciplined bowling performance to register a 58-run victory over Bangladesh in the third and final One-day International and inflict a 3-0 whitewash on the visitors. Indian Women rode on Harmanpreet Kaur's century to defeat Bangladesh by 46 runs in the second ODI and take an unassailable 2-0 lead in the three-match series. The coach of Bangladesh Women's cricket team Oshadee Weerasinghe on Sunday said that he side would look to avoid a whitewash in the three-match ODI series against India. The Indian women's cricket team rode on a disciplined bowling performance to register a 10-run win over Bangladesh in the third and final T20 International and inflict a 3-0 whitewash on the visitors. Poonam Raut and Thirush Kamini scored contrasting half-centuries in a 130-run opening stand as India thrashed Bangladesh by 49 runs in the first Twenty20 cricket international to a take a 1-0 lead in the three-match series, at Vadodara on Tuesday. The Indian women's cricket team will start its limited-overs series campaign against Bangladesh in Baroda on Tuesday.
english
<gh_stars>1-10 export class Examination { public name: string; public timeCreated: number; public timeUpdated: number; public date: number; public tags: any[]; public details: any; }
typescript
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":4},"outputFile":{"path":"/Users/parnilsamsen/projects/personal/android/kissfft/sample/prod/release/keigenDemo-1.1-prod-release.apk"},"properties":{"packageId":"com.paramsen.keigen.sample","split":""}}]
json
<filename>pkg/kubelet/pod/pod_manager_test.go /* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package pod import ( "reflect" "testing" "k8s.io/kubernetes/pkg/api/v1" podtest "k8s.io/kubernetes/pkg/kubelet/pod/testing" kubetypes "k8s.io/kubernetes/pkg/kubelet/types" ) // Stub out mirror client for testing purpose. func newTestManager() (*basicManager, *podtest.FakeMirrorClient) { fakeMirrorClient := podtest.NewFakeMirrorClient() manager := NewBasicPodManager(fakeMirrorClient).(*basicManager) return manager, fakeMirrorClient } // Tests that pods/maps are properly set after the pod update, and the basic // methods work correctly. func TestGetSetPods(t *testing.T) { mirrorPod := &v1.Pod{ ObjectMeta: v1.ObjectMeta{ UID: "987654321", Name: "bar", Namespace: "default", Annotations: map[string]string{ kubetypes.ConfigSourceAnnotationKey: "api", kubetypes.ConfigMirrorAnnotationKey: "mirror", }, }, } staticPod := &v1.Pod{ ObjectMeta: v1.ObjectMeta{ UID: "123456789", Name: "bar", Namespace: "default", Annotations: map[string]string{kubetypes.ConfigSourceAnnotationKey: "file"}, }, } expectedPods := []*v1.Pod{ { ObjectMeta: v1.ObjectMeta{ UID: "999999999", Name: "taco", Namespace: "default", Annotations: map[string]string{kubetypes.ConfigSourceAnnotationKey: "api"}, }, }, staticPod, } updates := append(expectedPods, mirrorPod) podManager, _ := newTestManager() podManager.SetPods(updates) // Tests that all regular pods are recorded correctly. actualPods := podManager.GetPods() if len(actualPods) != len(expectedPods) { t.Errorf("expected %d pods, got %d pods; expected pods %#v, got pods %#v", len(expectedPods), len(actualPods), expectedPods, actualPods) } for _, expected := range expectedPods { found := false for _, actual := range actualPods { if actual.UID == expected.UID { if !reflect.DeepEqual(&expected, &actual) { t.Errorf("pod was recorded incorrectly. expect: %#v, got: %#v", expected, actual) } found = true break } } if !found { t.Errorf("pod %q was not found in %#v", expected.UID, actualPods) } } // Tests UID translation works as expected. if uid := podManager.TranslatePodUID(mirrorPod.UID); uid != staticPod.UID { t.Errorf("unable to translate UID %q to the static POD's UID %q; %#v", mirrorPod.UID, staticPod.UID, podManager.mirrorPodByUID) } // Test the basic Get methods. actualPod, ok := podManager.GetPodByFullName("bar_default") if !ok || !reflect.DeepEqual(actualPod, staticPod) { t.Errorf("unable to get pod by full name; expected: %#v, got: %#v", staticPod, actualPod) } actualPod, ok = podManager.GetPodByName("default", "bar") if !ok || !reflect.DeepEqual(actualPod, staticPod) { t.Errorf("unable to get pod by name; expected: %#v, got: %#v", staticPod, actualPod) } }
go
Listen closely and you’ll hear the bell tolling for the Nintendo Switch. After nearly 7 years, the handheld hybrid responsible for restoring the fortunes of gaming’s most venerable company is teeing up its final run of games; and what a joyous line-up it is. September’s Nintendo Direct featured a mix of titles we already knew of, along with a couple of happy little surprises along the way. Given the reception to The Super Mario Bros. Movie earlier this year, there’s little wonder (see what we did there) that everyone’s favorite plumber in red is leading the charge through what we can safely assume are the console’s final months.
english
{"categories":["Data Management","Databases","Engineering"],"desc":"\n","details":{"authors":"<NAME>, <NAME>","format":"pdf","isbn-10":"1484208781","isbn-13":"978-1484208786","pages":"556 pages","publication date":"December 18, 2014","publisher":"Apress","size":"47.61Mb"},"img":"http://2192.168.3.11/covers/17/172bee9eca105eeab9e54e1671c3531f.jpg","link":"https://rapidhosting.info/files/fib","title":"Database Systems: A Pragmatic Approach"}
json
The Internet has revolutionised our ability to communicate and share data beyond national boundaries, thereby facilitating cross-border social and commercial interactions. Enabling cross-border data flows, however, raises a number of important Internet governance policy considerations for a broad range of stakeholders, such as business, intermediaries, users, law enforcement agencies, governments, policymakers and the wider Internet technical community. In this context, the workshop will explore policy issues, from various stakeholder perspectives. The dynamic panel of experts will provide a wide range of perspectives for this discussion and explore concrete solutions and options for enabling cross-border data flows. This is an important opportunity to raise awareness about the practical and the policy realities raised by these issues. It will also be an opportunity to share concrete issues, experiences, possible approaches and solutions. Christoph Steck, Chief Regulatory Officer, Telefonica (TBC)
english
from dataserv_client import common import os import tempfile import unittest import datetime import json import psutil from future.moves.urllib.request import urlopen from dataserv_client import cli from dataserv_client import api from btctxstore import BtcTxStore from dataserv_client import exceptions url = "http://127.0.0.1:5000" common.SHARD_SIZE = 1024 * 128 # monkey patch shard size to 128K class AbstractTestSetup(object): def setUp(self): self.btctxstore = BtcTxStore() # debug output the server online list # print(urlopen(url + '/api/online/json').read().decode('utf8')) class TestClientRegister(AbstractTestSetup, unittest.TestCase): def test_register_payout(self): client = api.Client(url=url, config_path=tempfile.mktemp()) config = client.config() self.assertTrue(client.register()) result = json.loads( urlopen(url + '/api/online/json').read().decode('utf8') ) result = [farmer for farmer in result['farmers'] if farmer['payout_addr'] == config['payout_address']] last_seen = result[0]['last_seen'] reg_time = result[0]['reg_time'] result = json.dumps(result, sort_keys=True) expected = json.dumps([{ 'height': 0, 'nodeid': common.address2nodeid(config['payout_address']), 'last_seen': last_seen, 'payout_addr': config['payout_address'], 'reg_time': reg_time, 'bandwidth_upload': 0, 'bandwidth_download': 0, "ip": "", 'uptime': 100.0 }], sort_keys=True) self.assertEqual(result, expected) def test_register(self): # register without createing a config client = api.Client(url=url) self.assertTrue(client.register()) def test_already_registered(self): def callback(): client = api.Client(url=url, config_path=tempfile.mktemp()) client.register() client.register() self.assertRaises(exceptions.AddressAlreadyRegistered, callback) def test_invalid_farmer(self): def callback(): client = api.Client(url=url + "/xyz", config_path=tempfile.mktemp()) client.register() self.assertRaises(exceptions.ServerNotFound, callback) class TestClientPing(AbstractTestSetup, unittest.TestCase): def test_ping(self): client = api.Client(url=url, config_path=tempfile.mktemp()) self.assertTrue(client.register()) self.assertTrue(client.ping()) def test_invalid_farmer(self): def callback(): client = api.Client(url=url + "/xyz", config_path=tempfile.mktemp()) client.ping() self.assertRaises(exceptions.ServerNotFound, callback) class TestClientPoll(AbstractTestSetup, unittest.TestCase): def test_poll(self): client = api.Client(url=url, config_path=tempfile.mktemp()) client.register() before = datetime.datetime.now() self.assertTrue(client.poll(delay=2, limit=2)) after = datetime.datetime.now() # check that poll did 2 pings with 2 sec delay self.assertTrue(datetime.timedelta(seconds=2) <= (after - before)) class TestInvalidArgument(AbstractTestSetup, unittest.TestCase): def test_invalid_retry_limit(self): def callback(): api.Client(connection_retry_limit=-1, config_path=tempfile.mktemp()) self.assertRaises(exceptions.InvalidInput, callback) def test_invalid_retry_delay(self): def callback(): api.Client(connection_retry_delay=-1, config_path=tempfile.mktemp()) self.assertRaises(exceptions.InvalidInput, callback) def test_invalid_negativ_max_size(self): def callback(): api.Client(max_size=-1, config_path=tempfile.mktemp()) self.assertRaises(exceptions.InvalidInput, callback) def test_invalid_zero_max_size(self): def callback(): api.Client(max_size=0, config_path=tempfile.mktemp()) self.assertRaises(exceptions.InvalidInput, callback) def test_invalid_negativ_min_free_size(self): def callback(): api.Client(min_free_size=-1, config_path=tempfile.mktemp()) self.assertRaises(exceptions.InvalidInput, callback) def test_invalid_zero_min_free_size(self): def callback(): api.Client(min_free_size=0, config_path=tempfile.mktemp()) self.assertRaises(exceptions.InvalidInput, callback) def test_build_invalid_negative_workers(self): def callback(): client = api.Client(config_path=tempfile.mktemp()) client.build(workers=-1) self.assertRaises(exceptions.InvalidInput, callback) def test_farm_invalid_zero_workers(self): def callback(): client = api.Client(config_path=tempfile.mktemp()) client.farm(workers=0) self.assertRaises(exceptions.InvalidInput, callback) def test_build_invalid_negative_set_height_interval(self): def callback(): client = api.Client(config_path=tempfile.mktemp()) client.build(set_height_interval=-1) self.assertRaises(exceptions.InvalidInput, callback) def test_farm_invalid_zero_set_height_interval(self): def callback(): client = api.Client(config_path=tempfile.mktemp()) client.farm(set_height_interval=0) self.assertRaises(exceptions.InvalidInput, callback) def test_farm_invalid_negative_set_height_interval(self): def callback(): client = api.Client(config_path=tempfile.mktemp()) client.farm(set_height_interval=-1) self.assertRaises(exceptions.InvalidInput, callback) def test_build_invalid_zero_set_height_interval(self): def callback(): client = api.Client(config_path=tempfile.mktemp()) client.build(set_height_interval=0) self.assertRaises(exceptions.InvalidInput, callback) def test_poll_invalid_negativ_delay(self): def callback(): client = api.Client(config_path=tempfile.mktemp()) client.poll(delay=-1, limit=0) self.assertRaises(exceptions.InvalidInput, callback) def test_audit_invalid_negativ_delay(self): def callback(): client = api.Client(config_path=tempfile.mktemp()) client.audit(delay=-1, limit=0) self.assertRaises(exceptions.InvalidInput, callback) class TestConnectionRetry(AbstractTestSetup, unittest.TestCase): def test_no_retry(self): def callback(): client = api.Client(url="http://invalid.url", connection_retry_limit=0, connection_retry_delay=0, config_path=tempfile.mktemp()) client.register() before = datetime.datetime.now() self.assertRaises(exceptions.ConnectionError, callback) after = datetime.datetime.now() self.assertTrue(datetime.timedelta(seconds=15) > (after - before)) def test_retry_server_not_found(self): def callback(): client = api.Client(url="http://ServerNotFound.url", config_path=tempfile.mktemp(), connection_retry_limit=2, connection_retry_delay=2) client.register() before = datetime.datetime.now() self.assertRaises(exceptions.ConnectionError, callback) after = datetime.datetime.now() self.assertTrue(datetime.timedelta(seconds=4) < (after - before)) def test_retry_invalid_url(self): def callback(): client = api.Client(url="http://127.0.0.257", config_path=tempfile.mktemp(), connection_retry_limit=2, connection_retry_delay=2) client.register() before = datetime.datetime.now() self.assertRaises(exceptions.ConnectionError, callback) after = datetime.datetime.now() self.assertTrue(datetime.timedelta(seconds=4) < (after - before)) def test_retry_high_retry_limit(self): def callback(): client = api.Client(url="http://127.0.0.257", config_path=tempfile.mktemp(), connection_retry_limit=2000, connection_retry_delay=0, quiet=True) client.register() self.assertRaises(exceptions.ConnectionError, callback) class TestClientBuild(AbstractTestSetup, unittest.TestCase): def test_build(self): client = api.Client(url=url, config_path=tempfile.mktemp(), max_size=1024 * 256) # 256K client.register() generated = client.build(cleanup=True) self.assertTrue(len(generated)) client = api.Client(url=url, config_path=tempfile.mktemp(), max_size=1024 * 512) # 512K config = client.config() client.register() generated = client.build(cleanup=True) self.assertTrue(len(generated) == 4) result = json.loads( urlopen(url + '/api/online/json').read().decode('utf8') ) result = [farmer for farmer in result['farmers'] if farmer['payout_addr'] == config['payout_address']] last_seen = result[0]['last_seen'] reg_time = result[0]['reg_time'] result = json.dumps(result, sort_keys=True) expected = json.dumps([{ 'height': 4, 'nodeid': common.address2nodeid(config['payout_address']), 'last_seen': last_seen, 'payout_addr': config['payout_address'], 'reg_time': reg_time, 'bandwidth_upload': 0, 'bandwidth_download': 0, "ip": "", 'uptime': 100.0 }], sort_keys=True) self.assertEqual(result, expected) def test_build_min_free_space(self): store_path = tempfile.mktemp() os.mkdir(store_path) my_free_size = psutil.disk_usage(store_path).free - (1024 * 256) # 256 client = api.Client(url=url, config_path=tempfile.mktemp(), store_path=store_path, max_size=1024 * 1024 * 2, min_free_size=my_free_size) # 256 config = client.config() client.register() generated = client.build() self.assertTrue(len(generated) > 0) # build at least 1 shard self.assertTrue(len(generated) < 16) # stoped cause of free Space result = json.loads( urlopen(url + '/api/online/json').read().decode('utf8') ) result = [farmer for farmer in result['farmers'] if farmer['payout_addr'] == config['payout_address']] last_seen = result[0]['last_seen'] reg_time = result[0]['reg_time'] result = json.dumps(result, sort_keys=True) expected = json.dumps([{ 'height': len(generated), 'nodeid': common.address2nodeid(config['payout_address']), 'last_seen': last_seen, 'payout_addr': config['payout_address'], 'reg_time': reg_time, 'bandwidth_upload': 0, 'bandwidth_download': 0, "ip": "", 'uptime': 100.0 }], sort_keys=True) self.assertEqual(result, expected) class TestClientFarm(AbstractTestSetup, unittest.TestCase): def test_farm(self): client = api.Client(url=url, config_path=tempfile.mktemp(), max_size=1024 * 256) # 256K befor = datetime.datetime.now() self.assertTrue(client.farm(delay=2, limit=2)) # check farm return true after = datetime.datetime.now() # check that farm did 2 pings with 2 sec delay self.assertTrue(datetime.timedelta(seconds=2) <= (after - befor)) def test_farm_registered(self): client = api.Client(url=url, config_path=tempfile.mktemp(), max_size=1024 * 256) # 256K config = client.config() client.register() befor = datetime.datetime.now() self.assertTrue(client.farm(delay=2, limit=2)) # check farm return true after = datetime.datetime.now() # check that farm did 2 pings with 2 sec delay self.assertTrue(datetime.timedelta(seconds=2) <= (after - befor)) result = json.loads( urlopen(url + '/api/online/json').read().decode('utf8') ) result = [farmer for farmer in result['farmers'] if farmer['payout_addr'] == config['payout_address']] last_seen = result[0]['last_seen'] reg_time = result[0]['reg_time'] # check bandwidth and pop as expected result cannot be know bandwidth_upload = result[0].pop('bandwidth_upload') bandwidth_download = result[0].pop('bandwidth_download') self.assertGreater(bandwidth_upload, 0) self.assertGreater(bandwidth_download, 0) result = json.dumps(result, sort_keys=True) expected = json.dumps([{ 'height': 2, 'nodeid': common.address2nodeid(config['payout_address']), 'last_seen': last_seen, 'payout_addr': config['payout_address'], 'reg_time': reg_time, "ip": "", 'uptime': 100.0 }], sort_keys=True) self.assertEqual(result, expected) class TestClientAudit(AbstractTestSetup, unittest.TestCase): @unittest.skip("to many blockchain api requests") def test_audit(self): client = api.Client(url=url, config_path=tempfile.mktemp(), max_size=1024 * 256) # 256K client.register() self.assertTrue(client.audit(delay=1, limit=1)) class TestClientCliArgs(AbstractTestSetup, unittest.TestCase): def test_version(self): args = [ "--config_path=" + tempfile.mktemp(), "version" ] self.assertTrue(cli.main(args)) def test_freespace(self): args = [ "--config_path=" + tempfile.mktemp(), "freespace" ] self.assertTrue(cli.main(args)) def test_poll(self): path = tempfile.mktemp() args = [ "--url=" + url, "--config_path=" + path, "register", ] cli.main(args) args = [ "--url=" + url, "--config_path=" + path, "poll", "--delay=0", "--limit=0" ] # no pings needed for check args self.assertTrue(cli.main(args)) def test_register(self): args = [ "--url=" + url, "--config_path=" + tempfile.mktemp(), "register" ] self.assertTrue(cli.main(args)) def test_build(self): path = tempfile.mktemp() args = [ "--url=" + url, "--config_path=" + path, "register", ] cli.main(args) args = [ "--url=" + url, "--config_path=" + path, "--max_size=" + str(1024 * 256), # 256K "--min_free_size=" + str(1024 * 256), # 256K "build", "--workers=4", "--cleanup", "--rebuild", "--repair", "--set_height_interval=3" ] self.assertTrue(cli.main(args)) def test_audit(self): path = tempfile.mktemp() args = [ "--url=" + url, "--config_path=" + path, "register", ] cli.main(args) args = [ "--url=" + url, "--config_path=" + path, "audit", "--delay=0", "--limit=0" ] # no audit needed for check args self.assertTrue(cli.main(args)) def test_farm(self): args = [ "--url=" + url, "--config_path=" + tempfile.mktemp(), "--max_size=" + str(1024 * 256), # 256K "--min_free_size=" + str(1024 * 256), # 256K "farm", "--workers=4", "--cleanup", "--rebuild", "--repair", "--set_height_interval=3", "--delay=0", "--limit=0" ] # no pings needed for check args self.assertTrue(cli.main(args)) def test_ping(self): config_path = tempfile.mktemp() args = [ "--url=" + url, "--config_path=" + config_path, "register" ] self.assertTrue(cli.main(args)) args = [ "--url=" + url, "--config_path=" + config_path, "ping" ] self.assertTrue(cli.main(args)) def test_no_command_error(self): def callback(): cli.main([]) self.assertRaises(SystemExit, callback) def test_input_error(self): def callback(): path = tempfile.mktemp() cli.main([ "--url=" + url, "--config_path=" + path, "register", ]) cli.main([ "--url=" + url, "--config_path=" + path, "poll", "--delay=5", "--limit=xyz" ]) self.assertRaises(ValueError, callback) class TestConfig(AbstractTestSetup, unittest.TestCase): def test_show(self): payout_wif = self.btctxstore.create_key() hwif = self.btctxstore.create_wallet() payout_address = self.btctxstore.get_address(payout_wif) client = api.Client(config_path=tempfile.mktemp()) config = client.config(set_wallet=hwif, set_payout_address=payout_address) self.assertEqual(config["wallet"], hwif) self.assertEqual(config["payout_address"], payout_address) def test_validation(self): def callback(): client = api.Client(config_path=tempfile.mktemp()) client.config(set_payout_address="invalid") self.assertRaises(exceptions.InvalidAddress, callback) def test_persistance(self): config_path = tempfile.mktemp() a = api.Client(config_path=config_path).config() b = api.Client(config_path=config_path).config() c = api.Client(config_path=config_path).config() self.assertEqual(a, b, c) self.assertTrue(c["wallet"] is not None) if __name__ == '__main__': unittest.main()
python
<gh_stars>1-10 import axios from 'axios'; import * as _ from 'lodash'; import { DateTime } from 'luxon'; import * as querystring from 'querystring'; import { v4 as uuidv4 } from 'uuid'; import { db, rollbar } from './admin'; import { PubsubMessageData, TaskActionInfo, Taskalator, TempTask, Todoist, UserPubSubMessage, } from './types'; // tslint:disable:no-any export const pubsubSyncUser = async (message: UserPubSubMessage) => { // get todoist id const data: PubsubMessageData = JSON.parse(Buffer.from(message.data, 'base64').toString('utf-8')) || {}; const todoistUid = data.todoistId; if (!todoistUid) return null; // find and load user data from db const userData: Taskalator.User = await loadUserData(todoistUid); // get changes from todoist const todoistData: Todoist.SyncResponse = await getTodoistSync(userData); // process todoist changes await processTaskUpdates(todoistData, userData); return null; }; export const loadUserData = async (todoistUid: string): Promise<Taskalator.User> => { const userQuery = db.collection('users') .where('todoistUserId', '==', todoistUid); try { const userSnapshot = await userQuery.get(); const settingsObj: Taskalator.User = userSnapshot.docs[0].data(); settingsObj.doc_id = userSnapshot.docs[0].id; return settingsObj; } catch (err) { rollbar.error(err); throw new Error(err); } }; export const getTodoistSync = async (userData: Taskalator.User): Promise<Todoist.SyncResponse> => { const token: string | undefined = _.get(userData, 'oauthToken'); if (!token) { throw new Error('No auth token'); } const syncToken: string = _.get(userData, 'syncToken', '*'); const resourceTypes: string = '["items"]'; const url: string = 'https://api.todoist.com/sync/v8/sync'; // make api request const data = { token, sync_token: syncToken, resource_types: resourceTypes, }; const response = await axios.post(url, querystring.stringify(data)); return response.data; }; export const escalateTodoistTask = async ({ oauthToken, todoistTaskData }: TaskActionInfo) => { const uuid = uuidv4(); if (!oauthToken) { throw new Error('Missing oauth token'); } const oldPriority = Number(todoistTaskData.priority); if (oldPriority === 4) { return; } const commands = [{ type: "item_update", uuid, args: { id: todoistTaskData.taskId, priority: oldPriority + 1 } }]; const url = "https://api.todoist.com/sync/v8/sync"; const data = { token: oauthToken, commands: JSON.stringify(commands), }; await axios.post(url, querystring.stringify(data)); return; }; export const filterTasks = (items: TempTask[]): TempTask[] => { return items.filter((item: TempTask) => { if (!_.get(item, "due")) return false; if (_.get(item, "due.is_recurring")) return false; if (_.get(item, "checked")) return false; return true; }); }; // return task document or empty document if none exists export const loadTaskalatorTask = async ({ userId, taskId}: any): Promise<Taskalator.Task | undefined> => { const taskRef = db .collection("users") .doc(userId) .collection("trackedTasks") .doc(String(taskId)); const taskDoc = await taskRef.get(); if (taskDoc.exists) { return taskDoc.data(); } else { return {}; } }; export const formatTodoistTask = (item: TempTask): Todoist.Task => { const taskId = _.get(item, 'id'); const content = _.get(item, 'content'); const priority: number = Number.parseInt(_.get(item, 'priority', ''), 10); const date = _.get(item, "due.date"); const due_date_utc = DateTime.fromISO(date, { zone: 'utc' }).toISO(); if (!content || !priority || !date) { throw new Error("Missing params"); } return { content, due_date_utc, priority, taskId }; }; export interface DetermineActionNeededInfo { taskalatorTask: Taskalator.Task; todoistTask: Todoist.Task; user: Taskalator.User; } export const determineActionNeeded = ({ taskalatorTask, todoistTask, user }: DetermineActionNeededInfo): Taskalator.Action => { // new priority set by user if (taskalatorTask.current_priority !== todoistTask.priority) { return 'UPDATE'; } const priority = _.get(todoistTask, 'priority'); const escalationDays = _.get(user, `p${5 - priority}Days`); // user doesn't want to escalate these tasks if (!escalationDays) { return 'UPDATE'; } const escalationMs = escalationDays * 24 * 60 * 60 * 1000; const incomingDueDate = new Date(todoistTask.due_date_utc); const taskalatorDueDate = new Date(taskalatorTask.current_due_date_utc!); // TODO: should we be overriding this? if ((incomingDueDate.getTime() - taskalatorDueDate.getTime()) >= escalationMs) { return 'ESCALATE'; } return 'UPDATE'; }; export const addEscalatedTask = async ({ todoistTaskData, userData }: TaskActionInfo) => { const userDocId = _.get(userData, 'doc_id'); if (!userDocId) { throw new Error('Missing user document ID'); } // content, previous_priority, new_priority, tracked_task_id const dataToSave = { content: todoistTaskData.content, previous_priority: todoistTaskData.priority, new_priority: todoistTaskData.priority === 4 ? 4 : todoistTaskData.priority + 1, tracked_task_id: todoistTaskData.taskId }; const timestamp = new Date().getTime(); await db .collection("users") .doc(userDocId) .collection("escalatedTasks") .doc(String(timestamp)) .set(dataToSave); }; export const updateFirestoreTask = async ({ taskalatorTaskData, todoistTaskData, userData, action }: TaskActionInfo) => { const escalate = action === "ESCALATE"; const escalatorPriority = Number(_.get(taskalatorTaskData, "current_priority", 999)); const todoistPriority = Number(_.get(todoistTaskData, "priority", 888)); if (todoistPriority === 888) { throw new Error("updateFirestoreTask: Bad todoist data"); } // content and due date always come from todoist const content = todoistTaskData.content; const current_due_date_utc = todoistTaskData.due_date_utc; // priority depends on if we're escalating or not const current_priority = (escalate && todoistTaskData.priority !== 4) ? todoistTaskData.priority + 1 : todoistTaskData.priority; const dataToSave: any = { content, current_due_date_utc, current_priority, }; // original_due_date_utc if we're escalating or the object is new const priorityChanging = escalatorPriority !== todoistPriority; const newTask = escalatorPriority === 999; if (priorityChanging || newTask || escalate) { dataToSave.original_due_date_utc = todoistTaskData.due_date_utc; } await db .collection("users") .doc(String(userData!.doc_id)) .collection("trackedTasks") .doc(String(todoistTaskData.taskId)) .set(dataToSave, { merge: true }); // console.log(`Update FS task ${todoistTaskData.taskId} for user ${userData.doc_id}`); return; }; export const handleSingleTask = async (item: TempTask, userData: Taskalator.User) => { // load from database const dbInfo = { userId: userData.doc_id, taskId: item.id }; const loadedTask: Taskalator.Task | undefined = await loadTaskalatorTask(dbInfo); const taskalatorTask = loadedTask ? loadedTask : {}; // format incoming data const todoistTask = formatTodoistTask(item); // compare and determine course of action const action = determineActionNeeded({ taskalatorTask, todoistTask, user: userData }); // if escalate, update todoist if (action === 'ESCALATE') { const escalateInfo = { oauthToken: userData.oauthToken, todoistTaskData: todoistTask }; await escalateTodoistTask(escalateInfo); } // update firestore with new info if (['ESCALATE', 'UPDATE'].includes(action)) { await updateFirestoreTask({ taskalatorTaskData: taskalatorTask, todoistTaskData: todoistTask, userData }); } if (action === 'ESCALATE') { await addEscalatedTask({ todoistTaskData: todoistTask, userData }); } // we made it return; }; export const updateSyncToken = async ({ userDocId, newSyncToken }: any) => { await db .collection("users") .doc(String(userDocId)) .set({ syncToken: newSyncToken }, { merge: true }); }; export const processTaskUpdates = async (todoistData: Todoist.SyncResponse, userData: Taskalator.User) => { const items = _.get(todoistData, 'items', []); const filteredItems = filterTasks(items); if (filteredItems.length < 1) { return; } // if promise all is successful, update syncToken and done await Promise.all( filteredItems.map((item: any) => handleSingleTask(item, userData)) ); const input = { userDocId: userData.doc_id, newSyncToken: todoistData.sync_token, }; await updateSyncToken(input); return; };
typescript
{ "integrity": "sha256-<KEY> "patch_strip": 1, "patches": { "add_module_extension.patch": "sha256-49ltsUGEbDnDx/<KEY> }, "strip_prefix": "rules_sh-0.2.0", "url": "https://github.com/tweag/rules_sh/archive/refs/tags/v0.2.0.tar.gz" }
json
This accessory can perform a purely decorative function and be complementary to the image. Alternatively, it can be a sports leather wristband for safe employment in weightlifting and other sports . In any case, you need to choose high-quality and professional models. An excellent addition to the appearance of the rocker will be a leather wristband with studs, rivets and other metal ornaments. In addition to this purely aesthetic function, such an accessory has a practical purpose - protecting the hand. But you do not have to be a brutal to wear this informal piece of jewelry. The wristband, made in a more relaxed style, can become an ornament for any image, be it an everyday suit or even a business style. Both men's and women's wristbands are made of fine leather of high quality with the use of special finishing and drawing techniques. Thus, this accessory becomes a reflection of your worldview and at the same time a very practical thing. These leather bracelets-wristlets are designed for reliable fixation of hands when working with a lot of weight during weight lifting. They are made of genuine leather and high-quality hardware made of metal. In addition, such wristbands are recommended in the recovery period after brush injuries. He will recover faster. Later it is used to prevent similar injuries to tendons. Leather wristband is also used during wrestling and just in hard work. The skin from which it is made is environmentally friendly material, breathable and hypoallergenic. And due to its fixation properties, it becomes an excellent prevention of injuries and strains.
english
I am not looking for a BTHS for music, I am looking only for the purpose of making and recieving calls. (instead of having wired headphone, I thought of using wireless, thats all). @Pathiks any decent BTHS around 2000 rs? I came across Cardo Scala 700 Bluetooth Headset, its cheap it seems, but is it available in India? (even gray market is OK with me)
english
<gh_stars>100-1000 public final class VoidReturnKt { public static final void foo(@org.jetbrains.annotations.NotNull java.lang.String g) { /* compiled code */ } }
java
<filename>tests/unit/test_service.py from platform_container_runtime.service import Stream class TestStream: def test_parse_error_channel_v4_success(self) -> None: result = Stream.parse_error_channel(b'\x03{"metadata":{},"status":"Success"}') assert result == {"exit_code": 0} def test_parse_error_channel_v4_failure(self) -> None: result = Stream.parse_error_channel( b'\x03{"metadata":{},"status":"Failure","message":"error","reason":"NonZeroExitCode","details":{"causes":[{"reason":"ExitCode","message":"42"}]}}' # noqa: E501 ) assert result == {"exit_code": 42, "message": "error"} def test_parse_error_channel_v1(self) -> None: result = Stream.parse_error_channel(b"\x03error") assert result == {"exit_code": 1, "message": "error"}
python
Posted On: The Appointments Committee of the Cabinet (ACC) has approved the following: 1. The ACC has approved the appointment of Shri Arvind Kumar, IPS (AM:84), Special Director, Intelligence Bureau as Director, Intelligence Bureau vice Shri Rajiv Jain on completion of his tenure on 30.06.2019 for a tenure of two years from the date of assumption of charge of the post or until further orders, whichever is earlier. 2. The ACC has approved the appointment of Shri Samant Kumar Goel, IPS (PB:84), Special Secretary, Cabinet Secretariat (SR) as Secretary, Research & Analysis Wing (R&AW) vice Shri A.K. Dhasmana on completion of his tenure on 29.06.2019 for a tenure of two years from the date of assumption of charge of the post, or until further orders, whichever is earlier. 3. The ACC has approved the extension of tenure of Shri Amitabh Kant, CEO, NITI Aayog for a further period of two years beyond 30.06.2019 i.e. up to 30.06.2021, on the same terms and conditions, as approved earlier.
english
In a major security risk ahead of Republic Day celebrations in the national capital, an improvised explosive device was recovered from Phool Mandin in East Delhi’s Ghazipur on Friday. The device was disposed of in a controlled explosion by pressing it into an 8-feet deep pit, which triggered a loud sound and smoke in the area, sources said. Speaking to News18, Delhi Police Commissioner Rakesh Asthana said there was no blast and the IED was recovered. “We are working with multiple agencies to find out details. Major casualty averted,” he said. The recovery of the IED comes a week after security forces were alerted to the possibility of a suspected terror attack ahead of Republic Day celebrations and the beginning of election season in five states. News18. com had reported on the detailed alert for security forces on January 7. The alert had said that terrorists could be planning attacks or explosions to target high-profile leaders and security forces campuses, apart from crowded places and markets. “Terrorists of various groups as well anti-social elements may plan their evil thought to attack/blast at high profit leaders, security forces campus, crowded places/markets Railway Stations, Bus Stands, religious places and vital installations etc (sic)," the alert reviewed by News18. com had said. As per the orders, senior officers had been asked to brief troops about the security drill, conduct, importance of the static guard, response in a contingency scenario by keeping necessary co-ordination with all sister agencies/stakeholders etc. “All unit control rooms and centres should be manned suitably round the clock for quick sharing of information and effective co-ordination. Close liaison be maintained with intelligence agencies and civil police in the area besides activating own sources for timely receipt of inputs," the communication had said. It had said that quick action teams should be deployed at suitable places like airports to activate them in case of any attack. “All troops have been asked to rehearse contingency plan religiously and remain extra alert and vigilant on duty outside and inside of the camp areas to avoid any untoward incidents. All outside and inside areas of the camp should also be put under constant watch to avoid any untoward incidents," a senior government official said. Delhi Police officials said a case is being registered in Delhi Police Special Cell under provisions of the Explosives Act in connection with the recovery of the IED from the Delhi market.
english
extern crate rquery; #[cfg(test)] mod element_test; #[cfg(test)] mod selector_test; #[cfg(test)] mod xml_document_test; #[cfg(test)] mod document_test; #[cfg(test)] mod querying_by_selectors_test;
rust
<reponame>iamneha19/apartment<gh_stars>0 #icon-wSecure { background: url(../images/login.gif) no-repeat !important; text-indent: 20px; } .icon32{ width:42px !important; } th.wsecure_th { width: 15%; } .wsecure_heading{ font-weight: bold !important; font-size: 42px !important; text-align: center; color: #2EA2CC; font-variant: small-caps; } .setting-description { display: none; } .wsecure_input { width: 217px !important; } img.wsecure_info { padding: 0px; margin: 0px 9px; } .setting-description:before { background: url(../images/tooltip_arrow.png) no-repeat; content: ""; display: block; height: 15px; left: -10px; position: absolute; width: 12px; top:4px; } .wsecure_container { border:1px solid #ccc; /*border-radius: 18px; -moz-border-radius: 18px; -webkit-border-radius: 18px;*/ padding: 7px 25px; margin: -1px 0 0; } .wsecure_container p { font-size:14px; } .wsecure_acc_child{ margin: 17px 3px; } .wsecure_acc_child_title { font-weight: bolder; font-size: 14px; } .wsecure_acc_child_desc{ font-weight: normal; color: #444; font-size: 14px; line-height: 1.5; } .wsecure_header_disp { font-weight: bold; font-size: 17px; margin: 10px 4px; color: #2EA2CC; } .wsecure_updated { border-left: 4px solid #7ad03a; padding: 1px 12px; background-color: #EBEBEB; -webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1); box-shadow: 0 1px 1px 0 rgba(0,0,0,.1); padding: 10px; color: #2EA2CC; font-weight: bold; } .nav-tab-wsecure { display: inline-block; font-size: 12px; line-height: 16px; margin: 0 -1px 0px 0; padding: 6px 14px 7px; text-decoration: none; border:1px solid #ccc; } .wsecuremenu { overflow:hidden; position:relative; z-index:5; margin:15px 0 0 0; } .wsecuremenu li { margin:0; padding:0; float:left; } .wsecuremenu li a { color:#000; font-size:13px; font-weight:bold; } .nav-tab-wsecure-active { border:1px solid #ccc; border-bottom: 1px solid #F1F1F1; color:#2EA2CC !important; } .nav-tab-wsecure:hover{background:#ececec;} .wsecuredetail { position:relative; z-index:2; margin:-1px 0 0 0; border-top:1px solid #CCCCCC; padding:15px 0 0 0; } ul#tabs { list-style-type: none; margin: 10px 0 0 0; padding: 0 0 0.3em 0; } ul#tabs li { display: inline; } ul#tabs li a { color: #3188b0; font-weight: bold; background-color: #ececec; border: 1px solid #d4d2d2; border-bottom: none; padding:6px 16px; text-decoration: none; font-size:11px; } ul#tabs li a:hover { color: #ffffff; background-color: #757575; } ul#tabs li a.selected { color: #fff; background-color: #757575; font-weight: bold; border: 1px solid #6f6c6c; border-bottom: none; } div.tabContent { border: 1px solid #d4d2d2; padding: 0.5em; background-color: #ffffff; margin:0 0 10px 0; } div.tabContent.hide { display: none; }
css
/* This CSS only styled the search results section, not the search input It defines the basic interraction to hide content when displaying results, etc */ #book-search-input { background: inherit; } #book-search-results .search-results { display: none; } #book-search-results .search-results ul.search-results-list { list-style-type: none; padding-left: 0; } #book-search-results .search-results ul.search-results-list li { margin-bottom: 1.5rem; padding-bottom: 0.5rem; /* Highlight results */ } #book-search-results .search-results ul.search-results-list li p em { background-color: rgba(255, 220, 0, 0.4); font-style: normal; } #book-search-results .search-results .no-results { display: none; } #book-search-results.open .search-results { display: block; } #book-search-results.open .search-noresults { display: none; } #book-search-results.no-results .search-results .has-results { display: none; } #book-search-results.no-results .search-results .no-results { display: block; } #book-search-results span.search-highlight-keyword { background: #ff0; } #book-search-results.search-plus .search-results .has-results .search-results-item { color: inherit; } #book-search-results.search-plus .search-results .has-results .search-results-item span { color: #4183c4; }
css
package org.apache.spark.scheduler; public class StopCoordinator$ implements org.apache.spark.scheduler.OutputCommitCoordinationMessage, scala.Product, scala.Serializable { /** * Static reference to the singleton instance of this Scala object. */ public static final StopCoordinator$ MODULE$ = null; public StopCoordinator$ () { throw new RuntimeException(); } }
java
26 ¶ In that day they shall sing this song in the land of Judah; We have a strong city; God has appointed saving health for walls and bulwarks. 2 Open ye the gates, that the righteous nation which keeps the truth may enter in. 3 Thou wilt keep him in perfect peace, whose mind is stayed on thee: because he trusts in thee. 4 Trust ye in the LORD for ever: for in JAH, the LORD is the strength of the ages: 5 ¶ For he has brought down those that dwelt on high; he has humbled the lofty city; he humbled her, even to the ground; he brought her down even to the dust. 6 The foot shall tread her down, even the feet of the poor, and the steps of the needy. 7 The way of the just is uprightness: thou, most upright, dost weigh the path of the just. 8 Yea, in the way of thy judgments, O LORD, we wait for thee; the desire of our soul is to thy name and to the remembrance of thee. 9 With my soul I desire thee in the night; yea, even as long as the spirit is within me I will seek thee early: for as long as thy judgments are in the earth, the inhabitants of the world learn righteousness. 10 Let favour be showed to the wicked, yet will he not learn righteousness: in the land of uprightness he will deal unjustly and will not behold the majesty of the LORD. 11 LORD, when thy hand is withdrawn, they will not see: but they shall see in the end and be ashamed with the zeal of the people. And fire shall consume thine enemies. 12 ¶ LORD, thou wilt ordain peace for us: for thou also hast wrought in us all our works. 13 O LORD our God, other lords have had dominion over us without thee: but in thee only will we remember thy name. 14 They are dead, they shall not live; they are deceased, they shall not rise because thou hast visited and destroyed them and made all their memory to perish. 15 Thou hast added the Gentiles, O LORD, thou hast added the Gentiles: thou hast made thyself glorious: thou hast extended thyself unto all the ends of the earth. 16 LORD, in the tribulation they have sought thee, they poured out prayer when thy chastening was upon them. 17 Like as a woman with child, that draws near the time of her delivery, is in pain, and cries out in her pangs; so have we been in thy sight, O LORD. 18 We have conceived, we have had birth pangs; we have, as it were, brought forth wind; we have not wrought any health in the earth; neither have the inhabitants of the world fallen. 19 Thy dead shall live, and together with my body they shall arise. Awake and sing, ye that dwell in dust: for thy dew is as the covering of light, and the earth shall cast out the dead. 20 ¶ Come, my people, enter thou into thy chambers, and shut thy doors about thee: hide thyself, as it were, for a little moment until the indignation is overpast. 21 For, behold, the LORD comes out of his place to visit the iniquity of the inhabitant of the earth against himself: the earth also shall disclose her blood and shall no longer cover her slain.
english
<filename>src/exceptions/StatsPrivacyError.ts /** * Represets an error thrown because a user set their stats to private */ class StatsPrivacyError extends Error { /** * The user who set their stats to private */ public user: string; /** * @param user The user who set their stats to private */ constructor(user: string) { super(); this.name = 'StatsPrivacyError'; this.message = `The user "${user}" set their stats to private`; this.user = user; } } export default StatsPrivacyError;
typescript
<gh_stars>0 package conv import ( "time" "github.com/shopspring/decimal" "google.golang.org/protobuf/types/known/durationpb" "google.golang.org/protobuf/types/known/timestamppb" "google.golang.org/protobuf/types/known/wrapperspb" ) // MaybeBool converts from protobuf WKT. func MaybeBool(wkt *wrapperspb.BoolValue) *bool { if wkt == nil { return nil } return &wkt.Value } // MaybePbBool converts to protobuf WKT. func MaybePbBool(v *bool) *wrapperspb.BoolValue { if v == nil { return nil } return wrapperspb.Bool(*v) } // MaybeFloat32 converts from protobuf WKT. func MaybeFloat32(wkt *wrapperspb.FloatValue) *float32 { if wkt == nil { return nil } return &wkt.Value } // MaybePbFloat converts to protobuf WKT. func MaybePbFloat(v *float32) *wrapperspb.FloatValue { if v == nil { return nil } return wrapperspb.Float(*v) } // MaybeFloat64 converts from protobuf WKT. func MaybeFloat64(wkt *wrapperspb.DoubleValue) *float64 { if wkt == nil { return nil } return &wkt.Value } // MaybePbDouble converts to protobuf WKT. func MaybePbDouble(v *float64) *wrapperspb.DoubleValue { if v == nil { return nil } return wrapperspb.Double(*v) } // MaybeInt32 converts from protobuf WKT. func MaybeInt32(wkt *wrapperspb.Int32Value) *int32 { if wkt == nil { return nil } return &wkt.Value } // MaybePbInt32 converts to protobuf WKT. func MaybePbInt32(v *int32) *wrapperspb.Int32Value { if v == nil { return nil } return wrapperspb.Int32(*v) } // MaybeInt64 converts from protobuf WKT. func MaybeInt64(wkt *wrapperspb.Int64Value) *int64 { if wkt == nil { return nil } return &wkt.Value } // MaybePbInt64 converts to protobuf WKT. func MaybePbInt64(v *int64) *wrapperspb.Int64Value { if v == nil { return nil } return wrapperspb.Int64(*v) } // MaybeString converts from protobuf WKT. func MaybeString(wkt *wrapperspb.StringValue) *string { if wkt == nil { return nil } return &wkt.Value } // MaybePbString converts to protobuf WKT. func MaybePbString(v *string) *wrapperspb.StringValue { if v == nil { return nil } return wrapperspb.String(*v) } // MaybeUInt32 converts from protobuf WKT. func MaybeUInt32(wkt *wrapperspb.UInt32Value) *uint32 { if wkt == nil { return nil } return &wkt.Value } // MaybePbUInt32 converts to protobuf WKT. func MaybePbUInt32(v *uint32) *wrapperspb.UInt32Value { if v == nil { return nil } return wrapperspb.UInt32(*v) } // MaybeUInt64 converts from protobuf WKT. func MaybeUInt64(wkt *wrapperspb.UInt64Value) *uint64 { if wkt == nil { return nil } return &wkt.Value } // MaybePbUInt64 converts to protobuf WKT. func MaybePbUInt64(v *uint64) *wrapperspb.UInt64Value { if v == nil { return nil } return wrapperspb.UInt64(*v) } // MaybeDuration converts from protobuf WKT. func MaybeDuration(wkt *durationpb.Duration) *time.Duration { if wkt == nil { return nil } v := wkt.AsDuration() return &v } // MaybePbDuration converts to protobuf WKT. func MaybePbDuration(v *time.Duration) *durationpb.Duration { if v == nil { return nil } return durationpb.New(*v) } // MaybeTime converts from protobuf WKT, returns zero time for nil. func MaybeTime(wkt *timestamppb.Timestamp) time.Time { if wkt == nil { return time.Time{} } return wkt.AsTime() } // MaybePbTimestamp converts to protobuf WKT, returns nil for zero time. func MaybePbTimestamp(v time.Time) *timestamppb.Timestamp { if v.IsZero() { return nil } return timestamppb.New(v) } // MaybeDecimal converts from protobuf WKT. func MaybeDecimal(wkt *wrapperspb.StringValue) (*decimal.Decimal, error) { if wkt == nil { return nil, nil } d, err := decimal.NewFromString(wkt.Value) if err != nil { return nil, err } return &d, nil } // MaybePbStringFromDecimal converts to protobuf WKT. func MaybePbStringFromDecimal(d *decimal.Decimal) *wrapperspb.StringValue { if d == nil { return nil } return wrapperspb.String(d.String()) }
go
[ "SPAGUETTI COM PRESUNTO TOMATE E AZEITONA: massa spaguhetti, com molho branco, salpicada com cebolinha, e com tiras de presunto, com pedaços de azeitona preta", "<NAME> COM CAMARÕES E TOMATES SECOS: cremoso penne, com um maravilhoso molho, espinafre, manjericão e tomates secos.", "MACARRÃO : cremoso penne, Salpicado com verde-esmeralda, ervilhas doces, nuggets crocantes e uma saborosa pancetta.", "PEITO DE FRANGO COM ORZO: orzo cremoso" ]
json
package de.diedavids.cuba.runtimediagnose.groovy.binding; import java.util.Map; interface GroovyScriptBindingSupplier { Map<String, Object> getBinding(); }
java
{ "extends": "modular-scripts/tsconfig.json", "include": [ "modular", "packages/**/src", "packages/create-modular-react-app/template/" ] }
json
<reponame>Kangz/cassia use std::{cell::RefCell, cmp::Ordering}; #[derive(Debug)] pub struct DynVec<T> { vec: RefCell<Vec<T>>, } impl<T> DynVec<T> { pub fn new() -> Self { Self { vec: RefCell::new(Vec::new()), } } pub fn is_empty(&self) -> bool { self.vec.borrow().is_empty() } pub fn len(&self) -> usize { self.vec.borrow().len() } pub fn push(&self, val: T) { self.vec.borrow_mut().push(val); } pub fn sort_by<F>(&self, compare: F) where F: FnMut(&T, &T) -> Ordering, { self.vec.borrow_mut().sort_by(compare); } } impl<T: Clone> DynVec<T> { pub fn iter(&self) -> DynVecIter<T> { DynVecIter { vec: &self.vec, index: 0, } } pub fn index(&self, index: usize) -> T { self.vec.borrow()[index].clone() } } impl<T> Default for DynVec<T> { fn default() -> Self { Self::new() } } pub struct DynVecIter<'v, T> { vec: &'v RefCell<Vec<T>>, index: usize, } impl<T: Clone> Iterator for DynVecIter<'_, T> { type Item = T; fn next(&mut self) -> Option<Self::Item> { let val = self.vec.borrow().get(self.index).cloned(); self.index += 1; val } }
rust
<!-- https://codepen.io/Digi-D/pen/pVZNwz --> <!DOCTYPE html> <html> <head> <title> Box Model </title> <style> div{ margin-top: 10px; /* border: 5px solid black; shorthand for below */ border-color: black; border-style: solid; border-width: 2px; } .box-one{ padding:10px; margin-right: 100px; } .box-two{ width:300px; margin-left: auto; margin-right: auto; } .box-three{ border-color: red; margin-left: 100px; } .starting-text{ font-weight: bold; font-size: 20px; } .box-three .starting-text{ margin-left:20px; } </style> <!-- Definitely Check out http://www.w3schools.com/css/css_boxmodel.asp --> </head> <body> <div class="box-one"> <span class="starting-text">Lorem ipsum</span> dolor sit amet, consectetur adipiscing elit. Donec efficitur pretium dui in rutrum. In et porta velit. Phasellus vel justo in justo semper sagittis. Integer ac pellentesque magna. Quisque sodales sapien ut neque porttitor finibus. Morbi rhoncus lacus vel nunc elementum tempor. Duis quam nisl, ullamcorper et ante et, sagittis porttitor mauris. Fusce sollicitudin arcu est, vel maximus ex congue ut. Morbi in convallis neque. Fusce pellentesque pharetra erat, quis placerat nulla convallis sit amet. </div> <div class="box-two"> <span class="starting-text">Lorem ipsum</span> dolor sit amet, consectetur adipiscing elit. Donec efficitur pretium dui in rutrum. In et porta velit. Phasellus vel justo in justo semper sagittis. Integer ac pellentesque magna. Quisque sodales sapien ut neque porttitor finibus. Morbi rhoncus lacus vel nunc elementum tempor. Duis quam nisl, ullamcorper et ante et, sagittis porttitor mauris. Fusce sollicitudin arcu est, vel maximus ex congue ut. Morbi in convallis neque. Fusce pellentesque pharetra erat, quis placerat nulla convallis sit amet. </div> <div class="box-three"> <span class="starting-text">Lorem ipsum</span> dolor sit amet, consectetur adipiscing elit. Donec efficitur pretium dui in rutrum. In et porta velit. Phasellus vel justo in justo semper sagittis. Integer ac pellentesque magna. Quisque sodales sapien ut neque porttitor finibus. Morbi rhoncus lacus vel nunc elementum tempor. Duis quam nisl, ullamcorper et ante et, sagittis porttitor mauris. Fusce sollicitudin arcu est, vel maximus ex congue ut. Morbi in convallis neque. Fusce pellentesque pharetra erat, quis placerat nulla convallis sit amet. </div> </body> </html>
html
# BraveHaxvius_Kinetix My take on Shazulth's tool
markdown
# # @lc app=leetcode id=297 lang=python3 # # [297] Serialize and Deserialize Binary Tree # # https://leetcode.com/problems/serialize-and-deserialize-binary-tree/description/ # # algorithms # Hard (46.18%) # Likes: 2721 # Dislikes: 136 # Total Accepted: 300.9K # Total Submissions: 651K # Testcase Example: '[1,2,3,null,null,4,5]' # # Serialization is the process of converting a data structure or object into a # sequence of bits so that it can be stored in a file or memory buffer, or # transmitted across a network connection link to be reconstructed later in the # same or another computer environment. # # Design an algorithm to serialize and deserialize a binary tree. There is no # restriction on how your serialization/deserialization algorithm should work. # You just need to ensure that a binary tree can be serialized to a string and # this string can be deserialized to the original tree structure. # # Example:  # # # You may serialize the following tree: # # ⁠ 1 # ⁠ / \ # ⁠ 2 3 # ⁠ / \ # ⁠ 4 5 # # as "[1,2,3,null,null,4,5]" # # # Clarification: The above format is the same as how LeetCode serializes a # binary tree. You do not necessarily need to follow this format, so please be # creative and come up with different approaches yourself. # # Note: Do not use class member/global/static variables to store states. Your # serialize and deserialize algorithms should be stateless. # # # @lc code=start # Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None LEFT = 0 RIGHT = 1 POSITIONS = [LEFT, RIGHT] class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str """ bfs = collections.deque([root]) serial_builder = [] while len(bfs) > 0: curr = bfs.popleft() if curr is not None: serial_builder.append(str(curr.val)) bfs.append(curr.left) bfs.append(curr.right) serial_builder.append(',') while len(serial_builder) > 0 and serial_builder[-1] == ',': serial_builder.pop() return ''.join(reversed(serial_builder)) def deserialize(self, data): """Decodes your encoded data to tree. :type data: str :rtype: TreeNode """ deserial = data.split(',') root = TreeNode(-1) bfs = collections.deque([(root, RIGHT)]) while len(deserial) > 0: curr_serial_val = deserial.pop() curr_parent, insert_pos = bfs.popleft() if curr_serial_val: curr_val = int(curr_serial_val) new_node = TreeNode(curr_val) if insert_pos == LEFT: curr_parent.left = new_node else: curr_parent.right = new_node for p in POSITIONS: bfs.append((new_node, p)) return root.right # Your Codec object will be instantiated and called as such: # codec = Codec() # codec.deserialize(codec.serialize(root)) # @lc code=end
python
<filename>connecting-widgets/src/widget.ts /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ // Copyright (c) <NAME> // Distributed under the terms of the Modified BSD License. import { DOMWidgetModel, DOMWidgetView, ISerializers, WidgetModel, } from '@jupyter-widgets/base'; import { MODULE_NAME, MODULE_VERSION } from './version'; // Import the CSS import '../css/widget.css'; export class model1 extends DOMWidgetModel { defaults() { return { ...super.defaults(), _model_name: model1.model_name, _model_module: model1.model_module, _model_module_version: model1.model_module_version, _view_name: model1.view_name, _view_module: model1.view_module, _view_module_version: model1.view_module_version, value: 'Hello World', }; } initialize(attributes: any, options: any) { super.initialize(attributes, options); this.on('msg:custom', this._on_msg.bind(this)); } private _on_msg(command: any, buffers: any) { if (command.what && command.what === 'grab-model') { Promise.resolve(this.widget_manager.get_model(command.comm_id)).then( (value) => { if (value) { this.otherModels.push(value); value.set('value', 'set by model1!!!'); } } ); } } static serializers: ISerializers = { ...DOMWidgetModel.serializers, // Add any extra serializers here }; private otherModels: WidgetModel[] = []; static model_name = 'model1'; static model_module = MODULE_NAME; static model_module_version = MODULE_VERSION; static view_name = 'view1'; // Set to null if no view static view_module = MODULE_NAME; // Set to null if no view static view_module_version = MODULE_VERSION; } export class view1 extends DOMWidgetView { render(): void { console.log(this.model.widget_manager.comm_target_name); const promise = this.model.widget_manager.get_model( this.model.comm.comm_id ); Promise.resolve(promise).then((value) => { console.log('in then'); console.log(value); }); console.log(promise); this.el.classList.add('custom-widget'); this.value_changed(); this.model.on('change:value', this.value_changed, this); } value_changed(): void { this.el.textContent = this.model.get('value'); } } export class model2 extends DOMWidgetModel { defaults() { return { ...super.defaults(), _model_name: model2.model_name, _model_module: model2.model_module, _model_module_version: model2.model_module_version, _view_name: model2.view_name, _view_module: model2.view_module, _view_module_version: model2.view_module_version, value: 'Hello World', }; } static serializers: ISerializers = { ...DOMWidgetModel.serializers, // Add any extra serializers here }; // set_value() static model_name = 'model2'; static model_module = MODULE_NAME; static model_module_version = MODULE_VERSION; static view_name = 'view2'; // Set to null if no view static view_module = MODULE_NAME; // Set to null if no view static view_module_version = MODULE_VERSION; } export class view2 extends DOMWidgetView { render(): void { // console.log(this.model.widget_manager.comm_target_name); // const promise = this.model.widget_manager.get_model( // this.model.comm.comm_id // ); // Promise.resolve(promise).then((value) => { // console.log('in then'); // console.log(value); // }); // console.log(promise); this.el.classList.add('custom-widget'); this.value_changed(); this.model.on('change:value', this.value_changed, this); } value_changed(): void { this.el.textContent = this.model.get('value'); } }
typescript
<gh_stars>1-10 .background_glossyOlive4, .hover_background_glossyOlive4:hover, .active_background_glossyOlive4:active:hover { background: #808000; background-image: -moz-linear-gradient(top, rgba(255, 255, 255, .30) 0%, rgba(255, 255, 255, .00) 50%, rgba(0, 0, 0, .10) 51%, rgba(0, 0, 0, .04) 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(255, 255, 255, .30)), color-stop(50%, rgba(255, 255, 255, .00)), color-stop(51%, rgba(0, 0, 0, .10)), color-stop(100%, rgba(0, 0, 0, .04))); background-image: -webkit-linear-gradient(top, rgba(255, 255, 255, .30) 0%, rgba(255, 255, 255, .00) 50%, rgba(0, 0, 0, .10) 51%, rgba(0, 0, 0, .04) 100%); background-image: -o-linear-gradient(top, rgba(255, 255, 255, .30) 0%, rgba(255, 255, 255, .00) 50%, rgba(0, 0, 0, .10) 51%, rgba(0, 0, 0, .04) 100%); background-image: -ms-linear-gradient(top, rgba(255, 255, 255, .30) 0%, rgba(255, 255, 255, .00) 50%, rgba(0, 0, 0, .10) 51%, rgba(0, 0, 0, .04) 100%); background-image: linear-gradient(to bottom, rgba(255, 255, 255, .30) 0%, rgba(255, 255, 255, .00) 50%, rgba(0, 0, 0, .10) 51%, rgba(0, 0, 0, .04) 100%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#000000',GradientType=0 ); } .background_glossyOlive4h, .hover_background_glossyOlive4h:hover, .active_background_glossyOlive4h:active:hover { background: #808000; background-image: -moz-linear-gradient(top, rgba(255, 255, 255, .30) 0%, rgba(255, 255, 255, .00) 50%, rgba(0, 0, 0, .10) 51%, rgba(0, 0, 0, .04) 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(255, 255, 255, .30)), color-stop(50%, rgba(255, 255, 255, .00)), color-stop(51%, rgba(0, 0, 0, .10)), color-stop(100%, rgba(0, 0, 0, .04))); background-image: -webkit-linear-gradient(top, rgba(255, 255, 255, .30) 0%, rgba(255, 255, 255, .00) 50%, rgba(0, 0, 0, .10) 51%, rgba(0, 0, 0, .04) 100%); background-image: -o-linear-gradient(top, rgba(255, 255, 255, .30) 0%, rgba(255, 255, 255, .00) 50%, rgba(0, 0, 0, .10) 51%, rgba(0, 0, 0, .04) 100%); background-image: -ms-linear-gradient(top, rgba(255, 255, 255, .30) 0%, rgba(255, 255, 255, .00) 50%, rgba(0, 0, 0, .10) 51%, rgba(0, 0, 0, .04) 100%); background-image: linear-gradient(to bottom, rgba(255, 255, 255, .30) 0%, rgba(255, 255, 255, .00) 50%, rgba(0, 0, 0, .10) 51%, rgba(0, 0, 0, .04) 100%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#000000',GradientType=0 ); } .background_glossyOlive4a, .hover_background_glossyOlive4a:hover, .active_background_glossyOlive4a:active:hover { background: #808000; background-image: -moz-linear-gradient(top, rgba(0, 0, 0, .04) 0%, rgba(0, 0, 0, .10) 50%, rgba(255, 255, 255, .00) 51%, rgba(255, 255, 255, .30) 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0, 0, 0, .04)), color-stop(50%, rgba(0, 0, 0, .10)), color-stop(51%, rgba(255, 255, 255, .00)), color-stop(100%, rgba(255, 255, 255, .30))); background-image: -webkit-linear-gradient(top, rgba(0, 0, 0, .04) 0%, rgba(0, 0, 0, .10) 50%, rgba(255, 255, 255, .00) 51%, rgba(255, 255, 255, .30) 100%); background-image: -o-linear-gradient(top, rgba(0, 0, 0, .04) 0%, rgba(0, 0, 0, .10) 50%, rgba(255, 255, 255, .00) 51%, rgba(255, 255, 255, .30) 100%); background-image: -ms-linear-gradient(top, rgba(0, 0, 0, .04) 0%, rgba(0, 0, 0, .10) 50%, rgba(255, 255, 255, .00) 51%, rgba(255, 255, 255, .30) 100%); background-image: linear-gradient(to bottom, rgba(0, 0, 0, .04) 0%, rgba(0, 0, 0, .10) 50%, rgba(255, 255, 255, .00) 51%, rgba(255, 255, 255, .30) 100%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#000000', endColorstr='#ffffff',GradientType=0 ); } .background_glossyOlive4s, .hover_background_glossyOlive4s:hover, .active_background_glossyOlive4s:active:hover { background: #808000; background-image: -moz-linear-gradient(top, rgba(255, 255, 255, .30) 0%, rgba(255, 255, 255, .00) 50%, rgba(0, 0, 0, .10) 51%, rgba(0, 0, 0, .04) 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(255, 255, 255, .30)), color-stop(50%, rgba(255, 255, 255, .00)), color-stop(51%, rgba(0, 0, 0, .10)), color-stop(100%, rgba(0, 0, 0, .04))); background-image: -webkit-linear-gradient(top, rgba(255, 255, 255, .30) 0%, rgba(255, 255, 255, .00) 50%, rgba(0, 0, 0, .10) 51%, rgba(0, 0, 0, .04) 100%); background-image: -o-linear-gradient(top, rgba(255, 255, 255, .30) 0%, rgba(255, 255, 255, .00) 50%, rgba(0, 0, 0, .10) 51%, rgba(0, 0, 0, .04) 100%); background-image: -ms-linear-gradient(top, rgba(255, 255, 255, .30) 0%, rgba(255, 255, 255, .00) 50%, rgba(0, 0, 0, .10) 51%, rgba(0, 0, 0, .04) 100%); background-image: linear-gradient(to bottom, rgba(255, 255, 255, .30) 0%, rgba(255, 255, 255, .00) 50%, rgba(0, 0, 0, .10) 51%, rgba(0, 0, 0, .04) 100%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#000000',GradientType=0 ); } .background_color_glossyOlive4, .hover_background_color_glossyOlive4:hover, .active_background_color_glossyOlive4:active:hover { background-color:#808000; } .background_first_color_glossyOlive4, .hover_background_first_color_glossyOlive4:hover, .active_background_first_color_glossyOlive4:active:hover { background-color:#ffffff; } .background_last_color_glossyOlive4, .hover_background_last_color_glossyOlive4:hover, .active_background_color_last_glossyOlive4:active:hover { background-color:#000000; } /* ------------------------------ color settings -------------------------------*/ .color_glossyOlive4, .hover_color_glossyOlive4:hover, .active_color_glossyOlive4:active:hover { color: #c8c8c8; } .color_glossyOlive4h, .hover_color_glossyOlive4h:hover, .active_color_glossyOlive4h:active:hover { color: #c8c8c8; } .color_glossyOlive4a, .hover_color_glossyOlive4a:hover, .active_color_glossyOlive4a:active:hover { color: #c8c8c8; } .color_glossyOlive4s, .hover_color_glossyOlive4s:hover, .active_color_glossyOlive4s:active:hover { color: #282828; } /* -------------------------- border color settings -----------------------------*/ .border_glossyOlive4, .hover_border_glossyOlive4:hover, .active_border_glossyOlive4:active:hover { border-color: #666600 #666600 #666600 #666600; } .border_glossyOlive4h, .hover_border_glossyOlive4h:hover, .active_border_glossyOlive4h:active:hover { border-color: #535300 #535300 #535300 #535300; } .border_glossyOlive4a, .hover_border_glossyOlive4a:hover, .active_border_glossyOlive4a:active:hover { border-color: #404000 #404000 #404000 #404000; } .border_glossyOlive4s, .hover_border_glossyOlive4s:hover, .active_border_glossyOlive4s:active:hover { border-color: #666600 #666600 #666600 #666600; } /* -------------------------- shadow expand settings --------------------------------*/ .shadow_expand_glossyOlive4, .hover_shadow_expand_glossyOlive4:hover, .active_shadow_expand_glossyOlive4:active:hover { -webkit-box-shadow: 0em 0em 1em 0.25em rgba(128, 128, 0, .39); -moz-box-shadow: 0em 0em 1em 0.25em rgba(128, 128, 0, .39); box-shadow: 0em 0em 1em 0.25em rgba(128, 128, 0, .39); } .shadow_expand_glossyOlive4h, .hover_shadow_expand_glossyOlive4h:hover, .active_shadow_expand_glossyOlive4h:active:hover { -webkit-box-shadow: 0em 0em 1em 0.25em rgba(154, 154, 0, .50); -moz-box-shadow: 0em 0em 1em 0.25em rgba(154, 154, 0, .50); box-shadow: 0em 0em 1em 0.25em rgba(154, 154, 0, .50); } .shadow_expand_glossyOlive4a, .hover_shadow_expand_glossyOlive4a:hover, .active_shadow_expand_glossyOlive4a:active:hover { -webkit-box-shadow: 0em 0em 1em 0.25em rgba(115, 115, 0, .63); -moz-box-shadow: 0em 0em 1em 0.25em rgba(115, 115, 0, .63); box-shadow: 0em 0em 1em 0.25em rgba(115, 115, 0, .63); } .shadow_expand_glossyOlive4s, .hover_shadow_expand_glossyOlive4s:hover, .active_shadow_expand_glossyOlive4s:active:hover { -webkit-box-shadow: 0em 0em 1em 0.25em rgba(115, 115, 0, .71); -moz-box-shadow: 0em 0em 1em 0.25em rgba(115, 115, 0, .71); box-shadow: 0em 0em 1em 0.25em rgba(115, 115, 0, .71); } /* -------------------------- shadow left settings --------------------------------*/ .shadow_left_glossyOlive4, .hover_shadow_left_glossyOlive4:hover, .active_shadow_left_glossyOlive4:active:hover { -webkit-box-shadow: -0.5em -0.5em 1em rgba(128, 128, 0, .39); -moz-box-shadow: -0.5em -0.5em 1em rgba(128, 128, 0, .39); box-shadow: -0.5em -0.5em 1em rgba(128, 128, 0, .39); } .shadow_left_glossyOlive4h, .hover_shadow_left_glossyOlive4h:hover, .active_shadow_left_glossyOlive4h:active:hover { -webkit-box-shadow: -0.5em -0.5em 1em rgba(154, 154, 0, .50); -moz-box-shadow: -0.5em -0.5em 1em rgba(154, 154, 0, .50); box-shadow: -0.5em -0.5em 1em rgba(154, 154, 0, .50); } .shadow_left_glossyOlive4a, .hover_shadow_left_glossyOlive4a:hover, .active_shadow_left_glossyOlive4a:active:hover { -webkit-box-shadow: -0.5em -0.5em 1em rgba(115, 115, 0, .63); -moz-box-shadow: -0.5em -0.5em 1em rgba(115, 115, 0, .63); box-shadow: -0.5em -0.5em 1em rgba(115, 115, 0, .63); } .shadow_left_glossyOlive4s, .hover_shadow_left_glossyOlive4s:hover, .active_shadow_left_glossyOlive4s:active:hover { -webkit-box-shadow: -0.5em -0.5em 1em rgba(115, 115, 0, .71); -moz-box-shadow: -0.5em -0.5em 1em rgba(115, 115, 0, .71); box-shadow: -0.5em -0.5em 1em rgba(115, 115, 0, .71); } /* -------------------------- shadow right settings --------------------------------*/ .shadow_right_glossyOlive4, .hover_shadow_right_glossyOlive4:hover, .active_shadow_right_glossyOlive4:active:hover { -webkit-box-shadow: 0.5em 0em 1em rgba(128, 128, 0, .39); -moz-box-shadow: 0.5em 0em 1em rgba(128, 128, 0, .39); box-shadow: 0.5em 0em 1em rgba(128, 128, 0, .39); } .shadow_right_glossyOlive4h, .hover_shadow_right_glossyOlive4h:hover, .active_shadow_right_glossyOlive4h:active:hover { -webkit-box-shadow: 0.5em 0em 1em rgba(154, 154, 0, .50); -moz-box-shadow: 0.5em 0em 1em rgba(154, 154, 0, .50); box-shadow: 0.5em 0em 1em rgba(154, 154, 0, .50); } .shadow_right_glossyOlive4a, .hover_shadow_right_glossyOlive4a:hover, .active_shadow_right_glossyOlive4a:active:hover { -webkit-box-shadow: 0.5em 0em 1em rgba(115, 115, 0, .63); -moz-box-shadow: 0.5em 0em 1em rgba(115, 115, 0, .63); box-shadow: 0.5em 0em 1em rgba(115, 115, 0, .63); } .shadow_right_glossyOlive4s, .hover_shadow_right_glossyOlive4s:hover, .active_shadow_right_glossyOlive4s:active:hover { -webkit-box-shadow: 0.5em 0em 1em rgba(115, 115, 0, .71); -moz-box-shadow: 0.5em 0em 1em rgba(115, 115, 0, .71); box-shadow: 0.5em 0em 1em rgba(115, 115, 0, .71); } /* -------------------------- shadow top settings --------------------------------*/ .shadow_top_glossyOlive4, .hover_shadow_top_glossyOlive4:hover, .active_shadow_top_glossyOlive4:active:hover { -webkit-box-shadow: 0em -0.5em 1em rgba(128, 128, 0, .39); -moz-box-shadow: 0em -0.5em 1em rgba(128, 128, 0, .39); box-shadow: 0em -0.5em 1em rgba(128, 128, 0, .39); } .shadow_top_glossyOlive4h, .hover_shadow_top_glossyOlive4h:hover, .active_shadow_top_glossyOlive4h:active:hover { -webkit-box-shadow: 0em -0.5em 1em rgba(154, 154, 0, .50); -moz-box-shadow: 0em -0.5em 1em rgba(154, 154, 0, .50); box-shadow: 0em -0.5em 1em rgba(154, 154, 0, .50); } .shadow_top_glossyOlive4a, .hover_shadow_top_glossyOlive4a:hover, .active_shadow_top_glossyOlive4a:active:hover { -webkit-box-shadow: 0em -0.5em 1em rgba(115, 115, 0, .63); -moz-box-shadow: 0em -0.5em 1em rgba(115, 115, 0, .63); box-shadow: 0em -0.5em 1em rgba(115, 115, 0, .63); } .shadow_top_glossyOlive4s, .hover_shadow_top_glossyOlive4s:hover, .active_shadow_top_glossyOlive4s:active:hover { -webkit-box-shadow: 0em -0.5em 1em rgba(115, 115, 0, .71); -moz-box-shadow: 0em -0.5em 1em rgba(115, 115, 0, .71); box-shadow: 0em -0.5em 1em rgba(115, 115, 0, .71); } /* -------------------------- shadow bottom settings --------------------------------*/ .shadow_bottom_glossyOlive4, .hover_shadow_bottom_glossyOlive4:hover, .active_shadow_bottom_glossyOlive4:active:hover { -webkit-box-shadow: 0em 0.5em 1em rgba(128, 128, 0, .39); -moz-box-shadow: 0em 0.5em 1em rgba(128, 128, 0, .39); box-shadow: 0em 0.5em 1em rgba(128, 128, 0, .39); } .shadow_bottom_glossyOlive4h, .hover_shadow_bottom_glossyOlive4h:hover, .active_shadow_bottom_glossyOlive4h:active:hover { -webkit-box-shadow: 0em 0.5em 1em rgba(154, 154, 0, .50); -moz-box-shadow: 0em 0.5em 1em rgba(154, 154, 0, .50); box-shadow: 0em 0.5em 1em rgba(154, 154, 0, .50); } .shadow_bottom_glossyOlive4a, .hover_shadow_bottom_glossyOlive4a:hover, .active_shadow_bottom_glossyOlive4a:active:hover { -webkit-box-shadow: 0em 0.5em 1em rgba(115, 115, 0, .63); -moz-box-shadow: 0em 0.5em 1em rgba(115, 115, 0, .63); box-shadow: 0em 0.5em 1em rgba(115, 115, 0, .63); } .shadow_bottom_glossyOlive4s, .hover_shadow_bottom_glossyOlive4s:hover, .active_shadow_bottom_glossyOlive4s:active:hover { -webkit-box-shadow: 0em 0.5em 1em rgba(115, 115, 0, .71); -moz-box-shadow: 0em 0.5em 1em rgba(115, 115, 0, .71); box-shadow: 0em 0.5em 1em rgba(115, 115, 0, .71); } /* -------------------------- shadow top_left settings --------------------------------*/ .shadow_top_left_glossyOlive4, .hover_shadow_top_left_glossyOlive4:hover, .active_shadow_top_left_glossyOlive4:active:hover { -webkit-box-shadow: -0.5em -0.5em 1em rgba(128, 128, 0, .39); -moz-box-shadow: -0.5em -0.5em 1em rgba(128, 128, 0, .39); box-shadow: -0.5em -0.5em 1em rgba(128, 128, 0, .39); } .shadow_top_left_glossyOlive4h, .hover_shadow_top_left_glossyOlive4h:hover, .active_shadow_top_left_glossyOlive4h:active:hover { -webkit-box-shadow: -0.5em -0.5em 1em rgba(154, 154, 0, .50); -moz-box-shadow: -0.5em -0.5em 1em rgba(154, 154, 0, .50); box-shadow: -0.5em -0.5em 1em rgba(154, 154, 0, .50); } .shadow_top_left_glossyOlive4a, .hover_shadow_top_left_glossyOlive4a:hover, .active_shadow_top_left_glossyOlive4a:active:hover { -webkit-box-shadow: -0.5em -0.5em 1em rgba(115, 115, 0, .63); -moz-box-shadow: -0.5em -0.5em 1em rgba(115, 115, 0, .63); box-shadow: -0.5em -0.5em 1em rgba(115, 115, 0, .63); } .shadow_top_left_glossyOlive4s, .hover_shadow_top_left_glossyOlive4s:hover, .active_shadow_top_left_glossyOlive4s:active:hover { -webkit-box-shadow: -0.5em -0.5em 1em rgba(115, 115, 0, .71); -moz-box-shadow: -0.5em -0.5em 1em rgba(115, 115, 0, .71); box-shadow: -0.5em -0.5em 1em rgba(115, 115, 0, .71); } /* -------------------------- shadow top_right settings --------------------------------*/ .shadow_top_right_glossyOlive4, .hover_shadow_top_right_glossyOlive4:hover, .active_shadow_top_right_glossyOlive4:active:hover { -webkit-box-shadow: 0.5em -0.5em 1em rgba(128, 128, 0, .39); -moz-box-shadow: 0.5em -0.5em 1em rgba(128, 128, 0, .39); box-shadow: 0.5em -0.5em 1em rgba(128, 128, 0, .39); } .shadow_top_right_glossyOlive4h, .hover_shadow_top_right_glossyOlive4h:hover, .active_shadow_top_right_glossyOlive4h:active:hover { -webkit-box-shadow: 0.5em -0.5em 1em rgba(154, 154, 0, .50); -moz-box-shadow: 0.5em -0.5em 1em rgba(154, 154, 0, .50); box-shadow: 0.5em -0.5em 1em rgba(154, 154, 0, .50); } .shadow_top_right_glossyOlive4a, .hover_shadow_top_right_glossyOlive4a:hover, .active_shadow_top_right_glossyOlive4a:active:hover { -webkit-box-shadow: 0.5em -0.5em 1em rgba(115, 115, 0, .63); -moz-box-shadow: 0.5em -0.5em 1em rgba(115, 115, 0, .63); box-shadow: 0.5em -0.5em 1em rgba(115, 115, 0, .63); } .shadow_top_right_glossyOlive4s, .hover_shadow_top_right_glossyOlive4s:hover, .active_shadow_top_right_glossyOlive4s:active:hover { -webkit-box-shadow: 0.5em -0.5em 1em rgba(115, 115, 0, .71); -moz-box-shadow: 0.5em -0.5em 1em rgba(115, 115, 0, .71); box-shadow: 0.5em -0.5em 1em rgba(115, 115, 0, .71); } /* -------------------------- shadow bottom_left settings --------------------------------*/ .shadow_bottom_left_glossyOlive4, .hover_shadow_bottom_left_glossyOlive4:hover, .active_shadow_bottom_left_glossyOlive4:active:hover { -webkit-box-shadow: -0.5em 0.5em 1em rgba(128, 128, 0, .39); -moz-box-shadow: -0.5em 0.5em 1em rgba(128, 128, 0, .39); box-shadow: -0.5em 0.5em 1em rgba(128, 128, 0, .39); } .shadow_bottom_left_glossyOlive4h, .hover_shadow_bottom_left_glossyOlive4h:hover, .active_shadow_bottom_left_glossyOlive4h:active:hover { -webkit-box-shadow: -0.5em 0.5em 1em rgba(154, 154, 0, .50); -moz-box-shadow: -0.5em 0.5em 1em rgba(154, 154, 0, .50); box-shadow: -0.5em 0.5em 1em rgba(154, 154, 0, .50); } .shadow_bottom_left_glossyOlive4a, .hover_shadow_bottom_left_glossyOlive4a:hover, .active_shadow_bottom_left_glossyOlive4a:active:hover { -webkit-box-shadow: -0.5em 0.5em 1em rgba(115, 115, 0, .63); -moz-box-shadow: -0.5em 0.5em 1em rgba(115, 115, 0, .63); box-shadow: -0.5em 0.5em 1em rgba(115, 115, 0, .63); } .shadow_bottom_left_glossyOlive4s, .hover_shadow_bottom_left_glossyOlive4s:hover, .active_shadow_bottom_left_glossyOlive4s:active:hover { -webkit-box-shadow: -0.5em 0.5em 1em rgba(115, 115, 0, .71); -moz-box-shadow: -0.5em 0.5em 1em rgba(115, 115, 0, .71); box-shadow: -0.5em 0.5em 1em rgba(115, 115, 0, .71); } /* -------------------------- shadow bottom_right settings --------------------------------*/ .shadow_bottom_right_glossyOlive4, .hover_shadow_bottom_right_glossyOlive4:hover, .active_shadow_bottom_right_glossyOlive4:active:hover { -webkit-box-shadow: 0.5em 0.5em 1em rgba(128, 128, 0, .39); -moz-box-shadow: 0.5em 0.5em 1em rgba(128, 128, 0, .39); box-shadow: 0.5em 0.5em 1em rgba(128, 128, 0, .39); } .shadow_bottom_right_glossyOlive4h, .hover_shadow_bottom_right_glossyOlive4h:hover, .active_shadow_bottom_right_glossyOlive4h:active:hover { -webkit-box-shadow: 0.5em 0.5em 1em rgba(154, 154, 0, .50); -moz-box-shadow: 0.5em 0.5em 1em rgba(154, 154, 0, .50); box-shadow: 0.5em 0.5em 1em rgba(154, 154, 0, .50); } .shadow_bottom_right_glossyOlive4a, .hover_shadow_bottom_right_glossyOlive4a:hover, .active_shadow_bottom_right_glossyOlive4a:active:hover { -webkit-box-shadow: 0.5em 0.5em 1em rgba(115, 115, 0, .63); -moz-box-shadow: 0.5em 0.5em 1em rgba(115, 115, 0, .63); box-shadow: 0.5em 0.5em 1em rgba(115, 115, 0, .63); } .shadow_bottom_right_glossyOlive4s, .hover_shadow_bottom_right_glossyOlive4s:hover, .active_shadow_bottom_right_glossyOlive4s:active:hover { -webkit-box-shadow: 0.5em 0.5em 1em rgba(115, 115, 0, .71); -moz-box-shadow: 0.5em 0.5em 1em rgba(115, 115, 0, .71); box-shadow: 0.5em 0.5em 1em rgba(115, 115, 0, .71); }
css
{ "name": "portfolio", "version": "1.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { "sal.js": { "version": "0.8.4", "resolved": "https://registry.npmjs.org/sal.js/-/sal.js-0.8.4.tgz", "integrity": "<KEY> } } }
json
/** * A package that implements a "dumb parser", and the facades to interact with the parser * @author <NAME>, <NAME>, <NAME> * @version 1.0.0 * @since 2020-05-03 */ package parser;
java
New Customer? English (United States) Français (Canada) Français (France) Deutsch (Deutschland) हिंदी (भारत) Italiano (Italia) Português (Brasil) Español (España) Español (México) Production Companies (3) Sales Representatives / ISA (1) Distributors (96) Special Effects (4) Other Companies (76) Metro-Goldwyn-Mayer (MGM) (Metro-Goldwyn-Mayer Pictures, presents and copyright holder) Metro-Goldwyn-Mayer (MGM) Warner Bros. (United States, 2012) (The Imaginarium, performance capture consultation) (WETA Digital, visual effects and animation) (M.A.C, makeup provided by) (Billie Lusk's Billionaires Catering, catering) (Chris Boswell Fine Catering, off set caterer) (off set caterer) (security services) By what name was The Hobbit: An Unexpected Journey (2012) officially released in Mexico? Who Are the 75th Primetime Emmys Acting Nominees?
english
For Daijiworld Media Network—Margoa (CN) Margoa, Jun 19: The trend of opposing development projects in the state is on the rise, which in turn has a negative impact on progress said Churchill Alemao, minister for public works, on Wednesday, June 18. Alemao was speaking at an event held at Lohia Maidan on the occasion of Goa Revolution Day, in the city. The huge gathering included senior citizens, freedom fighters, and school children. The minister’s comment is a turnaround from his earlier stance which involved protesting against the Mopa airport project and six-lane express highway. As a result, during the assembly elections, Alemao had come in for a lot of criticism from other politicians. Surprising the people further, he added that this attitude had caused the state to lag behind in terms of development which was adversely affecting the tourism industry. Tourism is the backbone of the state’s exchequer. Alemao warned that since Kerala and Karnataka was attracting the foreign tourists more, the repercussions would be felt on the state’s economy. He added that chief minister Digambar Kamat was doing a good job of running the government and rumors of instability were baseless. Minister for forest, Filip Neri Rodrigues, MLA Alex Reginald Lorence, councilor Johnson Fernandes, freedom Ffghter Madhukar Mordekar, Vaman Prabhu, collector G P Naik, and SP Shekhar Prabhudesay were present on the dais. Alemao also felicitated freedom fighters.
english
package org.springbud.mvc.type; public enum RequestMethod { GET, POST, PUT, DELETE; }
java
<reponame>Toure/Rhea __author__ = "<NAME>" __license__ = "Apache License 2.0" __version__ = "0.1" __email__ = "<EMAIL>" __status__ = "Alpha" import abc from importlib import import_module class TrackerBase(object): @staticmethod def import_mod(platform_name): """ Import mod will return an initialized import path from the specified module name. :param module_name: tracker module name of interest (str). :return: import object of requested module name. """ return import_module("iridium.libs.trackers.%s" % platform_name) class Tracker(object): __metaclass__ = abc.ABCMeta @abc.abstractmethod def create_case(self): pass @abc.abstractmethod def update_case(self, bug_id, updates): pass @abc.abstractmethod def update_flag(self, id, flags_status): pass @abc.abstractmethod def update_comment(self): pass
python
Former Indian cricketer, Gundappa Vishwanath made his debut in Test Cricket in the second Test during Australia’s tour of India in 1969. India batted first and Vishwanath walked out to bat after the loss of the two wickets. He couldn’t stay too long as he got out on a duck. However, Vishwanath scored his maiden Test century during India’s second innings in the Test. He played a brilliant knock of 137 runs, including 25 fours. With that, he became the first batsman to score a century in the second innings of the debut Test. Gundappa Vishwanath went on to score a plethora of runs in Test Cricket. He finished his career after playing 91 Tests and scoring 6080 runs at an average of 41.9. He scored 14 centuries and 35 half-centuries in Test Cricket.
english
function main() { var scene = new g.Scene({ game: g.game }); scene.onLoad.add(function() { var rect = new g.FilledRect({ scene: scene, cssColor: "red", width: 100, height: 100, touchable: true }); scene.append(rect); rect.onPointDown.add(function() { rect.cssColor = rect.cssColor === "red" ? "blue" : "red"; rect.modified(); }); }); scene.onPointDownCapture.add((ev) => { var size = 20; var rect = new g.FilledRect({ scene: scene, x: ev.point.x - size / 2, y: ev.point.y - size / 2, width: size, height: size, cssColor: "black" }); scene.append(rect); }); g.game.pushScene(scene); } module.exports = main;
javascript
<reponame>tonghuashuai/machine_learning from sklearn.model_selection import learning_curve from sklearn.datasets import load_digits from sklearn.svm import SVC import matplotlib.pyplot as plt import numpy as np digits = load_digits() X = digits.data y = digits.target train_sizes, train_loss, test_loss= learning_curve( SVC(gamma=0.001), X, y, cv=10, scoring='neg_mean_squared_error', train_sizes=[0.1, 0.25, 0.5, 0.75, 1]) train_loss_mean = -np.mean(train_loss, axis=1) test_loss_mean = -np.mean(test_loss, axis=1) plt.plot(train_sizes, train_loss_mean, 'o-', color="r", label="Training") plt.plot(train_sizes, test_loss_mean, 'o-', color="g", label="Cross-validation") plt.xlabel("Training examples") plt.ylabel("Loss") plt.legend(loc="best") plt.show()
python
<reponame>RaghuvirShirodkar/openroberta-lab #include "bob3.h" #include <stdlib.h> #include <math.h> Bob3 rob; void math1(); void math2(); inline bool _isPrime(double d); double ___n; bool ___booleanVar; unsigned int ___colourVar; void math1() { ___n = 0; ___n = ___n + ___n; ___n = ___n - ___n; ___n = ___n * ___n; ___n = ___n / ((float) ___n); ___n = pow(___n, ___n); ___n = sqrt(___n); ___n = abs(___n); ___n = - (___n); ___n = log(___n); ___n = log10(___n); ___n = exp(___n); ___n = pow(10.0, ___n); ___n = sin(M_PI / 180.0 * (___n)); ___n = cos(M_PI / 180.0 * (___n)); ___n = tan(M_PI / 180.0 * (___n)); ___n = 180.0 / M_PI * asin(___n); ___n = 180.0 / M_PI * acos(___n); ___n = 180.0 / M_PI * atan(___n); ___n = M_PI; ___n = M_E; ___n = M_GOLDEN_RATIO; ___n = M_SQRT2; ___n = M_SQRT1_2; ___n = M_INFINITY; } void math2() { ___booleanVar = (fmod(___n, 2) == 0); ___booleanVar = (fmod(___n, 2) != 0); ___booleanVar = _isPrime(___n); ___booleanVar = (___n == floor(___n)); ___booleanVar = (___n > 0); ___booleanVar = (___n < 0); ___booleanVar = (fmod(___n,___n) == 0); ___n += ___n; ___n = round(___n); ___n = ceil(___n); ___n = floor(___n); ___n = fmod(___n, ___n); ___n = _CLAMP(___n, ___n, ___n); ___n = randomNumber(___n, ___n); ___n = ((double) rand() / (RAND_MAX)); } void setup() { ___n = 0; ___booleanVar = true; ___colourVar = RGB(0xFF, 0xFF, 0xFF); } void loop() { math1(); math2(); } inline bool _isPrime(double d) { if (!(d == floor(d))) { return false; } int n = (int)d; if (n < 2) { return false; } if (n == 2) { return true; } if (n % 2 == 0) { return false; } for (int i = 3, s = (int)(sqrt(d) + 1); i <= s; i += 2) { if (n % i == 0) { return false; } } return true; }
cpp
Once upon a time, the temperature during summer increased so much. It resulted in scarcity of food and water. A group of birds staying together on a banyan tree were using their stock foods that they have stored long ago. After few days, they all had a meeting. The king told, "We should roam here and there regularly to collect food for the upcoming days otherwise our stock food will over and we would not left with anything else". Everybody agreed and next day onward they all went together and collected few grains whenever possible. One day, all were flying high in the sky. Suddenly a bird told, "Look at there at the ground, there are plenty of grains". Come on let's collect it. Everyone were so excited looking over there but suddenly the king asked, "in this hot summer, where availability of little food is being difficult, so much grains together at a time does not seem to be something unusual?" Other birds said, "no dear king, we are lucky to get such grains, without any delay we should move towards them". No body listened to the king and all went down. Being the leader, the king also went down still having a doubt in his mind. All of them were busy in collecting the grains. When they were almost done and tried to fly, they could not. Feeling difficulty in flying, they observed that all of them were trapped in a net. Now the king said, "I was telling you, not to get attracted and excited but none of you listened me". I think it is plan of a hunter to catch us. All the birds were frightened and asked the king for help. The king was also thinking how to rescue all of them. All of sudden he observed a hole on the ground and remembered his friend mouse is staying in that. He called his friend for help. Mouse came out of the hole, listened the matter from the king and promised to help them. MORAL OF THE STORY- Always listen to your elder's advice.
english
<reponame>awalker/nativescript-acedrawingview import { Directive } from "@angular/core"; @Directive({ selector: "Acedrawingview" }) export class AcedrawingviewDirective { constructor() { console.log('AcedrawingviewDirective'); } } @Directive({ selector: "AceDrawingView" }) export class AceDrawingViewDirective { constructor() { console.log('AcedrawingviewDirective'); } } export const DIRECTIVES = [AcedrawingviewDirective, AceDrawingViewDirective];
typescript
<gh_stars>0 package fr.max2.betterconfig.client.gui.style; public interface IPropertySource { <T> T getProperty(PropertyIdentifier<T> property); }
java
{"word":"foramen","definition":"A small opening, perforation, or orifice; a fenestra. Foramen of Monro (Anat.), the opening from each lateral into the third ventricle of the brain. -- Foramen of Winslow (Anat.), the opening connecting the sac of the omentum with the general cavity of the peritoneum."}
json
<HTML> <HEAD> <TITLE>PyIProcessDebugManager.GetDefaultApplication</TITLE> <META NAME="GENERATOR" CONTENT="Autoduck, by <EMAIL>"> <H1><A HREF="PyIProcessDebugManager.html">PyIProcessDebugManager</A>.GetDefaultApplication</H1><P> <B>GetDefaultApplication(</B>)<P>Description of GetDefaultApplication.<P> </body> </html>
html
Fans of Minecraft Championship (MCC) can celebrate its fourth anniversary with the upcoming Minecraft Championship Party. This exciting event will host 10 teams consisting of popular streamers and content creators as they work their way through minigames to clinch glory. Promising bundles of excitement, players will want more insight into the participating teams and their favorite Minecraft personalities. The MCC event will kick off on November 11, 2023, and the team rosters have recently been unveiled. The Minecraft Championship incorporates eight minigames built on numerous in-game facets, such as combat, parkour, survival, and more. As teams ascend through the MCC, each minigame becomes more important. After the games conclude, the teams with the two highest scores will participate in a game of Dodgebolt, an exciting twist on dodgeball using arrows. Presenting high stakes, these teams will need the support of their loyal fans to help them clinch the win. Here are all the lineups for the upcoming Minecraft Championship Party. The Red Rabbits team for MCC Party consists of: The Orange Ocelots team for MCC Party consists of: The Yellow Yaks team for MCC Party consists of: The Lime Llamas team for MCC Party consists of: The Green Geckos team for MCC Party consists of: The Cyan Coyotes team for MCC Party consists of: The Aqua Axolotls for MCC Party consists of: The Blue Bats for MCC Party consists of: The Purple Pandas for MCC Party consists of: The upcoming MCC Party celebrates more than just its fourth anniversary — it serves as a testament to the vibrant spirit of the Minecraft community. With fan-favorite streamers and content creators banding together in teams, the event promises to be a showcase of skill, strategy, and teamwork. As November 11, 2023 approaches, fans can pick their team and prepare to be captivated by every parkour jump, combat strategy, and survival tactic. They can watch the event unfold on Twitch, and YouTube via their favorite streamer's channel.
english
Forum is an online discussion forum where youth or even the experienced professionals discuss their queries related to and get answers for their questions from other talented individuals. An online discussion can be started by asking questions, helping others with answers. The best part is that it is very simple and is free of cost. Explain Affirmative action. How does it affect the legal activities of the business. Can someone please briefly explain what is the impact of affirmation policies on education and employment.
english
Index,Facility_Name,Facility_Type,Street_No,Street_Name,City,Prov_Terr,Postal_Code 75d3f3bf1ddcf01b6509,Du Vallon,Public,54,rue tremblay,Petit-Saguenay,QC,G0V1N0
json
<reponame>acetoneRu/XD<filename>lib/rpc/transmission/rpc.go package transmission import ( "encoding/json" "fmt" "github.com/majestrate/XD/lib/bittorrent/swarm" "github.com/majestrate/XD/lib/log" "github.com/majestrate/XD/lib/sync" "github.com/majestrate/XD/lib/util" "io" "net" "net/http" ) type Server struct { sw *swarm.Swarm tokens sync.Map nextToken *xsrfToken handlers map[string]Handler } func (s *Server) Error(w http.ResponseWriter, err error, tag Tag) { w.WriteHeader(http.StatusOK) log.Warnf("trpc error: %s", err.Error()) json.NewEncoder(w).Encode(Response{ Tag: tag, Result: err.Error(), }) } func (s *Server) getToken(addr string) *xsrfToken { a, _, _ := net.SplitHostPort(addr) if a != "" { addr = a } tok, loaded := s.tokens.LoadOrStore(addr, s.nextToken) if !loaded { s.nextToken = newToken() } return tok.(*xsrfToken) } func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { xsrf := r.Header.Get(XSRFToken) tok := s.getToken(r.RemoteAddr) if !tok.Check(xsrf) { tok.Update() w.Header().Set(XSRFToken, tok.Token()) w.WriteHeader(http.StatusConflict) return } tok.Update() var req Request var resp Response err := json.NewDecoder(r.Body).Decode(&req) if err == nil { log.Debugf("trpc request: %q", req) h, ok := s.handlers[req.Method] if ok { resp = h(s.sw, req.Args) if resp.Result != Success { log.Warnf("trpc handler non success: %s", resp.Result) } } resp.Tag = req.Tag } if err == nil { buff := new(util.Buffer) w.Header().Set("Content-Type", ContentType) json.NewEncoder(buff).Encode(resp) log.Debugf("trpc response: %s", buff.String()) w.Header().Set("Content-Length", fmt.Sprintf("%d", buff.Len())) io.Copy(w, buff) } else { s.Error(w, err, req.Tag) } r.Body.Close() } func NewHandler(sw *swarm.Swarm) http.Handler { return &Server{ sw: sw, nextToken: newToken(), handlers: map[string]Handler{ "torrent-start": NotImplemented, "torrent-start-now": NotImplemented, "torrent-stop": NotImplemented, "torrent-verify": NotImplemented, "torrent-reannounce": NotImplemented, "torrent-get": TorrentGet, "torrent-set": NotImplemented, "torrent-add": NotImplemented, "torrent-remove": NotImplemented, "torrent-set-location": NotImplemented, "torrent-rename-path": NotImplemented, "session-set": NotImplemented, "session-stats": NotImplemented, "blocklist-update": NotImplemented, "port-test": NotImplemented, "session-close": NotImplemented, "queue-move-top": NotImplemented, "queue-move-up": NotImplemented, "queue-move-down": NotImplemented, "queue-move-bottom": NotImplemented, "free-space": NotImplemented, }, } }
go
<reponame>raviranjan1996/Java14<filename>MoreBasicType/src/application/StringPrint.java package application; import java.util.Scanner; public class StringPrint { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); boolean isCorrect = true; int count = 0; String[] str = new String[3]; int[] number = new int[3]; do { System.out.println("Enter the string and number"); for (int i = 0; i < 3; i++) { str[i] = scanner.next(); number[i] = scanner.nextInt(); count++; if (count == 3) { isCorrect = false; } } } while (isCorrect); String formatString; System.out.println("================================"); for (int j = 0; j < 3; j++) { formatString = String.format("%-14s %03d", str[j], number[j]); System.out.println(formatString); } System.out.println("================================"); scanner.close(); } }
java
Royal Challengers Bangalore wrist spinner Yuzvendra Chahal managed to grab the Purple Cap after the conclusion of the 14th match of the tournament as he finished with impressive figures of 2/17 in his allotted four overs spell against the Rajasthan Royals yesterday. He is quite brilliant with his variations and had his fielders supported him well, Chahal could have pulled off a victory for Bangalore single-handedly. However, that was not the case as RR registered a quite convincing victory, in the end, to open their account in the tournament. The leg-spinner bagged the wickets of Ajinkya Rahane and Jos Buttler to keep Royal Challengers Bangalore in the game. However, the target didn’t prove to be enough for RCB in the end. Chahal was delighted after getting the Purple cap but said that he would have been happier had RCB won the match. He feels that with 10 matches still left in the tournament, RCB can make a comeback of sorts. “Obviously it is a great feeling if you are the highest wicket-taker in the tournament but sad that we didn’t win the match. Leg spinners have many variations compared to other bowlers. We also get more turn from the surface. The googly and top spinner also spin more. It is the fourth loss in a row, but we have 10 games to comeback. You need to stay positive in such a situation. I am used to conditions there, the sixth year with RCB, and I like bowling at the Chinnaswamy,” Yuzvendra Chahal told during the post-match interview. Earlier in the day, it was another leg-spinner Shreyas Gopal who wreaked havoc and bagged 3 crucial wickets for just 11 runs in his 4 overs spell. Gopal bowled brilliantly and his wickets tally includes those of arguably the two greatest batsmen of the modern generation Virat Kohli and AB de Villiers. It was his exceptional bowling spell which helped Rajasthan Royals restrict Bangalore to a competitive score of 158 runs.
english
import { mongoosePagination } from "ts-mongoose-pagination"; import { SchemaTypes ,PaginateModel,Schema, model} from "mongoose"; import { UserType } from "../../../business/enum/UserType"; import { User } from "../interfaces/user.interface"; import * as bcrypt from "bcrypt-nodejs"; const userSchema = new Schema( { fullName: { type: String }, mobile: { type: String, default: null }, email: { type: String, required: true, unique: true, validate: [ (val: string) => { return isMail(val); }, 'Please fill a valid email address' ] }, password: { type: String, required: true, uniq: true }, pic: { type: String, default: "" }, country: String, birthday: Date, userType: { type: String, default: UserType.user, enum: ["Admin", "StoreAdmin", "User"] }, active: { type: Boolean, required: true, default: false }, provider: { type: String, enum: ["LOCAL", "facebook", "google"], default: "LOCAL" }, providerData: { providerID: String, providerToken1: String, providerToken2: String, }, token: String, deliveryAddress: [ { type: SchemaTypes.ObjectId, ref: "DeliveryAddress" } ], changePassword: { token: String, creationDate: Date }, stores: [{type: SchemaTypes.ObjectId, ref: "Store"}], lastLogin: Date, }, { timestamps: true } ); userSchema.methods.comparePassword = (password: string, hash: string): Promise<boolean> => { const p: Promise<boolean> = new Promise<boolean>((resolve, reject) => { bcrypt.compare(password, hash, (err, isMatch) => { if (err) { reject(err); } console.log(isMatch); resolve(isMatch); }); }); return p; }; userSchema.methods.hashPasswordMethod = (password: string): Promise<string> => { let p: Promise<string> = new Promise<string>((resolve, reject) => { bcrypt.genSalt(10, (err, salt) => { bcrypt.hash( password, salt, () => { }, (err, hashedPassword) => { if (err) { reject(err); throw err; } password = <PASSWORD>; resolve(hashedPassword); } ); }); }); return p; }; userSchema.pre("save", function(next) { if (this.isModified("password")) { bcrypt.genSalt(10, (err, salt) => { bcrypt.hash( (<User>this).password, salt, () => {}, (err, hashedPassword) => { if (err) { throw err; } (<User>this).password = <PASSWORD>; next(); } ); }); } }); export function isMail(value: string): boolean { const emailRegex = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/; return emailRegex.test(value); } userSchema.plugin(mongoosePagination); export const UserPaginate: PaginateModel<User> = model("User", userSchema); export {userSchema} ;
typescript
package ge.edu.freeuni.sdp.iot.service.camera_object_recognizer.service; import com.microsoft.azure.storage.StorageException; import ge.edu.freeuni.sdp.iot.service.camera_object_recognizer.data.FakeRepository; import ge.edu.freeuni.sdp.iot.service.camera_object_recognizer.model.ObjectEntity; import ge.edu.freeuni.sdp.iot.service.camera_object_recognizer.proxy.CameraProxy; import ge.edu.freeuni.sdp.iot.service.camera_object_recognizer.proxy.FakeProxyFactory; import ge.edu.freeuni.sdp.iot.service.camera_object_recognizer.proxy.GoogleApiServiceProxy; import ge.edu.freeuni.sdp.iot.service.camera_object_recognizer.proxy.HouseRegistryServiceProxy; import org.glassfish.jersey.server.ResourceConfig; import org.glassfish.jersey.test.JerseyTest; import org.json.JSONArray; import org.json.JSONObject; import org.junit.Before; import org.junit.Test; import javax.ws.rs.core.Application; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.io.IOException; import java.lang.reflect.Array; import java.security.GeneralSecurityException; import java.util.ArrayList; import java.util.List; import static org.junit.Assert.*; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; public class TestCheckService extends JerseyTest { private HouseRegistryServiceProxy house; private CameraProxy camera; private GoogleApiServiceProxy googleapi; @Before public void init(){ FakeProxyFactory factory = FakeProxyFactory.getFakeFactory(); house = mock(HouseRegistryServiceProxy.class); camera = mock(CameraProxy.class); googleapi = mock(GoogleApiServiceProxy.class); factory.setHouseRegistryService(house); factory.setCamera(camera); factory.setGoogleApiService(googleapi); } @Override protected Application configure() { return new ResourceConfig(FakeCheckService.class); } @Test public void testHouseNotFound(){ FakeRepository.instance().clear(); String houseId = "1"; String cameraUrl = "0.0.0.0"; prepareHouseRegistry(houseId, false); prepareCameraUrl(houseId, cameraUrl); Response r = getResponse(String.format("houses/%s/check", houseId)); assertEquals(Response.Status.NOT_FOUND.getStatusCode(), r.getStatus()); } @Test public void testCameraNullUrl() { FakeRepository.instance().clear(); String houseId = "asd"; prepareHouseRegistry(houseId, true); prepareCameraUrl(houseId, null); Response r = getResponse(String.format("houses/%s/check", houseId)); assertEquals(Response.Status.NOT_FOUND.getStatusCode(), r.getStatus()); } @Test public void checkEmptyGoogleResponse() throws IOException, GeneralSecurityException { FakeRepository.instance().clear(); String houseId = "#"; String cameraUrl = "0.0.0.0"; prepareHouseRegistry(houseId, true); prepareCameraUrl(houseId, cameraUrl); byte[] bt = new byte[1]; prepareCamera(cameraUrl, bt); prepareGoogleApi(bt, 50, new ArrayList<String>()); CheckDo obj = readEntity(String.format("houses/%s/check", houseId)); assertTrue(obj.isResult()); } @Test public void checkForUnknownObject() throws IOException, GeneralSecurityException { FakeRepository.instance().clear(); String houseId = "-1"; String cameraUrl = "0.0.0.0"; prepareHouseRegistry(houseId, true); prepareCameraUrl(houseId, cameraUrl); byte[] bt = new byte[1]; prepareCamera(cameraUrl, bt); prepareGoogleApi(bt, 50, new ArrayList<String>() {{ add("chair"); add("table"); }}); CheckDo obj = readEntity(String.format("houses/%s/check", houseId)); assertFalse(obj.isResult()); List<String> ls = obj.getObjects(); assertEquals(2, ls.size()); assertTrue(ls.contains("chair")); assertTrue(ls.contains("table")); assertFalse(ls.contains("rame")); } @Test public void checkAllKnownObjects() throws IOException, GeneralSecurityException, StorageException { FakeRepository.instance().clear(); String houseId = "--"; String cameraUrl = "0.0.0.0"; prepareHouseRegistry(houseId, true); prepareCameraUrl(houseId, cameraUrl); byte[] bt = new byte[1]; prepareCamera(cameraUrl, bt); prepareGoogleApi(bt, 50, new ArrayList<String>() {{ add("tebro"); add("lamara"); }}); updateRepository(houseId, new ArrayList<String>() {{ add("tebro"); add("lamara"); }}); CheckDo obj = readEntity(String.format("houses/%s/check", houseId)); assertTrue(obj.isResult()); } @Test public void checkKnownAndUknownsTogether() throws IOException, GeneralSecurityException, StorageException { FakeRepository.instance().clear(); String houseId = "1"; String cameraUrl = "0.0.0.0"; prepareHouseRegistry(houseId, true); prepareCameraUrl(houseId, cameraUrl); byte[] bt = new byte[1]; prepareCamera(cameraUrl, bt); prepareGoogleApi(bt, 50, new ArrayList<String>() {{ add("tebro"); add("lamara"); add("skameika"); }}); updateRepository(houseId, new ArrayList<String>() {{ add("tebro"); add("lamara"); }}); CheckDo obj = readEntity(String.format("houses/%s/check", houseId)); List<String> ls = obj.getObjects(); assertFalse(obj.isResult()); assertEquals(1, ls.size()); assertTrue(ls.contains("skameika")); assertFalse(ls.contains("tebro")); assertFalse(ls.contains("lamara")); } private void prepareHouseRegistry(String houseId, boolean response) { when(house.get(houseId)).thenReturn(response); } private void prepareCameraUrl(String houseId, String response) { when(house.getCameraUrl(houseId)).thenReturn(response); } private void prepareCamera(String url, byte[] response) { when(camera.get(url)).thenReturn(response); } private void prepareGoogleApi(byte[] request, int max, ArrayList<String> response) throws IOException, GeneralSecurityException { when(googleapi.getObjectList(request, max)).thenReturn(response); } private void updateRepository(String houseId, ArrayList<String> arr) throws StorageException { int i = 0; for (String elem : arr) { FakeRepository.instance().insertOrUpdate(ObjectEntity.fromDo(houseId, new ObjectDo(String.valueOf(i++), elem))); } } private Response getResponse(String url) { return target(url) .request(MediaType.APPLICATION_JSON_TYPE) .get(); } private CheckDo readEntity(String url) { return getResponse(url).readEntity(CheckDo.class); } }
java
.u-font-baloo-chettan-2-400 { font-family: 'Baloo Chettan 2' !important; font-weight: 400 !important; } .u-font-baloo-chettan-2-500 { font-family: 'Baloo Chettan 2' !important; font-weight: 500 !important; } .u-font-baloo-chettan-2-600 { font-family: 'Baloo Chettan 2' !important; font-weight: 600 !important; } .u-font-baloo-chettan-2-700 { font-family: 'Baloo Chettan 2' !important; font-weight: 700 !important; } .u-font-baloo-chettan-2-800 { font-family: 'Baloo Chettan 2' !important; font-weight: 800 !important; }
css
ISL 2022 Top Scorers: ISL 2022 LIVE: ISL LIVE: The sixth match week of the ninth season of the Indian Super League has been underway. The games have witnessed some prolific and outstanding goals. The hunt for the coveted Golden Boot is back, with veteran superstars competing against high-profile summer additions for the title of best goal scorer in India’s premier division. With his goal against FC Goa Ivan Kaliuzhnyi leads the charts with four goals followed by Dimitri Petratos. Follow Indian Super League and ISL 2022-23 LIVE Updates on InsideSport.IN. This is the Ukrainian’s debut season in the Indian Super League (ISL). He is on loan from Oleksandriya and scored twice in his maiden outing for Kerala Blasters against Kolkata giants East Bengal. He added two more to his total to take the top spot on the standings. Proven striker Cleiton Silva is eagerly pursuing Petratos and Kalyuzhnyi. . After a respectable two seasons with the Blues, Cleiton Silva defected to East Bengal from Bengaluru in the offseason. During it, he scored 16 goals and contributed seven assists. The Brazilian scored the opening goal in the 3-1 victory against NorthEast United after scoring from the penalty spot in the Goa defeat. As for FC Goa, new signing Noah Sadaoui also made his name into the top scorer’s list with three goals in five appearances. In their season opener against Mumbai City, reigning champions Hyderabad FC held Mumbai City to a 3-3 draw thanks to two goals from Joao Victor. Halicharan Narzary, another member of his squad, is sprinting nearby. The Indian winger scored his first goal in Hyderabad’s 3-3 tie with Mumbai City to start their championship defence, and he added another in the team’s 3-0 victory over NorthEast United. Follow InsideSport on GOOGLE NEWS / Follow Indian Super League and ISL 2022-23 LIVE Updates on InsideSport.IN.
english
<gh_stars>10-100 from pathlib import Path from tempfile import mkdtemp from nose.tools import eq_ from anycache import AnyCache from anycache import get_defaultcache from anycache import anycache def test_basic(): """Basic functionality.""" @anycache() def myfunc(posarg, kwarg=3): # count the number of calls myfunc.callcount += 1 return posarg + kwarg myfunc.callcount = 0 eq_(myfunc(4, 5), 9) eq_(myfunc.callcount, 1) eq_(myfunc(4, 5), 9) eq_(myfunc.callcount, 1) eq_(myfunc(4, 5), 9) eq_(myfunc.callcount, 1) eq_(myfunc(4, 2), 6) eq_(myfunc.callcount, 2) eq_(myfunc(4, 5), 9) eq_(myfunc.callcount, 2) assert get_defaultcache().size > 0 def test_del(): ac = AnyCache() @ac.anycache() def myfunc(posarg, kwarg=3): return posarg + kwarg eq_(myfunc(4, 5), 9) assert ac.size > 0 del ac # we are not able to check anything here :-( def test_cleanup(): """Cleanup.""" ac = AnyCache() cachedir = ac.cachedir @ac.anycache() def myfunc(posarg, kwarg=3): # count the number of calls myfunc.callcount += 1 return posarg + kwarg myfunc.callcount = 0 # first use eq_(myfunc(4, 5), 9) eq_(myfunc.callcount, 1) eq_(myfunc(4, 2), 6) eq_(myfunc.callcount, 2) eq_(myfunc(4, 2), 6) eq_(myfunc.callcount, 2) assert ac.size > 0 # clear ac.clear() eq_(ac.size, 0) eq_(tuple(cachedir.glob("*")), tuple()) # second use eq_(myfunc(4, 4), 8) eq_(myfunc.callcount, 3) assert ac.size > 0 # clear twice ac.clear() eq_(ac.size, 0) ac.clear() eq_(ac.size, 0) def test_size(): """Size.""" ac = AnyCache() @ac.anycache() def myfunc(posarg, kwarg=3): return posarg + kwarg eq_(ac.size, 0) eq_(len(tuple(ac.cachedir.glob("*.cache"))), 0) eq_(myfunc(4, 5), 9) eq_(len(tuple(ac.cachedir.glob("*.cache"))), 1) size1 = ac.size eq_(myfunc(4, 2), 6) eq_(ac.size, 2 * size1) eq_(len(tuple(ac.cachedir.glob("*.cache"))), 2) def test_corrupt_cache(): """Corrupted Cache.""" cachedir = Path(mkdtemp()) ac = AnyCache(cachedir=cachedir) @ac.anycache() def myfunc(posarg, kwarg=3): myfunc.callcount += 1 return posarg + kwarg myfunc.callcount = 0 eq_(myfunc(4, 5), 9) eq_(myfunc.callcount, 1) eq_(myfunc(4, 5), 9) eq_(myfunc.callcount, 1) # corrupt cache cachefilepath = list(cachedir.glob("*.cache"))[0] with open(str(cachefilepath), "w") as cachefile: cachefile.write("foo") # repair eq_(myfunc(4, 5), 9) eq_(myfunc.callcount, 2) eq_(myfunc(4, 5), 9) eq_(myfunc.callcount, 2) # corrupt dep depfilepath = list(cachedir.glob("*.dep"))[0] with open(str(depfilepath), "w") as depfile: depfile.write("foo") # repair eq_(myfunc(4, 5), 9) eq_(myfunc.callcount, 3) eq_(myfunc(4, 5), 9) eq_(myfunc.callcount, 3) ac.clear() def test_cachedir(): """Corrupted Cache.""" cachedir = Path(mkdtemp()) @anycache(cachedir=cachedir) def myfunc(posarg, kwarg=3): myfunc.callcount += 1 return posarg + kwarg myfunc.callcount = 0 eq_(myfunc(4, 5), 9) eq_(myfunc.callcount, 1) eq_(myfunc(4, 5), 9) eq_(myfunc.callcount, 1) @anycache(cachedir=cachedir) def myfunc(posarg, kwarg=3): myfunc.callcount += 1 return posarg + kwarg myfunc.callcount = 0 eq_(myfunc(4, 5), 9) eq_(myfunc.callcount, 0) def class_test(): class MyClass(object): def __init__(self, posarg, kwarg=3): self.posarg = posarg self.kwarg = kwarg @anycache() def func(self, foo): return self.posarg + self.kwarg + foo a = MyClass(2, 4) b = MyClass(1, 3) eq_(a.func(6), 12) eq_(a.func(6), 12) eq_(b.func(6), 10) eq_(b.func(6), 10) eq_(a.func(6), 12)
python
A marriage needs constant devotion, intimacy, love, and some quirk. Using some nicknames for wife can be a great way to positively impact your relationship. It always feels great to call a loved one by their cool nickname. In addition to making them feel special and pampered, it has a swoon-worthy vibe. What about having catchy nicknames for wife? Not bad, huh? We're sure she'll appreciate getting an affectionate nickname from you. You will fall in love with the list of names we have created just for you to uniquely address your wife. Some of them are already quite well known, but others are exquisite and one-of-a-kind. Even when having a casual talk, they are the ideal way to show your better half affection in a regular conversation. Check it out! Here is a list of the most beautiful and adorably sweet nicknames to call your wife. From names with the most romantic feeling to the cutest and kindest feel, we have them all covered for you. These lovely terms of endearment allow you to show off your affection while also giving you a terrific, fascinating, and magical feeling. They will undoubtedly be adored by both you and your wife. Check out these recommendations! Consider giving your wife some cute and sassy nicknames. These are some perfect nickname suggestions to consider if you want to strike a lighthearted and endearing tone in your conversations. Every once in a while, we all like laughing and having lighthearted talks. Why not give your wife one of these adorable nicknames at this time? These fun nicknames are so lovely and cute that they'll quickly melt her heart. You'll see the difference if you try calling her such names! It's okay to use a few humorous nicknames for wife now and then. These amusing nicknames can be used to address her in a playful manner. These humorous nicknames can be used during a date to appreciate her presence. These nicknames for wife will help you maintain the spark if you've just gotten married. Any woman will feel special if their husband refers to them by one of these best nicknames for wife. Give your wife a nickname that sums up all your love for her in one word if you believe she is the most beautiful lady in the world and you simply can't stop thinking about her. Don't you consider yourself fortunate to be married to such a loving and caring person? Then, congratulate her on using some of these exotic nicknames. How did you like discovering these lovely nicknames for wife? Aren't they exciting and original? When you use them, your everyday interactions will have a romantic and excellent tone. These cute names are enchanting and have a spark that will inevitably bring the two of you closer together. How do you feel? Which classic nicknames appeal to you the most? Tell us what you think!
english
<reponame>henriquevcosta/feedzai-openml-python<filename>openml-python-common/src/main/java/com/feedzai/openml/python/AbstractClassificationPythonModelLoaderImpl.java /* * The copyright of this file belongs to Feedzai. The file cannot be * reproduced in whole or in part, stored in a retrieval system, * transmitted in any form, or by any means electronic, mechanical, * photocopying, or otherwise, without the prior permission of the owner. * * (c) 2018 Feedzai, Strictly Confidential */ package com.feedzai.openml.python; import com.feedzai.openml.data.schema.DatasetSchema; import com.feedzai.openml.model.MachineLearningModel; import com.feedzai.openml.provider.descriptor.fieldtype.ParamValidationError; import com.feedzai.openml.provider.exception.ModelLoadingException; import com.feedzai.openml.provider.model.MachineLearningModelLoader; import com.feedzai.openml.python.jep.instance.JepInstance; import com.feedzai.util.load.LoadSchemaUtils; import com.feedzai.util.validate.ClassificationValidationUtils; import com.feedzai.util.validate.ValidationUtils; import com.google.common.base.Preconditions; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.nio.file.Path; import java.util.Base64; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.UUID; import java.util.concurrent.ExecutionException; /** * Abstract implementation of a model loader for classification models implemented in Python. * Any model loader that loads python models should extend this class. * In theory the only thing a python model loader should need to implement is the * {@link #getModelImpl(DatasetSchema, JepInstance, String)} method, and even then it can be made very easy if the * {@link ClassificationPythonModel} can be reused. * * @author <NAME> (<EMAIL>) * @since 0.1.0 */ public abstract class AbstractClassificationPythonModelLoaderImpl implements MachineLearningModelLoader<ClassificationPythonModel> { /** * Logger. */ private static final Logger logger = LoggerFactory.getLogger(AbstractClassificationPythonModelLoaderImpl.class); @Override public ClassificationPythonModel loadModel(final Path modelPath, final DatasetSchema schema) throws ModelLoadingException { logger.info("Trying to load a model in path [{}]...", modelPath); final JepInstance jepInstance = new JepInstance(); final String id = generateNamesafeId(); try { // Start the Jep instance thread jepInstance.start(); // Run provider specific model loading logic modelLoadLogic(jepInstance, id, modelPath); // Load common imports jepInstance.submitEvaluation((jep) -> { jep.eval("import numpy"); return null; }).get(); } catch (final InterruptedException | ExecutionException e) { logger.error("Could not load the model [{}].", modelPath, e); throw new ModelLoadingException("Error while loading the model.", e); } // Since only classification is supported, we need to validate that the target variable is compatible final Optional<ParamValidationError> validationError = ValidationUtils.validateCategoricalSchema(schema); Preconditions.checkArgument(!validationError.isPresent(), "Target variable must be categorical: %s", validationError); // Creates the model object giving it the jep instance containing the imported model final ClassificationPythonModel model = getModelImpl(schema, jepInstance, id); validateLoadedModel(schema, jepInstance, id, model); logger.info("Model loaded successfully."); return model; } /** * Gets the actual instance of the {@link MachineLearningModel} to use. * * @param schema The {@link DatasetSchema} of the incoming instances. * @param jepInstance The {@link JepInstance} that provides access to the python environment. * @param id The identifier that has been assigned to the model. * @return The concrete model implementation. */ protected ClassificationPythonModel getModelImpl(final DatasetSchema schema, final JepInstance jepInstance, final String id) { return new ClassificationPythonModel(jepInstance, schema, id); } /** * Specific implementation of python logic that loads the model. * * @param jepInstance Instance of Jep that will store and handle the model. * @param id Name of the variable on the Jep environment that will hold the model. * @param modelPath Path to the model. * @throws InterruptedException Exception that is thrown in case the Jep instance is closed during or before * the evaluation of the model loading function. * @throws ExecutionException Exception that is thrown in case a JepException is thrown while loading the model. * @throws ModelLoadingException Generic exception for problems that may occur during model loading. */ protected abstract void modelLoadLogic(final JepInstance jepInstance, final String id, final Path modelPath) throws InterruptedException, ExecutionException, ModelLoadingException; /** * Generates a unique id to use as a variable name to store the loaded model in a Jep instance. * This is a UUID encoded with an URL safe Base64 encoder. * * @return Variable name safe id. */ private String generateNamesafeId() { final byte[] base64encodedUUID = Base64.getUrlEncoder().encode(UUID.randomUUID().toString().getBytes()); return String.format("model_%s", new String(base64encodedUUID)); } /** * Validates a loaded python model. * The model should be able to support calls to a classification and class distribution with a mocked instance based * on the provided model schema. * * @param schema Schema of the loaded model. * @param jepInstance Instance of Jep where the model was loaded. * @param id Name of the variable inside the Jep instance where the model was stored. * @param model Loaded model. * @throws ModelLoadingException Exception thrown when the model has validation problems. */ private void validateLoadedModel(final DatasetSchema schema, final JepInstance jepInstance, final String id, final ClassificationPythonModel model) throws ModelLoadingException { // Checks if functions exist model.validate(jepInstance, id); ClassificationValidationUtils.validateClassificationModel(schema, model); } @Override public List<ParamValidationError> validateForLoad(final Path modelPath, final DatasetSchema schema, final Map<String, String> params) { return ValidationUtils.baseLoadValidations(schema, params); } @Override public DatasetSchema loadSchema(final Path modelPath) throws ModelLoadingException { return LoadSchemaUtils.datasetSchemaFromJson(modelPath); } }
java
<gh_stars>10-100 """This is the eval tools for ICDAR2019 competitions ==== Features: > mAP evaluation by cocoAPI > F score evaluation ==== Author: > tkianai """ import os import json import argparse import cv2 import numpy as np import matplotlib.pyplot as plt from tqdm import tqdm from pycocotools.coco import COCO from pycocotools.cocoeval import COCOeval import pycocotools.mask as maskUtils from imantics import Mask as maskToPolygon from utils.iou import compute_polygons_iou class IcdarEval(object): def __init__(self, dt_file, gt_file=None, iou_threshold=0.5): self.gt_file = gt_file self.dt_file = dt_file self.iou_threshold = iou_threshold self.dt_anns = json.load(open(dt_file)) if gt_file is None: self.gt_anns = None else: self.gt_anns = json.load(open(gt_file)) self.Precision = None self.Recall = None def calculate_F_score(self, Precision, Recall): eps = 1e-7 F_score = 2.0 * Precision * Recall / (Precision + Recall + eps) return F_score def eval_map(self, mode='segm'): """evaluate mean average precision Keyword Arguments: mode {str} -- could be choose from ['bbox' | 'segm'] (default: {'segm'}) """ if mode not in ['bbox', 'segm']: raise NotImplementedError("Mode [{}] doesn't been implemented, choose from [bbox, segm]!".format(mode)) # eval map Gt = COCO(self.gt_file) Dt = Gt.loadRes(self.dt_file) evalObj = COCOeval(Gt, Dt, mode) imgIds = sorted(Gt.getImgIds()) evalObj.params.imgIds = imgIds evalObj.evaluate() evalObj.accumulate() evalObj.summarize() def save_pr_curve(self, save_name='./data/P_R_curve.png'): if self.Precision is None or self.Recall is None: return # save the P-R curve save_dir = os.path.dirname(save_name) if not os.path.exists(save_dir): os.makedirs(save_dir) plt.clf() plt.plot(self.Recall, self.Precision) plt.xlim(0, 1) plt.ylim(0, 1) plt.title('Precision-Recall Curve') plt.grid() plt.xlabel('Recall') plt.ylabel('Precision') plt.savefig(save_name, dpi=400) print('Precision-recall curve has been written to {}'.format(save_name)) def eval_F_by_coco(self, threshold=None, mode='segm'): iou_threshold = self.iou_threshold if threshold is None else threshold assert iou_threshold >=0.0 and iou_threshold <= 1.0, "The IOU threshold [{}] is illegal!".format(iou_threshold) if mode not in ['bbox', 'segm']: raise NotImplementedError("Mode [{}] doesn't been implemented, choose from [bbox, segm]!".format(mode)) # eval map Gt = COCO(self.gt_file) Dt = Gt.loadRes(self.dt_file) evalObj = COCOeval(Gt, Dt, mode) imgIds = sorted(Gt.getImgIds()) evalObj.params.imgIds = imgIds evalObj.params.iouThrs = [iou_threshold] evalObj.params.areaRng = [[0, 10000000000.0]] evalObj.params.maxDets = [100] evalObj.evaluate() evalObj.accumulate() Precision = evalObj.eval['precision'][0, :, 0, 0, 0] Recall = evalObj.params.recThrs Scores = evalObj.eval['scores'][0, :, 0, 0, 0] F_score = self.calculate_F_score(Precision, Recall) # calculate highest F score idx = np.argmax(F_score) results = dict( F_score=F_score[idx], Precision=Precision[idx], Recall=Recall[idx], score=Scores[idx], ) # summarize print('---------------------- F1 ---------------------- ') print('Maximum F-score: %f' % results['F_score']) print(' |-- Precision: %f' % results['Precision']) print(' |-- Recall : %f' % results['Recall']) print(' |-- Score : %f' % results['score']) print('------------------------------------------------ ') self.Precision = Precision self.Recall = Recall def eval_F(self, threshold=None): iou_threshold = self.iou_threshold if threshold is None else threshold assert iou_threshold >=0.0 and iou_threshold <= 1.0, "The IOU threshold [{}] is illegal!".format(iou_threshold) assert self.gt_anns is not None, "GroundTruth must be needed!" gt_polygons_number = 0 gt_polygons_set = {} gt_annotations = self.gt_anns['annotations'] gt_imgIds = set() for itm in gt_annotations: gt_imgIds.add(itm['image_id']) for imgId in gt_imgIds: polygons = [] for itm in gt_annotations: if itm['image_id'] == imgId: # polygons gt_segm = np.array(itm['segmentation']).ravel().tolist() polygons.append(gt_segm) gt_polygons_number += len(polygons) gt_polygons_set[imgId] = polygons dt_gt_match_all = [] dt_scores_all = [] dt_imgIds = set() dt_annotations = self.dt_anns for itm in dt_annotations: dt_imgIds.add(itm['image_id']) for imgId in tqdm(dt_imgIds): if imgId not in gt_polygons_set: print("Image ID [{}] not found in GroundTruth file, this will be ignored!".format(imgId)) continue gt_polygons = gt_polygons_set[imgId] dt_polygons = [] dt_scores = [] for itm in dt_annotations: if itm['image_id'] == imgId: # mask _mask = maskUtils.decode(itm['segmentation']).astype(np.bool) polygons = maskToPolygon(_mask).polygons() roi_areas = [cv2.contourArea(points) for points in polygons.points] idx = roi_areas.index(max(roi_areas)) dt_polygons.append(polygons.points[idx].tolist()) dt_scores.append(itm['score']) dt_gt_match = [] # TODO: methods of match should be optimizied according to LSVT requirements for dt_polygon in dt_polygons: match_flag = False for gt_polygon in gt_polygons: if compute_polygons_iou(dt_polygon, gt_polygon) >= iou_threshold: match_flag = True break dt_gt_match.append(match_flag) dt_gt_match_all.extend(dt_gt_match) dt_scores_all.extend(dt_scores) assert len(dt_gt_match_all) == len(dt_scores_all), "each polygon should have it's score!" # calculate precision, recall and F score under different score threshold dt_gt_match_all = np.array(dt_gt_match_all, dtype=np.bool).astype(np.int) dt_scores_all = np.array(dt_scores_all) # sort according to score sort_idx = np.argsort(dt_scores_all)[::-1] dt_gt_match_all = dt_gt_match_all[sort_idx] dt_scores_all = dt_scores_all[sort_idx] number_positive = np.cumsum(dt_gt_match_all) number_detected = np.arange(1, len(dt_gt_match_all) + 1) Precision = number_positive.astype(np.float) / number_detected.astype(np.float) Recall = number_positive.astype(np.float) / float(gt_polygons_number) F_score = self.calculate_F_score(Precision, Recall) # calculate highest F score idx = np.argmax(F_score) results = dict( F_score=F_score[idx], Precision=Precision[idx], Recall=Recall[idx], score=dt_scores_all[idx], ) # summarize print('---------------------- F1 ---------------------- ') print('Maximum F-score: %f' % results['F_score']) print(' |-- Precision: %f' % results['Precision']) print(' |-- Recall : %f' % results['Recall']) print(' |-- Score : %f' % results['score']) print('------------------------------------------------ ') self.Precision = Precision self.Recall = Recall if __name__ == "__main__": parser = argparse.ArgumentParser(description='mAP evaluation on ICDAR2019') parser.add_argument('--gt-file', default='data/gt.json', type=str, help='annotation | groundtruth file.') parser.add_argument('--dt-file', default='data/dt.json', type=str, help='detection results of coco annotation style.') args = parser.parse_args() # judge file existence if not os.path.exists(args.gt_file): print("File Not Found Error: {}".format(args.gt_file)) exit(404) if not os.path.exists(args.dt_file): print("File Not Found Error: {}".format(args.dt_file)) exit(404) eval_icdar = IcdarEval(args.dt_file, args.gt_file) eval_icdar.eval_map(mode='bbox') eval_icdar.eval_map(mode='segm') eval_icdar.eval_F_by_coco(threshold=0.5, mode='segm') eval_icdar.save_pr_curve() # eval_icdar.eval_F()
python
{"name":"<NAME>","latitude":"51.7764","longitude":"-1.493454","postalCode":"OX28 4GF","country":"gb","addressLines":["Thorney Leys Park","Ducklington","","Witney","Oxfordshire"]}
json
Anthony Davis has bought a new property in the upscale Bel-Aire neighborhood of Los Angeles. The house is reportedly worth $32 million. AD has been a member of the Los Angeles Lakers for 2 years now. The 28-year-old forced a trade to LA in order to team up with LeBron James and win a championship. AD’s dream has since been fulfilled, and he’s followed that up by putting pen to paper on a supermax contract. This new deal could earn him up to $195 million in these 5 seasons, and will enable him to scale up his brand and lifestyle. Davis previously owned a mansion in the Westlake Village locality of Los Angeles. He sold this house for a loss of over $1 million a few months back. The Brow didn’t actually live in that Westlake Village house, preferring to rent in the Bel-Aire locality. And it now seems that the 6’10” forward is making the area his permanent home during his time in Los Angeles. AD’s newest crib has reportedly set him back by a sum of $32 million. It seems the All-Star has financed a $20 million mortgage on the property over a period of 30 years. The house has been built over an area covering 16,700 square feet. It has 8 bedrooms and 8 full bathrooms over the 3.5 acre expanse, and comes with the high ceilings characteristic of villa-style mansions in the area. It also has an Olympic-sized swimming pool and an indoor basketball court. This property was previously owned by entrepreneur Ted Foxman, who bought it for a sum of $16 million in 2016 and spent copious sums of money on renovating it. Its $32 million price point seems to be a result of these renovations.
english
'use strict' const Hapi = require('@hapi/hapi') const server = new Hapi.Server({ host: 'localhost', port: 3000 }) async function start() { server.route([ { method: 'POST', path: '/', handler: (_, h) => { return h.redirect('/new').code(307) } }, { method: 'POST', path: '/new', handler: ({ payload }) => { return { message: 'Received your request including the payload!', payload } } } ]) await server.start() console.log('Server running on %s', server.info.uri); } start()
javascript
{ "name": "rticonnextdds-connector", "version": "1.1.1", "description": "RTI Connector for JavaScript", "main": "rticonnextdds-connector.js", "files": [ "rticonnextdds-connector.js", "rticonnextdds-connector/lib", "examples/nodejs" ], "repository": { "type": "git", "url": "https://github.com/rticommunity/rticonnextdds-connector-js.git" }, "dependencies": { "events": "^3.2.0", "ref-napi": "^3.0.1", "ref-struct-napi": "^1.1.1", "ffi-napi": "^4.0.3", "sleep": "^6.3.0" }, "keywords": [ "rti", "dds", "connext", "connector", "pub", "sub", "pub-sub" ], "author": "Real-Time Innovations, Inc.", "license": "SEE LICENSE IN LICENSE.pdf", "bugs": { "url": "https://github.com/rticommunity/rticonnextdds-connector-js/issues" }, "homepage": "https://github.com/rticommunity/rticonnextdds-connector-js" }
json
[{"id":"1007","provinceId":"16","regencyId":"13","districtId":"01","name":"Muara Rupit"},{"id":"2001","provinceId":"16","regencyId":"13","districtId":"01","name":"Tanjung Beringin"},{"id":"2002","provinceId":"16","regencyId":"13","districtId":"01","name":"Noman"},{"id":"2003","provinceId":"16","regencyId":"13","districtId":"01","name":"Batu Gajah"},{"id":"2004","provinceId":"16","regencyId":"13","districtId":"01","name":"Maur Lama"},{"id":"2005","provinceId":"16","regencyId":"13","districtId":"01","name":"Maur Baru"},{"id":"2006","provinceId":"16","regencyId":"13","districtId":"01","name":"Bingin Rupit"},{"id":"2008","provinceId":"16","regencyId":"13","districtId":"01","name":"Lubuk Rumbai"},{"id":"2009","provinceId":"16","regencyId":"13","districtId":"01","name":"Pantai"},{"id":"2010","provinceId":"16","regencyId":"13","districtId":"01","name":"Lawang Agung"},{"id":"2011","provinceId":"16","regencyId":"13","districtId":"01","name":"Karang Waru"},{"id":"2012","provinceId":"16","regencyId":"13","districtId":"01","name":"Karang Anyar"},{"id":"2013","provinceId":"16","regencyId":"13","districtId":"01","name":"Sungai Jernih"},{"id":"2014","provinceId":"16","regencyId":"13","districtId":"01","name":"Beringin Jaya"},{"id":"2015","provinceId":"16","regencyId":"13","districtId":"01","name":"Lubuk Rumbai Baru"},{"id":"2016","provinceId":"16","regencyId":"13","districtId":"01","name":"Noman Baru"},{"id":"2017","provinceId":"16","regencyId":"13","districtId":"01","name":"Batu Gajah Baru"}]
json
<filename>src/widgets/PopupWidget.ts // @ts-check import debug from "debug"; import Widget, { Params } from "./Widget"; import { domready } from "../utils/domready"; const _log = debug("squatch-js:POPUPwidget"); /** * The PopupWidget is used to display popups (also known as "Modals"). * Popups widgets are rendered on top of other elements in a page. * * To create a PopupWidget use {@link Widgets} * */ export default class PopupWidget extends Widget { triggerElement: HTMLElement | null; triggerWhenCTA: HTMLElement | null; popupdiv: HTMLElement; popupcontent: HTMLElement; constructor(params: Params, trigger = ".squatchpop") { super(params); this.triggerElement /* HTMLButton */ = document.querySelector(trigger); // Trigger is optional if (this.triggerElement) { //@ts-ignore -- we assume this is an element that can have click events this.triggerElement.onclick = () => { this.open(); }; } // If widget is loaded with CTA, look for a 'squatchpop' element to use // that element as a trigger as well. this.triggerWhenCTA = document.querySelector(".squatchpop"); if (trigger === "#cta" && this.triggerWhenCTA) { //@ts-ignore -- we assume this is an element that can have click events this.triggerWhenCTA.onclick = () => { this.open(); }; } this.popupdiv = document.createElement("div"); this.popupdiv.id = "squatchModal"; this.popupdiv.setAttribute( "style", "display: none; position: fixed; z-index: 1; padding-top: 5%; left: 0; top: -2000px; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.4);" ); this.popupcontent = document.createElement("div"); this.popupcontent.setAttribute( "style", "margin: auto; width: 80%; max-width: 500px; position: relative;" ); this.popupdiv.onclick = (event) => { this._clickedOutside(event); }; } load() { this.popupdiv.appendChild(this.popupcontent); document.body.appendChild(this.popupdiv); this.popupcontent.appendChild(this.frame); //@ts-ignore -- will occasionally throw a null pointer exception at runtime const frameDoc = this.frame.contentWindow.document; frameDoc.open(); frameDoc.write(this.content); frameDoc.write( `<script src="${this.npmCdn}/resize-observer-polyfill@1.5.x"></script>` ); frameDoc.close(); _log("Popup template loaded into iframe"); this._setupResizeHandler(); } protected _setupResizeHandler() { const popupdiv = this.popupdiv; const frame = this.frame; const { contentWindow } = frame; if (!contentWindow) { throw new Error("Frame needs a content window"); } const frameDoc = contentWindow.document; // Adjust frame height when size of body changes domready(frameDoc, async () => { frameDoc.body.style.overflowY = "hidden"; popupdiv.style.visibility = "hidden"; popupdiv.style.display = "block"; frame.height = `${frameDoc.body.offsetHeight}px`; // Adjust frame height when size of body changes const ro = new contentWindow["ResizeObserver"]((entries) => { for (const entry of entries) { const { top, bottom } = entry.contentRect; const computedHeight = bottom + top; frame.height = computedHeight + ""; // Don't let anything else set the height of this element entry.target.style = ``; if (window.innerHeight > Number(frame.height)) { popupdiv.style.paddingTop = `${ (window.innerHeight - Number(frame.height)) / 2 }px`; } else { popupdiv.style.paddingTop = "5px"; } } }); ro.observe(await this._findInnerContainer()); }); } open() { const popupdiv = this.popupdiv; const frame = this.frame; const { contentWindow } = frame; if (!contentWindow) throw new Error("Squatch.js has an empty iframe"); const frameDoc = contentWindow.document; // Adjust frame height when size of body changes domready(frameDoc, () => { const _sqh = contentWindow.squatch || contentWindow.widgetIdent; const ctaElement = frameDoc.getElementById("cta"); if (ctaElement) { //@ts-ignore -- will occasionally throw a null pointer exception at runtime ctaElement.parentNode.removeChild(ctaElement); } popupdiv.style.visibility = "visible"; popupdiv.style.top = "0px"; this._loadEvent(_sqh); _log("Popup opened"); }); } close() { this.popupdiv.style.visibility = "hidden"; this.popupdiv.style.top = "-2000px"; _log("Popup closed"); } protected _clickedOutside({ target }) { if (target === this.popupdiv) { this.close(); } } protected _error(rs, mode = "modal", style = "") { const _style = "body { margin: 0; } .modal { box-shadow: none; border: 0; }"; return super._error(rs, mode, style || _style); } }
typescript
Show Us Yours: Tony's amazing custom-built media room is one of the most impressive we've ever seen. From Runco projector to Kaleidescape server to LED backlit bar top, it's the stuff dreams are made of. As part of a new home construction started four years ago, Tony built a dedicated theater that was finally finished in March of 2017. The following slideshow shows its evolution from a near bare room to what it is today: high-end home theater greatness. This was not a DIY project. Cinema Design Group, International (CDGi), from Boca Raton, Florida, designed and built the theater. Atlantic Smart Technologies, from Jupiter, Florida, integrated the electronics and programmed the automation. Jason Dustal and Joel Silver from the Imaging Science Foundation (ISF) calibrated the projector. Enjoy the buildup. Click here to see more Show Us Yours home-theater showcases. We'll start with the "before" images. Tony's temporary home theater was in place before the real home theater went in. For a lot of people, this would be a pretty decent set-up. View to the room from the hallway. Construction begins. The air vents and outlet covers get the blackout treatment. Dolby Atmos has a separate "height" channel. The ceiling is a great place for those speakers. The ceiling before they painted it black. Rear surround speakers and bare, unpainted doors. Side surrounds. Door leading into the room painted black along with the ceiling. Now it's time to build out the frame for the projector screen. Acoustic paneling is up. The panels help dampen sound from outside the room as well as soften echos inside it. Slowly coming together. Projector is mounted. Screen is up. This is a Stewart VistaScope 120 screen with electric masking. The theater is configured for 7.4.2 Dolby Atmos and uses Paradigm Signature speakers: S8 (x2) for front, C5 for the center, ADP3 (x4) for side and rear surrounds, and Sig-1.5R (x4) for in-ceiling Atmos. JL Audio e112 subwoofers (x2) provide the bass. And here's the finished product! Front row seating: Two leather recliners in the center and two leather chaise lounges on the ends. Front screen wall conceals speakers and storage. The front screen wall with doors open. Tony says: "The game consoles and power conditioner are kept in-room for gaming convenience. Center storage has a slide-out rack for gaming sensors and slide-out drawer for miscellaneous storage. Xbox One Elite, Wii U, and Nintendo Switch consoles are installed." Close-up of the white onyx bar top with backlight full-range RGB LED backlighting. LEDs on blue bar top and white columns. In this mode, the bar top slowly progresses through entire color spectrum. Close-up the Runco D-73d dual LED 3D projector with Shasta motorized anamorphic lens sled. The equipment racks are located in a separate room to ensure the theater room stays quiet. Equipment in top of rack: Cable DVR, Dish Hopper 3 satellite receiver, Bryston 2BSST (x2) 2-channel amps for in-ceiling Dolby Atmos speakers, Pakedge router and switches (x3), Runco video processors, Savant audio distribution/HDMI matrix/control modules (x4)/host controller, SurgeX UPS (x2) and surge protectors (x2), Autonomic Mirage MMS-2A media server, Kaleidescape M500 player/M700 disk vault/3U server. Equipment rack (bottom): Pioneer Elite receiver for Great Room surround sound, Krell Foundation processor for theater, Bryston 2BSST provides two channels of amplification for theater rear surrounds, Bryston 9BSST provides five channels of amplification for theater front/center/side surrounds, Sonance two-channel sub amplifier for Great Room subwoofers, Architect 16-channel amplifier for whole-house audio. Dual LaunchPort charging stations keep the theater's iPad Pro charged at all times. One charger is on the bar top, and the second is installed between the front row recliners. Screen in 2.35:1 anamorphic with Kaleidescape source and bar top in blue. Tony says: "Stand-up bar serves as second row of seating and negates need for building a riser." Also pictured is a Savant Pro remote that controls the house Savant and Lutron Homeworks QS automation systems. Rear view from other side. Tony says: "LEDs in 'Sith mode!'" Lutron keypad with theater presets. Savant Pro remote. Let's take a closer look at the gear in Tony's rack. Here's SurgeX UPS and surge protection. Pakedge networking. Autonomic two-source audio server. Kaleidescape 3U server (cover down) with 18TB storage. Pioneer Elite receiver and Sonance subwoofer amp (for great room). Savant audio distribution. Architect 16-channel amp for whole-house audio. Cable DVR and Dish Hopper 3. Savant host controller. Krell Foundation processor and Bryston five-channel and two-channel amps. Controller for Runco D-73d projector. Kaleidescape 3U server. Savant HDMI matrix switch. Kaleidescape M500 player and M700 disk vault. Runco controllers and Bryston two-channel amp for Atmos ceiling speakers. That's it! If you like what you saw, feel free to kick back and enjoy other CNET readers' home theaters.
english
<reponame>rrsharma7/Interview_Preparations<filename>CodePractice/BasicOfJava/Test45.java package test; import java.util.Arrays; public class Test45 { public String largestNumber(final int[] A) { String str[] = new String[A.length]; for (int i = 0; i < A.length; i++) { str[i] = Integer.toString(A[i]); } Arrays.sort(str, (a, b) -> (b + a).compareTo(a + b)); String s = ""; if (str[0].equals("0")) return "0"; for (int i = 0; i < A.length; i++) s += str[i]; return s; } public static void main(String[] args) { Test45 test45 = new Test45(); int a[] = { 3, 30, 34, 5, 9}; test45.largestNumber(a); } }
java
The Royal Challengers Bangalore (RCB) faced off against the Delhi Capitals (DC) in Match 19 of the 13th edition of the Indian Premier League (IPL 2020) in Dubai. RCB captain Virat Kohli won the toss and elected to field first, and rung in a couple of changes for this game - Moeen Ali in place of Gurkeerat Singh and Mohammed Siraj in place of Adam Zampa. DC, on the other hand, were forced to bring in Axar Patel in place of the injured Amit Mishra, who has been ruled out of the tournament. DC got off to a flying start, with Prithvi Shaw and Shikhar Dhawan finding the boundary at will in the powerplay. The former in particular launched attacks on Isuru Udana and Navdeep Saini, and DC were beautifully placed at 63/0 after 6 overs. The introduction of Mohammed Siraj caused Shaw to glove one to AB de Villiers behind the stumps, while both Dhawan and Shreyas Iyer struggled to get going. After both batsmen were dismissed, Rishabh Pant and Marcus Stoinis played match-defining cameos to take their team to an above-par score of 196/4. In response, Aaron Finch struggled - he was dropped twice before finally edging one to the keeper. Devdutt Padikkal's struggle with off-spinners continued as he holed out in the deep off Ravichandran Ashwin, while AB de Villiers flattered to deceive. Virat Kohli scored a forty to continue his good form, but wasn't able to accelerate when the required run rate soared beyond reach. Moeen Ali, Shivam Dube and Washington Sundar all came and went, with DC's star performers with the ball being Kagiso Rabada, Anrich Nortje and Axar Patel. DC coasted to a convincing 59-run win over RCB in Match 19 of IPL 2020. IPL 2020, RCB vs DC: Who won the Man of the Match award yesterday? Despite excellent performances from Kagiso Rabada and Marcus Stoinis, all-rounder Axar Patel was adjudged the Man of the Match in the RCB vs DC IPL 2020 game. With figures of 4-0-18-2, the left-arm spinner was once again the most economical DC bowler on display, and picked up the wickets of Aaron Finch and Moeen Ali. Axar was dropped for the previous game when Ravichandran Ashwin returned, but he was afforded another chance due to Amit Mishra's IPL 2020-ending injury. The 26-year-old's performances - both in the powerplay and in the middle overs - have been a major boost for DC in IPL 2020, and they will hope that he is able to carry his form through the tournament.
english
I am signing this petition because like many others I have had family affected by these clinics. These clinics like the methadone ones do not watch these people when they administer medication. My sister was hooked on this for many years. Her dosage was so high that she would pass out where she stood. These clinics require a lock box to take meds home but sadly alot of these people who get this are also selling them on the streets and keeping enough to be in their system the next go around. I do not believe that this is needed in out town. This is not helping out opioid crisis but contributing to the legal way of getting and dealing drugs.
english
The first thing taught in all journalism schools is the importance of the 5W and 1H. Any event, occurrence, and news should be analyzed and studied under these criteria. It means finding the answers to What, When, Why, Who, Where, and How. A journalist is not a mediator of news or events. You do not present information as it comes. You have to find out the Why behind all. Always be on the run to find answers to your queries, unanswered questions, and the reason behind all occurrences. And you have to be inquisitive to find out new things, discover and research. An idle journalist is of significantly no value to either himself, the organization, or the nation. Courage is synonymous with this profession. Do you have the guts to question the authorities, the government, the hierarchy? Can you stand up for the right? Can you present all news, no matter how ugly or against the ruling class it is? Are you scared of influence, of the mafia, of the authorities? If your answer supports fearlessness, and the risk to life and career does not daunt you, only then should you get into this field. Truth is bitter and always up in arms against the wrong. Accept this fact and then decide what it is that you want to do. Keen observations skills help in identifying even the minutest details that can make you a good journalist. Observation on your part is important to create news items, features, and stories. Excellent written and oral communication skills are essential in this field. You have to converse, conduct interviews, extract answers from people on the streets as well as high officials, also from witnesses, criminals, and every individual who can provide information. As important as the ability to talk, so is the ability to listen. An effective listener grasps information that is missed by others. You need an empathetic ear. Hard work, long hours, different locales; you have to be prepared for all if you want to jump into this profession. You have to be willing to work irregular hours against tight deadlines, and in a highly competitive environment. And persistently follow your goal. You should have an individualistic point of view that is not influenced by others’ actions speech or beliefs. But again, your point of view belongs to you, so when you are dealing with people or disseminating information, you have to be objective. The valuation of the newsworthiness of information depends on your impartial outlook. A thin almost invisible line separates objectivity from partiality. Take the initiative. Be the first to air the news, the first to document a cause or event, and the first to support and speak against. Take the initiative and the rest will follow you. The strength to work under odds, to face the consequences of your action and belief, and to keep afloat when all around you is sinking.
english
<filename>sri/asynquence-contrib/0.1.1-a.json {"contrib.js":"sha256-s54Th3oPpJJUL3GiKuttmyGDbsge11e2YEEwAHE7qDQ=","contrib.src.js":"sha256-w3w0SnCSK63LovDgp/8ejiw6ETt3NnBocCWq2+40NRY="}
json
/* Adding support for language written in a Right To Left (RTL). @package wordpress-boilerplate @since 1.0.0 @link https://codex.wordpress.org/Right_to_Left_Language_Support */ body { direction: rtl; unicode-bidi: embed; }
css
BEN-W vs KAR-W Dream11 Prediction, Fantasy Cricket Tips, Dream11 Team, Playing XI, Pitch Report, Injury Update of Indian Women’s Domestic T20 Trophy match between Bengal Women and Karnataka Women. BEN-W vs KAR-W Indian Women’s Domestic T20 Trophy Match 98 Details: For all the Dream11 Tips and Fantasy Cricket Live Updates, follow us on Cricketaddictor Telegram Channel. This game is scheduled to start at 1:30 PM IST and live score and commentary can be seen on FanCode and CricketAddictor website. BEN-W vs KAR-W Indian Women’s Domestic T20 Trophy Match 98 Preview: The Indian Women’s Domestic T20 Trophy will see its ninety-eighth match of this season between Bengal Women and Karnataka Women. This game will see the battle between two teams of Group B of this season of the Indian Domestic T20 Trophy. Bengal Women will be squaring off against Karnataka Women for the first time in the ninety-eighth match of this season of the Indian Women’s Domestic T20 Trophy. Bengal Women is currently placed at the top of points table of this season of the Indian Women’s Domestic T20 Trophy whereas Karnataka Women is currently placed at the second spot on the points table. Bengal Women played five matches in this season of the Indian Domestic T20 Trophy where they won all of those matches while Karnataka Women also played five matches in this season where they won four games. BEN-W vs KAR-W Head-to-Head Record: BEN-W vs KAR-W Indian Women’s Domestic T20 Trophy Match 98 Weather Report: BEN-W vs KAR-W Indian Women’s Domestic T20 Trophy Match 98 Pitch Report: The pitch at the Gujarat State Fertilizer Corp Ground delivers a neutral wicket, with little assistance on offer for both departments during the course of the game. Batters will need to spend quality time. Pacers will also look to exact decent help from the track. Spinners will dominate in the middle overs. Average 1st innings score: Record of chasing teams: BEN-W vs KAR-W Indian Women’s Domestic T20 Trophy Match 98 Injury Update: (Will be added when there is an update) BEN-W vs KAR-W Indian Women’s Domestic T20 Trophy Match 98 Probable XIs: BEN-W vs KAR-W Dream11 Fantasy Cricket Players Stats: |Players Stats (last match) Hot Picks for BEN-W vs KAR-W Dream11 Prediction and Fantasy Cricket Tips: Captaincy Picks: Dhara Gujjar is a left-handed batter from Bengal Women. She marked 9 runs in the last game. Deepti Sharma left-handed batter and right-arm off-break bowler from Bengal Women. She hammered 50 runs in the last match. Top Picks: Richa Ghosh is a right-handed batter from Bengal Women. She smashed 18 runs in the last game. Shreyanka Patil is a right-handed batter and right-arm off-break bowler from Karnataka Women. She smacked 25 runs and took 1 wicket in the last match. Budget Picks: Mita Paul is a right-handed batter and right-arm off-break bowler from Bengal Women. Prathyusha Challuru is a right-handed batter and right-arm leg-break bowler from Karnataka Women. BEN-W vs KAR-W Indian Women’s Domestic T20 Trophy Match 98 Captain and Vice-captain Choices: Suggested Playing XI No. 1 (Small Leagues and Head-to-Head) for BEN-W vs KAR-W Dream11 Prediction Today Match and Dream11 Team: Suggested Playing XI No. 2 (Grand Leagues) for BEN-W vs KAR-W Dream11 Prediction Today Match and Dream11 Team: Keeper – Richa Ghosh (vc) BEN-W vs KAR-W Dream11 Prediction Today Match Indian Women’s Domestic T20 Trophy Match 98 Players to Avoid: Priyanka Bala and Roshni Kumar are the players that can be avoided for this game. BEN-W vs KAR-W Dream11 Prediction Today Match Indian Women’s Domestic T20 Trophy Match 98 Expert Advice: BEN-W vs KAR-W Dream11 Prediction Today Match Indian Women’s Domestic T20 Trophy Match 98 Probable Winners: Bengal Women are expected to win this match. Disclaimer: This team is based on the understanding, analysis, and instinct of the author. While selecting your team, consider the points mentioned and make your own decision.
english
/******************************************************************************/ // // CSTM3DLG.CPP - Line parameters page for the TSP Wizard // // Copyright (C) 1998 <NAME>, JulMar Entertainment Technology, Inc. // All rights reserved // For internal use only // /******************************************************************************/ /*---------------------------------------------------------------------------*/ // INCLUDE FILES /*---------------------------------------------------------------------------*/ #include "stdafx.h" #include "tspwizard.h" #include "SecureProps.h" #include "TSPWizardaw.h" /*---------------------------------------------------------------------------*/ // DEBUG STATEMENTS /*---------------------------------------------------------------------------*/ #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif /*---------------------------------------------------------------------------*/ // RTTI /*---------------------------------------------------------------------------*/ IMPLEMENT_DYNCREATE(CSecureProps, CDialog) /*---------------------------------------------------------------------------*/ // MESSAGE MAP /*---------------------------------------------------------------------------*/ BEGIN_MESSAGE_MAP(CSecureProps, CDialog) //{{AFX_MSG_MAP(CSecureProps) //}}AFX_MSG_MAP END_MESSAGE_MAP() /////////////////////////////////////////////////////////////////////////// // CSecureProps::CSecureProps // // Constructor for the security page // CSecureProps::CSecureProps() : CDialog(CSecureProps::IDD, NULL) { //{{AFX_DATA_INIT(CSecureProps) m_fSecure = FALSE; //}}AFX_DATA_INIT }// CSecureProps::CSecureProps /////////////////////////////////////////////////////////////////////////// // CSecureProps::DoDataExchange // // Dialog data exchange for the dialog // void CSecureProps::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CSecureProps) DDX_Check(pDX, IDC_SECURE, m_fSecure); //}}AFX_DATA_MAP }// CSecureProps::DoDataExchange ///////////////////////////////////////////////////////////////////////////// // CSecureProps::OnOK // // Dismiss the dialog // void CSecureProps::OnOK() { UpdateData(TRUE); TSPWizardaw.m_Dictionary["SECURE_ONCREATE"] = (m_fSecure) ? "Yes" : "No"; CDialog::OnOK(); }// CSecureProps::OnOK
cpp
<filename>common/abr_hls_dash.py<gh_stars>10-100 #!/usr/bin/python3 from os import mkdir import time import threading import subprocess import multiprocessing import json z_renditions_sample=( # resolution bitrate(kbps) audio-rate(kbps) # [426, 240, 400000, 64000], [640, 360, 800000, 128000], [842, 480, 1400000, 128000], [1280, 720, 2800000, 192000], [1920, 1080, 5000000, 192000], [2560, 1440, 10000000, 192000], [3840, 2160, 14000000, 192000] ) renditions_sample=( # resolution bitrate(kbps) audio-rate(kbps) [3840, 2160, 14000000, 192000], [2560, 1440, 10000000, 192000], [1920, 1080, 5000000, 192000], [1280, 720, 2800000, 192000], [842, 480, 1400000, 128000], [640, 360, 800000, 128000] ) def to_kps(bitrate): return str(int(bitrate/1000))+"k" def check_renditions(frame_height, renditions=renditions_sample): min_res = [640, 360, 800000, 128000] for item in renditions: height = item[1] if frame_height >= height: return item return min_res def GetABRCommand(in_file, target, streaming_type, renditions=renditions_sample, duration=2,segment_num=0,fade_type=None,content_type=None): ffprobe_cmd = ["ffprobe", "-v", "quiet", "-print_format", "json", "-show_streams",in_file] process_id = subprocess.Popen(ffprobe_cmd,stdout=subprocess.PIPE) # the `multiprocessing.Process` process will wait until # the call to the `subprocess.Popen` object is completed process_id.wait() clip_info = json.loads(process_id.stdout.read().decode("utf-8")) #print(clip_info) keyframe_interval = 0 frame_width = 0 frame_height = 0 clip_codec = 0 clip_v_duration = 0 clip_a_duration = 0 segment_target_duration=duration # try to create a new segment every X seconds max_bitrate_ratio=1.07 # maximum accepted bitrate fluctuations rate_monitor_buffer_ratio=1.5 # maximum buffer size between bitrate conformance checks for item in clip_info["streams"]: if item["codec_type"] == "video": keyframe_interval = int(eval(item["avg_frame_rate"])+0.5) frame_width = item["width"] frame_height = item["height"] clip_codec = item["codec_name"] clip_v_duration = eval(item["duration"]) if item["codec_type"] == "audio": clip_a_duration = eval(item["duration"]) if segment_num != 0: segment_duration=(int)((clip_v_duration+2.0)/segment_num) if segment_duration < segment_target_duration: segment_target_duration = segment_duration cmd = [] cmd_abr = [] cmd_base = ["ffmpeg", "-hide_banner", "-y","-i", in_file] if clip_a_duration == 0 and content_type == "ad": cmd_base += ["-f", "lavfi", "-i", "anullsrc=channel_layout=stereo:sample_rate="+str(44100)] cmd_misc = ["-hide_banner", "-y"] cmd_static = ["-c:v", "libx264", "-profile:v", "main", "-sc_threshold", "0", "-strict", "-2"] cmd_static += ["-g", str(keyframe_interval), "-keyint_min", str(keyframe_interval)] if clip_a_duration == 0 and content_type == "ad": cmd_static += ["-shortest", "-c:a", "aac", "-ar", "48000"] cmd_dash = ["-use_timeline", "1", "-use_template", "1","-seg_duration",str(segment_target_duration)] cmd_hls = ["-hls_time", str(segment_target_duration), "-hls_list_size", "0","-hls_allow_cache", "0"] cmd_fade_in_out = [] # handle the audio duration if fade_type == "audio" and clip_a_duration > 0: fade_duration = 1 a_st = (int)(clip_a_duration - fade_duration) cmd_fade_in_out = ["-af", "afade=in:st="+str(0)+":"+"d="+str(fade_duration)+","+"afade=out:st="+str(a_st)+":"+"d="+str(fade_duration)] master_playlist="#EXTM3U" + "\n" + "#EXT-X-VERSION:3" +"\n" + "#" + "\n" count = 0 default_threshold = 4 for item in renditions: width = item[0] height = item[1] v_bitrate = to_kps(item[2]) a_bitrate = to_kps(item[3]) maxrate = to_kps(item[2] * max_bitrate_ratio) bufsize = to_kps(item[2] * rate_monitor_buffer_ratio) name = str(height) + "p" if frame_height < height and content_type == "ad": item = check_renditions(frame_height) width = item[0] height = item[1] v_bitrate = to_kps(item[2]) a_bitrate = to_kps(item[3]) maxrate = to_kps(item[2] * max_bitrate_ratio) bufsize = to_kps(item[2] * rate_monitor_buffer_ratio) elif frame_height < height: continue cmd_1 = [] cmd_2 = [] cmd_3 = [] cmd_4 = [] if streaming_type == "hls": cmd_1 = ["-vf", "scale=w="+str(width)+":"+"h="+str(height)+":"+"force_original_aspect_ratio=decrease"+","+ "pad=w="+str(width)+":"+"h="+str(height)+":"+"x=(ow-iw)/2"+":"+"y=(oh-ih)/2"] cmd_2 = ["-b:v", v_bitrate, "-maxrate", maxrate, "-bufsize", bufsize, "-b:a", a_bitrate] cmd_3 = ["-f", streaming_type] cmd_4 = ["-hls_segment_filename", target+"/"+name+"_"+"%03d.ts", target+"/"+name+".m3u8"] master_playlist += "#EXT-X-STREAM-INF:BANDWIDTH="+str(item[2])+","+"RESOLUTION="+str(width)+"x"+str(height)+"\n"+name+".m3u8"+"\n" cmd_abr += cmd_static + cmd_1 + cmd_2 + cmd_fade_in_out + cmd_3 + cmd_hls + cmd_4 if streaming_type == "dash": cmd_1 = ["-map","0:v","-b:v"+":"+str(count), v_bitrate, "-s:v"+":"+str(count), str(width)+"x"+str(height), "-maxrate"+":"+str(count), maxrate, "-bufsize"+":"+str(count), bufsize] cmd_2 = ["-map","0:a","-b:a"+":"+str(count), a_bitrate] cmd_3 = ["-f",streaming_type] cmd_4 = ["-init_seg_name", name+"-init-stream$RepresentationID$.m4s", "-media_seg_name", name+"-chunk-stream$RepresentationID$-$Number%05d$.m4s", "-y", target+"/"+name+".mpd"] if clip_a_duration == 0: cmd_1 = ["-map","0:v","-b:v"+":"+str(count), v_bitrate, "-s:v"+":"+str(count), str(width)+"x"+str(height), "-maxrate"+":"+str(count), maxrate, "-bufsize"+":"+str(count), bufsize] cmd_2 = [] if content_type == "ad": cmd_1 = ["-vf", "scale=w="+str(width)+":"+"h="+str(height)+":"+"force_original_aspect_ratio=decrease"+","+ "pad=w="+str(width)+":"+"h="+str(height)+":"+"x=(ow-iw)/2"+":"+"y=(oh-ih)/2"] cmd_2 = ["-b:v", v_bitrate, "-maxrate", maxrate, "-bufsize", bufsize, "-b:a", a_bitrate] cmd_abr += cmd_static + cmd_1 + cmd_2 + cmd_3 + cmd_dash + cmd_4 else: cmd_abr += cmd_1 + cmd_2 count += 1 if default_threshold < count: break if streaming_type == "hls": cmd = cmd_base + cmd_abr elif streaming_type == "dash" and content_type == "ad": cmd = cmd_base + cmd_abr elif streaming_type == "dash": cmd = cmd_base + cmd_static + cmd_abr +["-f", "dash"] + cmd_dash + ["-y", target+"/"+"index.mpd"] #generate master m3u8 file if streaming_type == "hls": with open(target+"/"+"index.m3u8", "w", encoding='utf-8') as f: f.write(master_playlist) return cmd def GetFadeCommand(in_file, target, fade_type): # ffprobe -v quiet -print_format json -show_streams ffprobe_cmd = ["ffprobe", "-v", "quiet", "-print_format", "json", "-show_streams",in_file] process_id = subprocess.Popen(ffprobe_cmd,stdout=subprocess.PIPE) # the `multiprocessing.Process` process will wait until # the call to the `subprocess.Popen` object is completed process_id.wait() clip_info = json.loads(process_id.stdout.read().decode("utf-8")) #print(clip_info) clip_a_duration = 0 for item in clip_info["streams"]: if item["codec_type"] == "audio": clip_a_duration = eval(item["duration"]) if clip_a_duration == 0: return None duration = 1 a_st = 0 if fade_type == "in" and clip_a_duration > duration: a_st = (int)(clip_a_duration - duration) cmd = [] cmd_base = ["ffmpeg", "-i", in_file] cmd_fade_in_out = ["-af", "afade="+fade_type+":"+"st="+str(a_st)+":"+"d="+str(duration), "-c:v", "copy"] cmd = cmd_base + cmd_fade_in_out return cmd
python
THE youngest challenger in the fray, Peter Leko was the world's youngest Grandmaster in 1994 at the age of 14 years, four months and 22 days. He has come a long way since then. He was within a draw of taking the World `Classical' title from Vladimir Kramnik at Brissago last year but lost the final encounter of their 14-game match. The 7-7 deadlock saw Kramnik retain the title he snatched from Kasparov in 2000. The Hungarian, known for his hunger for success, wasted no time in despair and won the Corus title in January 2005 after inflicting a rare defeat on Anand, the eventual runner-up. The title also made Leko the only player in the last three years to complete a career `Grand Slam' by winning at Dortmund (in 2002), Linares (in 2003) and Wijk aan Zee (in 2005). Known for his preparation and physical fitness, Leko is extremely creative and solid at the same time. Though he could not show any great form in Dortmund this year, Leko enjoys the reputation of someone who loves challenges. He gets criticised for taking too many draws but none can question his liking for deep tactical complications.
english
<gh_stars>0 var fs = require("fs"); var version = require("../package.json").version; //update languages list var langs_lister = require("./../src/outputs/lang/langs_lister"); //update options keys list var options_lister = require("../src/Options/options_lister"); //update templates list var template_lister = require("../src/arrange/html_page/templates_list/templates_lister"); //edit OPTIONS.md var options_tmp = fs.readFileSync(__dirname+"/template/OPTIONS.md","UTF-8"); options_tmp = require("./template/templateListUpdater")(options_tmp); options_tmp = require("./template/langslistUpdater")(options_tmp); //write down fs.writeFileSync(__dirname+"/../OPTIONS.md",options_tmp,{encoding:"UTF-8",flags:"w"});
javascript
import pymongo from conf import Configuracoes class Mongo_Database: """ Singleton com a conexao com o MongoDB """ _instancia = None def __new__(cls, *args, **kwargs): if not(cls._instancia): cls._instancia = super(Mongo_Database, cls).__new__(cls, *args, **kwargs) return cls._instancia def __init__(self,): #pega a string de conexao no arquivo de configuracao string_conexao = Configuracoes().get_config("database", "string_connection") assert (string_conexao != ""), "String de conexao indefinida" try: self.mongo_client = pymongo.MongoClient(string_conexao) self.collection_filmes = self.mongo_client["popcorn_time"]["filmes"] self.collection_tweets = self.mongo_client["twitter_log"]["tweets"] except: raise Exception("Nao foi possivel se conectar ao B.D.") print("Conectado a", string_conexao) def grava_filmes(self, lista_filmes): #verifica se o filme ja existe #se nao existir, grava e adiciona a lista de novos filmes novos = [] try: for filme in lista_filmes: if (self.collection_filmes.count_documents({"_id": filme["_id"]}) == 0): self.collection_filmes.insert_one(filme) novos.append(filme) finally: return novos def grava_tweet(self, tweet_info): #grava o retorno dos tweets self.collection_tweets.insert_one(tweet_info)
python