text stringlengths 1 1.04M | language stringclasses 25 values |
|---|---|
I'm Monika and I love to read StoryMirror contents.
With the flash of the past in his eyes and watch in his hands, he slept that night with dejection.
The story shows the death of a daughter due to earthquake and mother living with her memories.
In the race of achieving dreams, your problems are mere hurdles.
In the race of achieving dreams, your problems are mere hurdles.
| english |
The offseason trade for Aaron Rodgers had the Jets thinking playoffs and beyond in 2023.
Rodgers’ Achilles injury four plays into the season crushed those expectations and now Gang Green has stretched its NFL-worst playoff drought to 13 seasons. The Jets will also finish with a losing record for the eighth straight season.
The devastating loss of Rodgers obviously set the team back, especially offensively. However, Gang Green has more problems than just an injured star quarterback and team brass has several significant holes to address before they start talking a playoff push in 2024.
For the second straight year, the Jets will enter the offseason needing to address their offensive line. In 2022, the Jets had 11 different players start games on their line. A year later, Gang Green was snake-bitten by injuries to Alijah Vera-Tucker (Achilles), Duane Brown (hip), Mekhi Becton (ankle) and Wes Schweitzer (calf) at various times during the season.
The situation became so dire that Xavier Newman-Johnson, who is traditionally a guard, had to play at center during the 13-10 overtime win against the Giants in October. This is among the many reasons the offensive line is the Jets’ No. 1 priority this offseason.
Rodgers is a 40-year-old quarterback coming off a serious injury and the Jets need to find a way to protect him. Their plan for doing that in ’23 was bringing back 38-year-old Duane Brown, coming off shoulder surgery, and Becton, who had suffered back-to-back knee injuries. The results were a very predictable disaster.
Both Brown and Becton will be free agents and the Jets will likely need to find two starting tackles. One of the solutions could be found in the 2024 NFL Draft, where the tackle class is expected to be one of the best in recent memory.
Notre Dame’s Joe Alt, Penn State’s Olu Fashanu, and Oregon State’s Taliese Fuaga are all potential first-round options for the Jets. Gang Green also could use better veteran depth in case of injury.
After trading for Rodgers, the Jets hoped that Zach Wilson wouldn’t have to play at all this season. But the Jets’ worst nightmare happened and Wilson once again became the team’s starting quarterback.
Clearly, this season hasn’t gone the way the Jets expected and there’s speculation the team will move on from Wilson during the offseason. The Jets must decide on the 2021 No. 2 overall pick’s fifth-year option by early May, which would be worth $23 million. Picking up the option is unlikely to happen, thus opening the door to trading or releasing Wilson.
Gang Green needs a better solution if Rodgers gets injured again and misses several games. A player like Titans quarterback Ryan Tannehill would make a lot of sense.
Tannehill has been a starter with both the Dolphins and Titans and could certainly fill in if needed. He will be a free agent and isn’t likely to get another starting quarterback job after he was benched for rookie Will Levis this season. With the Jets defense, which is one of the best in the NFL, a player like Tannehill would be good enough to keep them afloat should Rodgers miss games again.
Not only do the Jets need to sign a veteran quarterback, but they also need to develop one. Rodgers might play another season or two and having him groom a rookie isn’t the worst idea in the world.
Tulane’s Michael Pratt is a guy the Jets could potentially select in the third or fourth round. He has been the Green Wave’s starting quarterback for three seasons. He passed for 9,611 yards, 96 touchdowns and 26 interceptions in his career.
Other potential draft-eligible prospects include Florida State’s Jordan Travis, Georgia’s Carson Beck and Tennessee’s Joe Milton III.
The Jets thought they had addressed their No. 2 receiver issue when they signed Allen Lazard to a four-year, $44 million contract last March. But the signing proved to be one of the more disappointing of any team in the league last offseason.
Lazard suffered from drops, inconsistent play and penalties throughout the year. He was later made inactive for the Jets loss against the Dolphins on Black Friday, and when he did return his snaps decreased.
If the Jets have a top-five pick in the 2024 draft, they must consider selecting either Ohio State’s Marvin Harrison Jr. or LSU’s Malik Nabers. Harrison was arguably the best player in college football the last two seasons after registering 144 catches for 2,474 yards and 31 touchdowns during that span.
Nabers is considered the second-best receiver by draft experts. He finished with 86 receptions for 1,546 yards and 14 touchdowns for the Tigers this season.
If the Jets don’t go the rookie receiver route, expect them to pursue a top veteran like Raiders receiver Devante Adams. Gang Green inquired about reuniting Adams with Rodgers before last month’s trade deadline, but the Raiders declined.
If an Adams trade doesn’t happen, Buccaneers receiver Mike Evans could also be an option. He will be a free agent and is still considered one of the best receiving threats in the NFL.
| english |
Rockstar Games' latest GTA Plus will inevitably be a success, but that hasn't stopped some GTA Online fans from being disappointed with it. One of the main reasons is that it's yet another microtransaction introduced into the game (nearly a decade after the game was launched). It only costs $5. 99 a month, but some players are bound to dislike it.
Twitter is one of the most popular social media platforms around, especially since it's easy to see people talking about the new service there. Gamers tend to be more vocal about things they dislike, so there is no shortage of complaints about GTA Plus (or GTA Online in general).
Some fans have tried guilt-tripping others not to buy the new service. If the new subscription is successful, these types of gamers will likely dislike Rockstar's future business model even more than they do now.
However, one must wonder if GTA Online is genuinely at the end of its lifecycle. If that's the case, then GTA Plus could have some potential in extending it.
Many gamers have grown up living the Grand Theft Auto series and several of Rockstar's other projects. Naturally, a good number of them dislike Rockstar's latest business models. The above tweet is a good example of a devoted fan who is disappointed with the new service.
The most popular tweets regarding GTA Plus are often negative in nature. Not only that, but many of the lesser-liked tweets highlight various reasons why some gamers don't like it. The last tweet, in particular, is very interesting.
It features a popular Reddit post from the GTA Online subreddit, which is currently at 33. 1K upvotes with over 2,200 comments.
The service's unpopularity online isn't just related to criticism or disappointment. Several tweets received hundreds of likes for merely telling others not to buy this subscription. It's easy to interpret why a person says that, especially since most Twitter users have been slamming GTA Plus.
One reason fans want other players not to purchase this subscription is that if it's successful, it could lead to more microtransactions. Similarly, some gamers have expressed their concerns that it will only prolong GTA Online's life longer.
That wouldn't be a problem for fans of the game, but there have been some fan theories in the past that its success has delayed GTA 6.
A few fans also like to think back to the earlier days when GTA 5 first came out. GTA Online's balance wasn't as chaotic as it is now, and there was no such thing as GTA Plus. Of course, it is worth noting that the PS3 and Xbox 360 versions of GTA Online are offline now.
Still, many gamers have continued to become disillusioned with how the series has progressed in recent years. Some people found it funny when Rockstar Games parodied greed and laziness in other video game developers.
Funnily enough, fans see that Rockstar Games has become no better.
Poll : Do you like GTA+? | english |
A wide cross-section of Chinese society, from the ruling Communist Party’s leaders to scholars and activists pushing for political change, has mourned the passing of Nelson Mandela, an event which has triggered debate – and difficult questions – in China about the sensitive issue of political transitions and the role of dissidents in effecting change under authoritarian rule.
“Where is China’s Mandela” was, briefly, among the most discussed topics on a popular Twitter-like microblogging website, Tencent Weibo, before the thread appeared to be removed.
On Saturday morning, tributes, in the form of wreaths and bouquets, continued to come in outside the South African Embassy in Beijing. A young man in his twenties laid a bouquet in front of a banner of Mandela placed in front of the Embassy building, as he bowed three times to show his respect.
Chinese leaders and State media mourned the loss of “a world renowned statesman”. President Xi Jinping said he expressed “deep grief” as he saluted Mandela for his “arduous struggles to anti-apartheid victory”.
The Chinese people, he said, would “always remember Mandela’s extraordinary contributions” to both “the cause of human progress” and to South Africa’s ties with China, where Mandela visited twice. The Foreign Ministry described Mandela as “an old friend” of the Chinese people.
Qiao Mu, an outspoken academic and professor at Beijing Foreign Studies University, who has been an advocate for faster political reforms, said he was struck by the outpouring of messages condoling Mandela’s death across the spectrum of Chinese society.
“In China, when a foreign leader dies, usually there are different reactions from officials and ordinary people,” he said, citing the example of the death of North Korean leader Kim Jong-il, who was, also, hailed by the government as “an old friend”, even if there were less warm responses outside official circles. “But today,” he said, “when Mandela died, the whole country mourned for him”.
For him, the three striking aspects of Mandela’s political legacy were the transitions from “violent revolution to peaceful resistance”; from imprisonment to reconciliation; and from the office of President, which he gave up after one term “without reluctance”, to that of a citizen.
By Friday evening, there were more than 4. 4 lakh messages about Mandela on another Twitter-like website, Sina Weibo.
“Mandela’s braveness not only lies in his fighting, but also lies in his forgiveness,” wrote a blogger who uses the name Hanshuai0524. “South Africa is so lucky to have such a father of a nation”.
A few others wondered “if China’s Mandelas” – perhaps referring to activists and dissidents pushing for political change, such as the jailed writer and Nobel laureate Liu Xiaobo – were, like the great South African leader once was, being held in prison.
“It is not that we don't have a Chinese Mendela, it is just that they are all in prison,” wrote Ziwenfengyang, adding, in reference to apartheid-era South Africa’s last president who took the decision to release Mandela from prison and enable political change, “What we need is a de Klerk”. | english |
pub mod map_config;
pub mod map_file;
pub mod map_state;
pub mod map_system;
pub mod render;
pub mod state;
pub use self::map_config::MapConfig;
pub use self::map_config::MapFileConfig;
pub use self::map_file::MapFile;
pub use self::map_file::MapFileManager;
pub use self::map_state::MapState;
pub use self::map_system::MapSystem;
| rust |
<reponame>rickevry/mcw-ai-lab
{"Id":"495f01cf-b50f-44dc-aa31-0e4e207da2a8","Scope":"/subscriptions/ca0f0268-aa97-4e5c-a0ad-c55d1491f316/resourceGroups/mcw-ai-lab/providers/Microsoft.MachineLearningExperimentation/accounts/rickardnilssonAI/workspaces/RickardWorkspace/projects/mcw-ai-lab"} | json |
<reponame>venilnoronha/spring-cloud-aws<filename>spring-cloud-aws-context/src/test/java/org/springframework/cloud/aws/context/config/annotation/ContextRegionConfigurationRegistrarTest.java
/*
* Copyright 2013-2014 the original 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.springframework.cloud.aws.context.config.annotation;
import com.amazonaws.regions.Region;
import com.amazonaws.regions.Regions;
import org.junit.After;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.springframework.beans.factory.BeanCreationException;
import org.springframework.cloud.aws.core.region.Ec2MetadataRegionProvider;
import org.springframework.cloud.aws.core.region.StaticRegionProvider;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.springframework.core.env.MapPropertySource;
import java.util.Collections;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
public class ContextRegionConfigurationRegistrarTest {
@Rule
public ExpectedException expectedException = ExpectedException.none();
private AnnotationConfigApplicationContext context;
@After
public void tearDown() throws Exception {
if (this.context != null) {
this.context.close();
}
}
@Test
public void regionProvider_withConfiguredRegion_staticRegionProviderConfigured() throws Exception {
//Arrange
this.context = new AnnotationConfigApplicationContext(ApplicationConfigurationWithStaticRegionProvider.class);
//Act
StaticRegionProvider staticRegionProvider = this.context.getBean(StaticRegionProvider.class);
//Assert
assertNotNull(staticRegionProvider);
assertEquals(Region.getRegion(Regions.EU_WEST_1), staticRegionProvider.getRegion());
}
@Test
public void regionProvider_withAutoDetectedRegion_dynamicRegionProviderConfigured() throws Exception {
//Arrange
this.context = new AnnotationConfigApplicationContext(ApplicationConfigurationWithDynamicRegionProvider.class);
//Act
Ec2MetadataRegionProvider staticRegionProvider = this.context.getBean(Ec2MetadataRegionProvider.class);
//Assert
assertNotNull(staticRegionProvider);
}
@Test
public void regionProvider_withExpressionConfiguredRegion_staticRegionProviderConfigured() throws Exception {
//Arrange
this.context = new AnnotationConfigApplicationContext();
this.context.getEnvironment().getPropertySources().addLast(
new MapPropertySource("test", Collections.<String, Object>singletonMap("region", Regions.EU_WEST_1.getName())));
this.context.register(ApplicationConfigurationWithExpressionRegion.class);
// Act
this.context.refresh();
StaticRegionProvider staticRegionProvider = this.context.getBean(StaticRegionProvider.class);
//Assert
assertNotNull(staticRegionProvider);
assertEquals(Region.getRegion(Regions.EU_WEST_1), staticRegionProvider.getRegion());
}
@Test
public void regionProvider_withPlaceHolderConfiguredRegion_staticRegionProviderConfigured() throws Exception {
//Arrange
this.context = new AnnotationConfigApplicationContext();
this.context.getEnvironment().getPropertySources().addLast(
new MapPropertySource("test", Collections.<String, Object>singletonMap("region", Regions.EU_WEST_1.getName())));
this.context.register(ApplicationConfigurationWithPlaceHolderRegion.class);
// Act
this.context.refresh();
StaticRegionProvider staticRegionProvider = this.context.getBean(StaticRegionProvider.class);
//Assert
assertNotNull(staticRegionProvider);
assertEquals(Region.getRegion(Regions.EU_WEST_1), staticRegionProvider.getRegion());
}
@Test
public void regionProvider_withNoRegionAndNoAutoDetection_reportsError() throws Exception {
//Arrange
this.expectedException.expect(IllegalArgumentException.class);
this.expectedException.expectMessage("Region must be manually configured or autoDetect enabled");
this.context = new AnnotationConfigApplicationContext();
this.context.register(ApplicationConfigurationWithNoRegion.class);
// Act
this.context.refresh();
//Assert
}
@Test
public void regionProvider_withRegionAndAutoDetection_reportsError() throws Exception {
//Arrange
this.expectedException.expect(IllegalArgumentException.class);
this.expectedException.expectMessage("No region must be configured if autoDetect is defined as true");
this.context = new AnnotationConfigApplicationContext();
this.context.register(ApplicationConfigurationWithAutoDetectionAndRegion.class);
// Act
this.context.refresh();
//Assert
}
@Test
public void regionProvider_withConfiguredWrongRegion_reportsError() throws Exception {
//Arrange
this.expectedException.expect(BeanCreationException.class);
this.expectedException.expectMessage("not a valid region");
this.context = new AnnotationConfigApplicationContext(ApplicationConfigurationWithWrongRegion.class);
//Act
//Assert
}
@Configuration
@EnableContextRegion(region = "eu-west-1")
static class ApplicationConfigurationWithStaticRegionProvider {
}
@Configuration
@EnableContextRegion(autoDetect = true)
static class ApplicationConfigurationWithDynamicRegionProvider {
}
@Configuration
@EnableContextRegion(region = "#{environment.region}")
static class ApplicationConfigurationWithExpressionRegion {
}
@Configuration
@EnableContextRegion(region = "${region}")
static class ApplicationConfigurationWithPlaceHolderRegion {
@Bean
public static PropertySourcesPlaceholderConfigurer configurer() {
return new PropertySourcesPlaceholderConfigurer();
}
}
@Configuration
@EnableContextRegion
static class ApplicationConfigurationWithNoRegion {
}
@Configuration
@EnableContextRegion(autoDetect = true, region = "eu-west-1")
static class ApplicationConfigurationWithAutoDetectionAndRegion {
}
@Configuration
@EnableContextRegion(region = "eu-wast-1")
static class ApplicationConfigurationWithWrongRegion {
}
} | java |
<gh_stars>0
package report.reporter;
import de.vandermeer.asciitable.AsciiTable;
import de.vandermeer.asciithemes.u8.U8_Grids;
import de.vandermeer.skb.interfaces.transformers.textformat.TextAlignment;
import report.Result;
public class ConsoleReporter extends Reporter {
public ConsoleReporter(Result[] results) {
super(results);
}
/**
* The DataflowAnomalyAnalysis is suppressed here, because it's raised
* for the wrong reason. PMD thinks that the result variable inside the
* for loop is not initialized, which is the case indeed but it doesn't need to be.
*/
@Override
@SuppressWarnings("PMD.DataflowAnomalyAnalysis")
public void report() {
AsciiTable table = new AsciiTable();
table.addRow("Policy", "Requests", "Hit Rate",
"Hits", "Evictions", "Avg. Time per Request (millis)", "Operations");
table.addRule();
for (Result result: this.getResults()) {
table.addRow(
result.getPolicy(),
result.getNumberOfRequests(),
result.getHitRate(),
result.getNumberOfHits(),
result.getEvictions(),
result.getAverageProcessTimePerRequest(),
result.getNumberOfOperations());
table.addRule();
}
table.getContext().setGrid(U8_Grids.borderDouble());
table.setTextAlignment(TextAlignment.CENTER);
String renderedTable = table.render();
System.out.println(renderedTable);
}
}
| java |
Candidates will be able to apply online for the NDA 1 2024 exam from 20th December 2023. The last date to fill the NDA application form is 9th January 2024. Check the important details related to the NDA form here.
Union Public Service Commission (UPSC) will release NDA 1 application form 2024 on 20th December 2023 on upsc.gov.in. The candidates will be able to apply online for the NDA exam 2024 before the last date which is 9th January 2024. Both male and female candidates will be able to apply for the NDA exam provided they fulfil the age limit, educational qualification, and other requirements.
Filling up the NDA application form is done in two parts. The first part involves registration by filling up with the required details to receive the One-Time Registration Portal (OTRP). The second part involves filling up the details such as educational qualification, communication address, etc. Read this post further to learn about the NDA 1 application process, fee, documents to upload, etc.
NDA 1 application form 2024 link will be activated on 20th December 2023. The important dates associated with NDA exam are as follows:
The candidates will be able to apply online for the NDA 1 2024 exam from 20th December 2023 onwards on upsconline.nic.in/. Candidates must go through the NDA eligibility criteria before they proceed to fill the form. The online link for filling up the form will be closed on 9th January 2024. The direct link to apply for the exam shall be activated below as well.
Candidates must keep the following documents ready themselves while filling up the NDA application form. The list of details and documents required for NDA registration online is mentioned below.
Candidates can fill the NDA application form only through online mode only on the UPSC website. All the details must be filled in carefully to avoid rejection of the application form. The application form can be filled in two parts that are as follows:
NDA apply online part I registration is can be done in four simple steps that are as follows:
Check below the steps to fill Part I of the NDA application form:
Candidates have to enter their personal details, address, and educational qualifications. Candidates have to enter their complete address, email ID, and contact number.
Candidates are required to choose their branches, i.e. Indian Army, Air Force, and Navy. Candidates are also required to enter if they are students of Sanik/military school or son of JCO/NCO/other rank officer? Thereafter, click on the ‘Continue’ button and move to the next page.
The next step is to verify if all the details mentioned in it are correct. No correction can be made after the form has been submitted.
Once the registration has been made, the registration ID will be generated. The registration ID is also sent to the candidate’s registered email ID and contact number.
The NDA application form part 2 involves fee payment, exam centre selection, and uploading of documents. Check below for more details.
All the candidates have to pay the NDA application fee either through online mode of via SBI e challan mode. SC, ST, Sons of JCOs, NCOs, ORs, and Women candidates are exempted from fee payment while other candidates have to pay the application fee. The category-wise NDA application fee is given below in the table.
The candidates have to select the required NDA exam centre as per their suitability. They can choose any three centres at their convenience. Lakhs of candidates apply for the NDA exam as it is one of the most sought after defence exams in the country. Hence, the exam centre will be allotted on a first apply first allot basis. Hence, it is advisable to fill the NDA application form at the earliest to get the exam centre of their choice.
All the candidates have to upload scanned images of their photographs, signatures, and photo-identity card as per the specifications prescribed by the UPSC. The list of documents to upload with size specification are as follows:
Photo Identity Document (PID)
Once all the above details have been filled in the NDA application form, the candidates are required to tick the declaration. Lastly, one must take a print out of the online form by clicking on the View/Print button.
The UPSC allows the candidates to make corrections to the NDA application form. However, certain changes can only be made by the candidates in the application form. Candidates would need to login using their OTR and password to make corrections in the NDA form.
The UPSC conducts the NDA exam all over India in offline mode. The exam centres are allotted on a first-apply-first-allot basis. The list of test cities for NDA exam is given below:
Panaji (Goa)
Prayagraj (Allahabad)
Almora (Uttarakhand)
Anantpur (Andhra Pradesh)
Srinagar (Uttarakhand)
Kozhikode (Calicut)
| english |
package sample.spring.chapter06.bankapp;
import java.util.Date;
import java.util.Set;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import sample.spring.chapter06.bankapp.domain.FixedDepositDetails;
import sample.spring.chapter06.bankapp.service.AccountStatementService;
import sample.spring.chapter06.bankapp.service.CustomerRegistrationService;
import sample.spring.chapter06.bankapp.service.CustomerRequestService;
import sample.spring.chapter06.bankapp.service.FixedDepositService;
import sample.spring.chapter06.bankapp.service.MyService;
import sample.spring.chapter06.bankapp.service.Services;
import sample.spring.chapter06.bankapp.service.TxService;
public class BankApp {
private static Logger logger = LogManager.getLogger(BankApp.class);
public static void main(String args[]) throws Exception {
ConfigurableApplicationContext context = new ClassPathXmlApplicationContext(
"classpath:META-INF/spring/applicationContext.xml");
logger.info("----------> Beginning with accessing CustomerRequestService");
CustomerRequestService customerRequestService_1 = (CustomerRequestService) context
.getBean("customerRequestService");
customerRequestService_1.submitRequest("checkBookRequest", "Request to send a 50-leaf check book");
logger.info("----------> Done with accessing CustomerRequestService");
logger.info("----------> Beginning with accessing CustomerRegistrationService");
CustomerRegistrationService customerRegistrationService_1 = (CustomerRegistrationService) context
.getBean("customerRegistrationService");
customerRegistrationService_1.setAccountNumber("account_1");
customerRegistrationService_1.setAddress("address_1");
customerRegistrationService_1.setDebitCardNumber("debitCardNumber_1");
customerRegistrationService_1.register();
logger.info("----------> Done with accessing CustomerRegistrationService");
logger.info("----------> Beginning with accessing FixedDepositService");
FixedDepositService fixedDepositService = context.getBean(FixedDepositService.class);
fixedDepositService.createFixedDeposit(new FixedDepositDetails(1, 1000, 12, "<EMAIL>"));
logger.info("----------> Done with accessing FixedDepositService");
logger.info("----------> Beginning with accessing AccountStatementService");
try {
AccountStatementService accountStatementService = context.getBean(AccountStatementService.class);
accountStatementService.getAccountStatement(new Date(), new Date());
} catch (Exception e) {
logger.error("Exception : " + e.toString());
}
logger.info("----------> Done with accessing AccountStatementService");
logger.info("----------> Beginning with accessing TxService");
TxService txService = context.getBean(TxService.class);
logger.info("Transactions --> " + txService.getTransactions(1));
logger.info("----------> Done with accessing TxService");
Set<MyService> services = context.getBean(Services.class).getServices();
for(MyService service : services) {
logger.info("Service class --> " + service.getClass());
}
context.close();
}
}
| java |
<reponame>BIGWangYuDong/mmfewshot<gh_stars>100-1000
# Copyright (c) OpenMMLab. All rights reserved.
import os.path as osp
import pickle
import warnings
from typing import Dict, List, Optional, Sequence, Union
import mmcv
import numpy as np
from mmcls.datasets.builder import DATASETS
from typing_extensions import Literal
from .base import BaseFewShotDataset
TRAIN_CLASSES = [
('Yorkshire terrier', 'terrier'), ('space shuttle', 'craft'),
('drake', 'aquatic bird'),
("plane, carpenter's plane, woodworking plane", 'tool'),
('mosquito net', 'protective covering, protective cover, protect'),
('sax, saxophone', 'musical instrument, instrument'),
('container ship, containership, container vessel', 'craft'),
('patas, hussar monkey, Erythrocebus patas', 'primate'),
('cheetah, chetah, Acinonyx jubatus', 'feline, felid'),
('submarine, pigboat, sub, U-boat', 'craft'),
('prison, prison house', 'establishment'),
('can opener, tin opener', 'tool'), ('syringe', 'instrument'),
('odometer, hodometer, mileometer, milometer', 'instrument'),
('bassoon', 'musical instrument, instrument'),
('Kerry blue terrier', 'terrier'),
('scale, weighing machine', 'instrument'), ('baseball', 'game equipment'),
('cassette player', 'electronic equipment'),
('shield, buckler', 'protective covering, protective cover, protect'),
('goldfinch, Carduelis carduelis', 'passerine, passeriform bird'),
('cornet, horn, trumpet, trump', 'musical instrument, instrument'),
('flute, transverse flute', 'musical instrument, instrument'),
('stopwatch, stop watch', 'instrument'), ('basketball', 'game equipment'),
('brassiere, bra, bandeau', 'garment'),
('bulbul', 'passerine, passeriform bird'),
('steel drum', 'musical instrument, instrument'),
('bolo tie, bolo, bola tie, bola', 'garment'),
('planetarium', 'building, edifice'), ('stethoscope', 'instrument'),
('proboscis monkey, Nasalis larvatus', 'primate'),
('guillotine', 'instrument'),
('Scottish deerhound, deerhound', 'hound, hound dog'),
('ocarina, sweet potato', 'musical instrument, instrument'),
('Border terrier', 'terrier'),
('capuchin, ringtail, Cebus capucinus', 'primate'),
('magnetic compass', 'instrument'), ('alligator lizard', 'saurian'),
('baboon', 'primate'), ('sundial', 'instrument'),
('gibbon, Hylobates lar', 'primate'),
('grand piano, grand', 'musical instrument, instrument'),
('Arabian camel, dromedary, Camelus dromedarius',
'ungulate, hoofed mammal'), ('basset, basset hound', 'hound, hound dog'),
('corkscrew, bottle screw', 'tool'), ('miniskirt, mini', 'garment'),
('missile', 'instrument'), ('hatchet', 'tool'),
('acoustic guitar', 'musical instrument, instrument'),
('impala, Aepyceros melampus', 'ungulate, hoofed mammal'),
('parking meter', 'instrument'),
('greenhouse, nursery, glasshouse', 'building, edifice'),
('home theater, home theatre', 'building, edifice'),
('hartebeest', 'ungulate, hoofed mammal'),
('hippopotamus, hippo, river horse, Hippopotamus amphibius',
'ungulate, hoofed mammal'), ('warplane, military plane', 'craft'),
('albatross, mollymawk', 'aquatic bird'),
('umbrella', 'protective covering, protective cover, protect'),
('shoe shop, shoe-shop, shoe store', 'establishment'),
('suit, suit of clothes', 'garment'),
('pickelhaube', 'protective covering, protective cover, protect'),
('soccer ball', 'game equipment'), ('yawl', 'craft'),
('screwdriver', 'tool'),
('Madagascar cat, ring-tailed lemur, Lemur catta', 'primate'),
('garter snake, grass snake', 'snake, serpent, ophidian'),
('bustard', 'aquatic bird'), ('tabby, tabby cat', 'feline, felid'),
('airliner', 'craft'),
('tobacco shop, tobacconist shop, tobacconist', 'establishment'),
('Italian greyhound', 'hound, hound dog'), ('projector', 'instrument'),
('bittern', 'aquatic bird'), ('rifle', 'instrument'),
('pay-phone, pay-station', 'electronic equipment'),
('house finch, linnet, Carpodacus mexicanus',
'passerine, passeriform bird'), ('monastery', 'building, edifice'),
('lens cap, lens cover', 'protective covering, protective cover, protect'),
('maillot, tank suit', 'garment'), ('canoe', 'craft'),
('letter opener, paper knife, paperknife', 'tool'),
('nail', 'restraint, constraint'), ('guenon, guenon monkey', 'primate'),
('CD player', 'electronic equipment'),
('safety pin', 'restraint, constraint'),
('harp', 'musical instrument, instrument'),
('disk brake, disc brake', 'restraint, constraint'),
('otterhound, otter hound', 'hound, hound dog'),
('green mamba', 'snake, serpent, ophidian'),
('violin, fiddle', 'musical instrument, instrument'),
('American coot, marsh hen, mud hen, water hen, Fulica americana',
'aquatic bird'), ('ram, tup', 'ungulate, hoofed mammal'),
('jay', 'passerine, passeriform bird'), ('trench coat', 'garment'),
('Indian cobra, Naja naja', 'snake, serpent, ophidian'),
('projectile, missile', 'instrument'), ('schooner', 'craft'),
('magpie', 'passerine, passeriform bird'), ('Norwich terrier', 'terrier'),
('cairn, cairn terrier', 'terrier'),
('crossword puzzle, crossword', 'game equipment'),
('snow leopard, ounce, Panthera uncia', 'feline, felid'),
('gong, tam-tam', 'musical instrument, instrument'),
('library', 'building, edifice'),
('swimming trunks, bathing trunks', 'garment'),
('Staffordshire bullterrier, Staffordshire bull terrier', 'terrier'),
('Lakeland terrier', 'terrier'),
('black stork, Ciconia nigra', 'aquatic bird'),
('king penguin, Aptenodytes patagonica', 'aquatic bird'),
('water ouzel, dipper', 'passerine, passeriform bird'),
('macaque', 'primate'), ('lynx, catamount', 'feline, felid'),
('ping-pong ball', 'game equipment'), ('standard schnauzer', 'terrier'),
('Australian terrier', 'terrier'), ('stupa, tope', 'building, edifice'),
('white stork, Ciconia ciconia', 'aquatic bird'),
('king snake, kingsnake', 'snake, serpent, ophidian'),
('Airedale, Airedale terrier', 'terrier'),
('banjo', 'musical instrument, instrument'), ('Windsor tie', 'garment'),
('abaya', 'garment'), ('stole', 'garment'),
('vine snake', 'snake, serpent, ophidian'),
('Bedlington terrier', 'terrier'), ('langur', 'primate'),
('catamaran', 'craft'), ('sarong', 'garment'),
('spoonbill', 'aquatic bird'),
('boa constrictor, Constrictor constrictor', 'snake, serpent, ophidian'),
('ruddy turnstone, Arenaria interpres', 'aquatic bird'),
('hognose snake, puff adder, sand viper', 'snake, serpent, ophidian'),
('American chameleon, anole, Anolis carolinensis', 'saurian'),
('rugby ball', 'game equipment'),
('black swan, Cygnus atratus', 'aquatic bird'),
('frilled lizard, Chlamydosaurus kingi', 'saurian'),
('oscilloscope, scope, cathode-ray oscilloscope, CRO',
'electronic equipment'),
('ski mask', 'protective covering, protective cover, protect'),
('marmoset', 'primate'),
('Komodo dragon, Komodo lizard, dragon lizard, giant lizard, '
'Varanus komodoensis', 'saurian'),
('accordion, piano accordion, squeeze box',
'musical instrument, instrument'),
('horned viper, cerastes, sand viper, horned asp, Cerastes cornutus',
'snake, serpent, ophidian'),
('bookshop, bookstore, bookstall', 'establishment'),
('Boston bull, Boston terrier', 'terrier'), ('crane', 'aquatic bird'),
('junco, snowbird', 'passerine, passeriform bird'),
('silky terrier, Sydney silky', 'terrier'),
('Egyptian cat', 'feline, felid'), ('Irish terrier', 'terrier'),
('leopard, Panthera pardus', 'feline, felid'),
('sea snake', 'snake, serpent, ophidian'),
('hog, pig, grunter, squealer, Sus scrofa', 'ungulate, hoofed mammal'),
('colobus, colobus monkey', 'primate'),
('chickadee', 'passerine, passeriform bird'),
('Scotch terrier, Scottish terrier, Scottie', 'terrier'),
('digital watch', 'instrument'), ('analog clock', 'instrument'),
('zebra', 'ungulate, hoofed mammal'),
('American Staffordshire terrier, Staffordshire terrier, '
'American pit bull terrier, pit bull terrier', 'terrier'),
('European gallinule, Porphyrio porphyrio', 'aquatic bird'),
('lampshade, lamp shade',
'protective covering, protective cover, protect'),
('holster', 'protective covering, protective cover, protect'),
('jaguar, panther, Panthera onca, Felis onca', 'feline, felid'),
('cleaver, meat cleaver, chopper', 'tool'),
('brambling, Fringilla montifringilla', 'passerine, passeriform bird'),
('orangutan, orang, orangutang, Pongo pygmaeus', 'primate'),
('combination lock', 'restraint, constraint'),
('tile roof', 'protective covering, protective cover, protect'),
('borzoi, Russian wolfhound', 'hound, hound dog'),
('water snake', 'snake, serpent, ophidian'),
('knot', 'restraint, constraint'),
('window shade', 'protective covering, protective cover, protect'),
('mosque', 'building, edifice'),
('Walker hound, Walker foxhound', 'hound, hound dog'),
('cardigan', 'garment'), ('warthog', 'ungulate, hoofed mammal'),
('whiptail, whiptail lizard', 'saurian'), ('plow, plough', 'tool'),
('bluetick', 'hound, hound dog'), ('poncho', 'garment'),
('shovel', 'tool'),
('sidewinder, horned rattlesnake, Crotalus cerastes',
'snake, serpent, ophidian'), ('croquet ball', 'game equipment'),
('sorrel', 'ungulate, hoofed mammal'), ('airship, dirigible', 'craft'),
('goose', 'aquatic bird'), ('church, church building',
'building, edifice'),
('titi, titi monkey', 'primate'),
('butcher shop, meat market', 'establishment'),
('diamondback, diamondback rattlesnake, Crotalus adamanteus',
'snake, serpent, ophidian'),
('common iguana, iguana, Iguana iguana', 'saurian'),
('Saluki, gazelle hound', 'hound, hound dog'),
('monitor', 'electronic equipment'),
('sunglasses, dark glasses, shades', 'instrument'),
('flamingo', 'aquatic bird'),
('seat belt, seatbelt', 'restraint, constraint'),
('Persian cat', 'feline, felid'), ('gorilla, Gorilla gorilla', 'primate'),
('banded gecko', 'saurian'),
('thatch, thatched roof',
'protective covering, protective cover, protect'),
('beagle', 'hound, hound dog'), ('limpkin, Aramus pictus', 'aquatic bird'),
('jigsaw puzzle', 'game equipment'), ('rule, ruler', 'instrument'),
('hammer', 'tool'), ('cello, violoncello',
'musical instrument, instrument'),
('lab coat, laboratory coat', 'garment'),
('indri, indris, Indri indri, Indri brevicaudatus', 'primate'),
('vault', 'protective covering, protective cover, protect'),
('cellular telephone, cellular phone, cellphone, cell, mobile phone',
'electronic equipment'), ('whippet', 'hound, hound dog'),
('siamang, Hylobates syndactylus, Symphalangus syndactylus', 'primate'),
("loupe, jeweler's loupe", 'instrument'), ('modem',
'electronic equipment'),
('lifeboat', 'craft'),
('dial telephone, dial phone', 'electronic equipment'),
('cougar, puma, catamount, mountain lion, painter, panther, '
'Felis concolor', 'feline, felid'),
('thimble', 'protective covering, protective cover, protect'),
('ibex, Capra ibex', 'ungulate, hoofed mammal'),
('lawn mower, mower', 'tool'),
('bell cote, bell cot', 'protective covering, protective cover, protect'),
('chain mail, ring mail, mail, chain armor, chain armour, ring armor, '
'ring armour', 'protective covering, protective cover, protect'),
('hair slide', 'restraint, constraint'),
('apiary, bee house', 'building, edifice'),
('harmonica, mouth organ, harp, mouth harp',
'musical instrument, instrument'),
('green snake, grass snake', 'snake, serpent, ophidian'),
('howler monkey, howler', 'primate'), ('digital clock', 'instrument'),
('restaurant, eating house, eating place, eatery', 'building, edifice'),
('miniature schnauzer', 'terrier'),
('panpipe, pandean pipe, syrinx', 'musical instrument, instrument'),
('pirate, pirate ship', 'craft'),
('window screen', 'protective covering, protective cover, protect'),
('binoculars, field glasses, opera glasses', 'instrument'),
('Afghan hound, Afghan', 'hound, hound dog'),
('cinema, movie theater, movie theatre, movie house, picture palace',
'building, edifice'), ('liner, ocean liner', 'craft'),
('ringneck snake, ring-necked snake, ring snake',
'snake, serpent, ophidian'), ('redshank, Tringa totanus', 'aquatic bird'),
('Siamese cat, Siamese', 'feline, felid'),
('thunder snake, worm snake, Carphophis amoenus',
'snake, serpent, ophidian'), ('boathouse', 'building, edifice'),
('jersey, T-shirt, tee shirt', 'garment'),
('soft-coated wheaten terrier', 'terrier'),
('scabbard', 'protective covering, protective cover, protect'),
('muzzle', 'restraint, constraint'),
('Ibizan hound, Ibizan Podenco', 'hound, hound dog'),
('tennis ball', 'game equipment'), ('padlock', 'restraint, constraint'),
('kimono', 'garment'), ('redbone', 'hound, hound dog'),
('wild boar, boar, Sus scrofa', 'ungulate, hoofed mammal'),
('dowitcher', 'aquatic bird'),
('oboe, hautboy, hautbois', 'musical instrument, instrument'),
('electric guitar', 'musical instrument, instrument'), ('trimaran',
'craft'),
('barometer', 'instrument'), ('llama', 'ungulate, hoofed mammal'),
('robin, American robin, Turdus migratorius',
'passerine, passeriform bird'),
('maraca', 'musical instrument, instrument'),
('feather boa, boa', 'garment'),
('<NAME>, <NAME> terrier', 'terrier'),
('Lhasa, Lhasa apso', 'terrier'), ('bow', 'instrument'),
('punching bag, punch bag, punching ball, punchball', 'game equipment'),
('volleyball', 'game equipment'), ('Norfolk terrier', 'terrier'),
('Gila monster, Heloderma suspectum', 'saurian'),
('fire screen, fireguard',
'protective covering, protective cover, protect'),
('hourglass', 'instrument'),
('chimpanzee, chimp, Pan troglodytes', 'primate'),
('birdhouse', 'protective covering, protective cover, protect'),
('Sealyham terrier, Sealyham', 'terrier'),
('Tibetan terrier, chrysanthemum dog', 'terrier'),
('palace', 'building, edifice'), ('wreck', 'craft'),
('overskirt', 'garment'), ('pelican', 'aquatic bird'),
('French horn, horn', 'musical instrument, instrument'),
('tiger cat', 'feline, felid'), ('barbershop', 'establishment'),
('revolver, six-gun, six-shooter', 'instrument'),
('Irish wolfhound', 'hound, hound dog'),
('lion, king of beasts, Panthera leo', 'feline, felid'),
('fur coat', 'garment'), ('ox', 'ungulate, hoofed mammal'),
('cuirass', 'protective covering, protective cover, protect'),
('grocery store, grocery, food market, market', 'establishment'),
('hoopskirt, crinoline', 'garment'),
('spider monkey, Ateles geoffroyi', 'primate'),
('tiger, Panthera tigris', 'feline, felid'),
('bloodhound, sleuthhound', 'hound, hound dog'),
('red-backed sandpiper, dunlin, Erolia alpina', 'aquatic bird'),
('drum, membranophone, tympan', 'musical instrument, instrument'),
('radio telescope, radio reflector', 'instrument'),
('West Highland white terrier', 'terrier'),
('bow tie, bow-tie, bowtie', 'garment'), ('golf ball', 'game equipment'),
('barn', 'building, edifice'),
('binder, ring-binder', 'protective covering, protective cover, protect'),
('English foxhound', 'hound, hound dog'),
('bison', 'ungulate, hoofed mammal'), ('screw', 'restraint, constraint'),
('assault rifle, assault gun', 'instrument'),
('diaper, nappy, napkin', 'garment'),
('bighorn, bighorn sheep, cimarron, Rocky Mountain bighorn, '
'Rocky Mountain sheep, Ovis canadensis', 'ungulate, hoofed mammal'),
('Weimaraner', 'hound, hound dog'),
('computer keyboard, keypad', 'electronic equipment'),
('black-and-tan coonhound', 'hound, hound dog'),
('little blue heron, Egretta caerulea', 'aquatic bird'),
('breastplate, aegis, egis',
'protective covering, protective cover, protect'),
('gasmask, respirator, gas helmet',
'protective covering, protective cover, protect'),
('aircraft carrier, carrier, flattop, attack aircraft carrier', 'craft'),
('iPod', 'electronic equipment'),
('organ, pipe organ', 'musical instrument, instrument'),
('wall clock', 'instrument'),
('rock python, rock snake, Python sebae', 'snake, serpent, ophidian'),
('squirrel monkey, Saimiri sciureus', 'primate'),
('bikini, two-piece', 'garment'),
('water buffalo, water ox, Asiatic buffalo, Bubalus bubalis',
'ungulate, hoofed mammal'),
('upright, upright piano', 'musical instrument, instrument'),
('chime, bell, gong', 'musical instrument, instrument'),
('confectionery, confectionary, candy store', 'establishment'),
('indigo bunting, indigo finch, indigo bird, Passerina cyanea',
'passerine, passeriform bird'),
('green lizard, Lacerta viridis', 'saurian'),
('Norwegian elkhound, elkhound', 'hound, hound dog'),
('dome', 'protective covering, protective cover, protect'),
('buckle', 'restraint, constraint'), ('giant schnauzer', 'terrier'),
('jean, blue jean, denim', 'garment'),
('wire-haired fox terrier', 'terrier'),
('African chameleon, Chamaeleo chamaeleon', 'saurian'),
('trombone', 'musical instrument, instrument'),
('oystercatcher, oyster catcher', 'aquatic bird'), ('sweatshirt',
'garment'),
('American egret, great white heron, Egretta albus', 'aquatic bird'),
('marimba, xylophone', 'musical instrument, instrument'),
('gazelle', 'ungulate, hoofed mammal'),
('red-breasted merganser, Mergus serrator', 'aquatic bird'),
('tape player', 'electronic equipment'), ('speedboat', 'craft'),
('gondola', 'craft'),
('night snake, Hypsiglena torquata', 'snake, serpent, ophidian'),
('cannon', 'instrument'), ("plunger, plumber's helper", 'tool'),
('balloon', 'craft'), ('toyshop', 'establishment'), ('agama', 'saurian'),
('fireboat', 'craft'), ('bakery, bakeshop, bakehouse', 'establishment')
]
VAL_CLASSES = [
('cab, hack, taxi, taxicab', 'motor vehicle, automotive vehicle'),
('jeep, landrover', 'motor vehicle, automotive vehicle'),
('English setter', 'sporting dog, gun dog'),
('flat-coated retriever', 'sporting dog, gun dog'),
('bassinet', 'furnishing'),
('sports car, sport car', 'motor vehicle, automotive vehicle'),
('golfcart, golf cart', 'motor vehicle, automotive vehicle'),
('clumber, clumber spaniel', 'sporting dog, gun dog'),
('puck, hockey puck', 'mechanism'), ('reel', 'mechanism'),
('Welsh springer spaniel', 'sporting dog, gun dog'),
('car wheel', 'mechanism'), ('wardrobe, closet, press', 'furnishing'),
('go-kart', 'motor vehicle, automotive vehicle'),
('switch, electric switch, electrical switch', 'mechanism'),
('crib, cot', 'furnishing'), ('laptop, laptop computer', 'machine'),
('thresher, thrasher, threshing machine', 'machine'),
('web site, website, internet site, site', 'machine'),
('English springer, English springer spaniel', 'sporting dog, gun dog'),
('iron, smoothing iron', 'durables, durable goods, consumer durables'),
('<NAME>', 'sporting dog, gun dog'),
('Labrador retriever', 'sporting dog, gun dog'),
('<NAME>', 'sporting dog, gun dog'),
('amphibian, amphibious vehicle', 'motor vehicle, automotive vehicle'),
('file, file cabinet, filing cabinet', 'furnishing'),
('harvester, reaper', 'machine'),
('convertible', 'motor vehicle, automotive vehicle'),
('paddlewheel, paddle wheel', 'mechanism'),
('microwave, microwave oven',
'durables, durable goods, consumer durables'), ('swing', 'mechanism'),
('chiffonier, commode', 'furnishing'), ('desktop computer', 'machine'),
('gas pump, gasoline pump, petrol pump, island dispenser', 'mechanism'),
('beach wagon, station wagon, wagon, estate car, beach waggon, station '
'waggon, waggon', 'motor vehicle, automotive vehicle'),
('carousel, carrousel, merry-go-round, roundabout, whirligig',
'mechanism'), ("potter's wheel", 'mechanism'),
('folding chair', 'furnishing'),
('fire engine, fire truck', 'motor vehicle, automotive vehicle'),
('slide rule, slipstick', 'machine'),
('vizsla, Hungarian pointer', 'sporting dog, gun dog'),
('waffle iron', 'durables, durable goods, consumer durables'),
('trailer truck, tractor trailer, trucking rig, rig, articulated lorry, '
'semi', 'motor vehicle, automotive vehicle'),
('toilet seat', 'furnishing'),
('medicine chest, medicine cabinet', 'furnishing'),
('<NAME>', 'sporting dog, gun dog'),
('Chesapeake Bay retriever', 'sporting dog, gun dog'),
('cash machine, cash dispenser, automated teller machine, automatic '
'teller machine, automated teller, automatic teller, ATM', 'machine'),
('moped', 'motor vehicle, automotive vehicle'),
('Model T', 'motor vehicle, automotive vehicle'),
('bookcase', 'furnishing'),
('ambulance', 'motor vehicle, automotive vehicle'),
('German short-haired pointer', 'sporting dog, gun dog'),
('dining table, board', 'furnishing'),
('minivan', 'motor vehicle, automotive vehicle'),
('police van, police wagon, paddy wagon, patrol wagon, wagon, '
'black Maria', 'motor vehicle, automotive vehicle'),
('entertainment center', 'furnishing'), ('throne', 'furnishing'),
('desk', 'furnishing'), ('notebook, notebook computer', 'machine'),
('snowplow, snowplough', 'motor vehicle, automotive vehicle'),
('cradle', 'furnishing'), ('abacus', 'machine'),
('hand-held computer, hand-held microcomputer', 'machine'),
('Dutch oven', 'durables, durable goods, consumer durables'),
('toaster', 'durables, durable goods, consumer durables'),
('barber chair', 'furnishing'), ('vending machine', 'machine'),
('four-poster', 'furnishing'),
('rotisserie', 'durables, durable goods, consumer durables'),
('hook, claw', 'mechanism'),
('vacuum, vacuum cleaner', 'durables, durable goods, consumer durables'),
('pickup, pickup truck', 'motor vehicle, automotive vehicle'),
('table lamp', 'furnishing'), ('rocking chair, rocker', 'furnishing'),
('prayer rug, prayer mat', 'furnishing'),
('moving van', 'motor vehicle, automotive vehicle'),
('studio couch, day bed', 'furnishing'),
('racer, race car, racing car', 'motor vehicle, automotive vehicle'),
('park bench', 'furnishing'),
('Irish setter, red setter', 'sporting dog, gun dog'),
('refrigerator, icebox', 'durables, durable goods, consumer durables'),
('china cabinet, china closet', 'furnishing'),
('cocker spaniel, English cocker spaniel, cocker',
'sporting dog, gun dog'), ('radiator', 'mechanism'),
('Sussex spaniel', 'sporting dog, gun dog'),
('hand blower, blow dryer, blow drier, hair dryer, hair drier',
'durables, durable goods, consumer durables'),
('slot, one-armed bandit', 'machine'),
('golden retriever', 'sporting dog, gun dog'),
('curly-coated retriever', 'sporting dog, gun dog'),
('limousine, limo', 'motor vehicle, automotive vehicle'),
('washer, automatic washer, washing machine',
'durables, durable goods, consumer durables'),
('garbage truck, dustcart', 'motor vehicle, automotive vehicle'),
('dishwasher, dish washer, dishwashing machine',
'durables, durable goods, consumer durables'), ('pinwheel', 'mechanism'),
('espresso maker', 'durables, durable goods, consumer durables'),
('tow truck, tow car, wrecker', 'motor vehicle, automotive vehicle')
]
TEST_CLASSES = [
('Siberian husky', 'working dog'), ('dung beetle', 'insect'),
('jackfruit, jak, jack', 'solid'), ('miniature pinscher', 'working dog'),
('tiger shark, Galeocerdo cuvieri', 'aquatic vertebrate'),
('weevil', 'insect'),
('goldfish, Carassius auratus', 'aquatic vertebrate'),
('schipperke', 'working dog'), ('Tibetan mastiff', 'working dog'),
('orange', 'solid'), ('whiskey jug', 'vessel'),
('hammerhead, hammerhead shark', 'aquatic vertebrate'),
('bull mastiff', 'working dog'), ('eggnog', 'substance'),
('bee', 'insect'), ('tench, Tinca tinca', 'aquatic vertebrate'),
('chocolate sauce, chocolate syrup', 'substance'),
("dragonfly, darning needle, devil's darning needle, sewing needle, "
'snake feeder, snake doctor, mosquito hawk, skeeter hawk', 'insect'),
('zucchini, courgette', 'solid'), ('kelpie', 'working dog'),
('stone wall', 'obstruction, obstructor, obstructer, impedimen'),
('butternut squash', 'solid'), ('mushroom', 'solid'),
('Old English sheepdog, bobtail', 'working dog'),
('dam, dike, dyke', 'obstruction, obstructor, obstructer, impedimen'),
('picket fence, paling', 'obstruction, obstructor, obstructer, impedimen'),
('espresso', 'substance'), ('beer bottle', 'vessel'),
('plate', 'substance'), ('dough', 'substance'),
('sandbar, sand bar', 'geological formation, formation'),
('boxer', 'working dog'), ('bathtub, bathing tub, bath, tub', 'vessel'),
('beaker', 'vessel'), ('bucket, pail', 'vessel'),
('Border collie', 'working dog'), ('sturgeon', 'aquatic vertebrate'),
('worm fence, snake fence, snake-rail fence, Virginia fence',
'obstruction, obstructor, obstructer, impedimen'),
('seashore, coast, seacoast, sea-coast',
'geological formation, formation'),
('long-horned beetle, longicorn, longicorn beetle', 'insect'),
('turnstile', 'obstruction, obstructor, obstructer, impedimen'),
('groenendael', 'working dog'), ('vase', 'vessel'), ('teapot', 'vessel'),
('water tower', 'vessel'), ('strawberry', 'solid'), ('burrito',
'substance'),
('cauliflower', 'solid'), ('volcano', 'geological formation, formation'),
('valley, vale', 'geological formation, formation'),
('head cabbage', 'solid'), ('tub, vat', 'vessel'),
('lacewing, lacewing fly', 'insect'),
('coral reef', 'geological formation, formation'),
('hot pot, hotpot', 'substance'), ('custard apple', 'solid'),
('monarch, monarch butterfly, milkweed butterfly, Danaus plexippus',
'insect'), ('cricket', 'insect'), ('pill bottle', 'vessel'),
('walking stick, walkingstick, stick insect', 'insect'),
('promontory, headland, head, foreland',
'geological formation, formation'), ('malinois', 'working dog'),
('pizza, pizza pie', 'substance'),
('malamute, malemute, Alaskan malamute', 'working dog'),
('kuvasz', 'working dog'), ('trifle', 'substance'), ('fig', 'solid'),
('komondor', 'working dog'), ('ant, emmet, pismire', 'insect'),
('electric ray, crampfish, numbfish, torpedo', 'aquatic vertebrate'),
('<NAME>', 'solid'), ('cockroach, roach', 'insect'),
('stingray', 'aquatic vertebrate'), ('red wine', 'substance'),
('<NAME>, <NAME>', 'working dog'),
('ice lolly, lolly, lollipop, popsicle', 'substance'),
('bell pepper', 'solid'), ('cup', 'substance'), ('pomegranate', 'solid'),
('Appenzeller', 'working dog'), ('hay', 'substance'),
('EntleBucher', 'working dog'),
('sulphur butterfly, sulfur butterfly', 'insect'),
('mantis, mantid', 'insect'), ('Bernese mountain dog', 'working dog'),
('banana', 'solid'), ('water jug', 'vessel'), ('cicada, cicala', 'insect'),
('barracouta, snoek', 'aquatic vertebrate'),
('washbasin, handbasin, washbowl, lavabo, wash-hand basin', 'vessel'),
('wine bottle', 'vessel'), ('Rottweiler', 'working dog'),
('briard', 'working dog'),
('puffer, pufferfish, blowfish, globefish', 'aquatic vertebrate'),
('ground beetle, carabid beetle', 'insect'),
('Bouvier des Flandres, Bouviers des Flandres', 'working dog'),
('chainlink fence', 'obstruction, obstructor, obstructer, impedimen'),
('damselfly', 'insect'), ('grasshopper, hopper', 'insect'),
('carbonara', 'substance'),
('German shepherd, German shepherd dog, German police dog, alsatian',
'working dog'), ('guacamole', 'substance'),
('leaf beetle, chrysomelid', 'insect'), ('caldron, cauldron', 'vessel'),
('fly', 'insect'),
('bannister, banister, balustrade, balusters, handrail',
'obstruction, obstructor, obstructer, impedimen'),
('spaghetti squash', 'solid'), ('coffee mug', 'vessel'),
('gar, garfish, garpike, billfish, Lepisosteus osseus',
'aquatic vertebrate'), ('barrel, cask', 'vessel'),
('eel', 'aquatic vertebrate'), ('rain barrel', 'vessel'),
('coho, cohoe, coho salmon, blue jack, silver salmon, '
'Oncorhynchus kisutch', 'aquatic vertebrate'), ('water bottle', 'vessel'),
('menu', 'substance'), ('tiger beetle', 'insect'),
('Great Dane', 'working dog'),
('rock beauty, Holocanthus tricolor', 'aquatic vertebrate'),
('anemone fish', 'aquatic vertebrate'), ('mortar', 'vessel'),
('Eskimo dog, husky', 'working dog'),
('affenpinscher, monkey pinscher, monkey dog', 'working dog'),
('breakwater, groin, groyne, mole, bulwark, seawall, jetty',
'obstruction, obstructor, obstructer, impedimen'),
('artichoke, globe artichoke', 'solid'), ('broccoli', 'solid'),
('French bulldog', 'working dog'), ('coffeepot', 'vessel'),
('cliff, drop, drop-off', 'geological formation, formation'),
('ladle', 'vessel'),
('sliding door', 'obstruction, obstructor, obstructer, impedimen'),
('leafhopper', 'insect'), ('collie', 'working dog'),
('Doberman, <NAME>', 'working dog'), ('pitcher, ewer',
'vessel'),
('admiral', 'insect'), ('cabbage butterfly', 'insect'),
('geyser', 'geological formation, formation'), ('cheeseburger',
'substance'),
('grille, radiator grille',
'obstruction, obstructor, obstructer, impedimen'),
('ladybug, ladybeetle, lady beetle, ladybird, ladybird beetle', 'insect'),
('great white shark, white shark, man-eater, man-eating shark, '
'Carcharodon carcharias', 'aquatic vertebrate'),
('pineapple, ananas', 'solid'), ('cardoon', 'solid'),
('pop bottle, soda bottle', 'vessel'), ('lionfish', 'aquatic vertebrate'),
('cucumber, cuke', 'solid'), ('face powder', 'substance'),
('Shetland sheepdog, Shetland sheep dog, Shetland', 'working dog'),
('ringlet, ringlet butterfly', 'insect'),
('Greater Swiss Mountain dog', 'working dog'),
('alp', 'geological formation, formation'), ('consomme', 'substance'),
('potpie', 'substance'), ('acorn squash', 'solid'),
('ice cream, icecream', 'substance'),
('lakeside, lakeshore', 'geological formation, formation'),
('hotdog, hot dog, red hot', 'substance'), ('rhinoceros beetle', 'insect'),
('lycaenid, lycaenid butterfly', 'insect'), ('lemon', 'solid')
]
@DATASETS.register_module()
class TieredImageNetDataset(BaseFewShotDataset):
"""TieredImageNet dataset for few shot classification.
Args:
subset (str| list[str]): The classes of whole dataset are split into
three disjoint subset: train, val and test. If subset is a string,
only one subset data will be loaded. If subset is a list of
string, then all data of subset in list will be loaded.
Options: ['train', 'val', 'test']. Default: 'train'.
"""
resource = 'https://github.com/renmengye/few-shot-ssl-public'
TRAIN_CLASSES = TRAIN_CLASSES
VAL_CLASSES = VAL_CLASSES
TEST_CLASSES = TEST_CLASSES
def __init__(self,
subset: Literal['train', 'test', 'val'] = 'train',
*args,
**kwargs):
if isinstance(subset, str):
subset = [subset]
for subset_ in subset:
assert subset_ in ['train', 'test', 'val']
self.subset = subset
self.GENERAL_CLASSES = self.get_general_classes()
super().__init__(*args, **kwargs)
def get_classes(
self,
classes: Optional[Union[Sequence[str],
str]] = None) -> Sequence[str]:
"""Get class names of current dataset.
Args:
classes (Sequence[str] | str | None): Three types of input
will correspond to different processing logics:
- If `classes` is a tuple or list, it will override the
CLASSES predefined in the dataset.
- If `classes` is None, we directly use pre-defined CLASSES
will be used by the dataset.
- If `classes` is a string, it is the path of a classes file
that contains the name of all classes. Each line of the file
contains a single class name.
Returns:
tuple[str] or list[str]: Names of categories of the dataset.
"""
if classes is None:
class_names = []
for subset_ in self.subset:
if subset_ == 'train':
class_names += [i[0] for i in self.TRAIN_CLASSES]
elif subset_ == 'val':
class_names += [i[0] for i in self.VAL_CLASSES]
elif subset_ == 'test':
class_names += [i[0] for i in self.TEST_CLASSES]
else:
raise ValueError(f'invalid subset {subset_} only '
f'support train, val or test.')
elif isinstance(classes, str):
# take it as a file path
class_names = mmcv.list_from_file(classes)
elif isinstance(classes, (tuple, list)):
class_names = classes
else:
raise ValueError(f'Unsupported type {type(classes)} of classes.')
return class_names
def get_general_classes(self) -> List[str]:
"""Get general classes of each classes."""
general_classes = []
for subset_ in self.subset:
if subset_ == 'train':
general_classes += [i[1] for i in self.TRAIN_CLASSES]
elif subset_ == 'val':
general_classes += [i[1] for i in self.VAL_CLASSES]
elif subset_ == 'test':
general_classes += [i[1] for i in self.TEST_CLASSES]
else:
raise ValueError(f'invalid subset {subset_} only '
f'support train, val or test.')
return general_classes
def load_annotations(self) -> List[Dict]:
"""Load annotation according to the classes subset."""
data_infos = []
for subset_ in self.subset:
labels_file = osp.join(self.data_prefix, f'{subset_}_labels.pkl')
img_bytes_file = osp.join(self.data_prefix,
f'{subset_}_images_png.pkl')
assert osp.exists(img_bytes_file) and osp.exists(labels_file), \
f'Please download ann_file through {self.resource}.'
data_infos = []
with open(labels_file, 'rb') as labels, \
open(img_bytes_file, 'rb') as img_bytes:
labels = pickle.load(labels)
img_bytes = pickle.load(img_bytes)
label_specific = labels['label_specific']
label_general = labels['label_general']
class_specific = labels['label_specific_str']
class_general = labels['label_general_str']
unzip_file_path = osp.join(self.data_prefix, subset_)
is_unzip_file = osp.exists(unzip_file_path)
if not is_unzip_file:
msg = ('Please use the provided script '
'tools/classification/data/unzip_tiered_imagenet.py'
'to unzip pickle file. Otherwise the whole pickle '
'file may cost heavy memory usage when the model '
'is trained with distributed parallel.')
warnings.warn(msg)
for i in range(len(img_bytes)):
class_specific_name = class_specific[label_specific[i]]
class_general_name = class_general[label_general[i]]
gt_label = self.class_to_idx[class_specific_name]
assert class_general_name == self.GENERAL_CLASSES[gt_label]
filename = osp.join(subset_, f'{subset_}_image_{i}.byte')
info = {
'img_prefix': self.data_prefix,
'img_info': {
'filename': filename
},
'gt_label': np.array(gt_label, dtype=np.int64),
}
# if the whole pickle file isn't unzipped,
# image bytes of will be put into data_info
if not is_unzip_file:
info['img_bytes'] = img_bytes[i]
data_infos.append(info)
return data_infos
| python |
<filename>templates/pages/placeholder.add.bid.html
{% extends 'layouts/main.html' %}
{% block title %}Bid{{task.title}}{% endblock %}
{% block content %}
<form method="post" class="form">
<h3 class="form-heading">Bid<a href="{{ url_for('home') }}" title="Back to homepage"><i class="fa fa-home pull-right"></i></a></h3>
{{ form.hidden_tag() }}
<label for="Bid Amount">Bid Amount</label>
{{ form.bid_amount(class_ = 'form-control first-input', placeholder = form.bid_amount.label.text, required = true, min = task.min_bid, autofocus = true) }}
<label for="Comment">Comment</label>
{{ form.comment(class_ = 'form-control first-input', placeholder = form.comment.label.text) }}
<input type="submit" value="Bid Now" class="btn btn-primary btn-lg btn-block">
</form>
{% endblock %}
| html |
1. Examine the deleterious effects of India’s current cropping pattern on the environment. What reforms are needed to incentivise sustainable cropping pattern? Discuss.
र्यावरण पर भारत के वर्तमान फसल पैटर्न के प्रतिकूल प्रभावों की जांच करें। एक सतत फसल पैटर्न को प्रोत्साहित करने के लिए किन सुधारों की आवश्यकता है? चर्चा करें।
| english |
Former Petronet LNG Ltd CEO Prabhat Singh has joined a Reliance Industries Ltd affiliate firm, second top executive to join billionaire Mukesh Ambani-run group within weeks of demitting office.
Singh, who completed a five-term term at India's largest liquefied natural gas importer Petronet in mid-September, joined the "business leadership team of the India Gas Solutions (IGS)", an employee communication by Reliance Industries executive director P M S Prasad said.
In August this year, former Indian Oil Corp (IOC) chairman Sanjiv Singh joined Reliance Industries Ltd (RIL) as a group president for the firm's oil-to-chemicals business.
Singh had retired from India's top oil firm in June-end.
"He (Prabhat Singh) will lead and drive the IGS organisation, aimed at assured supply of natural gas to meet its energy demand of India," Prasad wrote.
Singh's exact role, designation and hierarchy in the organisation were fuzzy.
RIL and its partner BP did not answer emails sent for comments.
India Gas Solutions Private Limited (IGS) is a 50:50 joint venture of supermajor BP and RIL that is focused on sourcing and marketing of natural gas in India.
Bibhas Ganguly, an executive with RIL, is the chairman of IGS. Vinod Tahiliani, who was previously with BP, was named chief executive officer (CEO) of the company in February 2018.
"As a cleaner, sustainable fuel source, the demand for natural gas is expected to grow at an exponential rate. We are confident that with his experience and abilities, Prabhat will steer IGS towards meeting this exponential demand and marketing of natural gas within the country," Prasad wrote.
Prabhat Singh was appointed Managing Director and CEO of Petronet on September 14, 2015, for an initial period of five years.
Though Singh, 63, was eligible for an extension till he achieved superannuation age two years later, Petronet appointed a replacement for him.
Petronet is owned by state-owned gas utility GAIL (India) Ltd, refiners Indian Oil Corp (IOC) and Bharat Petroleum Corp Ltd (BPCL) and explorer Oil and Natural Gas Corp (ONGC). The four firms own a 12. 5 per cent stake each in the firm which is registered as a private company but is headed by the Secretary to Ministry of Petroleum and Natural Gas.
(Only the headline and picture of this report may have been reworked by the Business Standard staff; the rest of the content is auto-generated from a syndicated feed. ) | english |
The sequel to 1993 fantasy comedy film Hocus Pocus will be released on Disney Plus Hotstar on September 30, the streaming service announced on Tuesday.
Directed by Anne Fletcher, Hocus Pocus 2 brings back the iconic trio of Bette Midler, Sarah Jessica Parker and Kathy Najimy as three witches named Winifred, Sarah, and Mary, who are called the Sanderson Sisters.
“We’re back, Witches. Hocus Pocus 2, an Original movie event, is streaming September 30 on #DisneyPlus. #HocusPocus2” read a tweet from the official Twitter handle of Disney Plus.
Hocus Pocus, directed by Kenny Ortega, centered on Sanderson Sisters who were resurrected in Salem, Massachusetts and are bent on becoming immortal.
The sequel is set 29 years after the events of the original and follows three high-school students who must work together to stop the Sanderson sisters who have returned to present-day Salem.
Hocus Pocus 2 will also feature Doug Jones, Whitney Peak, Lilia Buckingham, Belissa Escobedo, Hannah Waddingham, Tony Hale and Sam Richardson.
The film is written by Jen D’Angelo and produced by Lynn Harris with Adam Shankman, Ralph Winter and David Kirschner serving as executive producers. | english |
<reponame>DOREMUS-ANR/recommender
http://data.doremus.org/expression/e58f3ce2-e206-32fe-84b8-2e63484fc66c
http://data.doremus.org/expression/70addded-2092-376b-81fb-e9e68bccf139
http://data.doremus.org/expression/6b835fcc-d36a-320c-ac54-60cf8cde790d
http://data.doremus.org/expression/90c33c8b-f6cf-3cf5-92c8-f21f8c7e8afd
http://data.doremus.org/expression/8bdadaed-d731-348b-b9a5-2af7096a5734
http://data.doremus.org/expression/80fba2cd-730e-3131-a78e-3be21eebb2b5
http://data.doremus.org/expression/e300aa56-206c-395c-8570-c50f4b12b8ff
http://data.doremus.org/expression/9cf84c5c-ea6d-32cd-8ba2-7bca1185fd09
http://data.doremus.org/expression/9cb4f4b1-809d-30c5-9038-c8cbc63f075a
http://data.doremus.org/expression/e4a41218-c2e4-37d7-8412-f4616961122d
http://data.doremus.org/expression/447a9c65-843f-344a-94dd-e91a73b074ee
http://data.doremus.org/expression/406614da-43e0-304c-8406-4dd3fa7b3229
http://data.doremus.org/expression/90fc4db5-12fa-340e-8c0f-8d0d225b94df
http://data.doremus.org/expression/998327dc-0ffa-3cd1-a793-9b6fbfa97090
http://data.doremus.org/expression/842cf3dd-72cc-39b2-948f-60f891f22663
http://data.doremus.org/expression/04458ef7-a5f1-394b-9628-84532a0b12a2
http://data.doremus.org/expression/bd4df06f-0560-3799-8203-f9c213337da7
http://data.doremus.org/expression/a96e48ae-72ac-30f5-bc01-caf447001eb5
http://data.doremus.org/expression/9c09d3fa-53fb-36e4-a053-0a08e23a0101
http://data.doremus.org/expression/ba2557ad-a089-3a1f-9e48-5261e29c42c8
http://data.doremus.org/expression/91c02817-8e21-3224-b9c1-cd34e651c5cd
http://data.doremus.org/expression/78529aa3-1a0f-3f98-b322-23a6bd11c66f
http://data.doremus.org/expression/d87a19b4-6b97-3d05-bdde-eaa5ba5d29f4 | json |
import tensorflow as tf
import os
from tensorflow.python.framework import graph_util
from tensorflow.python.platform import gfile
def show_help():
help(tf.contrib.lite.TocoConverter)
# 本地的pb文件转换成TensorFlow Lite (float)
def pb_to_tflite(pb_file, save_name, input_arrays, output_arrays):
# graph_def_file = "./models/faceboxes.pb"
# input_arrays = ["inputs"]
# output_arrays = ['out_locs', 'out_confs']
# converter = tf.contrib.lite.TFLiteConverter.from_frozen_graph(pb_file, input_arrays, output_arrays)
converter = tf.contrib.lite.TocoConverter.from_frozen_graph(pb_file, input_arrays, output_arrays)
# converter = tf.contrib.lite.toco_convert.from_frozen_graph(pb_file, input_arrays, output_arrays)
tflite_model = converter.convert()
open(save_name, "wb").write(tflite_model)
# 用tf.Session,将GraphDef转换成TensorFlow Lite (float)
def sess_to_tflite(sess, save_name, input_arrays=['inputs'], output_arrays=['out_locs', 'out_confs']):
# converter = tf.contrib.lite.TFLiteConverter.from_session(sess, input_arrays, output_arrays)
converter = tf.contrib.lite.TocoConverter.from_session(sess, input_arrays, output_arrays)
# converter = tf.contrib.lite.toco_convert.from_session(sess, input_arrays, output_arrays)
tflite_model = converter.convert()
open(save_name, "wb").write(tflite_model)
# 本地的saveModel文件转换成TensorFlow Lite (float)
def save_model_to_tflite_float(saved_model_dir, save_name, input_arrays=None, output_arrays=None):
# converter = tf.contrib.lite.TFLiteConverter.from_saved_model(saved_model_dir=saved_model_dir,
# input_arrays=input_arrays,
# output_arrays=output_arrays)
converter = tf.contrib.lite.TocoConverter.from_saved_model(saved_model_dir=saved_model_dir,
input_arrays=input_arrays,
output_arrays=output_arrays)
# converter = tf.contrib.lite.toco_convert.from_saved_model(saved_model_dir)
tflite_model = converter.convert()
open(save_name, "wb").write(tflite_model)
# 本地的keras文件转换成TensorFlow Lite (float)(该tf.keras文件必须包含模型和权重。)
def keras_to_tflite():
converter = tf.contrib.lite.TFLiteConverter.from_keras_model_file("keras_model.h5")
tflite_model = converter.convert()
open("converted_model.tflite", "wb").write(tflite_model)
# =========================================================================================================
# 本地的saveModel文件转换成TensorFlow Lite (quant)
def save_model_to_tflite_quant(saved_model_dir, save_name, input_arrays=None, output_arrays=None):
converter = tf.contrib.lite.TFLiteConverter.from_saved_model(saved_model_dir=saved_model_dir,
input_arrays=input_arrays,
output_arrays=output_arrays)
# converter = tf.contrib.lite.TocoConverter.from_saved_model(saved_model_dir=saved_model_dir,
# input_arrays=input_arrays,
# output_arrays=output_arrays)
# converter = tf.contrib.lite.toco_convert.from_saved_model(saved_model_dir)
converter.inference_type = tf.contrib.lite.constants.QUANTIZED_UINT8
input_arrays = converter.get_input_arrays()
converter.quantized_input_stats = {input_arrays[0]: (128., 127.)}
tflite_model = converter.convert()
open(save_name, "wb").write(tflite_model)
# =========================================================================================================
def save_pbtxt(save_path, save_name='graph.pbtxt', output_node_names=['inputs', 'out_locs', 'out_confs']):
with tf.Session() as sess:
print('save model graph to .pbtxt: %s' % os.path.join(save_path, save_name))
save_graph = graph_util.convert_variables_to_constants(sess, sess.graph_def, output_node_names)
tf.train.write_graph(save_graph, '', os.path.join(save_path, save_name))
# 保存为pb格式
def save_pb(save_path, save_name='faceboxes.pb', output_node_names=['inputs', 'out_locs', 'out_confs']):
with tf.Session() as sess:
print('save model to .pb: %s' % os.path.join(save_path, save_name))
# convert_variables_to_constants 需要指定output_node_names,list(),可以多个
# 此处务必和前面的输入输出对应上,其他的不用管
constant_graph = graph_util.convert_variables_to_constants(sess, sess.graph_def, output_node_names)
with tf.gfile.FastGFile(os.path.join(save_path, save_name), mode='wb') as f:
f.write(constant_graph.SerializeToString())
# 加载pb格式
def load_pb(load_path, save_name='faceboxes.pb'):
# sess = tf.Session()
with tf.Session() as sess:
with gfile.FastGFile(os.path.join(load_path, save_name), mode='rb') as f: # 加载模型
graph_def = tf.GraphDef()
graph_def.ParseFromString(f.read())
sess.graph.as_default()
tf.import_graph_def(graph_def, name='') # 导入计算图
# # 需要有一个初始化的过程
# sess.run(tf.global_variables_initializer())
# # 需要先复原变量
# print(sess.run('b:0'))
# # 下面三句,是能否复现模型的关键
# # 输入
# input_x = sess.graph.get_tensor_by_name('x:0') # 此处的x一定要和之前保存时输入的名称一致!
# input_y = sess.graph.get_tensor_by_name('y:0') # 此处的y一定要和之前保存时输入的名称一致!
# op = sess.graph.get_tensor_by_name('op_to_store:0') # 此处的op_to_store一定要和之前保存时输出的名称一致!
# ret = sess.run(op, feed_dict={input_x: 5, input_y: 5})
# print(ret)
if __name__ == '__main__':
# show_help()
# pb_to_tflite(pb_file="./models/faceboxes.pb",
# save_name="./models/faceboxes.tflite",
# input_arrays=["inputs"],
# output_arrays=['out_locs', 'out_confs'])
save_model_to_tflite_float(saved_model_dir='./export/run00/1557046559',
save_name='./models/faceboxes_float.tflite',
input_arrays=["image_tensor"],
output_arrays=['reshaping/loc_predict', 'reshaping/conf_predict'])
# save_model_to_tflite_float(saved_model_dir='./export/run00/1557046559',
# save_name='./models/faceboxes_float.tflite',
# input_arrays=["image_tensor"],
# output_arrays=['nms/map/TensorArrayStack/TensorArrayGatherV3',
# 'nms/map/TensorArrayStack_1/TensorArrayGatherV3',
# 'nms/map/TensorArrayStack_2/TensorArrayGatherV3'])
# save_model_to_tflite_quant(saved_model_dir='./export/run00/1555989957',
# save_name='./models/faceboxes_quant.tflite',
# input_arrays=["image_tensor"],
# output_arrays=['reshaping/loc_predict', 'reshaping/conf_predict'])
| python |
package application.services;
import java.util.List;
public class MessageService {
public static String completeMessage(List<List<String>> messages){
StringBuilder sentence = new StringBuilder();
String[] fullMessage = new String[maxSize(messages)];
for(List<String> message: messages){
for(int i = 0;i<message.size();i++){
if(!message.get(i).equals("") && message.get(i) != null)
fullMessage[i] = message.get(i);
}
}
for (String s : fullMessage) {
if (s != null)
sentence.append(s).append(" ");
}
return sentence.toString();
}
public static int maxSize(List<List<String>> messages) {
int max = messages.get(0).size();
for(int i = 1;i<messages.size();i++){
if(messages.get(i).size()>max)
max = messages.get(i).size();
}
return max;
}
}
| java |
#include<iostream>
using namespace std;
void printarr(int arr[],int n)
{
int i;
for(i=0;i<n;i++)
cout<<arr[i]<<" ";
cout<<endl;
}
void swap(int *a,int *b)
{
int temp=*a;
*a=*b;
*b=temp;
}
void bsort(int arr[],int n)
{
int i,j;
for(i=0;i<n-1;i++)
for(j=0;j<n-1-i;j++)
if(arr[j]>arr[j+1]) swap(&arr[j],&arr[j+1]);
}
void ssort(int arr[],int n)
{
int i,j,min;
for(i=0;i<n-1;i++)
{
min=i;
for(j=i+1;j<n;j++)
if(arr[j]<arr[min]) min=j;
swap(&arr[i],&arr[min]);
}
}
void merge(int arr[],int l,int m,int r)
{
int i,j,k;
int n1=m-l+1;
int n2=r-m;
int L[n1],R[n2];
for(i=0;i<n1;i++)
L[i]=arr[l+i];
for(j=0;j<n2;j++)
R[j]=arr[m+1+j];
i=0;
j=0;
k=l;
while(i<n1&&j<n2)
{
if(L[i]<=R[j])
{
arr[k]=L[i];
i++;
}
else
{
arr[k]=R[j];
j++;
}
k++;
}
while(i<n1)
{
arr[k]=L[i];
i++;
k++;
}
while(j<n2)
{
arr[k]=R[j];
j++;
k++;
}
}
void msort(int arr[],int l,int r)
{
if(l<r)
{
int m=l+(r-l)/2;
msort(arr,l,m);
msort(arr,m+1,r);
merge(arr,l,m,r);
}
}
main()
{
int arr[]={7,5,3,1,9,6,4,8,2};
int n=sizeof(arr)/sizeof(arr[0]);
msort(arr,0,n-1);
printarr(arr,n);
}
| cpp |
Thiruvananthapuram: After the Youth Congress in Kozhikode reportedly backed off from a seminar for which it had invited Shashi Tharoor, the senior Congress leader and Thiruvananthapuram MP has demanded a probe into the matter by the party leadership.
The seminar titled ‘Sangh Parivar and the challenges faced by Indian secularism’ has reportedly been assigned to the Jawahar Youth Foundation.
Tharoor’s demand has been backed by Kozhikode MP, M.K. Raghavan, who said that he would send a complaint to Sonia Gandhi and Rahul Gandhi in this matter. Raghavan also urged state Congress President K. Sudhakaran to constitute an inquiry commission to probe why the Kozhikode district committee of Youth Congress backed off from Tharoor’s seminar.
Tharoor said that being the Member of Parliament representing Kozhikode, Raghavan has the right to intervene in the matter and demand a report from the Congress leadership as to why the Youth Congress district committee backed off from his seminar.
Raghavan also said that Kerala Congress must project Tharoor as its leader to make a comeback into state politics.
Meanwhile, senior Congress leader K. Muraleedharan, who is the MP from Vadakara Lok Sabha constituency in Kozhikode district, told mediapersons that no one can exclude Tharoor from Kerala politics.
Tharoor has commenced a tour of northern Kerala during which he is addressing seminars at different places, which many feel is his bid to make a space for himself among the educated middle class as well as the Muslim community with the support of the Indian Union Muslim League.
Raghavan is fecilitating his travels in north Kerala.
| english |
Islam Times - NATO Secretary General Jens Stoltenberg said on Sunday that the US-led alliance aims to strengthen Ukraine’s position at the negotiating table, but added that any peace deal would involve compromises, including of territory.
Stoltenberg spoke at the Kultaranta Talks in Finland, following a meeting with Finnish President Sauli Niinisto. While the NATO chief said that the West was willing to “pay a price” to strengthen the Ukrainian military, Kiev will have to make some territorial concessions to Moscow in order to end the current conflict.
Stoltenberg did not suggest what terms Ukraine should accept, saying that “it’s for those who are paying the highest price to make that judgment,” while NATO and the West continue supplying arms to the Ukrainians to “strengthen their hand” when a settlement is eventually negotiated.
Stoltenberg’s statement comes amid growing sentiment that Ukraine may soon be pressed into a peace deal by its Western backers. While US and British officials publicly insist that Ukraine “can win” its war with Russia, a recent CNN report suggests that officials in Washington, London and Brussels are meeting without their Ukrainian counterparts in an effort to plan a ceasefire and peace settlement.
French President Emmanuel Macron has publicly denied urging Zelensky to give up some territory in exchange for an end to hostilities, as former US Secretary of State Henry Kissinger suggested last month he should do.
Kissinger proposed in May that Ukraine accept a return to the “status quo ante,” meaning it would relinquish its territorial claims to Crimea and grant autonomy to the Donetsk and Lugansk People’s Republics. Crimea has been a part of Russia since 2014, while Moscow recognized the independence of Donetsk and Lugansk People’s Republics several days before its military operation began in February.
Zelensky has shifted positions several times on a potential peace deal, with the president periodically expressing interest in negotiating a settlement with Russia, only for his officials, the US State Department, or Zelensky himself, to express the opposite sentiment shortly afterwards. After announcing his willingness to enter negotiations late last month, Zelensky came out several days later and told his citizens that “there will be no alternative to our Ukrainian flags” flying over the Donbass republics.
| english |
Union Health Minister Mansukh Mandaviya underscored the need for the Centre and the states to work in collaboration to keep the Covid-19 situation under control.
By Sneha Mordani: With India recording over 6,000 Covid-19 cases on Friday, Union Health Minister Mansukh Mandaviya chaired a high-level meeting with health ministers of states and Union Territories to review the public health preparedness and the status of Covid-19 vaccination. He directed states to identify emergency hotspots, ramp up testing, and ensure hospital infrastructure readiness.
Mandaviya underscored the need for the Centre and the states to work in collaboration as was done during the previous waves of Covid-19 to keep infection under control.
He also directed health officials to follow a five-fold strategy of test, track, treat, vaccinate and adherence to Covid-appropriate behaviour for Covid management.
The health minister asked states to ramp up testing and genome sequencing, identify emergency hotspots, increase vaccination and ensure hospitals are equipped with the necessary infrastructure so that proper treatment is administered to Covid-19 patients and the medical facilities are ready lest there is a surge in cases.
The state health ministers have been asked to review preparedness for Covid-19 management with district administrations and public health officials on April 8 and 9.
States have been asked to conduct mock drills across all health facilities on April 10 and 11. Mandaviya directed the state health ministers to visit the hospitals and review the drills.
India on Friday reported 14 fatalities and 6,050 new Covid-19 cases--a spike of 13% of the Covid cases reported on Thursday--showed data available with the health ministry.
The daily positivity rate is pegged at 3. 39 per cent while the weekly positivity rate stands at 3. 02 per cent, the ministry said.
Kerala has the highest number of Covid cases in the country with 9,422 active cases. | english |
'use strict';
exports.__esModule = true;
exports.default = function (fn) {
connectionResetDomain.run(fn);
};
var _domain = require('domain');
var _domain2 = _interopRequireDefault(_domain);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var connectionResetDomain = _domain2.default.create();
connectionResetDomain.on('error', function (err) {
if (err.code !== 'ECONNRESET') {
connectionResetDomain.removeAllListeners('error');
throw new Error(err);
}
});
module.exports = exports['default']; | javascript |
As a clinician, the most common anomaly for which people approach me is back trouble. WHO also identifies low back pain amongst the top 10 causes accounting for the highest number of Disability Adjusted Life Years (days with compromised quality of life)? What congregated my attention even more is the shift of this patient group from elderly to all ages in the recent present. Low backache is more common with increasing age substantially due to the progressive degeneration of the intervertebral discs. Moreover, the causes of backache are such that once incident, backache tends to recur. Recently low Back Pain has evolved as the most common Work-Related Musculoskeletal Disorder among the IT Professionals.
The adjacent figure showing the prevalence of all musculoskeletal problems amongst IT Professionals is an eye-opener.
In various sections we have covered diverse aspects of low back pain, today we will focus more on how to get rid of backache.
Before I start to read the praises about exercise management, it is important to know a little about types of backache.
What causes low back pain?
How to get rid of backache?
- Treatment of the underlying cause, the stone, the infection, the tumors.
- Ultrasound massage for single point originating pain (piriformis syndrome)
- Isometric Back– Lie supine with knees bent, press your back into the couch you are lying, hold count 5 repeat.
- SUPINE TWIST– Lie supine with knees bent, turn face towards left and rest of the torso towards right. Repeat from other side.
- Bridging– Lie supine with knees bent and no pillow under the neck, lift trunk up from hip, hold count 5, repeat.
- Leg Raises-Lie supine with legs spread, raise from hip, one leg at a time.
There is more to surgical management for more severe back problems, but I hope and believe yours will contain well within the boundaries of this write-up!!
| english |
import React, { useEffect, useState } from "react";
import {
Avatar,
Button,
CircularProgress,
Grid,
makeStyles,
Typography,
} from "@material-ui/core";
import Posts from "../../components/Posts/Posts";
import { connect } from "react-redux";
import { getUserProfileAsync, postsReset } from "../../store/actions/index";
import NewPost from "../../components/Posts/NewPost/NewPost";
import About from "../../components/Auth/User/About/About";
import UserSettings from "../../components/Auth/User/UserSettings/UserSettings";
import withError from "../../hoc/withError/withError";
import Axios from "axios";
const useStyles = makeStyles(() => ({
grow: {
flexGrow: 1,
},
avatar: {
margin: "15px auto",
width: 175,
height: 175,
},
spinner: {
marginTop: 25,
},
username: {
textAlign: "center",
},
about: {
justifyContent: "center",
},
}));
const UserProfile = (props) => {
const classes = useStyles();
const { onMount, postsReset } = props;
const { username } = props.match.params;
const [aboutDialogOpen, setAboutDialogOpen] = useState(false);
const [settingsDialogOpen, setSettingsDialogOpen] = useState(false);
useEffect(() => {
postsReset();
onMount(username);
}, [onMount, postsReset, username]);
const handleAboutDialogOpen = () => {
setAboutDialogOpen(true);
};
const handleAboutDialogClosed = () => {
setAboutDialogOpen(false);
};
const handleSettingsDialogOpen = () => {
setSettingsDialogOpen(true);
};
const handleSettingsDialogClosed = () => {
setSettingsDialogOpen(false);
};
return (
<div>
{props.user ? (
<div>
<Avatar className={classes.avatar}>U</Avatar>
<Typography className={classes.username} variant="h3">
{props.match.params.username}
</Typography>
<div style={{ display: "flex", justifyContent: "center" }}>
<Button onClick={handleAboutDialogOpen} variant="body1">
About
</Button>
<About
dialogOpen={aboutDialogOpen}
handleClose={handleAboutDialogClosed}
country={props.user.country}
age={props.user.age}
about={props.user.about}
/>
{props.user._id === props.authUserId && (
<React.Fragment>
<Button onClick={handleSettingsDialogOpen} variant="body1">
Settings
</Button>
<UserSettings
dialogOpen={settingsDialogOpen}
handleClose={handleSettingsDialogClosed}
/>
</React.Fragment>
)}
</div>
<Grid container>
<Grid item sm />
<Grid style={{ flexGrow: 1 }} item sm={8}>
{props.posts ? (
<Posts user={props.user} posts={props.posts} />
) : (
<CircularProgress />
)}
</Grid>
<Grid item sm />
</Grid>
{props.user._id === props.authUserId && <NewPost />}
</div>
) : (
<div style={{ textAlign: "center" }}>
<CircularProgress className={classes.spinner} size={90} />
</div>
)}
</div>
);
};
const mapStateToProps = (state) => {
return {
user: state.user.user,
authUserId: state.auth.userId,
isLoading: state.user.isLoading,
errors: state.user.errors,
//Need posts in order to update the posts in a user's profile in real time
posts: state.posts.posts,
};
};
const mapDispatchToProps = (dispatch) => {
return {
onMount: (username) => dispatch(getUserProfileAsync(username)),
postsReset: () => dispatch(postsReset()),
};
};
export default connect(
mapStateToProps,
mapDispatchToProps
)(withError(UserProfile, Axios));
| javascript |
As the world is changing and new things are discovered with new and better studies comes worth it is time to look at our laws when it comes to recreational use of cannabis, the pros of cannabis outwheaights the cons by a large margine and should be somthing we need to look at.
When the war on drugs started the reasons given for making cannabis illegal in the first place were falsely made documents to get people to talk negatively about the substance, now so many years later we have learned the truth and its time we demand the norwegian state to remove the law and give the people the freedom to use cannabis as a recreational drug.
The law dose not only not make sence, it should be illegal to refuse the public of a country the option of using cannabis as a recreational tool.
we now live in a time for the second prohibition, first it was alcohol and now we again have to fight the government to legalize cannabis, it is time to stand up against the government and force theire hand for the publics greater good.
It is time to stand. For freedom. For society. For life.
| english |
package golf
import (
. "gopkg.in/check.v1"
"time"
)
func (s *GolfSuite) TestJsonFloatNew(c *C) {
f := newJsonFloat(12345)
c.Check(f.val, Equals, float64(12345))
}
func (s *GolfSuite) TestJsonFloatJson(c *C) {
f := newJsonFloat(float64(1440387554.671944965))
c.Check(f.val, Equals, 1440387554.671944965)
json, err := f.MarshalJSON()
c.Logf("%v", string(json))
c.Check(err, IsNil)
c.Check(string(json), Equals, "1440387554.671945")
}
func (s *GolfSuite) TestJsonNoLogger(c *C) {
msg := newMessage()
msg.Level = LEVEL_CRIT
msg.Hostname = "hostname"
t := time.Unix(0, 1440387554671944965)
msg.Timestamp = &t
msg.ShortMessage = "short_message"
msg.FullMessage = "full_message"
msg.Attrs["attr1"] = "val1"
msg.Attrs["attr2"] = 1234
json, _ := generateMsgJson(msg)
c.Check(json, Equals, `{`+
`"_attr1":"val1","_attr2":1234,"full_message":"full_message",`+
`"host":"hostname","level":2,"short_message":"short_message",`+
`"timestamp":1440387554.671945,"version":"1.1"`+
`}`)
}
func (s *GolfSuite) TestJsonWithLogger(c *C) {
l := newLogger()
l.SetAttr("attr1", "notval1")
l.SetAttr("attr3", "val3")
msg := newMessage()
msg.logger = l
msg.Level = LEVEL_CRIT
msg.Hostname = "hostname"
t := time.Unix(0, 1440387554671944965)
msg.Timestamp = &t
msg.ShortMessage = "short_message"
msg.FullMessage = "full_message"
msg.Attrs["attr1"] = "val1"
msg.Attrs["attr2"] = 1234
json, _ := generateMsgJson(msg)
c.Check(json, Equals, `{`+
`"_attr1":"val1","_attr2":1234,"_attr3":"val3",`+
`"full_message":"full_message","host":"hostname","level":2,`+
`"short_message":"short_message","timestamp":1440387554.671945,`+
`"version":"1.1"`+
`}`)
}
| go |
<reponame>fleimgruber/python<gh_stars>10-100
{
"desc": "Pexpect allows easy control of interactive console applications.",
"home": "https://pexpect.readthedocs.io/",
"license": "ISC license"
}
| json |
Washington: The White House has said that it is still reviewing Haiti’s request for US military support to stabilize the country after the assassination of President Jovenel Moise.
White House Press Secretary Jen Psaki said on Monday during a daily briefing that Haiti’s interim government’s request of sending US troops to the country is still under review, Xinhua reported.
When asked if the White House had ruled out sending troops, she replied “no”.
President Joe Biden on the same day told reporters that “Haiti’s political leaders need to come together for the good of their country,” adding that the United States is ready to offer assistance.
The White House said earlier that an interagency delegation with officials from the departments of Justice, Homeland Security, and State, and National Security Council (NSC) had travelled to Haiti on Sunday.
“The delegation reviewed the security of critical infrastructure with Haitian government officials and met with the Haitian National Police, who are leading the investigation into the assassination,” NSC spokesperson Emily Horne said in a statement.
The delegation also met with Haitian political leaders “to encourage open and constructive dialogue to reach a political accord that can enable the country to hold free and fair elections,” according to the statement.
Haiti’s interim government asked the United States and the United Nations to deploy troops to the country to secure key infrastructure in the aftermath of the assassination of President Moise.
The assassination of the Haitian president came two months before the country’s presidential and legislative elections, which are scheduled for September 26.
| english |
{
"dependencies": {
"@google-cloud/functions-framework": "github:GoogleCloudPlatform/functions-framework-nodejs"
}
}
| json |
# About
<!-- TODO: add information on emoji-symbols concept -->
| markdown |
import { Card } from './card';
import { PlayerId } from './player';
export interface Penalty {
readonly card: Card;
readonly playerId: PlayerId;
}
| typescript |
Hyderabad: Amid heavy rains battering and widespread damage in Himachal Pradesh, three doctors from Osmania Hospital are stranded in the northern state. The families of Dr Banot Kamal Lal, Dr Rohit Suri and Dr Srinivas are worried as their phones got switched off. Similarly, a family from Hyderabad is also stuck in the rain-affected region. Their relatives are also concerned as the family members are not reachable.
The Health minister T Harish Rao is meeting the Union Minister Gajendra Singh Shekhawat in the national capital on Wednesday to discuss the issues like Krishna River Tribunal and Irrigation projects. He has ordered the officials to take necessary steps to bring back the stranded Telugu doctors from Himachal Pradesh.
Earlier in the day, the IT Minister KT Rama Rao tweeted that a few Telugu students were stranded in Kullu and Manali of Himachal Pradesh. He also informed that the Resident Commissioner in New Delhi would take required measures to shift the distressed students to the safer place.
At least 72 people died and hundreds are stranded as the torrential rains wreak havoc in the northern state. The unprecedented rains and flash floods have severely disrupted the communication network in the affected areas. | english |
<gh_stars>1-10
{"meta":{"build_time":"2021-04-11T07:04:14.468Z","license":"CC-BY-4.0","version":"2.0-beta"},"data":{"date":"2020-12-27","state":"RI","meta":{"data_quality_grade":"A+","updated":"2020-12-28T21:31:33Z","tests":{"total_source":"totalTestEncountersViral"}},"cases":{"total":84941,"confirmed":null,"probable":null},"tests":{"pcr":{"total":1939989,"pending":null,"encounters":{"total":1939989},"specimens":{"total":null,"positive":102386,"negative":1837603},"people":{"total":624666,"positive":84941,"negative":539725}},"antibody":{"encounters":{"total":null,"positive":null,"negative":null},"people":{"total":null,"positive":null,"negative":null}},"antigen":{"encounters":{"total":null,"positive":null,"negative":null},"people":{"total":null,"positive":null,"negative":null}}},"outcomes":{"recovered":null,"hospitalized":{"total":6131,"currently":442,"in_icu":{"total":null,"currently":49},"on_ventilator":{"total":null,"currently":35}},"death":{"total":1739,"confirmed":null,"probable":null}}}}
| json |
{
"class" : {
"rdf:type" : "rdfs:Class",
"rdfs:comment" : "A muscle is an anatomical structure consisting of a contractile form of tissue that animals use to effect movement.",
"rdfs:label" : "Muscle",
"rdfs:subClassOf" : "schema:AnatomicalStructure",
"schema:isPartOf" : "http:health-lifesci.schema.org"
},
"properties" : {
"schema:antagonist" : {
"rdf:type" : "rdf:Property",
"rdfs:comment" : "The muscle whose action counteracts the specified muscle.",
"rdfs:label" : "antagonist",
"schema:domainIncludes" : "schema:Muscle",
"schema:isPartOf" : "http:health-lifesci.schema.org",
"schema:rangeIncludes" : "schema:Muscle"
},
"schema:bloodSupply" : {
"rdf:type" : "rdf:Property",
"rdfs:comment" : "The blood vessel that carries blood from the heart to the muscle.",
"rdfs:label" : "bloodSupply",
"schema:domainIncludes" : "schema:Muscle",
"schema:isPartOf" : "http:health-lifesci.schema.org",
"schema:rangeIncludes" : "schema:Vessel"
},
"schema:insertion" : {
"rdf:type" : "rdf:Property",
"rdfs:comment" : "The place of attachment of a muscle, or what the muscle moves.",
"rdfs:label" : "insertion",
"schema:domainIncludes" : "schema:Muscle",
"schema:isPartOf" : "http:health-lifesci.schema.org",
"schema:rangeIncludes" : "schema:AnatomicalStructure"
},
"schema:muscleAction" : {
"rdf:type" : "rdf:Property",
"rdfs:comment" : "The movement the muscle generates.",
"rdfs:label" : "muscleAction",
"schema:domainIncludes" : "schema:Muscle",
"schema:isPartOf" : "http:health-lifesci.schema.org",
"schema:rangeIncludes" : "schema:Text"
},
"schema:nerve" : {
"rdf:type" : "rdf:Property",
"rdfs:comment" : "The underlying innervation associated with the muscle.",
"rdfs:label" : "nerve",
"schema:domainIncludes" : "schema:Muscle",
"schema:isPartOf" : "http:health-lifesci.schema.org",
"schema:rangeIncludes" : "schema:Nerve"
}
}
}
| json |
import React from 'react';
import styled from 'styled-components';
import Waves from './Waves';
import ScrollMore from './ScrollMore';
import { HOME_SECTION, ABOUT_SECTION } from 'data/sections';
const Section = styled.section`
position: relative;
width: 100%;
height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
color: #fff;
background-color: #171933;
`;
const HeroTitle = styled.h1`
margin-bottom: 10px;
`;
function HomeSection() {
const [isWavesPaused, setIsWavesPaused] = React.useState(false);
/**
* Stop wave animation after scrolled to certain position
*/
const handleWindowScroll = () => {
setIsWavesPaused(window.scrollY > 30);
};
React.useEffect(() => {
window.addEventListener('scroll', handleWindowScroll);
return () => {
window.removeEventListener('scroll', handleWindowScroll);
};
}, []);
return (
<Section id={HOME_SECTION.id}>
<HeroTitle>MAKE SIMPLE.</HeroTitle>
<p>Front End Developer</p>
<Waves pause={isWavesPaused} />
<ScrollMore href={`#${ABOUT_SECTION.id}`} />
</Section>
);
}
export default HomeSection;
| typescript |
Six months ago, he was the Finance Minister of a country. As his relationship with former President Asraf Ghani worsened, Khalid Payenda resigned as Finance Minister a week before the Taliban captured Kabul. The person in charge of the country's budget, worth thousands of crores of rupees, has suddenly become a car driver.
Due to circumstances, the minister, who was out of power, was running cabs on the roads for the sake of his existence and the survival of his family members. Payenda works six hours a day and earns $150 to maintain his family.
According to reports, he fled to the United States, where he reunited his family, fearing arrest by the President. | english |
<gh_stars>10-100
{
"name": "Gookie",
"version": "1.0.0",
"description": "Lightweight, configurable GitHub webhook server.",
"author": "<NAME> <<EMAIL>>",
"scripts": {
"start": "node gookie.js"
},
"main": "gookie.js",
"repository": {
"type": "git",
"url": "https://github.com/hoxxep/Gookie"
},
"bugs": {
"url": "https://github.com/hoxxep/Gookie/issues"
},
"dependencies": {
"body-parser": "^1.10.1",
"express": "^4.11.0",
"method-override": "^2.3.1",
"winston": "^0.8.3"
},
"license": "MIT"
}
| json |
Na ovoj stranici možete pronaći kvalitetan sadržaj fokusiran na fabrike metalnih trpezarijskih stolica. Također možete besplatno dobiti najnovije proizvode i artikle koji se odnose na tvornice metalnih stolica za ručavanje. Ako imate bilo kakvih pitanja ili želite da dobijete više informacija o fabrikama metalnih trpezarijskih stolica, slobodno nas kontaktirajte.
Kako bismo bili sigurni da Heshan Youmeiya Furniture Co., Ltd. obezbeđuje kvalitetne metalne trpezarijske stolice fabrike, imamo efikasne metode upravljanja kvalitetom koje u potpunosti ispunjavaju regulatorne zahteve. Strogo slijedimo standardne operativne procedure za odabir materijala kako bismo osigurali visoku kvalitetu proizvoda. U međuvremenu, efikasno implementiramo sistem kontrole kvaliteta kroz čitav proizvodni proces.
Naš glavni prioritet je da izgradimo povjerenje kod kupaca za naš brend - Yumeya Chairs. Ne plašimo se kritike. Svaka kritika je naša motivacija da postanemo bolji. Otvaramo naše kontakt informacije kupcima, omogućavajući kupcima da daju povratne informacije o proizvodima. Za svaku kritiku, mi zapravo činimo napore da ispravimo grešku i dajemo povratne informacije o našem poboljšanju klijentima. Ova akcija nam je efektivno pomogla da izgradimo dugoročno povjerenje kod kupaca.
Usluga je bitan dio našeg nastojanja u Yumeya Chairs. Pomažemo timu profesionalnog dizajnera da izradi plan prilagođavanja za sve proizvode, uključujući fabrike metalnih stolica za ručavanje.
E-maila: Info@youmeiya.net.
| english |
(Hockey India)
India's continued performance in the Asian Champions Trophy has been hampered by the persistent issue of poor penalty corner conversion, but head coach Craig Fulton is not overly concerned, stating that such dismal days from set pieces won't "stay forever."
The South African is pleased that his team is scoring goals as a result of pitch play. "I think we defended well and that helped us put an attack in place. So, we were able to defend from a lot of areas in the field that helped us counter, which is good. We scored some field goals, which got the boys some confidence," he told PTI.
"As far as penalty corner conversion rate (in this match) is concerned, you will have a bad day, but it won't stay bad forever. And we had a good balance today (Sunday)." India won 15 penalty corners against Japan, but just one was successful, resulting in a 1-1 tie. The depressing fact versus Malaysia on Sunday was that they only successfully converted two of ten set pieces.
When asked about the areas that needed development, Fulton pointed out that his team might have been more strategically aware of the opponent but should have gotten lesser cards.
"We got two yellow cards that I need to look into again. But the improvement areas are just general. It's being tactically aware of what the opposition is doing and how we play in that phase. We are not yet where we need to be upfront as a team, but that's ok," he said. On Monday, India will play host to the reigning champions, South Korea.
"You gotta do it all over again and take nothing for granted. And, it's a back-to-back game, so it will be tough. We will look at what happened tonight (Sunday), take the positives and go again," he said.
In addition to pointing out that managing the tempo aids in the creation of goal-scoring opportunities, India vice-captain and midfielder Hardik Singh claimed that the team's patience paid off against Malaysia.
"I think it was all about patience today (Sunday). We realised that we cannot win any game in the first half, so patience was a vital show from the team," he said.
"If we are unable to score, we still have the ball, and we are setting the tempo, so the goal has to come some time or the other. Also, the decent number of field goals today makes this triumph even sweeter.
"Besides having patience and maintaining the tempo, what was positive was that even after earning the cards, we didn't concede any goals," he signed off.
| english |
<gh_stars>1-10
version https://git-lfs.github.com/spec/v1
oid sha256:981cc6a7e4b41c9ce3e65a37c6aad41f009f05497e17e7bba45ffadbd79f8392
size 398
| json |
<filename>src/input.cpp<gh_stars>0
#include "include/input.h"
Input::Input() {
}
bool Input::HandleInput() {
memset(pressed_, false, sizeof(pressed_));
memset(released_, false, sizeof(released_));
mouse.Update();
mouseEvent_ = false;
SDL_Event event;
while (SDL_PollEvent(&event)) {
if (event.type == SDL_QUIT) {
return true;
} else if (event.type == SDL_KEYDOWN && event.key.repeat == 0) {
switch (event.key.keysym.sym) {
case SDLK_a:
pressed_[K_A] = true;
break;
case SDLK_b:
pressed_[K_B] = true;
break;
case SDLK_c:
pressed_[K_C] = true;
break;
case SDLK_d:
pressed_[K_D] = true;
break;
case SDLK_e:
pressed_[K_E] = true;
break;
case SDLK_f:
pressed_[K_F] = true;
break;
case SDLK_g:
pressed_[K_G] = true;
break;
case SDLK_h:
pressed_[K_H] = true;
break;
case SDLK_i:
pressed_[K_I] = true;
break;
case SDLK_j:
pressed_[K_J] = true;
break;
case SDLK_k:
pressed_[K_K] = true;
break;
case SDLK_l:
pressed_[K_L] = true;
break;
case SDLK_m:
pressed_[K_M] = true;
break;
case SDLK_n:
pressed_[K_N] = true;
break;
case SDLK_o:
pressed_[K_O] = true;
break;
case SDLK_p:
pressed_[K_P] = true;
break;
case SDLK_q:
pressed_[K_Q] = true;
break;
case SDLK_r:
pressed_[K_R] = true;
break;
case SDLK_s:
pressed_[K_S] = true;
break;
case SDLK_t:
pressed_[K_T] = true;
break;
case SDLK_u:
pressed_[K_U] = true;
break;
case SDLK_v:
pressed_[K_V] = true;
break;
case SDLK_w:
pressed_[K_W] = true;
break;
case SDLK_x:
pressed_[K_X] = true;
break;
case SDLK_y:
pressed_[K_Y] = true;
break;
case SDLK_z:
pressed_[K_Z] = true;
break;
case SDLK_ESCAPE:
pressed_[K_ESC] = true;
break;
case SDLK_F1:
pressed_[K_F1] = true;
break;
case SDLK_F2:
pressed_[K_F2] = true;
break;
case SDLK_F3:
pressed_[K_F3] = true;
break;
case SDLK_F4:
pressed_[K_F4] = true;
break;
case SDLK_F5:
pressed_[K_F5] = true;
break;
case SDLK_F6:
pressed_[K_F6] = true;
break;
case SDLK_F7:
pressed_[K_F7] = true;
break;
case SDLK_F8:
pressed_[K_F8] = true;
break;
case SDLK_F9:
pressed_[K_F9] = true;
break;
case SDLK_F10:
pressed_[K_F10] = true;
break;
case SDLK_F11:
pressed_[K_F11] = true;
break;
case SDLK_F12:
pressed_[K_F12] = true;
break;
case SDLK_PRINTSCREEN:
pressed_[K_PRINTSCREEN] = true;
break;
case SDLK_INSERT:
pressed_[K_INSERT] = true;
break;
case SDLK_DELETE:
pressed_[K_DELETE] = true;
break;
case SDLK_HOME:
pressed_[K_HOME] = true;
break;
case SDLK_END:
pressed_[K_END] = true;
break;
case SDLK_PAGEUP:
pressed_[K_PAGEUP] = true;
break;
case SDLK_PAGEDOWN:
pressed_[K_PAGEDOWN] = true;
break;
case SDLK_BACKQUOTE:
pressed_[K_BACKQUOTE] = true;
break;
case SDLK_1:
pressed_[K_1] = true;
break;
case SDLK_2:
pressed_[K_2] = true;
break;
case SDLK_3:
pressed_[K_3] = true;
break;
case SDLK_4:
pressed_[K_4] = true;
break;
case SDLK_5:
pressed_[K_5] = true;
break;
case SDLK_6:
pressed_[K_6] = true;
break;
case SDLK_7:
pressed_[K_7] = true;
break;
case SDLK_8:
pressed_[K_8] = true;
break;
case SDLK_9:
pressed_[K_9] = true;
break;
case SDLK_0:
pressed_[K_0] = true;
break;
case SDLK_MINUS:
pressed_[K_MINUS] = true;
break;
case SDLK_EQUALS:
pressed_[K_EQUALS] = true;
break;
case SDLK_BACKSPACE:
pressed_[K_BACKSPACE] = true;
break;
case SDLK_TAB:
pressed_[K_TAB] = true;
break;
case SDLK_LEFTBRACKET:
pressed_[K_LBRACKET] = true;
break;
case SDLK_RIGHTBRACKET:
pressed_[K_RBRACKET] = true;
break;
case SDLK_BACKSLASH:
pressed_[K_BACKSLASH] = true;
break;
case SDLK_CAPSLOCK:
pressed_[K_CAPSLOCK] = true;
break;
case SDLK_SEMICOLON:
pressed_[K_SEMICOLON] = true;
break;
case SDLK_QUOTE:
pressed_[K_QUOTE] = true;
break;
case SDLK_RETURN:
pressed_[K_ENTER] = true;
break;
case SDLK_LSHIFT:
pressed_[K_LSHIFT] = true;
break;
case SDLK_COMMA:
pressed_[K_COMMA] = true;
break;
case SDLK_PERIOD:
pressed_[K_PERIOD] = true;
break;
case SDLK_SLASH:
pressed_[K_SLASH] = true;
break;
case SDLK_RSHIFT:
pressed_[K_RSHIFT] = true;
break;
case SDLK_LCTRL:
pressed_[K_LCONTROL] = true;
break;
// case SDLK_:
// pressed_[K_FN] = true;
// break;
case SDLK_APPLICATION:
pressed_[K_SUPER] = true;
break;
case SDLK_LALT:
pressed_[K_LALT] = true;
break;
case SDLK_SPACE:
pressed_[K_SPACE] = true;
break;
case SDLK_RALT:
pressed_[K_RALT] = true;
break;
case SDLK_MENU:
pressed_[K_MENU] = true;
break;
case SDLK_RCTRL:
pressed_[K_RCONTROL] = true;
break;
case SDLK_LEFT:
pressed_[K_LEFT] = true;
break;
case SDLK_RIGHT:
pressed_[K_RIGHT] = true;
break;
case SDLK_UP:
pressed_[K_UP] = true;
break;
case SDLK_DOWN:
pressed_[K_DOWN] = true;
break;
default:
break;
}
} else if (event.type == SDL_KEYUP) {
switch (event.key.keysym.sym) {
case SDLK_a:
released_[K_A] = true;
break;
case SDLK_b:
released_[K_B] = true;
break;
case SDLK_c:
released_[K_C] = true;
break;
case SDLK_d:
released_[K_D] = true;
break;
case SDLK_e:
released_[K_E] = true;
break;
case SDLK_f:
released_[K_F] = true;
break;
case SDLK_g:
released_[K_G] = true;
break;
case SDLK_h:
released_[K_H] = true;
break;
case SDLK_i:
released_[K_I] = true;
break;
case SDLK_j:
released_[K_J] = true;
break;
case SDLK_k:
released_[K_K] = true;
break;
case SDLK_l:
released_[K_L] = true;
break;
case SDLK_m:
released_[K_M] = true;
break;
case SDLK_n:
released_[K_N] = true;
break;
case SDLK_o:
released_[K_O] = true;
break;
case SDLK_p:
released_[K_P] = true;
break;
case SDLK_q:
released_[K_Q] = true;
break;
case SDLK_r:
released_[K_R] = true;
break;
case SDLK_s:
released_[K_S] = true;
break;
case SDLK_t:
released_[K_T] = true;
break;
case SDLK_u:
released_[K_U] = true;
break;
case SDLK_v:
released_[K_V] = true;
break;
case SDLK_w:
released_[K_W] = true;
break;
case SDLK_x:
released_[K_X] = true;
break;
case SDLK_y:
released_[K_Y] = true;
break;
case SDLK_z:
released_[K_Z] = true;
break;
case SDLK_ESCAPE:
released_[K_ESC] = true;
break;
case SDLK_F1:
released_[K_F1] = true;
break;
case SDLK_F2:
released_[K_F2] = true;
break;
case SDLK_F3:
released_[K_F3] = true;
break;
case SDLK_F4:
released_[K_F4] = true;
break;
case SDLK_F5:
released_[K_F5] = true;
break;
case SDLK_F6:
released_[K_F6] = true;
break;
case SDLK_F7:
released_[K_F7] = true;
break;
case SDLK_F8:
released_[K_F8] = true;
break;
case SDLK_F9:
released_[K_F9] = true;
break;
case SDLK_F10:
released_[K_F10] = true;
break;
case SDLK_F11:
released_[K_F11] = true;
break;
case SDLK_F12:
released_[K_F12] = true;
break;
case SDLK_PRINTSCREEN:
released_[K_PRINTSCREEN] = true;
break;
case SDLK_INSERT:
released_[K_INSERT] = true;
break;
case SDLK_DELETE:
released_[K_DELETE] = true;
break;
case SDLK_HOME:
released_[K_HOME] = true;
break;
case SDLK_END:
released_[K_END] = true;
break;
case SDLK_PAGEUP:
released_[K_PAGEUP] = true;
break;
case SDLK_PAGEDOWN:
released_[K_PAGEDOWN] = true;
break;
case SDLK_BACKQUOTE:
released_[K_BACKQUOTE] = true;
break;
case SDLK_1:
released_[K_1] = true;
break;
case SDLK_2:
released_[K_2] = true;
break;
case SDLK_3:
released_[K_3] = true;
break;
case SDLK_4:
released_[K_4] = true;
break;
case SDLK_5:
released_[K_5] = true;
break;
case SDLK_6:
released_[K_6] = true;
break;
case SDLK_7:
released_[K_7] = true;
break;
case SDLK_8:
released_[K_8] = true;
break;
case SDLK_9:
released_[K_9] = true;
break;
case SDLK_0:
released_[K_0] = true;
break;
case SDLK_MINUS:
released_[K_MINUS] = true;
break;
case SDLK_EQUALS:
released_[K_EQUALS] = true;
break;
case SDLK_BACKSPACE:
released_[K_BACKSPACE] = true;
break;
case SDLK_TAB:
released_[K_TAB] = true;
break;
case SDLK_LEFTBRACKET:
released_[K_LBRACKET] = true;
break;
case SDLK_RIGHTBRACKET:
released_[K_RBRACKET] = true;
break;
case SDLK_BACKSLASH:
released_[K_BACKSLASH] = true;
break;
case SDLK_CAPSLOCK:
released_[K_CAPSLOCK] = true;
break;
case SDLK_SEMICOLON:
released_[K_SEMICOLON] = true;
break;
case SDLK_QUOTE:
released_[K_QUOTE] = true;
break;
case SDLK_RETURN:
released_[K_ENTER] = true;
break;
case SDLK_LSHIFT:
released_[K_LSHIFT] = true;
break;
case SDLK_COMMA:
released_[K_COMMA] = true;
break;
case SDLK_PERIOD:
released_[K_PERIOD] = true;
break;
case SDLK_SLASH:
released_[K_SLASH] = true;
break;
case SDLK_RSHIFT:
released_[K_RSHIFT] = true;
break;
case SDLK_LCTRL:
released_[K_LCONTROL] = true;
break;
// case SDLK_:
// released_[K_FN] = true;
// break;
case SDLK_APPLICATION:
released_[K_SUPER] = true;
break;
case SDLK_LALT:
released_[K_LALT] = true;
break;
case SDLK_SPACE:
released_[K_SPACE] = true;
break;
case SDLK_RALT:
released_[K_RALT] = true;
break;
case SDLK_MENU:
released_[K_MENU] = true;
break;
case SDLK_RCTRL:
released_[K_RCONTROL] = true;
break;
case SDLK_LEFT:
released_[K_LEFT] = true;
break;
case SDLK_RIGHT:
released_[K_RIGHT] = true;
break;
case SDLK_UP:
released_[K_UP] = true;
break;
case SDLK_DOWN:
released_[K_DOWN] = true;
break;
default:
break;
}
} else if (event.type == SDL_MOUSEMOTION) {
mouseEvent_ = true;
float dx = event.motion.xrel;
float dy = event.motion.yrel;
mouse.dx = dx;
mouse.dy = dy;
mouse.x = event.motion.x;
mouse.y = event.motion.y;
} else if (event.type == SDL_MOUSEBUTTONDOWN) {
switch(event.button.button) {
case SDL_BUTTON_LEFT:
pressed_[M_LEFT] = true;
break;
case SDL_BUTTON_MIDDLE:
pressed_[M_MIDDLE] = true;
break;
case SDL_BUTTON_RIGHT:
pressed_[M_RIGHT] = true;
break;
default:
break;
}
} else if (event.type == SDL_MOUSEBUTTONUP) {
switch(event.button.button) {
case SDL_BUTTON_LEFT:
released_[M_LEFT] = true;
break;
case SDL_BUTTON_MIDDLE:
released_[M_MIDDLE] = true;
break;
case SDL_BUTTON_RIGHT:
released_[M_RIGHT] = true;
break;
default:
break;
}
}
}
return false;
}
bool Input::KeyPressed(KeyCode k) {
return pressed_[k];
}
bool Input::KeyReleased(KeyCode k) {
return released_[k];
}
| cpp |
{
"name": "biubiubiu",
"version": "0.2.0",
"engines": {
"sketch": ">=3.0"
},
"skpm": {
"name": "biubiubiu",
"manifest": "src/manifest.json",
"main": "biubiubiu.sketchplugin",
"assets": [
"assets/**/*"
],
"sketch-assets-file": "sketch-assets/icons.sketch"
},
"scripts": {
"build": "skpm-build",
"watch": "skpm-build --watch",
"start": "skpm-build --watch",
"postinstall": "npm run build && skpm-link"
},
"devDependencies": {
"@skpm/builder": "^0.7.4",
"@skpm/extract-loader": "^2.0.2",
"css-loader": "^3.2.0",
"html-loader": "^0.5.5"
},
"resources": [
"resources/**/*.js"
],
"repository": "https://github.com/ZhouXiaoHong/Biubiubiu",
"description": "sketch 小工具集合, 快速导出图片, 智能导出 css, 以及快速复制文案",
"dependencies": {
"@skpm/dialog": "^0.4.0",
"@skpm/fs": "^0.2.6",
"sketch-module-web-view": "^3.4.3"
},
"author": "ZhouXiaoHong"
}
| json |
export interface IProgram {
path: string;
}
export interface IPrograms {
[name: string]: IProgram;
}
| typescript |
his recently released production venture ‘Tholi Prema’ starring Varun Tej and Raashi Khanna.
The sources close to the producer say that Bogavalli Prasad is willing to team up with Nagarjuna’s younger son Akhil and he has already met with Akhil. Both have agreed to join hands for the project.
Ram Gopal Varma and Puri Jagannadh are willing to helm movie for Akhil but there is no any official confirmation regarding Akhil’s third project.
| english |
package com.example.beatriz.listatcc.Model;
/**
* Created by bpncool on 2/23/2016.
*/
public class Item {
private String name;
private long categoryId;
private long id;
private int nodeId;
public String getOwner() {
return owner;
}
public void setOwner(String owner) {
this.owner = owner;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
private String owner;
private int status;
public void setName(String name) {
this.name = name;
}
public long getCategoryId() {
return categoryId;
}
public void setCategoryId(long categoryId) {
this.categoryId = categoryId;
}
public void setId(long id) {
this.id = id;
}
public Item() {
}
public Item(String name, int id) {
this.name = name;
this.id = id;
}
public long getId() {
return id;
}
public String getName() {
return name;
}
public int getNodeId() {
return nodeId;
}
public void setNodeId(int setNodeId) {
this.nodeId = setNodeId;
}
}
| java |
const MESS: i64 = 0x0123456789ABCDEF;
const KEY: i64 = <KEY>;
fn main() {
let key_plus = generate_key_plus(KEY);
let (left, right) = split_key(key_plus, 56);
let subkey_pairs = create_16_pairs_blocks_32bit(left, right);
let subkeys_48_bit = convert_pairs_to_encrypted_48_bit_keys(&subkey_pairs);
let message_permutation = initial_permutation_of_64bit_message(MESS);
let (left_message, right_message) = split_key(message_permutation, 64);
let last_pair =
generate_last_pair_of_32bit_blocks(left_message, right_message, &subkeys_48_bit);
let encrypted_message = last_permutation_with_ip_table(last_pair);
println!("{:x}", encrypted_message);
}
//Step 1: Create 16 subkeys, each of which is 48-bits long.
const PC1: [u8; 56] = [
57, 49, 41, 33, 25, 17, 9, 1, 58, 50, 42, 34, 26, 18, 10, 2, 59, 51, 43, 35, 27, 19, 11, 3, 60,
52, 44, 36, 63, 55, 47, 39, 31, 23, 15, 7, 62, 54, 46, 38, 30, 22, 14, 6, 61, 53, 45, 37, 29,
21, 13, 5, 28, 20, 12, 4,
];
fn generate_key_plus(key: i64) -> i64 {
let mut key_plus: i64 = 0;
for idx in 0..56 {
let bit_to_add = key >> (64 - PC1[idx]) & 1;
key_plus = key_plus << 1;
key_plus = key_plus | bit_to_add;
}
key_plus
}
fn split_key(key: i64, key_len: u8) -> (i64, i64) {
let half_size = key_len / 2;
let left_half = (key >> half_size) & bit_pattern_ones(half_size);
let right_half = key & bit_pattern_ones(half_size);
(left_half, right_half)
}
const LEFT_SHIFTS: [u8; 16] = [1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1];
fn create_16_pairs_blocks_32bit(left_half: i64, right_half: i64) -> Vec<(i64, i64)> {
let mut subkeys: Vec<(i64, i64)> = Vec::new();
subkeys.push((left_half, right_half));
for idx in 0..16 {
let next_left = bit_rotate_left(subkeys[idx].0, LEFT_SHIFTS[idx], 28);
let next_right = bit_rotate_left(subkeys[idx].1, LEFT_SHIFTS[idx], 28);
subkeys.push((next_left, next_right));
}
subkeys.remove(0);
subkeys
}
fn bit_rotate_left(bit_pattern: i64, rol_count: u8, pattern_len: u8) -> i64 {
let ones_for_rolled_bits = bit_pattern_ones(rol_count) << pattern_len - rol_count;
let rotated_bits = ((ones_for_rolled_bits) & bit_pattern) >> pattern_len - rol_count;
((bit_pattern << rol_count) & bit_pattern_ones(pattern_len)) | rotated_bits
}
fn bit_pattern_ones(how_much: u8) -> i64 {
((2u64).pow(how_much as u32) - 1) as i64
}
const PC2: [u8; 48] = [
14, 17, 11, 24, 1, 5, 3, 28, 15, 6, 21, 10, 23, 19, 12, 4, 26, 8, 16, 7, 27, 20, 13, 2, 41, 52,
31, 37, 47, 55, 30, 40, 51, 45, 33, 48, 44, 49, 39, 56, 34, 53, 46, 42, 50, 36, 29, 32,
];
fn key_kn_from_pair(left: i64, right: i64) -> i64 {
let combined = ((left << 28) | right) << 8;
let mut encrypted_key = 0i64;
for idx in 0..48 {
let combined_bit_at_position = (combined >> (64 - PC2[idx])) & 1;
encrypted_key = encrypted_key << 1;
encrypted_key = encrypted_key | combined_bit_at_position;
}
encrypted_key
}
fn convert_pairs_to_encrypted_48_bit_keys(pairs: &Vec<(i64, i64)>) -> Vec<i64> {
let mut keys_48_bit: Vec<i64> = Vec::new();
for idx in 0..pairs.len() {
keys_48_bit.push(key_kn_from_pair(pairs[idx].0, pairs[idx].1));
}
keys_48_bit
}
//Step 2: Encode each 64-bit block of data.
const IP: [u8; 64] = [
58, 50, 42, 34, 26, 18, 10, 2, 60, 52, 44, 36, 28, 20, 12, 4, 62, 54, 46, 38, 30, 22, 14, 6,
64, 56, 48, 40, 32, 24, 16, 8, 57, 49, 41, 33, 25, 17, 9, 1, 59, 51, 43, 35, 27, 19, 11, 3, 61,
53, 45, 37, 29, 21, 13, 5, 63, 55, 47, 39, 31, 23, 15, 7,
];
//b = bit
fn initial_permutation_of_64bit_message(message: i64) -> i64 {
let mut permutation = 0i64;
for idx in 0..64 {
let bit_at_index_in_message = (message >> (64 - IP[idx])) & 1;
permutation = permutation << 1;
permutation = permutation | bit_at_index_in_message;
}
permutation
}
const E_TABLE: [u8; 48] = [
32, 1, 2, 3, 4, 5, 4, 5, 6, 7, 8, 9, 8, 9, 10, 11, 12, 13, 12, 13, 14, 15, 16, 17, 16, 17, 18,
19, 20, 21, 20, 21, 22, 23, 24, 25, 24, 25, 26, 27, 28, 29, 28, 29, 30, 31, 32, 1,
];
fn encode_function(block_32bit: i64, block_48bit: i64) -> i64 {
let expanded_block = expand_32bit_block_to_48bit_block_using_e_table(block_32bit);
let xored = block_48bit ^ expanded_block;
let shrinked_xor = shrink_48bit_block_to_32bit_block_with_s_tables(xored);
permutate_block_32bit_with_p_table(shrinked_xor)
}
fn expand_32bit_block_to_48bit_block_using_e_table(block: i64) -> i64 {
let mut expanded = 0i64;
for idx in 0..48 {
let bit_at_index = (block >> (32 - E_TABLE[idx])) & 1;
expanded = expanded << 1;
expanded = expanded | bit_at_index;
}
expanded
}
fn shrink_48bit_block_to_32bit_block_with_s_tables(block_48bit: i64) -> i64 {
let mut shrinked = 0i64;
let block_6bit_count = 8;
for idx in 0..block_6bit_count {
let ones_at_block_index = bit_pattern_ones(6) << (42 - 6 * idx);
let only_6bit_block = (ones_at_block_index) & block_48bit;
let block_shited_left = only_6bit_block >> (42 - 6 * idx);
let row_idx = (block_shited_left & 0b00001) | ((block_shited_left & 0b100000) >> 4);
let col_idx = (block_shited_left & 0b011110) >> 1;
let block_4bit =
value_from_s_table_with_index((idx + 1) as u8, row_idx as u8, col_idx as u8) as i64;
shrinked = (shrinked << 4) | block_4bit;
}
shrinked
}
const P: [u8; 32] = [
16, 7, 20, 21, 29, 12, 28, 17, 1, 15, 23, 26, 5, 18, 31, 10, 2, 8, 24, 14, 32, 27, 3, 9, 19,
13, 30, 6, 22, 11, 4, 25,
];
fn permutate_block_32bit_with_p_table(block_32bit: i64) -> i64 {
let mut permutated = 0i64;
for idx in 0..32 {
let bit_at_index = (block_32bit >> (32 - P[idx])) & 1;
permutated = permutated << 1;
permutated = permutated | bit_at_index;
}
permutated
}
fn value_from_s_table_with_index(s_idx: u8, row: u8, col: u8) -> u8 {
match s_idx {
1 if row < 4 && col < 16 => S1[(row * 16 + col) as usize],
2 if row < 4 && col < 16 => S2[(row * 16 + col) as usize],
3 if row < 4 && col < 16 => S3[(row * 16 + col) as usize],
4 if row < 4 && col < 16 => S4[(row * 16 + col) as usize],
5 if row < 4 && col < 16 => S5[(row * 16 + col) as usize],
6 if row < 4 && col < 16 => S6[(row * 16 + col) as usize],
7 if row < 4 && col < 16 => S7[(row * 16 + col) as usize],
8 if row < 4 && col < 16 => S8[(row * 16 + col) as usize],
_ => 0,
}
}
fn produce_right_block_32bit(
left_block_32bit: i64,
prev_right_block_32bit: i64,
block_48bit: i64,
) -> i64 {
left_block_32bit ^ encode_function(prev_right_block_32bit, block_48bit)
}
fn generate_last_pair_of_32bit_blocks(
left_block: i64,
right_block: i64,
blocks_48bit: &Vec<i64>,
) -> (i64, i64) {
let mut pair = (left_block, right_block);
for idx in 0..blocks_48bit.len() {
let next_left = pair.1;
let next_right = produce_right_block_32bit(pair.0, pair.1, blocks_48bit[idx]);
pair = (next_left, next_right);
}
pair
}
const IP_INVERSE: [u8; 64] = [
40, 8, 48, 16, 56, 24, 64, 32, 39, 7, 47, 15, 55, 23, 63, 31, 38, 6, 46, 14, 54, 22, 62, 30,
37, 5, 45, 13, 53, 21, 61, 29, 36, 4, 44, 12, 52, 20, 60, 28, 35, 3, 43, 11, 51, 19, 59, 27,
34, 2, 42, 10, 50, 18, 58, 26, 33, 1, 41, 9, 49, 17, 57, 25,
];
fn last_permutation_with_ip_table(pair: (i64, i64)) -> i64 {
let block = (pair.1 << 32) | pair.0;
let mut permutation = 0i64;
for idx in 0..64 {
let bit_at_index_in_message = (block >> (64 - IP_INVERSE[idx])) & 1;
permutation = permutation << 1;
permutation = permutation | bit_at_index_in_message;
}
permutation
}
//S-Boxes :
const S1: [u8; 64] = [
14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7, 0, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11,
9, 5, 3, 8, 4, 1, 14, 8, 13, 6, 2, 11, 15, 12, 9, 7, 3, 10, 5, 0, 15, 12, 8, 2, 4, 9, 1, 7, 5,
11, 3, 14, 10, 0, 6, 13,
];
const S2: [u8; 64] = [
15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10, 3, 13, 4, 7, 15, 2, 8, 14, 12, 0, 1, 10,
6, 9, 11, 5, 0, 14, 7, 11, 10, 4, 13, 1, 5, 8, 12, 6, 9, 3, 2, 15, 13, 8, 10, 1, 3, 15, 4, 2,
11, 6, 7, 12, 0, 5, 14, 9,
];
const S3: [u8; 64] = [
10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8, 13, 7, 0, 9, 3, 4, 6, 10, 2, 8, 5, 14,
12, 11, 15, 1, 13, 6, 4, 9, 8, 15, 3, 0, 11, 1, 2, 12, 5, 10, 14, 7, 1, 10, 13, 0, 6, 9, 8, 7,
4, 15, 14, 3, 11, 5, 2, 12,
];
const S4: [u8; 64] = [
7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15, 13, 8, 11, 5, 6, 15, 0, 3, 4, 7, 2, 12,
1, 10, 14, 9, 10, 6, 9, 0, 12, 11, 7, 13, 15, 1, 3, 14, 5, 2, 8, 4, 3, 15, 0, 6, 10, 1, 13, 8,
9, 4, 5, 11, 12, 7, 2, 14,
];
const S5: [u8; 64] = [
2, 12, 4, 1, 7, 10, 11, 6, 8, 5, 3, 15, 13, 0, 14, 9, 14, 11, 2, 12, 4, 7, 13, 1, 5, 0, 15, 10,
3, 9, 8, 6, 4, 2, 1, 11, 10, 13, 7, 8, 15, 9, 12, 5, 6, 3, 0, 14, 11, 8, 12, 7, 1, 14, 2, 13,
6, 15, 0, 9, 10, 4, 5, 3,
];
const S6: [u8; 64] = [
12, 1, 10, 15, 9, 2, 6, 8, 0, 13, 3, 4, 14, 7, 5, 11, 10, 15, 4, 2, 7, 12, 9, 5, 6, 1, 13, 14,
0, 11, 3, 8, 9, 14, 15, 5, 2, 8, 12, 3, 7, 0, 4, 10, 1, 13, 11, 6, 4, 3, 2, 12, 9, 5, 15, 10,
11, 14, 1, 7, 6, 0, 8, 13,
];
const S7: [u8; 64] = [
4, 11, 2, 14, 15, 0, 8, 13, 3, 12, 9, 7, 5, 10, 6, 1, 13, 0, 11, 7, 4, 9, 1, 10, 14, 3, 5, 12,
2, 15, 8, 6, 1, 4, 11, 13, 12, 3, 7, 14, 10, 15, 6, 8, 0, 5, 9, 2, 6, 11, 13, 8, 1, 4, 10, 7,
9, 5, 0, 15, 14, 2, 3, 12,
];
const S8: [u8; 64] = [
13, 2, 8, 4, 6, 15, 11, 1, 10, 9, 3, 14, 5, 0, 12, 7, 1, 15, 13, 8, 10, 3, 7, 4, 12, 5, 6, 11,
0, 14, 9, 2, 7, 11, 4, 1, 9, 12, 14, 2, 0, 6, 10, 13, 15, 3, 5, 8, 2, 1, 14, 7, 4, 10, 8, 13,
15, 12, 9, 0, 3, 5, 6, 11,
];
//tests
#[cfg(test)]
#[test]
fn rotatig_bit_with_1_on_firstbit() {
let bit_to_rotate: i64 = 0b1111000011110000111100001111;
assert_eq!(
0b1110000111100001111000011111,
bit_rotate_left(bit_to_rotate, 1, 28)
);
}
#[cfg(test)]
#[test]
fn rotatig_bit_with_2_positions() {
let bit_to_rotate: i64 = 0b1111_0000_1111_0000_1111_0000_1111;
assert_eq!(
0b1100_0011_1100_0011_1100_0011_1111,
bit_rotate_left(bit_to_rotate, 2, 28)
);
}
#[cfg(test)]
#[test]
fn ones_for_2_is_11() {
assert_eq!(0b11, bit_pattern_ones(2));
}
#[cfg(test)]
#[test]
fn creating_vector_with_keys_returns_correct_subkeys() {
let subkeys = create_16_pairs_blocks_32bit(0xf0ccaaf, 0x556678f);
assert_eq!(16, subkeys.len());
//1
assert_eq!(0b1110000110011001010101011111, subkeys[0].0);
assert_eq!(0b1010101011001100111100011110, subkeys[0].1);
//2
assert_eq!(0b1100001100110010101010111111, subkeys[1].0);
assert_eq!(0b0101010110011001111000111101, subkeys[1].1);
//3
assert_eq!(0b0000110011001010101011111111, subkeys[2].0);
assert_eq!(0b0101011001100111100011110101, subkeys[2].1);
//4
assert_eq!(0b0011001100101010101111111100, subkeys[3].0);
assert_eq!(0b0101100110011110001111010101, subkeys[3].1);
//5
assert_eq!(0b1100110010101010111111110000, subkeys[4].0);
assert_eq!(0b0110011001111000111101010101, subkeys[4].1);
//6
assert_eq!(0b0011001010101011111111000011, subkeys[5].0);
assert_eq!(0b1001100111100011110101010101, subkeys[5].1);
//7
assert_eq!(0b1100101010101111111100001100, subkeys[6].0);
assert_eq!(0b0110011110001111010101010110, subkeys[6].1);
//8
assert_eq!(0b0010101010111111110000110011, subkeys[7].0);
assert_eq!(0b1001111000111101010101011001, subkeys[7].1);
//9
assert_eq!(0b0101010101111111100001100110, subkeys[8].0);
assert_eq!(0b0011110001111010101010110011, subkeys[8].1);
//10
assert_eq!(0b0101010111111110000110011001, subkeys[9].0);
assert_eq!(0b1111000111101010101011001100, subkeys[9].1);
//11
assert_eq!(0b0101011111111000011001100101, subkeys[10].0);
assert_eq!(0b1100011110101010101100110011, subkeys[10].1);
//12
assert_eq!(0b0101111111100001100110010101, subkeys[11].0);
assert_eq!(0b0001111010101010110011001111, subkeys[11].1);
//13
assert_eq!(0b0111111110000110011001010101, subkeys[12].0);
assert_eq!(0b0111101010101011001100111100, subkeys[12].1);
//14
assert_eq!(0b1111111000011001100101010101, subkeys[13].0);
assert_eq!(0b1110101010101100110011110001, subkeys[13].1);
//15
assert_eq!(0b1111100001100110010101010111, subkeys[14].0);
assert_eq!(0b1010101010110011001111000111, subkeys[14].1);
//16
assert_eq!(0b1111000011001100101010101111, subkeys[15].0);
assert_eq!(0b0101010101100110011110001111, subkeys[15].1);
}
#[cfg(test)]
#[test]
fn test_spliting_a_56_bit_key_into_2_x_28_keys() {
let original_key = 0b11110000110011001010101011110101010101100110011110001111;
let expected_left = 0b1111000011001100101010101111;
let expected_right = 0b0101010101100110011110001111;
assert_eq!((expected_left, expected_right), split_key(original_key, 56));
}
#[cfg(test)]
#[test]
fn generate_key_plus_based_on_pc1_table() {
let key = 0b0001001100110100010101110111100110011011101111001101111111110001;
let key_plus = 0b11110000110011001010101011110101010101100110011110001111;
assert_eq!(key_plus, generate_key_plus(key));
}
#[cfg(test)]
#[test]
fn creating_key_based_on_pairs_and_pc2_table() {
let left = 0b1110000110011001010101011111;
let right = 0b1010101011001100111100011110;
let expected_key = 0b000110110000001011101111111111000111000001110010;
assert_eq!(expected_key, key_kn_from_pair(left, right));
}
#[cfg(test)]
#[test]
fn creating_48_bit_key_based_on_maximum_pairs() {
let left = 0b1111_1111_1111_1111_1111_1111_1111;
let right = 0b1111_1111_1111_1111_1111_1111_1111;
let expected = 0b1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111;
assert_eq!(expected, key_kn_from_pair(left, right));
}
#[cfg(test)]
#[test]
fn get_48_bit_keys_from_array_of_28_bit_pairs() {
let pairs_28_bit = vec![
(
0b1110000110011001010101011111,
0b1010101011001100111100011110,
),
(
0b1100001100110010101010111111,
0b0101010110011001111000111101,
),
(
0b0000110011001010101011111111,
0b0101011001100111100011110101,
),
(
0b0011001100101010101111111100,
0b0101100110011110001111010101,
),
(
0b1100110010101010111111110000,
0b0110011001111000111101010101,
),
(
0b0011001010101011111111000011,
0b1001100111100011110101010101,
),
(
0b1100101010101111111100001100,
0b0110011110001111010101010110,
),
(
0b0010101010111111110000110011,
0b1001111000111101010101011001,
),
];
let expected = vec![
0b000110110000001011101111111111000111000001110010,
0b011110011010111011011001110110111100100111100101,
0b010101011111110010001010010000101100111110011001,
0b011100101010110111010110110110110011010100011101,
0b011111001110110000000111111010110101001110101000,
0b011000111010010100111110010100000111101100101111,
0b111011001000010010110111111101100001100010111100,
0b111101111000101000111010110000010011101111111011,
];
assert_eq!(
expected,
convert_pairs_to_encrypted_48_bit_keys(&pairs_28_bit)
);
}
#[cfg(test)]
#[test]
fn permutation_of_64bit_integer_gives_58_bit() {
let message_64bit = 0x123456789abcdef;
let intial_permutation = 0xcc00ccfff0aaf0aa_u64 as i64;
assert_eq!(
intial_permutation,
initial_permutation_of_64bit_message(message_64bit)
);
}
#[cfg(test)]
#[test]
fn splitting_key_of_64_bit_into_32_bit_pair() {
let key = 0xcc00ccfff0aaf0aa_u64 as i64;
let left = 0xcc00ccffi64;
let right = 0xf0aaf0aai64;
assert_eq!((left, right), split_key(key, 64));
}
#[cfg(test)]
#[test]
//1111 0000 1010 1010 1111 0000 1010 1010 ->
//0111 1010 0001 0101 0101 0101 0111 1010 0001 0101 0101 0101
fn expand_f0aaf0aa_using_etable_will_result_7a15557a1555() {
let block_32bit = 0b11110000101010101111000010101010;
let expected_block = 0b011110100001010101010101011110100001010101010101;
assert_eq!(
expected_block,
expand_32bit_block_to_48bit_block_using_e_table(block_32bit)
);
}
#[cfg(test)]
#[test]
//0110 0001 0001 0111 1011 1010 1000 0110 0110 0101 0010 0111 ->
//0101 1100 1000 0010 1011 0101 1001 0111
fn shirnk_6117ba866537_using_stable_will_result_5c82b597() {
let block_48bit = 0x6117ba866527;
let expected_output = 0x5c82b597;
assert_eq!(
expected_output,
shrink_48bit_block_to_32bit_block_with_s_tables(block_48bit)
);
}
#[cfg(test)]
#[test]
fn value_in_5th_s_position_2_10_is_12() {
let s_table_index = 5u8;
let row = 2u8;
let col = 10u8;
let expected = 12u8;
assert_eq!(
expected,
value_from_s_table_with_index(s_table_index, row, col)
);
}
#[cfg(test)]
#[test]
fn test_value_from_s_table_is_0_when_row_or_col_is_too_big() {
let s_table_index = 4;
let row = 4;
let col = 15;
let expected = 0;
assert_eq!(
expected,
value_from_s_table_with_index(s_table_index, row, col)
);
}
#[cfg(test)]
#[test]
//1111 0000 1010 1010 1111 0000 1010 1010
//0001 1011 0000 0010 1110 1111 1111 1100 0111 0000 0111 0010
//0010 0011 0100 1010 1010 1001 1011 1011
fn encode_function_returns_234aa9bb() {
let (block_32bit, block_48bit) = (0xf0aaf0aa, 0x1b02effc7072);
let output = 0x234aa9bb;
assert_eq!(output, encode_function(block_32bit, block_48bit));
}
#[cfg(test)]
#[test]
//0101 1100 1000 0010 1011 0101 1001 0111
//0010 0011 0100 1010 1010 1001 1011 1011
fn permutate_5c82b597_by_p_table_will_output_234559bb() {
let input = 0x5c82b597;
let output = 0x234aa9bb;
assert_eq!(output, permutate_block_32bit_with_p_table(input));
}
#[cfg(test)]
#[test]
//l0 = 1100 1100 0000 0000 1100 1100 1111 1111
//r0 = 1111 0000 1010 1010 1111 0000 1010 1010
//K1 = 0001 1011 0000 0010 1110 1111 1111 1100 0111 0000 0111 0010
//R1 = 1110 1111 0100 1010 0110 0101 0100 0100
fn right_block_r1_created_from_l0_r0_k1() {
let l0 = 0xcc00ccff;
let r0 = 0xf0aaf0aa;
let k1 = 0x1b02effc7072;
let r1 = 0xef4a6544;
assert_eq!(r1, produce_right_block_32bit(l0, r0, k1));
}
#[cfg(test)]
#[test]
//l0 = 1100 1100 0000 0000 1100 1100 1111 1111
//r0 = 1111 0000 1010 1010 1111 0000 1010 1010
//L16 = 0100 0011 0100 0010 0011 0010 0011 0100
//R16 = 0000 1010 0100 1100 1101 1001 1001 0101
fn final_pair_is_generated() {
let l0 = 0xcc00ccff;
let r0 = 0xf0aaf0aa;
let l16 = 0x43423234;
let r16 = 0xA4CD995;
//because this 2 functions are tested they are safe to call here
let subkeys = create_16_pairs_blocks_32bit(0xf0ccaaf, 0x556678f);
let keys_block_48bit = convert_pairs_to_encrypted_48_bit_keys(&subkeys);
assert_eq!(
(l16, r16),
generate_last_pair_of_32bit_blocks(l0, r0, &keys_block_48bit)
);
}
#[cfg(test)]
#[test]
fn final_permutation_is_85_e813540_f0_ab405_from_43423234_and_a4_cd995() {
let l16 = 0x43423234;
let r16 = 0xA4CD995;
let permutation = 0x85E813540F0AB405_u64 as i64;
assert_eq!(permutation, last_permutation_with_ip_table((l16, r16)));
}
| rust |
<gh_stars>1-10
import { getMongoRepository, MongoRepository } from 'typeorm';
import { NextMiddleware, NextMiddlewareReturn } from 'middleware-io';
import { Context, Middleware } from '@/core';
import { User } from '@/entities';
const userRepository: MongoRepository<User> = getMongoRepository(User);
export const user = new Middleware({
middleware: async (
context: Context,
next: NextMiddleware
): Promise<NextMiddlewareReturn> => {
let user: User | undefined = await userRepository.findOne({
vkId: context.senderId
});
if (!user) {
user = new User({ vkId: context.senderId });
await userRepository.save(user);
}
context.user = user;
return next();
}
});
| typescript |
The oil is slightly thick and pours cleanly into a teaspoon. The oil is tasteless. If you are not used to take oil, you might find the texture uncomfortable at first. If you hate swallowing pills, please try this one instead. It smells like artificial lemon. Omega-3 helps me focus and improves studying quality. It also helps reduce period pain remarkably. If you suffer from painful menstrual cramps, I highly recommend you give this fish oil a try, but you have to be consistent. You should notice the effect taking place after a month. And make sure you use organic cotton pads - if you do both, I pray that your horrible cramps will disappear within a month. This fish oil is essential to my diet now. I highly recommend! I prefer the orange flavor more.
| english |
The Ministry of Earth Sciences (MoES) has bagged an additional budget allocation of 12 per cent in the Union Budget announced on Tuesday. For the upcoming financial year, the MoES will receive a total of Rs 2,653. 51 crore, with a hike in budgets mainly for the India Meteorological Department (IMD) and the multi-crore and ambitious Deep Ocean Mission.
Funds for IMD have been raised from Rs 469. 75 crore in 2021 – 2022 to 514. 03 crore for the next financial year.
In June last year, the Rs 4,077-crore Deep Ocean Mission was given Union Cabinet approval and it is among MoES projects to bag the highest jump in fund share this year. With this, it is expected that research works would be taken up at an accelerated pace this year. In the upcoming financial year, a sum of Rs 650 crore has been announced for this mission. A estimated Rs 2,823. 4 crore will be spent during the mission’s first phase scheduled between 2021 and 2024.
The mission covers development of technologies for deep sea mining, a manned submersible, development of ocean climate change advisory services, development of technology for exploration, conservation of deep-sea biodiversity and deep ocean survey and setting up of a marine station for ocean biology.
However, the autonomous institutions operating under the aegis of the MoES have not been allotted appreciable hike in their annual budgets. From a total of Rs 183 crore in the last financial year, the five autonomous institutions will be given Rs 199. 07 crore during 2022 – 2023. | english |
The brutal gang-rape and murder of a young veterinarian in Hyderabad has sent shockwaves across the nation. It has sparked anger and once again the issue of women's safety is in the spotlight. When will men learn?
How safe is this country for women? Everyone is debating not only that but also the fact as to what kind of punishment shall be given to those accused of such brutal crimes.
In the wake of the same, BJP MP from Mathura Hema Malini said that the rapists should be kept in jail permanently. This comes a day after Samajwadi Party MP Jaya Bachchan said that the rapists should be brought out in public and lynched.
"Our colleagues raised the issue (of Hyderabad incident). This is important. Every day we are hearing these kinds of things happening to women. They (women) are being harassed. My suggestion is to keep the culprits in jail permanently, once they go in jail they should not be released at all. He should not be out in the society," Hema Malini was quoted as saying by ANI.
Jaya Bachchan on the other hand had said, "These types of people (the rape accused in the Telangana case) need to be brought out in public and lynched. . . I think it is time. . . the people want the government to give a proper and definite answer. "
Should a death sentence be declared for every rapist? It's high time we take a stand now. If we don't do that soon, will our future generations be safe? | english |
package instago
//The JSON type can be used when you do not directly want to parse JSON data into a Go
//struct, or when you are dealing with object types that are unknown or constantly
//changing. The API uses this because a) The structure of some Instagram API requests adds
//a lot of additional unnecessary data that ought not be in the final Go response.
type JSON map[string]interface{}
//Check to see if an interface is a string and if it is not, return an empty string
func JSONString(data interface{}) string {
if str, ok := data.(string); ok {
return str
}
return ""
}
//Check to see if an interface is an int and if it is not it will return 0
func JSONInt(data interface{}) int {
//N.B. The encoding/json library assumes all numbers as float64 but most Instagram
//values are actually integers
return int(JSONFloat(data))
}
//Check to see if an interface is a float(64) and if it is not it will return 0
func JSONFloat(data interface{}) float64 {
if number, ok := data.(float64); ok {
return number
}
return 0
}
//Checks to see if an interface is an array, and if not return an empty array
func JSONArray(data interface{}) []interface{} {
if arr, ok := data.([]interface{}); ok {
return arr
}
return make([]interface{}, 0)
}
//Checks to see if an object is a JSON object and if not, return an empty object
func JSONObject(data interface{}) JSON {
if obj, ok := data.(map[string]interface{}); ok {
return obj
}
return make(map[string]interface{}, 0)
}
//Checks to see if an interface is an array of strings, and if not return an empty string
//array
func JSONStringArray(data interface{}) []string {
arr := JSONArray(data)
strings := make([]string, 0)
for _, v := range arr {
strings = append(strings, JSONString(v))
}
return strings
}
//Check to see if it is an array of objects and if not return an empty JSON object array
func JSONObjectArray(data interface{}) []JSON {
arr := JSONArray(data)
objs := make([]JSON, 0)
for _, v := range arr {
objs = append(objs, JSONObject(v))
}
return objs
}
//Utility wrapper around JSONString
func (json JSON) String(key string) string {
return JSONString(json[key])
}
//Utility wrapper around JSONInt
func (json JSON) Int(key string) int {
return JSONInt(json[key])
}
//Utility wrapper around JSONFloat
func (json JSON) Float(key string) float64 {
return JSONFloat(json[key])
}
//Utility wrapper around JSONArray
func (json JSON) Array(key string) []interface{} {
return JSONArray(json[key])
}
//Utility wrapper around JSONObject
func (json JSON) Object(key string) JSON {
return JSONObject(json[key])
}
//Utility wrapper around JSONStringArray
func (json JSON) StringArray(key string) []string {
return JSONStringArray(json[key])
}
//Utility wrapper around JSONObjectArray
func (json JSON) ObjectArray(key string) []JSON {
return JSONObjectArray(json[key])
} | go |
<reponame>piopawel/modules
package org.motechproject.dhis2.rest.domain;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.codehaus.jackson.map.annotate.JsonSerialize;
/**
* Representation of the DHIS server information, retrieved directly from the DHIS server.
*/
@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class DhisServerInfo {
private String version;
private String serverDate;
private String environmentVariable;
private String dateFormat;
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
public String getDateFormat() {
return dateFormat;
}
public void setDateFormat(String dateFormat) {
this.dateFormat = dateFormat;
}
public String getEnvironmentVariable() {
return environmentVariable;
}
public void setEnvironmentVariable(String environmentVariable) {
this.environmentVariable = environmentVariable;
}
public String getServerDate() {
return serverDate;
}
public void setServerDate(String serverDate) {
this.serverDate = serverDate;
}
}
| java |
<reponame>NJ261/WPFToolkit
[
{
"Id": "460387",
"ThreadId": "217489",
"Html": "<p>Hi,</p>\r\n<p>I'm looking for good samples/tutorials that combine Prism and Ribbon in one application. I want to be able to create a Ribbon Window (that would work as a shell) with Ribbon tabs (which are not a module but rather a static element of a shell) and be able to load modules depending on the tab that is selected by the user. I wrote and application in prism, then tried to migrate it into an application using Ribbon but got all kind of errors. Is there a good example that could teach me how to do that properly?</p>\r\n<p> </p>\r\n<p>Thanks for any help.</p>",
"PostedDate": "2010-06-27T11:48:47.917-07:00",
"UserRole": null,
"MarkedAsAnswerDate": null
}
] | json |
<reponame>SimGus/Chatette
# coding: utf-8
"""
Module `chatette.parsing.lexing.rule_arg_decl`
Contains the definition of the class that represents the lexing rule
to tokenize the declaration of an argument in a unit declaration.
"""
from chatette.parsing.lexing.lexing_rule import LexingRule
from chatette.parsing.lexing import LexicalToken, TerminalType
from chatette.parsing.utils import ARG_SYM, extract_identifier
class RuleArgDecl(LexingRule):
def _apply_strategy(self, **kwargs):
if not self._text.startswith(ARG_SYM, self._next_index):
self.error_msg = \
"Invalid token. Expected an argument declaration there " + \
"(starting with '" + ARG_SYM + "')."
return False
self._next_index += 1
self._update_furthest_matched_index()
self._tokens.append(
LexicalToken(TerminalType.arg_marker, ARG_SYM)
)
arg_name = extract_identifier(self._text, self._next_index)
if arg_name is None:
self.error_msg = \
"Didn't expect the line to end there. Expected an argument name."
return False
elif len(arg_name) == 0:
self.error_msg = \
"Couldn't extract the argument name. Arguments must have a name."
return False
self._next_index += len(arg_name)
self._update_furthest_matched_index()
self._tokens.append(LexicalToken(TerminalType.arg_name, arg_name))
return True
| python |
"use strict";
function preventDefault(e) {
e.preventDefault();
}
exports.onImpl = function (name) {
return function (f) {
return function (state, info) {
// TODO should this use true or false ?
info.element.addEventListener(name, function (e) {
f(e)();
}, true);
};
};
};
exports.onClickImpl = function (makeEvent, button) {
return function (f) {
return function (state, info) {
var element = info.element;
// TODO what about blur, etc. ?
function mouseup(e) {
removeEventListener("mouseup", mouseup, true);
// TODO is this correct ?
if (e.button === button && element.contains(e.target)) {
// TODO what about Macs ?
f(makeEvent(e.shiftKey)(e.ctrlKey)(e.altKey))();
}
}
if (button === 2) {
element.addEventListener("contextmenu", preventDefault, true);
}
// TODO should this use true or false ?
element.addEventListener("mousedown", function (e) {
addEventListener("mouseup", mouseup, true);
}, true);
};
};
};
exports.widget = function (f) {
return function (state) {
return f(state)()(state);
};
};
function setTraits(state, info, attrs) {
var length = attrs.length;
for (var i = 0; i < length; ++i) {
attrs[i](state, info);
}
}
exports.htmlImpl = function (appendChild) {
return function (tag) {
return function (attrs) {
return function (children) {
return function (state) {
var element = document.createElement(tag);
var info = {
// TODO use createElementNS ?
element: element,
styles: {},
properties: {}
};
// This must be before `setTraits`, because otherwise setting the `value` of a `<select>` doesn't work
appendChild(state, info, children);
setTraits(state, info, attrs);
return element;
};
};
};
};
};
exports.textImpl = function (makeText) {
return function (text) {
return function (state) {
return makeText(state, text);
};
};
};
exports.styleImpl = function (setStyle) {
return function (important) {
return function (key) {
return function (value) {
return function (state, info) {
if (info.styles[key] == null) {
info.styles[key] = true;
} else {
throw new Error("Style already exists \"" + key + "\"");
}
// TODO pass in the style rather than the element
return setStyle(state, info.element, key, value, important);
};
};
};
};
};
exports.body = function () {
return document.body;
};
exports.trait = function (traits) {
return function (state, info) {
setTraits(state, info, traits);
};
};
// TODO test this
exports.onDragImpl = function (makeEvent) {
return function (makePosition) {
function getEvent(element, initialX, initialY, e) {
var x = e.clientX;
var y = e.clientY;
var box = element.getBoundingClientRect();
var position = makePosition(box.left)(box.top)(box.width)(box.height);
return makeEvent(initialX)(initialY)(x)(y)(position);
}
return function (threshold) {
return function (onStart) {
return function (onMove) {
return function (onEnd) {
return function (state, info) {
var element = info.element;
var initialX = null;
var initialY = null;
var dragging = false;
// TODO preventDefault ?
// TODO stopPropagation ?
function mousemove(e) {
var event = getEvent(element, initialX, initialY, e);
if (dragging) {
onMove(event)();
} else if (threshold(event)()) {
dragging = true;
onStart(event)();
}
}
// TODO preventDefault ?
// TODO stopPropagation ?
function mouseup(e) {
// TODO don't create this if dragging is false ?
var event = getEvent(element, initialX, initialY, e);
initialX = null;
initialY = null;
removeEventListener("mousemove", mousemove, true);
removeEventListener("mouseup", mouseup, true);
if (dragging) {
dragging = false;
onEnd(event)();
}
}
element.addEventListener("mousedown", function (e) {
// TODO support other buttons ?
// TODO support shift/ctrl/alt
// TODO what about Macs ?
if (e.button === 0 && !e.shiftKey && !e.ctrlKey && !e.altKey) {
initialX = e.clientX;
initialY = e.clientY;
addEventListener("mousemove", mousemove, true);
// TODO what about `blur` or other events ?
addEventListener("mouseup", mouseup, true);
var event = getEvent(element, initialX, initialY, e);
dragging = threshold(event)();
if (dragging) {
onStart(event)();
}
}
}, true);
};
};
};
};
};
};
};
| javascript |
Pakistan’s Joint Investigation Team (JIT) traversed nearly 100 km in the interiors of Pathankot district of Punjab on Tuesday, in a bid to collect evidence regarding the Jaish-e-Mohammad terrorists who were killed at the Pathankot Air Force base after a fierce gun battle on January 2.
A senior government official claimed that the JIT was convinced with the kind of evidence presented before them regarding JeM’s involvement in the attack.
He said the field visit added further weight to India’s claims.
The five-member JIT was put in bullet-proof SUVs and were given a guided tour by the National Investigation Agency (NIA) to all the five crime scenes, where the terrorists either stopped or snatched vehicles before storming the airbase.
Along the dusty roads of Pathankot, the JIT was given a first hand account of the route taken by the terrorists to enter India from Pakistan and finally reach the airbase. Accompanied by Indian officials, the team spent four hours criss-crossing the district.
In an attempt to avoid embarrassing visuals of the Pakistan team entering through the main gate, the JIT was escorted via the rear side of the base, the same place that terrorists snaked in from. The perimeter wall, which was scaled by the terrorists, was broke open at one location to erect a small gate, through which the JIT entered the location.
Barring the scene of crime, where the encounter took place, the entire airbase had been covered with tent clothes to visually block the defence installation from the Pakistan delegation.
The Punjab police commandos tailed the SUVs and a posse of policemen and policewomen followed the cavalcade. The JIT had to walk down a bridge to enter the airbase, because of the circuitous route taken by them to enter the forward air force base that is dedicated for operations against Pakistan.
The NIA said that the JIT was taken to all the places they desired to. “Pakistan JIT had desired to visit all these places and we complied with their request. They were here to see for themselves,” said a senior government official.
The JIT spent only an hour at the airbase and they were taken to the MES dump yard where the terrorists hid before they engaged with the security forces, the DSC mess, where they hid when challenged by the Garud commando and the airmen’s billet, where last of the two terrorists were gunned down.
After visiting the airbase, the team first went to Koliyan village area where former Gurdaspur SP Salwinder Singh was abandoned by terrorists after they snatched his vehicle. The team then went to Kathlor Ka Pul, 40 km away where taxi driver Ikagar Singh was found murdered. They saw a bridge on Unjhh, adjoining Pakistan border, from where the terrorists allegedly crossed over.
Minutes before the JIT reached Pathankot, the Aam Aadmi Party staged a protest outside the main entrance. Posters of “Pakistan SIT, ISI go back” with picture of Delhi Chief Minister Arvind Kejriwal were put up at Pathankot.
NIA DG Sharad Kumar said in New Delhi that they would be asking the JIT to provide them voice samples of Masood Azhar, JeM chief and his brother Abdul Rauf who coordinated the attack at the airbase. | english |
<gh_stars>0
import matplotlib.pyplot as plt
def countvalues(dataframe, subject):
# Filtrem i tractem el dataset
economydf = filtrar(dataframe, "economy")
# el printem
printar(economydf, subject)
# Filtrem ara per subject infected i ho desem en un altre df
infectedf = filtrar(dataframe, "infected")
# Calculem els percentatjes
percentvery = (infectedf['ppl_very'].sum()/infectedf['sample_size'].sum())*100
percentnotatall = (infectedf['ppl_not_at_all'].sum() / infectedf['sample_size'].sum()) * 100
# Els printem
print("percentatge very: {}%".format(percentvery))
print("percentatge not_at_all: {}%".format(percentnotatall))
grafic4('People_Very', 'People_Not_At_All', percentvery, percentnotatall, " % Persones", "Satisfacció", "% de persones preocupades o no per infected")
def printar(df, subject):
# Printem a la consola els valors
print("Valors per subject {}".format(subject))
pplvery = df['ppl_very'].sum()
pplnot = df['ppl_not_at_all'].sum()
print("Very: {}".format(pplvery))
print("Not at All: {}".format(pplnot))
# Finalment, grafiquem
# Cal tancar el grafic per a seguir amb l'execució
grafic4('People_Very', 'People_Not_At_All', pplvery, pplnot, "Persones", "Satisfacció", "Nombre de persones preocupades o no per l'economia")
def filtrar(dataframe, subject1):
df = dataframe[dataframe['subject'].str.contains(subject1, case=False)].copy()
# Afegim els valors en funció del samplesize a dues noves columnes
df['ppl_very'] = df['very'] / 100 * df['sample_size']
df['ppl_not_at_all'] = df['not_at_all'] / 100 * df['sample_size']
return df
def grafic4(label1, label2, valor1, valor2, leyenday, leyendax, titulo):
# Declaramos valors per l'eix x
eje_x = [label1, label2]
# Declaramos valors per l'eix y
eje_y = [valor1, valor2]
# Fem la grafica
plt.bar(eje_x, eje_y)
# Llegenda de l'eix x
plt.ylabel(leyenday)
# Legenda en el eje x
plt.xlabel(leyendax)
# Títol de Grafica
plt.title(titulo)
# Mostrem Grafica
plt.show()
#Funcio per a l'excercici 4.4
def grades(df):
df['538 Grade']=df['538 Grade'].str[0]
print(df.groupby('538 Grade').size())
| python |
<filename>data/uso-styles/130609.json<gh_stars>100-1000
{
"id": 130609,
"name": "kinoprofi.net without ads",
"description": "<h1>kinoprofi.net without ads</h1>",
"user": {
"id": 346158,
"name": "EchoDebug",
"email": "redacted",
"paypal_email": "<EMAIL>",
"homepage": null,
"about": null,
"license": null
},
"updated": "2016-07-24T02:32:51.000Z",
"weekly_install_count": 0,
"total_install_count": 85,
"rating": null,
"after_screenshot_name": "https://userstyles.org/style_screenshots/130609_after.jpeg?r=1609661251",
"obsoleting_style_id": null,
"obsoleting_style_name": null,
"obsolete": 0,
"admin_delete_reason_id": null,
"obsoletion_message": null,
"screenshots": null,
"license": null,
"created": "2016-07-24T02:32:51.000Z",
"category": "site",
"raw_subcategory": "kinoprofi",
"subcategory": "kinoprofi",
"additional_info": "id_author https://userstyles.org/users/346158\r\nauthor <Strong>EchoDebug</storng>",
"style_tags": [],
"css": "@-moz-document url-prefix(\"http://kinoprofi.net\") {\r\ndiv #brnd390697ec7,\r\n#brnd390697ec7 a {\r\n display: none !important;\r\n}\r\nbody {\r\n height: auto;\r\n padding-top: 26px !important;\r\n background: url(https://wallpaperscraft.com/image/black_background_pattern_light_texture_55291_1920x1080.jpg) repeat-y;\r\n background-attachment: fixed;\r\n}\r\nnoindex {\r\n display: none !important;\r\n}\r\n.adblock banner-sidebar,\r\n.adblock,\r\n.banner-top,\r\n#bfd507f1da,\r\n#bn_297e7f7751 {\r\n display: none !important;\r\n}\r\n}",
"discussions": [],
"discussionsCount": 0,
"commentsCount": 0,
"userjs_url": "/styles/userjs/130609/kinoprofi-net-without-ads.user.js",
"style_settings": []
} | json |
The San Diego Padres are reportedly interested in veteran pitcher Johnny Cueto. They were impressed with his 2022 season, where he found quite a bit of success. Cueto had his best ERA since 2018.
San Diego isn't the only team interested in his talents. The Miami Marlins are interested in signing the free-agent pitcher as well.
Cueto is well-respected around the league, and teams know they're getting a quality teammate when they sign him. On days when he isn't pitching, fans can see him talking and joking with other players. Fans usually catch him with a big smile on his face.
In his lone season with the Chicago White Sox, he became one of the most consistent pitchers in their rotation. In 25 games, he amassed a 3.35 ERA with 102 strikeouts. He even threw a complete game last season.
"Marlins and Padres? Welcome to SD," one fan tweeted.
"Come on Preller get a deal done, I'll take Cueto, he had a good year last year," said another fan.
San Diego Padres fans would love to add Cueto to their rotation. It wouldn't cost the team much, and he's a veteran who isn't seeking a long-term contract. It makes a ton of sense why San Diego would be interested in him.
San Diego fans think this is a no-brainer for Johnny Cueto. The Padres are the way to go if he's looking to compete for a World Series title. They've been trying to build something special in San Diego for the past couple of seasons now.
Other fans speculated that some trades are on the horizon. The Miami Marlins don't necessarily need a starting pitcher, but they would if they were to trade one of their own. Teams around the league have been asking Miami about Sandy Alcantara and Pablo Lopez.
The San Diego Padres have gotten inherently better since last season. Their biggest signing, Xander Bogaerts, gives the team one of the most stacked lineups in the league.
The signing will more than likely shift Ha-Seong Kim to second base and a returning Fernando Tatis Jr. to the outfield. Jake Cronenworth will likely start most games at first base.
With the team signing Bogaerts and Tatis Jr. making a return, this San Diego Padres team is scary. Watch for them to make some noise in 2023.
Click here for 2023 MLB Free Agency Tracker Updates. Follow Sportskeeda for latest news and updates on MLB.
| english |
import { EventEmitter } from 'events';
import { AlignmentCache, EmbeddingCache } from '../../cache/';
import { Frame } from '../ui/';
export declare class Validate extends EventEmitter {
frame: Frame;
alignmentCache: AlignmentCache;
embeddingCache: EmbeddingCache;
private grid;
constructor(frame: Frame, alignmentCache: AlignmentCache, embeddingCache: EmbeddingCache);
start(): Promise<void>;
private createMenuElement;
private createDonutElement;
private createProgressElement;
private createOutputElement;
}
| typescript |
<reponame>kind2-mc/kind2-java-api
/*
* Copyright (c) 2020, Board of Trustees of the University of Iowa
* All rights reserved.
*
* Licensed under the BSD 3-Clause License. See LICENSE in the project root for license information.
*/
package edu.uiowa.cs.clc.kind2.results;
/**
* The bool type for kind2
*/
public class Bool extends Type
{
public Bool()
{
super("bool");
}
}
| java |
<filename>sri/animate.css/3.2.1.json
{"animate.css":"sha256-iGg7CkGwf0ZTd8iEaTO9+x5X/JpUrM7z5f0BJb0FLMc=","animate.min.css":"sha256-tI+acDFHSg9z+S8ubLv61zC1RmzalthqRFnAbvyYYXM="} | json |
<gh_stars>10-100
# Link : https://leetcode.com/problems/valid-palindrome-ii/submissions/
# Two pointer approach
# TC : O(n)
class Solution(object):
def validPalindrome(self, s):
"""
:type s: str
:rtype: bool
"""
# Use two pointers at the start and end of the string
# To iterate over the string from the left
a_pointer = 0
# To iterate over the string from the right
b_pointer = len(s) - 1
while(a_pointer <= b_pointer):
# Condition for palindrome is that the charachters must be same when read reverse
# Find the index where the charachters dont match for a_pointer and b_pointer
if(s[a_pointer] != s[b_pointer]):
# Skip the index where the charachters dont match
s1 = s[ : a_pointer] + s[a_pointer + 1 : ]
s2 = s[ : b_pointer] + s[b_pointer + 1 : ]
# Return True if the string is a palindrome after removing one charachter , else false
return (s1 == s1[ : :-1] or s2 == s2[ : :-1])
# Towards right
a_pointer += 1
# Towards left
b_pointer -= 1
return True
| python |
<filename>stories/Navbar/Navbar.stories.tsx
import React from "react"
import { action } from "@storybook/addon-actions"
import Navbar from "../../src/components/Navbar"
export default {
title: "Responsive Navbar",
component: Navbar,
}
export const Nav = () => <Navbar />
| typescript |
Begin typing your search above and press return to search.
Shillong, June 11: Meghalaya Police on Thursday rescued an abducted coal trader identified as Banwarilal Joshi from a remote village in North Garo Hills district. The rescue operation was carried out by a combined force of the state police and the Cobra force of the CRPF. Joshi, a mager of a coal trader from Jogigopha, was kidpped yesterday by a group of GNLA militants from Depa Garet on NH 62 at around 8 am. Prelimiry investigation revealed that GNLA militants identified as Apseng D Shira, Rakban D Shira alias Philiport, Serejing, Tom and 4-5 other associates were involved, a senior police officer stated. | english |
<reponame>JefferyLukas/SRIs
{"inferno-mobx.js":"<KEY>,"inferno-mobx.min.js":"<KEY>} | json |
<filename>java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/invalidComparatorMethodReference/beforeCustomIntegerMax.java
// "Replace with 'Comparator.naturalOrder()'" "false"
import java.util.Arrays;
import java.util.List;
public class Main {
static class Integer {
static int max(int a, int b) {
return a == b ? 0 : a < b ? -1 : 1;
}
}
public static void main(String[] args) {
List<java.lang.Integer> ints = Arrays.asList(3,12,-2,3,-1,-4,4,args.length);
System.out.println(ints.stream().max(Int<caret>eger::max));
}
}
| java |
With a forward PE of 69, Just Dial, listed in June 2013, was the most expensive stock.
Market benchmark appears set to end 2013 on a positive note with modest gain of over 7 pc.
Dalal Street on Friday surged to its highest close in nearly three years as banks and blue chips gained ground.
Cos like Microsoft,PepsiCo,Coca-Cola,unloved on Wall Street,could turn out to be good buys. | english |
<reponame>maxwang/platform-client-sdk-dotnet
---
title: SequenceScheduleNotification
---
## ININ.PureCloudApi.Model.SequenceScheduleNotification
## Properties
|Name | Type | Description | Notes|
|------------ | ------------- | ------------- | -------------|
| **Id** | **string** | | [optional] |
| **Name** | **string** | | [optional] |
| **DateCreated** | **DateTime?** | | [optional] |
| **DateModified** | **DateTime?** | | [optional] |
| **Version** | **int?** | | [optional] |
| **Intervals** | [**List<CampaignScheduleNotificationIntervals>**](CampaignScheduleNotificationIntervals.html) | | [optional] |
| **TimeZone** | **string** | | [optional] |
| **Sequence** | [**DocumentDataV2NotificationCreatedBy**](DocumentDataV2NotificationCreatedBy.html) | | [optional] |
| **AdditionalProperties** | **Object** | | [optional] |
{: class="table table-striped"}
| markdown |
import { MeetingBroadcastRequestDto } from '../../../interfaces/dtos/request/meeting-broadcast-request.dto';
export class StartMeetingBroadcastCommand {
constructor(
public readonly meetingBroadcastRequest: MeetingBroadcastRequestDto,
) {}
}
| typescript |
<reponame>notlaast/python-rsync-system-backup
# rsync-system-backup: Linux system backups powered by rsync.
#
# Author: <NAME> <<EMAIL>>
# Last Change: May 4, 2018
# URL: https://github.com/xolox/python-rsync-system-backup
"""Parsing of rsync destination syntax (and then some)."""
# Standard library modules.
import logging
import os
import re
# External dependencies.
from humanfriendly import compact
from property_manager import (
PropertyManager,
mutable_property,
required_property,
set_property,
)
# Modules included in our package.
from rsync_system_backup.exceptions import (
InvalidDestinationError,
ParentDirectoryUnavailable,
)
RSYNCD_PORT = 873
"""
The default port of the `rsync daemon`_ (an integer).
.. _rsync daemon: https://manpages.debian.org/rsyncd.conf
"""
LOCAL_DESTINATION = re.compile('^(?P<directory>.+)$')
"""
A compiled regular expression pattern to parse local destinations,
used as a fall back because it matches any nonempty string.
"""
SSH_DESTINATION = re.compile('''
^ ( (?P<username> [^@]+ ) @ )? # optional username
(?P<hostname> [^:]+ ) : # mandatory host name
(?P<directory> .* ) # optional pathname
''', re.VERBOSE)
"""
A compiled regular expression pattern to parse remote destinations
of the form ``[USER@]HOST:DEST`` (using an SSH connection).
"""
SIMPLE_DAEMON_DESTINATION = re.compile('''
^ ( (?P<username> [^@]+ ) @ )? # optional username
(?P<hostname> [^:]+ ) :: # mandatory host name
(?P<module> [^/]+ ) # mandatory module name
( / (?P<directory> .* ) )? $ # optional pathname (without leading slash)
''', re.VERBOSE)
"""
A compiled regular expression pattern to parse remote destinations of the
form ``[USER@]HOST::MODULE[/DIRECTORY]`` (using an rsync daemon connection).
"""
ADVANCED_DAEMON_DESTINATION = re.compile('''
^ rsync:// # static prefix
( (?P<username>[^@]+) @ )? # optional username
(?P<hostname> [^:/]+ ) # mandatory host name
( : (?P<port_number> \d+ ) )? # optional port number
/ (?P<module> [^/]+ ) # mandatory module name
( / (?P<directory> .* ) )? $ # optional pathname (without leading slash)
''', re.VERBOSE)
"""
A compiled regular expression pattern to parse remote destinations of the form
``rsync://[USER@]HOST[:PORT]/MODULE[/DIRECTORY]`` (using an rsync daemon
connection).
"""
DESTINATION_PATTERNS = [
ADVANCED_DAEMON_DESTINATION,
SIMPLE_DAEMON_DESTINATION,
SSH_DESTINATION,
LOCAL_DESTINATION,
]
"""
A list of compiled regular expression patterns to match destination
expressions. The patterns are ordered by decreasing specificity.
"""
# Public identifiers that require documentation.
__all__ = (
'logger',
'RSYNCD_PORT',
'LOCAL_DESTINATION',
'SSH_DESTINATION',
'SIMPLE_DAEMON_DESTINATION',
'ADVANCED_DAEMON_DESTINATION',
'DESTINATION_PATTERNS',
'Destination',
)
# Initialize a logger for this module.
logger = logging.getLogger(__name__)
class Destination(PropertyManager):
"""
The :class:`Destination` class represents a location where backups are stored.
The :attr:`expression` property is a required property whose value is
parsed to populate the values of the :attr:`username`, :attr:`hostname`,
:attr:`port_number`, :attr:`module` and :attr:`directory` properties.
When you read the value of the :attr:`expression` property you get back a
computed value based on the values of the previously mentioned properties.
This makes it possible to manipulate the destination before passing it on
to rsync.
"""
@required_property
def expression(self):
"""
The destination in rsync's command line syntax (a string).
:raises: :exc:`.InvalidDestinationError` when you try to set
this property to a value that cannot be parsed.
"""
if not (self.hostname or self.directory):
# This is a bit tricky: Returning None here ensures that a
# TypeError will be raised when a Destination object is
# created without specifying a value for `expression'.
return None
value = 'rsync://' if self.module else ''
if self.hostname:
if self.username:
value += self.username + '@'
value += self.hostname
if self.module:
if self.port_number:
value += ':%s' % self.port_number
value += '/' + self.module
else:
value += ':'
if self.directory:
value += self.directory
return value
@expression.setter
def expression(self, value):
"""Automatically parse expression strings."""
for pattern in DESTINATION_PATTERNS:
match = pattern.match(value)
if match:
captures = match.groupdict()
non_empty = dict((n, c) for n, c in captures.items() if c)
self.set_properties(**non_empty)
break
else:
msg = "Failed to parse expression! (%s)"
raise InvalidDestinationError(msg % value)
@mutable_property
def directory(self):
"""The pathname of the directory where the backup should be written (a string)."""
return ''
@mutable_property
def hostname(self):
"""The host name or IP address of a remote system (a string)."""
return ''
@mutable_property
def module(self):
"""The name of a module exported by an `rsync daemon`_ (a string)."""
return ''
@mutable_property
def parent_directory(self):
"""
The pathname of the parent directory of the backup directory (a string).
:raises: :exc:`.ParentDirectoryUnavailable` when the parent directory
can't be determined because :attr:`directory` is empty or '/'.
"""
directory = os.path.dirname(self.directory.rstrip('/'))
if not directory:
raise ParentDirectoryUnavailable(compact("""
Failed to determine the parent directory of the destination
directory! This makes it impossible to create and rotate
snapshots for the destination {dest}.
""", dest=self.expression))
return directory
@mutable_property
def port_number(self):
"""
The port number of a remote `rsync daemon`_ (a number).
When :attr:`ssh_tunnel` is set the value of :attr:`port_number`
defaults to :attr:`executor.ssh.client.SecureTunnel.local_port`,
otherwise it defaults to :data:`RSYNCD_PORT`.
"""
return self.ssh_tunnel.local_port if self.ssh_tunnel is not None else RSYNCD_PORT
@port_number.setter
def port_number(self, value):
"""Automatically coerce port numbers to integers."""
set_property(self, 'port_number', int(value))
@mutable_property
def ssh_tunnel(self):
"""A :class:`~executor.ssh.client.SecureTunnel` object or :data:`None` (defaults to :data:`None`)."""
@mutable_property
def username(self):
"""The username for connecting to a remote system (a string)."""
return ''
def __enter__(self):
"""Automatically open :attr:`ssh_tunnel` when required."""
if self.ssh_tunnel:
self.ssh_tunnel.__enter__()
return self
def __exit__(self, exc_type=None, exc_value=None, traceback=None):
"""Automatically close :attr:`ssh_tunnel` when required"""
if self.ssh_tunnel:
self.ssh_tunnel.__exit__(exc_type, exc_value, traceback)
| python |
has had a habit of landing his very first ball at the very last spot a batsman wants it. A week ago, he nearly took out Rohit Sharma with a searing yorker. Tonight he pinned Dinesh Chandimal's front pad with a full and fierce inswinger even as the batsman was barely ready to play a shot. The lbw appeal was shot down on height. The final ball of the over was a wide half-volley and Chandimal bashed it through cover. Usually, bowlers tend to err at the start of their spell and then slowly gather rhythm, in Amir's case, it was all spectacularly topsy-turvy.
decided to bowl himself in the Powerplay and Tillakaratne Dilshan top-edged the fourth ball of the fifth over towards short fine leg. It was all perfectly set up for an early wicket, except the fielder was Mohammad Irfan, and it all went comically wrong. He ran forwards when the ball was comfortably sailing over him, then came the frantic change in direction and finally a desperate lunge with his hands. All to no avail. Afridi, who had been watching this precarious sequence, was buckled over with his hands on his knees, as if he felt the entire weight of the criticism back home about his captaincy suddenly and squarely on his shoulders.
With pundits clamoring that his hand-eye coordination has left him, the 39-year old Dilshan offered his humble reply by reverse-scooping Amir to the boundary. It didn't seem premeditated either. He'd gone down only after the ball had been released - perhaps because it was the 19th over and runs took precedence over wickets - kept his eyes on the ball and his head perfectly still before those magic wrists gave the ball just enough power to beat short third man.
Three balls after that outrageous shot, Dilshan went for a slog across the line and outside edge flew to deep third man. Once again Irfan was in the wrong place at the wrong time and this time, he couldn't even get two hands to a relatively simple catch. Meanwhile, Amir, the bowler, was wringing his hands in anger. Perhaps the memory of that incident was still fresh on Amir's mind as he became party to another fielding mishap off the very next ball. Dilshan pushed the penultimate ball of the over to mid-off, but Wahab Riaz slipped on the outfield in his haste to stop the ball beating him. Amir cautioned his fellow left-arm quick not to throw, and so Wahab took his time to stand up and just stare at his team-mates. Dilshan decided to take advantage of Pakistan taking some impromptu downtime and stole a second run.
He was dropped twice; given easy runs; played the shot of the tournament against the bowler of the tournament, so why not try his luck with the ball? Chandimal, Sri Lanka's stand-in captain, brought Dilshan on in the eighth over and it began with a short ball that Sharjeel Khan - who had spanked four beautiful, back-to-back fours off fast bowler Dushmantha Chameera - plopped straight to Chamara Kapugedera at long-on.
| english |
interface IEmit {
(text: string): void;
}
export function createEmitter(writer: NodeJS.WritableStream, padding: string): IEmit {
return (text: string) => {
if (text.includes('\n')) {
text = text.split(/[\n|\r]+/g).join('\n' + padding);
return writer.write(padding + text + '\n');
} else {
return writer.write(padding + text + '\n');
}
};
}
| typescript |
# https://www.codechef.com/problems/COPS
for T in range(int(input())):
M,x,y=map(int,input().split())
m,a = list(map(int,input().split())),list(range(1,101))
for i in m:
for j in range(i-x*y,i+1+x*y):
if(j in a): a.remove(j)
print(len(a)) | python |
For statistics, we note that there are 86 species of these animals on the Earth. The largest whale in the world is blue. In length this giant creation is almost 33 meters! Speaking figuratively, it would fit 30 African or Indian elephants! If we talk about where the whale of such unusual sizes lives, it is the open seas and oceans all over the world. However, this habitat is not only blue, but in general all the living whales.
So, we have learned that the seas and oceans are the places where the whale lives. But for all that, remember that whales are not fish! They breathe lungs like all mammals, not gills like fish. That is why it is extremely necessary for them to rise to the surface of the water from time to time to take a breath. This procedure is accompanied by an extraordinary fountain above sea level. But have whales always lived in water? Of course not! Interestingly, several million years ago, the ancestors of the current cetaceans lived on land, and unlike their descendants, they first moved to shallow water, hiding there from their enemies and hunting small animals at the same time, and after a while completely went to sea. At the same time, their hair completely disappeared from their bodies, and their forelegs turned into fins. The tail took the necessary shape for a comfortable swimming - not vertical, as in fish, but horizontal.
So, where the whale lives, we found out. "Swam" further!
Depending on their zoological species, whales can eat fish, squid, small crustaceans and plankton. The stomach of these animals contains two to three tons of food. They swallow their prey whole, without even trying to chew it. Swim whales very quickly. With their dimensions, they manage to reach speeds of up to 50 kilometers per hour. In addition, these animals are excellent divers. Sperm whale, for example, can dive to depths of up to three thousand meters! And all this thanks to a thick layer of fat, allowing them to dive to such depths, as well as remaining in the overgrown nostril of the whale, as in a bag, air. This gives him the opportunity not to float to the surface for two whole hours. If we talk about how much the whale lives, then this figure reaches 50 years. Whales are viviparous animals. They give birth to live cubs, feeding them with milk, which, by the way, is 10 times more nutritious than cow's milk! Thanks to this, the small kittens grow very fast. It is worth noting that these animals have excellent vision, touch, hearing and not only . . . As it was proved, they are guided by other sensory organs - analyzers. Whales are able to catch ultrasound and infrasound, among themselves, they talk through various sounds. Among other things, whales are very clever animals that can be easily trained!
Where does the whale live - in the tropics or in the ice?
Whales are spread all over the globe, because in the seas and oceans for their movement there are no barriers. They stay in packs, preferring the same place in a certain season, but nevertheless, they have to swim long distances. Depending on the species, whales are divided into heat-loving and lovers of cool waters. For example, a white whale (or beluga whale) lives in polar waters, and killer whales live in the waters of the tropics or subtropics.
The phenomenon of "suicide"
This is a common phenomenon in the life of whales. Throwing themselves ashore, the animal dies. According to one version, this is because people are very much polluting the World Ocean. Another version says that it's all due to own ultrasounds, which sometimes lead to whales. Swiming underwater, the animal sends an ultrasonic signal forward, and the one in the event of an obstacle reflects from it and comes back to the whale (as well as the bats), which, knowing full well that the obstacle ahead is folding. But if the coast is rather flat, then the ultrasonic signal from it will not be reflected, which also misleads the whale: he thinks that water is ahead and is thrown out onto the land at high speed! Take care of whales - save them! | english |
<gh_stars>10-100
{
"directions": [
"Pulse tofu, olive oil, garlic powder, oregano, and basil together in a food processor until crumbly and evenly mixed."
],
"image": "https://images.media-allrecipes.com/userphotos/560x315/7282624.jpg",
"ingredients": [
"1 (16 ounce) package tofu",
"1 tablespoon olive oil",
"1 tablespoon garlic powder",
"1 teaspoon dried oregano",
"1 teaspoon dried basil"
],
"language": "en-US",
"source": "allrecipes.com",
"tags": [],
"title": "Vegan Ricotta",
"url": "http://allrecipes.com/recipe/231476/vegan-ricotta/"
} | json |
{
"java.home": "C:\\Program Files\\Java\\jdk1.8.0_131",
"java.configuration.updateBuildConfiguration": "interactive",
"maven.view": "flat"
} | json |
.ipaddress {
display: flex;
flex-wrap: nowrap;
min-width: 138px;
}
.ipaddress.disabled {
background-color: #efefef;
cursor: not-allowed;
}
.ipaddress .ipv4-cell {
border: none;
max-width: 26px;
}
| css |
<reponame>dianaduran/login-sequelize
var db = require("../models");
module.exports = function(app) {
app.get("/api/user/:email", function(req, res) {
db.User.findOne({
where: {
email: req.params.email
},
include: [db.Task]
}).then(function(dbUser) {
res.json(dbUser);
});
});
app.post("/api/user", function(req, res) {
db.User.create(req.body).then(function(dbUser) {
res.json(dbUser);
});
});
} | javascript |
<filename>Olympiad Solutions/URI/2155.cpp
// <NAME>
// Solution to https://www.urionlinejudge.com.br/judge/problems/view/2155
#include <cstdio>
#include <cmath>
#include <vector>
#include <algorithm>
using namespace std;
const double EPS = 1e-5;
vector<int> resposta;
double menor;
int TC,X[10],Y[10];
int main(){
scanf("%d",&TC);
for(int tc = 1;tc <= TC;tc++){
menor = 1e9;
scanf("%d %d",&X[4],&Y[4]);
vector<int> brute;
for(int i=1;i<=6;i++){
int x,y,id;
scanf("%d %d %d",&id,&x,&y);
X[id] = x;
Y[id] = y;
}
brute.push_back(1);
brute.push_back(2);
brute.push_back(3);
brute.push_back(5);
brute.push_back(6);
brute.push_back(7);
do{
double temp = hypot(X[4] - X[brute[0]], Y[4] - Y[brute[0]]) + hypot(X[4] - X[brute[5]], Y[4] - Y[brute[5]]);
for(int i=0;i+1<6;i++){
temp += hypot(X[brute[i]] - X[brute[i+1]],Y[brute[i]] - Y[brute[i+1]]);
}
if(temp + EPS <= menor){
menor = temp;
resposta = brute;
}
else if(fabs(temp - menor) < EPS){
if(brute < resposta){
resposta = brute;
}
}
//printf("4->");
//for(int i=0;i<6;i++){
// printf("%d->",brute[i]);
//}
//printf("4: %.5lf\n",temp);
}while(next_permutation(brute.begin(),brute.end()));
printf("Caso %d:\n",tc);
printf("4->");
for(int i=0;i<6;i++){
printf("%d->",resposta[i]);
}
printf("4: %.5lf\n",menor);
}
return 0;
}
| cpp |
{
"id": "d469-49",
"text": "-4-\nof this program is \"the more 'public* your broadcasting, the stronger\nyour case will be,\" You must now be serving or planning to serve the\ninterest, convenience, and necessity of the \"publics\" of your community\nwith a quality broadcast signal in order to clear the first hurdle to\nsecuring a grant.\nIf you haven't already done so, you are urged, before making the\ndecision to apply for Federal funds under this program, to take a careful\nlook at your Community Needs for Educational Broadcasting, Before filing\nan application, you should identify the nature and scope of needs within\nyour areas of concern and jurisdiction that can and should be served by the\nbroadcast of radio programs. As a Radio broadcaster, you have an obligation\nto provide a wide range of program services. Unless you have considered the\nentire range of needs of the community to be served for educational,\ncultural, informational, or enrichment programs, and your own willingness\nand authority to serve those needs, your project may not measure up.\nBy now, I'm sure it's becoming more and more evident that the APPLICATION\nyou submit is the key that unlocks the door to a share of the Federal gold\nat the end of the Radio rainbow. However, you have a qualifying heat to run\nfirst. So let's go now to the Application Form which is in*the folder.\nPlease' notice it is only a working draft and not for official distribution or\nuse.\nSince the final form will not be significantly different, this working\ncopy may give you a chance, if you so desire, to study the contents at your\nleisure, to become fully aware of procedures, and to decide how best to\nproceed. Also, the Application Form, rather than the Regulations or\nInstructional Manual,- at this point, is your best guide to the kinds of\ninformation which will be required of you."
} | json |
It is known that Vijay, who is fondly called Thalapathy by his fans is going to work with National Award winning director Vamsi Padipally for an upcoming film #Thalapathy66. The reports are coming that Vamsi Paidipally is planning to bring Rashmika Mandanna on the board to play the female lead in Vijay starrer.
Earlier, the dusky siren Pooja Hegde and Kiara Advani were considered to play the lead roles in the film. But, now the reports are coming that Rashmika Mandanna’ name has been finalized as the female lead. The upcoming film Thalapathy 66 is expected to go on floors in March and the makers are planning to release it on Diwali 2022 or Sankranti 2023.
#Thalapathy66 will be produced by National Award winning producer Dil Raju and Shirish under their production house Sri Venkateswara Creations. The leading production house will be mounting this big budget film on a grand scale. Many noted actors and a top notch technical team will be associated with this project #Thalapathy66. Other details will be announced very soon.
Rashmika Mandanna was last seen in young actor Sharwanand starrer family drama Aadavallu Meeku Johaarlu, which was released last Friday but disappointed many on its release day.
| english |
use anyhow::Result;
use engine::{
glm,
model::Model,
resources::Resources,
window::{event::Event, scancode::Scancode, sdl_window::SdlWindow},
Camera, EngineStateRef, EventResult, Layer, MainLoop,
};
use native_dialog::FileDialog;
use std::path::Path;
struct Triangle {
camera: Camera,
model: Model,
}
impl Triangle {
fn swap_model(&mut self, state: &mut EngineStateRef) -> Option<()> {
let result = FileDialog::new()
.add_filter("glTF Model", &["gltf", "glb"])
.show_open_single_file();
let path = match result {
Ok(Some(path)) => path,
_ => return None,
};
let folder = path.parent()?;
let file = path.file_name()?.to_str()?;
let res = Resources::from_path(&folder);
let model = match Model::from_res(&res, file, &mut state.renderer) {
Ok(model) => model,
Err(e) => {
println!("error: {}", e);
return None;
}
};
self.model = model;
self.set_cam_pos();
Some(())
}
fn set_cam_pos(&mut self) {
let bound = self.model.get_bounds();
self.camera.set_pos(&glm::vec3(
(bound.max_x + bound.min_x) / 2.0,
(bound.max_y + bound.min_y) / 2.0,
bound.max_z * 2.0,
));
let x = bound.max_x - bound.min_x;
let y = bound.max_y - bound.min_y;
let z = bound.max_z - bound.min_z;
// use max, not min so the camera can still move if one of the dimensions
// of the mesh is equal to 0
self.camera.set_speed(x.max(y).max(z) / 5.0)
}
}
impl Layer for Triangle {
fn new(state: &mut EngineStateRef) -> Result<Self> {
let res = Resources::from_exe_path(Path::new("assets"))?;
let model = Model::from_res(
&res,
"sea_keep_lonely_watcher/scene.gltf",
&mut state.renderer,
)?;
let (width, height) = state.window.size();
state.viewport(width, height);
let mut this = Triangle {
model,
camera: Camera::new(),
};
this.set_cam_pos();
Ok(this)
}
fn handle_event(&mut self, state: &mut EngineStateRef, event: &Event) -> EventResult {
match event {
Event::Resize { width, height, .. } => {
state.viewport(*width, *height);
EventResult::Handled
}
// fix issue with mouse movement being limited if the window loses
// and regains focus
Event::FocusGained => {
//state.window.set_mouse_capture(true);
EventResult::Handled
}
Event::FocusLost => {
//state.window.set_mouse_capture(false);
EventResult::Handled
}
Event::KeyDown {
key: Scancode::Escape,
..
} => EventResult::Exit,
Event::KeyDown {
key: Scancode::O, ..
} => {
self.swap_model(state);
EventResult::Handled
}
_ => EventResult::Ignored,
}
}
fn update(&mut self, state: &mut EngineStateRef, dt: f32) {
self.camera.update(state, dt);
}
fn render(&mut self, state: &mut EngineStateRef) -> Result<()> {
state.clear(0.3, 0.3, 0.5);
let (width, height) = state.window.size();
let proj = glm::perspective(
width as f32 / height as f32,
self.camera.get_fov(),
0.1,
10000.0,
);
let view = self.camera.get_view();
self.model.render(state, &proj, &view)?;
Ok(())
}
}
fn main() {
if let Err(e) = run() {
println!("{}", e);
std::process::exit(1);
}
}
fn run() -> Result<()> {
MainLoop::new::<SdlWindow, engine::imgui::ImguiLayer<Triangle>>()?.run()?;
Ok(())
}
| rust |
<reponame>KAMDEMQic/client_Qam
{"ast":null,"code":"import Toast from \"./src\";\nexport { default as BaseToast } from \"./src/components/base\";\nexport { default as SuccessToast } from \"./src/components/success\";\nexport { default as ErrorToast } from \"./src/components/error\";\nexport { default as InfoToast } from \"./src/components/info\";\nexport default Toast;","map":{"version":3,"sources":["/home/theo/Bureau/react/QAM_U/client_Qam/node_modules/react-native-toast-message/index.js"],"names":["Toast","default","BaseToast","SuccessToast","ErrorToast","InfoToast"],"mappings":"AAAA,OAAOA,KAAP;AAEA,SAASC,OAAO,IAAIC,SAApB;AACA,SAASD,OAAO,IAAIE,YAApB;AACA,SAASF,OAAO,IAAIG,UAApB;AACA,SAASH,OAAO,IAAII,SAApB;AACA,eAAeL,KAAf","sourcesContent":["import Toast from './src';\n\nexport { default as BaseToast } from './src/components/base';\nexport { default as SuccessToast } from './src/components/success';\nexport { default as ErrorToast } from './src/components/error';\nexport { default as InfoToast } from './src/components/info';\nexport default Toast;\n"]},"metadata":{},"sourceType":"module"} | json |
What's the story?
Sasha Banks and Bayley recently surprised everyone at a recent set of NXT tapings by turning up with the WWE Women's Tag-Team Titles and making a huge announcement regarding them and the women of NXT.
The Boss 'N' Hug Connection outlasted Mandy Rose and Sonya Deville, Naomi and Carmella, Nia Jax and Tamina, The Riott Squad and The IIconics in an Elimination Chamber match to become the inaugural WWE Women's Tag Team Champions.
Nia Jax and Tamina took clear exception to the pair celebrating the achievement on Monday Night Raw and look set to be the first real challengers for Bayley and Sasha Banks' titles.
But, as was widely reported beforehand, it now seems clear that just because The Boss 'N' Hug Connection are Monday Night Raw Superstars, it doesn't mean their opponents have to be from Monday Night Raw.
That's because the pair invaded NXT to make a huge announcement, making it official that the WWE Women's Tag-Team Titles will be defended on Raw, SmackDown and NXT.
This means that Bayley and Sasha Banks are likely to find themselves popping up everywhere to defend the titles, leading to some really exciting match-ups.
What's next?
It seems that the first challengers from NXT might have already made themselves known thanks to an exchange between the champs and NXT Superstar Candice LeRae, who hints at the fact she's found herself a tag-team partner.
Dakota Kai and Tegan Nox, otherwise known as Team Kick, also seem like strong potential challengers for Banks and Bayley when they've recovered from their respective knee injuries.
Regardless of who it is, that does indeed 'step up', the fact we're going to get new and fresh tag-team match-ups in the Women's Division is a great thing!
Who do you want to see Bayley and Sasha Banks defend their titles against? Leave your thoughts in the comments section below!
| english |
UEFA has opened proceedings against the Champions League match officials involved in the sending off of Istanbul Basaksehir assistant coach Pierre Webo which sparked a player walk-off, Europe’s soccer governing body said on Thursday.
The match at Paris St Germain in December was halted after 13 minutes following an argument on the touchline over the red card shown to Webo and only resumed the following day after the four Romanian officials were replaced.
Webo, a former Cameroon international, said fourth official Sebastian Coltescu disrespected him by referring to him as “the Black one” and an investigation was conducted by a UEFA Ethics and Disciplinary Inspector.
“Proceedings have been opened against Sebastian Constantin Coltescu and Octavian Sovre for a potential violation of Article 11 of the UEFA Disciplinary Regulations,” the governing body said in a statement.
Article 11 deals with general principles of conduct and focuses on breaches such as those which bring the game into disrepute.
Players from both sides, as well as the three new on-field match officials, took a knee before the game resumed the following day with PSG winning 5-1 at the Parc de Princes.
Read all the Latest News, Breaking News and Coronavirus News here(This story has not been edited by News18 staff and is published from a syndicated news agency feed - Reuters) | english |
Konark Dance Festival Odisha(Last Updated 27 Jan, 2023)
Famed as the harbinger of the contemporary festivals of Orissa, the Konark Dance & Music Festival is a matchless extravaganza. Dating back to the year 1986, the fiesta takes place in the backdrop of the famous Sun Temple. Intended to create international cultural brotherhood and amity, the festival lures many artists from worldwide.
Hosted every year, the Konark Dance festival spans for 3 days. The fiesta witnesses participation of the famous classical dance group of national and international repute. Watching the unrivaled talent from different parts of the world perform Kathak, Odissi, Mohiniattam, etc. is a sight to behold. During these 5 days, many other full night shows and local programs leave the spectators in a state of awe.
How Konark Dance Festival is celebrated?
Interestingly, Late Guru Gangadhar Pradhan, the Founder-Director of the festival was also an eminent Odissi dance guru. A joint venture of the Orissa Tourism and the Odissi Research Centre, the Konark Dance Festival flaunts a unique identity. Taking place on the enchanting stage of the Natyashala in the monumental Sun Temple in Konark, the gala is spellbinding.
Dignified performances by the experts of different Indian classical dance forms present the aesthetic and spiritual essence of Orissa. Along with classical dances, a fair is also organized which displays handmade items, handicrafts and stalls specializing in different cuisines of India. The fair adds a special charm to the colorful dance festival.
For five days, the tunes of flute and the rhythmic sounds of ghungroos together with the beats of Phakawaj echo in the Sun Temple, a UNESCO World Heritage Site. All these melodies combine to transfer one into a fantasy. The pits of the platform opened to the sky resemble the stage performances in the famous Shakespearean era.
Konark Dance Festival is held in February every year. The festival is more than a cultural program. It is a boost to the tourism industry. Tourists interested in the exclusive dance forms of India never miss the chance to visit Konark during the dance festival.
- Konark Museum / Archaeological Museum – An ancient museum with four galleries exhibiting 260 various antiques.
- Chandrabhaga Beach / Konark Sea Beach – Reckoned as one of the finest beaches, the beach offers amazing views of the confluence of Chandrabhaga Beach with the Sea.
- Kuruma – Holding great historical significance, Kuruma is one of the major archeological excavation sites which also finds mention in many Buddhists texts.
- Ramachandi Temple and Beach – Dedicated to the Goddess Ramachandi, the temple boasts of an interesting legend associated with it.
- Astaranga Beach – Famous for its natural beauty, the beach casts a spell.
- Maa Mangala Temple – A holy abode of Goddess Mangala, the shrine is one of the Shakti Peethas in Odisha.
- Varahi Devi Temple – Dating back to the 10th-century AD, the temple is home to Goddess Varahi sitting in the lalitasana position.
How to reach Konark?
By Air - Biju Patnaik International Airport, Bhubaneswar (62 km)
By Train - Puri Railway Station (37.4 km)
By Road - Bhubaneswar (58.4 km)
| english |
Can you solve this math problem correctly using BODMAS before this dog does?
The video shows the dog named Luna correctly answering a simple math problem. Can you solve it correctly using BODMAS before her?
Almost all of us have used BODMAS to solve simple math problems in schools, colleges and elsewhere. While some have a hard time remembering the order, others love solving problems that require BODMAS. And the satisfaction when we correctly answer the equations or problems is unmatched. Right? Now, a video of a dog solving a math problem is doing the rounds on social media, and his ability to answer it correctly has stunned many. So, if you like the subject and love applying BODMAS to mathematical problems, solve this one before the dog answers it correctly. You only have a few seconds to do so.
"She knew she got it right at the end," read the caption of the video. In it, one can see a furry pet named Luna sitting in the back seat of a car, and her pet parent poses a math problem to her. He says, "What's ten divided by two plus one minus one? " The dog then thinks intently at her pet parent and answers correctly with the help of her paw. For those unable to solve (10/2)+1-1, the correct answer is 5.
Watch the video below:
The video that showcases a Mini Cockapoo correctly answering a math problem was shared on Instagram on October 7, and it has garnered more than 2. 7 lakh views and tons of comments.
"Luna you're a genius! " read a response from an Instagram page dedicated to a dog. "Luna DESERVES a place at Harvard. . . ," posted an individual. "Her eyes when she thinks," commented another. "I could see her doing the math in her head," wrote a third. "She can't wait to give those kisses," remarked a fourth. Were you able to answer the math problem correctly before the dog? | english |
Two of the biggest mainframe software companies, BMC and Compuware, are integrating three key technologies which they say will drive mainframe cost savings for customers.
They say that web, mobile, and Internet of Things applications are drive increasing mainframe transaction volumes, driving up costs which CIOs need to keep under control.
The companies said the integrations are the first of several they plan as part of a broader partnership that also includes use of each other's technology within their own organizations.
The three technologies are:
The companies point to one integration which uses BMC Cost Analyzer to call Compuware Strobe for a detailed analysis of the specific application component for peak MLC periods. This allows the customer to proactively tune applications that have the greatest impact on their monthly software licensing costs, the companies said.
Integration with BMC MainView allows customers to either automatically or manually invoke Strobe performance analysis, letting mainframe staff more quickly and consistently perform cost-saving while tuning tasks.
According to Bill Miller, president of ZSolutions and Select Technologies for BMC, "The integration of our key solutions helps mainframe customers achieve even greater cost efficiencies as they cope with the challenging combination of intensifying business demand and tight resource constraints."
Further Reading:
| english |
From UPSC perspective, the following things are important :
The article highlights the issues facing the judiciary in India and emphasises the need for addressing these issues.
- Today, the judiciary, especially the SC, is called upon to decide a large number of cases in which the government has a direct interest.
- These can be politically sensitive cases too.
- The framers of the Constitution understood the importance of the oath of office of judges of the Supreme Court of India (SC) and carefully designed its language.
- The words, “without fear or favour” to “uphold the constitution and the laws” are extremely significant and stress the need for a fiercely independent court.
- The Chief Justice of India is the first amongst the equals but by the virtue of his office assumes significant powers as the Master of the Roster to constitute benches and allocate matters.
- The SC has re-affirmed this position in a rather disappointing decision in Campaign for Judicial Accountability and Reforms v. Union of India, (2018).
- The result has been catastrophic.
- Many matters were either treated casually or deflected for no reason from serious hearing.
- The SC is expected to seek strict accountability from the legislature and executive and any infraction of the Constitution and laws must be corrected.
- Yet, this is not happening.
- A country of billion-plus needs its highest court to stand for the people, not seemingly for the executive of the day.
- The judiciary is besieged by inherent and fundamental challenges.
- Millions of pending cases, quality of judges and their decisions, organisational issues and its integrity and impartiality, need urgent attention.
- Yet, in the last two decades precious little has been done.
- Justice is eluding the common man, including the vulnerable sections of society.
- The new Chief Justice must seriously introspect and free himself of the bias in constituting benches and allocating cases and take concrete steps to revitalise the administration of justice.
- Only then will the rule of law be restored and the Constitution served.
The Chief Justice of India on account of the position he holds as paterfamilias of the judicial fraternity, was suspected by none other than Dr B R Ambedkar. Let us hope the new Chief Justice makes serious efforts to prove otherwise.
From UPSC perspective, the following things are important :
- The Industrial Revolution restructured the global manufacturing order to Asia’s disadvantage.
- But in the ‘Digital Data Revolution’, algorithms requiring massive amounts of data determine innovation, the nature of productivity growth, and military power.
- Mobile digital payment interconnections impact society and the international system, having three strategic implications.
- Because of the nature and pervasiveness of digital data, military and civilian systems are symbiotic.
- Cybersecurity is national security, and this requires both a new military doctrine and a diplomatic framework.
- The blurring of distinctions between domestic and foreign policy and the replacement of global rules with issue-based understanding converge with the growth of smartphone-based e-commerce, which ensures that massive amounts of data give a sustained productivity advantage to Asia.
- Data streams are now at the centre of global trade and countries’ economic and national power.
- India, thus, has the capacity to negotiate new rules as an equal with the U.S. and China.
- Innovation based on data streams has contributed to China’s rise as the second-largest economy and the “near-peer” of the U.S.
- The national security strategy of the U.S. puts more emphasis on diplomacy than military power to resolve conflicts with China, acknowledging that its military allies have complex relationships with Beijing, as it seeks to work with them to close technology gaps.
- China’s technology weakness is the dependence on semiconductors and its powerlessness against U.S. sanctions on banks, 5G and cloud computing companies.
- But China’s digital technology-led capitalism is moving fast to utilise the economic potential of data, pushing the recently launched e-yuan and shaking the dollar-based settlement for global trade.
- China has a $53-trillion mobile payments market and it is the global leader in the online transactions arena, controlling over 50% of the global market value.
- India’s Unified Payments Interface (UPI) volume is expected to cross $1 trillion by 2025.
- The U.S., in contrast, lags behind, with only around 30% of consumers using digital means and with the total volume of mobile payments less than $100 billion.
- The global strategic balance will depend on new data standards.
- The U.S., far behind in mobile payments, is falling back on data alliances and sanctions to maintain its global position.
- With Asia at the centre of the world, major powers see value in relationships with New Delhi.
- India fits into the U.S. frame to provide leverage.
- China wants India, also a digital power, to see it as a partner, not a rival.
- And China remains the largest trading partner of both the U.S. and India despite sanctions and border skirmishes.
- India, like China, is uncomfortable with treating Western values as universal values and with the U.S. interpretation of Freedom of Navigation rules in others’ territorial waters.
- New Delhi’s Indo-Pacific vision is premised on “ASEAN centrality and the common pursuit of prosperity”.
- The European Union recently acknowledged that the path to its future is through an enhanced influence in the Indo-Pacific, while stressing that the strategy is not “anti-China”.
- The U.S. position in trade, that investment creates new markets, makes it similar to China’s Belt and Road Initiative.
India alone straddles both U.S. and China-led strategic groupings, providing an equity-based perspective to competing visions. It must be prepared to play a key role in moulding rules for the hyper-connected world, facing off both the U.S. and China to realise its potential of becoming the second-largest economy.
From UPSC perspective, the following things are important :
The article deals with the issues of different prices set for the Covid vaccine and its implications.
- Vaccines have a positive externality; it is a good whose consumption benefits not just the one who has it.
- A vaccinated person is not only relatively protected against the disease himself/herself, but also less likely to transmit it to others.
- Usually, a person getting vaccinated takes into account only his/her own cost and benefit, while ignoring the fact that he/she lowers the chances of infecting others.
- It is the opposite of smoking, which has “negative externality”.
- Since every individual ignores the full set of benefits/costs from consuming goods with positive/negative externalities, the market isn’t always the most efficient mechanism for allocation of such goods.
- That is a key reason why governments treat goods having large positive externalities as “public goods” and provide these while factoring in the full costs and benefits to society.
- It requires vaccine manufacturers to supply 50 per cent of their production to the Centre at controlled prices, while allowing them to sell the remaining half in the open market including to state governments at pre-announced “self-set” prices.
- To start with, the new policy can lead to differential access to the vaccine.
- Manufacturers are supposed to “transparently declare” their prices in advance for their 50 per cent supply to the open market.
- But there is no limit per se on the retail price they would charge.
- This could lead to a whole range of prices and vaccine inequality, apart from diversion of supplies from the controlled low-price government centres to the open market.
- So, we may well have scarcity in the “mass” segment co-existing with a glut in the “elite” segment.
- There is also concerns about economic efficiency and the potential for market failure.
- Imagine there are two sets of people in India.
- The first consists of those who are better off and can afford to stay back or work from home.
- This lot is also less likely to cause infection to others.
- The second set is mostly blue-collar workers, small traders, vendors and agriculturists.
- The nature of their work — on the shop floor or in the field — makes them naturally prone to infect others.
- It follows, then, that society gains from first vaccinating the latter, as they have a higher negative externality.
- The market will ignore those with lower purchasing power, despite them having a higher probability of spreading the disease.
- In fact, the bigger the income difference between the two segments, the greater will be the extent of market failure from simultaneous over-provisioning and under-provisioning.
- The solution could be a single price to be paid to vaccine makers for all the doses that they supply.
- The price should be high enough to stimulate them to rapidly ramp up production.
- Those government should pay directly to the vaccine maker or the hospital administering the dose for those without sufficient means.
- The suggested solution is similar to the fertiliser subsidy, which is now disbursed to companies only after actual sales to farmers.
A single price for Covid-19 vaccines will stimulate production, ensure efficient vaccination.
From UPSC perspective, the following things are important :
- ICMR said that a small fraction of those vaccinated with either Covaxin or Covishield have tested positive (i.e. breakthrough” infections).
- However, these instances do not undermine the efficacy of the vaccines.
- The immune response begins to develop usually two weeks after every dose and there are variations within individuals, too.
- Of the 9.3 million who received the first dose of Covaxin, 4,208 tested positive; and of the 1.7 million who received the second dose, 695 tested positive.
- For Covishield, of the 100.3 million who received the first dose, 17,145 tested positive; and of the 15 million who got the second dose, 5,014 tested postive.
- Healthcare and frontline workers, who were among the first to be vaccinated, were as a population far more exposed to the virus and therefore more susceptible.
- Secondly, the emergence of “the highly transmissible second wave (newer variants) ” may have contributed to instances of infection among those vaccinated.
- Several variants, which have mutations that have been shown to avoid detection by the immune system, and in some cases reduce the efficacy of vaccines, have been reported globally, including in India.
From UPSC perspective, the following things are important :
The article suggests the need for reforms in the process of appointment to the police chief to ensure the political neutrality of the police.
- A crucial way in which governments exercise control over the State police is through their unregulated power to decide who the chief will be.
- There is no independent vetting process to assess the suitability of qualified candidates, and the government’s assessment, if it is done at all, remains opaque and is an exercise behind closed doors.
- The moot reform issue is in ensuring the right balance between the government’s legitimate role in appointing or removing the police chief with the need to safeguard the chief’s operational autonomy.
Two elements are vital to reforms in this area.
- The National Police Commission (NPC) (1979), and the Supreme Court in its judgment in 2006, in the Prakash Singh case suggested establishing a state-level oversight body with a specified role in the appointment and removal of police chiefs.
- While the Supreme Court entrusted the Union Public Service Commission (UPSC) with a role in shortlisting candidates from which the State government is to appoint the police chief.
- However, the Model Police Bill, 2015 places the responsibility with a multiparty State Police Board, also referred to as the State Security Commission (SSCs) instead.
- While 26 States and the Union Territories have established SSCs, not a single one adheres to the balanced composition suggested by the top court.
- Some do not include the Leader of the Opposition; others neither include independent members nor follow an independent selection process of the members.
- In essence, the commissions remain dominated by the political executive.
- Moreover, in as many as 23 States, governments retain the sole discretion of appointing the police chief. Assam, Jharkhand, Karnataka, Meghalaya and Mizoram are the only States where, on paper, the SSC is given the responsibility of shortlisting candidates.
- The second element critical to police reforms is instituting an independent and transparent selection and decision-making process around appointment and removal, against objective criteria.
- On appointments, the Court and the Model Police Act require the UPSC/SSC to shortlist candidates on the basis of length of service, service record, and range of experience and a performance appraisal of the candidates over the past 10 years.
- However, no further guidance has been developed on explaining these terms or specifying their elements.
- Similarly, no scrutiny process has been prescribed to justify removals from tenure posts.
- The National Police Commission had required State governments to seek the approval of the State Security Commission before removing the police chief before the end of term.
- This important check was diluted under the Prakash Singh judgment that only requires governments to consult the SSC.
- Most States omit even this cursory step.
- The Supreme Court has rightly emphasised that “prima facie satisfaction of the government” alone is not a sufficient ground to justify removal from a tenure post in government, such as that of the police chief (T.P. Senkumar vs Union of India, 2017).
- The rule of law requires such decisions be for compelling reasons and based on verifiable material that can be objectively tested.
- Clear and specific benchmarks need to be integrated into decision-making processes, both on appointments and removals, to prevent politically motivated adverse actions.
- In improving transparency the United Kingdom provides a useful example by introducing public confirmation hearings as an additional layer of check for the appointment of the heads of their police forces.
Reforms are needed on urgent to ensure fairness in administrative decisions and to protect the political neutrality of the police. Any further delay in implementing reforms in this area will continue to demoralise the police and cripple the rule of law.
From UPSC perspective, the following things are important :
Green hydrogen could help significantly in India’s transition to low carbon future. However, there are several challenges in ramping up its manufacturing. The article suggests measures to deal with these challenges.
- India will soon join 15 other countries in the hydrogen club as it prepares to launch the National Hydrogen Energy Mission (NHEM).
- India will soon join 15 other countries in the hydrogen club as it prepares to launch the National Hydrogen Energy Mission (NHEM).
- In 2030, according to an analysis by the Council on Energy, Environment and Water (CEEW), green hydrogen demand could be up to 1 million tonnes in India across application in sectors such as ammonia, steel, methanol, transport and energy storage.
Several challenges in scaling up to commercial-scale operations persist. Following are five recommendations.
- Decentralised hydrogen production must be promoted through open access of renewable power to an electrolyser (which splits water to form H2 and O2 using electricity).
- Currently, most renewable energy resources that can produce low-cost electricity are situated far from potential demand centres.
- Producing oxygen at such locations and then shipped, it would significantly erode the economics of it.
- A more viable option would be wheeling electricity directly from the solar plant.
- However, the electricity tariffs could double when supplying open-access power across State boundaries.
- Therefore, operationalising open access in letter and spirit, as envisioned in the Electricity Act, 2003, must be an early focus.
- To minimise intermittency associated with renewable energy, for a given level of hydrogen production capacity, a green hydrogen facility will store hydrogen to ensure continuous hydrogen supply.
- Therefore, as we scale up to the target of having 450 GW of renewable energy by 2030, aligning hydrogen production needs with broader electricity demand in the economy would be critical.
- We must take steps to blend green hydrogen in existing processes, especially the industrial sector.
- Improving the reliability of hydrogen supply by augmenting green hydrogen with conventionally produced hydrogen will significantly improve the economics of the fuel.
- This will also help build a technical understanding of the processes involved in handling hydrogen on a large scale.
- Policymakers must facilitate investments in early-stage piloting and the research and development needed to advance the technology for use in India.
- The growing interest in hydrogen is triggered by the anticipated steep decline in electrolyser costs.
- Public funding will have to lead the way, but the private sector, too, has significant gains to be made by securing its energy future.
- India must learn from the experience of the National Solar Mission and focus on domestic manufacturing.
- Establishing an end-to-end electrolyser manufacturing facility would require measures extending beyond the existing performance-linked incentive programme.
- India needs to secure supplies of raw materials that are needed for this technology.
- Further, major institutions like the DRDO, BARC and CSIR laboratories have been developing electrolyser and fuel-cell technologies.
Hydrogen may be lighter than air, but it will take some heavy lifting to get the ecosystem in place.
From UPSC perspective, the following things are important :
- Covid reminds us that a modern state is a welfare state as governments worldwide launched 1,600 plus new social protection programmes in 2020.
- Sustainable social security lies in raising India’s 138th ranking in country per-capita GDP.
- However, on the social security schemes, there is a case for three reforms to our biggest health insurance and pension schemes:
- These schemes are the Employee State Insurance Scheme (ESIS) and Employee Provident Fund (EPF).
- The Employee State Insurance Scheme (ESIS) is India’s richest and biggest health insurance scheme with 13 crore people covered and Rs 80,000 crore in cash.
- Employers with more than 10 employees make a mandatory 4 per cent payroll deduction for employees earning up to Rs 21,000 per month.
- Despite covering roughly 10 per cent of India’s population, a recent working paper from Dvara Research suggests high dissatisfaction.
- The constraint is hardly resources: ESIC’s unspent reserves are larger than the Central government’s healthcare budgetary allocation.
- EPF is India’s biggest pension scheme with a Rs 12 lakh crore corpus and 6.5 crore contributors.
- Employers with more than 20 employees make mandatory 24 per cent payroll deductions for employees earning up to Rs 15,000 per month.
- It only covers 10 per cent of India’s labour force and 60 per cent of accounts and 50 per cent of registered employers are inactive.
- EPF offers poor service and pathetic technology despite employer-funded administrative costs that make it the world’s most expensive government securities mutual fund.
- In a book titled What We Owe Each Other: A New Social Contract, Nemat Shafik suggests updating the risk-sharing framework in societies.
- This is because current structures are breaking up under the weight of changes in the role of women, longer careers, technology, globalisation, and much else.
- She suggests a more nuanced social security redistribution across time (the piggy bank function), incomes (the Robin Hood function), and financial burden-bearing (the state, individuals, or employers).
- In India, the answer lies in fixing the problems of EPF and ESIS.
- Both suffer from poor coverage, high costs, unsatisfied customers, metrics confused with goals, jail provisions, excessive corruption, low expertise, rude and unaccountable staff with no fear of falling or hope of rising, and no competition.
Let’s look at possible solutions.
- EPF and ESIS combine the roles of policymaker, regulator, and service provider.
- Splitting roles is a precondition for performance because goals, strategy, and skills are different.
- An independent policymaker horrified with only 6 lakh of India’s 6.3 crore enterprises covered would create competition.
- An independent regulator terrified by ESIS overcharging would frown on a claims ratio of less than 75 per cent.
- An independent service provider would invest heavily in technology, customer service, and human capital.
- Splitting roles would lead to the following benefits:
- 1) Competition from NPS for EPF.
- 2) Ending VIP opt-out by merging CGHS with ESIS,
- 3) Raising enforceability by making employee provident fund contribution voluntary.
- 4) Improving portability by de-linking accounts from employers.
- 5) Targeting universalisation by simultaneously ending minimum employer head-count and employee salary contribution thresholds while introducing absolute contribution caps.
- The Health and Finance Ministry would be logical homes for ESIS and EPF policy roles.
- The governing board of ESIS and EPFO have 59 and 33 members respectively.
- Such a large group can’t have meaningful discussions, make decisions, and exercise oversight.
- This governance deficit needs smaller boards (not more than 15), age limits, term limits, expertise, active sub-committees (HR, Investments, and technology) and real powers.
- Health and pensions need complex skills developed over time.
- Yet, ESIS and EPF are led by generalist bureaucrats.
- Both organisations need professional chief executives.
- Philosopher Isaiah Berlin’s framing of the generalist vs specialist debate as hedgehogs (who know one thing) and foxes (who know many things) is important.
- A less generalist, non-transitory, and non-cadred chief executive would create a new tone-from-the-top around performance management, technology, and service outcomes.
Social security — not a borrowing binge that steals from our grandchildren — can blunt structural and COVID inequality when combined with complementary policies like formalisation, financialisation, urbanisation, and better government schools. But a great place to start is three flick-of-pen, non-fiscal reforms at EPF and ESIS.
From UPSC perspective, the following things are important :
We need a comprehensive FDI policy on trade to take care of the needs of all the stakeholders. The article highlights the issues faced by the e-commerce sector in relation to the FDI policy.
- With their efficient, quick and reliable logistics network, e-commerce platforms have nudged consumer behaviour patterns from an offline to an online shopping mode.
- During the pandemic, e-commerce emerged as an enabler in ensuring the availability of essentials to the masses.
- E-commerce is going to be increasingly important in the future of retail shopping in India and the world over.
- It is estimated to become a $100 billion industry by 2024, which was at $38.5 billion until 2017.
- The trend will continue to grow with the government’s impetus on digital literacy, also supported by the increasing penetration of internet and smartphone users.
- However, what the sector lacks is the bandwidth of operation.
- In addition to the FDI Policy/FEMA, other laws such as IT Act, Consumer Protection Act, and those pertaining to IP and copyright, regulate the e-commerce sector in India.
- Of these, the FDI policy plays an important role as massive investments are needed to build and strengthen the entire ecosystem of the e-commerce sector in the country.
- FDI policies on trade have evolved over time as policy-making was done from time to time mostly responding to the needs of the market coupled with political feasibility.
- Thus, FDI policy in cash and carry or wholesale B2B operations is different (100 per cent FDI allowed under automatic route) compared to highly restrictive FDI policy on retail B2C trade.
- Similarly, an artificial distinction was created between single-brand retail and multi-brand retail as opposition to multi-brand retail was strong: 100 per cent FDI is allowed under automatic route in single-brand retail whereas FDI regime in multi-brand retail is quite restricted.
- E-commerce is not allowed under FDI policy in multi-brand retail.
- The FDI policy on e-commerce is quite different as e-commerce platforms are allowed to work only as a marketplace with permission to provide certain specified services to sellers and buyers.
- However, FDI is allowed in the inventory model when these platforms sell fresh farm produce made in India.
- There is no specific policy on FDI in e-commerce for exports.
- The rapid expansion of the retail, organised retail as well e-commerce sector in India in the coming years will create huge opportunities for all.
- The policies that have evolved over time need a relook to balance the interests of all in a win-win policy.
- Today, our small businesses employing an exceptionally large number of workers need to use e-commerce more and more to augment their sales.
- E-commerce provides them with the means to access a much bigger market without having to overly invest in marketing. This should include more and more foreign markets.
- Consumers have benefited enormously from e-commerce.
- Also, the harmonious working of online and offline retailers is essential.
- With GST and the drive towards digitisation, more small traders need to be enabled to make the transition and take advantage of the expanding opportunities.
Public policy on e-commerce needs to place an equal premium on the views and interests of all the stakeholders in the ecosystem to strengthen our domestic businesses and create many more jobs and livelihood opportunities in the country to fulfil the dreams of Atmanirbhar Bharat.
From UPSC perspective, the following things are important :
The article explains the issues with the two common themes adopted for explaining the Naxal movement in India.
- The recent attack in and around Tekulagudem village in Sukma district demonstrates the threat posed by Maoists.
- The post-incident analysis of such setbacks comes in two flavours.
- The most popular theory amongst our intelligentsia and media is the root cause and alienation approach.
- This approach states that it is the failure of the Indian state to provide economic development and social justice to the tribals living in these areas that has fuelled the Naxal movement and sustained it for five decades.
- As a prescription, a development-centric approach and negotiations are suggested as the way forward.
- There are several problems with this approach.
- First, it ignores the ideological foundations of the movement, specifically its rejection of India’s Constitution and democracy.
- Second, it fails to see that social and economic deprivation is not unique to the jungles of Chhattisgarh.
- Third, it doesn’t account for the possibility that while alienation and deprivation may help in igniting the spark of revolution, once lit the flames draw oxygen from many sources.
- Fourth, the role of external forces in fomenting and sustaining this movement is deliberately underplayed.
- Fifth, the grubby ground reality of the praxis of revolution is conveniently swept under the carpet.
- The organised extortion racket from all economic stakeholders in the Naxal-affected areas by our alienated revolutionaries seldom gets talked about.
- Sixth, the extensive ideological, financial and logistical ecosystem that provides sustenance to these revolutionaries in the jungle is seldom acknowledged.
- According to this view, our tactical failures against the Maoists are entirely due to the poor quality of leadership provided by the Indian Police Service.
- The when, where, how of a setback simply don’t matter.
- When in doubt, identify the first IPS officer in the chain of command and hoist him on the petard of tactical incompetence.
- This view completely ignores the many successes of IPS leadership in counterinsurgency operations in Punjab, Andhra Pradesh, Uttar Pradesh and most recently in Odisha.
- Even in the Northeast and Jammu and Kashmir, where the Indian Army provides the backbone of the counterinsurgency grid, the police forces of the respective states and their IPS leadership play a crucial role in gathering intelligence and in executing operations.
- So, the failures and setbacks in the Naxal areas of Chhattisgarh need to be placed in perspective.
- The fact that the Indian state has adopted a broad policy of economic development, military restraint and gradual attrition and rejected indiscriminate violence in the Naxal theatre is the democratically prudent and morally just course of action.
- This hasn’t dissuaded Maoist sympathisers from gaining international attention through relentless propaganda against our security forces.
- However, such attacks also help in exposing their true nature and hardening public resolve against them.
- \We have enough examples of successful, police led CI Ops in our country.
- Why we are not able to replicate these successes in Chhattisgarh is a matter of larger political issues, well beyond the narrow scope of operational tactics and individual lapses of police leadership.
- Not just the politics, the geography and demography of the Naxal-affected areas, make it an even more complex challenge of internal security.
Not just the politics, the geography and demography of the Naxal-affected areas, make it an even more complex challenge of internal security.
From UPSC perspective, the following things are important :
Repromulgation of ordinances raises several questions and it also goes against the Supreme Court judgement. The article explains the issues involved.
- The central government has repromulgated the ordinance that establishes a commission for air quality management in the National Capital Region.
- This raises questions about the practice of issuing ordinances to make law, and that of re-issuing ordinances without getting them ratified by Parliament.
- Law making is a legislative function, this power is provided for urgent requirements, and the law thus made has an automatic expiry at the end of six weeks from the time Legislature next meets.
- In the 1950s, central ordinances were issued at an average of 7.1 per year.
- The number peaked in the 1990s at 19.6 per year, and declined to 7.9 per year in the 2010s.
- The last couple of years has seen a spike, 16 in 2019, 15 in 2020, and four till now this year.
- States have also been using the ordinance route to enact laws.
- For example, in 2020, Kerala issued 81 ordinances, while Karnataka issued 24 and Maharashtra 21.
- Kerala has also repromulgated ordinances.
- The issue was brought up in the Supreme Court through a writ petition by D.C. Wadhwa.
- He found out that Bihar had issued 256 ordinances between 1967 and 1981, of which 69 were repromulgated several times, including 11 which were kept alive for more than 10 years.
- A five-judge Constitution Bench of the Supreme Court, in 1986, ruled that repromulgation of ordinances was contrary to the Constitutional scheme.
- The judgment did not stop the practice.
- Instead, the Centre also started to follow the lead of Bihar.
- For example, in 2013 and 2014, the Securities Laws (Amendment) ordinance was promulgated three times.
- Similarly, an ordinance to amend the Land Acquisition Act was issued in December 2014, and repromulgated twice – in April and May 2015.
- The matter came up again in the Supreme Court in 2017, a seven-judge Constitution Bench declared this practice to be unconstitutional and declared it to be a fraud on the Constitution.
- Even this judgment has been ignored.
- The Indian Medical Council Amendment Ordinance was issued in September 2018, and reissued in January 2019.
- Ordinances are to tackle exigencies when the legislature is not in session, and expire at the end of six weeks of the next meeting of the legislature.
- This time period is given for the legislature to decide whether such a law is warranted.
- Repromulgation is not permitted as that would be a usurpation of legislative power by the executive.
- As governments, both at the Centre and States, are violating this principle, the legislatures and the courts should check the practice.
- By not checking this practice, the other two organs are also abdicating their responsibility to the Constitution.
As the Supreme Court said, repromulgation would most certainly be a colourable exercise of power for the Government and it needs to be avoided.
From UPSC perspective, the following things are important :
The article highlights how players at 3 levels: global, regional and local level influence Afghan dynamics.
- The exit of US and NATO forces from Afghanistan underlines the end of the unipolar moment in international affairs.
- Ending US military involvement, however, does not necessarily make Washington marginal to the future evolution of Afghanistan.
- The US remains the most significant global power even after the end of the unipolar moment.
- Its ability to weigh in on multiple issues is considerable.
- President Joe Biden is under some pressure at home not to be seen as abandoning Afghanistan.
- Nor can the US President ignore the dangers of Afghanistan re-emerging as a breeding ground for international terrorism.
- The US will figure prominently in any Taliban strategy to win international diplomatic recognition and political legitimacy.
- It will also need Western economic assistance for stabilising the war-torn country.
- Russia is determined to play an important role in the future of Afghanistan.
- As a member of the UNSC, the joint leader of the Shanghai Cooperation Organisation with China, and a major source of weapons, Russian clout is real.
- Above all, Putin brings plenty of political will to compensate for Moscow’s loss of superpower status as we have seen across the world, from Venezuela to Myanmar and Mozambique to Syria.
- If the US is a distant power, China is Afghanistan’s neighbour.
- Unlike Russia, China can deliver massive economic resources to Afghanistan under the umbrella of the Belt and Road Initiative.
- China’s expanding relations with the different nations of the Gulf and Central Asia and a deep partnership with Pakistan lends much potential depth to Beijing’s role in Afghanistan.
- Both Kabul and the Taliban have seen China as a valuable partner in the pursuit of their divergent interests.
- Beijing has often talked of extending the China Pakistan Economic Corridor to Afghanistan.
- However, China is vulnerable to the extremist politics of the region that fan the flames of religious and ethnic separatism in its Xinjiang province.
- One of the biggest concern about the Afghan future is the kind of influence Islamic radicals might regain in the country under Taliban rule and its consequences for the subcontinent, Central Asia, and the Middle East.
- Pakistan and Iran, which share long physical borders, have had the greatest natural influence on land-locked Afghanistan.
- When the Taliban ruled Afghanistan, Saudi Arabia and the UAE were the only countries other than Pakistan to recognise the government-run by its leader, Mullah Omar.
- They have taken a back seat in the current round of Afghan diplomacy, but would certainly return to the centre stage sooner than later.
- Meanwhile, bold Qatar and ambitious Turkey have injected themselves into the Afghan jousting.
- The local actors in Afghanistan have agency of their own.
- All of them know how to manipulate external powers for their own ends in Afghanistan.
- The image of the Taliban as a creature of the Pakistan army is misleading, the Taliban is quite capable of making independent deals with the rest of the world.
- The Taliban’s opponents, too, are likely to fight for their interests and will seek out external partners.
Several contentions unfolding in and around Afghanistan promise to reorder the region again. Delhi needs much strategic activism to secure its interests and promote regional stability in this flux.
From UPSC perspective, the following things are important :
Avoiding military alliances and retaining its strategic autonomy could help India play an important role in geopolitics at the same time maintaining the diversity in its relationships.
- The principal objective of the Russian Foreign Minister was to prepare the ground for the visit of President Vladimir Putin later this year.
- The Indian perspective on the Indo-Pacific was conveyed to the Foreign Minister of Russia.
- India insists that its Indo-Pacific initiatives seek a cooperative order, that the Quad is not the nucleus of a politico-military alliance.
- A $1 billion Indian line of credit for projects in the Russian Far East and activation of a Chennai-Vladivostok maritime corridor were announced in 2019.
- The message was that India’s effort to restrain Chinese aggression is compatible with Russia’s vision of a Eurasian partnership.
- Russia remains unconvinced, either because it feels India’s words do not match its actions or because of its close ties with China.
- India is concerned about Russia’s China embrace, encompassing close political, economic and defence cooperation: Russia accounted for 77% of China’s arms imports in 2016-20.
- India’s apprehensions about their technology- and intelligence-sharing were heightened by Mr. Putin’s remark that he would not rule out a future Russia-China military alliance.
- Foreign Minister visited Pakistan directly after India — the first time a Russian Minister has done so.
- .He confirmed that Russia would strengthen Pakistan’s “counter-terrorism capability” .
- Russia is now Pakistan’s second-largest defence supplier, accounting for 6.6% of its arms imports in 2016-20.
- Their cooperation includes joint “counter-terrorism” drills and sharing perspectives on military tactics and strategic doctrines.
- Despite being a major defence supplier of China and Pakistan, Russia remains a major supplier of cutting-edge military technologies to India.
- The Stockholm International Peace Research Institute (SIPRI) records that Russia supplied 49% of India’s arms imports in 2016-20.
- his is a reality check.
- Defence cooperation is not a transactional exchange. Sharing of technologies and strategies is underpinned by a mutual commitment to protection of confidentiality.
- Sustainable defence cooperation is based on a credible assurance that what is transferred to our adversaries will not blunt the effectiveness of our weapons systems.
- In this already complex mix, the American sanctions legislation, CAATSA (Countering America’s Adversaries Through Sanctions Act), adds an external layer of complexity.
- The Eurasian landmass to India’s north is dominated by Russia and China.
- Strategic and security interests in Central Asia, West Asia and Afghanistan dictate our engagement with the region and the connectivity projects linking it, like the International North-South Transport Corridor through Iran.
- India cannot vacate this space to a Russia-China condominium (with Pakistan in tow), without potentially grave security consequences.
- The principal element in this is the drive for the superpower status of a powerful, assertive China.
- The U.S., as the pre-eminent superpower, seeks to retard this process.
- In a deviation from classical geopolitical strategy, the U.S. is taking on both China and Russia.
- This move is driving Russia and China together and arguably accelerating the move to bipolarity.
- Even so, the differentials in military, economic and political power across countries may complicate the emergence of two clear poles of the Cold War variety.
- A decline in Western hostility to Russia could add to the complexity, if Russia takes the opportunity to loosen the Chinese embrace and position itself as a pole in the multipolar world.
India has to explore the space within these processes to maximise its global influence by steering clear of alliances and retaining the autonomy of policy.
From UPSC perspective, the following things are important :
The article highlights the ambiguity about the number of farmers in India and related issues.
- The Agriculture Ministry’s last Input Survey for 2016-17 pegged the total operational holdings at 146.19 million.
- The NABARD All India Rural Financial Inclusion Survey of the same year estimated the country’s “agricultural households” at 100.7 million.
- The Pradhan Mantri Kisan Samman Nidhi (PM-Kisan) has around 111.5 million enrolled beneficiaries.
- Agricultural households, as per NABARD’s definition, cover any household whose value of produce from farming activities is more than Rs 5,000 during a year.
- That obviously is too little to qualify as living income.
- Agricultural households, as per NABARD’s definition, cover any household whose value of produce from farming activities is more than Rs 5,000 during a year.
- That obviously is too little to qualify as living income.
- A “real” farmer is someone who would derive a significant part of his/her income from agriculture.
- This, one can reasonably assume, requires growing at least two crops in a year.
- The 2016-17 Input Survey report shows that out of the total 157.21 million hectares (mh) of farmland with 146.19 million holdings, only 140 mh was cultivated.
- And even out of this net sown area, a mere 50.48 mh was cropped two times or more, which includes 40.76 mh of irrigated and 9.72 mh of un-irrigated land.
- Taking the average holding size of 1.08 hectares for 2016-17, the number of “serious full-time farmers” cultivating a minimum of two crops a year would be hardly 47 million.
- The above figure is also consistent with other data from the Input Survey.
- These pertain to the number of cultivators planting certified/high yielding seeds (59.01 million), using own or hired tractors (72.29 million) and electric/diesel engine pumpsets (45.96 million), and availing institutional credit (57.08 million).
- Whichever metric one considers, the farmer population significantly engaged and dependent on agriculture as a primary source of income is well within 50-75 million.
- The current agriculture crisis is largely about these 50-75 million farm households.
- At the heart of farmers’ crisis is the absence of price parity.
- In 1970-71, when the minimum support price (MSP) of wheat was Rs 76 per quintal, 10 grams of 24-carat gold cost about Rs 185.
- Today, the wheat MSP is at Rs 1,975/quintal, gold prices are Rs 45,000/10g.
- The absence of farm price parity didn’t hurt much initially when crop productivity was rising.
- Since the 1990s, yields have further gone up to 5.1-5.2 tonnes/hectare in wheat and 6.4-6.5 tonnes for paddy. But so have production costs.
- The demand for making MSP a legal right is basically a demand for price parity that gives agricultural commodities sufficient purchasing power with respect to things bought by farmers.
- Most government welfare schemes are aimed at poverty alleviation and uplifting those at the bottom of the pyramid.
- But there’s no policy for those in the “middle” and in danger of slipping to the bottom.
- When crop prices fail to keep pace with escalating costs — of not only inputs, but everything the farmer buys — the impact is on the 50-75 million surplus producers.
- Any “agriculture policy” has to first and foremost address the problem of price parity.
- Farmers’ interest be even better served by the government guaranteeing a minimum “income” rather than “price” support.
- Subsistence or part-time agriculturalists, on the other hand, would benefit more from welfare schemes and other interventions to boost non-farm employment.
Whether it is crop, livestock or poultry, agriculture policy has to focus on “serious full-time farmers”, most of them neither rich nor poor. This rural middle class that was once very confident of its future in agriculture today risks going out of business. That shouldn’t be allowed to happen.
From UPSC perspective, the following things are important :
The article highlights the issue of lack of clarity on the extent of the power of the Election Commission of India.
- Supreme Court held in Mohinder Singh Gill vs Chief Election Commissioner that Article 324 contains plenary powers to ensure free and fair elections.
- These plenary powers are vested in the ECI which can take all necessary steps to achieve this constitutional object.
- Thus, the model code of conduct has been issued in exercise of its powers under Article 324.
- Besides the code, the ECI issues from time to time directions, instructions and clarifications on a host of issues which crop up in the course of an election.
- The model code of conduct issued by the ECI is a set of guidelines meant for political parties, candidates and governments to adhere to during an election.
- This code is based on consensus among political parties.
- The model code is observed by all stakeholders for fear of action by the ECI.
- However, there exists a considerable amount of confusion about the extent and nature of the powers which are available to the ECI in enforcing the code as well as its other decisions in relation to an election.
- As the code of conduct is framed on the basis of a consensus among political parties, it has not been given any legal backing.
- A committee of Parliament recommended that the code should be made a part of the Representation of the People Act 1951.
- However, the ECI did not agree to it on the ground that once it becomes a part of the law, all matters connected with the enforcement of the code will be taken to court, which would delay elections.
- But then the question about the enforceability of the code remains unresolved.
- Paragraph 16A of the Election Symbols (Reservation and Allotment) Order, 1968 says that the commission may suspend or withdraw recognition of a recognised political party if it refuses to observe the model code of conduct.
- But it is doubtful whether this provision is legally sustainable.
- When the code is legally not enforceable, how can the ECI resort to a punitive action such as withdrawal of recognition?
- Observers of ECI report to it about the conduct of certain officials of the States where elections are to be held.
- Transfer of an official is within the exclusive jurisdiction of the government.
- It is actually not clear whether the ECI can transfer a State government official in exercise of the general powers under Article 324 or under the model code.
- Transfer of an official is within the exclusive jurisdiction of the government.
- It is actually not clear whether the ECI can transfer a State government official in exercise of the general powers under Article 324 or under the model code.
- Further, to assume that a police officer or a civil servant will be able to swing the election in favour of the ruling party is extremely unrealistic and naive.
- According to the model code, Ministers cannot announce any financial grants in any form, make any promise of construction of roads, provision of drinking water facilities, etc or make any ad hoc appointments in the government. departments or public undertakings.
- These are the core guidelines relating to the government.
- But in reality, no government is allowed by the ECI to take any action, administrative or otherwise, if the ECI believes that such actions or decisions will affect free and fair elections.
- A recent decision of the ECI to stop the Government of Kerala from continuing to supply kits containing rice, pulses, cooking oil, etc is a case in point.
- The Supreme Court had in S. Subramaniam Balaji vs Govt. of T. Nadu & Ors (2013) held that the distribution of colour TVs, computers, cycles, goats, cows, etc, done or promised by the government is in the nature of welfare measures and is in accordance with the directive principles of state policy, and therefore it is permissible during an election.
- So, how can the distribution of essential food articles which are used to stave off starvation be electoral malpractice?
There is no doubt that the ECI, through the conduct of free and fair elections in an extremely complex country, has restored the purity of the legislative bodies. However, no constitutional body is vested with unguided and absolute powers.
From UPSC perspective, the following things are important :
Amid the second wave of covid pandemic, India’s decision to supply vaccine to foreign countries has been questioned from various quarters. The article deals with this issue.
- While responding to a question Minister of State in the Ministry of External Affairs noted that India was sending these vaccines abroad in the form of grant, commercial sales of manufacturers GAVI’s COVAX facility.
- The supply to GAVI’s COVAX facility is an obligation since India is a member of this multilateral body and also a recipient of vaccines from this body.
- By doing this, India wishes to signal that it is a responsible global power which does not self-obsessively think of itself alone.
- This desire to be a good global citizen can be traced to the Objective Resolution moved by Jawaharlal Nehru in the Constituent Assembly on December 13, 1946.
- The premise of the ideal ‘Vasudhaiva Kutumbakam’ is no different to that of the Objective Resolution.
- The government made estimates of the vaccines that could be sent abroad on the interplay of three factors: domestic production, the demands of the national vaccine programme and requests for vaccines manufactured in India.
- What is not known is how these factors were collectively addressed in the decision-making process.
- It is also argued that it was obligatory to send vaccines contracted under GAVI’s COVAX facility.
- However, sovereign states can always invoke supreme national interest to over-ride obligations.
- Certainly, the vaccines sent as grants were voluntary and the commercial contracts of the company concerned could always be disregarded under existing laws.
The government needs to convince Indians that the vaccine exports have not been made at the cost of their health.
From UPSC perspective, the following things are important :
With the declining American supremacy in the global order, the world is set for new global order led by the developing countries. The article deals with this rise of alternate global order.
- The international order is under threat of the rising economic power of the BRICS nations, with China dominating in its economic and military capacity.
- It is apparent that the future of global politics requires a significant agenda in the hands of the rising powers that are aggressively building a parallel economic order envisaging new centres of hegemonic power.
- It forebodes the final decline of American ascendancy.
- It was the Bandung Conference of 1955, a meeting of Asian and African states, most of which were newly independent, that set the schema for the rise of Asia, politically and economically.
- The confrontational stance was therefore the expected corollary in third world struggles to create a parallel order.
- America will continue to play a prime role in international affairs though its image representing universal brotherhood has sharply declined under the Trump regime.
- The rising tide of far-right ultra-nationalism and ethnic purity experienced in the Brexit phenomena, in Trumpism and in the promotion of the right-wing agenda in India, has set in motion the wearing down of liberal democracy.
- Other threats such as terrorism, ethnic conflicts and the warning of annihilation owing to climate change necessarily demand joint international action where American “exceptionalism” becomes an incongruity and an aberration.
- This indeed has chipped away at the American global supremacy.
- The world is, as a result, witness to a more decentred and pluralistic global order.
- Though pandemic has ravaged economies such as Brazil, India, Turkey and South Africa into a downward spiral, in the post-pandemic period, these economies would rise to meet the American-led liberal hegemonic world order.
- With China spearheading Asian regionalism, a serious challenge is possible.
- China must strengthen the opposition to the West through the promotion of regional multilateral institutions.
- More than having individual partners or allies, China must embrace and give a push to multilateral affiliations in order to not further exacerbate regional tensions.
- Power rivalry in a multipolar world would remain a possibility with military conflict not ruled out.
- However, the capabilities of the rising economies cannot be underestimated.
- China and India clearly have the age-old potential to lead as, historically, they have been pioneers of some of the oldest civilisations in the world.
- China is indisputably a serious rival to the U.S. in the South China Sea, a world leader in renewable energy, and a formidable actor on the global stage of investment and trade, penetrating India, Israel, Ethiopia and Latin America.
- Thus, a kind of dualism persists in the world order with no clear hegemony that can be bestowed on one single nation.
It is feared that there could be a possibility of a multipolar world turning disordered and unstable, but it is up to the rising nations to attempt to overcome territorial aspirations and strike a forceful note of faith on cultural mediation, worldwide legitimacy, and the appeal of each society in terms of its democratic values.
From UPSC perspective, the following things are important :
The article explains the data governance norms we need to adopt to secure better societal outcomes.
- New terms of service circulated by WhatsApp, caused a stir among the user.
- It informed users that data about chats with business accounts would be shared with Facebook.
- These policies seemed unfair to India as they were not applicable to the European Union (EU), given their strong data protection policies.
- Default norms provide power to the tech platforms to collect, analyse and monetize data with complete control.
- This undergirds business models that seem undesirable for society—with harms to privacy and free speech.
- Global discussions about alternatives to the “exchange of data for free services” are becoming nuanced.
- It was generally accepted that extraction of data to access free services was a fair exchange with individuals.
- Emergence of existential threats related to privacy and democracy have highlighted the role of guaranteeing human and civil rights.
- There has been significant global progress through regulations on individual data rights.
- A United Nations Conference on Trade and Development (UNCTAD) report claims that 128 of 194 countries have put in place legislations for data protection and privacy.
- However, this protection is insufficient as it is centered on individuals and does not account for safety of groups.
- The next wave of data governance ideas will seek to protect collective harms and build on the foundation of individual agency and control.
- One-size-fits all global norms of data governance are changing and being replaced by region-specific ideas.
- Greater acceptance for “data sovereignty” assertions across India and Europe is a welcome shift towards crafting governance that is respectful of local nuances and inclusive of civic participation.
- The EU general data protection regulation (GDPR) had created an early lighthouse example.
- On the other hand, the US has adopted a light regulation approach—there is no comprehensive country-wide data protection law.
- Closer home, India is finalizing the contours of a country-wide and cross-sector personal data protection bill, which reflects local norms.
- So far, data economy has operated in a completely unregulated space, creating a “winner takes all” market, with concentrated profits and little contribution to local taxes.
- A healthy economy requires value creation for all stakeholders.
- As tech platforms take up the profitable role of acting as the gateway to all information and social connections, they have a greater accountability and responsibility to contribute to the economy.
- India’s digital tax through the 2% “equalization levy” is an attempt to make the tech giants pay for revenues earned in India.
Formal adoption of regulations and setting up of enforcement institutions will lead to meaningful progress in the right direction.
From UPSC perspective, the following things are important :
Four middle powers: India, Japan, China and Turkey anchor the world to multipolarity. The article deals with this issue.
- In respect of three crucial relationships, namely China, Russia and Iran, Mr. Biden is following in the footsteps of his predecessor.
- Mr. Biden has also extended his firm backing for the “Indo-Pacific” and the associated alignment — the Quadrilateral Security Dialogue, or Quad for short.
- The U.S. continues to view China as its principal adversary on the world stage and that it will use the Quad to challenge China in the Indo-Pacific.
- The U.S.’s hostility for Russia goes back to the latter’s war with Ukraine and the occupation of Crimea in 2014, followed by allegations of Russian cyber-interference in the U.S. presidential elections of 2016.
- U.S. animosity has encouraged China and Russia to solidify their relations.
- The two countries have agreed to harmonise their visions under the Eurasian Economic Union sponsored by Russia and China’s Belt and Road Initiative (BRI).
- This idea has now been subsumed under the ‘Greater Eurasian Partnership’ to which both are committed.
- Thus, the new Cold War is now being reflected in a new geopolitical binary — the Indo-Pacific versus Eurasia.
- But all four seems to be already aligned.
- Japan and India are part of the Quad and have substantial security ties with the U.S.
- Iran has found strategic comfort with the Sino-Russian alliance.
- Turkey, a NATO member, has found its interests better-served by Russia and China rather than the U.S. and its European allies.
- So, why the uncertainty? The main reason is that, despite the allure, the four nations are not yet prepared to join immutable alliances.
- India has been expanding defence ties with the U.S. since 2016, by massive defence purchases and agreements on inter-operability and intelligence-sharing and frequent military exercises, as also the elevation of the Quad to ministerial level.
- This might have signalled to China that India was now irreversibly in the U.S. camp.
- But China has a point: while the Quad has made India a valuable partner for the U.S. in the west Pacific, neither the U.S. nor the Quad can address the challenges it faces at its 3,500-kilometre land border with China.
- Moreover, the U.S.’s intrusive approach on human rights issues ensures that India will need to manage its ties with China largely through its own efforts while retaining Russia as its defence partner.
- Japan has an ongoing territorial dispute with China relating to the Senkaku Islands in the East China Sea.
- But there is more to Sino-Japanese relations: in 2019, 24% of Japanese imports came from China, while 19% of its exports went to China, affirming the adage.
- The crippling sanctions on Iran and the frequent threats of regime change make it a natural ally of the Sino-Russian axis.
- However, its strategic culture eschews long-term security alignments.
- Turkey is steady distancing from its western partners and increasing geopolitical, military and economic alignment with Russia and China.
- But Turkey still wishes to keep its ties with the U.S. intact and retain the freedom to make choices.
- Its “New Asia” initiative involves the strengthening of east-west logistical and economic connectivity backed by western powers and China.
As the clouds of the new Cold War gathers over the world, these four nations could find salvation in “strategic autonomy” — defined by flexible partnerships, with freedom to shape alliances to suit specific interests at different times.
From UPSC perspective, the following things are important :
The Insolvency and Bankruptcy Code was amended recently taking into account its creditor centric approach.
- IBC was amended last week, through an ordinance.
- The amendment sought to address a structural weakness in India’s resolution architecture by introducing the concept of pre-packs for micro, small and medium enterprises (MSMEs).
- The pre-packaged framework involves a privately negotiated contract between the promoters of a financially distressed firm and its financial creditors to restructure the company’s obligations.
- This contract is negotiated within the IBC architecture but before the commencement of insolvency proceedings.
- Once accepted by creditors, the plan must be presented to the National Company Law Tribunal (NCLT) for approval.
- A firm’s promoters could have submitted a resolution plan even after it enters the insolvency proceedings, subject to restrictions imposed under Section 29A which clarifies all those who are ineligible for submitting the resolution plan.
- So, the difference in the new framework essentially boils down to the following.
- Under the IBC, upon the initiation of insolvency proceedings, control of a firm is taken away from promoters, and a resolution professional is appointed.
- Now, during the restructuring, the promoter, through the pre-pack, retains control over the firm.
- So effectively, we have transitioned from a “creditor-in-control” model of resolution to a “debtor-in-control” model of restructuring.
- This amendment, which creates a framework for restructuring, without the promoter losing control over the firm, addresses a lacuna in the IBC.
- In this arrangement, the is an absence of an open bidding process, such as during the resolution phase.
- This might raise questions over price discovery, especially if value maximisation for creditors is the yardstick to measure the efficacy of IBC.
- This marks a fundamental change in the IBC framework.
- The IBC, while it has strengthened the position of the creditors, had swung to an extreme.
- The resolution architecture as it stood prior to this amendment was perceived as being too creditor-centric.
- Wresting control from the “errant” promoter, comes with its own set of consequences.
- The notion that all business failure is due to the connivance of promoters needs to be reconsidered.
- Firms may be unable to pay their obligations simply because the economic cycle has turned.
- Or projects have not materialised as expected.
- Of the 2,422 cases closed since IBC came into being, 46.5 per cent of the firms have gone into liquidation, while a resolution plan has been accepted in only 13.1 per cent of the cases.
- This indicates liquidation bias.
- At a time when there aren’t enough buyers in the economy, the IBC process would lead to significant value destruction.
- Promoters get to hold on to their firms, and exit the process with more manageable obligations, making this an attractive proposition.
- For creditors, considering the liquidation bias in IBC, as long as the value of the restructured obligation is greater than the liquidation value it makes sense to choose this option.
- Moreover, this entire process remains outside the restructuring framework of the central bank.
- And, considering that the pre-packs encompass all financial creditors, as opposed to RBI’s restructuring schemes which deal only with banks.
- This takes into account the concerns of other financial creditors as well.
Consider the question “How far IBC has succeeded in improving the insolvency regime in India? How the concepts of pre-packs is different from the previous system?
This approach will help clarify issues, bring about greater certainty to the process. And, once the creases are ironed out, it will create a permanent mechanism for restructuring debts.
From UPSC perspective, the following things are important :
The explains the issues involved in the recent incident in which US position on freedom of navigation under UNCLOS differed from India’s.
- On April 7, the U.S.’s 7th Fleet Destroyer conducted a ‘Freedom of Navigation Operation’ inside India’s Exclusive Economic Zone (EEZ).
- This exercise was conducted without requesting India’s consent.
- Moreover, the U.S. 7th Fleet noted in its press release that India’s requirement of prior consent is “inconsistent with international law”.
- However, India asserted that the UN Convention on the Law of the Sea (UNCLOS) “does not authorize other States to carry out in the Exclusive Economic Zone and on the continental shelf, military exercises or manoeuvres, in particular those involving the use of weapons or explosives, without the consent of the coastal state”.
- The question is, can countries carry out military exercises in another country’s EEZ and if yes, subject to what conditions?
- UN Convention on the Law of the Sea (UNCLOS) binds all its signatories and customary international law binds all states, subject to exceptions like the doctrine of persistent objector.
- As per the UNCLOS, EEZ is an area adjacent to the territorial waters of a coastal state.
- Under UNCLOS, a sovereign coastal state has rights and duties relating to management of natural resources; establishment and use of artificial islands, installations and structures; marine scientific research; and protection of the marine environment.
- India is a party to the UNCLOS while the U.S. is not.
- Article 87 provides for freedom of the high seas under which all states have the freedom of navigation.
- Apart from that, states enjoy the freedom of overflight and of the laying of submarine cables and pipelines as well as other internationally lawful uses of the sea.
- However, the freedom of navigation is subject to the conditions laid down under the UNCLOS and other rules of international law.
- In addition to it, Article 58 (3) stipulates another qualification: “In exercising their rights and performing their duties under this Convention in the exclusive economic zone, States shall have due regard to the rights and duties of the coastal State and shall comply with the laws and regulations adopted by the coastal State...”.
- The relevant Indian law in this regard is the Territorial Waters, Continental Shelf, Exclusive Economic Zone and Other Maritime Zones of India Act, 1976.
- Section 7 sub-section 9 of this Act recognises the freedom of navigation of the ships of all States but makes them subject to the exercise of rights by India within the zone.
- Article 310 of the UNCLOS does permit states to make declarations in order to explain the relationship between the Convention and their own laws.
- The declaration by India in 1995 also states that India “understands that the provisions of the Convention do not authorize other States to carry out in the exclusive economic zone and on the continental shelf military exercises or manoeuvres.
- Non-consensual military activities that hinder the lawful enjoyment of rights of coastal states need not be permissible.
- Also, a coastal state is naturally concerned about military exercises and manoeuvres posing a risk to its coastal communities, its installations or artificial islands, as well as the marine environment.
- Thus, any state which wishes to conduct such exercises must do so only in consultation with the coastal state since the coastal state is the best judge of its EEZ.
- Both India and the U.S. should negotiate such concerns for the maintenance of international peace and security.
On a conjoint reading of Articles 58, 87 and 310, it can be argued that freedom of navigation cannot be read in an absolute and isolated manner.
| english |
<gh_stars>1-10
//package javapoker;
public class Hand {
private Card[] cards;
private int[] value;
Hand(Deck d)
{
value = new int[6];
cards = new Card[5];
for (int x=0; x<5; x++)
{
cards[x] = d.drawFromDeck();
}
int[] ranks = new int[14];
int[] orderedRanks = new int[5]; //miscellaneous cards that are not otherwise significant
boolean flush=true, straight=false;
int sameCards=1,sameCards2=1;
int largeGroupRank=0,smallGroupRank=0;
int index=0;
int topStraightValue=0;
for (int x=0; x<=13; x++)
{
ranks[x]=0;
}
for (int x=0; x<=4; x++)
{
ranks[ cards[x].getRank() ]++;
}
for (int x=0; x<4; x++) {
if ( cards[x].getSuit() != cards[x+1].getSuit() )
flush=false;
}
for (int x=13; x>=1; x--)
{
if (ranks[x] > sameCards)
{
if (sameCards != 1) //if sameCards was not the default value
{
sameCards2 = sameCards;
smallGroupRank = largeGroupRank;
}
sameCards = ranks[x];
largeGroupRank = x;
} else if (ranks[x] > sameCards2)
{
sameCards2 = ranks[x];
smallGroupRank = x;
}
}
if (ranks[1]==1) //if ace, run this before because ace is highest card
{
orderedRanks[index]=14;
index++;
}
for (int x=13; x>=2; x--)
{
if (ranks[x]==1)
{
orderedRanks[index]=x; //if ace
index++;
}
}
for (int x=1; x<=9; x++) //can't have straight with lowest value of more than 10
{
if (ranks[x]==1 && ranks[x+1]==1 && ranks[x+2]==1 && ranks[x+3]==1 && ranks[x+4]==1)
{
straight=true;
topStraightValue=x+4; //4 above bottom value
break;
}
}
if (ranks[10]==1 && ranks[11]==1 && ranks[12]==1 && ranks[13]==1 && ranks[1]==1) //ace high
{
straight=true;
topStraightValue=14; //higher than king
}
for (int x=0; x<=5; x++)
{
value[x]=0;
}
//start hand evaluation
if ( sameCards==1 ) {
value[0]=1;
value[1]=orderedRanks[0];
value[2]=orderedRanks[1];
value[3]=orderedRanks[2];
value[4]=orderedRanks[3];
value[5]=orderedRanks[4];
}
if (sameCards==2 && sameCards2==1)
{
value[0]=2;
value[1]=largeGroupRank; //rank of pair
value[2]=orderedRanks[0];
value[3]=orderedRanks[1];
value[4]=orderedRanks[2];
}
if (sameCards==2 && sameCards2==2) //two pair
{
value[0]=3;
value[1]= largeGroupRank>smallGroupRank ? largeGroupRank : smallGroupRank; //rank of greater pair
value[2]= largeGroupRank<smallGroupRank ? largeGroupRank : smallGroupRank;
value[3]=orderedRanks[0]; //extra card
}
if (sameCards==3 && sameCards2!=2)
{
value[0]=4;
value[1]= largeGroupRank;
value[2]=orderedRanks[0];
value[3]=orderedRanks[1];
}
if (straight && !flush)
{
value[0]=5;
value[1]=topStraightValue;
}
if (flush && !straight)
{
value[0]=6;
value[1]=orderedRanks[0]; //tie determined by ranks of cards
value[2]=orderedRanks[1];
value[3]=orderedRanks[2];
value[4]=orderedRanks[3];
value[5]=orderedRanks[4];
}
if (sameCards==3 && sameCards2==2)
{
value[0]=7;
value[1]=largeGroupRank;
value[2]=smallGroupRank;
}
if (sameCards==4)
{
value[0]=8;
value[1]=largeGroupRank;
value[2]=orderedRanks[0];
}
if (straight && flush)
{
value[0]=9;
value[1]=topStraightValue;
}
}
void display()
{
String s;
switch( value[0] )
{
case 1:
s="high card";
break;
case 2:
s="pair of " + Card.rankAsString(value[1]) + "\'s";
break;
case 3:
s="two pair " + Card.rankAsString(value[1]) + " " + Card.rankAsString(value[2]);
break;
case 4:
s="three of a kind " + Card.rankAsString(value[1]) + "\'s";
break;
case 5:
s=Card.rankAsString(value[1]) + " high straight";
break;
case 6:
s="flush";
break;
case 7:
s="full house " + Card.rankAsString(value[1]) + " over " + Card.rankAsString(value[2]);
break;
case 8:
s="four of a kind " + Card.rankAsString(value[1]);
break;
case 9:
s="straight flush " + Card.rankAsString(value[1]) + " high";
break;
default:
s="error in Hand.display: value[0] contains invalid value";
}
s = " " + s;
System.out.println(s);
}
void displayAll()
{
for (int x=0; x<5; x++)
System.out.println(cards[x]);
}
int compareTo(Hand that)
{
for (int x=0; x<6; x++)
{
if (this.value[x]>that.value[x])
return 1;
else if (this.value[x]<that.value[x])
return -1;
}
return 0; //if hands are equal
}
}
| java |
Bismillah hir-Rahman nir-Rahim !
(1) If you have separate meal, there is no wrong in sharing a table with a Hindu. Islam allows tolerance, rather if you eat according to sunnah with an intention to impress your colleague and invite him to Islam then you may be rewarded for the same.
(2) One should avoid eating food prepared in a Hindu house; specially the foods which doubtfully may contain haram ingredients or may be offerings of their gods, such food are haram and prohibited. Yes, you may eat the food about which you are satisfied.
Darul Ifta,
| english |
LAS VEGAS – Most baseball fans won't forget the controversial call in Game 6 of the 2019 World Series between the Houston Astros and the Washington Nationals when runner Trea Turner was ruled out because of interference.
Umpire accuracy is a frustration for fans and players in nearly every game.
This season, MLB has launched so-called "robot umpires" in 11 Pacific Coast League Triple-A teams, putting it one step away from reaching the major leagues, to improve accuracy and reduce delays.
The automated balls and strikes system (ABS) debuted in a Las Vegas Aviators’ game earlier this month.
As cool and bizarre as it would be to see "Jetsons"-style robots on the field, most fans won’t notice the actual device — eight surveillance-looking cameras at the top of the bleachers.
Like hot dogs and beer, some argue booing umpires for a bad call is a tradition at baseball games.
"Yelling at the umpire, just having a good time. You know, it makes the game feel authentic, makes it feel real," said Ronaldo Echeverria, a Las Vegas Aviators fan.
But umpires make human errors, so MLB introduced an automated ball and strike system to increase the accuracy of calls and reduce delays.
"I think people have the misconception that it's going to be a robot behind the plate. ‘Lost in Space’ is one of my favorite shows. It’s not the robot from ‘Lost in Space’ back there," Jim Gemma, the Aviators' media relations director, told Fox News Digital. "The umpire is going to have AirPods in, and the ball comes over… That basically tells them instantly if it's a ball or strike. "
Cameras located at the top of the bleachers detect the strike zone based on the players’ height.
Once it determines whether the pitch was a ball or strike, a robotic voice tells the umpire through an earpiece.
ABS was first introduced in July 2019 in the Atlantic League of Professional Baseball.
It’s now reached the top of the minor leagues, and the majors could be next.
"At the core, sport is a human endeavor, and we like to cheer for our fans. We like to vilify the umpires," said Rayvon Fouché, a Purdue University professor of American Studies. "It’s a theater of sport and part of that would be lost if we moved to robotic officiating. "
Fouché has studied technology in sports.
He said there’s not yet enough evidence of whether this technology is improving umpires’ accuracy.
Fans are split.
"It's good in some ways, but not in baseball. Baseball's an old-fashioned game," David Baird, an Aviators fan, told Fox News Digital.
"In real high stakes situation like the World Series, we need the most accurate call possible you know," Damian Young, another Aviators fan, added.
MLB has said it’s possible the system could eventually roll out in major league games, but they haven’t released a potential timeline. | english |
//求 20 到 50 之间的随机整数 [包括20 和 50]
console.log(Math.floor(Math.random() * (50 - 20 + 1)) + 20);
//含最大值,含最小值 | javascript |
<gh_stars>0
{
"name": "express-form-router",
"version": "1.0.1",
"description": "Form lifecycle scaffolding in express.",
"keywords": [
"express",
"form",
"lifecycle",
"life-cycle",
"life cycle",
"router",
"routing",
"scaffolding",
"events",
"post",
"http",
"html"
],
"main": "index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/NewRedo/express-form-router.git"
},
"author": "NewRedo Ltd",
"license": "MIT",
"bugs": {
"url": "https://github.com/NewRedo/express-form-router/issues"
},
"homepage": "https://github.com/NewRedo/express-form-router#readme",
"dependencies": {
"express": "^4.16.4"
}
}
| json |
<reponame>demonly/utils
/**
* 该组件提供解析 html 字符串转为 VNode 的能力
* 默认原样解析,可以通过传入 renderers 参数覆盖默认行为
* 当一个 renderer 返回了 undefined 将继续由下一个 renderer 处理
*/
import Vue from 'vue';
import type { CreateElement, VNode } from 'vue';
import { html2json } from 'html2json';
import type { Node } from 'html2json';
import { unentriesReducer } from '../common/object';
import { htmlUnescape } from '../browser/escape';
export type { Node } from 'html2json';
export type { VNode, CreateElement } from 'vue';
interface Options {
scopeId?: string;
// eslint-disable-next-line no-use-before-define
renderers?: Renderer[];
}
export type Render = (node: Node) => VNode | string;
export type Renderer = (node: Node, createElement: CreateElement) => VNode | string;
const safeTags = [
'a',
'b',
'blockquote',
'code',
'del',
'dd',
'div',
'dl',
'dt',
'em',
'h1',
'h2',
'h3',
'i',
'img',
'kbd',
'li',
'ol',
'p',
'pre',
's',
'span',
'sup',
'sub',
'strong',
'strike',
'ul',
'br',
'hr',
'font',
];
function validateSrc(str: string) {
if (!str) return true;
if (str.toLowerCase().startsWith('http://')) return true;
if (str.toLowerCase().startsWith('https://')) return true;
return false;
}
/** 过滤掉白名单以外的标签 */
function xssFilter(node: Node): undefined | null {
if (node.node !== 'element') return undefined;
if (!safeTags.includes(node.tag?.toLowerCase())) return null;
if (node.attr) {
for (const key in node.attr) {
if (key.toLowerCase().startsWith('on')) delete node.attr[key];
}
}
if (!validateSrc(node?.attr?.src as string)) return null;
if (!validateSrc(node?.attr?.href as string)) return null;
return undefined;
}
function render(node: Node, createElement: CreateElement, options: Options): VNode | string {
const { renderers = [] } = options;
// 使用传入的 renderer 渲染
for (const renderer of renderers) {
const result = renderer(node, createElement);
if (result !== undefined) {
return result;
}
}
// 当传入的 renderer 都没有返回值时
// 按照 html 节点渲染
let attr: Record<string, string>;
const { scopeId = '' } = options;
const defaultAttrs = {};
if (scopeId) defaultAttrs[scopeId] = '';
switch (node.node) {
case 'comment':
return null;
case 'text':
return htmlUnescape(node.text);
case 'root':
return createElement(
'div',
{ attrs: { ...defaultAttrs } },
// custom renderer 中不需要手动 render child
node.child?.map((child) => render(child, createElement, options)),
);
default:
attr = Object.entries(node.attr || {})
.map(([key, value]) => [key, value instanceof Array ? value.join(' ') : value])
.reduce<Record<string, string>>(unentriesReducer, {});
return createElement(
node.tag,
{
attrs: { ...defaultAttrs, ...attr },
class: attr.class,
style: attr.style,
},
node.child?.map((child) => render(child, createElement, options)),
);
}
}
export default Vue.component('HtmlComponent', {
props: {
value: {
type: String,
required: true,
},
scopeId: {
type: String,
default: '',
},
safe: {
type: Boolean,
default: true,
},
renderers: {
type: Array,
default: () => [],
},
},
render(createElement) {
const {
value, scopeId, renderers, safe,
} = this.$props;
const htmljson = html2json(value);
const result = render(htmljson, createElement, {
scopeId,
renderers: safe ? [...renderers, xssFilter] : renderers,
});
return createElement('div', { class: 'html-component' }, [result]);
},
});
| typescript |
/* eslint-env browser */
import LoginView from "../view/login/LoginView.js";
import LoginManager from "../model/login/LoginManager.js";
// Controls the Login page
// The Login Manager handles account validations
// The Login View is there to show proceedings to the user
class LoginController {
init(navView) {
this.loginView = new LoginView();
this.loginView.addEventListener("login-submit", this.onSubmit.bind(this));
this.loginView.addEventListener("onRegisterClicked", this.onRegisterClicked.bind(this));
// Navbar View
// Just because if you route back to the Login from another Page, the elements still show
this.navView = navView;
this.navView.hideLinks();
this.navView.hideSafeBtn();
this.navView.hideTitleInput();
this.navView.hideNavView();
this.loginManager = new LoginManager();
this.loginManager.addEventListener("login-result", this.onLoginResult.bind(this));
}
onRegisterClicked() {
window.location.hash = "register";
}
// On submit button click the data from the inputs is used to search for a account in the database
onSubmit(event) {
let email = event.data.email,
password = event.data.password;
this.loginManager.createSession(email, password);
}
// If the result from the login try is ready, the user will be taken to the home page (if login was successful)
onLoginResult(event) {
let bool = event.data.login;
if (bool) {
window.location.hash = "home";
this.navView.showNavView();
} else {
this.loginView.clearInputs();
this.loginView.setServerAnswer(event.data.answer.message);
}
}
}
export default LoginController; | javascript |
Actress Manisha Koirala had the nation swooning when she teamed up with Arvind Swamy for Humma Humma in Mani Ratnam’s ‘Bombay’, released in 1995. More than two decades later, the song has been remade for Aditya Roy Kapur and Shraddha Kapoor starrer ‘Ok Jaanu’ and the new version was like by music lovers.
The song Humma Humma which was originally composed by A.R. Rahman, makes a groovy comeback with Trap artiste MojoJojo, launched by Times Music. Neeraj Shridhar, from the legendary pop act Bombay Vikings, has given the vocals for the Redux version of Humma Humma. The music video also features four of India’s most versatile and well-known dancers adding a never seen before concept to the track.
Humma Humma Redux is a perfect blend of modern music and contemporary dance forms portraying the diversity of music and dance as a form of art. Shot on the sets of a court room, the music video contains drama, dance and an unexpected twist. The Trap beats by MojoJojo is sure to keep the viewers asking for more.
The music video of Humma Humma redux is now available exclusively on Times Music’s YouTube channel.
Watch the video right here:
| english |
Indian Air Force continues its support against Novel Corona virus wherein medical supplies are being transported to equip the state governments and supporting agencies to combat the contagion effectively and efficiently.
During the last few days, IAF airlifted essential medical supplies and commodities from nodal points to Manipur, Nagaland and Gangtok in North Eastern region; and the Union Territories of J&K and Ladakh. In addition, An-32 aircraft, on 06 Apr 2020, airlifted personnel and 3500 kg of medical equipment of ICMR from Chennai to Bhubaneshwar for setting up of testing labs and facilities in Odisha.
IAF has earmarked aircraft at nodal points to airlift medical supplies and equipment at short notice to proactively support operations against COVID-19.
| english |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.