text stringlengths 1 1.04M | language stringclasses 25 values |
|---|---|
[{"name": "Capital goods", "path": "Capital goods", "value": 4546755.34}, {"name": "Consumer goods", "path": "Consumer goods", "value": 2081188.66}, {"name": "Intermediate goods", "path": "Intermediate goods", "value": 1647574.1}, {"name": "<NAME>", "path": "Mach and Elec", "value": 4375451.3}, {"name": "Metals", "path": "Metals", "value": 683645.79}, {"name": "Miscellaneous", "path": "Miscellaneous", "value": 274505.95}, {"name": "Plastic or Rubber", "path": "Plastic or Rubber", "value": 264314.46}] | json |
public interface Strategy {
//策略接口
}
| java |
<gh_stars>1-10
import { filterHash, mapHash } from '../util/object'
import { EventDef } from '../structs/event-def'
import { EventInstance, EventInstanceHash } from '../structs/event-instance'
import { EventInput } from '../structs/event-parse'
import {
EventStore,
mergeEventStores,
createEmptyEventStore,
filterEventStoreDefs,
excludeSubEventStore,
parseEvents
} from '../structs/event-store'
import { Action } from './Action'
import { EventSourceHash, EventSource } from '../structs/event-source'
import { DateRange } from '../datelib/date-range'
import { DateProfile } from '../DateProfileGenerator'
import { DateEnv } from '../datelib/env'
import { CalendarContext } from '../CalendarContext'
import { expandRecurring } from '../structs/recurring-event'
export function reduceEventStore(eventStore: EventStore, action: Action, eventSources: EventSourceHash, dateProfile: DateProfile, context: CalendarContext): EventStore {
switch (action.type) {
case 'RECEIVE_EVENTS': // raw
return receiveRawEvents(
eventStore,
eventSources[action.sourceId],
action.fetchId,
action.fetchRange,
action.rawEvents,
context
)
case 'ADD_EVENTS': // already parsed, but not expanded
return addEvent(
eventStore,
action.eventStore, // new ones
dateProfile ? dateProfile.activeRange : null,
context
)
case 'MERGE_EVENTS': // already parsed and expanded
return mergeEventStores(eventStore, action.eventStore)
case 'PREV': // TODO: how do we track all actions that affect dateProfile :(
case 'NEXT':
case 'CHANGE_DATE':
case 'CHANGE_VIEW_TYPE':
if (dateProfile) {
return expandRecurring(eventStore, dateProfile.activeRange, context)
} else {
return eventStore
}
case 'REMOVE_EVENTS':
return excludeSubEventStore(eventStore, action.eventStore)
case 'REMOVE_EVENT_SOURCE':
return excludeEventsBySourceId(eventStore, action.sourceId)
case 'REMOVE_ALL_EVENT_SOURCES':
return filterEventStoreDefs(eventStore, function(eventDef: EventDef) {
return !eventDef.sourceId // only keep events with no source id
})
case 'REMOVE_ALL_EVENTS':
return createEmptyEventStore()
default:
return eventStore
}
}
function receiveRawEvents(
eventStore: EventStore,
eventSource: EventSource<any>,
fetchId: string,
fetchRange: DateRange | null,
rawEvents: EventInput[],
context: CalendarContext
): EventStore {
if (
eventSource && // not already removed
fetchId === eventSource.latestFetchId // TODO: wish this logic was always in event-sources
) {
let subset = parseEvents(
transformRawEvents(rawEvents, eventSource, context),
eventSource,
context
)
if (fetchRange) {
subset = expandRecurring(subset, fetchRange, context)
}
return mergeEventStores(
excludeEventsBySourceId(eventStore, eventSource.sourceId),
subset
)
}
return eventStore
}
function transformRawEvents(rawEvents, eventSource: EventSource<any>, context: CalendarContext) {
let calEachTransform = context.options.eventDataTransform
let sourceEachTransform = eventSource ? eventSource.eventDataTransform : null
if (sourceEachTransform) {
rawEvents = transformEachRawEvent(rawEvents, sourceEachTransform)
}
if (calEachTransform) {
rawEvents = transformEachRawEvent(rawEvents, calEachTransform)
}
return rawEvents
}
function transformEachRawEvent(rawEvents, func) {
let refinedEvents
if (!func) {
refinedEvents = rawEvents
} else {
refinedEvents = []
for (let rawEvent of rawEvents) {
let refinedEvent = func(rawEvent)
if (refinedEvent) {
refinedEvents.push(refinedEvent)
} else if (refinedEvent == null) {
refinedEvents.push(rawEvent)
} // if a different falsy value, do nothing
}
}
return refinedEvents
}
function addEvent(eventStore: EventStore, subset: EventStore, expandRange: DateRange | null, context: CalendarContext): EventStore {
if (expandRange) {
subset = expandRecurring(subset, expandRange, context)
}
return mergeEventStores(eventStore, subset)
}
export function rezoneEventStoreDates(eventStore: EventStore, oldDateEnv: DateEnv, newDateEnv: DateEnv): EventStore {
let defs = eventStore.defs
let instances = mapHash(eventStore.instances, function(instance: EventInstance): EventInstance {
let def = defs[instance.defId]
if (def.allDay || def.recurringDef) {
return instance // isn't dependent on timezone
} else {
return {
...instance,
range: {
start: newDateEnv.createMarker(oldDateEnv.toDate(instance.range.start, instance.forcedStartTzo)),
end: newDateEnv.createMarker(oldDateEnv.toDate(instance.range.end, instance.forcedEndTzo))
},
forcedStartTzo: newDateEnv.canComputeOffset ? null : instance.forcedStartTzo,
forcedEndTzo: newDateEnv.canComputeOffset ? null : instance.forcedEndTzo
}
}
})
return { defs, instances }
}
function excludeEventsBySourceId(eventStore: EventStore, sourceId: string) {
return filterEventStoreDefs(eventStore, function(eventDef: EventDef) {
return eventDef.sourceId !== sourceId
})
}
// QUESTION: why not just return instances? do a general object-property-exclusion util
export function excludeInstances(eventStore: EventStore, removals: EventInstanceHash): EventStore {
return {
defs: eventStore.defs,
instances: filterHash(eventStore.instances, function(instance: EventInstance) {
return !removals[instance.instanceId]
})
}
}
| typescript |
Director Ali Abbas Zafar's Tiger Zinda Hai featuring Salman Khan and Katrina Kaif released last year around the Christmas season. Tiger Zinda Hai did marvelous business in more than 40 days of its run at the worldwide box office. Tiger Zinda Hai is a sequel to Ek Tha Tiger which was released in 2012.
Tiger Zinda Hai has beaten the lifetime collections of its prequel and went on to become the blockbuster hit of 2017. Within days of its release, Tiger Zinda Hai joined all the elite clubs of Rs 50,100,200 and 300 Crore clubs.
It could still run successfully at the domestic box office but for the release of Deepika's Padmavaat and Akshay Kumar's Pad Man which took over theatres. Salman Khan's Tiger Zinda Hai's lifetime collections is said to be around Rs 340 cr approximately. Exact figures are yet to be known.
Salman and Katrina were overwhelmed by the response they received from their fans, critics, celebrities and wellwishers. To continue the same momentum, Salman Khan has signed another film with Ali Abbas Zafar titled Bharat which is scheduled to release this year on Eid.
On the professional front, Salman Khan is currently busy filming Race -3 while Katrina will be next seen in Shah Rukh Khan's Zero which also features Anushka Sharma. | english |
British Telecommunications suffers a blow in its bid to charge royalties for hyperlinks when a New York judge hearing a case brought against Prodigy Communications issues a ruling.
In what is known as a Markman ruling, U.S. District Judge Colleen McMahon said many of BT's claims that its patent closely mirrors methods common to the Internet were not valid. The Markman ruling is the phase of the trial that is concerned primarily with putting the words of the patent claim into plain English.
The two parties now have 30 days to file motions for a summary judgment, and if the case is not dismissed after that a full trial will begin in September.
British Telecom's suit against Prodigy is a test case, and if BT wins it is likely to pursue other Internet Service Providers (ISPs) for license fees. Before the case went to court, BT had contacted Prodigy and 16 other ISPs, including America Online, in June 2000, asking them to buy a hyperlink license. BT has not indicated what it would charge, but any costs would likely be passed on to business and consumers who have Web sites.
David Weaver of Houston-based law firm Vinson & Elkins, who acted on behalf of Prodigy, said that although his client is likely to push for summary dismissal, a decision has not yet been made.
But the Markman ruling, said Weaver, weighs heavily in Prodigy's favor. "If you look at the opinion, it is evident that the judge spent a great deal of time considering the issues and wrote a thorough opinion," he told ZDNet UK. "The court adopted the majority of Prodigy's proposed constructions."
Prodigy was not successful on some issues, said Weaver, "but we are generally pleased with the results of the ruling."
In her ruling Wednesday, McMahon said BT's claim referred to the idea of information that is stored on a central computer and is accessed by remote terminals. "In this patent, the computer is a single device, in one location," McMahon wrote. "It is referred to as 'central' because it is connected to numerous physically separate stations, called 'remote terminals,' by the telephone lines of a telephone network. So there is a computer, connected to many remote terminals." Prodigy's lawyers believe that this analysis indicates that the patent does not cover the Internet but is instead confined to a system where there is one central computer.
The patent, number 4,873,662, was issued to BT in the U.S. in 1989 and expires in 2006. The company said it only discovered the patent in a routine trawl through its own patents four years ago.
According to Weaver, the patent was filed in the U.S. in 1976. "The Patent and Trademark Office here analyzed it, and for 12 years said there is nothing new in this patent application," he said. "So for 12 years they rejected the claims that were asserted, but the patent attorney representing BT kept pressing BTs case and eventually convinced the U.S. Patent and Trademark Office to issue the patent."
Some patent experts arguing against BT's case point to a video of a demonstration delivered by Douglas C. Engelbart, who had been working with a group of 17 researchers in the Augmentation Research Center at Stanford Research Institute, in Menlo Park, Calif. In a live demonstration of the online system, called NLS, which the researchers had been working on since 1962, Engelbart demonstrated the ability of NLS to jump between levels in the architecture of a text, making cross-references, creating Internal linking and live hyperlinks within a file.
Matt Loney reported from London.
| english |
<filename>common/src/types/v0/store/child.rs
//! Definition of child types that can be saved to the persistent store.
use crate::types::v0::{
message_bus::{self, ReplicaId},
store::definitions::{ObjectKey, StorableObject, StorableObjectType},
};
use serde::{Deserialize, Serialize};
/// Child information
#[derive(Serialize, Deserialize, Debug, PartialEq)]
pub struct Child {
/// Current state of the child.
pub state: Option<ChildState>,
/// Desired child specification.
pub spec: ChildSpec,
}
/// Runtime state of a child.
#[derive(Serialize, Deserialize, Debug, PartialEq)]
pub struct ChildState {
pub child: message_bus::Child,
/// Size of the child.
pub size: u64,
/// UUID of the replica that the child connects to.
pub replica_uuid: ReplicaId,
}
/// Key used by the store to uniquely identify a ChildState structure.
/// The child is identified through the replica ID.
pub struct ChildStateKey(ReplicaId);
impl From<&ReplicaId> for ChildStateKey {
fn from(id: &ReplicaId) -> Self {
Self(id.clone())
}
}
impl ObjectKey for ChildStateKey {
fn key_type(&self) -> StorableObjectType {
StorableObjectType::ChildState
}
fn key_uuid(&self) -> String {
self.0.to_string()
}
}
impl StorableObject for ChildState {
type Key = ChildStateKey;
fn key(&self) -> Self::Key {
ChildStateKey(self.replica_uuid.clone())
}
}
/// User specification of a child.
#[derive(Serialize, Deserialize, Debug, PartialEq)]
pub struct ChildSpec {
/// The size the child should be.
pub size: u64,
/// The UUID of the replica the child should be associated with.
pub replica_uuid: ReplicaId,
/// The state the child should eventually reach.
pub state: message_bus::ChildState,
}
/// Key used by the store to uniquely identify a ChildSpec structure.
/// The child is identified through the replica ID.
pub struct ChildSpecKey(ReplicaId);
impl From<&ReplicaId> for ChildSpecKey {
fn from(id: &ReplicaId) -> Self {
Self(id.clone())
}
}
impl ObjectKey for ChildSpecKey {
fn key_type(&self) -> StorableObjectType {
StorableObjectType::ChildSpec
}
fn key_uuid(&self) -> String {
self.0.to_string()
}
}
impl StorableObject for ChildSpec {
type Key = ChildSpecKey;
fn key(&self) -> Self::Key {
ChildSpecKey(self.replica_uuid.clone())
}
}
| rust |
<reponame>subhan300/fiver_hotel_design<filename>src/components/Gallery-screen/GalleryBanner.js
import React from 'react'
import '../../styles/Gallery=comp-styles/GalleryBanner.css'
function GalleryBanner({banner_img,title}) {
return (
<div className="gallery" style={{backgroundImage:`url(${banner_img})`}}>
<div className="gallery_text">
<h1>{title}</h1>
</div>
</div>
)
}
export default GalleryBanner
| javascript |
The all-important match between Punjab Kings and Rajasthan Royals is underway at the HPCA Stadium in Dharamshala. The game is crucial for both teams as the loser would crash out of the tournament while the winner would continue to be in contention for the race to the playoffs.
In the ongoing game, Punjab, batting first, got off to the worst possible start, as RR seamer Trent Boult, who returned to the side after sitting out in the previous game, lived up to his reputation of picking up wickets in the first over and got the wicket of Prabhsimran Singh on the 2nd ball of the first over.
On the 2nd ball, Singh mistimed a shot that went in Boult’s direction, and the left-arm seamer took a stunning flying catch, which left the viewers stunned. The fans took to the internet to share Boult’s impressive catch. Here is the video of the amazing catch.
After taking the wicket, Boult scripted a unique feat as he completed 50 wickets in the powerplay in his IPL career. Further, it was the 7th time this season that Trent took a wicket in the first over and surpassed Bhuvneshwar Kumar’s feat, who had six wickets in the first over in the 2016 edition. Here is the complete list of the most wickets in the first over of the innings in an IPL season.
- Trent Boult (MI) – 8 (2020)
- Trent Boult (RR) – 7 (2023)
- Bhuvneshwar Kumar (SRH) – 6 (2016)
| english |
{
"name": "human-inventory-management-system",
"version": "1.0.0",
"description": "Human resources management system",
"main": "launch.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/jondam1985/human-inventory-management-system.git"
},
"keywords": [
"mysql",
"system",
"human",
"resource",
"management",
"cli"
],
"author": "<NAME>",
"license": "MIT",
"bugs": {
"url": "https://github.com/jondam1985/human-inventory-management-system/issues"
},
"homepage": "https://github.com/jondam1985/human-inventory-management-system#readme",
"dependencies": {
"console.table": "^0.10.0",
"inquirer": "^7.0.0",
"mysql": "^2.17.1"
}
}
| json |
/**
* Solutions to Question 4.6 - Successor.
*
* @author <NAME>
*/
package nl.rostykerei.cci.ch04.q06;
| java |
Divisional Commissioner Jammu, Ramesh Kumar and Additional Director General of Police Jammu zone, Mukesh Singh today chaired a meeting of concerned officers to review the arrangements made for regulation of traffic in view of Shri Amarnath Ji Yatra 2023.
The meeting was attended by IG Traffic, Bhim Singh Tuti; (through vc), DIG Traffic, Shridhar Patel; Deputy Commissioner Jammu, Avny Lavasa; SSP Jammu, SSP Traffic, officers of NHAI and other concerned officers while SSP national highway, Deputy Commissioners of Kathua, Samba, Rajouri, Poonch Udhampur and Ramban along with SSPs participated in the meeting through video conferencing.
The Div Com and ADGP reviewed the Traffic Regulation plan formulated to facilitate smooth flow of traffic during Yatra days, especially on Udhampur to Banihal Stretch of Jammu Srinagar National Highway. The IG Traffic and SSPs shared the feedback and apprised about the existing traffic plan and the plan formulated for the Yatra days.
The IG Traffic informed that traffic advisories will be issued regularly during Yatra days for smooth flow of traffic on the National Highway. The ADGP and Div Com, after seeking suggestions from all the officers, decided to allow empty vehicles (trucks) to ply on Mughal road to minimize traffic rush amid the tourist season and Shri Amarnath Ji Yatra.
It was also decided that the cut off timing should be properly followed for smooth flow of traffic. It was also decided that the Light Motor Vehicles (LMV) will be allowed in a staggered manner to avoid traffic jams on the National Highway.
The ADGP stressed on the importance of devising an effective mechanism for the movement of light motor vehicles (LMVs) and heavy motor vehicles (HMVs) on the National Highway in a way that avoids congestion at any point, especially on National Highway. | english |
Discus thrower Vinod Kumar clinched a bronze medal in the men's F52 event with an Asian record to give India its third medal in Tokyo Paralympics here on Sunday.
The 41-year-old BSF man, whose father fought in the 1971 Indo-Pak war, produced a best throw of 19. 91m to finish third behind Piotr Kosewicz (20. 02m) of Poland and Velimir Sandor (19. 98m) of Croatia.
He injured his legs while training after joining the BSF, falling off a cliff in Leh that left him bed-ridden for close to a decade during which he lost both his parents.
The F52 classification is for athletes with impaired muscle power, restricted range of movement, limb deficiency or leg length difference, with athletes competing in seated position.
It also applies to cervical cord injury, spinal cord injury, amputation, and functional disorder.
Both Bhavina Patel and Nishad Kumar had earlier won a silver each in women's singles table tennis class 4 and men's T47 high jump events respectively on Sunday. | english |
Hollywood diva Ana de Armas is perplexed by the NC-17 rating assigned to her next Netflix film, "Blonde," which is based on the life of Marylin Monroe.
Hollywood diva Ana de Armas is perplexed by the NC-17 rating assigned to her next Netflix film, "Blonde," which is based on the life of Marylin Monroe.
According to Fox News, usually, a movie receives an NC-17 rating from the Motion Picture Association of America when it has gratuitous violence, obscene sex and/or nudity, and/or coarse language. An adult must accompany minors to view movies with an R rating in cinemas, but they are not permitted to see NC-17-rated films. This is why an NC-17 rating is distinct from an R rating.
The Cuban actress claims she has seen films with considerably more explicit content and doesn't understand why "Blonde" received such a high rating.
"I didn't understand why that happened," she said in her L'Officiel cover story. "I can tell you a number of shows or movies that are way more explicit with a lot more sexual content than 'Blonde. '"
She acknowledges that there are some sexual sequences in the film, but she believes they are vital to the narrative they were attempting to portray. "To tell this story it is important to show all these moments in Marilyn's life that made her end up the way that she did. It needed to be explained," she said. "Everyone [in the cast] knew we had to go to uncomfortable places. I wasn't the only one. "
De Armas made her film debut in "Knives Out," playing the lead character "Blonde. " When her hiring was revealed, Monroe supporters criticised the studio's choice to hire her since she had a Cuban accent and speaks English. She refused to allow the criticism of her accent to impact her or increase the pressure she already felt, stating that everyone should experience pressure while playing such a legendary character. She went on to say that her performance was not an imitation but rather a method to shed light on the icon's current state of mind.
"I am proud to have Andrew's trust and the chance to pull it off. I feel like whether you're a Cuban or an American actress, anyone should feel the pressure," de Armas said. The actor had the support of the Marilyn Monroe Estate, whose rep, Mark Rosen, told Variety that although the estate doesn't sanction the film, "Ana was a great casting choice as she captures Marilyn's glamour, humanity, and vulnerability. "
"Blonde" is set to drop on Netflix on Sept. 28 and is the streaming platform's first NC-17-rated film.
( With inputs from ANI ) | english |
{
"CONTRACT_ADDRESS": "0x1AFBd5509d2ECbe7bf56d55560eCE9f0F6FD26a9",
"SCAN_LINK": "https://polygonscan.com/address/0x1afbd5509d2ecbe7bf56d55560ece9f0f6fd26a9",
"NETWORK": {
"NAME": "Polygon",
"SYMBOL": "Matic",
"ID": 137
},
"NFT_NAME": "Afaction",
"SYMBOL": "AFAC",
"MAX_SUPPLY": 10000,
"WEI_COST": 2000000000000000000,
"DISPLAY_COST": 2,
"GAS_LIMIT": 350000,
"MARKETPLACE": "Opeansea",
"MARKETPLACE_LINK": "https://opensea.io/collection/afaction",
"SHOW_BACKGROUND": true
}
| json |
At 8 am on March 27, the first phase of the eight-phase mega election exercise will kick off in two of the five states going to polls over the coming month. For the taking in this phase are 77 assembly seats for which 455 candidates are in the fray. Which way the seats will swing will be known on May 2 when votes will be counted in all five states.
Of West Bengal, Assam, Tamil Nadu, Kerala, and Puducherry, 77 constituencies in the first two states will vote in the first phase. In West Bengal, elections for the 294-member Assembly will be held in eight phases between March 27 and April 29 and 30 seats will vote in the first phase. The voting for the 126-member Assam assembly will be held on March 27, April 1, and April 6 and 47 seats will poll in phase one.
West Bengal is perhaps the most keenly-watched of all the states with the Bharatiya Janata Party (BJP) putting up a spirited opposition to the ruling Trinamool Congress led by Chief Minister Mamata Banerjee. Marked by defections, high-decibel campaign and allegations of attacks, the campaign in the state was highly vitriolic, to say the least.
In the 2016 assembly elections, the ruling Trinamool had won 27 of the 30 seats going to polls in phase 1. The Congress had won two seats and RSP, a constituent of the Left Front, one seat. However, in the 2019 Lok Sabha elections, the BJP had swept this region.
In 2011, when Mamata Banerjee trounced the then ruling Left Front in the state, people in the tribal-dominated districts going to polls on March 27 — Bankura, Purulia, Jhargram, West Medinipur, and East Medinipur — voted overwhelmingly for her Trinamool Congress. This trend continued in the 2016 Assembly elections too. Going by the 2019 Lok Sabha elections voting pattern, Trinamool may have a tough time defending this bastion.
Keen contests are likely to be witnessed in these districts this time. In Purulia, sitting Congress MLA Sudip Mukherjee recently joined the BJP and is contesting on the saffron party’s ticket. This time, the Congress has fielded Partha Pratim Banerjee and the Trinamool has given ticket to Sujoy Banerjee.
Any key contest is likely in the Kharagpur assembly seat, which falls under the Medinipur Lok Sabha constituency represented by Bengal BJP president Dilip Ghosh. The BJP has fielded Tapan Bhuya for this prestige battle while the Trinamool has relied on sitting MLA Dinen Roy again.
Medinipur is another keenly-watched contest where the Trinamool has replaced sitting MLA Mrigendra Nath Maiti with actor June Maliah against the BJP’s Samit Kumar Das.
(Click here for more on key contests in phase 1 of West Bengal elections)
In Assam, the ruling BJP is looking to retain power in the three-phase assembly elections. While analysts feel that the BJP-AGP combine is comfortably placed in the elections, the Congress’s alliance with Badruddin Ajmal’s AIDUF may upset calculations in some seats.
In phase 1 elections, 47 of the 126 will vote on March 27. Of these, 37 MLAs are re-contesting, including 24 of the BJP, 6 each from the Congress and AGP, and one from AIUDF. Forty-two of these seats fall in 11 districts of Upper Assam and North Assam, and five from Central Assam’s Nagaon district. In 2016, the BJP had bagged 27 seats and its ally AGP 8 seats. The Congress had won just 9 seats.
This time, the AIUDF is contesting 19 seats as a part of the alliance with Congress. In the 2016 assembly election, the division of voters between Congress and Ajmal’s party had led to the BJP winning over 20 seats.
In the BJP, murmurs have already started over who will the chief minister if the party comes to power on May 2. Himanta Biswa Sarma, who had joined the BJP before the 2016 Assembly election and was widely credited with the party’s win in the state, is seen as a strong contender. Both Sarma and current CM Sarbanda Sonowal are in the fray this time too.
Among the key seats in Phase 1 are Majuli from where chief minister Sarbananda Sonowal is contesting; Gohpur from where Assam Congress president Ripun Bora is contesting; and Sibsagar from where jailed peasants’ rights activist and president of newly formed Raijor Dal Akhil Gogoi is contesting.
(Click here for more on key contests in phase 1 of Assam elections) | english |
Prime Minister Narendra Modi today came out all guns blazing in Puducherry. Addressing a public rally in the Union Territory, the PM attacked the Congress and the erstwhile government led by V Narayansamy. PM Modi said that this year’s election in the UT is unique in one aspect as the sitting CM has been denied a ticket. “I have had a reasonably long experience in politics. I have seen many elections. But, the Puducherry election 2021 is unique. Do you know why? Because the sitting Chief Minister has not been given a ticket,” said PM Modi targeting V Narayanasamy, who led the Congress government in the UT before it collapsed in February following the resignation of several sitting MLAs.
He said that the previous Congress government headed by V Narayanasamy was a disaster. “So many years of loyalty. Lifting slippers of his leader. Doing wrong translations to impress his leader. Still, no ticket! This clearly shows how much of a disaster his Government has turned out to be,” said PM Modi.
He said that the previous Puducherry Government has a special place in the long list of non-performing Congress governments over the years as the ‘High Command’ Government of Puducherry had failed on all fronts.
After his FAST approach in Kerala, PM Narendra Modi came out with a ‘BEST’ approach for Puducherry. He said that if voted to power, the NDA government will work to make ‘BEST’ Puducherry. “NDA government will work to make ‘BEST’ Puducherry. By Best, I mean: Business Hub. Education Hub. Spiritual Hub. Tourism Hub,” said the PM.
He also claimed to have seen a huge wave in favour of NDA in poll-bound states. “Seeing a huge wave in favour of NDA in four poll-bound states and Puducherry,” said PM Modi.
Earlier, starting his speech, PM Modi invoked the great spiritual leaders. “When I think of Puducherry I think about Bharathiyar. I think about Sri Aurobindo. I think about Sithanandha Swamy and Thollaikkathu Siddhar. I bow in reverence to the Manakula Vinayagar Swamy Temple and the Sreemath Guru Sithanandha Swamigal Devasthanam,” he said.
Puducherry is going to the polls on April 6. The counting of votes for the 30 assembly constituencies will take place on May 2.
| english |
<gh_stars>0
import os, subprocess
from kalmfl.parser.processor import Processor
import argparse
arg_parser = argparse.ArgumentParser()
arg_parser.add_argument('--mode', default='train', help='train or test')
arg_parser.add_argument('--ont', default='user', help='ontology')
arg_parser.add_argument('--isomorph', default=False, help='do isomorphic check or not')
arg_parser.add_argument('--dep_num', default=1, help='# of dependency parses')
args = arg_parser.parse_args()
processor = Processor(args)
processor.load_batch_data()
processor.stanza_parse()
if args.mode == 'test' or args.ont != 'metaqa':
sentence_level_rejected_sentences = processor.get_sentence_level_rejected_sentences()
for idx, (sent_id, sent_text) in enumerate(sentence_level_rejected_sentences.items(), 1):
print(str(idx) + ': ' + str(sent_id) + '. ' + sent_text)
processor.paraparse()
processor.serialize()
f = open('config/xsb.properties', 'r')
lines = f.read().split('\n')
xsb_path_str = lines[3].split('=')[1]
f.close()
os.chdir('kalmfl/parser/framebasedparsing/' + args.mode + '/run')
subprocess.call(xsb_path_str + " -e \"[" + args.mode + "_" + args.ont + "], halt.\"", shell=True)
os.chdir('../../../') | python |
<gh_stars>1-10
// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
use std::option::Option;
use std::boxed::Box;
use std::io::Result;
use std::io::Cursor;
use std::vec::Vec;
use std::default::Default;
use kaitai_struct::KaitaiStream;
use kaitai_struct::KaitaiStruct;
#[derive(Default)]
pub struct CombineBytes {
pub bytesTerm: Vec<u8>,
pub bytesLimit: Vec<u8>,
pub bytesEos: Vec<u8>,
pub limitOrCalc: Option<Vec<u8>>,
pub termOrLimit: Option<Vec<u8>>,
pub limitOrEos: Option<Vec<u8>>,
pub eosOrCalc: Option<Vec<u8>>,
pub termOrCalc: Option<Vec<u8>>,
pub bytesCalc: Option<Vec<u8>>,
pub termOrEos: Option<Vec<u8>>,
}
impl KaitaiStruct for CombineBytes {
fn new<S: KaitaiStream>(stream: &mut S,
_parent: &Option<Box<KaitaiStruct>>,
_root: &Option<Box<KaitaiStruct>>)
-> Result<Self>
where Self: Sized {
let mut s: Self = Default::default();
s.stream = stream;
s.read(stream, _parent, _root)?;
Ok(s)
}
fn read<S: KaitaiStream>(&mut self,
stream: &mut S,
_parent: &Option<Box<KaitaiStruct>>,
_root: &Option<Box<KaitaiStruct>>)
-> Result<()>
where Self: Sized {
self.bytesTerm = self.stream.read_bytes_term(124, false, true, true)?;
self.bytesLimit = self.stream.read_bytes(4)?;
self.bytesEos = self.stream.read_bytes_full()?;
}
}
impl CombineBytes {
fn limitOrCalc(&mut self) -> Vec<u8> {
if let Some(x) = self.limitOrCalc {
return x;
}
self.limitOrCalc = if false { self.bytes_limit } else { self.bytes_calc};
return self.limitOrCalc;
}
fn termOrLimit(&mut self) -> Vec<u8> {
if let Some(x) = self.termOrLimit {
return x;
}
self.termOrLimit = if true { self.bytes_term } else { self.bytes_limit};
return self.termOrLimit;
}
fn limitOrEos(&mut self) -> Vec<u8> {
if let Some(x) = self.limitOrEos {
return x;
}
self.limitOrEos = if true { self.bytes_limit } else { self.bytes_eos};
return self.limitOrEos;
}
fn eosOrCalc(&mut self) -> Vec<u8> {
if let Some(x) = self.eosOrCalc {
return x;
}
self.eosOrCalc = if true { self.bytes_eos } else { self.bytes_calc};
return self.eosOrCalc;
}
fn termOrCalc(&mut self) -> Vec<u8> {
if let Some(x) = self.termOrCalc {
return x;
}
self.termOrCalc = if true { self.bytes_term } else { self.bytes_calc};
return self.termOrCalc;
}
fn bytesCalc(&mut self) -> Vec<u8> {
if let Some(x) = self.bytesCalc {
return x;
}
self.bytesCalc = vec!([0x52, 0x6e, 0x44]);
return self.bytesCalc;
}
fn termOrEos(&mut self) -> Vec<u8> {
if let Some(x) = self.termOrEos {
return x;
}
self.termOrEos = if false { self.bytes_term } else { self.bytes_eos};
return self.termOrEos;
}
}
| rust |
Sahar Elhabashi, Spotify’s head of the podcast division, said in an internal memo, that the company would cut its workforce by 2%, according to reports.
In March, Amarjit Singh Batra, managing director, India and general manager, South Asia, the Middle East and Africa at Spotify, told ET in an exclusive chat about the company's plans to double down in India as it bulks up its sales team five-fold. This was significant in the face of the Swedish company's layoff announcement.
The audio company’s heavy investments in podcasts have come under scrutiny as analysts have questioned as to when it will result in racking up revenues.
In 2019, Spotify acquired podcast networks Anchor and Gimlet to strengthen the business but has since laid off employees at Gimlet and its Parcast podcast studios.
While Spotify has been adding users, losses for the NYSE-listed audio company have sustained due to heavy investments in podcasts. In January, while reporting its fourth-quarter results, Spotify said it had 489 million monthly active users, up 20% from a year earlier, and highlighted growth in India and Indonesia.
| english |
<gh_stars>0
var WebUiClient = function() {
this.socket = io.connect('/');
this.socket.on('connect', function() {
$('#connectionStatus').addClass('online');
$('#connectionStatus').removeClass('offline');
});
this.socket.on('disconnect', function() {
$('#connectionStatus').addClass('offline');
$('#connectionStatus').removeClass('online');
});
this.socket.on('new_job', function(id, source) {
var newrow = "";
newrow += "<div class=\"row job\" id=\"job" + id + "\">";
newrow += "<div class=\"three columns source\">" + source + "</div>"
newrow += "<div class=\"eight columns\">";
newrow += "<div class=\"progressbar\">";
newrow += "<div class=\"bar\" style=\"width: 0%\"></div>";
newrow += "</div>";
newrow += "</div>";
newrow += "<div class=\"one column progress\">0%</div>";
newrow += "</div>";
$('.container').append(newrow);
});
this.socket.on('progress', function(id, progress) {
var row = $('#job' + id);
if(!row) return;
var perc = progress + "%";
$('.bar', row).width(perc);
$('.progress', row).html(perc);
});
this.socket.on('error', function(id, error) {
var row = $('#job' + id);
if(!row) return;
var source = $('.source', row).html();
$(row).html('<div class="three columns source">' + source + '</div><div class="eight columns"><strong>Error: </strong>' + error + '</div></div>')
});
this.socket.on('syncing', function(id) {
var row = $('#job' + id);
if(!row) return;
var source = $('.source', row).html();
$(row).html('<div class="three columns source">' + source + '</div><div class="eight columns"><strong>syncing</strong></div></div>')
});
this.socket.on('done', function(id) {
var row = $('#job' + id);
if(!row) return;
$('.eight', row).html("done");
});
this.socket.on('drives', function(drives) {
var content = drives.filter(function(d) { return d.priority <= 10; }).map(function(d) { return d.name }).join(" ");
$('#destinations').html(content);
});
};
$(function() {
var ui = new WebUiClient();
screenfull.request();
$('#viewDestination').click(() => {
screenfull.toggle();
});
});
| javascript |
<reponame>CLBExchange/certified-token-list
{"name":"HUMAN-SOL LP Token","symbol":"HUMAN-SOL","logoURI":"https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/4AhAphjiE9M81KyHBJNHCHrYTzScm2wrxLSu5zCYKvWq/humanlp.png","decimals":9,"address":"4AhAphjiE9M81KyHBJNHCHrYTzScm2wrxLSu5zCYKvWq","chainId":101,"tags":["lp-token"],"extensions":{"website":"https://cyberkatz.space","twitter":"https://twitter.com/thecyberkatz","discord":"http://discord.gg/5m6cBdry6y","coingeckoId":"human","coinmarketcap":"https://coinmarketcap.com/currencies/human-coin/"}} | json |
Kangana Ranaut is currently hosting the controversial reality show Lock Upp and has dragged several celebs on her new show. This time around, the actor called out Karan Johar in an Instagram post as her reality TV show Lock Upp hit 200 million views. It is quite well known that Ranaut and Johar don't see eye to eye after, the former called the filmmaker ‘flagbearer of Nepotism’ on his talk show Koffee with Karan.
SEE ALSO: 'The Kashmir Files' Director Vivek Agnihotri Denies Signing Kangana Ranaut For His Next; 'My Films Don't Need Stars'
Kangana has been locking horns with Karan Johar ever since she called him 'flag bearer of Nepotism' and has publicly called out the filmmaker over the years. The actor also called Hrithik Roshan during the first episode of Lock Upp, she was heard saying, "Log paanch ungliyan mila ke haath jodd rahe hain. Waise gala toh che ungliyon walo ka bhi sookh raha hai ."
SEE ALSO: Kangana Ranaut Drags 'Gangubai Kathiawadi's Box Office Success Calling It "Movie Mafia Mathematics"
| english |
<reponame>MattPlays/webbzw
/** Smartly get coordinate for input */
export function getCoord(e: any, coord: "X" | "Y"): number{
return e.touches ? e.touches[0][`page${coord}`] : e[`page${coord}`];
}
/** Save map to device */
export function saveFile(fileName: string, text: string){
const blob = new Blob([text], {type: "text/plain"});
const link = document.createElement("a");
link.download = fileName;
link.href = window.URL.createObjectURL(blob);
link.style.display = "none";
document.body.appendChild(link);
link.click();
link.remove();
}
/** Apply color theme */
export function colorThemeChanged(){
document.documentElement.setAttribute("data-theme", localStorage.getItem("colorTheme") ?? "default");
}
| typescript |
To the Director: A special Davidic psalm[a] to the tune of[b] “Do Not Destroy,” when he fled from Saul into a cave.
57 Have mercy on me, God, have mercy,
for in you I[c] have placed my trust.
will I find my refuge until this calamity passes.
2 I call upon the God Most High;
to the God who completes what he began[d] in me.
from those who harass and despise me.
God will send his gracious love and truth.
4 I am[e] surrounded by lions.
whose tongues are like sharp swords.
5 Be exalted above the heavens, God!
May your glory cover the earth!
6 They have set a snare for my feet,
which makes me[f] depressed.
They dug a pit in front of me,
but they are the ones who fell into it!
7 My heart is committed, God,
my heart is committed,
so I will sing and play music.
wake up, lyre and harp!
I will awaken at dawn.
9 I will exalt you among the peoples, Lord.
I will play music among the nations.
10 For your gracious love is great,
extending even to the heavens,
and your truth even to the skies.
11 Be exalted above the heavens, God!
May your glory cover the earth!
Copyright © 1995-2014 by ISV Foundation. ALL RIGHTS RESERVED INTERNATIONALLY. Used by permission of Davidson Press, LLC.
| english |
A loud rumble breaks the silence of the dawn, as Indirapuram resident Pankaj Singh kick starts his 500cc Royal Enfield Bullet motorcycle to set out on a 300km adventure ride.
He is joined by other enthusiastic Bullet riders from Ghaziabad.
A club called ‘Reborn Riders’ was started by Singh in 2012 and has more than 150 members at present who regularly go for long road trips to find solace from the bustling city and professional life. The group members go on up to ten road trips each year, mostly from September to November and February to April.
“We have touched all the places within a 300km radius of Delhi. The visit to the Lahun-Spiti valley in Himachal was one of the most exciting and challenging trips due to the difficult terrain. Some places had no roads while others were rocky,” 29-year-old Singh said.
The members said that the experience of road trips becomes more memorable when crisis hits them on their journeys.
They said that there has not been a single trip when their bikes did not break down. Moreover, accidents are also a part of their adventure.
“I broke my shoulder bone last year on our way to Bilaspur. We were 12 riders in all and we were going to a village near Manali. It became all the more challenging because I had to get back home the next day and could not leave my bike behind. Hence, I had to ride the bike all the way through the rough patches with a broken shoulder,” said Nitin Kamboj, a member of the group who owns a 350cc Thunderbird bike.
Kamboj said that the longer trips mostly entail lesser members while shorter trips have more number of riders.
“The minimum number of riders was on the ride to Spiti valley, as just eight members travelled. We recorded the highest number of riders on a trip to Karnal, which had around 50 bikers,” said Kamboj, who works as a styling expert in a reputed cosmetics brand.
These mean machines cost well over Rs. 1 lakh but owning a Bullet bike is a source of pride for the riders.
“I was introduced to the Bullet in 2009 by a friend. It was love at first sight and I decided to buy one for myself. I had to save up and also had to get finance for the bike. But the wait was worth it,” said Singh, who is a businessman.
All the members not only share the passion of being bikers, but also a special bond caused by the rattling machines. They said the bike and rides are their addiction and passion.
“I cannot express the passion I have for my bike in words. In a year, if I don’t go on at least six 300-400 kilometre road trips, it feels like there is something missing in my life,” said KK Gautam, an IT professional.
“Majority of my close friendships are through the Bullet riding club only. Whether we are on breakfast rides to Karnal or on eight-day long trip to Leh-Ladakh, the bond gives us an exhilarating experience,” said Priyank Joshi, a freelance writer. | english |
<filename>fgietAdmission/settings/prod.py
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(
os.path.dirname(os.path.abspath(__file__))))
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = os.environ.get(
'SECRET_KEY', '<KEY>
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = eval(os.environ.get('DEBUG'))
ALLOWED_HOSTS = ['www.fgiet.in', 'fgiet.in']
if DEBUG:
ALLOWED_HOSTS = ['*']
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django_celery_beat',
'django_celery_results',
'crispy_forms',
'pagedown',
'widget_tweaks',
'admission',
'account',
'utils'
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'fgietAdmission.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
'libraries':{
'my_filters': 'fgietAdmission.templatetags.my_filters',
}
},
},
]
WSGI_APPLICATION = 'fgietAdmission.wsgi.application'
# Database
# https://docs.djangoproject.com/en/1.11/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': os.environ.get('POSTGRES_DB'),
'USER': os.environ.get('POSTGRES_USER'),
'PASSWORD': <PASSWORD>('POSTGRES_PASSWORD'),
'HOST': os.environ.get('POSTGRES_HOST', 'localhost'),
'PORT': os.environ.get('POSTGRES_PORT', '5432')
}
}
# Password validation
# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# Internationalization
# https://docs.djangoproject.com/en/1.11/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'Asia/Kolkata'
USE_I18N = True
USE_L10N = True
USE_TZ = True
MAX_UPLOAD_SIZE = 225280
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.11/howto/static-files/
STATIC_URL = '/static/'
STATICFILES_DIRS = [
os.path.join(BASE_DIR, "static"),
]
STATIC_ROOT = os.path.join(BASE_DIR, "static_cdn")
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, "media_cdn")
CRISPY_TEMPLATE_PACK = 'bootstrap4'
CELERY_BROKER_URL = os.environ.get('REDIS_URL', 'redis://localhost:6379')
CELERY_RESULT_BACKEND = os.environ.get('REDIS_URL', 'redis://localhost:6379')
CELERY_ACCEPT_CONTENT = ['application/json']
CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'
CELERY_TIMEZONE = TIME_ZONE
CELERY_IMPORTS = (
"utils.tasks",
)
EMAIL_HOST = os.environ.get('EMAIL_HOST')
EMAIL_PORT = os.environ.get('EMAIL_PORT')
EMAIL_HOST_USER = os.environ.get('EMAIL_HOST_USER')
EMAIL_HOST_PASSWORD = os.environ.get('EMAIL_HOST_PASSWORD')
EMAIL_USE_TLS = True
if not DEBUG:
CORS_REPLACE_HTTPS_REFERER = True
HOST_SCHEME = "https://"
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
SECURE_SSL_REDIRECT = True
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True
SECURE_HSTS_INCLUDE_SUBDOMAINS = True
SECURE_HSTS_SECONDS = 1000000
SECURE_FRAME_DENY = True
| python |
use crate::{
test_utils::{MockServer, DEFAULT_TERMINAL_BLOCK, DEFAULT_TERMINAL_DIFFICULTY, JWT_SECRET},
Config, *,
};
use sensitive_url::SensitiveUrl;
use task_executor::TaskExecutor;
use tempfile::NamedTempFile;
use types::{Address, ChainSpec, Epoch, EthSpec, FullPayload, Hash256, Uint256};
pub struct MockExecutionLayer<T: EthSpec> {
pub server: MockServer<T>,
pub el: ExecutionLayer,
pub executor: TaskExecutor,
pub spec: ChainSpec,
}
impl<T: EthSpec> MockExecutionLayer<T> {
pub fn default_params(executor: TaskExecutor) -> Self {
Self::new(
executor,
DEFAULT_TERMINAL_DIFFICULTY.into(),
DEFAULT_TERMINAL_BLOCK,
ExecutionBlockHash::zero(),
Epoch::new(0),
)
}
pub fn new(
executor: TaskExecutor,
terminal_total_difficulty: Uint256,
terminal_block: u64,
terminal_block_hash: ExecutionBlockHash,
terminal_block_hash_activation_epoch: Epoch,
) -> Self {
let handle = executor.handle().unwrap();
let mut spec = T::default_spec();
spec.terminal_total_difficulty = terminal_total_difficulty;
spec.terminal_block_hash = terminal_block_hash;
spec.terminal_block_hash_activation_epoch = terminal_block_hash_activation_epoch;
let server = MockServer::new(
&handle,
terminal_total_difficulty,
terminal_block,
terminal_block_hash,
);
let url = SensitiveUrl::parse(&server.url()).unwrap();
let file = NamedTempFile::new().unwrap();
let path = file.path().into();
std::fs::write(&path, hex::encode(JWT_SECRET)).unwrap();
let config = Config {
execution_endpoints: vec![url],
secret_files: vec![path],
suggested_fee_recipient: Some(Address::repeat_byte(42)),
..Default::default()
};
let el =
ExecutionLayer::from_config(config, executor.clone(), executor.log().clone()).unwrap();
Self {
server,
el,
executor,
spec,
}
}
pub async fn produce_valid_execution_payload_on_head(self) -> Self {
let latest_execution_block = {
let block_gen = self.server.execution_block_generator();
block_gen.latest_block().unwrap()
};
let parent_hash = latest_execution_block.block_hash();
let block_number = latest_execution_block.block_number() + 1;
let timestamp = block_number;
let prev_randao = Hash256::from_low_u64_be(block_number);
let finalized_block_hash = parent_hash;
// Insert a proposer to ensure the fork choice updated command works.
let slot = Slot::new(0);
let head_block_root = Hash256::repeat_byte(42);
let validator_index = 0;
self.el
.insert_proposer(
slot,
head_block_root,
validator_index,
PayloadAttributes {
timestamp,
prev_randao,
suggested_fee_recipient: Address::repeat_byte(42),
},
)
.await;
self.el
.notify_forkchoice_updated(
parent_hash,
ExecutionBlockHash::zero(),
slot,
head_block_root,
)
.await
.unwrap();
let validator_index = 0;
let payload = self
.el
.get_payload::<T, FullPayload<T>>(
parent_hash,
timestamp,
prev_randao,
finalized_block_hash,
validator_index,
)
.await
.unwrap()
.execution_payload;
let block_hash = payload.block_hash;
assert_eq!(payload.parent_hash, parent_hash);
assert_eq!(payload.block_number, block_number);
assert_eq!(payload.timestamp, timestamp);
assert_eq!(payload.prev_randao, prev_randao);
let status = self.el.notify_new_payload(&payload).await.unwrap();
assert_eq!(status, PayloadStatus::Valid);
// Use junk values for slot/head-root to ensure there is no payload supplied.
let slot = Slot::new(0);
let head_block_root = Hash256::repeat_byte(13);
self.el
.notify_forkchoice_updated(
block_hash,
ExecutionBlockHash::zero(),
slot,
head_block_root,
)
.await
.unwrap();
let head_execution_block = {
let block_gen = self.server.execution_block_generator();
block_gen.latest_block().unwrap()
};
assert_eq!(head_execution_block.block_number(), block_number);
assert_eq!(head_execution_block.block_hash(), block_hash);
assert_eq!(head_execution_block.parent_hash(), parent_hash);
self
}
pub fn move_to_block_prior_to_terminal_block(self) -> Self {
self.server
.execution_block_generator()
.move_to_block_prior_to_terminal_block()
.unwrap();
self
}
pub fn move_to_terminal_block(self) -> Self {
self.server
.execution_block_generator()
.move_to_terminal_block()
.unwrap();
self
}
pub async fn with_terminal_block<'a, U, V>(self, func: U) -> Self
where
U: Fn(ChainSpec, ExecutionLayer, Option<ExecutionBlock>) -> V,
V: Future<Output = ()>,
{
let terminal_block_number = self
.server
.execution_block_generator()
.terminal_block_number;
let terminal_block = self
.server
.execution_block_generator()
.execution_block_by_number(terminal_block_number);
func(self.spec.clone(), self.el.clone(), terminal_block).await;
self
}
}
| rust |
{"name":"<NAME>","city":"Oshkosh","state":"Wisconsin","code":"54901","country":"United States","phone":"1-920-232-2337","website":"","type":"brewery","updated":"2010-07-22 20:00:20","description":"","address":["1501 Arboretum Drive"],"geo":{"accuracy":"RANGE_INTERPOLATED","lat":44.0342,"lon":-88.5608}} | json |
<filename>test/liveValidation/payloads/missingResourceId_sublevelResource_input.json
{
"liveRequest": {
"headers": {
"strict-Transport-Security": "max-age=31536000; includeSubDomains",
"x-ms-request-id": "97856fec-304a-4317-87f0-f04c328402d3",
"x-ms-correlation-request-id": "97856fec-304a-4317-87f0-f04c328402d3",
"date": "Tue, 11 Sep 2018 19:00:21 GMT",
"eTag": "\"AAAAAAAAQqUAAAAAAABCpw==\"",
"server": "Microsoft-HTTPAPI/2.0",
"Content-Type": "application/json"
},
"method": "GET",
"url": "/subscriptions/a712f8f5-3c93-4d8f-a2cd-d888635158e6/resourceGroups/adme2e/providers/Microsoft.OperationsManagement/solutions/ServiceMap(adme2e)?api-version=2015-11-01-preview&MaskCMKEnabledProperties=true",
"query": {
"api-version": "2021-01-01-privatepreview"
}
},
"liveResponse": {
"statusCode": "200",
"headers": {
"strict-Transport-Security": "max-age=31536000; includeSubDomains",
"x-ms-request-id": "97856fec-304a-4317-87f0-f04c328402d3",
"x-ms-correlation-request-id": "97856fec-304a-4317-87f0-f04c328402d3",
"date": "Tue, 11 Sep 2018 19:00:21 GMT",
"eTag": "\"AAAAAAAAQqUAAAAAAABCpw==\"",
"server": "Microsoft-HTTPAPI/2.0",
"Content-Type": "application/json",
"Azure-AsyncOperation": "https://management.azure.com/subscriptions/subid/providers/Microsoft.ServiceLinker/...pathToOperationStatus..."
},
"body": {
"plan": {
"name": "ServiceMap(adme2e)",
"publisher": "Microsoft",
"promotionCode": "",
"product": "OMSGallery/ServiceMap"
},
"properties": {
"workspaceResourceId": "/subscriptions/a712f8f5-3c93-4d8f-a2cd-d888635158e6/resourcegroups/adme2e/providers/Microsoft.OperationalInsights/workspaces/adme2e",
"provisioningState": "Succeeded",
"containedResources": [
"/subscriptions/a712f8f5-3c93-4d8f-a2cd-d888635158e6/resourceGroups/adme2e/providers/microsoft.operationalinsights/workspaces/adme2e/views/ServiceMap(adme2e)"
]
},
"location": "East US",
"tags": {},
"id": "/subscriptions/a712f8f5-3c93-4d8f-a2cd-d888635158e6/resourceGroups/adme2e/providers/microsoft.operationsmanagement/solutions/ServiceMap(adme2e)",
"name": "ServiceMap(adme2e)",
"type": "microsoft.operationsmanagement/solutions"
}
}
} | json |
import Icon from '../components/Icon'
Icon.register({
lightbulb: {
width: 352,
height: 512,
paths: [
{
d: 'M96.1 454.3l0-38.3h160l0 38.3c0 5.3-2.4 13.3-5.4 17.7l-17.1 25.7c-5.2 7.9-17.2 14.3-26.6 14.3h-61.7c-9.5 0-21.4-6.4-26.6-14.3l-17.1-25.7c-3.5-5.2-5.3-11.4-5.4-17.7zM0 176c0-93 73.4-175.7 175.4-176 97.5-0.3 176.6 78.6 176.6 176 0 44.4-16.5 84.8-43.6 115.8-16.5 18.8-42.4 58.2-52.2 91.5 0 0.3-0.1 0.5-0.1 0.8h-160.2c0-0.3-0.1-0.5-0.1-0.8-9.8-33.2-35.7-72.6-52.2-91.5-27.1-30.9-43.6-71.4-43.6-115.8zM176 96c8.8 0 16-7.2 16-16s-7.2-16-16-16c-61.8 0-112 50.2-112 112 0 8.8 7.2 16 16 16s16-7.2 16-16c0-44.1 35.9-80 80-80z'
}
]
}
})
| javascript |
<reponame>CardanoFreaks/rarity-analyzer<filename>web/data/PixelFreak/6312.json
{"nft":{"id":"6312","name":"PixelFreak #06312","description":"They call us ugly, and misfits, but we prefer to call ourselves freaks","image":"ipfs://QmcPnWp6L7nGW44Bf4zAcfytBMbCGXthPXQBzucuKToLmC","attributes":[{"trait_type":"pet","value":"None"},{"trait_type":"body","value":"Overalls A"},{"trait_type":"eyes","value":"Lennon"},{"trait_type":"head","value":"Blu"},{"trait_type":"nose","value":"Pig"},{"trait_type":"extra","value":"Miris"},{"trait_type":"mouth","value":"Snake"},{"trait_type":"background","value":"RandomColor"},{"trait_type":"Trait Count","value":"8"}]},"attributeRarities":[{"trait_type":"pet","value":"None","count":9511,"ratio":0.9511,"ratioScore":1.0514141520344864},{"trait_type":"body","value":"Overalls A","count":219,"ratio":0.0219,"ratioScore":45.662100456621005},{"trait_type":"eyes","value":"Lennon","count":351,"ratio":0.0351,"ratioScore":28.49002849002849},{"trait_type":"head","value":"Blu","count":453,"ratio":0.0453,"ratioScore":22.075055187637968},{"trait_type":"nose","value":"Pig","count":1243,"ratio":0.1243,"ratioScore":8.045052292839904},{"trait_type":"extra","value":"Miris","count":94,"ratio":0.0094,"ratioScore":106.38297872340425},{"trait_type":"mouth","value":"Snake","count":182,"ratio":0.0182,"ratioScore":54.94505494505494},{"trait_type":"background","value":"RandomColor","count":9595,"ratio":0.9595,"ratioScore":1.0422094841063054},{"trait_type":"Trait Count","value":"8","count":10000,"ratio":1,"ratioScore":1}],"rarityScore":268.69389373172737,"rank":1891} | json |
<reponame>mostaphaRoudsari/RadianceMailingList
{"body": "<NAME> wrote:\n\n\n> Hi folks, 'nother update, if interested:\n> http://www.rumblestrip.org/rad/rad_01.html#break2\n\n\n\n\n>>> What the heck are those bright artifacts near the coffers?\n\n\nI think that's a rather old bug in Radiance.\n\n\nIllums sometimes behave strange (they forget that they should\nshow the repacement material) when viewed under a very flat\nangle, which is what you seem to be doing here.\n\n\nOf course, it's been years that I submitted the last bug report\nabout this (can't find my test case anymore) and I haven't\nchecked it since, so I might just as well be wrong. But your\npictures really remind me of that old weirdness, so it could be\nworth to do some research about what really happens there.\n\n\n\n\n-schorsch\n\n\n\n\n<NAME> -- simulations developer -- schorsch at schorsch com\n+schorsch.com+ -- lighting design tools -- http://www.schorsch.com/\n___\n<sup>Automatically generated content from [radiance mailing-list](https://radiance-online.org/pipermail/radiance-general/2003-September/000977.html).</sup>", "attachments": [], "created_by_name": "<NAME>", "created_at": "September 12, 2003 at 05:28PM", "created_by": "Georg_Mischler", "parent_id": "radiance-general_000963", "id": "radiance-general_000977"} | json |
<gh_stars>0
var CatDancer = function(top, left, timeBetweenSteps) {
this.gifs = [
// second argument is the BPMs.
['assets/images/cat1.gif', 2],
['assets/images/cat2.gif', 2],
['assets/images/cat3.gif', 4],
['assets/images/cat4.gif', 2],
['assets/images/cat5.gif', 2],
['assets/images/cat6.gif', 2],
];
GifDancer.call(this, top, left, timeBetweenSteps);
};
CatDancer.prototype = Object.create(Dancer.prototype);
CatDancer.prototype.constructor = CatDancer;
| javascript |
Ole Gunnar Solskjaer hailed Manchester United’s progress over the past year after a 2-1 win over Aston Villa took them level on points with Liverpool at the top of the Premier League.
A year ago to the day, United lost 2-0 at Arsenal to fall 24 points behind the English champions, having played two games more.
Another season contending just for a top-four finish looked in store for Solskjaer’s men after winning only two of their opening six league games.
But as all the other contenders have stumbled in recent weeks, the Red Devils have now taken 26 from a possible 30 points to mount an unexpected title challenge.
“Of course we are happy with what we are doing. We have shown we have improved a lot in a year,” said Solskjaer.
Bruno Fernandes has been the key figure in transforming United’s fortunes over the past 12 months and the Portuguese again provided the winner to edge out a rapidly improving Villa side.
Solskjaer’s side needed a 93rd minute winner to beat Wolves on Tuesday, but were far faster out the blocks this time round.
Anthony Martial forced Emiliano Martinez into an excellent save high to his left inside 10 minutes before Fred, Paul Pogba and Fernandes fired efforts just off target.
The breakthrough came five minutes before the break and owed much to Pogba’s ingenuity with the Frenchman finally starting to find form despite the speculation over his future.
Pogba and Marcus Rashford combined to send Aaron Wan-Bissaka free down the right and his cross was headed home by Martial at the near post.
Villa were on a five-game unbeaten run themselves to earn a place in the top six and showed why with their start to the second-half as United were forced back.
Jack Grealish was again at the heart of all the visitors’ best work going forward and it was from his cross that Bertrand Traore equalised.
However, Dean Smith’s men quickly undid their good work as a soft challenge from Douglas Luiz on Pogba was deemed enough for a penalty by referee Michael Oliver.
Fernandes’s near-perfect penalty record continued as he slotted the spot-kick just out of the reach of Martinez for his 15th goal of the season.
United needed a big save from David De Gea to deny Matty Cash and a brave block from Eric Baily in stoppage time to hang on and Solskjaer is not getting carried away with talk of challenging for the title ahead of a trip to Liverpool in two weeks’ time.
“It’s early on in the season and we shouldn’t be carried away,” added the Norwegian. “The league this season is going to be so tight.
Earlier, Everton missed the chance to close to within a point of the top two as they were beaten 1-0 at home by West Ham.
The Toffees failed to impose themselves on a West Ham side playing their third game in six days and were punished when Tomas Soucek slotted home the winner four minutes from time.
“It was not a good game,” said Everton boss Carlo Ancelotti.
David Moyes’s men had the toughest festive fixture schedule in the Premier League in terms of rest and he said there has been a change in mindset with the Hammers this season to battle through adversity.
“The players have played three games in six games, they are amazing,” said Moyes, who won for the first time as a visiting manager at Goodison Park, where he made his name in 11 years in charge of Everton.
Victory took West Ham to within three points of third, although they remain in 10th in a tight Premier League table.
| english |
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "net/cert/internal/parse_name.h"
#include "net/cert/internal/test_helpers.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace net {
namespace {
// Loads test data from file. The filename is constructed from the parameters:
// |prefix| describes the type of data being tested, e.g. "ascii",
// "unicode_bmp", "unicode_supplementary", and "invalid".
// |value_type| indicates what ASN.1 type is used to encode the data.
// |suffix| indicates any additional modifications, such as caseswapping,
// whitespace adding, etc.
::testing::AssertionResult LoadTestData(const std::string& prefix,
const std::string& value_type,
const std::string& suffix,
std::string* result) {
std::string path = "net/data/verify_name_match_unittest/names/" + prefix +
"-" + value_type + "-" + suffix + ".pem";
const PemBlockMapping mappings[] = {
{"NAME", result},
};
return ReadTestDataFromPemFile(path, mappings);
}
}
TEST(ParseNameTest, ConvertBmpString) {
const uint8_t der[] = {
0x00, 0x66, 0x00, 0x6f, 0x00, 0x6f, 0x00, 0x62, 0x00, 0x61, 0x00, 0x72,
};
X509NameAttribute value(der::Input(), der::kBmpString, der::Input(der));
std::string result;
ASSERT_TRUE(value.ValueAsStringUnsafe(&result));
ASSERT_EQ("foobar", result);
}
// BmpString must encode characters in pairs of 2 bytes.
TEST(ParseNameTest, ConvertInvalidBmpString) {
const uint8_t der[] = {0x66, 0x6f, 0x6f, 0x62, 0x61, 0x72, 0x72};
X509NameAttribute value(der::Input(), der::kBmpString, der::Input(der));
std::string result;
ASSERT_FALSE(value.ValueAsStringUnsafe(&result));
}
TEST(ParseNameTest, ConvertUniversalString) {
const uint8_t der[] = {0x00, 0x00, 0x00, 0x66, 0x00, 0x00, 0x00, 0x6f,
0x00, 0x00, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x62,
0x00, 0x00, 0x00, 0x61, 0x00, 0x00, 0x00, 0x72};
X509NameAttribute value(der::Input(), der::kUniversalString, der::Input(der));
std::string result;
ASSERT_TRUE(value.ValueAsStringUnsafe(&result));
}
// UniversalString must encode characters in pairs of 4 bytes.
TEST(ParseNameTest, ConvertInvalidUniversalString) {
const uint8_t der[] = {0x66, 0x6f, 0x6f, 0x62, 0x61, 0x72};
X509NameAttribute value(der::Input(), der::kUniversalString, der::Input(der));
std::string result;
ASSERT_FALSE(value.ValueAsStringUnsafe(&result));
}
TEST(ParseNameTest, EmptyName) {
const uint8_t der[] = {0x30, 0x00};
der::Input rdn(der);
RDNSequence atv;
ASSERT_TRUE(ParseName(rdn, &atv));
ASSERT_EQ(0u, atv.size());
}
TEST(ParseNameTest, ValidName) {
const uint8_t der[] = {0x30, 0x3c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55,
0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x14, 0x30,
0x12, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0b, 0x47,
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x20, 0x49, 0x6e, 0x63,
0x2e, 0x31, 0x17, 0x30, 0x15, 0x06, 0x03, 0x55, 0x04,
0x03, 0x13, 0x0e, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x43, 0x41};
der::Input rdn(der);
RDNSequence atv;
ASSERT_TRUE(ParseName(rdn, &atv));
ASSERT_EQ(3u, atv.size());
ASSERT_EQ(1u, atv[0].size());
ASSERT_EQ(TypeCountryNameOid(), atv[0][0].type);
ASSERT_EQ("US", atv[0][0].value.AsString());
ASSERT_EQ(1u, atv[1].size());
ASSERT_EQ(TypeOrganizationNameOid(), atv[1][0].type);
ASSERT_EQ("Google Inc.", atv[1][0].value.AsString());
ASSERT_EQ(1u, atv[2].size());
ASSERT_EQ(TypeCommonNameOid(), atv[2][0].type);
ASSERT_EQ("Google Test CA", atv[2][0].value.AsString());
}
TEST(ParseNameTest, InvalidNameExtraData) {
std::string invalid;
ASSERT_TRUE(
LoadTestData("invalid", "AttributeTypeAndValue", "extradata", &invalid));
RDNSequence atv;
ASSERT_FALSE(ParseName(SequenceValueFromString(&invalid), &atv));
}
TEST(ParseNameTest, InvalidNameEmpty) {
std::string invalid;
ASSERT_TRUE(
LoadTestData("invalid", "AttributeTypeAndValue", "empty", &invalid));
RDNSequence atv;
ASSERT_FALSE(ParseName(SequenceValueFromString(&invalid), &atv));
}
TEST(ParseNameTest, InvalidNameBadType) {
std::string invalid;
ASSERT_TRUE(LoadTestData("invalid", "AttributeTypeAndValue",
"badAttributeType", &invalid));
RDNSequence atv;
ASSERT_FALSE(ParseName(SequenceValueFromString(&invalid), &atv));
}
TEST(ParseNameTest, InvalidNameNotSequence) {
std::string invalid;
ASSERT_TRUE(LoadTestData("invalid", "AttributeTypeAndValue", "setNotSequence",
&invalid));
RDNSequence atv;
ASSERT_FALSE(ParseName(SequenceValueFromString(&invalid), &atv));
}
TEST(ParseNameTest, InvalidNameNotSet) {
std::string invalid;
ASSERT_TRUE(LoadTestData("invalid", "RDN", "sequenceInsteadOfSet", &invalid));
RDNSequence atv;
ASSERT_FALSE(ParseName(SequenceValueFromString(&invalid), &atv));
}
TEST(ParseNameTest, InvalidNameEmptyRdn) {
std::string invalid;
ASSERT_TRUE(LoadTestData("invalid", "RDN", "empty", &invalid));
RDNSequence atv;
ASSERT_FALSE(ParseName(SequenceValueFromString(&invalid), &atv));
}
TEST(ParseNameTest, RFC2253FormatBasic) {
const uint8_t der[] = {0x30, 0x3b, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55,
0x04, 0x06, 0x13, 0x02, 0x47, 0x42, 0x31, 0x16, 0x30,
0x14, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0d, 0x49,
0x73, 0x6f, 0x64, 0x65, 0x20, 0x4c, 0x69, 0x6d, 0x69,
0x74, 0x65, 0x64, 0x31, 0x14, 0x30, 0x12, 0x06, 0x03,
0x55, 0x04, 0x03, 0x13, 0x0b, 0x53, 0x74, 0x65, 0x76,
0x65, 0x20, 0x4b, 0x69, 0x6c, 0x6c, 0x65};
der::Input rdn_input(der);
RDNSequence rdn;
ASSERT_TRUE(ParseName(rdn_input, &rdn));
std::string output;
ASSERT_TRUE(ConvertToRFC2253(rdn, &output));
ASSERT_EQ("CN=<NAME>,O=Isode Limited,C=GB", output);
}
TEST(ParseNameTest, RFC2253FormatMultiRDN) {
const uint8_t der[] = {
0x30, 0x44, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13,
0x02, 0x55, 0x53, 0x31, 0x14, 0x30, 0x12, 0x06, 0x03, 0x55, 0x04, 0x0a,
0x13, 0x0b, 0x57, 0x69, 0x64, 0x67, 0x65, 0x74, 0x20, 0x49, 0x6e, 0x63,
0x2e, 0x31, 0x1f, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x05,
0x53, 0x61, 0x6c, 0x65, 0x73, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x03,
0x13, 0x08, 0x4a, 0x2e, 0x20, 0x53, 0x6d, 0x69, 0x74, 0x68};
der::Input rdn_input(der);
RDNSequence rdn;
ASSERT_TRUE(ParseName(rdn_input, &rdn));
std::string output;
ASSERT_TRUE(ConvertToRFC2253(rdn, &output));
ASSERT_EQ("OU=Sales+CN=J. Smith,O=Widget Inc.,C=US", output);
}
TEST(ParseNameTest, RFC2253FormatQuoted) {
const uint8_t der[] = {
0x30, 0x40, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06,
0x13, 0x02, 0x47, 0x42, 0x31, 0x1e, 0x30, 0x1c, 0x06, 0x03, 0x55,
0x04, 0x0a, 0x13, 0x15, 0x53, 0x75, 0x65, 0x2c, 0x20, 0x47, 0x72,
0x61, 0x62, 0x62, 0x69, 0x74, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x52,
0x75, 0x6e, 0x6e, 0x31, 0x11, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04,
0x03, 0x13, 0x08, 0x4c, 0x2e, 0x20, 0x45, 0x61, 0x67, 0x6c, 0x65};
der::Input rdn_input(der);
RDNSequence rdn;
ASSERT_TRUE(ParseName(rdn_input, &rdn));
std::string output;
ASSERT_TRUE(ConvertToRFC2253(rdn, &output));
ASSERT_EQ("CN=L. Eagle,O=Sue\\, Grabbit and Runn,C=GB", output);
}
TEST(ParseNameTest, RFC2253FormatNonPrintable) {
const uint8_t der[] = {0x30, 0x33, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55,
0x04, 0x06, 0x13, 0x02, 0x47, 0x42, 0x31, 0x0d, 0x30,
0x0b, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x04, 0x54,
0x65, 0x73, 0x74, 0x31, 0x15, 0x30, 0x13, 0x06, 0x03,
0x55, 0x04, 0x03, 0x13, 0x0c, 0x42, 0x65, 0x66, 0x6f,
0x72, 0x65, 0x0d, 0x41, 0x66, 0x74, 0x65, 0x72};
der::Input rdn_input(der);
RDNSequence rdn;
ASSERT_TRUE(ParseName(rdn_input, &rdn));
std::string output;
ASSERT_TRUE(ConvertToRFC2253(rdn, &output));
ASSERT_EQ("CN=Before\\0DAfter,O=Test,C=GB", output);
}
TEST(ParseNameTest, RFC2253FormatUnknownOid) {
const uint8_t der[] = {0x30, 0x30, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55,
0x04, 0x06, 0x13, 0x02, 0x47, 0x42, 0x31, 0x0d, 0x30,
0x0b, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x04, 0x54,
0x65, 0x73, 0x74, 0x31, 0x12, 0x30, 0x10, 0x06, 0x08,
0x2b, 0x06, 0x01, 0x04, 0x01, 0x8b, 0x3a, 0x00, 0x13,
0x04, 0x04, 0x02, 0x48, 0x69};
der::Input rdn_input(der);
RDNSequence rdn;
ASSERT_TRUE(ParseName(rdn_input, &rdn));
std::string output;
ASSERT_TRUE(ConvertToRFC2253(rdn, &output));
ASSERT_EQ("1.3.6.1.4.1.1466.0=#04024869,O=Test,C=GB", output);
}
TEST(ParseNameTest, RFC2253FormatLargeOid) {
const uint8_t der[] = {0x30, 0x16, 0x31, 0x14, 0x30, 0x12, 0x06, 0x0a,
0x81, 0x0d, 0x06, 0x01, 0x99, 0x21, 0x01, 0x8b,
0x3a, 0x00, 0x13, 0x04, 0x74, 0x65, 0x73, 0x74};
der::Input rdn_input(der);
RDNSequence rdn;
ASSERT_TRUE(ParseName(rdn_input, &rdn));
std::string output;
ASSERT_TRUE(ConvertToRFC2253(rdn, &output));
ASSERT_EQ("2.61.6.1.3233.1.1466.0=#74657374", output);
}
TEST(ParseNameTest, RFC2253FormatUTF8) {
const uint8_t der[] = {0x30, 0x12, 0x31, 0x10, 0x30, 0x0e, 0x06,
0x03, 0x55, 0x04, 0x04, 0x13, 0x07, 0x4c,
0x75, 0xc4, 0x8d, 0x69, 0xc4, 0x87};
der::Input rdn_input(der);
RDNSequence rdn;
ASSERT_TRUE(ParseName(rdn_input, &rdn));
std::string output;
ASSERT_TRUE(ConvertToRFC2253(rdn, &output));
ASSERT_EQ("SN=Lu\\C4\\8Di\\C4\\87", output);
}
} // namespace net
| cpp |
<filename>manifest.json<gh_stars>0
{
"manifest_version": 2,
"name": "Extension Boilerplate",
"description": "A boilerplate repo for chrome extensions.",
"version": "0.1",
"browser_action": {
"default_icon": "icon32.png",
"default_popup": "popup.html",
"default_title": "Click to open extension"
},
"permissions": [
"tabs","storage","contextMenus"
],
"icons": {
"16": "icon16.png",
"32": "icon32.png",
"48": "icon48.png",
"128": "icon128.png"
},
"background": {
"scripts": ["background.js"],
"persistent": false
},
"content_scripts": [
{
"matches": ["<all_urls>"],
"js": ["jquery.js", "contentScript.js"],
"css":["contentScriptStyles.css"],
"run_at": "document_end"
}
]
}
| json |
English golfer Ross McGowan chipped in from a greenside bunker at No. 16 and rolled in a birdie at the last hole to earn a one-stroke victory at the Italian Open on Sunday, securing his first title on the European Tour in 11 years.
McGowan struggled to keep his emotions in check after the final round, after seeing playing partner Laurie Canter miss his own birdie putt on the 18th that would have forced a playoff.
McGowan, whose only other European Tour victory came at the Madrid Masters in 2009, shot 1-under 71 to finish on 20 under overall.
Canter, another Englishman, was looking to clinch a wire-to-wire victory but shot even-par 72 — his worst score of the week. He was the only player in the top 20 to not break par on Sunday, and was tied for second place with Nicolas Colsaerts (68).
| english |
<reponame>kdara20/buildfirst
var fs = require('fs');
var base = require('./base.js');
var template = fs.readFileSync(__dirname + '/templates/sample.mu', { encoding: 'utf8' });
var SampleModel = require('../models/sample.js');
module.exports = base.extend({
el: '.view',
template: template,
initialize: function () {
this.model = new SampleModel();
this.model.on('change', this.updateView, this);
this.model.set('raw', 'https://ponyfoo.com/bf');
},
updateView: function () {
this.viewModel = {
raw: this.model.get('raw'),
binary: this.model.getBinary(),
isLink: this.model.isLink()
};
this.render();
},
events: {
'change .input': 'inputChanged'
},
inputChanged: function (e) {
this.model.set('raw', e.target.value);
}
});
| javascript |
# -*- coding: utf-8 -*-
import re
from Axon.Component import component
from Kamaelia.Util.Backplane import PublishTo, SubscribeTo
from Axon.Ipc import shutdownMicroprocess, producerFinished
from Kamaelia.Protocol.HTTP.HTTPClient import SimpleHTTPClient
from headstock.api.jid import JID
from headstock.api.im import Message, Body
from headstock.api.pubsub import Node, Item, Message
from headstock.api.discovery import *
from headstock.lib.utils import generate_unique
from bridge import Element as E
from bridge.common import XMPP_CLIENT_NS, XMPP_ROSTER_NS, \
XMPP_LAST_NS, XMPP_DISCO_INFO_NS, XMPP_DISCO_ITEMS_NS,\
XMPP_PUBSUB_NS
from amplee.utils import extract_url_trail, get_isodate,\
generate_uuid_uri
from amplee.error import ResourceOperationException
from microblog.atompub.resource import ResourceWrapper
from microblog.jabber.atomhandler import FeedReaderComponent
__all__ = ['DiscoHandler', 'ItemsHandler', 'MessageHandler']
publish_item_rx = re.compile(r'\[(.*)\] ([\w ]*)')
retract_item_rx = re.compile(r'\[(.*)\] ([\w:\-]*)')
geo_rx = re.compile(r'(.*) ([\[\.|\d,|\-\]]*)')
GEORSS_NS = u"http://www.georss.org/georss"
GEORSS_PREFIX = u"georss"
class DiscoHandler(component):
Inboxes = {"inbox" : "",
"control" : "",
"initiate" : "",
"jid" : "",
"error" : "",
"features.result": "",
"items.result": "",
"items.error" : "",
"docreate" : "",
"docreatecollection": "",
"dodelete" : "",
"dounsubscribe" : "",
"dosubscribe" : "",
"subscribed": "",
"subscriptions.result": "",
"affiliations.result": "",
"created": "",
"deleted" : ""}
Outboxes = {"outbox" : "",
"signal" : "Shutdown signal",
"message" : "",
"features-disco": "headstock.api.discovery.FeaturesDiscovery query to the server",
"features-announce": "headstock.api.discovery.FeaturesDiscovery informs"\
"the other components about the features instance received from the server",
"items-disco" : "",
"create-node" : "",
"delete-node" : "",
"subscribe-node" : "",
"unsubscribe-node" : "",
"subscriptions-disco": "",
"affiliations-disco" : ""}
def __init__(self, from_jid, atompub, host='localhost', session_id=None, profile=None):
super(DiscoHandler, self).__init__()
self.from_jid = from_jid
self.atompub = atompub
self.xmpphost = host
self.session_id = session_id
self.profile = profile
self._collection = None
self.pubsub_top_level_node = u'home/%s/%s' % (self.xmpphost, self.from_jid.node)
@property
def collection(self):
# Lazy loading of collection
if not self._collection:
self._collection = self.atompub.get_collection(self.profile.username)
return self._collection
def initComponents(self):
sub = SubscribeTo("JID.%s" % self.session_id)
self.link((sub, 'outbox'), (self, 'jid'))
self.addChildren(sub)
sub.activate()
pub = PublishTo("DISCO_FEAT.%s" % self.session_id)
self.link((self, 'features-announce'), (pub, 'inbox'))
self.addChildren(pub)
pub.activate()
sub = SubscribeTo("BOUND.%s" % self.session_id)
self.link((sub, 'outbox'), (self, 'initiate'))
self.addChildren(sub)
sub.activate()
return 1
def main(self):
yield self.initComponents()
while 1:
if self.dataReady("control"):
mes = self.recv("control")
if isinstance(mes, shutdownMicroprocess) or isinstance(mes, producerFinished):
self.send(producerFinished(), "signal")
break
if self.dataReady("jid"):
self.from_jid = self.recv('jid')
self.pubsub_top_level_node = u'home/%s/%s' % (self.xmpphost, self.from_jid.node)
if self.dataReady("initiate"):
self.recv("initiate")
p = Node(unicode(self.from_jid), u'pubsub.%s' % self.xmpphost,
node_name=self.pubsub_top_level_node)
self.send(p, "create-node")
yield 1
#d = FeaturesDiscovery(unicode(self.from_jid), u'pubsub.%s' % self.xmpphost)
#self.send(d, "features-disco")
d = SubscriptionsDiscovery(unicode(self.from_jid), u'pubsub.%s' % self.xmpphost)
self.send(d, "subscriptions-disco")
d = AffiliationsDiscovery(unicode(self.from_jid), u'pubsub.%s' % self.xmpphost)
self.send(d, "affiliations-disco")
n = ItemsDiscovery(unicode(self.from_jid), u'pubsub.%s' % self.xmpphost,
node_name=self.pubsub_top_level_node)
self.send(n, "items-disco")
# The response to our discovery query
# is a a headstock.api.discovery.FeaturesDiscovery instance.
# What we immediatly do is to notify all handlers
# interested in that event about it.
if self.dataReady('features.result'):
disco = self.recv('features.result')
for feature in disco.features:
print " ", feature.var
self.send(disco, 'features-announce')
if self.dataReady('items.result'):
items = self.recv('items.result')
print "%s has %d item(s)" % (items.node_name, len(items.items))
#for item in items.items:
#n = ItemsDiscovery(unicode(self.from_jid), u'pubsub.%s' % self.xmpphost,
# node_name=item.node)
#self.send(n, "items-disco")
if self.dataReady('items.error'):
items_disco = self.recv('items.error')
print "DISCO ERROR: ", items_disco.node_name, items_disco.error
if items_disco.error.condition == 'item-not-found':
p = Node(unicode(self.from_jid), u'pubsub.%s' % self.xmpphost,
node_name=items_disco.node_name)
self.send(p, "create-node")
yield 1
if self.dataReady('subscriptions.result'):
subscriptions = self.recv('subscriptions.result')
for sub in subscriptions.subscriptions:
print "Subscription: %s (%s)" % (sub.node, sub.state)
if self.dataReady('affiliations.result'):
affiliations = self.recv('affiliations.result')
for aff in affiliations.affiliations:
print "Affiliation: %s %s" % (aff.node, aff.affiliation)
if self.dataReady('docreate'):
nodeid = self.recv('docreate').strip()
p = Node(unicode(self.from_jid), u'pubsub.%s' % self.xmpphost,
node_name=nodeid)
self.send(p, "create-node")
if self.dataReady('docreatecollection'):
nodeid = self.recv('docreatecollection').strip()
p = Node(unicode(self.from_jid), u'pubsub.%s' % self.xmpphost,
node_name=nodeid)
p.set_default_collection_conf()
self.send(p, "create-node")
if self.dataReady('dodelete'):
nodeid = self.recv('dodelete').strip()
p = Node(unicode(self.from_jid), u'pubsub.%s' % self.xmpphost,
node_name=nodeid)
self.send(p, "delete-node")
if self.dataReady('dosubscribe'):
nodeid = self.recv('dosubscribe').strip()
p = Node(unicode(self.from_jid), u'pubsub.%s' % self.xmpphost,
node_name=nodeid, sub_jid=self.from_jid.nodeid())
self.send(p, "subscribe-node")
if self.dataReady('dounsubscribe'):
nodeid = self.recv('dounsubscribe').strip()
p = Node(unicode(self.from_jid), u'pubsub.%s' % self.xmpphost,
node_name=nodeid, sub_jid=self.from_jid.nodeid())
self.send(p, "unsubscribe-node")
if self.dataReady('created'):
node = self.recv('created')
print "Node created: %s" % node.node_name
p = Node(unicode(self.from_jid), u'pubsub.%s' % self.xmpphost,
node_name=node.node_name, sub_jid=self.from_jid.nodeid())
self.send(p, "subscribe-node")
if self.dataReady('subscribed'):
node = self.recv('subscribed')
print "Node subscribed: %s" % node.node_name
if self.dataReady('deleted'):
node = self.recv('deleted')
print "Node deleted: %s" % node.node_name
if self.dataReady('error'):
node = self.recv('error')
print node.error
if not self.anyReady():
self.pause()
yield 1
class ItemsHandler(component):
Inboxes = {"inbox" : "",
"topublish" : "",
"todelete" : "",
"topurge": "",
"control" : "",
"xmpp.result": "",
"published": "",
"publish.error": "",
"retract.error": "",
"jid" : "",
"_feedresponse": "",
"_delresponse": ""}
Outboxes = {"outbox" : "",
"publish" : "",
"delete" : "",
"purge" : "",
"signal" : "Shutdown signal",
"_feedrequest": "",
"_delrequest": ""}
def __init__(self, from_jid, atompub, host='localhost', session_id=None, profile=None):
super(ItemsHandler, self).__init__()
self.from_jid = from_jid
self.atompub = atompub
self.xmpphost = host
self.session_id = session_id
self.profile = profile
self._collection = None
self.pubsub_top_level_node = u'home/%s/%s' % (self.xmpphost, self.from_jid.node)
@property
def collection(self):
# Lazy loading of collection
if not self._collection:
self._collection = self.atompub.get_collection(self.profile.username)
return self._collection
def initComponents(self):
sub = SubscribeTo("JID.%s" % self.session_id)
self.link((sub, 'outbox'), (self, 'jid'))
self.addChildren(sub)
sub.activate()
feedreader = FeedReaderComponent(use_etags=False)
self.addChildren(feedreader)
feedreader.activate()
client = SimpleHTTPClient()
self.addChildren(client)
self.link((self, '_feedrequest'), (client, 'inbox'))
self.link((client, 'outbox'), (feedreader, 'inbox'))
self.link((feedreader, 'outbox'), (self, '_feedresponse'))
client.activate()
client = SimpleHTTPClient()
self.addChildren(client)
self.link((self, '_delrequest'), (client, 'inbox'))
self.link((client, 'outbox'), (self, '_delresponse'))
client.activate()
return 1
def make_entry(self, msg, node):
uuid = generate_uuid_uri()
entry = E.load('./entry.atom').xml_root
entry.get_child('id', ns=entry.xml_ns).xml_text = uuid
dt = get_isodate()
entry.get_child('author', ns=entry.xml_ns).get_child('name', ns=entry.xml_ns).xml_text = unicode(self.profile.username)
entry.get_child('published', ns=entry.xml_ns).xml_text = dt
entry.get_child('updated', ns=entry.xml_ns).xml_text = dt
entry.get_child('content', ns=entry.xml_ns).xml_text = unicode(msg)
if node != self.pubsub_top_level_node:
tag = extract_url_trail(node)
E(u'category', namespace=entry.xml_ns, prefix=entry.xml_prefix,
attributes={u'term': unicode(tag)}, parent=entry)
return uuid, entry
def add_geo_point(self, entry, long, lat):
E(u'point', prefix=GEORSS_PREFIX, namespace=GEORSS_NS,
content=u'%s %s' % (unicode(long), unicode(lat)), parent=entry)
def main(self):
yield self.initComponents()
while 1:
if self.dataReady("control"):
mes = self.recv("control")
if isinstance(mes, shutdownMicroprocess) or isinstance(mes, producerFinished):
self.send(producerFinished(), "signal")
break
if self.dataReady("jid"):
self.from_jid = self.recv('jid')
self.pubsub_top_level_node = u'home/%s/%s' % (self.xmpphost, self.from_jid.node)
if self.dataReady("topublish"):
message = self.recv("topublish")
node = self.pubsub_top_level_node
m = geo_rx.match(message)
long = lat = None
if not m:
m = publish_item_rx.match(message)
if m:
node, message = m.groups()
else:
message, long_lat = m.groups()
long, lat = long_lat.strip('[').rstrip(']').split(',')
uuid, entry = self.make_entry(message, node)
if long and lat:
self.add_geo_point(entry, long, lat)
i = Item(id=uuid, payload=entry)
p = Node(unicode(self.from_jid), u'pubsub.%s' % self.xmpphost,
node_name=unicode(node), item=i)
self.send(p, "publish")
yield 1
if self.dataReady("todelete"):
item_id = self.recv("todelete")
node = self.pubsub_top_level_node
m = retract_item_rx.match(item_id)
if m:
node, item_id = m.groups()
i = Item(id=unicode(item_id))
p = Node(unicode(self.from_jid), u'pubsub.%s' % self.xmpphost,
node_name=unicode(node), item=i)
self.send(p, "delete")
yield 1
if self.dataReady("topurge"):
node_id = self.recv("topurge")
p = Node(unicode(self.from_jid), u'pubsub.%s' % self.xmpphost,
node_name=node_id)
self.send(p, "purge")
params = {'url': '%s/feed' % (self.collection.get_base_edit_uri().rstrip('/')),
'method': 'GET'}
self.send(params, '_feedrequest')
if self.dataReady("published"):
node = self.recv("published")
print "Item published: %s" % node
if self.dataReady("publish.error"):
node = self.recv("publish.error")
print node.error
if self.dataReady("retract.error"):
node = self.recv("retract.error")
print node.error
if self.dataReady("_feedresponse"):
feed = self.recv("_feedresponse")
for entry in feed.entries:
for link in entry.links:
if link.rel == 'edit':
params = {'url': link.href, 'method': 'DELETE'}
self.send(params, '_delrequest')
if self.dataReady("_delresponse"):
self.recv("_delresponse")
if not self.anyReady():
self.pause()
yield 1
class MessageHandler(component):
Inboxes = {"inbox" : "",
"control" : "",
"jid" : "",
"_response" : ""}
Outboxes = {"outbox" : "",
"signal" : "Shutdown signal",
"items-disco" : "",
"_request": ""}
def __init__(self, from_jid, atompub, host='localhost', session_id=None, profile=None):
super(MessageHandler, self).__init__()
self.from_jid = from_jid
self.atompub = atompub
self.xmpphost = host
self.session_id = session_id
self.profile = profile
self._collection = None
@property
def collection(self):
# Lazy loading of collection
if not self._collection:
self._collection = self.atompub.get_collection(self.profile.username)
return self._collection
def initComponents(self):
sub = SubscribeTo("JID.%s" % self.session_id)
self.link((sub, 'outbox'), (self, 'jid'))
self.addChildren(sub)
sub.activate()
client = SimpleHTTPClient()
self.addChildren(client)
self.link((self, '_request'), (client, 'inbox'))
self.link((client, 'outbox'), (self, '_response'))
client.activate()
return 1
def main(self):
yield self.initComponents()
while 1:
if self.dataReady("control"):
mes = self.recv("control")
if isinstance(mes, shutdownMicroprocess) or isinstance(mes, producerFinished):
self.send(producerFinished(), "signal")
break
if self.dataReady("jid"):
self.from_jid = self.recv('jid')
if self.dataReady("_response"):
#discard the HTTP response for now
member_entry = self.recv("_response")
if self.dataReady("inbox"):
msg = self.recv("inbox")
collection = self.collection
if collection:
for item in msg.items:
if item.event == 'item' and item.payload:
print "Published item: %s" % item.id
member = collection.get_member(item.id)
if not member:
if isinstance(item.payload, list):
body = item.payload[0].xml()
else:
body = item.payload.xml()
params = {'url': collection.get_base_edit_uri(),
'method': 'POST', 'postbody': body,
'extraheaders': {'content-type': 'application/atom+xml;type=entry',
'content-length': str(len(body)),
'slug': item.id}}
self.send(params, '_request')
elif item.event == 'retract':
print "Removed item: %s" % item.id
params = {'url': '%s/%s' % (collection.get_base_edit_uri().rstrip('/'),
item.id.encode('utf-8')),
'method': 'DELETE'}
self.send(params, '_request')
if not self.anyReady():
self.pause()
yield 1
| python |
/*
*
* Copyright 2017-2018 Nitrite author or 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 org.dizitart.no2.sync;
import lombok.extern.slf4j.Slf4j;
import okhttp3.*;
import org.dizitart.no2.sync.data.UserAgent;
import javax.net.ssl.*;
import java.io.IOException;
import java.net.Proxy;
import java.security.cert.CertificateException;
import java.util.concurrent.TimeUnit;
import static org.dizitart.no2.sync.data.UserAgent.*;
import static org.dizitart.no2.util.StringUtils.isNullOrEmpty;
/**
* Represents a DataGate server client for synchronous access.
*
* @author <NAME>.
* @since 1.0
*/
@Slf4j
public class DataGateClient {
private String serverBaseUrl;
private String username;
private String password;
private Proxy proxy;
private boolean trustAllCerts;
private long readTimeout = 0;
private long connectTimeout = 0;
private UserAgent userAgent;
/**
* Instantiates a new {@link DataGateClient}.
*
* @param serverBaseUrl the server base url
*/
public DataGateClient(String serverBaseUrl) {
this.serverBaseUrl = serverBaseUrl;
}
/**
* Sets user credentials for basic authentication.
*
* @param username the username
* @param password the password
* @return the {@link DataGateClient}
*/
public DataGateClient withAuth(String username, String password) {
this.username = username;
this.password = password;
return this;
}
/**
* Sets the proxy details to connect to DataGate server.
*
* @param proxy the proxy
* @return the {@link DataGateClient}
*/
public DataGateClient withProxy(Proxy proxy) {
this.proxy = proxy;
return this;
}
/**
* Trust all certificates.
*
* @return the {@link DataGateClient}
*/
public DataGateClient trustAllCerts() {
this.trustAllCerts = true;
return this;
}
/**
* Sets the read timeout for the underlying http client.
*
* @param milliseconds the timeout value in milliseconds
* @return the {@link DataGateClient}
*/
public DataGateClient readTimeout(long milliseconds) {
this.readTimeout = milliseconds;
return this;
}
/**
* Sets the connection timeout for the underlying http client.
*
* @param milliseconds the timeout value in milliseconds
* @return the {@link DataGateClient}
*/
public DataGateClient connectTimeout(long milliseconds) {
this.connectTimeout = milliseconds;
return this;
}
/**
* Sets the {@link UserAgent} details. The user agent details
* helps to generate several analytics in DataGate server.
*
* @param userAgent the {@link UserAgent}
* @return the {@link DataGateClient}
*/
public DataGateClient withUserAgent(UserAgent userAgent) {
this.userAgent = userAgent;
return this;
}
/**
* Gets the server base url.
*
* @return the remote url
*/
protected String getServerBaseUrl() {
return serverBaseUrl;
}
/**
* Gets the underlying http client for the server-client communication.
*
* @return the http client
*/
protected OkHttpClient getHttpClient() {
OkHttpClient.Builder clientBuilder = new OkHttpClient.Builder();
if (!isNullOrEmpty(username)) {
clientBuilder.addInterceptor(new Interceptor() {
@Override
public Response intercept(Chain chain) throws IOException {
Request request = chain.request();
Request newRequest;
newRequest = request.newBuilder()
.addHeader("Authorization", Credentials.basic(username, password))
.build();
return chain.proceed(newRequest);
}
});
}
if (userAgent != null) {
clientBuilder.addInterceptor(new Interceptor() {
@Override
public Response intercept(Chain chain) throws IOException {
Request request = chain.request();
Request newRequest;
newRequest = request.newBuilder()
.addHeader(USER_AGENT, userAgent.toString())
.build();
return chain.proceed(newRequest);
}
});
}
if (proxy != null) {
clientBuilder.proxy(proxy);
}
if (trustAllCerts) {
try {
// Create a trust manager that does not validate certificate chains
final X509TrustManager[] trustManagers = new X509TrustManager[]{
new X509TrustManager() {
@Override
public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException {
}
@Override
public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException {
}
@Override
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
return new java.security.cert.X509Certificate[0];
}
}
};
// Install the all-trusting trust manager
final SSLContext sslContext = SSLContext.getInstance("SSL");
sslContext.init(null, trustManagers, new java.security.SecureRandom());
// Create an ssl socket factory with our all-trusting manager
final SSLSocketFactory sslSocketFactory = sslContext.getSocketFactory();
// set ssl socket factory
clientBuilder.sslSocketFactory(sslSocketFactory, trustManagers[0]);
} catch (Exception e) {
log.error("Error while bypassing certificate chains", e);
}
clientBuilder.hostnameVerifier(new HostnameVerifier() {
@Override
public boolean verify(String hostname, SSLSession session) {
return true;
}
});
}
if (readTimeout != 0) {
clientBuilder.readTimeout(readTimeout, TimeUnit.MILLISECONDS);
}
if (connectTimeout != 0) {
clientBuilder.connectTimeout(connectTimeout, TimeUnit.MILLISECONDS);
}
return clientBuilder.build();
}
}
| java |
package routes
import (
"net/http"
"github.com/labstack/echo"
)
// Healthcheck returns WORKING! if the API is up and running
func Healthcheck(c echo.Context) error {
return c.JSON(http.StatusOK, "WORKING")
}
| go |
<filename>dist/packages/material/progress-bar/progress-bar.metadata.json
[{"__symbolic":"module","version":4,"metadata":{"MatProgressBarBase":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":36,"character":34}]}]}},"ProgressAnimationEnd":{"__symbolic":"interface"},"_MatProgressBarMixinBase":{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/material/core","name":"mixinColor","line":45,"character":4},"arguments":[{"__symbolic":"reference","name":"MatProgressBarBase"},"primary"]},"MAT_PROGRESS_BAR_LOCATION":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":52,"character":45},"arguments":["mat-progress-bar-location",{"providedIn":"root","factory":{"__symbolic":"reference","name":"MAT_PROGRESS_BAR_LOCATION_FACTORY"}}]},"MatProgressBarLocation":{"__symbolic":"interface"},"MAT_PROGRESS_BAR_LOCATION_FACTORY":{"__symbolic":"function"},"MatProgressBar":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"_MatProgressBarMixinBase"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":84,"character":1},"arguments":[{"moduleId":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"module"},"member":"id"},"selector":"mat-progress-bar","exportAs":"matProgressBar","host":{"role":"progressbar","aria-valuemin":"0","aria-valuemax":"100","[attr.aria-valuenow]":"value","[attr.mode]":"mode","class":"mat-progress-bar","[class._mat-animation-noopable]":"_isNoopAnimation","$quoted$":["role","aria-valuemin","aria-valuemax","[attr.aria-valuenow]","[attr.mode]","class","[class._mat-animation-noopable]"]},"inputs":["color"],"templateUrl":"progress-bar.html","styleUrls":["progress-bar.css"],"changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy","line":100,"character":19},"member":"OnPush"},"encapsulation":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewEncapsulation","line":101,"character":17},"member":"None"}}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":106,"character":15}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":106,"character":27},"arguments":[{"__symbolic":"reference","module":"@angular/platform-browser/animations","name":"ANIMATION_MODULE_TYPE","line":106,"character":34}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":111,"character":15}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":111,"character":27},"arguments":[{"__symbolic":"reference","name":"MAT_PROGRESS_BAR_LOCATION"}]}]],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":36,"character":34},{"__symbolic":"reference","module":"@angular/core","name":"NgZone","line":105,"character":63},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","name":"any"}]}],"value":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":130,"character":3}}]}],"bufferValue":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":143,"character":3}}]}],"_primaryValueBar":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":148,"character":3},"arguments":["primaryValueBar"]}]}],"animationEnd":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":155,"character":3}}]}],"mode":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":167,"character":3}}]}],"_primaryTransform":[{"__symbolic":"method"}],"_bufferTransform":[{"__symbolic":"method"}],"ngAfterViewInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"emitAnimationEnd":[{"__symbolic":"method"}]}}},"importAs":"@angular/material/progress-bar"}] | json |
A pair of England matches against India and Australia scheduled to be held in Durham over the next two years have been reallocated.
India were due to play a Twenty20 fixture against England at Durham in 2014, while Australia had been set to visit north-east England to face the host nation in a One-Day International (ODI) in 2015.
But Durham chiefs made it known they would be willing to forego the fixtures after a review for their major match policy following poor ticket sales for some internationals.
The England and Wales Cricket Board (ECB) have therefore decided to move the India match to Edgbaston, the Birmingham venue which staged the ICC Champions Trophy 2013 final between the teams which India won.
England’s meeting with arch rivals Australia will now take place at Old Trafford in Manchester.
Durham will still stage an Ashes Test between England and Australia for the first time later this year, following that with limited overs matches against Sri Lanka in 2014 and New Zealand in 2015 before Sri Lanka return for a Test in 2016.
Warwickshire chief executive Colin Povey added: “England have a fantastic record at Edgbaston and we’re thrilled to welcome them back to Birmingham, where they’ll certainly be looking to avenge their recent ICC Champions Trophy final defeat when the they meet India again in this NatWest Series T20 International.
| english |
@charset "utf-8";
/* CSS Document */
@import url('https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@300&display=swap');
body {
background: #fff;
font-family: 'Roboto Condensed', sans-serif;
direction: rtl;
padding-top: 60px;
font-size: 14px;
font-weight: 400;
background: #FFFFFF;
color: #000000
}
h3{
font-family: 'Roboto Condensed', sans-serif;
}
footer > div > a > h3{
color: #febd69;
}
.fit-Nimage{
width: 600px;
object-fit: cover;
height: 150px;
background-size: cover;
position: center;
}
.fit-pop-image{
width: 1600px;
object-fit: cover;
height: 308px;
background-size: cover;
position: center;
}
.toggler-direction{
direction: rtl;
}
.custom-image-setting{
width: 150px;
height: 150px;
position: sticky;
}
.button-placement {
display: block;
width: 100%;
margin-bottom: 20px;
text-align: right; }
.carousel-item .product-block {
border: 1px solid #222;
padding: 0px;
text-align: center; }
.carousel-item .product-block h4 {
text-align: center; }
.carousel-item .product-block a {
margin: 0 0 20px; }
@media screen and (min-width: 320px) and (max-width: 767px) {
.carousel-item .product-block {
margin: 0 15px; }
.carousel-title {
font-size: 18px;
margin-top: 20px; } }
div.button-placement a{
background-color: #152023;
color: #ffffff;
}
div.button-placement a:hover{
background-color: #152023;
color: #febd69;
}
div.product-block div.row{
direction: rtl;
}
div.product-block div.row div a.btn-success{
border-radius: 16px;
color: #152023;
background-color: #febd69;
}
div.product-block div.row div a.btn-success:hover{
border-radius: 16px;
color: #365159;
background-color: #db7c01;
}
div.product-block div.row div a.btn-danger{
background: #152023;
color: #ffffff;
border-color: #152023;
border-radius: 16px;
}
div.product-block div.row div a.btn-danger:hover{
background-color: #365159;
color: #febd69;
border-color: #365159;
border-radius: 16px;
}
.row{
direction: rtl;
}
.footer-part {
padding: 20px 0 0;
background: #152023;
text-align: right;
}
.footer-part p {
font-style: italic;
margin-bottom: 40px;
font-family: 'Roboto Condensed', sans-serif;
}
.footer-logo {
display: inline-block;
margin-bottom: 50px;
}
.footer-fix {
margin-bottom: 50px;
}
.footer-fix h2 {
font-size: 18px;
font-weight: 700;
margin-bottom: 30px;
color: #fff;
}
.footer-fix ul {
list-style: none;
}
.footer-fix ul li a {
display: inline-block;
font-size: 14px;
color: #ffffff;
margin-bottom: 15px;
}
.footer-logo:hover{
background-color: #365159;
}
.footerDir{
text-align: right;
direction: rtl;
}
footer div p {
color: #ffffff;
}
.copy-right {
color: #74757b;
font-size: 14px;
padding-bottom: 20px;
}
.copy-right i {
color: #febd69;
}
.copy-right a {
color: #74757b;
}
.copy-right a:hover {
color: #febd69;
}
footer > div > a > h3{
color: #febd69;
}
.searchOpt1{
text-align: left;
}
.vl {
color: #ffffff;
}
.wrappers{
width:100px;
margin:0 auto;
position: relative;
}
.wrapper{
width:260px;
margin:0 auto;
position: relative;
}
@media (min-width:1020px) and (max-width:1100px){
div > form > .size{
max-width: 150px;
width: 150px;
min-width: 150px;
}
}
@media (max-width: 1020px){
div > form > .size{
max-width: 100px;
width: 100px;
min-width: 100px;
}
}
.navbar {
background-color: #232f3e;
font-size: 16px;
}
.navbar .navbar-brand {
color: #febd69;
}
.navbar .navbar-brand:hover,
.navbar .navbar-brand:focus {
color: #febd69;
}
.navbar .navbar-text {
color: #ffffff;
}
.navbar .navbar-text a {
color: #febd69;
}
.navbar .navbar-text a:hover,
.navbar .navbar-text a:focus {
color: #febd69;
}
.navbar .navbar-nav .nav-link {
color: #ffffff;
border-radius: .25rem;
margin: 0 0.25em;
}
.navbar .navbar-nav .nav-link:not(.disabled):hover,
.navbar .navbar-nav .nav-link:not(.disabled):focus {
color: #febd69;
background: rgba(255, 255, 255, 0.2);
}
.navbar .navbar-nav .dropdown-menu {
background-color: #232f3e;
border-color: #ffffff;
}
.navbar .navbar-nav .dropdown-menu .dropdown-item {
color: #ffffff;
}
.navbar .navbar-nav .dropdown-menu .dropdown-item:hover,
.navbar .navbar-nav .dropdown-menu .dropdown-item:focus,
.navbar .navbar-nav .dropdown-menu .dropdown-item.active {
color: #febd69;
background-color: #152023;
}
.navbar .navbar-nav .dropdown-menu .dropdown-divider {
border-top-color: #ffffff;
}
.navbar .navbar-nav .nav-item.active .nav-link,
.navbar .navbar-nav .nav-item.active .nav-link:hover,
.navbar .navbar-nav .nav-item.active .nav-link:focus,
.navbar .navbar-nav .nav-item.show .nav-link,
.navbar .navbar-nav .nav-item.show .nav-link:hover,
.navbar .navbar-nav .nav-item.show .nav-link:focus {
color: #febd69;
background-color: #152023;
}
.navbar .navbar-toggle {
border-color: #152023;
}
.navbar .navbar-toggle:hover,
.navbar .navbar-toggle:focus {
background-color: #152023;
}
.navbar .navbar-toggle .navbar-toggler-icon {
color: #ffffff;
}
.navbar .navbar-collapse,
.navbar .navbar-form {
border-color: #ffffff;
}
.navbar .navbar-link {
color: #ffffff;
}
.navbar .navbar-link:hover {
color: #febd69;
}
@media (max-width: 575px) {
.navbar-expand-sm .navbar-nav .show .dropdown-menu .dropdown-item {
color: #ffffff;
}
.navbar-expand-sm .navbar-nav .show .dropdown-menu .dropdown-item:hover,
.navbar-expand-sm .navbar-nav .show .dropdown-menu .dropdown-item:focus {
color: #febd69;
}
.navbar-expand-sm .navbar-nav .show .dropdown-menu .dropdown-item.active {
color: #febd69;
background-color: #152023;
}
}
@media (max-width: 767px) {
.navbar-expand-md .navbar-nav .show .dropdown-menu .dropdown-item {
color: #ffffff;
}
.navbar-expand-md .navbar-nav .show .dropdown-menu .dropdown-item:hover,
.navbar-expand-md .navbar-nav .show .dropdown-menu .dropdown-item:focus {
color: #febd69;
}
.navbar-expand-md .navbar-nav .show .dropdown-menu .dropdown-item.active {
color: #febd69;
background-color: #152023;
}
}
@media (max-width: 991px) {
.navbar-expand-lg .navbar-nav .show .dropdown-menu .dropdown-item {
color: #ffffff;
}
.navbar-expand-lg .navbar-nav .show .dropdown-menu .dropdown-item:hover,
.navbar-expand-lg .navbar-nav .show .dropdown-menu .dropdown-item:focus {
color: #febd69;
}
.navbar-expand-lg .navbar-nav .show .dropdown-menu .dropdown-item.active {
color: #febd69;
background-color: #152023;
}
}
@media (max-width: 1199px) {
.navbar-expand-xl .navbar-nav .show .dropdown-menu .dropdown-item {
color: #ffffff;
}
.navbar-expand-xl .navbar-nav .show .dropdown-menu .dropdown-item:hover,
.navbar-expand-xl .navbar-nav .show .dropdown-menu .dropdown-item:focus {
color: #febd69;
}
.navbar-expand-xl .navbar-nav .show .dropdown-menu .dropdown-item.active {
color: #febd69;
background-color: #152023;
}
}
.navbar-expand .navbar-nav .show .dropdown-menu .dropdown-item {
color: #ffffff;
}
.navbar-expand .navbar-nav .show .dropdown-menu .dropdown-item:hover,
.navbar-expand .navbar-nav .show .dropdown-menu .dropdown-item:focus {
color: #febd69;
}
.navbar-expand .navbar-nav .show .dropdown-menu .dropdown-item.active {
color: #febd69;
background-color: #152023;
}
.navSearchButton{
color:#ffffff;
border-color: #ffffff;
background-color: #232f3e;
border-radius: 20px;
}
.navSearchButton:hover{
background-color: #232f3e;
color: #febd69;
border-color: #febd69;
cursor: pointer;
border-radius: 16px;
}
.custom-toggler .navbar-toggler-icon {
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255,255,255, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 8h24M4 16h24M4 24h24'/%3E%3C/svg%3E");
}
.custom-toggler.navbar-toggler {
border-color: #ffffff;
}
.custom-toggler.navbar-toggler:hover{
border-color: #febd69;
}
button:hover > .navbar-toggler-icon {
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(254,189,105, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 8h24M4 16h24M4 24h24'/%3E%3C/svg%3E");
}
.navBlurp{
direction: rtl;
text-align: right;
}
.colorBlurp{
color: #ffffff;
background-color: #232f3e;
border-color: #152023;
}
.colorBlurp2{
color: #ffffff;
background-color: #232f3e;
border-color: #152023;
}
.colorBlurp:hover{
color: #febd69;
background-color: #232f3e;
border-color: #152023;
}
.nav-tabs .nav-link.active {
color: #ffffff;
background-color: #365159;
border-color: #365159;
}
.nav-tabs .nav-link.active:hover {
color: #febd69;
background-color: #365159;
border-color: #365159;
}
.breadcrumb-item+.breadcrumb-item::before {
content: ">"
}
.breadcrumb {
display: -ms-flexbox;
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
padding: .1rem 0rem !important;
margin-bottom: 0rem;
list-style: none;
background-color: #ffffff;
border-radius: .25rem
}
.single_product {
padding-top: 66px;
padding-bottom: 140px;
margin-top: 0px;
padding: 17px;
}
.product_name {
font-size: 20px;
font-weight: 400;
margin-top: 0px;
text-align: right;
}
.badge {
display: inline-block;
padding: 0.50em .4em;
font-size: 75%;
font-weight: 700;
line-height: 1;
text-align: center;
white-space: nowrap;
vertical-align: baseline;
border-radius: .25rem
}
.product-rating {
margin-top: 10px;
text-align: right;
direction: rtl;
}
.rating-review {
color: #5b5b5b
}
.product_price {
display: inline-block;
font-size: 30px;
font-weight: 500;
margin-top: 9px;
clear: left
}
.product_discount {
display: inline-block;
font-size: 17px;
font-weight: 300;
margin-top: 9px;
clear: left;
margin-left: 10px;
color: red
}
.product_saved {
display: inline-block;
font-size: 15px;
font-weight: 200;
color: #999999;
clear: left
}
.singleline {
margin-top: 1rem;
margin-bottom: .40rem;
border: 0;
border-top: 1px solid rgba(0, 0, 0, .1)
}
.product_info {
color: #4d4d4d;
display: inline-block
}
.product_options {
margin-bottom: 10px
}
.product_description {
padding-left: 0px
}
.input-group > .input-group-prepend > .input-group-text{
border-top-right-radius: 0.5rem;
border-bottom-right-radius: 0.5rem;
border-top-left-radius: 0rem;
border-bottom-left-radius: 0rem;
}
.form-control{
border-radius: 0rem;
border-top-left-radius: 0.5rem;
border-bottom-left-radius: 0.5rem;
}
.order_info {
margin-top: 18px
}
.shop-button {
height: 47px
}
.product_fav i {
line-height: 44px;
color: #cccccc
}
.product_fav {
display: inline-block;
width: 52px;
height: 46px;
background: #FFFFFF;
box-shadow: 0px 1px 5px rgba(0, 0, 0, 0.1);
border-radius: 11%;
text-align: center;
cursor: pointer;
margin-left: 3px;
-webkit-transition: all 200ms ease;
-moz-transition: all 200ms ease;
-ms-transition: all 200ms ease;
-o-transition: all 200ms ease;
transition: all 200ms ease
}
.br-dashed {
border-radius: 5px;
border: 1px dashed #dddddd;
margin-top: 6px
}
.pr-info {
margin-top: 2px;
padding-left: 2px;
margin-left: -14px;
padding-left: 0px
}
.break-all {
color: #5e5e5e
}
.image_selected {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: calc(100% + 15px);
height: 525px;
-webkit-transform: translateX(-15px);
-moz-transform: translateX(-15px);
-ms-transform: translateX(-15px);
-o-transform: translateX(-15px);
transform: translateX(-15px);
border: solid 1px #e8e8e8;
box-shadow: 0px 0px 0px rgba(0, 0, 0, 0.1);
overflow: hidden;
padding: 15px
}
.image_list li {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 165px;
border: solid 1px #e8e8e8;
box-shadow: 0px 0px 0px rgba(0, 0, 0, 0.1) !important;
margin-bottom: 15px;
cursor: pointer;
padding: 15px;
-webkit-transition: all 200ms ease;
-moz-transition: all 200ms ease;
-ms-transition: all 200ms ease;
-o-transition: all 200ms ease;
transition: all 200ms ease;
overflow: hidden
}
@media (max-width: 390px) {
.product_fav {
display: none
}
}
.bbb_combo {
width: 100%;
margin-right: 7%;
padding-top: 21px;
padding-left: 20px;
padding-right: 20px;
padding-bottom: 24px;
border-radius: 5px;
margin-top: 0px;
text-align: -webkit-center
}
.bbb_combo_image {
width: 170px;
height: 170px;
margin-bottom: 15px
}
.fs-10 {
font-size: 10px
}
.step {
background: #167af6;
border-radius: 0.8em;
-moz-border-radius: 0.8em;
-webkit-border-radius: 6.8em;
color: #ffffff;
display: inline-block;
font-weight: bold;
line-height: 3.6em;
margin-right: 5px;
text-align: center;
width: 3.6em;
margin-top: 116px
}
.row-underline {
content: "";
display: block;
border-bottom: 2px solid #3798db;
margin: 0px 0px;
margin-bottom: 20px;
margin-top: 15px
}
.deal-text {
margin-left: -10px;
font-size: 25px;
margin-bottom: 10px;
color: #000;
font-weight: 700
}
.padding-0 {
padding-left: 0;
padding-right: 0
}
.padding-2 {
margin-right: 2px;
margin-left: 2px
}
.vertical-line {
display: inline-block;
border-left: 3px solid #167af6;
margin: 0 10px;
height: 364px;
margin-top: 4px
}
.p-rating {
color: green
}
.combo-pricing-item {
display: flex;
flex-direction: column
}
.boxo-pricing-items {
display: inline-flex
}
.combo-plus {
margin-left: 10px;
margin-right: 18px;
margin-top: 10px
}
.add-both-cart-button {
margin-left: 36px
}
.items_text {
color: #b0b0b0
}
.combo_item_price {
font-size: 18px
}
.p_specification {
font-weight: 500;
margin-left: 22px
}
.mt-10 {
margin-top: 10px
}
* {
margin: 0;
/*padding: 0;*/
-webkit-font-smoothing: antialiased;
-webkit-text-shadow: rgba(0, 0, 0, .01) 0 0 1px;
text-shadow: rgba(0, 0, 0, .01) 0 0 1px
}
div {
display: block;
position: relative;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box
}
ul {
list-style: none;
margin-bottom: 0px
}
.single_product {
padding-top: 16px;
padding-bottom: 140px
}
.image_list li {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 165px;
border: solid 1px #e8e8e8;
box-shadow: 0px 1px 5px rgba(0, 0, 0, 0.1);
margin-bottom: 15px;
cursor: pointer;
padding: 15px;
-webkit-transition: all 200ms ease;
-moz-transition: all 200ms ease;
-ms-transition: all 200ms ease;
-o-transition: all 200ms ease;
transition: all 200ms ease;
overflow: hidden
}
.image_list li:last-child {
margin-bottom: 0
}
.image_list li:hover {
box-shadow: 0px 1px 5px rgba(0, 0, 0, 0.3)
}
.image_list li img {
max-width: 100%
}
.image_selected {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: calc(100% + 15px);
height: 525px;
-webkit-transform: translateX(-15px);
-moz-transform: translateX(-15px);
-ms-transform: translateX(-15px);
-o-transform: translateX(-15px);
transform: translateX(-15px);
border: solid 1px #e8e8e8;
box-shadow: 0px 1px 5px rgba(0, 0, 0, 0.1);
overflow: hidden;
padding: 15px
}
.image_selected img {
max-width: 100%
}
.product_category {
font-size: 12px;
color: rgba(0, 0, 0, 0.5)
}
.product_rating {
margin-top: 7px
}
.product_rating i {
margin-right: 4px
}
.product_rating i::before {
font-size: 13px
}
.product_text {
margin-top: 27px
}
.product_text p:last-child {
margin-bottom: 0px
}
.order_info {
margin-top: 16px
}
.quantity_control i {
font-size: 11px;
color: rgba(0, 0, 0, 0.3);
pointer-events: none
}
.quantity_control:active {
border: solid 1px rgba(14, 140, 228, 0.2)
}
.quantity_inc {
padding-bottom: 2px;
justify-content: flex-end;
border-top-right-radius: 5px
}
.quantity_dec {
padding-top: 2px;
justify-content: flex-start;
border-bottom-right-radius: 5px
}
.blurp{
text-align: right;
}
@import url('https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@300&display=swap');
#carousel-item1 {
width: 100%
}
.price span {
font-size: 18px
}
.cut {
text-decoration: line-through;
color: red
}
.icons i {
font-size: 17px;
color: green;
margin-right: 2px
}
.offers i {
color: green
}
.delivery i {
color: blue
}
label.radio {
cursor: pointer
}
label.radio input {
position: absolute;
top: 0;
left: 0;
visibility: hidden;
pointer-events: none
}
label.radio span {
padding: 2px 11px;
margin-right: 3px;
border: 1px solid #8f37aa;
display: inline-block;
color: #8f37aa;
border-radius: 3px;
text-transform: uppercase
}
label.radio input:checked+span {
border-color: #8f37aa;
background-color: #8f37aa;
color: #fff
}
.blurpImg{
width: 500px;
height: 500px;
}
.blurpImg3{
width: 450px;
height: 450px;
cursor: pointer;
}
.blurpImg2{
width: 115px;
height: 115px;
cursor: pointer;
}
@media all and (min-width: 992px) {
.blurpDiv{
max-height: 600px;
max-width: 609px;
}
.blurpDiv2{
max-height: 299px;
max-width: 609px;
}
}
@media all and (max-width: 992px) {
.product_description {
direction: ltr;
}
.blurpDiv{
max-height: inherit;
max-width: inherit;
}
.blurpDiv2{
max-height: inherit;
max-width: inherit;
}
}
.blurpDiv3{
max-height: 650px;
max-width: 650px;
text-align: center;
}
div> .btn-sm{
background-color: #232f3e;
color: #ffffff;
border-color: #ffffff;
cursor: pointer;
border-radius: 16px;
}
div> .btn-sm:hover{
background-color: #365159;
color: #febd69;
border-color: #febd69;
cursor: pointer;
border-radius: 16px;
}
.pb-0 > .container-fluid > .navBlurp{
direction: rtl;
text-align: right;
}
.colorBlurp{
color: #ffffff;
background-color: #232f3e;
border-color: #152023;
}
.colorBlurp2{
color: #ffffff;
background-color: #232f3e;
border-color: #152023;
}
.colorBlurp:hover{
color: #febd69;
background-color: #232f3e;
border-color: #152023;
}
.pb-0 > .container-fluid > .nav-tabs .nav-link.active {
color: #ffffff;
background-color: #365159;
border-color: #365159;
}
.pb-0 > .container-fluid > .nav-tabs .nav-link.active:hover {
color: #febd69;
background-color: #365159;
border-color: #365159;
}
.sth1[alt="Simple"] {color: white;}
arrating > input {display: none;}
.starrating > label:before {
content: "\f005";
margin: 2px;
font-size: 2em;
font-family: FontAwesome;
display: inline-block;
}
.starrating > label
{
color: #232f3e;
}
.starrating > input:checked ~ label
{ color: #ffca08 ; }
.starrating > input:hover ~ label
{ color: #ffca08 ; }
.rating-label {
font-weight: bold
}
.rating-bar {
width: 300px;
padding: 8px;
border-radius: 5px
}
.bar-container {
width: 100%;
background-color: #f1f1f1;
text-align: center;
color: white;
border-radius: 20px;
cursor: pointer;
margin-bottom: 5px
}
.bar-5 {
width: 70%;
height: 13px;
background-color: #FBC02D;
border-radius: 20px
}
.bar-4 {
width: 30%;
height: 13px;
background-color: #FBC02D;
border-radius: 20px
}
.bar-3 {
width: 20%;
height: 13px;
background-color: #FBC02D;
border-radius: 20px
}
.bar-2 {
width: 10%;
height: 13px;
background-color: #FBC02D;
border-radius: 20px
}
.bar-1 {
width: 0%;
height: 13px;
background-color: #FBC02D;
border-radius: 20px
}
.textarea{
width: 80%;
min-width:80%;
max-width:80%;
height:100px;
min-height:100px;
max-height:100px;
}
.col-md-10 > p > .profile-button {
background-color: #232f3e;
color:#ffffff !important;
box-shadow: none;
border-color: #ffffff;
}
.col-md-10 > p > .profile-button:hover {
background-color: #365159;
color: #febd69 !important;
border-color: #febd69;
}
.profile-button:focus {
background-color: #232f3e;
box-shadow: none
}
.imgProfile{
height: 120px;
width: 120px;
align-content: center;
}
.align-content-center{
text-align: center;
}
.border-infoo{
border-color: whitesmoke;
border-style: solid;
}
.btn-primary{
color: #152023;
background-color: #febd69;
}
.btn-success{
background-color: #152023;
color: #ffffff;
border-color: #152023;
}
.btn-primary:hover{
color: #365159;
background-color: #db7c01;
}
.btn-success:hover{
background-color: #365159;
color: #febd69;
border-color: #febd69;
}
@media only screen and (min-width: 767px) {
.customButSearch{
min-width: 48px !important;
max-width: 48px !important;
min-height: 31px !important;
max-height: 31px !important;
overflow: hidden;
}
.customM{
margin-left: 30px;
}
}
@media only screen and (min-width: 992px) {
.customButSearch{
min-width: 66px !important;
max-width: 66px !important;
min-height: 31px !important;
max-height: 31px !important;
overflow: hidden;
}
.customM{
margin-left: 40px;
}
}
@media only screen and (min-width: 1200px) {
.customButSearch{
min-width: 88px !important;
max-width: 88px !important;
min-height: 31px !important;
max-height: 31px !important;
overflow: hidden;
}
.customM{
margin-left: 50px;
}
}
@media (min-width:1200px){
.img-size{
width: 260px;
max-width: 260px;
min-width: 260px;
height: 200px;
max-height: 200px;
min-height: 200px;
}
}@media (min-width:1000px) and (max-width:1200px){
.img-size{
width: 215px;
max-width: 215px;
min-width: 215px;
height: 180px;
max-height: 180px;
min-height: 180px;
}
}@media (min-width:768px) and (max-width:1000px){
.img-size{
width: 155px;
max-width: 155px;
min-width: 155px;
height: 100px;
max-height: 100px;
min-height: 100px;
}
}
@media (min-width:576px) and (max-width:768px){
.img-size{
width: 500px;
max-width: 500px;
min-width: 500px;
height: 300px;
max-height: 300px;
min-height: 300px;
}
}
@media (min-width:450px) and (max-width:576px){
.img-size{
width: 100%;
max-width: 100%;
min-width: 470px;
height: 250px;
max-height: 250px;
min-height: 250px;
}
}@media (max-width:450px){
.img-size{
width: 100%;
max-width: 100%;
min-width: 250px;
height: 200px;
max-height: 200px;
min-height: 200px;
}
}
div > .style1{
background-color: #fff;
padding: 11px;
}
.product_discount > .style2 {
color:black;
}
div > .style3{
margin-top: 15px;
}
div > .style4{
margin-left: 15px;
}
div > .style5{
margin-left: 55px;
}
div > .style6{
margin-left: 13px;
}
| css |
import useImportedHook from 'use-imported-hook'
export default function useTestHook() {
const a = './hook.jsx'
return useImportedHook(import(a))
}
| javascript |
#!/bin/python3
import sys
total = 0
d1,m1,y1 = input().strip().split(' ')
d1,m1,y1 = [int(d1),int(m1),int(y1)]
d2,m2,y2 = input().strip().split(' ')
d2,m2,y2 = [int(d2),int(m2),int(y2)]
if(y2<y1):
total = 10000
elif (y2==y1):
if(m2<m1):
total = 500*(m1-m2)
elif(m1==m2):
if(d2<d1):
total = 15*(d1-d2)
print (total) | python |
The Kevin Durant trade has been a cold trail with no real progress achieved. Reports have it that the Brooklyn Nets are still in active talks, but no agreement has been reached with any franchise.
Rumors have it that the Nets have held conversations with each of the other 29 franchises. In some quarters, the Nets' pickiness has been perceived as ridiculous. Some people have questioned if Brooklyn really wants to part with the player.
There have been a few leaks of players from interested franchises who are seemingly on the table. According to Michael Scotto of HoopsHype, the New Orleans Pelicans' Brandon Ingram was not on the table along with the Toronto Raptors' Scottie Barnes.
“Brooklyn wanted a package that could top the Rudy Gobert package that Utah got for him in the trade with Minnesota," Scotto said. "To this point, that market has not materialized. There are some younger guys they’d be open to getting if they were going to move Kevin Durant.
The Miami Heat are one of Durant’s preferred destinations, with the Phoenix Suns being the other. According to Barry Jackson of the Miami Herald, the Heat's offer for KD has been met with little interest from the Brooklyn Nets.
"While the Miami Heat remains interested in Kevin Durant, the Brooklyn Nets have displayed little interest in the Heat’s offer for the high-scoring superstar, and Miami is moving ahead with its current roster for next season, according to sources briefed on the situation," Jackson said.
While the Nets have shown interest in Heat center Bam Adebayo, the Heat did not include him in their offer and have no plans to. Due to NBA salary cap rules, Adebayo is not eligible to be included in a trade.
5 Times Steph Curry Was HUMILIATED On And Off The Court! | english |
<reponame>IoTcat/archive
{ "translations": {
"activated" : "Aktivált",
"updated" : "frissítve",
"These are your backup codes. Please save and/or print them as you will not be able to read the codes again later" : "Ezek a biztonsági kódjaid. Kérlek mentsd el vagy nyomtasd ki őket úgy hogy később is meglegyenek.",
"Save backup codes" : "Biztonsági kódok mentése",
"Print backup codes" : "Biztonsági kódok nyomtatása",
"Regenerate backup codes" : "Biztonsági kódok újra generálása",
"If you regenerate backup codes, you automatically invalidate old codes." : "Ha újra generálod a biztonsági kódokat, akkor a régiek automatikusan érvénytelenítve lesznek.",
"Generate backup codes" : "Biztonsági kód generálás",
"An error occurred while generating your backup codes" : "Hiba történt a biztonsági kódok generálása közben",
"Nextcloud backup codes" : "Nextcloud biztonsági kódok",
"You created two-factor backup codes for your account" : "Kétfaktoros helyreállítási kódot hoztál létre a fiókodhoz",
"Second-factor backup codes" : "Második lépcsős biztonsági kódok",
"Backup code" : "Biztonsági kód",
"Use backup code" : "Biztonsági kód használata",
"Two factor backup codes" : "Kétfaktoros biztonsági mentési kódok",
"A two-factor auth backup codes provider" : "Kétfaktoros azonosítás biztonsági kódok szolgáltatója",
"Submit" : "Küldés",
"Backup codes have been generated. {{used}} of {{total}} codes have been used." : "A biztonsági kódok elkészültek. Felhasználva: {{used}}, ennyiből: {{total}}."
},"pluralForm" :"nplurals=2; plural=(n != 1);"
} | json |
/* Copyright (c) 2018 <NAME>
This work is available under the "MIT License”.
Please see the file LICENSE in this distribution
for license terms. */
use std::f32;
use ggez::*;
use nalgebra::Vector2;
use nalgebra::Point2;
use super::entity::*;
use super::body::*;
use super::asset_manager::*;
use super::camera::*;
pub struct Unit {
pub is_dead: bool,
pub asset_key: String,
pub body: Body,
sheet_w: u32,
sheet_h: u32,
animation_repeats: bool,
animation_progress: u32
}
impl Unit {
pub fn new(body: Body, asset_key: String, sheet_w: u32, sheet_h: u32, animation_repeats: bool) -> Unit {
Unit {
is_dead: false,
asset_key,
sheet_w,
sheet_h,
animation_repeats,
animation_progress: 0,
body
}
}
fn get_default_draw_param(&self, interpolation_value: f32, camera: &Camera) -> graphics::DrawParam {
let view_position = self.body.get_view_position(interpolation_value, camera);
graphics::DrawParam {
src: graphics::Rect {
x: (self.animation_progress % self.sheet_w) as f32 / self.sheet_w as f32,
y: (self.animation_progress / self.sheet_w) as f32 / self.sheet_h as f32,
w: 1.0/self.sheet_w as f32,
h: 1.0/self.sheet_h as f32
},
dest: Point2::new(view_position.x, view_position.y),
rotation: self.body.rotation,
scale: Point2::new(self.body.scale.x, self.body.scale.y),
offset: Point2::new(0.5, 0.5),
.. Default::default()
}
}
fn update_animation(&mut self) {
if self.animation_progress == (self.sheet_w * self.sheet_h)-1 {
if self.animation_repeats {
self.animation_progress = 0;
} else {
self.set_dead();
}
}
else {
self.animation_progress += 1;
}
}
pub fn set_velocity(&mut self, velocity: Vector2<f32>) {
self.body.velocity = velocity;
}
}
impl Entity for Unit {
fn update(&mut self) {
self.update_animation();
self.body.update_pos();
}
fn draw(&self, asset_manager: &AssetManager, ctx: &mut Context, interpolation_value: f32, camera: &Camera) {
if !self.is_dead {
asset_manager.draw_asset(self.asset_key.clone(), ctx, self.get_default_draw_param(interpolation_value, camera));
}
}
fn get_body(&self) -> Body {
self.body.clone()
}
fn set_body(&mut self, body: Body) {
self.body = body;
}
fn is_dead(&self) -> bool {
self.is_dead
}
fn set_dead(&mut self) {
self.is_dead = true;
}
} | rust |
package jrfeng.simplemusic.activity.scan_result;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.ActionBar;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import jrfeng.player.data.Music;
import jrfeng.player.player.MusicPlayerClient;
import jrfeng.simplemusic.R;
import jrfeng.simplemusic.activity.scan_result.adapter.ScannedMusicsAdapter;
import jrfeng.player.base.BaseActivity;
import jrfeng.player.mode.MusicStorageImp;
public class ScannedMusicsActivity extends BaseActivity {
private MusicStorageImp mMusicStorageImp;
private List<Music> mNewMusic;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_scanned_musics);
overridePendingTransition(R.anim.slide_in_up, R.anim.no_anim);
MusicPlayerClient client = MusicPlayerClient.getInstance();
mMusicStorageImp = (MusicStorageImp) client.getMusicStorage();
init();
}
@SuppressWarnings("unchecked")
private void init() {
//获取值
ArrayList<Music> musics = (ArrayList<Music>) getIntent().getSerializableExtra("musics");
//初始化 Toolbar
Toolbar tbScannedMusics = findViewById(R.id.tbScanned);
setSupportActionBar(tbScannedMusics);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setDisplayShowTitleEnabled(false);
}
//初始化 RecyclerView
RecyclerView rvScannedMusics = findViewById(R.id.rvScannedMusics);
RecyclerView.LayoutManager lm = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
rvScannedMusics.setLayoutManager(lm);
TextView tvScannedMusicCount = findViewById(R.id.tvScannedMusicCount);
TextView tvNewMusicCount = findViewById(R.id.tvNewMusicCount);
initNewMusic(musics);
tvScannedMusicCount.setText("扫描到" + musics.size() + "首歌曲");
tvNewMusicCount.setText(mNewMusic.size() + "首新歌曲");
final ScannedMusicsAdapter adapter = new ScannedMusicsAdapter(this, mNewMusic, findViewById(R.id.scannedMusicsTitle));
rvScannedMusics.setAdapter(adapter);
Button btnCommitAdd = findViewById(R.id.btnCommitAdd);
btnCommitAdd.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
boolean[] choice = adapter.getItemsChoiceState();
List<Music> needAdd = new LinkedList<>();
for(int i = 0; i < choice.length; i++) {
if(choice[i]) {
needAdd.add(mNewMusic.get(i));
}
}
mMusicStorageImp.addAll(needAdd);
setResult(RESULT_OK);
finish();
}
});
}
private void initNewMusic(List<Music> scannedMusic) {
List<Music> allMusic = mMusicStorageImp.getAllMusic();
mNewMusic = new LinkedList<>();
for (Music music : scannedMusic) {
if (!allMusic.contains(music)) {
mNewMusic.add(music);
}
}
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == android.R.id.home) {
finish();
}
return super.onOptionsItemSelected(item);
}
}
| java |
import { mode, transparentize } from '@chakra-ui/theme-tools';
import { fonts } from '../../theme/foundations/typography';
import { themeDefaultColorMap } from '../../theme/helpers';
type Dict = Record<string, any>;
function variantGhost(props: Dict) {
const { colorScheme: c, theme } = props;
if (c === 'gray') {
return {
color: mode(`inherit`, `whiteAlpha.900`)(props),
_hover: {
bg: mode(`gray.100`, `whiteAlpha.200`)(props)
},
_active: { bg: mode(`gray.200`, `whiteAlpha.300`)(props) }
};
}
const darkHoverBg = transparentize(`${c}.200`, 0.12)(theme);
const darkActiveBg = transparentize(`${c}.200`, 0.24)(theme);
return {
color: mode(`${c}.${themeDefaultColorMap[c]}`, `${c}.200`)(props),
bg: 'transparent',
_hover: {
bg: mode(`${c}.50`, darkHoverBg)(props)
},
_active: {
bg: mode(`${c}.100`, darkActiveBg)(props)
}
};
}
function variantOutline(props: Dict) {
const { colorScheme: c, theme } = props;
const darkHoverBg = transparentize(`${c}.200`, 0.12)(theme);
if (c === 'gray') {
return {
color: mode(`inherit`, `whiteAlpha.900`)(props),
border: '2.5px solid',
borderColor: 'gray.200',
_hover: {
bg: mode(`gray.800`, `whiteAlpha.200`)(props),
borderColor: 'gray.800',
color: 'gray.50'
},
_active: { bg: mode(`gray.200`, `whiteAlpha.300`)(props) }
};
}
return {
...variantGhost(props),
border: '2.5px solid',
borderColor: mode(`${c}.500`, `${c}.200`)(props),
_hover: {
bg: mode(`${c}.500`, darkHoverBg)(props),
color: mode(`white`, `gray.900`)(props)
}
};
}
function variantLink(props: Dict) {
const { colorScheme: c } = props;
return {
padding: 0,
height: 'auto',
lineHeight: 'normal',
color: mode(`${c}.${themeDefaultColorMap[c]}`, `${c}.200`)(props),
_hover: { textDecoration: 'underline' },
_active: {
color: mode(`${c}.700`, `${c}.500`)(props)
}
};
}
function variantDark(props: Dict) {
const { colorScheme: c } = props;
const textColor = c == 'gray' ? `${c}.50` : `${c}.100`;
return {
bg: mode('gray.800', `${c}.200`)(props),
color: textColor,
_hover: { color: `${c}.300` }
};
}
function variantLight(props: Dict) {
const { colorScheme: c } = props;
const backgroundColor = c == 'gray' ? `${c}.200` : `${c}.50`;
return {
bg: backgroundColor,
color: `${c}.${themeDefaultColorMap[c]}`,
_hover: {
bg: `${c}.${themeDefaultColorMap[c]}`,
color: 'gray.50'
}
};
}
const Button = {
baseStyle: {
fontWeight: 'medium',
fontFamily: fonts.heading,
_focus: { boxShadow: 'none' }
},
defaultProps: {
colorScheme: 'blue'
},
variants: {
outline: variantOutline,
link: variantLink,
dark: variantDark,
light: variantLight
}
};
export default Button;
| typescript |
Liverpool legend Jamie Carragher has opined that Manchester City striker Erling Haaland might have picked the wrong club for himself.
The Norwegian striker joined the Cityzens from Borussia Dortmund last summer and has since scored an incredible 25 goals in 19 Premier League games. While Haaland has been prolific, Manchester City have looked far from their best this season.
Many fans and pundits have pointed out that Pep Guardiola's side look disjointed in attack. The latest example of the same came on Sunday, February 5, as City lost 1-0 against Tottenham Hotspur. Haaland had zero shots and zero touches in the penalty box despite playing the entirety of the contest.
Speaking after the game, Carragher explained on Sky Sports how Manchester City could be the wrong club for Haaland. He said:
He added:
Carragher explained that Guardiola's style of play requires his team to keep control of possession rather than playing direct football. He said:
He added:
Carragher concluded by saying that while Haaland might score plenty of goals, his abilities haven't been highlighted so far with City:
Premier League leaders Arsenal faced their second league defeat of the season on February 4 when they lost 1-0 against Everton at Goodison Park.
It provided a big opportunity for Manchester City to cut down the gap to just two points at the top of the table. However, they faltered against Tottenham away from home on Sunday. Harry Kane scored the only goal of the game to become Spurs' all-time top goalscorer with 267 goals.
City now trail Arsenal by five points with the Gunners having a game in hand. The two teams are notably yet to meet each other in the Premier League this term. | english |
{"name": "django-debreach", "description": "BREACH mitigation for Django apps.", "license": {"key": "bsd-2-clause", "name": "BSD 2-clause \"Simplified\" License", "spdx_id": "BSD-2-Clause", "url": "https://api.github.com/licenses/bsd-2-clause"}, "starNum": 68, "folkNum": 3, "watchNum": 68, "topic": []} | json |
require('dotenv').config();
const express = require('express');
const app = express();
const bodyParser = require('body-parser');
const usersRouter = require('./api/routes/users');
const cardsRouter = require('./api/routes/cards');
const loginRouter = require('./api/routes/login');
const testRouter = require('./api/routes/test');
var compression = require('compression');
app.use(bodyParser.urlencoded({
extended: false
}));
app.use(bodyParser.json());
app.use((req, res, next) => {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, Authorization");
if(req.method === 'OPTIONS'){
res.header('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE');
return res.status(200).json({});
}
next();
});
app.use(compression());
app.use('/registration', usersRouter);
app.use('/login', loginRouter);
app.use('/cardDetails', cardsRouter);
app.use('/test', testRouter)
app.use((req, res, next) => {
const error = new Error('Resource not found!');
error.status = 404;
next(error);
})
app.use((error, req, res, next) => {
res.status(error.status || 500);
res.json({
error: {
message: error.message
}
});
})
module.exports = app; | javascript |
{
"src2dstTxHash": "2EC57CBA313DD1E85C2AACEBA9374987BAB0C5DC08DECD71A3217FEF51C25046",
"dst2srcTxHash": "2F23D6A689AFC55D7C8138E9F2377FCB682596996DB52AFA1C2730131F9F5CA4",
"accountAddress": "<KEY>",
"validatorOprAddress": "<KEY>"
}
| json |
Aidan McGinty(I)
Aidan McGinty is known for A Quiet Place: Day One (2024), Ghostbusters: Frozen Empire (2024) and Joker: Folie à Deux (2024).
Known for:
- Additional Crew(ny unit)
- Additional Crew(ny unit)
- Additional Crew(ny unit)
How much have you seen?
Keep track of how much of Aidan McGinty’s work you have seen. Go to your list.
| english |
<filename>cpp/hifst/include/task.sparseweightvectorlattices.hpp
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use these files 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.
// Copyright 2012 - <NAME>, <NAME>, <NAME>
#ifndef TASK_SPWLATS_HPP
#define TASK_SPWLATS_HPP
/**
* \file
* \brief Implements the task of creating sparse vector weight lattices -- contains feature weight contributions separately in each arc
* and we can use it to dump features, MERT training, etc
* \date 15-10-2012
* \author <NAME>
*/
namespace ucam {
namespace hifst {
/**
* \brief Creates lattices using tropical tuple weight semiring -- each arc containing separate feature weight contributions.
* Note that the semiring is tropical under dot product of all these features with its scales
*/
template<class Data, class Arc>
class SparseWeightVectorLatticesTask: public ucam::util::TaskInterface<Data> {
private:
//key for a pointer in the data object to read the alignment lattice
const std::string alilatskey_;
///key for a pointer in the data object to store the sparse weight vector lattice
const std::string sparseweightvectorlatticekey_;
///key for a pointer to language model(s).
const std::string lmkey_;
///key for a pointer to the rule flower lattice
const std::string ruleflowerlatticekey_;
///Sparse tuple weight lattice
fst::VectorFst<TupleArc32> myfst_;
///Pointer to data object
Data *d_;
//Strip dr, oov, ...
bool stripHifstEpsilons_;
fst::RelabelUtil<TupleArc32> ru_;
public:
///Constructor with registry object and keys to access/write lattices in data object
SparseWeightVectorLatticesTask ( const ucam::util::RegistryPO& rg,
const std::string& alilatskey =
HifstConstants::kSparseweightvectorlatticeLoadalilats,
const std::string& ruleflowerlatticekey =
HifstConstants::kRuleflowerlatticeStore,
const std::string& sparseweightvectorlatticekey =
HifstConstants::kSparseweightvectorlatticeStore
) :
ruleflowerlatticekey_ ( ruleflowerlatticekey )
, alilatskey_ ( alilatskey )
, sparseweightvectorlatticekey_ ( sparseweightvectorlatticekey )
, stripHifstEpsilons_ (rg.getBool (
HifstConstants::kSparseweightvectorlatticeStripSpecialEpsilonLabels) ) {
ru_.addIPL (DR, EPSILON)
.addIPL (OOV, EPSILON)
.addIPL (SEP, EPSILON)
;
};
/**
* \brief Implements virtual method from ucam::util::TaskInterface.
* \remark Takes an alignment lattice, maps to tuplearc32 and composes it with the grammar flower lattice.
* After projecting on the words (thus deleting rules), we have a word lattice
* containing independent feature contributions to weight in each arc.
* \param d Data object
*/
bool run ( Data& d ) {
myfst_.DeleteStates();
d_ = &d;
fst::VectorFst<Arc> *lattice = static_cast<fst::VectorFst<Arc> *>
( d.fsts[alilatskey_] );
USER_CHECK ( lattice->NumStates(), "Empty alignment lattice?" );
Invert ( lattice );
fst::VectorFst<TupleArc32> *lxr
= applyFlowerLattice (*lattice
, * ( static_cast<fst::VectorFst<TupleArc32> *>
( d.fsts[ruleflowerlatticekey_] ) ) );
LDBG_EXECUTE ( lattice->Write ( "fsts/aplats/aplats+flower.fst" ) );
if (stripHifstEpsilons_) {
LINFO ("Remove hifst epsilons");
ru_ (lxr);
}
LINFO ( "Project, RmEpsilon, Determinize and Minimize" );
fst::Project ( lxr, fst::PROJECT_INPUT );
LDBG_EXECUTE ( lxr->Write ( "fsts/aplats/aplats+flower+p.fst.gz" ) );
fst::RmEpsilon<TupleArc32> ( lxr );
fst::Determinize<TupleArc32> ( *lxr, &myfst_ );
LDBG_EXECUTE ( myfst_.Write ( "fsts/aplats/aplats+flower+p+re+d.fst" ) );
delete lxr;
fst::Minimize<TupleArc32> ( &myfst_ );
LDBG_EXECUTE ( myfst_.Write ( "fsts/aplats/aplats+flower+p+re+d+m.fst" ) );
d.fsts[sparseweightvectorlatticekey_] = &myfst_;
LINFO ( "Ready! Stored with key=" << sparseweightvectorlatticekey_ << "; NS=" <<
myfst_.NumStates() );
return false;
};
~SparseWeightVectorLatticesTask() {
myfst_.DeleteStates();
LINFO ("Shutdown!");
}
private:
///Takes care of composition with the grammar flower lattice. Alignment lattice must be mapped first to tropical sparse tuple weight semiring.
fst::VectorFst<TupleArc32> * applyFlowerLattice ( const fst::VectorFst<Arc>
& hypfst,
const fst::VectorFst<TupleArc32>& grammarflowerlattice ) {
LINFO ( "Removing Weights of Target Lattice" );
fst::VectorFst<Arc> prvfst ( hypfst );
fst::Map ( &prvfst, fst::RmWeightMapper<Arc>() );
fst::VectorFst<TupleArc32> *vwfst = new fst::VectorFst<TupleArc32>;
LINFO ( "Mapping Arc Target Lattice to TupleArc32" );
fst::MakeSparseVectorWeight<Arc> mwcopy ( 1 );
fst::Map<Arc> ( prvfst, vwfst,
fst::GenericWeightMapper<Arc, TupleArc32, fst::MakeSparseVectorWeight<Arc> > ( mwcopy ) );
fst::VectorFst<TupleArc32> *output = new fst::VectorFst<TupleArc32>;
LDBG_EXECUTE ( vwfst->Write ( "fsts/aplats/vw-beforecomposing.fst" ) );
LINFO ( "Compose (TupleArc32)" );
fst::Compose ( *vwfst, grammarflowerlattice, output );
delete vwfst;
return output;
};
ZDISALLOW_COPY_AND_ASSIGN ( SparseWeightVectorLatticesTask );
};
}
} // end namespaces
#endif // TASK_ALATS2SPWLATS_HPP
| cpp |
The world’s largest aircraft, developed by Microsoft co-founder Paul Allen’s aerospace firm, emerged from its hangar in California desert for the first time on Wednesday. “This is a first-of-its-kind aircraft, so we are going to be diligent throughout testing,” Jean Flyod, chief executive at Allen’s firm Stratolaunch Systems Corporation, said in a blog.
The Stratolaunch aircraft, which has the largest plane wingspan measuring 385 feet, is powered by six 747 aircraft engines and is designed to launch rockets into space from the air. The aircraft is 238 feet long from nose to tail and is 50 feet high from the ground. It has 28 wheels and can carry more than 500,000 pounds of payload.
The Stratolaunch was announced in 2011 and is expected to be demonstrated in 2019, reported AFP. The aerospace firm will soon test its fuel systems and engines before the demonstration.
In the past, Allen had said that the project would be a more cost-effective option for cargo and human missions sent to space. “We could deploy more satellites that would enable better understanding of why our weather patterns are changing and help increase agricultural productivity,” he had said last year according to Telegraph.
| english |
Mattannur, Kannur: Yashoda K P, an elderly farm labourer, had wrapped tarpaulin sheets over her dilapidated house three monsoons ago. The traditional tiled-roof house has a small attic on the first floor and two bedrooms on the ground floor. This time around, she cannot ask anyone to get on top of the house to fix the tarpaulin sheets because the ruined wooden rafters will not hold anyone.
"This monsoon, the water will pour into her house and she has nowhere else to go," says Vinod P C, Yashoda's neighbour at Kanad in Kannur's Keezhallur grama panchayat.
Farm labourer Prashandan's house has a similar structure and he is holding up the tiled roof with wooden poles.
The houses of K P Yashoda and Palakandi Shantha, two other farm labourers, are in a similar condition. Their neighbour C K Dileepan, a concrete worker, is also edgy because his house too might give away in the rains.
None of them have the resources to fix their houses. Those who can, are not allowed to.
Eight years ago, the state government identified 248 acres on the western side of the Kannur International Airport to expand the runway to 4,000 m from 3,050 m.
The land in wards no. 12 and 13 - Keezhallur North and Kanad - of the panchayat has 172 houses.
"But the government is not taking any steps to take over our land and rehabilitate us. We can neither build a new house on our property nor repair it. We can neither till our land nor sell it. We have been living in uncertainty for the past eight years," said Vinod.
Vinod is the convenor of an action committee of 172 landowners who have to give up their land and houses for the expansion of the runway. On May 22, the action committee is planning to picket the office of the Kerala Industrial Infrastructure Development Corporation (KINFRA), the government agency authorised to acquire land for the airport and rehabilitate the displaced families.
Of the 172 houses, KINFRA has done valuation for only 80 houses, he said. "The process is painfully slow," said action committee chairperson K K Gangadharan Nambiar. Officials are cheating the people who are ready to give up their land for the airport, he said.
Two years ago, KINFRA shifted families from seven houses at Kanad to rent houses because the runoff rainwater from the airport was eroding their land. "But KINFRA paid the rent for only six months. Now the poor people are left to fend for themselves," said Vinod.
Narayani, who is around 80 years old, is among those who shifted to rent houses. She said the rents ranged between Rs 5,000 to Rs 7,000 but she did not have the resources to pay.
'Govt has no money to pay compensation'
KINFRA officials said the state government could pay the rent of displaced persons for six months. The Land Acquisition Act allows the government to pay for another six months, but it did not consider it, an official said.
On rehabilitation, KINFRA has identified 36 acres at Chalode, 4 km from Kanad. Families losing their houses will get 10 cents each to build a house. The land will be compensated with twice the valuation amount.
Seven months ago, KINFRA wrote to the state government for Rs 1,273 crore to compensate and rehabilitate the families displaced by the airport project. "But we have not heard from the government. We are told the government does not have money," said an official of KINFRA in Kannur.
He said the paperwork for acquiring the land of the people was almost complete. But the final notification under Section 19 (1) of the Land Acquisition Act can be issued only after the government deposits Rs 1,273 crore in the bank account of the land acquisition officer. "That's the law. Without getting the fund, we cannot issue the notification and start the process," he said.
The government may be hesitating because the Kannur International Airport is not functioning at full capacity. Air India Express, IndiGo, and Go First are the three airlines flying in and out of the airport.
Air India Express has 36 international flights taking off from the airport; IndiGo has six international and 43 domestic flights taking off from the airport.
But cash-strapped Go First filing for insolvency was a body blow to the airport. The airline cancelled its 21 international flights and seven domestic flights (to Mumbai) from Kannur. "That's a big blow to the airport. We are in the process of bringing in new airlines to the airport. Now is not the time to go to the media," said a top official of the airport. He, however, said there was no point in delaying the land acquisition for the runway "because the project was already approved years ago".
Go First flights have been officially suspended till May 23.
MP John Brittas, who was in Mattannur on Monday (May 15), said the airport was in talks with several airlines and there would be a change in the airport's fortunes in the six months. He said the Union government would not deny permission again for foreign airlines to operate out from Kannur airport.
In December, the Ministry of Civil Aviation refused to grant 'point of call' status for foreign airlines in Kannur airport saying it was not a metro.
Since the airport's first commercial flight on December 9, 2018, the airport has handled 3. 14 million passengers. People from north Kerala and a part of Karnataka are beneficiaries of the airport.
"Now that there is a change in government in Karnataka, there can be a joint effort to get the point of call status for Kannur airport," he said.
But for the people of Keezhallur panchayat living on the edge of the airport, all these talks may fly over their heads.
"Eight years is a long time. One year ago, we met the chief minister in person and sought his intervention to rehabilitate us," said action committee convenor Vinod. But there is radio silence from the government. | english |
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/
'use strict';
const models = require('./index');
/**
* Resource Id.
*
* @extends models['SubResource']
*/
class VirtualMachineCaptureResult extends models['SubResource'] {
/**
* Create a VirtualMachineCaptureResult.
* @member {object} [output] Operation output data (raw JSON)
*/
constructor() {
super();
}
/**
* Defines the metadata of VirtualMachineCaptureResult
*
* @returns {object} metadata of VirtualMachineCaptureResult
*
*/
mapper() {
return {
required: false,
serializedName: 'VirtualMachineCaptureResult',
type: {
name: 'Composite',
className: 'VirtualMachineCaptureResult',
modelProperties: {
id: {
required: false,
serializedName: 'id',
type: {
name: 'String'
}
},
output: {
required: false,
serializedName: 'properties.output',
type: {
name: 'Object'
}
}
}
}
};
}
}
module.exports = VirtualMachineCaptureResult;
| javascript |
CHAITRA 14, 1911 (SAKA) Written Answers 406
(c) the steps envisaged to improve telephone services between Delhi and Faridabad?
Electrification Schemes for Purnea District in Bihar
4753 SHRI SYED SHAHABUDDIN Will the Minister of ENERGY be pleased to state
(a) the criteria adopted for distribution of rural electrification funds allocated to the States among he various districts and of the funds allocated to a district to various blocks/ panchayats, and
(b) the number of schemes approved for the Purnea district of Bihar, the number of villages electrified during 1988-89 and the number of villages to be taken up during 1989-90?
THE MINISTER OF STATE IN THE DEPARTMENT OF POWER IN THE MINISTRY OF ENERGY (SHRI KALP NATH RAI) (a) The districtwise and blockwise financial outlays are decided at the State level
(b) As on 29 3 1989, Rural Electrification Corporation has sanctioned 43 rural electrification schemes in Purnea district of Bihar during 1988 89 18 villages (Provisional) are reported to have been electrified by the end of December, 1988 For the year 1989-90, a target of electrification of 2300 villages has been fixed for the State of Bihar Districtwise targets are decided at the State level
Telephone Services Between Delhi and Faridabad
4754 PROF RAMKRISHNA MORE Will the Minister of COMMUNICATIONS be pleased to state
(a) whether the telephone services between Delhi and Faridabad mostly remain out of order,
(b) if so, the reasons therefor, and
THE MINISTER OF STATE IN THE MINISTRY OF COMMUNICATIONS (SHRI GIRIDHAR GOMANGO) (a) and (b). The telephone services between Delhi and Faridabad are generally satis factory
(c) The steps envisaged to further improve telephone service between Delhi and Faridabad are detailed below
Commissioning of a 10,000 line digital electronic exchange at Faridabad
2 Commissioning of additional PCM systems between Delhi and Faridabad on junction cables, and
Introduction of Digital coaxial system between Delhi and Faridabad
Telex Services in Karnataka
4755 SHRI HG RAMULU Will the Minister of COMMUNICATIONS be pleased to state
(a) whether Government propose to provide telex services in the major towns of Karnataka, and
(b) If so, the names of the towns where such facilities are proposed to be provided in the near future?
THE MINISTER OF STATE IN THE MINISTRY OF COMMUNICATIONS (SHRI GIRIDHAR GOMANGO) (a) Yes, Sir
(b) A number of major towns including district Headquarters and other important towns are already having telex services. It is proposed to extend the Telex facilities to the
407 Written Answers
following district Headquarters in the near future, provided a minimum firm demand of 4 connections is registered, at the following places:(i) Bijapur (ii) Chitradurga (iii) Chickmagalur (iv) Mandya and (v) Madikeri.
Memorandum from Employees of Bharat Process and Mechanical Engineers Limited
4756. SHRI R.P. DAS: Will the Minister of INDUSTRY be pleased to state:
(a) whether Union Government have received a memorandum from the employees of the Bharat Process and Mechanical Engineers Limited; New Delhi;
(b) if so, the details thereof; and
(c) the action taken by Government thereon?
THE MINISTER OF INDUSTRY (SHRI J. VENGALA RAO): (a) Yes, Sir.
(b) Points raised in the memorandum relate to:
(i) Categorisation of the employees at New Delhi Branch of BPMEL.
(ii) Disparity in salaries of employees posted at Calcutta and Delhi.
(iii) Payment of travelling allowance for Delhi staff.
(c) The revised pay structure of staff and sub-staff of BPMEL including Ministries of Delhi Branch of BPMEL was implemented after due Govt. approval with effect from April 1, 1987, after negotiations with the then recognised union, i.e. Bird Heilgers Employees Union, Delhi Branch. The wage structure of Calcutta workers of BPMEL is govWritten Answers 408
erned by the West Bengal Tripartite Engineering Wage Settlement dated January 28, 1988.
Pit-Head Price of Coal
4757. SHRI K. RAMAMURTHY: Will the Minister of ENERGY be pleased to state:
(a) whether the pit-head price of coal as a percentage of the landed price of coal at a power station has come down between February, 1981 and January, 1987 and the share of railway freight has gone up considerably; and
(b) if so, the details thereof and the present position as in January, 1989 of the percentages of landed price of coal and the railway freight?
THE MINISTER OF ENERGY (SHRI VASANT SATHE): (a) and (b). The shares of pit-head price of coal and the railway freight as a percentage of landed price of coal will vary from one power station to another as it will depend on the grade of coal and the distance between production point of coal and the power station. It will also depend on the State where coal is produced as the impact of cesses/levies varies from one State to another. For the year 1987-88 the average distance over which coal was transported by the Railways was of the order of 655 Kms. It is estimated that for E grade of coal supplied from Bihar/West Bengal coalfield to a power station 655 Kms. away, the share of pithead price has come down from about 55 per cent in Feb. '81 to about 37 per cent in January, 1987; the share of railway freight having gone up from about 36 per cent in February 1981 to about 47 per cent in January, 1987.
In January, 1989, for E grade coal supplied from Bihar/West Bengal coalfields to a power station located 655 Kms. away, the shares of pithead price and railway freight as
a percentage of landed price of coal are estimated to be about 41 and 38 per cent respectively.
Improvement In condition of Coal Workers
CHAITRA 14, 1911 (SAKA)
4758. SHRI KALI PRASAD PANDEY: Will the Minister of ENERGY be pleased to state:
(a) whether Union Government have proposed effective measures to improve the condition of labourers/employees in the coal industry, to change the functioning and structure of coal industry/collieries and to
Water Supply
Position at the time of of nationalisation.
Within the geographical spread of CIL coal companies, there are 602 primary schools, 231 middle schools, 152 high schools, 9 colleges and 25 Central Schools. The coal companies make suitable grantsin-aid to these educational institutions and help them in other ways to augment their educational facilities which are availed of by the wards of their employees. The coal companies are also encouraging establishment of cooperative institutions, bank branches etc. for benefit of their workforce. The coal companies run 77 hospitals, with 4,533 beds, and 417 dispensaries and have 1,241 Medical Officers and 200 Specialists who provide uninterrupted medical attention to their employees.
(b) and (c). Coal India Limited is workWritten Answers
give benefit to the workers under the pension scheme;
(b) if so, the details thereof and progress made so far; and
(c) the time by which the proposed pension scheme for coal workers is likely to be implemented?
THE MINISTER OF STATE FOR COAL (SHRI C.K. JAFFER SHARIEF): (a) The CIL coal companies make constant efforts to improve the quality of life of their employees by upgradation of facilities like, housing, water supply, medical and educational facilities etc. This will be evident from the following table:Position at the end of 1988
%age increase
ing on a retirement benefit scheme for its employees. The details of the scheme are yet to be finalised.
Electrification of Villages in Rajasthan
4759. SHRI VIRDHI CHANDER JAIN: Will the Minister of ENERGY be pleased to state:
(a) the number and percentages of villages electrified in Rajasthan till date, district-wise;
(b) whether Jaisalmer district of Rajasthan is lagging behind all the districts in electrification;
| english |
{"packages":{"wpackagist-plugin\/my-review":{"1.0":{"name":"wpackagist-plugin\/my-review","version":"1.0","version_normalized":"1.0.0.0","uid":227388,"dist":{"type":"zip","url":"https:\/\/downloads.wordpress.org\/plugin\/my-review.1.0.zip"},"source":{"type":"svn","url":"https:\/\/plugins.svn.wordpress.org\/my-review\/","reference":"tags\/1.0"},"homepage":"https:\/\/wordpress.org\/plugins\/my-review\/","require":{"composer\/installers":"~1.0"},"type":"wordpress-plugin"},"1.0.1":{"name":"wpackagist-plugin\/my-review","version":"1.0.1","version_normalized":"1.0.1.0","uid":227389,"dist":{"type":"zip","url":"https:\/\/downloads.wordpress.org\/plugin\/my-review.1.0.1.zip"},"source":{"type":"svn","url":"https:\/\/plugins.svn.wordpress.org\/my-review\/","reference":"tags\/1.0.1"},"homepage":"https:\/\/wordpress.org\/plugins\/my-review\/","require":{"composer\/installers":"~1.0"},"type":"wordpress-plugin"},"1.0.2":{"name":"wpackagist-plugin\/my-review","version":"1.0.2","version_normalized":"1.0.2.0","uid":227390,"dist":{"type":"zip","url":"https:\/\/downloads.wordpress.org\/plugin\/my-review.1.0.2.zip"},"source":{"type":"svn","url":"https:\/\/plugins.svn.wordpress.org\/my-review\/","reference":"tags\/1.0.2"},"homepage":"https:\/\/wordpress.org\/plugins\/my-review\/","require":{"composer\/installers":"~1.0"},"type":"wordpress-plugin"},"1.2":{"name":"wpackagist-plugin\/my-review","version":"1.2","version_normalized":"1.2.0.0","uid":227391,"dist":{"type":"zip","url":"https:\/\/downloads.wordpress.org\/plugin\/my-review.1.2.zip"},"source":{"type":"svn","url":"https:\/\/plugins.svn.wordpress.org\/my-review\/","reference":"tags\/1.2"},"homepage":"https:\/\/wordpress.org\/plugins\/my-review\/","require":{"composer\/installers":"~1.0"},"type":"wordpress-plugin"},"dev-trunk":{"name":"wpackagist-plugin\/my-review","version":"dev-trunk","version_normalized":"9999999-dev","uid":227392,"time":"2008-06-07 08:26:43","dist":{"type":"zip","url":"https:\/\/downloads.wordpress.org\/plugin\/my-review.zip?timestamp=1212827203"},"source":{"type":"svn","url":"https:\/\/plugins.svn.wordpress.org\/my-review\/","reference":"trunk"},"homepage":"https:\/\/wordpress.org\/plugins\/my-review\/","require":{"composer\/installers":"~1.0"},"type":"wordpress-plugin"}}}} | json |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @file test_wsdl.py
# @brief Python unittest for PortageLive's WSDL.
#
# @author <NAME>
#
# Traitement multilingue de textes / Multilingual Text Processing
# Centre de recherche en technologies numériques / Digital Technologies Research Centre
# Conseil national de recherches Canada / National Research Council Canada
# Copyright 2018, Sa Majeste la Reine du Chef du Canada
# Copyright 2018, Her Majesty in Right of Canada
# python -m unittest tests.test_wsdl
# python -m unittest tests.test_wsdl.TestGetAllContexts
# python -m unittest tests.test_wsdl.TestGetAllContexts.testJson01
# python -m unittest discover -s tests -p 'test*.py'
from __future__ import print_function
import json
import re
import suds
import time
import unittest
from suds.client import Client
import logging
logging.basicConfig(format='%(asctime)-15s %(name)-8s %(message)s')
logging.getLogger('suds.client').setLevel(logging.CRITICAL) # Set it to INFO to see the SOAP envelop that is sent.
logging.getLogger('suds.transport').setLevel(logging.CRITICAL)
#####################################
# Suds has its own cache /tmp/suds/*
# rm /tmp/suds/*
# rm /var/lib/php/wsdlcache/
#####################################
from suds.cache import DocumentCache
DocumentCache().clear()
class TestGetAllContexts(unittest.TestCase):
"""
Unittest for WSDL's getAllContexts().
"""
def __init__(self, *args, **kwargs):
super(TestGetAllContexts, self).__init__(*args, **kwargs)
self.c = Client('http://localhost/PortageLiveAPI.wsdl')
# ADMIN.e2f (EN-CA --> FR-CA) [Incr]
self.re = re.compile(r'.+ \(([-a-zA-Z]+ --> [-a-zA-Z])|\w+\)( [Incr])?')
def testString01(self):
"""
getAllContexts() not in verbose mode and not in json.
Note that I'm not sure what to validate for this request?
"""
response = self.c.service.getAllContexts(verbose=False, json=False)
contexts = response.strip().split(';')
self.assertTrue(len(contexts) > 0, 'You should get at least one context. Are you using a valid server?')
def testString02(self):
"""
getAllContexts() in verbose mode but not in json.
Expected format for one context:
ADMIN.e2f (EN-CA --> FR-CA) [Incr]
"""
response = self.c.service.getAllContexts(verbose=True, json=False)
contexts = response.strip().split(';')
self.assertTrue(len(contexts) > 0, 'You should get at least one context. Are you using a valid server?')
for m in contexts:
self.assertTrue(self.re.match(m), 'Invalid context format: {}'.format(m))
def testJson01(self):
"""
getAllContexts() in json mode but not in verbose mode.
This is the expected json response's format:
{
u'source': u'EN-CA',
u'target': u'FR-CA',
u'is_incremental': False,
u'name': u'ADMIN.e2f',
u'description': u'ADMIN.e2f (EN-CA --> FR-CA) [Incr]'
}
"""
response = self.c.service.getAllContexts(verbose=False, json=True)
response = json.loads(response)
contexts = response['contexts']
self.assertTrue(len(contexts) > 0, 'You should get at least one context. Are you using a valid server?')
for c in contexts:
self.assertTrue('source' in c.viewkeys(), 'Missing source')
self.assertTrue('target' in c.viewkeys(), 'Missing target')
self.assertTrue('name' in c.viewkeys(), 'Missing name')
self.assertTrue('description' in c.viewkeys(), 'Missing description')
self.assertTrue('is_incremental' in c.viewkeys(), 'Missing is_incremental')
def testJson02(self):
"""
getAllContexts() in json mode and also in verbose mode.
A verbose json response is the same as a none verbose one.
"""
# This part is not verbose.
response = self.c.service.getAllContexts(verbose=False, json=True)
response = json.loads(response)
contexts = response['contexts']
self.assertTrue(len(contexts) > 0, 'You should get at least one context. Are you using a valid server?')
# This part is in verbose mode.
response_verbose = self.c.service.getAllContexts(verbose=True, json=True)
response_verbose = json.loads(response_verbose)
contexts_verbose = response_verbose['contexts']
self.assertTrue(len(contexts_verbose) > 0, 'You should get at least one context. Are you using a valid server?')
# There should be no difference between json verbose and json not verbose.
self.assertEquals(cmp(contexts, contexts_verbose), 0, 'Both json verbose or not requests should be equal.')
class TestIncrAddSentence(unittest.TestCase):
def setUp(self):
self.c = Client('http://localhost/PortageLiveAPI.wsdl')
self.context = 'incremental'
self.doc_id = 'unittest_doc_id'
self.source = 'This is a source sentence.'
self.target = 'This is a target sentence.'
self.extra_data = 'This is some extra data for my block.'
def testAddSentence(self):
self.assertTrue(self.c.service.incrAddSentence(self.context, self.doc_id, self.source, self.target, self.extra_data))
class TestIncrAddTextBlock(unittest.TestCase):
"""
incrAddTextBlock() is used when we want to send multiple sentence
source/target to be add to an incremental systems.
"""
def setUp(self):
self.c = Client('http://localhost/PortageLiveAPI.wsdl')
self.context = 'incremental'
self.doc_id = 'unittest_doc_id'
self.source = 'This is a source block.'
self.target = 'This is a target block.'
self.extra_data = 'This is some extra data for my block.'
self.big_source = """This is a bigger block.
It has multiple lines.
Three lines in total."""
self.big_target = """Here's a multiline translation.
We will make it this block longer than the source block.
Hopefully, the aligner will to a great job.
But, we are not helping it."""
def testEmptyContext(self):
with self.assertRaises(suds.WebFault) as cm:
self.c.service.incrAddTextBlock( '', self.doc_id, self.source, self.target)
self.assertEqual(cm.exception.message, u"Server raised fault: 'You must provide a valid context.'")
def testBadContext(self):
with self.assertRaises(suds.WebFault) as cm:
self.c.service.incrAddTextBlock('BAD_CONTEXT', self.doc_id, self.source, self.target)
self.assertEqual(cm.exception.message, u"Server raised fault: 'Context \"BAD_CONTEXT\" does not exist.\n'")
def testNoDocumentID(self):
with self.assertRaises(suds.WebFault) as cm:
self.c.service.incrAddTextBlock(self.context)
self.assertEqual(cm.exception.message, u"Server raised fault: 'You must provide a valid document_model_id.'")
def testEmptyDocumentID(self):
with self.assertRaises(suds.WebFault) as cm:
self.c.service.incrAddTextBlock(self.context, '', self.source, self.target)
self.assertEqual(cm.exception.message, u"Server raised fault: 'You must provide a valid document_model_id.'")
def testNoSource(self):
with self.assertRaises(suds.WebFault) as cm:
self.c.service.incrAddTextBlock(self.context, self.doc_id)
self.assertEqual(cm.exception.message, u"Server raised fault: 'You must provide a source text block.'")
def testEmptySource(self):
with self.assertRaises(suds.WebFault) as cm:
self.c.service.incrAddTextBlock(self.context, self.doc_id, '')
self.assertEqual(cm.exception.message, u"Server raised fault: 'You must provide a source text block.'")
def testNoTarget(self):
with self.assertRaises(suds.WebFault) as cm:
self.c.service.incrAddTextBlock(self.context, self.doc_id, self.source)
self.assertEqual(cm.exception.message, u"Server raised fault: 'You must provide a target text block.'")
def testEmptyTarget(self):
with self.assertRaises(suds.WebFault) as cm:
self.c.service.incrAddTextBlock(self.context, self.doc_id, self.source, '')
self.assertEqual(cm.exception.message, u"Server raised fault: 'You must provide a target text block.'")
def testAddBlock(self):
"""
Using `incrAddTextBlock()` with a simple sentence pair.
"""
self.assertTrue(self.c.service.incrAddTextBlock(self.context, self.doc_id, self.source, self.target, self.extra_data))
def testAddBigBlock(self):
"""
Using `incrAddTextBlock()` with multiple sentence pairs.
"""
self.assertTrue(self.c.service.incrAddTextBlock(self.context, self.doc_id, self.big_source, self.big_target, self.extra_data))
<EMAIL>("Skipping this test as it needs to wait for the server to finish incremental training which could take some time.")
def testBlockEnd(self):
"""
The intend of this test is to validate that `incrAddTextBlock()`
proctects `__BLOCK_END__`, a special token used during the corpora alignment.
We send a OOV `foobarbaz` with its translation `__BLOCK_END__`, wait
for the server to finish its incremental update and then, we expect the
translation of `foobarbaz` to be `__block_end_protected__`.
"""
self.assertTrue(self.c.service.incrAddTextBlock(self.context, self.doc_id, 'foobarbaz', '__BLOCK_END__', 'unittest: guarding __BLOCK_END__'))
time.sleep(10)
translation = self.c.service.translate('foobarbaz', self.context + '/' + self.doc_id, 's')
#print(translation)
self.assertEqual(translation['Result'].strip(), '__block_end__')
| python |
In the last thirty years, FC Shalke have picked up a reputation as a club that loves provide a youth-first approach. The high-risk approach has seen the Royal Blues producing some of the biggest talents in German football. Their dependence on youth have seen Knappenschmiede products, also called the Schalke Academy, turn into a seal of quality in German football.
The road to their present success has had its share of difficulties. The Royal Blues had to disband and abolish their U16 team for a couple of years to allow the club to undertake a major revamp to their youth systems.
Owing to the success of the youth setup, Schalke has finished outside of the top 10 just 6 times in the last 30 years. During this time, the club has won two UEFA Intertoto Cups, UEFA Cup, three German Cups and the German Super Cup - their biggest trophy haul since the early 1940s and late 50s.
One of the very few academies in the world with state of the art facilities, Schalke have now turned into the hub of German youth football.
Here are ten of the best players to have graduated from the Knappenschmiede.
Dubbed one of the greatest talents in German football during his early years, Max Meyer joined the Schalke Academy at the age of 14. The attacking midfielder spent three years at the academy before making professional debut for the Schalke reserve team in 2013.
The next five years saw Meyer making his debut and becoming one of the key players in Schalke's midfield. A dispute with the Gelsenkirchen club's management saw the midfielder running down his contract and joining Crystal Palace in 2018.
A fan-favourite during his time at the Veltins-Arena, Meyer made 192 appearances and scored 22 times before joining the English Premier League side.
Kehrer joined the Gelsenkirchen club's Academy in 2012 from VFB Stuggart. He spent three years in the academy before making his first-team debut in 2016.
The defender went on to spend just two more seasons in Germany before securing a big-money move to French giants Paris Saint Germain. In his two-year stint with the first-team, Kehrer made 59 appearances and scored 4 times.
The 23-year-old, who is capable of playing on the right as well as on the centre, is now one of the hottest young defensive prospects in the world.
Nicknamed 'Stan' after the late inaugural Balon d'Or winner Sir Stanley Matthews, Reinhard Libuda is arguably the one of the greatest talents to come out of the Schalke Academy during the last century. The winger joined the miners in 1954 at the age of 11 and rose through the Academy before making his debut seven years later in 1961.
Libuda spent four seasons with Schalke before making a controversial move to join arch-rivals Borussia Dortmund. Three years later he was back with the miners after once again crossing the Ruhr river to join his boyhood club. Four years later, Libuda made one more move away from the Royal Blues to join RC Strasbourg before rejoining the club and calling it a day in 1976.
Blessed with tremendous pace and exceptional dribbling skills, Libuda was one of the stars of the German national team during the 1960s. A lifetime ban in 1972 for bribery, which was later cleared, saw his career fall apart and drive him to retirement four years later.
Reinhard Libuda died in 1996 after being diagnosed with throat cancer.
Signed at the age of 13, young Howedes spent six years in the Academy before making his first-team debut in 2007. A versatile and reliable defender, Howedes spent 10 seasons at the Veltkins-Arena before moving to Juventus on loan during the 2017-18 season.
A move to Russian side Lokomotiv Moscow followed for the defender at the end of the 2017/18 season after Howedes ran his contract down. At 31, Howedes is past his prime but still remains in contention for a callup to the German national side despite making his last appearance way back in 2017.
During his stay at the Gelsenkirchen side, the defender made 335 appearances and scored 23 times. He was also part of the German side that won the 2014 FIFA World Cup.
At just 24, Leroy Sane is already an established household name in the world. The German winger joined the Schalke Academy at the age of 9 but left the club three years later for Bayer Leverkusen only to rejoin the Miners another three years later.
Sane made his first-team debut in 2014, at the age of 18, against VFB Stuttgart after spending six years in the Schalke Academy. The youngster quickly became one of the first-names in the Miners teamsheet as he established himself as one of the biggest young talents in the world.
The youngster caught the eye of Pep Guardiola and soon was on a plane to England as he joined Manchester City to become one of the Spaniards' first signings. In his two years at the Ruhr region, Leroy Sane made 57 appearances and scored thirteen times for the Gelsenkirchen side.
The German international was born just thirty minutes away from Schalke Veltin's Arena in Gladbeck and duly signed for the Royal Blues at the age of 8. Draxler rose through the ranks of the youth academy and made his first-team debut in 2011 at the age of 17 years and 117 days - becoming the fourth-youngest player in the history of the Bundesliga.
In his first three full seasons as a professional, Draxler helped bring the Royal Blues back into the Champions League after finishing in the Top 4 of the Bundesliga. An injury-marred 2014-15 season for Draxler saw Schalke struggling as they finished outside the European places for the first time in three seasons. The following season saw young Draxler moving to Wolfsburg after making 170 appearances and scoring 30 goals for the Royal Blues.
Now plying his trade in Ligue 1 with PSG, Draxler looks far from his best as he looks to regain his place in the star-studded PSG first-team.
Arguably the greatest outfield player produced by Schalke Academy in the 20th century, Olaf Thon joined the Miners Academy at the age of 14. He spent three years in the Academy before making his first-team debut at the age of 17.
Thon had two spells with the Miners on either side of six seasons spell with Bayern Munich. The striker spent five seasons in the Veltins-Arena during his first spell between 1983 and 88. The second spell saw Thon spending eight seasons with the club between 1994 till his last day as a professional in 2002.
Nicknamed the 'Professor' the midfielder made over 350 appearances and scored 75 times for the Royal Blues during his 13-year long career with Schalke. Thon was part of the 1990 German side that won the World Cup.
The greatest player to come out of the Royal Blues academy in the 20th century. The shot-stopper joined the youth setup in 1987-year-old and made his first-team debut a year later. After a rocky start, Lehmann matured into one of the best goalkeepers of his generation.
Lehmann went onto spend 10 seasons at Veltins-Arena before moving to AC Milan at the end of the 1997/98 season. The custodian was a key member of the squad that won 1996/97 UEFA Cup, Schalke's only success in the competition.
A failed move to Milan was followed by a return to Germany, joining Schalke's arch-rivals Borussia Dortmund. A move to Arsenal soon followed before returning to Germany to join VfB Stuttgart. Jens Lehmann called it a day in 2011, after appearing once for the Gunners while they faced a goalkeeper injury crisis.
A Schalke legend, Lehmann made 312 appearances and even scored three goals for the Miners during his 10 seasons. Often called 'Mad Jens', Lehmann was known for his on-field gimmicks and fantastic goalkeeping ability.
One word to describe Manuel Neuer - Revolutionary. The greatest goalkeeper of his generation and arguably one of the greatest ever, Neuer was a pioneering figure in introducing the concept of sweeper-keeper to the world. The German stopper, who was often seen alongside the defenders and sometimes in midfield, helped bring forward a different dimension to the position of a goalkeeper.
Signed at the age of 5, Neuer rose through Schalke's various youth teams before making his professional debut for the reserves side in 2004. Two years later, He made his first-team debut for the Royal Blues after coming on as a second-half substitute against Hertha Berlin.
Blessed with excellent technique with both feet and hands, Neuer quickly became the first-team choice of the Royal Blues shortly after making his debut. Neuer went onto captain the side during his final season with the club in 2010/11 season before joining Bayern Munich.
Manuel Neuer spent almost 20 years of his life in Schake and made over 200 appearances for the Royal Blues. The shot-stopper played a key role in 2014 as the Germans won their fourth World Cup.
There have only been a few players who have been blessed with Mesut Ozil's vision and ability to pick a pass. The German joined Schalke's youth setup as a 16-year-old and made his first-team debut a year later. Ozil though spent only two seasons at the Veltins-Arena, making 39 appearances and scoring once, before joining Werder Bremen in 2008 following a fallout with the club management.
An impressive 2010 World Cup saw Ozil signing for Real Madrid. At Madrid, Ozil helped create one of the most devastating counter-attacking units of this generation under Jose Mourinho.
Following the departure of Mourinho and arrival of Toni Kroos and James Rodriguez, the German midfielder was sold to Arsenal in 2013. Mesut Ozil was one of the key members for the 2014 German World Cup-winning team. | english |
{"cam/image_array":"5889_cam-image_array_.jpg","user/throttle":0.0,"user/angle":0.1331350952386856,"user/mode":"user"} | json |
package broker
import (
"github.com/Azure/service-catalog-cli/cmd/svcat/command"
"github.com/Azure/service-catalog-cli/cmd/svcat/output"
"github.com/spf13/cobra"
)
type getCmd struct {
*command.Context
name string
}
// NewGetCmd builds a "svcat get brokers" command
func NewGetCmd(cxt *command.Context) *cobra.Command {
getCmd := getCmd{Context: cxt}
cmd := &cobra.Command{
Use: "brokers [name]",
Aliases: []string{"broker", "brk"},
Short: "List brokers, optionally filtered by name",
Example: `
svcat get brokers
svcat get broker asb
`,
RunE: func(cmd *cobra.Command, args []string) error {
return getCmd.run(args)
},
}
return cmd
}
func (c *getCmd) run(args []string) error {
if len(args) == 0 {
return c.getAll()
} else {
c.name = args[0]
return c.get()
}
}
func (c *getCmd) getAll() error {
brokers, err := c.App.RetrieveBrokers()
if err != nil {
return err
}
output.WriteBrokerList(c.Output, brokers...)
return nil
}
func (c *getCmd) get() error {
broker, err := c.App.RetrieveBroker(c.name)
if err != nil {
return err
}
output.WriteBrokerList(c.Output, *broker)
return nil
}
| go |
The BJP had given Vikassheel Insan Party 11 seats from its own quota and it managed to win four, though VIP chief Mukesh Sahani lost himself in last Bihar elections.
Patna: A day after all three MLAs of the Vikassheel Insan Party (VIP) joined the BJP, the Rashtriya Janata Dal (RJD) has given an indication that its doors are also shut for beleaguered party chief Mukesh Sahani.
Former chief minister Rabri Devi said: "Whatever he sowed, he is reaping the same. "
Her reference was to the run-up of the 2020 Assembly election when Sahani, who was then the RJD-led Mahagathbandhan, left all parties' joint press conference held in a Patna hotel, accusing RJD leader Tejashwi Yadav of back-stabbing him. On the same day, he went to New Delhi, met Home Minister Amit Shah and switched over to the NDA.
The BJP had given his VIP 11 seats from its own quota and it managed to win four, though Sahani lost himself. The NDA government accommodated him in the Legislative Council and on this basis, he bagged a ministry in the Nitish Kumar government.
Meanwhile, Sahani, who is the Animal Husbandry and Fisheries Minister, said that he would not quit on his own.
"I would not resign from the post. The Chief Minister would decide my fate. It is his special privilege," he said.
Sahani came to the Assembly and sat near to cabinet minister Ram Surat Rai and Jibesh Mishra, though neither interacted with him. Sahani himself focussed on his mobile phone.
"I knew about the consequences. In the last 4 months, I was humiliated by a particular party's leader. They were angry at me as I was gaining good political ground in Uttar Pradesh and Bihar.
"I was working for Nishadh reservation and my fight will continue. I am not afraid of anyone and I will contest in the Bochahan by-election and MLC election for the 24 seats with full strength," Sahani said.
Meanwhile, BJP OBC Morcha's national General Secretary cum Bihar BJP spokesperson Dr. Nikhil Anand said that the BJP has heartfelt respect for the parties involved in the NDA alliance and their top leaders.
"Mukesh Sahani contested the elections in Uttar Pradesh. . . it was not a big deal but he constantly made malicious and unfortunate personal remarks against Prime Minister Narendra Modi and Chief Minister Yogi Adityanath.
"After all, what problem or enmity does Mukesh Sahani have with Narendra Modi ji? Does Mukesh Sahani not believe that Narendra Modi is a symbol of national pride for the most backward communities in India? Sahni should apologise for using abusive words against PM Modi ji and UP CM Yogi ji during Uttar Pradesh elections," Anand said. | english |
<reponame>usertesting/dagobah<filename>dagobah/daemon/api.py
""" HTTP API methods for Dagobah daemon. """
import StringIO
import json
from flask import request, abort, send_file
from flask_login import login_required
from .daemon import app
from .util import validate_dict, api_call, allowed_file
dagobah = app.config['dagobah']
@app.route('/api/jobs', methods=['GET'])
@login_required
@api_call
def get_jobs():
return dagobah._serialize().get('jobs', {})
@app.route('/api/job', methods=['GET'])
@login_required
@api_call
def get_job():
args = dict(request.args)
if not validate_dict(args,
required=['job_name'],
job_name=str):
abort(400)
job = dagobah.get_job(args['job_name'])
if not job:
abort(400)
return job._serialize()
@app.route('/api/logs', methods=['GET'])
@login_required
@api_call
def get_run_log_history():
args = dict(request.args)
if not validate_dict(args,
required=['job_name', 'task_name'],
job_name=str,
task_name=str):
abort(400)
job = dagobah.get_job(args['job_name'])
task = job.tasks.get(args['task_name'], None)
if not task:
abort(400)
return task.get_run_log_history()
@app.route('/api/log', methods=['GET'])
@login_required
@api_call
def get_log():
args = dict(request.args)
if not validate_dict(args,
required=['job_name', 'task_name', 'log_id'],
job_name=str,
task_name=str,
log_id=str):
abort(400)
job = dagobah.get_job(args['job_name'])
task = job.tasks.get(args['task_name'], None)
if not task:
abort(400)
return task.get_run_log(args['log_id'])
@app.route('/api/head', methods=['GET'])
@login_required
@api_call
def head_task():
args = dict(request.args)
if not validate_dict(args,
required=['job_name', 'task_name'],
job_name=str,
task_name=str,
stream=str,
num_lines=int):
abort(400)
job = dagobah.get_job(args['job_name'])
task = job.tasks.get(args['task_name'], None)
if not task:
abort(400)
call_args = {}
for key in ['stream', 'num_lines']:
if key in args:
call_args[key] = args[key]
return task.head(**call_args)
@app.route('/api/tail', methods=['GET'])
@login_required
@api_call
def tail_task():
args = dict(request.args)
if not validate_dict(args,
required=['job_name', 'task_name'],
job_name=str,
task_name=str,
stream=str,
num_lines=int):
abort(400)
job = dagobah.get_job(args['job_name'])
task = job.tasks.get(args['task_name'], None)
if not task:
abort(400)
call_args = {}
for key in ['stream', 'num_lines']:
if key in args:
call_args[key] = args[key]
return task.tail(**call_args)
@app.route('/api/add_job', methods=['POST'])
@login_required
@api_call
def add_job():
args = dict(request.form)
if not validate_dict(args,
required=['job_name'],
job_name=str):
abort(400)
dagobah.add_job(args['job_name'])
@app.route('/api/delete_job', methods=['POST'])
@login_required
@api_call
def delete_job():
args = dict(request.form)
if not validate_dict(args,
required=['job_name'],
job_name=str):
abort(400)
dagobah.delete_job(args['job_name'])
@app.route('/api/start_job', methods=['POST'])
@login_required
@api_call
def start_job():
args = dict(request.form)
if not validate_dict(args,
required=['job_name'],
job_name=str):
abort(400)
job = dagobah.get_job(args['job_name'])
job.start()
@app.route('/api/retry_job', methods=['POST'])
@login_required
@api_call
def retry_job():
args = dict(request.form)
if not validate_dict(args,
required=['job_name'],
job_name=str):
abort(400)
job = dagobah.get_job(args['job_name'])
job.retry()
@app.route('/api/add_task_to_job', methods=['POST'])
@login_required
@api_call
def add_task_to_job():
args = dict(request.form)
if not validate_dict(args,
required=['job_name', 'task_command', 'task_name'],
job_name=str,
task_command=str,
task_name=str,
task_target=str):
abort(400)
dagobah.add_task_to_job(args['job_name'],
args['task_command'],
args['task_name'],
hostname=args.get("task_target", None))
@app.route('/api/delete_task', methods=['POST'])
@login_required
@api_call
def delete_task():
args = dict(request.form)
if not validate_dict(args,
required=['job_name', 'task_name'],
job_name=str,
task_name=str):
abort(400)
job = dagobah.get_job(args['job_name'])
job.delete_task(args['task_name'])
@app.route('/api/add_dependency', methods=['POST'])
@login_required
@api_call
def add_dependency():
args = dict(request.form)
if not validate_dict(args,
required=['job_name',
'from_task_name',
'to_task_name'],
job_name=str,
from_task_name=str,
to_task_name=str):
abort(400)
job = dagobah.get_job(args['job_name'])
job.add_dependency(args['from_task_name'], args['to_task_name'])
@app.route('/api/delete_dependency', methods=['POST'])
@login_required
@api_call
def delete_dependency():
args = dict(request.form)
if not validate_dict(args,
required=['job_name',
'from_task_name',
'to_task_name'],
job_name=str,
from_task_name=str,
to_task_name=str):
abort(400)
job = dagobah.get_job(args['job_name'])
job.delete_dependency(args['from_task_name'], args['to_task_name'])
@app.route('/api/schedule_job', methods=['POST'])
@login_required
@api_call
def schedule_job():
args = dict(request.form)
if not validate_dict(args,
required=['job_name', 'cron_schedule'],
job_name=str,
cron_schedule=str):
abort(400)
if args['cron_schedule'] == '':
args['cron_schedule'] = None
job = dagobah.get_job(args['job_name'])
job.schedule(args['cron_schedule'])
@app.route('/api/stop_scheduler', methods=['POST'])
@login_required
@api_call
def stop_scheduler():
dagobah.scheduler.stop()
@app.route('/api/restart_scheduler', methods=['POST'])
@login_required
@api_call
def restart_scheduler():
dagobah.scheduler.restart()
@app.route('/api/terminate_all_tasks', methods=['POST'])
@login_required
@api_call
def terminate_all_tasks():
args = dict(request.form)
if not validate_dict(args,
required=['job_name'],
job_name=str):
abort(400)
job = dagobah.get_job(args['job_name'])
job.terminate_all()
@app.route('/api/kill_all_tasks', methods=['POST'])
@login_required
@api_call
def kill_all_tasks():
args = dict(request.form)
if not validate_dict(args,
required=['job_name'],
job_name=str):
abort(400)
job = dagobah.get_job(args['job_name'])
job.kill_all()
@app.route('/api/terminate_task', methods=['POST'])
@login_required
@api_call
def terminate_task():
args = dict(request.form)
if not validate_dict(args,
required=['job_name', 'task_name'],
job_name=str,
task_name=str):
abort(400)
job = dagobah.get_job(args['job_name'])
task = job.tasks.get(args['task_name'], None)
if not task:
abort(400)
task.terminate()
@app.route('/api/kill_task', methods=['POST'])
@login_required
@api_call
def kill_task():
args = dict(request.form)
if not validate_dict(args,
required=['job_name', 'task_name'],
job_name=str,
task_name=str):
abort(400)
job = dagobah.get_job(args['job_name'])
task = job.tasks.get(args['task_name'], None)
if not task:
abort(400)
task.kill()
@app.route('/api/edit_job', methods=['POST'])
@login_required
@api_call
def edit_job():
args = dict(request.form)
if not validate_dict(args,
required=['job_name'],
job_name=str,
name=str):
abort(400)
job = dagobah.get_job(args['job_name'])
del args['job_name']
job.edit(**args)
@app.route('/api/update_job_notes', methods=['POST'])
@login_required
@api_call
def update_job_notes():
args = dict(request.form)
if not validate_dict(args,
required=['job_name', 'notes'],
job_name=str,
notes=str):
abort(400)
job = dagobah.get_job(args['job_name'])
job.update_job_notes(args['notes'])
@app.route('/api/edit_task', methods=['POST'])
@login_required
@api_call
def edit_task():
args = dict(request.form)
if not validate_dict(args,
required=['job_name', 'task_name'],
job_name=str,
task_name=str,
name=str,
command=str,
soft_timeout=int,
hard_timeout=int,
hostname=str):
abort(400)
job = dagobah.get_job(args['job_name'])
task = job.tasks.get(args['task_name'], None)
if not task:
abort(400)
# validate host
if 'hostname' in args and args.get('hostname') not in dagobah.get_hosts():
# Check for empty host, if so then task is no longer remote
if not args.get('hostname'):
args['hostname'] = None
else:
abort(400)
del args['job_name']
del args['task_name']
job.edit_task(task.name, **args)
@app.route('/api/set_soft_timeout', methods=['POST'])
@login_required
@api_call
def set_soft_timeout():
args = dict(request.form)
if not validate_dict(args,
required=['job_name', 'task_name', 'soft_timeout'],
job_name=str,
task_name=str,
soft_timeout=int):
abort(400)
job = dagobah.get_job(args['job_name'])
task = job.tasks.get(args['task_name'], None)
if not task:
abort(400)
task.set_soft_timeout(args['soft_timeout'])
@app.route('/api/set_hard_timeout', methods=['POST'])
@login_required
@api_call
def set_hard_timeout():
args = dict(request.form)
if not validate_dict(args,
required=['job_name', 'task_name', 'hard_timeout'],
job_name=str,
task_name=str,
hard_timeout=int):
abort(400)
job = dagobah.get_job(args['job_name'])
task = job.tasks.get(args['task_name'], None)
if not task:
abort(400)
task.set_hard_timeout(args['hard_timeout'])
@app.route('/api/export_job', methods=['GET'])
@login_required
def export_job():
args = dict(request.args)
if not validate_dict(args,
required=['job_name'],
job_name=str):
abort(400)
job = dagobah.get_job(args['job_name'])
to_send = StringIO.StringIO()
to_send.write(json.dumps(job._serialize(strict_json=True)))
to_send.write('\n')
to_send.seek(0)
return send_file(to_send,
attachment_filename='%s.json' % job.name,
as_attachment=True)
@app.route('/api/import_job', methods=['POST'])
@login_required
@api_call
def import_job():
file = request.files['file']
if (file and allowed_file(file.filename, ['json'])):
dagobah.add_job_from_json(file.read(), destructive=True)
@app.route('/api/hosts', methods=['GET'])
@login_required
@api_call
def get_hosts():
return dagobah.get_hosts()
| python |
{"variants":{"type\u003degg":{"model":"conquest:block/irregular_sandstone_tiles_sphere_dragonegg"},"type\u003dsmall":{"model":"conquest:block/irregular_sandstone_tiles_sphere_small"},"type\u003dlarge":{"model":"conquest:block/irregular_sandstone_tiles_sphere"}}} | json |
<gh_stars>0
from queue import Queue
import threading
from Spider.spider import spider
from helper_functions.domain import *
from helper_functions.files_manager import *
PROJECT_NAME = 'projects/quora'
HOME_PAGE = 'https://www.quora.com/profile/Abdelrahman-Hamdy-1'
DOMAIN_NAME = get_domain_name(HOME_PAGE)
QUEUE_FILE = PROJECT_NAME + "/queue.txt"
CRAWLED_FILE = PROJECT_NAME + "/crawled.txt"
NUMBER_OF_THREADS = 8
queue = Queue()
spider(PROJECT_NAME, HOME_PAGE, DOMAIN_NAME)
#Get someone to crawl for you
def create_workers():
for _ in range(NUMBER_OF_THREADS):
worker_thread = threading.Thread(target=work)
worker_thread.daemon = True
worker_thread.start()
# Do the next job in the queue
def work():
while True:
url = queue.get()
spider.crawl_page(threading.current_thread().name, url)
queue.task_done()
#Get something to crawl it
def create_jobs():
for link in file_to_set(QUEUE_FILE):
queue.put(link)
queue.join()
crawl()
#Checks if there are any links in the queue, crawl them
def crawl():
queued_links = file_to_set(QUEUE_FILE)
if len(queued_links) > 0:
print(str(len(queued_links)) + " links in the queue.")
create_jobs()
create_workers()
crawl() | python |
The Hatch Act is a significant federal law in the United States that places limitations on the political involvement of federal employees. Its primary objective is to prevent federal employees from engaging in partisan political activities while performing their official duties or representing the government. This legislation was initially enacted in 1939 and has undergone several amendments over the years.
The Hatch Act applies to most employees within the executive branch of the federal government, although certain positions and agencies have specific exemptions. It places restrictions on federal employees, such as prohibiting them from running for public office in partisan elections, utilizing their official authority or influence to interfere with election outcomes, soliciting or accepting political contributions, and engaging in partisan political activities while on duty or within government premises.
KEY DETAILS:
However, it is important to note that the Hatch Act does not completely bar federal employees from participating in political activities. They are permitted to express their personal opinions, engage in political discussions, and participate in political activities during their personal time and outside the workplace, as long as they do not employ their official position or government resources for such purposes.
The enforcement of the Hatch Act falls under the jurisdiction of the U.S. Office of Special Counsel (OSC). Any violations of this act can lead to disciplinary actions, including reprimands, suspensions, or even termination from federal service.
In a recent development, a federal agency has declared that White House press secretary Karine Jean-Pierre has violated the Hatch Act. The Hatch Act is a law that imposes restrictions on certain political activities of government employees. However, it is worth noting that Jean-Pierre is not the first high-profile individual to breach this law.
The US Office of the Special Counsel, an independent agency responsible for enforcing the Hatch Act, has found violations by notable figures in the past as well. Last year, President Joe Biden's former chief of staff, Ron Klain, was found to have violated the Hatch Act, as well as his former press secretary, Jen Psaki, in 2021. Additionally, the agency reported that 13 senior officials from the Trump administration also violated the Hatch Act in 2021.
Several notable individuals in the past have been found to have violated the Hatch Act. White House officials such as Kellyanne Conway, Jared Kushner, Kayleigh McEnany, and Mark Meadows, among others, were identified as having violated the act during their time in the Trump administration. Similarly, Dan Scavino, the White House social media director, and Nikki Haley, the former U.S. Ambassador to the United Nations, received official warnings for tweets that were deemed to have violated the Hatch Act in 2017.
Instances of Hatch Act violations are not limited to one political party or administration. During the Obama administration, Cabinet members such as Kathleen Sebelius, the Secretary of Health and Human Services, and Julian Castro, the Secretary of Housing and Urban Development, faced reprimands for their political comments and activities that ran afoul of the Hatch Act.
Most recently, in May, the OSC determined that Marcia Fudge, the Secretary of Housing and Urban Development, violated the Hatch Act when she made comments about Ohio politics from the White House podium earlier this year. These incidents serve as reminders of the importance of adhering to the restrictions outlined in the Hatch Act to maintain the integrity of the federal workforce and prevent undue political influence in the workplace.
| english |
When they carried the body of a 32-year-old Black man named Lamont Perry out of the woods in Wadesboro, North Carolina, there were no protests over his sudden death in police custody.
No reporters camped at the scene. No lawyers filed suit.
Instead, the final mark in the ledger of Perry’s life was made by a state medical examiner who attributed his death in large part to sickle cell trait, a genetic characteristic that overwhelmingly occurs in Black people. The official word was that he had died by accident.
But the examiner’s determination belied certain facts about that night in October 2016, public records and interviews show. Accused of violating probation in a misdemeanor assault case, Perry was chased by parole and police officers through the dark into a stand of trees, where only they could witness what happened next.
He had swelling of the brain, and a forensic investigator reported that he had an open fracture of his right leg. He was covered in dirt, and residents of a nearby housing complex told his family that when the officers emerged from the woods, their shoes and the bottoms of their pants were spattered in blood.
Perry’s case underscores how willing some American pathologists have been to rule in-custody deaths of Black people accidents or natural occurrences caused by sickle cell trait, which is carried by 1 in 13 Black Americans and is almost always benign. Those with the trait have only one of the two genes required for full-blown sickle cell disease, a painful and sometimes life-threatening condition that can deform red blood cells into crescent shapes that stick together and block blood flow.
As recently as August, lawyers for Derek Chauvin, the Minneapolis police officer convicted last month of murdering George Floyd, invoked sickle cell trait in an unsuccessful motion to dismiss the case against him, saying that the condition, along with other health problems and drug use, was the reason Floyd had died.
The New York Times has found at least 46 other instances over the past 25 years in which medical examiners, law enforcement officials or defenders of accused officers pointed to the trait as a cause or major factor in deaths of Black people in custody. Fifteen such deaths have occurred since 2015.
In roughly two-thirds of the cases, the person who died had been forcefully restrained by authorities, pepper-sprayed or shocked with stun guns. The determinations on sickle cell trait often created enough doubt for officers to avert criminal or civil penalties, the Times found.
In three cases, deaths linked to sickle cell trait that were deemed natural or of indeterminate cause were later ruled homicides — as occurred when Martin Lee Anderson, 14, died at the hands of his jailers at a northwest Florida juvenile detention camp in January 2006.
Not every death that is tied to the condition is inherently questionable. Medical experts say sickle cell trait has caused deaths in rare cases of extreme overexertion, especially among military trainees and college athletes. Three of the in-custody deaths identified by the Times involved people who were exercising vigorously in jail yards or running hard before they collapsed — and law enforcement officers said that at most they put handcuffs on them.
In none of the deaths examined by the Times did the person have actual sickle cell disease.
In interviews, Mitchell and other medical experts agreed that the trait warranted mention in autopsies but said any natural or accidental death attributed to it, even in part, should be scrutinized if the person died during or after a struggle with law enforcement.
Many said they suspected some sickle cell determinations might reflect a pattern of bias or conflicts of interest among medical examiners and police officials.
Forensic pathologists, the doctors who conduct autopsies for coroners and medical examiners, were singled out in a hotly disputed study published in a scientific journal in February suggesting that racial bias could influence their rulings, though it did not address sickle cell trait.
And coroners and medical examiners have entrenched relationships with law enforcement in many areas, functioning as part of police departments or working closely with them.
Perry had alcohol and a small amount of cocaine in his bloodstream when he died, and the medical examiner ruled that he had succumbed to “cocaine toxicity in the setting of sickle cell trait,” effectively ending any deeper inquiry. The local district attorney declined to bring charges.
For Perry’s relatives, who could not afford a lawyer to challenge the ruling, all that was left was a series of unanswered questions. What had happened in the woods? Why would the investigators not let them view the body before the autopsy?
To gain a sense of how often medical examiners have used sickle cell trait to explain in-custody deaths, the Times reviewed thousands of pages of autopsy records, court filings and police reports. It examined data on suspicious deaths from more than 30 of the U. S. ’ largest counties, whose jurisdictions cover nearly 1 in 3 Black Americans.
The review identified dozens of cases dating to the 1970s and was almost certainly an undercount.
Many of the deaths received little outside scrutiny at the time, in part because the families did not have the resources to challenge official determinations or because the detained people were not seen as particularly sympathetic. Many had histories of arrests on drug use, domestic violence or other charges, and additional evidence that might point to police misconduct, such as video footage, was often not made public.
The results of the review offer a vivid glimpse into deaths in custody. In the past 25 years, 19 cases involved Black people who died after being restrained in ways that could hinder breathing. Twelve deaths occurred after the police or sheriffs’ deputies used stun guns. Nine happened after they used pepper spray. Two followed bites from police dogs.
Five of the cases were initially ruled homicides.
The rest were labeled undetermined, accidental or natural.
In communities from California to Pennsylvania, officials cited the rulings in closing investigations into the deaths, ensuring that police agencies provided the last word on what had occurred.
David Campbell, 25, stopped breathing in Allentown, Pennsylvania, in October 2011 after resisting his jailers’ efforts to remove his clothing and put him on suicide watch. They responded by dousing him with pepper spray, jamming knees into his back and leaving him tied to a chair, according to a lawsuit brought by his family.
While the results of Campbell’s autopsy were pending, emails show, the head of the Lehigh County Corrections Department sent the coroner a video of the arrest of a Florida man whose death was attributed to “excited delirium” — a condition that pathologists say can suddenly kill drug users or the mentally ill, though they acknowledge it is poorly understood and unevenly applied.
The Times described its findings to Simon Dyson, a British researcher who studies sickle cell conditions and deaths in custody. He said the cases follow a well-established pattern in which the trait is listed alongside other conditions, like high blood pressure or drug use, to create doubt about the role of law enforcement.
“It’s all throwing a smoke screen up around the death that makes it more difficult to effect a prosecution,” he said.
Determining whether a death is a homicide is ultimately a judgment call, though most pathologists interviewed by the Times said they applied the label if the intentional actions of one person led to the death of another — even if those actions were taken by the police and the person who died had health problems.
But not all medical examiners agree on how much another person’s actions must contribute to the death to call it homicide. Dr. Lisa Scheinin, a former deputy medical examiner in Los Angeles who wrote a journal article in 2009 about sickle cell trait, said she had been “very hesitant” to rule in-custody deaths homicides unless the police had played an important role.
Most people with sickle cell trait never suffer a symptom, though studies and experts have suggested that on rare occasions it can cause the fatal curving of blood cells in people who overexert themselves when other conditions are present — for example, hot weather, high altitude or drug use.
Dr. Bruce Mitchell, the former director of hospital medicine at Emory University Hospital Midtown in Atlanta, who has studied sudden death and sickle cell trait, said the condition had been cited in the deaths of some military recruits because they are often made to run long distances in the heat and with heavy equipment without enough training or conditioning.
Several doctors and researchers who spoke with the Times said they would be skeptical of in-custody deaths attributed to sickle cell trait, unless the situation also involved other risk factors.
In at least three cases reviewed by the Times, the person was exerting himself and did not appear to interact significantly with law enforcement. In another, the environment was harsh: Darryl Daniels, 30, stopped breathing in Reno, Nevada, in 1998 after taking cocaine and running for several blocks in 97-degree weather. The pathologist acknowledged that sickle cell trait was “usually benign and asymptomatic except under circumstances of extreme stress” but wrote that the heat, activity and stimulant drugs provided that stress even before the man was arrested.
More often, the Times found, the police reported that the arrested people struggled, prompting the medical examiner to rule that their physical activity precipitated a so-called sickling crisis, when the blood cells bend into crescents and block blood vessels. In many instances, law enforcement also used control techniques that doctors said could limit oxygen enough to cause sickling and death. These included repeatedly using stun guns and pepper spray and holding people facedown with their arms behind them.
Sickle cell trait alone cannot cause death, said Dr. Swee Lay Thein, a hematologist at the National Institutes of Health who has studied the condition. “It has to be something else, and something quite extreme,” she said.
Medical experts also said it could be misleading to attribute death to the trait based on the presence of cells that have clumped or sickled — something that often happens when people with the condition stop breathing. Finding the crescent-shaped blood cells during an autopsy is to be expected, the experts said, and does not mean the cells were like that before death.
In the case of Floyd, the medical examiner in Minneapolis noted the curved cells and said he had had sickle cell trait. But the autopsy indicated that it had not contributed to his death, and there was no evidence the cells had sickled before he died. In their unsuccessful motion to dismiss the case, Chauvin’s lawyers nonetheless suggested that the trait could cause trouble breathing.
The argument echoed claims made in other cases as early as 1973, the Times found. That year, 28-year-old George Lucas died in the Cook County jail in Illinois, according to media reports at the time. Inmates testified that guards had beaten, strangled and suffocated him with a blanket, while jail officials said they had only strapped him to his bed. | english |
<filename>cisco-ios-xe/ydk/models/cisco_ios_xe/CISCO_IPSLA_ECHO_MIB.py
""" CISCO_IPSLA_ECHO_MIB
This MIB module defines the templates for IP SLA operations of
ICMP echo, UDP echo and TCP connect.
The ICMP echo operation measures end\-to\-end response time between
a Cisco router and any IP enabled device by computing the time
taken between sending an ICMP echo request message to the
destination and receiving an ICMP echo reply.
The UDP echo operation measures end\-to\-end response time between
a Cisco router and any IP enabled device by computing the time
taken between sending an UDP echo request message to the
destination and receiving an UDP echo reply.
The TCP connect operation measures end\-to\-end response time between
a Cisco router and any IP enabled device by computing the time
taken to perform a TCP connect operation.
"""
from collections import OrderedDict
from ydk.types import Entity, EntityPath, Identity, Enum, YType, YLeaf, YLeafList, YList, LeafDataList, Bits, Empty, Decimal64
from ydk.filters import YFilter
from ydk.errors import YError, YModelError
from ydk.errors.error_handler import handle_type_error as _handle_type_error
class CISCOIPSLAECHOMIB(Entity):
"""
.. attribute:: cipslaicmpechotmpltable
A table that contains ICMP echo template definitions
**type**\: :py:class:`CipslaIcmpEchoTmplTable <ydk.models.cisco_ios_xe.CISCO_IPSLA_ECHO_MIB.CISCOIPSLAECHOMIB.CipslaIcmpEchoTmplTable>`
.. attribute:: cipslaudpechotmpltable
A table that contains UDP echo template specific definitions
**type**\: :py:class:`CipslaUdpEchoTmplTable <ydk.models.cisco_ios_xe.CISCO_IPSLA_ECHO_MIB.CISCOIPSLAECHOMIB.CipslaUdpEchoTmplTable>`
.. attribute:: cipslatcpconntmpltable
A table that contains TCP connect template specific definitions
**type**\: :py:class:`CipslaTcpConnTmplTable <ydk.models.cisco_ios_xe.CISCO_IPSLA_ECHO_MIB.CISCOIPSLAECHOMIB.CipslaTcpConnTmplTable>`
"""
_prefix = 'CISCO-IPSLA-ECHO-MIB'
_revision = '2007-08-16'
def __init__(self):
super(CISCOIPSLAECHOMIB, self).__init__()
self._top_entity = None
self.yang_name = "CISCO-IPSLA-ECHO-MIB"
self.yang_parent_name = "CISCO-IPSLA-ECHO-MIB"
self.is_top_level_class = True
self.has_list_ancestor = False
self.ylist_key_names = []
self._child_classes = OrderedDict([("cipslaIcmpEchoTmplTable", ("cipslaicmpechotmpltable", CISCOIPSLAECHOMIB.CipslaIcmpEchoTmplTable)), ("cipslaUdpEchoTmplTable", ("cipslaudpechotmpltable", CISCOIPSLAECHOMIB.CipslaUdpEchoTmplTable)), ("cipslaTcpConnTmplTable", ("cipslatcpconntmpltable", CISCOIPSLAECHOMIB.CipslaTcpConnTmplTable))])
self._leafs = OrderedDict()
self.cipslaicmpechotmpltable = CISCOIPSLAECHOMIB.CipslaIcmpEchoTmplTable()
self.cipslaicmpechotmpltable.parent = self
self._children_name_map["cipslaicmpechotmpltable"] = "cipslaIcmpEchoTmplTable"
self.cipslaudpechotmpltable = CISCOIPSLAECHOMIB.CipslaUdpEchoTmplTable()
self.cipslaudpechotmpltable.parent = self
self._children_name_map["cipslaudpechotmpltable"] = "cipslaUdpEchoTmplTable"
self.cipslatcpconntmpltable = CISCOIPSLAECHOMIB.CipslaTcpConnTmplTable()
self.cipslatcpconntmpltable.parent = self
self._children_name_map["cipslatcpconntmpltable"] = "cipslaTcpConnTmplTable"
self._segment_path = lambda: "CISCO-IPSLA-ECHO-MIB:CISCO-IPSLA-ECHO-MIB"
self._is_frozen = True
def __setattr__(self, name, value):
self._perform_setattr(CISCOIPSLAECHOMIB, [], name, value)
class CipslaIcmpEchoTmplTable(Entity):
"""
A table that contains ICMP echo template definitions.
.. attribute:: cipslaicmpechotmplentry
A row entry representing an IPSLA ICMP echo template
**type**\: list of :py:class:`CipslaIcmpEchoTmplEntry <ydk.models.cisco_ios_xe.CISCO_IPSLA_ECHO_MIB.CISCOIPSLAECHOMIB.CipslaIcmpEchoTmplTable.CipslaIcmpEchoTmplEntry>`
"""
_prefix = 'CISCO-IPSLA-ECHO-MIB'
_revision = '2007-08-16'
def __init__(self):
super(CISCOIPSLAECHOMIB.CipslaIcmpEchoTmplTable, self).__init__()
self.yang_name = "cipslaIcmpEchoTmplTable"
self.yang_parent_name = "CISCO-IPSLA-ECHO-MIB"
self.is_top_level_class = False
self.has_list_ancestor = False
self.ylist_key_names = []
self._child_classes = OrderedDict([("cipslaIcmpEchoTmplEntry", ("cipslaicmpechotmplentry", CISCOIPSLAECHOMIB.CipslaIcmpEchoTmplTable.CipslaIcmpEchoTmplEntry))])
self._leafs = OrderedDict()
self.cipslaicmpechotmplentry = YList(self)
self._segment_path = lambda: "cipslaIcmpEchoTmplTable"
self._absolute_path = lambda: "CISCO-IPSLA-ECHO-MIB:CISCO-IPSLA-ECHO-MIB/%s" % self._segment_path()
self._is_frozen = True
def __setattr__(self, name, value):
self._perform_setattr(CISCOIPSLAECHOMIB.CipslaIcmpEchoTmplTable, [], name, value)
class CipslaIcmpEchoTmplEntry(Entity):
"""
A row entry representing an IPSLA ICMP echo template.
.. attribute:: cipslaicmpechotmplname (key)
This field is used to specify the ICMP echo template name
**type**\: str
**length:** 1..64
.. attribute:: cipslaicmpechotmpldescription
This field is used to provide description for the ICMP echo template
**type**\: str
**length:** 0..128
.. attribute:: cipslaicmpechotmplsrcaddrtype
An enumerated value which specifies the IP address type of the source. It must be used along with the cipslaIcmpEchoTmplSrcAddr object
**type**\: :py:class:`InetAddressType <ydk.models.cisco_ios_xe.INET_ADDRESS_MIB.InetAddressType>`
.. attribute:: cipslaicmpechotmplsrcaddr
A string which specifies the IP address of the source
**type**\: str
**length:** 0..255
.. attribute:: cipslaicmpechotmpltimeout
Specifies the duration to wait for a IP SLA operation completion. For connection oriented protocols, this may cause the connection to be closed by the operation. Once closed, it will be assumed that the connection reestablishment will be performed. To prevent unwanted closure of connections, be sure to set this value to a realistic connection timeout
**type**\: int
**range:** 0..604800000
**units**\: milliseconds
.. attribute:: cipslaicmpechotmplverifydata
When set to true, the resulting data in each IP SLA operation is compared with the expected data. This includes checking header information (if possible) and exact packet size
**type**\: bool
.. attribute:: cipslaicmpechotmplreqdatasize
This object represents the number of octets to be placed into the ARR Data portion of the request message, when using SNA protocols. For non\-ARR protocols' IP SLA request/responses, this value represents the native payload size. REMEMBER\: The ARR Header overhead is not included in this value
**type**\: int
**range:** 0..16384
**units**\: octets
.. attribute:: cipslaicmpechotmpltos
This object represents the type of service octet in an IP header
**type**\: int
**range:** 0..255
.. attribute:: cipslaicmpechotmplvrfname
This field is used to specify the VRF name with which the IP SLA operation will be used. For regular IP SLA operation this field should not be configured. The agent will use this field to identify the VRF routing table for this operation
**type**\: str
**length:** 0..32
.. attribute:: cipslaicmpechotmplthreshold
This object defines an administrative threshold limit. If the IP SLA operation time exceeds this limit and if the condition specified in cipslaIcmpEchoTmplHistFilter is satisfied, one threshold crossing occurrence will be counted
**type**\: int
**range:** 0..2147483647
**units**\: milliseconds
.. attribute:: cipslaicmpechotmplhistlives
The maximum number of history lives to record. A life is defined by the countdown (or transition) to zero by the cipslaAutoGroupScheduleLife object. A new life is created when the same conceptual control row is restarted via the transition of the cipslaAutoGroupScheduleLife object and its subsequent countdown. The value of zero will shut off all data collection
**type**\: int
**range:** 0..2
.. attribute:: cipslaicmpechotmplhistbuckets
The maximum number of history buckets to record. This value is set to the number of operations to keep per lifetime. After cipslaIcmpEchoTmplHistBuckets are filled, the oldest entries are deleted and the most recent cipslaIcmpEchoTmplHistBuckets buckets are retained
**type**\: int
**range:** 1..60
.. attribute:: cipslaicmpechotmplhistfilter
Defines a filter for adding RTT results to the history buffer\: none(1) \- no history is recorded all(2) \- the results of all completion times and failed completions are recorded overThreshold(3) \- the results of completion times over cipslaIcmpEchoTmplThreshold are recorded. failures(4) \- the results of failed operations (only) are recorded
**type**\: :py:class:`CipslaIcmpEchoTmplHistFilter <ydk.models.cisco_ios_xe.CISCO_IPSLA_ECHO_MIB.CISCOIPSLAECHOMIB.CipslaIcmpEchoTmplTable.CipslaIcmpEchoTmplEntry.CipslaIcmpEchoTmplHistFilter>`
.. attribute:: cipslaicmpechotmplstatshours
The maximum number of hours for which statistics are maintained. Specifically this is the number of hourly groups to keep before rolling over. The value of one is not advisable because the hourly group will close and immediately be deleted before the network management station will have the opportunity to retrieve the statistics. The value of zero will shut off data collection
**type**\: int
**range:** 0..25
**units**\: hours
.. attribute:: cipslaicmpechotmpldistbuckets
The maximum number of statistical distribution buckets to accumulate. Since this index does not rollover, only the first cipslaIcmpEchoTmplStatsNumDistBuckets will be kept. The last cipslaIcmpEchoTmplStatsNumDistBucket will contain all entries from its distribution interval start point to infinity
**type**\: int
**range:** 1..20
.. attribute:: cipslaicmpechotmpldistinterval
The statistical distribution buckets interval. Distribution Bucket Example\: cipslaIcmpEchoTmplDistBuckets = 5 buckets cipslaIcmpEchoTmplDistInterval = 10 milliseconds \| Bucket 1 \| Bucket 2 \| Bucket 3 \| Bucket 4 \| Bucket 5 \| \| 0\-9 ms \| 10\-19 ms \| 20\-29 ms \| 30\-39 ms \| 40\-Inf ms \| Odd Example\: cipslaIcmpEchoTmplDistBuckets = 1 buckets cipslaIcmpEchoTmplDistInterval = 10 milliseconds \| Bucket 1 \| \| 0\-Inf ms \| Thus, this odd example shows that the value of cipslaIcmpEchoTmplDistInterval does not apply when cipslaIcmpEchoTmplDistBuckets is one
**type**\: int
**range:** 1..100
**units**\: milliseconds
.. attribute:: cipslaicmpechotmplstoragetype
The storage type of this conceptual row
**type**\: :py:class:`StorageType <ydk.models.cisco_ios_xe.SNMPv2_TC.StorageType>`
.. attribute:: cipslaicmpechotmplrowstatus
The status of the conceptual ICMP echo template control row. When the status is active, all the read\-create objects in that row can be modified
**type**\: :py:class:`RowStatus <ydk.models.cisco_ios_xe.SNMPv2_TC.RowStatus>`
"""
_prefix = 'CISCO-IPSLA-ECHO-MIB'
_revision = '2007-08-16'
def __init__(self):
super(CISCOIPSLAECHOMIB.CipslaIcmpEchoTmplTable.CipslaIcmpEchoTmplEntry, self).__init__()
self.yang_name = "cipslaIcmpEchoTmplEntry"
self.yang_parent_name = "cipslaIcmpEchoTmplTable"
self.is_top_level_class = False
self.has_list_ancestor = False
self.ylist_key_names = ['cipslaicmpechotmplname']
self._child_classes = OrderedDict([])
self._leafs = OrderedDict([
('cipslaicmpechotmplname', (YLeaf(YType.str, 'cipslaIcmpEchoTmplName'), ['str'])),
('cipslaicmpechotmpldescription', (YLeaf(YType.str, 'cipslaIcmpEchoTmplDescription'), ['str'])),
('cipslaicmpechotmplsrcaddrtype', (YLeaf(YType.enumeration, 'cipslaIcmpEchoTmplSrcAddrType'), [('ydk.models.cisco_ios_xe.INET_ADDRESS_MIB', 'InetAddressType', '')])),
('cipslaicmpechotmplsrcaddr', (YLeaf(YType.str, 'cipslaIcmpEchoTmplSrcAddr'), ['str'])),
('cipslaicmpechotmpltimeout', (YLeaf(YType.uint32, 'cipslaIcmpEchoTmplTimeOut'), ['int'])),
('cipslaicmpechotmplverifydata', (YLeaf(YType.boolean, 'cipslaIcmpEchoTmplVerifyData'), ['bool'])),
('cipslaicmpechotmplreqdatasize', (YLeaf(YType.uint32, 'cipslaIcmpEchoTmplReqDataSize'), ['int'])),
('cipslaicmpechotmpltos', (YLeaf(YType.uint32, 'cipslaIcmpEchoTmplTOS'), ['int'])),
('cipslaicmpechotmplvrfname', (YLeaf(YType.str, 'cipslaIcmpEchoTmplVrfName'), ['str'])),
('cipslaicmpechotmplthreshold', (YLeaf(YType.uint32, 'cipslaIcmpEchoTmplThreshold'), ['int'])),
('cipslaicmpechotmplhistlives', (YLeaf(YType.uint32, 'cipslaIcmpEchoTmplHistLives'), ['int'])),
('cipslaicmpechotmplhistbuckets', (YLeaf(YType.uint32, 'cipslaIcmpEchoTmplHistBuckets'), ['int'])),
('cipslaicmpechotmplhistfilter', (YLeaf(YType.enumeration, 'cipslaIcmpEchoTmplHistFilter'), [('ydk.models.cisco_ios_xe.CISCO_IPSLA_ECHO_MIB', 'CISCOIPSLAECHOMIB', 'CipslaIcmpEchoTmplTable.CipslaIcmpEchoTmplEntry.CipslaIcmpEchoTmplHistFilter')])),
('cipslaicmpechotmplstatshours', (YLeaf(YType.uint32, 'cipslaIcmpEchoTmplStatsHours'), ['int'])),
('cipslaicmpechotmpldistbuckets', (YLeaf(YType.uint32, 'cipslaIcmpEchoTmplDistBuckets'), ['int'])),
('cipslaicmpechotmpldistinterval', (YLeaf(YType.uint32, 'cipslaIcmpEchoTmplDistInterval'), ['int'])),
('cipslaicmpechotmplstoragetype', (YLeaf(YType.enumeration, 'cipslaIcmpEchoTmplStorageType'), [('ydk.models.cisco_ios_xe.SNMPv2_TC', 'StorageType', '')])),
('cipslaicmpechotmplrowstatus', (YLeaf(YType.enumeration, 'cipslaIcmpEchoTmplRowStatus'), [('ydk.models.cisco_ios_xe.SNMPv2_TC', 'RowStatus', '')])),
])
self.cipslaicmpechotmplname = None
self.cipslaicmpechotmpldescription = None
self.cipslaicmpechotmplsrcaddrtype = None
self.cipslaicmpechotmplsrcaddr = None
self.cipslaicmpechotmpltimeout = None
self.cipslaicmpechotmplverifydata = None
self.cipslaicmpechotmplreqdatasize = None
self.cipslaicmpechotmpltos = None
self.cipslaicmpechotmplvrfname = None
self.cipslaicmpechotmplthreshold = None
self.cipslaicmpechotmplhistlives = None
self.cipslaicmpechotmplhistbuckets = None
self.cipslaicmpechotmplhistfilter = None
self.cipslaicmpechotmplstatshours = None
self.cipslaicmpechotmpldistbuckets = None
self.cipslaicmpechotmpldistinterval = None
self.cipslaicmpechotmplstoragetype = None
self.cipslaicmpechotmplrowstatus = None
self._segment_path = lambda: "cipslaIcmpEchoTmplEntry" + "[cipslaIcmpEchoTmplName='" + str(self.cipslaicmpechotmplname) + "']"
self._absolute_path = lambda: "CISCO-IPSLA-ECHO-MIB:CISCO-IPSLA-ECHO-MIB/cipslaIcmpEchoTmplTable/%s" % self._segment_path()
self._is_frozen = True
def __setattr__(self, name, value):
self._perform_setattr(CISCOIPSLAECHOMIB.CipslaIcmpEchoTmplTable.CipslaIcmpEchoTmplEntry, ['cipslaicmpechotmplname', 'cipslaicmpechotmpldescription', 'cipslaicmpechotmplsrcaddrtype', 'cipslaicmpechotmplsrcaddr', 'cipslaicmpechotmpltimeout', 'cipslaicmpechotmplverifydata', 'cipslaicmpechotmplreqdatasize', 'cipslaicmpechotmpltos', 'cipslaicmpechotmplvrfname', 'cipslaicmpechotmplthreshold', 'cipslaicmpechotmplhistlives', 'cipslaicmpechotmplhistbuckets', 'cipslaicmpechotmplhistfilter', 'cipslaicmpechotmplstatshours', 'cipslaicmpechotmpldistbuckets', 'cipslaicmpechotmpldistinterval', 'cipslaicmpechotmplstoragetype', 'cipslaicmpechotmplrowstatus'], name, value)
class CipslaIcmpEchoTmplHistFilter(Enum):
"""
CipslaIcmpEchoTmplHistFilter (Enum Class)
Defines a filter for adding RTT results to the history
buffer\:
none(1) \- no history is recorded
all(2) \- the results of all completion times
and failed completions are recorded
overThreshold(3) \- the results of completion times
over cipslaIcmpEchoTmplThreshold are
recorded.
failures(4) \- the results of failed operations (only)
are recorded.
.. data:: none = 1
.. data:: all = 2
.. data:: overThreshold = 3
.. data:: failures = 4
"""
none = Enum.YLeaf(1, "none")
all = Enum.YLeaf(2, "all")
overThreshold = Enum.YLeaf(3, "overThreshold")
failures = Enum.YLeaf(4, "failures")
class CipslaUdpEchoTmplTable(Entity):
"""
A table that contains UDP echo template specific definitions.
.. attribute:: cipslaudpechotmplentry
A row entry representing an IPSLA UDP echo template
**type**\: list of :py:class:`CipslaUdpEchoTmplEntry <ydk.models.cisco_ios_xe.CISCO_IPSLA_ECHO_MIB.CISCOIPSLAECHOMIB.CipslaUdpEchoTmplTable.CipslaUdpEchoTmplEntry>`
"""
_prefix = 'CISCO-IPSLA-ECHO-MIB'
_revision = '2007-08-16'
def __init__(self):
super(CISCOIPSLAECHOMIB.CipslaUdpEchoTmplTable, self).__init__()
self.yang_name = "cipslaUdpEchoTmplTable"
self.yang_parent_name = "CISCO-IPSLA-ECHO-MIB"
self.is_top_level_class = False
self.has_list_ancestor = False
self.ylist_key_names = []
self._child_classes = OrderedDict([("cipslaUdpEchoTmplEntry", ("cipslaudpechotmplentry", CISCOIPSLAECHOMIB.CipslaUdpEchoTmplTable.CipslaUdpEchoTmplEntry))])
self._leafs = OrderedDict()
self.cipslaudpechotmplentry = YList(self)
self._segment_path = lambda: "cipslaUdpEchoTmplTable"
self._absolute_path = lambda: "CISCO-IPSLA-ECHO-MIB:CISCO-IPSLA-ECHO-MIB/%s" % self._segment_path()
self._is_frozen = True
def __setattr__(self, name, value):
self._perform_setattr(CISCOIPSLAECHOMIB.CipslaUdpEchoTmplTable, [], name, value)
class CipslaUdpEchoTmplEntry(Entity):
"""
A row entry representing an IPSLA UDP echo template.
.. attribute:: cipslaudpechotmplname (key)
A string which specifies the UDP echo template name
**type**\: str
**length:** 1..64
.. attribute:: cipslaudpechotmpldescription
A string which provides description to the UDP echo template
**type**\: str
**length:** 0..128
.. attribute:: cipslaudpechotmplcontrolenable
If this object is enabled, then the IP SLA application will send control messages to a responder, residing on the target router to respond to the data request packets being sent by the source router
**type**\: bool
.. attribute:: cipslaudpechotmplsrcaddrtype
An enumerated value which specifies the IP address type of the source. It must be used along with the cipslaUdpEchoTmplSrcAddr object
**type**\: :py:class:`InetAddressType <ydk.models.cisco_ios_xe.INET_ADDRESS_MIB.InetAddressType>`
.. attribute:: cipslaudpechotmplsrcaddr
A string which specifies the IP address of the source
**type**\: str
**length:** 0..255
.. attribute:: cipslaudpechotmplsrcport
This object represents the source's port number. If this object is not specified, the application will get a port allocated by the system
**type**\: int
**range:** 0..65535
.. attribute:: cipslaudpechotmpltimeout
Specifies the duration to wait for an IP SLA operation completion. For connection oriented protocols, this may cause the connection to be closed by the operation. Once closed, it will be assumed that the connection reestablishment will be performed. To prevent unwanted closure of connections, be sure to set this value to a realistic connection timeout
**type**\: int
**range:** 0..604800000
**units**\: milliseconds
.. attribute:: cipslaudpechotmplverifydata
When set to true, the resulting data in each IP SLA operation is compared with the expected data. This includes checking header information (if possible) and exact packet size
**type**\: bool
.. attribute:: cipslaudpechotmplreqdatasize
This object represents the number of octets to be placed into the ARR Data portion of the request message, when using SNA protocols. For non\-ARR protocols' RTT request/responses, this value represents the native payload size. REMEMBER\: The ARR Header overhead is not included in this value
**type**\: int
**range:** 4..1500
**units**\: octets
.. attribute:: cipslaudpechotmpltos
This object represents the type of service octet in an IP header
**type**\: int
**range:** 0..255
.. attribute:: cipslaudpechotmplvrfname
This field is used to specify the VRF name with which the IP SLA operation will be used. For regular IP SLA operation this field should not be configured. The agent will use this field to identify the VRF routing Table for this operation
**type**\: str
**length:** 0..32
.. attribute:: cipslaudpechotmplthreshold
This object defines an administrative threshold limit. If the IP SLA operation time exceeds this limit and if the condition specified in cipslaUdpEchoTmplHistFilter is satisfied, one threshold crossing occurrence will be counted
**type**\: int
**range:** 0..2147483647
**units**\: milliseconds
.. attribute:: cipslaudpechotmplhistlives
The maximum number of history lives to record. A life is defined by the countdown (or transition) to zero by the cipslaAutoGroupScheduleLife object. A new life is created when the same conceptual control row is restarted via the transition of the cipslaAutoGroupScheduleLife object and its subsequent countdown. The value of zero will shut off all data collection
**type**\: int
**range:** 0..2
.. attribute:: cipslaudpechotmplhistbuckets
The maximum number of history buckets to record. This value should be set to the number of operations to keep per lifetime. After cipslaUdpEchoTmplHistBuckets are filled, the oldest entries are deleted and the most recent cipslaUdpEchoTmplHistBuckets buckets are retained
**type**\: int
**range:** 1..60
.. attribute:: cipslaudpechotmplhistfilter
Defines a filter for adding RTT results to the history buffer\: none(1) \- no history is recorded all(2) \- the results of all completion times and failed completions are recorded overThreshold(3) \- the results of completion times over cipslaUdpEchoTmplThreshold are recorded. failures(4) \- the results of failed operations (only) are recorded
**type**\: :py:class:`CipslaUdpEchoTmplHistFilter <ydk.models.cisco_ios_xe.CISCO_IPSLA_ECHO_MIB.CISCOIPSLAECHOMIB.CipslaUdpEchoTmplTable.CipslaUdpEchoTmplEntry.CipslaUdpEchoTmplHistFilter>`
.. attribute:: cipslaudpechotmplstatshours
The maximum number of hours for which statistics are maintained. Specifically this is the number of hourly groups to keep before rolling over. The value of one is not advisable because the hourly group will close and immediately be deleted before the network management station will have the opportunity to retrieve the statistics. The value of zero will shut off data collection
**type**\: int
**range:** 0..25
**units**\: hours
.. attribute:: cipslaudpechotmpldistbuckets
The maximum number of statistical distribution buckets to accumulate. Since this index does not rollover, only the first cipslaUdpEchoTmplStatsNumDistBuckets will be kept. The last cipslaUdpEchoTmplStatsNumDistBuckets will contain all entries from its distribution interval start point to infinity
**type**\: int
**range:** 1..20
.. attribute:: cipslaudpechotmpldistinterval
The statistical distribution buckets interval. Distribution Bucket Example\: cipslaUdpEchoTmplDistBuckets = 5 buckets cipslaUdpEchoTmplDistInterval = 10 milliseconds \| Bucket 1 \| Bucket 2 \| Bucket 3 \| Bucket 4 \| Bucket 5 \| \| 0\-9 ms \| 10\-19 ms \| 20\-29 ms \| 30\-39 ms \| 40\-Inf ms \| Odd Example\: cipslaUdpEchoTmplDistBuckets = 1 buckets cipslaUdpEchoTmplDistInterval = 10 milliseconds \| Bucket 1 \| \| 0\-Inf ms \| Thus, this odd example shows that the value of cipslaUdpEchoTmplDistInterval does not apply when cipslaUdpEchoTmplDistBuckets is one
**type**\: int
**range:** 1..100
**units**\: milliseconds
.. attribute:: cipslaudpechotmplstoragetype
The storage type of this conceptual row
**type**\: :py:class:`StorageType <ydk.models.cisco_ios_xe.SNMPv2_TC.StorageType>`
.. attribute:: cipslaudpechotmplrowstatus
The status of the conceptual UDP echo template control row. When the status is active, all the read\-create objects in that row can be modified
**type**\: :py:class:`RowStatus <ydk.models.cisco_ios_xe.SNMPv2_TC.RowStatus>`
"""
_prefix = 'CISCO-IPSLA-ECHO-MIB'
_revision = '2007-08-16'
def __init__(self):
super(CISCOIPSLAECHOMIB.CipslaUdpEchoTmplTable.CipslaUdpEchoTmplEntry, self).__init__()
self.yang_name = "cipslaUdpEchoTmplEntry"
self.yang_parent_name = "cipslaUdpEchoTmplTable"
self.is_top_level_class = False
self.has_list_ancestor = False
self.ylist_key_names = ['cipslaudpechotmplname']
self._child_classes = OrderedDict([])
self._leafs = OrderedDict([
('cipslaudpechotmplname', (YLeaf(YType.str, 'cipslaUdpEchoTmplName'), ['str'])),
('cipslaudpechotmpldescription', (YLeaf(YType.str, 'cipslaUdpEchoTmplDescription'), ['str'])),
('cipslaudpechotmplcontrolenable', (YLeaf(YType.boolean, 'cipslaUdpEchoTmplControlEnable'), ['bool'])),
('cipslaudpechotmplsrcaddrtype', (YLeaf(YType.enumeration, 'cipslaUdpEchoTmplSrcAddrType'), [('ydk.models.cisco_ios_xe.INET_ADDRESS_MIB', 'InetAddressType', '')])),
('cipslaudpechotmplsrcaddr', (YLeaf(YType.str, 'cipslaUdpEchoTmplSrcAddr'), ['str'])),
('cipslaudpechotmplsrcport', (YLeaf(YType.uint16, 'cipslaUdpEchoTmplSrcPort'), ['int'])),
('cipslaudpechotmpltimeout', (YLeaf(YType.uint32, 'cipslaUdpEchoTmplTimeOut'), ['int'])),
('cipslaudpechotmplverifydata', (YLeaf(YType.boolean, 'cipslaUdpEchoTmplVerifyData'), ['bool'])),
('cipslaudpechotmplreqdatasize', (YLeaf(YType.uint32, 'cipslaUdpEchoTmplReqDataSize'), ['int'])),
('cipslaudpechotmpltos', (YLeaf(YType.uint32, 'cipslaUdpEchoTmplTOS'), ['int'])),
('cipslaudpechotmplvrfname', (YLeaf(YType.str, 'cipslaUdpEchoTmplVrfName'), ['str'])),
('cipslaudpechotmplthreshold', (YLeaf(YType.uint32, 'cipslaUdpEchoTmplThreshold'), ['int'])),
('cipslaudpechotmplhistlives', (YLeaf(YType.uint32, 'cipslaUdpEchoTmplHistLives'), ['int'])),
('cipslaudpechotmplhistbuckets', (YLeaf(YType.uint32, 'cipslaUdpEchoTmplHistBuckets'), ['int'])),
('cipslaudpechotmplhistfilter', (YLeaf(YType.enumeration, 'cipslaUdpEchoTmplHistFilter'), [('ydk.models.cisco_ios_xe.CISCO_IPSLA_ECHO_MIB', 'CISCOIPSLAECHOMIB', 'CipslaUdpEchoTmplTable.CipslaUdpEchoTmplEntry.CipslaUdpEchoTmplHistFilter')])),
('cipslaudpechotmplstatshours', (YLeaf(YType.uint32, 'cipslaUdpEchoTmplStatsHours'), ['int'])),
('cipslaudpechotmpldistbuckets', (YLeaf(YType.uint32, 'cipslaUdpEchoTmplDistBuckets'), ['int'])),
('cipslaudpechotmpldistinterval', (YLeaf(YType.uint32, 'cipslaUdpEchoTmplDistInterval'), ['int'])),
('cipslaudpechotmplstoragetype', (YLeaf(YType.enumeration, 'cipslaUdpEchoTmplStorageType'), [('ydk.models.cisco_ios_xe.SNMPv2_TC', 'StorageType', '')])),
('cipslaudpechotmplrowstatus', (YLeaf(YType.enumeration, 'cipslaUdpEchoTmplRowStatus'), [('ydk.models.cisco_ios_xe.SNMPv2_TC', 'RowStatus', '')])),
])
self.cipslaudpechotmplname = None
self.cipslaudpechotmpldescription = None
self.cipslaudpechotmplcontrolenable = None
self.cipslaudpechotmplsrcaddrtype = None
self.cipslaudpechotmplsrcaddr = None
self.cipslaudpechotmplsrcport = None
self.cipslaudpechotmpltimeout = None
self.cipslaudpechotmplverifydata = None
self.cipslaudpechotmplreqdatasize = None
self.cipslaudpechotmpltos = None
self.cipslaudpechotmplvrfname = None
self.cipslaudpechotmplthreshold = None
self.cipslaudpechotmplhistlives = None
self.cipslaudpechotmplhistbuckets = None
self.cipslaudpechotmplhistfilter = None
self.cipslaudpechotmplstatshours = None
self.cipslaudpechotmpldistbuckets = None
self.cipslaudpechotmpldistinterval = None
self.cipslaudpechotmplstoragetype = None
self.cipslaudpechotmplrowstatus = None
self._segment_path = lambda: "cipslaUdpEchoTmplEntry" + "[cipslaUdpEchoTmplName='" + str(self.cipslaudpechotmplname) + "']"
self._absolute_path = lambda: "CISCO-IPSLA-ECHO-MIB:CISCO-IPSLA-ECHO-MIB/cipslaUdpEchoTmplTable/%s" % self._segment_path()
self._is_frozen = True
def __setattr__(self, name, value):
self._perform_setattr(CISCOIPSLAECHOMIB.CipslaUdpEchoTmplTable.CipslaUdpEchoTmplEntry, ['cipslaudpechotmplname', 'cipslaudpechotmpldescription', 'cipslaudpechotmplcontrolenable', 'cipslaudpechotmplsrcaddrtype', 'cipslaudpechotmplsrcaddr', 'cipslaudpechotmplsrcport', 'cipslaudpechotmpltimeout', 'cipslaudpechotmplverifydata', 'cipslaudpechotmplreqdatasize', 'cipslaudpechotmpltos', 'cipslaudpechotmplvrfname', 'cipslaudpechotmplthreshold', 'cipslaudpechotmplhistlives', 'cipslaudpechotmplhistbuckets', 'cipslaudpechotmplhistfilter', 'cipslaudpechotmplstatshours', 'cipslaudpechotmpldistbuckets', 'cipslaudpechotmpldistinterval', 'cipslaudpechotmplstoragetype', 'cipslaudpechotmplrowstatus'], name, value)
class CipslaUdpEchoTmplHistFilter(Enum):
"""
CipslaUdpEchoTmplHistFilter (Enum Class)
Defines a filter for adding RTT results to the history
buffer\:
none(1) \- no history is recorded
all(2) \- the results of all completion times
and failed completions are recorded
overThreshold(3) \- the results of completion times
over cipslaUdpEchoTmplThreshold are
recorded.
failures(4) \- the results of failed operations (only)
are recorded.
.. data:: none = 1
.. data:: all = 2
.. data:: overThreshold = 3
.. data:: failures = 4
"""
none = Enum.YLeaf(1, "none")
all = Enum.YLeaf(2, "all")
overThreshold = Enum.YLeaf(3, "overThreshold")
failures = Enum.YLeaf(4, "failures")
class CipslaTcpConnTmplTable(Entity):
"""
A table that contains TCP connect template specific definitions.
.. attribute:: cipslatcpconntmplentry
A row entry representing an IPSLA TCP connect template
**type**\: list of :py:class:`CipslaTcpConnTmplEntry <ydk.models.cisco_ios_xe.CISCO_IPSLA_ECHO_MIB.CISCOIPSLAECHOMIB.CipslaTcpConnTmplTable.CipslaTcpConnTmplEntry>`
"""
_prefix = 'CISCO-IPSLA-ECHO-MIB'
_revision = '2007-08-16'
def __init__(self):
super(CISCOIPSLAECHOMIB.CipslaTcpConnTmplTable, self).__init__()
self.yang_name = "cipslaTcpConnTmplTable"
self.yang_parent_name = "CISCO-IPSLA-ECHO-MIB"
self.is_top_level_class = False
self.has_list_ancestor = False
self.ylist_key_names = []
self._child_classes = OrderedDict([("cipslaTcpConnTmplEntry", ("cipslatcpconntmplentry", CISCOIPSLAECHOMIB.CipslaTcpConnTmplTable.CipslaTcpConnTmplEntry))])
self._leafs = OrderedDict()
self.cipslatcpconntmplentry = YList(self)
self._segment_path = lambda: "cipslaTcpConnTmplTable"
self._absolute_path = lambda: "CISCO-IPSLA-ECHO-MIB:CISCO-IPSLA-ECHO-MIB/%s" % self._segment_path()
self._is_frozen = True
def __setattr__(self, name, value):
self._perform_setattr(CISCOIPSLAECHOMIB.CipslaTcpConnTmplTable, [], name, value)
class CipslaTcpConnTmplEntry(Entity):
"""
A row entry representing an IPSLA TCP connect template.
.. attribute:: cipslatcpconntmplname (key)
A string which specifies the TCP connect template name
**type**\: str
**length:** 1..64
.. attribute:: cipslatcpconntmpldescription
A string which provides description for the TCP connect template
**type**\: str
**length:** 0..128
.. attribute:: cipslatcpconntmplcontrolenable
If this object is enabled, then the IP SLA application will send control messages to a responder, residing on the target router to respond to the data request packets being sent by the source router
**type**\: bool
.. attribute:: cipslatcpconntmplsrcaddrtype
An enumerated value which specifies the IP address type of the source. It must be used along with the cipslaTcpConnTmplSrcAddr object
**type**\: :py:class:`InetAddressType <ydk.models.cisco_ios_xe.INET_ADDRESS_MIB.InetAddressType>`
.. attribute:: cipslatcpconntmplsrcaddr
A string which specifies the IP address of the source
**type**\: str
**length:** 0..255
.. attribute:: cipslatcpconntmplsrcport
This object represents the source's port number. If this object is not specified, the application will get a port allocated by the system
**type**\: int
**range:** 0..65535
.. attribute:: cipslatcpconntmpltimeout
Specifies the duration to wait for an IP SLA operation completion. For connection oriented protocols, this may cause the connection to be closed by the operation. Once closed, it will be assumed that the connection reestablishment will be performed. To prevent unwanted closure of connections, be sure to set this value to a realistic connection timeout
**type**\: int
**range:** 0..604800000
**units**\: milliseconds
.. attribute:: cipslatcpconntmplverifydata
When set to true, the resulting data in each IP SLA operation is compared with the expected data. This includes checking header information (if possible) and exact packet size
**type**\: bool
.. attribute:: cipslatcpconntmpltos
This object represents the type of service octet in an IP header
**type**\: int
**range:** 0..255
.. attribute:: cipslatcpconntmplthreshold
This object defines an administrative threshold limit. If the IP SLA operation time exceeds this limit and if the condition specified in cipslaTcpConnTmplHistFilter is satisfied, one threshold crossing occurrence will be counted
**type**\: int
**range:** 0..2147483647
**units**\: milliseconds
.. attribute:: cipslatcpconntmplhistlives
The maximum number of history lives to record. A life is defined by the countdown (or transition) to zero by the cipslaAutoGroupScheduleLife object. A new life is created when the same conceptual control row is restarted via the transition of the cipslaAutoGroupScheduleLife object and its subsequent countdown. The value of zero will shut off all data collection
**type**\: int
**range:** 0..2
.. attribute:: cipslatcpconntmplhistbuckets
The maximum number of history buckets to record. This value should be set to the number of operations to keep per lifetime. After cipslaTcpConnTmplHistBuckets are filled, the oldest entries are deleted and the most recent cipslaTcpConnTmplHistBuckets buckets are retained
**type**\: int
**range:** 1..60
.. attribute:: cipslatcpconntmplhistfilter
Defines a filter for adding RTT results to the history buffer\: none(1) \- no history is recorded all(2) \- the results of all completion times and failed completions are recorded overThreshold(3) \- the results of completion times over cipslaTcpConnTmplThreshold are recorded. failures(4) \- the results of failed operations (only) are recorded
**type**\: :py:class:`CipslaTcpConnTmplHistFilter <ydk.models.cisco_ios_xe.CISCO_IPSLA_ECHO_MIB.CISCOIPSLAECHOMIB.CipslaTcpConnTmplTable.CipslaTcpConnTmplEntry.CipslaTcpConnTmplHistFilter>`
.. attribute:: cipslatcpconntmplstatshours
The maximum number of hours for which statistics are maintained. Specifically this is the number of hourly groups to keep before rolling over. The value of one is not advisable because the hourly group will close and immediately be deleted before the network management station will have the opportunity to retrieve the statistics. The value of zero will shut off data collection
**type**\: int
**range:** 0..25
**units**\: hours
.. attribute:: cipslatcpconntmpldistbuckets
The maximum number of statistical distribution buckets to accumulate. Since this index does not rollover, only the first cipslaTcpConnTmplDistBuckets will be kept. The last cipslaTcpConnTmplDistBuckets will contain all entries from its distribution interval start point to infinity
**type**\: int
**range:** 1..20
.. attribute:: cipslatcpconntmpldistinterval
The statistical distribution buckets interval. Distribution Bucket Example\: cipslaTcpConnTmplDistBuckets = 5 buckets cipslaTcpConnTmplDistInterval = 10 milliseconds \| Bucket 1 \| Bucket 2 \| Bucket 3 \| Bucket 4 \| Bucket 5 \| \| 0\-9 ms \| 10\-19 ms \| 20\-29 ms \| 30\-39 ms \| 40\-Inf ms \| Odd Example\: cipslaTcpConnTmplDistBuckets = 1 buckets cipslaTcpConnTmplDistInterval = 10 milliseconds \| Bucket 1 \| \| 0\-Inf ms \| Thus, this odd example shows that the value of cipslaTcpConnTmplDistInterval does not apply when cipslaTcpConnTmplDistBuckets is one
**type**\: int
**range:** 1..100
**units**\: milliseconds
.. attribute:: cipslatcpconntmplstoragetype
The storage type of this conceptual row
**type**\: :py:class:`StorageType <ydk.models.cisco_ios_xe.SNMPv2_TC.StorageType>`
.. attribute:: cipslatcpconntmplrowstatus
The status of the conceptual tcp connect control row. When the status is active, all the read\-create objects in that row can be modified
**type**\: :py:class:`RowStatus <ydk.models.cisco_ios_xe.SNMPv2_TC.RowStatus>`
"""
_prefix = 'CISCO-IPSLA-ECHO-MIB'
_revision = '2007-08-16'
def __init__(self):
super(CISCOIPSLAECHOMIB.CipslaTcpConnTmplTable.CipslaTcpConnTmplEntry, self).__init__()
self.yang_name = "cipslaTcpConnTmplEntry"
self.yang_parent_name = "cipslaTcpConnTmplTable"
self.is_top_level_class = False
self.has_list_ancestor = False
self.ylist_key_names = ['cipslatcpconntmplname']
self._child_classes = OrderedDict([])
self._leafs = OrderedDict([
('cipslatcpconntmplname', (YLeaf(YType.str, 'cipslaTcpConnTmplName'), ['str'])),
('cipslatcpconntmpldescription', (YLeaf(YType.str, 'cipslaTcpConnTmplDescription'), ['str'])),
('cipslatcpconntmplcontrolenable', (YLeaf(YType.boolean, 'cipslaTcpConnTmplControlEnable'), ['bool'])),
('cipslatcpconntmplsrcaddrtype', (YLeaf(YType.enumeration, 'cipslaTcpConnTmplSrcAddrType'), [('ydk.models.cisco_ios_xe.INET_ADDRESS_MIB', 'InetAddressType', '')])),
('cipslatcpconntmplsrcaddr', (YLeaf(YType.str, 'cipslaTcpConnTmplSrcAddr'), ['str'])),
('cipslatcpconntmplsrcport', (YLeaf(YType.uint16, 'cipslaTcpConnTmplSrcPort'), ['int'])),
('cipslatcpconntmpltimeout', (YLeaf(YType.uint32, 'cipslaTcpConnTmplTimeOut'), ['int'])),
('cipslatcpconntmplverifydata', (YLeaf(YType.boolean, 'cipslaTcpConnTmplVerifyData'), ['bool'])),
('cipslatcpconntmpltos', (YLeaf(YType.uint32, 'cipslaTcpConnTmplTOS'), ['int'])),
('cipslatcpconntmplthreshold', (YLeaf(YType.uint32, 'cipslaTcpConnTmplThreshold'), ['int'])),
('cipslatcpconntmplhistlives', (YLeaf(YType.uint32, 'cipslaTcpConnTmplHistLives'), ['int'])),
('cipslatcpconntmplhistbuckets', (YLeaf(YType.uint32, 'cipslaTcpConnTmplHistBuckets'), ['int'])),
('cipslatcpconntmplhistfilter', (YLeaf(YType.enumeration, 'cipslaTcpConnTmplHistFilter'), [('ydk.models.cisco_ios_xe.CISCO_IPSLA_ECHO_MIB', 'CISCOIPSLAECHOMIB', 'CipslaTcpConnTmplTable.CipslaTcpConnTmplEntry.CipslaTcpConnTmplHistFilter')])),
('cipslatcpconntmplstatshours', (YLeaf(YType.uint32, 'cipslaTcpConnTmplStatsHours'), ['int'])),
('cipslatcpconntmpldistbuckets', (YLeaf(YType.uint32, 'cipslaTcpConnTmplDistBuckets'), ['int'])),
('cipslatcpconntmpldistinterval', (YLeaf(YType.uint32, 'cipslaTcpConnTmplDistInterval'), ['int'])),
('cipslatcpconntmplstoragetype', (YLeaf(YType.enumeration, 'cipslaTcpConnTmplStorageType'), [('ydk.models.cisco_ios_xe.SNMPv2_TC', 'StorageType', '')])),
('cipslatcpconntmplrowstatus', (YLeaf(YType.enumeration, 'cipslaTcpConnTmplRowStatus'), [('ydk.models.cisco_ios_xe.SNMPv2_TC', 'RowStatus', '')])),
])
self.cipslatcpconntmplname = None
self.cipslatcpconntmpldescription = None
self.cipslatcpconntmplcontrolenable = None
self.cipslatcpconntmplsrcaddrtype = None
self.cipslatcpconntmplsrcaddr = None
self.cipslatcpconntmplsrcport = None
self.cipslatcpconntmpltimeout = None
self.cipslatcpconntmplverifydata = None
self.cipslatcpconntmpltos = None
self.cipslatcpconntmplthreshold = None
self.cipslatcpconntmplhistlives = None
self.cipslatcpconntmplhistbuckets = None
self.cipslatcpconntmplhistfilter = None
self.cipslatcpconntmplstatshours = None
self.cipslatcpconntmpldistbuckets = None
self.cipslatcpconntmpldistinterval = None
self.cipslatcpconntmplstoragetype = None
self.cipslatcpconntmplrowstatus = None
self._segment_path = lambda: "cipslaTcpConnTmplEntry" + "[cipslaTcpConnTmplName='" + str(self.cipslatcpconntmplname) + "']"
self._absolute_path = lambda: "CISCO-IPSLA-ECHO-MIB:CISCO-IPSLA-ECHO-MIB/cipslaTcpConnTmplTable/%s" % self._segment_path()
self._is_frozen = True
def __setattr__(self, name, value):
self._perform_setattr(CISCOIPSLAECHOMIB.CipslaTcpConnTmplTable.CipslaTcpConnTmplEntry, ['cipslatcpconntmplname', 'cipslatcpconntmpldescription', 'cipslatcpconntmplcontrolenable', 'cipslatcpconntmplsrcaddrtype', 'cipslatcpconntmplsrcaddr', 'cipslatcpconntmplsrcport', 'cipslatcpconntmpltimeout', 'cipslatcpconntmplverifydata', 'cipslatcpconntmpltos', 'cipslatcpconntmplthreshold', 'cipslatcpconntmplhistlives', 'cipslatcpconntmplhistbuckets', 'cipslatcpconntmplhistfilter', 'cipslatcpconntmplstatshours', 'cipslatcpconntmpldistbuckets', 'cipslatcpconntmpldistinterval', 'cipslatcpconntmplstoragetype', 'cipslatcpconntmplrowstatus'], name, value)
class CipslaTcpConnTmplHistFilter(Enum):
"""
CipslaTcpConnTmplHistFilter (Enum Class)
Defines a filter for adding RTT results to the history
buffer\:
none(1) \- no history is recorded
all(2) \- the results of all completion times
and failed completions are recorded
overThreshold(3) \- the results of completion times
over cipslaTcpConnTmplThreshold are
recorded.
failures(4) \- the results of failed operations (only)
are recorded.
.. data:: none = 1
.. data:: all = 2
.. data:: overThreshold = 3
.. data:: failures = 4
"""
none = Enum.YLeaf(1, "none")
all = Enum.YLeaf(2, "all")
overThreshold = Enum.YLeaf(3, "overThreshold")
failures = Enum.YLeaf(4, "failures")
def clone_ptr(self):
self._top_entity = CISCOIPSLAECHOMIB()
return self._top_entity
| python |
Television actors are quite miffed over the clause that their production houses are introducing these days. Although, a few clauses seem exclusive and limited to the actors of the particular shows; they may soon be adopted by other production houses, owing to the competition!
Recently, Comedy Nights Live actress Upasana Singh was annoyed when she was asked to sign a contract, even after quitting the show! And now, the recent topic in debate is 'No Dating Clause'. Recently, the production house of the show Baazigar got its actors Vatsal Sheth and Ishita Dutta to sign on an agreement that said the actors cannot date each other or anybody else from the cast and crew, while they are a part of the show!
Aamir Ali, who is married to Sanjeeda Sheikh after dating for many years, was quoted by a leading daily as saying, " It's funny! Sanjee and I were doing two different shows made by the same production house. Luckily, no one stopped me or I didn't get arrested when I went to meet her on her set, which was in the same compound."
He further said, "On a serious note, actors who are dating must take care to not disrupt or delay shoots. And if they ever break up, they have to make sure that work doesn't suffer."
Vivian Dsena was quoted by the leading daily as saying, "We can't control or keep tabs on our feelings. I met my wife Vahbiz while working on 'Pyar Ki Ek Kahani'. If there was a clause like this at that time, I would have laughed it off. Clauses can't be put on emotions and relationships."
He further added, "What actors do in their personal lives outside the set is their decision. However, decorum has to be maintained on the set. Even if co-stars fall in love, they should not disturb the shoot or unit in any way."
Producer Saurabh Tewari says that although this clause cannot stop two people from dating, there are situations, where it can help. He says, "There are instances where the lead pair has fallen in love and things have got affected on the set. For instance, they prefer coming and leaving together and the schedule goes for toss. If they end up fighting in real life, they refuse to enact any romantic scene on the show. Lunch breaks tend to become extra long, causing delays and financially affecting the producer."
Another producer Yash Patnaik said 'dating is not an issue but when they break up, the problems starts'. He says, "They stop talking to each other. The unit and cast get divided; some support one actor and some, the other. The couple stops shooting much with each other and this has an effect on the creative execution of scenes."
Well, Mr Producer, when the lead couple date and the show gets good TRPs with their chemistry, you get double profit!
| english |
Begin typing your search above and press return to search.
The BCCI announced a 15 member team for the Men's T20 World Cup, with MS Dhoni as the mentor.
Indian teen star Shafali Verma maintained her number one position among women's T20 batters.
Why is the Indian cricket team wearing black armbands?
The Indian cricket team were seen wearing black armbands during their fourth test match against England.
The Royal Challengers Bangalore has arrived in UAE for the second leg of IPL 2021.
Led by Harman, Smriti, Poonam and Shafali, Indian women's cricket has seen exponential growth in the last few years.
| english |
<gh_stars>0
/* Enum Dropdown Option
*
* From: https://github.com/PokemonAutomation/Arduino-Source
*
*/
#include <QJsonValue>
#include <QHBoxLayout>
#include <QLabel>
#include "Common/Qt/NoWheelComboBox.h"
#include "EnumDropdownOption.h"
#include "EnumDropdownWidget.h"
namespace PokemonAutomation{
EnumDropdownOption::EnumDropdownOption(
QString label,
std::vector<QString> cases,
size_t default_index
)
: m_label(std::move(label))
, m_case_list(std::move(cases))
, m_default(default_index)
, m_current(default_index)
{
if (default_index >= m_case_list.size()){
throw "Index is too large.";
}
for (size_t index = 0; index < m_case_list.size(); index++){
const QString& item = m_case_list[index];
auto ret = m_case_map.emplace(
std::piecewise_construct,
std::forward_as_tuple(item),
std::forward_as_tuple(index)
);
if (!ret.second){
throw "Duplicate enum label.";
}
}
}
void EnumDropdownOption::load_json(const QJsonValue& json){
if (!json.isString()){
return;
}
QString str = json.toString();
auto iter = m_case_map.find(str);
if (iter != m_case_map.end()){
m_current.store(iter->second, std::memory_order_relaxed);
}
}
QJsonValue EnumDropdownOption::to_json() const{
return QJsonValue(m_case_list[m_current]);
}
void EnumDropdownOption::restore_defaults(){
m_current.store(m_default, std::memory_order_relaxed);
}
ConfigWidget* EnumDropdownOption::make_ui(QWidget& parent){
return new EnumDropdownWidget(parent, *this);
}
EnumDropdownWidget::EnumDropdownWidget(QWidget& parent, EnumDropdownOption& value)
: QWidget(&parent)
, ConfigWidget(value, *this)
, m_value(value)
{
QHBoxLayout* layout = new QHBoxLayout(this);
layout->setContentsMargins(0, 0, 0, 0);
QLabel* text = new QLabel(m_value.label(), this);
layout->addWidget(text, 1);
text->setWordWrap(true);
m_box = new NoWheelComboBox(&parent);
layout->addWidget(m_box);
for (const QString& item : m_value.case_list()){
m_box->addItem(item);
}
m_box->setCurrentIndex((int)m_value);
layout->addWidget(m_box, 1);
connect(
m_box, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
this, [=](int index){
if (index < 0){
m_value.restore_defaults();
return;
}
m_value.set(index);
emit on_changed();
}
);
}
void EnumDropdownWidget::restore_defaults(){
m_value.restore_defaults();
update_ui();
}
void EnumDropdownWidget::update_ui(){
m_box->setCurrentIndex((int)m_value);
}
}
| cpp |
[
{
"schema": null,
"name": "teams-recognize-most-active-users-specific-team",
"version": null,
"source": "pnp",
"title": "Recognize most active users for a specific Team",
"url": "teams-recognize-most-active-users-specific-team/README.html",
"creationDateTime": "2021-08-03",
"updateDateTime": "2021-08-03",
"shortDescription": "Retrieves all activities for a specific Microsoft Teams Team and shares the top 3 contributors based on their score ",
"longDescription": null,
"products": [
"Teams"
],
"categories": [
"Data",
"Report"
],
"tags": [
"Microsoft Teams",
"Adoption"
],
"metadata": [
{
"key": "cli-for-microsoft365",
"value": "3.7.0"
}
],
"thumbnails": [
{
"type": "image",
"order": 100,
"url": "teams-recognize-most-active-users-specific-team/assets/preview.png",
"alt": "preview image for the sample",
"slides": null
}
],
"authors": [
{
"name": "<NAME>",
"gitHubAccount": "appieschot",
"company": "@portiva",
"pictureUrl": "https://avatars.githubusercontent.com/u/15227781?v=4"
}
],
"references": null
}
] | json |
Quinton de Kock, the South African wicketkeeper, reckons the Lucknow Super Giants have a pretty good chance in the playoffs.
The South African has scored 502 runs at a strike rate of 149.40 in 14 games, and his performance on Wednesday will be crucial for LSG.
In IPL 2022, Quinton de Kock has been on fire for newcomers Lucknow Super Giants. The South African virtually single-handedly fashioned their triumph against Kolkata Knight Riders in the final match of the group league with a 140 not out off 70 balls.
He has 502 runs at a strike rate of 149.40 in 14 matches, and Lucknow’s chances in the Eliminator against Royal Challengers Bangalore at Eden Gardens on Wednesday will be majorly dependent on his ability to lead the innings.
Quinton de Kock smashed 140 runs off just 70 deliveries, including 10 fours and ten sixes, for a destructive strike rate of 200. He also became the IPL’s third-highest individual scorer, trailing only Chris Gayle (175) and Brendon McCullum (158).
Quinton de Kock on the Lucknow Super Giants’ playoff chances:
QDK is the third-highest run-scorer in IPL 2022, and one of just three players to reach the 500-run milestone, alongside Jos Buttler and KL Rahul. de Kock has 502 runs at an average of 38.61 and a strike rate of 149 in 14 IPL 2022 appearances, with three half-centuries and one century.
Royal Challengers Bangalore and Lucknow Super Giants will face off in the Eliminator, looking to advance one step closer to the IPL 2022 final after a strong showing in the league rounds. The match will take place on Wednesday, May 25, 2022, at the Eden Gardens Stadium in Kolkata.
| english |
{
"id": 198102,
"info": {
"name": "Archwiki colourful dark",
"description": "A dark theme for the archwiki. Theme is adapted from \"Another dark Arch Linux theme\" by kiwii, just with more colour\r\n\r\nWatch out if you use the form, since the text is a bit too dark",
"additionalInfo": null,
"format": "uso",
"category": "global",
"createdAt": "2021-02-22T06:19:23.000Z",
"updatedAt": "2021-02-22T06:19:23.000Z",
"license": "CC0-1.0",
"author": {
"id": 1128033,
"name": "voovs"
}
},
"stats": {
"installs": {
"total": 0,
"weekly": 0
}
},
"screenshots": {
"main": {
"name": "198102_after.jpeg",
"archived": true
}
},
"discussions": {
"stats": {
"discussionsCount": 0,
"commentsCount": 0
},
"data": []
},
"style": {
"css": "@namespace url(http://www.w3.org/1999/xhtml);\r\nbody, #content, table {\r\n background-color: #201f1f !important;\r\n color: #d4d2cf !important;\r\n }\r\n h1, h2, h3, h4, h5 {\r\n color: #ff6e6e !important;\r\n }\r\n pre, code, .pBody, #p-cactions li a {\r\n background-color: #2b2a2a !important;\r\n border: none !important;\r\n color: #d4d2cf !important;\r\n }\r\n div, #p-personal .portlet, #p-personal .pBody, #p-cactions .pBody {\r\n background-color: #201f1f !important;\r\n color: #d4d2cf !important;\r\n }\r\n input {\r\n background-color: #2b2a2a !important;\r\n color: #d4d2cf !important;\r\n }\r\n table.results th {\r\n background-color: #2b2a2a !important;\r\n }\r\n table.results tr.odd {\r\n background-color: #373636 !important;\r\n }\r\n table.results tr.even {\r\n background-color: #2b2a2a !important;\r\n }\r\n .pun .punwrap, .pun .blockpost h2 {\r\n border: none;\r\n background: none;\r\n border-bottom: 1px dotted #BBB;\r\n border-top: 1px dotted #BBB;\r\n }\r\n #brdmain, .pun .blockpost .postbody, .pun .blockpost .postfoot, .pun .blockpost, .pun .quotebox, .pun .codebox, .pun .pagelink a, .pun .pagelink * {\r\n border-style: none !important;\r\n }\r\n .pun .quotebox, pre, code, .pun .quotebox blockquote div {\r\n background-color: #2B2A2A !important;\r\n }\r\n #brdmenu a, #brdmenu a:link, #brdmenu a:visited, .pun .blocktable * {\r\n background-color: #201f1f !important;\r\n border: none !important;\r\n }\r\n .pun .blocktable tr {\r\n border-top: 1px dotted #BBB !important;\r\n }\r\n\t#content a:not(.new), #mw-navigation li:not(.new) a:not(.new), #mw-panel li:not(.new) a:not(.new), #column-one li:not(.new) a:not(.new), #footer a:not(.new) {\r\n\t\tcolor: #e6ab00 !important;\r\n\t}\r\n/* i really want this to be global */"
}
} | json |
<reponame>bxio/Discord-Bot-Heroku<filename>app.json
{
"name": "Discord.py Heroku",
"description": "A One-click deployment of a basic discord.py bot on Heroku",
"keywords": [
"bot",
"discord",
"discord.py",
"heroku"
],
"website": "https://github.com/bxio/Discord-Heroku",
"repository": "https://github.com/bxio/Discord-Heroku",
"env": {
"DISCORD_TOKEN": {
"description": "Discord Bot Token",
"value": "PUT_YOUR_BOT_TOKEN_HERE"
},
"BOT_PREFIX": {
"description": "Discord Bot Prefix (defaults to ?)",
"value": "?"
}
},
"buildpacks": [
{
"url": "heroku/python"
},
{
"url": "https://github.com/xrisk/heroku-opus.git"
},
{
"url": "https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest.git"
}
]
}
| json |
Claiming she didn’t want questions raised about her integrity to “ tarnish the image of Tehelka“,managing editor of the news magazine Shoma Chaudhury resigned from the organization early on Thursday morning,ten days after a young woman journalist wrote to her complaining about being sexually assaulted by magazine editor-in-chief Tarun Tejpal.
The resignation email,sent out just before 6 am,says this had been a “damaging” time for everyone associated with Tehelka and that she had taken a series of actions in response to the victim’s complaint.
” To my mind,I acted on instant outrage and solidarity for our colleague as a woman and co-worker.
After the first steps to immediately address her expressed needs,the process of setting up the anti-sexual harassment committee was begun. There were only two days to act on the complaint before the story broke in the press. Post this,things have been misconstrued and have snowballed exponentially in the media,based on half-facts and selective leaks,” Chaudhury has said in her email.
She has also denied allegations of attempting a “cover up” and for not standing by her ” feminist positions”. “While I accept that I could have done many things differently and in a more measured way,I reject the allegations of a cover-up because in no way could the first actions that were taken be deemed suppression of any kind. As for my feminist positions,I believe I acted in consonance with them by giving my colleagues account precedence over everything else,” she says in her email.
Chaudhury,however,says she would come to office to close the issue and do the “necessary handovers”.
” It has never been a part of me to give up midway through a challenge. I would have liked to continue at Tehelka to see us through this dark time,but I am no longer sure whether my presence is harming or helping Tehelka,” Chaudhury added in her email. | english |
export {
products as _productMockData,
categories as _categoriesMockData,
brands as _brandsMockData
} from './_mockData';
| javascript |
Iran warned on Thursday that it will quit a landmark nuclear deal with world powers if President Donald Trump pulls the U. S. out of the accord.
“If the United States withdraws from the nuclear deal, then we will not stay in it,” Ali Akbar Velayati, foreign policy adviser to Supreme Leader Ayatollah Ali Khamenei, was quoted as saying by the state television website.
Mr. Velayati also warned against any move to try to renegotiate the deal signed by Iran and six world powers in 2015 curbing Tehran’s nuclear programme in exchange for sanctions relief. “Iran accepts the nuclear agreement as it has been prepared and will not accept adding or removing anything,” he said.
Mr. Trump has all but decided to withdraw from the nuclear accord by May 12 but exactly how he will do so remains unclear, two White House officials and a source familiar with the administration’s internal debate told Reuters on Wednesday.
There is a chance that he might choose to keep the U. S. in the international pact, in part because of “alliance maintenance” with France, the source said.
The White House official said Mr. Trump was “most of the way there toward pulling out of the deal but he hasn’t made the decision” and that he “seems poised to do it but until a decision is made by this President it is not final”.
Top aides are not seeking to talk Mr. Trump out of withdrawal because he seems intent on it, a second White House official said. | english |
<reponame>gbaudhuin/whatsbehind
{"slug":"lightweight-grid-columns","name":"Lightweight Grid Columns","latest_version":"1.0","last_updated":"2018-03-27T16:55:22.925Z","vulnerabilities":null} | json |
/*
Copyright 2021 <NAME>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package io.hotmoka.tests;
import static io.hotmoka.beans.types.BasicTypes.BOOLEAN;
import static io.hotmoka.beans.types.BasicTypes.INT;
import static io.hotmoka.beans.types.BasicTypes.LONG;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.math.BigInteger;
import java.security.InvalidKeyException;
import java.security.PrivateKey;
import java.security.SignatureException;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import io.hotmoka.beans.CodeExecutionException;
import io.hotmoka.beans.TransactionException;
import io.hotmoka.beans.TransactionRejectedException;
import io.hotmoka.beans.signatures.ConstructorSignature;
import io.hotmoka.beans.signatures.NonVoidMethodSignature;
import io.hotmoka.beans.types.ClassType;
import io.hotmoka.beans.values.BooleanValue;
import io.hotmoka.beans.values.IntValue;
import io.hotmoka.beans.values.LongValue;
import io.hotmoka.beans.values.StorageReference;
import io.hotmoka.beans.values.StorageValue;
/**
* A test for the storage map Takamaka class.
*/
class Collections extends TakamakaTest {
private static final ClassType MAP_TESTS = new ClassType("io.hotmoka.examples.collections.MapTests");
private static final ClassType INT_MAP_TESTS = new ClassType("io.hotmoka.examples.collections.IntMapTests");
private static final ClassType ARRAY_TESTS = new ClassType("io.hotmoka.examples.collections.ArrayTests");
private static final ClassType SET_TESTS = new ClassType("io.hotmoka.examples.collections.SetTests");
private static final ClassType MAP_HOLDER = new ClassType("io.hotmoka.examples.collections.MapHolder");
private static final ClassType STATE = new ClassType("io.hotmoka.examples.collections.MapHolder$State");
private static final ClassType COMPARABLE = new ClassType("java.lang.Comparable");
/**
* The first object, that holds all funds initially.
*/
private StorageReference eoa;
/**
* The private key of {@linkplain #eoa}.
*/
private PrivateKey key;
@BeforeAll
static void beforeAll() throws Exception {
setJar("collections.jar");
}
@BeforeEach
void beforeEach() throws Exception {
setAccounts(_10_000_000);
eoa = account(0);
key = privateKey(0);
}
@Test @DisplayName("MapTests.testIteration1() == 4950")
void geometricSum() throws TransactionException, CodeExecutionException, TransactionRejectedException {
IntValue sum = (IntValue) runStaticMethodCallTransaction(eoa, _10_000_000, jar(), new NonVoidMethodSignature(MAP_TESTS, "testIteration1", INT));
assertEquals(4950, sum.value);
}
@Test @DisplayName("MapTests.testUpdate1() == 5050")
void geometricSumAfterUpdate() throws TransactionException, CodeExecutionException, TransactionRejectedException {
IntValue sum = (IntValue) runStaticMethodCallTransaction(eoa, _10_000_000, jar(), new NonVoidMethodSignature(MAP_TESTS, "testUpdate1", INT));
assertEquals(5050, sum.value);
}
@Test @DisplayName("MapTests.testUpdate2() == 5050")
void geometricSumAfterUpdateWithStream() throws TransactionException, CodeExecutionException, TransactionRejectedException {
IntValue sum = (IntValue) runStaticMethodCallTransaction(eoa, _10_000_000, jar(), new NonVoidMethodSignature(MAP_TESTS, "testUpdate2", INT));
assertEquals(5050, sum.value);
}
@Test @DisplayName("MapTests.testNullValues() == 100L")
void nullValuesInMap() throws TransactionException, CodeExecutionException, TransactionRejectedException {
LongValue count = (LongValue) runStaticMethodCallTransaction(eoa, _10_000_000, jar(), new NonVoidMethodSignature(MAP_TESTS, "testNullValues", LONG));
assertEquals(100L, count.value);
}
@Test @DisplayName("IntMapTests.testIteration1() == 4950")
void geometricSumIntKeys() throws TransactionException, CodeExecutionException, TransactionRejectedException {
IntValue sum = (IntValue) runStaticMethodCallTransaction(eoa, _10_000_000, jar(), new NonVoidMethodSignature(INT_MAP_TESTS, "testIteration1", INT));
assertEquals(4950, sum.value);
}
@Test @DisplayName("IntMapTests.testUpdate1() == 5050")
void geometricSumAfterUpdateIntKeys() throws TransactionException, CodeExecutionException, TransactionRejectedException {
IntValue sum = (IntValue) runStaticMethodCallTransaction(eoa, _10_000_000, jar(), new NonVoidMethodSignature(INT_MAP_TESTS, "testUpdate1", INT));
assertEquals(5050, sum.value);
}
@Test @DisplayName("IntMapTests.testUpdate2() == 5050")
void geometricSumAfterUpdateIntKeysWithStream() throws TransactionException, CodeExecutionException, TransactionRejectedException {
IntValue sum = (IntValue) runStaticMethodCallTransaction(eoa, _10_000_000, jar(), new NonVoidMethodSignature(INT_MAP_TESTS, "testUpdate2", INT));
assertEquals(5050, sum.value);
}
@Test @DisplayName("IntMapTests.testNullValues() == 100L()")
void nullValuesInMapIntKeys() throws TransactionException, CodeExecutionException, TransactionRejectedException {
LongValue count = (LongValue) runStaticMethodCallTransaction(eoa, _10_000_000, jar(), new NonVoidMethodSignature(INT_MAP_TESTS, "testNullValues", LONG));
assertEquals(100L, count.value);
}
@Test @DisplayName("ArrayTests.testRandomInitialization() == 1225")
void randomArray() throws TransactionException, CodeExecutionException, TransactionRejectedException {
IntValue sum = (IntValue) runStaticMethodCallTransaction(eoa, _10_000_000, jar(), new NonVoidMethodSignature(ARRAY_TESTS, "testRandomInitialization", INT));
assertEquals(1225, sum.value);
}
@Test @DisplayName("ArrayTests.countNullsAfterRandomInitialization() == 50L")
void randomArrayCountNulls() throws TransactionException, CodeExecutionException, TransactionRejectedException {
LongValue count = (LongValue) runStaticMethodCallTransaction(eoa, _10_000_000, jar(), new NonVoidMethodSignature(ARRAY_TESTS, "countNullsAfterRandomInitialization", LONG));
assertEquals(50L, count.value);
}
@Test @DisplayName("ArrayTests.testUpdateWithDefault1() == 1325")
void randomArrayThenUpdate1() throws TransactionException, CodeExecutionException, TransactionRejectedException {
IntValue sum = (IntValue) runStaticMethodCallTransaction(eoa, _10_000_000, jar(), new NonVoidMethodSignature(ARRAY_TESTS, "testUpdateWithDefault1", INT));
assertEquals(1325, sum.value);
}
@Test @DisplayName("ArrayTests.testByteArrayThenIncrease() == 1375")
void randomArrayThenIncrease() throws TransactionException, CodeExecutionException, TransactionRejectedException {
IntValue sum = (IntValue) runStaticMethodCallTransaction(eoa, _10_000_000, jar(), new NonVoidMethodSignature(ARRAY_TESTS, "testByteArrayThenIncrease", INT));
assertEquals(1375, sum.value);
}
@Test @DisplayName("ArrayTests.testUpdateWithDefault2() == 1225")
void randomArrayThenUpdate2() throws TransactionException, CodeExecutionException, TransactionRejectedException {
IntValue sum = (IntValue) runStaticMethodCallTransaction(eoa, _10_000_000, jar(), new NonVoidMethodSignature(ARRAY_TESTS, "testUpdateWithDefault2", INT));
assertEquals(1225, sum.value);
}
@Test @DisplayName("ArrayTests.testGetOrDefault() == 1225")
void randomArrayTheGetOrDefault() throws TransactionException, CodeExecutionException, TransactionRejectedException {
IntValue sum = (IntValue) runStaticMethodCallTransaction(eoa, _10_000_000, jar(), new NonVoidMethodSignature(ARRAY_TESTS, "testGetOrDefault", INT));
assertEquals(1225, sum.value);
}
@Test @DisplayName("SetTests.testRandomInitialization() == true")
void randomRandomSetInitialization() throws TransactionException, CodeExecutionException, TransactionRejectedException {
BooleanValue count = (BooleanValue) runStaticMethodCallTransaction(eoa, _10_000_000, jar(), new NonVoidMethodSignature(SET_TESTS, "testRandomInitialization", BOOLEAN));
assertTrue(count.value);
}
@Test @DisplayName("new MapHolder()")
void mapHolder() throws TransactionException, CodeExecutionException, TransactionRejectedException, InvalidKeyException, SignatureException {
addConstructorCallTransaction(key, eoa, _10_000_000, BigInteger.ONE, jar(), new ConstructorSignature(MAP_HOLDER));
}
@Test @DisplayName("new MapHolder().get0() == RUNNING")
void mapHolderGet0() throws TransactionException, CodeExecutionException, TransactionRejectedException, InvalidKeyException, SignatureException {
StorageReference mapHolder = addConstructorCallTransaction(key, eoa, _10_000_000, BigInteger.ONE, jar(), new ConstructorSignature(MAP_HOLDER));
StorageValue state = runInstanceMethodCallTransaction(eoa, _10_000_000, jar(), new NonVoidMethodSignature(MAP_HOLDER, "get0", STATE), mapHolder);
BooleanValue result = (BooleanValue) runInstanceMethodCallTransaction(eoa, _10_000_000, jar(), new NonVoidMethodSignature(MAP_HOLDER, "isRunning", BOOLEAN, ClassType.OBJECT), mapHolder, state);
assertTrue(result.value);
}
@Test @DisplayName("new MapHolder().get1() == SLEEPING")
void mapHolderGet1() throws TransactionException, CodeExecutionException, TransactionRejectedException, InvalidKeyException, SignatureException {
StorageReference mapHolder = addConstructorCallTransaction(key, eoa, _10_000_000, BigInteger.ONE, jar(), new ConstructorSignature(MAP_HOLDER));
StorageValue state = runInstanceMethodCallTransaction(eoa, _10_000_000, jar(), new NonVoidMethodSignature(MAP_HOLDER, "get1", STATE), mapHolder);
BooleanValue result = (BooleanValue) runInstanceMethodCallTransaction(eoa, _10_000_000, jar(), new NonVoidMethodSignature(MAP_HOLDER, "isSleeping", BOOLEAN, ClassType.OBJECT), mapHolder, state);
assertTrue(result.value);
}
@Test @DisplayName("new MapHolder().get10() == WAITING")
void mapHolderGet10() throws TransactionException, CodeExecutionException, TransactionRejectedException, InvalidKeyException, SignatureException {
StorageReference mapHolder = addConstructorCallTransaction(key, eoa, _10_000_000, BigInteger.ONE, jar(), new ConstructorSignature(MAP_HOLDER));
StorageValue state = runInstanceMethodCallTransaction(eoa, _10_000_000, jar(), new NonVoidMethodSignature(MAP_HOLDER, "get10", STATE), mapHolder);
BooleanValue result = (BooleanValue) runInstanceMethodCallTransaction(eoa, _10_000_000, jar(), new NonVoidMethodSignature(MAP_HOLDER, "isWaiting", BOOLEAN, ClassType.OBJECT), mapHolder, state);
assertTrue(result.value);
}
@Test @DisplayName("new MapHolder().get0() == RUNNING with State")
void mapHolderGet0State() throws TransactionException, CodeExecutionException, TransactionRejectedException, InvalidKeyException, SignatureException {
StorageReference mapHolder = addConstructorCallTransaction(key, eoa, _10_000_000, BigInteger.ONE, jar(), new ConstructorSignature(MAP_HOLDER));
StorageValue state = runInstanceMethodCallTransaction(eoa, _10_000_000, jar(), new NonVoidMethodSignature(MAP_HOLDER, "get0", STATE), mapHolder);
BooleanValue result = (BooleanValue) runInstanceMethodCallTransaction(eoa, _10_000_000, jar(), new NonVoidMethodSignature(MAP_HOLDER, "isRunning2", BOOLEAN, STATE), mapHolder, state);
assertTrue(result.value);
}
@Test @DisplayName("new MapHolder().get1() == SLEEPING with State")
void mapHolderGet1State() throws TransactionException, CodeExecutionException, TransactionRejectedException, InvalidKeyException, SignatureException {
StorageReference mapHolder = addConstructorCallTransaction(key, eoa, _10_000_000, BigInteger.ONE, jar(), new ConstructorSignature(MAP_HOLDER));
StorageValue state = runInstanceMethodCallTransaction(eoa, _10_000_000, jar(), new NonVoidMethodSignature(MAP_HOLDER, "get1", STATE), mapHolder);
BooleanValue result = (BooleanValue) runInstanceMethodCallTransaction(eoa, _10_000_000, jar(), new NonVoidMethodSignature(MAP_HOLDER, "isSleeping2", BOOLEAN, STATE), mapHolder, state);
assertTrue(result.value);
}
@Test @DisplayName("new MapHolder().get10() == WAITING with State")
void mapHolderGet10State() throws TransactionException, CodeExecutionException, TransactionRejectedException, InvalidKeyException, SignatureException {
StorageReference mapHolder = addConstructorCallTransaction(key, eoa, _10_000_000, BigInteger.ONE, jar(), new ConstructorSignature(MAP_HOLDER));
StorageValue state = runInstanceMethodCallTransaction(eoa, _10_000_000, jar(), new NonVoidMethodSignature(MAP_HOLDER, "get10", STATE), mapHolder);
BooleanValue result = (BooleanValue) runInstanceMethodCallTransaction(eoa, _10_000_000, jar(), new NonVoidMethodSignature(MAP_HOLDER, "isWaiting2", BOOLEAN, STATE), mapHolder, state);
assertTrue(result.value);
}
@Test @DisplayName("new MapHolder().get0() == RUNNING with Comparable")
void mapHolderGet0Comparable() throws TransactionException, CodeExecutionException, TransactionRejectedException, InvalidKeyException, SignatureException {
StorageReference mapHolder = addConstructorCallTransaction(key, eoa, _10_000_000, BigInteger.ONE, jar(), new ConstructorSignature(MAP_HOLDER));
StorageValue state = runInstanceMethodCallTransaction(eoa, _10_000_000, jar(), new NonVoidMethodSignature(MAP_HOLDER, "get0", STATE), mapHolder);
BooleanValue result = (BooleanValue) runInstanceMethodCallTransaction(eoa, _10_000_000, jar(), new NonVoidMethodSignature(MAP_HOLDER, "isRunning3", BOOLEAN, COMPARABLE), mapHolder, state);
assertTrue(result.value);
}
@Test @DisplayName("new MapHolder().get1() == SLEEPING with Comparable")
void mapHolderGet1Comparable() throws TransactionException, CodeExecutionException, TransactionRejectedException, InvalidKeyException, SignatureException {
StorageReference mapHolder = addConstructorCallTransaction(key, eoa, _10_000_000, BigInteger.ONE, jar(), new ConstructorSignature(MAP_HOLDER));
StorageValue state = runInstanceMethodCallTransaction(eoa, _10_000_000, jar(), new NonVoidMethodSignature(MAP_HOLDER, "get1", STATE), mapHolder);
BooleanValue result = (BooleanValue) runInstanceMethodCallTransaction(eoa, _10_000_000, jar(), new NonVoidMethodSignature(MAP_HOLDER, "isSleeping3", BOOLEAN, COMPARABLE), mapHolder, state);
assertTrue(result.value);
}
@Test @DisplayName("new MapHolder().get10() == WAITING with Comparable")
void mapHolderGet10Comparable() throws TransactionException, CodeExecutionException, TransactionRejectedException, InvalidKeyException, SignatureException {
StorageReference mapHolder = addConstructorCallTransaction(key, eoa, _10_000_000, BigInteger.ONE, jar(), new ConstructorSignature(MAP_HOLDER));
StorageValue state = runInstanceMethodCallTransaction(eoa, _10_000_000, jar(), new NonVoidMethodSignature(MAP_HOLDER, "get10", STATE), mapHolder);
BooleanValue result = (BooleanValue) runInstanceMethodCallTransaction(eoa, _10_000_000, jar(), new NonVoidMethodSignature(MAP_HOLDER, "isWaiting3", BOOLEAN, COMPARABLE), mapHolder, state);
assertTrue(result.value);
}
} | java |
[{"Name":"Expand Items Into View","ExampleInfo":{"Name":"Expand Items Into View","DirectoryName":"ExpandItemsIntoView","ExampleFileNames":["ExpandItemsIntoView_WPF.csproj","App.xaml","App.xaml.cs","MainWindow.xaml","MainWindow.xaml.cs","MyObject.cs","RadTreeListViewExtensions.cs","Readme.md"]},"GitHubPath":"https://api.github.com/repos/telerik/xaml-sdk/contents/TreeListView/ExpandItemsIntoView/","Description":"\nThis example demonstrates how to expand and scroll into view an item or group of nested items.","KeyWords":"Expand Items Into View"}] | json |
{"jquery.storageapi.js":"sha256-<KEY>,"jquery.storageapi.min.js":"<KEY>}
| json |
March 20 – Voice-controlled smartwatches that track heart rates and connect to phones and tablets will debut later this year as Google Inc partners with electronics, technology and fashion companies to take consumers to the next promised frontier in computing.
Google has unveiled plans to help develop the watches and other wearable computers based on its Android mobile operating system, which already runs more than three out of four smartphones sold worldwide.
The Android Wear project is open to software makers to create apps for the watches, putting Google at the forefront of efforts to jumpstart the nascent wearable computing market.
The news comes as speculation swirls around iPhone-maker Apple Inc’s plans for wearable computers, including a smartwatch of its own. Apple Chief Executive Tim Cook has promised new “product categories” later this year.
A video posted on Google’s blog showed people speaking into their watches to check sports scores, control music, send replies to text messages and even open their home garages.
By aligning itself with a broad spectrum of partners to develop the smartwatches, Google is hoping to replicate the success that helped make its free Android software the most popular smartphone operating system, analysts said.
LG Electronics said on Tuesday it would introduce its first Android watch, the G Watch, in the second quarter. Motorola said its Moto 360 Android watch would be available this summer. Fossil Group Inc, which makes watches, handbags and other accessories, also announced that it was working with Google on Android devices.
Many believe wearable computers represent the next big shift in technology, just as smartphones evolved from personal computers, but efforts by various companies so far have had mixed results.
Samsung was among the first to sell a smartwatch for consumers, but its maiden effort, the Galaxy Gear, was widely panned by reviewers.
Google’s announcement “definitely gives wearables a status that it’s a market in its own right and it needs to be treated with the respect that a separate operating system branch gives it,” said Carolina Milanesi, an analyst with Kantar World Panel.
Android smartwatches will connect wirelessly to a mobile phone and can be outfitted with a variety of sensors, Google said. That means that apps developed for Android watches will be able to monitor fitness and health information such as a wearer’s heart rate or distance jogged.
Google has released an Android Wear Developer Preview, saying it would allow software makers to begin creating specialized apps for the watches.
Google has also been developing Google Glass, a small stamp-sized screen attached to a pair of eyeglass frames. Google Glass can record video, access email, provide turn-by-turn driving directions and retrieve info from the Web by connecting wirelessly to a user’s cell phone, but it has also raised concerns ranging from privacy intrusions to distracted driving.
Smartwatches have a better chance of catching on with the general public than Google Glass, said Ramon Llamas, an analyst with industry research firm IDC.
“It’s a really cool idea, but there’s something that creeps people out about it,” Llamas said of Google Glass.
The success of smartwatches will depend on the device’s price, battery life and the appeal of the watches’ designs, he said.
Motorola said it would share more details about its forthcoming Moto 360 smartwatch when it holds a special online press conference on Wednesday. Google recently announced plans to sell its Motorola business to Chinese PC-maker Lenovo Group Ltd.
Juniper Research expects more than 130 million smart wearable devices will ship by 2018. Moreover, global shipments of wearable “smart glasses” alone will reach 10 million each year by 2018, compared with an estimated 87,000 in 2013, according to the research firm.
MUST HAVE OR NICE TO HAVE?
Google, whose projects range from self-driving cars to robots, likely sees smartwatches as part of the future evolution of computing, said Raymond James analyst Aaron Kessler. But he said it remained to be seen whether smartwatches will become an indispensable digital accessory or a “nice-to-have” gadget.
“At this point I would still view it as a niche product,” he said.
| english |
<gh_stars>1-10
/*
* YangFfmpegEncoderMeta.cpp
*
* Created on: 2020年9月26日
* Author: yang
*/
#include "YangFfmpegEncoderMeta.h"
#include "YangVideoEncoderFfmpeg.h"
#include <yangutil/sys/YangLog.h>
#include <yangavutil/video/YangMeta.h>
YangFfmpegEncoderMeta::YangFfmpegEncoderMeta() {
#if Yang_Ffmpeg_UsingSo
unloadLib();
#endif
}
YangFfmpegEncoderMeta::~YangFfmpegEncoderMeta() {
#if Yang_Ffmpeg_UsingSo
unloadLib();
m_lib.unloadObject();
m_lib1.unloadObject();
#endif
}
#if Yang_Ffmpeg_UsingSo
void YangFfmpegEncoderMeta::loadLib() {
yang_av_buffer_unref = (void (*)(AVBufferRef **buf)) m_lib1.loadFunction(
"av_buffer_unref");
yang_av_hwframe_ctx_init = (int32_t (*)(AVBufferRef *ref)) m_lib1.loadFunction(
"av_hwframe_ctx_init");
yang_av_frame_alloc = (AVFrame* (*)(void)) m_lib1.loadFunction(
"av_frame_alloc");
yang_av_image_get_buffer_size = (int32_t (*)(enum AVPixelFormat pix_fmt,
int32_t width, int32_t height, int32_t align)) m_lib1.loadFunction(
"av_image_get_buffer_size");
yang_av_hwdevice_ctx_create = (int32_t (*)(AVBufferRef **device_ctx,
enum AVHWDeviceType type, const char *device, AVDictionary *opts,
int32_t flags)) m_lib1.loadFunction("av_hwdevice_ctx_create");
yang_av_hwframe_transfer_data = (int32_t (*)(AVFrame *dst, const AVFrame *src,
int32_t flags)) m_lib1.loadFunction("av_hwframe_transfer_data");
yang_av_free = (void (*)(void *ptr)) m_lib1.loadFunction("av_free");
yang_av_frame_free = (void (*)(AVFrame **frame)) m_lib1.loadFunction(
"av_frame_free");
yang_av_buffer_ref =
(AVBufferRef* (*)(AVBufferRef *buf)) m_lib1.loadFunction(
"av_buffer_ref");
yang_av_image_fill_arrays = (int32_t (*)(uint8_t *dst_data[4],
int32_t dst_linesize[4], const uint8_t *src, enum AVPixelFormat pix_fmt,
int32_t width, int32_t height, int32_t align)) m_lib1.loadFunction(
"av_image_fill_arrays");
yang_av_hwframe_ctx_alloc =
(AVBufferRef* (*)(AVBufferRef *device_ctx)) m_lib1.loadFunction(
"av_hwframe_ctx_alloc");
yang_av_hwframe_get_buffer = (int32_t (*)(AVBufferRef *hwframe_ctx,
AVFrame *frame, int32_t flags)) m_lib1.loadFunction(
"av_hwframe_get_buffer");
yang_av_malloc = (void* (*)(size_t size)) m_lib1.loadFunction("av_malloc");
yang_avcodec_alloc_context3 =
(AVCodecContext* (*)(const AVCodec *codec)) m_lib.loadFunction(
"avcodec_alloc_context3");
yang_av_init_packet = (void (*)(AVPacket *pkt)) m_lib.loadFunction(
"av_init_packet");
yang_avcodec_find_encoder_by_name =
(AVCodec* (*)(const char *name)) m_lib.loadFunction(
"avcodec_find_encoder_by_name");
yang_avcodec_open2 = (int32_t (*)(AVCodecContext *avctx, const AVCodec *codec,
AVDictionary **options)) m_lib.loadFunction("avcodec_open2");
yang_avcodec_send_frame = (int32_t (*)(AVCodecContext *avctx,
const AVFrame *frame)) m_lib.loadFunction("avcodec_send_frame");
yang_avcodec_receive_packet = (int32_t (*)(AVCodecContext *avctx,
AVPacket *avpkt)) m_lib.loadFunction("avcodec_receive_packet");
yang_avcodec_close = (int32_t (*)(AVCodecContext *avctx)) m_lib.loadFunction(
"avcodec_close");
}
void YangFfmpegEncoderMeta::unloadLib() {
yang_av_hwframe_ctx_alloc = NULL;
yang_av_hwframe_ctx_init = NULL;
yang_av_buffer_unref = NULL;
yang_avcodec_find_encoder_by_name = NULL;
yang_av_hwdevice_ctx_create = NULL;
yang_av_frame_alloc = NULL;
yang_avcodec_open2 = NULL;
yang_av_image_get_buffer_size = NULL;
yang_av_malloc = NULL;
yang_av_image_fill_arrays = NULL;
yang_av_init_packet = NULL;
yang_av_hwframe_get_buffer = NULL;
yang_av_hwframe_transfer_data = NULL;
yang_avcodec_send_frame = NULL;
yang_avcodec_receive_packet = NULL;
yang_av_frame_free = NULL;
yang_avcodec_close = NULL;
yang_av_free = NULL;
}
#endif
#define HEX2BIN(a) (((a)&0x40)?((a)&0xf)+9:((a)&0xf))
//void ConvertYCbCr2BGR(uint8_t *pYUV,uint8_t *pBGR,int32_t iWidth,int32_t iHeight);
//void ConvertRGB2YUV(int32_t w,int32_t h,uint8_t *bmp,uint8_t *yuv);
//int32_t g_m_fx2=2;
void YangFfmpegEncoderMeta::yang_find_next_start_code(YangVideoCodec pve,uint8_t *buf,int32_t bufLen,int32_t *vpsPos,int32_t *vpsLen,int32_t *spsPos,int32_t *spsLen,int32_t *ppsPos,int32_t *ppsLen)
{
int32_t i = 0;
// printf("\n**********************extradate.....=%d\n",bufLen);
// for(int32_t j=0;j<bufLen;j++) printf("%02x,",*(buf+j));
//printf("\n*************************************\n");
*spsPos=0;*ppsPos=0;
if(pve==Yang_VED_265) {
*vpsPos=0;
while(i<bufLen-3){
if (buf[i] == 0 && buf[i + 1] == 0 &&buf[i + 2] == 0&& buf[i + 3] == 1){
*vpsPos=i+4;
i+=4;
break;
}
i++;
}
}
while (i <bufLen-3) {
if (buf[i] == 0 && buf[i + 1] == 0 &&buf[i + 2] == 0&& buf[i + 3] == 1){
if(pve==Yang_VED_265) *vpsLen=i-4;
*spsPos=i+4;
i+=4;
break;
}
i++;
}
while (i <bufLen-3) {
if (buf[i] == 0 && buf[i + 1] == 0 &&buf[i + 2] == 0&& buf[i + 3] == 1){
*spsLen=i-*spsPos;
*ppsPos=i+4;
*ppsLen=bufLen-*ppsPos;
break;
}
i++;
}
}
int32_t YangFfmpegEncoderMeta::set_hwframe_ctx(AVPixelFormat ctxformat,AVPixelFormat swformat,YangVideoInfo *yvp,AVCodecContext *ctx, AVBufferRef *hw_device_ctx,int32_t pwid,int32_t phei) {
AVBufferRef *hw_frames_ref;
AVHWFramesContext *frames_ctx = NULL;
int32_t err = 0;
int32_t ret=0;
if (!(hw_frames_ref = yang_av_hwframe_ctx_alloc(hw_device_ctx))) {
yang_error("Failed to create VAAPI frame context.\n");
return -1;
}
frames_ctx = (AVHWFramesContext*) (hw_frames_ref->data);
frames_ctx->format = ctxformat;
frames_ctx->sw_format = swformat;
frames_ctx->width = pwid;
frames_ctx->height = phei;
frames_ctx->initial_pool_size = 0;
if ((err = yang_av_hwframe_ctx_init(hw_frames_ref)) < 0) {
yang_error("Failed to initialize VAAPI frame context.Error code: %d\n",
ret);
yang_av_buffer_unref(&hw_frames_ref);
return err;
}
ctx->hw_frames_ctx = yang_av_buffer_ref(hw_frames_ref);
ctx->hw_device_ctx = yang_av_buffer_ref(hw_device_ctx);
// ctx->hwaccel_flags=1;
if (!ctx->hw_frames_ctx)
err = AVERROR(ENOMEM);
yang_av_buffer_unref(&hw_frames_ref);
return err;
}
enum AVPixelFormat get_hw_format22(AVCodecContext *ctx,
const enum AVPixelFormat *pix_fmts) {
if(YangVideoEncoderFfmpeg::g_hwType==YangV_Hw_Intel) return AV_PIX_FMT_VAAPI;
if(YangVideoEncoderFfmpeg::g_hwType==YangV_Hw_Nvdia) return AV_PIX_FMT_CUDA;
if(YangVideoEncoderFfmpeg::g_hwType==YangV_Hw_Android) return AV_PIX_FMT_MEDIACODEC;
return AV_PIX_FMT_VAAPI;
}
void YangFfmpegEncoderMeta::yang_getSpsPps(YangH2645Conf *pconf,
YangVideoInfo *p_yvp, YangVideoEncInfo *penc) {
#if Yang_Ffmpeg_UsingSo
m_lib.loadObject("libavcodec");
m_lib1.loadObject("libavutil");
loadLib();
#endif
YangVideoCodec m_encoderType=(YangVideoCodec)p_yvp->videoEncoderType;
YangVideoHwType m_hwType=(YangVideoHwType)p_yvp->videoEncHwType;
AVCodec *m_codec=NULL;
AVCodecContext *m_codecCtx = NULL;
AVBufferRef *hw_device_ctx=NULL;
//hevc_vaapi nvenc nvdec vdpau h264_nvenc
if(m_encoderType==Yang_VED_264){
if(m_hwType==YangV_Hw_Intel) m_codec = yang_avcodec_find_encoder_by_name("h264_vaapi");//avcodec_find_encoder(AV_CODEC_ID_H264);
if(m_hwType==YangV_Hw_Nvdia) m_codec = yang_avcodec_find_encoder_by_name("h264_nvenc");
if(m_hwType==YangV_Hw_Android) m_codec = yang_avcodec_find_encoder_by_name("h264_mediacodec");
}else if(m_encoderType==Yang_VED_265){
if(m_hwType==YangV_Hw_Intel) m_codec = yang_avcodec_find_encoder_by_name("hevc_vaapi");
if(m_hwType==YangV_Hw_Nvdia) m_codec = yang_avcodec_find_encoder_by_name("hevc_nvenc");
if(m_hwType==YangV_Hw_Android) m_codec = yang_avcodec_find_encoder_by_name("hevc_mediacodec");
}
m_codecCtx = yang_avcodec_alloc_context3(m_codec);
YangVideoEncoderFfmpeg::initParam(m_codecCtx,p_yvp,penc);
m_codecCtx->get_format = get_hw_format22; // AV_PIX_FMT_NV12;//get_hw_format;
int32_t ret=0;
//AV_HWDEVICE_TYPE_CUDA
YangVideoEncoderFfmpeg::g_hwType=(YangVideoHwType)p_yvp->videoEncHwType;
if(YangVideoEncoderFfmpeg::g_hwType==YangV_Hw_Intel){
ret = yang_av_hwdevice_ctx_create(&hw_device_ctx, AV_HWDEVICE_TYPE_VAAPI,"/dev/dri/renderD128", NULL, 0);
m_codecCtx->pix_fmt = AV_PIX_FMT_VAAPI;
}else if(YangVideoEncoderFfmpeg::g_hwType==YangV_Hw_Nvdia){
ret = yang_av_hwdevice_ctx_create(&hw_device_ctx, AV_HWDEVICE_TYPE_CUDA,"CUDA", NULL, 0);
m_codecCtx->pix_fmt = AV_PIX_FMT_CUDA;
}else if(YangVideoEncoderFfmpeg::g_hwType==YangV_Hw_Android){
ret = yang_av_hwdevice_ctx_create(&hw_device_ctx, AV_HWDEVICE_TYPE_MEDIACODEC,"MEDIACODEC", NULL, 0);
m_codecCtx->pix_fmt = AV_PIX_FMT_MEDIACODEC;
}
//YangVideoEncoderFfmpeg::g_hwType=m_codecCtx->pix_fmt ;
if(ret<0){
printf("\nhw create error!..ret=%d\n",ret);
exit(1);
}
//ret = yang_av_hwdevice_ctx_create(&hw_device_ctx, AV_HWDEVICE_TYPE_CUDA,"CUDA", NULL, 0);
//AV_PIX_FMT_NV12;//AV_PIX_FMT_VAAPI;AV_PIX_FMT_YUV420P;//AV_PIX_FMT_CUDA
//AV_PIX_FMT_CUDA
AVPixelFormat ctxformat,swformat;
if(p_yvp->videoEncHwType==YangV_Hw_Intel) ctxformat = AV_PIX_FMT_VAAPI;
if(p_yvp->videoEncHwType==YangV_Hw_Nvdia) ctxformat = AV_PIX_FMT_CUDA;
if(p_yvp->videoEncHwType==YangV_Hw_Android) ctxformat = AV_PIX_FMT_MEDIACODEC;
if(p_yvp->bitDepth==8) swformat = AV_PIX_FMT_NV12;
if(p_yvp->bitDepth==10) swformat = AV_PIX_FMT_P010;
if(p_yvp->bitDepth==16) swformat = AV_PIX_FMT_P016;
if ((ret = set_hwframe_ctx(ctxformat,swformat,p_yvp,m_codecCtx, hw_device_ctx, p_yvp->outWidth,
p_yvp->outHeight)) < 0) {
printf("Failed to set hwframe context.\n");
//goto close;
}
m_codecCtx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
ret = yang_avcodec_open2(m_codecCtx, m_codec, NULL);
if (ret < 0){
printf("\navcodec_open2 failure................\n");
exit(1);
}
int32_t vpsPos=0,vpsLen=0;
int32_t spsPos=0,ppsPos=0;
int32_t spsLen=0,ppsLen=0;
yang_find_next_start_code(m_encoderType,m_codecCtx->extradata,m_codecCtx->extradata_size,&vpsPos,&vpsLen,&spsPos,&spsLen,&ppsPos,&ppsLen);
if(m_encoderType==Yang_VED_265) {
pconf->vpsLen=vpsLen;
memcpy(pconf->vps,m_codecCtx->extradata+vpsPos,vpsLen);
//printf("\n**************vpsLen===%d...\n",pconf->vpsLen);
//for(int32_t i=0;i<pconf->vpsLen;i++) printf("%02x,",pconf->vps[i]);
}
pconf->spsLen=spsLen;
pconf->ppsLen=ppsLen;
memcpy(pconf->sps,m_codecCtx->extradata+spsPos,spsLen);
memcpy(pconf->pps,m_codecCtx->extradata+ppsPos,ppsLen);
yang_av_buffer_unref(&hw_device_ctx);
if (m_codecCtx){
yang_avcodec_close(m_codecCtx);
yang_av_free(m_codecCtx);
}
m_codecCtx = NULL;
}
//Conf264 t_conf264;
void YangFfmpegEncoderMeta::yang_initVmd(YangVideoMeta *p_vmd,
YangVideoInfo *p_yvp, YangVideoEncInfo *penc) {
if (!p_vmd->isInit) {
yang_getSpsPps(&p_vmd->mp4Meta, p_yvp,penc);
if(p_yvp->videoEncoderType==Yang_VED_264) yang_getConfig_Flv_H264(&p_vmd->mp4Meta, p_vmd->livingMeta.buffer,&p_vmd->livingMeta.bufLen);
if(p_yvp->videoEncoderType==Yang_VED_265) yang_getConfig_Flv_H265(&p_vmd->mp4Meta, p_vmd->livingMeta.buffer,&p_vmd->livingMeta.bufLen);
// yang_getH265Config_Flv(&p_vmd->mp4Meta, p_vmd->flvMeta.buffer, &p_vmd->flvMeta.bufLen);
p_vmd->isInit = 1;
}
}
| cpp |
<filename>benches/rescue.rs<gh_stars>1-10
// Copyright (c) 2021-2022 Toposware, Inc.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion};
use log::debug;
use std::time::{Duration, Instant};
use winterfell::{
crypto::Hasher,
math::{fields::f63::BaseElement, log2, FieldElement},
Air, AirContext, Assertion, ByteWriter, EvaluationFrame, FieldExtension, HashFunction,
ProofOptions, Serializable, StarkProof, Trace, TraceInfo, TraceTable,
TransitionConstraintDegree, VerifierError,
};
use certificate_stark::utils::rescue::{HASH_CYCLE_LENGTH, NUM_HASH_ROUNDS, RATE_WIDTH};
use certificate_stark::utils::{are_equal, is_zero, not, rescue, EvaluationResult};
const SIZES: [usize; 4] = [128, 256, 512, 1024];
pub struct RescueExample {
options: ProofOptions,
chain_length: usize,
seed: [BaseElement; 7],
result: [BaseElement; 7],
}
impl RescueExample {
fn new(chain_length: usize, options: ProofOptions) -> RescueExample {
assert!(
chain_length.is_power_of_two(),
"chain length must a power of 2"
);
let seed = [
BaseElement::from(42u8),
BaseElement::from(43u8),
BaseElement::from(44u8),
BaseElement::from(45u8),
BaseElement::from(46u8),
BaseElement::from(47u8),
BaseElement::from(48u8),
];
// compute the sequence of hashes using external implementation of Rescue hash
let now = Instant::now();
let result = compute_hash_chain(seed, chain_length);
debug!(
"Computed a chain of {} Rescue hashes in {} ms",
chain_length,
now.elapsed().as_millis(),
);
RescueExample {
options,
chain_length,
seed,
result,
}
}
fn prove(&self) -> StarkProof {
// generate the execution trace
debug!(
"Generating proof for computing a chain of {} Rescue hashes\n\
---------------------",
self.chain_length
);
let now = Instant::now();
let trace = build_trace(self.seed, self.chain_length);
let trace_length = trace.length();
debug!(
"Generated execution trace of {} registers and 2^{} steps in {} ms",
trace.width(),
log2(trace_length),
now.elapsed().as_millis()
);
// generate the proof
let pub_inputs = PublicInputs {
seed: self.seed,
result: self.result,
};
winterfell::prove::<RescueAir>(trace, pub_inputs, self.options.clone()).unwrap()
}
fn verify(&self, proof: StarkProof) -> Result<(), VerifierError> {
let pub_inputs = PublicInputs {
seed: self.seed,
result: self.result,
};
winterfell::verify::<RescueAir>(proof, pub_inputs)
}
fn _verify_with_wrong_inputs(&self, proof: StarkProof) -> Result<(), VerifierError> {
let pub_inputs = PublicInputs {
seed: self.seed,
result: [self.result[0]; RATE_WIDTH],
};
winterfell::verify::<RescueAir>(proof, pub_inputs)
}
}
fn compute_hash_chain(seed: [BaseElement; RATE_WIDTH], length: usize) -> [BaseElement; RATE_WIDTH] {
let mut values = rescue::Hash::new(
seed[0], seed[1], seed[2], seed[3], seed[4], seed[5], seed[6],
);
let mut result = rescue::Hash::new(
BaseElement::ZERO,
BaseElement::ZERO,
BaseElement::ZERO,
BaseElement::ZERO,
BaseElement::ZERO,
BaseElement::ZERO,
BaseElement::ZERO,
);
for _ in 0..length {
result = rescue::Rescue63::merge(&[values, result]);
values = result;
}
result.to_elements()
}
// CONSTANTS
// ================================================================================================
const TRACE_WIDTH: usize = 14;
/// Specifies steps on which Rescue transition function is applied.
const CYCLE_MASK: [BaseElement; HASH_CYCLE_LENGTH] = [
BaseElement::ONE,
BaseElement::ONE,
BaseElement::ONE,
BaseElement::ONE,
BaseElement::ONE,
BaseElement::ONE,
BaseElement::ONE,
BaseElement::ZERO,
];
// RESCUE AIR
// ================================================================================================
pub struct PublicInputs {
pub seed: [BaseElement; RATE_WIDTH],
pub result: [BaseElement; RATE_WIDTH],
}
impl Serializable for PublicInputs {
fn write_into<W: ByteWriter>(&self, target: &mut W) {
target.write(&self.seed[..]);
target.write(&self.result[..]);
}
}
pub struct RescueAir {
context: AirContext<BaseElement>,
seed: [BaseElement; RATE_WIDTH],
result: [BaseElement; RATE_WIDTH],
}
impl Air for RescueAir {
type BaseField = BaseElement;
type PublicInputs = PublicInputs;
// CONSTRUCTOR
// --------------------------------------------------------------------------------------------
fn new(trace_info: TraceInfo, pub_inputs: PublicInputs, options: ProofOptions) -> Self {
let degrees = vec![
TransitionConstraintDegree::with_cycles(3, vec![HASH_CYCLE_LENGTH]),
TransitionConstraintDegree::with_cycles(3, vec![HASH_CYCLE_LENGTH]),
TransitionConstraintDegree::with_cycles(3, vec![HASH_CYCLE_LENGTH]),
TransitionConstraintDegree::with_cycles(3, vec![HASH_CYCLE_LENGTH]),
TransitionConstraintDegree::with_cycles(3, vec![HASH_CYCLE_LENGTH]),
TransitionConstraintDegree::with_cycles(3, vec![HASH_CYCLE_LENGTH]),
TransitionConstraintDegree::with_cycles(3, vec![HASH_CYCLE_LENGTH]),
TransitionConstraintDegree::with_cycles(3, vec![HASH_CYCLE_LENGTH]),
TransitionConstraintDegree::with_cycles(3, vec![HASH_CYCLE_LENGTH]),
TransitionConstraintDegree::with_cycles(3, vec![HASH_CYCLE_LENGTH]),
TransitionConstraintDegree::with_cycles(3, vec![HASH_CYCLE_LENGTH]),
TransitionConstraintDegree::with_cycles(3, vec![HASH_CYCLE_LENGTH]),
TransitionConstraintDegree::with_cycles(3, vec![HASH_CYCLE_LENGTH]),
TransitionConstraintDegree::with_cycles(3, vec![HASH_CYCLE_LENGTH]),
];
assert_eq!(TRACE_WIDTH, trace_info.width());
RescueAir {
context: AirContext::new(trace_info, degrees, options),
seed: pub_inputs.seed,
result: pub_inputs.result,
}
}
fn context(&self) -> &AirContext<Self::BaseField> {
&self.context
}
fn evaluate_transition<E: FieldElement + From<Self::BaseField>>(
&self,
frame: &EvaluationFrame<E>,
periodic_values: &[E],
result: &mut [E],
) {
let current = frame.current();
let next = frame.next();
// expected state width is 14 field elements
debug_assert_eq!(TRACE_WIDTH, current.len());
debug_assert_eq!(TRACE_WIDTH, next.len());
// split periodic values into hash_flag and Rescue round constants
let hash_flag = periodic_values[0];
let ark = &periodic_values[1..];
// when hash_flag = 1, constraints for Rescue round are enforced
rescue::enforce_round(result, current, next, ark, hash_flag);
// when hash_flag = 0, constraints for copying hash values to the next
// step are enforced.
let copy_flag = not(hash_flag);
enforce_hash_copy(result, current, next, copy_flag);
}
fn get_assertions(&self) -> Vec<Assertion<Self::BaseField>> {
// Assert starting and ending values of the hash chain
let last_step = self.trace_length() - 1;
vec![
Assertion::single(0, 0, self.seed[0]),
Assertion::single(1, 0, self.seed[1]),
Assertion::single(2, 0, self.seed[2]),
Assertion::single(3, 0, self.seed[3]),
Assertion::single(4, 0, self.seed[4]),
Assertion::single(5, 0, self.seed[5]),
Assertion::single(6, 0, self.seed[6]),
Assertion::single(0, last_step, self.result[0]),
Assertion::single(1, last_step, self.result[1]),
Assertion::single(2, last_step, self.result[2]),
Assertion::single(3, last_step, self.result[3]),
Assertion::single(4, last_step, self.result[4]),
Assertion::single(5, last_step, self.result[5]),
Assertion::single(6, last_step, self.result[6]),
]
}
fn get_periodic_column_values(&self) -> Vec<Vec<Self::BaseField>> {
let mut result = vec![CYCLE_MASK.to_vec()];
result.append(&mut rescue::get_round_constants());
result
}
}
// HELPER EVALUATORS
// ------------------------------------------------------------------------------------------------
/// when flag = 1, enforces that the next state of the computation is defined like so:
/// - the first RATE_WIDTH registers are equal to the values from the previous step
/// - the other RATE_WIDTH registers are equal to 0,
fn enforce_hash_copy<E: FieldElement>(result: &mut [E], current: &[E], next: &[E], flag: E) {
for i in 0..RATE_WIDTH {
result.agg_constraint(i, flag, are_equal(current[i], next[i]));
}
// resetting the last registers
for i in 0..RATE_WIDTH {
result.agg_constraint(RATE_WIDTH + i, flag, is_zero(next[RATE_WIDTH + i]));
}
}
// RESCUE TRACE GENERATOR
// ================================================================================================
fn build_trace(seed: [BaseElement; RATE_WIDTH], iterations: usize) -> TraceTable<BaseElement> {
// allocate memory to hold the trace table
let trace_length = iterations * HASH_CYCLE_LENGTH;
let mut trace = TraceTable::new(TRACE_WIDTH, trace_length);
trace.fill(
|state| {
// initialize first state of the computation
state[0] = seed[0];
state[1] = seed[1];
state[2] = seed[2];
state[3] = seed[3];
state[4] = seed[4];
state[5] = seed[5];
state[6] = seed[6];
state[7] = BaseElement::ZERO;
state[8] = BaseElement::ZERO;
state[9] = BaseElement::ZERO;
state[10] = BaseElement::ZERO;
state[11] = BaseElement::ZERO;
state[12] = BaseElement::ZERO;
state[13] = BaseElement::ZERO;
},
|step, state| {
// execute the transition function for all steps
if (step % HASH_CYCLE_LENGTH) < NUM_HASH_ROUNDS {
rescue::apply_round(state, step);
} else {
state[7] = BaseElement::ZERO;
state[8] = BaseElement::ZERO;
state[9] = BaseElement::ZERO;
state[10] = BaseElement::ZERO;
state[11] = BaseElement::ZERO;
state[12] = BaseElement::ZERO;
state[13] = BaseElement::ZERO;
}
},
);
trace
}
// RESCUE BENCHMARK
// ================================================================================================
fn rescue_bench(c: &mut Criterion) {
let mut group = c.benchmark_group("rescue");
group.sample_size(10);
group.measurement_time(Duration::from_secs(20));
let options = ProofOptions::new(
42,
4,
0,
HashFunction::Blake3_256,
FieldExtension::None,
4,
256,
);
for &size in SIZES.iter() {
let rescue = RescueExample::new(size, options.clone());
group.bench_function(BenchmarkId::new("prove", size), |bench| {
bench.iter(|| rescue.prove());
});
let proof = rescue.prove();
group.bench_function(BenchmarkId::new("verify", size), |bench| {
bench.iter(|| rescue.verify(proof.clone()));
});
}
group.finish();
}
criterion_group!(rescue_group, rescue_bench);
criterion_main!(rescue_group);
| rust |
var callbackArguments = [];
var argument1 = function callback(a,b,c) {
callbackArguments.push(JSON.stringify(arguments))
base_0[7][2] = [-100]
base_0[6][3] = {"213":"","607":"v+","6.517762464072812e+307":1.2135408043159328e+308,"_l":843,"9.575722842313938e+307":6.750605395822894e+307}
return a+b+c
};
var argument2 = function callback(a,b,c) {
callbackArguments.push(JSON.stringify(arguments))
base_1[1][0] = ""
base_1[0][1.4677087964888306e+308] = [969,49,"V","B","5EOG^6",843,627]
base_1[7][2] = true
return a/b+c
};
var argument3 = ["N7C","|","=","^","$G","O8TL"];
var argument4 = function callback(a,b,c) {
callbackArguments.push(JSON.stringify(arguments))
argument5[1] = ["2p","eo","r",";c","<","`","K",","]
argument5[618] = null
base_2[3][4] = ""
return a-b*c
};
var argument5 = function callback(a,b,c) {
callbackArguments.push(JSON.stringify(arguments))
argument6[1.6177106033227046e+308] = {"3":"!a","5":1.5194533062843776e+308,"49":"R0D","AR<I":"2%bk46u","2.3609818186330725e+307":""}
base_3[4] = {"_":126,"":714,"'":1.0560416431551267e+308,"ij":1.0016055099351705e+308}
argument6['C'] = {"714":"","-100":"@","2.032129315444174e+307":"","4.735436115502806e+307":1.495989553641834e+308,"1.7976931348623157e+308":"","":"","5.575596295363419e+307":893}
return a/b*c
};
var base_0 = ["N","R","V","ck","p?","!,","D-#"]
var r_0= undefined
try {
r_0 = base_0.map(argument1)
}
catch(e) {
r_0= "Error"
}
var base_1 = ["N","R","V","ck","p?","!,","D-#"]
var r_1= undefined
try {
r_1 = base_1.map(argument2,argument3)
}
catch(e) {
r_1= "Error"
}
var base_2 = ["N","R","V","ck","p?","!,","D-#"]
var r_2= undefined
try {
r_2 = base_2.map(argument4)
}
catch(e) {
r_2= "Error"
}
var base_3 = ["N","R","V","ck","p?","!,","D-#"]
var r_3= undefined
try {
r_3 = base_3.map(argument5)
}
catch(e) {
r_3= "Error"
}
function serialize(array){
return array.map(function(a){
if (a === null || a == undefined) return a;
var name = a.constructor.name;
if (name==='Object' || name=='Boolean'|| name=='Array'||name=='Number'||name=='String')
return JSON.stringify(a);
return name;
});
}
setTimeout(function(){
require("fs").writeFileSync("./experiments/map/mapGen/test572.json",JSON.stringify({"baseObjects":serialize([base_0,base_1,base_2,base_3]),"returnObjects":serialize([r_0,r_1,r_2,r_3]),"callbackArgs":callbackArguments}))
},300) | javascript |
Simon Doull has asked Pakistan to avoid playing veterans Shoaib Malik and Mohammad Hafeez together in the playing XI against India, calling them a "80-year-old running around in two bodies".
Simon Doull's remarks came on a chat show with Cricbuzz. While picking his preferred XI for Pakistan for the bumper clash, the former New Zealand pacer said he'll choose Hafeez and Haider Ali in the middle order. He suggested that Hafeez, 41, and Malik, 39, playing together will be detrimental to the team.
Simon Doull said:
"Babar and Mohammad Rizwan at the top; Fakhar Zaman at three; Hafeez and Haider Ali. I don't think they can play Hafeez and Shoaib Malik together. You don't need an 80-year-old running around in two people. That can't happen. I just I don't think they can play two 40-year-olds on the same team so I will go with Hafeez and Haidar Ali. [Then] Asif Ali, Imad Wasim definitely then Shadab, Hasan Ali, Haris Rauf and Shaheen Shah Afridi. "
Despite his age, Mohammad Hafeez has kept his Pakistan career on track on the backs of consistent performances in the middle order. Overall, he has played 113 T20Is, scoring 2429 runs at a strike rate of just under 121. Malik, meanwhile, hasn't been a part of the national team for the better part of the last two years. He has played 116 T20Is, scoring 2335 runs at a strike rate of 124.
Both spin-bowling all-rounders weren't part of the preliminary Pakistani squad for the T20 World Cup 2021, with the selectors going with younger batters.
They were only added to the team recently, apparently because of the pair's performances in the National T20 Cup. The sluggish pitches in the UAE also played a part in the decision, with the selectors finding value in their experience after observing IPL 2021.
Explaining his assessment of Malik and Hafeez, Simon Doull said he watched both of them during the Caribbean Premier League (CPL) and the former was "really bad". He said the duo struggles to get going early on in their innings, but Hafeez gets an edge over Malik just because he could still contribute with the ball.
Simon Doull said:
"I watched them both in the CPL and, I mean, I have got to say Shoaib Malik was really bad. Really bad. Eyes were gone, [he was] really struggling. I know he had one really good innings in the [National T20 cup] but I just watched him enough in the CPL to think I just couldn't have the two of them in the same team. They both struggle to get going early on so they have to make that choice. And because Hafeez can bowl a bit still, that's why I would go with him. "
The T20 World Cup 2021 match between India and Pakistan will begin at 7:30 PM IST in Dubai.
Poll : Pakistan to lose 2 or more wickets inside the powerplay? | english |
The Ministry of Consumer Affairs, Food and Public Distribution on Thursday said on Thursday it is keeping a close watch on fake reviews on e-Commerce platforms as it infringes on the rights of consumers.
The Ministry of Consumer Affairs, Food and Public Distribution on Thursday said on Thursday it is keeping a close watch on fake reviews on e-Commerce platforms as it infringes on the rights of consumers.
To gauge the magnitude of fake reviews on e-Commerce platforms that mislead consumers into buying online services or products and to prepare a roadmap ahead, the Department of Consumer Affairs (DoCA) in association with the Advertising Standards Council of India (ASCI) will be holding a virtual meeting on 27th May 2022 along with various stakeholders, the ministry said.
The discussions will be broadly based on the impact of fake and misleading reviews on consumers and possible measures to prevent such anomalies. In this regard, Secretary DoCA, Rohit Kumar Singh has written to all stakeholders: e-Commerce entities like Flipkart, Amazon, Tata Sons, Reliance Retail, and others besides, Consumer Forums, Law Universities, Lawyers, FICCI, CII, Consumer Rights Activists, etc to participate in the meeting.
In the letter, Singh referred to a report of the European Commission, highlighting the results of an EU-wide screening of online consumer reviews across 223 major websites.
The screening results underline that at least 55 per cent of the websites violate the unfair commercial Practices Directive of the EU which requires truthful information to be presented to consumers to make an informed choice. Further, in 144 out of the 223 websites checked, the authorities could not confirm that traders were doing enough to ensure that reviews were authentic, i. e. , if they were posted by consumers who had actually used the product or service that was reviewed.
"It is relevant to mention that with growing internet and smartphone use, consumers are increasingly shopping online to purchase goods and services. Given that e-Commerce involves a virtual shopping experience without any opportunity to physically view or examine the product, consumers heavily rely on reviews posted on e-commerce platforms to see the opinion and experiences of users who have already purchased the goods or service. As a result, due to fake and misleading reviews, the right to be informed, which is a consumer right under the Consumer Protection Act, 2019 is violated," Sing noted in the letter.
"Since the issue impacts people shopping online on a daily basis and has a significant impact on their rights as a consumer, it is important that it is examined with greater scrutiny and detail," the letter states.
( With inputs from ANI ) | english |
{
"vorgangId": "244748",
"VORGANG": {
"WAHLPERIODE": "19",
"VORGANGSTYP": "Mündliche Frage",
"TITEL": "Nominierung von <NAME> als Weltbankpräsidentschaftskandidat",
"AKTUELLER_STAND": "Beantwortet",
"SIGNATUR": "",
"GESTA_ORDNUNGSNUMMER": "",
"PLENUM": {
"PLPR_KLARTEXT": "Mündliche Frage/Schriftliche Antwort",
"PLPR_HERAUSGEBER": "BT",
"PLPR_NUMMER": "19/85",
"PLPR_SEITEN": "10030A - 10030B",
"PLPR_LINK": "http://dipbt.bundestag.de:80/dip21/btp/19/19085.pdf#P.10030"
},
"EU_DOK_NR": "",
"SCHLAGWORT": [
{
"_fundstelle": "true",
"__cdata": "Führungskraft"
},
{
"_fundstelle": "true",
"__cdata": "Internationale Bank für Wiederaufbau und Entwicklung"
},
"Wahl"
],
"ABSTRAKT": "Originaltext der Frage(n): \r\n \r\nWie positioniert sich die Bundesregierung zur Nominierung von <NAME> als Weltbankpräsidentschaftskandidat, und inwiefern plant die Bundesregierung, vor dem Hintergrund des Beschlusses des Aufsichtsrats vom 9. Januar 2019, „sicherzustellen, dass die neue Leitung der Bank fachlich qualifiziert ist und sich zur multilateralen Kooperation und zu den Zielen der Bank bekennt“ (Antwort der Bundesregierung auf meine Mündliche Frage 10, Plenarprotokoll 19/73), ein klares Bekenntnis von <NAME> zum Pariser Klimaabkommen und dem ab diesem Jahr geplanten Ausstieg der Weltbank aus der Finanzierung fossiler Energieprojekte – beides Ziele der Bank – (www.worldbank.org/en/news/press-release/2018/12/03/multilateral-development-banks-mdbs-announced-a-joint-framework-for-aligning-their-activities-with-the-goals-of-the-paris-agreement), zur Bedingung für ihre Zustimmung zu seiner Wahl zu machen?"
},
"VORGANGSABLAUF": {
"VORGANGSPOSITION": [
{
"ZUORDNUNG": "BT",
"URHEBER": "Mündliche Frage ",
"FUNDSTELLE": "07.03.2019 - BT-Drucksache 19/8181, Nr. 35",
"FUNDSTELLE_LINK": "http://dipbt.bundestag.de:80/dip21/btd/19/081/1908181.pdf"
},
{
"ZUORDNUNG": "BT",
"URHEBER": "Mündliche Frage/Schriftliche Antwort",
"FUNDSTELLE": "13.03.2019 - BT-Plenarprotokoll 19/85, S. 10030A - 10030B",
"FUNDSTELLE_LINK": "http://dipbt.bundestag.de:80/dip21/btp/19/19085.pdf#P.10030",
"PERSOENLICHER_URHEBER": [
{
"VORNAME": "Uwe",
"NACHNAME": "Kekeritz",
"FUNKTION": "MdB",
"FRAKTION": "BÜNDNIS 90/DIE GRÜNEN",
"AKTIVITAETSART": "Frage",
"SEITE": "10030A"
},
{
"VORNAME": "Norbert",
"NACHNAME": "Barthle",
"FUNKTION": "Parl. Staatssekr.",
"RESSORT": "Bundesministerium für wirtschaftliche Zusammenarbeit und Entwicklung",
"AKTIVITAETSART": "Antwort",
"SEITE": "10030A"
}
]
}
]
}
}
| json |
<reponame>sbworth/getnoc
{
"name": "<NAME>",
"$collection": "pm.measurementunits",
"uuid": "28b4f8c1-beed-4393-b0ea-168fc3d37d9f",
"code": "VDC",
"description": "Direct Current electric potential measurement",
"label": "VDC",
"dashboard_label": "volt",
"dashboard_sr_color": 14692164
}
| json |
<reponame>alexmiddeleer/buttle
module.exports = function(glob) {
'use strict';
if(!glob) {
return;
}
var Gaze = require('gaze')
, gaze = new Gaze(glob)
, changedFiles = []
, debounce = require('lodash.debounce')
, uniq = require('lodash.uniq')
, lr = require('tiny-lr')()
, yw = require('chalk').yellow
, gy = require('chalk').gray;
lr.listen(35729, function(err) {
if(err) { console.log(err); }
});
var reload = function(filepath) {
changedFiles.push(filepath);
live_reload();
};
var live_reload = debounce(function() {
lr.changed({body: {files: uniq(changedFiles)}});
changedFiles.length = 0;
}, 250);
gaze.on('all', function(evt, filepath) {
console.log(yw(evt.toUpperCase()) + ' ' + gy(filepath));
reload(filepath);
//lr.changed({body: {files: [filepath]}});
});
gaze.on('error', function(err) {
console.log('Boo! buttle hit a snag while watching your files.');
console.log(err.message);
});
};
| javascript |
<filename>composer.json
{
"name": "symbiote-library/silverstripe-misobyte-starter",
"description": "A minimal theme used for Symbiote projects.",
"type": "silverstripe-theme",
"keywords": ["silverstripe", "theme"],
"license": "BSD-3-Clause",
"authors": [
{
"name": "<NAME>",
"homepage": "http://www.symbiote.com.au"
}
],
"require": {
"composer/installers": "*",
"silverstripe/framework": "~3.2",
"symbiote-library/silverstripe-misobyte-theme": "~1.0"
},
"extra": {
"installer-name": "misobyte-starter",
"branch-alias": {
"dev-master": "1.0.x-dev"
}
}
}
| json |
{
"name": "handlebars-helpers",
"description": "120+ Handlebars helpers in ~20 categories, for Assemble, YUI, Ghost or any Handlebars project. Includes helpers like {{i18}}, {{markdown}}, {{relative}}, {{extend}}, {{moment}}, and so on.",
"version": "0.5.8",
"homepage": "https://github.com/assemble/handlebars-helpers",
"author": {
"name": "Assemble",
"url": "https://github.com/assemble/assemble/handlebars-helpers"
},
"contributors": [
{
"name": "<NAME>",
"url": "https://github.com/jonschlinkert"
},
{
"name": "<NAME>",
"url": "https://github.com/doowb"
}
],
"repository": {
"type": "git",
"url": "git://github.com/assemble/handlebars-helpers.git"
},
"bugs": {
"url": "https://github.com/assemble/handlebars-helpers/issues"
},
"licenses": [
{
"type": "MIT",
"url": "https://github.com/assemble/handlebars-helpers/blob/master/LICENSE-MIT"
}
],
"main": "index.js",
"engines": {
"node": ">= 0.10.0"
},
"scripts": {
"test": "grunt test"
},
"dependencies": {
"handlebars": "~1.3.0",
"highlight.js": "~7.4.0",
"iconv-lite": "~0.2.11",
"js-yaml": "~2.1.3",
"lodash": "~2.2.1",
"marked": "~0.2.10",
"matchdep": "~0.3.0",
"matchkeys": "~0.1.3",
"minimatch": "~0.2.12",
"nap": "~0.7.11",
"sort-object": "0.0.5",
"to": "~0.2.9"
},
"devDependencies": {
"chai": "~1.8.1",
"grunt": "~0.4.1",
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-compress": "~0.5.2",
"grunt-contrib-jshint": "~0.7.1",
"grunt-contrib-uglify": "~0.2.5",
"grunt-mocha-test": "~0.7.0",
"grunt-sync-pkg": "~0.1.1",
"grunt-verb": "~0.2.1",
"handlebars-helper-prettify": "~0.1.11",
"handlebars-helper-repeat": "~0.1.1",
"rimraf": "~2.2.4",
"should": "~2.0.2"
},
"keywords": [
"assemble helpers",
"block helper",
"code helpers",
"collections helpers",
"comparisons helpers",
"data helpers",
"dates helpers",
"example helper",
"files helpers",
"handle bars js",
"handlebar helper",
"handlebars block helper",
"handlebars custom helpers",
"handlebars escape",
"handlebars for loop",
"handlebars helper",
"handlebars helpers",
"handlebars if helper",
"handlebars list",
"handlebars loop index",
"handlebars loop",
"handlebars register helper",
"handlebars view helper",
"handlebars",
"handlebars-helper-prettify",
"handlebars-helper-repeat",
"helper library",
"helper",
"helpers",
"html helpers",
"i18n helpers",
"inflections helpers",
"logging helpers",
"loop handlebars",
"markdown helper",
"markdown helpers",
"math helpers",
"miscellaneous helpers",
"numbers helpers",
"path helpers",
"prettify helper",
"repeat helper",
"strings helpers",
"template helpers",
"url helpers"
],
"gitHead": "db48d65b38c5bea68eacce59a8cfc15ce2fce730",
"_id": "handlebars-helpers@0.5.8",
"_shasum": "fcca0368ddde97599138360688eba5a14cf0413a",
"_from": "handlebars-helpers@>=0.5.8 <0.6.0",
"_npmVersion": "1.4.14",
"_npmUser": {
"name": "doowb",
"email": "<EMAIL>"
},
"maintainers": [
{
"name": "jonschlinkert",
"email": "<EMAIL>"
},
{
"name": "doowb",
"email": "<EMAIL>"
}
],
"dist": {
"shasum": "fcca0368ddde97599138360688eba5a14cf0413a",
"tarball": "https://registry.npmjs.org/handlebars-helpers/-/handlebars-helpers-0.5.8.tgz"
},
"directories": {},
"_resolved": "https://registry.npmjs.org/handlebars-helpers/-/handlebars-helpers-0.5.8.tgz",
"readme": "ERROR: No README data found!"
}
| json |
The Catholic church in Madhya Pradesh alleged that Bharatiya Janata Party workers damaged a missionary hospital run by its administration and attacked its personnel, The Indian Express reported on Tuesday.
Ujjain’s BJP MP and party spokesperson Chintamani Malviya, however, claimed that the Pushpa Mission Hospital had encroached on private property owned by his family. The MP said the workers had demolished an unauthorised structure, but refuted allegations that they attacked the nurses.
The church’s public relations officer in Madhya Pradesh, Father Maria Stephen, alleged that a group of people, on March 12, tore down the hospital’s compound wall and gate, damaged a generator and disrupted power and water supply before putting up a metal fence within the hospital’s premises. The church also accused the local police of turning a blind eye to the incident.
A video of the purported incident surfaced on social media showing masked men demolishing the paved floor within the hospital compound.
The BJP legislator alleged that the church had lost the case in connection with the land in the High Court and lower courts, and that the owner had demolished the unauthorised construction after the district magistrate had demarcated the areas owned by both parties. Malviya accused the church of using its minority status to claim undue advantage.
He submitted a memorandum signed by his father against the hospital administration to Governor Anandiben Patel, while a delegation led by the Bishop of Ujjain met her to express their concern about the incident. The Archbishop of Bhopal, Leo Cornelio, also condemned the attack and described it as a “systematic planning to create disturbance and violence”.
| english |
<reponame>KTH-ID2212/exercise1
package se.kth.id2212.ex1.compute;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.OptionalDataException;
import java.net.Socket;
import java.net.UnknownHostException;
public class ComputeClient
{
public static void main(String[] args) throws IOException
{
Socket clientSocket = null;
try
{
clientSocket = new Socket(args[0], 4444);
} catch (UnknownHostException e)
{
System.err.println("Don't know about host: " + args[0] + ".");
System.exit(1);
} catch (IOException e)
{
System.err.println("Couldn't get I/O for " +
"the connection to: " + args[0] + "");
System.exit(1);
}
Spy spy = new Spy();
ObjectOutputStream out =
new ObjectOutputStream(clientSocket.getOutputStream());
out.writeObject(spy);
out.flush();
Object taskObj;
ObjectInputStream in =
new ObjectInputStream(clientSocket.getInputStream());
try
{
taskObj = in.readObject();
} catch (ClassNotFoundException cnfe)
{
System.out.println(cnfe.toString());
return;
} catch (OptionalDataException ode)
{
System.out.println(ode.toString());
return;
}
if (taskObj instanceof Spy)
{
spy = (Spy) taskObj;
for (String fileName : spy.getFileNames())
{
System.out.println(fileName);
}
}
out.close();
in.close();
clientSocket.close();
}
}
| java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.