text stringlengths 1 1.04M | language stringclasses 25 values |
|---|---|
Priyamani’s new clicks spellbound her fans!
Priya Vasudev Mani Iyer, also famous as Priyamani, is an Indian actress and former model, working in all South Indian Languages.
She made her acting debut with a Telugu movie in 2003 titled Evare Atagaadu and later became famous for her role in the 2007 Tamil romantic movie Paruthiveeran.
With her strong acting skills, she received a National Film Award for Best Actress and a Filmfare Award for Best Actress in Tamil.
She is part of several hit movies like Raam (2009), Raavan (2010), Raavanan (2010), Pranchiyettan & the Saint (2010), Chaarulatha (2012), and Idolle Ramayana (2016).
Apart from movies, the actress has also judged many dance reality shows and is also quite active on Instagram.
Priyamani has over 1. 6 million followers on the platform and she often shares new pictures on the platform to further increase her followers. | english |
<filename>blousebrothers/friends/migrations/0003_auto_20171024_1628.py
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2017-10-24 16:28
from __future__ import unicode_literals
import blousebrothers.friends.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import image_cropping.fields
class Migration(migrations.Migration):
dependencies = [
('users', '0021_user_friends'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('friends', '0002_relationship_share_confs'),
]
operations = [
migrations.CreateModel(
name='Group',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(help_text='Tu peux par exemple entrer le nom de ta corpo :)', max_length=512, unique=True, verbose_name='Nom du groupe')),
('avatar', image_cropping.fields.ImageCropField(max_length=255, null=True, upload_to=blousebrothers.friends.models.group_avatar_path, verbose_name='Avatar')),
('cropping', image_cropping.fields.ImageRatioField('avatar', '430x360', adapt_rotation=False, allow_fullsize=False, free_crop=True, help_text=None, hide_image_field=False, size_warning=False, verbose_name='cropping')),
('members', models.ManyToManyField(related_name='bbgroups', to=settings.AUTH_USER_MODEL)),
('moderators', models.ManyToManyField(related_name='groups_moderator', to=settings.AUTH_USER_MODEL)),
('university', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='users.University', verbose_name='Ville')),
],
),
migrations.CreateModel(
name='GroupInvitRequest',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('create_timestamp', models.DateTimeField(auto_now_add=True, null=True)),
('accepted', models.BooleanField(default=False)),
('deleted', models.BooleanField(default=False)),
('requester', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='invited_users', to='friends.Group')),
('target', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='group_invits', to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='MemberShipRequest',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('create_timestamp', models.DateTimeField(auto_now_add=True, null=True)),
('accepted', models.BooleanField(default=False)),
('deleted', models.BooleanField(default=False)),
('requester', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='membership_requests', to=settings.AUTH_USER_MODEL)),
('target', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='membership_requests', to='friends.Group')),
],
),
migrations.AlterField(
model_name='relationship',
name='from_user',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='gives_friendship', to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='relationship',
name='to_user',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='has_friendship', to=settings.AUTH_USER_MODEL),
),
]
| python |
{"nom":"Mont-d'Astarac","circ":"1ère circonscription","dpt":"Gers","inscrits":85,"abs":36,"votants":49,"blancs":4,"nuls":4,"exp":41,"res":[{"nuance":"SOC","nom":"<NAME>","voix":21},{"nuance":"REM","nom":"<NAME>","voix":20}]} | json |
<gh_stars>0
---
type: image
featimg: kanboard.png
title: Kanboard
tags: [kanban, project management, php, mariadb]
category: [project-management]
layout: post-material-sidebar-left
---
[Kanboard](https://kanboard.org/) is a free and open source Kanban project management software. It has some features that will help you manage your agile project.
--
**How to use**:
- Install [docker](https://docs.docker.com/get-docker/) & [docker-compose](https://docs.docker.com/compose/install/)
- Download this [docker-compose configuration](https://raw.githubusercontent.com/aqidd/composable-apps/master/kanboard/docker-compose.yml), or copy-paste its content to a file named `docker-compose.yml`
- Run `docker-compose up`
- Open `localhost` with user/password `<PASSWORD>` to try Kanboard
--
**What is included**:
- Kanboard
- MariaDB | markdown |
package io.netty.example.zpc;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.nio.channels.ServerSocketChannel;
import java.nio.channels.SocketChannel;
import java.util.Set;
public class NioServerTest {
public static void main(String[] args) throws Exception{
//创建一个ServerSocketChannel对象,绑定端口并配置成非阻塞模式。
ServerSocketChannel serverSocketChannel = ServerSocketChannel.open();
serverSocketChannel.bind(new InetSocketAddress(8888), 1024);
//下面这句必需要,否则ServerSocketChannel会使用阻塞的模式,那就不是NIO了
serverSocketChannel.configureBlocking(false);
//把ServerSocketChannel交给Selector监听
Selector selector = Selector.open();
serverSocketChannel.register(selector, SelectionKey.OP_ACCEPT);
//循环,不断的从Selector中获取准备就绪的Channel,最开始的时候Selector只监听了一个ServerSocketChannel
//但是后续有客户端连接时,会把客户端对应的Channel也交给Selector对象
while (true) {
//这一步会阻塞,当有Channel准备就绪时或者超过1000秒后会返回。
selector.select();
System.out.println("select11");
//获取所有的准备就绪的Channel,SelectionKey中包含中Channel信息
Set<SelectionKey> selectionKeySet = selector.selectedKeys();
//遍历,每个Channel都可处理
for (SelectionKey selectionKey : selectionKeySet) {
//如果Channel已经无效了,则跳过(如Channel已经关闭了)
if(!selectionKey.isValid()) {
continue;
}
//判断Channel具体的就绪事件,如果是有客户端连接,则建立连接
if (selectionKey.isAcceptable()) {
acceptConnection(selectionKey, selector);
}
//如果有客户端可以读取请求了,则读取请求然后返回数据
if (selectionKey.isReadable()) {
System.out.println(readFromSelectionKey(selectionKey));
}
}
//处理完成后把返回的Set清空,如果不清空下次还会再返回这些Key,导致重复处理
selectionKeySet.clear();
}
}
//客户端建立连接的方法
private static void acceptConnection(SelectionKey selectionKey, Selector selector) throws Exception{
System.err.println("accept connection...");
//SelectionKey中包含选取出来的Channel的信息,我们可以从中获取,对于建立连接来说,只会有ServerSocketChannel可能触发,
//因此这里可以把它转成ServerSocketChannel对象
ServerSocketChannel ssc = ((ServerSocketChannel) selectionKey.channel());
//获取客户端对应的SocketChannel,也需要配置成非阻塞模式
SocketChannel socketChannel = ssc.accept();
socketChannel.configureBlocking(false);
//把客户端的Channel交给Selector监控,之后如果有数据可以读取时,会被select出来
socketChannel.register(selector, SelectionKey.OP_READ);
}
//从客户端读取数据的庐江
private static String readFromSelectionKey(SelectionKey selectionKey) throws Exception{
//从SelectionKey中包含选取出来的Channel的信息把Channel获取出来
SocketChannel socketChannel = ((SocketChannel) selectionKey.channel());
//读取数据到ByteBuffer中
ByteBuffer byteBuffer = ByteBuffer.allocate(1024);
int len = socketChannel.read(byteBuffer);
//如果读到-1,说明数据已经传输完成了,可以并闭
if (len < 0) {
socketChannel.close();
selectionKey.cancel();
return "";
} else if(len == 0) { //什么都没读到
return "";
}
byteBuffer.flip();
doWrite(selectionKey, "Hello Nio");
return new String(byteBuffer.array(), 0, len);
}
private static void doWrite(SelectionKey selectionKey, String responseMessage) throws Exception{
System.err.println("Output message...");
SocketChannel socketChannel = ((SocketChannel) selectionKey.channel());
ByteBuffer byteBuffer = ByteBuffer.allocate(responseMessage.getBytes().length);
byteBuffer.put(responseMessage.getBytes());
byteBuffer.flip();
socketChannel.write(byteBuffer);
}
}
| java |
- #CoronavirusHow Dogs Can Help Us Detect COVID-19 And Other Diseases?
Lucknow, Apr 27: While several states in India are coming with new ways to fight the spread of the novel coronavirus, a video clip of a quarantine centre in Agra has gone viral on social media.
In this video clip, a person is seen wearing personal protective equipment (PPE) and throwing water bottles and food packets from outside a locked gate, as several people inside are stretching out their hands through the gate, trying to grab them.
This video has gone viral days after the Centre and state government claimed that "Agra model of containment" was showcased as a success. Also, several residents in the area also claimed that food was distributed at the quarantine centre in a similar routine.
According to a media organisation, Agra District Magistrate Prabhu Narain Singh said it happened a few days ago, and "everything is fine now".
"The situation has been taken care of. The DM has ordered an inquiry. There was a slight delay in distributing the food, that is why those staying at the quarantine centre became somewhat restless," The Indian Express quoted Additional Chief Secretary (Home) Awanish Kumar Awasthi as saying.
Until Sunday evening, Uttar Pradesh's Agra reported 372 cases, including 49 discharged and 10 deaths.
Reacting to this incident, Congress spokesperson Akhilesh Pratap Singh took to Twitter and said, "This is the role model city of Agra which is now being addressed as India's 'Wuhan'. People are treated like animals in quarantine centres. Whose role model is this city? You can very well guess. " | english |
Ahead of the much-awaited ODI series between India and Australia which gets underway on Tuesday, former Aussie skipper Ricky Ponting has revealed his pick between Jasprit Bumrah and Pat Cummins as the best fast bowler in the world at the moment. Both the pacers will have a face-off when India take on Australia in the first ODI at the Wankhede Stadium in Mumbai on Tuesday.
Cummins is currently the number one ranked bowler in Tests and enjoyed a tremendous 2019. He was instrumental in helping Australia retain the prestigious urn after a 2-2 draw in Ashes 2019 in England and followed it up with impressive performances in the remaining Test season at home. Cummins finished the year with a staggering 59 wickets in 12 matches including two five-wicket hauls at an impressive average of 20. 13.
Bumrah, on the other hand, is currently the number one ranked ODI bowler and is a vital cog of the Indian team across formats. The pacer had a stellar 2019 before injuries marred his progress. He played only three Tests in 2019 and returned with 14 wickets while in ODIs, he played 14 matches and picked up 25 wickets. Despite remaining on the sidelines for over 4 months, Bumrah finished 2019 on top of the ODI bowling rankings.
There often have been a lot of debates over who is the best fast bowler between Bumrah and Cummins but Ponting has no doubts over who is better. The former Australian captain recently conducted a Q & A session on Twitter where he was asked by a fan to name the best fast bowler in the world. Ponting picked Cummins and explained, "I think what Pat Cummins has done over the last 12 months has him clearly the best fast bowler in the world".
Cummins and Bumrah will both be in action and will be looking to produce their best with the ball for their respective sides when India and Australia lock horns in the ODI series opener in Mumbai. Australia defeated India 3-2 in their own backyard when the last time these two sides met in a bilateral series. | english |
{
"name": "rinatkhaziev/wpgeolocation",
"type": "class",
"description": "Retrieve bounding coordinates, distances, longitude and latitude with GeoLocation.class.php, modified for WordPress",
"keywords": ["geolocation","geocoding", "bounding coordinates", "distances", "wordpress"],
"homepage": "https://github.com/rinatkhaziev/WpGeoLocation.php",
"license": "CC 3.0",
"authors": [
{
"name": "<NAME>",
"email": "<EMAIL>",
"homepage": "http://replaycreative.com",
"role": "Original Author"
},
{
"name": "<NAME>",
"email": "<EMAIL>",
"homepage": "http://r1nat.com",
"role": "Fork Maintainer"
}
],
"require": {
"php": ">=5.3.0"
},
"autoload": {
"psr-4": {
"RinatKhaziev\\": "src/RinatKhaziev"
}
}
}
| json |
The annual exercise, which will begin on September 3, will see 200 personnel from the Indian Army’s Naga Battalion honing their skills with the military of 17 nations.
Indian Army will participate in a multi-nation wargame ZAPAD being held at Nizhniy in Russia to enhance military and strategic ties amongst participating countries. China and Pakistan will take part as observers.
The annual exercise, which will begin on September 3, will see 200 personnel from the Indian Army’s Naga Battalion honing their skills with the military of 17 nations.
ZAPAD 2021 is a theatre-level exercise being conducted by the Russian armed forces that primarily focused on anti-terror operations. Over a dozen nations from the Eurasian and South Asian regions will join the exercise.
Before leaving for Russia, the Indian troops were put through a strenuous training schedule that comprised of mechanised, airborne and heliborne, counter-terrorism, combat conditioning and firing operations.
The countries included China, Pakistan, Armenia, Belarus, Nepal, Sri Lanka, Indonesia, Uzbekistan, Turkmenistan, Vietnam, Serbia, Mongolia, Myanmar, Kazakhstan, Tajikistan and Kyrgyzstan.
The exercise, which serves as a cornerstone to the Russian Armed Forces annual training cycle, tests Russia's four main strategic commands -- Zapad (West), Vostok (East), Tsentr (Center) and Kavkaz (Caucasus) on rotation.
A 140-member Indian Army contingent had participated in Exercise Tsentr in 2019. India had stayed away from the 2020 Kavkaz exercise, citing the Covid-19 pandemic. China and Pakistan had participated in that joint exercise. Another reason why India skipped the Kavkaz exercise was because of its complicated relationship with China in the backdrop of the hostilities in eastern Ladakh.
In the next few weeks, India will also participate in Shanghai Cooperation Organisation military exercise, in which troops of China and Pakistan will also participate. | english |
<filename>04/cross_validation.01.py<gh_stars>1-10
from sklearn import svm, metrics
import random
import re
def split(rows):
data = []
labels = []
for row in rows:
data.append(row[0:4])
labels.append(row[4])
return (data, labels)
def calculate_score(train, test):
train_data, train_label = split(train)
test_data, test_label = split(test)
classifier = svm.SVC()
classifier.fit(train_data, train_label)
predict = classifier.predict(test_data)
return metrics.accuracy_score(test_label, predict)
def to_number(n):
return float(n) if re.match(r"^[0-9\.]+$", n) else n
def to_columm(line):
return list(map(to_number, line.strip().split(",")))
lines = open("iris.csv", "r", encoding="utf-8").read().split("\n")
csv = list(map(to_columm, lines))
del csv[0]
random.shuffle(csv)
k = 5
csv_k = [[] for i in range(k)]
scores = []
for i in range(len(csv)):
csv_k[i % k].append(csv[i])
for test in csv_k:
train = []
for data in csv_k:
if test != data:
train += data
score = calculate_score(train, test)
scores.append(score)
print("score = ", scores)
print("avg = ", sum(scores) / len(scores))
| python |
/*
* Copyright © 2019 <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 above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#pragma once
#include "codegen/module_builder.hpp"
namespace codegen {
namespace detail {
enum class arithmetic_operation_type {
add,
sub,
mul,
div,
mod,
and_,
or_,
xor_,
};
template<arithmetic_operation_type Op, typename LHS, typename RHS> class arithmetic_operation {
LHS lhs_;
RHS rhs_;
static_assert(std::is_same_v<typename LHS::value_type, typename RHS::value_type>);
public:
using value_type = typename LHS::value_type;
arithmetic_operation(LHS lhs, RHS rhs) : lhs_(std::move(lhs)), rhs_(std::move(rhs)) {}
llvm::Value* eval() const {
if constexpr (std::is_integral_v<value_type>) {
switch (Op) {
case arithmetic_operation_type::add: return current_builder->ir_builder_.CreateAdd(lhs_.eval(), rhs_.eval());
case arithmetic_operation_type::sub: return current_builder->ir_builder_.CreateSub(lhs_.eval(), rhs_.eval());
case arithmetic_operation_type::mul: return current_builder->ir_builder_.CreateMul(lhs_.eval(), rhs_.eval());
case arithmetic_operation_type::div:
if constexpr (std::is_signed_v<value_type>) {
return current_builder->ir_builder_.CreateSDiv(lhs_.eval(), rhs_.eval());
} else {
return current_builder->ir_builder_.CreateUDiv(lhs_.eval(), rhs_.eval());
}
case arithmetic_operation_type::mod:
if constexpr (std::is_signed_v<value_type>) {
return current_builder->ir_builder_.CreateSRem(lhs_.eval(), rhs_.eval());
} else {
return current_builder->ir_builder_.CreateURem(lhs_.eval(), rhs_.eval());
}
case arithmetic_operation_type::and_: return current_builder->ir_builder_.CreateAnd(lhs_.eval(), rhs_.eval());
case arithmetic_operation_type::or_: return current_builder->ir_builder_.CreateOr(lhs_.eval(), rhs_.eval());
case arithmetic_operation_type::xor_: return current_builder->ir_builder_.CreateXor(lhs_.eval(), rhs_.eval());
}
} else {
switch (Op) {
case arithmetic_operation_type::add: return current_builder->ir_builder_.CreateFAdd(lhs_.eval(), rhs_.eval());
case arithmetic_operation_type::sub: return current_builder->ir_builder_.CreateFSub(lhs_.eval(), rhs_.eval());
case arithmetic_operation_type::mul: return current_builder->ir_builder_.CreateFMul(lhs_.eval(), rhs_.eval());
case arithmetic_operation_type::div: return current_builder->ir_builder_.CreateFDiv(lhs_.eval(), rhs_.eval());
case arithmetic_operation_type::mod: return current_builder->ir_builder_.CreateFRem(lhs_.eval(), rhs_.eval());
case arithmetic_operation_type::and_: [[fallthrough]];
case arithmetic_operation_type::or_: [[fallthrough]];
case arithmetic_operation_type::xor_: abort();
}
}
}
friend std::ostream& operator<<(std::ostream& os, arithmetic_operation const& ao) {
auto symbol = [] {
switch (Op) {
case arithmetic_operation_type::add: return '+';
case arithmetic_operation_type::sub: return '-';
case arithmetic_operation_type::mul: return '*';
case arithmetic_operation_type::div: return '/';
case arithmetic_operation_type::mod: return '%';
case arithmetic_operation_type::and_: return '&';
case arithmetic_operation_type::or_: return '|';
case arithmetic_operation_type::xor_: return '^';
}
}();
return os << '(' << ao.lhs_ << ' ' << symbol << ' ' << ao.rhs_ << ')';
}
};
enum class pointer_arithmetic_operation_type {
add,
sub,
};
template<pointer_arithmetic_operation_type Op, typename LHS, typename RHS> class pointer_arithmetic_operation {
LHS lhs_;
RHS rhs_;
static_assert(std::is_pointer_v<typename LHS::value_type>);
static_assert(std::is_integral_v<typename RHS::value_type>);
using rhs_value_type = typename RHS::value_type;
public:
using value_type = typename LHS::value_type;
pointer_arithmetic_operation(LHS lhs, RHS rhs) : lhs_(std::move(lhs)), rhs_(std::move(rhs)) {}
llvm::Value* eval() const {
auto& mb = *current_builder;
auto rhs = rhs_.eval();
if constexpr (sizeof(rhs_value_type) < sizeof(uint64_t)) {
if constexpr (std::is_unsigned_v<rhs_value_type>) {
rhs = mb.ir_builder_.CreateZExt(rhs, type<uint64_t>::llvm());
} else {
rhs = mb.ir_builder_.CreateSExt(rhs, type<int64_t>::llvm());
}
}
switch (Op) {
case pointer_arithmetic_operation_type::add: return mb.ir_builder_.CreateInBoundsGEP(lhs_.eval(), rhs);
case pointer_arithmetic_operation_type::sub:
return mb.ir_builder_.CreateInBoundsGEP(lhs_.eval(), mb.ir_builder_.CreateSub(constant<int64_t>(0), rhs));
}
abort();
}
friend std::ostream& operator<<(std::ostream& os, pointer_arithmetic_operation const& ao) {
auto symbol = [] {
switch (Op) {
case pointer_arithmetic_operation_type::add: return '+';
case pointer_arithmetic_operation_type::sub: return '-';
}
}();
return os << '(' << ao.lhs_ << ' ' << symbol << ' ' << ao.rhs_ << ')';
}
};
} // namespace detail
template<typename LHS, typename RHS,
typename = std::enable_if_t<std::is_arithmetic_v<typename RHS::value_type> &&
std::is_same_v<typename RHS::value_type, typename LHS::value_type>>>
auto operator+(LHS lhs, RHS rhs) {
return detail::arithmetic_operation<detail::arithmetic_operation_type::add, LHS, RHS>(std::move(lhs), std::move(rhs));
}
template<typename LHS, typename RHS,
typename = std::enable_if_t<std::is_arithmetic_v<typename RHS::value_type> &&
std::is_same_v<typename RHS::value_type, typename LHS::value_type>>>
auto operator-(LHS lhs, RHS rhs) {
return detail::arithmetic_operation<detail::arithmetic_operation_type::sub, LHS, RHS>(std::move(lhs), std::move(rhs));
}
template<typename LHS, typename RHS,
typename = std::enable_if_t<std::is_arithmetic_v<typename RHS::value_type> &&
std::is_same_v<typename RHS::value_type, typename LHS::value_type>>>
auto operator*(LHS lhs, RHS rhs) {
return detail::arithmetic_operation<detail::arithmetic_operation_type::mul, LHS, RHS>(std::move(lhs), std::move(rhs));
}
template<typename LHS, typename RHS,
typename = std::enable_if_t<std::is_arithmetic_v<typename RHS::value_type> &&
std::is_same_v<typename RHS::value_type, typename LHS::value_type>>>
auto operator/(LHS lhs, RHS rhs) {
return detail::arithmetic_operation<detail::arithmetic_operation_type::div, LHS, RHS>(std::move(lhs), std::move(rhs));
}
template<typename LHS, typename RHS,
typename = std::enable_if_t<std::is_arithmetic_v<typename RHS::value_type> &&
std::is_same_v<typename RHS::value_type, typename LHS::value_type>>>
auto operator%(LHS lhs, RHS rhs) {
return detail::arithmetic_operation<detail::arithmetic_operation_type::mod, LHS, RHS>(std::move(lhs), std::move(rhs));
}
template<typename LHS, typename RHS,
typename = std::enable_if_t<std::is_integral_v<typename RHS::value_type> &&
std::is_same_v<typename RHS::value_type, typename LHS::value_type>>>
auto operator&(LHS lhs, RHS rhs) {
return detail::arithmetic_operation<detail::arithmetic_operation_type::and_, LHS, RHS>(std::move(lhs),
std::move(rhs));
}
template<typename LHS, typename RHS,
typename = std::enable_if_t<std::is_integral_v<typename RHS::value_type> &&
std::is_same_v<typename RHS::value_type, typename LHS::value_type>>>
auto operator|(LHS lhs, RHS rhs) {
return detail::arithmetic_operation<detail::arithmetic_operation_type::or_, LHS, RHS>(std::move(lhs), std::move(rhs));
}
template<typename LHS, typename RHS,
typename = std::enable_if_t<std::is_integral_v<typename RHS::value_type> &&
std::is_same_v<typename RHS::value_type, typename LHS::value_type>>>
auto operator^(LHS lhs, RHS rhs) {
return detail::arithmetic_operation<detail::arithmetic_operation_type::xor_, LHS, RHS>(std::move(lhs),
std::move(rhs));
}
template<typename LHS, typename RHS,
typename = std::enable_if_t<std::is_integral_v<typename RHS::value_type> &&
std::is_pointer_v<typename LHS::value_type>>,
typename = void>
auto operator+(LHS lhs, RHS rhs) {
return detail::pointer_arithmetic_operation<detail::pointer_arithmetic_operation_type::add, LHS, RHS>(std::move(lhs),
std::move(rhs));
}
template<typename LHS, typename RHS,
typename = std::enable_if_t<std::is_integral_v<typename RHS::value_type> &&
std::is_pointer_v<typename LHS::value_type>>,
typename = void>
auto operator-(LHS lhs, RHS rhs) {
return detail::pointer_arithmetic_operation<detail::pointer_arithmetic_operation_type::sub, LHS, RHS>(std::move(lhs),
std::move(rhs));
}
} // namespace codegen
| cpp |
package geometry
import (
"math"
"github.com/tab58/v1/spatial/pkg/numeric"
"gonum.org/v1/gonum/blas"
"gonum.org/v1/gonum/blas/blas64"
)
// Vector3DReader is a read-only interface for a 3D vector.
type Vector3DReader interface {
GetX() float64
GetY() float64
GetZ() float64
GetComponents() (float64, float64, float64)
Length() (float64, error)
LengthSquared() (float64, error)
Clone() *Vector3D
ToBlasVector() blas64.Vector
GetNormalizedVector() *Vector3D
IsZeroLength(tol float64) (bool, error)
IsUnitLength(tol float64) (bool, error)
AngleTo(w Vector3DReader) (float64, error)
Dot(w Vector3DReader) (float64, error)
Cross(w Vector3DReader) (*Vector3D, error)
IsPerpendicularTo(w Vector3DReader, tol float64) (bool, error)
IsCodirectionalTo(w Vector3DReader, tol float64) (bool, error)
IsParallelTo(w Vector3DReader, tol float64) (bool, error)
IsEqualTo(w Vector3DReader, tol float64) (bool, error)
MatrixTransform3D(m *Matrix3D) error
HomogeneousMatrixTransform4D(m *Matrix4D) error
}
// Vector3DWriter is a write-only interface for a 3D vector.
type Vector3DWriter interface {
SetX(float64)
SetY(float64)
SetZ(float64)
Negate()
Add(w Vector3DReader) error
Sub(w Vector3DReader) error
Normalize() error
Scale(f float64) error
RotateBy(axis Vector3DReader, angleRad float64) error
}
// XAxis3D represents the canonical Cartesian x-axis in 3 dimensions.
var XAxis3D Vector3DReader = &Vector3D{X: 1, Y: 0, Z: 0}
// YAxis3D represents the canonical Cartesian y-axis in 3 dimensions.
var YAxis3D Vector3DReader = &Vector3D{X: 0, Y: 1, Z: 0}
// ZAxis3D represents the canonical Cartesian z-axis in 3 dimensions.
var ZAxis3D Vector3DReader = &Vector3D{X: 0, Y: 1, Z: 1}
// Zero3D represents the zero vector in the 3D plane.
var Zero3D Vector3DReader = &Vector3D{X: 0, Y: 0, Z: 0}
// Vector3D is a representation of a vector in 3 dimensions.
type Vector3D struct {
X float64
Y float64
Z float64
}
// GetX returns the x-coordinate of the vector.
func (v *Vector3D) GetX() float64 {
return v.X
}
// GetY returns the y-coordinate of the vector.
func (v *Vector3D) GetY() float64 {
return v.Y
}
// GetZ returns the z-coordinate of the vector.
func (v *Vector3D) GetZ() float64 {
return v.Z
}
// GetComponents returns the components of the vector.
func (v *Vector3D) GetComponents() (x, y, z float64) {
return v.GetX(), v.GetY(), v.GetZ()
}
// SetX sets the x-coordinate of the vector.
func (v *Vector3D) SetX(z float64) {
v.X = z
}
// SetY sets the y-coordinate of the vector.
func (v *Vector3D) SetY(z float64) {
v.Y = z
}
// SetZ sets the z-coordinate of the vector.
func (v *Vector3D) SetZ(z float64) {
v.Z = z
}
// SetComponents sets the components of the vector.
func (v *Vector3D) SetComponents(x, y, z float64) {
v.SetX(x)
v.SetY(y)
v.SetZ(z)
}
// ToBlasVector returns a BLAS vector for operations.
func (v *Vector3D) ToBlasVector() blas64.Vector {
return blas64.Vector{
N: 3,
Data: []float64{v.X, v.Y, v.Z},
Inc: 1,
}
}
// Length computes the length of the vector.
func (v *Vector3D) Length() (float64, error) {
x, y, z := v.GetComponents()
r := numeric.Nrm2(numeric.Nrm2(x, y), z)
if numeric.AreAnyOverflow(r) {
return 0, numeric.ErrOverflow
}
return r, nil
}
// LengthSquared computes the squared length of the vector.
func (v *Vector3D) LengthSquared() (float64, error) {
x, y, z := v.GetComponents()
r := x*x + y*y + z*z
if numeric.IsOverflow(r) {
return 0, numeric.ErrOverflow
}
return r, nil
}
// Clone creates a new Vector3D with the same component values.
func (v *Vector3D) Clone() *Vector3D {
return &Vector3D{
X: v.GetX(),
Y: v.GetY(),
Z: v.GetZ(),
}
}
// GetNormalizedVector gets the unit vector codirectional to this vector.
func (v *Vector3D) GetNormalizedVector() *Vector3D {
w := v.Clone()
w.Normalize()
return w
}
// IsZeroLength returns true if the vector is of zero length (within a tolerance), false if not.
func (v *Vector3D) IsZeroLength(tol float64) (bool, error) {
if numeric.IsInvalidTolerance(tol) {
return false, numeric.ErrInvalidTol
}
return v.IsEqualTo(Zero3D, tol)
}
// IsUnitLength returns true if the vector is equal to the normalized vector within the given tolerance, false if not.
func (v *Vector3D) IsUnitLength(tol float64) (bool, error) {
if numeric.IsInvalidTolerance(tol) {
return false, numeric.ErrInvalidTol
}
vv := v.Clone()
vv.Normalize()
return v.IsEqualTo(vv, tol)
}
// AngleTo gets the angle between this vector and another vector.
func (v *Vector3D) AngleTo(u Vector3DReader) (float64, error) {
// code based on Kahan's formula for angles between 3D vectors
// https://people.eecs.berkeley.edu/~wkahan/Mindless.pdf, see Mangled Angles section
lv, err := v.Length()
if err != nil {
return 0, err
}
lu, err := u.Length()
if err != nil {
return 0, err
}
nVu := u.Clone()
err = nVu.Scale(lv)
if err != nil {
return 0, err
}
nUv := v.Clone()
err = nUv.Scale(lu)
if err != nil {
return 0, err
}
// Y = norm(v) * u - norm(u) * v
Y := nVu.Clone()
Y.Sub(nUv)
// X = norm(v) * u + norm(u) * v
X := nVu.Clone()
X.Add(nUv)
ay, err := Y.Length()
if err != nil {
return 0, err
}
ax, err := X.Length()
if err != nil {
return 0, err
}
return 2 * math.Atan2(ay, ax), nil
}
// Dot computes the dot product between this vector and another Vector3DReader.
func (v *Vector3D) Dot(w Vector3DReader) (float64, error) {
ax, ay, az := v.GetComponents()
bx, by, bz := w.GetComponents()
r := ax*bx + ay*by + az*bz
if numeric.AreAnyOverflow(r) {
return 0, numeric.ErrOverflow
}
return r, nil
}
// Cross computes the cross product between this vector and another Vector3DReader.
func (v *Vector3D) Cross(w Vector3DReader) (*Vector3D, error) {
ax, ay, az := v.GetComponents()
bx, by, bz := w.GetComponents()
ux := ay*bz - az*by
uy := az*bx - ax*bz
uz := ax*by - ay*bx
if numeric.AreAnyOverflow(ux, uy, uz) {
return nil, numeric.ErrOverflow
}
cross := &Vector3D{
X: ux,
Y: uy,
Z: uz,
}
return cross, nil
}
// IsEqualTo returns true if the vector components are equal within a tolerance of each other, false if not.
func (v *Vector3D) IsEqualTo(w Vector3DReader, tol float64) (bool, error) {
if numeric.IsInvalidTolerance(tol) {
return false, numeric.ErrInvalidTol
}
vx, vy, vz := v.GetComponents()
wx, wy, wz := w.GetComponents()
x := math.Abs(wx - vx)
y := math.Abs(wy - vy)
z := math.Abs(wz - vz)
isEqual := x <= tol && y <= tol && z <= tol
return isEqual, nil
}
// IsParallelTo returns true if the vector is in the direction (either same or opposite) of the given vector within the given tolerance, false if not.
func (v *Vector3D) IsParallelTo(w Vector3DReader, tol float64) (bool, error) {
if numeric.IsInvalidTolerance(tol) {
return false, numeric.ErrInvalidTol
}
vv := v.Clone()
vv.Normalize()
ww := w.Clone()
ww.Normalize()
D, err := vv.Dot(ww)
if err != nil {
return false, err
}
d, err := numeric.Signum(D)
if err != nil {
return false, err
}
if d == 0 {
return false, nil
}
err = vv.Scale(float64(d)) // flips vv in the direction into the ww
if err != nil {
return false, err
}
return vv.IsEqualTo(ww, tol)
}
// IsPerpendicularTo returns true if the vector is pointed in the same direction as the given vector within the given tolerance, false if not.
func (v *Vector3D) IsPerpendicularTo(w Vector3DReader, tol float64) (bool, error) {
if numeric.IsInvalidTolerance(tol) {
return false, numeric.ErrInvalidTol
}
vv := v.Clone()
vv.Normalize()
ww := w.Clone()
ww.Normalize()
d, err := vv.Dot(ww)
if err != nil {
return false, err
}
return math.Abs(d) <= tol, nil
}
// IsCodirectionalTo returns true if the vector is pointed in the same direction as the given vector within the given tolerance, false if not.
func (v *Vector3D) IsCodirectionalTo(w Vector3DReader, tol float64) (bool, error) {
if numeric.IsInvalidTolerance(tol) {
return false, numeric.ErrInvalidTol
}
vv := v.Clone()
vv.Normalize()
ww := w.Clone()
ww.Normalize()
return vv.IsEqualTo(ww, tol)
}
// Negate negates the vector components.
func (v *Vector3D) Negate() {
x, y, z := v.GetX(), v.GetY(), v.GetZ()
v.SetX(-x)
v.SetY(-y)
v.SetZ(-z)
}
// Add adds the given displacement vector to this point.
func (v *Vector3D) Add(w Vector3DReader) error {
vx, vy, vz := v.GetComponents()
wx, wy, wz := w.GetComponents()
newX := vx + wx
newY := vy + wy
newZ := vz + wz
if numeric.AreAnyOverflow(newX, newY, newZ) {
return numeric.ErrOverflow
}
v.SetComponents(newX, newY, newZ)
return nil
}
// Sub subtracts the given displacement vector to this point.
func (v *Vector3D) Sub(w Vector3DReader) error {
vx, vy, vz := v.GetComponents()
wx, wy, wz := w.GetComponents()
newX := vx - wx
newY := vy - wy
newZ := vz - wz
if numeric.AreAnyOverflow(newX, newY, newZ) {
return numeric.ErrOverflow
}
v.SetComponents(newX, newY, newZ)
return nil
}
// Normalize scales the vector to unit length.
func (v *Vector3D) Normalize() error {
x, y, z := v.GetComponents()
l, err := v.Length()
if err != nil {
return err
}
if math.Abs(l) == 0 {
return numeric.ErrDivideByZero
}
newX := x / l
newY := y / l
newZ := z / l
if numeric.AreAnyOverflow(newX, newY, newZ) {
return numeric.ErrOverflow
}
v.SetComponents(newX, newY, newZ)
return nil
}
// Scale scales the vector by the given factor.
func (v *Vector3D) Scale(f float64) error {
if math.IsNaN(f) {
return numeric.ErrInvalidArgument
}
x, y, z := v.GetComponents()
newX := x * f
newY := y * f
newZ := z * f
if numeric.AreAnyOverflow(newX, newY, newZ) {
return numeric.ErrOverflow
}
v.SetComponents(newX, newY, newZ)
return nil
}
// MatrixTransform3D transforms this vector by left-multiplying the given matrix.
func (v *Vector3D) MatrixTransform3D(m *Matrix3D) error {
isSingular, err := m.IsNearSingular(1e-12)
if err != nil {
return err
}
if isSingular {
return numeric.ErrSingularMatrix
}
vv := v.ToBlasVector()
mm := m.ToBlas64General()
uu := blas64.Vector{
N: 3,
Data: []float64{0, 0, 0},
Inc: 1,
}
blas64.Gemv(blas.NoTrans, 1, mm, vv, 0, uu)
newX := uu.Data[0]
newY := uu.Data[1]
newZ := uu.Data[2]
if numeric.AreAnyOverflow(newX, newY, newZ) {
return numeric.ErrOverflow
}
v.SetComponents(newX, newY, newZ)
return nil
}
// HomogeneousMatrixTransform4D transforms this vector by left-multiplying the given matrix
// by the homogeneous vector and then projected back into this space.
func (v *Vector3D) HomogeneousMatrixTransform4D(m *Matrix4D) error {
u := &Vector4D{X: v.X, Y: v.Y, Z: v.Z, W: 1.0}
err := u.MatrixTransform4D(m)
if err != nil {
return err
}
ux, uy, uz, uw := u.GetComponents()
if uw != 0 {
return numeric.ErrDivideByZero
}
newX := ux / uw
newY := uy / uw
newZ := uz / uw
if numeric.AreAnyOverflow(newX, newY, newZ) {
return numeric.ErrOverflow
}
v.SetComponents(newX, newY, newZ)
return nil
}
| go |
Arsenal today host a Cardiff side who will be disappointed with their Boxing Day result, as the Welsh outfit gave away a two goal lead to draw 2 – 2 with bottom-placed Sunderland. Conversely, Arsenal scraped a one-nil victory away to eight-placed Newcastle to climb back to the top of the Premier League.
Arsene Wenger makes three changes to the line-up that took three points away from Saint James’ Park, with Nacho Monreal replacing Keiran Gibbs at left back, Mathieu Flamini coming in for Tomas Rosicky and Lukas Podolski filling the forward position, in place of the injured Olivier Giroud.
David Kerslake, who looks very much set to hand over the managerial role to Ole Gunnar Solskjaer, will send his Cardiff team out unchanged from the team who drew at home to Sunderland.
Arsenal Subs:
Cardiff Subs: | english |
A team of physicists at the University of Cambridge suspects that dark energy may have muddled results from the XENON1T experiment, a series of underground vats of xenon that are being used to search for dark matter.
Dark matter and dark energy are two of the most discussed quandaries of contemporary physics. The two darks are placeholder names for mysterious somethings that seem to be affecting the behavior of the universe and the stuff in it. Dark matter refers to the seemingly invisible mass that only makes itself known through its gravitational effects. Dark energy refers to the as-yet unexplained reason for the universe’s accelerating expansion. Dark matter is thought to make up about 27% of the universe, while dark energy is 68%, according to NASA.
Physicists have some ideas to explain dark matter: axions, WIMPs, SIMPs, and primordial black holes, to name a few. But dark energy is a lot more enigmatic, and now a group of researchers working on XENON1T data says an unexpected excess of activity could be due to that unknown force, rather than any dark matter candidate. The team’s research was published this week in Physical Review D.
The XENON1T experiment, buried below Italy’s Apennine Mountains, is set up to be as far away from any noise as possible. It consists of vats of liquid xenon that will light up if interacted with by a passing particle. As previously reported by Gizmodo, in June 2020 the XENON1T team reported that the project was seeing more interactions than it ought to be under the Standard Model of physics, meaning that it could be detecting theorized subatomic particles like axions—or something could be screwy with the experiment.
Despite constituting so much of the universe, dark energy has not yet been identified. Many models suggest that there may be some fifth force besides the known four known fundamental forces in the universe, one that is hidden until you get to some of the largest-scale phenomena, like the universe’s ever-faster expansion.
Axions shooting out of the Sun seemed a possible explanation for the excess signal, but there were holes in that idea, as it would require a re-think of what we know about stars. “Even our Sun would not agree with the best theoretical models and experiments as well as it does now,” one researcher told Gizmodo last year.
Part of the problem with looking for dark energy are “chameleon particles” (also known as solar axions or solar chameleons), so-called for their theorized ability to vary in mass based on the amount of matter around them. That would make the particles’ mass larger when passing through a dense object like Earth and would make their force on surrounding masses smaller, as New Atlas explained in 2019. The recent research team built a model that uses chameleon screening to probe how dark energy behaves on scales well beyond that of the dense local universe.
The model allowed the team to understand how XENON1T would behave if the dark energy were produced in a magnetically strong region of the Sun. Their calculations indicated that dark energy could be detected with XENON1T.
Since the excess was first discovered, the XENON1T team “tried in any way to destroy it,” as one researcher told The New York Times. The signal’s obstinacy is as perplexing as it is thrilling.
The next generation of XENON1T, called XENONnT, is slated to have its first experimental runs later this year. Upgrades to the experiment will hopefully seal out any noise and help physicists home in on what exactly is messing with the subterranean detector.
More: What Is Dark Matter and Why Hasn’t Anyone Found It Yet?
| english |
<filename>data/wordpress/plugins/wordfence.json
{"slug":"wordfence","name":"Wordfence Security – Firewall & Malware Scan","latest_version":"7.1.1","last_updated":"2018-03-27T19:28:44.323Z","vulnerabilities":[{"id":"6140","title":"Wordfence 3.8.6 - lib/IPTraf.php User-Agent Header Stored XSS","created_at":"2014-08-01T10:58:38Z","updated_at":"2015-05-15T13:47:30Z","published_date":null,"references":{"url":null,"osvdb":null,"secunia":["56558"],"cve":null,"exploitdb":null},"vuln_type":"XSS","fixed_in":"3.8.7","criticity":0.0},{"id":"6141","title":"Wordfence 3.8.1 - Password Creation Restriction Bypass","created_at":"2014-08-01T10:58:38Z","updated_at":"2015-05-15T13:47:30Z","published_date":null,"references":{"url":null,"osvdb":null,"secunia":null,"cve":null,"exploitdb":null},"vuln_type":"AUTHBYPASS","fixed_in":"3.8.3","criticity":0.0},{"id":"6142","title":"Wordfence 3.8.1 - wp-admin/admin.php whois Parameter Stored XSS","created_at":"2014-08-01T10:58:39Z","updated_at":"2015-05-15T13:47:30Z","published_date":null,"references":{"url":["http://packetstormsecurity.com/files/122993/","http://www.securityfocus.com/bid/62053/"],"osvdb":null,"secunia":null,"cve":null,"exploitdb":null},"vuln_type":"XSS","fixed_in":"3.8.3","criticity":0.0},{"id":"6143","title":"Wordfence 3.3.5 - XSS & IAA","created_at":"2014-08-01T10:58:39Z","updated_at":"2015-05-15T13:47:30Z","published_date":null,"references":{"url":["http://seclists.org/fulldisclosure/2012/Oct/139"],"osvdb":null,"secunia":["51055"],"cve":null,"exploitdb":null},"vuln_type":"MULTI","fixed_in":"3.3.7","criticity":0.0},{"id":"7581","title":"Wordfence 5.2.4 - Unspecified Issue","created_at":"2014-09-22T18:47:58Z","updated_at":"2015-05-15T13:49:03Z","published_date":null,"references":{"url":null,"osvdb":null,"secunia":null,"cve":null,"exploitdb":null},"vuln_type":"UNKNOWN","fixed_in":"5.2.5","criticity":0.0},{"id":"7582","title":"Wordfence 5.2.4 - IPTraf.php URI Request Stored XSS","created_at":"2014-09-22T18:52:28Z","updated_at":"2015-05-15T13:49:03Z","published_date":null,"references":{"url":["http://packetstormsecurity.com/files/128259/"],"osvdb":null,"secunia":null,"cve":null,"exploitdb":null},"vuln_type":"XSS","fixed_in":"5.2.5","criticity":0.0},{"id":"7583","title":"Wordfence 5.2.3 - Banned IP Functionality Bypass","created_at":"2014-09-22T19:33:44Z","updated_at":"2015-06-24T15:47:43Z","published_date":null,"references":{"url":["http://packetstormsecurity.com/files/128259/","http://seclists.org/fulldisclosure/2014/Sep/49","https://vexatioustendencies.com/wordfence-v5-2-3-2-stored-xss-insufficient-logging-throttle-bypass-exploit-detection-bypass/"],"osvdb":null,"secunia":null,"cve":null,"exploitdb":null},"vuln_type":"BYPASS","fixed_in":"5.2.4","criticity":0.0},{"id":"7612","title":"Wordfence 5.2.3 - Multiple Vulnerabilities","created_at":"2014-09-27T12:37:39Z","updated_at":"2015-05-15T13:49:05Z","published_date":null,"references":{"url":["https://vexatioustendencies.com/wordfence-v5-2-3-2-stored-xss-insufficient-logging-throttle-bypass-exploit-detection-bypass/"],"osvdb":null,"secunia":null,"cve":null,"exploitdb":null},"vuln_type":"MULTI","fixed_in":"5.2.4","criticity":0.0},{"id":"7636","title":"Wordfence <= 5.2.4 - Multiple Vulnerabilities (XSS & Bypasses)","created_at":"2014-10-07T16:26:43Z","updated_at":"2017-12-10T15:37:31Z","published_date":null,"references":{"url":["https://secupress.me/blog/wordfence-5-2-5-security-update/","http://www.securityfocus.com/bid/70915/"],"osvdb":null,"secunia":null,"cve":["2014-4664"],"exploitdb":null},"vuln_type":"MULTI","fixed_in":"5.2.5","criticity":0.0},{"id":"7698","title":"Wordfence 5.2.2 - XSS in Referer Header","created_at":"2014-12-01T13:18:37Z","updated_at":"2015-05-15T13:49:11Z","published_date":null,"references":{"url":["https://vexatioustendencies.com/wordpress-plugin-vulnerability-dump-part-2/"],"osvdb":null,"secunia":null,"cve":null,"exploitdb":null},"vuln_type":"XSS","fixed_in":"5.2.3","criticity":0.0},{"id":"7711","title":"Wordfence <= 5.1.4 - Cross-Site Scripting (XSS)","created_at":"2014-12-08T13:19:49Z","updated_at":"2015-12-09T21:27:33Z","published_date":null,"references":{"url":["http://techdefencelabs.com/security-advisories.html"],"osvdb":null,"secunia":null,"cve":["2014-4932"],"exploitdb":null},"vuln_type":"XSS","fixed_in":"5.1.5","criticity":0.0}]} | json |
The owner of a dog was detained after he threw three puppies off the balcony of his apartment on the 10th floor in Greater Noida. Investigations revealed the man's pet dog had given birth to six puppies, three of whom were found missing.
By Abhishek Anand: The owner of a pet dog was detained after he allegedly threw three puppies off the 10th floor of a high-rise in Greater Noida. The incident was reported early on Wednesday, from the 6th Avenue of Gaur City 1.
The three puppies, barely a month old, died on the spot.
A police officer, while talking about the incident, told India Today, "The incident came to light when the apartment owner’s association reported about three puppies being thrown from a high-rise flat into a shed on the ground floor. It was found that the tin had a big dent, leading to suspicion that it was thrown from the upper floors. When the pet parent list was checked, it was found that three puppies of one person were missing. It was also found that they could not fall on their own as his balcony was secured with a legion net and the bodies of all three puppies were found together. The suspect has been detained. "
The owner was identified as Shekhar, the police said.
Investigations revealed that Shekhar's pet dog had given birth to six puppies, out of which three were allegedly thrown off the balcony.
A post-mortem of the puppies was being conducted, the officer said.
Ram Badan Singh, DCP Central Noida, said, "The pet owner says the puppies fell from his balcony. No FIR has been registered so far. The matter is under investigation. We have questioned the pet owner about the incident. Further action will be taken following the investigation. "
Commenting on the incident, the animal rights activists said they found that the puppies were from a mixed breed.
"This is a heartbreaking incident. If people can’t take care of their pets, they shouldn’t have them. Why to kill puppies, they can send them to any shelter? The Apartment Owners' Association (AOA) and the police have been very helpful in the quick investigation of the case. The suspect has been detained. We hope strict action is taken against the culprit," said Kaveri Rana Bhardwaj, animal rescuer and founder of SMART sanctuary. | english |
<reponame>sneaxiy/PaddlePaddle.org
from django import template
register = template.Library()
@register.assignment_tag(takes_context=False)
def get_dict_item(dictionary, key):
return dictionary.get(key)
@register.assignment_tag(takes_context=True)
def first_book_url_assignment(context, book, content_id):
# Finds the first url in the book in the default category
if book and 'default-category' in book:
category = book['default-category']
if content_id == portal_helper.Content.DOCUMENTATION or \
content_id == portal_helper.Content.API:
# For Documentation or API, we also filter by category
api_category = context.get('CURRENT_API_VERSION', None)
if api_category:
category = api_category
leaf_node = book['categories'][category]
if ('link' in leaf_node):
return translation(context, leaf_node['link'])
return ''
| python |
<reponame>ScSherifTarek/universities
{"name":"ENSTA - Paris Tech","alt_name":"Ecole nationale supérieure de Techniques avancées (ENSTA Paris Tech)","country":"France","state":null,"address":{"street":"828, boulevard des Maréchaux","city":"Palaiseau","province":"Cedex","postal_code":"91762"},"contact":{"telephone":"+33(1) 81-87-17-40","website":"http:\/\/www.ensta-paristech.fr","email":"<EMAIL>","fax":"+33(1) 81-87-17-55"},"funding":"Public","languages":null,"academic_year":"September to June","accrediting_agency":null}
| json |
import React from 'react';
import PropTypes from 'prop-types';
import { Helmet } from 'react-helmet';
import { prefixUrl } from '@mapbox/batfish/modules/prefix-url';
export default class PageShell extends React.Component {
render() {
const { props } = this;
const title = `${props.frontMatter.title} | Miscellany`;
return (
<div>
<Helmet>
<html lang="en" />
<meta charSet="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>{title}</title>
<meta name="description" content={props.frontMatter.description} />
{/* Facebook tags */}
<meta name="og:title" content={props.frontMatter.title} />
<meta name="og:description" content={props.frontMatter.description} />
<meta name="og:type" content="website" />
<meta
name="og:url"
content={`https://www.your-batfish-site.com/miscellany${props.location.pathname}`}
/>
</Helmet>
<div className="px24 py24 mx-auto" style={{ maxWidth: 960 }}>
<div className="mb36 flex-parent flex-parent--center-cross bg-gray px24 py12">
<a
className="flex-child link link--white txt-bold txt-uppercase"
href={prefixUrl('/')}
>
Home
</a>
<a
className="flex-child link link--white txt-bold txt-uppercase ml24"
href={prefixUrl('/holidays/')}
>
Holidays
</a>
<a
className="flex-child link link--white txt-bold txt-uppercase ml24"
href={prefixUrl('/stories/')}
>
Stories
</a>
</div>
{props.children}
</div>
</div>
);
}
}
PageShell.propTypes = {
location: PropTypes.shape({
pathname: PropTypes.string.isRequired
}).isRequired,
frontMatter: PropTypes.shape({
title: PropTypes.string.isRequired,
description: PropTypes.string.isRequired
}).isRequired,
children: PropTypes.node.isRequired
};
| javascript |
Eoin Morgan has called on England to continue their limited-overs renaissance when it starts a five-match one-day international series against Sri Lanka at Trent Bridge on Tuesday.
England claimed an ODI series victory over Pakistan in the United Arab Emirates last year before surrendering a 2-0 advantage to lose 3-2 in South Africa.
It then came agonisingly close to winning the ICC World Twenty20 in India two months ago, losing to West Indies in a dramatic final over having exceeded expectations by reaching the final.
England returns to the 50-over format when it takes on a Sri Lanka side which it can leapfrop to go fifth in the rankings with at least a 4-1 victory on home soil.
The Test team eased to a 2-0 series victory over Angelo Mathews' side and limited-overs captain Morgan is determined to follow suit.
He said: "We're still at the beginning of building hopefully what will be a successful campaign in the 2019 World Cup [in England and Wales].
"We will play on home soil then and it's something we earmarked our preparation for. It was part and parcel of selecting a completely new squad this time last year and actually starting something to turn around our white-ball cricket.
"We've had some success since then which has been good for the side, particularly in the confidence the guys have shown.
"Also, the little bit of success we've had away, beating Pakistan in the UAE and putting ourselves in a commanding position against South Africa, has been good for us.
"We had chances to win that series, notably in the third ODI, but what ultimately let us down was a little bit of inexperience.
"I think it's important for us not only to stick with the same group of players in order to grow their experience over a period of time but also trying to find some consistency in our performances is very important.
"If you look at where we sit in the ICC rankings we're actually below Sri Lanka and that's a reflection of our performances over the last number of years."
Sri Lanka trails 10-2 in the newly-introduced 'Super Series', with two points up for grabs for wins in the ODIs and the one-off T20 next month.
Mathews' men warmed up for the ODI series with two comfortable victories over Ireland in Dublin, but will have to do without Shaminda Eranga after also losing fellow paceman Dhammika Prasad and Dushmantha Chameera.
Eranga was suspended from bowling due to an illegal action on Sunday and it was later revealed that he had been admitted to hospital due to an irregular heartbeat, but was due to be discharged on Monday.
The in-form Jonny Bairstow could make his return to the England ODI side as a batsman with Ben Stokes still sidelined due to injury.
| english |
<filename>spring-beans/src/test/java/com/qingyun/springframework/beansTest/BeanFactoryTest.java
package com.qingyun.springframework.beansTest;
import com.qingyun.springframework.beans.factory.PropertyValue;
import com.qingyun.springframework.beans.factory.PropertyValues;
import com.qingyun.springframework.beans.factory.config.BeanDefinition;
import com.qingyun.springframework.beans.factory.config.BeanReference;
import com.qingyun.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.junit.Test;
/**
* @description:
* @author: 張青云
* @create: 2021-08-18 18:52
**/
public class BeanFactoryTest {
@Test
public void beanTest1() {
// 1.初始化 BeanFactory
DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();
// 2.注册 com.qingyun.springframework.aop.test.bean
BeanDefinition beanDefinition = new BeanDefinition(Object.class);
beanFactory.registerBeanDefinition("object", beanDefinition);
// 3.第一次获取 com.qingyun.springframework.aop.test.bean
Object object = beanFactory.getBean("object");
// 4.第二次获取 com.qingyun.springframework.aop.test.bean from Singleton
Object object2 = beanFactory.getBean("object");
assert object == object2;
}
@Test
public void beanTest2() {
// 1.初始化 BeanFactory
DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();
// 2.注册 com.qingyun.springframework.aop.test.bean
BeanDefinition beanDefinition = new BeanDefinition(UserService.class);
beanFactory.registerBeanDefinition("userService", beanDefinition);
// 3.获取 com.qingyun.springframework.aop.test.bean
UserService userService = (UserService) beanFactory.getBean("userService");
// System.out.println(userService.getUser());
}
@Test
public void beanTest3() {
// 1.初始化 BeanFactory
DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();
// 2. UserDao 注册
beanFactory.registerBeanDefinition("userDao", new BeanDefinition(UserDao.class));
// 3. UserService 设置属性[uId、userDao]
PropertyValues propertyValues = new PropertyValues();
propertyValues.addPropertyValue(new PropertyValue("uId", "10001"));
propertyValues.addPropertyValue(new PropertyValue("userDao",new BeanReference("userDao")));
// 4. UserService 注入bean
BeanDefinition beanDefinition = new BeanDefinition(UserService.class, propertyValues);
beanFactory.registerBeanDefinition("userService", beanDefinition);
// 5. UserService 获取bean
UserService userService = (UserService) beanFactory.getBean("userService");
userService.queryUserInfo();
}
}
| java |
{
"name": "zepgram/module-fasterize",
"description": "Manage Fasterize cache from Magento admin and auto-trigger cache flush when it's necessary by using the Fasterize API service",
"type": "magento2-module",
"version": "0.0.3",
"authors": [
{
"name": "<NAME>",
"email": "<EMAIL>"
}
],
"require": {
"magento/framework": "^101.0.0|^102.0.0|^103.0.0",
"magento/module-store": "^100.0.0|^101.0.0",
"zepgram/module-base": "~0.0.1"
},
"autoload": {
"files": [
"registration.php"
],
"psr-4": {
"Zepgram\\Fasterize\\": ""
}
},
"license": "MIT",
"repositories": {
"repo.magento.com": {
"type": "composer",
"url": "https://repo.magento.com/"
}
}
}
| json |
{"remainingRequest":"F:\\work\\lhds\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!F:\\work\\lhds\\src\\components\\core\\Toolbar.vue?vue&type=template&id=1af91b7d&","dependencies":[{"path":"F:\\work\\lhds\\src\\components\\core\\Toolbar.vue","mtime":1573806463831},{"path":"F:\\work\\lhds\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"F:\\work\\lhds\\node_modules\\vue-loader\\lib\\loaders\\templateLoader.js","mtime":499162500000},{"path":"F:\\work\\lhds\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"F:\\work\\lhds\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["\n<div>\n\t <v-toolbar dark class=\"elevation-0\">\n\t <v-toolbar-title class=\"d-flex align-center \" @click=\"toRouter('/')\" style=\"cursor: pointer;\">\n\t\t\t <v-img\n\t\t\t :src=\"logo\"\n\t\t\t height=\"34\"\n\t\t\t \t width=\"34\"\n\t\t\t style=\"background: none;margin-right: 15px;\"\n\t\t\t />\n\t\t\t <span>量化大师</span>\n\t\t </v-toolbar-title>\n\t\t \n\t <v-spacer></v-spacer>\n\t\n\t <v-toolbar-items v-if=\"$vuetify.breakpoint.mdAndUp\" v-for=\"item in links\" :to=\"item.to\">\n\t <v-btn text v-ripple=\"{ class: 'green--text' }\" :class=\"[$route.path==item.to?'defaultGreen':'']\"\n\t\t\t @click=\"toRouter(item.to)\">{{item.text}}</v-btn>\n\t </v-toolbar-items>\n\t\t\t<v-menu transition=\"scroll-y-transition\" v-if=\"!$vuetify.breakpoint.mdAndUp\">\n\t\t\t\t<template v-slot:activator=\"{ on }\">\n\t\t\t\t\t<v-btn icon text v-on=\"on\">\n\t\t\t\t\t\t<v-icon>mdi-format-list-bulleted-square</v-icon>\n\t\t\t\t\t</v-btn>\n\t\t\t\t <!-- <v-app-bar-nav-icon v-on=\"on\"></v-app-bar-nav-icon> -->\n\t\t\t\t</template>\n\t\t\t\t<v-list>\n\t\t\t\t <v-list-item v-ripple=\"{ class: 'green--text' }\"\n\t\t\t\t\tv-for=\"n in links\" link @click=\"toRouter(n.to)\">\n\t\t\t\t\t<v-list-item-title>{{n.text}}</v-list-item-title>\n\t\t\t\t </v-list-item>\n\t\t\t\t</v-list>\n\t\t\t</v-menu>\n\t\t\t<v-menu\n\t\t\t offset-y\n\t\t\t >\n\t\t\t <template v-slot:activator=\"{ on }\">\n\t\t\t\t\t<v-btn icon text v-on=\"on\">\n\t\t\t\t\t\t<v-icon>mdi-account</v-icon>\n\t\t\t\t\t</v-btn>\n\t\t\t </template>\n\t\t\t\n\t\t\t <v-card outlined style=\"border: none;\" tile>\n\t\t\t \t<v-list-item dense>\n\t\t\t\t\t\t<v-list-item-avatar tile size=\"24\">\n\t\t\t\t\t\t\t<v-img :src=\"logo\"/>\n\t\t\t\t\t\t</v-list-item-avatar>\n\t\t\t\t\t\n\t\t\t\t\t\t<v-list-item-content>\n\t\t\t\t\t\t\t<v-list-item-title class=\"subtitle-1\">{{userData.name}}</v-list-item-title>\n\t\t\t\t\t\t</v-list-item-content>\n\t\t\t \t\n\t\t\t \t</v-list-item>\n\t\t\t\t\t <v-divider></v-divider>\n\t\t\t\t\t \n\t\t\t\t\t <v-list-item dense>\n\t\t\t\t\t\t <v-list-item-avatar tile size=\"24\">\n\t\t\t\t\t\t \t<v-icon>mdi-email</v-icon>\n\t\t\t\t\t\t </v-list-item-avatar>\n\t\t\t\t \n\t\t\t\t\t\t <v-list-item-content>\n\t\t\t\t\t\t <v-list-item-title>{{userData.email}}</v-list-item-title>\n\t\t\t\t\t\t </v-list-item-content>\n\n\t\t\t\t\t</v-list-item>\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t<v-list-item dense>\n\t\t\t\t\t\t <v-list-item-avatar tile size=\"24\">\n\t\t\t\t\t\t \t<v-icon>mdi-av-timer</v-icon>\n\t\t\t\t\t\t </v-list-item-avatar>\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t <v-list-item-content>\n\t\t\t\t\t\t <v-list-item-title>{{changeTime(userData.endTime)}} 到期</v-list-item-title>\n\t\t\t\t\t\t </v-list-item-content>\n\t\t\t\t\t\n\t\t\t\t\t</v-list-item>\n\t\t\t\t\t<v-divider></v-divider>\n\t\t\t\t\t<v-list-item dense>\n\t\t\t\t\t\t <v-list-item-content>\n\t\t\t\t\t\t\t <div class=\"ma-0 d-flex align-center justify-space-between\">\n\t\t\t\t\t\t\t\t<v-btn small text color=\"error\" @click=\"renew\">续期</v-btn>\n\t\t\t\t\t\t\t\t<v-btn small text color=\"primary\" @click=\"exit\">退出</v-btn>\n\t\t\t\t\t\t\t </div>\n\n\t\t\t\t\t\t </v-list-item-content>\n\t\t\t\t\t\n\t\t\t\t\t</v-list-item>\n\t\t\t\t\t\n\t\t\t </v-card>\n\t\t\t\t \n\t\t\t </v-menu>\n\t </v-toolbar>\n\t\t<v-dialog v-model=\"dialog\" width=\"500\" persistent>\n\t\t\t<v-card>\n\t\t\t\t<v-card-title class=\"headline grey lighten-2\" primary-title>\n\t\t\t\t\t激活账号\n\t\t\t\t</v-card-title>\n\t\t\t\t\t\n\t\t\t\t<v-card-text>\n\t\t\t\t\t<v-form ref=\"codeForm\" v-model=\"codeValid\" lazy-validation>\n\t\t\t\t\t\t<v-text-field v-model=\"code\" label=\"激活码\" :rules=\"[rules.not,rules.required,rules.isEmpty]\"></v-text-field>\n\t\t\t\t\t</v-form>\n\t\t\t\t\t\n\t\t\t\t</v-card-text>\n\t\t\t\t\t\n\t\t\t\t<v-card-actions>\n\t\t\t\t\t<div class=\"flex-grow-1\"></div>\n\t\t\t\t\t<v-btn color=\"primary\" text @click=\"cancelDialog\">\n\t\t\t\t\t\t关闭\n\t\t\t\t\t</v-btn>\n\t\t\t\t\t<v-btn color=\"primary\" text @click=\"postCode\">\n\t\t\t\t\t\t确定\n\t\t\t\t\t</v-btn>\n\t\t\t\t</v-card-actions>\n\t\t\t</v-card>\n\t\t</v-dialog>\n</div>\n",null]} | json |
body {
background-image:
url(../img/background.jpg);
background-repeat:
no-repeat;
background-size: 100%,100%;
}
#header{
background:
url(../img/earphone.png);
background-repeat:
no-repeat;
height:50px;
position:relative;
top:35px;
left:200px;
}
#content{
position:relative;
left:260px;
top:0px;
font-size:25px;
color:white;
}
#main{
height:643px;
width:500px;
position:relative;
left:200px;
top:10px;
background-color:white;
}
.cover{
height:400px;
width:300px;
position:relative;
left:100px;
top:30px;
background-image:
url(../img/chenyixun.jpg);
}
.lyrics{
height:643px;
width:500px;
position:absolute;
left:709px;
top:96px;
background-color:transparent;
color: white;
text-indent: 2em;
overflow: auto;
}
h2.small {line-height: 40%;}
p.small {line-height: 40%}
p {font-size:16px;font-family: "微软雅黑";}
| css |
<reponame>greenelab/nature_news_disparities
version https://git-lfs.github.com/spec/v1
oid sha256:c02a670d5ec98bf5827af84b005db93c56a1a0201810faac9bb8b73c228a6d0c
size 525000
| json |
<filename>index-list/individual/AnatomyAgony.json
{
"AnatomyAgony": [
"AgonizingStomachWound",
"AgonyOfTheFeet",
"AnArmAndALeg",
"AssShove",
"AttackTheMouth",
"AttackTheTail",
"BoomHeadshot",
"BorrowedBiometricBypass",
"BreastAttack",
"ButtBiter",
"ButtBrand",
"ChestBurster",
"ClipItsWings",
"ComedicSpanking",
"CripplingCastration",
"CrushingHandshake",
"DecapitationRequired",
"EarAche",
"EyeScream",
"Fingore",
"FreudianThreat",
"GlasgowGrin",
"GoForTheEye",
"GroinAttack",
"GuttedLikeAFish",
"HalfTheManHeUsedToBe",
"HandStomp",
"HeartTrauma",
"HurtFootHop",
"ImpaledPalm",
"ImpromptuTracheotomy",
"InjuredLimbEpisode",
"KillItThroughItsStomach",
"LifeOrLimbDecision",
"LiteralDisarming",
"MouthStitchedShut",
"NasalTrauma",
"NoseShove",
"OffWithHisHead",
"OrificeInvasion",
"OrificeEvacuation",
"OwMyBodyPart",
"PainToTheAss",
"PrettyLittleHeadshots",
"PutTheirHeadsTogether",
"RemovingTheHeadOrDestroyingTheBrain",
"RumpRoast",
"ShotInTheAss",
"SymbolicMutilation",
"TearOffYourFace",
"TeethFlying",
"TongueTrauma",
"TheToothHurts",
"WhoNeedsTheirWholeBody"
]
} | json |
Just because Prime Big Deals Days is an Amazon-invented shopping holiday, doesn’t mean other retailers aren’t getting involved. For example, Dell has some great October Prime Day laptop deals running on its site. If you are a professional looking to upgrade your work computer, you should check out this deal. The Dell Latitude 3420, a 14-inch business laptop, is on sale for $699, which is 50% off its usual $1,396. The $700 discount on a powerful laptop probably won’t last, so get it while the Prime Day deals are still active.
What differentiates a business laptop from a casual laptop or a gaming laptop? Business laptops focus on power, speed, and the ability to run multiple programs simultaneously. This usually elevates them above casual laptops in almost every way. They sometimes resemble gaming laptops, but they often don’t focus so much on graphics cards.
This configuration of Dell Latitude follows that formula. It has an 11th generation Intel Core i7 processor, which is a solid processor even if it is somewhat dated. It has 16GB RAM, which is enough to run multiple programs simultaneously. You will have no problem running Zoom, Google Chrome, Microsoft Excel, and Microsoft Teams at the same time. Where performance falls short of gaming laptops is the graphics card. It has Nvidia GeForce MX350. It’s a quality component, but if you work with image editing or video rendering, you may want to upgrade to an Nvidia GTX graphics card.
The screen is a 14-inch FHD monitor, which means it has 1080p. This works for most business situations, and you can always plug in some external monitors (on sale in the Prime Day monitor deals) to your screen real estate. It only comes with 256GB of storage, so you’ll probably want to take advantage of some external hard drive deals while Amazon’s Prime Day sale is still going on.
The Dell Latitude 3420 business laptop is 50% off during October Prime Day, bringing the price down from $1,396 to $699. This deal will likely last until Amazon’s Prime Day event, but Dell is notorious for selling out its laptops during sales. If you are looking to upgrade your work computer then get this soon.
| english |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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.
*/
/**
* @file Visual solution, for consistent option specification.
*/
import * as zrUtil from 'zrender/src/core/util';
import VisualMapping, { VisualMappingOption } from './VisualMapping';
import { Dictionary } from 'zrender/src/core/types';
import {
BuiltinVisualProperty,
ParsedValue,
DimensionLoose,
StageHandlerProgressExecutor,
DimensionIndex
} from '../util/types';
import SeriesData from '../data/SeriesData';
import { getItemVisualFromData, setItemVisualFromData } from './helper';
const each = zrUtil.each;
type VisualMappingCollection<VisualState extends string>
= {
[key in VisualState]?: {
[key in BuiltinVisualProperty]?: VisualMapping
} & {
__alphaForOpacity?: VisualMapping
}
};
function hasKeys(obj: Dictionary<any>) {
if (obj) {
for (const name in obj) {
if (obj.hasOwnProperty(name)) {
return true;
}
}
}
}
type VisualOption = {[key in BuiltinVisualProperty]?: any};
export function createVisualMappings<VisualState extends string>(
option: Partial<Record<VisualState, VisualOption>>,
stateList: readonly VisualState[],
supplementVisualOption: (mappingOption: VisualMappingOption, state: string) => void
) {
const visualMappings: VisualMappingCollection<VisualState> = {};
each(stateList, function (state) {
const mappings = visualMappings[state] = createMappings();
each(option[state], function (visualData: VisualOption, visualType: BuiltinVisualProperty) {
if (!VisualMapping.isValidType(visualType)) {
return;
}
let mappingOption = {
type: visualType,
visual: visualData
};
supplementVisualOption && supplementVisualOption(mappingOption, state);
mappings[visualType] = new VisualMapping(mappingOption);
// Prepare a alpha for opacity, for some case that opacity
// is not supported, such as rendering using gradient color.
if (visualType === 'opacity') {
mappingOption = zrUtil.clone(mappingOption);
mappingOption.type = 'colorAlpha';
mappings.__hidden.__alphaForOpacity = new VisualMapping(mappingOption);
}
});
});
return visualMappings;
function createMappings() {
const Creater = function () {};
// Make sure hidden fields will not be visited by
// object iteration (with hasOwnProperty checking).
Creater.prototype.__hidden = Creater.prototype;
const obj = new (Creater as any)();
return obj;
}
}
export function replaceVisualOption<T extends string>(
thisOption: Partial<Record<T, any>>, newOption: Partial<Record<T, any>>, keys: readonly T[]
) {
// Visual attributes merge is not supported, otherwise it
// brings overcomplicated merge logic. See #2853. So if
// newOption has anyone of these keys, all of these keys
// will be reset. Otherwise, all keys remain.
let has;
zrUtil.each(keys, function (key) {
if (newOption.hasOwnProperty(key) && hasKeys(newOption[key])) {
has = true;
}
});
has && zrUtil.each(keys, function (key) {
if (newOption.hasOwnProperty(key) && hasKeys(newOption[key])) {
thisOption[key] = zrUtil.clone(newOption[key]);
}
else {
delete thisOption[key];
}
});
}
/**
* @param stateList
* @param visualMappings
* @param list
* @param getValueState param: valueOrIndex, return: state.
* @param scope Scope for getValueState
* @param dimension Concrete dimension, if used.
*/
// ???! handle brush?
export function applyVisual<VisualState extends string, Scope>(
stateList: readonly VisualState[],
visualMappings: VisualMappingCollection<VisualState>,
data: SeriesData,
getValueState: (this: Scope, valueOrIndex: ParsedValue | number) => VisualState,
scope?: Scope,
dimension?: DimensionLoose
) {
const visualTypesMap: Partial<Record<VisualState, BuiltinVisualProperty[]>> = {};
zrUtil.each(stateList, function (state) {
const visualTypes = VisualMapping.prepareVisualTypes(visualMappings[state]);
visualTypesMap[state] = visualTypes;
});
let dataIndex: number;
function getVisual(key: string) {
return getItemVisualFromData(data, dataIndex, key) as string | number;
}
function setVisual(key: string, value: any) {
setItemVisualFromData(data, dataIndex, key, value);
}
if (dimension == null) {
data.each(eachItem);
}
else {
data.each([dimension], eachItem);
}
function eachItem(valueOrIndex: ParsedValue | number, index?: number) {
dataIndex = dimension == null
? valueOrIndex as number // First argument is index
: index;
const rawDataItem = data.getRawDataItem(dataIndex);
// Consider performance
// @ts-ignore
if (rawDataItem && rawDataItem.visualMap === false) {
return;
}
const valueState = getValueState.call(scope, valueOrIndex);
const mappings = visualMappings[valueState];
const visualTypes = visualTypesMap[valueState];
for (let i = 0, len = visualTypes.length; i < len; i++) {
const type = visualTypes[i];
mappings[type] && mappings[type].applyVisual(
valueOrIndex, getVisual, setVisual
);
}
}
}
/**
* @param data
* @param stateList
* @param visualMappings <state, Object.<visualType, module:echarts/visual/VisualMapping>>
* @param getValueState param: valueOrIndex, return: state.
* @param dim dimension or dimension index.
*/
export function incrementalApplyVisual<VisualState extends string>(
stateList: readonly VisualState[],
visualMappings: VisualMappingCollection<VisualState>,
getValueState: (valueOrIndex: ParsedValue | number) => VisualState,
dim?: DimensionLoose
): StageHandlerProgressExecutor {
const visualTypesMap: Partial<Record<VisualState, BuiltinVisualProperty[]>> = {};
zrUtil.each(stateList, function (state) {
const visualTypes = VisualMapping.prepareVisualTypes(visualMappings[state]);
visualTypesMap[state] = visualTypes;
});
return {
progress: function progress(params, data) {
let dimIndex: DimensionIndex;
if (dim != null) {
dimIndex = data.getDimensionIndex(dim);
}
function getVisual(key: string) {
return getItemVisualFromData(data, dataIndex, key) as string | number;
}
function setVisual(key: string, value: any) {
setItemVisualFromData(data, dataIndex, key, value);
}
let dataIndex: number;
const store = data.getStore();
while ((dataIndex = params.next()) != null) {
const rawDataItem = data.getRawDataItem(dataIndex);
// Consider performance
// @ts-ignore
if (rawDataItem && rawDataItem.visualMap === false) {
continue;
}
const value = dim != null
? store.get(dimIndex, dataIndex)
: dataIndex;
const valueState = getValueState(value);
const mappings = visualMappings[valueState];
const visualTypes = visualTypesMap[valueState];
for (let i = 0, len = visualTypes.length; i < len; i++) {
const type = visualTypes[i];
mappings[type] && mappings[type].applyVisual(value, getVisual, setVisual);
}
}
}
};
}
| typescript |
import "reflect-metadata";
import { injectable, inject, TYPES } from "../../inversify";
@injectable()
export default class ValidatorRoutes implements lib.IRoutes {
constructor(
@inject(TYPES.Api.ValidatorHandler) private _handler: api.IValidatorHandler
) {}
get() {
return [
{
method: "GET",
path: "/validators",
handler: this._handler.getValidatorSummary
}
];
}
}
| typescript |
{
"id": 16338,
"source": "nyman",
"verse_id": 17741,
"verse_count": 30,
"reference": 5,
"title": "The Parable of the Vineyard",
"html": " <p>This chapter appears to be a continuation of chapters 2 through 4, but is treated separately here because it can be read as an independent unit. It is one of the few parables in the Old Testament and uses imagery similar to that which Jesus used in several parables during his ministry among the Jews. The interpretation of the parable, also given by Isaiah, definitely identifies the vineyard as the house of Israel and the pleasant plant as the men of Judah. Such parables as the laborers in the vineyard (<a class=\"ref\">Matt. 20:1-16<\/a>), the two sons (<a class=\"ref\">Matt. 21:28-32<\/a>), the wicked husbandman (<a class=\"ref\">Matt. 21:33-44; Mark 12:1-11; Luke 20:9-18<\/a>), the barren fig tree (<a class=\"ref\">Luke 13:6-9<\/a>), and the true vine (<a class=\"ref\">John 15:1-8<\/a>) all use the same imagery.<\/p> <p>There is also a resemblance to the allegory of Zenos, which is recorded in the Book of Mormon (Jacob 5) and probably was once in the Old Testament record (see <a class=\"ref\">Rom. 11:17-24<\/a>). Both concern the whole house of Israel.<\/p> <p>Isaiah's parable is followed by six warnings which seem related to the downfall of northern Israel, apparently given as a warning to Judah so she would be left without excuse. However, the warnings are also extended to the latter days, when the Lord will gather the righteous from the wicked unto Zion and Jerusalem. Following is a brief outline of the chapter:<\/p> <p>1.The parable and the interpretation are given (5:1-7). <\/p> <p>a.The parable likens Israel to a vineyard (5:1-6).<\/p> <p>b.The interpretation is explained (5:7).<\/p> <p>2.The six warnings are given (5:8-25).<\/p> <p>a.A warning is given against socialism (5:8-10).<\/p> <p>b.A warning is given against alcoholism (5:11-17).<\/p> <p>c.Israel is warned against gross dishonesty and a distorted value system (5:18-19).<\/p> <p>d.She is warned against a perverted moral code (5:20).<\/p> <p>e.There is a warning against pseudo-intellectualism (5:21).<\/p> <p>f.A warning is given against false and misleading advertising (5:22-23).<\/p> <p>3.The Lord's hand is stretched out in judgment upon his people (5:24-25).<\/p> <p>4.The ensign (Book of Mormon) is lifted to the nations (5:26-30).<\/p> <p>a.The messengers will come with speed (5:26-28).<\/p> <p>b.The prey will be carried away safely (5:29).<\/p> <p>c.Darkness will remain upon the land deserted by the righteous of Israel (5:30).<\/p> <p>The entire chapter is quoted in the Book of Mormon with several retentions in the text, only a few of which are significant. There is only one reference in the Doctrine and Covenants which relates to Isaiah chapter 5. There are several enlightenments upon the text given by modern-day Church authorities.<\/p> ",
"audit": null
} | json |
Empoli are set to play Inter Milan at The Stadio comunale Carlo Castellani on Wednesday in Serie A.
Empoli come into this game on the back of a 4-2 win over Stefano Colantuono's Salernitana in the league. A brace from striker Andrea Pinamonti, an own goal from Norwegian centre-back Stefan Strandberg and a goal from Italy international Patrick Cutrone sealed the deal for Aurelio Andreazzoli's Empoli.
A second-half goal from left-back Luca Ranieri and an own goal from Albania international Ardian Ismajli proved to be mere consolation for Salernitana.
Inter Milan, on the other hand, drew 1-1 against Massimiliano Allegri's Juventus in the league. A first-half goal from veteran Bosnia and Herzegovina international Edin Dzeko for Inter Milan was cancelled out by a late second-half penalty from Argentine forward Paulo Dybala for Juventus.
In 13 head-to-head encounters between the two sides, Inter Milan have won 12 games and drawn one.
The two clubs last faced each other in 2019 in the league, with Inter Milan beating Empoli 2-1. Second-half goals from Senegal international Keita Balde and Belgian midfielder Radja Nainggolan secured the win for Inter Milan, who had Keita Balde sent off late in the second-half. Young Ivorian midfielder Hamed Traore scored the consolation goal for Empoli, who had goalkeeper Filippo Perucchini sent off in the second-half.
Empoli will likely be without experienced centre-back Simone Romagnoli. Other than that there are no known issues and manager Aurelio Andreazzoli is expected to have a fully fit squad at his disposal.
Meanwhile, Inter Milan boss Simone Inzaghi will be unable to call upon the services of young Brazilian goalkeeper Gabriel Brazao.
Empoli are currently 10th in the league table, and have won three of their last five league games. The win against Salernitana will boost their confidence, and they could cause some problems to Inter Milan.
Inter Milan, on the other hand, were whiskers away from a crucial victory against Juventus. Simone Inzaghi have been inconsistent recently, and are currently 3rd in the league table, seven points behind league leaders Napoli.
Inter Milan should win here. | english |
{
"generator-openapi-repo": {
"importExistingSpec": false,
"name": "Yodata Activity Streams",
"repo": "Yodata/activity-streams-api",
"splitSpec": false,
"samples": true,
"installSwaggerUI": true
}
} | json |
<gh_stars>0
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CRAN - Package hues</title>
<link rel="stylesheet" type="text/css" href="../../CRAN_web.css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="citation_title" content="Distinct Colours Palettes Based on 'iwanthue' [R package hues version 0.1]" />
<meta name="citation_author" content="<NAME>" />
<meta name="citation_publication_date.Published" content="2017-11-07" />
<meta name="citation_public_url" content="https://CRAN.R-project.org/package=hues" />
<meta name="DC.identifier" content="https://CRAN.R-project.org/package=hues" />
<meta name="DC.publisher" content="Comprehensive R Archive Network (CRAN)" />
<style type="text/css">
table td { vertical-align: top; }
</style>
</head>
<body>
<h2>hues: Distinct Colours Palettes Based on 'iwanthue'</h2>
<p>Creating effective colour palettes for figures is
challenging. This package generates and plot palettes of optimally
distinct colours in perceptually uniform colour space, based on
'iwanthue' <<a href="http://tools.medialab.sciences-po.fr/iwanthue/">http://tools.medialab.sciences-po.fr/iwanthue/</a>>.
This is done through k-means clustering of CIE Lab colour space,
according to user-selected constraints on hue, chroma, and
lightness.</p>
<table summary="Package hues summary">
<tr>
<td>Version:</td>
<td>0.1</td>
</tr>
<tr>
<td>Depends:</td>
<td>R (≥ 3.2.0)</td>
</tr>
<tr>
<td>Imports:</td>
<td><a href="../colorspace/index.html">colorspace</a>, methods</td>
</tr>
<tr>
<td>Published:</td>
<td>2017-11-07</td>
</tr>
<tr>
<td>Author:</td>
<td><NAME> [aut, cre]</td>
</tr>
<tr>
<td>Maintainer:</td>
<td><NAME> <johnbaums at gmail.com></td>
</tr>
<tr>
<td>BugReports:</td>
<td><a href="https://github.com/johnbaums/hues/issues">https://github.com/johnbaums/hues/issues</a></td>
</tr>
<tr>
<td>License:</td>
<td><a href="../../licenses/LGPL-3">LGPL (≥ 3)</a></td>
</tr>
<tr>
<td>URL:</td>
<td><a href="https://github.com/johnbaums/hues">https://github.com/johnbaums/hues</a></td>
</tr>
<tr>
<td>NeedsCompilation:</td>
<td>no</td>
</tr>
<tr>
<td>Materials:</td>
<td><a href="README.html">README</a> </td>
</tr>
<tr>
<td>CRAN checks:</td>
<td><a href="../../checks/check_results_hues.html">hues results</a></td>
</tr>
</table>
<h4>Downloads:</h4>
<table summary="Package hues downloads">
<tr>
<td> Reference manual: </td>
<td> <a href="hues.pdf"> hues.pdf </a> </td>
</tr>
<tr>
<td> Package source: </td>
<td> <a href="../../../src/contrib/hues_0.1.tar.gz"> hues_0.1.tar.gz </a> </td>
</tr>
<tr>
<td> Windows binaries: </td>
<td> r-devel: <a href="../../../bin/windows/contrib/3.6/hues_0.1.zip">hues_0.1.zip</a>, r-release: <a href="../../../bin/windows/contrib/3.5/hues_0.1.zip">hues_0.1.zip</a>, r-oldrel: <a href="../../../bin/windows/contrib/3.4/hues_0.1.zip">hues_0.1.zip</a> </td>
</tr>
<tr>
<td> OS X binaries: </td>
<td> r-release: <a href="../../../bin/macosx/el-capitan/contrib/3.5/hues_0.1.tgz">hues_0.1.tgz</a>, r-oldrel: <a href="../../../bin/macosx/el-capitan/contrib/3.4/hues_0.1.tgz">hues_0.1.tgz</a> </td>
</tr>
</table>
<h4>Linking:</h4>
<p>Please use the canonical form
<a href="https://CRAN.R-project.org/package=hues"><samp>https://CRAN.R-project.org/package=hues</samp></a>
to link to this page.</p>
</body>
</html>
| html |
The Bar Association of Kathua ‘condemned the conduct of the police in dealing with the issue’.
Lawyers at the Chief Judicial Magistrate’s court in Kathua, Jammu and Kashmir, held a protest as the police filed a chargesheet against seven people accused of kidnapping, rape and murder of an eight-year-old girl in January, news agency GNS reported.
On March 20, a 60-year-old man, who had allegedly planned the crimes, surrendered to the crime branch.
The Crime Branch has arrested eight people in the case so far, including the alleged mastermind identified as Sanji Ram and his son.
The Bar Association of Kathua reportedly released a statement against the filing of the chargesheet. “All the members of the Bar condemn the conduct of the Crime Branch in dealing with the issue,” the statement said. Former Chief Minister Omar Abdullah criticised the protest. “Shame on them [protesting lawyers] and their political masters,” Abdullah tweeted.
The brutal rape and murder had sparked protests across the state, with several groups demanding a Central Bureau of Investigation inquiry. In February, the Jammu and Kashmir Police had arrested a special police officer in connection with the case. A police constable and a sub-inspector were also arrested after the Crime Branch found they had allegedly tried to destroy evidence of the crime.
Ram, 60, a former government official, allegedly planned the crime to terrorist the Gujjar Muslim community living in Rasana. He surrendered to the Crime Branch on March 20, but not before participating in protests organised by the Hindu Ekta Manch against the police officer’s arrest, according to Rising Kashmir.
In March, Chief Minister Mehbooba Mufti rejected the demand for a CBI inquiry, saying the Crime Branch had already completed “over 95%” of the investigation.
| english |
The much-hyped solar policy of the Gujarat government has come in for some sharp criticism by the Comptroller and Auditor General of India (CAG), who has rapped the state for awarding solar projects to “ineligible bidders”, and for creating excess burden of Rs 473 crore on power consumers in the state.
“As per the Solar Policy 2009, a maximum of 500 MW solar power generation was envisaged up to March 31, 2014…Against this ceiling of 500 MW, capacity of 958 MW was set up by developers till November 2010, for which GUVNL (Gujarat Urja Vikas Nigam Ltd) signed PPAs (Power Purchase Agreements) on the directives of Government of Gujarat,” CAG pointed out in its report on Public Sector Undertakings (PSUs) tabled in the state legislature on Friday.
“GUVNL/GoG… had approved development of solar projects far in excess resulting in purchase of 1,139 million units of solar power in 2012-13 (bought at cost of Rs 14 per unit), against the stipulated 686 million units. This excess purchase of 453 million units led to excess burden of Rs 473 crore and consequently passing of the burden to consumers through increased average cost of power of the GUVNL,” the report added.
This was done in “disregard” to the economical mix proposed by GERC (Gujarat Electricity Regulatory Commission). “Capacity under costlier solar power was created in excess of what was required by GERC orders and many developers selected did not satisfy the technical and financial criteria prescribed under the Solar Policy,” the auditor observed.
CAG pointed out 10 cases where project developers were allocated projects. The companies who have been named in the CAG report are Rasna Marketing Services Pvt Ltd, Jayhind Projects Ltd, Alex Asatral Power Pvt Ltd, Ganga Entertainment Pvt Ltd, Som Shiva (Impex) Ltd, Responsive SUTIP Ltd, NKG Infrastructure Ltd, Konark Gujarat Pvt Ltd, Sand Land Real Estate Pvt Ltd and Sun Clean Renewable Power Ltd.
“In four of the 10 cases, the object clause of MoA (Memorandum of Association) do developer who were registered under the Companies Act 1956, did not envisage power generation activity to be pursued by them,” the report added with an observation that the Gujarat government did not have a mechanism to monitor that incentives availed by solar power developers under Customs and Excise at a later stage were passed on through lower tariff to GUVNL.
CAG also criticised GUVNL’s executing a PPA with state run-Bhavnagar Energy Company Ltd (November 2009) for purchase of 500 MW of power from their lignite-based power plant in Bhavnagar. “Such increased levelised tariff (Rs 3. 32 per Kwh) will burden GUVNL with an extra purchase cost of Rs 38 crore per annum,” it observed. | english |
export default {
widget: 2,
navigation: 5,
banner: 10,
modal: 10,
sidebar: 10,
floatingActionButton: 20,
skipLink: 100,
}
| javascript |
"""
Tests for Day 22
"""
from day22.module import part_1, part_2, \
FULL_INPUT_FILE, TEST_INPUT_FILE_1, TEST_INPUT_FILE_2, TEST_INPUT_FILE_3
def test_part_1_1():
result = part_1(TEST_INPUT_FILE_1)
assert result == 39
def test_part_1_2():
result = part_1(TEST_INPUT_FILE_2)
assert result == 590784
def test_part_1_3():
result = part_1(TEST_INPUT_FILE_3)
assert result == 474140
def test_part_1_full():
result = part_1(FULL_INPUT_FILE)
assert result == 546724
def test_part_2():
result = part_2(TEST_INPUT_FILE_3)
assert result == 2758514936282235
def test_part_2_full():
result = part_2(FULL_INPUT_FILE)
assert result == 1346544039176841
| python |
<reponame>frainfreeze/sqlalchemy-filters-plus
from datetime import datetime
import factory
import faker
from factory.alchemy import SQLAlchemyModelFactory
from tests.models import Article
from tests.models import Category
from tests.models import User
factories_registry = set()
Faker = faker.Faker()
class BaseModelFactory(SQLAlchemyModelFactory):
def __init_subclass__(cls, **kwargs):
super().__init_subclass__(**kwargs)
factories_registry.add(cls)
class Meta:
abstract = True
class UserFactory(BaseModelFactory):
birth_date = factory.Sequence(lambda n: datetime.strptime(Faker.date(), "%Y-%m-%d"))
class Meta:
model = User
class CategoryFactory(BaseModelFactory):
class Meta:
model = Category
class ArticleFactory(BaseModelFactory):
category = factory.SubFactory(CategoryFactory)
user = factory.SubFactory(UserFactory)
class Meta:
model = Article
def patch_factories_session(session):
for _factory in factories_registry:
_factory._meta.sqlalchemy_session = session
| python |
Truth is Eternal, Living and Perfect! Truth exists, cannot change in any way, but is the same yesterday, today and forever. All Questions of Life, great and small, are answered in The Truth. The Whence and Whither of man, indeed, of all Creation is clear from The Truth. All the problems of today have their solutions in The Truth. But the greatest question is: What really is Truth? And, most of all, how can we recognise It? How will we know we have found It? In this work, the author postulates a Premise by which every Seeker of Truth can find and recognise The Perfect Truth. On the basis of this Supreme Premise, the author explains the concepts of spirit, intuition, intellect, and reveals how the Seeker may find the true path to the intuition, which alone enables one to recognise The Truth. And, lastly, this work reveals the Seven Signs of The Truth, by which one may recognise The Word of Truth, which is on the Earth at just this crucial point in time! May the reader open eyes and heart, and therein find!
Currently there are no reviews available for this book.
Be the first one to write a review for the book WHAT IS TRUTH?.
| english |
Indian fast bowler and seamer Mohammed Shami's phenomenal run continue in the Indian side, especially following his latest return to Test cricket.
Indian fast bowler and seamer Mohammed Shami‘s phenomenal run continue in the Indian side, especially following his latest return to Test cricket, where he has once again proved that he is currently the best seamer in the side. In the ongoing Test series vs England, he has had better bowling figures and numbers, as compared to that of Ravichandran Ashwin and Ravindra Jadeja. Shami so far has claimed 10 wickets in the three Tests, with an average of 25. 20, while he has continued to evolve good under the captaincy of Virat Kohli, and having claimed 38 wickets, with an average of 28. 57. He has had similar run in the ODIs as well for India. | english |
The Delhi High Court on Thursday ordered that customs departments should clear the import of Amphotericin-B, the drug used to treat mucormycosis or “black fungus”, by accepting a bond from the importer without actual payment of import duty, till the Centre makes a final decision on a waiver, reported Live Law.
A bench of Justices Vipin Sanghi and Jasmeet Singh also directed the Centre to consider waiving import duty on the medicine while it remains in short supply. “The bond [given] to the effect that duty shall be paid if the same is not waived,” said the High Court, reported The Indian Express.
The order came on a plea filed by advocate Iqra Khalid whose grandfather was in need of the drug for the treatment of the fungus infection. The High Court was considering the shortage of the Amphotericin-B and a possible mechanism for its procurement to treat people infected by black fungus.
“Black fungus” disease is caused by a fungus named mucor, which is found on wet surfaces. The symptoms of the infection include headache, fever, pain under the eyes, nasal or sinus congestion, and partial loss of vision, among others. It mainly affects people who have health problems or take medicines that lower the body’s ability to fight germs and sickness and most commonly affects the sinuses or the lungs after inhaling fungal spores from the air, according to the United States’ Centers for Disease Control and Prevention.
There is a shortage of the drug to treat the fungal infection. On Wednesday, Delhi Chief Minister Arvind Kejriwal had said that there were around 620 cases of mucormycosis in the national Capital as well as a shortage of Amphotericin-B.
During the hearing on Thursday, the High Court also took on record the submission of Advocate Nidhi Mohan Parashar, representing the Centre, that customs will clear all consignments of the medicine without any delay.
Citing a judgement passed by the High Court on waiving Integrated Goods and Services Tax in the import of oxygen concentrators for individual needs, the bench asked the Centre if it was fair to levy duties on Amphotericin-B.
To this, Parashar replied that the Centre will try to do it expeditiously.
| english |
Royal Challengers Bangalore (RCB) skipper Faf du Plessis was dismissed after another brilliant knock, thanks to a juggling catch by substitute fielder Vishnu Vinod off the bowling of Cameron Green against the Mumbai Indians (MI) at the Wankhede Stadium in Mumbai on Tuesday, May 9.
Du Plessis scored 65 off 41 deliveries, including five four and three sixes before being dismissed in the first ball of the 15th over with the score reading 146/4.
The former South African skipper tried to play his favorite premeditated scoop shot but took his eye off the ball at the point of contact to a delivery wide outside off. It resulted in the ball being miscued to short fine leg where Vishnu Vinod took the catch on the third attempt after a couple of fumbles.
Here is a video of Faf du Plessis' dismissal:
Faf du Plessis was dropped off the fourth ball of the innings by Nehal Wadhera at mid-wicket off the bowling of Australian left-arm seamer Jason Behrendorff when he hadn't opened his account yet.
The drop proved costly as the right-handed batter made MI pay with a sublime knock after fellow opener Virat Kohli was dismissed for just one run. He put on a scintillating partnership of 120 off 61 balls to resurrect the RCB innings from 16-2.
The partnership propelled them to a competitive total on a placid Wankhede pitch of 199-6 in their 20 overs.
Faf du Plessis has been in red-hot form this season, scoring 556 runs through 11 games at an average of 61. 78 and a strike rate of 157. 95 with five half-centuries.
The game is a virtual must-win for both sides as they are in a tricky position concerning playoff qualification with five wins in ten games.
The newest member of the Royal Challengers Bangalore squad, Kedar Jadhav, spoke glowingly about former skipper Virat Kohli and how his intensity rubs off on the other players in the team.
Jadhav was named as a replacement for David Wiley, who picked up a toe injury in RCB's 21-run defeat to the Kolkata Knight Riders (KKR) on April 26.
Speaking ahead of the RCB-MI clash, Jadhav said:
"He has a strong personality, likes to lead from the front. Whatever it is, batting or bowling, he wants to contribute in winning games whichever teams he plays for. It definitely rubs off on the team. The players want to perform close to that level, or close to that intensity he brings in, in his batting or when he is practising. "
The 38-year-old Jadhav represented RCB in 2016 and 2017 and played 17 matches, scoring 311 runs at an average of 23. 92 and a strike rate of 142. 66.
He has scored 1,196 runs at an average of 22. 15 and a strike rate of 123. 17 in his overall IPL career. | english |
National carrier Air India, whose FY16 budgetary allocation had been cut, will now receive a bigger amount as a parliamentary committee has recommended to the government that it should make an additional equity infusion of Rs 1,777 crore.
The Department Related Parliamentary Standing Committee on Transport, Tourism and Culture had, in an April 28 report, said it hoped for additional funds into Air India in the form of equity infusion as per the turn around plan (TAP).
“The committee recommends that since Air India is already on the path of recovery and preforming well, the government should provide Rs 1,777 crore which stands as a deficit in equity infusion without any cut during the course of the current financial year,” the report said.
According to senior Air India officials, the government is expected to approve this additional infusion during the monsoon session and the airline hopes to receive the amount by August-September.
“The Rs 1,777 crore will be used by the airline to pay off a part of government-garunteed loans, while the remaining will be used to service the interest rates on such loans,” a senior airline official told FE.
The airline’s net debt, including aircraft and working capital loans, stood at about Rs 40,000 crore at the end of December 31.
Air India had asked the finance ministry for Rs 4,277 crore in 2015-16 to repay debt, strengthen operations and hire staff, as it strives to return to profitability by 2018-19.
While the government had budgeted Rs 6,500 crore for the carrier in FY15 and Rs 6,000 crore in FY14, it allocated only Rs 2,500 crore to the airline during FY16. The decision to cut down allocation by more than a half came despite the government not releasing about Rs 720 crore out of Rs 6,500 crore announced for FY15 due to fiscal constraints.
“The main focus for FY16 is to improve on our on-time performance (OTP) and return to profitability. If we can improve on our current performance, we can hope to report profit from 2018-19. From this aspect the government infusion is extremely important for us,” the senior Air India official added.
The national carrier expects an operating profit of about Rs 10 crore during FY16, its first annual operating profit since the implementation of the government-approved TAP in 2012. It hopes to achieve a 77.7% passenger load factor (PLF) on domestic routes and a 73 PLF on international routes during the period.
During the first nine months of Fy15, Air India’s total revenues stood at Rs 16,000 crore while its operating expenses were Rs 16,700 crore. The airline posted an operating loss of Rs 1,700 crore and a net loss of Rs 3,600 crore during the period. According to the airline’s budget estimates for FY15, it is expected to post a net loss of Rs 4,346 crore on total revenue of Rs 21,290 crore and operating expenses of Rs 22,525 crore.
| english |
#!/usr/bin/env python
"""PlayerPiano amazes your friends by running Python doctests in a fake interactive shell.
author: <NAME>
email: <EMAIL>
homepage: http://playerpiano.googlecode.com/
Original idea & minor tty frobage from <NAME>. Thanks Ian!
"""
import doctest
import termios
import tty
import sys
import argparse
import re
import os.path
import importlib
import contextlib
from . import terminal_highlighter, fifo_target, terminal_target
@contextlib.contextmanager
def frob_tty():
"""massage the terminal to not echo characters & the like"""
stdin_fd = sys.stdin.fileno()
old_mask = termios.tcgetattr(stdin_fd)
new = old_mask[:]
LFLAGS = 3
new[LFLAGS] &= ~termios.ECHO
termios.tcsetattr(stdin_fd, termios.TCSADRAIN, new)
tty.setraw(stdin_fd)
try:
yield
finally:
# restore the terminal to its original state
termios.tcsetattr(stdin_fd, termios.TCSADRAIN, old_mask)
def eat_key():
"""consume a key. Exit on ^C"""
c = sys.stdin.read(1)
if c == '\x03': # ^C
sys.exit(1)
else:
return c
banner = '''Python {sys.version} on {sys.platform}
Type "help", "copyright", "credits" or "license" for more information.
'''.format(**globals())
doctest_re=re.compile('# *doctest.*$')
if sys.version_info[0] == 2:
def load_testfile(filename):
return doctest._load_testfile(filename, None, False)
else:
# For python3 compatibility
def load_testfile(filename):
return doctest._load_testfile(filename, None, False, 'utf8')
# based on doctest.testfile
def doctests_from_text(filename, encoding=None):
# Relativize the path
text, filename = load_testfile(filename)
name = os.path.basename(filename)
if encoding is not None:
text = text.decode(encoding)
# Read the file, convert it to a test, and run it.
test = doctest.DocTestParser().get_doctest(text, {}, name, filename, 0)
return [test]
def doctests_from_module(modname):
module = importlib.import_module(modname)
tests = doctest.DocTestFinder().find(module)
return tests
targets = {} # places we write to
def write(s):
for t in targets.values():
t(s)
def run(tests, highlight):
# clear the screen to hide the command we were invoked with & write banner
if sys.platform == 'nt':
os.system('cls')
else:
os.system('clear')
write(banner)
for test in tests:
for example in test.examples:
want = example.want
source = example.source
# strip doctest directives
source = doctest_re.sub('', source)
# highlight
source = highlight(source)
# strip trailing newline - added back below
assert source[-2] != '\r'
if source[-1] == '\n':
source = source[:-1]
# write out source code one keypress at a time
write('>>> ')
for s in source:
eat_key()
write(s)
if s == '\n':
write('... ')
# slurp extra keys until <enter>
while eat_key() != '\r':
pass
# write out response, adding stripped newline first
write('\n')
write(want)
# display final prompt & wait for <EOF> to exit
write('>>> ')
while eat_key() != '\x04': # ^D
pass
write('\n')
def main():
"""%(prog)s <options> <FILE>
PlayerPiano amazes your friends by running Python doctests
in a fake interactive shell.
Press: <random_keys> to 'type' source <EOF> to exit at the end
<enter> to show results. <^C> to break.
"""
parser = argparse.ArgumentParser(usage=main.__doc__)
parser.add_argument("--fifo", dest="fifo", action="store", default=None,
help="duplicate output to a fifo")
parser.add_argument("--no-terminal", dest="terminal", action="store_false", default=True,
help="disable output on main terminal")
parser.add_argument("--color", dest="color", action="store_true", default=False,
help="enable color for Python 2")
parser.add_argument("--color3", dest="color3", action="store_true", default=False,
help="enable color for Python 3")
parser.add_argument('file',
help="either a module name or the path to a text file")
options = parser.parse_args()
if options.terminal:
targets[terminal_target] = terminal_target.make_target(options)
if options.fifo:
targets[fifo_target] = fifo_target.make_target(options)
if options.color:
highlight = terminal_highlighter.highlight2
elif options.color3:
highlight = terminal_highlighter.highlight3
else:
highlight = lambda x: x
if os.path.exists(options.file):
tests = doctests_from_text(options.file)
else:
tests = doctests_from_module(options.file)
try:
with frob_tty():
run(tests, highlight)
finally:
for t in list(targets.keys()):
del targets[t]
t.free_target()
if __name__ == '__main__':
main()
| python |
""" A config only for reproducing the ScanNet evaluation results.
We remove border matches by default, but the originally implemented
`remove_border()` has a bug, leading to only two sides of
all borders are actually removed. However, the [bug fix](https://github.com/zju3dv/LoFTR/commit/e9146c8144dea5f3cbdd98b225f3e147a171c216)
makes the scannet evaluation results worse (auc@10=40.8 => 39.5), which should be
caused by tiny result fluctuation of few image pairs. This config set `BORDER_RM` to 0
to be consistent with the results in our paper.
Update: This config is for testing the re-trained model with the pos-enc bug fixed.
"""
from src.config.default import _CN as cfg
cfg.LOFTR.COARSE.TEMP_BUG_FIX = True
cfg.LOFTR.MATCH_COARSE.MATCH_TYPE = 'dual_softmax'
cfg.LOFTR.MATCH_COARSE.BORDER_RM = 0
| python |
You don't need that rumored Toshiba phone that "acts like a secretary," or even Maggie Gyllenhaal (though that would be nice), to have help when organizing your social life. Siri uses "speech recognition with a brain," according to its CEO.
To use the iPhone app, you just have to say aloud a command like "Book a table for six at 7pm at McDonalds" (I'm sure you're classier than that, but let's stick with it for now), and then using speech-recognition technology and the iPhone's GPS capabilities, your command is translated and processed by the app, responding with confirmation of booking—or lack of availability.
Siri, which has ties with Stanford Research Institude and DARPA, has collaborated with OpenTable, MovieTickets, StubHub, CitySearch and TaxiMagic to help with bookings and information, which pretty much wipes out the reason why you'd want to download any of those services' apps individually.
| english |
<gh_stars>0
use crate::{
cfg::{self, CfgPrivate},
clear::Clear,
page,
sync::{
alloc,
atomic::{
AtomicPtr, AtomicUsize,
Ordering::{self, *},
},
},
tid::Tid,
Pack,
};
use std::{fmt, ptr, slice};
// ┌─────────────┐ ┌────────┐
// │ page 1 │ │ │
// ├─────────────┤ ┌───▶│ next──┼─┐
// │ page 2 │ │ ├────────┤ │
// │ │ │ │XXXXXXXX│ │
// │ local_free──┼─┘ ├────────┤ │
// │ global_free─┼─┐ │ │◀┘
// ├─────────────┤ └───▶│ next──┼─┐
// │ page 3 │ ├────────┤ │
// └─────────────┘ │XXXXXXXX│ │
// ... ├────────┤ │
// ┌─────────────┐ │XXXXXXXX│ │
// │ page n │ ├────────┤ │
// └─────────────┘ │ │◀┘
// │ next──┼───▶
// ├────────┤
// │XXXXXXXX│
// └────────┘
// ...
pub(crate) struct Shard<T, C: cfg::Config> {
/// The shard's parent thread ID.
pub(crate) tid: usize,
/// The local free list for each page.
///
/// These are only ever accessed from this shard's thread, so they are
/// stored separately from the shared state for the page that can be
/// accessed concurrently, to minimize false sharing.
local: Box<[page::Local]>,
/// The shared state for each page in this shard.
///
/// This consists of the page's metadata (size, previous size), remote free
/// list, and a pointer to the actual array backing that page.
shared: Box<[page::Shared<T, C>]>,
}
pub(crate) struct Array<T, C: cfg::Config> {
shards: Box<[Ptr<T, C>]>,
max: AtomicUsize,
}
#[derive(Debug)]
struct Ptr<T, C: cfg::Config>(AtomicPtr<alloc::Track<Shard<T, C>>>);
#[derive(Debug)]
pub(crate) struct IterMut<'a, T: 'a, C: cfg::Config + 'a>(slice::IterMut<'a, Ptr<T, C>>);
// === impl Shard ===
impl<T, C> Shard<T, C>
where
C: cfg::Config,
{
#[inline(always)]
pub(crate) fn with_slot<'a, U>(
&'a self,
idx: usize,
f: impl FnOnce(&'a page::Slot<T, C>) -> Option<U>,
) -> Option<U> {
debug_assert_eq_in_drop!(Tid::<C>::from_packed(idx).as_usize(), self.tid);
let (addr, page_index) = page::indices::<C>(idx);
test_println!("-> {:?}", addr);
if page_index > self.shared.len() {
return None;
}
self.shared[page_index].with_slot(addr, f)
}
pub(crate) fn new(tid: usize) -> Self {
let mut total_sz = 0;
let shared = (0..C::MAX_PAGES)
.map(|page_num| {
let sz = C::page_size(page_num);
let prev_sz = total_sz;
total_sz += sz;
page::Shared::new(sz, prev_sz)
})
.collect();
let local = (0..C::MAX_PAGES).map(|_| page::Local::new()).collect();
Self { tid, local, shared }
}
}
impl<T, C> Shard<Option<T>, C>
where
C: cfg::Config,
{
/// Remove an item on the shard's local thread.
pub(crate) fn take_local(&self, idx: usize) -> Option<T> {
debug_assert_eq_in_drop!(Tid::<C>::from_packed(idx).as_usize(), self.tid);
let (addr, page_index) = page::indices::<C>(idx);
test_println!("-> remove_local {:?}", addr);
self.shared
.get(page_index)?
.take(addr, C::unpack_gen(idx), self.local(page_index))
}
/// Remove an item, while on a different thread from the shard's local thread.
pub(crate) fn take_remote(&self, idx: usize) -> Option<T> {
debug_assert_eq_in_drop!(Tid::<C>::from_packed(idx).as_usize(), self.tid);
debug_assert!(Tid::<C>::current().as_usize() != self.tid);
let (addr, page_index) = page::indices::<C>(idx);
test_println!("-> take_remote {:?}; page {:?}", addr, page_index);
let shared = self.shared.get(page_index)?;
shared.take(addr, C::unpack_gen(idx), shared.free_list())
}
pub(crate) fn remove_local(&self, idx: usize) -> bool {
debug_assert_eq_in_drop!(Tid::<C>::from_packed(idx).as_usize(), self.tid);
let (addr, page_index) = page::indices::<C>(idx);
if page_index > self.shared.len() {
return false;
}
self.shared[page_index].remove(addr, C::unpack_gen(idx), self.local(page_index))
}
pub(crate) fn remove_remote(&self, idx: usize) -> bool {
debug_assert_eq_in_drop!(Tid::<C>::from_packed(idx).as_usize(), self.tid);
let (addr, page_index) = page::indices::<C>(idx);
if page_index > self.shared.len() {
return false;
}
let shared = &self.shared[page_index];
shared.remove(addr, C::unpack_gen(idx), shared.free_list())
}
pub(crate) fn iter(&self) -> std::slice::Iter<'_, page::Shared<Option<T>, C>> {
self.shared.iter()
}
}
impl<T, C> Shard<T, C>
where
T: Clear + Default,
C: cfg::Config,
{
pub(crate) fn init_with<U>(
&self,
mut init: impl FnMut(usize, &page::Slot<T, C>) -> Option<U>,
) -> Option<U> {
// Can we fit the value into an exist`ing page?
for (page_idx, page) in self.shared.iter().enumerate() {
let local = self.local(page_idx);
test_println!("-> page {}; {:?}; {:?}", page_idx, local, page);
if let Some(res) = page.init_with(local, &mut init) {
return Some(res);
}
}
None
}
pub(crate) fn mark_clear_local(&self, idx: usize) -> bool {
debug_assert_eq_in_drop!(Tid::<C>::from_packed(idx).as_usize(), self.tid);
let (addr, page_index) = page::indices::<C>(idx);
if page_index > self.shared.len() {
return false;
}
self.shared[page_index].mark_clear(addr, C::unpack_gen(idx), self.local(page_index))
}
pub(crate) fn mark_clear_remote(&self, idx: usize) -> bool {
debug_assert_eq_in_drop!(Tid::<C>::from_packed(idx).as_usize(), self.tid);
let (addr, page_index) = page::indices::<C>(idx);
if page_index > self.shared.len() {
return false;
}
let shared = &self.shared[page_index];
shared.mark_clear(addr, C::unpack_gen(idx), shared.free_list())
}
pub(crate) fn clear_after_release(&self, idx: usize) {
crate::sync::atomic::fence(crate::sync::atomic::Ordering::Acquire);
let tid = Tid::<C>::current().as_usize();
test_println!(
"-> clear_after_release; self.tid={:?}; current.tid={:?};",
tid,
self.tid
);
if tid == self.tid {
self.clear_local(idx);
} else {
self.clear_remote(idx);
}
}
fn clear_local(&self, idx: usize) -> bool {
debug_assert_eq_in_drop!(Tid::<C>::from_packed(idx).as_usize(), self.tid);
let (addr, page_index) = page::indices::<C>(idx);
if page_index > self.shared.len() {
return false;
}
self.shared[page_index].clear(addr, C::unpack_gen(idx), self.local(page_index))
}
fn clear_remote(&self, idx: usize) -> bool {
debug_assert_eq_in_drop!(Tid::<C>::from_packed(idx).as_usize(), self.tid);
let (addr, page_index) = page::indices::<C>(idx);
if page_index > self.shared.len() {
return false;
}
let shared = &self.shared[page_index];
shared.clear(addr, C::unpack_gen(idx), shared.free_list())
}
#[inline(always)]
fn local(&self, i: usize) -> &page::Local {
#[cfg(debug_assertions)]
debug_assert_eq_in_drop!(
Tid::<C>::current().as_usize(),
self.tid,
"tried to access local data from another thread!"
);
&self.local[i]
}
}
impl<T: fmt::Debug, C: cfg::Config> fmt::Debug for Shard<T, C> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let mut d = f.debug_struct("Shard");
#[cfg(debug_assertions)]
d.field("tid", &self.tid);
d.field("shared", &self.shared).finish()
}
}
// === impl Array ===
impl<T, C> Array<T, C>
where
C: cfg::Config,
{
pub(crate) fn new() -> Self {
let mut shards = Vec::with_capacity(C::MAX_SHARDS);
for _ in 0..C::MAX_SHARDS {
// XXX(eliza): T_T this could be avoided with maybeuninit or something...
shards.push(Ptr::null());
}
Self {
shards: shards.into(),
max: AtomicUsize::new(0),
}
}
#[inline]
pub(crate) fn get(&self, idx: usize) -> Option<&Shard<T, C>> {
test_println!("-> get shard={}", idx);
self.shards.get(idx)?.load(Acquire)
}
#[inline]
pub(crate) fn current(&self) -> (Tid<C>, &Shard<T, C>) {
let tid = Tid::<C>::current();
test_println!("current: {:?}", tid);
let idx = tid.as_usize();
// It's okay for this to be relaxed. The value is only ever stored by
// the thread that corresponds to the index, and we are that thread.
let shard = self.shards[idx].load(Relaxed).unwrap_or_else(|| {
let ptr = Box::into_raw(Box::new(alloc::Track::new(Shard::new(idx))));
test_println!("-> allocated new shard for index {} at {:p}", idx, ptr);
self.shards[idx].set(ptr);
let mut max = self.max.load(Acquire);
while max < idx {
match self.max.compare_exchange(max, idx, AcqRel, Acquire) {
Ok(_) => break,
Err(actual) => max = actual,
}
}
test_println!("-> highest index={}, prev={}", std::cmp::max(max, idx), max);
unsafe {
// Safety: we just put it there!
&*ptr
}
.get_ref()
});
(tid, shard)
}
pub(crate) fn iter_mut(&mut self) -> IterMut<'_, T, C> {
test_println!("Array::iter_mut");
let max = self.max.load(Acquire);
test_println!("-> highest index={}", max);
IterMut(self.shards[0..=max].iter_mut())
}
}
impl<T, C: cfg::Config> Drop for Array<T, C> {
fn drop(&mut self) {
// XXX(eliza): this could be `with_mut` if we wanted to impl a wrapper for std atomics to change `get_mut` to `with_mut`...
let max = self.max.load(Acquire);
for shard in &self.shards[0..=max] {
// XXX(eliza): this could be `with_mut` if we wanted to impl a wrapper for std atomics to change `get_mut` to `with_mut`...
let ptr = shard.0.load(Acquire);
if ptr.is_null() {
continue;
}
let shard = unsafe {
// Safety: this is the only place where these boxes are
// deallocated, and we have exclusive access to the shard array,
// because...we are dropping it...
Box::from_raw(ptr)
};
drop(shard)
}
}
}
impl<T: fmt::Debug, C: cfg::Config> fmt::Debug for Array<T, C> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let max = self.max.load(Acquire);
let mut set = f.debug_map();
for shard in &self.shards[0..=max] {
let ptr = shard.0.load(Acquire);
if let Some(shard) = ptr::NonNull::new(ptr) {
set.entry(&format_args!("{:p}", ptr), unsafe { shard.as_ref() });
} else {
set.entry(&format_args!("{:p}", ptr), &());
}
}
set.finish()
}
}
// === impl Ptr ===
impl<T, C: cfg::Config> Ptr<T, C> {
#[inline]
fn null() -> Self {
Self(AtomicPtr::new(ptr::null_mut()))
}
#[inline]
fn load(&self, order: Ordering) -> Option<&Shard<T, C>> {
let ptr = self.0.load(order);
test_println!("---> loaded={:p} (order={:?})", ptr, order);
if ptr.is_null() {
test_println!("---> null");
return None;
}
let track = unsafe {
// Safety: The returned reference will have the same lifetime as the
// reference to the shard pointer, which (morally, if not actually)
// owns the shard. The shard is only deallocated when the shard
// array is dropped, and it won't be dropped while this pointer is
// borrowed --- and the returned reference has the same lifetime.
//
// We know that the pointer is not null, because we just
// null-checked it immediately prior.
&*ptr
};
Some(track.get_ref())
}
#[inline]
fn set(&self, new: *mut alloc::Track<Shard<T, C>>) {
self.0
.compare_exchange(ptr::null_mut(), new, AcqRel, Acquire)
.expect("a shard can only be inserted by the thread that owns it, this is a bug!");
}
}
// === Iterators ===
impl<'a, T, C> Iterator for IterMut<'a, T, C>
where
T: 'a,
C: cfg::Config + 'a,
{
type Item = &'a Shard<T, C>;
fn next(&mut self) -> Option<Self::Item> {
test_println!("IterMut::next");
loop {
// Skip over empty indices if they are less than the highest
// allocated shard. Some threads may have accessed the slab
// (generating a thread ID) but never actually inserted data, so
// they may have never allocated a shard.
let next = self.0.next();
test_println!("-> next.is_some={}", next.is_some());
if let Some(shard) = next?.load(Acquire) {
test_println!("-> done");
return Some(shard);
}
}
}
}
| rust |
{"word":"unconcernment","definition":"The state of being unconcerned, or of having no share or concern; unconcernedness. [Obs.] South."} | json |
<filename>data-analysis/data/50.json
{
"content": "Pokój dwuosobowy. Pokój dwuosobowy ( 20 m) w kamienicy przy ul. Sępa-Szarzyńskiego bardzo blisko Politechnika i kampus uniwersytecki. Mieszkanie po remoncie z pełnym wyposażeniem AGD i wyposażoną kuchnią. Internet i TV UPC. W mieszkaniu 3 pokoje dla 4 osób. Cena 650 zł/osobę i opłaty 120 zł/osobę ",
"meta": {
"subject": "roomShare",
"flatMeterage": null,
"roomMeterage": 20,
"rent": 650,
"bills": 120,
"deposit": null,
"internetSpeed": null,
"district": null,
"street": "Sępa-Szarzyńskiego",
"roomsCount": 3,
"flatmatesCount": 3,
"flatmatesGenders": null,
"flatmatesOccupation": null,
"preferredOccupation": null,
"preferredGender": null
}
} | json |
{
"id": 6208,
"citation_title": "Trends in Male Labor Force Participation And Retirement: Some Evidence On The Role Of Pensions And Social Security In The 1970's And 1980's",
"citation_author": [
"<NAME>",
"<NAME>",
"<NAME>"
],
"citation_publication_date": "1997-10-01",
"issue_date": "1997-10-01",
"revision_date": "None",
"topics": [
"Public Economics",
"National Fiscal Issues",
"Labor Economics",
"Demography and Aging"
],
"program": [
"Economics of Aging",
"Labor Studies"
],
"projects": null,
"working_groups": null,
"abstract": "\n\nThis paper estimates the effects on steady state retirement by men of changes in pension\" plans and social security in the 1970's and 1980's. Work incentives associated with pension\" coverage and plan characteristics are calculated primarily from the 1969-79 Retirement History\" Study and the 1983 and 1989 Surveys of Consumer Finances. Simulations with a structural\" retirement model suggest that the long run effects of changes in pension plans and social security\" account for about a quarter of the reduction in full-time work by men in their early sixties none of the trend for those age 65.\n\n",
"acknowledgement": "\n"
} | json |
{
"apiKey": "<any-string-here-you-want-to-use>",
"merchantToken": "<your-merchant-token-from-swedbank>",
"merchantId": "<your-merchant-id-from-swedbank>",
"countryCode": "SE",
"currency": "SEK",
"payexBaseUrl": "https://api.externalintegration.payex.com",
"iosAppIds": [
"<your-team-id>.<your-app-id>"
]
}
| json |
Adam Gilchrist is an expert at both keeping wickets and using his bat to affect the game. While players like Quinton de Kock, Mohammad Rizwan, and Rishabh Pant are having a significant impact today, they still have a long way to go before matching the Australian icon. Gilchrist, along with MS Dhoni, is one of the best wicketkeeper hitters of all time.
One of the main drivers of Australia’s dominance from the late 1990s to the middle of the 2000s was Adam Gilchrist, whose aggressive style of batting and dependable glovework behind the stumps helped pave the way for wicketkeeper batsmen in subsequent generations.
So who better than Adam Gilchrist to give a remedy when India is now dealing with the hotly contested Pant vs. Dinesh Karthik issue? While both Pant and Karthik have been selected for India’s T20 World Cup roster, it appears that only one of them would be able to participate given the side’s batting-heavy lineup.
Recently, there have been a number of toss-ups between Pant and Karthik, with each receiving a chance but neither being able to establish themselves as a starter. However, judging on recent trends, it appears that the management is leaning significantly more in Karthik’s favour. In his opinion, Adam Gilchrist states that he opposes benching Pant regardless of the circumstances.
“The dare of Rishabh Pant and the courage for him, the way in which he takes on bowling attacks. I think he’s got to be a must in that Indian line-up. They can play together, but I think Rishabh Pant has definitely got to be in there,” Gilchrist said told ICC.
Karthik was selected ahead of Pant for India’s opening match of the 2022 Asia Cup against Pakistan. With India rested Hardik Pandya for the following match against Hong Kong, both wicketkeeper hitters participated in the match. After that, Pant played against Sri Lanka before Karthik took his position against Pakistan in the Super 4 round.
He later made another appearance for the match against Afghanistan but was left off the starting lineup for the first T20I at home against Australia because Karthik was preferred by skipper Rohit Sharma.
Pant and Karthik haven’t been able to use the bat very much throughout this musical chair. While Pant has improved in ODIs after already dominating in Tests, the India teenager continues to struggle in T20Is, whereas Karthik has been developed by India to be their finisher in the T20 World Cup.
India does have the option of using both of them in the starting XI, but should the management take the chance? Adam Gilchrist responds.
“It will be interesting to see if they can both play in the same team. I think they can. What they bring to a team...the versatility of Dinesh Karthik, he can play at the top of the order, he can, as he has done more so later in his career, be in the middle and late overs to finish.
He has a really nice touch game,” added the three-time World Cup-winning Australia legend.
| english |
Imagine “a robot couple fine dining with Eiffel Tower in the background”? For us humans, it is pretty simple to picture this in our heads. Of course, the more creative ones among us can easily bring these words to life in their artwork. And now Google’s AI model called Imagen is capable of doing something similar. In a new announcement, Google has showcased how Imagen, which is a text-to-image diffusion model, is able to create images based on written text.
The most remarkable part though is the accuracy and the photorealism seen in the pictures, all of which are created by these models. Google has showcased a number of artworks which were created by Imagen, which accurately depict the sentence in question. For instance, there’s one Android mascot made out of bamboo. Another shows an angry bird. Another shows a chrome-plated duck with a golden beak arguing with an angry turtle in a forest.
However, the company notes that there are limitations to this, including “several ethical challenges facing text-to-image research broadly. ” It admits this could impact “society in complex ways,” and there’s a risk of misuse of such models. This is why it is not releasing the code or a public demo right now.
Google’s blog notes “the data requirements of text-to-image models have led researchers to rely heavily on large, mostly uncurated, web-scraped datasets”. The problem with such datasets is that they often “reflect social stereotypes, oppressive viewpoints, and derogatory, or otherwise harmful, associations to marginalised identity groups,” according to the blog.
The post adds that “a subset of our training data was filtered to remove noise and undesirable content, such as pornographic imagery and toxic language,”. But the dataset Google used, which is the LAION-400M, known to “contain a wide range of inappropriate content including pornographic imagery, racist slurs, and harmful social stereotypes,” notes the company.
Finally, Imagen is still very limited when it comes to generating art that depicts people, and it is mostly giving stereotypical results. It tends to have “social biases and stereotypes, including an overall bias towards generating images of people with lighter skin tones,” states Google. Also, there’s a preference for showcasing Western gender stereotypes when asked to portray different professions. | english |
Television serials have become a part and parcel of our busy lives. Every TV channel strives hard to bring some interesting unique subject to the small screens to woo the viewers. There are several daily soaps that are currently being aired on various Telugu TV channels during primetime, but a few have made it to the list of top five Telugu TV serials with the highest TRP ratings. Continue to see them in the gallery.
Actress Avika Gor's TV serial Chinnari Pellikuthuru is the popular telugu daily serial, which is aired between 7.00 and 7.30 pm on Maa TV. This daily soap has topped the chart with 7 TRP ratings in the 15th week (April 6th to 12th 2014).
Actor Nagababu starrer TV serial Seetamahalakshmi, which is aired on weekdays in Maa TV, has landed in 5.46 TRP Rating in 15th week.
TV serial Eetharam Illalu, which has more than 130 episodes to its credit, has graced the 3rd position with 5.38 TRP rating in 15th week.
Sasiekha Parinayam, which is being aired on MAA TV, landed on the fourth place with 5.21 TRP ratings in 15th week.
Paupu Kumkuma stands in the fifth place with 5.02 TRP rating in 15th week.
| english |
{"data":{"header":{"childImageSharp":{"fluid":{"base64":"data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAHABQDASIAAhEBAxEB/8QAFgABAQEAAAAAAAAAAAAAAAAAAAEF/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAH/2gAMAwEAAhADEAAAAcOiQL//xAAUEAEAAAAAAAAAAAAAAAAAAAAQ/9oACAEBAAEFAn//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAEDAQE/AT//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAECAQE/AT//xAAUEAEAAAAAAAAAAAAAAAAAAAAQ/9oACAEBAAY/An//xAAXEAEAAwAAAAAAAAAAAAAAAAABABAR/9oACAEBAAE/ISJlf//aAAwDAQACAAMAAAAQ/A//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAEDAQE/ED//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAECAQE/ED//xAAWEAEBAQAAAAAAAAAAAAAAAAABEBH/2gAIAQEAAT8QGt3/2Q==","aspectRatio":3.003003003003003,"src":"/static/f55e924eff608d71da37e57b398c587d/7ac0b/blog-cover.jpg","srcSet":"/static/f55e924eff608d71da37e57b398c587d/ca45b/blog-cover.jpg 500w,\n/static/f55e924eff608d71da37e57b398c587d/a0205/blog-cover.jpg 1000w,\n/static/f55e924eff608d71da37e57b398c587d/7ac0b/blog-cover.jpg 2000w","sizes":"(max-width: 2000px) 100vw, 2000px"}}}}} | json |
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "mojo/embedder/platform_channel_utils_posix.h"
#include <sys/socket.h>
#include <sys/uio.h>
#include <unistd.h>
#include "base/logging.h"
#include "base/posix/eintr_wrapper.h"
#include "build/build_config.h"
namespace mojo {
namespace embedder {
// On Linux, |SIGPIPE| is suppressed by passing |MSG_NOSIGNAL| to
// |send()|/|sendmsg()|. (There is no way of suppressing |SIGPIPE| on
// |write()|/|writev().) On Mac, |SIGPIPE| is suppressed by setting the
// |SO_NOSIGPIPE| option on the socket.
//
// Performance notes:
// - On Linux, we have to use |send()|/|sendmsg()| rather than
// |write()|/|writev()| in order to suppress |SIGPIPE|. This is okay, since
// |send()| is (slightly) faster than |write()| (!), while |sendmsg()| is
// quite comparable to |writev()|.
// - On Mac, we may use |write()|/|writev()|. Here, |write()| is considerably
// faster than |send()|, whereas |sendmsg()| is quite comparable to
// |writev()|.
// - On both platforms, an appropriate |sendmsg()|/|writev()| is considerably
// faster than two |send()|s/|write()|s.
// - Relative numbers (minimum real times from 10 runs) for one |write()| of
// 1032 bytes, one |send()| of 1032 bytes, one |writev()| of 32+1000 bytes,
// one |sendmsg()| of 32+1000 bytes, two |write()|s of 32 and 1000 bytes, two
// |send()|s of 32 and 1000 bytes:
// - Linux: 0.81 s, 0.77 s, 0.87 s, 0.89 s, 1.31 s, 1.22 s
// - Mac: 2.21 s, 2.91 s, 2.98 s, 3.08 s, 3.59 s, 4.74 s
// Flags to use with calling |send()| or |sendmsg()| (see above).
#if defined(OS_MACOSX)
const int kSendFlags = 0;
#else
const int kSendFlags = MSG_NOSIGNAL;
#endif
ssize_t PlatformChannelWrite(PlatformHandle h,
const void* bytes,
size_t num_bytes) {
DCHECK(h.is_valid());
DCHECK(bytes);
DCHECK_GT(num_bytes, 0u);
#if defined(OS_MACOSX)
return HANDLE_EINTR(write(h.fd, bytes, num_bytes));
#else
return send(h.fd, bytes, num_bytes, kSendFlags);
#endif
}
ssize_t PlatformChannelWritev(PlatformHandle h,
struct iovec* iov,
size_t num_iov) {
DCHECK(h.is_valid());
DCHECK(iov);
DCHECK_GT(num_iov, 0u);
#if defined(OS_MACOSX)
return HANDLE_EINTR(writev(h.fd, iov, static_cast<int>(num_iov)));
#else
struct msghdr msg = {};
msg.msg_iov = iov;
msg.msg_iovlen = num_iov;
return HANDLE_EINTR(sendmsg(h.fd, &msg, kSendFlags));
#endif
}
ssize_t PlatformChannelSendmsgWithHandles(PlatformHandle h,
struct iovec* iov,
size_t num_iov,
PlatformHandle* platform_handles,
size_t num_platform_handles) {
DCHECK(iov);
DCHECK_GT(num_iov, 0u);
DCHECK(platform_handles);
DCHECK_GT(num_platform_handles, 0u);
DCHECK_LE(num_platform_handles, kPlatformChannelMaxNumHandles);
char cmsg_buf[CMSG_SPACE(kPlatformChannelMaxNumHandles * sizeof(int))];
struct msghdr msg = {};
msg.msg_iov = iov;
msg.msg_iovlen = num_iov;
msg.msg_control = cmsg_buf;
msg.msg_controllen = CMSG_LEN(num_platform_handles * sizeof(int));
struct cmsghdr* cmsg = CMSG_FIRSTHDR(&msg);
cmsg->cmsg_level = SOL_SOCKET;
cmsg->cmsg_type = SCM_RIGHTS;
cmsg->cmsg_len = CMSG_LEN(num_platform_handles * sizeof(int));
for (size_t i = 0; i < num_platform_handles; i++) {
DCHECK(platform_handles[i].is_valid());
reinterpret_cast<int*>(CMSG_DATA(cmsg))[i] = platform_handles[i].fd;
}
return HANDLE_EINTR(sendmsg(h.fd, &msg, kSendFlags));
}
bool PlatformChannelSendHandles(PlatformHandle h,
PlatformHandle* handles,
size_t num_handles) {
DCHECK(handles);
DCHECK_GT(num_handles, 0u);
DCHECK_LE(num_handles, kPlatformChannelMaxNumHandles);
// Note: |sendmsg()| fails on Mac if we don't write at least one character.
struct iovec iov = {const_cast<char*>(""), 1};
char cmsg_buf[CMSG_SPACE(kPlatformChannelMaxNumHandles * sizeof(int))];
struct msghdr msg = {};
msg.msg_iov = &iov;
msg.msg_iovlen = 1;
msg.msg_control = cmsg_buf;
msg.msg_controllen = CMSG_LEN(num_handles * sizeof(int));
struct cmsghdr* cmsg = CMSG_FIRSTHDR(&msg);
cmsg->cmsg_level = SOL_SOCKET;
cmsg->cmsg_type = SCM_RIGHTS;
cmsg->cmsg_len = CMSG_LEN(num_handles * sizeof(int));
for (size_t i = 0; i < num_handles; i++) {
DCHECK(handles[i].is_valid());
reinterpret_cast<int*>(CMSG_DATA(cmsg))[i] = handles[i].fd;
}
ssize_t result = HANDLE_EINTR(sendmsg(h.fd, &msg, kSendFlags));
if (result < 1) {
DCHECK_EQ(result, -1);
return false;
}
for (size_t i = 0; i < num_handles; i++)
handles[i].CloseIfNecessary();
return true;
}
ssize_t PlatformChannelRecvmsg(PlatformHandle h,
void* buf,
size_t num_bytes,
std::deque<PlatformHandle>* platform_handles) {
DCHECK(buf);
DCHECK_GT(num_bytes, 0u);
DCHECK(platform_handles);
struct iovec iov = {buf, num_bytes};
char cmsg_buf[CMSG_SPACE(kPlatformChannelMaxNumHandles * sizeof(int))];
struct msghdr msg = {};
msg.msg_iov = &iov;
msg.msg_iovlen = 1;
msg.msg_control = cmsg_buf;
msg.msg_controllen = sizeof(cmsg_buf);
ssize_t result = HANDLE_EINTR(recvmsg(h.fd, &msg, MSG_DONTWAIT));
if (result < 0)
return result;
// Success; no control messages.
if (msg.msg_controllen == 0)
return result;
DCHECK(!(msg.msg_flags & MSG_CTRUNC));
for (cmsghdr* cmsg = CMSG_FIRSTHDR(&msg); cmsg;
cmsg = CMSG_NXTHDR(&msg, cmsg)) {
if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_RIGHTS) {
size_t payload_length = cmsg->cmsg_len - CMSG_LEN(0);
DCHECK_EQ(payload_length % sizeof(int), 0u);
size_t num_fds = payload_length / sizeof(int);
const int* fds = reinterpret_cast<int*>(CMSG_DATA(cmsg));
for (size_t i = 0; i < num_fds; i++) {
platform_handles->push_back(PlatformHandle(fds[i]));
DCHECK(platform_handles->back().is_valid());
}
}
}
return result;
}
} // namespace embedder
} // namespace mojo
| cpp |
/*
* Copyright 2022 berni3.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.huberb.prototyping.transhuelle;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Stream;
import org.huberb.prototyping.transhuelle.Supports.MapBuilder;
import org.huberb.prototyping.transhuelle.TransHuelle.Data;
import static org.huberb.prototyping.transhuelle.TransHuelle.Data.newSetBuilderVs;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertNotSame;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
/**
*
* @author berni3
*/
public class DataTest {
@ParameterizedTest
@MethodSource("given_an_empty_data")
public void given_an_empty_data_then_verify_it() {
final Data instance = new Data("X");
assertEquals("X", instance.name);
assertEquals(0, instance.groupsInList.size());
assertEquals(0, instance.groupsMergedList.size());
}
static Stream<Data> given_an_empty_data() {
final Stream<Data> result = Stream.of(
new Data("X"),
new Data("Y"),
new Data("X",
new ArrayList<>(),
new ArrayList<>()
),
new Data("X",
Collections.emptyList(),
Collections.emptyList()
),
new Data("X",
new LinkedList<>(),
new LinkedList<>()
)
);
return result;
}
@Test
public void give_data_then_verify_toString_and_toMap() {
final Data instance = new Data("X");
final List<Map<String, Set<String>>> groupsInList = new ArrayList<>();
groupsInList.add(new MapBuilder<String, Set<String>>()
.kv(TransHuelle.Data.kName, newSetBuilderVs("S1"))
.kv(TransHuelle.Data.kGroup, newSetBuilderVs("A1", "A2"))
.build());
groupsInList.add(new MapBuilder<String, Set<String>>()
.kv(TransHuelle.Data.kName, new HashSet<>(Arrays.asList("S2")))
.kv(TransHuelle.Data.kGroup, new HashSet<>(Arrays.asList("A2", "A3")))
.build());
groupsInList.add(new MapBuilder<String, Set<String>>()
.kv(TransHuelle.Data.kName, new HashSet<>(Arrays.asList("S3")))
.kv(TransHuelle.Data.kGroup, new HashSet<>(Arrays.asList("A4")))
.build());
instance.groupsInList.addAll(groupsInList);
//---
final List<Map<String, Set<String>>> groupsMergedList = new ArrayList<>();
groupsInList.add(new MapBuilder<String, Set<String>>()
.kv(TransHuelle.Data.kName, newSetBuilderVs("S1", "S2"))
.kv(TransHuelle.Data.kGroup, newSetBuilderVs("A1", "A2", "A2", "A3"))
.build());
groupsInList.add(new MapBuilder<String, Set<String>>()
.kv(TransHuelle.Data.kName, new HashSet<>(Arrays.asList("S3")))
.kv(TransHuelle.Data.kGroup, new HashSet<>(Arrays.asList("A4")))
.build());
instance.groupsMergedList.addAll(groupsMergedList);
{
final String expectedToString = "Data {\n"
+ "name=X\n"
+ "groupsInList=[{name=[S1], group=[A1, A2]}, {name=[S2], group=[A2, A3]}, {name=[S3], group=[A4]}],\n"
+ "groupsMergedList=[]\n"
+ "}";
assertEquals(cleanWs(expectedToString), cleanWs(instance.toString()));
}
{
final String expectedToMap = "{groupsInList=["
+ "{name=[S1], group=[A1, A2]}, "
+ "{name=[S2], group=[A2, A3]}, "
+ "{name=[S3], group=[A4]}], "
+ "name=X, "
+ "groupsMergedList=[]}";
assertEquals(cleanWs(expectedToMap), cleanWs(instance.toMap().toString()));
}
}
String cleanWs(String s) {
final String cleanWs = s.replaceAll("[ \r\n\t]", "");
return cleanWs;
}
@Test
public void given_some_Data_then_none_are_equals_or_same() {
final Data data1 = new Data("X");
final Data data2 = new Data("X");
assertNotSame(data1, data2);
assertNotEquals(data1, data2);
final Data data3 = new Data("X",
new ArrayList<>(),
new ArrayList<>()
);
assertNotSame(data1, data3);
assertNotEquals(data1, data3);
assertNotSame(data2, data3);
assertNotEquals(data2, data3);
}
}
| java |
Will Smith shook the Oscars last year and took the internet by storm when he slapped Chris Rock live during the ceremony after Rock cracked a joke regarding Jada Pinkett Smith's bald look.
In light of his violent action, the Academy Awards committee announced their decision to bar Smith from attending all Academy events, in-person and virtual, for a period of 10 years.
This will, however, not affect the Focus actor's eligibility for nominations or even winning. Nor was his Oscar, which he received last year for his phenomenal performance in the movie King Richard, taken back by the Academy.
Apart from Will Smith, there are several other well-known faces from Hollywood who have been banned over the years from attending the prestigious annual Oscars for some reason or another.
The Godfather: Part II actor is infamous as the first-ever member of the Academy to be expelled. Caridi was banned from attending the Oscars in 2004 for pirating screeners, which were only intended for members to view for awards voting purposes.
Weinstein was expelled by the Academy in 2017, shortly after a barrage of s*xual assault allegations against him came to light. The Academy condemned the disgraced former film producer and called his actions:
"repugnant, abhorrent, and antithetical to the high standards of the Academy and the creative community it represents. "
Although the producer was allowed to keep his awards, he was banned permanently from the Oscars for his condemnable actions.
In 2018, Bill Cosby was convicted of drugging and s*xually assaulting basketball player Andrea Constand. In light of his actions, the Academy subsequently banned him from attending the coveted award ceremony.
Roman Polanski was expelled around the same time as Cosby by the Academy Awards, although many tagged the act as hollow, since nothing was done against him even after years of s*xual assault allegations kept cropping up against him.
Polanski fled to France in 1977 after pleading guilty of being s*xually involved with a minor. He was wanted by the US authorities so he could not enter America, but at the time, he was nominated for several awards at the Oscars, even winning the 'Best Director' award for The Pianist in 2003.
Cinematographer Adam Kimmel, who is credited for his works, including Lars and the Real Girl and Capote, was expelled from the Academy in 2021, owing to his history as a repeatitive s*x offender.
Kimmel was arrested twice for statutory assaults on minors, following which he was removed from Academy membership for violating its code of conduct.
When will the Oscars 2023 air?
The 95th Academy Awards ceremony is scheduled to be held this Sunday at the Dolby Theatre in Los Angeles, California. The ceremony will be live broadcast from 5 pm on the ABC television network. With an epic lineup, from action-comedy Everything Everywhere All At Once to a war drama like All Quiet on the Western Front, this year's Oscars will be a tough competition for all the nominees across a variety of categories.
Jimmy Kimmel will return as host once again this year and it will mark his thrid time hosting the prestigious award ceremony.
Catch The 95th Academy Award Ceremony this Sunday. | english |
#include "dynet/saxe-init.h"
#include "dynet/tensor.h"
#include "dynet/tensor-eigen.h"
#include "dynet/globals.h"
#include <random>
#include <cstring>
#include <Eigen/SVD>
using namespace std;
namespace dynet {
void orthonormal_random(unsigned dd, float g, Tensor& x) {
Tensor t;
t.d = Dim({dd, dd});
t.v = new float[dd * dd];
normal_distribution<float> distribution(0, 0.01);
auto b = [&] () {return distribution(*rndeng);};
generate(t.v, t.v + dd*dd, b);
Eigen::JacobiSVD<Eigen::MatrixXf> svd(mat(t), Eigen::ComputeFullU);
mat(x) = svd.matrixU();
delete[] t.v;
}
}
| cpp |
Khalistani terrorist Gurpatwant Singh Pannun has released a video in which he said he would attack the Indian Parliament on or before December 13. Notably, December 13 will mark the 22nd anniversary of the Parliament attack by terrorists in 2001. Security agencies here are on high alert after Pannun's threat video surfaced.
Referring to the US Justice Department indictment of an Indian national in an alleged foiled assassination plot in the US, Kirby added, "At the same time, we take this very seriously. These allegations and this investigation, we take very seriously." He further said that we are glad to see that India is also taking it seriously by announcing their "own efforts to investigate this."
The unsealing of the indictment follows recent sharing of information by the US on a nexus between organised criminals, gun runners and terrorists. India has since formed a high-level inquiry committee to address the security concerns highlighted by the US government. The Ministry of External Affairs said that India takes such inputs seriously since they impinge on national security interests as well, and relevant departments were already examining the issue.
Prosecutors did not name the Indian official or the target, although they did describe the latter as a U.S. citizen of Indian origin and U.S. officials have named him as Gurpatwant Singh Pannun, a dual citizen of the United States and Canada. Gupta was arrested by Czech authorities in June and is awaiting extradition. He could not be reached for comment.
India has expressed serious concern over the US authorities' charges against an Indian citizen, Nikhil Gupta, accused of plotting to assassinate Khalistani separatist leader Gurpatwant Singh Pannun. Gupta, alleged to have murder-for-hire and conspiracy charges, was recruited by an unidentified Indian government official, US has alleged. The Ministry stated that a high-level inquiry committee had been formed, emphasizing the seriousness of the matter for law enforcement agencies.
Revealing details of the plot, the indictment said beginning in or about early May 2023, in a series of telephonic and electronic communications between the Indian official CC-1 and Gupta over encrypted applications, CC-1 asked Gupta to arrange the murder of the victim in exchange for CC-1 's assistance in securing the dismissal of a criminal case. Gupta, it said, agreed to orchestrate the assassination. In addition to their electronic communications, Gupta also met CC-1 in-person in New Delhi in furtherance of the plot, it alleged.
"The defendant conspired from India to assassinate, right here in New York City, a U.S. citizen of Indian origin who has publicly advocated for the establishment of a sovereign state for Sikhs," Damian Williams, the top federal prosecutor in Manhattan, said in a statement.
Canadian Prime Minister Justin Trudeau extended his wishes to the Hindu community on the occasion of Navratri, softening his tone after claiming Indian agents were behind the killing of Sikh separatist leader Hardeep Singh Nijjar. Trudeau stated that Navratri offers an opportunity to learn about the rich history and culture of Hindu communities and recognize their contributions to Canada.
Worsfold found the government went well too far in its assessment of Ram's support for the armed militants at the time, namely omitting to note that he repeatedly said he accepted to host the armed individuals because he "feared the consequences" of being on the wrong end of the group.
According to the Peel Regional Police, on the night of October 2, it received reports of shots fired in the area of Donald Stewart Road and Brisdale Drive in Brampton. "With the assistance of the Tactical Unit, eight individuals were extracted from the residence and arrested," a press release from Peel Regional Police said on Wednesday.
A man has been arrested by Scotland Yard on suspicion of "violent disorder" in connection with an attack on the Indian High Commission in London. The arrest was made during a protest outside India House on Monday. The man has been released on bail pending further investigations.
The Glasgow Gurdwara Guru Granth Sahib Sikh Sabha has strongly condemned the incident where the Indian High Commissioner to the UK, Vikram Doraiswami, was stopped from attending an event at the religious site. The Gurdwara stated that the incident was caused by unknown individuals from outside the Glasgow area and described it as disorderly behavior. They emphasized that the Gurdwara is open to people from all communities and backgrounds. The Scotland Police is currently investigating the matter.
According to officials in the know, the meeting at the gurdwara had been organised as part of the events at the request of the gurdwara committee to meet Sikh groups and address their concerns over consular and other matters. Sources said the unnecessary altercation by a few outsiders and radical elements interrupted an interaction and community engagement planned by a majority of peace-loving Sikhs in the city.
Over the years, Khalistani extremists were further "emboldened" and started "operating with impunity" from Canada. In the last decade, links of Canada-based Khalistani extremists have emerged in more than half of the terror cases reported from Punjab, according to the sources. The multiple targeted killings of Sikhs, Hindus and Christians in Punjab after 2016 were the handiwork of Khalistani separatist Hardeep Singh Nijjar, whose killing has led to a row between India and Canada.
Prominent Indian-American businessman Sant Singh Chatwal stated that over 99% of the Sikhs love India and only a small number support Khalistan. He emphasized that those talking about Khalistan have never been to Punjab and are a minority. Chatwal praised Prime Minister Narendra Modi's leadership and the steps taken for the Sikh community, including the opening of the Kartarpur Corridor. He also mentioned that Sikhs hold prominent positions in India, serving as ministers and ambassadors.
Pro-Khalistan elements in Canada are reportedly sponsoring visas for Sikh youth from Punjab, luring them with promises of jobs and support. These youth are then used to carry out pro-Khalistan activities, such as participating in anti-India protests and conducting radical-religious congregations.
Jagmeet Singh has been alleged to influence Trudeau's pro-Khalistan politics and the Trudeau-Jagmeet alliance has engaged in vote bank politics amid the Canadian PM's rising unpopularity. India had engaged with certain countries, including Russia, on Jagmeet Singh's pro-extremist ideologies. Russia has banned Jagmeet's entry into its territory based on inputs provided by New Delhi, ET has learnt.
Canadian Prime Minister Justin Trudeau's accusation that India may have been involved in the assassination of a Sikh separatist leader has sparked debate about Sikh activism in the diaspora. Canada is home to the largest Sikh population outside India, with about 800,000 Sikhs. While some argue for an independent Sikh state called Khalistan, others disagree. The accusation has strained relations between India and Canada, with India stopping visa issuance to Canadian citizens and reducing diplomatic staff.
The allegation that India was involved in the assassination of a Sikh separatist leader in Canada has reignited tensions within the Indian diaspora in Canada. The country, which is home to the largest Sikh population outside of India, is now facing challenges as it investigates the killing. The relationship between extremists on both sides threatens to escalate into violence, prompting Canada to recognize the need to rein in extreme actions. Tensions have already intensified, with protests and provocative actions from both sides.
Hindu families in Canada are feeling threatened after receiving threats from a US-based Sikh extremist. The extremist has called on Hindus to leave Canada, alleging their failure to condemn the killing of a Khalistan Tiger Force chief. Traditionally, Punjabi Sikhs have been the main group migrating to Canada, but in recent years, Hindu families and students have also been joining. Hindu families are concerned about the situation and hope that the Canadian government will intervene to ensure their safety.
Canadian MP Chandra Arya has accused extremist elements of attacking and threatening Hindu-Canadians to go back to India. He has urged Hindu-Canadians to stay calm, vigilant, and report any incidents to law enforcement agencies. Arya also clarified that the majority of Canadian Sikhs do not support the Khalistan movement and that the Hindu and Sikh communities in Canada are deeply connected. He expressed concern over the recent attacks on Hindu temples and the glorification of terrorism and hate crimes in the name of freedom of expression.
British Sikh MPs Preet Kaur Gill and Tanmanjeet Singh Dhesi have expressed concern over Canadian Prime Minister Justin Trudeau's allegations of Indian involvement in the murder of a Sikh separatist leader. The Labour MPs, who represent Sikh-heavy constituencies in England, have reached out to their constituents and are raising their concerns with government ministers.
The Justin Trudeau government has faced criticism for yielding to pressure from Sikh extremist groups and failing to take action against them. The presence of Jagmeet Singh, leader of the New Democratic Party, in Trudeau's coalition has worsened the situation. Observers note that Trudeau's declining popularity has influenced his decision to cater to the Khalistani extremist vote bank.
India has summoned the Canadian High Commissioner in New Delhi over propaganda material that includes threats to Indian diplomats circulated in Canada. The material contains information about a pro-Khalistan rally scheduled for July 8th that threatens Indian Ambassador to Canada and the Consulate General in Toronto.
Indian authorities stalled trade negotiations with the UK for trade facilitations, accusing Britain of failing to condemn a Sikh extremist group that attacked the Indian high commission in London last month, British daily The Times reported. India had registered a strong protest with the UK government and the issue was also raised in the House of Commons.
In the last few months, the Indian Australian community has been targeted by the USA and Canada-based Khalistan separatist groups that vandalised or threatened five Hindu temples in Melbourne and Brisbane. These overseas actors have also been trying to recruit Australian Indian youths for their divisive agenda, sources said.
| english |
<reponame>eomo/moon-blog<filename>src/main/java/cn/moondev/blog/controller/api/ArticleController.java
package cn.moondev.blog.controller.api;
import cn.moondev.blog.dto.QueryDTO;
import cn.moondev.blog.model.Article;
import cn.moondev.blog.service.ArticleService;
import cn.moondev.framework.annotation.Permit;
import cn.moondev.framework.model.PaginationDTO;
import cn.moondev.framework.model.ResponseDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/v1/article")
public class ArticleController {
@Autowired
private ArticleService service;
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
public ResponseDTO<Article> page(@PathVariable String id) {
Article article = new Article();
if (!"id_NuLlaRtIclE".equalsIgnoreCase(id)) {
article = service.detail4Admin(id);
}
return ResponseDTO.success(article);
}
@Permit
@RequestMapping(value = "/font/page", method = RequestMethod.POST)
public ResponseDTO<PaginationDTO<Article>> page(@RequestBody QueryDTO query) {
query.point = "font";
return ResponseDTO.success(service.page(query));
}
@RequestMapping(value = "/back/page", method = RequestMethod.POST)
public ResponseDTO<PaginationDTO<Article>> backPage(@RequestBody QueryDTO query) {
query.point = "back";
return ResponseDTO.success(service.page(query));
}
@Permit
@RequestMapping(value = "/badge/page", method = RequestMethod.POST)
public ResponseDTO<PaginationDTO<Article>> badgePage(@RequestBody QueryDTO query) {
query.point = "badge";
return ResponseDTO.success(service.page(query));
}
/**
* 保存草稿
*/
@RequestMapping(value = "/draft", method = RequestMethod.POST)
public ResponseDTO<String> draft(@RequestBody Article article) {
return ResponseDTO.success(service.draft(article));
}
/**
* 发布文章
*/
@RequestMapping(value = "/publish", method = RequestMethod.POST)
public ResponseDTO<String> publish(@RequestBody Article article) {
return ResponseDTO.success(service.publish(article));
}
/**
* 删除文章
*/
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
public ResponseDTO<Void> delete(@PathVariable String id) {
service.delete(id);
return ResponseDTO.success();
}
/**
* 保存特殊文章
*/
@RequestMapping(value = "/badge", method = RequestMethod.POST)
public ResponseDTO<String> publishBadgeArticle(@RequestBody Article article) {
return ResponseDTO.success(service.publishBadgeArticle(article));
}
/**
* 特殊文章
*/
@RequestMapping(value = "/badge/{badge}", method = RequestMethod.GET)
public ResponseDTO<Article> publishBadgeArticle(@PathVariable String badge) {
return ResponseDTO.success(service.findByBadge(badge));
}
/**
* 控制文章显隐
*/
@RequestMapping(value = "/show/{id}/{show}", method = RequestMethod.POST)
public ResponseDTO<Void> hideOrShow(@PathVariable String id, @PathVariable int show) {
service.updateShowFlag(id, show);
return ResponseDTO.success();
}
}
| java |
9 Wal YAWEI bin dalim Mosis, 10 “Yu garra dalim ola Isreil pipul wen yumob krosoba det Jodan Riba en go langa det kantri gulum Keinan, 11 yu garra pikimat 6 seifwan taun, en if enibodi kilim sambodi ded wen im nomo bin wandim kilim im, wal im lafta go langa det seifwan taun. 12 En deya na im garra jidan seifwan brom det ded men rileishan hu wandi kilim im ded. Det men hu dei reken im gilti, nobodi kaan kilim im, dumaji dei garra kotim im basdam. 13 Yu garra pikimat 6 seifwan taun, 14 thribala sanrais said langa det Jodan Riba, en thribala langa det kantri gulum Keinan. 15 Dislot garra jidan seifwan taun blanga detlot Isreil pipul blanga blandimbat miselp, en blanga detlot streinja pipul du hu jidan deya lilbit taim, o longtaim. Enibodi hu kilim sambodi ded, en if im nomo bin wandim kilim im, wal im gin ranawei en jidan langa det seifwan taun na.
16-18 “Bat if det men im yusum enijing weya deibin meigim brom aiyan, ston, o wadi blanga kilim sambodi, wal im brabli gilti dumaji imbin olredi kilim sambodi, wal im garra lafta dai. 19 Det ded men gulijapwan rileishan, im na bos blanga meigim det medra dai. Wen im faindim im, wal im garra kilim im ded.
20 “If wan men nomo laigim sambodi en kilim im ded dumaji imbin pushumdan im, o tjakambat samting langa im, 21 o kilim im ded garram im bingga, im gilti dumaji imbin kilim ded, wal im garra lafta dai. Det ded men gulijapwan rileishan, im na bos blanga meigim det medra dai. Wen im faindim im wal im garra kilim im ded.
22 “Bat maitbi sambodi bin kilim sambodi ded, en im nomo bin heidim im, en im nomo bin min blanga kilim im wen imbin pushumdan im, o tjakambat samting langa im. 23 O maitbi im nomo bin luk weya imbin tjakam ston, en imbin kilim sambodi ded en im nomo bin wandim kilim im en im nomo bin im enami. 24 Langa detkain trabul det komyuniti garra kotim det men hubin kilim sambodi ded, en dei garra sodimat det trabul. 25 Det komyuniti garra album det men hubin kilim det sambodi wen im nomo bin wandim kilim im, en dei garra album im gidawei brom det ded men rileishan, en dei garra deigim im langa det seifwan taun weya nobodi kaan ardim im. Im garra jidan deya raidap det haibala serramonimen dai. 26 If det men libum det seifwan taun weya im oldei jidanbat, 27 wal if det ded men rileishan faindim im, wal im garram det rait blanga kilim im ded. 28 Enibodi hu jidan giltiwan garra go en jidan langa det seifwan taun raidap det haibala serramonimen dai. Bambai na im gin gobek langa im ronwan taun.✡ Dyud 19:2-4; Josh 20:1-9 29 Dijan lowa ai gibit langa yumob en langa yumob bigininimob nomeda weya olabat jidan.
30 “Wal if det men medrim sambodi en olabat faindim im gilti en wandi kilim im, dei garra abum dubala o thribala witnis. Det wanbala witnis nomo naf blanga pruf im gilti.✡ Dyud 17:6; 19:15 31 Det medra garra dai. Im kaan go fri nomeda im peiyim mani. 32 If imbin ranawei langa seifwan taun weya imbin blandim miselp, nomo larram im pei eni mani blanga gobek langa im kemp bifo det haibala serramonimen dai. 33 If yu dum lagijat yu garra meigim det kantri nogud weya yu jidan. Det medra meigim det kantri nogud. Oni wanwei yu gin meigim det kantri klinbala igin. Det men hubin medrim det sambodi, im garra dai. Tharran na garra meigim det kantri klinbala. 34 Nomo meigim det kantri nogudbala wen yu jidanbat deya, dumaji mi na YAWEI det trubala God, en ai jidan garram ol yumob Isreil pipul.” Lagijat na YAWEI bin tok.
| english |
{"pos":"v","translits":{"han·ne·ḥĕ·šā·lîm":{"deu.25.18|5":["all","the stragglers","at your rear"]}},"meanings":{"straggler":1},"meaningsCount":1,"occurences":1} | json |
/*
* Copyright 2021 The gRPC Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.grpc.util;
import io.grpc.ExperimentalApi;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.Socket;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.net.ssl.SSLEngine;
import javax.net.ssl.SSLParameters;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.TrustManager;
import javax.net.ssl.TrustManagerFactory;
import javax.net.ssl.X509ExtendedTrustManager;
import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
/**
* AdvancedTlsX509TrustManager is an {@code X509ExtendedTrustManager} that allows users to configure
* advanced TLS features, such as root certificate reloading, peer cert custom verification, etc.
* For Android users: this class is only supported in API level 24 and above.
*/
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/8024")
@IgnoreJRERequirement
public final class AdvancedTlsX509TrustManager extends X509ExtendedTrustManager {
private static final Logger log = Logger.getLogger(AdvancedTlsX509TrustManager.class.getName());
private final Verification verification;
private final SslSocketAndEnginePeerVerifier socketAndEnginePeerVerifier;
// The delegated trust manager used to perform traditional certificate verification.
private volatile X509ExtendedTrustManager delegateManager = null;
private AdvancedTlsX509TrustManager(Verification verification,
SslSocketAndEnginePeerVerifier socketAndEnginePeerVerifier) throws CertificateException {
this.verification = verification;
this.socketAndEnginePeerVerifier = socketAndEnginePeerVerifier;
}
@Override
public void checkClientTrusted(X509Certificate[] chain, String authType)
throws CertificateException {
throw new CertificateException(
"Not enough information to validate peer. SSLEngine or Socket required.");
}
@Override
public void checkClientTrusted(X509Certificate[] chain, String authType, Socket socket)
throws CertificateException {
checkTrusted(chain, authType, null, socket, false);
}
@Override
public void checkClientTrusted(X509Certificate[] chain, String authType, SSLEngine engine)
throws CertificateException {
checkTrusted(chain, authType, engine, null, false);
}
@Override
public void checkServerTrusted(X509Certificate[] chain, String authType, SSLEngine engine)
throws CertificateException {
checkTrusted(chain, authType, engine, null, true);
}
@Override
public void checkServerTrusted(X509Certificate[] chain, String authType)
throws CertificateException {
throw new CertificateException(
"Not enough information to validate peer. SSLEngine or Socket required.");
}
@Override
public void checkServerTrusted(X509Certificate[] chain, String authType, Socket socket)
throws CertificateException {
checkTrusted(chain, authType, null, socket, true);
}
@Override
public X509Certificate[] getAcceptedIssuers() {
if (this.delegateManager == null) {
return new X509Certificate[0];
}
return this.delegateManager.getAcceptedIssuers();
}
/**
* Uses the default trust certificates stored on user's local system.
* After this is used, functions that will provide new credential
* data(e.g. updateTrustCredentials(), updateTrustCredentialsFromFile()) should not be called.
*/
public void useSystemDefaultTrustCerts() throws CertificateException, KeyStoreException,
NoSuchAlgorithmException {
// Passing a null value of KeyStore would make {@code TrustManagerFactory} attempt to use
// system-default trust CA certs.
this.delegateManager = createDelegateTrustManager(null);
}
/**
* Updates the current cached trust certificates as well as the key store.
*
* @param trustCerts the trust certificates that are going to be used
*/
public void updateTrustCredentials(X509Certificate[] trustCerts) throws CertificateException,
KeyStoreException, NoSuchAlgorithmException, IOException {
KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
keyStore.load(null, null);
int i = 1;
for (X509Certificate cert: trustCerts) {
String alias = Integer.toString(i);
keyStore.setCertificateEntry(alias, cert);
i++;
}
X509ExtendedTrustManager newDelegateManager = createDelegateTrustManager(keyStore);
this.delegateManager = newDelegateManager;
}
private static X509ExtendedTrustManager createDelegateTrustManager(KeyStore keyStore)
throws CertificateException, KeyStoreException, NoSuchAlgorithmException {
TrustManagerFactory tmf = TrustManagerFactory.getInstance(
TrustManagerFactory.getDefaultAlgorithm());
tmf.init(keyStore);
X509ExtendedTrustManager delegateManager = null;
TrustManager[] tms = tmf.getTrustManagers();
// Iterate over the returned trust managers, looking for an instance of X509TrustManager.
// If found, use that as the delegate trust manager.
for (int j = 0; j < tms.length; j++) {
if (tms[j] instanceof X509ExtendedTrustManager) {
delegateManager = (X509ExtendedTrustManager) tms[j];
break;
}
}
if (delegateManager == null) {
throw new CertificateException(
"Failed to find X509ExtendedTrustManager with default TrustManager algorithm "
+ TrustManagerFactory.getDefaultAlgorithm());
}
return delegateManager;
}
private void checkTrusted(X509Certificate[] chain, String authType, SSLEngine sslEngine,
Socket socket, boolean checkingServer) throws CertificateException {
if (chain == null || chain.length == 0) {
throw new IllegalArgumentException(
"Want certificate verification but got null or empty certificates");
}
if (sslEngine == null && socket == null) {
throw new CertificateException(
"Not enough information to validate peer. SSLEngine or Socket required.");
}
if (this.verification != Verification.INSECURELY_SKIP_ALL_VERIFICATION) {
X509ExtendedTrustManager currentDelegateManager = this.delegateManager;
if (currentDelegateManager == null) {
throw new CertificateException("No trust roots configured");
}
if (checkingServer) {
String algorithm = this.verification == Verification.CERTIFICATE_AND_HOST_NAME_VERIFICATION
? "HTTPS" : "";
if (sslEngine != null) {
SSLParameters sslParams = sslEngine.getSSLParameters();
sslParams.setEndpointIdentificationAlgorithm(algorithm);
sslEngine.setSSLParameters(sslParams);
currentDelegateManager.checkServerTrusted(chain, authType, sslEngine);
} else {
if (!(socket instanceof SSLSocket)) {
throw new CertificateException("socket is not a type of SSLSocket");
}
SSLSocket sslSocket = (SSLSocket)socket;
SSLParameters sslParams = sslSocket.getSSLParameters();
sslParams.setEndpointIdentificationAlgorithm(algorithm);
sslSocket.setSSLParameters(sslParams);
currentDelegateManager.checkServerTrusted(chain, authType, sslSocket);
}
} else {
currentDelegateManager.checkClientTrusted(chain, authType, sslEngine);
}
}
// Perform the additional peer cert check.
if (socketAndEnginePeerVerifier != null) {
if (sslEngine != null) {
socketAndEnginePeerVerifier.verifyPeerCertificate(chain, authType, sslEngine);
} else {
socketAndEnginePeerVerifier.verifyPeerCertificate(chain, authType, socket);
}
}
}
/**
* Schedules a {@code ScheduledExecutorService} to read trust certificates from a local file path
* periodically, and update the cached trust certs if there is an update.
*
* @param trustCertFile the file on disk holding the trust certificates
* @param period the period between successive read-and-update executions
* @param unit the time unit of the initialDelay and period parameters
* @param executor the execute service we use to read and update the credentials
* @return an object that caller should close when the file refreshes are not needed
*/
public Closeable updateTrustCredentialsFromFile(File trustCertFile, long period, TimeUnit unit,
ScheduledExecutorService executor) {
final ScheduledFuture<?> future =
executor.scheduleWithFixedDelay(
new LoadFilePathExecution(trustCertFile), 0, period, unit);
return new Closeable() {
@Override public void close() {
future.cancel(false);
}
};
}
private class LoadFilePathExecution implements Runnable {
File file;
long currentTime;
public LoadFilePathExecution(File file) {
this.file = file;
this.currentTime = 0;
}
@Override
public void run() {
try {
this.currentTime = readAndUpdate(this.file, this.currentTime);
} catch (CertificateException | IOException | KeyStoreException
| NoSuchAlgorithmException e) {
log.log(Level.SEVERE, "Failed refreshing trust CAs from file. Using previous CAs", e);
}
}
}
/**
* Reads the trust certificates specified in the path location, and update the key store if the
* modified time has changed since last read.
*
* @param trustCertFile the file on disk holding the trust certificates
* @param oldTime the time when the trust file is modified during last execution
* @return oldTime if failed or the modified time is not changed, otherwise the new modified time
*/
private long readAndUpdate(File trustCertFile, long oldTime)
throws CertificateException, IOException, KeyStoreException, NoSuchAlgorithmException {
long newTime = trustCertFile.lastModified();
if (newTime == oldTime) {
return oldTime;
}
FileInputStream inputStream = new FileInputStream(trustCertFile);
try {
X509Certificate[] certificates = CertificateUtils.getX509Certificates(inputStream);
updateTrustCredentials(certificates);
return newTime;
} finally {
inputStream.close();
}
}
// Mainly used to avoid throwing IO Exceptions in java.io.Closeable.
public interface Closeable extends java.io.Closeable {
@Override public void close();
}
public static Builder newBuilder() {
return new Builder();
}
// The verification mode when authenticating the peer certificate.
public enum Verification {
// This is the DEFAULT and RECOMMENDED mode for most applications.
// Setting this on the client side will do the certificate and hostname verification, while
// setting this on the server side will only do the certificate verification.
CERTIFICATE_AND_HOST_NAME_VERIFICATION,
// This SHOULD be chosen only when you know what the implication this will bring, and have a
// basic understanding about TLS.
// It SHOULD be accompanied with proper additional peer identity checks set through
// {@code PeerVerifier}(nit: why this @code not working?). Failing to do so will leave
// applications to MITM attack.
// Also note that this will only take effect if the underlying SDK implementation invokes
// checkClientTrusted/checkServerTrusted with the {@code SSLEngine} parameter while doing
// verification.
// Setting this on either side will only do the certificate verification.
CERTIFICATE_ONLY_VERIFICATION,
// Setting is very DANGEROUS. Please try to avoid this in a real production environment, unless
// you are a super advanced user intended to re-implement the whole verification logic on your
// own. A secure verification might include:
// 1. proper verification on the peer certificate chain
// 2. proper checks on the identity of the peer certificate
INSECURELY_SKIP_ALL_VERIFICATION,
}
// Additional custom peer verification check.
// It will be used when checkClientTrusted/checkServerTrusted is called with the {@code Socket} or
// the {@code SSLEngine} parameter.
public interface SslSocketAndEnginePeerVerifier {
/**
* Verifies the peer certificate chain. For more information, please refer to
* {@code X509ExtendedTrustManager}.
*
* @param peerCertChain the certificate chain sent from the peer
* @param authType the key exchange algorithm used, e.g. "RSA", "DHE_DSS", etc
* @param socket the socket used for this connection. This parameter can be null, which
* indicates that implementations need not check the ssl parameters
*/
void verifyPeerCertificate(X509Certificate[] peerCertChain, String authType, Socket socket)
throws CertificateException;
/**
* Verifies the peer certificate chain. For more information, please refer to
* {@code X509ExtendedTrustManager}.
*
* @param peerCertChain the certificate chain sent from the peer
* @param authType the key exchange algorithm used, e.g. "RSA", "DHE_DSS", etc
* @param engine the engine used for this connection. This parameter can be null, which
* indicates that implementations need not check the ssl parameters
*/
void verifyPeerCertificate(X509Certificate[] peerCertChain, String authType, SSLEngine engine)
throws CertificateException;
}
public static final class Builder {
private Verification verification = Verification.CERTIFICATE_AND_HOST_NAME_VERIFICATION;
private SslSocketAndEnginePeerVerifier socketAndEnginePeerVerifier;
private Builder() {}
public Builder setVerification(Verification verification) {
this.verification = verification;
return this;
}
public Builder setSslSocketAndEnginePeerVerifier(SslSocketAndEnginePeerVerifier verifier) {
this.socketAndEnginePeerVerifier = verifier;
return this;
}
public AdvancedTlsX509TrustManager build() throws CertificateException {
return new AdvancedTlsX509TrustManager(this.verification, this.socketAndEnginePeerVerifier);
}
}
}
| java |
<filename>SBaaS_base/sbaas_base_o.py
from .sbaas_base import sbaas_base
from .sbaas_base_query_select import sbaas_base_query_select
# resources
from io_utilities.base_exportData import base_exportData
from ddt_python.ddt_container_table import ddt_container_table
from ddt_python.ddt_container_SQL import ddt_container_SQL
class sbaas_base_o(sbaas_base
):
def export_rows_sqlalchemyModel_csv(self,
table_model_I,
query_I,
filename_O,
):
'''export rows of model_I to filename_O
INPUT:
table_model_I = {tablename:sqlalchemy model object,...}
query_I = dictionary of query parameters
OUTPUT:
filename_O = .csv file name/location
'''
data = [];
queryselect = sbaas_base_query_select(session_I=self.session,engine_I=self.engine,settings_I=self.settings,data_I=self.data);
query = queryselect.make_queryFromString(table_model_I,query_I);
data = queryselect.get_rows_sqlalchemyModel(
query_I=query,
output_O='listDict',
dictColumn_I=None,
verbose_I = False);
if data:
# write data to file
export = base_exportData(data);
export.write_dict2csv(filename_O);
else:
print('rows not found.');
def export_rows_sqlalchemyModel_table_js(self,
table_model_I,
query_I,
data_dir_I,
tabletype='responsivecrosstable_01',
data1_keys=None,
data1_nestkeys=None,
data1_keymap=None,
tabletileheader=None,
tablefilters=None,
tableheaders=None
):
'''export rows of model_I to filename_O
INPUT:
table_model_I = {tablename:sqlalchemy model object,...}
query_dict_I = dictionary of query parameters
data_dir_I = .js file name/location
if data_dir_I == 'tmp'
the .js file will be written the 'visualization/tmp' direction specified in the settings
data_dir_I == 'data_json'
the .js string will be returned
all other cases will be written to the .js file name/location specified
OPTIONAL INPUT to ddt_python:
'''
# query the data
data = [];
queryselect = sbaas_base_query_select(session_I=self.session,engine_I=self.engine,settings_I=self.settings,data_I=self.data);
query = queryselect.make_queryFromString(table_model_I,query_I);
data = queryselect.get_rows_sqlalchemyModel(
query_I=query,
output_O='listDict',
dictColumn_I=None,
verbose_I = False);
# dump chart parameters to a js files
if data1_keys is None or not data1_keys:
data1_keys=[];
for model in table_model_I.values():
data1_keys.extend(queryselect.get_columns_sqlalchemyModel(model));
if data1_nestkeys is None or not data1_nestkeys:
data1_nestkeys = data1_keys[0];
if data1_keymap is None or not data1_keymap:
data1_keymap = {};
if tabletileheader is None or not tabletileheader:
tabletileheader = '';
for model in table_model_I.values():
tabletileheader += queryselect.get_tableName_sqlalchemyModel(model);
tabletileheader += ' and ';
tabletileheader = tabletileheader[:-5];
ddttable = ddt_container_table()
ddttable.make_container_table(
data,
data1_keys,
data1_nestkeys,
data1_keymap,
tabletype=tabletype,
tabletileheader=tabletileheader,
tableheaders=tableheaders,
tablefilters=tablefilters,
);
if data_dir_I=='tmp':
filename_str = self.settings['visualization_data'] + '/tmp/ddt_data.js';
elif data_dir_I=='data_json':
data_json_O = ddttable.get_allObjects_js();
return data_json_O;
else:
filename_str = data_dir_I;
with open(filename_str,'w') as file:
file.write(ddttable.get_allObjects());
def export_rows_sqlalchemyModel_queryForm_js(self,
table_model_I,
query_I,
data_dir_I,
tabletype='responsivecrosstable_01',
data1_keys=None,
data1_nestkeys=None,
data1_keymap=None,
tabletileheader=None,
tablefilters=None,
tableheaders=None
):
'''export rows of model_I to filename_O
INPUT:
table_model_I = {tablename:sqlalchemy model object,...}
query_dict_I = dictionary of query parameters
data_dir_I = .js file name/location
if data_dir_I == 'tmp'
the .js file will be written the 'visualization/tmp' direction specified in the settings
data_dir_I == 'data_json'
the .js string will be returned
all other cases will be written to the .js file name/location specified
OPTIONAL INPUT to ddt_python:
'''
# query the data
data = [];
queryselect = sbaas_base_query_select(session_I=self.session,engine_I=self.engine,settings_I=self.settings,data_I=self.data);
query = queryselect.make_queryFromString(table_model_I,query_I);
try:
data = queryselect.get_rows_sqlalchemyModel(
query_I=query,
output_O='listDict',
dictColumn_I=None,
verbose_I = False,
raise_I = True);
alert=None;
except Exception as e:
alert=str(e);
# dump chart parameters to a js files
if data1_keys is None or not data1_keys:
if data:
data1_keys=list(data[0].keys());
else:
data1_keys=[];
for model in table_model_I.values():
data1_keys.extend(queryselect.get_columns_sqlalchemyModel(model));
if data1_nestkeys is None or not data1_nestkeys:
if data:
data1_nestkeys = [list(data[0].keys())[0]];
else:
data1_nestkeys = [queryselect.get_columns_sqlalchemyModel(list(table_model_I.values())[0])[0]];
if data1_keymap is None or not data1_keymap:
data1_keymap = {};
if tabletileheader is None or not tabletileheader:
tabletileheader = '';
for model in table_model_I.values():
tabletileheader += queryselect.get_tableName_sqlalchemyModel(model);
tabletileheader += ' and ';
tabletileheader = tabletileheader[:-5];
#TODO:
#refactor into a form menu
#---
from_cmd = '';
for model in table_model_I.values():
from_cmd += '"' + queryselect.get_tableName_sqlalchemyModel(model) + '"';
from_cmd += ", ";
from_cmd = from_cmd[:-2];
#---
querytable = ddt_container_SQL();
#TODO:
#refactor into a form menu
#---
select_cmd,where_cmd,group_by_cmd,having_cmd,order_by_cmd,limit_cmd,offset_cmd = queryselect.make_querySelectClauses(query_I);
select_str,from_str,where_str,group_by_str,having_str,order_by_str,limit_str,offset_str = queryselect.convert_querySelectClauses2str(select_cmd,where_cmd,group_by_cmd,having_cmd,order_by_cmd,limit_cmd,offset_cmd);
data_select_I = [
{
#'SELECT':data1_keys,
'SELECT':select_str,
#'FROM':from_cmd,
'FROM':from_str,
'WHERE':where_str,
'GROUP_BY':group_by_str,
'HAVING':having_str,
'ORDER_BY':order_by_str,
'LIMIT':limit_str,
'OFFSET':offset_str,
}];
querytable.make_container_querySelectForm(
data_1=data_select_I,
rowcnt=1,colcnt=1,datacnt=0,
htmlalert=alert,
formurl='pipeline',
);
#---
# check for double quotes in the from_string
if from_str[0] == '"': table_name = eval(from_str);
else: table_name = from_str;
querytable.make_container_queryInsertUpdateDeleteForm(
tablename = table_name,
data_2=data,
data2_keys=data1_keys,
data2_nestkeys=data1_nestkeys,
data2_keymap=data1_keymap,
rowcnt=1,colcnt=2,datacnt=1,
formurl='pipeline',
);
querytable.make_container_table(
data,
data1_keys,
data1_nestkeys,
data1_keymap,
tabletype=tabletype,
tabletileheader=tabletileheader,
tableheaders=tableheaders,
tablefilters=tablefilters,
rowcnt=2,colcnt=1,
datacnt=2);
return querytable.get_allObjects_js();
if data_dir_I=='tmp':
filename_str = self.settings['visualization_data'] + '/tmp/ddt_data.js';
elif data_dir_I=='data_json':
data_json_O = ddttable.get_allObjects_js();
return data_json_O;
else:
filename_str = data_dir_I;
with open(filename_str,'w') as file:
file.write(ddttable.get_allObjects());
| python |
{"end_device_ids": {"device_id": "weather-station-prototype-02-otaa", "application_ids": {"application_id": "living-lab"}, "dev_eui": "0004A30B00ECBE59", "join_eui": "0000000000000000", "dev_addr": "260B7CC9"}, "correlation_ids": ["as:up:01F628ZWJTWAGG505ZMTF8KE06", "ns:uplink:01F628ZWCAZ0Z490NX5RDBAV3P", "pba:conn:up:01F4S0EZVXS88GJ8THJ3HZ2ZE2", "pba:uplink:01F628ZWAGQVPRYAVYR3QWX16M", "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01F628ZWCAMYRC49779KECH3AS", "rpc:/ttn.lorawan.v3.NsAs/HandleUplink:01F628ZWJSZYD2BKXKM01V587Z"], "received_at": "2021-05-19T12:18:16.794770096Z", "uplink_message": {"session_key_id": "<KEY> "f_port": 1, "frm_payload": "BlM9A/QASgDNAo4=", "decoded_payload": {"altitude": 74, "battery_voltage": 2.05, "bytes": [6, 83, 61, 3, 244, 0, 74, 0, 205, 2, 142], "humidity": 61, "pressure": 1012, "rain_detect": null, "solar_voltage": 6.54, "temp": 16.19}, "decoded_payload_warnings": [], "rx_metadata": [{"gateway_ids": {"gateway_id": "packetbroker"}, "packet_broker": {"message_id": "01F628ZWAGQVPRYAVYR3QWX16M", "forwarder_net_id": "000013", "forwarder_tenant_id": "ttn", "forwarder_cluster_id": "ttn-v2-eu-3", "home_network_net_id": "000013", "home_network_tenant_id": "ttn", "home_network_cluster_id": "ttn-eu1", "hops": [{"received_at": "2021-05-19T12:18:16.528798036Z", "sender_address": "172.16.17.32", "receiver_name": "router-dataplane-57d9d9bddd-dsrjj", "receiver_agent": "pbdataplane/1.5.2 go/1.16.2 linux/amd64"}, {"received_at": "2021-05-19T12:18:16.529670423Z", "sender_name": "router-dataplane-57d9d9bddd-dsrjj", "sender_address": "forwarder_uplink", "receiver_name": "router-5b5dc54cf7-psxlt", "receiver_agent": "pbrouter/1.5.2 go/1.16.2 linux/amd64"}, {"received_at": "2021-05-19T12:18:16.531996337Z", "sender_name": "router-5b5dc54cf7-psxlt", "sender_address": "deliver.000013_ttn_ttn-eu1.uplink", "receiver_name": "router-dataplane-57d9d9bddd-f7h6k", "receiver_agent": "pbdataplane/1.5.2 go/1.16.2 linux/amd64"}]}, "time": "2021-05-19T12:18:16.146122Z", "rssi": -85, "channel_rssi": -85, "snr": 10.8, "uplink_token": "eyJnIjoiWlhsS2FHSkhZMmxQYVVwQ1RWUkpORkl3VGs1VE1XTnBURU5LYkdKdFRXbFBhVXBDVFZSSk5GSXdUazVKYVhkcFlWaFphVTlwU201YWJrcE1aV2t4TTFsNlJtMVlla0pJWkhreFJrbHBkMmxrUjBadVNXcHZhV050VG5sWk1tUnZZVlJuTUZwRlRrNWhWbFl5WkZVeGNFMUZhM2hrZVVvNUxtSTNhRU10TUc5V1NITnJSMng2TUV4NlJqaHNkMmN1VDNvNE9EQkVTa2hEUmtOQlZtOWhSQzR6VWxoQ2FsUjVhWFZITFdZMFRqZFJhMWs1Y3pkVFZVb3dVSFJRWTBwdmRqbFFOVEI0Um5jeU5HTmhkMFEyWmsweVpVdHhWMHBNUVU5M2RsZG9MWE5UYUhoTFltNUtjV0ZRVUdoQ1dEZE5iMk5yY1dFNWNrUnJYM0puU1cwdE0yMU9VME5NVlY4emRXYzVOSG96ZHkxYVRscE9lRjk1V1ZCT1psRk5OeTB5U0VnNFpsODFkbWxsWDJaRk5HRjFSbXhJTkVkTFkyTldkV2cwYjNWNFFUbERRalYxY21OemNqVkNjMk51TGtsMGNWWkZjRXMyTmtGaldrZFRYMlZsZFhnelZHYz0iLCJhIjp7ImZuaWQiOiIwMDAwMTMiLCJmdGlkIjoidHRuIiwiZmNpZCI6InR0bi12Mi1ldS0zIn19"}], "settings": {"data_rate": {"lora": {"bandwidth": 125000, "spreading_factor": 7}}, "data_rate_index": 5, "coding_rate": "4/5", "frequency": "868100000"}, "received_at": "2021-05-19T12:18:16.586624152Z", "consumed_airtime": "0.061696s"}} | json |
The process of admission to four new medical colleges in Rajasthan is expected to start from the new academic session, an official said on Tuesday. A meeting of the empowered committee of the Medical Education Department was held on Wednesday under the chairmanship of Chief Secretary Usha Sharma.
At the meeting, Principal Secretary of the department, Vaibhav Galriya, said efforts are being made to start the process of admission to medical colleges in Ganganagar, Chittorgarh, Sirohi and Dholpur districts from the new academic session.
All these colleges will have 100 seats each. Educational buildings, hostels for residents, nurses and interns, teachers' residences and sports ground are being constructed in the medical colleges, he said in a statement.
Galriya said most of the work has been completed and efforts are being made to get the remaining work completed soon. At present, 15 government and eight private medical colleges are functioning in the state, 16 government medical colleges are in the process of construction.
There are a total of 2,830 MBBS seats in the state medical colleges. Chief Secretary Sharma directed officials of the department concerned to complete all facilities and necessary work in the new medical colleges at the earliest.
(Except for the headline, this story has not been edited by our staff and is published from a syndicated feed. ) | english |
<filename>tomcat/webapps/hudson-3.2.0/help/tasks/aggregate-test/manual-list_fr.html
<!-- **************************************************************************
#
# Copyright (C) 2004-2009 Oracle Corporation
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# <NAME>
#
#************************************************************************** -->
<div>
Indiquez ici manuellement la liste des jobs. De multiples noms peuvent être
séparés par une virgule, par exemple "<tt>foo, bar</tt>".
</div>
| html |
Golden State Warriors guard Steph Curry gave a confident interview despite his team's Game 1 loss in the NBA Finals against the Boston Celtics. The Warriors endured a fourth-quarter meltdown, getting outscored 40-16 as they blew a 12-point lead entering the final frame of the game.
However, Curry believes the Dubs will bounce back in Sunday's Game 2 contest. Here's what he said after the game (via NBC Sports):
"It's not ideal, but we believe in who we are and how we deal with adversity, how we've responded all year, how we respond in the playoffs after a loss. Learned a lot from that fourth quarter. Obviously, they made a lot of shots."
Steph Curry continued:
"You know they have a team that just finds a little bit of momentum like they did and they keep making shots, so it's tough to kind of regain that momentum.
"And the guys that are obviously making the shots, Al, Marcus, Derrick White, Jaylen early in the fourth, they played well. We know they are a good team, so we've gotta respond on Sunday."
Game 1 of the NBA Finals between the Boston Celtics and Golden State Warriors was a close encounter until the fourth quarter.
Steph Curry registered a record-breaking performance in the first quarter. He scored 21 points on 7-of-9 shooting. He made 6-of-8 shots from the arc, the most by a player in a single quarter in an NBA Finals game.
His points tally in the first quarter was the second-highest since Michael Jordan's 22-point fourth quarter against the Phoenix Suns in the 1993 NBA Finals. Curry's heroics helped the Golden State Warriors enter the halftime break trailing by only two points.
The Warriors capitalized on that by taking a 12-point lead entering the fourth quarter as they outscored the C's 38-24 in the opening 12 minutes of the second half.
The Boston Celtics did a remarkable job in the second half, restricting Steph Curry to 13 points on 5-of-14 shooting during that stretch. It proved to be decisive as Ime Udoka's men caught fire in the final frame of the game.
Al Horford scored 11 points on 100% shooting in the final 12 minutes to help the C's outscore the Golden State Warriors 40-16. They successfully overturned their 12-point deficit at the start of the fourth period to claim a 120-108 win.
How did Michael Jordan's gambling "habit" taint his image?
| english |
Video game logic can be absurd at times, with a game like GTA Vice City having its own fair share of weird but funny logic.
There is a stark difference between video game features and realism sometimes. The former is often made to be fun and to accommodate the player at their convenience, while the latter can often be too restrictive in terms of video game design. Nonetheless, it's interesting to compare aspects of GTA Vice City that seem utterly silly when considering the above.
It is amusing to think that "Of course he looks like the suspect, that don't make him guilty. You look like an idiot, that doesn't mean you are one," is an acceptable way to get Tommy released from prison.
It doesn't matter what the crime is or how severe it was. Ken will often say something witty and Tommy will get out of prison, only losing his weapons and ammo. It would be boring if the game ended with Tommy in prison, so it's logical why this absurd logic is still in GTA Vice City.
There's an argument to be made that Tommy Vercetti can't swim because not everybody knows how to swim. Still, it's absurd to think that not a single citizen in GTA Vice City can swim, especially if they're wearing beachwear.
Of course, programming swimming this early on in the 3D GTA series would've been a pain for Rockstar Games, so it makes sense why this happens. It's still amusing seeing people near the lighthouse running to their watery graves, though.
For some strange reason, Tommy Vercetti is unable to do a wheelie no matter how hard a player tries when facing north. It's a bizarre bug, making this entry a more absurd aspect related to gameplay logic rather than just a gameplay feature.
Wheelies work in other directions, so it's not like Tommy is supposed to be unable to perform the act. Fortunately, this dumb bug is not prevalent in future GTA titles.
One of the best ways to heal to full HP in GTA Vice City is to eat pizza. As delicious of a meal as it might be, it is funny to think that Tommy Vercetti could get shot dozens of times and heal it off instantly with pizza.
Likewise, Tommy could get shot in the groin and still recover some of his HP by utilizing a prostitute's services. Obviously, GTA Vice City isn't meant to be a realistic game. Still, it's funny imagining pizza and prostitutes being a cure for serious injuries.
No parachutes? Not a problem. Almost every GTA game punishes the player for falling from a tremendous height. However, GTA Vice City is different. Tommy Vercetti can shrug off the most severe falls without a problem.
Touching a fairly deep body of water will kill Tommy Vercetti quickly, but he's free to jump off the tallest building nearly 10 times in order to die with max HP. Tommy is seriously one tough guy, especially since he can still sprint like it's nothing.
Note: This article is subjective and solely reflects the opinion of the writer.
GTA 5's mammoth $7,700,000,000 earnings set to be challenged by upcoming game! Know more here. | english |
Derbyshire 352 (Madsen 95, Slater 70, Freckingham 4-91) and 331-8 (Hughes 101, Madsen 66, Slater 56, Godleman 51,) drew with Leicestershire 329 (Chappell 96, Eckersley 50, Footitt 7-71) and 363 (Cosgrove 156, Ali 62)
Derbyshire fell just short of what would have been a famous victory in a thrilling end to the Division Two county championship match against Leicestershire at Derby.
Set 341 in 81 overs, 101 from Chesney Hughes plus half centuries from Billy Godleman, Ben Slater and skipper Wayne Madsen looked to have secured Derbyshire's first home championship win of the season.
But Wes Durston's dismissal with 14 needed sparked a collapse that saw four wickets fall for two runs and with 10 needed off the last five balls, Derbyshire settled for a draw at 331 for 8.
Durston had looked set for a memorable end of the season after he took a career-best 6 for 109, including the wicket of Mark Cosgrove for 156, to bowl Leicestershire out for 363.
Leicestershire needed to set a challenging target with key bowlers missing and Cosgrove added another 30 runs to his overnight score before he was last out.
He drove Durston for two sixes, the second taking him past 150, but when he went for a third, he was stumped to give Durston his second six wicket haul in a month.
Derbyshire began their chase knowing the pitch was still a good one to bat on but they needed a solid start and Godleman and Slater provided it with an opening stand of 103 in 27 overs.
Ben Raine was hit for six fours in 14 balls but he made the first breakthrough when Godleman misread the length and was lbw and Slater followed before tea, leg before trying to work Zak Chappell through mid-wicket.
At the interval, Derbyshire needed to accelerate with another 186 required from 34 overs and Hughes opened up by pulling Rob Taylor for six and driving the next ball for four.
Madsen swept Dan Redfern for four to pass 1,000 first-class runs for the season and Derbyshire went into the last hour needing 94 from 16 overs with Leicestershire increasingly desperate for a wicket.
Cosgrove turned to the off-spin of Aadil Ali but Madsen reverse swept him for three to reach 50 and complete 1,000 championship runs before he drove Redfern for another boundary.
Derbyshire went into the last 10 overs needing 64 and Hughes reduced that by two to reach his second hundred of the season from 152 balls but was then yorked by Taylor who had Madsen caught behind in his next over.
Durston responded by driving Raine for a much needed boundary to bring the target down to 35 from 30 balls and 16 came from Taylor's next over as Durston pulled him for four and six off consecutive balls.
That looked to have settled it but Durston drove to long on, Tom Poynton was bowled by Raine and Tom Millns was run out going for a second off an overthrow to leave 11 off the last over.
When Tom Taylor was run out going for a second off the first ball, Tom Knight blocked the next five balls from Ollie Freckingham to leave Madsen to reflect on what might have been.
"We are disappointed not to get the win but there are lots of positives to take because I thought we played brilliantly to get ourselves into that position. To chase down that sort of a score on the last day is no mean feat and we were in the position we wanted to be but unfortunately we threw it away at the end.
"We were under a run a ball so we should have got across the line but then at the end we felt it was too much a task in the last over so we had to close up shop."
Leicestershire head coach Andrew McDonald said: "It was a classic four day game, there was no winner but it went down to the wire and I'm really impressed with the way the boys fought . We stuck at it and to have an opportunity to almost win it at the end I think speaks volumes for where this group of players is at.
"I don't want to get too carried away with a draw but if people were here to see that they would understand why it was a significant effort and a significant step forward."
| english |
Jan Blachowicz had his first successful title defense against Israel Adesanya in their much anticipated matchup of champions at UFC 259.
Though Jan Blachowicz entered the fight as a sizeable underdog, he was able to thwart Adesanya's attempt at being a two-division UFC champion. While Izzy is known as a sniper on his feet, Blachowicz managed to avoid any serious damage with commendable defense in the first three rounds.
Jan Blachowicz then took the game to the ground in the championship rounds. It was here that he dominated Adesanya enough to get away with a comfortable unanimous decison win.
In a recent interview, Jan Blachowicz revealed that although Adesanya had some good kicks, there wasn't any one shot in the fight that really threatened 'Polish Power'. Talking about the fight, Jan Blachowicz told MMA Fighting:
"No, he hit me couple of times with clean shot. But nothing was like you know, that I feel that I will dizzy out in the fight. But I feel it you know, I feel specially his kicks. He has really good kicks, you know, strong. And I feel that ‘Oh my god’ when he kick. Low kicks also. But there wasn’t any shot in the fight where I think ‘Oh, I have to be careful. Maybe one more and will be the finish of the fight’. So no."
The UFC light heavyweight champion also claimed that he was well prepared going into the bout against Israel Adesanya. According to Jan Blachowicz, though he might have misjudged the speed and power of Adesanya, 'The Last Stylebender' failed to surprise him overall. Blachowicz further told MMA Fighting:
| english |
@charset "UTF-8";
*{
margin:0px;
padding:0px;
}
#nav_div{
width:100%;
height:50px;
background-color:#FFFFFF;
box-shadow:0 0 1px 0 #ECECEC;
}
.name_div{
width:100px;
height:50px;
line-height:50px;
margin-left:10px;
text-align:center;
float:left;
}
.name_div:hover{
cursor:pointer;
}
.nav_list_div{
width:1000px;
height:50px;
float:right;
}
#nav_list{
float:left;
margin-left:450px;
list-style:none;
}
#nav_list li{
font-family:Microsoft YaHei;
font-size:14px;
text-align:center;
width:80px;
height:50px;
line-height:50px;
float:left;
}
#nav_list li:hover{
color:#EC509A;
cursor:pointer;
} | css |
<reponame>sean-morris/otter-grader
"""
"""
__all__ = ["export_notebook", "grade_submission"]
import os
import sys
import shutil
import tempfile
from contextlib import redirect_stdout
try:
from contextlib import nullcontext
except ImportError:
from .utils import nullcontext # nullcontext is new in Python 3.7
from .argparser import get_parser
from .export import export_notebook
from .run import main as run_grader
PARSER = get_parser()
ARGS_STARTER = ["run"]
def grade_submission(ag_path, submission_path, quiet=False, debug=False):
"""
Runs non-containerized grading on a single submission at ``submission_path`` using the autograder
configuration file at ``ag_path``.
Creates a temporary grading directory using the ``tempfile`` library and grades the submission
by replicating the autograder tree structure in that folder and running the autograder there. Does
not run environment setup files (e.g. ``setup.sh``) or install requirements, so any requirements
should be available in the environment being used for grading.
Print statements executed during grading can be suppressed with ``quiet``.
Args:
ag_path (``str``): path to autograder zip file
submission_path (``str``): path to submission file
quiet (``bool``, optional): whether to suppress print statements during grading; default
``False``
debug (``bool``, optional): whether to run the submission in debug mode (without ignoring
errors)
Returns:
``otter.test_files.GradingResults``: the results object produced during the grading of the
submission.
"""
dp = tempfile.mkdtemp()
args_list = ARGS_STARTER.copy()
args_list.extend([
"-a", ag_path,
"-o", dp,
submission_path,
"--no-logo",
])
if debug:
args_list.append("--debug")
args = PARSER.parse_args(args_list)
if quiet:
f = open(os.devnull, "w")
cm = redirect_stdout(f)
else:
cm = nullcontext()
with cm:
results = run_grader(**vars(args))
if quiet:
f.close()
shutil.rmtree(dp)
return results
| python |
<gh_stars>0
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for utils/GammaUtils.sol</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="../index.html">all files</a> / <a href="index.html">utils/</a> GammaUtils.sol
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>17/17</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Branches</span>
<span class='fraction'>2/2</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>5/5</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>17/17</span>
</div>
</div>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117</td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">12×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">9×</span>
<span class="cline-any cline-yes">9×</span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">9×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">9×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">9×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">4×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">4×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">4×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">4×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">// SPDX-License-Identifier: MIT
pragma solidity >=0.7.2;
pragma experimental ABIEncoderV2;
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol";
import {IController} from "../interfaces/IController.sol";
contract GammaUtils {
IController controller;
function _initGammaUtil(address _controller) internal {
controller = IController(_controller);
}
/**
* @dev open vault with vaultId 1. this should only be performed once when contract is initiated
*/
function _openGammaVault(uint256 _vaultType) internal {
bytes memory data;
if (_vaultType != 0) {
data = abi.encode(_vaultType);
}
// this action will always use vault id 0
IController.ActionArgs[] memory actions = new IController.ActionArgs[](1);
actions[0] = IController.ActionArgs(
IController.ActionType.OpenVault,
address(this), // owner
address(0), // second address
address(0), // asset, otoken
1, // vaultId
0, // amount
0, // index
data // data
);
controller.operate(actions);
}
/**
* @dev mint otoken in vault 0
*/
function _mintOTokens(
address _collateral,
uint256 _collateralAmount,
address _otoken,
uint256 _otokenAmount
) internal {
// this action will always use vault id 0
IController.ActionArgs[] memory actions = new IController.ActionArgs[](2);
actions[0] = IController.ActionArgs(
IController.ActionType.DepositCollateral,
address(this), // vault owner
address(this), // deposit from this address
_collateral, // collateral asset
1, // vaultId
_collateralAmount, // amount
0, // index
"" // data
);
actions[1] = IController.ActionArgs(
IController.ActionType.MintShortOption,
address(this), // vault owner
address(this), // mint to this address
_otoken, // otoken
1, // vaultId
_otokenAmount, // amount
0, // index
"" // data
);
controller.operate(actions);
}
/**
* @dev settle vault 0 and withdraw all locked collateral
*/
function _settleGammaVault() internal {
IController.ActionArgs[] memory actions = new IController.ActionArgs[](1);
// this action will always use vault id 1
actions[0] = IController.ActionArgs(
IController.ActionType.SettleVault,
address(this), // owner
address(this), // recipient
address(0), // asset
1, // vaultId
0, // amount
0, // index
"" // data
);
controller.operate(actions);
}
function _redeemOTokens(address _otoken, uint256 _amount) internal {
IController.ActionArgs[] memory actions = new IController.ActionArgs[](1);
// this action will always use vault id 1
actions[0] = IController.ActionArgs(
IController.ActionType.Redeem,
address(0), // owner
address(this), // secondAddress: recipient
_otoken, // asset
0, // vaultId
_amount, // amount
0, // index
"" // data
);
controller.operate(actions);
}
}
</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Wed Jul 21 2021 15:06:33 GMT-0700 (Pacific Daylight Time)
</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../sorter.js"></script>
</body>
</html>
| html |
NAME = "admin-extra-urls"
VERSION = __version__ = "2.1.0"
__author__ = 'sax'
| python |
“Test cricket has been spoken about in a way I don’t like. It is losing the attention of the fans with all the new formats and franchise competitions. We understand there are so many opportunities for players away from Test cricket. But for me it is so important for the game. I love playing Test cricket and felt we could do something different.
“It is perceived that men shouldn’t be seen to show weakness, but I have never had an issue with expressing my feelings and opening up about It. I can’t tell you how much pride I had in myself for doing that after the messages I got from people I had never met.
“Moments like that in sport should always be cherished. The miracle of Headingley 1981, everyone who knows cricket knows about that. So for my moment to be compared is pretty cool.
“The scheduling doesn’t get enough attention that it should. A great example is England’s one-day series against Australia after the T20 World Cup. That was shoving three games in there. It made sense to someone to schedule a series which meant nothing. | english |
<filename>Clients/WebApp/appsettings.json
{
"urls": {
"BooksService": "http://books:80/" // For docker compose
//"BooksService": "https://localhost:44322/"
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*"
} | json |
{
"id": 92344,
"name": "Ай! Тут всё двигается!",
"description": "Надоело мне списки открывать ручками... И тут понеслось...\r\n\r\n<b>Рассчитан на использование с <a href='http://adblockplus.org' target=\"_blank\">AdBlock Plus</a></b>\r\n\r\nЯ старался ;). Если понравится, пошлите хотя бы сообщение ВКонтакте мол я молодец, пиши ещё :)!\r\n\r\nЗа сим удаляюсь. Приятного пользования!",
"user": {
"id": 195263,
"name": "<NAME>",
"email": "redacted",
"paypal_email": null,
"homepage": null,
"about": null,
"license": "arr"
},
"updated": "2016-12-08T16:35:50.000Z",
"weekly_install_count": 0,
"total_install_count": 93,
"rating": null,
"after_screenshot_name": "https://userstyles.org/style_screenshots/92344_after.jpeg?r=1588925024",
"obsoleting_style_id": null,
"obsoleting_style_name": null,
"obsolete": 0,
"admin_delete_reason_id": null,
"obsoletion_message": null,
"screenshots": null,
"license": "arr",
"created": "2013-08-28T09:54:53.000Z",
"category": "site",
"raw_subcategory": "absurdopedia",
"subcategory": "absurdopedia",
"additional_info": null,
"style_tags": [],
"css": "@namespace url(http://www.w3.org/1999/xhtml);\r\n\r\n@-moz-document domain(\"absurdopedia.net\") {\r\n.toccolours tbody tr + tr\r\n,.navbox tbody tr + tr\r\n{visibility:collapse !important}\r\n\r\n.toccolours:hover tbody tr + tr\r\n,.navbox:hover tbody tr + tr\r\n{visibility:visible !important; display:table-row !important}\r\n\r\n.NavFrame .NavContent\r\n,h2 span:nth-child(1)\r\n,#toctitle + ul\r\n,.toctoggle\r\n,h3 .editsection\r\n{display:none !important}\r\n\r\n.NavFrame:hover .NavContent\r\n,h2:hover span:nth-child(1)\r\n,#toc:hover tbody tr td ul:nth-child(2)\r\n,h3:hover .editsection\r\n{display:block !important}\r\n\r\n.navbox tbody tr th span[style=\"float: right; font-weight: normal; text-align: right; width: 6em;\"]\r\n,.NavHead a\r\n{visibility:hidden !important}\r\n\r\ns:hover {text-decoration:none !important}\r\n.toc {float:left; margin:5px 5px 5px 0}\r\n.mw-content-ltr {cursor: default}\r\n}",
"discussions": [],
"discussionsCount": 0,
"commentsCount": 0,
"userjs_url": "/styles/userjs/92344/theme.user.js",
"style_settings": []
} | json |
.landing-image {
padding: 160px 20px;
//background-image: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url(../img/bg.jpg);
background-image: url(../img/bg.jpg);
background-attachment: fixed;
background-size: cover;
background-position: center;
}
@media (max-width: 768px) {
.landing-image {
padding: 100px 22px;
}
}
.search-box {
max-width: 600px;
margin:auto;
}
.city-container{
text-align: center;
margin-top:55px;
}
.city img {
height: 110px;
width: 110px;
}
.city {
padding: 15px;
background-color: #ffffff;
border-radius: 50%;
box-shadow: rgba(36, 31, 31, 0.3) 0px 2px 5px 0px;
display: inline-block;
transition: all 100ms ease-in-out;
}
.city:focus,
.city:hover {
box-shadow: rgba(36, 31, 31, 0.3) 0px 5px 10px 0px;
} | css |
<filename>src/sample.rs
use op::{OpArith, OpLogic, OpUnary, OpBool, OpCast,
OPARITH, OPLOGIC, OPUNARY, OPBOOL, OPCAST};
use expr::{Expr, ExprType, ILiteral};
use utils::CloneWeightedChoice;
use num::{BigUint};
use num::traits::{Zero};
use num::bigint::ToBigUint;
use rand;
use rand::distributions::{Weighted, IndependentSample};
use rand::{Rng, ThreadRng};
use std::iter::Iterator;
mod constants {
use num::{BigUint};
use num::traits::{One, Zero};
use num::bigint::ToBigUint;
use utils::AsRaw;
/// Generates the 0b1010.. or 0b0101... representations
pub fn gen_alternated_bit(bits: u32, shift: bool) -> BigUint {
if bits == 1 {
return
if shift {
BigUint::one()
} else {
BigUint::zero()
};
}
let (mut start, end) = {
if shift == true {
(BigUint::zero(), bits)
} else {
(BigUint::one() << 1, bits - 3)
}
};
for i in 0 .. end {
start = start << 1;
if i % 2 == 0 {
start = start + BigUint::one();
}
}
start
}
/// Generates 0xff00 or 0x00ff representations
pub fn gen_half(bits: u32, upper: bool) -> BigUint {
let half_bits = bits / 2;
let mut start = BigUint::zero();
for i in 0 .. half_bits {
start = start | BigUint::one() << i as usize;
}
if upper {
start = start << half_bits as usize;
}
start
}
/// Max value for width
pub fn max_value(width: u32) -> BigUint {
(BigUint::one() << (width as usize)) - BigUint::one()
}
/// Max positive value for width
pub fn max_pos_value(width: u32) -> BigUint {
max_value(width) / 2.to_biguint().unwrap()
}
// XXX_ 0 and -0 are very simple in floating point
pub fn gen_alternated_float(which: u32) -> BigUint {
use std::f32::INFINITY;
if which % 3 == 0 {
0.0f32.as_raw().to_biguint().unwrap()
} else if which % 3 == 1 {
// Infinity
INFINITY.as_raw().to_biguint().unwrap()
} else {
(-0.0f32).as_raw().to_biguint().unwrap()
}
}
pub fn gen_float(which: u32) -> BigUint {
BigUint::one()
}
pub fn to_vector(value: &BigUint, orig_width: u32, times: u32)
-> BigUint
{
assert!(orig_width < 32);
value.clone()
}
}
/// Self state tracking object for sampling values
pub trait ValueSampler
{
// Methods
fn get_value(&mut self, width: u32) -> BigUint;
fn reset(&mut self);
fn push(&mut self);
fn pop(&mut self);
fn increase(&mut self);
fn current(&self) -> usize;
// Ctor
fn new(round: usize) -> Self where Self: Sized;
}
/// Contains the static methods that generate the values
trait ValueSamplerStatic {
fn get_value_static(round: usize, curr: usize, width: u32) -> BigUint;
fn rounds() -> usize;
}
/// Implement the basic functions for samplers iterators when they
/// have curr and stack in the struct
macro_rules! impl_basic_I{
() => (
fn reset(&mut self) { self.curr = 0; }
fn push(&mut self) { self.stack.push(self.curr); }
fn pop(&mut self) { self.curr = self.stack.pop().unwrap(); }
fn current(&self) -> usize { self.curr }
fn increase(&mut self) { self.curr += 1 }
fn get_value(&mut self, width: u32) -> BigUint {
let value = Self::get_value_static(self.round, self.curr, width);
self.increase();
value
}
)
}
/// Some simple constants
pub struct ConstSampler {
round: usize,
curr: usize,
stack: Vec<usize>
}
impl ValueSamplerStatic for ConstSampler {
fn rounds() -> usize { 28 }
fn get_value_static(round: usize, curr: usize, width: u32) -> BigUint {
// debugln!("reting value, round: {}, curr: {}, width: {}",
// round, curr, width);
match round {
0 ... 1 => {
let curr = curr % 2 == 0;
constants::gen_alternated_bit(width, curr)
},
1 ... 2 => {
let curr = !curr % 2 == 0;
constants::gen_alternated_bit(width, curr)
},
3 ... 4 => {
let curr = curr % 2 == 0;
constants::gen_half(width, curr)
},
5 ... 6 => {
let curr = !curr % 2 == 0;
constants::gen_half(width, curr)
},
7 ... 8 => {
let curr = curr % 3 == 0;
constants::gen_alternated_bit(width, curr)
},
9 ... 10 => {
let curr = (curr + 1) % 3 == 0;
constants::gen_alternated_bit(width, curr)
},
11 ... 12 => {
let curr = curr % 3 == 0;
constants::gen_half(width, curr)
},
13 ... 14 => {
let curr = (curr + 1) % 3 == 0;
constants::gen_half(width, curr)
},
15 ... 16 => {
if curr % 2 == 1 { 3.to_biguint().unwrap() }
else { 2.to_biguint().unwrap() }
},
17 ... 18 => {
if curr % 2 == 1 { 4.to_biguint().unwrap() }
else { 3.to_biguint().unwrap() }
},
19 ... 20 => {
if curr % 2 == 1 { 7.to_biguint().unwrap() }
else { 2.to_biguint().unwrap() }
},
21 ... 22 => {
if curr % 2 == 1 { 29.to_biguint().unwrap() }
else { 4.to_biguint().unwrap() }
},
23 ... 24 => {
if curr % 2 == 1 { 53.to_biguint().unwrap() }
else { 8.to_biguint().unwrap() }
},
25 ... 26 => {
if curr % 2 == 1 { 2510.to_biguint().unwrap() }
else { 16.to_biguint().unwrap() }
},
27 => BigUint::zero(),
_ => panic!(format!("unreachable: {}", curr))
}
}
}
impl ValueSampler for ConstSampler {
impl_basic_I!();
fn new(round: usize) -> ConstSampler {
ConstSampler {
round: round,
curr: 0,
stack: Vec::new()
}
}
}
/// Try making overflows/underflows
pub struct OverflowSampler {
round: usize,
curr: usize,
stack: Vec<usize>
}
impl ValueSamplerStatic for OverflowSampler {
fn rounds() -> usize { 13 }
fn get_value_static(round: usize, curr: usize, width: u32) -> BigUint {
match round {
0 => constants::max_value(width),
1 => {
if curr % 2 == 0 {
BigUint::zero()
} else {
constants::max_value(width)
}
},
2 => {
if curr % 3 == 0 {
BigUint::zero()
} else {
constants::max_value(width)
}
},
3 => {
if (curr + 1) % 2 == 0 {
BigUint::zero()
} else {
constants::max_value(width)
}
},
4 => {
if (curr + 1) % 3 == 0 {
BigUint::zero()
} else {
constants::max_value(width)
}
},
5 => {
if curr % 2 == 0 {
BigUint::zero()
} else {
constants::max_pos_value(width)
}
},
6 => {
if curr % 3 == 0 {
BigUint::zero()
} else {
constants::max_pos_value(width)
}
},
7 => {
if curr % 2 == 0 {
constants::max_value(width)
} else {
constants::max_pos_value(width)
}
},
8 => {
if (curr + 1) % 2 == 0 {
BigUint::zero()
} else {
constants::max_pos_value(width)
}
},
9 => {
if (curr + 1) % 3 == 0 {
BigUint::zero()
} else {
constants::max_pos_value(width)
}
},
10 => {
if (curr + 1) % 2 == 0 {
constants::max_value(width)
} else {
constants::max_pos_value(width)
}
},
11 => {
if (curr + 1) % 3 == 0 {
constants::max_value(width)
} else {
constants::max_pos_value(width)
}
},
12 => constants::max_pos_value(width),
_ => unreachable!()
}
}
}
impl ValueSampler for OverflowSampler {
impl_basic_I!();
fn new(round: usize) -> OverflowSampler {
OverflowSampler {
round: round,
curr: 0,
stack: Vec::new()
}
}
}
pub struct DepValueSampler {
i: usize,
}
impl DepValueSampler {
pub fn new(count: usize) -> DepValueSampler {
DepValueSampler {
i: 0
}
}
}
// macro_rules! return_sampler{
// ($($e:ident), *) => (
// let total = $ ( $e::rounds() ) , *
// )
// }
impl Iterator for DepValueSampler {
type Item = Box<ValueSampler>;
fn next(&mut self) -> Option<Box<ValueSampler>> {
// return_sampler![ConstSampler, OverflowSampler];
let total = ConstSampler::rounds() + OverflowSampler::rounds();
if self.i >= total {
None
} else {
let res: Option<Box<ValueSampler>> = Some(
if self.i < ConstSampler::rounds() {
Box::new(ConstSampler::new(self.i))
} else if self.i < ConstSampler::rounds() + OverflowSampler::rounds() {
Box::new(OverflowSampler::new(self.i - ConstSampler::rounds()))
} else {
unreachable!();
}
);
self.i += 1;
res
}
}
}
/// Algorithms to detect dependencies (these have not been tested nor
/// proved):
///
/// a) gen_alternated_bits * 2
/// b) gen_half * 2
/// c) zero
/// d) full
/// e) values: 7, 29, 53, 2510
///
/// Creates iter number of num strategies * reg_size
///
/// Exceptions: if width == 1, we alternate between 1 and 0
// enum_and_list!(DepStrategy, DEPSTRATEGY,
// Alt1, Alt2, Half1, Half2, Zero, Full, Val1, Val2, Val3, Val4,
// Const7, Const29, Const53, Const2510);
// pub struct DepValue {
// curr: usize,
// // XXX_ unused:
// count: usize,
// strategy: DepStrategy,
// stack: Vec<usize>
// }
/// Sample random Expr
pub struct RandExprSampler{
base: Vec<Expr>,
rng: ThreadRng,
sample_choice: CloneWeightedChoice<EEWS>
}
#[derive(Clone,Debug)]
enum EEWS {
Bit,
Bits,
Arith,
Logic,
Un,
ITE,
Bool,
Cast,
Ex,
IInt
}
impl RandExprSampler {
pub fn new(base: &[Expr]) -> RandExprSampler{
let rng = rand::thread_rng();
RandExprSampler {
base: base.to_vec(),
rng: rng,
sample_choice: CloneWeightedChoice::new(&[
// Weighted{item: EEWS::Bit, weight: 1},
// Weighted{item: EEWS::Bits, weight: 1},
// Weighted{item: EEWS::Arith, weight: 1},
// Weighted{item: EEWS::Logic, weight: 1},
// Weighted{item: EEWS::Un, weight: 1},
// Weighted{item: EEWS::ITE, weight: 1},
// //Weighted{item: EEWS::Bool, weight: 0},
// Weighted{item: EEWS::Cast, weight: 1},
// Weighted{item: EEWS::Ex, weight: 1},
// Weighted{item: EEWS::IInt, weight: 1}
Weighted{item: EEWS::Bit, weight: 3},
Weighted{item: EEWS::Bits, weight: 3},
Weighted{item: EEWS::Arith, weight: 10},
Weighted{item: EEWS::Logic, weight: 10},
Weighted{item: EEWS::Un, weight: 5},
Weighted{item: EEWS::ITE, weight: 1},
//Weighted{item: EEWS::Bool, weight: 0},
Weighted{item: EEWS::Cast, weight: 3},
Weighted{item: EEWS::Ex, weight: 1},
Weighted{item: EEWS::IInt, weight: 1}
]
)
}
}
fn sample_constant_shift(&mut self, width: u32) -> i16 {
let width = width as i16;
self.rng.gen_range(-width, width)
}
fn sample_constant(&mut self) -> i16 {
self.rng.gen_range(-16, 16)
}
fn sample_literal(&mut self) -> ILiteral {
self.sample_constant()
}
fn sample_base(&mut self) -> Expr {
if self.base.is_empty() {
Expr::Int(self.sample_const().to_biguint().unwrap())
} else {
let which = self.rng.gen_range(0, self.base.len());
self.base[which].clone()
}
}
fn sample_from_arr<T: Clone>(&mut self, arr: &[T]) -> T {
let len = arr.len();
let which = self.rng.gen_range(0, len);
arr[which].clone()
}
fn sample_from_arr_remove<T: Clone>(&mut self, arr: &mut Vec<T>)
-> Option<T>
{
if arr.is_empty() {
None
} else {
let len = arr.len();
let which = self.rng.gen_range(0, len);
Some(arr.remove(which))
}
}
fn sample_ex(&mut self) -> Expr {
if self.rng.gen::<bool>() {
self.sample_base()
} else {
Expr::Int(self.sample_const().to_biguint().unwrap())
}
}
pub fn sample_arithop(&mut self) -> OpArith {
self.sample_from_arr(&OPARITH)
}
pub fn sample_logicop(&mut self) -> OpLogic {
self.sample_from_arr(&OPLOGIC)
}
pub fn sample_unop(&mut self) -> OpUnary {
self.sample_from_arr(&OPUNARY)
}
pub fn sample_boolop(&mut self) -> OpBool {
self.sample_from_arr(&OPBOOL)
}
pub fn sample_castop(&mut self) -> OpCast {
self.sample_from_arr(&OPCAST)
}
pub fn sample_bit(&mut self, max: Option<u32>) -> u32 {
let max =
if max.is_none() {
self.sample_const()
} else {
max.unwrap()
};
self.rng.gen_range(0, max)
}
pub fn sample_bits(&mut self, range: Option<u32>, max: Option<u32>)
-> (u32, u32)
{
let (range, max) =
if range.is_none() || max.is_none() {
let range = self.sample_const();
let max = self.sample_const();
(range, max)
} else {
(range.unwrap(), max.unwrap())
};
let val = self.rng.gen_range(0, max);
(val, val+range)
}
fn sample_const(&mut self) -> u32 {
let values = [1, 4, 8, 16, 32, 64, 128, 256];
self.sample_from_arr(&values)
}
pub fn sample_ty(&mut self, width: Option<u32>) -> ExprType {
// XXX_ add float
ExprType::Int(
if let Some(w) = width {
w
} else {
self.sample_const()
})
}
pub fn sample_width(&mut self, width: Option<u32>) -> u32 {
if let Some(w) = width {
if self.rng.gen_range(0, 10) > 7 {
self.sample_const()
} else {
w
}
} else {
self.sample_const()
}
}
pub fn sample_expr_w_with_leafs(&mut self, leafs: &mut Vec<&Expr>,
width: Option<u32>)
-> Expr
{
use expr::Expr::*;
// Replace with an Expr sampled from the array if avail
macro_rules! leaf_or_e(
($e:expr, $leafs:expr) => ({
if let Some(n_e) = self.sample_from_arr_remove($leafs) {
*$e = Box::new(n_e.clone())
}
}));
let mut new_e;
// Sample until getting a non-ultimate expr where we can plug
// our leaf
loop {
new_e = self.sample_expr_w(width);
if !new_e.is_last() {
break;
}
}
match new_e {
ArithOp(_, ref mut e1, ref mut e2, _) |
LogicOp(_,ref mut e1, ref mut e2, _) |
BoolOp(_, ref mut e1, ref mut e2, _) => {
if self.rng.gen::<bool>() {
leaf_or_e!(e1, leafs);
leaf_or_e!(e2, leafs);
} else {
leaf_or_e!(e2, leafs);
leaf_or_e!(e1, leafs);
}
},
UnOp(_, ref mut e1, _) | Cast(_, ref mut e1, _) |
Bit(_, ref mut e1) | Bits(_, _, ref mut e1) => {
leaf_or_e!(e1, leafs);
},
ITE(_, ref mut e2, ref mut e3) => {
if self.rng.gen::<bool>() {
leaf_or_e!(e2, leafs);
leaf_or_e!(e3, leafs);
} else {
leaf_or_e!(e3, leafs);
leaf_or_e!(e2, leafs);
}
},
_ => ()
};
new_e
}
pub fn sample_boolexpr(&mut self) -> Expr {
Expr::BoolOp(self.sample_boolop(),
Box::new(self.sample_ex()),
Box::new(self.sample_ex()),
self.sample_width(None))
}
pub fn sample_expr_w(&mut self, width: Option<u32>) -> Expr {
let n_width = self.sample_width(width);
match self.sample_choice.ind_sample(&mut self.rng) {
EEWS::Ex => self.sample_ex(),
EEWS::IInt => Expr::IInt(self.sample_literal()),
EEWS::Bits => {
let e = self.sample_base();
let w_e = e.get_width();
let (bit1, bit2) = self.sample_bits(width, w_e);
Expr::Bits(bit1, bit2, Box::new(e))
}
EEWS::Bit => {
let e = self.sample_base();
let w = e.get_width();
let bit = self.sample_bit(w);
Expr::Bit(bit, Box::new(e))
}
EEWS::Arith => Expr::ArithOp(self.sample_arithop(),
Box::new(self.sample_ex()),
Box::new(self.sample_ex()),
self.sample_ty(width)),
EEWS::Logic => Expr::LogicOp(self.sample_logicop(),
Box::new(self.sample_ex()),
Box::new(self.sample_ex()),
// XXX_ fixme
n_width),
EEWS::Un => Expr::UnOp(self.sample_unop(),
Box::new(self.sample_ex()),
// XXX_ fixme
n_width),
EEWS::ITE => Expr::ITE(Box::new(self.sample_boolexpr()),
Box::new(self.sample_ex()),
Box::new(self.sample_ex())),
EEWS::Cast => Expr::Cast(self.sample_castop(),
Box::new(self.sample_ex()),
self.sample_ty(width)),
//_ => unreachable!()
wc => panic!(format!("not supported: {:?}", wc))
}
}
}
// Always start with the expression with the same expression of the
// StoreStmt, for example if it's StoreReg(Reg("EAX"), RESULT), start
// with: Reg("EAX").
fn start() {
}
fn sample_dep() {
}
fn sample_binop() {
}
// Sample randomly now
fn sample() -> Expr {
Expr::Reg("EAX".to_owned(), 32)
}
#[cfg(test)]
mod test {
use expr::Expr;
use num::bigint::ToBigUint;
use sample::{constants, RandExprSampler};
#[test]
fn test_gen_alternated() {
let bu = constants::gen_alternated_bit(8, false);
assert_eq!(bu, 0x55.to_biguint().unwrap());
let bu = constants::gen_alternated_bit(8, true);
assert_eq!(bu, 0xaa.to_biguint().unwrap());
let bu = constants::gen_alternated_bit(32, false);
assert_eq!(bu, 0x55555555u32.to_biguint().unwrap());
let bu = constants::gen_alternated_bit(32, true);
assert_eq!(bu, 0xaaAAaaAAu32.to_biguint().unwrap());
}
#[test]
fn test_gen_half() {
let bu = constants::gen_half(8, false);
assert_eq!(bu, 0xf.to_biguint().unwrap());
let bu = constants::gen_half(8, true);
assert_eq!(bu, 0xf0.to_biguint().unwrap());
}
}
| rust |
<filename>Final-Assignment/data/9323.json
{"published": "2015-08-31T21:59:01Z", "media-type": "Blog", "title": "State Attorney General <NAME> to speak at Burien Rotary Thursday", "id": "d5deba71-6527-4f16-a8b7-e8b97bf7ab54", "content": "Washington State Attorney General <NAME> will speak at the Rotary Club of Burien/White Center\u2019s monthly lunch this Thursday, starting at Noon at Angelo\u2019s Restaurant. \n \nRotarians are inviting all to come, eat and listen. \n \nCost is $15 per person, and includes a lunch. \n \nHere\u2019s more on Ferguson, who will speak from Noon \u2013 1:15 p.m.: \n \nFerguson is Washington\u2019s 18th Attorney General. As the state\u2019s chief legal officer, he directs 500 attorneys and 600 professional staff providing legal services to state agencies, Governor and Legislature.\u00a0Bob is a fourth-generation Washingtonian.\u00a0His family homesteaded on the Skagit River, and his grandparents owned the local meat market in Everett. Bob\u2019s mother, Betty, was a public school teacher, and his dad, Murray, worked for Boeing. Bob is the sixth of seven kids and was born and raised in the Queen Anne neighborhood of Seattle. \u00a0Today, Bob lives in the Maple Leaf neighborhood of Seattle with his family. He is happily married to his wife Colleen and together they have two twins, Jack and Katie. Jack and Katie are 4 years old.\u00a0Bob attended the University of Washington. He is an avid Husky fan, and a strong advocate for maintaining Washington\u2019s proud tradition of quality education for our students. \n \nAngelo\u2019s is located at 601 SW 153rd Street (206-244-3555), and guests can just show up. \n \nMore info about the Burien Rotary Club is available at http://bwcrotary.org .", "source": "The B-Town (Burien) Blog"} | json |
One of my favourite poems is beautifully illustrated by P.J.Lynch in this children’s book.The shades of green and blue used evoke the beauty, darkness and isolation of the snowy woodland scene.The horse illustrations, in particular the one in which he looks quizzically at the girl are used very effectively as a reminder of civilisation and the domestic.My only quibble is that for the last line,the illustrator has the rider leaving the scene whereas in the poem the issue of whether to linger in the woods or move on is left unresolved .Perhaps the endpaper would have been a more appropriate accompaniment to that line.
No comments have been added yet.
| english |
<gh_stars>1-10
{"books":{"9":{"id":"8002","title":"Seasons","description":"The Seasons is a series of four long poems in blank verse by the Scottish poet <NAME>, each poem describing one of the four seasons. The poems are replete with various scenes of nature described with loving detail, as well as Thomson's view of the proper relationship between humans and nature, which anticipates the attitudes of the Romantics. \"Spring,\" which was published in 1728, first brought Thomson to mainstream attention. He followed it up with \"Summer,\" \"Winter,\" and \"Autumn,\" publishing all four as The Seasons in 1730. It is in large part because of the reputation he garnered from the publication of The Seasons that the critic <NAME> called Thomson \"the best and most original of our descriptive poets.\" (Summary by <NAME>)<\/p>","url_text_source":"http:\/\/archive.org\/details\/seasonsbyjamest00thomgoog","language":"English","copyright_year":"1730","num_sections":"9","url_rss":"http:\/\/librivox.org\/rss\/8002","url_zip_file":"http:\/\/www.archive.org\/download\/\/theseasons_1309_librivox\/theseasons_1309_librivox_64kb_mp3.zip","url_project":"http:\/\/en.wikipedia.org\/wiki\/The_Seasons_(Thomson_poem)","url_librivox":"http:\/\/librivox.org\/the-seasons-by-james-thomson\/","url_other":null,"totaltime":"05:54:13","totaltimesecs":21253,"authors":[{"id":"10117","first_name":"James","last_name":"Thomson","dob":"1700","dod":"1748"}],"url_iarchive":"http:\/\/archive.org\/details\/theseasons_1309_librivox","sections":[{"id":"287230","section_number":"0","title":"Life of <NAME>","listen_url":"https:\/\/librivox.org\/uploads\/maryannspiegel\/seasons_0_thomson.mp3","language":"English","playtime":"1169","file_name":"seasons_00_thomson_128kb.mp3","readers":[{"reader_id":"8487","display_name":"<NAME>"}]},{"id":"287231","section_number":"1","title":"Spring - Part I","listen_url":"http:\/\/upload.librivox.org\/share\/uploads\/mas\/seasons_1_thomson.mp3","language":"English","playtime":"2070","file_name":"seasons_01_thomson_128kb.mp3","readers":[{"reader_id":"8487","display_name":"<NAME>"}]},{"id":"287232","section_number":"2","title":"Spring - Part II","listen_url":"http:\/\/upload.librivox.org\/share\/uploads\/mas\/seasons_2_thomson.mp3","language":"English","playtime":"2190","file_name":"seasons_02_thomson_128kb.mp3","readers":[{"reader_id":"8487","display_name":"<NAME>"}]},{"id":"287233","section_number":"3","title":"Summer - Part I","listen_url":"http:\/\/upload.librivox.org\/share\/uploads\/mas\/seasons_3_thomson.mp3","language":"English","playtime":"2839","file_name":"seasons_03_thomson_128kb.mp3","readers":[{"reader_id":"8487","display_name":"<NAME>"}]},{"id":"287234","section_number":"4","title":"Summer - Part II","listen_url":"https:\/\/librivox.org\/uploads\/maryannspiegel\/seasons_4_thomson.mp3","language":"English","playtime":"3476","file_name":"seasons_04_thomson_128kb.mp3","readers":[{"reader_id":"8487","display_name":"<NAME>"}]},{"id":"287235","section_number":"5","title":"Autumn - Part I","listen_url":"https:\/\/librivox.org\/uploads\/maryannspiegel\/seasons_5_thomson.mp3","language":"English","playtime":"3063","file_name":"seasons_05_thomson_128kb.mp3","readers":[{"reader_id":"8487","display_name":"<NAME>"}]},{"id":"287236","section_number":"6","title":"Autumn - Part II","listen_url":"https:\/\/librivox.org\/uploads\/maryannspiegel\/seasons_6_thomson.mp3","language":"English","playtime":"2065","file_name":"seasons_06_thomson_128kb.mp3","readers":[{"reader_id":"8487","display_name":"<NAME>"}]},{"id":"287237","section_number":"7","title":"Winter - Part I","listen_url":"https:\/\/librivox.org\/uploads\/maryannspiegel\/seasons_7_thomson.mp3","language":"English","playtime":"1568","file_name":"seasons_07_thomson_128kb.mp3","readers":[{"reader_id":"8487","display_name":"<NAME>"}]},{"id":"287238","section_number":"8","title":"Winter - Part II","listen_url":"https:\/\/librivox.org\/uploads\/maryannspiegel\/seasons_8_thomson.mp3","language":"English","playtime":"2334","file_name":"seasons_08_thomson_128kb.mp3","readers":[{"reader_id":"8487","display_name":"<NAME>"}]},{"id":"293232","section_number":"9","title":"A Hymn","listen_url":"https:\/\/librivox.org\/uploads\/maryannspiegel\/seasons_9_thomson.mp3","language":"English","playtime":"479","file_name":"seasons_09_thomson_128kb.mp3","readers":[{"reader_id":"8487","display_name":"<NAME>"}]}],"genres":[{"id":"25","name":"Poetry"}],"translators":[]}}} | json |
.messaging-form {
width: 100%;
display: flex;
height: 15%;
border-top: 1px solid grey;
/* border-left: 1px solid grey; */
}
.messaging-input {
padding: 5px;
height: 100%;
width: 16rem;
outline: none;
resize: none;
background-color: rgba(14, 14, 14, 0.637);
border: none;
color: white;
font-size: 1.2rem;
font-family: gilSans;
}
.messaging-sendButton {
display: flex;
align-items: center;
justify-content: center;
width: calc(100% - 16.1rem);
height: 100%;
background-color: rgba(100, 0, 194, 0.61);
border: none;
outline: none;
box-shadow: none;
color: white;
}
.messaging-sendButton-disabled {
display: flex;
align-items: center;
justify-content: center;
width: calc(100% - 16.1rem);
height: 100%;
background-color: rgba(100, 0, 194, 0.109);
border: none;
outline: none;
box-shadow: none;
color: rgb(87, 87, 87);
}
.messaging-sendButton:hover {
background-color: rgba(100, 0, 194, 0.883);
}
| css |
<reponame>soumyadipdas37/finescoop.github.io<filename>source/_posts/married_at_first_sights_aleks_markovic_launches_her_own_beauty_range.md
---
extends: _layouts.post
section: content
image: https://i.dailymail.co.uk/1s/2020/09/29/15/33769648-0-image-a-15_1601390890267.jpg
title: Married At First Sights Aleks Markovic launches her own beauty range
description: Former Married At First Sight star Aleks Markovic has launched her own beauty line.
date: 2020-09-29-16-45-35
categories: [latest, tv]
featured: true
---
Former Married At First Sight star Aleks Markovic relocated to Sydney to pursue her dreams in real estate.
And on Monday, the 26-year-old ticked another goal off her list by launching her very own beauty line.
'Tears stream down my face with excitement as I announce this, and boy am I proud to welcome Aleks beauty,' the TV star wrote on Instagram.
'Tears stream down my face' On Monday, Married At First Sight star Aleks Markovic, 26, launched her very own beauty range, which she announced on Instagram
Before adding: 'My vision [has] come to life and something that I had a dream of creating is finally here.'
Aleks said she 'followed her gut' before launching the line.
'I listened to the universe and followed my gut and even though this wasn't easy, I know that God has led me here,' she wrote.
Glamazon: 'I listened to the universe and followed my gut and even though this wasn't easy, I know that God has led me here,' Aleks wrote
She then thanked her friends, family and fans for their support.
'For everyone who believed in me and supported me, thank you! Go and give the page a follow if you haven't already,' she added.
Aleks' line is comprised of affordable beauty products for 'boss babes', according to the brand's Instagram handle.
Supportive: 'For everyone who believed in me and supported me, thank you! Go and give the page a follow if you haven't already,' Aleks added
The launch comes after the former reality star moved to Sydney from Perth for a career in real estate.
Aleks, who rose to fame after appearing on this year's season of the Channel Nine dating experiment, explained her move has been smooth sailing.
'Being on MAFS gave me a lot more opportunities, you're more recognised now so people know who you are,' she told Perth Now.
Remember this? Her shock career move is a surprise to many, with her ex <NAME> (right) also being a real estate agent in Sydney
| markdown |
<filename>CompetitiveProgramming/HackerEarth/basicInput/ex/PrinttheNumbers.cpp<gh_stars>1-10
#include <iostream>
using namespace std;
int main()
{
int N, i;
cin >> N;
int A[N];
for (i = 0; i < N; i++) cin >> A[i];
for (i = 0; i < N; i++) cout << A[i] << " ";
return 0;
} | cpp |
<reponame>LeonDong1993/TractableDE-ContCNet<filename>experiment/core/utmLib/ml/BN.py<gh_stars>0
# coding: utf-8
import numpy as np
from copy import deepcopy
from functools import partial
from utmLib import utils
from utmLib.ml.graph import Node, Graph
from pdb import set_trace
class BayesianNetwork:
def __init__(self,g,ev):
assert(g.digraph), "Only directed graph allowed"
for i in range(g.N):
parents = g.find_parents(i)
assert(len(parents) <=1), "At most one parent is allowed for each node"
self.graph = g
self.ev = ev
@staticmethod
def chowliu_tree(data):
'''
Learn a chowliu tree structure based on give data
data: S*N numpy array, where S is #samples, N is #RV (Discrete)
'''
_,D = data.shape
marginals = {}
# compute single r.v. marginals
for i in range(D):
values, counts = np.unique(data[:,i], return_counts=True)
marginals[i] = dict(zip(values, counts))
# compute joint marginal for each pair
for i,j in utils.halfprod(range(D)):
values, counts = np.unique(data[:,(i,j)], axis=0 ,return_counts=True)
values = list(map(lambda x:tuple(x),values))
marginals[i,j] = dict(zip(values, counts))
allcomb = utils.crossprod(list(marginals[i].keys()),list(marginals[j].keys()))
for v in allcomb:
if v not in marginals[i,j]: marginals[i,j][v] = 0
# normalize all marginals
for key in marginals:
dist = marginals[key]
summation = sum(dist.values())
for k in dist: dist[k] = (dist[k]+1) / float(summation) # 1- correction
mutual = {}
# compute mutual information
for i,j in utils.halfprod(range(D)):
mutual[i,j] = 0
for vi,vj in marginals[i,j]:
mutual[i,j] += np.log(marginals[i,j][vi,vj] / (marginals[i][vi] * marginals[j][vj])) * marginals[i,j][vi,vj]
# find the maximum spanning tree
G = Graph(digraph=False)
for i in range(D):
node = Node('N{}'.format(i))
node.domain = list(marginals[i].keys())
G.add_vertice(node)
for i,j in mutual:
G.add_edge(i,j,weight = mutual[i,j])
G = G.max_spanning_tree()
root = int(D/2)
G = G.todirect(root)
return G
def fit(self,traindata):
'''
MLE learning, basically empirical distribution
traindata: S*N numpy array, where S is #samples, N is #RV (Discrete)
'''
_,D = traindata.shape
assert(self.graph.N == D), "Input data not valid"
self.cpt = {}
for i in range(self.graph.N):
domain = self.graph.V[i].domain
parents = self.graph.find_parents(i)
if len(parents) == 0: # root node
# learn the node potential
values, counts = np.unique(traindata[:,i], return_counts=True)
dist = dict(zip(values, counts))
for v in domain:
if v not in dist: dist[v] = 1 # 1-correction
# normalize
summation = sum(dist.values())
for k in dist:dist[k] /= float(summation)
self.cpt[i] = dist
else:
# create uniform node potential
self.cpt[i] = dict(zip(domain, [1]*len(domain) ))
# learn the edge potential
dist = {}
assert(len(parents) == 1), "Each vertice can only have at most one parent!"
j = parents[0]
jdomain = self.graph.V[j].domain
values, counts = np.unique(traindata[:,(i,j)], axis=0 ,return_counts=True)
values = list(map(lambda x:tuple(x),values))
dist= dict(zip(values, counts))
allcomb = utils.crossprod(domain,jdomain)
for v in allcomb:
if v not in dist: dist[v] = 1 #1-correction
# normalize
for vj in jdomain:
summation = sum(map(lambda vi:dist[vi,vj],domain))
for vi in domain:
dist[vi,vj] /= float(summation)
self.cpt[i,j] = dist
return self
def predict(self,testdata):
'''
predict the values of non-evidence RV given the value of evidence RV
testdata: 1*N list / numpy array, N is #RV
'''
# first, from leaves to root
order = self.graph.toposort(reverse = True)
message = {}
for i in order:
parents = self.graph.find_parents(i)
children = self.graph.find_children(i)
if len(parents) == 0:
continue
msg = {}
assert(len(parents) == 1)
j = parents[0]
if j in self.ev:
continue
ivals = self.graph.V[i].domain
jvals = self.graph.V[j].domain
if i not in self.ev:
for vj in jvals:
msg[vj] = []
for vi in ivals:
production = 1.0
for c in children:
production *= message[c,i][vi]
msg[vj].append(self.cpt[i][vi] * self.cpt[i,j][vi,vj] * production)
msg[vj] = max(msg[vj])
else:
for vj in jvals:
msg[vj] = self.cpt[i,j][testdata[i], vj]
# normalize message
summation = sum(msg.values())
for k in msg: msg[k] /= float(summation)
message[i,j] = msg
# second, from root to leaves
order.reverse()
for i in order:
parents = self.graph.find_parents(i)
children = self.graph.find_children(i)
ivals = self.graph.V[i].domain
for j in children:
if j in self.ev:
continue
jvals = self.graph.V[j].domain
msg = {}
if i not in self.ev:
for vj in jvals:
msg[vj] = []
for vi in ivals:
production = 1.0
for p in parents:
production *= message[p,i][vi]
for c in children:
if c == j:continue
production *= message[c,i][vi]
msg[vj].append(self.cpt[i][vi] * self.cpt[j,i][vj,vi] * production)
msg[vj] = max(msg[vj])
else:
for vj in jvals:
msg[vj] = self.cpt[j,i][vj,testdata[i]]
# normalize message
summation = sum(msg.values())
for k in msg: msg[k] /= float(summation)
message[i,j] = msg
# calculate node belief
prediction = deepcopy(testdata)
for i in range(self.graph.N):
if i not in self.ev:
belief = {}
parents = self.graph.find_parents(i)
children = self.graph.find_children(i)
nodes = parents + children
for v in self.graph.V[i].domain:
belief[v] = self.cpt[i][v]
for n in nodes:
belief[v] *= message[n,i][v]
prediction[i] = max(belief.items(),key= lambda x:x[1])[0]
return prediction
class Clique(Node):
def __init__(self):
self.ids = []
self.desc='|'
def add_node(self,nid,n):
self.ids.append(nid)
self.desc += '{}|'.format(n)
def moralize(g):
# will lost weight information
assert(g.digraph)
ret = deepcopy(g)
ret.digraph = False
ret.remove_all_edges()
for v in range(g.N):
parents = g.find_parents(v)
parents.append(v)
for s,t in utils.halfprod(parents):
ret.add_edge(s,t)
return ret
def find_small_clique(X):
for i,xi in enumerate(X):
for j,xj in enumerate(X):
if i!=j and utils.allin(xi.ids,xj.ids):
return (i,j)
return None
def get_elim_order(g,alg = 'min-fill',preserve=None):
assert(not g.digraph)
assert(alg in ['min-degree','min-fill'])
unmarked = list(range(g.N))
edges = g.get_edges()
elim_order = []
cliques = []
while len(unmarked) > 0:
cost = [0 for x in unmarked]
for i,v in enumerate(unmarked):
unmarked_neighbor = list(filter(lambda x: (v,x) in edges,unmarked))
if alg == 'min-degree':
cost[i] = len(unmarked_neighbor)
if alg == 'min-fill':
cost[i] = len(unmarked_neighbor)*(len(unmarked_neighbor)-1)/2
for s,t in utils.halfprod(unmarked_neighbor):
if (s,t) in edges:
cost[i] -= 1
besti = None
bestv = None
if preserve == None:
besti = cost.index(min(cost))
bestv = unmarked[besti]
else:
tmp = list(zip(unmarked,cost))
tmp.sort(key = lambda x:x[1])
for v,_ in tmp:
children = preserve.find_children(v)
marked = list(filter(lambda x:x not in unmarked ,list(range(g.N))))
if utils.allin(children,marked):
bestv = v
besti = unmarked.index(bestv)
break
elim_order.append(bestv)
best_neighbor = list(filter(lambda x: (bestv,x) in edges,unmarked))
for s,t in utils.diffprod(best_neighbor):
if (s,t) not in edges:
edges.append( (s,t) )
best_neighbor.append(bestv)
cliques.append(best_neighbor)
unmarked.pop(besti)
return elim_order,cliques
def get_junction_tree(g, preserve = None):
assert(not g.digraph)
order,cliques = get_elim_order(g,preserve = preserve)
CLIQUE = []
for i,elem in enumerate(cliques):
cq = Clique()
for rid in elem:
cq.add_node(rid,g.V[rid])
cq.elim = [order[i]]
CLIQUE.append(cq)
while 1:
pair = find_small_clique(CLIQUE)
if pair == None:
break
i,j = pair
for eid in CLIQUE[i].elim:
CLIQUE[j].elim.append(eid)
CLIQUE.pop(i)
# find the maximum spanning tree over the clique graph
newg = Graph(digraph = False)
for c in CLIQUE:
newg.add_vertice(c)
vertices = range(newg.N)
for (i,j) in utils.halfprod(vertices):
cinodes = newg.V[i].ids
cjnodes = newg.V[j].ids
weight = sum(map(lambda x:x in cinodes,cjnodes))
if weight>0: newg.add_edge(i,j,weight=weight)
newg = newg.max_spanning_tree()
return newg
class Potential:
def __repr__(self):
return 'ids:{} P:{}'.format(self.ids,self.P)
class DynamicBayesianNetwork:
def __init__(self,g,ev,intercnt='default'):
'''
intercnt - the connection between two time slice, 'default' means we have 1-to-1 connection between
all the state variables.
'''
assert(g.digraph), "Only directed graph allowed"
sv = list(filter(lambda x:x not in ev,range(g.N)))
self.G = g
self.EV = ev
self.SV = sv
self.CPT = {}
self.ICPT = {}
self.filter = partial(self.smooth,smooth = False)
self.predict = partial(self.smooth,smooth = False)
# construt two time slice graph G2
mapping = {}
G2 = deepcopy(self.G)
for i in self.SV:
node = deepcopy(self.G.V[i])
node.desc = 'f-' + node.desc
nid = G2.add_vertice(node)
mapping[i]=nid
if intercnt == 'default':
intercnt = [(i,i) for i in self.SV]
for i,j in intercnt:
G2.add_edge(mapping[i],j)
self.G2 = G2
self.M = mapping
# add edges in G
edges = self.G.get_edges()
for i,j in edges:
if (i in self.SV) and (j in self.SV):
a,b = self.M[i],self.M[j]
self.G2.add_edge(a,b)
# reverse mapping used for backward message passing
self.rM = {}
for k,v in self.M.items():
self.rM[v] = k
# init node CPT
for i in self.SV:
parents = self.G.find_parents(i)
self.ICPT[i] = self.init_CPT(i,parents)
for i in range(self.G.N):
parents = self.G2.find_parents(i)
self.CPT[i] = self.init_CPT(i,parents)
def logprob(self,sequence):
T,F = sequence.shape
assert(F == self.G.N), "Invalid input data"
sum_log_prob = 0.0
for t in range(T):
if t == 0:
cur_slice = sequence[0,:]
for i in range(F):
if i in self.EV:
potential = self.CPT[i]
else:
potential = self.ICPT[i]
ind = tuple(cur_slice[potential.ids])
sum_log_prob += np.log(potential.P[ind])
else:
slice_two = sequence[(t-1):(t+1),:]
ex_slice = slice_two.flatten()
for i in range(F):
potential = self.CPT[i]
ind = tuple(ex_slice[potential.ids])
sum_log_prob += np.log(potential.P[ind])
avg_log_prob = sum_log_prob/float(T)
return avg_log_prob
def init_CPT(self,i,parents):
cpt = Potential()
ids = [i] + parents
table_size = tuple(map(lambda x: len(self.G2.V[x].domain) ,ids))
cpt.ids = ids
cpt.P = np.zeros(table_size)
return cpt
def min_clique(self,G,ids):
# find the minimum clique in G contains all id in ids
candidates = []
for i in range(G.N):
nids = G.V[i].ids
if utils.allin(ids,nids):
candidates.append( (i,len(nids)) )
best = min(candidates,key=lambda x:x[1])
return best[0]
def init_potential(self,ids):
potential = Potential()
table_size = tuple(map(lambda x: len(self.G2.V[x].domain) ,ids))
potential.ids = ids
potential.P = np.ones(table_size)
return potential
def init_message(self,G,ret):
for i in range(G.N):
clique = G.V[i]
ret[i] = self.init_potential(clique.ids)
return
def multiply_potential(self,p1,p2):
if p1.ids == p2.ids:
newp = self.init_potential(p1.ids)
newp.P = p1.P * p2.P
return newp
if len(p1.ids) >= len(p2.ids):
pb = p1; ps = p2
else:
pb = p2; ps = p1
assert(utils.allin(ps.ids,pb.ids))
pt = deepcopy(pb)
for npi,npv in np.ndenumerate(ps.P):
idx = []
for v in pt.ids:
if v in ps.ids:
idx.append( npi[ps.ids.index(v)] )
else:
idx.append( slice(None) )
idx = tuple(idx)
pt.P[idx] *= npv
pt.P = pt.P/np.sum(pt.P)
return pt
def multiply_CPT(self,G,E,ret,init=False):
for i in range(G.N):
clique = G.V[i]
assert(ret[i].ids == clique.ids)
for eid in clique.elim:
if eid in self.SV:
if init:
ret[i] = self.multiply_potential(ret[i],self.ICPT[eid])
else:
ret[i] = self.multiply_potential(ret[i],self.CPT[eid])
if eid in self.EV:
ret[i] = self.multiply_potential(ret[i],self.CPT[eid])
# condition out the evidence variable
newids = list(filter(lambda x:x not in self.EV,clique.ids))
if len(newids) < len(clique.ids):
potential = self.init_potential(newids)
for npi,_ in np.ndenumerate(potential.P):
idx = [-1 for v in clique.ids]
for si,v in enumerate(clique.ids):
if v in self.EV:
idx[si] = E[v]
else:
idx[si] = npi[newids.index(v)]
idx = tuple(idx)
potential.P[npi] = ret[i].P[idx]
ret[i] = potential
def marginalize(self,pt,ids):
if pt.ids == ids:
newp = deepcopy(pt)
newp.P = newp.P/np.sum(newp.P)
return newp
newp = deepcopy(pt)
sumout = list(filter(lambda v:v not in ids,pt.ids))
for s in sumout:
dim = newp.ids.index(s)
if self.mode == 'max':
newp.P = np.amax(newp.P,axis = dim)
else:
assert(self.mode == 'sum')
newp.P = np.sum(newp.P,axis = dim)
newp.ids.remove(s)
return newp
def get_message(self,p1,p2,timestep = 0):
assert(timestep in [-1,0,1])
# get the message pass from p1 -> p2
ids = []
if timestep > 0:
for i in p1.ids:
assert(i not in self.EV)
if (i in self.SV) and (self.M[i] in p2.ids): ids.append(i)
elif timestep <0:
for i in p1.ids:
assert(i not in self.EV)
if (i not in self.SV) and (self.rM[i] in p2.ids): ids.append(i)
else:
ids = list(filter(lambda x:x in p2.ids,p1.ids))
msg = self.marginalize(p1,ids)
if timestep > 0:
msg.ids = list(map(lambda x:self.M[x],msg.ids))
if timestep < 0:
msg.ids = list(map(lambda x:self.rM[x],msg.ids))
return msg
def calculate_msg(self,G,npt):
message = {}
g = G.todirect(0)
order = g.toposort(reverse = True)
# do message passing
for i in order:
parents = g.find_parents(i)
children = g.find_children(i)
if len(parents) == 0: continue
assert(len(parents) == 1)
j = parents[0]
msg = npt[i]
for c in children:
msg = self.multiply_potential(msg,message[c,i])
message[i,j] = self.get_message(msg,npt[j])
# from root to leaves
order.reverse()
for i in order:
parents = g.find_parents(i)
children = g.find_children(i)
for j in children:
msg = npt[i]
for p in parents:
msg = self.multiply_potential(msg,message[p,i])
for c in children:
if c == j: continue
msg = self.multiply_potential(msg,message[c,i])
message[i,j] = self.get_message(msg,npt[j])
return message
def collect_msg(self,G,r,npt,msg):
neignbors = G.find_neighbor(r)
pt = npt[r]
for n in neignbors:
pt = self.multiply_potential(pt,msg[n,r])
return pt
def smooth(self,data,numnodes=4,smooth=True):
self.mode = 'max'
assert(numnodes > 1)
st = 0
appro = []
while st < len(self.SV):
ed = st + numnodes
if ed > len(self.SV):
ed = len(self.SV)
appro.append(self.SV[st:ed])
st = ed
# create junction tree J1
T1G = deepcopy(self.G)
T1G = moralize(T1G)
for bkc in appro:
for s,t in utils.halfprod(bkc):
T1G.add_edge(s,t)
self.J1 = get_junction_tree(T1G,preserve=self.G)
# find come and out node
self.J1.out = []
for bkc in appro:
self.J1.out.append( self.min_clique(self.J1,bkc) )
self.J1.come = deepcopy(self.J1.out)
# create junction tree Jt
T2G = moralize(self.G2)
for bkc in appro:
for s,t in utils.halfprod(bkc):
T2G.add_edge(s,t)
fbkc = list(map(lambda x:self.M[x],bkc))
for s,t in utils.halfprod(fbkc):
T2G.add_edge(s,t)
self.J2 = get_junction_tree(T2G,preserve = self.G2)
# find come and out node
self.J2.out = []
for bkc in appro:
self.J2.out.append( self.min_clique(self.J2,bkc) )
self.J2.come = []
for bkc in appro:
fbkc = list(map(lambda x:self.M[x],bkc))
self.J2.come.append( self.min_clique(self.J2,fbkc) )
T,N = data.shape
assert(N == self.G.N)
fmsg = {}
for t in range(T):
fmsg[t] = {}
evidence = data[t,:]
if t==0:
self.init_message(self.J1,fmsg[t])
self.multiply_CPT(self.J1,evidence,fmsg[t],init=True)
# collect message to out node for each bk cluster
npt = deepcopy(fmsg[t])
message = self.calculate_msg(self.J1,npt)
for i in self.J1.out:
fmsg[t][i] = self.collect_msg(self.J1,i,npt,message)
else:
pt = t-1
self.init_message(self.J2,fmsg[t])
self.multiply_CPT(self.J2,evidence,fmsg[t])
# absorb message from the previous time slice
for i,inid in enumerate(self.J2.come):
if pt == 0:
outid = self.J1.out[i]
else:
outid = self.J2.out[i]
msg = self.get_message(fmsg[pt][outid],fmsg[t][inid],timestep = 1)
fmsg[pt][outid,-1] = msg
fmsg[t][inid] = self.multiply_potential(msg,fmsg[t][inid])
npt = deepcopy(fmsg[t])
message = self.calculate_msg(self.J2,npt)
for i in self.J2.out:
fmsg[t][i] = self.collect_msg(self.J2,i,npt,message)
if t==(T-1):
for i,outid in enumerate(self.J2.out):
inid = self.J2.come[i]
fmsg[t][outid,-1] = self.get_message(fmsg[t][outid],fmsg[t][inid],timestep = 1)
if smooth:
endtime = -1
else:
endtime = T
bmsg = {}
for t in range(T-1,endtime,-1):
bmsg[t] = {}
evidence = data[t,:]
if t==(T-1):
curG = self.J2
self.init_message(curG,bmsg[t])
self.multiply_CPT(curG,evidence,bmsg[t])
npt = deepcopy(bmsg[t])
message = self.calculate_msg(curG,npt)
for i,inid in enumerate(curG.come):
bmsg[t][inid] = self.collect_msg(curG,inid,npt,message)
outid = curG.out[i]
bmsg[t][-1,outid] = self.init_potential(appro[i])
if t<(T-1):
nt = t+1
curG = self.J2
if t==0:
curG = self.J1
# initialize message
self.init_message(curG,bmsg[t])
if t==0:
self.multiply_CPT(curG,evidence,bmsg[t],init=True)
else:
self.multiply_CPT(curG,evidence,bmsg[t])
# absorb message from the previous time slice
for i,outid in enumerate(curG.out):
inid = self.J2.come[i]
msg = self.get_message(bmsg[nt][inid],bmsg[t][outid],timestep = -1)
bmsg[t][-1,outid] = msg
bmsg[t][outid] = self.multiply_potential(msg,bmsg[t][outid])
npt = deepcopy(bmsg[t])
message = self.calculate_msg(curG,npt)
for i in curG.come:
bmsg[t][i] = self.collect_msg(curG,i,npt,message)
prediction = deepcopy(data)
for t in range(T):
if t==0:
tg = self.J1
else:
tg = self.J2
for bki,outid in enumerate(tg.out):
fP = fmsg[t][outid,-1]
fP.ids = list(map(lambda x:self.rM[x],fP.ids))
potential = fP
if smooth:
bP = bmsg[t][-1,outid]
potential = self.multiply_potential(potential,bP)
P = potential.P/np.sum(potential.P)
idx = np.unravel_index(P.argmax(), P.shape)
for v in appro[bki]:
prediction[t,v] = idx[fP.ids.index(v)]
return prediction
def condLL(self,data,numnodes=4,smooth=False):
self.mode = 'sum'
assert(numnodes > 1)
st = 0
appro = []
while st < len(self.SV):
ed = st + numnodes
if ed > len(self.SV):
ed = len(self.SV)
appro.append(self.SV[st:ed])
st = ed
# create junction tree J1
T1G = deepcopy(self.G)
T1G = moralize(T1G)
for bkc in appro:
for s,t in utils.halfprod(bkc):
T1G.add_edge(s,t)
self.J1 = get_junction_tree(T1G,preserve=self.G)
# find come and out node
self.J1.out = []
for bkc in appro:
self.J1.out.append( self.min_clique(self.J1,bkc) )
self.J1.come = deepcopy(self.J1.out)
# create junction tree Jt
T2G = moralize(self.G2)
for bkc in appro:
for s,t in utils.halfprod(bkc):
T2G.add_edge(s,t)
fbkc = list(map(lambda x:self.M[x],bkc))
for s,t in utils.halfprod(fbkc):
T2G.add_edge(s,t)
self.J2 = get_junction_tree(T2G,preserve = self.G2)
# find come and out node
self.J2.out = []
for bkc in appro:
self.J2.out.append( self.min_clique(self.J2,bkc) )
self.J2.come = []
for bkc in appro:
fbkc = list(map(lambda x:self.M[x],bkc))
self.J2.come.append( self.min_clique(self.J2,fbkc) )
T,N = data.shape
assert(N == self.G.N)
fmsg = {}
for t in range(T):
fmsg[t] = {}
evidence = data[t,:]
if t==0:
self.init_message(self.J1,fmsg[t])
self.multiply_CPT(self.J1,evidence,fmsg[t],init=True)
# collect message to out node for each bk cluster
npt = deepcopy(fmsg[t])
message = self.calculate_msg(self.J1,npt)
for i in self.J1.out:
fmsg[t][i] = self.collect_msg(self.J1,i,npt,message)
else:
pt = t-1
self.init_message(self.J2,fmsg[t])
self.multiply_CPT(self.J2,evidence,fmsg[t])
# absorb message from the previous time slice
for i,inid in enumerate(self.J2.come):
if pt == 0:
outid = self.J1.out[i]
else:
outid = self.J2.out[i]
msg = self.get_message(fmsg[pt][outid],fmsg[t][inid],timestep = 1)
fmsg[pt][outid,-1] = msg
fmsg[t][inid] = self.multiply_potential(msg,fmsg[t][inid])
npt = deepcopy(fmsg[t])
message = self.calculate_msg(self.J2,npt)
for i in self.J2.out:
fmsg[t][i] = self.collect_msg(self.J2,i,npt,message)
if t==(T-1):
for i,outid in enumerate(self.J2.out):
inid = self.J2.come[i]
fmsg[t][outid,-1] = self.get_message(fmsg[t][outid],fmsg[t][inid],timestep = 1)
if smooth:
endtime = -1
else:
endtime = T
bmsg = {}
for t in range(T-1,endtime,-1):
bmsg[t] = {}
evidence = data[t,:]
if t==(T-1):
curG = self.J2
self.init_message(curG,bmsg[t])
self.multiply_CPT(curG,evidence,bmsg[t])
npt = deepcopy(bmsg[t])
message = self.calculate_msg(curG,npt)
for i,inid in enumerate(curG.come):
bmsg[t][inid] = self.collect_msg(curG,inid,npt,message)
outid = curG.out[i]
bmsg[t][-1,outid] = self.init_potential(appro[i])
if t<(T-1):
nt = t+1
curG = self.J2
if t==0:
curG = self.J1
# initialize message
self.init_message(curG,bmsg[t])
if t==0:
self.multiply_CPT(curG,evidence,bmsg[t],init=True)
else:
self.multiply_CPT(curG,evidence,bmsg[t])
# absorb message from the previous time slice
for i,outid in enumerate(curG.out):
inid = self.J2.come[i]
msg = self.get_message(bmsg[nt][inid],bmsg[t][outid],timestep = -1)
bmsg[t][-1,outid] = msg
bmsg[t][outid] = self.multiply_potential(msg,bmsg[t][outid])
npt = deepcopy(bmsg[t])
message = self.calculate_msg(curG,npt)
for i in curG.come:
bmsg[t][i] = self.collect_msg(curG,i,npt,message)
logprob = 0.0
for t in range(T):
prob = 1.0
row = data[t,:]
if t==0:
tg = self.J1
else:
tg = self.J2
for bki,outid in enumerate(tg.out):
fP = fmsg[t][outid,-1]
fP.ids = list(map(lambda x:self.rM[x],fP.ids))
potential = fP
if smooth:
bP = bmsg[t][-1,outid]
potential = self.multiply_potential(potential,bP)
P = potential.P/np.sum(potential.P)
idx = tuple(row[potential.ids])
prob *= P[idx]
logprob += np.log(prob)
avg_logprob = logprob/T
return avg_logprob
def get_domain(self,nids):
n0 = self.G2.V[nids[0]]
D = n0.domain
for i in nids[1:]:
node = self.G2.V[i]
D = utils.crossprod(D,node.domain)
return D
def norm_CPT(self,cpt):
ratio = 1e-3
X = np.sum(cpt.P)
addv = int(X*ratio)
addv += int(addv==0)
cpt.P += addv
newP = deepcopy(cpt.P)
if len(cpt.ids) == 1:
newP = newP/np.sum(cpt.P)
else:
n = cpt.ids[0]
domain = self.get_domain(cpt.ids[1:])
for v in domain:
if not isinstance(v,tuple): v = tuple([v])
index = tuple([self.G.V[n].domain]) + v
summation = np.sum(cpt.P[index])
assert( summation!=0 )
newP[index] /= summation
# return
cpt.P = newP
def fit(self,traindata):
# traindata - list of 2D numpy array
M = len(traindata)
for i in range(M):
data = traindata[i]
T,N = data.shape
assert(N == self.G.N)
# basically learning the empirical distribution
for t in range(T):
now = data[t,:]
if t == 0:
for i in self.SV:
idx = tuple(now[self.ICPT[i].ids])
self.ICPT[i].P[idx] += 1
else:
prev = data[t-1,:]
exnow = np.append(now,[0 for i in self.SV])
for k,v in self.M.items():
exnow[v] = prev[k]
for i in self.SV:
idx = tuple(exnow[self.CPT[i].ids])
self.CPT[i].P[idx] += 1
for i in self.EV:
idx = tuple(now[self.CPT[i].ids])
self.CPT[i].P[idx] += 1
# normalize all CPT
for i in range(self.G.N):
self.norm_CPT(self.CPT[i])
for i in self.SV:
self.norm_CPT(self.ICPT[i])
return self
| python |
UFC bantamweight star Sean O'Malley has praised Israel Adesanya for his dominant run at middleweight, even claiming it is greater than Khabib Nurmagomedov's at 155lbs.
After losing the title to Alex Pereira in a major upset last year, 'The Last Stylebender' finally conquered his boogeyman when the pair ran it back at UFC 287. Adesanya stunned MMA fans by not only finally getting a win over Pereira, but did so with a stunning second-round KO to recapture his belt.
The win for the Nigerian New Zealander meant he now holds victories over the entire middleweight division's top 5. A fact that Sean O'Malley was left seriously impressed with.
Discussing the champ in the latest video on his YouTube channel, 'Sugar' was left questioning whether or not the UFC would see another dominance like Israel Adesanya's. The 28-year-old did highlight, however, that he expects Bo Nickals grappling game to shake up the rankings. He said:
"Adesanya has beat every single middleweight in the top five currently. That's gangster. . . It's another division there's no real heavy grapplers, heavy wrestlers, besides Bo Nickal but he's a little way out from the title. How long's it been since somebody took over the game that long? Khabib didn't really do it. Volk maybe? Volk and Izzy are taking over the game. "
Catch O'Malley's comments here (21:20):
Sean O'Malley recently gave fans some insight into his relationship after he and his wife Danya Gonzalez answered questions on his YouTube channel.
The pair have a child together who was born in 2020, but have remained in an open relationship since deciding to tie the knot. Their relationship dynamic has often been questioned by fans of the MMA star, and he has since shed some light on their situation.
According to O'Malley, their journey hasn't always been easy. The 28-year-old revealed that they've had ups and downs throughout their time together and it's taken years to get to the point they are now:
"We listen. We listened to podcasts, learned about relationships and growing so we could figure out what relationship works for us. . . I'm horny all the time and it's not just for you [Gonzalez]. It took us years to get past that but I was telling my truths. "
Catch O'Malley's comments here (9:45): | english |
{"@context": "https://linked.art/ns/v1/linked-art.json", "about": [], "classified_as": [{"id": "aat:300375748", "label": "archives (groupings)", "type": "Type"}, {"id": "aat:300026867", "label": "clippings (information artifacts)", "type": "Type"}, {"id": "aat:object", "label": "object", "type": "Type"}], "crm:P104_is_subject_to": [{"classified_as": [{"id": "aat:300068844", "label": "use", "type": "Type"}], "id": "_:b1", "type": "crm:E30_Right"}, {"classified_as": [{"id": "aat:300417633", "label": "legal status", "type": "Type"}], "id": "_:b0", "type": "crm:E30_Right"}], "crm:P57_has_number_of_parts": null, "current_keeper": null, "current_location": {"label": "Association Marcel Duchamp, Paris", "type": "Place"}, "current_owner": {"id": "http://data.duchamparchives.org/amd", "label": "Association Marcel Duchamp", "type": "Group"}, "depicts": [], "id": "http://data.duchamparchives.org/amd/archive/component/SBK2_1961-63_25", "identified_by": [{"id": "http://data.duchamparchives.org/amd/archive/component/aspace_045fedb916218a034dfc8e354f07e47f/unittitle", "type": "Name", "value": "Utica Observer Dispatch clippings about 50th Anniversary Armory Show exhibition"}, {"classified_as": [{"id": "aat:accession", "label": "accession", "type": "Type"}], "id": "http://data.duchamparchives.org/amd/archive/component/aspace_045fedb916218a034dfc8e354f07e47f/unitid/0", "type": "Identifier", "value": "SBK2_1961-63_25"}, {"classified_as": [{"id": "aat:300404670", "label": "preferred terms", "type": "Type"}], "id": "http://data.duchamparchives.org/amd/archive/component/aspace_045fedb916218a034dfc8e354f07e47f/id", "type": "Identifier", "value": "aspace_045fedb916218a034dfc8e354f07e47f"}], "label": null, "language": [{"id": "aat:300388277", "label": "English (language)", "type": "Type"}], "made_of": [], "ore:isAggregatedBy": null, "part_of": [], "produced_by": {"carried_out_by": ["http://data.duchamparchives.org/amd/archive/actor/local/whittemore-h-e-"], "consists_of": [{"carried_out_by": [{"id": "http://data.duchamparchives.org/amd/archive/actor/local/whittemore-h-e-", "label": "Whittemore, H. E.", "type": "Actor"}], "classified_as": [], "id": "http://data.duchamparchives.org/amd/archive/component/aspace_045fedb916218a034dfc8e354f07e47f/production/aut", "technique": [{"id": "aat:author", "label": "author", "type": "Type"}], "type": "Production"}], "id": "http://data.duchamparchives.org/amd/archive/component/aspace_045fedb916218a034dfc8e354f07e47f/production", "timespan": {"begin_of_the_begin": "1963-02-16T00:00:00+00:00", "end_of_the_end": "1963-02-16T00:00:00+00:00", "id": "http://data.duchamparchives.org/amd/archive/component/aspace_045fedb916218a034dfc8e354f07e47f/production/timespan", "label": "1963 February 16-17", "type": "TimeSpan"}, "took_place_at": [{"id": "tgn:7014679", "label": "Utica, United States", "type": "Place"}], "type": "Production"}, "referred_to_by": [{"classified_as": ["aat:scopenote"], "id": "http://data.duchamparchives.org/amd/archive/component/aspace_045fedb916218a034dfc8e354f07e47f/scope", "type": "LinguisticObject", "value": "<p>Utica Observer Dispatch. \"200 Attend Preview Of Armory Art Show.\"; \n\"Armory Show Exhibit Opens Today in Art Museum- Renoir, Monet, van Gogh Among Anniversary Showing.\"; \n\"Eyes of Art World On Armory Exhibit.\"; \n\"Utica Artist Played Role in Exhibit.\"; \n\"Duchamp Leads A Quiet Life.\"; \n\"Art Publications Tell Utica Story.\"; \n\"Utica Man's Idea Lead to Art Search.\"; \n\"Your Weekly Calendar of Activities.\"</p>"}], "refers_to": [], "related": [], "representation": [{"id": "https://iiif.duchamparchives.org/image/iiif/2/SBK2_1961-63_25_001", "type": "VisualItem"}, {"id": "https://iiif.duchamparchives.org/image/iiif/2/SBK2_1961-63_25_002", "type": "VisualItem"}, {"id": "https://iiif.duchamparchives.org/image/iiif/2/SBK2_1961-63_25_003", "type": "VisualItem"}, {"id": "https://iiif.duchamparchives.org/image/iiif/2/SBK2_1961-63_25_004", "type": "VisualItem"}, {"id": "https://iiif.duchamparchives.org/image/iiif/2/SBK2_1961-63_25_005", "type": "VisualItem"}, {"id": "https://iiif.duchamparchives.org/image/iiif/2/SBK2_1961-63_25_006", "type": "VisualItem"}], "subject_of": [], "type": "ManMadeObject", "used_for": []} | json |
import "./weapp-adapter";
import Main from "./main";
new Main(canvas);
| javascript |
<filename>package.json<gh_stars>1-10
{
"name": "@magna_shogun/catch-decorator",
"version": "1.0.1",
"description": "Handle exceptions by just annotating a method or class with a decorator. Based on enkot/catch-decorator.",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"scripts": {
"build": "rollup --config",
"test": "npm run build && jest"
},
"repository": {
"type": "git",
"url": "git+https://github.com/omirobarcelo/catch-decorator"
},
"keywords": [
"try",
"catch",
"decorator",
"javascript",
"typescript",
"errors",
"exceptions",
"handling"
],
"author": "<NAME> <<EMAIL>>",
"license": "MIT",
"bugs": {
"url": "https://github.com/omirobarcelo/catch-decorator/issues"
},
"homepage": "https://github.com/omirobarcelo/catch-decorator#readme",
"devDependencies": {
"@types/jest": "^22.2.3",
"jest": "^23.0.1",
"rollup": "^0.59.3",
"rollup-plugin-license": "^0.7.0",
"rollup-plugin-typescript2": "^0.14.0",
"ts-jest": "^22.4.6",
"ts-loader": "^2.0.3",
"typescript": "^2.7.2"
}
}
| json |
Bigg Boss OTT, the Colors reality show, is doing well, with new drama every day. As we all know, all of the contestants were nominated last week, and on the Sunday ka Vaar episode, Ridhima Pandit and Karan Nath were evicted. Many people were taken by surprise, while others were not so much. According to the audience, these two lacked the enthusiasm required in the Bigg Boss house.
Up until now, four contestants have been eliminated. First was Urfi Javed then Ridhima and Karan and recently it was Zeeshan Khan after his fight with Pratik Sehajpal. For now, we cannot say anything but speculations are that Zeeshan will be coming back to the house. For now, his partner Divya Agarwal is alone and without any connection.
Among all, the nominated connections were Akshara-Millind, Pratik-Neha, and lastly Raqesh-Shamita. The audience had to vote for their favourite contestant/connection and keep them safe in the house. From them, Shamita and Raqesh were saved during the live voting, so they are out of the danger zone. We have two Jodis left now, but the question is whether this time two people will be evicted or just one. Anyways on the last position, we have Akshara and Millind.
Yes, these two have gotten the least number of votes and are currently in the danger zone. Akshara is getting love from her Bihari fans but it is not enough to keep her safe as Pratik on the other hand is emerging as the popular one. But looking at how things have been in the Bigg Boss house, we cannot expect anything. The Sunday ka Vaar episode could shock all of us. | english |
<reponame>fringelin/graphql
package schemabuilder
import (
"context"
"fmt"
"go/ast"
"reflect"
"strings"
)
type structFields struct {
list []*reflect.Value
nameIndex map[string]int
}
func parseFieldTag(field reflect.StructField) (skip, null, nonnull bool, name, desc string) {
if !ast.IsExported(field.Name) {
skip = true
return
}
tag := field.Tag.Get("graphql")
if tag == "" {
name = field.Name
return
}
if tag == "-" {
skip = true
return
}
split := strings.Split(tag, ";")
name = split[0]
if len(split) > 1 {
desc = split[1]
}
if len(split) > 2 {
nonnull = split[2] == "nonnull"
null = split[2] == "null"
}
return
}
func getField(source interface{}, name string) reflect.Type {
typ := reflect.TypeOf(source)
if field, ok := typ.FieldByName(name); ok {
return field.Type
}
for i := 0; i < typ.NumField(); i++ {
field := typ.Field(i)
tag := field.Tag.Get("graphql")
if tag == "" || tag == "-" {
continue
}
split := strings.Split(tag, ";")
if split[0] == name {
return field.Type
}
}
return nil
}
func getMethod(source interface{}, name string) reflect.Type {
typ := reflect.TypeOf(source)
if typ.Kind() == reflect.Ptr {
typ = typ.Elem()
}
if field, ok := typ.MethodByName(name); ok {
return field.Type
}
return nil
}
func GetField(typ reflect.Value, name string) *reflect.Value {
for i := 0; i < typ.NumField(); i++ {
field := typ.Field(i)
fieldTyp := typ.Type().Field(i)
tag := fieldTyp.Tag.Get("graphql")
if tag == "" || tag == "-" {
if fieldTyp.Name == name {
return &field
}
}
split := strings.Split(tag, ";")
if split[0] == name {
return &field
}
}
return nil
}
func Convert(args map[string]interface{}, typ reflect.Type) (interface{}, error) {
fields := structFields{
nameIndex: make(map[string]int),
}
var typPtr bool
if typ.Kind() == reflect.Ptr {
typPtr = true
typ = typ.Elem()
}
tv := reflect.New(typ).Elem()
for i := 0; i < typ.NumField(); i++ {
field := typ.Field(i)
tag := field.Tag.Get("graphql")
if tag == "-" || !ast.IsExported(field.Name) {
continue
}
tf := tv.Field(i)
fields.list = append(fields.list, &tf)
if tag == "" {
fields.nameIndex[field.Name] = len(fields.list) - 1
continue
}
split := strings.Split(tag, ";")
fields.nameIndex[split[0]] = len(fields.list) - 1
}
for k, v := range args {
if v == nil {
continue
}
var f reflect.Value
if i, ok := fields.nameIndex[k]; ok {
f = *fields.list[i]
} else {
continue
}
vv := reflect.ValueOf(v)
if err := value(f, vv); err != nil {
return nil, err
}
}
if typPtr {
return tv.Addr().Interface(), nil
}
return tv.Interface(), nil
}
func value(f reflect.Value, v reflect.Value) error {
if f.IsValid() {
f.Set(reflect.New(f.Type()).Elem())
}
for v.Kind() == reflect.Interface {
if v.IsNil() {
return nil
}
v = v.Elem()
}
for f.Kind() == reflect.Ptr {
if f.IsNil() {
f.Set(reflect.New(f.Type().Elem()))
}
f = f.Elem()
}
if f.Kind() == reflect.Slice {
if v.Kind() != reflect.Slice {
return fmt.Errorf("field %s type is slice, but value %s not", f.Type().String(), v.Type().String())
}
fs := reflect.MakeSlice(f.Type(), v.Len(), v.Len())
for i := 0; i < v.Len(); i++ {
if err := value(fs.Index(i), v.Index(i)); err != nil {
return err
}
}
f.Set(fs)
return nil
}
if f.Kind() == reflect.Map {
if v.Kind() != reflect.Map {
return fmt.Errorf("field %s type is map, but value %s not", f.Type().String(), v.Type().String())
}
fm := reflect.MakeMapWithSize(f.Type(), v.Len())
for _, k := range v.MapKeys() {
fv := reflect.New(f.Type().Elem()).Elem()
if err := value(fv, v.MapIndex(k)); err != nil {
return err
}
fm.SetMapIndex(k, fv)
}
f.Set(fm)
return nil
}
if !v.Type().ConvertibleTo(f.Type()) {
return nil
}
f.Set(v.Convert(f.Type()))
return nil
}
// Common Types that we will need to perform type assertions against.
var errType = reflect.TypeOf((*error)(nil)).Elem()
var contextType = reflect.TypeOf((*context.Context)(nil)).Elem()
| go |
In this Moonlight film, Trevante Rhodes, Andre Holland played the primary leads.
The Moonlight was released in theaters on 21 Oct 2016.
Movies like Aquaman and the Lost Kingdom, Nomadland, The Father and others in a similar vein had the same genre but quite different stories.
The soundtracks and background music were composed by Nicholas Britell for the movie Moonlight.
The movie Moonlight belonged to the Drama, genre.
| english |
<gh_stars>100-1000
{
"algorithm": "",
"chat": ["https://t.me/nemred"],
"community": ["https://www.reddit.com/r/nem"],
"description": {
"en": "NEM is a peer-to-peer crypto platform. It is written in Java and JavaScript with 100% original source code. NEM has a stated goal of a wide distribution model and has introduced new features in blockchain technology in its proof-of-importance (POI) algorithm. NEM also features an integrated P2P secure and encrypted messaging system, multisignature accounts and an Eigentrust++ reputation system."
},
"explorer": ["http://explorer.nemchina.com/", "http://chain.nem.ninja/#/blocks/0"],
"fromSymbol": "XEM",
"is_crypto": true,
"is_minable": false,
"name": "NEM",
"network": {
"t_available_supply": 8999999999,
"t_block_reward": 0,
"t_max_supply": 8999999999,
"t_total_supply": 8999999999
},
"proof_type": "PoI",
"quote": ["https://blockmodo.com/quotes/XEM"],
"social": ["https://twitter.com/@NEMofficial", "https://www.facebook.com/ourNEM"],
"source_code": ["https://github.com/NemProject/NEMiOSApp", "https://github.com/NemProject/csharp2nem"],
"toSymbol": "ALL",
"type": "COINREGISTRY",
"version": 1,
"website": "http://www.nem.io/",
"adoptedFromSymbol": "XEM"
} | json |
Mi FlipBuds Pro or Xiaomi FlipBuds Pro are the company's upcoming true wireless stereo (TWS) earbuds that have been teased to come with “active noise reduction”. Xiaomi recently shared a poster teasing the new product that also confirmed the release date to be May 13. It later also shared the name of the TWS earbuds. The Mi FlipBuds Pro will have a stem design with in-ear tips that sit securely in your ears. As of now, there is no information about the pricing and availability of the TWS earbuds.
Xiaomi took to Weibo through its Xiaomi Smart Life account to share the name of its new TWS earbuds - to be called FlipBuds Pro - along with an image of its charging case that has an indicator light on it. The TWS earbuds will launch in China on May 13 and, as of now, it is unclear if they will be released in international markets as well. The Mi FlipBuds Pro will have a stem-shaped design and come with active noise reduction of 40dB. The earbuds in the images shared on Weibo have a black finish with a matching charging case. The Xiaomi logo can be seen on the back of the case as well. That's about all the information on the Mi FlipBuds Pro revealed by the teasers.
Xiaomi has multiple TWS earbuds in its portfolio under its Mi and Redmi brands. The most recent additions were the Redmi AirDots 3 TWS earbuds that come with seven hours of battery life and aptX Adaptive support. Given that the Mi-branded TWS earbuds generally seem to get the stem design while the Redmi branded ones are more compact, it is likely that the upcoming TWS earbuds are officially called Mi FlipBuds Pro.
The Chinese company sells the Redmi Earbuds S and the Redmi Earbuds 2C in India under its Redmi brand. It also sells the Mi True Wireless Earphones 2C and the Mi True Wireless Earphones 2 under its Mi brand in the country. Since the Redmi AirDots 3 did not make their way to the Indian market, it is unclear if the Mi FlipBuds Pro will be launched here.
Catch the latest from the Consumer Electronics Show on Gadgets 360, at our CES 2024 hub.
| english |
We could call this "the trouble with the Trib," to riff on Star Trek, about its canning 11 editorial staff last week.
We start internally, as Trib tries to spin its editorial staff gutting. It is worth noting that part of the cuts are on podcasts; print and digital-print media that "pivoted" to podcasts a few Years Ago, in yet another version of the tragedy of the commons, oversaturated the market.
The Austin Chronicle has two posts about the layoffs at the Texas Tribune. The first is a big one, for multiple reasons. It notes that, first of all, there will be no more prisons and criminal justice desk at the Trib. However, there are six new hires — none in editorial. All in either general development positions or directly in sponsorship.
the NYT, claims he was never contacted about troubles at the Trib.
the "Save the Observer" did this spring.
Ev could have seen the podcast issues before he retired, as well as the dimming revenue stream. How much he dumped in Shah's lap while giving an "above the fray" statement in the first Chronicle speech is unknown but color me more skeptical than Pasztor. I mean, from memory, problems in the podcast world overall have been discussed within big media players for at least six if not nine months.
Personally, I was skeptical of the legend vs the reality of the Trib already at its five-year mark, following in the footsteps of Jim Moore. I was more skeptical at the 10-year mark, in part by doing judo on the Trib's own financials. And also at the five-year mark, I was already skeptical then about transparency issues with its sponsors and donors. (Note: I have long ago exchanged Tweets with Smith over some of this; his answers didn't impress me.)
And, in timely fashion, Nieman Lab writes about grants to newspapers. It notes that, despite grantmakers' stated preferences for nonprofits, more of their money still goes to for-profits. It also notes that conflict of interest issues are rising. And, Dick Tofel notes that more money is going to, well, folks like "field building organizations," which to put it more bluntly, probably include "incubators" like the one created of Mike Orren, late of the Snooze and of Pegasus News before that.
| english |
<reponame>i-need-nerfed/galactix
#![no_std]
mod fs;
mod memory;
| rust |
When the virgins were assembled a second time, Mordecai was sitting at the king’s gate. But Esther had kept secret her family background and nationality just as Mordecai had told her to do, for she continued to follow Mordecai’s instructions as she had done when he was bringing her up. During the time Mordecai was sitting at the king’s gate, Bigthana and Teresh, two of the king’s officers who guarded the doorway, became angry and conspired to assassinate King Xerxes. But Mordecai found out about the plot and told Queen Esther, who in turn reported it to the king, giving credit to Mordecai. And when the report was investigated and found to be true, the two officials were impaled on poles. All this was recorded in the book of the annals in the presence of the king.
| english |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.