text stringlengths 1 1.04M | language stringclasses 25 values |
|---|---|
Censor Details:
- Not Available.
- Not Available.
- Not Available.
- Not Available.
Q: What is the release date of Janam?
A: The release date of Janam is 01 January 1986.
Q: Who are the actors in Janam?
A: The starcast of the Janam includes Kumar Gaurav.
Q: Who is the director of Janam?
A: Janam has been directed by .
Q: Who is the producer of Janam?
A: No Data Found..
Q: What is Genre of Janam?
A: Janam belongs to the genre Drama.
Q: Who is the music director of Janam?
A: The music of Janam has been composed by Ajit Verma.
| english |
* { box-sizing: border-box; margin: 0; padding: 0 }
html,
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.header {
background-color: #eee;
padding: 25px;
box-shadow: 0 1px 10px #999;
display: flex;
}
.header h1 {
margin-right: 25px;
}
.header ul {
padding: 0px;
margin: 0px;
list-style: none;
align-self: center;
padding-top: 5px;
}
.header ul li {
display: inline;
}
.header ul li a {
padding: 2px 10px;
display: inline-block;
color: #106274;
text-decoration: none;
}
.header ul li a:hover {
opacity: 0.6;
}
.header ul li a.active {
font-weight: bold;
}
.content {
margin: 40px 25px;
}
@media only screen and (max-width: 375px) {
.content {
margin: 40px 15px;
}
.header h1 {
font-size: 150%;
}
}
@media only screen and (max-width: 768px) {
.header {
display: block;
}
.header h1 {
text-align: center;
margin-right: 0;
margin-bottom: 15px;
}
.header ul {
text-align: center;
}
} | css |
Vegetarian salads for the New Year are usually prepared in the event that one of the invited guests does not eat meat or simply adheres to a healthy and dietary diet. I would also like to say that today there are a huge number of recipes for such dishes. Using them, you can quickly and easily make any salad without using meat. Let's consider some ways of preparation in more details.
In this section of the article it was decided to tell you about how a simple salad "Health" with mushrooms is made. By the New Year's table it can be served warmly. If you decide to make it in summer, then it is recommended to pre-cool the snack in the refrigerator.
So, the ingredients:
- Fresh medium-sized mushrooms - about 300 g;
- Canned white beans - a small jar;
- Canned peas - a small jar;
- Bulb - 1 piece;
- Fresh greens - apply to taste;
- Walnuts - apply to taste;
- Spices are different - apply to taste;
- Oil without aroma sunflower - apply at your discretion.
Presented salad with vegetarian mushrooms should be started with the processing of ingredients. To begin with, you need to wash the mushrooms, and then cut them into strips. Next, you need to clean the bulb and chop it into half rings. As for walnuts, they should be sorted, thoroughly washed and divided into large pieces. In the end, with the canned products, you need to drain the brine.
Delicious vegetarian salads can include completely different ingredients. We decided to use the simplest and most affordable ones. Some of them should be fried in a frying pan. To do this, you need to pour in the oil (without the aroma, sunflower) in the dishes, and then lay out the semicircles of onions and achieve their rosy color. Next to the vegetable should be poured mushrooms. Having spiced the ingredients, they must be cooked to the full softness.
In the end, the products are required to lay out the pressed white beans and to stand on the fire for about 5 minutes.
Vegetarian New Year salads can be served to the table in a warm and cold form. After all the ingredients have been cooked, they should be removed from the fire. Next to them you must immediately lay out the chopped fresh greens, washed walnuts and canned peas. After mixing, all the products should be placed in a salad bowl and warmly presented to the table.
Almost all vegetarian salads for the New Year are prepared surprisingly quickly. This is due to the fact that for their formation you do not need to long process the meat, boil it, and then shred to the right pieces. It is for this reason that these snacks are very popular with those who do not like to stand at the stove for a long time.
So how are vegetarian salads made? Recipes of such dishes can include any ingredients, of course, with the exception of meat. In this case, we need:
- Fresh medium-sized mushrooms - about 300 g;
- Potatoes small - 3 pcs . ;
- Sour cream of medium fat content from the store - 110 g;
- Bulb - 1 piece;
- Fresh greens - apply to taste;
- Fresh cucumber - 2 pcs . ;
- Lemon juice - two teaspoons;
- Table vinegar - about 60 ml;
- Spices are different - apply to taste;
- Oil without aroma sunflower - apply at your discretion.
Vegetarian New Year salads should differ from other dishes only in that they do not contain meat. Otherwise, these snacks should also be nourishing, tasty and nutritious.
So, to prepare this dish, you must boil the potato tubers in a uniform beforehand, and then cool them and clean them. After that, the vegetable together with fresh cucumbers must be cut into not very small slices.
As for medium-sized mushrooms, they should be washed and cut into strips. In the future, mushrooms are required to be fried in sunflower oil until light rustic crust.
If you want to receive vegetarian salads festive with a little sour, then it is recommended to add a pickled onion. To do this, the vegetable is cleaned and cut into thin rings. Further it is poured with table vinegar and kept in it for half an hour. In the end, the products are strongly wrung out and, if necessary, rinsed.
Vegetarian salads for the New Year are formed easily and simply. To do this, take a large bowl and put into it boiled potato tubers, fresh cucumbers, fried champignons and pickled onion. Further all the ingredients should be flavored with a sauce made from fresh sour cream, chopped greens, lemon juice and sunflower oil (a couple of spoons). After mixing the salad, it needs to be put in a deep plate and immediately presented to the festive table.
Vegetarian salads for the New Year are well done with fresh greenery and vegetables. Such appetizers will decorate the festive table, making it more vivid. For this we need:
- Olive oil without fragrance - 500 ml;
- Fresh basil - medium bunch;
- Cheese "Adyghe" - about 200 g;
- Tomatoes ripe fleshy - 600 g;
- Iodized salt - a couple of pinch;
- Lemon small - 1 fruit;
- Cloves of garlic - 3 pcs . ;
- Black pepper ground - a pinch;
- The mustard in the grains is a dessert spoon.
Vegetarian salads can be seasoned with different sauces. We decided to use olive. For its preparation, squeeze a small lemon into a bowl, and then add crushed chives, ground pepper and mustard seeds to it. After mixing all the ingredients, they must be poured into a bottle of olive oil, tightly clogged and kept in the refrigerator for about half an hour. Before use, the sauce should be shaken vigorously.
Before starting to mix the salad, all the ingredients should be carefully processed. Ripe tomatoes should be washed, cut off the navels and chopped into medium cubes. In exactly the same way it is required to grind Adyghe cheese. As for the fresh basil, it must be rinsed and chopped large with a knife.
To form such an appetizer, take a large bowl and put into it fresh tomatoes, soft cheese and basil. Having flavored the ingredients with a cooled sauce of olive oil, they must be mixed thoroughly. If necessary, the products can be salted to taste.
How to properly bring a vegetarian salad to the table?
The formed salad from tomatoes and cheese turns out not only very tasty and useful, but also surprisingly beautiful. This snack will serve as an excellent decoration for the New Year's table.
After the dish is ready and seasoned, it must be put in a deep salad bowl and served to invited guests.
As you can see, practically all vegetarian salads include a minimum of inexpensive and simple products. Thanks to this, these snacks are made quickly and easily, but are surprisingly easy and useful. By the way, they can be presented not only to the New Year's, but also to the everyday table. | english |
A piece of good news is on the charts for the passengers travelling from Ranchi to Chopan. As per reports, the Ranchi-Chopan Express will now run six days a week. Train No. 18631/18632 Ranchi-Chopan Express will run for 3 days via Lohardaga and 3 days via Barkakana.
Train number 18631 will leave Ranchi for Chopan on Wednesday, Friday, and Sunday. Meanwhile, train number 18632 will depart from Chopan for Ranchi on Monday, Thursday, and Saturday. Apart from that, the Ranchi Railway Division has decided to resume the operation of train number 18613/18614 running via Barkakana.
Train number 18613 will run from Ranchi on Monday, Thursday, and Saturday, while train number 18614 will run from Chopan on Wednesday, Friday, and Sunday.
For the uninitiated, the services of the Ranchi Chopan train running via Barkakana were stopped during the Covid-19 lockdown period. At that time, the train used to run only 3 days a week. Now, as the situation has come back to normal, the train operations are being normalized gradually.
The date of operation of Train No. 18612 Banaras-Ranchi Express has been changed. Now this train will run from August 21, instead of August 23.
Train No. 18612 BANARAS RANCHI EXPRESS will leave from Banaras at 3:00 PM every Tuesday, Wednesday, Friday, Saturday & Sunday and will reach Ranchi at 4:15 AM the next day. Passengers have welcomed the announcement of the Railway Board. | english |
<filename>src/nn_v2.rs
#![allow(dead_code)]
use nalgebra as na;
use serde::{Deserialize, Serialize};
use std::sync::{Arc, RwLock};
#[derive(Clone)]
pub struct Dual<T> {
pub val: T,
pub grad: T,
}
type MatrixXf = na::DMatrix<f32>;
type VectorXf = na::DVector<f32>;
// pub trait Activation: Send + Sync {
// fn new() -> Self
// where
// Self: Sized;
// fn forward(&self, x: &MatrixXf) -> MatrixXf;
// fn backward(&self, x: &MatrixXf, out: Dual<&MatrixXf>) -> MatrixXf;
// }
struct Relu {}
impl Relu {
fn forward(x: &mut MatrixXf) {
// x.map(|v| v.max(0.0))
x.iter_mut().for_each(|x| *x = x.max(0.0))
}
fn backward(x: &MatrixXf, out: Dual<&MatrixXf>) -> MatrixXf {
MatrixXf::from_fn(x.nrows(), x.ncols(), |r, c| {
if x[(r, c)] > 0.0 {
out.grad[(r, c)]
} else {
0.0
}
})
}
}
struct Sigmoid {}
impl Sigmoid {
fn forward(x: &mut MatrixXf) {
x.iter_mut().for_each(|x| *x = 1.0 / (1.0 + (-*x).exp()))
}
fn backward(x: &MatrixXf, out: Dual<&MatrixXf>) -> MatrixXf {
MatrixXf::from_fn(x.nrows(), x.ncols(), |r, c| {
let s = out.val[(r, c)];
s * (1.0 - s) * out.grad[(r, c)]
})
}
}
// struct Exp {}
// impl Exp {
// fn forward(x: &MatrixXf) -> MatrixXf {
// x.map(|v| v.exp())
// }
// fn backward(x: &MatrixXf, out: Dual<&MatrixXf>) -> MatrixXf {
// MatrixXf::from_fn(x.nrows(), x.ncols(), |r, c| {
// let s = out.val[(r, c)];
// s * out.grad[(r, c)]
// })
// }
// }
// struct Sin {}
// impl Sin {
// fn forward(x: &MatrixXf) -> MatrixXf {
// x.map(|v| v.sin())
// }
// fn backward(x: &MatrixXf, out: Dual<&MatrixXf>) -> MatrixXf {
// MatrixXf::from_fn(x.nrows(), x.ncols(), |r, c| {
// let s = x[(r, c)];
// s.cos() * out.grad[(r, c)]
// })
// }
// }
#[derive(Clone, Copy, Serialize, Deserialize)]
pub enum Activation {
Relu,
Sigmoid,
// Exp,
// Sin,
}
impl Activation {
pub fn forward(&self, x: &mut MatrixXf) {
match self {
Self::Relu => Relu::forward(x),
Self::Sigmoid => Sigmoid::forward(x),
// Self::Exp => Exp::forward(x),
// Self::Sin => Sin::forward(x),
}
}
pub fn backward(&self, x: &MatrixXf, out: Dual<&MatrixXf>) -> MatrixXf {
match self {
Self::Relu => Relu::backward(x, out),
Self::Sigmoid => Sigmoid::backward(x, out),
// Self::Exp => Exp::backward(x, out),
// Self::Sin => Exp::backward(x, out),
}
}
}
pub struct Layer {
pub inputs: usize,
pub outputs: usize,
pub activation: Option<Activation>,
pub bias: bool,
}
impl Layer {
pub fn new(act: Option<Activation>, inputs: usize, outputs: usize, bias: bool) -> Self {
Layer {
inputs,
outputs,
activation: act,
bias,
}
}
}
pub trait Optimizer: Clone {
fn create(&self, n: usize) -> Box<dyn OptimizerImpl>;
}
pub trait OptimizerImpl: Send + Sync {
fn step(&mut self, val: &mut [f32], grad: &[f32]);
}
#[derive(Copy, Clone)]
pub struct SGDParams {
pub learning_rate: f32,
}
impl Default for SGDParams {
fn default() -> Self {
Self {
learning_rate: 0.003,
}
}
}
#[derive(Clone)]
pub struct SGD {
params: Arc<RwLock<SGDParams>>,
}
impl SGD {
pub fn new(params: SGDParams) -> Self {
Self {
params: Arc::new(RwLock::new(params)),
}
}
}
struct SGDImpl {
params: Arc<RwLock<SGDParams>>,
}
impl Optimizer for SGD {
fn create(&self, _n: usize) -> Box<dyn OptimizerImpl> {
Box::new(SGDImpl {
params: self.params.clone(),
})
}
}
impl OptimizerImpl for SGDImpl {
fn step(&mut self, val: &mut [f32], grad: &[f32]) {
let lr = self.params.read().unwrap().learning_rate;
assert!(val.len() == grad.len());
for i in 0..val.len() {
val[i] -= lr * grad[i].min(1000.0).max(-1000.0);
}
}
}
#[derive(Clone, Copy)]
pub struct AdamParams {
pub learning_rate: f32,
pub beta1: f32,
pub beta2: f32,
}
impl Default for AdamParams {
fn default() -> Self {
Self {
learning_rate: 0.001,
beta1: 0.9,
beta2: 0.999,
}
}
}
#[derive(Clone)]
pub struct Adam {
params: Arc<RwLock<AdamParams>>,
}
impl Adam {
pub fn new(params: AdamParams) -> Self {
Self {
params: Arc::new(RwLock::new(params)),
}
}
}
impl Optimizer for Adam {
fn create(&self, n: usize) -> Box<dyn OptimizerImpl> {
Box::new(AdamImpl {
params: self.params.clone(),
m: vec![0.0; n],
v: vec![0.0; n],
t: 0,
})
}
}
struct AdamImpl {
params: Arc<RwLock<AdamParams>>,
m: Vec<f32>,
v: Vec<f32>,
t: i32,
}
impl OptimizerImpl for AdamImpl {
fn step(&mut self, val: &mut [f32], grad: &[f32]) {
let params = self.params.read().unwrap();
let lr = params.learning_rate;
let beta1 = params.beta1;
let beta2 = params.beta2;
self.t += 1;
for i in 0..val.len() {
let grad = grad[i].min(1000.0).max(-1000.0);
self.m[i] = beta1 * self.m[i] + (1.0 - beta1) * grad;
self.v[i] = beta2 * self.v[i] + (1.0 - beta2) * grad * grad;
}
let b1 = beta1.powi(self.t);
let b2 = beta2.powi(self.t);
for i in 0..val.len() {
let m_tilde = self.m[i] / (1.0 - b1);
let v_tilde = self.v[i] / (1.0 - b2);
val[i] -= lr * (m_tilde / (v_tilde.sqrt() + 1e-8f32)) as f32;
}
}
}
#[derive(Clone, Serialize, Deserialize)]
struct LayerData {
weights: MatrixXf,
bias: VectorXf,
activation: Option<Activation>,
use_bias: bool,
}
struct LayerOptimizer {
weights: Box<dyn OptimizerImpl>,
bias: Box<dyn OptimizerImpl>,
}
use rand::distributions::Distribution;
use statrs::distribution::Normal;
struct LayerOutput {
linear_out: MatrixXf,
out: MatrixXf,
}
impl LayerData {
fn num_inputs(&self) -> usize {
self.weights.ncols()
}
fn num_outputs(&self) -> usize {
self.weights.nrows()
}
fn new(inputs: usize, outputs: usize, activation: Option<Activation>, use_bias: bool) -> Self {
let mut rng = rand::thread_rng();
let n = Normal::new(0.0, (2.0 / (inputs + outputs) as f64).sqrt()).unwrap();
let weights = MatrixXf::from_fn(outputs, inputs, |_r, _c| n.sample(&mut rng) as f32);
let bias = if use_bias {
VectorXf::from_fn(outputs, |_r, _c| 0.0f32)
} else {
VectorXf::zeros(0)
};
Self {
weights,
bias,
activation,
use_bias,
}
}
}
#[derive(Clone, Serialize, Deserialize)]
pub struct MLPData {
layers: Vec<LayerData>,
}
pub struct MLP {
layers: Vec<LayerData>,
opts: Vec<LayerOptimizer>,
}
pub enum Loss {
L2,
RelativeL2,
}
impl MLP {
pub fn from_data_opt<O: Optimizer>(data: MLPData, opt: O) -> Self {
let layers = data.layers;
let mut opts = vec![];
for l in &layers {
opts.push(LayerOptimizer {
weights: opt.create(l.num_inputs() * l.num_outputs()),
bias: opt.create(l.num_outputs()),
})
}
Self { layers, opts }
}
pub fn from_data(data: MLPData) -> Self {
Self {
layers: data.layers,
opts: vec![],
}
}
pub fn data(self) -> MLPData {
MLPData {
layers: self.layers,
}
}
pub fn new<O: Optimizer>(desc: Vec<Layer>, opt: O) -> Self {
let mut layers = vec![];
let mut opts = vec![];
for d in desc {
layers.push(LayerData::new(d.inputs, d.outputs, d.activation, d.bias));
opts.push(LayerOptimizer {
weights: opt.create(d.inputs * d.outputs),
bias: opt.create(d.outputs),
})
}
Self { layers, opts }
}
fn forward(&self, mut x: MatrixXf, tmp: &mut Vec<LayerOutput>, training: bool) -> MatrixXf {
for layer in &self.layers {
x = &layer.weights * x;
if layer.use_bias {
// x = MatrixXf::from_fn(x.nrows(), x.ncols(), |r, c| x[(r, c)] + layer.bias[r]);
for c in 0..x.ncols() {
for r in 0..x.nrows() {
x[(r, c)] += layer.bias[r];
}
}
}
let linear_out = if training { Some(x.clone()) } else { None };
if let Some(f) = &layer.activation {
// x = f.forward(&x);
f.forward(&mut x);
}
if training {
tmp.push(LayerOutput {
linear_out: linear_out.unwrap(),
out: x.clone(),
})
}
}
x
}
pub fn infer(&self, x: MatrixXf) -> MatrixXf {
let mut tmp = vec![];
self.forward(x, &mut tmp, false)
}
pub fn train(&mut self, x: MatrixXf, target: &MatrixXf, loss_fn: Loss) -> f32 {
assert!(
!self.opts.is_empty(),
"model is not configured for training!"
);
let mut tmp = vec![];
let y = self.forward(x.clone(), &mut tmp, true);
let (loss, dy) = match loss_fn {
Loss::L2 => {
let loss = (&y - target).map(|v| v * v).mean();
let dy = 0.5 * (&y - target) / (y.ncols() * y.nrows()) as f32;
(loss, dy)
}
Loss::RelativeL2 => {
let loss = y
.iter()
.zip(target.iter())
.map(|(y, target)| -> f32 { (*y - *target).powi(2) / (*y * *y + 0.01) })
.sum::<f32>()
/ (y.ncols() * y.nrows()) as f32;
let dy = na::DMatrix::from_fn(y.nrows(), y.ncols(), |r, c| -> f32 {
0.5 * (y[(r, c)] - target[(r, c)]) / (y[(r, c)] * y[(r, c)] + 0.01)
}) / (y.ncols() * y.nrows()) as f32;
// let dy = 0.5 * (&y - target).component_div(y.component_muml(y)) / (y.ncols() * y.nrows()) as f32;
(loss, dy)
}
};
let mut dout = dy;
for i in (0..self.layers.len()).rev() {
let layer = &self.layers[i];
let use_bias = layer.use_bias;
let out = &tmp[i].out;
let linear_out = &tmp[i].linear_out;
if let Some(f) = &layer.activation {
let gradf = f.backward(
linear_out,
Dual {
val: out,
grad: &dout,
},
);
// out = linear_out;
dout = gradf;
}
let input = if i == 0 { &x } else { &tmp[i - 1].out };
let (dw, dbias, dx) = {
let dbias = dout.column_sum();
let dw = &dout * input.transpose();
let dx = &layer.weights.transpose() * &dout;
(dw, dbias, dx)
};
let opt = &mut self.opts[i];
opt.weights
.as_mut()
.step(self.layers[i].weights.as_mut_slice(), dw.as_slice());
if use_bias {
opt.bias
.as_mut()
.step(self.layers[i].bias.as_mut_slice(), dbias.as_slice());
}
dout = dx;
}
loss
}
}
#[macro_export]
macro_rules! position_encoding_func_v2 {
// N: #inputs need mapping
// E: #encoders
// R: #inputs don't need mapping
// input is [N; R]
($name:ident, $N:expr, $E:expr, $M:expr, $R: expr) => {
fn $name(v: &na::DMatrix<f32>) -> na::DMatrix<f32> {
assert!(v.nrows() == $N + $R);
let mut u: na::DMatrix<f32> = na::DMatrix::zeros($N * $E * 2 + $N + $R, v.ncols());
for c in 0..v.ncols() {
for i in 0..$N {
for j in 0..$E {
let feq = 2.0f32.powf($M as f32 * (j as f32) / ($E - 1) as f32);
u[(i * $E + j, c)] = (v[(i, c)] * feq).sin();
u[(i * $E + j + $N * $E, c)] = (v[(i, c)] * feq).cos();
}
u[($N * $E * 2 + i, c)] = v[(i, c)];
}
for i in 0..$R {
u[($N * $E * 2 + $N + i, c)] = v[($N + i, c)];
}
}
u
}
};
}
#[macro_export]
macro_rules! position_encoding_func_v3 {
($name:ident, $N:expr, $E:expr, $F:expr) => {
fn $name(v: &na::DMatrix<f32>) -> na::DMatrix<f32> {
assert!(v.nrows() == $N);
let mut u: na::DMatrix<f32> = na::DMatrix::zeros($N * $E * 2 + $N, v.ncols());
for c in 0..v.ncols() {
for i in 0..$N {
for j in 0..$E {
let feq = 2.0f32.powf((j as f32 / $E as f32) * $F);
u[(i * $E + j, c)] = (v[(i, c)] * feq).sin();
u[(i * $E + j + $N * $E, c)] = (v[(i, c)] * feq).cos();
}
u[($N * $E * 2 + i, c)] = v[(i, c)];
}
}
u
}
};
}
| rust |
Celebrities debut in Cannes 2023. Cannes 2023 is renowned for celebrities from across the world making fashion statements. This year, many celebrities are making their debut at Cannes. 2017 Miss World Manushi Chillar is making her debut at Cannes. Manushi Chillar will walk as part of the Indian delegation at the Cannes Film Festival 2023. She is romancing Varun Tej in his next under the direction of Shakti Pratap Singh.
Popular singer Kumar Sanu's daughter Shanon K will make her Cannes debut. Esha Gupta will make her Cannes debut as part of the Indian contingent led by Minister of State for Information and Broadcasting L Murugan.
Anushka Sharma will also be making her debut at the Cannes Festival. Anushka is the brand ambassador for L'Oréal Paris. She will be presenting an award to honor women in cinema alongside Hollywood actress Kate Winslet.
The 76th Festival de Cannes will begin on Tuesday, May 16, and end on May 27. The red carpet will roll out next week with the premiere of Johnny Depp's comeback film 'Jeanne du Barry', in which he is essaying the role of King Louis XV of France. | english |
<filename>api-ref/source/v3/samples/group-replication-failover.json
{
"failover_replication": {
"allow_attached_volume": true,
"secondary_backend_id": "vendor-id-1"
}
}
| json |
"""
Dash app
"""
import dash_bootstrap_components as dbc
import dash_core_components as dcc
from dash.dependencies import Input, Output
import utilities as u
import constants as c
import layout as lay
from plots import plots_comparison as plots
class Page(lay.AppPage):
""" Page Comparison """
link = c.dash.LINK_COMPARISON
radio_opt = lay.get_options([c.names.INCOMES, c.names.EXPENSES, c.names.EBIT])
def __init__(self, app):
super().__init__([c.dash.INPUT_CATEGORIES, c.dash.INPUT_SMOOTHING])
@app.callback(
[Output(f"plot_comp_{x}", "figure") for x in list("12")],
[
Input("global_df", "children"),
Input("input_categories", "value"),
Input("input_smoothing", "value"),
Input("radio_comp_1", "value"),
Input("radio_comp_2", "value"),
Input("comp_aux", "children"),
],
)
# pylint: disable=unused-variable,unused-argument
def update_ts_grad_1(df_in, categories, avg_month, type_trans_1, type_trans_2, aux):
"""
Updates the timeserie gradient plot
Args:
df_in: transactions dataframe
categories: categories to use
avg_month: month to use in rolling average
type_trans_1: expenses/incomes/ebit plot 1
type_trans_2: expenses/incomes/ebit plot 2
"""
df = u.uos.b64_to_df(df_in)
df = u.dfs.filter_data(df, categories)
return (
plots.ts_gradient(df, type_trans_1, avg_month),
plots.ts_gradient(df, type_trans_2, avg_month),
)
def get_body(self):
return [
lay.card(
[
dcc.Graph(id="plot_comp_1", config=c.dash.PLOT_CONFIG),
dbc.RadioItems(
id="radio_comp_1",
options=self.radio_opt,
value=c.names.INCOMES,
inline=True,
),
]
),
lay.card(
[
dcc.Graph(id="plot_comp_2", config=c.dash.PLOT_CONFIG),
dbc.RadioItems(
id="radio_comp_2",
options=self.radio_opt,
value=c.names.EXPENSES,
inline=True,
),
]
),
lay.get_dummy_div("comp_aux"),
]
| python |
( function() {
'use strict';
describe( 'vui.changeTracking', function() {
var node;
beforeEach( function () {
jasmine.addMatchers( vui.jasmine.dom.matchers );
node = document.body.appendChild( document.createElement( 'div' ) );
} );
afterEach( function() {
document.body.removeChild( node );
} );
describe( 'style', function() {
it( 'defines a "vui-changed" selector', function() {
expect( document ).toHaveCssSelector( '.vui-changed' );
} );
} );
describe( 'create', function() {
var $input;
beforeEach( function () {
$input = $( "<input class='vui-input' type='checkbox'>" ).appendTo( node );
} );
it( 'binds the input elements using widget method', function() {
$input.vui_changeTracking();
expect( $input.data( 'vui-vui_changeTracking' ) ).toBeDefined();
} );
} );
describe( 'destroy', function() {
var $input;
beforeEach( function () {
$input = $( "<input class='vui-input' type='checkbox'>" )
.appendTo( node )
.vui_changeTracking();
} );
it( 'unbinds input from widget when destroy is called', function() {
$input.vui_changeTracking( 'destroy' );
expect( $input.data( 'vui-vui_changeTracking' ) ).not.toBeDefined();
} );
it( 'triggers vui-restore if has changed', function( done ) {
$input.click();
$input.on( 'vui-restore', function( sender ) {
done();
} );
$input.vui_changeTracking( 'destroy' );
} );
it( 'does not trigger vui-restore if value has not changed', function( done ) {
var hasTriggered = false;
$input.on( 'vui-restore', function( sender ) {
hasTriggered = true;
} );
setTimeout( function() {
expect( hasTriggered ).toBeFalsy();
done();
}, 0 );
$input.vui_changeTracking( 'destroy' );
} );
} );
describe( 'checkbox', function() {
var $input;
beforeEach( function () {
$input = $( "<input class='vui-input' type='checkbox'>" )
.appendTo( node )
.vui_changeTracking();
} );
it( 'hasChanged returns false when value has not changed', function() {
expect( $input.vui_changeTracking( 'hasChanged' ) ).toBeFalsy();
} );
it( 'hasChanged returns true when value has changed', function() {
$input.click();
expect( $input.vui_changeTracking( 'hasChanged' ) ).toBeTruthy();
} );
it( 'hasChanged returns false when value has changed and then changed back', function() {
$input.click();
$input.click();
expect( $input.vui_changeTracking( 'hasChanged' ) ).toBeFalsy();
} );
} );
describe( 'radio button', function() {
var $input1, $input2, $input3;
beforeEach( function () {
$input1 = $( "<input class='vui-input' type='radio' name='test_radio' value='apples' checked='checked'>" ).appendTo( node )
.vui_changeTracking();
$input2 = $( "<input class='vui-input' type='radio' name='test_radio' value='bananas'>" ).appendTo( node )
.vui_changeTracking();
$input3 = $( "<input class='vui-input' type='radio' name='test_radio' value='coconuts'>" ).appendTo( node )
.vui_changeTracking();
} );
it( 'hasChanged returns false when value has not changed', function() {
expect( $input1.vui_changeTracking( 'hasChanged' ) ).toBeFalsy();
expect( $input2.vui_changeTracking( 'hasChanged' ) ).toBeFalsy();
expect( $input3.vui_changeTracking( 'hasChanged' ) ).toBeFalsy();
} );
it( 'hasChanged returns false when value has changed and then changed back', function() {
$input2.click();
$input1.click();
expect( $input1.vui_changeTracking( 'hasChanged' ) ).toBeFalsy();
expect( $input2.vui_changeTracking( 'hasChanged' ) ).toBeFalsy();
} );
it( 'hasChanged returns true when value has changed', function() {
$input2.click();
expect( $input1.vui_changeTracking( 'hasChanged' ) ).toBeTruthy();
expect( $input2.vui_changeTracking( 'hasChanged' ) ).toBeTruthy();
} );
} );
describe( 'text', function() {
var $input;
beforeEach( function () {
$input = $( "<input class='vui-input' type='text'>" )
.appendTo( node )
.vui_changeTracking();
} );
it( 'hasChanged returns false when value has not changed', function() {
expect( $input.vui_changeTracking( 'hasChanged' ) ).toBeFalsy();
} );
it( 'hasChanged returns true when value has changed', function() {
$input.attr( 'value', 'abc' )
.trigger( 'change' );
expect( $input.vui_changeTracking( 'hasChanged' ) ).toBeTruthy();
} );
it( 'hasChanged returns false when value has changed and then changed back', function() {
$input.attr( 'value', 'abc' )
.trigger( 'change' );
expect( $input.vui_changeTracking( 'hasChanged' ) ).toBeTruthy();
$input.attr( 'value', '' )
.trigger( 'change' );
expect( $input.vui_changeTracking( 'hasChanged' ) ).toBeFalsy();
} );
} );
describe( 'textarea', function() {
var $input;
beforeEach( function () {
$input = $( "<textarea class='vui-input'></textarea>" )
.appendTo( node )
.vui_changeTracking();
} );
it( 'hasChanged returns false when value has not changed', function() {
expect( $input.vui_changeTracking( 'hasChanged' ) ).toBeFalsy();
} );
it( 'hasChanged returns true when value has changed', function() {
$input.val( 'abc' )
.trigger( 'change' );
expect( $input.vui_changeTracking( 'hasChanged' ) ).toBeTruthy();
} );
it( 'hasChanged returns false when value has changed and then changed back', function() {
$input.val( 'abc' )
.trigger( 'change' );
expect( $input.vui_changeTracking( 'hasChanged' ) ).toBeTruthy();
$input.val( '' )
.trigger( 'change' );
expect( $input.vui_changeTracking( 'hasChanged' ) ).toBeFalsy();
} );
} );
describe( 'select', function() {
var $input;
beforeEach( function () {
$input = $( "<select class='vui-input'><option>option 1</option><option>option 2</option><option>option 3</option></select>" )
.appendTo( node )
.vui_changeTracking();
} );
it( 'hasChanged returns false when value has not changed', function() {
expect( $input.vui_changeTracking( 'hasChanged' ) ).toBeFalsy();
} );
it( 'hasChanged returns true when value has changed', function() {
$input.val( 'option 2' )
.trigger( 'change' );
expect( $input.vui_changeTracking( 'hasChanged' ) ).toBeTruthy();
} );
it( 'hasChanged returns false when value has changed and then changed back', function() {
$input.val( 'option 2' )
.trigger( 'change' );
expect( $input.vui_changeTracking( 'hasChanged' ) ).toBeTruthy();
$input.val( 'option 1' )
.trigger( 'change' );
expect( $input.vui_changeTracking( 'hasChanged' ) ).toBeFalsy();
} );
} );
describe( 'reset', function() {
var $input, node2;
beforeEach( function () {
node2 = document.body.appendChild( document.createElement( 'div' ) );
$input = $( "<input class='vui-input' type='checkbox'>" )
.appendTo( node )
.vui_changeTracking();
} );
afterEach( function() {
document.body.removeChild( node2 );
} );
it( 'hasChanged returns false after reset event is triggered', function() {
$input.click();
expect( $input.vui_changeTracking( 'hasChanged' ) ).toBeTruthy();
$( document ).trigger( 'vui-reset' );
expect( $input.vui_changeTracking( 'hasChanged' ) ).toBeFalsy();
} );
it( 'hasChanged returns false after reset event is triggered on input element', function() {
$input.click();
expect( $input.vui_changeTracking( 'hasChanged' ) ).toBeTruthy();
$input.trigger( 'vui-reset' );
expect( $input.vui_changeTracking( 'hasChanged' ) ).toBeFalsy();
} );
it( 'hasChanged returns true after reset event is triggered on a non-ancestor', function() {
$input.click();
expect( $input.vui_changeTracking( 'hasChanged' ) ).toBeTruthy();
$( node2 ).trigger( 'vui-reset' );
expect( $input.vui_changeTracking( 'hasChanged' ) ).toBeTruthy();
} );
} );
describe( 'change/restore event', function() {
var $input;
beforeEach( function () {
$input = $( "<input class='vui-input' type='checkbox'>" )
.appendTo( node )
.vui_changeTracking();
} );
it( 'hasChanged returns false when value has not changed', function() {
expect( $input.vui_changeTracking( 'hasChanged' ) ).toBeFalsy();
} );
it( 'triggers vui-change when value is changed', function( done ) {
$input.on( 'vui-change', function( sender ) {
done();
} );
$input.click();
} );
it( 'triggers vui-restore when value is changed back to original value', function( done ) {
$input.on( 'vui-restore', function( sender ) {
done();
} );
$input.click();
$input.click();
} );
} );
} );
} )();
| javascript |
<reponame>se-panfilov/outstanding_test
'use strict';
angular.module('outstanding.calendar', [])
.constant('DAY_EVENT_FIELDS', {
CONTRACT: 'contract',
AMOUNT: 'amount',
DATE: 'date',
TIME: 'time'
})
.constant('DAYS_OF_WEEK', [
'Mon',
'Tue',
'Wed',
'Thu',
'Fri',
'Sat',
'Sun'
])
.constant('MONTH_NAMES', [
'January',
'February',
'March',
'April',
'May',
'June',
'July',
'August',
'September',
'October',
'November',
'December'
])
.factory('CalendarFactory', function (DataFactory, DAY_EVENT_FIELDS, MONTH_NAMES) {
function _getDaysInMonth(month, year) {
var date = new Date(year, month + 1, 0);
if (!exports.isUTC) {
return date.getDate();
} else {
return date.getUTCDate();
}
}
function _getDays(monthNum, yearNum) {
var result = {};
var from = 1;
var to = _getDaysInMonth(monthNum, yearNum);
for (var i = from; i <= to; i++) {
result[i] = {};
}
return result;
}
function _getMonthNumber(datetime, isUserView) {
var date = new Date(datetime);
var result;
if (!exports.isUTC) {
result = date.getMonth();
} else {
result = date.getUTCMonth();
}
result += (isUserView) ? 1 : 0;
return result;
}
function _getDayNumber(datetime) {
var date = new Date(datetime);
if (!exports.isUTC) {
return date.getDate();
} else {
return date.getUTCDate();
}
}
function _getYearNumber(datetime) {
var date = new Date(datetime);
if (!exports.isUTC) {
return date.getFullYear();
} else {
return date.getUTCFullYear();
}
}
function _getMonthList(dateTimesList, yearNum) {
var result = {};
for (var i = 0; i < dateTimesList.length; i++) {
var datetime = dateTimesList[i];
if (yearNum === _getYearNumber(datetime)) {
var monthNum = _getMonthNumber(datetime, true);
if (!result[monthNum]) {
result[monthNum] = _getDays(monthNum - 1, yearNum);
}
}
}
return result;
}
var DATE_REGEXP = new RegExp(/\d+/g);
function parseDateStr(data, cb) {
var datesCol = DataFactory.getDateCol(data, true);
for (var i = 0; i < datesCol.length; i++) {
var dateString = datesCol[i];
var parsed = dateString.match(DATE_REGEXP);
var date = new Date(parsed[2], parsed[1] - 1, parsed[0]);
if (cb) cb(date.getTime(), parsed);
}
}
var exports = {
dates: [],
years: [],
isUTC: false,
setUTC: function (isUTC) {
exports.isUTC = isUTC || false;
},
setDates: function (data) {
exports.dates = [];
parseDateStr(data, function (date) {
exports.dates.push(date);
});
},
makeYearsList: function () {
var years = {};
for (var i = 0; i < exports.dates.length; i++) {
var datetime = exports.dates[i];
var yearNum = _getYearNumber(datetime);
if (!years[yearNum]) { //TODO (S.Panfilov) what if year exist?
years[yearNum] = _getMonthList(exports.dates, yearNum);
}
}
exports.years = years;
},
insertDataToDates: function (data) {
var start = 1; //beacuse 0 - is a title row
for (var i = start; i < data.length; i++) {
var row = data[i];
var event = {};
var dateString = DataFactory.getDateVal(row);
var parsed = dateString.match(DATE_REGEXP);
var date = new Date(parsed[2], parsed[1] - 1, parsed[0]);
var datetime = date.getTime();
var yearNum = '' + _getYearNumber(datetime);
var monthNum = ('0' + _getMonthNumber(datetime, true)).slice(-2);
var dayNum = ('0' + _getDayNumber(datetime)).slice(-2);
exports.years[+yearNum][+monthNum][+dayNum].events = exports.years[+yearNum][+monthNum][+dayNum].events || [];
event[DAY_EVENT_FIELDS.CONTRACT] = DataFactory.getContractVal(row);
event[DAY_EVENT_FIELDS.TIME] = DataFactory.getTimeVal(row);
event[DAY_EVENT_FIELDS.AMOUNT] = DataFactory.getAmountVal(row);
exports.years[+yearNum][+monthNum][+dayNum].events.push(event);
}
},
getTotalForDay: function (eventsList, fieldName) {
if (!eventsList) return;
var result = 0;
for (var i = 0; i < eventsList.length; i++) {
var event = eventsList[i];
result += event[fieldName];
}
return result;
},
getMonthName: function (num) {
return MONTH_NAMES[num - 1];
},
getDayOfWeek: function (monthNum, yearNum) {
var result;
var date = new Date(+yearNum, +monthNum -1, 1);
if (!exports.isUTC) {
result = date.getDay();
} else {
result = date.getUTCDay();
}
var days = [6,0,1,2,3,4,5];//this is a hack to makes week start from Mon (btw can be refactored)
return days[result];
}
};
return exports;
})
.directive('calendar', function (CalendarFactory, DAY_EVENT_FIELDS, DAYS_OF_WEEK) {
return {
restrict: 'E',
replace: true,
templateUrl: 'calendar/calendar.html',
scope: {
source: '=',
selected: '=',
isUtc: '='
},
link: function (scope) {
scope.setSelectedDate = function (day, month, year) {
scope.selected = {
day: day,
month: month,
year: year,
data: CalendarFactory.years[year][month][day]
};
};
scope.$watch('source', function (value, oldValue) {
if (!value || value === oldValue) return;
initFactory(value);
}
);
function initFactory(sourceData) {
CalendarFactory.setUTC(scope.isUtc);
CalendarFactory.setDates(sourceData);
CalendarFactory.makeYearsList();
CalendarFactory.insertDataToDates(sourceData);
}
(function _init() {
scope.CalendarFactory = CalendarFactory;
scope.DAY_EVENT_FIELDS = DAY_EVENT_FIELDS;
scope.DAYS_OF_WEEK = DAYS_OF_WEEK;
})();
}
};
})
;
| javascript |
package edu.ucsd.library.xdre.ingest.assembler;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import org.apache.commons.io.FilenameUtils;
import org.apache.log4j.Logger;
/**
* UploadTaskIterator return a UploadTask for SRB loading each time when call for hasNext() and next()
* There are three types of Upload tasks: simple loading with one ark for one file, complex object loading
* and pair images loading. File filters may be applied for file prefix and post-fix
*
* @author <NAME>
*/
public class UploadTaskOrganizer{
public static final int SIMPLE_LOADING = 0;
public static final int COMPLEXOBJECT_LOADING = 1;
public static final int MIX_LOADING = 2;
public static final int PAIR_LOADING = 3;
public static final int SHARE_ARK_LOADING = 4;
public static final int MIX_CO_SHARE_ARK_LOADING = 5;
public static enum PreferedOrder {PDFANDPDF, PDFANDXML, SUFFIX};
private static Logger log = Logger.getLogger(UploadTaskOrganizer.class);
private int versionNo = 1;
private int currIndex = 0;
//private String collectionId = null;
private List<List> uploadList = null;
private int uploadType = SIMPLE_LOADING;
private String filePrefix = null;
private String fileFilter = null;
private String coDelimiter = null;
private String singleKey = "singleList";
private String message = "";
private String[] fileOrderSuffixes = null;
private int taskSize = 0;
private PreferedOrder preferedOrder = null;
public UploadTaskOrganizer(List<String> fileList, int uploadType){
this(fileList, uploadType, null);
}
public UploadTaskOrganizer(List<String> fileList, int uploadType, String fileFilter){
this(fileList, uploadType, fileFilter, null);
}
public UploadTaskOrganizer(List<String> fileList, int uploadType, String fileFilter, String[] fileOrderSuffixes){
this(fileList, uploadType, fileFilter, fileOrderSuffixes, null);
}
public UploadTaskOrganizer(List<String> fileList, int uploadType, String fileFilter, String[] fileOrderSuffixes, String coDelimiter){
this(fileList, uploadType, fileFilter, fileOrderSuffixes, coDelimiter, null);
}
public UploadTaskOrganizer(List<String> fileList, int uploadType, String fileFilter, String[] fileOrderSuffixes, String coDelimiter, PreferedOrder preferedOrder){
//this.collectionId = collectionId;
this.uploadType = uploadType;
this.fileFilter = fileFilter;
this.fileOrderSuffixes = fileOrderSuffixes;
this.coDelimiter = coDelimiter;
this.preferedOrder = preferedOrder;
uploadList = initUploadList(fileList, preferedOrder);
taskSize = uploadList.size();
}
/**
*
* @return List<List>, batches of files for uploading under diferent rules
*/
private List<List> initUploadList(List<String> fileList, PreferedOrder preferedOrder){
List<List> uploadList = new ArrayList<List>();
Map<String, Map> filesPoolMap = null;
Iterator it = null;
Iterator coIt = null;
for(int i=0; i<fileList.size(); i++){
String tmpFileName = fileList.get(i);
File tmpFile = new File(tmpFileName);
if(!tmpFile.exists()){
message += "File " + tmpFile.getAbsolutePath() + " doesn't exist.\n";
log.error(message);
System.out.println(message);
continue;
}
switch (uploadType){
case PAIR_LOADING:
Map<String, List> filesPool = new HashMap<String, List>();
appendPairFileToPool(filesPool, tmpFile);
it = filesPool.values().iterator();
while(it.hasNext()){
uploadList.add((List) it.next());
}
break;
case COMPLEXOBJECT_LOADING:
//Files in the same directory are consider to be complex objects
filesPoolMap = new HashMap<String, Map>();
appendComplexObjectToPool(filesPoolMap, tmpFile, (fileOrderSuffixes != null&&(preferedOrder==null || !preferedOrder.equals(PreferedOrder.SUFFIX))));
coIt = filesPoolMap.keySet().iterator();
while(coIt.hasNext()){
String path = (String) coIt.next();
Map tmpMap = filesPoolMap.get(path);
it = orderFiles(tmpMap, coDelimiter, preferedOrder);
List<Object> cos = new ArrayList<Object>();
uploadList.add(cos);
while(it.hasNext())
cos.add((Object) it.next());
}
break;
case MIX_LOADING:
//Mixing of single objects and complex object in the same directory with prefix+pxx+.tif
//to indentify the order and the complex objects
filesPoolMap = new HashMap<String, Map>();
appendMixComplexObjectToPool(filesPoolMap, tmpFile);
Map singleObjects = filesPoolMap.remove(singleKey);
if(singleObjects != null && singleObjects.size() > 0){
Iterator sIt = singleObjects.values().iterator();
while(sIt.hasNext()){
uploadList.add(getNewFileGroup((String) sIt.next()));
}
}
coIt = filesPoolMap.keySet().iterator();
while(coIt.hasNext()){
String path = (String) coIt.next();
Map tmpMap = filesPoolMap.get(path);
it = handleOrdering(tmpMap, coDelimiter);
List<String> cos = new ArrayList<String>();
uploadList.add(cos);
while(it.hasNext())
cos.add((String) it.next());
}
break;
case SHARE_ARK_LOADING:
//Mixing of single objects and objects with the same name and different extension
//which should share one ark in the same directory with filename.xxx
//to indentify the order and the derivatives
filesPoolMap = new HashMap<String, Map>();
appendShareArkObjectToPool(filesPoolMap, tmpFile);
coIt = filesPoolMap.keySet().iterator();
while(coIt.hasNext()){
List<String> sos = new ArrayList<String>();
String key = (String) coIt.next();
Map tmpMap = filesPoolMap.get(key);
Iterator fIt = tmpMap.values().iterator();
while(fIt.hasNext())
sos.add((String)fIt.next());
if(sos.size() > 0)
uploadList.add(sos);
}
break;
case MIX_CO_SHARE_ARK_LOADING:
//Mixing of single objects and objects with the same name and different extension
//which should share one ark in the same directory with filename.xxx
//to indentify the order and the complex objects and their derivatives
filesPoolMap = new HashMap<String, Map>();
appendShareArkObjectToPool(filesPoolMap, tmpFile);
coIt = filesPoolMap.keySet().iterator();
Map<String, Map<String, List<String>>> coFilesMap = new HashMap<String, Map<String, List<String>>>();
while(coIt.hasNext()){
List<String> sos = new ArrayList<String>();
String key = (String) coIt.next();
Map tmpMap = filesPoolMap.get(key);
Iterator fIt = tmpMap.values().iterator();
while(fIt.hasNext())
sos.add((String)fIt.next());
if(sos.size() > 0){
String coKey = key;
int udIndex = coKey.lastIndexOf(coDelimiter);
int delLength = coDelimiter.length();
if(udIndex>0 && coKey.length()>udIndex+delLength){
try{
//Test for possible complex objects
int order = Integer.parseInt(coKey.substring(udIndex + delLength));
coKey = key.substring(0, udIndex);
}catch(NumberFormatException e){}
}
Map<String, List<String>> componentFilesMap = coFilesMap.get(coKey);
if(componentFilesMap == null){
componentFilesMap = new HashMap<String, List<String>>();
coFilesMap.put(coKey, componentFilesMap);
}
componentFilesMap.put(key, sos);
}
}
//Handling complex object ordering
coIt = coFilesMap.keySet().iterator();
while(coIt.hasNext()){
String path = (String) coIt.next();
Map tmpMap = coFilesMap.get(path);
it = handleOrdering(tmpMap, coDelimiter);
List<List<String>> cos = new ArrayList<List<String>>();
uploadList.add(cos);
while(it.hasNext())
cos.add((List<String>) it.next());
}
break;
default:
appendFiles(uploadList, tmpFile);
break;
}
}
return uploadList;
}
public boolean hasNext() {
return currIndex < taskSize;
}
public UploadTask next() {
UploadTask uploadTask = null;
List taskList = uploadList.get(currIndex++);
switch (uploadType){
case PAIR_LOADING:
uploadTask = new PairUploadTask(taskList);
break;
case COMPLEXOBJECT_LOADING:
//taskList = uploadList.get(currIndex++);
if(taskList.size() > 1){
if(fileOrderSuffixes == null || (preferedOrder!=null && preferedOrder.equals(PreferedOrder.SUFFIX)))
uploadTask = new ComplexObjectUploadTask(taskList, fileOrderSuffixes);
else
uploadTask = new COShareArkUploadTask(taskList, fileOrderSuffixes);
}else if(taskList.size() == 1){
if(fileOrderSuffixes == null)
uploadTask = new SimpleUploadTask(taskList);
else
uploadTask = new ShareArkUploadTask((List<String>)taskList.get(0), fileOrderSuffixes);
}
break;
case MIX_LOADING:
//taskList = uploadList.get(currIndex++);
if(taskList.size() > 1)
uploadTask = new ComplexObjectUploadTask(taskList);
else
uploadTask = new SimpleUploadTask(taskList);
break;
case SHARE_ARK_LOADING:
//taskList = uploadList.get(currIndex++);
if(taskList.size() > 1)
uploadTask = new ShareArkUploadTask(taskList, fileOrderSuffixes);
else
uploadTask = new SimpleUploadTask(taskList);
//uploadTask.setFileOrderSuffixes(fileOrderSuffixes);
break;
case MIX_CO_SHARE_ARK_LOADING:
//taskList = uploadList.get(currIndex++);
if(taskList.size() > 1)
uploadTask = new COShareArkUploadTask(taskList, fileOrderSuffixes);
else if(taskList.size() == 1){
uploadTask = new ShareArkUploadTask((List<String>)taskList.get(0), fileOrderSuffixes);
}
break;
default:
uploadTask = new SimpleUploadTask(taskList);
}
uploadTask.setPreferOrder(preferedOrder);
return uploadTask;
}
private void appendFiles(List<List> uploadList, File file){
if(file.isDirectory()){
File[] fileList = file.listFiles();
for(int i=0; i<fileList.length; i++){
File tmpFile = fileList[i];
if(tmpFile.isDirectory()){
appendFiles(uploadList, tmpFile);
}else if(tmpFile.isFile() && !tmpFile.isHidden()){
addFileGroup(tmpFile, uploadList);
}
}
}else if(file.isFile() && !file.isHidden()){
addFileGroup(file, uploadList);
}
}
private void appendPairFileToPool(Map<String, List>filesPool, File tmpFile){
if(tmpFile.isDirectory()){
File[] tmpFiles = tmpFile.listFiles();
File tmp = null;
for(int i=0; i<tmpFiles.length; i++){
tmp = tmpFiles[i];
appendPairFileToPool(filesPool, tmp);
}
}else if(tmpFile.isFile() && !tmpFile.isHidden()){
addPairFileToPool(filesPool, tmpFile);
}
}
private void addPairFileToPool(Map<String, List> pairPool, File tmpFile){
String fName = tmpFile.getName();
//String tmpFileName = tmpFile.getAbsolutePath();
int idx = fName.lastIndexOf('.');
String pairId = fName.substring(0, idx>0?idx:fName.length());
List<String> pairList = null;
//int eIndex = pairId.endsWith("-edited");
if(pairId.endsWith("-edited")){
pairId = pairId.substring(0, pairId.indexOf("-edited"));
pairList = pairPool.get(pairId);
if(pairList == null){
addPairGroup(pairId, tmpFile, pairPool);
}else{
addFile(tmpFile, pairList);
}
}else{
//Master file
pairList = pairPool.get(pairId);
if(pairList == null){
addPairGroup(pairId, tmpFile, pairPool);
}else{
addFile(tmpFile, pairList);
}
}
}
private void appendComplexObjectToPool(Map<String, Map> filesPoolMap, File tmpFile, boolean withDerivative){
Map<String, Object> complexObjectMap = null;
if(tmpFile.isDirectory()){
File[] fileList = tmpFile.listFiles();
for(int i=0; i<fileList.length; i++){
File tmp = fileList[i];
appendComplexObjectToPool(filesPoolMap, tmp, withDerivative);
}
}else if(tmpFile.isFile() && !tmpFile.isHidden()){
boolean addFile = isFileValid(tmpFile, fileFilter);
if (addFile) {
String key = null;
String filePath = getFilePathValue(tmpFile);
String fName = tmpFile.getName();
complexObjectMap = filesPoolMap.get(filePath);
if(withDerivative){
//int dIndex = fName.lastIndexOf('.');
//key = fName.substring(0, (dIndex>0?dIndex:fName.length()));
key = getGroupKey(fName);
if(complexObjectMap == null){
complexObjectMap = new TreeMap<String, Object>();
filesPoolMap.put(filePath, complexObjectMap);
}
List<String> fList = (List<String>) complexObjectMap.get(key);
if(fList == null){
fList = new ArrayList<String>();
complexObjectMap.put(key, fList);
}
fList.add(tmpFile.getAbsolutePath());
}else{
key = fName;
if(complexObjectMap == null){
complexObjectMap = new TreeMap<String, Object>();
filesPoolMap.put(filePath, complexObjectMap);
}
complexObjectMap.put(key, tmpFile.getAbsolutePath());
}
}
}
}
private void appendMixComplexObjectToPool(Map<String, Map> filesPoolMap, File tmpFile){
Map<String, String> complexObjectMap = null;
if(tmpFile.isDirectory()){
File[] fileList = tmpFile.listFiles();
for(int i=0; i<fileList.length; i++){
File tmp = fileList[i];
appendMixComplexObjectToPool(filesPoolMap, tmp);
}
}else if(tmpFile.isFile() && !tmpFile.isHidden()){
boolean addFile = isFileValid(tmpFile, fileFilter);
if (addFile) {
String fName = tmpFile.getName();
int dIndex = fName.lastIndexOf('.');
String key = fName.substring(0, (dIndex>0?dIndex:fName.length()));
int indexp = (key.toLowerCase()).lastIndexOf(coDelimiter);
int delLength = coDelimiter.length();
boolean isComplexObject = false;
if(indexp > 0 && indexp != key.length() - delLength){
String orderNum = key.substring(indexp + delLength, key.length());
try{
//Test for possible complex objects
int order = Integer.parseInt(orderNum);
isComplexObject = true;
String filePath = getFilePathValue(tmpFile);
complexObjectMap = filesPoolMap.get(filePath);
if(complexObjectMap == null){
complexObjectMap = new TreeMap<String, String>();
filesPoolMap.put(filePath, complexObjectMap);
complexObjectMap.put(key, tmpFile.getAbsolutePath());
}else{
complexObjectMap.put(key, tmpFile.getAbsolutePath());
}
}catch (NumberFormatException ne){}
}
if(!isComplexObject){
complexObjectMap = filesPoolMap.get(singleKey);
if(complexObjectMap == null){
complexObjectMap = new HashMap<String, String>();
filesPoolMap.put(singleKey, complexObjectMap);
complexObjectMap.put(tmpFile.getAbsolutePath(), tmpFile.getAbsolutePath());
}else{
complexObjectMap.put(tmpFile.getAbsolutePath(), tmpFile.getAbsolutePath());
}
}
}
}
}
private void appendShareArkObjectToPool(Map<String, Map> filesPoolMap, File tmpFile){
Map<String, String> shareArkObjectMap = null;
if(tmpFile.isDirectory()){
File[] fileList = tmpFile.listFiles();
for(int i=0; i<fileList.length; i++){
File tmp = fileList[i];
appendShareArkObjectToPool(filesPoolMap, tmp);
}
}else if(tmpFile.isFile() && !tmpFile.isHidden()){
boolean addFile = isFileValid(tmpFile, fileFilter);
if (addFile) {
String key = getGroupKey(tmpFile.getName());
String filePath = tmpFile.getAbsolutePath();
shareArkObjectMap = filesPoolMap.get(key);
if(shareArkObjectMap == null){
shareArkObjectMap = new HashMap<String, String>();
filesPoolMap.put(key, shareArkObjectMap);
}
shareArkObjectMap.put(filePath, filePath);
}
}
}
private String getGroupKey(String fileName){
int dIndex = -1;
int matchIndex = -1;
if(fileOrderSuffixes != null && fileOrderSuffixes.length > 0){
String tmp = null;
for(int i=0; i< fileOrderSuffixes.length; i++){
tmp = fileOrderSuffixes[i];
if((fileName.endsWith(tmp))){
//Handle the matching like xxx.tif, .tif. with longest matching
if( matchIndex >= 0 ){
if(tmp.length() > fileOrderSuffixes[matchIndex].length())
matchIndex = i;
}else
matchIndex = i;
}
}
}
if(matchIndex >= 0){
dIndex = fileName.lastIndexOf(fileOrderSuffixes[matchIndex]);
}else
dIndex = fileName.lastIndexOf('.');
return fileName.substring(0, (dIndex>0?dIndex:fileName.length()));
}
private Iterator handleOrdering(Map tmpMap, String delimiter){
Map<String, Object> orderMap = new TreeMap<String, Object>();
if(delimiter != null && delimiter.length() > 0){
Object[] fileList = (Object[]) tmpMap.keySet().toArray();
String largestKey = (String) fileList[0];
int keyLength = largestKey.length();
for (int i = 0; i < fileList.length; i++) {
String filename = (String) fileList[i];
if (filename.length() >= keyLength) {
keyLength = filename.length();
largestKey = filename;
}
}
String tmpKey = null;
Object tmpFile = null;
for(int i=0; i<fileList.length; i++){
tmpKey = (String) fileList[i];
tmpFile = (Object) tmpMap.remove(tmpKey);
int tmpKeyLength = tmpKey.length();
if(tmpKey.length() < keyLength){
//Page ordering
int indexp = tmpKey.lastIndexOf(delimiter);
if (indexp > 0){
String tmp = tmpKey.substring(indexp + delimiter.length());
try{
int order = Integer.parseInt(tmp);
for(int j=0; j<(keyLength-tmpKeyLength); j++){
tmp = "0" + tmp;
}
tmpKey = tmpKey.substring(0, indexp + delimiter.length()) + tmp;
}catch(NumberFormatException ne){
ne.printStackTrace();
}
}
}
orderMap.put(tmpKey, tmpFile);
}
}else{
orderMap.putAll(tmpMap);
}
return orderMap.values().iterator();
}
private Iterator orderFiles(Map tmpMap, String delimiter, PreferedOrder preferedOrder){
Map<String, Object> orderMap = new TreeMap<String, Object>();
if(delimiter != null && delimiter.length() > 0){
int delLength = delimiter.length();
Object[] fileList = (Object[]) tmpMap.keySet().toArray();
String orderKey = null;
int largestOrderLen = 0;
int indexp = -1;
for (int i = 0; i < fileList.length; i++) {
orderKey = (String) fileList[i];
int idx = orderKey.lastIndexOf('.');
if(idx > 0)
orderKey = orderKey.substring(0, idx);
indexp = orderKey.lastIndexOf(delimiter);
if(indexp >= 0 && orderKey.length() > (indexp + delLength)){
orderKey = orderKey.substring(indexp + delLength);
if (orderKey.length() >= largestOrderLen) {
try{
Integer.parseInt(orderKey);
largestOrderLen = orderKey.length();
}catch (NumberFormatException ne){}
}
}
}
String tmpKey = null;
Object tmpFile = null;
for(int i=0; i<fileList.length; i++){
tmpKey = (String) fileList[i];
tmpFile = (Object) tmpMap.remove(tmpKey);
orderKey = "";
indexp = tmpKey.lastIndexOf(delimiter);
if(indexp >= 0 && tmpKey.length() > (indexp + delLength)){
orderKey = tmpKey.substring(indexp + delLength);
int idx = orderKey.lastIndexOf('.');
if(idx > 0)
orderKey = orderKey.substring(0, idx);
int orderKeyLen = orderKey.length();
//Page ordering with numbers like 1, 2, ..., 10, 11, ..., etc.
try{
Integer.parseInt(orderKey);
String tmp = tmpKey.substring(indexp + delimiter.length());
if(orderKeyLen < largestOrderLen){
for(int j=0; j<(largestOrderLen-orderKeyLen); j++)
tmp = "0" + tmp;
}
tmpKey = tmp + delimiter + tmpKey;
}catch (NumberFormatException ne){}
}
orderMap.put(tmpKey, tmpFile);
}
}else{
orderMap.putAll(tmpMap);
}
orderComponents(orderMap, preferedOrder);
return orderMap.values().iterator();
}
/**
* Special handling for the second pdf for access in AV Dissertations and XML for ETD
* @param components
*/
public void orderComponents(Map<String, Object> components, PreferedOrder preferedOrder){
if(preferedOrder != null){
if(preferedOrder.equals(PreferedOrder.PDFANDPDF) || preferedOrder.equals(PreferedOrder.PDFANDXML)){
int order = 0;
int fPosition = -1;
String fileExt = ".pdf";
Object[] keys = (Object[])components.keySet().toArray();
String tmpKey = (String)keys[order];
//The first order for the high resolution rdf
if(!tmpKey.toLowerCase().endsWith(fileExt)){
for(int i=0; i<keys.length; i++){
tmpKey = (String)keys[i];
if(tmpKey.toLowerCase().endsWith(fileExt)){
fPosition = i;
components.put("#0" + tmpKey, components.remove(tmpKey));
break;
}
}
}else{
fPosition = 0;
components.put("#0" + tmpKey, components.remove(tmpKey));
}
//The second order for access rdf or proquest xml
order = 1;
if(preferedOrder.equals(PreferedOrder.PDFANDXML))
fileExt = ".xml";
tmpKey = (String)keys[order];
if(fPosition == order || !tmpKey.toLowerCase().endsWith(fileExt)){
for(int i=0; i<keys.length; i++){
if(i!=fPosition){
tmpKey = (String)keys[i];
if(tmpKey.toLowerCase().endsWith(fileExt)){
components.put("#1" + tmpKey, components.remove(tmpKey));
break;
}
}
}
}
}else if(preferedOrder.equals(PreferedOrder.SUFFIX) && fileOrderSuffixes != null){
String fileExt = null;
String tmpKey = null;
Object[] keys = (Object[])components.keySet().toArray();
int filesLength = keys.length;
int filesOrderLength = fileOrderSuffixes.length;
for (int n=0; n<filesOrderLength; n++){
int order = n;
fileExt = fileOrderSuffixes[order];
tmpKey = (String)keys[order];
if(tmpKey.toLowerCase().endsWith(fileExt)){
components.put("#" + n + ":" + tmpKey, components.remove(tmpKey));
}else{
for(int i=0; i<filesLength; i++){
tmpKey = (String)keys[i];
if(tmpKey.toLowerCase().endsWith(fileExt)){
components.put("#" + n + ":" + tmpKey, components.remove(tmpKey));
break;
}
}
}
}
//Remove other files that haven't included in the suffix list.
//Files removed from the ingest list include the manifest file and the validation file etc.
if(filesLength > filesOrderLength){
keys = (Object[])components.keySet().toArray();
for(int n=0; n<filesLength; n++){
tmpKey = (String)keys[n];
if(n >= filesOrderLength || !tmpKey.endsWith(fileOrderSuffixes[n])){
// Check for files that are not in the suffixes list for removal
boolean found = false;
for(int m=0; m<fileOrderSuffixes.length; m++){
if(tmpKey.endsWith(fileOrderSuffixes[m])){
found = true;
break;
}
}
if(!found)
components.remove(tmpKey);
}
}
}
}
}
}
public String getFileFilter() {
return fileFilter;
}
public void setFileFilter(String fileFilter) {
this.fileFilter = fileFilter;
}
public void addFileGroup(File file, List<List> poolList){
boolean addFile = isFileValid(file, fileFilter);
if (addFile) {
List<String> files = getNewFileGroup(file.getAbsolutePath());
poolList.add(files);
}
}
private List<String> getNewFileGroup(String fileName){
List<String> files = new ArrayList<String>();
files.add(fileName);
return files;
}
public void addFile(File file, List<String> fileGroup){
boolean addFile = isFileValid(file, fileFilter);
if (addFile) {
fileGroup.add(file.getAbsolutePath());
}
}
public void addPairGroup(String key, File file, Map<String, List> poolList){
boolean addFile = isFileValid(file, fileFilter);
if (addFile) {
List<String> files = new ArrayList<String>();
files.add(file.getAbsolutePath());
poolList.put(key, files);
}
}
public String[] getFileOrderSuffixes() {
return fileOrderSuffixes;
}
public void setFileOrderSuffixes(String[] fileOrderSuffixes) {
this.fileOrderSuffixes = fileOrderSuffixes;
}
public int getSize(){
return uploadList.size();
}
public String getMessage(){
return message;
}
public String getCoDelimiter() {
return coDelimiter;
}
public static boolean isFileValid(File file, String fileFilter){
if (file.getName().startsWith("."))
return false;
if (fileFilter != null && fileFilter.length() > 0)
return FilenameUtils.wildcardMatchOnSystem(file.getAbsolutePath(), fileFilter);
else
return true;
}
public static String getFilePathValue(File file){
String pathValue = file.getAbsolutePath().replace("\\", "/");
return pathValue.substring(0, pathValue.lastIndexOf("/") + 1);
}
}
| java |
{"topic_33": {"num_tags": 9, "name": "topic_33", "full_name": "topic_33", "num_included_tokens": 9}, "topic_32": {"num_tags": 9, "name": "topic_32", "full_name": "topic_32", "num_included_tokens": 9}, "topic_97": {"num_tags": 1, "name": "topic_97", "full_name": "topic_97", "num_included_tokens": 1}, "topic_43": {"num_tags": 10, "name": "topic_43", "full_name": "topic_43", "num_included_tokens": 10}, "topic_13": {"num_tags": 7, "name": "topic_13", "full_name": "topic_13", "num_included_tokens": 7}, "topic_17": {"num_tags": 5, "name": "topic_17", "full_name": "topic_17", "num_included_tokens": 5}, "topic_5": {"num_tags": 20, "name": "topic_5", "full_name": "topic_5", "num_included_tokens": 20}, "topic_7": {"num_tags": 1, "name": "topic_7", "full_name": "topic_7", "num_included_tokens": 1}, "topic_69": {"num_tags": 2, "name": "topic_69", "full_name": "topic_69", "num_included_tokens": 2}, "topic_91": {"num_tags": 28, "name": "topic_91", "full_name": "topic_91", "num_included_tokens": 28}, "topic_90": {"num_tags": 7, "name": "topic_90", "full_name": "topic_90", "num_included_tokens": 7}, "topic_79": {"num_tags": 17, "name": "topic_79", "full_name": "topic_79", "num_included_tokens": 17}, "topic_78": {"num_tags": 17, "name": "topic_78", "full_name": "topic_78", "num_included_tokens": 17}, "topic_86": {"num_tags": 15, "name": "topic_86", "full_name": "topic_86", "num_included_tokens": 15}, "topic_89": {"num_tags": 2, "name": "topic_89", "full_name": "topic_89", "num_included_tokens": 2}, "topic_63": {"num_tags": 1, "name": "topic_63", "full_name": "topic_63", "num_included_tokens": 1}, "topic_60": {"num_tags": 1, "name": "topic_60", "full_name": "topic_60", "num_included_tokens": 1}, "topic_77": {"num_tags": 1, "name": "topic_77", "full_name": "topic_77", "num_included_tokens": 1}, "topic_55": {"num_tags": 3, "name": "topic_55", "full_name": "topic_55", "num_included_tokens": 3}, "topic_85": {"num_tags": 1, "name": "topic_85", "full_name": "topic_85", "num_included_tokens": 1}} | json |
For the gnocchi:
For the green pea puree:
For the Sicilian vegetable caponata:
1. To prepare the oats gnocchi, boil the milk in a saucepan on a medium-high flame. Once it comes to a boil, add the oats and semolina, and whisk vigorously. Cook for a few minutes, add 100 g butter, Parmesan, and nutmeg powder to the mixture and continue whisking. Remove from the flame and spread on a greased pan, set, and cool. Cut into the desired shape and sear in olive oil on a hot pan.
2. To prepare the green pea puree, boil the green peas, and blend with salt, pepper, and cream. Return to the pan and finish with butter. Set aside.
3. To prepare the Sicilian vegetable caponata, heat the olive oil, and sauté the vegetables and garlic until just done.
4. Place the gnocchi on the plate and serve hot, accompanied by the green pea puree and caponata. Garnish with micro herbs and aragula.
| english |
package tw.com.geovision.geoengine;
public class FaceQuality {
public float mScore;
public float mLeftRight;
public float mUpDown;
public float mHorizontal;
public float mClarity;
public float mBright;
public FaceQuality() {
this.mScore = 0.0F;
this.mLeftRight = 0.0F;
this.mUpDown = 0.0F;
this.mHorizontal = 0.0F;
this.mClarity = 0.0F;
this.mBright = 0.0F;
}
public FaceQuality(float score, float leftRight, float upDown, float horizontal, float clarity) {
this.mScore = score;
this.mLeftRight = leftRight;
this.mUpDown = upDown;
this.mHorizontal = horizontal;
this.mClarity = clarity;
}
public FaceQuality(FaceQuality q) {
this.mScore = q.mScore;
this.mLeftRight = q.mLeftRight;
this.mUpDown = q.mUpDown;
this.mHorizontal = q.mHorizontal;
this.mClarity = q.mClarity;
this.mBright = q.mBright;
}
public String toString() {
return "Quality(" + Float.toString(this.mScore) + "," + Float.toString(this.mLeftRight) + "," + Float.toString(this.mUpDown) + "," + Float.toString(this.mHorizontal) + "," + Float.toString(this.mClarity) + ")";
}
}
| java |
{"remainingRequest":"E:\\Eason\\transfer\\AAAAJeecg-boot\\jeecgbootwithonline\\ant-design-jeecg-vue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!E:\\Eason\\transfer\\AAAAJeecg-boot\\jeecgbootwithonline\\ant-design-jeecg-vue\\src\\components\\tools\\UserPassword.vue?vue&type=template&id=d161ff2c&scoped=true&","dependencies":[{"path":"E:\\Eason\\transfer\\AAAAJeecg-boot\\jeecgbootwithonline\\ant-design-jeecg-vue\\src\\components\\tools\\UserPassword.vue","mtime":1555675509927},{"path":"E:\\Eason\\transfer\\AAAAJeecg-boot\\jeecgbootwithonline\\ant-design-jeecg-vue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1572241135682},{"path":"E:\\Eason\\transfer\\AAAAJeecg-boot\\jeecgbootwithonline\\ant-design-jeecg-vue\\node_modules\\vue-loader\\lib\\loaders\\templateLoader.js","mtime":1574652421668},{"path":"E:\\Eason\\transfer\\AAAAJeecg-boot\\jeecgbootwithonline\\ant-design-jeecg-vue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1572241135682},{"path":"E:\\Eason\\transfer\\AAAAJeecg-boot\\jeecgbootwithonline\\ant-design-jeecg-vue\\node_modules\\vue-loader\\lib\\index.js","mtime":1574652421668}],"contextDependencies":[],"result":["\n<a-modal\n :title=\"title\"\n :width=\"modalWidth\"\n :visible=\"visible\"\n :confirmLoading=\"confirmLoading\"\n @ok=\"handleOk\"\n @cancel=\"handleCancel\"\n cancelText=\"关闭\"\n>\n <a-spin :spinning=\"confirmLoading\">\n <a-form :form=\"form\">\n\n <a-form-item\n :labelCol=\"labelCol\"\n :wrapperCol=\"wrapperCol\"\n label=\"旧密码\">\n <a-input type=\"password\" placeholder=\"请输入旧密码\" v-decorator=\"[ 'oldpassword', validatorRules.oldpassword]\" />\n </a-form-item>\n\n <a-form-item\n :labelCol=\"labelCol\"\n :wrapperCol=\"wrapperCol\"\n label=\"新密码\">\n <a-input type=\"password\" placeholder=\"请输入新密码\" v-decorator=\"[ 'password', validatorRules.password]\" />\n </a-form-item>\n\n <a-form-item\n :labelCol=\"labelCol\"\n :wrapperCol=\"wrapperCol\"\n label=\"确认新密码\">\n <a-input type=\"password\" @blur=\"handleConfirmBlur\" placeholder=\"请确认新密码\" v-decorator=\"[ 'confirmpassword', validatorRules.confirmpassword]\"/>\n </a-form-item>\n\n </a-form>\n </a-spin>\n</a-modal>\n",null]} | json |
With the government allowing 49 per cent FDI (foreign direct investment) in aviation sector, the focus will now be on encouraging use of smaller aircraft to connect Tier-I, Tier-II and Tier-III cities with metros, according to Union Civil Aviation Minister Ajit Singh.
“No doubt the aviation sector is going through a difficult phase. The decision to allow 49 per cent FDI will certainly push things in the positive direction. I am looking towards entry of smaller aircraft to serve new destinations in India’s Tier-I, Tier-II and Tier-III cities which hold a great potential. We are looking towards connecting these cities with metros. We have to tap the vast middle class segment, which wants to travel by air. We will urge the airlines to make connectivity with such cities to tap this potential,” Mr. Singh said on the sidelines of an Assocham conference on Indian civil aviation sector here.
To a question, Mr. Singh said only time would tell how many foreign airlines would show interest in acquiring stake in domestic carriers. Nevertheless, he felt, the mood was upbeat. Allowing FDI in aviation would pave way for much-needed equity infusion in Indian carriers, which were in dire need of funds, he added.
He said he would bring a Bill in the winter session of Parliament to set up of a Civil Aviation Authority which would revamp the aviation regulator, Directorate-General of Civil Aviation . The government was also working on constituting a dedicated civil aviation security force, as the Central Industrial Security Force, currently looking after aviation security, was formed for a different purpose. He said the government was looking at replicating the public-private-partnership model to develop airports in small cities. There was also a need to build low-cost airports at smaller cities. | english |
.rose {
transition: color 36ms;
background-color: pink;
color: #111;
accent-color: #628;
}
mark.rose {
background-color: transparent;
}
.rose ::selection {
background-color: midnightblue;
color: gainsboro;
}
.rose :any-link {
color: #628;
outline-color: #628;
}
.rose :any-link:focus {
color: #111;
outline-color: #111;
}
| css |
Shorapur also known as Surapur is the taluk headquarter of the same name situated about 110 km south of Gulbarga and about 500 km north of Bangalore. The Muslims rulers changed the place name from Surapur to Shorapur. The place has historical importance too in the history of freedom movement. After the fall of the Vijayanagara it was the capital of the line of the Nayakas of Surpur (1636-1858) known for their gallantry. The place came to limelight during the period of First War of Independence when Raja Venkatappa Nayaka of Surapura boldly revolted against the British rule in February 1858. The place is situated on a strategic point from the defense point of view surrounded by hill ranges; and the fortification round it and tall, gateways impress the visitor.Among the objects of interest of the place, the splendid temple dedicated to Gopalswamy built by the Nayakas of Surapur attracts devotees throughout the year. It is situated on an elevated place with steps leading to it, and rows of turret-like niches with images installed in them and are built in a line on the sides of the roof top. It is in post-Vijayanagara style with tall stone pillars.
| english |
<gh_stars>1-10
<form class="layui-form model-form" action="">
<input name="id" id="id" type="hidden" value="{$info.id|default=0}">
<input name="type_id" id="type_id" type="hidden" value="{$info.type_id|default=0}">
<div class="layui-form-item" style="width: 500px;">
<label class="layui-form-label">推荐标题:</label>
<div class="layui-input-block">
<input name="title" value="{$info.title|default=''}" lay-verify="required" autocomplete="off" placeholder="请输入推荐标题" class="layui-input" type="text">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">页面位置:</label>
{layout:select itemId="$info['item_id']" locId="$info['loc_id']" limit="2"}
</div>
<div class="layui-form-item">
<label class="layui-form-label">推荐类型:</label>
<div class="layui-input-inline">
{common:select param="type|1|推荐类型|name|id" data="$typeList" value="isset($info['type']) ? $info['type'] : 0"}
</div>
<div class="layui-input-inline">
<input name="type_desc" id="type_value" value="{$info.type_desc|default=''}" lay-verify="" autocomplete="off" placeholder="请选择模块对象" class="layui-input" type="text" readonly="">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">布局图片:</label>
{upload:image name="image|图片|90x90|建议上传尺寸450x450" value="isset($info['image_url']) ? $info['image_url'] : ''"}
</div>
<div class="layui-form-item">
<label class="layui-form-label">序号:</label>
<div class="layui-input-inline">
<input name="sort" id="sort" value="{$info.sort|default=125}" lay-verify="required|number" autocomplete="off" placeholder="请输入序号" class="layui-input" type="text">
</div>
</div>
{widget:submit name="submit|立即保存,close|关闭"}
</form> | html |
<reponame>lekjos/FlightDataAnalysis
import numpy as np
import pandas as pd
from copy import copy
def print_max_str_len(df:pd.DataFrame):
"""
Print max length of string columns in pandas dataframe
"""
index = 0
for col_name, col in df.iteritems():
try:
print(index, col_name, 'str', col.str.len().max())
except AttributeError:
try:
print(index, col_name, 'int/float', max(col.map(str).apply(len)))
except AttributeError:
#lazy way to print col length of strings and ints
pass
index += 1
def make_table(headers:list, rows:list, round_cols:list=[], round_to=3):
"""
Generates a markdown table.
- headers: list of headers
- rows: list of lists
- round_cols: list of col index to round to three digits
* all rows and headers must be same length
"""
if len(headers) != len(rows[0]):
raise ValueError("Title array and rows array must be same length")
for row in rows:
if len(rows[0]) != len(row):
raise ValueError("All rows must be same length")
str_ = ""
max_col = dict(zip(range(len(headers)), [0 for i in headers])) #dict of max col length
# Find max col len
titles_rows = copy(rows)
titles_rows.append(headers)
transposed = np.array(titles_rows).T.tolist()
for ind, x in enumerate(transposed):
max_col[ind] = max([len(str(y)) for y in x])
# Make table
for row_ind, row in enumerate(rows):
## make header rows
if row_ind == 0:
str_ += "| "+" | ".join([str(x).ljust(max_col[i]) for i,x in enumerate(headers)])+ " |\n"
str_ += "| "+" | ".join([ "-"*max_col[i] for i, z in enumerate(headers)])+ " |\n"
str_+= "| "
# make rows of table and round
for col_ind, col in enumerate(row):
if col_ind in round_cols:
if col is not None:
col = round(col,round_to)
else:
col = 'N/A'
str_ += str(col).ljust(max_col[col_ind])
if col_ind < len(row)-1:
str_ += " | "
str_+=" |\n"
return str_
def row_count(f):
"""
Counts rows in iterable or file.
"""
for i, l in enumerate(f):
pass
return i | python |
[{"authors":["admin"],"categories":null,"content":"Aritra is a Research Scientist in the Computer Vision and Artificial Intelligence Group at GE Research.\nHe is responsible for working on computer vision problems across different businesses including Aviation, Healthcare, Power, Transportation (currently a part of Wabtec). He is also an integral part of GE Research\u0026rsquo;s external portfolio. In this role, Aritra is actively pursuing government funding opportunities by working on fundamental research problems in AI and computer vision leading to publications and grant proposals. These problems include the abstract grounding problem in AI using logical and symbolic methods, to bespoke problems in computer vision.\nHis research interests lie in the reconciliation of the disparate areas of artificial intelligence - particularly symbolic, logical, bayesian and connectionist approaches.\nHis current work involves research in artificial intelligence with a focus on image analytics and computer vision. He has significant extensive academic and industrial exposure in developing research prototypes at RPI, IBM Research and GE Research.\nPrior to joining GE Research, he was at GE Healthcare working on developing deep learning solutions for specific healthcare problems. Aritra completed research internships at GE Research and IBM Research before joining the organization as a full time researcher.\nAritra has published several papers in top international conferences and journals in AI, computer vision and medical imaging, and has been involved with patenting novel technology in Healthcare, Transportation, Aviation and Power. Aritra has a Ph.D. and M.S. in Computer Science from Rensselaer Polytechnic Institute, and a B.E. in Electronics and Telecommunication Engineering from Jadavpur University, India.\n","date":-62135596800,"expirydate":-62135596800,"kind":"taxonomy","lang":"en","lastmod":-62135596800,"objectID":"2525497d367e79493fd32b198b28f040","permalink":"http://aritrachowdhury.com/author/aritra-chowdhury/","publishdate":"0001-01-01T00:00:00Z","relpermalink":"/author/aritra-chowdhury/","section":"authors","summary":"Aritra is a Research Scientist in the Computer Vision and Artificial Intelligence Group at GE Research.\nHe is responsible for working on computer vision problems across different businesses including Aviation, Healthcare, Power, Transportation (currently a part of Wabtec).","tags":null,"title":"<NAME>","type":"authors"}] | json |
[
{
"Id": "948762",
"ThreadId": "404972",
"Html": "\r\n<p>Hi!</p>\r\n<p>I try to parse PNG from Excel sheet. The Excel file has one list (01_Body_Graph_Daily) and going to PHP-script from Microsoft SQL Reporting Services by e-mail and/or SMB-share, in any case, the error is the same:</p>\r\n<p>PHP Fatal error: Call to a member function getBlipType() on a non-object in /var/www/mail-edge.mil.zs/Classes/PHPExcel/Reader/Excel5.php on line 995</p>\r\n<p>PHP code:</p>\r\n<p> </p>\r\n<div style=\"color:black; background-color:white\">\r\n<pre><span style=\"color:blue\">function</span> getBodyImages($dataDir, $parseFile, $reporting_type)\n{\n <span style=\"color:blue\">try</span> {\n $objPHPExcel = PHPExcel_IOFactory::load($dataDir . $reporting_type . <span style=\"color:#a31515\">'/'</span> . $parseFile);\n } <span style=\"color:blue\">catch</span> (Exception $e) {\n <span style=\"color:blue\">die</span>(<span style=\"color:#a31515\">'Error loading file: '</span> . $e->getMessage());\n }\n $worksheet = $objPHPExcel->getActiveSheet();\n <span style=\"color:blue\">foreach</span> ($worksheet->getDrawingCollection() <span style=\"color:blue\">as</span> $i => $drawing) {\n <span style=\"color:blue\">if</span> ($drawing <span style=\"color:blue\">instanceof</span> PHPExcel_Worksheet_MemoryDrawing) {\n ob_start();\n call_user_func(\n $drawing->getRenderingFunction(),\n $drawing->getImageResource()\n );\n $imageContents = ob_get_contents();\n ob_end_clean();\n\n $myFileName = $dataDir . $reporting_type . <span style=\"color:#a31515\">'/graph_'</span> . ++$i . <span style=\"color:#a31515\">'.png'</span>;\n $trueFileName = <span style=\"color:#a31515\">'graph_'</span> . $i . <span style=\"color:#a31515\">'.png'</span>;\n file_put_contents($myFileName, $imageContents);\n $files[] = $trueFileName;\n }\n }\n <span style=\"color:blue\">return</span> $files;\n}\n</pre>\r\n</div>\r\n<p> </p>\r\n<div style=\"color:black; background-color:white\">Ok, I download file from server to my Mac, opened it in MS Office 2011 for Mac, just save it (Cmd+S) and upload to server again, then run script - and voila - all drawings parsed successfuly.</div>\r\n<p> </p>\r\n<p>Sometimes, this error is not appears, but script going to the infinite loop of Notices on this lines:</p>\r\n<p> </p>\r\n<div style=\"color:black; background-color:white\">\r\n<pre> <span style=\"color:blue\">try</span> {\n $objPHPExcel = PHPExcel_IOFactory::load($dataDir . $reporting_type . <span style=\"color:#a31515\">'/'</span> . $parseFile);\n } <span style=\"color:blue\">catch</span> (Exception $e) {\n <span style=\"color:blue\">die</span>(<span style=\"color:#a31515\">'Error loading file: '</span> . $e->getMessage());\n }\n \n</pre>\r\n</div>\r\n<p> </p>\r\n<p>I cannot post Notices now, but when it appear again I'll do it.</p>\r\n<p>So - the question - where is the problem?</p>\r\n<p>Two files (broken.xls and okay.xls) in attch.</p>\r\n<p>Uh, and so strange - MacOS doesn't render preview in file icon for broken.xls and render for okay.xls (this file I saved in Excel by hands), screenshot in attch too.</p>\r\n<p>Attch:</p>\r\n<p>http://phpexcel.codeplex.com/Download/AttachmentDownload.ashx?ProjectName=phpexcel&WorkItemId=10749&FileAttachmentId=6718</p>\r\n<p>http://phpexcel.codeplex.com/Download/AttachmentDownload.ashx?ProjectName=phpexcel&WorkItemId=10749&FileAttachmentId=6719</p>\r\n<p>Thanx!</p>\r\n<p>p.s. sorry for my english.</p>\r\n",
"PostedDate": "2012-11-28T22:55:20.2-08:00",
"UserRole": null,
"MarkedAsAnswerDate": null
}
] | json |
/*
* Copyright 2013 Palantir Technologies, Inc.
*
* 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.
*/
import * as Lint from "./lint";
import * as path from "path";
import {findConfiguration as config} from "./configuration";
const moduleDirectory = path.dirname(module.filename);
class Linter {
public static VERSION = "2.5.1";
public static findConfiguration = config;
private fileName: string;
private source: string;
private options: Lint.ILinterOptions;
constructor(fileName: string, source: string, options: Lint.ILinterOptions) {
this.fileName = fileName;
this.source = source;
this.options = options;
}
public lint(): Lint.LintResult {
const failures: Lint.RuleFailure[] = [];
const sourceFile = Lint.getSourceFile(this.fileName, this.source);
// walk the code first to find all the intervals where rules are disabled
const rulesWalker = new Lint.EnableDisableRulesWalker(sourceFile, {
disabledIntervals: [],
ruleName: ""
});
rulesWalker.walk(sourceFile);
const enableDisableRuleMap = rulesWalker.enableDisableRuleMap;
const rulesDirectory = this.getRelativePath(this.options.rulesDirectory);
const configuration = this.options.configuration.rules;
const configuredRules = Lint.loadRules(configuration, enableDisableRuleMap, rulesDirectory);
const enabledRules = configuredRules.filter((r) => r.isEnabled());
for (let rule of enabledRules) {
const ruleFailures = rule.apply(sourceFile);
for (let ruleFailure of ruleFailures) {
if (!this.containsRule(failures, ruleFailure)) {
failures.push(ruleFailure);
}
}
}
let formatter: Lint.IFormatter;
const formattersDirectory = this.getRelativePath(this.options.formattersDirectory);
const Formatter = Lint.findFormatter(this.options.formatter, formattersDirectory);
if (Formatter) {
formatter = new Formatter();
} else {
throw new Error(`formatter '${this.options.formatter}' not found`);
}
const output = formatter.format(failures);
return {
failureCount: failures.length,
failures: failures,
format: this.options.formatter,
output: output
};
}
private getRelativePath(directory: string): string {
if (directory != null) {
return path.relative(moduleDirectory, directory);
}
}
private containsRule(rules: Lint.RuleFailure[], rule: Lint.RuleFailure) {
return rules.some((r) => r.equals(rule));
}
}
namespace Linter {}
export = Linter;
| typescript |
<reponame>azureautomation/this-runbook-would-install-windows-roles-and-features-on-any-azure-vm
{
"Author": "Ritesh.Modi",
"ContentSize": 5740,
"ContentUrl": "https://raw.githubusercontent.com/azureautomation/this-runbook-would-install-windows-roles-and-features-on-any-azure-vm/master/Install-WindowsFeature.ps1",
"DownloadCount": 957,
"Id": "This-runbook-would-install-3ca21121",
"IsFederated": false,
"IsWorkflow": true,
"Popularity": 487,
"RaterCount": 0,
"Rating": 0.0,
"ReleaseDate": "2015-4-5T00:00:00",
"RunbookKind": 6,
"RunbookKindString": "PowerShell Workflow",
"Summary": "This runbooks installs a Windows feature on a virtual machine. These features are typically installed using server manager. The feature would be installed and if the feature demands a reboot, the virtual machine will reboot automatically.",
"Title": "This runbook would install Windows roles and features on any Azure VM",
"UpdatedDate": "2015-4-5T00:00:00",
"Url": "https://github.com/azureautomation/this-runbook-would-install-windows-roles-and-features-on-any-azure-vm",
"UserTags": "Microsoft Azure, Roles and Features, Azure Automation"
} | json |
package org.talchain.util;
import java.util.*;
/**
* @author <NAME>
* @since 14.07.2015
*/
public class CollectionUtils {
public static <K, V> List<V> collectList(Collection<K> items, Functional.Function<K, V> collector) {
List<V> collected = new ArrayList<>(items.size());
for(K item : items) {
collected.add(collector.apply(item));
}
return collected;
}
public static <K, V> Set<V> collectSet(Collection<K> items, Functional.Function<K, V> collector) {
Set<V> collected = new HashSet<>();
for(K item : items) {
collected.add(collector.apply(item));
}
return collected;
}
public static <T> List<T> truncate(List<T> items, int limit) {
if(limit > items.size()) {
return new ArrayList<>(items);
}
List<T> truncated = new ArrayList<>(limit);
for(T item : items) {
truncated.add(item);
if(truncated.size() == limit) {
break;
}
}
return truncated;
}
public static <T> List<T> selectList(Collection<T> items, Functional.Predicate<T> predicate) {
List<T> selected = new ArrayList<>();
for(T item : items) {
if(predicate.test(item)) {
selected.add(item);
}
}
return selected;
}
public static <T> Set<T> selectSet(Collection<T> items, Functional.Predicate<T> predicate) {
Set<T> selected = new HashSet<>();
for(T item : items) {
if(predicate.test(item)) {
selected.add(item);
}
}
return selected;
}
}
| java |
The Avengers (2012)
Consider the wit, brawn and pulse-pounding balls of both Iron Man movies and the spectacular Thor. Now consider the flaws and failings of Captain America, Fury and two incredibly average Hulk flicks. What are you left with? A question: where exactly was in-form writer/director Joss Whedon's Avengers Assemble actually going to go? Down the pan? Or through the roof? Well, guess what? He's only gone and pulled it off.
Ever since that teasing Nick Fury advent at the end of the first Iron Man, fans and filmgoers alike have been seeing-out the end credits of all subsequent Marvel flicks in hope of something (anything). What they got was everything. All signs pointed to an assemble, all roads lead to an Avengers movie. 5 years in the making? Try 50 for any Marvel mogul worth their salt will tell you a film's been coming since the early 1960's.
And here it is: 4 big-buck franchises rolled into one: Iron Man, Thor, Captain America and Hulk. Robert Downey-Junior, Chris Hemsworth, Chris Evans and...Mark Ruffolo?! Ed Norton obviously didn't fancy this one but fear not, Hulk nuts, Ruffolo's twitchy turn makes for the best Banner yet. Anyway, throw these four in a room together and you're guaranteed two things; friction and fun. Our heroes square up, square off but in the end...well you can guess where it goes. The story? SHIELD head Nick Fury (Samuel L Jackson) enlists the fickle four along with Black Widow (Scarlet Johanson) to help save the world from Thor's bad brother Loki (Tom Hiddleston). Zero points for innovation, then. But if you thought Tony Stark suiting-up for the first-time was the coolest thing you've ever seen. Think again.
Skilled sci-fi pen-cum-director Joss Whedon has well and truly arrived with this dizzyingly brilliant blockbuster that's more than the sum of it's fluctuating parts. Believe the hype, Avengers Assemble is a cast-iron hit. It's incredible. It's thunderous. It's furious, beaming, biting and marvellous. But enough puns, let's get down to business.
Whedon has approached this four-way fusion in the right way: a strong and balanced emphasis on plot, dialogue and visuals, character development and chemistry. Too many cooks? Hell no. The big-name players work so well with one another it's actually surprising. The sheer sum and sense of one-liners and put-downs are just as memorable as the brutal, in-house beat-downs. Which is saying something when you consider scenes pitting Iron Man and Hulk against Thor are enough to send an entire generation of comic-book geeks into cardiac arrest.
Downey-Junior's effortlessly cool turn on the sarci' Stark was always going to be the main lure, here, but to say he outshines his peers would be wrong. It's not all about the billionaire ball-buster. Everyone gets their 15 minutes. Both Hemsworth and Ruffolo (in particular) are bang on. Even the out-of-touch Cap' chips in with a few big, cheesy shots and Hiddleston's creepy demigod makes for a sharp villain.
Granted, Whedon's tongue-in-cheek ethos and slapstick-like approach means the Avengers was never going to measure up to any of Nolan's Batman films. How many comic-book films (or films, in general) do!? Which is why there's not much point even trying to compare this breath-snatching Marvel muster to Nolan's Dark Knight rebirth. It's a kick-ass popcorn movie for young and old. Nothing more.
That said, this hulking 142 minute feature is a stimulating affair with a freehold on the brash and the flash and the down-right hilarious. It's an absolute blast. Wildly entertaining, ridiculously awesome, the Avengers' is everything it should be: over-the-top, funny, cool, funny, loud, exciting, electric and did I mention funny!?
Best comic book movie ever? No. Best Marvel production ever? Yeeeeee...no. X-Men: First Class still has that one tied-up but for such a question to prompt a pause for thought says an awful lot. Whedon's Assemble may not be the best superhero film out there but it is the funniest and probably the most entertaining. Definitely the coolest.
Sure, there may be a limit to how many times you can watch superheroes kick the crap out of one and all. But you won't mind too much. Popcorn cinema doesn't get much better than this. Joss Whedon and co. have kicked this year's comic-book-busters off with a bang. Expect sequels.
Usain Bolt and bobsleighs aside, when someone mentions Jamaica, you think of either Reggae, Rhastas or weed. In other words, you think of Bob Marley. The undisputed paragon of everything we associate with that "laid-back" corner of the Caribbean. But Bob was a little more than a nonchalant stoner who sung a few tunes, you know. As far as singer/songwriters go, they don't come much bigger than Bob Marley. His and The Wailers' universal songs of love, peace and hope rank amidst some of the finest and most recognizable ever given up to music. There are even those who would liken Bob to Ghandi. A bit O.T.T, sure, but the comparisons are there (sort of): an immortal advocate of peace and altruism; a liberal; a national treasure. And yet Bob Marley was not without fault and, 'till now, a fair share of unworthy documentaries.
Kevin Macdonald's (The Last King of Scotland) bio' doc' about Bob's life and legacy is a stylish and honest mediation on the man behind the myth that charts his physical and spiritual journey through the music world; his quest for success that would transform him from the rejected frontman of a budding ska band to the iconic, liberating arbitrator whose timeless tunes went beyond music and unified colours, creeds and a country in meltdown.
Made with the full cooperation of Bob's family and friends and told largely through their accounts, Marley is a potent and essential piece of documentary film-making. Kevin Macdonald's Bob doc' could've made the man out to be some kind of saint. But it doesn't. Macdonald's various interviews with those who knew Bob best in addition to a heap of archival stills and footage paint the pop-icon in a variety of ways; conflicted, poised, selfish, kind, wanton, loyal, driven, stubborn, free. Marley lays bare the heart and soul of the dreadlocked Rhasta in some style.
A distinct level of cohesion and humanity is well and truly found in the director's attention to detail regarding Bob's estranged personal life; from his impoverished roots and search for acceptance to his self-serving, self-sacrificing ways and stirring date with cancer.
Despite a muddled and stuttered opening, Marley boasts an absolving and deeply moving final third that ties the hefty, 146 minute bio doc' up in style (cheesy ending credits aside).
This is a fresh and thoughtful trip through the life of a music legend with scope and soul in spades; an intriguing and chic fusion of art, music and history. Marley is the quintessential portrait of Bob Marley's life. See it.
Brokeback Mountain (2005)
An eloquently tender slice of American cinema, Brokeback Mountain is a film I've held close to my heart now for quite some time. Among other things, this delicately spun picture brought to my attention the skills of an enticing young actor who was fast becoming recognised as one of the finest his generation had to offer. Heath Ledger. A dynamic talent whose Oscar Nominated turn in Ang Lee's epic love parable proved he was, in fact, the real deal. Okay, he didn't win the award and Brokeback was erroneously pipped to the best picture prize by the pretentious Crash. But in 10, 15, 20 years time, Lee's spacious adap of Annie Prolux's short story will no doubt be remembered as the film of 2006. Perhaps even the noughties. And while Ledger's show-stopping spin on Lee Bermejo's retooled Joker maybe the role forever coupled with his name, I will always remember him as the man who played a prominent part in the conception of, quite possibly, the greatest love story of our time.
Set against the sweeping mountain vistas of Wymoing, Brokeback Mountain tells the tearful tale of Ennis Del Mar (Ledger) and Jack Twist (Jake Gyllenhaal). Two twenty something ranch-hands who inadvertently forge a secret love affair in the summer of 1963 that, for all its twists and turns, snags, wrongs and rights, endures: emerging a subversive yet authentic testament to the power of love.
Spanning three arduous decades, Ennis and Jack's covert allegory is one awash with danger, deceit, thought, feeling, density and doubt that bobs and weaves from start to finish. In spite of their mutual affection, Ennis's repressed spirit and alpha-male tendencies obscure the two men's hopes of a happy life together. Jack is the beta and more in-touch half of the bond who, in time, comes to terms with who and what he is. But for Ennis, things aren't so easy. He's a cagey, conflicted and near- inaudible entity who's always quick to remind Jack that their country and culture has a "heterosexual or highway" policy that cannot be inverted.
Considered "alien" even now, homosexuality is outlawed in and around certain pockets of the U.S which is why controversy surrounded and continues to prod the picture three years on from its release. Given the underground credentials of art house autuers' Pedro Almodovar and Wong Kar Wai.Ang, Lee wasn't the first to tackle the theme head-on, but under the stuborn eye of the Hollywood mainstream's- he was. "The first time I read the script for Brokeback, I rejected it," he confessed. "The second time I read it I decided to do it for the exact same reason I'd rejected it before: no one was going to see it." Lee was right to some extent: the percentage of insular homophobes occupying the mainstream of the movie going world was and is, no doubt, large. But Brokeback is too good a film to take on board the criticism dished out by the obtuse. Wake up, smell the coffee. This film is a flat out triumph. A gracefully spun tear jerker with hope, pride and splendour to spare. Brokeback Mountain is one of the most important films to come out of America in living memory. One that compels, captivates, moves and inspires: it stuck with me for months after viewing it.
Much more than just a gay love yarn about two cowboys, Brokeback Mountain is a spectacle. A heart-wrenching morality play that has the power to reshape the notions and ideals of those who discard diversity. This is a film about love. Love that transcends gender, reason and the so-called "norms" laid down by a heterosexual world. Brokeback doesn't ask you to embrace homosexuality, but to understand it, to accept it. Discard it as an "issue", even, for love is an inescapable force that knows no bounds.
Ennis and Jack's same-sex relationship even defies relevance as the film flows towards a melancholic finale, paving the way for a full fledged romantic melodrama that has an unmistakable air of Romeo and Juliet about it. Gylenhall is fantastic, Ledger is a revelation. The late chameleon's pitch-perfect portrayal of a troubled father and husband torn between what he feels and what he thinks he should feel is as true, as touching and as potent as anything you're likely to see in cinema. Much like the film's breathtaking backdrop and photography. Brokeback looks magnificent. The jagged peaks, land; lake and sky-scapes together with the deftly plucked and strummed strings of Gustavoa Santliano's acoustic guitar mount towards one effortlessly potent motif: reminding the viewer time and time again of the men's rocky liaison; of the struggle, pain and care they both share. Brokeback Mountain is an emotive masterpiece. A truly special film that has the dexterity to stir, touch and even transform.
Disturbing yet allegorical, emotionally shallow yet erotically fierce, David Cronenberg's crushingly warped world of sex, cars and sex in cars isn't for those who like their films "middle-of-the-road". Try "off- road". And then some, for Cronenberg's Crash is a perverse, surreal and psychosexual illustration of the apparent links between danger, death and sex with clout that, for all its scandal and sexcitement, ultimately fails to get into top gear.
James Spader plays horny TV exec' James Ballard who, following a near fatal car crash with an equally horny Dr. Helen Remington (Holly Hunter), finds himself lured into an uncanny cult where ex-crash victims are bound together by a kinetic lust for the very machines, circumstances and imagery that disfigured their bodies and minds.
Taking contentious themes and stretching them to their outer limits such as scopophilia, sadomasochism, serial monogamy, self mutilation and homosexuality, Cronenberg crafts and explores a world driven by auto- eroticism, sexual-oddities and libidinal hungers that feeds on the messages, morals and conventions of the mainstream. A move that'll come to the delight of some but, inevitably, the complete and utter disgust of others. Those who fall into the latter camp: don't bother with Crash. You'd do well to last twenty minutes. The former: sit back, interpret and try to enjoy.
With seemingly more scenes of a sexual nature than dialogue (I counted three in the first two minutes), Crash is not for those who bare a faint or chaste heart. It's a prude's worst nightmare. It's provocative, distinct and sexy; a libidinal indie smash of Bunuel-cum-Lynch-like verve whose characters have somewhat idealistic and incalculable sex drives superior to those of a celibate sex addict set loose in Amsterdam. The result? Cinematic smut in pure overdrive that depraves and astounds.
The Cabin in the Woods (2011)
Fresh, fun and bloody far-fetched, Buffy God Joss Wheldon and director Drew Goddard's ferocious black-comedy may be riddled with plot holes to the point of absurdity, but it is different. Good different? Yes and no; The Cabin in the Woods is a wry and rash blend of every sub-genre known to horror that plays like a dystopian spin on The Truman Show. Imagine bits-and-pieces from every horror flick you've ever seen swirling in a cruel yet comical crimson cocktail. Slasher, zombie, paranormal, abnormal- you name it, it's in there. We even have the classic horror cast set-up; the jock, the whore, the stoner, black dude and virgin. They're all in there too- but for good reason.
Bolting itself to a My Little Eye-like concept of a reality TV show gone wrong, this horror hybrid is set somewhere in the future and tells of 5 teen' stereotypes who opt to spend spring-break in a tucked-away cabin in the woods. Big Brother is watching, though. A detached control-room full of quirky hands and 2 cynical stage managers (including a priceless Richard Jenkins) have something in store for the oblivious 5. The would- be woods is like a giant stage. It's been rigged with all sorts of booby-traps and pitfalls with a tone of cameras to catch the whole damn thing. But why?
Wheldon's screenplay doesn't beat about the bush; a rushed and frantic start ensures we know the who, the what, the where and the how after just 5 minutes. But not the why. This, along with the perpetual blood- letting, iconic horror film nods and laughs, is the question that drives the Cabin in the Woods to a barnstorming final third that borders on the brilliant and the daft, the ludicrous and the predictable. Jumpy in places, edgy in others, Goddard takes the style, form and ideas put forth by the likes of The Evil Dead, Scream and The Truman Show and runs with them.
In spite of its energy, though, The Cabin in the Woods doesn't pull up many trees. Goddard's given up a good and gory, almost spoof-like addition to the horror genre that brings to mind the likes of Raimi, Craven and Jackson but it isn't the "mind-blowing game-changer" some are making it out to be. The brunt of its class lies, if anywhere, in its tongue-in-cheek humour- away from the woods and in HQ; the oddball antics of Jenkins' and co. are pure gold and the part of the knowing stoner Marty (Franz Kanz) is a fresh and droll addition.
Goddard's piece of horror movie-making twists and turns a tad and is built on an array of interesting concepts but ultimately fails to leave the size a dent it perhaps could've left on the genre. His Cabin in the Woods is worth a watch for its zest and zane alone, though. Making it an absolute must for any horror film nut. Optional for everyone else.
Who's the daddy!?
Tzvetan Todorov's model of narrative equilibrium and the action film go hand-in-hand. Harmony, disruption, restoration. Simple. Enter Taken; Director Pierre Morel kicks things off with some good old fashioned scene setting. Subtle, delicate and about as ordinary as a Nicholas Cage film. Oh, and we're also thrust onto the side of his protagonist in the most ostentatious of fashions: exiled Dad Bryan (Liam Neeson) buys his daughter a karaoke set, step dad whips out a dashing white pony. Top that. But as far as negative criticisms for Taken go, I'm spent. A mundane start and structure doesn't conceal the fact that this is a stunning, high-octane fuelled action film with a freehold on the fast and furious, the tense and intense. Second-best to Bourne, perhaps, but more than a match for those that rest and revel in the action/adventure genre.
Bryan may've been cast into the shade by a prancing pony but he's one hard b*stard. A worn, torn, tried and tested retiree trying to make up for those lost years taxed by trade. A trade that annulled a marriage, divided a three piece family suite and rid Mills of any domestic respect he may've had. His line of work? Protection. Prevention. 007 kinda stuff; he was a first-class covert infiltrator for the U.S Government. Highly- trained, highly-skilled, highly- dangerous. So I suppose it's Mr. B*stard to you, then. Neeson's adroit and wrinkled visage tells us all we need to know from the outset. He's been there. Done that. Got the t-shirt. But when a clan of wily, woman traffickers "unexpectedly" up and off with daddy's little girl in Paris, the pension gets the boot and we have ourselves a movie. And a pretty good one at that: a part chase, part rescue, part action; adventure, thrill and redemption movie with verve, vigour and viscera. Archetypal? Sure. Taken throws up nothing new, but it is one of the best of its overcooked kind: sometimes heavy, sometimes cruel. Gritty in places, stylish in others. Clever in areas, conservative in others. It's a very well made film fresh from the minds and eyes that bought us the superb French thriller, District 13.
Co-penned, then, by Luc Besson and directed by Pierre Morel, Taken draws numerous and sometimes obvious likings to the Jason Bourne franchise; guerrilla styled photography, breakneck editing, fast cars, fast hands, state of the art tech', superior covert opp' crushing skull after skull. Bourne didn't know who or what he was, though. Mills does: a pensioned off, ticked off CIA hard nut without the rust and with plenty of thrust ("I will find you, and I will kill you!" ). For all its heart stopping scraps and tussles, takedowns, beatdowns, fist, gun and knife fights, Taken succeeds in mining our emotions and domestic qualms on an up-close and personal level. The empathy injection, although clichéd, works to the film's advantage. None of us could really relate to Bourne's mind state or predicament but with this- we kind of can. Whether it be as a father, mother, daughter or even tourist. Thus every grapple, pursuit, punch, shift, block, bullet, bob and weave has added intent and meaning. You'll be willing Neeson's Mills on through every horde of baddies as he plots and pummels his way to his daughter's aid.
It's Neeson who'll no doubt seize the plaudits, then. And why not. The acclaimed thesp' churns out yet another first-class performance as the determined, ageing action hero; proving once more that there's no role he cant take on without rendering both his own and convincing. Neeson's pin-sharp portrayal of Mills' means the character's not just his corny little girl's rock, he's ours too. The man's an exceptional actor. His Taken turn reiterates his kudos as one of the industry's finest.
As for the film itself? In terms of flat-out entertainment? It's the best since the Bourne Supremacy by a mile. Yes, I said Supremacy. Didn't go much on Ultimatum I'm afraid. But I'll leave that for another day. Anyway, Taken's energy, score and degree of grip factor are spot- on but it's in the cutting room where the film really excels. Sharp, swift, seamless: the action set-pieces are cut to near perfection: showing us just enough on occasion to evoke a grimace, gasp or sly snigger. Heads get slammed in car doors. Bones get crushed. Noses broken. Skulls fractured. Action film junkies: satisfied.
Taken is a solid all-round effort. Hardly flawless but all you could ever really ask for from a steely, high-concept adventure film.
American: The Bill Hicks Story (2009)
an honest and psychedelic fusion of art and artistry that lays bare the heart and soul of an idealist who, if he had lived, may have staged a revolution.
If you've never heard of Bill Hicks, I'm guessing you've heard of Muhammad Ali. That brash and forthright hero of boxing who was much more than just a sportsman; a social and political icon who through his actions, words and spirit, inspired millions. Though revered the world over and without a doubt "up there", Ali is seldom considered the best boxer ever. What's this got to do with the late stand-up comedian Bill Hicks? Well, he too may not have been the finest his medium had to offer, but he's certainly the most important.
In the first official documentary feature about his life, American is a stylish and moving experience that charts Hicks' physical and spiritual journey through the stand-up circuit, both off stage and on; his quest for success that would transform him from one of the brightest young talents in stand-up to the ranting, renegade genius whose mind-opening material went beyond comedy and changed it forever.
Made with the full cooperation of Hicks' family and friends, novice directors Matt Harlock and Paul Thomas have crafted an essential look into one of the most devalued and influential figures of the modern age whose unsung words of rage and wisdom still ring true over a decade on from his untimely death.
Though frank and sometimes vicious in his observations of American life and politics, Hicks is portrayed as a hopeless romantic; the ultimate patriot who believed in a better world. His was the voice his country needed, just not the one it wanted. Such was his domestic anonymity that the bulk of his praise ultimately came from the British public and media who, in the early 1990's, championed his hilarious, homespun satire and antisocial cynicism. What's not to like about taking the mickey out of Americans? The film's finale (an exert from one of his UK shows) is a heartfelt meditation on war and peace that defined what the man was all about, though. Hicks never hated his homeland, he just feared what it had become and thought it could do better.
There's more to this documentary than Hicks' fascinating work and ideals, though. A level of cohesion and humanity is found in the film's attention to detail regarding Hicks' estranged personal life; from his alcoholism and regular drug use to his lone life on the road and fatal date with pancreatic cancer. Hicks was also a talented musician and poet whose memoirs and music feature throughout the film in addition to oodles of unseen archival footage and stills from his shows and youth.
Despite a slow and sometimes repetitive opening, Harlock and Thomas' off-the-wall documentary is a fresh and thoughtful biopic; an honest and psychedelic fusion of art and artistry that lays bare the heart and soul of an idealist who, if he had lived, may have staged a revolution. Hicks told the truth about the way he saw the world and did so with such humour, such clarity and candour that it riled a lot of people. He inspired a whole lot more, though. His influence on stand-up comedy and comedy, in general, are there for all to see. Bill Hicks achieved something only terrifying artists do- he told us; this is how we live now. American is the quintessential portrait of his life. Unmissable.
The Woman in Black (2012)
If there's one thing horror movies have taught us, it's that ghostly old dears and kids are a recipe for new underwear.
30 years and several retools on from Susan Hill's now seminal pocket novel comes the big screen adaptation of The Woman in Black. Swapping the lingering, life-spanning impact of Hill's Dickensian book of the dead for a hollow yet effective house-of-horrors yarn that'll have you stirring in your seat- and out of it.
The film's set-up is more or less identical to the book but with a few baffling tweaks; Arthur Kipps (Daniel Radcliffe) is a solicitor and widowed father of one who's summoned to a remote town and manor on an eerie northern marshland where he's to settle the estate and will of a recently deceased old hag. Somethings wrong with the place, though. An ominous figure stalks and taunts and haunts the townspeople. A child falls whenever it is seen; a woman in black.
If there's one thing horror movies have taught us, it's that ghostly old dears and kids are a recipe for new underwear. And what do you know, The Woman in Black has them both in droves. All of which reside in a haunted, Victorian mansion in the middle of nowhere. The film charts Kipps' probe into the strange happenings from inside the damned estate in this simplistic yet effectual horror gem that's as playful and frightening as it is enjoyable.
As a stand-alone picture, director James (Eden Lake) Watkins' Woman in Black is as sound a horror of this ilk and purpose come; the haunted-house caper has been done to death then done again over the course of cinema's history. The Woman in Black is the best of its kind for quite some time. When measured against the book, though, it comes up short. Despite remaining faithful to its source through large parts and absolutely nailing the location, Jane Goldman's screenplay omits certain key scenes as well as the haunting bookends that made Hill's novel one the finest ghost stories of all time. Fans of the book will find it hard to fathom why these decisions were made. Maybe Goldman and Watkins wanted to stamp their own, uplifting mark on the tale. Shades of Kubrick's Shining? Not quite. I won't reveal what transpires in Hill's novel, but if the film had followed suite, it would've had greater substance and longevity.
Grafting Harry Potter onto its set-up ensured Watkins' film spun a profit before it hit a single screen. In an undemanding role that require Radcliffe tread cautiously and look scared, the boyish Brit does what's expected of him but fails to impress; to say he's believable as a father would be stupid. He isn't. If Radcliffe is looking to break free from his Potter persona, it's going to take a lot more than a 12A, British horror film to do the trick. Albeit a damn good one; the Evil Dead 2 a la Dickens without the gore, gut laughs and satire. Jumpy, jittery and fun. Yes, fun. The Woman in Black is by no means a black comedy but its clichéd set-up and slow-boiling pots of suspense are so well conceived and cooked you'll be scared silly and amused at the same time. Nervous laughter? You bet. Watkins' delays the unveiling of the shadow shrouded woman to the bitter-end but when we finally see the bitch, its no laughing matter.
Think The Shining without the depth. Think Paranormal Activity without the realism; a minimaliststic, nail-biting scare-fest primed for the big screen that joins the likes of The Others and The Village as well crafted mainstream horrors fit for young and old. See it.
Moneyball (2011)
Any Given Sunday without the testosterone: very well acted, scripted, shot and peppered with bouts of humour and heart.
It's pretty safe to say that what little knowledge us Brits have regarding major American sports like Baseball, Basketball, Ice Hockey and American Football tend to stem from cinema. These titanic past times that comprise a lofty part of US culture and identity just don't get the coverage they arguably deserve over this side of the pond. They're still more or less exclusive to our star spangled cousins who, to their credit, have actually given the world some credible films centred on their beloved four like Field of Dreams, White Men Can't Jump, The Mighty Ducks and Any Given Sunday. So what about Moneyball? Capote director Bennet Miller's rousing and inspired semi-biopic about a pivotal period in contemporary Baseball starring major league thesp Brad Pitt. Well, it's good. Very good, in fact. You could even go as far as saying it's a little bit special.
Nominated for six Oscars and based heavily on a true tale that unfolded around the early noughties, Moneyball is a character based docudrama that even those with zero Baseball knowledge can be taken in and moved by. Pitt plays Billy Beane, a former ball player who's now the haunted general manager of the Oakland A's; a cash strapped major league team who are down on their luck. They've just lost their final and most important game of the season and look set to lose their 3 best players with no financial gain as a result. Bean must now rebuild the team for the upcoming season with next-to-nothing in the way of cash and appeal. Despite resistance from his staff and the media, Beane enlists the help of a Yale educated economist (Jonah Hill) and begins to assemble a team of misfits based on stats, facts and figures and forever changes the way Baseball is played.
If, like me, you're unfamiliar with Baseball politics and procedures, a general manager answers only to the club's chairman and is required to broker deals and contracts for current and would be players. It's basically his job to pick the players that make up the squad. It's then down to the head coach and staff to field the team for a given game and implement tactics. Got it? Right, back to the film.
Despite revolving heavily around everything Baseball, the lasting impression Moneyball leaves is that it is more of an honest and thoughtful meditation on one man's desire to make amends and restore a level of personal pride and dignity. As the volatile Billy Beane, Pitt brings his A-game to the field and exhibits all the charm, wit, skills and natural talents that have made him one of the most diverse and commendable actors at work in Hollywood over the past 3 decades. When Pitt's not dabbling in conventional pieces of high-concept dribble like Mr. and Mrs. Smith and Ocean's Twelve, he can act up a storm and does so with Oscar- worthy ease in this: his latest and, perhaps, greatest pitch. His portrayal of the bitter and quirky general manager hell-bent on re-writing the rule book ranks easily amongst some of the 49 year old's best work. As a teenager, Beane was prematurely lured into the pro-leagues with promises of fame and glory. It didn't work out. Neither did his marriage. So, he turned to scouting in attempt to right wrongs.
Jonah Hill's assured, Oscar nominated turn as Beane's studious assistant is also worth a mention for this may signal a break away from the funny fat guy roles that have comprised the bulk of Hill's career so far. Make no mistake about it though, it's Pitt who steals the show in what some believe was "the" performance that should've bagged him that long overdue best actor gong.
Don't be fooled by the facade and grandeur of an underdog Hollywood sporting film starring an A-list star or two, Moneyball isn't your typical sports film. Think Any Given Sunday without the testosterone: very well acted, scripted, shot and peppered with bouts of humour and heart. You don't have to like Baseball or even sport to enjoy Miller's Moneyball. In only his third film, he has steered a total of 4 actors to Oscar nods now which is an impressive feat to say the least. His heartwarming spin on Steven Zailian and Aaron Sorkin's adapted screenplay deserves its place alongside both this year's best pictures and the all-time greats of character based sporting pictures.
The Thing (2011)
Question: how do you craft a stand-alone and worthy prequel to a seminal slice of horror movie-making without cocking it up? The answer: not like this. So well-made and accomplished was John Carpenter's eerie, Hitchcockian classic that a straight remake was and should never be on the cards. If you're going for a prequel then you're still on wafer-thin ice. One wrong move (eg- using the same title) and the cracks start to appear, a few more and it's goodnight Viena.
One or two neat tie-ins to its 1982 source aren't enough to warrant the new Thing's conception. The set-up and scenario are virtually like-for-like yet the taut, tense and claustrophobic tones that ran so rich throughout Carpenter's finest film just don't come to pass in director Mathjis Van Heigimgen's toothless Thing. It may as well have been a remake.
Yes, the SFX are an improvement (of sorts) but it's surprising just how well they still hold up in Carpenter's pre-CGI creature feature. Some of the greatest horror films ever made relied little on the quality and exposure of on-screen gore and ghouls (The Exorcist, Jaws, Alien, The Mist). Heigimgen obviously didn't care for these films. Consider Carpenter's Thing; the fear and impact conjured rests not just on the nail biting, paranoid set-ups but in the mystery surrounding the Thing itself. Where did it come from? What does it want? What the hell is it? And what the exactly happened in that Norwegian camp? These questions, though, need not be answered. But where there's money to be made, there's always room for stale movies that rest on the shoulder's of giants.
Granted, this prelude can be understood and even enjoyed by those with zero knowledge of the original. But for those who know better, this isn't the real thing. The tale takes place in a Norwegian research camp somewhere in Antarctica. It's 1982 and after unearthing an ice bound, shape shifting alien, a group of US scientists start poking it with sticks; it breaks free and reeks havoc. Picking off the camp members one by one on its way to supremacy. Sound familiar?
Gone to an extent, then, is the mystery surrounding the creature and the ravaged camp. This Thing is a daft rendition of Carpenter's sublime Alien in the artic tale whose only glimmer of class lies in its transitional ending credits.
Shelf this one with 2009's Predators and the other pointless retools of recent times. If this is a sign of things to come from prequels to timeless sci-fi treasures then Prometheus (Ridley Scott's highly anticipated prologue to Alien) is going to hurt. But with Scott at the helm and Michael Fassbender on board, there is still hope for a break in this banal trend.
In the Loop (2009)
probably the best and most original British comedy to hit the silver screen in years.
In the Loop is a cynical, laugh-out-loud docudrama-cum-comedy that tackles the "speculative" side of modern politics with piercingly funny and audacious dazzle and dialogue. Writer/director Armando Iannucci satirises and melds both the light and dark components of International relations and humour into an instant transatlantic gem of vivid one-liners and putdowns, characters and camera-work with Peter Capaldi at the cold heart of it all in one of the single most funniest yet frightening character performances I've seen in anything, anywhere, ever.
The film, itself, follows a fictitious assembly of foul-mouthed, sharp-tongued Government and State Department Officials, advisers, Secretaries and enforcers in their behind-the-scenes efforts to either promote or prevent the then impending war in the middle east.
Tom Hollander plays Simon Foster, a nervy yet humane Cabinet Minister who lands himself in a web of turmoil after publicly declaring the possibility of the UK and the US launching a war in the middle-east as "unforeseeable" only to contradict himself the following morning with a hilarious pro-war metaphor on live TV. Enter the PM's obstinate and shady communications chief Malcolm Tucker (Capaldi), an abusive yet hysterical press and political spin doctor who jets Foster and his assistant Toby off to Washington while things in London get smoothed over. In the Loop centres, then, on the aftermath of Foster's comments as both pro and anti war narcissists inside the US State Department treat him as a pawn in their fierce yet farcical tug of war as the "secret" opinion poll for military intervention in the middle-east draws near.
It's basically The Office meets Dr. Strangelove. It's probably the best and most original British comedy to hit the silver screen in years. It's a sublime political satire: a hyper-kinetic, feature-length spin-off of director Iannucci's award winning BBC sit-com (The Thick of It) that has all the energy, look and feel of a 30 minute episode and it's bloody brilliant. Hard to follow in places, perhaps, but more than enough chunks of comedy gold at hand to keep you glued until the plot becomes clear. Still not everyone's cup of tea, granted, but sufficient enough to wet the appetites of those who like (a) their politics, (b) their comedy black and sharp and ( c ) their films fast, smart and relevant to the now.
If truth be told, though, In the Loop is hardly an enlightening experience, it doesn't educate us on the cut throat world of politics- apparently it's corrupt and full of lying, egocentric gits- director Armando Ianucci and his team of talented screenwriters don't say anything we don't already know, then, but when a film's this funny and this good who cares!? Stand-out turns from Capaldi, Hollander and James Gandolofini along with a whole host of smartly scripted, paced and delivered dialogue make for one of the funniest films this country have ever produced. So get In the Loop.
(1) a block of flouting IRA captives staged a shocking blanket and no-wash protest in hope of obtaining POW status, (2) an on-edge prison guard and his colleagues beat and abused the insurgents silly and (3) protest chief Bobby Sands (Michael Fassbender) led a perilous hunger strike.
You may've gathered that the film's title is something of a double entendre, then. But how good is Hunger? The answer is simple; 'very'. In fact, I have no hesitation what so ever in branding it a masterpiece. This is a film that'll knock the breath clean from your lungs. Not because it makes Posh Spice look like a half-ton mum. Not because it makes Shawshank look like Disney Land. But because it's an extraordinarily grim yet breathtakingly brilliant blend of the harsh realities and nightmarish-like cogs in this stain on modern British history. A vision that's realised so vividly by Steve Mcqueen who is so assured, so meticulous yet fearless in both his filmmaking and direction that an array of emotions are invoked throughout the course of his somewhat impartial treatise on human spirit: anger, disgust, pity, shock, doubt, confusion, nausea, sorrow, respect- you name it, you'll feel it.
Hunger isn't what you would call 'easy viewing', then, and it will divide viewers on the grounds of both its subject matter and imagery but so did the likes of say The Passion of the Christ, Fight Club, The Exorcist, A Clockwork Orange and Irreversible- all divisive, all effective, all triumphs. So I guess Hunger's just another case of 'cinematic marmite'- Mcqueen leaves little room for a middle ground. You'll either love this one or hate it. I mean, one scene shows a janitor sweeping pee and bleach towards the camera for 2 minutes. Another shows an inmate smearing his own sht into the wall, a third: someone jet- blasting it off. Shall I go on? No? OK, I'll stop, but expect no such mercy from Mcqueen who pulls no punches in his portrayal of both the jailed and the jailers. How true to the facts he is in his depiction may never be known but Hunger still looks and feels excruciatingly real. Almost too real: Mcqueen shoots with unflinching clarity and class. The scene where we're first introduced to Bobby Sands as he's hauled out of his cell for a wash is so viciously lifelike that you can virtually feel the blows inflicted on his body. These kind of scenes really infiltrate the film and are incensed by yet somewhat neutralised in the more drawn out, dream-like sequences. Mcqueen adopts a thorny, staccato like approach to storytelling that finds a kind of bent cohesion in Joe Walker's delicate editing.
It would also appear evident that the first-time director doesn't consider neither an omnipresent score nor a large amount of dialogue necessary. And why should he!? Actions speak louder than words, or so the saying goes, yet some verbal explanation is needed after 40 minutes or so of pure unpleasant imagery and a vindication, of sorts, arrives a bit belated but in some style: a single, 18 minute stationary shot of Sands and a republican Priest (Liam Cunningham) discussing the sense and morality behind the impending hunger strike. This, for me, is the film's as well as Fassbender's crowning moment. It is in this scene that we learn all we really need to know about Sands- the flawed revolutionary and Sands- the man (what follows is one of the single most finales I've ever seen in cinema). Like the rigid Priest, you too have to question Sands' sanity and judgement considering what he and his fellow prisoners have been through. The sheer intensity of their fortitude cannot be ignored, though.
That said, Hunger doesn't really force us into taking sides. It doesn't ask "Hey, who do you think was in the wrong?" No. If there's a question the film throws up it's "in the end, did it really matter!?" Mcqueen doesn't glorify the IRA. He doesn't back Thatcher's Britain nor does he render Bobby Sands a martyr. He simply shows that when an unyielding spirit meets an immovable object, when one man's right meets another man's wrong, when doctrines dissolve into all out war, people will die: lunacy will, in time, prevail and there will be no gain, only casualties.
Hunger is a film of such terrible beauty that you will sometimes struggle to look at and away from. Much has and will continue to be said about Michael Fassbender's intense and unwavering turn as the skeletal Sands but he's no more than a hefty stroke on director Steve McQueen's visionary- grey, green and bleak house canvas. Is it art? If not, it's what art should be. The fact that this is Mcqueen's first film will leave you reeling. You have to see this.
Public Enemies (2009)
Where's the HEAT?
It's hard to watch any Michael Mann film these days without feeling even the slightest of tendencies to measure it against HEAT- Mann's cops- versus-crims epic that stirred, stunned and starred a couple of 'alright' actors called Al Pacino and Robert De Niro. Ask any Mann fan what they consider his best film to be and they'll almost certainly come back with the aforementioned. Ask a stubborn film snob like me and I'll insist on The Insider. Anyway, whoever you ask, whichever Mann film you favour, the above-mentioned movies actually have a lot in common: superbly acted urban allegories with clear eyes about the importance of look, sound and feel. They're also comprised of great scripts, photography, sound, scores, half a dozen lens filters and rather memorable endings.
So, "where does this leave Mann's latest film?" I hear you ask. Well, not only is Public Enemies his finest since the quite brilliant Collateral, but it's reasonably akin to the above-mentioned movies in a variety of ways, especially HEAT. Public Enemies is a relatively well acted, well shot and scored US based action/thriller that's loaded with breathtaking shoot outs: it looks, feels and above all sounds pretty good. What's more, Mann's grafted A-list stars Johnny Depp and Christian Bale onto its set-up, employing vintage yet somewhat bare characterisation techniques to show the similar mind sets and emotions of cops and robbers. Having said that, though, Public Enemies lacks that (for want of a better word) 'zing' that made Mann's finest work just that. To rank his latest film amidst his best would not only be generous, it would be wrong.
Pubic Enemies is an overlong, self assured film that has been drained of all depth and complexity to make room for some fast, profit- reaping commercialism and high concept. Spun from Bryan Burrough's equally titled book, the film tells the true tale of notorious bank robber John Dillinger (Depp), a charismatic, Robin Hood like maverick whose swift and graceful raids made him the number one target of J. Edgar Hoover's newly founded FBI and its chief agent, Melvin Purvis (Bale).
Back in a Depression ridden, 1930's America, Dillinger's name and antics held somewhat of an illustrious place in society. No cop could stop him. No bank could beat him. No jail could hold him. His magnetism and foolhardy prison breaks widened his appeal to almost everyone, from his girlfriend Billie Frechette (a superb Marion Cotillard) to a society who felt no compassion for the banks that had thrust their nation into a Depression. If only Dillinger and his band of crooks were among us now, eh? Anyway, the film is basically a far from extraordinary dramatisation of a particularly 'eventful' year in the life of a love- struck Dillinger with Purvis' bid to catch him acting as an omnipresent plot boost.
Pitting Depp against Bale, Public Enemies certainly harks back to Mann's metro' crime classics HEAT, The Insider and Collateral, yet, it ultimately fails to tap Bale's true potential. If there's any area that the film can be seriously accused of faltering in then it's in the sheer depth of Bale's forgettable supporting character: there isn't any. Depp is excellent, playing a tortured, bent kind of anti villain who, like De Niro's character in HEAT, has a heart, a dream and enough principles to steal the audience's sympathy. Bale is far less convincing, though- trapped inside a shallow, uninspiring role that begs to be explored. He does the best with what he's been given, yes, but I'm afraid the usually reliable Bale has been upstaged for the third film on the bounce by an actor who's just had more to work with. Ledger had the Joker. Worthington had Marcus Wright. And now Depp has Dillinger. I'm not even sure why Bale even went for this role. He's a side character at best. I found Marion Cotillard's character and performance far more interesting. Anyway, enough Bale bashing. Onto the film stuff.
Mann's hands-on approach to filming combined with Elliot Goldenthal virtuoso score and sound mixing are the film's underlying strengths. A modern sheen on 1930's styling is also brought to fruition but Mann and DP Dante Spinotti shoot and frame the locations in such a way that they ultimately fail to boast the same kind of presence the urban spaces did in their previous work. For me, Public Enemies does not reflect Mann's knack for transforming city and landscapes into screen characters. A few overhead shots, tracks or even the odd long shot or two would've been nice. Maybe even a tea-stained, saturated lens filter would've added a little more authenticity, a little more character. It sure did the job in that Francis Ford Copolla gangster film. I forget what it's called. Anyway, I guess I'm nitpicking, but when it comes to Michael Mann, when it comes to one of the most experienced visualists in the business, you expect better. The dark and largely sombre palette employed along with the cold, clear interiors certainly add to a detailed mise-en-scene that works well with a whole host of hand-held coverage but Mann's summer smash stirs in the shadows of his transfixing, urban masterstrokes and emerges a forgettable gangster caper.
Good: At times suspenseful, sometimes sensual and very well scored, Public Enemies is a decent yet unremarkable film riddled with remarkable gunfights. Mann's authorial traits permeate the plot throughout and his droll Cagney homage a la Stephen Graham was a very nice touch, but I guess Public Enemies belongs to Johnny Depp- if anyone.
Bad: The comparisons are there alright, but Public Enemies is no HEAT. Bale's talents all but go to waste inside a second-rate supporting role and the film, itself, is nothing more than a flimsy genre mash-up when weighed against the likes of, say, Scarface, Once upon a time in America, American Gangster and Miller's Crossing.
There's something familiar about Gavin O'Connor's latest film, Warrior. I can't quite put my finger on it. I mean, its a gritty underdog tale about second chances and punching people in a ring for pride, love, cash and redemption. It's also set in and around Philadelphia and features a growling old trainer, sweaty brutes, a training montage and a bunch of rousing scenes that'll send chills down your spine and tears down your cheek. If you're yet to fathom what I'm getting at, Warrior resembles that old 1970's classic Rocky. A truly unforgettable film that very few people still have on their "to see" list yet the unfortunate catalyst to countless amounts of barrel-chested fighting films that were just not worthy of John Avilsen's Oscar winning rock. Bloodsport, Kickboxer, Split Decisions, Fighting, Never Back Down, Best of the Best, the list goes on and on and on. All jokes aside, Warrior should fall into that category with consummate ease. It should be a superficial, clichéd piece of trash. It should be a terrible film. But it isn't. Not by a long shot.
The film tells of three men. Each solitary tale contributing to one story about forgiveness and family. Troubled US Marine Tommy Riordan (Tom Hardy) turns up on his father Paddy Conlon's (Nick Nolte) doorstep after 14 years away. Turns out the old man was something of a woman- beating drunk back before he found God and went sober. Tommy gave up a promising career in professional wrestling to run away from dad with mum in his early teens: nursed her, buried her then joined the core. Now he's back and after decking a top- middleweight contender in the local gym, he has a chance to fight in SPARTA: the biggest mixed-martial-arts (MMA) tournament in history with $5million up for grabs. Tommy needs a trainer. A prick his Dad may've been, but he always was a good trainer.
A few hundred miles down the road is Tommy's older brother Brendan (Joel Edgerton). A physics teacher, husband and father of two who also has a beef with dad. Brendan's also broke and facing foreclosure if he doesn't come up with some big money in the next 3 months. Before he got into teaching, Brendan was an average MMA competitor who failed to make it big and packed it all in to be with his wife and kids. He still does a bit of midnight brawling on the side though. And after an amateur circuit win in a grubby parking-lot tournament, Brendan wants a shot at SPARTA. No points for guessing who he's going to run into.
Predictable Warrior most certainly is. A modern-day Rocky counterpart it very nearly is. Masculine? Yes. Fantastical? Yes. Warrior is almost mythical in stature: a torn-apart family tale that's nothing short of a Greek tragedy. David takes on Goliath, there're nods to Moby Dick, the unbeaten ancient Greek wrestler Theogenes and.....Beethoven?? Oh, and the winner-take- all tournament is called SPARTA. If it wasn't for Ridley Scott and his 1999 classic, Warrior probably would've been called Gladiator.
The reasons why Warrior earns its place amidst the heavyweights of combat orientated pictures like Rocky, Raging Bull,The Champ and The Boxer, though, are threefold: 1) Subplot- the three mens' tragic past and present family tale is a bitter affair rife with pain and emotion that emerges more important than the in-ring rucks and bucks, 2) Fight scenes- they're brutal, breakneck and utterly convincing, 3) Acting- its some of the best you're ever likely to see in a mainstream film. Tom Hardy turns in yet another imposing, multi-layered performance as the muscle-bound, tormented Tommy: a ferocious and vengeful runaway who for all his muscles, tats and ass-whoopings emerges a vulnerable man haunted by those who've done him wrong. Australian born Edgerton is also excellent as the determined and likable underdog Brendan. Both Hardy and Edgerton do themselves proud inside two physically demanding, all- American roles. Nick Nolte, though, is a revelation. His grumbling turn as the guilt-ridden, recovering alcoholic trying to make amends is worthy of a thousand Oscars. Director O'Connor claimed the part was literally written for Nolte who gives a career best performance at the age of 71. One scene with Nolte and Hardy, in particular, will have the hardest of blokes reaching for the Kleenex.
It's not all about feuding families, though. Warrior is the first film to explore the ever- growing sport of MMA with the level of respect and realism it now deserves. Gone are the days of no-holds-barred cock- fighting in cages. MMA is now a disciplined, sanctioned tactical combat sport with seasoned athletes and weight-classes. Some say it could eclipse boxing someday.
Once the final bell has sounded, though, MMA is nothing more than a backdrop to which Warrior is so brilliantly set against. It isn't really about MMA, winning, losing or two men slugging it out for cash and the mantle of world's hardest bastard. Its about pride, honour, redemption, family and love. Rocky-esque? Of course. The final scene in particular will have those same hard nuts reaching for the Kleenex...again. Warrior is worth a watch for the acting alone.
Films about boxing and boxers have been done to death and done again. The likes of Rocky and Raging Bull are the films against which all of their kind have to measure themselves against. That's why its refreshing to see films like The Wrestler, Redbelt and now Warrior step into the ring with something just a little bit different albeit familiar. Believe the hype. This one's a winner.
"You don't need to know the route." states a mysterious figure down a phone while standing in the window of some trashy L.A motel room. "You give me a time and a place, I give you a five minute window. Anything happens in that five minutes and I'm yours. No matter what. Anything happens a minute either side of that and you're on your own. Do you understand?" What follows is a slick yet savvy getaway drive handled by the film's nameless and soon to be iconic hero (Ryan Gosling). This edgy prologue is rounded off by the word "Drive" scrawled across the screen in fluorescent pink to the thumping sound of some electro eighties throwback track. The opening credits role and so begins the coolest film of 2011.
Director Nicolas Winding Refn revs up the romance in this retro metro, neo noire reverie. Drive is an instant cult classic and a career defining film for both Refn and lead man Gosling: measured, memorable and ultra violent. A modern day Taxi Driver with shades of Memento and like a 1970's Scorsese, Winding Refn appears to be a cut above the current crop when it comes to producing compulsive indie pictures with a semi-mainstream lure. In the hands of a lesser director, Drive could've had the facade of a straightforward, pedal to the metal Hollywood action flick. Instead, it has the look, sound and feel of something familiar yet somehow different: the heart and soul of a esoteric European art-house film in the guise of a romantic, idyllic American b-movie. There's a guy, a girl, gangsters, guns, chase scenes, heroes and villains. And Ron Pearlman. And what can only be described as an "epic" soundtrack. "The studios wanted me to use more western, 'radio friendly' music with guys like Kayne West" snarled Refn in a recent BBC interview, "which proves they don't know what the hell they're talking about." Amen.
Make no mistake about it, Refn's unruly rendition of James Sallis' noire novel is his own kind of movie. It's not one for the low-brow, dumbed down Hollywood crowd. Nor the squeamish. He's done it his way. This is a character driven tale of good vs. evil and not necessarily the power of love, but the idea of love. The near inaudible relationship between Gosling's driver and the beautiful Irene (a radiant Carrey Mulligan) is more spiritual than physical. It forms the basis of the plot and is simple enough: Gosling's enigmatic mechanic (who's something of a beast behind the wheel) strikes up a bond with neighbour Irene and her young son Benicio. A surrogate dad appears to be on the cards but then jailbird bio-dad shows up and derails the dream. He owes money and favours to the wrong kind of people. They want him to handle a heist for them. Dad needs a driver. You can see where this is going. The job goes tits up and our driver goes to great and gory lengths to protect his new found loves. Escapism. Fantasy. True Romance. Take your pick.
Drive is a subtle yet savage masterstroke. A pure dream and Refn's most accomplished work to date and surely Gosling's signature role. He is to Drive what Eastwood is to Sergio Leone's Dollar westerns. A deep and ever present anti hero with a badass wardrobe who just has that look about him. He needn't say much. He needn't say anything. But when he does its compelling. Much like the film itself.
Bronson director Refn's recurring urge to explore complex characters with psychotic, ultra violent tendencies to the sound of some killer tunes invite comparisons to not just Scorsese but Tarrantino. Drive is, after all, a cool genre cocktail riddled with crime, revenge, suspense, death and love that's clearly inspired by styles and eras gone by.
Ryan Gosling's measured turn affirms his brewing reputation as one of the most gifted leading actors in modern cinema. Expect more from him. Expect more from Mulligan, Refn and expect to hear a lot more about this absolute gem of a film for many years to come. See it.
X: First Class (2011)
a loud and proud preface with balls and brains to spare.
First class by name, first class by nature, this explosive chapter in the wilting X-Men film anthology is not just the best of the bunch by an absolute mile, it's also a complete game- changer. Following the abysmal Last Stand, it couldn't get much worse for mutant buffs. Then it did; the awful Wolverine origins tale of rise and maul was a daft and rushed affair rife with flaws and frailties. It was the Batman and Robin of X-Men movies. Back to the drawing board, then; the failing franchise in desperate need of its Batman Begins.
Enter Kick-Ass helmer Matthew Vaughn and co. with a heady and rousing cold-war embroiled script charting the genesis of the original mutant coalition lead by then chums Charles Xavier (James McAvoy) and Erik Lehnsheer (Michael Fassbender). Before they were worn, sworn enemies and answered to Professor X and Magneto, the two forged an elite class of mutants to help bring down a band of baddies hell-bent on sparking World War 3. X-Men: First Class chronicles the events that made the early-day mutants X-Men fans know and love and love to hate while shedding light on some unfamiliar faces like nasty Nazi Sebastian Shaw (a dastardly Kevin Bacon) and the seductive Emma Frost (January Jones).
Featuring a horde of nods and groundwork to what lies ahead in both the comics and films, Vaughn's vision is an action-packed and highly satisfying benchmark in superhero cinema. Yeah, yeah, Chris Nolan's Batman renaissance may be the bee's knees but to class it in the superhero niche with the likes of First Class would be wrong. OK, they're both inspired renewals of mainstream material with top-class acting but ask yourself this; would you see a submarine being plucked from the sea by a magnetic man in a Batman movie? Exactly.
Over-the-top First Class undoubtedly is, then, but that's not to say it's ridiculous in its scope and execution when its context is considered. Set in the sixties and amongst the paranoia surrounding an imminent nuclear war, the film's historical backdrop helps establish an air of fidelity despite being pure baloney. There is plenty viewers can relate and refer to; prejudice, friendship, love, loss, anger, revenge, Nazis, the Cuban missile crisis, war and peace.
The brunt of the film's class lies within its cast, though; both McAvoy and Bacon give exceptional and highly-convincing character performances inside their taut and tailored roles but it's Michael Fassbender who owns all. Complex, tortured and conflicted to the core, who better to take on the vengeful Holocaust refugee than the intense and immense method man. The German born thesp of Irish descent turns in yet another absorbing performance of great concentration and great effort. His measured turns in the likes of Hunger, Fishtank and Inglorious Bastards ensured he earned the praise and respect of film buffs but seldom that of the mainstream. Until now. With this film and this performance, Fassbender can no longer be ignored. He could well be the best thing to happen to big-screen acting since Christian Bale. Expect more from him. It's rare for a film of this ilk be praised for its acting. Without it, the emotional impact and poise of key scenes would be lost. It's the best the action/adventure genre has had to offer since, you've guessed it, The Dark Knight.
X-Men: First Class is a spectacular slice of high-octane, globe-trotting cinema and is nothing short of a revelation that action film fans and X-Men nuts should ready themselves to marvel at; a loud and proud preface with balls and brains to spare. Add to that a chic and pulsating score, a wry Hugh Jackman cameo and the urgent need for a follow-up and you're left with two words. You know what they are; first...class.
A film about a sex addict in NYC sounds like a banal Rom-com starring some A-list heartthrob like Ashton Kutcher or Gerard Butler. Well, Steve Mcqueen's Shame couldn't be further from that stomach-churning premise. The Brit director's sombre morality-play about a sex pest in the city is a bleak and intriguing affair; an unflinching character study about a detached introvert that'll bore many, immerse few. Make no mistake about it, this is one for the independent and art-house purists who appreciate fine film-making and damn good acting.
Shame tells of Brandon, (Michael Fassbender) a self-consumed sex addict whose perverse private life reaches a crossroads when his idle sister Sissy (Carey Mulligan) shows up on his doorstep and begins to meddle and annoy.
In spite of his success, charm and rugged good looks, Brandon is a hard (no pun intended) and isolated man incapable of forging a meaningful relationship with somebody, anybody. The fact Shame is set in Manhattan is far from coincidental; it underscores Brandon's anonymity and loneliness as a person. This is sex and sex addiction like you've never seen on screen before; complex, sobering, shameful and destructive. Sexual healing can go fudge itself.
Once again, the intense and immense Michael Fassbender is highly-convincing inside a very.....difficult role that requires a great deal of patience and restraint and balls for that matter; strolling around on screen with them out, taking a slash and performing an array of explicit sexual scenes can't be easy but where there's method, there's Fassbender. The ever- impressing thesp' does his director proud; going the distance for Mcqueen once more and bagging himself an Oscar nod in the process.
Carey Mulligan is also superb as the suicidal Sissy. Outgoing, dramatic, needy, she's the complete opposite of her big brother but his saviour nonetheless. Her erratic and, at times, spellbinding performance is by far the best of her career thus far.
Then there's Mcqueen; the gifted and fearless director of Hunger whose approach to film making is as bold and as beautiful and as it is challenging and technical. The man loves his prolonged stationary shots and employs them to lingering effect throughout, allowing Fassbender and Mulligan to ad-lib and feel their way through scenes in pursuit of total realism. Mcqueen also opts for what can only be described as a majestic tracking shot in one scene where Brandon flees Sissy's company in the way of a metaphorical run. In only his second feature, Mcqueen achieves a balance between the two main adjectives all directors and authors care about; "unique" and "brilliant". Here, he has a freehold on both of them; the sheer thought and attention to detail behind each and every shot is remarkable. From the potent close-ups of Brandon pressed against a grimy train window to moody, single takes of him doing his business.
Shame is by no means the first film to look at sex addiction in modern cinema. Chuck Palahniuk's novel Choke was adapted into a droll and enjoyable indie satire some 4 years back but it's hard to compare the two. They differ in both genre and approach; Shame being the unprotected half of the two in its honest depiction of two siblings bound by pain and torment. Its climax is a telling and unforgettable one; abrupt, daring and open- hopeless in the eyes of some, uplifting in the eyes of many. Mcqueen and Fassbender's last tango in Manhattan may not be as powerful as their first collaboration, but it certainly doesn't fail to stir or impress. In a word; shameless.
Set against the sun-starved suburbs of northern Adelaide, Snowtown is an unflinching look at the sordid underbelly of Australian life and crime that rejects common sentiment despite delving into a much chartered niche in Australian cinema: the gritty, crime fuelled drama with something to say.
First time writer/director Justin Kurzel's bleak, brutal and bloody nasty rendition of the notorious Adelaide killings is certainly a step up in class from last year's overrated Animal Kingdom and although his work fails to rank amidst seminal Aussie films like Romper Stomper and Chopper, Snowtown is a harrowing, hand-held drama of considerable patience, poise and impact that deserves attention.
Shot on a shoestring budget and based on true events, the film follows 16 year-old Jamie (Lucas Pittaway), a troubled teen who becomes involved with his mum's "welcoming" new lover John Bunting (Daniel Henshall): the hateful head of a self-governing, self-righteous group of neighbourhood watchmen who would go on to commit a string of heinous murders that would shake Australia to its very core.
The similarities to Animal Kingdom, then, are obvious; a mislead, partially moral teen gets caught in a morose web of communal crime and killings. Snowtown has a look, sound, setting and feel akin to its crime-based predecessor yet somehow emerges a far more chilling, absorbing text.
The restrained and multi-layered performance of Lucas Pittaway brings to mind the work and aura of a young Heath Ledger and despite Daniel Henshall's forbidding and intense portrayal of the bearded Bunting, it's Pittaway's turn that steals the show in this grim and fearless affair of the tense and the intense; of hate crime, malevolence and a descent into evil and all out madness.
First degree murder, drug use and poverty aside, a host of challenging themes are also thrust to the fore and shot with unflinching clarity and realism. Paedophilia, rape, sodomy, animal cruelty and sadism all fall under the microscope. One particular scene featuring a stop/start strangulation of a local victim is nigh on impossible to watch. Its also worth noting that a great deal of the facts and details regarding the actual events were omitted from Justin Kurzel's script as they were deemed too distasteful by the Australian Film Council.
Snowtown is a slow-boiling and ultimately shocking experience that'll unnerve even the most robust of film fans. It is an unforgiving film. As bold, real and as harsh as they come. It's not for the feint of heart. Do not expect to be entertained or even excited by this one. That's not its intention. That's not its purpose. This claustrophobic docudrama merely casts a callous eye over an irrefutably dark period in Australia's history that follows the likes of Animal Kingdom and the stirring Martha Marcy May Marlene in its sombre depiction of a young and mislead soul in torment.
Chronicle (2012)
Marmite. Garlic. Brussels Sprouts. Don't worry, you're in the right place; this is a film review. Why the hell has it began with a list of disgusting foods- you ask? Well, that's the point. To many, they're actually delicious. Even sprouts. You simply either love 'em or hate 'em which, consequently, brings us to Chronicle. First-time director Josh Trank's low-budget sci-fi spectacle that bolts itself to the vexed Blair Witch-ish notion of "real" documented footage. The reasons to love this kind of style are actually reasons to hate; raw, course and tangible filmmaking that blends truth with trickery. Sucking the viewer into the plot whether they like it or not, spitting them out at the end all shaken and stirred. While some revel in the tremulous, hand-held realism conjured by the cast and crew, others detest; dismissing the concept-cum-gimmick as mere nauseating crap. Example? Cloverfield. Another? Paranormal Activity. One more? Troll Hunter. Chronicle, then, will enthral just as many as it'll appal.
Given the ultimate success of certain hand-held films across a range of genres, it was only a matter of time before someone had a go at a superhero flick in a docudrama disguise. Trank's directorial debut chronicles the events of three high school friends who gain telekinetic-like superpowers after stumbling across a mysterious crystal-like-thing. Soon, though, they find their lives spiralling out of control as the cameraman and would-be baddie of the trio starts to embrace his darker side.
In an era where we're documenting our every thought, mood and action, updating our Facebook status' and flushing all sorts of crap down Youtube, anybody can chronicle their day-to-day life, anybody can make a movie. It also appears that any production company can put up the cash to pretend to make a low-budget, indie film. With its sterile, static twitching camera concept and staggering effects, Chronicle falls somewhere in-between the three. It's a product of its time; an immersive and enjoyable experience blaring with cinematic shock and awe with humour to spare.
The everyman acting of the unknown cast instills enough empathy and flat-out realism to make the super power servings palatable. Chronicle all but makes the unbelievable believable. A rare feat, indeed, in modern-day fantasy film obtained only by the likes of Christopher Nolan and the cream of the discovered footage crop. Yes, teens do play pranks, bend metal and move cars with their minds and take to the skies from time to time. Our main character's subjection to domestic abuse and high-school bullying along with his terminally ill mother and punch-drunk dad brings Chronicle crashing down to earth, though. But not for long. Trank counteracts this dark subtext by ramping up the voltage and the laughs, the fireworks and the fantasy. His Chronicle is ambitious, immersive, subversive and boasts a barnstorming finale redolent of Akira. And like the seminal Anime classic, Chronicle is a revelation. Yes, it requires a certain predilection for found footage filmmaking, but it's hard not to marvel at the enterprise of such a well executed concept.
The fact little effort went into a lofty viral marketing campaign (or any sort of campaign for that matter) means Chronicle won't reap the initial hype and profits obtained by the likes of Cloverfield at the box-office. Which doesn't make much sense given the film's demo-graph. But with its pending DVD/Blu Ray release, sales and idle talk should sky-rocket in Josh Trank's favour. Whatever happens, Chronicle looks set to be a cult hit and possible catalyst to a league of sequels and spin-offs (which may not be a good thing).
Anyway, the last thing I want to do is to encourage you to see a film you may not like, but seldom do you see a mainstream-friendly film this engaging; this pioneering. It's absolutely brilliant and like all great movies, Chronicle is a rousing and fresh fusion of cinematic prowess and high-quality entertainment that breathes new life into a genre. Forget The Hunger Games. This is the new and exciting sci-fi saga we deserve. See it.
Coriolanus (2011)
Coriolanus will have Shakespeare enthusiasts chomping-at-the-bit, students scrambling for the exits.
A modern-day spin on one of Shakespeare's lesser known plays, Coriolanus is an ambitious and lyrical Greek tragedy that has everything you'd expect from the mind of the Bard; betrayal, revenge, pride, conflict, monologues, dilemmas, death- it's all in there. The only thing missing is a star-crossed lover or two.
Both its star and director, Ralph Fiennes follows past masters Laurence Olivier and Kenneth Branagh onto the breach in this doomy and demanding directorial debut that may signal a new and exciting direction for the steely-eyed actor.
Set in a city on the verge of collapse that resembles Tripoli but calls itself Rome, the film charts the rise and fall of general Coriolanus (Fiennes); a fiery soldier of war-torn Rome who earns his stripes in a bloody battle against an insurgent army lead by Turrus (Gerard Butler). In the aftermath of a brutal bullet storm and knife fight, Coriolanus emerges victorious and is branded the symbol of a new and prosperous empire. It doesn't work out. The decorated vet is more brawn than brains; his strong sense of pride coupled with the dirty work of corrupt bureaucrats and advisors lead to civil unrest and, in turn, a verbal attack by Coriolanus' on the people of Rome which results in his banishment from the city. Bitter, betrayed and hell- bent on revenge, the spitting outlaw seeks refuge and redemption in who else but his sworn enemy, Turrus.
Swapping the frantic razzmatazz of Baz Lurhmann's Romeo and Juliet retool for a far more gritty and paced approach, Fiennes has crafted a brave and bombastic drama that'll probably find its way onto a school curriculum or two before the year is out. And why not. His contemporary vision of a 300+ year old morality play is one awash with thought, feeling, values, complexities, politics and emotion- pure, unadulterated Shakespeare.
Coriolanus is far from the vision of just one man, though. Gladiator screenwriter Josh Lucas lays the necessary footing for Fiennes and Hurt Locker cinematographer Barry Ackroyd to bring the tale to life. Stirling support also comes in the shape of seasoned thesps Brian cox, Vanessa Redgrave, James Nesbitt and....Gerard Butler; all of which are new to big-screen Shakespeare yet convincing nonetheless. Even Butler.
The screen belongs to a raw and rampant Ralph Fiennes, though. More than just a noseless sorcerer, Fiennes is an exceptional actor and, now, promising director whose verbose and gung-ho approach from both behind and in front of the lens makes for a fascinating commitment. "Such is the work of a man". Olivier and Branagh would be proud. Coriolanus will have Shakespeare enthusiasts chomping-at-the-bit, students scrambling for the exits.
The Hunger Games (2012)
In a cinematic world of re-makes, re-imaginings and full-blown copies, it's inevitable to see a movie like The Hunger Games wallow in the limelight and hysteria of mainstream banality and post-Potter hunger simply because it's there. Adapted from Suzanne Collins' trilogy of teen- friendly novels, The Hunger Games looks set to follow in the well-off footsteps of Harry Potter and the soon-to-cease Twilight as the next big-money, low-brow saga for the GCSE bound masses.
This moderately engaging adaptation of Collins' first novel plays like a pre-teen spin on Battle Royale. Director Gary Ross shoots for a futurist-retro sense of uprising, endurance and wonder and in the eyes and minds of 11 year-olds, he's on target. There's plenty to behold, but little to absorb. Despite all efforts, The Hunger Games is starved of a character or scenario to really care about.
A hyped-up, cheesy and dumbed down treatise on human nature, spirit, freedom and TV culture, this is a badly-acted, action-crammed movie built on a much explored prophecy that's been residing in both literature and film for years; a nightmare dystopia in which society is slave to a tyrannical regime. But what do you know; there's a rebellion on the cards. And guess what? It's only lead by an unlikely yet inspiring hero. The Hunger Games is nothing new, then, but hold your horses; pitting 24 kids against one another in a game of death on a top-secret island is an original idea that's sure to evoke sympathy, shock and compassion. Isn't it? Well, maybe, but not if you know your films; not if you've seen Battle Royale.
A bloody slice of social satire with shock and awe to spare, Battle Royale was by no means the first to offer up a glimpse into an oppressive fictional world where people are forced to fight to the death. Sparticus, Running Man and even Gladiator all touched upon on this idea of enslaved cock-fighting for the "greater good" and fun of a bent society.
Suzanne Collins' tale may not be a rip-off of Battle Royale, but it is a blatant source. In director Ross' big screen retooling, The Hunger Games is set in a far from terrifying, post-war America whose totalitarian government get their kicks from a legislation born out of the ashes of World War III; each of the country's 12 districts are to offer up one young girl and boy every year to slog it out on live TV in a last-kid-standing tournament set on a virtual island. This; a sacrificial homage to a nation's thirst for blood and conflict. A punishment for an early, post war rebellion. A tribute to state power; The Hunger Games.
The film follows Katniss (Jennifer Lawrence), a steadfast teen who puts her life on the line when she volunteers to replace her younger sister in the upcoming games. What follows is a predictable tale of heroism and self-sacrifice as Katniss and clunky love interest Peeta (a wooden Josh Hutcherson) are wined, dined, trained and then hurled into a giant lion's den full of determined, blood-thirsty brats who are there to win, to kill. Will Katniss and Peeta fall in love? Will they both make it out alive? If not, will one of them be the victor? Do you care?
The Hunger Games is a self-assured, self-important piece of profit-reaping cinema whose potentially bleak and barbaric set-up cannot be realised through on screen peril, atmosphere, gore and violence due to its mild target audience. Alas, there is a lot of hand-held camera-work and rapid editing to cover up the scuffles, scraps, impact and blood. It doesn't work. Over-hyped and overdone; turns out it doesn't take much to tailor a totalitarian future concept for the modern-day youths; just strip it of all depth, complexity and darkness, throw in some weapons, some fire, a bit of romance and some heartthrobs and you'll be laughing all the way to the bank.
Antichrist (2009)
An eerie yet gorgeous tapestry of lingering close-ups; parallels, cuts and slow-motion photography, Lars Von Trier's Antichrist is a gruelling tale of mythical grandeur: a bizarre yet beautiful film chock full of sadism and shagging, Satanic dogma and similes. Most of which, I don't understand. So you'll be pleased to know that I have no intention of harping on about the director's bent meditation on gender, nature, genocide, motherhood, misogyny and astronomy. I find all that stuff interesting, don't get me wrong, but when things get Freudian I'm way out of my league. Therefore, I'll stick to what I know.
Albeit seething with emotion, Antichrist refuses to adhere to some of the general "rules" of the classical Hollywood narrative, meaning it lacks clarity, unity and closure. For example, there're only two characters, both of which remain nameless and have indefinite; pasts, motives and are somewhat difficult to identify with. The film rejects conventional morality. It is a difficult and uncomfortable experience that'll unnerve even the most robust of film fans. So if you like your films light, clear and conservative, stay away. If, however, you're a fan of, say, Nicholas Roeg's Don't Look Now, director David Lynch or you just dig a bit of alternative cinema, then brace yourself for a hugely demanding tableau that film critic Anita Singh of the Sunday Telegraph dubbed "the most shocking film in the history of the Cannes Film Festival." Willem Dafoe plays "he", a therapist and husband to "she" (Charlotte Gainsbourg), the female half of the cast whose line of work we never really learn. After a quite miraculous opening montage that juxtaposes the couple making love with the accidental death of their child, the embedded tale follows the pair as they flee to "Eden", their isolated cabin in the woods, where "he" attempts to aid a severely grief stricken "she" through her bereavement.
Book-ended by a masterfully conceived prologue and epilogue and split into four focal chapters entitled "Grief", "Pain", "Despair" and "The Three Beggars" (don't ask), the film takes on a ghostlike tone from the outset as the boundaries between the real and surreal become blurred. Alas, things get weird, edgy and very, very nasty. The sheer mass and rate of dense motifs and metaphors at hand regarding sex, Freud, the devil and the soul is a little overwhelming. Not to mention the force and intensity of both Dafoe and Gainsbourg's turns in addition to the film's strong, emotional undercurrent.
In spite of large and sustained periods of quite brilliant film-making, Antichrist contains some of the most violent and deplorable images ever committed to celluloid. For the ladies there's self mutilation. For the gents there's I, I, I can't even say it. Put it this way, it ain't good lads Anyway, add to the unthinkable gore a whole host of outlandish set-ups, half a dozen scenes of a sexual nature and one or two jolts in tone and you'll be scared silly. Remember- sometimes in cinema, you fear what you don't understand, especially when the camera is an unflinching eye inside the head of a disturbed, Danish poet. Lars Von Trier is an excellent filmmaker, but even his biggest fans will find it hard to swallow this, never mind stomach it.
Dedicated to the memory of legendary soviet filmmaker Andrei Tarkovsky, Antichrist is truly as haunting, delicate and poetic a film as you're ever bound to see. Though shrouded in scenes of unspeakable cruelty, the film eludes to the work of Tarkovsky in a big way: Von Trier's warped Adam and Eve parable is a moody, metaphysical affair cloaked in hypnotic, dreamlike imagery that calls to mind the likes of Mirror, Solaris and the brilliant Stalker. The trancelike photography; sound, score, and editing demonstrate a predilection for atmospheric, art-theatre sensibility. Tarkovsky would have loved it. This, after all, is a film that simply has to be seen to be believed. Not necessarily for its aesthetic grandeur, gore or technique, but for its harrowing portrayal of a soul in torment.
What's it all about? Who cares?! Antichrist is an unusual, atmospheric horror film that's guaranteed to provoke. The performances are honest and strong, the aesthetics are bold, the direction is brilliant and the outcome is something that is ultimately hard to come by these days: authentic film-making.
The Wrestler (2008)
Believe the hype- this one's a winner.
20 years or so ago, as the eighties dispersed into nothing more than memory- so to did the acting career of Mickey Rourke. A once glorious, once rugged young talent whose forthrightness got the better of him- landing the once promising, once striking up and comer a place on Hollywood's cold shoulder and a fruitless career in the Boxing ring.
A handful of decent comeback turns aside, Rourke has long been considered a lost and wasted talent who, given the right attitude, could've flourished and seized those early day likings to late greats' James Dean, Paul Newman and Marlon Brando.
Mirrored to an extent, then, is Rourke's chronicle by the character he plays (and how) in 'The Wrestler'- Randy "the Ram" Robinson. A weary, washed-up wrestler. A has-been. A nobody. A nostalgic, runaway father who lives and breathes his in-ring pseudonym. Back in the mid to late eighties, Randy was a star. Now, 20 years on, he's a loner. A mountain reduced to a mound. A champ turned chump. When he's not roaming the rings of the weekend amateur wrestling circuit, he's pumping iron, shooting steroids and hauling ass at the local deli.
All in all, Randy's a nice guy: likable, easy going and even Christ-like but after suffering a serious heart attack, the inevitable bad news is dealt: wrestle again and you could die. Now- Randy has a choice to make: go on living the only life he knows or get moral and stage one last crack at righting his wrongs: patch things up with his daughter and settle down with his favourite stripper.
The role of Randy is perfect, then, for Rourke. Not only does it give the 52 year old a shot at "the" lead many have been aching to see him grapple with for years, but it also allows him the substance and space to churn out the performance of his life. Beneath his unsightly exterior still stirs the wit, charm and dazzling panache that once promised so much. Mickey Rourke is, perhaps, the only actor out there who could approach this hearty part with the means, motives and memories to draw upon so effortlessly. For Rourke, this is a crossroads. A hairpin. A renaissance. A turn that sees the life of a wayward actor congregate with that of a fictional pugilist to summon something heartfelt, bona-fide and pretty dam special.
Directed by the visionary Darren Aronofsky, 'The Wrestler' is a moving and masterfully shot treatise on human nature and endeavour. The acclaimed cult director, whose former triumphs include 1998's cyber-surreal 'π' and 2000's stunning 'Requiem for a Dream', could be described as a dazzling mix of Davids' Lynch and Fincher with a generous pinch of Kubrick thrown in- and yet he is none of them. He's a budding maker of dense psychological dramas that centre on the self-seclusion of characters trapped inside their own bubbles of being.
Although considerably different in terms of visual style to Aronofsky's previous three features, 'The Wrestler' s a quite superb slice of American cinema that displays the 41 year old helmer's resourcefulness and new found maturity as a director. His 'Wrestler' is a smart yet simple tapestry of hand-held shots, moving cameras and tracks. Aronofsky's crafted an instant classic of the independent sphere that deserves attention. 'The Wrestler' is his most authentic film to date: a toned-down, slowed-down character piece with a big, brave heart.
Forget what you think you know about wrestling. This film is far a field from fake and a mere whisker from perfection. It's a morality-play, of sorts, but without the histrionic moralising and feel good summit that sugar coated this sport film to that. Yes, the proverbial blood, sweat and tears are there alright but this isn't a rewarding underdog tale or rags to riches yarn. This is neorealism. This is life: unfair, unfulfilling and un (bloody) reliable. Aronofsky drags cinema back onto the streets and hones in on reality. The nice guys aren't nice, they finish last and the 'heroes' keel over on their way to save the day. Yet, 'The Wrestler' emerges a flat-out winner: an often gritty, sometimes comical affair that fluctuates between the rough and the fine, the tough and the touching.
An unknown yet high-class supporting cast also come to pass- leaving nil to be desired which, ultimately, brings me back to Mickey Rourke who'll no doubt bare the brunt of the film's justifiable ovation. Darren Aronofsky steers his leading man towards a standout turn that could see the born-again thesp' land a fair few gongs this season. An Oscar?.No. I think Sean Penn's got that one sewn up but for such a question to prompt a pause for thought says an awful lot. Rourke is magnificent. Memorable, even, in this able all American gutter film that's going to give this year's best a run for their money.
Frost/Nixon (2008)
Where were the Oscars/BAFTAS?
Skilfully adapted by Peter Morgan from his own hit stage play, Frost/Nixon is an expertly balanced film that sees the playwright's screen tailored script combine memorably with two unfamiliar yet exceptional actors to give us one of the best and most gripping Hollywood dramas in years.
Child actor-cum-director Ron Howard has an Oscar winning flair for historical U.S bio-dramas and Frost/Nixon could well be his masterpiece. Predictable? Perhaps, but without a doubt his most charismatic and intelligent picture to date that uses a truly historical event to comment on current affairs.
If you want a modern-day sense of both the scale and importance of this 1970's political drama, then imagine Richard Hammond set loose on George Bush over a string of televised interviews and wringing out a confession over those wretched weapons of mass destruction. This, in essence, is what happened back in 1977 when chirpy British TV presenter David (Breakfast with) Frost (Michael Sheen) sealed a series of damning face-to-face interviews with fiery ex Prez Richard Nixon (Frank Langella). For three years after being forced from his presidential post over his involvement in the notorious Watergate scandals, Nixon remained silent. Officially pardoned yet publicly despised: unquestioned yet yearning for his chance to set the record "straight" and win back the hearts of the American people. So when fluffy TV funny man Frost comes along with a wad of cash and a team of 'crack investigators', baying for the ex-premier's blood, time and apology, Nixon sees his chance for a public-relations comeback. What follows is a compelling battle of wits and words between a budding TV talent trying to further his career and a shamed politician trying to justify his.
Peppered with actual footage and recordings and staged documentary-like interviews with the side characters, Frost/Nixon offers a dramatised yet authentic looking insight into the events surrounding the now legendary interviews, showing us the mentality, morals and interlocking back stories of both Frost and Nixon in the months and weeks leading up to their final showdown. The result is a dynamic duel to the death. A heavy yet light and ultimately moving affair chock full of high-quality movie moments that chill us to the bone; make us gasp, laugh and sometimes gape. A certain close-up of a rattled and wounded Nixon, eyes welled, head tilted- frozen, is up there with some of the finest and most potent pieces of cinema I've seen all year. It's a telling climax: time seems to stand still, there is complete silence, no words or score are needed- just damn good acting.
Reprising their roles from Morgan's prized play, then, are the quite brilliant Michael Sheen and Frank Langella. The latter, undoubtedly the film's crowning glory. The 71 year old plays the part of Nixon to shocking perfection. Each individual mannerism, tone and tick that set the slouched and slack cheeked politician apart come to quite excellent pass in a performance of great presence and great effort. As the forlorn yet droll Nixon, Langella gives one of the great leading performances of modern movie history but to say he outshines young Michael Sheen would be wrong. The unsung Brit sparkles as the beaming, coming-of-age underdog Frost in a buoyant, breakthrough turn that has to be regarded as a step up from his lifelike portrayal of a certain Tony Blair in Stephen Frear's The Queen. Both Sheen and Langella do more than hold their own against a subtle yet star studied supporting cast comprised by the likes of Kevin Bacon, Rebecca Hall, Oliver Platt and the priceless Sam Rockwell. Frost/Nixon is a very well acted film, a very well made film and, dare I say, a modern Hollywood classic in the making. See it.
Final Verdict: Ron Howard has crafted an inspired, thoroughly engaging political drama of rare value and class, time, place and intelligence. It would've been interesting to see what director Oliver Stone had in mind for a project seemingly destined for him but Howard's charm and knack for getting the best out of his cast comes up trumps in a way few could've foreseen. Langella and Sheen are dynamite. Where were the Oscars/BAFTAS?
Gran Torino (2008)
Would you cross Clint Eastwood when he's on a mission? Thought Not. The acclaimed screen vet' may've given up his guns for a different kind of shooter in recent years, but don't go thinking a fistful of treasured turns as a director has rendered the man soft. I still wouldn't mess with him. Would you? Thought not. But it's still fun watching a gang of punks doing just that in 'Gran Torino': Eastwood's first crack at leading the pack from both behind and in front of the lens since 'Million Dollar Baby'.
For me, Eastwood's reputation as a director rests not on his Westerns, not on his genre burying classic 'Unforgiven' or his thrillers but on his recent crop of human dramas: 'Mystic River', 'Million Dollar Baby', 'Flags of our Fathers', 'Letters From Iwo Jima', 'Changeling'- Not a bad string of films, I suppose, but what about 'Gran Torino'? Well, Eastwood plays rigid Korean War vet' Walt Kowalski- a grouchy, ominous old git who sets out to reform his gang hounded, east-Asian neighbour, Thao, after the teen's attempt to steal his trophy car (a vintage 1972 Gran Torino) runs afoul.
Drawn against his own will to get with the times and accept the company and race of those around him, Clint's Kowalski soon finds himself pulling back the hammer on his M1 rifle in the way only Clint can to protect his fellow neighbours from the hoods that plague their turf. "Ever noticed how you come across somebody once in a while," he growls, "somebody who you know shouldn't have messed with that's me!" Lucid shades of dirty Harry Callahan, cut man Frank and a wasted William Munny help paint Clint's obstinate yet august Kowalski, then. That unnerving, doll-like look in his eye still holds up. As does the by-gone icon's forbidding, set-to-be last on-screen turn as the hostile yet righteous martyr. Say what you want about Eastwood's age and overall range as an actor, he 'can' still carry a film.
There'll be no Oscar nods for acting, directing or producing this time around, though. Eastwood's 'Gran Torino' borders grand but it's not that kind of film; it's not 'that' good a film nor does it reach the heights of his previous five. Eastwood doesn't tell us anything we don't already know: the elderly are, by and large, blinkered; they hate kids and immigrants and retirement homes and often cling to their prejudices but, it's never too late to change. Whether you're good, bad or ugly, morality can upend bigotry. Age gaps can be bridged. One man can make a difference. We know all this. We've seen it all before. Yet 'Gran Torino' still makes for a pretty decent film, and watch for that matter.
Final Verdict: An engaging yet flaw flecked fusion of Clint Eastwood's love for the one-man-army action play and the human drama. Not his best, but still more inclined to the good than the bad, or the ugly.
| english |
<gh_stars>10-100
{"title": "Bayesian Matrix Factorization with Side Information and Dirichlet Process Mixtures.", "fields": ["sparse matrix", "matrix decomposition", "non negative matrix factorization", "collaborative filtering", "document term matrix"], "abstract": "Matrix factorization is a fundamental technique in machine learning that is applicable to collaborative filtering, information retrieval and many other areas. In collaborative filtering and many other tasks, the objective is to fill in missing elements of a sparse data matrix. One of the biggest challenges in this case is filling in a column or row of the matrix with very few observations. In this paper we introduce a Bayesian matrix factorization model that performs regression against side information known about the data in addition to the observations. The side information helps by adding observed entries to the factored matrices. We also introduce a nonpara-metric mixture model for the prior of the rows and columns of the factored matrices that gives a different regularization for each latent class. Besides providing a richer prior, the posterior distribution of mixture assignments reveals the latent classes. Using Gibbs sampling for inference, we apply our model to the Netflix Prize problem of predicting movie ratings given an incomplete user-movie ratings matrix. Incorporating rating information with gathered metadata information, our Bayesian approach outperforms other matrix factorization techniques even when using fewer dimensions.", "citation": "Citations (137)", "departments": ["University of California, Irvine", "University of California, Irvine", "University of California, Irvine"], "authors": ["<NAME>.....http://dblp.org/pers/hd/p/Porteous:Ian", "<NAME>.....http://dblp.org/pers/hd/a/Asuncion:Arthur_U=", "Max Welling.....http://dblp.org/pers/hd/w/Welling:Max"], "conf": "aaai", "year": "2010", "pages": -1} | json |
<gh_stars>1-10
#body{height:100%}
.logo{
width:100%;
height:30%;
}
.logo img{width: 100%}
.footer{
width:100%;
height:30%;
}
.footer img{width: 100%}
.nva{
width:100%;
height:20%;
}
.icon{
width:33%;
float: left;
}
.icon img{
width: 100%;
} | css |
{"envelope":{"headers":{}, "triples":[], "instance":{"info":{"title":"Patient", "version":"1.0.0", "baseUri":"http://example.org/"}, "Patient":{"CustomerID":514, "FirstName":"Marc", "LastName":"bron", "DateOfBirth":"1988-08-18", "Address":"Saint St", "Zip":"00613", "PhoneNumber":"256978019"}}, "attachments":{"CustomerID":514, "FirstName":"Marc", "LastName":"bron", "Address":"Saint St", "PhoneNumber":"256978019", "Zip":"00613", "DateOfBirth":"08/18/1988"}}} | json |
New Delhi, April 18: Dipa Karmakar, who became India's first woman gymnast to qualify for Olympics -- will receive the sports ministry's funding of up to Rs. 30 lakh under the Target Olympic Scheme (TOPS), it was announced on Monday. Dipa, who is an Asian bronze medallist, qualified in the artistic gymnastics event at Rio after collecting 52. 698 points in the test event. "Congrats Dipa Karmakar. By virtue of Oly qualification joins TOPS that entitles her 4 additional assistance of 30 lacs 4 customised training," the Sports Authority of India (SAI) wrote on Twitter. The ministry of youth affairs and sports (Department of Sports) has formulated the TOP scheme for identifying and supporting potential medal prospects for the 2016 and 2020 Olympic Games. Besides being the first Indian woman, Dipa will also be an Indian gymnast qualifying for the quadrennial extravaganza after 52 long years. The last participation by India in gymnastics at Olympics was way back in 1964, but during that time there was no qualification system in place. | english |
#!/usr/bin/env python3
"""
Author : <NAME> <<EMAIL>>
Date : 2021-10-04
Purpose: Rock the Casbah
"""
import argparse
import sys
# --------------------------------------------------
def get_args():
"""Get command-line arguments"""
parser = argparse.ArgumentParser(
description='Emulate wc (word cound)',
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('file',
help='Input file(s)',
metavar='FILE',
nargs='*',
type=argparse.FileType('rt'),
default=[sys.stdin])
return parser.parse_args()
# --------------------------------------------------
def main():
"""Make a jazz noise here"""
args = get_args()
total_num_lines: int = 0
total_num_words: int = 0
total_num_bytes: int = 0
for fh in args.file:
num_lines: int = 0
num_words: int = 0
num_bytes: int = 0
for line in fh:
num_lines += 1
num_words += len(line.split())
num_bytes += len(line)
print(f'{num_lines:8}{num_words:8}{num_bytes:8} {fh.name}')
total_num_lines += num_lines
total_num_words += num_words
total_num_bytes += num_bytes
if len(args.file) > 1:
print(f'{total_num_lines:8}{total_num_words:8}{total_num_bytes:8} total')
# --------------------------------------------------
if __name__ == '__main__':
main()
| python |
A free program for Android, by KUMA GAMES.
A free app for Android, by Marko Speed Cars.
A free app for Android, by Gameberry Labs+.
Free application for Android from Sberbank of Russia.
A free program for Android, by TeleStar.
| english |
<gh_stars>10-100
{"type":"Feature","id":"node/5806635840","properties":{"amenity":"vending_machine","operator":"<NAME>","vending":"milk","id":"node/5806635840"},"geometry":{"type":"Point","coordinates":[7.0889856,53.3560684]}} | json |
Don’t Miss Out on the Latest Updates.
Subscribe to Our Newsletter Today!
Guwahati, Oct 1 (PTI) A fresh wave of floods has hit Assam, submerging five districts and affecting 78,275 people, an official said today.
The north-eastern state, which was recuperating after several rounds of floods this year, again saw 306 acres of land submerged in the fresh wave. Nearly 16,000 animals and poultry had also been affected, added the Assam State Disaster Management Authority (ASDMA) official.
Rains across the state and in neighbouring Arunachal Pradesh and Meghalaya have caused flooding in the districts of Lakhimpur, South Salmara, Goalpara, Hojai and Karbi Anglong.
At least 86 villages in seven revenue circles had been affected by the fresh wave of deluge with Goalpara on the Assam-Meghalaya border being the worst-hit, an ASDMA report said.
As many as 41,479 people were affected in Goalpara, followed by 29,594 in South Salmara, it added.
The Dhansiri river at Numaligarh in Golaghat was flowing above the ‘danger’ mark, according to a Central Water Commission (CWC) bulletin.
The administrations of the flood-hit districts had set up 18 relief camps, where 9,994 people had taken shelter, the ASDMA said.
The State Disaster Response Force (SDRF) had rescued 30 marooned people from Goalpara, where an embankment at Khorija Manikpur was damaged, the ASDMA said, adding that roads and culverts were damaged at various places in the five districts.
The third wave of the devastating floods last month had claimed 76 lives, taking the toll in flood-related incidents in the state to 160 this year, including eight in the capital, Guwahati.
Chief Minister Sarbananda Sonowal has directed the deputy commissioners of the flood-hit districts to step up the rescue-and-relief operations and ensure a stock of adequate relief material for the marooned people.
He has also asked the deputy commissioners to ensure the availability of all the essential items at the relief camps, besides making all-out efforts to provide food, drinking water, baby food, fodder and medical help in the flood-hit areas, a government release said.
The chief minister has also directed the ASDMA to maintain a close coordination with the district administrations and extend all the support to them, the release added.
This is published unedited from the PTI feed.
For breaking news and live news updates, like us on Facebook or follow us on Twitter and Instagram. Read more on Latest News on India. com. | english |
{
"title": "Name an example of a category",
"description": "You must name an example of a type of category, such as a type of dog or an ice cream flavor.",
"keywords": "write,writing,category,example,examples",
"reward": 0.05,
"duration": 900,
"frame_height": 20000,
"max_assignments": 1
}
| json |
<filename>src/main/resources/assets/capabilityproxy/lang/en_us.json
{
"_comment": "General",
"itemGroup.capabilityproxy": "Capability Proxy",
"_comment": "Blocks",
"block.capabilityproxy.capability_proxy": "Capability Proxy",
"block.capabilityproxy.capability_proxy.info": "Access the target block capabilities from this block. The target block must be an immediate neighbour",
"block.capabilityproxy.entity_capability_proxy": "Entity Capability Proxy",
"block.capabilityproxy.entity_capability_proxy.info": "Access the target entity capabilities from this block. The target entity must be in the immediate neighbouring square",
"block.capabilityproxy.item_capability_proxy": "Item Capability Proxy",
"block.capabilityproxy.item_capability_proxy.info": "Expose the capabilities from the stored item via this block. The target side is only accessible for piping in/out the contained item.",
"block.capabilityproxy.ranged_capability_proxy": "Ranged Capability Proxy",
"block.capabilityproxy.ranged_capability_proxy.info": "Access the target block capabilities from this block. The target block is the closest applicable block within 16 blocks."
} | json |
<filename>linkprediction/prediction_methods/prediction/similarity_indices.py
from math import sqrt
from networkx import (
Graph, adamic_adar_index, common_neighbors, jaccard_coefficient,
preferential_attachment, resource_allocation_index, community,
shortest_path_length)
from .predictor import \
LinkPredictor
class AdamicAdar(LinkPredictor):
def predict(self, node_pairs):
predictions = adamic_adar_index(self.graph, node_pairs)
return list(predictions)
def __repr__(self):
return self.__str__()
def __str__(self):
return 'AdamicAdar'
class AdjustedRand(LinkPredictor):
def predict(self, node_pairs):
predictions = []
for node_pair in node_pairs:
uNeighborhood = self.graph.neighbors(node_pair[0])
vNeighborhood = self.graph.neighbors(node_pair[1])
uNeighborhood = list(uNeighborhood)
vNeighborhood = list(vNeighborhood)
intersectionNeighbors = list(common_neighbors(self.graph, node_pair[0], node_pair[1]))
unionNeighbors = set().union(uNeighborhood, vNeighborhood)
a = len(intersectionNeighbors)
b = len(unionNeighbors)
c = len(unionNeighbors)
d = len(self.graph) - len(unionNeighbors)
denominator = ((a+b) * (b+d)) + ((a+c) * (c+d))
predictions.append((node_pair[0], node_pair[1], 2*(a*d - b*c) / denominator
if denominator != 0 else 0))
return predictions
def __repr__(self):
return self.__str__()
def __str__(self):
return 'AdjustedRand'
class CommonNeighbors(LinkPredictor):
def predict(self, node_pairs):
predictions = [(node_pair[0], node_pair[1],
len(list(common_neighbors(self.graph, node_pair[0], node_pair[1]))))
for node_pair in node_pairs]
return predictions
def __repr__(self):
return self.__str__()
def __str__(self):
return 'CommonNeighbors'
class Jaccard(LinkPredictor):
def predict(self, node_pairs):
predictions = jaccard_coefficient(self.graph, node_pairs)
return list(predictions)
def __repr__(self):
return self.__str__()
def __str__(self):
return 'Jaccard'
class Salton(LinkPredictor):
def predict(self, node_pairs):
predictions = []
for node_pair in node_pairs:
uNeighborhood = self.graph.degree(node_pair[0])
vNeighborhood = self.graph.degree(node_pair[1])
intersection = common_neighbors(self.graph, node_pair[0], node_pair[1])
intersection = len(list(intersection))
denominator = sqrt(uNeighborhood * vNeighborhood)
predictions.append((node_pair[0], node_pair[1],
intersection / denominator if denominator != 0 else 0))
return predictions
def __repr__(self):
return self.__str__()
def __str__(self):
return 'Salton'
class PreferentialAttachement(LinkPredictor):
def predict(self, node_pairs):
predictions = preferential_attachment(self.graph, node_pairs)
return list(predictions)
def __repr__(self):
return self.__str__()
def __str__(self):
return 'PreferentialAttachement'
class ResourceAllocation(LinkPredictor):
def predict(self, node_pairs):
predictions = resource_allocation_index(self.graph, node_pairs)
return list(predictions)
def __repr__(self):
return self.__str__()
def __str__(self):
return 'ResourceAllocation'
class SameCommunity(LinkPredictor):
def __init__(self, graph, iterations: int = 1):
super().__init__(graph)
if iterations < 1:
raise ValueError('Invalid iterations value. It must be greater '
'than or equal to 1!')
self.iterations = iterations
def predict(self, node_pairs):
communities_generator = community.girvan_newman(self.graph)
for i in range(self.iterations):
level_communities = next(communities_generator)
predictions = []
for node_pair in node_pairs:
uCommunityIndex = self._getCommunityIndex(node_pair[0], level_communities)
vCommunityIndex = self._getCommunityIndex(node_pair[1], level_communities)
predictions.append((node_pair[0], node_pair[1],
1 if (uCommunityIndex == vCommunityIndex and uCommunityIndex != -1) else 0))
return predictions
def _getCommunityIndex(self, node, communities):
index = -1
for community in communities:
if node in community:
index = communities.index(community)
return index
def __repr__(self):
return self.__str__()
def __str__(self):
return 'SameCommunity'
class ShortestPath(LinkPredictor):
def __init__(self, graph, method='dijkstra'):
super().__init__(graph)
self.method = method
def predict(self, node_pairs):
try:
predictions = [(node_pair[0], node_pair[1],
shortest_path_length(self.graph, node_pair[0], node_pair[1], method=self.method))
for node_pair in node_pairs]
except Exception:
raise ValueError('Error during shortest path calculation. Probably'
', the method does not exist!')
return predictions
def __repr__(self):
return self.__str__()
def __str__(self):
return 'ShortestPath'
class TotalNeighbors(LinkPredictor):
def predict(self, node_pairs):
predictions = []
for node_pair in node_pairs:
uNeighborhood = self.graph.neighbors(node_pair[0])
vNeighborhood = self.graph.neighbors(node_pair[1])
uNeighborhood = list(uNeighborhood)
vNeighborhood = list(vNeighborhood)
predictions.append((node_pair[0], node_pair[1],
len(set().union(uNeighborhood, vNeighborhood))))
return predictions
def __repr__(self):
return self.__str__()
def __str__(self):
return 'TotalNeighbors'
class UDegree(LinkPredictor):
def predict(self, node_pairs):
predictions = [(node_pair[0], node_pair[1], self.graph.degree(node_pair[0]))
for node_pair in node_pairs]
return predictions
def __repr__(self):
return self.__str__()
def __str__(self):
return 'UDegree'
class VDegree(LinkPredictor):
def predict(self, node_pairs):
predictions = [(node_pair[0], node_pair[1], self.graph.degree(node_pair[1]))
for node_pair in node_pairs]
return predictions
def __repr__(self):
return self.__str__()
def __str__(self):
return 'VDegree'
class Sorensen(LinkPredictor):
def predict(self, node_pairs):
predictions = []
for node_pair in node_pairs:
uNeighborhood = self.graph.degree(node_pair[0])
vNeighborhood = self.graph.degree(node_pair[1])
intersection = common_neighbors(self.graph, node_pair[0], node_pair[1])
intersection = len(list(intersection))
denominator = uNeighborhood + vNeighborhood
predictions.append((node_pair[0], node_pair[1],
2 * intersection / denominator if denominator != 0 else 0))
return predictions
def __repr__(self):
return self.__str__()
def __str__(self):
return 'Sorensen'
class HubPromoted(LinkPredictor):
def predict(self, node_pairs):
predictions = []
for node_pair in node_pairs:
uNeighborhood = self.graph.degree(node_pair[0])
vNeighborhood = self.graph.degree(node_pair[1])
intersection = common_neighbors(self.graph, node_pair[0], node_pair[1])
intersection = len(list(intersection))
denominator = min(uNeighborhood, vNeighborhood)
predictions.append((node_pair[0], node_pair[1],
2 * intersection / denominator if denominator != 0 else 0))
return predictions
def __repr__(self):
return self.__str__()
def __str__(self):
return 'HubPromoted'
class HubDepressed(LinkPredictor):
def predict(self, node_pairs):
predictions = []
for node_pair in node_pairs:
uNeighborhood = self.graph.degree(node_pair[0])
vNeighborhood = self.graph.degree(node_pair[1])
intersection = common_neighbors(self.graph, node_pair[0], node_pair[1])
intersection = len(list(intersection))
denominator = max(uNeighborhood, vNeighborhood)
predictions.append((node_pair[0], node_pair[1],
2 * intersection / denominator if denominator != 0 else 0))
return predictions
def __repr__(self):
return self.__str__()
def __str__(self):
return 'HubDepressed'
class LeichtHolmeNewman(LinkPredictor):
def predict(self, node_pairs):
predictions = []
for node_pair in node_pairs:
uNeighborhood = self.graph.degree(node_pair[0])
vNeighborhood = self.graph.degree(node_pair[1])
intersection = common_neighbors(self.graph, node_pair[0], node_pair[1])
intersection = len(list(intersection))
denominator = uNeighborhood * vNeighborhood
predictions.append((node_pair[0], node_pair[1],
2 * intersection / denominator if denominator != 0 else 0))
return predictions
def __repr__(self):
return self.__str__()
def __str__(self):
return 'LeichtHolmeNewman'
| python |
<reponame>rizkhal/badaso-docs-1<filename>i18n/id/docusaurus-plugin-content-docs/current/customization/overriding-controller.md
---
docId: "customizationintro"
sidebar_position: 2
custom_edit_url: https://github.com/uasoft-indonesia/badaso-docs/edit/main/i18n/id/docusaurus-plugin-content-docs/current/customization/overriding-controller.md
---
# Overriding Controller
Setiap CRUD yang di-generate melalui CRUD generator akan menggunakan controller yang sama. Ada kalanya controller ini butuh penyesuaian, seperti penambahan logika yang tidak disediakan oleh Badaso.
Untuk kustomisasi, kita perlu melakukan override terhadap controller bawaan dengan controller baru, ada beberapa langkah yang perlu dilakukan, yaitu:
- Buat controller baru untuk digunakan sebagai overriding.
```bash
php artisan make:controller NewController
```
- Extends `BadasoBaseController` Class dan import kode kode yang diperlukan pada controller yang baru di buat.
```bash title="App\Http\Controllers\NewController.php"
<?php
namespace App\Http\Controllers;
use Exception;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Uasoft\Badaso\Helpers\GetData;
use Uasoft\Badaso\Models\DataType;
use Uasoft\Badaso\Helpers\ApiResponse;
use Uasoft\Badaso\Controllers\BadasoBaseController;
use Uasoft\Badaso\Helpers\Firebase\FCMNotification;
class NewController extends BadasoBaseController
{
// Add new method or override the existing method
}
```
- Berikut method yang bisa kita override.
- browse
- read
- edit
- add
- delete
- restore
- deleteMultiple
- restoreMultiple
- sort
- setMaintenanceState
Kita bisa cek lebih detail pada `vendor/badaso/core/src/Controllers/BadasoBaseController`
- Ubah controller pada CRUD yang ingin kita override pada "Edit related CRUD > Advanced Settings > Controller Name" dengan controller baru yang kita buat `App\Http\Controllers\NewController`

| markdown |
package seedu.address.testutil.expenses;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import seedu.address.model.expenses.Expenses;
import seedu.address.model.expenses.ExpensesAmount;
import seedu.address.model.expenses.MedicalExpenses;
import seedu.address.model.expenses.MiscellaneousExpenses;
import seedu.address.model.expenses.TravelExpenses;
import seedu.address.model.person.EmployeeId;
/**
* A utility class to help with building Expenses objects.
*/
public class ExpensesBuilder {
public static final String DEFAULT_EMPLOYEEID = "000001";
public static final String DEFAULT_TRAVELEXPENSES = "123123";
public static final String DEFAULT_MEDICALEXPENSES = "123123";
public static final String DEFAULT_MISCELLANEOUSEXPENSES = "123123";
private EmployeeId employeeId;
private ExpensesAmount expensesAmount;
private TravelExpenses travelExpenses;
private MedicalExpenses medicalExpenses;
private MiscellaneousExpenses miscellaneousExpenses;
public ExpensesBuilder() {
NumberFormat formatter = new DecimalFormat("#0.00");
employeeId = new EmployeeId(DEFAULT_EMPLOYEEID);
travelExpenses = new TravelExpenses(DEFAULT_TRAVELEXPENSES);
medicalExpenses = new MedicalExpenses(DEFAULT_MEDICALEXPENSES);
miscellaneousExpenses = new MiscellaneousExpenses(DEFAULT_MISCELLANEOUSEXPENSES);
double totalExpenses = Double.parseDouble(travelExpenses.toString()) + Double.parseDouble(medicalExpenses
.toString()) + Double.parseDouble(miscellaneousExpenses.toString());
expensesAmount = new ExpensesAmount(String.valueOf(formatter.format(totalExpenses)));
}
/**
* Initializes the ExpensesBuilder with the data of {@code expensesToCopy}.
*/
public ExpensesBuilder(Expenses expensesToCopy) {
NumberFormat formatter = new DecimalFormat("#0.00");
employeeId = expensesToCopy.getEmployeeId();
travelExpenses = expensesToCopy.getTravelExpenses();
medicalExpenses = expensesToCopy.getMedicalExpenses();
miscellaneousExpenses = expensesToCopy.getMiscellaneousExpenses();
double totalExpenses = Double.parseDouble(travelExpenses.toString()) + Double.parseDouble(medicalExpenses
.toString()) + Double.parseDouble(miscellaneousExpenses.toString());
expensesAmount = new ExpensesAmount(String.valueOf(formatter.format(totalExpenses)));
}
/**
* Sets the {@code EmployeeId} of the {@code Expenses} that we are building.
*/
public ExpensesBuilder withEmployeeId(String employeeId) {
this.employeeId = new EmployeeId(employeeId);
return this;
}
/**
* Sets the {@code Name} of the {@code Expenses} that we are building.
*/
public ExpensesBuilder withExpensesAmount(String travelExpenses, String medicalExpenses, String
miscellaneousExpenses) {
NumberFormat formatter = new DecimalFormat("#0.00");
double totalExpenses = Double.parseDouble(travelExpenses) + Double.parseDouble(medicalExpenses)
+ Double.parseDouble(miscellaneousExpenses);
this.expensesAmount = new ExpensesAmount(String.valueOf(formatter.format(totalExpenses)));
return this;
}
/**
* Sets the {@code Name} of the {@code Expenses} that we are building.
*/
public ExpensesBuilder withTravelExpenses(String travelExpenses) {
this.travelExpenses = new TravelExpenses(travelExpenses);
return this;
}
/**
* Sets the {@code Name} of the {@code Expenses} that we are building.
*/
public ExpensesBuilder withMedicalExpenses(String medicalExpenses) {
this.medicalExpenses = new MedicalExpenses(medicalExpenses);
return this;
}
/**
* Sets the {@code Name} of the {@code Expenses} that we are building.
*/
public ExpensesBuilder withMiscellaneousExpenses(String miscellaneousExpenses) {
this.miscellaneousExpenses = new MiscellaneousExpenses(miscellaneousExpenses);
return this;
}
/**
* Builds (@code Expenses) with required employee's variables
*/
public Expenses build() {
return new Expenses(employeeId, expensesAmount, travelExpenses, medicalExpenses, miscellaneousExpenses);
}
}
| java |
<gh_stars>100-1000
{
"name": "Sprites-as-a-Service",
"version": "0.5.0",
"description": "Generate 8-bit avatars using Cellular Automata!",
"author": "<NAME>",
"private": true,
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"build:gh-pages": "DEPLOY_ENV=GH_PAGES nuxt build",
"start": "nuxt start",
"generate": "nuxt generate",
"generate:gh-pages": "DEPLOY_ENV=GH_PAGES nuxt generate",
"deploy": "push-dir --dir=dist --branch=gh-pages --cleanup"
},
"dependencies": {
"@fortawesome/fontawesome-free": "^5.13.0",
"@nuxtjs/axios": "^5.3.6",
"axios": "^0.21.2",
"nes.css": "^2.3.0",
"nuxt": "^2.0.0",
"pattern.css": "^1.0.0",
"shorthandcss": "^1.1.1"
},
"devDependencies": {
"@nuxtjs/google-analytics": "^2.2.3",
"eslint-config-prettier": "^6.10.0",
"eslint-plugin-prettier": "^3.1.2",
"prettier": "^1.19.1",
"push-dir": "^0.4.1"
}
}
| json |
Click on EACH question to post/upload you answers.
How to Follow Secure Initiative?
How to Self-evaluate your answer?
arising out of their design and implementation.
Topic: Indian Culture will cover the salient aspects of Art forms, Literature and Architecture from ancient to modern times.
1) The art of storytelling through paintings reached its zenith during Mughal Period in India. Elucidate with suitable examples. (250 words)
Why this question:
The question is about discussing the prevalent art forms especially the paintings during the Mughal period.
Key demand of the question:
The question expects us to analyse how the art of storytelling was made relevant with the coming of painting styles during the Mughal periods in India.
Directive word:
Elucidate – Give a detailed account as to how and why it occurred, or what is the particular context. You must be defining key terms where ever appropriate, and substantiate with relevant associated facts.
Structure of the answer:
Begin with brief introduction on paintings during the Mughal period.
- Discuss the coming of storytelling through paintings in India – how it started, when and where – Story telling through paintings has been an established art form in India. We find many examples of Ramayana and Mahabharata depicted in the form of continuous paintings, for example in Patachitra of Odisha.
- Similarly, Jataka stories of Buddha are also found in paintings of Ajanta Caves in Maharashtra.
- Though this art form already existed in India, but Mughals with their rich colors and more realistic paintings took this art to its pinnacle.
- Then move onto explain Mughal era paintings and their significance.
Conclude with importance.
Topic: Government policies and interventions for development in various sectors and issues arising out of their design and implementation.
2) Is the reservation policy earmarking a 10% quota for the economically weaker sections of the “general category” empirically founded and justifiable? Critically analyse.(250 words)
Why this question:
An analysis of 445 premier higher education institutions finds that this section of students already had about 28% of representation—that is, close to three times the proposed 10% quota—in these institutions in 2016–17. This finding raises questions as to the relevance and possible impact of the proposed policy.
Key demands of the question:
Answer is to analyse the reservation policy earmarking 10% quota for the economically weaker sections (EWS) , as to whether it is justified or not.
Critically analyze – When asked to analyze, you have to examine methodically the structure or nature of the topic by separating it into component parts and present them as a whole in a summary. When ‘critically’ is suffixed or prefixed to a directive, one needs to look at the good and bad of the topic and give a fair judgement.
Structure of the answer:
In a few introductory lines define the policy that came into effect recently.
- The recent reservation policy brought about by introducing an amendment to the Constitution intends to reserve 10% of the total seats in higher education institutions, both private and public, and in government jobs exclusively for the EWS belonging to the general category.
- Discuss what are the pros and cons of the policy.
- Discuss the rationale behind it.
- Suggest your opinion and conclude with fair and balanced conclusion.
Conclude with significance of such policies, yet suggest what more can be done.
Topic: Government policies and interventions for development in various sectors and issues arising out of their design and implementation.
3) What are the major reforms needed in Food Corporation of India to ensure food security in India? Do you think the recommendations of the Shanta Kumar Committee take us in that direction? (250 words)
Why this question:
Union Minister of Consumer Affairs, Food and Public Distribution laid down the future roadmap for Food Corporation of India (FCI) recently, thus it is essential for us to analyse the major reforms needed in Food Corporation of India to ensure food security in India.
Key demand of the question:
The answer must analyse the major reforms needed in Food Corporation of India to ensure food security in India along with significance of Shanta Kumar committee.
Structure of the answer:
In a few lines state some the role played by FCI.
The answer must discuss the following:
Discuss the Key highlights of the roadmap:
- Primacy will be given to ensuring that the functioning of FCI is streamlined and fast paced as per recommendations of the Shanta Kumar Committee.
- 100 lakh ton silo storage capacity will be created in the country. For this, RITES has been assigned the task of changing the silo model and they will give their recommendations in 90 days to FCI.
- At present, there are 3 types of labourers in FCI namely Departmental, Daily Payment System (DPS) and No work no pay workers along with contractual labour. Government of India is deliberating to finish the 3 different arrangements and bring all workers of FCI under a single, uniform system which will bring stability of tenure and secured wages for all.
- To improve the usage of Information Technology in FCI, a Human Resource Management System (HRMS) will be implemented, the work for which will begin in August, 2019 and will be completed by August 2020. This move will benefit 22,000 employees in 196 offices of FCI.
Then move on to explaining the significance of recommendations made by Shanta Kumar committee.
Conclude with way forward.
Topic: Indian Economy and issues relating to planning, mobilization of resources, growth, development and employment.
4) Do you think Foreign Contribution (Regulation) Act violates international human rights standards on freedom of association? Critically examine. (250 words)
Why this question:
Recently Union Home Ministry has warned of taking penal action against NGOs who have changed office bearers without taking its approval.
Key demand of the question:
The answer must evaluate in detail FCRA, and the recent actions taken in this direction by the govt.
Directive word:
Critically analyze – When asked to analyze, you have to examine methodically the structure or nature of the topic by separating it into component parts and present them as a whole in a summary. When ‘critically’ is suffixed or prefixed to a directive, one needs to look at the good and bad of the topic and give a fair judgement.
In a few introductory lines state what is FCRA – The Foreign Contribution Regulations Act (FCRA) is used to regulate foreign contribution (especially monetary donation) provided by certain individuals or associations to NGOs and others within India.
- What are the concerns associated with the FCRA?
- Explain the recent steps taken by the govt. – In a notification, Union Home Ministry said, some incidents have come to light that some NGOs, having registered under Foreign Contribution Regulation Act (FCRA), have changed their office bearers without its approval.
- The Home Ministry said, replacement of key functionaries of FCRA registered organizations without prior permission is a violation of the law.
- The Ministry has asked the NGOs to submit applications for addition or deletion or any change of details about office bearers within one month from the date of issue of notice.
- Conclude with what needs to be done to overcome such concerns and challenges.
Conclude with way forward.
Topic: Indian Economy and issues relating to planning, mobilization of resources, growth, development and employment.
5) Discuss the key highlights of ‘prudential framework for resolution of stressed assets’ that were recently released by RBI, also discuss significance of such steps.(250 words)
Why this question:
The question is in the context of recently released RBI’s new prudential framework for resolution of stressed assets by banks.
Key demand of the question:
The answer must discuss the key features of the new prudential framework for resolution of stressed assets by banks, also one should provide for previous efforts made in this direction.
Discuss – This is an all-encompassing directive – you have to debate on paper by going through the details of the issues concerned by examining each one of them. You have to give reasons for both for and against arguments.
Structure of the answer:
In a few introductory lines discuss the issues plaguing the Banks of India in terms of the stressed assets.
- The new framework for resolution of bad loans, offers a 30-day gap for stress recognition instead of the one-day default earlier.
- Lenders will have complete discretion with regard to the design and implementation of resolution plans, subject to the specified timeline and independent credit evaluation.
- enders may recognize incipient stress in loan accounts, immediately on default, by classifying such assets as special mention accounts (SMA).
- For the purpose of restructuring, the definition of ‘financial difficulty’ to be aligned with the guidelines issued by the Basel Committee on Banking Supervision; and,
- If multiple lenders are involved, all the lenders must enter into an inter-creditor agreement (ICA) during the review period, to provide for ground rules for the resolution plan.
- Suggest what should be the way forward.
Conclude with what more needs to be done.
Topic:Ethics and Human Interface: Essence, determinants and consequences of Ethics in human actions.
6) School and family are two important agents through which the child is develops moral values and evolves as an ethical individual. Elucidate.(250 words)
Why this question:
The question is to analyse the significant role played by school and family in the upbringing of moral values in a child.
Demand of the question:
This question seeks to examine the role of school and family in sculpting a moral and ethical behaviour in individuals.
Directive word:
Elucidate – Give a detailed account as to how and why it occurred, or what is the particular context. You must be defining key terms where ever appropriate, and substantiate with relevant associated facts.
Structure of the answer:
Start with brief introduction of the context of the question.
Explain the role played by school in sculpting an individual, how family has key role to play, what are the changes both bring in one’s life etc. Give examples to justify and suggest ideal conditions that one must look for to bring up the best in an individual.
Conclude with significance.
Topic : Ethics and Human Interface: Essence, determinants and consequences of Ethics in human actions; dimensions of ethics; ethics in private and public relationships. Human Values – lessons from the lives and teachings of great leaders, reformers and administrators; role of family, society and educational institutions in inculcating values.
7) What do you understand by war ethics? Do you agree ‘Everything is fair in love and war’? Elucidate.(250 words)
Why this question:
The question intends to discuss the indispensability of ethics in human life. One must discuss how the purpose of war ethics is to help decide what is right or wrong, both for individuals and countries.
Key demand of the question:
The answer must discuss the nuances associated with war ethics in detail.
Structure of the answer:
Elucidate – Give a detailed account as to how and why it occurred, or what is the particular context. You must be defining key terms where ever appropriate, and substantiate with relevant associated facts.
In a few introductory lines appreciate what you understand by War ethics.
Explain first the circumstances, ethical angles involved in wars. Then move to explain the meaning of Everything is fair in love and war. The ends justify the means when it comes to love and war. When you are fighting a war, it is important to do what you have to in order to win the war. You can’t expect someone to play fair in war when their survival is on the line. When going for love it is also important to do as much as you can for the people that you love. Such questions are best answered using examples.
Conclude by reasserting significance of ethics.
| english |
<gh_stars>0
{
"name": "editorconfig",
"version": "0.15.0",
"description": "EditorConfig File Locator and Interpreter for Node.js",
"keywords": [
"editorconfig",
"core"
],
"main": "index.js",
"bin": {
"editorconfig": "bin/editorconfig"
},
"contributors": [
"<NAME> (topbug.net)",
"<NAME> (https://github.com/jedmao/)",
"<NAME> (http://treyhunner.com)"
],
"directories": {
"bin": "./bin",
"lib": "./lib"
},
"scripts": {
"clean": "rimraf dist",
"prebuild": "npm run clean",
"build": "tsc",
"pretest": "npm run lint && npm run build && npm run copy && cmake .",
"test": "ctest .",
"pretest:ci": "npm run pretest",
"test:ci": "ctest -VV --output-on-failure .",
"lint": "npm run eclint && npm run tslint",
"eclint": "eclint check --indent_size ignore \"src/**\"",
"tslint": "tslint --project tslint.json",
"copy": "cpy package.json .npmignore LICENSE README.md CHANGELOG.md dist && cpy src/bin/* dist/bin && cpy src/lib/fnmatch*.* dist/lib",
"prepub": "npm run lint && npm run build && npm run copy",
"pub": "npm publish ./dist"
},
"repository": {
"type": "git",
"url": "git://github.com/editorconfig/editorconfig-core-js.git"
},
"bugs": "https://github.com/editorconfig/editorconfig-core-js/issues",
"author": "EditorConfig Team",
"license": "MIT",
"dependencies": {
"@types/commander": "^2.11.0",
"@types/semver": "^5.4.0",
"commander": "^2.11.0",
"lru-cache": "^4.1.1",
"semver": "^5.4.1",
"sigmund": "^1.0.1"
},
"devDependencies": {
"@types/mocha": "^2.2.43",
"cpy-cli": "^1.0.1",
"eclint": "^2.4.3",
"mocha": "^4.0.1",
"rimraf": "^2.6.2",
"should": "^13.1.2",
"tslint": "^5.7.0",
"typescript": "^2.5.3"
},
"_from": "editorconfig@0.15.0",
"_resolved": "http://registry.npm.taobao.org/editorconfig/download/editorconfig-0.15.0.tgz"
} | json |
The worship of Devi Durga in the month of Ashwin is called 'Akalbodhan'- an uncoventional time for inauguration of the worship. It is so called since the period of this worship differs from the conventional period (during the spring - 'Basanta').Mythological tract:
In the ancient times, a demon called 'Mahishasura' earned the favor of 'Lord Brahma' through extreme austerity and prolonged meditation. Pleased with the devotion of the demon, the lord blessed him with a boon that no man or Deity would be able to kill him. Empowered with the boon, Mahishasura started his reign of terror over the Earth and Heaven.Invasion of Heaven:
People were already being killed mercilessly and even the Gods were assaulted.
Yet the worse was yet to come. It came when an strong army of demons was gathered to siege the abode of the Deities. The army was led by the king Mahishasura, the green skinned demon with the form of a giant buffalo. With its weapons of iron, and its phalanxes of elephants and charioteers the army finally marched on the king of gods, Purandara or (Indra), defeating him. Then, Mahishasura usurped the throne of heaven.
The victory was complete, and all the gods were driven out of the heaven. Routed they went to the trinity of the Supreme Gods, Brahma, Vishnu, and Shiva to save themselves and the men on the world.
The orgy of violence vis-a-vis the the invasion of the heaven by the evils enraged the Supreme Gods. Their faces were flushed with anger and a dazzling luminescence flooded forth. Great flames and thunderbolt streaked through all directions. The fires illuminated all the three worlds: the heaven, the earth, and the nether-world with penetrating beams of light.The Birth of Durga:
At a single point, the energy of all the fires coalesced and assumed a shape, in the form of a young woman. Her face was from the light of Shiva. Her ten arms were from Lord Vishnu. Her legs were from Lord Brahma.
The dispossessed gods were awed by the supreme energy and enchanting beauty of the conceived Goddess. They praised her and equipped her with their divine gifts: Shiva gave Her a trident with a spear-end. Krishna gave her rotating disc. Varuna, the God of sea, gave her a conch and the God of fire gave her a missile. From the wind, Vayu, she received arrows. The king of gods, Indra, gave her the thunder-bolt, and the gift of his white-skinned elephant Airavata was a bell. From Yama, the god of death, Durga received a rod, and from the Ruler of Waters she was given a noose.
Durga received many other precious and magical treasures-- gifts of jewels, new clothing, and a garland of immortal lotuses for her head and breasts. Heaven's architect gave her a bright axe and magic armor. God of mountains, Himalayas gave her jewels and a magnificent lion to ride into battle.
Now equipped with the fearsome weaponry and magical powers of the gods, and dressed in golden armor and jewels she set off, seated gracefully upon the lion. His thunderous roars shook the three worlds. Oceans swelled up to scrape the sky and surf broke over the land. Continents were torn at their granite foundations as whole new chains of mountains rose, while older ranges crumbled, cracked, and gave way to dust in a thousand landslides. Seeing these cataclysmic ripplings in waves through all the three worlds, Mahishasura and his demon allies found their attention drawn from heaven to Earth. Though confident of their power and control in heaven, even the conquering demon host could not help being awestruck.
The demons had little time to admire the radiant visage of their new adversary, for soon she engaged them on the battlefield. First, the army of Chikasura, and then that of Chamara, the two chief commanders (also called Shumbha and Nishumbha,of Mahishasura by some) were met. They were destroyed in a great battle. Now it's turn for Mahishasura.The Termination of Mahishasura:
Confident but confused by the humiliating defeat of his loyal and powerful commanders Mahishasura did his best in arranging and equipping his personal army.
This time the heaven was led by Durga as the boon of Mahishasura could only make him invincible against all but woman. Surrounded by chants of praise, the blowing of horns the beating of drums and songs of worship Durga roamed the battlefield on her mighty lion. From her divine breath her army was constantly replenished with new warriors, each able, brave and resolute.
Shocked and enraged by the disastrous events on the battlefield. In a mad desperate bid Mahishasura then reverted to his own form, a buffalo, and charged about on the battlefield. In a wild rage he charged at Durga's divine soldiers wounding many, biting others and all the while thrashing with his long, whip-like tail. Durga's lion, angered by the presence of the demon-buffalo, attacked him. While he was thus engaged, Durga threw her noose around his neck.
But through magical spell Mahishasura kept changing his shape and form from one to another so as to puzzle the Devi.
Finally the Goddess beheaded the buffalo and from it emerged Mahishasura in his original form. Durga pierced his chest with the trident and relieved the world from the evil power.
The gods returned to heaven, and along with the sages of the earth, they sang praises and showered floral compliments to the Goddess Durga. Henceforth, and to this day, the Goddess Durga is worshipped by all the gods in heaven, and all human beings on earth. Mahishasura is there too--frozen in his moment of final defeat, impaled by Durga's spear and seeking pardon beneath her left foot. The Goddess Durga then continued to be worshipped in this form.
According to Puranas (the epics) , King Suratha, used to worship the goddess Durga in spring. Thus Durga Puja was also known as Basanti Puja (Basanta being Spring). While the vernal worship of Durga still goes on but it is the Ram's Akalbodhan during the autumn that came to be a most widely accepted practice.
In the 'Ramayana', as it goes, Rama went to 'Lanka' to rescue his abducted wife, Sita, from the grip of Ravana, the king of the Demons in Lanka. Before starting for his battle with Ravana, Rama wanted the blessings of Devi Durga . He came to know that the Goddess would be pleased only if she is worshipped with one hundred 'NeelKamal' or blue lotuses. Rama, after travelling the whole world, could gather only ninety nine of them. He finally decided to offer one of his eyes, which resembled blue lotuses. Durga, being pleased with the devotion of Rama, appeared before him and blessed him. The epical battle started on the 'Saptami' and Ravana was finally killed on the 'Sandhikshan' i.e. the crossover period between Ashtami (the next day) and Navami (the day after). Ravana was cremated on Dashami. This is why Dashera is celebrated in India with so much of fanfare and the effigy of Raavana is burnt.
In course of time Bengalis adopted the autumnal worship of Durga performed by Rama and made it their main festival. The Pujas span over the four days, the time taken by Rama to finally kill and cremate Ravana.
| english |
<gh_stars>1-10
{"948490061174":{"type":"book open","bookName":"Epic%20Quest","subjectName":"school","fName":"users/<KEY>"},"948490061285":{"type":"st"},"948490061412":{"type":"st"},"948490061413":{"type":"ss"}} | json |
Mumbai: Former Congress spokesperson Priyanka Chaturvedi Friday joined the Shiv Sena, blaming the Rahul Gandhi-led party for reinstating party workers who misbehaved with her recently.
At a press conference here, Chaturvedi was welcomed into the Sena by the saffron party president Uddhav Thackeray, who said Shiv Sena workers have got a “good sister” in Chaturvedi.
Earlier in the day, Chaturvedi, who was convenor of the Congress media cell, was miffed at the reinstatement of some party workers in Uttar Pradesh who had threatened and misbehaved with her during her press conference in Mathura a few days ago.
She told media at Thackeray’s residence ‘Matoshree’ in suburban Bandra that she was pained after some Congress workers, who had made comments against her, were reinstated by that party.
Without naming the Congress, she said she gave 10 years to the party in which she thought she could speak for the cause of women, despite being trolled on the social media.
“I kept speaking in a ‘bindaas’ (fearless) way despite being abused and trolled constantly,” she said. “I was pained when some party workers made comments about me. After being suspended, they were reinstated,” she added.
Chaturvedi said the statements made against her were ignored by the party (Congress), despite speaking for 10 years at a “great personal cost” and without joining politics formally.
“I was very let down. I thought If I didn’t fight for my self respect, I would fail women. I have joined the Sena after a lot of thinking, and understanding my responsibility towards the cause of women,” she said.
She denied that she resigned from the Congress after being denied a ticket in the ongoing Lok Sabha polls.
“Parties keep fighting elections. However, only fighting and winning is not life. The work of party workers should be to accept an ideology and work towards the cause,” Thackeray said.
Chaturvedi said she would work towards strengthening the Sena not only in Maharashtra, but across the country.
Asked why did she join the Sena and not the BJP, Chaturvedi said that as she hailed from Mumbai, her “karmabhoomi”, she always felt connected to the Sena.
“If I have joined the party, it is only with a feeling to serve and not for political posts. I wanted to come back to my roots. When I thought of coming back, I did not find any organisation better than this and no other better platform than this,” she said. | english |
<filename>about.html<gh_stars>0
---
layout: page
title: About
header-img: "img/about-bg.png"
---
<p>Dad && Designer && Developer. Versatility is key. If I cut you off, chances are you gave me the ✂️</p>
| html |
There are many reasons that lead to inflammation of the gums, but in most cases this phenomenon is associated with improper oral care. Regular and high-quality cleaning of teeth gives almost complete guarantee that you will not encounter this problem. But in every rule there are exceptions! If for some reason you develop gum disease, treatment with folk remedies will help restore health and prevent tooth loss.
What is the basis for folk treatment of gum disease?
The more bacteria accumulate on the teeth and gums, there will be more inflammation. The source of infection is usually:
- plaque;
- tartar;
- caries;
- poor-quality dental fillings;
- prostheses, which are poorly maintained;
- the basis of the tongue for internal infections and diseases of the digestive tract.
It is not surprising that, first of all, the treatment of inflammation should be directed to the destruction of bacteria. The remedy to be used should be chosen already, proceeding from the degree of development of the disease:
- parodontosis - a small inflammation;
- Gingivitis - inflammation of the gums of medium degree, accompanied by bleeding and suppuration;
- periodontitis - a severe degree of gum disease, often leads to tooth loss.
To remove a slight inflammation of the gum will help such a folk remedy, like aloe juice or Kalanchoe. It should be rubbed directly into the mucosa. In more severe cases, infusions of medicinal herbs and products based on sea salt are effective.
The most effective folk remedy for gum disease is cleaning your teeth after each meal and using dental floss. Also, for prevention, doctors recommend enriching the diet with vitamins and minerals, as well as eating a day at least one raw vegetable. The mechanical action of solid products during chewing prevents the formation of tartar. But if it comes to periodontal disease, treatment will be required.
The best folk remedies against gum disease are herbs:
- chamomile;
- calendula;
- sage ;
- thyme;
- St. John's wort;
- peppermint;
- Melissa;
- Oak bark.
They can be brewed with steep boiling water each separately, or prepare a collection for your taste. The main thing is to observe the proportions: for 1 cup of boiling water - 1 tbsp. spoon of a herbal mixture. Rinse should be done when the broth has cooled to a comfortable temperature, but has not yet become cold. The course of treatment is 10-20 days. Also, according to this scheme, you can prepare a solution of sea salt and use it in the morning and evening. | english |
<html>
<head>
<title>FedX Documentation</title>
</head>
<body>
<div id="content" style="width:800px">
<h2>Endpoint Management</h2>
<a href="../Index.html">back</a>
<p>In FedX any federation member is mapped to an <i>Endpoint</i>. The endpoint maintains all
relevant information for a particular endpoint, e.g. how triples can be retrieved from the
endpoint. Endpoints can be added to the federation at initialization time or at runtime.</p>
<p>In FedX we provide support methods to create <i>Endpoints</i> for SPARQL endpoints and
Sesame <i>NativeStore</i>s. The methods can be used to create endpoints easily.</p>
<h3>Example: Using the endpoint Manager to create endpoints</h3>
<pre>
Config.initialize();
List<Endpoint> endpoints = new ArrayList<Endpoint>();
// initializing a SPARQL endpoint (with explicit name)
endpoints.add( EndpointFactory.loadSPARQLEndpoint("http://dbpedia", "http://dbpedia.org/sparql"));
// another SPARQL endpoint (name is constructed from url)
endpoints.add( EndpointFactory.loadSPARQLEndpoint("http://data.semanticweb.org/sparql"));
// load a Sesame NativeStore (path either absolute or relative to Config#getBaseDir)
endpoints.add( EndpointFactory.loadNativeEndpoint("http://mystore", "path/to/myNativeStore"));
FedXFactory.initializeFederation(endpoints);
</pre>
For details about the methods please refer to the javadoc help of the class<i>EndpointFactory</i>
<p><b>Note:</b> With the Endpoint mechanism it is basically possible to support any kind of SAIL implementation as federation member.
For documentation consider the javadoc, in particular <i>EndpointFactory</i> and <i>EndpointProvider</i>.</p>
</div>
</body>
</html> | html |
Execs from the biggest studios talk business and technology at CES.
LAS VEGAS--Studios know how to make money in the traditional way--in the theater, via broadcast television. But the Internet still has them slightly flummoxed.
True, most of the major film and television studios are embracing the Web. But the exact formula for distributing their content while still making money remains somewhat up in the air.
Here at CES during a panel sponsored by Hollywood trade pub Variety, the heads of digitial distribution for Disney/ABC, Fox, Paramount Pictures, and Warner Bros. discussed what is and isn't working for them.
All present were adamant that there is no one good way to make money online yet. "We're using every model because consumers will ultimately decide how they want to consume (content)," said Tom Lesinski, president of Paramount Pictures Digital Entertainment. For Paramount, that means downloads of its films via iTunes, Xbox Live, Netflix Watch it Now, and the Vudu set-top box.
The head of Fox Entertainment's digital media group, Dan Fawcett, said the best way is to give content to people the way they're used to. "People online want things for free. They can get it for free on piracy sites," he said. "They are inclined to watch it with a reasonable amount of advertising, but downloading a movie that takes a couple of hours just to own it doesn't seem to be a very compelling consumer experience."
This, of course, gave Fawcett the opportunity to plug Hulu.com, the online video partnership between Fox and NBC Universal where some of the two companies' most popular shows are viewable for free with some ads.
Paramount's Lesinski agreed that studios have to "give (content) to people anyway they want," he said.
And so did everyone else: a constant familiar refrain from all of them was "letting consumers consume content when and how they want." But isn't the way they want it instant and free?
Other tidbits: All of them profess to like Steve Jobs. Some think Apple and its iTunes Store hold too much sway over the download business, but those on the panel didn't seem to agree. Warner Bros. called Apple "a great partner," and Paramount is really, really happy that 5- and 10-year-old film titles are selling in volumes of hundreds of thousands today on iTunes. Disney, perhaps unsurprisingly, was almost defensive of Apple. (Jobs is Disney's largest shareholder.)
"Apple wanted to legitimize the marketplace," said Albert Cheng, executive vice president of digital media for Disney-ABC Television. "They compete with so many other different options, including piracy. To say Apple has so much control is looking at a very narrow slice of pie."
All had plenty to say on the impact of the Web on professional content. But despite talk of successes with viral video, streaming branded sites, and partnership deals across different platforms, none had an articulate response when an audience member asked when online revenue would surpass traditional revenue sources for each.
After some amused stares with each other, finally Fox's Fawcett was able to stammer: "Nowhere in the forseeable future."
| english |
U N Me is a Children's Clothing Shop. They stock brands domestic and international brands such as Pigeon, Chicco, Mini Rodinis, Evans. They have baby clothes, baby strollers, cots, toys and books. They also store baby groceries such as baby shampoos, baby washes, diapers, diaper rash cream. They have furniture for a child's nursery or bedroom such as baby cots, tableswings, chairs, bookshelves.
| english |
import pytumblr, ConfigParser, re, sys
config = ConfigParser.RawConfigParser()
config.read('settings.cfg')
class API(object):
# initialize Tumblr client
def __init__(self):
self.t = pytumblr.TumblrRestClient(
config.get('tumblr', 'consumerKey'),
config.get('tumblr', 'consumerSecret'),
config.get('tumblr', 'oauthToken'),
config.get('tumblr', 'oauthSecret')
)
self.blogName = config.get('tumblr', 'blogName')
# build caption for post with available data
def buildCaption(self, post):
caption = ''
if(post['artist'] is not None):
caption += post['artist']
if(post['songTitle'] is not None):
caption += ' - ' + post['songTitle']
if(post['genres'] is not None):
caption += ' [' + " / ".join(post['genres']) + ']'
if(post['songYear'] is not None):
caption += ' (' + post['songYear'] + ')'
return caption.encode('utf-8')
# create a Tumblr post of type audio
def createAudioPost(self, post):
audioCaption = self.buildCaption(post)
try:
print self.t.create_audio(self.blogName, caption=audioCaption, tags=post['genres'], external_url=post['url'])
except:
print "failed to create audio post:", sys.exc_info()[0]
# create a Tumblr post for youtube video
def createYoutubePost(self, post):
videoCaption = self.buildCaption(post)
# get video ID from URL
regex = re.compile("v\=([\-\w]+)")
videoId = regex.search(post['url'])
try:
videoId = videoId.groups()[0]
except:
return
# create embed code string using video ID
embedString = '<iframe id="ytplayer" type="text/html" width="640" height="390" src="http://www.youtube.com/embed/' + videoId + '?frameborder="0"/>'
try:
print self.t.create_video(self.blogName, caption=videoCaption, tags=post['genres'], embed=embedString)
except:
print "failed to create youtube post:", sys.exc_info()[0]
# create a Tumblr post for vimeo video
def createVimeoPost(self, post):
videoCaption = self.buildCaption(post)
# get video ID from URL
regex = re.compile("vimeo.com\/([\-\w]+)")
videoId = regex.search(post['url'])
try:
videoId = videoId.groups()[0]
except:
return
# create embed code string using video ID
embedString = '<iframe src="//player.vimeo.com/video/' + videoId + '" width="640" height="390" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>'
try:
print self.t.create_video(self.blogName, caption=videoCaption, tags=post['genres'], embed=embedString)
except:
print "failed to create vimeo post:", sys.exc_info()[0]
# create a Tumblr post of type link
def createLinkPost(self, post):
linkTitle = self.buildCaption(post)
try:
print self.t.create_link(self.blogName, title=linkTitle, tags=post['genres'], url=str(post['url']))
except:
print "failed to create link post" | python |
Australia won the first ever day-night cricket test by 3 wickets against New Zealand on Sunday, with tail-enders Peter Siddle and Mitch Starc ushering the hosts to victory in a dramatic finish under lights that will almost certainly ensure the format isn’t consigned to history as a one-time event.
The match was over inside three days, which hasn’t happened in an Adelaide Oval test since 1951 and which highlighted the differences of using the pink ball and playing under lights in the longest form of the game.
Ball dominated bat, particularly in the twilight sessions. The first 25 wickets tumbled in two days before New Zealand resumed Sunday at 116-5, an overall lead of 94.
Josh Hazlewood, leading the attack because the injured Starc wasn’t allowed to bowl, returned a career-best 6-70 and Mitch Marsh took 3-59 to bowl the New Zealanders out for 208 in the first session and set up the target. Trent Boult responded with figures of 5-60 for New Zealand, including Shaun Marsh for 49 just as the home team appeared to be coasting, to ensure a tense two hours before Australia clinched the three-match series 2-0.
New Zealand skipper Brendon McCullum said the day-night concept was the future of test cricket.
Boult got two lbw decisions on either side of David Warner’s dismissal for 35, removing Joe Burns (11) with the total at 34 and ending Smith’s scratchy innings at 14 as Australia slipped to 66-3.
Smith never appeared settled, his edge off Boult just failed to carry to wicketkeeper B. J. Watling on one, he was dropped at mid-wicket by Mitch Santner on two, and he squeezed an inside edge between his legs to get a boundary off Boult on eight.
The Australians got on top again with Adam Voges (28) sharing a 49-run stand with Shaun Marsh before he was out in the second over after the tea break.
The Marsh brothers combined to add 46 before the younger Mitch was out to Santner, skying a catch to Kane Williamson.
Shaun Marsh was batting to save his test career after a terrible run out in the first innings in his latest recall to the national XI.
Peter Nevill, the highest scorer in the match with 66 in the first innings, was out for 10 when he tried to drive Boult and got an inside edge that Watling caught to complete a spectacular, diving dismissal, leaving Australia requiring two for victory. Starc, unable to bowl because of a foot injury, hobbled out to join Siddle, who edged his way to the win with an unbeaten 9.
Starc will miss Australia’s next three-test series against the West Indies, which starts Dec. 10 at Hobart. New Zealand will host Sri Lanka before the return two-test series against Australia early next year.
Despite the three-day finish, the day-night concept for tests was popular with local fans, with the crowd of 33,923 on day three taking the total attendance to 123,736 for the match.
Scores:
New Zealand 1st Innings - 202 (Tom Latham 50, Mitchell Santner 31; Mitch Starc 3-24, Josh Hazlewood 3-66).
Australia 1st Innings - 224 (Peter Nevill 66, Steve Smith 53, Nathan Lyon 34; Doug Bracewell 3-18)
New Zealand 2nd Innings - 208 (Mitchell Santner 45, Ross Taylor 32; Josh Hazlewood 6-70, Mitch Marsh 3-59)
Australia 2nd Innings - 187-7 (Shaun Marsh 49, David Warner 35; Trent Boult 5-60) | english |
import { readFile } from "fs/promises";
import { deserialize, fail } from "@azure-tools/codegen";
import { WriteFileOptions } from "../extension-host";
import { AutorestExtensionLogger } from "../extension-logger";
import { Session, startSession } from "../session";
export interface TestSessionInput {
model: any;
filename: string;
content: string;
}
export interface TestSession<T> {
session: Session<T>;
errors: Array<any>;
}
async function readData(folder: string, ...files: Array<string>): Promise<Map<string, TestSessionInput>> {
const results = new Map<string, { model: any; filename: string; content: string }>();
for (const filename of files) {
const buffer = await readFile(`${folder}/${filename}`);
const content = buffer.toString();
const model = deserialize<any>(content, filename);
results.set(filename, {
model,
filename,
content,
});
}
return results;
}
export async function createTestSessionFromFiles<TInputModel>(
config: any,
folder: string,
inputs: Array<string>,
): Promise<TestSession<TInputModel>> {
const models = await readData(folder, ...inputs);
return createTestSession(config, models);
}
/**
* Create a Test session to use for testing extension.
* @param config Autorest configuration to use in this session.
* @param inputs List of inputs.
* @returns Test session
*/
export async function createTestSession<TInputModel>(
config: any,
inputs: Array<TestSessionInput> | Map<string, TestSessionInput>,
): Promise<TestSession<TInputModel>> {
const models = Array.isArray(inputs) ? inputs.reduce((m, x) => m.set(x.filename, x), new Map()) : inputs;
const errors: Array<any> = [];
const sendMessage = (message: any): void => {
if (message.Channel === "warning" || message.Channel === "error" || message.Channel === "verbose") {
if (message.Channel === "error") {
errors.push(message);
}
}
};
const session = await startSession<TInputModel>({
logger: new AutorestExtensionLogger(sendMessage),
readFile: (filename: string) =>
Promise.resolve(models.get(filename)?.content ?? fail(`missing input '${filename}'`)),
getValue: (key: string) => Promise.resolve(key ? config[key] : config),
listInputs: (artifactType?: string) => Promise.resolve([...models.values()].map((x) => x.filename)),
protectFiles: (path: string) => Promise.resolve(),
writeFile: (options: WriteFileOptions) => Promise.resolve(),
message: sendMessage,
UpdateConfigurationFile: (filename: string, content: string) => {},
GetConfigurationFile: (filename: string) => Promise.resolve(""),
} as any);
return { session, errors };
}
| typescript |
@font-face {
font-family: 'IRANSansWeb';
src: url('../../fonts/IRANSansWeb/IRANSansWeb_Regular.eot');
src: local('IRANSansWeb Regular'), local('IRANSansWeb_Regular'), url('../../fonts/IRANSansWeb/IRANSansWeb_Regular.eot?#iefix') format('embedded-opentype'), url('../../fonts/IRANSansWeb/IRANSansWeb_Regular.woff2') format('woff2'), url('../../fonts/IRANSansWeb/IRANSansWeb_Regular.woff') format('woff'), url('../../fonts/IRANSansWeb/IRANSansWeb_Regular.ttf') format('truetype');
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: 'IRANSansWeb-Regular';
src: url('../../fonts/IRANSansWeb/IRANSansWeb_Regular.eot');
src: local('IRANSansWeb Regular'), local('IRANSansWeb_Regular'), url('../../fonts/IRANSansWeb/IRANSansWeb_Regular.eot?#iefix') format('embedded-opentype'), url('../../fonts/IRANSansWeb/IRANSansWeb_Regular.woff2') format('woff2'), url('../../fonts/IRANSansWeb/IRANSansWeb_Regular.woff') format('woff'), url('../../fonts/IRANSansWeb/IRANSansWeb_Regular.ttf') format('truetype');
}
@font-face {
font-family: 'IRANSansWeb';
src: url('../../fonts/IRANSansWeb/IRANSansWeb_Light.eot');
src: local('IRANSansWeb Light'), local('IRANSansWeb_Light'), url('../../fonts/IRANSansWeb/IRANSansWeb_Light.eot?#iefix') format('embedded-opentype'), url('../../fonts/IRANSansWeb/IRANSansWeb_Light.woff2') format('woff2'), url('../../fonts/IRANSansWeb/IRANSansWeb_Light.woff') format('woff'), url('../../fonts/IRANSansWeb/IRANSansWeb_Light.ttf') format('truetype');
font-weight: 300;
font-style: normal;
}
@font-face {
font-family: 'IRANSansWeb-Light';
src: url('../../fonts/IRANSansWeb/IRANSansWeb_Light.eot');
src: local('IRANSansWeb Light'), local('IRANSansWeb_Light'), url('../../fonts/IRANSansWeb/IRANSansWeb_Light.eot?#iefix') format('embedded-opentype'), url('../../fonts/IRANSansWeb/IRANSansWeb_Light.woff2') format('woff2'), url('../../fonts/IRANSansWeb/IRANSansWeb_Light.woff') format('woff'), url('../../fonts/IRANSansWeb/IRANSansWeb_Light.ttf') format('truetype');
}
@font-face {
font-family: 'IRANSansWeb';
src: url('../../fonts/IRANSansWeb/IRANSansWeb_UltraLight.eot');
src: local('IRANSansWeb UltraLight'), local('IRANSansWeb_UltraLight'), url('../../fonts/IRANSansWeb/IRANSansWeb_UltraLight.eot?#iefix') format('embedded-opentype'), url('../../fonts/IRANSansWeb/IRANSansWeb_UltraLight.woff2') format('woff2'), url('../../fonts/IRANSansWeb/IRANSansWeb_UltraLight.woff') format('woff'), url('../../fonts/IRANSansWeb/IRANSansWeb_UltraLight.ttf') format('truetype');
font-weight: 300;
font-style: normal;
}
@font-face {
font-family: 'IRANSansWeb-UltraLight';
src: url('../../fonts/IRANSansWeb/IRANSansWeb_UltraLight.eot');
src: local('IRANSansWeb UltraLight'), local('IRANSansWeb_UltraLight'), url('../../fonts/IRANSansWeb/IRANSansWeb_UltraLight.eot?#iefix') format('embedded-opentype'), url('../../fonts/IRANSansWeb/IRANSansWeb_UltraLight.woff2') format('woff2'), url('../../fonts/IRANSansWeb/IRANSansWeb_UltraLight.woff') format('woff'), url('../../fonts/IRANSansWeb/IRANSansWeb_UltraLight.ttf') format('truetype');
}
@font-face {
font-family: 'IRANSansWeb';
src: url('../../fonts/IRANSansWeb/IRANSansWeb_Medium.eot');
src: local('IRANSansWeb Medium'), local('IRANSansWeb_Medium'), url('../../fonts/IRANSansWeb/IRANSansWeb_Medium.eot?#iefix') format('embedded-opentype'), url('../../fonts/IRANSansWeb/IRANSansWeb_Medium.woff2') format('woff2'), url('../../fonts/IRANSansWeb/IRANSansWeb_Medium.woff') format('woff'), url('../../fonts/IRANSansWeb/IRANSansWeb_Medium.ttf') format('truetype');
font-weight: 500;
font-style: normal;
}
@font-face {
font-family: 'IRANSansWeb-Medium';
src: url('../../fonts/IRANSansWeb/IRANSansWeb_Medium.eot');
src: local('IRANSansWeb Medium'), local('IRANSansWeb_Medium'), url('../../fonts/IRANSansWeb/IRANSansWeb_Medium.eot?#iefix') format('embedded-opentype'), url('../../fonts/IRANSansWeb/IRANSansWeb_Medium.woff2') format('woff2'), url('../../fonts/IRANSansWeb/IRANSansWeb_Medium.woff') format('woff'), url('../../fonts/IRANSansWeb/IRANSansWeb_Medium.ttf') format('truetype');
}
@font-face {
font-family: 'IRANSansWeb';
src: url('../../fonts/IRANSansWeb/IRANSansWeb_Bold.eot');
src: local('IRANSansWeb Bold'), local('IRANSansWeb_Bold'), url('../../fonts/IRANSansWeb/IRANSansWeb_Bold.eot?#iefix') format('embedded-opentype'), url('../../fonts/IRANSansWeb/IRANSansWeb_Bold.woff2') format('woff2'), url('../../fonts/IRANSansWeb/IRANSansWeb_Bold.woff') format('woff'), url('../../fonts/IRANSansWeb/IRANSansWeb_Bold.ttf') format('truetype');
font-weight: 700;
font-style: normal;
}
@font-face {
font-family: 'IRANSansWeb-Bold';
src: url('../../fonts/IRANSansWeb/IRANSansWeb_Bold.eot');
src: local('IRANSansWeb Bold'), local('IRANSansWeb_Bold'), url('../../fonts/IRANSansWeb/IRANSansWeb_Bold.eot?#iefix') format('embedded-opentype'), url('../../fonts/IRANSansWeb/IRANSansWeb_Bold.woff2') format('woff2'), url('../../fonts/IRANSansWeb/IRANSansWeb_Bold.woff') format('woff'), url('../../fonts/IRANSansWeb/IRANSansWeb_Bold.ttf') format('truetype');
}
| css |
Sam Curran is part of Chennai Super Kings in IPL 2022. Sam Curran showed an amazing performance in IPL 2022 with the bat as well as the bowl. However, Chennai Super Kings will be only able to retain two overseas players in IPL 2022 and they might go with Moeen Ali and Faf du Plessis. CSK bought Moeen Ali for Rs. 7 crores in IPL 2021 auction and he also batted brilliantly at the no.3 spot in IPL 2021. So CSK might not want to lose the English all-rounder in IPL 2022.
Faf du Plessis was a star batsman for Chennai Super Kings in IPL 2021, who smashed 320 runs in 7 matches along with 4 fifties. Therefore, CSK might go for Faf du Plessis and lose Sam Curran. In such a scenario, Sam Curran will be in the eyesight for other franchises in IPL 2022 auction. Sam Curran is a young player and has all-round abilities. Due to this, the English player can become the costliest player in IPL 2022 auction.
| english |
<filename>utils/sqlite.py
# 导入:
from sqlalchemy import Column, String, create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
# 创建对象的基类:
Base = declarative_base()
# 定义Project对象:
class Project(Base):
# 表的名字:
__tablename__ = 'project'
# 表的结构:
id = Column(String(20), primary_key=True)
name = Column(String(20))
# 初始化数据库连接:
engine = create_engine(
'mysql+mysqlconnector://root:password@localhost:3306/test')
# 创建DBSession类型:
DBSession = sessionmaker(bind=engine) | python |
<filename>query_optimizer/strategy/Strategy.hpp
/**
* Copyright 2011-2015 Quickstep Technologies LLC.
* Copyright 2015 Pivotal Software, Inc.
*
* 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.
**/
#ifndef QUICKSTEP_QUERY_OPTIMIZER_STRATEGY_STRATEGY_HPP_
#define QUICKSTEP_QUERY_OPTIMIZER_STRATEGY_STRATEGY_HPP_
#include <string>
#include <vector>
#include "query_optimizer/logical/Logical.hpp"
#include "query_optimizer/physical/Physical.hpp"
#include "utility/Macros.hpp"
namespace quickstep {
namespace optimizer {
class OptimizerContext;
class LogicalToPhysicalMapper;
namespace strategy {
/** \addtogroup OptimizerStrategy
* @{
*/
/**
* @brief Base class for strategies that implement how to convert a logical
* plan to a physical plan for a type of operators.
*/
class Strategy {
public:
/**
* @brief Destructor.
*/
virtual ~Strategy() {}
/**
* @brief Converts \p logical_input to \p physical_output if the strategy
* can be applied to the input; otherwise, set physical_output to NULL.
*
* @param logical_input The logical plan to be converted
* @param physical_output The physical plan output. NULL if the strategy
* cannot be applied to the input.
* @return True if the strategy has been applied to the input logical.
*/
virtual bool generatePlan(const logical::LogicalPtr &logical_input,
physical::PhysicalPtr *physical_output) = 0;
/**
* @return The name of the strategy.
*/
virtual std::string getName() const = 0;
protected:
/**
* @brief Constructor.
*
* @param physical_mapper The physical plan generator. A strategy can
* interact with other strategies via the plan
* generator to create a complete plan.
*/
explicit Strategy(LogicalToPhysicalMapper *physical_mapper)
: physical_mapper_(physical_mapper) {}
LogicalToPhysicalMapper *physical_mapper_;
private:
DISALLOW_COPY_AND_ASSIGN(Strategy);
};
/** @} */
} // namespace strategy
} // namespace optimizer
} // namespace quickstep
#endif /* QUICKSTEP_QUERY_OPTIMIZER_STRATEGY_STRATEGY_HPP_ */
| cpp |
Mitchell Kupchak (born May 24, 1954) is an American professional basketball executive and retired player. He is the current president of basketball operations and general manager of the Charlotte Hornets of the National Basketball Association (NBA). As a college player, Kupchak was an All-American at the University of North Carolina and a member of the gold medal-winning 1976 United States Olympic team. As a professional player, he won three NBA titles - one as a member of the Washington Bullets and two with the Los Angeles Lakers.
Known for:
How much have you seen?
Keep track of how much of Mitch Kupchak’s work you have seen. Go to your list.
| english |
The Coastguard Rescue helicopter appears to have taken off again from an area around HM Prison Wormwood Scrubs. It does currently appear to be following the helicopter routes, the blue dashed line in the map. This time (H3). It did NOT follow H10 coming in.
It took off at around 1658GMT and headed towards Farnborough Airport where the tracking stopped at roughly 1709GMT. The path took it towards an MoD Training Area, as seen top-left on this public domain map.
Also, interestingly, the history of this particular helicopter has flight status for the last 2/3 weeks. The status for the 3 flights today are "N/A".
Another interesting thing is the squawk code. Online data shows "0023". This is a designated code, and it means "Search And Rescue Operation".
| english |
Yemen’s Ansarullah movement has slammed a recent decision by the United States to designate the popular group as “terrorist” and impose illegal sanctions on some of its leaders, saying the move is in fact a “badge of honor” for the movement.
US President-elect Joe Biden’s nominee for the United States’ top intelligence position has pledged to release an unclassified report on who directed the murder of dissident Saudi journalist Jamal Khashoggi as per a congressional demand that the outgoing Donald Trump administration defied.
Israeli tanks have targeted the Gaza Strip in a new act of aggression against the blockaded Palestinian territory.
A senior Yemeni official has slammed the US for designating the country’s Ansarullah Movement as a “terrorist” organization, saying Washington is fighting alongside Takfiri terror outfits such as Daesh and al-Qaeda against Yemen.
UN Secretary-General Antonio Guterres has condemned the Israeli regime’s recent plan to construct hundreds of new settler units in the occupied West Bank, saying such structures are considered illegal under international law.
A Boeing AH-64 Apache attack helicopter belonging to the US military has reportedly crashed in Syria’s northeastern Province of Hasakah, with no information available about the fate of those onboard.
Syria has vehemently rejected untrue reports by some "hired media outlets" about having held meetings with the Israeli regime, saying those who are spreading such lies seek to draw the whole region into Western Zionist alliances.
Human Rights Watch (HRW) has urged Israeli regime to provide more than 4. 5 million Palestinians in the occupied West Bank and the besieged Gaza Strip with COVID-19 vaccines against the backdrop of reports that Tel Aviv was deliberately letting the spread of the disease in the occupied territories.
US forces have transported 70 imprisoned members of the Daesh Takfiri terrorist group from the northeastern Syrian province of Hasakah to their bases on the Jordan border, a report says.
Turkish and Azerbaijani armed forces are getting prepared to hold joint winter military exercises in Turkey's Kars region. | english |
<reponame>jhorneman/choba-parser<gh_stars>0
{
"name": "choba-parser",
"version": "0.0.1",
"description": "A parser to create data for Choba, the choice-based interactive fiction engine.",
"scripts": {
"buildParser": "node src/buildParser.js src/choba.grammar dist/chobaParser.js"
},
"repository": {
"type": "git",
"url": "https://github.com/jhorneman/choba-parser.git"
},
"keywords": [
"interactive-fiction"
],
"authors": [
"<NAME> <<EMAIL>> (http://www.intelligent-artifice.com)"
],
"license": "MIT",
"url": "https://github.com/jhorneman/choba-parser/blob/master/LICENSE",
"bugs": {
"url": "https://github.com/jhorneman/choba-parser/issues"
},
"homepage": "https://github.com/jhorneman/choba-parser",
"devDependencies": {
"jison": "^0.4.17",
"nomnom": "^1.8.1"
}
}
| json |
{
"name": "afterwerk",
"version": "0.0.0",
"description": "AfterWerk Toronto",
"main": "src/index.js",
"scripts": {
"start": "budo demo/demo.js:bundle.js --live --open",
"build": "browserify demo/demo.js > bundle.js",
"dist": "browserify dist/demo.js | uglifyjs -cm > bundle.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/kbventures/Afterwerk.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/kbventures/Afterwerk/issues"
},
"homepage": "https://github.com/kbventures/Afterwerk#readme",
"dependencies": {
"csjs-inject": "^1.0.1",
"nanohtml": "^1.9.1"
},
"devDependencies": {
"browserify": "^16.5.1",
"budo": "^11.6.3",
"uglify-js": "^3.9.2"
}
}
| json |
{"data":{"ID":"pop8-11","Name":"<NAME>","Supertype":"Trainer","Subtypes":["Supporter"],"HP":"","Types":null,"EvolvesFrom":"","Rules":["You can play only one Supporter card each turn. When you play this card, put it next to your Active Pokémon. When your turn ends, discard this card.","Search your deck for up to 2 in any combination of Basic Pokémon and basic Energy cards, show them to your opponent, and put them into your hand. Shuffle your deck afterward."],"Attacks":null,"Weaknesses":null,"RetreatCost":null,"ConvertedRetreatCost":0,"Set":{"ID":"pop8","Name":"POP Series 8","Series":"POP","PrintedTotal":17,"Total":17,"Legalities":{"unlimited":"Legal"},"PtcgoCode":"","ReleaseDate":"2008/09/01","UpdatedAt":"2018/03/04 10:35:00","Images":{"logo":"https://images.pokemontcg.io/pop8/logo.png","symbol":"https://images.pokemontcg.io/pop8/symbol.png"}},"Number":"11","Artist":"<NAME>","Rarity":"Uncommon","NationalPokedexNumbers":null,"Legalities":{"unlimited":"Legal"},"RegulationMark":"","Images":{"large":"https://images.pokemontcg.io/pop8/11_hires.png","small":"https://images.pokemontcg.io/pop8/11.png"},"CardMarket":{"URL":"https://prices.pokemontcg.io/cardmarket/pop8-11","UpdatedAt":"2022/03/10","Prices":{"AverageSellPrice":0,"LowPrice":1.3,"TrendPrice":1.77,"ReverseHoloTrend":0,"Avg1":2.5,"Avg7":1.69,"Avg30":1.07,"ReverseHoloAvg1":0,"ReverseHoloAvg7":0,"ReverseHoloAvg30":0}}}}
| json |
<gh_stars>1-10
package net.minecraft.world.gen.feature;
import java.util.Random;
import net.minecraft.block.state.IBlockState;
import net.minecraft.util.BlockPos;
import net.minecraft.world.World;
public abstract class WorldGenerator {
private final boolean field_76488_a;
public WorldGenerator() {
this(false);
}
public WorldGenerator(boolean p_i2013_1_) {
this.field_76488_a = p_i2013_1_;
}
public abstract boolean func_180709_b(World var1, Random var2, BlockPos var3);
public void func_175904_e() {
}
protected void func_175903_a(World p_175903_1_, BlockPos p_175903_2_, IBlockState p_175903_3_) {
if(this.field_76488_a) {
p_175903_1_.func_180501_a(p_175903_2_, p_175903_3_, 3);
} else {
p_175903_1_.func_180501_a(p_175903_2_, p_175903_3_, 2);
}
}
}
| java |
import Vue from 'vue'
import Vuex from 'vuex'
import Storage from 'zstorage'
Vue.use(Vuex)
const state = {
user: null,
baseUrl: apiServer,
token: '',
themeValue: 'black',
centerTitle: '治电一期综合管理后台'
}
const mutations = {
SET_USER(state, user) {
state.user = user
},
LOG_OUT(state) {
state.user = null
Storage.set('admin_user', null)
},
SET_TOKEN(state, token) {
state.token = token
},
SET_THEME(state, theme) {
state.themeValue = theme
},
SET_SERVER(state, server) {
state.baseUrl = server
}
}
const actions = {
LOG_OUT({ commit }) {
commit('LOG_OUT')
},
SET_USER(state, user) {
state.commit('SET_USER', user)
},
SET_TOKEN(state, token) {
state.commit('SET_TOKEN', token)
},
SET_THEME(state, theme) {
state.commit('SET_THEME', theme)
},
SET_SERVER(state, server) {
state.commit('SET_SERVER', server)
}
}
export default new Vuex.Store({
state,
mutations,
getters: {},
actions: actions
})
| javascript |
After winning a closely-contested series against England, India skipper Virat Kohli questioned the scheduling of the matches and hoped that the authorities will look into it. "Scheduling needs to be looked at in the future, [especially] in these times. Because playing in bio-bubbles will be difficult, and everyone can't have the same mental capacity all the time. I am sure things will be discussed in the future," said the India skipper after he led his team to a 2-1 win in the ODI series on Sunday, which capped off a gruelling international calendar for his boys. Immediately after the Indian Premier League T20 tournament that ended in November last year in UAE, India have been busy in full series with top international sides -- Australia (away) and England (at home). They have played eight Test matches, six ODIs and six T20 Internationals. This year, Test matches and T20 Internationals needed to be given significance since there is the World Test Championship final which India will play in June as well as the T20 World Cup here in India in October-November. The ODI matches are turning out to be unnecessary disturbance. Kohli was also unhappy with the man-of-the-match and man-of-the-series awards saying that they should have been given to Shardul Thakur (4/67 and 30 off 21 balls) and Bhuvneshwar Kumar (6 wickets in three matches and economy rate of 4. 65) respectively. Jonny Bairstow was declared man of the series and Sam Curran was the man of the match. "I am surprised Shardul Thakur wasn't the man of the match, and Bhuvi (Bhuvneshwar Kumar) wasn't the man of the series. These guys were the difference in middle overs and powerplay. A lot of credit to them for bowling in tough conditions," he added. The 32-year-old said that he was impressed by the depth of India's batting. "Death overs batting was extremely good. If the top three can get a hundred, then we can get scores in the range of 370 and 380. This win has been sweet because it's against the top team in the world. " | english |
package ru.synesis.kipod.utils;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.util.Arrays;
import java.util.Collection;
import java.util.Objects;
import java.util.stream.Collectors;
public class TestUtils {
public static String readFileFromCp(String path, ClassLoader cl) throws IOException, URISyntaxException {
path = Objects.requireNonNull(path, "Path required");
URL resource = cl.getResource(path);
if (resource == null) throw new FileNotFoundException(path);
return Files
.readAllLines(new File(resource.toURI()).toPath(), StandardCharsets.UTF_8)
.stream()
.collect(Collectors.joining(" "));
}
public static Collection<String> splitTextByStatements(String text) {
text = Objects.requireNonNull(text, "Text required");
String[] res = text.split(";\\n");
return Arrays.stream(res).map(s -> s + ";").collect(Collectors.toList());
}
}
| java |
/*
* Licensed to Crate under one or more contributor license agreements.
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership. Crate licenses this file
* to you under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may
* obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*
* However, if you have executed another commercial license agreement
* with Crate these terms will supersede the license and you may use the
* software solely pursuant to the terms of the relevant commercial
* agreement.
*/
package io.crate.execution.jobs.transport;
import static io.crate.testing.DiscoveryNodes.newNode;
import static org.hamcrest.Matchers.is;
import static org.mockito.Mockito.mock;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicInteger;
import org.elasticsearch.Version;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.transport.Transport;
import org.elasticsearch.transport.TransportService;
import org.junit.Test;
import io.crate.exceptions.TaskMissing;
import io.crate.execution.engine.collect.stats.JobsLogs;
import io.crate.execution.jobs.DummyTask;
import io.crate.execution.jobs.NodeLimits;
import io.crate.execution.jobs.RootTask;
import io.crate.execution.jobs.TasksService;
import io.crate.execution.jobs.kill.KillJobsRequest;
import io.crate.execution.jobs.kill.TransportKillJobsNodeAction;
import io.crate.test.integration.CrateDummyClusterServiceUnitTest;
public class NodeDisconnectJobMonitorServiceTest extends CrateDummyClusterServiceUnitTest {
private TasksService tasksInstance() throws Exception {
return new TasksService(clusterService, new JobsLogs(() -> true));
}
@Test
public void testOnNodeDisconnectedKillsJobOriginatingFromThatNode() throws Exception {
TasksService tasksService = tasksInstance();
RootTask.Builder builder = tasksService.newBuilder(UUID.randomUUID());
builder.addTask(new DummyTask());
RootTask context = tasksService.createTask(builder);
NodeDisconnectJobMonitorService monitorService = new NodeDisconnectJobMonitorService(
tasksService,
new NodeLimits(),
mock(TransportService.class),
mock(TransportKillJobsNodeAction.class));
monitorService.onNodeDisconnected(
new DiscoveryNode(NODE_ID, buildNewFakeTransportAddress(), Version.CURRENT),
mock(Transport.Connection.class)
);
expectedException.expect(TaskMissing.class);
tasksService.getTask(context.jobId());
monitorService.close();
}
@Test
public void testOnParticipatingNodeDisconnectedKillsJob() throws Exception {
TasksService tasksService = tasksInstance();
DiscoveryNode coordinator = newNode("coordinator");
DiscoveryNode dataNode = newNode("dataNode");
RootTask.Builder builder = tasksService.newBuilder(UUID.randomUUID(), "dummy-user", coordinator.getId(), Arrays.asList(coordinator.getId(), dataNode.getId()));
builder.addTask(new DummyTask());
tasksService.createTask(builder);
// add a second job that is coordinated by the other node to make sure the the broadcast logic is run
// even though there are jobs coordinated by the disconnected node
builder = tasksService.newBuilder(UUID.randomUUID(), "dummy-user", dataNode.getId(), Collections.emptySet());
builder.addTask(new DummyTask());
tasksService.createTask(builder);
AtomicInteger broadcasts = new AtomicInteger(0);
TransportKillJobsNodeAction killAction = new TransportKillJobsNodeAction(
tasksService,
clusterService,
mock(TransportService.class)
) {
@Override
public void broadcast(KillJobsRequest request, ActionListener<Long> listener, Collection<String> excludedNodeIds) {
broadcasts.incrementAndGet();
}
};
NodeDisconnectJobMonitorService monitorService = new NodeDisconnectJobMonitorService(
tasksService,
new NodeLimits(),
mock(TransportService.class),
killAction);
monitorService.onNodeDisconnected(dataNode, mock(Transport.Connection.class));
assertThat(broadcasts.get(), is(1));
monitorService.close();
}
}
| java |
body,
html {
width: 100%;
height: 100%;
}
body {
font-family: 'Merriweather', 'Helvetica Neue', Arial, sans-serif;
}
hr {
max-width: 50px;
border-width: 3px;
border-color: rgb(211, 187, 48);;
}
hr.light {
border-color: #fff;
}
a {
color: rgb(211, 187, 48);;
-webkit-transition: all 0.2s;
-moz-transition: all 0.2s;
transition: all 0.2s;
}
a:hover {
color: rgb(211, 187, 48);;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: 'Open Sans', 'Helvetica Neue', Arial, sans-serif;
}
.bg-primary {
background-color: rgb(211, 187, 48); !important;
}
.bg-dark {
background-color: #212529 !important;
}
.text-faded {
color: rgba(255, 255, 255, 0.7);
}
section {
padding: 8rem 0;
}
.section-heading {
margin-top: 0;
}
::-moz-selection {
color: #fff;
background: #212529;
text-shadow: none;
}
::selection {
color: #fff;
background: #212529;
text-shadow: none;
}
img::selection {
color: #fff;
background: transparent;
}
img::-moz-selection {
color: #fff;
background: transparent;
}
#mainNav {
border-bottom: 1px solid rgba(33, 37, 41, 0.1);
background-color: #fff;
font-family: 'Open Sans', 'Helvetica Neue', Arial, sans-serif;
-webkit-transition: all 0.2s;
-moz-transition: all 0.2s;
transition: all 0.2s;
}
#mainNav .navbar-brand {
font-weight: 700;
text-transform: uppercase;
color: rgb(211, 187, 48);;
font-family: 'Open Sans', 'Helvetica Neue', Arial, sans-serif;
}
#mainNav .navbar-brand:focus, #mainNav .navbar-brand:hover {
color: rgb(211, 187, 48);;
}
#mainNav .navbar-nav > li.nav-item > a.nav-link,
#mainNav .navbar-nav > li.nav-item > a.nav-link:focus {
font-size: .9rem;
font-weight: 700;
text-transform: uppercase;
color: #212529;
}
#mainNav .navbar-nav > li.nav-item > a.nav-link:hover,
#mainNav .navbar-nav > li.nav-item > a.nav-link:focus:hover {
color: rgb(211, 187, 48);;
}
#mainNav .navbar-nav > li.nav-item > a.nav-link.active,
#mainNav .navbar-nav > li.nav-item > a.nav-link:focus.active {
color: rgb(211, 187, 48); !important;
background-color: transparent;
}
#mainNav .navbar-nav > li.nav-item > a.nav-link.active:hover,
#mainNav .navbar-nav > li.nav-item > a.nav-link:focus.active:hover {
background-color: transparent;
}
@media (min-width: 992px) {
#mainNav {
border-color: transparent;
background-color: transparent;
}
#mainNav .navbar-brand {
color: rgba(255, 255, 255, 0.7);
}
#mainNav .navbar-brand:focus, #mainNav .navbar-brand:hover {
color: #fff;
}
#mainNav .navbar-nav > li.nav-item > a.nav-link {
padding: 0.5rem 1rem;
}
#mainNav .navbar-nav > li.nav-item > a.nav-link,
#mainNav .navbar-nav > li.nav-item > a.nav-link:focus {
color: rgba(255, 255, 255, 0.7);
}
#mainNav .navbar-nav > li.nav-item > a.nav-link:hover,
#mainNav .navbar-nav > li.nav-item > a.nav-link:focus:hover {
color: #fff;
}
#mainNav.navbar-shrink {
border-bottom: 1px solid rgba(33, 37, 41, 0.1);
background-color: #fff;
}
#mainNav.navbar-shrink .navbar-brand {
color: rgb(211, 187, 48);;
}
#mainNav.navbar-shrink .navbar-brand:focus, #mainNav.navbar-shrink .navbar-brand:hover {
color: rgb(211, 187, 48);;
}
#mainNav.navbar-shrink .navbar-nav > li.nav-item > a.nav-link,
#mainNav.navbar-shrink .navbar-nav > li.nav-item > a.nav-link:focus {
color: #212529;
}
#mainNav.navbar-shrink .navbar-nav > li.nav-item > a.nav-link:hover,
#mainNav.navbar-shrink .navbar-nav > li.nav-item > a.nav-link:focus:hover {
color: rgb(211, 187, 48);;
}
}
header.masthead {
padding-top: 10rem;
padding-bottom: calc(10rem - 56px);
background-image: url("../img/header.jpg");
background-position: center center;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
header.masthead hr {
margin-top: 30px;
margin-bottom: 30px;
}
header.masthead h1 {
font-size: 2rem;
}
header.masthead p {
font-weight: 300;
}
@media (min-width: 768px) {
header.masthead p {
font-size: 1.15rem;
}
}
@media (min-width: 992px) {
header.masthead {
height: 100vh;
min-height: 650px;
padding-top: 0;
padding-bottom: 0;
}
header.masthead h1 {
font-size: 3rem;
}
}
@media (min-width: 1200px) {
header.masthead h1 {
font-size: 4rem;
}
}
.service-box {
max-width: 400px;
}
.portfolio-box {
position: relative;
display: block;
max-width: 650px;
margin: 0 auto;
}
.portfolio-box .portfolio-box-caption {
position: absolute;
bottom: 0;
display: block;
width: 100%;
height: 100%;
text-align: center;
opacity: 0;
color: #fff;
background: rgba(240, 95, 64, 0.9);
-webkit-transition: all 0.2s;
-moz-transition: all 0.2s;
transition: all 0.2s;
}
.portfolio-box .portfolio-box-caption .portfolio-box-caption-content {
position: absolute;
top: 50%;
width: 100%;
transform: translateY(-50%);
text-align: center;
}
.portfolio-box .portfolio-box-caption .portfolio-box-caption-content .project-category,
.portfolio-box .portfolio-box-caption .portfolio-box-caption-content .project-name {
padding: 0 15px;
font-family: 'Open Sans', 'Helvetica Neue', Arial, sans-serif;
}
.portfolio-box .portfolio-box-caption .portfolio-box-caption-content .project-category {
font-size: 14px;
font-weight: 600;
text-transform: uppercase;
}
.portfolio-box .portfolio-box-caption .portfolio-box-caption-content .project-name {
font-size: 18px;
}
.portfolio-box:hover .portfolio-box-caption {
opacity: 1;
}
.portfolio-box:focus {
outline: none;
}
@media (min-width: 768px) {
.portfolio-box .portfolio-box-caption .portfolio-box-caption-content .project-category {
font-size: 16px;
}
.portfolio-box .portfolio-box-caption .portfolio-box-caption-content .project-name {
font-size: 22px;
}
}
.text-primary {
color: rgb(211, 187, 48); !important;
}
.btn {
font-weight: 700;
text-transform: uppercase;
border: none;
border-radius: 300px;
font-family: 'Open Sans', 'Helvetica Neue', Arial, sans-serif;
}
.btn-xl {
padding: 1rem 2rem;
}
.btn-primary {
background-color: rgb(211, 187, 48);
border-color: rgb(211, 187, 48);;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
color: #fff;
background-color: #ee4b28 !important;
}
.btn-primary:active, .btn-primary:focus {
box-shadow: 0 0 0 0.2rem rgba(240, 95, 64, 0.5) !important;
}
/* Always set the map height explicitly to define the size of the div
* element that contains the map. */
#floating-panel {
position: absolute;
top: 10px;
left: 25%;
z-index: 5;
background-color: #fff;
padding: 5px;
border: 1px solid #999;
text-align: center;
font-family: 'Roboto','sans-serif';
line-height: 30px;
padding-left: 10px;
}
.pac-card {
margin: 10px 10px 0 0;
border-radius: 2px 0 0 2px;
box-sizing: border-box;
-moz-box-sizing: border-box;
outline: none;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
background-color: #fff;
font-family: Roboto;
}
#pac-container {
padding-bottom: 12px;
margin-right: 12px;
}
.pac-controls {
display: inline-block;
padding: 5px 11px;
}
.pac-controls label {
font-family: Roboto;
font-size: 13px;
font-weight: 300;
}
#pac-input {
background-color: #fff;
font-family: Roboto;
font-size: 15px;
font-weight: 300;
margin-left: 12px;
padding: 0 11px 0 13px;
text-overflow: ellipsis;
width: 400px;
}
#pac-input:focus {
border-color: #4d90fe;
}
#title {
color: #fff;
background-color: #4d90fe;
font-size: 25px;
font-weight: 500;
padding: 6px 12px;
}
/* The Modal (background) */
.modal {
display: none; /* Hidden by default */
position: fixed; /* Stay in place */
z-index: 1; /* Sit on top */
left: 0;
top: 0;
width: 100%; /* Full width */
height: 100%; /* Full height */
overflow: auto; /* Enable scroll if needed */
background-color: rgb(0,0,0); /* Fallback color */
background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
text-align: center;
}
/* The Modal (background) */
.stripeModal {
display: none; /* Hidden by default */
position: fixed; /* Stay in place */
z-index: 1; /* Sit on top */
left: 0;
top: 0;
width: 100%; /* Full width */
height: 100%; /* Full height */
overflow: auto; /* Enable scroll if needed */
background-color: rgb(0,0,0); /* Fallback color */
background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
text-align: center;
}
/* Modal Content/Box */
.modal-content {
background-color: #fefefe;
margin: 15% auto; /* 15% from the top and centered */
padding: 20px;
border: 1px solid #888;
width: 80%; /* Could be more or less, depending on screen size */
}
/* The Close Button */
.close {
color: #aaa;
float: right;
font-size: 28px;
font-weight: bold;
}
.close:hover,
.close:focus {
color: black;
text-decoration: none;
cursor: pointer;
}
.stripeClose {
color: #aaa;
float: right;
font-size: 28px;
font-weight: bold;
}
.stripeClose:hover,
.stripeClose:focus {
color: black;
text-decoration: none;
cursor: pointer;
}
.StripeElement, #email, #name {
background-color: white;
height: 40px;
padding: 10px 12px;
border-radius: 4px;
border: 1px solid transparent;
box-shadow: 0 1px 3px 0 #e6ebf1;
-webkit-transition: box-shadow 150ms ease;
transition: box-shadow 150ms ease;
}
.StripeElement--focus {
box-shadow: 0 1px 3px 0 #cfd7df;
}
.StripeElement--invalid {
border-color: #fa755a;
}
.StripeElement--webkit-autofill {
background-color: #fefde5 !important;
}
#email {
color: #32325d;
line-height: 18px;
font-family: "Helvetica Neue", Helvetica, sans-serif;
font-size: 16px;
}
#name {
color: #32325d;
line-height: 18px;
font-family: "Helvetica Neue", Helvetica, sans-serif;
font-size: 16px;
}
::placeholder {
color: #aab7c4;
}
.StripeElement {
padding-top: 35px;
}
.form-row {
margin-top: 10px;
}
#card-errors {
color: #fa755a;
}
#button {
margin-top: 25px;
background-color: transparent;
}
#server-response {
margin-top: 15px;
}
| css |
<reponame>ai-teams/ai-economy
{
"title": "AI ECO",
"titleShort": "ECO",
"subtitle": "innovate @ai speed",
"subtitleShort": "@ai speed",
"newDevTitle": "new Post",
"newDevTitleShort": "post",
"newOpsTitle": "new Ops",
"newOpsTitleShort": "ops"
}
| json |
{
"name": "tadirah",
"version": "0.0.0",
"private": true,
"scripts": {
"start": "node ./bin/www"
},
"dependencies": {
"cookie-parser": "~1.4.3",
"debug": "~2.6.9",
"express": "^4.16.4",
"http-errors": "~1.6.2",
"morgan": "~1.9.0",
"pug": "2.0.0-beta11"
},
"engines": {
"node": "10.15.3"
},
"description": "TaDiRAH, which is short for the Taxonomy of Digital Research Activities in the Humanities, is originally found [on the original TaDiRAH website](http://tadirah.dariah.eu/vocab/index.php). This is a redesigned version of the existing website, created for a course in Digital Humanities at Syracuse University. The intent of the project is to make TaDiRAH more accessible for all users, both in terms of intellectual design but also for patrons using screen readers or other accessibility devices. This project also includes some updates in the language used to describe these activities, and provides some well-needed examples of techniques in action.",
"main": "app.js",
"devDependencies": {},
"repository": {
"type": "git",
"url": "git+https://github.com/sunrein/tadirah.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/sunrein/tadirah/issues"
},
"homepage": "https://github.com/sunrein/tadirah#readme"
}
| json |
A case has been filed against 14 people over 124 kg gold haul at Dhaka's Hazrat Shahjalal International Airport in 2013.
Customs' Assistant Revenue Officer Mustafa Kamal filed the case with police on Friday, said Airport Police Station OC Md Shah Alam.
"There are 10 Biman Bangladesh employees among the accused," he said.
According to sources at the Customs Intelligence Division, the Biman employees are Sweeping Supervisor Abu Zafar, Aircraft Mechanic 'Masud', Security Officer Kamrul Hasan, Engineers Saleh Ahmed, Mojibur Rahman, Assistant Aircraft Mechanic Anis Uddin Bhuiyan, Engineering Hangar Mechanic Osman Gani and Junior Inspection officers Shahjahan Siraj, Raihan Ali and 'Maksud'.
The other four accused in the case are a Nepali national Gourango Rosan, Indian citizen Jason Prince, Bangladesh nationals Jasim Uddin and Milon Shikder, chairman of SA Cargo.
Customs Intelligence Division Assistant Director Umme Nahida Akter said that on Jul 24 last year, 1,165 gold bars weighing 124 kg were recovered from an aircraft of Bangladesh Biman coming from Dubai.
According to customs, the estimated market value of the recovered gold was Tk 540 million. It was the biggest gold haul in the history of Bangladesh.
| english |
<gh_stars>0
{
"name": "electron-mailer",
"version": "1.0.0",
"description": "electron email-dispatch-client",
"main": "app/main.js",
"scripts": {
"start": "electron ."
},
"repository": "https://github.com/angeal185/electron-mailer",
"author": "<NAME>",
"license": "MIT",
"devDependencies": {
"electron": "^1.8.4"
},
"dependencies": {
"jquery": "^3.3.1",
"lodash": "^4.17.10",
"nodemailer": "^4.6.4"
}
}
| json |
Former NFL running back Le'Veon Bell is set to make his pro boxing debut when he faces former UFC middleweight and TUF winner Uriah Hall on Saturday, October 29.
The news was announced Thursday morning. They will fight as part of the Most Valuable Promotions’ Jake Paul vs. Anderson Silva event on SHOWTIME PPV in Phoenix, Arizona.
Bell is coming off a KO victory over former NFL running back Adrian Peterson in an exhibition match. He hasn't signed to an NFL team this off-season, and this is his first season away from football.
Hall recently retired from the UFC. He will now transition into the boxing world and will test his skills out against Bell in his debut.
While Bell is new to the combat world, here are five interesting facts about the former All-Pro running back:
After being franchise tagged for the second-straight time by the Pittsburgh Steelers, Bell elected to sit out the entire 2018 NFL season.
Bell had been trying to get a long-term deal with the Steelers, but after two off-seasons in a row, the two couldn't agree to terms. This forced Bell to stay away from the team for the for the season, and it proved costly for his future.
Bell made his amateur boxing debut on September 10. He faced former NFL runningback Adrian Peterson.
Bell scored a fifth-round TKO after being dropped earlier in the fight by Peterson. Bell stated, after the victory, that he wanted to focus on a career in boxing.
Following his departure from the Pittsburgh Steelers, after holding out for the 2018 season, Bell signed a lucrative deal with the New York Jets. The Jets gave him a four-year $52. 5 million deal with $35 million guaranteed. He lasted only two seasons with the team and scored just four touchdowns.
Bell was a big factor for the Pittsburgh Steelers and The Killer Bs' offense early on in his career. During the 2014 season, he set the Steelers franchise record for most scrimmage yards in a single-season with 2,215.
He recorded 1,361 rushing yards and piled up 854 receiving yards while scoring 11 total touchdowns.
Before making a name for himself as a pro, Bell played college football at Michigan State.
In three seasons, he recorded 3,346 rushing yards, 33 rushing touchdowns, 531 receiving yards, and a touchdown. His college career was good enough for the Pittsburgh Steelers to draft him in the second round of the 2013 NFL draft. | english |
import requests
import json
import subprocess
###################################################################
# load_cmd = 1
user = '(your API keys "Token")'
passw = '(your API keys "Secret")'
contid = '(Container ID)'
port = '(SSR Port)'
# ssr = 'ShadowsocksR-dotnet4.0.exe'
###################################################################
url = "https://app.arukas.io/api/containers/"
header = {'content-type': 'application/json'}
response = requests.get(url + contid, auth=(user, passw), headers = header)
json_data = json.loads(response.content)
sub_json_data = json_data["data"]["attributes"];
# print json.dumps(sub_json_data, indent=4, sort_keys=True)
cmd = sub_json_data['cmd']
for x in sub_json_data["port_mappings"][0]:
if x['container_port'] == port:
output_port = x['service_port']
output_host = x['host']
print "Port = " + str(output_port)
if output_host.startswith("seaof-"):
output_host = output_host[6:]
output_host = output_host.split(".")[0]
output_host = output_host.replace("-",".")
print "IP address = " + output_host
###################################################################
in_file = open('gui-config.json')
indata = in_file.read()
out_file = open('gui-config.json.temp', 'w')
out_file.write(indata)
json_data_local = json.loads(indata)
# json_data_local['configs']['server'] = output_host;
# json_data_local['configs']['server_port'] = output_port;
for x in json_data_local["configs"]:
x['server_port'] = output_port
x['server'] = output_host
with open('gui-config.json', 'w') as outfile:
json.dump(json_data_local, outfile, indent=4, sort_keys=True)
###################################################################
# subprocess.Popen([ssr])
raw_input("Parameter loaded, hit close(x) to exit")
| python |
<filename>pkg/pipeline/decode/decode.go
/*
* Copyright (C) 2021 IBM, Inc.
*
* 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 decode
import (
"fmt"
"github.com/netobserv/flowlogs-pipeline/pkg/api"
"github.com/netobserv/flowlogs-pipeline/pkg/config"
)
type Decoder interface {
Decode(in []interface{}) []config.GenericMap
}
func GetDecoder(params api.Decoder) (Decoder, error) {
switch params.Type {
case api.DecoderName("JSON"):
return NewDecodeJson()
case api.DecoderName("Protobuf"):
return NewProtobuf()
}
panic(fmt.Sprintf("`decode` type %s not defined", params.Type))
}
| go |
---
layout: post
title: External Projects for the Week of 2014-12-15
summary: MyByteRub side-swiped in a DDoS attack on their data center, i2pd added su3 router update support
tags: [external, mybyterub, i2p, forkguard]
author: <NAME> (fluffypony)
forum: https://forum.getbyterub.org/1/news-and-announcements/115/monday-byterub-missives-21-december-15th-2014
---
**MyByteRub:** due to a very broad DDoS attack at the data center in which MyByteRub is hosted (not targeted at MyByteRub) the service was offline on Sunday for a 12 hour stretch. We are putting some effort in place to ensure this does not happen again in future. New features added this past week: a "copy to clipboard" helper is now available on the right of your ByteRub address on your dashboard, as well as on the login key review screen and account details screen. In addition, clicking on a transaction in the dashboard or your transaction history screens will show additional details, such as the payment ID used.
**ForkGuard:** added MyByteRub.com and ByteRubClub.com
**I2PD:** massive progress was made this week adding support for the su3 router update format (the previous .sud / .su2 format being deprecated), which is used to deliver updates to all routers on the i2p network, including: router update alerts, plugin update alerts, reseed data, and news feed items. Details on the su3 format can be found here: https://geti2p.net/en/docs/spec/updates
| markdown |
Administrations in Haryana and Punjab on Tuesday said the situation in the region was relatively peaceful after the sentencing of controversial Dera Sacha Sauda chief Gurmeet Ram Rahim Singh. The two states are still on high alert after Singh’s supporters reacted violently to his conviction sentence on August 25.
In Sirsa, officials relaxed the curfew for 12 hours from 7am on Tuesday, PTI reported.
Anger against the administration’s apparent inaction still has locals, particularly those in Panchkula, seething. “Just the suspension of Panchkula Deputy Commissioner Ashok Kumar is not sufficient,” social activist Seema Bhardwaj told the Hindustan Times and demanded that others be held accountable too.
“The political leadership might have helped Dera followers to assemble here but the officers also did not show integrity and buckled under pressure rather than doing their duty,” SK Nayyar, president of citizen welfare association told the Hindustan Times.
| english |
{"comments":[],"workout_items":[],"workout":{"id":37844935,"due":"2019-10-13","short_description":"<p class='rest-day-title'><b><u>Rest Day</u></b></p>","created_at":"2019-09-15T11:43:45.228Z","updated_at":"2019-10-12T23:20:48.133Z","title":"","state":"completed","rest_day":true,"rest_day_instructions":"","warmup":null,"warmup_selected_exercises":[],"cooldown_selected_exercises":[],"cooldown":null,"position":null,"order":1,"uuid":"f8a45131-71a8-47d4-aea6-3303da10197b","program_name":"The Model Athlete","hidden":false,"client_id":413684,"comment_ids":[],"note_id":null,"program_id":null,"workout_item_ids":[]}} | json |
Enchantments are one of the most important features in Minecraft. These are magical powerups that players can add to various types of items used in the game. Some of them are valuable and highly useful, while others have negative effects on the player and are obviously not as useful.
Players can primarily apply most of these powerups from an enchanting table. Additionally, they will also need Lapis Lazuli and bookshelves around the enchanting table to place strong enchantments on their gear. Currently, there are about 40 different types of enchantments, with more sure to arrive with the new updates in 2022, which is why players must know which are the most useful and which aren't.
Top 5 useful Minecraft enchantments in 2022 (And 5 that are not)
This particular enchantment enables a tool to drop more items upon breaking a block. For example, players can get more than one diamond from a diamond ore block using a pickaxe with this enchantment. It has a total of three levels and can be applied to any tool, although it is incompatible with the Silk Touch enchantment.
This one increases the overall attack damage of any melee weapon. It has a total of five levels and can be applied to swords and axes, but is not compatible with the Bane of Arthropods and Smite enchantments.
This increases the overall strength of any armor part and protects the player from heavy attacks from mobs and other players. It has a total of four levels and can be applied to any armor part, including turtle shells. Unfortunately, it is incompatible with the Blast Protection, Fire Protection, or Projectile Protection enchantments.
View the Minecraftwiki here.
This is a treasure enchantment that enables any gear to repair itself with the help of XP points picked up by the player. It has only one level and can be applied to any armor part, any weapon, or any tool, but is incompatible with Infinity.
1) Swift Sneak (Coming soon)
Although this one is still not available and is scheduled to be released with the Minecraft 1. 19 update, this upcoming enchantment enables players to walk faster while in sneak mode, which will be highly useful when encountering the new Warden mob. As of now, it will have three levels can only be applied to boots.
To see Minecraft Skindex, click here.
With a total of three levels, this enchantment can only be applied to a fishing rod and reduces the overall wait time until any fish, junk or loot is hooked by the rod.
This can only be applied to any armor part and reflects some of the damage taken by the player back at the attacker. With every hit reflected, the overall durability of the armor also decreases. This particular enchantment has a total of three levels.
This increases the overall attack damage towards arthropod mobs like spiders, silverfishes, endermites and bees. It also applies the slowness effect of level four to them. It can be applied to swords and axes, with a total of five levels and is currently incompatible with the Smite and Sharpness enchantments.
This is a curse that can be applied to nearly all items on which enchantments can be applied. After a player dies, the item with this curse will vanish and won't drop as an item.
This is another curse that can be applied to any armor part, pumpkin head, elytra or any head. If players wear the cursed item, they won't be able to remove it, unless it breaks or the player dies.
Note: This article is subjective and reflects the opinion of the writer. | english |
<reponame>sjeohp/jni-bindgen
// WARNING: This file was autogenerated by jni-bindgen. Any changes to this file may be lost!!!
#[cfg(any(feature = "all", feature = "android-hardware-ConsumerIrManager_CarrierFrequencyRange"))]
__jni_bindgen! {
/// public final class [ConsumerIrManager.CarrierFrequencyRange](https://developer.android.com/reference/android/hardware/ConsumerIrManager.CarrierFrequencyRange.html)
///
/// Required feature: android-hardware-ConsumerIrManager_CarrierFrequencyRange
public final class ConsumerIrManager_CarrierFrequencyRange ("android/hardware/ConsumerIrManager$CarrierFrequencyRange") extends crate::java::lang::Object {
/// [CarrierFrequencyRange](https://developer.android.com/reference/android/hardware/ConsumerIrManager.CarrierFrequencyRange.html#CarrierFrequencyRange(android.hardware.ConsumerIrManager,%20int,%20int))
///
/// Required features: "android-hardware-ConsumerIrManager"
#[cfg(any(feature = "all", all(feature = "android-hardware-ConsumerIrManager")))]
pub fn new<'env>(__jni_env: &'env __jni_bindgen::Env, arg0: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env crate::android::hardware::ConsumerIrManager>>, arg1: i32, arg2: i32) -> __jni_bindgen::std::result::Result<__jni_bindgen::Local<'env, crate::android::hardware::ConsumerIrManager_CarrierFrequencyRange>, __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
// class.path == "android/hardware/ConsumerIrManager$CarrierFrequencyRange", java.flags == PUBLIC, .name == "<init>", .descriptor == "(Landroid/hardware/ConsumerIrManager;II)V"
unsafe {
let __jni_args = [__jni_bindgen::AsJValue::as_jvalue(&arg0.into()), __jni_bindgen::AsJValue::as_jvalue(&arg1), __jni_bindgen::AsJValue::as_jvalue(&arg2)];
let (__jni_class, __jni_method) = __jni_env.require_class_method("android/hardware/ConsumerIrManager$CarrierFrequencyRange\0", "<init>\0", "(Landroid/hardware/ConsumerIrManager;II)V\0");
__jni_env.new_object_a(__jni_class, __jni_method, __jni_args.as_ptr())
}
}
/// [getMinFrequency](https://developer.android.com/reference/android/hardware/ConsumerIrManager.CarrierFrequencyRange.html#getMinFrequency())
pub fn getMinFrequency<'env>(&'env self) -> __jni_bindgen::std::result::Result<i32, __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
// class.path == "android/hardware/ConsumerIrManager$CarrierFrequencyRange", java.flags == PUBLIC, .name == "getMinFrequency", .descriptor == "()I"
unsafe {
let __jni_args = [];
let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env);
let (__jni_class, __jni_method) = __jni_env.require_class_method("android/hardware/ConsumerIrManager$CarrierFrequencyRange\0", "getMinFrequency\0", "()I\0");
__jni_env.call_int_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
}
}
/// [getMaxFrequency](https://developer.android.com/reference/android/hardware/ConsumerIrManager.CarrierFrequencyRange.html#getMaxFrequency())
pub fn getMaxFrequency<'env>(&'env self) -> __jni_bindgen::std::result::Result<i32, __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
// class.path == "android/hardware/ConsumerIrManager$CarrierFrequencyRange", java.flags == PUBLIC, .name == "getMaxFrequency", .descriptor == "()I"
unsafe {
let __jni_args = [];
let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env);
let (__jni_class, __jni_method) = __jni_env.require_class_method("android/hardware/ConsumerIrManager$CarrierFrequencyRange\0", "getMaxFrequency\0", "()I\0");
__jni_env.call_int_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
}
}
// // Not emitting: Non-public field
// // Not emitting: Failed to mangle field name: this$N outer class pointer
// pub fn get_"this$0"<'env>(&'env self) -> __jni_bindgen::std::option::Option<__jni_bindgen::Local<'env, crate::android::hardware::ConsumerIrManager>> { ... }
}
}
| rust |
<reponame>MELDProject/meld_classifier<filename>meld_classifier/saliency.py
# interpretability methods
# general API: saliency(model, X, targets, **kwargs)
# returns: score for each element in X
def integrated_gradients(model, X, targets, kwargs={}):
"""integrated gradients"""
from alibi.explainers import IntegratedGradients
# kwargs for ig
layer = kwargs.pop("layer", None)
method = kwargs.pop("method", "gausslegendre")
n_steps = kwargs.pop("n_steps", 25)
internal_batch_size = kwargs.pop("internal_batch_size", 100)
ig = IntegratedGradients(
model, layer=layer, method=method, n_steps=n_steps, internal_batch_size=internal_batch_size
)
explanation = ig.explain(X, baselines=None, target=targets)
return explanation.data["attributions"][0]
def vanilla_backprop(model, X, targets, target="gt"):
"""vanilla gradients"""
import tensorflow as tf
bce = tf.keras.losses.BinaryCrossentropy()
inputs = tf.cast(X, tf.float32)
gt_outputs = tf.cast(targets, tf.float32)
with tf.GradientTape() as tape:
tape.watch(inputs)
outputs = model(inputs)
loss = bce(gt_outputs, outputs)
grads = tape.gradient(loss, inputs)
return grads.numpy()
| python |
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See License.txt in the repository root.
package com.microsoft.tfs.jni;
import com.microsoft.tfs.jni.internal.keychain.NativeKeychain;
public class KeychainUtils implements Keychain {
private static final KeychainUtils instance = new KeychainUtils();
/**
* @return an instance of a {@link Keychain} implementation full of utility
* methods that are ready-to-call.
*/
public static KeychainUtils getInstance() {
return KeychainUtils.instance;
}
private final NativeKeychain nativeImpl;
private KeychainUtils() {
nativeImpl = new NativeKeychain();
}
/**
* {@inheritDoc}
*/
@Override
public boolean addInternetPassword(final KeychainInternetPassword password, final boolean allowUi) {
return nativeImpl.addInternetPassword(password, allowUi);
}
/**
* {@inheritDoc}
*/
@Override
public boolean modifyInternetPassword(
final KeychainInternetPassword oldPassword,
final KeychainInternetPassword newPassword,
final boolean allowUi) {
return nativeImpl.modifyInternetPassword(oldPassword, newPassword, allowUi);
}
/**
* {@inheritDoc}
*/
@Override
public KeychainInternetPassword findInternetPassword(
final KeychainInternetPassword password,
final boolean allowUi) {
return nativeImpl.findInternetPassword(password, allowUi);
}
/**
* {@inheritDoc}
*/
@Override
public boolean removeInternetPassword(final KeychainInternetPassword password, final boolean allowUi) {
return nativeImpl.removeInternetPassword(password, allowUi);
}
}
| java |
<gh_stars>0
from move import Move
from piece import Piece
from rook import Rook
class King(Piece):
def __init__(self, board, is_white, file, rank):
super().__init__(board, is_white, file, rank)
self.letter = 'K'
if is_white:
self.img = 'Images/WhiteKing.png'
else:
self.img = 'Images/BlackKing.png'
def is_in_check(self):
return self.defended_by_enemy(self.file, self.rank)
def defended_by_enemy(self, f, r):
files = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']
target = f + str(r)
for i in range(0, 8):
for j in range(1, 9):
s = self.board.get_piece(files[i], j)
if not s:
continue
if (self.is_white != s.get_is_white()) and (
target in s.get_defended_squares()):
return True
return False
def get_defended_squares(self):
defended = []
w = self.get_is_white()
opposing = lambda x: x and w != x.get_is_white()
moveable = lambda x: x != -1 and x is None
captureable = lambda x: x != -1 and (x is not None)
add_move = lambda x: defended.append(''.join(map(str, self.get_offset(x))))
for i in range(-1, 2):
for j in range(-1, 2):
if i == 0 and j == 0:
continue
s = self.get_piece_at_offset((i, j))
if moveable(s) or captureable(s):
add_move((i, j))
return defended
def get_possible_moves(self):
possible = []
w = self.get_is_white()
opposing = lambda x: x and w != x.get_is_white()
moveable = lambda x: x != -1 and x is None
captureable = lambda x: x != -1 and (x is not None and opposing(x))
add_move = lambda x, c, e, s, l: possible.append(Move(w, self.letter, self.file, self.rank, self.get_offset(x)[0], int(self.get_offset(x)[1]), c, e, s, l))
# regular king movement
for i in range(-1, 2):
for j in range(-1, 2):
if i == 0 and j == 0:
continue
s = self.get_piece_at_offset((i, j))
if moveable(s) or captureable(s):
add_move((i, j), s, False, False, False)
# short castling
# king cannot have moved
short_castle = not self.get_has_moved()
# h1/8 rook can't have moved
s = self.board.get_piece('h', self.rank)
if not (s and type(s) is Rook and not s.num_times_moved):
short_castle = False
# f1/8 and g1.8 must be empty and undefended
for i in ['f', 'g']:
s = self.board.get_piece(i, self.rank)
if s or self.defended_by_enemy(i, self.rank):
short_castle = False
if short_castle:
add_move((2, 0), None, False, True, False)
# long castling
# king cannot have moved
long_castle = not self.get_has_moved()
# a1/8 rook can't have moved
s = self.board.get_piece('a', self.rank)
if not (s and type(s) is Rook and not s.num_times_moved):
long_castle = False
# c1/8 and d1/8 must be empty and undefended
for i in ['c', 'd']:
s = self.board.get_piece(i, self.rank)
if s or self.defended_by_enemy(i, self.rank):
long_castle = False
# b1/8 only has to be empty
s = self.board.get_piece('b', self.rank)
if s:
long_castle = False
if long_castle:
add_move((-2, 0), None, False, False, True)
return possible
def move(self, move):
f = move.to_file
r = move.to_rank
self.board.remove_piece(move.from_file, move.from_rank)
self.file = f
self.rank = r
self.increment_num_times_moved()
self.board.set_piece(self)
if move.is_short_castle:
s = self.board.get_piece('h', self.rank)
self.board.remove_piece_by_ref(s)
s.file = 'f'
self.board.set_piece(s)
if move.is_long_castle:
s = self.board.get_piece('a', self.rank)
self.board.remove_piece_by_ref(s)
s.file = 'd'
self.board.set_piece(s)
return True | python |
<reponame>HarryHaoLee/Relationship-Analysis-between-Packages
{"name": "ssd.pytorch", "description": "A PyTorch Implementation of Single Shot MultiBox Detector", "license": {"key": "mit", "name": "MIT License", "spdx_id": "MIT", "url": "https://api.github.com/licenses/mit"}, "starNum": 536, "folkNum": 175, "watchNum": 536, "topic": ["computer-vision", "deep-learning", "image-recognition", "machine-learning", "object-detection", "pytorch", "ssd", "webcam"]} | json |
<filename>index/a/apricot-raspberry-pie-106598.json
{
"directions": [
"Place a baking sheet in middle of oven and preheat oven to 450\u00b0F.",
"Whisk together cornstarch, salt, and 1 cup plus 2 tablespoons sugar in a large bowl.",
"Roll out 1 piece of dough (keep remaining piece chilled) on a lightly floured surface with a lightly floured rolling pin into a 13-inch round and fit into a 9-inch glass pie plate (4-cup capacity). Trim edge, leaving a 1/2-inch overhang. Chill shell while rolling out dough for top crust.",
"Roll out remaining piece of dough into an 11-inch round.",
"Stir apricots into sugar mixture until combined, then gently stir in raspberries and spoon filling into shell.",
"Cover pie with pastry round and trim with kitchen shears, leaving a 1/2-inch overhang. Crimp edge decoratively. Brush top of pie with egg and sprinkle all over with remaining 2 tablespoons sugar. Cut 3 steam vents in top crust with a sharp small knife.",
"Bake pie on hot baking sheet 15 minutes. Reduce oven temperature to 375\u00b0F and continue to bake until crust is golden brown and filling is bubbling, about 45 minutes more. Cool pie on a rack at least 2 hours before serving."
],
"ingredients": [
"1/4 cup cornstarch",
"1/4 teaspoon salt",
"1 1/4 cups sugar",
"Pastry dough",
"1 1/2 lb firm-ripe apricots (8 large), cut into 1/2-inch-thick wedges",
"1 1/2 cups raspberries (7 ounces)",
"1 large egg, lightly beaten"
],
"language": "en-US",
"source": "www.epicurious.com",
"tags": [
"Berry",
"Fruit",
"Dessert",
"Bake",
"Fourth of July",
"Picnic",
"Thanksgiving",
"Raspberry",
"Apricot",
"Summer",
"Family Reunion",
"Gourmet"
],
"title": "Apricot Raspberry Pie",
"url": "http://www.epicurious.com/recipes/food/views/apricot-raspberry-pie-106598"
}
| json |
export interface Node {
id: string;
name: string;
}
export interface NodeTotals {
all: number;
unreachable: number;
reachable: number;
unknown: number;
}
| typescript |
FROM LEADING writers to artists, historians to former judges, 625 persons brought together by the Indian Cultural Forum have described the Citizenship (Amendment) Bill, 2019, as “divisive, discriminatory and unconstitutional”, and demanded that the government withdraw it.
A statement issued by the Forum stated that the Bill will, “along with a nationwide NRC, bring untold suffering to people across the country”.
”It will damage, fundamentally and irreparably, the nature of the Indian republic. This is why we demand that the government withdraw the Bill. This is why we demand that the government not betray the Constitution,” it said.
The signatories of the statement include writers Arundhati Roy, Amitav Ghosh, Githa Hariharan and Amit Chaudhuri; artists T M Krishna and Vivan Sundaram; filmpersons Aparna Sen and Anand Patwardhan; scholars Romila Thapar and Ramachandra Guha; and others from a cross-section of society including Justice (retd) A P Shah and Wajahat Habibullah. | english |
Place Details:
Home to Demoiselle cranes which migrate from southern Europe and north Asia between October and March. The Panchala Black Buck Reserve is home to three species of antelope- the Blackbuck, Chinkara and Bluebull.
The average minimum and maximum temperature of Khimsar is as given below. The best time to visit Khimsar is also specified. | english |
Zimbabwe international Brian Vitori has been banned from cricket due to an illegal bowling action.
The 25-year-old left arm seamer was reported during the T20 series his country played against Bangladesh in January and was summoned for assessment in Chennai in India.
All of his deliveries were said to have exceeded the 15 degree limit for arm extension allowed by the International Cricket Council.
As a result of the ban, he cannot play in any international matches or domestic games governed by all National Cricket Federations.
However, he may gain special permission to play domestic games in Zimbabwe. Vitori has played four test matches, which saw him take 12 wickets.
In addition he has played 19 one-day internationals and 11 T20 internationals. He now has the option of modifying his action and applying for reassessment at any stage.
| english |
<reponame>ms0680146/Order_System<filename>orders/tests/test_views.py
from django.test import TestCase, Client
from django.urls import reverse
from orders.models import Order, OrderItem
from datetime import datetime
from django.utils.timezone import get_current_timezone
import pytz
class TestViews(TestCase):
def setUp(self):
self.client = Client()
def test_home_GET(self):
response = self.client.get(reverse('home'))
self.assertEquals(response.status_code, 200)
self.assertTemplateUsed(response, 'layout.html')
def test_piechart_GET(self):
response = self.client.get(reverse('piechart'))
self.assertEquals(response.status_code, 200)
self.assertTemplateUsed(response, 'pages/piechart.html')
def test_cohort_GET(self):
response = self.client.get(reverse('cohort'))
self.assertEquals(response.status_code, 200)
self.assertTemplateUsed(response, 'pages/cohort.html')
def test_barchart_GET(self):
response = self.client.get(reverse('barchart'))
self.assertEquals(response.status_code, 200)
self.assertTemplateUsed(response, 'pages/barchart.html')
def test_get_shipping_data_GET(self):
tz = get_current_timezone()
shipping_free = Order.objects.create(
order_id=1,
customer_id=10,
shipping=0,
created_at=tz.localize(datetime.now())
)
shipping_need = Order.objects.create(
order_id=2,
customer_id=14,
shipping=80,
created_at=tz.localize(datetime.now())
)
response = self.client.get(reverse('api-shipping-data'))
self.assertJSONEqual(response.content, {"labels": ["free shipping", "need shipping"], "counts": [1, 1]})
def test_get_top3_products_GET(self):
product1 = OrderItem.objects.create(
order_id=1,
product_name='product1',
qty=3
)
product2 = OrderItem.objects.create(
order_id=2,
product_name='product2',
qty=2
)
product2_1 = OrderItem.objects.create(
order_id=3,
product_name='product2',
qty=5
)
product3 = OrderItem.objects.create(
order_id=4,
product_name='product3',
qty=1
)
product4 = OrderItem.objects.create(
order_id=5,
product_name='product4',
qty=2
)
response = self.client.get(reverse('api-top3-products'))
self.assertJSONEqual(response.content, {"labels": ["product2", "product1", "product4"], "counts": [7, 3, 2]}) | python |
from abc import ABCMeta, abstractmethod
from typing import Any, Dict, List, Optional, Set, Union, overload
class LLVMType(metaclass=ABCMeta):
@abstractmethod
def to_json(self) -> Any: pass
class LLVMIntType(LLVMType):
def __init__(self, width : int) -> None:
self.width = width
def to_json(self) -> Any:
return {'type': 'primitive type', 'primitive': 'integer', 'size': self.width}
class LLVMArrayType(LLVMType):
def __init__(self, elemtype : 'LLVMType', size : int) -> None:
self.size = size
self.elemtype = elemtype
def to_json(self) -> Any:
return { 'type': 'array',
'element type': self.elemtype.to_json(),
'size': self.size }
class LLVMPointerType(LLVMType):
def __init__(self, points_to : 'LLVMType') -> None:
self.points_to = points_to
def to_json(self) -> Any:
return {'type': 'pointer', 'to type': self.points_to.to_json()}
class LLVMAliasType(LLVMType):
def __init__(self, name : str) -> None:
self.name = name
def to_json(self) -> Any:
return {'type': 'type alias',
'alias of': self.name}
class LLVMStructType(LLVMType):
def __init__(self, field_types : List[LLVMType]) -> None:
self.field_types = field_types
def to_json(self) -> Any:
return {'type': 'struct',
'fields': [fld_ty.to_json() for fld_ty in self.field_types]}
class LLVMPackedStructType(LLVMType):
def __init__(self, field_types : List[LLVMType]) -> None:
self.field_types = field_types
def to_json(self) -> Any:
return {'type': 'packed struct',
'fields': [fld_ty.to_json() for fld_ty in self.field_types]}
| python |
<filename>learning_logs/admin.py<gh_stars>0
from django.contrib import admin
from .models import Topic, Entry
admin.site.register(Topic)
admin.site.register(Entry)
| python |
export { default as AppScreen } from './AppScreen/AppScreen';
export {default as AppNavigator } from './Navigator/AppNavigator';
export { default as SplashScreen } from './Splash/SplashScreen';
export { default as HomeScreen } from './Home/HomeScreen';
export { default as FooterTabs } from './FooterTabs/FooterTabsScreen'; | javascript |
<reponame>ajbanck/brxm
/*
* Copyright 2020 Bloomreach
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.hippoecm.frontend.plugins.reviewedactions;
import java.util.function.UnaryOperator;
import javax.jcr.Node;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
import org.apache.wicket.model.StringResourceModel;
import org.hippoecm.addon.workflow.StdWorkflow;
import org.hippoecm.frontend.plugin.IPluginContext;
import org.hippoecm.frontend.plugin.config.IPluginConfig;
import org.onehippo.repository.documentworkflow.DocumentWorkflow;
public class BranchInfoWorkflowPlugin extends AbstractDocumentWorkflowPlugin {
/**
* Id and name of the document Info.
* The id should start with "info", see MenuHierarchy.
*/
private static final String INFO_DOCUMENT_INFO = "infoDocumentInfo";
public BranchInfoWorkflowPlugin(final IPluginContext context, final IPluginConfig config) {
super(context, config);
add(new StdWorkflow<DocumentWorkflow>(INFO_DOCUMENT_INFO, INFO_DOCUMENT_INFO) {
@Override
public String getSubMenu() {
return "info";
}
@Override
protected IModel<String> getTitle() {
final UnaryOperator<String> resolver = key ->
new StringResourceModel(key, BranchInfoWorkflowPlugin.this).getString();
final Node node = getWorkflow().getNode();
final RetainableStateSummary retainableStateSummary = new RetainableStateSummary(node, getBranchId());
final String info = new BranchInfoBuilder(resolver, getBranchInfo(resolver))
.draftChanges(retainableStateSummary.hasDraftChanges())
.unpublishedChanges(retainableStateSummary.hasUnpublishedChanges())
.live(retainableStateSummary.isLive())
.build();
return Model.of(info);
}
@Override
protected void invoke() {
// do not invoke workflow
}
});
}
/**
* @return the branchInfo for the current branch.
*/
protected String getBranchInfo(final UnaryOperator<String> resolver) {
return resolver.apply(BranchInfoBuilder.CORE_DOCUMENT_KEY);
}
}
| java |
#include "TArc/SharedModules/ActionManagementModule/Private/ShortcutsModel.h"
namespace DAVA
{
namespace ShortcursModelDetails
{
bool IsContextCoflicted(Qt::ShortcutContext left, Qt::ShortcutContext right)
{
return left == Qt::WindowShortcut || left == Qt::ApplicationShortcut || right == Qt::WindowShortcut || right == Qt::ApplicationShortcut;
}
} // namespace ShortcursModelDetails
void ShortcutsModel::SetData(const Vector<KeyBindableAction>& actionsData)
{
using namespace ShortcursModelDetails;
beginResetModel();
blocks.clear();
actions.clear();
Set<QString> sortedBlocks;
for (size_t i = 0; i < actionsData.size(); ++i)
{
const KeyBindableAction& action = actionsData[i];
if (action.action == nullptr)
{
continue;
}
sortedBlocks.insert(action.blockName);
QString conflitsWith;
foreach (const QKeySequence& seq1, action.sequences)
{
for (size_t j = 0; j < actionsData.size(); ++j)
{
if (i == j)
{
continue;
}
const KeyBindableAction& conflicted = actionsData[j];
if (conflicted.action == nullptr)
{
continue;
}
foreach (const QKeySequence& seq2, conflicted.sequences)
{
if (seq1.matches(seq2) != QKeySequence::NoMatch && IsContextCoflicted(conflicted.context, action.context))
{
QString conflictedAction = QString("%1.%2").arg(conflicted.blockName).arg(conflicted.actionName);
if (conflitsWith.isEmpty())
{
conflitsWith = conflictedAction;
}
else
{
conflitsWith = QString("%1;%2").arg(conflitsWith).arg(conflictedAction);
}
break;
}
}
}
}
Node node;
node.action = action;
node.conflictsWith = conflitsWith;
actions[action.blockName].push_back(node);
}
blocks.assign(sortedBlocks.begin(), sortedBlocks.end());
for (auto& action : actions)
{
std::sort(action.second.begin(), action.second.end(), [](const Node& n1, const Node& n2) {
return n1.action.actionName < n2.action.actionName;
});
}
endResetModel();
}
const KeyBindableAction* ShortcutsModel::GetKeyBindableAction(const QModelIndex& index)
{
quintptr id = index.internalId();
if (id == static_cast<quintptr>(-1))
{
return nullptr;
}
QString blockName = blocks[id];
auto iter = actions.find(blockName);
DVASSERT(iter != actions.end());
return &(iter->second[index.row()].action);
}
QModelIndex ShortcutsModel::GetIndex(const QString& blockName) const
{
if (blockName.isEmpty())
{
return QModelIndex();
}
auto blockNameIter = std::find(blocks.begin(), blocks.end(), blockName);
DVASSERT(blockNameIter != blocks.end());
int row = std::distance(blocks.begin(), blockNameIter);
return createIndex(row, 0, static_cast<quintptr>(-1));
}
QModelIndex ShortcutsModel::GetIndex(const QString& blockName, QPointer<QAction> action) const
{
if (blockName.isEmpty())
{
return QModelIndex();
}
auto blockNameIter = std::find(blocks.begin(), blocks.end(), blockName);
DVASSERT(blockNameIter != blocks.end());
quintptr id = std::distance(blocks.begin(), blockNameIter);
auto iter = actions.find(blockName);
DVASSERT(iter != actions.end());
auto actionIter = std::find_if(iter->second.begin(), iter->second.end(), [action](const Node& n) {
return n.action.action == action;
});
DVASSERT(actionIter != iter->second.end());
int row = static_cast<int>(std::distance(iter->second.begin(), actionIter));
return createIndex(row, 0, id);
}
int ShortcutsModel::columnCount(const QModelIndex& parent) const
{
return 4;
}
int ShortcutsModel::rowCount(const QModelIndex& parent) const
{
if (parent == QModelIndex())
{
return static_cast<int>(blocks.size());
}
quintptr id = parent.internalId();
if (id == static_cast<quintptr>(-1))
{
QString blockName = blocks[parent.row()];
auto iter = actions.find(blockName);
DVASSERT(iter != actions.end());
return static_cast<int>(iter->second.size());
}
return 0;
}
QVariant ShortcutsModel::data(const QModelIndex& index, int role) const
{
if (role == Qt::ForegroundRole && index.column() == 3)
{
return QColor(Qt::red);
}
if (role != Qt::DisplayRole)
{
return QVariant();
}
quintptr id = index.internalId();
if (id == static_cast<quintptr>(-1))
{
if (index.column() == 0)
{
return blocks[index.row()];
}
else
{
return QVariant();
}
}
else
{
QString blockName = blocks[id];
auto iter = actions.find(blockName);
DVASSERT(iter != actions.end());
const Node& n = iter->second[index.row()];
switch (index.column())
{
case 0:
return n.action.actionName;
case 1:
{
QString result;
if (n.action.sequences.size() > 0)
{
result = n.action.sequences[0].toString(QKeySequence::NativeText);
}
for (int i = 1; i < n.action.sequences.size(); ++i)
{
result += "; ";
result += n.action.sequences[i].toString(QKeySequence::NativeText);
}
return result;
}
case 2:
{
const EnumMap* contextMap = GlobalEnumMap<Qt::ShortcutContext>::Instance();
return QString(contextMap->ToString(n.action.context));
}
case 3:
{
return n.conflictsWith;
}
default:
break;
}
}
return QVariant();
}
QModelIndex ShortcutsModel::index(int row, int column, const QModelIndex& parent) const
{
if (parent == QModelIndex())
{
if (row >= static_cast<int>(blocks.size()))
{
return QModelIndex();
}
return createIndex(row, column, static_cast<quintptr>(-1));
}
int blockIndex = parent.row();
DVASSERT(blockIndex < static_cast<int>(blocks.size()));
QString blockName = blocks[blockIndex];
auto iter = actions.find(blockName);
DVASSERT(iter != actions.end());
DVASSERT(row < static_cast<int>(iter->second.size()));
return createIndex(row, column, static_cast<quintptr>(blockIndex));
}
QModelIndex ShortcutsModel::parent(const QModelIndex& index) const
{
quintptr id = index.internalId();
if (id == static_cast<quintptr>(-1))
{
return QModelIndex();
}
return createIndex(id, 0, static_cast<quintptr>(-1));
}
QVariant ShortcutsModel::headerData(int section, Qt::Orientation orientation, int role) const
{
if (role != Qt::DisplayRole || orientation == Qt::Vertical)
{
return QVariant();
}
switch (section)
{
case 0:
return "Command";
case 1:
return "Shortcut";
case 2:
return "Context";
case 3:
return "Conflicts with";
}
return QVariant();
}
} // namespace DAVA
| cpp |
Kasaragod: A battery shop employee died after crashing his scooter into what people suspect was a wild boar at Kasaragod's Periya village.
The deceased has been identified as K V Babu (43) of Villarampathi in Koodanam ward.
The accident happened at Chekkippallam on Periya Bazar-Ayamkadavu Road around 8. 30 pm on Monday. A seriously injured Babu was found on the road by Youth Congress district secretary Rakesh Periya and his friend Aneesh Kalliyot who were passing by in a car. They called in the Pullur-Periya grama panchayat's ambulance and shifted him to the District Hospital. "Babu's helmet was shattered and his head was bleeding," said Karthyayani A, the panchayat vice-president, and Babu's neighbour.
As his condition was serious, Babu was shifted to Aster MIMS in Kannur, where he died around 12. 30 am on Tuesday.
Karthyayani said no one saw the wild boar near the site of the accident. "But people saw hoof marks of wild boar near the accident site and also the hair of the animal on the Scooty," Karthyayani.
Morning walkers have often reported droves of boars rummaging the area, she said.
Babu was returning from his battery shop when he met with the accident, she said. He is survived by his elder brother Narayanan and younger sister Sharada. His parents Madhavi and Raman of Madathil predeceased him. | english |
<!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">
<link rel="stylesheet" href="style.css">
<link rel="shortcut icon" href="../../../img/garra.ico" type="image/x-icon">
<title>Seletores personalizados</title>
</head>
<body>
<h1 id="principal">Criando sites com HTMLL e CSS</h1>
<h1>Aprendendo HTML</h1>
<h2 class="basico">HTML básico</h2>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Temporibus, dolores velit unde assumenda vel dolorum nostrum animi itaque molestias eveniet <span class="basico">laudantium delectus</span> mollitia beatae quibusdam eum et hic? Ipsam, laudantium.</p>
<h2 class="intermediario">HTML intermediário</h2>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Libero porro ab totam aperiam error quaerat sint, non amet quo tempore, a dolorum dolor laborum laboriosam maxime autem quae expedita! Culpa.</p>
<h2 class="avancado">HTML avançado</h2>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Sed magnam laudantium explicabo, soluta molestiae odit quisquam nihil, porro rem cupiditate blanditiis a ratione aperiam sequi incidunt laboriosam debitis voluptatem! Commodi!</p>
<h1 class="destaque">Aprendendo CSS</h1>
<h2 class="basico">CSS básico</h2>
<p>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Quo tenetur et, esse omnis reiciendis sequi laudantium alias quas officiis autem sunt, quam sint amet accusantium! Eligendi nesciunt harum sequi suscipit.</p>
<h2 class="intermediario">CSS intermediário</h2>
<p>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Quas, minus maiores ea facere doloribus ullam blanditiis quibusdam dolore, officiis ducimus similique possimus nostrum distinctio qui illo numquam quos laboriosam magni?</p>
<h2 class="avancado destaque">CSS avançado</h2>
<p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Eaque tempora nam et distinctio. Voluptate atque, deserunt nisi non excepturi ea accusantium facere expedita! Est iusto repudiandae architecto quo praesentium ipsam?</p>
</body>
</html> | html |
If Sage Northcutt ever gets bored with MMA, he may want to try his hand at gymnastics. The ONE lightweight MMA fighter is always up to wild stunts that may cause fans to wonder if he is, in fact, not from Earth but from another planet of giants.
'Super' was at it again, filming himself spinning and kicking through the year in what looks like a gymnastics studio after hours when he has the whole place to himself.
Take a look at Northcutt’s acrobatics:
Imagine the reaction if Sage Northcutt attempted such a kick in the ONE circle. It would supersede Anthony Pettis’ highlight-reel kick against Benson Henderson in the final WEC event in 2010.
Sage will look to pull out all of his old tricks and show off some new ones when he makes his long-awaited return to the circle on May 5. He won’t have to travel too far this time, traveling just one timezone to the east from California to Colorado to fight Pakistan’s Ahmed Mujtaba.
Sage Northcutt hasn’t entered the ONE circle since 2019. He was already scheduled once to return from a hiatus in 2021 against Shinya Aoki, but complications recovering from Covid-19 set his return back two more years.
Ahmed Mujtaba is the perfect kind of opponent for the 26-year-old's return fight. On paper, it may be one of the more equal matchups that ONE could put together for Northcutt. Both are in their late 20s and have similar records. While the American has had quite the hype surrounding him since signing with ONE Championship, Mujtaba has the advantage on momentum following back-to-back wins.
The fight will take place at ONE Fight Night 10 on May 5 in Broomfield, Colorado’s 1stBank Center.
Northcutt may not have fought for four years, but that doesn’t mean he wasn’t living an adventurous life in the meantime.
'Super' Sage Northcutt lives in Northern California, where he’s surrounded by trails, national parks, and wild landscapes.
Speaking to Ariel Helwani on The MMA Hour, Northcutt spoke about the many activities he enjoyed while taking a break from fighting. Here’s what he said:
He added:
From the outdoors to the gym, Northcutt will be spending much of the next three months in Sacramento’s Team Alpha Male, getting ready to fight Ahmed Mujtaba in May.
ONE Fight Night 10 streams on Amazon Prime for North American subscribers in US prime time. | english |
<reponame>LiuFang07/bk-cmdb<gh_stars>1000+
/*
* Tencent is pleased to support the open source community by making 蓝鲸 available.
* Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/MIT
* 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 mongo
import (
"configcenter/src/common/mapstr"
"configcenter/src/common/universalsql"
)
var _ universalsql.Result = (*result)(nil)
type result struct {
}
func (r *result) ToSQL() (string, error) {
return "", nil
}
func (r *result) ToMapStr() mapstr.MapStr {
return mapstr.New()
}
| go |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.