text stringlengths 1 1.04M | language stringclasses 25 values |
|---|---|
I am the shining silvery water of Ganges.
I sing the song of the rivers.
The sweet voice of the waterfall is where I have my concerto.
The peacock took my crown,
and moon my fairness.
The sun is my burning passion.
and the earth my calm serene nature.
Planets are my bits and pieces of emotion,
Swirling inside the ever-expanding brain of mine, causing commotion.
Stars are the shining bright eyes of mine who admire the world at every dusk and dawn.
The rain sings the victory of self-control over the scorching heat of my passion and desires.
I flow with the waves of the ocean in an endless expedition through Coconut groves and sandy beaches.
I am the daughter of Hercules,
And nieces of flora and fauna.
I sway along with the leaves when the wind blows,
And sometimes make collaboration with nightingale's angelic voice.
Cuckoos ku-hu-khu and bird's chirping.
I am the oasis of the desert and desert itself.
I am the clear, filtered streams of the valleys and valley itself.
I am the glaciers of Antarctic and Antarctic itself.
I am the nectar of the flower and poison of the snakes.
I am the forest of the Amazon and desert of the Thar.
I paint my own world of fantasy cause this world is hurting.
I am ugly they say but you see universe has taken a lot from me.
| english |
London [UK], June 4 : Australia's star all-rounder Cameron Green has just finished playing under Rohit Sharma and will be able to draw on what he learned from the Indian captain when they meet again in the ICC World Test Championship final.
After being the most expensive Australian in Indian Premier League (IPL) history, Green did not show any signs of nervousness as he amassed 452 runs and bagged six wickets for Mumbai Indians (MI) under the captaincy of Rohit Sharma.
With a 47-ball century in his team's final IPL group match, the young all-rounder was essential in Mumbai's last-gasp charge to the playoffs, which began with a scorching 128-run stand with Rohit.
Mumbai were eliminated in Qualifier 2, but Green and Rohit will meet once again when Australia take on India in the ICC World Test Championship final at The Oval from June 7.
While Green's Mumbai teammates are now his WTC Final opponents, he may draw on everything he learned from India's captain throughout the IPL and during their important century partnership when they meet in the red-ball clash.
"The calmness he has out in the middle is so evident. He's obviously been there and done that for 10 years. To be out there with him and just talk through a situation was awesome. My role was trying to be aggressive and then he obviously showed ways to go about it, whether it was attacking spin, attacking pace, kind of picking your bowler in a way," Green said to the ICC when asked about playing under Rohit's guidance.
Green has had a good run of form recently, with a five-wicket haul in the Boxing Day Test, followed by a maiden Test ton.
India's squad for WTC final: Rohit Sharma (Captain), Shubman Gill, Cheteshwar Pujara, Virat Kohli, Ajinkya Rahane, KS Bharat (wk), Ravichandran Ashwin, Ravindra Jadeja, Axar Patel, Shardul Thakur, Mohd. Shami, Mohd. Siraj, Umesh Yadav, Jaydev Unadkat, Ishan Kishan (wk).
Australia squad: Pat Cummins (c), Scott Boland, Alex Carey (wk), Cameron Green, Marcus Harris, Josh Hazlewood, Travis Head, Josh Inglis (wk), Usman Khawaja, Marnus Labuschagne, Nathan Lyon, Mitch Marsh, Todd Murphy, Matthew Renshaw, Steve Smith (vc), Mitchell Starc, David Warner. | english |
<gh_stars>1-10
# ------------------------------------------------------------------------------
# Collection of loss metrics that can be used during training, including binary
# cross-entropy and dice. Class-wise weights can be specified.
# Losses receive a 'target' array with shape (batch_size, channel_dim, etc.)
# and channel dimension equal to nr. of classes that has been previously
# transformed (through e.g. softmax) so that values lie between 0 and 1, and an
# 'output' array with the same dimension and values that are either 0 or 1.
# The results of the loss is always averaged over batch items (the first dim).
# ------------------------------------------------------------------------------
import torch
import torch.nn as nn
from mp.eval.losses.loss_abstract import LossAbstract
class LossDice(LossAbstract):
r"""Dice loss with a smoothing factor."""
def __init__(self, smooth=1., device='cuda:0'):
super().__init__(device=device)
self.smooth = smooth
self.device = device
self.name = 'LossDice[smooth='+str(self.smooth)+']'
def forward(self, output, target):
output_flat = output.view(-1)
target_flat = target.view(-1)
intersection = (output_flat * target_flat).sum()
return 1 - ((2. * intersection + self.smooth) /
(output_flat.sum() + target_flat.sum() + self.smooth))
class LossBCE(LossAbstract):
r"""Binary cross entropy loss."""
def __init__(self, device='cuda:0'):
super().__init__(device=device)
self.device = device
self.bce = nn.BCELoss(reduction='mean')
def forward(self, output, target):
# output = output.contiguous()
# target = target.contiguous()
# print(output.max(), output.min())
# print(target.max(), target.min())
# print(output.max(), output.min())
# print(target.max(), target.min())
# print(torch.isnan(output).any())
# print(torch.isnan(target).any())
try:
bce_loss = self.bce(output, target)
except:
print(output.max(), output.min())
print(target.max(), target.min())
print(torch.isnan(output).any())
print(torch.isnan(target).any())
return bce_loss # self.bce(output, target)
class LossBCEWithLogits(LossAbstract):
r"""More stable than following applying a sigmoid function to the output
before applying the loss (see
https://pytorch.org/docs/stable/generated/torch.nn.LossBCEWithLogits.html),
but only use if applicable."""
def __init__(self, device='cuda:0'):
super().__init__(device=device)
self.bce = nn.BCEWithLogitsLoss(reduction='mean')# BCELossWithLogits
def forward(self, output, target):
return self.bce(output, target)
class LossCombined(LossAbstract):
r"""A combination of several different losses."""
def __init__(self, losses, weights, device='cuda:0'):
super().__init__(device=device)
self.losses = losses
self.weights = weights
# Set name
self.name = 'LossCombined['
for loss, weight in zip(self.losses, self.weights):
self.name += str(weight)+'x'+loss.name + '+'
self.name = self.name[:-1] + ']'
def forward(self, output, target):
total_loss = torch.zeros(1).to(self.device)
for loss, weight in zip(self.losses, self.weights):
total_loss += weight*loss(output, target)
return total_loss
def get_evaluation_dict(self, output, target):
eval_dict = super().get_evaluation_dict(output, target)
for loss, weight in zip(self.losses, self.weights):
loss_eval_dict = loss.get_evaluation_dict(output, target)
for key, value in loss_eval_dict.items():
eval_dict[key] = value
return eval_dict
class LossDiceBCE(LossCombined):
r"""A combination of Dice and Binary cross entropy."""
def __init__(self, bce_weight=1., smooth=1., device='cuda:0'):
super().__init__(losses=[LossDice(smooth=smooth), LossBCE()],
weights=[1., bce_weight], device=device)
class LossClassWeighted(LossAbstract):
r"""A loss that weights different labels differently. Often, weights should
be set inverse to the ratio of pixels of that class in the data so that
classes with high representation (e.g. background) do not monopolize the
loss."""
def __init__(self, loss, weights=None, nr_labels=None, device='cuda:0'):
super().__init__(device)
self.loss = loss
if weights is None:
assert nr_labels is not None, "Specify either weights or number of labels."
self.class_weights = [1 for label_nr in range(nr_labels)]
else:
self.class_weights = weights
# Set name
self.name = 'LossClassWeighted[loss='+loss.name+'; weights='+str(tuple(self.class_weights))+']'
# Set tensor class weights
self.class_weights = torch.tensor(self.class_weights).to(self.device)
self.added_weights = self.class_weights.sum()
def forward(self, output, target):
batch_loss = torch.zeros(1).to(self.device)
for instance_output, instance_target in zip(output, target):
instance_loss = torch.zeros(1).to(self.device)
for out_channel_output, out_channel_target, weight in zip(instance_output, instance_target, self.class_weights):
instance_loss += weight * self.loss(out_channel_output,
out_channel_target)
batch_loss += instance_loss / self.added_weights
return batch_loss / len(output)
def get_evaluation_dict(self, output, target):
eval_dict = super().get_evaluation_dict(output, target)
weighted_loss_values = [0 for weight in self.class_weights]
for instance_output, instance_target in zip(output, target):
for out_channel_output, out_channel_target, weight_ix in zip(instance_output, instance_target, range(len(weighted_loss_values))):
instance_weighted_loss = self.loss(out_channel_output, out_channel_target)
weighted_loss_values[weight_ix] += float(instance_weighted_loss.cpu())
for weight_ix, loss_value in enumerate(weighted_loss_values):
eval_dict[self.loss.name+'['+str(weight_ix)+']'] = loss_value / len(output)
return eval_dict | python |
<gh_stars>1-10
/*******************************************************************************
MIT License
Copyright (c) 2021 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*******************************************************************************/
#include <gtest/gtest.h>
#include <hardware/cpu_instruction_set.h>
using namespace pandora::hardware;
class CpuInstructionSetTest : public testing::Test {
public:
protected:
//static void SetUpTestCase() {}
//static void TearDownTestCase() {}
void SetUp() override {}
void TearDown() override {}
};
// -- enumerations --
TEST_F(CpuInstructionSetTest, instructionFamilySerializer) {
EXPECT_TRUE(*toString(CpuInstructionFamily::assembly));
EXPECT_TRUE(*toString(CpuInstructionFamily::mmx));
EXPECT_TRUE(*toString(CpuInstructionFamily::sse));
EXPECT_TRUE(*toString(CpuInstructionFamily::avx));
EXPECT_TRUE(*toString(CpuInstructionFamily::neon));
EXPECT_TRUE(CpuInstructionFamily_size() > 0);
CpuInstructionFamily converted = CpuInstructionFamily::assembly;
EXPECT_TRUE(fromString(toString(CpuInstructionFamily::assembly), converted));
EXPECT_EQ(CpuInstructionFamily::assembly, converted);
EXPECT_TRUE(fromString(toString(CpuInstructionFamily::mmx), converted));
EXPECT_EQ(CpuInstructionFamily::mmx, converted);
EXPECT_TRUE(fromString(toString(CpuInstructionFamily::sse), converted));
EXPECT_EQ(CpuInstructionFamily::sse, converted);
EXPECT_TRUE(fromString(toString(CpuInstructionFamily::avx), converted));
EXPECT_EQ(CpuInstructionFamily::avx, converted);
EXPECT_TRUE(fromString(toString(CpuInstructionFamily::neon), converted));
EXPECT_EQ(CpuInstructionFamily::neon, converted);
}
TEST_F(CpuInstructionSetTest, instructionFamilyFlagOps) {
CpuInstructionFamily flag1 = CpuInstructionFamily::sse;
CpuInstructionFamily flag2 = CpuInstructionFamily::sse;
EXPECT_TRUE(flag1 == flag2);
EXPECT_FALSE(flag1 != flag2);
EXPECT_FALSE(flag1 < flag2);
EXPECT_TRUE(flag1 <= flag2);
EXPECT_FALSE(flag1 > flag2);
EXPECT_TRUE(flag1 >= flag2);
flag2 = CpuInstructionFamily::avx;
EXPECT_FALSE(flag1 == flag2);
EXPECT_TRUE(flag1 != flag2);
EXPECT_EQ((static_cast<uint32_t>(flag1) < static_cast<uint32_t>(flag2)), (flag1 < flag2));
EXPECT_EQ((static_cast<uint32_t>(flag1) <= static_cast<uint32_t>(flag2)), (flag1 <= flag2));
EXPECT_EQ((static_cast<uint32_t>(flag1) > static_cast<uint32_t>(flag2)), (flag1 > flag2));
EXPECT_EQ((static_cast<uint32_t>(flag1) >= static_cast<uint32_t>(flag2)), (flag1 >= flag2));
EXPECT_EQ(static_cast<CpuInstructionFamily>(static_cast<uint32_t>(flag1) & static_cast<uint32_t>(flag2)), (flag1 & flag2));
EXPECT_EQ(static_cast<CpuInstructionFamily>(static_cast<uint32_t>(flag1) | static_cast<uint32_t>(flag2)), (flag1 | flag2));
EXPECT_EQ(static_cast<CpuInstructionFamily>(static_cast<uint32_t>(flag1) ^ static_cast<uint32_t>(flag2)), (flag1 ^ flag2));
EXPECT_EQ(static_cast<CpuInstructionFamily>(~static_cast<uint32_t>(flag1)), (~flag1));
EXPECT_EQ((CpuInstructionFamily::sse | CpuInstructionFamily::avx), addFlag(flag1, flag2));
EXPECT_EQ((CpuInstructionFamily::sse | CpuInstructionFamily::avx), flag1);
EXPECT_EQ((CpuInstructionFamily::avx), removeFlag(flag1, CpuInstructionFamily::sse));
EXPECT_EQ((CpuInstructionFamily::avx), flag1);
}
TEST_F(CpuInstructionSetTest, instructionSetSerializer) {
CpuInstructionSet converted = CpuInstructionSet::cpp;
EXPECT_TRUE(*toString(CpuInstructionSet::cpp));
EXPECT_TRUE(fromString(toString(CpuInstructionSet::cpp), converted));
EXPECT_EQ(CpuInstructionSet::cpp, converted);
EXPECT_TRUE(CpuInstructionSet_size() > 0);
for (auto instSet : CpuInstructionSet_x86_values()) {
EXPECT_TRUE(*toString(instSet));
EXPECT_TRUE(fromString(toString(instSet), converted));
EXPECT_EQ(instSet, converted);
}
for (auto instSet : CpuInstructionSet_arm_values()) {
EXPECT_TRUE(*toString(instSet));
EXPECT_TRUE(fromString(toString(instSet), converted));
EXPECT_EQ(instSet, converted);
}
}
TEST_F(CpuInstructionSetTest, instructionSetFlagOps) {
CpuInstructionSet flag1 = CpuInstructionSet::sse;
CpuInstructionSet flag2 = CpuInstructionSet::sse;
EXPECT_TRUE(flag1 == flag2);
EXPECT_FALSE(flag1 != flag2);
EXPECT_FALSE(flag1 < flag2);
EXPECT_TRUE(flag1 <= flag2);
EXPECT_FALSE(flag1 > flag2);
EXPECT_TRUE(flag1 >= flag2);
flag2 = CpuInstructionSet::avx;
EXPECT_FALSE(flag1 == flag2);
EXPECT_TRUE(flag1 != flag2);
EXPECT_EQ((static_cast<uint32_t>(flag1) < static_cast<uint32_t>(flag2)), (flag1 < flag2));
EXPECT_EQ((static_cast<uint32_t>(flag1) <= static_cast<uint32_t>(flag2)), (flag1 <= flag2));
EXPECT_EQ((static_cast<uint32_t>(flag1) > static_cast<uint32_t>(flag2)), (flag1 > flag2));
EXPECT_EQ((static_cast<uint32_t>(flag1) >= static_cast<uint32_t>(flag2)), (flag1 >= flag2));
EXPECT_EQ(static_cast<CpuInstructionSet>(static_cast<uint32_t>(flag1) & static_cast<uint32_t>(flag2)), (flag1 & flag2));
EXPECT_EQ(static_cast<CpuInstructionSet>(static_cast<uint32_t>(flag1) | static_cast<uint32_t>(flag2)), (flag1 | flag2));
EXPECT_EQ(static_cast<CpuInstructionSet>(static_cast<uint32_t>(flag1) ^ static_cast<uint32_t>(flag2)), (flag1 ^ flag2));
EXPECT_EQ(static_cast<CpuInstructionSet>(~static_cast<uint32_t>(flag1)), (~flag1));
EXPECT_EQ((CpuInstructionSet::sse | CpuInstructionSet::avx), addFlag(flag1, flag2));
EXPECT_EQ((CpuInstructionSet::sse | CpuInstructionSet::avx), flag1);
}
TEST_F(CpuInstructionSetTest, instructionSetSubEnumValues) {
EXPECT_TRUE(CpuInstructionSet_size() > 0);
EXPECT_FALSE(CpuInstructionSet_x86_values().empty());
EXPECT_FALSE(CpuInstructionSet_x86_rvalues().empty());
EXPECT_FALSE(CpuInstructionSet_arm_values().empty());
EXPECT_FALSE(CpuInstructionSet_arm_rvalues().empty());
EXPECT_EQ(CpuInstructionSet_x86_values().size(), CpuInstructionSet_x86_rvalues().size());
EXPECT_EQ(CpuInstructionSet_arm_values().size(), CpuInstructionSet_arm_rvalues().size());
EXPECT_TRUE(CpuInstructionSet_x86_values().size() + CpuInstructionSet_arm_values().size() <= CpuInstructionSet_size());
}
// -- builder / extractors --
TEST_F(CpuInstructionSetTest, buildInstructionSet) {
EXPECT_EQ(CpuInstructionSet::sse, toCpuInstructionSet(pandora::system::CpuArchitecture::x86, CpuInstructionFamily::sse, 0x2));
}
TEST_F(CpuInstructionSetTest, extractInstructionFamily) {
EXPECT_EQ(CpuInstructionFamily::assembly, toCpuInstructionFamily(CpuInstructionSet::cpp));
for (auto instSet : CpuInstructionSet_x86_values()) {
EXPECT_TRUE(toCpuInstructionFamily(instSet) == CpuInstructionFamily::mmx
|| toCpuInstructionFamily(instSet) == CpuInstructionFamily::sse
|| toCpuInstructionFamily(instSet) == CpuInstructionFamily::avx);
}
for (auto instSet : CpuInstructionSet_arm_values()) {
EXPECT_EQ(CpuInstructionFamily::neon, toCpuInstructionFamily(instSet));
}
}
TEST_F(CpuInstructionSetTest, extractCpuArch) {
EXPECT_EQ(pandora::system::CpuArchitecture::all, toCpuArchitecture(CpuInstructionSet::cpp));
for (auto instSet : CpuInstructionSet_x86_values()) {
EXPECT_EQ(pandora::system::CpuArchitecture::x86, toCpuArchitecture(instSet));
}
for (auto instSet : CpuInstructionSet_arm_values()) {
EXPECT_EQ(pandora::system::CpuArchitecture::arm, toCpuArchitecture(instSet));
}
}
| cpp |
<filename>install/install.json
{
"@comment": "Note that the code to transform these data into a webpage is in https://github.com/Schnark/schnark.github.io",
"title": {
"en": "QR Scanner – App for Firefox OS",
"de": "QR-Leser – App für Firefox OS"
},
"serviceworker": true,
"icon": "icons/icon-128.png",
"screenshots": [
"2017-04-18-17-51-15.png",
"2017-04-18-17-50-59.png"
],
"desc": {
"en": ["This app reades QR codes and other barcodes. You can use it with a live image from the camera or from any other image."],
"de": ["Diese App liest QR-Codes und andere Strichcodes. Du kannst sie mit dem Livebild der Kamera oder einem beliebigen anderen Bild verwenden."]
},
"restrictions": {
"en": "Note that it will behave a bit differently regarding sharing the result with other apps if you don’t use Firefox OS.",
"de": "Beachte, dass sie sich ein bisschen unterschiedlich verhält bezüglich des Teilens des Ergebnisses mit anderen Apps, wenn du nicht Firefox OS verwendest."
}
} | json |
Written Answers
(b) if so, whether the Government propose to set up more nursing training centres so as to increase the number of trained nurses; and
(c) If so, the detalls thereof?
THE MINISTER OF HEALTH AND FAMILY WELFARE (SHRIM. L. FOTEDAR): (a) to (c). There is an overall shortage of qualified nurses in the country. It is proposed to give high priority to the expansion and strengthening of nursing education in the Eighth Plan.
Cost Overrun of Rallway Projects
*587. SHRI SHARAD DIGHE SHRI R. SURENDER
Will the Minister of RAILWAYS be
pleased to state:
Written Answers 72
(a) the names of railway projects which have registered steep cost and time overrun in the current year;
(b) the details regarding escalation of cost in case of each project; and
(c) the steps taken for speedy implementation of these projects?
THE MINISTER OF RAILWAYS (SHRI .C. K. JAFFER SHARIEF): (a) to (c). The amount of escalation is known only when the revised estimates are sanctioned and therefore only those projects for which revised estimates were sanctioned in 1991-92 have been listed.
Major ongoing projects costing over Rs 20 crores each, revised estimates for which were sanctioned in the year 1991-92, because of escalation in cost are listed below
| english |
{
"Arch": "amd64 386",
"Os": "linux darwin windows",
"ResourcesInclude": "README.md,static,templates,LICENSE,AUTHORS,CONTRIBUTORS,docs,cayley.cfg.example,30kmoviedata.nt.gz,testdata.nt",
"ConfigVersion": "0.9"
}
| json |
<reponame>lasithadilshan/fleetapp<filename>src/main/resources/static/js/vehicleStatus.js
/**
*
*/
$('document').ready(function() {
$('.table .btn-primary').on('click',function(event){
event.preventDefault();
var href= $(this).attr('href');
$.get(href, function(vehicleStatus, status){
$('#idEdit').val(vehicleStatus.id);
$('#descriptionEdit').val(vehicleStatus.description);
$('#detailsEdit').val(vehicleStatus.details);
});
$('#editModal').modal();
});
$('.table #detailsButton').on('click',function(event) {
event.preventDefault();
var href= $(this).attr('href');
$.get(href, function(vehicleStatus, status){
$('#idDetails').val(vehicleStatus.id);
$('#descriptionDetails').val(vehicleStatus.description);
$('#detailsDetails').val(vehicleStatus.details);
$('#lastModifiedByDetails').val(vehicleStatus.lastModifiedBy);
$('#lastModifiedDateDetails').val(vehicleStatus.lastModifiedDate.substr(0,19).replace("T", " "));
});
$('#detailsModal').modal();
});
$('.table #deleteButton').on('click',function(event) {
event.preventDefault();
var href = $(this).attr('href');
$('#deleteModal #delRef').attr('href', href);
$('#deleteModal').modal();
});
}); | javascript |
<filename>aliyun-java-sdk-pvtz/src/main/java/com/aliyuncs/pvtz/transform/v20180101/DescribeZoneVpcTreeResponseUnmarshaller.java
/*
* 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 com.aliyuncs.pvtz.transform.v20180101;
import java.util.ArrayList;
import java.util.List;
import com.aliyuncs.pvtz.model.v20180101.DescribeZoneVpcTreeResponse;
import com.aliyuncs.pvtz.model.v20180101.DescribeZoneVpcTreeResponse.Zone;
import com.aliyuncs.pvtz.model.v20180101.DescribeZoneVpcTreeResponse.Zone.Vpc;
import com.aliyuncs.transform.UnmarshallerContext;
public class DescribeZoneVpcTreeResponseUnmarshaller {
public static DescribeZoneVpcTreeResponse unmarshall(DescribeZoneVpcTreeResponse describeZoneVpcTreeResponse, UnmarshallerContext _ctx) {
describeZoneVpcTreeResponse.setRequestId(_ctx.stringValue("DescribeZoneVpcTreeResponse.RequestId"));
List<Zone> zones = new ArrayList<Zone>();
for (int i = 0; i < _ctx.lengthValue("DescribeZoneVpcTreeResponse.Zones.Length"); i++) {
Zone zone = new Zone();
zone.setZoneId(_ctx.stringValue("DescribeZoneVpcTreeResponse.Zones["+ i +"].ZoneId"));
zone.setZoneName(_ctx.stringValue("DescribeZoneVpcTreeResponse.Zones["+ i +"].ZoneName"));
zone.setRemark(_ctx.stringValue("DescribeZoneVpcTreeResponse.Zones["+ i +"].Remark"));
zone.setRecordCount(_ctx.integerValue("DescribeZoneVpcTreeResponse.Zones["+ i +"].RecordCount"));
zone.setCreateTime(_ctx.stringValue("DescribeZoneVpcTreeResponse.Zones["+ i +"].CreateTime"));
zone.setCreateTimestamp(_ctx.longValue("DescribeZoneVpcTreeResponse.Zones["+ i +"].CreateTimestamp"));
zone.setUpdateTime(_ctx.stringValue("DescribeZoneVpcTreeResponse.Zones["+ i +"].UpdateTime"));
zone.setUpdateTimestamp(_ctx.longValue("DescribeZoneVpcTreeResponse.Zones["+ i +"].UpdateTimestamp"));
zone.setIsPtr(_ctx.booleanValue("DescribeZoneVpcTreeResponse.Zones["+ i +"].IsPtr"));
List<Vpc> vpcs = new ArrayList<Vpc>();
for (int j = 0; j < _ctx.lengthValue("DescribeZoneVpcTreeResponse.Zones["+ i +"].Vpcs.Length"); j++) {
Vpc vpc = new Vpc();
vpc.setRegionId(_ctx.stringValue("DescribeZoneVpcTreeResponse.Zones["+ i +"].Vpcs["+ j +"].RegionId"));
vpc.setRegionName(_ctx.stringValue("DescribeZoneVpcTreeResponse.Zones["+ i +"].Vpcs["+ j +"].RegionName"));
vpc.setVpcId(_ctx.stringValue("DescribeZoneVpcTreeResponse.Zones["+ i +"].Vpcs["+ j +"].VpcId"));
vpc.setVpcName(_ctx.stringValue("DescribeZoneVpcTreeResponse.Zones["+ i +"].Vpcs["+ j +"].VpcName"));
vpcs.add(vpc);
}
zone.setVpcs(vpcs);
zones.add(zone);
}
describeZoneVpcTreeResponse.setZones(zones);
return describeZoneVpcTreeResponse;
}
} | java |
Everyone has an opinion on rape - which isn't a bad thing unless the opinion is used to over-simplify a subject so contentious that it can prove counter-productive if not handled with sensitivity. I was mostly baffled when I read Ford Foundation International Professor of Economics Abhijit Banerjee's column on rape in the Hindustan Times on Wednesday, titled 'It's time to get real'.
While Banerjee said he was not defending rape in his article, but the heinous act does form the basis of his argument that inequality of access to sex and privacy in urban India is a factor in sexual assaults. Read Banerjee's column here.
While I agree with Banerjee on some specific points stated in his column (the right to privacy, for example), I strongly feel taking an apologist's stance will not help tackle the menace. I have the following counter-arguments.
I can't state this often enough. Rape isn't always about sexual aggression. More often than not, it is the tool for establishing power over the victim. Rapists forcefully violate an individual's private space with intent to dominate.
Banerjee makes several valid points that can be discussed as individual problems that plague the society but they cannot be tied up in a cohesive theme to make a case for the cause for sexual violence. The in-your-face consumerism and public display of affection aren't reasons enough to justify the frustration of the have-nots who presumably assault men and women.
As Banerjee points out, in India the lack of low-cost urban housing is a genuine problem and privacy comes at a premium. But to infer that the lack of it breeds rapists is stretching the point a bit. How do you then account for global instances of rape, especially in developed nations like the United States?
A comparison of the 2007 data suggests that Delhi with 3. 57 rapes per 1,00,000 people fared better in safety as compared to the safest city in the US - New York - which recorded 10. 48 rapes per 1,00,000 people (according to FBI and NYPD's crime statistics).
I understand what Banerjee tries to imply when he says, "What are we doing as a society to reduce inequality of access to sex? I don't mean publicly provided brothels - though those are not unknown in history - but just the right to a normal conjugal life. " But he grossly undermines the deeper social and economic causes that breed the malaise - lack of education, a complete lack of gender equality, our social mindset that moralizes a crime and further victimizes the target in the convoluted system of establishing blame. Add to that the complete lack of empathy in the men and women employed by the state to protect the victims.
It isn't about economic disparity either. Rape is violence and should be treated as such. Justifying rape in any way is indirectly admitting that we as social beings are incapable of controlling our base desires and present a potential threat to others as we live and breathe and go about our daily chores. The argument Banerjee makes indicates that those without access to sexual privacy are completely incapable of exercising their better judgements.
An international report found that worldwide the judicial system is often stacked against women who complain of sexual violence. "In the United States, for example, some states do not treat sexual misconduct by guards on women prisoners as a criminal offence. In Peru some women have had to deliver police summonses to their abusers, and in Pakistan police often refuse to register a complaint.
Forensic examination in some countries focuses solely on whether or not the victim was a virgin. In Jordan officials place women victims in prison, apparently for protective custody, and in most countries the moral standing of the victim is taken into account in the judicial system. One judge in Pakistan allegedly dismissed a case because he felt that the victim had not struggled enough," stated this report on sexual violence.
The crux of the matter is, we fail as a state if we cannot provide safety and security to the citizens. Rape should be treated like any other violent crime. You aren't asked if you were provoking the mugger when your purse gets snatched on the highway, so why do it to rape victims? Please, let's stop making excuses. | english |
Every day comes with some auspicious and inauspicious timings which are important to be followed by an individual while performing any rituals or starting any new work. As per beliefs, doing so can fetch people their desired wishes, success, wealth and prosperity. All the major details including tithi, shubh muhurat, nakshatra about a particular day is given in the Panchang, which is a Vedic calendar. People are advised to read a Panchang daily so that they can know all these important details.
According to the Hindu calendar, April 6, 2021 is Krishna Paksha Dashami Tithi in Chaitra Mass (month) of Vikram Samvata 2077. The day will be Tuesday or Mangalawara. Devotees worship Lord Hanuman on Tuesday and observe a fast and offer prayers to him.
Sunrise, Sunset, Moonrise and Moonset Time:
The day will begin with a sunrise at 06:06 am while the sunset will be at 06:41 pm. At 03:30 am on April 7, moonrise will take place while moonset time is 01:30 pm.
Tithi, Nakshatra and Rashi Details for April 6:
Dashami Tithi will prevail up to 02:09 am on April 7 after which Ekadashi Tithi will begin. Nakshatra for the day will be Shravana up to 02:35 am on April 7, after which Dhanishtha will start. Moon will be in Makara (Capricorn) Rashi,while the sun will prevail in Meena (Pisces) Rashi.
Shubh Muhurat for April 6:
From 11:58 am to 12:48 pm, Abhijit Muhurat -the most auspicious time of the day — will prevail. While the other shubh muhurats including the Amrit Kalam and the Godhuli Muhurat will be from 03:58 pm to 05:36 pm and from 06:28 pm to 06:52 pm, respectively.
Ashubh Muhurat for April 6:
Rahu Kalam or the most ashubh muhurat of the day will be from 03:32 pm to 05:06 pm. The other inauspicious timing including the Gulikai Kalam and Varjyam will prevail from 12:23 pm to 01:58 pm and 06:10 am to 07:48 am, respectively.
Read all the Latest News, Breaking News and Coronavirus News here. Follow us on Facebook, Twitter and Telegram. | english |
In a determined move to achieve a single-digit infant mortality rate (IMR), the Telangana government has announced the launch of statewide neonatal ambulance service. The initiative aims at ensuring swift and safe transportation of premature and sick infants.
The neonatal ambulances will be equipped with state-of-the-art mobile intensive care incubators. These incubators will feature advanced technologies such as mechanical ventilators, infusion pumps and physiological monitors, all engineered to operate seamlessly in a mobile environment.
Speaking to The Hindu , a senior health official said the government plans to introduce 33 neonatal ambulances—one for each district. The ambitious project, set for launch by August 15, carries a yearly budget of approximately Rs. 8. 07 crore. The responsibility of supplying and operating the ambulances has been entrusted to GVK Emergency Management Research Institute (EMRI), following a tender process.
Other medical equipment in the neonatal ambulances include two d-type cylinders with regulators, flow meters, humidifiers, monitors with pulse oximeters and syringe pumps boasting extended battery life.
For optimal care during transportation, each ambulance will have a dedicated neonatal emergency medical technician (EMT) on board. These EMTs will undergo rigorous training for 45 days, as per an agreement between the government and EMRI.
Telangana has made significant strides in reducing neonatal mortality rates over the years. The Neonatal Mortality Rate in the State decreased from 25 in 2014 to 15 in 2022, and it is below the national average of 20. Furthermore, the Under-5 mortality rate dropped from 41 in 2014 to 23 in 2022, while the country’s average stands at 32. With the introduction of neonatal ambulances, the State aims to further lower the mortality rate, aligning with the target set by the United Nations Development Programme Self Development Goals (SDG).
The SDG target envisions a world where preventable deaths of newborns and children under the age of five are eradicated by 2030. Countries are urged to reduce neonatal mortality to as low as 12 per 1,000 live births and achieve an Under-5 mortality rate as low as 25 per 1,000 live births. | english |
<reponame>iris-connect/IRIS-library-js
import { Crypto } from '@peculiar/webcrypto';
import { pack, encode, str2ab } from './util';
const crypto = new Crypto();
async function importRsaKey(pemBase64Encoded: string): Promise<CryptoKey> {
const pem = window.atob(pemBase64Encoded);
// fetch the part of the PEM string between header and footer
const pemHeader = '-----BEGIN PUBLIC KEY-----';
const pemFooter = '-----END PUBLIC KEY-----';
const pemContents = pem.substring(pemHeader.length, pem.length - pemFooter.length);
// base64 decode the string to get the binary data
const binaryDerString = window.atob(pemContents);
// convert from a binary string to an ArrayBuffer
const binaryDer = str2ab(binaryDerString);
return crypto.subtle.importKey(
'spki',
binaryDer,
{
name: 'RSA-OAEP',
hash: 'SHA-256',
},
true,
['encrypt'],
);
}
export async function encryptData(
keyOfHealthDepartment: string,
data,
): Promise<{ dataToTransport: string; keyToTransport: string; nonce: string }> {
const nonce = crypto.getRandomValues(new Uint8Array(16));
const key = await crypto.subtle.generateKey(
{
name: 'AES-GCM',
length: 256,
},
true,
['encrypt'],
);
const publicKey = await importRsaKey(keyOfHealthDepartment);
const dataString = JSON.stringify(data);
const encryptedData = await crypto.subtle.encrypt(
{
name: 'AES-GCM',
iv: nonce,
},
key,
encode(dataString),
);
const encryptedKey = await crypto.subtle.encrypt(
{
name: 'RSA-OAEP',
},
publicKey,
await crypto.subtle.exportKey('raw', key),
);
return {
dataToTransport: pack(encryptedData),
keyToTransport: pack(encryptedKey),
nonce: pack(nonce),
};
}
| typescript |
Cavinton is a well-known drug that has been used in medicine for several decades and is considered one of the most vital medicines. Numerous studies and experience of application show effective results in the treatment of a number of pathologies, prevention of severe consequences and complications.
Cavinton has two forms of release:
- pills;
- concentrate for solution preparation.
There is also the tabletted form of Cavinton forte, which contains a large concentration of active substance.
The active ingredient is vinpocetine, a semi-synthetic substance, which is obtained from the alkaloid vinokamine contained in the plant of periwinkles small.
The drug has the following pharmacological action:
- improves blood flow and microcirculation in the brain;
- improves the transport of oxygen to tissues;
- promotes vasodilation;
- increases the stability of nerve cells to the effect of various adverse factors;
- reduces the ability of platelets and other blood components to aggregate, reduces blood viscosity and reduces the risk of thrombus formation;
- improves the tolerance of cerebral oxygen deficiency (by activating glucose utilization, as well as metabolic processes with adrenaline and serotonin in brain tissues);
- normalizes the supply of bleeding areas of the brain (through the relaxation of the smooth muscles of cerebral vessels);
- contributes to a non-intensive lowering of systemic blood pressure.
It should be noted that this drug acts selectively, affecting the affected areas and not affecting the body as a whole.
Indications for the use of injections and droppers with Cavinton (intravenously, drip), as well as indications for the use of Cavinton in the form of tablets (including forte), are common. The choice of the form of the drug, its dosage and the frequency of reception is individually determined depending on the type of illness, the severity and severity of the process, the age of the patient, etc. So, the medicine is recommended for the following diagnoses:
1. Insufficiency of cerebral circulation in acute or chronic stage, including:
- progressive stroke;
- hypertension;
- transistor ischemic attacks;
- post-stroke state;
- atherosclerotic lesion of cerebral vessels;
- organic brain damage of hypertensive or post-traumatic origin;
- vertebrobasilar insufficiency;
- cardiovascular dementia.
2. Mental and neurological disorders in patients with cerebrovascular insufficiency, including:
- memory impairment ;
- dizziness;
- headache;
- speech and motor disorders.
3. Vascular ophthalmic diseases:
- angiospasm of the choroid and retina;
- lesions of the choroid, retina or yellow spot;
- secondary glaucoma;
- thrombosis or occlusion of central retinal vessels, etc.
4. Lesions of ENT organs:
- Meniere's disease ;
- idiopathic noises in the ears;
- hypoacusis of toxic origin;
- neuritis of the auditory nerve;
- dizziness of labyrinth origin, etc.
5. Climacteric syndrome with vasovegetative symptoms.
Contraindications to the use of Cavinton:
- hemorrhagic stroke in acute form;
- severe stage of ischemic heart disease;
- arrhythmias with severe course;
- pregnancy;
- the period of breastfeeding;
- hypersensitivity to the components of the drug. | english |
Councillors of the South Delhi Municipal Corporation (SDMC) Friday said the civic body’s claim of declaring itself open defecation-free, opening new parking lots in the city and declaring five markets plastic free have been punctured as none of these proposals are being implemented on the ground. AAP and Congress leaders also alleged that while the BJP-led corporation was getting its own projects cleared, proposal to open dispensaries in their wards were being blocked.
During the SDMC house meeting Friday, Congress councillor from Badarpur Shravan Kumar said several people in Gautampuri area in his ward defecate along the tracks or in the open as the public toilet has sewer lines blocked. He said the toilet falls under DUSIB, but SDMC spent money on its upgradation through the Swachh Bharat Fund. Still, the sewage line remains choked and the toilet overflows. Kumar said there are 16-17 toilets in this area but half of them are non-functional as they do not have electricity or water. SDMC commissioner Puneet Goel said he will take up the matter with DUSIB.
The SDMC had on October 2, 2017, announced that all wards under its jurisdiction have become open defecation-free.
Leader of the Congress in South MCD Abhishek Dutt said there is no point getting such tags when in reality several toilet blocks are closed and open defecation is rampant in several areas. He said that while the South MCD has promised to open parking lots in several areas, the reality on the ground is different. The SDMC has set multiple deadlines to open multi-level parking lots in New Friends Colony, Jangpura, Kalkaji and Subhash Nagar, but not even one is completely operational.
BJP councillor from Safdarjung Radhika Abrol said the plastic-free campaign has fizzled out in Green Park and Yusuf Sarai. Leader of Opposition Praveen Kumar said a proposal to make dispensaries in wards of Abhishek Dutt and AAP leader Ramesh Matiala has been rejected by the standing committee — the same body that cleared a similar proposal in Pul Prahladpur, a BJP leader’s ward. | english |
from os import getenv
from gevent import monkey; monkey.patch_all()
from flask import Flask
from huey import RedisHuey
DEBUG = getenv('DEBUG', True)
app = Flask(__name__)
app.config.from_object(__name__)
huey = RedisHuey('task-scheduler', host=getenv('REDIS_HOST'), always_eager=DEBUG)
huey.immediate = False
| python |
The 2019 Oscar winners are here, and it's not a U.S. award only! Alibaba Pictures Group Limited co-produced Green Book, which won Oscars for Best Picture, Best Original Screenplay and Best Actor in a Supporting Role at the 91st Academy Awards (The Oscars).
| english |
Steven Gerrard was substituted in the second half of the game against Chelsea, as the game was reaching its final stages. As he left the pitch, everyone in the stadium, Chelsea fans, manager, staff and players included recognised the gravity of the moment.
Their “dear enemy” who almost joined them in 2005 was leaving the Stamford Bridge pitch for the last time as a Liverpool player. The crowd applauded the one they had sung about many times, often taunting him and reminding him of his monumental “slip” against the Blues at Anfield last year.
Everyone including Chelsea fans, staff, manager and players recognised the Liverpool captain as he went off the field. Of course, once the moment had past, hostilities resumed.
Speaking after the game, Gerrard said, “I was more happy with the ovation from the Liverpool fans.
“Chelsea fans have had respect for a couple of seconds today but have slaughtered me all game.
The Liverpool captain also appreciated Jose Mourinho, saying, “I have huge respect for him. He's the best manager in the world. I would have signed for him on three occasions if I wasn't such a big Liverpool fan.
In turn, Jose Mourinho who had previously waxed lyrical about Gerrard in the pre-match press conference, added to his earlier comments.
“I'm so happy with the ovation,” said Mourinho. “The negative song Chelsea fans sing for him is respect for an old, dear enemy that fought so much against us in every competition.
| english |
Goals for Girls (G4G) became the first-ever US female football team to travel to India this winter. They eagerly went about their purpose of connecting girls from different regions and backgrounds with their peers from around the world through a program designed towards addressing social and health challenges via cultural exchange and football. The final leg of their 2013/14 trip was played out within the confines of the awe-inspiring Jawaharlal Nehru Stadium in New Delhi.
See what G4G, led by Olympic and World Cup champ Cindy Parlow, and others including Franz Gastler, the YUWA players, players from the Haryana Girls Football team and Tanvie Hans (Tottenham Hotspur Ladies FC) have to say about the state of girls and women’s football in India.
This event could not have taken place without the tremendous support and leadership of the Anglian partners including Moonlight Sports Foundation and CEQUIN. | english |
Begin typing your search above and press return to search.
Aries : (March 21 - April 20)
Marriage is possible. You will make closer ties with your beloved and be ready to face all challenges courageously. A delightful day is on the cards. You can be a party to a secret pact, where you should exercise control over yourself. You will also see changes in your health today. Nothing to worry. | english |
Harbhajan Singh has confirmed he has pulled out of the upcoming edition of the Indian Premier League (IPL) due to personal reasons. The veteran spinner has become the second CSK player after Suresh Raina to pull out of the tournament. With Harbhajan Singh’s latest comments, the speculation surrounding his participation in the IPL has finally come to an end.
Speculations were rife after he missed the team’s pre-season camp in Chennai last month from August 15 to 20. He also did not accompany the team to UAE before reports stated that he would leave for the gulf country in September. However, Harbhajan Singh has decided against playing in the IPL this year.
“I will not be playing IPL this year due to personal reasons.These are difficult times and I would expect some privacy as I spend time with my family. @ChennaiIPL CSK management has been extremely supportive and I wish them a great IPL,” he wrote on Twitter.
As per reports, he had informed CSK of his decision to pull out from IPL 2020 owing to personal reasons two weeks ago but the team had asked him to take some more time and think over his decision.
This will be yet another big blow for the three-time champions. In the spin-friendly conditions of the UAE, Harbhajan Singh’s experience would have played a crucial role for the franchise. Having joined CSK in 2018, he had picked up 16 wickets last season when CSK made it to the final.
CSK still have a formidable spin department though. The likes of Ravindra Jadeja, Imran Tahir, Karn Sharma, Mitchell Santner as well as Sai Kishore form the team’s spin attack.
Last week, Raina had also returned to India from UAE citing personal reasons. The franchise later confirmed that he has pulled out of the entire competition. Things are not really falling into place for CSK ahead of IPL 2020. Last week, 13 of their members including two players – Deepak Chahar, Ruturaj Gaikwad – had tested positive for COVID-19.
The whole squad and all franchise officials in the UAE were then asked to self-isolate themselves for an additional 7 days. The three-time champions are likely to hit the nets from Friday, subject to clearance of the 2nd round of testing.
| english |
Mumbai (Maharashtra) [India], April 4 : A Parliamentary Delegation from Israel, led by the Speaker of Knesset, Amir Ohana called on Maharashtra Governor Ramesh Bais at Raj Bhavan, Mumbai on Tuesday.
The Speaker of the Israeli Parliament (Knesett) Amir Ohana was accomped by a high-level Parliamentary delegation of Israel while meeting Maharashtra Governor Ramesh Bais.
Member of Parliament Michale Mordechai Biton, Parliamentarian Amit Halevy, Ambassador of Israel to India Naor Gilon and Consul General of Israel in Mumbai Kobbi Shosh were among those present during the meeting.
Earlier in the day, Israeli Knesset Speaker Amir Ohana visited the Nariman House in Mumbai to pay tribute to victims of the 26/11 terror attack.
"Everyone who took part in this terrible terror attack should be brought to justice. This is a major part of counter-terrorism. So, first we need to prevent, but once we didn't succeed to prevent, everyone needs to be brought to justice. And this is our expectation, and I think it is the vast majority of the Indian people's expectation," Amir Ohana said.
Ohana landed in Mumbai on Monday. Consulate General of Israel in Mumbai tweeted, "Knesset Speaker MK Amir Ohana has landed here as part of a first-ever visit to India. At the National Stock Exchange he was honored by ringing the bell and meeting the CEO. "
Before his visit to Mumbai, Ohana and Israel's parliamentary delegation held a meeting with External Affairs Minister S Jaishankar on Monday. The two sides discussed strengthening India-Israel ties and promoting cooperation in I2U2.
"Glad to welcome Israeli Knesset Speaker @AmirOhanaand parliamentary delegation in South Block today. Discussed strengthening India-Israel ties and promoting cooperation in I2U2, Jaishankar tweeted.
Ohana tweeted, "Thank you my dear friend Minister for External Affairs of India @DrSJaishankar. It was an important and productive meeting. I'm confident that our collaboration will enhance Israel-India relations for the benefit of both nations. "
The Israeli Speaker also called on Vice President and Chairman of Rajya Sabha, Jagdeep Dhankhar at the Parliament House. Taking to Twitter, the official handle of the Vice president of India wrote, "A Parliamentary delegation from Israel, led by Hon'ble Speaker of Knesset, H. E. Mr Amir Ohana called on the Hon'ble Vice President & Chairman Rajya Sabha, Shri Jagdeep Dhankhar at Parliament House today. @AmirOhana @MEAIndia"
The Knesset Speaker called India one of Israel's closest and dearest friends. He called it a distinct pleasure to have been invited to India. Knesset Speaker made the statement during a meeting with Parliament Speaker Om Birla.
"It is a great honour for me to be here with you today. This is indeed not only my first visit to India but also the first visit of any speaker of the Knesset in an official visit to India. And it is my distinct pleasure to have been invited specifically to India, one of Israel's closest and dearest friends and the world's largest democracy," Ohana said.
The Israeli Parliamentary Delegation led by Amir Ohana called on Lok Sabha Speaker Om Birla at Parliament House on Friday. At the outset, Birla welcomed the delegation to India and said that Israel and India have traditionally enjoyed close and friendly relations. The Israeli Parliamentary Delegation, which is on a visit to India was jointly invited by the Vice President and Chairperson of Rajya Sabha and the Speaker of Lok Sabha. | english |
#loads and trains data using simple CPU data loading technique
#adapted from https://colab.research.google.com/github/tensorflow/docs/blob/master/site/en/r2/tutorials/load_data/images.ipynb#scrollTo=qj_U09xpDvOg
import pathlib
import tensorflow as tf
AUTOTUNE = tf.data.experimental.AUTOTUNE
def preprocess_image(image):
image = tf.image.decode_jpeg(image, channels=3)
image = tf.image.resize(image, [192, 192])
image /= 255.0 # normalize to [0,1] range
return image
def load_and_preprocess_image(path):
image = tf.io.read_file(path)
return preprocess_image(image)
def caption_image(image_path):
image_rel = pathlib.Path(image_path).relative_to(data_root)
return "Image " + image_rel.parts[-1]
data_root_orig = "../datasetSearch/images/"
data_root = pathlib.Path(data_root_orig)
for item in data_root.iterdir():
print(item)
import random
all_image_paths = list(data_root.glob('*/*'))
all_image_paths = [str(path) for path in all_image_paths]
random.shuffle(all_image_paths)
image_count = len(all_image_paths)
print(f"total: {image_count} images")
label_names = sorted(item.name for item in data_root.glob('*/') if item.is_dir())
print(f"label_names:{label_names}")
label_to_index = dict((name, index) for index,name in enumerate(label_names))
print(f"label_indices: {label_to_index}")
all_image_labels = [label_to_index[pathlib.Path(path).parent.name]
for path in all_image_paths]
print("First 10 labels indices: ", all_image_labels[:10])
import matplotlib.pyplot as plt
img_path = all_image_paths[0]
image_path = all_image_paths[0]
label = all_image_labels[0]
plt.imshow(load_and_preprocess_image(img_path))
plt.grid(False)
plt.xlabel(caption_image(img_path))
plt.title(label_names[label].title())
plt.show()
path_ds = tf.data.Dataset.from_tensor_slices(all_image_paths)
print(path_ds)
image_ds = path_ds.map(load_and_preprocess_image, num_parallel_calls=AUTOTUNE)
import matplotlib.pyplot as plt
plt.figure(figsize=(8,8))
for n,image in enumerate(image_ds.take(4)):
plt.subplot(2,2,n+1)
plt.imshow(image)
plt.grid(False)
plt.xticks([])
plt.yticks([])
plt.xlabel(caption_image(all_image_paths[n]))
plt.show()
label_ds = tf.data.Dataset.from_tensor_slices(tf.cast(all_image_labels, tf.int64))
image_label_ds = tf.data.Dataset.zip((image_ds, label_ds))
print(image_label_ds)
ds = tf.data.Dataset.from_tensor_slices((all_image_paths, all_image_labels))
# The tuples are unpacked into the positional arguments of the mapped function
def load_and_preprocess_from_path_label(path, label):
return load_and_preprocess_image(path), label
image_label_ds = ds.map(load_and_preprocess_from_path_label)
image_label_ds
BATCH_SIZE = 32
# Setting a shuffle buffer size as large as the dataset ensures that the data is
# completely shuffled.
ds = image_label_ds.shuffle(buffer_size=image_count)
ds = ds.repeat()
ds = ds.batch(BATCH_SIZE)
# `prefetch` lets the dataset fetch batches, in the background while the model is training.
ds = ds.prefetch(buffer_size=AUTOTUNE)
ds = image_label_ds.apply(
tf.data.experimental.shuffle_and_repeat(buffer_size=image_count))
ds = ds.batch(BATCH_SIZE)
ds = ds.prefetch(buffer_size=AUTOTUNE)
mobile_net = tf.keras.applications.MobileNetV2(input_shape=(192, 192, 3), include_top=False)
mobile_net.trainable=False
def change_range(image,label):
return 2*image-1, label
keras_ds = ds.map(change_range)
# The dataset may take a few seconds to start, as it fills its shuffle buffer.
image_batch, label_batch = next(iter(keras_ds))
feature_map_batch = mobile_net(image_batch)
print(feature_map_batch.shape)
model = tf.keras.Sequential([
mobile_net,
tf.keras.layers.GlobalAveragePooling2D(),
tf.keras.layers.Dense(len(label_names))])
logit_batch = model(image_batch).numpy()
print("min logit:", logit_batch.min())
print("max logit:", logit_batch.max())
print()
print("Shape:", logit_batch.shape)
model.compile(optimizer=tf.keras.optimizers.Adam(),
loss='sparse_categorical_crossentropy',
metrics=["accuracy"])
len(model.trainable_variables)
model.summary()
steps_per_epoch=tf.math.ceil(len(all_image_paths)/BATCH_SIZE).numpy()
print(f'steps_per_epoch:{steps_per_epoch}')
checkpoint_path = "plant_model/cp.ckpt"
cp_callback = tf.keras.callbacks.ModelCheckpoint(checkpoint_path,
save_weights_only=True,
verbose=1)
model.fit(ds, epochs=10, callbacks=[cp_callback])
# import time
# default_timeit_steps = 2*steps_per_epoch+1
# def timeit(ds, steps=default_timeit_steps):
# overall_start = time.time()
# # Fetch a single batch to prime the pipeline (fill the shuffle buffer),
# # before starting the timer
# it = iter(ds.take(steps+1))
# next(it)
# start = time.time()
# for i,(images,labels) in enumerate(it):
# if i%10 == 0:
# print('.',end='')
# print()
# end = time.time()
# duration = end-start
# print("{} batches: {} s".format(steps, duration))
# print("{:0.5f} Images/s".format(BATCH_SIZE*steps/duration))
# print("Total time: {}s".format(end-overall_start))
# ds = image_label_ds.apply(
# tf.data.experimental.shuffle_and_repeat(buffer_size=image_count))
# ds = ds.batch(BATCH_SIZE).prefetch(buffer_size=AUTOTUNE)
# print(f'ds:{ds}')
# #build tf_record
# image_ds = tf.data.Dataset.from_tensor_slices(all_image_paths).map(tf.io.read_file)
# tfrec = tf.data.experimental.TFRecordWriter('images.tfrec')
# tfrec.write(image_ds)
# image_ds = tf.data.TFRecordDataset('images.tfrec').map(preprocess_image)
# BATCH_SIZE=32
# s = tf.data.Dataset.zip((image_ds, label_ds))
# ds = ds.apply(
# tf.data.experimental.shuffle_and_repeat(buffer_size=image_count))
# ds=ds.batch(BATCH_SIZE).prefetch(AUTOTUNE) | python |
Are those the hoverboards we are looking for?
In 1994, I eagerly accepted my first full-time position in research at the Columbia-Presbyterian Medical Center. Part of my job was to find patients willing to participate in a prostate cancer study.
To bring the market back into equilibrium more quickly, VCs, particularly growth-stage VCs, owe it to entrepreneurs to offer candor and transparency about how we think about valuing companies.
“The theme of LA is diversity.” That is what DoorDash’s Kevin Huang told me in our conversation about how expanding on-demand marketplaces into LA differs from other markets.
| english |
package net.chrisrichardson.eventstore.examples.management.restaurantsservice;
import net.chrisrichardson.eventstore.examples.management.restaurant.common.CreateRestaurantResponse;
import net.chrisrichardson.eventstore.examples.management.restaurant.common.RestaurantInfo;
import net.chrisrichardson.eventstore.examples.management.restaurant.common.UpdateRestaurantResponse;
import net.chrisrichardson.eventstore.examples.management.restaurant.testutil.RestaurantMother;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.IntegrationTest;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.web.client.RestTemplate;
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = RestaurantServiceIntegrationTestConfiguration.class)
@WebAppConfiguration
@IntegrationTest({"server.port=0", "management.port=0"})
public class RestaurantsServiceIntegrationTest {
@Value("${local.server.port}")
private int port;
private String baseUrl(String path) {
return "http://localhost:" + port + "/" + path;
}
@Autowired
RestTemplate restTemplate;
@Test
public void shouldCreateAndUpdateRestaurant() {
RestaurantInfo restaurantInfo = RestaurantMother.makeRestaurant();
ResponseEntity<CreateRestaurantResponse> createRestaurantResponse = restTemplate.postForEntity(baseUrl("/restaurants"), restaurantInfo, CreateRestaurantResponse.class);
Assert.assertEquals(createRestaurantResponse.getStatusCode(), HttpStatus.OK);
final String restaurantId = createRestaurantResponse.getBody().getRestaurantId();
ResponseEntity<UpdateRestaurantResponse> updateRestaurantResponse = restTemplate.exchange(baseUrl("/restaurants/"+restaurantId), HttpMethod.PUT, new HttpEntity(restaurantInfo), UpdateRestaurantResponse.class);
Assert.assertEquals(updateRestaurantResponse.getStatusCode(), HttpStatus.OK);
}
}
| java |
# Equality checks should behave the same way as assignment
# Variable equality check
bar == {'a': 1, 'b':2}
bar == {
'a': 1,
'b': 2,
}
# Function equality check
foo() == {
'a': 1,
'b': 2,
'c': 3,
}
foo(1, 2, 3) == {
'a': 1,
'b': 2,
'c': 3,
}
| python |
#!/usr/bin/env python
import pytest
from pyxenon_snippets import directory_listing_recursive
def test_directory_listing_recursive():
directory_listing_recursive.run_example()
| python |
<reponame>jonaskello/amqp-client.js
export type AMQPProperties = {
/** content type of body, eg. application/json */
contentType?: string
/** content encoding of body, eg. gzip */
contentEncoding?: string
/** custom headers, can also be used for routing with header exchanges */
headers?: Record<string, Field>
/** 1 for transient messages, 2 for persistent messages */
deliveryMode?: number
/** between 0 and 255 */
priority?: number
/** for RPC requests */
correlationId?: string
/** for RPC requests */
replyTo?: string
/** Message TTL, in milliseconds, as string */
expiration?: string
messageId?: string
/** the time the message was generated */
timestamp?: Date
type?: string
userId?: string
appId?: string
}
export type Field = string | boolean | bigint | number | undefined | null | object;
| typescript |
<reponame>jeffmylife/models
version https://git-lfs.github.com/spec/v1
oid sha256:6ef8599efa0756455535512a0e71c75c66cfcffdd6d8e9b4d14167df92b47641
size 7070
| json |
html { font-family: 'Roboto', sans-serif;
text-align: center;}
body { background-color: #0D5C63;
color: #FFFFFA;
margin: 0px;}
nav { position: relative;
color:#FFFFFA;
text-align: center;}
h1 { background-color: #8ceefa;
color: #FFFFFA;
padding: 10px;
text-align: center;}
h2 { background-color: #78CDD7;
color: #FFFFFA;
margin-left: 10%;
margin-right: 10%;}
h3 { background-color: #78CDD7;
color: #FFFFFA;
margin-left: 10%;
margin-right: 10%;}
h4 { margin-top: -5px;
margin-bottom: -5px;}
p { padding: 5px 20%;
text-align: left;}
ul { list-style-position: inside;
padding: 5px 20%;}
li { text-align: left;}
table { margin: 0 auto;
padding: 10px;
width: 150px;
margin: 0 5px;
height: 150px;
display: flex;
flex-direction: column;
align-items: center;
border-collapse: collapse;}
fieldset { border: none;}
a:link, a:visited { text-decoration: none;
color:#FFFFFA;}
a:hover { text-decoration: none;
color: black;}
footer { text-align: center;}
#pic1 { text-align: center;
padding: 10px 25%;
height: 50%;
width: 50%;}
#space { margin-bottom: 40px;}
.topimage { width: 50%;
height: 50%;
padding: 25px 25%;}
.topimage#code { width: 25%;
height: 25%;}
.linet { margin-top: 30px;}
.lineb { margin-bottom: 20px;}
input[type="text"], input[type="date"] { border: none;
border-bottom: #FFFFFA 2px solid;
background-color: #0D5C63;
color: #FFFFFA;}
/*Dropdown menu*/
.dropdown { text-decoration: none;
list-style-type: none;
text-align: left;
margin: 0px;
background-color: #8ceefa;
padding: 0;}
#submenu { position: absolute;
padding: 5px;
text-align: left;
display: none;
background-color: #8ceefa;
border: black 1px solid;}
#submenui { display: block;
width: 8em;
padding-left: 1em;
list-style-type: none;}
#home:hover ul{ display: block;
list-style-type: none;} | css |
Jake Paul believes Floyd Mayweather is tarnishing his legacy by fighting 'no namers' in exhibition bouts. Last weekend, the 45-year-old American fought Mikuru Asakura, an MMA fighter, in the boxing ring. This was his second exhibition fight under the Rizin banner in Japan. He fought Asakura at the Saitama Super Arena and produced a knockout win over his opponent.
In the latest episode of BS w/ Jake Paul, the YouTuber turned boxer spoke about the fight and explained how the exhibitions are "ruining" Mayweather's legacy:
"No, he literally said it in an interview, 'I don't even know the name of the guy that I'm fighting. ' He's wasting his fans' f***ing money bro, he's wasting everyone's time, he's ruining his legacy. Like this is a guy that arguably had one of the greatest legacies in the sport of boxing, up there, you know, with Ali and up there with Tyson and he's ruining it by doing these little exhibition fights. "
Floyd Mayweather is one of the greatest boxers the sport has ever seen, with a perfect record of 50 wins in 50 fights. He remained unbeaten throughout his career despite facing the best of opponents in Oscar De La Hoya, Manny Pacquiao, and Shane Mosley.
Take a look at a back-and-forth between Paul and Mayweather (courtesy ESPN Ringside's Twitter):
Catch the episode below:
In the same episode, 'The Problem Child' explained why Mayweather suddenly decided to keep fighting small exhibition fights despite retiring back in 2017. 'Money' has already fought two exhibition fights this year and is set to fight another one against Deji on November 13 at the Coca-Cola Arena in Dubai.
Jake Paul believes Mayweather fights exhibitions to support his extravagant lifestyle:
"You can't keep up that same lifestyle after you're retired and I think he realized that and then he had to get back into shape and started doing these exhibitions because he can't function without that lifestyle. That is who he is, that's his identity, it's Floyd 'Money' Mayweather. "
According to Jake Paul, Mayweather got used to the extravagant lifestyle he acquired while he was the highest paid athlete in the world. However, that kind of lifestyle is addictive and 'Money' could not sustain it after retiring. Therefore, he fights exhibitions to earn easy money, which he calls "legalized bank robbery. "
Take a look at Paul's call out to Mayweather (courtesy Michael Benson's Twitter): | english |
<gh_stars>10-100
package main
import (
"flag"
"log"
"github.com/jekyll/dashboard"
)
func main() {
var bindAddr string
flag.StringVar(&bindAddr, "http", "localhost:8000", "The address (host:port) the server should listen on.")
flag.Parse()
log.Printf("Starting server on %s...", bindAddr)
if err := dashboard.Listen(bindAddr); err != nil {
log.Fatalf("Encountered error serving: %+v", err)
}
}
| go |
<gh_stars>1-10
// Code generated by smithy-go-codegen DO NOT EDIT.
package budgets
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/budgets/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the subscribers that are associated with a notification.
func (c *Client) DescribeSubscribersForNotification(ctx context.Context, params *DescribeSubscribersForNotificationInput, optFns ...func(*Options)) (*DescribeSubscribersForNotificationOutput, error) {
if params == nil {
params = &DescribeSubscribersForNotificationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeSubscribersForNotification", params, optFns, c.addOperationDescribeSubscribersForNotificationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeSubscribersForNotificationOutput)
out.ResultMetadata = metadata
return out, nil
}
// Request of DescribeSubscribersForNotification
type DescribeSubscribersForNotificationInput struct {
// The accountId that is associated with the budget whose subscribers you want
// descriptions of.
//
// This member is required.
AccountId *string
// The name of the budget whose subscribers you want descriptions of.
//
// This member is required.
BudgetName *string
// The notification whose subscribers you want to list.
//
// This member is required.
Notification *types.Notification
// An optional integer that represents how many entries a paginated response
// contains. The maximum is 100.
MaxResults *int32
// The pagination token that you include in your request to indicate the next set
// of results that you want to retrieve.
NextToken *string
}
// Response of DescribeSubscribersForNotification
type DescribeSubscribersForNotificationOutput struct {
// The pagination token in the service response that indicates the next set of
// results that you can retrieve.
NextToken *string
// A list of subscribers that are associated with a notification.
Subscribers []types.Subscriber
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
}
func (c *Client) addOperationDescribeSubscribersForNotificationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeSubscribersForNotification{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeSubscribersForNotification{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeSubscribersForNotificationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeSubscribersForNotification(options.Region), middleware.Before); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// DescribeSubscribersForNotificationAPIClient is a client that implements the
// DescribeSubscribersForNotification operation.
type DescribeSubscribersForNotificationAPIClient interface {
DescribeSubscribersForNotification(context.Context, *DescribeSubscribersForNotificationInput, ...func(*Options)) (*DescribeSubscribersForNotificationOutput, error)
}
var _ DescribeSubscribersForNotificationAPIClient = (*Client)(nil)
// DescribeSubscribersForNotificationPaginatorOptions is the paginator options for
// DescribeSubscribersForNotification
type DescribeSubscribersForNotificationPaginatorOptions struct {
// An optional integer that represents how many entries a paginated response
// contains. The maximum is 100.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// DescribeSubscribersForNotificationPaginator is a paginator for
// DescribeSubscribersForNotification
type DescribeSubscribersForNotificationPaginator struct {
options DescribeSubscribersForNotificationPaginatorOptions
client DescribeSubscribersForNotificationAPIClient
params *DescribeSubscribersForNotificationInput
nextToken *string
firstPage bool
}
// NewDescribeSubscribersForNotificationPaginator returns a new
// DescribeSubscribersForNotificationPaginator
func NewDescribeSubscribersForNotificationPaginator(client DescribeSubscribersForNotificationAPIClient, params *DescribeSubscribersForNotificationInput, optFns ...func(*DescribeSubscribersForNotificationPaginatorOptions)) *DescribeSubscribersForNotificationPaginator {
if params == nil {
params = &DescribeSubscribersForNotificationInput{}
}
options := DescribeSubscribersForNotificationPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &DescribeSubscribersForNotificationPaginator{
options: options,
client: client,
params: params,
firstPage: true,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *DescribeSubscribersForNotificationPaginator) HasMorePages() bool {
return p.firstPage || p.nextToken != nil
}
// NextPage retrieves the next DescribeSubscribersForNotification page.
func (p *DescribeSubscribersForNotificationPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeSubscribersForNotificationOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.DescribeSubscribersForNotification(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opDescribeSubscribersForNotification(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "budgets",
OperationName: "DescribeSubscribersForNotification",
}
}
| go |
<reponame>manzonPanda/Jael-s-uncle-restaurant
.off-canvas-sidebar:before {
display: block;
content: "";
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
z-index: 2;
background: #FFFFFF; }
.sidebar:after, .sidebar:before, .sidebar[data-background-color="#2E4057"]:after, .sidebar[data-background-color="#2E4057"]:before,
.off-canvas-sidebar:after,
.off-canvas-sidebar:before,
.off-canvas-sidebar[data-background-color="#2E4057"]:after,
.off-canvas-sidebar[data-background-color="#2E4057"]:before {
background-color: #2E4057; }
.sidebar .logo, .sidebar[data-background-color="#2E4057"] .logo,
.off-canvas-sidebar .logo,
.off-canvas-sidebar[data-background-color="#2E4057"] .logo {
border-bottom: 1px solid rgba(102, 97, 91, 0.3); }
.sidebar .logo p, .sidebar[data-background-color="#2E4057"] .logo p,
.off-canvas-sidebar .logo p,
.off-canvas-sidebar[data-background-color="#2E4057"] .logo p {
color: white; }
.sidebar .logo .simple-text, .sidebar[data-background-color="#2E4057"] .logo .simple-text,
.off-canvas-sidebar .logo .simple-text,
.off-canvas-sidebar[data-background-color="#2E4057"] .logo .simple-text {
color: white; }
.sidebar .nav li:not(.active) > a, .sidebar[data-background-color="#2E4057"] .nav li:not(.active) > a,
.off-canvas-sidebar .nav li:not(.active) > a,
.off-canvas-sidebar[data-background-color="#2E4057"] .nav li:not(.active) > a {
color: white; }
.sidebar .nav .divider, .sidebar[data-background-color="#2E4057"] .nav .divider,
.off-canvas-sidebar .nav .divider,
.off-canvas-sidebar[data-background-color="#2E4057"] .nav .divider {
background-color: white; } | css |
UNITED NATIONS, Nov 16 – UN leader Ban Ki-moon on Tuesday raised fears of "wider conflict" in Sudan and said the United Nations wants to send in more peacekeepers ahead of a key self-determination vote.
Amid statements by the rival north and south governments that they did not want war, the UN Security Council demanded new efforts by both sides to ensure the January 9 referendum is held on time in South Sudan and oil-rich Abyei.
US Secretary of State Hillary Clinton offered Sudan "dramatically" better relations with Washington if Khartoum sticks to its side of the 2005 peace accord with the south that ended a civil war in which two million people died.
Tensions between the north and south have risen again as troubled preparations for the vote move slowly ahead.
Ban highlighted "hostile public statements and accusations of ceasefire violations which risk heightening anxiety and provoking isolated security incidents that can escalate in a wider conflict. "
He said the United Nations was talking with the north and south "on options for a possible augmentation of additional UN troops to increase referendum and post-referendum security. "
The UN force, UNAMID, currently has about 10,000 troops in Sudan.
"However, the presence of UN troops will not be enough to prevent the return to war should widespread hostilities erupt," Ban stressed.
"The potential for unintentional conflict is especially high" in oil-rich Abyei, where there are the strongest fears that the referendum will not be held on time, the UN leader said.
The UN leader said aid agencies have contingency plans to provide assistance in case of "referendum-related violence. "
He appealed for donations for the 63 million dollars needed "to pre-position humanitarian assistance near potential hotspots. "
Many governments now doubt whether the January 9 vote will be on time, even though they have seen some positive events in Sudan.
Voter registration started on schedule on Monday and the north and south have agreed to make a new push to agree on borders, the sharing of oil revenues and other deadlocked issues.
International envoy Thabo Mbeki, the former South African president, said talks involving Sudan\’s President Omar al-Bashir and South Sudan\’s leader Salva Kiir would start November 22.
Sudan\’s Foreign Minister Ali Karti said many "positive developments" had emerged and said the two sides would "cooperate on solving issues and will not go back to war. "
Pagan Amum, secretary general of the south\’s Sudan People\’s Liberation Movement (SPLM), highlighted that the south is likely to choose secession but told the council: "We shall always remain neighbors and we have no choice but to remain good neighbors. "
Clinton said the January 9 vote "is critical to peace and stability not just for Sudan but also for the neighbors. "
She pressed the two sides to speed up their negotiations and said they "must avoid inflammatory rhetoric, quell rumors and dampen animosities. "
But she said if Khartoum holds the referendum on time, recognizes the result and settles the future of Abyei then the US government would move to take Sudan off the US list of terrorist backers.
If Sudan "commits to a peaceful resolution of the conflict in Darfur and takes other steps toward peace and accountability" the US administration is ready to offer an end to US sanctions, help with international debt relief, increased trade and "forging a mutually beneficial relationship. "
A Security Council statement on Sudan read by British Foreign Secretary William Hague expressed "deep concern" about the growing violence in Darfur and deadlocked peace talks between rebel groups and the Khartoum government.
The United Nations estimates that at least 300,000 people have died in Darfur since 2003.
It called on the Sudan government to give greater cooperation to the UN mission in Darfur and "to give full, unhindered access and freedom of movement" to UN peacekeepers and aid workers. | english |
define('views/forms/choice', [
'view',
'views/forms/base',
'views/types/choice',
'clone'
], function (
View,
Form,
Choice,
clone
) {
ChoiceForm.id = Choice.id;
function ChoiceForm() {
Form.apply(this, arguments);
this.on('open', function (params) {
var question = params.question;
this.model('question').assign(question, 'defaults');
this.model('options').reset(clone(question.data.options));
});
this.on('save', function (data) {
data.title = this.data.question.title;
data.data = data.data || {};
data.data.multiple = !!data.data.multiple;
data.data.options = clone(this.data.options);
});
}
Form.extend({
constructor: ChoiceForm,
data: function () {
return {
question: {
title: '',
data: {
multiple: false
}
},
options: []
};
},
addOption: function () {
this.model('options').add({
title: ''
});
},
template: {
'[name="data[multiple]"]': {
prop: {
'checked': '@question.data.multiple'
}
},
'[data-options]': {
each: {
prop: 'options',
view: Option,
dataProp: 'option'
}
},
'[data-add-option]': {
click: 'addOption'
}
}
});
function Option() {
View.apply(this, arguments);
}
View.extend({
constructor: Option,
deleteOption: function () {
this.parent.model('options').remove(this.data.option);
},
template: {
'[data-option-answer]': {
connect: {
'checked': 'option.answer'
}
},
'[data-option-title]': {
connect: {
'value': 'option.title'
}
},
'[data-delete-option]': {
click: 'deleteOption'
}
}
});
return ChoiceForm;
}); | javascript |
package com.ebstrada.formreturn.manager.gef.base;
import java.awt.event.ActionEvent;
import java.util.Collection;
import javax.swing.AbstractAction;
import javax.swing.Icon;
import com.ebstrada.formreturn.manager.gef.util.Localizer;
/**
* Action to select all the Figs in the editor's current view.
*/
public class SelectAllAction extends AbstractAction {
private static final long serialVersionUID = 318997315984793176L;
/**
* Creates a new SelectAllAction
*/
public SelectAllAction() {
super();
}
/**
* Creates a new SelectAllAction
*
* @param name The name of the action
*/
public SelectAllAction(String name) {
this(name, false);
}
/**
* Creates a new SelectAllAction
*
* @param name The name of the action
* @param icon The icon of the action
*/
public SelectAllAction(String name, Icon icon) {
this(name, icon, false);
}
/**
* Creates a new SelectAllAction
*
* @param name The name of the action
* @param localize Whether to localize the name or not
*/
public SelectAllAction(String name, boolean localize) {
super(localize ? Localizer.localize("GefBase", name) : name);
}
/**
* Creates a new SelectAllAction
*
* @param name The name of the action
* @param icon The icon of the action
* @param localize Whether to localize the name or not
*/
public SelectAllAction(String name, Icon icon, boolean localize) {
super(localize ? Localizer.localize("GefBase", name) : name, icon);
}
public void actionPerformed(ActionEvent e) {
Editor ce = Globals.curEditor();
Collection diagramContents = ce.getLayerManager().getContents();
ce.getSelectionManager().select(diagramContents);
}
}
| java |
At least it was small.
We've gotten pretty good at spotting worrisome asteroids and tracking their paths. But sometimes the little ones sneak by, like asteroid 2020 QG did on Sunday.
The European Space Agency (ESA) NEO Coordination Centre, which monitors near-Earth objects, called 2020 QG "the closest asteroid ever observed to pass by our planet without hitting it" in a statement on Tuesday.
The asteroid snuggled up to Earth on Aug. 16, which was the same day it was first spotted by the Zwicky Transient Facility, an astronomical survey that looks out for these sorts of things.
Two observatories that work with ESA's Planetary Defence Office collected follow-up data.
We now know the asteroid missed Earth by a mere 1,860 miles (3,000 kilometers). Compare that to the notably close flyby of asteroid 2020 JJ back in May. JJ came within 4,350 miles (7,000 kilometers) of Earth.
A visualization of 2020 QG's path shows it squeezing past our planet.
ESA said the asteroid was small, measuring in at just a few meters across. That scientists spotted it at all shows that our ability to locate and track near-Earth objects is getting more sophisticated.
The asteroid's dainty size means it wasn't a serious threat, even if it had veered into the atmosphere. "Had it hit the Earth, it would not have caused any significant damage on the ground," ESA said.
Now you can breathe your sigh of relief.
| english |
Index,Facility_Name,ODRSF_facility_type,Provider,Street_No,Street_Name,Postal_Code,City,Prov_Terr
18230,West Deane Park,sports field,toronto,400,martingrove,M9B 4M1,..,on
18231,West Deane Park - Outdoor Tennis Court ( 1),sports field,toronto,19,sedgebrook,..,..,on
18232,West Deane Park - Outdoor Tennis Court ( 2),sports field,toronto,19,sedgebrook,..,..,on
18233,West Deane Park - Outdoor Tennis Court ( 3),sports field,toronto,19,sedgebrook,..,..,on
18234,West Deane Park - Outdoor Tennis Court ( 4),sports field,toronto,19,sedgebrook,..,..,on
18236,West Hill Park,sports field,toronto,145,hilton,M1H 3W5,..,on
18238,West Mall - Outdoor Tennis Court ( 1),sports field,toronto,370,the-west,..,..,on
18239,West Mall - Outdoor Tennis Court ( 2),sports field,toronto,370,the-west,..,..,on
18240,West Mall - Outdoor Tennis Court ( 3),sports field,toronto,370,the-west,..,..,on
18247,West Rouge Park - Outdoor Tennis Court ( 1),sports field,toronto,270,rouge hills,..,..,on
18248,West Rouge Park - Outdoor Tennis Court ( 2),sports field,toronto,270,rouge hills,..,..,on
18249,West Rouge Park - Outdoor Tennis Court ( 3),sports field,toronto,270,rouge hills,..,..,on
18271,Westgrove Park - Outdoor Tennis Court ( 1),sports field,toronto,15,redgrave,..,..,on
18272,Westgrove Park - Outdoor Tennis Court ( 2),sports field,toronto,15,redgrave,..,..,on
18273,Westgrove Park - Outdoor Tennis Court ( 3),sports field,toronto,15,redgrave,..,..,on
18292,Westmount Park - Outdoor Tennis Court ( 1),sports field,toronto,22,arcade,..,..,on
18293,Westmount Park - Outdoor Tennis Court ( 2),sports field,toronto,22,arcade,..,..,on
18294,Westmount Park - Outdoor Tennis Court ( 3),sports field,toronto,22,arcade,..,..,on
18296,Weston Golf And Country Club,sports field,york region,50,phillip's,M9P 2N6,etobicoke,on
18297,Weston Lions Park,sports field,toronto,2125,lawrence,M9N 1H7,..,on
18298,Weston Lions Park,sports field,toronto,2125,lawrence,M9N 1H7,..,on
18299,Weston Lions Park - Outdoor Tennis Court ( 1),sports field,toronto,2125,lawrence,..,..,on
18300,Weston Lions Park - Outdoor Tennis Court ( 2),sports field,toronto,2125,lawrence,..,..,on
18301,Weston Lions Park - Outdoor Tennis Court ( 3),sports field,toronto,2125,lawrence,..,..,on
18302,Weston Lions Park - Outdoor Tennis Court ( 4),sports field,toronto,2125,lawrence,..,..,on
18313,Westway Park,sports field,toronto,175,the-westway,M9P 2C2,..,on
18314,Westway Park - Outdoor Tennis Court ( 1),sports field,toronto,175,the-westway,..,..,on
18315,Westway Park - Outdoor Tennis Court ( 2),sports field,toronto,175,the-westway,..,..,on
18316,Westway Park - Outdoor Tennis Court ( 3),sports field,toronto,175,the-westway,..,..,on
18317,Westway Park - Outdoor Tennis Court ( 4),sports field,toronto,175,the-westway,..,..,on
18323,Wexford Park,sports field,toronto,55,elm bank,M1B 1J4,..,on
18363,Wigmore Park,sports field,toronto,106,wigmore,M4A 200000000,..,on
18406,Willowdale Park - Outdoor Tennis Court ( 1),sports field,toronto,75,hollywood,..,..,on
18407,Willowdale Park - Outdoor Tennis Court ( 2),sports field,toronto,75,hollywood,..,..,on
18408,Willowdale Park - Outdoor Tennis Court ( 3),sports field,toronto,75,hollywood,..,..,on
18409,Willowdale Park - Outdoor Tennis Court ( 4),sports field,toronto,75,hollywood,..,..,on
18474,Wishing Well Park,sports field,toronto,1801,pharmacy,M1T 1H7,..,on
18475,Wishing Well Park,sports field,toronto,1801,pharmacy,M1T 1H7,..,on
18476,Wishing Well Park - Outdoor Tennis Court ( 1),sports field,toronto,1700,pharmacy,..,..,on
18477,Wishing Well Park - Outdoor Tennis Court ( 2),sports field,toronto,1700,pharmacy,..,..,on
18478,Wishing Well Park - Outdoor Tennis Court ( 3),sports field,toronto,1700,pharmacy,..,..,on
18479,Withrow Park,sports field,toronto,725,logan,M4K 3B9,..,on
18480,Withrow Park,sports field,toronto,725,logan,M4K 3B9,..,on
18481,Withrow Park - Outdoor Tennis Court ( 1),sports field,toronto,725,logan,..,..,on
18482,Withrow Park - Outdoor Tennis Court ( 2),sports field,toronto,725,logan,..,..,on
18550,Woodsworth Park,sports field,toronto,122,sedgemount,M1H 1X9,..,on
18559,Wychwood Tennis Club,sports field,toronto,950,davenport,..,..,on
18583,York Mills Park (Irving Paisley Park),sports field,toronto,2539,bayview,M2L 1B1,..,on
18584,York Mills Valley Park - Outdoor Tennis Court ( 1),sports field,toronto,3865,yonge,..,..,on
| json |
Begin typing your search above and press return to search.
JORHAT, March 15: In two different road accidents, three persons were hurt on the busy -Ali Road near Bongalpukhuri, one at LK Path while the second near UK Path under Lichubari Outpost in Jorhat district here on Thursday. In the first accident, a cyclist was hit by a speeding Bolero pick-up van bearing registration number AS03AC2967 and the vehicle, after hitting the man, fled from the scene. The 108 service ambulance allegedly did not arrive on time and the injured were rushed to Jorhat Medical College nd Hospital in the police vehicle by Ujjal Borah, the officer in-charge of the Lichubari outpost, said eye witness Tridip Khound. In the second accident, two motorcyclists hit a parked vehicle in front of the Bongalpukhuri Pollution Centre following which both the bike riders received multiple injuries on the head and chest and were rushed to JMCH. They are said to be critical. | english |
package com.douzi.accesshand;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import java.util.List;
/**
* Created by quan on 2017/3/25.
*/
public class RegionAdapter extends BaseQuickAdapter<RegionModel> {
public RegionAdapter(List<RegionModel> data) {
super(R.layout.item_list_region, data);
}
@Override
protected void convert(BaseViewHolder holder, RegionModel regionModel) {
holder.setText(R.id.name, regionModel.getName());
}
}
| java |
Boeing’s first orbital test flight of its Starliner spacecraft ended in failure in 2019, so the aviation giant is keen to get it right second time around.
Following extensive work on the spacecraft to correct all of the flaws that ruined its first outing, Boeing and NASA are now targeting July 30 for the capsule’s next test flight.
The uncrewed mission will see Starliner blast off from Cape Canaveral in Florida before docking with the International Space Station (ISS). After a short stay it will then return to Earth and make a ground landing.
“Boeing and NASA are targeting 2:53 p.m. ET on Friday, July 30, for the launch of Starliner’s uncrewed Orbital Flight Test-2, or OFT-2, mission to the ISS, pending range approval,” Boeing said in a release, adding that the updated launch target fits with both the ISS schedule and the availability of United Launch Alliance’s Atlas V rocket.
Should the second test flight go according to plan, the third orbital flight is likely to see Starliner transport three astronauts to and from the space station in a mission that could take place before the end of this year. Future flights could see the Starliner carry as many as seven astronauts at a time into orbit.
Boeing said that it recently completed end-to-end testing of Starliner’s flight software, an exercise that involved a simulated OFT-2 mission using operations teams and relevant hardware over a period of five days.
Following Starliner’s first launch in December 2019, the spacecraft failed to reach the targeted orbit, preventing it from completing its journey to the space station.
After a thorough investigation, various issues were discovered with the Starliner capsule, all of which had to be fixed ahead of a second test flight. That work is now complete.
NASA selected Boeing to be part of its Commercial Crew Program, a public-private partnership that pairs the agency’s space experience with private companies’ new technology with a view to ramping up space travel availability.
The Commercial Crew Program has already scored a major success after NASA and SpaceX succeeded in returning human spaceflight missions to U.S. territory after a decade-long hiatus.
| english |
SWEET TIME: AICC President Rahul Gandhi, State in-Charge K. C. Venugopal, KPCC President Dr. G. Parameshwara and AICC Member Dr. Pushpa Amarnath sharing a lighter moment after District in-Charge Minister Dr. H. C. Mahadevappa gave chocolates to the leaders. Picture below shows the calorie-conscious and fit Rahul handing over the chocolate to senior Congress leader Mallikarjun Kharge.
No to Crown: When Zameer Ahmed Khan (extreme left) wanted to honour Rahul Gandhi with a silver crown (Tipu Peta), the AICC President refused to accept it. However, Rahul Gandhi accepted the sword and garland given by Zameer Ahmed Khan, a former JD(S) MLA, who joined the Congress party at the Mysuru Rally yesterday.
Mysuru: Barricaded roads, ban on vehicle entry, armed commandoes covering the VVIPs, people barred from certain points, thick security cover, bandh-like atmosphere, argument between media persons and the Police — these were a few scenes witnessed at Chamundeshwari Temple atop the imposing Chamundi Hill in city this morning when Congress President Rahul Gandhi came calling…. | english |
<gh_stars>1-10
import React from 'react';
import renderer from 'react-test-renderer';
import Schedule from '../../src/Components/Schedule';
import Adapter from 'enzyme-adapter-react-16';
import Enzyme from 'enzyme';
import {shallow} from 'enzyme';
import {View} from 'react-native';
import {Alert} from 'react-native';
import ScheduleItem from '../../src/Components/ScheduleItem';
// import axios from 'axios';
// import MockAdapter from 'axios-mock-adapter';
require('bezier');
Enzyme.configure({adapter: new Adapter()});
// var mock = new MockAdapter(axios);
const props = {
navigation: {
state: {
params: {
userId: 1
},
visible: false
}
}
};
test('renders correctly' , () => {
const tree = renderer
.create(<Schedule {...props} />)
.toJSON();
expect(tree).toMatchSnapshot();
});
const flushPromises = () => new Promise(resolve => setImmediate(resolve));
it('testing axios', async () => {
const wrapper = shallow(<Schedule/>);
await flushPromises();
wrapper.update();
expect(wrapper).toMatchSnapshot();
});
it('should test rowHasChanged correctly', () => {
// This is to test component functions
let weekSchedule = renderer
.create(
<Schedule
dispatch={action =>
expect(action)
.toEqual(true)
}
/>
)
.getInstance();
weekSchedule.rowHasChanged(1,2);
});
it('should test renderEmptyDate correctly', () => {
// This is to test component functions
let weekSchedule = renderer
.create(
<Schedule
dispatch={action =>
expect(action)
.toEqual(<View/>)
}
/>
)
.getInstance();
weekSchedule.renderEmptyDate();
});
it('should test timeToString correctly', () => {
// This is to test component functions
const date_string = '06/03/2018 08:00';
const retrun_string = '2018-06-03';
let weekSchedule = renderer
.create(
<Schedule
dispatch={action =>
expect(action)
.toEqual(retrun_string)
}
/>
)
.getInstance();
weekSchedule.timeToString(date_string);
});
it('should test renderChangeItem correctly', () => {
// This is to test component functions
let weekSchedule = renderer
.create(
<Schedule
dispatch={action =>
expect(action)
.toEqual(<ScheduleItem/>)
}
/>
)
.getInstance();
weekSchedule.renderChangeItem();
});
it('should test renderItem correctly', () => {
// This is to test component functions
let weekSchedule = renderer
.create(
<Schedule
dispatch={action =>
expect(action)
.toEqual(<ScheduleItem/>)
}
/>
)
.getInstance();
weekSchedule.renderItem();
});
it('should test alert_change correctly', () => {
// This is to test component functions
let weekSchedule = renderer
.create(
<Schedule
dispatch={action =>
expect(action)
.toEqual(Alert.alert)
}
/>
)
.getInstance();
weekSchedule.alert_change('Employee Example');
});
it('should test _alert correctly', () => {
// This is to test component functions
let weekSchedule = renderer
.create(
<Schedule
dispatch={action =>
expect(action)
.toEqual(Alert.alert)
}
/>
)
.getInstance();
weekSchedule._alert('Employee Example');
});
it('should test arrayToObject correctly', () => {
// This is to test component functions
const itemDateResponse = [{
'date': '06/18/2018',
'start_time': '08:00',
'end_time': '18:00',
'sector': 'Sector Example',
'employee': 'Employee Example',
'specialty': 'Specialty Example',
'amount_of_hours': '10h'
}];
const item = {
'06-18-2018': {
'date': '06/18/2018',
'start_time': '08:00',
'end_time': '18:00',
'sector': 'Sector Example',
'employee': 'Employee Example',
'specialty': 'Specialty Example',
'amount_of_hours': '10h'
}};
let weekSchedule = renderer
.create(
<Schedule
dispatch={action =>
expect(action)
.toEqual(item)
}
/>
)
.getInstance();
weekSchedule.setState({itemDate: itemDateResponse});
weekSchedule.arrayToObject();
});
it('should test setModalVisible correctly', () => {
// This is to test component functions
let weekSchedule = renderer
.create(
<Schedule
dispatch={action =>
expect(action)
.toEqual(true)
}
/>
)
.getInstance();
weekSchedule.setModalVisible(true);
});
it('should test requestChange correctly', () => {
// This is to test component functions
let weekSchedule = renderer
.create(
<Schedule
dispatch={action =>
expect(action)
.toEqual(Alert.alert)
}
/>
)
.getInstance();
weekSchedule.requestChange();
});
jest.mock('Alert', () => {
return {
alert: jest.fn()
};
});
it('should test the alert when there is no schedule created', async() => {
const wrapper = shallow(<Schedule/>);
await flushPromises();
wrapper.update();
expect(Alert.alert).toHaveBeenCalled();
});
it('Testing fab',() => {
const spy = jest.spyOn(Schedule.prototype, 'timePickerVisible');
const wrapper = shallow(<Schedule />);
wrapper.setState({active: true});
const fab = shallow(wrapper.instance().fab());
fab.simulate('press');
expect(spy).toHaveBeenCalled();
});
it('Testing timePicker onConfirm', () => {
const spy = jest.spyOn(Schedule.prototype, 'showEndDateTimePicker');
const wrapper = shallow(<Schedule/>);
wrapper.setState({isDateTimePickerVisible: true});
const timePicker = shallow(wrapper.instance().timePicker());
const onConfirm = timePicker.find('TouchableHighlight').at(0);
onConfirm.simulate('press');
expect(spy).toHaveBeenCalled();
});
it('Testing timePicker onCancel', () => {
const spy = jest.spyOn(Schedule.prototype, 'showEndDateTimePicker');
const wrapper = shallow(<Schedule/>);
wrapper.setState({isDateTimePickerVisible: true});
const timePicker = shallow(wrapper.instance().timePicker());
const onCancel = timePicker.find('TouchableHighlight').at(1);
onCancel.simulate('press');
expect(spy).toHaveBeenCalled();
});
it('Testing finalPicker onConfirm', () => {
const spy = jest.spyOn(Schedule.prototype, 'alert_Selfchange');
const wrapper = shallow(<Schedule/>);
wrapper.setState({isDateTimePickerVisible: true});
const finalPicker = shallow(wrapper.instance().finalPicker());
const onConfirm = finalPicker.find('TouchableHighlight').at(0);
onConfirm.simulate('press');
expect(spy).toHaveBeenCalled();
});
it('Testing finalPicker onCancel', () => {
const spy = jest.spyOn(Schedule.prototype, 'timePickerVisible');
const wrapper = shallow(<Schedule/>);
wrapper.setState({isDateTimePickerVisible: true});
const finalPicker = shallow(wrapper.instance().finalPicker());
const onCancel = finalPicker.find('TouchableHighlight').at(1);
onCancel.simulate('press');
expect(spy).toHaveBeenCalled();
});
// it('testing renderItem function', async() => {
// const item = {
// 'start_time': '2018-06-24T08:00',
// 'end_time': '2018-06-24T18:00',
// 'profile_id': '1',
// 'sector_id': '1'
// };
// const spy = jest.spyOn(Schedule.prototype, 'setNames');
// const wrapper = shallow(<Schedule/>);
// wrapper.setState({currentSchedule: item});
// console.log(wrapper.debug());
// const renderI = shallow(wrapper.instance().renderItem(item));
// await flushPromises();
// wrapper.update();
// renderI.simulate('press');
// expect(spy).toHaveBeenCalled();
//
// });
// it('testing renderChangeItem function', () => {
// const item = {
// employee: 'Ezequiel',
// specialty: 'Making tests',
// start_time: '08:00',
// end_time: '10:00',
// amount_of_hours: '2h'
// };
// const spy = jest.spyOn(Schedule.prototype, 'alert_change');
// const wrapper = shallow(<Schedule/>);
// const renderC = shallow(wrapper.instance().renderChangeItem(item));
// renderC.simulate('press');
// expect(spy).toHaveBeenCalled();
// });
it('Testing renderModal function',() => {
const spy = jest.spyOn(Schedule.prototype, 'setModalVisible');
const wrapper = shallow(<Schedule/>);
wrapper.setState({modalVisible: true});
const Modal = shallow(wrapper.instance().renderModal());
const button = Modal.find('ReactNativeModal').at(0).dive();
const backButton = button.find('TouchableWithoutFeedback').at(0);
backButton.simulate('press');
expect(spy).toHaveBeenCalled();
});
// // it('alert_change onPress Não', () => {
// // jest.mock('Alert',() => {
// // return {
// // alert: jest.fn()
// // };
// // }
// // );
// //
// // const wrapper = shallow(<Schedule />);
// //
// // wrapper.instance().alert_change(jest.fn());
// // Alert.alert.mock.calls[0][2][0].onPress();
// // });
//
// // it('alert_change onPress Sim', () => {
// // jest.mock('Alert',() => {
// // return {
// // alert: jest.fn()
// // };
// // });
// //
// // const wrapper = shallow(<Schedule />);
// // wrapper.instance().alert_change(jest.fn());
// // Alert.alert.mock.calls[0][2][1].onPress();
// //
// // });
// //
// // it('_alert onPress Não', () => {
// //
// // jest.mock('Alert',() => {
// // return {
// // alert: jest.fn()
// // };
// // });
// //
// // const wrapper = shallow(<Schedule />);
// //
// // wrapper.instance()._alert(jest.fn());
// // Alert.alert.mock.calls[1][2][0].onPress();
// // });
// //
// // it('_alert onPress Sim', () => {
// //
// // jest.mock('Alert',() => {
// // return {
// // alert: jest.fn()
// // };
// // });
// //
// // const wrapper = shallow(<Schedule />);
// //
// // wrapper.instance()._alert(jest.fn());
// // Alert.alert.mock.calls[1][2][1].onPress();
// // });
//
// it('alert_Selfchange onPress Não', () => {
//
// const date = new Date();
//
// jest.mock('Alert',() => {
// return {
// alert: jest.fn()
// };
// });
//
// const wrapper = shallow(<Schedule />);
//
// wrapper.instance().alert_Selfchange(date);
// Alert.alert.mock.calls[3][2][0].onPress();
// });
//
// it('alert_Selfchange onPress Sim', () => {
//
// jest.mock('Alert',() => {
// return {
// alert: jest.fn()
// };
// });
//
// const date = new Date();
// const wrapper = shallow(<Schedule />);
//
// wrapper.instance().alert_Selfchange(date);
// Alert.alert.mock.calls[3][2][1].onPress();
// });
it('should test axiosProfile', async() => {
const wrapper = shallow(<Schedule sector={true} />);
wrapper.instance().axiosProfile(1,true);
await flushPromises();
wrapper.update();
console.log(wrapper.debug());
});
it('should test axiosUser true', async() => {
const wrapper = shallow(<Schedule sector={true} />);
wrapper.instance().axiosUser(1,true);
await flushPromises();
wrapper.update();
console.log(wrapper.debug());
});
it('should test axiosUser false', async() => {
const wrapper = shallow(<Schedule sector={true} />);
wrapper.instance().axiosUser(1,false);
await flushPromises();
wrapper.update();
console.log(wrapper.debug());
});
it('should test renderItem', async() => {
const item = {
'start_time': '2018-06-24T08:00',
'end_time': '2018-06-24T18:00',
'profile_id': '1',
'sector_id': '1'
};
const spy = jest.spyOn(Schedule.prototype, '_alert');
const wrapper = shallow(<Schedule sector={false}/>);
const render = shallow(wrapper.instance().renderItem(item));
render.setState({loading: false});
console.log(render.debug());
const button = render.find('TouchableHighlight').at(0);
button.simulate('press');
expect(spy).toHaveBeenCalled();
});
it('should test renderChangeItem', () => {
const item = {
'start_time': '2018-06-24T08:00',
'end_time': '2018-06-24T18:00',
'profile_id': '1',
'sector_id': '1'
};
const spy = jest.spyOn(Schedule.prototype, 'setNames');
const wrapper = shallow(<Schedule sector={false}/>);
const render = shallow(wrapper.instance().renderChangeItem(item));
render.setState({loading: false});
console.log(render.debug());
const button = render.find('TouchableHighlight').at(0);
button.simulate('press');
expect(spy).toHaveBeenCalled();
});
it('should test if in selfChange', () => {
const date = '2018-06-24T18:00';
const wrapper = shallow(<Schedule sector={false}/>);
wrapper.setState({finalDateString: false});
wrapper.update();
wrapper.instance().alert_Selfchange(date);
});
//
// it('_alert onPress Não', () => {
//
// jest.mock('Alert',() => {
// return {
// alert: jest.fn()
// };
// });
//
// const wrapper = shallow(<Schedule />);
//
// wrapper.instance()._alert(jest.fn());
// Alert.alert.mock.calls[0][2][0];
// });
| javascript |
from __future__ import unicode_literals
import collections
import restea.errors as errors
import restea.formats as formats
import restea.fields as fields
# TODO: Add fileds with validation
class Resource(object):
'''
Resource class implements all the logic of mapping HTTP methods to
methods and error handling
'''
#: maps HTTP methods to class methods
method_map = {
'get': ('list', 'show'),
'post': 'create',
'put': 'edit',
'delete': 'delete',
}
def __init__(self, request, formatter):
'''
:param request: request wrapper object
:type request: :class: `restea.apapters.base.BaseRequestWrapper`
:param formatter: formatter object
:type formatter: :class: `restea.formats.BaseFormatter`
'''
if not hasattr(self, 'fields'):
self.fields = fields.FieldSet()
self.request = request
self.formatter = formatter
def _iden_required(self, method_name):
'''
Checks if given method requires iden
:param method_name: name of method on a resrouce
:type method_name: str
:returns: boolean value of whatever iden is needed or not
:rtype: bool
'''
return method_name not in ('list', 'create')
def _match_responce_to_fields(self, dct):
'''
Filters output from rest method to return only fields matching
self.fields
:param dct: dict to be filtered
:type dct: dict
:returns: filtered dict, with no values out of self.fields
:rtype: dict
'''
return {
k: v for k, v in dct.items()
if k in self.fields.field_names
}
def _match_resource_list_to_fields(self, lst):
'''
Filters 'list' output from rest method to return only fields matching
self.fields
:param lst: list to be filtered
:type lst: list, tuple, set
:returns: filtered list, with no values out of self.fields
:rtype: generator
'''
return (self._match_responce_to_fields(item) for item in lst)
def _apply_decorators(self, method):
'''
Returns method decorated with decorators specified in self.decorators
:param method: resource instance method from self.method_map
:type method: function
:returns: decorated method
:rtype: function
'''
if not hasattr(self, 'decorators'):
return method
for decorator in reversed(self.decorators):
method = decorator(method)
return method
def _get_method_name(self, has_iden):
'''
Return resource object based on the HTTP method
:param has_iden: specifies if requested url has iden (i.e /res/ vs
/res/1)
:type has_iden: bool
:raises errors.MethodNotAllowedError: if HTTP method is not supprted
:returns: name of the resource method name
:rtype: str
'''
method = self.request.method
method = self.request.headers.get(
'HTTP_X_HTTP_METHOD_OVERRIDE',
method
)
method_name = self.method_map.get(method.lower())
if not method_name:
raise errors.MethodNotAllowedError(
'Method "{}" is not supported'.format(self.request.method)
)
if isinstance(method_name, tuple):
method_name = method_name[has_iden]
if not has_iden and self._iden_required(method_name):
raise errors.BadRequestError(
'Given method requires iden'
)
if has_iden and not self._iden_required(method_name):
raise errors.BadRequestError(
'Given method shouldn\'t have iden'
)
return method_name
@property
def _is_valid_formatter(self):
'''
Returns is self.formatter refers to a valid formatter class object
:returns: whatever self.formatter is valid or not
:rtype: bool
'''
return (
isinstance(self.formatter, type) and
issubclass(self.formatter, formats.BaseFormatter)
)
@property
def _error_formatter(self):
'''
Formatter used in case of error, uses self.formatter with fallback to
`restea.formats.DEFAULT_FORMATTER`
:returns: formatter object
:rtype: :class: `restea.formats.BaseFormatter`
'''
if self._is_valid_formatter:
return self.formatter
else:
return formats.DEFAULT_FORMATTER
def _get_method(self, method_name):
'''
Returns method based on a name
:param method_name: name of the method
:type method_name: str
:raises errors.BadRequestError: method is not implemented for a given
resource
:returns: method of the REST resource object
:rtype: function
'''
method_exists = hasattr(self, method_name)
if not method_exists:
msg = 'Method "{}" is not implemented for a given endpoint'
raise errors.BadRequestError(
msg.format(self.request.method)
)
return getattr(type(self), method_name)
def _get_payload(self):
'''
Returns a validated and parsed payload data for request
:raises restea.errors.BadRequestError: unparseable data
:raises restea.errors.BadRequestError: payload is not mappable
:raises restea.errors.BadRequestError: validation of fields not passed
:returns: validated data passed to resource
:rtype: dict
'''
if not self.request.data:
return {}
try:
payload_data = self.formatter.unserialize(self.request.data)
except formats.LoadError:
raise errors.BadRequestError(
'Fail to load the data'
)
if not isinstance(payload_data, collections.Mapping):
raise errors.BadRequestError(
'Data should be key -> value structure'
)
try:
return self.fields.validate(payload_data)
except fields.FieldSet.Error as e:
raise errors.BadRequestError(e)
except fields.FieldSet.ConfigurationError as e:
raise errors.ServerError(e)
def process(self, *args, **kwargs):
'''
Processes the payload and maps HTTP method to resource object methods
and calls the method
:raises restea.errors.BadRequestError: wrong self.formatter type
:raises restea.errors.ServerError: Some unhandled exception in
resource method implementation or formatter serialization error
:returns: serialized data to be returned to client
:rtype: str
'''
if not self._is_valid_formatter:
raise errors.BadRequestError('Not recognizable format')
self.payload = self._get_payload()
method_name = self._get_method_name(has_iden=bool(args or kwargs))
method = self._get_method(method_name)
method = self._apply_decorators(method)
try:
res = method(self, *args, **kwargs)
except errors.RestError:
raise
try:
return self.formatter.serialize(res)
except formats.LoadError:
raise errors.ServerError('Service can\'t respond with this format')
def dispatch(self, *args, **kwargs):
'''
Dispatches the request and handles exception to return data, status
and content type
:returns: 3 element tuple: result, HTTP status code and content type
:rtype: tuple
'''
try:
return (
self.process(*args, **kwargs),
200,
self.formatter.content_type
)
except errors.RestError as e:
err = {'error': str(e)}
if e.code:
err.update({'code': e.code})
return (
self._error_formatter.serialize(err),
e.http_code,
self._error_formatter.content_type
)
| python |
Mumbai Police Crime Branch on Tuesday detained a 16-year-old boy from Shahpur taluka in Thane for allegedly making a phone call to the police control room late Monday and threatening to kill actor Salman Khan on April 30.
It took three police teams eight hours to detain the teen after a 10-km chase. Probe has revealed that the Class XI dropout had recently seen a video on YouTube about Khan receiving threats from the Lawrence Bishnoi gang and decided to issue a similar threat.
Police said that at 9. 14 pm on Monday, its control room received a call from a caller who identified himself as “goushala rakshak Rocky bhai” from Jodhpur. He claimed he would kill Khan on April 30 and asked police to inform the actor. Following this, security was stepped up outside Khan’s house. The actor has already been provided Y+ category security due to a perceived threat to his life and has a bulletproof vehicle.
A technical investigation led the police to Padgha in Bhiwandi taluka. “Since the suspect had switched off his phone, we zeroed in on a location and looked in some households but in vain. At 7. 30 am, we saw two persons going on a motorcycle and gave them a chase in a vehicle. Seeing that unknown people were chasing them, they sped off. After chasing them for nearly 10 km, we caught them in Dolkhamb,” a senior officer said.
“We found the cellphone used to make the call on the suspect. He also admitted that he had made the call,” the officer added. The boy had come to his 26-year-old cousin’s place in Padgha around 10 days ago. The purpose was to visit famous places in Mumbai and learn imitation jewellery work that his cousin and uncle do at a workshop in Shahpur.
“The boy belongs to Rajasthan’s Barmer district and hails from the Chaudhary community, whose members are animal lovers, and that is why he introduced himself as ‘goushala rakshak’. The boy’s father is a pujari at a temple in Barmer,” an officer said, adding that the cousin did not have any idea that a threat call has been made to the police. After questioning, the crime branch handed over the boy to the Azad Maidan police station. He was produced before the Child Welfare Committee, which will hand him over to his parents on Wednesday, the police said.
Last month, the Mumbai Police had registered an FIR against gangsters Lawrence Bishnoi and Goldy Brar as well as a person named Mohit Garg, for allegedly sending an email threatening Khan. However, the police suspect it to be a hoax.
Last June, a letter was kept at Bandra Bandstand where the actor’s father Salim Khan would go for walk. The letter claimed that the actor, too, would meet the same fate as singer Sidhu Moosewala, who was killed last year. | english |
{
"name": "RatingStarControl",
"version": "0.1.0",
"summary": "별점 입력 및 표현을 해주는 커스텀뷰",
"description": "TODO: Add long description of the pod here.",
"homepage": "https://github.com/taewan0530/RatingStarControl",
"license": {
"type": "MIT",
"file": "LICENSE"
},
"authors": {
"taewan0530": "<EMAIL>"
},
"source": {
"git": "https://github.com/taewan0530/RatingStarControl.git",
"tag": "0.1.0"
},
"platforms": {
"ios": "9.0"
},
"swift_versions": "4.0",
"source_files": "RatingStarControl/Classes/**/*",
"resources": "RatingStarControl/Assets/*.xcassets",
"swift_version": "4.0"
}
| json |
JSW One Platforms will utilise the money to strengthen its market presence and improve its technology. The firm, which houses both business-to-business and business-to-consumer construction ecommerce units, plans to expand operations in newer geographies like Delhi-NCR, Gujarat, Rajasthan, Madhya Pradesh and Chhattisgarh.
The Mumbai-based company launched its B2B marketplace, which is the bigger of the two businesses, in January 2021. It uses the conglomerate's steel, cement and paint business to sell construction materials to small and medium-sized businesses and individual home builders.
Gaurav Sachdeva, CEO of JSW One Platforms, said the business clocked FY23 at about $250 million GMV (gross merchandise value) and expects it to grow to $1 billion in FY24. The company projects that 15% of the sales will be contributed by third-party sellers by then.
“In MSME business (marketplace business) we have 15,000 registered customers (FY23) and targeting 10,000 MSME customers by the end of FY24,” he said. Its total SKUs are also expected to grow from 11,000 in FY23 to about 25,000 by FY24.
Its B2C business involves end-to-end management of building a house for customers. The company has 300 customers in the homes business, which is expected to grow to more than 800 by the end of FY24.
Sachdeva said the venture is expected to be profitable by FY27, by which time the business would touch $5 billion, 73% of which is expected to be JSW’s own products.
| english |
David Warner 100th Test: AUS vs SA LIVE: Australian veteran opener David Warner completed 8,000 runs in Test cricket on Tuesday, becoming the eighth player from his nation to do so. Follow AUS vs SA LIVE updates with InsideSport.IN.
The star batter accomplished this milestone during Australia’s second Test against South Africa at the iconic Melbourne Cricket Ground, which also happens to be his 100th Test match. At the time of writing, Warner is currently unbeaten at 120 off 174 balls, a knock which has consisted of nine fours so far.
Warner hit his 25th Test hundred, ending his Test century drought that lasted for nearly three years. Before this, he had hit his previous century in a longer format on January 3, 2020 against New Zealand. The stylish southpaw currently has 8,042 Test runs at an average of 46.21 in 183 innings across 100 Tests. He has 25 hundreds to his name in the longer format and has scored 34 half-centuries as well. His best individual score in this format of the sport is 335*.
Notably, he is also the seventh-highest run-scorer for Australia in Test cricket. Legendary batter and former skipper Ricky Ponting has scored the most Test runs for Aussies. In 168 matches and 287 innings, Ponting scored 13,378 runs at an average of 51.85. He scored 41 centuries and 62 half-centuries with the best score of 257.
Behind this batter are players like Allan Border (11,174 runs), Steve Waugh (10,927 runs), Michael Clarke (8,643 runs), Matthew Hayden (8,625 runs), Steve Smith (8,503 runs) and Warner. Coming to the match, Australia’s first innings is currently in progress and they have a slender lead over South Africa.
Earlier, put to bat first by Australia, South Africa was bundled out for 189 runs. After the Proteas were down at 67/5, wicketkeeper-batter Kyle Verreynne (52) and Marco Jansen (59) put on a 112-run partnership to stabilise the innings.
All-rounder Cameron Green was the pick of the bowlers for Aussies, taking 5/27. This is his first-ever five-wicket haul in Tests. Mitchell Starc took two wickets while Scott Boland and Nathan Lyon took a wicket each.
Follow InsideSport on GOOGLE NEWS / Follow AUS vs SA LIVE updates with InsideSport.IN.
| english |
#!/usr/bin/env python
#
# File: run_con_hostage.py
#
# Created: Sunday, August 14 2016 by rejuvyesh <<EMAIL>>
#
from __future__ import absolute_import, print_function
import argparse
import json
import numpy as np
import tensorflow as tf
from gym import spaces
import rltools.algos.policyopt
import rltools.log
import rltools.util
from rltools.samplers.serial import SimpleSampler, ImportanceWeightedSampler, DecSampler
from rltools.samplers.parallel import ThreadedSampler, ParallelSampler
from madrl_environments import ObservationBuffer
from madrl_environments.hostage import ContinuousHostageWorld
from rltools.baselines.linear import LinearFeatureBaseline
from rltools.baselines.mlp import MLPBaseline
from rltools.baselines.zero import ZeroBaseline
from rltools.policy.gaussian import GaussianMLPPolicy
from runners.archs import *
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--discount', type=float, default=0.95)
parser.add_argument('--gae_lambda', type=float, default=0.99)
parser.add_argument('--interp_alpha', type=float, default=0.5)
parser.add_argument('--policy_avg_weights', type=str, default='0.3333333,0.3333333,0.3333333')
parser.add_argument('--n_iter', type=int, default=250)
parser.add_argument('--sampler', type=str, default='simple')
parser.add_argument('--sampler_workers', type=int, default=4)
parser.add_argument('--max_traj_len', type=int, default=500)
parser.add_argument('--adaptive_batch', action='store_true', default=False)
parser.add_argument('--n_timesteps', type=int, default=8000)
parser.add_argument('--n_timesteps_min', type=int, default=1000)
parser.add_argument('--n_timesteps_max', type=int, default=64000)
parser.add_argument('--timestep_rate', type=int, default=20)
parser.add_argument('--is_n_backtrack', type=int, default=1)
parser.add_argument('--is_randomize_draw', action='store_true', default=False)
parser.add_argument('--is_n_pretrain', type=int, default=0)
parser.add_argument('--is_skip_is', action='store_true', default=False)
parser.add_argument('--is_max_is_ratio', type=float, default=0)
parser.add_argument('--buffer_size', type=int, default=1)
parser.add_argument('--n_good', type=int, default=3)
parser.add_argument('--n_hostage', type=int, default=5)
parser.add_argument('--n_bad', type=int, default=5)
parser.add_argument('--n_coop_save', type=int, default=2)
parser.add_argument('--n_coop_avoid', type=int, default=2)
parser.add_argument('--n_sensors', type=int, default=20)
parser.add_argument('--sensor_range', type=float, default=0.2)
parser.add_argument('--save_reward', type=float, default=3)
parser.add_argument('--hit_reward', type=float, default=-1)
parser.add_argument('--encounter_reward', type=float, default=0.01)
parser.add_argument('--bomb_reward', type=float, default=-10.)
parser.add_argument('--policy_hidden_spec', type=str, default=GAE_ARCH)
parser.add_argument('--min_std', type=float, default=0)
parser.add_argument('--blend_freq', type=int, default=20)
parser.add_argument('--baseline_type', type=str, default='mlp')
parser.add_argument('--baseline_hidden_spec', type=str, default=GAE_ARCH)
parser.add_argument('--max_kl', type=float, default=0.01)
parser.add_argument('--vf_max_kl', type=float, default=0.01)
parser.add_argument('--vf_cg_damping', type=float, default=0.01)
parser.add_argument('--save_freq', type=int, default=20)
parser.add_argument('--log', type=str, required=False)
parser.add_argument('--tblog', type=str, default='/tmp/madrl_tb')
parser.add_argument('--debug', dest='debug', action='store_true')
parser.add_argument('--no-debug', dest='debug', action='store_false')
parser.set_defaults(debug=True)
args = parser.parse_args()
policy_avg_weights = np.array(map(float, args.policy_avg_weights.split(',')))
assert len(policy_avg_weights) == args.n_good
env = ContinuousHostageWorld(args.n_good, args.n_hostage, args.n_bad, args.n_coop_save,
args.n_coop_avoid, n_sensors=args.n_sensors,
sensor_range=args.sensor_range, save_reward=args.save_reward,
hit_reward=args.hit_reward, encounter_reward=args.encounter_reward,
bomb_reward=args.bomb_reward)
if args.buffer_size > 1:
env = ObservationBuffer(env, args.buffer_size)
policies = [GaussianMLPPolicy(agent.observation_space, agent.action_space,
hidden_spec=args.policy_hidden_spec, enable_obsnorm=True,
min_stdev=args.min_std, init_logstdev=0., tblog=args.tblog,
varscope_name='gaussmlp_policy_{}'.format(agid))
for agid, agent in enumerate(env.agents)]
if args.blend_freq:
assert all(
[agent.observation_space == env.agents[0].observation_space for agent in env.agents])
target_policy = GaussianMLPPolicy(env.agents[0].observation_space,
env.agents[0].action_space,
hidden_spec=args.policy_hidden_spec, enable_obsnorm=True,
min_stdev=0., init_logstdev=0., tblog=args.tblog,
varscope_name='targetgaussmlp_policy')
else:
target_policy = None
if args.baseline_type == 'linear':
baselines = [LinearFeatureBaseline(agent.observation_space, enable_obsnorm=True,
varscope_name='linear_baseline_{}'.format(agid))
for agid, agent in enumerate(env.agents)]
elif args.baseline_type == 'mlp':
baselines = [MLPBaseline(agent.observation_space, args.baseline_hidden_spec,
enable_obsnorm=True, enable_vnorm=True, max_kl=args.vf_max_kl,
damping=args.vf_cg_damping, time_scale=1. / args.max_traj_len,
varscope_name='mlp_baseline_{}'.format(agid))
for agid, agent in enumerate(env.agents)]
else:
baselines = [ZeroBaseline(agent.observation_space) for agent in env.agents]
if args.sampler == 'parallel':
sampler_cls = ParallelSampler
sampler_args = dict(max_traj_len=args.max_traj_len, n_timesteps=args.n_timesteps,
n_timesteps_min=args.n_timesteps_min,
n_timesteps_max=args.n_timesteps_max, timestep_rate=args.timestep_rate,
adaptive=args.adaptive_batch, enable_rewnorm=True,
n_workers=args.sampler_workers, mode='concurrent')
else:
raise NotImplementedError()
step_func = rltools.algos.policyopt.TRPO(max_kl=args.max_kl)
popt = rltools.algos.policyopt.ConcurrentPolicyOptimizer(
env=env, policies=policies, baselines=baselines, step_func=step_func,
discount=args.discount, gae_lambda=args.gae_lambda, sampler_cls=sampler_cls,
sampler_args=sampler_args, n_iter=args.n_iter, target_policy=target_policy,
weights=policy_avg_weights, interp_alpha=args.interp_alpha)
argstr = json.dumps(vars(args), separators=(',', ':'), indent=2)
rltools.util.header(argstr)
log_f = rltools.log.TrainingLog(args.log, [('args', argstr)], debug=args.debug)
with tf.Session() as sess:
sess.run(tf.initialize_all_variables())
popt.train(sess, log_f, args.blend_freq, args.save_freq)
if __name__ == '__main__':
main()
| python |
<filename>src/python/pants/backend/python/typecheck/mypy/rules.py
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import itertools
import logging
from collections import defaultdict
from dataclasses import dataclass
from pathlib import PurePath
from textwrap import dedent
from typing import Iterable, Optional, Tuple
from pants.backend.python.target_types import PythonRequirementsField, PythonSources
from pants.backend.python.typecheck.mypy.subsystem import MyPy
from pants.backend.python.util_rules import extract_pex, pex_from_targets
from pants.backend.python.util_rules.extract_pex import ExtractedPexDistributions
from pants.backend.python.util_rules.pex import (
Pex,
PexInterpreterConstraints,
PexProcess,
PexRequest,
PexRequirements,
)
from pants.backend.python.util_rules.pex_from_targets import PexFromTargetsRequest
from pants.backend.python.util_rules.python_sources import (
PythonSourceFiles,
PythonSourceFilesRequest,
)
from pants.core.goals.typecheck import TypecheckRequest, TypecheckResult, TypecheckResults
from pants.core.util_rules import pants_bin
from pants.engine.addresses import Address, Addresses, UnparsedAddressInputs
from pants.engine.fs import (
CreateDigest,
Digest,
DigestContents,
FileContent,
GlobMatchErrorBehavior,
MergeDigests,
PathGlobs,
)
from pants.engine.process import FallibleProcessResult
from pants.engine.rules import Get, MultiGet, collect_rules, rule
from pants.engine.target import FieldSet, Target, TransitiveTargets, TransitiveTargetsRequest
from pants.engine.unions import UnionRule
from pants.python.python_setup import PythonSetup
from pants.util.docutil import docs_url
from pants.util.logging import LogLevel
from pants.util.ordered_set import FrozenOrderedSet, OrderedSet
from pants.util.strutil import pluralize
logger = logging.getLogger(__name__)
@dataclass(frozen=True)
class MyPyFieldSet(FieldSet):
required_fields = (PythonSources,)
sources: PythonSources
@dataclass(frozen=True)
class MyPyPartition:
field_set_addresses: FrozenOrderedSet[Address]
closure: FrozenOrderedSet[Target]
interpreter_constraints: PexInterpreterConstraints
python_version_already_configured: bool
class MyPyRequest(TypecheckRequest):
field_set_type = MyPyFieldSet
def generate_argv(
mypy: MyPy, *, file_list_path: str, python_version: Optional[str]
) -> Tuple[str, ...]:
args = []
if mypy.config:
args.append(f"--config-file={mypy.config}")
if python_version:
args.append(f"--python-version={python_version}")
args.extend(mypy.args)
args.append(f"@{file_list_path}")
return tuple(args)
def check_and_warn_if_python_version_configured(
*, config: Optional[FileContent], args: Tuple[str, ...]
) -> bool:
configured = []
if config and b"python_version" in config.content:
configured.append(
f"`python_version` in {config.path} (which is used because of the "
"`[mypy].config` option)"
)
if "--py2" in args:
configured.append("`--py2` in the `--mypy-args` option")
if any(arg.startswith("--python-version") for arg in args):
configured.append("`--python-version` in the `--mypy-args` option")
if configured:
formatted_configured = " and you set ".join(configured)
logger.warning(
f"You set {formatted_configured}. Normally, Pants would automatically set this for you "
"based on your code's interpreter constraints "
f"({docs_url('python-interpreter-compatibility')}). Instead, it will "
"use what you set.\n\n(Automatically setting the option allows Pants to partition your "
"targets by their constraints, so that, for example, you can run MyPy on Python 2-only "
"code and Python 3-only code at the same time. This feature may no longer work.)"
)
return bool(configured)
def config_path_globs(mypy: MyPy) -> PathGlobs:
return PathGlobs(
globs=[mypy.config] if mypy.config else [],
glob_match_error_behavior=GlobMatchErrorBehavior.error,
description_of_origin="the option `--mypy-config`",
)
def determine_python_files(files: Iterable[str]) -> Tuple[str, ...]:
"""We run over all .py and .pyi files, but .pyi files take precedence.
MyPy will error if we say to run over the same module with both its .py and .pyi files, so we
must be careful to only use the .pyi stub.
"""
result: OrderedSet[str] = OrderedSet()
for f in files:
if f.endswith(".pyi"):
py_file = f[:-1] # That is, strip the `.pyi` suffix to be `.py`.
result.discard(py_file)
result.add(f)
elif f.endswith(".py"):
pyi_file = f + "i"
if pyi_file not in result:
result.add(f)
return tuple(result)
# MyPy searches for types for a package in packages containing a `py.types` marker file or else in
# a sibling `<package>-stubs` package as per PEP-0561. Going further than that PEP, MyPy restricts
# its search to `site-packages`. Since PEX deliberately isolates itself from `site-packages` as
# part of its raison d'être, we monkey-patch `site.getsitepackages` to look inside the scrubbed
# PEX sys.path before handing off to `mypy`. This will find dependencies installed in the
# `mypy.pex`, such as MyPy itself and any third-party plugins installed via
# `--mypy-extra-requirements`.
#
# We also include the values from our custom env var `EXTRACTED_WHEELS` in this monkey-patch. For
# user's third-party requirements, we don't include them in the `mypy.pex`, as the interpreter
# constraints for their own code may be different than what's used to run MyPy, and this would
# cause issues with Pex. Instead, we extract out the `.deps` folder from `requirements.pex`, and
# set the env var `EXTRACTED_WHEELS` to point to each entry. This allows MyPy to know about user's
# third-party requirements without having to set them on PYTHONPATH.
#
# Finally, we elide the values of PEX_EXTRA_SYS_PATH, which will point to user's first-party code's
# source roots. MyPy validates that the same paths are not available both in site-packages and
# PYTHONPATH, so we must not add this first-party code to site-packages. We use a heuristic of
# looking for relative paths, as all other entries will be absolute paths. (We can't directly look
# for PEX_EXTRA_SYS_PATH because Pex scrubs it.)
#
# See:
# https://mypy.readthedocs.io/en/stable/installed_packages.html#installed-packages
# https://www.python.org/dev/peps/pep-0561/#stub-only-packages
# https://github.com/python/mypy/blob/f743b0af0f62ce4cf8612829e50310eb0a019724/mypy/sitepkgs.py#L22-L28
LAUNCHER_FILE = FileContent(
"__pants_mypy_launcher.py",
dedent(
"""\
import os
import runpy
import site
import sys
site.getsitepackages = lambda: [
*(p for p in sys.path if os.path.isabs(p)),
*os.environ.get('EXTRACTED_WHEELS').split(os.pathsep),
]
site.getusersitepackages = lambda: '' # i.e, the CWD.
runpy.run_module('mypy', run_name='__main__')
"""
).encode(),
)
@rule
async def mypy_typecheck_partition(partition: MyPyPartition, mypy: MyPy) -> TypecheckResult:
plugin_target_addresses = await Get(Addresses, UnparsedAddressInputs, mypy.source_plugins)
plugin_transitive_targets_request = Get(
TransitiveTargets, TransitiveTargetsRequest(plugin_target_addresses)
)
plugin_transitive_targets, launcher_script = await MultiGet(
plugin_transitive_targets_request, Get(Digest, CreateDigest([LAUNCHER_FILE]))
)
plugin_requirements = PexRequirements.create_from_requirement_fields(
plugin_tgt[PythonRequirementsField]
for plugin_tgt in plugin_transitive_targets.closure
if plugin_tgt.has_field(PythonRequirementsField)
)
# If the user did not set `--python-version` already, we set it ourselves based on their code's
# interpreter constraints. This determines what AST is used by MyPy.
python_version = (
None
if partition.python_version_already_configured
else partition.interpreter_constraints.minimum_python_version()
)
# MyPy requires 3.5+ to run, but uses the typed-ast library to work with 2.7, 3.4, 3.5, 3.6,
# and 3.7. However, typed-ast does not understand 3.8, so instead we must run MyPy with
# Python 3.8 when relevant. We only do this if <3.8 can't be used, as we don't want a
# loose requirement like `>=3.6` to result in requiring Python 3.8, which would error if
# 3.8 is not installed on the machine.
tool_interpreter_constraints = PexInterpreterConstraints(
("CPython>=3.8",)
if (
mypy.options.is_default("interpreter_constraints")
and partition.interpreter_constraints.requires_python38_or_newer()
)
else mypy.interpreter_constraints
)
plugin_sources_request = Get(
PythonSourceFiles, PythonSourceFilesRequest(plugin_transitive_targets.closure)
)
typechecked_sources_request = Get(
PythonSourceFiles, PythonSourceFilesRequest(partition.closure)
)
# Normally, this `requirements.pex` would be merged with mypy.pex via `--pex-path`. However,
# this will cause a runtime error if the interpreter constraints are different between the
# PEXes and they have incompatible wheels.
#
# Instead, we teach MyPy about the requirements by extracting the distributions from
# requirements.pex and setting EXTRACTED_WHEELS, which our custom launcher script then
# looks for.
#
# Conventionally, MyPy users might instead set `MYPYPATH` for this. However, doing this
# results in type checking the requirements themselves.
requirements_pex_request = Get(
Pex,
PexFromTargetsRequest,
PexFromTargetsRequest.for_requirements(
(addr for addr in partition.field_set_addresses),
hardcoded_interpreter_constraints=partition.interpreter_constraints,
internal_only=True,
),
)
mypy_pex_request = Get(
Pex,
PexRequest(
output_filename="mypy.pex",
internal_only=True,
sources=launcher_script,
requirements=PexRequirements(
itertools.chain(mypy.all_requirements, plugin_requirements)
),
interpreter_constraints=tool_interpreter_constraints,
entry_point=PurePath(LAUNCHER_FILE.path).stem,
),
)
config_digest_request = Get(Digest, PathGlobs, config_path_globs(mypy))
(
plugin_sources,
typechecked_sources,
mypy_pex,
requirements_pex,
config_digest,
) = await MultiGet(
plugin_sources_request,
typechecked_sources_request,
mypy_pex_request,
requirements_pex_request,
config_digest_request,
)
typechecked_srcs_snapshot = typechecked_sources.source_files.snapshot
file_list_path = "__files.txt"
python_files = "\n".join(
determine_python_files(typechecked_sources.source_files.snapshot.files)
)
create_file_list_request = Get(
Digest,
CreateDigest([FileContent(file_list_path, python_files.encode())]),
)
file_list_digest, extracted_pex_distributions = await MultiGet(
create_file_list_request, Get(ExtractedPexDistributions, Pex, requirements_pex)
)
merged_input_files = await Get(
Digest,
MergeDigests(
[
file_list_digest,
plugin_sources.source_files.snapshot.digest,
typechecked_srcs_snapshot.digest,
mypy_pex.digest,
extracted_pex_distributions.digest,
config_digest,
]
),
)
all_used_source_roots = sorted(
set(itertools.chain(plugin_sources.source_roots, typechecked_sources.source_roots))
)
env = {
"PEX_EXTRA_SYS_PATH": ":".join(all_used_source_roots),
"EXTRACTED_WHEELS": ":".join(extracted_pex_distributions.wheel_directory_paths),
}
result = await Get(
FallibleProcessResult,
PexProcess(
mypy_pex,
argv=generate_argv(mypy, file_list_path=file_list_path, python_version=python_version),
input_digest=merged_input_files,
extra_env=env,
description=f"Run MyPy on {pluralize(len(typechecked_srcs_snapshot.files), 'file')}.",
level=LogLevel.DEBUG,
),
)
return TypecheckResult.from_fallible_process_result(
result, partition_description=str(sorted(str(c) for c in partition.interpreter_constraints))
)
# TODO(#10864): Improve performance, e.g. by leveraging the MyPy cache.
@rule(desc="Typecheck using MyPy", level=LogLevel.DEBUG)
async def mypy_typecheck(
request: MyPyRequest, mypy: MyPy, python_setup: PythonSetup
) -> TypecheckResults:
if mypy.skip:
return TypecheckResults([], typechecker_name="MyPy")
# We batch targets by their interpreter constraints to ensure, for example, that all Python 2
# targets run together and all Python 3 targets run together. We can only do this by setting
# the `--python-version` option, but we allow the user to set it as a safety valve. We warn if
# they've set the option.
config_content = await Get(DigestContents, PathGlobs, config_path_globs(mypy))
python_version_configured = check_and_warn_if_python_version_configured(
config=next(iter(config_content), None), args=mypy.args
)
# When determining how to batch by interpreter constraints, we must consider the entire
# transitive closure to get the final resulting constraints.
# TODO(#10863): Improve the performance of this.
transitive_targets_per_field_set = await MultiGet(
Get(TransitiveTargets, TransitiveTargetsRequest([field_set.address]))
for field_set in request.field_sets
)
interpreter_constraints_to_transitive_targets = defaultdict(set)
for transitive_targets in transitive_targets_per_field_set:
interpreter_constraints = PexInterpreterConstraints.create_from_targets(
transitive_targets.closure, python_setup
) or PexInterpreterConstraints(mypy.interpreter_constraints)
interpreter_constraints_to_transitive_targets[interpreter_constraints].add(
transitive_targets
)
partitions = []
for interpreter_constraints, all_transitive_targets in sorted(
interpreter_constraints_to_transitive_targets.items()
):
combined_roots: OrderedSet[Address] = OrderedSet()
combined_closure: OrderedSet[Target] = OrderedSet()
for transitive_targets in all_transitive_targets:
combined_roots.update(tgt.address for tgt in transitive_targets.roots)
combined_closure.update(transitive_targets.closure)
partitions.append(
MyPyPartition(
FrozenOrderedSet(combined_roots),
FrozenOrderedSet(combined_closure),
interpreter_constraints,
python_version_already_configured=python_version_configured,
)
)
partitioned_results = await MultiGet(
Get(TypecheckResult, MyPyPartition, partition) for partition in partitions
)
return TypecheckResults(partitioned_results, typechecker_name="MyPy")
def rules():
return [
*collect_rules(),
UnionRule(TypecheckRequest, MyPyRequest),
*extract_pex.rules(),
*pants_bin.rules(),
*pex_from_targets.rules(),
]
| python |
Dard Dil Me Bhail song is a Bhojpuri folk song from the Dard Bhail Ba Gahara released on 2018. Music of Dard Dil Me Bhail song is composed by CM Music. Dard Dil Me Bhail was sung by Pawan Sharma, Manorma Raj. Download Dard Dil Me Bhail song from Dard Bhail Ba Gahara on Raaga.com.
| english |
Homeopathy: Just water?
Firstly, I should mention here that my goal with this essay isn't to make the case that homeopathy works. My experience with homeopathy has been positive, but too limited to even convince myself that it works, so I'd hardly expect to persuade anyone else. My intention is to present the much humbler case - that it's not clear that homeopathy is false; and that the most commonly-accepted argument against homeopathy is indeed false, based on phony logic and mistaken premises.
You'll know the argument if you've taken any interest in the subject. It goes like this: "They dilute it so much. It's just water. It can't work."
To phrase the argument more formally, it goes like this:
- Homeopathy involves extremely high dilutions, less than a part per million in some cases.
- Such a dilution is so high, it is pure water.
- A molecule of water in this solution is identical to a molecule in a regular glass of water.
- Therefore, this solution has identical properties to a regular glass of water.
- Therefore, the medicinal effect must be identical to regular water (or a placebo).
If you made it through Logic 101, right away you can see there's a problem here. The assumption is that, because the water molecules are identical in a vial of pure water and a vial of homeopathic solution, the water must have exactly the same properties. However, groups of things sometimes have different properties to individual things. The mistake is a fallacy of composition.
A classic example of a fallacy of composition is to say, both sodium and chlorine are fatal to humans, so when combined they must also be fatal. Therefore sodium chloride (table salt) must also be fatal to humans. But, it's not. The combination of sodium and chlorine in a compound has different properties.
Looking at how chemicals are structured, starting at the subatomic level, we can see how big this error might be. The same kind of neutrons, electrons and protons can be formed into atoms, having much different properties to the original particles. The same kinds of atoms can be arranged into different molecules, with much different properties again. Molecules can even be arranged in solids to form different crystal structures, or to lack crystal structure, with different melting points. So why would it be so strange to suggest that molecules might form different structures in liquids?
In fact, that's exactly what Nobel Laureate Luc Montagnier suggests as a hypothesis to explain his unusual experiments in which water can be coaxed to emit electromagnetic information about a DNA sequence, even when the DNA isn't present in the water. He calls these water structures “naneons”.
Other experiments also show that water isn't “just water”, such as the work of Louis Rey, showing that water can emit light signatures specific to the solution, even once the salts are in an ultra-high or homeopathic dilution, and a study from The Pennsylvania State University, which indicates that homeopathic solutions can be distinguished using stereoscopy, detecting very small bubbles apparently caused by the agitation of the medicine.
Finally, people like to say that there are no peer-reviewed studies that show a positive result. In reality, there are scores of studies that can be uncovered with a simple Google search. Here are a handful of these studies:
- A controlled evaluation of a homoeopathic preparation in the treatment of influenza-like syndromes.
- Chronic primary insomnia: efficacy of homeopathic simillimum.
- Is evidence for homoeopathy reproducible?
So, does this mean that homeopathy works? I don't know. But I do know that reality is too complex and too subtle, and too fascinating, to allow our discovery to be halted by a reductive phrase such as: “It's just water”. We should not be guided solely by our preconceptions, as it is only through the challenging of our previous ideas that we can truly gain knowledge, and wisdom.
| english |
116/7 (17. 0 ov)
119/4 (16. 1 ov)
172/7 (20. 0 ov)
157 (20. 0 ov)
Ishant removed Robson leg-before as wicket falls after lunch on third consecutive day.
Ishant feels that no humiliation can be worse than what happened to Brazil.
The Indian captain also hinted that he could bat at No 6 in the first Test against England.
With a young and hungry team, all the horrors of the 2011 tour to England can be avoided.
James Anderson alone with 355 Test wickets and the Indian pacers together account for 203.
The bowlers did not impress in the two tour matches against Leicestershire and Derbyshire.
India captain MS Dhoni got trolled by the lanky pacer Ishant Sharma on WhatsApp.
Zaheer believes that Ishant Sharma will have to spearhead the bowling attack due to his experience.
Of the current squad, only MS Dhoni has played more Tests than Ishant. | english |
It’s been quite a difficult last few weeks for Formula One and another controversy is what the fraternity would have wanted to avoid. Post the Jules Bianchi accident in Suzuka and the Marussia and Caterham financial crisis, Red Bull Racing is in the news for all the wrong reasons.
Sebastian Vettel is expected to miss the qualifying session later today. The four-time champion has used up his full allocation of five power units and will need to fit a new one for US Grand Prix in Austin.
Vettel, a race winner at the Circuit of Americas, will see his RB10 with a new engine, a new turbo, a new MGU-K and MGU-H, and new energy store and control electronics systems. Vettel was on pole in the previous two editions, and has never finished outside the top two - he won last year's race, and finished second to Lewis Hamilton, at the time racing for McLaren, in the inaugural 2012 event.
But Red-Bull’s decision has got a lot of people talking whether this is how a penalty should be looked at and if the authorities should enforce that all cars participate in qualifying despite a penalty being enforced for the race. Red-Bull’s decision to sit out hasn’t gone down well with the media and fans as well given that the grid is already reduced to 18 cars. Red-Bull ,after being put under pressure from the FIA and the organizers, might ask Vettel to atleast participate in Q1.
Red-Bull are of the view that it doesn’t make sense for them to participate in Qualifying as the German driver would anyhow be starting from the pit-lane on Sunday and would not affect the grid position. Having used the allotted quota of 5 engines for the complete season (as per new rules), Red-Bull thought it was better to skip the session as it might affect them in the last two races in Brazil and Abu Dhabi.
Vettel also expressed his thought on the rule that it wasn’t an ideal situation where a driver is left stranded and helpless to do anything until the race.
While the FIA has been put into question for penalizing the drivers and teams for a new engine, Red Bull have been blamed for being not sporting enough. As Formula One tries to recover from the aftermath of the Financial crisis seeing two teams sitting out the last three races, an instance like this might adversely affect the Formula One brand and as a sport in general. Formula One fans especially in the US too have been vocal about it on social media disagreeing to the strategy followed by Red Bull.
Questions are already being raised with respect to the financial conditions of the teams, the new regulations and also the decline in the audience despite introduction of new tracks during the season. From the FIA’s point of view ,which is in damage control after the controversies that rocked the sport recently, the rule was already communicated to the teams and drivers at the beginning of the season and hence it shouldn’t be taken as a surprise.
Whether or not the rule would be revised for the next season remains to be seen but a strategy followed by Red-Bull surely doesnt project a good image of team and the sport and leads to a loss of credibility in the eyes of the fans and in general.
| english |
Delhi Capitals (DC) batter Aman Hakim Khan stated that he was extremely keen to grab the opportunity that came his way after all-rounder Mitchell Marsh fell sick and was ruled out of the IPL 2023 match against Gujarat Titans (GT) on Tuesday, May 2.
Khan top-scored for DC with 51 off 44 balls to help the team recover from a precarious 23/5. Delhi went on to notch up a total of 130/8 in their 20 overs at the Narendra Modi Stadium in Ahmedabad. Their bowlers then did a fabulous job of restricting Gujarat to 125/6.
Expectations from Khan were pretty low after he registered a highest score of 18 in the five matches he played for DC before Tuesday. However, the 26-year-old was keen to make an impact against GT. Speaking at the post-match conference, he said:
Reflecting on his innings, he added that he batted normally since the team had lost a lot of wickets. Khan said:
Khan and Axar Patel (27) added 50 for the sixth wicket. A handy cameo of 23 in 13 balls from Ripal Patel then lifted DC to 130.
Khan praised veteran pacer Ishant Sharma for bowling a fantastic last over. Gujarat needed 12 to win in six balls, but Ishant gave away only six, while also picking up the wicket of Rahul Tewatia (20 off 7). Speaking about the last over, the DC batter said:
Despite the win, Delhi remain last in the points table with six points from nine games and a net run rate of -0.768. Khan admitted being unsure of the qualification scenario and stated:
DC will next take on Royal Challengers Bangalore (RCB) at the Arun Jaitley Stadium in Delhi on Saturday, May 6.
| english |
{"is_sample_playing":true,"download_path":"http:\/\/api.ritmo.media\/api\/tracks\/1568\/download","free_to":0,"name_fa":"\u062a\u0635\u0646\u06cc\u0641 \u0642\u062f\u06cc\u0645\u06cc \u0631\u0627\u06a9","like_count":0,"lyric":"","thumbnail_list":{},"id":1568,"file_duration_formatted":"21''","rtmp_path":"mp4:ritmo\/128\/sample_44100_2_dfa92d8f817e5b08fcaafb50d03763cf.m4a","free_to_download":false,"dislike_count":0,"file_size_MB":2.92,"rtmp_base":"rtmp:\/\/ritmo.ir:8080\/saod","album_info":{"album_name":"\u0634\u06cc\u0631\u06cc\u0646 \u062f\u06cc\u0644","album_id":124},"publish_time":{"year":null,"month":null},"rbt_code":"","description":"","rtsp_path":"rtsp:\/\/ritmo.ir:8080\/saod\/_definst_\/mp4:ritmo\/128\/sample_44100_2_dfa92d8f817e5b08fcaafb50d03763cf.m4a","hls_path":"http:\/\/ritmo.ir:8080\/saod\/_definst_\/mp4:ritmo\/128\/sample_44100_2_dfa92d8f817e5b08fcaafb50d03763cf.m4a\/playlist.m3u8","file_duration":21,"price":300.0,"free_from":0,"file_checksum":"d4ee5c5eed8a4cc5631cb5a7006e6e67","name_en":"<NAME>","image_path_absolute":"http:\/\/api.ritmo.media\/media\/track\/images\/1568_7554ddf5b3a5b789c580f53c16a240c2.jpg","file_duration_real":109,"track_number":13,"artists_info":[{"name_fa":"\u0645\u0638\u0641\u0631 \u0634\u0641\u06cc\u0639\u06cc","name_en":"<NAME>","type":"singer","id":134}],"free_to_listen":false,"user_activity":null} | json |
package com.dgut.member.entity.base;
import java.io.Serializable;
import com.dgut.member.entity.Member;
import com.dgut.member.entity.MemberLog;
public class BaseMemberLog implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
// constructors
public BaseMemberLog () {
initialize();
}
/**
* Constructor for primary key
*/
public BaseMemberLog (java.lang.Integer id) {
this.setId(id);
initialize();
}
/**
* Constructor for required fields
*/
public BaseMemberLog (
java.lang.Integer id,
java.lang.Integer category,
java.util.Date time) {
this.setId(id);
this.setCategory(category);
this.setTime(time);
initialize();
}
protected void initialize () {}
private int hashCode = Integer.MIN_VALUE;
// primary key
private java.lang.Integer id;
// fields
private java.lang.Integer category;
private java.util.Date time;
private java.lang.String ip;
private java.lang.String url;
private java.lang.String title;
private java.lang.String content;
// many to one
private Member user;
/**
* Return the unique identifier of this class
* @hibernate.id
* generator-class="identity"
* column="log_id"
*/
public java.lang.Integer getId () {
return id;
}
/**
* Set the unique identifier of this class
* @param id the new ID
*/
public void setId (java.lang.Integer id) {
this.id = id;
this.hashCode = Integer.MIN_VALUE;
}
/**
* Return the value associated with the column: category
*/
public java.lang.Integer getCategory () {
return category;
}
/**
* Set the value related to the column: category
* @param category the category value
*/
public void setCategory (java.lang.Integer category) {
this.category = category;
}
/**
* Return the value associated with the column: log_time
*/
public java.util.Date getTime () {
return time;
}
/**
* Set the value related to the column: log_time
* @param time the log_time value
*/
public void setTime (java.util.Date time) {
this.time = time;
}
/**
* Return the value associated with the column: ip
*/
public java.lang.String getIp () {
return ip;
}
/**
* Set the value related to the column: ip
* @param ip the ip value
*/
public void setIp (java.lang.String ip) {
this.ip = ip;
}
/**
* Return the value associated with the column: url
*/
public java.lang.String getUrl () {
return url;
}
/**
* Set the value related to the column: url
* @param url the url value
*/
public void setUrl (java.lang.String url) {
this.url = url;
}
/**
* Return the value associated with the column: title
*/
public java.lang.String getTitle () {
return title;
}
/**
* Set the value related to the column: title
* @param title the title value
*/
public void setTitle (java.lang.String title) {
this.title = title;
}
/**
* Return the value associated with the column: content
*/
public java.lang.String getContent () {
return content;
}
/**
* Set the value related to the column: content
* @param content the content value
*/
public void setContent (java.lang.String content) {
this.content = content;
}
public void setUser(Member user) {
this.user = user;
}
public Member getUser() {
return user;
}
public boolean equals (Object obj) {
if (null == obj) return false;
if (!(obj instanceof MemberLog)) return false;
else {
MemberLog cmsLog = (MemberLog) obj;
if (null == this.getId() || null == cmsLog.getId()) return false;
else return (this.getId().equals(cmsLog.getId()));
}
}
public int hashCode () {
if (Integer.MIN_VALUE == this.hashCode) {
if (null == this.getId()) return super.hashCode();
else {
String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
this.hashCode = hashStr.hashCode();
}
}
return this.hashCode;
}
public String toString () {
return super.toString();
}
}
| java |
Vraća "da" ako je bilo koji argument TRUE, a "ne" ako su svi argumenti FALSE.
Logical1, logical2, ... su 1 do 30 argumenata koje želite testirati i mogu biti TRUE ili FALSE.
Argumenti moraju biti logičke vrijednosti TRUE ili FALSE ili reference na polja u kojima se nalaze logičke vrijednosti.
Ako argument reference stupca sadrži tekst ili je prazan, te se vrijednosti zanemaruju.
Ako zadani argumenti ne sadrže logičke vrijednosti, funkcija OR vraća pogrešku #VRIJ!.
Opis (rezultat)
Jedan argument je TRUE (da)
Svi argumenti su FALSE (ne)
Barem jedan od argumenata je TRUE (da)
| english |
MUSSOORIE has spent the past fortnight perched on the horns of a dilemma, watching first with delight tourists arriving after nearly a year and then, as numbers rose, with growing horror. The hill town, one of the country’s oldest tourist destinations, wasn’t the only one watching either: so were Covid experts at the Centre, ringing alarm bells.
Restrictions have been imposed since, especially for weekends when the rush is the maximum, and strict rules are now in place to regulate the flow of arrivals at tourist spots such as Mall Road, Library Chowk and Company Garden. However, the trade-off is high for the town dependent on tourism.
As per one estimate, Covid has caused losses up to Rs 1,600 crore in the tourism sector for the state. Government data shows that between 2006-07 and 2016-17, tourism accounted for over 50% of the state’s GSDP. Mussoorie alone saw footfall dip to nearly one-fourth between 2019 and 2020 (from 19. 62 lakh to 5. 49 lakh). This year, till July, 4. 65 lakh had visited the town, with the lockdown not as strict as in 2020.
Sandeep Sahni, president of the Uttarakhand Hotels Association, says in the previous fiscal, hotels and guest-houses suffered up to 70 per cent loss in revenues.
At Kuthal Gate on Mussoorie Road, police barricades manned by at least 12 personnel (two sub-inspectors and 10 constables) now let through only tourists who have all the three documents: a negative Covid report, a confirmed hotel booking in Mussoorie and registration on the website of Dehradun Smart City Limited. As of now, the restrictions are applicable till July 25 night.
The vehicles getting the all-clear are allotted stickers with destinations clearly marked — Mussoorie, Dhanaulti, Kempty Fall etc. The Dhanaulti and Kempty Fall vehicles, for example, can’t enter Mussoorie.
One of those turned away is Manoj Kumar of Faridabad, who doesn’t have a hotel booking. S-I N S Rathod tells him to get a booking online and try again. “But there is a network issue in this area, I’m not able to make online payment. I had come to Dehradun for admission of my son in a college and thought would visit Mussoorie over the weekend,” says a dejected Kumar.
Yogesh Pratap and his five friends who have come from Haryana after a seven-hour drive are turned back for the same reason. Yogesh says they had no idea about these rules. “When we entered Uttarakhand, the officials did a rapid antigen test and cleared us as we were all negative,” Yogesh says.
A policeman advises them to either do the booking and return or try their luck on Monday, when the curbs are relaxed.
Outpost in-charge Rakesh Shah says they don’t let through even two-wheelers of local tourists on weekends. Last weekend, 305 four-wheelers and 405 two-wheelers were returned from Kuthal Gate outpost.
Besides regulation of entry, there is also a crackdown against those found violating Covid norms in the city — more than 220 have been booked for this in the past week.
Company Garden management committee member Bagh Singh Rawat says officials randomly inspect the park to ensure no more than half is full, and that masks are on.
Vijay Negi, a government teacher, admits the huge crowd of tourists at Mall Road on July 3 and 4 — images of which made national headlines — left him nervous. Despite taking two shots of Covid vaccine, the 58-year-old decided to not venture out on weekends. “There was an over 4-km queue of vehicles on the road approaching Mussoorie from Dehradun. Here on Mall Road, there were only tourists and vehicles,” he says, adding that many visitors didn’t have masks on.
From the first wave till July 22 this year, Mussoorie recorded 2,521 Covid cases, with 2,493 having recovered, and seven deaths. Only six cases were active as of June 22, with as many as 25,000 of the town’s eligible 30,000 population having received at least one or both doses of Covid vaccine. SDM Manish Kumar says there has been no surge since the tourist arrivals. But that has only boosted fears about what will happen if outsiders stream in from Covid-hit areas.
At Kempty Fall in Tehri Garhwal district, S-I Harkesh Singh monitors crowds from atop a watchtower, along with two-three constables. At 10. 55 am, he signals to his subordinate Ravi Chauhan, who walks to the shop from where some visitors rent out clothes before entering the waterfall, and sounds a siren. The moment he does that, over half-a-dozen constables blow whistles to indicate to those inside the water that their allotted 20 minutes are over and they should come out so that the next set can go in.
As they enter, Harkesh keeps a count. The moment the number hits 50, he signals constables to stop the others. “The water body is spread over 4,000 sq ft and can accommodate many more. But to ensure social distancing, the administration has allowed only 50. The official limit for time inside the waterfall is 30 minutes but we stick to 20 minutes so that more people can enjoy,” Harkesh says.
SDM, Dhanaulti, Ravindra Juvantha says since 50 was the highest number of persons allowed at any public gathering during the Covid curfew, they decided to set the limit at 50 persons.
Deployed at the entry of Kempty Fall, S-I Puran Singh Kathait says, “We don’t ask people to go back once they have reached here from places such as Delhi, Punjab, Chandigarh and UP. Why disappoint them? ” So he keeps an eye on those inside while reassuring the others that their turn will come. | english |
Full-body exercises can help activate smaller muscles, improve blood flow and muscle endurance, build stamina, and focus on burning calories for weight loss.
If you do not get the time to go to the gym, you can always do full-body exercises at home to maintain your physical fitness.
Here are some exercises you can do at home to improve your physical fitness and increase your strength, flexibility, mobility, and endurance.
One of the first exercises that anyone recommends for home workouts is push-ups. This is because push-ups can help your entire body, depending on your palm placement.
The shoulder-width placement focuses on your chest, the close-grip focuses on your tricep, the reverse-grip focuses on your biceps, and the pike push-up helps with your shoulders.
Usually, push-ups are used as warm-ups and finishers, but they can also be useful as part of sets or circuit training.
Moreover, push-ups will help with core strength as well, since your abdominal muscles remain engaged during this exercise.
Another exercise that can be done at home are pull ups. All you need is a pull-up bar.
Pull-ups help with your back muscles, biceps, and rear delts. However, it is the grip that determines which muscle group will be worked on.
A wider grip will focus on your lats and back muscles, and a close-grip will focus on your biceps. However, smaller muscles around your rear delts will engage during each type of pull-up for balance.
Finally, it is important to engage your core muscles during this exercise to ensure stability throughout the movement.
Squats are an exercise that can be done at home. They are effective even without any weights.
When you do squats, you focus on your lower back and legs. It is a great way to improve your quads and hamstring strength, and improve your mobility for daily movements since it helps joints as well.
It is one of the best full-body exercises to focus on if you are searching for functional movements.
Burpees also do not require any weight. It is great for any type of training, such as HIIT or circuit training, and helps with your overall physique development.
If you are looking for full-body exercises that will improve your strength and allow you to cut fat, burpees should be one of your top picks.
Jumping jacks are an excellent exercise to improve your joints, as they focus on improving flexibility and mobility.
You can do jumping jacks as a warm-up, or as a proper cardio movement. The jumps motivate the body to burn extra calories to generate fuel for the additional effort.
Core exercises should never be neglected. Your core strength determines how well-maintained your balance and stability is during compound movements such as bench presses, deadlifts, and others.
Moreover, core strength helps with daily chores as well, by helping your posture and movement.
| english |
Lionel Messi confirms Barcelona players will take 70% wage cut with the Coronavirus outbreak to sustain the working staff at the club.
Barcelona captain Lionel Messi has confirmed on his Instagram that Barcelona players will take a huge 70% wage cut to sustain the income of working staff at the club amidst the pandemic.
Contrary to the reports, where it was circulated that Barcelona’s squad was not willing to take the cut in their wages. However, Messi has denied all the allegations and confronted it in his post.
“It doesn’t cease to surprise us that within the club there were those who tried to put us under the limelight and add pressure for us to do exactly what we intended,” read Messi’s statement.
“On our behalf, it’s time to announce that, besides reducing our wage by 70% during the State of Emergency we’ll also contribute so that club employees can count on 100% of their salary as long as the current situation doesn’t change.
The statement seems to be an attack on the club’s board, and president Josep Maria Bartomeu, who recently announced publicly that the players had been asked to accept a reduction in their wages until football returns.
Messi has claimed that the squad did not need to be asked and were merely taking some time to find the best solution. Earlier, Barcelona’s players were slammed by the media for not accepting the cut.
“There was always going to be a drop in the salary we receive, because we understand that this is an exceptional situation and we are the first ones who have ALWAYS helped the club when it has asked us, Many times we have even done it on our own initiative.” read the statement.
| english |
Wall-mountable entertainment components don't begin and end with TVs. This square CD player features an illuminated Corian surface that displays a back-lit touch screen when turned on and functions as a minimalist decorative wall piece when turned off. A little “magnet” connected to the surface, transforms it into a speaker. No word on availability or pricing.
| english |
{
"body": "this is bit long but to gives complete picture:\n\nI am working on an application with PGI compiler and didn't understand why I was getting below error while compiling only with spack:\n\n``` bash\n 128, Accelerator restriction: call to 'log' with no acc routine information\n```\n\nI looked into `spack/lib/spack/env/pgi/pgcc` and enabled some verbose output. I realise that following extra includes are added : \n\n``` bash\n -I/usr/include\n```\n\nThe associated code in the compiler wrapper is:\n\n``` bash\n# Read spack dependencies from the path environment variable\nIFS=':' read -ra deps <<< \"$SPACK_DEPENDENCIES\"\nfor dep in \"${deps[@]}\"; do\n # Prepend include directories\n if [[ -d $dep/include ]]; then\n if [[ $mode == cpp || $mode == cc || $mode == as || $mode == ccld ]]; then\n args=(\"-I$dep/include\" \"${args[@]}\")\n fi\n fi\n```\n\nI am using `OpenACC` with PGI and the `accelerated` kernels are using some `math` functions. PGI compiler doesn't like `/usr/include` (and hence `math.h`) because it needs `OpenACC` annotated declarations from compiler's directory.\n\nSuppose there are two packages `A` and `B`. `A` has following dependencies (specified as externals with path `/usr`): \n\n``` bash\n depends_on('automake', type='build')\n depends_on('autoconf', type='build')\n depends_on('libtool', type='build')\n```\n\nWhile building package `B` for GPU with `PGI`, spack adds `-I/usr/include` for every dependency mentioned above which causes the problem.\n\nI somewhat understand whats going on and wondering why `build` dependencies path (of `A`) are included for package `B`.\n\nI could work around this by avoiding `/usr`. Has someone else came across this issue and have better way to avoid this situation?\n\np.s. I tried using `fake` path approach but if one of the dependencies is `python` then I got error like:\n\n``` bash\n'import site' failed; use -v for traceback\nTraceback (most recent call last):\n File \"/tmp/kumbhar/spack-stage/spack-stage-zIDsDu/xx/somefile.py\", line 12, in <module>\n import os\nImportError: No module named os\n```\n",
"user": "pramodk",
"url": "https://api.github.com/repos/spack/spack/issues/2180",
"updated_at": "2017-04-14 10:14:26",
"created_at": "2016-10-30 22:41:37",
"closed_at": "2017-04-14 10:14:26",
"state": "closed",
"title": "Compiler wrappers and include of directories from /usr (PGI, OpenACC)",
"number": 2180,
"milestone": null,
"labels": [
"compilers",
"external-packages"
],
"id": 186170232,
"html_url": "https://github.com/spack/spack/issues/2180",
"assignees": [],
"comments": 2
} | json |
According to journalist Pedro Almedia, Liverpool midfielder Thiago Alcantara could rejoin Barcelona. It was at Barcelona that Thiago started his club career before he went to Bayern Munich in 2013.
Barcelona recently brought back club legends Xavi Hernandez as manager and Dani Alves as a player. Thiago could be the latest addition to the list of re-joiners.
Thiago joined Liverpool in 2020 for an initial fee of just £20 million. However, he hasn't been as influential as many Liverpool fans had hoped he would be. He scored just one goal in 30 appearances for them last season, with no assists.
Thiago's injuries haven't helped his case either. He has made just seven appearances this season for Liverpool.
Barcelona, however, are in dire need of experienced players in their ranks. With Lionel Messi and Miralem Pjanic gone, they have had to persist with teenagers like Gavi and Pedri in midfield.
As good as the youngsters are, putting the load of the highest level of football consistently on such young shoulders isn't ideal. Hence, signing Thiago would be a big boost for the Catalan giants.
To say that Barcelona have been going through a tough phase would be an understatement. Their financial troubles have been there for the world to witness. It is because of this that they had to let go of the club legend and arguably the best player in the world, Lionel Messi.
They have also made some expensive but underwhelming signings in recent years. This includes the likes of Philippe Coutinho, Ousmanne Dembele, Antoine Griezmann and more.
Barcelona currently sit ninth in the La Liga table, 11 points off the top. This saw the sacking of Ronald Koeman and the arrival of Xavi Hernandez as the new manager.
Just days after the return of Xavi, the Catalan giants also announced the return of Dani Alves. These are not just quality signings but also a great morale booster for the club and its fans.
Barcelona will now be hoping to get back to winning ways and climb up the ladder in La Liga.
If they manage to sign Thiago Alcantara, it would be a great boost for Barcelona's attempts to return to the summit of Spanish and European football.
| english |
package com.example.project;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.*;
public class Find {
public static void main(String[] args) throws FileNotFoundException {
ArrayList<String> keys = new ArrayList<>(); //список для поиска имён директории и файла
Collections.addAll(keys, args);
boolean d = false; // содержится ли ключ -d
boolean r = false; // содержится ли ключ -r
String dirName = ""; // Имя указанной директориий
for (int i = 0; i < args.length; i++) {
if (args[i].equals("-r")) {
r = true;
keys.remove(args[i]);
}
if (args[i].equals("-d")) {
d = true;
dirName = args[i + 1];
boolean foundDir = false; // существует ли указанная директори
keys.remove(dirName);
keys.remove(args[i]);
if (!isDir(dirName)) {
for (int j = i + 2; j < args.length; j++) {
dirName += " " + args[j];
keys.remove(args[j]);
if (isDir(dirName)) {
foundDir = true;
break;
}
}
} else foundDir = true;
if (!foundDir ) throw new FileNotFoundException("Directory wasn't found");
if (keys.isEmpty()) throw new FileNotFoundException("Enter file name");
}
}
String name = keys.get(0);
if (keys.size() > 1) {
for (int i = 1; i < keys.size(); i++) {
name += " " + keys.get(i);
}
}
if (name.matches("(.*)[/?*:\"<>](.*)")) {
throw new IllegalArgumentException("File contains invalid chars");
}
if (!d && !r) { // Поиск в текущей директории
File file = new File(name);
if (file.exists()) {
System.out.println("File " + name + " was found");
System.out.println("Absolute path: " + file.getAbsolutePath());
}
}
if (!d && r) { // Поиск в поддиректориях текущей директории
File defaultDir = new File(System.getProperty("user.dir")); // директория по умолчанию
find(defaultDir, name);
}
File directory = new File(dirName);
if (d && !r) { // Поиск в указанной директории
for (File file: directory.listFiles()) {
if (file.getName().equals(name)) {
System.out.println("File " + name + " was found");
System.out.println("Absolute path: " + file.getAbsolutePath());
}
}
}
if (d && r) { // Поиск в поддиректориях указанной директории
find(directory, name);
}
}
public static void find(File dirName, String fileName) { // Поиск в поддиректориях
File[] dirList = dirName.listFiles();
assert dirList != null;
for (File file : dirList) {
if (file.isFile()) {
if (file.getName().equals(fileName)) {
System.out.println("File " + file.getName() + " was found");
System.out.println("Absolute path: " + file.getAbsolutePath());
}
} else if (file.isDirectory() && !file.isHidden()) find(file, fileName);
}
}
public static boolean isDir(String directoryName) { // Проверка существования указанной директории
File dir = new File(directoryName);
return dir.isDirectory() && dir.exists();
}
}
| java |
{
"index": 908,
"hash": 3073758979,
"blacklisted": false,
"redacted": false,
"displayProperties": {
"icon": "/common/destiny2_content/icons/4351e3fe33c75c7f2a0a8003440ab9a5.png",
"hasIcon": true,
"description": "I always seem to get a customer with many questions right as things get busiest, in the late afternoon. Today it was a woman. A beautiful, sturdy Guardian with dark, cropped hair and a diagonal stripe of white across each eye—very striking! She had a satchel slung over one shoulder and a stack of books and packages cradled in one arm. By this, I guessed she was a paying customer. She also had a cheeky curl to her lip and a hand on her hip, and she tap-tap-tapped her fingers as she waited. By this, I guessed she was a Hunter.\n\n\"Happy Dawning, Miss…?\" I greeted her.\n\nShe launched right in. \"Can you help me put together a really small, intimate Dawning celebration? Do you have, like, a kit or something?\" she asked, peering back over her shoulder with impatience. \"It's a surprise for… somebody who's used to the Dawning in the City, only now we're all the way over on Mars, so…\"\n\n\"Ah! Well, the Dawning basics are decorations, shared food, and gifts. First: you have a choice of lanterns\"—I pointed to the colorful spheres lining the shop—\"and candles\"—I produced a box of tea candles from under the counter and thumped it down in front of her—\"and streamers.\"\n\n\"Candles and streamers are a fire hazard. I'll take candles and lanterns.\"\n\n\"Silver and yellow lanterns go well together…\"\n\nShe squinted up at my display. \"Purple.\"\n\n\"I'll give you purple, green, and silver. That's a pretty combination. The Dawning is about wonder and beauty, so you don't buy just one lantern.\" I stacked the accordioned lanterns on top of the candles.\n\nShe opened her mouth and then shut it again. I pulled out my biggest assortment of Dawning treats and placed it on the counter. \"Sharing and generosity are the heart of the Dawning. This collection is the one you want\"—here I paused—\"if you want to impress someone you love.\"\n\nShe pursed her lips and pushed the beribboned package of sweets next to the candles and lanterns.\n\nSmiling, I pulled over a rack of my finer garments. \"Finally, the Dawning gift: the most important—\"\n\n\"Oh, I've already got a good Dawning gift.\" She put her belongings on the counter to point out the necklace box on top. I also happened to scan the spines of the thick books, some with very long titles, all labeled, \"Fu'an Library – REFERENCE – DO NOT REMOVE.\"\n\nThe Hunter noticed my frown and shoved the books into her satchel. \"Here's what I picked. Think she'll like it?\"\n\nI didn't know who 'she' was. But I admired the necklace she was showing off: an elongated pendant with an emblem of a little bird, of exquisite workmanship.\n\nShe grinned, \"That design is Golden Age, but the pendant also holds thirty-five petabytes of data!\"\n\nI returned her smile. I also convinced her to buy a sturdy book bag and purple wrapping paper.\n\n\"There! Your own personal Dawning in a bag!\" I said, tucking away her Glimmer and handing over her purchases. \"I hope your companion enjoys the surprise.\"\n\nThe Hunter bobbed her head in thanks and turned to go.\n\n\"Anastasia!\"\n\nWho did I see then but <NAME>, standing arms akimbo in the corridor as the press of the afternoon shopping crowd flowed around him.\n\n\"Zavala,\" muttered the Hunter. She pushed her shoulders back and thrust out her chin; she looked fierce as a falcon.\n\n\"Happy Dawning, Ana. I'm surprised to see you in the Tower.\"\n\n\"Yeah, well, I had errands…\"\n\nBut I missed what else they said, because someone ran up with a package, asking, \"Hey, did I hear that woman was headed back to Mars? This one's going there, too.\"\n\nI ran my eyes down the packing list: candles, lanterns, candy assortment, wrapping paper, cloak… Ordered by a Camrin Dumuzi. I got a funny feeling, it was such a coincidence…\n\n\"I think this is meant to be a surprise. The package can wait for tomorrow's deliveries,\" I replied.\n\nWhen I looked back, Zavala and the Hunter were deep in conversation, the Titan Vanguard wearing a half smile and the woman smirking. By this, I guessed that the Dawning spirit was uniting old friends.\n\nAnd with that, I turned to my next customer.\n\n---\n\nJavelin Mooncake:\nMix Chitin Powder and Sharp Flavor, add Essence of Dawning, then bake.",
"name": "No Such Thing as Coincidence"
},
"subtitle": ""
} | json |
<gh_stars>0
# blogger
A blog website with React.js, Node.js and SQL
| markdown |
{"adapter.min.js":"sha256-epEbGCOyUeI1Fu9Mdq5S5I4DDX/eq3rsiSyv4Fzebvk=","adapter.screenshare.js":"sha256-F6QOrpV8awhDmNeoGHyiRkww0D2qd41hAXCZlUY/26o=","adapter.screenshare.min.js":"sha256-<KEY>} | json |
Suspended IPS officer Param Bir Singh has submitted a copy of alleged conversation between him and DGP Sanjay Pandey before the Supreme Court.
By Sahil Joshi, Vidya : Former Mumbai Police Commissioner Param Bir Singh submitted an affidavit before the Supreme Court, attaching an alleged conversation between him and Director-General of Police (DGP) Sanjay Pandey. In the conversation, DGP Pandey allegedly asked Param Bir Singh to withdraw his letter to Maharashtra Chief Minister Uddhav Thackeray, wherein he had levelled extortion allegation against former home minister Anil Deshmukh.
Param Bir Singh claimed that Sanjay Pandey had promised that he will settle inquires against him if he writes saying that he made those allegations against Anil Deshmukh due to “grievances” and sudden provocation resulting out of statements released by the then home minister.
Param Bir Singh had also submitted a copy of this conversation to the CBI in a letter.
Additionally, Param Bir Singh also raised questions over the continuation of Sanjay Pandey as the DGP, despite UPSC recommending three other officers.
“Sanjay Pandey, despite not being eligible to be the Director General of Police in terms of the judgment and subsequent orders passed by this Hon’ble Court in Prakash Singh’s case, is continuing to hold the position of DGP (head of police force) in the State of Maharashtra. I state that the UPSC empanelment committee, vide its recommendation dated 01. 01. 2021 had recommended the names of three IPS officers for consideration to be appointed as the DGP (Head of Police Force) in the State of Maharashtra. However, the said recommendation has intentionally been kept in deference and Mr. Sanjay Pandey has not only continued to be the DGP, but has also made recommendation for my suspension,” Param Bir Singh told the court.
He has further attached some more conversation with DGP Sanjay Pandey which allegedly took place on April 22, 2021.
Sanjay Pandey allegedly told Param Bir Singh that he had had “positive discussion” over the matter if he is writes the letter as he is advising him to.
In the attached conversation, Param Bir Singh allegedly claimed that he cannot write that there was any "grave and sudden provocation" to write the letter to CM Thackeray and level extortion allegations against Anil Deshmukh.
Meanwhile, the Maharashtra government has also filed their reply to Param Bir Singh’s affidavit, saying that the former Mumbai Police commissioner is no whistleblower as he is claiming in the petition.
Seeking dismissal of his plea, the Maharashtra government said that Param Bir Singh cannot be considered as a "whistleblower" under the law as he chose to speak out against alleged corruption involving former home minister Anil Deshmukh only after his transfer.
'GOVT GOING HAMMER AND TONGS AGAINST ME'
In his rejoinder to the affidavit filed by the Maharashtra government, Param Bir Singh told the Supreme Court that the ruling dispensation was trying to thwart the CBI investigation against Anil Deshmukh and trying to protect DGP Sanjay Pandey.
Singh further stated that the Maharashtra government "is going hammer and tongs against" him and registering one FIR after another, while on the other hand it is defending Pandey by filing writ petitions before the Bombay High Court.
The former Mumbai top cop pointed out that the CBI has filed its affidavit in reply to the writ petition of the Maharashtra government in Bombay High Court stating that the state's petition aims to scuttle the investigation. "It also states that the state wants to protect the wrongdoers and further that the state is not cooperating with the investigation," quotes Singh from the affidavit in reply of CBI. | english |
What do you think?
Usually people are trying to rein me in, not encourage me, but I don’t think Sawyer would. I think instead of wanting me to tone it down, he’d look forward to what I’d throw at him next.
I’ve said it before- life really has a way of working out for me. My advice? A positive attitude and the ability to be flexible is essential. And a dash of delusion never hurts.
Everly (the h) has been in love with Finn (who is 8 years older) since she was 6 and thereon, the trajectory of her life revolved around Finn with the ultimate goal being to become Mrs Finn.
Finn gets a job as a professor at U. Penn and, just like that, Everly decides she will become an undergrad at U. Penn because she would then have 4 years to wear down the completely oblivious Finn.
It is now year 3.5 and she is nowhere close to achieving her goal and at the last attempt of 'operation get Finn to notice me' she meets, Sawyer, Finn's older brother, who falls in love with her at first sight. Thereafter she's forced to ride back to Uni with Sawyer and it's during this 4-hour trip that the script flips. Sawyer tells Everly he would rather prefer she focused on him.
Oh, she resists for all of 4-5 days, however, he's relentless, he sends gifts (a pair of Louboutins, some flowers etc) and with some social media finagling on his part *boom👏🏽, he gets the date.
I liked Sawyer who started as an Alpha male but weirdly morphed into an Alpha minus/Beta Plus, still, I liked him. I also continued to like "fickle" Everly simply because she was super funny and both of them together was doubly fun.
This fun fuzzy feeling persisted until the big conflict, during which (and with no explanation whatsoever) Sawyer breaks up with Everly. Aaaaaaand.... that singular act, ruined this book completely. She mopes about then after some days decides she has to get back with Sawyer, which leads to a very cringe-worthy reunion.
I nearly broke my MacBook. I nearly sobbed. And I was done. HAS SHE NO PRIDE????!
I AM EMOTIONALLY BEREFT.
I tried to sex-talk Finn in the car and he turned on the radio. But I’m an aggressive girl and Finn’s shy so I didn’t let it phase me. Nope. Instead I placed my hand on his thigh, and as I started to slide it up his leg, Finn finally spoke. He said no.In Right this person is called the heroine. This stalkerish behaviour seems to be acceptable if it's a woman doing it. I am done with this author.
| english |
Systems for Advanced Applications (DASFAA 2021)
submissions covering innovative industry database systems and applications,
industry in this area.
Contributions from both industry R&D groups and the academia are welcome.
published in the conference proceedings.
co-chair directly.
Paper submission deadline:
November 04, 2020 (PDT)
Acceptance notification:
Camera ready due:
| english |
import React from "react"
import { Link } from "gatsby"
import { Location } from "@reach/router"
import styles from "./styles.module.css"
const PAGES = [{ to: "/about", display: "About" }]
export default ({ ...spreadableProps }) => {
return (
<Location>
{({ location }) => {
return (
<nav {...spreadableProps}>
<div className={styles.hamburgerMenu}>
<span />
<span />
<span />
</div>
{/* {PAGES.map(p => {
const renderedLink = <Link to={p.to}>{p.display}</Link>
if (p.to === location.pathname) {
return <mark>{renderedLink}</mark>
} else {
return renderedLink
}
})} */}
</nav>
)
}}
</Location>
)
}
| javascript |
import {
childrenConfiguration,
newReleaseConfiguration,
Rental
} from "../../../source/domain/movie/videoStore"
import {calculateRentalPoints} from "../../../source/domain/movie/rentPoint";
describe('Renter Points', function () {
it('two new release movie one day', () => {
let aRental = new Rental(1, newReleaseConfiguration("::title::"));
let anotherRental = new Rental(1, newReleaseConfiguration("::anothertitle::"));
expect(calculateRentalPoints(Array.of(aRental,anotherRental))).toEqual(2)
});
it('two new release movie one day', () => {
let one = new Rental(1, newReleaseConfiguration("::title::"));
let two = new Rental(7, newReleaseConfiguration("::anothertitle::"));
let three = new Rental(4, childrenConfiguration("::children title::"));
expect(calculateRentalPoints(Array.of(one,two,three))).toEqual(4)
});
}); | typescript |
import { Component } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { AlertController, Alert } from 'ionic-angular';
import { AuthService } from '../../services/auth.service';
import { AngularFirestore } from '@angular/fire/firestore';
import { PhoneUserData } from '../../models/phoneuserdata.interface';
@Component({
selector: 'page-signup',
templateUrl: './signup.html'
})
export class SignupPage {
form: FormGroup;
currentAlert: Alert;
constructor(fb: FormBuilder, private auth: AuthService, public alertCtrl: AlertController, private firestore: AngularFirestore) {
this.form = fb.group({
email: ['', Validators.compose([Validators.required, Validators.email])],
password: ['', Validators.compose([Validators.required, Validators.minLength(8)])]
});
}
signup() {
let data = this.form.value;
let credentials = {
email: data.email,
password: data.password
};
this.auth.signUp(credentials).then(a => {
this.firestore.collection<PhoneUserData>('phone_users').add({
UID: a.user.uid,
conn: []
});
a.user.sendEmailVerification();
this.errorPrompt('A verificaiton email has been sent to your email. Please verify your email.', true);
}).catch(err => {
this.errorPrompt(err.message);
})
}
errorPrompt(err, chk=false) {
this.currentAlert = this.alertCtrl.create({
title: chk ? 'Email Verification' : 'Error',
message: err,
buttons: ['OK']
});
this.currentAlert.present();
}
} | typescript |
package io.quarkus.kafka.client.runtime;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.net.URL;
import org.xerial.snappy.OSInfo;
import org.xerial.snappy.SnappyError;
import org.xerial.snappy.SnappyErrorCode;
import org.xerial.snappy.SnappyLoader;
import io.quarkus.runtime.annotations.Recorder;
@Recorder
public class KafkaRecorder {
public void loadSnappy() {
// Resolve the library file name with a suffix (e.g., dll, .so, etc.)
String snappyNativeLibraryName = System.mapLibraryName("snappyjava");
String snappyNativeLibraryPath = "/org/xerial/snappy/native/" + OSInfo.getNativeLibFolderPathForCurrentOS();
boolean hasNativeLib = hasResource(snappyNativeLibraryPath + "/" + snappyNativeLibraryName);
if (!hasNativeLib) {
if (OSInfo.getOSName().equals("Mac")) {
// Fix for openjdk7 for Mac
String altName = "libsnappyjava.jnilib";
if (hasResource(snappyNativeLibraryPath + "/" + altName)) {
snappyNativeLibraryName = altName;
hasNativeLib = true;
}
}
}
if (!hasNativeLib) {
String errorMessage = String.format("no native library is found for os.name=%s and os.arch=%s", OSInfo.getOSName(),
OSInfo.getArchName());
throw new SnappyError(SnappyErrorCode.FAILED_TO_LOAD_NATIVE_LIBRARY, errorMessage);
}
File out = extractLibraryFile(
SnappyLoader.class.getResource(snappyNativeLibraryPath + "/" + snappyNativeLibraryName),
snappyNativeLibraryName);
System.load(out.getAbsolutePath());
}
private static boolean hasResource(String path) {
return SnappyLoader.class.getResource(path) != null;
}
private static File extractLibraryFile(URL library, String name) {
String tmp = System.getProperty("java.io.tmpdir");
File extractedLibFile = new File(tmp, name);
try (BufferedInputStream inputStream = new BufferedInputStream(library.openStream());
FileOutputStream fileOS = new FileOutputStream(extractedLibFile)) {
byte[] data = new byte[8192];
int byteContent;
while ((byteContent = inputStream.read(data, 0, 8192)) != -1) {
fileOS.write(data, 0, byteContent);
}
} catch (IOException e) {
throw new UncheckedIOException(
"Unable to extract native library " + name + " to " + extractedLibFile.getAbsolutePath(), e);
}
extractedLibFile.deleteOnExit();
return extractedLibFile;
}
}
| java |
^^ In this game there is nothing much to see in that regard and everything is left to your imagination .
on Chapter 2 now in Witcher 2 (Roach's path I took)..
what u not liked gameplay?graphics?
Playing Gas Guzzlers Combat Carnage. One time play. Not as interesting as Split Second. More comparable to Blur. But one game it reminds me every step is Flatout. Would have loved more explosions though.
Finished Attic Level but there was a bug in the game - the puzzle of the clock room must be solved first or else solving the clock room puzzle will be a lot more tedious. Anyway, reached Silent Hill.
did u meet the girl sticking posters?
I tried F.E.A.R like that! very scary especially the sounds and shadows of Alma.
It seems that my statement has been grossly misunderstood. What I meant to say was that there is no sexual content in this game and that is left to your imagination. Which I have no problem with. Secondly I love this game. When I said that posting my progress will take the fun out of your experience it only meant that It will reveal all the surprises. Even if i post the names of some missions it may as well spoil your fun. I love this game and i have said that from the very start. Heck i played it for 7 hrs straight and still wanted to play more.
yes the chainsaw & fighting with judge looks like movie Hostel...Met with Elle earlier this time it's not so enjoyable for Alex at-least - had to fight with lots of lurkers and after I finish the power plant mission had to do one thing - just run .. run .. run - all sorts of creepy things came out of dark, anyway managed to escape that and came to know Judge Margaret Holloway is a wicked ***** - anyway, saved Elle from that chainsaw, Wheeler with medkit and now I'm going to unveil the remaining secrets of SH : Homecoming.
Will definetely give a try!
availability may be an issue but if you can don't hesitate to get it from some special sources this game worths that and should be on every scary game lovers collection.
completed the game but the ending was not what I thought it would be .. one replay needed and I've a save file to make things right.
| english |
<reponame>igemsoftwareadmin/ClusteRsy-Linkoping
$(document).ready(function tooltip() {
Tipped.create('.badge.badge-pill.badge-warning', function(element){
return $(element).data('content')},
{
maxWidth: 200,
shadow: false,
});
});
| javascript |
version https://git-lfs.github.com/spec/v1
oid sha256:d778727fcf946dad24eb1bff8ad15575e567c2ab824ccb211ff2967414a36665
size 2084449
| json |
//@formatter:off
/*
* LongPrefix
* Code-Beispiel zum Buch Patterns Kompakt, Verlag Springer Vieweg
* Copyright 2014 <NAME>
*
* Licensed under the Apache License, Version 2.0 (the "License"):
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
//@formatter:on
package de.calamanari.pk.muhai;
import java.io.Serializable;
import java.math.BigInteger;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
/**
* The {@link LongPrefix} is a VALUE-object that represents a <i>valid</i> prefix sequence for a long value to define a keyspace. The size of the prefix can be
* up to 63 bits. 64 bits is invalid because it would create a <i>strange keyspace</i> that has a single member (the prefix itself) but cannot contain any keys.
* A valid special case is an empty prefix (2^64 keys).
* @author <a href="mailto:Karl.Eilebrecht(a/t)calamanari.de"><NAME></a>
*
*/
public final class LongPrefix implements Serializable, Comparable<LongPrefix> {
private static final long serialVersionUID = 1189853182590506689L;
/**
* Special case, an empty prefix means no prefix at all to leverage the maximum number of keys: 2^64.
*/
public static final LongPrefix NONE = new LongPrefix("");
/**
* This two-bits prefix '00' (2^62 keys possible) is a convenient default as it still spans a large keyspace, but eliminates the negative values when
* represented as signed long and it reserves 3 subspaces (e.g. for migration purposes in future). Because the bits on the left are both zero, the keys in
* the defined space will have variable length. For economical reasons (e.g. String representation) this is recommended, especially if the keys to be
* prefixed are expected to be/start rather small.
*/
public static final LongPrefix DEFAULT = new LongPrefix("00");
/**
* This single-bit prefix '0' (2^63 keys possible) causes the signed long representation to never turn negative. This is recommended if the storage
* (db-table) also uses signed longs and negative keys would cause confusion or any processing issues.
*/
public static final LongPrefix POSITIVE = new LongPrefix("0");
/**
* This two-bits prefix '01' (2^62 keys possible) spans a large keyspace, eliminates the negative values when represented as signed long and it reserves 3
* subspaces (e.g. for migration purposes in future). The leading 1-bit on the left causes all keys to have the same length, no matter whether displayed as
* binary String (62 digits), as signed long (19 digits), unsigned integer (19 digits) or hex String (16 digits).
*/
public static final LongPrefix STRAIGHT = new LongPrefix("01");
/**
* This prefix sets the first 33 bits '0', so any key in that space of 2^31 keys will be a positive 32-bit integer.
*/
public static final LongPrefix POSITIVE_31 = new LongPrefix("000000000000000000000000000000000");
/**
* This prefix sets the first 33 bits to '0' followed by a '1' (2^30 keys possible) creating a rather small keyspace with 3 optional subspaces. All keys are
* positive 32-bit-integer values. Because of the single '1' to the left, keys will all have the same length no matter if represented binary (31 digits), as
* signed integer (10 digits) or hex String (8 digits).
*/
public static final LongPrefix STRAIGHT_30 = new LongPrefix("0000000000000000000000000000000001");
/**
* A common list of prefixes to avoid duplicates (static caching).
*/
private static final Map<String, LongPrefix> STANDARD_PREFIXES;
static {
HashMap<String, LongPrefix> map = new HashMap<>();
map.put(NONE.toBinaryString(), NONE);
map.put(DEFAULT.toBinaryString(), DEFAULT);
map.put(POSITIVE.toBinaryString(), POSITIVE);
map.put(POSITIVE_31.toBinaryString(), POSITIVE_31);
map.put(STRAIGHT.toBinaryString(), STRAIGHT);
map.put(STRAIGHT_30.toBinaryString(), STRAIGHT_30);
STANDARD_PREFIXES = Collections.unmodifiableMap(map);
}
/**
* The prefix passed to the constructor<br />
* The only non-transient state to be included in serialization.
*/
private final String prefixString;
/**
* The prefix as an 8-bytes long at the end of the bit vector.
*/
private final transient long prefixWithLeadingZeros;
/**
* The prefix, but moved to the start of the bit vector, at the same time the start key of the keyspace.
*/
private final transient long prefixWithTrailingZeros;
/**
* Number of unique keys in this sub-keyspace of long defined by this prefix
*/
private final transient BigInteger sizeOfKeyspace;
/**
* Returns the {@link LongPrefix} instance for the given prefix string, each character ('0' or '1') stands for a bit.
* @param prefixString composed of '0's and '1's, supports leading zeros, length in range [0 .. 63], empty String is valid, NOT NULL.
* @return prefix instance
* @throws InvalidPrefixException if the given prefix cannot be used
*/
public static LongPrefix fromBinaryString(String prefixString) {
LongPrefix res = STANDARD_PREFIXES.get(prefixString);
if (res == null) {
res = new LongPrefix(prefixString);
}
return res;
}
/**
* Creates a custom prefix from the given bit vector.
* @param prefix composed of 0s and 1s, length in range [0 .. 63], empty String is valid, NOT NULL.
* @throws InvalidPrefixException if the given prefix cannot be used
*/
private LongPrefix(String prefix) {
if (prefix == null) {
throw new InvalidPrefixException("Prefix must not be null, instead specify an empty prefix explicitly as an empty String.");
}
else if (prefix.length() > 63) {
throw new InvalidPrefixException(String.format("Prefix length must be in range [0 .. 63], given: '%s'", prefix));
}
long prefixBinary = 0;
for (int i = 0; i < prefix.length(); i++) {
char ch = prefix.charAt(i);
if (ch == '1') {
prefixBinary |= 1L << (63 - i);
}
else if (ch != '0') {
throw new InvalidPrefixException(String.format("Prefix must be specified as a binary string composed of 0s and 1s, given: '%s'", prefix));
}
}
this.prefixString = prefix;
this.prefixWithTrailingZeros = prefixBinary;
this.prefixWithLeadingZeros = prefixBinary >>> (64 - prefix.length());
this.sizeOfKeyspace = BigInteger.TWO.pow(64 - prefix.length());
}
/**
* Returns the string representation of this prefix (provided at construction time), a character (0, 1) per bit.
* @return prefix as a binary string, may have leading zeros
*/
public String toBinaryString() {
return prefixString;
}
/**
* @return length of the prefix (number of bits starting from the left [0 .. 63])
*/
public int getLength() {
return prefixString.length();
}
/**
* Returns the size of the keyspace with a maximum value of <code>2^64 = 18_446_744_073_709_551_616</code> keys (empty prefix).<br />
* @return number of unique keys in this sub-keyspace of long defined by this prefix
*/
public BigInteger getSizeOfKeyspace() {
return this.sizeOfKeyspace;
}
/**
* Checks whether the given key is prefixed with <b>this</b> prefix. The <i>empty prefix</i> matches all keys.
* @param key to be tested
* @return true if the leading bits from the left of the given long value match this prefix
*/
public boolean match(long key) {
return prefixString.isEmpty() || ((key >>> (64 - prefixString.length())) == prefixWithLeadingZeros);
}
/**
* Returns a new long value where the leading bits (length of prefix) have been <b>replaced</b> with the bits of the prefix. Trailing bits will remain
* unchanged.
* @param key source bits
* @return value with the leading prefix
*/
public long applyTo(long key) {
long res = key;
if (prefixString.length() > 0) {
res = ((key << prefixString.length()) >>> prefixString.length()) | prefixWithTrailingZeros;
}
return res;
}
@Override
public int hashCode() {
return this.prefixString.hashCode();
}
@Override
public boolean equals(Object obj) {
return obj != null && (obj == this || (obj.getClass() == LongPrefix.class && ((LongPrefix) obj).prefixString.equals(this.prefixString)));
}
@Override
public int compareTo(LongPrefix other) {
return this.prefixString.compareTo(other.prefixString);
}
/**
* Returns a description
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(LongPrefix.class.getSimpleName());
sb.append("('");
sb.append(this.prefixString);
sb.append("'");
sb.append(", length=");
sb.append(prefixString.length());
sb.append(", size of keyspace: ");
sb.append(sizeOfKeyspace);
sb.append(")");
return sb.toString();
}
/**
* Replaces the instance during deserialization with, so that serialization won't create duplicates in the same VM.
* @return generator instance
*/
Object readResolve() {
return fromBinaryString(this.prefixString);
}
}
| java |
Groovy : tokenize() vs split() - 推酷 https://www.tuicool.com/articles/IV3I7r
Groovy : tokenize() vs split()
时间 2013-03-14 20:35:35 Intelligrape Groovy & Grails Blogs
原文 http://www.intelligrape.com/blog/2013/03/14/groovy-tokenize-vs-split/
主题 Groovy
The split() method returns a string [] instance and the tokenize() method returns a List instance
tokenize() ,which returns a List ,will ignore empty string (when a delimeter appears twice in succession) where as split() keeps such string.
String testString = 'hello brother'
assert testString.split() instanceof String[]
assert ['hello','brother']==testString.split() //split with no arguments
assert['he','','o brother']==testString.split('l')
// split keeps empty string
assert testString.tokenize() instanceof List
assert ['hello','brother']==testString.tokenize() //tokenize with no arguments
assert ['he','o brother']==testString.tokenize('l')
//tokenize ignore empty string
The tokenize() method uses each character of a String as delimeter where as split() takes the entire string as delimeter
String testString='hello world'
assert ['hel',' world']==testString.split('lo')
assert ['he',' w','r','d']==testString.tokenize('lo')
The split() can take regex as delimeter where as tokenize does not.
String testString='hello world 123 herload'
assert['hello world ',' herload']==testString.split(/\d{3}/)
I hope it helps, feel free to ask if you have any queries
This entry was posted on March 14th, 2013 at 6:05 pm and is filed under Grails . You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response , or trackback from your own site. | markdown |
Sri Lanka captain Angelo Mathews was handed a two-match suspension on Friday for maintaining a slow over-rate during his team's one-wicket defeat against India in the final of the Tri-series in Trinidad.
Sri Lanka captain Angelo Mathews was handed a two-match suspension on Friday for maintaining a slow over-rate during his team’s one-wicket defeat against India in the final of the tri-series in Trinidad.
The rest of the Sri Lankan team members were fined 40 per cent of their match fees, the ICC said in a release.
Match referee David Boon imposed the suspension on Sri Lanka after they were ruled to be three overs short of their target at the end of the match.
The decision means Mathews will not be playing in the first two ODIs of the five-match home series against South Africa on July 20 and July 23 at the R Premadasa Stadium in Colombo.
Mathews pleaded guilty to the offence and accepted the proposed sanction.
According to the ICC Code of Conduct, which deals with serious over-rate offences, the captain receives two suspension points while the players are fined 10 per cent of their match fees for each of the first two overs short and 20-per-cent for every additional over their side fails to bowl in the allotted time.
Two suspension points in the Code equates to a suspension from one Test or two ODIs, to be applied to the subsequent international matches. | english |
<filename>src/connectivity/openthread/third_party/openthread/platform/fuchsia_platform_alarm.cc
// Copyright 2020 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "fuchsia_platform_alarm.h"
#include <lib/zx/time.h>
uint64_t FuchsiaPlatformAlarm::GetTimeMicroSec(void) {
uint64_t cur_time_ns = static_cast<uint64_t>(zx_clock_get_monotonic());
return (cur_time_ns / kNanoSecondsPerMicroSecond);
}
uint32_t FuchsiaPlatformAlarm::GetNowMicroSec(void) { return GetTimeMicroSec() * speed_up_factor_; }
uint32_t FuchsiaPlatformAlarm::GetNowMilliSec(void) {
return GetNowMicroSec() / kMicroSecondsPerMilliSecond;
}
void FuchsiaPlatformAlarm::SetMilliSecAlarm(uint32_t time_ms) {
is_ms_running_ = true;
ms_alarm_ = time_ms;
}
void FuchsiaPlatformAlarm::ClearMilliSecAlarm() { is_ms_running_ = false; }
void FuchsiaPlatformAlarm::SetSpeedUpFactor(uint32_t speed_up_factor) {
speed_up_factor_ = speed_up_factor;
}
uint32_t FuchsiaPlatformAlarm::GetRemainingTimeMicroSec() {
int64_t remaining_time_us = INT32_MAX;
uint32_t now = GetNowMicroSec();
if (is_ms_running_) {
int32_t remaining_time_ms =
(ms_alarm_ - static_cast<uint32_t>(now / kMicroSecondsPerMilliSecond));
if (remaining_time_ms <= 0) {
// Note - code makes an assumption that we'll never set an
// alarm which is more than INT32_MAX msec in future.
// Which is true for practical purposes
return 0;
}
remaining_time_us = remaining_time_ms * kMicroSecondsPerMilliSecond;
remaining_time_us -= (now % kMicroSecondsPerMilliSecond);
}
if (is_us_running_) {
int32_t usRemaining = (us_alarm_ - now);
if (usRemaining < remaining_time_us) {
remaining_time_us = usRemaining;
}
}
remaining_time_us /= speed_up_factor_;
if (remaining_time_us == 0) {
remaining_time_us = 1;
}
return remaining_time_us;
}
bool FuchsiaPlatformAlarm::MilliSecAlarmFired() {
int32_t remaining;
bool alarm_fired = false;
if (is_ms_running_) {
remaining = (int32_t)(ms_alarm_ - GetNowMilliSec());
if (remaining <= 0) {
is_ms_running_ = false;
alarm_fired = true;
}
}
return alarm_fired;
}
bool FuchsiaPlatformAlarm::MicroSecAlarmFired() {
bool alarm_fired = false;
if (is_us_running_) {
int32_t remaining = (int32_t)(us_alarm_ - GetNowMicroSec());
if (remaining <= 0) {
is_us_running_ = false;
alarm_fired = true;
}
}
return alarm_fired;
}
void FuchsiaPlatformAlarm::SetMicroSecAlarm(uint32_t time_us) {
is_us_running_ = true;
us_alarm_ = time_us;
}
void FuchsiaPlatformAlarm::ClearMicroSecAlarm() { is_us_running_ = false; }
uint32_t FuchsiaPlatformAlarm::MilliToMicroSec(uint32_t time_ms) {
return (time_ms * kMicroSecondsPerMilliSecond);
}
uint32_t FuchsiaPlatformAlarm::MicroToMilliSec(uint32_t time_us) {
return (time_us / kMicroSecondsPerMilliSecond);
}
void FuchsiaPlatformAlarm::SetOtStackCallBackPtr(OtStackCallBack* callback_ptr) {
ot_stack_callback_ptr_ = callback_ptr;
}
OtStackCallBack* FuchsiaPlatformAlarm::GetOtStackCallBackPtr() { return ot_stack_callback_ptr_; }
| cpp |
#!/usr/bin/python
import Adafruit_SSD1306
import os
from retrying import retry
from PIL import Image, ImageDraw, ImageFont
class Oled:
def __init__(self, display_bus, font_size):
# declare member variables
self.draw = None
self.font = None
self.disp = None
self.width = None
self.height = None
self.image = None
self.font_size = font_size
# display bus
# Rev 2 Pi, Pi 2 & Pi 3 uses bus 1
# Rev 1 Pi uses bus 0
# Orange Pi Zero uses bus 0 for pins 1-5 (other pins for bus 1 & 2)
self.display_bus = display_bus
# init
self.initialize()
def initialize(self):
# 128x64 display with hardware I2C:
self.disp = Adafruit_SSD1306.SSD1306_128_64(rst=None, i2c_bus=self.display_bus)
# Initialize library.
self.disp.begin()
# Clear display.
self.disp.clear()
self.disp.display()
# Create blank image for drawing.
# Make sure to create image with mode '1' for 1-bit color.
self.width = self.disp.width
self.height = self.disp.height
self.image = Image.new('1', (self.width, self.height))
# Get drawing object to draw on image.
self.draw = ImageDraw.Draw(self.image)
# set full puth for incling libs below
full_path = os.path.dirname(os.path.abspath(__file__)) + "/"
# Draw a black filled box to clear the image.
self.draw.rectangle((-20, -20, self.width, self.height), outline=0, fill=0)
self.font = ImageFont.truetype(full_path + "Lato-Heavy.ttf", self.font_size)
@retry()
def display(self, text):
# Draw some shapes.
# First define some constants to allow easy resizing of shapes.
padding = -2
top = padding
# bottom = self.height - padding
# Draw a black filled box to clear the image.
self.draw.rectangle((0, 0, self.width, self.height), outline=0, fill=0)
self.draw.text((0, top), str(text), font=self.font, fill=255)
# Display image.
self.disp.image(self.image)
self.disp.display()
| python |
Rep. Ralph Abraham, R-La. , said Wednesday that he will not seek another term in Congress to make good on his promise to serve just two terms, despite a last-minute pitch from President Trump to reconsider.
Abraham recently made an unsuccessful attempt in the Louisiana gubernatorial race but insisted that the loss did not play a role in his decision.
"This decision was made before I ever took office," he told the News Star, a paper in Monroe. Abraham served on the House Armed Services Committee and the House Agriculture Committee.
He said he was "humbled" that Trump asked him to give it another go while aboard Air Force One while headed to the NCAA National Championship Game, but his decision was made.
There’s good reason why Trump made the pitch. Politico pointed out that he is one of about two dozen Republicans who announced that they won't seek re-election in 2020.
Democrats, who’ve flipped several House seats last year, are expected to make plays on many of these seats. Republicans will insist that these districts will be defended, but the lack of an incumbent will likely add to the vulnerability of even some secure seats.
To retake the House, Republicans need to win back these seats and pick up an additional 19. FiveThirtyEight pointed out that it is rare that a party can win so many seats when there is an incumbent president.
Abraham’s seat doesn’t appear to be vulnerable in 2020, reports said. | english |
<reponame>wiio12/trpg<filename>src/main/java/indi/wiio/controllers/showcase/ShowcaseWindow.java
package indi.wiio.controllers.showcase;
import indi.wiio.controllers.imageExplorer.ImageExplorer;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.*;
import javafx.scene.image.Image;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.Pane;
import javafx.scene.layout.Region;
import javafx.scene.layout.StackPane;
import javafx.stage.FileChooser;
import javafx.stage.Stage;
import indi.wiio.network.client.ClientMain;
import indi.wiio.utils.Univ;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.*;
public class ShowcaseWindow implements Initializable {
public Tab tab;
public TextField nameField;
public Region resetButton;
public Region uploadButton;
public Pane imageExplorerContainer;
private ShowcaseItem showcaseItem = new ShowcaseItem();
private ImageExplorer imageExplorer = new ImageExplorer();
private Boolean active = true;
@Override
public void initialize(URL url, ResourceBundle resourceBundle) {
Tooltip.install(resetButton, new Tooltip("重置图片浏览器视图"));
Tooltip.install(uploadButton, new Tooltip("发送图片"));
//TODO:改bind?
nameField.textProperty().addListener((observableValue, s, t1) -> {
showcaseItem.setName(t1);
});
tab.textProperty().bind(nameField.textProperty());
nameField.setText("未命名");
uploadButton.addEventHandler(MouseEvent.MOUSE_PRESSED, mouseEvent -> {
if(showcaseItem.getImage() != null){
try {
ClientMain.getClient().sendShowCaseImage(showcaseItem);
} catch (IOException e) {
e.printStackTrace();
}
}
});
resetButton.addEventHandler(MouseEvent.MOUSE_PRESSED, mouseEvent -> {
if(imageExplorer != null) {
imageExplorer.reset();
}
});
//
// ContextMenu clientList = new ContextMenu();
// MenuItem write = new MenuItem("write");
// MenuItem read = new MenuItem("read");
// clientList.getItems().addAll(write, read);
// write.setOnAction( e -> {
// if(showcaseItem.getImage() != null)
// showcaseItem.writeMapToFile();
// else
// System.out.println("no content displayed!!!!");
// });
// read.setOnAction(e -> {
// showcaseItem.readMapFromFile();
// if(active) {
// addImage(showcaseItem.getImage());
// } else {
// imageExplorer.setImage(showcaseItem.getImage());
// imageExplorer.reset();
// }
// nameField.setText(showcaseItem.getName());
// });
//
// uploadButton.setContextMenu(clientList);
}
@FXML
void inputImage(MouseEvent event) throws IOException {
if(!active) return;
String initialDir = System.getProperty("user.dir");
FileChooser fileChooser = new FileChooser();
fileChooser.setTitle("Insert image");
fileChooser.setInitialDirectory(new File(initialDir));
fileChooser.getExtensionFilters().addAll(new FileChooser.ExtensionFilter("images","*.jpg","*.png","*.gif"));
File selectedFile = fileChooser.showOpenDialog((Stage)imageExplorerContainer.getScene().getWindow());
if (selectedFile != null) {
String imagePath = selectedFile.getAbsolutePath();
imagePath = imagePath.replace('\\', '/');
showcaseItem.setImage(new Image("File:"+imagePath));
showcaseItem.setImageType(Univ.getFileType(imagePath));
addImage(showcaseItem.getImage());
}
}
public void setAll(ShowcaseItem showcaseItem){
this.showcaseItem = showcaseItem;
addImage(showcaseItem.getImage());
nameField.setText(showcaseItem.getName());
}
private void addImage(Image image) {
StackPane imageExplorerPane = imageExplorer.initialize((Stage)imageExplorerContainer.getScene().getWindow());
imageExplorerContainer.getChildren().addAll(imageExplorerPane);
imageExplorer.setImage(image);
imageExplorer.reset();
imageExplorerContainer.getStyleClass().remove("imageExplorerContainerActive");
imageExplorerContainer.heightProperty().addListener( (observableValue, number, t1) -> {
imageExplorer.reset();
});
imageExplorerContainer.widthProperty().addListener( (observableValue, number, t1) -> {
imageExplorer.reset();
});
active = false;
}
//
// @FXML
// void reset(MouseEvent event) {
// if(imageExplorer != null) {
// imageExplorer.reset();
// }
// }
public ShowcaseItem getShowcaseItem() {
return showcaseItem;
}
public void upload(MouseEvent mouseEvent) {
//TODO:upload
}
}
| java |
VANCOUVER, British Columbia – Just hours before the end of Google's $1 million hack challenge, a teenager who once applied to work at Google without getting a response, hacked the company's Chrome browser using three zero-day vulnerabilities, one of which allowed him to escape the browser's security sandbox.
The tall teen, who asked to be identified only by his handle "Pinkie Pie" because his employer did not authorize his activity, spent just a week and a half to find the vulnerabilities and craft the exploit, achieving stability only in the last hours of the contest.
A demonstration of the teen's hack took a slight departure from other hack demonstrations this week. Instead of opening the calculator application on the targeted machine to demonstrate success, Pinkie Pie's hack ended with an image of an axe-wielding Pinkie Pie pony, a character from the wildly popular My Little Pony animated TV series.
The hack qualifies him for one of the top $60,000 prizes that are part of Google's $1 million Pwnium challenge, and could be the launch of a new security career.
The teen said the escape from the sandbox was surprisingly more easy to do than other parts of his exploit.
"I got lucky because I found a way to do that relatively early," he said.
The sandbox is a security feature in Chrome and some other browsers that’s meant to contain malware and keep it from breaking out of the browser and affecting a computer’s operating system and other applications. Sandbox vulnerabilities are highly prized, because they’re rare, hard to find and allow an attacker to escalate his control of a system.
Google declined to discuss details of the three vulnerabilities the teen used in his exploit until the company can create and distribute a patch.
He dropped the exploit just hours before the end of the three-day contest, which was held at the CanSecWest conference in Canada.
Pinkie Pie was one of only two contestants in the contest, which Google launched only this year. The other contestant was Russian university student Sergey Glazunov whose zero-day exploit kicked off the contest on Wednesday for another $60,000 win.
Glazunov’s attack took advantage of the Chrome extension subsystem to sidestep the browser’s sandbox. The exploit used two zero-day vulnerabilities, which Google quickly patched within a day of Glazunov's demonstration.
Glazunov has an advantage over Pinkie Pie in hacking Chrome. He’s one of Google’s most prolific bug finders and earned around $70,000 for previous bugs he’s found under the company’s year-round bug bounty program. As such, he's very familiar with the Chrome code base.
Pinkie Pie, wearing shorts, a t-shirt and glasses, said he'd never submitted a vulnerability report to Google before, but he had sent his resume to the company last year seeking a job. He wrote in his cover note that he could crack Chrome on OSX, but he never got a reply.
But now it looks like the teen might soon be riding his pony into the Googleplex. A member of Google's security team on-site at the conference said they'd be sure to follow up on his resume now.
| english |
We always continually offer you the most conscientious purchaser services, and the widest variety of designs and styles with finest materials. These efforts include the availability of customized designs with speed and dispatch for Led Batten Light, Led Panel 60x120, High Bay Luminaire, Home T8 Led Tube,25w High Bay Light Lifter. We are sincerely looking forward to establishing good cooperative relationships with customers from at home and abroad for creating a bright future together. The product will supply to all over the world, such as Europe, America, Australia,New Orleans, Estonia,Brasilia, Thailand.To get more information about us as well as see all our products, please visit our website. To get more information please feel free to let us know. Thank you very much and wish your business always be great!
| english |
Posted On:
The Union Government is committed to accelerating the pace and expanding the scope of COVID-19 vaccination throughout the country. The nationwide COVID 19 vaccination started on 16th January 2021. The new phase of universalization of COVID-19 vaccination commenced from 21st June 2021. The vaccination drive has been ramped up through availability of more vaccines, advance visibility of vaccine availability to States and UTs for enabling better planning by them, and streamlining the vaccine supply chain.
As part of the nationwide vaccination drive, Government of India has been supporting the States and UTs by providing them COVID Vaccines free of cost. In the new phase of the universalization of the COVID19 vaccination drive, the Union Government will procure and supply (free of cost) 75% of the vaccines being produced by the vaccine manufacturers in the country to States and UTs.
(As on 8th June 2022)
More than 193.53 crore (1,93,53,58,865) vaccine doses have been provided to States/UTs so far through Govt. of India (free of cost channel) and through direct state procurement category.
More than 14.48 Cr (14,48,56,780) balance and unutilized COVID Vaccine doses are still available with the States/UTs to be administered.
| english |
<gh_stars>0
package lazarusgame;
import java.awt.*;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import static javax.imageio.ImageIO.read;
public class Title implements KeyListener{
private boolean start = false;
private int key;
private BufferedImage titleimg;
private BufferedImage bgImg;
Title(int key)
{
this.key=key;
try {
titleimg = read(new File("Resources/Title.gif"));
} catch (IOException ex) {
System.out.println(ex.getMessage());
}
try {
bgImg = read(new File("Resources/Background.bmp"));
} catch (IOException ex) {
System.out.println(ex.getMessage());
}
}
public void keyTyped(KeyEvent ke) {
int keyTyped = ke.getKeyChar();
if (keyTyped == key) {
this.start =true;
}
}
public void keyPressed(KeyEvent ke) {}
public void keyReleased(KeyEvent ke) {}
boolean isStart()
{
return this.start;
}
void drawImage(Graphics g)
{
Graphics2D g2d = (Graphics2D) g;
g2d.drawImage(this.bgImg, 0,0,1280,960, null);
g2d.drawImage(this.titleimg, 0,0,1280,960, null);
String string = "PRESS 'Enter' TO START THE GAME!!! ";
Font displayFont = new Font("TimesNewRoman", Font.BOLD, 48);
g2d.setFont(displayFont);
g2d.setColor(Color.WHITE);
g2d.fill3DRect(200,40,900,80,true);
g2d.setColor(Color.BLACK);
g2d.drawString(string, 200, 100);
}
}
| java |
Mumbai: The rupee Thursday weakened by 24 paise to hit another low of 74. 45 against the US dollar on strong demand for the American currency from importers amid unabated foreign fund outflows and a sharp losses in the domestic equity market.
At the Interbank Foreign Exchange (forex) market, the domestic currency opened weak at 74. 37 and slipped further to quote at an all-time low of 74. 45, depreciating 24 paise against the US dollar in the early trade.
weighed on the domestic currency.
On Wednesday, the rupee snapped its six-session losing streak to end 18 paise higher at 74. 21 against the US dollar after the American currency weakened overseas.
Foreign institutional investors (FIIs) sold shares net worth a net of Rs 1,096 crore Wednesday, provisional data showed.
Investors remained concerned over sustained foreign capital outflows.
Meanwhile, the BSE benchmark Sensex crashed 1,030. 40 points, or 2. 95 per cent, to hit 33,730. 49 in opening trade. | english |
Moscow, May 31: Russian vy vessels fired four sea-launched cruise missiles at Islamic State (IS) targets near the Syrian city of Palmyra, the Defence Ministry said on Wednesday.
The Kalibr cruise missiles were launched late on Monday from the eastern Mediterranean Sea by the Russian fleet frigate “Admiral Essen” and the “Krasnodar” submarine, which fired its missiles from underwater, Efe news reported.
“The Russian vy has demonstrated its capacity to launch successful attacks with high precision weapons on short notice once given its launch orders,” said the Russian Ministry note.
The Ministry said the US, Turkey and Israel were informed of the strikes at the “appropriate time”.
It was the first combat operation for both Russian ships, according to the Russian Defence press note. The ministry confirmed that all four missiles destroyed their targets — IS heavy weapons and militant concentrations redeployed from Al Raqqa, the extremist group’s principal bastion city in Syria. (IANS) | english |
There have been recent reports that guard James Harden is unhappy with the Brooklyn Nets. As Thursday's trade deadline nears, a report Friday said the Philadelphia 76ers may be making a push to land the three-time scoring champ, and Brooklyn is ready to listen to that pitch.
According to The Athletic's Shams Charania, the Nets are open to conversations regarding Harden and the Philadelphia 76ers are interested. There's a concern that Harden's playing style might not be the right fit alongside Brooklyn's Kyrie Irving and Kevin Durant, which could be a factor in the willingness to entertain offers.
"There’s expectation that both the 76ers and Nets will engage in dialogue on a deal around Simmons for Harden this week, multiple sources say, with Philadelphia holding a chest of role players in Seth Curry, Tyrese Maxey and Matisse Thybulle that could sweeten a potential package," Charania reported.
"Still, there’s no urgency for Nets officials, who have had the steadfast belief that the current core, as is, has the means necessary for a championship. However, it’s believed that an opening exists should an offer elevate the team and make the roster more well-rounded as the franchise pursues a championship."
Sixers president Daryl Morey has maintained his stance on getting an All-Star in return for disgruntled guard Ben Simmons and might finally get his wish. Simmons has not played this season, stating he is not mentally ready to play for the Sixers. If they pull off the deal, Harden and Joel Embiid could form a one-two punch lethal enough to contend for a championship.
Harden did not sign a contract extension with the Nets during the 2021 offseason, but it seemed like it was a no-brainer. According to the New York Post's Brian Lewis, Nets owner Joe Tsai said Harden wants to retire with the team.
Despite the reported positive conversations the organization had with Harden, "The Beard" was not in a hurry to sign as he wanted to test free agency and focus on winning a championship.
James Harden has not played his best brand of basketball this season, averaging 22.5 points (his lowest average in the last nine seasons). But he has been named a reserve for the All-Star Game. He stepped up around Christmas upon his return from health protocols but has since cooled down again.
The 2018 MVP has not been dependable for the Nets, and perhaps they would be further down the Eastern Conference standings if not for the efforts of Kevin Durant. Since KD sprained his MCL on Jan. 15, the Nets have a 2-7 record, with Harden leading the charge, and are sixth in the East.
Although Harden has not played at the level many expected, his presence still makes the Nets one of the most lethal teams in the league. In the 16 games their Big Three have played in, they have a 13-3 record.
Harden is currently sidelined with hamstring tightness and will miss the game against the Utah Jazz on Friday night. If a deal between the Nets and the Sixers pulls through, the next time we might see Harden play would be in a Sixers uniform.
Check out all NBA Trade Deadline 2024 deals here as big moves are made!
| english |
{
"copyright_text": "Standard YouTube License",
"description": "ReScience is a peer-reviewed journal that target computational research and encourage the explicit reproduction of already published research promoting new and open-source implementations in order to ensure the original research is reproducible. To achieve such a goal, the whole editing chain is radically different from any other traditional scientific journal and ReScience lives on github.",
"duration": 929,
"language": "eng",
"recorded": "2015-10-05",
"related_urls": [],
"speakers": [
"<NAME>",
"<NAME>"
],
"tags": [],
"thumbnail_url": "https://i.ytimg.com/vi/orLYVhSrOwk/maxresdefault.jpg",
"title": "ReScience Initiative",
"videos": [
{
"type": "youtube",
"url": "https://www.youtube.com/watch?v=orLYVhSrOwk"
}
]
} | json |
var searchData=
[
['wolk_5fctx',['wolk_ctx',['../structwolk__ctx.html',1,'']]]
];
| javascript |
<filename>data/usercss/67969.user.css
/* ==UserStyle==
@name Scrollbar: Glowy Ring (dark blue scheme)
@namespace USO Archive
@author jongo
@description `CSS scrollbar for firefox (browser-chrome) with an emphasis on css gradient/transparency.`
@version 20120624.3.14
@license NO-REDISTRIBUTION
@preprocessor uso
==/UserStyle== */
/* AGENT_SHEET */
@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
scrollbar > slider { -moz-appearance: none !important; box-shadow: inset 0px 0px 2px 1px black, inset 0px 0px 4px 1px hsla(220,30%,20%,0.5); border-radius: 10px; background-color: hsla(220,60%,30%,0.85); }
scrollbar[orient='horizontal'] > slider { background-image: -moz-linear-gradient(left, hsla(220,60%,30%,0.85), hsla(220,40%,10%,0.85), hsla(220,60%,30%,0.85), hsla(220,60%,30%,0.85), hsla(220,40%,10%,0.85), hsla(220,60%,30%,0.85), hsla(220,60%,30%,0.85), hsla(220,40%,10%,0.85), hsla(220,60%,30%,0.85)); }
scrollbar[orient='vertical'] > slider { background-image: -moz-linear-gradient(top, hsla(220,60%,30%,0.85), hsla(220,40%,10%,0.85), hsla(220,60%,30%,0.85), hsla(220,60%,30%,0.85), hsla(220,40%,10%,0.85), hsla(220,60%,30%,0.85), hsla(220,60%,30%,0.85), hsla(220,40%,10%,0.85), hsla(220,60%,30%,0.85)); }
scrollbar[orient='horizontal'] > slider > thumb { min-width: 35px; }
scrollbar[orient='vertical'] > slider > thumb { min-height: 35px; }
scrollbar > slider > thumb { -moz-appearance: none !important; border-radius: 10px; border-width: 0px;
box-shadow:
inset 0 0 1px 1px hsla(220, 100%, 20%, 1.0),
inset 0 0 0px 2px hsla(180, 50%, 80%, 0.8),
inset 0 0 0px 3px hsla(180, 100%, 50%, 0.5);
background-color: hsla(220, 100%, 50%, 0.1); }
scrollbar > slider > thumb:hover { background-color: hsla(180,75%,60%,0.2); }
scrollbar > slider > thumb:active { background-color: hsla(300,75%,60%,0.2); }
/*
this section hides the scrollbarbuttons located at the ends of the scrollbar, comment this out to show them, or restyle as needed.
important note: with default scrollbar, removing/collapsing scrollbarbutton also collapses the scrollbar itself, causing it to disappear (ungood!).
the scrollbarbutton element acts as 'rigging' for the scrollbar.
either set min-width/min-height dimensions or selectively zero the default min-width/min-height as implemented below.
keep this in mind when tampering with scrollbarbutton element.
*/
/*remove incremental scroll buttons located at scrollbar ends*/
scrollbar > scrollbarbutton{ -moz-appearance: none !important; border: none !important; background: none !important; }
scrollbar[orient='vertical'] > scrollbarbutton { min-height: 0 !important; }
scrollbar[orient='horizontal'] > scrollbarbutton { min-width: 0 !important; }
| css |
import { Country } from '../Country'
import { isValid } from '../isValid'
describe('isValid', () => {
test('should return true on correct RU number', () => {
expect(isValid('79994955033', [Country.RU])).toBeTruthy()
})
test('should return false on incorrect RU number', () => {
expect(isValid('7999495503', [Country.RU])).toBeFalsy()
expect(isValid('78994955033', [Country.RU])).toBeFalsy()
})
})
| typescript |
Posted On:
With the 17th Mumbai International Film Festival (29 May to 04 June) around the corner, the month of May will witness celebration of films on a grand scale.
On the occasion of commemoration of Satyajit Ray’s Birth Centenary, Ministry of Information & Broadcasting has initiated various activities to pay tribute to the legendary filmmaker. As part of this, a three-day film festival will be organised at various venues across India. Films made by and made on Satyajit Ray will be screened at New Delhi, Mumbai, Chennai, Kolkata, Bengaluru and Pune on 2nd, 3rd & 4th May 2022.
Besides, premiering Aparajito , slated to release on the 13th may, the other films include NFDC’s Agantuk, Ghare Baire, Ganashatru directed by Satyajit Ray & Music of Satyajit Ray directed by Utpalendu Chakraborty, Nemai Ghosh – A Ray of Light directed by Anirban Mitra & Tirtho Dasgupta, Films Divisions documentaries & shorts Inner Eye, Rabindranath Tagore are directed by Satyajit Ray, Satyajit Ray directed by Shyam Benegal, Creative Artists of India – Satyajit Ray, directed by B.D. Garga, NFAI’s newly restored films Sonar Kella, Seemabadha, Hirak Rajar Deshe all directed by Satyajit Ray, Government of West Bengal’s Pather Panchali print from the Academy Film Archive’s landmark restoration of the film from negatives nearly lost in a fire is screening. Also films produced by Independent filmmakers Aparajito, Jalsaghar both directed by Satyajit Ray.
(Part of Apu-Triology)
Pather Panchali (Dir: Satyajit Ray) - 126 Min Govt. of West Bengal (Part of Apu-Triology)
National Museum of Indian Cinema, Mumbai in association with National Film Development Corporation, Films Division, National Film Archive of India & Doordarshan and supported by Government of West Bengal and Aurora Film Corporation & Friends Communication is organizing the Film Festival.
The Satyajit Ray film festival will begin with the red carpet and Shri Shyam Benegal will inaugurate the Satyajit Ray’s semi-permanent Gallery on 2nd May 2022 at 10:00 AM.
National Museum of Indian Cinema, Auditorium I & II, Films Division, 24, Dr. G. Deshmukh Marg (Peddar Road),
Films Division Auditorium, 1, Mahadev Road, Connaught Place,
Tagore Film Centre, Music College Road, State Bank of India Colony, Raja Annamalai Puram,
Shruthi Auditorium, Films division, B Wing 6th Floor, Kendriya Sadan, Sr Administrative officer, Koramangala,
National Film Archives of India, NFAI Main Theater / Auditorium, Law college road,
The screenings at all venues is for free. The audiences will get to appreciate a slate of films that celebrate Ray’s life and also experience his celebrated films on big screens.
The inauguration will be followed by the screening of the opening film at the festival Aparajito, which is its ‘India Premier’.
Panel Discussion:
A panel discussion is scheduled to be held on 4th May 2022 at 4:00 PM post the screening of Pather Panchali (Satyajit Ray’s directorial debut feature), the closing film of the festival. The panel discussion shall be live on NFDC’s official Facebook for all audiences especially the cinephiles & aficionados of Ray’s work. The panellists will be Shyam Benegal, Barun Chanda (actor from Ray’s Seemabadh) & Shantanu Moitra; it will be moderated by Shankhayan Ghosh.
MIFF the 17th edition of Mumbai International Film Festival for Documentary, Short Fiction and Animation films (MIFF-2022) will be held from 29 May to 4 June, 2022 at the Films Division complex, Mumbai.
About National Museum of Indian Cinema (NMIC)
The Museum is housed in two buildings – the New Museum Building and the 19th century historic palace Gulshan Mahal – both at the Films Division campus in Mumbai.
About National Film Development Corporation (NFDC)
Incorporated in the year 1975 National Film Development Corporation Ltd is formed by Ministry of Information and Broadcasting with the primary objective of promoting the good cinema movement in India.
11:00 Hrs - 13:30 Hrs (OPENING FILM)
13:24 Hrs - 15:30 Hrs (CLOSING FILM)
Pather Panchali (Dir: Satyajit Ray) - 126 Min Govt. of West Bengal (Part of Apu-Triology)
| english |
<reponame>poeschel/dbus-java
package org.freedesktop.dbus.annotations;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
* Description of the interface or method, returned in the introspection data
*/
@Retention(RetentionPolicy.RUNTIME)
@DBusInterfaceName("org.freedesktop.DBus.Description")
public @interface IntrospectionDescription {
String value();
} | java |
<reponame>idlesign/django-sitegate<filename>sitegate/signin_flows/remotes/yandex.py
from django.http import HttpResponseRedirect, HttpRequest
from django.utils.translation import gettext_lazy as _
from .base import Remote, UserData
if False: # pragma: nocover
from django.contrib.auth.models import User # noqa
class Yandex(Remote):
"""Sign in using Yandex.
Docs: https://yandex.ru/dev/oauth/
Register your OAuth application at
https://oauth.yandex.ru/
Set scopes:
API Яндекс ID - Доступ к адресу электронной почты --- required
API Яндекс ID - Доступ к логину, имени и фамилии, полу --- optional
Set callback URL:
<your-domain-uri>/rauth/yandex/
"""
alias: str = 'yandex'
title: str = _('Yandex')
@classmethod
def _get_user_data(cls, request: HttpRequest, *, data: dict) -> UserData:
user_data = cls._request_json(
'https://login.yandex.ru/info?format=json',
headers={'Authorization': f"OAuth {data.get('access_token')}"},
)
user_data = UserData(
remote_id=user_data['id'],
username=user_data['login'],
emails=user_data['emails'],
first_name=user_data.get('first_name', ''),
last_name=user_data.get('last_name', ''),
)
return user_data
def auth_start(self, request: HttpRequest, *, ticket: str) -> HttpResponseRedirect:
return self.redirect(
'https://oauth.yandex.ru/authorize?response_type=token&'
f'client_id={self.client_id}&state={ticket}&display=popup')
| python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.