text
stringlengths 1
1.04M
| language
stringclasses 25
values |
|---|---|
Playboy Enterprises filed suit in federal court against Excite and Netscape Communications for selling control of its trademark to online porn advertisers.
According to Playboy, when Excite and Netscape visitors search for the words playboy or playmate, advertising from other other pornography sites pop up. Playboy alleges that its trademark is being unfairly hijacked and its good name degraded.
"Excite has hijacked and usurped Playboy Enterprises' good will and reputation," the suit claims.
Cosmetics firm Estée Lauder slapped Excite with a similar suit in late January.
The outcome of the suits could have broad impact on search firms, which make a good chunk of their money selling ad banners pegged to keyword searches.
Telephony gets louder voice: Two lobbying groups that promote Internet telephony said on Thursday they agreed to merge to create a more powerful voice in defending the interests of Net-based telecommunications companies.
The Spread the Net Coalition and the Voice on the Net Coalition said the combined organization, to be called the VON Coalition, will be able to send a more unified message to policy makers, in particular the Federal Communications Commission.
The mission, in the coalition's own words, will be "to actively advocate the viewpoint that the IP telephony industry should remain as free of governmental regulations as possible."
The coalition represents companies that send voice conversations over the Internet at cheap rates. The traditional phone companies are applying intense pressure on Congress and the FCC to curtail Net-telephony companies. The VON Coalition was formed in 1996 in response to the threat of the FCC regulations and tariffs.
Founding members in the VON Coalition include 3COM, Brooktrout Technology, Cisco Systems, Deltathree, Dialogic Corporation, and Intel, among others.
CMP for sale: CMP Media, a technology magazine publisher that's been facing falling advertising for the past few months, said Thursday it hired investment bank Lazard Freres & Co. to find a potential buyer.
Michael Leeds, CMP's chief executive, said the New York company, the third-largest technology publishing firm in the United States, wants Lazard Freres to "explore strategic alternatives," but cautioned that didn't necessarily mean a deal was in the works.
"The goal of this process is to enable us to maximize stockholder value, expand our ability to provide new products and services to our customers, and enhance career opportunities for our employees," Leeds said.
It has been a turbulent year for CMP, which publishes a half dozen computer titles, including InternetWeek, Information Week, and Computer Reseller News. Disappointing earnings caused in part by the company's acquisition of Byte, sent CMP's stock into a tailspin last fall. A downturn in technology advertising forced CMP to fold LAN Times, a computer-networking publication, in October.
MarketWatch on CompuServe: The CompuServe unit of America Online said on Thursday it agreed to build a financial news center with MarketWatch.com.
MarketWatch will serve as a key content provider on CompuServe's main menu and in its new Personal Finance Channel. In addition, CompuServe signed agreements with BigCharts and Thomson Investor's Network to contribute to the financial information site.
CompuServe's Personal Finance Channel offers online trading, stock lists, and portfolios.
|
english
|
I was looking through my cryptocurrency spreadsheet last night (that post has almost 9k views!), and I realized I haven't been trading much lately. Altcoins have been going down so a handful of my coins are worth less than what I paid. Previously I was using profits to invest in new things. I'm not good at letting go once I buy in because if I think the project has merit, I also think eventually others will also and the price will go back up after a dip. It's also possible I bought some crap coins that will never be taken seriously. Time will tell, I guess.
I also remember the excitement of buying BTS and PIVX before they blew up in price, and I thought, "I'd love to do something like that again."
Yesterday, @msg768 surprised me with a tip from a tipbot on Steemit I had never heard of.
SmartCash? What's that all about?
So that's what I did last night. I started reading up about it, and it really caught my interest.
SmartCash is a community governance, cooperation & growth focused blockchain based currency & a decentralized economy.
The website looks solid, it has a nice web wallet (which I signed up for and moved the coins I was given to), and joined the Slack channel to chat a bit with the team. I was reminded of the way BitShares creates worker proposals funded by the blockchain via voting.
Then I realized this is the same coin @heiditravels mentioned in her recent video: Blockchain Tech is Bringing Honesty Back to Charities. It seems someone created a proposal to help feed people in Venezuela. How freaking cool is that?!?
So then I got even more interested. The volume on this thing is really low as you can see here:
It's not even on Bittrex yet. I had to create an account on Cryptopia to buy some (note: that is a referral link). This is where my "haven't been trading lately" side got overruled by my "I want to see a new project moon!" side. I got out my Ledger Nano S and decided to give it a shot. I bought just a bit last night and a bit more today and I have a buy order in for some more.
Could this go down a lot from here? For sure! At the same time, if it goes from $0.02 to $0.04 then I doubled my money (assuming I sell). The more I learn about this project, the more I think they have some real players involved, and it might be one worth holding.
The @smartbot is pretty cool, for sure, and my hunch is you're going to be hearing a lot more about SmartCash here on Steemit because of this proposal for Steemit banner ads which looks like it will get funded:
If Steemit starts getting flooded with news about SmartCash, you can say you heard it here first. :)
I really like their "Hive Teams" concept. Instead of a single group of core developers, they have different "hives" which are focusing their efforts in different ways. They've made some good progress on their roadmap as well.
One of the things that caught my attention right away was their SmartRewards idea.
SmartRewards are a price stabilization mechanism and a way to encourage long term holding. Long term holders are key to the project’s success since the SmartHive treasury needs SmartCash to appreciate in value in order to fund meaningful 3rd party proposals and help grow SmartCash into a successful global crypto-currency. Each wallet address holding at least 1000 SmartCash will get paid each 30 days on the 25th and the snapshot for the next month will happen at the same time. The SmartRewards will come out of the 15% block reward allocation.
This is like staking rewards without having to have a wallet open and running all the time. Similar to how Neo rewards token holders with Gas tokens, but the catch here is you can't move your coins. If you move them, you aren't eligible for that month's SmartRewards. For this reason, it's a good idea to have a spending wallet address separate from a staking address. The web wallet creates three addresses by default, one for spending and two for staking. It doesn't matter which one you use as long as you don't touch the funds for more than 30 days.
You can use this SmartRewards calculator to see what the current SmartRewards are for this coming month.
I haven't used the renew function yet, but it seems to be built into the full wallet client based on the Zerocoin protocol. True cryptographic anonymity may become more and more of an important thing in the future. It's not yet implemented in the web wallet, but asking around in the Slack channel I found it will be implemented after the ability to vote.
The block explorer is nice: https://explorer.smartcash.cc/. It's where I found the rich list of the top 100 token holding addresses.
Whoa! What's up with that address holding 55% of all the tokens? Also, 80% of the newly minted coins goes to these addresses (that's a lot!) I started grilling the team in Slack about that and about who controls those addresses. Unlike BitShares worker proposals which are controlled via the blockchain, currently SmartCash distributes value manually. That means humans are involved. That means we have to trust someone not to steal the coins and dump them on the market. As I pressed in further, I found the individuals who control these funds are anonymous (though I did have two people direct message me and let me know they knew who they were, but did not reveal them—nor did I ask them to). Essentially, they are trying to protect these individuals to ensure someone doesn't show up at their house and harass them. It's probably safe to say "the founders" control those addresses.
So how big of a problem is that? Well, the point of cryptocurrencies is to eliminate the need for trust. It's a trust-less system which relies on protocols for pre-determined outcomes. To me, this is a big risk. And yet, at the same time, Steemit, inc essentially followed the same model. They mined most of the tokens here via the @steemit account and they use those funds to onboard new users and support development. So far, it seems SmartCash funds from these accounts are being used in a similar way.
We should always be concerned when a project is centralized like this. At the same time, after grilling the team there in slack quite a bit, I do think they are sincerely working towards decentralizing things as much as possible in the future. The leaders of the hives have access to the funds and, so far, it seems there hasn't been any abuse (that I know of). As a programmer, I'm a fan of doing something manually first until you understand it well enough to automate it. That seems to be the model they are following as well.
So, having looked into the project since last night, I decided to write this post about it. Please don't take this as investment advice as I'm not an investment advisor. This is just my story which I thought you might enjoy. There are no guarantees in cryptocurrency, and it's possible the small amount I've already invested may go way down and stay there. There's also the slight chance this project could blow up, get added to some big exchanges, and be a lot of fun. That would be exciting.
Either way, do your own research and see what you come up with. I decided to write this post once I learned enough about the project, but I think I'll also submit it to some of the contests they have going on to see if I can earn some rewards that way as well. Does that make this a "pay to post" blog entry? Not to me. I was going to do it anyway and found out about the contests like this and this later on (thanks for letting me know, @decentralizd).
So there you have it. I'm not staking my reputation on this one, but I do think it's interesting enough to check out. Let me know what you think.
|
english
|
<filename>src/media/stream_processors/test/h264_decoder_test/lib.rs
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#![feature(async_await, await_macro)]
#![cfg(test)]
mod h264;
use crate::h264::*;
use lazy_static::lazy_static;
use parking_lot::Mutex;
use std::{rc::Rc, sync::Arc};
use stream_processor_decoder_factory::*;
use stream_processor_test::*;
use video_frame_hasher::*;
lazy_static! {
// We use a test lock to prevent any tests from running in parallel.
//
// Running in parallel is something we want to control for specific tests cases especially
// when testing hardware stream processors.
//
// This can be removed in the future if we get a static way to specify environment variables
// for a component, so we can set `RUST_TEST_THREADS=1` for this component.
static ref TEST_LOCK: Arc<Mutex<()>> = Arc::new(Mutex::new(()));
static ref LOGGER: () = ::fuchsia_syslog::init().expect("Initializing syslog");
static ref BEAR_DIGEST: ExpectedDigest = ExpectedDigest::new(
"bear.h264 decoded digest",
"1dc4d1510fc4d26173480f5e689e38dca7c1fa2df1894085f1bcee9c0d19acf7",
);
}
// TODO(turnage): Add test spec for buffers released between streams.
// TODO(turnage): Add hash validator for NV12 and YV12.
#[fuchsia_async::run_singlethreaded]
#[test]
async fn serial_bear_on_same_codec() -> std::result::Result<(), ::failure::Error> {
let _lock = TEST_LOCK.lock();
*LOGGER;
let stream = Rc::new(TimestampedStream {
source: H264Stream::from_file(BEAR_TEST_FILE)?,
timestamps: 0..,
});
let frame_count_validator = Rc::new(OutputPacketCountValidator {
expected_output_packet_count: stream.video_frame_count(),
});
let hash_validator = Rc::new(VideoFrameHasher { expected_digest: *BEAR_DIGEST });
let spec = TestSpec {
cases: vec![
TestCase {
name: "Simple bear test run 1 on same channel",
stream: stream.clone(),
validators: vec![
Rc::new(TerminatesWithValidator {
expected_terminal_output: Output::Eos { stream_lifetime_ordinal: 1 },
}),
frame_count_validator.clone(),
hash_validator.clone(),
],
stream_options: None,
},
TestCase {
name: "Simple bear test run 2 on same channel",
stream,
validators: vec![
Rc::new(TerminatesWithValidator {
expected_terminal_output: Output::Eos { stream_lifetime_ordinal: 3 },
}),
frame_count_validator,
hash_validator,
],
stream_options: Some(StreamOptions {
queue_format_details: false,
..StreamOptions::default()
}),
},
],
relation: CaseRelation::Serial,
stream_processor_factory: Rc::new(DecoderFactory),
};
await!(spec.run())
}
|
rust
|
A famous saying rules Bollywood, which states 'Stars are born, not made'. Amidst the thousands and lakhs of known and unknown faces, lies a 'Born Star' named Randeep Hooda, who celebrates his birthday today. Born in a simple family, his mother being a social worker and father, a doctor, this dude went onto to do his Masters in Business Management & Human Resource Management, something that very few people in tinsel town can boast of. Randeep is also the man, to whom one can attribute the works like peeling onions in a Chinese restaurant, working in a car-wash, and even driving taxis. Randeep made his acting debut with his famous NRI do in the hit film Monsoon Wedding. What followed later were films like D, Risk, Darna Zaroori Hai etc... One common factor that binds these films is a fact that irrespective of the film's B-O reports, Randeep stood out like a shooting star! Join us as we put our hands together in wishing this star a Very Happy Birthday, simply by positing your wishes below.
Catch us for latest Bollywood News, New Bollywood Movies update, Box office collection, New Movies Release , Bollywood News Hindi, Entertainment News, Bollywood Live News Today & Upcoming Movies 2024 and stay updated with latest hindi movies only on Bollywood Hungama.
|
english
|
import getLastClipboardData from './getLastClipboardData';
import Ribbon from './Ribbon';
import {
ChangeSource,
ClipboardData,
EditorPlugin,
IEditor,
PluginEvent,
PluginEventType,
} from 'roosterjs-editor-types';
export default class RibbonPlugin implements EditorPlugin {
editor: IEditor;
ribbon: Ribbon;
getName() {
return 'Ribbon';
}
initialize(editor: IEditor) {
this.editor = editor;
}
dispose() {
this.editor = null;
}
getEditor() {
return this.editor;
}
refCallback = (ref: Ribbon) => {
this.ribbon = ref;
};
onPluginEvent(event: PluginEvent) {
if (this.ribbon) {
if (
event.eventType == PluginEventType.KeyDown ||
event.eventType == PluginEventType.MouseUp
) {
const wrapper = getLastClipboardData(this.editor);
wrapper.data = null;
this.ribbon.forceUpdate();
} else if (event.eventType == PluginEventType.ContentChanged) {
const wrapper = getLastClipboardData(this.editor);
if (event.source == ChangeSource.Paste) {
wrapper.data = event.data as ClipboardData;
} else {
wrapper.data = null;
}
this.ribbon.forceUpdate();
} else if (event.eventType == PluginEventType.EditorReady) {
this.ribbon.forceUpdate();
}
}
}
}
|
typescript
|
// jest knows this is a test file because it's named whatever-the-fuck-name-Im-using.test.js
'use strict';
const supertest = require ('supertest');
const app = require('../server/app.js');
const request = supertest(app);
// jest injects values and objects into our runtime environment, and we call this special version of the runtime the "test environment"
describe('Testing our HTTP API', () => {
// "it" is a method from jest, which uses the callback function in the 2nd argument to test your code.
it('Respond with status 200 to GET request to /hello route', async () => {
// We need async...await for the test to wait for the request to complete
const response = await request.get('/hello');
expect(response.status).toEqual(200);
});
});
|
javascript
|
Fifty-nine MPs from 19 political parties have written to the German ambassador to New Delhi seeking his intervention to ensure the return of an Indian child who was placed in Berlin’s child welfare custody in September 2021, reported PTI.
The child was seven months old when she suffered an accidental injury in the perineum for which she was hospitalised. Following an investigation into the possibility of child sexual abuse, the German authorities had put her in foster care, alleging harassment by her parents Dhara and Bhavesh Shah.
However, in February 2022, the case against the Shahs was closed and the hospital where the child had been admitted ruled out sexual abuse as the reason for the injury, reported PTI.
On Friday, the group of 59 MP urged German envoy, Philipp Ackerman, to send the child back to her parents since the charges against them have been dropped.
The signatories of the letter include Congress leader in Lok Sabha Adhir Ranjan and his party colleagues Praneet Kaur, Shashi Tharoor, Nationalist Congress Party’s Supriya Sule, Dravida Munnetra Kazhagam’s Kanimozhi Karunanidhi, Trinamool Congress’ Mahua Moitra, National People’s Party’s Agatha Sangma, Shiromani Akali Dal’s Harsimrat Kaur Badal, Bharatiya Janata Party’s Maneka Gandhi, and National Conference’s Farooq Abdullah.
The MPs noted that the case took a year-and-a-half for an evaluation of the parents by a court-appointed psychologist and the German child services pressed for permanent custody of the child.
The MPs also said that the decision to move the child from one carer to another could cause deep trauma.
On Friday, External Affairs Ministry spokesperson Arindam Bagchi had said at a press conference that India has been “persistently advocating” for returning the child to her parents.
“The [Indian] Embassy has repeatedly requested German authorities to ensure that [the child’s] connection with her cultural, religious and linguistic background is not compromised and sought consular access to the child as well as cultural immersion at the Indian Cultural Centre in Berlin,” Bagchi said.
|
english
|
<gh_stars>1-10
{% extends 'base.html' %}
{% block title %}
{{ current_user.first_name }} | {{ current_user.last_name }}
{% endblock %}
{% block content %}
{% if current_user.is_authenticated %}
<div align="center">
<br/>
<img src="https://i5.walmartimages.com/asr/203a0700-5368-4e2a-bc67-a5dadde04f30_1.bbd191a726fcfcb655675d37380fbd18.jpeg"
alt="back_cat" width="250" height="350">
<br/>
<br/>
<div class="container">
<div class="row">
<div class="col md-12">
<div class="jumbotron p-3" align="center" style="color:#343a40">
<h2>{{ current_user.first_name }} {{ current_user.last_name }}
<br/>
<small> <i style="color:pink"> here you can </i> </small>
<br/>
Manage Your Account
</h2>
<table class="table table-hover table-dark">
<thead>
<tr>
<th>ID</th>
<th>First Name</th>
<th>Last Name</th>
<th>Date of Birth</th>
<th>Email Address</th>
<th>Department</th>
<th>Salary</th>
<th>Update</th>
<th>Assign</th>
<th>Delete</th>
</tr>
</thead>
<tr>
<td>{{current_user.id}}</td>
<td>{{current_user.first_name}}</td>
<td>{{current_user.last_name}}</td>
<td>{{current_user.date_of_birth}}</td>
<td>{{current_user.email_address}}</td>
{% if current_user.department %}
<td>{{current_user.department}}</td>
{% else %}
<td> TBD </td>
{% endif %}
{% if current_user.salary %}
<td>$ {{current_user.salary}}</td>
{% else %}
<td> TBD </td>
{% endif %}
<td>
<a href="{{ url_for('user.update_employee', id=current_user.id) }}"
class="btn btn-warning btn-sm">
Update
</a>
</td>
<td>
<a href="{{ url_for('user.assign_employee', id=current_user.id) }}"
class="btn btn-success btn-sm">
Assign
</a>
</td>
<td>
<button type="button" class="btn btn-danger btn-sm" data-toggle="modal"
data-target="#exampleModalCenter{{current_user.id}}">
Delete
</button>
<div class="modal fade" id="exampleModalCenter{{current_user.id}}">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content" style="color:black">
<div class="modal-header">
<h5 align="center">
Deleting Account Permanently
</h5>
<button type="button" class="close" data-dismiss="modal"
aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body" align="center">
<p>Do you really want me to delete</p>
<h3>{{current_user.first_name}} {{current_user.last_name}} account?</h3>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">
Cancel
</button>
<form action="{{ url_for('user.delete_employee', id=current_user.id) }}"
method="post">
<input type="submit" value="Delete" class="btn btn-danger">
</form>
</div>
</div>
</div>
</div>
</td>
</tr>
</table>
<!-- Modal -->
<div class="modal fade" id="deleteModal" tabindex="-1" role="dialog"
aria-labelledby="deleteModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="deleteModalLabel">Delete Post?</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close
</button>
<form action="{{ url_for('user.delete_employee', id=current_user.id) }}"
method="POST">
<input class="btn btn-danger" type="submit" value="Delete">
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{% endif %}
{% endblock %}
|
html
|
Tamil writer Udaya Shankar has won the Sahitya Akademi’s Bal Puraskar award for his novel Adhanin Bommai. Ram Thangam, author of the short story collection Thirukarthiyal, won the Yuva Puraskar award.
The awardees will get a casket containing an engraved copper plaque and a cheque of ₹50,000 at a function, which will be held in Delhi.
Adhanin Bommai is based on the archaeological excavation in Keezhadi while Thirukarthiyal offers a glimpse of life in Nanjil Nadu in Kanniyakumari district.
Chief Minister M. K. Stalin has congratulated the awardees. “By writing about Keezhadi, Mr. Udaya Shankar has helped the young generation to know about our roots. Ram Thangam’s Thirukarthiyal has poignantly captured hunger and poverty one faces in young age,” the Chief Minister tweeted.
|
english
|
” Movie Tonight “, she messaged.
” Why not “, I replied without having any second thought.
We were located at separate locations, a couple of weeks back I texted her; “I am going to visit your city, let’s catch up”. Long distance gives you space and helps to create bonding that get build with help of every text message which says “take care”. It might be single message but it have deep meaning. Journey from friend zone to being in relationship is sweetest thing ever. It is beautiful thing to know that someone is there for us, someone will stand for us.
Few people thinks long distance relationship wont work. There could be other distracting , tempting objects around us but it’s up to you. How you are connected with each other. Exchange of gifts, greeting cards and feelings for each other’s keep relationship alive. It doesn’t required expensive gifts to make it alive but it require a gift that connects you. Couple Coffee mug is one of them, its just mug but it gives feeling of having coffee together.
Once we were chatting at late night and I said, “ice cream khane ka maan kar raha yaar”. And exactly after 20 minutes doorbell rang where zomato guy delivered an ice cream ordered by her. Later we shared an ice cream over video call. That’s how technology helped us to stay connected .
At end it is important to have meaningful relationship.
-“Lets catch on MG road”, I took a cab and texted.
-“I am in Cab,”.
-Yes, I remember those moments, goodbyes are hard.
-That time I had thought to ask you, if I can hug you for being there for me. But I had a second thought that you might not like that because it was our first meet. I was never so comfortable with someone.
-Haso mat (don’t laugh)
Sach bol raha (its truth ).
-What you think, what would have been my reaction if you had hugged me that time.
-It would have been positive. Because I felt some bond.
-Same here.
– I don’t know-how would have reacted that time but it wouldn’t be negative.
|
english
|
<filename>test/device/resources/device.ts
import { Connectivity, ConnectivityType, DeviceType } from '../../../src/device/template/model';
export const deviceCreationDto = {
connectivityType: Connectivity.MQTT_BROKER,
defaultBinding: false,
deviceKey: '',
firmwareUpdateType: null,
name: 'WRT - CREATED WITHOUTH MANIFEST',
protocol: 'JsonProtocol',
type: DeviceType.STANDARD
};
export const failCreationDto = {
connectivityType: Connectivity.MQTT_BROKER,
defaultBinding: false,
deviceKey: '',
firmwareUpdateType: null,
name: 'WRT - CREATED WITHOUTH MANIFEST',
protocol: 'JsonProtocol',
type: 'SREM'
};
export const jasperCreationDto = {
connectivityParameters: { ICCID: '89462036051001511713' },
connectivityType: Connectivity.MQTT_JASPER as Connectivity.MQTT_JASPER,
defaultBinding: false,
deviceKey: 'WRTJASPER',
firmwareUpdateType: null,
name: 'WRT - JASPER',
protocol: 'JsonProtocol',
type: DeviceType.STANDARD
};
export const loRaCreationDto = {
connectivityParameters: { appKey: 'EFEFEFEFEFEFEFEFEFEFEFEFEFEEFEFF' },
connectivityType: <Connectivity.TTN>Connectivity.TTN,
defaultBinding: false,
deviceKey: 'ABAABBABABBABBAB',
firmwareUpdateType: null,
name: 'WRT-LoRa_Device',
protocol: 'JsonMultiReferenceProtocol',
type: DeviceType.STANDARD
};
|
typescript
|
# c_labs
First semester in M3102
|
markdown
|
@import '~nativescript-theme-core/css/core.light.css';
.btn {
padding: 4 10;
}
.message {
text-align: center;
margin: 10 0;
padding: 6 16;
color: #ffffff;
background-color: #cccccc;
border-radius: 50%;
}
.device-id {
font-size: 13;
color: #aaaaaa;
}
.device-name {
font-size: 16;
font-weight: bold;
color: #333333;
}
.function-name,
.variable-name {
font-size: 14;
color: #333333;
}
.device-type,
.variable-type {
font-size: 11;
color: #ffffff;
padding: 2 5;
background-color: #cccccc;
border-radius: 50%;
margin-left: 6;
vertical-align: center;
}
|
css
|
Le test a été réalisé le :
|
markdown
|
# SPDX-License-Identifier: MIT
import docker
import os
import sys
from bobber.__version__ import __version__ as version
from bobber.lib.exit_codes import (CONTAINER_NOT_RUNNING,
CONTAINER_VERSION_MISMATCH,
DOCKER_BUILD_FAILURE,
DOCKER_COMMUNICATION_ERROR,
NVIDIA_RUNTIME_ERROR)
from bobber.lib.system.file_handler import update_log
from docker.models.containers import Container
from typing import NoReturn, Optional
class DockerManager:
"""
Build, launch, and execute commands for Docker containers.
The DockerManager provides a single interface accessible from the entire
Bobber package in which to communicate with Docker containers. The class
provides the ability to build new containers based on the provided
Dockerfile, launch the container with necessary settings for tests, and
execute commands inside the launched container to run tests. An instance
of this class is created in the bobber.lib.docker.__init__.py module which
can be access from other modules without re-instantiating the class.
"""
def __init__(self) -> NoReturn:
try:
self.client = docker.from_env()
self.cli = docker.APIClient(timeout=600)
except docker.errors.DockerException as e:
if 'error while fetching server api version' in str(e).lower():
print('Error: Could not communicate with the Docker daemon.')
print('Ensure Docker is running with "systemctl start docker"')
sys.exit(DOCKER_COMMUNICATION_ERROR)
def _build_if_not_built(self, tag: str, bobber_version: str) -> NoReturn:
"""
Build the image if not built already.
Check if an image exists for the local version of Bobber. If not, build
the image immediately.
Parameters
----------
tag : string
A ``string`` of the Bobber image name, such as
'nvidia/bobber:5.0.0'.
bobber_version : string
A ``string`` of the local version of Bobber, such as '5.0.0'.
"""
try:
self.client.images.get(tag)
except docker.errors.ImageNotFound:
print(f'Image {tag} not built, building now...')
self.build(bobber_version)
def get_tag(self, bobber_version: str) -> str:
"""
Create the image name.
Build the full image name including the tag, such as
'nvidia/bobber:5.0.0'.
Parameters
----------
bobber_version : string
A ``string`` of the local version of Bobber, such as '5.0.0'.
Returns
-------
str
Returns a ``string`` of the full image name plus tag, such as
'nvidia/bobber:5.0.0'.
"""
return f'nvidia/bobber:{bobber_version}'
def cast(self, storage_path: str, ignore_gpu: bool,
bobber_version: str) -> NoReturn:
"""
Launch a container with necessary settings.
Launch a Bobber image with various settings required to initiate the
testing framework, including attaching GPUs, starting an SSH daemon,
setting the container to privileged mode, and attaching a filesystem
to be accessible inside the container.
The launched container will be based off of the Bobber image for the
current version of the application. If the image does not yet exist,
it will be built automatically. The launched container is named
'bobber'.
Parameters
----------
storage_path : string
A ``string`` of the absolute path to the storage location to test
against, such as `/mnt/storage`.
ignore_gpu : boolean
When `True`, launches the container without GPU resources. Defaults
to `False`.
bobber_version : string
A ``string`` of the local version of Bobber, such as '5.0.0'.
"""
tag = self.get_tag(bobber_version)
self._build_if_not_built(tag, bobber_version)
runtime = None
if not ignore_gpu:
runtime = 'nvidia'
try:
self.client.containers.run(
tag,
'bash -c "/usr/sbin/sshd; sleep infinity"',
detach=True,
auto_remove=True,
ipc_mode='host',
name='bobber',
network_mode='host',
privileged=True,
shm_size='1G',
runtime=runtime,
ulimits=[
docker.types.Ulimit(name='memlock',
soft=-1,
hard=-1),
docker.types.Ulimit(name='stack',
soft=67108864,
hard=67108864)
],
volumes={
f'{storage_path}': {
'bind': '/mnt/fs_under_test',
'mode': 'rw'
}
}
)
except docker.errors.APIError as e:
if 'Unknown runtime specified nvidia' in str(e):
print('NVIDIA container runtime not found. Ensure the latest '
'nvidia-docker libraries and NVIDIA drivers are '
'installed.')
sys.exit(NVIDIA_RUNTIME_ERROR)
def export(self, bobber_version: str) -> NoReturn:
"""
Save an image as a tarball.
To make it easy to transfer an image to multiple machines, the image
can be saved as a tarball which can be copied directly to a remote
device. On the other device, run the "load" command to load the copied
tarball.
Parameters
----------
bobber_version : string
A ``string`` of the local version of Bobber, such as '5.0.0'.
"""
tag = self.get_tag(bobber_version)
self._build_if_not_built(tag, bobber_version)
filename = tag.replace('/', '_').replace(':', '_')
print(f'Exporting {tag} to "{filename}.tar". This may take a while...')
image = self.cli.get_image(tag)
with open(f'{filename}.tar', 'wb') as image_file:
for chunk in image:
image_file.write(chunk)
print(f'{tag} saved to {filename}.tar')
def build(self, bobber_version: str) -> NoReturn:
"""
Build the image on the Dockerfile.
Build a new image based on the Dockerfile named
'nvidia/bobber:{version}'.
Parameters
----------
bobber_version : string
A ``string`` of the local version of Bobber, such as '5.0.0'.
"""
tag = self.get_tag(bobber_version)
print('Building a new image. This may take a while...')
# Set the path to the repository's parent directory.
path = os.path.dirname(os.path.abspath(__file__))
path = '/'.join(path.split('/')[:-2])
output = self.cli.build(path=path,
dockerfile='lib/docker/Dockerfile',
tag=tag,
decode=True)
for line in output:
if 'error' in line.keys():
print(line['error'].rstrip())
print(f'{tag} build failed. See error above.')
sys.exit(DOCKER_BUILD_FAILURE)
if 'stream' in line.keys() and line['stream'].strip() != '':
print(line['stream'].rstrip())
print(f'{tag} successfully built')
def load(self, filename: str) -> NoReturn:
"""
Load a Docker image from a tarball.
If a Bobber image was saved as a tarball using the "export" command, it
can be loaded on the system using the "load" command.
Parameters
----------
filename : string
A ``string`` of the filename for the local tarball to load, such as
'./nvidia_bobber_5.0.0.tar'.
"""
print(f'Importing {filename}. This may take a while...')
with open(filename, 'rb') as image_file:
self.client.images.load(image_file)
def execute(self, command: str, environment: Optional[dict] = None,
log_file: Optional[str] = None) -> NoReturn:
"""
Execute a command against the running container.
Assuming the Bobber container is already launched from the "cast"
command, execute a specific command and stream the output to the
terminal. Optionally specify a dictionary with any necessary
environment variables and a log file to save the output to.
Parameters
----------
command : string
A ``string`` of the command to run inside the container.
environment : dict (Optional)
A ``dictionary`` of environment variables to use where the keys are
the name of the variable and the values are the corresponding value
to set.
log_file : string (Optional)
A ``string`` of the path and filename to optionally save output to.
"""
if not self.running:
print('Bobber container not running. Launch a container with '
'"bobber cast" prior to running any tests.')
sys.exit(CONTAINER_NOT_RUNNING)
bobber = self.client.containers.get('bobber')
if not self.version_match(bobber):
print('Bobber container version mismatch.')
print('Kill the running Bobber container with "docker kill bobber"'
' and re-cast a new container with "bobber cast" prior to '
'running any tests.')
sys.exit(CONTAINER_VERSION_MISMATCH)
result = bobber.exec_run(
command,
demux=False,
environment=environment,
stream=True
)
# Continually print STDOUT and STDERR until there is nothing left
while True:
try:
output = next(result.output).decode('ascii')
print(output.rstrip())
if log_file:
update_log(log_file, output)
# Usually only happens for terminating characters at the end of
# streams
except UnicodeDecodeError:
print(result.output)
except StopIteration:
break
def version_match(self, container: Container) -> bool:
"""
Determine if the Bobber container version matches the application.
The running Bobber container version must match the local Bobber
application version to ensure all tests will function properly.
Parameters
----------
container : Container
A ``Container`` object representing the running Bobber image.
Returns
-------
bool
Returns `True` when the versions match and `False` when not.
"""
if f'nvidia/bobber:{version}' not in container.image.tags:
return False
return True
@property
def running(self) -> bool:
"""
Determine if the Bobber container is running on the system.
Check to see if the current version of the Bobber container is running
on the local machine and return the status. This method can be used to
determine whether or not to run a command that depends on the container
being launched.
Returns
-------
bool
Returns `True` when the container is running and `False` when not.
"""
try:
bobber = self.client.containers.get('bobber')
except docker.errors.NotFound:
return False
else:
return True
|
python
|
<reponame>smalltong02/Bruce-Ma
#include "stdafx.h"
#include "hookimpl.h"
#include "HookImplementObject.h"
#include "utils.h"
#include "exploitmpl.h"
#include "UniversalObject.h"
using namespace cchips;
processing_status WINAPI CHookImplementObject::detour_virtualAlloc(detour_node* node, LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect)
{
EXPLOIT_PRE_BEGIN(node)
#ifdef _X86_
do {
CHECK_COMMON_EXPLOIT()
} while (0);
#endif
return processing_continue;
}
processing_status WINAPI CHookImplementObject::detour_virtualAllocEx(CHookImplementObject::detour_node* node, HANDLE hProcess, LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect)
{
EXPLOIT_POST_BEGIN(node)
#ifdef _X86_
do {
CHECK_COMMON_EXPLOIT()
if (flAllocationType != MEM_COMMIT)
break;
// we only check it when target process is current process
// this might fix mantis: 0492346
if (hProcess != GetCurrentProcess())
break;
if (flProtect != PAGE_EXECUTE_READ && flProtect != PAGE_EXECUTE_READWRITE)
break;
std::vector<PVOID> frame_chains;
WalkFrameCurrentChain(frame_chains);
if (!frame_chains.size()) return processing_continue;
for (const auto& chain : frame_chains) {
if (CheckExploitFuncs::AddressInModule(reinterpret_cast<ULONG_PTR>(chain), node->hook_implement_object->GetSpecialModuleInfo().m_self_info)) {
continue;
}
if (CheckExploitFuncs::AddressInModule(reinterpret_cast<ULONG_PTR>(chain), node->hook_implement_object->GetSpecialModuleInfo().m_vbe_info)) {
if (CheckExploitFuncs::CheckStackInstruction(reinterpret_cast<ULONG_PTR>(chain))) {
exploit_log("\"API\": \"{}\", \"reason\": {}", node->function->GetName(), CheckExploitFuncs::e_reason_vbe_suspicious);
}
}
else {
std::shared_ptr<CObObject> return_ptr = node->function->GetIdentifier(SI_RETURN);
if (!return_ptr) return processing_continue;
std::any anyvalue = return_ptr->GetValue(static_cast<char*>(node->return_va));
if (!anyvalue.has_value() || anyvalue.type() != typeid(PVOID))
return processing_continue;
if (PVOID virtual_addr = std::any_cast<PVOID>(anyvalue); virtual_addr != nullptr) {
if (CheckExploitFuncs::ValidStackPointer(reinterpret_cast<ULONG_PTR>(virtual_addr))) {
exploit_log("\"API\": \"{}\", \"reason\": {}", node->function->GetName(), CheckExploitFuncs::e_reason_allocate_exec_stack);
}
}
}
}
} while (0);
#endif
return processing_continue;
}
processing_status WINAPI CHookImplementObject::detour_virtualProtectEx(detour_node* node, HANDLE hProcess, LPVOID lpAddress, SIZE_T dwSize, DWORD flNewProtect, LPDWORD lpflOldProtect)
{
EXPLOIT_POST_BEGIN(node)
#ifdef _X86_
do {
CHECK_COMMON_EXPLOIT()
// we only check it when target process is current process
// this might fix mantis: 0492346
if (hProcess != GetCurrentProcess())
break;
if (flNewProtect != PAGE_EXECUTE_READ && flNewProtect != PAGE_EXECUTE_READWRITE)
break;
std::vector<PVOID> frame_chains;
WalkFrameCurrentChain(frame_chains);
if (!frame_chains.size()) return processing_continue;
for (const auto& chain : frame_chains) {
if (CheckExploitFuncs::AddressInModule(reinterpret_cast<ULONG_PTR>(chain), node->hook_implement_object->GetSpecialModuleInfo().m_self_info)) {
continue;
}
if (CheckExploitFuncs::AddressInModule(reinterpret_cast<ULONG_PTR>(chain), node->hook_implement_object->GetSpecialModuleInfo().m_vbe_info)) {
if (CheckExploitFuncs::CheckStackInstruction(reinterpret_cast<ULONG_PTR>(chain))) {
exploit_log("\"API\": \"{}\", \"reason\": {}", node->function->GetName(), CheckExploitFuncs::e_reason_vbe_suspicious);
}
continue;
}
if (CheckExploitFuncs::ValidStackPointer(reinterpret_cast<ULONG_PTR>(lpAddress))) {
exploit_log("\"API\": \"{}\", \"reason\": {}", node->function->GetName(), CheckExploitFuncs::e_reason_allocate_exec_stack);
}
}
} while (0);
#endif
return processing_continue;
}
processing_status WINAPI CHookImplementObject::detour_createProcessA(detour_node* node, LPCSTR lpApplicationName, LPSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
{
EXPLOIT_PRE_BEGIN(node)
#ifdef _X86_
do {
CHECK_COMMON_EXPLOIT()
std::shared_ptr<CHookImplementObject> impl_ptr = node->hook_implement_object;
if (lpApplicationName) {
std::string str_name = lpApplicationName;
if (impl_ptr->GetCategoryPtr()->IsDangerousCommand(str_name)) {
exploit_log("\"API\": \"{}\", \"reason\": {}, \"command\": \"{}\"", node->function->GetName(), CheckExploitFuncs::e_reason_danger_process, str_name);
}
else {
//if (CheckTaintList((LPWSTR)lpApplicationName)) {
// FOUND_EXPLOIT(EXPLOIT_REASON_SUSPICIOUS_PROCESS, NULL);
//}
}
}
else if (lpCommandLine) {
std::string str_name = lpCommandLine;
if (impl_ptr->GetCategoryPtr()->IsDangerousCommand(str_name)) {
exploit_log("\"API\": \"{}\", \"reason\": {}, \"command\": \"{}\"", node->function->GetName(), CheckExploitFuncs::e_reason_danger_process, str_name);
}
else {
//if (CheckTaintList((LPWSTR)lpApplicationName)) {
// FOUND_EXPLOIT(EXPLOIT_REASON_SUSPICIOUS_PROCESS, NULL);
//}
}
}
} while (0);
#endif
return processing_continue;
}
processing_status WINAPI CHookImplementObject::detour_createProcessW(detour_node* node, LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
{
EXPLOIT_PRE_BEGIN(node)
#ifdef _X86_
do {
CHECK_COMMON_EXPLOIT()
std::shared_ptr<CHookImplementObject> impl_ptr = node->hook_implement_object;
if (lpApplicationName) {
std::wstring wstr_name = lpApplicationName;
if (impl_ptr->GetCategoryPtr()->IsDangerousCommand(W2AString(wstr_name))) {
exploit_log("\"API\": \"{}\", \"reason\": {}, \"command\": \"{}\"", node->function->GetName(), CheckExploitFuncs::e_reason_danger_process, W2AString(wstr_name));
}
else {
//if (CheckTaintList((LPWSTR)lpApplicationName)) {
// FOUND_EXPLOIT(EXPLOIT_REASON_SUSPICIOUS_PROCESS, NULL);
//}
}
}
else if (lpCommandLine) {
std::wstring wstr_name = lpCommandLine;
if (impl_ptr->GetCategoryPtr()->IsDangerousCommand(W2AString(wstr_name))) {
exploit_log("\"API\": \"{}\", \"reason\": {}, \"command\": \"{}\"", node->function->GetName(), CheckExploitFuncs::e_reason_danger_process, W2AString(wstr_name));
}
else {
//if (CheckTaintList((LPWSTR)lpApplicationName)) {
// FOUND_EXPLOIT(EXPLOIT_REASON_SUSPICIOUS_PROCESS, NULL);
//}
}
}
} while (0);
#endif
return processing_continue;
}
processing_status WINAPI CHookImplementObject::detour_createProcessInternalW(detour_node* node, HANDLE hToken, LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation, PHANDLE hNewToken)
{
EXPLOIT_PRE_BEGIN(node)
#ifdef _X86_
do {
CHECK_COMMON_EXPLOIT()
std::shared_ptr<CHookImplementObject> impl_ptr = node->hook_implement_object;
if (lpApplicationName) {
std::wstring wstr_name = lpApplicationName;
if (impl_ptr->GetCategoryPtr()->IsDangerousCommand(W2AString(wstr_name))) {
exploit_log("\"API\": \"{}\", \"reason\": {}, \"command\": \"{}\"", node->function->GetName(), CheckExploitFuncs::e_reason_danger_process, W2AString(wstr_name));
}
else {
//if (CheckTaintList((LPWSTR)lpApplicationName)) {
// FOUND_EXPLOIT(EXPLOIT_REASON_SUSPICIOUS_PROCESS, NULL);
//}
}
}
else if (lpCommandLine) {
std::wstring wstr_name = lpCommandLine;
if (impl_ptr->GetCategoryPtr()->IsDangerousCommand(W2AString(wstr_name))) {
exploit_log("\"API\": \"{}\", \"reason\": {}, \"command\": \"{}\"", node->function->GetName(), CheckExploitFuncs::e_reason_danger_process, W2AString(wstr_name));
}
else {
//if (CheckTaintList((LPWSTR)lpApplicationName)) {
// FOUND_EXPLOIT(EXPLOIT_REASON_SUSPICIOUS_PROCESS, NULL);
//}
}
}
} while (0);
#endif
return processing_continue;
}
processing_status WINAPI CHookImplementObject::detour_dialogBoxParamA(detour_node* node, HINSTANCE hInstance, LPCSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam)
{
EXPLOIT_PRE_BEGIN(node)
#ifdef _X86_
do {
if ((DWORD)lpTemplateName == 4070)
{
// try unlock password of VBA behaviors found, report e_reason_unlock_vba
exploit_log("\"API\": \"{}\", \"reason\": {}", node->function->GetName(), CheckExploitFuncs::e_reason_unlock_vba);
std::shared_ptr<CObObject> return_ptr = node->function->GetIdentifier(SI_RETURN);
if (!return_ptr) return processing_continue;
std::any anyvalue = return_ptr->GetValue(static_cast<char*>(node->return_va));
if (!anyvalue.has_value() || anyvalue.type() != typeid(LPVOID))
return processing_continue;
anyvalue = reinterpret_cast<LPVOID>(1);
return_ptr->SetValue(static_cast<char*>(node->return_va), anyvalue);
return processing_exit;
}
} while (0);
#endif
return processing_continue;
}
processing_status WINAPI CHookImplementObject::detour_dialogBoxParamW(detour_node* node, HINSTANCE hInstance, LPCWSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam)
{
EXPLOIT_PRE_BEGIN(node)
#ifdef _X86_
do {
if ((DWORD)lpTemplateName == 4070)
{
// try unlock password of VBA behaviors found, report e_reason_unlock_vba
exploit_log("\"API\": \"{}\", \"reason\": {}", node->function->GetName(), CheckExploitFuncs::e_reason_unlock_vba);
std::shared_ptr<CObObject> return_ptr = node->function->GetIdentifier(SI_RETURN);
if (!return_ptr) return processing_continue;
std::any anyvalue = return_ptr->GetValue(static_cast<char*>(node->return_va));
if (!anyvalue.has_value() || anyvalue.type() != typeid(LPVOID))
return processing_continue;
anyvalue = reinterpret_cast<LPVOID>(1);
return_ptr->SetValue(static_cast<char*>(node->return_va), anyvalue);
return processing_exit;
}
} while (0);
#endif
return processing_continue;
}
processing_status WINAPI CHookImplementObject::detour_createFileA(detour_node* node, LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile)
{
EXPLOIT_PRE_BEGIN(node)
#ifdef _X86_
do {
CHECK_COMMON_EXPLOIT()
} while (0);
#endif
return processing_continue;
}
processing_status WINAPI CHookImplementObject::detour_createFileW(detour_node* node, LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile)
{
EXPLOIT_PRE_BEGIN(node)
#ifdef _X86_
do {
CHECK_COMMON_EXPLOIT()
} while (0);
#endif
return processing_continue;
}
processing_status WINAPI CHookImplementObject::detour_copyFileA(detour_node* node, LPCSTR lpExistingFileName, LPCSTR lpNewFileName, BOOL bFailIfExists)
{
EXPLOIT_PRE_BEGIN(node)
#ifdef _X86_
do {
CHECK_COMMON_EXPLOIT()
} while (0);
#endif
return processing_continue;
}
processing_status WINAPI CHookImplementObject::detour_copyFileW(detour_node* node, LPCWSTR lpExistingFileName, LPCWSTR lpNewFileName, BOOL bFailIfExists)
{
EXPLOIT_PRE_BEGIN(node)
#ifdef _X86_
do {
CHECK_COMMON_EXPLOIT()
} while (0);
#endif
return processing_continue;
}
processing_status WINAPI CHookImplementObject::detour_shellExecuteA(detour_node* node, HWND hwnd, LPCSTR lpOperation, LPCSTR lpFile, LPCSTR lpParameters, LPCSTR lpDirectory, INT nShowCmd)
{
EXPLOIT_PRE_BEGIN(node)
#ifdef _X86_
do {
CHECK_COMMON_EXPLOIT()
std::shared_ptr<CHookImplementObject> impl_ptr = node->hook_implement_object;
if (lpFile) {
std::string str_name = lpFile;
if (impl_ptr->GetCategoryPtr()->IsDangerousCommand(str_name)) {
// start danger process behaviors found, report e_reason_danger_process
exploit_log("\"API\": \"{}\", \"reason\": {}, \"command\": \"{}\"", node->function->GetName(), CheckExploitFuncs::e_reason_danger_process, str_name);
}
else {
//if (CheckTaintList((LPWSTR)lpApplicationName)) {
// FOUND_EXPLOIT(EXPLOIT_REASON_SUSPICIOUS_PROCESS, NULL);
//}
}
}
} while (0);
#endif
return processing_continue;
}
processing_status WINAPI CHookImplementObject::detour_shellExecuteW(detour_node* node, HWND hwnd, LPCWSTR lpOperation, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
{
EXPLOIT_PRE_BEGIN(node)
#ifdef _X86_
do {
CHECK_COMMON_EXPLOIT()
std::shared_ptr<CHookImplementObject> impl_ptr = node->hook_implement_object;
if (lpFile) {
std::wstring wstr_name = lpFile;
if (impl_ptr->GetCategoryPtr()->IsDangerousCommand(W2AString(wstr_name))) {
// start danger process behaviors found, report e_reason_danger_process
exploit_log("\"API\": \"{}\", \"reason\": {}, \"command\": \"{}\"", node->function->GetName(), CheckExploitFuncs::e_reason_danger_process, W2AString(wstr_name));
}
else {
//if (CheckTaintList((LPWSTR)lpApplicationName)) {
// FOUND_EXPLOIT(EXPLOIT_REASON_SUSPICIOUS_PROCESS, NULL);
//}
}
}
} while (0);
#endif
return processing_continue;
}
processing_status WINAPI CHookImplementObject::detour_URLDownloadToFileA(detour_node* node, LPUNKNOWN pCaller, LPCSTR szURL, LPCSTR szFileName, DWORD dwReserved, LPBINDSTATUSCALLBACK lpfnCB)
{
EXPLOIT_PRE_BEGIN(node)
#ifdef _X86_
do {
CHECK_COMMON_EXPLOIT()
} while (0);
#endif
return processing_continue;
}
processing_status WINAPI CHookImplementObject::detour_URLDownloadToFileW(detour_node* node, LPUNKNOWN pCaller, LPCWSTR szURL, LPCWSTR szFileName, DWORD dwReserved, LPBINDSTATUSCALLBACK lpfnCB)
{
EXPLOIT_PRE_BEGIN(node)
#ifdef _X86_
do {
CHECK_COMMON_EXPLOIT()
} while (0);
#endif
return processing_continue;
}
processing_status WINAPI CHookImplementObject::detour_URLDownloadToCacheFileA(detour_node* node, LPUNKNOWN lpUnkcaller, LPCSTR szURL, LPCSTR szFileName, DWORD cchFileName, DWORD dwReserved, IBindStatusCallback *pBSC)
{
EXPLOIT_PRE_BEGIN(node)
#ifdef _X86_
do {
CHECK_COMMON_EXPLOIT()
} while (0);
#endif
return processing_continue;
}
processing_status WINAPI CHookImplementObject::detour_URLDownloadToCacheFileW(detour_node* node, LPUNKNOWN lpUnkcaller, LPCSTR szURL, LPCWSTR szFileName, DWORD cchFileName, DWORD dwReserved, IBindStatusCallback *pBSC)
{
EXPLOIT_PRE_BEGIN(node)
#ifdef _X86_
do {
CHECK_COMMON_EXPLOIT()
} while (0);
#endif
return processing_continue;
}
processing_status WINAPI CHookImplementObject::detour_winExec(detour_node* node, LPCSTR lpCmdLine, UINT uCmdShow)
{
EXPLOIT_PRE_BEGIN(node)
#ifdef _X86_
do {
CHECK_COMMON_EXPLOIT()
} while (0);
#endif
return processing_continue;
}
processing_status WINAPI CHookImplementObject::detour_loadLibraryA(detour_node* node, LPCSTR lpLibFileName)
{
EXPLOIT_PRE_BEGIN(node)
#ifdef _X86_
do {
CHECK_COMMON_EXPLOIT()
} while (0);
#endif
return processing_continue;
}
processing_status WINAPI CHookImplementObject::detour_loadLibraryW(detour_node* node, LPCWSTR lpLibFileName)
{
EXPLOIT_PRE_BEGIN(node)
#ifdef _X86_
do {
CHECK_COMMON_EXPLOIT()
} while (0);
#endif
return processing_continue;
}
processing_status WINAPI CHookImplementObject::detour_loadLibraryExA(detour_node* node, LPCSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
{
EXPLOIT_PRE_BEGIN(node)
#ifdef _X86_
do {
CHECK_COMMON_EXPLOIT()
} while (0);
#endif
return processing_continue;
}
processing_status WINAPI CHookImplementObject::detour_loadLibraryExW(detour_node* node, LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
{
EXPLOIT_PRE_BEGIN(node)
#ifdef _X86_
do {
CHECK_COMMON_EXPLOIT()
} while (0);
#endif
return processing_continue;
}
processing_status WINAPI CHookImplementObject::detour_ntMapViewOfSection(detour_node* node, HANDLE SectionHandle, HANDLE ProcessHandle, PVOID *BaseAddress, ULONG ZeroBits, ULONG CommitSize, PLARGE_INTEGER SectionOffset, PULONG ViewSize, UINT InheritDisposition, ULONG AllocationType, ULONG Protect)
{
EXPLOIT_PRE_BEGIN(node)
#ifdef _X86_
do {
CHECK_COMMON_EXPLOIT()
} while (0);
#endif
return processing_continue;
}
PVOID WINAPI CHookImplementObject::detour_rtlAllocateHeap(PVOID HeapHandle, ULONG Flags, SIZE_T Size)
{
if (m_heap_allocation_define.rtlallocateheap_func)
{
PVOID ret_base = m_heap_allocation_define.rtlallocateheap_func(HeapHandle, Flags, Size);
static LONG add_lock = 0;
LONG lock_int = InterlockedCompareExchange(&add_lock, 1, 0);
if (lock_int == 0) {
#ifdef _X86_
do {
if (CheckExploitFuncs::CheckHeapSpray(HeapHandle, ret_base, Size)) {
// heap spray behaviors found, report e_reason_heap_spray
exploit_log("\"API\": \"{}\", \"reason\": {}", "RtlAllocateHeap", CheckExploitFuncs::e_reason_heap_spray);
}
else {
InterlockedExchange(&add_lock, 0);
}
} while (0);
#endif
}
return ret_base;
}
return nullptr;
}
BOOLEAN WINAPI CHookImplementObject::detour_rtlFreeHeap(PVOID HeapHandle, ULONG Flags, PVOID BaseAddress)
{
if (m_heap_allocation_define.rtlfreeheap_func)
{
#ifdef _X86_
do {
CheckExploitFuncs::FreeHeapSpray(HeapHandle, BaseAddress);
} while (0);
#endif
return m_heap_allocation_define.rtlfreeheap_func(HeapHandle, Flags, BaseAddress);
}
return FALSE;
}
PVOID WINAPI CHookImplementObject::detour_rtlDestroyHeap(PVOID HeapHandle)
{
if (m_heap_allocation_define.rtldestroyheap_func)
{
#ifdef _X86_
do {
CheckExploitFuncs::DestroyHeapSpray(HeapHandle);
} while (0);
#endif
return m_heap_allocation_define.rtldestroyheap_func(HeapHandle);
}
return nullptr;
}
processing_status WINAPI CHookImplementObject::detour_WSAStartup(detour_node* node, WORD wVersionRequired, LPWSADATA lpWSAData)
{
EXPLOIT_PRE_BEGIN(node)
#ifdef _X86_
do {
CHECK_COMMON_EXPLOIT()
} while (0);
#endif
return processing_continue;
}
processing_status WINAPI CHookImplementObject::detour_socket(detour_node* node, int af, int type, int protocol)
{
EXPLOIT_PRE_BEGIN(node)
#ifdef _X86_
do {
CHECK_COMMON_EXPLOIT()
} while (0);
#endif
return processing_continue;
}
processing_status WINAPI CHookImplementObject::detour_connect(detour_node* node, SOCKET s, const sockaddr *name, int namelen)
{
EXPLOIT_PRE_BEGIN(node)
#ifdef _X86_
do {
CHECK_COMMON_EXPLOIT()
} while (0);
#endif
return processing_continue;
}
|
cpp
|
Prime Minister Narendra Modi today chaired a high-level meeting to review preparedness for hot weather in upcoming summer and called for preparing awareness material for common citizens, medical professionals, and disaster response teams.
Above-normal temperatures along with heat wave conditions are expected in most parts of India during three months ending May 31, threatening to lower crop production and hurting the efforts to control food costs, says a Bloomberg report.
The Prime Minister was briefed about forecast of monsoon, impact on Rabi crops, preparedness of medical infrastructure and preparation for disaster related to heat and mitigation measures, said a statement from his office.
Last year, India suffered its hottest March in more than a century, scorching the grain harvest and forcing the government to curb exports.
Heat wave is described as a period of abnormally high temperatures, more than the normal maximum temperature that occurs during the hot weather season.
The weather office, India Meteorological Department (IMD), has been instructed by PM Modi to prepare daily weather forecasts, said the Prime Minister's Office.
The Prime Minister, said the statement, stressed on the need for detailed fire audits of all hospitals.
The need for a coordinated effort to deal with forest fires was also pointed out, it added.
Schools have been asked to include lecture sessions to sensitise children on dealing with extreme heat conditions. The Prime Minister said that do's and don'ts for hot weather should be prepared in accessible formats, and various other modes of publicity like jingles, films, pamphlets etc. should also be prepared and issued.
The availability of fodder and of water in reservoirs should be tracked, said the Prime Minister. Food Corporation of India was asked to ensure optimal storage of grains in extreme weather conditions.
The meeting was attended by Principal Secretary to the Prime Minister, Cabinet Secretary, Home Secretary, Secretary Health & Family Welfare, National Disaster Management Authority, among others.
|
english
|
Shakira's mother Nidia Ripoll Torrado has said that Gerard Pique is still family after the Barcelona icon visited the pop star's father in hospital.
The Colombian singer and Pique announced their separation in June 2022, ending their 11-year relationship. The aftermath of their split has been volatile, with the two at loggerheads over the circumstances of the breakup.
Shakira left Barcelona and headed to Miami earlier this year but has been dealing with her father who has been in hospital. William Mebarak Chadid fell in 2022 and is receiving treatment in America for head trauma.
Essentially Sports cite reports claiming that Pique visited Chadid in hospital, which surprised many, given the tense situation between the Spaniard and Shakira. Shakira's mother Torrado has admitted that she still views the Barcelona legend as family despite Pique's breakup with her daugher. She confirmed Pique's visit to the hospital, telling Colombian magazine Semana:
"Sure, he came. We are still family. I think I have a good relationship with him. I must have it, because we haven’t fought. "
Shakira and Gerard Pique share two children, Milan, 10, and Sasha, 8. The couple first met during the 2010 FIFA World Cup in South Africa, when the singer recorded the competition's anthem 'Waka Waka (This time for Africa)'.
The Barca legend has since moved on to a new partner Clara Chia Marti, 24, with the couple residing in Cataluyna. Meanwhile, the Colombian pop star now lives in Miami.
The singer has released a new song titled 'Acrostic' dedicated to Milan and Sasha. It was released just in time for International Mother's Day and is an open letter to the two children.
The Colombian expresses her deep love for her kids and shares how a mother can use the love of her children to numb the pain she endures The song's release came just after she was honored as Woman of the Year at the Billboard Latin Women in Music gala.
She made her first public appearance during the gala since moving to Miami after leaving Barcelona. She thanked her mother, friends and family during her acceptance speech.
It's the second song she has released this year after her diss track with Argentine DJ Bizzarap. The song 'Bzrp Music Sessions, Vol. 53' broke Latin streaming records and sent fans into a frenzy due to digs made at Gerard Pique and Clara Chia.
|
english
|
Addl. DG (M&C)
(Agriculture, CA, Food & PD)
Dear Sir/Madam,
for the following:
Shri Sharad Pawar, Minister of Agriculture,
Consumer Affairs, Food and PD will preside over the NCDC’s 66th General Council Meeting.
Room No.
142, Krishi Bhawan, New Delhi.
Yours Sincerely,
(Manoj Pandey)
|
english
|
{
"name": "setup-purescript",
"description": "Set up a PureScript toolchain in GitHub Actions",
"author": "<NAME>",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/thomashoneyman/setup-purescript.git"
},
"scripts": {
"build": "spago bundle-module --to output/index.js && ncc build --minify update.js && mv dist/index.js dist/update.js && ncc build --minify index.js"
},
"dependencies": {
"@actions/core": "^1.2.6",
"@actions/exec": "^1.0.4",
"@actions/tool-cache": "^1.6.1",
"xhr2": "^0.2.1"
},
"devDependencies": {
"@vercel/ncc": "^0.27.0"
}
}
|
json
|
<reponame>subiz/sstable
package sstable
import (
"encoding/binary"
"fmt"
"io/ioutil"
)
type ShortString struct {
Length uint16
Value []byte
}
type Option struct {
Key ShortString
Value ShortString
}
type CompressionInfo struct {
CompressorName ShortString
OptionsCount uint32
Options []Option
ChunkLength uint32
DataLength uint64
ChunkCount uint32
ChunkOffsets []uint64
}
func read_short_string(data []byte) ShortString {
var s ShortString
s.Length = binary.BigEndian.Uint16(data[0:2])
s.Value = data[2:s.Length]
return s
}
func read_compression(filepath string) (CompressionInfo, error) {
var info CompressionInfo
data, err := ioutil.ReadFile(filepath)
// f, err := os.Open(filepath)
if err != nil {
return info, err
}
info.CompressorName = read_short_string(data)
data = data[2+info.CompressorName.Length:]
info.OptionsCount = binary.BigEndian.Uint32(data[0:4])
data = data[4:]
info.Options = make([]Option, info.OptionsCount, info.OptionsCount)
for i := uint32(0); i < info.OptionsCount; i++ {
var option Option
option.Key = read_short_string(data)
data = data[2+option.Key.Length:]
option.Value = read_short_string(data)
data = data[2+option.Value.Length:]
info.Options[i] = option
}
info.ChunkLength = binary.BigEndian.Uint32(data[0:4])
data = data[4:]
info.DataLength = binary.BigEndian.Uint64(data[0:8])
data = data[8:]
info.ChunkCount = binary.BigEndian.Uint32(data[0:4])
data = data[4:]
info.ChunkOffsets = make([]uint64, info.ChunkCount, info.ChunkCount)
for i := uint32(0); i < info.ChunkCount; i++ {
info.ChunkOffsets[i] = binary.BigEndian.Uint64(data[0:8])
data = data[8:]
}
if len(data) != 0 {
return info, fmt.Errorf("corrupted compression info, trailing bytes")
}
return info, nil
}
|
go
|
// This is a generated file. Not intended for manual editing.
package org.plugin.dot.psi;
import java.util.List;
import org.jetbrains.annotations.*;
import com.intellij.psi.PsiElement;
public interface DotEdgeRHS extends PsiElement {
@Nullable
DotEdgeRHS getEdgeRHS();
@Nullable
DotNodeId getNodeId();
@Nullable
DotSubGraph getSubGraph();
@NotNull
PsiElement getEdgeOp();
}
|
java
|
GTA Online is filled with a lot of different types of vehicles that fulfill different purposes. The Criminal Enterprises update has further added to this tally with tons of content, including eight new sets of wheels so far.
However, not every vehicle can be fun, as some are meant strictly to help players in their hustle. That said, they can still have a lot of fun if they pick the right vehicle for that purpose.
This article looks at the five most fun and entertaining vehicles in GTA Online that players should know about.
Note: This article is subjective and reflects the writer's views.
At number five, it is none other than the Pegassi Oppressor, a custom sports bike that was added to GTA Online with the Gunrunning update.
Anytime players get bored in the game, they should pick up the Oppressor, especially if they love to do tricks with motorbikes. It has a top speed of 140 mph and the ability to fly thanks to its wings. With the help of its rocket boosters and wings, players can pull off some cool tricks and stay in the air for much longer, and do combos as well.
It is available for purchase at $3,524,500 - $2,650,00 from Warstock Cache & Carry.
Next on the list is the Phantom Wedge, a custom semi-truck added to GTA Online with the Import/Export update.
This vehicle is for players who hate pedestrians and traffic on the road as they can ram them out of their way easily with this monster. It has a large, defensive metal wedge on its front to help players with the task. It’s easy and fun to clear the roads with a massive truck and let others know who owns the roads in Los Santos.
It is available for purchase at $2,553,600 - $1,920,000 from Warstock Cache & Carry.
At number three is the Canis Kamacho, a 4-door off-road utility truck that was added to GTA Online with The Doomsday Heist.
This vehicle is recommended for players who are outdoorsy and want to have fun while exploring every corner of Los Santos. It is the king of off-roaders in the game, with the capability to climb mountains with even 90-degree slopes with great ease. Players can gas the vehicle up and down mountains and pull off amazing moments thanks to its suspension.
The vehicle can be purchased from Southern San Andreas Super Autos for $345,000.
Next on the list is the LF-22 Starling, a rocket fighter aircraft added to GTA Online with the Smuggler’s Run update.
It is highly recommended for players who want to fly around Los Santos, blow up stuff, and pull off cool air tricks. The aircraft has an incredible top speed of 187. 75 mph (302. 15 km/h). However, it can reach up to 207 mph thanks to its long-lasting rocket booster. It is quite responsive and super fun to roam around in an LF-22 even in 2022.
Players can pick it up from $3,657,500 - $2,750,000 from Warstock Cache & Carry.
Finally, at number one, it is the famous Benefactor Future Shock Bruiser, a 4-door 6X6 custom limousine version of Glendale.
It’s recommended for players who want an all-in-one tank to wreak havoc chaos on the streets of Los Santos. The vehicle has every tool to help them with the task, including nitrous, shunt boost, jump boost, proximity mines, sticky mines, guns on the front, and spikes. No matter what comes in front of the vehicle, they will be able to go through it when fully upgraded no matter what.
Players can convert their Glendale into the Future Shock Bruiser at the Arena Workshop for $1,609,000.
Rockstar has done a great job in providing a variety of vehicles in the game, and players have the freedom to pick one according to their preferences. If they are looking to have fun, the aforementioned vehicles are worth checking out.
|
english
|
Since it’s a bio-pic, Shirdi Sai should not be viewed like a commercial film. Every one of us have the curiosity to know more about Sai Baba. We might have read some books. But none of these readings give us a complete picture on life and times of Sai Baba. The film Sai Baba attempts to tell the world about the making of an enlightened man called Sai Baba who is revered as a God today. Nagarjuna is the major highlight of the film and he convinces us all as Sai Baba. You may watch Shirdi Sai with an academic interest.
Ratings:3/5 Reviewer:Karthik Pasupulate Site:Times of India(TOI)
Cinematic glitches aside, what works in the movie is that it focuses more on the spirit of the teachings rather than the miracles that Sai Baba performed, which was the crux of the previous films like Shri Sai Baba Mahatyam, widely regarded as the definitive film on Sai Baba. As far as viewing experience goes, this film falls short of the standards set by that K Vasu film but it has a few moments nevertheless. The writing proves to be a stumbling block as the lines just don’t have that effect. Forced comedy tracks involving Sayaji Shinde look mediocre at best. It’s isn’t a film that will douse you with that feeling of divinity, but makes for a one time watch. How much you like this film might just be a matter of how staunch a devotee of Sai Baba you are.
A film of this kind is bound to eulogise the central character, particularly since he is endowed with divine powers. The director Raghavendra Rao has tried to maintain a balance between entertaining viewing and capturing some of the spiritual essence as well.Shirdi Sai is not just a devotional to be seen by an older audience. Anyone can see it for the relevance of the simple teachings of the saint from Shirdi.The film has a shot of the sanctum at Shirdi as a bonus for followers of the sage!
But despite all the positives, the film didn’t really have that spark or the vibration that really sets the crowds going. Given the fact that it is more of a remake, comparisons are bound to rise with the older version starring Vijayachander. And it must be said that this is no match to that. As such, the film runs smoothly without any hiccups but the problem is there are no deep moments of reflection or a situation which connects you strongly to the subject. The intensity factor which can generate a communion in the theatre is absent.Director screwed up the devotional factor by placing an irritating comedy track with Sayaji, Ali, Ananth and Dharmavarapu. The film is made with a chain of miracles but will not hold any story line. If proper home work and research was done, then the film would have touched a higher mark.
Unlike Annamayya and Sri Ramadasu, Nagarjuna’s Shirdi Sai is interestingly narrated basic Sai’s philosophies. Without deviating much from the known life of Sai Baba, the makers recreate moments to show exactly what happened in his life and how he attained enlightenment.The film doesn’t have a storyline per se but the series of anecdotes weaved out of meaningful ideologies are definitely something to look forward to. At the end of the film you need to ask yourself one question – Will you go home and worship different gods by different names or will you stand by the line Sabka Malik Ek Hai?
Director Raghavendra Rao has maintained perfect balance between the spiritual concept and dramatic happenings of miracles, perfect colors have been used for songs. First half of the movie has been directed well however there is a slight drop in second half also lacking to catch the attention of audience until the last 20 minutes of movie.A huge round of applause for Nagarjuna for taking up this role which needs a serene look after having worked on various other aspects, it is good for all those who are completely into spirituality of Sai Baba without any expectations.
Also Try:
|
english
|
<reponame>JefferyLukas/SRIs<filename>es6-promise/4.2.0.json
{"es6-promise.auto.js":"<KEY>,"es6-promise.auto.min.js":"<KEY>,"es6-promise.js":"<KEY>,"es6-promise.min.js":"<KEY>}
|
json
|
Tirun Travel Marketing,India’s representative of Royal Caribbean Cruises,has confirmed that plans are underway to welcome Mariner of the Seas,one of the largest ship to be based in Asia.
At 138,000 gross registered tons (GRT) and stretching more than a thousand feet in length,the ship can carry 3,114 guests on double occupancy and will become the biggest Royal Caribbean International cruise ship to call on Goa and Kochi on May 24 and 26 respectively.
Construction of new cruise terminals has paved way for bigger and more innovative ships to home-port in Asia thereby fuelling consumer demand for cruises in the region.
Mariner of the Seas brings 15 decks of activities,first-at-sea innovations,luxurious staterooms,entertainment and dining options.
Initially,the ship will offer three to five-night cruises from Singapore to Penang,Langkawi and Kuala Lumpur in Malaysia,and Phuket in Thailand in June.
Subsequently,it will move to China and offer a choice of 4/5/7 night and longer north Asian sailings from Baoshan (Shanghai).
Later in the year,Mariner will return to Singapore and offer a variety of sailings till March next year.
Mariner of the Seas includes an ice skating rink,eight dining venues and sports facilities,including a jogging and inline skating track,rock-climbing wall,a mini golf course,a full-sized sports court with basketball court,three swimming pools and six whirlpools.
A Broadway-style entertainment in the main theatre,which seats 1,362 guests,Vegas-style Casino Royale,and a variety of duty-free shopping are also other attractions for travellers.
|
english
|
import {
Plugin,
WabtOptions
} from '../../index.d.ts';
import {
addGlobals
} from '../utilities';
import * as wabt from 'wabt';
export const WatPlugin: Readonly<Plugin> = {
fileExtensions: ['wat'],
httpHeaders: {
'Content-Type': 'application/javascript'
},
defaultCompilerOptions: {},
createTransformer: (transformerCreatorParams: {
url: string;
compilerOptions: Readonly<WabtOptions>;
wsPort: number;
}) => {
return (transformerParams: {
sourceString: string;
sourceBuffer: Readonly<Buffer>;
}) => {
// TODO why do I have to pass the filename in as the first parameter? The url is not exactly the file name, make sure it works
const wasmModule: Readonly<wabt.WasmModule> = (wabt as any)().parseWat(transformerCreatorParams.url, transformerParams.sourceString);
const binary = wasmModule.toBinary({}).buffer;
return addGlobals({
source: `
const wasmByteCode = Uint8Array.from('${binary}'.split(','));
export default async (imports) => {
const wasmModule = await WebAssembly.instantiate(wasmByteCode, imports);
return wasmModule.instance.exports;
};
`,
wsPort: transformerCreatorParams.wsPort
});
};
}
};
|
typescript
|
<html>
<head>
<title>Acorn Language</title>
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" type="text/css" href="standard.css" />
</head>
<body>
<div id="header">
<a href="/"><div id="title">Acorn Guide</div></a>
<div id="sub">Contents (Outdated)</div>
</div>
<div class="text">
<ol>
<li><b><a href="intro.html">Introduction</a></b></li>
<li><b><a href="scene.html">Making a Scene</a></b>
<p><i>Wherein we introduce value types and show how they
assemble together to create static 3-D content.</i></p></li>
<li><b><a href="resources.html">Be Resourceful</a></b>
<p><i>Wherein we describe how to organize a world's parts into resources
and libraries.</i></p></li>
<li><b><a href="expression.html">That's Just an Expression</a></b>
<p><i>Wherein we explain the structure of expressions and assignments
using values, variables, operators, methods and members.</i></p></li>
<li><b><a href="methods.html">Smart Parts</a></b>
<p><i>Wherein we delegate a scene's roles and responsibilities
across custom-built Methods, Functions, and Types.</i></p></li>
<li><b><a href="flow.html">Decisions! Decisions! Decisions!</a></b>
<p><i>Wherein we specify what actions to take based on evaluating the content of values.</i></p></li>
<li><b><a href="parts.html">The Well-Connected Part</a></b>
<p><i>2-way binding...</i></p></li>
<li><b><a href="misc.html">Miscellaneous</a></b>
<p><i>Security, Threads, Namespaces.</i></p></li>
</ol>
</div>
</body>
</html>
|
html
|
Announcement - New Tamil fantasy series starting from March 30th!
Announcement - New Tamil fantasy series starting from March 30th!
Guess this is the first fantasy series... Eagerly waiting to read your seroes Lokesh (y)
Announcement - New Tamil fantasy series starting from March 30th!
All the very best Lokesh :)
super start lokesh. romba vithyaasamanaa kathai. padikka romba swarasyamaa irukku. vaazhthukkal.
Hi Lokesh , very nice start. :GL:
good start lokesh sir :-) story different and interesting ah iruku :cool: :GL:
Very interesting start Lokesh. All the very best for your series (y)
Hi lokesh , story romba nalla poguthu....if my guess is rite edhu historical base mathiri eruku... enaku historical stories romba pudikum...i like the way u started the story :-) all the best :-) :-)
|
english
|
<reponame>cdnjs/SRIs
{"bijou-min.js":"<KEY>,"bijou.js":"<KEY>}
|
json
|
23 David had become very old. So he made his son Solomon king over Israel.
6 David separated the Levites into groups. He did it according to the sons of Levi. The sons were Gershon, Kohath and Merari.
7 Ladan and Shimei belonged to the family of Gershon.
Jehiel, Zetham and Joel. Jehiel was the oldest son. The total number of sons was three.
Shelomoth, Haziel and Haran. The total number of sons was three. They were the leaders of the families of Ladan.
Jahath, Ziza, Jeush and Beriah. The total number of the sons of Shimei was four.
11 Jahath was the first son. Ziza was the second son. But Jeush and Beriah didn’t have many sons. So they were counted as one family. They had only one task.
Amram, Izhar, Hebron and Uzziel. The total number of sons was four.
Aaron and Moses.
Aaron and his family line were set apart forever as the Lord’s priests. They had the duty of setting the most holy things apart to the Lord. They offered sacrifices to the Lord. They served him. They gave blessings in his name forever. 14 The sons of Moses, the man of God, were counted as part of the tribe of Levi.
Gershom and Eliezer.
16 Shubael was the oldest son in the family line of Gershom.
17 Rehabiah was the oldest son in the family line of Eliezer.
Eliezer didn’t have any other sons. But Rehabiah had a great many sons.
18 Shelomith was the oldest son of Izhar.
19 Jeriah was the first son of Hebron.
Amariah was his second son. Jahaziel was the third. Jekameam was the fourth.
20 Micah was the first son of Uzziel. Ishiah was his second son.
Mahli and Mushi.
Eleazar and Kish.
22 Eleazar died without having any sons. All he had was daughters. They married their cousins. The cousins were the sons of Kish.
Mahli, Eder and Jerimoth. The total number of sons was three.
24 Those were the family lines of Levi. They were recorded under the names of the family leaders. Each worker who was 20 years old or more was counted. They served in the Lord’s temple. 25 David had said, “The Lord is the God of Israel. He has given peace and rest to his people. He has come to Jerusalem to live there forever. 26 So the Levites don’t need to carry the holy tent anymore. They don’t need to carry any of its objects anymore. Those were the things that were used to serve there.” 27 The Levites who were 20 years old or more were counted. That was in keeping with David’s final directions.
28 The Levites had the duty of helping the members of Aaron’s family line. They helped them serve in the Lord’s temple. They were in charge of the courtyards and the side rooms. They made all the sacred things pure and “clean.” They also had other duties at the house of God. 29 They were in charge of setting the holy bread out on the table. They prepared the special flour for the grain offerings. They made the thin loaves without using any yeast. They did the baking and the mixing. They measured the amount and size of everything. 30 They stood every morning to thank and praise the Lord. They did the same thing every evening. 31 They also did it every time burnt offerings were brought to the Lord. Those offerings were brought every Sabbath day. They were also brought at every New Moon feast and during the appointed yearly feasts. The Levites served in front of the Lord at regular times. The proper number of Levites was always used when they served. They served in the way the law required.
32 So the Levites carried out their duties for the tent of meeting and for the Holy Room. They worked under their relatives who were in the family line of Aaron. They helped them serve at the Lord’s temple.
Copyright © 1995, 1996, 1998, 2014 by Biblica, Inc.®. Used by permission. All rights reserved worldwide.
|
english
|
At a local parking lot, you push a button to get your ticket.
The ticket emerges and a voice says: "Take the ticket."
It's a female voice, attempting to be as erotically alluring as possible. It's a robot female voice, of course, and it always makes me wonder why this parking lot believes it should offer an erotic experience.
Yet robot voices have become part of our lives. Who hasn't thanked Siri at least once when she's answered a question or found the very song we just asked for?
But we still like, respect, and trust other humans, right? Even if, at times, it seems we have ill-disguised contempt for most of them.
I fear the emergence of robots may have permanently changed us.
I was moved, you see, by the tale of a Starbucks barista called Drey.
Her location had plumbing problems. She tried to tell customers who rolled up to the drive-thru that it was closed. She tried to tell them again when they offered disbelief.
Then, as she claimed on TikTok, she tried something a little different. She put on a robot voice.
It went like this: "Sorry. Our location is now closed." (Please imagine Siri saying it.)
You might imagine people would ignore this, roll up and shout their orders impatiently. But no. Drey insists: "And they roll right through. I was like...wait a minute this shit works, let's try it again."
She did. It worked again.
And then Drey offered a startling insight into the psychological trigger of this interaction: "No rebuttals, no nothing, you know why? Cause you can't argue with a robot."
Anyone who has screamed down the phone at a customer service robot knows this. Yet still we scream. We're frustrated and, perhaps in our inner depths, we hope that some human, any human may overhear our screaming and come to our aid.
But if you roll up to a Starbucks and a robot tells you it's closed, you make the assumption that there's no point screaming. The robot must be right.
Because robots are unfeeling, unresponsive, and uncomprehending, but they're never wrong. Or, at least, we're conditioned to believe they are.
So we trust their (supposed) objectivity in a way that we can never trust any human's sincerity.
They're taking over anyway, so what's the point of arguing?
|
english
|
# coding: utf-8
__author__ = 'ZFTurbo: https://kaggle.com/zfturbo'
import os
import time
import pickle
import numpy as np
import pandas as pd
from multiprocessing import Pool, cpu_count
from itertools import repeat
from ensemble_boxes import *
from map_boxes import *
def save_in_file_fast(arr, file_name):
pickle.dump(arr, open(file_name, 'wb'))
def load_from_file_fast(file_name):
return pickle.load(open(file_name, 'rb'))
def get_detections(path):
preds = pd.read_csv(path)
ids = preds['ImageId'].values
preds_strings = preds['PredictionString'].values
ImageID = []
LabelName = []
Conf = []
XMin = []
XMax = []
YMin = []
YMax = []
for j in range(len(ids)):
# print('Go for {}'.format(ids[j]))
id = ids[j]
if str(preds_strings[j]) == 'nan':
continue
arr = preds_strings[j].strip().split(' ')
if len(arr) % 6 != 0:
print('Some problem here! {}'.format(id))
exit()
for i in range(0, len(arr), 6):
ImageID.append(id)
LabelName.append(arr[i])
Conf.append(float(arr[i + 1]))
XMin.append(float(arr[i + 2]))
XMax.append(float(arr[i + 4]))
YMin.append(float(arr[i + 3]))
YMax.append(float(arr[i + 5]))
res = pd.DataFrame(ImageID, columns=['ImageId'])
res['LabelName'] = LabelName
res['Conf'] = Conf
res['XMin'] = XMin
res['XMax'] = XMax
res['YMin'] = YMin
res['YMax'] = YMax
return res
def process_single_id(id, res, weights, params):
run_type = params['run_type']
verbose = params['verbose']
if verbose:
print('Go for ID: {}'.format(id))
boxes_list = []
scores_list = []
labels_list = []
labels_to_use_forward = dict()
labels_to_use_backward = dict()
for i in range(len(res[id])):
boxes = []
scores = []
labels = []
dt = res[id][i]
if str(dt) == 'nan':
boxes = np.zeros((0, 4), dtype=np.float32)
scores = np.zeros((0, ), dtype=np.float32)
labels = np.zeros((0, ), dtype=np.int32)
boxes_list.append(boxes)
scores_list.append(scores)
labels_list.append(labels)
continue
pred = dt.strip().split(' ')
# Empty preds
if len(pred) <= 1:
boxes = np.zeros((0, 4), dtype=np.float32)
scores = np.zeros((0,), dtype=np.float32)
labels = np.zeros((0,), dtype=np.int32)
boxes_list.append(boxes)
scores_list.append(scores)
labels_list.append(labels)
continue
# Check correctness
if len(pred) % 6 != 0:
print('Erorr % 6 {}'.format(len(pred)))
print(dt)
exit()
for j in range(0, len(pred), 6):
lbl = pred[j]
scr = float(pred[j + 1])
box_x1 = float(pred[j + 2])
box_y1 = float(pred[j + 3])
box_x2 = float(pred[j + 4])
box_y2 = float(pred[j + 5])
if box_x1 >= box_x2:
if verbose:
print('Problem with box x1 and x2: {}. Skip it'.format(pred[j:j+6]))
continue
if box_y1 >= box_y2:
if verbose:
print('Problem with box y1 and y2: {}. Skip it'.format(pred[j:j+6]))
continue
if scr <= 0:
if verbose:
print('Problem with box score: {}. Skip it'.format(pred[j:j+6]))
continue
boxes.append([box_x1, box_y1, box_x2, box_y2])
scores.append(scr)
if lbl not in labels_to_use_forward:
cur_point = len(labels_to_use_forward)
labels_to_use_forward[lbl] = cur_point
labels_to_use_backward[cur_point] = lbl
labels.append(labels_to_use_forward[lbl])
boxes = np.array(boxes, dtype=np.float32)
scores = np.array(scores, dtype=np.float32)
labels = np.array(labels, dtype=np.int32)
boxes_list.append(boxes)
scores_list.append(scores)
labels_list.append(labels)
# Empty predictions for all models
if len(boxes_list) == 0:
return np.array([]), np.array([]), np.array([])
if run_type == 'wbf':
merged_boxes, merged_scores, merged_labels = weighted_boxes_fusion(boxes_list, scores_list, labels_list,
weights=weights, iou_thr=params['intersection_thr'],
skip_box_thr=params['skip_box_thr'],
conf_type=params['conf_type'])
elif run_type == 'nms':
iou_thr = params['iou_thr']
merged_boxes, merged_scores, merged_labels = nms(boxes_list, scores_list, labels_list, weights=weights, iou_thr=iou_thr)
elif run_type == 'soft-nms':
iou_thr = params['iou_thr']
sigma = params['sigma']
thresh = params['thresh']
merged_boxes, merged_scores, merged_labels = soft_nms(boxes_list, scores_list, labels_list,
weights=weights, iou_thr=iou_thr, sigma=sigma, thresh=thresh)
elif run_type == 'nmw':
merged_boxes, merged_scores, merged_labels = non_maximum_weighted(boxes_list, scores_list, labels_list,
weights=weights, iou_thr=params['intersection_thr'],
skip_box_thr=params['skip_box_thr'])
if verbose:
print(len(boxes_list), len(merged_boxes))
if 'limit_boxes' in params:
limit_boxes = params['limit_boxes']
if len(merged_boxes) > limit_boxes:
merged_boxes = merged_boxes[:limit_boxes]
merged_scores = merged_scores[:limit_boxes]
merged_labels = merged_labels[:limit_boxes]
# Rename labels back
merged_labels_string = []
for m in merged_labels:
merged_labels_string.append(labels_to_use_backward[m])
merged_labels = np.array(merged_labels_string, dtype=np.str)
# Create IDs array
ids_list = [id] * len(merged_labels)
return merged_boxes, merged_scores, merged_labels, ids_list
def ensemble_predictions(pred_filenames, weights, params):
verbose = False
if 'verbose' in params:
verbose = params['verbose']
start_time = time.time()
procs_to_use = max(cpu_count() // 2, 1)
# procs_to_use = 1
if verbose:
print('Use processes: {}'.format(procs_to_use))
res = dict()
ref_ids = None
for j in range(len(pred_filenames)):
s = pd.read_csv(pred_filenames[j])
try:
s.sort_values('ImageId', inplace=True)
except:
s.sort_values('ImageID', inplace=True)
s.reset_index(drop=True, inplace=True)
try:
ids = s['ImageId'].values
except:
ids = s['ImageID'].values
preds = s['PredictionString'].values
if ref_ids is None:
ref_ids = tuple(ids)
else:
if ref_ids != tuple(ids):
print('Different IDs in ensembled CSVs!')
exit()
for i in range(len(ids)):
id = ids[i]
if id not in res:
res[id] = []
res[id].append(preds[i])
p = Pool(processes=procs_to_use)
ids_to_use = sorted(list(res.keys()))
results = p.starmap(process_single_id, zip(ids_to_use, repeat(res), repeat(weights), repeat(params)))
all_ids = []
all_boxes = []
all_scores = []
all_labels = []
for boxes, scores, labels, ids_list in results:
if boxes is None:
continue
all_boxes.append(boxes)
all_scores.append(scores)
all_labels.append(labels)
all_ids.append(ids_list)
all_ids = np.concatenate(all_ids)
all_boxes = np.concatenate(all_boxes)
all_scores = np.concatenate(all_scores)
all_labels = np.concatenate(all_labels)
if verbose:
print(all_ids.shape, all_boxes.shape, all_scores.shape, all_labels.shape)
res = pd.DataFrame(all_ids, columns=['ImageId'])
res['LabelName'] = all_labels
res['Conf'] = all_scores
res['XMin'] = all_boxes[:, 0]
res['XMax'] = all_boxes[:, 2]
res['YMin'] = all_boxes[:, 1]
res['YMax'] = all_boxes[:, 3]
if verbose:
print('Run time: {:.2f}'.format(time.time() - start_time))
return res
if __name__ == '__main__':
if 1:
params = {
'run_type': 'nms',
'iou_thr': 0.5,
'verbose': True,
}
if 1:
params = {
'run_type': 'soft-nms',
'iou_thr': 0.5,
'thresh': 0.0001,
'sigma': 0.1,
'verbose': True,
}
if 1:
params = {
'run_type': 'nmw',
'skip_box_thr': 0.000000001,
'intersection_thr': 0.5,
'limit_boxes': 30000,
'verbose': True,
}
if 1:
params = {
'run_type': 'wbf',
'skip_box_thr': 0.0000001,
'intersection_thr': 0.6,
'conf_type': 'avg',
'limit_boxes': 30000,
'verbose': True,
}
# Files available here: https://github.com/ZFTurbo/Weighted-Boxes-Fusion/releases/download/v1.0/test_data.zip
annotations_path = 'test_data/challenge-2019-validation-detection-bbox-expand_3520.csv'
pred_list = [
'test_data/0.46450_TF_IRV2_atrous_3520.csv',
'test_data/0.52319_mmdet_3520.csv',
'test_data/0.52918_tensorpack1_3520.csv',
'test_data/0.53775_tensorpack2_3520.csv',
'test_data/0.51145_retinanet_3520.csv',
]
weights = [1, 1, 1, 1, 1]
ann = pd.read_csv(annotations_path)
ann = ann[['ImageId', 'LabelName', 'XMin', 'XMax', 'YMin', 'YMax']].values
# Find initial scores
for i in range(len(pred_list)):
det = get_detections(pred_list[i])
det = det[['ImageId', 'LabelName', 'Conf', 'XMin', 'XMax', 'YMin', 'YMax']].values
mean_ap, average_precisions = mean_average_precision_for_boxes(ann, det, verbose=False)
print("File: {} mAP: {:.6f}".format(os.path.basename(pred_list[i]), mean_ap))
start_time = time.time()
ensemble_preds = ensemble_predictions(pred_list, weights, params)
print("Overall ensemble time for method: {}: {:.2f} sec".format(params['run_type'], time.time() - start_time))
ensemble_preds.to_csv("test_data/debug_{}.csv".format(params['run_type']), index=False)
ensemble_preds = ensemble_preds[['ImageId', 'LabelName', 'Conf', 'XMin', 'XMax', 'YMin', 'YMax']].values
mean_ap, average_precisions = mean_average_precision_for_boxes(ann, ensemble_preds, verbose=True)
print("Ensemble [{}] Weights: {} Params: {} mAP: {:.6f}".format(len(weights), weights, params, mean_ap))
|
python
|
Bleach the Movie: Hell Verse Movie Streaming Watch Online. Hell – A place where beings that have committed mortal sins during their lifetime are sent. It is a realm where even Soul Reapers are forbidden to interfere. When a group of vicious Sinners plot to escape from this eternal prison, they discover that Substitute Soul Reaper Ichigo Kurosaki is the key to their freedom.
|
english
|
Connor McDavid scored the go-ahead goal on a power play with 10:16 remaining, and Leon Draisaitl collected two goals and an assist as the Edmonton Oilers dominated the third period and remained unbeaten with a 4-1 victory over the host New York Rangers on Saturday afternoon.
The Oilers improved to 5-0 for the first time since the 1985-86 season and became the first team in NHL history to open a season with five straight wins while overcoming a deficit in each contest.
McDavid scored his fourth goal of the season and notched his seventh point on the power play after drawing an interference penalty on Brendan Lemieux. McDavid also scored 84 seconds after Edmonton killed off his tripping penalty.
New York was denied a 3-0 start after having six days off since a 4-1 win in Ottawa last Saturday. Rangers goaltender Henrik Lundqvist finished with 23 saves, while Mike Smith stopped 20 shots for Edmonton.
Dustin Brown had a goal and two assists as Los Angeles won its home opener against Nashville.
The Kings scored three goals in the final minute -- two on an empty net -- after the Predators (3-2-0) tied the game with 8:30 to play. Los Angeles (2-2-0) blew a three-goal lead in the third period after Colton Sissons, Matt Duchene and Viktor Arvidsson scored to tie the game 4-4.
Jack Campbell, who picked up the Kings' only win entering Saturday in his lone start this season, started against Nashville and made 28 saves. Juuse Saros made 30 saves in his second start this season for Nashville.
Avalanche 3, Coyotes 2 (OT)
Andre Burakovsky scored with 1:31 left in overtime, Pavel Francouz had 34 saves in his first NHL start, and Colorado beat Arizona in Denver to improve to 4-0-0.
Nazem Kadri and Tyson Jost scored 1:49 apart midway through the third period, and Cale Makar had two assists to help Colorado sweep its four-game homestand to open the season. The Avalanche have won 10 straight regular-season home games dating back to last season.
Michael Grabner and Nick Schmaltz scored, and Antti Raanta had 29 saves for Arizona.
Artturi Lehkonen jammed in a rebound off his own shot to break a 3-3 tie as Montreal scored four consecutive goals to pull out the victory over visiting St. Louis.
Brendan Gallagher and Max Domi also scored third period goals for the Habs. Tomas Tatar, Jonathan Drouin and Domi each had a goal and an assist, Gallagher also had two assists for a three-point game, and Phillip Danault scored a goal for Montreal, which snapped a two-game losing streak.
Brayden Schenn had a goal and an assist, and Sammy Blais and Vince Dunn also scored goals for St. Louis, which suffered its first regulation loss of the season. The defending Stanley Cup champions had scored a point in four straight games to begin the season to match a franchise record.
Rookie Sam Lafferty and Adam Johnson scored their first NHL goals, and goalie Matt Murray earned his 100th career win as visiting Pittsburgh downed winless Minnesota.
Sidney Crosby, Kris Letang, Johnson and Patric Hornqvist each had a goal and an assist, and Joseph Blandisi and Jake Guentzel also scored for the Penguins. Murray made 29 saves to improve to 100-44-14. He also got his fourth career assist.
Jared Spurgeon had a goal and two assists, Brad Hunt a goal and an assist, and Jason Zucker and Luke Kunin scored for the Wild in their home opener. Minnesota fell to 0-4-0.
Tuukka Rask stopped all 31 shots he faced in his first shutout of the season as Boston beat visiting New Jersey.
Brad Marchand, Joakim Nordstrom and Patrice Bergeron scored as the Bruins (4-1-0) won for the fourth time in five games to begin the new year. Rask turned away just six shots in the third period to complete the shutout.
Cory Schneider made 29 saves for the Devils (0-3-2), who have dropped five straight to begin the season. New Jersey was shutout for the second time in four nights.
Jets 3, Blackhawks 2 (OT)
Mark Scheifele scored on a one-timer 47 seconds into overtime to lift Winnipeg to a come-from-behind win at Chicago.
Blake Wheeler slipped a pass to Scheifele, who blasted a shot from the top of the left circle to cap the Jets' comeback. Winnipeg (4-2-0) trailed 2-0 in the first before scoring the final three goals to earn its third straight win.
Jets goaltender Connor Hellebuyck stopped 27 of 20 shots to improve to 3-1-0 on the season. Blackhawks goaltender Robin Lehner turned aside 30 of 33 shots in his team debut with Chicago.
Defenseman John Carlson and winger Tom Wilson each collected a goal and an assist as Washington cruised past host Dallas.
Evgeny Kuznetsov and captain Alex Ovechkin (an empty-netter) also tallied, and Ilya Samsonov made 24 saves for the Capitals, who snapped a three-game winless skid (0-1-2) and avenged a 4-3 overtime loss to Dallas on Tuesday.
Radek Faksa scored on a wraparound at the seven-minute mark of the third period, and Anton Khudobin turned aside 21 shots for the Stars, who sustained just their second regulation loss to Washington in their last 18 games (13-2-3). The Stars dropped to 1-4-1 on the season.
Islanders 3, Panthers 2 (SO)
Brock Nelson scored the first -- and only -- goal in the shootout as New York edged Florida in Uniondale, N.Y.
Anders Lee and Josh Bailey scored for the Islanders, who snapped a two-game losing streak. Semyon Varlamov made 35 saves in regulation and overtime before stopping all three shots he faced in the shootout.
Denis Malgin and Evgenii Dadonov scored for the Panthers, who lost in the shootout for the second time in as many nights and have lost three in a row overall. Goalie Sam Montembeault recorded 26 saves in his first start of the season.
Pierre-Luc Dubois scored 1:15 into the third period as Columbus handed Carolina its first loss of the season in Raleigh, N.C.
It also was the first victory in regulation for the Blue Jackets, who were in their fifth game. Markus Nutivaara and Oliver Bjorkstrand scored earlier for Columbus. Ryan Murray and Alexander Wennberg both had two assists for the Blue Jackets.
Erik Haula, who scored his team-leading fifth goal, and Dougie Hamilton scored for Carolina. Hamilton, a defenseman, has a career-long four-game goal streak.
A three-point game for Vladislav Namestnikov led Ottawa over visiting Tampa Bay for its first victory of the season.
After twice surrendering leads in the game, the Senators went ahead for good when Namestnikov scored 16:57 into the final frame. Namestnikov added an empty-net goal in the final minute, and also collected an assist on Jean-Gabriel Pageau's goal in the second period.
The Senators acquired Namestnikov in a trade with the Rangers on Monday, and the forward has already made an immediate impact with his new team. Namestnikov also collected an assist in his first game as a Senator, a 6-4 loss to the Blues on Thursday.
Mark Stone and William Carrier each had a goal and an assist, and Marc-Andre Fleury had 33 saves as Vegas snapped a two-game losing streak with a victory over visiting Calgary.
Tomas Nosek, Paul Stastny, Ryan Reaves and Cody Glass also scored goals for the Golden Knights, who improved to 5-0 all-time against the Flames at T-Mobile Arena, outscoring them 21-7 in the process. Max Pacioretty added two assists for Vegas, which scored the final five goals of the game.
Rasmus Andersson and Johnny Gaudreau scored goals, and David Rittich finished with 24 saves for Calgary.
Nicholas Shore and Ilya Mikheyev each had a goal and an assist as Toronto turned a one-goal deficit into a blowout in Detroit.
Alexander Kerfoot, Jake Muzzin and Trevor Moore also scored for the Leafs, while Frederik Andersen made 25 saves. Jacob de la Rose had a goal and an assist for the Wings and Darren Helm also scored. Jimmy Howard stopped 36 shots.
Detroit scored first at 3:44, but the Leafs tied it by the end of the first period, carried a 2-1 lead into the third, and put the game away with a pair of goals in the final 6 1/2 minutes.
Canucks 3, Flyers 2 (SO)
Tanner Pearson scored in regulation and also netted the shootout winner as Vancouver defeated visiting Philadelphia.
Brock Boeser also scored for the Canucks, and goaltender Jacob Markstrom made 30 saves. Markstrom stopped Kevin Hayes' shootout attempt to clinch the victory.
Carsen Twarynski and Oskar Lindblom scored for the Flyers. Carter Hart made 22 saves but failed in his bid to become the first goalie in NHL history age 21 or younger to win his team's first three games of a season.
|
english
|
import React from "react";
import styled from "@emotion/styled";
import tw from "tailwind.macro";
import colors from "../../colors";
const CTALink = styled.a`
${tw`relative no-underline items-center justify-between py-2 px-6`}
background: #5c74ec;
color: white;
border-radius: 4px;
cursor: pointer;
& :hover {
filter: darken(10%);
& img {
transform: translate3d(-5px, 0, 0);
}
}
`;
const CTALinkComponent: React.FC = ({ text }) => {
return (
<div style={{}}>
<CTALink className="blogCTABotLauncher">{text}</CTALink>
</div>
);
};
export default CTALinkComponent;
|
typescript
|
<gh_stars>1-10
#include <iostream>
#include <iomanip>
long double harmonic_mean(long double a, long double b) {
return a + b == 0 ? 0 : 2 * a * b / (a + b);
}
int main() {
size_t size;
std::cin >> size;
unsigned int sum = 0;
unsigned int column[size] = {};
unsigned int row[size] = {};
unsigned int trace[size];
for (size_t i = 0; i < size; ++i) {
for (size_t j = 0; j < size; ++j) {
unsigned int value;
std::cin >> value;
if (i == j) {
trace[i] = value;
}
sum += value;
row[i] += value;
column[j] += value;
}
}
long double precision = 0;
long double recall = 0;
long double score = 0;
for (size_t i = 0; i < size; ++i) {
long double local_precision = row[i] == 0 ? 0 : (double) trace[i] / row[i];
long double local_recall = column[i] == 0 ? 0 : (double) trace[i] / column[i];
long double weight = row[i];
precision += local_precision * weight;
recall += local_recall * weight;
score += harmonic_mean(local_precision, local_recall) * weight;
}
std::cout
<< std::setprecision(9)
<< harmonic_mean(precision, recall) / sum << '\n' // macro
<< score / sum << '\n'; // micro
return 0;
}
|
cpp
|
<gh_stars>1000+
/*
* Copyright 2011-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://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.lettuce.core.dynamic;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import io.lettuce.core.*;
import io.lettuce.core.dynamic.annotation.Key;
import io.lettuce.core.dynamic.annotation.Value;
import io.lettuce.core.dynamic.parameter.MethodParametersAccessor;
import io.lettuce.core.dynamic.parameter.Parameter;
import io.lettuce.core.dynamic.parameter.Parameters;
import io.lettuce.core.internal.LettuceAssert;
/**
* Default {@link MethodParametersAccessor} implementation.
*
* @author <NAME>
* @since 5.0
*/
class DefaultMethodParametersAccessor implements MethodParametersAccessor {
private final Parameters<? extends Parameter> parameters;
private final List<Object> values;
DefaultMethodParametersAccessor(Parameters<? extends Parameter> parameters, Object... values) {
LettuceAssert.notNull(parameters, "Parameters must not be null");
LettuceAssert.notNull(values, "Values must not be null");
this.parameters = parameters;
this.values = Arrays.asList(values);
}
public int getParameterCount() {
return parameters.getBindableParameters().size();
}
@Override
public Object getBindableValue(int index) {
return values.get(parameters.getBindableParameter(index).getParameterIndex());
}
@Override
public boolean isKey(int index) {
return parameters.getBindableParameter(index).findAnnotation(Key.class) != null;
}
@Override
public boolean isValue(int index) {
return parameters.getBindableParameter(index).findAnnotation(Value.class) != null;
}
@Override
public Iterator<Object> iterator() {
return new BindableParameterIterator(this);
}
@Override
public int resolveParameterIndex(String name) {
List<? extends Parameter> bindableParameters = parameters.getBindableParameters();
for (int i = 0; i < bindableParameters.size(); i++) {
if (name.equals(bindableParameters.get(i).getName())) {
return i;
}
}
throw new IllegalArgumentException(String.format("Cannot resolve named parameter %s", name));
}
public Parameters<? extends Parameter> getParameters() {
return parameters;
}
@Override
public boolean isBindableNullValue(int index) {
Parameter bindableParameter = parameters.getBindableParameter(index);
if (bindableParameter.isAssignableTo(Limit.class) || bindableParameter.isAssignableTo(io.lettuce.core.Value.class)
|| bindableParameter.isAssignableTo(KeyValue.class) || bindableParameter.isAssignableTo(ScoredValue.class)
|| bindableParameter.isAssignableTo(GeoCoordinates.class) || bindableParameter.isAssignableTo(Range.class)) {
return false;
}
return true;
}
/**
* Iterator class to allow traversing all bindable parameters inside the accessor.
*/
static class BindableParameterIterator implements Iterator<Object> {
private final int bindableParameterCount;
private final DefaultMethodParametersAccessor accessor;
private int currentIndex = 0;
/**
* Creates a new {@link BindableParameterIterator}.
*
* @param accessor must not be {@code null}.
*/
BindableParameterIterator(DefaultMethodParametersAccessor accessor) {
LettuceAssert.notNull(accessor, "ParametersParameterAccessor must not be null!");
this.accessor = accessor;
this.bindableParameterCount = accessor.getParameters().getBindableParameters().size();
}
/**
* Return the next bindable parameter.
*
* @return
*/
public Object next() {
return accessor.getBindableValue(currentIndex++);
}
public boolean hasNext() {
return bindableParameterCount > currentIndex;
}
public void remove() {
throw new UnsupportedOperationException();
}
}
}
|
java
|
<reponame>YunLemon/simperium-android<gh_stars>10-100
package com.simperium.test;
import com.simperium.client.Bucket;
import com.simperium.client.Ghost;
import com.simperium.client.GhostMissingException;
import com.simperium.client.GhostStorageProvider;
import java.util.HashMap;
import java.util.Map;
public class MockGhostStore implements GhostStorageProvider {
private Map<String,Map<String,Ghost>> data = new HashMap<String,Map<String,Ghost>>();
private Map<String,String> versions = new HashMap<String,String>();
/**
* Check if the store has a change version for the provided bucket
*/
@Override
public boolean hasChangeVersion(Bucket bucket){
return versions.containsKey(bucket.getName());
}
/**
* Returns wether the bucket's saved version matches the given version
*/
@Override
public boolean hasChangeVersion(Bucket bucket, String version){
return hasChangeVersion(bucket) && versions.get(bucket.getName()).equals(version);
}
/**
* Returns the current change version for the bucket
*/
@Override
public String getChangeVersion(Bucket bucket){
return versions.get(bucket.getName());
}
/**
* Updates the change version for the given bucket
*/
@Override
public void setChangeVersion(Bucket bucket, String version){
versions.put(bucket.getName(), version);
}
/**
* Checks if there is a ghost for given bucket and key
*/
@Override
public boolean hasGhost(Bucket bucket, String key){
return ghostsForBucket(bucket).containsKey(key);
}
/**
* Builds a ghost from the provided bucket and key
*/
@Override
public Ghost getGhost(Bucket bucket, String key) throws GhostMissingException {
Map<String,Ghost> ghosts = ghostsForBucket(bucket);
Ghost ghost = ghosts.get(key);
if (ghost == null) {
throw(new GhostMissingException());
}
return ghost;
}
@Override
public int getGhostVersion(Bucket bucket, String key) throws GhostMissingException {
Map<String,Ghost> ghosts = ghostsForBucket(bucket);
Ghost ghost = ghosts.get(key);
if (ghost == null) {
throw(new GhostMissingException());
}
return ghost.getVersion();
}
/**
* Saves the provided ghost to the bucket
*/
@Override
public void saveGhost(Bucket bucket, Ghost ghost){
Map<String,Ghost> ghosts = ghostsForBucket(bucket);
ghosts.put(ghost.getSimperiumKey(), ghost);
}
/**
* Remove the ghost with the provided key from the store
*/
@Override
public void deleteGhost(Bucket bucket, String key){
Map<String,Ghost> ghosts = ghostsForBucket(bucket);
ghosts.remove(key);
}
/**
* Clear all ghost data and change version for the given bucket
*/
@Override
public void resetBucket(Bucket bucket){
data.put(bucket.getName(), new HashMap<String,Ghost>());
}
protected Map<String,Ghost> ghostsForBucket(Bucket bucket){
String name = bucket.getName();
Map<String,Ghost> ghosts = data.get(name);
if (ghosts == null) {
resetBucket(bucket);
return ghostsForBucket(bucket);
}
return ghosts;
}
}
|
java
|
import * as React from "react";
import { Country } from "src/assets/country-list";
import { Flag } from "../flag";
import cx from "classnames";
import { MutableRefObject, useCallback } from "react";
interface Props {
country: Country;
isSelected: boolean;
onClick: (country: Country) => void;
showCountryCodeInList: boolean;
showFlags: boolean;
emojiFlags: boolean;
countryItemRefs: MutableRefObject<(HTMLDivElement | null)[]> | null;
}
export const ListItem: React.FC<Props> = React.memo(
({
country,
onClick,
showCountryCodeInList,
showFlags,
emojiFlags,
countryItemRefs,
isSelected,
}: Props) => {
const onClickHandler = useCallback((): void => {
onClick(country);
}, []);
const setCountryItemsRefs = useCallback((ref: HTMLDivElement): void => {
if (countryItemRefs) {
countryItemRefs.current.push(ref);
}
}, []);
return (
<div
data-testid="list-item"
ref={setCountryItemsRefs}
className={cx("country-selector-list__item", {
"country-selector-list__item--selected": isSelected,
})}
onClick={onClickHandler}
>
{showFlags && (
<div
className={
"country-selector-list__item__flag-container"
}
>
<Flag emojiFlags={emojiFlags} country={country} />
</div>
)}
<div
className={"country-selector-text"}
data-testid="country-text"
>
{country.name}
{showCountryCodeInList && (
<div
className={"country-selector-code"}
data-testid="country-code"
>
{`(${country.countryCallingCodes[0]})`}
</div>
)}
</div>
</div>
);
},
);
|
typescript
|
<reponame>Akrivus/MoeMagic
{
"aliases": [
"minecraft:granite_slab",
"minecraft:granite_stairs",
"minecraft:granite_wall",
"minecraft:polished_granite",
"minecraft:polished_granite_slab",
"minecraft:polished_granite_stairs"
]
}
|
json
|
import iBook from '@dto/iBook'
import { Model } from 'objection'
export default class Book extends Model {
static get tableName () {
return 'books'
}
static serialize (book: iBook): any {
return book
}
static deserialize (serialized: any): iBook {
return serialized as iBook
}
}
|
typescript
|
# HX711 Load Cell Amplifier
The `hx711` sensor platform allows you to use your HX711 load cell amplifier ([datasheet](https://www.mouser.com/ds/2/813/hx711_english-1022875.pdf), [Sparkfun](https://www.sparkfun.com/products/13879)) with esphomelib

HX711 Load Cell Amplifier. Image by [Sparkfun](https://www.sparkfun.com/products/13879) licensed and re-distributed under [CC BY 2.0](https://creativecommons.org/licenses/by/2.0/).
Connect `GND` to `GND`, `VCC` to `3.3V` and the other three `MISO` (or `SO` for short), `CS` and `CLOCK` (or `SCK`) to free GPIO pins.
```
# 配置示例
sensor:
- platform: hx711
name: "HX711 Value"
dout_pin: D0
clk_pin: D1
gain: 128
update_interval: 60s
```
## **配置参数**
- **name** (**必填**, 字符串): The name for the load cell sensor.
- **dout_pin** (**必填**, [Pin Schema](https://esphome.io/guides/configuration-types#config-pin-schema)): The DOUT (or DAT) pin.
- **clk_pin** (**必填**, [Pin Schema](https://esphome.io/guides/configuration-types#config-pin-schema)): The CLK pin.
- **update_interval** (*选填*, [时长](esphome/guides/configuration-types#时长)): The interval to check the sensor. Defaults to `60s`.
- **id** (*选填*, [ID](esphome/guides/configuration-types#id)): Manually specify the ID used for code generation.
- All other options from [Sensor](https://esphome.io/components/sensor/#config-sensor) and [MQTT Component](https://esphome.io/components/mqtt#config-mqtt-component).
## Converting Units
As the HX711 does not have any calibration data, you have to convert the measurement to units yourself. To calibrate the sensor:
1. Place nothing or a known mass on the sensor, for example `0kg`
2. Wait for the data to arrive in the logs and write down the value. For example `120`.
3. Place another (different) known mass on the sensor, for example `1kg`
4. Again wait for the data to arrive and note the value, for example `810`.
Once you’ve done those steps, you can use the `map` function to map the incoming value to the calibrated one:
```
# 配置示例
sensor:
- platform: hx711
# ... Other HX711 options
filters:
- lambda: |-
auto first_mass = 0.0; // first known mass was 0kg
auto first_value = 120.0; // value for the first known mass was 120
auto second_mass = 1.0; // second mass was 1kg
auto second_value = 810.0; // second value was 810
return map(x, first_value, second_value, first_mass, second_mass);
unit_of_measurement: kg
```
Replace the masses and values `120.0`, `810.0`, etc with your values.
|
markdown
|
<reponame>jeremyosborne/fthis
{
"name": "fthis",
"version": "0.0.2",
"description": "generate common files (like index.html)",
"main": "fthis.js",
"bin": "fthis.js",
"repository": {
"type": "git",
"url": "git+ssh://git@github.com/jeremyosborne/fthis.git"
},
"keywords": [
"file",
"generation",
"generator",
"euphemism"
],
"author": "<NAME>",
"license": "MIT",
"bugs": {
"url": "https://github.com/jeremyosborne/fthis/issues"
},
"homepage": "https://github.com/jeremyosborne/fthis#readme",
"preferGlobal": true,
"dependencies": {
"glob": "^5.0.5",
"minimist": "^1.1.1"
}
}
|
json
|
/*
* Copyright 2007-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at:
*
* http://aws.amazon.com/apache2.0/
*
* or in the "license" file accompanying this file. This file 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 software.amazon.ion;
/**
* An error caused by a request for an Ion version that is not supported by
* this implementation.
*/
public class UnsupportedIonVersionException
extends IonException
{
private static final long serialVersionUID = -1166749371823975664L;
private final String _unsupportedIonVersionId;
public UnsupportedIonVersionException(String unsupportedIonVersionId)
{
_unsupportedIonVersionId = unsupportedIonVersionId;
}
public String getUnsuportedIonVersionId()
{
return _unsupportedIonVersionId;
}
@Override
public String getMessage()
{
return "Unsupported Ion version " + _unsupportedIonVersionId;
}
}
|
java
|
{"t":"mipacomoday","h":[{"d":[{"f":"送進去了、弄進去了。","e":["`Mipacomod~`ay~ `ci~ `safa~ `i~ `laloma'~.弟弟進屋裡了。"]},{"f":"指送進者,把東西弄進去的人。","e":["`O~ `kako~ `ko~ `mipacomod~`ay~ `ci~ `safa~`a~`n~.是我送弟弟進去的。"]}]}],"stem":"comod"}
|
json
|
<reponame>hyperdivision/blockexplorers<gh_stars>1-10
module.exports = {
name: 'Bitcoin',
symbol: 'BTC',
blockstreaminfo: require('./blockstreaminfo'),
blockcyphercom: require('./blockcyphercom'),
bitcoincom: require('./bitcoincom'),
btccom: require('./btccom')
}
|
javascript
|
In a recent interview back in his homeland, Japanese wrestling star Keiichi Yamada aka Jushin Thunder Liger, confessed that he is in the twilight years of his career – which he describes as the ‘final chapter’ – and already has his retirement chalked out, reports wrestlinginc. com.
Being over 50, Liger knows that his best days will soon be behind him and has stated that he will almost certainly hang up his wrestling boots in the next five years, which is a rather long period for someone who’s already broached the subject of retirement.
Nevertheless, Liger boasts of a distinguished wrestling career that spans nearly thirty years and includes stints with All-Star Wrestling, New Japan Pro Wrestling, World Championship Wrestling, Ring of Honor and TNA, among others.
The 51-year-old even made an appearance in WWE, who invited him as a special guest for a match against Tyler Breeze at NXT Takeover: Brooklyn last year, with the match being won by the Japanese Superstar.
Liger also forayed into Mixed Martial Arts back in 2002 but was easily defeated by opponent Minoru Suzuki in the former’s first and last MMA bout.
Trophies have followed Liger, with the star winning over thirty trophies in his distinguished career.
|
english
|
{
"an7.88:0.1": "Nummerierte Lehrreden 7 ",
"an7.88:0.2": "9. Asketen ",
"an7.88:0.3": "88. Eine Gelehrte ",
"an7.88:1.1": "„Mönche und Nonnen, weil man sieben Dinge ausgespült hat, ist man eine Gelehrte …“ "
}
|
json
|
[
{
"DeniedAlternatives": [],
"Files": {
"objects/skath/skathshotgundisplay/skathshotgundisplay.object": [
"/description"
]
},
"Texts": {
"Chs": "一支绘世者等离子猎枪,退役后用于展示。",
"Eng": "A Skath Plasma Shotgun, decommissioned for display."
}
},
{
"DeniedAlternatives": [],
"Files": {
"objects/skath/skathshotgundisplay/skathshotgundisplay.object": [
"/novakidDescription"
]
},
"Texts": {
"Chs": "一把看起来非常危险的绘世者猎枪。",
"Eng": "A mighty dangerous lookin' Skath Shotgun."
}
},
{
"DeniedAlternatives": [],
"Files": {
"objects/skath/skathshotgundisplay/skathshotgundisplay.object": [
"/skathDescription"
]
},
"Texts": {
"Chs": "突击猎枪是一种快速射击的猎枪。每次射击都会增加穿墙或穿甲的几率。",
"Eng": "An Assault Shotgun is a rapid firing shotgun. The chances of penetrating walls or armour increases with each shot."
}
},
{
"DeniedAlternatives": [],
"Files": {
"objects/skath/skathshotgundisplay/skathshotgundisplay.object": [
"/humanDescription"
]
},
"Texts": {
"Chs": "突击猎枪,嗯?这是一个奇怪的组合。",
"Eng": "Assault Shotgun, eh? That's a weird mix."
}
},
{
"DeniedAlternatives": [],
"Files": {
"objects/skath/skathshotgundisplay/skathshotgundisplay.object": [
"/shortdescription"
]
},
"Texts": {
"Chs": "绘世者猎枪展台",
"Eng": "Skath Shotgun Display"
}
}
]
|
json
|
import React from 'react'
import { Link } from 'gatsby'
import { useSiteMetadata } from '../../../hooks/useSiteMetadata'
import './MenuItems.css'
export const MenuItems = () => {
const { menuItems } = useSiteMetadata()
const url = typeof window !== 'undefined' ? window.location.href : ''
const onPost = url.indexOf('/tag/') !== -1 || url.indexOf('/post/') !== -1
return (
<div>
<ul id='MenuItems'>
<Link to='/' activeClassName='active' className={onPost ? 'active' : ''}>
<li>Posts</li>
</Link>
{menuItems &&
menuItems.map((menuItem) => {
return (
<Link
to={menuItem.path}
activeClassName='active'
key={menuItem.title}
partiallyActive
>
<li>{menuItem.title}</li>
</Link>
)
})}
<Link to='/labs/' activeClassName='active' partiallyActive>
<li>Labs</li>
</Link>
</ul>
</div>
)
}
|
javascript
|
<reponame>charles-halifax/recipes
{
"directions": [
"Process the watermelon and milk together in a blender until smooth. Add the sugar and blend another 10 seconds to incorporate. Serve immediately."
],
"ingredients": [
"1 1/2 cups diced watermelon",
"2 1/4 cups milk",
"2 teaspoons white sugar"
],
"language": "en-US",
"source": "allrecipes.com",
"tags": [],
"title": "Watermelon Milkshake",
"url": "http://allrecipes.com/recipe/215579/watermelon-milkshake/"
}
|
json
|
<filename>posts/archive/20201231 - 2020 Reflection.html
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-128651188-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-128651188-1');
</script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon"
href="/favicon_vpW_icon.ico">
<title><NAME></title>
<!-- Bootstrap core CSS -->
<link href="/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom fonts for this template -->
<link href="/vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href='https://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
<!-- Custom styles for this template -->
<link href="/css/clean-blog.min.css" rel="stylesheet">
</head>
<body>
<style>
html, body { height: 100% }
</style>
<!-- Navigation -->
<nav class="navbar navbar-expand-lg navbar-light fixed-top" id="mainNav">
<div class="container">
<a class="navbar-brand" href="/index.html"><img src="https://raw.githubusercontent.com/davidvelleca/davidvelleca.github.io/master/Logo.png" width="250"></img></a>
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
Menu
<i class="fa fa-bars"></i>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="/index.html">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/archive.html">Archive</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/about.html">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/contact.html">Contact</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- Page Header -->
<header class="masthead" style="background-image: url('https://github.com/davidvelleca/davidvelleca.github.io/blob/master/img/BG%20-%20Index.jpg?raw=true')">
<div class="overlay"></div>
<div class="container">
<div class="row">
<div class="col-lg-8 col-md-10 mx-auto">
<div class="post-heading">
<h1>2020 In Review - My Top Moments<h1>
<h2 class="subheading">Reflecting on the Moments that Shaped my Year</h2>
<span class="meta">Posted by
<a href="https://twitter.com/DavidVelleca"><NAME></a>
on December 31, 2020</span>
</div>
</div>
</div>
</div>
</header>
<!-- Post Content -->
<article>
<div class="container">
<div class="row">
<div class="col-lg-8 col-md-10 mx-auto">
<h2 class="section-heading">Self Reflecting</h2>
<p>It's no surprise that 2020 was a difficult year for all, but even through all of the trials, there were likely some bright spots for everyone. Looking forward to 2021 and the next challenges that lie ahead, I wanted to take the opportunity to look back on 10 impactful moments in 2020. I challenge you to do the same, tag 5 connections and let 2020 go out on a high(ish) note. After all, some of our best growth and learning comes from persevering in the face of adversity.</p>
<p>My Top 10 (in no particular order):</p>
<ol>
<li>Spending 4th of July with my family - by this point, the stay at home period had been going on for about 3.5 months. We'd sacrificed so much and the numbers were starting to level off. So with some careful planning and extra caution, we were able to spend some very important time with some family members. A very bright spot!</li>
<li>Finishing my basement - I finally have a "real" home office now, and had a fun project to work on and occupy some of my "extra" time for a few months (I did the majority of the work).</li>
<li>Catching up with Friends - Used some alternative methods to keep up with everyone and reconnect. </li>
<li>Promoting a Team Member - As a manager, one of my biggest focuses is developing the talents of my team. This year, I was able to reward one of my team members with a well deserved promotion, and seriously advocate for others.</li>
<li>Starting a new Job - Thankful for my time at Mastercard, but really looking forward to the challenges that lie ahead with my new position at Cigna.</li>
<li>Being chosen to speak at Alteryx's Analyticon Conference - Well, this happened at the beginning of 2020 and was supposed to materialize in 2020, but will hopefully come to fruition in 2021.</li>
<li>Family Trips - We took two very safe and carefully planned trips this year when we realized our planned Disney trip likely wasn't going to happen (see #8). We had some great family time "camping" in cabins in Alabama and a Boy Scout property in the St. Louis Area.</li>
<li>Cancelling our Disney Trip - We were scheduled to take a vacation in October, but with a special needs daughter who is unable to tolerate a mask, had to make a difficult (but correct) decision to postpone.</li>
<li> Starting an Etsy Shop - At the beginning of 2020, I purchased a 3D Printer. It's been a great distraction and an awesome toy to learn with. The biggest moment was when in August I decided to try to sell some of my designs with decent success (especially for not really marketing all that well). <a href="https://www.etsy.com/shop/DCVDesigns" target="_blank">Check it out here if you're interested.</a></li>
<li>and finally...March 20 - That's the last day I worked in a real office environment. A lot has changed since then, including accepting my current role at Cigna that will be remote even after all of the WFH situations change for many. I miss the ability to walk to a colleague's desk and have a conversation, but I am relishing the challenge of collaborating in different ways.</li>
</ul>
<p>Being able to look back, reflect and grow from major moments (most positive, and at least one negative) is a super valuable exercise. As we move into 2021, I'll be looking to continue the reflection on a more regular basis.</p>
<p>Happy New Year to all, and here's to an even more productive 2021!</p>
</div>>
</div>
</div>
</article>
<hr>
<!-- Footer -->
<footer>
<div class="container">
<div class="row">
<div class="col-lg-8 col-md-10 mx-auto">
<ul class="list-inline text-center">
<li class="list-inline-item">
<a href="https://twitter.com/davidvelleca">
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-twitter fa-stack-1x fa-inverse"></i>
</span>
</a>
<li class="list-inline-item">
<a href="https://public.tableau.com/profile/david.c.velleca#!/">
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-bar-chart fa-stack-1x fa-inverse"></i>
</span>
</a>
<li class="list-inline-item">
<a href="https://www.linkedin.com/in/davidvelleca/">
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-linkedin fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
</ul>
<p class="copyright text-muted">Copyright © davidvelleca.com 2018</p>
</div>
</div>
</div>
</footer>
<!-- Bootstrap core JavaScript -->
<script src="vendor/jquery/jquery.min.js"></script>
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- Custom scripts for this template -->
<script src="js/clean-blog.min.js"></script>
</body>
</html>
|
html
|
// @flow
import React, { Component, Fragment } from 'react'
import { compose } from 'redux'
import { connect } from 'react-redux'
import { createStructuredSelector } from 'reselect'
import { translate } from 'react-i18next'
import type { T } from 'types/common'
import type { AsyncState } from 'reducers/bridgeSync'
import { globalSyncStateSelector } from 'reducers/bridgeSync'
import { BridgeSyncConsumer } from 'bridge/BridgeSyncContext'
import CounterValues from 'helpers/countervalues'
import { Rotating } from 'components/base/Spinner'
import Box from 'components/base/Box'
import IconRefresh from 'icons/Refresh'
import IconExclamationCircle from 'icons/ExclamationCircle'
import IconCheckCircle from 'icons/CheckCircle'
import ItemContainer from './ItemContainer'
const mapStateToProps = createStructuredSelector({ globalSyncState: globalSyncStateSelector })
type Props = {
// FIXME: eslint should see that it is used in static method
isGlobalSyncStatePending: boolean, // eslint-disable-line react/no-unused-prop-types
isPending: boolean,
isError: boolean,
onClick: void => void,
t: T,
}
type State = {
hasClicked: boolean,
isGlobalSyncStatePending: boolean,
isFirstSync: boolean,
}
class ActivityIndicatorInner extends Component<Props, State> {
state = {
hasClicked: false,
isFirstSync: true,
// FIXME: eslint should see that it is used in static method
isGlobalSyncStatePending: false, // eslint-disable-line react/no-unused-state
}
static getDerivedStateFromProps(nextProps: Props, prevState: State) {
const nextState = {
...prevState,
isGlobalSyncStatePending: nextProps.isGlobalSyncStatePending,
}
if (prevState.hasClicked && !nextProps.isGlobalSyncStatePending) {
nextState.hasClicked = false
}
if (prevState.isGlobalSyncStatePending && !nextProps.isGlobalSyncStatePending) {
nextState.isFirstSync = false
}
return nextState
}
handleRefresh = () => {
const { onClick } = this.props
this.setState({ hasClicked: true })
onClick()
}
render() {
const { isPending, isError, t } = this.props
const { hasClicked, isFirstSync } = this.state
const isDisabled = hasClicked || isError
const isRotating = isPending && (hasClicked || isFirstSync)
return (
<ItemContainer isDisabled={isDisabled} onClick={isDisabled ? undefined : this.handleRefresh}>
<Rotating
size={16}
isRotating={isRotating}
color={isError ? 'alertRed' : isRotating ? undefined : 'positiveGreen'}
>
{isError ? (
<IconExclamationCircle size={16} />
) : isRotating ? (
<IconRefresh size={16} />
) : (
<IconCheckCircle size={16} />
)}
</Rotating>
<Box
ml={2}
ff="Open Sans|SemiBold"
color={isError ? 'alertRed' : undefined}
fontSize={4}
horizontal
align="center"
>
{isRotating ? (
t('common:sync.syncing')
) : isError ? (
<Fragment>
<Box>{t('common:sync.error')}</Box>
<Box
ml={2}
cursor="pointer"
style={{ textDecoration: 'underline', pointerEvents: 'all' }}
onClick={this.handleRefresh}
>
{t('common:sync.refresh')}
</Box>
</Fragment>
) : (
t('common:sync.upToDate')
)}
</Box>
</ItemContainer>
)
}
}
const ActivityIndicator = ({ globalSyncState, t }: { globalSyncState: AsyncState, t: T }) => (
<BridgeSyncConsumer>
{setSyncBehavior => (
<CounterValues.PollingConsumer>
{cvPolling => {
const isPending = cvPolling.pending || globalSyncState.pending
const isError = cvPolling.error || globalSyncState.error
return (
<ActivityIndicatorInner
t={t}
isPending={isPending}
isGlobalSyncStatePending={globalSyncState.pending}
isError={!!isError && !isPending}
onClick={() => {
cvPolling.poll()
setSyncBehavior({ type: 'SYNC_ALL_ACCOUNTS', priority: 5 })
}}
/>
)
}}
</CounterValues.PollingConsumer>
)}
</BridgeSyncConsumer>
)
export default compose(
translate(),
connect(mapStateToProps),
)(ActivityIndicator)
|
javascript
|
{
"ConnectionStrings": {
"DefaultConnection": "Server=MPC-1\\SQLEXPRESS;Database=FNews;User Id=sa;Password=<PASSWORD>;MultipleActiveResultSets=true"
}
}
|
json
|
<reponame>Cluedo-MLH-Hackathon/Cluedo-Project
import os
import shutil
def recursive_walk(folder):
for folderName, subfolders, filenames in os.walk(folder):
if subfolders:
for subfolder in subfolders:
recursive_walk(subfolder)
#print('\nFolder: ' + folderName + '\n')
for filename in filenames:
if filename.endswith('.exe'):
shutil.copy(folderName+"\\"+filename, dir_dst)
#print(filename)
unallowed = ['desktop.ini','WindowsApps']
l=os.listdir("C:\\Program Files\\")
dir_src = ("C:\\Program Files\\")
dir_dst = ("C:\\BenignFiles\\")
for i in l:
if i in unallowed:
continue
print('C:\\Program Files\\' +i)
recursive_walk('C:\\Program Files\\'+i)
|
python
|
Arsene Wenger is confident Aaron Ramsey will extend his stay at Arsenal into a second decade as talks continue over a contract extension.
The midfielder, who signed from Cardiff City in 2008, is free to leave when his current deal expires at the end of next season, sparking concerns the club may be forced to cash in on another key player.
Alexis Sanchez's hesitation to commit his future paved the way for a January move to Manchester United, but Wenger does not anticipate a similar problem with Ramsey.
The Wales international has impressed with nine goals in all competitions amid the Gunners' underwhelming campaign.
"We are communicating," Wenger said of discussions with Ramsey's representatives. "I'm confident. He's not at the end of his contract, he has one and a half years to go.
"From my side it is clear, but you always have to find an agreement. We want him to stay.
"He's one of these guys who has been here for a long time. He will be an important player in the future of this club."
Ramsey's prominence at Arsenal has been helped by a reduction in the injury issues that restricted him to just 13 league starts last term.
Wenger believes the 27-year-old is now over the troubles that have often hindered his development.
"He's always been very fit, but it's been about getting to the core of the problems," he said.
"Sometimes there is a reoccurrence of an injury. It's a little bit like an engine in Formula One, you have to find out where the problem lies and what you have to change.
"Sometimes it can be a single movement to change and that can take time."
|
english
|
<filename>example-parent/basic-example/src/main/java/com/speedment/example/basic_example/RestBackEnd.java
/**
*
* Copyright (c) 2006-2018, Speedment, Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); You may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.speedment.example.basic_example;
import com.company.sakila.SakilaApplication;
import com.company.sakila.db0.sakila.film.Film;
import com.company.sakila.db0.sakila.film.FilmManager;
import static com.speedment.example.basic_example.util.ExampleUtil.buildApplication;
import com.speedment.runtime.core.ApplicationBuilder.LogType;
import java.util.function.UnaryOperator;
import java.util.stream.Stream;
/**
*
* @author <NAME>
*/
public class RestBackEnd {
private final SakilaApplication app;
private final FilmManager films;
public RestBackEnd() {
app = buildApplication(b -> b.withLogging(LogType.STREAM_OPTIMIZER));
films = app.getOrThrow(FilmManager.class);
}
public static void main(String[] args) {
new RestBackEnd().run();
}
private void run() {
serveFilms("PG-13", 0).forEach(System.out::println);
serveFilms("PG-13", 1).forEach(System.out::println);
serveFilms("PG-13", 3).forEach(System.out::println);
}
private static final long PAGE_SIZE = 50;
private Stream<Film> serveFilms(String rating, int page) {
System.out.format("serveFilms(String rating=%s, int page=%d) %n", rating, page);
Stream<Film> stream = films.stream();
if (rating != null) {
stream = stream.filter(Film.RATING.equal(rating));
}
return stream
.sorted(Film.LENGTH)
.skip(page * PAGE_SIZE)
.limit(PAGE_SIZE);
}
private Stream<Film> serveFilmsVariant(String rating, int page) {
System.out.format("serveFilmsVariant(String rating=%s, int page=%d) %n", rating, page);
Stream<Film> stream = films.stream()
.sorted(Film.LENGTH.reversed())
.sorted(Film.RELEASE_YEAR)
.filter(Film.LENGTH.greaterThan(2));
if (rating != null) {
stream = stream.filter(Film.RATING.equal(rating));
}
return stream
.skip(page * PAGE_SIZE)
.limit(PAGE_SIZE);
}
private Stream<Film> serveFilmsWithfunctionalFold(String rating, int page) {
System.out.format("serveFilmsWithfunctionalFold(String rating=%s, int page=%d) %n", rating, page);
return Stream.<UnaryOperator<Stream<Film>>>of(
(s) -> rating == null ? s : s.filter(Film.RATING.equal(rating)),
s -> s.sorted(Film.LENGTH),
s -> s.skip(page * PAGE_SIZE),
s -> s.limit(PAGE_SIZE)
).reduce(
films.stream(),
(s, o) -> o.apply(s),
(a, b) -> a
);
}
}
|
java
|
import torch
import torch.nn as nn
import torch.utils.checkpoint as cp
class basic_conv(nn.Module):
def __init__(self, in_ch, out_ch, group=8, dilation_rate=1, memory_efficient=True):
super(basic_conv, self).__init__()
self.memory_efficient = memory_efficient
self.conv = nn.Conv2d(in_ch, out_ch, 3, dilation=dilation_rate, padding=dilation_rate)
self.relu = nn.ReLU(inplace=True)
self.norm = nn.GroupNorm(group, out_ch, eps=0.1)
def bn_function(self, inputs):
concated_features = torch.cat(inputs, dim=1)
bottleneck_output = self.norm(self.relu(self.conv(concated_features))) # noqa: T484
return bottleneck_output
# todo: rewrite when torchscript supports any
def any_requires_grad(self, input):
for tensor in input:
if tensor.requires_grad:
return True
return False
@torch.jit.unused # noqa: T484
def call_checkpoint_bottleneck(self, input):
def closure(*inputs):
return self.bn_function(inputs)
return cp.checkpoint(closure, *input)
@torch.jit._overload_method # noqa: F811
def forward(self, input):
pass
@torch.jit._overload_method # noqa: F811
def forward(self, input):
pass
# torchscript does not yet support *args, so we overload method
# allowing it to take either a List[Tensor] or single Tensor
def forward(self, input): # noqa: F811
if isinstance(input, torch.Tensor):
prev_features = [input]
else:
prev_features = input
if self.memory_efficient and self.any_requires_grad(prev_features):
if torch.jit.is_scripting():
raise Exception("Memory Efficient not supported in JIT")
bottleneck_output = self.call_checkpoint_bottleneck(prev_features)
else:
bottleneck_output = self.bn_function(prev_features)
return bottleneck_output
class Dense_Atrous_Convs_Block(nn.Module):
def __init__(self, in_ch, growth_rate, group=8, downsample=True):
super(Dense_Atrous_Convs_Block, self).__init__()
self.basic_conv_list = nn.ModuleList([])
self.basic_conv_list.append(basic_conv(in_ch, growth_rate, group=group, dilation_rate=1))
self.basic_conv_list.append(basic_conv(in_ch + growth_rate, growth_rate, group=group, dilation_rate=2))
self.basic_conv_list.append(basic_conv(in_ch + growth_rate * 2, growth_rate, group=group, dilation_rate=5))
self.basic_conv_list.append(basic_conv(in_ch + growth_rate * 3, growth_rate, group=group, dilation_rate=1))
self.basic_conv_list.append(basic_conv(in_ch + growth_rate * 4, growth_rate, group=group, dilation_rate=2))
self.basic_conv_list.append(basic_conv(in_ch + growth_rate * 5, growth_rate, group=group, dilation_rate=5))
self.conv_f = nn.Sequential(
nn.Conv2d(in_ch + growth_rate * 6, growth_rate * 4, 1),
nn.ReLU(inplace=True)
)
self.downsample = downsample
if self.downsample:
self.conv_d = nn.Sequential(
nn.Conv2d(growth_rate * 4, growth_rate, 1, stride=2),
nn.ReLU(inplace=True)
)
def dense_forward(self, input):
features = [input]
for layer in self.basic_conv_list:
new_features = layer(features)
features.append(new_features)
return torch.cat(features, 1)
def forward(self, input):
out = self.conv_f(self.dense_forward(input))
if self.downsample:
out_d = self.conv_d(out)
return out, out_d
else:
return out
|
python
|
<reponame>rubendal/Sm4sh-Calculator-Page
{"name":"Samus","weight":108,"run_speed":1.504,"walk_speed":1.0615,"air_speed":1.03,"fall_speed":1.3,"fast_fall_speed":2.08,"air_acceleration":0.05,"gravity":0.077,"sh_air_time":43,"jumps":2,"wall_jump":true,"wall_cling":false,"crawl":false,"tether":true,"jumpsquat":4,"soft_landing_lag":2,"hard_landing_lag":4,"fh_air_time":67,"traction":0.0585,"gravity2":0.0075,"air_friction":0.0075,"initial_dash":1.86,"run_acceleration":0.12,"run_deceleration":0.04,"jump_height":37,"hop_height":18,"air_jump_height":37}
|
json
|
<filename>Assignment 4/Computer Graphics_assignment4/assignment4/src/base/App.cpp
#define _CRT_SECURE_NO_WARNINGS
#include "App.hpp"
#include "base/Main.hpp"
#include "gpu/GLContext.hpp"
#include "gpu/Buffer.hpp"
#include <cassert>
#include <cstddef>
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <type_traits>
#include "integrators.hpp"
using namespace FW;
using namespace std;
namespace {
enum VertexShaderAttributeLocations
{
ATTRIB_POSITION = 0,
ATTRIB_NORMAL = 1
};
} // namespace
App::App(void)
: common_ctrl_(CommonControls::Feature_Default & ~CommonControls::Feature_RepaintOnF5),
system_changed_(false),
shading_toggle_(false),
shading_mode_changed_(false),
camera_rotation_angle_(0.0f),
step_(0.0001f),
steps_per_update_(5),
integrator_(MIDPOINT_INTEGRATOR),
ps_type_(SIMPLE_SYSTEM),
ps_(&simple_system_),
timer_(true),
simple_system_(),
spring_system_(),
pendulum_system_(10),
cloth_system_(20, 20),
initial_implicit_(false)
{
static_assert(is_standard_layout<Vertex>::value, "struct Vertex must be standard layout to use offsetof");
initRendering();
common_ctrl_.showFPS(true);
common_ctrl_.addToggle((S32*)&ps_type_, SIMPLE_SYSTEM, FW_KEY_1, "Simple system (1)", &system_changed_);
common_ctrl_.addToggle((S32*)&ps_type_, SPRING_SYSTEM, FW_KEY_2, "R2 Spring system (2)", &system_changed_);
common_ctrl_.addToggle((S32*)&ps_type_, PENDULUM_SYSTEM, FW_KEY_3, "R4 Pendulum system (3)", &system_changed_);
common_ctrl_.addToggle((S32*)&ps_type_, CLOTH_SYSTEM, FW_KEY_4, "R5 Cloth system (4)", &system_changed_);
#ifdef COMPUTE_CLOTH_MODULE
common_ctrl_.addToggle((S32*)&ps_type_, COMPUTE_CLOTH, FW_KEY_NONE, "EXTRA: Compute cloth", &system_changed_);
#endif
common_ctrl_.addSeparator();
common_ctrl_.addToggle((S32*)&integrator_, EULER_INTEGRATOR, FW_KEY_5, "R1 Euler integrator (5)");
common_ctrl_.addToggle((S32*)&integrator_, TRAPEZOID_INTEGRATOR, FW_KEY_6, "R3 Trapezoid integrator (6)");
common_ctrl_.addToggle((S32*)&integrator_, MIDPOINT_INTEGRATOR, FW_KEY_7, "Midpoint integrator (7)");
common_ctrl_.addToggle((S32*)&integrator_, RK4_INTEGRATOR, FW_KEY_8, "EXTRA: RK4 integrator (8)");
common_ctrl_.addToggle((S32*)&integrator_, IMPLICIT_EULER_INTEGRATOR, FW_KEY_9, "EXTRA: Implicit Euler integrator (9)");
common_ctrl_.addToggle((S32*)&integrator_, IMPLICIT_MIDPOINT_INTEGRATOR, FW_KEY_0, "EXTRA: Implicit midpoint integrator (0)");
#ifdef COMPUTE_CLOTH_MODULE
common_ctrl_.addToggle((S32*)&integrator_, COMPUTE_CLOTH_INTEGRATOR, FW_KEY_NONE, "EXTRA: Compute integrator for cloth");
#endif
common_ctrl_.addSeparator();
common_ctrl_.addToggle(&shading_toggle_, FW_KEY_T, "Toggle cloth rendering mode (T)", &shading_mode_changed_);
#ifdef COMPUTE_CLOTH_MODULE
common_ctrl_.addButton(&fireBullet, FW_KEY_SPACE, "EXTRA: Fire bullet from mouse position (SPACE)");
#endif
common_ctrl_.beginSliderStack();
common_ctrl_.addSlider((F32*)&step_, 0.00001, 0.05, true, FW_KEY_NONE, FW_KEY_NONE, "Step size: %.4f", 0.0f);
common_ctrl_.addSlider((S32*)&steps_per_update_, 1, 100, false, FW_KEY_NONE, FW_KEY_NONE, "Steps per update: %d");
common_ctrl_.endSliderStack();
window_.setTitle("Assignment 4");
window_.addListener(this);
window_.addListener(&common_ctrl_);
window_.setSize(Vec2i(800, 800));
ps_->reset();
#ifdef COMPUTE_CLOTH_MODULE
compute_cloth_ = ComputeCloth(window_.getGL());
#endif
#ifdef EIGEN_SPARSECORE_MODULE_H
ps_J_ = Eigen::SparseMatrix<float>(ps_->state().size() * 3, ps_->state().size() * 3);
#endif
}
bool App::handleEvent(const Window::Event& ev) {
if (system_changed_) {
system_changed_ = false;
switch (ps_type_) {
case SIMPLE_SYSTEM:
ps_ = &simple_system_; break;
case SPRING_SYSTEM:
ps_ = &spring_system_; break;
case PENDULUM_SYSTEM:
ps_ = &pendulum_system_; break;
case CLOTH_SYSTEM:
ps_ = &cloth_system_; break;
#ifdef COMPUTE_CLOTH_MODULE
case COMPUTE_CLOTH:
integrator_ = COMPUTE_CLOTH_INTEGRATOR;
compute_cloth_.Reset(); // Reset separately since ComputeCloth doesn't inherit from ParticleSystem
break;
#endif
default:
assert(false && "invalid system type");
}
ps_->reset();
initial_implicit_ = true;
#ifdef EIGEN_SPARSECORE_MODULE_H
ps_J_ = SparseMatrix(ps_->state().size() * 3, ps_->state().size() * 3);
#endif
}
if (shading_mode_changed_) {
common_ctrl_.message(shading_toggle_ ? "EXTRA: Surface rendering" : "Wireframe rendering");
shading_mode_changed_ = false;
}
if (ev.type == Window::EventType_KeyDown) {
if (ev.key == FW_KEY_HOME)
camera_rotation_angle_ -= 0.05 * FW_PI;
else if (ev.key == FW_KEY_END)
camera_rotation_angle_ += 0.05 * FW_PI;
}
if (ev.type == Window::EventType_Mouse) {
if (ev.mouseDragging)
camera_rotation_angle_ += 0.01f * ev.mouseDelta.x;
}
if (ev.type == Window::EventType_Close) {
window_.showModalMessage("Exiting...");
delete this;
return true;
}
if (fireBullet)
{
// YOUR CODE HERE (bullet extra):
// Compute bullet origin and direction here based on current view matrix and mouse position
}
window_.setVisible(true);
if (ev.type == Window::EventType_Paint)
{
if (integrator_ != previous_integrator_ || step_ != previous_step_) {
initial_implicit_ = true;
#ifdef EIGEN_SPARSECORE_MODULE_H
ps_J_ = SparseMatrix(ps_->state().size() * 3, ps_->state().size() * 3);
#endif
}
for (int i = 0; i < steps_per_update_; ++i) {
switch (integrator_) {
case EULER_INTEGRATOR:
eulerStep(*ps_, step_); break;
case TRAPEZOID_INTEGRATOR:
trapezoidStep(*ps_, step_); break;
case MIDPOINT_INTEGRATOR:
midpointStep(*ps_, step_); break;
case RK4_INTEGRATOR:
rk4Step(*ps_, step_); break;
#ifdef EIGEN_SPARSECORE_MODULE_H
case IMPLICIT_EULER_INTEGRATOR:
implicit_euler_step(*ps_, step_, ps_J_, implicit_solver_, initial_implicit_); break;
case IMPLICIT_MIDPOINT_INTEGRATOR:
implicit_midpoint_step(*ps_, step_, ps_J_, implicit_solver_, initial_implicit_); break;
#endif
#ifdef COMPUTE_CLOTH_MODULE
case COMPUTE_CLOTH_INTEGRATOR:
compute_cloth_.Advance(step_); break;
#endif
default:
assert(false && " invalid integrator type");
}
initial_implicit_ = false;
}
previous_integrator_ = integrator_;
previous_step_ = step_;
render();
}
window_.repaint();
return false;
}
void App::initRendering() {
// Ask the Nvidia framework for the GLContext object associated with the window.
// As a side effect, this initializes the OpenGL context and lets us call GL functions.
auto ctx = window_.getGL();
glGenBuffers(1, &gl_.vertex_buffer);
glBindBuffer(GL_ARRAY_BUFFER, gl_.vertex_buffer);
// Mesh rendering setup
glGenVertexArrays(1, &gl_.mesh_vao);
glBindVertexArray(gl_.mesh_vao);
glEnableVertexAttribArray(ATTRIB_POSITION);
glVertexAttribPointer(ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex), (GLvoid*)0);
glEnableVertexAttribArray(ATTRIB_NORMAL);
glVertexAttribPointer(ATTRIB_NORMAL, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex), (GLvoid*)offsetof(Vertex, normal));
// Point and line rendering setup
glGenVertexArrays(1, &gl_.point_vao);
glBindVertexArray(gl_.point_vao);
glEnableVertexAttribArray(ATTRIB_POSITION);
glVertexAttribPointer(ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, sizeof(Vec3f), (GLvoid*)0);
glBindVertexArray(0);
auto shader_program = new GLContext::Program(
"#version 330\n"
FW_GL_SHADER_SOURCE(
layout(location = 0) in vec4 aPosition;
layout(location = 1) in vec3 aNormal;
out vec4 vColor;
uniform mat4 uWorldToClip;
const vec3 directionToLight = normalize(vec3(0.5, 0.3, 0.6));
void main()
{
float clampedCosine = clamp(dot(aNormal, directionToLight), 0.0, 1.0);
vec3 litColor = vec3(clampedCosine);
gl_Position = uWorldToClip * aPosition;
vColor = vec4(litColor, 1);
}
),
"#version 330\n"
FW_GL_SHADER_SOURCE(
in vec4 vColor;
out vec4 fColor;
void main()
{
fColor = vColor;
}
));
ctx->setProgram("shaders", shader_program);
// Get the IDs of the shader program and its uniform input locations from OpenGL.
gl_.shader_program = shader_program->getHandle();
gl_.world_to_clip_uniform = glGetUniformLocation(gl_.shader_program, "uWorldToClip");
}
void App::render()
{
// Clear screen.
glClearColor(0.3f, 0.3f, 0.3f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// Enable depth testing.
glEnable(GL_DEPTH_TEST);
// Our camera orbits around origin at a fixed distance.
static const float cameraDistance = 2.1f;
Mat4f C;
Mat3f rot = Mat3f::rotation(Vec3f(0, 1, 0), -camera_rotation_angle_);
C.setCol(0, Vec4f(rot.getCol(0), 0));
C.setCol(1, Vec4f(rot.getCol(1), 0));
C.setCol(2, Vec4f(rot.getCol(2), 0));
C.setCol(3, Vec4f(0, 0, cameraDistance, 1));
// Simple perspective.
Mat4f P;
static const float fNear = 0.1f, fFar = 4.0f;
P.setCol(0, Vec4f(1, 0, 0, 0));
P.setCol(1, Vec4f(0, 1, 0, 0));
P.setCol(2, Vec4f(0, 0, (fFar + fNear) / (fFar - fNear), 1));
P.setCol(3, Vec4f(0, 0, -2 * fFar*fNear / (fFar - fNear), 0));
Mat4f worldToClip = P * C;
if (ps_type_ == CLOTH_SYSTEM && shading_toggle_) {
// EXTRA: Render cloth surface.
}
#ifdef COMPUTE_CLOTH_MODULE
else if (ps_type_ == COMPUTE_CLOTH)
compute_cloth_.Render(shading_toggle_, worldToClip);
#endif
else {
// Draw particle system as lines and points.
glUseProgram(0);
glMatrixMode(GL_MODELVIEW);
glLoadMatrixf(&C(0, 0));
glMatrixMode(GL_PROJECTION);
glLoadMatrixf(&P(0, 0));
glBindVertexArray(gl_.point_vao);
glBindBuffer(GL_ARRAY_BUFFER, gl_.vertex_buffer);
auto p = ps_->getPoints();
glBufferData(GL_ARRAY_BUFFER, sizeof(Vec3f) * p.size(), p.data(), GL_STATIC_DRAW);
glEnable(GL_POINT_SMOOTH);
glPointSize(10.0f);
glDrawArrays(GL_POINTS, 0, p.size());
auto l = ps_->getLines();
glBufferData(GL_ARRAY_BUFFER, sizeof(Vec3f) * l.size(), l.data(), GL_STATIC_DRAW);
glEnable(GL_LINE_SMOOTH);
glLineWidth(1);
glDrawArrays(GL_LINES, 0, l.size());
}
// Undo our bindings.
glBindBuffer(GL_ARRAY_BUFFER, 0);
glBindVertexArray(0);
glUseProgram(0);
// Check for OpenGL errors.
GLContext::checkErrors();
common_ctrl_.message(sprintf("Home/End or drag mouse to rotate camera."), "instructions");
}
void FW::init(void) {
new App;
}
|
cpp
|
Honor Magic 6 is poised to be a notable advancement over its predecessor.
Best gadgets that will bring immense joy to your loved ones this Diwali.
Time is running short, but Apple has a plan.
With an IP52 rating, the Motorola Edge 2022 smartphone is water-resistant.
The Samsung Galaxy S25 series is expected to undergo substantial hardware transformations, according to recent insider tips.
As the highly anticipated Samsung Galaxy S24 series is scheduled for a Q1 2024 release.
The Redmi Note 13 series appears on Amazon and Flipkart microsites.
|
english
|
<gh_stars>0
#include "Geant/FieldPropagationHandler.h"
#include "Geant/FieldConfig.h"
#include "Geant/FieldLookup.h"
#include "Geant/GUFieldPropagatorPool.h"
#include "Geant/GUFieldPropagator.h"
#include "Geant/ConstBzFieldHelixStepper.h"
#include "Geant/ConstFieldHelixStepper.h"
#include "Geant/FieldTrack.h"
#include "Geant/Track.h"
#include <sstream>
#include "base/SOA3D.h"
// #include "SOA6D.h"
#include "Geant/VectorTypes.h" // Defines geant::Double_v etc
#include "Geant/SystemOfUnits.h"
#include "Geant/WorkspaceForFieldPropagation.h"
#include "Geant/FlexIntegrationDriver.h"
#include "navigation/NavigationState.h"
#include "Geant/ScalarNavInterfaceVG.h"
#include "Geant/ScalarNavInterfaceVGM.h"
#include "Geant/VectorNavInterface.h"
using Double_v = geant::Double_v;
// #define CHECK_VS_RK 1
//#define CHECK_VS_HELIX 1
// #define REPORT_AND_CHECK 1
// #define STATS_METHODS 1
// #define DEBUG_FIELD 1
#ifdef CHECK_VS_HELIX
#define CHECK_VS_SCALAR 1
#endif
#ifdef CHECK_VS_RK
#define CHECK_VS_SCALAR 1
#endif
namespace geant {
inline namespace GEANT_IMPL_NAMESPACE {
const double FieldPropagationHandler::gEpsDeflection = 1.E-2 * units::cm;
auto stageAfterCrossing = kPostPropagationStage;
#ifdef STATS_METHODS
static std::atomic<unsigned long> numRK, numHelixZ, numHelixGen, numTot;
#endif
//______________________________________________________________________________
VECCORE_ATT_HOST_DEVICE
FieldPropagationHandler::FieldPropagationHandler(int threshold, Propagator *propagator, double epsTol)
: Handler(threshold, propagator), fEpsTol(epsTol)
{
// Default constructor
// std::cout << " FieldPropagationHandler c-tor called: threshold= " << threshold << std::endl;
SetName("FieldPropagation");
InitializeStats();
}
//______________________________________________________________________________
VECCORE_ATT_HOST_DEVICE
void FieldPropagationHandler::InitializeStats()
{
#ifdef STATS_METHODS
numTot = 0;
numRK = 0;
numHelixZ = 0;
numHelixGen = 0;
#else
// std::cout << " Field Propagation Handler: no statistics for types of steps." << std::endl;
#endif
}
//______________________________________________________________________________
VECCORE_ATT_HOST_DEVICE
FieldPropagationHandler::~FieldPropagationHandler()
{
// Destructor
std::cerr << "Statistics from FieldPropagation destructor." << std::endl;
PrintStats();
}
//______________________________________________________________________________
void FieldPropagationHandler::Cleanup(TaskData *td)
{
delete td->fSpace4FieldProp;
td->fSpace4FieldProp = nullptr;
}
//______________________________________________________________________________
// Curvature for general field
VECCORE_ATT_HOST_DEVICE
double FieldPropagationHandler::Curvature(const Track &track) const
{
using ThreeVector_d = vecgeom::Vector3D<double>;
constexpr double tiny = 1.E-30;
constexpr double inv_kilogauss = 1.0 / units::kilogauss;
ThreeVector_d MagFld;
double bmag = 0.0;
ThreeVector_d Position(track.X(), track.Y(), track.Z());
FieldLookup::GetFieldValue(Position, MagFld, bmag); // , td);
bmag *= inv_kilogauss;
MagFld *= inv_kilogauss;
// Calculate transverse momentum 'Pt' for field 'B'
//
ThreeVector_d Momentum(track.Px(), track.Py(), track.Pz());
ThreeVector_d PtransB; // Transverse wrt direction of B
double ratioOverFld = 0.0;
if (bmag > 0) ratioOverFld = Momentum.Dot(MagFld) / (bmag * bmag);
PtransB = Momentum - ratioOverFld * MagFld;
double Pt_mag = PtransB.Mag();
return fabs(Track::kB2C * track.Charge() * bmag / (Pt_mag + tiny));
}
//______________________________________________________________________________
VECCORE_ATT_HOST_DEVICE
void FieldPropagationHandler::DoIt(Track *track, Basket &output, TaskData *td)
{
// Scalar geometry length computation. The track is moved into the output basket.
using vecCore::math::Max;
using vecCore::math::Min;
constexpr double step_push = 1.e-4;
// The minimum step is step_push in case the physics step limit is not smaller
double step_min = Min(track->GetPstep(), step_push);
// The track snext value is already the minimum between geometry and physics
double step_geom_phys = Max(step_min, track->GetSnext());
// Field step limit. We use the track sagitta to estimate the "bending" error,
// i.e. what is the propagated length for which the track deviation in
// magnetic field with respect to straight propagation is less than epsilon.
double step_field = Max(SafeLength(*track, gEpsDeflection), track->GetSafety());
double step = Min(step_geom_phys, step_field);
// Propagate in magnetic field
PropagateInVolume(*track, step, td);
// Update number of partial steps propagated in field
td->fNmag++;
// Set continuous processes stage as follow-up for tracks that reached the
// physics process
if (track->Status() == kPhysics) {
// Update number of steps to physics and total number of steps
td->fNphys++;
td->fNsteps++;
track->SetStage(stageAfterCrossing); // Future: (kPostPropagationStage);
} else {
// Crossing tracks continue to continuous processes, the rest have to
// query again the geometry
if (!IsSameLocation(*track, td)) {
td->fNcross++;
td->fNsteps++;
} else {
track->SetStage(kGeometryStepStage);
}
}
output.AddTrack(track);
}
//______________________________________________________________________________
VECCORE_ATT_HOST_DEVICE
void FieldPropagationHandler::DoIt(Basket &input, Basket &output, TaskData *td)
{
// Vector geometry length computation. The tracks are moved into the output basket.
using vecCore::math::Max;
using vecCore::math::Min;
constexpr double step_push = 1.e-4;
TrackVec_t &tracks = input.Tracks();
int ntracks = tracks.size();
double *steps = td->GetDblArray(ntracks);
for (int itr = 0; itr < ntracks; itr++) {
// Can this loop be vectorized?
Track &track = *tracks[itr];
// The minimum step is step_push in case the physics step limit is not smaller
double step_min = Min(track.GetPstep(), step_push);
// The track snext value is already the minimum between geometry and physics
double step_geom_phys = Max(step_min, track.GetSnext());
// Field step limit. We use the track sagitta to estimate the "bending" error,
// i.e. what is the propagated length for which the track deviation in
// magnetic field with respect to straight propagation is less than epsilon.
double step_field = Max(SafeLength(track, gEpsDeflection), track.GetSafety());
// Select step to propagate as the minimum among the "safe" step and:
// the straight distance to boundary (if fboundary=1) or the proposed physics
// step (fboundary=0)
steps[itr] = Min(step_geom_phys, step_field);
}
// Propagate the vector of tracks
PropagateInVolume(input.Tracks(), steps, td);
// Update number of partial steps propagated in field
td->fNmag += ntracks;
// Update time of flight and number of interaction lengths.
// Check also if it makes sense to call the vector interfaces
#if !(defined(VECTORIZED_GEOMERY) && defined(VECTORIZED_SAMELOC))
for (auto track : tracks) {
if (track->Status() == kPhysics) {
// Update number of steps to physics and total number of steps
td->fNphys++; // Find a new Counter !!! TODO
td->fNsteps++;
track->SetStage(stageAfterCrossing); // kPostPropagationStage);
} else {
// Vector treatment was not requested, so proceed with scalar
if (!IsSameLocation(*track, td)) {
td->fNcross++;
td->fNsteps++;
} else {
track->SetStage(kGeometryStepStage);
}
}
output.AddTrack(track);
}
#else
// If vectorized treatment was requested and the remaining population is
// large enough, continue with vectorized treatment
constexpr int kMinVecSize = 8; // this should be retrieved from elsewhere
int nvect = 0;
if (nvect < kMinVecSize) {
for (auto track : tracks) {
if (track->Status() == kPhysics) {
output.AddTrack(track);
continue;
}
if (!IsSameLocation(*track, td)) {
td->fNcross++;
td->fNsteps++; // Why not ?
track->SetStage(stageAfterCrossing); // Future: (kPostPropagationStage);
} else {
track->SetStage(kGeometryStepStage);
}
output.AddTrack(track);
continue;
}
return;
}
// This part deals with vectorized treatment
// Copy data to SOA and dispatch for vector mode
TrackGeo_v &track_geo = *td.fGeoTrack;
for (auto track : tracks) {
if (track.Status() != kPhysics && (track.GetSafety() < 1.E-10 || track.GetSnext() < 1.E-10))
track_geo.AddTrack(*track);
}
bool *same = td->GetBoolArray(nvect);
NavigationState *tmpstate = td->GetPath();
VectorNavInterface::NavIsSameLocation(nvect, track_geo.fXposV, track_geo.fYposV, track_geo.fZposV, track_geo.fXdirV,
track_geo.fYdirV, track_geo.fZdirV, (const VolumePath_t **)fPathV, fNextpathV,
same, tmpstate);
track_geo.UpdateOriginalTracks();
for (itr = 0; itr < nsel; itr++) {
Track *track = track_geo.fOriginalV[itr];
if (!same[itr]) {
td->fNcross++;
td->fNsteps++;
track->SetBoundary(true);
track->SetStatus(kBoundary);
if (track->NextPath()->IsOutside()) track->SetStatus(kExitingSetup);
// if (track->GetStep() < 1.E-8) td->fNsmall++;
} else {
track->SetBoundary(false);
track->SetStage(kGeometryStepStage);
}
output.AddTrack(track);
}
#endif
}
void FieldPropagationHandler::VectorDispatchOverhead(TrackVec_t &tracks, TaskData *td)
{
// This function just reproduces the overhead for gather/scatter in vector mode
using vecgeom::SOA3D;
using vecgeom::Vector3D;
const int nTracks = tracks.size();
PrepareBuffers(nTracks, td);
auto wsp = td->fSpace4FieldProp; // WorkspaceForFieldPropagation *
double *fltCharge = wsp->fChargeInp;
double *momentumMag = wsp->fMomentumInp;
double *steps = wsp->fStepsInp;
SOA3D<double> &position3D = *(wsp->fPositionInp);
SOA3D<double> &direction3D = *(wsp->fDirectionInp);
SOA3D<double> &PositionOut = *(wsp->fPositionOutp);
SOA3D<double> &DirectionOut = *(wsp->fDirectionOutp);
for (int itr = 0; itr < nTracks; ++itr) {
Track *pTrack = tracks[itr];
// gather
fltCharge[itr] = pTrack->Charge();
momentumMag[itr] = pTrack->P();
steps[itr] = 0;
position3D.push_back(pTrack->X(), pTrack->Y(), pTrack->Z());
direction3D.push_back(pTrack->Dx(), pTrack->Dy(), pTrack->Dz());
// scatter
PositionOut.push_back(pTrack->X(), pTrack->Y(), pTrack->Z());
DirectionOut.push_back(pTrack->Dx(), pTrack->Dy(), pTrack->Dz());
}
}
//______________________________________________________________________________
VECCORE_ATT_HOST_DEVICE
void FieldPropagationHandler::PropagateInVolume(Track &track, double crtstep, TaskData *td)
{
// Single track propagation in a volume. The method is to be called
// only with charged tracks in magnetic field.The method decreases the fPstepV
// fSafetyV and fSnextV with the propagated values while increasing the fStepV.
// The status and boundary flags are set according to which gets hit first:
// - physics step (bdr=0)
// - safety step (bdr=0)
// - snext step (bdr=1)
// std::cout << "FieldPropagationHandler::PropagateInVolume called for 1 track" << std::endl;
using ThreeVector = vecgeom::Vector3D<double>;
constexpr double toKiloGauss = 1.0 / units::kilogauss; // Converts to kilogauss
bool useRungeKutta = td->fPropagator->fConfig->fUseRungeKutta;
auto fieldConfig = FieldLookup::GetFieldConfig();
double bmag = -1.0;
ThreeVector BfieldInitial;
ThreeVector Position(track.X(), track.Y(), track.Z());
FieldLookup::GetFieldValue(Position, BfieldInitial, bmag);
auto fieldPropagator = td->fFieldPropagator;
#if DEBUG_FIELD
bool verboseDiff = true; // If false, print just one line. Else more details.
bool epsilonRK = td->fPropagator->fConfig->fEpsilonRK;
double curvaturePlus =
fabs(Track::kB2C * track.Charge() * (bmag * toKiloGauss)) / (track.P() + 1.0e-30); // norm for step
const double angle = crtstep * curvaturePlus;
#endif
#ifdef PRINT_STEP_SINGLE
Print("--PropagateInVolume(Single): ",
"Momentum= %9.4g (MeV) Curvature= %9.4g (1/mm) CurvPlus= %9.4g (1/mm) step= "
"%f (mm) Bmag=%8.4g KG angle= %g\n",
(track.P() / units::MeV), Curvature(track) * units::mm, curvaturePlus * units::mm, crtstep / units::mm,
bmag * toKiloGauss, angle);
// Print("\n");
#endif
ThreeVector Direction(track.Dx(), track.Dy(), track.Dz());
ThreeVector PositionNew(0., 0., 0.);
ThreeVector DirectionNew(0., 0., 0.);
// char method= '0';
ThreeVector PositionNewCheck(0., 0., 0.);
ThreeVector DirectionNewCheck(0., 0., 0.);
if (useRungeKutta || !fieldConfig->IsFieldUniform()) {
assert(fieldPropagator);
fieldPropagator->DoStep(Position, Direction, track.Charge(), track.P(), crtstep, PositionNew, DirectionNew);
#ifdef DEBUG_FIELD
// cross check
#ifndef CHECK_VS_BZ
ConstFieldHelixStepper stepper(BfieldInitial * toKiloGauss);
stepper.DoStep<double>(Position, Direction, track.Charge(), track.P(), crtstep, PositionNewCheck,
DirectionNewCheck);
#else
double Bz = BfieldInitial[2] * toKiloGauss;
ConstBzFieldHelixStepper stepper_bz(Bz); //
stepper_bz.DoStep<ThreeVector, double, int>(Position, Direction, track.Charge(), track.P(), crtstep,
PositionNewCheck, DirectionNewCheck);
#endif
double posShift = (PositionNew - PositionNewCheck).Mag();
double dirShift = (DirectionNew - DirectionNewCheck).Mag();
if (posShift > epsilonRK || dirShift > epsilonRK) {
std::cout << "*** position/direction shift RK vs. HelixConstBz :" << posShift << " / " << dirShift << "\n";
printf("*** position/direction shift RK vs. HelixConstBz : %f / %f \n", posShift, dirShift);
if (verboseDiff) {
printf("%s End> Pos= %9.6f %9.6f %9.6f Mom= %9.6f %9.6f %9.6f\n", " FPH::PiV(1)-RK: ", PositionNew.x(),
PositionNew.y(), PositionNew.z(), DirectionNew.x(), DirectionNew.y(), DirectionNew.z());
printf("%s End> Pos= %9.6f %9.6f %9.6f Mom= %9.6f %9.6f %9.6f\n", " FPH::PiV(1)-Bz: ", PositionNewCheck.x(),
PositionNewCheck.y(), PositionNewCheck.z(), DirectionNewCheck.x(), DirectionNewCheck.y(),
DirectionNewCheck.z());
}
}
#endif
// method= 'R';
#ifdef STATS_METHODS
numRK++;
#endif
} else {
// Must agree with values in magneticfield/inc/Units.h
double Bz = BfieldInitial[2] * toKiloGauss;
const bool dominantBz = false;
if (dominantBz) {
// Constant field in Z-direction
ConstBzFieldHelixStepper stepper(Bz); //
stepper.DoStep<ThreeVector, double, int>(Position, Direction, track.Charge(), track.P(), crtstep, PositionNew,
DirectionNew);
// method= 'z';
#ifdef STATS_METHODS
numHelixZ++;
#endif
} else {
// geant::
double BfieldArr[3] = {BfieldInitial.x() * toKiloGauss, BfieldInitial.y() * toKiloGauss,
BfieldInitial.z() * toKiloGauss};
ConstFieldHelixStepper stepper(BfieldArr);
stepper.DoStep<double>(Position, Direction, track.Charge(), track.P(), crtstep, PositionNew, DirectionNew);
// method= 'v';
#ifdef STATS_METHODS
numHelixGen++;
#endif
}
}
#ifdef PRINT_FIELD
// Print(" FPH::PiV(1): Start>", " Pos= %8.5f %8.5f %8.5f Mom= %8.5f %8.5f %8.5f", Position.x(), Position.y(),
// Position.z(), Direction.x(), Direction.y(), Direction.z() );
// Print(" FPH::PiV(1): End> ", " Pos= %8.5f %8.5f %8.5f Mom= %8.5f %8.5f %8.5f", PositionNew.x(), PositionNew.y(),
// PositionNew.z(), DirectionNew.x(), DirectionNew.y(), DirectionNew.z() );
// printf(" FPH::PiV(1): ");
printf(" FPH::PiV(1):: ev= %3d trk= %3d %3d %c ", track.Event(), track.Particle(), track.GetNsteps(), method);
printf("Start> Pos= %8.5f %8.5f %8.5f Mom= %8.5f %8.5f %8.5f ", Position.x(), Position.y(), Position.z(),
Direction.x(), Direction.y(), Direction.z());
printf(" s= %10.6f ang= %7.5f ", crtstep / units::mm, angle);
printf( // " FPH::PiV(1): "
"End> Pos= %9.6f %9.6f %9.6f Mom= %9.6f %9.6f %9.6f\n", PositionNew.x(), PositionNew.y(), PositionNew.z(),
DirectionNew.x(), DirectionNew.y(), DirectionNew.z());
#endif
#ifdef STATS_METHODS
unsigned long modbase = 100;
if (numTot % modbase < 1) {
PrintStats();
if (numTot > 10 * modbase) modbase = 10 * modbase;
}
#endif
// may normalize direction here // vecCore::math::Normalize(dirnew);
ThreeVector DirectionUnit = DirectionNew.Unit();
double posShiftSq = (PositionNew - Position).Mag2();
track.SetPosition(PositionNew);
track.SetDirection(DirectionUnit);
track.NormalizeFast();
// Reset relevant variables
track.SetStatus(kInFlight);
track.IncreaseStep(crtstep);
track.DecreasePstep(crtstep);
if (track.GetPstep() < 1.E-10) {
track.SetPstep(0);
track.SetStatus(kPhysics);
}
track.DecreaseSnext(crtstep);
if (track.GetSnext() < 1.E-10) {
track.SetSnext(0);
}
double preSafety = track.GetSafety();
if (posShiftSq > preSafety * preSafety) {
track.SetSafety(0);
} else {
double posShift = std::sqrt(posShiftSq);
track.DecreaseSafety(posShift);
if (track.GetSafety() < 1.E-10) track.SetSafety(0);
}
#ifdef REPORT_AND_CHECK
CheckTrack(track, "End of Propagate-In-Volume", 1.0e-5);
#endif
}
//______________________________________________________________________________
VECCORE_ATT_HOST_DEVICE
void FieldPropagationHandler::PropagateInVolume(TrackVec_t &tracks, const double *stepSize, TaskData *td)
{
// The Vectorized Implementation for Magnetic Field Propagation
using ThreeVector = vecgeom::Vector3D<double>;
constexpr double toKiloGauss = 1.0 / units::kilogauss; // Converts to kilogauss
bool useRungeKutta = td->fPropagator->fConfig->fUseRungeKutta;
const int nTracks = tracks.size();
auto fieldConfig = FieldLookup::GetFieldConfig();
assert(fieldConfig != nullptr);
#if 1 // VECTOR_FIELD_PROPAGATION
using vecgeom::SOA3D;
using vecgeom::Vector3D;
constexpr int Npm = 6;
// double yInput[8*nTracks], yOutput[8*nTracks];
bool succeeded[nTracks];
// int intCharge[nTracks];
// Choice 1. SOA3D
PrepareBuffers(nTracks, td);
auto wsp = td->fSpace4FieldProp; // WorkspaceForFieldPropagation *
double *fltCharge = wsp->fChargeInp;
double *momentumMag = wsp->fMomentumInp;
double *steps = wsp->fStepsInp;
SOA3D<double> &position3D = *(wsp->fPositionInp);
SOA3D<double> &direction3D = *(wsp->fDirectionInp);
SOA3D<double> &PositionOut = *(wsp->fPositionOutp);
SOA3D<double> &DirectionOut = *(wsp->fDirectionOutp);
for (int itr = 0; itr < nTracks; ++itr) {
Track *pTrack = tracks[itr];
fltCharge[itr] = pTrack->Charge();
momentumMag[itr] = pTrack->P();
steps[itr] = stepSize[itr];
position3D.push_back(pTrack->X(), pTrack->Y(), pTrack->Z());
direction3D.push_back(pTrack->Dx(), pTrack->Dy(), pTrack->Dz());
}
if (!useRungeKutta && fieldConfig->IsFieldUniform()) {
vecgeom::Vector3D<double> BfieldUniform = fieldConfig->GetUniformFieldValue();
ConstFieldHelixStepper stepper(BfieldUniform * toKiloGauss);
// stepper.DoStep<ThreeVector,double,int>(Position, Direction, track.Charge(), track.P(), stepSize,
// PositionNew, DirectionNew);
// std::cout << "Before Helix stepper - Position addresses: x= " << PositionOut.x() << " y= " << PositionOut.y()
// << " z=" << PositionOut.z() << std::endl;
stepper.DoStepArr<Double_v>(position3D.x(), position3D.y(), position3D.z(), direction3D.x(), direction3D.y(),
direction3D.z(), fltCharge, momentumMag, stepSize, PositionOut.x(), PositionOut.y(),
PositionOut.z(), DirectionOut.x(), DirectionOut.y(), DirectionOut.z(), nTracks);
for (int itr = 0; itr < nTracks; ++itr) {
Track &track = *tracks[itr];
Vector3D<double> startPosition = {track.X(), track.Y(), track.Z()};
Vector3D<double> startDirection = {track.Dx(), track.Dy(), track.Dz()};
#ifdef DEBUG_FIELD
// Quick Crosscheck against helix stepper
ThreeVector PositionNew(0., 0., 0.), DirectionNew(0., 0., 0.);
stepper.DoStep<double>(startPosition, startDirection, track.Charge(), track.P(), stepSize[itr], PositionNew,
DirectionNew);
double posDiff = (PositionNew - PositionOut[itr]).Mag();
double dirDiff = (DirectionNew - DirectionOut[itr]).Mag();
if (posDiff > 1.e-6 || dirDiff > 1.e-6) {
std::cout << "*** position/direction shift HelixStepper scalar vs. vector :" << posDiff << " / " << dirDiff
<< "\n";
}
#endif
Vector3D<double> positionMove = startPosition - PositionOut[itr];
// Store revised positions and location in original tracks
track.SetPosition(PositionOut.x(itr), PositionOut.y(itr), PositionOut.z(itr));
track.SetDirection(DirectionOut.x(itr), DirectionOut.y(itr), DirectionOut.z(itr));
track.NormalizeFast();
// Update status, step and safety
track.SetStatus(kInFlight);
track.IncreaseStep(stepSize[itr]);
track.DecreasePstep(stepSize[itr]);
if (track.GetPstep() < 1.E-10) {
track.SetPstep(0);
track.SetStatus(kPhysics);
}
track.DecreaseSnext(stepSize[itr]);
if (track.GetSnext() < 1.E-10) {
track.SetSnext(0);
}
double posShiftSq = positionMove.Mag2();
double preSafety = track.GetSafety();
if (posShiftSq > preSafety * preSafety) {
track.SetSafety(0);
} else {
double posShift = std::sqrt(posShiftSq);
track.DecreaseSafety(posShift); // Was crtstep;
if (track.GetSafety() < 1.0e-10) track.SetSafety(0);
}
}
} else {
// Prepare for Runge Kutta stepping
// Choice 3. Array of FieldTrack
FieldTrack fldTracksIn[nTracks], fldTracksOut[nTracks];
for (int itr = 0; itr < nTracks; ++itr) {
Track *pTrack = tracks[itr];
double trackVals[Npm] = {pTrack->X(), pTrack->Y(), pTrack->Z(), pTrack->Px(), pTrack->Py(), pTrack->Pz()};
fldTracksIn[itr].LoadFromArray(trackVals, Npm);
}
auto fieldPropagator = td->fFieldPropagator;
assert(fieldPropagator);
auto vectorDriver = fieldPropagator ? fieldPropagator->GetFlexibleIntegrationDriver() : nullptr;
assert(vectorDriver);
if (vectorDriver) {
// Integrate using Runge Kutta method
vectorDriver->AccurateAdvance(fldTracksIn, steps, fltCharge, fEpsTol, fldTracksOut, nTracks, succeeded);
#ifdef CHECK_VS_SCALAR
bool checkVsScalar = true;
#ifdef CHECK_VS_HELIX
const char *diffBanner = "Differences between vector RK vs scalar Helix method:";
#else
const char *diffBanner = "Differences between vector RK vs scalar RK method:";
#endif
bool bannerUsed = false;
#endif
// Store revised positions and location in original tracks
for (int itr = 0; itr < nTracks; ++itr) {
Track &track = *tracks[itr];
FieldTrack &fldTrackEnd = fldTracksOut[itr];
Vector3D<double> startPosition = {track.X(), track.Y(), track.Z()};
Vector3D<double> startDirection = {track.Dx(), track.Dy(), track.Dz()};
Vector3D<double> endPosition = {fldTrackEnd[0], fldTrackEnd[1], fldTrackEnd[2]};
const double pmag_inv = 1.0 / track.P();
ThreeVector endDirVector = pmag_inv * ThreeVector(fldTrackEnd[3], fldTrackEnd[4], fldTrackEnd[5]);
#ifdef CHECK_VS_SCALAR
double posShift = (startPosition - endPosition).Mag();
// ---- Perform checks
ThreeVector endPositionScalar(0., 0., 0.), endDirScalar(0., 0., 0.);
fieldPropagator->DoStep(startPosition, startDirection, track.Charge(), track.P(), stepSize[itr],
endPositionScalar, endDirScalar);
double posErr = (endPositionScalar - endPosition).Mag();
double dirErr = (endDirScalar - endDirVector).Mag();
if (posErr > 1.e-3 * posShift || dirErr > 1.e-6) {
std::cout << "*** position/direction shift scalar RK vs. vector RK :" << posErr << " / " << dirErr << "\n";
}
if (magDiff > perMillion) {
if (!bannerUsed) {
std::cerr << diffBanner << std::endl;
bannerUsed = true;
}
std::cerr << "Track " << itr << " has momentum magnitude difference " << magDiff
<< " Momentum magnitude @ end = " << std::sqrt(pMag2End) << " vs. start = " << track.P()
<< std::endl;
assert(pMag2End > 0.0 && fabs(magDiff) < 0.003 && "ERROR in direction normal.");
}
#endif
#ifdef DEBUG_FIELD
// ---- Start verbose print (of selected events/tracks)
// int maxPartNo = 2, maxEvSlot = 3;
bool printTrack = false; // = (track.Particle() < maxPartNo) && (track.EventSlot() < maxEvSlot );
if (printTrack) {
// Select a few tracks to print ...
printf(" FPH::PiV(V)/rk: ev= %3d trk= %3d Start> Pos= %8.5f %8.5f %8.5f Mom= %8.5f %8.5f %8.5f ",
track.Event(), track.Particle(), startPosition.x(), startPosition.y(), startPosition.z(),
startDirection.x(), startDirection.y(), startDirection.z());
double angle = std::acos(endDirVector.Dot(startDirection));
printf(" s= %10.6f ang= %7.5f ", *stepSize / units::mm, angle);
printf("End> Pos= %9.6f %9.6f %9.6f Mom= %9.6f %9.6f %9.6f\n", endPosition.x(), endPosition.y(),
endPosition.z(), endDirVector.x(), endDirVector.y(), endDirVector.z());
}
// ---- End verbose print
#endif
#ifdef CHECK_VS_SCALAR
// ---- Perform checks
if (checkVsScalar) {
bool checkVsHelix = true;
double curv = Curvature(track);
CheckVsScalar(startPosition, startDirection, track.Charge(), track.P(), stepSize[itr], endPosition,
endDirVector, curv, itr, td, checkVsHelix);
}
#endif
// Update the state of this track
track.SetPosition(fldTrackEnd[0], fldTrackEnd[1], fldTrackEnd[2]);
track.SetDirection(endDirVector);
track.NormalizeFast();
track.SetStatus(kInFlight);
track.IncreaseStep(stepSize[itr]);
track.DecreasePstep(stepSize[itr]);
if (track.GetPstep() < 1.E-10) {
track.SetPstep(0);
track.SetStatus(kPhysics);
}
track.DecreaseSnext(stepSize[itr]);
if (track.GetSnext() < 1.E-10) {
track.SetSnext(0);
}
// Exact update of the safety - using true move (not distance along curve)
// track.DecreaseSafety(posShift) // More accurate
double posShiftSq = (startPosition - endPosition).Mag2();
double preSafety = track.GetSafety();
if (posShiftSq > preSafety * preSafety) {
track.SetSafety(0);
} else {
double posShift = std::sqrt(posShiftSq);
track.DecreaseSafety(posShift); // Was crtstep;
if (track.GetSafety() < 1.0e-10) track.SetSafety(0);
}
}
} else {
// geant::Error( ... );
std::cerr << "ERROR in FieldPropagationHandler: no Flexible/Vector Integration Driver found." << std::endl;
exit(1);
}
}
#else
// Placeholder - implemented just as a loop
for (int itr = 0; itr < nTracks; ++itr)
PropagateInVolume(*tracks[itr], stepSize[itr], td);
#endif // VECTOR_FIELD_PROPAGATION
}
//______________________________________________________________________________
VECCORE_ATT_HOST_DEVICE
bool FieldPropagationHandler::IsSameLocation(Track &track, TaskData *td)
{
// Query geometry if the location has changed for a track
// Returns number of tracks crossing the boundary (0 or 1)
if (track.GetSafety() > 1.E-10 && track.GetSnext() > 1.E-10) {
// Track stays in the same volume
track.SetBoundary(false);
return true;
}
// Track may have crossed, check it
bool same;
vecgeom::NavigationState *tmpstate = td->GetPath();
ScalarNavInterfaceVGM::NavIsSameLocation(track, same, tmpstate);
if (same) {
track.SetBoundary(false);
return true;
}
track.SetBoundary(true);
track.SetStatus(kBoundary);
if (track.NextPath()->IsOutside()) track.SetStatus(kExitingSetup);
// if (track.GetStep() < 1.E-8) td->fNsmall++;
return false;
}
#define IsNan(x) (!(x > 0 || x <= 0.0))
//______________________________________________________________________________
VECCORE_ATT_HOST_DEVICE
void FieldPropagationHandler::CheckTrack(Track &track, const char *msg, double epsilon) const
{
// Ensure that values are 'sensible' - else print msg and track
if (epsilon <= 0.0 || epsilon > 0.01) {
epsilon = 1.e-6;
}
double x = track.X(), y = track.Y(), z = track.Z();
bool badPosition = IsNan(x) || IsNan(y) || IsNan(z);
const double maxRadius = 10000.0; // Should be a property of the geometry
const double maxRadXY = 5000.0; // Should be a property of the geometry
// const double maxUnitDev = 1.0e-4; // Deviation from unit of the norm of the direction
double radiusXy2 = x * x + y * y;
double radius2 = radiusXy2 + z * z;
badPosition = badPosition || (radiusXy2 > maxRadXY * maxRadXY) || (radius2 > maxRadius * maxRadius);
const double maxUnitDev = epsilon; // Use epsilon for max deviation of direction norm from 1.0
double dx = track.Dx(), dy = track.Dy(), dz = track.Dz();
double dirNorm2 = dx * dx + dy * dy + dz * dz;
bool badDirection = std::fabs(dirNorm2 - 1.0) > maxUnitDev;
if (badPosition || badDirection) {
static const char *errMsg[4] = {" All ok - No error. ",
" Bad position.", // [1]
" Bad direction.", // [2]
" Bad direction and position. "}; // [3]
int iM = 0;
if (badPosition) {
iM++;
}
if (badDirection) {
iM += 2;
}
// if( badDirection ) {
// Printf( " Norm^2 direction= %f , Norm -1 = %g", dirNorm2, sqrt(dirNorm2)-1.0 );
// }
Printf("ERROR> Problem with track %p . Issue: %s. Info message: %s -- Mag^2(dir)= %9.6f Norm-1= %g", (void *)&track,
errMsg[iM], msg, dirNorm2, sqrt(dirNorm2) - 1.0);
track.Print(msg);
}
}
//______________________________________________________________________________
VECCORE_ATT_HOST_DEVICE
void FieldPropagationHandler::PrintStats() const
{
#ifdef STATS_METHODS
unsigned long nTot = numTot++;
unsigned long rk = numRK, hZ = numHelixZ, hGen = numHelixGen;
std::cerr << "Step statistics (field Propagation): total= " << nTot << " RK = " << rk << " HelixGen = " << hGen
<< " Helix-Z = " << hZ << std::endl;
#endif
}
//______________________________________________________________________________
VECCORE_ATT_HOST_DEVICE
void FieldPropagationHandler::CheckVsScalar(const vecgeom::Vector3D<double> &startPosition,
const vecgeom::Vector3D<double> &startDirection, double charge,
double momentum, // starting magnitude
double stepSize, const vecgeom::Vector3D<double> &endPosition,
const vecgeom::Vector3D<double> &endDirection, double curvature, int index,
TaskData *td, bool checkVsHelix)
{
using ThreeVector = vecgeom::Vector3D<double>;
constexpr double toKiloGauss = 1.0 / units::kilogauss;
// static bool bannerUsed = false;
auto fieldPropagator = td->fFieldPropagator;
bool useRungeKutta = td->fPropagator->fConfig->fUseRungeKutta;
bool differs = false;
// Check against 'scalar' propagation of the same track
ThreeVector EndPositionScalar(0., 0., 0.), EndDirScalar(0., 0., 0.);
vecgeom::Vector3D<double> BfieldInitial;
double bmag;
FieldLookup::GetFieldValue(startPosition, BfieldInitial, bmag);
BfieldInitial *= toKiloGauss;
bmag *= toKiloGauss;
checkVsHelix = checkVsHelix || (!useRungeKutta); // Cannot check vs RK if it is not available
if (checkVsHelix) {
ConstFieldHelixStepper stepper(BfieldInitial);
stepper.DoStep<double>(startPosition, startDirection, charge, momentum, stepSize, EndPositionScalar, EndDirScalar);
} else {
fieldPropagator->DoStep(startPosition, startDirection, charge, momentum, stepSize, EndPositionScalar, EndDirScalar);
}
// checking direction
ThreeVector diffDir = endDirection - EndDirScalar;
double diffDirMag = diffDir.Mag();
const double maxDiffMom = 1.0e-4; // 1.5 * fEpsTol; // 10.0 * units::perMillion;
if (diffDirMag > maxDiffMom) {
differs = true;
// if (!bannerUsed) { std::cerr << diffBanner << std::endl; bannerUsed = true; }
std::ostringstream strDiff;
strDiff // std::cerr
<< "Track [" << index << "] : direction differs "
<< " by " << diffDir << " ( mag = " << diffDirMag
<< " ) "
// << " Direction vector = " << endDirection << " scalar = " << EndDirScalar
<< " stepSize = " << stepSize << " curv = " << curvature << " B-field = " << BfieldInitial
<< " kilo-Gauss "
// << " End position= " << endPosition
<< std::endl;
std::cout << strDiff.str();
std::cerr << strDiff.str();
} else {
// checking against magnitude of direction difference
ThreeVector changeDirVector = endDirection - startDirection;
ThreeVector changeDirScalar = EndDirScalar - startDirection;
double magChangeDirScalar = changeDirScalar.Mag();
const double relativeDiffMax = 1.0e-3;
if (diffDirMag > relativeDiffMax * magChangeDirScalar && (diffDirMag > 1.e-9) && (magChangeDirScalar > 1.e-10)) {
differs = true;
// if (!bannerUsed) { std::cerr << diffBanner << std::endl; bannerUsed = true; }
std::ostringstream strDiff;
strDiff // std::cerr
<< "Track [" << index << "] : direction CHANGE has high RELATIVE difference "
<< " by " << diffDir << " ( mag = " << diffDirMag << " vs |delta Dir scalar| " << magChangeDirScalar
<< " ) "
<< " DeltaDir/V = " << changeDirVector << " scalar = " << changeDirScalar << " End position= " << endPosition
<< std::endl;
std::cout << strDiff.str();
std::cerr << strDiff.str();
}
}
// checking position
ThreeVector diffPos = endPosition - EndPositionScalar;
const double maxDiffPos = 1.5 * fEpsTol; // * distanceAlongPath
if (diffPos.Mag() > maxDiffPos) {
differs = true;
// if (!bannerUsed) { std::cerr << diffBanner << std::endl; bannerUsed = true; }
std::cerr << "Track [" << index << "] : position diff " << diffPos << " mag= " << diffPos.Mag()
<< " "
// << " Pos: vec = " << endPosition << " scalar = " << EndPositionScalar
<< " move (vector) = " << endPosition - startPosition
<< " its-mag= " << (endPosition - startPosition).Mag() << " stepSize = " << stepSize
<< " move (scalar) = " << EndPositionScalar - startPosition << std::endl;
}
if (differs) {
printf(" FPH::PiV-Start: Start> Pos= %9.6f %9.6f %9.6f Mom= %9.6f %9.6f %9.6f\n", startPosition.x(),
startPosition.y(), startPosition.z(), startDirection.x(), startDirection.y(), startDirection.z());
printf(" FPH::PiV/Vector: End> Pos= %9.6f %9.6f %9.6f Mom= %9.6f %9.6f %9.6f Delta-p: %6.2g %6.2g %6.2g \n",
endPosition.x(), endPosition.y(), endPosition.z(), endDirection.x(), endDirection.y(), endDirection.z(),
endDirection.x() - startDirection.x(), endDirection.y() - startDirection.y(),
endDirection.z() - startDirection.z());
printf(" FPH::PiV-1/chk: End> Pos= %9.6f %9.6f %9.6f Mom= %9.6f %9.6f %9.6f Delta-p: %6.2g %6.2g %6.2g \n",
EndPositionScalar.x(), EndPositionScalar.y(), EndPositionScalar.z(), EndDirScalar.x(), EndDirScalar.y(),
EndDirScalar.z(), EndDirScalar.x() - startDirection.x(), EndDirScalar.y() - startDirection.y(),
EndDirScalar.z() - startDirection.z());
}
}
} // namespace GEANT_IMPL_NAMESPACE
} // namespace geant
|
cpp
|
import { ConfigService, ConfigModule } from '@nestjs/config';
import { TypeOrmModuleAsyncOptions, TypeOrmModuleOptions } from '@nestjs/typeorm';
export default class TypeOrmConfig {
static getTypeOrmConfig(configService: ConfigService): TypeOrmModuleOptions {
return {
type: 'postgres',
host: configService.get('DB_HOST'),
port: configService.get('DB_PORT'),
username: configService.get('DB_USERNAME'),
password: <PASSWORD>('<PASSWORD>'),
database: configService.get('DB_NAME'),
schema: configService.get('DB_SCHEMA'),
entities: [__dirname + '/../**/*.entity{.ts,.js}'],
migrations: [__dirname + '/../migration/*.ts'],
synchronize: configService.get('TYPE_ORM_SYNCHRONIZE').toString() === 'true' ? true : false,
logging: configService.get('TYPE_ORM_LOGGING').toString() === 'true' ? true : false,
migrationsRun: true,
};
}
}
export const typeOrmConfigAsync: TypeOrmModuleAsyncOptions = {
imports: [ConfigModule],
useFactory: async (configService: ConfigService): Promise<TypeOrmModuleOptions> => TypeOrmConfig.getTypeOrmConfig(configService),
inject: [ConfigService]
};
|
typescript
|
<!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" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:<EMAIL>" />
<link rel="icon" type="image/png" href="/graphics/gnu-head-mini.png" />
<meta name="ICBM" content="42.256233,-71.006581" />
<meta name="DC.title" content="gnu.org" />
<title>GNU Lesser General Public License - GNU Project - Free Software Foundation (FSF)</title>
<link rel="alternate" type="application/rdf+xml" href="lgpl-3.0.rdf" />
<!-- start of banner.html -->
<!-- start of head-include-2.html -->
<style type="text/css" media="screen">
@import url('/style.css');
</style>
<style type="text/css" media="handheld">
@import url('/mini.css');
</style>
<!--[if IE]>
<link rel="stylesheet" href="/style.css" media="screen" type="text/css" />
<![endif]-->
<style type="text/css" media="print">
@import url('/print.css');
</style>
<meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
<!-- end of head-include-2.html -->
</head>
<body>
<div id="toplinks"><span class="netscape4"><a href="#content">Skip to content</a> | <a href="#navigation">Skip to navigation</a> | <a href="#searcher">Skip to search</a>| </span><a href="#translations">Translations of this page</a> | <a href="/accessibility/">Accessibility</a></div>
<div id="null-wrapper">
<div id="header">
<div class="inner" style="position: relative;">
<h1 id="logo"><a href="/">The GNU Operating System</a></h1>
<div style="position: absolute; top: -20px; right: 0; width: 344px;"><a href="http://patentabsurdity.com/watch.html" title="Watch Patent Absurdity"><img src="http://static.fsf.org/nosvn/pa-gnu.jpg" alt="" /></a>
</div>
<!-- <div id="fssbox">
<h4>Sign up for the <em>Free Software Supporter</em></h4>
<p>A monthly update on GNU and the FSF</p>
<form action="http://lists.gnu.org/mailman/subscribe/info-fsf" method="post">
<p><input type="text" id="frmEmail" name="email" size="15" maxlength="80" value="<EMAIL>" onfocus="this.value=''" /> <input type="submit" value="Ok" /></p>
</form>
</div>
-->
</div>
</div>
<div id="navigation">
<div class="inner">
<ul>
<li id="tabPhilosophy"><a href="/philosophy/philosophy.html">Philosophy</a></li>
<li id="tabLicenses"><a href="/licenses/licenses.html">Licenses</a></li>
<li id="tabSoftware"><a href="/software/software.html">Downloads</a></li>
<li id="tabDoc"><a href="/doc/doc.html">Documentation</a></li>
<li><a href="/help/help.html">Help GNU</a></li>
<li id="joinfsftab"><a href="https://www.fsf.org/associate/support_freedom?referrer=4052">Join the FSF!</a></li>
</ul>
<div id="searcher">
<form method="get" action="http://www.gnu.org/cgi-bin/estseek.cgi">
<div><label class="netscape4" for="phrase">Search:</label>
<input name="phrase" id="phrase" type="text" size="18" accesskey="s" value="Why GNU/Linux?" />
<input type="submit" value="Search" /></div>
</form>
</div>
</div>
</div>
<div id="content" class="inner">
<!-- end of banner.html -->
<h2>GNU Lesser General Public License</h2>
<img src="/graphics/lgplv3-147x51.png" alt="" style="float: right;" />
<ul>
<li><a href="/licenses/why-not-lgpl.html">Why you shouldn't use the
Lesser GPL for your next library</a></li>
<li><a href="/licenses/gpl-faq.html">Frequently Asked Questions about
the GNU licenses</a></li>
<li><a href="/licenses/gpl-howto.html">How to use GNU licenses for your
own software</a></li>
<li><a href="/licenses/translations.html">Translations
of the LGPL</a></li>
<li>The GNU LGPL in other formats:
<a href="/licenses/lgpl-3.0.txt">plain text</a>,
<a href="/licenses/lgpl-3.0.dbk">Docbook</a>,
<a href="/licenses/lgpl-3.0-standalone.html">standalone HTML</a>,
<a href="/licenses/lgpl-3.0.tex">LaTeX</a>,
<a href="/licenses/lgpl-3.0.texi">Texinfo</a></li>
<li><a href="/graphics/license-logos.html">LGPLv3 logos</a> to use
with your project</li>
<li><a href="/licenses/old-licenses/old-licenses.html#LGPL">Old
versions of the GNU LGPL</a></li>
<li><a href="/licenses/gpl-violation.html">What to do if you see a
possible LGPL violation</a></li>
</ul>
<p>This license is a set of additional permissions added to <a
href="/licenses/gpl-3.0.html">version 3 of the GNU General Public
License</a>. For more information about how to release your own software
under this license, please see our <a href="/licenses/gpl-howto.html">page
of instructions</a>.</p>
<hr style="clear: both;" />
<!-- The license text is in English and appears broken in RTL as
Arabic, Farsi, etc. Explicitly set the direction to override the
one defined in the translation. -->
<div dir="ltr">
<h3 style="text-align: center;">GNU LESSER GENERAL PUBLIC LICENSE</h3>
<p style="text-align: center;">Version 3, 29 June 2007</p>
<p>Copyright © 2007 Free Software Foundation, Inc.
<<a href="http://fsf.org/">http://fsf.org/</a>></p><p>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.</p>
<p>This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.</p>
<h4><a name="section0"></a>0. Additional Definitions.</h4>
<p>As used herein, “this License” refers to version 3 of the GNU Lesser
General Public License, and the “GNU GPL” refers to version 3 of the GNU
General Public License.</p>
<p>“The Library” refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.</p>
<p>An “Application” is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.</p>
<p>A “Combined Work” is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the “Linked
Version”.</p>
<p>The “Minimal Corresponding Source” for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.</p>
<p>The “Corresponding Application Code” for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.</p>
<h4><a name="section1"></a>1. Exception to Section 3 of the GNU GPL.</h4>
<p>You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.</p>
<h4><a name="section2"></a>2. Conveying Modified Versions.</h4>
<p>If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:</p>
<ul>
<li>a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or</li>
<li>b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.</li>
</ul>
<h4><a name="section3"></a>3. Object Code Incorporating Material from Library Header Files.</h4>
<p>The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:</p>
<ul>
<li>a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.</li>
<li>b) Accompany the object code with a copy of the GNU GPL and this license
document.</li>
</ul>
<h4><a name="section4"></a>4. Combined Works.</h4>
<p>You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:</p>
<ul>
<li>a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.</li>
<li>b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.</li>
<li>c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.</li>
<li>d) Do one of the following:
<ul>
<li>0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.</li>
<li>1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.</li>
</ul></li>
<li>e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)</li>
</ul>
<h4><a name="section5"></a>5. Combined Libraries.</h4>
<p>You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:</p>
<ul>
<li>a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.</li>
<li>b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.</li>
</ul>
<h4><a name="section6"></a>6. Revised Versions of the GNU Lesser General Public License.</h4>
<p>The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.</p>
<p>Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License “or any later version”
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.</p>
<p>If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.</p>
</div>
</div>
<div class="inner">
<div class="yui-g" id="fsf-links">
<div class="yui-g first">
<div class="yui-u first" id="sitemap-1">
<p class="netscape4"><a href="#footer">Skip sitemap</a> or <a href="#sitemap-2">skip to licensing items</a></p>
<ul>
<li><a href="/gnu/gnu-history.html">GNU History</a></li>
<li><a href="/help/">Get involved</a>
<ul>
<li><a href="http://savannah.gnu.org/people/?type_id=1">Projects that need help</a></li>
<li><a href="/server/standards/translations/priorities.html#Languages">Help translate this website</a></li>
</ul></li>
<li><a href="/server/takeaction.html#unmaint">Take over an unmaintained package</a></li>
<li><a href="/server/takeaction.html#gnustep">Use GNUstep</a></li>
<li><a href="/distros/free-distros.html">Download GNU</a></li>
<li><a href="http://directory.fsf.org/GNU/">GNU packages</a></li>
<li><a href="/manual/manual.html">Free documentation</a></li>
<li><a href="http://lists.gnu.org/">GNU mailing lists</a></li>
<li><a href="http://savannah.gnu.org/">GNU savannah</a></li>
<li><a href="http://libreplanet.org/">Connect with free software users</a></li>
<li><a href="/people/">GNU's Who?</a></li>
<li><a href="http://planet.gnu.org/">Planet GNU</a></li>
<li><a href="/contact/gnu-advisory.html">GNU Advisory Committee</a></li>
</ul>
</div>
<div class="yui-u" id="sitemap-2">
<p class="netscape4"><a href="#sitemap-3">Skip to general items</a></p>
<ul>
<li><a href="http://www.fsf.org/licensing">Software licensing</a>
<ul>
<li><a href="http://www.fsf.org/licensing/education">Licensing education</a></li>
<li><a href="/licenses">Free software licenses</a>
<ul>
<li><a href="/licenses/gpl.html">GNU GPL</a></li>
<li><a href="/licenses/agpl.html">GNU AGPL</a></li>
<li><a href="/licenses/lgpl.html">GNU LGPL</a></li>
<li><a href="/licenses/fdl.html">GNU FDL</a></li></ul></li>
<li><a href="/licenses/gpl-faq.html">Software licensing FAQ</a></li>
<li><a href="/licenses/gpl-faq.html">Licensing compliance</a></li>
<li><a href="/licenses/gpl-faq.html">How to use GNU licenses for your own software</a></li></ul></li>
<li><a href="http://www.fsf.org/resources/service/">GNU Service Directory</a></li>
<li><a href="/fun/fun.html">GNU Fun</a></li>
<li><a href="/graphics/graphics.html">GNU Art</a></li>
<li><a href="/music/music.html">Music & Songs</a></li>
</ul>
</div>
</div>
<div class="yui-g first">
<div class="yui-u first" id="sitemap-3">
<p class="netscape4"><a href="#sitemap-4">Skip to philosophical items</a></p>
<ul>
<li><a href="http://www.fsf.org/news/">Latest News</a><ul>
<li><a href="http://www.fsf.org/events/">Upcoming Events</a></li>
<li><a href="http://www.fsf.org/blogs/">FSF Blogs</a></li></ul></li>
<li><a href="http://www.fsf.org/volunteer">Volunteering and internships</a></li>
<li><a href="http://www.fsf.org/resources/hw">Hardware Database</a></li>
<li><a href="http://directory.fsf.org">Free Software Directory</a></li>
<li><a href="http://www.fsf.org/resources/">Free Software Resources</a></li>
<li><a href="http://www.fsf.org/associate/">Associate Members</a></li>
<li><a href="http://www.fsf.org/associate/account/">My FSF Account</a></li>
<li class="noright"><a href="http://www.fsf.org/about/contact.html">Contact the FSF</a></li>
<li><a href="http://audio-video.gnu.org/">GNU Audio/Video</a></li>
<li><a href="/accessibility/accessibility.html">Accessibility Statement</a></li>
<li><a href="http://ftp.gnu.org/gnu/">GNU FTP Site</a>
and <a href="/prep/ftp.html">mirrors</a></li>
<li><a href="/people/speakers.html">GNU Speakers</a></li>
<li><a href="http://www.fsf.org/jobs">Free software jobs</a></li>
</ul>
</div>
<div class="yui-u" id="sitemap-4">
<p class="netscape4"><a href="#ft">Skip list</a></p>
<ul>
<li><a href="http://donate.fsf.org">Donate to the FSF</a></li>
<li><a href="http://www.fsf.org/jfb">Join the FSF</a></li>
<li><a href="/philosophy/">Free software philosophy</a><ul>
<li><a href="/philosophy/free-sw.html">The Free Software Definition</a></li>
<li><a href="/philosophy/pragmatic.html">Copyleft: Pragmatic Idealism</a></li>
<li><a href="/philosophy/free-doc.html">Free Software and Free Manuals</a></li>
<li><a href="/philosophy/selling.html">Selling Free Software</a></li>
<li><a href="/philosophy/fs-motives.html">Motives for Writing Free Software</a></li>
<li><a href="/philosophy/right-to-read.html">The Right To Read</a></li>
<li><a href="/philosophy/open-source-misses-the-point.html">Why Open Source Misses the Point of Free Software</a></li></ul></li>
<li><a href="/software/for-windows.html">Free software for Windows</a></li>
<li><a href="http://defectivebydesign.org/">Defective by Design — Fight DRM</a></li>
<li><a href="http://windows7sins.org/">Windows 7 Sins</a></li>
<li><a href="http://playogg.org/">Support free media formats</a></li>
</ul>
</div>
</div>
</div>
<div class="yui-g" id="mission-statement">
<p><small>The <a href="http://www.fsf.org">Free Software
Foundation</a> is the principal organizational sponsor of the <a
href="http://www.gnu.org/">GNU Operating System</a>. <strong>Our
mission is to preserve, protect and promote the freedom to use, study,
copy, modify, and redistribute computer software, and to defend the
rights of Free Software users.</strong></small></p>
<p><small><strong>Support GNU and the FSF by <a
href="http://shop.fsf.org/">buying manuals and gear</a>, <a
href="http://www.fsf.org/join">joining the FSF as an associate
member</a> or by <a href="http://donate.fsf.org/">making a
donation</a>.</strong></small></p>
<p id="backtotop"><a href="#header">back to top</a></p>
</div>
</div>
<div id="footer">
<p>
Please send FSF & GNU inquiries to
<a href="mailto:<EMAIL>"><em><EMAIL></em></a>.
There are also <a href="/contact/">other ways to contact</a>
the FSF.
<br />
Please send broken links and other corrections or suggestions to
<a href="mailto:<EMAIL>"><em><EMAIL></em></a>.
</p>
<p>
Please see the
<a href="/server/standards/README.translations.html">Translations
README</a> for information on coordinating and submitting
translations of this article.
</p>
<p>
Copyright notice above.</p>
<address>51 Franklin Street, Fifth Floor, Boston, MA 02110, USA</address>
<p>
Verbatim copying and distribution of this entire article is
permitted in any medium without royalty provided this notice is
preserved.
</p>
<p>
Updated:
<!-- timestamp start -->
$Date: 2009/06/17 19:20:32 $
<!-- timestamp end -->
</p>
</div>
<div id="translations">
<h4>Translations of this page</h4>
<!-- Please keep this list alphabetical by language code. -->
<!-- Comment what the language is for each type, i.e. de is German. -->
<!-- Write the language name in its own language (Deutsch) in the text. -->
<!-- If you add a new language here, please -->
<!-- advise <EMAIL> and add it to -->
<!-- - /home/www/html/server/standards/README.translations.html -->
<!-- - one of the lists under the section "Translations Underway" -->
<!-- - if there is a translation team, you also have to add an alias -->
<!-- to mail.gnu.org:/com/mailer/aliases -->
<!-- Please also check you have the language code right; see: -->
<!-- http://www.loc.gov/standards/iso639-2/php/code_list.php -->
<!-- If the 2-letter ISO 639-1 code is not available, -->
<!-- use the 3-letter ISO 639-2. -->
<!-- Please use W3C normative character entities. -->
<ul class="translations-list">
<!-- English -->
<li><a href="/licenses/lgpl-3.0.html">English</a> [en]</li>
</ul>
</div>
</div>
</body>
</html>
|
html
|
<filename>app/bns/templates/bns_surveys.html
{% extends 'bns_base.html' %}
{% load i18n %}
{% block title %}{% trans "CARPE - Basic Necessity Surveys" %}{% endblock %}
{% block main %}
<h2>{% trans "BNS Surveys" %}</h2>
{% for survey in surveys %}
<a href="{% url 'bns_surveys' %}{{ survey.dataset_name }}">{{ survey.dataset_name }}</a><br />
{% endfor %}
{% endblock main %}
|
html
|
"use strict";
/**
* Copyright 2015 Google Inc. All Rights Reserved.
*
* 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.
*/
/* jshint maxlen: false */
const apirequest_1 = require("../../lib/apirequest");
/**
* YouTube Analytics API
*
* Retrieves your YouTube Analytics data.
*
* @example
* const google = require('googleapis');
* const youtubeAnalytics = google.youtubeAnalytics('v1');
*
* @namespace youtubeAnalytics
* @type {Function}
* @version v1
* @variation v1
* @param {object=} options Options for Youtubeanalytics
*/
function Youtubeanalytics(options) {
const self = this;
self._options = options || {};
self.groupItems = {
/**
* youtubeAnalytics.groupItems.delete
*
* @desc Removes an item from a group.
*
* @alias youtubeAnalytics.groupItems.delete
* @memberOf! youtubeAnalytics(v1)
*
* @param {object} params Parameters for request
* @param {string} params.id The id parameter specifies the YouTube group item ID for the group that is being deleted.
* @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
delete: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/youtube/analytics/v1/groupItems').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE'
}, options),
params: params,
requiredParams: ['id'],
pathParams: [],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* youtubeAnalytics.groupItems.insert
*
* @desc Creates a group item.
*
* @alias youtubeAnalytics.groupItems.insert
* @memberOf! youtubeAnalytics(v1)
*
* @param {object} params Parameters for request
* @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.
* @param {youtubeAnalytics(v1).GroupItem} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
insert: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/youtube/analytics/v1/groupItems').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: [],
pathParams: [],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* youtubeAnalytics.groupItems.list
*
* @desc Returns a collection of group items that match the API request parameters.
*
* @alias youtubeAnalytics.groupItems.list
* @memberOf! youtubeAnalytics(v1)
*
* @param {object} params Parameters for request
* @param {string} params.groupId The id parameter specifies the unique ID of the group for which you want to retrieve group items.
* @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/youtube/analytics/v1/groupItems').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['groupId'],
pathParams: [],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.groups = {
/**
* youtubeAnalytics.groups.delete
*
* @desc Deletes a group.
*
* @alias youtubeAnalytics.groups.delete
* @memberOf! youtubeAnalytics(v1)
*
* @param {object} params Parameters for request
* @param {string} params.id The id parameter specifies the YouTube group ID for the group that is being deleted.
* @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
delete: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/youtube/analytics/v1/groups').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE'
}, options),
params: params,
requiredParams: ['id'],
pathParams: [],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* youtubeAnalytics.groups.insert
*
* @desc Creates a group.
*
* @alias youtubeAnalytics.groups.insert
* @memberOf! youtubeAnalytics(v1)
*
* @param {object} params Parameters for request
* @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.
* @param {youtubeAnalytics(v1).Group} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
insert: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/youtube/analytics/v1/groups').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: [],
pathParams: [],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* youtubeAnalytics.groups.list
*
* @desc Returns a collection of groups that match the API request parameters. For example, you can retrieve all groups that the authenticated user owns, or you can retrieve one or more groups by their unique IDs.
*
* @alias youtubeAnalytics.groups.list
* @memberOf! youtubeAnalytics(v1)
*
* @param {object=} params Parameters for request
* @param {string=} params.id The id parameter specifies a comma-separated list of the YouTube group ID(s) for the resource(s) that are being retrieved. In a group resource, the id property specifies the group's YouTube group ID.
* @param {boolean=} params.mine Set this parameter's value to true to instruct the API to only return groups owned by the authenticated user.
* @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.
* @param {string=} params.pageToken The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken property identifies the next page that can be retrieved.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/youtube/analytics/v1/groups').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: [],
pathParams: [],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* youtubeAnalytics.groups.update
*
* @desc Modifies a group. For example, you could change a group's title.
*
* @alias youtubeAnalytics.groups.update
* @memberOf! youtubeAnalytics(v1)
*
* @param {object} params Parameters for request
* @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.
* @param {youtubeAnalytics(v1).Group} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
update: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/youtube/analytics/v1/groups').replace(/([^:]\/)\/+/g, '$1'),
method: 'PUT'
}, options),
params: params,
requiredParams: [],
pathParams: [],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.reports = {
/**
* youtubeAnalytics.reports.query
*
* @desc Retrieve your YouTube Analytics reports.
*
* @alias youtubeAnalytics.reports.query
* @memberOf! youtubeAnalytics(v1)
*
* @param {object} params Parameters for request
* @param {string=} params.currency The currency to which financial metrics should be converted. The default is US Dollar (USD). If the result contains no financial metrics, this flag will be ignored. Responds with an error if the specified currency is not recognized.
* @param {string=} params.dimensions A comma-separated list of YouTube Analytics dimensions, such as views or ageGroup,gender. See the Available Reports document for a list of the reports that you can retrieve and the dimensions used for those reports. Also see the Dimensions document for definitions of those dimensions.
* @param {string} params.end-date The end date for fetching YouTube Analytics data. The value should be in YYYY-MM-DD format.
* @param {string=} params.filters A list of filters that should be applied when retrieving YouTube Analytics data. The Available Reports document identifies the dimensions that can be used to filter each report, and the Dimensions document defines those dimensions. If a request uses multiple filters, join them together with a semicolon (;), and the returned result table will satisfy both filters. For example, a filters parameter value of video==dMH0bHeiRNg;country==IT restricts the result set to include data for the given video in Italy.
* @param {string} params.ids Identifies the YouTube channel or content owner for which you are retrieving YouTube Analytics data. - To request data for a YouTube user, set the ids parameter value to channel==CHANNEL_ID, where CHANNEL_ID specifies the unique YouTube channel ID. - To request data for a YouTube CMS content owner, set the ids parameter value to contentOwner==OWNER_NAME, where OWNER_NAME is the CMS name of the content owner.
* @param {boolean=} params.include-historical-channel-data If set to true historical data (i.e. channel data from before the linking of the channel to the content owner) will be retrieved.
* @param {integer=} params.max-results The maximum number of rows to include in the response.
* @param {string} params.metrics A comma-separated list of YouTube Analytics metrics, such as views or likes,dislikes. See the Available Reports document for a list of the reports that you can retrieve and the metrics available in each report, and see the Metrics document for definitions of those metrics.
* @param {string=} params.sort A comma-separated list of dimensions or metrics that determine the sort order for YouTube Analytics data. By default the sort order is ascending. The '-' prefix causes descending sort order.
* @param {string} params.start-date The start date for fetching YouTube Analytics data. The value should be in YYYY-MM-DD format.
* @param {integer=} params.start-index An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter (one-based, inclusive).
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
query: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/youtube/analytics/v1/reports').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['ids', 'start-date', 'end-date', 'metrics'],
pathParams: [],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
}
module.exports = Youtubeanalytics;
//# sourceMappingURL=v1.js.map
|
javascript
|
Bhubaneswar: Despite the ruling Biju Janata Dal’s reputation being besmirched by a slew of cases of atrocities against women and children, can the state’s main opposition party, the Bharatiya Janata Party (BJP), better its performance in the ensuing three-tier panchayat elections? The issue is being hotly debated in the political circles across the state as this is for the first time since its inception in 1997, the BJD, has been facing such torrid time and is pushed to a corner over scandals involving incumbent ministers.
The first such issue is Kalahandi woman teacher kidnap and murder case linked to the Minister of State for Home and the second being the Mahanga double murder case involving name of the Law Minister. These two issues breathed fire during the entire 2021 as Chief Minister Naveen Patnaik did not take any action, rather shielded the ministers under suspicion, as alleged by opposition parties.
Naveen, who all along his over two-decade long political career, has unhesitatingly sacrificed ministers for slightest of mistakes, this time refused to heed the popular voice and preferred to go with a section of leaders in the ruling party. And this aberration has provided a big handle to both the BJP and the Congress. As Congress has already become frail and weak to take on the mighty BJD, it is BJP alone which could upset Naveen’s apple cart.
However, can the BJP, which for the first time got its recognition as an opposition party in Odisha, in the 2017 panchayat polls, by securing 297 Zilla Parishad seats from just 36 seats in 2014 elections, this time raise its tally? If the BJP fails to retain its 297 tally in the 2022 panchayat polls, the party would certainly be wiped out and the BJD’s victory would become a foregone conclusion.
The politics in Odisha has undergone many changes since 2017. After a small setback in 2017 panchayat polls, the BJD has redressed itself and taken lead in all elections, other than losing some Lok Sabha seats in 2019 General Elections. Now that the twin polls like panchayat and urban elections, are due in 2022 ahead of the General Elections for the Assembly and Lok Sabha scheduled in 2024, BJD appears more prepared than any other party.
What has emerged as a major difficulty for BJP in Odisha, is Union Minister Dharmendra Pradhan. The national leadership of the saffron party has already engaged Pradhan in the 2022 Assembly elections in a major state like Uttar Pradesh. He is thoroughly busy in UP elections and can hardly find any time to oversee the party’s preparation for the panchayat polls in Odisha. It should be kept in mind that though Samir Mohanty is the BJP’s Odisha unit President, it is Pradhan alone who calls the shots. During the last ten years, Pradhan has already laid his network across the state for the BJP and he holds the reigns. When he will remain off from the state for engagement in UP, it is difficult to say whether his followers will knuckle under any other leader.
Interestingly, the BJP has not yet assigned the responsibility of the panchayat polls to any senior leader in place of Pradhan. Though the BJP in Odisha has many senior leaders to take the lead, the party has almost sidelined them. Take for instance Bijay Mohapatra and Aparajita Sarangi. These two leaders are considered to have some organizational skills who could build up a tempo before the panchayat polls. But, these two leaders are not included in the party’s core committee. Therefore, the party rank and file may not accept them when they go for organizing the panchayat polls. However, insiders said that the party has asked all its MLAs to look after the panchayats under their jurisdiction. As such, the BJP has only 13 MLAs and 8 MPs. If at all, all the Zilla Parishad seats under these assembly and Lok Sabha segments go in favour of BJP, still they cannot overshoot the BJD which has 113 MLAs and 12 MPs.
It is also a fact that BJP has some constituency level leaders to make the party candidate win in the Zilla Parishads. But, things have already become difficult as the opponent BJD, which runs the State Government, is winning confidence of the people by announcing several popular schemes and initiatives. Naveen’s biggest trump card this time is Smart Health Card under the Biju Swasthya Kalyan Yojana (BSKY). This could become a game changer. This apart, Naveen, who is also the BJD President, announces financial assistance for different categories of people from newspaper hawkers to street vendors under the garb of COVID-19 assistance. This is not all; Naveen has also announced financial assistance for house repair of the beneficiaries of Awas Yojana. He also assured the needy people that the state government would take measures for the people who have been denied dwelling units under Pradhan Mantri Awas Yojana (Gramin). Benefits announced for the women self-help groups under Mission Shakti directly targets about one crore women voters.
While the voters’ baskets are overflowing with Naveen’s goodies and promises ahead of the panchayat polls, the rival BJP has nothing with which to lure the people other than Prime Minister Narendra Modi’s popularity. This apart, the BJP’s main poll strategy is based on negative campaigns albeit nothing directly against Naveen. Therefore, it may not be easy for the saffron leaders to motivate people to cast votes against the BJD.
Yet the prevailing situation is not adverse for the BJP. It needs a well-planned strategy and able leadership to take on the BJD’s incumbency. The corruption in rural housing schemes and others could help the BJP. But, everything now depends on the party leadership. Around 50 days are left for Odisha to go for panchayat polls. The dates for the 5 phase panchayat polls are likely to be announced by Mid-January 2022.
However, there is no clear-cut idea among the workers and leaders as to who will lead Panchayat poll campaign against the BJD behemoth. The party must promptly decide on the leader if at all they wish to take advantage of the chinks in Naveen’s armor.
|
english
|
<filename>_problems/medium/ADDFRAC.json
{"body":"\n<h3> All submissions for this problem are available. <\/h3><p>\nYou have discovered a new way to add fractions ! Now, the result of adding fractions a\/b and c\/d is (a + c)\/(b + d). Similarly the result of adding 3 fractions a\/b, c\/d, e\/f is (a + c + e)\/(b + d + f), and so on. You are given a list of N fractions a_1\/b_1, a_2\/b_2,...,a_N\/b_N. You wonder what for each fraction i is the maximum fraction that you can obtain by adding together some continuous fractions in the list (possibly 1) starting at i ?\n\n<\/p><p>\nFor example, let N = 4 and the fractions be 1\/1, 4\/3, 10\/1 and 5\/4. The maximum fraction you can obtain by starting at index 1 is 3\/1 (1\/1 + 4\/3 + 10\/1). Similarly, the maximum fraction you can obtain by starting at index 2 is 7\/2 (4\/3 + 10\/1). By starting at index 3, the maximum sum you can obtain is 10\/1 itself, and by starting at index 4, you can obtain sum 5\/4.\n\n<h3>\nInput :\n<\/h3>\nThe first line contains T the number of test cases. T test cases follow. The first line of each test case contains N. Each of the next N lines contains a fraction given in the form \"a_i\/b_i\". A blank line seperates two test cases.\n\n<h3>\nOutput :\n<\/h3>\nFor each test case, output N lines. The ith line contains the maximum fraction you can obtain by adding continuous fractions in the list starting at index i. The numerator and denominator of any fraction you output should have gcd 1. Output a blank line after each test case.\n<h3>\nSample Input :<\/h3>\n<pre>\n2\n4\n1\/1\n4\/3\n10\/1\n5\/4\n\n5\n1\/3\n3\/1\n2\/5\n5\/6\n6\/5\n<\/pre>\n\n\n\n\n<h3>Sample Output :<\/h3>\n<pre>\n3\/1\n7\/2\n10\/1\n5\/4\n\n1\/1\n3\/1\n13\/16\n1\/1\n6\/5\n<\/pre>\n\n\n\n<h3>\nConstraints :\n<\/h3>\n<pre>\n1 <= T <= 5\n1 <= n <= 100000\n1 <= a_k,b_k <= 100000\n<\/pre><\/p> ","languages_supported":"NA","title":"ADDFRAC","category":"NA","old_version":true,"problem_code":"ADDFRAC"}
|
json
|
from src.stores.amazon import *
class AmazonSimulation:
@staticmethod
def test(url):
page = get_page(url)
text = page.text
content = page.content
tree = html.fromstring(content)
price = get_price(tree)
mpn = get_mpn(text)
print(price)
print(mpn)
@staticmethod
def run_test():
# Should work
# url = 'https://www.amazon.com/Crucial-MX500-NAND-SATA-Internal/dp/B077SF8KMG'
#
# Should work
# url = 'https://www.amazon.com/gp/product/B073TQKNF2/'
#
# Should work
# url = 'https://www.amazon.com/RIPJAWS-KM570-Cherry-Speed-Silver/dp/B01LZEVDKI/'
#
# Should work
# url = 'https://www.amazon.com/Kingston-120GB-Solid-SA400S37-120G/dp/B01N6JQS8C/ref=mp_s_a_1_6?ie=UTF8&qid=1528906162&sr=8-6&pi=AC_SX236_SY340_QL65&keywords=ssd&dpPl=1&dpID=41EjY-AhQUL&ref=plSrch'
#
# Should work
# url = 'https://www.amazon.com/TP-Link-RangeBoost-Technology-Archer-A2300/dp/B0751RK6XZ/ref=sr_1_1?m=A3C0IBSA2XBL9N&s=merchant-items&ie=UTF8&qid=1528439208&sr=1-1&refinements=p_4%3ATP-Link&dpID=51LmWDKvBnL&preST=_SX300_QL70_&dpSrc=srch'
#
# Should fail
# url = 'https://www.amazon.com/Home-Audio-Electronics/b/ref=nav_shopall_hat?ie=UTF8&node=667846011'
#
# AmazonSimulation.test(url)
pass
if __name__ == '__main__':
AmazonSimulation.run_test()
|
python
|
<filename>results/smartcheck/icse20/0xbf3558318944306e5ab0b265ae808936a10f7568/result.json
{
"contract": "0xbf3558318944306e5ab0b265ae808936a10f7568",
"tool": "smartcheck",
"start": 1563668266.7374437,
"end": 1563668274.581684,
"duration": 7.844240427017212,
"analysis": [
{
"name": "SOLIDITY_LOCKED_MONEY",
"patternId": "30281d",
"severity": 3,
"line": 30,
"column": 0,
"content": "contractIntercoin{usingSafeMathforuint256;stringpublicconstantname=\"Intercoin\";stringpublicconstantsymbol=\"INT\";uint8publicconstantdecimals=8;uint256publicconstanttotalSupply=21000000*(10**uint256(decimals));mapping(address=>uint256)balances;mapping(address=>mapping(address=>uint256))internalallowed;functionIntercoin()public{balances[msg.sender]=totalSupply;}function()publicpayable{revert();}eventApproval(addressindexedowner,addressindexedspender,uint256value);eventTransfer(addressindexedfrom,addressindexedto,uint256value);functiontransfer(address_to,uint256_value)publicreturns(bool){require(_to!=address(0));require(_value<=balances[msg.sender]);balances[msg.sender]=balances[msg.sender].sub(_value);balances[_to]=balances[_to].add(_value);Transfer(msg.sender,_to,_value);returntrue;}functionbalanceOf(address_owner)publicviewreturns(uint256balance){returnbalances[_owner];}functiontransferFrom(address_from,address_to,uint256_value)publicreturns(bool){require(_to!=address(0));require(_value<=balances[_from]);require(_value<=allowed[_from][msg.sender]);balances[_from]=balances[_from].sub(_value);balances[_to]=balances[_to].add(_value);allowed[_from][msg.sender]=allowed[_from][msg.sender].sub(_value);Transfer(_from,_to,_value);returntrue;}functionapprove(address_spender,uint256_value)publicreturns(bool){allowed[msg.sender][_spender]=_value;Approval(msg.sender,_spender,_value);returntrue;}functionallowance(address_owner,address_spender)publicviewreturns(uint256){returnallowed[_owner][_spender];}functionincreaseApproval(address_spender,uint_addedValue)publicreturns(bool){allowed[msg.sender][_spender]=allowed[msg.sender][_spender].add(_addedValue);Approval(msg.sender,_spender,allowed[msg.sender][_spender]);returntrue;}functiondecreaseApproval(address_spender,uint_subtractedValue)publicreturns(bool){uintoldValue=allowed[msg.sender][_spender];if(_subtractedValue>oldValue){allowed[msg.sender][_spender]=0;}else{allowed[msg.sender][_spender]=oldValue.sub(_subtractedValue);}Approval(msg.sender,_spender,allowed[msg.sender][_spender]);returntrue;}}"
},
{
"name": "SOLIDITY_PRAGMAS_VERSION",
"patternId": "23fc32",
"severity": 1,
"line": 1,
"column": 16,
"content": "^"
},
{
"name": "SOLIDITY_REDUNDANT_FALLBACK_REJECT",
"patternId": "b85a32",
"severity": 1,
"line": 42,
"column": 28,
"content": "{revert();}"
},
{
"name": "SOLIDITY_SAFEMATH",
"patternId": "837cac",
"severity": 1,
"line": 31,
"column": 2,
"content": "usingSafeMathforuint256;"
},
{
"name": "SOLIDITY_UPGRADE_TO_050",
"patternId": "91h3sa",
"severity": 1,
"line": 42,
"column": 13,
"content": "public"
},
{
"name": "SOLIDITY_VISIBILITY",
"patternId": "b51ce0",
"severity": 1,
"line": 36,
"column": 2,
"content": "mapping(address=>uint256)balances;"
}
]
}
|
json
|
<filename>src/components/header/Header.tsx
import * as React from 'react';
import NavigationArticles from './NavigationArticles'
import Search from './Search';
import PresentationArticles from './PresentationArticles';
class Header extends React.Component<any> {
render(){
return (
<div className="KPTAPP-header">
<PresentationArticles />
<Search />
<NavigationArticles />
</div>
)
}
}
export default Header;
|
typescript
|
{"body": "What types of mistakes are there? Are you expecting to see direct reflection of the sun that is missing? Are you expecting higher overall values? Are you seeing a direct reflection when you were expecting it to be scattered?\n\n\nYou mention the error occurs when the light shelf is less than 0.5m. Is it 0.5m square? Or is it 0.5m by some longer length? Also, what are the dimensions of the room it's in? And is there a lot of additional geometry outside of the room, like the rest of a building, or even surrounding buildings? How large is everything outside the room?\n\n\n____________________________________________________________\nElectronic mail messages entering and leaving Arup business\nsystems are scanned for acceptability of content and viruses\n___\n<sup>Automatically generated content from [radiance mailing-list](https://radiance-online.org/pipermail/radiance-general/2012-November/009030.html).</sup>", "attachments": [], "created_by_name": "<NAME>", "created_at": "November 12, 2012 at 10:20AM", "created_by": "Christopher_Rush", "parent_id": "radiance-general_009026", "id": "radiance-general_009030"}
|
json
|
<filename>pipy/tests/test_utils.py
import pandas as pd
from pipy.pipeline.utils import combine_series
def test_combine_series():
s1 = pd.Series(dict(zip("AB", (1, 2))))
s2 = pd.Series(dict(zip("BC", (20, 30))))
s3 = combine_series(s1, s2)
pd.testing.assert_series_equal(s3, pd.Series({"A": 1, "B": 20, "C": 30}))
|
python
|
<reponame>gitpanshen/EasyPropertyQA
import { Injectable } from '@angular/core';
import swal from 'sweetalert2';
enum Colors {
Danger = '#c9302c',
}
@Injectable()
export class UIContext {
public handleError(err: any, title?: string, message?: string, dismissCallback?: () => void) {
console.error(err);
let errMsg: string;
if (err['_body']) {
try {
errMsg = JSON.parse(err['_body']).err;
} catch (e) {
//
}
}
if (!errMsg) {
errMsg = `${err}`;
}
swal({
title: title ? title : 'Ooops...',
text: message ? message : `Something went wrong. ${errMsg}`,
type: 'error',
confirmButtonColor: Colors.Danger,
confirmButtonText: 'Dismiss'
}).then(() => {
if (dismissCallback) {
dismissCallback();
}
});
}
}
|
typescript
|
Madhuri Dixit Birthday Special: These Rare Photos Of The Diva Will Make Your Heart Go 'Dhak-Dhak'
When Madhuri Dixit shimmied to the beats of 'Ek Do Teen' song in Tezaab, the nation went crazy over Bollywood's 'Mohini'. Soon, with a long list of memorable songs, iconic scenes and award wins, she left everyone swooning over her 'million-dollar' smile, graceful expressions and mesmerizing dance-moves. People flocked to theatres to watch the stunning actress. There were times when she even overshadowed her heroes. Yes, Madhuri Dixit was just unstoppable!
Post marriage, the actress took a long sabbatical. But, when she returned back to showbiz, her charm hadn't fizzled out! Yes, the 'Dhak-dhak' girl would still give today's actresses a run for their money.
On Madhuri Dixit's 53rd birthday, we bring you some rare pictures from her throwback photoshoots, and we bet, you won't stop staring at them!
"I didn't decide anything about acting or movies, fate had decided it for me because I have learnt Kathak for many years right since I was three years old. I was interested in dramatics and all, but I never thought I would work in films someday. I never knew anyone from a film background so the film was far from my dreams.
But, it so happened that when I was in the seventh standard I got an offer for a film in which I was supposed to play a Kathak dancer and my mom said no. But again when I was 12 years old, Rajashree production was looking for a new face. Things eventually fell in place," Madhuri recently told Indian Express.
In one of her throwback interviews, the actress recalled, "I was totally unruly and disorganized. I would throw the family and the house into an uproar before I left for school. I was such a chatterbox, I wouldn't stop talking till I had said all that I wanted to. In school I was once punished for aping a nun who sang soprano. On another occasion, I thoroughly embarrassed my mother. At three, I was asked to sing a classical song at a family get together. Instead, I broke into a cabaret number from a film, replete with all the jhataks and mataks! I guess therein lay the dormant beginnings of 'Ek, Do, Teen'..."
"When I entered the industry, I used to wear comfortable clothes because even at home, you'll find me in the oldest and the most faded clothes. I didn't realize that once you are a heroine, you are expected to dress in glittering jewelry, Kanjeevaram saris and salwar- kameez. To doll up so much at such a young age took me time to adjust to the idea," said the diva.
"I was the kind to wear just kohl and lipstick, even to functions. Can you imagine, I used just about any soap to bathe with, even Rin at times, as long as it was cleansing. I just couldn't communicate if there were more than three people around me. I withdrew into a shell and most people thought I was sulking. They gave me complexes," revealed Madhuri.
The actress confessed, "I didn't like my nose. I didn't think I was beautiful. I had this perennial pimple problem which I tried to control by drinking a lot of juice and liquid. Initially, I lacked confidence and felt that people were just being polite when they said I was beautiful. Especially since I was not being accepted as an actress. I wished my nose was smaller and that I was a little taller. I was envious of Waheeda Rehman who has the perfect nose and of Dimple and Farha, who have the best skins."
"Beauty cannot be defined in just one simple line. For me, it's the overall personality that makes a person beautiful. It is who you are and what you stand for and how talented you are. Then, it is also about how you look and carry yourself. All of this together, defines beauty. Everyone has to grow old. It is how you do it which is important. It is important to look after yourself and strive to look good, presentable and graceful," the actress said in a Filmfare interview.
(Photo credit: Pinterest)
|
english
|
const { ipcRenderer } = require('electron')
const { render } = require('./render')
const isImg = target => target.tagName === 'IMG' && ['photo-item__img'].includes(target.className)
const mouseoverFn = function (e){
const { target } = e
if (isImg(target)){
const imgParent = target.parentNode
if (!imgParent.addChild){
const options = {
width: target.getAttribute('data-image-width'),
height: target.getAttribute('data-image-height'),
url: target.getAttribute('data-large-src'),
downloadUrl: target.getAttribute('data-big-src').split('?')[0]
}
imgParent.addChild = render(options)
imgParent.appendChild(imgParent.addChild)
}
}
}
const mouseoutFn = function (e){
const { target } = e
if (isImg(target)){
const imgParent = target.parentNode
if (imgParent.addChild){
window.setTimeout(() => {
if (!imgParent.addChild.mouseoverFlag){
imgParent.removeChild(imgParent.addChild)
imgParent.addChild = null
}
}, 40)
}
}
}
ipcRenderer.on('dom-ready', () => {
document.querySelector('body').addEventListener('mouseover', mouseoverFn, false)
document.querySelector('body').addEventListener('mouseout', mouseoutFn, false)
})
|
javascript
|
{% extends "common.html" %}
{% block htmlhead %}
{% load static %}
<link rel="icon" href="{% static 'home/favico.png' %}">
<link rel="stylesheet" type="text/css"
href="{% static 'home/base.css' %}" />
<script type="text/javascript"
src="{% static 'home/base.js' %}"></script>
<script type="text/javascript"
src="{% static 'home/jquery.dialog.min.js' %}"></script>
<link rel="stylesheet" type="text/css"
href="{% static 'home/jquery.dialog.css' %}" />
{% block basehead %}
{% endblock %}
{% endblock %}
{% block commonbody %}
{% include "header.html" %}
{% block basebody %}
{% endblock %}
<div class="load-modal"></div>
{% include "footer2.html" %}
{% endblock %}
|
html
|
Reliance BP Mobility, under the brand name of Jio-bp, on Wednesday signed an MoU with the Mahindra Group for collaboration in areas such as electric vehicle products and services, and in low-carbon and conventional fuels.
Jio-bp is a fuel and mobility joint venture between Reliance Industries and UK's bp plc.
The MoU is a "non-binding" agreement.
"The MoU also covers evaluating charging solutions by Jio-bp for Mahindra vehicles including electric three and four wheelers, quadricycles and e-small commercial vehicles," Jio-bp said in a statement.
Additionally, business models like 'mobility as a service' (MaaS) and 'battery as a service' (BaaS) will be explored where Jio-bp could provide charging solutions to Mahindra vehicles, the statement said.
Besides, the partnership aims at accelerating EV adoption in India with high-performance and swappable batteries, which in turn will help in dispelling range anxiety among users.
"Such innovative solutions will broaden the horizon for both the companies and help realise India's net-zero emissions goals faster," it added.
India aims to achieve the net-zero emitting status by 2070.
|
english
|
“‘Fear not, for I am with you; Be not dismayed, for I am your God. I will strengthen you, Yes, I will help you, I will uphold you with My righteous right hand.’” (Isaiah 41:10, NKJV)
“Fear not”...We sometimes tend to believe that fear protects us. It’s true that it can be a good indicator of danger, but have you ever considered that it may also be possible that your fears have little or no rational foundation? That instead of being a protective barrier against danger, your fears may be an obstacle preventing you from entering into your destiny?
Whatever fears may be in your heart today, particularly concerning the Coronavirus, one thing is certain: God won’t leave you helpless in the face of it all. We read in the Bible, “‘No weapon formed against you shall prosper, and every tongue which rises against you in judgment you shall condemn. This is the heritage of the servants of the Lord, and their righteousness is from Me,’ says the Lord.” (Isaiah 54:17)
In His Word, God doesn’t make the promise that no weapon will be formed against you, but here’s what He does say: even if this weapon seems to reach its mark, it cannot be effective because your life is in His hand. Fear no longer - the One who upholds the universe is fighting for you!
“And Moses said to the people, ‘Do not be afraid. Stand still, and see the salvation of the Lord, which He will accomplish for you today. For the Egyptians whom you see today, you shall see again no more forever. The Lord will fight for you, and you shall hold your peace.’” (Exodus 14:13-14)
I believe and declare that you have the victory over fear!
Thanks for existing!
|
english
|
Begin typing your search above and press return to search.
Scorpio : (October 24 - November 22)
It will turn out to be an amazing day. Luck will favor you. There are chances of a hot and happening affair with a very charming office colleague. Sparks will fly from both sides. You will be in an advantageous position. Relations will take an interesting turn all of a sudden and you could decide to marry.
|
english
|
For fast-moving consumer goods, a sharp price cut in edible oil dragged down value growth. A cooler summer and erratic rainfall impacted beverages and food, while rural markets stayed under pressure due to inflation. Value sales fell 4.5% during October-December, according to Bizom, which analyses data based on orders at nearly 7.5 million kirana stores.
India's FMCG companies are facing challenges in rural markets due to sluggish demand caused by deficient rainfall. Stiff competition from local firms exacerbates the situation. However, there is hope for a recovery in rural demand in FY25 with increased government spending in the election year and the harvest of rabi crops.
Rural demand for daily household products and groceries has been challenging in villages, potentially impacting the overall consumer goods sector's volume growth. Rural volumes, which have been lagging urban growth for over a year, could either decline or remain flat due to inflation and the proliferation of smaller regional players. Upcoming general elections and a further reduction in inflation are likely to lead to a gradual improvement in FY25.
Overall sales of apparel and electronic products have been languishing for over a year now, while those of mass-segment electronic products have been low since the pandemic outbreak. According to researcher GfK, there was a slight pick-up in mass segment during Diwali.
Prices of edible oils, which experienced significant inflation after the COVID-19 pandemic, have declined by 13-30% over the past year. However, prices of daily groceries and household products, including rice, soaps, and detergents, have seen marginal increases in 2022, according to a report by Bizom.
FMCG companies had indicated that consistent decline in rural markets had halted in the September quarter but deficient rains, followed by a spike in food prices affected the second part of the quarter. Sales in villages fell 9.6% year-on-year in November, more than the 3.5% decline in cities, said Bizom, which expects rural consumption rebound to take slightly longer.
The downtrading phenomenon, where consumers switch to purchasing smaller product sizes due to financial difficulties or rising prices, has intensified in the fast-moving consumer goods (FMCG) sector. Data from retail intelligence platform Bizom shows that smaller product sizes have experienced more rapid growth compared to medium or high-priced alternatives across most FMCG categories.
Despite the moderation in inflation on an annual basis, Indians are still not opting for high-priced large consumer product packs, a TOI report showed. Low-and-mid-priced packs still figured among the preferred alternatives for most Indians as prices of large packs remain higher than expected. Indian consumers are okay with grammage reductions because extra money does not go out of their pockets.
Sales of daily essentials and electrical goods declined in the June quarter in India due to unseasonal rains and consumer spending cuts. The fast-moving consumer goods (FMCG) market fell 5%, with the beverages category dropping 28%. Neeraj Khatri, CEO of Wipro Consumer Care, stated that despite improved margins and volume growth, overall growth was still muted, particularly in rural areas.
The value of fast-moving consumer goods retailed in December rose 1.4% from the last month, according to Bizom that analyses data based on orders at kirana stores. Electronics categories grew 8-10% sequentially, according to industry executives.
"We don't see inflation ebbing anytime soon given the volatility in global markets. There are still no signs of demand recovery," said Anil Chugh, head of the foods business at Wipro Consumer Care. "With prices of many commodities still above last year's level, we expect companies to pass any benefit from falling palm and crude oil through promotions and not direct price-cuts, amid uncertainty."
Most of the discretionary personal care categories are in the mid-to-premium segment. The sales growth of such products defies the historical industry trend of consumers cutting down on discretionary FMCG spending in times of high inflation.
Edible oil and packaged commodity firm Adani Wilmar reported 10-12% incremental sequential growth so far in July over June. Executives of Emami and RSPL Group, which owns Ghari brand of detergent and Venus soap, said the recovery will gather pace now.
The sector's direct distributor count has crossed the 100,000 mark, and nearly a third of them were added by the companies in the past two financial years, according to Bizom, a sales automation firm that transacts with 7.5 million retail stores.
The maker of Saffola and Parachute oil said despite the challenging macro context, its India business stayed relatively firm, riding on focused execution and market share gains and revenue growth in the quarter was in the low single digits, while volumes were marginally positive on an exceptionally high base of 25%.
Sales of ice-creams, packaged snacks, biscuits and large packs of food products targeted at hotels, restaurants and caterers (HoReCa) have surged by double digits in the first half of February compared with a year earlier, companies and market researchers said.
In the fast moving consumer goods market, rural consumption expanded 58% year on year, twice the rate of urban consumption, which grew 28% during the quarter ended September, according to the latest report by Bizom, a sales automation firm that transacts with 7.5 million retail stores. To be fair, the overall market has recovered sharply with the quarter seeing a 46% growth in total sales by value.
Most companies including Hindustan Unilever, ITC and Marico launched their internal ordering app and have since onboarded millions of mom-and-pop stores on the platform, generating sales of about $1 billion last fiscal, according to latest report by Bizom, which tracks the sales of 7.5 million retail stores across the country.
With peak lockdown months coinciding with the single largest quarter of April-June, which contributes more than half of the packaged beverages industry’s annual sales of over Rs 20,000 crore, the segment has still lost 40% of their annual sales despite the recent recovery.
Bizom, a sales automation firm that transacts with 7.5 million retail stores, said operational kirana stores fell to a fourth in April after Covid-induced curbs, liquidity challenges and reverse migration forced millions of neighbourhood shops to shut down. However, the store count has gradually risen and was about 8% higher in October compared to the pre-Covid months of January and February.
|
english
|
{
"status": {
"noErrors": "NEssun errore",
"oneError": "1 errore",
"severalErrors": "${errors} errorq",
"line": "Riga",
"type": "Tipo",
"message": "Messaggio",
"file": "File"
},
"sidebar": {
"settings": {
"model": "Modello",
"texture": "Texture",
"filtering": {
"title": "Filtro",
"nearest": "Pixelato",
"linear": "Morbido"
},
"wrapping": {
"title": "Wrapping",
"clampToEdge": "Bordi fissi",
"repeat": "Ripeti",
"mirroredRepeat": "Ripeti a specchio"
},
"showSkeleton": "Mostra scheletro",
"unitRatio": "Proporzioni Unità",
"opacity": {
"title": "Opacità",
"opaque": "Opaca",
"transparent": "Transparente"
}
},
"animations": {
"title": "Animazioni",
"new": {
"prompt": "Inserisci un nome per l'animazione.",
"initialValue": "Animazione"
},
"renamePrompt": "Inserisci un nuovo nome per l'animazione.",
"deleteConfirm": "Sei sicuro di voler eliminare le animazioni selezionate?"
},
"advancedTextures": {
"title": "Texture Avanzate",
"map": "Mappa",
"lightMap": "Light map",
"specularMap": "Specular map",
"alphaMap": "Alpha map",
"normalMap": "Normal map (Phong)",
"newMapPrompt": "Inserisci un nuovo nome per la mappa.",
"renameMapPrompt": "Inserisci un nuovo nome per la texture.",
"deleteMapConfirm": "Sei sicuro di voler eliminare le texture selezionate?",
"downloadPrompt": "Inserisci un nome per l'immagine.",
"downloadInitialValue": "Immagine"
}
}
}
|
json
|
The official trailer for 'Dharavi Bank' is out. Director Samit Kakkad's Dharavi Bank has Suniel Shetty, Vivek Anand Oberoi, and Sonali Kulkarni in the lead roles. It appears that Suniel Shetty will play a very important part for the first time in a very long time. Vivek Oberoi will play the part of a good cop, while Shetty will play the role of a mobster named Thalaivan.
In addition to an ensemble supporting cast that includes Luke Kenny, Freddy Daruwala, Shanthi Priya, Santosh Juvekar, Nagesh Bhosle, and Siddharth Menon, the series is directed by Samit Kakkad and produced by Zee Studios.
Beginning on November 19, MX Player will broadcast all of the episodes of this suspenseful show.
|
english
|
Billions Season 5 Episode 12 Review Release Date Spoiler Recap Where To Watch!: One of the fascinating and popular web shows of the US television network named Billions has returned back with the new episode of its fifth season.
The web show has kept interested in its franchise for a long period of time as the show’s content and plots have spread the craziness among the viewers and with that viewers every time desperate for its upcoming volumes. Now for all the Billions show lovers, the makers of the show are all set to release the season 5th episode 12th very soon. So get ready for the power booster series.
Curious to know each update of the show then stick with us and read the complete article.
As per the information gathered the on-demanding and thrilling web show named Billions Episode 12th of the season 5th will be released on Sunday, October 3rd,2021 at 9 pm on Showtime. Episode 12 will be the final episode of season 5th of the show but don’t worry the season 6th of the show will be very soon released.
As per the teaser’s trailer, it shows that there will be a clashing battle between Axe and Mike Prince which will be emerging with the former at the backs of the bars. While Mike enjoys his victory celebration over Axe and with that he suggests that Axe and his fellows have something in their minds to do on Mike’s Parade. However, Mike’s daughters named Liz and Gail will continue to finds the matter.
Talks about the previous volume then Axe is still trying hard to make some hard money for the bank named Axe Bank while in confine due to covid pandemic. Meanwhile, Mike Prince starts to train his daughters for the interview of Fine Young Cannibis as a major patron for the Hypercube.
While Axe got to know Mike’s interest in Fine Young Cannibis but despite that, the CEO of Cannabis named Dawn Winslow were got amazed by the Prince’s daughters. With that Axe proffer 3% of interest and his country’s residence to Winslow for the Cannibis deal in return. And with that, the episode all sum up with Mike disclosure to his daughters that this was all set only to send Axe to Prison.
|
english
|
// Code generated by smithy-go-codegen DO NOT EDIT.
package secretsmanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/secretsmanager/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Validates that the resource policy does not grant a wide range of IAM principals
// access to your secret. The JSON request string input and response output
// displays formatted code with white space and line breaks for better readability.
// Submit your input as a single line JSON string. A resource-based policy is
// optional for secrets. The API performs three checks when validating the
// secret:
//
// * Sends a call to Zelkova
// (https://aws.amazon.com/blogs/security/protect-sensitive-data-in-the-cloud-with-automated-reasoning-zelkova/),
// an automated reasoning engine, to ensure your Resource Policy does not allow
// broad access to your secret.
//
// * Checks for correct syntax in a policy.
//
// *
// Verifies the policy does not lock out a caller.
//
// Minimum Permissions You must
// have the permissions required to access the following APIs:
//
// *
// secretsmanager:PutResourcePolicy
//
// * secretsmanager:ValidateResourcePolicy
func (c *Client) ValidateResourcePolicy(ctx context.Context, params *ValidateResourcePolicyInput, optFns ...func(*Options)) (*ValidateResourcePolicyOutput, error) {
if params == nil {
params = &ValidateResourcePolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ValidateResourcePolicy", params, optFns, c.addOperationValidateResourcePolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ValidateResourcePolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type ValidateResourcePolicyInput struct {
// A JSON-formatted string constructed according to the grammar and syntax for an
// Amazon Web Services resource-based policy. The policy in the string identifies
// who can access or manage this secret and its versions. For information on how to
// format a JSON parameter for the various command line tool environments, see
// Using JSON for Parameters
// (http://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-json)
// in the CLI User Guide.publi
//
// This member is required.
ResourcePolicy *string
// (Optional) The identifier of the secret with the resource-based policy you want
// to validate. You can specify either the Amazon Resource Name (ARN) or the
// friendly name of the secret. For an ARN, we recommend that you specify a
// complete ARN rather than a partial ARN.
SecretId *string
noSmithyDocumentSerde
}
type ValidateResourcePolicyOutput struct {
// Returns a message stating that your Reource Policy passed validation.
PolicyValidationPassed bool
// Returns an error message if your policy doesn't pass validatation.
ValidationErrors []types.ValidationErrorsEntry
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationValidateResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpValidateResourcePolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpValidateResourcePolicy{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpValidateResourcePolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opValidateResourcePolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opValidateResourcePolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "secretsmanager",
OperationName: "ValidateResourcePolicy",
}
}
|
go
|
Terence Crawford put on the performance of a lifetime against Errol Spence Jr. last weekend, and his teammate believes he could defeat Canelo Alvarez too, should the pair ever face off.
Crawford is the same height as Alvarez but is significantly smaller at his stage. The weight that 'Bud' currently fights at, welterweight (147 pounds), is the weight that Alvarez began his career at.
The Mexican has moved all the way up to light heavyweight in the past but currently competes at super-middleweight (160 pounds), where he is the unified champion.
According to Shakur Stevenson, who trains with Terence Crawford, 'Bud' has the skillset to topple the generational talent of Canelo Alvarez. During a recent interview with IFL TV, Stevenson said this:
"I think Bud could beat Canelo... I would like to see it. I don't think size wins fights, I think skills do. I don't know who else will listen to me, but I think Bud stylistically - being a southpaw with good movement, sharp boxing, it's gonna be hard for Canelo, with that high guard, to walk him down and unload with those big hooks. I think Bud would beat Canelo."
Watch the video below from 4:50:
Terence Crawford's ninth-round stoppage of Errol Spence Jr. sent shockwaves around the boxing world. A fight billed as one of the biggest boxing matchups in the past thirty years ended up being a one-sided beatdown in a stunning turn of events.
Crawford made history by becoming the first-ever undisputed welterweight champion and the first male boxer to become an undisputed champion in two weight divisions.
Terence Crawford and Errol Spence Jr. put their undefeated records on the line to determine the first undisputed welterweight world champion.
'Bud' proved too much for Spence Jr. to handle, and he began dominating his opponent as early as the second round.
Both men are known as finishers, with Crawford holding 30 KO wins to Spence Jr.'s 22 KO wins before their contest. But following the fight, 'Bud' revealed that 'The Truth' did not hit as hard as he expected.
Terence Crawford said this:
"After the second round, when I hurt him, I felt as if he couldn't handle my power like I could handle his. I remember him throwing an overhand looping left, and he caught me right on the button, I think it was the first or the second round, and I was just like, 'This is it? Okay. This is gonna be a long night for him"
Watch the video below:
|
english
|
<filename>data/nber/21659.json
{
"id": 21659,
"citation_title": "Employment and Training Programs",
"citation_author": [
"<NAME>",
"<NAME>"
],
"citation_publication_date": "2015-10-26",
"issue_date": "2015-10-22",
"revision_date": "None",
"topics": [
"Public Economics",
"Health, Education, and Welfare",
"Education",
"Labor Economics",
"Labor Supply and Demand"
],
"program": [
"Labor Studies",
"Public Economics"
],
"projects": null,
"working_groups": null,
"abstract": "\n\nThis chapter considers means-tested employment and training programs in the United States. We focus in particular on large, means-tested federal programs, including the Job Training Partnership Act (JTPA), its successor the Workforce Investment Act (WIA), that program\u2019s recent replacement, the Workforce Innovation and Opportunity Act (WIOA), the long-running Job Corps program, and the Trade Adjustment Assistance (TAA) program. The first part of the chapter provides details on program history, organization, expenditures, eligibility rules, services, and participant characteristics. In the second part of the chapter, we discuss the applied econometric methods typically used to evaluate these programs, which in the United States means primarily social experiments and methods such as matching that rely on an assumption of \u201cselection on observed variables.\u201d The third part of the chapter reviews the literature evaluating these programs, highlighting both methodological and substantive lessons learned as well as open questions. The fourth part of the chapter considers what lessons the evaluation literature provides on program operation, especially how to best allocate particular services to particular participants. The final section concludes with the big picture lessons from this literature and discussion of promising directions for future research.\n\n",
"acknowledgement": "\nThe views expressed herein are those of the authors and do not necessarily reflect the views of the National Bureau of Economic Research. Disclaimer on potential conflicts of interest: Both authors have undertaken contract research sponsored by the U.S. Department of Labor as well as serving on numerous technical advisory panels and providing comments on draft reports for various evaluations. In particular, in regard to evaluations considered in detail in this chapter, both authors were part of the NORC subcontract for the non-experimental component of the National JTPA Study, both authors reviewed drafts and provided technical advice on the recent TAA evaluation, and both are members of the technical advisory panel for the WIA experiment. It should, but does not, go without saying that the views expressed represent those of the authors alone.\n\n\n"
}
|
json
|
package main;
/**
* Created by jshanmug on 09/08/15.
*/
public class Bird {
private String color;
private String type;
private String habitat;
public String getName() {
return name;
}
private String name;
public String getColor() {
return color;
}
public String getType() {
return type;
}
public String getHabitat() {
return habitat;
}
public Bird(String Name, String Color, String Type, String Habitat)
{
name = Name;
color = Color;
type = Type;
habitat = Habitat;
}
}
|
java
|
Ada fenomena aneh yang saya lihat, yaitu sebagian jamaah shalat membawa anak-anak perempuan mereka yang masih kecil ke masjid pada waktu-waktu shalat. Umumnya anak-anak tersebut rambutnya dihias menarik dan pakaiannya pendek menarik perhatian. Sangat disayangkan dengan pakaian dan dandanan mereka yang dapat menggoda orang yang ada penyakit hati.
Apakah pengaruh dari fenomena ini dalam pendidikan anak perempuan dan gadis remaja? Apa pengaruhnya jika sang anak dibiasakan mengikuti kebiasaan wanita dewasa yang suka buka-bukaan hanya untuk menyenangkan hati orang tua? Juga apakah membiasakan mereka berkumpul dengan orang-orang laki di masjid berdampak sesuatu?
Tidak mengapa mengajak anak perempuan kecil ke masjid dalam shalat berjamaah dengan memperhatikan beberapa perkara:
1- Masih usia kanak-kanak sebelum masa tamyiz dan baligh jika dia bersama bapak atau saudara laki-lakinya. Adapun jika dia ikut bersama ibunya atau saudara perempuannya, maka batasan ini tidak berlaku.
2- Tidak menyebabkan kegaduhan dan mengganggu orang shalat. Hal tersebut dapat dihindari dengan memberikan nasehat lembut kepadanya.
3- Mengantisipasi agar dia tidak mengotori masjid karena buang air kecil atau besar.
4- Kedua orang tuanya menghindari pakian sempit dan pendek padanya. Ini merupakan bagian untuk mendidiknya menjaga kehormatan, dan hal ini berlaku di mana saja dia berada. Tidak diragukan lagi bahwa mesjid lebih utama untuk sang anak memakai pakaian syar’i dan menjauhi perhiasan.
Dalil dibolehkannya mengajak anak perempuan kecil sebelum masa tamyiz dan balig adalah riwayat Qatadah radhiallahu anhu, dia berkata,
خَرَجَ عَلَيْنَا النَّبِيُّ صلى الله عليه وسلم وَأُمَامَةُ بِنْتُ أَبِي الْعَاصِ عَلَى عَاتِقِهِ ، فَصَلَّى ، فَإِذَا رَكَعَ وَضَعَهَا ، وَإِذَا رَفَعَ رَفَعَهَا .(رواه البخاري، رقم 5996 ومسلم، رقم 543 )
"Nabi shallallahu alaihi wa sallam keluar sambil menggendong Umamah binti Abul Ash di pundaknya, lalu beliau shalat, apabila ruku beliau meletakkannya, jika bangkit, beliau mengangkatnya." (HR. Bukhari, no 5996, Muslim, no. 543)
Akan tetapi, perlu diketahui, bahwa siapa yang usianya masih dibawah usia tamyiz, bahkan walaupun dia anak laki, maka orang yang berada disampingnya tidak terhindar dari prilakunya. Karena itu, tidak ada landasan dalam syariat untuk mengajak anak seusia mereka ke masjid. Karena dari satu sisi, mereka belum dapat mengambil manfaat dari hal tersebut, dan di sisi lain tindakannya akan dapat mengganggu pada umumnya. Akan tetapi hal tersebut selayaknya terjadi karena situasi mendadak, atau ada keperluan atau sesuatu kejadian yang bersifat jarang, atau semacamnya. Perbuatan Nabi shallallahu alaihi wa sallam terhadap puterinya Zainab (Umamah) bukan merupakan kebiasaan yang kontinyu. Bahkan terdapat riwayat bahwa Umamah binti Zainab tersebut bergelayutan dengan kakeknya Rasulullah shallallahu alaihi wa sallam saat beliau keluar menuju masjid, maka kemudian beliau menggendongnya dan membawanya ke masjid.
Ash-Shan'ani rahimahullah berkata, "Ucapan; 'Beliau dahulu shalat..' menunjukkan bahwa redaksi ini tidak berarti pengulangan secara mutlak, karena peristiwa menggendong Umamah hanya terjadi sekali pada beliau, tidak (terjadi pada waktu) lain." (Subulussalam, 1/211)
Tidak sepantasnya menjadikan hadits ini sebagai dalil untuk membawa anak-anak yang suka mengganggu dan mengusik rumah Allah Ta'ala. Karena jika diperkirakan ada manfaat membawa mereka ke masjid, akan tetapi kerusakan yang ditimbulkan mereka lebih besar dari kebaikannya. Dan menghindari kerusakan didahulukan dari mendatangkan manfaat. .
Ibnu Qasim rahimahullah berkata, "Malik ditanya tentang anak kecil yang dibawa ke masjid?" Beliau berkata, "Jika dia tidak mengganggu karena usianya yang masih kecil, atau menurut jika dilarang, maka saya memandang tidak apa-apa (dibawa ke masjid)." Lalu dia berkata, "Tapi jika dia mengganggu, maka saya memandang agar jangan dibawa ke masjid." (Al-Mudawwanah, 1/106)
Syaikhul Islam Ibnu Taimiah rahimahullah berkata, "Masjid hendaknya dipelihara dari apa saja yang mengganggunya dan mengganggu orang shalat di dalamnya. Misalnya dari suara keras anak-anak, atau tindakan mereka yang mengotori tikarnya, dan semacamnya. Khususnya pada saat shalat. Karena hal tersebut merupakan kemunkaran yang besar." (Majmu Fatawa, 22/204)
Ulama Lajnah Daimah (22/204) berkata, "Jika anaknya belum usia tamyiz, maka lebih baik tidak dibawa ke masjid, karena dia belum mengerti shalat dan mengerti makna berjamaah, disamping dia dapat mengganggu orang shalat."
(Syekh Abdul Aziz bin Baz, Syekh Abdul Aziz Al Syekh, Syekh Abdullah bin Ghudayyan, Syekh Saleh Al-Fauzan, Syekh Bakar Abu Zaid)
Fatawa Lajnah Daimah, Al-Majmua Ats-Tsaniah, 5/263-264)
Yang penting diketahui dalam masalah ini adalah bahwa membawa anak kecil perempuan ke rumah Allah Ta'ala tidak sama dengan membawa anak kecil laki-laki. Karena seorang muslim butuh mendidik anak laki-lakinya untuk shalat dan mendidiknya di rumah Allah serta membiasakannya datang ke masjid, karena shalat berjamaah di masjid apabila dia telah balig wajib hukumnya. Hal tersebut tidak sama bagi wanita apabila dia balig, bahkan syariat menganjurkan mereka (para wanita) untuk shalat di rumahnya saja, dan bahkan menjadikan hal tersebut lebih utama bagi mereka daripada shalat di Masjidil Haram dan Masjid Nabawi. Maka perbedaan antara anak kecil laki-laki dan anak kecil perempuan cukup besar. Apa yang disebutkan penanya dari dampak buruk membawa anak kecil perempuan ke masjid benar adanya dan kami akui demikian. Karena itu, kami peringatkan kepada para jamaah shalat agar perhatian mereka dalam masalah ini (membawa anak ke masjid) dikhususkan bagi anak laki-laki sebagaimana disebutkan sebelumnya. Sedangkan urusan shalat anak kecil perempuan diserahkan kepada ibunya, agar dia shalat bersamanya di rumah, juga agar dia terbiasa tidak keluar rumah serta memberikan pelajaran kepadanya bahwa shalatnya di rumah lebih baik daripada shalatnya di masjid, juga agar dia tidak terbiasa bercampur baur dengan laki-laki. Ini semua merupakan manfaat yang besar, wajib bagi para pendidik dan penuntut ilmu untuk tidak mengabaikannya ketika membicarakan hal ini.
Khusus mengenai pakaian wanita dan kewajiban mendidik mereka dengan akhlak terpuji sejak kecil serta membiasakan mereka mengenakan pakaian terhormat serta dampak membiasakan mereka dengan pakaian pendek dan telanjang, lihat jawaban pada soal no. 103526, no. 43485, no. 6907. Di sana terdapat tambahan penjelasan.
Soal Jawab Tentang Islam.
|
english
|
The England Cricket Board (ECB) is back with the second season of the newest format of cricket, The Hundred 2022. The inaugural season of The Hundred was a big hit last year. The Hundred has been modelled after the hugely popular Indian Premier League (IPL).
However, the competition differs from T20 cricket as it stipulates 100 balls per innings. The competition was touted as ECB’s very own franchise league and recorded huge crowds and viewership numbers in its inaugural season.
The Hundred will feature limited-overs cricket specialists like Kieron Pollard, Dwayne Bravo, David Miller, Andre Russell and Adam Zampa. Defending champions Southern Braves will take on Welsh Fire in the first game of the season on August 3.
Ahead of the start of The Hundred 2022, here is the complete schedule and squads of the tournament:
The Hundred 2022 Full Schedule & Match Timings (All Times in IST)
Squads (with injury updates)
Dawid Malan, Joe Root, Lewis Gregory (c), Alex Hales, Matthew Carter, Tom Moores, Steven Mullaney, Luke Wood, Samit Patel, Sam Cook, Ian Cockbain, Tom Kohler-Cadmore, Luke Fletcher, Ben Mike, Rashid Khan, Colin Munro, Marchant de Lange,Daniel Sams, Tabraiz Shamsi (Rashid’s replacement final leg of the tournament)
|
english
|
{
"id": 17146,
"citation_title": "Trade Credit Contracts",
"citation_author": [
"<NAME>",
"<NAME>",
"<NAME>"
],
"citation_publication_date": "2011-06-16",
"issue_date": "2011-06-16",
"revision_date": "2020-06-08",
"topics": [
"Financial Economics",
"Corporate Finance"
],
"program": [
"Corporate Finance"
],
"projects": null,
"working_groups": null,
"abstract": "\n\nWe employ a novel dataset on almost 30,000 trade credit contracts to describe the broad characteristics of the parties that contract together and the key contractual terms of these contracts. Whereas prior work has typically used information on only one side of the buyer-seller transaction, this paper utilizes information on both, allowing for the first analysis of buyer-seller pairs. An equally important distinction is that we have multiple contracts for the same buyer or supplier firms, rather than a firm-average response, allowing for the correction of time-invariant firm characteristics that might determine the choice of credit terms. We find that the largest and most creditworthy buyers receive contracts with the longest maturities from smaller suppliers, and that discounts for early payment tend to be offered to riskier buyers. (JEL G32)\n\n",
"acknowledgement": "\nWe thank PrimeRevenue for generously sharing the trade credit contract data, <NAME> (the Editor), two anonymous referees, <NAME>, <NAME>, <NAME>, and <NAME> for useful comments or suggestions, and <NAME> and <NAME> for excellent research assistance. The views expressed herein are those of the authors and do not necessarily reflect the views of the National Bureau of Economic Research.\n\n\n"
}
|
json
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JuanOlima|FrontEndDeveloper</title>
<link rel="stylesheet" href="./css/main.css">
<link rel="stylesheet" href="./css/icons.css">
<link rel="stylesheet" href="./css/media-queries.css">
</head>
<body>
<header>
<section class="header-icons-container">
<div class="icons">
<a href="index.html"><span class="inicio-icon"></span>Inicio</a>
<a href="https://ar.linkedin.com/in/juanolima"> <span class="linkedin-icon"></span></a>
<a href="https://twitter.com/"><span class="twitter-icon"></span></a>
<a href="https://github.com/olimajs"><span class="github-icon"></span></a>
</div>
</section>
<nav>
<section class="nav-logo-container">
<img class="milogo" src="./assets/mylogo2.png" alt="Logo de mi blog"></a>
</section>
<section class="profile-link">
<a href="aboutme.html">Sobre mí</a>
</section>
</nav>
</header>
<main class="blogs-main">
<section class="blogs-news-container">
<div class="grid-container blogs-main-news">
<h3>Proyecto de muestra:</h3>
<div class="blogs-news-img-container">
<img src="./assets/projectimg/a&c.png" alt="A&c SERVCIO DE LIMPIEZA">
</div>
<div class="blogs-news-info-container">
<h2>A&C Servicios de Limpieza.</h2>
<p>Primera muestra de Landing page p/emprendimiento de un cliente en Rubro de Limpieza.🧽🧹🧼 <br><br> Realizado con HTML5 Y CSS3(flex).</p>
<a href="https://olimajs.github.io/Landing-page-a.c/"class="blogs-button">Ver más</a>
</div>
</div>
</section>
<section class="blogs-posts-container">
<div class="grid-container">
<h3>Otros proyectos:</h3>
<article class="post-container">
<img src="./assets/projectimg/prototip.png" alt="preview of tip calculator">
<p><u>Tip Calculator|Calcula propina.</u></p>
<p>Ingresa el total de la cuenta y dividelo entre los presentes.<br> 👩🏻💻: HTML,CSS y JavaScript.</p>
<a href="https://olimajs.github.io/Propina-Calc./"class="blogss-button">Ver más</a>
</article>
<article class="post-container">
<img src="./assets/projectimg/timer.png" alt="cronometrotimer">
<p><u>Timer/Cronómetro</u></p>
<p>Timer/Cronómetro ⌚<br> 👩🏻💻: HTML, CSS y JavaScript.</p>
<a href="https://olimajs.github.io/Cron-metro-Timer/"class="blogss-button">Ver más</a>
</article>
<article class="post-container">
<img src="./assets/projectimg/googlehompage.png" alt="Googlewelcomeclone">
<p> <u>Clon de Google Home Page</u></p>
<p>Clon de la Home Page de Google.<br> 👩🏻💻: HTML y CSS.</p>
<a href="https://olimajs.github.io/GoogleWelcomeClone/"class="blogss-button">Ver más</a>
</article>
<article class="post-container">
<img src="./assets/projectimg/batabitpic.png" alt="Batabitpage">
<p> <u>Batabit.Page</u></p>
<p> Home Page para empresa de criptomonedas Batabit. (Proyecto realizado para aprobar challenge de resposive design by Platzi). <br> 👩🏻💻: HTML y CSS.</p>
<a href="https://olimajs.github.io/Batabit.page/"class="blogss-button">Ver más</a>
</article>
<article class="post-container">
<img src="./assets/projectimg/webmath.png" alt="mathpageapp">
<p><u>Web Math app</u></p>
<p>Proyecto de matemáticas para calcular promedios entre otras cosas. Código disponible para el/la que quiera agregar css💛. <br> 👩🏻💻: HTML y JavaScript.</p>
<a href="https://olimajs.github.io/mathpage-js/" class ="blogss-button">Ver más</a>
</article>
<article class="post-container">
<img src="./assets/projectimg/platziburger.png" alt="Platzi Burger Homepage">
<p> <u>PlatziBurger|Fast Food</u></p>
<p>HomePage de Hamburguesería🥗🥫🍝. <br> 👩🏻💻: HTML5, TailwindCSS, y AlpineJS.</p>
<a href="https://olimajs.github.io/PlatziBurger/"class="blogss-button">Ver más</a>
</article>
</div>
</section>
</main>
<footer>
<p>© 2021 <NAME>.</p>
</footer>
</body>
</html>
|
html
|
3 Remember this! There will be many troubles in the last days. 2 In those times people will love only themselves and money. They will brag and be proud. They will say evil things against others. They will not obey their parents. People will not be thankful or be the kind of people God wants. 3 They will not have love for others. They will refuse to forgive others and will speak bad things. They will not control themselves. They will be cruel and will hate what is good. 4 In the last days, people will turn against their friends. They will do foolish things without thinking. They will be conceited and proud. They will love pleasure. They will not love God. 5 They will continue to act as if they serve God, but they will not really serve God. Stay away from those people. 6 Some of them go into homes and get control of weak women who are full of sin. They are led to sin by the many evil desires they have. 7 Those women always try to learn new teachings, but they are never able to understand the truth fully. 8 Just as Jannes and Jambres were against Moses, these people are against the truth. They are people whose thinking has been confused. They have failed in trying to follow the faith. 9 But they will not be successful in what they do. Everyone will see that they are foolish. That is what happened to Jannes and Jambres.
10 But you know all about me. You know what I teach and the way I live. You know my goal in life. You know my faith, my patience, and my love. You know that I never stop trying. 11 You know how I have been hurt and have suffered. You know all that happened to me in Antioch, Iconium, and Lystra. You know the hurts I suffered in those places. But the Lord saved me from all those troubles. 12 Everyone who wants to live the way God wants, in Christ Jesus, will be persecuted. 13 People who are evil and cheat other people will go from bad to worse. They will fool others, but they will also be fooling themselves.
14 But you should continue following the teachings that you learned. You know that these teachings are true. And you know you can trust those who taught you. 15 You have known the Holy Scriptures since you were a child. The Scriptures are able to make you wise. And that wisdom leads to salvation through faith in Christ Jesus. 16 All Scripture is inspired by God and is useful for teaching and for showing people what is wrong in their lives. It is useful for correcting faults and teaching how to live right. 17 Using the Scriptures, the person who serves God will be ready and will have everything he needs to do every good work.
The Holy Bible, International Children’s Bible® Copyright© 1986, 1988, 1999, 2015 by Thomas Nelson. Used by permission.
|
english
|
var a01011 =
[
[ "History", "a01011.html#a8b2c1637ad018a556951686442f5e659", null ],
[ "History", "a01011.html#aaa86eda0a602fb9e9b4f066d6a15a6bd", null ],
[ "depth", "a01011.html#abd6052760b1824adbde8e604c22194cf", null ],
[ "depth", "a01011.html#affa52cd0e5de169fe269d62c02383dc2", null ],
[ "KeepAll", "a01011.html#abbb117f178a30e6753ba7e36998a471a", null ],
[ "KeepLast", "a01011.html#ac72f475969d5984cba75ab76bc3cf72d", null ],
[ "kind", "a01011.html#aa3fbacd0900fb3c25579ae53f2dd40b9", null ],
[ "kind", "a01011.html#abc13416d139b21f1ec167a0a1920122b", null ],
[ "operator!=", "a01011.html#a9b22715713bc0bfc10af93eeaeda80f4", null ],
[ "operator->", "a01011.html#a948a6f4576c26fe7e44c551a56f4d038", null ],
[ "operator->", "a01011.html#a0147b1dea8bdb0987505033b7025470c", null ],
[ "operator==", "a01011.html#a34fd669d0051ad90b89d98a323d2d96a", null ]
];
|
javascript
|
<reponame>marcofanti/manning-smia
package com.optimagrowth.license.config;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import lombok.Getter;
import lombok.Setter;
@Configuration
@ConfigurationProperties(prefix = "example")
@Getter @Setter
public class ServiceConfig{
private String property;
}
|
java
|
{"ast":null,"code":"import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nexport default function useForceUpdate() {\n var _React$useReducer = React.useReducer(function (x) {\n return x + 1;\n }, 0),\n _React$useReducer2 = _slicedToArray(_React$useReducer, 2),\n forceUpdate = _React$useReducer2[1];\n\n return forceUpdate;\n}","map":null,"metadata":{},"sourceType":"module"}
|
json
|
Kent captain Rob Key fell two runs short of a century as the County Championship Division Two match against Leicestershire ended in a draw at Grace Road.
Set a target of 332 Kent looked to be on course for victory when they cruised to 184 for 2. But they then lost three wickets for two runs in five balls, with Key bowled for 98 by Wayne White.
The paceman then dismissed Geraint Jones with his next delivery and when Darren Stevens was out to a catch in the deep Leicestershire's own chances of winning looked to have been boosted. But the two teams somewhat surprisingly shook hands on a draw with eight overs remaining with Kent, on 255 for 6, still needing another 77 runs.
Leicestershire resumed the final day on 227 for 5, leading by 265 and looking for quick runs in order to set Kent a target. Tom New and Shiv Thakor took their sixth-wicket stand to 100 in 29 overs before 17-year-old Thakor was caught at gully off Azhar Mahmood for 34.
New followed having made 76 off 101 balls with 10 boundaries. He was trapped lbw by the same bowler with a delivery that kept low. Mahmood also claimed the wickets of Jigar Naik and Claude Henderson and Leicestershire declared on 289 for 9, leaving Kent 332 to win in 75 overs. Mahmood finished with 4 for 42.
Although Kent lost opener Joe Denly who was bowled by a fine delivery from Alex Wyatt with the total on 32, the visitors made good progress with Key playing a captain's role.
He looked assured and confident, using the sweep shot to great effect against Leicestershire's spinners. The Kent captain reached his 50 off 74 balls with six boundaries plus a six off Henderson and shared a stand of 82 in 20 overs with Sam Northeast.
But Northeast was out with the total on 113, lbw to Naik, leaving Martin van Jaarsveld to join Key in another useful partnership for the third wicket. Their stand put on 71 in 19 overs but van Jaarsveld's dismissal by Henderson triggered the loss of three quick wickets in five deliveries.
Key could hardly believe it when he was bowled off stump by White as he tried to work the ball away on leg side, having made 98 off 153 balls with 12 fours and a six.
Mahmood hit an unbeaten 46 but in the end the teams settled on a draw with neither side gaining an edge ahead of once again facing each other in a T20 quarter-final at Grace Road tomorrow.
|
english
|
pub mod file_operations;
pub mod error_logging;
|
rust
|
{"nom":"Lion-sur-Mer","circ":"5ème circonscription","dpt":"Calvados","inscrits":2226,"abs":1022,"votants":1204,"blancs":22,"nuls":5,"exp":1177,"res":[{"nuance":"REM","nom":"M. <NAME>","voix":463},{"nuance":"DVG","nom":"Mme <NAME>","voix":268},{"nuance":"LR","nom":"M. <NAME>","voix":198},{"nuance":"FN","nom":"Mme <NAME>","voix":118},{"nuance":"ECO","nom":"M. <NAME>","voix":67},{"nuance":"EXG","nom":"Mme <NAME>","voix":25},{"nuance":"DLF","nom":"<NAME>","voix":19},{"nuance":"DVG","nom":"M. <NAME>","voix":15},{"nuance":"DIV","nom":"M. <NAME>","voix":4}]}
|
json
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.