text
stringlengths
1
1.04M
language
stringclasses
25 values
<reponame>smagill/opensphere-desktop package io.opensphere.core.util.swing.input.model; import java.util.Collection; import java.util.Collections; import javax.swing.text.AttributeSet; import javax.swing.text.BadLocationException; import javax.swing.text.DocumentFilter; import org.apache.commons.lang3.StringUtils; import io.opensphere.core.util.CompoundPredicateWithMessage; import io.opensphere.core.util.ObservableValueValidatorSupport; import io.opensphere.core.util.PredicateWithMessage; import io.opensphere.core.util.WrappedPredicateWithMessage; import io.opensphere.core.util.collections.New; import io.opensphere.core.util.lang.StringUtilities; import io.opensphere.core.util.predicate.NotInPredicate; import io.opensphere.core.util.predicate.ValidURLPredicate; /** * Model for a URL. */ public class UrlModel extends TextModel { /** Serial version UID. */ private static final long serialVersionUID = 1L; /** The disallowed URLs. */ private Collection<String> myDisallowedUrls; /** * Constructor. */ public UrlModel() { setDisallowedUrls(Collections.<String>emptyList()); } @Override public DocumentFilter getDocumentFilter() { return new DocumentFilter() { @Override public void insertString(FilterBypass fb, int offset, String string, AttributeSet attr) throws BadLocationException { if (StringUtils.isEmpty(string)) { super.insertString(fb, offset, string, attr); } else { fb.insertString(offset, trimFront(string).replaceAll(" ", "+"), attr); } } @Override public void remove(FilterBypass fb, int offset, int length) throws BadLocationException { String existing = fb.getDocument().getText(0, fb.getDocument().getLength()); if (offset == 0 && StringUtils.isNotEmpty(existing)) { String candidate = existing.substring(0, offset) + existing.substring(offset + length, existing.length()); String trim = trimFront(candidate); // Any difference in the length of the candidate string and // the trimmed string should also be removed from the front // of the string. For example, attempting to remove the // first 3 characters of "foo bar" should result in removing // the first 4 characters. However, typically there should // not be // spaces in the URL since we substitute "+" instead. super.remove(fb, offset, length + candidate.length() - trim.length()); } else { super.remove(fb, offset, length); } } @Override public void replace(FilterBypass fb, int offset, int length, String text, AttributeSet attrs) throws BadLocationException { if (StringUtils.isEmpty(text)) { super.replace(fb, offset, length, text, attrs); } else if (offset == 0) { // Trim the front before replacing spaces. The length given // to the method is the length being removed, so it does not // need to be adjusted when we trim. fb.replace(offset, length, trimFront(text).replaceAll(" ", "+"), attrs); } else { // just replace space with "+", but do the regular document // replacement. fb.replace(offset, length, text.replaceAll(" ", "+"), attrs); } } /** * Trim only the front of the given string. This functions exactly * like the trim function of java.lang.String, but the end of the * string is not trimmed. * * @param orig The string to trim. * @return The trimmed string if trimming was necessary or the * original (same reference) if no trimming was required. */ private String trimFront(String orig) { int start = 0; while (start < orig.length() && orig.charAt(start) <= ' ') { ++start; } return start > 0 ? orig.substring(start, orig.length()) : orig; } }; } /** * Sets the disallowed URLs. * * @param disallowedUrls The disallowed URLs */ public final void setDisallowedUrls(Collection<String> disallowedUrls) { myDisallowedUrls = disallowedUrls; setValidator(); } @Override public void setRequired(boolean isRequired) { super.setRequired(isRequired); setValidator(); } /** * Set the validator based on the current disallowed URLs and required * properties. */ private void setValidator() { Collection<PredicateWithMessage<? super String>> predicates = New.collection(2); predicates.add(new WrappedPredicateWithMessage<>(new ValidURLPredicate()) { @Override public String getMessage() { return StringUtilities.concat(getName(), " is not a valid URL."); } @Override public boolean test(String input) { return !isRequired() && StringUtils.isEmpty(input) || super.test(input); } }); predicates.add(new WrappedPredicateWithMessage<String>(new NotInPredicate(myDisallowedUrls)) { @Override public String getMessage() { return StringUtilities.concat(getName(), " is already in use."); } }); PredicateWithMessage<String> predicate = new CompoundPredicateWithMessage<>(predicates); setValidatorSupport(new ObservableValueValidatorSupport<>(this, predicate)); } }
java
The SC order had removed the cap of 8 per cent in case of delay in depositing land price by builders to the authorities and kept it in the range of 15-23 percent compound interest. The developers felt the order could delay the registry of 1.5 lakh homes. “After studying the SC order, and the authorities’ response, the developers felt that the 15-23 percent compound interest would raise the final amount substantially. We are of the view that it would take the final figure much higher than the current market rate,” said Manoj Gaur, President, CREDAI NCR and CMD Gaur Group. In a meeting of CREDAI, over 100 developers of the region said that the delays were also on account of events outside their control. The National Real Estate Development Council(NAREDCO), has also written to the CEO of Noida authority, requesting to withdraw its recent order of charging high interest rates on dues by the builder. “It is mandatory that the authority should implement order of UP government dated simultaneously with compliance orders of the Supreme Court of July, 2020, in which both the Authorities had accepted to adopt SBI MCLR with a request to the Supreme Court that it should be 8.5% instead of 8% p.a. The said order has not been recalled by the Supreme Court in its order dated 07.11.2022 and the same is very much enforceable,“ R K Arora, president of NAREDCO UP said. According to CREDAI, the reason for delay include, plots allotted to them not having clear titles, NGT order on Okhla Bird Sanctuary where it banned all construction activities, settlement of the farmers’ compensation issue that took an inordinately long time and access to plots and development of basic infrastructure such as electricity, as promised by the authorities, not materializing within the stipulated time. As a result, developers had to defer taking possession of the land. “In that case we might have to take recourse to NCLT. Moreover, since occupancy and completion certificates are linked to the clearance of the dues, the buyers would not be able to register their homes,” Gaur added. The developers also felt that the present situation demanded a One Time Settlement (OTS) scheme as introduced in Haryana. The developers also decided that if the issue is not settled, they will represent the Noida and Greater Noida authorities, the UP finance minister, and the state chief secretary. Download The Economic Times News App to get Daily Market Updates & Live Business News.
english
import { createBottomTabNavigator } from 'react-navigation'; import Home from '../components/Home'; import Logout from '../components/Logout'; import ChatWindow from '../components/ChatWindow'; export const AuthorizedNav = createBottomTabNavigator( { Home: {screen: Home}, Logout:Logout, Chat : ChatWindow }, { initialRouteName : 'Home' } );
javascript
This thread is based on three documents: The DGC documents do not provide evidence whether and how the three promises will be met: The DGC documents do not provide evidence whether and how the three promises will be met: CLAIM 1 "Be accessible and secure for all EU citizens" So, security relies on (1) the signing keys being well protected, and (2) that those who can can create signatures are trusted. The framework foresees that DGCs can "be issued by hospitals, test centres, health authorities." The framework foresees that DGCs can "be issued by hospitals, test centres, health authorities." When signing is outsourced, how can the signer ensure that they create a DGC for the correct person? Or that this person has been vaccinated? How it is even possible to know whether an authorized person requested the signature and not a hacker that gained control over a computer? The security of the DGCs depends on: So the question is: how secure is a digital certificate in reality? does it provide enough security to outweigh the risk of discrimination and surveillance that it brings? does it really pay off to build such an infrastructure? While we are on the signature topic. What happens if a signing key has been abused? The proposal says there will be a list of revoked certificates per country. Will that country add all certificates signed by the abused key? And how will countries know which certificates to add to the revocation list? Only the "fraudulent" ones? How is that determined? Do they add all certificates signed with that key? What happens to the people who were legitimately vaccinated and signed under this key? Traditionally, revocation builds on top of a PKI hierarchy. It seems, however, that DGC does not implement such a hierarchy but instead implements a semblance of such a structure via a custom EU gateway. Why use established solutions when you can roll your own? CLAIM 2: "Be non-discriminatory". What matters for discrimination is not only the possibility of having a DGC. It is what the DGC will give access to, and under which circumstances. Example: if I have a DGC, but it says I am not vaccinated, can I travel? or go to a concert? or the pub? or to the synagoge? Example: if I have a DGC, but it says I am not vaccinated, can I travel? or go to a concert? or the pub? or to the synagoge? So the question is not whether the DGC is available. The questions are: 1) what are the conditions (vaccination, negative test) to receive a DGC that enables access to services and free movement? 2) how can people achieve these conditions, and can everybody achieve them? 1) what are the conditions (vaccination, negative test) to receive a DGC that enables access to services and free movement? 2) how can people achieve these conditions, and can everybody achieve them? CLAIM 3: "Contain only essential information". The certificate in itself is not a purpose, so it is not possible to claim it has only the essential data. Essential for what? The documents do not provide a goal or a justification. The minimal set of data proposed is pretty extensive, and not justified for the purposes one can foresee. What data registry? What is the goal of this link? Who holds this database? Who has access to it? (worth noting that the proposal suggests the possible use of selective disclosure -- only showing some attributes-- using cryptographic credentials. But these are already *unencrypted attributes*. How would selective disclosure even work? Yet another inconsistency) Very worrisome: the proposal completely ignores metadata associated with verification. The verifier can collect times, locations... these practicces are not even discouraged, just not accounted for despite their potential for surveillance. Even worse, the proposal foresees that there could be online verification. This type of verification would give the online verifying partner full visibility on citizens movements in real time. What are the safeguards planned? What other functions will they support? What other functions will they support? In summary: My conclusion is: this is an immature design of an extremely complex infrastructure with no guaranteed security. The proposed scheme is likely to go down the slippery slope of discrimination and surveillance.
english
Reef-dwelling catsharks wrap their fertilized eggs in leathery box-shaped cases commonly called “mermaid’s purses.” The tough, collagenous wall of the purse protects the developing young until it’s ready to hatch—anywhere from a month to a year after it’s laid, depending on its species. This short video from the Smithsonian Marine Station in Fort Pierce, Florida gives us a peek inside the case. The shark embryo is swimming! There’s a reason for that: It needs oxygen. The enormous yolk attached to its umbilical cord gives the embryo all the food it needs to grow. But once the embryo grows big enough, it needs more oxygen than the water inside the case can hold. And since the purse is tough and waterproof, it’s hard for fresher water to find its way inside. In some catshark species, a ‘swim-based’ pump solves the problem. Although the purse is sealed early in development, tiny holes eventually open on the long tendrils at its ends, and the embryo starts to swim. Its motion pumps water through the case, drawing oxygen-rich water through one end and pushing waste-filled water out the other. Contact the author at diane@io9.com.
english
<gh_stars>0 import React from 'react' import { messages } from '@cucumber/messages' export class EnvelopesQuery { private envelopes: messages.IEnvelope[] = [] public update(envelope: messages.IEnvelope) { this.envelopes.push(envelope) } public find(predicate: (envelope: messages.IEnvelope) => boolean): messages.IEnvelope { return this.envelopes.find(predicate) } public filter(predicate: (envelope: messages.IEnvelope) => boolean): messages.IEnvelope[] { return this.envelopes.filter(predicate) } } export default React.createContext(new EnvelopesQuery())
typescript
{"remainingRequest":"C:\\Users\\cwx\\Desktop\\editor-demo\\node_modules\\babel-loader\\lib\\index.js??ref--5-1!C:\\Users\\cwx\\Desktop\\editor-demo\\node_modules\\@ovine\\core\\node_modules\\core-js\\internals\\iterator-close.js","dependencies":[{"path":"C:\\Users\\cwx\\Desktop\\editor-demo\\node_modules\\@ovine\\core\\node_modules\\core-js\\internals\\iterator-close.js","mtime":1617857103016},{"path":"C:\\Users\\cwx\\Desktop\\editor-demo\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1616400859944},{"path":"C:\\Users\\cwx\\Desktop\\editor-demo\\node_modules\\babel-loader\\lib\\index.js","mtime":1617798315061}],"contextDependencies":[],"result":[{"type":"Buffer","data":"base64:<KEY>},{"version":3,"sources":["C:/Users/cwx/Desktop/editor-demo/node_modules/@ovine/core/node_modules/core-js/internals/iterator-close.js"],"names":["anObject","require","module","exports","iterator","returnMethod","undefined","call","value"],"mappings":"AAAA,IAAIA,QAAQ,GAAGC,OAAO,CAAC,wBAAD,CAAtB;;AAEAC,MAAM,CAACC,OAAP,GAAiB,UAAUC,QAAV,EAAoB;AACnC,MAAIC,YAAY,GAAGD,QAAQ,CAAC,QAAD,CAA3B;;AACA,MAAIC,YAAY,KAAKC,SAArB,EAAgC;AAC9B,WAAON,QAAQ,CAACK,YAAY,CAACE,IAAb,CAAkBH,QAAlB,CAAD,CAAR,CAAsCI,KAA7C;AACD;AACF,CALD","sourcesContent":["var anObject = require('../internals/an-object');\n\nmodule.exports = function (iterator) {\n var returnMethod = iterator['return'];\n if (returnMethod !== undefined) {\n return anObject(returnMethod.call(iterator)).value;\n }\n};\n"]}]}
json
import { withTheme } from 'styled-components'; import React from 'react'; import PropTypes from 'prop-types'; import slugify from 'slugify'; import Button from '../../../Button'; import { parseMd, getProportionalHeight } from '../../../../util'; import { Container } from '../../ContenfulModules.styled'; import { Background, Content, ImageWrapper, HeaderWrapper, } from './Styled'; const HeroSplitTemplate = ({ reference, title: rawTitle, backgroundColor, titleSub: rawTitleSub, description: rawDescription, image, callToActionButton, callToActionButtonUrl, callToActionSecondary, callToActionSecondaryUrl, customFields, }) => { const backgroundWhite = backgroundColor === '#FFFFFF' ? 'secondary' : undefined; const title = parseMd(rawTitle); const subtitle = parseMd(rawTitleSub); const description = parseMd(rawDescription); const jsonPropsRaw = customFields?.internal?.content || '{}'; const jsonProps = JSON.parse(jsonPropsRaw); return ( <Background color={backgroundColor} minHeightOnBrowser={image && image.file && ((getProportionalHeight({ targetWidth: 640, initialWidth: image.file.details.image.width, initialHeight: image.file.details.image.height, })) + 60)} > {title && ( <HeaderWrapper> <h1>{title}</h1> </HeaderWrapper> )} <Container as="section" id={slugify(reference, { lower: true })} > <Content> {jsonProps?.titleLeft && ( <h1>{jsonProps.titleLeft}</h1> )} {subtitle && ( <p>{subtitle}</p> )} <div> {callToActionButton && ( <Button variant={backgroundWhite} href={callToActionButtonUrl}> {callToActionButton} </Button> )} </div> </Content> <ImageWrapper> {image?.file ? ( <img src={image.file.url} alt={image.description} /> ) : null} </ImageWrapper> <Content> {jsonProps?.titleRight && ( <h1>{jsonProps.titleRight}</h1> )} {description && ( <p>{description}</p> )} <div> {callToActionSecondary && ( <Button variant={backgroundWhite} href={callToActionSecondaryUrl}> {callToActionSecondary} </Button> )} {image && image.file ? ( <img src={image.file.url} alt={image.description} /> ) : null} </div> </Content> </Container> </Background> ); }; HeroSplitTemplate.defaultProps = { reference: '', title: { title: '', }, backgroundColor: '#FFFFFF', titleSub: { titleSub: '', }, description: { description: '', }, image: null, callToActionButton: '', callToActionButtonUrl: '', callToActionSecondary: '', callToActionSecondaryUrl: '', customFields: {}, }; HeroSplitTemplate.propTypes = { reference: PropTypes.string, title: PropTypes.shape({ title: PropTypes.string, }), backgroundColor: PropTypes.string, titleSub: PropTypes.shape({ titleSub: PropTypes.string, }), description: PropTypes.shape({ description: PropTypes.string, }), image: PropTypes.shape({ file: PropTypes.shape({ url: PropTypes.string, details: PropTypes.shape({ image: PropTypes.shape({ width: PropTypes.number, height: PropTypes.number, }), }), }), description: PropTypes.string, }), callToActionButton: PropTypes.string, callToActionButtonUrl: PropTypes.string, callToActionSecondary: PropTypes.string, callToActionSecondaryUrl: PropTypes.string, customFields: PropTypes.shape({ internal: PropTypes.shape({ content: PropTypes.string, }), }), }; export default withTheme(HeroSplitTemplate);
javascript
<gh_stars>0 [ { "Comment": "Don't add a Context member to a struct type; instead add a ctx parameter to each method on that type that needs to pass it along.", "Filename": "main.go", "Line": 8, "Snippet": "type Example struct {\n\tName string\n\tCtx context.Context\n}\n" } ]
json
<gh_stars>0 package commands import ( "errors" "fmt" "strings" "github.com/Seasheller/grafana/pkg/cmd/grafana-cli/services" "github.com/Seasheller/grafana/pkg/cmd/grafana-cli/utils" ) var removePlugin func(pluginPath, id string) error = services.RemoveInstalledPlugin func removeCommand(c utils.CommandLine) error { pluginPath := c.PluginDirectory() plugin := c.Args().First() if plugin == "" { return errors.New("Missing plugin parameter") } err := removePlugin(pluginPath, plugin) if err != nil { if strings.Contains(err.Error(), "no such file or directory") { return fmt.Errorf("Plugin does not exist") } return err } return nil }
go
karera wa hitoban dake nebō shitai to omotte imasu. Eles querem, finalmente, dormir até tarde por uma noite. kare wa kanojo no hanashi o kiite imasu. Ele está ouvindo ela. nōfu wa kare no shokubutsu ni sawarimasu. O agricultor toca suas plantas. watashitachiha tomi o kyōyū suru koto o manabu hitsuyō ga arimasu. Precisamos aprender a compartilhar nossa riqueza.
english
<gh_stars>1-10 {"vue-router.cjs.js":"<KEY>,"vue-router.cjs.min.js":"<KEY>,"vue-router.esm-bundler.js":"<KEY>,"vue-router.esm.js":"<KEY>,"vue-router.js":"<KEY>,"vue-router.min.js":"<KEY>}
json
Although the womens movement has already transformed the way in which we look at society in each of our countries,the search for equality is far from finished. History,culture and economics still remain weighted against women. In my own country,most worrying of all is the declining sex ratio of females to males. That this is happening in regions of substantial economic prosperity within the country is even more disturbing. (I should add here,however,that in the recent Commonwealth Games in New Delhi,young women from these very regions won the most number of medals. ) Among all the challenges facing humankind in the 21st century,few are more pressing than climate change and global warming. Unfortunately,as the International Union for the Conservation of Nature has pointed out,most of the climate debate has so far been gender-blind. Yet women have played a special role in raising environmental consciousness. The Chipko movement in the Himalayas in the 1970s,in which village women hugged the trees to protect them from being felled,gave a new meaning and momentum to environmental activism in India. Like elsewhere in the world,and especially in India,it has not been easy to carve a direct solidarity among women. Their concerns are divided by class,by community,by caste,by culture. But through the 1970s and 80s,the womens movement in India flowered,banding together on issues like dowry and violence,household labour,discriminatory customs,property rights and wages. These campaigns resulted in the enactment of radical new laws. A visitor to contemporary India will be impressed by the prominence of women in all aspects of life. Indias president is a woman,as are the speaker and the leader of the opposition in the Lower House of Parliament. The chief minister of Indias most populous state is a woman from a section of society subjected to discrimination for centuries. Women are presidents of four of our major political parties. Women are prominent in the judiciary,the higher civil service,the professions,academia,the corporate world,the media and every branch of civil society. At the time of Independence,women accounted for less than 10 per cent of enrolment in higher education they will soon be on par with men. And it is not by government action alone that this silent revolution is taking place. Today,women in India are becoming agents of change through their own initiative,their energy and enterprise. Let me give you some examples of where and how women ordinary poor women are beginning to make a difference with far-reaching implications for our country as a whole. The first is the growth of womens self-help groups which are changing rural India. Groups of women pool their savings on a regular basis and secure loans for a variety of activities that help them increase their incomes. There are now about five million such groups,averaging 10-15 members each. Last year,they secured bank loans worth more than two billion pounds. By giving poor women access to credit (and I might add,with a repayment record far superior to that of well-heeled borrowers! ),these groups are helping to blunt the harsh edges of poverty and destitution. But women are doing more than getting loans. They are actually taking on a variety of functions on behalf of government departments. They are,for instance,buying rice and maize from farmers for sale through fair price shops. They are distributing old age pensions and scholarships. They are managing primary health centres. And in this pub-loving country,it may surprise you to know how successful they have been in forcing the closure of village liquor shops to combat male alcoholism,domestic violence and the drain on household finances. But there is something even more fundamentally revolutionary about this movement. It cuts across caste divides. It gives women a new voice,a new self-confidence,a new assertiveness. Attending a meeting of these women is an uplifting experience. When once they dared not open their mouths even within the family,let alone voice their concerns before outsiders,they are now vociferous in discussing personal and family problems as well as a whole range of community issues. The second arena where women have emerged as catalysts of change is politics,especially at the local level. In 1993,India amended its Constitution to provide 33 per cent reservation or quota for women in rural and urban local bodies throughout the country. There was cynicism,resentment and even anger – from powerful men,predictably when the idea was first mooted. No longer. Today,1. 2 million elected women representatives,including women from the most deprived and disadvantaged communities,have taken their place alongside men in the councils of rural self-government. Long-established power equations are now changing. But I am less than happy to admit that at the national level we have not yet been successful. Womens representation in Parliament has hovered between 9 and 11 per cent,a figure that is considerably lower than in many other democracies. Legislation for a 33 per cent quota in Parliament and state assemblies has been passed by the Upper House. We shall persevere in our efforts to get it approved by the Lower House as well. Over the last few years the language of rights has entered the mainstream of political discourse. Thus we now have a right to information,a right to work,a right to education and soon,a right to food security. What is remarkable about the rights debate and how it has progressed is the leading role women have played as its champions and advocates. Thanks to their passion and commitment,governance has become more open and accountable and public policies more caring of the poor. Environmental activism too is something in which women are prominent. This is not surprising because,in essence,the issue of environment in India is an issue of livelihoods,of public health,of access to forests,of water security. The fourth arena of impact is enterprise. The most visible may be women who lead some major Indian corporations,businesses and NGOs. But,perhaps even more significant are the unsung majority who make up over 90 per cent of all working women in what we call the informal or unorganised sector. For years,they enjoyed no pension,health insurance or maternity benefits,something that our government has begun to address.
english
Lord’s does not need any introduction; the name suffices. India move on to Lord’s for the second Test of the 2014 tour against England following the stalemate at Trent Bridge. Abhishek Mukherjee looks at the key numbers at the Mecca of Cricket. Other grounds — even Melbourne Cricket Ground — need introductions. Lord’s does not. The name suffices. The sheer thought of walking through the Long Room to bat brings goosebumps to youngsters. Everything about the ground — from the moment you enter Grace Gates — is made of dreams. There are bigger grounds; there are grounds that have seen more epic battles; but there has been no Lord’s. Let us have a look at the numbers at Lord’s, then. As one can see, there is not much of a difference between the numbers at Lord’s and the other English grounds. Let us, then, look back at some of the best performers at the historic ground. Top run-scorers at Lord’s: Highest scores at Lord’s: Most wickets at Lord’s: As is easily noticeable, James Anderson may turn out to be a major threat for the Indians. Best bowling at Lord’s: Highest team scores at Lord’s: Lowest team scores at Lord’s: Biggest partnerships at Lord’s: (Abhishek Mukherjee is the Deputy Editor and Cricket Historian at CricketCountry. He blogs at http://ovshake. blogspot. in and can be followed on Twitter at http://www. twitter. com/ovshake42)
english
/** * @license * Copyright 2016 Google Inc. All rights reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.security.wycheproof.testcases; import java.security.KeyPair; import java.security.KeyPairGenerator; import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; import java.util.HashSet; import javax.crypto.Cipher; import javax.crypto.NoSuchPaddingException; import junit.framework.TestCase; /** * RSA encryption tests * * @author <EMAIL> (<NAME>) */ // TODO(bleichen): test vectors check special cases: // - ciphertext too long // - plaintext too long // - ciphertext 0 // - ciphertext == modulus timing attacks public class RsaEncryptionTest extends TestCase { /** * Providers that implement RSA with PKCS1Padding but not OAEP are outdated and should be avoided * even if RSA is currently not used in a project. Such providers promote using an insecure * cipher. There is a great danger that PKCS1Padding is used as a temporary workaround, but later * stays in the project for much longer than necessary. */ public void testOutdatedProvider() throws Exception { try { Cipher c = Cipher.getInstance("RSA/ECB/PKCS1Padding"); try { Cipher.getInstance("RSA/ECB/OAEPWITHSHA-1ANDMGF1PADDING"); } catch (NoSuchPaddingException | NoSuchAlgorithmException ex) { fail("Provider " + c.getProvider().getName() + " is outdated and should not be used."); } } catch (NoSuchPaddingException | NoSuchAlgorithmException ex) { System.out.println("RSA/ECB/PKCS1Padding is not implemented"); } } /** * Tries decrypting random messages with a given algorithm. Counts the number of distinct error * messages and expects this number to be 1. * * <p><b>References:</b> * * <ul> * <li>Bleichenbacher, "Chosen ciphertext attacks against protocols based on the RSA encryption * standard PKCS# 1" Crypto 98 * <li>Manger, "A chosen ciphertext attack on RSA optimal asymmetric encryption padding (OAEP) * as standardized in PKCS# 1 v2.0", Crypto 2001 This paper shows that OAEP is susceptible * to a chosen ciphertext attack if error messages distinguish between different failure * condidtions. * <li><NAME>, Kawamoto, Simionato, <NAME>say "Efficient Padding Oracle Attacks on * Cryptographic Hardware", Crypto 2012 The paper shows that small differences on what * information an attacker recieves can make a big difference on the number of chosen * message necessary for an attack. * <li>Smart, "Errors matter: Breaking RSA-based PIN encryption with thirty ciphertext validity * queries" RSA conference, 2010 This paper shows that padding oracle attacks can be * successful with even a small number of queries. * </ul> * * <p><b>Some recent bugs:</b> CVE-2012-5081: Java JSSE provider leaked information through * exceptions and timing. Both the PKCS #1 padding and the OAEP padding were broken: * http://www-brs.ub.ruhr-uni-bochum.de/netahtml/HSS/Diss/MeyerChristopher/diss.pdf * * <p><b>What this test does not (yet) io:</b> * * <ul> * <li> A previous version of one of the provider leaked the block type. (when was this fixed?) * <li> Some attacks require a large number of ciphertexts to be detected if random ciphertexts * are used. Such problems require specifically crafted ciphertexts to run in a unit test. * E.g. "Attacking RSA-based Sessions in SSL/TLS" by <NAME>, <NAME>, and <NAME>: * https://eprint.iacr.org/2003/052/ * <li> Timing leakages because of differences in parsing the padding (e.g. CVE-2015-7827) Such * differences are too small to be reliably detectable in unit tests. * </ul> */ public void testExceptions(String algorithm) throws Exception { KeyPairGenerator keygen = KeyPairGenerator.getInstance("RSA"); keygen.initialize(1024); KeyPair keypair = keygen.genKeyPair(); SecureRandom rand = new SecureRandom(); Cipher c = Cipher.getInstance(algorithm); byte[] ciphertext = new byte[1024 / 8]; HashSet<String> exceptions = new HashSet<String>(); final int samples = 1000; for (int i = 0; i < samples; i++) { rand.nextBytes(ciphertext); ciphertext[0] &= (byte) 0x7f; try { c.init(Cipher.DECRYPT_MODE, keypair.getPrivate()); c.doFinal(ciphertext); } catch (Exception ex) { exceptions.add(ex.toString()); } } if (exceptions.size() > 1) { System.out.println("Exceptions for " + algorithm); for (String s : exceptions) { System.out.println(s); } fail("Exceptions leak information about the padding for " + algorithm); } } /** * Tests the exceptions for RSA decryption with PKCS1Padding. PKCS1Padding is susceptible to * chosen message attacks. Nonetheless, to minimize the damage of such an attack an implementation * should minimize the information about the failure in the padding. */ public void testExceptionsPKCS1() throws Exception { testExceptions("RSA/ECB/PKCS1PADDING"); } public void testGetExceptionsOAEP() throws Exception { testExceptions("RSA/ECB/OAEPWITHSHA-1ANDMGF1PADDING"); } }
java
Sri Lanka captain Dinesh Chandimal won the toss and elected to bat in the second and final Test against England beginning Friday at the Galle International Stadium. For the hosts, right-handed batsman Ramesh Mendis is making his debut and he becomes the 154th Sri Lankan player to represent his country in Test cricket. Suranga Lakmal and Oshada Fernando have also been included in the playing XI. The visitors have made just one change to their line-up, bringing in veteran pacer James Anderson in place of Stuart Broad who has been given a rest ahead of the four-Test series against India beginning next month. England had won the first Test by seven wickets to take a 1-0 lead in the series. Playing XIs: (Only the headline and picture of this report may have been reworked by the Business Standard staff; the rest of the content is auto-generated from a syndicated feed. )
english
#example { width: 100%; max-width: 600px; margin: 20px auto; padding-top: 2em; } #example .buttons { position: fixed; top: 0; left: 0; right: 100%; width: 100%; min-height: 1.5em; text-align: center; background-color: #555; padding: 5px; z-index: 100; } #example table { position: relative; width: 800px; border-collapse: collapse; border-top: 1px solid black; overflow: hidden; display: table; } #example table tr { border: none; border-bottom: 1px solid black; border-right: 1px solid black; } #example table thead tr { background: #f5f5f5; font-weight: bold; } #example table td { border: 1px solid black; border-top: none; border-bottom: none; border-right: none; padding: 0.5em; position: relative; } #example table th { border: 1px solid black; border-top: none; border-bottom: none; border-right: none; padding: 0.5em; position: relative; } /* for nested tables */ #example table td > table { width: 100%; } td > p:first-child { margin-top: 0; } td > p:last-child { margin-bottom: 0; }
css
{ "allow_import": 1, "allow_rename": 1, "autoname": "naming_series:", "creation": "2017-10-17 08:21:50.489773", "doctype": "DocType", "document_type": "Setup", "editable_grid": 1, "engine": "InnoDB", "field_order": [ "naming_series", "full_name", "status", "transporter", "column_break_2", "employee", "cell_number", "address", "license_details", "license_number", "column_break_8", "issuing_date", "column_break_10", "expiry_date", "driving_license_categories", "driving_license_category" ], "fields": [ { "fieldname": "naming_series", "fieldtype": "Select", "label": "Series", "options": "HR-DRI-.YYYY.-" }, { "fieldname": "full_name", "fieldtype": "Data", "in_list_view": 1, "label": "<NAME>", "reqd": 1 }, { "fieldname": "status", "fieldtype": "Select", "in_list_view": 1, "label": "Status", "options": "Active\nSuspended\nLeft", "reqd": 1 }, { "allow_in_quick_entry": 1, "description": "Applicable for external driver", "fieldname": "transporter", "fieldtype": "Link", "label": "Transporter", "options": "Supplier" }, { "fieldname": "column_break_2", "fieldtype": "Column Break" }, { "fieldname": "employee", "fieldtype": "Link", "in_list_view": 1, "label": "Employee", "options": "Employee" }, { "fieldname": "cell_number", "fieldtype": "Data", "label": "Cellphone Number" }, { "fieldname": "license_details", "fieldtype": "Section Break", "label": "License Details" }, { "fieldname": "license_number", "fieldtype": "Data", "label": "License Number" }, { "fieldname": "column_break_8", "fieldtype": "Column Break" }, { "fieldname": "issuing_date", "fieldtype": "Date", "label": "Issuing Date" }, { "fieldname": "column_break_10", "fieldtype": "Column Break" }, { "fieldname": "expiry_date", "fieldtype": "Date", "label": "Expiry Date" }, { "fieldname": "driving_license_categories", "fieldtype": "Section Break", "label": "Driving License Categories" }, { "fieldname": "driving_license_category", "fieldtype": "Table", "label": "Driving License Category", "options": "Driving License Category" }, { "fieldname": "address", "fieldtype": "Link", "label": "Address", "options": "Address" } ], "icon": "fa fa-user", "modified": "2019-07-18 16:29:14.151380", "modified_by": "Administrator", "module": "HR", "name": "Driver", "name_case": "Title Case", "owner": "Administrator", "permissions": [ { "email": 1, "export": 1, "print": 1, "read": 1, "report": 1, "role": "Fleet Manager", "share": 1 }, { "create": 1, "delete": 1, "email": 1, "export": 1, "print": 1, "read": 1, "report": 1, "role": "HR User", "share": 1, "write": 1 }, { "create": 1, "delete": 1, "email": 1, "export": 1, "print": 1, "read": 1, "report": 1, "role": "HR Manager", "share": 1, "write": 1 } ], "quick_entry": 1, "search_fields": "full_name", "show_name_in_global_search": 1, "sort_field": "modified", "sort_order": "DESC", "title_field": "full_name", "track_changes": 1 }
json
{"name": "hackUtils", "description": "It is a hack tool kit for pentest and web security research.", "license": null, "starNum": 291, "folkNum": 191, "watchNum": 291, "topic": []}
json
<filename>src/ndnSIM/NFD/daemon/table/cs-entry.hpp /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /** * Copyright (c) 2014-2017, Regents of the University of California, * Arizona Board of Regents, * Colorado State University, * University Pierre & <NAME>ie, Sorbonne University, * Washington University in St. Louis, * Beijing Institute of Technology, * The University of Memphis. * * This file is part of NFD (Named Data Networking Forwarding Daemon). * See AUTHORS.md for complete list of NFD authors and contributors. * * NFD is free software: you can redistribute it and/or modify it under the terms * of the GNU General Public License as published by the Free Software Foundation, * either version 3 of the License, or (at your option) any later version. * * NFD 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 General Public License for more details. * * You should have received a copy of the GNU General Public License along with * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>. */ #ifndef NFD_DAEMON_TABLE_CS_ENTRY_HPP #define NFD_DAEMON_TABLE_CS_ENTRY_HPP #include "core/common.hpp" namespace nfd { namespace cs { /** \brief represents a base class for CS entry */ class Entry { public: // exposed through ContentStore enumeration /** \return the stored Data * \pre hasData() */ const Data& getData() const { BOOST_ASSERT(this->hasData()); return *m_data; } /** \return Name of the stored Data * \pre hasData() */ const Name& getName() const { BOOST_ASSERT(this->hasData()); return m_data->getName(); } /** \return full name (including implicit digest) of the stored Data * \pre hasData() */ const Name& getFullName() const { BOOST_ASSERT(this->hasData()); return m_data->getFullName(); } /** \return whether the stored Data is unsolicited * \pre hasData() */ bool isUnsolicited() const { BOOST_ASSERT(this->hasData()); return m_isUnsolicited; } /** \return the absolute time when the stored Data becomes stale * \note if the returned TimePoint is in the past, the Data is stale * \pre hasData() */ const time::steady_clock::TimePoint& getStaleTime() const { BOOST_ASSERT(this->hasData()); return m_staleTime; } /** \brief checks if the stored Data is stale now * \pre hasData() */ bool isStale() const; /** \brief determines whether Interest can be satisified by the stored Data * \note ChildSelector is not considered * \pre hasData() */ bool canSatisfy(const Interest& interest) const; public: // used by generic ContentStore implementation /** \return true if a Data packet is stored */ bool hasData() const { return m_data != nullptr; } /** \brief replaces the stored Data */ void setData(shared_ptr<const Data> data, bool isUnsolicited); /** \brief replaces the stored Data */ void setData(const Data& data, bool isUnsolicited) { this->setData(data.shared_from_this(), isUnsolicited); } /** \brief refreshes stale time relative to current time */ void updateStaleTime(); /** \brief clears the entry * \post !hasData() */ void reset(); private: shared_ptr<const Data> m_data; bool m_isUnsolicited; time::steady_clock::TimePoint m_staleTime; }; } // namespace cs } // namespace nfd #endif // NFD_DAEMON_TABLE_CS_ENTRY_HPP
cpp
var searchData= [ ['none',['None',['../class_unity_webrtc_1_1_webrtc.html#a4001218c617984268d852c72d05f1de1a6adf97f83acf6453d4a6a4b1070f3754',1,'UnityWebrtc::Webrtc']]] ];
javascript
{"componentChunkName":"component---src-templates-blog-list-tsx","path":"/blog","result":{"data":{"allMdx":{"edges":[{"node":{"id":"ba00d92a-0dfe-5143-be88-4e98b5f8058d","frontmatter":{"title":"Exploring Lineage History via the Marquez API","author":"<NAME>","description":"Taking advantage of recent changes to the Marquez API, this post shows how to diagnose job failures and explore the impact of code changes on downstream dependents.","date":"08 July 2021","image":{"publicURL":"/static/7fa9cf5cb4a7ee6c2ed8a7ecf38db0c5/image.svg","childImageSharp":null}},"fields":{"slug":"/blog/explore-lineage-api/"}}},{"node":{"id":"c8fda3cb-2e8c-575f-847f-aec238d64b53","frontmatter":{"title":"Backfilling Airflow DAGs using Marquez","author":"<NAME>","description":"In this blog post, we'll discuss how lineage metadata can be used to automatically backfill DAGs with complex upstream and downstream dependencies.","date":"30 June 2021","image":{"publicURL":"/static/807ce55173f1e9826dd4f023e9884fc0/image.svg","childImageSharp":null}},"fields":{"slug":"/blog/backfilling-airflow-dags-using-marquez/"}}},{"node":{"id":"297b5617-122d-5fea-a0c9-76dce1d5c5f4","frontmatter":{"title":"How OpenLineage takes inspiration from OpenTelemetry","author":"<NAME>","description":"The data world and the service world have many similarities but also a few crucial differences.","date":"20 June 2021","image":{"publicURL":"/static/2c2ed255132045784fe157e961f32ba5/image.svg","childImageSharp":null}},"fields":{"slug":"/blog/openlineage-takes-inspiration-from-opentelemetry/"}}},{"node":{"id":"c6654c3d-8a07-5b91-8ae4-75220efafce0","frontmatter":{"title":"Introducing OpenLineage","author":"<NAME>","description":"Today, we're excited to announce the launch of OpenLineage, a new effort to define such a flexible industry standard for data lineage.","date":"27 January 2021","image":{"publicURL":"/static/ffef4cbdfba5afbfee306f66916015b9/image.svg","childImageSharp":null}},"fields":{"slug":"/blog/introducing-openlineage/"}}}]}},"pageContext":{"limit":10,"skip":0,"numPages":1,"currentPage":1}},"staticQueryHashes":["1139857438","1946588481","2083862410","2213455283","2418326273","3067102388"]}
json
{"title": "Orthogonality-Promoting Distance Metric Learning: Convex Relaxation and Theoretical Analysis.", "fields": ["overfitting", "compact space", "small number", "orthogonality", "generalizability theory"], "abstract": "Distance metric learning (DML), which learns a distance metric from labeled \"similar\" and \"dissimilar\" data pairs, is widely utilized. Recently, several works investigate orthogonality-promoting regularization (OPR), which encourages the projection vectors in DML to be close to being orthogonal, to achieve three effects: (1) high balancedness -- achieving comparable performance on both frequent and infrequent classes; (2) high compactness -- using a small number of projection vectors to achieve a \"good\" metric; (3) good generalizability -- alleviating overfitting to training data. While showing promising results, these approaches suffer three problems. First, they involve solving non-convex optimization problems where achieving the global optimal is NP-hard. Second, it lacks a theoretical understanding why OPR can lead to balancedness. Third, the current generalization error analysis of OPR is not directly on the regularizer. In this paper, we address these three issues by (1) seeking convex relaxations of the original nonconvex problems so that the global optimal is guaranteed to be achievable; (2) providing a formal analysis on OPR's capability of promoting balancedness; (3) providing a theoretical analysis that directly reveals the relationship between OPR and generalization performance. Experiments on various datasets demonstrate that our convex methods are more effective in promoting balancedness, compactness, and generalization, and are computationally more efficient, compared with the nonconvex methods.", "citation": "Citations (1)", "departments": ["Carnegie Mellon University", "Carnegie Mellon University", "Carnegie Mellon University"], "authors": ["<NAME>.....http://dblp.org/pers/hd/x/Xie:Pengtao", "<NAME>.....http://dblp.org/pers/hd/w/Wu:Wei", "<NAME>.....http://dblp.org/pers/hd/z/Zhu:Yichen", "<NAME>.....http://dblp.org/pers/hd/x/Xing:Eric_P="], "conf": "icml", "year": "2018", "pages": 10}
json
Bollywood it seems just can’t get rid of some political party or the other meddling in its affairs. And director Deepa Mehta, who premiered her film Midnight’s Children yesterday in Kerala, is again at the mercy of a local leader who alleges that the film has insulted the sensibilities of his party. As soon as the premier of the film got over, R Balakrishna Pillai, a former Congress minister in the state, attacked the film for showing the party in poor light. The minister was referring to the part in the movie that delves into the Emergency of 1975, called by the then prime minister Indira Gandhi. The movie, based on the book of the same name, written by controversial author Salman Rushdie, shows how its protagonist shares his destiny with that of the country. It focuses on the Emergency period and the riots that took place during that time, which can easily be counted as one of the darkest days in Indian history. Director Mehta remained unfazed, despite a few frivolous threats and amidst rumours that the movie has been banned. “Listen, I made the film. Hear it from my mouth, it has not been banned,” said Deepa, answering press queries about why the second screening of the movie was not being held. She said that the distributors didn’t feel it was necessary to screen the film again, and so did she. The movie has been shot in Sri Lanka, and stars Ronit Roy, Shahana Goswami, Shabana Azmi, Siddharth and Soha Ali Khan, and is narrated by the author Salman Rushdie himself. Well, we’re happy that the bickering has not ruffled Deepa’s feathers as she has faced similar issues in the past too when it came to her movies Water and Fire, which faced the ire of fundamentalist organisations and political goons. Well, we hope the filmmaker will handle the situation deftly this time too, and that Midnight’s Children doesn’t face any more unnecessary flak. 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
<filename>v2/traits/1240.json { "id": 1240, "tier": 1, "order": 0, "name": "<NAME>", "description": "Gain swiftness upon dodging.", "slot": "Minor", "facts": [ { "text": "Apply Buff/Condition", "type": "Buff", "icon": "https://render.guildwars2.com/file/20CFC14967E67F7A3FD4A4B8722B4CF5B8565E11/102836.png", "duration": 6, "status": "Swiftness", "description": "Movement speed increased by 33%; stacks duration.", "apply_count": 1 } ], "specialization": 54, "icon": "https://render.guildwars2.com/file/46E42E0D330FA8C60B6477BF6E206FDA98E114D6/1012723.png" }
json
<reponame>burgamacha/lexicalDispersion<filename>data/690_webhose-2017-03_20170904112233/discussions_0007215.json {"organizations": [], "uuid": "9956011c380f222899aef628fd8dc59b60fd6f23", "thread": {"social": {"gplus": {"shares": 0}, "pinterest": {"shares": 0}, "vk": {"shares": 0}, "linkedin": {"shares": 0}, "facebook": {"likes": 0, "shares": 0, "comments": 0}, "stumbledupon": {"shares": 0}}, "site_full": "www.tripadvisor.com", "main_image": "https://media-cdn.tripadvisor.com/media/photo-s/09/05/f2/b2/the-bridge-hotel.jpg", "site_section": "https://www.tripadvisor.com/Hotel_Review-g186338-d563907-Reviews-The_Bridge_Hotel-London_England.html", "section_title": "The Bridge Hotel - UPDATED 2017 Reviews &amp; Price Comparison (London, England) - TripAdvisor", "url": "https://www.tripadvisor.com/ShowUserReviews-g186338-d563907-r466360086-The_Bridge_Hotel-London_England.html", "country": "US", "domain_rank": 189, "title": "Nice,clean,friendly &welcoming", "performance_score": 0, "site": "tripadvisor.com", "participants_count": 2, "title_full": "Nice,clean,friendly &welcoming - Review of The Bridge Hotel, London, England - TripAdvisor", "spam_score": 0.002, "site_type": "discussions", "published": "2017-03-11T02:00:00.000+02:00", "replies_count": 1, "uuid": "9956011c380f222899aef628fd8dc59b60fd6f23"}, "author": "<NAME>", "url": "https://www.tripadvisor.com/ShowUserReviews-g186338-d563907-r466360086-The_Bridge_Hotel-London_England.html", "ord_in_thread": 0, "title": "Nice,clean,friendly &welcoming", "locations": [], "entities": {"persons": [], "locations": [], "organizations": []}, "highlightText": "", "language": "english", "persons": [], "text": "We came to this hotel on march 2017.reception was warm and welcoming.price was very good for the place close to the centre on London.room was clean and tidy.we had 2 types room was share bathroom but inside was clean I cannot believe it was share bathroom.other room was En-suite double good mattress and clean room.i leave the hotel very satisfied and happy.we 100%coming back next time.", "external_links": [], "published": "2017-03-11T02:00:00.000+02:00", "crawled": "2017-03-31T20:37:17.729+03:00", "highlightTitle": ""}
json
Less than a day away from 2017. To bring in the New Year, everyone is either heading to exotic locations or spending it at home with family and friends. Our South Indian celebs are no different. Check out where they are going with lovely pictures. Mahesh Babu and Ram Charan: Mahesh Babu took to social media to share a picture of him and Ram Charan with their family. It looks like they will be celebrating New Year together. Samantha Ruth Prabhu: Check out her Instagram account, Samantha Ruth Prabhu and Naga Chaitanya are bringing in the New Year in Maldives. Rana Daggubati: Rana aka BhallalaDeva is all set to celebrate his New Year in Goa. Shruti Haasan: She will bring in the New Year in London this time. Priyanka Chopra: The diva is heading to Goa with family. Sonu Sood: The actor is heading for Sri Lanka with his wife and kids This New year. His sister and their children will also join them. Radhika Apte: The actress has been in London for the last two weeks, and she will be spending New year there itself with Family. Asin: Asin and hubby Rahul Sharma holiday in France and give us major vacation goals! The two have taken off to snowcapped mountains of Courchevel in France.
english
// UploadFile: (1) Drag & drop single or multiple files, (2) Paste from clipboard and name .png file. /* <div> <h2>COS</h2> <div id="container1" class="up-container"> <img src="~/images/files-lg.svg" width="204" height="52" /> <h1>Drag &amp; drop files here</h1> <p class="up-clipboard">or paste them from clipboard</p> <div class="up-form"> <form asp-action="CosUpload" asp-controller="Home" method="post"> <input type="file" multiple="multiple" style="display: none;" /> <button>Select Files</button> </form> </div> <div class="up-status" data-urlformat='@Url.Action("GetCloudObject", "Home", new {fileName="filenameplaceholder" })' /> </div> </div> <div> <h2>File</h2> <div id="container2" class="up-container"> <img src="~/images/files-lg.svg" width="204" height="52" /> <h1>Drag &amp; drop files here</h1> <p class="up-clipboard">or paste them from clipboard</p> <div class="up-form"> <form asp-action="FileUpload" asp-controller="Home" method="post"> <input type="file" multiple="multiple" style="display: none;" /> <button>Select Files</button> </form> </div> <div class="up-status" data-urlformat='@Url.Action("GetFile", "Home", new {fileName="filenameplaceholder" })' /> </div> </div> <script> InitUploadZone("container1"); InitUploadZone("container2"); </script> */ function UploadFile(url, file, onCompleted, onError, onProgress) { var formData = new FormData(); formData.append("file", file, file.customName || file.name); var currentRequest = new XMLHttpRequest(); currentRequest.onreadystatechange = function (e) { var request = e.target; if (request.readyState == XMLHttpRequest.DONE) { if (request.status == 200) { var responseText = currentRequest.responseText; onCompleted(responseText); } else if (onError != null) { onError(currentRequest.status, currentRequest.statusText); } } }; if (onError != null) { currentRequest.onerror = function (e) { onError(500, e.message) }; } if (onProgress != null) { currentRequest.upload.onprogress = function (e) { onProgress(e.loaded, e.total); }; } currentRequest.open("POST", url); currentRequest.send(formData); } function IsDraggableSupported() { var div = document.createElement('div'); return (('draggable' in div) || ('ondragstart' in div && 'ondrop' in div)); } function IsPasteSupport() { return 'onpaste' in document; } // InitUploadZone("container1", "/cos/?fileName="); function InitUploadZone(containerName, fileContainerWithSeparator) { var RootContainer; var FormContainer; var Form; var FileInput; var SelectButton; var Status; var CurrentFiles = []; var CurrentFileIndex = -1; function RenderFiles() { var content = ""; for (var i = 0; i < CurrentFiles.length; i++) { var file = CurrentFiles[i]; var fileName = file.customName || file.name; //var fileUrl = fileContainerWithSeparator + fileName;//window.location.href + fileName; var urlformat = Status.getAttribute("data-urlformat"); var fileUrl = urlformat.replace("filenameplaceholder", fileName); content += "" + "<div data-file-index='" + i + "' class='up-file'>" + "<div class='up-file-name'>" + "<a href='" + fileUrl + "' target='_blank'>" + fileName + "</a>" + "</div>" + "<div class='up-file-state'>Waiting</div>" + "<div class='clear'></div>" + "<div class='up-file-progress'></div>" + "</div>"; } Status.innerHTML = content; } function UploadStep() { CurrentFileIndex++; if (CurrentFiles.length > CurrentFileIndex) { var progress = null; var state = null; var container = Status.querySelector("[data-file-index='" + CurrentFileIndex + "']"); if (container != null) { container.classList.add("up-file-current"); progress = container.querySelector(".up-file-progress"); state = container.querySelector(".up-file-state"); } UploadFile( Form.action, CurrentFiles[CurrentFileIndex], function (e) { if (container != null) { container.classList.remove("up-file-current"); container.classList.add("up-file-done"); state.innerHTML = "Done"; } UploadStep(); }, function (code, message) { if (container != null) { container.classList.remove("up-file-current"); container.classList.add("up-file-error"); state.innerHTML = "Failed"; } UploadStep(); }, function (loaded, total) { var percent = 100 / total * loaded; progress.style.width = percent + "%"; state.innerHTML = Math.floor(percent) + "%"; } ); } else { SelectButton.removeAttribute("disabled"); Form.reset(); } } RootContainer = document.getElementById(containerName); FormContainer = RootContainer.querySelector(".up-form"); Form = FormContainer.querySelector("form");//document.getElementById("form"); FileInput = Form.querySelector("input[type='file']");//document.getElementById("files"); FileInput.addEventListener("change", function (e) { SelectButton.setAttribute("disabled", "disabled"); CurrentFiles = FileInput.files; CurrentFileIndex = -1; RenderFiles(); UploadStep(); }); SelectButton = Form.querySelector("button");//document.getElementById(containerName + "_picker");//"picker" SelectButton.addEventListener("click", function (e) { FileInput.click(); e.preventDefault(); }); RootContainer.addEventListener('drag', function (e) { e.preventDefault(); }); RootContainer.addEventListener('dragstart', function (e) { e.preventDefault(); }); RootContainer.addEventListener('dragend', function (e) { e.preventDefault(); }); RootContainer.addEventListener('dragover', function (e) { e.preventDefault(); }); RootContainer.addEventListener('dragenter', function (e) { e.preventDefault(); }); RootContainer.addEventListener('dragleave', function (e) { e.preventDefault(); }); RootContainer.addEventListener('drop', function (e) { CurrentFiles = e.dataTransfer.files; CurrentFileIndex = -1; RenderFiles(); UploadStep(); e.preventDefault(); }); Status = RootContainer.querySelector(".up-status"); if (IsDraggableSupported()) { document.body.classList.add("up-draggable"); } if (IsPasteSupport()) { document.addEventListener("paste", function (e) { CurrentFiles = e.clipboardData.files; CurrentFileIndex = -1; for (var i = 0; i < CurrentFiles.length; i++) { var file = CurrentFiles[i]; var name = file.name.split("."); if (name[0] == 'image') { var defaultName = 'file_' + (+new Date); var userName = prompt("Name the file (without extension of .png):", defaultName); if (userName == null || userName.trim() == '') { userName = defaultName; } name[0] = userName; file.customName = name.join("."); } } RenderFiles(); UploadStep(); e.preventDefault(); }); RootContainer.querySelector(".up-clipboard").style.display = 'block'; } RootContainer.style.display = 'block'; }
javascript
Derek Carr's longevity with the Las Vegas Raiders is an enigma. Since being drafted in 2014, he has played in one playoff game. Despite this, he has survived five coaching changes. The quarterback could now be in line to earn money within the range of some of the league's top quarterback contracts. According to Raiders reporter Vincent Bonsignore, the Raiders and Carr haven't talked about an extension. However, when they do, the extension could put the quarterback in the $40 million per season range. He says that, for example, if the team gives him a two-year extension, factoring in the 2021 salary, he would be making $100 million over three years. Overall, based on his statement, it appears the odds of the team going into the full 40-range are on the low-end. That said, they are far from zero. Based on his example, Carr would be averaging about $33.3 million over three years. However, considering he made $22 million in 2021, the extension would need to go into the 40s to raise the average to $33.3 million. Is Derek Carr worth it? Earning more than $40 million per season would place the quarterback in the top three highest paid quarterbacks in the league. According to Spotrac, the most expensive quarterbacks on average are Dak Prescott ($40 million), Josh Allen ($43 million), and Patrick Mahomes ($45 million). If Carr earns more than $40 million, he will likely be the third-highest paid quarterback in the NFL heading into 2022. Is the quarterback worth more than what the other roughly 30 quarterbacks are making? The most likely answer is "no." However, for a franchise that has struggled mightily over the last two decades, the quarterback may be the only thing keeping them afloat through a surprise rebuild. As such, the team may feel a lot of pressure to keep him around. If that is the case, it will show on the final check paid to the quarterback. Otherwise, the act of the Raiders paying Mahomes-type money for half of the passing touchdowns (23 touchdowns for Carr in 2021 versus 50 for Mahomes in 2018) is a head-scratcher. Will the team follow through or will they embrace a full rebuild under new head coach Josh McDaniels?
english
<gh_stars>1-10 {"id": 9430, "date": "2013-04-04 21:20:24", "user": "[Deleted User]", "post": "In celebration of warmer weather and longer days, we're tossing you an early Spring promotion.\r\n\r\nThis promotion is available in our popular Los Angeles, California location; our brand new Miami, Florida location; and our recently stocked Maidenhead, UK location. Three great locations to choose from, one great low yearly deal rate.\r\n\r\n&lt;br&gt;&lt;br&gt;\r\n&lt;h1&gt;Heres the deal&lt;/h1&gt;\r\n512MB RAM\r\n35GB RAID10 Storage (w/ SSD cache)\r\n500GB Bandwidth\r\n100Mbps Port\r\nSolusVM/OpenVZ\r\n\r\nJust $20 per &lt;i&gt;year&lt;/i&gt;!\r\n\r\n&lt;h2&gt;[&lt;a href=\"https://billing.urpad.net/cart.php?a=add&amp;pid=246\"&gt;ORDER HERE&lt;/a&gt;]&lt;/h2&gt;\r\n&lt;br&gt;&lt;br&gt;\r\n&lt;H1&gt;As always, there is a second deal!&lt;/H1&gt;\r\n\r\n&lt;p align=\"center\"&gt;&lt;img src=\"http://i.imgur.com/5HFHkwP.gif\" /&gt;&lt;/p&gt;\r\n\r\n&lt;b&gt;Deal #2&lt;/b&gt;\r\n2048MB RAM\r\n50GB RAID10 Storage (w/ SSD cache)\r\n1 IPv4 Address\r\n750GB Bandwidth\r\n100Mbps Port\r\nOpenVZ/SolusVM\r\n\r\n\r\nPrice: $6.95/mo\r\n&lt;h2&gt;[&lt;a href=\"https://billing.urpad.net/cart.php?a=add&amp;pid=237\"&gt;ORDER HERE&lt;/a&gt;]&lt;/h2&gt;\r\n\r\n&lt;br&gt;&lt;br&gt;\r\n&lt;b&gt;Network Test:&lt;/b&gt;\r\n\r\nLos Angeles, CA \u2013 QuadraNet Datacenter \u2013 Test IP: 192.168.3.11\r\nMiami, FL - QuadraNet Datacenter - Test IP: 192.168.127.12\r\nMaidenhead, UK - Pulsant Datacenter - Test IP: 192.168.127.12\r\n\r\nURPad.net is owned by an established parent (FTNHosting) which manages multiple web hosting brands and has been in business for 5 years. We love what we do and always appreciate your business. If you have any questions, don't hesitate to contact us:\r\n\r\nEmail sales at: <EMAIL>.net\r\n\r\nSocial Networks:\r\nTweet us: http://twitter.com/urpad\r\nFacebook: http://www.facebook.com/urpadhosting"}
json
//----------------------------------------------- // // This file is part of the Siv3D Engine. // // Copyright (c) 2008-2020 <NAME> // Copyright (c) 2016-2020 OpenSiv3D Project // // Licensed under the MIT License. // //----------------------------------------------- # include <crtdbg.h> # include <Siv3D/Windows/Windows.hpp> # include <Common/ApplicationOptions.hpp> # include <Common/Siv3DEngine.hpp> void Main(); int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) { if (g_ApplicationOptions.debugHeapManager) { _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); } using namespace s3d; Siv3DEngine engine; Main(); return 0; }
cpp
Ever felt torn about doing everything, everywhere all at once? Then, this is the film for you. Using the du jour device of multiverses, the writer-director pair of Dan Kwan and Daniel Scheinert (or the Daniels, as they prefer to be called) confusingly, and chaotically – but ultimately, neatly — tie together life and its many possibilities as viewed through the roads not taken, and the paths that were. At the centre of it is Michelle Yeoh at the top of her form as Evelyn, a girl from China on whom rested many of her father’s hopes, who instead chose Waymond (Quan) and America, and to leave all that behind. Now the two run a laundromat, that takes up all her time and their energies, and most of their home, even as Evelyn deals with the fact that her daughter Joy (Hsu) has dropped out of college and declared herself gay, and there is an auditor determined to declare their business fraudulent on taxes. And, that’s not enough. She is still trying to make up to her dad (Hong), who happens to have just arrived in America for his birthday. It also coincides with the Chinese New Year, leaving Evelyn no choice but to be on this day, “everything”. It is in the midst of this – the papers spread over their dining table, making arrangements for the party where Evelyn hopes to peddle her cooking skills, as well as the setting up of the karaoke, where she can be the singer she once hoped to be – that she discovers the multiverses. The realisation comes through the one person whom she has come to regard the least in her life — and that may not be coincidental — her husband. That very day, incidentally, Waymond has been pondering how to deliver divorce papers to her as he is tired of hanging around hoping for her to notice him. It all goes pretty chaotic from here on, as the shifting between the verses takes bizarre, nonsensical turns, some simply to get some wolf whistles. The premise is that the staid Evelyn, who has built her life religiously toeing the line, must do something weird to jump into another multiverse, so as to escape an evil being chasing her through the many universes. Do the Daniels go over the top with this? The pair behind the other movie that had opinions similarly divided, Swiss Army Man, do. Does the film drag on, almost too pleased to punch over the parallels it is drawing? It does. Is the pitting of family members against each other taken too far? It is. Did Jamie Lee Curtis, the auditor from hell, deserve better? She does. While the film makes it all worthwhile in the end, by having at the heart of it a much simpler tale of marital conflict, family discords and the bonds of love, the fact is that we see it coming much before the Daniels say ‘cut’. If Everything Everywhere All At Once is about one thing, it is that you can’t have everything. The film should have heeded that advice.
english
BANGALORE (METRO RAIL NEWS): Senior officials of the Bengaluru Metro Rail Corporation says that trial runs on the eagerly awaited Purple Line extension of the Bengaluru Metro from Baiyappanahalli to Whitefield will start in September. Anjum Parvez, BMRCL managing director states that the trial on the Purple Line between Baiyappanahalli and KR Puram will start in September, with a goal of finishing the extension to Whitefield by December 2022. “We intend to do the trial up to KR Puram in September, and then we’ll wait and see how long it takes. We want to be finished by December, but we’ll see,” Parvez remarked. There are two reaches on the more than 15 km-long Baiyappanahalli-Whitefield stretch: R1A, which runs from Baiyappanahalli to Seetharama Palya for 8. 67 km, and R1B, which runs from Seetharama Palya to Whitefield for 7. 14 km. Benniganahalli will be the only stop in the September trials between Baiyappanahalli and K R Puram on the R1A section. However, the finished Baiyappanahalli-Whitefield stretched stoppage will be made at Mahadevapura, Garudacharpalya, Hoodi Junction, Seetharama Palya, Kundalahalli, Nallurhalli, Sri Sathya Sai Hospital, Pattandur Agrahara, Kadugodi, Channasandra, and Whitefield. Thousands of commuters on the stretch who must spend more than two hours in traffic each day to reach Whitefield or drive into the city from Whitefield are expected to benefit from the extension of Baiyappanahalli to Whitefield. While the Metro is being built, the BMRCL has urged the Bruhat Bengaluru Mahanagara Palike (BBMP) to postpone building two of the seven flyovers for traffic on the Outer Ring Road. After the Metro project is finished, the metro rail corporation will jointly build flyovers at the Sarakki and Ittamadu junctions. “We have granted approval for five flyovers at seven locations along the Outer Ring Road where the BBMP planned to construct them. We have made the decision to use combined flyovers in the remaining areas. The work is being delayed in Sarakki and Ittamadu, and it would be carried out in the same manner as the Ragigudda-Jayadeva stretch,” BMRCL MD stated.
english
<reponame>cardsofkeyforge/json { "id": "048", "card_title": "Obscúrio", "house": "Conspiracy", "card_type": "Creature", "front_image": "https://cards-keyforge.s3.eu-north-1.amazonaws.com/media/pt/tac/048.png", "card_text": "Presa – a criatura mais poderosa.\nCombativo.\nJogar: Se a sua equipe controlar mais \ncriaturas em seu local do que a Conspiração, \na Conspiração arquiva 1 carta de aventura.", "traits": "Elfo • Ladrão", "amber": 0, "power": "2", "armor": null, "rarity": "Evil Twin", "flavor_text": null, "card_number": "048", "expansion": 1002, "is_maverick": false, "is_anomaly": false, "is_enhanced": false, "is_non_deck": false }
json
<filename>lib/utils/flat/get.js "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.get = void 0; var _flat = require("flat"); var _constants = require("./constants"); var _selectParams = require("./select-params"); var _propertyKeyRegex = require("./property-key-regex"); const TEMP_HOLDING_KEY = 'TEMP_HOLDING_KEY'; /** * @load ./get.doc.md * @memberof flat * @param {FlattenParams} params flatten params from which property has to be taken * @param {string} [propertyPath] name of the property * @param {GetOptions} options options * @returns {any} when property key exists directly it returns what is inside, * otherwise it tries to find any nested objects and returns * them */ const get = (params = {}, propertyPath, options) => { if (!propertyPath) { return (0, _flat.unflatten)(params); } // when object has this key - simply return it // we cannot rely on typeof params[propertyPath !== 'undefined' because params can actually be // undefined and in such case if would pass and function would return [undefined] if (Object.keys(params).find(key => key === propertyPath)) { return params[propertyPath]; } const regex = (0, _propertyKeyRegex.propertyKeyRegex)(propertyPath, options); const selectedParams = (0, _selectParams.selectParams)(params, propertyPath, options); const nestedProperties = Object.keys(selectedParams).reduce((memo, key, index) => { let newKey = key.replace(regex, `${TEMP_HOLDING_KEY}${_constants.DELIMITER}`); // when user wants to take allSiblings we have to fix the indexes so nested items from // different siblings don't overlap // // Example for key `nested.1.el`: // 'nested.0.el.0.value': 'val0.0', // 'nested.0.el.1.value': 'val0.1', // 'nested.1.el.0.value': 'val1', // 'nested.1.el.1.value': 'val2', // // has to be changed to: // 'TEMP_HOLDING_KEY.0.value': 'val0.0', // 'TEMP_HOLDING_KEY.1.value': 'val0.1', // 'TEMP_HOLDING_KEY.2.value': 'val1', // 'TEMP_HOLDING_KEY.3.value': 'val2', if (options === null || options === void 0 ? void 0 : options.includeAllSiblings) { newKey = newKey.replace(new RegExp(`${TEMP_HOLDING_KEY}\\${_constants.DELIMITER}(\\d+)`), `${TEMP_HOLDING_KEY}.${index}`); } memo[newKey] = selectedParams[key]; return memo; }, {}); if (Object.keys(nestedProperties).length) { return (0, _flat.unflatten)(nestedProperties)[TEMP_HOLDING_KEY]; } return undefined; }; exports.get = get;
javascript
<filename>src/May2021PrepLeetcode/_0000SortKSortedArray.java package May2021PrepLeetcode; import java.util.Arrays; import java.util.List; import java.util.PriorityQueue; public class _0000SortKSortedArray { // https://leetcode.com/discuss/interview-question/1170063/Facebook-Phone-Interview public static void main(String[] args) { List<Integer> list = Arrays.asList(1, 4, 5, 2, 3, 7, 8, 6, 10, 9); int k = 2; sortKSortedArray(list, k); System.out.println(list); } public static void sortKSortedArray(List<Integer> list, int k) { PriorityQueue<Integer> pq = new PriorityQueue<Integer>(); int index = 0; for (int i = 0; i <= k; i++) { pq.offer(list.get(i)); } for (int i = k+1; i < list.size(); i++) { list.set(index++, pq.poll()); pq.offer(list.get(i)); } while (!pq.isEmpty()) { list.set(index++, pq.poll()); } } }
java
<!DOCTYPE html> <!-- Mirrored from www.chsi.com.cn/xlcx/xsglgd.shtml by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 09 Jan 2019 13:01:51 GMT --> <!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=UTF-8" /><!-- /Added by HTTrack --> <head> <meta charset=UTF-8" /> <title>普通高等学校学生管理规定</title> <meta name="keywords" content="普通高等学校学生管理规定" /> <meta name="description" content="《普通高等学校学生管理规定》已于2016年12月16日经教育部2016年第49次部长办公会议修订通过,现将修订后的《普通高等学校学生管理规定》公布,自2017年9月1日起施行。" /> <link rel="stylesheet" href="../../t1.chei.com.cn/chsi/css/news-1.0.1.min.css"> <style> .nav-list li{padding:0 8px;} </style> <script type="text/javascript" src="../../t1.chei.com.cn/common/jquery/1.8.3/jquery.min.js"></script> <script src="../../t1.chei.com.cn/common/js/boomerang-min-20141211.js"></script> <script> BOOMR.init({ beacon_url: "https://www.chsi.com.cn/images/perf.gif", log: null, DNS:{ base_url: "https://*.chdi.com.cn/images/" } }); </script> <script> function gaTrackerOutboundLink(ele,eventCategory,eventAction,eventLabel){ gtag('event', eventAction, { 'event_category': eventCategory, 'event_label': eventLabel }); return true; } </script> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-100524-1"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-100524-1'); </script> </head> <body> <div class="outer-layer"> <div class="outer-layer-content"> <div class="header"> <div class="wrap1180 clearfix"> <ul class="nav-list clearfix"> <li class="currentLi"><a href="https://www.chsi.com.cn/" target="_blank">学信网</a></li> <li><a href="https://my.chsi.com.cn/" target="_blank">学籍查询</a></li> <li><a href="index.html" target="_blank">学历查询</a></li> <li><a href="bgcx.html" target="_blank">在线验证</a></li> <li><a href="https://www.chsi.com.cn/xlrz/index2.jsp" target="_blank">出国教育背景服务</a></li> <li><a href="https://my.chsi.com.cn/archive/index.jsp#txjd" target="_blank">图像校对</a></li> <li><a href="https://my.chsi.com.cn/" target="_blank">学信档案</a></li> <li><a href="https://gaokao.chsi.com.cn/" target="_blank" title="教育部阳光高考信息平台">高考</a></li> <li><a href="https://yz.chsi.com.cn/" target="_blank" title="中国研究生招生信息网">考研</a></li> <li><a href="https://zf.chsi.com.cn/" target="_blank" title="政法干警改革试点招生网">政法招生</a></li> <li><a href="https://www.gatzs.com.cn/gatyz/" target="_blank">港澳台招生</a></li> <li><a href="https://www.chsi.com.cn/cet/" target="_blank">四六级查分</a></li> <li><a href="https://zbbm.chsi.com.cn/" target="_blank">征兵</a></li> <li><a href="https://job.chsi.com.cn/" target="_blank">就业</a></li> <li><a href="https://xz.chsi.com.cn/" target="_blank">学职平台</a></li> <li><a href="https://jp.chsi.com.cn/" target="_blank">日本频道</a></li> </ul> </div> </div> <div class="wrap1180"> <div class="logo-box clearfix"> <a href="https://www.chsi.com.cn/" class="logo-img"></a> <span class="location">&ensp;<a href="https://www.chsi.com.cn/">首页</a> > 学历网上查询</span> <div class="search-box"> <form method="get" action="https://www.chsi.com.cn/search.jsp" target="_blank" id='cse-search-box'> <input type="hidden" name="sitesearch" value="chsi.com.cn" /> <input type="hidden" name="searchType" value="baidu" /> <input type="text" name="q" maxlength="50" id="sbi" class="search-input" placeholder="站内搜索"> <input type="submit" sbb class="search-btn" value="搜 索"> </form> </div> <!--站内搜索--> <script type="text/javascript"> function formSubmitH() { var sbi = document.getElementById('sbi').value; sbi = sbi.replace(/^\s+|\s+$/g, ''); //去左右空格 document.getElementById('sbi').value = sbi; //去空格后赋值 if (sbi == '' || sbi == '站内搜索') { alert('请输入搜索内容!'); return false; } if (sbi.length > 50) { alert('关键字不得超过50个字'); return false; } return true; } document.getElementById("cse-search-box").onsubmit = function() { return formSubmitH(); } //输入框获取焦点和失去焦点效果 function eventFocusAndBlur(id, text) { document.getElementById(id).onfocus = function() { if (this.value == "" || this.value == text) { this.value = ""; } this.style.color = "#333333"; } document.getElementById(id).onblur = function() { if (this.value == "" || this.value == text) { this.value = text; this.style.color = "#999999"; } } } eventFocusAndBlur("sbi", "站内搜索"); </script> </div> <div class="title-box"> <h2>普通高等学校学生管理规定</h2> <span class="news-time">2017年02月16日 10:11 </span>&ensp; <span class="news-from">来源:教育部 </span> <div id="share"></div> </div> <div class="content-box clearfix"> <div class="content-l"> <p style="text-align: center;"><strong>中华人民共和国教育部令第41号</strong></p> <p>《普通高等学校学生管理规定》已于2016年12月16日经教育部2016年第49次部长办公会议修订通过,现将修订后的《普通高等学校学生管理规定》公布,自2017年9月1日起施行。</p> <p style="text-align: right;">教育部部长</p> <p style="text-align: right;">2017年2月4日</p> <p style="text-align: center;"><strong>普通高等学校学生管理规定</strong></p> <p style="text-align: center;"><strong>第一章 总 则</strong></p> <p>第一条 为规范普通高等学校学生管理行为,维护普通高等学校正常的教育教学秩序和生活秩序,保障学生合法权益,培养德、智、体、美等方面全面发展的社会主义建设者和接班人,依据教育法、高等教育法以及有关法律、法规,制定本规定。</p> <p>第二条 本规定适用于普通高等学校、承担研究生教育任务的科学研究机构(以下称学校)对接受普通高等学历教育的研究生和本科、专科(高职)学生(以下称学生)的管理。</p> <p>第三条 学校要坚持社会主义办学方向,坚持马克思主义的指导地位,全面贯彻国家教育方针;要坚持以立德树人为根本,以理想信念教育为核心,培育和践行社会主义核心价值观,弘扬中华优秀传统文化和革命文化、社会主义先进文化,培养学生的社会责任感、创新精神和实践能力;要坚持依法治校,科学管理,健全和完善管理制度,规范管理行为,将管理与育人相结合,不断提高管理和服务水平。</p> <p>第四条 学生应当拥护中国共产党领导,努力学习马克思列宁主义、毛泽东思想、中国特色社会主义理论体系,深入学习习近平总书记系列重要讲话精神和治国理政新理念新思想新战略,坚定中国特色社会主义道路自信、理论自信、制度自信、文化自信,树立中国特色社会主义共同理想;应当树立爱国主义思想,具有团结统一、爱好和平、勤劳勇敢、自强不息的精神;应当增强法治观念,遵守宪法、法律、法规,遵守公民道德规范,遵守学校管理制度,具有良好的道德品质和行为习惯;应当刻苦学习,勇于探索,积极实践,努力掌握现代科学文化知识和专业技能;应当积极锻炼身体,增进身心健康,提高个人修养,培养审美情趣。</p> <p>第五条 实施学生管理,应当尊重和保护学生的合法权利,教育和引导学生承担应尽的义务与责任,鼓励和支持学生实行自我管理、自我服务、自我教育、自我监督。</p> <p style="text-align: center;"><strong>第二章 学生的权利与义务</strong></p> <p>第六条 学生在校期间依法享有下列权利:</p> <p>(一)参加学校教育教学计划安排的各项活动,使用学校提供的教育教学资源;</p> <p>(二)参加社会实践、志愿服务、勤工助学、文娱体育及科技文化创新等活动,获得就业创业指导和服务;</p> <p>(三)申请奖学金、助学金及助学贷款;</p> <p>(四)在思想品德、学业成绩等方面获得科学、公正评价,完成学校规定学业后获得相应的学历证书、学位证书;</p> <p>(五)在校内组织、参加学生团体,以适当方式参与学校管理,对学校与学生权益相关事务享有知情权、参与权、表达权和监督权;</p> <p>(六)对学校给予的处理或者处分有异议,向学校、教育行政部门提出申诉,对学校、教职员工侵犯其人身权、财产权等合法权益的行为,提出申诉或者依法提起诉讼;</p> <p>(七)法律、法规及学校章程规定的其他权利。</p> <p>第七条 学生在校期间依法履行下列义务:</p> <p>(一)遵守宪法和法律、法规;</p> <p>(二)遵守学校章程和规章制度;</p> <p>(三)恪守学术道德,完成规定学业;</p> <p>(四)按规定缴纳学费及有关费用,履行获得贷学金及助学金的相应义务;</p> <p>(五)遵守学生行为规范,尊敬师长,养成良好的思想品德和行为习惯;</p> <p>(六)法律、法规及学校章程规定的其他义务。</p> <p style="text-align: center;"><strong>第三章 学籍管理</strong></p> <p style="text-align: center;"><strong>第一节 入学与注册</strong></p> <p>第八条 按国家招生规定录取的新生,持录取通知书,按学校有关要求和规定的期限到校办理入学手续。因故不能按期入学的,应当向学校请假。未请假或者请假逾期的,除因不可抗力等正当事由以外,视为放弃入学资格。</p> <p>第九条 学校应当在报到时对新生入学资格进行初步审查,审查合格的办理入学手续,予以注册学籍;审查发现新生的录取通知、考生信息等证明材料,与本人实际情况不符,或者有其他违反国家招生考试规定情形的,取消入学资格。</p> <p>第十条 新生可以申请保留入学资格。保留入学资格期间不具有学籍。保留入学资格的条件、期限等由学校规定。</p> <p>新生保留入学资格期满前应向学校申请入学,经学校审查合格后,办理入学手续。审查不合格的,取消入学资格;逾期不办理入学手续且未有因不可抗力延迟等正当理由的,视为放弃入学资格。</p> <p>第十一条 学生入学后,学校应当在3个月内按照国家招生规定进行复查。复查内容主要包括以下方面:</p> <p>(一)录取手续及程序等是否合乎国家招生规定;</p> <p>(二)所获得的录取资格是否真实、合乎相关规定;</p> <p>(三)本人及身份证明与录取通知、考生档案等是否一致;</p> <p>(四)身心健康状况是否符合报考专业或者专业类别体检要求,能否保证在校正常学习、生活;</p> <p>(五)艺术、体育等特殊类型录取学生的专业水平是否符合录取要求。</p> <p>复查中发现学生存在弄虚作假、徇私舞弊等情形的,确定为复查不合格,应当取消学籍;情节严重的,学校应当移交有关部门调查处理。</p> <p>复查中发现学生身心状况不适宜在校学习,经学校指定的二级甲等以上医院诊断,需要在家休养的,可以按照第十条的规定保留入学资格。</p> <p>复查的程序和办法,由学校规定。</p> <p>第十二条 每学期开学时,学生应当按学校规定办理注册手续。不能如期注册的,应当履行暂缓注册手续。未按学校规定缴纳学费或者有其他不符合注册条件的,不予注册。</p> <p>家庭经济困难的学生可以申请助学贷款或者其他形式资助,办理有关手续后注册。</p> <p>学校应当按照国家有关规定为家庭经济困难学生提供教育救助,完善学生资助体系,保证学生不因家庭经济困难而放弃学业。</p> <p style="text-align: center;"><strong>第二节 考核与成绩记载</strong></p> <p>第十三条 学生应当参加学校教育教学计划规定的课程和各种教育教学环节(以下统称课程)的考核,考核成绩记入成绩册,并归入学籍档案。</p> <p>考核分为考试和考查两种。考核和成绩评定方式,以及考核不合格的课程是否重修或者补考,由学校规定。</p> <p>第十四条 学生思想品德的考核、鉴定,以本规定第四条为主要依据,采取个人小结、师生民主评议等形式进行。</p> <p>学生体育成绩评定要突出过程管理,可以根据考勤、课内教学、课外锻炼活动和体质健康等情况综合评定。</p> <p>第十五条 学生每学期或者每学年所修课程或者应修学分数以及升级、跳级、留级、降级等要求,由学校规定。</p> <p>第十六条 学生根据学校有关规定,可以申请辅修校内其他专业或者选修其他专业课程;可以申请跨校辅修专业或者修读课程,参加学校认可的开放式网络课程学习。学生修读的课程成绩(学分),学校审核同意后,予以承认。</p> <p>第十七条 学生参加创新创业、社会实践等活动以及发表论文、获得专利授权等与专业学习、学业要求相关的经历、成果,可以折算为学分,计入学业成绩。具体办法由学校规定。</p> <p>学校应当鼓励、支持和指导学生参加社会实践、创新创业活动,可以建立创新创业档案、设置创新创业学分。</p> <p>第十八条 学校应当健全学生学业成绩和学籍档案管理制度,真实、完整地记载、出具学生学业成绩,对通过补考、重修获得的成绩,应当予以标注。</p> <p>学生严重违反考核纪律或者作弊的,该课程考核成绩记为无效,并应视其违纪或者作弊情节,给予相应的纪律处分。给予警告、严重警告、记过及留校察看处分的,经教育表现较好,可以对该课程给予补考或者重修机会。</p> <p>学生因退学等情况中止学业,其在校学习期间所修课程及已获得学分,应当予以记录。学生重新参加入学考试、符合录取条件,再次入学的,其已获得学分,经录取学校认定,可以予以承认。具体办法由学校规定。</p> <p>第十九条 学生应当按时参加教育教学计划规定的活动。不能按时参加的,应当事先请假并获得批准。无故缺席的,根据学校有关规定给予批评教育,情节严重的,给予相应的纪律处分。</p> <p>第二十条 学校应当开展学生诚信教育,以适当方式记录学生学业、学术、品行等方面的诚信信息,建立对失信行为的约束和惩戒机制;对有严重失信行为的,可以规定给予相应的纪律处分,对违背学术诚信的,可以对其获得学位及学术称号、荣誉等作出限制。</p> <p style="text-align: center;"><strong>第三节 转专业与转学</strong></p> <p>第二十一条 学生在学习期间对其他专业有兴趣和专长的,可以申请转专业;以特殊招生形式录取的学生,国家有相关规定或者录取前与学校有明确约定的,不得转专业。</p> <p>学校应当制定学生转专业的具体办法,建立公平、公正的标准和程序,健全公示制度。学校根据社会对人才需求情况的发展变化,需要适当调整专业的,应当允许在读学生转到其他相关专业就读。</p> <p>休学创业或退役后复学的学生,因自身情况需要转专业的,学校应当优先考虑。</p> <p>第二十二条 学生一般应当在被录取学校完成学业。因患病或者有特殊困难、特别需要,无法继续在本校学习或者不适应本校学习要求的,可以申请转学。有下列情形之一,不得转学:</p> <p>(一)入学未满一学期或者毕业前一年的;</p> <p>(二)高考成绩低于拟转入学校相关专业同一生源地相应年份录取成绩的;</p> <p>(三)由低学历层次转为高学历层次的;</p> <p>(四)以定向就业招生录取的;</p> <p>(五)研究生拟转入学校、专业的录取控制标准高于其所在学校、专业的;</p> <p>(六)无正当转学理由的。</p> <p>学生因学校培养条件改变等非本人原因需要转学的,学校应当出具证明,由所在地省级教育行政部门协调转学到同层次学校。</p> <p>第二十三条 学生转学由学生本人提出申请,说明理由,经所在学校和拟转入学校同意,由转入学校负责审核转学条件及相关证明,认为符合本校培养要求且学校有培养能力的,经学校校长办公会或者专题会议研究决定,可以转入。研究生转学还应当经拟转入专业导师同意。</p> <p>跨省转学的,由转出地省级教育行政部门商转入地省级教育行政部门,按转学条件确认后办理转学手续。须转户口的由转入地省级教育行政部门将有关文件抄送转入学校所在地的公安机关。</p> <p>第二十四条 学校应当按照国家有关规定,建立健全学生转学的具体办法;对转学情况应当及时进行公示,并在转学完成后3个月内,由转入学校报所在地省级教育行政部门备案。</p> <p>省级教育行政部门应当加强对区域内学校转学行为的监督和管理,及时纠正违规转学行为。</p> <p style="text-align: center;"><strong>第四节 休学与复学</strong></p> <p>第二十五条 学生可以分阶段完成学业,除另有规定外,应当在学校规定的最长学习年限(含休学和保留学籍)内完成学业。</p> <p>学生申请休学或者学校认为应当休学的,经学校批准,可以休学。休学次数和期限由学校规定。</p> <p>第二十六条 学校可以根据情况建立并实行灵活的学习制度。对休学创业的学生,可以单独规定最长学习年限,并简化休学批准程序。</p> <p>第二十七条 新生和在校学生应征参加中国人民解放军(含中国人民武装警察部队),学校应当保留其入学资格或者学籍至退役后2年。</p> <p>学生参加学校组织的跨校联合培养项目,在联合培养学校学习期间,学校同时为其保留学籍。</p> <p>学生保留学籍期间,与其实际所在的部队、学校等组织建立管理关系。</p> <p>第二十八条 休学学生应当办理手续离校。学生休学期间,学校应为其保留学籍,但不享受在校学习学生待遇。因病休学学生的医疗费按国家及当地的有关规定处理。</p> <p>第二十九条 学生休学期满前应当在学校规定的期限内提出复学申请,经学校复查合格,方可复学。</p> <p style="text-align: center;"><strong>第五节 退学</strong></p> <p>第三十条 学生有下列情形之一,学校可予退学处理:</p> <p>(一)学业成绩未达到学校要求或者在学校规定的学习年限内未完成学业的;</p> <p>(二)休学、保留学籍期满,在学校规定期限内未提出复学申请或者申请复学经复查不合格的;</p> <p>(三)根据学校指定医院诊断,患有疾病或者意外伤残不能继续在校学习的;</p> <p>(四)未经批准连续两周未参加学校规定的教学活动的;</p> <p>(五)超过学校规定期限未注册而又未履行暂缓注册手续的;</p> <p>(六)学校规定的不能完成学业、应予退学的其他情形。</p> <p>学生本人申请退学的,经学校审核同意后,办理退学手续。</p> <p>第三十一条 退学学生,应当按学校规定期限办理退学手续离校。退学的研究生,按已有毕业学历和就业政策可以就业的,由学校报所在地省级毕业生就业部门办理相关手续;在学校规定期限内没有聘用单位的,应当办理退学手续离校。</p> <p>退学学生的档案由学校退回其家庭所在地,户口应当按照国家相关规定迁回原户籍地或者家庭户籍所在地。</p> <p style="text-align: center;"><strong>第六节 毕业与结业</strong></p> <p>第三十二条 学生在学校规定学习年限内,修完教育教学计划规定内容,成绩合格,达到学校毕业要求的,学校应当准予毕业,并在学生离校前发给毕业证书。</p> <p>符合学位授予条件的,学位授予单位应当颁发学位证书。</p> <p>学生提前完成教育教学计划规定内容,获得毕业所要求的学分,可以申请提前毕业。学生提前毕业的条件,由学校规定。</p> <p>第三十三条 学生在学校规定学习年限内,修完教育教学计划规定内容,但未达到学校毕业要求的,学校可以准予结业,发给结业证书。</p> <p>结业后是否可以补考、重修或者补作毕业设计、论文、答辩,以及是否颁发毕业证书、学位证书,由学校规定。合格后颁发的毕业证书、学位证书,毕业时间、获得学位时间按发证日期填写。</p> <p>对退学学生,学校应当发给肄业证书或者写实性学习证明。</p> <p style="text-align: center;"><strong>第七节 学业证书管理</strong></p> <p>第三十四条 学校应当严格按照招生时确定的办学类型和学习形式,以及学生招生录取时填报的个人信息,填写、颁发学历证书、学位证书及其他学业证书。</p> <p>学生在校期间变更姓名、出生日期等证书需填写的个人信息的,应当有合理、充分的理由,并提供有法定效力的相应证明文件。学校进行审查,需要学生生源地省级教育行政部门及有关部门协助核查的,有关部门应当予以配合。</p> <p>第三十五条 学校应当执行高等教育学籍学历电子注册管理制度,完善学籍学历信息管理办法,按相关规定及时完成学生学籍学历电子注册。</p> <p>第三十六条 对完成本专业学业同时辅修其他专业并达到该专业辅修要求的学生,由学校发给辅修专业证书。</p> <p>第三十七条 对违反国家招生规定取得入学资格或者学籍的,学校应当取消其学籍,不得发给学历证书、学位证书;已发的学历证书、学位证书,学校应当依法予以撤销。对以作弊、剽窃、抄袭等学术不端行为或者其他不正当手段获得学历证书、学位证书的,学校应当依法予以撤销。</p> <p>被撤销的学历证书、学位证书已注册的,学校应当予以注销并报教育行政部门宣布无效。</p> <p>第三十八条 学历证书和学位证书遗失或者损坏,经本人申请,学校核实后应当出具相应的证明书。证明书与原证书具有同等效力。</p> <p style="text-align: center;"><strong>第四章 校园秩序与课外活动</strong></p> <p>第三十九条 学校、学生应当共同维护校园正常秩序,保障学校环境安全、稳定,保障学生的正常学习和生活。</p> <p>第四十条 学校应当建立和完善学生参与管理的组织形式,支持和保障学生依法、依章程参与学校管理。</p> <p>第四十一条 学生应当自觉遵守公民道德规范,自觉遵守学校管理制度,创造和维护文明、整洁、优美、安全的学习和生活环境,树立安全风险防范和自我保护意识,保障自身合法权益。</p> <p>第四十二条 学生不得有酗酒、打架斗殴、赌博、吸毒,传播、复制、贩卖非法书刊和音像制品等违法行为;不得参与非法传销和进行邪教、封建迷信活动;不得从事或者参与有损大学生形象、有悖社会公序良俗的活动。</p> <p>学校发现学生在校内有违法行为或者严重精神疾病可能对他人造成伤害的,可以依法采取或者协助有关部门采取必要措施。</p> <p>第四十三条 学校应当坚持教育与宗教相分离原则。任何组织和个人不得在学校进行宗教活动。</p> <p>第四十四条 学校应当建立健全学生代表大会制度,为学生会、研究生会等开展活动提供必要条件,支持其在学生管理中发挥作用。</p> <p>学生可以在校内成立、参加学生团体。学生成立团体,应当按学校有关规定提出书面申请,报学校批准并施行登记和年检制度。</p> <p>学生团体应当在宪法、法律、法规和学校管理制度范围内活动,接受学校的领导和管理。学生团体邀请校外组织、人员到校举办讲座等活动,需经学校批准。</p> <p>第四十五条 学校提倡并支持学生及学生团体开展有益于身心健康、成长成才的学术、科技、艺术、文娱、体育等活动。</p> <p>学生进行课外活动不得影响学校正常的教育教学秩序和生活秩序。</p> <p>学生参加勤工助学活动应当遵守法律、法规以及学校、用工单位的管理制度,履行勤工助学活动的有关协议。</p> <p>第四十六条 学生举行大型集会、游行、示威等活动,应当按法律程序和有关规定获得批准。对未获批准的,学校应当依法劝阻或者制止。</p> <p>第四十七条 学生应当遵守国家和学校关于网络使用的有关规定,不得登录非法网站和传播非法文字、音频、视频资料等,不得编造或者传播虚假、有害信息;不得攻击、侵入他人计算机和移动通讯网络系统。</p> <p>第四十八条 学校应当建立健全学生住宿管理制度。学生应当遵守学校关于学生住宿管理的规定。鼓励和支持学生通过制定公约,实施自我管理。</p> <p style="text-align: center;"><strong>第五章 奖励与处分</strong></p> <p>第四十九条 学校、省(区、市)和国家有关部门应当对在德、智、体、美等方面全面发展或者在思想品德、学业成绩、科技创造、体育竞赛、文艺活动、志愿服务及社会实践等方面表现突出的学生,给予表彰和奖励。</p> <p>第五十条 对学生的表彰和奖励可以采取授予&ldquo;三好学生&rdquo;称号或者其他荣誉称号、颁发奖学金等多种形式,给予相应的精神鼓励或者物质奖励。</p> <p>学校对学生予以表彰和奖励,以及确定推荐免试研究生、国家奖学金、公派出国留学人选等赋予学生利益的行为,应当建立公开、公平、公正的程序和规定,建立和完善相应的选拔、公示等制度。</p> <p>第五十一条 对有违反法律法规、本规定以及学校纪律行为的学生,学校应当给予批评教育,并可视情节轻重,给予如下纪律处分:</p> <p>(一)警告;</p> <p>(二)严重警告;</p> <p>(三)记过;</p> <p>(四)留校察看;</p> <p>(五)开除学籍。</p> <p>第五十二条 学生有下列情形之一,学校可以给予开除学籍处分:</p> <p>(一)违反宪法,反对四项基本原则、破坏安定团结、扰乱社会秩序的;</p> <p>(二)触犯国家法律,构成刑事犯罪的;</p> <p>(三)受到治安管理处罚,情节严重、性质恶劣的;</p> <p>(四)代替他人或者让他人代替自己参加考试、组织作弊、使用通讯设备或其他器材作弊、向他人出售考试试题或答案牟取利益,以及其他严重作弊或扰乱考试秩序行为的;</p> <p>(五)学位论文、公开发表的研究成果存在抄袭、篡改、伪造等学术不端行为,情节严重的,或者代写论文、买卖论文的;</p> <p>(六)违反本规定和学校规定,严重影响学校教育教学秩序、生活秩序以及公共场所管理秩序的;</p> <p>(七)侵害其他个人、组织合法权益,造成严重后果的;</p> <p>(八)屡次违反学校规定受到纪律处分,经教育不改的。</p> <p>第五十三条 学校对学生作出处分,应当出具处分决定书。处分决定书应当包括下列内容:</p> <p>(一)学生的基本信息;</p> <p>(二)作出处分的事实和证据;</p> <p>(三)处分的种类、依据、期限;</p> <p>(四)申诉的途径和期限;</p> <p>(五)其他必要内容。</p> <p>第五十四条 学校给予学生处分,应当坚持教育与惩戒相结合,与学生违法、违纪行为的性质和过错的严重程度相适应。学校对学生的处分,应当做到证据充分、依据明确、定性准确、程序正当、处分适当。</p> <p>第五十五条 在对学生作出处分或者其他不利决定之前,学校应当告知学生作出决定的事实、理由及依据,并告知学生享有陈述和申辩的权利,听取学生的陈述和申辩。</p> <p>处理、处分决定以及处分告知书等,应当直接送达学生本人,学生拒绝签收的,可以以留置方式送达;已离校的,可以采取邮寄方式送达;难于联系的,可以利用学校网站、新闻媒体等以公告方式送达。</p> <p>第五十六条 对学生作出取消入学资格、取消学籍、退学、开除学籍或者其他涉及学生重大利益的处理或者处分决定的,应当提交校长办公会或者校长授权的专门会议研究决定,并应当事先进行合法性审查。</p> <p>第五十七条 除开除学籍处分以外,给予学生处分一般应当设置6到12个月期限,到期按学校规定程序予以解除。解除处分后,学生获得表彰、奖励及其他权益,不再受原处分的影响。</p> <p>第五十八条 对学生的奖励、处理、处分及解除处分材料,学校应当真实完整地归入学校文书档案和本人档案。</p> <p>被开除学籍的学生,由学校发给学习证明。学生按学校规定期限离校,档案由学校退回其家庭所在地,户口应当按照国家相关规定迁回原户籍地或者家庭户籍所在地。</p> <p style="text-align: center;"><strong>第六章 学生申诉</strong></p> <p>第五十九条 学校应当成立学生申诉处理委员会,负责受理学生对处理或者处分决定不服提起的申诉。</p> <p>学生申诉处理委员会应当由学校相关负责人、职能部门负责人、教师代表、学生代表、负责法律事务的相关机构负责人等组成,可以聘请校外法律、教育等方面专家参加。</p> <p>学校应当制定学生申诉的具体办法,健全学生申诉处理委员会的组成与工作规则,提供必要条件,保证其能够客观、公正地履行职责。</p> <p>第六十条 学生对学校的处理或者处分决定有异议的,可以在接到学校处理或者处分决定书之日起10日内,向学校学生申诉处理委员会提出书面申诉。</p> <p>第六十一条 学生申诉处理委员会对学生提出的申诉进行复查,并在接到书面申诉之日起15日内作出复查结论并告知申诉人。情况复杂不能在规定限期内作出结论的,经学校负责人批准,可延长15日。学生申诉处理委员会认为必要的,可以建议学校暂缓执行有关决定。</p> <p>学生申诉处理委员会经复查,认为做出处理或者处分的事实、依据、程序等存在不当,可以作出建议撤销或变更的复查意见,要求相关职能部门予以研究,重新提交校长办公会或者专门会议作出决定。</p> <p>第六十二条 学生对复查决定有异议的,在接到学校复查决定书之日起15日内,可以向学校所在地省级教育行政部门提出书面申诉。</p> <p>省级教育行政部门应当在接到学生书面申诉之日起30个工作日内,对申诉人的问题给予处理并作出决定。</p> <p>第六十三条 省级教育行政部门在处理因对学校处理或者处分决定不服提起的学生申诉时,应当听取学生和学校的意见,并可根据需要进行必要的调查。根据审查结论,区别不同情况,分别作出下列处理:</p> <p>(一) 事实清楚、依据明确、定性准确、程序正当、处分适当的,予以维持;</p> <p>(二) 认定事实不存在,或者学校超越职权、违反上位法规定作出决定的,责令学校予以撤销;</p> <p>(三) 认定事实清楚,但认定情节有误、定性不准确,或者适用依据有错误的,责令学校变更或者重新作出决定;</p> <p>(四) 认定事实不清、证据不足,或者违反本规定以及学校规定的程序和权限的,责令学校重新作出决定。</p> <p>第六十四条 自处理、处分或者复查决定书送达之日起,学生在申诉期内未提出申诉的视为放弃申诉,学校或者省级教育行政部门不再受理其提出的申诉。</p> <p>处理、处分或者复查决定书未告知学生申诉期限的,申诉期限自学生知道或者应当知道处理或者处分决定之日起计算,但最长不得超过6个月。</p> <p>第六十五条 学生认为学校及其工作人员违反本规定,侵害其合法权益的;或者学校制定的规章制度与法律法规和本规定抵触的,可以向学校所在地省级教育行政部门投诉。</p> <p>教育主管部门在实施监督或者处理申诉、投诉过程中,发现学校及其工作人员有违反法律、法规及本规定的行为或者未按照本规定履行相应义务的,或者学校自行制定的相关管理制度、规定,侵害学生合法权益的,应当责令改正;发现存在违法违纪的,应当及时进行调查处理或者移送有关部门,依据有关法律和相关规定,追究有关责任人的责任。</p> <p style="text-align: center;"><strong>第七章 附 则</strong></p> <p>第六十六条 学校对接受高等学历继续教育的学生、港澳台侨学生、留学生的管理,参照本规定执行。</p> <p>第六十七条 学校应当根据本规定制定或修改学校的学生管理规定或者纪律处分规定,报主管教育行政部门备案(中央部委属校同时抄报所在地省级教育行政部门),并及时向学生公布。</p> <p>省级教育行政部门根据本规定,指导、检查和监督本地区高等学校的学生管理工作。</p> <p>第六十八条 本规定自2017年9月1日起施行。原《普通高等学校学生管理规定》(教育部令第21号)同时废止。其他有关文件规定与本规定不一致的,以本规定为准。</p> &nbsp; <div id="dz"></div> <script src="../../t1.chei.com.cn/common/js/dianzan.js"></script> <script> showDianZan("dz", 1583708777, "#2EAFBB"); </script> </div> <div class="content-r"> <div class="ewm-box"> <div class="clearfix"> <img src='../../t4.chei.com.cn/chsi/images/news/chsiwx.jpg' class="ewm-box-img"> <div class="ewm-box-des"> <h4 class="ewm-box-des_title">学信网官方微信</h4> <div class="ewm-box-des_content"> 扫一扫,关注学信网资讯<br> 微信号:chsiwx </div> </div> </div> <div class="ewm-cutline"></div> <div class="wb-warp clearfix"> <a class="wb-left" href="http://weibo.com/chsiky" target="_blank"> <img src='../../t2.chei.com.cn/chsi/images/news/wb_gk.jpg' alt="阳光高考微博"> <span>阳光高考微博</span> </a> <a class="wb-right" href="http://weibo.com/chsiky" target="_blank"> <img src='../../t1.chei.com.cn/chsi/images/news/wb_yz.jpg' alt="研招网微博"> <span>研招网微博</span> </a> </div> </div> <div class="aside-box"> <div class="aside-title">高考热点</div> <div class="aside-con"> <ul> <li><a href="https://gaokao.chsi.com.cn/gkxx/zszcgd/zszc/201901/20190104/1752818501.html" style="color:#FF0000;" target="_blank">2019年高校自主招生工作通知 </a></li> <li><a href="https://gaokao.chsi.com.cn/gkxx/zszcgd/zszc/201812/20181229/1751451435-1.html" style="color:#FF0000;" target="_blank">2019年高校特殊类型招生基本要求</a></li> <li><a href="https://gaokao.chsi.com.cn/gkxx/ksbd/201812/20181229/1751434032.html" style="color:#FF0000;" target="_blank">1月高考热点</a></li> <li><a href="https://gaokao.chsi.com.cn/gkxx/yszy/dt/201901/20190109/1755639356.html" target="_blank">教育部督促高校妥善处置艺考报名问题</a></li> <li><a href="https://gaokao.chsi.com.cn/gkxx/zc/moe/201901/20190108/1754047262.html" target="_blank">2018年教育部重点实验室评估结果</a></li> <li><a href="https://gaokao.chsi.com.cn/gkzt/bss2019" target="_blank">2019年保送生报考指南</a></li> <li><a href="https://gaokao.chsi.com.cn/gkzt/ysl2019" target="_blank">2019年艺术类专业报考指南</a></li> <li><a href="https://gaokao.chsi.com.cn/gkzt/tyl2019" target="_blank">2019年体育类专业报考指南</a></li> <li><a href="https://gaokao.chsi.com.cn/gkzt/gagx" target="_blank">2019年港澳高校内地招生指南</a></li> <li><a href="https://gaokao.chsi.com.cn/help/" target="_blank">阳光高考帮助中心</a></li> </ul> </div> </div> <div class="aside-box"> <div class="aside-title">考研热点</div> <div class="aside-con"> <ul class="r_box_txt"> <li><a href="https://yz.chsi.com.cn/yzzt/fxbg2018" style="color: #ff0000" target="_blank">2015-2018年硕士报考数据报告</a></li> <li><a href="https://yz.chsi.com.cn/yzzt/lnfsx" target="_blank">近五年考研分数线及趋势图</a></li> <li><a href="https://yz.chsi.com.cn/yzzt/kygh2019" target="_blank">2019考研全程规划</a></li> <li><a href="http://yz.chsi.com.cn/yzzt/dsbk2017" target="_blank">大三的你如何备战考研</a></li> <li><a href="http://yz.chsi.com.cn/yzzt/zyqmjx" target="_blank">考研专业解析汇总</a></li> <li><a href="http://yz.chsi.com.cn/z/amgx/index.jsp" style="color: #ff0000" target="_blank">澳门高校招收内地研究生</a></li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="outer-footer foot" id="footer"><a href="http://chesicc.moe.edu.cn/zxgw/zxjs/201604/20160418/1529506207.html" target="_blank">中心简介</a> - <a href="https://www.chsi.com.cn/about/about_site.shtml" target="_blank">网站简介</a> - <a href="https://www.chsi.com.cn/about/contact.shtml" target="_blank">联系我们</a> - <a href="https://www.chsi.com.cn/zhaopin/index.jsp" target="_blank">招聘信息</a> - <a href="https://www.chsi.com.cn/about/copyright.shtml" target="_blank">版权声明</a> - <a href="https://www.chsi.com.cn/ad/index.shtml" target="_blank">网站广告</a> - <a href="https://www.chsi.com.cn/help/" target="_blank">帮助中心</a> - <a href="https://www.chsi.com.cn/help/wzdh.jsp" target="_blank">网站导航</a> - <a href="https://www.chsi.com.cn/z/tenyears/index.jsp" target="_blank">学信十周年</a><br /> 主办单位:<a href="http://chesicc.moe.edu.cn/" target="_blank">全国高等学校学生信息咨询与就业指导中心</a> 客服热线:010-82199588 客服邮箱:<EMAIL>(将#替换为@) Copyright © 2003-2019 <a href="https://www.chsi.com.cn/" target="_blank">学信网</a> All Rights Reserved</div> <script type="text/javascript"> function footerPst(id1,id2){ var subH = document.documentElement.clientHeight - document.body.offsetHeight; if(document.getElementById("footer") && document.getElementById(id1) && subH > 0){ var leftH = document.getElementById(id1).offsetHeight; var rightH = 0,new_subH = 0; if(document.getElementById(id2)){ rightH = document.getElementById(id2).offsetHeight; }else{ if(leftH<443){ new_subH = subH - (443 - leftH); } leftH = (leftH > 443) ? leftH : 443;//for news,news_right changed, the number change } if(leftH > rightH){ if(leftH==443){ //说明leftH小于443,上面已经重新赋值了 subH = new_subH; } document.getElementById(id1).style.height = leftH + subH - 20 + "px"; }else{ document.getElementById(id2).style.height = rightH + subH - 20 + "px"; } } } window.onload = function(){ footerPst("leftH","rightH"); footerPst("leftMenu","rightCnt"); footerPst("leftHeight",""); } </script> <script src="../../t1.chei.com.cn/common/js/snsshare.js"></script> <script src="../../t3.chei.com.cn/common/js/gototop2.0.js"></script> <script type="text/javascript"> var s = new SnsShare("share"); var gtt = new CreatGoToTop(1180,'https://www.chsi.com.cn/'); s.defaultShow(); gtt.goToTop(); </script> </body> <!-- Mirrored from www.chsi.com.cn/xlcx/xsglgd.shtml by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 09 Jan 2019 13:01:51 GMT --> </html>
html
It should be noted that Shashi Tharoor and Mallikarjun Kharge are up against each other in the race for the post of Congress President. Lucknow: Senior Congress leader Mallikarjun Kharge on Tuesday dismissed speculations of receiving support from party's interim chief Sonia Gandhi and also claimed that his name for Congress president election was not suggested by her. "Sonia Gandhi suggesting my name for the president position is all a rumour, I have never said this. She has clearly stated that anyone from the Gandhi family will neither be a part of the election nor support any candidate," Kharge said. It should be noted that Shashi Tharoor and Mallikarjun Kharge are up against each other in the race for the post of Congress President. "Someone has spread this rumour to defame the Congress party, Sonia Gandhi and me. She has clearly stated that she will not participate in the party elections nor will she come in support of any candidate," Kharge added. Kharge further said that the members of the party have elected delegates which are 9300 in numbers which will vote for the candidate and the one with the majority, would be elected. Talking about voters of Uttar Pradesh, he said that there were a total of "1250 voters" (delegates) in UP. "I am not here to see the chances for me, the candidates that have asked me to contest will be responsible for my victory," he added. With the Gandhis not running for the top post, the grand old party is all set to get a non-Gandhi president after over 25 years. Voting will take place on October 17 and the election results will be declared on October 19.
english
Begin typing your search above and press return to search. DIGBOI, February 9: Polls in eight wards of Digboi in Tinsukia district passed off peacefully on Monday with minor incidents in some of the sensitive polling stations. The polls turnout has been reported to be 68. 32 per cent in Digboi while 70 per cent votes were cast in Margherita in nine wards. Local MLA Rameswar Dhanowar, while expressing confidence in his voters, told The Sentinel that Congress alone had the potential to govern Digboi where Congress was the synonym for development.
english
Bhavani Devi seemed satisfied with her maiden Olympic campaign at Tokyo. The 27-year-old said she couldn't have possibly done anything better in her 15-7 women's sabre second round defeat at the hands of Manon Brunet of France, ranked third in the world. "I am very happy. Olympics has been a dream for me. I realised that it was true a few minutes before my first match [to Ben Azizi Nadia of Indonesia]," said Sportstar . Ranked 42 in the world, Bhavani said she was a bit nervous before the start of the first match as she hadn't played a match after the 2021 World Cup in Budapest in March. "But the way I played my first round showed that I was well-prepared for the Games," she said. On the contest against Brunet, Bhavani said in the first half the Frenchwoman was very quick, and couldn't understand her strategy, but in the second half she put up a good fight and played to a plan. "I did my best," she said, while adding that she had defeated Brunet in a training camp in France a few weeks prior to the Olympics. Now, Bhavani will return to Liverno (Italy) and then from there take a flight to reach her hometown Chennai. "I want to rest my mind and body, and get ready for future competitions," she signed off.
english
<!DOCTYPE html> <!--[if IE]><![endif]--> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title>Building and testing </title> <meta name="viewport" content="width=device-width"> <meta name="title" content="Building and testing "> <meta name="generator" content="docfx 2.56.6.0"> <link rel="shortcut icon" href="../favicon.ico"> <link rel="stylesheet" href="../styles/docfx.vendor.css"> <link rel="stylesheet" href="../styles/docfx.css"> <link rel="stylesheet" href="../styles/main.css"> <meta property="docfx:navrel" content="../toc.html"> <meta property="docfx:tocrel" content="toc.html"> </head> <body data-spy="scroll" data-target="#affix" data-offset="120"> <div id="wrapper"> <header> <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="../index.html"> <img id="logo" class="svg" src="../logo.svg" alt=""> </a> </div> <div class="collapse navbar-collapse" id="navbar"> <form class="navbar-form navbar-right" role="search" id="search"> <div class="form-group"> <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off"> </div> </form> </div> </div> </nav> <div class="subnav navbar navbar-default"> <div class="container hide-when-search" id="breadcrumb"> <ul class="breadcrumb"> <li></li> </ul> </div> </div> </header> <div role="main" class="container body-content hide-when-search"> <div class="sidenav hide-when-search"> <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a> <div class="sidetoggle collapse" id="sidetoggle"> <div id="sidetoc"></div> </div> </div> <div class="article row grid-right"> <div class="col-md-10"> <article class="content wrap" id="_content" data-uid=""> <h1 id="building-and-testing">Building and testing</h1> <p>The build and test process for ZptSharp 2.0 has been simplified compared to 1.x. <em>The only dependency to build ZptSharp</em> from source is <a href="https://dotnet.microsoft.com/download/dotnet-core/3.1">a <strong>.NET Core SDK</strong> for .NET Core version 3.1</a> or higher. All further build dependencies will be fetched by dotnet.</p> <p>The solution builds using <code>dotnet build</code>. Optionally, add <code>-c Release</code> for a release-configuration build.</p> <h2 id="running-tests">Running tests</h2> <p>In order to run tests, <em>you will additionally need</em> either <a href="https://dotnet.microsoft.com/download/dotnet-framework/net472">.NET Framework 4.7.2</a> or an equivalent <a href="https://www.mono-project.com/">Mono Framework</a> version installed. This is because <a href="FurtherTestingInfo.html">a subset of the tests cannot run in a .NET Core environment</a>.</p> <p>The tests are run using <code>dotnet test</code>; this alone is sufficient to get pass/fail information. You only need consider <a href="FurtherTestingInfo.html">more advanced options</a> if you would like detailed logs and/or diagnostic information.</p> <h2 id="the-integration-tests">The integration tests</h2> <p><a href="https://github.com/csf-dev/ZPT-Sharp/tree/master/ZptSharp.Tests/IntegrationTests">The integration tests</a> are an excellent source of information for how ZPT works; they are included in any normal test run. The integration test classes work in conjunction with <a href="https://github.com/csf-dev/ZPT-Sharp/tree/master/ZptSharp.Tests/TestFiles">some files in the tests source directory</a>. The test first sets up a model and application state, then renders that using a source document (from the test files). Another test file, in a parallel directory structure, is an 'expected rendering'. The test compares the actual result of the rendering with the expected outcome and fails if they differ.</p> </article> </div> <div class="hidden-sm col-md-2" role="complementary"> <div class="sideaffix"> <div class="contribution"> <ul class="nav"> <li> <a href="https://github.com/csf-dev/ZPT-Sharp/blob/master/ZptSharp.Documentation/articles/BuildAndTest.md/#L1" class="contribution-link">Improve this Doc</a> </li> </ul> </div> <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix"> <h5>In This Article</h5> <div></div> </nav> </div> </div> </div> </div> <footer> <div class="grad-bottom"></div> <div class="footer"> <div class="container"> <span class="pull-right"> <a href="#top">Back to top</a> </span> <span>Generated by <strong>DocFX</strong></span> </div> </div> </footer> </div> <script type="text/javascript" src="../styles/docfx.vendor.js"></script> <script type="text/javascript" src="../styles/docfx.js"></script> <script type="text/javascript" src="../styles/main.js"></script> </body> </html>
html
import React from 'react'; import { Icon } from './Icon'; import { bpd } from './fragments'; export var SharpCollectionsBookmark = /*#__PURE__*/ function SharpCollectionsBookmark(props) { return React.createElement(Icon, props, React.createElement("path", { d: bpd + "m-2 10l-2.5-1.5L15 12V4h5z" })); };
javascript
{ "_comment": "DO NOT EDIT MANUALLY - See ../../../README.md", "name": "gastrodon", "full_name": "paulhoule/gastrodon", "owner": "paulhoule", "private": false, "html_url": "https://github.com/paulhoule/gastrodon", "description": "Visualize RDF data in Jupyter with Pandas", "fork": false, "url": "https://api.github.com/repos/paulhoule/gastrodon", "languages_url": "https://api.github.com/repos/paulhoule/gastrodon/languages", "pulls_url": "https://api.github.com/repos/paulhoule/gastrodon/pulls{/number}", "created_at": "2016-07-15T13:05:39Z", "updated_at": "2018-08-31T18:16:18Z", "pushed_at": "2018-01-22T02:03:58Z", "homepage": "", "size": 2669, "stargazers_count": 42, "language": "Jupyter Notebook", "mirror_url": null, "archived": false, "license": { "key": "mit", "name": "MIT License", "spdx_id": "MIT", "url": "https://api.github.com/licenses/mit", "node_id": "MDc6TGljZW5zZTEz" }, "default_branch": "master", "contributors": { "paulhoule": 51 }, "pulls_authors": [ "paulhoule" ], "languages": { "Jupyter Notebook": { "bytes": 1000349, "color": "#DA5B0B" }, "Python": { "bytes": 41835, "color": "#3572A5" }, "HTML": { "bytes": 19217, "color": "#e34c26" }, "Batchfile": { "bytes": 340, "color": "#C1F12E" } }, "fetched_at": "2018-09-11T23:10:15.706Z" }
json
<reponame>la-la-Cute/leetcode-the-hard-way<gh_stars>10-100 --- description: >- Author: @wingkwong | https://leetcode.com/problems/maximum-score-from-performing-multiplication-operations --- # 1770 - Maximum Score from Performing Multiplication Operations (Medium) ## Problem Statement You are given two integer arrays `nums` and `multipliers` **** of size `n` and `m` respectively, where `n >= m`. The arrays are **1-indexed**. You begin with a score of `0`. You want to perform **exactly** `m` operations. On the `ith` operation **(1-indexed)**, you will: * Choose one integer `x` from **either the start or the end** of the array `nums`. * Add `multipliers[i] * x` to your score. * Remove `x` from the array `nums`. Return _the **maximum** score after performing_ `m` _operations._ **Example 1:** ``` Input: nums = [1,2,3], multipliers = [3,2,1] Output: 14 Explanation: An optimal solution is as follows: - Choose from the end, [1,2,3], adding 3 * 3 = 9 to the score. - Choose from the end, [1,2], adding 2 * 2 = 4 to the score. - Choose from the end, [1], adding 1 * 1 = 1 to the score. The total score is 9 + 4 + 1 = 14. ``` **Example 2:** ``` Input: nums = [-5,-3,-3,-2,7,1], multipliers = [-10,-5,3,4,6] Output: 102 Explanation: An optimal solution is as follows: - Choose from the start, [-5,-3,-3,-2,7,1], adding -5 * -10 = 50 to the score. - Choose from the start, [-3,-3,-2,7,1], adding -3 * -5 = 15 to the score. - Choose from the start, [-3,-2,7,1], adding -3 * 3 = -9 to the score. - Choose from the end, [-2,7,1], adding 1 * 4 = 4 to the score. - Choose from the end, [-2,7], adding 7 * 6 = 42 to the score. The total score is 50 + 15 - 9 + 4 + 42 = 102. ``` **Constraints:** * `n == nums.length` * `m == multipliers.length` * `1 <= m <= 103` * `m <= n <= 105` * `-1000 <= nums[i], multipliers[i] <= 1000` ## Approach 1: Dynamic Programming This is a classic DP problem. You choose one operation out of two. The tricky part is to handle three things - the starting point of nums, the ending point of nums, and the current point of multipliers. If we go for a 3D DP solution, it will get TLE given the constraints. Hence we need to reduce it to a 2D solution. We need the pointer at multipliers anyway so we need to think about how to use one pointer to track both starting point and the ending point. Supposing our multipliers pointer is at index $$j$$ (0-based), that means we have multiplied $$j + 1$$elements already. If our starting point is at index $$i$$ (0-based), the ending point would be at index $$n - 1 - j +i$$.&#x20; Let $$dp[i][j]$$ be the maximum score where $$i$$ is the pointer at $$nums$$ and $$j$$ is the pointer at $$mult$$. When $$j$$ reaches the end of $$mult$$, then return $$0$$. If $$dp[i][j]$$has been calculated before, return it immediately. Otherwise, we have two options.&#x20; * if we pick from the left, we got $$mult[j] * nums[i] + dfs(nums, mult, i + 1, j + 1)$$ * if we pick from the right, $$mult[j] * nums[n - 1 - j + i] + dfs(nums, mult, i, j + 1)$$ ```cpp class Solution { public: int dp[1005][1005], m, n; int dfs(vector<int>& nums, vector<int>& mult, int i, int j) { // i : pointer at nums. j : pointer at mult // pointer j reaches the end of mult, return 0 if (j == m) return 0; // dp[i][j] has been calculated, return the result if (dp[i][j] != -1) return dp[i][j]; // take the max score from either left or right side return dp[i][j] = max( // pick from the left mult[j] * nums[i] + dfs(nums, mult, i + 1, j + 1), // pick from the right mult[j] * nums[n - 1 - j + i] + dfs(nums, mult, i, j + 1) ); } int maximumScore(vector<int>& nums, vector<int>& multipliers) { n = (int) nums.size(), m = (int) multipliers.size(); memset(dp, -1, sizeof(dp)); return dfs(nums, multipliers, 0, 0); } }; ```
markdown
The recent biopic Whitney Houston: I Wanna Dance With Somebody traces the rise and fall of one of the greatest singers of all time – Whitney Houston. If we go by the numbers, Whitney is one of the most successful and best-selling artists of all time. Standing at a staggering 45 million records (estimated) sold worldwide, the soundtrack of The Bodyguard is the third best-selling album of all time. In doing so, the film cements her status as a queer icon, and also brings to surface some of the most defining hurdles of any famous woman – the pressure to maintain a clean, moral and respectable image; dealing with drug and alcohol abuse; and the delicate balance between personal and professional life. Whitney’s life is also relatable to many queer people, where she had to hide certain parts of her identity but at the same time was all glammed up on the stage, a space where she could be herself. No wonder her music is still a staple for drag performances. Gerrick Kenndy in his book, Didn’t We Almost Have It: In Defense of Whitney Houston, writes that there was a sense of freedom and liberation in her music, especially for black queer people. In the documentary Whitney, Whitney’s family and friends describe her sexuality as fluid. From the context established in the movie, it’s actually painful to see Whitney being forced into a life of heteronormativity, where the press is asking if she’s gay or her father asking her and Robyn to be seen in public with the media. The life of such a star was at the scrutiny of the media at every second, and that’s why it’s also surprising that the movie confirms Whitney’s relationship with her close friend Robyn Crawford. And while there hasn’t been a conclusive label of Whitney’s sexuality, but Crawford has confessed that she’s been intimate with Whitney on many levels where the relationship was very deep and they were very connected. The film traces how this changed when Whitney was in the public limelight, where it was required of her to be a ‘respectable, moral, cishet woman,’ something that was also forced through her father. James Somerton, a Canadian marketing expert and YouTuber known for his commentary videos on films, books and comics, especially regarding queer history and characters, has also discussed on his channel how coming out can actually hurt queer actors. This is because even though the media and representation seems affirmative, studios and producers still operate in archaic ways and it’s unheard of an openly queer actor heading a big budgeted movie. The same is true for queer singers and other artists as well where their gender or sexuality might impact their career trajectory. Regardless of how much an artist is loved, unfortunately, it becomes about money at the end of the day. We also see a thread of common themes, the most prominent of which are drug and alcohol abuse, abusive marriage, and the way family members are the first one to turn on famous women as they are only after money. This is something that stars like Britney Spears, Amy Winehouse, and Tina Turner, also have been through. While Britney was in a draconian conservatorship, Amy Winehouse’s father failed her, and Tina Turner suffered brutal abuse at the hands of her husband Ike. This definitely says something about the agency of women with fame and money, and the men in their life try to take control of the same, essentially holding power forcibly. Is it time to rethink her understanding of love for all her love songs? As per billboard, “In the past, non-gender-specific anthems were the best bet, and Whitney has had several, including, but not limited to: “Saving All My Love for You,” “My Love Is Your Love,” “I Have Nothing,” “Run to You,” “So Emotional” and the ever-iconic “I Wanna Dance With Somebody,” just to name a few. “I Wanna Dance With Somebody” is a queer anthem that has spanned decades.” If we look at queer media or media directed at primarily queer audiences, this actually holds true whether it is I Wanna Dance With Somebody being played in Love, Simon, or FX’s show Pose. As a queer person, it’s particularly scary watching Whitney juggling between her career and her sexuality, and as per the movie, Whitney chose fame over being with Robyn. And the point is not to make a moral judgement of Whitney’s decision, rather, understand and question what’s so wrong with queerness that it’s not afforded the same opportunity as cisgender heterosexuals. This is particularly when Whitney has maintained that she’s a singer and that’s what she does. She doesn’t pay heed to if her music is black enough or not. Phillip Henry in his reasoning for why Whitney is a gay icon, has theorised that not only she is famous of giving shade, but in general, queer people are drawn to women who have dealt with horrible men, faced much abuse from media, and got betrayed by family, but still managed to get up and face the world. Whitney’s story is one such story, but it also feels defeated when these conversations only started to happen once Whitney was no more. In an article on Whitney’s queer iconography, Karen Millions discusses the, Gay Icons: The (Mostly) Female Entertainers Gay Men Love, in which the author Georges-Calude Guilbert writes, “I do not think that anyone would dispute Houston’s gay iconicity. She was beautiful, black, fierce (sometimes), and singing dance music.” Particularly her song It’s Not Right, It’s Okay (Thunderpuss Remix), is a certified gay anthem with a message that’s all too relatable – it’s not right, but it will be. The film also has a few factual errors, some of which harms the celebrity or undermines her talent. One of the scenes in the movie explicitly mentions that Whitney didn’t write her songs even though she has co-writing songs on multiple songs. And while the movie is successful at addressing Whitney’s sexuality and her career trajectory, it still somehow fails to capture the essence of Whitney’s life. Noami Ackie is barely believable as Whitney and the screenplay as per many critics feels like a wikipedia summary. The 2018 documentary Whitney does more justice to Whitney’s life as it escapes the overdramatising of the ‘fall from grace’ trope. Keeping the technical aspects and a hollow script aside, the film still manages to hit a chord with fans of Houston, and introduces people to the vocal powerhouse who still has a record of gaining seven consecutive number one songs on the Hot 100. In doing so, we also get a look at Whitney’s life – the forcing of gender norms, the lack of trustworthy people in the middle of fame and money, and the lack of social support for people whom we place on a high pedestal. It tries hard to be in the same category as Bohemian Rhapsody and Rocketman but fails to do so, with the most impactful aspect of the movie being the appreciation of her queerness, one of the most overlooked and scrutinised areas of her life.
english
tinymce.init({ selector: 'textarea#page_text' });
javascript
- #Narendra ModiWho Is Sanjay Mishra, The ED Chief Known For Sending 15 Big Politicians To Jail? "Prime Minister Narendra Modi is making real efforts to connect India through the construction of roads and other developmental efforts," Dinesh Sharma. New Delhi, Dec 27: Former Uttar Pradesh deputy chief minister Dinesh Sharma has turned down the offer to join Bharat Jodo Yatra made by Rahul Gandhi and in return, he has asked the Congress former president has been asked to join Prime Minister Narendra Modi's efforts to connect the country. Dinesh Sharma took a swipe at the yatra which will enter Uttar Pradesh on January 3. He targeted the Congress for taking "Bharat todo" (breaking the country) yatra. He was invited to the Yatra in his capacity as a professor at Lucknow University. "Prime Minister Narendra Modi is making real efforts to connect India through construction of roads and other developmental efforts," PTI quoted him as saying as he listed other measures taken by the central government, which he said were aimed at "connecting the nation. " Two such instances he cited were the Modi government's abrogation of article 370 in Jammu and Kashmir and the construction of roads in the northeast. Congress is filled with "negativity" and this was clearly reflected in its opposition to annulling of Article 370 in Jammu and Kashmir and its joining hands with the Indian Muslim League in Kerala, he said, according to PTI. Sharma said he doesn't have any information about the invitation for the UP leg of the Congress yatra, which he came to know through media reports. Sharma had served as deputy CM in the first Yogi Adityanath government. Congress has invited several leaders of non-BJP parties, including Akhilesh Yadav, BSP supremo Mayawati, and RLD's Jayant Chaudhary to take part in the Uttar Pradesh leg of the nationwide yatra which began from Kanyakumari. However, Samajwadi Party chief Akhilesh Yadav is unlikely to take part in the Congress' Bharat Jodo Yatra in Uttar Pradesh, an SP leader said on Tuesday, while other non-BJP leaders who have also been invited are yet to take a call. "The schedule of SP president Akhilesh Yadav related to party programmes has already been decided and he is unlikely to attend the yatra," SP spokesman Rajendra Chaudhary told PTI.
english
<reponame>pharmarin/pharmacie-netlify-cms<filename>data/products/firoroid-gelules.json {"id":"5a44f100-a500-4615-9c3c-2e0a77eee202","title":"Firoroïd gélules","attributes":[],"featuredImage":"./images/firoroïd-gélules.jpg","laboratoire":"Aboca"}
json
Suzuki Zenkō, (born January 11, 1911, Yamada, Iwate prefecture, Japan—died July 19, 2004, Tokyo), prime minister of Japan (1980–82), who worked closely with the United States and other Western countries. The son of a fisherman, Suzuki attended the former Imperial Fisheries Institute and joined the Japan Fisheries Association. At the second postwar general election, in 1947, Suzuki won a seat in the lower house of the Diet (parliament) as a socialist. Two years later he switched to the conservative Liberal Party, forerunner of the Liberal-Democratic Party (LDP), and he won reelection 12 times, during which period he held several cabinet posts. His abilities as a mediator brought him the chairmanship of the LDP’s executive council a record 10 times, but he was virtually unknown abroad when elected prime minister on July 17, 1980. When his predecessor, Ōhira Masayoshi, unexpectedly died 10 days before an election, a three-week battle for succession resulted within the LDP. Suzuki, a loyal and longtime party worker, was the dark-horse winner of the LDP presidency, which assured him the prime ministership. In office Suzuki upheld his political slogan, “politics of harmony,” while stressing moderate internationalism. In 1981 he attended a summit with U.S. President Ronald Reagan in which the two countries’ relationship was defined as an “alliance.” The following year, however, Suzuki drew criticism for Japan’s struggling economy and for his handling of the controversy that ensued after Japanese textbooks were revised to downplay the country’s aggression against China during World War II. Suzuki lost support within the LDP, and in 1982 he decided not to seek reelection as the party’s leader and thereby relinquished the post of prime minister. He retained his seat in the Diet, however, and continued to lead a sizable faction of the LDP. Suzuki remained active in politics until his retirement in 1990.
english
<filename>cc/signature/ecdsa_sign_key_manager.cc // Copyright 2017 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // /////////////////////////////////////////////////////////////////////////////// #include "tink/signature/ecdsa_sign_key_manager.h" #include <map> #include "absl/strings/string_view.h" #include "tink/public_key_sign.h" #include "tink/key_manager.h" #include "tink/signature/ecdsa_verify_key_manager.h" #include "tink/subtle/ecdsa_sign_boringssl.h" #include "tink/subtle/subtle_util_boringssl.h" #include "tink/util/enums.h" #include "tink/util/errors.h" #include "tink/util/status.h" #include "tink/util/statusor.h" #include "tink/util/validation.h" #include "google/protobuf/message.h" #include "proto/ecdsa.pb.h" #include "proto/tink.pb.h" using google::crypto::tink::EcdsaPrivateKey; using google::crypto::tink::EcdsaPublicKey; using google::crypto::tink::KeyData; using google::protobuf::Message; using crypto::tink::util::Enums; using crypto::tink::util::Status; using crypto::tink::util::StatusOr; namespace crypto { namespace tink { class EcdsaPrivateKeyFactory : public KeyFactory { public: EcdsaPrivateKeyFactory() {} // Generates a new random EcdsaPrivateKey, based on // the given 'key_format', which must contain EcdsaKeyFormat-proto. crypto::tink::util::StatusOr<std::unique_ptr<google::protobuf::Message>> NewKey(const google::protobuf::Message& key_format) const override; // Generates a new random EcdsaPrivateKey, based on // the given 'serialized_key_format', which must contain // EcdsaKeyFormat-proto. crypto::tink::util::StatusOr<std::unique_ptr<google::protobuf::Message>> NewKey(absl::string_view serialized_key_format) const override; // Generates a new random EcdsaPrivateKey based on // the given 'serialized_key_format' (which must contain // EcdsaKeyFormat-proto), and wraps it in a KeyData-proto. crypto::tink::util::StatusOr<std::unique_ptr<google::crypto::tink::KeyData>> NewKeyData(absl::string_view serialized_key_format) const override; }; StatusOr<std::unique_ptr<Message>> EcdsaPrivateKeyFactory::NewKey( const google::protobuf::Message& key_format) const { return util::Status(util::error::UNIMPLEMENTED, "not implemented yet"); } StatusOr<std::unique_ptr<Message>> EcdsaPrivateKeyFactory::NewKey( absl::string_view serialized_key_format) const { return util::Status(util::error::UNIMPLEMENTED, "not implemented yet"); } StatusOr<std::unique_ptr<KeyData>> EcdsaPrivateKeyFactory::NewKeyData( absl::string_view serialized_key_format) const { return util::Status(util::error::UNIMPLEMENTED, "not implemented yet"); } constexpr char EcdsaSignKeyManager::kKeyTypePrefix[]; constexpr char EcdsaSignKeyManager::kKeyType[]; constexpr uint32_t EcdsaSignKeyManager::kVersion; EcdsaSignKeyManager::EcdsaSignKeyManager() : key_type_(kKeyType), key_factory_(new EcdsaPrivateKeyFactory()) { } const std::string& EcdsaSignKeyManager::get_key_type() const { return key_type_; } const KeyFactory& EcdsaSignKeyManager::get_key_factory() const { return *key_factory_; } uint32_t EcdsaSignKeyManager::get_version() const { return kVersion; } StatusOr<std::unique_ptr<PublicKeySign>> EcdsaSignKeyManager::GetPrimitive(const KeyData& key_data) const { if (DoesSupport(key_data.type_url())) { EcdsaPrivateKey ecdsa_private_key; if (!ecdsa_private_key.ParseFromString(key_data.value())) { return ToStatusF(util::error::INVALID_ARGUMENT, "Could not parse key_data.value as key type '%s'.", key_data.type_url().c_str()); } return GetPrimitiveImpl(ecdsa_private_key); } else { return ToStatusF(util::error::INVALID_ARGUMENT, "Key type '%s' is not supported by this manager.", key_data.type_url().c_str()); } } StatusOr<std::unique_ptr<PublicKeySign>> EcdsaSignKeyManager::GetPrimitive(const Message& key) const { std::string key_type = std::string(kKeyTypePrefix) + key.GetDescriptor()->full_name(); if (DoesSupport(key_type)) { const EcdsaPrivateKey& ecdsa_private_key = reinterpret_cast<const EcdsaPrivateKey&>(key); return GetPrimitiveImpl(ecdsa_private_key); } else { return ToStatusF(util::error::INVALID_ARGUMENT, "Key type '%s' is not supported by this manager.", key_type.c_str()); } } StatusOr<std::unique_ptr<PublicKeySign>> EcdsaSignKeyManager::GetPrimitiveImpl( const EcdsaPrivateKey& ecdsa_private_key) const { Status status = Validate(ecdsa_private_key); if (!status.ok()) return status; const EcdsaPublicKey& public_key = ecdsa_private_key.public_key(); subtle::SubtleUtilBoringSSL::EcKey ec_key; ec_key.curve = Enums::ProtoToSubtle(public_key.params().curve()); ec_key.pub_x = public_key.x(); ec_key.pub_y = public_key.y(); ec_key.priv = ecdsa_private_key.key_value(); auto ecdsa_result = subtle::EcdsaSignBoringSsl::New( ec_key, Enums::ProtoToSubtle(public_key.params().hash_type())); if (!ecdsa_result.ok()) return ecdsa_result.status(); std::unique_ptr<PublicKeySign> ecdsa(ecdsa_result.ValueOrDie().release()); return std::move(ecdsa); } // static Status EcdsaSignKeyManager::Validate( const EcdsaPrivateKey& key) { Status status = ValidateVersion(key.version(), kVersion); if (!status.ok()) return status; return EcdsaVerifyKeyManager::Validate(key.public_key().params()); } } // namespace tink } // namespace crypto
cpp
Hyundai Motor has listed within Interbrand’s top 40 global companies for six consecutive years. Since entering the ranks of the top 100 companies in terms of brand value in 2005, Hyundai Motor has remained in the top 100 for 15 consecutive years. Hyundai Motor’s commitment to mobility electrification was most recently demonstrated with the launch of its dedicated EV brand IONIQ. Under IONIQ, the company will leverage its industry-leading manufacturing know-how in EVs to introduce three new dedicated models over the next four years with more innovative models to follow. The creation of IONIQ lineup brand is in response to the fast-growing market demand and accelerates Hyundai’s plan to lead the global EV market. Hyundai Motor’s investment in hydrogen fuel cell technology has also bolstered its position in the rapidly changing transportation sector. The company recently delivered the first seven units of the world’s first mass-produced fuel cell electric heavy-duty truck to customers in Switzerland, with a total of 50 hitting the roads there this year. Production capacity for fuel-cell trucks will reach 2,000 units per year by 2021 to support its expansion into Europe, the U. S. , and China as demand for clean mobility grows. The company is striving to solve urban traffic challenges and highlighting an innovative new mobility paradigm via its urban air mobility (UAM) business. To strengthen its competitiveness in robotics, autonomous driving technologies, and other future mobility business areas, and to establish itself as a pioneer of the future mobility industry, it is signing research and development collaboration schemes with diverse open innovation labs around the world. At the same time, Hyundai has adapted to the COVID-19 pandemic by strengthening its online sales channels worldwide. In particular, the ‘Click to Buy’ option in the U. S. and India is showing great sales results, and the company is developing a similar online sales platform for Europe. As a result, the brand has welcomed 1. 5 million cumulative virtual visitors, received 20,000 sales inquiries, and made more than 2,000 sales through its Click to Buy platform in India. In the U. S. , more than 95 percent of local dealers are using the Click to Buy platform. Also in response to COVID-19 conditions, Hyundai Motor has carried out various social contribution activities for customers who are suffering from the aftermath of the pandemic around the world. The company has provided vehicle support for hygiene products, transportation of patients and medical personnel, and various financial and service benefits for its customers. These activities helped Hyundai Motor become the only automotive company on the list to see its brand value rise this year. As a result, the company’s ranking on the list rose by one spot from last year to fifth among global automotive companies. The global brand consulting firm Interbrand conducts an annual evaluation of major multinational brands to release its Best Global Brands rankings. Each brand’s present value is arrived at following a comprehensive assessment of its fiscal and marketing operations, which are used to calculate its future revenue.
english
import os import shutil import numpy as np import mxnet as mx from mxnet import gluon from mxnet.gluon import nn from mxnet import autograd as ag def train_one_epoch(epoch, optimizer, train_data, criterion, ctx): train_data.reset() acc_metric = mx.metric.Accuracy() loss_sum = 0.0 count = 0 for batch in train_data: data = gluon.utils.split_and_load(batch.data[0], ctx_list=ctx, batch_axis=0) label = gluon.utils.split_and_load(batch.label[0], ctx_list=ctx, batch_axis=0) outputs = [] with ag.record(): for x, y in zip(data, label): z = net(x) loss = criterion(z, y) loss_sum += float(loss.sum().asnumpy()) count += data[0].shape[0] loss.backward() outputs.append(z) acc_metric.update(label, outputs) optimizer.step(batch.data[0].shape[0]) _, avg_acc = acc_metric.get() avg_loss = loss_sum / count acc_metric.reset() print('Epoch {} - Training: Avg accuracy: {:.2f} ' 'Avg loss: {:.2f}'.format(epoch, 100.0*avg_acc, avg_loss)) def val_one_epoch(epoch, val_data, criterion, ctx): val_data.reset() acc_metric = mx.metric.Accuracy() loss_sum = 0.0 count = 0 for batch in val_data: data = gluon.utils.split_and_load(batch.data[0], ctx_list=ctx, batch_axis=0) label = gluon.utils.split_and_load(batch.label[0], ctx_list=ctx, batch_axis=0) outputs = [] for x, y in zip(data, label): z = net(x) loss = criterion(z, y) loss_sum += float(loss.sum().asnumpy()) count += data[0].shape[0] outputs.append(z) acc_metric.update(label, outputs) _, avg_acc = acc_metric.get() avg_loss = loss_sum / count acc_metric.reset() if epoch >= 0: print('Epoch {} - Validation: Avg accuracy: {:.2f} ' 'Avg loss: {:.2f}'.format(epoch, 100.0*avg_acc, avg_loss)) return avg_acc def save_checkpoint(net, checkpoint_dir, is_best=0): net.save_params(os.path.join(checkpoint_dir, 'mnist_last.params')) if is_best: shutil.copyfile(os.path.join(checkpoint_dir, 'mnist_last.params'), os.path.join(checkpoint_dir, 'mnist_best.params')) def load_checkpoint(net, checkpoint_dir, val_data, criterion, ctx): best_acc = 0 if not os.path.exists(checkpoint_dir): os.mkdir(checkpoint_dir) else: if os.path.exists(os.path.join(checkpoint_dir,'mnist_best.params')): net.load_params(os.path.join(checkpoint_dir,'mnist_best.params')) best_acc = val_one_epoch(-1, val_data, criterion, ctx) print('The last accuracy: {:.2f}'.format(100.0 * best_acc)) return best_acc if __name__ == '__main__': lr = 0.01 momentum = 0.5 epoch = 10 batch_size = 64 mnistdata_dir = '/gdata/MNIST' checkpoint_dir = '/userhome/checkpoints' train_data = mx.io.MNISTIter( image=os.path.join(mnistdata_dir, "train-images-idx3-ubyte"), label=os.path.join(mnistdata_dir, "train-labels-idx1-ubyte"), batch_size=batch_size, data_shape=(28, 28), shuffle = True ) val_data = mx.io.MNISTIter( image=os.path.join(mnistdata_dir, "t10k-images-idx3-ubyte"), label=os.path.join(mnistdata_dir, "t10k-labels-idx1-ubyte"), batch_size=batch_size, data_shape=(28, 28), shuffle=False ) net = nn.Sequential() with net.name_scope(): net.add(nn.Conv2D(channels=10,kernel_size=5,use_bias=False)), net.add(nn.MaxPool2D()), net.add(nn.LeakyReLU(0)) net.add(nn.Conv2D(channels=20, kernel_size=5, use_bias=False)), net.add(nn.Dropout(0.5)), net.add(nn.MaxPool2D()), net.add(nn.LeakyReLU(0)), net.add(nn.Flatten()), net.add(nn.Dense(50, activation='relu')), net.add(nn.Dropout(0.5)), net.add(nn.Dense(10)) gpus = mx.test_utils.list_gpus() ctx = [mx.gpu()] if gpus else [mx.cpu(0), mx.cpu(1)] net.initialize(mx.init.Xavier(magnitude=2.24), ctx=ctx) trainer = gluon.Trainer(net.collect_params(), 'sgd', {'learning_rate': lr, 'momentum':momentum}) softmax_cross_entropy_loss = gluon.loss.SoftmaxCrossEntropyLoss() best_acc = load_checkpoint(net, checkpoint_dir, val_data, softmax_cross_entropy_loss, ctx) print('start train...') for i in range(epoch): train_one_epoch(i, trainer, train_data, softmax_cross_entropy_loss, ctx) acc = val_one_epoch(i, val_data, softmax_cross_entropy_loss, ctx) is_best = acc > best_acc best_acc = max(acc, best_acc) save_checkpoint(net, checkpoint_dir, is_best)
python
<reponame>TheYahya/minimalist .icon-search:before { content: '\e800'; } /* '' */ .icon-menu:before { content: '\f0c9'; } /* '' */ .icon-share:before { content: '\f1e0'; } /* '' */
css
package persister import ( "errors" "fmt" "log" "math/big" "sync" "time" "github.com/KyberNetwork/cache/ethereum" ) const ( STEP_SAVE_RATE = 10 //1 minute MAXIMUM_SAVE_RECORD = 60 //60 records INTERVAL_UPDATE_KYBER_ENABLE = 20 INTERVAL_UPDATE_MAX_GAS = 70 INTERVAL_UPDATE_GAS = 40 INTERVAL_UPDATE_RATE_USD = 610 INTERVAL_UPDATE_GENERAL_TOKEN_INFO = 3600 INTERVAL_UPDATE_GET_BLOCKNUM = 20 INTERVAL_UPDATE_GET_RATE = 30 INTERVAL_UPDATE_DATA_TRACKER = 310 ) type RamPersister struct { mu sync.RWMutex timeRun string kyberEnabled bool isNewKyberEnabled bool rates []ethereum.Rate isNewRate bool updatedAt int64 latestBlock string isNewLatestBlock bool rateUSD []RateUSD rateETH string isNewRateUsd bool events []ethereum.EventHistory isNewEvent bool maxGasPrice string isNewMaxGasPrice bool gasPrice *ethereum.GasPrice isNewGasPrice bool } func NewRamPersister() (*RamPersister, error) { var mu sync.RWMutex location, _ := time.LoadLocation("Asia/Bangkok") tNow := time.Now().In(location) timeRun := fmt.Sprintf("%02d:%02d:%02d %02d-%02d-%d", tNow.Hour(), tNow.Minute(), tNow.Second(), tNow.Day(), tNow.Month(), tNow.Year()) kyberEnabled := true isNewKyberEnabled := true rates := []ethereum.Rate{} isNewRate := false latestBlock := "0" isNewLatestBlock := true rateUSD := make([]RateUSD, 0) rateETH := "0" isNewRateUsd := true events := make([]ethereum.EventHistory, 0) isNewEvent := true maxGasPrice := "50" isNewMaxGasPrice := true gasPrice := ethereum.GasPrice{} isNewGasPrice := true persister := &RamPersister{ mu: mu, timeRun: timeRun, kyberEnabled: kyberEnabled, isNewKyberEnabled: isNewKyberEnabled, rates: rates, isNewRate: isNewRate, updatedAt: 0, latestBlock: latestBlock, isNewLatestBlock: isNewLatestBlock, rateUSD: rateUSD, rateETH: rateETH, isNewRateUsd: isNewRateUsd, events: events, isNewEvent: isNewEvent, maxGasPrice: maxGasPrice, isNewMaxGasPrice: isNewMaxGasPrice, gasPrice: &gasPrice, isNewGasPrice: isNewGasPrice, } return persister, nil } /////------------------------------ func (self *RamPersister) GetRate() []ethereum.Rate { self.mu.RLock() defer self.mu.RUnlock() return self.rates } func (self *RamPersister) GetTimeUpdateRate() int64 { self.mu.RLock() defer self.mu.RUnlock() return self.updatedAt } func (self *RamPersister) SetIsNewRate(isNewRate bool) { self.mu.RLock() defer self.mu.RUnlock() // return self.rates self.isNewRate = isNewRate } func (self *RamPersister) GetIsNewRate() bool { self.mu.RLock() defer self.mu.RUnlock() return self.isNewRate } func (self *RamPersister) SaveRate(rates []ethereum.Rate, timestamp int64) { self.mu.Lock() defer self.mu.Unlock() self.rates = rates if timestamp != 0 { self.updatedAt = timestamp } } //-------------------------------------------------------- func (self *RamPersister) SaveKyberEnabled(enabled bool) { self.mu.Lock() defer self.mu.Unlock() self.kyberEnabled = enabled self.isNewKyberEnabled = true } func (self *RamPersister) SetNewKyberEnabled(isNew bool) { self.mu.Lock() defer self.mu.Unlock() self.isNewKyberEnabled = isNew } func (self *RamPersister) GetKyberEnabled() bool { self.mu.Lock() defer self.mu.Unlock() return self.kyberEnabled } func (self *RamPersister) GetNewKyberEnabled() bool { self.mu.Lock() defer self.mu.Unlock() return self.isNewKyberEnabled } //-------------------------------------------------------- //-------------------------------------------------------- func (self *RamPersister) SetNewMaxGasPrice(isNew bool) { self.mu.Lock() defer self.mu.Unlock() self.isNewMaxGasPrice = isNew return } func (self *RamPersister) SaveMaxGasPrice(maxGasPrice string) { self.mu.Lock() defer self.mu.Unlock() self.maxGasPrice = maxGasPrice self.isNewMaxGasPrice = true return } func (self *RamPersister) GetMaxGasPrice() string { self.mu.Lock() defer self.mu.Unlock() return self.maxGasPrice } func (self *RamPersister) GetNewMaxGasPrice() bool { self.mu.Lock() defer self.mu.Unlock() return self.isNewMaxGasPrice } //-------------------------------------------------------- //-------------------------------------------------------------- func (self *RamPersister) SaveGasPrice(gasPrice *ethereum.GasPrice) { self.mu.Lock() defer self.mu.Unlock() self.gasPrice = gasPrice self.isNewGasPrice = true } func (self *RamPersister) SetNewGasPrice(isNew bool) { self.mu.Lock() defer self.mu.Unlock() self.isNewGasPrice = isNew } func (self *RamPersister) GetGasPrice() *ethereum.GasPrice { self.mu.Lock() defer self.mu.Unlock() return self.gasPrice } func (self *RamPersister) GetNewGasPrice() bool { self.mu.Lock() defer self.mu.Unlock() return self.isNewGasPrice } //----------------------------------------------------------- func (self *RamPersister) GetRateUSD() []RateUSD { self.mu.RLock() defer self.mu.RUnlock() return self.rateUSD } func (self *RamPersister) GetRateETH() string { self.mu.RLock() defer self.mu.RUnlock() return self.rateETH } func (self *RamPersister) GetIsNewRateUSD() bool { self.mu.RLock() defer self.mu.RUnlock() return self.isNewRateUsd } func (self *RamPersister) SaveRateUSD(rateUSDEth string) error { self.mu.Lock() defer self.mu.Unlock() rates := make([]RateUSD, 0) itemRateEth := RateUSD{Symbol: "ETH", PriceUsd: rateUSDEth} rates = append(rates, itemRateEth) for _, item := range self.rates { if item.Source != "ETH" { priceUsd, err := CalculateRateUSD(item.Rate, rateUSDEth) if err != nil { log.Print(err) self.isNewRateUsd = false return nil } sourceSymbol := item.Source if sourceSymbol == "ETHOS" { sourceSymbol = "BQX" } itemRate := RateUSD{Symbol: sourceSymbol, PriceUsd: priceUsd} rates = append(rates, itemRate) } } self.rateUSD = rates self.rateETH = rateUSDEth self.isNewRateUsd = true return nil } func CalculateRateUSD(rateEther string, rateUSD string) (string, error) { //func (z *Int) SetString(s string, base int) (*Int, bool) bigRateUSD, ok := new(big.Float).SetString(rateUSD) if !ok { err := errors.New("Cannot convert rate usd of ether to big float") return "", err } bigRateEth, ok := new(big.Float).SetString(rateEther) if !ok { err := errors.New("Cannot convert rate token-eth to big float") return "", err } i, e := big.NewInt(10), big.NewInt(18) i.Exp(i, e, nil) weight := new(big.Float).SetInt(i) rateUSDBig := new(big.Float).Mul(bigRateUSD, bigRateEth) rateUSDNormal := new(big.Float).Quo(rateUSDBig, weight) return rateUSDNormal.String(), nil } func (self *RamPersister) SetNewRateUSD(isNew bool) { self.mu.Lock() defer self.mu.Unlock() self.isNewRateUsd = isNew } func (self *RamPersister) GetLatestBlock() string { self.mu.RLock() defer self.mu.RUnlock() return self.latestBlock } func (self *RamPersister) SaveLatestBlock(blockNumber string) error { self.mu.Lock() defer self.mu.Unlock() self.latestBlock = blockNumber self.isNewLatestBlock = true return nil } func (self *RamPersister) GetIsNewLatestBlock() bool { self.mu.RLock() defer self.mu.RUnlock() return self.isNewLatestBlock } func (self *RamPersister) SetNewLatestBlock(isNew bool) { self.mu.Lock() defer self.mu.Unlock() self.isNewLatestBlock = isNew } func (self *RamPersister) GetTimeVersion() string { self.mu.Lock() defer self.mu.Unlock() return self.timeRun }
go
Pringles are a favorite food of many peoples due to their texture and flavor but when you get Braces, you should avoid food that is hard and crunchy. Now You may wonder that can I eat pringles with braces that’s is the question which many people asked. Yes, you can eat Pringles with braces although there is a certain types of chips you can eat with braces and they are easily available in the market such as Pringles. You can easily eat them with braces because they come in a soft and normal crunchy texture that’s acceptable with braces. How toEat Pringles with Braces? Select soft and non-sticky crunchy chips, secondly chew slowly and properly in this way you can easily Eat Pringles. This type of pringles can’t hurt the braces or get stuck. - These are a few recommendations for people who are wearing braces. - Chew them properly, and take one pringles at one time. - Brush your teeth after eating not even brush use some dental floss for proper care of braces. Do Pringles Get Stuck in your Braces? Yes, crunchy pringles can get stuck between the wire of braces. Hard and crunch materials put great pressure on braces and may cause braces brake. So avoid hard and crunchy chips and choose soft chips. Can I Eat Pringles in the First Week of Braces? Unfortunately, you can’t eat Pringles in the first week of braces. As I earlier mention pringles are considered a hard and crunchy food that is not acceptable with braces, especially in the first week. If you eat in the first week of braces it will damage your braces and also affect your teeth so stay away from chips in the first week. Frequently Ask Question (FAQs) No, pringles are certainly not good to eat with braces. because they are too crunchy and crispy. The hard pieces of pringles are easily stuck in your braces and damage them. Chips come in a variety of types and with braces the soft and baked chips are acceptable you can easily eat them because they are not crunchy or hard. Definitely no, you can not eat tortilla chips with braces because they are a hard and crunchy texture. Due to their texture, they will break your braces and damage them. You can eat Pringles as I explained but choose soft Pringles to consume with braces also follow all recommendations. Proper care of your braces is important so brushing your teeth on a daily basis will remove all stuck food and germs. The post Can You Eat Pringles With Braces? appeared first on VAUNTE.
english
<gh_stars>1-10 import sys from itertools import product n, *abc = map(int, sys.stdin.readline().split()) *l, = map(int, sys.stdin.read().split()) def main(): cand = [] for p in product([0, 1, 2, 3], repeat=n): group = [[] for _ in range(4)] for i in range(n): group[p[i]].append(l[i]) cost = 0 for i in range(1, 4): if not group[i]: break cost += 10 * (len(group[i]) - 1) group[i] = sum(group[i]) else: group = group[1:] for i in range(3): cost += abs(abc[i] - group[i]) cand.append(cost) print(min(cand)) if __name__ == '__main__': main()
python
Last year, Bengali actress and Trinamool Congress MP Nusrat Jahan welcomed a boy, who she named Yishaan. She had been living with her partner Yash Dasgupta since December 2020, and thus everyone had anticipated that he was her son’s biological father. The rumours were soon confirmed by Nusrat herself. However, she had never said anything about her marital status. Last week, responding to a journalist Nusrat said, “How do you know that I’m not married? " Now, she has said in an interview that she and Yash ‘don’t need to get married again’. Nusrat Jahan, in a recent interview, has opened up about her marriage to Yash Das Gupta. In an interview to India Today, Nusrat said, “I don’t know why people were so curious about this. They kept asking me about my wedding date. I mean, what do you expect? That I’ll call everyone up and say, ‘Hey, I’m getting married? ’ If so, then your expectations are incorrect. " Nusrat continued, “If I choose not to speak about my personal life, it is my choice. Isn’t it? I think two married people should decide for themselves. If they are happy, what else can anyone do? " When asked if she and Yash had got married, Nusrat replied, “We don’t need to get married again. " Nusrat had a grand wedding with businessman Nikhil Jain in Turkey in 2019. However, in June 2021, she said that their marriage was void under Indian law since she had not got their marriage registered under the Special Marriage Act. Nusrat gave birth to son Yishaan on 26 August last year. Yash Dasgupta’s name was mentioned as the baby’s father when Nusrat was discharged from Bhagirathi Neotia Hospital in Kolkata. Yash was seen holding her son when the duo left the hospital for home. Earlier, Yash had also shared an update with the fans regarding Nusrat. He wrote, “For those who are inquiring about Nusrat’s health, mother and child are healthy and feeling well. " Nusrat and Yash have been in a live-in relationship ever since December 2020.
english
Farhan Akhtar has a penchant for working with first-time directors. Rock On! ! may not be Abhishek Kapoor’s directorial debut,but it was the first film that discovered Abhishek’s true talent. Farhan’s next release,Luck By Chance,is also helmed by a first-timer,his sister Zoya Akhtar. The film is carrying rave reports and those who’ve watched the film,speak very,very highly of it. Farhan is ready to face the camera again and his next film as an actor,titled Kartik Calling Kartik,will also be directed by a newcomer — Vijay Lalwani. This one’s a psychological thriller. Besides acting in home-productions,Farhan and his enterprising producer-partner Ritesh Sidhwani will start a film with Abhishek Bachchan and Aishwarya Rai Bachchan,which will be directed by Abhinay Deo,who’s currently directing Aamir Khan’s home-production Delhi Belly.
english
package netplan import yamlnillable "github.com/moznion/go-yaml-nillable" // PhysicalDevice represents netplan's common properties for physical device types. // See also: https://netplan.io/reference#common-properties-for-physical-device-types type PhysicalDevice struct { Match *Match `yaml:"match,omitempty"` SetName *yamlnillable.String `yaml:"set-name,omitempty"` WakeOnLAN *yamlnillable.Bool `yaml:"wakeonlan,omitempty"` }
go
In 1992, researcher Tom Caudell coined the term Augmented Reality (AR). It’s an experience that supplements the real world with a virtual layer of information. Until recently, AR sounded like something from a cyberpunk novel. Some sort of cyborg capability that could go the way of PDAs and laser disks. However AR doesn’t rely on wearable technology (e.g.Google Glass) – and considering the millions who’ve opted for Lasik, it’s hard to imagine people embracing a constant need to wear special eyewear. Even if the cost of Google Glass was more accessible, the fashion faux pas of unchic fashion is a major hurdle – not to mention something blocking your range of sight. That’s why there’s more to AR than just wearable devices. In this piece, I’ll explain the benefits and challenges of designing for augmented reality, then dive into why we must start thinking of products as connected services instead of standalone items. Last year I was invited by Austin’s Chief Innovation Officer to help facilitate a workshop for businesses and institutions which included public libraries, YMCA, business development centers, etc. who’d qualified to receive free Google Fiber. Google claims it solved a common complaint of many internet users by engineering a faster, more reliable broadband network. Google Fiber boasts a download speed of a whopping 1,000 megabits per second. The question posed during the workshop was: How might programs be improved once anyone can freely access the internet without limitation? The unfortunate answer amongst participants was that they had no idea what to do with ubiquitous high-speed broadband. They didn’t know what it meant, but were grateful to have it. Facilitating the workshop brought AR to mind as an important consideration for UX Designers. Once we’re no longer limited by broadband connections, it’ll be possible to design a smarter and more interactive modern world. I’m not convinced we’ll be walking around wearing special glasses or gear, but as services like Google Fiber change the broadband game, I see a modern world seamlessly enmeshed with technology. In 2012, Amber Case delivered a keynote at SXSW and spoke about AR as something valuable with a real purpose. A cyborg anthropologist who spends most of her time thinking about AR, Amber believes mobile devices are becoming an extension of our brain. Amber contends that our phones are becoming an extremity of ourselves. She says: Our phones already do so much more than make voice calls and send text messages. Case and other digital anthropologists track the use of technology to reveal that the tools may change but the behavior does not. As the free e-book Interaction Design Best Practices by UXPin describes in the second chapter, you must always design faster and easier way to do simple things. Technology must fulfill that criteria of efficiency (perhaps even laziness) if it wants to survive. More than likely, we’ll continue to use the same devices, but objects previously passive will become interactive. Genevieve Bell is an anthropologist who works at Intel and spends a lot of time thinking about technology and culture. During her SXSW panel discussion on User Experience Design Shaping Our World she shared: Essentially, everything will eventually have some sort of computer inside it. Honeywell has recently created a UX team in Austin focused only on building more intelligent products. Consider: - Would you eat better if your fridge had a built in computer? - Could clothes be washed based on their care instructions by your smart washing machine? I don’t know what Honeywell will come up with, but smarter homes are becoming a reality for many people. Also in Austin, IBM is working on a project known as Watson. IBM describes Watson as, “a cognitive system enabling a new partnership between people and computers”. Apple’s recent acquisition of Metaio (an augmented reality software company based in Germany) indicates that hardware companies are looking to built-in AR capabilities. The expectation is that Apple will use the Metaio software to make all Apple devices AR-compatible. It makes sense to create AR Apps for popular products. Metaio’s showroom app for Ferrari perfectly illustrates the value that AR technology can provide. Customers can customize their ideal car in the showroom using the AR app that animates 3D images. Not to mention services like Wink, which enable users to connect all of their smart products to a single control system. The signals are clear: augmented reality is the future of product design. Augmented reality will rise as a layer of connected services through high speed WIFI. The design challenge isn’t creating new devices, but how existing products are connected by a single service. Too often users are burdened by poorly designed services. Service design is an important arm of UX because as information becomes freer, our ability to access it becomes more limited. We are experiencing information overload. All of these stand-alone apps certainly aren’t helping. Many apps die a slow death because they’re so difficult to use with other things. Service design acts helps connect all these formerly unconnected things. Photo credit: Peter Morville. Creative Commons. A service needs to link different types of channels and devices, and the experience must be seamless. Many times, workarounds are required to enable a user’s ability to easily get from point A to point B. Workarounds are a short-term solution because software design has so many variables. Different languages, different browser compatibilities, different device optimisation and so on. Service design considers all of the related touch-points across a mix of channels and devices for a user to complete a task. If the touch-points aren’t compatible, the workarounds are a short-term fix. A new version might render the workaround obsolete and that can break the service. Large companies tend to design products in a silo. A perfect example is AT&T. I moved into a new house last month and had Uverse installed. As a current AT&T customer, I was surprised that my cell phone account wasn’t automatically connected to my Uverse account. I’ve seen this type of disconnect before in my work as a UX consultant. Large institutions and corporations have siloed teams responsible for individual products. They don’t integrate products so the customer has to manage them as separate accounts. It is possible to connect a Uverse account with other AT&T accounts through a single sign-on, but management of the accounts remains separated. Here’s what happens: - If I update my address or payment option for my cell phone, it won’t be updated for any other account. - This means a lot of unnecessary data entry and maintenance for me, as well as introducing opportunities for human error. All of these silos negatively affect the opportunities for augmented reality. In order for AR to be usable, it must be quick and simple. Unlike other experiences, AR screens are layers to an existing object or device. No one will use AR apps or tools if they take just as long or longer than the conventional way of doing something. Let’s use the AT&T example, again. Let’s say I want to modify my account settings. I could design an augmented reality interface where I open an AT&T app on my smartphone or tablet and direct the camera at my WIFI modem. Similar to the Ferrari showroom app, the app would then show me all options for managing my WIFI service. If my AT&T accounts are linked, I can then select an option to apply address changes to all other accounts. Most likely a customer who wants to change their address for WiFi would also want to change their address for all their other AT&T services. Using an augmented reality app makes it possible to detect the customer’s address based on GPS, verify the account holder by voice recognition, verify the device in question through camera display and essentially make our lives a whole lot easier. This technology exists. It’s just not being used because companies have limited themselves by building their products in silos. They burden themselves and us by not recognizing the power of connected products. Layar is a great example of how to design AR capabilities into formerly inactive objects like printed materials. Instead of merely creating a digital recreation of a printed magazine, AR apps bring the pages to life. Consider producing a single source with layers of capabilities instead of recreating the same information into multiple forms of media. This allows a product team to work collaboratively on a single product instead of multiple unconnected products. The one product is an analog format with digital layers, which provides a richer reading experience while deepening brand engagement. Engagement provides a lot of passive feedback about content and design, which in turn provides continual feedback to both the user and the product team. Consider the process of discovering a new movie. Think about where you are when you are introduced to a new movie coming to a theater near you. Usually you’re at the cinema, or walking nearby a movie theater, sitting on the bus reading, in a cab, or watching something contextually related on your phone. An AR app could allow you to scan a poster or screen so you can buy tickets, select the seats in the theater, choose your refreshments with a clear understanding of what the seats physically look like and the actual size of your popcorn. Consumers will be able to make far more informed choices with AR apps and reduce customer service complaints. Some people might worry that this kind of technology will eliminate jobs or that relying too heavily on technology is risky. AR is not the same as AI and isn’t about designing intelligent services that eliminate the need for human thinking. AR is really about designing layers of added value that reduce the time to complete simple tasks. AR apps should reduce human error by removing room for interpretation because you’re presented with a realistic rendering of something. As the collaborative design app UXPin first explained in their free e-book Interaction Design Best Practices, task efficiency is the core of every great product. Well designed services include contingency plans for technology failures in case of an outage. These services all have some sort of analog component to ground them in reality. And although reality can be whatever our minds allow us to believe in order for people to collectively perceive something as useful there has to be a shared mental model of reality. When designing augmented reality apps, you first need to research the time and place in which the service will be used. The environment affects AR design significantly because there’s always an object that becomes the background to display the layers upon. Successful AR apps are grounded in reality. Consider real tools that solve real problems at a particular location and time. Look at the internet of things. How does adding interactive elements add value? Technology just for the sake of technology might be interesting as a gimmick but it won’t change behavior. Augmented reality apps need to be based off an existing behavior. Figure out what tasks people already perform and map the touch-points involved. The best way to do this is by creating a service blueprint. A great resource is ServiceDesignTools.org. There are all kinds of activities and templates to use for designing services that work well and add value. Through the capabilities of our smart phones, the internet of things, and WiFi everywhere, we are all slowly becoming cyborgs. Augmented reality is a valuable added layer empowering us to make more informed decisions. As consumers experiencing information overload, we are desperate for advanced customer service. Augmented reality is like our own personal assistant providing us with an easy way to customize our world. Designing for an augmented world requires an understanding of how to design services that solve problems. To learn more about designing for human behavior, I recommend checking out the two free e-books below. Across over 200 pages, both ebooks boil down complex topics like psychology and design principles into simple tips for everyday design. I’ve also started playing around with the UXPin app and found it quite helpful for approaching design from a service rather than product standpoint. With thousands of built-in elements for different devices (like mobile, tablet, and wearables), you can quickly design for many digital touchpoints in a single project. It certainly helps keep everything in the right perspective throughout the UX process. Get the most important tech news in your inbox each week.
english
<filename>.devcontainer.json { "name": "scaffold-eth", "extensions": [ "dbaeumer.vscode-eslint", "contractshark.solidity-lang@1.3.0" ], "forwardPorts": [ 3000 ], "hostRequirements": { "memory": "8gb" }, "remoteUser": "node", "image": "mcr.microsoft.com/vscode/devcontainers/javascript-node:16-bullseye", "containerEnv": { "REACT_APP_CODESPACES": "true" }, "onCreateCommand": "yarn install && yarn browserslist --update-db" }
json
--- layout: default title: Diary of a Madman - Productions - Fail Better Productions menu-item: productions submenu-item: madman styles: - /css/colours.css - ../production.css - ./styles.css styles-ie6: ../production-ie6.css --- <div class="sub-content"> <h1 id="madman" class="two-lines">Diary of a Madman</h1> <h2>after Gogol</h2> <div class="cast-and-crew madman"> <h3>Cast and Crew</h3> <div class="core-team"> <dl class="left"> <dt>Director</dt> <dd><NAME></dd> <dt>Designer</dt> <dd><NAME></dd> <dt>Sound Design</dt> <dd><NAME> / <NAME></dd> </dl> <dl class="right"> <dt>Performer 2011</dt> <dd><NAME></dd> <dt>Lighting Designer</dt> <dd><NAME></dd> </dl> </div> <!-- <div class="assistants"> <dl class="left"> <dt>Assistant Producer</dt> <dd><NAME></dd> <dt>Assistant Producer</dt> <dd><NAME></dd> </dl> <dl class="right"> <dt>Assistant Director</dt> <dd><NAME></dd> <dt>Assistant Stage Manager</dt> <dd class="double-height">Nat Rossetti</dd> </dl> </div> --> <div class="previous-team"> <dl class="left"> <dt>Producer</dt> <dd><NAME></dd> </dl> <dl class="right"> <dt>Performer 2007-09</dt> <dd><NAME>er</dd> </dl> </div> </div> <div class="production madman"> <h3>About the production</h3> <div class="images"> <img src="./madman-10.jpg" width="160" height="118" title="'The letter is quite legible, though the handwriting looks a bit doggy'" alt="['The letter is quite legible, though the handwriting looks a bit doggy']" /> <img src="./madman-11.jpg" width="160" height="240" title="'Ferdinand VIII, King of Spain'" alt="['Ferdinand VIII, King of Spain']" /> <img src="./madman-1.jpg" width="160" height="120" title="'Silence. The less said the better. Silence.'" alt="['Silence. The less said the better. Silence.']" /> </div> <p style="color: #CCC;"> <a href="http://www.warwickartscentre.co.uk/events/theatre/diary-of-a-madman-discords#performance-108809" target="_blank" title="http://www.warwickartscentre.co.uk/... - Opens in a new window" style="color: #CCC;">Warwick Arts Centre - 21st &amp; 22nd January 2011 @ 7:45pm</a><br /> Presented as part of a double bill with <a href="../discords/" class="fbp-show" style="color: #CCC;">Discords</a> </p> <p><q>"I love going to the theatre. As long as I've a kopeck in my pocket you can't stop me."</q></p> <p><strong> obsession. alienation. breakdown. crisis. psychosis. <!--trauma.--><br /> <br /> ...and two little dogs writing each other letters. </strong></p> <p><NAME>, a Russian titular councillor, finds he can no longer exist as a mere civil servant in St Petersburg. His failure to write begins a transformational journey that will take him either to the Spanish court or to a brutal asylum.</p> <p>Performed alone on an intricate set in a continuous flow of action, this one-man show challenges the spectator to see Axenty within themselves. Using methods central to the company's practice, this production tells a tragicomic story through an intensely focused and detailed immediacy that defines the Fail Better aesthetic. </p> <p> This production premiered at the Rosemary Branch Theatre, London in August 2007 and was 'Best Fringe Show of 2007' for Tamara Gausi of Time Out London:<br /> <q cite="http://www.timeout.com/london/theatre/events/469373/diary_of_a_madman.html">"Fail Better's accomplished one-man performance [featuring] ... an enchanting Chris Tester ... terse direction ... an absorbing performance ... clever lighting design ... a set [that] perfectly captures the claustrophobic mania ... a reminder that madness sits dangerously close to us all."</q><br /> <cite>Time Out London</cite> </p> <p> Last performed at the Edinburgh Fringe in 2009, the show received outstanding reviews: <q cite="http://fest.theskinny.co.uk/article/97167-diary-of-a-madman">"... remarkably punchy ... strikingly inventive ... a truly gripping piece of theatre"</q> <a href="http://fest.theskinny.co.uk/article/97167-diary-of-a-madman" target="_blank" title="http://fest.theskinny.co.uk/...diary-of-a-madman - Opens in a new window"><cite>Fest</cite></a>; <q cite="http://edinburgh.threeweeks.co.uk/review/7476">"A powerful and moving piece of theatre"</q> <a href="http://edinburgh.threeweeks.co.uk/review/7476" target="_blank" title="http://edinburgh.threeweeks.co.uk/... - Opens in a new window"><cite>Three Weeks</cite></a>. </p> <!-- <p style="color: #DDD; font-size: 11px; text-align: center;"> <q cite="http://www.edfringe.com/reviews/read.html?id=14583">"This show is absolutely riveting. It is funny, sad and moving; do not miss it!"</q><br /> ***** - <a href="http://www.edfringe.com/reviews/read.html?id=14583" target="_blank" title="http://www.edfringe.com/... - Opens in a new window" style="color: #DDD;"><cite>Audience member - edfringe.com</cite></a> </p> <p style="color: #DDD; font-size: 11px; text-align: center;"> <q cite="http://www.theskinny.co.uk/listing/29478-diary-of-a-madman">"Beautiful little discovery at the Underbelly - a stunning setting... An incredibly accomplished one-man performance... Highly recommended!"</q><br /> <a href="http://www.theskinny.co.uk/listing/29478-diary-of-a-madman#comment_3393" target="_blank" title="http://www.theskinny.co.uk/... - Opens in a new window" style="color: #DDD;"><cite>Audience member - Fest Online</cite></a> </p> <p style="color: #DDD; font-size: 11px; text-align: center;"> <q cite="http://tariqkataria.blogspot.com/2009/08/diary-of-madman-at-edinburgh-fringe.html">"...the acting is intense, with rich flowing movement ... and touchingly emotive lighting..."</q><br /> <a href="http://tariqkataria.blogspot.com/2009/08/diary-of-madman-at-edinburgh-fringe.html" target="_blank" title="http://tariqkataria.blogspot.com/... - Opens in a new window" style="color: #DDD;"><cite>Audience member</cite></a> </p> --> <p class="reviews">To read reviews and audience feedback from the London run of this production, <a href="../../press/madman/madman_reviews.pdf" target="_blank" title="Download reviews">click here</a><p> </div> </div>
html
{ "name": "PHR-100AF", "description": "An external Firewire hard drive enclosure.", "url": "https://www.amazon.com/Macally-PHR-100AF-FireWire-External-Enclosure/dp/B0001UEHI0" }
json
package gm.server.handler; import client.MapleClient; import gm.GMPacketCreator; import gm.GMPacketHandler; import gm.server.GMServer; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import org.apache.mina.core.session.IoSession; import tools.DatabaseConnection; import tools.data.input.SeekableLittleEndianAccessor; /** * * @author kevintjuh93 */ public class LoginHandler implements GMPacketHandler { @Override public void handlePacket(SeekableLittleEndianAccessor slea, IoSession session) { if (!GMServer.KEYWORD.equals(slea.readMapleAsciiString())) { session.write(GMPacketCreator.sendLoginResponse((byte) -1, null)); return; } String login = slea.readMapleAsciiString(); if (GMServer.contains(login)) { session.write(GMPacketCreator.sendLoginResponse((byte) 0, null)); return; } String password = slea.readMapleAsciiString(); PreparedStatement ps = null; ResultSet rs = null; Connection con = DatabaseConnection.getConnection(); try { ps = con.prepareStatement("SELECT `password`, `id` FROM `accounts` WHERE `name` = ? AND `gm` >= 2"); ps.setString(1, login); rs = ps.executeQuery(); if (rs.next()) { String pw = rs.getString("password"); if (password.equals(pw) || MapleClient.checkHash(pw, "SHA-1", password)) { /* int accid = rs.getInt("id"); ps.close(); rs.close(); ps = con.prepareStatement("SELECT `name` FROM `characters` WHERE `accountid` = ? AND `gm` >= 2"); ps.setInt(1, accid); rs = ps.executeQuery(); if (rs.next()) { String name = rs.getString("name"); session.setAttribute("NAME", login); server.addOutGame(login, session); session.write(GMPacketCreator.sendLoginResponse((byte) 3, login)); server.broadcastOutGame(GMPacketCreator.chat(login + " has logged in."), login); server.broadcastOutGame(GMPacketCreator.addUser(login), login); session.write(GMPacketCreator.sendUserList(server.getUserList(login))); return; } else { session.write(GMPacketCreator.sendLoginResponse((byte) 2, name)); return; }*/ session.setAttribute("NAME", login); GMServer.addOutGame(login, session); session.write(GMPacketCreator.sendLoginResponse((byte) 3, login)); GMServer.broadcastOutGame(GMPacketCreator.chat(login + " has logged in."), login); GMServer.broadcastOutGame(GMPacketCreator.addUser(login), login); session.write(GMPacketCreator.sendUserList(GMServer.getUserList(login))); return; } } session.write(GMPacketCreator.sendLoginResponse((byte) 1, null)); } catch (SQLException e) { try { if (ps != null) { ps.close(); } if (rs != null) { rs.close(); } } catch (SQLException ex) { } session.write(GMPacketCreator.sendLoginResponse((byte) 1, null)); } finally { try { if (ps != null) { ps.close(); } if (rs != null) { rs.close(); } } catch (SQLException ex) { } } } }
java
<filename>src/main/java/gg/sep/twitchapi/helix/model/AbstractHelixObject.java package gg.sep.twitchapi.helix.model; import lombok.Getter; import lombok.Setter; import gg.sep.twitchapi.helix.Helix; /** * Abstract implementation of {@link HelixObject}. * * Implements the base Getter and Setter for the Helix reference. */ public abstract class AbstractHelixObject implements HelixObject { @Getter @Setter private transient Helix helix; }
java
Despite the unprecedented power outage in Mumbai and its surrounding areas on Monday, COVID-19 hospitals continued to work uninterrupted, said the Brihanmumbai Municipal Corporation (BMC). “Even though the frequency of power cuts within BMC limits is less, all municipal hospitals are equipped with automatic diesel generators at all times. Today, after the power outage, the automatic diesel generators started immediately. The solid waste management department was directed to ensure diesel storage. As a result, all hospitals continued to function without interruption,” the BMC said. The civic body said its disaster management department ensures that all private COVID-19 hospitals also has necessary supplies of diesel to run generators in case of emergency. “No health services were hampered due to the power outage in Mumbai,” the BMC said. Navi Mumbai and Raigad implemented rotational load shedding throughout the day after the power failure at 10. 10 a. m. disrupted traffic signals, online classes, work from home schedules and household chores. Around 12 p. m. , power in Navi Mumbai started being restored. “In the afternoon, on a priority basis, we started switching on the feeders providing power to the hospitals with the existing load. Once the work at the main line of fault was completed around 7 p. m. , electricity was restored in a step by step manner to avoid overloading,” Rajaram Mane, superintendent engineer, Vashi circle of MSEDCL, said. At the time of going to press, many areas in Koparkhairane, Ghansoli, Airoli, Taloja, Panvel, Nerul, Kharghar, Kamothe, where power had been restored in the afternoon, plunged into darkness again. “We started rotational load shedding till the main fault was rectified. The feeders were supplying power in rotation so that power supply to hospitals do not go off,” an executive engineer from Navi Mumbai said. The 400 kV Kalwa-Talegaon line was undergoing repairs since October 10. On Monday, when the 400 kV Kalwa–Padghe circuit no. 1 of MSETCL was being repaired, all the load was transferred to circuit no. 2. Milind Awatade, MSETCL PRO, said due to the sudden technical fault in circuit no. 2, power supply was affected in Mumbai, Thane and parts of Raigad. The officers and employees of MSETCL worked on a war footing to restore power supply. He said, as three of the four lines supplying power to Kalwa substation tripped, all the load was transferred to the 400 kV Talegaon–Kharghar and 400 kV Kharghar–Kalwa lines. “Due to heavy sparks, those lines tripped too. The Kharghar-Kalwa line got deenergised (zero load) and the Mumbai system got delinked,” Mr. Awatade said. As the 500 MW unit of Tata Power tripped, 1700 MW load in MMR region was affected. “This multiple power grid failure at this massive level at the State Load Dispatch Centre happened for the first time,” he said. (With additional inputs from Raina Assainar)
english
{ "usingComponents": { "van-tab": "../../vant-lib/tab/index", "van-tabs": "../../vant-lib/tabs/index", "van-tabbar": "../../vant-lib/tabbar/index", "van-tabbar-item": "../../vant-lib/tabbar-item/index" } }
json
<reponame>justacoder/mica /* *************************************************************************** * Mica - the Java(tm) Graphics Framework * *************************************************************************** * NOTICE: Permission to use, copy, and modify this software and its * * documentation is hereby granted provided that this notice appears in * * all copies. * * * * Permission to distribute un-modified copies of this software and its * * documentation is hereby granted provided that no fee is charged and * * that this notice appears in all copies. * * * * SOFTWARE FARM MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE * * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT * * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR * * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SOFTWARE FARM SHALL NOT BE * * LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR * * CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE, MODIFICATION OR * * DISTRIBUTION OF THIS SOFTWARE OR ITS DERIVATIVES. * * * * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND * * DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, * * UPDATES, ENHANCEMENTS, OR MODIFICATIONS. * * * *************************************************************************** * Copyright (c) 1997-2004 Software Farm, Inc. All Rights Reserved. * *************************************************************************** */ package com.swfm.mica; /**---------------------------------------------------------------------------------------------- * This class can execute commands that a standard 'view' menu might * generate. The commands apply to the target MiEditor (see * setTargetOfCommand()). The commands that are handled are: * <p> * <pre> * Mi_CUT_COMMAND_NAME * Mi_COPY_COMMAND_NAME * Mi_PASTE_COMMAND_NAME * Mi_DUPLICATE_COMMAND_NAME * Mi_DELETE_COMMAND_NAME * Mi_ZOOM_IN_COMMAND_NAME * Mi_ZOOM_OUT_COMMAND_NAME * Mi_DISPLAY_PROPERTIES_COMMAND_NAME * </pre> * @version %I% %G% * @author <NAME> * @release 1.4.1 * @module %M% * @language Java (JDK 1.4) *----------------------------------------------------------------------------------------------*/ public class MiEditorBackgroundMenuCommands extends MiCommandHandler implements MiiActionHandler, MiiCommandNames, MiiActionTypes { private MiiCommandManager manager; private boolean shapeSelected; private MiEditor editor; private MiPanAndZoomCommand panAndZoomCommand = new MiPanAndZoomCommand(); private MiDeletePartsCommand deleteSelectedObjects = new MiDeletePartsCommand(); private MiAction itemSelectedAction = new MiAction(this, Mi_NO_ITEMS_SELECTED_ACTION, Mi_ONE_ITEM_SELECTED_ACTION, Mi_MANY_ITEMS_SELECTED_ACTION); /**------------------------------------------------------ * Constructs a new MiEditorBackgroundMenuCommands. * @see MiEditorBackgroundMenu *------------------------------------------------------*/ public MiEditorBackgroundMenuCommands(MiiCommandManager manager) { this.manager = manager; MiSystem.getClipBoard().appendActionHandler(this, Mi_CLIPBOARD_NOW_HAS_DATA_ACTION); } /**------------------------------------------------------ * Sets the target of the commands processed by this * MiiCommandHandler (i.e. what the commands are to act upon). * The target must be an MiEditor. * @param target the target MiEditor * @see MiCommandHandler#getTargetOfCommand * @see #processCommand *------------------------------------------------------*/ public void setTargetOfCommand(Object target) { if (editor == (MiEditor )target) { return; } if (editor != null) { editor.removeActionHandler(itemSelectedAction); } editor = (MiEditor )target; panAndZoomCommand.setTargetOfCommand(editor); super.setTargetOfCommand(editor); deleteSelectedObjects.setTargetOfCommand(getTargetOfCommand()); editor.appendActionHandler(itemSelectedAction); handleSelectionState(editor.getNumberOfPartsSelected()); } /**------------------------------------------------------ * Processes the given command. * @command the command to execute *------------------------------------------------------*/ public void processCommand(String cmd) { MiUtility.pushMouseAppearance( editor, MiiTypes.Mi_WAIT_CURSOR, "MiEditorBackgroundMenuCommands"); if (cmd.equalsIgnoreCase(Mi_ZOOM_IN_COMMAND_NAME)) { panAndZoomCommand.processCommand(Mi_ZOOM_IN_COMMAND_NAME); } else if (cmd.equalsIgnoreCase(Mi_ZOOM_OUT_COMMAND_NAME)) { panAndZoomCommand.processCommand(Mi_ZOOM_OUT_COMMAND_NAME); } else if (cmd.equalsIgnoreCase(Mi_CUT_COMMAND_NAME)) { MiSystem.getClipBoard().cutSelectionToClipBoard(editor); } else if (cmd.equalsIgnoreCase(Mi_COPY_COMMAND_NAME)) { MiSystem.getClipBoard().copySelectionToClipBoard(editor); } else if (cmd.equalsIgnoreCase(Mi_PASTE_COMMAND_NAME)) { MiSystem.getClipBoard().pasteFromClipBoard(editor, editor.getMousePosition().getCenter()); } else if (cmd.equalsIgnoreCase(Mi_DUPLICATE_COMMAND_NAME)) { deleteSelectedObjects.processCommand(Mi_DUPLICATE_COMMAND_NAME); } else if (cmd.equalsIgnoreCase(Mi_DELETE_COMMAND_NAME)) { deleteSelectedObjects.processCommand(MiDeletePartsCommand.Mi_DELETE_COMMAND_NAME); } else if (cmd.equalsIgnoreCase(Mi_DISPLAY_PROPERTIES_COMMAND_NAME)) { MiParts selectedParts = editor.getSelectedParts(new MiParts()); if (selectedParts.size() > 0) selectedParts.elementAt(0).dispatchAction(Mi_DISPLAY_PROPERTIES_ACTION); } MiUtility.popMouseAppearance(editor, "MiEditorBackgroundMenuCommands"); } /**------------------------------------------------------ * Processes the given action. * @param action the action to process * @return true if it is OK to send * action to the next action handler * false if it is NOT OK to send * action to the next action handler *------------------------------------------------------*/ public boolean processAction(MiiAction event) { if (event.hasActionType(Mi_NO_ITEMS_SELECTED_ACTION)) { handleSelectionState(0); } else if (event.hasActionType(Mi_ONE_ITEM_SELECTED_ACTION)) { handleSelectionState(1); } else if (event.hasActionType(Mi_MANY_ITEMS_SELECTED_ACTION)) { handleSelectionState(2); } else if (event.hasActionType(Mi_CLIPBOARD_NOW_HAS_DATA_ACTION)) { manager.setCommandSensitivity(Mi_PASTE_COMMAND_NAME, true); } return(true); } /**------------------------------------------------------ * Updates the sensitivity of the widgets that generate * some of the commands based on the given number of items * currently selected in the target editor. * @param num the number of items selected *------------------------------------------------------*/ protected void handleSelectionState(int num) { if (num == 0) { shapeSelected = false; manager.setCommandSensitivity(Mi_CUT_COMMAND_NAME, false); manager.setCommandSensitivity(Mi_COPY_COMMAND_NAME, false); manager.setCommandSensitivity(Mi_DUPLICATE_COMMAND_NAME, false); manager.setCommandSensitivity(Mi_DELETE_COMMAND_NAME, false); /*** FIX: add this someday if (editor.getLocalActionsHandled().hasActionType(Mi_DISPLAY_PROPERTIES_ACTION)) manager.setCommandSensitivity(Mi_DISPLAY_PROPERTIES_COMMAND_NAME, true); else ***/ manager.setCommandSensitivity(Mi_DISPLAY_PROPERTIES_COMMAND_NAME, false); } else { shapeSelected = true; manager.setCommandSensitivity(Mi_CUT_COMMAND_NAME, true); manager.setCommandSensitivity(Mi_COPY_COMMAND_NAME, true); manager.setCommandSensitivity(Mi_DUPLICATE_COMMAND_NAME, true); manager.setCommandSensitivity(Mi_DELETE_COMMAND_NAME, true); manager.setCommandSensitivity(Mi_DISPLAY_PROPERTIES_COMMAND_NAME, (num == 1)); } if (MiSystem.getClipBoard().hasData()) manager.setCommandSensitivity(Mi_PASTE_COMMAND_NAME, true); else manager.setCommandSensitivity(Mi_PASTE_COMMAND_NAME, false); } }
java
<filename>test/TopAppBar.js 'use strict' import test from 'ava' import { snapshot } from './helpers/vnode' import { TopAppBar } from '../src' test('minimal', t => { const x = TopAppBar() snapshot(t, x) }) test('maximal', t => { const x = TopAppBar( { fixed: true }, TopAppBar.Row( TopAppBar.Section( { alignStart: true }, TopAppBar.Icon({ navigation: true }, 'icon_name'), 'AppBarText' ), TopAppBar.Section({ alignEnd: true }, 'MoreText') ) ) snapshot(t, x) })
javascript
Cannes 2023: Aishwarya Rai Bachchan leaves everyone shocked as she returns within one day after making an appearance at French Rivera along with daughter Aaradhya Bachchan. Aishwarya Rai Bachchan is called Cannes Queen as she has been ruling the French Riviera over the years, and this year too she stunned in a silver and black over-head gown, and her fans were melting looking at the mesmerising beauty and were waiting for the day 2 look, but to everyone’s surprise Ash came back home, making only one day's appearance at the red carpet, and many are wondering what went wrong. It is the first time over the years Ash returned in a day and didn’t make the second appearance at Cannes 2023. Watch the video of Aaradhya Bachchan greeting the paparazzi with Namaste as she is back from Cannes, along with mom Aishwarya Rai Bachchan. Aishwarya was spotted at the airport along with her daughter, who happily greeted the paparazzi for their presence, and the netizens jumped to pass on their opinions after this return video of the mother and daughter duo surfaced online. They are flabbergasted seeing that this is the first time Ash is not holding Aaradhya’s hand. Often, Ash gets mercilessly trolled for being an overprotective mother. Aishwarya Rai Bachchan's Cannes 2023 appearance fails to impress netizens. Aishwarya Rai Bachchan was badly trolled for her appearance at Canes at his year, and they asked the former Miss India to change her stylist ASAP. Ash was also mocked for keeping the same hairstyle over the years, and they wonder if she is bored in her life and doesn’t want to make any basic changes either. While her fans are in love with her no matter what. And like Aishwarya had reacted years ago to being trolled for their Cannes look, "You guys can troll me as much as you want, but the fact is I have just been too busy." 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
The Enforcement Directorate’s searches at Manappuram Finance Ltd (Manappuram) could hurt the gold loan company’s reputation and endanger its business prospects, according to rating agency Fitch. Such risks may constrict funding access due to reduced market confidence, potentially affecting an issuer’s credit profile--even if no wrongdoing is identified. Manappuram (BB-/Stable) has disclosed that the Enforcement Directorate searched its premises in Kerala’s Thrissur last week in connection with legacy non-compliant activities at its branches up until 2012, said Fitch in a statement. Such searches are relatively rare but can flag potential governance risks. The activities the company has identified thus far as being involved are publicly known. Fitch has already factored them in the company's rating and assessment of corporate governance. The issue highlights the corporate governance challenges that can arise in emerging markets like India. Governance standards are still developing and often lag those in higher-rated jurisdictions. Companies that expanded rapidly amid strong economic growth may also lack established governance structures to match their increased scale, the rating agency said. India sets minimum governance standards for listed corporates, and the requirements for non-bank financing companies have stiffened in recent years. Nonetheless, the prevalence of founder- and family-driven corporations can concentrate decision-making, and alignment of interests among key company decision-makers may be skewed in favour of equity-holders, it said. Such issues are common in many emerging markets, and Fitch said it considers multiple factors in assessing corporate governance risks.
english
Why you can trust TechRadar We spend hours testing every product or service we review, so you can be sure you’re buying the best. Find out more about how we test. The Orbitsound T12 is a relatively simple design that doesn't claim to deliver real 5.1 sound. Indeed, it's not conventional stereo either. Its proprietary 'airSOUND' technology reproduces the main signal (mono) and spatial (the 'difference' signal, between the left and right channels) information, instead of the 'left/ right-channel' method associated with traditional stereo systems. The main signal is reproduced from the unit's front-firing drivers, while the spatial information emanates from the side-firing transducers in reverse-polarity to one another. When these combine in front of the soundbar, they produce a 'single-point' stereo soundfield. The 'virtual' 5.1 systems sold by some manufacturers rarely sound convincing, and so this ingenious alternative is quite compelling. As well as offering to boost the stereo output of your TV and give a wider soundstage, the T12 has an iPod dock located on top. This cunning addition suddenly turns it into a hi-fi as well. Clever, eh? As soundbars go, this is the smallest I've seen, and can be easily wall-mounted underneath a flatscreen if you so wish. The tall passive subwoofer is best located somewhere near the screen, partly because the thin speaker wire provided is so short. The only inputs here are a single pair of analogue line-level connections to run to your TV, and a stereo minijack for hooking up another portable device. There are no digital inputs at all, but Orbitsound told us that a digital input would present 'no advantage', not least because the airSOUND processing and amplification is analogue. Does it work, though? To a degree, yes. airSOUND gives stereo sources a smidgen of depth and a wider field – an improvement over most TV's integrated speakers. The treble detail is quite accurate, and this makes TV dialogue a little more intelligible. And adding a subwoofer is a big advantage for a flatscreen TV, as they usually have trouble drumming up decent bass levels. However, while the Orbitsound T12 offers a marked improvement on the audio of an average TV, it's by no means the best soundbar I've heard. The passive subwoofer is boomy and under-powered and, with no digital audio inputs, connectivity is oversimplified. The integrated iPod dock wins back a lot of that criticism, though. Statistically, you probably own at least one of these MP3 players, and this is certainly a convenient way of accessing your music via remote control. There's even a composite connection to put the menu on screen. It's no PA system, but soundbar and dock will give you decent playback. There are plenty of soundbars around at this price point, and the Orbitsound T12 might struggle to make itself heard. But the provision of the iPod dock will certainly broaden its appeal. Jim is a seasoned expert when it comes to testing tech. From playing a prototype PlayStation One to meeting a man called Steve about a new kind of phone in 2007, he’s always hunting the next big thing at the bleeding edge of the electronics industry. After editing the tech section of Wired UK magazine, he is currently specialising in IT and voyaging in his VW camper van.
english
Visit http://defn.sh/docker-compose/ or open `docs/index.html`
markdown
Amazon holds the Prime Day sale every year to gain new subscribers and reward the existing ones with exclusive deals and offers. - Amazon Prime Day sale is all set to go live in India on July 26. - The sale would start at 12 am and would continue till July 27 midnight. - The two-day sale is exclusively available for Prime members. By Ankita Chakravarti: Amazon Prime Day sale is all set to go live in India on July 26. The sale would start at 12 am and would continue till July 27 midnight. The two-day sale is exclusively available for Prime members. Amazon holds the Prime Day sale to gain new subscribers and attract more subscribers. Amazon will be offering deals on discounts on categories, including Smartphones, Consumer Electronics, TVs, Appliances, Amazon Devices, Fashion & Beauty, Home & Kitchen, Furniture. Apart from the discounts, some companies are also expected to launch their products during the Prime Day sale. Ahead of the sale, Amazon has already listed the smartphones that will be available at discounted prices during the sale. The list includes some newly-launched smartphones such as the OnePlus Nord CE 5G, which was launched at Rs 22,999 for the base variant. Other phones that will be available with a price cut includes Redmi Note 10S, Redmi Note 10 Pro Max, iPhone 11 and OnePlus 9R 5G, Redmi Note 10. What are the bank offers? Amazon has revealed that HDFC Bank account holders will get an instant discount of 10 per cent on most smartphones. Apart from that, buyers will also be able to exchange their old phone for the new one, avail of No-cost EMI. How much does the Prime Membership cost?
english
Having two pace bowlers will not add as much as value to the bowling attack as the reliance is completely on the spinners. And then, neither Umesh nor Aaron fall in the category of ‘match-winners’. The pitch for the first Test is turning out a paradise for spinners; looking at how India’s batting responded to the part-time spin of Elgar on the opening day of this four-Test series, it will be wise to have an extra batsman instead of having the second pacer who is neither impactful nor required. Having an additional batsman will not only provide them depth but will also take pressure off the five specialist batsmen who carry the burden of making all the runs. In 2004, when India registered a miraculous win at Mumbai against Australia, the team had one pacer in Zaheer Khan and three spinners in Anil Kumble, Murali Kartik and Harbhajan Singh. This combination not only worked for India, but also gave them an opportunity to load their side with batsmen — India’s core strength. South Africa have proved time and again that irrespective of the nature of the track, they have it in them to trouble India. The way their spinners bowled on Day One proved that India will not have an easy road ahead, more so with the form of Dhawan and Kohli being a little bit of concern. It will be a relief if there is an extra batsman who can chip in with the ball as well whenever needed. The idea of aggression is indeed alluring, but it must be kept in mind that the team composition should not leave any loophole. The frailties of the lower order have been exposed time and again. It will also not be fair to expect runs from Ashwin, Jadeja and Mishra. They should be allowed to concentrate on their core strength and targets, whereas batsmen should bear the burden of scoring all the runs and holding fort whenever needed. (Devarchit Varma is senior writer with CricketCountry. He can be followed on Twitter @Devarchit) This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful. Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings. If you disable this cookie, we will not be able to save your preferences. This means that every time you visit this website you will need to enable or disable cookies again.
english
<gh_stars>0 {"ast":null,"code":"var _jsxFileName = \"/Users/babakiki/LambdaSchoolWork/Labs/shopping/ecommerce-site/store/src/components/Title.js\";\nimport React from 'react';\nexport default function Title({\n name,\n title\n}) {\n return React.createElement(\"div\", {\n className: \"row\",\n __source: {\n fileName: _jsxFileName,\n lineNumber: 5\n },\n __self: this\n }, React.createElement(\"div\", {\n className: \"col-10 mx-auto my-2 mt-2 text-center text-title\",\n __source: {\n fileName: _jsxFileName,\n lineNumber: 6\n },\n __self: this\n }, React.createElement(\"h1\", {\n className: \"text-capitalize font-weight-bold\",\n __source: {\n fileName: _jsxFileName,\n lineNumber: 7\n },\n __self: this\n }, name, \" \", React.createElement(\"strong\", {\n className: \"text-blue\",\n __source: {\n fileName: _jsxFileName,\n lineNumber: 8\n },\n __self: this\n }, title))));\n}","map":{"version":3,"sources":["/Users/babakiki/LambdaSchoolWork/Labs/shopping/ecommerce-site/store/src/components/Title.js"],"names":["React","Title","name","title"],"mappings":";AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAEA,eAAe,SAASC,KAAT,CAAe;AAACC,EAAAA,IAAD;AAAOC,EAAAA;AAAP,CAAf,EAA8B;AACzC,SACI;AAAK,IAAA,SAAS,EAAC,KAAf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KACI;AAAK,IAAA,SAAS,EAAC,iDAAf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KACI;AAAI,IAAA,SAAS,EAAC,kCAAd;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KACKD,IADL,OACW;AAAQ,IAAA,SAAS,EAAC,WAAlB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAA+BC,KAA/B,CADX,CADJ,CADJ,CADJ;AAWH","sourcesContent":["import React from 'react'\n\nexport default function Title({name, title}) {\n return (\n <div className='row'>\n <div className='col-10 mx-auto my-2 mt-2 text-center text-title'>\n <h1 className='text-capitalize font-weight-bold'>\n {name} <strong className='text-blue'>{title}</strong>\n </h1>\n\n </div>\n \n </div>\n )\n}\n"]},"metadata":{},"sourceType":"module"}
json
The Andhra Pradesh government led by Chief Minister YS Jagan Mohan Reddy has taken the Rayalaseema Lift Irrigation Project (RLIP) on river Krishna prestigiously, which was started with an aim to draw 3 TMCs water from the Srisailam reservoir daily. However, the project went through a series of tough situations, with Jagan's Telangana counterpart KCR raising many objections over the project of the Andhra Pradesh government. Now it is said that the Central Warehousing Corporation told a piece of good news for the Andhra Pradesh government by declaring the construction of the project can be done without their permission reportedly. Reports claimed that the CWC gave its nod to go ahead with the project without their permission as the public warehouse operator is satisfied with the agreements of the AP government that the Rayalaseema Lift Irrigation project is constructed as part of the Pothireddypadu project extensions works. With the latest development, the Andhra Pradesh government is likely to speed up the works related to the construction of the Rayalaseema Lift Irrigation project. Now, the AP government has only one step to cross to go ahead with the construction. Once, the State Water Resources Department officials give a green signal, there will be no stopping for the project. The project is crucial for Andhra Pradesh as the project plays a vital role in providing water for drinking water and irrigation purposes for Kadapa, Kurnool, Chittoor, Anantapur, and the Nellore district.
english
{ "id": 17412, "title": [ "[Saisha's General Store]" ], "description": [ "Honey gold oak walls rise from a golden blonde oak floor. Just above an iron candelabra hangs a peacock feather fan, and an oak beam ceiling completes the picture. A narrow glass-topped table and a narrow glass-topped table stand side by side in the middle of the room." ], "paths": [ "Obvious exits: east" ], "location": "Icemule Trace", "wayto": { "15700": "east" }, "timeto": { "15700": 0.2 } }
json
import { Component, OnInit ,Input } from '@angular/core'; import { Router } from '@angular/router'; declare let $: any; @Component({ selector: 'app-progress-bar', templateUrl: './progress-bar.component.html', styleUrls: ['./progress-bar.component.scss'] }) export class ProgressBarComponent implements OnInit { @Input() percentage: any; @Input() Wdith: any; @Input() borderColor: any; @Input() fontSize: any; @Input() label: any; constructor( public router: Router, ) {} ngOnInit() { $(document).ready(function () { $('[data-toggle="tooltip"]').tooltip(); }); } }
typescript
<filename>api/serializers.py from rest_framework import serializers from apps.calendarioPago.models import CalendarioPago from apps.cliente.models import Cliente from apps.cuenta.models import Cuenta from apps.grupo.models import Grupo from apps.miembro.models import Miembro from apps.transaccion.models import Transaccion # Serializers define the API representation. class CalendarioPagoSerializer(serializers.ModelSerializer): class Meta: model = CalendarioPago fields = ['id', 'cuenta_id', 'num_pago', 'monto', 'fecha_pago', 'estatus', ] class ClienteSerializer(serializers.ModelSerializer): class Meta: model = Cliente fields = ['id', 'nombre', ] class MiembroSerializer(serializers.ModelSerializer): cliente = ClienteSerializer(source='cliente_id', read_only=True) class Meta: model = Miembro fields = ['cliente'] class MiembrosSerializer(serializers.ModelSerializer): class Meta: model = Miembro fields = ['id', 'grupo_id', 'cliente_id'] class GrupoSerializer(serializers.ModelSerializer): miembros = MiembroSerializer(many=True) class Meta: model = Grupo fields = ['id', 'nombre', 'miembros'] class GruposSerializer(serializers.ModelSerializer): class Meta: model = Grupo fields = ['id', 'nombre', ] class TransaccionSerializer(serializers.ModelSerializer): class Meta: model = Transaccion fields = ['id', 'cuenta_id', 'fecha', 'monto', ] class CuentaSerializer(serializers.ModelSerializer): class Meta: model = Cuenta fields = ['id', 'grupo_id', 'estatus', 'monto', 'saldo']
python
<reponame>33kk/uso-archive<filename>data/uso-styles/90947.json { "id": 90947, "name": "Digg Reader Persian_BRN style; V 1.0", "description": "دیگ‌ریدر با نسخ عربی دروید و تاهوما، نمایش راست به چپ متن", "user": { "id": 193616, "name": "MMB", "email": "redacted", "paypal_email": null, "homepage": null, "about": null, "license": "publicdomain" }, "updated": "2013-07-24T08:31:18.000Z", "weekly_install_count": 0, "total_install_count": 137, "rating": null, "after_screenshot_name": "https://userstyles.org/auto_style_screenshots/90947-after.png?r=1589184326", "obsoleting_style_id": null, "obsoleting_style_name": null, "obsolete": 0, "admin_delete_reason_id": null, "obsoletion_message": null, "screenshots": null, "license": null, "created": "2013-07-24T01:24:59.000Z", "category": "site", "raw_subcategory": "digg", "subcategory": "digg", "additional_info": null, "style_tags": [], "css": "@-moz-document domain(\"digg.com\") {\r\n\r\n\r\nDIV {font-family:tahoma!important; direction:rtl!important; text-align:justify!important}\r\nDIV.dr-label {direction:ltr!important}\r\nSPAN.dr-label-txt {font-family:Tahoma; text-align:Right; Font-size:13px; direction:rtl!important}\r\na {font-family:droid arabic naskh; text-align:right; direction:rtl!important;}\r\nDIV.story-detail-content{direction:rtl!important}\r\nSPAN.feeditem-headline {font-family:droid arabic naskh}\r\nSPAN.feeditem-description,SPAN.story-data, SPAN.story-meta-item, DIV.detail-body {font-family:Tahoma; direction:rtl!important; text-align:right}\r\n\r\n}\r\n", "discussions": [ { "id": 36774, "name": "<NAME>", "rating": 2, "created": "2013-08-02T05:20:39.000Z", "author_name": "Ayati", "author_id": 199470 } ], "discussionsCount": 1, "commentsCount": 2, "userjs_url": "/styles/userjs/90947/digg-reader-persian-brn-style-v-1-0.user.js", "style_settings": [] }
json
import traceback try: from .Polygonize_action import PolygonizePluginAction PolygonizePluginAction().register() except Exception as e: print(traceback.format_exc())
python
<reponame>olistic/simplechain { "name": "simplechain", "version": "0.0.0", "description": "Learn how a simple blockchain works in this interactive demo", "author": "<NAME> <<EMAIL>>", "license": "MIT", "repository": "https://github.com/olistic/simplechain.git", "keywords": [ "blockchain", "cryptocurrency", "bitcoin", "learn", "simple", "demo" ], "scripts": { "start": "node lib/cli.js", "test": "jest" }, "private": true, "devDependencies": { "eslint": "^4.19.1", "eslint-config-airbnb-base": "^12.1.0", "eslint-config-prettier": "^2.9.0", "eslint-plugin-import": "^2.9.0", "eslint-plugin-prettier": "^2.6.0", "jest": "^22.4.3", "prettier": "^1.11.1" }, "dependencies": { "chalk": "^2.3.2", "ora": "^2.0.0", "yargs": "^11.0.0" } }
json
<reponame>DirkFi/BigDL import argparse import os import FileOperator, KeyManager def generate_primary_key(ip, port): KeyManager.generate_primary_key_ciphertext(ip, port) def generate_data_key(ip, port, encrypted_primary_key_path): KeyManager.generate_data_key_ciphertext(ip, port, encrypted_primary_key_path) def encrypt_file_without_key(data_file_path, ip, port): KeyManager.generate_primary_key_ciphertext(ip, port) KeyManager.generate_data_key_ciphertext(ip, port, './encrypted_primary_key') FileOperator.encrypt_data_file(ip, port, data_file_path, './encrypted_primary_key', './encrypted_data_key') def encrypt_file_with_key(data_file_path, ip, port, encrypted_primary_key_path, encrypted_data_key_path): FileOperator.encrypt_data_file(ip, port, data_file_path, encrypted_primary_key_path, encrypted_data_key_path) def decrypt_file(data_file_path, ip, port, encrypted_primary_key_path, encrypted_data_key_path): FileOperator.decrypt_data_file(ip, port, data_file_path, encrypted_primary_key_path, encrypted_data_key_path) def encrypt_directory_with_key(dir_path, ip, port,encrypted_primary_key_path, encrypted_data_key_path, save_dir=None): FileOperator.encrypt_directory_automation(ip, port, dir_path, encrypted_primary_key_path, encrypted_data_key_path,save_dir) def encrypt_directory_without_key(dir_path, ip, port, save_dir=None): KeyManager.generate_primary_key_ciphertext(ip, port) KeyManager.generate_data_key_ciphertext(ip, port, './encrypted_primary_key') FileOperator.encrypt_directory_automation(ip, port, dir_path, './encrypted_primary_key', './encrypted_data_key',save_dir) def get_data_key_plaintext(ip, port, encrypted_primary_key_path, encrypted_data_key_path): data_key_plaintext = KeyManager.retrieve_data_key_plaintext(ip, port, encrypted_primary_key_path, encrypted_data_key_path) print(data_key_plaintext) return data_key_plaintext def decrypt_csv_columns(ip, port, encrypted_primary_key_path, encrypted_data_key_path, input_dir): FileOperator.decrypt_csv_columns_automation(ip, port, encrypted_primary_key_path, encrypted_data_key_path, input_dir) if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument('-api', '--api', type=str, help='name of the API to use', required=True) parser.add_argument('-ip', '--ip', type=str, help='ip address of the ehsm_kms_server', required=True) parser.add_argument('-port', '--port', type=str, help='port of the ehsm_kms_server',default='3000', required=False) parser.add_argument('-pkp', '--pkp', type=str, help='path of the primary key storage file', required=False) parser.add_argument('-dkp', '--dkp', type=str, help='path of the data key storage file', required=False) parser.add_argument('-dfp', '--dfp', type=str, help='path of the data file to encrypt', required=False) parser.add_argument('-dir', '--dir', type=str, help='path of the directory containing column-encrypted CSVs or the directory to be encrypted', required=False) parser.add_argument('-sdp', '--sdp', type=str, help='path of the save directory output to',required=False) args = parser.parse_args() api = args.api ip = args.ip port = args.port if os.getenv('APPID') is None: print("Please set appid to environment variable APPID") exit(1) if os.getenv('APIKEY') is None: print("Please set apikey to environment variable APIKEY") exit(1) if api == 'encrypt_file_without_key': data_file_path = args.dfp encrypt_file_without_key(data_file_path, ip, port) elif api == 'generate_primary_key': generate_primary_key(ip, port) elif api == 'generate_data_key': encrypted_primary_key_path = args.pkp generate_data_key(ip, port, encrypted_primary_key_path) elif api == 'encrypt_file_with_key': data_file_path = args.dfp encrypted_primary_key_path = args.pkp encrypted_data_key_path = args.dkp encrypt_file_with_key(data_file_path, ip, port, encrypted_primary_key_path, encrypted_data_key_path) elif api == 'decrypt_file': data_file_path = args.dfp encrypted_primary_key_path = args.pkp encrypted_data_key_path = args.dkp decrypt_file(data_file_path, ip, port, encrypted_primary_key_path, encrypted_data_key_path) elif api == 'encrypt_directory_without_key': dir_path = args.dir save_path = args.sdp encrypt_directory_without_key(dir_path, ip, port, save_path) elif api == 'encrypt_directory_with_key': dir_path = args.dir encrypted_primary_key_path = args.pkp encrypted_data_key_path = args.dkp save_path = args.sdp encrypt_directory_with_key(dir_path, ip, port, encrypted_primary_key_path, encrypted_data_key_path,save_path) elif api == 'get_data_key_plaintext': encrypted_primary_key_path = args.pkp encrypted_data_key_path = args.dkp get_data_key_plaintext(ip, port, encrypted_primary_key_path, encrypted_data_key_path) elif api == 'decrypt_csv_columns': encrypted_primary_key_path = args.pkp encrypted_data_key_path = args.dkp input_dir = args.dir decrypt_csv_columns(ip, port, encrypted_primary_key_path, encrypted_data_key_path, input_dir)
python
England [UK], January 8 (ANI): Optimistic thinking has long been immortalized in self-help books as the way to pleasure, good health, and longevity, but it may also lead to bad decision-making, with major consequences for people’s financial well-being. Research from the University of Bath shows that excessive optimism is actually associated with lower cognitive skills such as verbal fluency, fluid reasoning, numerical reasoning, and memory. Whereas those high on cognitive ability tend to be both more realistic and pessimistic in their expectations about the future. “Forecasting the future with accuracy is difficult and for that reason we night expect those with low cognitive ability to make more errors in judgments, both pessimistic and optimistic. But the results are clear: low cognitive ability leads to more self-flattering biases — people essentially deluding themselves to a degree.” said Dr Chris Dawson of the University’s School of Management. “This points to the idea that whilst humans may be primed by evolution to expect the best, those high on cognitive ability are more able to override this automatic response when it comes to important decisions. Plans based on overly optimistic beliefs make for poor decisions and are bound to deliver worse outcomes than would realistic beliefs,” Dr Dawson added. Decisions on major financial issues such as employment, investments or savings, and any choice involving risk and uncertainty, were particularly prone to this effect and posed serious implications for individuals. “Unrealistically optimistic financial expectations can lead to excessive levels of consumption and debt, as well as insufficient savings. It can also lead to excessive business entries and subsequent failures. The chances of starting a successful business are tiny, but optimists always think they have a shot and will start businesses destined to fail,” Dr Dawson said. The study — “Looking on the (B)right Side of Life: Cognitive Ability and Miscalibrated Financial Expectations” — took data from a UK survey of over 36,000 households and looked at people’s expectations of their financial wellbeing and compared them with their actual financial outcomes. “The problem with our being programmed to think positively is that it can adversely affect our quality of decision making, particularly when we have to make serious decisions. We need to be able to over-ride that and this research shows that people with high cognitive ability manage this better than those with low cognitive ability,” he said. “Unrealistic optimism is one of the most pervasive human traits and research has shown people consistently underestimate the negative and accentuate the positive. The concept of ‘positive thinking’ is almost unquestioningly embedded in our culture — and it would be healthy to revisit that belief,” Dr Dawson added. (ANI) The post Excessive optimism linked with lower cognitive abilities: Study appeared first on CliQ INDIA.
english
{"react-autocomplete.js":"sha256-BogYGLv42F8hAWV4ScT/XtMEYkuErEqbLoh8H7xXu20=","react-autocomplete.min.js":"<KEY>}
json
#!/usr/bin/env python from __future__ import absolute_import, division, print_function import os import sys import subprocess import argparse from functools import reduce from itertools import chain from pyHIPIFY import hipify_python parser = argparse.ArgumentParser(description='Top-level script for HIPifying, filling in most common parameters') parser.add_argument( '--project-directory', type=str, default=os.path.normpath(os.path.join( os.path.realpath(__file__), os.pardir, os.pardir, os.pardir, )), help="The root of the project. (default: %(default)s)", required=False) parser.add_argument( '--output-directory', type=str, default='', help="The Directory to Store the Hipified Project", required=False) parser.add_argument( '--list-files-only', action='store_true', help="Only print the list of hipify files.") parser.add_argument( '--root-dir', type=str, default="gloo", help="The root directory of gloo project", required=False) args = parser.parse_args() amd_build_dir = os.path.dirname(os.path.realpath(__file__)) proj_dir = os.path.join(os.path.dirname(os.path.dirname(amd_build_dir))) if args.project_directory: proj_dir = args.project_directory out_dir = proj_dir if args.output_directory: out_dir = args.output_directory includes = [ os.path.join(args.root_dir, "*cuda*"), ] ignores = [ ] hipify_python.hipify( project_directory=proj_dir, output_directory=out_dir, includes=includes, ignores=ignores, list_files_only=args.list_files_only, show_progress=False)
python
On Wednesday, April 20, the Maine Center for Disease Control and Prevention (CDC) confirmed that a Waldo County resident passed away from Powassan virus infection. The victim, who was revealed to be an adult, reportedly died at the hospital with neurologic symptoms. As per the CDC, the victim is likely to have been infected in Maine. CDC Maine’s director Nirav D. Shah said: The CDC’s press release stated that around 25 people get infected with the virus each year since 2015. Maine has recorded 14 such cases since 2010. What is known about the Powassan virus? Here's how the Maine CDC described the Powassan virus: The virus was first recorded in Canada in 1958. It was named after the town of Powassan, where it was first recorded. The virus later popped up in many regions across the world, including the Russian territories and other parts of Eurasia. As per data pooled from medically accurate sources, the Powassan virus is caused by infected tick bites. The CDC claims the virus can originate from the bites of the groundhog tick (Ixodes cookei), the deer tick (Ixodes scapularis), and the squirrel tick (Ixodes marxi). According to the CDC, many virus-infected individuals will not even have any symptoms. However, others can show symptoms within a week or month. The department stated: More extreme symptoms of the virus may include coordination loss, slurred speech, confusion, and seizures. The Powassan virus can cause serious diseases like infection of the brain (encephalitis) or membranes around the brain and spinal cord (meningitis). Since there is no treatment or vaccination for the virus yet, the CDC revealed that one out of 10 people might not survive the infection if their condition is severe.
english
A couple of months ago, MSK Prasad, India’s outgoing chief national selector, had specified that the five-member national selection panel will look beyond Mahendra Singh Dhoni. The idea was simple; to back young Rishabh Pant as much as possible. Even though he added a footnote that the selectors did have a word with Dhoni, it was not clear what they discussed. It, however, was evident that only some consistent performances could open the door for the World Cup-winning captain again. However, with Dhoni staying away from any form of cricket for the last six months, there is still no clarity on whether the 38-year-old will at all return to the international fold? And on Thursday, as the Board of Control for Cricket in India (BCCI) left him out of its central contract list, some of the top Board officials indicated that they had to take the tough call as Dhoni was out of competitive cricket for six months and there was no communication from his end in terms of his future. “The national selectors only put up the proposal for the central contract list and as far as MSD was concerned, there was no clarity on whether he would like to continue or not,” one of the officials, in the know of things, said. However, reports claimed that Dhoni was informed about the decision before finalising the list. Dhoni was in the A list last year, which fetched him Rs 5 crore a year. But this time around, he has not been part of the Indian team since the World Cup in June-July, last year. "These are the contracts for this cycle, awarded on the basis of performance from the last cycle. Dhoni was out of the circuit after the World Cup," the official clarified. Since the World Cup, he has missed the tour of the West Indies and the home series against South Africa, Bangladesh, the West Indies and the ongoing series against Australia. While he is expected to appear for the Chennai Super Kings in the IPL, he has so far not even featured in any domestic tournaments. One of the superstars of Indian cricket, Dhoni has led the country to two World Cup titles -- World Cup in 2011 and World T20 in 2007 -- and the Champions Trophy in 2013. In a promotional event in Mumbai a month ago, Dhoni had casually stated that he will talk about his future only after January. However, as of now, he seems to have kept the selectors and the team management guessing.
english
package ca.mcgill.sis.dmas.kam1n0.framework.storage; import java.util.Iterator; public class BinaryMultiParts implements Iterable<Binary> { private Iterable<Binary> parts; private int size; public BinaryMultiParts(Iterable<Binary> parts, int size) { this.parts = parts; this.size = size; } public int getSize() { return this.size; } @Override public Iterator<Binary> iterator() { return this.parts.iterator(); } }
java
package io.github.moosbusch.permagon.configuration.builder.converter.impl; import io.github.moosbusch.permagon.configuration.builder.converter.spi.AbstractJavaFXFromStringConverter; import javafx.geometry.NodeOrientation; public class JavaFXNodeOrientationConverter extends AbstractJavaFXFromStringConverter<NodeOrientation> { @Override public NodeOrientation getDefaultValue() { return NodeOrientation.INHERIT; } @Override public Class<NodeOrientation> getTargetType() { return NodeOrientation.class; } @Override public NodeOrientation valueFromString(String constraint) { return NodeOrientation.valueOf(constraint); } }
java
// Place your settings in this file to overwrite default and user settings. { "[csharp]": { "editor.tabSize": 4 }, "editor.tabSize": 2, "editor.insertSpaces": true, "editor.detectIndentation": false, "editor.rulers": [80], "search.exclude": { "**/node_modules": true, "**/bower_components": true, "**/bin": true, "**/obj": true, "**/publish/**": true, "**/Debug": true }, "typescript.surveys.enabled": false, "cSpell.words": ["api", "i", "kubernetes", "wrapper"], "java.configuration.updateBuildConfiguration": "interactive", "eslint.workingDirectories": [ { "directory": "./src/studio/src/designer/frontend", "changeProcessCWD": true }, { "directory": "./src/Altinn.Apps/AppFrontend/react", "changeProcessCWD": true } ], "editor.codeActionsOnSave": { "source.fixAll": true } }
json
Hansika Motwani and Sohael Khaturiya's dreamy wedding has left fans in awe. Images and videos from the ceremony have been going viral on social media for nearly a week now. Adding to this list is a new picture featuring Hansika Motwani's post wedding ritual. In the image, Hansika is scooping some halwa from a bowl into a plate. The caption on the post read, “Pehli Rasoi,” with a heart and amulet emoji. Hansika Motwani married businessman Sohael Khaturiya earlier this month in Jaipur. He had proposed to the actress in front of the Eiffel Tower in Paris last month. See the post here: Hansika Motwani and Sohael Khaturiya returned to Mumbai from Jaipur, Rajasthan, on Sunday. In the images shared by a fan page, Hansika and Sohael can be seen exiting the airport gate holding hands. Hansika Motwani, is dressed in a pink kurta set with sindoor, mangalsutra and red and white bangles. See the images here: Hansika Motwani shared dreamy pictures from her wedding on social media, much to the delight of her fans. In the images, the actress is dressed in a red lehenga. Sohael, meanwhile, is seen in embroidered sherwani. Sharing the photos, Hansika wrote: "Now and forever 4. 12. 2022. " Soon after she shared the post, her friends and colleagues flooded the comment section with congratulatory messages. Mandira Bedi said, "Congratulations to both of you. " Sriya Reddy commented, "most magical wedding ever ! #nowandforever. " Esha Gupta wrote, "Congratulations," followed by heart emoticons. Sohael Kathuria, who is a Mumbai-based entrepreneur proposed to Hansika Motwani in front of the Eiffel Tower in Paris last month. The actress shared pictures from the romantic moment on Instagram and wrote: "Now and forever. " Hansika Motwani is known for her work in Hrithik Roshan's Koi. . . Mil Gaya, Aap Kaa Surroor, Desamuduru, Kandireega,Maska, Kantri,Aranmanai, Villain, Singam II (Suriya's version), Denikaina Ready and Uyire Uyire, to name a few.
english
{ "attributes": { "grsu": true }, "courseCode": "EE6004", "courseCredit": "4", "description": "This module caters for the needs of research students working in the field of Microwave & RF circuit and system analysis and design, and electromagnetics. The student will gain an understanding of the following topics: the foundation theory of dyadic Green's functions, followed by detailed formulation and computer implementation with real-world case studies of any two of the following computational methods - Moment and Boundary Element, Finite Element, Finite Difference, Transmission Line and Fast method for Large Systems.", "faculty": "Engineering", "prereqTree": { "or": [ "EE5302", "EE5308" ] }, "title": "Selected Advanced Topics In EM Modelling" }
json
303 Written Answers Crisis in Air Conditioner and Refrigerator Manufacturing Units 4984, PROF, RAMKRISHNA MORE: Will the Minister of FINANCE be pleased ts state : (a) whether it is a fact that small scale units manufacturing air conditioners and refrigerators are on the verge of closure because of discrimination in the matter of excise duty exemption limit; and (b) if so, the steps Government propos: to take to help these small units who are facing acute crisis ? THE MINISTER OF STATE THE MINISTRY OF FINANCE (SHRI JANARDHANA POOJARY) : (a) and (b). Different exemption schemes have been prescribed for the small scale sector in different areas of industrial production taking into account various factors, such as, the applicable rate of excise duty, the quantam of exemption available for the unit, position of the organised sector, etc. The scheme of excise duty relief applicable to small seale units manufacturing refrigerating and air-conditioning appliances and parts thereof cannot be regarded as disc 1minatory in nature. There are no reports of closure of small scale units manufacturing refrigerators and airconditioners as a result of the present scheme of excise duty concession to the small scale units There is no proposal at present to revise the existing scheme, Proposal to set up Coir Fxport Promotion Council 4985. SHRI T, BASHEER : Will the Minister of SUPPLY AND TEXTILES be pleased to state : (a) whether there is any proposal te set up Coir Export Promotion Council; (b) if so, the details thereof; and (c) if not, the reasons therefor? THE MINISTER OF STATE OF THE MINISTRY OF SUPPLY AND TEXTILES (SHRI CHANDRA SHEKHAR SINGH): (a) No Sir, St. correcting reply to USQ 304 693 dt. 26.7.85 (b) Does not arise. (c) Under the Coir Industry Act 1953,` the Coir Board has inter-alia been entrusted with export promotion functions for coir items, Declaration of Hyderabad as a Free Port 4986. SHRI V. TULSIRAM: Will the Minister of COMMERCL be pleased to state : (a) total number of free airports in the country; (b) whether Hyderabad airport is also. a.free port; (c) if not, whether there is any proposal under the consideration of the Government to declare Hyderabad as a free port; and (d) if so, when ? THE MINISTER OF STATE IN THE MINISTRY OF COMMERCE (SHRI P. A. SANGMA): (a) There are no such airports in the country. Statement correcting Answer ro Unstarred Question No. 693 dated 26-7-1985 Re: Allotment of Quotas and Licences for Garments transferred to Apparel Export Promotion Council THE MINISTER OF STATE OF THE MINISTRY OF SUPPLY AND TEXTILES (SHRI CHANDRA SHEKHAR SINGH): A typographical error in the figure indicated in reply to part (f) of the Question [Annexure 'A' placed in Library. See No. LT 1438/85]. has been noticed. The correct reply to the Lok Sabha Un. starred Question No. 693 is as given at Annexure 'B', 305 St, correcting reply BHADRA 1, 1907 (SAKA) USQ 693 dt. 26.7.85 306 Allotment of Quotas and Licences for Garments Transferred to Apparel Export Promotion Council 693. SHRI G. BANATWALLA: Will the Minister of SUPPLY AND TEXTILES be pleased to state : (a) whether the work relating to allotment of quotas and licences for garments have been transferred from the office of the Chief Controller of Imports and Exports to the Apparel Export Promotion Council, New Delhi; If so, since when; (c) the reasons for the aforesaid transfer of the work and power; (d) whether Government appreciates the inadvisable nature of such transfer to a private agencymand if so, whether the power will be reassumed by the Chief Controller; (e) whether the said Apparel Export Promotion Council (AEPC) also levies fines and penalties on garment exporters; (f) if so, the amount so collected since the power has been delegated to the AEPC; and (g) whether the amount collected belongs to Government of the AEPC ? . THE MINISTER OF STATE OF THE MINISTRY OF SUPPLY AND TEXTILES (SHRI CHANDRA SHEKHAR SINGH): (a) No, Sir. This work has been with ABPC since the inception of AEPC. (e) No, Sir. The forfeiture of EMDs/ BGs by AEPC in terms of blic Notices issued by the Government is not a penalty but merely in the nature of action taken for non-performance of contractual obligation on part of exporters. (f) According to available information, as on 31-12-1984 AEPC had collected a sum of Rs. 3,12,22,513/- on account of forfeiture of EMDs/BGs. (g) The amount is to be kept separately by AEPC to be spent on export promotion after obtaining Government's approval. PROF. MADHU DANDAVATE (Rajapur): I want to raise very serious matter. Please listen to our submission because that is the submission of the M Ps. On 21st of this month, 17 MPs went to attend the funeral of late Longowal. MR, SPEAKER: My information is different. PROF. MADHU DANDAVATE : You have misunderstood it. The press had commented on that. They say that the funeral was conspicuous by the absence of MPs because of the discrimination shown by the Government and the ruling party on us, we could not be present. MR. SPEAKER : I do not think there was anything like that, the information, PROF. MADHU DANDAVATE : Let the hon, Minister make a statement. We were half an-hour late. Members of the ruling party were allowed to reach the funeral in time and only (Interruptions) ......on technical grounds. MR. SPEAKER : I must make it clear because I was myself there. PROF. MADHU DANDAVATE : You are not a member of the Congress party. We are referring to the Congress party. 307 St. correcting reply AUGUST 23, 1985 MR, SPEAKER: I am not talking C about them either. I am only talking of what I saw there. The press has asked me about it. The fact is that myself on behalf of the Prime Minister and the the President, Mr. Arun Nehru and Defence Minister....... AN HON, MEMBER: What about Mrs. Bajpai ? MR. SPEAKER : Mrs. Bajpai went there of her own, by the daily service and she reached there. She did not travel with us. Only we three were there. SHRI INDRAJIT GUPTA (Basirhat): What about Shri Moopanar ? MR. SPEAKER Shri Moopanar might have gone somewhere else. I do not know. PROF. MADHU DANDAVATE : He went to the funeral, MR, SPEAKER: I saw them there and I met them there-Mrs. Bajpai and the others. While coming back, I saw members going including Opposition leaders. I got this information that the IAC provided the aircraft for all these members. That is why, I felt that I must clarify the matter. I told the press that they are coming. That is what I told them because somebody from the Opposition came to me and said "We re going," Mr. Amal Datta came and said "We are going there." We have been provided this service and we went there. PROF. MADHU DANDAVATE : My point is, way should there be discrimination ? MR. SPEAKER : There is no discrimination. PROF MADHU DANDAVATE : Not about you, The members of the ruling party were provided aircraft to reach there in time, and the members of the Opposition could not reach in time, MR. SPEAKER : I saw; nobody else was present. PROF. MADHU DANDAVATE : We have nothing against you, We only say that the hon Minister should make a statement against the discrimination. MR, SPEAKER: I say nobody was there. PROF. MADHU DANDAVATE : There was discrimination in the arrangements made. PROF. K.K. TEWARY (Buxar) : It is very unfortunate that the precious time of the House is being taken away on non-issues. The hon. Minister of Home Affairs is here. Yesterday you promised to speak to the hon, Minister of Home Affairs. MR. SPEAKER : I have already spoken to him. PROF. K.K. TEWARY: After the heinous murder of Shri Longowal Amritsar Golden Temple has been taken over by extremists and sweets have been distributed and murders have been applauded by Baba Jogendra Singh The hon, Minister of Home Affairs yesterday made a revelation to the House that Pakistani Government has been imparting training to these extremists and they have been unleashed into Punjab, I wonder why the Government of India has not lodged a formal protest to the Pakistani Government for training the extremists. As this has been established, what steps Government of India is taking in rounding up the criminals ? MR. SPEAKFR: This is a new situation. The hon Minister of Home Affairs is also here. He will take care of it and let you know. (Interruptions) PROF. K K. TEWARY: It is a very important matter, Elections have been announced, These criminals will make further trouble. MR, SPEAKER I will ask the hon, Minister to look into the matter. 309 Papers Laid BHADRA 1, 1907 (SAKA) PROF. K.K. TEWARY: Why don't of Home you ask the hon. Minister Affairs? MR, SPEAKER I have already told him, I have already done it, PROF. K.K, TEWARY: Why have they not been arrested ? MR. SPEAKER: I have already told him. PAPERS LAID ON THE TABLE Annual Reports and Reviews on the working of the Engineering Export Promotion Council, Calcutta, for 1982-83 and 1983-84 and stataments for delay in laying these papers THE MINISTER OF FINANCE AND COMMERCE (SHRI VISHWANATH PRATAP SINGH) : Sir, I beg to lay on the Table: (1) (i) A copy of the Annual Report (Hindi and English versions) of the Engineering Export Promotion Council, Calcutta, for the year 1982-83 along with Audited Accounts. (ii) A copy of the Review (Hindi and English versions) by the Government on the working of the Engineering Export Promotion Council, Calcutta, for the year 1982-83. (2) A statement (Hindi and English versions) showing reasons for delay in laying the papers mentioned (1) above. of the (¹) (1) A copy Annual Report (Hindi and English Papers Laild 310 versions) of the Engineering Export Promotion Council, Calcutta, for the year 1983-84 along with Audited Accounts, (ii) A copy of the Review Hindi and English versions) by the Government on the working of the Engineering Export Promotion Council, Calcutta, for the year 1983-84. (4) A statement (Hindi and Englisb versions) showing reasons for delay in laying the papers mentioned at (3) above, [Placed in Library, See No. LT1381/85]. Notification under Dowry Prohibition (Amendment) Act, 1984 and Dowry Prohibition (Maintenance of List's of Presents to the Bride and Bridegroom) Rules, 1985 THE MINISTER OF STATE IN THE MINISTRY OF LAW AND JUSTICE (SHRI H.R. BHARADWAJ): Sir, I beg to lay on the Table :(1) A copy of the Notification No. S.O. 610(E) (Hindi and English versions) published in Gazette of India dated the 19th August, 1985 appointing the 2nd day of October, 1985 as the date on which the Dowry Prohibition (Amendment) Act, 1984, shall come into force, issued under section 1 of the said Act, [Placed in Library. See No. LT1382/85] (2) A copy of the Dowry Prohibition, (Maintenance of Lists of Presents to the Bride and Bridegroom) Rules, 1985 published in Notification No. G.S.R. 664(E) in Gazette of India dated the 19th August, 1985 under sub-section (3) of section 9 of the Dowry Prohibition Act, 1961., [Placed in Library. See No. LT. 1383/85]
english
# Copyright (c) 2016-2020 <NAME> # Licensed under the zlib/libpng License # https://opensource.org/licenses/Zlib # xusb: Generic USB test program # Copyright © 2009-2012 <NAME> <<EMAIL>> # Contributions to Mass Storage by <NAME>. # # This library 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. # # This library 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 this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA import sys import os import ctypes as ct import libusb as usb #include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <string.h> #include <stdarg.h> #if defined(_WIN32) #define msleep(msecs) Sleep(msecs) #else #include <time.h> #define msleep(msecs) nanosleep(&(struct timespec){msecs / 1000, (msecs * 1000000) % 1000000000UL}, NULL); #endif #if defined(_MSC_VER) #define snprintf _snprintf #endif # Future versions of libusb will use usb_interface instead of interface # in usb.config_descriptor => catter for that #define usb_interface interface # Global variables binary_dump = False # bool binary_name = None # str|None extra_info = False # bool force_device_request = False # bool # For WCID descriptor queries def perr(fmt, *args): print(fmt.format(*args), file=sys.stderr, end="") def err_exit(errcode): perr(" {}\n", usb.strerror(usb.error(errcode))) return -1 B = lambda x: 1 if x != 0 else 0 be_to_int32 = lambda buf: (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3] RETRY_MAX = 5 REQUEST_SENSE_LENGTH = 0x12 INQUIRY_LENGTH = 0x24 READ_CAPACITY_LENGTH = 0x08 # HID Class-Specific Requests values. # See section 7.2 of the HID specifications HID_GET_REPORT = 0x01 HID_GET_IDLE = 0x02 HID_GET_PROTOCOL = 0x03 HID_SET_REPORT = 0x09 HID_SET_IDLE = 0x0A HID_SET_PROTOCOL = 0x0B HID_REPORT_TYPE_INPUT = 0x01 HID_REPORT_TYPE_OUTPUT = 0x02 HID_REPORT_TYPE_FEATURE = 0x03 # Mass Storage Requests values. # See section 3 of the Bulk-Only Mass Storage Class specifications BOMS_RESET = 0xFF BOMS_GET_MAX_LUN = 0xFE # Microsoft OS Descriptor MS_OS_DESC_STRING_INDEX = 0xEE MS_OS_DESC_STRING_LENGTH = 0x12 MS_OS_DESC_VENDOR_CODE_OFFSET = 0x10 #static const ms_os_desc_string = (ct.c_uint8 * 16)( MS_OS_DESC_STRING_LENGTH, usb.LIBUSB_DT_STRING, ord(b'M'), 0, ord(b'S'), 0, ord(b'F'), 0, ord(b'T'), 0, ord(b'1'), 0, ord(b'0'), 0, ord(b'0'), 0, ) # Section 5.1: Command Block Wrapper (CBW) class command_block_wrapper(ct.Structure): _fields_ = [ ("dCBWSignature", (ct.c_uint8 * 4)), ("dCBWTag", ct.c_uint32), ("dCBWDataTransferLength", ct.c_uint32), ("bmCBWFlags", ct.c_uint8), ("bCBWLUN", ct.c_uint8), ("bCBWCBLength", ct.c_uint8), ("CBWCB", (ct.c_uint8 * 16)), ] # Section 5.2: Command Status Wrapper (CSW) class command_status_wrapper(ct.Structure): _fields_ = [ ("dCSWSignature", (ct.c_uint8 * 4)), ("dCSWTag", ct.c_uint32), ("dCSWDataResidue", ct.c_uint32), ("bCSWStatus", ct.c_uint8), ] #static const cdb_length = (ct.c_uint8 * 256)( # 0 1 2 3 4 5 6 7 8 9 A B C D E F 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, # 0 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, # 1 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, # 2 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, # 3 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, # 4 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, # 5 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 6 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 7 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, # 8 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, # 9 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, # A 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, # B 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # C 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # D 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # E 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # F ) cdb_length[255] = 0 test_type = ct.c_int ( USE_GENERIC, USE_PS3, USE_XBOX, USE_SCSI, USE_HID ) = (0, 1, 2, 3, 4) test_mode = USE_GENERIC VID = 0 # ct.c_uint16 PID = 0 # ct.c_uint16 #static #@annotate(buffer=unsigned char*, size=unsigned int) def display_buffer_hex(buffer, size): for i in range(0, size, 16): print("\n {:08x} ".format(i), end="") for j in range(16): if i + j < size: print("{:02x}".format(buffer[i + j]), end="") else: print(" ", end="") print(" ", end="") print(" ", end="") for j in range(16): if i + j < size: if buffer[i + j] < 32 or buffer[i + j] > 126: print(".", end="") else: print("%c", buffer[i + j], end="") print() #static #@annotate(str|None, uuid=const ct.POINTER(ct.c_uint8)) def uuid_to_string(uuid): if uuid == NULL: return None return ("{{{:02x}{:02x}{:02x}{:02x}-{:02x}{:02x}-{:02x}{:02x}" "-{:02x}{:02x}-{:02x}{:02x}{:02x}{:02x}{:02x}{:02x}}}".format( uuid[0], uuid[1], uuid[2], uuid[3], uuid[4], uuid[5], uuid[6], uuid[7], uuid[8], uuid[9], uuid[10], uuid[11], uuid[12], uuid[13], uuid[14], uuid[15])) #static #@annotate(int, handle=ct.POINTER(usb.device_handle)) def display_ps3_status(handle): # The PS3 Controller is really a HID device that got its HID Report Descriptors # removed by Sony input_report = (ct.c_uint8 * 49)() master_bt_address = (ct.c_uint8 * 8)() device_bt_address = (ct.c_uint8 * 18)() # Get the controller's bluetooth address of its master device r = usb.control_transfer(handle, usb.LIBUSB_ENDPOINT_IN | usb.LIBUSB_REQUEST_TYPE_CLASS | usb.LIBUSB_RECIPIENT_INTERFACE, HID_GET_REPORT, 0x03f5, 0, master_bt_address, ct.sizeof(master_bt_address), 100) if r < 0: return err_exit(r) print("\nMaster's bluetooth address: " "{:02X}:{:02X}:{:02X}:{:02X}:{:02X}:{:02X}".format( master_bt_address[2], master_bt_address[3], master_bt_address[4], master_bt_address[5], master_bt_address[6], master_bt_address[7])) # Get the controller's bluetooth address r = usb.control_transfer(handle, usb.LIBUSB_ENDPOINT_IN | usb.LIBUSB_REQUEST_TYPE_CLASS | usb.LIBUSB_RECIPIENT_INTERFACE, HID_GET_REPORT, 0x03f2, 0, device_bt_address, ct.sizeof(device_bt_address), 100) if r < 0: return err_exit(r) print("\nMaster's bluetooth address: " "{:02X}:{:02X}:{:02X}:{:02X}:{:02X}:{:02X}".format( device_bt_address[4], device_bt_address[5], device_bt_address[6], device_bt_address[7], device_bt_address[8], device_bt_address[9])) # Get the status of the controller's buttons via its HID report print("\nReading PS3 Input Report...") r = usb.control_transfer(handle, usb.LIBUSB_ENDPOINT_IN | usb.LIBUSB_REQUEST_TYPE_CLASS | usb.LIBUSB_RECIPIENT_INTERFACE, HID_GET_REPORT, (HID_REPORT_TYPE_INPUT << 8) | 0x01, 0, input_report, ct.sizeof(input_report), 1000) if r < 0: return err_exit(r) pressed = input_report[2] # Direction pad plus start, select, and joystick buttons if pressed == 0x01: print("\tSELECT pressed") elif pressed == 0x02: print("\tLEFT 3 pressed") elif pressed == 0x04: print("\tRIGHT 3 pressed") elif pressed == 0x08: print("\tSTART presed") elif pressed == 0x10: print("\tUP pressed") elif pressed == 0x20: print("\tRIGHT pressed") elif pressed == 0x40: print("\tDOWN pressed") elif pressed == 0x80: print("\tLEFT pressed") pressed = input_report[3] # Shapes plus top right and left buttons if pressed == 0x01: print("\tLEFT 2 pressed") elif pressed == 0x02: print("\tRIGHT 2 pressed") elif pressed == 0x04: print("\tLEFT 1 pressed") elif pressed == 0x08: print("\tRIGHT 1 presed") elif pressed == 0x10: print("\tTRIANGLE pressed") elif pressed == 0x20: print("\tCIRCLE pressed") elif pressed == 0x40: print("\tCROSS pressed") elif pressed == 0x80: print("\tSQUARE pressed") print("\tPS button: {}".format(input_report[4])) print("\tLeft Analog (X,Y): ({},{})".format(input_report[6], input_report[7])) print("\tRight Analog (X,Y): ({},{})".format(input_report[8], input_report[9])) print("\tL2 Value: {}\tR2 Value: {}".format(input_report[18], input_report[19])) print("\tL1 Value: {}\tR1 Value: {}".format(input_report[20], input_report[21])) print("\tRoll (x axis): {} Yaw (y axis): {} Pitch (z axis) {}".format( #(((input_report[42] + 128) % 256) - 128), int8_t(input_report[42]), int8_t(input_report[44]), int8_t(input_report[46]))) print("\tAcceleration: {}".format(int8_t(input_report[48]))) print() return 0 #static #@annotate(int, handle=ct.POINTER(usb.device_handle)) def display_xbox_status(handle): # The XBOX Controller is really a HID device that got its HID Report Descriptors # removed by Microsoft. # Input/Output reports described at http://euc.jp/periphs/xbox-controller.ja.html input_report = (20 * ct.c_uint8)() print("\nReading XBox Input Report...") r = usb.control_transfer(handle, usb.LIBUSB_ENDPOINT_IN | usb.LIBUSB_REQUEST_TYPE_CLASS | usb.LIBUSB_RECIPIENT_INTERFACE, HID_GET_REPORT, (HID_REPORT_TYPE_INPUT << 8) | 0x00, 0, input_report, 20, 1000) if r < 0: return err_exit(r) print(" D-pad: {:02X}".format(input_report[2] & 0x0F)) print(" Start:{}, Back:{}, " "Left Stick Press:{}, Right Stick Press:{}".format( B(input_report[2] & 0x10), B(input_report[2] & 0x20), B(input_report[2] & 0x40), B(input_report[2] & 0x80))) # A, B, X, Y, Black, White are pressure sensitive print(" A:{}, B:{}, X:{}, Y:{}, White:{}, Black:{}".format( input_report[4], input_report[5], input_report[6], input_report[7], input_report[9], input_report[8])) print(" Left Trigger: {}, Right Trigger: {}".format( input_report[10], input_report[11])) print(" Left Analog (X,Y): ({},{})".format( int16_t((input_report[13] << 8) | input_report[12]), int16_t((input_report[15] << 8) | input_report[14]))) print(" Right Analog (X,Y): ({},{})".format( int16_t((input_report[17] << 8) | input_report[16]), int16_t((input_report[19] << 8) | input_report[18]))) return 0 #static #@annotate(int, handle=ct.POINTER(usb.device_handle), left=ct.c_uint8, right=ct.c_uint8) def set_xbox_actuators(handle, left, right): print("\nWriting XBox Controller Output Report...") output_report = (6 * ct.c_uint8)() output_report[1] = ct.sizeof(output_report) output_report[3] = left output_report[5] = right r = usb.control_transfer(handle, usb.LIBUSB_ENDPOINT_OUT | usb.LIBUSB_REQUEST_TYPE_CLASS | usb.LIBUSB_RECIPIENT_INTERFACE, HID_SET_REPORT, (HID_REPORT_TYPE_OUTPUT << 8) | 0x00, 0, output_report, 6, 1000) if r < 0: return err_exit(r) return 0 _tag = 1 # ct.c_uint32 #static #@annotate(int, handle=ct.POINTER(usb.device_handle), endpoint=int) # ct.c_uint8 lun, ct.c_uint8* cdb, ct.c_uint8 direction, int data_length, # ct.c_uint32* ret_tag): def send_mass_storage_command(handle, endpoint, lun, cdb, direction, data_length, ret_tag): global _tag #int i, r; cbw = command_block_wrapper() if not cdb: return -1 if endpoint & usb.LIBUSB_ENDPOINT_IN: perr("send_mass_storage_command: cannot send command on IN endpoint\n") return -1 #ct.c_uint8 cdb_len; cdb_len = cdb_length[cdb[0]] if cdb_len == 0 or cdb_len > ct.sizeof(cbw.CBWCB): perr("send_mass_storage_command: don't know how to handle this command ({:02X}, length {})\n", cdb[0], cdb_len) return -1 cbw.dCBWSignature[0] = 'U' cbw.dCBWSignature[1] = 'S' cbw.dCBWSignature[2] = 'B' cbw.dCBWSignature[3] = 'C' ret_tag[0] = _tag cbw.dCBWTag = _tag cbw.dCBWDataTransferLength = data_length cbw.bmCBWFlags = direction cbw.bCBWLUN = lun _tag += 1 # Subclass is 1 or 6 => cdb_len cbw.bCBWCBLength = cdb_len memcpy(cbw.CBWCB, cdb, cdb_len); i = 0 while True: # The transfer length must always be exactly 31 bytes. size = ct.c_int() r = usb.bulk_transfer(handle, endpoint, ct.cast(ct.pointer(cbw), ct.POINTER(ct.c_ubyte)), 31, ct.byref(size), 1000) if r == usb.LIBUSB_ERROR_PIPE: usb.clear_halt(handle, endpoint) i += 1 if r != usb.LIBUSB_ERROR_PIPE or i >= RETRY_MAX: break if r != usb.LIBUSB_SUCCESS: perr(" send_mass_storage_command: {}\n", usb.strerror(usb.error(r))) return -1 print(" sent {} CDB bytes".format(cdb_len)) return 0 #static #@annotate(int, handle=ct.POINTER(usb.device_handle), endpoint=int, ct.c_uint32 expected_tag) def get_mass_storage_status(handle, endpoint, expected_tag): #int r; csw = command_status_wrapper() # The device is allowed to STALL this transfer. If it does, you have to # clear the stall and try again. i = 0; while True: size = ct.c_int() r = usb.bulk_transfer(handle, endpoint, ct.cast(ct.pointer(csw), ct.POINTER(ct.c_ubyte)), 13, ct.byref(size), 1000) if r == usb.LIBUSB_ERROR_PIPE: usb.clear_halt(handle, endpoint) i += 1 if r != usb.LIBUSB_ERROR_PIPE or i >= RETRY_MAX: break if r != usb.LIBUSB_SUCCESS: perr(" get_mass_storage_status: {}\n", usb.strerror(usb.error(r))) return -1 size = size.value if size != 13: perr(" get_mass_storage_status: received {} bytes (expected 13)\n", size) return -1 if csw.dCSWTag != expected_tag: perr(" get_mass_storage_status: mismatched tags (expected {:08X}, received {:08X})\n", expected_tag, csw.dCSWTag) return -1 # For this test, we ignore the dCSWSignature check for validity... print(" Mass Storage Status: {:02X} ({})".format( csw.bCSWStatus, "FAILED" if csw.bCSWStatus else "Success")) if csw.dCSWTag != expected_tag: return -1 if csw.bCSWStatus: # REQUEST SENSE is appropriate only if bCSWStatus is 1, meaning that the # command failed somehow. Larger values (2 in particular) mean that # the command couldn't be understood. if csw.bCSWStatus == 1: return -2 # request Get Sense else: return -1 # In theory we also should check dCSWDataResidue. But lots of devices # set it wrongly. return 0 #static #@annotate(handle=ct.POINTER(usb.device_handle), endpoint_in=int, endpoint_out=int) def get_sense(handle, endpoint_in, endpoint_out): # Request Sense print("Request Sense:") sense = (ct.c_uint8 * 18)() cdb = (ct.c_uint8 * 16)() # SCSI Command Descriptor Block cdb[0] = 0x03 # Request Sense cdb[4] = REQUEST_SENSE_LENGTH expected_tag = ct.c_uint32() send_mass_storage_command(handle, endpoint_out, 0, cdb, usb.LIBUSB_ENDPOINT_IN, REQUEST_SENSE_LENGTH, ct.pointer(expected_tag)) size = ct.c_int() rc = usb.bulk_transfer(handle, endpoint_in, ct.cast(ct.pointer(sense), ct.POINTER(ct.c_ubyte)), REQUEST_SENSE_LENGTH, ct.byref(size), 1000) if rc < 0: print("usb.bulk_transfer failed: {}".format(usb.error_name(rc))) return size = size.value print(" received {} bytes".format(size)) if sense[0] != 0x70 and sense[0] != 0x71: perr(" ERROR No sense data\n") else: perr(" ERROR Sense: {:02X} {:02X} {:02X}\n", sense[2] & 0x0F, sense[12], sense[13]) # Strictly speaking, the get_mass_storage_status() call should come # before these perr() lines. If the status is nonzero then we must # assume there's no data in the buffer. For xusb it doesn't matter. get_mass_storage_status(handle, endpoint_in, expected_tag) #static #@annotate(int, handle=ct.POINTER(usb.device_handle), endpoint_in=int, endpoint_out=int) def test_mass_storage(handle, endpoint_in, endpoint_out): # Mass Storage device to test bulk transfers (non destructive test) global binary_dump global binary_name #int r; #ct.c_uint32 i print("Reading Max LUN:") lun = ct.c_uint8() r = usb.control_transfer(handle, usb.LIBUSB_ENDPOINT_IN | usb.LIBUSB_REQUEST_TYPE_CLASS | usb.LIBUSB_RECIPIENT_INTERFACE, BOMS_GET_MAX_LUN, 0, 0, ct.byref(lun), 1, 1000) lun = lun.value # Some devices send a STALL instead of the actual value. # In such cases we should set lun to 0. if r == 0: lun = 0 elif r < 0: perr(" Failed: {}".format(usb.strerror(usb.error(r)))) print(" Max LUN = {}".format(lun)) # Send Inquiry print("Sending Inquiry:") buffer = (ct.c_uint8 * 64)() cdb = (ct.c_uint8 * 16)() # SCSI Command Descriptor Block cdb[0] = 0x12 # Inquiry cdb[4] = INQUIRY_LENGTH expected_tag = ct.c_uint32() send_mass_storage_command(handle, endpoint_out, lun, cdb, usb.LIBUSB_ENDPOINT_IN, INQUIRY_LENGTH, ct.pointer(expected_tag)) size = ct.c_int() r = usb.bulk_transfer(handle, endpoint_in, ct.cast(ct.pointer(buffer), ct.POINTER(ct.c_ubyte)), INQUIRY_LENGTH, ct.byref(size), 1000) if r < 0: return err_exit(r) size = size.value print(" received {} bytes".format(size)) # The following strings are not zero terminated vid = (ct.c_char * 9)() pid = (ct.c_char * 9)() rev = (ct.c_char * 5)() for i in range(8): vid[i] = buffer[8 + i] pid[i] = buffer[16 + i] rev[i / 2] = buffer[32 + i / 2] # instead of another loop vid[8] = 0 pid[8] = 0 rev[4] = 0 print(" VID:PID:REV \"%8s\":\"%8s\":\"%4s\"".format(vid, pid, rev)) if get_mass_storage_status(handle, endpoint_in, expected_tag) == -2: get_sense(handle, endpoint_in, endpoint_out) # Read capacity print("Reading Capacity:") buffer = (ct.c_uint8 * 64)() cdb = (ct.c_uint8 * 16)() # SCSI Command Descriptor Block cdb[0] = 0x25 # Read Capacity expected_tag = ct.c_uint32() send_mass_storage_command(handle, endpoint_out, lun, cdb, usb.LIBUSB_ENDPOINT_IN, READ_CAPACITY_LENGTH, ct.pointer(expected_tag)) size = ct.c_int() r = usb.bulk_transfer(handle, endpoint_in, ct.cast(ct.pointer(buffer), ct.POINTER(ct.c_ubyte)), READ_CAPACITY_LENGTH, ct.byref(size), 1000) if r < 0: return err_exit(r) size = size.value print(" received {} bytes".format(size)) max_lba = be_to_int32(buffer[0:]) block_size = be_to_int32(buffer[4:]) device_size = (max_lba + 1.0) * block_size / (1024 * 1024 * 1024) print(" Max LBA: {:08X}, Block Size: {:08X} (%.2f GB)".format( max_lba, block_size, device_size)) if get_mass_storage_status(handle, endpoint_in, expected_tag) == -2: get_sense(handle, endpoint_in, endpoint_out) # coverity[tainted_data] try: data = ct.cast(calloc(1, block_size), ct.POINTER(ct.c_ubyte)) # unsigned char* except: perr(" unable to allocate data buffer\n") return -1 # Send Read print("Attempting to read %u bytes:".format(block_size)) cdb = (ct.c_uint8 * 16)() # SCSI Command Descriptor Block cdb[0] = 0x28 # Read(10) cdb[8] = 0x01 # 1 block expected_tag = ct.c_uint32() send_mass_storage_command(handle, endpoint_out, lun, cdb, usb.LIBUSB_ENDPOINT_IN, block_size, ct.pointer(expected_tag)) size = ct.c_int() usb.bulk_transfer(handle, endpoint_in, data, block_size, ct.byref(size), 5000) size = size.value print(" READ: received {} bytes".format(size)) if get_mass_storage_status(handle, endpoint_in, expected_tag) == -2: get_sense(handle, endpoint_in, endpoint_out) else: display_buffer_hex(data, size) if binary_dump: try: fd = open(binary_name, "w") except: pass else: with fd: if fd.fwrite(data, ct.c_size_t(size).value) != ct.c_uint(size).value: perr(" unable to write binary data\n") free(data) return 0 # HID #static #@annotate(int, ct.c_uint8* hid_report_descriptor, int size, int type) def get_hid_record_size(hid_report_descriptor, size, type): record_size = [0, 0, 0] # [int, ...] nb_bits = 0 # int nb_items = 0 # int found_record_marker = False j = 0 i = hid_report_descriptor[0] + 1 while i < size: offset = (hid_report_descriptor[i] & 0x03) + 1 # ct.c_uint8 if offset == 4: offset = 5 kind_of = hid_report_descriptor[i] & 0xFC if kind_of == 0x74: # bitsize nb_bits = hid_report_descriptor[i + 1] elif kind_of == 0x94: # count nb_items = 0 for j in range(1, offset): nb_items = ct.c_uint32(hid_report_descriptor[i + j]).value << (8 * (j - 1)) i = offset # ??? elif kind_of == 0x80: # input found_record_marker = True j = 0 elif kind_of == 0x90: # output found_record_marker = True j = 1 elif kind_of == 0xb0: # feature found_record_marker = True j = 2 elif kind_of == 0xC0: # end of collection nb_items = 0 nb_bits = 0 else: i += offset continue if found_record_marker: found_record_marker = False record_size[j] += nb_items * nb_bits i += offset if type < HID_REPORT_TYPE_INPUT or type > HID_REPORT_TYPE_FEATURE: return 0 else: return (record_size[type - HID_REPORT_TYPE_INPUT] + 7) / 8 #static #@annotate(int, handle=ct.POINTER(usb.device_handle), endpoint_in=int) def test_hid(handle, endpoint_in): global binary_dump global binary_name #int r; hid_report_descriptor = (ct.c_uint8 * 256)() report_buffer = ct.POINTER(ct.c_uint8) print("\nReading HID Report Descriptors:") descriptor_size = usb.control_transfer(handle, usb.LIBUSB_ENDPOINT_IN | usb.LIBUSB_REQUEST_TYPE_STANDARD | usb.LIBUSB_RECIPIENT_INTERFACE, usb.LIBUSB_REQUEST_GET_DESCRIPTOR, usb.LIBUSB_DT_REPORT << 8, 0, hid_report_descriptor, ct.sizeof(hid_report_descriptor), 1000) if descriptor_size < 0: print(" Failed") return -1 display_buffer_hex(hid_report_descriptor, descriptor_size) if binary_dump: try: fd = open(binary_name, "w") except: pass else: with fd: if fd.fwrite(hid_report_descriptor, descriptor_size) != descriptor_size: print(" Error writing descriptor to file") size = get_hid_record_size(hid_report_descriptor, descriptor_size, HID_REPORT_TYPE_FEATURE) if size <= 0: print("\nSkipping Feature Report readout (None detected)") else: report_buffer = ct.cast(calloc(size, 1), ct.POINTER(ct.c_uint8)) if not report_buffer: return -1 print("\nReading Feature Report (length {})...".format(size)) r = usb.control_transfer(handle, usb.LIBUSB_ENDPOINT_IN | usb.LIBUSB_REQUEST_TYPE_CLASS | usb.LIBUSB_RECIPIENT_INTERFACE, HID_GET_REPORT, (HID_REPORT_TYPE_FEATURE << 8) | 0, 0, report_buffer, ct.c_uint16(size), 5000) if r >= 0: display_buffer_hex(report_buffer, size) else: if r == usb.LIBUSB_ERROR_NOT_FOUND: print(" No Feature Report available for this device") elif r == usb.LIBUSB_ERROR_PIPE: print(" Detected stall - resetting pipe...") usb.clear_halt(handle, 0) else: print(" Error: {}".format(usb.strerror(usb.error(r)))) free(report_buffer) size = get_hid_record_size(hid_report_descriptor, descriptor_size, HID_REPORT_TYPE_INPUT) if size <= 0: print("\nSkipping Input Report readout (None detected)") else: report_buffer = ct.cast(calloc(size, 1), ct.POINTER(ct.c_uint8)) if not report_buffer: return -1 print("\nReading Input Report (length {})...".format(size)) r = usb.control_transfer(handle, usb.LIBUSB_ENDPOINT_IN | usb.LIBUSB_REQUEST_TYPE_CLASS | usb.LIBUSB_RECIPIENT_INTERFACE, HID_GET_REPORT, (HID_REPORT_TYPE_INPUT << 8) | 0x00, 0, report_buffer, ct.c_uint16(size), 5000) if r >= 0: display_buffer_hex(report_buffer, size) else: if r == usb.LIBUSB_ERROR_TIMEOUT: print(" Timeout! Please make sure you act on the device within the 5 seconds allocated...") elif r == usb.LIBUSB_ERROR_PIPE: print(" Detected stall - resetting pipe...") usb.clear_halt(handle, 0) else: print(" Error: {}".format(usb.strerror(usb.error(r)))) # Attempt a bulk read from endpoint 0 (this should just return a raw input report) print("\nTesting interrupt read using endpoint {:02X}...".format(endpoint_in)) r = usb.interrupt_transfer(handle, endpoint_in, report_buffer, size, ct.byref(size), 5000) if r >= 0: display_buffer_hex(report_buffer, size) else: print(" {}".format(usb.strerror(usb.error(r)))) free(report_buffer) return 0 #static #@annotate(handle=ct.POINTER(usb.device_handle), ct.c_uint8 bRequest, int iface_number) def read_ms_winsub_feature_descriptors(handle, bRequest, iface_number): # Read the MS WinUSB Feature Descriptors, that are used on Windows 8 for automated driver installation MAX_OS_FD_LENGTH = 256 #int r; os_desc = (ct.c_uint8 * MAX_OS_FD_LENGTH)() class struct_os_fd(ct.Structure): _fields_ = [ ("desc", ct.c_char_p), ("recipient", ct.c_uint8), ("index", ct.c_uint16), ("header_size", ct.c_uint16), ] os_fd = [ struct_os_fd(b"Extended Compat ID", usb.LIBUSB_RECIPIENT_DEVICE, 0x0004, 0x10), struct_os_fd(b"Extended Properties", usb.LIBUSB_RECIPIENT_INTERFACE, 0x0005, 0x0A), ] if iface_number < 0: return # WinUSB has a limitation that forces wIndex to the interface number when issuing # an Interface Request. To work around that, we can force a Device Request for # the Extended Properties, assuming the device answers both equally. if force_device_request: os_fd[1].recipient = usb.LIBUSB_RECIPIENT_DEVICE for i in range(2): print("\nReading {} OS Feature Descriptor (wIndex = 0x%04d):".format( os_fd[i].desc, os_fd[i].index)) # Read the header part r = usb.control_transfer(handle, ct.c_uint8(usb.LIBUSB_ENDPOINT_IN | usb.LIBUSB_REQUEST_TYPE_VENDOR | os_fd[i].recipient), bRequest, ct.c_uint16((iface_number << 8) | 0x00), os_fd[i].index, os_desc, os_fd[i].header_size, 1000) if r < os_fd[i].header_size: perr(" Failed: {}", usb.strerror(usb.error(r)) if r < 0 else "header size is too small") return le_type_punning_IS_fine = ct.cast(os_desc, ct.c_void_p) length = ct.cast(le_type_punning_IS_fine, ct.POINTER(ct.c_uint32))[0].value # ct.c_uint32 length = min(length, MAX_OS_FD_LENGTH) # Read the full feature descriptor r = usb.control_transfer(handle, ct.c_uint8(usb.LIBUSB_ENDPOINT_IN | usb.LIBUSB_REQUEST_TYPE_VENDOR | os_fd[i].recipient), bRequest, ct.c_uint16((iface_number << 8) | 0x00), os_fd[i].index, os_desc, ct.c_uint16(length), 1000) if r < 0: perr(" Failed: {}", usb.strerror(usb.error(r))) return else: display_buffer_hex(os_desc, r) #@annotate(dev_cap=ct.POINTER(usb.bos_dev_capability_descriptor)) def print_device_cap(dev_cap): if dev_cap[0].bDevCapabilityType == usb.LIBUSB_BT_USB_2_0_EXTENSION: usb_2_0_ext = ct.POINTER(usb.usb_2_0_extension_descriptor)() usb.get_usb_2_0_extension_descriptor(None, dev_cap, ct.byref(usb_2_0_ext)) if usb_2_0_ext: print(" USB 2.0 extension:") print(" attributes : {:02X}".format(usb_2_0_ext[0].bmAttributes)) usb.free_usb_2_0_extension_descriptor(usb_2_0_ext) elif dev_cap[0].bDevCapabilityType == usb.LIBUSB_BT_SS_USB_DEVICE_CAPABILITY: ss_usb_device_cap = ct.POINTER(usb.ss_usb_device_capability_descriptor)() usb.get_ss_usb_device_capability_descriptor(None, dev_cap, ct.byref(ss_usb_device_cap)) if ss_usb_device_cap: print(" USB 3.0 capabilities:") print(" attributes : {:02X}".format(ss_usb_device_cap[0].bmAttributes)) print(" supported speeds : {:04X}".format(ss_usb_device_cap[0].wSpeedSupported)) print(" supported functionality: {:02X}".format(ss_usb_device_cap[0].bFunctionalitySupport)) usb.free_ss_usb_device_capability_descriptor(ss_usb_device_cap) elif dev_cap[0].bDevCapabilityType == usb.LIBUSB_BT_CONTAINER_ID: container_id = ct.POINTER(usb.container_id_descriptor)() usb.get_container_id_descriptor(None, dev_cap, ct.byref(container_id)) if container_id: print(" Container ID:\n {}".format(uuid_to_string(container_id[0].ContainerID))) usb.free_container_id_descriptor(container_id) else: print(" Unknown BOS device capability {:02x}:".format(dev_cap[0].bDevCapabilityType)) #static #@annotate(int, ct.c_uint16 vid, ct.c_uint16 pid) def test_device(vid, pid): #int r; speed_name = [ "Unknown", "1.5 Mbit/s (USB LowSpeed)", "12 Mbit/s (USB FullSpeed)", "480 Mbit/s (USB HighSpeed)", "5000 Mbit/s (USB SuperSpeed)", "10000 Mbit/s (USB SuperSpeedPlus)", ] print("Opening device {:04X}:{:04X}...".format(vid, pid)) #handle = ct.POINTER(usb.device_handle)() handle = usb.open_device_with_vid_pid(None, vid, pid) if not handle: perr(" Failed.\n") return -1 endpoint_in = 0 # default IN endpoint endpoint_out = 0 # default OUT endpoint try: dev = usb.get_device(handle) # usb.device* bus = usb.get_bus_number(dev) # ct.c_uint8 if extra_info: port_path = (ct.c_uint8 * 8)() r = usb.get_port_numbers(dev, port_path, ct.sizeof(port_path)) if r > 0: print("\nDevice properties:") print(" bus number: {}".format(bus)) print(" port path: {}".format(port_path[0]), end="") for i in range(1, r): print("->{}".format(port_path[i]), end="") print(" (from root hub)") r = usb.get_device_speed(dev) if r < 0 or r > 5: r = 0 print(" speed: {}".format(speed_name[r])) print("\nReading device descriptor:") dev_desc = usb.device_descriptor() r = usb.get_device_descriptor(dev, ct.byref(dev_desc)) if r < 0: return err_exit(r) print(" length: {}".format(dev_desc.bLength)) print(" device class: {}".format(dev_desc.bDeviceClass)) print(" S/N: {}".format(dev_desc.iSerialNumber)) print(" VID:PID: {:04X}:{:04X}".format(dev_desc.idVendor, dev_desc.idProduct)) print(" bcdDevice: {:04X}".format(dev_desc.bcdDevice)) print(" iMan:iProd:iSer: {}:{}:{}".format( dev_desc.iManufacturer, dev_desc.iProduct, dev_desc.iSerialNumber)) print(" nb confs: {}".format(dev_desc.bNumConfigurations)) # Copy the string descriptors for easier parsing string_index = (ct.c_uint8 * 3)() # indexes of the string descriptors string_index[0] = dev_desc.iManufacturer string_index[1] = dev_desc.iProduct string_index[2] = dev_desc.iSerialNumber print("\nReading BOS descriptor: ", end="") bos_desc = usb.bos_descriptor*() if usb.get_bos_descriptor(handle, ct.byref(bos_desc)) == usb.LIBUSB_SUCCESS: print("{} caps".format(bos_desc[0].bNumDeviceCaps)) for i in range(bos_desc[0].bNumDeviceCaps): print_device_cap(bos_desc[0].dev_capability[i]) usb.free_bos_descriptor(bos_desc) else: print("no descriptor") print("\nReading first configuration descriptor:") conf_desc = usb.config_descriptor*() r = usb.get_config_descriptor(dev, 0, ct.byref(conf_desc)) if r < 0: return err_exit(r) nb_ifaces = conf_desc[0].bNumInterfaces # int print(" nb interfaces: {}".format(nb_ifaces)) first_iface = (conf_desc[0].usb_interface[0].altsetting[0].bInterfaceNumber if nb_ifaces > 0 else -1) for i in range(nb_ifaces): usb_interface = conf_desc[0].usb_interface[i] print(" interface[{}]: id = {}".format( i, usb_interface.altsetting[0].bInterfaceNumber)) for j in range(usb_interface.num_altsetting): altsetting = usb_interface.altsetting[j] print("interface[{}].altsetting[{}]: num endpoints = {}".format( i, j, altsetting.bNumEndpoints)) print(" Class.SubClass.Protocol: {:02X}.{:02X}.{:02X}".format( altsetting.bInterfaceClass, altsetting.bInterfaceSubClass, altsetting.bInterfaceProtocol)) if (altsetting.bInterfaceClass == usb.LIBUSB_CLASS_MASS_STORAGE and (altsetting.bInterfaceSubClass == 0x01 or altsetting.bInterfaceSubClass == 0x06) and altsetting.bInterfaceProtocol == 0x50): # Mass storage devices that can use basic SCSI commands test_mode = USE_SCSI for k in range(altsetting.bNumEndpoints): endpoint = altsetting.endpoint[k] # const usb.endpoint_descriptor* print(" endpoint[{}].address: {:02X}".format( k, endpoint.bEndpointAddress)) # Use the first interrupt or bulk IN/OUT endpoints as default for testing if ((endpoint.bmAttributes & usb.LIBUSB_TRANSFER_TYPE_MASK) & (usb.LIBUSB_TRANSFER_TYPE_BULK | usb.LIBUSB_TRANSFER_TYPE_INTERRUPT)): if endpoint.bEndpointAddress & usb.LIBUSB_ENDPOINT_IN: if not endpoint_in: endpoint_in = endpoint.bEndpointAddress else: if not endpoint_out: endpoint_out = endpoint.bEndpointAddress print(" max packet size: {:04X}".format(endpoint.wMaxPacketSize)) print(" polling interval: {:02X}".format(endpoint.bInterval)) ep_comp = ct.POINTER(usb.ss_endpoint_companion_descriptor)() usb.get_ss_endpoint_companion_descriptor(None, ct.byref(altsetting.endpoint[k]), ct.byref(ep_comp)) if ep_comp: print(" max burst: {:02X} (USB 3.0)".format(ep_comp[0].bMaxBurst)) print(" bytes per interval: {:04X} (USB 3.0)".format(ep_comp[0].wBytesPerInterval)) usb.free_ss_endpoint_companion_descriptor(ep_comp) usb.free_config_descriptor(conf_desc) usb.set_auto_detach_kernel_driver(handle, 1) for iface in range(nb_ifaces): print("\nClaiming interface {}...".format(iface)) r = usb.claim_interface(handle, iface) if r != usb.LIBUSB_SUCCESS: perr(" Failed.\n") print("\nReading string descriptors:") string = (ct.c_char * 128)() for i in range(3): if string_index[i] == 0: continue if usb.get_string_descriptor_ascii(handle, string_index[i], ct.cast(string, ct.POINTER(ct.c_ubyte)), ct.sizeof(string)) > 0: print(" String ({:#04X}): \"{}\"".format(string_index[i], string)) # Read the OS String Descriptor r = usb.get_string_descriptor(handle, MS_OS_DESC_STRING_INDEX, 0, ct.cast(string, ct.POINTER(ct.c_ubyte)), MS_OS_DESC_STRING_LENGTH) if r == MS_OS_DESC_STRING_LENGTH and memcmp(ms_os_desc_string, string, sizeof(ms_os_desc_string)) == 0: # If this is a Microsoft OS String Descriptor, # attempt to read the WinUSB extended Feature Descriptors read_ms_winsub_feature_descriptors(handle, string[MS_OS_DESC_VENDOR_CODE_OFFSET], first_iface) if test_mode == USE_PS3: r = display_ps3_status(handle) if r < 0: return err_exit(r) elif test_mode == USE_XBOX: r = display_xbox_status(handle) if r < 0: return err_exit(r) r = set_xbox_actuators(handle, 128, 222) if r < 0: return err_exit(r) msleep(2000) r = set_xbox_actuators(handle, 0, 0) if r < 0: return err_exit(r) elif test_mode == USE_HID: test_hid(handle, endpoint_in) elif test_mode == USE_SCSI: r = test_mass_storage(handle, endpoint_in, endpoint_out) if r < 0: return err_exit(r) elif test_mode == USE_GENERIC: pass print() for iface in range(nb_ifaces): print("Releasing interface {}...".format(iface)) usb.release_interface(handle, iface) print("Closing device...") finally: usb.close(handle) return 0 def main(argv=sys.argv): global VID, PID global test_mode global binary_dump global binary_name show_help = False # bool debug_mode = False # bool error_lang = None # char* # Default to generic, expecting VID:PID VID = 0 PID = 0 test_mode = USE_GENERIC endian_test = ct.c_uint16(0xBE00) if ct.cast(ct.pointer(endian_test), ct.POINTER(ct.c_uint8))[0] == 0xBE: print("Despite their natural superiority for end users, big endian\n" "CPUs are not supported with this program, sorry.") return 0 #if len(argv) >= 2: for j in range(1, len(argv)): arglen = len(argv[j]) if argv[j][0] in ('-', '/') and arglen >= 2: opt = argv[j][1] if opt == 'd': debug_mode = True elif opt == 'i': extra_info = True elif opt == 'w': force_device_request = True elif opt == 'b': j += 1 if j >= len(argv) or argv[j][0] in ('-', '/'): print(" Option -b requires a file name") return 1 binary_name = argv[j] binary_dump = True elif opt == 'l': j += 1 if j >= len(argv) or argv[j][0] in ('-', '/'): print(" Option -l requires an ISO 639-1 language parameter") return 1 error_lang = argv[j] elif opt == 'j': # OLIMEX ARM-USB-TINY JTAG, 2 channel composite device - 2 interfaces if not VID and not PID: VID = 0x15BA PID = 0x0004 elif opt == 'k': # Generic 2 GB USB Key (SCSI Transparent/Bulk Only) - 1 interface if not VID and not PID: VID = 0x0204 PID = 0x6025 # The following tests will force VID:PID if already provided elif opt == 'p': # Sony PS3 Controller - 1 interface VID = 0x054C PID = 0x0268 test_mode = USE_PS3 elif opt == 's': # Microsoft Sidewinder Precision Pro Joystick - 1 HID interface VID = 0x045E PID = 0x0008 test_mode = USE_HID elif opt == 'x': # Microsoft XBox Controller Type S - 1 interface VID = 0x045E PID = 0x0289 test_mode = USE_XBOX else: show_help = True else: for i in range(arglen): if argv[j][i] == ':': tmp_vid = 0 # unsigned int tmp_pid = 0 # unsigned int if sscanf(argv[j], "%x:%x" , ct.pointer(tmp_vid), ct.pointer(tmp_pid)) != 2: print(" Please specify VID & PID as \"vid:pid\" in hexadecimal format") return 1 VID = ct.c_uint16(tmp_vid) PID = ct.c_uint16(tmp_pid) break else: show_help = True if show_help or len(argv) == 1 or len(argv) > 7: print("usage: {} [-h] [-d] [-i] [-k] [-b file] [-l lang] [-j] [-x] [-s] [-p] [-w] [vid:pid]".format(argv[0])) print(" -h : display usage") print(" -d : enable debug output") print(" -i : print topology and speed info") print(" -j : test composite FTDI based JTAG device") print(" -k : test Mass Storage device") print(" -b file : dump Mass Storage data to file 'file'") print(" -p : test Sony PS3 SixAxis controller") print(" -s : test Microsoft Sidewinder Precision Pro (HID)") print(" -x : test Microsoft XBox Controller Type S") print(" -l lang : language to report errors in (ISO 639-1)") print(" -w : force the use of device requests when querying WCID descriptors") print("If only the vid:pid is provided, xusb attempts to run the most appropriate test") return 0 # xusb is commonly used as a debug tool, so it's convenient to have debug output # during usb.init(), but since we can't call on usb.set_option() before usb.init(), # we use the env variable method old_dbg_str = os.environ.get("LIBUSB_DEBUG", None) if debug_mode: try: os.environ["LIBUSB_DEBUG"] = "4" # usb.LIBUSB_LOG_LEVEL_DEBUG except: print("Unable to set debug level") version = usb.get_version()[0] print("Using libusb v{}.{}.{}.{}\n".format( version.major, version.minor, version.micro, version.nano)) r = usb.init(None) if r < 0: return r try: # If not set externally, and no debug option was given, use info log level if old_dbg_str is None and not debug_mode: usb.set_option(None, usb.LIBUSB_OPTION_LOG_LEVEL, usb.LIBUSB_LOG_LEVEL_INFO) if error_lang is not None: r = usb.setlocale(error_lang) if r < 0: print("Invalid or unsupported locale '{}': {}".format( error_lang, usb.strerror(usb.error(r)))) test_device(VID, PID) finally: usb.exit(None) if debug_mode: #char string[256]; string = "LIBUSB_DEBUG={}".format("" if old_dbg_str is None else old_dbg_str) return 0 sys.exit(main())
python
from threading import Lock from PyQt5.Qt import QImage from PyQt5.Qt import QIcon from PyQt5.Qt import QStyle from PyQt5.Qt import Qt from PyQt5.Qt import QUrl from PyQt5.Qt import QBuffer from PyQt5.Qt import QByteArray from PyQt5.Qt import QIODevice from PyQt5.Qt import QDateTime from PyQt5.Qt import QPixmap from PyQt5.Qt import pyqtProperty from PyQt5.Qt import QApplication from PyQt5.QtWidgets import QWidget from .AutoSaver import AutoSaver from mc.common.globalvars import gVar from mc.common.models import IconsDbModel from mc.common.models import HistoryDbModel def encodeUrl(url): ''' @param: url QUrl ''' return url.toEncoded(QUrl.RemoveFragment | QUrl.StripTrailingSlash) # Need to be QWidget subclass, otherwise qproperty- setting won't work # but in Python could inherate form object directly class IconProvider(QWidget): _instance = None def __init__(self): super().__init__() self._emptyWebImage = QImage() self._bookmarkIcon = QIcon() self._iconBuffer = [] # QVector<[QUrl, QImage]> # TODO: cache limit size self._urlImageCache = {} # QCache<QByteArray, QImage> self._iconCacheMutex = Lock() # QMutex self._autoSaver = AutoSaver(self) # AutoSaver self._autoSaver.save.connect(self.saveIconsToDatabase) def saveIcon(self, view): ''' @param: view WebView ''' # Don't save icons in private mode if gVar.app.isPrivate(): return icon = view.icon(True) if icon.isNull(): return ignoredSchemes = [ 'app', 'ftp', 'file', 'view-source', 'data', 'about' ] if view.url().scheme() in ignoredSchemes: return for idx in range(len(self._iconBuffer)): if self._iconBuffer[idx][0] == view.url(): self._iconBuffer.pop(idx) break item = (view.url(), icon.pixmap(16).toImage()) self._autoSaver.changeOccurred() self._iconBuffer.append(item) def _bookmarkIcon(self): ''' @return: QIcon ''' return QIcon.fromTheme('bookmarks', self._bookmarkIcon) def setBookmarkIcon(self, icon): ''' @param: icon QIcon ''' self._bookmarkIcon = icon bookmarkIcon = pyqtProperty(QIcon, _bookmarkIcon, setBookmarkIcon) # QStyle equivalent @classmethod # noqa C901 def standardIcon(cls, icon): ''' @param: icon QStyle::StandardPixmap @return: QIcon ''' defIcon = QApplication.style().standardIcon(icon) if icon == QStyle.SP_MessageBoxCritical: return QIcon.fromTheme('dialog-error', defIcon) elif icon == QStyle.SP_MessageBoxInformation: return QIcon.fromTheme('dialog-information', defIcon) elif icon == QStyle.SP_MessageBoxQuestion: return QIcon.fromTheme('dialog-question', defIcon) elif icon == QStyle.SP_MessageBoxWarning: return QIcon.fromTheme('dialog-warning', defIcon) elif icon == QStyle.SP_DialogCloseButton: return QIcon.fromTheme('dialog-close', defIcon) elif icon == QStyle.SP_BrowserStop: return QIcon.fromTheme('progress-stop', defIcon) elif icon == QStyle.SP_BrowserReload: return QIcon.fromTheme('view-refresh', defIcon) elif icon == QStyle.SP_FileDialogToParent: return QIcon.fromTheme('go-up', defIcon) elif icon == QStyle.SP_ArrowUp: return QIcon.fromTheme('go-up', defIcon) elif icon == QStyle.SP_ArrowDown: return QIcon.fromTheme('go-down', defIcon) elif icon == QStyle.SP_ArrowForward: if QApplication.layoutDirection() == Qt.RightToLeft: return QIcon.fromTheme('go-previous', defIcon) else: return QIcon.fromTheme('go-next', defIcon) elif icon == QStyle.SP_ArrowBack: if QApplication.layoutDirection() == Qt.RightToLeft: return QIcon.fromTheme('go-next', defIcon) else: return QIcon.fromTheme('go-previous', defIcon) else: return defIcon @classmethod def newTabIcon(cls): ''' @return: QIcon ''' return QIcon.fromTheme('tab-new', QIcon(':/icons/menu/tab-new.svg')) @classmethod def newWindowIcon(cls): ''' @return: QIcon ''' return QIcon.fromTheme('window-new', QIcon(':/icons/menu/window-new.svg')) @classmethod def privateBrowsingIcon(cls): ''' @return: QIcon ''' return QIcon.fromTheme('view-private-symbolic', QIcon(':/icons/menu/privatebrowsing.png')) @classmethod def settingsIcon(cls): ''' @return: QIcon ''' return QIcon.fromTheme('configure', QIcon(':/icons/menu/settings.svg')) # Icon for empty page @classmethod def emptyWebIcon(cls): ''' @return: QIcon ''' return QIcon(QPixmap.fromImage(cls.emptyWebImage())) @classmethod def emptyWebImage(cls): ''' @return: QIcon ''' if cls.instance()._emptyWebImage.isNull(): cls.instance()._emptyWebImage = QIcon(':/icons/other/webpage.svg').pixmap(16).toImage() return cls.instance()._emptyWebImage # Icon for url (only available for urls in history) @classmethod def iconForUrl(cls, url, allowNull=False): ''' @param: url QUrl @return: QIcon ''' return cls.instance()._iconFromImage(cls.imageForUrl(url, allowNull)) @classmethod def imageForUrl(cls, url, allowNull=False): ''' @param: url QUrl @return: QImage ''' if not url.path(): return allowNull and QImage() or cls.emptyWebImage() with cls.instance()._iconCacheMutex: encUrl = encodeUrl(url) # find in urlImageCache img = cls.instance()._urlImageCache.get(encUrl, None) if img: if not img.isNull(): return img if not allowNull: return cls.emptyWebImage() return img # find from icon buffer for url0, img in cls.instance()._iconBuffer: if encodeUrl(url0) == encUrl: return img # TODO: is it necessary to use escapeSqlGlobString escapedUrl = gVar.appTools.escapeSqlGlobString(encUrl.data().decode()) urlPattern = '%s*' % escapedUrl icon = IconsDbModel.select().filter(IconsDbModel.url.contains(urlPattern)).first() img = QImage() if icon: img.loadFromData(icon.icon) cls.instance()._urlImageCache[encUrl] = img if not img.isNull(): return img if not allowNull: return cls.emptyWebImage() return img # Icon for domain (only available for urls in history) @classmethod def iconForDomain(cls, url, allowNull=False): ''' @param: url QUrl @return: QIcon ''' return cls.instance()._iconFromImage(cls.imageForDomain(url, allowNull)) @classmethod def imageForDomain(cls, url, allowNull=False): ''' @param: url QUrl @return: QIcon ''' if not url.host(): if allowNull: return QImage() return cls.emptyWebImage() with cls.instance()._iconCacheMutex: for url0, img in cls.instance()._iconBuffer: if url0.host() == url.host(): return img # TODO: is it necessary to use escapeSqlGlobString escapedHost = gVar.appTools.escapeSqlGlobString(url.host()) hostPattern = '*%s*' % escapedHost icon = IconsDbModel.select().filter(IconsDbModel.url.contains(hostPattern)).first() img = QImage() if icon: img.loadFromData(icon.icon) if not img.isNull(): return img if not allowNull: return cls.emptyWebImage() return img # public Q_SLOTS: def saveIconsToDatabase(self): gVar.executor.submit(self._saveIconsToDatabase) def _saveIconsToDatabase(self): with self._iconCacheMutex: for url, img in self._iconBuffer: ba = QByteArray() buff = QBuffer(ba) buff.open(QIODevice.WriteOnly) img.save(buff, 'PNG') # QByteArray encodedUrl = encodeUrl(url) self._urlImageCache.pop(encodedUrl, None) IconsDbModel.insert(icon=buff.data(), url=encodedUrl.data().decode()) \ .on_conflict('replace') \ .execute() self._iconBuffer.clear() def clearOldIconsInDatabase(self): # Delete icons for entries older than 6 months gVar.executor.submit(self._clearOldIconsInDatabase) def _clearOldIconsInDatabase(self): date = QDateTime.currentDateTime().addMonths(-6) urls = HistoryDbModel.select().where(HistoryDbModel.date < date.toMSecsSinceEpoch()) IconsDbModel.delete().where(IconsDbModel.url.in_(urls)).execute() # private: def _iconFromImage(self, image): ''' @param: image QImage @return: QIcon ''' return QIcon(QPixmap.fromImage(image)) @classmethod def instance(cls): if not cls._instance: cls._instance = cls() return cls._instance
python
- 6 hrs ago International Malala Day 2023: Who Is Malala Yousafzai? Where Is She Celebrating Her 26th Birthday? - News GST Council Meeting Highlights: What Will Be Cheaper, Costlier? - Travel Have you been to Vishveshwaraya Falls in Mandya yet? If not, this is the best time! She has lost so much of weight, that her 'assets' now hardly fill a bra. The singer-turned-fashion designer, who is the mother of three recently turned up in a revealing top with nothing to 'reveal'. The astonishing figure of the celebrity has sparked rumours about her strict diet. Victoria wants to shed even more weight, despite her flat-chested new appeal. She is going on a tough exercise regime with her friend, Eva Longoria Parker. She had her breast implants reduced last year. “Victoria thought having her boobs reduced would make the fashion world take her more seriously. But she is now so tiny she struggles to find bras that fit," says Victoria's friend. - healthMyths vs Facts: The Bigger You Are, The Less Healthy You Are; Is It True? - healthSigns You Are Eating Too Much Sugar; How Much Sugar Is Too Much? - nutritionAre Rice Cakes Healthy? Do They Help With Weight Loss? - disorders cureInternational No Diet Day 2020: What Are Eating Disorders? - diet fitnessHow To Gain Weight In A Healthy Way? - babyWhy Are Some Babies Born With Low Weight? GET THE BEST BOLDSKY STORIES!
english
Amidst the ongoing Enforcement Directorate (ED) raids in Telangana, a new chief has been appointed to the agnecy. The Joint Director of the agency, Dinesh Paruchuri has been transferred to Kochi while 2010 batch IRS officer Rohit Anand has replaced him. Dinesh took charge in August and has handled many sensitive cases in the state. Anand takes over as the joint director of ED Hyderabad unit at a time when investigations in crucial cases like PMLA, Foreign Exchange Management Act cases and other high-profile cases involving BRS leaders, ministers, MPs and MLAs are ongoing. This come as a surprise to many. It is believed that the transfer was done on the insistence of the ED director who wanted a non-Telugu in Hyderabad, reports said.
english
Manchester United legend Roy Keane was left flabbergasted with his former team's dismal display in a 7-0 Premier League loss against Liverpool on Sunday, 5 March. Cody Gakpo, Darwin Nunez, and Mohamed Salah all bagged braces while Roberto Firmino scored another at Anfield. The loss marked United's heaviest defeat in the league since 1931. It was an absolute demolition and Keane, former Red Devils' captain, reacted to the loss, saying (via Irish Examiner): "A very, very bad day. Shocking day, really. I always imagine if you ever got beaten in a game like this, six or seven-nil, you’d go into hiding. You would, you’d go into hiding. Whatever about a few days, I’d go missing for a few months. It really is that embarrassing. " Keane further described Manchester United's senior players as 'embarrassing' for their performances. "The senior players were, we can use all the words, embarrassing. They didn’t show any leadership skills, particularly for senior players. The goals against were shocking. A tough day for United. Thank God I’ve never been part of a team that’s been beaten by that much playing for Man United. The players no doubt will be embarrassed, they’ll be ashamed of the performance, to give up that many goals. " He further said: "When United come to Anfield, whatever about the form, everything goes out the window. It's the hardest place to go as a United player. When you go two goals down, you have to show some kind of fight, pride, sprit. They didn’t show any of that. Liverpool were back to their very, very best, but certainly an embarrassing day for United. " Despite their defeat, the Red Devils remain third in the Premier League table with 49 points from 25 matches. Liverpool. meanwhile, are fifth with 42 points on the board. After the loss against the Reds, Roy Keane said that he never thought that Manchester United are back at the top. He added that while other teams have let Erik ten Hag's side off the hook, Jurgen Klopp's team didn't. "I’ve never thought United were back to their very, very best. Teams have let them off the hook. Today, Liverpool didn’t let them off the hook. They punished them. The senior players are the ones that let the club down. What else is there to say? I'm in shock. " Manchester United will return to action on 9 March as they take on Real Betis in the round of 16 of the UEFA Europa League.
english