text
stringlengths
1
1.04M
language
stringclasses
25 values
<reponame>rohit04saluja/genielibs # Python import time import logging # Unicon from unicon import Connection from unicon.eal.dialogs import Dialog, Statement from unicon.core.errors import ( SubCommandFailure, StateMachineError, TimeoutError, ConnectionError, ) # Logger log = logging.getLogger(__name__) def write_erase_reload_device_without_reconfig( device, via_console, reload_timeout, username=None, password=<PASSWORD>, reload_creds=None, reload_hostname='Router', ): """Execute 'write erase' on device and reload without reconfiguring. Args: device(`obj`): Device object via_console(`str`): Via to use to reach the device console. reload_timeout(`int`): Maximum time to wait for reload to complete reload_creds(`str or list`): Creds to apply if reloading device asks """ # Set 'write erase' dialog wr_dialog = Dialog( [ Statement( pattern=r'.*Do you wish to proceed anyway\? \(y/n\)\s*\[n\]', action="sendline(y)", loop_continue=True, continue_timer=False) ] ) # Execute 'write erase' command log.info("\n\nExecuting 'write erase' on device '{}'".format(device.name)) try: device.execute("write erase", reply=wr_dialog) except Exception as e: raise Exception( "Error while executing 'write erase' on device '{}' : {}".format( device.name, e ) ) from e else: log.info( "Successfully executed 'write erase' command on device '{}'".format( device.name ) ) # Collect device base information before reload os = device.os hostname = device.name username, password = device.api.get_username_password( device = device, username = username, password = password, creds = reload_creds) ip = str(device.connections[via_console]["ip"]) port = str(device.connections[via_console]["port"]) # Execute 'reload' command log.info("\n\nExecuting 'reload' on device '{}'".format(device.name)) try: device.reload( prompt_recovery=True, reload_creds=reload_creds, timeout = reload_timeout) device.disconnect() except SubCommandFailure: # Disconnect and destroy the connection log.info( "Sucessfully executed 'reload' command on device {}".format( device.name ) ) log.info( "Disconnecting and destroying handle to device {}".format( device.name ) ) device.destroy() except Exception as e: raise Exception( "Error while reloading device '{}'".format(device.name) ) from e # Wait until reload has completed and device can be reachable log.info( "\n\nWaiting '{}' seconds for device to reboot after reload...".format( reload_timeout ) ) time.sleep(reload_timeout) # Reconnect to device log.info( "\n\nReconnecting to device '{}' after reload...".format(hostname) ) new_device = Connection( credentials=dict(default=dict(username=username, password=password)), os=os, hostname=reload_hostname, start=["telnet {ip} {port}".format(ip=ip, port=port)], prompt_recovery=True, ) try: new_device.connect() except (ConnectionError, TimeoutError) as e: # Connection or Timeout Error but 'no' has been sent # simply destroy handle at this point new_device.disconnect() log.info( "Reconnected to device '{}' after 'write erase' and reload'".format( hostname ) ) except Exception as e: raise Exception( "Error reconnecting to device '{}' after 'write erase'" " and reload".format(hostname) ) from e else: new_device.disconnect() log.info( "Successully reconnected to device '{}' after 'write erase' " "and reload'".format(hostname) )
python
import Ember from 'ember'; import { Ability } from 'ember-can'; export default Ability.extend({ canImport: Ember.computed(function() { return this.get('session').hasPermission('iuf/junia', 'import'); }), canAnalyze: Ember.computed(function() { return this.get('session').hasPermission('iuf/junia', 'analyze'); }) });
javascript
import numpy as np from itertools import chain, islice, product, repeat, cycle, izip from fos.actor.surf import CommonSurfaceGroup, IlluminatedSurfaceGroup from fos.core.world import World from fos.lib.pyglet.gl import * from fos.lib.pyglet.graphics import Batch from fos.core.actor import Actor from fos.geometry.vec3 import Vec3 from fos.geometry.math3d import * type_to_enum = { gl.GLubyte: gl.GL_UNSIGNED_BYTE, gl.GLushort: gl.GL_UNSIGNED_SHORT, gl.GLuint: gl.GL_UNSIGNED_INT, } def glarray(gltype, seq, length): ''' Convert a list of lists into a flattened ctypes array, eg: [ (1, 2, 3), (4, 5, 6) ] -> (GLfloat*6)(1, 2, 3, 4, 5, 6) ''' arraytype = gltype * length return arraytype(*seq) def tessellate(face): ''' Return the given face broken into a list of triangles, wound in the same direction as the original poly. Does not work for concave faces. e.g. [0, 1, 2, 3, 4] -> [[0, 1, 2], [0, 2, 3], [0, 3, 4]] ''' return ( [face[0], face[index], face[index + 1]] for index in xrange(1, len(face) - 1) ) def face_normal(vertices, face): ''' Return the unit normal vector (at right angles to) this face. Note that the direction of the normal will be reversed if the face's winding is reversed. ''' v0 = vertices[face[0]] v1 = vertices[face[1]] v2 = vertices[face[2]] a = v0 - v1 b = v2 - v1 return b.cross(a).normalized() class GLPrimitive(object): def __init__(self): self.num_glvertices = None self.glvertices = None self.glindex_type = None self.glindices = None self.glcolors = None self.glnormals = None def get_num_glvertices(_, faces): return len(list(chain(*faces))) def get_glvertices(self, vertices, faces): glverts = chain.from_iterable( vertices[index] for face in faces for index in face ) self.num_glvertices = self.get_num_glvertices(faces) return glarray(gl.GLfloat, glverts, self.num_glvertices * 3) def get_glindex_type(self): ''' The type of the glindices array depends on how many vertices there are ''' if self.num_glvertices < 256: index_type = gl.GLubyte elif self.num_glvertices < 65536: index_type = gl.GLushort else: index_type = gl.GLuint return index_type def get_glindices(self, faces): glindices = [] face_offset = 0 for face in faces: indices = xrange(face_offset, face_offset + len(face)) glindices.extend(chain(*tessellate(indices))) face_offset += len(face) self.glindex_type = self.get_glindex_type() return glarray(self.glindex_type, glindices, len(glindices)) def get_glcolors(self, faces, face_colors): glcolors = chain.from_iterable( repeat(color, len(face)) for face, color in izip(faces, face_colors) ) return glarray(gl.GLubyte, chain(*glcolors), self.num_glvertices * 4) def get_glnormals(self, vertices, faces): normals = ( face_normal(vertices, face) for face in faces ) glnormals = chain.from_iterable( repeat(normal, len(face)) for face, normal in izip(faces, normals) ) return glarray( gl.GLfloat, chain(*glnormals), self.num_glvertices * 3) def from_shape(self, vertices, faces, face_colors, affine): self.glvertices = self.get_glvertices(vertices, faces) self.glindices = self.get_glindices(faces) self.glcolors = self.get_glcolors(faces, face_colors) self.glnormals = self.get_glnormals(vertices, faces) self.affine = self.get_affine(affine) def get_affine(self, affine): ident = M3DMatrix44f() ident = m3dLoadIdentity44(ident) translate = m3dTranslateMatrix44(ident, affine[0,3], affine[1,3], affine[2.3]) # do the rotation return translate class Polyhedron(object): ''' Defines a polyhedron, a 3D shape with flat faces and straight edges. Each vertex defines a point in 3d space. Each face is a list of indices into the vertex array, forming a coplanar convex ring defining the face's edges. Each face has its own color. ''' def __init__(self, vertices, faces, face_colors=None, affine=None): if len(vertices) > 0 and not isinstance(vertices[0], Vec3): vertices = [Vec3(*v) for v in vertices] self.vertices = vertices for face in faces: assert len(face) >= 3 for index in face: assert 0 <= index < len(vertices) self.faces = faces if face_colors is None: face_colors = repeat((255, 0, 0, 255)) # if face_colors is None: # face_colors = white # if isinstance(face_colors, Color): # face_colors = repeat(face_colors) # TODO: colors of koch_cube/tetra break if we remove this 'list' # and set face_colors to the return of 'islice'. Don't know why. # returns a list of tuples of len self.faces of the given facecolors self.face_colors = list(islice(cycle(face_colors), len(self.faces))) self.affine = affine def get_glprimitive(self): glprimitive = GLPrimitive() glprimitive.from_shape(self.vertices, self.faces, self.face_colors, self.affine) return glprimitive class Cubes(Actor): def __init__(self, location): ''' # just one cube e2 = 1. / 2 verts = list(product(*repeat([-e2, +e2], 3))) faces = [ [0, 1, 3, 2], # left [4, 6, 7, 5], # right [7, 3, 1, 5], # front [0, 2, 6, 4], # back [3, 7, 6, 2], # top [1, 0, 4, 5], # bottom ] oc = Polyhedron(verts, faces) glprim = oc.get_glprimitive() group = IlluminatedSurfaceGroup() ''' self.primitives = [] nr_cubes = location.shape[0] for i in xrange(nr_cubes): self.primitives.append(self.create_cubes(location[:,i],1.0)) def create_cubes(self, location, edge_size, color=None): e2 = edge_size / 2.0 verts = list(product(*repeat([-e2, +e2], 3))) faces = [ [0, 1, 3, 2], # left [4, 6, 7, 5], # right [7, 3, 1, 5], # front [0, 2, 6, 4], # back [3, 7, 6, 2], # top [1, 0, 4, 5], # bottom ] aff= np.eye(4) aff[3,:3] = location oc = Polyhedron(verts, faces, affine = aff) return oc ''' self.vertex_list = [] self.batch=Batch() self.vertex_list.append(self.batch.add_indexed(len(glprim.glvertices) / 3,\ GL_TRIANGLES,\ None,\ list(glprim.glindices),\ ('v3f/static',np.array(glprim.glvertices)),\ ('n3f/static',list(glprim.glnormals)),\ ('c4B/static',list(glprim.glcolors)) ) ) ver = np.array(glprim.glvertices) for i in range(1,300): self.vertex_list.append(self.batch.add_indexed(len(glprim.glvertices) / 3,\ GL_TRIANGLES,\ None,\ list(glprim.glindices),\ ('v3f/static',ver+(i*1)),\ ('n3f/static',list(glprim.glnormals)),\ ('c4B/static',list(glprim.glcolors)) )) self.vertex_list.append(self.batch.add_indexed(len(glprim.glvertices) / 3,\ GL_TRIANGLES,\ None,\ list(glprim.glindices),\ ('v3f/static',ver-(i*1)),\ ('n3f/static',list(glprim.glnormals)),\ ('c4B/static',list(glprim.glcolors)) )) ''' def draw(self): gl.glEnableClientState(gl.GL_NORMAL_ARRAY) for item in self.primitives: gl.glPushMatrix() # gl.glMultMatrixf(glyph.affine) glyph = item.get_glprimitive() gl.glVertexPointer( 3, gl.GL_FLOAT, 0, glyph.glvertices) gl.glColorPointer( 4, gl.GL_UNSIGNED_BYTE, 0, glyph.glcolors) gl.glNormalPointer(gl.GL_FLOAT, 0, glyph.glnormals) gl.glDrawElements( gl.GL_TRIANGLES, len(glyph.glindices), type_to_enum[glyph.glindex_type], glyph.glindices) gl.glPopMatrix() # self.batch.draw() def delete(self): self.vertex_list.delete() if __name__ == '__main__': mycubes = Cubes( np.array([0.0,0.0,0.0]) )
python
<gh_stars>1-10 {"word":"minster","definition":"A church of a monastery. The name is often retained and applied to the church after the monastery has ceased to exist (as Beverly Minster, Southwell Minster, etc.), and is also improperly used for any large church. Minster house, the official house in which the canons of a cathedral live in common or in rotation. Shipley."}
json
import numpy as np import os, sys os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' from tensorflow.keras.models import Model import tensorflow as tf from PIL import Image from utils_rtp import ProMP class Predictor: def __init__(self, encoder_model_path, predictor_model_path): self.all_phi = self.promp_train() encoder_model = tf.keras.models.load_model(encoder_model_path) self.encoder = Model(encoder_model.input, encoder_model.get_layer("bottleneck").output) self.exp_model = tf.keras.models.load_model(predictor_model_path, compile=False) def promp_train(self): phi = ProMP().basis_func_gauss_glb() zeros = np.zeros([phi.shape[0], 8]) h1 = np.hstack((phi, zeros, zeros, zeros, zeros, zeros, zeros)) h2 = np.hstack((zeros, phi, zeros, zeros, zeros, zeros, zeros)) h3 = np.hstack((zeros, zeros, phi, zeros, zeros, zeros, zeros)) h4 = np.hstack((zeros, zeros, zeros, phi, zeros, zeros, zeros)) h5 = np.hstack((zeros, zeros, zeros, zeros, phi, zeros, zeros)) h6 = np.hstack((zeros, zeros, zeros, zeros, zeros, phi, zeros)) h7 = np.hstack((zeros, zeros, zeros, zeros, zeros, zeros, phi)) vstack = np.vstack((h1, h2, h3, h4, h5, h6, h7)) vstack = tf.cast(vstack, tf.float32) return vstack def preprocess_image(self, image): return np.asarray(image.resize((256, 256))) def predict(self, image_numpy): # image_numpy = np.expand_dims(image_numpy, axis=0) latent_img = self.encoder.predict(image_numpy/255) q_val_pred = self.exp_model.predict(latent_img) traj_pred = np.matmul(self.all_phi, np.transpose(q_val_pred)).squeeze() return traj_pred #np.reshape(traj_pred, (-1, 150)) if __name__ == "__main__": ENCODED_MODEL_PATH = "/home/arshad/Documents/reach_to_palpate_validation_models/encoded_model_regions" PREDICTOR_MODEL = "/home/arshad/Documents/reach_to_palpate_validation_models/model_cnn_rgb_1" image = np.load( "/home/arshad/catkin_ws/image_xy_rtp.npy" ) predictor = Predictor(ENCODED_MODEL_PATH, PREDICTOR_MODEL) traj = predictor.predict(image) np.save("/home/arshad/catkin_ws/predicted_joints_values_rtp.npy", traj) print ("\n Predicted ProMPs weights for RTP task. Joint trajectory is saved in the file. \n Press 'p' to display the trajectory...")
python
Members of the Civil Society participate in a March Pass in Kathmandu on Friday. KATHMANDU: The civil movement has issued a manifesto from Tundikhel in Kathmandu on Friday. The manifesto was issued at the citizens’ declaration meeting held at Tundikhel March Pass. The declaration has talked about emphasized revising the Constitution for giving a forward-looking momentum to democracy, making the people’s elected bodies and state machinery accountable to democracy. The manifesto has also said that voices will be raised against the autocratic character to immediately repeal the act and rules that restrict the fundamental rights. Likewise, the manifesto has also stated that ban, repression, arrest, detention and killing of any party, group or campaign on the basis of political belief and dissent should be stopped immediately. Earlier, civil society activists had organized the Tundikhel March in Kathmandu on Friday afternoon.
english
563 Written Answers Restructuring of Schemes for Local Bodies 416. SHRI R. GOPALAKRISHNAN: Will the Minister of PANCHAYATI RAJ be pleased to state: (a) whether the Government proposes to restructure the schemes meant for local bodies; (b) if so, the details thereof and if not, the reasons therefor; (c) whether the schemes are being/will be extended to all the States; and (d) if so, the details thereof? THE MINISTER OF STATE IN THE MINISTRY OF AGRICULTURE AND FARMERS WELFARE AND MINISTER OF STATE IN THE MINISTRY OF PANCHAYATI RAJ (SHRI PARSHOTTAM RUPALA): (a) to (d) In order to strengthen governance capabilities of Panchayati Raj Institutions to deliver on Sustainable Development Goals, the Government has launched the Centrally Sponsored Scheme of Rashtriya Gram Swaraj Abhiyan (RGSA) to be implemented from 2018-19 to 2021-22 with total outlay of Rs 7255.50 crore having Central share of Rs. 4500 crore and State share of 2755.50 crore. The scheme will have both central as well as state components. The central component will be fully funded by Government of India. However, Centre: State funding pattern will be 60:40 for all States, except North East and Hill States where Centre: State funding pattern will be 90:10. For all Union Territories (UTs), the Central share will be 100%. The Scheme will extend to all States and Union Territories of the country. In achieving its objectives, the Scheme will have main thrust on convergence with Mission Antyodaya, and emphasis on strengthening PRIS in the Aspirational Districts as identified by NITI Aayog. Assets Created Under MGNREGS 417. SHRI JANARDAN SINGH SIGRIWAL: Will the Minister of RURAL DEVELOPMENT be pleased to state: (a) the total funds released and utilised under the Mahatma Gandhi National Rural Employment Guarantee Scheme (MGNREGS) during each of the last three years and the current year, State/UT-wise and year-wise; (b) whether the assets created under the MGNREGS are commensurate with the funds provided during the said period; (c) if so, the details thereof and if not, the reasons therefor: irregularities/misappropriation of funds under MGNREGS have come to the notice of the Government; and to Questions 564 % of expenditure on Agriculture & Allied Works (e) if so, the details thereof during each of the last three years and the current year and the reaction of the Government thereto along with the corrective measures taken by the Government to check such irregularities in future? THE MINISTER OF STATE IN THE MINISTRY OF RURAL DEVELOPMENT (SHRI RAM KRIPAL YADAV): (a)to(c) State/UTs-wise details of total Central funds released and expenditure under the Mahatma Gandhi National Rural Employment Guarantee Scheme (MGNREGS) during last three years and current financial year 2018-19 are given in the enclosed Statement. The programme over the last three years has focused on creation of durable assets, with primary to Natural Resource Management and Water Conservation Works. The percentage of expenditure on Agriculture & Allied works under MGNREGS during the last three year and current year as on 16.07.2018 are given below: (d) and (e) Complaints of irregularities/ misappropriation of funds in implementation of Mahatma Gandhi National Rural Employment Guarantee Scheme (MGNREGS) in States/UTs are received in the Ministry from time to time. Since the responsibility of implementation of MGNREGS is vested with the State Governments/UTs, all complaints received in the Ministry and forwarded to the concerned State Governments/UTS for taking appropriate action including investigation, as per law. With a view to bring in more transparency in the system and to minimize leakages, Direct Benefit Transfer (DBT) system in wage payment has been adopted. The Ministry has introduced Electronic Fund Management System (e-FMS) under which 96% of wage payments are electronically credited into the accounts of the workers through DBT system. The Government has started National Electronic Fund Management System (NeFMS) in 24 States and 1 UT for direct payment of wages into workers account.
english
Hardik Pandya, the allrounder, receives his ODI cap from Kapil Dev, so that's one debutant confirmed in the side. Jayant Yadav does not have the same fortune, so he should be on the sidelines today. New Zealand are going in with two spinners and three pacers - Henry and Boult have been rested. Finally, some luck going for New Zealand. Kedar Jadhav, who has one first class wicket and one list A wicket, comes on to bowl and traps James Neesham plumb in front. Luckily for the batsman, umpire Bruce Oxenford rules in his favour. Well, luck only stays with Neesham for that long. Jadhav comes back much stronger in the next over and has the batsman tamely chipping the ball back to him. And Jadhav's not even finished. He just takes one more ball to send back Mitchell Santner, edging behind to Dhoni. 67/7!
english
The groom called off the wedding after the bride's father informed him they could not provide any additional dowry, the groom called off the wedding under the pretext of the poor marks of the girl. Digital Desk: We have often come across cases where the groom's family cancels the wedding if the bride's family couldn't meet dowry demand. These incidents are not new in India. But according to reports, a man in the Uttar Pradesh district of Kannauj called off his wedding because of the bride's "low" score in Class 12. The strange incident occurred recently in the Tirva Kotwali neighbourhood of Kannauj. The bride's family claims that the groom's family called off the wedding because their dowry expectations were not satisfied, according to Amarujala. Even though the "Godh Bharai" ritual was performed, the wedding was called off. The father of the bride claimed that because of the girl's poor grades on her Class 12 report card, the groom's family attempted to end the relationship. The father of the bride-to-be complained about the groom and his family. According to the complaint, the bride's father claimed that Ramshankar of Baganwa village fixed the marriage of his daughter Soni with Sonu. The ritual known as "Godh Bharai" took place on December 4, 2022. The bride's father spent Rs 60,000 on the event and gave the groom a gold ring worth Rs 15,000 as well. But the groom's family demanded a dowry a few days later. The groom called off the wedding after the bride's father informed him they could not provide any additional dowry, the groom called off the wedding under the pretext of the poor marks of the girl. Police are reportedly trying to put an end to the argument at this time.
english
# React International A react development environment for international - With examples
markdown
<reponame>LarsKemmann/IdentityServer3.Admin [ { "outputFile": "Assets/Content/style.css", "inputFile": "Assets/Content/style.less" } ]
json
use crate::auth::Auth; use crate::common::UdpStream; use crate::inbound::{Inbound, InboundAccept, InboundRequest}; use crate::outbound::Outbound; use crate::utils::count_stream::CountStream; use anyhow::{anyhow, bail, Context, Error, Result}; use futures::{future::try_select, SinkExt, StreamExt, TryStreamExt}; use log::{error, info, warn}; use std::{io, sync::Arc, time::Duration}; use tokio::{ io::{copy, split, AsyncRead, AsyncWrite, AsyncWriteExt}, net::TcpListener, pin, select, sync::mpsc::{unbounded_channel, UnboundedReceiver}, time::timeout, }; use tokio_io_timeout::TimeoutStream; use tokio_stream::wrappers::UnboundedReceiverStream; const FULL_CONE_TIMEOUT: Duration = Duration::from_secs(30); pub struct Relay<I, O> { listener: TcpListener, inbound: Arc<I>, outbound: Arc<O>, tcp_nodelay: bool, pub tcp_timeout: Option<Duration>, } /// Connect two `TcpStream`. Unlike `copy_bidirectional`, it closes the other side once one side is done. pub async fn connect_tcp( t1: impl AsyncRead + AsyncWrite, t2: impl AsyncRead + AsyncWrite, ) -> io::Result<()> { let (mut read_1, mut write_1) = split(t1); let (mut read_2, mut write_2) = split(t2); let fut1 = async { let r = copy(&mut read_1, &mut write_2).await; write_2.shutdown().await?; r }; let fut2 = async { let r = copy(&mut read_2, &mut write_1).await; write_1.shutdown().await?; r }; pin!(fut1, fut2); match try_select(fut1, fut2).await { Ok(_) => {} Err(e) => return Err(e.factor_first().0), }; Ok(()) } impl<I, O> Relay<I, O> where I: Inbound + 'static, O: Outbound + 'static, { async fn process( outbound: Arc<O>, inbound_accept: InboundAccept<I::Metadata, I::TcpStream, I::UdpSocket>, ) -> Result<()> { match inbound_accept.request { InboundRequest::TcpConnect { addr, stream } => { let target = outbound.tcp_connect(&addr).await?; pin!(target, stream); connect_tcp(&mut stream, &mut target) .await .map_err(|e| anyhow!("Connection reset by peer. {:?}", e))?; } InboundRequest::UdpBind { addr, stream } => { let target = outbound.udp_bind(&addr).await?; pin!(target, stream); info!("UDP tunnel created."); handle_udp(&mut stream, &mut target).await?; stream.close().await?; target.close().await?; } } Ok(()) } } struct PacketStat { password: String, upload: u64, download: u64, } impl PacketStat { // conn_id, upload, download fn new(password: String, upload: u64, download: u64) -> Self { PacketStat { password, upload, download, } } } impl<I, O> Relay<I, O> where I: Inbound<Metadata = String> + 'static, O: Outbound + 'static, { pub fn new(listener: TcpListener, inbound: I, outbound: O, tcp_nodelay: bool) -> Self { Relay { listener, inbound: Arc::new(inbound), outbound: Arc::new(outbound), tcp_nodelay, tcp_timeout: None, } } pub async fn serve_trojan(&self, auth: Arc<dyn Auth>) -> Result<()> { let (tx, rx) = unbounded_channel::<PacketStat>(); tokio::spawn(stat(auth, rx)); loop { let (stream, addr) = self.listener.accept().await?; info!("Inbound connection from {}", addr); stream .set_nodelay(self.tcp_nodelay) .context("Set TCP_NODELAY failed")?; let (stream, sender) = CountStream::new2(stream); let mut stream = TimeoutStream::new(stream); stream.set_read_timeout(self.tcp_timeout); let inbound = self.inbound.clone(); let outbound = self.outbound.clone(); let t = tx.clone(); tokio::spawn(async move { let inbound_accept = inbound.accept(Box::pin(stream), addr).await?; if let Some(accept) = inbound_accept { // Here we got trojan password let password = accept.metadata.clone(); sender .send(Box::new(move |read: usize, write: usize| { t.send(PacketStat::new(password, read as u64, write as u64)) .ok(); })) .ok(); if let Err(e) = Self::process(outbound, accept).await { warn!("Relay error: {:?}", e) } } Ok(()) as Result<()> }); } } } async fn stat(auth: Arc<dyn Auth>, rx: UnboundedReceiver<PacketStat>) { let stream = UnboundedReceiverStream::new(rx); stream .for_each_concurrent(10, |i| { let auth = auth.clone(); async move { if let Err(e) = auth.stat(&i.password, i.upload, i.download).await { error!("Failed to stat: {:?}", e); } } }) .await; } async fn handle_udp(incoming: impl UdpStream, target: impl UdpStream) -> Result<()> { let (mut at, mut ar) = incoming.split(); let (mut bt, mut br) = target.split(); let inbound = async { loop { let (buf, addr) = match br.try_next().await { Ok(Some(r)) => r, _ => continue, }; at.send((buf, addr)) .await .map_err(|_| anyhow!("Broken pipe."))?; } #[allow(unreachable_code)] Ok::<(), Error>(()) }; let outbound = async { while let Ok(Some(res)) = timeout(FULL_CONE_TIMEOUT, ar.next()).await { match res { Ok((buf, addr)) => { if let Err(e) = bt.send((buf, addr.clone())).await { warn!("Unable to send to target {}: {}", addr, e); }; } Err(_) => bail!("Connection reset by peer."), } } Ok::<(), Error>(()) }; select! { r = inbound => r?, r = outbound => r?, }; info!("UDP tunnel closed."); Ok(()) }
rust
Leica's full-frame Typ 116 Q is one of our favorites among the compact cameras we've shot with at TechRadar, and if the standard black finish wasn't quite special enough for you, Leica has teamed up with luggage makers Globe-Trotter to release two special edition models. Like the black model, the new Globe-Trotter special edition models feature a full-frame 24.2MP CMOS sensor, an ultra-fast fixed 28mm f/1.7 lens and a crystal-clear 3,680,000-dot electronic viewfinder, but they're finished in specially selected Globe-Trotter leather in pink or navy. The limited-edition Leica Q ‘Globe-Trotter’ cameras each have a serial number engraved on the top cover of the camera, and come in a specially produced case based on the nine-inch Mini Trotter, finished in leather to match the camera body. The case also features a Bordeaux-colored adjustable shoulder strap that matches the corner leather pieces. If you like the look of these special-edition Leica Qs, you better be quick – and have deep pockets. The Leica Q Globe-Trotter is limited to 50 pieces in each color, and they're available now in the UK at the Leica stores in Mayfair, City of London and Manchester, as well as selected authorized dealers – availability in other regions is still to be confirmed. The cost? £5,400 (around $6,900 or AU$9,450), which is quite a premium over the standard black model, which costs around £3,600 / $4,500 / AU$6,300) at the moment. Exact pricing for other regions is also to be confirmed. Get the hottest deals available in your inbox plus news, reviews, opinion, analysis, deals and more from the TechRadar team. Phil Hall is an experienced writer and editor having worked on some of the largest photography magazines in the UK, and now edit the photography channel of TechRadar, the UK's biggest tech website and one of the largest in the world. He has also worked on numerous commercial projects, including working with manufacturers like Nikon and Fujifilm on bespoke printed and online camera guides, as well as writing technique blogs and copy for the John Lewis Technology guide.
english
<gh_stars>0 package middleware_test import ( "bytes" "fmt" "io/ioutil" "log" "net/http" "testing" "github.com/cixtor/middleware" ) func curl(t *testing.T, method string, hostname string, target string, expected []byte) { var err error var out []byte var req *http.Request var res *http.Response if req, err = http.NewRequest(method, target, nil); err != nil { t.Fatalf("http.NewRequest %s", err) return } req.Host = hostname if res, err = http.DefaultClient.Do(req); err != nil { t.Fatalf("http.DefaultClient %s", err) return } defer res.Body.Close() if out, err = ioutil.ReadAll(res.Body); err != nil { t.Fatalf("ioutil.ReadAll %s", err) return } if !bytes.Equal(out, expected) { t.Fatalf("%s %s\nexpected: %q\nreceived: %q", method, target, expected, out) return } } func TestIndex(t *testing.T) { go func() { router := middleware.New() router.DiscardLogs() defer router.Shutdown() router.GET("/foobar", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello World") }) _ = router.ListenAndServe(":60302") }() curl(t, "GET", "localhost", "http://localhost:60302/foobar", []byte("Hello World")) } func TestUse(t *testing.T) { lorem := func(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.Header().Set("lorem", "lorem") next.ServeHTTP(w, r) }) } ipsum := func(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.Header().Set("ipsum", "ipsum") next.ServeHTTP(w, r) }) } dolor := func(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.Header().Set("dolor", "dolor") next.ServeHTTP(w, r) }) } go func() { router := middleware.New() router.DiscardLogs() router.Use(lorem) router.Use(ipsum) router.Use(dolor) defer router.Shutdown() router.GET("/foobar", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf( w, "%s:%s:%s", w.Header().Get("lorem"), w.Header().Get("ipsum"), w.Header().Get("dolor"), ) }) _ = router.ListenAndServe(":60333") }() curl(t, "GET", "localhost", "http://localhost:60333/foobar", []byte("lorem:ipsum:dolor")) } func TestUse2(t *testing.T) { lorem := func(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "<%s>", "1:lorem") next.ServeHTTP(w, r) }) } ipsum := func(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "<%s>", "2:ipsum") next.ServeHTTP(w, r) }) } dolor := func(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "<%s>", "3:dolor") next.ServeHTTP(w, r) }) } go func() { router := middleware.New() router.DiscardLogs() defer router.Shutdown() router.GET("/foobar", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "<4:foobar>") }) router.Use(lorem) router.Use(ipsum) router.Use(dolor) _ = router.ListenAndServe(":60334") }() curl(t, "GET", "localhost", "http://localhost:60334/foobar", []byte("<1:lorem><2:ipsum><3:dolor><4:foobar>")) } func TestPOST(t *testing.T) { go func() { router := middleware.New() router.DiscardLogs() defer router.Shutdown() router.POST("/foobar", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello World POST") }) _ = router.ListenAndServe(":60303") }() curl(t, "POST", "localhost", "http://localhost:60303/foobar", []byte("Hello World POST")) } func TestNotFound(t *testing.T) { go func() { router := middleware.New() router.DiscardLogs() defer router.Shutdown() router.GET("/", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello World GET") }) _ = router.ListenAndServe(":60304") }() curl(t, "GET", "localhost", "http://localhost:60304/notfound", []byte("404 page not found\n")) } func TestNotFoundSimilar(t *testing.T) { go func() { router := middleware.New() router.DiscardLogs() defer router.Shutdown() router.GET("/lorem/ipsum/dolor", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello World GET") }) _ = router.ListenAndServe(":60314") }() curl(t, "GET", "localhost", "http://localhost:60314/lorem/ipsum/dolores", []byte("404 page not found\n")) } func TestNotFoundInvalid(t *testing.T) { go func() { router := middleware.New() router.DiscardLogs() router.NotFound = nil defer router.Shutdown() router.GET("/", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello World GET") }) _ = router.ListenAndServe(":60317") }() curl(t, "GET", "localhost", "http://localhost:60317/test", []byte("404 page not found\n")) } func TestNotFoundCustom(t *testing.T) { go func() { router := middleware.New() router.DiscardLogs() router.NotFound = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "404 page does not exist\n") }) defer router.Shutdown() router.GET("/", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello World GET") }) _ = router.ListenAndServe(":60318") }() curl(t, "GET", "localhost", "http://localhost:60318/test", []byte("404 page does not exist\n")) } func TestNotFoundCustomWithInterceptor(t *testing.T) { go func() { router := middleware.New() router.DiscardLogs() router.NotFound = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "404 missing page\n") }) router.Use(func(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { if r.URL.Path == "/test" { fmt.Fprintf(w, "hello interceptor\n") // return /* do not return */ } next.ServeHTTP(w, r) }) }) defer router.Shutdown() router.GET("/", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello World GET") }) _ = router.ListenAndServe(":60319") }() curl(t, "GET", "localhost", "http://localhost:60319/test", []byte("hello interceptor\n404 missing page\n")) } func TestDirectoryListing(t *testing.T) { go func() { router := middleware.New() router.DiscardLogs() defer router.Shutdown() router.STATIC(".", "/assets") log.Fatal(router.ListenAndServe(":60305")) }() curl(t, "GET", "localhost", "http://localhost:60305/assets", []byte("Forbidden\n")) curl(t, "GET", "localhost", "http://localhost:60305/assets/", []byte("Forbidden\n")) curl(t, "GET", "localhost", "http://localhost:60305/assets/.git", []byte("Forbidden\n")) curl(t, "GET", "localhost", "http://localhost:60305/assets/.git/", []byte("Forbidden\n")) curl(t, "GET", "localhost", "http://localhost:60305/assets/.git/objects", []byte("Forbidden\n")) curl(t, "GET", "localhost", "http://localhost:60305/assets/.git/objects/", []byte("Forbidden\n")) } func TestSingleParam(t *testing.T) { go func() { router := middleware.New() router.DiscardLogs() defer router.Shutdown() router.PUT("/hello/:name", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello %s", middleware.Param(r, "name")) }) _ = router.ListenAndServe(":60306") }() curl(t, "PUT", "localhost", "http://localhost:60306/hello/john", []byte("Hello john")) } func TestMultiParam(t *testing.T) { go func() { router := middleware.New() router.DiscardLogs() defer router.Shutdown() router.PATCH("/:group/:section", func(w http.ResponseWriter, r *http.Request) { group := middleware.Param(r, "group") section := middleware.Param(r, "section") fmt.Fprintf(w, "Page /%s/%s", group, section) }) _ = router.ListenAndServe(":60307") }() curl(t, "PATCH", "localhost", "http://localhost:60307/account/info", []byte("Page /account/info")) } func TestMultiParamPrefix(t *testing.T) { go func() { router := middleware.New() router.DiscardLogs() defer router.Shutdown() router.DELETE("/foo/:group/:section", func(w http.ResponseWriter, r *http.Request) { group := middleware.Param(r, "group") section := middleware.Param(r, "section") fmt.Fprintf(w, "Page /foo/%s/%s", group, section) }) _ = router.ListenAndServe(":60308") }() curl(t, "DELETE", "localhost", "http://localhost:60308/foo/account/info", []byte("Page /foo/account/info")) } func TestComplexParam(t *testing.T) { go func() { router := middleware.New() router.DiscardLogs() defer router.Shutdown() router.PUT("/account/:name/info", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello %s", middleware.Param(r, "name")) }) _ = router.ListenAndServe(":60312") }() curl(t, "PUT", "localhost", "http://localhost:60312/account/john/info", []byte("Hello john")) } func TestServeFiles(t *testing.T) { go func() { router := middleware.New() router.DiscardLogs() defer router.Shutdown() router.STATIC(".", "/cdn") _ = router.ListenAndServe(":60311") }() data, err := ioutil.ReadFile("LICENSE.md") if err != nil { t.Fatalf("cannot read LICENSE.md %s", err) return } curl(t, "GET", "localhost", "http://localhost:60311/cdn/LICENSE.md", data) } func TestServeFilesFake(t *testing.T) { go func() { router := middleware.New() router.DiscardLogs() defer router.Shutdown() router.GET("/updates/appcast.xml", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "<xml></xml>") }) _ = router.ListenAndServe(":60335") }() curl(t, "GET", "localhost", "http://localhost:60335/updates/appcast.xml", []byte("<xml></xml>")) } func TestServeFilesFakeScript(t *testing.T) { go func() { router := middleware.New() router.DiscardLogs() defer router.Shutdown() router.GET("/tag/js/gpt.js", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "(function(E){})") }) _ = router.ListenAndServe(":60336") }() curl(t, "GET", "localhost", "http://localhost:60336/tag/js/gpt.js", []byte("(function(E){})")) curl(t, "GET", "localhost", "http://localhost:60336/tag/js/foo.js", []byte("404 page not found\n")) } func TestTrailingSlash(t *testing.T) { go func() { router := middleware.New() router.DiscardLogs() defer router.Shutdown() router.GET("/hello/world/", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello World") }) _ = router.ListenAndServe(":60313") }() curl(t, "GET", "localhost", "http://localhost:60313/hello/world/", []byte("Hello World")) } func TestTrailingSlashDynamic(t *testing.T) { go func() { router := middleware.New() router.DiscardLogs() defer router.Shutdown() router.POST("/api/:id/store/", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "store") }) _ = router.ListenAndServe(":60316") }() curl(t, "POST", "localhost", "http://localhost:60316/api/123/store/", []byte("store")) } func TestTrailingSlashDynamicMultiple(t *testing.T) { go func() { router := middleware.New() router.DiscardLogs() defer router.Shutdown() router.POST("/api/:id/store/", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "dynamic") }) _ = router.ListenAndServe(":60324") }() curl(t, "POST", "localhost", "http://localhost:60324/api/123/////store/", []byte("dynamic")) } func TestMultipleRoutes(t *testing.T) { go func() { router := middleware.New() router.DiscardLogs() defer router.Shutdown() router.GET("/hello/world/", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello World") }) router.GET("/lorem/ipsum/", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Lorem Ipsum") }) _ = router.ListenAndServe(":60315") }() curl(t, "GET", "localhost", "http://localhost:60315/hello/world/", []byte("Hello World")) curl(t, "GET", "localhost", "http://localhost:60315/lorem/ipsum/", []byte("Lorem Ipsum")) } func TestMultipleDynamic(t *testing.T) { go func() { router := middleware.New() router.DiscardLogs() defer router.Shutdown() router.GET("/hello/:first/:last/info", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf( w, "Hello %s %s", middleware.Param(r, "first"), middleware.Param(r, "last"), ) }) _ = router.ListenAndServe(":60332") }() curl(t, "GET", "localhost", "http://localhost:60332/hello/john/smith/info", []byte("Hello <NAME>")) } func TestMultipleHosts(t *testing.T) { go func() { router := middleware.New() router.DiscardLogs() defer router.Shutdown() router.Host("foo.test").GET("/hello/:name", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello from foo.test (%s)", middleware.Param(r, "name")) }) router.Host("bar.test").GET("/hello/:name", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello from bar.test (%s)", middleware.Param(r, "name")) }) _ = router.ListenAndServe(":60337") }() curl(t, "GET", "foo.test", "http://localhost:60337/hello/john", []byte("Hello from foo.test (john)")) curl(t, "GET", "bar.test", "http://localhost:60337/hello/alice", []byte("Hello from bar.test (alice)")) } func TestDefaultHost(t *testing.T) { go func() { router := middleware.New() router.DiscardLogs() defer router.Shutdown() router.GET("/hello/:name", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello %s", middleware.Param(r, "name")) }) router.Host("foo.test").GET("/world/:name", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "World %s", middleware.Param(r, "name")) }) _ = router.ListenAndServe(":60338") }() curl(t, "GET", "localhost", "http://localhost:60338/hello/john", []byte("Hello john")) curl(t, "GET", "foo.test", "http://localhost:60338/world/earth", []byte("World earth")) curl(t, "GET", "bar.test", "http://localhost:60338/anything", []byte("404 page not found\n")) } func TestMethodHandle(t *testing.T) { go func() { router := middleware.New() router.DiscardLogs() defer router.Shutdown() router.Handle("HELLOWORLD", "/foobar", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello World") }) _ = router.ListenAndServe(":60340") }() curl(t, "HELLOWORLD", "localhost", "http://localhost:60340/foobar", []byte("Hello World")) } func TestMethodCONNECT(t *testing.T) { go func() { router := middleware.New() router.DiscardLogs() defer router.Shutdown() router.CONNECT("/foobar", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello World") }) _ = router.ListenAndServe(":60341") }() curl(t, "CONNECT", "localhost", "http://localhost:60341/foobar", []byte("Hello World")) } func TestMethodTRACE(t *testing.T) { go func() { router := middleware.New() router.DiscardLogs() defer router.Shutdown() router.TRACE("/foobar", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello World") }) _ = router.ListenAndServe(":60342") }() curl(t, "TRACE", "localhost", "http://localhost:60342/foobar", []byte("Hello World")) } func TestMethodCOPY(t *testing.T) { go func() { router := middleware.New() router.DiscardLogs() defer router.Shutdown() router.COPY("/foobar", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello World") }) _ = router.ListenAndServe(":60343") }() curl(t, "COPY", "localhost", "http://localhost:60343/foobar", []byte("Hello World")) } func TestMethodLOCK(t *testing.T) { go func() { router := middleware.New() router.DiscardLogs() defer router.Shutdown() router.LOCK("/foobar", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello World") }) _ = router.ListenAndServe(":60344") }() curl(t, "LOCK", "localhost", "http://localhost:60344/foobar", []byte("Hello World")) } func TestMethodMKCOL(t *testing.T) { go func() { router := middleware.New() router.DiscardLogs() defer router.Shutdown() router.MKCOL("/foobar", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello World") }) _ = router.ListenAndServe(":60345") }() curl(t, "MKCOL", "localhost", "http://localhost:60345/foobar", []byte("Hello World")) } func TestMethodMOVE(t *testing.T) { go func() { router := middleware.New() router.DiscardLogs() defer router.Shutdown() router.MOVE("/foobar", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello World") }) _ = router.ListenAndServe(":60346") }() curl(t, "MOVE", "localhost", "http://localhost:60346/foobar", []byte("Hello World")) } func TestMethodPROPFIND(t *testing.T) { go func() { router := middleware.New() router.DiscardLogs() defer router.Shutdown() router.PROPFIND("/foobar", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello World") }) _ = router.ListenAndServe(":60347") }() curl(t, "PROPFIND", "localhost", "http://localhost:60347/foobar", []byte("Hello World")) } func TestMethodPROPPATCH(t *testing.T) { go func() { router := middleware.New() router.DiscardLogs() defer router.Shutdown() router.PROPPATCH("/foobar", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello World") }) _ = router.ListenAndServe(":60348") }() curl(t, "PROPPATCH", "localhost", "http://localhost:60348/foobar", []byte("Hello World")) } func TestMethodUNLOCK(t *testing.T) { go func() { router := middleware.New() router.DiscardLogs() defer router.Shutdown() router.UNLOCK("/foobar", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello World") }) _ = router.ListenAndServe(":60349") }() curl(t, "UNLOCK", "localhost", "http://localhost:60349/foobar", []byte("Hello World")) } type telemetry struct { called bool latest middleware.AccessLog } func (t *telemetry) ListeningOn(addr string) { } func (t *telemetry) Shutdown(err error) { } func (t *telemetry) Log(data middleware.AccessLog) { t.called = true t.latest = data } func TestResponseCallback(t *testing.T) { tracer := &telemetry{} go func() { router := middleware.New() router.Logger = tracer defer router.Shutdown() router.GET("/", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello World") }) _ = router.ListenAndServe(":60339") }() curl(t, "GET", "localhost", "http://localhost:60339/?hello=world&foo=bar", []byte("Hello World")) if !tracer.called { t.Fatal("http tracer was not called") } if tracer.latest.Host != "localhost" { t.Fatalf("unexpected value for Host: %s", tracer.latest.Host) } if tracer.latest.RemoteUser != "" { t.Fatalf("unexpected value for RemoteUser: %s", tracer.latest.RemoteUser) } if tracer.latest.Method != "GET" { t.Fatalf("unexpected value for Method: %s", tracer.latest.Method) } if tracer.latest.Path != "/" { t.Fatalf("unexpected value for Path: %s", tracer.latest.Path) } if params := tracer.latest.Query.Encode(); params != "foo=bar&hello=world" { t.Fatalf("unexpected value for Query: %s", params) } if tracer.latest.Protocol != "HTTP/1.1" { t.Fatalf("unexpected value for Protocol: %s", tracer.latest.Protocol) } if tracer.latest.StatusCode != 200 { t.Fatalf("unexpected value for StatusCode: %d", tracer.latest.StatusCode) } if tracer.latest.BytesReceived != 0 { t.Fatalf("unexpected value for BytesReceived: %d", tracer.latest.BytesReceived) } if tracer.latest.BytesSent != 11 { t.Fatalf("unexpected value for BytesSent: %d", tracer.latest.BytesSent) } if ua := tracer.latest.Header.Get("User-Agent"); ua != "Go-http-client/1.1" { t.Fatalf("unexpected value for BytesSent: %s", ua) } if tracer.latest.Duration <= 0 { t.Fatalf("unexpected value for Duration: %v", tracer.latest.Duration) } }
go
Practically every modern person of any gender and age has a smartphone or tablet with a touch screen and Internet access. Convenience in use, communication anywhere in the world, a large number of functions in one palm-sized device make it irreplaceable. But active work, a long call or an Internet session, the game can lead to overheating of the device, as well as to slow down the system in response to user actions. In the common people - to hang. But the biggest problem is if the phone hangs and does not react at all to you. How to reload the "Samsung Galaxy" or any other model? Read about this in the article. How to restart "Samsung" (phone) There are several ways. So, how to restart the Samsung, if it hangs: - Hold the lock / on / off button for 10-20 seconds. The phone turns off and reboots, its further operation should be stable. - If your phone pulls out the battery, you can remove the back cover and get the battery, wait a couple of seconds and insert it back. It remains to assemble and turn on the phone. But often this can not be done, because the battery will deteriorate, and the phone itself. - If the back cover is not removed, then it is necessary to simultaneously hold the lock / on / off button and reduce the volume and hold for 5-7 seconds. With a reboot, the tablet will be more difficult than with the phone. But you can try all the same methods as with a smartphone: clamping the buttons simultaneously, pulling out the battery, if possible. If none of the above methods help, you can wait until the battery discharges the battery, it turns itself off, and after charging, you can turn it on without any problems, if there are no technical problems. If you do not want to wait or there is a suggestion that the gadget hangs due to problems with the processor, electronics, etc. , you can immediately contact the service center. If the phone hangs and buggy all the time, the question arises, how to reset the Samsung so that its further work does not fail. In this situation, a hard reset of the system can help. The smartphone will be rebooted in such a way that the system will be restored to the factory state, and all files, contacts, messages, etc. will be deleted. Therefore, it is worthwhile to take care of the safety in advance and reset them to the computer. To perform Hard reset, you need to perform the following sequence of actions: - Turn off the phone completely, the battery must be charged at the same time. - Simultaneously press 3 buttons: lock / on / off, increase volume and "home" (located on the front of the phone under the screen). - Release only after the inscription with the name of the phone appears. - A blue or black screen appears - you are in the Recovery-menu of the smartphone. - Here you need to select the categories Wipe data / factory reset, then Yes - delete all user data, the last Reboot system now. Moving through the menu is carried out by pressing the buttons to decrease / increase the volume, and confirm the choice of the item by pressing the lock button. Everything, the reboot process is complete. To ensure that the phone or tablet does not hang or do it regularly, you need to make sure that the technology does not overheat. For this, there are special applications that inform the user if the CPU temperature exceeds the norm. The most famous utility that controls CPU temperature and applications that overheat the device or take up too much RAM is the Clean Master. Thanks to it, you can also control the memory capacity and clean up the excess (cache, unnecessary files, etc. ). Or enter into the search for the Play Market "temperature control" and select the desired application.
english
package com.athaydes.osgiaas.javac; import java.util.Collection; import static java.util.Collections.emptyList; /** * Representation of a Java code snippet. * <p> * Instances of types implementing this interface can be used to run * Java code using the {@link JavacService} implementations. * <p> * A trivial implementation of this class is provided with the nested {@link Builder} class. */ public interface JavaSnippet { /** * @return the executable code. This is the code that will go in the body of the runnable method. */ String getExecutableCode(); /** * @return class imports. Eg. ['java.util.*', 'com.acme'] */ Collection<String> getImports(); class Builder implements JavaSnippet { private String code = ""; private Collection<String> imports = emptyList(); private Builder() { } public static Builder withCode( String code ) { Builder b = new Builder(); b.code = code; return b; } public Builder withImports( Collection<String> imports ) { this.imports = imports; return this; } @Override public String getExecutableCode() { return code; } @Override public Collection<String> getImports() { return imports; } } }
java
<gh_stars>1-10 # Tetris (Ren'Py) ![screenshot](https://pp.userapi.com/c849416/v849416003/dc39a/luZjOyp1dgg.jpg) ## Features **Difficulty levels**: - Classic - field 10x20, low speed, no bonus; - New - field 12x25, normal speed, with bonus; - Hard - field 13x25, high speed, with bonus; - Impossible - field 15x26, high speed, no bonus, no I tetromino. ## Installation Add files to your Ren'Py project ## Init ``` row - field width column - field height speed - falling speed tops - number of top places level - level of difficulty mode - presence of a bonus impossible - without I tetromino for_level - the number of lines for level-up ``` ## Usage **Keys**: - Left Arrow - move tetromino to the left; - Right Arrow - move tetromino to the right; - Up Arrow - rotate tetromino; - Down Arrow - increasing the speed of falling (pressing again disables it); - Enter - instantly lower tetromino; - Space - remove current tetromino (if you have a bonus). ## License [MIT](https://github.com/sDextra/tetris/blob/master/LICENSE/).
markdown
BlueSky Cinemas, one of the leading players in overseas market for South Indian movies is brining another real incidents based Gundello Godari to the overseas market which is slotted March 8th release. Aadi Pinisetty and Tapasee Pannu starrer Gundello Godari is Manchu Lakshmi's dream project which she also acted in a leading role. This is a bi-lingual film (Telugu and Tamil), directed by Kumar Nagendra and produced by Manchu Lakshmi on Manchu Entertainment Banner. Music scored by Maestro Ilayaraja and already released songs and trailers got very decent response. Sandeep Kishan is playing key role in this film. Ravi Babu, Jeeva, Mumaith Khan, Annapurna, Praveen, Suja and Dhanraj are in the main supporting cast. It's a short and sweet less than 2 hrs. Movie. We thank Manchu Entertainment team and Dr. Mohan Babu Garu for giving this opportunity to us. BlueSky will be releasing this movie in association with Manchu Entertainment. Follow us on Google News and stay updated with the latest!
english
Vicky Kaushal’s Uri: The Surgical Strike can open at around Rs 7 crore, says trade expert Akshaye Rathi. Uri: The Surgical Srike is the first big release of 2019 and looks promising from its thrilling trailer. Starring Vicky Kaushal in the lead role, the film has the potential to become his most successful solo release, says film exhibitor Akshaye Rathi. The film kickstarts the year on a patriotic note as it reconstructs the events of the 2016 Surgical Strikes carried out by the Indian Army after the Uri attack claimed the lives of 18 Indian soldiers. Rathi expects the film to open at around Rs 7 crore, which should be good for a solo Vicky Kaushal film. The film also stars Yami Gautam, Mohit Raina, Kirti Kulhari and Paresh Rawal and is set to release on January 11. The film has been directed by Aditya Dhar.
english
/* (a) Inorder (Left, Root, Right) Algorithm Inorder(tree) 1. Traverse the left subtree, i.e., call Inorder(left-subtree) 2. Visit the root. 3. Traverse the right subtree, i.e., call Inorder(right-subtree) */ //Class for binary tree class Node { //Constructor for giving the values,left and right child of root constructor(data) { this.data = data; this.left = null; this.right = null; } } // Root of Binary Tree let root = null; //Function for inorder traversal function inorder_traversal(root) { //If function is at null then it should return if (root == null) return; //For left child of root inorder_traversal(root.left); //For printing the values of root console.log(`${root.data} `); //For right child of root inorder_traversal(root.right); } //Buliding of the BT root = new Node(1); root.left = new Node(2); root.right = new Node(3); root.left.left = new Node(4); root.left.right = new Node(5); root.right.right = new Node(6); console.log("Inorder Traversal of Binary Tree:-"); inorder_traversal(root); /* Binary Tree 1 / \ 2 3 / \ \ 4 5 6 Output : Inorder Traversal of Binary Tree:- 4 2 5 1 3 6 */
javascript
<filename>css/main.css body { font-family: 'Poppins', sans-serif; overflow: hidden; } h2 { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; -webkit-box-align: center; -ms-flex-align: center; align-items: center; } .center { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; -ms-flex-line-pack: center; align-content: center; } .buttons { text-align: center; } /* start da css for da buttons */ .btn { text-align: center; border: none; border-radius: 5px; padding: 15px 25px; font-size: 22px; text-decoration: none; margin: 20px; color: #fff; position: relative; display: inline-block; } .btn:active { -ms-transform: translate(0px, 5px); transform: translate(0px, 5px); -webkit-transform: translate(0px, 5px); -webkit-box-shadow: 0px 1px 0px 0px; box-shadow: 0px 1px 0px 0px; } .blue { background-color: #55acee; -webkit-box-shadow: 0px 5px 0px 0px #3C93D5; box-shadow: 0px 5px 0px 0px #3C93D5; } .blue:hover { background-color: #6FC6FF; } .green { background-color: #2ecc71; -webkit-box-shadow: 0px 5px 0px 0px #15B358; box-shadow: 0px 5px 0px 0px #15B358; } .green:hover { background-color: #48E68B; } .red { background-color: #e74c3c; -webkit-box-shadow: 0px 5px 0px 0px #CE3323; box-shadow: 0px 5px 0px 0px #CE3323; } .red:hover { background-color: #FF6656; } .purple { background-color: #9b59b6; -webkit-box-shadow: 0px 5px 0px 0px #82409D; box-shadow: 0px 5px 0px 0px #82409D; } .purple:hover { background-color: #B573D0; } .orange { background-color: #e67e22; -webkit-box-shadow: 0px 5px 0px 0px #CD6509; box-shadow: 0px 5px 0px 0px #CD6509; } .orange:hover { background-color: #FF983C; } .yellow { background-color: #f1c40f; -webkit-box-shadow: 0px 5px 0px 0px #D8AB00; box-shadow: 0px 5px 0px 0px #D8AB00; } .yellow:hover { background-color: #FFDE29; } :focus{outline: none;} .pos{ position: relative; margin: 20% 0px 20% 0px; } /* necessary to give position: relative to parent. */ .input { text-align: left; color: #333; width: 100%; -webkit-box-sizing: border-box; box-sizing: border-box; letter-spacing: 1px; font-size: 120%; } .effect{ border: 0; padding: 4px 0; border-bottom: 1px solid #ccc; background-color: transparent; } .effect ~ .focus-border{ position: absolute; bottom: 0; left: 50%; width: 0; height: 2px; background-color: #3399FF; -webkit-transition: 0.4s; -o-transition: 0.4s; transition: 0.4s; } .effect:focus ~ .focus-border, .has-content.effect-17 ~ .focus-border{ width: 100%; -webkit-transition: 0.4s; -o-transition: 0.4s; transition: 0.4s; left: 0; } .effect ~ label{ position: absolute; vertical-align: middle; width: 100%; top: 7px; color: #aaa; -webkit-transition: 0.3s; -o-transition: 0.3s; transition: 0.3s; z-index: -1; letter-spacing: 0.5px; display: -webkit-box; display: -ms-flexbox; display: flex; } .effect:focus ~ label, .has-content.effect ~ label{ top: -16px; font-size: 12px; color: #3399FF; -webkit-transition: 0.3s; -o-transition: 0.3s; transition: 0.3s; } .btncenter{ position: relative; display: -webkit-box; display: -ms-flexbox; display: flex } .same { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column; height: 100%; } .ads{ position: absolute; bottom: 0%; width:100%; }
css
YANGON, Nov 22 – At least 90 people have died in a huge landslide in a remote jade mining area of northern Myanmar, officials said Sunday, as search teams continued to find bodies in one of the deadliest disasters to strike the country’s shadowy jade industry. “We found 79 dead bodies on November 21 (and) 11 today so the total so far is 90,” said Nilar Myint, an official from the local administrative authorities in Hpakant, northern Kachin state, adding that the rescue operation was ongoing. Rescuers were thought to still be battling to dig through the mountains of loose rubble at the site on Sunday, in the latest deadly accident to affect Myanmar’s secretive multi-billion dollar jade industry in war-torn Kachin. Those killed were thought to have been scavenging through a mountain of waste rubble dumped by mechanical diggers used by the mining firms in the area to extract Myanmar’s most valuable precious stone. Landslides are a common hazard in the area as people living off the industry’s waste pick their way across perilous mounds, driven by the hope that they might find a chunk of jade worth thousands of dollars. Scores have been killed this year alone as local people say the mining firms, many of which are linked to the country’s junta-era military elite, scale up their operations in Kachin. Myanmar is the source of virtually all of the world’s finest jadeite, an almost translucent green stone that is prized above almost all other materials in neighbouring China. In an October report, advocacy group Global Witness estimated that the value of jade produced in 2014 alone was $31 billion, the equivalent of nearly half the country’s GDP. But that figure is around 10 times the official $3. 4 billion sales of the precious stone last year, in an industry that has long been shrouded in secrecy with much of the best jade thought to be smuggled directly to China. Local people in Hpakant complain of a litany of abuses associated with the mining industry, including the frequency of accidents and land confiscations. The area has been turned into a moonscape of environmental destruction as huge diggers gouge the earth looking for jade. Itinerant miners are drawn from all parts of Myanmar by the promise of riches and become easy prey for drug addiction in Hpakant, where heroin and methamphetamine are cheaply available on the streets. “Industrial-scale mining by big companies controlled by military families and companies, cronies and drug lords has made Hpakant a dystopian wasteland where locals are literally having the ground cut from under their feet,” said Mike Davis of Global Witness, calling for firms to be held accountable for accidents. The group wants the jade industry, which has long been the subject of United States sanctions, to be part of the Extractive Industries Transparency Initiative (EITI), a global scheme designed to increase transparency around natural resource management.
english
One-time pop-punk princess Avril Lavigne has beaten superstar Beyonce at something, but she may not be totally happy with her victory - she's been named the most dangerous celebrity on the internet. Cyber-security firm McAfee said Tuesday that Lavigne, whose last album came out in 2013, was the most likely celebrity to land users on websites that carry viruses or malware. Searches for Lavigne have a 14.5 percent chance of landing on a web page with the potential for online threats, a number that increases to 22 percent if users type her name and search for free MP3s. Bruno Mars was second in his debut on the list, followed closely behind by Carly Rae Jepsen. Zayn Malik (No. 4), Celine Dion (No. 5), Calvin Harris (No. 6), Justin Bieber (No. 7), Sean "Diddy" Combs (No. 8), Katy Perry (No. 9) and Beyonce (No. 10) rounded out the top 10 list. It's a dubious step up for Lavigne, who was ranked No. 2 in 2013. Lavigne, whose hits include "Sk8er Boi," ''Complicated" and "I'm With You," has been out of the spotlight for several years as she battles Lyme disease. McAfee had a few suggestions for why Lavigne scored so high on the 11th annual list: Interest after the artist said she's working on a new album, a feature story on her by E! Online and an internet conspiracy that she has been replaced by an impostor. Lavigne is the first female musician to take the No. 1 spot and replaced Amy Schumer, named the most dangerous celebrity on the internet in 2016. In 2015, it was Dutch trance DJ van Buuren. The survey is meant to highlight the danger of clicking on suspicious links. McAfee urges Internet users to consider risks associated with searching for downloadable content. The company used its own site ratings to compile the celebrity list and used searches on Google, Bing and Yahoo. Catch the latest from the Consumer Electronics Show on Gadgets 360, at our CES 2024 hub.
english
<reponame>Asuis/wexin-app // pages/utils/card/card.js Component({ /** * 组件的属性列表 */ properties: { }, /** * 组件的初始数据 */ data: { }, /** * 组件的方法列表 */ methods: { } })
javascript
<reponame>edvin/tornadofaces package io.tornadofaces.component.data; import io.tornadofaces.component.api.Widget; import io.tornadofaces.component.util.ComponentUtils; import javax.faces.application.ResourceDependency; import javax.faces.component.FacesComponent; import javax.faces.component.UIComponentBase; @ResourceDependency(library = "tornadofaces", name = "data.js") @FacesComponent(value = Data.COMPONENT_TYPE, createTag = true, tagName = "data", namespace = "http://tornadofaces.io/ui") public class Data extends UIComponentBase implements Widget { public static final String COMPONENT_TYPE = "io.tornadofaces.component.Data"; public String getFamily() { return ComponentUtils.COMPONENT_FAMILY; } public String getWidgetVar() { return (String) getStateHelper().eval("widgetVar"); } public void setWidgetVar(String widgetVar) { getStateHelper().put("widgetVar", widgetVar); } public String getVar() { return (String) getStateHelper().eval("var"); } public void setVar(String var) { getStateHelper().put("var", var); } public String getSuccess() { return (String) getStateHelper().eval("success"); } public void setSuccess(String success) { getStateHelper().put("success", success); } public Object getValue() { return getStateHelper().eval("value"); } public void setValue(Object value) { getStateHelper().put("value", value); } public Boolean getLazy() { return (Boolean) getStateHelper().eval("lazy", false); } public void setLazy(Boolean lazy) { getStateHelper().put("lazy", lazy); } public Boolean getJson() { return (Boolean) getStateHelper().eval("json", true); } public void setJson(Boolean json) { getStateHelper().put("json", json); } }
java
<filename>android_smart_phone/main/app/src/main/java/com/wearableintelligencesystem/androidsmartphone/comms/SmsComms.java<gh_stars>0 package com.wearableintelligencesystem.androidsmartphone.comms; import io.reactivex.rxjava3.disposables.Disposable; import io.reactivex.rxjava3.subjects.PublishSubject; import java.io.IOException; import java.io.InputStream; import android.util.Log; import android.telephony.SmsManager; import com.wearableintelligencesystem.androidsmartphone.R; import org.json.JSONObject; import org.json.JSONException; import io.reactivex.rxjava3.disposables.Disposable; import io.reactivex.rxjava3.subjects.PublishSubject; import java.util.ArrayList; import android.util.Log; import com.wearableintelligencesystem.androidsmartphone.comms.MessageTypes; import java.lang.Exception; public class SmsComms { private static String TAG = "WearableAi_SmsComms"; private static SmsManager sm; private static SmsComms myself; //data observable we can tx/rx data private static PublishSubject<JSONObject> dataObservable; private SmsComms(){ sm = SmsManager.getDefault(); } public static SmsComms getInstance(){ if (myself == null){ myself = new SmsComms(); } return myself; } // https://stackoverflow.com/questions/6361428/how-can-i-send-sms-messages-in-the-background-using-android public void sendSms(String phoneNumber, String message){ //send a text message Log.d(TAG, "Sending SMS"); Log.d(TAG, "-- number: " + phoneNumber); Log.d(TAG, "-- message: " + message); //below, we break up the message if it's greater than 160 chars if (message.length() < 160){ sm.sendTextMessage(phoneNumber, null, message, null, null); } else { try { ArrayList<String> mSMSMessage = sm.divideMessage(message); // for (int i = 0; i < mSMSMessage.size(); i++) { // sentPendingIntents.add(i, sentPI); // deliveredPendingIntents.add(i, deliveredPI); // } sm.sendMultipartTextMessage(phoneNumber, null, mSMSMessage, null, null); } catch (Exception e) { e.printStackTrace(); } } } //receive observable to send and receive data public void setObservable(PublishSubject<JSONObject> observable){ dataObservable = observable; Disposable dataSub = dataObservable.subscribe(i -> handleDataStream(i)); } //this receives data from the data observable private void handleDataStream(JSONObject data){ //first check if it's a type we should handle try{ String type = data.getString(MessageTypes.MESSAGE_TYPE_LOCAL); if (type.equals(MessageTypes.SMS_REQUEST_SEND)){ //if it's a request to send a text, send it Log.d(TAG, "Got SMS request"); String phoneNumber = data.getString(MessageTypes.SMS_PHONE_NUMBER); String message = data.getString(MessageTypes.SMS_MESSAGE_TEXT); sendSms(phoneNumber, message); } } catch (JSONException e){ e.printStackTrace(); } } }
java
<gh_stars>0 class TetrisManager{ constructor(document){ this.document = document; this.instances= new Set; this.template = this.document.getElementById("player-template"); // const playerElements = document.querySelectorAll('.player'); // // [...playerElements].forEach((element,index) => { // // const tetris = new Tetris(element,keycodes); // // this.instances.push(tetris); // // }); } createPlayer(){ const element = this.document .importNode(this.template.content,true) .children[0]; const tetris = new Tetris(element,keycodes); this.instances.add(tetris); this.document.body.querySelector(".game").appendChild(tetris.element); return tetris; } removePlayer(tetris){ this.instances.delete(tetris); this.document.body.querySelector(".game").removeChild(tetris.element); } sortPlayers(tetri){ tetri.forEach(tetris => { this.document.body.querySelector(".game").appendChild(tetris.element) ; }); } }
javascript
<reponame>edwig/Kwatta<filename>SuiteLibrary/AboutDlg.cpp /////////////////////////////////////////////////////////////////////////////////////////////////////// // // // ██╗░░██╗░██╗░░░░░░░██╗░█████╗░████████╗████████╗░█████╗░ // ██║░██╔╝░██║░░██╗░░██║██╔══██╗╚══██╔══╝╚══██╔══╝██╔══██╗ // █████═╝░░╚██╗████╗██╔╝███████║░░░██║░░░░░░██║░░░███████║ // ██╔═██╗░░░████╔═████║░██╔══██║░░░██║░░░░░░██║░░░██╔══██║ // ██║░╚██╗░░╚██╔╝░╚██╔╝░██║░░██║░░░██║░░░░░░██║░░░██║░░██║ // ╚═╝░░╚═╝░░░╚═╝░░░╚═╝░░╚═╝░░╚═╝░░░╚═╝░░░░░░╚═╝░░░╚═╝░░╚═╝ // // // This product: KWATTA (KWAliTy Test API) Test suite for Command-line SOAP/JSON/HTTP internet API's // This program: SuiteLibrary // This File : AboutDlg.cpp // What it does: General About dialog for all programs // Author : <NAME> // License : See license.md file in the root directory // /////////////////////////////////////////////////////////////////////////////////////////////////////// #include "StdAfx.h" #include "SuiteLibrary.h" #include "AboutDlg.h" #include "afxdialogex.h" #ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[] = __FILE__; #define new DEBUG_NEW #endif // AboutDlg dialog IMPLEMENT_DYNAMIC(AboutDlg, StyleDialog) AboutDlg::AboutDlg(CWnd* pParent /*=nullptr*/) :StyleDialog(IDD_ABOUT, pParent) { } AboutDlg::~AboutDlg() { } void AboutDlg::DoDataExchange(CDataExchange* pDX) { StyleDialog::DoDataExchange(pDX); DDX_Control(pDX,IDC_ABOUT,m_editText); DDX_Control(pDX,IDOK, m_buttonOK); if(pDX->m_bSaveAndValidate == FALSE) { m_editText.SetRTFText(m_text); CString test = m_editText.GetRTFText(); } } BEGIN_MESSAGE_MAP(AboutDlg, StyleDialog) END_MESSAGE_MAP() BOOL AboutDlg::OnInitDialog() { StyleDialog::OnInitDialog(); SetWindowText("About"); ShowCloseButton(); m_text = "{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1043{\\fonttbl{\\f0\\fnil\\fcharset0 Verdana;}}\n" "\\viewkind4\\uc1\\pard\\f0\\fs20\n" "\\tab{\\b KWATTA}\\par\n" "\\par\n" "KWALITY TEST API - Program\\par\n" "\\par\n" "Named after the '<NAME>'\\par\n" "monkey. Also named the spider-monkey,\\par\n" "Jungle-devil or Bosduivel.\\par\n" "\\par\n" "This program is named {\\b Kwatta} as a\\par\n" "short for {\\b Kwa}li{\\b T}y {\\b T}est {\\b A}pi program.\\par\n" "To programmers the protests of a\\par\n" "professional tester is somewhat like\\par\n" "the screeching of the spider-monkey.\\par\n" "After having accomplished a difficult\\par\n" "task in programming, the programmer\\par\n" "sits back in humble satisfaction.\\par\n" "\\par\n" "But his/her peace gets quickly disturbed\\par\n" "by the noises of the quality testers\\par\n" "who gets busy in the aftermath of the\\par\n" "programming day......\\par\n" "\\par\n"; CString version; version.Format("{\\b VERSION: %s}}",KWATTA_VERSION); m_text += version; // Perform the streaming m_editText.SetBorderColor(ThemeColor::_Color1); m_editText.SetTextMode(TM_RICHTEXT); UpdateData(FALSE); return TRUE; } // AboutDlg message handlers
cpp
sonorant, in phonetics, any of the nasal, liquid, and glide consonants that are marked by a continuing resonant sound. Sonorants have more acoustic energy than other consonants. In English the sonorants are y, w, l, r, m, n, and ng. See also nasal; liquid.
english
India and the Global Fund to fight AIDS, Tuberculosis and Malaria (GFATM) have signed a three-year grant agreement for $128. 4 million or Rs. 609. 9 crore to support the continuation of flagship programmes of the National AIDS Control Organisation (NACO). The agreement was signed on Wednesday between NACO director-general K. Chandramouli and GFATM executive director Michel Kazatchkine. The programmes covered under the grant agreement include Integrated Counselling and Testing Services (ICTS), Prevention of Parent to Child Transmission (PPTCT) services and HIV-TB collaborative services. The overall goal of the grant is to reach and diagnose an estimated 65 per cent of the HIV-infected people in India and link them to care, support and treatment services. In order to achieve this, the NACO, through this grant, aims to counsel and test 1. 82 crore clients annually in over 10,700 Integrated Counselling and Testing Centres (ICTCs) by the end of the project (2012). Special focus will be given to ante-natal women, high risk groups such as female sex workers, men who have sex with men, intravenous drug users as well as people with sexually transmitted infections and tuberculosis. The NACO also intends to work in collaboration with the National Rural Health Mission and increase the number of facility integrated ICTCs in Primary Health Centres from 1,000 to 4,755. The number of facility integrated ICTCs under the public-private-partnership scheme in the private sector will also be increased from 266 to 1,600 by the end of the three-year period. Of the estimated 65,000 HIV positive pregnant women in the country, the NACO will reach and identify 60 per cent of them to administer prophylactic treatment to prevent mother to child transmission under the PPTCT programme. To achieve this target, 83 lakh pregnant women will be annually counselled and tested in the ICTCs. In the three-year period, an estimated 70 per cent of HIV-infected TB patients will be detected through an intensified package of HIV-TB collaboration services. In addition, capacity of the National Institute of Health and Family Welfare (NIHFW), 20 State Institutes of Health and Family Welfare and 5 National Institutes under TB programme will also be built through the establishment of an HIV unit, with requisite infrastructure and human resource strengthening. Also, cold storage units will be set up in 110 warehouses across the country to store thermolabile products such as rapid HIV diagnostic kits. Further, to improve supply chain management, a nationwide logistics management and information system will be installed. The NACO has applied for the Round 10 funding of the Global Fund. The proposal is to reduce vulnerability among most at risk migrant population, so that the HIV epidemic can be contained. India's revised migrant strategy envisages identifying high out migration locations at source and transit (besides destination), providing the migrant population information about HIV/AIDS, sexually transmitted infections (STI) and safe migration.
english
<reponame>crlf0710/tex-rs //! @ We need a special routine to read the first line of \TeX\ input from //! the user's terminal. This line is different because it is read before we //! have opened the transcript file; there is sort of a ``chicken and //! egg'' problem here. If the user types `\.{\\input paper}' on the first //! line, or if some macro invoked by that line does such an \.{\\input}, //! the transcript file will be named `\.{paper.log}'; but if no \.{\\input} //! commands are performed during the first line of terminal input, the transcript //! file will acquire its default name `\.{texput.log}'. (The transcript file //! will not contain error messages generated by the first line before the //! first \.{\\input} command.) //! @.texput@> //! //! The first line is even more special if we are lucky enough to have an operating //! system that treats \TeX\ differently from a run-of-the-mill \PASCAL\ object //! program. It's nice to let the user start running a \TeX\ job by typing //! a command line like `\.{tex paper}'; in such a case, \TeX\ will operate //! as if the first line of input were `\.{paper}', i.e., the first line will //! consist of the remainder of the command line, after the part that invoked //! \TeX. //! //! The first line is special also because it may be read before \TeX\ has //! input a format file. In such cases, normal error messages cannot yet //! be given. The following code uses concepts that will be explained later. //! (If the \PASCAL\ compiler does not support non-local |@!goto|\unskip, the //! @^system dependencies@> //! statement `|goto final_end|' should be replaced by something that //! quietly terminates the program.) //! //! @<Report overflow of the input buffer, and abort@>= //! if format_ident=0 then //! begin write_ln(term_out,'Buffer size exceeded!'); goto final_end; //! @.Buffer size exceeded@> //! end //! else begin cur_input.loc_field:=first; cur_input.limit_field:=last-1; //! overflow("buffer size",buf_size); //! @:TeX capacity exceeded buffer size}{\quad buffer size@> //! end //!
rust
package br.com.sisdep.model.patrimonio; import java.sql.Connection; import java.sql.Date; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.ArrayList; import java.util.List; import br.com.sisdep.util.ConnectionFactory; public class PatrimonioDAO extends ConnectionFactory { Connection con; PreparedStatement ps; ResultSet rs; public List<Patrimonio> selectBaixados(){ List<Patrimonio> listaBaixados = null; String sql = "select * from patrimonio inner join baixa on patrimonio.id = " + "baixa.idpatrimonio order by nome"; try { con = openConnection(); ps = con.prepareStatement(sql); rs = ps.executeQuery(); listaBaixados = new ArrayList<Patrimonio>(); while (rs.next()){ Patrimonio patrimonio = new Patrimonio(); patrimonio.setId(rs.getLong("id")); patrimonio.setNome(rs.getString("nome")); patrimonio.setDataAquisicao(rs.getDate("dataaquisicao")); patrimonio.setCategoria(rs.getString("categoria")); patrimonio.setVidaUtil(rs.getFloat("vidautil")); patrimonio.setBemUsado(rs.getString("bemusado")); patrimonio.setValorAquisicao(rs.getFloat("valoraquisicao")); patrimonio.setTempoDeUso(rs.getFloat("tempodeuso")); patrimonio.setTaxaResidual(rs.getFloat("taxaresidual")); patrimonio.setTurnos(rs.getFloat("turnos")); patrimonio.setDataBaixa(rs.getDate("databaixa")); patrimonio.setValorBaixa(rs.getFloat("valorbaixa")); listaBaixados.add(patrimonio); } }catch (Exception e){ System.err.println("---------------------"); System.err.println("Erro: " + e.getMessage()); e.printStackTrace(); System.err.println("---------------------"); } finally { closeConnection(con, ps, rs); } return listaBaixados; } public List<Patrimonio> lista(){ List<Patrimonio> listaAtivos = null; String sql = "select * from patrimonio where id not in " + "(select idpatrimonio from baixa) " + "order by id"; try { con = openConnection(); ps = con.prepareStatement(sql); rs = ps.executeQuery(); listaAtivos = new ArrayList<Patrimonio>(); while (rs.next()){ Patrimonio patrimonio = new Patrimonio(); patrimonio.setId(rs.getLong("id")); patrimonio.setNome(rs.getString("nome")); patrimonio.setDataAquisicao(rs.getDate("dataaquisicao")); patrimonio.setCategoria(rs.getString("categoria")); patrimonio.setVidaUtil(rs.getFloat("vidautil")); patrimonio.setBemUsado(rs.getString("bemusado")); patrimonio.setValorAquisicao(rs.getFloat("valoraquisicao")); patrimonio.setTempoDeUso(rs.getFloat("tempodeuso")); patrimonio.setTaxaResidual(rs.getFloat("taxaresidual")); patrimonio.setTurnos(rs.getFloat("turnos")); listaAtivos.add(patrimonio); } }catch (Exception e){ System.err.println("---------------------"); System.err.println("Erro: " + e.getMessage()); e.printStackTrace(); System.err.println("---------------------"); } finally { closeConnection(con, ps, rs); } return listaAtivos; } public Patrimonio insert(Patrimonio patrimonio){ String sql = "INSERT INTO patrimonio (nome, dataaquisicao, categoria, vidautil, " + "bemusado, valoraquisicao, taxaresidual, turnos, tempodeuso) " + "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)"; try { Connection con; PreparedStatement ps; con = openConnection(); ps = con.prepareStatement(sql); ps.setString(1, patrimonio.getNome()); ps.setDate(2, new Date(patrimonio.getDataAquisicao() .getTime())); System.out.println(patrimonio.getDataAquisicao() .getTime()); ps.setString(3, patrimonio.getCategoria()); ps.setFloat(4, patrimonio.getVidaUtil()); ps.setString(5, patrimonio.getBemUsado()); ps.setFloat(6, patrimonio.getValorAquisicao()); ps.setFloat(7, patrimonio.getTaxaResidual()); ps.setFloat(8, patrimonio.getTurnos()); ps.setFloat(9, patrimonio.getTempoDeUso()); ps.executeUpdate(); //System.out.println("feito insert"); } catch (Exception e){ System.err.println("---------------------"); System.err.println("Erro: " + e.getMessage()); e.printStackTrace(); System.err.println("---------------------"); } finally { closeConnection(con, ps); } return patrimonio; } public Patrimonio insertBaixa(Patrimonio patrimonio){ String sql = "INSERT INTO baixa (databaixa, valorbaixa, idpatrimonio) " + " VALUES (?, ?, ?)"; try { Connection con; PreparedStatement ps; con = openConnection(); ps = con.prepareStatement(sql); ps.setDate(1, new Date(patrimonio.getDataBaixa().getTime())); ps.setFloat(2, patrimonio.getValorBaixa()); ps.setLong(3, patrimonio.getId()); ps.executeUpdate(); } catch (Exception e){ System.err.println("---------------------"); System.err.println("Erro: " + e.getMessage()); e.printStackTrace(); System.err.println("---------------------"); } finally { closeConnection(con, ps); } return patrimonio; } public Patrimonio update(Patrimonio patrimonio){ String sql = "UPDATE patrimonio SET bemusado = ?, tempodeuso =?, nome = ?, " + "dataaquisicao = ?, categoria = ?, vidautil = ?, " + "valoraquisicao = ?, taxaresidual = ?, turnos = ? WHERE id = ?"; try { con = openConnection(); ps = con.prepareStatement(sql); ps.setString(1, patrimonio.getBemUsado()); ps.setFloat(2, patrimonio.getTempoDeUso()); ps.setString(3, patrimonio.getNome()); System.out.println(patrimonio.getNome()); ps.setDate(4, new Date(patrimonio.getDataAquisicao() .getTime())); ps.setString(5, patrimonio.getCategoria()); ps.setFloat(6, patrimonio.getVidaUtil()); ps.setFloat(7, patrimonio.getValorAquisicao()); ps.setFloat(8, patrimonio.getTaxaResidual()); ps.setFloat(9, patrimonio.getTurnos()); ps.setLong(10, patrimonio.getId()); ps.executeUpdate(); } catch (Exception e){ System.err.println("---------------------"); System.err.println("Erro: " + e.getMessage()); e.printStackTrace(); System.err.println("---------------------"); } finally { closeConnection(con, ps); } return patrimonio; } public Patrimonio buscarPorCodigo(Patrimonio p){ String sql = "SELECT * from patrimonio WHERE id = ? ;"; Patrimonio objP = null; try { con = openConnection(); ps = con.prepareStatement(sql); ps.setLong(1, p.getId()); rs = ps.executeQuery(); while (rs.next()){ objP = new Patrimonio(); objP.setId(rs.getLong("id")); objP.setNome(rs.getString("nome")); objP.setDataAquisicao(rs.getDate("dataaquisicao")); objP.setVidaUtil(rs.getFloat("vidautil")); objP.setValorAquisicao(rs.getFloat("valoraquisicao")); objP.setTaxaResidual(rs.getFloat("taxaresidual")); objP.setTurnos(rs.getFloat("turnos")); objP.setTempoDeUso(rs.getFloat("tempodeuso")); objP.setBemUsado(rs.getString("bemusado")); } } catch (Exception e){ System.err.println("---------------------"); System.err.println("Erro: " + e.getMessage()); e.printStackTrace(); System.err.println("---------------------"); } finally { closeConnection(con, ps); } return objP; } }
java
import React from 'react' import Icon from 'src/components/ui/Icon' import Incentives from './Incentives' import Section from '../Section' const incentives = [ { icon: <Icon name="Truck" width={32} height={32} />, title: 'Compre online', firstLineText: '<NAME>', }, { icon: <Icon name="Calendar" width={32} height={32} />, title: 'Devolução gratuita', firstLineText: '30 dias após a compra', }, { icon: <Icon name="Gift" width={32} height={32} />, title: 'Gift cards', firstLineText: '$20 / $30 / $50', }, { icon: <Icon name="Storefront" width={32} height={32} />, title: 'Lojas físicas', firstLineText: '+40 lojas no Brasil', }, { icon: <Icon name="ShieldCheck" width={32} height={32} />, title: 'Compra', firstLineText: 'Totalmente segura', }, ] function IncentivesHeader() { return ( <Section> <Incentives incentives={incentives} classes="incentives--colored" /> </Section> ) } export default IncentivesHeader
typescript
Why this website? Who owns the Media? All the natural disasters in Orissa have had immense media coverage. So why does so little change? They are whistleblowers within the media, bucking the demand that the Fourth Estate fall in line. Strange encounter of the fake kind? In case of the Diwali eve Ansal Plaza shootout some reporters found it tempting to accept the loophole ridden official version.
english
Dhoke Ratta is a residential area located in Rawalpindi, a city in the Punjab province of Pakistan. It is situated in the southern part of Rawalpindi and is surrounded by several other neighborhoods, including Sddar, Mohanpura, Dhoke Hasso and Raja Bazar. Dhoke Ratta is well-connected to other parts of Rawalpindi and Islamabad through a network of roads and public transportation, including buses and taxis. Dhoke Ratta is located near several major roads, including the IGP Road, GT Road and the Islamabad Expressway, which connect it to other parts of the region.
english
The United States and India have agreed to expand their cooperation in fighting cybercrimes, telemarketing fraud and enforcing consumer protection, the US Justice Department said on Thursday. Deputy Assistant Attorney General Arun G. Rao of the U. S. Department of Justice Civil Division's Consumer Protection Branch, together with colleagues from the Consumer Protection Branch and the Federal Bureau of Investigation (FBI), met this week with Central Bureau of Investigation (CBI) officials in New Delhi to further strengthen law enforcement cooperation. During the meeting, they discussed means for combating emerging crime trends, including fighting rising telemarketing fraud. "In their meetings, the parties affirmed their shared commitment to strengthen cooperation in combating crime, specifically with respect to efforts to investigate and prosecute cyber-enabled financial frauds and global telemarketing frauds, including international robocalls and communications," the Justice Department said in a statement. They additionally discussed the need for continued cooperation in tackling emerging technology-based crimes through faster information exchange and evidence sharing, with a view to ensure security and protection of citizens of both jurisdictions, the department added. (ANI)
english
IND vs NZ Test: New Zealand coach says Ashwin and co dangerous: New Zealand coach Gary Stead feels the Kiwi batters have to quickly adapt to the conditions here if they want to overcome the challenge of Indian spin attack in the upcoming Test series. India and New Zealand will lock horns in the two-match Test series which gets underway from Thursday. “I think whenever you come here and face the likes of Ashwin, Jadeja, Axar Patel, who are world-class spinners in this environment as well. For us it’s about being able to adapt quickly to what the surface is telling us and what is right in front of us,” said Stead while replying to a query from ANI during a virtual press conference. India Playing XI vs NZ 1st Test: Ajinkya Rahane in fix, Shreyas Iyer or Shubman Gill for No 4 spot in 1st Test? “Sometimes when you start the match, it may not be spinning too much but it does come later on. So having multiple ideas or ways to challenge the bowlers back will be something that will be important to our group,” he added. IND vs NZ Test: NZ coach Gary Stead on facing the likes of Ashwin, Jadeja & Axar Patel in the 1st Test: Trent Boult and Colin de Grandhomme will miss the Test series due to bio-secure bubbles fatigue. The New Zealand coach said Boult wanted to get “mentally refreshed” after spending quite an amount of time in bio-bubble. “Trent Boult has been a fine bowler for New Zealand for a long long period of time but we made the decision that the best thing for him was to get home in order to be mentally refreshed. I also know India is doing a similar thing with some of their players as well,” said Trent Boult . “And I think that’s the sign of the COVID world that we live in. It’s not New Zealand who will miss Trent Boult but I think India will also miss some of their players,” he added. IND vs NZ Test: NZ coach Gary Stead on facing the likes of Ashwin, Jadeja & Axar Patel in the 1st Test: Stead also informed that all New Zealand players are available for selection for the first Test which gets underway from Thursday.
english
{ "Searching": { "description": "🎧 Support on all platforms: https://Monstercat.lnk.to/OneWayDream\n\n▼ Follow Monstercat\nSpotify: https://monster.cat/2biZbkd\nApple: https://apple.co/2xiKWTO\nFacebook: https://facebook.com/monstercat\nTwitter: https://twitter.com/monstercat\nInstagram: https://instagram.com/monstercat\n\n💥Follow <NAME>\nFacebook: https://www.facebook.com/jaycosmic/\nTwitter: https://twitter.com/jaycosmic\nSoundcloud: https://soundcloud.com/jay-cosmic\nInstagram: https://instagram.com/jay_cosmic\n\nGenre: #IndieDance\n\n▼ Want some new Merchandise?\nhttps://monster.cat/MonstercatShop\n\n▼ Download with Gold!\nhttps://monster.cat/goldyt\n\n▼ Submit to Monstercat!\nhttp://monster.cat/demo-submissions", "duration": 164, "genre": "Indie Dance", "title": "One Way Dream", "username": "Monstercat", "artist": "<NAME>", "remixArtist": null, "labelname": "Monstercat", "id": 429178226, "isRemix": false, "search_stage": 1, "url": "https://soundcloud.com/monstercat/jay-cosmic-one-way-dream" }, "Results": [ { "description": "", "duration": 179, "genre": "", "title": "Ocean Eyes", "username": "Various Artists", "artist": "Various Artists", "remixArtist": null, "labelname": "", "id": 518852922, "isRemix": false, "search_stage": 0, "url": "https://www.deezer.com/track/518852922" }, { "description": "", "duration": 272, "genre": "", "title": "Ascend", "username": "Various Artists", "artist": "Various Artists", "remixArtist": null, "labelname": "", "id": 422794272, "isRemix": false, "search_stage": 0, "url": "https://www.deezer.com/track/422794272" } ] }
json
New Delhi: A special court on Monday ordered framing of charges against industrialist Naveen Jindal and four others in a coal scam case. Special judge Bharat Parashar ordered that Jindal and the others be put on trial for offences allegedly committed under sections 420 (cheating) and 120-B (criminal conspiracy) of the Indian Penal Code. Besides Jindal, the charges have been framed against Jindal Steel and Power Limited's former director Sushil Maroo, former deputy managing director Anand Goyal, chief executive officer Vikrant Gujral and the company's authorised signatory D N Abrol. The court was hearing a matter pertaining to the allocation of the Urtan North coal block in Madhya Pradesh. It has now put up the matter for July 25 for formally framing the charges against the accused. (This story has not been edited by News18 staff and is published from a syndicated news agency feed - PTI)
english
From honeydew.srv.cs.cmu.edu!magnesium.club.cc.cmu.edu!news.sei.cmu.edu!fs7.ece.cmu.edu!europa.eng.gtefsd.com!uunet!sparky!rick Fri Sep 10 02:55:27 EDT 1993 Article: 4718 of news.announce.conferences Xref: honeydew.srv.cs.cmu.edu news.announce.conferences:4718 Newsgroups: news.announce.conferences Path: honeydew.srv.cs.cmu.edu!magnesium.club.cc.cmu.edu!news.sei.cmu.edu!fs7.ece.cmu.edu!europa.eng.gtefsd.com!uunet!sparky!rick From: <EMAIL> (<NAME>) Subject: CFP: Proof Theory, Provability Logic and Computation Message-ID: <<EMAIL>> Sender: <EMAIL> (<NAME>) Organization: Sterling Software Date: Fri, 10 Sep 1993 00:48:57 GMT Approved: <EMAIL> Expires: Thu, 6 Jan 1994 08:00:00 GMT Lines: 75 X-Md4-Signature: e15efc3cf6ee0525e3f5d247da520221 PPC '94 International Conference on Proof Theory, Provability Logic, and Computation March 20-24, 1994 University of Berne, Switzerland CALL FOR PAPERS The central aim of this meeting is to provide a platform for the presentation of recent results in the areas of Proof Theory, Provability Logic, and Computation where these are interrelated. More specifically, the main emphasis will be on the following: - Applications of Proof Theory to Theoretical Computer Science. - New developments in Provability Logic related to Computer Science - New challenges from Computer Science for Proof Theory and Provability Logic. The conference is intended for logicians and computer scientists interested in the interaction of proof theory and theoretical computer science. The scientific program will consist of invited lectures and short contributions, which will be selected from the submitted papers. All contributions will be refereed for a special issue of the journal "Annals of Pure and Applied Logic" devoted to the conference, where selected papers will be published. An extended abstract (2 pages) of papers to be submitted should be sent to the address below not later than January 5, 1994. The authors will be notified of acceptance for presentation to the workshop by February 5. The complete paper to be submitted for publication should not exceed 15 pages and must be available before April 30, 1994. The conference fee is SFr 200.--. INVITED SPEAKERS: <NAME>, Steklov Institute, Moscow <NAME>, University of Amsterdam <NAME>, University of Munich F. Montagna, University of Siena <NAME>, U.C.S.D., San Diego CA <NAME>"ark, University of Munich R. Constable, Cornell University <NAME>, University of Amsterdam <NAME>, University of Prague PROGRAM COMMITTEE: <NAME>, Steklov Institute, Moscow <NAME>, Stanford University <NAME>, M.I.T., Cambridge MA <NAME>, University of Berne <NAME>, ETH Z"urich <NAME>, University of Utrecht Correspondence should be sent to: PPC '94 Institut f"ur Informatik und angewandte Mathematik Universit"at Bern L"angga3str. 51 CH-3012 Bern Switzerland Fax: +41 31 65 39 65 E-mail: <EMAIL>
html
import org.junit.*; import ru.otus.h2.DataSourceH2; import ru.otus.jdbc.mapper.hw9.impl.JdbcMapperImpl; import ru.otus.jdbc.mapper.hw9.impl.User; import ru.otus.jdbc.sessionmanager.SessionManagerJdbc; import javax.sql.DataSource; import java.sql.SQLException; import static org.junit.Assert.*; import static org.mockito.Mockito.*; public class JdbcMapperImplOnUserTest { static DataSource dataSource; static SessionManagerJdbc sessionManager; @Before public void databaseUp() { dataSource = new DataSourceH2(); sessionManager = new SessionManagerJdbc(dataSource); try (var connection = dataSource.getConnection(); var pst = connection.prepareStatement( "create table User(id long auto_increment, name varchar(50), age int(3));" )) { pst.executeUpdate(); } catch (SQLException throwables) { throw new RuntimeException("Can't initialize database" + throwables.toString()); } sessionManager.beginSession(); } @After public void DropUsers() { try (var connection = dataSource.getConnection(); var pst = connection.prepareStatement( "drop table User;" )) { pst.executeUpdate(); connection.commit(); } catch (SQLException throwables) { throw new RuntimeException("Can't initialize database" + throwables.toString()); } } @AfterClass public static void databaseDown() { sessionManager.commitSession(); sessionManager.close(); } @Test public void ConstructorTest() { var mapper = new JdbcMapperImpl<>(User.class, sessionManager); } @Test public void selectOfAbsentIdTest() { var mapper = new JdbcMapperImpl<>(User.class, sessionManager); assertEquals(null, mapper.findById(200, User.class)); } @Test public void selectTest() { try (var connection = dataSource.getConnection(); var pst = connection.prepareStatement( "INSERT INTO User (name, age) VALUES ('Putin', 2036);" )) { pst.executeUpdate(); connection.commit(); var mapper = new JdbcMapperImpl<>(User.class, sessionManager); User pain = new User(1, "Putin", 2036); User selectedPain = mapper.findById(1, User.class); assertEquals(pain, selectedPain); } catch (SQLException throwables) { throwables.printStackTrace(); throw new RuntimeException("Can't initialize database"); } } @Test public void insertCallTest() { var mapper = new JdbcMapperImpl<>(User.class, sessionManager); User user = new User(-1, "Hero", 10); mapper.insert(user); } @Test public void insertThenSelectTest() { var mapper = new JdbcMapperImpl<>(User.class, sessionManager); User inserted = new User(-1, "hero", 10); mapper.insert(inserted); User selected = mapper.findById(1, User.class); assertEquals(selected, new User(1, "hero", 10)); } @Test public void updateTest() { var mapper = new JdbcMapperImpl<>(User.class, sessionManager); User inserted = new User(-1, "hero", 10); mapper.insert(inserted); User master = new User(1, "Master", 11); mapper.update(master); User selected = mapper.findById(1, User.class); assertEquals(selected, master); } @Test public void insertOrUpdateTest() { JdbcMapperImpl<User> mapper = spy(new JdbcMapperImpl<>(User.class, sessionManager)); User user = new User(-1, "A", 10); verify(mapper, times(0)).insert(user); mapper.insertOrUpdate(user); verify(mapper, times(1)).insert(user); User selected = mapper.findById(1, User.class); mapper.insertOrUpdate(selected); verify(mapper, times(1)).update(selected); } }
java
{ "authors": [ { "author": "<NAME>" }, { "author": "<NAME>" }, { "author": "<NAME>" } ], "doi": "10.1186/s12891-015-0843-4", "publication_date": "2015-12-08", "id": "EN114985", "url": "https://pubmed.ncbi.nlm.nih.gov/26638151", "source": "BMC musculoskeletal disorders", "source_url": "", "licence": "CC BY", "language": "en", "type": "pubmed", "description": "", "text": "We describe three cases of central serous chorioretinopathy in patients taking systemic corticosteroids due to rheumatological diseases (ankylosing spondylitis, systemic lupus erythematosus and Behçet's disease). They were diagnosed and managed at our Multidisciplinary (Rheumatology-Ophthalmology) Uveitis Clinic. All three cases improved after corticosteroids dose tapering." }
json
<filename>src/InstPyr/MyDevices/helpers.py from dataclasses import dataclass,fields @dataclass class Sensor: pass
python
<reponame>morix1500/zengin [{"code":"401","name":"首里","name_kana":"シユリ"},{"code":"409","name":"首里城下町","name_kana":"シユリジヨウカマチ"},{"code":"719","name":"下地","name_kana":"シモヂ"}]
json
Unleash your full potential on the paddle tennis court with the perfect combination of power and control. In the world of competitive play, the right racket can make all the difference in dominating your opponents. That’s why we’ve prepared a list of the top 10 paddle tennis rackets specifically designed for competitive players. Get ready to elevate your game to new heights as we delve into the world of paddle tennis rackets that will ignite your competitive spirit. It’s time to unlock the power, unleash control, and leave your opponents in fear with these exceptional rackets designed to give you the winning edge. Are you ready to take your game to the next level? Let’s dive in and discover the paddle tennis rackets that will unlock your untapped potential on the court. Bullpadel Vertex Paddle Tennis Racket: The Bullpadel Vertex is a popular padel racket model offered by Bullpadel, a well-known brand in the world of padel tennis. The Vertex racket is designed for advanced and professional players seeking power and precision on the court. It has been endorsed by top players such as Maxi Sánchez. Babolat Pure Drive Paddle Tennis Racket: Competitive players always tend to choose the Babolat Pure Drive paddle tennis racket as a premier option. It has a hybrid frame blending carbon fiber and fiberglass, resulting in a harmonious blend of power and control. The racket’s grip ensures comfort, while its expanded sweet spot enables greater shot consistency. One of the best in its class. Head Graphene Touch Delta Hybrid Paddle Tennis Racket: This one is designed specifically for advanced players, the Head Graphene Touch Delta Hybrid paddle tennis racket offers exceptional performance. It’s made of combined carbon fiber and foam core, striking a perfect equilibrium between power and control. With a comfortable grip and an expanded sweet spot, this racket facilitates consistent and precise shots, ensuring an elevated level of play. Adidas Metalbone Carbon Paddle Tennis Racket: The latest Metalbone Carbon racket from Adidas offers an impressive blend of power and comfort, showcasing high-performance capabilities. By incorporating a combination of Eva Soft Performance rubber and a high-density 6k carbon surface, the racket delivers exceptional performance, providing both significant power and a delightful feel. Additionally, the innovative Octagonal-Shaped Spin Blade technology enables players to generate substantial spin on their shots. The inclusion of Smart Holes Curve technology reinforces the overall structure of the racket while facilitating spin acquisition. Catri Volcano Paddle Tennis Racket: The Cartri Volcano is a popular racket model manufactured by Cartri, a renowned brand in the Padel tennis industry. The Volcano racket is designed to offer players a balanced combination of power, control, and maneuverability on the court. Volcano 2 is typically constructed using high-quality materials such as carbon fiber or carbon fiber composites. This construction helps provide a good balance of power, durability, and responsiveness. Bullpadel Vertex Paddle Tennis Racket: The Bullpadel Vertex is one of the most popular paddle tennis rackets produced by Bullpadel, a renowned brand within the paddle tennis community. Created with the needs of advanced and professional players in mind, the Vertex racket aims to deliver an exceptional combination of power, control, and precision during gameplay. It is crafted utilizing top-grade materials like carbon fiber or carbon fiber composites, ensuring optimal power, durability, and responsiveness when striking the ball. The racket’s balance is typically weighted towards the head (head-heavy), enabling players to unleash forceful shots and achieve powerful smashes. This balance distribution enhances swing speed and strength, adding an extra edge to the player’s game. StarVie Metheora Dual Paddle Tennis Racket: The StarVie Metheora Dual is a top-of-the-line paddle tennis racket specifically created for experienced and professional players. Renowned for its exceptional power, control, and adaptability, this racket offers a premium playing experience. The Metheora Dual showcases a frame constructed from carbon fiber and incorporates a high-density EVA foam core. These materials work together to deliver remarkable shock absorption and precise ball control. The racket’s standout feature is its dual shape, featuring a round head on one side and a diamond shape on the other. This unique design allows players to effortlessly transition between a well-balanced playing style and a more aggressive approach, catering to individual preferences and varying game situations. Siux Diablo Revolution II Sanyo Pro Paddle Tennis Racket: The Siux Diablo Revolution II Sanyo Pro is a paddle tennis racket specifically built for advanced and professional players, offering top-tier performance on the court. Renowned for its exceptional power, control, and precision, this racket boasts a design that caters to the needs of skilled players. With a carbon fiber frame and a high-density EVA foam core, the Diablo Revolution II Sanyo Pro excels in shock absorption and enhances ball control. Its diamond-shaped head further amplifies performance by providing a larger sweet spot, resulting in increased power and improved shot execution. Varlion Bourne Prisma AIRFLOW Paddle Tennis Racket: The Varlion Bourne Prisma AIRFLOW is a top-notch padel racket specifically created for skilled and professional players. Renowned for its exceptional power, control, and maneuverability, this racket is a preferred choice among serious players. The Bourne Prisma AIRFLOW showcases a frame constructed with carbon fiber and incorporates a high-density EVA foam core. This combination effectively absorbs shocks and enhances ball control, allowing players to handle intense shots with precision. With its diamond-shaped head and well-balanced weight distribution, the racket offers an excellent blend of power and maneuverability on the court. Wilson Bela LT V2 White Paddle Tennis Racket: The Wilson Bela LT V2 White is a top-tier paddle tennis racket developed in partnership with professional player Fernando Belasteguín, widely recognized as “Bela”. This high-performance racket is specifically tailored for advanced and professional players who seek a combination of power, control, and maneuverability during their matches. The Bela LT V2 White showcases a frame constructed from carbon fiber material and incorporates a high-density EVA foam core. These elements work together to deliver exceptional shock absorption and precise ball control. With its diamond-shaped head, the racket offers an enlarged sweet spot located towards the upper section, resulting in heightened power and enhanced shot control. Conclusion: Selecting the ideal paddle tennis racket is very important for competitive players who seek to unlock their potential in terms of power and control on the court. The finest paddle tennis rackets for competitive play are meticulously crafted to offer a harmonious blend of power and control. These rackets often feature carbon fiber frames, expansive sweet spots, and ergonomically designed grips. When making a choice, it is vital to consider factors such as the player’s skill level, playing style, and personal preferences. Finding a racket that strikes the right balance between power and control, alongside a comfortable grip and well-balanced weight distribution, is key. Exploring multiple options and trying out various rackets can provide valuable insights in determining the perfect fit for individual needs. Remember, the journey to finding the ideal paddle tennis racket is as unique as the player themselves. Embrace the process, experiment, and select a racket that empowers you to unleash your true power and control on the court.
english
Only two days are left for the Foreign Medical Graduates Examination (FMGE) December 2022 exam to commence and around 10,000 aspirants are yet to receive their admit cards from the examination council. Students alleged that the National Board of Examinations (NBE) has threatened to withhold their FMGE results when they urged that clarity must be given by the board about the medical exam. The FMGE December 2022 exam which was earlier scheduled to be held on December 4 was postponed to January 20 due to Municipal Corporation of Delhi (MCD) elections by the Delhi State Election Commission. In addition to this, the board organizes the entrance exam every year for Indians with medical degrees from foreign universities in order to qualify for medical practice in the nation. As per the updated schedule, the FMGE announced to release of the students’ admit cards on January 13, 2023. Several students who registered for the exam have not yet received their respective hall tickets due to “blurry images and missing documents”. A medical aspirant claimed regarding the NBE exam that the NBE director threatened the students that the results will be denied if anyone spoke against the examination board. Also, they were pushed outside the office when the students demanded clarity over the exam matter and asked about the reason for not issuing their admit cards. He further added that candidates have been preparing for hours and their hard work will go in vain. “Around 10000 #FMG student’s didn’t receive their admit cards for 20th Jan FMG Exam. NMC and NBE We demand immediate response for the reasons thereof & a quick redressal of the problem,” Shankul Dwivedi, IMA junior doctors network standing committee member wrote on Twitter. As per the latest notification, several students have asked for clarity over the delay in releasing admit cards. These candidates who have registered themselves for the entrance test are waiting for their admit cards to be issued by the National Board of Examinations in Medical Science (NBEMS).
english
import React from 'react' import { Graph, Node, NodeView, Point, Angle, Dom, Vector } from '@antv/x6' import '../index.less' class ConveyorNode extends Node { addPallet() { this.prop('hasPallet', true) } removePallet() { this.prop('hasPallet', false) } hasPallet() { return !!this.prop('hasPallet') } switchPallet() { if (this.hasPallet()) { this.removePallet() } else { this.addPallet() } } getOuterRectBBox() { var size = this.getSize() var bbox = { x: 0, y: 0, width: size.width, height: size.height, } return bbox } getInnerRectBBox() { var padding = 2 var size = this.getSize() var bbox = { x: padding, y: padding, width: size.width - 2 * padding, height: size.height - 2 * padding, } return bbox } } const innerRect = Vector.create('rect').addClass('rect-inner').node const outerRect = Vector.create('rect').addClass('rect-outer').node class ConveyorNodeView extends NodeView<ConveyorNode> { svgOuterRect: SVGRectElement svgInnerRect: SVGRectElement confirmUpdate(flag: number) { if (this.hasAction(flag, 'markup')) this.renderMarkup() if (this.hasAction(flag, 'pallet')) this.updatePallet() if (this.hasAction(flag, 'resize')) this.resize() if (this.hasAction(flag, 'rotate')) this.rotate() if (this.hasAction(flag, 'translate')) this.translate() } renderMarkup() { this.svgOuterRect = outerRect.cloneNode() this.svgInnerRect = innerRect.cloneNode() this.container.appendChild(this.svgOuterRect) this.container.appendChild(this.svgInnerRect) } updatePallet() { var palletColor = this.cell.hasPallet() ? 'blue' : 'red' Dom.attr(this.svgInnerRect, 'fill', palletColor) } updateRectsDimensions() { var node = this.cell Dom.attr(this.svgOuterRect, node.getOuterRectBBox()) Dom.attr(this.svgInnerRect, node.getInnerRectBBox()) } resize() { this.updateRectsDimensions() } translate() { var node = this.cell var position = node.getPosition() Dom.translate(this.container, position.x, position.y, { absolute: true }) } rotate() { var node = this.cell var angle = node.getAngle() var size = node.getSize() Dom.rotate(this.container, angle, size.width / 2, size.height / 2, { absolute: true, }) } } ConveyorNodeView.config({ bootstrap: ['translate', 'resize', 'rotate', 'pallet', 'markup'], actions: { size: ['resize', 'rotate'], angle: ['rotate'], position: ['translate'], hasPallet: ['pallet'], }, }) Node.registry.register('performance_conveyor', ConveyorNode, true) NodeView.registry.register('performance_conveyor_view', ConveyorNodeView, true) ConveyorNode.config({ view: 'performance_conveyor_view' }) function createCircle( center: Point.PointLike, radius: number, rectSize: number, ) { var nodes = [] for (var angle = 0; angle < 360; angle += 3) { var p = Point.fromPolar(radius, Angle.toRad(angle), center) var conveyorElement = new ConveyorNode({ position: { x: p.x, y: p.y }, size: { width: rectSize, height: rectSize }, angle: -angle, }) if (nodes.length % 2 === 0) { conveyorElement.addPallet() } else { conveyorElement.removePallet() } nodes.push(conveyorElement) } return nodes } export default class Example extends React.Component { private container: HTMLDivElement componentDidMount() { const graph = new Graph({ container: this.container, width: 1000, height: 1000, grid: 1, async: true, sorting: 'approx', background: { color: '#000000', }, }) // efficient drawing var rectSize = 18 var center = graph.getArea().getCenter() var radius = 1000 / 2 var nodes: ConveyorNode[] = [] for (var i = 0; i < 10; i++) { nodes.push(...createCircle(center, radius - 50 - i * 30, rectSize)) } graph.model.resetCells(nodes) // var frames = 0 var startTime = Date.now() var prevTime = startTime var fpsElement = document.getElementById('fps') as HTMLElement var updateConveyor = function () { for (i = 0; i < nodes.length; i += 1) { nodes[i].switchPallet() } var time = Date.now() frames++ if (time > prevTime + 1000) { var fps = Math.round((frames * 1000) / (time - prevTime)) prevTime = time frames = 0 fpsElement.textContent = 'FPS: ' + fps } } setInterval(updateConveyor, 1) } refContainer = (container: HTMLDivElement) => { this.container = container } render() { return ( <div className="x6-graph-wrap" style={{ backgroundColor: '#000', }} > <div id="fps" style={{ position: 'fixed', color: '#fff', top: 10, left: 10, }} /> <div ref={this.refContainer} className="x6-graph" style={{ boxShadow: 'none' }} /> </div> ) } }
typescript
<filename>vendor/assets/javascripts/mobile/la_boutique.js var boutique = { animate_nivo: function($progress, speed) { $progress.find('span').animate({ 'width': '100%' }, speed, 'linear'); }, reset_nivo: function($progress) { $progress.find('span').stop().css('width', '0%'); }, resize_menu: function(width) { if(width > 979) { $('.main-menu').find('ul').removeClass('span3').addClass('span2'); } else { $('.main-menu').find('ul').removeClass('span2').addClass('span3'); } } }; $(document).ready(function() { "use strict"; // $('.megamenu').megaMenuCompleteSet({ // menu_speed_show : 300, // Time (in milliseconds) to show a drop down // menu_speed_hide : 200, // Time (in milliseconds) to hide a drop down // menu_speed_delay : 200, // Time (in milliseconds) before showing a drop down // menu_effect : 'hover_fade', // Drop down effect, choose between 'hover_fade', 'hover_slide', etc. // menu_click_outside : 1, // Clicks outside the drop down close it (1 = true, 0 = false) // menu_show_onload : 0, // Drop down to show on page load (type the number of the drop down, 0 for none) // menu_responsive:1 // 1 = Responsive, 0 = Not responsive // }); // var base = $('base').attr('href'); // var share_url = base + 'sharrre/'; // var screen_width = $(window).width(); // (function() { // boutique.resize_menu(screen_width); // })(); // (function() { // var options_panel = $('.options-panel'); // options_panel.find('.options-panel-toggle').on('click', function(event) { // options_panel.toggleClass('active'); // if (options_panel.hasClass('active')) { // options_panel.animate({ // 'left': 0 // }, 600, 'easeInOutBack'); // } else { // options_panel.animate({ // 'left': '-' + options_panel.find('.options-panel-content').outerWidth() // }, 600, 'easeInOutBack'); // } // event.preventDefault(); // }); // options_panel.find('#option_color_scheme').on('change', function() { // var stylesheet = $('#color_scheme'); // stylesheet.attr('href', $(this).attr('value')); // $.cookie('color_scheme', $(this).attr('value')); // }); // })(); // (function() { // $(".mobile-nav").change(function() { // window.location = $(this).find("option:selected").val(); // }); // })(); // (function() { // $('.navigation').find('.main-menu').on('mouseover', '> li', function() { // var $this = $(this); // $this.children('ul').show(); // }); // $('.navigation').find('.main-menu').on('mouseleave', '> li', function() { // var $this = $(this); // $this.children('ul').hide(); // }); // })(); // (function() { // var panel_navigation = $('.panel-navigation.primary'); // panel_navigation.children('li').children('a').append('<span class="toggle">&minus;</span>'); // panel_navigation.find('.toggle').on('click', function(event) { // var $this = $(this); // var active = $this.hasClass('active'); // $this.toggleClass('active').html(active ? '&minus;' : '&plus;'); // $this.parent('a').next('.panel-navigation.secondary').slideToggle(); // event.preventDefault(); // }); // })(); // (function() { // $('#checkout-content').on('click', '.shipping-methods .box, .payment-methods .box', function(e) { // var radio = $(this).find(':radio'); // radio.prop('checked', true); // }); // })(); // (function() { // var map = $('.map'); // map.gmap3({ // map: { // address: map.data('address'), // options: { // zoom: map.data('zoom'), // mapTypeId: google.maps.MapTypeId.ROADMAP, // mapTypeControl: false, // navigationControl: true, // scrollwheel: false, // streetViewControl: false // } // }, // marker: { // address: map.data('address'), // } // }); // })(); // (function() { // var slider = $('#slider'); // slider.slider({ // range: true, // min: 0, // max: slider.data('max'), // values: [0, slider.data('max')], // step: slider.data('step'), // animate: 200, // slide: function(event, ui) { // $('#slider-label').find('strong').html(slider.data('currency') + ui.values[0] + ' &ndash; ' + slider.data('currency') + ui.values[1]); // }, // change: function(event, ui) { // var products = $('.product-list').find('li').filter(function() { // return ($(this).data('price') >= ui.values[0]) && $(this).data('price') <= ui.values[1] ? true : false; // }); // var $product_list = $('.product-list.isotope'); // $product_list.isotope({ // filter: products // }); // } // }); // })(); (function() { var $product_list = $('.product-list.isotope'); $product_list.addClass('loading'); $product_list.imagesLoaded(function() { $product_list.isotope({ itemSelector: 'li' }, function($items) { this.removeClass('loading'); }); }); })(); // (function() { // imagesLoaded($('.post-list img'), function(){ // var $post_list = $('.post-list'); // $post_list.isotope({ // itemSelector: 'article.post-grid' // }); // }); // })(); // $("[rel='tooltip']").tooltip(); // $('#sharrre .twitter').sharrre({ // template: '<button class="btn btn-mini btn-twitter"><i class="icon-twitter"></i> &nbsp; {total}</button>', // share: { // twitter: true // }, // enableHover: false, // enableTracking: true, // click: function(api, options) { // api.simulateClick(); // api.openPopup('twitter'); // } // }); // $('#sharrre .facebook').sharrre({ // template: '<button class="btn btn-mini btn-facebook"><i class="icon-facebook"></i> &nbsp; {total}</button>', // share: { // facebook: true // }, // enableHover: false, // enableTracking: true, // click: function(api, options) { // api.simulateClick(); // api.openPopup('facebook'); // } // }); // $('#sharrre .googleplus').sharrre({ // template: '<button class="btn btn-mini btn-googleplus"><i class="icon-google-plus"></i> &nbsp; {total}</button>', // share: { // googlePlus: true // }, // enableHover: false, // enableTracking: true, // click: function(api, options) { // api.simulateClick(); // api.openPopup('googlePlus'); // }, // urlCurl: share_url // }); // $('#sharrre .pinterest').sharrre({ // template: '<button class="btn btn-mini btn-pinterest"><i class="icon-pinterest"></i> &nbsp; {total}</button>', // share: { // pinterest: true // }, // enableHover: false, // enableTracking: true, // click: function(api, options) { // api.simulateClick(); // api.openPopup('pinterest'); // }, // urlCurl: share_url // }); // $('.product-images .primary img').elevateZoom({ // zoomType: "inner", // cursor: "crosshair", // easing: true, // zoomWindowFadeIn: 300, // zoomWindowFadeOut: 300, // gallery: 'gallery', // galleryActiveClass: 'active' // }); // $('#query').keyup(function(){ // $('#autocomplete-results').css({display:'block'}); // setTimeout(function(){ // $('#autocomplete-results').css({display:'none'}); // },3000); // }); // (function() { // var $tweets = $('#tweets'); // $tweets.tweet({ // username: $tweets.data('username'), // favorites: false, // retweets: false, // count: 1, // avatar_size: 60, // template: '<div class="tweet"><div class="avatar">{avatar}</div><div class="text">{text}{time}</div></div>' // }); // })(); //set color scheme // if (typeof($.cookie('color_scheme'))!=undefined){ // var stylesheet = $('#color_scheme'); // stylesheet.attr('href', $.cookie('color_scheme')); // $('.options-panel #option_color_scheme').val($.cookie('color_scheme')); // } }); $(window).smartresize(function() { "use strict"; var screen_width = $(window).width(); var $product_list = $('.product-list.isotope'); $product_list.isotope('reLayout'); boutique.resize_menu(screen_width); }); $(window).load(function() { "use strict"; $('html').removeClass('no-js').addClass('js'); // $('.flexslider').flexslider({ // animation: 'fade', // easing: 'swing', // smoothHeight: true, // slideshowSpeed: 10000, // animationSpeed: 500, // pauseOnAction: false, // directionNav: true, // start: function($slider) { // var $this = $(this)[0]; // $('<div />', { // 'class': $this.namespace + 'progress' // }).append($('<span />')).appendTo($slider); // $('.' + $this.namespace + 'progress').find('span').animate({ // 'width': '100%' // }, $this.slideshowSpeed, $this.easing); // }, // before: function($slider) { // var $this = $(this)[0]; // $('.' + $this.namespace + 'progress').find('span').stop().css('width', '0%'); // }, // after: function($slider) { // var $this = $(this)[0]; // $('.' + $this.namespace + 'progress').find('span').animate({ // 'width': '100%' // }, $this.slideshowSpeed, $this.easing); // } // }); });
javascript
<gh_stars>1000+ const set = require('regenerate')(); set.addRange(0xAAE0, 0xAAF6).addRange(0xABC0, 0xABED).addRange(0xABF0, 0xABF9); module.exports = set;
javascript
import { pText, pImg, pBox, pButton } from "../../../libs/component/index"; import fixedTemplate from "../../../libs/template/fixed"; module.exports = function(PIXI, app, obj, callBack) { const container = new PIXI.Container(); const { goBack, title, apiName, underline, logo } = fixedTemplate(PIXI, { obj, title: "截图生成一个临时文件", apiName: "toTempFilePath" }); const bottomBg = new PIXI.Graphics(); container.addChild(bottomBg); bottomBg .beginFill(0xf5f6fa) .drawRoundedRect( 0, underline.y + 60 * PIXI.ratio, app.renderer.view.width, app.renderer.view.height ) .endFill(); const box = pBox(PIXI, { height: 360 * PIXI.ratio, y: underline.y + underline.height + 80 * PIXI.ratio }); const img = pImg(PIXI, { width: 630 * PIXI.ratio, height: 280 * PIXI.ratio, src: "images/someImage.png", relative_middle: { containerWidth: box.width, containerHeight: box.height } }); const tipText = pText(PIXI, { content: "提示:一但使用了开放数据域,生成后的文件仅\n能被qq.saveImageToPhotosAlbum、qq.share\nAppMessage、qq.onShareAppMessage\n这些接口调用", fontSize: 28 * PIXI.ratio, fill: 0x878b99, align: "center", lineHeight: 28 * PIXI.ratio, y: box.height + box.y + 44 * PIXI.ratio, relative_middle: { containerWidth: obj.width } }); const button = pButton(PIXI, { width: 686 * PIXI.ratio, y: box.height + box.y + 260 * PIXI.ratio }); box.addChild(img); // 截图生成一个临时文件 “按钮” 开始 button.myAddChildFn( pText(PIXI, { content: `截图生成一个临时文件`, fontSize: 34 * PIXI.ratio, fill: 0xffffff, relative_middle: { containerWidth: button.width, containerHeight: button.height } }) ); button.onClickFn(() => { callBack({ status: "toTempFilePath", deploy: { x: img.x, y: box.y + img.y, width: img.width, height: img.height } }); }); // 截图生成一个临时文件 “按钮” 结束 container.addChild( goBack, title, apiName, underline, box, tipText, button, logo ); app.stage.addChild(container); return container; };
javascript
Cincinnati Home + Garden Show. Minneapolis Home + Garden Show. PA Home + Garden Show. Jacksonville Home + Patio Show (Spring). Richmond Home + Garden Show. The National Home Show (Montreal). Louisville Home, Garden + Remodeling Show. Salt Lake Home + Garden Show. Indiana Flower + Patio Show. BC Home + Garden Show. Below is the complete list of shows. You can also filter by date. Click on the markers below to zoom in and see where our shows can be found. Indiana State Fairgrounds and Event Center / Indianapolis (IN). Vancouver Convention Centre - West Building / Vancouver, BC. Overland Park Convention Center / Overland Park (KS). The Park Expo and Conference Center, Charlotte, NC. OKC Fairgrounds - Bennett Event Center / Oklahoma City, OK. Overland Park Convention Center / Overland Park (KS). Harrisburg, PA Farm Show Complex & Expo Center. Overland Park Convention Center / Overland Park (KS). Phoenix Convention Center - South Building / Phoenix, AZ. Greater Philadelphia Expo Center at Oaks / Oaks, PA. The Park Expo and Conference Center, Charlotte, NC. TERMS OF USE. About UsContact Habitat For Humanity Partnership Bryan Baeumler Partnership Job Opportunities. Information for ExhibitorsGet a Quote. What's new in the Press Release Home and Garden Blog ExhibiTALK.
english
import React from "react"; import { mount } from "enzyme"; import DataFetchError from "../../../js/components/report/data-fetch-error"; describe("<DataFetchError />", () => { let dataFetchError; describe("when the error has a plain text body", () => { beforeEach(() => { dataFetchError = mount(<DataFetchError error={{title: "fake title", body: "fake error body"}} />); }); it("should render the text", () => { expect(dataFetchError.text()).toEqual(expect.stringContaining("fake error body")); }); }); describe("when the error has a url and no body", () => { beforeEach(() => { dataFetchError = mount(<DataFetchError error={{title: "fake title", url: "http://example.com"}} />); }); it("should render the url", () => { expect(dataFetchError.text()).toEqual(expect.stringContaining("URL: http://example.com")); }); }); // <div>URL: {error.url}</div> // <div>Status: {error.status}</div> // <div>Status text: {error.statusText}</div> // The data fetch error also supports an error which is the response from a fetch // in this case the error.body is a ReadableStream. This is tested by // cypress/integration/api-error.spec.js });
javascript
For years the Drew Brees/Michael Thomas connection was the "bread and butter" of the New Orleans Saints offense. The New Orleans Saints are ranked 31st in the National Football League in terms of receiving yards. The obvious reason is due in part to the absence of wide receiver Michael Thomas. Thomas dealt with an ankle injury in 2020 that limited him to just five starts, seven games in total, breaking a four-year streak of at least 1,000 receiving yards. Michael Thomas had surgery on his ankle in the offseason, which has kept him off the field so far this season. Although it was originally thought that Thomas would return around Week 6 or 7 of the NFL season, it seems that he isn't ready to return to the field just yet. NFL insider Ian Rapoport reported that Michael Thomas, who is scheduled to return to the New Orleans Saints this week, is still apparently weeks away from even hitting the practice field. Per NFL rules, once a player is activated off the PUP (Physically Unable to Perform) list, the team has three weeks to put that player on the active roster or, they will be done for the season if they can't get back in that time frame. So, once Thomas returns to practice, the Saints will have 21 days to get him on the active roster. It seems that the Saints are waiting until Thomas is completely rehabilitated and healthy before starting the clock for his return. There has been speculation since the summer that the New Orleans Saints and Michael Thomas were not in a good place. There were even rumors that Thomas wanted to be traded out of New Orleans and that he waited to undergo surgery to delay the time frame of his return. Most of those rumors have been squashed and it seems that both parties are on good terms. The Saints offense desperately needs Michael Thomas back in the starting lineup. Since being drafted in 2016, Thomas has had over 1,000 yards receiving each season until 2020. His 1,725 receiving yards in 2019 led the league and his 149 receptions that season broke an NFL record. In his absence, the New Orleans Saints signed Chris Hogan in the summer and used Kenny Stills, Marquez Callaway, Deonte Harris and Ty Montgomery. The New Orleans Saints sit at 3-2 in the season and are coming off their bye week. The Saints will travel to the West Coast for a Monday night matchup against the Seattle Seahawks.
english
Annamayya Dt: In a horrendous incident, a woman beheaded her daughter-in-law’s head and walked into the police station with her severed head in the Annamayya district of Andhra Pradesh. The incident took place in broad daylight on Thursday noon at K Ramapuram in Rayachoti mandal in the district. As per reports, the woman named Subbamma had cut off the head of her daughter-in-law identified as Vasundhara ( 35), upset over her alleged affair with another man and also related property issues. Locals who saw a disheveled Subbamma walking with the severed head in a plastic cover were shocked, and so were the policemen when she walked into the station and showed them the contents of the cover. This is the first such incident in the history of this police station and in Rayachoti, locals said. Onlookers recorded a video of the woman who was seen walking with her head placed in a black cover and filled with blood. Initial reports state that the Vasundhara who was a widow had two children. Her husband bequeathed a house and other properties in her name. She was said to be having an affair with another man. Subbamma was upset that she was going to give the house and properties to the other man and hatched a plan to eliminate her. She is said to have killed her with the help of Vasundhara's husband's brother named Chandu and murdered the woman on Thursday afternoon. Local police immediately rushed to Vasundhara's house to find her body lying in a pool of blood. A case was registered and the police have taken Subbamma and Chandu into custody and are investigating further.
english
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from apscheduler.schedulers.background import BackgroundScheduler from apscheduler.schedulers import SchedulerNotRunningError from aliyunsdkcore.client import AcsClient from urllib.request import urlopen import colorlog import logging import json import time import sys class Log: logsa="---------------------------------------------------------" logsb="=========================================================" log_colors_config = { "INFO": "green", "WARNING": "yellow", "ERROR": "red", } logger = logging.getLogger("logger_name") console_handler = logging.StreamHandler() file_handler = logging.FileHandler(filename="logs.log",encoding="utf8") logger.setLevel(logging.INFO) console_handler.setLevel(logging.INFO) file_handler.setLevel(logging.INFO) file_formatter = logging.Formatter( fmt="%(asctime)s [%(levelname)s] : %(message)s", datefmt="%Y-%m-%d %H:%M:%S" ) console_formatter = colorlog.ColoredFormatter( fmt="%(log_color)s%(asctime)s [%(levelname)s] : %(message)s", datefmt="%Y-%m-%d %H:%M:%S", log_colors=log_colors_config ) console_handler.setFormatter(console_formatter) file_handler.setFormatter(file_formatter) if not logger.handlers: logger.addHandler(console_handler) logger.addHandler(file_handler) console_handler.close() file_handler.close() class GetConfig: def getconfig(key=None, default=None, path="config.json"): if not hasattr(GetConfig.getconfig, "config"): try: with open(path) as config: GetConfig.getconfig.config = json.load(config) except IOError: Log.logger.error("配置文件config.json不存在!") with open(path, "w") as config: configure = { "accessKeyId": "youraccessKeyId", "accessSecret": "youraccessSecret", "enableipv4": True, "enableipv6": True, "domain": "your.domain", "names": [ "host1", "host2" ], "enabletimedrun": True, "timedruntime": "600" } json.dump(configure, config, indent=4, sort_keys=False) sys.stdout.write("已生成新的配置文件config.json!\n\n") Log.logger.warning("已生成新的配置文件config.json!\n\nconfig.json 配置文件说明:\n\n accessKeyId:你获取的阿里云accessKeyId\n accessSecret:你获取的阿里云accessSecret\n\n enableipv4/6:是否启用IPv4/6的DDNS动态域名更新\n true 为启用,false 为禁用\n\n domain:你的域名\n names: 你的主机记录值(支持多个)\n\n enabletimedrun: 是否启用后台自动间隔运行\n true 为启用,false 为禁用\n timedruntime: 为间隔运行时间(单位为秒)\n") input("配置文件的详细填写说明在log文件中,填入你的信息,重新运行本程序!") sys.exit(0) except: Log.logger.error("无法从config.json加载配置文件!") sys.exit(0) if key: return GetConfig.getconfig.config.get(key, default) else: return GetConfig.getconfig.config class DDNSUnit: def client(): try: client = AcsClient(accessKeyId, accessSecret, "cn-hangzhou") except: Log.logger.error("运行中出现错误,请检查配置文件!") input("运行中出现错误,请检查配置文件!") sys.exit(0) return client def response(request): try: response = DDNSUnit.client().do_action_with_exception(request) except: Log.logger.error("运行中出现错误,请检查配置文件!") input("运行中出现错误,请检查配置文件!") sys.exit(0) return response def update(RecordId, RR, Type, Value): from aliyunsdkalidns.request.v20150109.UpdateDomainRecordRequest import UpdateDomainRecordRequest request = UpdateDomainRecordRequest() request.set_accept_format("json") request.set_RecordId(RecordId) request.set_RR(RR) request.set_Type(Type) request.set_Value(Value) DDNSUnit.response(request) def add(DomainName, RR, Type, Value): from aliyunsdkalidns.request.v20150109.AddDomainRecordRequest import AddDomainRecordRequest request = AddDomainRecordRequest() request.set_accept_format("json") request.set_DomainName(DomainName) request.set_RR(RR) request.set_Type(Type) request.set_Value(Value) DDNSUnit.response(request) def delete(Domain, Name): from aliyunsdkalidns.request.v20150109.DeleteSubDomainRecordsRequest import DeleteSubDomainRecordsRequest request = DeleteSubDomainRecordsRequest() request.set_accept_format("json") request.set_DomainName(Domain) request.set_RR(Name) DDNSUnit.response(request) def getinfo(Domain, Name): from aliyunsdkalidns.request.v20150109.DescribeSubDomainRecordsRequest import DescribeSubDomainRecordsRequest request = DescribeSubDomainRecordsRequest() request.set_accept_format("json") request.set_DomainName(Domain) request.set_SubDomain(Name + "." + Domain) response = DDNSUnit.response(request) info = json.loads(response) return info def index(i): Log.logger.info("类型:%s" % (info["DomainRecords"]["Record"][i]["Type"])) Log.logger.info("值:%s" % (info["DomainRecords"]["Record"][i]["Value"])) Log.logger.info(Log.logsa) class GetIP: def getipv4(): try: ipv4 = urlopen("https://api-ipv4.ip.sb/ip").read() ipv4 = str(ipv4, encoding="utf-8") ipv4 = ipv4.strip() Log.logger.info("获取到本机IPv4地址:%s" % ipv4) except: ipv4 = None Log.logger.error("无法获取本机IPv4地址,请检查配置!") return ipv4 def getipv6(): try: ipv6 = urlopen("https://api-ipv6.ip.sb/ip").read() ipv6 = str(ipv6, encoding="utf-8") ipv6 = ipv6.strip() Log.logger.info("获取到本机IPv6地址:%s" % ipv6) except: ipv6 = None Log.logger.error("无法获取本机IPv6地址,请检查配置!") return ipv6 class DDNS: def newaddipv4(): if enableipv4 == True: ipv4 = GetIP.getipv4() if ipv4 != None: DDNSUnit.add(domain, name, "A", ipv4) Log.logger.info("域名(%s)新建解析成功" % (name + "." + domain)) Log.logger.info(Log.logsa) def newaddipv6(): if GetConfig.getconfig("enableipv6") == True: ipv6 = GetIP.getipv6() if ipv6 != None: DDNSUnit.add(domain, name, "AAAA", ipv6) Log.logger.info("域名(%s)新建解析成功" % (name + "." + domain)) Log.logger.info(Log.logsa) def changeipv4(): if enableipv4 == True: ipv4 = GetIP.getipv4() if ipv4 != None: if info["DomainRecords"]["Record"][i]["Value"].strip() != ipv4.strip(): DDNSUnit.update(info["DomainRecords"]["Record"][i]["RecordId"], name, "A", ipv4) Log.logger.info("域名(%s)解析修改成功" % (name + "." + domain)) else: Log.logger.info("域名(%s)IPv4地址没变" % (name + "." + domain)) Log.logger.info(Log.logsa) def changeipv6(): if enableipv6 == True: ipv6 = GetIP.getipv6() if ipv6 != None: if info["DomainRecords"]["Record"][i]["Value"].strip() != ipv6.strip(): DDNSUnit.update(info["DomainRecords"]["Record"][i]["RecordId"], name, "AAAA", ipv6) Log.logger.info("域名(%s)解析修改成功" % (name + "." + domain)) else: Log.logger.info("域名(%s)IPv6地址没变" % (name + "." + domain)) Log.logger.info(Log.logsa) def Main(): global domain,name ,info,i,enableipv4,enableipv6,accessKeyId,accessSecret enableipv4 = GetConfig.getconfig("enableipv4") enableipv6 = GetConfig.getconfig("enableipv6") accessKeyId = GetConfig.getconfig("accessKeyId") accessSecret = GetConfig.getconfig("accessSecret") domain = GetConfig.getconfig("domain") names = GetConfig.getconfig("names") for name in names: info = DDNSUnit.getinfo(domain, name) Log.logger.info(Log.logsb) Log.logger.info("域名:(%s)" % (name + "." + domain)) Log.logger.info("总记录个数:%s" % (info["TotalCount"])) Log.logger.info("IPv4地址DDNS功能:{0}" .format("启用" if enableipv4 == True else "禁用")) Log.logger.info("IPv6地址DDNS功能:{0}" .format("启用" if enableipv6 == True else "禁用")) Log.logger.info(Log.logsa) for i, element in enumerate(info["DomainRecords"]["Record"]): if info["TotalCount"] == 0: DDNS.newaddipv4() DDNS.newaddipv6() elif info["TotalCount"] == 1: if info["DomainRecords"]["Record"][i]["Type"] == "A": DDNS.changeipv4() DDNS.newaddipv6() elif info["DomainRecords"]["Record"][i]["Type"] == "AAAA": DDNS.changeipv6() DDNS.newaddipv4() else: DDNS.newaddipv6() DDNS.newaddipv4() elif info["TotalCount"] == 2: Log.logger.info("Start") if info["DomainRecords"]["Record"][i]["Type"] == "A": DDNS.changeipv4() if info["DomainRecords"]["Record"][1-i]["Type"] != "AAAA": DDNS.newaddipv6() elif info["DomainRecords"]["Record"][i]["Type"] == "AAAA": DDNS.changeipv6() if info["DomainRecords"]["Record"][1-i]["Type"] != "A": DDNS.newaddipv4() else: Log.logger.info("跳过非域名记录类型") else: if info["DomainRecords"]["Record"][i]["Type"] == "A": DDNS.changeipv4() elif info["DomainRecords"]["Record"][i]["Type"] == "AAAA": DDNS.changeipv6() else: Log.logger.info("跳过非域名记录类型") class Timed: def Main(): enabletimedrun = GetConfig.getconfig("enabletimedrun") timedruntime = int(GetConfig.getconfig("timedruntime")) Log.logger.info("计划任务执行功能:{0}" .format("启用" if enabletimedrun == True else "禁用")) if enabletimedrun == True: Log.logger.info("计划任务执行时间间隔:%s秒" %timedruntime) BackgroundScheduler().start() Log.logger.info("=====================开始执行计划任务====================") Log.logger.info("在运行中输入 Ctrl + C 可以退出本程序!") try: while True: DDNS.Main() time.sleep(timedruntime) except (KeyboardInterrupt): sys.exit(0) except (SchedulerNotRunningError): sys.exit(0) else: DDNS.Main() if __name__ == "__main__": Timed.Main()
python
The dramatic fall of FTX is taking with it more than just the paper wealth of one of crypto's most colorful players. It's hard not to wonder where venture goes next in web3. Here's how we helped establish a positive remote culture that helps our engineers be productive and accountable. Volvo unveiled Wednesday its flagship electric vehicle, a seven-passenger SUV loaded with sensors and software that the company hopes will push it ahead in an increasingly saturated luxury EV market. Subscription management services are meant to be used by developers, but not only: Their user personas include engineering, product and marketing teams. Adapty hopes to help developers earn more from their apps. So far, it has been doing this mostly by powering A/B testing for paywalls, but it has a broader road map. Ping users create a free account in U.S. dollars to receive bank transfers in either their local currency or cryptocurrency. Apple announced its so-called Figma Whiteboard competitor called Freeform at its Worldwide Developer Conference (WWDC) in June. The company hasn’t rolled out the idea board app to everyone yet,
english
Steph Curry and the Golden State Warriors are coming off another NBA championship, their fourth in the last eight years. Despite winning it all, they want to win next year and have flirted with the idea of trading for Kevin Durant. Durant was not happy with the Brooklyn Nets. However, he decided to stay with the team after talking to Joe Tsai, the owner of the franchise. Shannon Sharpe recently spoke about the two-time NBA champion on "Undisputed. " He pointed out how he hasn't won without Steph Curry and the Warriors yet. “I can win without you KD, you have yet to show that you can win without me," Sharpe said. Since leaving the Warriors, Kevin Durant's biggest success was reaching the second round of the playoffs. His last season was especially bad as the Nets were swept in the first round. Since his trade to the Brooklyn Nets, Kevin Durant's career hasn't been really great. He sat out the entire first year with the team due to an injury, but he bounced back a season later, averaging 26. 9 points per game. That year, he almost led the team to the conference finals. Unfortunately, Giannis Antetokounmpo and his Milwaukee Bucks outlasted the Nets and advanced. The Bucks ended up winning it all, which made things even worse for Durant and the Nets. Last season, Kyrie Irving sat out more than 50 games due to his refusal to get vaccinated. Durant also missed a lot of games due to injuries, and in the end, the Nets were swept by the Boston Celtics. Winning without Steph Curry is extremely tough for Durant. He's dealt with a lot of problems and has played in what's considered an easier conference. Unfortunately, his results have been disappointing. When he was with the Warriors, Kevin Durant was still one of the best players in the world. In three years in the Bay Area, Durant won two championships and received two Finals MVP awards. If the Warriors traded for Kevin Durant, they would have lost a lot of flexibility and a lot of young players. Shannon Sharpe believes that Steph Curry is satisfied with the roster that surrounds him now and he'd rather have those guys instead of KD. Unfortunately, the Warriors will probably have to part ways with some of their players. Jordan Poole is a fantastic young player who averaged 18. 5 points per game last season. Unfortunately, his contract expires next summer. Steph Curry may also lose Andrew Wiggins as his teammate. Wiggins played a huge role in the last championship run by the Warriors, but his contract will also expire in less than a year and he will demand big money. Joe Lacob has complained about the luxury tax in the NBA and may not be willing to pay a huge amount of money to keep the team together. 5 Times Steph Curry Was HUMILIATED On And Off The Court!
english
When Delhi airports terminal 3 is inaugurated by the Prime Minister on Saturday,a carpet manufactured in Mulshi here is likely to be the cynosure of all eyes. A large workforce in Mulshi had spent the better part of the year working on what is arguably the largest ever commercial order in the world for a carpet for a single customer. The carpet is spread over an area of 1,70,000 sq m or 24 football fields. The order was bagged by UKs Brintons Carpets. The work was done at Brintons Carpets Asia,its Asia manufacturing unit. As many as 320 labourers and 20 weaving machines worked for four months to put together the piece that was transported to Delhi by 85 containers each 30 feet long. The basic design depicts Delhis Connaught Place as seen by Google Earth, said MM Kamath,director,Brintons Asia.
english
I'm not entirely sure how Gizmodo waded into this Coke vs. Pepsi thing—isn't Nokia vs. Motorola and Apple vs. Everything Else enough? But Gizmodo loves coffee, and after writing about Coke Blak yesterday, reader Yves sent us this update on the cola-coffee wars: Are You Rich Enough to Buy This Folding TV? Note 1: My bad for misspelling "Cappuccino." I thought that, like Coke Blak, Pepsi just dropped a C someplace. Note 2: Yes, I know all about Pepsi Kona. But doesn't this drink imply milk?
english
Viewership for the 2023 NBA All-Star Game hit a record low amid complaints that players don’t compete hard enough. In other news, Phoenix Suns superstar forward Kevin Durant’s target debut date has been revealed. On that note, here's the latest news from the NBA as of Feb. 23, 2023: Many NBA fans have complained that this year’s All-Star Game was a massive disappointment, as the players didn't put any effort into playing defense. It appears that the complaints have been reflected in the viewership totals for the game. According to Nielsen Media Research, just 3. 7 million fans watched the game on TNT. That's a 32% decrease from last year when just over 5. 4 million fans tuned in. It includes a 28% drop in viewership among adults between the ages of 25 and 54. Moreover, according to Sports Media Watch, Sunday's game marked the smallest All-Star Game audience on record. The NBA will now have some tough decisions to make about improving the event and piquing fan interest again. That will likely involve the league coming up with some sort of extra incentives to get players to compete. However, it remains to be seen if any drastic changes are made. Kevin Durant has been out since Jan. 8 with a right MCL sprain. Durant suffered the injury when he was still a member of the Brooklyn Nets and was expected to miss around 4-6 weeks. That timeline has now passed. As a result, many fans are awaiting Durant’s Phoenix Suns debut following his trade to Phoenix a couple of weeks ago. According to The Athletic’s Shams Charania, Durant hopes to make his Suns debut on Wednesday (Mar. 1) at Charlotte. On Durant’s return, the Suns (32-28, fifth in the West) could look to make a late-season run to achieve a top playoff seed. They sit just 4. 5 games behind Memphis (35-22) in second place in the NBA Western Conference. However, Phoenix will probably have Durant ramp up slowly as he eases himself back into action following an extended stint on the sidelines. Durant averaged 29. 7 points, 6. 7 rebounds, 5. 3 assists and 1. 5 blocks per game on 55. 9% shooting in 39 games with Brooklyn this season. The Atlanta Hawks (29-30, eighth in the East) fired coach Nate McMillan on Tuesday amid their disappointing season. ESPN’s Adrian Wojnarowski reported that Atlanta is planning to conduct a wide-ranging coaching search. According to NBA insider Marc Stein, that could include an interview with disgraced former Boston Celtics coach Ime Udoka. "Among the candidates being considered for the Hawks' coaching vacancy, league sources say, is former Celtics coach Ime Udoka,” Stein reported. In Udoka’s lone season as coach last year, he led the Celtics to the second seed in the East with a 51-31 record. The team proceeded to make it within two games of winning the championship, losing 4-2 in the 2022 NBA Finals to Golden State. However, Udoka was then suspended for the entirety of this season and later let go after being involved in a workplace misconduct scandal. That led to questions about whether he would receive another NBA coaching opportunity. However, it now looks like the Hawks may still be doing their due diligence and covering all their bases by potentially interviewing Udoka. Golden State Warriors superstar point guard Steph Curry has been out since Feb. 4 with a lower left leg injury. However, Curry recently underwent a re-evaluation. Following that, the Warriors have concluded that the player has made good progress and will be re-evaluated again in a week. The team’s official statement reads: "Golden State Warriors guard Stephen Curry, who has missed the last five games after suffering partial tears to his superior tibiofibular ligaments and interosseous membrane, as well as a contusion to his left lower leg on Feb. 4 vs. Dallas, was recently re-evaluated. " It continued: “The re-evaluation indicated that Curry is making good progress. He has started various individual on-court workouts, which will continue in the coming days. He will be re-evaluated again in one week. " The Warriors (29-29, ninth in the West) have gone 2-3 since Curry’s injury. Overall, the team is 9-11 without him and 20-18 with him this season. Through 38 games, Curry has averaged 29. 4 ppg, 6. 3 rpg, 6. 4 apg, 1. 0 spg and 4. 9 3 pg while shooting 49. 5% and 42. 7% from the three. Nine-time NBA All-Star point guard Russell Westbrook agreed a deal with the LA Clippers earlier this week. That came after he was traded from the LA Lakers to the Utah Jazz and subsequently bought out. Westbrook could reportedly make his Clippers debut as early as Friday (Feb. 24). As Westbrook prepares for his debut, his former Lakers teammate Anthony Davis was asked what Westbrook would offer the Clippers. Davis offered a fairly indifferent response: "I'm not part of that team. I have no idea what their locker room is like, what their chemistry is like,” Davis said. Davis then clarified that he's too busy with his personal life and that he hasn’t had a chance to watch many Clippers games this season. "Honestly, I don't really watch the Clippers like that," Davis said. "I got three kids; I don't have time for that. I don't know; I know they got rid of John (Wall) and Reggie (Jackson), so it's another point guard for them. I'm not sure how T. Lue and the coaching staff will utilize him, but I'm pretty sure he's happy to stay in LA,” Davis continued. Westbrook averaged 15. 9 ppg, 6. 2 rpg, 7. 5 apg and 1. 0 spg on 41. 7% shooting in 52 games with the Lakers this season. He did not appear for the Jazz following his trade to Utah. The Clippers (33-28, fourth in the West) will take on Sacramento (32-25, third in the West) at home on Friday (Feb. 24). This will mark their first game following the All-Star break and Westbrook’s first chance to suit up for the team.
english
<filename>assets/product/9648.json {"name":"<NAME>","harga":" Rp. 37.376/ kemasan","golongan":"http://medicastore.com/image_banner/obat_keras_dan_psikotropika.gif","kandungan":"Ambroxol HCl/Ambroksol HCl.","indikasi":"- Infeksi saluran nafas akut dan kronis yang disertai sekresi bronkial berlebihan.- Khususnya pada eksaserbasi bronkitis kronis, bronkitis asmatik dan asma bronkial.","kontraindikasi":"Hipersensitif terhadap ambroksol.","perhatian":"Hamil dan laktasi.","efeksamping":"Gangguan pencernaan ringan, reaksi alergi.","indeksamanwanitahamil":"","kemasan":"Syrup 15 mg/5 ml x 60 ml","dosis":"Anak 5 sampai 12 tahun : 5 ml 2 sampai 3 kali sehari.Anak 2 sampai 5 tahun : 2,5 ml 3 kali sehari.Kurang dari 2 tahun : 2,5 ml 2 kali sehari.","penyajian":"Dikonsumsi bersamaan dengan makanan","pabrik":"Ikapharmindo.","id":"9648","category_id":"3"}
json
<reponame>britive/python-api valid_statues = ['active', 'inactive'] class ServiceIdentities: def __init__(self, britive): self.britive = britive self.base_url = f'{self.britive.base_url}/users' def list(self, filter_expression: str = None) -> list: """ Provide an optionally filtered list of all service identities. :param filter_expression: filter list of users based on name, status, or role. The supported operators are 'eq' and 'co'. Example: 'name co "Smith"' :return: List of service identity records """ params = { 'type': 'ServiceIdentity', 'page': 0, 'size': 100 } if filter_expression: params['filter'] = filter_expression return self.britive.get(self.base_url, params) def get(self, service_identity_id: str) -> dict: """ Provide details of the given service_identity. :param service_identity_id: The ID of the service identity. :return: Details of the specified user. """ params = { 'type': 'ServiceIdentity' } return self.britive.get(f'{self.base_url}/{service_identity_id}', params=params) def get_by_name(self, name: str) -> list: """ Return service identities whose name field contains `name`. :param name: The name (or part of the name) of the service identity you wish to get :return: Details of the specified service identities. If no service identity is found will return an empty list. """ service_identities = self.list(filter_expression=f'name co "{name}"') return service_identities def get_by_status(self, status: str) -> list: """ Return a list of service identities filtered to `status`. :param status: valid values are `active` and `inactive` :return: """ if status not in valid_statues: raise ValueError(f'status {status} not allowed.') return self.list(filter_expression=f'status eq "{status}"') def search(self, search_string: str) -> list: """ Search all user fields for the given `search_string` and returns a list of matched service identities. :param search_string: :return: List of user records """ params = { 'type': 'ServiceIdentity', 'page': 0, 'size': 100, 'searchText': search_string } return self.britive.get(self.base_url, params) def create(self, **kwargs) -> dict: """ Create a new service identity. :param kwargs: Valid fields are... name - required description status - valid values are active, inactive - if omitted will default to active :return: Details of the newly created user. """ required_fields = ['name'] kwargs['type'] = 'ServiceIdentity' if 'status' not in kwargs.keys(): kwargs['status'] = 'active' if kwargs['status'] not in valid_statues: raise ValueError(f'invalid status {kwargs["status"]}') if not all(x in kwargs.keys() for x in required_fields): raise ValueError('Not all required keyword arguments were provided.') response = self.britive.post(self.base_url, json=kwargs) return response # TODO - check this once a bug fix has been deployed def update(self, service_identity_id: str, **kwargs) -> dict: """ Update the specified attributes of the provided service identity. Acceptable attributes are `name` and `description`. :param service_identity_id: The ID of the service identity to update :param kwargs: The attributes to update for the service identity :return: A dict containing the newly updated service identity details """ if 'name' not in kwargs.keys(): existing = self.get(service_identity_id) kwargs['name'] = existing['name'] # add some required elements to the kwargs passed in by the caller kwargs['type'] = 'ServiceIdentity' kwargs['roleName'] = '' self.britive.patch(f'{self.base_url}/{service_identity_id}', json=kwargs) # return the updated service identity record return self.get(service_identity_id) def delete(self, service_identity_id: str) -> None: """ Delete a service identity. :param service_identity_id: The ID of the service identity to delete :return: None """ self.britive.delete(f'{self.base_url}/{service_identity_id}') def enable(self, service_identity_id: str = None, service_identity_ids: list = None) -> object: """ Enable the given service identities. You can pass in both `service_identity_id` for a single user and `service_identity_ids` to enable multiple service identities in one call. If both `service_identity_id` and `service_identity_ids` are provided they will be merged together into one list. :param service_identity_id: The ID of the user you wish to enable. :param service_identity_ids: A list of user IDs that you wish to enable. :return: if `service_identity_ids` is set will return a list of user records, else returns a user dict """ computed_identities = [] if service_identity_ids: computed_identities += service_identity_ids if service_identity_id: computed_identities.append(service_identity_id) # de-dup computed_identities = list(set(computed_identities)) response = self.britive.post(f'{self.base_url}/enabled-statuses', json=computed_identities) if not service_identity_ids: return response[0] return response def disable(self, service_identity_id: str = None, service_identity_ids: list = None) -> object: """ Disable the given service identities. You can pass in both `service_identity_id` for a single service identity and `service_identity_ids` to disable multiple service identitie at in one call. If both `service_identity_id` and `service_identity_ids` are provided they will be merged together into one list. :param service_identity_id: The ID of the user you wish to disable. :param service_identity_ids: A list of user IDs that you wish to disable. :return: if `user_ids` is set will return a list of user records, else returns a user dict """ computed_identities = [] if service_identity_ids: computed_identities += service_identity_ids if service_identity_id: computed_identities.append(service_identity_id) # de-dup computed_identities = list(set(computed_identities)) response = self.britive.post(f'{self.base_url}/disabled-statuses', json=computed_identities) if not service_identity_ids: return response[0] return response
python
Former India cricketer Zaheer Khan's wife, actress Sagarika Ghatge said, “I see Stacy is back”. She has also added a series of emojis to the comment section. Watch the adorable video here: Last month, Hazel Keech and Yuvraj Singh celebrated Orin's six-month birthday. Alongside an adorable picture of the baby boy, Hazel wrote, “And, just like that my little ray of sunshine turns 6 months. It's a pleasure to watch you explore and learn new skills every day. Thank you for making me your mummy, it's a role I treasure. Happy 6 Months, Orion. ” Don't know about you but we are gushing over his cute cheeks. Hazel Keech and former Indian cricketer Yuvraj Singh got married in 2016. Earlier this year in January, the couple welcomed their baby boy.
english
#mainnavbar .navbar-brand{ color: white ; font-size: 1.5rem; } #mainnavbar .nav-link { color: white; } #mainnavbar .nav-toggler-icon { color: white; } #para{ text-align: center; color: white; } body{ background-color: black; font-family: 'Righteous', cursive; } h1{ color: #ffffff; text-align: center; margin-top: 30px; margin-bottom: 40px; } #one{ background-color: rgb(40,103,178); } #two{ background-color: rgb(33, 31, 31); } #three{ background-color: rgb(225,48,108); } #buttons{ margin-bottom: 10px; }
css
{ "symptoms": {}, "name": "<NAME>", "details": "South American plant. Paralysis; paraplegia with numbness. Sensation of internal coldness." }
json
Make 2015 a healthier year with Health Tuesdays with Femina where nutritionist and weight optimisation specialist Kavita Devgan will help you with tips to achieve all your health and fitness goals. You can also comment below and let us know the issues that you think should be discussed under Health Tuesdays with Femina. This vegetable is called by a lot of fancy names - brinjal, eggplant, aubergine, even melongene but unfortunately it is almost always overlooked, and quite often undermined both by people looking for health, as well as those who eat only for taste. I don’t get that at all! After all, this vegetable has everything going for it. For starters, it is ridiculously low in calories (25 calories per 100 gm) and loaded with fibre (3 grams), so you can eat a lot of it and still not gain weight at all. Plus it is packed with a bunch of B vitamins - B-6, choline, folate, pantothenic acid, riboflavin, niacin and thiamine, all of which help keep our metabolism running, a pre-requisite for staying thin. And besides being scale friendly, there are lots of other reasons too why we must plate this food more often. Protects our heart: Eggplants contain anthocyanins, phytochemicals that give it it’s vibrant colour, and help protect our hearts. Plus it is a high potassium and low sodium food, which again is good news for our heart. And chlorogenic acid in it helps lower bad cholesterol (LDL) levels. Kills cancer: Both anthocyanins and chlorogenic acid are effective cancer slayers too. Prevents diabetes: Eggplant helps prevent diabetes too, thanks to its high fiber and low soluble carbohydrate content. Increases immunity: Plus it is an alkaline food, which helps moderate the ph of our gut and boost the immune system. Eggplant’s skin is full of fiber, potassium and magnesium and antioxidants. The phenols in it are potent free radical scavengers that can help keep myriad lifestyle diseases away! And nasunin, an anthocyanin found within the skin is known to boost the brain, protect it from free radical damage and improve memory. Never ever fry them, because they have a tendency to soak up a lot of oil. And if you don’t quite like their slightly bitter taste then just cut them, sprinkle some salt on them, leave for a bit, then squeeze and rinse with water once. I personally totally dig the regular aloo-baigan subzi made at home and also always keep homemade babaganoush handy (purée roasted eggplant, garlic, tahini, lemon juice and olive oil). Also try this: Grill eggplant slices tossed with a bit of oil, salt and pepper for 5 minutes, flipping once. Place atop bread grilled with cheese, garlic and herbs and dig in.
english
<filename>Web/customHPAScalingClient/README.md # Autoscaling - Client Side This is a sample application that is meant to test out horizontal scaling using custom metrics. This has been tested on kubernetes 1.15+. However, experience with that is not that great. Further tests needs to be done - maybe kubernetes 1.18+ which also incluses autoscaling behaviours - which allow proper tight control over metric scaling. Before proceeding - do adjust the kustomization.yml file. And push the required image to the docker registry ## Usage Before deploying, do ensure that you build the required image and push to an image registry that is accessible by Kubernetes cluster ```bash # To deploy the components make deploy # To drop the components make drop ```
markdown
{ "_from": "sfcookies", "_id": "sfcookies@1.0.2", "_inBundle": false, "_integrity": "sha1-4t97TUydsVllu6uanOcoKdr/W7k=", "_location": "/sfcookies", "_phantomChildren": {}, "_requested": { "type": "tag", "registry": true, "raw": "sfcookies", "name": "sfcookies", "escapedName": "sfcookies", "rawSpec": "", "saveSpec": null, "fetchSpec": "latest" }, "_requiredBy": [ "#USER", "/" ], "_resolved": "https://registry.npmjs.org/sfcookies/-/sfcookies-1.0.2.tgz", "_shasum": "e2df7b4d4c9db15965bbab9a9ce72829daff5bb9", "_spec": "sfcookies", "_where": "/Users/leemartinc/Projects/ReactJS_e-library", "author": { "name": "<NAME>", "email": "<EMAIL>", "url": "http://davidtkatz.com/" }, "bugs": { "url": "https://github.com/15Dkatz/sfcookies/issues" }, "bundleDependencies": false, "deprecated": false, "description": "Giving react projects access to browser cookies. More description on usage on github.", "homepage": "https://github.com/15Dkatz/sfcookies#readme", "keywords": [ "Cookies", "React", "ReactJS" ], "license": "ISC", "main": "index.js", "name": "sfcookies", "repository": { "type": "git", "url": "git+https://github.com/15Dkatz/sfcookies.git" }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "version": "1.0.2" }
json
Tata Technologies Ltd. has been awarded the coveted Verafirm Certification by BSA The Software Alliance, one of the leading advocates for the global software industry. Verafirm certifications are awarded to enterprises whose Software Asset Management (SAM) programs are best-in-class and meet the benchmarks established by the International Organisation for Standardisation (ISO). This certification demonstrates the effectiveness of the world-class SAM practices at Tata Technologies that are aligned to the ISO 19770-1 standardised benchmarks. The Verafirm certification gives enterprises an opportunity to achieve software compliance and efficient license optimisation while ensuring improved IT and business efficiencies. It thus empowers Tata Technologies to implement and maintain effective SAM processes that adhere to international best practices, enhance competence of businesses and are distinguished in today’s constantly evolving business scenario. “This is a major achievement for Tata Technologies and we are absolutely thrilled to receive the Verafirm certification. This globally distinguished certificate recognises the effective governance and implementation of our IT asset management program that is aligned to internal frameworks and standards like ISO 19770. This in turn helps us serve our clients better,” commented Mr. Samir Yajnik, President Global Delivery & COO APAC, Tata Technologies.
english
There are two kinds of smart bulbs in this world—those that work well, and those doomed to languish in drawers with all of your other bitter regrets. If you haven’t done your research, or just failed hard a lot, you have probably come to the same conclusion many of us have: Just buy the friggin’ Philips Hue bulbs. Yes, they’re pricey, but the rest of the market is largely a wasteland; the affordable alternatives are so absolutely terrible that the fact you paid any money for them at all feels a little like punishment. Enter Nanoleaf Essentials A19 bulbs. Built on the back of Thread, the latest wireless standard to enter the smart home fray—see our explainer here—these bulbs promise to be super fast, being the first to capitalize on the Thread capabilities of Apple’s HomePod Mini. They’re also relatively cheap at $20, effectively hitting a sweet spot in pricing that, if they work well, should probably make Hue-maker Philips sweat—but only a little. The benefits of these bulbs remain contingent on the presence of a HomePod Mini, which we’ve yet to see real sales figures on. Otherwise, it’s just a (very nice) Bluetooth bulb: slow as the dickens, and buggy as the...well, as the buggy dickens. Aesthetically, there can be no doubt of these bulbs’ Nanoleafiness. Their Archimedean solid shape—which I am not going to type the name of—is very much in keeping with the company’s insistence that light need not come from a fully-rounded enclosure. It’s like bringing a low-poly indie game object to life! Setup was characteristically easy and done fully through the iOS Home app. The bulb felt like it maybe took a bit longer than most devices to pair with my home, and it was a little herky-jerky out of the gate, but after it finished up whatever initialization it needed to go through, I found it very responsive. So responsive, in fact, that if you’d broken into my home and put it in one of my normally Hue fixtures, I wouldn’t have noticed for days. Thread or no, there was no major speed boost over Hue via Siri on my HomePod Minis, with both bulbs responding within a perfectly-fine 1.5-ish seconds on average. For grins, I set the Nanoleaf up as a Bluetooth-only light, and I can safely say: Just don’t. When it did work, it took more than twice as long, sometimes much, much longer at around 20 or 30 seconds. As for color reproduction, the bulbs are fantastic, as you’d expect them to be, coming from Nanoleaf. Accurate though they are, however, they were extremely dim when using colors, so it’ll take more of them to live out your Miami Vice fantasy. Conversely, when using normal, brighter white light, the dimmest setting feels like it could’ve been dimmer still. That said, at 1100 max lumens, the Essentials bulb does white very well. Thanks to a recent firmware update, I was able to test Apple’s Adaptive Lighting feature. Throughout the day, it goes from cool to warm lighting, being at its coziest in the wee hours. Not to be outdone, the Nanoleaf app’s Circadian Lighting takes it a step further, letting you set the shades you want for the start and end of your day. Also in their app, you can set color-changing scenes, and it’s promised they’ll soon also take on features from the flat panel lights like Screen Mirror. Like any good HomeKit device, however, you needn’t use their app to use the bulb—the Home app will suffice, if your needs are simple enough. The feature set already baked into the Essentials A19 is bonkers for the price, but only if you have a HomePod Mini. Provided you’ve got one, the bulbs work just as fast as Hue’s, and in the time I spent with it, more reliably, as promised. Thread’s claims of a more stable network so far seem true. That said, is the Essentials bulb a revelation? No, it’s still a light bulb, albeit a very cool one. But it’s $30 less than the biggest player in the space, and as far as I’m concerned, is exactly as good at doing its main job: Being a light. - The first Thread-compatible smart light definitely makes the case for Thread as a serious, non-hub competitor to the typical smart home equipment. - Has excellent color and response time. - The Nanoleaf scenes are fun to play with, if not as impressive as they are on their panel light brethren. - Its blocky, geometric shape is unique and more fun than other options.
english
On September 8, 2022, at the age of 96, the Queen passed away at her home in Balmoral. Following a 70-year historic time on the throne, Her Royal Highness Queen Elizabeth II’s quintessential style has never failed to make a fashion statement. Over the course of her reign, the Queen was known for her closeness towards her beloved dogs and had always spoken against cruelty towards animals. PETA remembers Queen Elizabeth II for evolving with the times and, although there had been no stigma attached to wearing fur when she rose to the throne, she chose kindness over cruelty in recent years by banishing fur from her wardrobe. Ingrid Newkirk, founder, PETA, recollects her meeting Her Majesty in 1961 in India. “Her Royal Highness Queen Elizabeth of England took the throne at a time when wearing fur was not only acceptable, but desirable. In 1961, during her and Prince Phillip’s visit to New Delhi, I met her and heard that, as much as she loved her experience in India, she missed her beloved dogs when she travelled abroad,” expresses Ingrid. While the Queen chose kindness over cruelty, Ingrid hopes and wishes the Ministry of Defence honours her legacy by replacing the bear fur used to make the royal guards’ caps with faux fur. “The Queen lived a life in service to British values, and we are respectfully requesting that the Ministry of Defence honour her legacy by replacing the bears’ fur used to make the royal guards’ caps with faux fur fit for the 21st century monarch of an animal-loving nation. In this period of transition, a changing of the King’s Guard’s caps would spare these magnificent animals’ lives and represent the continued evolution of our modern monarchy,” shares Ingrid.
english
A marksman living in exile is coaxed back into action after learning of a plot to kill the president. Ultimately double-crossed and framed for the attempt, he goes on the run to track the real killer and find out who exactly set him up, and why? ? Disclaimer: All content and media belong to original content streaming platforms/owners like Netflix, Disney Hotstar, Amazon Prime, SonyLIV etc. 91mobiles entertainment does not claim any rights to the content and only aggregate the content along with the service providers links. A marksman living in exile is coaxed back into action after learning of a plot to kill the president. Ultimately double-crossed and framed for the attempt, he goes on the run to track the real killer and find out who exactly set him up, and why? ? According to the movie's script doctor William Goldman, Clint Eastwood, Robert Redford, and Harrison Ford passed on the movie. These men would have fit the literary Bob Lee Swagger's age a bit more closely than Mark Wahlberg (born in 1971). Author Stephen Hunter introduced Swagger as a Vietnam veteran in a 1993 novel, taking place in 1992; however, to accommodate Wahlberg's age, this film has Swagger active in Africa in the 1990s, instead of Vietnam in the 1970s. (at around 57 mins) The website to which Nick Memphis (Michael Peña) is given a link in the chat room, precisionremotes. com, is real. It is the website of Precision Remotes, a Richmond, California, company, which designs and manufactures remote-operated weapon and surveillance platforms, such as the one featured in the film. The large caliber rifle that Swagger owns, with which he is framed, is a Cheyenne Tactical M200 Intervention. It fires a . 408 caliber projectile accurately out to and beyond two thousand meters. The CheyTac M200 is also available with a Long Range Rifle System, which consists of a laser range finder, magnifying scope with night vision capability, and a weather-sensing module, all of which interface with a PDA running ballistics calculation software. Mark Wahlberg had to lose twenty pounds, to give Bob Lee Swagger the slim and ripped look of a field sniper, to make the film more realistic. Stephen Hunter named Bob Lee Swagger after his longtime friend and colleague, Baltimore Sun photojournalist Weyman Dexter Swagger (1943 - 2010). The two worked together at the Sun for over a decade, and it was Swagger who introduced Hunter to shooting and gun culture. "Bob Lee Swagger: I don't think you understand. These boys killed my dog. " "Mr. Rate: Would've been a bad job to take, though. Nick Memphis: How come? Mr. Rate: Whoever took that shot's probably dead now. That's how conspiracy works. Them boys on the grassy knoll, they were dead within three hours. Buried in the damn desert. Unmarked graves out past Terlingua. Nick Memphis: And you know this for a fact? Mr. Rate: Still got the shovel! "
english
<reponame>IceExchange/ice-services-lib<filename>toshi/test/ethereum/parity.py<gh_stars>0 import asyncio import binascii import bitcoin import os import tornado.httpclient import tornado.escape import signal import subprocess import re from testing.common.database import ( Database, DatabaseFactory, get_path_of, get_unused_port ) from string import Template from .faucet import FAUCET_PRIVATE_KEY, FAUCET_ADDRESS from .ethminer import EthMiner # https://github.com/ethcore/parity/wiki/Chain-specification chaintemplate = Template("""{ "name": "Dev", "engine": { "Ethash": { "params": { "gasLimitBoundDivisor": "0x0400", "minimumDifficulty": "$difficulty", "difficultyBoundDivisor": "0x0800", "durationLimit": "0x0a", "blockReward": "0x4563918244F40000", "registrar": "", "homesteadTransition": "0x0" } } }, "params": { "accountStartNonce": "0x0100000", "maximumExtraDataSize": "0x20", "minGasLimit": "0x1388", "networkID" : "0x42" }, "genesis": { "seal": { "ethereum": { "nonce": "0x00006d6f7264656e", "mixHash": "0x00000000000000000000000000000000000000647572616c65787365646c6578" } }, "difficulty": "$difficulty", "author": "0x0000000000000000000000000000000000000000", "timestamp": "0x00", "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "extraData": "0x", "gasLimit": "0x2fefd8" }, "accounts": { "0000000000000000000000000000000000000001": { "balance": "1", "nonce": "1048576", "builtin": { "name": "ecrecover", "pricing": { "linear": { "base": 3000, "word": 0 } } } }, "0000000000000000000000000000000000000002": { "balance": "1", "nonce": "1048576", "builtin": { "name": "sha256", "pricing": { "linear": { "base": 60, "word": 12 } } } }, "0000000000000000000000000000000000000003": { "balance": "1", "nonce": "1048576", "builtin": { "name": "ripemd160", "pricing": { "linear": { "base": 600, "word": 120 } } } }, "0000000000000000000000000000000000000004": { "balance": "1", "nonce": "1048576", "builtin": { "name": "identity", "pricing": { "linear": { "base": 15, "word": 3 } } } }, "$faucet": { "balance": "1606938044258990275541962092341162602522202993782792835301376", "nonce": "1048576" } } }""") def write_chain_file(version, fn, faucet, difficulty): if faucet.startswith('0x'): faucet = faucet[2:] if isinstance(difficulty, int): difficulty = hex(difficulty) elif isinstance(difficulty, str): if not difficulty.startswith("0x"): difficulty = "0x{}".format(difficulty) with open(fn, 'w') as f: f.write(chaintemplate.substitute(faucet=faucet, difficulty=difficulty)) class ParityServer(Database): DEFAULT_SETTINGS = dict(auto_start=2, base_dir=None, parity_server=None, author="0x0102030405060708090001020304050607080900", faucet=FAUCET_ADDRESS, port=None, jsonrpc_port=None, bootnodes=None, node_key=None, no_dapps=False, dapps_port=None, difficulty=None, copy_data_from=None) subdirectories = ['data', 'tmp'] def initialize(self): self.parity_server = self.settings.get('parity_server') if self.parity_server is None: self.parity_server = get_path_of('parity') p = subprocess.Popen([self.parity_server, '-v'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) outs, errs = p.communicate(timeout=15) for line in errs.split(b'\n') + outs.split(b'\n'): m = re.match("^\s+version\sParity\/v([0-9.]+).*$", line.decode('utf-8')) if m: v = tuple(int(i) for i in m.group(1).split('.')) break else: raise Exception("Unable to figure out Parity version") self.version = v self.chainfile = os.path.join(self.base_dir, 'chain.json') self.faucet = self.settings.get('faucet') self.author = self.settings.get('author') self.difficulty = self.settings.get('difficulty') if self.difficulty is None: self.difficulty = 1024 def dsn(self, **kwargs): return {'node': 'enode://{}@127.0.0.1:{}'.format(self.public_key, self.settings['port']), 'url': "http://localhost:{}/".format(self.settings['jsonrpc_port']), 'network_id': "66"} def get_data_directory(self): return os.path.join(self.base_dir, 'data') def prestart(self): super(ParityServer, self).prestart() if self.settings['jsonrpc_port'] is None: self.settings['jsonrpc_port'] = get_unused_port() if self.version < (1, 7, 0) and self.settings['no_dapps'] is False and self.settings['dapps_port'] is None: self.settings['dapps_port'] = get_unused_port() if self.settings['node_key'] is None: self.settings['node_key'] = "{:0>64}".format(binascii.b2a_hex(os.urandom(32)).decode('ascii')) self.public_key = "{:0>128}".format(binascii.b2a_hex(bitcoin.privtopub(binascii.a2b_hex(self.settings['node_key']))[1:]).decode('ascii')) # write chain file write_chain_file(self.version, self.chainfile, self.faucet, self.difficulty) def get_server_commandline(self): if self.author.startswith("0x"): author = self.author[2:] else: author = self.author cmd = [self.parity_server, "--no-ui", "--port", str(self.settings['port']), "--datadir", self.get_data_directory(), "--no-color", "--chain", self.chainfile, "--author", author, "--tracing", 'on', "--node-key", self.settings['node_key']] # check version if self.version >= (1, 7, 0): cmd.extend(["--jsonrpc-port", str(self.settings['jsonrpc_port']), "--jsonrpc-hosts", "all", "--no-ws"]) else: cmd.extend(["--rpcport", str(self.settings['jsonrpc_port'])]) if self.settings['no_dapps']: cmd.extend(['--no-dapps']) elif self.version < (1, 7, 0): cmd.extend(['--dapps-port', str(self.settings['dapps_port'])]) if self.settings['bootnodes'] is not None: if isinstance(self.settings['bootnodes'], list): self.settings['bootnodes'] = ','.join(self.settings['bootnodes']) cmd.extend(['--bootnodes', self.settings['bootnodes']]) return cmd def is_server_available(self): try: tornado.httpclient.HTTPClient().fetch( self.dsn()['url'], method="POST", headers={'Content-Type': "application/json"}, body=tornado.escape.json_encode({ "jsonrpc": "2.0", "id": "1234", "method": "eth_getBalance", "params": ["0x{}".format(self.author), "latest"] }) ) return True except: return False def pause(self): """stops service, without calling the cleanup""" self.terminate(signal.SIGTERM) class ParityServerFactory(DatabaseFactory): target_class = ParityServer def requires_parity(func=None, difficulty=None, pass_args=False, pass_parity=False, pass_ethminer=False, debug_ethminer=False): """Used to ensure all database connections are returned to the pool before finishing the test""" def wrap(fn): async def wrapper(self, *args, **kwargs): parity = ParityServer(difficulty=difficulty) ethminer = EthMiner(jsonrpc_url=parity.dsn()['url'], debug=debug_ethminer) self._app.config['ethereum'] = parity.dsn() if pass_args: kwargs['parity'] = parity kwargs['ethminer'] = ethminer if pass_ethminer: if pass_ethminer is True: kwargs['ethminer'] = ethminer else: kwargs[pass_ethminer] = ethminer if pass_parity: if pass_parity is True: kwargs['parity'] = parity else: kwargs[pass_parity] = parity try: f = fn(self, *args, **kwargs) if asyncio.iscoroutine(f): await f finally: ethminer.stop() parity.stop() return wrapper if func is not None: return wrap(func) else: return wrap
python
<reponame>Ingeperez1091/scaffold-clean-architecture { "folders": [ "infrastructure/driven-adapters/redis/src/test/{{language}}/{{packagePath}}/redis/template" ], "files": {}, "java": { "driven-adapter/redis/redis-template/helper/template-adapter-operations.java.mustache": "infrastructure/driven-adapters/redis/src/main/{{language}}/{{packagePath}}/redis/template/helper/TemplateAdapterOperations.java", "driven-adapter/redis/redis-template/redis-template-adapter.java.mustache": "infrastructure/driven-adapters/redis/src/main/java/{{packagePath}}/redis/template/RedisTemplateAdapter.java", "driven-adapter/redis/redis-template/build.gradle.mustache": "infrastructure/driven-adapters/redis/build.gradle" }, "kotlin": { "driven-adapter/redis/redis-template/helper/template-adapter-operations.kt.mustache": "infrastructure/driven-adapters/redis/src/main/{{language}}/{{packagePath}}/redis/template/helper/TemplateAdapterOperations.kt", "driven-adapter/redis/redis-template/redis-template-adapter.kt.mustache": "infrastructure/driven-adapters/redis/src/main/{{language}}/{{packagePath}}/redis/template/RedisTemplateAdapter.kt", "driven-adapter/redis/redis-template/build.gradle.kts.mustache": "infrastructure/driven-adapters/redis/build.gradle.kts" } }
json
const { Message } = require('discord.js') const emojiList = require('./emoji.json') const CachedMap = require('./utils/CachedMap.js') const ok = require('./utils/ok.js') const select = require('./utils/select.js') const emojiRegex = new RegExp( `<a?:\\w+:\\d+>|${emojiList.join('|').replace(/[+*]/g, m => '\\' + m)}`, 'g' ) const pollChannels = new CachedMap('./data/poll-reactions.json') module.exports.onReady = pollChannels.read function isPollChannel (message) { return pollChannels.get(message.channel.id, false) } /** @param {Message} message */ module.exports.pollChannel = async message => { if (!message.channel.permissionsFor(message.member).has('MANAGE_CHANNELS')) { await message.lineReply( "you can't even manage channels, why should i listen to you" ) return } if (isPollChannel(message)) { await message.lineReply( select([ 'this is already a poll channel though', "didn't you already do `poll channel`", "that doesn't do anything if this channel already is a poll channel" ]) ) } else { pollChannels.set(message.channel.id, true).save() await message.react(select(ok)) } } module.exports.notPollChannel = async message => { if (!message.channel.permissionsFor(message.member).has('MANAGE_CHANNELS')) { await message.lineReply( "you can't even manage channels, why should i listen to you" ) return } if (isPollChannel(message)) { pollChannels.set(message.channel.id, false).save() await message.react(select(ok)) } else { await message.lineReply( select([ "this isn't a poll channel though", "that doesn't do anything if this channel already isn't a poll channel" ]) ) } } module.exports.onMessage = async message => { if (isPollChannel(message)) { const emoji = message.content.match(emojiRegex) || [] if (emoji.length === 0) { await Promise.all([message.react('👍'), message.react('👎')]).catch( () => {} ) } else { await Promise.all(emoji.map(em => message.react(em))).catch(() => {}) } } } module.exports.onEdit = async newMessage => { if (isPollChannel(newMessage)) { const emoji = newMessage.content.match(emojiRegex) || [] if (emoji.length > 0) { // TODO: Do not re-add already-reacted emoji for speedier reaction // additions await Promise.all(emoji.map(em => newMessage.react(em))).catch(() => {}) } } }
javascript
#main { display: block; padding: 7em 0; } .wrap { width: 100%; border-radius: 5px; box-shadow: 0px 10px 34px -15px rgb(0 0 0 / 24%); } /* background: linear-gradient(135deg, #f75959 0%, #f35587 100%); */ .signup-line { padding-top: 20px; } .link { color: #f35588; }
css
Local residents claim the teenager died in clashes with the troops, but the police chief said he was hit by a stray bullet after sneaking into the site. A 15-year-old boy and two militants were killed in an encounter with security personnel in Jammu and Kashmir’s Pulwama district on Thursday, the Central Reserve Police Force said. The radicals – identified as Jahangir Ahmed Ganaie and Mohammad Shafi Shergujari – are believed to have been affiliated with the Lashkar-e-Taiba. State police chief SP Vaid said the teenager was hit by a stray bullet “after he managed to sneak up near the site’’ were security forces were engaged in a gunfight, Hindustan Times reported. “We have requested people many times to not come near encounter sites, but they don’t pay heed to our warnings,” he said. The exchange of fire began in Pulwama’s Padgampora region early Thursday morning. Troops from the CRPF’s 130 Battallion, 55 Rashtriya Rifles and the J&K Police’s Special Operations Group were deployed after receiving a tip-off that the militants were hiding in a house there, reported ANI. According to Kashmir Life, people gathered in the area in large numbers after news of the gunfight spread and began to pelt stones at the troops in an alleged attempt to help the militants escape. Disputing the police chief’s claim, locals said the 15-year-old – identified as Amir Nazir Wani – was killed after security forces opened fire on the protesters. Vaid had denied this allegation. Local residents told the Kashmir Reader that they first heard a few gunshots, which was followed by heavy firing. While the encounter was underway, authorities had suspended train services from Banihal to Srinagar as one of the railway stations is near the site. This is the second major encounter in the region in the past four days. On March 5, at least two militants were killed in Tral after a fierce gun battle that lasted several hours. Naik Manzoor Ahmad of the Special Operations Group was also killed in the strike. The Kashmir Valley was thrown out of gear for several months in 2016 after Hizbul Mujahideen commander Burhan Wani’s killing in July. Schools and other establishments remained closed for weeks on end, large-scale protests were carried, and security forces were accused of using excessive force to quell the resistance.
english
In a unique initiative, a private school in Surat, Gujarat, has converted a school bus into a fully functional portable classroom. This innovative project aims to provide education to underprivileged children who often lack access to formal schooling. The moving school, named Pramukh Swami Smriti Vidya Mandir, was inaugurated by Minister of State for Education Prafulla Panseria. Mahesh Bhai Patel, the visionary behind the moving school, initiated this project to commemorate the birth centenary of Pramukh Swami. With an expenditure of Rs 8. 65 lakhs, Patel transformed the bus into a classroom-like environment suitable for young students. Inside the bus, a blackboard has been installed to replicate a traditional classroom setting. Additionally, a television has been set up to provide both entertainment and educational content for the children. experience. During the inauguration ceremony, Minister Prafulla Panseria interacted with the children seated in the bus and even conducted a brief teaching session. Praising the moving school, the minister highlighted its significance as the first of its kind in Gujarat. He expressed his desire to replicate such initiatives throughout the state, with the support of Chief Minister Bhupendra Patel and collaboration with various social organisations and private schools. The driving force behind starting the school in a bus, Mahesh Bhai Patel, shared his motivation for this innovative approach. Inspired by his experience of living among the homeless community during a month-long service initiative, he recognised the need for educational opportunities for children from impoverished and nomadic backgrounds. The mobile school bus aims to provide education to these children who cannot stay in one place for long periods.
english
Telugu cinema producers guild has recently taken a decision to reduce twenty percent of all actors and technicians remuneration due to covid crisis. This rule doesn’t apply for those who are in high demand, though! Senior actor Murali Sharma who featured in the Sankranthi blockbusters this year has multiple movies on hands at this moment. He is working round the clock with so many movies resuming shootings post lockdown. Producers are willing to pay more than Murali Sharma’s usual pay to get his dates at the earliest. Murali Sharma’s daily paycheck has gone up to a whopping Rs 2. 25 lakh, according to Tollywood insiders. It is neither covid crisis nor the producers guild, it is the demand that will decide what an actor can charge!
english
/** @author - <NAME> Problem - Idea - Concept - */ #include <bits/stdc++.h> #define m0(a) memset(a , 0 , sizeof(a)) using namespace std; /************************************** END OF INITIALS ****************************************/ /** * Linear time Manacher's algorithm to find longest palindromic substring. * There are 4 cases to handle * Case 1 : Right side palindrome is totally contained under current palindrome. In this case do not consider this as center. * Case 2 : Current palindrome is proper suffix of input. Terminate the loop in this case. No better palindrom will be found on right. * Case 3 : Right side palindrome is proper suffix and its corresponding left side palindrome is proper prefix of current palindrome. Make largest such point as * next center. * Case 4 : Right side palindrome is proper suffix but its left corresponding palindrome is be beyond current palindrome. Do not consider this * as center because it will not extend at all. * * To handle even size palindromes replace input string with one containing $ between every input character and in start and end. */ int longestPalindromicSubstringLinear(string input) { int index = 0; //preprocess the input to convert it into type abc -> $a$b$c$ to handle even length case. //Total size will be 2*n + 1 of this new array. string newInput = ""; for (int i = 0; i < 2*input.length() + 1; i++) { if (i % 2 != 0) { newInput += input[index++]; } else { newInput += '$'; } } // cout << newInput << endl ; int newInputLength = static_cast<int>(newInput.length()); //create temporary array for holding largest palindrome at every point. There are 2*n + 1 such points. int T[newInputLength]; m0(T); int start = 0; int end = 0; //here i is the center. for (int i = 0; i < newInputLength;) { //expand around i. See how far we can go. while (start > 0 && end < newInputLength - 1 && newInput[start - 1] == newInput[end + 1]) { start--; end++; } //set the longest value of palindrome around center i at T[i] T[i] = end - start + 1; //Case 2: this is case 2. Current palindrome is proper suffix of input. No need to proceed. Just break out of loop. if (end == newInputLength - 1) { break; } //Mark newCenter to be either end or end + 1 depending on if we dealing with even or old number input. // etar karon hocche, # ke center dhore palin ber korar kono mane nai. as, even place gulate always # thakbe int newCenter = end + (i % 2 == 0 ? 1 : 0); for (int j = i + 1; j <= end; j++) { // This part contains Case 3,4 /* * * Bangla explanation - * * j ki? - j hocche ashol palindrome er center er daan pasher part ta. * ei j = range(center -> end) * * Case 1: jodi choto palindrome boro palindrome er moddhe included hoye jay. * how is checked? - T[j] = min(T[i - (j - i)], 2 * (end - j) + 1); -> it ensures it * Q: (2 * (end - j) + 1) diye ki bujhaay? - j ke center dhore palindrom er daane baame (end-j) ta kore * element thaake. so, total element in that palindrom hobe 2 * (end-j) + 1. (1 hoche j ke shoho niye). * Q: T[i - (j - i)] diye ki bujhaay? - Eta bujhaay i er mirror elelment ke center dhore banano * palindrom er length koto hobe. ekhon chinta koro, (2 * (end - j) + 1) is the highest possible * length of the palindrome centered at j. naaile onnora ore cover kore felto. * So, - * 1. T[i - (j - i)] > (2 * (end - j) + 1) ---> maane holo, baam dike ashol palin * er edge over kore chole gese. so, eta ignore korbo ---> CASE : 4 * * * 2. T[i - (j - i)] < (2 * (end - j) + 1) ---> baam dike notun palin ashol palin er moddhe * included hoye gese. notun kore etake hishab korar proyojon nai----> CASE : 1 * * * 3. T[i - (j - i)] == (2 * (end - j) + 1) ---> maane holo, baam dike edge thekei shuru * hoise oi palindrom. maane PREFIX hoye gese eta. etake count kora lagbe ----> CASE : 3 * * * CASE 3: etaay arektu extra kaaj kora laage. karon, tumi to minimum ta niso but ekhono jano na * je ashole konta minimum chilo T[i - (j - i)], naki (2 * (end - j) + 1). so, ami sure korte * chaitesi je T[i - (j - i)] minimum hoilei kebol eta prefix hoye jaabe nicher check e * and so, change ta hobe. * * * if (j + T[i - (j - i)] / 2 == end) --> ei check ta kora lagtese case 3 te. keno? * eta diye confirm kortese je 'j' theke palin nile sheta suffix o hobe. aar prefix to aagei hoilo ekbar. * so, ultimately suffix , prefix duitai proof hoilo ---> CASE : 3 proved. * * */ //Case 1, 4: i - (j - i) is left mirror. Its possible left mirror might go beyond current center palindrome. // So take minimum of either left side palindrome or distance of j to end. T[j] = min(T[i - (j - i)], 2 * (end - j) + 1); // Case 3: Only proceed if we get case 3. This check is to make sure we do not pick j as new // center for case 1 or case 4 // As soon as we find a center lets break out of this inner while loop. if (j + T[i - (j - i)] / 2 == end) { newCenter = j; break; } } //make i as newCenter. Set right and left to atleast the value we already know should be matching based of left side palindrome. i = newCenter; end = i + T[i] / 2; start = i - T[i] / 2; } //find the max palindrome in T and return it. int max = INT_MIN; for (int i = 0; i < newInputLength; i++) { // cout << T[i] << " "; int val; val = T[i] / 2; if (max < val) { max = val; } } cout << endl; return max; } int main() { // string str = "abaxabaxabybaxabyb"; string str = "ab"; cout << longestPalindromicSubstringLinear(str) << endl; return 0; }
cpp
//Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume all four edges of the grid are all surrounded by water. // //Example 1: // //11110 //11010 //11000 //00000 //Answer: 1 // //Example 2: // //11000 //11000 //00100 //00011 //Answer: 3 // //Credits: //Special thanks to @mithmatt for adding this problem and creating all test cases. #include <iostream> #include <algorithm> #include <stack> #include <string> #include <vector> #include <string> #include <stdint.h> #include <assert.h> using namespace std; class Solution { public: int numIslands(vector<vector<char>> &grid) { int i = grid.size(); if(i<=0) return 0; int j = grid[0].size(); int count=0; for(int m=0;m<i;m++){ for(int n=0;n<j;n++){ if(grid[m][n]=='1'){ count++; DFS(grid,m,n); } } } return count; } void buildvector(vector<vector<char>> &grid,char (*a)[5],int m,int n){ vector<char> temp; for(int i=0;i<m;i++){ for(int j=0;j<n;j++){ temp.push_back(a[i][j]); } grid.push_back(temp); temp.clear(); } } private: void DFS(vector<vector<char>> &grid, int i, int j) { grid[i][j]='0'; int m = grid.size(); int n = grid[0].size(); if(i>0&&grid[i-1][j]=='1') DFS(grid,i-1,j); if(j>0&&grid[i][j-1]=='1') DFS(grid,i,j-1); if(i<m-1&&grid[i+1][j]=='1') DFS(grid,i+1,j); if(j<n-1&&grid[i][j+1]=='1') DFS(grid,i,j+1); } }; int main() { char a1[][5]={{'1','1','1','1','0'},{'1','1','0','1','0'},{'1','1','0','0','0'}, {'0','0','0','0','0'}}; char a2[][5]={{'1','1','0','0','0'},{'1','1','0','0','0'},{'0','0','1','0','0'}, {'0','0','0','1','1'}}; vector<vector<char>> grid; int result = 0; Solution solute; solute.buildvector(grid,a1,4,5); result = solute.numIslands(grid); assert(result==1); grid.clear(); solute.buildvector(grid,a2,4,5); result = solute.numIslands(grid); assert(result==3); return 0; }
cpp
<filename>@kelp/services/server/src/plugins/lightroom/syncRendition.ts import { Rendition, RenditionInput } from '@kelp/graphql/nodes' import * as db from '@kelp/worker/db' import { gql, makeExtendSchemaPlugin } from 'graphile-utils' import { PoolClient, QueryConfig } from 'pg' import { isNil } from 'ramda' import { OurGraphQLContext } from '../../middleware/installPostGraphile' import { generateSQLPreparedValues } from '../../utils/dbHelpers' interface LightroomSyncRenditionPayload { renditionId?: number rendition: RenditionInput } // woss-test kusama account export const defaultCreator = 'did:substrate:5HnKtosumdYfHSifYKBHhNmoXvhDANCU8j8v7tc4p4pY7MMP/sensio-network' export const SyncRendition = makeExtendSchemaPlugin((build) => { const { pgSql: sql } = build return { typeDefs: gql` type LightroomSyncRenditionResponse { rendition: Rendition @pgField } extend type Mutation { lightroomSyncRendition( renditionId: Int rendition: RenditionInput! ): LightroomSyncRenditionResponse } `, resolvers: { Mutation: { async lightroomSyncRendition( _mutation, args: LightroomSyncRenditionPayload, { pgClient, user, workerUtils }: OurGraphQLContext, resolveInfo, ) { console.log('syncing rendition') const { rendition: { mediaId }, renditionId, } = args if (isNil(mediaId)) { throw new Error('mediaId is missing in payload') } await pgClient.query('SAVEPOINT lightroom_sync_rendition') /** * internal sync method, returns the RenditionID */ async function sync(): Promise<number> { let modelId = isNil(renditionId) ? null : renditionId const maybeMasterRendition = await masterRenditionExistsBy(mediaId, pgClient) if (!maybeMasterRendition.exists) { // 100% create new rendition const model = await createNewRendition(args.rendition, pgClient) modelId = model.id } else { modelId = maybeMasterRendition.id as number await db.rendition.updateRendition(modelId, args.rendition, pgClient) } return modelId } let modelId: number | null = null try { // find Media in DB, this will throw error if doesn't exist await mediaExistsById(mediaId, pgClient) // do the sync modelId = await sync() const [row] = await resolveInfo.graphile.selectGraphQLResultFromTable( sql.fragment`app_public.rendition`, (tableAlias, sqlBuilder) => { sqlBuilder.where(sql.fragment`${tableAlias}.id = ${sql.value(modelId)}`) }, ) return { data: row, } } catch (error) { await pgClient.query('ROLLBACK TO SAVEPOINT lightroom_sync_rendition') throw error } finally { // Release our savepoint so it doesn't conflict with other mutations await pgClient.query('RELEASE SAVEPOINT lightroom_sync_rendition') // trigger the job when the savepoint is released if (!isNil(modelId) && !isNil(mediaId)) { await workerUtils.addJob('syncMediaMetadata', { mediaId, renditionId: modelId, user, }) } } }, }, }, } }) /** * Create new simple rendition and add it to the pending for the PoE generation * @param data * @param pgClient */ async function createNewRendition(data: RenditionInput, pgClient: PoolClient): Promise<Rendition> { const { columns, values, preparedValues } = generateSQLPreparedValues<RenditionInput>(data) const insertQuery: QueryConfig = { text: `INSERT INTO app_public.rendition (${columns}) VALUES(${preparedValues}) RETURNING *;`, values, } const { rows: [row], } = await pgClient.query<Rendition>(insertQuery) // create pending poe for the rendition await db.pending_tx.createPendingTx( { mediaId: data.mediaId, renditionId: row.id, }, 'proof', 'photo', defaultCreator, 'poe', pgClient, ) return row } /** * Does media exist? throws Error if doesn't * @param mediaId * @param pgClient */ async function mediaExistsById(mediaId: number, pgClient: PoolClient): Promise<void> { const query: QueryConfig = { text: `select m.id as media_id from app_public.media m where m.id=$1;`, values: [mediaId], } const { rows: [maybeRecord], } = await pgClient.query(query) if (isNil(maybeRecord)) { throw new Error("Media doesn't exist") } } /** * Does media already have master rendition * @param mediaId * @param pgClient */ async function masterRenditionExistsBy( mediaId: number, pgClient: PoolClient, ): Promise<{ exists: boolean; id: number | null }> { const query: QueryConfig = { text: `select r.id from app_public.media m join app_public.rendition r on r.media_id = m.id where r.is_master = true and r.media_id = $1;`, values: [mediaId], } const { rows: [maybeRecord], } = await pgClient.query(query) if (isNil(maybeRecord)) { return { exists: false, id: null } } else { return { exists: true, id: maybeRecord.id } } } export default SyncRendition
typescript
package com.github.quintans.ezSQL.mapper; public interface Row { Object get(int columnIndex); <T> T get(int columnIndex, Class<T> type); }
java
Renowned comedian-actor Jaspal Bhatti, known as the 'King of Comedy,' perished in a car crash on October 25, 2012, along with his son Jasraj Bhatti. His satirical shows like Flop Show and Full Tension endeared him to audiences. Sonika Chauhan, an Indian model, actress, and former Femina Miss India and Miss Diva 2013 contestant, tragically met her end in a car crash in Kolkata on April 29, 2017. Her companion that night, Vikram Chatterjee, faced arrest for drunk driving. On May 5, 2017, Kannada TV actress Rekha Sindhu tragically died in a car crash on the Chennai-Bengaluru Highway. She was en route to Bengaluru with three others, all of whom lost their lives instantly when their car collided with a truck, leaving their vehicle utterly mangled. Cyrus Mistry, former Tata Group chair, son of billionaire Pallonji Mistry, lived luxuriously with wife Rohiqa Chagla and sons Firoz and Zahan. A tragic accident on September 4, 2022, claimed his life as his Mercedes-Benz crashed, causing severe head trauma and multiple fractures. Rajesh Pilot, an ex-Indian Air Force officer, Indian politician, and Indian National Congress member, was married to Rama Pilot, and they had two children, Sachin Pilot and Sarika Pilot. Tragically, he died at 55 in a car crash near Jaipur on June 11, 2000. Deep Sidhu, an Indian film actor, barrister, and activist, featured in numerous Punjabi films like Ramta Jogi, Saade Aale, and Jora - The Second Chapter. Tragically, he passed away at just 37 on February 15, 2022, in a car accident while with his girlfriend, Reena Rai. Gagan Kang, renowned for portraying Lord Indra in "Mahakali," a popular TV show, tragically lost his life in an accident. On August 19, 2017, while returning from Gujarat, he met with a fatal accident, losing his life instantly. Anand Abhyankar, a revered Marathi actor, graced films such as Spandan, Balgandharva, and Vaastav, and featured in beloved TV series like Taarak Mehta Ka Ooltah Chashman and Mala Susu Havi. Tragically, he met his end in a car accident near Pune, Maharashtra on June 2, 2018. Ishwari Deshpande, a well-known figure in Marathi cinema, tragically left this world at just 25 on September 23, 2021. Her life was cut short in a fatal accident when her car collided with Goa's Baga Creek near Hadfade village, leaving her grieving family behind. Saheb Singh Verma, ex-Delhi Chief Minister and BJP Vice President, met a tragic end at 68 in a car collision. His Tata Safari SUV collided with a truck in Alwar, Rajasthan, and he passed away on June 30, 2007. Thanks For Reading!
english
Union housing and urban affairs minister Hardeep Singh Puri hit out at the Congress party on Friday for its opposition to the Central Vista project, accusing it of double-standards and spreading “lies” to divert people’s attention from “monumental governance failures” in states ruled by it. In a series of tweets, Puri also said the central government got its priorities right, rejecting allegations by the Congress and critics that the Rs 20,000-crore project should be halted in view of a raging second wave of the coronavirus disease (Covid-19). “Congress’s discourse on Central Vista is bizarre. Cost of Central Vista is about Rs 20,000 crore, over several years. GoI (the government of India) has allocated nearly twice that amount for vaccination! India’s healthcare budget for just this year was over ₹3 lakh crore. We know our priorities,” he said. Puri came down heavily on what he called the Congress’s “hypocrisy” and said “Congress leaders wrote about the need for a new parliament” during the United Progressive Alliance (UPA)’s rule at the Centre. “While Central Vista is not new, see Congress’ hypocrisy. Congress & its allies are splurging on a new project reconstructing an MLA hostel in Maharashtra & building a new Legislative Assembly building in Chhattisgarh. If this is fine, what is the problem with Central Vista? ” Puri said in another tweet. The Union minister also accused the Congress of practising “cheap politics” and adopting a diversion tactic. “They want to distract people from monumental governance failures in their states by spreading lies. So they indulge in cheap politics despite knowing this project creates direct & indirect employment for thousands of skilled, semi-skilled & unskilled workers in these times,” he posted. The Central Vista project envisages the construction of a new Parliament House, a new residential complex that will house the Prime Minister and the Vice President, and several new office buildings and a Central Secretariat to accommodate ministries’ offices. Puri’s offensive came hours after Congress leader Rahul Gandhi termed the project a “criminal wastage”. “Central Vista is criminal wastage. Put people’s lives at the centre — not your blind arrogance to get a new house,” Gandhi posted on Twitter. Puri pointed out that there were hundreds of projects being executed by various departments. “Governance hasn’t come to a standstill, unlike the Congress’s times of policy paralysis. Central Vista is just another ongoing project. It’s only the Congress that’s obsessed about it, nobody else,” he said, taking a dig at past governments led by the Congress at the Centre. “Moreover, only projects for New Parliament Building & rejuvenation of Central Vista Avenue have been awarded at an estimated cost of ₹862 crore & ₹477 crore respectively till now. As I said, there are many components in Central Vista project which are spread over several years,” Puri added. In a related development, the Supreme Court refused on Friday to entertain a plea against deferment of hearing on a public interest litigation (PIL) seeking direction to halt construction activities under the Central Vista project during the pandemic, but gave liberty to petitioners to approach the Delhi High Court for urgent listing of the matter. The court was hearing the appeal against a May 4 order of the high court, which had listed the PIL for hearing on May 17 while mention that it wanted to first go through what the Supreme Court deliberated in its January 5 judgment that gave a go-ahead to the ambitious project, news agency PTI reported. Read all the Latest News, Breaking News and Coronavirus News here. Follow us on Facebook, Twitter and Telegram.
english
Proteas legend AB de Villiers believes the Betway SA20 is the perfect time for South African cricket. The inaugural League, featuring six newly-constructed teams, will launch on Tuesday, 10 January, at Newlands, with the opening local derby between MI Cape Town and Paarl Royals setting up an explosive start to South African cricket’s new-kid-on-the-block. De Villiers, who has played in the Indian Premier League (IPL) since its inception in 2008, says the SA20 is just the boost the game requires in South Africa. “I think the Betway SA20 comes at a really good time for South African cricket. We have seen the amazing things these leagues have done to cricket in particular nations,” De Villiers said. “It was a huge occasion for a lot of the other players and me. The start of the IPL changed our lives. The people are passionate about cricket. Not only with the home team, but they support members in other teams as well,” De Villiers said.
english
#include <iostream> int main() { std::cout << "Enter the character class for your player." << std::endl; std::cout << "(B)arbarian, (M)age, (R)ogue, (D)ruid: "; // TODO - handle user input: (b/B), (m/M), (r/R), or (d/D) char character_class; std::cin >> character_class; // Barbarian Character unsigned short barbarian_strength = 20; unsigned short barbarian_agility = 12; unsigned short barbarian_intelligence = 5; unsigned short barbarian_wisdom = 7; // Mage Character unsigned short mage_strength = 5; unsigned short mage_agility = 10; unsigned short mage_intelligence = 20; unsigned short mage_wisdom = 11; // Rogue Character unsigned short rogue_strength = 9; unsigned short rogue_agility = 20; unsigned short rogue_intelligence = 14; unsigned short rogue_wisdom = 6; // Druid Character unsigned short druid_strength = 14; unsigned short druid_agility = 8; unsigned short druid_intelligence = 5; unsigned short druid_wisdom = 20; // TODO - from the user's selection, print their character's properties to the console. switch(character_class) { case 'b': case 'B': std::cout << "The player is a Barbarian" << std::endl << "\tStrength = " << barbarian_strength << std::endl << "\tAgility = " << barbarian_agility << std::endl << "\tIntelligence = " << barbarian_intelligence << std::endl << "\tWisdom = " << barbarian_wisdom << std::endl; break; case 'm': case 'M': std::cout << "The player is a Mage" << std::endl << "\tStrength = " << mage_strength << std::endl << "\tAgility = " << mage_agility << std::endl << "\tIntelligence = " << mage_intelligence << std::endl << "\tWisdom = " << mage_wisdom << std::endl; break; case 'r': case 'R': std::cout << "The player is a Rogue" << std::endl << "\tStrength = " << rogue_strength << std::endl << "\tAgility = " << rogue_agility << std::endl << "\tIntelligence = " << rogue_intelligence << std::endl << "\tWisdom = " << rogue_wisdom << std::endl; break; case 'd': case 'D': std::cout << "The player is a Druid" << std::endl << "\tStrength = " << druid_strength << std::endl << "\tAgility = " << druid_agility << std::endl << "\tIntelligence = " << druid_intelligence << std::endl << "\tWisdom = " << druid_wisdom << std::endl; break; default: std::cout << "You didn't enter a valid character class."; break; } return 0; }
cpp
import React from 'react'; import { SvgIcon, SvgIconProps } from '@kukui/ui'; const SvgComponent = props => ( <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" {...props}> <path d="M502 57.63C523.3 36.38 508.3 0 478.3 0H33.72C3.711 0-11.29 36.38 9.962 57.63l230 230V480H144c-8.836 0-16 7.164-16 16s7.164 16 16 16h224c8.838 0 16-7.164 16-16s-7.2-16-16-16h-95.1V287.6L502 57.63zM480 32l-94.99 96H126.1L32 32h448zM256 258.4 158.7 160h194.7L256 258.4z" /> </svg> ); const SvgMartiniGlass = (props: SvgIconProps) => ( <SvgIcon component={SvgComponent} {...props} /> ); export default SvgMartiniGlass;
typescript
<gh_stars>0 {"title": "Poland - Science and Technology", "downloads": 77, "tags": ["economics", "hxl", "indicators", "Poland"], "hxl": 1, "org": "World Bank Group", "id": "827f099e-c20f-4d5a-97c7-f1ca69095f87", "resources": [{"update_date": "2021-01-29T06:35:22.481160", "link": "https://data.humdata.org/dataset/827f099e-c20f-4d5a-97c7-f1ca69095f87/resource/19eede4a-001a-499c-a539-477c12647c31/download/science-and-technology_pol.csv"}, {"update_date": "2021-01-29T06:35:22.481160", "link": "https://data.humdata.org/dataset/827f099e-c20f-4d5a-97c7-f1ca69095f87/resource/b6c9d797-03d1-4382-b375-641887f60f4b/download/qc_science-and-technology_pol.csv"}]}
json
package com.lebinh.skeleton.utils; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Row.MissingCellPolicy; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; public class SpreadSheetUtil { public static boolean checkNumberOfSheet(Workbook workbook, int allowNumberOfSheets) { if (workbook != null) { return workbook.getNumberOfSheets() == allowNumberOfSheets; } return false; } public static boolean checkSheets(Workbook workbook, String... sheetsNames) { boolean result = false; if (workbook != null) { result = Arrays.asList(sheetsNames) .stream() .anyMatch(sheetName -> workbook.getSheet(sheetName) == null); } return result; } public static String getDataInCell(Workbook workbook, String sheetName, int row, int column) { if (workbook != null) { Sheet sheet = workbook.getSheet(sheetName); if (sheet != null) { return getDataInCell(sheet, row, column); } } return ""; } public static String getDataInCell(Sheet sheet, int rowNo, int columnNo) { if (sheet != null) { Row row = sheet.getRow(rowNo); if (row != null) { Cell cell = row.getCell(columnNo, MissingCellPolicy.CREATE_NULL_AS_BLANK); return cell.getStringCellValue(); } } return ""; } public static List<Map<String, String>> getDataInSheet( Workbook workbook, String sheetName, Map<Integer, String> dataInfo, int limit, int offset) { Sheet sheet = workbook.getSheet(sheetName); if (sheet != null) { return getDataInSheet(sheet, dataInfo, limit, offset); } return new ArrayList<>(); } public static List<Map<String, String>> getDataInSheet( Sheet sheet, Map<Integer, String> dataInfo, int limit, int offset) { List<Map<String, String>> result = new ArrayList<>(); // if from = 0 to = 0 -> get all int rowTotal = sheet.getPhysicalNumberOfRows(); if (offset < 0 || limit < 0 || rowTotal <= offset) { return result; } else { for (int i = offset; i <= limit; i++) { final int rowNo = i; Map<String, String> record = new HashMap<>(); dataInfo.forEach((k, v) -> record.put("label", getDataInCell(sheet, rowNo, k))); result.add(record); } } return result; } }
java
Britain will not pursue any trading relationship with the European Union that relies on the country aligning with the bloc's laws, Prime Minister Rishi Sunak said on Monday after a newspaper reported his government was pursuing closer ties. "On trade, let me be unequivocal about this: under my leadership, the United Kingdom will not pursue any relationship with Europe that relies on alignment with EU laws," Sunak told a gathering of business leaders in answer to a question about Britain's trade and migration relationship with Europe. Sunak said Britain's exit from the EU had helped bring more freedom on matters like migration and regulation and had secured "proper control" of the country's borders. "We need regulatory regimes that are fit for the future, that ensure that this country can be leaders in those industries that are going to create the jobs and the growth of the future. And having the regulatory freedom to do that is an important opportunity of Brexit," he told the Confederation of British Industry's annual conference. The remarks came after Britain said on Sunday it had no plans to pursue a Swiss-style trade relationship with the EU after the Sunday Times newspaper reported that the government was looking into such plans. Switzerland has access to the EU's single market, but in return has to accept certain conditions on budget contributions and migration. Britain left the EU in 2020. Eurosceptic lawmakers in Sunak's governing Conservative Party warned him on Sunday against pursuing closer ties with the bloc. "I believe in Brexit, and I know that Brexit can deliver and is already delivering enormous benefits and opportunities for the country, migration being an immediate one," Sunak said. (Except for the headline, this story has not been edited by NDTV staff and is published from a syndicated feed. )
english
A few days ago, just after the #9PM9Minutes activity of lighting the diyas, a picture was made viral on whatsapp. That is a glowing Indian map with full of lights carrying a tagline "picture taken from the NASA satellite". How can a satellite capture look like that? How can even the mountains, deserts, rivers and everything glow with lights? Even the highly educated research scholars and Science graduates have forwarded this silly stuff, without spending a single second observing the pic to judge if it is real or fabricated. Spreading of ignorance with fake pictures can be an act of illiterates, but not of the learned people. The similar kind of so called satellite picture gets circulated every year even during Diwali. Sometime ago people started sharing the pictures of "Charminar under construction"! ! Shockingly, those who shared were again educated fools. Don't they use common sense before believing and sharing them? Even a 6th class student knows that Charminar was built in 16th century and the camera was not invented then. Later, a section of educated fools started sharing the childhood pic of Abdul Kalam riding on a bicycle as a paperboy. The pic was in color and above all, the boy was riding on a modern sports bicycle. There were internet junction boxes fixed on to the electric pole behind. One can clearly observe the plastic chairs at a kiosk. Any below average mind can understand that the pic no way belongs to Abdul Kalam's childhood days in Rameshwaram. But still, that became viral. Now, the same educated numbskulls are believing and forwarding some videos and images amidst Covid 19 pandemic. A video shows a fruit vendor who is counting the fruits and frequently wetting his fingers with his saliva like many do while counting the currency notes. Though the act looks a bit disgusting, it was wrongly made viral in connection to Covid 19 pandemic saying that he is spreading the virus. Judgemental people started forwarding it. We can see the busily moving vehicles and shops with business activity in the video. Adding to that, nobody was seen wearing a mask. So, there are no signs of lockdown or present social distancing norm. So, it is an old video. Without spending a minute using common sense, the people are still forwarding it, as if it is a great discovery. In another video a prisoner was seen spitting on a cop. The dumbos those made it viral assumed that the guy was attempting to spread Covid 19 virus. But the video dates back to a few years. No one was wearing masks and everybody is sitting closer. When searched for the same online, it can be discovered that a prisoner was stopped to eat the food brought from his home, so he was infuriated and spat on the cop. What is fabricated and what is real? Little common sense and an elementary standard IQ is enough to make out the difference. Preconceived suspicion and fear on a particular community, inbuilt hatred on a particular political party and jealousy on a specific successful leader have been the reasons for fabricating and circulating such videos and pictures. Recently a mimicked voice of JD lakshminarayana started making rounds frightening people about the worst lockdown with no banks and essential goods for the next two months. JD condemned on March 27th itself that it is fake and appealed to everyone not to believe in such things. But still, the audio is making rounds. No body is making any attempt to google about it before sharing to their whatsapp groups. Insane! Let us use common sense. Think before sharing. Let us not spread panic, fear, hatred and unrest with our negligence and ignorance.
english
JULY 5- The music launch of Shah Rukh Khan’s Chennai Express was indeed a memorable one. Going with the theme of the film, mediapersons were given mund and lungi, the traditional attire of South Indians. “It was quite an experience wearing a lungi and it was helpful because we were shooting in a hot place,” Shah Rukh Khan told reporters. The music of the film is given by Vishal and Shekhar. Deepika Padukone, who worked with with Shah Rukh after her debut film Om Shanti Om, says he is still very protective about her.
english
Beijing reportedly conducted numerous naval and air exercises near the island in the last two weeks. TAIPEI: The increased frequency of China’s military activities around Taiwan recently has raised the risk of events “getting out of hand” and sparking an accidental clash, the island’s defence minister said today. Taiwan has said that the past two weeks have seen dozens of fighters, drones, bombers, and other aircraft, as well as warships and the Chinese carrier the Shandong, operating nearby. China, which views democratically governed Taiwan as its own territory, has in recent years carried out many such drills around the island, seeking to assert its sovereignty claims and pressure Taipei. Warships from China’s Southern and Eastern Theatre Commands have been operating together off Taiwan’s east coast, he added.Read more: Wang Yi says Beijing, Moscow must deepen cooperationChina’s top envoy met Russian leader Vladimir Putin in St Petersburg today. Apple’s Taiwan suppliers resume double-digit decline in AugustTotal revenue fell 12.3% year on year to US$29.6 billion, deepening July’s 9% electronics industry slump. Chinese activist lands at airport, asks Taiwan not to deport himThe island’s mainland affairs council has not confirmed Chen Siming’s current status.
english
Instead of the expensive fairs, uneasy journeys and lack of punctuality, most of the Pakistanis considered the train service as the cheapest mode of transportation. For many of them, nothing compares to traveling by train as it is the most enjoyable journey and in this delightful trip for the sake of their amusement, they overlook the difficulties. But they can’t neglect the record of train accidents which are very common in Pakistan. The old tracks, bridges, and bogies which were inherited via the colonial power were never re-built or renovated. Last night, when the Shalimar Express was moving from Karachi to Lahore, an oil tanker hit the train at Hiran Minar Phatak near Sheikhupura. The oil tanker was stopped at the track due to a fault in its axel. After the collision, the locomotive caught fire which quickly immersed at least three bogies and till the recent report ten were injured and 2 died on the spot. According to the reports, the wires of the main electric power house of Sheikhupura also caught fire which plunged the city into darkness. The rescue teams from Lahore and Gujranwala rushed to the spot within time and extinguished the fire. Rescue 1122 shifted the injured to the District Headquarters Hospital while emergency was declared in the hospitals of Lahore and Sheikhupura. Khwaja Saad Rafique, the Railway Minister, expressed his deep sorrow over the tragic train incident at Sheikhupura and claimed that strict action would be taken if any proof of the involvement of Pakistan Railways is found. This is not the first time. Earlier this year in January, two rickshaws which were carrying schoolchildren, hit a train a Railway Crossing near Jalalpur Road of Lodharan, killing all seven students and the rickshaw driver. In February, a bogey carrying 22 tons of coal went missing which was going to Sahiwal Power Plant. Pakistan Railways is in dire need of upgradations. Human lives are not as petty as they are being considered. Digital technology should be incorporated in the train management system to increase its efficiency. This is the only way for reducing incidents such as the one in Sheikhupura.
english
import ast import operator import pickle from copy import deepcopy from typing import List import cv2 import numpy as np import albumentations as A from torch.utils.data import Dataset from mlcomp.db.providers import ModelProvider from mlcomp.utils.config import parse_albu_short, Config from mlcomp.utils.torch import infer from mlcomp.worker.executors import Executor from mlcomp.contrib.transform.tta import TtaWrap _OP_MAP = { ast.Add: operator.add, ast.Sub: operator.sub, ast.Mult: operator.mul, ast.Invert: operator.neg, ast.Div: operator.truediv, ast.Pow: operator.pow } @Executor.register class Equation(Executor, ast.NodeVisitor): # noinspection PyTypeChecker def __init__( self, model_id: int = None, suffix: str = '', max_count=None, part_size: int = None, cache_names: List[str] = (), **kwargs ): self.__dict__.update(kwargs) self.model_id = model_id self.suffix = suffix self.max_count = max_count self.part_size = part_size self.part = None self.cache = dict() self.cache_names = cache_names self.model_name = kwargs.get('model_name') self.name = kwargs.get('name') if not self.model_name and self.model_id: self.model_name = ModelProvider(self.session).by_id( self.model_id).name if not self.name: self.name = self.model_name self.suffix = self._solve(suffix) def tta(self, x: Dataset, tfms=()): x = deepcopy(x) transforms = getattr(x, 'transforms') if not transforms: return x assert isinstance(transforms, A.Compose), \ 'only Albumentations transforms are supported' index = len(transforms.transforms) for i, t in enumerate(transforms.transforms): if isinstance(t, A.Normalize): index = i break tfms_albu = [] for i, t in enumerate(tfms): t = parse_albu_short(t, always_apply=True) tfms_albu.append(t) transforms.transforms.insert(index + i, t) return TtaWrap(x, tfms_albu) def adjust_part(self, part): pass def generate_parts(self, count): part_size = self.part_size or count res = [] for i in range(0, count, part_size): res.append((i, min(count, i + part_size))) return res def load(self, file: str = None): file = file or self.name + f'_{self.suffix}' file = f'data/pred/{file}' data = pickle.load(open(file, 'rb')) data = data[self.part[0]: self.part[1]] if isinstance(data, list): for row in data: if type(row).__module__ == np.__name__: continue if isinstance(row, list): for i, c in enumerate(row): row[i] = cv2.imdecode(c, cv2.IMREAD_GRAYSCALE) data = np.array(data) return data def torch( self, x: Dataset, file: str = None, batch_size: int = 1, activation=None, num_workers: int = 1 ): file = (file or self.name) + '.pth' file = f'models/{file}' return infer( x=x, file=file, batch_size=batch_size, activation=activation, num_workers=num_workers ) def visit_BinOp(self, node): left = self.visit(node.left) right = self.visit(node.right) return _OP_MAP[type(node.op)](left, right) def visit_Name(self, node): name = node.id attr = getattr(self, name, None) if attr: if isinstance(attr, str): res = self._solve(attr) if attr in self.cache_names: self.cache[attr] = res return res return attr return str(name) def visit_List(self, node): return self.get_value(node) def visit_Tuple(self, node): return self.get_value(node) def visit_Num(self, node): return node.n def visit_Str(self, node): return node.s def visit_Expr(self, node): return self.visit(node.value) def visit_pow(self, node): return node def visit_NameConstant(self, node): return node.value def get_value(self, node): t = type(node) if t == ast.NameConstant: return node.value if t == ast.Name: return self.visit_Name(node) if t == ast.Str: return node.s if t == ast.Name: return node.id if t == ast.Num: return node.n if t == ast.List: res = [] for e in node.elts: res.append(self.get_value(e)) return res if t == ast.Tuple: res = [] for e in node.elts: res.append(self.get_value(e)) return res raise Exception(f'Unknown type {t}') def visit_Call(self, node): name = node.func.id f = getattr(self, name) if not f: raise Exception(f'Equation class does not contain method = {name}') args = [self.get_value(a) for a in node.args] kwargs = {k.arg: self.get_value(k.value) for k in node.keywords} return f(*args, **kwargs) def _solve(self, equation): if equation is None: return None equation = str(equation) if equation in self.cache: return self.cache[equation] tree = ast.parse(equation) if len(tree.body) == 0: return None calc = self res = calc.visit(tree.body[0]) return res def solve(self, name, parts): equation = getattr(self, name) for part in parts: self.cache = {} self.part = part self.adjust_part(part) res = self._solve(equation) if name in self.cache_names: self.cache[name] = res yield res @classmethod def _from_config( cls, executor: dict, config: Config, additional_info: dict ): return cls(**executor) __all__ = ['Equation']
python
#ifndef _GDI_WINDOW_ #define _GDI_WINDOW_ namespace Guarneri { static LRESULT event_callback(HWND, UINT, WPARAM, LPARAM); static bool closed; class GDIWindow { public: void* framebuffer; int width; int height; float aspect; LPCSTR title; LPCSTR name; bool initialized; int buffer_size; HWND window_handle; HDC window_device_context; HBITMAP bitmap_handle; HBITMAP original_handle; int text_start = 16; public: void initialize(int w, int h, LPCSTR title_str, LRESULT(*event_callback)(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)); void set_title(LPCSTR _title); void draw_text(const int& w, const int& h, LPCSTR text); bool is_valid(); void flush(); void get_mouse_position(float& x, float& y, int& xi, int& yi); RECT get_rect(); void dispose(); void send_message(); }; void GDIWindow::initialize(int w, int h, LPCSTR title_str, LRESULT(*event_callback)(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)) { if (initialized) { return; } this->width = w; this->height = h; this->aspect = (float)w / (float)h; this->title = title_str; this->name = title_str; buffer_size = width * height * 4; window_handle = nullptr; window_device_context = nullptr; framebuffer = nullptr; bitmap_handle = nullptr; closed = false; WNDCLASS win_class; win_class.style = CS_BYTEALIGNCLIENT; win_class.lpfnWndProc = (WNDPROC)event_callback; win_class.cbClsExtra = 0; win_class.cbWndExtra = 0; win_class.hInstance = GetModuleHandle(nullptr); win_class.hIcon = nullptr; win_class.hCursor = LoadCursor(nullptr, IDC_ARROW); win_class.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); win_class.lpszMenuName = title; win_class.lpszClassName = name; BITMAPINFO bitmap_info; BITMAPINFOHEADER bitmap_header; bitmap_header.biSize = sizeof(BITMAPINFOHEADER); bitmap_header.biWidth = width; bitmap_header.biHeight = height; bitmap_header.biPlanes = 1; bitmap_header.biBitCount = 32; bitmap_header.biCompression = BI_RGB; bitmap_header.biSizeImage = buffer_size; bitmap_header.biXPelsPerMeter = 0; bitmap_header.biYPelsPerMeter = 0; bitmap_header.biClrUsed = 0; bitmap_header.biClrImportant = 0; bitmap_info.bmiHeader = bitmap_header; RegisterClass(&win_class); window_handle = CreateWindow(name, title, WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX, 0, 0, 0, 0, nullptr, nullptr, win_class.hInstance, nullptr); HDC hDC = GetDC(window_handle); window_device_context = CreateCompatibleDC(hDC); ReleaseDC(window_handle, hDC); LPVOID buffer; bitmap_handle = CreateDIBSection(window_device_context, &bitmap_info, DIB_RGB_COLORS, &buffer, 0, 0); if (bitmap_handle != nullptr) { original_handle = (HBITMAP)SelectObject(window_device_context, bitmap_handle); } framebuffer = (void*)buffer; memset(framebuffer, 0, buffer_size); RECT rect = { 0, 0, width, height }; AdjustWindowRect(&rect, GetWindowLong(window_handle, GWL_STYLE), 0); int real_width = rect.right - rect.left; int real_height = rect.bottom - rect.top; int window_x = (GetSystemMetrics(SM_CXSCREEN) - real_width) / 2; int window_y = (GetSystemMetrics(SM_CYSCREEN) - real_height) / 2; SetWindowPos(window_handle, nullptr, window_x, window_y, real_width, real_height, (SWP_NOCOPYBITS | SWP_NOZORDER | SWP_SHOWWINDOW)); SetForegroundWindow(window_handle); ShowWindow(window_handle, SW_NORMAL); // window initialized initialized = true; } void GDIWindow::set_title(LPCSTR _title) { SetWindowText(window_handle, _title); } void GDIWindow::draw_text(const int& w, const int& h, LPCSTR text) { RECT rect; rect.left = 1; rect.right = 1 + w; rect.bottom = text_start - h; rect.top = text_start; DrawText(window_device_context, text, -1, &rect, DT_SINGLELINE | DT_LEFT | DT_VCENTER); text_start += h - 4; } bool GDIWindow::is_valid() { return !closed; } void GDIWindow::flush() { text_start = 16; HDC hDC = GetDC(window_handle); BitBlt(hDC, 0, 0, width, height, window_device_context, 0, 0, SRCCOPY); ReleaseDC(window_handle, hDC); send_message(); } void GDIWindow::get_mouse_position(float& x, float& y, int& xi, int& yi) { POINT pt; if (GetCursorPos(&pt)) { ScreenToClient(window_handle, &pt); xi = (int)pt.x; yi = (int)pt.y; x = (float)pt.x / (float)this->width; y = (float)pt.y / (float)this->height; } } RECT GDIWindow::get_rect() { RECT rect; if (GetWindowRect(window_handle, &rect)) { return rect; } return rect; } void GDIWindow::dispose() { if (original_handle) { SelectObject(window_device_context, original_handle); original_handle = nullptr; } if (window_device_context) { DeleteDC(window_device_context); window_device_context = nullptr; } if (bitmap_handle) { DeleteObject(bitmap_handle); bitmap_handle = nullptr; } if (window_handle) { CloseWindow(window_handle); window_handle = nullptr; } closed = true; } void GDIWindow::send_message() { MSG msg; while (1) { if (!PeekMessage(&msg, nullptr, 0, 0, PM_NOREMOVE)) break; if (!GetMessage(&msg, nullptr, 0, 0)) break; DispatchMessage(&msg); } } } #endif
cpp
The trouble for the farmers in Gujarat is that the place where the millet is grown the most is the place where the storm came and it rained. So this millet has now come in the market and has turned black due to rain. there is no cure. It is used as animal feed. Therefore, farmers have to sell it at a price lower than the government support price. The people of Gujarat have to spend Rs 26,000 crore every year on heart disease and diabetes. The Gujarat government has to spend a lot for this. But millet is one such cereal that helps in controlling both these diseases. Which is opposite to the wheat crop. The Gujarat government can reduce its health expenditure by Rs 10,000 crore by giving incentives for millet. There was crop damage due to nature, but millet crop was not included in the survey. Therefore, farmers have not been given their dues. Secondly, millet was not purchased on support price. So far the government has not taken any action against the traders who buy at less than the support price. In Banaskantha district, 50 percent of Gujarat’s Bajara is grown. On June 3, 2021, apart from the storm in the border areas of Banaskantha, there were strong winds accompanied by heavy rains. Therefore, due to heavy rains in Danta, Ambaji, Vadgam, Palanpur, Dhanera, Deesa, Dantiwada, Amirgarh, Bapala, Vaktpura, Vachol, Alwara areas, there has been heavy damage to the millet crop. On one hand, where production has decreased, on the other hand traders are buying at low prices. Tau Te storm passed through Bhabhor deodar of Banaskantha on the morning of 19 May 2021 and moved towards Rajasthan. It rained in Patan and Banaskantha areas. Therefore, the Banaskantha collector ordered people not to come out of the house. In addition, farmers sown 2. 71 lakh hectares of summer millet, where the cyclone had caused rains. In which Banaskantha 1. 66 lakh hectares used to cultivate more than 50% of the total millet of Gujarat. There were 4 thousand hectares in Patan and 10 thousand hectares in Mehsana. A total of 1. 93 lakh hectares were sown in North Gujarat. Anand was planted in 28 thousand hectare, Kheda 20 thousand hectare, Junagadh 2800, Amreli 2100, Bhavnagar 3800, Somnath 5400 hectare. It rained in South Gujarat but farmers did not cultivate millet. On an average 3,000 kg of millet is harvested per hectare. The production in monsoon is barely half of the 1400 kg per hectare in summer. Therefore, farmers should sow summer millet. 81. 30 crore kg of Bajara was cooked. But the millet crop came in the middle of the storm. So the production came down to 61 percent. So hardly 49-50 crore kg was produced. Fall in prices and blackening of millet due to rain has caused damage. 20 kg hardly fetches Rs. 250. In fact, if the cost of 20 kg of millet is Rs 400 to Rs 500, then farmers can earn some profit after their hard work. 1500-1600 crores were to be received, but only 625 crores have been received. The government actually had to pay around Rs 500 crore. But the Rupani government of BJP has refused to give compensation to the farmers. The government has not given compensation for the natural calamity. Such complaints have been made by farmers. Heart disease is on the rise in Gujarat. 108 emergency services received calls of 18,647 heart attacks in 2010 and 28,201 in 2021. 31-50 years is the age of red alert. Rs 22,000 crore is spent on heart disease. Millet regulates cholesterol levels, blood sugar and blood pressure. This lowers the risk of heart disease. Magnesium, iron, calcium, potassium, starch, are good. An amino acid called tryptophan helps maintain appetite and digestion. People spend Rs 4,000 crore annually on diabetes. 36% of people over the age of 40 have diabetes. Bajara was sown on 7. 70 lakh hectares in 2006-07, compared to 4. 64 lakh hectares in 2016-17 and an average of 3. 50 lakh hectares. Thus, due to less consumption of millet, some diseases have increased. Bajara is a traditional food of Gujarat. Wheat is later. In the 1995-96 monsoon, 7 lakh tonnes of millet was produced in one million hectares. With summer it was 1. 3 million hectares, every man used to eat 20-25 kg of millet in a year. Now only 10 percent of it is being consumed.
english
/*! @file posix_thread_manager.cpp * @version 3.3 * @date Jun 15 2017 * * @brief * Thread safety and data protection for DJI Onboard SDK on linux platforms * * @copyright * 2017 DJI. All rights reserved. * */ #include "posix_thread_manager.hpp" using namespace DJI::OSDK; PosixThreadManager::~PosixThreadManager() { pthread_mutex_destroy(&m_memLock); pthread_mutex_destroy(&m_msgLock); pthread_mutex_destroy(&m_ackLock); pthread_mutex_destroy(&m_nbAckLock); pthread_mutex_destroy(&m_headerLock); pthread_cond_destroy(&m_nbAckRecv); pthread_cond_destroy(&m_ackRecvCv); pthread_mutex_destroy(&m_frameLock); pthread_mutex_destroy(&m_stopCondLock); } void PosixThreadManager::init() { m_memLock = PTHREAD_MUTEX_INITIALIZER; m_msgLock = PTHREAD_MUTEX_INITIALIZER; m_ackLock = PTHREAD_MUTEX_INITIALIZER; pthread_cond_init(&m_ackRecvCv, NULL); /*! These mutexes are used for the non blocking callback ACK mechanism */ m_nbAckLock = PTHREAD_MUTEX_INITIALIZER; m_headerLock = PTHREAD_MUTEX_INITIALIZER; pthread_cond_init(&m_nbAckRecv, NULL); /*! Mutex initializations * These are newly added mutexes */ m_frameLock = PTHREAD_MUTEX_INITIALIZER; m_stopCondLock = PTHREAD_MUTEX_INITIALIZER; } void PosixThreadManager::lockMemory() { pthread_mutex_lock(&m_memLock); } void PosixThreadManager::freeMemory() { pthread_mutex_unlock(&m_memLock); } void PosixThreadManager::lockMSG() { pthread_mutex_lock(&m_msgLock); } void PosixThreadManager::freeMSG() { pthread_mutex_unlock(&m_msgLock); } void PosixThreadManager::lockACK() { pthread_mutex_lock(&m_ackLock); } void PosixThreadManager::freeACK() { pthread_mutex_unlock(&m_ackLock); } void PosixThreadManager::lockProtocolHeader() { pthread_mutex_lock(&m_headerLock); } void PosixThreadManager::freeProtocolHeader() { pthread_mutex_unlock(&m_headerLock); } void PosixThreadManager::lockNonBlockCBAck() { pthread_mutex_lock(&m_nbAckLock); } void PosixThreadManager::freeNonBlockCBAck() { pthread_mutex_unlock(&m_nbAckLock); } void PosixThreadManager::lockStopCond() { pthread_mutex_lock(&m_stopCondLock); } void PosixThreadManager::freeStopCond() { pthread_mutex_unlock(&m_stopCondLock); } void PosixThreadManager::lockFrame() { pthread_mutex_lock(&m_frameLock); } void PosixThreadManager::freeFrame() { pthread_mutex_unlock(&m_frameLock); } void PosixThreadManager::notify() { pthread_cond_signal(&m_ackRecvCv); } void PosixThreadManager::notifyNonBlockCBAckRecv() { pthread_cond_signal(&m_nbAckRecv); } void PosixThreadManager::nonBlockWait() { pthread_cond_wait(&m_nbAckRecv, &m_nbAckLock); } void PosixThreadManager::wait(int timeoutInSeconds) { struct timespec curTime, absTimeout; // Use clock_gettime instead of getttimeofday for compatibility with POSIX // APIs clock_gettime(CLOCK_REALTIME, &curTime); // absTimeout = curTime; absTimeout.tv_sec = curTime.tv_sec + timeoutInSeconds; absTimeout.tv_nsec = curTime.tv_nsec; pthread_cond_timedwait(&m_ackRecvCv, &m_ackLock, &absTimeout); }
cpp
version https://git-lfs.github.com/spec/v1 oid sha256:390ba26fb788ca0e2e005363f36a11e2dbfd036656b20d48dbfb4b683cd8b4e4 size 20577
json