text
stringlengths
1
1.04M
language
stringclasses
25 values
<gh_stars>100-1000 { "word": "Upstart", "definitions": [ "A person who has risen suddenly in rank or importance, especially one who behaves arrogantly.", "A series of movements on the parallel or asymmetric bars, by which a gymnast swings to a position in which their body is supported by their arms above the bar, especially at the start of a routine." ], "parts-of-speech": "Noun" }
json
<gh_stars>1-10 { "id": 7367, "cites": 20, "cited_by": 23, "reference": [ "[1] <NAME> and <NAME>. Using Maimonides Rule to Estimate the Effect of Class Size on Scholastic Achievement. forthcoming Quarterly Journal of Economics, 1999.", "[2] <NAME> and <NAME>. The Effect of Income Taxes on Household Behavior. Office of Tax Analysis, U.S. Department of the Treasury, mimeo 1997, forthcoming Review of Economics and Statistics. 32 That is, taxpayers whose itemized deductions are just above the standard deduction so that deflating the itemized deductions makes itemizing unattractiveinyear 1.", "[4] <NAME> and <NAME>. Attrition in the Statistics of Income Panel of Individual Returns. National Tax Journal, 1989, 62(4), pp. 495-501.", "[5] <NAME> and <NAME>. Income Inequality and the Incomes of Very High-Income Taxpayers: Evidence from Tax Returns. in Tax Policy and the Economy, vol. 7, ed. J. Poterba. Cambridge: MIT Press, 1993.", "[7] <NAME>. How Much has De-Unionization Contributed to the Rise in Male Earnings Inequality. in Uneven Tides: Rising Inequality in America, ed. P. Gottschalk and S. Danziger. New-York: Russell Sage Foundation, 1993.", "[8] <NAME>. What Happens When You Tax the Rich'DONE' Evidence from Executive Compensation., NBER Working Paper, No. 6333, 1997.", "[9] <NAME>. Labor Supply. in How Taxes Affect Economic Behavior, ed. <NAME> and <NAME>. Washington, D.C.: Brookings Institution, 1981.", "[10] Hausman, Jerry, Taxes and Labor Supply. in A.J. Auerbach and <NAME> (eds.), Handbook of Public Economics, Amsterdam: North-Holland, 1985.", "[11] <NAME>. What has been learned about Labor Supply in the Past Twenty Years'DONE', American Economic Review, 1993, 83(2), pp. 116-121.", "[14] MaCurdy, Thomas, <NAME> and <NAME>. Assessing Empirical Approaches for Analyzing Taxes and Labor Supply. The Journal of Human Resources, Fall 1990, pp. 415-490.", "[15] <NAME>. The Sensitivity of an Empirical Model of Married Womens Hours of Work to Economic and Statistical Assumptions. Econometrica, 55, 1987 pp. 765799.", "[16] <NAME> and <NAME>. The Structure of Wages. Quarterly Journal of Economics, 1992, 107(1), pp. 285-326.", "[18] <NAME>. Labor Supply of Men. in O. Ashenfelter and R. Layard (eds.), Handbook of Labor Economics, 1986, Amsterdam: North-Holland, pp. 3-102.", "[19] <NAME>, The Effect of Marginal Tax Rates on Income: A Panel Study of `Bracket Creep., Unpublished MIT mimeograph, 1997.", "[20] <NAME>. Using Elasticities to Derive Optimal Income Tax Rates. Unpublished MIT mimeograph, 1998.", "[21] <NAME>. Taxation and Inequality: A Time-exposure Perspective. Tax Policy and the Economy, 1992, pp. 105-127.", "[24] <NAME>. The Tax Decade: How Taxes Came to Dominate the Public Agenda. The Urban Institute Press, Washington, D.C., 1991.", "[25] <NAME>. Regional Labor Markets and the Determinants of Wages Inequality. American Economic Review, 1994, 84, pp. 17-22.", "[26] <NAME>. The Effect of Income Taxation on Labor Supply in the United-States. Journal of Human Resources, 1990, 25, (Summer), pp. 491-516.", "[27] <NAME>. A Regression-DiscontinuityEvaluation of the Effect of Financial Aid Offers on College Enrollment. unpublished mimeograph, New York University," ] }
json
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { HeroAvatarComponent } from './hero-avatar.component'; describe('HeroAvatarComponent', () => { let component: HeroAvatarComponent; let fixture: ComponentFixture<HeroAvatarComponent>; beforeEach(async(() => { TestBed.configureTestingModule({ declarations: [HeroAvatarComponent], }) .compileComponents(); })); beforeEach(() => { fixture = TestBed.createComponent(HeroAvatarComponent); component = fixture.componentInstance; fixture.detectChanges(); }); it('should create', () => { expect(component).toBeTruthy(); }); });
typescript
--- isPage: true templateKey: work title: golden gate park subtitle: 'oil on canvas, 50x60, 2013' description: >- part of the first collection, this canvas represents two people walking through the forest of golden gate park. the moment has been extremely dramatized by energetic brush strokes that follow rhythmic patterns of curved and straight lines. saturated shades of blue and green fill the canvas while strokes of white red and purple enhance the colourful impact of the composition for the viewer. link: >- https://www.amazon.it/Meletto-Golden-Gate-Park/dp/B07YLZG4KT/ref=sr_1_13?__mk_it_IT=%C3%85M%C3%85%C5%BD%C3%95%C3%91&keywords=meletto+dipinto&qid=1570133868&s=kitchen&sr=1-13 pictures: - image: /assets/golden_gate_park-painting-meletto.jpg - image: /assets/golden_gate_park-painting-meletto-macro-3.jpg - image: /assets/golden_gate_park-painting-meletto-mockup-2.jpg - image: /assets/golden_gate_park-painting-meletto-macro-1.jpg - image: /assets/golden_gate_park-painting-meletto-macro-4.jpg - image: /assets/golden_gate_park-painting-meletto-macro-2.jpg - image: /assets/golden_gate_park-painting-meletto-mockup-1bw.jpg - image: /assets/golden_gate_park-painting-meletto-macro-5.jpg ---
markdown
Aaron Rodgers and the Packers couldn’t qualify for the playoffs, marking the end of a sad season. Skip Bayless was eagerly watching and ripped into Rodgers’ performance. The Packers were slated for a bad year after they lost superstar receiver Davante Adams without a contingency plan in place. Rodgers didn’t find a groove with his younger more inexperienced receivers, and the team struggled out of the gates. They started the year 3-6, and they were looking like they would struggle going forward too. However, the team put on a magical run and put themselves in a position to make the playoffs. The Packers faced the Lions, and they had a simple formula to make the playoffs. If they won, they were in. However, they couldn’t put it together in the end with the entire team having a forgetful performance, Rodgers included. Also Read: Who has the number 1 pick in the NFL draft 2023? Of course, given the conditions, media analyst Skip Bayless was thrilled to see the Packers out of the playoffs, and more importantly, he was happy to see Aaron Rodgers struggle. The Packers quarterback went 17/27 for 205 yards with 1 touchdown and 1 interception. Those aren’t great numbers for a quarterback, but of course, the entire loss can’t be pinned on Rodgers. Aaron Jones had a fumble, and there were several other mistakes that led to the loss. For Skip, it didn’t matter though. Of course, the retirement talks came into play following the post-game incident. Rodgers was asked to give up his jersey, but he refused, claiming that he couldn’t give that one away. Why would he say for a game where he played poorly, lost, and missed the playoffs? There was nothing notable. However, if he was retiring, then that would mark the last jersey he would ever wear. It is also too early for all these discussions. We had the same conversation last year, and in the end, Rodgers ended up staying despite all the drama. Perhaps we’re calling this too soon.
english
<reponame>juharris/PySyft from itertools import zip_longest import syft from syft.generic.frameworks.hook import hook_args from syft.generic.abstract.tensor import AbstractTensor from syft.workers.abstract import AbstractWorker from syft_proto.execution.v1.placeholder_pb2 import Placeholder as PlaceholderPB class PlaceHolder(AbstractTensor): def __init__( self, role=None, tracing=False, id=None, tags: set = None, description: str = None, shape=None, expected_dtype=None, ): """A PlaceHolder acts as a tensor but does nothing special. It can get "instantiated" when a real tensor is appended as a child attribute. It will send forward all the commands it receives to its child tensor. When you send a PlaceHolder, you don't sent the instantiated tensors. Args: id: An optional string or integer id of the PlaceHolder. """ super().__init__(id=id, tags=tags, description=description) if not isinstance(self.id, syft.execution.placeholder_id.PlaceholderId): self.id = syft.execution.placeholder_id.PlaceholderId(self.id) self.expected_shape = tuple(shape) if shape is not None else None self.expected_dtype = expected_dtype self.child = None self.role = role self.tracing = tracing def get_class_attributes(self): """ Specify all the attributes need to build a wrapper correctly when returning a response. """ return {"role": self.role, "tracing": self.tracing} @classmethod def handle_func_command(cls, command): """ Receive an instruction for a function to be applied on a Placeholder, Replace in the args with their child attribute, forward the command instruction to the handle_function_command of the type of the child attributes, get the response and wrap it in a Placeholder. We use this method to perform the tracing. Args: command: instruction of a function command: (command name, <no self>, arguments[, kwargs]) Returns: the response of the function command """ cmd, _, args, kwargs = command # Replace all PlaceHolders with their child attribute new_args, new_kwargs, new_type = hook_args.unwrap_args_from_function(cmd, args, kwargs) # build the new command new_command = (cmd, None, new_args, new_kwargs) # Send it to the appropriate class and get the response response = new_type.handle_func_command(new_command) # Find first placeholder in args template_placeholder = None for arg in args: if isinstance(arg, PlaceHolder): template_placeholder = arg placeholders = PlaceHolder.convert_to_placeholders(response, template_placeholder) if template_placeholder.tracing: template_placeholder.role.register_action( (command, placeholders), syft.execution.computation.ComputationAction ) return placeholders @staticmethod def convert_to_placeholders(response, template_placeholder): """ Turn back response to PlaceHolders """ if isinstance(response, (tuple, list)): placeholders = tuple( PlaceHolder.create_from( r, role=template_placeholder.role, tracing=template_placeholder.tracing ) for r in response ) else: placeholders = PlaceHolder.create_from( response, role=template_placeholder.role, tracing=template_placeholder.tracing ) return placeholders def __getattribute__(self, name): """Try to find the attribute in the current object and in case we can not then we forward it to the child """ try: response = object.__getattribute__(self, name) except AttributeError: child = object.__getattribute__(self, "child") response = getattr(child, name) return response def instantiate(self, tensor): """ Add a tensor as a child attribute. All operations on the placeholder will be also executed on this child tensor. We remove Placeholders if is there are any. """ if isinstance(tensor, PlaceHolder): self.child = tensor.child else: self.child = tensor if hasattr(self.child, "shape"): self.expected_shape = tuple(self.child.shape) if hasattr(self.child, "dtype"): self.expected_dtype = self.child.dtype return self def __str__(self) -> str: """ Compact representation of a Placeholder, including tags and optional child """ tags = " ".join(list(self.tags or [])) out = f"{type(self).__name__ }[Id:{self.id.value}]" if hasattr(self, "child") and self.child is not None: out += f">{self.child}" return out __repr__ = __str__ def send(self, *args, **kwargs): """ calls move on child & register_action to role """ response = self.child.send(*args, **kwargs) placeholder = PlaceHolder.convert_to_placeholders(response, self) command = ("send", self, args, kwargs) self.role.register_action( (command, placeholder), syft.execution.communication.CommunicationAction ) return placeholder def move(self, *args, **kwargs): """ calls move on a pointer tensor & register_action to role """ response = self.child.move(*args, **kwargs) placeholder = PlaceHolder.convert_to_placeholders(response, self) command = ("move", self, args, kwargs) self.role.register_action( (command, placeholder), syft.execution.communication.CommunicationAction ) return placeholder def share(self, *args, **kwargs): """ Send a command to remote worker to additively share a tensor via pointer tensor """ response = self.child.share(*args, **kwargs) placeholder = PlaceHolder.convert_to_placeholders(response, self) command = ("share", self, args, kwargs) self.role.register_action( (command, placeholder), syft.execution.communication.CommunicationAction ) return placeholder def fix_prec(self, *args, **kwargs): """ sends command to remote worker to transform a tensor to fix_precision via pointer tensor """ response = self.child.fix_prec(*args, **kwargs) placeholder = PlaceHolder.convert_to_placeholders(response, self) command = ("fix_prec", self, args, kwargs) self.role.register_action( (command, placeholder), syft.execution.computation.ComputationAction ) return placeholder def mid_get(self, *args, **kwargs): response = self.child.mid_get(*args, **kwargs) placeholder = PlaceHolder.convert_to_placeholders(self.child, self) command = ("mid_get", self, args, kwargs) self.role.register_action( (command, placeholder), syft.execution.communication.CommunicationAction ) return placeholder def remote_get(self, *args, **kwargs): """ calls remote_get on child & register_action to role """ response = self.child.remote_get(*args, **kwargs) placeholder = PlaceHolder.convert_to_placeholders(response, self) command = ("remote_get", self, args, kwargs) self.role.register_action( (command, placeholder), syft.execution.communication.CommunicationAction ) return placeholder def remote_send(self, *args, **kwargs): """ calls remote_send on child & register_action to role """ response = self.child.remote_send(*args, **kwargs) placeholder = PlaceHolder.convert_to_placeholders(response, self) command = ("remote_send", self, args, kwargs) self.role.register_action( (command, placeholder), syft.execution.communication.CommunicationAction ) return placeholder def share_(self, *args, **kwargs): """ calls share_ on child & register_action to role """ response = self.child.share_(*args, **kwargs) placeholder = PlaceHolder.convert_to_placeholders(response, self) command = ("share_", self, args, kwargs) self.role.register_action( (command, placeholder), syft.execution.communication.CommunicationAction ) return placeholder def get(self, *args, **kwargs): """Requests the tensor/chain being pointed to, be serialized and return via child""" response = self.child.get(*args, **kwargs) placeholder = PlaceHolder.convert_to_placeholders(response, self) command = ("get", self, args, kwargs) self.role.register_action( (command, placeholder), syft.execution.communication.CommunicationAction ) return placeholder def copy(self): """ Copying a placeholder doesn't duplicate the child attribute, because all copy operations happen locally where we want to keep reference to the same instantiated object. As the child doesn't get sent, this is not an issue. """ placeholder = PlaceHolder( role=self.role, tracing=self.tracing, tags=self.tags, shape=self.expected_shape, expected_dtype=self.expected_dtype, ) placeholder.child = self.child if self.tracing: command = ("copy", self, (), {}), placeholder self.role.register_action(command, syft.execution.computation.ComputationAction) return placeholder @staticmethod def create_from(tensor, role=None, tracing=False): """ Helper method to create a placeholder already instantiated with tensor. """ return PlaceHolder(role=role, tracing=tracing).instantiate(tensor) @staticmethod def insert(tensor, after, role=None, tracing=False): """ Helper method to add a placeholder in the specific place of tensor chain. """ current_level = tensor while not isinstance(current_level, after) and current_level is not None: current_level = getattr(current_level, "child", None) if current_level is None: raise RuntimeError( f"Cannot insert Placeholder, chain does not contain {after.__name__} tensor type." ) child = getattr(current_level, "child", None) if child is None: raise RuntimeError( f"Cannot insert Placeholder, {after.__name__} does not wrap anything." ) placeholder = PlaceHolder.create_from(child, role, tracing) current_level.child = placeholder return placeholder @staticmethod def extract(tensor): """ Helper method to find and return placeholder in the tensor chain. """ current_level = tensor while not isinstance(current_level, PlaceHolder) and current_level is not None: current_level = getattr(current_level, "child", None) return current_level @staticmethod def create_placeholders(args_shape, args_dtypes=()): """ Helper method to create a list of placeholders with shapes in args_shape. """ # In order to support -1 value in shape to indicate any dimension # we map -1 to 1 for shape dimensions. # TODO: A more complex strategy could be used mapped_shapes = [] for shape in args_shape: if list(filter(lambda x: x < -1, shape)): raise ValueError(f"Invalid shape {shape}") mapped_shapes.append(tuple(map(lambda y: 1 if y == -1 else y, shape))) return [ syft.framework.hook.create_zeros(shape, dtype=dtype, requires_grad=False) for shape, dtype in zip_longest(mapped_shapes, args_dtypes) ] @staticmethod def instantiate_placeholders(obj, response): """ Utility function to instantiate recursively an object containing placeholders with a similar object but containing tensors """ if obj is not None: if isinstance(obj, PlaceHolder): obj.instantiate(response) elif isinstance(obj, (list, tuple)): for ph, rep in zip(obj, response): PlaceHolder.instantiate_placeholders(ph, rep) else: raise ValueError( f"Response of type {type(response)} is not supported in " "Placeholder.instantiate." ) @staticmethod def simplify(worker: AbstractWorker, placeholder: "PlaceHolder") -> tuple: """Takes the attributes of a PlaceHolder and saves them in a tuple. Args: worker: the worker doing the serialization placeholder: a PlaceHolder. Returns: tuple: a tuple holding the unique attributes of the PlaceHolder. """ return ( syft.serde.msgpack.serde._simplify(worker, placeholder.id), syft.serde.msgpack.serde._simplify(worker, placeholder.tags), syft.serde.msgpack.serde._simplify(worker, placeholder.description), syft.serde.msgpack.serde._simplify(worker, placeholder.expected_shape), ) @staticmethod def detail(worker: AbstractWorker, tensor_tuple: tuple) -> "PlaceHolder": """ This function reconstructs a PlaceHolder given it's attributes in form of a tuple. Args: worker: the worker doing the deserialization tensor_tuple: a tuple holding the attributes of the PlaceHolder Returns: PlaceHolder: a PlaceHolder """ tensor_id, tags, description, shape = tensor_tuple tensor_id = syft.serde.msgpack.serde._detail(worker, tensor_id) tags = syft.serde.msgpack.serde._detail(worker, tags) description = syft.serde.msgpack.serde._detail(worker, description) shape = syft.serde.msgpack.serde._detail(worker, shape) return PlaceHolder(id=tensor_id, tags=tags, description=description, shape=shape) @staticmethod def bufferize(worker: AbstractWorker, placeholder: "PlaceHolder") -> PlaceholderPB: """Takes the attributes of a PlaceHolder and saves them in a Protobuf message. Args: worker: the worker doing the serialization placeholder: a PlaceHolder. Returns: PlaceholderPB: a Protobuf message holding the unique attributes of the PlaceHolder. """ protobuf_placeholder = PlaceholderPB() syft.serde.protobuf.proto.set_protobuf_id(protobuf_placeholder.id, placeholder.id.value) protobuf_placeholder.tags.extend(placeholder.tags) if placeholder.description: protobuf_placeholder.description = placeholder.description if placeholder.expected_shape: protobuf_placeholder.expected_shape.dims.extend(placeholder.expected_shape) return protobuf_placeholder @staticmethod def unbufferize(worker: AbstractWorker, protobuf_placeholder: PlaceholderPB) -> "PlaceHolder": """ This function reconstructs a PlaceHolder given it's attributes in form of a Protobuf message. Args: worker: the worker doing the deserialization protobuf_placeholder: a Protobuf message holding the attributes of the PlaceHolder Returns: PlaceHolder: a PlaceHolder """ tensor_id = syft.serde.protobuf.proto.get_protobuf_id(protobuf_placeholder.id) tags = set(protobuf_placeholder.tags) description = None if bool(protobuf_placeholder.description): description = protobuf_placeholder.description expected_shape = tuple(protobuf_placeholder.expected_shape.dims) or None return PlaceHolder(id=tensor_id, tags=tags, description=description, shape=expected_shape) @staticmethod def get_protobuf_schema() -> PlaceholderPB: return PlaceholderPB ### Register the tensor with hook_args.py ### hook_args.default_register_tensor(PlaceHolder)
python
<reponame>andrewpap22/Project_Iwannidhs_Fall-2020<filename>dataset/camera_specs/2013_camera_specs/www.alibaba.com/34249.json<gh_stars>0 { "<page title>": "Hot Sale 1.0mp 24hrs Cycled Recording Wifi Video Mini Ip Camera - Buy Mini Ip Camera,Wifi Video Camera,Wifi Video Mini Ip Camera Product on Alibaba.com", "audio": "Input Built-in microphone", "camera": "Image Sensor 1/4\u201d color CMOS", "certificates": "CE; FCC; RoHS", "cpu": "Micro Processor ARM9 32-bit core", "fob price": "US $30 - 35 / Unit\nGet Latest Price", "function": "Specification Description", "ir led": "8 PCS", "lens": "3.6mm", "max frame rate": "12fps", "mini illumination": "0Lux/F1.2 (IR ON)", "minorder quantity": "50 Unit/Units", "night vision distance": "10m", "payment terms": "L/C,T/T,Western Union", "pixel": "1.0MP", "port": "SZ", "power": "DC Input: 220/110V, Output: 5V, 1A", "recording time": "12 hrs with 4GB card", "resolution": "WAN: VGA 640\u00d7480; Local Storage: 1280*720", "storage": "Local TF Card 2GB \u2013 32GB", "supply ability": "5000 Unit/Units per Week", "video": "Compression H.264", "warranty": "Limited 24-month warranty" }
json
Indian customs authorities cleared the firm of embezzling around Rs 1,500 crore to offshore accounts by submitting inflated bills. A federal court in Brisbane on Friday rejected two pleas against mining giant Adani Group’s $16.5-billion coal mine project in Australia. The Australian Conservation Foundation had challenged an earlier ruling that upheld the approval to the project, while the second plea was filed by landowner Adrian Burragubba asking the court to review the Native Title Tribunal’s decision to allow the mine to proceed. On August 22, the Directorate of Revenue Intelligence had also dismissed allegations of embezzlement against the company. Adani said Friday’s rulings in Australia have reinforced its legal right to develop the project. “These appeals simply tried to delay a project that will create 10,000 direct and indirect jobs,” said Adani Australia Chief Executive Officer and Head of Country Jeyakumar Janakaraj, according to PTI. The project has faced opposition from several environmental activists who had raised concerns about its impact on the local ecosystem, including the Great Barrier Reef. Many were also concerned about the lack of funding for the project. Earlier, some major banks like Germany’s Deutsch Bank and Commonwealth Bank of Australia had refused to participate in the controversial coal project. The customs authority has cleared the Adani Group of embezzling around Rs 1,500 crore to offshore accounts by submitting inflated bills related to an electricity project, reported The Guardian reported on Friday. The Directorate of Revenue Intelligence had alleged that the conglomerate had ordered equipment worth several hundred millions for an electricity project in Maharashtra using a shell company in Dubai, and that the company had sold the same equipment back to the Adani Group at highly inflated prices. The DRI had also said that a major portion of the money the Adani Group siphoned off to offshore accounts included loans from the State Bank of India and ICICI Bank. But the agency did not accuse either lender of any illegal activity.
english
<filename>now/persistence/models/variable_usage.py # Copyright (c) 2016 Universidade Federal Fluminense (UFF) # Copyright (c) 2016 Polytechnic Institute of New York University. # Copyright (c) 2018, 2019, 2020 President and Fellows of Harvard College. # This file is part of ProvBuild. """Slicing Usage Model""" from __future__ import (absolute_import, print_function, division, unicode_literals) from sqlalchemy import Column, Integer, Text from sqlalchemy import PrimaryKeyConstraint, ForeignKeyConstraint from sqlalchemy import CheckConstraint from ...utils.prolog import PrologDescription, PrologTrial, PrologAttribute from ...utils.prolog import PrologRepr from .. import relational, content, persistence_config from .base import AlchemyProxy, proxy_class, backref_one @proxy_class class VariableUsage(AlchemyProxy): """Represent a variable usage during program slicing""" __tablename__ = "variable_usage" __table_args__ = ( PrimaryKeyConstraint("trial_id", "id"), ForeignKeyConstraint(["trial_id"], ["trial.id"], ondelete="CASCADE"), ForeignKeyConstraint(["trial_id", "activation_id"], ["function_activation.trial_id", "function_activation.id"], ondelete="CASCADE"), ForeignKeyConstraint(["trial_id", "activation_id", "variable_id"], ["variable.trial_id", "variable.activation_id", "variable.id"], ondelete="CASCADE"), ) trial_id = Column(Integer, index=True) activation_id = Column(Integer, index=True) variable_id = Column(Integer, index=True) id = Column(Integer, index=True) # pylint: disable=invalid-name line = Column(Integer) context = Column(Text, CheckConstraint("context IN ('Load', 'Del')")) trial = backref_one("trial") # Trial.variable_usages activation = backref_one("activation") # Activation.variables_usages variable = backref_one("variable") # Variable.usages prolog_description = PrologDescription("usage", ( PrologTrial("trial_id", link="variable.trial_id"), PrologAttribute("activation_id", link="variable.activation_id"), PrologAttribute("variable_id", link="variable.id"), PrologAttribute("id"), PrologRepr("name", attr_name="variable.name"), PrologAttribute("line"), ), description=( "informs that in a given trial (*trial_id*),\n" "during a specific function activation (*activation_id*),\n" "in a specific *line* of code,\n" "a variable *name* was accessed (read, delete)." )) def __init__(self, *args, **kwargs): if args and isinstance(args[0], relational.base): obj = args[0] trial_ref = obj.id elif args: trial_ref = kwargs.get("trial_ref", args[0]) else: trial_ref = kwargs.get("trial_ref", None) session = relational.session obj = VariableUsage.load_variableusage(trial_ref, session=session) if obj is not None: super(VariableUsage, self).__init__(obj) def __repr__(self): name = self.variable.name return ( "VariableUsage({self.trial_id}, {self.activation_id}, " "{self.variable_id}, {self.id}, {name}, {self.line}, " "{self.context})" ).format(**locals()) def __str__(self): name = self.variable.name return "(L{self.line}, {name}, <{self.context}>)".format(**locals()) @classmethod # query def load_variableusage(cls, trial_ref, session=None): """Load variableusage by variableusage reference Find reference on trials id and tags name """ session = session or relational.session result = session.query(cls.m).filter(cls.m.trial_id == trial_ref) return result.first() def pull_content(cls, tid, session=None): session = session or relational.session ttrial = cls.__table__ result = session.query(ttrial).filter(ttrial.c.trial_id == tid).all() return result def push_content(cls, id, reslist, session=None): session = session or relational.session ttrial = cls.__table__ for res in reslist: result = session.execute( ttrial.insert(), {"trial_id": id, "activation_id": res.activation_id, "variable_id": res.variable_id,"id": res.id, "line": res.line, "context": res.context} ) session.commit()
python
{ "vorgangId": "94303", "VORGANG": { "WAHLPERIODE": "15", "VORGANGSTYP": "Kleine Anfrage", "TITEL": "Aktueller Stand des Projektes der verdeckten Feldbeobachtung (G-SIG: 15011411)", "INITIATIVE": "Fraktion der FDP", "AKTUELLER_STAND": "Beantwortet", "SIGNATUR": "", "GESTA_ORDNUNGSNUMMER": "", "WICHTIGE_DRUCKSACHE": [ { "DRS_HERAUSGEBER": "BT", "DRS_NUMMER": "15/4687", "DRS_TYP": "Kleine Anfrage", "DRS_LINK": "http://dipbt.bundestag.de:80/dip21/btd/15/046/1504687.pdf" }, { "DRS_HERAUSGEBER": "BT", "DRS_NUMMER": "15/4802", "DRS_TYP": "Antwort", "DRS_LINK": "http://dipbt.bundestag.de:80/dip21/btd/15/048/1504802.pdf" } ], "EU_DOK_NR": "", "SACHGEBIET": [ "Umwelt", "Landwirtschaft und Ernährung" ], "SCHLAGWORT": [ "Landwirtschaft", "Schädlingsbekämpfungsmittel", { "_fundstelle": "true", "__cdata": "Umweltbundesamt" }, "Umweltschutz" ], "ABSTRAKT": "Kosten des Projekts, Stopp oder modifizierte Weiterführung, Auswirkungen, Zusammenarbeit von Bund und Ländern, Haltung der zuständigen Bundesminister und des UBA-Präsidenten, Angemessenheit \"verdeckter Ermittler\", beteiligte Personen und Organisationen im \"wissenschaftlichen Begleitkreis\" " }, "VORGANGSABLAUF": { "VORGANGSPOSITION": [ { "ZUORDNUNG": "BT", "URHEBER": "Kleine Anfrage, Urheber : Fraktion der FDP ", "FUNDSTELLE": "19.01.2005 - BT-Drucksache 15/4687", "FUNDSTELLE_LINK": "http://dipbt.bundestag.de:80/dip21/btd/15/046/1504687.pdf", "PERSOENLICHER_URHEBER": [ { "PERSON_TITEL": "Dr.", "VORNAME": "Christel", "NACHNAME": "Happach-Kasan", "FUNKTION": "MdB", "FRAKTION": "FDP", "AKTIVITAETSART": "Kleine Anfrage" }, { "VORNAME": "Hans-Michael", "NACHNAME": "Goldmann", "FUNKTION": "MdB", "FRAKTION": "FDP", "AKTIVITAETSART": "Kleine Anfrage" } ] }, { "ZUORDNUNG": "BT", "URHEBER": "Antwort, Urheber : Bundesregierung, Bundesministerium für Umwelt, Naturschutz und Reaktorsicherheit (federführend)", "FUNDSTELLE": "03.02.2005 - BT-Drucksache 15/4802", "FUNDSTELLE_LINK": "http://dipbt.bundestag.de:80/dip21/btd/15/048/1504802.pdf" } ] } }
json
<reponame>zabi94/Covens-reborn { "name": "Beehives", "icon": "covens:beehive", "category": "exploration", "pages": [ { "type": "spotlight", "item": "covens:beehive", "text": "$(o)Ah, the bee, always humming around, happily unaware of a world much more complex than just making honey in their hive... $(br2)$()If it pays attention, a witch will find such hives hanging from trees." }, { "type": "spotlight", "item": "covens:empty_honeycomb", "text": "Those not wise enough to follow the Art say that simply punching it will be enough to obtain honeycombs.$(br2)Of course, you, a dignified witch, would never do such thing, relying instead on your trusty $(l:tools/boline)boline$() to do the harvesting. $(br2)You might get stung as those" }, { "type": "text", "text":"brutes, but at least you will have a garanteed honey comb drop...$(br2)$(p)$(o)Bee puns really sting..." }, { "type": "image", "images": ["covens:textures/gui/books/images/beehive.png"], "border": true, "text": "A beehive in the wild." } ] }
json
<filename>package.json { "author": { "name": "ci010", "email": "<EMAIL>" }, "bundleDependencies": false, "dependencies": { "@azure/storage-blob": "^10.3.0", "@actions/core": "^1.0.0" }, "deprecated": false, "description": "Github action to upload blob to azure storage", "devDependencies": { "@zeit/ncc": "^0.20.4", "@types/node": "^12.6.8", "typescript": "^3.5.3" }, "license": "MIT", "main": "dist/index.js", "name": "upload-blob-to-azure", "scripts": { "build": "ncc build src/index.ts" }, "version": "0.0.1" }
json
Our editors will review what you’ve submitted and determine whether to revise the article. - Byname: - Original name: - Born: - Died: - February 8, 1587, Fotheringhay Castle, Northamptonshire, England (aged 44) - House / Dynasty: - Notable Family Members: Mary (born December 8, 1542, Linlithgow Palace, West Lothian, Scotland—died February 8, 1587, Fotheringhay Castle, Northamptonshire, England) queen of Scotland (1542–67) and queen consort of France (1559–60). Her unwise marital and political actions provoked rebellion among the Scottish nobles, forcing her to flee to England, where she was eventually beheaded as a Roman Catholic threat to the English throne. Mary Stuart was the only child of King James V of Scotland and his French wife, Mary of Guise. The death of her father six days after her birth left Mary as queen of Scotland in her own right. Although Mary’s great-uncle King Henry VIII of England made an unsuccessful effort to secure control of her (Mary inherited Tudor blood through her grandmother, a sister of Henry VIII), the regency of the kingdom was settled in favour of her mother. Her mother saw to it that Mary was sent to France at age five. There she was brought up at the court of King Henry II and his queen Catherine de Médicis with their own large family, assisted by relations on her mother’s side, the powerful Guises. Despite a charmed childhood of much luxury, including frequent hunting and dancing (at both of which she excelled), Mary’s education was not neglected, and she was taught Latin, Italian, Spanish, and some Greek. French now became her first language, and indeed in every other way Mary grew into a Frenchwoman rather than a Scot. By her remarkable beauty, with her tall, slender figure (she was about 5 feet 11 inches), her red-gold hair and amber-coloured eyes, and her taste for music and poetry, Mary summed up the contemporary ideal of the Renaissance princess at the time of her marriage to Francis, eldest son of Henry and Catherine, in April 1558. Although it was a political match aimed at the union of France and Scotland, Mary was sincerely fond of her boy husband, though the marriage was probably never consummated. The accession of Elizabeth Tudor to the throne of England in November 1558 meant that Mary was, by virtue of her Tudor blood, next in line to the English throne. Those Roman Catholics who considered Elizabeth illegitimate because they regarded Henry VIII’s divorce from Catherine of Aragon and his marriage to Anne Boleyn invalid even looked upon Mary as the lawful queen. Mary’s father-in-law, Henry II of France, thus claimed the English throne on her behalf. The death of Henry in 1559 brought Francis to the French throne and made Mary a glittering queen consort of France, until Francis’s premature death in December 1560 made her a widow at the age of 18. Returning to Scotland in August 1561, Mary discovered that her sheltered French upbringing had made her ill-equipped to cope with the series of problems now facing her. Mary’s former pretensions to the English throne had incurred Elizabeth’s hostility. She refused to acknowledge Mary as her heiress, however much Mary, nothing if not royal by temperament, prized her English rights. While Mary herself was a Roman Catholic, the official religion of Scotland had been reformed to Protestantism in her absence, and she thus represented to many, including the leading Calvinist preacher John Knox, a foreign queen of an alien religion. Most difficult of all were the Scottish nobles; factious and turbulent after a series of royal minorities, they cared more for private feuds and self-aggrandizement than support of the crown. Nevertheless, for the first years of her rule, Mary managed well, with the aid of her natural half-brother James, earl of Moray, and helped in particular by her policy of religious tolerance. Nor were all the Scots averse to the spectacle of a pretty young queen creating a graceful court life and enjoying her progresses round the country. It was Mary’s second marriage in July 1565 to her cousin Henry Stewart (Stuart), earl of Darnley, son of Matthew Stewart, 4th earl of Lennox, that started the fatal train of events culminating in her destruction. Mary married the handsome Darnley recklessly for love. It was a disastrous choice because by her marriage she antagonized all the elements interested in the power structure of Scotland, including Elizabeth, who disapproved of Mary marrying another Tudor descendant, and her half brother James, who, jealous of the Lennox family’s rise to power, promptly rebelled. Nor did Darnley’s character measure up to the promise of his appearance—he was weak, vicious, and yet ambitious. The callous butchery of her secretary and confidant, David Riccio (Rizzio), in front of her own eyes, in March 1566, by Darnley and a group of nobles, convinced Mary that her husband had aimed at her own life. The birth of their son James in June did nothing to reconcile the couple, and Mary, armed now with the heir she had craved, looked for some means to relieve an intolerable situation. The next eight months constitute the most tangled and controversial period of Mary’s career. According to Mary’s detractors, it was during this period that she developed an adulterous liaison with James Hepburn, 4th earl of Bothwell, and planned with him the death of Darnley and their own following marriage. There is, however, no contemporary evidence of this love affair, before Darnley’s death, except the highly dubious so-called Casket Letters, poems and letters supposedly written by Mary to Bothwell but now generally considered to be inadmissible evidence by historians. But Mary did undoubtedly consider the question of a divorce from Darnley, after a serious illness in October 1566, which left her health wrecked and her spirits low. On the night of February 9, 1567, the house at Kirk o’ Field on the outskirts of Edinburgh where Darnley lay recovering from illness was blown up, and Darnley himself was strangled while trying to escape. Many theories have been put forward to explain conflicting accounts of the crime, including the possibility that Darnley, plotting to blow up Mary, was caught in his own trap. Nevertheless, the most obvious explanation—that those responsible were the nobles who hated Darnley—is the most likely one. Whatever Mary’s foreknowledge of the crime, her conduct thereafter was fatally unwise and showed how much she lacked wise counselors in Scotland. After three months, she allowed herself to be married off to Bothwell, the chief suspect, after he abducted and ravished her. If passion is rejected as the motive, Mary’s behaviour can be ascribed to her increasing despair, exacerbated by ill health, at her inability to manage the affairs of tempestuous Scotland without a strong arm to support her. But in fact Bothwell as a consort proved no more acceptable to the jealous Scottish nobility than Darnley had been. Mary and Bothwell were parted forever at Carberry Hill on June 15, 1567, Bothwell to exile and imprisonment where he died in 1578 and Mary to incarceration on the tiny island of Loch Leven, where she was formally deposed in favour of her one-year-old son James. After a brief fling of liberty the following year, defeat of her supporters at a battle at Langside put her once more to flight. Impulsively, Mary sought refuge in England with her cousin Elizabeth. But Elizabeth, with all the political cunning Mary lacked, employed a series of excuses connected with the murder of Darnley to hold Mary in English captivity in a series of prisons for the next 18 years of her life. In the meantime, Mary’s brother Moray flourished as regent of Scotland. Mary’s captivity was long and wearisome, only partly allayed by the consolations of religion and, on a more mundane level, her skill at embroidery and her love of such little pets as lap dogs and singing birds. Her health suffered from the lack of physical exercise, her figure thickened, and her beauty diminished, as can be seen in the best-known pictures of her in black velvet and white veil, dating from 1578. Naturally, she concentrated her energies on procuring release from an imprisonment she considered unjustified, at first by pleas and later by conspiracy. Unfortunately for her survival, Mary as a Catholic was the natural focus for the hopes of those English Catholics who wished to replace the Protestant queen Elizabeth on the throne. It was the discovery in 1586 of a plot to assassinate Elizabeth and bring about a Roman Catholic uprising that convinced Queen Elizabeth that, while she lived, Mary would always constitute too dangerous a threat to her own position. Despite the fact that she was the sovereign queen of another country, Mary was tried by an English court and condemned; her son, James, who had not seen his mother since infancy and now had his sights fixed on succeeding to the English throne, raised no objections. Mary was executed in 1587 in the great hall at Fotheringhay Castle, near Peterborough; she was 44 years old. It was a chilling scene, redeemed by the great personal dignity with which Mary met her fate. Her body ultimately came to rest in Westminster Abbey in a magnificent monument James I raised to his mother after he finally ascended the throne of England.
english
(Symbolic image) KATHMANDU: CellPay service of CellCome P. Ltd. , an NRB-licensed payment service provider, has put up stalls to promote its services in the capital from Friday. It has begun its promotional program at Civil Mall with the aim of advertising its app and informing the customers about its advantages and disadvantages. It started at 10 am and will continue until 5 pm. Similarly, the service will continue at LabiM Mall between 10 am to 5 pm tomorrow. CellPay is a fast, safe and secure e-payment service providing app that can be used through both mobile and web applications. The customers of those banks associated with the CellCome P. Ltd can avail this service. This app can be downloaded through Google Play Store and Apple App Store.
english
<reponame>traitify/traitify-java<gh_stars>1-10 package com.traitify.models; import com.traitify.net.ApiModel; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @JsonIgnoreProperties(ignoreUnknown = true) public class AssessmentPersonalityTrait extends ApiModel { private PersonalityTrait personality_trait; private Float score; public PersonalityTrait getPersonality_trait() { return personality_trait; } public void setPersonality_trait(PersonalityTrait personality_trait) { this.personality_trait = personality_trait; } public Float getScore() { return score; } public void setScore(Float score) { this.score = score; } }
java
IBM and Microsoft have signed the Vatican's "Rome Call for AI Ethics," a pledge to develop artificial intelligence in a way that protects all people and the planet, Financial Times reports. Microsoft President Brad Smith and John Kelly, IBM's executive vice-president, are among the first global tech leaders to sign the document. The pledge, presented to Pope Francis today, calls for AI that safeguards the rights of all humans, especially the underprivileged, and for new regulations in areas like facial recognition. It asks tech leaders to "humanise technology and not 'technologise' humanity," Novena News reports. "The Vatican is not an expert on the technology but on values," Francesca Rossi, IBM's global AI ethics leader, said in a statement. "The collaboration is to make the Vatican and the whole society understand how to use this technology with these values." The pledge is part of a larger workshop on ethical AI led by the Pontifical Academy for Life in the Vatican this week. The Academy hopes governments, NGOs, industry leaders and other associations will join the "Rome Call for AI Ethics," along with tech companies like IBM and Microsoft. It's unclear what this means in the long run, but this is an interesting symbolic move for IBM and Microsoft as they pledge to make ethical AI. Last year, Facebook backed an independent AI ethics research center, and Google has formed an external council to guide "responsible development and use." The European Union has released its own guidelines for ethical AI development, and Canada and France are tackling the issue. Meanwhile, the White House has cautioned against over-regulating AI.
english
<reponame>benjroy/metro /** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @emails oncall+js_foundation * @format */ 'use strict'; const stringToBundle = require('../stringToBundle'); describe('stringToBundle', () => { it('parses a bundle from a string', () => { expect( stringToBundle(`pre 0 1.0 post //# offsetTable={"pre":3,"post":4,"modules":[[0,1],[100,3]],"revisionId":"rev0"}`), ).toEqual({ base: true, revisionId: 'rev0', pre: 'pre', post: 'post', modules: [[0, '0'], [100, '1.0']], }); }); it('throws an error when the string bundle does not contain a pragma', () => { expect(() => stringToBundle(`pre 0 1.0 post`), ).toThrowErrorMatchingInlineSnapshot( '"stringToBundle: Pragma not found in string bundle."', ); }); });
javascript
{"domain":"ZipCodes","code":"02331","codevalue":"Duxbury","link":"MA","sequence":0,"attributes":[{"key":"State","val":"MA"},{"key":"Latitude","val":"42.04"},{"key":"Longitude","val":"-70.67"}],"SequenceType":0,"id":"ed2a62d8-cec0-47c5-9d01-e19a6b15e82b","cachettl":1}
json
<reponame>Lee0701/mobileapps<gh_stars>1-10 { "@metadata": { "authors": [ "Fulup" ] }, "description-add-link-title": "Ouzhpennañ deskrivadur ar pennad", "article-read-more-title": "Lenn muioc'h", "table-title-other": "Muioc'h a ditouroù", "page-edit-history": "Istor klok ar c'hemmoù", "info-box-close-text": "Serriñ", "page-talk-page-subtitle": "Kaozeal diwar-benn gwellaennoù da zegas d'ar pennad-mañ", "page-issues-subtitle": "Disklêriañ danvezioù kudennek pe izel e live betek re.", "page-talk-page": "Gwelet ar bajenn gaozeal", "info-box-title": "Fedoù berr-ha-berr", "view-in-browser-footer-link": "Gwelet ar pennad er merdeer", "page-location": "Diskwel war ur gartenn", "page-similar-titles": "Pajennoù damheñvel", "page-last-edited": "Kemmet $1 deiz zo", "article-about-title": "Diwar-benn ar pennad-mañ", "page-issues": "Kudennoù war ar bajenn", "license-footer-name": "CC-BY-SA 3.0", "license-footer-text": "An endalc'had a c'haller kavout dindan $1, nemet e vefe spisaet ar c'hontrol.", "page-read-in-other-languages": "A c'haller kaout e $1 yezh all", "article-edit-button": "Kemmañ ar rann", "article-edit-protected-button": "Kemmañ ar rannbennad war ar bajenn warezet", "article-section-expand": "Dispakañ ar rannbennad", "article-section-collapse": "Dastum ar rannbennad", "table-expand": "Dispakañ an daolenn", "table-collapse": "Dastum an daolenn", "references-preview-header": "Rakwel an daveennoù" }
json
Ricochet took to social media to express his excitement at earning a match at WWE WrestleMania 39 alongside his tag team partner Braun Strowman. WWE RAW hosted a match between Ricochet and Chad Gable on Monday night. The two men displayed their athleticism in the limited time they got on-screen. Gable was in a good position to win the match, but a distraction from Maxxine Dupri helped The One and Only hit the 450 Splash for the win. Before the contest, a big Fatal Four-Way Tag Team Match was announced for WWE WrestleMania 39. He was delighted to learn that he would be part of the biggest wrestling event of the year. "Y’all really out there acting like this match not about to be 🔥🔥🔥🔥Mama I’m going to #WrestleMania," Ricochet wrote. Check out the tweet below: The match will host four of the best tag teams in the company at The Show of Shows. Strowman and Ricochet have worked well together, collecting victories over the past several weeks. Meanwhile, Street Profits and The Viking Raiders are also well positioned in the division, while Alpha Academy is going through a rough patch. Many fans believe that Ricochet deserves bigger opportunities and matches than he’s currently getting. In an exclusive interview with Sportskeeda's The Wrestling Outlaws, former WWE Superstar EC3 pointed out a major reason why The One and Only isn’t getting the push he deserves: "Unfortunately, he could be the attraction, and he should be an attraction, in a sense. Just by suffering that one defeat upon return and kind of being shuffled around, it just makes him a bigger version of everybody else. And that's the problem with WWE. No one can stand above and be different. " EC3 further went on to say that a certain level of preservation is required to build an attraction in the business. He doesn’t believe that things are going to get better for Ricochet anytime soon: "That's how you build an attraction, that's how you build an Andre [The Giant], a [Hulk] Hogan, and things like that. At this point, I don't think it hurts him to lose. I don't think it helps either. I just think it is what it is, and short of a complete evaluation of how we build stars, nothing changes. " EC3 shared the locker room with the former United States Champion for some time in the company. He believes Ricochet could become a much bigger deal in the company if he can rise above backstage politics. Do you want to see The One and Only as a world champion in WWE someday? Sound off in the comments section below.
english
The work of classification of garbage at the source, which was initiated by Kathmandu Metropolitan City (KMC) around five months ago has been put off for the time being. In a bid to make solid waste management further effective, the KMC had begun the task to classify waste at source in all 32 wards since mid-July this year as part of the waste management. Though the task was on in the first couple of weeks as per the plan, it did not get continuity later. Member of KMC Mayor Balendra Shah, Secretariat Sunil Lamsal said the task has not been continued for lack of proper space. As KMC lacks open space, it has demanded the federal government provide at least 200 ropani of land for the purpose. "The government has assured KMC to provide land. Classification of biodegradable and non-biodegradable wastes would resume once KMC gets land for its management. We are hopeful that this would gain momentum once the new government is formed", Lamsal shared. "KMC has no legal authority to occupy land beyond its boundary. So, we urged the central government for the same. The KMC has made necessary preparation to use biodegradable waste to manufacture fertilizers after space for waste management is identified", he further informed. Every day around 1,200 tons of waste from the capital city is being managed presently in Bancharedanda. The KMC shares the highest quantity of 500 metric tons of waste. Solid wastes emanating from 19 local government units of the Kathmandu Valley are managed in Banacharedanda. READ ALSO:
english
The release of Chrome 87 is significant for a number of reasons. Not only is it the last version of Google's browser due to be released in 2020, but it also includes a host of improvements, including speed and security improvements and a raft of new features. Security and performance enhancements are always welcome in a web browser, and Google has done great work with Chrome 87 in numerous ways to speed things up. The browser now starts 25% faster, and CPU usage has been reduced by up to five times, meaning it uses less power and your laptop battery will last longer. While the performance boost will vary from computer to computer, and will be for individuals to judge, the new features can be enjoyed by everyone. In recent versions of Chrome, Google has been gradually making a number of important improvements to the way tabs work, including adding pinning and grouping options. This development continues with version 87 of the browser, with Google adding the ability to search open tabs to save you having to manually hunt them down. This is a great option for anyone who finds themselves buried under a sea of tabs – and search even works across multiple browser windows. Other tab improvements in the latest version of Chrome include the focusing of resources on the active tab, which Google says has enabled it to improve performance and reduce power usage. The Android version of Chrome is also seeing speed improvements thanks to caching, which allows for faster backwards and forwards navigation. Google is also making the omnibar – or the address bar to you and I – more useful. As well as serving as the location to type addresses or search terms, this can now be used to access various functions of Chrome without having to navigate through settings. There are numerous 'actions' that you can perform, including clearing browsing data by typing 'delete history', 'clear cache' or 'wipe cookies', or opening an incognito window by typing 'launch incognito mode' or just 'incognito'. Google points out that while these are features of Chrome 87, not all users will see them straight away, as they'll be rolled out gradually. Chromebook users will get access to features such as tab search first, before they're made available to other desktop users. Get the hottest deals available in your inbox plus news, reviews, opinion, analysis, deals and more from the TechRadar team. Sofia is a tech journalist who's been writing about software, hardware and the web for nearly 25 years – but still looks as youthful as ever! After years writing for magazines, her life moved online and remains fueled by technology, music and nature. Having written for websites and magazines since 2000, producing a wide range of reviews, guides, tutorials, brochures, newsletters and more, she continues to write for diverse audiences, from computing newbies to advanced users and business clients. Always willing to try something new, she loves sharing new discoveries with others. Sofia lives and breathes Windows, Android, iOS, macOS and just about anything with a power button, but her particular areas of interest include security, tweaking and privacy. Her other loves include walking, music, her two Malamutes and, of course, her wife and daughter.
english
<filename>editor/src/components/canvas/canvas-strategies/absolute-resize-bounding-box-strategy.tsx import { isHorizontalPoint } from 'utopia-api/core' import { getLayoutProperty } from '../../../core/layout/getLayoutProperty' import { framePointForPinnedProp } from '../../../core/layout/layout-helpers-new' import { MetadataUtils } from '../../../core/model/element-metadata-utils' import { mapDropNulls } from '../../../core/shared/array-utils' import { isRight, right } from '../../../core/shared/either' import { ElementInstanceMetadataMap, JSXElement } from '../../../core/shared/element-template' import { CanvasRectangle, rectangleDifference, roundTo, transformFrameUsingBoundingBox, } from '../../../core/shared/math-utils' import { ElementPath } from '../../../core/shared/project-file-types' import { getElementFromProjectContents } from '../../editor/store/editor-state' import { stylePropPathMappingFn } from '../../inspector/common/property-path-hooks' import { EdgePosition } from '../canvas-types' import { AdjustCssLengthProperty, adjustCssLengthProperty, } from '../commands/adjust-css-length-command' import { setSnappingGuidelines } from '../commands/set-snapping-guidelines-command' import { updateHighlightedViews } from '../commands/update-highlighted-views-command' import { AbsoluteResizeControl } from '../controls/select-mode/absolute-resize-control' import { AbsolutePin, hasAtLeastTwoPinsPerSide } from './absolute-resize-helpers' import { CanvasStrategy } from './canvas-strategy-types' import { getMultiselectBounds, resizeBoundingBox, runLegacyAbsoluteResizeSnapping, } from './shared-absolute-move-strategy-helpers' export const absoluteResizeBoundingBoxStrategy: CanvasStrategy = { id: 'ABSOLUTE_RESIZE_BOUNDING_BOX', name: 'Absolute Resize', isApplicable: (canvasState, interactionState, metadata) => { if ( canvasState.selectedElements.length > 1 || (canvasState.selectedElements.length >= 1 && interactionState?.interactionData.modifiers.alt) ) { return canvasState.selectedElements.every((element) => { const elementMetadata = MetadataUtils.findElementByElementPath(metadata, element) return ( elementMetadata?.specialSizeMeasurements.position === 'absolute' && hasAtLeastTwoPinsPerSide(elementMetadata.props) ) }) } else { return false } }, controlsToRender: [ { control: AbsoluteResizeControl, key: 'absolute-resize-control', show: 'always-visible' }, ], fitness: (canvasState, interactionState, sessionState) => { return absoluteResizeBoundingBoxStrategy.isApplicable( canvasState, interactionState, sessionState.startingMetadata, ) && interactionState.interactionData.type === 'DRAG' && interactionState.activeControl.type === 'RESIZE_HANDLE' ? 1 : 0 }, apply: (canvasState, interactionState, sessionState) => { if ( interactionState.interactionData.type === 'DRAG' && interactionState.interactionData.drag != null && interactionState.activeControl.type === 'RESIZE_HANDLE' ) { const drag = interactionState.interactionData.drag const edgePosition = interactionState.activeControl.edgePosition const originalBoundingBox = getMultiselectBounds( sessionState.startingMetadata, canvasState.selectedElements, ) if (originalBoundingBox != null) { const centerBased = interactionState.interactionData.modifiers.alt const newBoundingBox = resizeBoundingBox( originalBoundingBox, drag, edgePosition, centerBased, ) const { snappedBoundingBox, guidelinesWithSnappingVector } = snapBoundingBox( canvasState.selectedElements, sessionState.startingMetadata, edgePosition, newBoundingBox, canvasState.scale, false, centerBased, ) const commandsForSelectedElements = canvasState.selectedElements.flatMap( (selectedElement) => { const element = getElementFromProjectContents( selectedElement, canvasState.projectContents, canvasState.openFile, ) const originalFrame = MetadataUtils.getFrameInCanvasCoords( selectedElement, sessionState.startingMetadata, ) if (element == null || originalFrame == null) { return [] } const newFrame = transformFrameUsingBoundingBox( snappedBoundingBox, originalBoundingBox, originalFrame, ) const elementParentBounds = MetadataUtils.findElementByElementPath(sessionState.startingMetadata, selectedElement) ?.specialSizeMeasurements.immediateParentBounds ?? null return [ ...createResizeCommandsFromFrame( element, selectedElement, newFrame, originalFrame, elementParentBounds, ), setSnappingGuidelines('transient', guidelinesWithSnappingVector), ] }, ) return [...commandsForSelectedElements, updateHighlightedViews('transient', [])] } } // Fallback for when the checks above are not satisfied. return [] }, } function createResizeCommandsFromFrame( element: JSXElement, selectedElement: ElementPath, newFrame: CanvasRectangle, originalFrame: CanvasRectangle, elementParentBounds: CanvasRectangle | null, ): AdjustCssLengthProperty[] { const pins: Array<AbsolutePin> = ['top', 'left', 'width', 'height', 'bottom', 'right'] return mapDropNulls((pin) => { const horizontal = isHorizontalPoint( // TODO avoid using the loaded FramePoint enum framePointForPinnedProp(pin), ) const value = getLayoutProperty(pin, right(element.props), ['style']) const rectangleDiff = rectangleDifference(originalFrame, newFrame) const delta = allPinsFromFrame(rectangleDiff)[pin] const roundedDelta = roundTo(delta, 0) const pinDirection = pin === 'right' || pin === 'bottom' ? -1 : 1 if (isRight(value) && value.value != null && roundedDelta !== 0) { return adjustCssLengthProperty( 'permanent', selectedElement, stylePropPathMappingFn(pin, ['style']), roundedDelta * pinDirection, horizontal ? elementParentBounds?.width : elementParentBounds?.height, true, ) } else { return null } }, pins) } function allPinsFromFrame(frame: CanvasRectangle): { [key: string]: number } { return { left: frame.x, top: frame.y, width: frame.width, height: frame.height, right: frame.x + frame.width, bottom: frame.y + frame.height, } } function snapBoundingBox( selectedElements: Array<ElementPath>, jsxMetadata: ElementInstanceMetadataMap, edgePosition: EdgePosition, resizedBounds: CanvasRectangle, canvasScale: number, keepAspectRatio: boolean, centerBased: boolean, ) { const { snappedBoundingBox, guidelinesWithSnappingVector } = runLegacyAbsoluteResizeSnapping( selectedElements, jsxMetadata, edgePosition, resizedBounds, canvasScale, keepAspectRatio, centerBased, ) return { snappedBoundingBox, guidelinesWithSnappingVector, } }
typescript
{ "id": "d811-17", "text": "inhibiting factor which they would constitute for national\nmeetings* The NAEBss contributions would be limited to\nreimbursing cooperating institutions for actual expenses*\nparing for necessary consultants* reports and demonstration\nmaterials end expenses* Estimate t §1,J>00* per workshop\nfor a total of $6,000* per year. All income would be\nused to reduce the actual grant expenses used for this\npurpose* A gradual effort would be made to make these\nincreasingly self-supporting, through the lilb of the\nproject*\nThese workshops and Seining would also be principally,\nbut not exclusively, for teachers and teacher-trainers* Soma of the\nother emphases, as indicated, would be in the fields of graphics and\nvisual aidsj script planning and writing! production! series planning^\nand evaluation.\nConsultants and other expenses;\n5) Besides the above workshops, qualified consultants would\nbe provided each of the cooperating institutions and/or\nthe teachers of such courses as will be developed under\nthis projectj these services would be provided particularly\nat the beginning of the year, but the coordinator would\nhave the responsibility of seeing thatiheso schools are\nserviced as necessary, throughout the year, to insure the\navailability of maximum resources and standards in the\ninitial stages of this project* Estimated consultant\nIbes (at 050.00 to 0100*00 per day) plus travel:\n§6,000.00 per year,\nJxi the professional development efforts of the NAEB,\ncoaplimentary copies of the Newsletter, the Journal and\n6)" }
json
<filename>blog/items/2019/09/15/a192924.json { "text": "An <a href=\"https://twitter.com/davewiner/status/1173300120206663680\">idea</a> for the <a href=\"https://www.newyorker.com/\">New Yorker</a> and other pubs with paywalls. Suppose I request a link to a story, you include a code in the url, so when you get a hit you know it came thru me. At least deduct that page from my monthly quota. Or maybe a twofer.", "created": "Sun, 15 Sep 2019 19:29:24 GMT", "type": "outline", "urltweet": "https://twitter.com/davewiner/status/1173300120206663680" }
json
Jaipur: On Wednesday, PM Narendra Modi fiercely attacked the Congress government of Rajasthan. He accused the Gehlot government of adopting a policy of 'appeasement' and taking a soft stand against terrorists. He also held the Rajasthan government responsible for releasing the culprits of the 2008 Jaipur serial blasts. Addressing a rally in Rajasthan's Abu Road, PM Narendra Modi took a dig at the infighting in the Congress and said, "The chief minister doesn't trust his MLAs, he doesn't trust them. " According to the report, he said about Sachin Pilot targeting the Gehlot government, "Everyone in the government is competing to insult each other. When (the Congress government's) whole five years (the Chief Minister's) chair was in trouble , then who will care for the development of Rajasthan. " In fact, on Tuesday, Rajasthan Congress leader and former deputy CM Sachin Pilot had said that we heard Ashok Gehlot's previous speech, after listening to this speech, I feel that his (Ashok Gehlot) leader is not Sonia Gandhi but his leader is Vasundhara Raje. Scindia is Referring to the 2008 Jaipur serial blasts, the PM alleged that the Congress government in the state did not fight the case vigorously, due to which all were released. He also alleged that the law and order in Rajasthan has completely broken down under the Congress rule. Prime Minister Modi alleged, "The Congress government in Rajasthan is afraid to take action against criminals because of vote bank politics. " Earlier on Wednesday, PM Narendra Modi reached Rajasthan tour. Prime Minister Modi launched development projects worth over Rs 5,500 crore in Nathdwara. Due to this, Rajasthan CM Ashok Gehlot was also present. Addressing the public meeting here, Prime Minister Modi described Ashok Gehlot as his friend. So before this Ashok Gehlot said, there is no enmity between us. It is only a battle of ideology. However, raising the issue of ERCP project, Gehlot said, there is a crisis of drinking water in 13 districts of Rajasthan. On this Prime Minister Modi said, If the problem of water crisis had been solved earlier, then there would have been no need for the Jal Jeevan Mission. In July 2020, 18 Congress MLAs rebelled under the leadership of Congress leader Sachin Pilot. This political drama which went on for a month ended after the intervention of the party high command. Thereafter, Pilot was removed from the post of Deputy Chief Minister and Congress State President.
english
Republicans in Congress lauded President Trump for his nomination of Judge Amy Coney Barrett to the Supreme Court Saturday night while Democrats predicted her confirmation could be a death knell for a number of liberal priorities, including the Affordable Care Act (ACA) and Roe v. Wade. Barrett, of the 7th Circuit Court of Appeals, is up to fill the Supreme Court seat of late Justice Ruth Bader Ginsburg, a trailblazer for women's rights and the face of the liberal bloc of the court. Barrett's confirmation would significantly tip its ideological balance in favor of conservatives. "I stand before you to fulfill one of my highest and most important duties," Trump said in remarks before he introduced Barrett, who he called "one of our nation's most brilliant and gifted legal minds. " Congressional Republicans overwhelmingly approved of the nomination and characterized Barrett as "exceptionally impressive," re-upping their promises to put Trump's nominee to a vote on the floor of the Senate. "President Trump could not have made a better decision," Sen. Mitch McConnell, R-Ky. , the majority leader, said in a statement. "Judge Amy Coney Barrett is an exceptionally impressive jurist and an exceedingly well-qualified nominee to the Supreme Court of the United States. " He added: "First, Judge Barrett built a reputation as a brilliant scholar at the forefront of the legal academy. Then she answered the call to public service. For three years on the Court of Appeals for the Seventh Circuit, she has demonstrated exactly the independence, impartiality, and fidelity to our laws and Constitution that Americans need and deserve on their highest Court. . . As I have stated, this nomination will receive a vote on the Senate floor in the weeks ahead, following the work of the Judiciary Committee supervised by Chairman Graham. " Democrats, on the other hand, slammed Barrett and the president over potential rulings they believe Barrett would make if given the opportunity. "The American people should make no mistake—a vote by any Senator for Judge Amy Coney Barrett is a vote to strike down the Affordable Care Act and eliminate protections for millions of Americans with pre-existing conditions," Senate Minority Leader Chuck Schumer, D-N. Y. , said. He added: "Should Judge Amy Coney Barrett be confirmed, a far-right majority on the court could also turn back the clock on women’s rights and a woman’s right to choose, workers’ rights, voting rights, civil rights, LGBTQ rights, environmental protections and more. The future for DACA recipients also hangs in the balance with this nominee. " Schumer said that Republicans were ignoring the "dying wish" of Ginsburg that she be replaced only after the presidential election and said that "I will strongly oppose this nomination. " Senate Judiciary Committee Ranking Member Diane Feinstein, D-Calif. , also warned about the potential ramifications of Barrett, but also slammed Republicans for considering a Supreme Court nominee so close to an election. "There are now only 38 days until the election, and early voting has already begun in many states. No Supreme Court vacancy has been filled this close to a presidential election," she said. "The Senate should not consider any Supreme Court nominee until the American people have spoken in November and the next president has been inaugurated. " Sen. Richard Blumenthal, D-Conn. , another Senate Judiciary Committee member, said that he would "refuse to treat this process as legitimate & will not meet with Judge Amy Coney Barrett. " Democrats have accused Republicans of rank hypocrisy for planning to advance a Supreme Court nomination so close to the election after blocking Obama nominee Judge Merrick Garland in 2016 months ahead of the election. But McConnell and Republicans have argued that Senate precedent shows the body generally confirms Supreme Court nominees when the Senate and White House are in the same hands and declined to do so when the government is divided. They say their majority in 2014 was elected to oppose Obama and in 2018 to support Trump. The Senate hasn’t considered a Supreme Court nominee in a presidential election year since 1940. The Senate voted to confirm Supreme Court Justice Frank Murphy in January of that year. It also confirmed Justice Benjamin Cardozo in Feb. 1932 and before that Justice Louis Brandeis in Jan. 1916. Democrats, of course, overwhelmingly called on the Senate move on Garland in 2016 but are now opposing any action on Barrett. Democratic vice-presidential nominee Sen. Kamala Harris, D-Calif. , who is a member of the judiciary committee, warned that Barrett could be the vote on the Supreme Court that leads to the end of Roe v. Wade. WHERE HAS AMY CONEY BARRETT STOOD ON IMPORTANT CASES? "Trump’s hand-picked successor to Justice Ginsburg’s seat makes it clear: they intend to destroy the Affordable Care Act & overturn Roe. This selection would move the court further right for a generation & harm millions of Americans," she said. "I strongly oppose Judge Barrett’s nomination. " Sen. Lindsey Graham, R-S. C. , the chairman of the Senate Judiciary Committee seemed to reference the nasty confirmation battle over Justice Brett Kavanaugh in his statement calling for a civil hearing on Barrett's nomination. "As the Chairman of the Senate Judiciary Committee, I’m very committed to ensuring that the nominee gets a challenging, fair, and respectful hearing," Graham said. "We move forward on this nomination knowing that the President has picked a highly qualified individual who will serve our nation well on the highest court in the land. " WHO IS JUDGE AMY CONEY BARRETT, POTENTIAL SCOTUS CONTENDER? Sen. Kevin Cramer, R-N. D. , slammed Democrats over attacks they've leveled against Barrett already but said he trusts that she can make it through the confirmation process. And Sen. Ben Sasse, R-Neb. , known for his witty press releases, lauded Barrett for her judicial philosophy, arguing that she won't attempt to make policy from the bench. "Despite her unsurpassed character, reputation, and intellect, this confirmation process will be nasty. Why? Because too many on the left (and sadly some on the right as well) want judges who will substitute their own will for the law," Sasse said. " Judge Barrett is not that kind of judge. She believes her duty isn’t to arbitrarily slop applesauce on stone tablets and declare new laws — her duty is to cloak her personal views under a black robe and to faithfully uphold the Constitution. That makes her a problem to rabid partisans, and an ally to the rule of law. " Reaction also poured in from House members. "Judge Amy Coney Barrett is an excellent pick by President Trump for the Supreme Court," Rep. Ken Buck, R-Colo. , said. "She is a brilliant legal mind and solid conservative. The Senate should confirm her immediately. " Countered House Speaker Nancy Pelosi, D-Calif: "If this nominee is confirmed, millions of families’ health care will be ripped away in the middle of a pandemic that has infected seven million Americans and killed over 200,000 people in our country. . . Every vote to confirm this nominee is a vote to dismantle health care. The American people will hold every Senator responsible for their vote at the ballot box. "
english
import React from 'react'; import ReactDOM from 'react-dom'; import App from './App'; import registerServiceWorker from './registerServiceWorker'; if (process.env.NODE_ENV === 'production') { require('./index.css'); } else { require('./index.less'); } ReactDOM.render(<App />, document.getElementById('root')); registerServiceWorker(); // CRA hot-reload if (module.hot) { module.hot.accept() }
javascript
<filename>payment-api/infra/src/test/java/com/hexagonaldemo/paymentapi/integration/PaymentDataAdapterIT.java package com.hexagonaldemo.paymentapi.integration; import com.hexagonaldemo.paymentapi.AbstractIT; import com.hexagonaldemo.paymentapi.IT; import com.hexagonaldemo.paymentapi.adapters.payment.jpa.PaymentDataAdapter; import com.hexagonaldemo.paymentapi.adapters.payment.jpa.repository.PaymentJpaRepository; import com.hexagonaldemo.paymentapi.common.exception.PaymentApiBusinessException; import com.hexagonaldemo.paymentapi.payment.usecase.PaymentCreate; import com.hexagonaldemo.paymentapi.payment.usecase.PaymentRollback; import com.hexagonaldemo.paymentapi.payment.model.Payment; import com.hexagonaldemo.paymentapi.payment.model.PaymentState; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.jdbc.Sql; import java.math.BigDecimal; import static org.assertj.core.api.Assertions.*; @IT @Sql(scripts = "classpath:sql/payments.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) @Sql(scripts = "classpath:sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) class PaymentDataAdapterIT extends AbstractIT { @Autowired PaymentDataAdapter paymentDataAdapter; @Autowired PaymentJpaRepository paymentJpaRepository; @Test void should_retrieve_payment() { // when Payment payment = paymentDataAdapter.retrieve(1L); // then assertThat(payment).isNotNull() .returns(1L, from(Payment::getId)) .returns(PaymentState.SUCCESS, from(Payment::getState)); } @Test void should_not_retrieve_payment_when_payment_not_found() { // when assertThatExceptionOfType(PaymentApiBusinessException.class) .isThrownBy(() -> paymentDataAdapter.retrieve(666L)) .withMessage("paymentapi.payment.notFound"); } @Test void should_create_payment() { // given PaymentCreate paymentCreate = PaymentCreate.builder() .accountId(1002L) .price(BigDecimal.valueOf(99.9)) .referenceCode("test ref code") .build(); // when Payment payment = paymentDataAdapter.create(paymentCreate); // then assertThat(payment).isNotNull() .returns(3L, from(Payment::getId)) .returns(1002L, from(Payment::getAccountId)) .returns(BigDecimal.valueOf(99.9), from(Payment::getPrice)) .returns(PaymentState.SUCCESS, from(Payment::getState)); } @Test void should_rollback_payment() { // given PaymentRollback paymentRollback = PaymentRollback.builder() .id(1L) .build(); // when paymentDataAdapter.rollback(paymentRollback); // then assertThat(paymentJpaRepository.findById(1L).get().toModel()).isNotNull() .returns(1L, from(Payment::getId)) .returns(1001L, from(Payment::getAccountId)) .returns(BigDecimal.valueOf(100.11), from(Payment::getPrice)) .returns(PaymentState.ROLLBACKED, from(Payment::getState)); } }
java
<reponame>VanessaSwerts/react-dogs import React from 'react' export default function Error({error}) { if (!error) return null return ( <p style={{ color: '#f31', margin: '1rem 0' }}> {error} </p> ) }
javascript
TS ICET Answer Key 2019| The TS ICET Answer key 2019 or Telangana ICET Answer key 2019 has been released by the Kakatiya University, Warangal. The TS ICET 2019 Answer Key has been published by the Kakatiya University on its official website icet. tsche. ac. in (https://www. tsche. ac. in. /). The Kakatiya University, Warangal on behalf of Telangana State Council of Higher Education (TSCHE) will be uploading the TS ICET Answer key 2019 for MBA and MCA examinations. The Telangana State Integrated Common Entrance Test was conducted on May 23 and May 24 for postgraduate MBA and MCA courses. Candidates can download their TS ICET Answer key 2019 for TS ICET 2019 MBA Answer key, TS ICET MCA Answer key once it is released. Further, candidates can check their probable scores by tallying their marked responses with the one given in Telangana ICET Answer key. After the release of official TS ICET Answer Key 2019, wrong or doubted answers can be challenged in prescribed format to the Kakatiya University, Warangal. The submitted objection against the TS ICET MBA Answer key or TS ICET MCA Answer key will be deliberated and then a final TS ICET Answer Key 2019 is scheduled for release on June 13.
english
{ "vorgangId": "84267", "VORGANG": { "WAHLPERIODE": "18", "VORGANGSTYP": "Schriftliche Frage", "TITEL": "Gutachten und Analysen der letzten fünf Jahre im Zusammenhang mit der Umstellung des Betriebs des Garchinger Forschungsreaktors FRM II", "AKTUELLER_STAND": "Beantwortet", "SIGNATUR": "", "GESTA_ORDNUNGSNUMMER": "", "WICHTIGE_DRUCKSACHE": { "DRS_HERAUSGEBER": "BT", "DRS_NUMMER": "18/13617", "DRS_TYP": "Schriftliche Fragen", "DRS_LINK": "http://dipbt.bundestag.de:80/dip21/btd/18/136/1813617.pdf" }, "EU_DOK_NR": "", "SCHLAGWORT": [ { "_fundstelle": "true", "__cdata": "Forschungsreaktor" }, { "_fundstelle": "true", "__cdata": "Garching b. München" }, "Gutachten", "Urananreicherung" ], "ABSTRAKT": "Originaltext der Frage(n): \r\n \r\nVon wem liegen der Bundesregierung Gutachten, Analysen oder fachliche Stellungnahmen aus den letzten fünf Jahren im Zusammenhang mit der Umstellung des Betriebs des Garchinger Forschungsreaktors FRM II weg vom Einsatz von hochangereichertem Uranbrennstoff (HEU) vor (bitte möglichst auch mit Angabe des jeweiligen Datums; es wird explizit nicht nach dem Inhalt der betreffenden Unterlagen gefragt), und welche mit dem Freistaat Bayern abgestimmte Entscheidung hat die Bundesregierung hinsichtlich der Umstellung des FRM-II-Betriebs weg vom HEU-Einsatz getroffen (bitte detaillierte und vollständige Darlegung; vgl. Antwort der Bundesregierung auf meine Mündliche Frage 2, Plenarprotokoll 18/214, Anlage 3, wonach die Bundesregierung mit Stand von Januar 2017 mit der Entscheidung für Frühjahr 2017 rechnete)?" }, "VORGANGSABLAUF": { "VORGANGSPOSITION": { "ZUORDNUNG": "BT", "URHEBER": "Schriftliche Frage/Schriftliche Antwort ", "FUNDSTELLE": "22.09.2017 - BT-Drucksache 18/13617, Nr. 68", "FUNDSTELLE_LINK": "http://dipbt.bundestag.de:80/dip21/btd/18/136/1813617.pdf", "PERSOENLICHER_URHEBER": [ { "VORNAME": "Sylvia", "NACHNAME": "Kotting-Uhl", "FUNKTION": "MdB", "FRAKTION": "BÜNDNIS 90/DIE GRÜNEN", "AKTIVITAETSART": "Frage" }, { "VORNAME": "Stefan", "NACHNAME": "Müller", "FUNKTION": "Parl. Staatssekr.", "RESSORT": "Bundesministerium für Bildung und Forschung", "AKTIVITAETSART": "Antwort" } ] } } }
json
Pune Warriors India will hope that they will be the first team to beat Rajasthan Royals at the Sawai Mansingh Stadium in the 50th match of the Indian Premier League (IPL) on Sunday. Rajasthan Royals were beaten comfortably by Pune Warriors India in their previous encounter at the Subrata Sahara Stadium. Rajasthan’s batting revolves mainly around Shane Watson and to a certain extent Brad Hodge (who was dropped in their previous encounter against Kolkata Knight Riders). Rahul Dravid batted at No. 8 which was baffling. The ploy to expose James Faulkner, Sanju Samson and Dishant Yagnik is a horses for courses policy. The core of the batting order if tinkered might give Rajasthan chequered results. Ajinkya Rahane has opened the batting in all the matches. He has had modest tournament so far. The centurion of IPL 2012, Rahane will be hoping to get himself in and then score big. Owais Shah’s inclusion bolsters batting line-up but it is no good if he bats any later that No.4. If Samson is Rajasthan’s full time one-down batsman then Rajasthan might think of including Kevon Cooper to reinforce the bowling department and also a handy batting prospect will be at their disposal. The bowling of Rajasthan looks ordinary at times when they fail to pick up early wickets. Ajit Chandila, Ankeet Chavan and Brad Hogg make sporadic appearances. It is very difficult for the spinners to keep performing in every game as the tracks across the country vary. The track at Jaipur has some help for the fast bowlers. So Sreesanth might get a game at Jaipur at the expense of one of the spinners. Stuart Binny has not bowled much in the tournament so far. If Binny bowls the four overs, two-pronged spin attack might be considered. Pune Warriors India’s death bowling is their pet-peeve. In the last encounter AB de Villiers’ 23-ball fifty tilted the balance in Bangalore’s favour especially after expensive last over where 26 runs were conceded. In the last game, Pune’s batting was inspiring. Robin Uthappa’s 45-ball 75 was an innings of high pedigree. He failed to get enough support at the other end. Angelo Mathews will be without any captaincy responsibilities as he has handed over the reins to Aaron Finch. Yuvraj Singh has had quite a forgettable IPL so far. He would be wanting to unleash his repertoire of shots and help Pune to win more matches. Pune, with nothing to lose, might spoil Rajsthan’s party. For Rajasthan a win will give them much needed impetus and confidence to secure their place in the playoffs. Rajasthan Royals (Probable): Shane Watson, Ajinkya Rahane, Rahul Dravid (c), Sanju Samson (wk), Brad Hodge, Kevon Cooper, James Faulkner, Stuart Binny, Siddharth Trivedi, Ajit Chandila, S Sreesanth. Pune Warriors India (Probable): Aaron Finch (c), Robin Uthappa (wk), Tirumalasetti Suman, Yuvraj Singh, Angelo Mathew, Steve Smith, Luke Wright, Abhishek Nayar, Bhuvneshwar Kumar, Ashok Dinda, Rahul Sharma. (Sarang Bhalerao hails from a family of doctors, but did his engineering. He then dumped a career in IT with Infosys to follow his heart and passion and became a writer with CricketCountry. A voracious reader, Sarang aspires to beat Google with his knowledge of the game! You can follow him on Twitter here)
english
<reponame>saroff/hh-radar package ru.hh.radar.repository; import org.springframework.data.jpa.repository.JpaRepository; import ru.hh.radar.model.entity.User; public interface UserRepository extends JpaRepository<User, Long> { User findByUsername(String userName); }
java
{ "name": "vacum/dert", "description": "example package", "require": { "zendframework/zend-diactoros": "^2.1" } }
json
WHEN DELHI lawyer Humam Ahmed Siddiqui saw a break in the hectic schedule of the SIMI tribunal underJustice Geeta Mittal, he headed straight to his father-in-law’s home in Gonda in Uttar Pradesh to fetch his children from there. Defending SIMI, Siddiqui had since May attended the tribunal’s sittings at Delhi, Bangalore, Hyderabad and Chennai. A veteran of three tribunals and an ex-SIMI officebearer, Siddiqui knew every case past and present, the best defence arguments, and, most importantly for SIMI, the loopholes in the prosecution’s case. At 8 am on June 23, 2008, as he stood at the Gonda railway station, the anti-terrorism squad swooped down and arrested him. Siddiqui’s case dates to 2001. Police say that on September 15 that year, he and ex-SIMI president Shahid Badr Falahi made speeches against Hinduism at a madarsa in Gorakhpur city, 800 km east of Delhi. (Falahi was given bail in this case five years ago. ) The police had also created another FIR against four local Muslims for attending that meeting. Neither FIR showed how the police got wind of the meeting. Intelligence agents, who claimed to have attended the meeting, were the only prosecution witnesses. That the police registered the FIRs six days after the alleged incident immediately raised doubts that the cases were fabricated. The other four accused secured bail, though by then they had spent two months in jail. Seven years later, the state government is yet to give a routine sanction to start prosecution against Siddiqui and Falahi. Yet, though virtually dead for seven years, the case suddenly came alive miraculously with Siddiqui’s arrest in June. Presenting Siddiqui before the Chief Judicial Magistrate of Gorakhpur on June 23, the police claimed he had admitted to his role in blasts that had rocked Gorakhpur in 2007. Police said they had sent Siddiqui notices and warrants to his father’s house in Sultanpur city and then attached his house in a village in the Sultanpur district. But the house they attached is an ancestral property that Siddiqui hasn’t visited in a quarter century. As for the court notices, Siddiqui says he never received them at his father’s house. Siddiqui languished in jail for exactly a month. Gorakhpur lawyer Radheshyam Pandey finally managed bail for him on July 16. In a total mockery of police and jail accountability, Siddiqui could walk out of his cell only a week later, on July 23, because processing the paperwork took that long. By then, the hearings at the SIMI tribunal had already been held at Udaipur, Bhopal, Aurangabad and Mumbai, where the defence was forced to appear without his valuable support. Siddiqui thought better than to rejoin the defence team. Ever the lawyer, Siddiqui won’t talk about the case as it is pending trial. But he denies he confessed to his involvement in the Gorakhpur blasts. He may be free now but his reputation is in shreds, vilified in just a month. The media widely published a news item released by a news agency, which quoted a top Uttar Pradesh police officer as saying that Siddiqui had confessed to “managing funds” of the banned organisation and that he sent money to members in different states. The report claimed Siddiqui was in touch with ex-SIMI general secretary Safdar Nagori, who was arrested in Indore in March this year. The widely internalised prejudice against SIMI was perhaps revealed most starkly when a Hindi newspaper reporter visited Siddiqui’s retired father in Sultanpur while Siddiqui was still in jail in Gorakhpur. In the course of the interview, Siddiqui’s father told the reporter that as a government servant he had lived in many cities and named a few. The reporter got stuck on one name: Azamgarh. The newspaper report he wrote suggested that Siddiqui must have got close to ex-SIMI president Falahi, who is an Azamgarh native, when his father was posted there.
english
Network Definition APIs ====================== This chapter describes the Network API that includes functionalities, such as network tasks, network authentication, and security. It contains the following sections: - [_API Headers_](#api-headers) - [_PANA network authentication API_](#pana-network-authentication-api) - [_General security type definitions_](#general-security-type-definitions) - [_Ethernet interface bootstrap definition_](#ethernet-interface-bootstrap-definition) - [_RF 6LoWPAN interface configure definition_](#rf-6lowpan-interface-configure-definition) ## API Headers To use Network API, include the following headers: ``` #include net_interface.h #include net_nvm_api.h ``` ## PANA network authentication API This section introduces the PANA network authentication API for server and client mode. PANA network authentication is an authentication layer for network access. It supports configurable authentication methods and security parameters. The server controls that only devices that passed the network authentication get access to the network and receive security material for network layer encryption. The server also handles the key updates to nodes in a coordinated way. Supported TLS 1.2 cipher modes for client and server are listed in _Table 3-9_: **Table 3-9 Supported TLS 1.2 cipher modes** Cipher mode|Description -----------|----------- `NET_TLS_PSK_CIPHER`|PSK authentication. `NET_TLS_ECC_CIPHER`|ECC authentication (ECC must be enabled). `NET_TLS_PSK_AND_ECC_CIPHER`|PSK and ECC authentication (if ECC is not enabled, only PSK is used). In PSK mode, the client and server must use the same PSK key. The PSK key must be loaded to the stack by `arm_tls_add_psk_key()` function. Unused keys can be removed by `arm_tls_remove_psk_key()` function. In ECC mode, the Network authentication certificate must be loaded to the stack by `arm_network_certificate_chain_set()`. ### Client API _Table 3-10_ introduces the client functions used. **Table 3-10 Client functions** Function|Description --------|----------- `arm_pana_client_library_init()`|Initializes the PANA Protocol for client mode with a given setup. `arm_pana_client_key_pull()`|Manually pulls the key from the server. Only for testing purposes. To initialize and configure the PANA network client interface, use the following function: ``` int8_t arm_pana_client_library_init ( int8_t interface_id, net_tls_cipher_e cipher_mode, uint32_t psk_key_id ) ``` Parameter|Description ---------|----------- `interface_id`|The network interface ID. `cipher_mode`|The TLS 1.2 cipher mode; PSK, ECC or both. `psk_key_id`|The PSK key ID for the PSK setup. <dl> <dt>Return value:</dt> <dd>0 Success.</dd> <dd>-1 Unknown network ID or PANA is not supported in this stack.</dd> <dd>-2 Interface active.</dd> </dl> To pull the PANA client key manually for testing purposes: ``` int8_t arm_pana_client_key_pull ( int8_t interface_id ) ``` Parameter|Description ---------|----------- `interface_id`|The network interface ID. <dl> <dt>Return value:</dt> <dd>0 Success.</dd> <dd>-1 Unknown network ID.</dd> </dl> ### Server API _Table 3-11_ introduces the server functions used. **Table 3-11 Server functions** Function|Description --------|----------- `arm_pana_server_library_init()`|Initializes the PANA server mode and security material. `arm_pana_server_key_update()`|Starts a key update process and key delivery to all authenticated nodes. `arm_pana_activate_new_key()`|Triggers new key material quicker after key delivery phase. Only for testing purposes. `arm_network_key_get()`|Reads PANA server key material. Only for testing purposes. To initialize and configure the PANA network server interface: ``` int8_t arm_pana_server_library_init ( int8_t interface_id, net_tls_cipher_e cipher_mode, uint8_t *key_material, uint32_t time_period_before_activate_key ) ``` Parameter|Description ---------|----------- `interface_id`|The network interface ID. `cipher_mode`|The TLS 1.2 cipher mode; PSK, ECC or both. `key_material`|A pointer to 128-bit key material or `NULL` when the PANA server generates the random key. `time_period_before_activate_key`|The guard period in seconds after a successful key delivery phase before the key is activated by the server. <dl> <dt>Return value:</dt> <dd>0 Success.</dd> <dd>-1 Unknown network ID.</dd> <dd>-2 Interface active.</dd> </dl> To trigger a network key update process, use the following function. This function will deliver a new network key to all routers that have registered a GP address with the server. The function call always triggers a new key ID. The key delivery is started in 300ms intervals between the nodes. This function does not cause any traffic if the server does not have any router device sessions. ``` int8_t arm_pana_server_key_update ( int8_t interface_id, uint8_t * network_key_material ) ``` Parameter|Description ---------|----------- `interface_id`|The network interface ID. `network_key_material`|A pointer to new 128-bit key material or a NULL pointer to a randomly generated key. <dl> <dt>Return value:</dt> <dd>0 Key update process is OK.</dd> <dd>-1 PANA server is not yet initialized.</dd> <dd>-2 Old key update is still active.</dd> <dd>-3 Memory allocation fail.</dd> </dl> To activate the new key material quicker before a standard timeout, use the following function. This function is only used for testing purposes. ``` int8_t arm_pana_activate_new_key ( int8_t interface_id ) ``` Parameter|Description ---------|----------- `interface_id`|The network interface ID. <dl> <dt>Return value:</dt> <dd>0 Key activate process is OK.</dd> <dd>-1 No pending key update.</dd> <dd>-2 PANA server is not initialized or the PANA server API is disabled by this stack.</dd> </dl> To read the security key material of the PANA server: `previous_active_network_key` is only valid when `current_active_key_index` is bigger than 1. ``` int8_t arm_network_key_get ( int8_t interface_id, ns_keys_t *key ) ``` Parameter|Description ---------|----------- `key`|A pointer for storing key material information. <dl> <dt>Return value:</dt> <dd>0 Key read is OK.</dd> <dd>-1 PANA server key material is not available.</dd> </dl> This structure defines the network keys used by the `net_network_key_get` function and comprises the following members: ``` typedef struct ns_keys_t { uint8_t previous_active_network_key[16]; uint8_t previous_active_key_index; uint8_t current_active_network_key[16]; uint8_t current_active_key_index; } ns_keys_t; ``` Member|Description ------|----------- `previous_active_network_key`|Contains the previous key. The key is still valid for reception. `previous_active_key_index`|Contains the key index for the previous key. `current_active_network_key`|Contains the current key. `current_active_key_index`|Contains the index for the current key. ### Resume API The PANA Resume API allows the previously established PANA sessions to be resumed without going through a full authentication phase. This allows smaller low-power devices to join the network faster after the host or router is booted. The resume functionality depends on the platform side to provide non-volatile storage space that is used for storing PANA session data. The storage is used for keeping the data when the device is powered off or rebooted. The data contains authentication keys so it must be kept secure. If no such secure storage can be provided, ARM recommends not to use the resume functionality because it may leak the authentication keys. The resume functionality is divided into two parts, the client side API and the server side API. Both sides require the application to set a callback that receives new material when there are updates in the network. The client side callback receives key material immediately after a successful authentication and periodically after each network key update. On the server side, the callback receives an update when a new client joins the network or when network keys are updated. Security material is basically divided into two parts, session keys and network keys. Each client session has unique authentication keys that are assigned to only one session. After a successful authentication, the client receives network keys that are shared with the whole network. The network keys are used for encryption and decryption for all clients. Therefore, a session resume requires you to store both keys. #### Client side PANA resume API To set a callback for storing PANA key material, use the following function. Before setting this callback, the application should allocate a buffer for transferring keys to the callback. ``` int8_t pana_client_nvm_callback_set ( void (*passed_fptr)(pana_client_nvm_update_process_t), uint8_t * nvm_static_buffer ); ``` Parameter|Description ---------|----------- `passed_fptr`|A pointer to the callback function. `nvm_static_buffer`|A pointer to the allocated buffer. The required size is 86 bytes. <dl> <dt>Return value:</dt> <dd>0 Initialization is OK.</dd> <dd>-1 Failure.</dd> </dl> The callback function is called whenever the stack acquires new keys. The parameter passed to the callback tells which parts of the keys are updated. This enumeration defines the parameter types: ``` typedef enum pana_client_nvm_update_process_t { PANA_CLIENT_SESSION_UPDATE, PANA_CLIENT_SESSION_SEQ_UPDATE, }pana_client_nvm_update_process_t; ``` Parameter|Description ---------|----------- `PANA_CLIENT_SESSION_UPDATE`|Full update of PANA session information. `PANA_CLIENT_SESSION_SEQ_UPDATE`|An update of the REQ and RES sequence number of a PANA key pull or push operation. When a callback takes place with the parameter `PANA_CLIENT_SESSION_UPDATE`, the first 16 bytes in the data buffer are PANA session address and the following 70 bytes PANA session keys. The session address is associated with the node's parent address, so that is most probably required only on star topology networks. On the mesh network, the parent address can change, so storing the session address is unnecessary. When multiple sessions are supported, the session address identifies each session. All sessions are then stored separately. An example of a session saving functionality when the session address is not stored: ``` #define PANA_SESSION_ADDRESS_SIZE 16 #define PANA_SESSION_KEY_SIZE 70 void pana_resume_callback(pana_client_nvm_update_process_t event) { if (PANA_CLIENT_SESSION_UPDATE == event) { // store now the Session keys, skip the session address write_to_storage(nvm_static_buffer+PANA_SESSION_ADDRESS_SIZE, PANA_SESSION_KEY_SIZE); } } ``` To resume the PANA session: ``` int8_t net_pana_client_session_nvm_data_load ( uint8_t *data_buffer, uint8_t *session_address, int8_t interface_id ); ``` Parameter|Description ---------|----------- `data_buffer`|A pointer to the PANA session keys. `session_address`|A pointer to the PANA session address, or NULL if no session address information is stored. `interface_id`|The interface ID for a 6LoWPAN interface. When you give a `NULL` pointer to `session_address`, the function only restores the PANA keys and can then associate with any parent from the same network. This functionality is required on the mesh topology. A client can keep track of a single PANA session or multiple PANA sessions using the enumeration below. Single session mode is set by default. ``` typedef enum { NET_PANA_SINGLE_SESSION, NET_PANA_MULTI_SESSION, } net_pana_session_mode_e; ``` #### Server side API The server side API differs from the client side so that it stores multiple PANA sessions. This adds some complexity to storing of keys. The first step is to allocate a buffer that is used to transfer keys to the callback function. The buffer size must be 116 bytes and is symbolically defined as `PANA_SERVER_CLIENT_NVM_SESSION_BUF_SIZE`. The next step is to set a PANA key update callback that receives the key material: ``` int8_t pana_server_nvm_callback_set ( uint16_t (*passed_fptr)(pana_nvm_update_process_t), uint8_t * nvm_static_buffer ); ``` Parameter|Description ---------|----------- `passed_fptr`|A pointer to the callback function. `nvm_static_buffer`|A pointer to the buffer used to store the PANA keys. <dl> <dt>Return value:</dt> <dd>0 Success.</dd> <dd>-1 Error.</dd> </dl> The following enumeration defines the parameters to the callback: ``` typedef enum pana_nvm_update_process_t { PANA_SERVER_MATERIAL_UPDATE, PANA_SERVER_CLIENT_SESSION_UPDATE, PANA_SERVER_CLIENT_SESSION_SEQ_UPDATE, PANA_SERVER_CLIENT_SESSION_REMOVE_UPDATE, }pana_nvm_update_process_t; ``` Parameter|Description ---------|----------- `PANA_SERVER_MATERIAL_UPDATE`|An update of the PANA server security material. `PANA_SERVER_CLIENT_SESSION_UPDATE`|An update of the PANA client session. `PANA_SERVER_CLIENT_SESSION_SEQ_UPDATE`|A sequence number update of the PANA client session. `PANA_SERVER_CLIENT_SESSION_REMOVE_UPDATE`|Removes the PANA client session. The buffer that is used to transfer data from the PANA process to the storage can contain server keys or client session data. When the server keys are stored, the buffer size is 90 bytes. On the client sessions, it depends on the event that the buffer contains. When client session data is stored, the buffer is divided into the following parts: 1. Session addresses, 20 bytes, containing the following parts: 1. 16 bytes offset, 2 bytes. 2. Client session IPv6 address, 16 bytes. 3. Client port number, 2 bytes. 2. PANA client session data, 33 bytes. 3. PANA client session private keys, 63 bytes. Not all segments are valid by each call. The parameter that is passed to the callback function defines the parts that are valid. _Table 3-12_ defines the segments. **Table 3-12 Callback parameters** |Callback parameter|Buffer content| |------------------|-------------| |`PANA_SERVER_MATERIAL_UPDATE`|Buffer contains server key material. The size is defined by the symbol<br> `PANA_SERVER_MATERIAL_BUF_SIZE`.| |`PANA_SERVER_CLIENT_SESSION_UPDATE`|Add a new PANA session or update the previously stored one. All three segments are valid.<br> An offset number is used to determine which session this is. The offset number for new sessions is zero.<br> The callback should return the offset number for the sessions; this information is not used by the stack but is provided back on the following update.| |`PANA_SERVER_CLIENT_SESSION_SEQ_UPDATE`|Update only the client session data. The first two segments are stored in the buffer.<br>The callback should use the offset field to determine which session data this is.| |`PANA_SERVER_CLIENT_SESSION_REMOVE_UPDATE`|Remove the previously stored session. Only the first segment is stored in the buffer.<br>The callback should use the offset field to determine which session data this is.| The following example shows the basic functionality of the PANA server callback: ``` uint16_t app_nvm_pana_update(pana_nvm_update_process_t update_type ) { uint16_t ret_val = 0; uint16_t offset; switch(update_type) { case PANA_SERVER_MATERIAL_UPDATE: store_server_key(nvm_static_buffer, PANA_SERVER_MATERIAL_BUF_SIZE); return 0; case PANA_SERVER_CLIENT_SESSION_UPDATE: // Store a new session, or update full session record. offset = *((uint16_t*)nvm_static_buffer); if (0 == offset) return store_new_session(nvm_static_buffer); else return update_session(offset, nvm_static_buffer); case PANA_SERVER_CLIENT_SESSION_SEQ_UPDATE: // Update session data, but does not touch keys offset = *((uint16_t*)nvm_static_buffer); return update_session_data(offset, nvm_static_buffer); case PANA_SERVER_CLIENT_SESSION_REMOVE_UPDATE: // Remove previously stored session offset = *((uint16_t*)nvm_static_buffer); return remove_session(offset); } } ``` <span class="notes">**Note:** The previous example assumes that the user provides the functions `store_server_key()`, `store_new_session()`, `update_session()`, `update_session_data()` and `remove_session()`.</span> When the server starts, it uses the following API to restore the previous server keys: ``` int8_t pana_server_restore_from_nvm ( uint8_t * nvm_data, int8_t interface_id ); ``` Parameter|Description ---------|----------- `nvm_data`|Full buffer content given to the callback previously. `interface_id`|The 6LoWPAN interface ID. <dl> <dt>Return value:</dt> <dd>0 Success.</dd> <dd>-1 Failure.</dd> </dl> After restoring the server data, each session previously stored must be restored: ``` int8_t pana_server_nvm_client_session_load ( uint8_t *nvm_pointer ); ``` Parameter|Description ---------|----------- `nvm_pointer`|A pointer to the full PANA session record containing all three defined fields. <dl> <dt>Return value:</dt> <dd>0 Success.</dd> <dd>-1 Failure.</dd> </dl> ## General security type definitions This section introduces general security type definitions. ### Certificate structure The certificate structure comprises the following members: ``` typedef struct arm_certificate_chain_entry_s { uint8_t chain_length; const uint8_t *cert_chain[4]; uint16_t cert_len[4]; const uint8_t *key_chain[4]; } arm_certificate_chain_entry_t; ``` Member|Description ------|----------- `chain_length`|Defines the length of the certificate chain. `cert_chain`|Defines the pointers to the certificates in chain. `cert_len`|Defines the certificate lengths. `key_chain`|Defines the private keys. ### TLS cipher mode structure This enumeration defines the TLS cipher modes: ``` typedef enum net_tls_cipher_e { NET_TLS_PSK_CIPHER, NET_TLS_ECC_CIPHER, NET_TLS_PSK_AND_ECC_CIPHER, } net_tls_cipher_e; ``` Parameter|Description ---------|----------- `NET_TLS_PSK_CIPHER`|Means that network authentication only supports PSK. `NET_TLS_ECC_CIPHER`|Means that network authentication only supports ECC. `NET_TLS_PSK_AND_ECC_CIPHER`|Means that network authentication supports both PSK and ECC. ### TLS PSK info structure The TLS PSK info structure comprises the following members: ``` typedef struct net_tls_psk_info_s { uint32_t key_id; uint8_t key[16]; } net_tls_psk_info_s; ``` Member|Description ------|----------- `key_id`|Means that a PSK key ID can be `0x01-0xFFFF`. The storage size is intentionally 32 bits. `key`|Defines a 128-bit PSK key. The 6LoWPAN stack supports two different chain certificate users: - Transport Layer Security (TLS). - Network authentication (PANA, EAP or TLS). ## Ethernet interface bootstrap definition This section defines the Ethernet interface bootstrap. ### IPv6 This enumeration defines the IPv6 bootstrap: ``` typedef enum net_ipv6_mode_e { NET_IPV6_BOOTSTRAP_STATIC, NET_IPV6_BOOTSTRAP_AUTONOMOUS } net_ipv6_mode_e; ``` Parameter|Description ---------|----------- `NET_IPV6_BOOTSTRAP_STATIC`|Means that the application defines the IPv6 prefix. `NET_IPV6_BOOTSTRAP_AUTONOMOUS`|Means that the network defines the IPv6 prefix. ## RF 6LoWPAN interface configure definition This section defines the RF 6LoWPAN interface configuration. ### typedef enum net_6lowpan_mode_e This enumeration defines the different 6LoWPAN bootstrap or device modes: ``` typedef enum net_6lowpan_mode_e { NET_6LOWPAN_BORDER_ROUTER, NET_6LOWPAN_ROUTER, NET_6LOWPAN_HOST, NET_6LOWPAN_SLEEPY_HOST NET_6LOWPAN_NETWORK_DRIVER, NET_6LOWPAN_SNIFFER } net_6lowpan_mode_e; ``` Parameter|Description ---------|----------- `NET_6LOWPAN_BORDER_ROUTER`|Is a root device for 6LoWPAN ND. `NET_6LOWPAN_ROUTER`|Is a router device. `NET_6LOWPAN_HOST`|Is a host device. This is the default setting. `NET_6LOWPAN_SLEEPY_HOST`|Is a sleepy host device. `NET_6LOWPAN_NETWORK_DRIVER`|6LoWPAN radio host device only, no bootstrap. `NET_6LOWPAN_SNIFFER`|Radio sniffer only, no bootstrap. The `NET_6LOWPAN_SLEEPY_HOST` mode support requires MLE protocol support. ### typedef enum net_6lowpan_mode_extension_e This enumeration defines the different 6LoWPAN bootstrap extension modes: ``` typedef enum { NET_6LOWPAN_ND_WITHOUT_MLE, NET_6LOWPAN_ND_WITH_MLE, NET_6LOWPAN_THREAD, NET_6LOWPAN_ZIGBEE_IP } net_6lowpan_mode_extension_e; ``` Parameter|Description ---------|----------- `NET_6LOWPAN_ND_WITHOUT_MLE`|Starts the 6LoWPAN-ND bootstrap without MLE (Mesh link establishment protocol). `NET_6LOWPAN_ND_WITH_MLE`|Starts 6LoWPAN-ND with MLE support. `NET_6LOWPAN_THREAD`|Starts Thread with MLE. `NET_6LOWPAN_ZIGBEE_IP`|Starts 6LoWPAN ZigBee-IP. ### typedef struct network_driver_setup_s This structure defines the different 6LoWPAN radio interface setups: ``` typedef struct { uint16_t mac_panid; uint16_t mac_short_adr; uint8_t beacon_protocol_id; uint8_t network_id[16]; uint8_t beacon_payload_tlv_length; uint8_t *beacon_payload_tlv_ptr; /**< Optional Steering parameters */ } network_driver_setup_s; ``` Member|Description ------|----------- `mac_panid`|Link layer PAN ID. Accepted values are `<0xFFFE`. `mac_short_adr`|Defines the IEEE 802.15.4 Short MAC address. If the value is `<0xFFFE`, it indicates that GP16 addresses are active. `beacon_protocol_id`|Beacon protocol ID. ZigBee reserves the value 2. 6LoWPAN does not define any value for this, you can use any non-reserved value. `network_id`|A 16-byte long network ID. Used in the beacon payload. `beacon_payload_tlv_length`|The length of optional steering parameters. `beacon_payload_tlv_ptr`|A pointer to the optional steering parameters. ### typedef enum net_6lowpan_gp_address_mode_e This enumeration defines the different addressing modes for a network interface. This setting is specific to each interface and is only applicable to a 6LoWPAN interface. ``` typedef enum net_6lowpan_gp_address_mode_e { NET_6LOWPAN_GP64_ADDRESS, NET_6LOWPAN_GP16_ADDRESS, NET_6LOWPAN_MULTI_GP_ADDRESS, } net_6lowpan_gp_address_mode_e; ``` Parameter|Description ---------|----------- `NET_6LOWPAN_GP64_ADDRESS`|Means that the interface will only register a GP64 address. This is the default setting. `NET_6LOWPAN_GP16_ADDRESS`|Means that the interface will only register a GP16 address. `NET_6LOWPAN_MULTI_GP_ADDRESS`|Means that the interface will register both GP16 and GP64 addresses. The default address mode is `NET_6LOWPAN_GP64_ADDRESS`. ### typedef enum net_6lowpan_link_layer_sec_mode_e This enumeration defines the security mode for an interface. This setting is specific to each interface and is only applicable to 6LoWPAN interfaces. ``` typedef enum net_6lowpan_link_layer_sec_mode_e { NET_SEC_MODE_NO_LINK_SECURITY, NET_SEC_MODE_PSK_LINK_SECURITY, NET_SEC_MODE_PANA_LINK_SECURITY, } net_6lowpan_link_layer_sec_mode_e; ``` Parameter|Description ---------|----------- `NET_SEC_MODE_NO_LINK_SECURITY`|Means that the security is disabled at a link layer. This is the default setting. `NET_SEC_MODE_PSK_LINK_SECURITY`|Means that a PSK key defines the link security. `NET_SEC_MODE_PANA_LINK_SECURITY`|Means that PANA network authentication defines the link key. The client must call `arm_pana_client_library_init()` and the border router application `arm_pana_server_library_init()` to initialize the PANA protocol. The PANA Network API could be disabled by some of the stack packets and it is also possible that it only supports client mode. The default setting is `NET_SEC_MODE_NO_SECURITY`. ### typedef struct net_link_layer_psk_security_info_s This structure defines the PSK security information and comprises the following members: ``` typedef struct net_link_layer_psk_security_info_s { uint8_t key_id; uint8_t security_key[16]; } net_link_layer_psk_security_info_s; ``` Member|Description ------|----------- `key_id`|PSK key ID of a link layer. Can be `0x01-0xFF`. `security_key`|Defines the 128-bit PSK key of a link layer. ### typedef struct border_router_setup_s This structure defines the information required to set up a 6LoWPAN border router and comprises the following members: ``` typedef struct border_router_setup_s { uint8_t channel; uint16_t mac_panid; uint16_t mac_short_adr; uint8_t beacon_protocol_id; uint8_t network_id[16]; uint8_t lowpan_nd_prefix[8]; uint16_t ra_life_time; uint32_t abro_version_num; } border_router_setup_t; ``` Member|Description ------|----------- `channel`|Defines the channel used in 802.15.4 radio. Supported values are from 1 to 26. `mac_panid`|Link layer PAN ID. Accepted values are `<0xFFFE`. `mac_short_adr`|Defines IEEE 802.15.4 Short MAC address. If value is `<0xFFFE`, it indicates that GP16 addresses are active. `beacon_protocol_id`|Beacon protocol ID. ZigBee reserves the values from `0` to `2`. 6LoWPAN does not define any value for this, you can use any non-reserved value. `network_id`|A 16-byte long network ID. Used in the beacon payload. `lowpan_nd_prefix`|Defines the ND default prefix, ABRO, DODAG ID, and GP address. `ra_life_time`|Defines the ND router lifetime in seconds. ARM recommends value 180+. `abro_version_num`|Defines the ND ABRO version number (0 when starting a new ND setup). ## General network type definitions This section defines general network layer types defined by the Network API. ### typedef enum net_security_t This enumeration defines the information required to set up an id that represents a network interface and comprises the following parameters: ``` typedef enum net_security_t { NW_NO_SECURITY = 0, NW_SECURITY_LEVEL_MIC32 = 1, NW_SECURITY_LEVEL_MIC64 = 2, NW_SECURITY_LEVEL_MIC128 = 3, NW_SECURITY_LEVEL_ENC = 4, NW_SECURITY_LEVEL_ENC_MIC32 = 5, NW_SECURITY_LEVEL_ENC_MIC64 = 6, NW_SECURITY_LEVEL_ENC_MIC128 = 7 } net_security_t; ``` Parameter|Description ---------|----------- `NW_NO_SECURITY`|Disables network level security. `NW_SECURITY_LEVEL_MIC32`|Enables 32-bit Message Integrity Code (MIC) verification without encoding. `NW_SECURITY_LEVEL_MIC64`|Enables 64-bit MIC verification without encoding. `NW_SECURITY_LEVEL_MIC128`|Enables 128-bit Message Integrity Code (MIC) verification without encoding. `NW_SECURITY_LEVEL_ENC`|Enables AES encoding without MIC. `NW_SECURITY_LEVEL_ENC_MIC32`|Enables AES encoding with 32-bit MIC. `NW_SECURITY_LEVEL_ENC_MIC64`|Enables AES encoding with 64-bit MIC. `NW_SECURITY_LEVEL_ENC_MIC128`|Enables AES encoding with 128-bit MIC.
markdown
#include "core/Command.h" #include "core/CommandSender.h" #include "util/ClassInfo.h" using namespace BeeeOn; using namespace std; Command::Command(): m_sendingHandler(NULL) { } string Command::name() const { return ClassInfo::forPointer(this).name(); } Command::~Command() { } void Command::setSendingHandler(CommandHandler *sender) { m_sendingHandler = sender; } CommandHandler* Command::sendingHandler() const { return m_sendingHandler; } string Command::toString() const { return name(); } Result::Ptr Command::deriveResult(Answer::Ptr answer) const { return new Result(answer); }
cpp
{"ast":null,"code":"exports['az'] = require('./locales/az');\nexports['cz'] = require('./locales/cz');\nexports['de'] = require('./locales/de');\nexports['de_AT'] = require('./locales/de_AT');\nexports['de_CH'] = require('./locales/de_CH');\nexports['en'] = require('./locales/en');\nexports['en_AU'] = require('./locales/en_AU');\nexports['en_BORK'] = require('./locales/en_BORK');\nexports['en_CA'] = require('./locales/en_CA');\nexports['en_GB'] = require('./locales/en_GB');\nexports['en_IE'] = require('./locales/en_IE');\nexports['en_IND'] = require('./locales/en_IND');\nexports['en_US'] = require('./locales/en_US');\nexports['en_au_ocker'] = require('./locales/en_au_ocker');\nexports['es'] = require('./locales/es');\nexports['es_MX'] = require('./locales/es_MX');\nexports['fa'] = require('./locales/fa');\nexports['fr'] = require('./locales/fr');\nexports['fr_CA'] = require('./locales/fr_CA');\nexports['ge'] = require('./locales/ge');\nexports['id_ID'] = require('./locales/id_ID');\nexports['it'] = require('./locales/it');\nexports['ja'] = require('./locales/ja');\nexports['ko'] = require('./locales/ko');\nexports['nb_NO'] = require('./locales/nb_NO');\nexports['nep'] = require('./locales/nep');\nexports['nl'] = require('./locales/nl');\nexports['pl'] = require('./locales/pl');\nexports['pt_BR'] = require('./locales/pt_BR');\nexports['ru'] = require('./locales/ru');\nexports['sk'] = require('./locales/sk');\nexports['sv'] = require('./locales/sv');\nexports['tr'] = require('./locales/tr');\nexports['uk'] = require('./locales/uk');\nexports['vi'] = require('./locales/vi');\nexports['zh_CN'] = require('./locales/zh_CN');\nexports['zh_TW'] = require('./locales/zh_TW');","map":null,"metadata":{},"sourceType":"script"}
json
<filename>chapters/12.1.html<gh_stars>0 <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>Chapter 12.1</title> <link rel="stylesheet" href="../style.css"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script> window.onload=function(){ setTimeout(function(){ if(screen.width<680){ var wrapper=document.getElementById('wrapper'); var zoom=screen.width/680; wrapper.style.zoom = zoom; document.body.style.width=screen.width+'px'; } }); }; </script> </head> <body> <div id="wrapper"> <div class="problem"> <div class="problem-title" id="problem-1E"> <a href="#problem-1E">1E</a> </div> <div class="problem-content"> <!DOCTYPE html> <html> <head> <title></title> </head> <body> <img src="../imgs/9c20fdbeb8ca6398bbdcc94be37a423b0f919a70.png"> <hr> <img src="../imgs/c07a6954d146c447e68e58f19c9b93f3bc5fef9e.png"> <hr> <img src="../imgs/990d67cf2ef5f84b50a33ecde10bc019a6400944.png"> <hr> <img src="../imgs/a5dc6f0325340d467f37535dd25dca6f72fa85c1.png"> </body> </html> </div> </div> <div class="problem"> <div class="problem-title" id="problem-2E"> <a href="#problem-2E">2E</a> </div> <div class="problem-content"> <!DOCTYPE html> <html> <head> <title></title> </head> <body> <img src="../imgs/83c7c01e1853c8edaaf08abb788a4afbb8e5f834.png"> <hr> <img src="../imgs/d831468fd7e0acb9e58e6d628d20a84a82656536.png"> </body> </html> </div> </div> <div class="problem"> <div class="problem-title" id="problem-3E"> <a href="#problem-3E">3E</a> </div> <div class="problem-content"> <!DOCTYPE html> <html> <head> <title></title> </head> <body> <div class="answer"> <p>The following is the non-recursive algorithm to perform in-order tree traversal on a binary search tree. The following algorithm uses a stack as an auxiliary data structure in order to accomplish the in-order transversal.</p> <p>INORDER-TREE-TRAVERSE (<i>T</i>)</p> <p>//initialize an empty Stack</p> <p>1. <i>A</i>= <i>Empty Stack</i>;</p> <p>//put the root of tree into current node variable.</p> <p>2. <i>Crnt_node</i> =<i>T.root</i></p> <p>// while loop is used to check the value of current node.</p> <p>3. <b>While</b> <i>Crnt_node</i> != <i>NIL</i> <b>or</b> <i>Stack-Empty</i> (<i>A</i>)= <i>FALSE</i></p> <p>//if the current node value is not null</p> <p>4. <b>if</b> <i>Crnt_node</i> != <i>NIL</i> then</p> <p>//insert the value of current node into stack <i>A</i></p> <p>5. PUSH (<i>A</i>, <i>Crnt_node</i>);</p> <p>// store the left child of tree into current node</p> <p>6. <i>Crnt_node</i>=<i>Crnt_node</i>. <i>left</i></p> <p>7. <b>else</b></p> <p>// retrieve the element from stack and store it into current node.</p> <p><i>Crnt_node</i> =POP (<i>A</i>)</p> <p>//display the current value</p> <p>8. Display (<i>Crnt_node</i>)</p> <p>//store the right child of tree into current node.</p> <p>9. <i>Crnt_node</i> = <i>Crnt_node</i>. <i>right</i></p> </div> <hr> <div class="answer"> <p><b>Explanation of Algorithm:</b></p> <p>• The algorithm starts from the <i>Crnt_node</i>, which contains the root node initially.</p> <p>• In line 3, while loop is used to traverse the left nodes (left children) from the root.</p> <p>• In line 4-6, <i>Crnt_node</i> is pushed into stack if the <i>Crnt_node</i> is not <i>NIL</i>.</p> <p>• In line 7-9, if <i>Crnt_node</i> is <i>NIL</i> , <i>Crnt_node</i> is displayed and starts traversing right children by updating <i>Crnt_node</i> with its right child.</p> <p>• While loop exits when the <i>Crnt_node</i> is <i>NIL</i> and the stack is empty.</p> <p><b>Since the above algorithm traversing all the nodes in the binary search tree, if</b> <i><b>n</b></i> <b>is the number of nodes in the binary search tree, the above algorithm takes</b> <b><img src= "../imgs/c30e9eac86a492e0e43a20b7423112f17e7d7fce.png"></b> <b>time to traverse.</b></p> </div> <hr> <div class="answer"> <p>The following is the non-recursive algorithm to perform in-order tree traversal on a binary search tree without using stack as an auxiliary data structure, but using a pointer called previous(<i>Prev</i>). Previous pointer is used to compare with current node.</p> <p>INORDER-TREE-TRAVERSE (<i>T</i>)</p> <p>//put the root of tree into current node variable.</p> <p>1. <i>Crnt_node=T</i>.<i>root</i></p> <p>// while loop is used to check the value of current node.</p> <p>2. <b>While</b> <i>crnt_node</i> != <i>NIL</i></p> <p>//if the current node value is not null</p> <p>3. <b>if</b> <i>crnt_node</i>.<i>left</i> = <i>NIL</i></p> <p>//display the current value</p> <p>4. Display (<i>Crnt_node</i>)</p> <p>//add the right child of tree into current node variable</p> <p>5. <i>Crnt_node</i> = <i>Crnt_node</i>. <i>right</i></p> <p>6. <b>else</b></p> <p>//add the left child of current node into previous node variable.</p> <p>7. <i>Prvs_node</i> = <i>Crnt_node</i>. <i>left</i></p> <p>//while loop is used to check the value of previous node and compare previous</p> <p>//node with current node</p> <p>8. <b>While</b> <i>Prvs_node</i> != <i>NIL</i> <b>and</b> <i>Prvs_node.right</i> != <i>Crnt_node</i></p> <p>//add right child of previous node into previous node variable</p> <p>9. <i>Prvs_node</i> =<i>Prvs_node.right</i></p> <p>//check the value of right child of previous node.</p> <p>10. <b>if</b> <i>Prvs_node.right</i> = <i>NIL</i></p> <p>//store the current node value into previous node</p> <p>11. <i>Prvs_node.right</i> =<i>Crnt_node</i></p> <p>12. <i>Crnt_node</i> = <i>Crnt_node.left</i></p> <p>13. <b>else</b></p> <p>//put null into right child of previous node</p> <p>14. <i>Prvs_node.right</i> = <i>NIL</i></p> <p>15. Display (<i>Crnt_node</i>)</p> <p>//store the right child of tree into current node.</p> <p>16. <i>Crnt_node</i> = <i>Crnt_node</i>. <i>right</i></p> </div> <hr> <div class="answer"> <p><b>Explanation of Algorithm:</b></p> <p>• In line 1, algorithm initializes current node with root.</p> <p>• in line 2, “While” loop runs until the C<i>rnt_node</i> is NIL<i>.</i></p> <p>• In line 3 -7, if left child of current node is <i>NIL,</i> then the <i>Crnt_node</i> is displayed and updates the <i>Crnt_node</i> with the right child of the current node. Otherwise updates the <i>Prvs_node</i> with the left child of current node.</p> <p>• in line 8, “While” loop is used to find the previous node(or predecessor) to <i>Crnt_node</i>.</p> <p>• In line 10-12, if the right child of previous node is <i>NIL,</i> then assign current node as right child of previous node and assign left child of the current node to <i>Crnt_node</i> variable.</p> <p>• In line 13-16, the tree is restored to original .</p> <p><b>The above algorithm also takes</b> <b><img src= "../imgs/c30e9eac86a492e0e43a20b7423112f17e7d7fce.png"></b> <b>time to traverse the binary search tree with</b> <i><b>n</b></i> <b>nodes.</b></p> </div> </body> </html> </div> </div> <div class="problem"> <div class="problem-title" id="problem-4E"> <a href="#problem-4E">4E</a> </div> <div class="problem-content"> <!DOCTYPE html> <html> <head> <title></title> </head> <body> <img src="../imgs/761a9047ba5b5303f9e2f96b249f08f38a342b10.png"> <hr> <img src="../imgs/827690434f45e753a93e003ffef15b531a898770.png"> <hr> <img src="../imgs/ac1c3edd6b825c2b5d7d3c0ede994d27ee274110.png"> </body> </html> </div> </div> <div class="problem"> <div class="problem-title" id="problem-5E"> <a href="#problem-5E">5E</a> </div> <div class="problem-content"> <!DOCTYPE html> <html> <head> <title></title> </head> <body> <img src="../imgs/8b6a7477936e717f5d3da241dcfc27f78d1728f9.png"> </body> </html> </div> </div> </div> <div class="info"> Chegg Rip, Introduction to Algorithms, 3rd Edition. [RipVer 0.1] <a href="../index.html"> (index) </a> </div> <a class="return-float-btn" href="../index.html"> <span class="arrow-left icon"/> </a> </body> </html>
html
Tuesday November 22, 2016, Founders often ask me when the right time to bring the HR function into the company is. Over the years, having worked with over 75 startups, I am yet to find a formula or equation which answers that. What shines through very clearly acrossthe diverse set of founders and businesses is that the founder who starts thinking about HR and people matters right at the beginning is more likely to find success. Yes, that early! Two scenarios come to my mind —one, my first meeting with Yogesh Mahansuria, Founder of Alliance Tire Group (www.atgtire.com) and second, with Neeraj Gupta, Founder of Meru Cabs (www.merucabs.com ) In 2006, when I first met Yogesh, it was in an industrial shed in Thane–Belapur industrial area near Mumbai. Yogesh, at that time, was putting together his plans to acquire a global tyre business and wanted to talk to me about how companies drive productivity in people. In 2007, Yogesh, with over $100 million funded by Warburg Pincus, acquired ATG, a company headquartered in Israel. In 2013, the Warburg Pincus investment yielded four times return when they sold their stake to KKR at an enterprise value of $650 million. In 2016, Yokohama bought the KKR stake for $1.2 billion. Quite a success story — ATG has done a lot of things right and one of them was thinking about talent management right from Day 0. My first meeting with Neeraj was in a small mezzanine room above a ramshackle garage in a Mumbai suburb. Neeraj was working on the plans for introducing a taxi service model totally new to India. Radio taxi businesses were being researched, the offering was not firmed up, the logo was WIP, and we were discussing talent management. Even though there was no team in place, the founder was thinking about the people aspect! He was wearing the cap of the HR leader while building his plans! In all startups, it is the founder who is the first HR leader of the company. At this point, the headcount is in single digits, the team is close-knit, and every single person interacts closely with the founder/s. The only HR priority at this point is payroll. As the company moves post the proof-of-concept stage, and the team grows, HR professionals are inducted. A thumb rule I have found to be effective in determining the right time to get a formal HR team in place (beyond recruiters) is when the ratio of founders to employees goes beyond 20. If there are threefounders, a headcount of over 60 would require a formal HR function. In other words, once the team grows to a size where the founder is not closely working with all members, demonstrating values and stances in person, an HR team — onethat cantake ownership of translating the vision, values, andbeliefs into operating practices, policies, and ways of working — becomes essential. Also, a company’s HR capability influences company valuations significantly. Valuations are influenced by the strength and stability of the team, clear, defined roles and responsibilities, transparent goal setting, and the systemic capability to meet targets. For the founders to take advantage of these aspects, they need to go beyond operational HR and ensure they have an owner for HR value building among their core team too. Looking at it from another dimension, in the pre-seed and seed stages, the priority is survival, the environment chaotic,and the future uncertain.Having reached the road towards Series A funding, it’s time to do a deep dive into the intangible aspects of organisation building and ensure thatthe organisation you are creating resonates with the stated values and beliefs. Going ahead from here you will need strategic, tactical, and operational HR. This is when a formal HR function, going beyond hiring and payroll, becomes essential. By and large, the HR team available to the company even in the Series A stage mostly includes recruiters and HR administrators, not HR professionals who can take on the responsibility of capability building and organisational growth. Often, the HR leader is among the last functional heads to be inducted. The trap founders fall into is retaining the HR portfolio with them. Given the business pressures and priorities on their table, they are unable to devote the right mindspace to HR matters. As a result, the organisational culture evolves on its own, unguided and unsupported by formal frameworks. So here are the parameters I would use to help assess the timetable of HR capabilities in your organisation— whether outsourced or staffed internally. (Disclaimer: The views and opinions expressed in this article are those of the author and do not necessarily reflect the views of YourStory.)
english
The post is about my day trip to Agra, visit to Taj Mahal and Agra Fort. Agra is a major tourist destination in India famous for its Mughal Era Monuments like over the top tombstone Taj Mahal, Agra Fort, and Fatehpur Sikri, all of which are UNESCO World Heritage Sites. Millions of visitors come to India, many only to visit the which is amongst the New Seven Wonders of the World List. We took the Gatimaan Express train at 8:10 am, with a return ticket later that evening from the same train. We reached around 10 am at Agra Cantt railway station, from where we took an Ola cab, whose driver finally took us to the Taj Mahal. After, taking the Entrance Ticket, we stood in the queue for security check. Here, apart from the ticket, the ticket checker asked for my Aadhaar Card, as in just to check that whether I am an Indian or a Foreigner? And I whispered in Hindi, Bhai ek Indian bhi Gaura ho Sakta hai (Bro, an Indian too can be White). He smiled and allowed me to pass the gate. After a few minutes of walking, we reached the Darwaza-I Rauza (Gate of the Mausoleum), which is made up of red sandstone and impressive in itself. Also Read: 5 Unforgettable Moments in Kanyakumari (Cape Comorin) From here, the view of the Taj Mahal was the same as we have seen many times in books, or on the internet. In between, to capture the moment, We took so many pictures. Before reaching the monument, we wore shoe covers to prevent it from scuffing and damage. One thing you should know here is that you are not allowed to take pictures inside the monuments. We went inside and saw the tombs of the famous couple, Mumtaz Mahal and her husband Mughal Emporer, Shah Jahan. About Taj Mahal, I felt like Shah Jahan was saying to me the famous one-liner of Jaime Lannister in Game of Thrones, "The things I do for love". Though, I do like Peter Dinklage (Tyrion Lannister) and Sophie Turner (Sansa Stark) from the show. For that moment, I thought that I should also make such a beautiful mausoleum for the love of my life, but my brain reminded me of two things. First, you do need at least a girlfriend or a wife for that and second, the famous dialogue of Bobby "Axe" Axelrod from Billions, "A lot of guys watch Bruce Lee movies, doesn't mean they can do karate". I instantly controlled my emotions and move forward. After coming out of the monument, we decided to take our leave from here and we went to Agra Fort. Around 1:00 am we reached the Agra Fort, after taking the Entrance ticket we booked a Guide. Here, we went to : Jahangiri Mahal Khas Mahal Musamman Burj (An Octagonal Tower) Diwan-I-Khas (Hall of Private Audience) Diwan-I-Aam (Hall of Public Audience) Jahangiri Mahal is the main attraction of the Agra Fort. It was built by Mughal Emporer Akbar for the residence of his wives. is the place were the Shah Jahan lived with his wife Mumtaz Mahal. From the lattice windows here, you can see the Taj Mahal and the river. Musamman Burj is basically a tower made in an octagonal shape. It is the Jail in which Shah Jahan was captive by his own son, Aurangzeb. In Diwan-I-Khas, Shah Jahan used to meet dignitaries and foreign ambassadors. In Diwan-I-Aam he used to meet officials and commoners and listened to the petitioners. Due to the Scarcity of time, we skipped the visit to Fatehpur Sikri. Apart from these three UNESCO world heritage sites, amongst Indian, Agra is famous for its Petha (a translucent soft candy made up from ash Gourd) and Nuthouse. Fun Fact!! After visiting Agra Fort, we went to a nearby restaurant and took a meal. From here, we again went to Agra Cantt railway station and took Gatimaan Express train. Around, 7:30 pm, we reached Hazrat Nizamuddin railway station. It was a nice experience of getting a glimpse of India's rich history.
english
import React, { Dispatch, SetStateAction, useEffect, useState } from 'react'; import { Route, Routes } from 'react-router-dom'; import { Layout } from './routes'; // const Product = React.lazy(() => import(/* webpackChunkName: "product" */ './routes/product')); const Products = React.lazy(() => import(/* webpackChunkName: "products" */ './routes/Products')); const Home = () => <div>Home</div>; export interface Category { name: string; remedies: string[]; } export interface Constraints { pharmacies: { [slug: string]: { name: string }; }; sections: { remedies: { name: string; categories: { [slug: string]: Category; }; }; }; } const App = () => { const [constraints, setConstraints]: [Constraints, Dispatch<SetStateAction<Constraints>>] = useState({ pharmacies: {}, sections: { remedies: { name: 'Remedios', categories: {} }, }, }); // fetch global data on initial render useEffect(() => { const fetchConstraints = async () => { const response = await fetch('https://data.drgato.com/constraints.json'); setConstraints(await response.json()); }; fetchConstraints(); }, []); return ( <Routes> <Route path="/" element={<Layout constraints={constraints} />}> <Route index element={<Home />} /> <Route path="remedios" element={ <React.Suspense fallback={<>...</>}> <Products section="remedies" constraints={constraints} /> </React.Suspense> }/> </Route> </Routes> ); }; export default App;
typescript
Shoaib Ibrahim and Dipika Kakar recently embraced parenthood. They also treated their followers to the first photo of their son. In the picture, the couple radiates pure joy as they are holding Ruhaan close to them. Popular television actor Shoaib Ibrahim is currently basking in the joy of fatherhood. He recently welcomed his first child on June 21. The baby boy is named Ruhaan. The doting father has been sharing glimpses of his journey as a father. Besides personal life, the actor also made headlines for making a comeback to TV last year after a three-year hiatus. As per the reports, his show titled Ajooni recently completed a year. To mark the occasion, the actor shared an extremely adorable picture with his son Ruhaan on Instagram. Sharing the adorable picture with Ruhaan, Shoaib Ibrahim wrote, "When this journey started a year ago... kabhinahi socha tha ki itni special tarah se wish milega on completing a year... One year of Rajveer Bagga... One year of Ajooni!" For those unversed, the show ‘Ajooni’ features an outstanding ensemble cast of Shoaib Ibrahim and Ayushi Khurana. The serial features Ajooni, a modern and bold woman who knows how to defend her rights. She falls in love with Rajveer whose family is deeply traditional. Needless to mention, the audience has been showering the on-screen couple with love and blessings for their performances in the serial. Shoaib Ibrahim and Dipika Kakar recently embraced parenthood. They also treated their followers to the first photo of their son. In the picture, the couple radiates pure joy as they are holding Ruhaan close to them. Dipika, in the caption, wrote, "RUHAAN. Thank you for keeping him in your prayers." On the work front, Shoaib Ibrahim is currently busy with his show Ajooni. Meanwhile, Dipika was last seen in Kahaan Hum Kahaan Tum. Stay tuned to BollywoodLife for the latest scoops and updates from Bollywood, Hollywood, South, TV and Web-Series. Click to join us on Facebook, Twitter, Youtube and Instagram. Also follow us on Facebook Messenger for latest updates.
english
Investing in property through a limited company can carry a number of advantages for the owner or owners, and a growing number of landlords are turning to this structure. Many professional Landlords, particularly those with large portfolios or those who co-own properties, use a Limited company structure to make and manage their investments. But in recent years, due to certain tax changes affecting the buy-to-let space, this method of owning an investment property has become even more popular. The latest research from Paragon Bank has now revealed that almost three quarters (74%) of UK landlords surveyed plan on using such a company structure when they come to make their next investment in the coming 12 months. This is the highest level recorded by the BVA BDRC tracker. It is also a relatively steep rise from the 62% of landlords who said they planned to purchase in this way in the first quarter of this year. The data also shows that the average number of properties held per landlord in Q2 was 12.3, compared with 11.7 in Q1. Why use a limited company? - Income tax: If you invest in property using a limited company, rather than as an individual, you will be subject to different tax rules. For example, while an individual higher rate tax payer may be subject to 40% tax on a portion of their earnings, including rental income, this falls to 19-25% corporation tax for limited companies. - Mortgage interest relief: Landlords who have been operating in the UK market for a number of years would have once been able to claim 100% of their mortgage interest payments against their income. This has now been phased out for individual owners under Section 21, but limited companies can still claim this relief. - Financing options: Paragon points out that while most lenders set interest coverage ratios at 145% for higher-rate taxpayers, applications through limited companies only require ratios of 125%. - Greater borrowing: Often, professional landlords operating through a company can secure higher loan amounts than individual landlords, which can open up a wider range of investment opportunities. Due to the above factors and other aspects of this investment method, many landlords find that their profits are stronger when they own property via a limited company. However, as with any major business or financial decision, it is important to seek advice and gain a full picture of whether this option is right for you. For example, it can be very costly to move properties you already own into a limited company, as you would incur costs such as stamp duty and legal fees. Further to this, those landlords who are not higher taxpayers may not see the same benefits as those in the top tax bracket, meaning that the administrative costs of setting up and running one may outweigh any increase in profits or tax benefits. As Louisa Sedgwick, commercial director of mortgages at Paragon Bank, points out, activity in this space has been ramping up over the course of 2023. This is likely due to factors such as rising mortgage rates and other costs leading to landlords looking at how they can continue to maximise their investments. “Holding rental property within a Limited Company structure has been growing in popularity since the mortgage interest relief changes introduced by the government in 2017, but it has certainly accelerated in the past year,” she says. At BuyAssociation, our team of property investment consultants are experienced in dealing with investors who use limited company structures. We can also put you in touch with one of our independent partners if you’d like more information. Get in touch today to find out more, or to register your interest in UK property investment opportunities.
english
<reponame>ahmadchan/mysite --- title: "The BioNLP-SADI" excerpt: "BioNLP-SADI An Interoperable framework for BioNLP SADI web service" collection: portfolio --- </p> <div align="center"> <iframe src="https://www.slideshare.net/slideshow/embed_code/key/9PgkxbLuz3tA4Y" width="659" height="401" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" allowfullscreen=""></iframe> </div>
html
[ { "Id": "1015070", "ThreadId": "436589", "Html": "Hi Team,<br />\n<br />\nI am very new to PHPExcel, Like to know this script supports importing the excel sheet data to a mysql.<br />\n<h2>Please guide me.</h2>\nArvind<br />\n", "PostedDate": "2013-03-14T01:51:00.607-07:00", "UserRole": null, "MarkedAsAnswerDate": null }, { "Id": "1015087", "ThreadId": "436589", "Html": "Have you looked at any of the documentation yet, particularly the Reade documentation?<br />\n<br />\nPHPExcel won't write a spreadsheet to a database for you; but it will let you write a script that reads the file, loop through each row of each worksheet, and build an SQL insert statement from the cell data that you can then insert into your database<br />\n", "PostedDate": "2013-03-14T02:30:18.233-07:00", "UserRole": null, "MarkedAsAnswerDate": null } ]
json
<gh_stars>1-10 [{"postal_code":"37750","place_name":"<NAME>onio","place_type":"Colonia","county":"San Miguel de Allende","state":"Guanajuato","city":"San Miguel de Allende"},{"postal_code":"37750","place_name":"<NAME>","place_type":"Fraccionamiento","county":"San Miguel de Allende","state":"Guanajuato","city":"San Miguel de Allende"}]
json
Bharath can afford to smile from ear to ear. The young hero has been having a whale of a time of late. His recent release Kadhal is doing well, while his Chellamae has completed 100 days run in theatres all over the State. Attributing all his success to director Shankar, who gave him a break in Boys, Bharath says it helped to start with a taskmaster like Shankar. "Playing a negative hero in Chellamae or a low-class mechanic in Kadhal were never easy. I had to mould myself for the characters that were made possible thanks to the directors (GandhiKrishna and Balaji Sakthivel) respectively. And my grounding with Shankar came very handy". Bharath is currently acting in a movie titled February 14 to be directed by a Shankar's associate Ho Chi Min. It will be produced Chandrasekhar, who made Sullan. Follow us on Google News and stay updated with the latest!
english
{"month": "9", "num": 1584, "link": "", "year": "2015", "news": "", "safe_title": "Moments of Inspiration", "transcript": "<NAME>\n[[A man sitting under a tree is hit in the head by a falling apple.]]\n<<BONK>>\nNewton: Ow!\n\n[[Newton rubs his sore head.]]\nNewton: Aha!\n\nLise Meitner\n[[Someone throws a ball towards a woman, and it goes over her head.]]\nBall-thrower: Hey Lise, think fast!\n<<CRASH>>\n\n[[The ball has hit one of her porcelain model atoms, splitting it in half. Lise surveys the damage.]]\nLise: Oh no! My collection of porcelain atoms! -- \n...Hmm.\n\n\n<NAME>\n[[<NAME> and his wife are watching their four children drinking soda. Two drink through straws while two have beaks and are having trouble drinking.]]\nMrs. Darwin: I gave our kids soda, but the ones with beaks always have trouble drinking it.\nMr. Darwn: I've noticed that...\n\nAlbert Einstein\n[[A train passes by in the background while Al<NAME>instein and another person look on from the foreground.]]\nEinstein: I wish your twin brother would stop shining lights at us from that train. I can barely see my clock! - \n...Wait!\n\n\n{{Title text: Charles, I just talked to John and Mildred, who run that company selling seeds and nuts, and their kids with MOUTHS are starving!}}", "alt": "Charles, I just talked to John and Mildred, who run that company selling seeds and nuts, and their kids with MOUTHS are starving!", "img": "https://imgs.xkcd.com/comics/moments_of_inspiration.png", "title": "Moments of Inspiration", "day": "30"}
json
<reponame>shades2/hedera-sdk-go // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.1 // protoc v3.17.3 // source: proto/query_header.proto package proto import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) // //The client uses the ResponseType to indicate that it desires the node send just the answer, or both the answer and a state proof. It can also ask for just the cost and not the answer itself (allowing it to tailor the payment transaction accordingly). If the payment in the query fails the precheck, then the response may have some fields blank. The state proof is only available for some types of information. It is available for a Record, but not a receipt. It is available for the information in each kind of *GetInfo request. type ResponseType int32 const ( // Response returns answer ResponseType_ANSWER_ONLY ResponseType = 0 // (NOT YET SUPPORTED) Response returns both answer and state proof ResponseType_ANSWER_STATE_PROOF ResponseType = 1 // Response returns the cost of answer ResponseType_COST_ANSWER ResponseType = 2 // (NOT YET SUPPORTED) Response returns the total cost of answer and state proof ResponseType_COST_ANSWER_STATE_PROOF ResponseType = 3 ) // Enum value maps for ResponseType. var ( ResponseType_name = map[int32]string{ 0: "ANSWER_ONLY", 1: "ANSWER_STATE_PROOF", 2: "COST_ANSWER", 3: "COST_ANSWER_STATE_PROOF", } ResponseType_value = map[string]int32{ "ANSWER_ONLY": 0, "ANSWER_STATE_PROOF": 1, "COST_ANSWER": 2, "COST_ANSWER_STATE_PROOF": 3, } ) func (x ResponseType) Enum() *ResponseType { p := new(ResponseType) *p = x return p } func (x ResponseType) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (ResponseType) Descriptor() protoreflect.EnumDescriptor { return file_proto_query_header_proto_enumTypes[0].Descriptor() } func (ResponseType) Type() protoreflect.EnumType { return &file_proto_query_header_proto_enumTypes[0] } func (x ResponseType) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Use ResponseType.Descriptor instead. func (ResponseType) EnumDescriptor() ([]byte, []int) { return file_proto_query_header_proto_rawDescGZIP(), []int{0} } // //Each query from the client to the node will contain the QueryHeader, which gives the requested response type, and includes a payment transaction that will compensate the node for responding to the query. The payment can be blank if the query is free. type QueryHeader struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Payment *Transaction `protobuf:"bytes,1,opt,name=payment,proto3" json:"payment,omitempty"` // A signed CryptoTransferTransaction to pay the node a fee for handling this query ResponseType ResponseType `protobuf:"varint,2,opt,name=responseType,proto3,enum=proto.ResponseType" json:"responseType,omitempty"` // The requested response, asking for cost, state proof, both, or neither } func (x *QueryHeader) Reset() { *x = QueryHeader{} if protoimpl.UnsafeEnabled { mi := &file_proto_query_header_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *QueryHeader) String() string { return protoimpl.X.MessageStringOf(x) } func (*QueryHeader) ProtoMessage() {} func (x *QueryHeader) ProtoReflect() protoreflect.Message { mi := &file_proto_query_header_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use QueryHeader.ProtoReflect.Descriptor instead. func (*QueryHeader) Descriptor() ([]byte, []int) { return file_proto_query_header_proto_rawDescGZIP(), []int{0} } func (x *QueryHeader) GetPayment() *Transaction { if x != nil { return x.Payment } return nil } func (x *QueryHeader) GetResponseType() ResponseType { if x != nil { return x.ResponseType } return ResponseType_ANSWER_ONLY } var File_proto_query_header_proto protoreflect.FileDescriptor var file_proto_query_header_proto_rawDesc = []byte{ 0x0a, 0x18, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x74, 0x0a, 0x0b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x2c, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x37, 0x0a, 0x0c, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x2a, 0x65, 0x0a, 0x0c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x41, 0x4e, 0x53, 0x57, 0x45, 0x52, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x41, 0x4e, 0x53, 0x57, 0x45, 0x52, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x50, 0x52, 0x4f, 0x4f, 0x46, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x43, 0x4f, 0x53, 0x54, 0x5f, 0x41, 0x4e, 0x53, 0x57, 0x45, 0x52, 0x10, 0x02, 0x12, 0x1b, 0x0a, 0x17, 0x43, 0x4f, 0x53, 0x54, 0x5f, 0x41, 0x4e, 0x53, 0x57, 0x45, 0x52, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x50, 0x52, 0x4f, 0x4f, 0x46, 0x10, 0x03, 0x42, 0x4b, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x68, 0x65, 0x64, 0x65, 0x72, 0x61, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2f, 0x68, 0x65, 0x64, 0x65, 0x72, 0x61, 0x2d, 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_proto_query_header_proto_rawDescOnce sync.Once file_proto_query_header_proto_rawDescData = file_proto_query_header_proto_rawDesc ) func file_proto_query_header_proto_rawDescGZIP() []byte { file_proto_query_header_proto_rawDescOnce.Do(func() { file_proto_query_header_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_query_header_proto_rawDescData) }) return file_proto_query_header_proto_rawDescData } var file_proto_query_header_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_proto_query_header_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_proto_query_header_proto_goTypes = []interface{}{ (ResponseType)(0), // 0: proto.ResponseType (*QueryHeader)(nil), // 1: proto.QueryHeader (*Transaction)(nil), // 2: proto.Transaction } var file_proto_query_header_proto_depIdxs = []int32{ 2, // 0: proto.QueryHeader.payment:type_name -> proto.Transaction 0, // 1: proto.QueryHeader.responseType:type_name -> proto.ResponseType 2, // [2:2] is the sub-list for method output_type 2, // [2:2] is the sub-list for method input_type 2, // [2:2] is the sub-list for extension type_name 2, // [2:2] is the sub-list for extension extendee 0, // [0:2] is the sub-list for field type_name } func init() { file_proto_query_header_proto_init() } func file_proto_query_header_proto_init() { if File_proto_query_header_proto != nil { return } file_proto_transaction_proto_init() if !protoimpl.UnsafeEnabled { file_proto_query_header_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QueryHeader); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_proto_query_header_proto_rawDesc, NumEnums: 1, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, GoTypes: file_proto_query_header_proto_goTypes, DependencyIndexes: file_proto_query_header_proto_depIdxs, EnumInfos: file_proto_query_header_proto_enumTypes, MessageInfos: file_proto_query_header_proto_msgTypes, }.Build() File_proto_query_header_proto = out.File file_proto_query_header_proto_rawDesc = nil file_proto_query_header_proto_goTypes = nil file_proto_query_header_proto_depIdxs = nil }
go
Australian captain Michael Clarke heaped lavish praises on Ryan Harris, rating the pacer as equal to any fast bowler with whom he has played. Australian captain Michael Clarke heaped lavish praises on Ryan Harris, rating the pacer as equal to any fast bowler with whom he has played. ”We get Ryan Harris back, who is as good a fast bowler as I have played with through my career, and he’s had a lot of success, so I’m really confident our attack, whether we go with three quicks or four quicks, can do a really good job,” Clarke was quoted saying in Brisbane Times. ”I think these conditions are obviously going to suit fast bowling, especially on day one, and the new ball is going to be an important part of this match the whole way through. Harris has taken 35 wickets at an average of 21 in his eight Tests. He also took nine wickets in the Perth victory over England last summer. ”Ryano bowls high 140 kilometres an hour and runs in hard so like any fast bowler we would like to see him get some momentum and play for a long period of time,” Clarke said. ”In series like this with back-to-back Test matches there is always extra strain on the guys. I would love to see Ryano play every Test match now for the rest of his career. Who knows how long that’s going to go for?
english
<filename>cli_app/engine/firestore_records_handler.py import datetime import os import sys from google.cloud import firestore from google.api_core.exceptions import ServiceUnavailable from .log_helper import logger from .retry_decorator import retry sys.path.append(os.getcwd()) cred_json = os.getenv('GOOGLE_APPLICATION_CREDENTIALS') logger.info("Reading from " + cred_json) db = firestore.Client() posts_ref = db.collection('posts') def save_data(url, title): logger.info(f"Adding {url} for database") posts_ref.add({ 'news_url': url, 'news_title': title, 'timestamp': datetime.datetime.now() }) @retry(ServiceUnavailable, logger=logger) def exists_in_database(url): logger.info(f"Checking if {url} exists in database") news_found_ref = posts_ref.where('news_url', '==', url).limit(1) return next(news_found_ref.get(), None) is not None
python
[{"postal_code":"73968","place_name":"Loma Bonita","place_type":"Colonia","county":"Teziutlán","state":"Puebla","city":""},{"postal_code":"73968","place_name":"El Mirador","place_type":"Colonia","county":"Teziutlán","state":"Puebla","city":""},{"postal_code":"73968","place_name":"Ampliación Sección 23","place_type":"Barrio","county":"Teziutlán","state":"Puebla","city":""},{"postal_code":"73968","place_name":"Ixtahuiata (La Legua)","place_type":"Colonia","county":"Teziutlán","state":"Puebla","city":""}]
json
package com.example.marmatsewa.UserInterface; import androidx.appcompat.app.AppCompatActivity; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.TextView; import android.widget.Toast; import com.example.marmatsewa.AdminInterface.adapter.ServiceAdapter; import com.example.marmatsewa.R; import com.example.marmatsewa.RequestDevelopment.RequestBLL; import com.example.marmatsewa.UserInterface.Adapter.ReviewRatingAdapter; import com.example.marmatsewa.UserInterface.RatingReviewDevelopment.RatingReviewBLL; import com.example.marmatsewa.UserInterface.RatingReviewDevelopment.RatingReviewResponse; import java.util.List; public class user_hiring_page extends AppCompatActivity { private TextView tvGarageNumber; private TextView tvAddress; private TextView tvGarageName; private Button btnHire; private String garageName; private String garage_id; private String feature_id; private String garageAddress; private String featureName; private String phoneNo; private RecyclerView rcReview; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_user_hiring_page); tvGarageNumber = findViewById(R.id.garageNumber); tvAddress = findViewById(R.id.tvAddress); tvGarageName = findViewById(R.id.garageTitle); //hiding rating as it is not implemented ... btnHire = findViewById(R.id.btnHire); rcReview = findViewById(R.id.rcReview); getValuesFromIntentAndSetText(); getReviewsCall(); btnHire.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { postRequestCall(); } }); } private void getReviewsCall() { if (garage_id.isEmpty()) return; RatingReviewBLL ratingReviewBLL = new RatingReviewBLL(garage_id); List<RatingReviewResponse> responseList = ratingReviewBLL.checkGetReviews(); if (responseList == null) { Toast.makeText(this, "No Reviews in DB ...", Toast.LENGTH_SHORT).show(); return; } //setup recycler view ... rcReview.setLayoutManager(new LinearLayoutManager(this)); ReviewRatingAdapter serviceAdapter = new ReviewRatingAdapter(responseList); rcReview.setAdapter(serviceAdapter); } private void getValuesFromIntentAndSetText() { try { garageName = getIntent().getStringExtra("name"); garage_id = getIntent().getStringExtra("garage_id"); feature_id = getIntent().getStringExtra("feature_id"); featureName = getIntent().getStringExtra("feature_name"); phoneNo = getIntent().getStringExtra("garage_phone"); garageAddress = getIntent().getStringExtra("garage_address"); tvGarageNumber.setText(phoneNo); tvGarageName.setText(garageName); tvAddress.setText(garageAddress); } catch (Exception ex) { Toast.makeText(this, "No data fetched from Intent ...", Toast.LENGTH_SHORT).show(); } } private void postRequestCall() { if (getServiceTypesFromSharedPreference().isEmpty()) { Toast.makeText(this, "Service Types value not fetched from shared preference ...", Toast.LENGTH_SHORT).show(); return; } RequestBLL requestBLL = new RequestBLL(feature_id, garage_id, getServiceTypesFromSharedPreference()); if (requestBLL.checkPostRequest()) { Intent i = new Intent(this, userRating.class); i.putExtra("garage_id", garage_id); startActivity(i); } else { Toast.makeText(this, "postRequestCall failed ..", Toast.LENGTH_SHORT).show(); } } private String getServiceTypesFromSharedPreference() { SharedPreferences savedData = getSharedPreferences("USER_REQUEST", Context.MODE_PRIVATE); return savedData.getString("SERVICE_TYPES", ""); } }
java
Amaravati, May 2: The State Government on Sunday has postponed Intermediate examinations taking High court recommendations into consideration. In a statement released by Education Minister Adimulapu Suresh, he stated that the examinations were scheduled to start from May 5, but due to spike Covid cases across the State, the High Court has suggested reconsidering the decision and the government had postponed the examinations. The new dates for conducting inter-examinations will be announced as soon as the pandemic eases. As the Union government didn’t provide clear instructions on conducting Class X and Intermediate examinations, a few states have cancelled the exams and awarded pass certificates for the students. However, a few states went ahead with examinations and awarded grades as per the student's scores. Similarly, the Andhra Pradesh government had also decided to conduct examinations, as both Class X and Intermediate grades play a vital role in students' careers, thus scheduled intermediate examinations from May 5. But with the increasing risk of the pandemic, considering the High Court suggestions, the government had postponed the examinations.
english
<gh_stars>10-100 { "description": "Rename datat", "properties": { "entityTypeName": { "type": "string", "description": "The name of the entity with a field to rename." }, "oldFieldName": { "type": "string", "description": "The old name of the field that is being renamed." }, "newFieldName": { "type": "string", "description": "The new name of the field." } } }
json
{ "id": 6613, "name": "<NAME>", "icon": "ability_warrior_warcry", "description": "Instantly generates 30 to 60 rage.", "castTime": "Instant", "cooldown": "1 min cooldown" }
json
{"peppermint.js":"<KEY>,"peppermint.min.js":"<KEY>,"peppermint.required.css":"sha512-DmP0UKCytTshumI3H3EHQlGW0uWAk+G7nWEdNvDslt+Q2U0ihuzaQGowpQKcMkFA+C3iqAz5j2GZHpZYgWHZlA==","peppermint.required.min.css":"sha512-2Ttv648aGUG<KEY>,"peppermint.suggested.css":"sha512-e/cMY5T0H3TPa9bU/BAOJae5S4zzKSREmSwBgkxduFfjYMwnZb7pkwQAG/kVVD7A8A44IFMfg/Kiq0G0rhEEfQ==","peppermint.suggested.min.css":"sha512-uw<KEY>}
json
Last year's The Old Guard starring Charlize Theron arrived at just the right time. It was July 2020 and, instead of the Marvel and Fast and Furious movies we thought we'd be enjoying, we had nothing. So along came Netflix to the rescue with a not-so-bad action movie with a daft premise about immortal soldiers, based on a comic book by writer Greg Rucka. The result? 74 million households watched it – or, at least, they watched two minutes of it, which is what Netflix counts as a view. This firmly made it one of Netflix's most watched movies ever, and it was followed by immediate sequel talk. Now, Netflix is moving ahead with a sequel, Theron has told Variety, and it's due to film in early 2022. The script has already been written. Alongside Theron's character Andy, the actress confirmed two characters from the first movie will also be returning: Joe (Marwan Kenzari) and Nicky (Luca Marinelli), whose characters had a widely praised gay romantic relationship on-screen. Director Gina Prince-Bythewood previously expressed interest in a trilogy of movies based on The Old Guard comics, so this seems like a move in the right direction. It's unclear when this sequel will arrive, but we wouldn't expect it before the end of 2022. 74 million households is a lot of people, and is more than a third of Netflix's 207.64 million (current) subscribers. The Old Guard was as widely watched as any major blockbuster you can think of – it just happened to be seen at home, and not on the big screen. Netflix is clearly now committed to finding its own franchises that have name recognition. What it doesn't have is a property with a major history, like Marvel or Star Wars or James Bond. So it has to either grow those from scratch, or make big acquisitions. The streaming service has already made sequels to movie hits on the platform – see the likes of the To All The Boys I've Loved Before... movies, or The Babysitter horror comedies. This is a different ball game, though. Netflix is making stuff like The Old Guard, Army of the Dead and the upcoming Chris Evans spy movie The Gray Man because it wants to show it can compete in that same sphere. See also its acquisition of two Knives Out sequels. Netflix isn't trying to replace the cinema experience, but it's clearly trying to be an increasingly competitive alternative. Get the hottest deals available in your inbox plus news, reviews, opinion, analysis, deals and more from the TechRadar team. Samuel is a PR Manager at game developer Frontier. Formerly TechRadar's Senior Entertainment Editor, he's an expert in Marvel, Star Wars, Netflix shows and general streaming stuff. Before his stint at TechRadar, he spent six years at PC Gamer. Samuel is also the co-host of the popular Back Page podcast, in which he details the trials and tribulations of being a games magazine editor – and attempts to justify his impulsive eBay games buying binges.
english
<!DOCTYPE html> <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="fr"> <![endif]--> <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="fr"> <![endif]--> <!--[if IE 8]> <html class="no-js lt-ie9" lang="fr"> <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js" lang="fr"> <!--<![endif]--> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Microsoft job (2017-2018) - <NAME></title> <meta name="description" content="Portfolio de <NAME>"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="../css/normalize.css"> <!-- <link rel="stylesheet" href="css/font-awesome.css"> --> <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.10.1/css/all.css"> <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.10.1/css/v4-shims.css"> <link rel="stylesheet" href="../css/bootstrap.min.css"> <link rel="stylesheet" href="../css/style.css"> <link rel="stylesheet" href="../css/details.css"> <script src="js/main.js"></script> </head> <body> <!--[if lt IE 7]> <p class="browsehappy">Vous utilisez une <strong>ancienne version</strong> de votre navigateur internet. Veuillez <a href="http://browsehappy.com/">mettre à jour votre navigateur</a> pour améliorer l'expérience.</p> <![endif]--> <header> <button type="button" class="btn btn-light"><a href="../index.html#projects"><i class="fas fa-chevron-left"></i> Retour au Portfolio</a></button> <h1>2017 - 2018 : Job étudiant - Microsoft Ambassador</h1> </header> <article class="divInfo"> <p class="info"><i class="far fa-clock"> 153h</i> | <span class="label label-default" style="font-size: 12px;">JOB - Ambassador</span> <p><img src="../img/ms-logo.png" alt="Logo Microsoft" class="infoImg"></p> </article> <article> <div class="jobDetails"> <p><strong><em>Dates sous contrat (10-18h) en 2017 :</em></strong> 1-2-4-5 mars, 1 et 29 avril, 6-13-20 mai, 17-26 juin, 1-8-22 juillet, 7-14-28 octobre, 4-26 novembre. <br><strong><em>Date sous contrat (10-18h) en 2018 :</em></strong> 23 mars. <br><strong><em>Evènements :</em></strong> Copaco (31 aout 2017), Tech Data (14 septembre 2017), WOPS 2017 (11-12 octobre). <br><strong><em>Formations :</em></strong> 12 juillet 2017, 7 septembre 2017, 5 décembre 2017. <br><strong><em>Durée justifiée (EPHEC) :</em></strong> 10h</p> </div> <p>En cherchant un job étudiant pouvant être combiné avec mes études, je suis tombé sur une annonce d’une agence d’intérim, « Think & Go » <em>(appelé Sarawak Brussels depuis début 2019)</em>, proposant un petit travail dans le secteur des technologies et des ventes. <br>Je n’ai même pas pris le temps de réfléchir et ai directement envoyé mon CV et un petit message de motivation au travers du système de prise de contact de student.be. <br>Quelle fut ma surprise lorsque, quelques jours plus tard, je reçois une réponse positive de la part de <NAME> ainsi qu’une proposition d’interview ?</p> <p>Lors de l’interview, il m’a fallu remplir une petite enquête sur un ordinateur afin de créer mon profil dans leur base de données : nom, prénom, date de naissance, numéro de registre national, etc. <br>Il m’était également demandé de remplir un questionnaire de quelques pages traitant de 3 domaines : IT, Multimédia et Photographie. <br>Ensuite, il m’a fallu répondre aux questions de <NAME> ainsi que de faire une petite démo de présentation d’un produit (n’importe lequel que je pensais (j’ai pris mon Microsoft Lumia 950)). <br>Elle fut rapidement conquise par mes talents commerciaux et m’a demandé si un job auprès de Microsoft me plairait. <br>Je n’ai pas hésité et ai dit oui. <br>De là, pour vérifier si je convenais réellement pour ce job, elle m’a demandé de répondre à une dernière question, qu’elle considérait comme question piège : « Quels sont les derniers Hardware de Microsoft ? ». <br>Pour moi, ce fut très facile à répondre : Surface Pro 4, Surface Book et Surface Studio.</p> <p>Je fus accepté pour ce job et ai reçu 3 jours de travail (10-13h - 14-18h) qui devinrent 4 plus tard. <br>J’ai travaillé au MediaMarkt Rue Neuve les 1 et 2 mars, à la FNAC Louvain-la-Neuve le 4 mars et au MediaMark<NAME> le 5 mars 2017. <br>D'autres dates ont été ajoutées par la suite.</p> <p>Il m’a fallu passer quelques accréditations auprès de ExpertZone de Microsoft, un site internet, et les ai tous réussi : Windows, Surface, Office et Xbox. <br>Ensuite arriva le jour du briefing dans les locaux de Microsoft Zaventem Center à Da Vincilaan 3, étage 9. <br>Le briefing a duré 2 heures et nous étions encadré par 2 responsables plutôt haut placé et nous avons fait un Quizz via internet (il fallait répondre avec nos smartphones) et un petit Roleplay pour prouver nos connaissances sur les différentes suites Office (Office 2016 et Office 365). <br>Ils nous ont également expliqué en quoi consistait notre travail : présenter la Surface non pas comme un produit quelconque, mais comme une entité et qu’il fallait vraiment appuyer sur le fait que ce n’est pas un ordinateur ou un 2-en-1 ou même une tablette, mais bien LA Surface ! <br>Notre travail consistait également à présenter Office 365 et aider les acheteurs à choisir le bon ordinateur en fonction de leur type d’utilisation et leur budget, même s’ils ne prenait pas la Surface. <br>À la fin du briefing, ils nous ont donné quelques documents à relire, au cas où, sur la Surface Pro 4 ainsi qu’Office.</p> <p>Ce travail m’a vraiment beaucoup plus et j’ai beaucoup appris du secteur de la vente, mais, non pas vu par un client désirant acheter quelque chose et recevoir des conseils que l’on espère utile, mais plutôt vu par un Microsoft Ambassador (ou, si vous voulez, un Microsoft Advisor) étant présent dans le magasin pour conseiller au mieux les gens pour qu’ils aient quelque chose d’adapté sans pour autant exploser leur budget. <br>Dans le secteur de l’informatique, surtout dans les PC, il y a beaucoup d’ordinateurs et il n’est pas toujours facile de pouvoir choisir son appareil et de prendre un adapté, fiable, mais qui surtout, tiendra dans le temps pour supporter nos tâches quotidiennes dans le monde du travail, familial ou même d’étudiant.</p> <p>Ce travail m’a également appris à mieux cerner ce que les gens cherchent réellement, à apprendre à mieux communiquer avec eux afin d’être efficace et d’en soutirer des remerciements de l’aide énorme que nous leur apportons accompagné d’un sourire.</p> </article> <aside> <ul class="imgBox"> <li><a href="../img/2017-2018-microsoft/WP_20170401_17_04_40_Rich.jpg" target="_blank"><img src="../img/2017-2018-microsoft/WP_20170401_17_04_40_Rich.jpg"></a></li> <li><a href="../img/2017-2018-microsoft/WP_20170708_12_26_20_Rich.jpg" target="_blank"><img src="../img/2017-2018-microsoft/WP_20170708_12_26_20_Rich.jpg"></a></li> <li><a href="../img/2017-2018-microsoft/2017-07-08.jpg" target="_blank"><img src="../img/2017-2018-microsoft/2017-07-08.jpg"></a></li> <li><a href="../img/2017-2018-microsoft/WP_20171008_15_28_35_Rich.jpg" target="_blank"><img src="../img/2017-2018-microsoft/WP_20171008_15_28_35_Rich.jpg"></a></li> <li><a href="../img/2017-2018-microsoft/WP_20171014_23_56_11_Rich.jpg" target="_blank"><img src="../img/2017-2018-microsoft/WP_20171014_23_56_11_Rich.jpg"></a></li> <li><a href="../img/2017-2018-microsoft/WP_20171028_18_51_43_Pro.jpg" target="_blank"><img src="../img/2017-2018-microsoft/WP_20171028_18_51_43_Pro.jpg"></a></li> <li><a href="../img/2017-2018-microsoft/Microsoft-fnac-city2-28102017.jpg" target="_blank"><img src="../img/2017-2018-microsoft/Microsoft-fnac-city2-28102017.jpg"></a></li> <li><a href="../img/2017-2018-microsoft/WP_20171104_22_07_59_Rich.jpg" target="_blank"><img src="../img/2017-2018-microsoft/WP_20171104_22_07_59_Rich.jpg"></a></li> <li><a href="../img/2017-2018-microsoft/WP_20171127_03_15_17_Rich.jpg" target="_blank"><img src="../img/2017-2018-microsoft/WP_20171127_03_15_17_Rich.jpg"></a></li> </ul> </aside> <div class="row" id="footer"> <div class="col-md-12 text-center"> <p class="copyright-text">Copyright &copy; 2019-2020 <NAME></p> <div class="social-icons"> <ul> <li><a href="mailto:<EMAIL>"><i class="fas fa-at"></i></a></li> <li><a href="https://www.linkedin.com/in/melvincamposcasares/" target="_blank"><i class="fa fa-linkedin"></i></a></li> <li><a href="https://www.github.com/melvinmajor" target="_blank"><i class="fa fa-github"></i></a></li> <li><a href="https://www.instagram.com/mccprod" target="_blank"><i class="fa fa-instagram"></i></a></li> <li><a href="https://www.youtube.com/user/melvinmajor" target="_blank"><i class="fa fa-youtube"></i></a></li> </ul> </div> <!-- .social-icons --> </div> </div> </body> </html>
html
<reponame>shido76/onebitfood-react import { createReducer } from 'redux-starter-kit' const initialState = { address: [] } export const addressReducer = createReducer(initialState, { SET_ADDRESS: (state, action) => { state.address = action.data } })
javascript
{ "pretrained_model_name":"bert-base-chinese", "data_config":{ "train_file":"demos/HFL/example/pytorch/hugging_face/data/demo_train_data.txt", "val_file": "demos/HFL/example/pytorch/hugging_face/data/demo_train_data.txt", "mlm_probability":0.15, "max_train_samples":1000, "max_eval_samples":1000, "pad_to_max_length":true, "line_by_line":true }, "train_config":{ "output_dir":"saved_bert_test_models", "do_train":true, "do_eval":true, "report_to":"tensorboard", "logging_dir":"log_test", "evaluation_strategy":"steps", "num_train_epochs":5, "eval_steps":1000, "per_device_train_batch_size":10, "gradient_accumulation_steps":6, "save_steps":3000, "save_total_limit":5, "dataloader_num_workers":4 } }
json
import torch from torch.autograd import Variable from .convert import to_var from .vocab import PAD_TOKEN, SOS_TOKEN, EOS_TOKEN def pad(tensor, length, dtype=None): if isinstance(tensor, Variable): var = tensor if length > var.size(0): return torch.cat( [var, torch.zeros( length - var.size(0), *var.size()[1:], dtype=dtype).cuda()]) else: return var else: if length > tensor.size(0): return torch.cat( [tensor, torch.zeros( length - tensor.size(0), *tensor.size()[1:], dtype=dtype).cuda()]) else: return tensor def pad_and_pack(tensor_list): length_list = ([t.size(0) for t in tensor_list]) max_len = max(length_list) padded = [pad(t, max_len) for t in tensor_list] packed = torch.stack(padded, 0) return packed, length_list def pad_tokens(tokens, max_sentence_length=30): n_valid_tokens = len(tokens) if n_valid_tokens > max_sentence_length - 1: tokens = tokens[:max_sentence_length - 1] n_pad = max_sentence_length - n_valid_tokens - 1 tokens = tokens + [EOS_TOKEN] + [PAD_TOKEN] * n_pad return tokens def pad_conversation(conversation, max_sentence_length=30): conversation = [pad_tokens(sentence, max_sentence_length=max_sentence_length) for sentence in conversation] return conversation def pad_sentences(conversations, max_sentence_length=30, max_conversation_length=10): all_padded_sentences = [] all_sentence_length = [] for conversation in conversations: if len(conversation) > max_conversation_length: conversation = conversation[:max_conversation_length] sentence_length = [min(len(sentence) + 1, max_sentence_length) # +1 for EOS token for sentence in conversation] all_sentence_length.append(sentence_length) sentences = pad_conversation(conversation) all_padded_sentences.append(sentences) # [n_conversations, n_sentence (various), max_sentence_length] sentences = all_padded_sentences # [n_conversations, n_sentence (various)] sentence_length = all_sentence_length return sentences, sentence_length
python
Amaravati (Maharashtra) : A series of lectures by Prof. Shyam Manav, the founder and Convener of ‘All India Andha-shraddha Nirmulan Samiti (ANS)’ has been organized here; but it is opposed by ‘Hindu Dharmarakshan Samiti (HDS)’ which is a committee formed by various pro-Hindu organizations coming together. HDS submitted a representation to the police demanding imposition of ban on Prof. Shyam Manav’s program as he is always spitting venom against Hindu Dharma. Later, posters advertising Prof. Manav’s program were found torn by some unknown persons. This has enraged ANS and its members have started spitting venom against Sanatan Sanstha and Hindu Janajagruti Samiti (HJS). ANS has lodged complaint against HDS by claiming that the State Home Ministry has found that many members of HJS and Sanatan Sanstha have been extending support to different terrorist activities. Moreover, the State Home Ministry was following with the Central Government for imposing ban on the said two organizations. (HJS stages agitations in the interest of Nation and Dharma in lawful manner; whereas Sanatan Sanstha is engaged in spread of spirituality and none of these organizations supports terrorist activities. Prof. Shyam Manav always spits venom against pro-Hindu organizations; but he has never shown such guts to say anything against Abu Azmi, Jitendra Avhad, who are always openly supporting terrorists; his mouth does not open out of fear. Hindus should now expose Prof. Manav’s and his sham of spitting venom against Hindu Dharma, Deities, Saints and pro-Hindu organizations in the name of eradication of superstitions ! – Editor, Dainik Sanatan Prabhat)
english
<filename>vision/scraper.py from selenium import webdriver import time import requests import shutil import os user = os.getlogin() driver = webdriver.Chrome() #directory = 'C:\\Users'+'\\'+user+'\Desktop' directory = os.path.join(os.getcwd(), 'data') inp = input("ripe bananas") url = 'https://www.google.com/search?q='+str(inp)+'&source=lnms&tbm=isch&sa=X&ved=2ahUKEwie44_AnqLpAhUhBWMBHUFGD90Q_AUoAXoECBUQAw&biw=1920&bih=947' iterate = int(input("Enter how many pics?")) def save_img(inp,img,i): try: filename = inp+str(i)+'.jpg' response = requests.get(img,stream=True) image_path = os.path.join(directory, filename) with open(image_path, 'wb') as file: shutil.copyfileobj(response.raw, file) except Exception: pass def find_urls(inp,url,driver,iterate): driver.get(url) time.sleep(3) for j in range (1,iterate+1): imgurl = driver.find_element_by_xpath('//div//div//div//div//div//div//div//div//div//div['+str(j)+']//a[1]//div[1]//img[1]') imgurl.click() time.sleep(15) img = driver.find_element_by_xpath('//body/div[2]/c-wiz/div[3]/div[2]/div[3]/div/div/div[3]/div[2]/c-wiz/div[1]/div[1]/div/div[2]/a/img').get_attribute("src") save_img(inp,img,j) find_urls(inp,url,driver,iterate)
python
/* * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 2021, by the GROMACS development team, led by * <NAME>, <NAME>, <NAME>, and <NAME>, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. * * GROMACS is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1 * of the License, or (at your option) any later version. * * GROMACS is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with GROMACS; if not, see * http://www.gnu.org/licenses, or write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * If you want to redistribute modifications to GROMACS, please * consider that scientific software is very special. Version * control is crucial - bugs must be traceable. We will be happy to * consider code for inclusion in the official distribution, but * derived work must not be called official GROMACS. Details are found * in the README & COPYING files - if they are missing, get the * official version at http://www.gromacs.org. * * To help us fund GROMACS development, we humbly ask that you cite * the research papers on the package. Check out http://www.gromacs.org. */ /*! \internal \file * * \brief Defines a function that makes the list of links between * atoms connected by bonded interactions. * * \author <NAME> <<EMAIL>> * \ingroup module_domdec */ #include "gmxpre.h" #include "gromacs/domdec/makebondedlinks.h" #include "gromacs/domdec/domdec_internal.h" #include "gromacs/domdec/options.h" #include "gromacs/domdec/reversetopology.h" #include "gromacs/mdtypes/atominfo.h" #include "gromacs/utility/fatalerror.h" #include "gromacs/utility/smalloc.h" #include "gromacs/topology/block.h" #include "gromacs/topology/mtop_util.h" using gmx::ArrayRef; using gmx::DDBondedChecking; /*! \brief Check if a link is stored in \p link between charge groups \p cg_gl and \p cg_gl_j and if not so, store a link */ static void check_link(t_blocka* link, int cg_gl, int cg_gl_j) { bool bFound = false; for (int k = link->index[cg_gl]; k < link->index[cg_gl + 1]; k++) { GMX_RELEASE_ASSERT(link->a, "Inconsistent NULL pointer while making charge-group links"); if (link->a[k] == cg_gl_j) { bFound = TRUE; } } if (!bFound) { GMX_RELEASE_ASSERT(link->a || link->index[cg_gl + 1] + 1 > link->nalloc_a, "Inconsistent allocation of link"); /* Add this charge group link */ if (link->index[cg_gl + 1] + 1 > link->nalloc_a) { link->nalloc_a = over_alloc_large(link->index[cg_gl + 1] + 1); srenew(link->a, link->nalloc_a); } link->a[link->index[cg_gl + 1]] = cg_gl_j; link->index[cg_gl + 1]++; } } void makeBondedLinks(gmx_domdec_t* dd, const gmx_mtop_t& mtop, gmx::ArrayRef<gmx::AtomInfoWithinMoleculeBlock> atomInfoForEachMoleculeBlock) { if (!dd->comm->systemInfo.filterBondedCommunication) { /* Only communicate atoms based on cut-off */ dd->comm->bondedLinks = nullptr; return; } t_blocka* link = nullptr; /* For each atom make a list of other atoms in the system * that a linked to it via bonded interactions * which are also stored in reverse_top. */ reverse_ilist_t ril_intermol; if (mtop.bIntermolecularInteractions) { t_atoms atoms; atoms.nr = mtop.natoms; atoms.atom = nullptr; GMX_RELEASE_ASSERT(mtop.intermolecular_ilist, "We should have an ilist when intermolecular interactions are on"); ReverseTopOptions rtOptions(DDBondedChecking::ExcludeZeroLimit); make_reverse_ilist( *mtop.intermolecular_ilist, &atoms, rtOptions, AtomLinkRule::AllAtomsInBondeds, &ril_intermol); } snew(link, 1); snew(link->index, mtop.natoms + 1); link->nalloc_a = 0; link->a = nullptr; link->index[0] = 0; int indexOfFirstAtomInMolecule = 0; int numLinkedAtoms = 0; for (size_t mb = 0; mb < mtop.molblock.size(); mb++) { const gmx_molblock_t& molb = mtop.molblock[mb]; if (molb.nmol == 0) { continue; } const gmx_moltype_t& molt = mtop.moltype[molb.type]; /* Make a reverse ilist in which the interactions are linked * to all atoms, not only the first atom as in gmx_reverse_top. * The constraints are discarded here. */ ReverseTopOptions rtOptions(DDBondedChecking::ExcludeZeroLimit); reverse_ilist_t ril; make_reverse_ilist(molt.ilist, &molt.atoms, rtOptions, AtomLinkRule::AllAtomsInBondeds, &ril); gmx::AtomInfoWithinMoleculeBlock* atomInfoOfMoleculeBlock = &atomInfoForEachMoleculeBlock[mb]; int mol = 0; for (mol = 0; mol < (mtop.bIntermolecularInteractions ? molb.nmol : 1); mol++) { for (int a = 0; a < molt.atoms.nr; a++) { int atomIndex = indexOfFirstAtomInMolecule + a; link->index[atomIndex + 1] = link->index[atomIndex]; int i = ril.index[a]; while (i < ril.index[a + 1]) { int ftype = ril.il[i++]; int nral = NRAL(ftype); /* Skip the ifunc index */ i++; for (int j = 0; j < nral; j++) { int aj = ril.il[i + j]; if (aj != a) { check_link(link, atomIndex, indexOfFirstAtomInMolecule + aj); } } i += nral_rt(ftype); } if (mtop.bIntermolecularInteractions) { int i = ril_intermol.index[atomIndex]; while (i < ril_intermol.index[atomIndex + 1]) { int ftype = ril_intermol.il[i++]; int nral = NRAL(ftype); /* Skip the ifunc index */ i++; for (int j = 0; j < nral; j++) { /* Here we assume we have no charge groups; * this has been checked above. */ int aj = ril_intermol.il[i + j]; check_link(link, atomIndex, aj); } i += nral_rt(ftype); } } if (link->index[atomIndex + 1] - link->index[atomIndex] > 0) { atomInfoOfMoleculeBlock->atomInfo[a] |= gmx::sc_atomInfo_BondCommunication; numLinkedAtoms++; } } indexOfFirstAtomInMolecule += molt.atoms.nr; } int nlink_mol = link->index[indexOfFirstAtomInMolecule] - link->index[indexOfFirstAtomInMolecule - molt.atoms.nr]; if (debug) { fprintf(debug, "molecule type '%s' %d atoms has %d atom links through bonded interac.\n", *molt.name, molt.atoms.nr, nlink_mol); } if (molb.nmol > mol) { /* Copy the data for the rest of the molecules in this block */ link->nalloc_a += (molb.nmol - mol) * nlink_mol; srenew(link->a, link->nalloc_a); for (; mol < molb.nmol; mol++) { for (int a = 0; a < molt.atoms.nr; a++) { int atomIndex = indexOfFirstAtomInMolecule + a; link->index[atomIndex + 1] = link->index[atomIndex + 1 - molt.atoms.nr] + nlink_mol; for (int j = link->index[atomIndex]; j < link->index[atomIndex + 1]; j++) { link->a[j] = link->a[j - nlink_mol] + molt.atoms.nr; } if (link->index[atomIndex + 1] - link->index[atomIndex] > 0 && atomIndex - atomInfoOfMoleculeBlock->indexOfFirstAtomInMoleculeBlock < gmx::ssize(atomInfoOfMoleculeBlock->atomInfo)) { atomInfoOfMoleculeBlock->atomInfo[atomIndex - atomInfoOfMoleculeBlock->indexOfFirstAtomInMoleculeBlock] |= gmx::sc_atomInfo_BondCommunication; numLinkedAtoms++; } } indexOfFirstAtomInMolecule += molt.atoms.nr; } } } if (debug) { fprintf(debug, "Of the %d atoms %d are linked via bonded interactions\n", mtop.natoms, numLinkedAtoms); } dd->comm->bondedLinks = link; }
cpp
<filename>packages/sand-editor/src/plugins/list/utils/getSelectionInListItem.ts import getRangeItem from './getRangeItem'; /** * 获取选中区间中的list数据 * @param {*} value */ export default function getSelectionInListItem(value) { if (!value) return null; // 获取当前选中的所有节点对应的层级最深的block集合 const blocks = getRangeItem(value); if (!blocks) return null; const list = blocks.get(0).data.get('list'); return list || null; }
typescript
World number one Novak Djokovic dealt a further blow to the hopes of the US Open going ahead after claiming it would be "impossible" to play under the "extreme" proposed safety protocols. The hard-court grand slam is due to begin at Flushing Meadows in New York on 31st August, but there are serious doubts over the tournament due to the ongoing coronavirus crisis. "I had a telephone conversation with the leaders of world tennis, there were talks about the continuation of the season, mostly about the US Open due in late August, but it is not known whether it will be held," the Serbian told Prva TV television. "The rules that they told us that we would have to respect to be there, to play at all, they are extreme.'' "We would not have access to Manhattan, we would have to sleep in hotels at the airport, to be tested twice or three times per week.'' "Also, we could bring one person to the club which is really impossible. I mean, you need your coach, then a fitness trainer, then a physiotherapist."
english
<reponame>s4-2/scancode-toolkit<gh_stars>1000+ { "model_version": "4.0.0", "group_id": "mysql", "artifact_id": "mysql-connector-java", "version": "5.0.4", "classifier": null, "packaging": "jar", "parent": {}, "name": "MySQL java connector", "description": "MySQL java connector", "inception_year": null, "url": "http://dev.mysql.com/usingmysql/java/", "organization_name": null, "organization_url": null, "licenses": [ { "name": "The GNU General Public License, Version 2", "url": "http://www.gnu.org/licenses/gpl.txt", "comments": "MySQL Connector/J contains exceptions to GPL requirements when linking with other components\n \t\tthat are licensed under OSI-approved open source licenses, see EXCEPTIONS-CONNECTOR-J\n \t\tin this distribution for more details.", "distribution": "repo" } ], "developers": [], "contributors": [], "modules": [], "mailing_lists": [], "scm": { "connection": "scm:svn:http://svn.mysql.com/svnpublic/connector-j/trunk/connector-j", "developer_connection": null, "url": "http://svn.mysql.com/svnpublic/connector-j/trunk/connector-j", "tag": null }, "issue_management": {}, "ci_management": {}, "distribution_management": {}, "repositories": [], "plugin_repositories": [], "dependencies": {} }
json
'''Setup: loss functions used for training and evaluation.''' ## Internal modules. from mml.losses.classification import Zero_One from mml.losses.logistic import Logistic from mml.losses.quadratic import Quadratic ############################################################################### ## A dictionary of instantiated losses. dict_losses = { "logistic": Logistic(), "quadratic": Quadratic(), "zero_one": Zero_One() } def get_loss(name): ''' A simple parser that returns a loss instance. ''' return dict_losses[name] ###############################################################################
python
<gh_stars>0 require('dotenv').config(); const { Octokit } = require("@octokit/core"); const callOctokit = async (route, owner, repo) => { const octokit = new Octokit({ auth: process.env.OCTOKIT_TOKEN }); return await octokit.request(route, { owner, repo }); } module.exports = callOctokit;
javascript
Central office of the Federation of Nepalese Chambers of Commerce and Industry in Kathmandu. (File Photo/Khabarhub) KATHMANDU: The Federation of Nepalese Chambers of Commerce and Industry, an umbrella organization of Nepali private business houses, has rescheduled its election. The decision to this effect was made after the government urged people to put off all gatherings and public events in order to avoid the fear of novel coronavirus infection. The FNCCI was scheduled to hold its election on April 10 and 11. It has now rescheduled the election on May 20 and 21.
english
<reponame>idlesign/lassie { "author_name": "NoThumb", "author_url": "https://www.youtube.com/user/NoThumb", "height": 270, "html": "<iframe width=\"480\" height=\"270\" src=\"https://www.youtube.com/embed/lVhOLT2xQAc?feature=oembed\" frameborder=\"0\" gesture=\"media\" allowfullscreen></iframe>", "provider_name": "YouTube", "provider_url": "https://www.youtube.com/", "title": "Bad Type", "type": "video", "version": "1.0", "width": 480 }
json
{"compatibility.js":"sha256-wiXXmxl7eT1P5fGatjNBTxG7BBjLYBWZNR3SxjH5/9c=","compatibility.min.js":"sha256-X47ssUh91PwdOwaac5BypZz8wp2z+q/KL7j5FaTRplM=","pdf_viewer.css":"sha256-Nzjm/ENflTKpKPuEiCg2s/4Tm45UfwSCb6P4XtutmT0=","pdf_viewer.js":"sha256-9qkHgsW7jdzPAhdvKg7QMPWYt1fTLj/NDNbrZrX/QSk=","pdf_viewer.min.css":"sha256-zefUnkPLlPtAJ68qIQe89B9GYOFIDQQwrLdiWaDzWYY=","pdf_viewer.min.js":"sha256-tv6+rMESFUPdEPvKWnczooj+0BYtEFxKqBCxGJTGFrk=","pdf.combined.js":"sha256-2aDumV5EdeuseT+z7q6jDqoW+HrRRg+2xu9yJaUD7a8=","pdf.combined.min.js":"sha256-30ENo76FtlfoL9oEg55L9I1+sATxObhDwt9uw9BsY9Y=","pdf.js":"sha256-65eBCWVp/p5oeAc2UtXpqr4Ym1iQBsvkKmpRp4FZCOA=","pdf.min.js":"sha256-uiasHU4gAJmoYfWqOdq1/krKIqcXRUrf0zOYQ4Tv9Gg=","pdf.worker.entry.js":"sha256-4V2nQMPK3MbLnxzAq57GK74pW70TMP8/E4yPE1a6Aks=","pdf.worker.entry.min.js":"sha256-KHbjB+ecL+W921mJIgQy28hAjKh1+ZA1cHnoLZ3ASoQ=","pdf.worker.js":"sha256-jYvKfx9cE5rUuA6F/SO<KEY>,"pdf.worker.min.js":"<KEY>}
json
Tandon has been part of India's stand-up comedy scene since 2010, but he recalled that his big break — a viral video that put him on the map — came only in 2015. Now, he's one of three Indians, alongside Atul Khatri and Aditi Mittal, who are among the 47 comedians from 13 regions that will be featured in Netflix's global stand-up comedy series Comedians of the World, out now on the streaming service. Tandon believes that new-age comedians fail to recognise the hard work that needs to be put it and are too impatient. Like most comedians in today's time, Tandon had been wanting to do a one-hour solo special, for which he had had conversations with Netflix. So when the streaming giant approached him back in June for Comedians of the World, an original series that would feature half-hour sets from nearly four dozen comedians, Tandon was initially hesitant. But after he looked at what Netflix was going for, in terms of the scale of the project —eight different languages and multiple subtitles for each set — he gave in. Artists have to take care of the production and visuals for solo specials, but on Comedians of the World, Netflix handled every aspect as it wanted to ensure a similar look and feel. In addition to filming at Famous Studios in Mumbai, sets have been taped in Montreal, São Paulo, Mexico City, Berlin, and Amsterdam. In India, Netflix partnered with the production house and event management firm Only Much Louder (OML), which has been under fire recently for its toxic culture and alleged treatment of female employees. OML claimed that a lengthy expose published by The Caravan magazine was “one-sided” and “biased”, though ex-employees have termed its response “tone deaf” for “undermining the pain and trauma” of women. With a new year here, Tandon is looking forward to several new projects, including an extensive international tour from March to September, across the US, the UK, Canada, and Singapore. He's also looking to spread his wings beyond stand-up, by way of his involvement with a series based on the Partition of India. And back in his comfort zone, he's developing a special on the 100 years of Indian cinema, and the life of late actor-comedian Jaspal Bhatti, best known for his short-lived series Flop Show and Ulta Pulta, who was posthumously awarded the Padma Bhushan.
english
With regard to the draft National Encryption Policy, the government’s decision to withdraw the poorly conceived draft in its entirety was the only face-saving course left. It is the kind of embarrassment that Prime Minister Narendra Modi could have done without, especially just days before his visit to Silicon Valley in the US. Governments may have to find other ways of “seeing” through societies, beyond the magic bullet of cracking encryption. Apropos the editorial ‘Quota fracas’ (September 23), interpret and question RSS chief Mohan Bhagwat’s comments in whichever way, is it not a fact that the reservation policy in India has been politicised? Quotas have become tools in the hands of the political parties to create caste and community vote banks. Under the present circumstances, no political party can afford to take a rational stand on the reservation policy. Then why expect the BJP to be an exception? The BJP’s distancing itself from Bhagwat’s comment was quite understandable. The main beneficiaries of caste-based reservations have been those in the upper strata of the reserved categories rather than those who are socially and economically weakest. Over six decades of quotas for SC/ STs have failed to bring these categories on par with the others. The OBC quota regime since 1990, too, has only led to newer castes and community groups demanding OBC status. This puts a big question mark on the merits of the caste-based reservation policy. There is certainly a case for review. Reservations cannot continue forever nor can they be an ever expanding phenomenon. The government may have succumbed to public pressure and dropped the controversial draft of the National Encryption Policy, but one does need a regulation to monitor social networking applications like WhatsApp, Facebook, etc. These social networking sites are being used to promote pornography and other illegal activities. The draft encryption policy required businesses, telcos and internet companies to store all encrypted data for 90 days in plain text. It may have been next to impossible to follow and monitor all messages but a realistic policy needs to be put in place so that the medium is respected by one and all.
english
Sporadic incidents of violence including hurling of bombs at two booths and skirmishes between political workers marred an otherwise humdrum polling to the Kolkata Municipal Corporation (KMC) as 63. 63 percent was registered till 5 pm on Sunday. State Election Commissioner Sourav Das said that there were 195 arrests and 453 complaints, which are being addressed by the election body. While the State Election Commission and the police described the elections as “peaceful", the opposition BJP demanded cancellation of the “violence-marred polls". Two incidents of hurling of crude bombs were reported in Kolkata’s Sealdah and Khanna areas. Police contingents were rushed to the spot to bring the situation under control. “A total of 63. 63 per cent of total votes were polled till 5 PM. Polling has by and large been peaceful barring a few incidents," State Election Commissioner Sourav Das said. The final voter turnout will be available on Monday as there were still people in queue to vote at 5 PM when the polls ended, SEC officials said. Although the SEC claimed that only one person was injured, police said three people were injured in the bomb attacks, one of them losing a leg. Trinamool Congress national general secretary Abhishek Banerjee said if any ruling party leader was found involved in violence during the polls, strict action would be taken “within 24 hours". “We don’t support any form of violence, and strict action will be taken within 24 hours if any TMC leader is found to be stopping the process of free and fair polls. I would request the media to come out with related footage and evidence (if available)," he told reporters after casting his vote. West Bengal Chief Minister Mamata Banerjee expressed her happiness over people taking part in the “festival of democracy. " “People are voting as if a festival is going on. In a democracy, an election is a mass festival. So people are voting, we are happy about it," she said. Governor Jagdeep Dhankhar said that his security personnel stayed outside the booth when he went to cast his vote during the polls in adherence to an order of the state election commissioner. He said peaceful polling with no fear in voters’ minds and the absence of interference of the state apparatus is at the heart of any election process. “My security personnel adhered to the order issued on Saturday night State Election Commissioner Sourav Das allowed the facility to only two persons — Chief Minister Mamata Banerjee and TMC MP Abhishek Banerjee," he said. “I had called Sourav Das twice and tried to impress upon him that polling should be held peacefully and without fear, and the administration should not interfere in any manner in this," Dhankhar said. The opposition BJP and the CPI(M) alleged that the TMC has forcibly stopped opposition booth agents from entering polling centres in several wards, a charge that the ruling party termed as “baseless". CPI(M) activists staged a road blockade in Bagha Jatin area, alleging that their polling agents were not allowed inside the booths. The BJP state leadership announced that it would conduct peaceful demonstrations against “violence and malpractices" in the polls. Leader of the opposition Suvendu Adhikari who led a delegation of BJP MLAs to meet Governor Dhankar, demanded “cancellation of the entire poll process" as the election has been turned into a farce by the ruling dispensation. Former Kolkata mayor and senior TMC leader Firhad Hakim dismissed the allegations as “baseless and politically motivated". “The BJP knows they will face defeat in the elections. So, they are now making such excuses. The elections have been very peaceful, barring few small incidents," he said. Before this, high drama was witnessed outside a Salt Lake area residence where Adhikari was holding a meeting with party MLAs, after the Bidhannagar city police cordoned off the entire area and stopped him from leaving for Raj Bhawan, where he was scheduled to meet the Governor. “The police of this TMC government didn’t allow me to leave. We were illegally kept under house arrest. I condemn it. Later they allowed," he said. Reacting to allegations, Hakim said, “none of these leaders are residents of Kolkata. So they will not be allowed in the city as per the rules on a polling day. " He said the BJP is falsely claiming the opposition leader, and 20 others are under house arrest. Some BJP MLAs also claimed that the gates of the MLA hostel in Kolkata were locked. “We will stage peaceful sit-in demonstrations across the state against the ongoing violence (in the KMC polls). The way looting of votes took place with the active help of state administration is shameful for our democracy. This is the reason we had asked for central forces to ensure free and fair polls," BJP state spokesperson Shamik Bhattacharya said. Echoing the BJP’s allegations on violence, Left Front Chairman Biman Bose said the Left would organize a two-day long demonstration across the state from Monday. In ward no. 22, BJP’s sitting councillor and former deputy mayor of Kolkata, Mina Devi Purohit, alleged that she was attacked by TMC activists, which the ruling party denied. In ward no. 45, Congress alleged the TMC has brought in fake voters and a scuffle ensued between workers of both the parties. The grand old party alleged that Amitabha Chakraborti, the election agent of Congress councillor Santosh Pathak, was beaten up by TMC activists inside the booth. In the Jain School booth of the ward, clashes were reported between TMC and Congress activists inside the booth. The police later brought the situation under control. The TMC, during the run-up to the KMC polls, had warned party candidates against using force during the civic polls and said that those found to be involved in violence would be thrown out of the party. Meanwhile, In an attack on a section of state BJP leadership, party’s Rajya Sabha MP Rupa Ganguly on Sunday said there could be some truth behind rival charges that “money changed hands" while fielding some candidates from her own party for the Kolkata Municipal Corporation polls. Voting began at 7 AM in 4,949 polling centres, strictly adhering to COVID-19 protocols amid tight security. A total of 40,48,357 voters are eligible to exercise their franchise to seal the fate of 950 candidates in the fray. The SEC has declared 1,139 of the 4,949 polling centres as “sensitive". A total of 23,500 Kolkata Police personnel have been deployed across the city, and route marches and area domination exercises were conducted in various parts of the metropolis, an officer of the force said. He said that more than 200 police pickets have also been set up at crucial points across the city. The ruling Trinamool Congress is fighting to retain the civic board for the third consecutive term, while the BJP will contest CPI(M) to secure the second position. The TMC had swept all the 16 assembly segments in the metropolis in this year’s assembly elections. The counting of votes will take place on December 21. (With inputs from agencies) Read all the Latest News, Breaking News and Coronavirus News here.
english
<filename>00-1-spin.html <!DOCTYPE html> <html> <head> <title>Taking AngularJS for a spin</title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.17/angular.min.js"></script> <script> function myCtrl($scope){} function yourCtrl($scope){} </script> </head> <body> <div ng-app="" ng-init="data.message='hi'"> {{data.message}} <div ng-controller="myCtrl"> <h1>{{2+2}}</h1> Type in a message: <input type="text" ng-model="data.message"> <br /><h1><b>{{data.message}}</b></h1> </div> <div ng-controller="yourCtrl"> Type in a message: <input type="text" ng-model="data.message"> <br /><h1><b>{{data.message}}</b></h1> </div> </div> </body> </html>
html
<gh_stars>1-10 // [10:59:00 AM] khongthanhhoa: vix // [10:59:02 AM] khongthanhhoa: pet // [10:59:03 AM] khongthanhhoa: gtn // [10:59:04 AM] khongthanhhoa: ssi // [10:59:05 AM] khongthanhhoa: kbc function load(filename, callback){ d3.json(filename, function(err, json){ if (err) return console.error('Data cant be loaded'); sinfo = json.hits.hits; callback(sinfo.map(function(s){return s._source;})); }); } function index(price, floor){ return Math.round((price - floor) / 0.1); } function price_step_count(stock){ return index(stock.ceilingPrice, stock.floorPrice) + 1; } function reduce_obj(stock){ return { 'time': stock.time, 'stock':[ {'price': stock.bidPrice01, 'quantity': stock.bidQtty01, 'class': 'buy'}, {'price': stock.bidPrice02, 'quantity': stock.bidQtty02, 'class': 'buy'}, {'price': stock.bidPrice03, 'quantity': stock.bidQtty03, 'class': 'buy'}, {'price': stock.offerPrice01, 'quantity': stock.offerQtty01, 'class': 'sell'}, {'price': stock.offerPrice02, 'quantity': stock.offerQtty02, 'class': 'sell'}, {'price': stock.offerPrice03, 'quantity': stock.offerQtty03, 'class': 'sell'} ], 'match': { 'price': stock.matchPrice, 'quantity': stock.matchQtty } }; }
javascript
Shayan Munshi is accused of lying on oath during trial before the sessions court. The court directed its registrar general to file a complaint against Munshi and Manocha under Section 340 of the CrPC. Court will tomorrow decide whether to prosecute 19 witnesses for perjury. Shayan said the roles of Neel in Jhankar Beats and Kelly Menzes in My Brother Nikhil were small,but important. How does an actor who delivers a cracking performance in one film switch to become a totally different person in another,both out the same day?
english
Ravi Teja and Gopichand Malineni is one of the most successful combinations in Tollywood, as they delivered three blockbusters so far. Don Seenu marked Gopichand Malineni’s first movie and also a maiden one with Ravi Teja. Then, they worked together for Balupu and Krack. The successful combo is back. Ravi Teja and Gopichand Malineni will team up once again for another commercial entertainer. Gopichand Malineni who is in full swing with consecutive hits has prepared a mass-appealing script and Ravi Teja is happy to work again with him. This will be made on a large scale and the leading production house Mythri Movie Makers will be backing it. More details of the fourth movie in Ravi Teja and Gopichand Malineni’s combo will be revealed soon.
english
import React from 'react' import styles from './index.module.css' import { ProductItemDetail } from '@/types' import Amount from '@/components/Amount' const ProductDetails = ({ product }: { product: ProductItemDetail }) => ( <> <div data-testid="product-details" className={styles.containerProduct}> <a> <img data-testid="product-img" className={styles.image} src={product.picture} alt={product.title} title={product.title} /> </a> <div className={styles.subContainer}> <div className={styles.containerDetails}> <span className={styles.sold}> {product.condition} - {`${product.sold_quantity} vendidos`} </span> <a className={styles.title}> <span>{product.title}</span> </a> <Amount price={product.price} /> <button type="button" className={styles.button}>Comprar</button> </div> </div> </div> <div className={styles.containerDescription}> <h1 className={styles.titleDescription}> Descripción del producto </h1> <p data-testid="product-description" className={styles.description}>{product.description}</p> </div> </> ) export default ProductDetails
typescript
<gh_stars>100-1000 { "schema_version": "1.2.0", "id": "GHSA-485w-jm59-qvxp", "modified": "2022-03-17T00:01:37Z", "published": "2022-03-11T00:02:24Z", "aliases": [ "CVE-2022-0507" ], "details": "Found a potential security vulnerability inside the Pandora API. Affected Pandora FMS version range: all versions of NG version, up to OUM 759. This vulnerability could allow an attacker with authenticated IP to inject SQL.", "severity": [ { "type": "CVSS_V3", "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H" } ], "affected": [ ], "references": [ { "type": "ADVISORY", "url": "https://nvd.nist.gov/vuln/detail/CVE-2022-0507" }, { "type": "WEB", "url": "https://pandorafms.com/en/security/common-vulnerabilities-and-exposures/" }, { "type": "WEB", "url": "https://www.incibe.es/en/cve-assignment-publication/coordinated-cves" } ], "database_specific": { "cwe_ids": [ "CWE-89" ], "severity": "HIGH", "github_reviewed": false } }
json
/*! nouislider - 9.1.0 - 2016-12-10 16:00:32 */ .noUi-target, .noUi-target * { -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; -ms-touch-action: none; touch-action: none; -ms-user-select: none; -moz-user-select: none; user-select: none; -moz-box-sizing: border-box; box-sizing: border-box; } .noUi-target { position: relative; direction: ltr; } .noUi-base { width: 100%; position: relative; z-index: 1; background: #d8ecf2; border: 1px solid #d8ecf2; height: 3px; } .noUi-connect { position: absolute; right: 0; top: 0; left: 0; bottom: 0; } .noUi-origin { position: absolute; height: 0; width: 0; } .noUi-handle { position: relative; z-index: 1; } .noUi-state-tap .noUi-connect, .noUi-state-tap .noUi-origin { -webkit-transition: top .3s, right .3s, bottom .3s, left .3s; transition: top .3s, right .3s, bottom .3s, left .3s; } .noUi-state-drag * { cursor: inherit!important; } .noUi-base, .noUi-handle { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); } .noUi-horizontal { height: 10px; } .noUi-horizontal .noUi-handle { width: 8px; height: 8px; } .noUi-horizontal .noUi-handle::after { content: ""; width: 0; height: 0; position: absolute; border-left: 4px solid transparent; border-right: 4px solid transparent; border-bottom: 3px solid #ce1715; left: -1px; top: -4px; } .noUi-vertical { width: 18px; } .noUi-vertical .noUi-handle { width: 28px; height: 34px; left: -6px; top: -17px; } .noUi-target { border-radius: 4px; } .noUi-connect { height: 3px; border: 1px solid #ce1715; background: #ce1715; -webkit-transition: background 450ms; transition: background 450ms; } .noUi-draggable { cursor: ew-resize; } .noUi-vertical .noUi-draggable { cursor: ns-resize; } .noUi-handle { border: 1px solid #ce1715; -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; top: 5px; background: #ce1715; margin-left: -4px; outline: 0; cursor: pointer; } .noUi-active { box-shadow: inset 0 0 1px #FFF, inset 0 1px 7px #DDD, 0 3px 6px -3px #BBB; } .noUi-handle:after { left: 17px; } .noUi-vertical .noUi-handle:after, .noUi-vertical .noUi-handle:before { width: 14px; height: 1px; left: 6px; top: 14px; } .noUi-vertical .noUi-handle:after { top: 17px; } [disabled] .noUi-connect { background: #B8B8B8; } [disabled] .noUi-handle, [disabled].noUi-handle, [disabled].noUi-target { cursor: not-allowed; } .noUi-pips, .noUi-pips * { -moz-box-sizing: border-box; box-sizing: border-box; } .noUi-pips { position: absolute; color: #999; } .noUi-value { position: absolute; text-align: center; } .noUi-value-sub { color: #ccc; font-size: 10px; } .noUi-marker { position: absolute; background: #CCC; } .noUi-marker-large, .noUi-marker-sub { background: #AAA; } .noUi-pips-horizontal { padding: 10px 0; height: 80px; top: 100%; left: 0; width: 100%} .noUi-value-horizontal { -webkit-transform: translate3d(-50%, 50%, 0); transform: translate3d(-50%, 50%, 0); } .noUi-marker-horizontal.noUi-marker { margin-left: -1px; width: 2px; height: 5px; } .noUi-marker-horizontal.noUi-marker-sub { height: 10px; } .noUi-marker-horizontal.noUi-marker-large { height: 15px; } .noUi-pips-vertical { padding: 0 10px; height: 100%; top: 0; left: 100%} .noUi-value-vertical { -webkit-transform: translate3d(0, 50%, 0); transform: translate3d(0, 50%, 0); padding-left: 25px; } .noUi-marker-vertical.noUi-marker { width: 5px; height: 2px; margin-top: -1px; } .noUi-marker-vertical.noUi-marker-sub { width: 10px; } .noUi-marker-vertical.noUi-marker-large { width: 15px; } .noUi-tooltip { display: block; position: absolute; border-radius: 3px; background: #838996; color: #fff; padding: 3px; text-align: center; font-size: 12px; } .noUi-horizontal .noUi-tooltip { -webkit-transform: translate(-50%, 0); transform: translate(-50%, 0); left: 16%; top: -35px; } .noUi-vertical .noUi-tooltip { -webkit-transform: translate(0, -50%); transform: translate(0, -50%); top: 50%; right: 120%}
css
/** * */ package reega.io; import java.io.File; import org.apache.commons.lang3.SystemUtils; /** * */ public final class IOControllerImpl implements IOController { private static IOControllerImpl instance; /** * URI of the directory of the app. */ private static final String APP_DIRECTORY_URI; static { final String baseDir = System.getProperty("user.home"); // For Windows, create a folder in the AppData\Local directory of the current // user, for the other systems create a folder in the /home/user directory if (SystemUtils.IS_OS_WINDOWS) { APP_DIRECTORY_URI = baseDir + File.separator + "AppData" + File.separator + "Local" + File.separator + "Reega"; } else { APP_DIRECTORY_URI = baseDir + File.separator + ".reega"; } final File dir = new File(IOControllerImpl.APP_DIRECTORY_URI); if (!dir.exists()) { // Create the directory if it doesn't exist dir.mkdir(); } } /** * Get the static instance of the {@link IOControllerImpl}. * * @return the static instance of the {@link IOControllerImpl} */ public static synchronized IOControllerImpl getInstance() { if (IOControllerImpl.instance == null) { IOControllerImpl.instance = new IOControllerImpl(); } return IOControllerImpl.instance; } private IOControllerImpl() { } /** * {@inheritDoc} */ @Override public File getDefaultDirectory() { return new File(IOControllerImpl.APP_DIRECTORY_URI); } /** * {@inheritDoc} */ @Override public String getDefaultDirectoryPath() { return IOControllerImpl.APP_DIRECTORY_URI; } }
java
President Bola Tinubu will on Monday depart Abuja for New Delhi, India, to attend the G-20 Leaders' Summit. President Bola Tinubu will on Monday depart Abuja for New Delhi, India, to attend the G-20 Leaders’ Summit. Tinubu is attending the two-day summit on the special invitation of Indian Prime Minister, Narendra Modi, a statement signed by his Special Adviser on Media and Publicity, Ajuri Ngelale, read on Sunday. In the statement titled ‘President Tinubu set to attend G-20 Summit in India with investment attraction topping Nigeria’s agenda,’ Ngelale revealed that the President aims to leverage the platform to attract global capital and promote increased foreign direct investments in key labour-intensive sectors of Nigeria’s economy for job creation and revenue expansion. “He will use this opportunity to highlight Nigeria’s attractiveness as an investment destination, specifically outlining his cross-sectoral reform plan as encapsulated by the Renewed Hope Agenda. “Given the President’s renowned experience in attracting investment to Lagos State, leading industrialists have sought separate private engagements with him at the summit,” it read in part. headtopics.comRead more: Tinubu to attend G20 summit in India, seeks to attract investmentsPresident Bola Tinubu is expected to attend a G-20 summit in New Delhi, India on Spetember 9 and 10. Tinubu seeks to attract investments at G-20 summit in IndiaPresident Bola Tinubu is expected to attend a G-20 summit in New Delhi, India on Spetember 9 and 10. Tinubu to attend G-20 summit in India, seeks to attract investmentsPresident Bola Tinubu is expected to attend a G-20 summit in New Delhi, India on Spetember 9 and 10.
english
30 “But now I am mocked by people younger than I, by young men whose fathers are not worthy to run with my sheepdogs. those worn-out wretches! 3 They are gaunt from poverty and hunger. They claw the dry ground in desolate wastelands. and eat from the roots of broom trees. 5 They are driven from human society, and people shout at them as if they were thieves. 6 So now they live in frightening ravines, in caves and among the rocks. 7 They sound like animals howling among the bushes, huddled together beneath the nettles. 8 They are nameless fools, outcasts from society. 9 “And now they mock me with vulgar songs! They taunt me! 10 They despise me and won’t come near me, except to spit in my face. 11 For God has cut my bowstring. He has humbled me, so they have thrown off all restraint. 12 These outcasts oppose me to my face. and lay traps in my path. and do everything they can to destroy me. They know I have no one to help me. 14 They come at me from all directions. They jump on me when I am down. 15 I live in terror now. My honor has blown away in the wind, and my prosperity has vanished like a cloud. 16 “And now my life seeps away. Depression haunts my days. 17 At night my bones are filled with pain, which gnaws at me relentlessly. He grips me by the collar of my coat. 19 He has thrown me into the mud. I’m nothing more than dust and ashes. 20 “I cry to you, O God, but you don’t answer. I stand before you, but you don’t even look. 21 You have become cruel toward me. You use your power to persecute me. and destroy me in the storm. the destination of all who live. when they cry for help in their trouble. 25 Did I not weep for those in trouble? Was I not deeply grieved for the needy? 26 So I looked for good, but evil came instead. I waited for the light, but darkness fell. 27 My heart is troubled and restless. Days of suffering torment me. 28 I walk in gloom, without sunlight. I stand in the public square and cry for help. and a companion to owls. 30 My skin has turned dark, and my bones burn with fever. 31 My harp plays sad music, and my flute accompanies those who weep. - 30:18 As in Greek version; Hebrew reads hand, my garment is disfigured. 30 “But now they mock me,(A) men younger than I, to put with my sheep dogs.(B) 2 Of what use was the strength of their hands to me, since their vigor had gone from them? 3 Haggard from want and hunger, they roamed[a] the parched land(C) in desolate wastelands(D) at night.(E) 4 In the brush they gathered salt herbs,(F) and their food[b] was the root of the broom bush.(G) 5 They were banished from human society, shouted at as if they were thieves. 6 They were forced to live in the dry stream beds, among the rocks and in holes in the ground.(H) 7 They brayed(I) among the bushes(J) and huddled in the undergrowth. 8 A base and nameless brood,(K) they were driven out of the land.(L) 9 “And now those young men mock me(M) in song;(N) I have become a byword(O) among them. 10 They detest me(P) and keep their distance; they do not hesitate to spit in my face.(Q) 11 Now that God has unstrung my bow(R) and afflicted me,(S) they throw off restraint(T) in my presence. 12 On my right(U) the tribe[c] attacks; they lay snares(V) for my feet,(W) they build their siege ramps against me.(X) 13 They break up my road;(Y) they succeed in destroying me.(Z) ‘No one can help him,’ they say. 14 They advance as through a gaping breach;(AA) amid the ruins they come rolling in. 15 Terrors(AB) overwhelm me;(AC) my dignity is driven away as by the wind, my safety vanishes like a cloud.(AD) 16 “And now my life ebbs away;(AE) days of suffering grip me.(AF) 17 Night pierces my bones; my gnawing pains never rest.(AG) 18 In his great power(AH) God becomes like clothing to me[d]; he binds me like the neck of my garment. 19 He throws me into the mud,(AI) and I am reduced to dust and ashes.(AJ) 20 “I cry out to you,(AK) God, but you do not answer;(AL) I stand up, but you merely look at me. 21 You turn on me ruthlessly;(AM) with the might of your hand(AN) you attack me.(AO) 22 You snatch me up and drive me before the wind;(AP) you toss me about in the storm.(AQ) 23 I know you will bring me down to death,(AR) to the place appointed for all the living.(AS) 24 “Surely no one lays a hand on a broken man(AT) when he cries for help in his distress.(AU) 25 Have I not wept for those in trouble?(AV) Has not my soul grieved for the poor?(AW) 26 Yet when I hoped for good, evil came; when I looked for light, then came darkness.(AX) 27 The churning inside me never stops;(AY) days of suffering confront me.(AZ) 28 I go about blackened,(BA) but not by the sun; I stand up in the assembly and cry for help.(BB) 29 I have become a brother of jackals,(BC) a companion of owls.(BD) 30 My skin grows black(BE) and peels;(BF) my body burns with fever.(BG) 31 My lyre is tuned to mourning,(BH) and my pipe(BI) to the sound of wailing. Holy Bible, New Living Translation, copyright © 1996, 2004, 2015 by Tyndale House Foundation. Used by permission of Tyndale House Publishers, Inc., Carol Stream, Illinois 60188. All rights reserved. Holy Bible, New International Version®, NIV® Copyright ©1973, 1978, 1984, 2011 by Biblica, Inc.® Used by permission. All rights reserved worldwide. NIV Reverse Interlinear Bible: English to Hebrew and English to Greek. Copyright © 2019 by Zondervan.
english
<gh_stars>0 /* :root { --main-bg-color: #fafafa; --h-color: #3a302d; --p-color: #3a302d; } html { margin: 0; padding: 0; } body { width: 100%; background-color: var(--main-bg-color); font-family: canada-type-gibson, "游ゴシック Medium", "Yu Gothic Medium", "游ゴシック体", YuGothic, 'ヒラギノ角ゴシック Pro', 'Hiragino Kaku Gothic Pro', メイリオ, Meiryo, 'MS Pゴシック', 'MS PGothic', sans-serif; font-feature-settings: "palt"; letter-spacing: 0.08rem; font-weight: 300; } article, aside, details, header, footer, hgroup, nav, section { display: block; } h1, h2, h3, h4, h5, h6 { color: var(--h-color); font-weight: normal; font-size: 100%; letter-spacing: 0.06rem; } p { margin: 0 !important; color: var(--p-color); } ul { list-style-position: inside; } */
css
<reponame>jlin/usesthis<gh_stars>0 { "name": "TouchOSC (iOS)", "description": "An OSC and MIDI controller for iOS.", "url": "http://hexler.net/software/touchosc" }
json
# Design-pattern-in-java java pattern
markdown
<gh_stars>1-10 class CircleTimer extends UIBlock { constructor(config) { super(); this.scene = config.scene; this.graphics = this.scene.add.graphics(); this.count = 100; this.setPer(100); this.add(this.graphics); } setCallback(func, scope = null) { this.func = func; this.scope = scope; } start() { this.timer = this.scene.time.addEvent({ delay: 100, callback: this.tick, callbackScope: this, loop: true, }); } reset() { this.count = 100; this.stop(); this.start(); } tick() { this.count -= 2; this.setPer(this.count); if (this.count <= 0) { this.stop(); if (this.scope) { this.func.call(this.scope); } else { this.func.call(); } } } stop() { this.timer.remove(); } setPer(per) { let rad = (per / 100) * 360; this.graphics.clear(); this.graphics.fillStyle(0xffffff, 0.5); this.graphics.slice( 0, 0, game.config.width * 0.1, Phaser.Math.DegToRad(0), Phaser.Math.DegToRad(rad) ); this.graphics.fillPath(); } }
javascript
<gh_stars>1000+ /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.netbeans.modules.form.layoutsupport.griddesigner; import java.awt.Color; import java.awt.Component; import java.awt.Container; import java.awt.Cursor; import java.awt.Graphics; import java.awt.Image; import java.awt.Point; import java.awt.Rectangle; import java.awt.Toolkit; import java.awt.event.ActionEvent; import java.awt.event.InputEvent; import java.awt.event.KeyEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.util.ArrayList; import java.util.Arrays; import java.util.BitSet; import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; import javax.swing.AbstractAction; import javax.swing.BorderFactory; import javax.swing.JLabel; import javax.swing.JMenuItem; import javax.swing.JPanel; import javax.swing.JPopupMenu; import javax.swing.SwingConstants; import javax.swing.SwingUtilities; import javax.swing.border.Border; import javax.swing.border.EtchedBorder; import org.netbeans.modules.form.FormLoaderSettings; import org.netbeans.modules.form.layoutsupport.griddesigner.actions.AbstractGridAction; import org.netbeans.modules.form.layoutsupport.griddesigner.actions.DeleteComponentAction; import org.netbeans.modules.form.layoutsupport.griddesigner.actions.GridAction; import org.netbeans.modules.form.layoutsupport.griddesigner.actions.GridActionPerformer; import org.netbeans.modules.form.layoutsupport.griddesigner.actions.GridBoundsChange; /** * Glass pane of the grid designer. * * @author <NAME> * @author <NAME> */ public class GlassPane extends JPanel implements GridActionPerformer { /** Color of the grid. */ private static final Color GRID_COLOR = new Color(192, 192, 192, 128); /** Color of the highlighted cell. */ private static final Color HIGHLIGHT_COLOR = new Color(64, 255, 64, 64); /** Gap between the grid and the header. */ static final int HEADER_GAP = 10; private GridDesigner designer; /** The container we are glasspane for. */ private Container innerPane; /** The subcontainer of {@code innerPane} that contains the grid. */ private Container componentPane; /** Grid manager. */ private GridManager gridManager; /** Grid information provider. */ private GridInfoProvider gridInfo; /** Grid customizer. */ private GridCustomizer customizer; // SELECTION /** Selected components. */ private Set<Component> selection = new HashSet<Component>(); /** Focused component, i.e., component recently clicked. */ private Component focusedComponent; /** Selected columns. */ private BitSet selectedColumns = new BitSet(); /** Selected rows. */ private BitSet selectedRows = new BitSet(); /** Row of focused cell - used by actions with CELL context. */ private int focusedCellRow; /** Column of focused cell - used by actions with CELL context. */ private int focusedCellColumn; /** The height of the column header. */ private int headerHeight; /** The width of the row header. */ private int headerWidth; // HEADER emphaisizing /** Index of header under the cursor. */ private int emphColumnHeader = -1; /** Index of header under the cursor. */ private int emphRowHeader = -1; // RESIZING and MOVING /** Determines if we are in the middle of moving. */ private boolean moving; /** Determines if we are in the middle of resizing. */ private boolean resizing; /** Determines if we are in the middle of area selection. */ private boolean selecting; /** Determines the direction in which we are (or will start) resizing. */ private int resizingMode; /** The initial point of the current resizing/moving. */ private Point draggingStart; /** The current resizing/moving rectangle. */ private Rectangle draggingRect; /** Minimum grid X coordinate of moved/resized component. */ private int selMinX; /** Maximum grid X coordinate of a cell occupied by moved/resized component. */ private int selMaxX; /** Minimum grid Y coordinate of moved/resized component. */ private int selMinY; /** Maximum grid Y coordinate of a cell occupied by moved/resized component. */ private int selMaxY; /** Minimum width of moved/resized component. */ private int selMinWidth; /** Maximum width of moved/resized component. */ private int selMinHeight; /** New grid x coordinate of the resized/moved component. */ private int newGridX; /** New grid y coordinate of the resized/moved component. */ private int newGridY; /** New grid width of the resized component. */ private int newGridWidth; /** New grid height of the resized component. */ private int newGridHeight; // ANIMATION /** Animation layer. */ private AnimationLayer animLayer = new AnimationLayer(); /** Determines whether the animation is in a progress. */ boolean animation; /** The current phase of the animation. */ float animPhase; /** Information about column/row changes. */ GridBoundsChange animChange; /** * Creates new {@code GlassPane}. */ public GlassPane(GridDesigner designer) { this.designer = designer; setLayout(null); Listener listener = new Listener(); addMouseListener(listener); addMouseMotionListener(listener); initHeaderWidth(); } /** * Sets the underlying container of this glass pane ({@code innerPane}) * and the subcontainer of {@code innerPane} that contains the grid. * * @param innerPane underlying container of this glass pane. * @param componentPane subcontainer of {@code innerPane} that * contains the grid. */ public void setPanes(Container innerPane, Container componentPane) { this.innerPane = innerPane; this.componentPane = componentPane; } /** * Determines whether some user action is in progress, i.e, * if some animation is running. * * @return {@code true} if some user action is in progress, * returns {@code false} otherwise. */ public boolean isUserActionInProgress() { return animation; } /** * Updates the layout in the grid designer according to the current * state of the model (meta-data). This method should be called * when some change is not done through {@code gridManager} * (for example, for changes made through property sheet). */ public void updateLayout() { performAction(new AbstractGridAction() { @Override public GridBoundsChange performAction(GridManager gridManager, DesignerContext context) { GridInfoProvider info = gridManager.getGridInfo(); int oldColumns = info.getColumnCount(); int oldRows = info.getRowCount(); GridUtils.removePaddingComponents(gridManager); gridManager.updateLayout(false); GridUtils.revalidateGrid(gridManager); gridManager.updateGaps(false); int newColumns = info.getColumnCount(); int newRows = info.getRowCount(); int columns = Math.max(oldColumns, newColumns); int rows = Math.max(oldRows, newRows); GridUtils.addPaddingComponents(gridManager, columns, rows); GridUtils.revalidateGrid(gridManager); return null; } }); } /** * Initializes the {@code headerWidth} (i.e., the width of the row header). */ private void initHeaderWidth() { // Simple heuristics for the row header width JLabel label = new JLabel("99"); // NOI18N label.setBorder(BorderFactory.createRaisedBevelBorder()); headerWidth = label.getPreferredSize().width+HEADER_GAP; } /** * Sets the grid manager. * * @param gridManager grid manager. */ public void setGridManager(GridManager gridManager) { this.gridManager = gridManager; this.gridInfo = gridManager.getGridInfo(); this.customizer = gridManager.getCustomizer(this); GridUtils.revalidateGrid(gridManager); GridUtils.addPaddingComponents(gridManager, gridInfo.getColumnCount(), gridInfo.getRowCount()); } /** * Glass-pane painting. * * @param g graphics object. */ @Override protected void paintComponent(Graphics g) { super.paintComponent(g); if (animation) { Point shift = fromComponentPane(new Point()); g.translate(shift.x, shift.y); animLayer.paint(g); g.translate(-shift.x, -shift.y); animPhase = animLayer.getPhase(); emphColumnHeader = -1; emphRowHeader = -1; } paintGrid(g); if (resizing) { paintResizing(g); } else if (moving) { paintResizing(g); } else { if (selecting) { g.setColor(GridDesigner.SELECTION_COLOR); g.drawRect(draggingRect.x, draggingRect.y, draggingRect.width, draggingRect.height); } if (!animation) { paintConstraints(g); paintSelection(g); } } if (animation && (animPhase == 1f)) { // End of animation animation = false; animPhase = 0; repaint(); // Repaint without the animation layer (to show selection, etc.) } } /** * Paints the grid. * * @param g graphics object. */ private void paintGrid(Graphics g) { if (gridInfo == null) { return; } Color oldColor = g.getColor(); g.setColor(GRID_COLOR); boolean animReady = animation && (animChange != null); // Calculate column bounds int[] columnBounds; if (animReady) { int[] animOldColumnBounds = animChange.getOldColumnBounds(); int[] animNewColumnBounds = animChange.getNewColumnBounds(); columnBounds = new int[animOldColumnBounds.length]; for (int i=0; i<animOldColumnBounds.length; i++) { columnBounds[i] = Math.round(animOldColumnBounds[i]*(1-animPhase)+animPhase*animNewColumnBounds[i]); } } else { columnBounds = gridInfo.getColumnBounds(); } int columns = columnBounds.length-1; // Calculate row bounds int[] rowBounds; if (animReady) { int[] animOldRowBounds = animChange.getOldRowBounds(); int[] animNewRowBounds = animChange.getNewRowBounds(); rowBounds = new int[animOldRowBounds.length]; for (int i=0; i<animOldRowBounds.length; i++) { rowBounds[i] = Math.round(animOldRowBounds[i]*(1-animPhase)+animPhase*animNewRowBounds[i]); } } else { rowBounds = gridInfo.getRowBounds(); } int rows = rowBounds.length-1; // Check if there are any newly created columns/rows if (moving || resizing) { int deltaX = newGridX - gridInfo.getGridX(focusedComponent); int deltaWidth = newGridWidth - gridInfo.getGridWidth(focusedComponent); columns = Math.max(columns, selMaxX+deltaX+deltaWidth+1); int deltaY = newGridY - gridInfo.getGridY(focusedComponent); int deltaHeight = newGridHeight - gridInfo.getGridHeight(focusedComponent); rows = Math.max(rows, selMaxY+deltaY+deltaHeight+1); } // Paint the grid Point shift = new Point(); shift = fromComponentPane(shift); int x = columnBounds[0]+shift.x; int y = rowBounds[0]+shift.y; int width = extendedColumnBound(columnBounds, columns)-columnBounds[0]; int height = extendedRowBound(rowBounds, rows)-rowBounds[0]; for (int i=0; i<=columns; i++) { int bound = extendedColumnBound(columnBounds, i); g.drawLine(bound+shift.x, y, bound+shift.x, y+height); } for (int i=0; i<=rows; i++) { int bound = extendedRowBound(rowBounds, i); g.drawLine(x, bound+shift.y, x+width, bound+shift.y); } g.setColor(oldColor); // Paint the columns Color c = new Color(GRID_COLOR.getRGB()); // Getting rid of transparency JLabel header = new JLabel(); header.setOpaque(true); header.setBackground(c); header.setHorizontalAlignment(SwingConstants.CENTER); for (int i=0; i<columns; i++) { if (!gridInfo.isGapColumn(i)) { header.setText(Integer.toString(i)); if(i == emphColumnHeader) { header.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED)); } else { header.setBorder(selectedColumns.get(i) ? BorderFactory.createLoweredBevelBorder() : BorderFactory.createRaisedBevelBorder()); } headerHeight = header.getPreferredSize().height; int start = extendedColumnBound(columnBounds, i); int end = extendedColumnBound(columnBounds, i+1); int w = end-start; Graphics gg = g.create(start+shift.x, rowBounds[0]-HEADER_GAP-headerHeight+shift.y, w, headerHeight); header.setSize(w, headerHeight); header.paint(gg); gg.dispose(); } } // Paint the rows for (int i=0; i<rows; i++) { if (!gridInfo.isGapRow(i)) { header.setText(Integer.toString(i)); Border border; if(i == emphRowHeader) { border = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED); } else { border = selectedRows.get(i) ? BorderFactory.createLoweredBevelBorder() : BorderFactory.createRaisedBevelBorder(); } header.setBorder(BorderFactory.createCompoundBorder(border, BorderFactory.createEmptyBorder(0,HEADER_GAP/2,0,HEADER_GAP/2))); int start = extendedRowBound(rowBounds, i); int end = extendedRowBound(rowBounds, i+1); int h = end-start; Graphics gg = g.create(columnBounds[0]-HEADER_GAP-headerWidth+shift.x, start+shift.y, headerWidth, h); header.setSize(headerWidth, h); header.paint(gg); gg.dispose(); } } } /** * Identifies whether a header is under mouse pointer. * Such header is then emphasized to point out * that it can be actively used (right-click opens menu). * See #200671 for reasoning. * * @param cursorLocation current mouse cursor location. */ void updateActiveHeaders(Point cursorLocation) { if (cursorLocation == null) { emphColumnHeader = -1; emphRowHeader = -1; } else { int oldColumnHeader = emphColumnHeader; int oldRowHeader = emphRowHeader; emphColumnHeader = findColumnHeader(cursorLocation); emphRowHeader = findRowHeader(cursorLocation); if(oldColumnHeader != emphColumnHeader || oldRowHeader != emphRowHeader) { repaint(); } } } /** * Paints additional information about component constraints. * * @param g graphics to use for painting. */ private void paintConstraints(Graphics g) { Point shift = fromComponentPane(new Point()); Graphics gClip = g.create(); Rectangle paneRect = fromComponentPane(new Rectangle(new Point(), componentPane.getSize())); gClip.clipRect(paneRect.x, paneRect.y, paneRect.width, paneRect.height); gClip.translate(shift.x, shift.y); for (Component comp : componentPane.getComponents()) { if (GridUtils.isPaddingComponent(comp)) { continue; } boolean selected = selection.contains(comp); gridInfo.paintConstraints(gClip, comp, selected); } gClip.dispose(); } /** * Paints the selection. * * @param g graphics object. */ private void paintSelection(Graphics g) { Graphics gClip = g.create(); Rectangle paneRect = fromComponentPane(new Rectangle(new Point(), componentPane.getSize())); gClip.clipRect(paneRect.x, paneRect.y, paneRect.width, paneRect.height); for (Component selComp : selection) { Rectangle rect = fromComponentPane(selectionResizingBounds(selComp)); Rectangle inner = fromComponentPane(selComp.getBounds()); gClip.setColor(HIGHLIGHT_COLOR); if ((inner.width == 0) || (inner.height == 0)) { // GridBagLayout sets location of such components // to (0,0) which makes inner rectangle incorrect. // Happily, we can ignore inner rectangle in this case. gClip.fillRect(rect.x, rect.y, rect.width, rect.height); } else { gClip.fillRect(rect.x, rect.y, rect.width, inner.y-rect.y); gClip.fillRect(rect.x, inner.y, inner.x-rect.x, inner.height); gClip.fillRect(inner.x+inner.width, inner.y, rect.width-(inner.x+inner.width-rect.x), inner.height); gClip.fillRect(rect.x, inner.y+inner.height, rect.width, rect.height-(inner.y+inner.height-rect.y)); } g.setColor(GridDesigner.SELECTION_COLOR); int x = rect.x-1; int y = rect.y-1; int w = rect.width/2+1; int h = rect.height/2+1; g.drawRect(x, y, rect.width+1, rect.height+1); Image resizeHandle = GridDesigner.RESIZE_HANDLE; int rw = resizeHandle.getWidth(null); int rh = resizeHandle.getHeight(null); g.drawImage(resizeHandle, x-rw, y-rh, null); // left-top x += w; g.drawImage(resizeHandle, x-rw/2, y-rh, null); // top x += rect.width+2-w; g.drawImage(resizeHandle, x, y-rh, null); // right-top y += h; g.drawImage(resizeHandle, x, y-rh/2, null); // right y += rect.height+2-h; g.drawImage(resizeHandle, x, y, null); // right-bottom x -= rect.width+2-w; g.drawImage(resizeHandle, x-rw/2, y, null); // bottom x -= w; g.drawImage(resizeHandle, x-rw, y, null); // left-bottom y -= rect.height+2-h; g.drawImage(resizeHandle, x-rw, y-rh/2, null); // left } gClip.dispose(); } /** * Paints resizing feedback. * * @param g graphics object. */ private void paintResizing(Graphics g) { int xDelta = newGridX - gridInfo.getGridX(focusedComponent); int yDelta = newGridY - gridInfo.getGridY(focusedComponent); int heightDelta = newGridHeight - gridInfo.getGridHeight(focusedComponent); int widthDelta = newGridWidth - gridInfo.getGridWidth(focusedComponent); g.setColor(GridDesigner.SELECTION_COLOR); g.drawRect(draggingRect.x, draggingRect.y, draggingRect.width, draggingRect.height); g.setColor(HIGHLIGHT_COLOR); int[] columnBounds = gridInfo.getColumnBounds(); int[] rowBounds = gridInfo.getRowBounds(); Point shift = fromComponentPane(new Point()); for (Component selComp : selection) { int newCompGridX = gridInfo.getGridX(selComp)+xDelta; int newCompGridWidth = gridInfo.getGridWidth(selComp)+widthDelta; int newCompGridY = gridInfo.getGridY(selComp)+yDelta; int newCompGridHeight = gridInfo.getGridHeight(selComp)+heightDelta; for(int i = newCompGridX; i < newCompGridX + newCompGridWidth; i++) { for(int j = newCompGridY; j < newCompGridY + newCompGridHeight; j++) { if(!gridInfo.isGapColumn(i) && !gridInfo.isGapRow(j)) { int x = extendedColumnBound(columnBounds, i); int width = extendedColumnBound(columnBounds, i + 1) - x; int y = extendedRowBound(rowBounds, j); int height = extendedRowBound(rowBounds, j + 1) - y; g.fillRect(x + shift.x, y + shift.y, width, height); } } } } } private Rectangle selectionResizingBounds(Component selComp) { int[] columnBounds = gridInfo.getColumnBounds(); int[] rowBounds = gridInfo.getRowBounds(); int gridX = gridInfo.getGridX(selComp); int gridY = gridInfo.getGridY(selComp); int gridWidth = gridInfo.getGridWidth(selComp); int gridHeight = gridInfo.getGridHeight(selComp); int x = columnBounds[gridX]; int width = columnBounds[gridX+gridWidth]-x; int y = rowBounds[gridY]; int height = rowBounds[gridY+gridHeight]-y; return new Rectangle(x,y,width,height); } /** * Returns the position of the specified grid vertical line (= column edge). * It returns either the position of the existing line or the suggested * position of a newly created line. * * @param bounds positions of the existing lines. * @param index index of the line we are interested in. * @return position of the specified grid line. */ private int extendedColumnBound(int[] bounds, int index) { int bound; if (index<bounds.length) { bound = bounds[index]; } else { if(gridInfo.hasGaps()) { int gapWidth = FormLoaderSettings.getInstance().getGapWidth(); bound = bounds[bounds.length-1]; for(int i = bounds.length; i <= index; i++) { if(gridInfo.isGapColumn(i + 1)) { bound += gapWidth; } else { bound += GridUtils.PADDING_SIZE_STANDARD; } } } else { bound = bounds[bounds.length-1]+(index-bounds.length+1)*GridUtils.PADDING_SIZE_STANDARD; } } return bound; } /** * Returns the position of the specified grid horizontal line (= row edge). * It returns either the position of the existing line or the suggested * position of a newly created line. * * @param bounds positions of the existing lines. * @param index index of the line we are interested in. * @return position of the specified grid line. */ private int extendedRowBound(int[] bounds, int index) { int bound; if (index<bounds.length) { bound = bounds[index]; } else { if(gridInfo.hasGaps()) { int gapWidth = FormLoaderSettings.getInstance().getGapHeight(); bound = bounds[bounds.length-1]; for(int i = bounds.length; i <= index; i++) { if(gridInfo.isGapRow(i + 1)) { bound += gapWidth; } else { bound += GridUtils.PADDING_SIZE_STANDARD; } } } else { bound = bounds[bounds.length-1]+(index-bounds.length+1)*GridUtils.PADDING_SIZE_STANDARD; } } return bound; } /** * Determines if we are moving east side of the component during resizing. * * @return {@code true} is we are moving east side of the component, * returns {@code false} otherwise. */ private boolean isResizingEastward() { return (resizingMode == SwingConstants.EAST || resizingMode == SwingConstants.SOUTH_EAST || resizingMode == SwingConstants.NORTH_EAST); } /** * Determines if we are moving west side of the component during resizing. * * @return {@code true} is we are moving west side of the component, * returns {@code false} otherwise. */ private boolean isResizingWestward() { return (resizingMode == SwingConstants.WEST || resizingMode == SwingConstants.SOUTH_WEST || resizingMode == SwingConstants.NORTH_WEST); } /** * Determines if we are moving south side of the component during resizing. * * @return {@code true} is we are moving south side of the component, * returns {@code false} otherwise. */ private boolean isResizingSouthward() { return (resizingMode == SwingConstants.SOUTH || resizingMode == SwingConstants.SOUTH_EAST || resizingMode == SwingConstants.SOUTH_WEST); } /** * Determines if we are moving north side of the component during resizing. * * @return {@code true} is we are moving north side of the component, * returns {@code false} otherwise. */ private boolean isResizingNorthward() { return (resizingMode == SwingConstants.NORTH || resizingMode == SwingConstants.NORTH_EAST || resizingMode == SwingConstants.NORTH_WEST); } /** * Calculates a resizing rectangle (a part of the resizing feedback). * * @param resizingEnd potential end of the resizing (the current location * of the mouse cursor). * @return resizing rectangle that is used as a part of the resizing feedback. */ Rectangle calculateResizingRectangle(Point resizingEnd, Component selComp) { Rectangle rect = fromComponentPane(selectionResizingBounds(selComp)); int dx = resizingEnd.x - draggingStart.x; int dy = resizingEnd.y - draggingStart.y; if (isResizingEastward()) { rect.width += dx; if (rect.width < 0) { rect.width = 0; } } if (isResizingSouthward()) { rect.height += dy; if (rect.height < 0) { rect.height = 0; } } if (isResizingWestward()) { rect.width -= dx; rect.x += dx; if (rect.width < 0) { rect.x += rect.width; rect.width = 0; } } if (isResizingNorthward()) { rect.height -= dy; rect.y += dy; if (rect.height < 0) { rect.y += rect.height; rect.height = 0; } } return rect; } /** * Calculates the grid location of the current resizing rectangle * ({@code draggingRect}). */ void calculateResizingGridLocation() { Rectangle rect = toComponentPane(draggingRect); int x = gridInfo.getGridX(focusedComponent); int y = gridInfo.getGridY(focusedComponent); int width = gridInfo.getGridWidth(focusedComponent); int height = gridInfo.getGridHeight(focusedComponent); if (isResizingEastward()) { int currentX = gridXLocation(rect.x+rect.width, false); if( !gridInfo.isGapColumn(currentX) ) { newGridWidth = Math.max(width-selMinWidth+1, currentX-x+1); } } if (isResizingWestward()) { int currentX = gridXLocation(rect.x, false); if( !gridInfo.isGapColumn(currentX) ) { newGridX = Math.max(x-selMinX, Math.min(x+width-(width-selMinWidth+1), currentX)); newGridWidth = x+width-newGridX; } } if (isResizingSouthward()) { int currentY = gridYLocation(rect.y+rect.height, false); if( !gridInfo.isGapRow(currentY) ) { newGridHeight = Math.max(height-selMinHeight+1, currentY-y+1); } } if (isResizingNorthward()) { int currentY = gridYLocation(rect.y, false); if( !gridInfo.isGapRow(currentY) ) { newGridY = Math.max(y-selMinY, Math.min(y+height-(height-selMinHeight+1), currentY)); newGridHeight = y+height-newGridY; } } } /** * Calculates a moving rectangle (a part of the moving feedback). * * @param movingEnd potential end of the moving (the current location * of the mouse cursor). * @return moving rectangle that is used as a part of the moving feedback. */ Rectangle calculateMovingRectangle(Point movingEnd) { Rectangle rect = focusedComponent.getBounds(); rect.x += movingEnd.x-draggingStart.x; rect.y += movingEnd.y-draggingStart.y; return fromComponentPane(rect); } /** * Calculates the grid location of the moved component. * * @param cursorLocation current position of the cursor. */ void calculateMovingGridLocation(Point cursorLocation) { Point start = toComponentPane(draggingStart); Point end = toComponentPane(cursorLocation); int startX = gridXLocation(start.x, true); int startY = gridYLocation(start.y, true); int endX = gridXLocation(end.x, false); int endY = gridYLocation(end.y, false); int deltaX = endX-startX; int deltaY = endY-startY; deltaX = Math.max(deltaX, -selMinX); deltaY = Math.max(deltaY, -selMinY); int tempGridX = gridInfo.getGridX(focusedComponent) + deltaX; int tempGridY = gridInfo.getGridY(focusedComponent) + deltaY; if( !gridInfo.isGapColumn(tempGridX) && !gridInfo.isGapRow(tempGridY) ) { newGridX = tempGridX; newGridY = tempGridY; } } /** * Updates cursor according to its location. For example, it sets * the appropriate resizing cursor when the mouse is over the boundary * of the selection component. * * @param cursorLocation current mouse cursor location. */ void updateCursor(Point cursorLocation) { Cursor cursor = Cursor.getDefaultCursor(); if (cursorLocation == null) { resizingMode = 0; } else { int x = cursorLocation.x; int y = cursorLocation.y; Image resizeHandle = GridDesigner.RESIZE_HANDLE; int rw = resizeHandle.getWidth(null); int rh = resizeHandle.getHeight(null); for (Component selComp : selection) { Rectangle rect = fromComponentPane(selectionResizingBounds(selComp)); boolean w = (rect.x-rw<=x) && (x<=rect.x+rect.width+rw); boolean h = (rect.y-rh<=y) && (y<=rect.y+rect.height+rh); boolean top = w && (rect.y-rh<=y) && (y<=rect.y+2); boolean bottom = w && (rect.y+rect.height-2<=y) && (y<=rect.y+rect.height+rh); boolean left = h && (rect.x-rw<=x) && (x<=rect.x+2); boolean right = h && (rect.x+rect.width-2<=x) && (x<=rect.x+rect.width+rw); if (top) { if (left) { cursor = Cursor.getPredefinedCursor(Cursor.NW_RESIZE_CURSOR); resizingMode = SwingConstants.NORTH_WEST; } else if (right) { cursor = Cursor.getPredefinedCursor(Cursor.NE_RESIZE_CURSOR); resizingMode = SwingConstants.NORTH_EAST; } else { cursor = Cursor.getPredefinedCursor(Cursor.N_RESIZE_CURSOR); resizingMode = SwingConstants.NORTH; } } else if (bottom) { if (left) { cursor = Cursor.getPredefinedCursor(Cursor.SW_RESIZE_CURSOR); resizingMode = SwingConstants.SOUTH_WEST; } else if (right) { cursor = Cursor.getPredefinedCursor(Cursor.SE_RESIZE_CURSOR); resizingMode = SwingConstants.SOUTH_EAST; } else { cursor = Cursor.getPredefinedCursor(Cursor.S_RESIZE_CURSOR); resizingMode = SwingConstants.SOUTH; } } else if (left) { cursor = Cursor.getPredefinedCursor(Cursor.W_RESIZE_CURSOR); resizingMode = SwingConstants.WEST; } else if (right) { cursor = Cursor.getPredefinedCursor(Cursor.E_RESIZE_CURSOR); resizingMode = SwingConstants.EAST; } else { cursor = Cursor.getDefaultCursor(); resizingMode = 0; } if (resizingMode != 0) { focusedComponent = selComp; break; } } } setCursor(cursor); } // Conversion of coordinates /** * Converts a {@code point} in {@code innerPane} coordinates to * a corresponding point in {@code componentPane} coordinates. * * @param point point in {@code innerPane} coordinates. * @return point in {@code componentPane} coordinates. */ Point toComponentPane(Point point) { return SwingUtilities.convertPoint(innerPane, point, componentPane); } /** * Converts a {@code rectangle} in {@code innerPane} coordinates to * a corresponding rectangle in {@code componentPane} coordinates. * * @param rectangle rectangle in {@code innerPane} coordinates. * @return rectangle in {@code componentPane} coordinates. */ Rectangle toComponentPane(Rectangle rectangle) { return SwingUtilities.convertRectangle(innerPane, rectangle, componentPane); } /** * Converts a {@code point} in {@code componentPane} coordinates to * a corresponding point in {@code innerPane} coordinates. * * @param point point in {@code componentPane} coordinates. * @return point in {@code innerPane} coordinates. */ Point fromComponentPane(Point point) { return SwingUtilities.convertPoint(componentPane, point, innerPane); } /** * Converts a {@code rectangle} in {@code componentPane} coordinates to * a corresponding rectangle in {@code innerPane} coordinates. * * @param rectangle rectangle in {@code componentPane} coordinates. * @return rectangle in {@code innerPane} coordinates. */ Rectangle fromComponentPane(Rectangle rectangle) { return SwingUtilities.convertRectangle(componentPane, rectangle, innerPane); } /** * Returns {@code x} grid coordinate that corresponds to the given * pixel coordinate ({@code xComponentPaneCoordinate}). * * @param xComponentPaneCoordinate pixel coordinate. * @param mustBeInside determines whether the returned coordinate * must be forced to lay in the existing grid. * @return grid {@code x} coordinate. */ private int gridXLocation(int xComponentPaneCoordinate, boolean mustBeInside) { int[] bounds = gridInfo.getColumnBounds(); int gridX = -1; while (gridX+1<bounds.length && bounds[gridX+1]<=xComponentPaneCoordinate) { gridX++; } if (mustBeInside) { gridX = Math.max(0,Math.min(gridX, bounds.length-2)); } else if (gridX == bounds.length-1) { if(gridInfo.hasGaps()) { int gapWidth = FormLoaderSettings.getInstance().getGapWidth(); int coordinateX = bounds[bounds.length-1]+1; while (coordinateX <= xComponentPaneCoordinate) { if(gridInfo.isGapColumn(gridX + 1)) { coordinateX += gapWidth; } else { coordinateX += GridUtils.PADDING_SIZE_STANDARD; } gridX++; } } else { gridX = (xComponentPaneCoordinate-bounds[bounds.length-1]+1)/GridUtils.PADDING_SIZE_STANDARD+bounds.length-1; } } return gridX; } /** * Returns {@code y} grid coordinate that corresponds to the given * pixel coordinate ({@code yComponentPaneCoordinate}). * * @param yComponentPaneCoordinate pixel coordinate. * @param mustBeInside determines whether the returned coordinate * must be forced to lay in the existing grid. * @return grid {@code y} coordinate. */ private int gridYLocation(int yComponentPaneCoordinate, boolean mustBeInside) { int[] bounds = gridInfo.getRowBounds(); int gridY = -1; while (gridY+1<bounds.length && bounds[gridY+1]<=yComponentPaneCoordinate) { gridY++; } if (mustBeInside) { gridY = Math.max(0,Math.min(gridY, bounds.length-2)); } else if (gridY == bounds.length-1) { if(gridInfo.hasGaps()) { int gapHeight = FormLoaderSettings.getInstance().getGapHeight(); int coordinateY = bounds[bounds.length-1]+1; while (coordinateY <= yComponentPaneCoordinate) { if(gridInfo.isGapRow(gridY + 1)) { coordinateY += gapHeight; } else { coordinateY += GridUtils.PADDING_SIZE_STANDARD; } gridY++; } } else { gridY = (yComponentPaneCoordinate-bounds[bounds.length-1]+1)/GridUtils.PADDING_SIZE_STANDARD+bounds.length-1; } } return gridY; } /** * Returns the component at the specified point. * * @param innerPanePoint point where we are looking for a component. * @return component at the specified point or {@code null}. */ Component findComponent(Point innerPanePoint) { Rectangle paneRect = fromComponentPane(new Rectangle(new Point(), componentPane.getSize())); if (paneRect.contains(innerPanePoint)) { for (Component comp : componentPane.getComponents()) { if (GridUtils.isPaddingComponent(comp)) { continue; } Rectangle rect = fromComponentPane(comp.getBounds()); if (rect.contains(innerPanePoint)) { return comp; } } // no component clicked directly, try to select some based on click in a grid cell for (Component comp : componentPane.getComponents()) { if (GridUtils.isPaddingComponent(comp)) { continue; } Rectangle rect = fromComponentPane(selectionResizingBounds(comp)); if (rect.contains(innerPanePoint)) { return comp; } } } return null; } /** * Returns the index of the column header at the specified point. * * @param innerPanePoint point whete we are looking for a column header. * @return index of the column header or {@code -1}. */ int findColumnHeader(Point innerPanePoint) { Point shift = fromComponentPane(new Point()); int y = gridInfo.getY()+shift.y-HEADER_GAP; if (y-headerHeight <= innerPanePoint.y && innerPanePoint.y <= y) { int[] bounds = gridInfo.getColumnBounds(); for (int i=0; i<bounds.length-1; i++) { int x = innerPanePoint.x-shift.x; if (bounds[i]<=x && x<bounds[i+1]) { if(gridInfo.isGapColumn(i)) { return -1; } else { return i; } } } } return -1; } /** * Returns the index of the row header at the specified point. * * @param innerPanePoint point whete we are looking for a row header. * @return index of the row header or {@code -1}. */ int findRowHeader(Point innerPanePoint) { Point shift = fromComponentPane(new Point()); int x = gridInfo.getX()+shift.x-HEADER_GAP; if (x-headerWidth <= innerPanePoint.x && innerPanePoint.x <= x) { int[] bounds = gridInfo.getRowBounds(); for (int i=0; i<bounds.length-1; i++) { int y = innerPanePoint.y-shift.y; if (bounds[i]<=y && y<bounds[i+1]) { if(gridInfo.isGapRow(i)) { return -1; } else { return i; } } } } return -1; } /** * Returns {@ DesignerContext} covering the current state of the designer. * * @return current designer context. */ DesignerContext currentContext() { DesignerContext context = new DesignerContext(); context.setSelectedColumns((BitSet)selectedColumns.clone()); context.setSelectedRows((BitSet)selectedRows.clone()); context.setSelectedComponents(new HashSet<Component>(selection)); context.setGridInfo(gridInfo); context.setFocusedRow(focusedCellRow); context.setFocusedColumn(focusedCellColumn); return context; } /** * Updates the current context of the designer according to the given * designer context. This method is used to update the designer context * according to needs of grid actions (it is invoked when a grid * action is finised). * * @param context designer context that should be reflected * the designer/glass pane. */ void updateCurrentContext(DesignerContext context) { setSelection(context.getSelectedComponents()); } /** * Change the grid location of the selected component according * to data collected during moving/resizing. */ void changeLocation() { int oldX = gridInfo.getGridX(focusedComponent); int oldY = gridInfo.getGridY(focusedComponent); int oldWidth = gridInfo.getGridWidth(focusedComponent); int oldHeight = gridInfo.getGridHeight(focusedComponent); boolean xChanged = (oldX != newGridX); boolean yChanged = (oldY != newGridY); boolean heightChanged = (oldHeight != newGridHeight); boolean widthChanged = (oldWidth != newGridWidth); if (xChanged || yChanged || widthChanged || heightChanged) { performAction(new ChangeLocationAction()); } } /** * Performs the given {@code GridAction}. * * @param action grid action to perform. */ @Override public void performAction(GridAction action) { GridActionWrapper wrapper = new GridActionWrapper(action); wrapper.setDesignerContext(currentContext()); wrapper.actionPerformed(null); } /** * Sets the selection. * * @param selComp component that should be the only selected component, * if it is {@code null} then the current selection is cleared. */ void setSelection(Component selComp) { setSelection((selComp==null) ? Collections.EMPTY_SET : Collections.singleton(selComp)); } /** * Sets the selection. * * @param selection new selection. */ void setSelection(Set<Component> selection) { assert !selection.contains(null); if (selection == this.selection) { return; } if (selection.isEmpty()) { updateCursor(null); } this.selection = selection; designer.setSelection(selection); requestFocusInWindow(); } /** * Processes key events. * * @param e key event. */ @Override protected void processKeyEvent(KeyEvent e) { int keyCode = e.getKeyCode(); if (keyCode == KeyEvent.VK_DELETE) { if (!selection.isEmpty()) { performAction(new DeleteComponentAction()); } } else if ((keyCode == KeyEvent.VK_ESCAPE) && (moving || resizing)) { // Cancel moving and resizing when Esc is pressed. moving = false; resizing = false; repaint(); } else { super.processKeyEvent(e); } } /** * Initializes {@code selMinX}, {@code selMaxX}, {@code selMinY}, * {@code selMaxY}, {@code selMinWidth} and {@code selMinHeight} fields. */ void initSelFields() { selMinX = Integer.MAX_VALUE; selMaxX = 0; selMinY = Integer.MAX_VALUE; selMaxY = 0; selMinWidth = Integer.MAX_VALUE; selMinHeight = Integer.MAX_VALUE; for (Component selComp : selection) { int gridX = gridInfo.getGridX(selComp); int gridY = gridInfo.getGridY(selComp); int gridWidth = gridInfo.getGridWidth(selComp); int gridHeight = gridInfo.getGridHeight(selComp); selMinX = Math.min(selMinX, gridX); selMaxX = Math.max(selMaxX, gridX+gridWidth-1); selMinY = Math.min(selMinY, gridY); selMaxY = Math.max(selMaxY, gridY+gridHeight-1); selMinWidth = Math.min(selMinWidth, gridWidth); selMinHeight = Math.min(selMinHeight, gridHeight); } } private static boolean ctrlOrCmdModifier(MouseEvent e) { if (Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() == InputEvent.META_MASK) { // on Mac return (e.getModifiersEx() & InputEvent.META_DOWN_MASK) == InputEvent.META_DOWN_MASK; } return (e.getModifiers() & InputEvent.CTRL_MASK) == InputEvent.CTRL_MASK; } private void showPopupMenu(Point point) { List<GridAction> actions = null; // Component actions DesignerContext context = currentContext(); if (!selection.isEmpty()) { context.setFocusedComponent(focusedComponent); actions = gridManager.designerActions(GridAction.Context.COMPONENT); } // Column actions int column = findColumnHeader(point); context.setFocusedColumn(column); if (column != -1) { actions = gridManager.designerActions(GridAction.Context.COLUMN); } // Row actions int row = findRowHeader(point); context.setFocusedRow(row); if (row != -1) { actions = gridManager.designerActions(GridAction.Context.ROW); } // Grid actions if (column == -1 && row == -1) { Point shift = fromComponentPane(new Point()); int x = gridInfo.getX(); int y = gridInfo.getY(); int width = gridInfo.getWidth(); int height = gridInfo.getHeight(); Rectangle rect = new Rectangle(x+shift.x, y+shift.y, width, height); if (rect.contains(point)) { focusedCellColumn = gridXLocation(point.x-shift.x, true); focusedCellRow = gridYLocation(point.y-shift.y, true); if( !gridInfo.isGapColumn(focusedCellColumn) && !gridInfo.isGapRow(focusedCellRow) ) { context.setFocusedColumn(focusedCellColumn); context.setFocusedRow(focusedCellRow); List<GridAction> moreActions = gridManager.designerActions(GridAction.Context.CELL); if (moreActions != null && !moreActions.isEmpty()) { if (actions == null) { actions = moreActions; } else { List<GridAction> l = new ArrayList<GridAction>(actions.size() + moreActions.size()); l.addAll(actions); l.addAll(moreActions); actions = l; } } } else { focusedCellColumn = -1; focusedCellRow = -1; } } } else { focusedCellColumn = -1; focusedCellRow = -1; } if (actions != null) { JPopupMenu menu = new JPopupMenu(); for (GridAction action : actions) { JMenuItem menuItem = action.getPopupPresenter(GlassPane.this); if (menuItem == null) { GridActionWrapper wrapper = new GridActionWrapper(action); wrapper.setDesignerContext(context); menu.add(wrapper); } else { menu.add(menuItem); } } designer.updateContextMenu(context, menu); draggingStart = null; menu.show(GlassPane.this, point.x, point.y); } } /** * Listener for glass-pane user gestures. */ class Listener extends MouseAdapter { @Override public void mousePressed(MouseEvent e) { Point point = e.getPoint(); draggingStart = point; boolean leftMousePressed = (e.getButton() == MouseEvent.BUTTON1); boolean rightMousePressed = (e.getButton() == MouseEvent.BUTTON3); if (leftMousePressed) { if (resizingMode == 0) { focusedComponent = findComponent(point); if (e.isPopupTrigger()) { // Mac if (!selection.contains(focusedComponent)) { setSelection(focusedComponent); } showPopupMenu(point); } else if (!e.isShiftDown()) { // shift adding to selection on mouse release if (focusedComponent != null && ctrlOrCmdModifier(e)) { Set<Component> newSelection = new HashSet<Component>(); newSelection.addAll(selection); if (selection.contains(focusedComponent)) { newSelection.remove(focusedComponent); } else { newSelection.add(focusedComponent); } setSelection(newSelection); } else if (!selection.contains(focusedComponent)) { setSelection(focusedComponent); } } // // Column selection // int column = findColumnHeader(point); // if (column != -1) { //// selectedColumns.flip(column); // } // // Row selection // int row = findRowHeader(point); // if (row != -1) { //// selectedRows.flip(row); // } } else { // Resizing (start) resizing = true; requestFocusInWindow(); draggingRect = fromComponentPane(selectionResizingBounds(focusedComponent)); newGridX = gridInfo.getGridX(focusedComponent); newGridY = gridInfo.getGridY(focusedComponent); newGridHeight = gridInfo.getGridHeight(focusedComponent); newGridWidth = gridInfo.getGridWidth(focusedComponent); initSelFields(); } } else if (rightMousePressed) { if (moving || resizing) { moving = false; resizing = false; draggingStart = null; } else { focusedComponent = findComponent(point); if (!selection.contains(focusedComponent)) { setSelection(focusedComponent); } if (e.isPopupTrigger()) { // Linux showPopupMenu(point); } } } repaint(); } @Override public void mouseReleased(MouseEvent e) { Point point = e.getPoint(); if (moving) { moving = false; changeLocation(); } else if (resizing) { resizing = false; changeLocation(); } else if (selecting) { selecting = false; Set<Component> newSelection = new HashSet<Component>(); Rectangle paneRect = fromComponentPane(new Rectangle(new Point(), componentPane.getSize())); for (Component comp : componentPane.getComponents()) { if (GridUtils.isPaddingComponent(comp)) { continue; } Rectangle rect = fromComponentPane(comp.getBounds()); rect = rect.intersection(paneRect); if (draggingRect.intersects(rect)) { if (newSelection.contains(comp)) { newSelection.remove(comp); } else { newSelection.add(comp); } } } setSelection(newSelection); } else { // no dragging, just a click boolean leftMouseReleased = (e.getButton() == MouseEvent.BUTTON1); focusedComponent = findComponent(point); if (e.isPopupTrigger()) { if (draggingStart != null) { // i.e. right click did not cancel dragging if (!selection.contains(focusedComponent)) { setSelection(focusedComponent); } showPopupMenu(point); // Windows } } else if (leftMouseReleased && e.isShiftDown()) { if (focusedComponent != null && !selection.contains(focusedComponent)) { Set<Component> newSelection = new HashSet<Component>(); newSelection.addAll(selection); newSelection.add(focusedComponent); setSelection(newSelection); } } else if (!ctrlOrCmdModifier(e) && draggingStart != null) { // not releasing after multiselect or canceled dragging setSelection(focusedComponent); // force single select } } repaint(); } @Override public void mouseMoved(MouseEvent e) { if (!selection.isEmpty()) { updateCursor(e.getPoint()); } updateActiveHeaders(e.getPoint()); } @Override public void mouseDragged(MouseEvent e) { if (draggingStart == null) { draggingStart = e.getPoint(); } if (resizing) { draggingRect = calculateResizingRectangle(e.getPoint(), focusedComponent); calculateResizingGridLocation(); } else if (focusedComponent == null || e.isShiftDown()) { selecting = true; draggingRect = new Rectangle(draggingStart); draggingRect.add(e.getPoint()); } else if (!selection.isEmpty()) { if (SwingUtilities.isLeftMouseButton(e)) { if (!moving) { // Moving start newGridHeight = gridInfo.getGridHeight(focusedComponent); newGridWidth = gridInfo.getGridWidth(focusedComponent); initSelFields(); requestFocusInWindow(); } moving = true; draggingRect = calculateMovingRectangle(e.getPoint()); calculateMovingGridLocation(e.getPoint()); } } repaint(); } } /** * Adapts {@code GridAction} to be a {@code javax.swing.Action} * and supports animated changes of the layout and the grid. */ class GridActionWrapper extends AbstractAction { /** Wrapped {@code GridAction}. */ private GridAction delegate; /** The designer context given to this action. */ private DesignerContext currentContext; /** * Creates a new wrapper around the specified action. * * @param action action to wrap. */ GridActionWrapper(GridAction action) { this.delegate = action; } /** * Gives a designer context to this action. * * @param currentContext current designer context. */ public void setDesignerContext(DesignerContext currentContext) { this.currentContext = currentContext; setEnabled(delegate.isEnabled(currentContext)); } /** * Invokes the wrapped action and animates its changes. * * @param e action event. */ @Override public void actionPerformed(ActionEvent e) { animation = true; int[] animOldColumnBounds = gridInfo.getColumnBounds(); int[] animOldRowBounds = gridInfo.getRowBounds(); animLayer.setContainer(componentPane); animLayer.setGlassPane(GlassPane.this); animLayer.setVIPComponents(new ArrayList<Component>(selection)); animLayer.loadStart(); GridBoundsChange change = delegate.performAction(gridManager, currentContext); updateCurrentContext(currentContext); animLayer.loadEnd(); int[] animNewColumnBounds; int[] animNewRowBounds; if (change == null) { animNewColumnBounds = gridInfo.getColumnBounds(); animNewRowBounds = gridInfo.getRowBounds(); if(gridInfo.hasGaps()) { if( animNewColumnBounds.length > gridInfo.getLastGapColumn() + 3 ) { animNewColumnBounds = resizeArray(animNewColumnBounds, gridInfo.getLastGapColumn() + 3); } if( animNewRowBounds.length > gridInfo.getLastGapRow() + 3 ) { animNewRowBounds = resizeArray(animNewRowBounds, gridInfo.getLastGapRow() + 3); } } } else { animOldColumnBounds = change.getOldColumnBounds(); animOldRowBounds = change.getOldRowBounds(); animNewColumnBounds = change.getNewColumnBounds(); animNewRowBounds = change.getNewRowBounds(); } if (animNewColumnBounds.length != animOldColumnBounds.length) { if (animNewColumnBounds.length > animOldColumnBounds.length) { animOldColumnBounds = resizeArray(animOldColumnBounds, animNewColumnBounds.length); } else { animNewColumnBounds = resizeArray(animNewColumnBounds, animOldColumnBounds.length); } } if (animNewRowBounds.length != animOldRowBounds.length) { if (animNewRowBounds.length > animOldRowBounds.length) { animOldRowBounds = resizeArray(animOldRowBounds, animNewRowBounds.length); } else { animNewRowBounds = resizeArray(animNewRowBounds, animOldRowBounds.length); } } change = new GridBoundsChange(animOldColumnBounds, animOldRowBounds, animNewColumnBounds, animNewRowBounds); // Update customizer if (customizer != null) { DesignerContext context = currentContext(); customizer.setContext(context); } // Animate, if there is something to animate if(!noChange(change)) { animChange = change; animLayer.animate(); } else { animation = false; } } /** * Checks whether column/row bounds have changed and need to be animated * * @param change between old and new column/row bounds. */ public boolean noChange(GridBoundsChange change) { if(!Arrays.equals(change.getNewColumnBounds(), change.getOldColumnBounds()) || !Arrays.equals(change.getNewRowBounds(), change.getOldRowBounds())) { return false; } return true; } /** * Returns larger/equal/shorter copy of the passed array. The additional slots * of this array are filled by the last value of the original array, * or the superfluous slots are trimmed. * * @param original original array. * @param newLength length of the new array. * @return resized array. */ private int[] resizeArray(int[] original, int newLength) { int[] result = original; if(newLength > original.length) { result = new int[newLength]; System.arraycopy(original, 0, result, 0, original.length); int last = original[original.length-1]; for (int i=original.length; i<newLength; i++) { result[i] = last; } } if(newLength < original.length) { assert newLength > 0; result = new int[newLength]; System.arraycopy(original, 0, result, 0, newLength); } return result; } @Override public Object getValue(String key) { Object value = delegate.getValue(key); if (value == null) { value = super.getValue(key); } return value; } } /** * Action that changes location of the selected component. */ class ChangeLocationAction extends AbstractGridAction { @Override public GridBoundsChange performAction(GridManager gridManager, DesignerContext context) { GridInfoProvider info = gridManager.getGridInfo(); int[] originalColumnBounds = info.getColumnBounds(); int[] originalRowBounds = info.getRowBounds(); GridUtils.revalidateGrid(gridManager); int columns = info.getColumnCount(); int rows = info.getRowCount(); int xDelta = newGridX - info.getGridX(focusedComponent); int yDelta = newGridY - info.getGridY(focusedComponent); int heightDelta = newGridHeight - info.getGridHeight(focusedComponent); int widthDelta = newGridWidth - info.getGridWidth(focusedComponent); GridUtils.removePaddingComponents(gridManager); if ((xDelta != 0) || (yDelta != 0) || (widthDelta != 0) || (heightDelta != 0)) { for (Component selComp : selection) { int gridX = info.getGridX(selComp); int gridY = info.getGridY(selComp); int width = info.getGridWidth(selComp); int height = info.getGridHeight(selComp); // We set all grid location properties even when // just one changes to avoid unexpected behaviour // caused by GridBagConstraint.RELATIVE or REMAINDER gridManager.setGridPosition(selComp, gridX+xDelta, gridY+yDelta, width+widthDelta, height+heightDelta); columns = Math.max(columns, gridX+xDelta+width+widthDelta); rows = Math.max(rows, gridY+yDelta+height+heightDelta); } } gridManager.updateLayout(false); GridUtils.revalidateGrid(gridManager); gridManager.updateGaps(false); GridUtils.addPaddingComponents(gridManager, columns, rows); GridUtils.revalidateGrid(gridManager); int[] newColumnBounds = gridInfo.getColumnBounds(); int[] newRowBounds = gridInfo.getRowBounds(); if (newColumnBounds.length>originalColumnBounds.length) { // Moving/resizing outside the original grid int[] oldBounds = new int[newColumnBounds.length]; for (int i=0; i<oldBounds.length; i++) { oldBounds[i] = extendedColumnBound(originalColumnBounds, i); } originalColumnBounds = oldBounds; } if (newRowBounds.length>originalRowBounds.length) { // Moving/resizing outside the original grid int[] oldBounds = new int[newRowBounds.length]; for (int i=0; i<oldBounds.length; i++) { oldBounds[i] = extendedRowBound(originalRowBounds, i); } originalRowBounds = oldBounds; } return new GridBoundsChange(originalColumnBounds, originalRowBounds, newColumnBounds, newRowBounds); } } }
java
Character combinations are an essential component of Free Fire MAX's gameplay, and they can provide players with a significant advantage on the battlefield. Each combo can only consist of one active ability and three passive ones. DJ Alok's incredible ability makes him one of the top choices to make a base for the combinations. Once activated, it creates an aura, increasing the movement speed by 10% and healing 5 HP/s for 5 seconds. There's a 45-second cooldown period after each use. Subsequently, users search for the best characters they can pair with Alok. Free Fire MAX: Character combinations for DJ Alok (March 2022) After eliminating an enemy, the location of all other foes within a range of 25 meters is revealed. In Otho's ability, the revealed location also gets shared with teammates. Alvaro's ability boosts explosive weapons' damage by 10%. It also increases the overall damage range by 7%, making it potent while using grenades and launchers. Buzzer Beater of Leon will lead to a health recovery by 5 points after users survive combat on the battlefield. This number will be surging to 30 at the max level of the character. If a player has Shirou equipped and is hit by an enemy within 80 meters, the character's ability will tag the attacker for 6 seconds. There's additionally 50% increased armor penetration in the first shot they hit on that foe. Luqueta's skill within Free Fire MAX boosts the maximum health by 10, up to a maximum of 50, after each kill users get on the battlefield. With the Bushido ability of Hayato, the armor penetration of players is increased by 7. 5%, with every 10% reduction in their overall health. In Free Fire MAX, Jota's ability will regenerate some health every time a player hits an adversary with a gun. Additionally, if they take down an enemy, they will have 10% of their health restored. When Jai's Raging Reload is equipped, a weapon's magazine is refilled by 30% of its maximum capacity after users knock an enemy (functions only with AR, SG, SMG, and Pistol). Opponents who players shoot are marked for 2 seconds, and their position is communicated with teammates as well. Note: Choice of character combinations is subjective, and the ones mentioned represent the writer's opinion. Additionally, all the abilities stated are at the lowest level of each character in Free Fire MAX. Check out the latest Free Fire MAX redeem codes here.
english
Vedang D Asgaonkar bagged AIR 7 in the JEE Advanced 2020 results announced today. We got talking to him to know more about his preparation process. By Roshni Chakrabarty: Vedang D Asgaonkar from Pune bagged an all-India rank of 7 in the JEE Advanced 2020 exam held on September 27. The engineering entrance exam is one of the toughest exams in the world and Vedang got a score of 326 out of 396, thus securing a position in the top 10 scorers among around 1. 6 lakh students who appeared for the interview. The son of a businessman and an organic chemistry teacher, Vedang studied at DAV Public School, Pune. We got talking to the JEE Advanced topper to know more about his exam preparation process and his future plans. The JEE Advanced 2020 result was announced today and interested candidates can check the answer key here. Vedang says that the confusion raised due to the Covid-19 pandemic on the postponement of JEE and NEET allowed him more time to prepare for the exam. “I could work on my weakness and improve myself. My teachers kept me motivated throughout the pandemic time,” he says. “I always took interest in science and maths, so JEE was a fun journey,” says the JEE Advanced topper. He credits his school teachers for their care, support and motivation. “They were very supportive of my great interest in innovation and in the field of science and technology,” he says. With a percentile of 99. 99% Vedang had topped Maharashtra in the JEE Main exam held at the beginning of September. “I had worked very hard, my parents had put in a lot of effort, and by god’s grace I scored well in JEE Advanced. My score has improved over JEE mains,” says the JEE Advanced topper. Vedang explains how he studied up to 14 hours a day and part of his rigorous preparation for JEE Advanced. “My teachers provided me with a lot of material and put in extra effort for me. The academic team at FIITJEE and Bakiwal Tutorials were great,” he says. To unwind, he took to sports. “I played light sports and had great friends who always cheered me up. They helped me relax,” he says. With the goal of building a career around computers, the JEE Advanced topper at Rank 7 is set to take admission at IIT Bombay. “IIT Bombay has always been my dream college. I would pick Computer Science Engineering,” he says. “My message to future aspirants would be to stay calm and composed, focus on the task at hand, work on it with your heart and soul and the best will happen to you," he adds. We wish Vedang all the best for his future!
english
<filename>data/usercss/51132.user.css<gh_stars>100-1000 /* ==UserStyle== @name WOG Forum - Cyborg Dark Bugfix @namespace USO Archive @author Steff @description `Behebt Probleme mit dem vBulletin Design Cyborg Dark im World of Games Forum.` @version 20110722.19.52 @license NO-REDISTRIBUTION @preprocessor uso ==/UserStyle== */ @namespace url(http://www.w3.org/1999/xhtml); @-moz-document domain("forum.wog.ch") { .time, .postdate .date .time{ color:#ccc !important; } }
css
{ "id": 28023, "title": [ "[Rumor Woods, Hammer Way]" ], "description": [ "A wagon filled with sawdust is parked in the middle of the road, its driver nowhere in sight. A small group of children astride stick horses brandish aspen branches streaming royal blue banderoles, laughing and shouting as they charge at each other in turn. A line of merchant stalls along one side of the road appear to have recently been afire, the scorched aspen wood still smoldering." ], "paths": [ "Obvious paths: north, east, west, northwest" ], "location": false, "wayto": { "28025": "go tent", "28026": "w" }, "timeto": { "28025": 0.2, "28026": 0.2 } }
json
export interface IMenuItem { name: string; component: any; iconClass: string; badge?: number; production?: boolean; }
typescript
<filename>astronat/core/__init__.py # -*- coding: utf-8 -*- # see LICENSE.rst """Basic Astronomy Functions. .. todo:: change this to C / pyx. whatever astropy's preferred C thing is. """ __author__ = "" # __copyright__ = "Copyright 2018, " # __credits__ = [""] # __license__ = "" # __version__ = "0.0.0" # __maintainer__ = "" # __email__ = "" # __status__ = "Production" # __all__ = [ # "" # ] ############################################################################## # IMPORTS # BUILT IN # THIRD PARTY # PROJECT-SPECIFIC ############################################################################## # END
python
import os import pickle import tempfile import timeit import sacred from golf_course.core.model import ToyModel from golf_course.utils import load_model_params from sacred.observers import FileStorageObserver log_folder = os.path.expanduser('~/logs/diffusion/capacity_based_hitprob') ex = sacred.Experiment('capacity_based_hitprob') ex.observers.append(FileStorageObserver.create(log_folder)) @ex.config def config(): case = 'med' time_step = 1e-6 inner_list = [1, 1] outer_list = [1, 1] num_points_list = [5000, 5000] num_clusters_list = [10, 10] num_trials_list = [5000, 5000] simulation_log_folder = os.path.expanduser( '~/entropic_barrier/results/simulation_based_hitprob/{}_target'.format(case) ) capacity_estimation_param_list = [ { "inner": inner_list[0], "outer": outer_list[0], "num_points": num_points_list[0], "num_clusters": num_clusters_list[0], "num_trials": num_trials_list[0], "use_parallel": False, "n_split": 1, "use_analytical_gradients": True, "estimate_gradients": False, "n_surfaces_gradients_estimation": 10, "time_step": time_step, }, { "inner": inner_list[1], "outer": outer_list[1], "num_points": num_points_list[1], "num_clusters": num_clusters_list[1], "num_trials": num_trials_list[1], "use_parallel": False, "n_split": 1, "use_analytical_gradients": True, "estimate_gradients": False, "n_surfaces_gradients_estimation": 10, "time_step": time_step, }, ] @ex.main def run(simulation_log_folder, time_step, capacity_estimation_param_list): temp_folder = tempfile.TemporaryDirectory() folder_name = temp_folder.name # Construct model model_params_fname = os.path.join(simulation_log_folder, 'model_params.pkl') ex.add_artifact(model_params_fname) _, target_param_list = load_model_params(model_params_fname) assert len(capacity_estimation_param_list) == len(target_param_list) # Make compatible with existing results for ii in range(len(target_param_list)): target_param_list[ii] = { key: target_param_list[ii][key] for key in target_param_list[ii] if key not in capacity_estimation_param_list[ii] } model = ToyModel(time_step, target_param_list) # Save simulation results results_fname = os.path.join(simulation_log_folder, 'results.pkl') ex.add_artifact(results_fname, 'simulation_results.pkl') # Estimate capacity-based hitting probability start = timeit.default_timer() hitting_prob = model.estimate_hitting_prob(capacity_estimation_param_list) end = timeit.default_timer() time_taken = end - start results = {'hitting_prob': hitting_prob, 'time_taken': time_taken} print(results) results_fname = os.path.join(folder_name, 'capacity_results.pkl') with open(results_fname, 'wb') as f: pickle.dump(results, f) ex.add_artifact(results_fname) temp_folder.cleanup() ex.run( config_updates={ 'case': 'large', 'time_step': 1e-7, 'outer_list': [5, 5], 'num_points_list': [1000, 1000], 'num_clusters_list': [3, 3], 'num_trials_list': [1000, 1000], } ) ex.run( config_updates={ 'case': 'med', 'time_step': 1e-5, 'outer_list': [7, 7], 'num_points_list': [1000, 1000], 'num_clusters_list': [3, 3], 'num_trials_list': [1000, 1000], } ) ex.run( config_updates={ 'case': 'small', 'time_step': 1e-6, 'outer_list': [7, 7], 'num_points_list': [1000, 1000], 'num_clusters_list': [3, 3], 'num_trials_list': [1000, 1000], } )
python