text
stringlengths
1
1.04M
language
stringclasses
25 values
<gh_stars>0 package com.larregle.mnistlearning.functions; import java.util.HashMap; import java.util.Map; public class Sigmoid implements ActivationFunction { private static final Sigmoid instance; private final Map<Double, Double> cache; static { instance = new Sigmoid(); } private Sigmoid() { cache = new HashMap<>(); } public static Sigmoid getInstance() { return instance; } /** * {@inheritDoc} * * Basic sigmoid function impl * @param z input value to the activation function * @return */ @Override public double activation(double z) { if (cache.get(z) == null) { cache.put(z, 1.0/(1.0 + Math.exp(z))); } return cache.get(z); } /** * {@inheritDoc} * * @param z * @return */ @Override public double derivative(double z) { return activation(z) * (1 - activation(z)); } }
java
<filename>latency/src/bin/t_sub_delay.rs // // Copyright (c) 2017, 2020 ADLINK Technology Inc. // // This program and the accompanying materials are made available under the // terms of the Eclipse Public License 2.0 which is available at // http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 // which is available at https://www.apache.org/licenses/LICENSE-2.0. // // SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 // // Contributors: // ADLINK zenoh team, <<EMAIL>> // use async_std::future; use async_std::sync::Arc; use clap::Parser; use std::any::Any; use std::str::FromStr; use std::time::{Duration, SystemTime, UNIX_EPOCH}; use zenoh::net::link::Link; use zenoh::net::protocol::io::reader::{HasReader, Reader}; use zenoh::net::protocol::io::SplitBuffer; use zenoh::net::protocol::proto::{Data, ZenohBody, ZenohMessage}; use zenoh::net::transport::*; use zenoh_core::Result as ZResult; use zenoh_protocol_core::{EndPoint, WhatAmI}; // Transport Handler for the peer struct MySH; impl MySH { fn new() -> Self { Self } } impl TransportEventHandler for MySH { fn new_unicast( &self, _peer: TransportPeer, _transport: TransportUnicast, ) -> ZResult<Arc<dyn TransportPeerEventHandler>> { Ok(Arc::new(MyMH::new())) } fn new_multicast( &self, _transport: TransportMulticast, ) -> ZResult<Arc<dyn TransportMulticastEventHandler>> { panic!(); } } // Message Handler for the peer struct MyMH; impl MyMH { fn new() -> Self { Self } } impl TransportPeerEventHandler for MyMH { fn handle_message(&self, message: ZenohMessage) -> ZResult<()> { match message.body { ZenohBody::Data(Data { payload, .. }) => { let mut count_bytes = [0u8; 8]; let mut now_bytes = [0u8; 16]; let mut data_reader = payload.reader(); if data_reader.read_exact(&mut count_bytes) && data_reader.read_exact(&mut now_bytes) { let count = u64::from_le_bytes(count_bytes); let now_pub = u128::from_le_bytes(now_bytes); let now_sub = SystemTime::now() .duration_since(UNIX_EPOCH) .unwrap() .as_nanos(); let interval = Duration::from_nanos((now_sub - now_pub) as u64); println!("{} bytes: seq={} time={:?}", payload.len(), count, interval); } else { panic!("Fail to fill the buffer"); } } _ => panic!("Invalid message"), } Ok(()) } fn new_link(&self, _link: Link) {} fn del_link(&self, _link: Link) {} fn closing(&self) {} fn closed(&self) {} fn as_any(&self) -> &dyn Any { self } } #[derive(Debug, Parser)] #[clap(name = "t_sub_delay")] struct Opt { /// endpoint, e.g. --endpoint tcp/127.0.0.1:7447 #[clap(short, long)] endpoint: String, /// peer or client or router #[clap(short, long)] mode: String, } #[async_std::main] async fn main() { // Enable logging env_logger::init(); // Parse the args let opt = Opt::parse(); let whatami = WhatAmI::from_str(opt.mode.as_str()).unwrap(); let manager = TransportManager::builder() .whatami(whatami) .build(Arc::new(MySH::new())) .unwrap(); // Connect to the peer or listen if whatami == WhatAmI::Peer { manager .add_listener(EndPoint::from_str(opt.endpoint.as_str()).unwrap()) .await .unwrap(); } else { let _session = manager .open_transport(EndPoint::from_str(opt.endpoint.as_str()).unwrap()) .await .unwrap(); } // Stop forever future::pending::<()>().await; }
rust
<gh_stars>1-10 { "brush-size": "Šepečio dydis", "by": "pagal", "change-brush-color": "Keisti teptuko spalvą", "clear": "Skaidrus", "clear-current": "Išvalyti dabartinį puslapį", "clear-page": "Aiškus puslapis", "clear-page-modal-body": "Ar tikrai norite ištrinti dabartinio puslapio elementus?", "close": "Uždaryti", "copy": "Kopijuoti", "delete-mode": "Ištrinti režimas", "disable-swiping": "Išjungti dviejų pirštų perbraukimo gestus keičiant skaidres", "disable-transmissions": "Spustelėkite , jei norite išjungti perdavimo veiksmus", "download": "Parsisiųsti skaidres", "download-instructor-annotations": "Atsisiųsti PDF su instruktoriaus pastabomis", "download-original": "Atsisiųsti originalų PDF failą", "drag-mode": "Vilkimo režimas", "drawing-mode": "Piešimo režimas", "enable-swiping": "Įgalinti dviejų pirštų perbraukimo gestus skaidrėms keisti", "enable-transmissions": "Spustelėkite , jei norite įjungti perdavimo veiksmus", "encountered-error": "Susidūrė su klaida", "export-pdf": "Eksportuoti mano anotacijas kaip PDF", "export-png": "Eksportuoti dabartinę skaidrę kaip PNG", "feedback-modal-title": "Studentų atsiliepimai {{id}} (skaidrių skaičius: {{noPages}})", "fill-entire-width": "Spustelėkite, jei norite puslapiu užpildyti visą eskizų juostos plotį", "fit-page": "Spustelėkite, kad puslapis tilptų į eskizų bloknotą", "font-size": "Šrifto dydis", "generate-pdf": "PDF formato generavimas...", "goto-first": "Pereiti į pirmąjį puslapį", "goto-last": "Pereiti į paskutinį puslapį", "goto-next": "Pereiti į kitą puslapį", "goto-previous": "Pereiti į ankstesnį puslapį", "group-mode": "Grupės režimas", "insert-page": "Įterpti puslapį po dabartinio puslapio", "jump-page": "Pereiti į puslapį", "last-updated": "paskutinį kartą atnaujinta", "load-pdf": "Įkelti PDF failą (išvalomas esamas drobės vaizdas)", "magnifying-glass": "Didinamasis stiklas", "open-slide-feedback": "Atviras skaidrių grįžtamasis ryšys", "page": "Puslapis", "pdf-uploaded": "Įkeltas PDF failas", "pointer-mode": "Rodiklio režimas", "redo": "Redo", "remote-control-by": "Nuotolinio valdymo pultelis...", "reset": "Iš naujo nustatyti", "reset-modal-body": "Ar tikrai norite iš naujo nustatyti numatytuosius eskizų sąsiuvinio turinio parametrus? Šis veiksmas yra negrįžtamas ir visi jūsų darbai bus prarasti, nebent juos išsaugotumėte.", "reset-pages": "Iš naujo nustatyti visus puslapius", "reset-sketchpad": "Iš naujo nustatyti eskizų bloknotą", "save-local": "Išsaugoti vietinėje naršyklėje", "save-server": "Išsaugoti serveryje", "saved": "Išsaugota", "saved-local": "Vietinėje naršyklėje išsaugotos pastabos", "saved-server": "Serveryje išsaugotos pastabos", "server-response": "Serverio atsakas", "show": "Rodyti", "show-all-annotations": "Rodyti visas anotacijas", "show-only-own-annotations": "Rodyti tik savo anotacijas", "start-tutorial": "Pradėkite eskizų sąsiuvinio pamoką", "stop-tutorial": "Sustabdyti eskizų sąsiuvinio pamoka", "text-mode": "Teksto režimas", "undo": "Panaikinti", "upload-email": "Gerbiami {{name}}, jūsų pastabos sėkmingai įkeltos ir dabar jas galima rasti adresu ", "upload-successful": "Failas buvo sėkmingai įkeltas ir jį galima pasiekti šiuo adresu", "upload-to-server": "Įkėlimas į serverį" }
json
{ "body": "I SHALL NOT, CONTRARY TO THE DESIGN OF THIS ESSAY, SET MYSELF TO INQUIRE PHILOSOPHICALLY INTO THE PECULIAR CONSTITUTION OF BODIES,", "next": "https://raw.githubusercontent.com/CAPSELOCKE/CAPSELOCKE/master/tweets/5067.json" }
json
<gh_stars>1-10 { "config": { "id": "36a3b0b5-bad0-4a04-b79b-441c7cef77db", "label": "BetterBibTeX JSON", "localeDateOrder": "ymd", "options": { "exportNotes": true }, "preferences": { "qualityReport": true, "autoAbbrevStyle": "http://www.zotero.org/styles/cell", "bibtexURL": "note", "citekeyFormat": "[authors][shortyear]", "skipFields": "file,abstract" } }, "items": [ { "abstractNote": "We consider translation invariant gapped quantum spin systems satisfying the Lieb-Robinson bound and containing single particle states in a ground state representation. Following the Haag-Ruelle approach from relativistic quantum field theory, we construct states describing collisions of several particles, and define the corresponding $S$-matrix. We also obtain some general restrictions on the shape of the energy-momentum spectrum. For the purpose of our analysis we adapt the concepts of almost local observables and energy-momentum transfer (or Arveson spectrum) from relativistic QFT to the lattice setting. Our results hold, in particular, in the Ising model in strong transverse magnetic fields.", "accessDate": "2015-02-07 13:25:26", "creators": [ { "creatorType": "author", "firstName": "Sven", "lastName": "Bachmann" }, { "creatorType": "author", "firstName": "Wojciech", "lastName": "Dybalski" }, { "creatorType": "author", "firstName": "Pieter", "lastName": "Naaijkens" } ], "date": "2014-12-09", "extra": [ "arXiv: 1412.2970" ], "itemID": 1, "itemType": "journalArticle", "libraryCatalog": "arXiv.org", "publicationTitle": "arXiv:1412.2970 [math-ph, physics:quant-ph]", "tags": [ { "tag": "Lieb-Robinson bounds" }, { "tag": "Mathematical Physics" }, { "tag": "Quantum Physics" } ], "title": "Lieb-Robinson bounds, Arveson spectrum and Haag-Ruelle scattering theory for gapped quantum spin systems", "url": "http://arxiv.org/abs/1412.2970" } ] }
json
Australia captain Pat Cummins had no regrets about falling one wicket short of a 4-0 lead in the Ashes, admitting he found a tense draw in Sydney "a lot of fun". Cummins was denied victory for the first time since taking over as skipper at the start of the series, but only by the slenderest of margins. Hunting 10 English wickets on day five at the SCG, he saw his team take nine before number 11 James Anderson negotiated the final over of the match to claim a share of the spoils. England were second best by a distance, never even contemplating a dart at the winning target of 388 and finishing 118 short, but Cummins was not in the market for recriminations. One possible slight on Cummins' largely impressive leadership was the timing of his declaration on the fourth evening. He allowed the lead to stretch well beyond what England might realistically have chased down despite an uncertain weather forecast that threatened to take further time out of the game. In the end, only seven overs were lost to rain on day five but bad light did mean he was unable to bowl pace for the final three overs.
english
Forgot password or user name? Latest Info from Administrator. Glad News! The website has been successfully upgraded to the latest version. Please start posting your contents! Expecting your valuable Feedbacks and support. No announcement yet. Search Results: 90 results in 0.0043 seconds. changes in the main page? changes in the main page? Dear members, In a concert, Chembai wanted the organizers to keep the microphone nearer. Finding that the microphone cable (wire) Dear friends, Copyright © 2023 MH Sub I, LLC dba vBulletin. All rights reserved. All times are GMT+5. This page was generated at 23:24.
english
[{"id":"01","provinceId":"33","regencyId":"22","name":"Getasan"},{"id":"02","provinceId":"33","regencyId":"22","name":"Tengaran"},{"id":"03","provinceId":"33","regencyId":"22","name":"Susukan"},{"id":"04","provinceId":"33","regencyId":"22","name":"Suruh"},{"id":"05","provinceId":"33","regencyId":"22","name":"Pabelan"},{"id":"06","provinceId":"33","regencyId":"22","name":"Tuntang"},{"id":"07","provinceId":"33","regencyId":"22","name":"Banyubiru"},{"id":"08","provinceId":"33","regencyId":"22","name":"Jambu"},{"id":"09","provinceId":"33","regencyId":"22","name":"Sumowono"},{"id":"10","provinceId":"33","regencyId":"22","name":"Ambarawa"},{"id":"11","provinceId":"33","regencyId":"22","name":"Bawen"},{"id":"12","provinceId":"33","regencyId":"22","name":"Bringin"},{"id":"13","provinceId":"33","regencyId":"22","name":"Bergas"},{"id":"15","provinceId":"33","regencyId":"22","name":"Pringapus"},{"id":"16","provinceId":"33","regencyId":"22","name":"Bancak"},{"id":"17","provinceId":"33","regencyId":"22","name":"Kaliwungu"},{"id":"18","provinceId":"33","regencyId":"22","name":"Ungaran Barat"},{"id":"19","provinceId":"33","regencyId":"22","name":"Ungaran Timur"},{"id":"20","provinceId":"33","regencyId":"22","name":"Bandungan"}]
json
package array /* 152. Maximum Product Subarray Given an integer array nums, find the contiguous subarray within an array (containing at least one number) which has the largest product. 给定整型数组,找到数组连续子数组的最大乘积 这里还有正负号需要考虑 使用两个变量,一个是当前最大负数,一个是当前最大正数 因为是乘法,然后整型,所以只要不是乘以 0 一直乘是最大的 [ref](https://leetcode.com/problems/maximum-product-subarray/discuss/48230/Possibly-simplest-solution-with-O(n)-time-complexity) */ // 无敌了 /* 初始化 res 为第一个元素,然后 iMax, iMin 分别维护当前的最大正数乘积和最小负数乘积 从第二个元素开始遍历数组 如果当前元素小于 0,将 iMax, iMin 互换, iMax = max(nums[i], iMax*nums[i]) iMin = min(nums[i], iMin*nums[i]) 最后用 iMax 以及 res 较大值更新 res */ func maxProduct(nums []int) int { numsLen := len(nums) res := nums[0] for i, iMax, iMin := 1, res, res; i < numsLen; i++ { if nums[i] < 0 { iMax, iMin = iMin, iMax } iMax = max(nums[i], iMax*nums[i]) iMin = min(nums[i], iMin*nums[i]) res = max(res, iMax) } return res } func max(a, b int) int { if a > b { return a } return b } func min(a, b int) int { if a < b { return a } return b } func maxProduct2(nums []int) int { numsLen := len(nums) mp, mn := -1, 1 tmp, tmn := 1, 1 for i := 0; i < numsLen; i++ { if nums[i] >= 0 { tmp *= nums[i] if tmp > mp { mp = tmp } if tmp == 0 { tmp = 1 } } else { tmn *= nums[i] if tmn < mn { mn = tmn } if tmn == 0 { tmn = 1 } } } return mp }
go
New Delhi: Superstar Nagarjuna Akkineni revealed the first few posters of his upcoming film titled NagRGV 4 and we definitely can't keep calm. Nagarjuna shared a few pictures on Twitter today and shared his utmost excitement for his next film. In one of the posters, the actor can be seen giving serious looks with his handgun while in the other, Nagarjuna can be seen holding a thick metallic chain, which reminded us of our favourite scene from his blockbuster hit Shiva. "28 years ago a film called Shiva changed my life and now again another film/what I'm feeling now is something I cannot describe! I only wish that life was so exciting every day NagRGV4," Nagarjuna captioned the pictures. Nagarjuna's fans have shared the stills from NagRGV4 on Instagram and have poured sweet comments for the 58-year-old actor. In the comments thread the users seemed interested to learn about NagRGV4 and expressed their excitement about the film. "We too have not yet forgotten Shiva. . . loved u then onwards," read one user's comment while the other read: "All the best I think your film is pakka super-duper and blockbuster good luck. " Thank You Nagarjuna Akkineni for these posters: The film, which is tentatively called NagRGV4, will be produced by Ram Gopal Varma and Sudheer Chandra. "Well Nag, it's a cliche to say I will let my work speak . . But since I tend to over promise and under deliver, first time in my career I will shut up and let the film speak," wrote Ram Gopal Varma responding to Nagarjuna. On working with Ram Gopal Varma, Nagarjuna earlier told news agency IANS: Well, going by his recent works, I shouldn't have. In fact, when he first came to me three months ago, I very clearly and explicitly told him to go back and work on the script and come back later, and not do two other films while waiting for my consent. Rather he should put all his other projects and ideas and away and just focus on my film. That was my condition for agreeing to do his film. " Nagarjuna was last seen in Ohmkar's Raju Gari Gadhi 2. (With inputs from IANS)
english
# 구 자가진단 사이트 취약점 보고서 > 이 보고서는 VINTO가 작성하였으며 MIT 라이센스로 배포됩니다. > 또한 이 보고서를 악용하여 발생하는 법적 책임은 모두 당사자에게 있습니다. > 교육부의 권고/안내사항 및 정보통신망법 제44조의2 1항에 따라 이 취약점으로 인해 피해자가 발생할 경우, 피해자의 요청에 따라 해당 취약점이 완전히 막힐 때까지 취약점 보고서의 공개를 잠정 중단할 것을 알립니다. 🔑 취약점 ============ Script의 난독화 부재 ------------ <img src="./selfCheckHomeHTML.png" alt="Chrome Dev Tool을 통해 자가진단 페이지를 본 모습" width="500"/> > Chrome Dev Tool을 통해 자가진단 페이지를 본 모습 교육부가 개발한 자가진단 홈페이지를 Chrome Dev Tool로 분석한 결과, Javascript 코드가 .js 파일로 따로 분리되지 않고 HTML 파일에 ```<Script>``` 태그 형식으로 내장된 것이 확인되었다. 또한 Javascript 코드에는 어떠한 난독화 조치도 되어있지 않았다. #### 이는, 공격자가 손쉽게 페이지를 분석하고 공격할 수 있는 기회를 마련한다. Bruteforce 방지기능의 부재 ------------ Ajax를 이용해 동시에 300~400회의 ```HTTP POST Request```를 넣은 결과, 모든 요청에 대해 지연/연결 차단등의 조치 없이 응답을 반환하는 것이 확인되었다. 300~400회의 Request에 소요된 시간은 단 **2초 이내**로 측정되었다. 이러한 Bruteforce 차단기능의 부재는 **개인정보를 유출의 가능성을 현저히 높인다.** SQL Injection 방어의 부재 의심 ------------ 취약점을 분석하는 도중 자가진단 사이트가 Sql을 사용하는 것으로 의심되는 코드(```SELECT_ERROR```)가 반환되었다. 대부분의 사이트에서 Sql을 사용하기에 이 정보 자체는 큰 문제가 되지 않을 것으로는 보이나, ```첫번째 취약점```의 사례가 있는 만큼 **SQL Injection 취약점의 존재 가능성도 의심된다.** 🔐 취약점 시연 ============ 생년월일 및 자가진단 토큰 추출 ------------ <img src="./Success_Tool.PNG" alt="Chrome Dev Tool을 통해 자가진단 페이지를 본 모습" width="500"/> > 본 개발자의 이름/학교명/태어난 년도를 입력하게 되자, > 본 개발자의 생년월일은 물론, 자가진단 조작에 필요한 토큰까지 나오게 되었다. ```2번째 취약점```을 이용한 Bruteforce 도구를 개발하여 실험한 것으로, 특정인의 ```거주 지역```/```이름```/```학교명```/```태어난 년도(필수는 아님)```을 입력하면 **단 1~2초만에 그 사람의 생년월일과 자가진단 등록에 필요한 토큰을 추출**할 수 있다. 이는 매우 심각한 상황으로, 누군가 악의적인 목적으로 접근하여 이름/학교 정보/지역만을 통해 **해당 사용자의 개인정보**를 알아낼 수 있을 뿐만 아니라, 자가진단 데이터를 조작하여 **피해자가 등교하지 못하도록 하는 등의 행위**까지도 가능해진다. 🔧 해결 방안 ============ * 자가진단 페이지의 Javascript 코드를 .js 파일로 분리하고, 난독화 과정을 거친다. * Bruteforce를 방지하기 위해 ```학생의 이름 별``` 분당 요청 횟수를 제한한다. * 또한 SQL Injection의 취약점이 의심되는 만큼 ```SQL 저장 프로시저```를 이용하거나 ```입력값 검증```을 추가한다. 🚧 현황 ============ * 2020년 9월 경, 새로 개발된 자가진단 서비스가 출시되었음에도 불구하고 현 취약점을 그대로 보유하고 있는 서비스는 유지되고 있음. * 2020년 10월 9일 : 국민신문고 민원을 통해 교육부에 해당 취약점을 통보함 * 2020년 10월 20일 : 교육부 교육정보화과로부터 아래와 같은 답변을 받음 : ``` 교육부 교육정보화과에서 답변드립니다. 민원인께서는 교육부 구 자가진단 사이트 대상 브루트 포스 취약점에 대해 제보하셨습니다. 평소 교육부 운영 사이트 대상으로 정보보안에 관심을 갖아주셔서 감사말씀드립니다. 민원인께서 8월경 구 자가진단 사이트에서 발견하신 브루트 포스 공격 대상 서비스는 현재 운영하지 않고 있으며, 구 사이트 접속 시 사용자 편리성을 위해 신 사이트로 자동전환 되는 기능을 제한적으로 사용하고 있습니다. ※ 신 사이트 자동전환 기능도 구 사이트 접속 사용자를 고려하여 서비스 제한(폐쇄) 예정 또한, 신 자가진단 사이트에서는 브루트 포스 공격에 대비한 SQL Injecton 방어 조치 및 소스 난독화가 적용되어 있습니다. 또한 사이트에 취약점이 존재한다 하더라도 Github에 취약점을 공개하는 부분은 해커(권한없는 자) 등이 공개된 정보를 이용하여 남의 개인정보를 확인하려는 행위 우려가 있는 점에 있어서 정보통신망법 제44조의2(정보의 삭제요청 등)제1항*이 적용될 수 있는 소지가 있음을 추가로 알려드립니다. * 정보통신망을 통하여 일반에게 공개를 목적으로 제공된 정보로 사생활 침해나 명예훼손 등 타인의 권리가 침해된 경우 그 침해를 받은 자는 해당 정보를 처리한 정보통신서비스 제공자에게 침해사실을 소명하여 그 정보의 삭제 또는 반박내용의 게재(이하 "삭제등"이라 한다)를 요청할 수 있다. 향후 교육부 관련 사이트의 취약요소 발견 시에는 교육부 사이버안전센터로 문의 또는 신고바라며, 본 민원 관련 추가 문의사항에 대해서는 교육부 교육정보화과로 연락주시면 답변드리도록 하겠습니다. 감사합니다. ``` * 2020년 10월 20일 : 교육부 확인결과 취약점이 적용되는 구 자가진단 사이트의 운영이 중단됨. * 구 사이트로 접속시 최신 자가진단 사이트로 리다이렉트 * 단, 사이트만 접속이 불가능하고 **구 API는 여전히 동작하는 것이 확인됨**, 이는 교육부의 답변에서 밝힌 사이트 리다이렉트 조치가 무의미하다는 것을 보여줌. * 교육부의 답변에 따르면, 최신 자가진단 사이트에서는 SQL Injection 방어조치 및 프론트엔드 난독화 등 기본적인 보안수칙이 적용됨. * 2020년 10월 20일 : 교육부의 권고 및 안내사항 `정보통신망법 제44조의2(정보의 삭제요청 등)`에 따라 해당 취약점으로 인한 피해자가 발생할 경우, 피해자의 의사에 따라 취약점 공개를 잠정 중단하기로 함.
markdown
<reponame>stefan-karl/packages {"resourceType":"CodeSystem","id":"device-status-reason","meta":{"lastUpdated":"2021-01-17T07:06:13.533+11:00"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg","valueCode":"oo"},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":2}],"url":"http://terminology.hl7.org/CodeSystem/device-status-reason","identifier":[{"system":"urn:ietf:rfc:3986","value":"urn:oid:2.16.840.1.113883.4.642.4.1082"}],"version":"4.0.1","name":"FHIRDeviceStatusReason","title":"FHIRDeviceStatusReason","status":"draft","experimental":false,"date":"2021-01-17T07:06:13+11:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"<EMAIL>"}]}],"description":"The availability status reason of the device.","caseSensitive":true,"valueSet":"http://hl7.org/fhir/ValueSet/device-status-reason","content":"complete","concept":[{"code":"online","display":"Online","definition":"The device is off."},{"code":"paused","display":"Paused","definition":"The device is paused."},{"code":"standby","display":"Standby","definition":"The device is ready but not actively operating."},{"code":"offline","display":"Offline","definition":"The device is offline."},{"code":"not-ready","display":"Not Ready","definition":"The device is not ready."},{"code":"transduc-discon","display":"Transducer Disconnected","definition":"The device transducer is disconnected."},{"code":"hw-discon","display":"Hardware Disconnected","definition":"The device hardware is disconnected."},{"code":"off","display":"Off","definition":"The device is off."}]}
json
HCLTech, India's third-largest software exporter, outperformed expectations with a 6.2% rise in net profit and a 6.5% increase in revenues in Q3. Meanwhile, Wipro reported a steep 12% fall in profits and a 4.4% dip in revenue. HCLTech's success can be attributed to the $2.1-billion Verizon deal and an increase in headcount. Wipro Q3 Results: Wipro reported disappointing Q3 results, with a decline in net profit and revenue. The company's consolidated net profit decreased by nearly 12% YoY to Rs 2,694 crore, while the consolidated revenue dropped 4.4% to Rs 22,205 crore. The board recommended an interim dividend of Re 1 per share. For the nine months ended December, Wipro's consolidated revenue rose by only 0.4% to Rs 67,552 crore, while the net profit declined by nearly 1% to Rs 8,211 crore. Wipro expects revenue from its IT Services business to be in the range of $2.62 billion to $2.67 billion for the quarter ending March. TCS CFO and CHRO discuss Q3 results and margin resilience. Attrition has decreased and there is potential for further reduction. Subcontracting cost has been lowered and there is room for optimization. The impact of generative AI on the workforce is acknowledged, but it is not a major factor in the current headcount decline. The BSNL deal contributes to growth and showcases TCS's capabilities. The demand environment is being closely monitored and there is optimism for improvement. K Krithivasan says: "You cannot look at the deal wins in the same lens as revenue. It does not follow the same revenue trajectory because there is always a certain amount of lumpiness as a timing issue. You need to look at over a long period of time, over the last four quarters, how the deal wins have been very strong. And this quarter, it is not aided by any mega deals because mega deals tend to be lumpy and all come from mid-sized deals. We are very happy with what we achieved in terms of deal wins." TCS has fixed January 19 as the record date to determine the eligibility of shareholders for the proposed dividend. The third interim dividend and the special dividend will be paid on February 5 to the eligible shareholders. Shares of TCS will likely trade ex-dividend on the day or a day before the record date. TCS Q3 Results: India’s largest software service provider reported a 2% YoY growth in consolidated net profit for the December quarter to Rs 11,058 crore, while the revenue increased 4% to Rs 60,583 crore. Analysts estimated a revenue of Rs 60,119 crore and a profit of Rs 11,446 crore. The board also recommended a special dividend payout of Rs 18/share and an interim dividend of Rs 9/share. The topline and bottomline were the highest-ever quarterly numbers for the company. The company has also reported a record EBITDA of Rs 1,087 crore, with a growth of 32% YoY. Total sales volume during the second quarter increased 13% year-on-year to 2.29 lakh units. On a standalone basis, net profit stood at Rs 847 crore for the quarter ended September 2023, up 55% from Rs 548 crore clocked in the previous year quarter. Revenue from operations rose 12% YoY to Rs 20,676 crore. The company reported an EBITDA of Rs 1,756 crore in the second quarter under review, and margins were at 8.5% in the same period. Revenue from operations in the reporting second quarter jumped 19% year-on-year (YoY) to Rs 4,800 crore, compared with Rs 4,038 crore in the year-ago quarter. Operating profit or EBITDA for the quarter jumped 64% YoY to Rs 886 crore. The total sales volume increased 10% year-on-year to 8.2 million tonnes in the July-September period. Bharat Forge Q2 results: Revenue from operations grew by nearly 21% to Rs 2,249 crore, driven by a 21% growth each in exports and domestic revenue. The quarter saw stellar performance on the exports front, with passenger vehicle (PV) exports growing 39% YoY. HDFC Bank Q2 Preview: While Kotak Institutional Equities expects HDFC Bank's Q2 PAT to rise 44.5% to Rs 15,327 crore, Motilal sees a growth of 39.4%. "We expect gross NPL ratio to be marginally higher as reported in the merged balance sheet. The near-term focus would be the progress of NIM and the impact of PSL (FY2025)," Kotak Equities said. Infosys has reported a 3% YoY growth in consolidated net profit for the quarter ended September. The company's consolidated revenue also grew nearly 7% YoY. Infosys has tweaked its guidance for FY24, expecting revenue growth of 1.0-2.5% in constant currency terms. The company retained its operating margin target of 20-22%. Infosys announced large TCV deals worth $7.7 billion for the quarter and saw a decline in attrition rate. Torrent Power reported a consolidated net profit of INR 483.93 crore for the March 2023 quarter, compared to a net loss of INR 487.37 crore in the same period last year, largely driven by increased revenues. For the full year FY23, net profit rose nearly five-fold to reach INR 2,164.7 crore, while total income increased 59% to INR 6,133.70 crore during the quarter and reached INR 26,075.97 crore in FY23. The company also approved a proposal to issue non-convertible debentures worth up to INR 3,000 crore by way of private placement, subject to approval by members in the ensuing annual general meeting. State-owned engineers India Ltd (EIL) saw a Q4 profit increase of 25% to INR 159 crore ($22m) and new businesses secured rose nearly three-fold year-on-year to INR 4,700 crore. Despite profit for 2022-23 remaining steady, revenue from operations rose 7.5% YoY to INR 866 crore in Q4, with debtors and trade receivables also decreasing. EIL has already secured INR 650 crore worth of new business and its order book at end of March was INR 9,079 crore, with 15% from abroad, focused on projects in the GCC, Africa, Mongolia and Guyana.
english
// Core.cpp #include <cmath> #include <iostream> #include <fstream> #include <string> #include <stdlib.h> #include <vector> #include <sstream> #include "Core.h" using namespace std; Core::Core(InputParameter& _inputParameter, Technology& _tech, MemCell& _cell, ReadParam& _readParam): inputParameter(_inputParameter), tech(_tech), cell(_cell), readParam(_readParam), sum_add(_inputParameter, _tech, _cell), shiftAdd(_inputParameter, _tech, _cell), subArray(_inputParameter, _tech, _cell) { initialized = false; } void Core::Initialize(double _unitWireRes) { if (initialized) cout << "[Core] Warning: Already initialized! " << endl; numArrayCol = readParam.numArrayCol; numArrayRow = readParam.numArrayRow; numWeightBit = readParam.WeightBits; numCellBit = readParam.CellBits; numCellPerSynapse = numWeightBit*1.0 / numCellBit; numBitInput = readParam.IOBits; numOutput = floor(numArrayCol/numCellPerSynapse)-1; // The output number, -1 means substrate bias numSABit = readParam.SABits; /* Initialize Sum */ sum_add.Initialize(numArrayCol, numCellPerSynapse, numSABit); /* Initialize ShiftAdder */ int ShiftAddmux = 10.0; shiftAdd.Initialize(ceil(numOutput/ShiftAddmux), readParam.IOBits, readParam.clkFreq, NONSPIKING, numBitInput); /* Initialize SubArray */ subArray.activityRowWrite = (double)1/2; subArray.activityColWrite = (double)1/2; subArray.spikingMode = NONSPIKING; if (subArray.spikingMode == SPIKING) subArray.numReadPulse = pow(2, numBitInput); else subArray.numReadPulse = numBitInput; subArray.numWritePulse = 1; subArray.neuro = 1; subArray.multifunctional = 0; subArray.digitalModeNeuro = 0; subArray.newBNNrowbyrowMode = 0; subArray.newBNNparallelMode = 0; subArray.tsqinghua = 1; if (1 <= numSABit && numSABit<= 6) subArray.levelOutput = pow(2, numSABit); else { subArray.levelOutput = pow(2, 6); cout << "[Core] Error: Current version only support SABit=1-6!" << endl; } subArray.FirstLayer = 0; subArray.XNORModeDoubleEnded = 0; subArray.XNORModeSingleEnded = 0; subArray.clkFreq = readParam.clkFreq; subArray.parallelWrite = false; subArray.FPGA = false; subArray.LUT_dynamic = false; subArray.backToBack = false; subArray.numLut = 32; subArray.numColMuxed = 4; subArray.numWriteColMuxed = 4; if (subArray.spikingMode == NONSPIKING && subArray.numReadPulse > 1) subArray.shiftAddEnable = true; else subArray.shiftAddEnable = false; subArray.relaxArrayCellHeight = 0; subArray.relaxArrayCellWidth = 0; subArray.readCircuitMode = CMOS; subArray.maxNumIntBit = numBitPartialSum; int numBitLTP = numWeightBit; int numBitLTD = numWeightBit; int maxNumLevelLTP = pow(2, numBitLTP) - 1; int maxNumLevelLTD = pow(2, numBitLTD) - 1; subArray.maxNumWritePulse = (maxNumLevelLTP > maxNumLevelLTD)? maxNumLevelLTP : maxNumLevelLTD; if (subArray.digitalModeNeuro) { subArray.numCellPerSynapse = numWeightBit; subArray.avgWeightBit = subArray.numCellPerSynapse; } else if(subArray.newBNNparallelMode) { subArray.numCellPerSynapse = numWeightBit; subArray.avgWeightBit = subArray.numCellPerSynapse; } else if(subArray.newBNNrowbyrowMode) { subArray.numCellPerSynapse = 1; subArray.avgWeightBit = subArray.numCellPerSynapse; } else if(subArray.XNORModeDoubleEnded) { subArray.numCellPerSynapse = numWeightBit; subArray.avgWeightBit = subArray.numCellPerSynapse; } else if(subArray.XNORModeSingleEnded) { subArray.numCellPerSynapse = 1; subArray.avgWeightBit = subArray.numCellPerSynapse; } else if(subArray.tsqinghua) // Tsinghua Design { subArray.numCellPerSynapse = numCellPerSynapse; subArray.avgWeightBit = subArray.numCellPerSynapse; } else { subArray.numCellPerSynapse = 1; subArray.avgWeightBit = (numBitLTP > numBitLTD)? numBitLTP : numBitLTD; } int numRow; if (subArray.XNORModeDoubleEnded && !subArray.FPGA) numRow = numArrayRow * 2; else if (subArray.XNORModeSingleEnded && !subArray.FPGA) numRow = numArrayRow * 2; else numRow = numArrayRow; int numCol; if (subArray.neuro && !subArray.FPGA) { numCol = numArrayCol * subArray.numCellPerSynapse; } else numCol = numArrayCol; if (subArray.numColMuxed > numCol) subArray.numColMuxed = numCol; subArray.numReadCellPerOperationFPGA = numCol; subArray.numWriteCellPerOperationFPGA = numCol; subArray.numReadCellPerOperationMemory = numCol; subArray.numWriteCellPerOperationMemory = numCol/8; subArray.numReadCellPerOperationNeuro = numCol * subArray.numCellPerSynapse; subArray.numWriteCellPerOperationNeuro = numCol; //subArray.activityRowRead = activityRowRead; //(double) numofreadrow/numRow; subArray.numof1=numof1, subArray.numof2=numof2, subArray.numof3=numof3, subArray.numof4=numof4, subArray.numof5=numof5, subArray.numof6=numof6, subArray.numof7=numof7, subArray.numof8=numof8,subArray.numof9=numof9, subArray.numof10=numof10; subArray.Initialize(numArrayRow, numArrayCol, _unitWireRes); initialized = true; } void Core::CalculateArea() { if (!initialized) cout << "[Core] Error: Require initialization first!" << endl; // To ensure initialization first else { subArray.CalculateArea(); width = subArray.width; sum_add.CalculateArea(NULL, width, NONE); shiftAdd.CalculateArea(NULL, width, NONE); height = subArray.height + sum_add.height + shiftAdd.height; area = height * width; usedArea = subArray.usedArea + sum_add.area + shiftAdd.area; emptyArea = area - usedArea; } } void Core::CalculateLatency(double _rampInput) { if (!initialized) cout << "[Core] Error: Require initialization first!" << endl; // To ensure initialization first else { subArray.CalculateLatency(_rampInput); sum_add.CalculateLatency(numBitInput); shiftAdd.CalculateLatency(numBitInput); readLatency = 0; readLatency += subArray.readLatency; readLatency += sum_add.readLatency; readLatency += shiftAdd.readLatency; writeLatency = 0; writeLatency = subArray.writeLatency; } } void Core::CalculatePower(double activityRowRead) { if (!initialized) cout << "[Core] Error: Require initialization first!" << endl; // To ensure initialization first else { subArray.numof1 = numof1; subArray.numof2 = numof2; subArray.numof3 = numof3; subArray.numof4 = numof4; subArray.numof5 = numof5; subArray.numof6 = numof6; subArray.numof7 = numof7; subArray.numof8 = numof8; subArray.numof9 = numof9; subArray.numof10 = numof10; subArray.CalculatePower(activityRowRead); sum_add.CalculatePower(numBitInput); shiftAdd.CalculatePower(numBitInput); readDynamicEnergy = 0; readDynamicEnergy += subArray.readDynamicEnergy; readDynamicEnergy += sum_add.readDynamicEnergy; readDynamicEnergy += shiftAdd.readDynamicEnergy; writeDynamicEnergy = 0; writeDynamicEnergy += subArray.writeDynamicEnergy; leakage = 0; leakage += subArray.leakage; leakage += sum_add.leakage; leakage += shiftAdd.leakage; if (!readLatency) cout << "[Core] Error: Need to calculate read latency first" << endl; else readPower = readDynamicEnergy/readLatency + leakage; if (!writeLatency) cout << "[Core] Error: Need to calculate write latency first" << endl; else writePower = writeDynamicEnergy/writeLatency + leakage; } } void Core::SaveOutput(const int& CoreIndex, const char* outputFile) { ofstream outfile; outfile.open(outputFile, ios::app); outfile << " CoreIndex: " << CoreIndex << endl; subArray.SaveOutput(outputFile); sum_add.SaveOutput("Sum", outputFile); shiftAdd.SaveOutput("ShiftAdd", outputFile); FunctionUnit::SaveOutput("Calculation Core", outputFile); outfile << "Used Area = " << usedArea*1e12 << "um^2" << endl; outfile << "Empty Area = " << emptyArea*1e12 << "um^2" << endl; outfile << '\n' << endl; outfile << endl; outfile.close(); } void Core::PrintProperty() { subArray.PrintProperty(); sum_add.PrintProperty("Sum"); shiftAdd.PrintProperty("ShiftAdd"); FunctionUnit::PrintProperty("Core"); cout << "Used Area = " << usedArea*1e12 << "um^2" << endl << "Empty Area = " << emptyArea*1e12 << "um^2" << endl << '\n' << endl; }
cpp
<filename>src/app/app.module.ts import {NgModule} from '@angular/core'; import {BrowserModule} from '@angular/platform-browser'; import { RouterModule, Routes } from "@angular/router"; import { AppComponent } from "./app.component"; import { EngineComponent } from "./engine/engine.component"; import { UiInfobarBottomComponent } from "./ui/ui-infobar-bottom/ui-infobar-bottom.component"; import { UiInfobarTopComponent } from "./ui/ui-infobar-top/ui-infobar-top.component"; import { UiSidebarLeftComponent } from "./ui/ui-sidebar-left/ui-sidebar-left.component"; import { UiSidebarRightComponent } from "./ui/ui-sidebar-right/ui-sidebar-right.component"; import { UiComponent } from "./ui/ui.component"; import { MainComponent } from "./main/main.component"; const routes: Routes = [ { path: "", component: MainComponent, }, { path: "three", component: UiComponent, }, { path: "**", redirectTo: "", pathMatch: "full", }, ]; @NgModule({ declarations: [ AppComponent, EngineComponent, UiComponent, UiInfobarBottomComponent, UiInfobarTopComponent, UiSidebarLeftComponent, UiSidebarRightComponent, MainComponent, ], imports: [BrowserModule, RouterModule.forRoot(routes)], providers: [], bootstrap: [AppComponent], }) export class AppModule {}
typescript
<reponame>sawe-daisy/insta-try<filename>gram/templates/index.html {% extends "base.html" %} {% block content %} {% for post in posts %} <article class="media content-section"> <img class="rounded-circle article-img" src="{{ post.image.url }}" height="300px" width="300px"> <div class="media-body"> <div class="article-metadata"> <small class="text-muted">posted on {{ post.pub_date|date:"F d, Y" }}</small> </div> <h2><a class="article-title" href="{% url 'post-detail' post.id %}">View Image</a></h2> <p class="article-content">{{ post.caption }}</p> </div> <a class="mr-2" href="{% url 'comment' post.id %}">Comments</a> {% if user.is_authenticated %} <form action="{% url 'like_post' post.pk %}" method="POST"> {% csrf_token %} <button type="submit" name="post_id" value="{{post.id}}" class="btn-sm btn-info">Like</button> </form> {% endif %} </article> {% endfor %} {% endblock content %}
html
############################################################################## # VIM CHEATSHEET (中文速查表) - by skywind (created on 2017/10/12) # Version: 42, Last Modified: 2018/07/19 19:04 # https://github.com/skywind3000/awesome-cheatsheets ############################################################################## ############################################################################## # 光标移动 ############################################################################## h 光标左移,同 <Left> 键 j 光标下移,同 <Down> 键 k 光标上移,同 <Up> 键 l 光标右移,同 <Right> 键 CTRL-F 下一页 CTRL-B 上一页 CTRL-U 上移半屏 CTRL-D 下移半屏 0 跳到行首(是数字零,不是字母O),效用等同于 <Home> 键 ^ 跳到从行首开始第一个非空白字符 $ 跳到行尾,效用等同于 <End> 键 gg 跳到第一行,效用等同于 CTRL+<Home> G 跳到最后一行,效用等同于 CTRL+<End> nG 跳到第n行,比如 10G 是移动到第十行 :n 跳到第n行,比如 :10<回车> 是移动到第十行 10% 移动到文件 10% 处 15| 移动到当前行的 15列 w 跳到下一个单词开头 (word: 标点或空格分隔的单词) W 跳到下一个单词开头 (WORD: 空格分隔的单词) e 跳到下一个单词尾部 (word: 标点或空格分隔的单词) E 跳到下一个单词尾部 (WORD: 空格分隔的单词) b 上一个单词头 (word: 标点或空格分隔的单词) B 上一个单词头 (WORD: 空格分隔的单词) ge 上一个单词尾 ) 向前移动一个句子(句号分隔) ( 向后移动一个句子(句号分隔) } 向前移动一个段落(空行分隔) { 向后移动一个段落(空行分隔) <enter> 移动到下一行首个非空字符 + 移动到下一行首个非空字符(同回车键) - 移动到上一行首个非空字符 H 移动到屏幕上部 M 移动到屏幕中部 L 移动到屏幕下部 fx 跳转到下一个为 x 的字符,2f/ 可以找到第二个斜杆 Fx 跳转到上一个为 x 的字符 tx 跳转到下一个为 x 的字符前 Tx 跳转到上一个为 x 的字符前 ; 跳到下一个 f/t 搜索的结果 , 跳到上一个 f/t 搜索的结果 <S-Left> 按住 SHIFT 按左键,向左移动一个单词 <S-Right> 按住 SHIFT 按右键,向右移动一个单词 <S-Up> 按住 SHIFT 按上键,向上翻页 <S-Down> 按住 SHIFT 按下键,向下翻页 gm 移动到行中 gj 光标下移一行(忽略自动换行) gk 光标上移一行(忽略自动换行) ############################################################################## # 插入模式:进入退出 ############################################################################## i 在光标处进入插入模式 I 在行首进入插入模式 a 在光标后进入插入模式 A 在行尾进入插入模式 o 在下一行插入新行并进入插入模式 O 在上一行插入新行并进入插入模式 gi 进入到上一次插入模式的位置 <ESC> 退出插入模式 CTRL-[ 退出插入模式(同 ESC 等价,但更顺手) ############################################################################## # INSERT MODE - 由 i, I, a, A, o, O 等命令进入插入模式后 ############################################################################## <Up> 光标向上移动 <Down> 光标向下移动 <Left> 光标向左移动 <Right> 光标向右移动 <S-Left> 按住 SHIFT 按左键,向左移动一个单词 <S-Right> 按住 SHIFT 按右键,向右移动一个单词 <S-Up> 按住 SHIFT 按上键,向上翻页 <S-Down> 按住 SHIFT 按下键,向下翻页 <PageUp> 上翻页 <PageDown> 下翻页 <Delete> 删除光标处字符 <BS> Backspace 向后删除字符 <Home> 光标跳转行首 <End> 光标跳转行尾 CTRL-W 向后删除单词 CTRL-O 临时退出插入模式,执行单条命令又返回插入模式 CTRL-\ CTRL-O 临时退出插入模式(光标保持),执行单条命令又返回插入模式 CTRL-R 0 插入寄存器(内部 0号剪贴板)内容,CTRL-R 后可跟寄存器名 CTRL-R " 插入匿名寄存器内容,相当于插入模式下 p粘贴 CTRL-R = 插入表达式计算结果,等号后面跟表达式 CTRL-R : 插入上一次命令行命令 CTRL-R / 插入上一次搜索的关键字 CTRL-F 自动缩进 CTRL-U 删除当前行所有字符 CTRL-V {char} 插入非数字的字面量 CTRL-V {number} 插入三个数字代表的 ascii/unicode 字符 CTRL-V 065 插入 10进制 ascii 字符(两数字) 065 即 A字符 CTRL-V x41 插入 16进制 ascii 字符(三数字) x41 即 A字符 CTRL-V o101 插入 8进制 ascii 字符(三数字) o101 即 A字符 CTRL-V u1234 插入 16进制 unicode 字符(四数字) CTRL-V U12345678 插入 16进制 unicode 字符(八数字) CTRL-K {ch1} {ch2} 插入 digraph(见 :h digraph),快速输入日文或符号等 ############################################################################## # 文本编辑 ############################################################################## r 替换当前字符 R 进入替换模式,直至 ESC 离开 s 替换字符(删除光标处字符,并进入插入模式,前可接数量) S 替换行(删除当前行,并进入插入模式,前可接数量) cc 改写当前行(删除当前行并进入插入模式),同 S cw 改写光标开始处的当前单词 ciw 改写光标所处的单词 caw 改写光标所处的单词,并且包括前后空格(如果有的话) c0 改写到行首 c^ 改写到行首(第一个非零字符) c$ 改写到行末 C 改写到行尾(同c$) ci" 改写双引号中的内容 ci' 改写单引号中的内容 cib 改写小括号中的内容 cab 改写小括号中的内容(包含小括号本身) ci) 改写小括号中的内容 ci] 改写中括号中内容 ciB 改写大括号中内容 caB 改写大括号中的内容(包含大括号本身) ci} 改写大括号中内容 cit 改写 xml tag 中的内容 cis 改写当前句子 c2w 改写下两个单词 ct( 改写到小括号前 x 删除当前字符,前面可以接数字,3x代表删除三个字符 X 向前删除字符 dd 删除当前行 d0 删除到行首 d^ 删除到行首(第一个非零字符) d$ 删除到行末 D 删除到行末(同 d$) dw 删除当前单词 diw 删除光标所处的单词 daw 删除光标所处的单词,并包含前后空格(如果有的话) di" 删除双引号中的内容 di' 删除单引号中的内容 dib 删除小括号中的内容 di) 删除小括号中的内容 dab 删除小括号内的内容(包含小括号本身) di] 删除中括号中内容 diB 删除大括号中内容 di} 删除大括号中内容 daB 删除大括号内的内容(包含大括号本身) dit 删除 xml tag 中的内容 dis 删除当前句子 d2w 删除下两个单词 dt( 删除到小括号前 dgg 删除到文件头部 dG 删除到文件尾部 d} 删除下一段 d{ 删除上一段 u 撤销 U 撤销整行操作 CTRL-R 撤销上一次 u 命令 J 链接多行为一行 . 重复上一次操作 ~ 替换大小写 g~iw 替换当前单词的大小写 gUiw 将单词转成大写 guiw 将当前单词转成小写 guu 全行转为小写 gUU 全行转为大写 << 减少缩进 >> 增加缩进 == 自动缩进 CTRL-A 增加数字 CTRL-X 减少数字 ############################################################################## # 复制粘贴 ############################################################################## p 粘贴到光标后 P 粘贴到光标前 v 开始标记 y 复制标记内容 V 开始按行标记 CTRL-V 开始列标记 y$ 复制当前位置到本行结束的内容 yy 复制当前行 Y 复制当前行,同 yy yiw 复制当前单词 3yy 复制光标下三行内容 v0 选中当前位置到行首 v$ 选中当前位置到行末 viw 选中当前单词 vib 选中小括号内的东西 vi) 选中小括号内的东西 vi] 选中中括号内的东西 viB 选中大括号内的东西 vi} 选中大括号内的东西 vis 选中句子中的东西 vab 选中小括号内的东西(包含小括号本身) va) 选中小括号内的东西(包含小括号本身) va] 选中中括号内的东西(包含中括号本身) vaB 选中大括号内的东西(包含大括号本身) va} 选中大括号内的东西(包含大括号本身) gv 重新选择上一次选中的文字 :set paste 允许粘贴模式(避免粘贴时自动缩进影响格式) :set nopaste 禁止粘贴模式 "?yy 复制当前行到寄存器 ? ,问号代表 0-9 的寄存器名称 "?p 将寄存器 ? 的内容粘贴到光标后 "?P 将寄存器 ? 的内容粘贴到光标前 :registers 显示所有寄存器内容 :[range]y 复制范围,比如 :20,30y 是复制20到30行,:10y 是复制第十行 :[range]d 删除范围,比如 :20,30d 是删除20到30行,:10d 是删除第十行 ddp 交换两行内容:先删除当前行复制到寄存器,并粘贴 ############################################################################## # 文本对象 - c,d,v,y 等命令后接文本对象,一般为:<范围 i/a><类型> ############################################################################## $ 到行末 0 到行首 ^ 到行首非空字符 tx 光标位置到字符 x 之前 fx 光标位置到字符 x 之处 iw 整个单词(不包括分隔符) aw 整个单词(包括分隔符) iW 整个 WORD(不包括分隔符) aW 整个 WORD(包括分隔符) is 整个句子(不包括分隔符) ib 小括号内 ab 小括号内(包含小括号本身) iB 大括号内 aB 大括号内(包含大括号本身) i) 小括号内 a) 小括号内(包含小括号本身) i] 中括号内 a] 中括号内(包含中括号本身) i} 大括号内 a} 大括号内(包含大括号本身) i' 单引号内 a' 单引号内(包含单引号本身) i" 双引号内 a" 双引号内(包含双引号本身) 2i) 往外两层小括号内 2a) 往外两层小括号内(包含小括号本身) 2f) 到第二个小括号处 2t) 到第二个小括号前 ############################################################################## # 查找替换 ############################################################################## /pattern 从光标处向文件尾搜索 pattern ?pattern 从光标处向文件头搜索 pattern n 向同一方向执行上一次搜索 N 向相反方向执行上一次搜索 * 向前搜索光标下的单词 # 向后搜索光标下的单词 :s/p1/p2/g 将当前行中全替换p1为p2 :%s/p1/p2/g 将当前文件中全替换p1为p2 :%s/p1/p2/gc 将当前文件中全替换p1为p2,并且每处询问你是否替换 :10,20s/p1/p2/g 将第10到20行中所有p1替换为p2 :%s/1\\2\/3/123/g 将“1\2/3” 替换为 “123”(特殊字符使用反斜杠标注) :%s/\r//g 删除 DOS 换行符 ^M ############################################################################## # VISUAL MODE - 由 v, V, CTRL-V 进入的可视模式 ############################################################################## > 增加缩进 < 减少缩进 d 删除高亮选中的文字 x 删除高亮选中的文字 c 改写文字,即删除高亮选中的文字并进入插入模式 s 改写文字,即删除高亮选中的文字并进入插入模式 y 拷贝文字 ~ 转换大小写 o 跳转到标记区的另外一端 O 跳转到标记块的另外一端 u 标记区转换为小写 U 标记区转换为大写 g CTRL-G 显示所选择区域的统计信息 <Esc> 退出可视模式 ############################################################################## # 位置跳转 ############################################################################## CTRL-O 跳转到上一个位置 CTRL-I 跳转到下一个位置 CTRL-^ 跳转到 alternate file (当前窗口的上一个文件) % 跳转到 {} () [] 的匹配 gd 跳转到局部定义(光标下的单词的定义) gD 跳转到全局定义(光标下的单词的定义) gf 打开名称为光标下文件名的文件 [[ 跳转到上一个顶层函数(比如C语言以大括号分隔) ]] 跳转到下一个顶层函数(比如C语言以大括号分隔) [m 跳转到上一个成员函数 ]m 跳转到下一个成员函数 [{ 跳转到上一处未匹配的 { ]} 跳转到下一处未匹配的 } [( 跳转到上一处未匹配的 ( ]) 跳转到下一处未匹配的 ) [c 上一个不同处(diff时) ]c 下一个不同处(diff时) [/ 跳转到 C注释开头 ]/ 跳转到 C注释结尾 `` 回到上次跳转的位置 '' 回到上次跳转的位置 `. 回到上次编辑的位置 '. 回到上次编辑的位置 ############################################################################## # 文件操作 ############################################################################## :w 保存文件 :w <filename> 按名称保存文件 :e <filename> 打开文件并编辑 :saveas <filename> 另存为文件 :r <filename> 读取文件并将内容插入到光标后 :r !dir 将 dir 命令的输出捕获并插入到光标后 :close 关闭文件 :q 退出 :q! 强制退出 :wa 保存所有文件 :cd <path> 切换 Vim 当前路径 :pwd 显示 Vim 当前路径 :new 打开一个新的窗口编辑新文件 :enew 在当前窗口创建新文件 :vnew 在左右切分的新窗口中编辑新文件 :tabnew 在新的标签页中编辑新文件 ############################################################################## # 缓存操作 ############################################################################## :ls 查案缓存列表 :bn 切换到下一个缓存 :bp 切换到上一个缓存 :bd 删除缓存 :b 1 切换到1号缓存 :b abc 切换到文件名为 abc 开头的缓存 :badd <filename> 将文件添加到缓存列表 :set hidden 设置隐藏模式(未保存的缓存可以被切换走,或者关闭) :set nohidden 关闭隐藏模式(未保存的缓存不能被切换走,或者关闭) n CTRL-^ 切换缓存,先输入数字的缓存编号,再按 CTRL + 6 ############################################################################## # 窗口操作 ############################################################################## :sp <filename> 上下切分窗口并在新窗口打开文件 filename :vs <filename> 左右切分窗口并在新窗口打开文件 filename CTRL-W s 上下切分窗口 CTRL-W v 左右切分窗口 CTRL-W w 循环切换到下一个窗口 CTRL-W W 循环切换到上一个窗口 CTRL-W p 跳到上一个访问过的窗口 CTRL-W c 关闭当前窗口 CTRL-W o 关闭其他窗口 CTRL-W h 跳到左边的窗口 CTRL-W j 跳到下边的窗口 CTRL-W k 跳到上边的窗口 CTRL-W l 跳到右边的窗口 CTRL-W + 增加当前窗口的行高,前面可以加数字 CTRL-W - 减少当前窗口的行高,前面可以加数字 CTRL-W < 减少当前窗口的列宽,前面可以加数字 CTRL-W > 增加当前窗口的列宽,前面可以加数字 CTRL-W = 让所有窗口宽高相同 CTRL-W H 将当前窗口移动到最左边 CTRL-W J 将当前窗口移动到最下边 CTRL-W K 将当前窗口移动到最上边 CTRL-W L 将当前窗口移动到最右边 CTRL-W x 交换窗口 CTRL-W f 在新窗口中打开名为光标下文件名的文件 CTRL-W gf 在新标签页中打开名为光标下文件名的文件 CTRL-W R 旋转窗口 CTRL-W T 将当前窗口移到新的标签页中 CTRL-W P 跳转到预览窗口 CTRL-W z 关闭预览窗口 CTRL-W _ 纵向最大化当前窗口 CTRL-W | 横向最大化当前窗口 ############################################################################## # 标签页 ############################################################################## :tabs 显示所有标签页 :tabe <filename> 在新标签页中打开文件 filename :tabn 下一个标签页 :tabp 上一个标签页 :tabc 关闭当前标签页 :tabo 关闭其他标签页 :tabn n 切换到第n个标签页,比如 :tabn 3 切换到第三个标签页 :tabm n 标签移动 :tabfirst 切换到第一个标签页 :tablast 切换到最后一个标签页 :tab help 在标签页打开帮助 :tab drop <file> 如果文件已被其他标签页和窗口打开则跳过去,否则新标签打开 :tab split 在新的标签页中打开当前窗口里的文件 :tab ball 将缓存中所有文件用标签页打开 :set showtabline=? 设置为 0 就不显示标签页标签,1会按需显示,2会永久显示 ngt 切换到第n个标签页,比如 2gt 将会切换到第二个标签页 gt 下一个标签页 gT 上一个标签页 ############################################################################## # 书签 ############################################################################## :marks 显示所有书签 ma 保存当前位置到书签 a ,书签名可以用 a-z(作用范围为文件内部), A-Z(作用范围为所有文件) 26*2个字母 'a 跳转到书签 a所在的行 `a 跳转到书签 a所在位置 `. 跳转到上一次编辑的行 'A 跳转到全文书签 A [' 跳转到上一个书签 ]' 跳转到下一个书签 '< 跳到上次可视模式选择区域的开始 '> 跳到上次可视模式选择区域的结束 ############################################################################## # 常用设置 ############################################################################## :set nocompatible 设置不兼容原始 vi 模式(必须设置在最开头) :set bs=? 设置BS键模式,现代编辑器为 :set bs=eol,start,indent :set sw=4 设置缩进宽度为 4 :set ts=4 设置制表符宽度为 4 :set noet 设置不展开 tab 成空格 :set et 设置展开 tab 成空格 :set winaltkeys=no 设置 GVim 下正常捕获 ALT 键 :set nowrap 关闭自动换行 :set ttimeout 允许终端按键检测超时(终端下功能键为一串ESC开头的扫描码) :set ttm=100 设置终端按键检测超时为100毫秒 :set term=? 设置终端类型,比如常见的 xterm :set ignorecase 设置搜索是否忽略大小写 :set smartcase 智能大小写,默认忽略大小写,除非搜索内容里包含大写字母 :set list 设置显示制表符和换行符 :set number 设置显示行号,禁止显示行号可以用 :set nonumber :set paste 进入粘贴模式(粘贴时禁用缩进等影响格式的东西) :set nopaste 结束粘贴模式 :set spell 允许拼写检查 :set hlsearch 设置高亮查找 :set ruler 总是显示光标位置 :set incsearch 查找输入时动态增量显示查找结果 :set insertmode Vim 始终处于插入模式下,使用 ctrl-o 临时执行命令 :set all 列出所有选项设置情况 :syntax on 允许语法高亮 :syntax off 禁止语法高亮 ############################################################################## # 帮助信息 ############################################################################## :h tutor 入门文档 :h quickref 快速帮助 :h index 查询 Vim 所有键盘命令定义 :h summary 帮助你更好的使用内置帮助系统 :h CTRL-H 查询普通模式下 CTRL-H 是干什么的 :h i_CTRL-H 查询插入模式下 CTRL-H 是干什么的 :h i_<Up> 查询插入模式下方向键上是干什么的 :h pattern.txt 正则表达式帮助 :h eval 脚本编写帮助 :h function-list 查看 VimScript 的函数列表 :h windows.txt 窗口使用帮助 :h tabpage.txt 标签页使用帮助 :h +timers 显示对 +timers 特性的帮助 :h :! 查看如何运行外部命令 :h tips 查看 Vim 内置的常用技巧文档 :h set-termcap 查看如何设置按键扫描码 :viusage NORMAL 模式帮助 :exusage EX 命令帮助 :version 显示当前 Vim 的版本号和特性 ############################################################################## # 外部命令 ############################################################################## :!ls 运行外部命令 ls,并等待返回 :r !ls 将外部命令 ls 的输出捕获,并插入到光标后 :w !sudo tee % sudo以后保存当前文件 :call system('ls') 调用 ls 命令,但是不显示返回内容 :!start notepad Windows 下启动 notepad,最前面可以加 silent :sil !start cmd Windows 下当前目录打开 cmd :%!prog 运行文字过滤程序,如整理 json格式 :%!python -m json.tool ############################################################################## # Quickfix 窗口 ############################################################################## :copen 打开 quickfix 窗口(查看编译,grep等信息) :copen 10 打开 quickfix 窗口,并且设置高度为 10 :cclose 关闭 quickfix 窗口 :cfirst 跳到 quickfix 中第一个错误信息 :clast 跳到 quickfix 中最后一条错误信息 :cc [nr] 查看错误 [nr] :cnext 跳到 quickfix 中下一个错误信息 :cprev 跳到 quickfix 中上一个错误信息 ############################################################################## # 拼写检查 ############################################################################## :set spell 打开拼写检查 :set nospell 关闭拼写检查 ]s 下一处错误拼写的单词 [s 上一处错误拼写的单词 zg 加入单词到拼写词表中 zug 撤销上一次加入的单词 z= 拼写建议 ############################################################################## # 代码折叠 ############################################################################## za 切换折叠 zA 递归切换折叠 zc 折叠光标下代码 zC 折叠光标下所有代码 zd 删除光标下折叠 zD 递归删除所有折叠 zE 删除所有折叠 zf 创建代码折叠 zF 指定行数创建折叠 zi 切换折叠 zm 所有代码折叠一层 zr 所有代码打开一层 zM 折叠所有代码,设置 foldlevel=0,设置 foldenable zR 打开所有代码,设置 foldlevel 为最大值 zn 折叠 none,重置 foldenable 并打开所有代码 zN 折叠 normal,重置 foldenable 并恢复所有折叠 zo 打开一层代码 zO 打开光标下所有代码折叠 ############################################################################## # 宏录制 ############################################################################## qa 开始录制名字为 a 的宏 q 结束录制宏 @a 播放名字为 a 的宏 @: 播放上一个宏 ############################################################################## # 其他命令 ############################################################################## CTRL-E 向上卷屏 CTRL-Y 向下卷屏 CTRL-G 显示正在编辑的文件名,以及大小和位置信息 g CTRL-G 显示文件的:大小,字符数,单词数和行数,可视模式下也可用 zz 调整光标所在行到屏幕中央 zt 调整光标所在行到屏幕上部 zb 调整光标所在行到屏幕下部 ga 显示光标下字符的 ascii 码或者 unicode 编码 g8 显示光标下字符的 utf-8 编码字节序 gi 回到上次进入插入的地方,并切换到插入模式 K 查询光标下单词的帮助 ZZ 保存文件(如果有改动的话),并关闭窗口 ZQ 不保存文件关闭窗口 CTRL-PgUp 上个标签页,GVim OK,部分终端软件需设置对应键盘码 CTRL-PgDown 下个标签页,GVim OK,部分终端软件需设置对应键盘码 CTRL-R CTRL-W 命令模式下插入光标下单词 CTRL-INSERT 复制到系统剪贴板(GVIM) SHIFT-INSERT 粘贴系统剪贴板的内容(GVIM) :set ff=unix 设置换行为 unix :set ff=dos 设置换行为 dos :set ff? 查看换行设置 :set nohl 清除搜索高亮 :set termcap 查看会从终端接收什么以及会发送给终端什么命令 :set guicursor= 解决 SecureCRT/PenguiNet 中 NeoVim 局部奇怪字符问题 :set t_RS= t_SH= 解决 SecureCRT/PenguiNet 中 Vim8.0 终端功能奇怪字符 :set fo+=a 开启文本段的实时自动格式化 :earlier 15m 回退到15分钟前的文件内容 :.!date 在当前窗口插入时间 :%!xxd 开始二进制编辑 :%!xxd -r 保存二进制编辑 :r !curl -sL {URL} 读取 url 内容添加到光标后 :g/^\s*$/d 删除空行 :g/green/d 删除所有包含 green 的行 :v/green/d 删除所有不包含 green 的行 :g/gladiolli/# 搜索单词打印结果,并在结果前加上行号 :g/ab.*cd.*efg/# 搜索包含 ab,cd 和 efg 的行,打印结果以及行号 :v/./,/./-j 压缩空行 :Man bash 在 Vim 中查看 man,先调用 :runtime! ftplugin/man.vim 激活 /fred\|joe 搜索 fred 或者 joe /\<\d\d\d\d\> 精确搜索四个数字 /^\n\{3} 搜索连续三个空行 ############################################################################## # Plugin - https://github.com/tpope/vim-commentary ############################################################################## gcc 注释当前行 gc{motion} 注释 {motion} 所标注的区域,比如 gcap 注释整段 gci{ 注释大括号内的内容 gc 在 Visual Mode 下面按 gc 注释选中区域 :7,17Commentary 注释 7 到 17 行 ############################################################################## # Plugin - https://github.com/godlygeek/tabular ############################################################################## :Tabularize /, 按逗号对齐 :Tabularize /= 按等于号对齐 :Tabularize /\| 按竖线对齐 :Tabularize /\|/r0 按竖线靠右对齐 ############################################################################## # Plugin - https://github.com/tpope/vim-unimpaired ############################################################################## [space 向上插入空行 ]space 向下插入空行 [e 替换当前行和上一行 ]e 替换当前行和下一行 [x XML 编码 ]x XML 解码 [u URL 编码 ]u URL 解码 [y C 字符串编码 ]y C 字符串解码 [q 上一个 quickfix 错误 ]q 下一个 quickfix 错误 [Q 第一个 quickfix 错误 ]Q 最后一个 quickfix 错误 [f 切换同目录里上一个文件 ]f 切换同目录里下一个文件 [os 设置 :set spell ]os 设置 :set nospell =os 设置 :set invspell [on 显示行号 ]on 关闭行号 [ol 显示回车和制表符 :set list ]ol 不显示回车和制表符 :set nolist [b 缓存切换到上一个文件,即 :bp ]b 缓存切换到下一个文件,即 :bn [B 缓存切换到第一个文件,即 :bfirst ]B 缓存切换到最后一个文件,即 :blast ############################################################################## # Plugin - https://github.com/skywind3000/asyncrun.vim ############################################################################## :AsyncRun ls 异步运行命令 ls 结果输出到 quickfix 使用 :copen 查看 :AsyncRun -raw ls 异步运行命令 ls 结果不匹配 errorformat ############################################################################## # Plugin - https://github.com/gaving/vim-textobj-argument ############################################################################## cia 改写函数参数 caa 改写函数参数(包括逗号分隔) dia 删除函数参数 daa 删除函数参数(包括逗号分隔) via 选取函数参数 vaa 选取函数参数(包括逗号分隔) yia 复制函数参数 yaa 复制函数参数(包括逗号分隔) ############################################################################## # 网络资源 ############################################################################## 最新版本 https://github.com/vim/vim Windows 最新版 https://github.com/vim/vim-win32-installer/releases 插件浏览 http://vimawesome.com reddit https://www.reddit.com/r/vim/ 正确设置 ALT/BS 键 http://www.skywind.me/blog/archives/2021 视频教程 http://vimcasts.org/ 中文帮助 http://vimcdoc.sourceforge.net/doc/help.html 中文版入门到精通 https://github.com/wsdjeg/vim-galore-zh_cn 五分钟脚本入门 http://andrewscala.com/vimscript/ 脚本精通 http://learnvimscriptthehardway.stevelosh.com/ 中文脚本帮助 vimcdoc.sourceforge.net/doc/eval.html 十六年使用经验 http://zzapper.co.uk/vimtips.html 配色方案 http://vimcolors.com/ ############################################################################## # TIPS ############################################################################## - 永远不要用 CTRL-C 代替 <ESC> 完全不同的含义,容易错误中断运行的后台脚本 - 很多人使用 CTRL-[ 代替 <ESC>,左手小指 CTRL,右手小指 [ 熟练后很方便 - 某些终端中使用 Vim 8 内嵌终端如看到奇怪字符,使用 :set t_RS= t_SH= 解决 - 某些终端中使用 NeoVim 如看到奇怪字符,使用 :set guicursor= 解决 - 多使用 ciw, ci[, ci", ci( 以及 diw, di[, di", di( 命令来快速改写/删除文本 - SHIFT 相当于移动加速键, w b e 移动光标很慢,但是 W B E 走的很快 - 自己要善于总结新技巧,比如移动到行首非空字符时用 0w 命令比 ^ 命令更容易输入 - 在空白行使用 dip 命令可以删除所有临近的空白行,viw 可以选择连续空白 - 缩进时使用 >8j >} <ap >ap =i} == 会方便很多 - 插入模式下,当你发现一个单词写错了,应该多用 CTRL-W 这比 <BackSpace> 快 - y d c 命令可以很好结合 f t 和 /X 比如 dt) 和 y/end<cr> - c d x 命令会自动填充寄存器 "1 到 "9 , y 命令会自动填充 "0 寄存器 - 用 v 命令选择文本时,可以用 o 掉头选择,有时很有用 - 写文章时,可以写一段代码块,然后选中后执行 :!python 代码块就会被替换成结果 - 搜索后经常使用 :nohl 来消除高亮,使用很频繁,可以 map 到 <BackSpace> 上 - 搜索时可以用 CTRL-R CTRL-W 插入光标下的单词,命令模式也能这么用 - 映射按键时,应该默认使用 noremap ,只有特别需要的时候使用 map - 当你觉得做某事很低效时,你应该停下来,u u u u 然后思考正确的高效方式来完成 - 用 y复制文本后,命令模式中 CTRL-R 然后按双引号 0 可以插入之前复制内容 - Windows 下的 GVim 可以设置 set rop=type:directx,renmode:5 增强显示 ############################################################################## # References ############################################################################## https://github.com/groenewege/vimrc/blob/master/vim_cheat_sheet.txt http://blog.g-design.net/post/4789778607/vim-cheat-sheet http://www.keyxl.com/aaa8263/290/VIM-keyboard-shortcuts.htm http://jmcpherson.org/editing.html http://www.fprintf.net/vimCheatSheet.html http://www.ouyaoxiazai.com/article/24/654.html http://bbs.it-home.org/thread-80794-1-1.html http://www.lpfrx.com/wp-content/uploads/2008/09/vi.jpg http://michael.peopleofhonoronly.com/vim/ https://github.com/hobbestigrou/vimtips-fortune/blob/master/fortunes/vimtips https://github.com/glts/vim-cottidie/blob/master/autoload/cottidie/tips # vim: set ts=4 sw=4 tw=0 noet noautoindent fdm=manual : ############################################################################## # ADB CHEATSHEET (中文速查表) - by baiguangan (created on 2018/03/2) # Version: 1, Last Modified: 2018/03/2 9:13 # https://github.com/skywind3000/awesome-cheatsheets ############################################################################## ############################################################################## # 常用命令 ############################################################################## devices # 查看已连接的设备 start-server # 启动 adb server kill-server # 停止 adb server logcat # 查看日志 install # 安装一个apk uninstall # 卸载一个apk shell # 进入终端 ############################################################################## # 其他命令 ############################################################################## help # 查看帮助信息 version # 查看版本 devices # 查看已连接的设备 forward # 端口转发 bugreport # 生成adb出错报告 install # 安装一个apk uninstall # 卸载一个apk disconnect # 断开设备 tcpip # 侦听端口 connect # 连接设备 start-server # 启动 adb server kill-server # 停止 adb server logcat # 查看日志 reboot # 重启 push # 上传 pull # 下载 remount # 提权 get-serialno # 获取序列号 shell # 进入终端 shell screencap # 屏幕截图 shell screenrecord # 录制视频 shell pm list packages # 列出手机装的所有app的包名 shell pm list packages -s # 列出系统应用的所有包名 shell pm list packages -3 # 列出第三方应用的所有包名 shell pm clear # 清除应用数据与缓存 shell am start -n # 启动应用 shell am force-stop # 停止应用 shell am force-stop # 强制停止应用 shell wm size # 查看屏幕分辨率 shell wm density # 查看屏幕密度 ############################################################################## # References ############################################################################## https://developer.android.google.cn/studio/command-line/adb.html ############################################################################## # GDB CHEATSHEET (中文速查表) - by skywind (created on 2018/02/20) # Version: 8, Last Modified: 2018/02/28 17:13 # https://github.com/skywind3000/awesome-cheatsheets ############################################################################## ############################################################################## # 启动 GDB ############################################################################## gdb object # 正常启动,加载可执行 gdb object core # 对可执行 + core 文件进行调试 gdb object pid # 对正在执行的进程进行调试 gdb # 正常启动,启动后需要 file 命令手动加载 gdb -tui # 启用 gdb 的文本界面 ############################################################################## # 帮助信息 ############################################################################## help # 列出命令分类 help running # 查看某个类别的帮助信息 help run # 查看命令 run 的帮助 help info # 列出查看程序运行状态相关的命令 help info line # 列出具体的一个运行状态命令的帮助 help show # 列出 GDB 状态相关的命令 help show commands # 列出 show 命令的帮助 ############################################################################## # 断点 ############################################################################## break main # 对函数 main 设置一个断点,可简写为 b main break 101 # 对源代码的行号设置断点,可简写为 b 101 break basic.c:101 # 对源代码和行号设置断点 break basic.c:foo # 对源代码和函数名设置断点 break *0x00400448 # 对内存地址 0x00400448 设置断点 info breakpoints # 列出当前的所有断点信息,可简写为 info break delete 1 # 按编号删除一个断点 delete # 删除所有断点 clear # 删除在当前行的断点 clear function # 删除函数断点 clear line # 删除行号断点 clear basic.c:101 # 删除文件名和行号的断点 clear basic.c:main # 删除文件名和函数名的断点 clear *0x00400448 # 删除内存地址的断点 disable 2 # 禁用某断点,但是部删除 enable 2 # 允许某个之前被禁用的断点,让它生效 tbreak function|line # 临时断点 ignore {id} {count} # 忽略某断点 N-1 次 condition {id} {expr} # 条件断点,只有在条件生效时才发生 condition 2 i == 20 # 2号断点只有在 i == 20 条件为真时才生效 watch {expr} # 对变量设置监视点 info watchpoints # 显示所有观察点 ############################################################################## # 运行程序 ############################################################################## run # 运行程序 run {args} # 以某参数运行程序 run < file # 以某文件为标准输入运行程序 run < <(cmd) # 以某命令的输出作为标准输入运行程序 run <<< $(cmd) # 以某命令的输出作为标准输入运行程序 set args {args} ... # 设置运行的参数 show args # 显示当前的运行参数 cont # 继续运行,可简写为 c step # 单步进入,碰到函数会进去 step {count} # 单步多少次 next # 单步跳过,碰到函数不会进入 next {count} # 单步多少次 CTRL+C # 发送 SIGINT 信号,中止当前运行的程序 attach {process-id} # 链接上当前正在运行的进程,开始调试 detach # 断开进程链接 finish # 结束当前函数的运行 until # 持续执行直到代码行号大于当前行号(跳出循环) until {line} # 持续执行直到执行到某行 kill # 杀死当前运行的函数 ############################################################################## # 栈帧 ############################################################################## bt # 打印 backtrace frame # 显示当前运行的栈帧 up # 向上移动栈帧(向着 main 函数) down # 向下移动栈帧(远离 main 函数) info locals # 打印帧内的相关变量 info args # 打印函数的参数 ############################################################################## # 代码浏览 ############################################################################## list 101 # 显示第 101 行周围 10行代码 list 1,10 # 显示 1 到 10 行代码 list main # 显示函数周围代码 list basic.c:main # 显示另外一个源代码文件的函数周围代码 list - # 重复之前 10 行代码 list *0x22e4 # 显示特定地址的代码 cd dir # 切换当前目录 pwd # 显示当前目录 search {regexpr} # 向前进行正则搜索 reverse-search {regexp} # 向后进行正则搜索 dir {dirname} # 增加源代码搜索路径 dir # 复位源代码搜索路径(清空) show directories # 显示源代码路径 ############################################################################## # 浏览数据 ############################################################################## print {expression} # 打印表达式,并且增加到打印历史 print /x {expression} # 十六进制输出,print 可以简写为 p print array[i]@count # 打印数组范围 print $ # 打印之前的变量 print *$->next # 打印 list print $1 # 输出打印历史里第一条 print ::gx # 将变量可视范围(scope)设置为全局 print 'basic.c'::gx # 打印某源代码里的全局变量,(gdb 4.6) print /x &main # 打印函数地址 x *0x11223344 # 显示给定地址的内存数据 x /nfu {address} # 打印内存数据,n是多少个,f是格式,u是单位大小 x /10xb *0x11223344 # 按十六进制打印内存地址 0x11223344 处的十个字节 x/x &gx # 按十六进制打印变量 gx,x和斜杆后参数可以连写 x/4wx &main # 按十六进制打印位于 main 函数开头的四个 long x/gf &gd1 # 打印 double 类型 help x # 查看关于 x 命令的帮助 info locals # 打印本地局部变量 info functions {regexp} # 打印函数名称 info variables {regexp} # 打印全局变量名称 ptype name # 查看类型定义,比如 ptype FILE,查看 FILE 结构体定义 whatis {expression} # 查看表达式的类型 set var = {expression} # 变量赋值 display {expression} # 在单步指令后查看某表达式的值 undisplay # 删除单步后对某些值的监控 info display # 显示监视的表达式 show values # 查看记录到打印历史中的变量的值 (gdb 4.0) info history # 查看打印历史的帮助 (gdb 3.5) ############################################################################## # 目标文件操作 ############################################################################## file {object} # 加载新的可执行文件供调试 file # 放弃可执行和符号表信息 symbol-file {object} # 仅加载符号表 exec-file {object} # 指定用于调试的可执行文件(非符号表) core-file {core} # 加载 core 用于分析 ############################################################################## # 信号控制 ############################################################################## info signals # 打印信号设置 handle {signo} {actions} # 设置信号的调试行为 handle INT print # 信号发生时打印信息 handle INT noprint # 信号发生时不打印信息 handle INT stop # 信号发生时中止被调试程序 handle INT nostop # 信号发生时不中止被调试程序 handle INT pass # 调试器接获信号,不让程序知道 handle INT nopass # 调试起不接获信号 signal signo # 继续并将信号转移给程序 signal 0 # 继续但不把信号给程序 ############################################################################## # 线程调试 ############################################################################## info threads # 查看当前线程和 id thread {id} # 切换当前调试线程为指定 id 的线程 break {line} thread all # 所有线程在指定行号处设置断点 thread apply {id..} cmd # 指定多个线程共同执行 gdb 命令 thread apply all cmd # 所有线程共同执行 gdb 命令 set schedule-locking ? # 调试一个线程时,其他线程是否执行,off|on|step set non-stop on/off # 调试一个线程时,其他线程是否运行 set pagination on/off # 调试一个线程时,分页是否停止 set target-async on/off # 同步或者异步调试,是否等待线程中止的信息 ############################################################################## # 进程调试 ############################################################################## info inferiors # 查看当前进程和 id inferior {id} # 切换某个进程 kill inferior {id...} # 杀死某个进程 set detach-on-fork on/off # 设置当进程调用fork时gdb是否同时调试父子进程 set follow-fork-mode parent/child # 设置当进程调用fork时是否进入子进程 ############################################################################## # 汇编调试 ############################################################################## info registers # 打印普通寄存器 info all-registers # 打印所有寄存器 print/x $pc # 打印单个寄存器 stepi # 指令级别单步进入,可以简写为 si nexti # 指令级别单步跳过,可以简写为 ni display/i $pc # 监控寄存器(每条单步完以后会自动打印值) x/x &gx # 十六进制打印变量 info line 22 # 打印行号为 22 的内存地址信息 info line *0x2c4e # 打印给定内存地址对应的源代码和行号信息 disassemble {addr} # 对地址进行反汇编,比如 disassemble 0x2c4e ############################################################################## # 历史信息 ############################################################################## show commands # 显示历史命令 (gdb 4.0) info editing # 显示历史命令 (gdb 3.5) ESC-CTRL-J # 切换到 Vi 命令行编辑模式 set history expansion on # 允许类 c-shell 的历史 break class::member # 在类成员处设置断点 list class:member # 显示类成员代码 ptype class # 查看类包含的成员 print *this # 查看 this 指针 rbreak {regexpr} # 匹配正则的函数前断点,如 ex_* 将断点 ex_ 开头的函数 ############################################################################## # 其他命令 ############################################################################## define command ... end # 定义用户命令 <return> # 直接按回车执行上一条指令 shell {command} [args] # 执行 shell 命令 source {file} # 从文件加载 gdb 命令 quit # 退出 gdb ############################################################################## # GDB 前端 ############################################################################## gdb-tui 使用 gdb -tui 启动 cgdb http://cgdb.github.io/ emacs http://gnu.org/software/emacs gdbgui https://github.com/cs01/gdbgui GDB 图形化前端评测 http://www.skywind.me/blog/archives/2036 ############################################################################## # References ############################################################################## https://sourceware.org/gdb/current/onlinedocs/gdb/ https://kapeli.com/cheat_sheets/GDB.docset/Contents/Resources/Documents/index http://www.yolinux.com/TUTORIALS/GDB-Commands.html https://gist.github.com/rkubik/b96c23bd8ed58333de37f2b8cd052c30 http://security.cs.pub.ro/hexcellents/wiki/kb/toolset/gdb # vim: set ts=4 sw=4 tw=0 noet ft=gdb:
markdown
{ "attributes": { "su": true }, "courseCode": "ID2323", "courseCredit": "4", "description": "This module is specially designed for BA Industrial Design students. This module discusses the physics behind the ordinary objects and natural phenomena all around us. It unravels the mysteries of how things work. From the household appliances that make our lives easier, vehicles that we travel in and to the audio/visual players fill our world with sounds and images.", "faculty": "Design and Environment", "title": "Technology for Design" }
json
export default class Component { constructor(props) { this.props = props; } init() { this.$element = this.render(); this.setObserver(); this.setEvent(); this.didMount(); } getElement() { return this.$element; } setObserver() {} setEvent() {} render() {} didMount() {} unmount() { this.$element.remove(); } reRender() { const $newElement = this.render(); this.$element.replaceWith($newElement); this.$element = $newElement; this.setEvent(); } addEvent(eventType, selector, callback) { const children = [...this.$element.querySelectorAll(selector)]; const isTarget = target => children.includes(target) || target.closest(selector); this.$element.addEventListener(eventType, event => { if (!isTarget(event.target)) return false; callback(event); return true; }); } }
javascript
<reponame>contentstack/syncdata-between-stacks-using-webhooks-and-aws-lambda [{"stackHeaders":{"api_key":"blt9cdaadd4f607287e","authorization":"cs4ced136ef8af14710fa92c17"},"urlPath":"/assets/bltb42a7e7a8be3c7b7","uid":"bltb42a7e7a8be3c7b7","content_type":"image/jpeg","file_size":"129240","tags":[],"filename":"photo-coffe.jpeg","url":"https://images.contentstack.io/v3/assets/blt9cdaadd4f607287e/bltb42a7e7a8be3c7b7/5f92d8872f31d726f73b9c6d/photo-coffe.jpeg","ACL":{},"is_dir":false,"_version":1,"title":"photo-coffe.jpeg","publish_details":[{"environment":"blt1440614432b3d7ad","locale":"en-us","time":"2020-10-23T13:20:08.980Z","user":"blt6c5e398771c3bf8e","version":1}]}]
json
<reponame>charles-halifax/recipes { "directions": [ "Preheat oven to 400 degrees F (200 degrees C).", "Combine ground chuck, bread crumbs, egg, onion soup mix, water, and black pepper in a bowl; press into a 10x15-inch jelly roll pan. Prick holes through the chuck mixture for ventilation while cooking.", "Bake in the preheated oven until browned and cooked through, about 10 minutes. An instant-read thermometer inserted into the center should read at least 160 degrees F (70 degrees C). Drain excess grease.", "Cut chuck mixture into squares the size of the rolls. Place 1 chuck patty in each roll." ], "ingredients": [ "1 1/2 pounds ground chuck", "1/3 cup plain bread crumbs", "1 egg", "1 (1 ounce) package dry onion soup mix", "2 tablespoons water", "1/2 teaspoon ground black pepper", "24 small square dinner rolls" ], "language": "en-US", "source": "allrecipes.com", "tags": [], "title": "Almost White Castle\u00ae Hamburgers", "url": "http://allrecipes.com/recipe/242427/almost-white-castle-hamburgers/" }
json
<filename>ditto/src/main/java/eu/xenit/testing/ditto/util/Assert.java<gh_stars>0 package eu.xenit.testing.ditto.util; public class Assert { private Assert() { // do not instantiate } public static void hasText(String text, String message) { if (!StringUtils.hasText(text)) { throw new IllegalArgumentException(message); } } }
java
In this Thiru Vi Ka Poonga film, John Vijay, Kadhal Dhandapani played the primary leads. The Thiru Vi Ka Poonga was released in theaters on 02 Jan 2015. Movies like Demonte Colony 2, Vidaamuyarchi, Thangalaan and others in a similar vein had the same genre but quite different stories. The soundtracks and background music were composed by Praveen Mirra for the movie Thiru Vi Ka Poonga. The movie Thiru Vi Ka Poonga belonged to the Drama,Romance, genre.
english
Actor Tiger Shroff says he would like to work with the National-Award winning filmmaker Omung Kumar in a film. He was interacting with media when he attended a charity event where Omung unveiled a hand painted animal calendar. Tiger said: "I have had the opportunity to meet Omung (Kumar) sir at very few occasions actually. He has been the art director of Star Screen Awards as well and that's where first time, I met him. "I also had the chance to go and meet him at his office or at my home discussing various scripts so, very soon hopefully we would like to work together in a film and I am looking forward to that day." Talking about Omung's initiative where he unveiled a hand painted animal calendar and the revenues of which will be directed towards the betterment of animals, Tiger said: "I really salute Omung sir for doing this. For animals, I will do anything as per my capacity so, there isn't any better way to be associated with Omung sir's initiative." The "Baaghi" actor also talked about human being's habit of trespassing forest land because of which forest animals are moving towards residential areas. "It's really sad and it is something that has been happening from long time and it's very rampant all over the world so, we should do our part by planting trees wherever and whenever we can," he said. Tiger will next be seen in Punit Malhotra's "Student of The Year 2" along with Tara Sutaria and Ananya Pandey in lead roles. The film is distributed by Fox Star Studios and produced by Karan Johar, Hiroo Yash Johar and Apoorva Mehta under the banner of Dharma Productions. It is set to release on May 10, 2019. 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>**Leaflet-Step-1**/static/css/style.css body { padding: 0; margin: 0; } .legend { line-height: 20px; color: #555; background-color: white; padding: 6px; border-radius: 5px; font-weight: bold; opacity: 0.9; } .legend i { width: 18px; height: 18px; float: left; margin-right: 12px; opacity: 0.8; } p.m-top { margin-top: 1px; } #map, body, html { height: 100%; }
css
There are many series and movies in Hindi that are adapted from popular Amercian and even other language shows. Check out the six Indian series that are adapted from British series. Available on Disney Plus Hotstar, Ajay Devgn's OTT debut series Rudra: The Edge of Darkness is a remake of popular British show Luther. Who doesn't know the popular series The Office? Did you know we have our own version of The Office? It is available on Disney Plus Hotstar. Available to watch on Disney Plus Hotstar, Dead Pixels is a Telugu language series which is adapted from a British series from 2019. Criminal Justice starring Vikrant Massey and Pankaj Tripathi is adapted from the British show of the same name. It is available to watch on Disney Plus Hotstar. The Sonali Bendre starrer The Broken News series which also stars Jaideep Ahlawat. The series is a remake of the 2018 series Press. Tom Hiddleston's popular British show The Night Manager was remade in Hindi with the same name starring Anil Kapoor and Aditya Roy Kapur. It is available to stream on Disney Plus Hotstar.
english
package uk.org.tombolo.recipe; import java.util.List; public class AttributeMatcher { public final String provider; public final String label; public final List<String> values; public AttributeMatcher(String provider, String label, List<String> values) { this.provider = provider; this.label = label; this.values = values; } }
java
{% extends 'base.html' %} {% load staticfiles %} {% block content %} <br> <div class="row"> <div class="col-md-12 text-center"> <a href="/address-details?clear=true" class="btn btn-primary">Send Another Letter <span class="glyphicon glyphicon-circle-arrow-right" aria-hidden="true"></span></a> </div> </div> <div class="row"> <div class="col-md-12"> <div class="card"> <h3 class="card-header primary-color white-text">Your Orders</h3> <ul> {% for order in orders %} <li class="card-block"> <div class="row"> <div class="col-xs-6 col-md-2 no-margin"> <p><strong>From:</strong></p> <p>{{order.sender_name}}</p> {% if order.sender_unit %} <p>{{order.sender_unit}}</p> {% endif %} <p>{{order.sender_street_number}} {{order.sender_route}}</p> <p>{{order.sender_locality}}, {{order.sender_state}} {{order.sender_postal_code}}</p> </div> <div class="col-xs-6 col-md-2 no-margin"> <p><strong>To:</strong></p> <p>{{order.recipient_name}}</p> {% if order.recipient_unit %} <p>{{order.recipient_unit}}</p> {% endif %} <p>{{order.recipient_street_number}} {{order.recipient_route}}</p> <p>{{order.recipient_locality}}, {{order.recipient_state}} {{order.recipient_postal_code}}</p> </div> <div class="col-xs-12 hidden-md hidden-lg"> <hr> </div> <div class="col-xs-4 col-md-2"> <p class="text-center"><strong>Payment:</strong></p> <h3 class="text-green text-center"><i class="glyphicon glyphicon-ok-circle"></i></h3> </div> <div class="col-xs-4 col-md-2"> <p class="text-center"><strong>Printed:</strong></p> <h3 class="text-center"><i class="glyphicon {% if order.printed == True %} text-green glyphicon-ok-circle {% else %} text-muted glyphicon-time {% endif %}"></i></h3> </div> <div class="col-xs-4 col-md-2"> <p class="text-center"><strong>Delivered to USPS:</strong></p> <h3 class="text-center"><i class="glyphicon {% if order.delivered_to_post_office == True %} text-green glyphicon-ok-circle {% else %} text-muted glyphicon-time {% endif %}"></i></h3> </div> <div class="col-xs-12 col-md-1"> <button data-toggle="collapse" class="btn btn-primary" data-target="#letter-{{ forloop.counter }}">View Letter</button> </div> </div> <div class="row"> <div class="col-lg-offset-2 col-lg-8"> <div id="letter-{{ forloop.counter }}" class="collapse"> <br> <div class="panel panel-default"> <div class="panel-body"> {{order.letter|safe}} </div> </div> </div> </div> </div> </li> <hr> {% endfor %} </ul> </div> </div> </div> {% endblock %}
html
{ "main": "org.vertx.mods.CouchbasePersistor", "worker": true, "multi-threaded": true, "description":"Couchbase persistor module for Vert.x", "licenses": ["The Apache Software License Version 2.0"], "author": "jmusacchio", "keywords": ["couchbase", "couchbasedb", "database", "databases", "persistence", "json", "nosql"], "homepage": "https://github.com/jmusacchio/mod-couchbase-persistor" }
json
{ "name": "egil/php-markdown-extra-extended", "type": "library", "description": "PHP Markdown Extra Extended", "homepage": "https://github.com/egil/php-markdown-extra-extended", "keywords": ["markdown"], "license": "MIT", "require": { "php": ">=5.3" }, "autoload": { "files": ["markdown.php", "markdown_extended.php"] } }
json
{ "id": 828, "info": { "name": "Website: cleaner - newegg.com", "description": "This is a very simple style mod that removes all of the top, side, and bottom ads/banners\r\nfrom newegg.com, giving more screen real estate for browsing items, etc. Now--of course, there\r\nmay be a few \"hot deals\" in those ad banners that you'll miss out on...but I've never found\r\nany. This is probably not a very useful style, but there's a few people who may appreciate it.\r\n\r\nI also use adblock+, so keep that in mind if you still see ads.", "additionalInfo": null, "format": "uso", "category": "newegg", "createdAt": "2006-08-18T23:12:43.000Z", "updatedAt": "2006-08-18T23:12:43.000Z", "license": "NO-REDISTRIBUTION", "author": { "id": 635, "name": "SKYY" } }, "stats": { "installs": { "total": 1024, "weekly": 0 } }, "screenshots": { "main": { "name": "828-after.png", "archived": false } }, "discussions": { "stats": { "discussionsCount": 0, "commentsCount": 0 }, "data": [] }, "style": { "css": "/* SKYY's newegg cleaner */\r\n\r\n@namespace url(http://www.w3.org/1999/xhtml);\r\n\r\n@-moz-document domain(newegg.com)\r\n{\r\n\r\n[id=\"bottomAd1\"],[id=\"bannerAd1\"],[id=\"awards\"],[id=\"rightArea\"],[id=\"promotion\"]\r\n{\r\n\tdisplay: none !important;\r\n}\r\n\r\n}" } }
json
Punjab’s first ever art festival, the Punjab Art Initiative started its concluding week with an art competition for children of the Tricity area. It saw over 450 students from the Tricity area of Chandigarh, Mohali & Panchkula participate in the VR Punjab – ‘Artfile’ inter school art competition at the VR Punjab Amphitheatre. The theme for the art contest was ‘Helping Others’, a conscious effort to sensitise children and encourage them to develop empathy. “The theme and the Children Art Competition was truly a fun way of ‘Connecting Communities’ with art amongst our most important VIPs – children and we hope to see more of these master artists in the making at VR Punjab” said Jonathan Yach, Director Operations, Virtuous Retail. The contest was run for 3 age groups – Below 8years, 8-12 years and 12 &16 yrs. Each group had a gold, silver and bronze winner as well as runner up medalists. Prizes were awarded to 24 children who went home happy with their winner’s haul of medals. Each child also received a Participation certificate along with their Art supply kit. Judges included Anand Shende, Rajender Kumar, Pramod Arya, Vandana Shukla, Prof. Jagtej & Neepa Sharma who worked hard to judge the 473 entries. The running trophy was a tie won by St Kabir School, Chandigarh & St. Josephs Senior Secondary School, Chandigarh.
english
The Manpreet Singh-led Indian men’s hockey team will aim to get past Great Britain in the quarterfinals of the Olympic Games on Sunday and secure a last-four berth, which has eluded them since the 1980 Moscow Olympic Games where the team led by V. Baskaran had won the eighth gold medal for the country. Great Britain qualified for the quarterfinals on the back of two wins, two draws and a loss in their Pool B encounters. Barring the disappointment against Australia (1-7) in their second game in Pool A, India did well to finish second in their group with wins against New Zealand (3-2), Spain (3-0), Argentina (3-1) and Japan (5-3). Reid believes India will need to carry forward the momentum from these wins into the quarterfinals. “When you look at our performances in the last four-five games, apart from the Australian one which was really a disappointing result, the rest have been about building performance levels. “I think we are reasonably happy with how things have gone. Friday’s game against Japan was really about trying to increase the tempo so that we can be hitting our straps during the quarterfinals. Objective was really to be playing at that level. I think Japan played very well, I thought we played a higher, faster tempo. That’s what we are going to need to have to play against Great Britain,” added the 56-year-old Australian.
english
<filename>NexService/src/main/java/com/nexcloud/tsdb/adapter/HostDockerAdapter.java /* * Copyright 2019 NexCloud Co.,Ltd. * * 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.nexcloud.tsdb.adapter; public interface HostDockerAdapter { public String getDockerCpuUsedByContainerId (String clusterId, String hostIp, String containerId, String startTime, String time, int limit); public String getDockerCpuUsedByTaskId (String clusterId, String hostIp, String taskId, String startTime, String time, int limit); public String getDockerMemoryAllocateByContainerId (String clusterId, String hostIp, String containerId, String startTime, String time, int limit); public String getDockerMemoryUsedByteByContainerId (String clusterId, String hostIp, String containerId, String startTime, String time, int limit); public String getDockerMemoryUsedByteByTaskId (String clusterId, String hostIp, String taskId, String startTime, String time, int limit); public String getDockerMemoryUsedPercentByContainerId (String clusterId, String hostIp, String containerId, String startTime, String time, int limit); public String getDockerMemoryUsedPercentByTaskId (String clusterId, String hostIp, String taskId, String startTime, String time, int limit); public String getDockerDiskioReadByContainerId (String clusterId, String hostIp, String containerId, String startTime, String time, int limit); public String getDockerDiskioReadByTaskId (String clusterId, String hostIp, String taskId, String startTime, String time, int limit); public String getDockerDiskioWriteByContainerId (String clusterId, String hostIp, String containerId, String startTime, String time, int limit); public String getDockerDiskioWriteByTaskId (String clusterId, String hostIp, String taskId, String startTime, String time, int limit); public String getDockerNetworkRxbyteByContainerId (String clusterId, String hostIp, String containerId, String startTime, String time, int limit); public String getDockerNetworkRxdropByContainerId (String clusterId, String hostIp, String containerId, String startTime, String time, int limit); public String getDockerNetworkRxerrorByContainerId (String clusterId, String hostIp, String containerId, String startTime, String time, int limit); public String getDockerNetworkRxpacketByContainerId (String clusterId, String hostIp, String containerId, String startTime, String time, int limit); public String getDockerNetworkTxbyteByContainerId (String clusterId, String hostIp, String containerId, String startTime, String time, int limit); public String getDockerNetworkTxdropByContainerId (String clusterId, String hostIp, String containerId, String startTime, String time, int limit); public String getDockerNetworkTxerrorByContainerId (String clusterId, String hostIp, String containerId, String startTime, String time, int limit); public String getDockerNetworkTxpacketByContainerId (String clusterId, String hostIp, String containerId, String startTime, String time, int limit); public String getDockerNetworkRxbyteByTaskId (String clusterId, String hostIp, String taskId, String startTime, String time, int limit); public String getDockerNetworkRxdropByTaskId (String clusterId, String hostIp, String taskId, String startTime, String time, int limit); public String getDockerNetworkRxerrorByTaskId (String clusterId, String hostIp, String taskId, String startTime, String time, int limit); public String getDockerNetworkRxpacketByTaskId (String clusterId, String hostIp, String taskId, String startTime, String time, int limit); public String getDockerNetworkTxbyteByTaskId (String clusterId, String hostIp, String taskId, String startTime, String time, int limit); public String getDockerNetworkTxdropByTaskId (String clusterId, String hostIp, String taskId, String startTime, String time, int limit); public String getDockerNetworkTxerrorByTaskId (String clusterId, String hostIp, String taskId, String startTime, String time, int limit); public String getDockerNetworkTxpacketByTaskId (String clusterId, String hostIp, String taskId, String startTime, String time, int limit); }
java
# RAISR A Python implementation of [RAISR](http://ieeexplore.ieee.org/document/7744595/) ## How To Use ### Prerequisites You need Python 3.x, older versions don't work out-of-the-box. You can install most of the following packages using [pip](https://pypi.python.org/pypi/pip). It is also important to have a 64 bit version of Python 3.x * [OpenCV-Python](https://pypi.python.org/pypi/opencv-python) * [NumPy](http://www.numpy.org/) * [SciPy](https://www.scipy.org/) * [Python Imaging Library (PIL)](http://www.pythonware.com/products/pil/) * [Matplotlib](https://matplotlib.org/) * [scikit-image](http://scikit-image.org/) ### Training Put your training images in the `train` directory. The training images are the **high resolution (HR)** ones. Run the following command to start training. ``` python train.py ``` In the training stage, the program virtually downscales the high resolution images. The program then trains the model using the downscaled version images and the original HR images. The learned filters `filter.p` will be saved in the root directory of the project. The result Q, V matrix (`q.p` and `v.p`) will also be saved for further retraining. To train an improved model with your previous Q, V, use the following command. ``` python train.py -q q.p -v v.p ``` ### Testing Put your testing images in the `test` directory. Basically, you can use some **low resolution (LR)** images as your testing images. By running the following command, the program takes `filter.p` generated by training as your default filters. ``` python test.py ``` The result (HR version of the testing images) will be saved in the `results` directory. To use an alternative filter file, take using the pretrained `filters/filter_BSDS500` for example, use the following command. ``` python test.py -f filters/filter_BSDS500 ``` ## Visualization Visualing the learned filters ``` python train.py -p ``` Visualing the process of RAISR image upscaling ``` python test.py -p ``` For more details, use the help command argument `-h`. ## Testing Results Comparing between original image, bilinear interpolation and RAISR: | Origin | Bilinear Interpolation | RAISR | |:----------------------:|:----------------------:|:----------------------:| |![origin_gray_crop bmp](https://user-images.githubusercontent.com/12198424/27002908-28a69cf2-4e1f-11e7-954d-1135950cd760.png)|![cheap_crop bmp](https://user-images.githubusercontent.com/12198424/27002909-28a7834c-4e1f-11e7-875e-30bb4eaaa0d3.png)|![raisr_gray_crop bmp](https://user-images.githubusercontent.com/12198424/27002910-28ae90f6-4e1f-11e7-83e5-3e63ca07b308.png)| Other results using images taken from [BSDS500 database](https://www2.eecs.berkeley.edu/Research/Projects/CS/vision/grouping/resources.html) and [ArTe-Lab 1D Medium Barcode Dataset](http://artelab.dista.uninsubria.it/downloads/datasets/barcode/medium_barcode_1d/medium_barcode_1d.html): | Origin | RAISR | |:-------------:|:-------------:| |![origin_crop bmp](https://user-images.githubusercontent.com/12198424/27002925-81cf7f88-4e1f-11e7-8a75-4975db1d37b8.png)|![raisr_crop bmp](https://user-images.githubusercontent.com/12198424/27002926-81d126b2-4e1f-11e7-8814-f2fce323caac.png)| |![origin_crop bmp](https://user-images.githubusercontent.com/12198424/27002932-a39f6cc2-4e1f-11e7-9dea-3aa79a9d9764.png)|![raisr_crop bmp](https://user-images.githubusercontent.com/12198424/27002933-a3a248ac-4e1f-11e7-9c81-807d3a5eac90.png)| |![origin_crop bmp](https://user-images.githubusercontent.com/12198424/27002942-c9ba697a-4e1f-11e7-8743-d41be65c09d3.png)|![raisr_crop bmp](https://user-images.githubusercontent.com/12198424/27002943-c9bcefd8-4e1f-11e7-9e55-bf5d93f17a9c.png)| ## Contribute We actively welcome pull requests. Learn how to [contribute](https://github.com/movehand/raisr/blob/master/docs/CONTRIBUTING.md). ## References * <NAME>, <NAME> and <NAME>, "RAISR: Rapid and Accurate Image Super Resolution" in IEEE Transactions on Computational Imaging, vol. 3, no. 1, pp. 110-125, March 2017. * <NAME>, <NAME>, <NAME> and <NAME>, "Contour Detection and Hierarchical Image Segmentation", IEEE TPAMI, Vol. 33, No. 5, pp. 898-916, May 2011. * <NAME>, <NAME> and <NAME>, "Robust Angle Invariant 1D Barcode Detection", Proceedings of the 2nd Asian Conference on Pattern Recognition (ACPR), Okinawa, Japan, 2013 ## License [MIT.](https://github.com/movehand/raisr/blob/master/LICENSE) Copyright (c) 2017 <NAME>
markdown
Mumbai: Despite several attempts by police and administration to prevent road mishaps on festivals, tragic incidents are reported all over the country. In one such incident, an eight-year-old boy who was playing Holi on the road was killed after being knocked down by a taxi that was allegedly being rashly driven in Mumbai’s Bandra. The minor was killed on the spot and the taxi ran over three other people who were on a morning walk. The three were severely injured during the collision. The driver of the taxi, identified as Sunil Kumar Rajput claimed that he lost control of the car and hit the people. The child, identified as Gaffar Chowdhary was playing Holi on the sidewalk when the taxi hit him. He died on the spot before getting any medical attention. Locals following the incident nabbed the driver and handed him to the police. The driver was said to be under the influence of alcohol during the incident and was allegedly driving without a valid licence. The person has been arrested and the car has also been seized.
english
;(function (global) { (typeof define !== 'undefined' && define.amd && !define(function () { return extend; })) || (typeof module !== 'undefined' && (module.exports = extend)) || (global.extend = extend); var toString = Object.prototype.toString; var pSlice = Array.prototype.slice; function isObject(obj, isPlain) { return obj == null ? false : typeof obj !== 'object' ? false : !isPlain ? true : toString.call(obj) === '[object Object]' && obj.constructor === Object; } function isPlainObject(obj) { return isObject(obj, true) && obj.nodeType === void 0 && obj.window === void 0; } function extend() { var target; var deep = arguments[0] === true; var index = 1; var targetIsArray; target = typeof arguments[0] === 'boolean' ? ++index && arguments[1] : arguments[0]; !(isObject(target) || typeof target === 'function') && (target = {}); arguments.length <= 1 && !(index = 0) && (target = this); targetIsArray = Array.isArray(target); return arguments.length === 0 ? target : pSlice.call(arguments, index).reduce(function (target, obj) { if (obj == null || !isObject(obj) || !(isPlainObject(obj) || Array.isArray(obj))) { return target; } Object.keys(obj).reduce(function (target, key) { var value = obj[key]; if (value === void 0 || value === target) { return target; } if (!deep || !isObject(value)) { if (targetIsArray) { target.push(value); } else { target[key] = value; } } else { var data = Array.isArray(value) ? Array.isArray(target[key]) ? target[key] : [] : isPlainObject(value) ? isPlainObject(target[key]) ? target[key] : {} : {}; target[key] = extend(true, data, value); } return target; }, target); return target; }, target); } })(this);
javascript
- 3 hrs ago 5 Best Microwave Ovens For Your Kitchen: Deals To Consider As Amazon Sale 2023 Is Nearing! - Travel Have you been to Vishveshwaraya Falls in Mandya yet? If not, this is the best time! Winter brings in chilly breezes and high electricity bills freezing life to the indoors. You don't want to use your study because it is too cold. You don't like to move around your home because it is freezing. While modern houses are mostly equipped with efficient heating gear to warm your living room and bedrooms, there are instances wherein you might look for an alternative to stay warm without having to rely on the heating system. Finding natural ways to keep your home warm isn't tough. Though the central heating system might have kept you cozy when you fall asleep in your bed, it brings along a massive roof high power bill that you need to clear on time to stay warm in the next month too. On the contrary, simple techniques can aid you in taking control on the extreme cold conditions without paying too much. What do you get? A cozy, warm and comfortable home to live in during winters. There are many natural ways that may help you stay warm and comfortable in winter. All you need to know are few simple basics, and you are good to go. You can warm up the atmosphere in your home quite easily and cut out the cold snap. Use these natural ways to make your home warm and beat the blues of the winter season. Easy and Natural Ways To Keep Your Home Warm During Winters: To keep your home warm during winters, you need to use the right type of curtains. This is one of the major home tips you should know. Identify the windows that let sunlight in and use only thin or clear curtains. Use thick curtains for other windows. It is important that you move your furniture away from windows and doors. This is one of the natural ways for home warming that will help you stay cozy and comfortable without turning on your heater. Keep the furniture away from damp corners. Fireplaces have the tendency to collect all the heat from its surroundings and throwing it away from the chimney. Though you may be a bit warm when it is burning, but when it's off, you will be left with a cold room. This home improvement technique is quite simple! To stay warm, you need to seal all the windows and doors, which include storm windows, attic and floor too. They should be air tight and shouldn't allow air to sneak in. There might be a few sunny days in the cold winter. One of the natural ways to keep home warm is to remove any unwanted obstruction around your home, so that it can receive maximum sunlight. If you are looking for natural ways to keep your home warm during winter, then you need as many carpets and rugs as possible. Use them on the floors in your home, especially on the regularly used hallway, dining room, living room and bedrooms. Warm up your living room by adding some throws in warm colours to the couch and other furniture. With this home improvement tip, every time you use the couch, you will surely feel warm and cozy without allowing the winter chills to bother you anymore. One of the natural ways towards a home warm is to light up candles. This simple home improvement tip is not only cheap, but also, easy to implement. Lighting a candle will make the room bright, warm and can definitely cheer up the dull winter atmosphere. - healthMyths vs Facts: Can Cold Weather Make You Sick? - kidsBenefits Of Ragi For Children In Winter: Why Is Ragi Considered The Ultimate Winter Food? - babyWinter Soup For Babies: Benefits And 2 Recipes (Veg & Non-veg) - wellnessBangalore Will Get Colder In The Coming Days: Here’s How You Can Stay Warm! - wellness6 Reasons Why Soup Is The Best Winter Food! - nutritionWhy You Should Eat Apples During Winter Months: 5 Reasons! - skin careAmla For Winter Skincare: 3 Ways To Use It!
english
<filename>node_modules/@alfresco/adf-core/models/file.model.d.ts /*! * @license * Copyright 2016 Alfresco Software, Ltd. * * 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. */ export interface FileUploadProgress { loaded: number; total: number; percent: number; } export interface FileUploadOptions { newVersion?: boolean; newVersionBaseName?: string; parentId?: string; path?: string; } export declare enum FileUploadStatus { Pending = 0, Complete = 1, Starting = 2, Progress = 3, Cancelled = 4, Aborted = 5, Error = 6, Deleted = 7, } export declare class FileModel { readonly id: string; readonly name: string; readonly size: number; readonly file: File; status: FileUploadStatus; progress: FileUploadProgress; options: FileUploadOptions; data: any; constructor(file: File, options?: FileUploadOptions); private generateId(); readonly extension: string; }
typescript
TDP senior politician and AP Seeds Corporation ex-Chairman, AV Subba Reddy escaped a planned murder attempt and police have revealed some shocking facts about the person who tried to kill him. A person Fakir got supari of Rs. 50 lakhs to kill AV Subba Reddy from an unnamed client. He carefully traced AV Subba Reddy's movements and decided to kill him at his Jubilee Hills residence. Before he could execute his plan, he saw Police Patrol van and escaped from the area. After observing some more time, he decided he needs help and he can't pull it off single-handed. So, he hired Rami Reddy and Ravichandra Reddy to help him kill AV Subba Reddy in his Nandyal, Kurnool residence. But before he could plan and execute it, local people reported about their suspicious moments to police and they got caught. Fakir got caught with one gun, 6 bullets, 3. 2 lakhs cash and two phones. He was arrested at Chinna Chauk, Old Bypass road in Kurnool. He revealed that he took Rs. 15 lakhs as advance to kill AV and this is a faction murder planned by politician's rivals. On 12th March, Fakir failed in his attempt in Hyderbad and now, he is caught before he can make second attempt. Soon police will catch the people who planned the murder attempt said Commissioner of Police. Well, AV Subba Reddy is highly lucky, we must say!
english
What's the story? It is natural for those not in favour with WWE's top brass to be blacklisted and have records of their existence expunged forever from the history books. We've seen this treatment meted out to Hulk Hogan, Jimmy 'Superfly' Snuka, Chris Benoit and many more individuals, who do not represent the corporate values of the company, with their despicable actions outside the squared circle. According to a report on Wrestlingnews.co, WWE have removed all traces of another woman. This happens to be first female referee in WWE known as RIta Chatterton/Rita Marie. Rita Chatterton was a referee during the 80s for the promotion, who gained much notoriety after she appeared on Geraldo Rivera's 'Now it can be told' show, smack dab in the middle of WWE's steroid scandal. She claimed that McMahon had sexually assaulted her. Not only was her story discredited by most, Vince and Linda McMahon filed a lawsuit against her and the media company, on grounds of 'severe emotional distress'. The report mentions the Mae Young Classic, where the company named Jessika Carr as the first female referee in the history of WWE. Lita made a passing reference to Carr being the first female referee since the 80s, without mentioning names. It seems that Chatterton is a sore spot for the company and her existence has been wiped out from the history books for good. What's next? We do believe that Carr is on considerably better terms with the company and she will go on to have a long and illustrious career with the company. The record books will show her as a trendsetter. Because Chatterton did not have the same run in the business that Hogan or Snuka did, I doubt anyone will really miss her name in the record books. As for her claims, they have been rubbished by several people over the years, and so I'm led to believe that they were fabricated. She never even filed charges against Vince McMahon!
english
<reponame>Trievo/sia<gh_stars>0 import React from 'react'; import { Switch } from 'react-router-dom'; import ErrorBoundaryRoute from 'app/shared/error/error-boundary-route'; import Ignored from './ignored'; import IgnoredDetail from './ignored-detail'; import IgnoredUpdate from './ignored-update'; import IgnoredDeleteDialog from './ignored-delete-dialog'; const Routes = ({ match }) => ( <> <Switch> <ErrorBoundaryRoute exact path={`${match.url}/new`} component={IgnoredUpdate} /> <ErrorBoundaryRoute exact path={`${match.url}/:id/edit`} component={IgnoredUpdate} /> <ErrorBoundaryRoute exact path={`${match.url}/:id`} component={IgnoredDetail} /> <ErrorBoundaryRoute path={match.url} component={Ignored} /> </Switch> <ErrorBoundaryRoute path={`${match.url}/:id/delete`} component={IgnoredDeleteDialog} /> </> ); export default Routes;
typescript
Jackie Buntan didn’t have the smoothest routes when she began taking the amateur circuit in her home state of California. The Filipino-American star revealed in an interview with Alex Wendling that gaining the proper amateur experience was already an ordeal before even turning professional. Buntan said that fighting more than 20 amateur fights was already an achievement on its own, especially with the limited opportunities she got in Los Angeles. Asked if she would’ve turned professional earlier than she did, Buntan expressed: Buntan tried to get as much experience as she could before turning into the professional circuit, nevertheless, it was a journey that properly prepared her for the toughest challenges on the global stage. The 26-year-old is now one of the best female strikers on the planet and holds an incredible reputation in ONE Championship. Watch Buntan's entire interview below: Much like her amateur career, Jackie Buntan faced tremendous challenges when she arrived at ONE Championship in 2021. Nevertheless, Buntan took the ball and ran with it. The unrelenting striker racked up three straight wins against Nat Jaroonsak, Ekaterina Vandaryeva, and Daniela Lopez. After a hat-trick of victories, Buntan matched up with Smilla Sundell for the inaugural ONE women’s strawweight Muay Thai world title. Buntan, however, fell short against the Swedish sensation and lost via unanimous decision at ONE 156. After her winning streak and world title opportunity were taken away, Buntan bounced back with thrilling victories against Amber Kitchen and Diandra Martin.
english
{ "name": "express-hotmods", "version": "1.0.2", "description": "Reload and use new modules without restarting Express.", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [ "Express", "modules", "middleware", "reload" ], "repository": { "type": "git", "url": "https://github.com/sladec/express-hotmods.git" }, "author": "<NAME> <<EMAIL>>", "license": "MIT" }
json
<filename>data/docs/RTCIceTransport/getSelectedCandidatePair.json { "kind": "Method", "name": "RTCIceTransport.getSelectedCandidatePair", "href": "https://developer.mozilla.org/en-US/docs/Web/API/RTCIceTransport/getSelectedCandidatePair", "description": "The RTCIceTransport method getSelectedCandidatePair() returns an RTCIceCandidatePair object containing the current best-choice pair of ICE candidates describing the configuration of the endpoints of the transport.", "refs": [ { "name": "WebRTC 1.0: Real-time Communication Between Browsers", "href": "https://w3c.github.io/webrtc-pc/#dom-rtcicetransport-getselectedcandidatepair", "description": "RTCIceTransport.getSelectedCandidatePair() - WebRTC 1.0: Real-time Communication Between Browsers" } ] }
json
<filename>src/components/common/protected-route.js import React, { Component } from 'react' import { connect } from 'react-redux' import { Route } from 'react-router-dom' import { isAuthorizedSelector } from '../../ducks/auth' class ProtectedRoute extends Component { render() { const { isAuthorized, component, ...rest } = this.props return <Route {...rest} render={this.getComponent} /> } getComponent = () => { const { isAuthorized, ...rest } = this.props return isAuthorized ? <Route {...rest} /> : <h1>Not Authorized</h1> } } export default connect( (state) => ({ isAuthorized: isAuthorizedSelector(state) }), null, null, { pure: false } )(ProtectedRoute)
javascript
<filename>output/G-INNJ.json {"dna":"G-INNJ","name":"#G-INNJ","description":"Code contributions graph snapshots.","image":"https://codebits.rocks/G-INNJ.png","date":1631521789773,"attributes":[{"trait_type":"Base","value":"Base"},{"trait_type":"1x1","value":"Intermediate"},{"trait_type":"1x2","value":"No Code"},{"trait_type":"2x1","value":"No Code"},{"trait_type":"2x2","value":"Junior"}]}
json
The girl somehow managed to reach her home and inform about the incident. She also revealed the names of the culprits. - Police said that three youths from the same village abducted her. - She later succumbed to burn injuries. - The police have arrested two accused while one managed to escape. By India Today Web Desk: A 15-year-old girl was gangraped and later succumbed to burn injuries after her attackers immolated her in Jharkhand's Chatra district, police said on Friday. Police said that three youths from the same village abducted her when she came out to relieve herself and took her away to an isolated spot where they raped her. After raping the girl, the youths allegedly poured kerosene oil over her and set her on fire. The accused have been identified as Ishrar, Saddam and Sahid Aalam, according to locals. The severely burnt girl somehow managed to reach her home and inform about the incident. She also revealed the names of the culprits. She was admitted to a local hospital, but later succumbed to the burn injuries. The police have arrested two accused while one managed to escape. Bajrang Dal workers on Friday blocked the highway demanding arrest of the third accused and death penalty for all the three. (With IANS inputs)
english
The 2022 NBA Dunk Contest has been widely criticized for not living up to the excitement the contest usually has. For starters, there were no big names in the dunk contest, probably because superstars don’t want to end up getting hurt. Additionally, the dunks lacked creativity and seemed repetitive – not really getting the fans out of their seats. Rich Eisen of “The Rich Eisen Show” sat down with Chris Brockman and TJ Jefferson to debate what measures the NBA could take to fix the contest. Eisen compared the contest to the NFL’s Pro Bowl, which is essentially American Football's version of the NBA's All-Star game. TJ Jefferson raised the point that participants weren’t really known by casual fans and suggested adding an incentive to the dunk contest. Bringing in players like Ja Morant into the dunk contest could really elevate the excitement around it, but Eisen felt otherwise, Eisen then went on to elaborate, saying that as fans, we've basically seen it all when it comes to the NBA All-Star Dunk Contest. The contest had four participants, including Obi Toppin of the New York Knicks, Juan Toscano-Anderson of the Golden State Warriors, Jalen Green of the Houston Rockets and Anthony Cole of the Orlando Magic. Although some of the dunks were hard to perform, they ultimately did not push the envelope in terms of what we've seen. Eisen came up with a suggestion for the NBA regarding the deteriorating Dunk contest. “Or here what’s you do – you just take it and it’s no longer the last thing of the night. Make the three-point shooting contest the last of the night, because that actually is terrific." Is the three-point contest more exciting than the dunk contest? With Steph Curry already having changed the game, making teams and even centers focus more on their three-pointers, that argument by Rich Eisen isn’t way off. In the 2022 edition, Karl Anthony-Towns became the first center in NBA History to win a three-point contest – which was very impressive, and Eisen certainly thought so too. "That is amazing, this is an amazing feat of actual shooting" Another possibility could be to bring in athletes who are not part of the NBA, but have special dunking abilities – and let them battle it out. That keeps the excitement of the dunk contest alive, and the creativity they could bring would be astounding, as that’s what their speciality is. How did Michael Jordan's gambling "habit" taint his image?
english
Note the singular importance given to Tibet in ensuring border security. No other border, nor borders in general, have been mentioned. This is why one must realise the significantly enhanced threat to India’s security in Arunachal Pradesh. There is visible acceleration in the pace of infrastructure development in Tibet, particularly near the India-China border in the Arunachal Pradesh sector. Nyingchi, where Xi visited, is currently a major link in the proposed high-speed railway from Lhasa to Chengdu in Sichuan province. It lies only 15 km from the India-China border. The strategic importance of the rail link in moving troops and materials swiftly to the border in case of an armed conflict should not be underestimated. Nyingchi is important for another reason. It lies close to the bend in the Brahmaputra river at which a gigantic hydropower project is planned. The impact on the flow of water south to India and to Bangladesh is likely to be adverse and there would be severe ecological consequences. The completion of a new bridge over the Brahmaputra, at Nyingchi, was also announced during Xi’s visit, further improving the highway network criss-crossing the plateau. The upgrade of transport infrastructure will also support the large-scale construction work on account of the massive hydro project. A more recent policy involves the setting up of mixed Tibetan and Han settlements on its southern borders, through the grant of various incentives and subsidies. These settlements have not only come up in increasing numbers on the India-China border but also on the China-Nepal and China-Bhutan borders. While the Narendra Modi government has not acknowledged any Chinese encroachment on the Indian side of the border in Arunachal, there are confirmed reports of building of new villages across the border with Nepal and Bhutan. Local Tibetan militia are being raised to assist in border defence and special attention is being paid to their “patriotic education”. After the 1962 war with China, India had moved quickly to encourage new settlements in the sparsely populated border areas of Arunachal. These were settled by reservists from the Army and local people. The government subsidised the provision of rations, established basic medical and educational facilities and extended other services. However, during the first border infrastructure survey that I carried out in the area in 2004, most of these villages had been abandoned and their inhabitants had moved to the lower hills and plains. Over the years, as the memories of 1962 receded and the border appeared to be largely peaceful, the subsidies were withdrawn. In fact, in some of these villages, more recent migrants from across the border in Tibet had set up their homes. Now, we are witnessing China taking up this settlement project seriously while we have allowed the border on our side to become depopulated. This and the other developments will have serious security implications for India. This has been interpreted by Chinese cadres as a policy of “sinicizing” Tibetan Buddhism, by regulating the syllabus for religious education and controlling the recognition of “tulkus” or reincarnations of high lamas. This is clearly a prelude to the naming of the 15th Dalai Lama when the current incumbent has passed away. There is a more insidious aspect of China’s assimilative policies in Tibet – open encouragement of marriages between Han Chinese and Tibetans. One should not ignore the fact that over the years, China has been able to co-opt a number of Tibetans in its assimilation project. These Tibetans have developed personal and professional stakes in upholding and consolidating Chinese rule over Tibet. This co-option has a long history and was already in evidence during the so-called “peaceful liberation” of Tibet in 1951. Those who have benefited from their association with Chinese rule over Tibet are not at all enthusiastic about any reconciliation between the Dalai Lama and the Chinese regime or the possibility of the return of the religious leader to Tibet. The current policy direction on Tibet would suggest that even a feeble prospect of reconciliation, which would suit India best, no longer exists. Therefore, the salience of the Tibet issue in India-China relations has become more direct and explicit. It will further complicate the quest for a new equilibrium in India-China relations. Shyam Saran is a former Foreign Secretary and a Senior Fellow CPR. Views are personal. (Edited by Anurag Chaubey)
english
An own goal by Sumeet Passi doomed East Bengal's fate as ATK Mohun Bagan returned to winning ways by the thinnest of margins in the marquee 'Kolkata Derby' of the Durand Cup. An own goal by Sumeet Passi doomed East Bengal's fate as ATK Mohun Bagan returned to winning ways by the thinnest of margins in the marquee 'Kolkata Derby' of Durand Cup. (Image: Twitter) Kolkata: An own goal by Sumeet Passi doomed East Bengal’s fate as ATK Mohun Bagan returned to winning ways by the thinnest of margins in the marquee ‘Kolkata Derby’ of Durand Cup here on Sunday. Playing in front of a packed crowd of about 70,000, Mohun Bagan went ahead in a freak manner when Liston Colaco’s low flag-kick found Eliandro make a hash of a clearance not being to get a touch and the ball deflected into the net off an onrushing Passi, who was literally blindsided and couldn’t move his body out of line. If anyone was to be blamed, it was the Brazilian forward, who had come down to defend his team’s citadel. The result also revived the 16-time champions’ hopes in the tournament as they secured their first win after a shocking defeat to I-league outfit Rajasthan United and a draw against Mumbai City FC. Mohun Bagan now have four points from three matches in group B and face Indian Navy in their decisive concluding group fixture on September 5. The Kolkata Derby was back at the Salt Lake Stadium for the first time since January 19, 2020 when they last clashed in the I-League. Stephen Constantine’s men could barely hold forte as Mohun Bagan kept up pressure from both flanks during the first 45 minutes. But all their hard work went down the drain due to Eliandro’s indiscretion. It could have been worse for East Bengal who almost conceded a second in the 54th minute but Kamaljit Singh fisted away a sure shot goal from star India midfielder Ashique Kuruniyan. East Bengal came out with a more attacking intent in the second-half but there was little support for their Brazilian forward Eliandro, while their long ball strategy was easily dealt by the Mariners. A 64 per cent first-half possession underlined the Mariners dominating display up front as they controlled the match playing deep into the box. But credit should be given to the newly-formed East Bengal line-up under the former Indian coach as they held the Mariners with their resolute defence helmed superbly by Spanish centre-back Ivan Gonzalez. Charis Kyriakou was also good, while Lalchungnunga was at his resolute best as they did nothing wrong till that split of second lapse by Passi. East Bengal slowly tried to get into the game after the half an hour mark and got their first shot at goal from a powerful Gonzalez long ranger that narrowly missed the target. Soon they further raided the Mohun Bagan half with a counter-attacking move generated by Eliandro from the left but the three-man attack failed to get past the Mohun Bagan defence. Tempers flared up soon after the changeover when the young Asish Rai swung his arm on Gonzalez only to escape with a yellow card. Former India U-17 World Cupper Aniket Jadhav’s shot in the 49th minute but the missed the direction. East Bengal are now yet to win in a derby since securing a 2-0 victory in the I-League on January 27, 2019.
english
{ "bad":false, "conda-forge.yml":{}, "feedstock_name":"google-cloud-webrisk", "hash_type":"sha256", "meta_yaml":{ "about":{ "description":"Web Risk API is a Google Cloud service that lets client applications check URLs against Google's constantly updated lists of unsafe web resources. Unsafe web resources include social engineering sites such as phishing and deceptive sites and sites that host malware or unwanted software. With the Web Risk API, you can quickly identify known bad sites, warn users before they click infected links, and prevent users from posting links to known infected pages from your site. The Web Risk API includes data on more than a million unsafe URLs and stays up to date by examining billions of URLs each day.\nSee the [quick start guide](https://cloud.google.com/web-risk/docs/quickstart).", "dev_url":"https://github.com/googleapis/python-webrisk", "doc_url":"https://googleapis.dev/python/webrisk/latest/index.html", "home":"https://github.com/googleapis/python-webrisk", "license":"Apache-2.0", "license_family":"Apache", "license_file":"LICENSE", "summary":"Google Cloud Web Risk API client library" }, "build":{ "noarch":"python", "number":"0", "script":"-m pip install . --no-deps -vv" }, "extra":{ "recipe-maintainers":[ "parthea", "parthea", "parthea" ] }, "package":{ "name":"google-cloud-webrisk", "version":"0.3.0" }, "requirements":{ "host":[ "python", "pip >=18.1", "python", "pip >=18.1", "python", "pip >=18.1" ], "run":[ "python", "google-api-core-grpc >=1.14.0,<2.0.0dev", "python", "google-api-core-grpc >=1.14.0,<2.0.0dev", "python", "google-api-core-grpc >=1.14.0,<2.0.0dev" ] }, "source":{ "sha256":"1dee50964303c4e2b9e13b9ddd7ff72a80be3dac04c725e9d051692d715b37a3", "url":"https://pypi.io/packages/source/g/google-cloud-webrisk/google-cloud-webrisk-0.3.0.tar.gz" }, "test":{ "imports":[ "grpc", "google.cloud.webrisk_v1", "grpc", "google.cloud.webrisk_v1", "grpc", "google.cloud.webrisk_v1" ] } }, "name":"google-cloud-webrisk", "new_version":"0.3.0", "raw_meta_yaml":"{% set name = \"google-cloud-webrisk\" %}\n{% set version = \"0.3.0\" %}\n{% set sha256 = \"1dee50964303c4e2b9e13b9ddd7ff72a80be3dac04c725e9d051692d715b37a3\" %}\n\npackage:\n name: {{ name|lower }}\n version: {{ version }}\n\nsource:\n url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz\n sha256: {{ sha256 }}\n\nbuild:\n number: 0\n noarch: python\n script: {{ PYTHON }} -m pip install . --no-deps -vv\n\nrequirements:\n host:\n - python\n - pip >=18.1\n run:\n - python\n - google-api-core-grpc >=1.14.0,<2.0.0dev\n\ntest:\n imports:\n - grpc\n - google.cloud.webrisk_v1\n\nabout:\n home: https://github.com/googleapis/python-webrisk\n license: Apache-2.0\n license_family: Apache\n license_file: LICENSE\n summary: 'Google Cloud Web Risk API client library'\n description: Web Risk API is a Google Cloud service that lets client applications \n check URLs against Google's constantly updated lists of unsafe web resources. Unsafe \n web resources include social engineering sites such as phishing and deceptive sites \n and sites that host malware or unwanted software. With the Web Risk API, you can quickly \n identify known bad sites, warn users before they click infected links, and prevent users \n from posting links to known infected pages from your site. The Web Risk API includes data \n on more than a million unsafe URLs and stays up to date by examining billions of URLs \n each day.\n\n See the [quick start guide](https://cloud.google.com/web-risk/docs/quickstart).\n\n doc_url: https://googleapis.dev/python/webrisk/latest/index.html\n dev_url: https://github.com/googleapis/python-webrisk\n\nextra:\n recipe-maintainers:\n - parthea\n", "req":{ "__set__":true, "elements":[ "google-api-core-grpc", "pip", "python" ] }, "requirements":{ "build":{ "__set__":true, "elements":[] }, "host":{ "__set__":true, "elements":[ "pip", "python" ] }, "run":{ "__set__":true, "elements":[ "google-api-core-grpc", "python" ] }, "test":{ "__set__":true, "elements":[] } }, "strong_exports":false, "total_requirements":{ "build":{ "__set__":true, "elements":[] }, "host":{ "__set__":true, "elements":[ "pip >=18.1", "python" ] }, "run":{ "__set__":true, "elements":[ "google-api-core-grpc >=1.14.0,<2.0.0dev", "python" ] }, "test":{ "__set__":true, "elements":[] } }, "url":"https://pypi.io/packages/source/g/google-cloud-webrisk/google-cloud-webrisk-0.3.0.tar.gz", "version":"0.3.0" }
json
<reponame>shunp/three.js <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <base href="../../../../" /> <script src="list.js"></script> <script src="page.js"></script> <link type="text/css" rel="stylesheet" href="page.css" /> </head> <body> <h1>[name]</h1> <p class="desc"> 该类作为其他阴影类的基类来使用。 </p> <h2>构造函数</h2> <h3>[name]( [param:Camera camera] )</h3> <p> [page:Camera camera] - 在光的世界里<br /><br /> 创建一个新的[name]。这不能直接调用的 - 它由其他阴影用作基类。 </p> <h2>属性</h2> <h3>[property:Camera camera]</h3> <p> 光的世界里。这用于生成场景的深度图;从光的角度来看,其他物体背后的物体将处于阴影中。 </p> <h3>[property:Float bias]</h3> <p> 阴影贴图偏差,在确定曲面是否在阴影中时,从标准化深度添加或减去多少。<br /> 默认值为0.此处非常小的调整(大约0.0001)可能有助于减少阴影中的伪影 </p> <h3>[property:WebGLRenderTarget map]</h3> <p> 使用内置摄像头生成的深度图;超出像素深度的位置在阴影中。在渲染期间内部计算。 </p> <h3>[property:WebGLRenderTarget mapPass]</h3> <p> The distribution map generated using the internal camera; an occlusion is calculated based on the distribution of depths. Computed internally during rendering. </p> <h3>[property:Vector2 mapSize]</h3> <p> 一个[Page:Vector2]定义阴影贴图的宽度和高度。<br /><br /> 较高的值会以计算时间为代价提供更好的阴影质量。值必须是2的幂,直到给定设备的[page:WebGLRenderer.capabilities].maxTextureSize, 虽然宽度和高度不必相同(例如,(512,1024)有效)。 默认值为*(512,512)*。 </p> <h3>[property:Matrix4 matrix]</h3> <p> 模拟阴影相机空间,计算阴影贴图中的位置和深度。存储在[page:Matrix4 Matrix4]中。这是在渲染期间内部计算的。 </p> <h3>[property:Float radius]</h3> <p> 将此值设置为大于1的值将模糊阴影的边缘。<br /> 较高的值会在阴影中产生不必要的条带效果 - 更大的[page:.mapSize mapSize]将允许在这些效果变得可见之前使用更高的值。<br /> If [page:WebGLRenderer.shadowMap.type] is set to [page:Renderer PCFSoftShadowMap], radius has no effect and it is recommended to increase softness by decreasing [page:.mapSize mapSize] instead.<br /><br /> 请注意,如果[page:WebGLRenderer.shadowMap.type]设置为[page:Renderer BasicShadowMap],将会无效。 </p> <h2>方法</h2> <h3>[method:Vector2 getFrameExtents]()</h3> <p> Used internally by the renderer to extend the shadow map to contain all viewports </p> <h3>[method:null updateMatrices]( [param:Light light] )</h3> <p> Update the matrices for the camera and shadow, used internally by the renderer.<br /><br /> light -- the light for which the shadow is being rendered. </p> <h3>[method:Frustum getFrustum]()</h3> <p> Gets the shadow cameras frustum. Used internally by the renderer to cull objects. </p> <h3>[method:number getViewportCount]()</h3> <p> Used internally by the renderer to get the number of viewports that need to be rendered for this shadow. </p> <h3>[method:LightShadow copy]( [param:LightShadow source] )</h3> <p> 将[page:LightShadow source]中的所有属性的值复制到该Light。 </p> <h3>[method:LightShadow clone]()</h3> <p> 克隆与此相同属性的新LightShadow。 </p> <h3>[method:Object toJSON]()</h3> <p> 序列化这个LightShadow。 </p> <h2>源码</h2> <p> [link:https://github.com/mrdoob/three.js/blob/master/src/lights/[name].js src/lights/[name].js] </p> </body> </html>
html
<filename>frontend/screens/Home.tsx import React, {useState, useEffect} from "react"; import {Asset} from "expo-asset"; import {ActivityIndicator, Animated, Dimensions, Platform, StatusBar, StyleSheet, TouchableOpacity} from "react-native"; // @ts-ignore // import { AppLoading } from "expo"; import Album from "../components/ContentComponent"; import {Album as AlbumModel, ContentInfo} from "../components/Model"; import Carousel, {AdditionalParallaxProps, ParallaxImage} from "react-native-snap-carousel"; import {useAppSelector} from "../_helpers/store.hooks"; import {selectImagesUri, selectImgLoading} from "../_reducers/img.reducer"; import {Text, View} from "../components/Themed"; import {loremIpsum} from "react-lorem-ipsum"; import {useDispatch} from "react-redux"; import {imgActions} from "../_actions/img.actions"; import {infoActions} from "../_actions/info.actions"; import {selectContentText, selectInfoLoading} from "../_reducers/info.reducer"; import ContentComponent from "../components/ContentComponent"; import ImageViewer from "react-native-image-zoom-viewer"; import ImageView from "react-native-image-viewing"; export default () => { const imagesLoading = useAppSelector(selectImgLoading) const imagesUri = useAppSelector(selectImagesUri) const infoLoading = useAppSelector(selectInfoLoading) const contentTexts = useAppSelector(selectContentText) const {width: screenWidth, height: screenHeight} = Dimensions.get('window') let carouselRef: Carousel<ParallaxImage> | null; const [ready, setReady] = useState(false); const dispatch = useDispatch(); useEffect(() => { dispatch(imgActions.getAllImages()); dispatch(infoActions.getAllContent()); }, [dispatch]); const [contentList, setContentList] = useState({ activeIndex: 0, carouselItems: imagesUri.map((image, idx) => ( { title: contentTexts[idx].title, description: contentTexts[idx].description, uri: image as unknown as string, feedback: contentTexts[idx].feedback } as ContentInfo ) ) }); console.log('content text ', contentTexts) // if (!ready) { // return <AppLoading />; // } return ( <View style={{flex: 1, height: 'auto', backgroundColor: 'black'}}> <StatusBar barStyle="light-content"/> {imagesLoading ? <ActivityIndicator size="large"/> : <Carousel // layout={'stack'} hasParallaxImages={true} data={contentList.carouselItems} sliderWidth={screenWidth} sliderHeight={screenWidth} slideStyle={{width: screenWidth, height: screenHeight, backgroundColor: 'black'}} itemWidth={screenWidth} itemHeight={screenHeight} // @ts-ignore renderItem={({item, index}: { item: any, index: number }, props: AdditionalParallaxProps) => _renderItem({item, index}, props) } onSnapToItem={index => setContentList({ carouselItems: contentList.carouselItems, activeIndex: index })} // ref={(c) => { // carouselRef = c // }} /> } </View> ); }; const _renderItem = ({item, index}: { item: ContentInfo, index: number }, parallaxProps: AdditionalParallaxProps) => { const content = item as ContentInfo; return ( <View style={{flex: 1, flexGrow: 1}}> <ContentComponent {...{content, index, parallaxProps}} /> </View> ); } // const styles = StyleSheet.create({ // imageContainer: { // // flex: 1, // // height: '50%', // height: Dimensions.get('window').height * 0.7, // marginBottom: Platform.select({ios: 0, android: 1}), // Prevent a random Android rendering issue // backgroundColor: 'white', // borderRadius: 8, // }, // image: { // ...StyleSheet.absoluteFillObject, // resizeMode: 'cover', // }, // });
typescript
<gh_stars>100-1000 { "id": 174159, "info": { "name": "Sonarr V3 Calendar Backgrounds (plus Radarr)", "description": "I find the calendar entries in Sonarr 3 to not be very visible.\r\n\r\nThis style makes them more like the ones in Sonarr 2", "additionalInfo": "Now Radarr compatible too\r\nUpdated to fix changes in Sonarr that broke the style\r\n\r\nAdded regex url.\r\nModify to your own url if the regex fails to match your installation.", "format": "uso", "category": "yourdomain", "createdAt": "2019-08-06T06:08:22.000Z", "updatedAt": "2021-09-28T08:49:52.000Z", "license": "CC0-1.0", "author": { "id": 839050, "name": "<NAME>", "paypalEmail": "<EMAIL>" } }, "stats": { "installs": { "total": 113, "weekly": 0 } }, "screenshots": { "main": { "name": "174159_after.png", "archived": true } }, "discussions": { "stats": { "discussionsCount": 0, "commentsCount": 0 }, "data": [] }, "style": { "css": "@-moz-document regexp(\"\\\\b(https?:\\\\/\\\\/)?[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]\\\\/calendar\") {\r\n/* Now fixed for latest version as of June 2021 */\r\n/* Uses regex which will hopefully match most Sonarr installations */\r\n/* URL for Sonarr. e.g: http://192.168.1.x:8989/calendar */\r\n\r\n.CalendarEvent-downloading-2dk-4 {\r\n\tborder-left-color: #7a43b6 !important;\r\n\tborder-left-width: 10px;\r\n\tbackground-color: #d0bee3;\r\n}\r\n\r\n.CalendarEvent-downloading-2dk-4.colorImpaired {\r\n\tbackground: repeating-linear-gradient(90deg, #d0bee3, #fff 10px);\r\n}\r\n\r\n.CalendarEvent-downloaded-1ZMYd {\r\n\tborder-left-color: #57bd4a !important;\r\n\tborder-left-width: 10px;\r\n\tbackground-color: #d9ffe3;\r\n}\r\n\r\n.CalendarEvent-downloaded-1ZMYd.colorImpaired {\r\n\tbackground: repeating-linear-gradient(90deg, #d9ffe3, #fff 10px);\r\n}\r\n\r\n.CalendarEvent-unaired-3wyjs {\r\n\tborder-left-color: #5d9cec !important;\r\n\tborder-left-width: 10px;\r\n\tbackground-color: #def2ff;\r\n\tfont-weight: bold;\r\n}\r\n\r\n.CalendarEvent-unaired-3wyjs.colorImpaired {\r\n\tbackground: repeating-linear-gradient(90deg, #def2ff, #fff 10px);\r\n}\r\n\r\n.CalendarEvent-onAir-1YTlC {\r\n\tborder-left-color: #ffa500 !important;\r\n\tborder-left-width: 10px;\r\n\tbackground-color: #f5e187;\r\n}\r\n\r\ndiv.CalendarEvent-onAir-1YTlC.colorImpaired {\r\n\tbackground: repeating-linear-gradient(90deg, #f5e187, #fff 10px);\r\n}\r\n\r\n.CalendarEvent-unmonitored-7tD28 {\r\n\tborder-left-color: #adadad !important;\r\n\tborder-left-width: 10px;\r\n\tbackground-color: #cfc7cf;\r\n}\r\n\r\n.CalendarEvent-unmonitored-7tD28.colorImpaired {\r\n\tbackground: repeating-linear-gradient(90deg, #cfc7cf, #fff 10px);\r\n}\r\n\r\n.CalendarEvent-missing-2Uj6M {\r\n\tborder-left-color: #f05050 !important;\r\n\tborder-left-width: 10px;\r\n\tbackground-color: #ffbac7;\r\n}\r\n\r\n.CalendarEvent-missing-2Uj6M.colorImpaired {\r\n\tbackground: repeating-linear-gradient(90deg, #ffbac7, #fff 10px);\r\n}\r\n\r\n.Icon-info-3mlj_ {\r\n color: #f05050;\r\n}\r\n\r\n/* Radarr */\r\n\t\r\n.CalendarEvent-unreleased-2Kg-f {\r\n border-left-color: #5d9cec !important;\r\n\tborder-left-width: 10px;\r\n\tbackground-color: #def2ff;\r\n\tfont-weight: bold;\r\n}\r\n\t\r\n}" } }
json
/* Copyright (C) <NAME> - All Rights Reserved * Unauthorized copying of this file, via any medium is strictly prohibited * Proprietary and confidential * Written by <NAME> <[EMAIL]>, July 2017 */ .navigation-logo { width: auto; height: 30px; margin-right: 8px; cursor: pointer; outline: none; } button.navigation-button { min-width: 80px; height: 100%; margin-left: 16px; padding-left: 5px; padding-right: 5px; border: none; border-top: solid 4px rgba( 0, 0, 0, 0 ); border-bottom: solid 6px rgba( 0, 0, 0, 0 ); outline: none; background-color: rgba( 0, 0, 0, 0 ); } button.navigation-button:hover { border-bottom: solid 6px #4BA3C7; /* Primary 500 */ } button.navigation-button span { font-size: 16px; font-weight: 500; color: rgb( 255, 255, 255 ); text-transform: uppercase; } button.navigation-button.active { border-bottom: solid 6px #4BA3C7; /* Primary 500 */ } button.navigation-button.inactive span { color: rgba( 255, 255, 255, 0.50 ); transition: color 0.3s ease-out; } button.navigation-button.inactive:hover span { color: rgb( 255, 255, 255 ); transition: color 0.3s ease-out; }
css
{ "type": "service_account", "project_id": "clonebot-327518", "private_key_id": "<KEY>", "private_key": "-----<KEY>", "client_email": "<EMAIL>", "client_id": "101152842472495938250", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "token_uri": "https://oauth2.googleapis.com/token", "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/mfc-mtl8ekew8xsi0jbtn60ben4yhe%40clonebot-327518.iam.gserviceaccount.com" }
json
<filename>rules/oe-rules/templates/widget-index.js import { widgetLoader } from "occ-components/widget-core"; import * as allViewModels from "./view-models"; export default widgetLoader(allViewModels);
javascript
The skyline of Islamabad is about to be transformed forever, and Islamabad Downtown is leading the way! Islamabad Downtown is a flagship project of the esteemed IMARAT Group, proudly positioned as a shining example of their unwavering commitment to excellence in real estate development. Real estate development is an ever-evolving field, constantly adapting to the demands of modern society. Creating new and innovative living spaces has become an art form, with developers striving to create vibrant communities that offer both luxury and practicality. Boasting a central location, state-of-the-art amenities, and elegant design, the Islamabad Downtown project has symbolized excellence in real estate development. The Islamabad Downtown project has been designed around the “Live, Work, Shop & Play ” philosophy, which aims to provide a holistic experience to its residents. It represents a new paradigm in urban planning, which emphasizes the efficient use of space without compromising the quality of life. By integrating residential, commercial, and recreational spaces, Islamabad Downtown has created a unique urban ecosystem that is both functional and aesthetically pleasing. Grand Bazar is a marketplace that celebrates the rich cultural heritage of Pakistan, showcasing the traditional bazaar concept through a modern lens. With its eclectic mix of boutiques, restaurants, cafes, and entertainment venues, Grand Bazar is a vibrant and bustling destination that caters to its visitors’ diverse needs and tastes. Its central location, lively atmosphere, and numerous offerings make it a must-visit destination for anyone seeking a unique and immersive shopping experience. Here is a list of some critical amenities: The Mall of IMARAT stands out as Pakistan’s most expansive themed shopping destination. It is not simply a shopping center, but an opulent Arabian-inspired sanctuary that promises an experience of grandeur and indulgence. The mall features a diverse range of high-end dining and entertainment options and upscale fashion and retail choices. Additionally, the Mall is home to the majestic Four Points by Sheraton Hotel, a distinguished brand known for its world-class hospitality services. The Mall’s exquisite blend of Arabian-inspired architecture, upscale retail offerings, and premium hospitality services make it a unique and unparalleled shopping destination in Pakistan. The following is a list of some amenities at the Mall of IMARAT: IMARAT Residences, a 467-luxury apartment project, is a cutting-edge development that offers a new standard of luxury living in Pakistan. With its innovative Smart Living concept, it is redefining urban living by optimizing the use of vertical spaces while promoting green and healthy living. The project’s emphasis on a human-centric approach to design and living aims to improve the quality of life for its residents, ensuring they live in a comfortable, healthy, and secure environment. The focus on resource efficiency, energy conservation, and waste reduction in construction is a testament to Imarat Residences‘ commitment to sustainability and eco-friendliness. Prominent features of Imarat Residences include: Islamabad Downtown is dubbed as Pakistan’s Most Prestigious Square Kilometer. It is a highly sought-after location that offers easy access to over 20 housing societies along the Islamabad Expressway. These societies include PWD, Bahria Town, DHA, Media Town, Naval Anchorage, Gulberg Greens, Airport Housing Society, Ghauri Town, Fazaia Colony, and others. This prime location allows residents to indulge in the city’s bustling offerings while enjoying a comfortable and affordable living experience. The Mall’s prime location within a 5KM radius of numerous residential and commercial areas makes it a preferred retail destination, catering to 700,000 residents. Its strategic position offers easy accessibility to a wide demographic of potential customers, resulting in constant visitors. Just a 10-minute drive from the iconic Zero Point and proximity to the Islamabad Expressway ensures seamless connectivity to various parts of the city. Presently 100,000 plus cars pass through the Expressway on an everyday basis. This makes Islamabad Downtown ideal for those seeking a well-connected and transit-oriented living experience. Islamabad Downtown is a remarkable project by the Fastest Vertical Developers, IMARAT Group, renowned for their efficient and timely project deliveries. With a proven track record of completing six projects in six years, they have established themselves as leaders in the real estate industry. Their commitment to delivering high-quality developments within strict timelines showcases their expertise and dedication to excellence, making Islamabad Downtown a trusted choice for discerning buyers and investors.
english
The Maharashtra government is considering a plot at Dharavi to build the starting point of the Prime Minister Narendra Modi’s pet project — Mumbai-Ahmedabad bullet train. The state is considering this plot as an alternative to land in the business district of Bandra Kurla Complex (BKC), which the Union government wants. Speaking in the state legislative council, state transport minister Diwakar Raote said the government has not given any land for the project. He also said the an International Financial Services Centre will come up at BKC. “It is not true that the state government has approved setting aside land at BKC for the bullet train. We are looking for an alternative in Dharavi,” the Shiv Sena minister said. The starting point of the Mumbai-Ahmedabad bullet train has been a bone of contention between the two governments. The Centre is keen on building the station at BKC, as it is one of Mumbai’s prime business district and the bullet train is expected to cater to the business travellers between the two cities. However, the state government, wants to utilise the same plot for an International Financial Services Centre. The state had also proposed plots near Bandra Terminus and Kurla as an alternative. Modi is likely to lay the foundation stone for the project at Sabarmati, Gujarat, next month. Raote added the state plans to build a portion of the train corridor from Mumbai to Thane underground to minimise land acquisition. “Farmers whose lands the state will acquire will be given a fair compensation. Tribals along the belt will also benefit, as the corridor will bring in industrial growth in the area,” he said. Raote assured the house that the bullet train project will not impact the already state’s finances. The transport minister said the Japan International Cooperation Agency (JICA) would be giving a loan to cover 80% [approx R1 lakh crore] of the project cost, estimated to be close to Rs one lakh crore. While the Centre will fund 10%, the remaining 10% will be provided by Maharashtra and Gujarat governments.
english
The Dearness Relief has also been increased by 4% for pensioners. The Union Cabinet on Wednesday approved a 4% hike in Dearness Allowance for central government employees. The Dearness Relief for central government pensioners has also been increased by 4%. The move will come into effect retrospectively from July and will benefit about 41. 85 lakh central government employees and 69. 76 lakh pensioners. The Centre will have to bear an additional expense of Rs 12,852. 56 crore per annum and Rs 8,568. 36 crore in this financial year (July 2022 to February 2023) as an impact of the decision, Union Information and Broadcasting Minister Anurag Thakur said at a press briefing in Delhi on Wednesday afternoon. Thakur also announced that the Cabinet has decided to extend the free ration scheme, popularly known as the Pradhan Mantri Garib Kalyan Anna Yojana, by three more months. The scheme to provide five kilograms of additional foodgrains to 80 crore citizens had first been announced in March 2020 to deal with hardships due to the coronavirus pandemic. The benefits have been extended since then every three months. The foodgrains provided under the scheme are over and above the monthly allocation that ration card holders get under the National Food Security Act. The Cabinet on Wednesday also approved a river water sharing agreement between India and Bangladesh, and a redevelopment project of the New Delhi, Ahmedabad and Mumbai’s Chhatrapati Shivaji Maharaj Terminus railway stations.
english
/** * @typedef {import("@typings/index").ApiRequest} ApiPageRequest * @typedef {import("@typings/spotify").TopTimeRange} TopTimeRange */ const { http } = require("@architect/functions"); const { get } = require("tiny-json-http"); const { makeResponse } = require("@architect/shared/utils"); const { getTracksAudio } = require("@architect/shared/audio"); const LIMIT = 48; const TIME_RANGE = "short_term"; const ROOT_URL = "https://api.spotify.com/v1/me/top"; /** @type {ApiRequest} */ const getTop = async (req, headers) => { const limit = req.query.limit || LIMIT; /** @type {TopTimeRange} */ const timeRange = req.query.timeRange || TIME_RANGE; const url = `${ROOT_URL}/tracks?time_range=${timeRange}&limit=${limit}`; const page = (await get({ url, headers })).body; const tracks = await getTracksAudio(page.items, headers); return req.query.debug ? { page } : { tracks }; }; module.exports = { handler: http.async(makeResponse(getTop)), };
javascript
PGA Tour commissioner Jay Monahan taking leave from duties to address 'medical situation' PGA Tour commissioner Jay Monahan is taking a leave from his role following an undisclosed "medical situation." The PGA Tour announced the news in a statement released Tuesday. Executives Ron Price and Tyler Dennis will take over Monahan's duties in his absence. "Jay Monahan informed the PGA Tour policy board that he is recuperating from a medical situation," the statement reads. "The board fully supports Jay and appreciates everyone respecting his privacy. During Jay’s absence, Ron Price, Chief Operating Officer, and Tyler Dennis, Executive Vice President & President, PGA Tour, will lead the day-to-day operations of the PGA Tour with the assistance of the great team Jay has built, ensuring seamless continuity. We will provide further updates as appropriate." The Tour didn't elaborate on Monahan's health status or the nature of his medical condition. The news arrives a week after the PGA Tour announced its merger with LIV Golf, a stunning decision that followed PGA Tour criticism of the rebel tour that's backed by the Saudi Arabian Public Investment Fund. Monahan, 53, oversaw the negotiations that were made behind closed doors and weren't revealed to PGA Tour players until the merger was announced to the general public. He's been under intense fire from PGA Tour players since. LIV Golf has repeatedly been criticized as an effort to sportswash Saudi Arabia's lengthy record of human rights abuses. While Phil Mickelson, Dustin Johnson and others joined the league for lucrative paydays, other players reportedly turned down nine-figure offers to remain on the PGA Tour and avoid being associated with LIV Golf. Now they're linked to LIV Golf with the offers off the table. Monahan has served as PGA Tour commissioner since 2017. It's not clear when he'll return to his duties.
english
<gh_stars>1-10 # Copyright (c) 2006-2010, <NAME> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the author nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE IMPLIED # DISCLAIMED. IN NO EVENT SHALL JESSE LIESCH BE LIABLE FOR ANY # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. from PyQt4.QtCore import * from PyQt4.QtGui import * import copy from editGrid import * from plugin import * from portfolio import * import appGlobal class SpendingModel(EditGridModel): def __init__(self, parent = None, *args): EditGridModel.__init__(self, parent, *args) self.days = 30 self.categorized = True def rebuildSpending(self): portfolio = appGlobal.getApp().portfolio table = portfolio.getSpendingTable(days = self.days, categorize = self.categorized) self.setColumns(table[0]) self.setData(table[1]) class SpendingWidget(QWidget): def __init__(self, parent): QWidget.__init__(self, parent) self.model = SpendingModel(self) portfolio = appGlobal.getApp().portfolio vbox = QVBoxLayout(self) vbox.setMargin(0) hor = QHBoxLayout() hor.setMargin(0) vbox.addLayout(hor) hor.addWidget(QLabel("Period:")) self.periods = ["One Week", "One Month", "Three Months", "One Year", "Two Years", "Three Years", "Five Years", "Ten Years", "Portfolio Inception"] value = portfolio.portPrefs.getPositionPeriod() self.period = QComboBox() self.period.addItems(self.periods) if value in self.periods: self.period.setCurrentIndex(self.periods.index(value)) else: self.period.setCurrentIndex(self.periods.index("Portfolio Inception")) hor.addWidget(self.period) self.connect(self.period, SIGNAL("currentIndexChanged(int)"), self.newPeriod) showCategorized = QCheckBox("Show Categorized") if True or portfolio.portPrefs.getPerformanceCurrent(): showCategorized.setChecked(True) self.model.categorized = True hor.addWidget(showCategorized) # Redraw when checkbox is changed self.connect(showCategorized, SIGNAL("stateChanged(int)"), self.changeCategorized) hor.addStretch(1000) self.table = EditGrid(self.model) self.newPeriod() vbox.addWidget(self.table) self.table.setSortingEnabled(True) self.table.sortByColumn(1, Qt.DescendingOrder) self.table.resizeColumnsToContents() def newPeriod(self): period = self.periods[self.period.currentIndex()] appGlobal.getApp().portfolio.portPrefs.setPositionPeriod(period) period = self.periods[self.period.currentIndex()] if period == "One Week": self.model.days = 7 elif period == "One Month": self.model.days = 30 elif period == "Three Months": self.model.days = 91 elif period == "One Year": self.model.days = 365 elif period == "Two Years": self.model.days = 365 * 2 elif period == "Three Years": self.model.days = 365 * 3 elif period == "Five Years": self.model.days = 365 * 5 + 1 elif period == "Ten Years": self.model.days = 365 * 10 + 2 else: self.model.days = 365 * 100 # 100 years self.model.rebuildSpending() self.table.resizeColumnsToContents() def changeCategorized(self, state): self.model.categorized = state != 0 #appGlobal.getApp().portfolio.portPrefs.setPerformanceCurrent(self.model.current) self.model.rebuildSpending() self.table.resizeColumnsToContents() class Plugin(PluginBase): def __init__(self): PluginBase.__init__(self) def name(self): return "Spending" def icarraVersion(self): return (0, 0, 0) def version(self): return (1, 0, 0) def forInvestment(self): return False def createWidget(self, parent): return SpendingWidget(parent)
python
<filename>client/src/Main.css .Main { display: flex; } .Main-column { flex: 2; background-color: azure; } .Main-sidebar { flex: 1; background-color: azure; } .Main > * + * { margin-top: 0; margin-left: 1.5em; }
css
<reponame>gonzaleztroyano/ASIR2-IIAW-Trim2<filename>15-JS-Calculadora/estilo.css body{ margin: 1%; align-items: center; align-self: auto; } div#entrada{ margin-left: 20%; display: inline-block; } #entrada label,input { margin-right: 5px; margin-bottom: 15px; } #acciones input { width: 50px; height: 50px; text-align: center; } div#resultado{ margin-left: 20%; display: inline; width: 30%; text-align: center; }
css
<gh_stars>0 # Copyright (c) 2014 Mirantis 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. from oslo.config import cfg import oslo.messaging from ceilometer import plugin from ceilometer import sample OPTS = [ cfg.StrOpt('sahara_control_exchange', default='sahara', help="Exchange name for Data Processing notifications."), ] cfg.CONF.register_opts(OPTS) SERVICE = 'sahara' class DataProcessing(plugin.NotificationBase): resource_name = '%s.cluster' % SERVICE @property def event_types(self): return [ '%s.create' % self.resource_name, '%s.update' % self.resource_name, '%s.delete' % self.resource_name, ] @staticmethod def get_targets(conf): """Return a sequence of oslo.messaging.Target It is defining the exchange and topics to be connected for this plugin. """ return [oslo.messaging.Target(topic=topic, exchange=conf.sahara_control_exchange) for topic in conf.notification_topics] def process_notification(self, message): name = message['event_type'].replace(self.resource_name, 'cluster') project_id = message['payload']['project_id'] user_id = message['_context_user_id'] yield sample.Sample.from_notification( name=name, type=sample.TYPE_DELTA, unit='cluster', volume=1, resource_id=message['payload']['cluster_id'], user_id=user_id, project_id=project_id, message=message)
python
/* * Copyright 2010-2019 Australian Signals Directorate * * 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 au.gov.asd.tac.constellation.plugins.importexport.delimited; import au.gov.asd.tac.constellation.graph.Attribute; import au.gov.asd.tac.constellation.graph.Graph; import au.gov.asd.tac.constellation.graph.GraphAttribute; import au.gov.asd.tac.constellation.graph.GraphElementType; import au.gov.asd.tac.constellation.graph.GraphReadMethods; import au.gov.asd.tac.constellation.graph.ReadableGraph; import au.gov.asd.tac.constellation.graph.attribute.BooleanAttributeDescription; import au.gov.asd.tac.constellation.graph.file.opener.GraphOpener; import au.gov.asd.tac.constellation.graph.manager.GraphManager; import au.gov.asd.tac.constellation.graph.manager.GraphManagerListener; import au.gov.asd.tac.constellation.graph.schema.SchemaFactory; import au.gov.asd.tac.constellation.graph.schema.attribute.SchemaAttribute; import au.gov.asd.tac.constellation.plugins.importexport.ImportExportPluginRegistry; import au.gov.asd.tac.constellation.plugins.importexport.ImportExportPreferenceKeys; import au.gov.asd.tac.constellation.plugins.importexport.delimited.parser.ImportFileParser; import au.gov.asd.tac.constellation.plugins.importexport.delimited.parser.InputSource; import au.gov.asd.tac.constellation.plugins.PluginException; import au.gov.asd.tac.constellation.plugins.PluginExecutor; import au.gov.asd.tac.constellation.plugins.parameters.PluginParameters; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import java.util.prefs.Preferences; import org.openide.DialogDisplayer; import org.openide.NotifyDescriptor; import org.openide.util.NbPreferences; /** * * @author sirius */ public class ImportController { /** * Pseudo-attribute to indicate directed transactions. */ public static final String DIRECTED = "__directed__"; /** * Limit the number of rows shown in the preview. */ private static final int PREVIEW_ROW_LIMIT = 100; private final DelimitedFileImporterStage stage; private final List<File> files; private File sampleFile = null; private List<String[]> currentData = new ArrayList<>(); // private ObservableList<TableRow> currentRows = FXCollections.emptyObservableList(); private String[] currentColumns = new String[0]; private ConfigurationPane configurationPane; private ImportDestination<?> currentDestination; private ImportFileParser importFileParser; private boolean schemaInitialised; private boolean showAllSchemaAttributes; private PluginParameters currentParameters = null; // Attributes that exist in the graph or schema. private final Map<String, Attribute> autoAddedVertexAttributes; private final Map<String, Attribute> autoAddedTransactionAttributes; // Attributes that have been manually added by the user. private final Map<String, Attribute> manuallyAddedVertexAttributes; private final Map<String, Attribute> manuallyAddedTransactionAttributes; private boolean clearManuallyAdded; private Map<String, Attribute> displayedVertexAttributes; private Map<String, Attribute> displayedTransactionAttributes; private final Set<Integer> keys; // preference to show or hide all graph schema attributes private final Preferences importExportPrefs = NbPreferences.forModule(ImportExportPreferenceKeys.class); private final RefreshRequest refreshRequest = () -> { updateSampleData(); }; public ImportController(final DelimitedFileImporterStage stage) { this.stage = stage; files = new ArrayList<>(); importFileParser = ImportFileParser.DEFAULT_PARSER; schemaInitialised = true; showAllSchemaAttributes = false; autoAddedVertexAttributes = new HashMap<>(); autoAddedTransactionAttributes = new HashMap<>(); manuallyAddedVertexAttributes = new HashMap<>(); manuallyAddedTransactionAttributes = new HashMap<>(); clearManuallyAdded = true; displayedVertexAttributes = new HashMap<>(); displayedTransactionAttributes = new HashMap<>(); keys = new HashSet<>(); } public DelimitedFileImporterStage getStage() { return stage; } public ConfigurationPane getConfigurationPane() { return configurationPane; } public void setConfigurationPane(final ConfigurationPane configurationPane) { this.configurationPane = configurationPane; if (currentDestination != null) { setDestination(currentDestination); } } public boolean hasFiles() { return !files.isEmpty(); } public void setFiles(final List<File> files, final File sampleFile) { this.files.clear(); this.files.addAll(files); if (currentParameters != null) { List<InputSource> inputSources = new ArrayList<>(); for (File file : files) { inputSources.add(new InputSource(file)); } importFileParser.updateParameters(currentParameters, inputSources); } if (sampleFile == null && files != null && !files.isEmpty()) { this.sampleFile = files.get(0); } else { this.sampleFile = sampleFile; } updateSampleData(); } /** * Whether the ImportController should clear the manually added attributes * in setDestination(). * <p> * Defaults to true, but when attributes have been added manually by a * loaded template, should be false. * * @param b True to cause the manually added attributes to be cleared, false * otherwise. */ public void setClearManuallyAdded(final boolean b) { clearManuallyAdded = b; } public void setDestination(final ImportDestination<?> destination) { this.currentDestination = destination; // Clearing the manually added attributes removes them when loading a template. // The destination is set with clearmanuallyAdded true before loading the // template, so there are no other left-over attributes to clear out after // loading a template. if (clearManuallyAdded) { manuallyAddedVertexAttributes.clear(); manuallyAddedTransactionAttributes.clear(); } keys.clear(); final boolean showSchemaAttributes = importExportPrefs.getBoolean(ImportExportPreferenceKeys.SHOW_SCHEMA_ATTRIBUTES, ImportExportPreferenceKeys.DEFAULT_SHOW_SCHEMA_ATTRIBUTES); loadAllSchemaAttributes(destination, showSchemaAttributes); updateDisplayedAttributes(); } /** * Load all the schema attributes of the graph * * @param destination the destination for the imported data. * @param showSchemaAttributes specifies whether schema attributes should be * included. */ public void loadAllSchemaAttributes(final ImportDestination<?> destination, final boolean showSchemaAttributes) { final Graph graph = destination.getGraph(); final ReadableGraph rg = graph.getReadableGraph(); try { updateAutoAddedAttributes(GraphElementType.VERTEX, autoAddedVertexAttributes, rg, showSchemaAttributes); updateAutoAddedAttributes(GraphElementType.TRANSACTION, autoAddedTransactionAttributes, rg, showSchemaAttributes); } finally { rg.release(); } } /** * True if the specified attribute is known, false otherwise. * <p> * Only the auto added attributes are checked. * * @param elementType The element type of the attribute. * @param label The attribute label. * * @return True if the specified attribute is known, false otherwise. */ public boolean hasAttribute(final GraphElementType elementType, final String label) { switch (elementType) { case VERTEX: return autoAddedVertexAttributes.containsKey(label); case TRANSACTION: return autoAddedTransactionAttributes.containsKey(label); default: throw new IllegalArgumentException("Element type must be VERTEX or TRANSACTION"); } } /** * Get the specified attribute. * <p> * Both the auto added and manually added attributes are checked. * * @param elementType The element type of the attribute. * @param label The attribute label. * * @return The specified attribute, or null if the attribute is not found. */ public Attribute getAttribute(final GraphElementType elementType, final String label) { switch (elementType) { case VERTEX: return autoAddedVertexAttributes.containsKey(label) ? autoAddedVertexAttributes.get(label) : manuallyAddedVertexAttributes.get(label); case TRANSACTION: return autoAddedTransactionAttributes.containsKey(label) ? autoAddedTransactionAttributes.get(label) : manuallyAddedTransactionAttributes.get(label); default: throw new IllegalArgumentException("Element type must be VERTEX or TRANSACTION"); } } /** * Get the attributes that will automatically be added to the attribute * list. * * @param elementType * @param attributes * @param rg */ private void updateAutoAddedAttributes(final GraphElementType elementType, final Map<String, Attribute> attributes, final GraphReadMethods rg, final boolean showSchemaAttributes) { attributes.clear(); // Add attributes from the graph int attributeCount = rg.getAttributeCount(elementType); for (int i = 0; i < attributeCount; i++) { int attributeId = rg.getAttribute(elementType, i); Attribute attribute = new GraphAttribute(rg, attributeId); attributes.put(attribute.getName(), attribute); } // Add attributes from the schema if (showSchemaAttributes && rg.getSchema() != null) { final SchemaFactory factory = rg.getSchema().getFactory(); for (final SchemaAttribute sattr : factory.getRegisteredAttributes(elementType).values()) { final Attribute attribute = new GraphAttribute(elementType, sattr.getAttributeType(), sattr.getName(), sattr.getDescription()); if (!attributes.containsKey(attribute.getName())) { attributes.put(attribute.getName(), attribute); } } } // Add pseudo-attributes if (elementType == GraphElementType.TRANSACTION) { final Attribute attribute = new GraphAttribute(elementType, BooleanAttributeDescription.ATTRIBUTE_NAME, DIRECTED, "Is this transaction directed?"); attributes.put(attribute.getName(), attribute); } // Add primary keys for (int key : rg.getPrimaryKey(elementType)) { keys.add(key); } } public void deleteAttribute(final Attribute attribute) { if (attribute.getElementType() == GraphElementType.VERTEX) { manuallyAddedVertexAttributes.remove(attribute.getName()); } else { manuallyAddedTransactionAttributes.remove(attribute.getName()); } if (configurationPane != null) { configurationPane.deleteAttribute(attribute); } } public void updateDisplayedAttributes() { if (configurationPane != null) { displayedVertexAttributes = createDisplayedAttributes(autoAddedVertexAttributes, manuallyAddedVertexAttributes); displayedTransactionAttributes = createDisplayedAttributes(autoAddedTransactionAttributes, manuallyAddedTransactionAttributes); for (Attribute attribute : configurationPane.getAllocatedAttributes()) { if (attribute.getElementType() == GraphElementType.VERTEX) { if (!displayedVertexAttributes.containsKey(attribute.getName())) { Attribute newAttribute = new NewAttribute(attribute); displayedVertexAttributes.put(newAttribute.getName(), newAttribute); } } else { if (!displayedTransactionAttributes.containsKey(attribute.getName())) { Attribute newAttribute = new NewAttribute(attribute); displayedTransactionAttributes.put(newAttribute.getName(), newAttribute); } } } configurationPane.setDisplayedAttributes(displayedVertexAttributes, displayedTransactionAttributes, keys); } } private Map<String, Attribute> createDisplayedAttributes(final Map<String, Attribute> autoAddedAttributes, final Map<String, Attribute> manuallyAddedAttributes) { Map<String, Attribute> displayedAttributes = new HashMap<>(); displayedAttributes.putAll(manuallyAddedAttributes); displayedAttributes.putAll(autoAddedAttributes); return displayedAttributes; } public void createManualAttribute(final Attribute attribute) { Map<String, Attribute> attributes = attribute.getElementType() == GraphElementType.VERTEX ? manuallyAddedVertexAttributes : manuallyAddedTransactionAttributes; if (!attributes.containsKey(attribute.getName())) { attributes.put(attribute.getName(), attribute); if (configurationPane != null) { updateDisplayedAttributes(); } } } public String showSetDefaultValueDialog(final String attributeName, final String currentDefaultValue) { DefaultAttributeValueDialog dialog = new DefaultAttributeValueDialog(stage, attributeName, currentDefaultValue); dialog.showAndWait(); return dialog.getDefaultValue(); } public ImportDestination<?> getDestination() { return currentDestination; } /** * A List&lt;ImportDefinition&gt; where each list element corresponds to a * RunPane tab. * * @return A List&lt;ImportDefinition&gt; where each list element * corresponds to a RunPane tab. */ public List<ImportDefinition> getDefinitions() { return configurationPane.createDefinitions(); } public void processImport() throws IOException, InterruptedException, PluginException { final List<ImportDefinition> definitions = configurationPane.createDefinitions(); final Graph importGraph = currentDestination.getGraph(); final boolean schema = schemaInitialised; final List<File> importFiles = new ArrayList<>(files); final ImportFileParser parser = importFileParser; if (currentDestination instanceof SchemaDestination) { GraphManager.getDefault().addGraphManagerListener(new GraphManagerListener() { boolean opened = false; @Override public void graphOpened(Graph graph) { } @Override public void graphClosed(Graph graph) { } @Override public synchronized void newActiveGraph(Graph graph) { if (graph == importGraph) { if (!opened) { opened = true; GraphManager.getDefault().removeGraphManagerListener(this); PluginExecutor.startWith(ImportExportPluginRegistry.IMPORT_DELIMITED, false) .set(ImportDelimitedPlugin.DEFINITIONS_PARAMETER_ID, definitions) .set(ImportDelimitedPlugin.PARSER_PARAMETER_ID, parser) .set(ImportDelimitedPlugin.FILES_PARAMETER_ID, importFiles) .set(ImportDelimitedPlugin.SCHEMA_PARAMETER_ID, schema) .set(ImportDelimitedPlugin.PARSER_PARAMETER_IDS_PARAMETER_ID, currentParameters) .executeWriteLater(importGraph); } } } }); GraphOpener.getDefault().openGraph(importGraph, "graph"); } else { PluginExecutor.startWith(ImportExportPluginRegistry.IMPORT_DELIMITED, false) .set(ImportDelimitedPlugin.DEFINITIONS_PARAMETER_ID, definitions) .set(ImportDelimitedPlugin.PARSER_PARAMETER_ID, parser) .set(ImportDelimitedPlugin.FILES_PARAMETER_ID, importFiles) .set(ImportDelimitedPlugin.SCHEMA_PARAMETER_ID, schema) .executeWriteLater(importGraph); } } public void cancelImport() { stage.close(); } private void updateSampleData() { if (sampleFile == null) { currentColumns = new String[0]; currentData = new ArrayList<>(); } else { try { currentData = importFileParser.preview(new InputSource(sampleFile), currentParameters, PREVIEW_ROW_LIMIT); String[] columns = currentData.isEmpty() ? new String[0] : currentData.get(0); currentColumns = new String[columns.length + 1]; System.arraycopy(columns, 0, currentColumns, 1, columns.length); currentColumns[0] = "Row"; } catch (IOException ex) { final NotifyDescriptor nd = new NotifyDescriptor.Message(ex.getMessage(), NotifyDescriptor.WARNING_MESSAGE); DialogDisplayer.getDefault().notify(nd); } } if (configurationPane != null) { configurationPane.setSampleData(currentColumns, currentData); } } public void createNewRun() { if (configurationPane != null) { configurationPane.createNewRun(displayedVertexAttributes, displayedTransactionAttributes, keys, currentColumns, currentData); } } public void setImportFileParser(final ImportFileParser importFileParser) { if (this.importFileParser != importFileParser) { this.importFileParser = importFileParser; if (importFileParser == null) { currentParameters = null; } else { currentParameters = importFileParser.getParameters(refreshRequest); List<InputSource> inputSources = new ArrayList<>(); for (File file : files) { inputSources.add(new InputSource(file)); } importFileParser.updateParameters(currentParameters, inputSources); } stage.getSourcePane().setParameters(currentParameters); updateSampleData(); } } public ImportFileParser getImportFileParser() { return importFileParser; } public boolean isSchemaInitialised() { return schemaInitialised; } public void setSchemaInitialised(final boolean schemaInitialised) { this.schemaInitialised = schemaInitialised; } public boolean isShowAllSchemaAttributesEnabled() { return showAllSchemaAttributes; } public void setShowAllSchemaAttributes(final boolean showAllSchemaAttributes) { this.showAllSchemaAttributes = showAllSchemaAttributes; importExportPrefs.putBoolean(ImportExportPreferenceKeys.SHOW_SCHEMA_ATTRIBUTES, showAllSchemaAttributes); // TODO: the tick box could have changed but the menu item isn't updated, fix it } public String[] getCurrentColumns() { return currentColumns; } public List<String[]> getCurrentData() { return currentData; } public Attribute showNewAttributeDialog(final GraphElementType elementType) { NewAttributeDialog dialog = new NewAttributeDialog(stage, elementType); dialog.showAndWait(); return dialog.getAttribute(); } public Set<Integer> getKeys() { return Collections.unmodifiableSet(keys); } }
java
<gh_stars>10-100 import React, { Component } from "react"; import getWeb3 from "@drizzle-utils/get-web3"; import getAccounts from "@drizzle-utils/get-accounts"; class App extends Component { state = { accounts: null }; componentDidMount = async () => { const web3 = await getWeb3() try { const accounts = await getAccounts({ web3 }); this.setState({ accounts }); } catch (error) { console.error(error); } }; renderAccounts() { const { accounts } = this.state; return ( <> <p>Accounts [{accounts.length}]:</p> <ul> {accounts.map(address => ( <li key={address}>{address}</li> ))} </ul> </> ); } render() { const { accounts } = this.state; return ( <div style={{ margin: "2em" }}> <h1>@drizzle-utils/get-accounts</h1> {accounts === null ? "Loading..." : this.renderAccounts()} </div> ); } } export default App;
javascript
When we covered an extensive hands-on video of the Pixel 4a yesterday, we lamented that one of the only things we don’t know about the new phone at this point is its price. Well, that’s now been checked off the list, if images posted leaker Evan Blass is to be believed — and he has an unimpeachable track record. Blass shared a few images of what appear to be billboard ad mockups for the new device. Notably, one of them shows the device price at $399. This isn’t a huge surprise, as it’s the same price Google used for the 3a last year, but it’s nice to see Google isn’t following the trend of higher prices every year. A few other images also show off some of the cleanest looks at the new design, including the hole-punch camera — a first for Google — and the somewhat misleading square camera module on the back. Though this may make you think the phone has more than one camera like the Pixel 4 or iPhone 11 Pro, it’s just an excessively large housing for the single camera and flash. It also confirms the existence of a fingerprint sensor, as expected for a device without the requisite hardware for the 3D facial recognition used in the Pixel 4. This also means the device will almost certainly not have radar-based gesture recognition, but I suspect the trade-off in price and aesthetics — there’s no big forehead at the top — is worth it for most people. The Pixel 4a is shaping up to be the Pixel to beat. The device was expected to be unveiled at Google I/O, but the physical part of that event has been canceled. Still, rumors are currently pointing to an early April release, but we’ll keep you updated as we find out more. For more on what we know so far, check out our previous coverage. Get the most important tech news in your inbox each week.
english
<reponame>willem810/jea-passmanager package rest; import interceptor.LogError; import interceptor.Logging; import interceptor.Secured; import javax.ws.rs.GET; import javax.ws.rs.Path; /** * @author <EMAIL> */ @Path("ping") @Logging @LogError public class PingResource { @GET public String ping() { return "Enjoy Java EE 8!"; } @GET @Path("secure") @Secured public String secured() { return "Enjoy Java EE 8!"; } }
java
<reponame>HMTEUNIS/react-beats {"ast":null,"code":"export const isAudioNode = audioNodeOrAudioParam => {\n return 'context' in audioNodeOrAudioParam;\n};","map":null,"metadata":{},"sourceType":"module"}
json
Madrid, Sep 16 Real Madrid and Tottenham have reached agreement for the sale of Madrid's Spain international left back Sergio Reguilon to the north-London based club. Reguilon will cost the Spurs 30 million euros, and according to Spanish sports paper Diario AS, has agreed a deal until the end of June 2025 with Real Madrid reserving the right to buy him back for 40 million euros before the summer of 2022, Xinhua news agency reported. Reguilon broke into the Real Madrid first team in the 2018-19 season, making 22 appearances and moving ahead of the Brazilian left back Marcelo in the pecking order. However, the return of Zinedine Zidane saw Marcelo return to favor and the signing of Ferland Mendy in 2019 saw Reguilon loaned to Sevilla (who are now coached by former Madrid boss Julen Lopetegui), where he played 38 times and scored three goals as Sevilla finished fourth in La Liga and won the Europa League for the sixth time in the club's history. The 23-year-old's displays last season earned him his first cap for Spain on September 6th as he started in his country's 4-0 UEFA Nations League win against the Ukraine. The Spanish press also report on Wednesday that Real Madrid and Tottenham are also talking about a loan deal to see Gareth Bale go back to White Hart Lane, seven years after leaving the club to join Real Madrid. The 31-year-old recently commented that he would like to return to the Premier League and said Madrid had blocked previous attempts to leave. Any deal would almost certainly see Real Madrid continue to pay part of the wages of a player whose relationship with coach Zinedine Zidane has broken down completely in recent months. ( With inputs from IANS )
english
{ "vorgangId": "81875", "VORGANG": { "WAHLPERIODE": "18", "VORGANGSTYP": "Schriftliche Frage", "TITEL": "Genehmigungen für den Export von Teilen für den Kampfhubschrauber Apache in die USA und nach Saudi-Arabien seit 2016", "AKTUELLER_STAND": "Beantwortet", "SIGNATUR": "", "GESTA_ORDNUNGSNUMMER": "", "WICHTIGE_DRUCKSACHE": { "DRS_HERAUSGEBER": "BT", "DRS_NUMMER": "18/11885", "DRS_TYP": "Schriftliche Fragen", "DRS_LINK": "http://dipbt.bundestag.de:80/dip21/btd/18/118/1811885.pdf" }, "EU_DOK_NR": "", "SCHLAGWORT": [ { "_fundstelle": "true", "__cdata": "Militärhubschrauber" }, "Saudi-Arabien", "USA", "Waffenhandel", "Wehrtechnik" ], "ABSTRAKT": "Originaltext der Frage(n): \r\n \r\nDen Export welcher Teile für den Kampfhubschrauber Apache hat die Bundesregierung in die USA und nach Saudi-Arabien seit dem 1. Januar 2016 genehmigt (bitte nach Monaten und Land aufschlüsseln sowie unter der Angabe des jeweiligen Wertes)?" }, "VORGANGSABLAUF": { "VORGANGSPOSITION": { "ZUORDNUNG": "BT", "URHEBER": "Schriftliche Frage/Schriftliche Antwort ", "FUNDSTELLE": "07.04.2017 - BT-Drucksache 18/11885, Nr. 47", "FUNDSTELLE_LINK": "http://dipbt.bundestag.de:80/dip21/btd/18/118/1811885.pdf", "PERSOENLICHER_URHEBER": [ { "VORNAME": "Stefan", "NACHNAME": "Liebich", "FUNKTION": "MdB", "FRAKTION": "DIE LINKE", "AKTIVITAETSART": "Frage" }, { "VORNAME": "Matthias", "NACHNAME": "Machnig", "FUNKTION": "Staatssekr.", "RESSORT": "Bundesministerium für Wirtschaft und Energie", "AKTIVITAETSART": "Antwort" } ] } } }
json
<filename>src/main/resources/static/mas_json/2013_sigcomm_4318218974982426981.json {"title": "Forwarding metamorphosis: fast programmable match-action processing in hardware for SDN.", "fields": ["packet processing", "header", "programmer", "forwarding plane", "openflow"], "abstract": "In Software Defined Networking (SDN) the control plane is physically separate from the forwarding plane. Control software programs the forwarding plane (e.g., switches and routers) using an open interface, such as OpenFlow. This paper aims to overcomes two limitations in current switching chips and the OpenFlow protocol: i) current hardware switches are quite rigid, allowing ``Match-Action'' processing on only a fixed set of fields, and ii) the OpenFlow specification only defines a limited repertoire of packet processing actions. We propose the RMT (reconfigurable match tables) model, a new RISC-inspired pipelined architecture for switching chips, and we identify the essential minimal set of action primitives to specify how headers are processed in hardware. RMT allows the forwarding plane to be changed in the field without modifying hardware. As in OpenFlow, the programmer can specify multiple match tables of arbitrary width and depth, subject only to an overall resource limit, with each table configurable for matching on arbitrary fields. However, RMT allows the programmer to modify all header fields much more comprehensively than in OpenFlow. Our paper describes the design of a 64 port by 10 Gb/s switch chip implementing the RMT model. Our concrete design demonstrates, contrary to concerns within the community, that flexible OpenFlow hardware switch implementations are feasible at almost no additional cost or power.", "citation": "Citations (409)", "departments": ["Texas Instruments", "Stanford University", "Texas Instruments", "Microsoft", "Stanford University"], "authors": ["<NAME>.....http://dblp.org/pers/hd/b/Bosshart:Pat", "<NAME>.....http://dblp.org/pers/hd/g/Gibb:Glen", "<NAME>.....http://dblp.org/pers/hd/k/Kim:Hun=Seok", "<NAME>.....http://dblp.org/pers/hd/v/Varghese:George", "<NAME>.....http://dblp.org/pers/hd/m/McKeown:Nick", "<NAME>.....http://dblp.org/pers/hd/i/Izzard:Martin", "<NAME>.....http://dblp.org/pers/hd/m/Mujica:Fernando_A=", "<NAME>.....http://dblp.org/pers/hd/h/Horowitz:Mark"], "conf": "sigcomm", "year": "2013", "pages": 12}
json
[ { "question": "Everybody's talking about heaven like they just can't wait to go", "choice1": "<NAME>", "choice2": "Sai Sai K<NAME>", "choice3": "Queen", "choice4": "Aye Chan Ko", "answer": 1 }, { "question":"And I'm speechless \n Staring at you standing there in that dress", "choice1": "<NAME>", "choice2": "<NAME>", "choice3": "Dan + Shay", "choice4": "Marron 5", "answer": 3 }, { "question":"'Cause all of me \nLoves all of you \nLove your curves and all your edges", "choice1": "BTS", "choice2": "<NAME>", "choice3": "<NAME>", "choice4": "Magic!", "answer": 2 }, { "question":"Superman got nothing on me \nI'm only one call away", "choice1": "<NAME>", "choice2": "<NAME>", "choice3": "Potato", "choice4": "Koe Koe Zaw", "answer": 1 }, { "question":"There's no way I can save you (save you) \nCause I need to be saved, too\n I'm no good at goodbyes", "choice1": "<NAME>", "choice2": "<NAME>", "choice3": "Tomato", "choice4": "Ann Mei", "answer": 2 }, { "question":"Hello, my love \nI've been searching for someone like you", "choice1": "<NAME>", "choice2": "Banana", "choice3": "Westlife", "choice4": "Snare", "answer": 3 }, { "question": "Loving can hurt, loving can hurt sometimes \n But it's the only thing that I know", "choice1": "Gfatt", "choice2": "Lee K<NAME>", "choice3": "<NAME>", "choice4": "<NAME>", "answer": 4 } ]
json
<reponame>fengjixuchui/scapula<filename>scapula/transform/encoded_rt_to_r9.py import shoulder class EncodedRtToR9(shoulder.transform.abstract_transform.AbstractTransform): @property def description(self): d = "changing src/dest register for encoded accessors from r0 to r9" return d def do_transform(self, reg): for am in reg.access_mechanisms["mrs_register"]: am.rt = 9 for am in reg.access_mechanisms["msr_register"]: am.rt = 9 return reg
python
import mongodb from "./mongodb.config"; import redis from "./redis.config"; export { mongodb, redis };
javascript
<reponame>maze-runnar/modal-component "use strict"; function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } module.exports = function evaluate(path, { tdz = false } = {}) { if (!tdz && !path.isReferencedIdentifier()) { return baseEvaluate(path); } if (path.isReferencedIdentifier()) { return evaluateIdentifier(path); } const state = { confident: true }; // prepare path.traverse({ Scope(scopePath) { scopePath.skip(); }, ReferencedIdentifier(idPath) { const binding = idPath.scope.getBinding(idPath.node.name); // don't deopt globals // let babel take care of it if (!binding) return; const evalResult = evaluateIdentifier(idPath); if (!evalResult.confident) { state.confident = evalResult.confident; state.deoptPath = evalResult.deoptPath; } } }); if (!state.confident) { return state; } return baseEvaluate(path); }; function baseEvaluate(path) { try { return path.evaluate(); } catch (e) { return { confident: false, error: e }; } } // Original Source: // https://github.com/babel/babel/blob/master/packages/babel-traverse/src/path/evaluation.js // modified for Babel-minify use function evaluateIdentifier(path) { if (!path.isReferencedIdentifier()) { throw new Error(`Expected ReferencedIdentifier. Got ${path.type}`); } const node = path.node; const binding = path.scope.getBinding(node.name); if (!binding) { const name = node.name; if (!name) { return deopt(path); } switch (name) { case "undefined": return { confident: true, value: undefined }; case "NaN": return { confident: true, value: NaN }; case "Infinity": return { confident: true, value: Infinity }; default: return deopt(path); } } if (binding.constantViolations.length > 0) { return deopt(binding.path); } // referenced in a different scope - deopt if (shouldDeoptBasedOnScope(binding, path)) { return deopt(path); } // let/var/const referenced before init // or "var" referenced in an outer scope const flowEvalResult = evaluateBasedOnControlFlow(binding, path); if (flowEvalResult.confident) { return flowEvalResult; } if (flowEvalResult.shouldDeopt) { return deopt(path); } return path.evaluate(); } // check if referenced in a different fn scope // we can't determine if this function is called sync or async // if the binding is in program scope // all it's references inside a different function should be deopted function shouldDeoptBasedOnScope(binding, refPath) { if (binding.scope.path.isProgram() && refPath.scope !== binding.scope) { return true; } return false; } function evaluateBasedOnControlFlow(binding, refPath) { if (binding.kind === "var") { // early-exit const declaration = binding.path.parentPath; if (declaration.parentPath) { /** * Handle when binding is created inside a parent block and * the corresponding parent is removed by other plugins * if (false) { var a } -> var a */ if (declaration.parentPath.removed) { return { confident: true, value: void 0 }; } if (declaration.parentPath.isIfStatement() || declaration.parentPath.isLoop() || declaration.parentPath.isSwitchCase()) { return { shouldDeopt: true }; } } const fnParent = (binding.path.scope.getFunctionParent() || binding.path.scope.getProgramParent()).path; let blockParentPath = binding.path.scope.getBlockParent().path; let blockParent = blockParentPath.node; if (blockParentPath === fnParent && !fnParent.isProgram()) { blockParent = blockParent.body; } // detect Usage Outside Init Scope const blockBody = blockParent.body; if (Array.isArray(blockBody) && !blockBody.some(stmt => isAncestor(stmt, refPath))) { return { shouldDeopt: true }; } // Detect usage before init const stmts = fnParent.isProgram() ? fnParent.node.body : fnParent.node.body.body; const compareResult = compareBindingAndReference({ binding, refPath, stmts }); if (compareResult.reference && compareResult.binding) { if (compareResult.reference.scope === "current" && compareResult.reference.idx < compareResult.binding.idx) { return { confident: true, value: void 0 }; } } } else if (binding.kind === "let" || binding.kind === "const") { // binding.path is the declarator const declarator = binding.path; const declaration = declarator.parentPath; if (declaration.parentPath && (declaration.parentPath.isIfStatement() || declaration.parentPath.isLoop() || declaration.parentPath.isSwitchCase())) { return { shouldDeopt: true }; } const scopePath = declarator.scope.path; let scopeNode = scopePath.node; if (scopePath.isFunction() || scopePath.isCatchClause()) { scopeNode = scopeNode.body; } // Detect Usage before Init let stmts = scopeNode.body; if (!Array.isArray(stmts)) { stmts = [stmts]; } const compareResult = compareBindingAndReference({ binding, refPath, stmts }); if (compareResult.reference && compareResult.binding) { if (compareResult.reference.scope === "current" && compareResult.reference.idx < compareResult.binding.idx) { throw new Error(`ReferenceError: Used ${refPath.node.name}: ` + `${binding.kind} binding before declaration`); } if (compareResult.reference.scope === "other") { return { shouldDeopt: true }; } } } return { confident: false, shouldDeopt: false }; } function compareBindingAndReference({ binding, refPath, stmts }) { const state = { binding: null, reference: null }; var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = stmts.entries()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { const _step$value = _slicedToArray(_step.value, 2), idx = _step$value[0], stmt = _step$value[1]; if (isAncestor(stmt, binding.path)) { state.binding = { idx }; } var _iteratorNormalCompletion2 = true; var _didIteratorError2 = false; var _iteratorError2 = undefined; try { for (var _iterator2 = binding.referencePaths[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { const ref = _step2.value; if (ref === refPath && isAncestor(stmt, ref)) { state.reference = { idx, scope: binding.path.scope === ref.scope ? "current" : "other" }; break; } } } catch (err) { _didIteratorError2 = true; _iteratorError2 = err; } finally { try { if (!_iteratorNormalCompletion2 && _iterator2.return != null) { _iterator2.return(); } } finally { if (_didIteratorError2) { throw _iteratorError2; } } } } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return != null) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } return state; } function deopt(deoptPath) { return { confident: false, deoptPath }; } /** * is nodeParent an ancestor of path */ function isAncestor(nodeParent, path) { return !!path.findParent(parent => parent.node === nodeParent); }
javascript
package zhihucrawler; import java.io.IOException; import java.util.concurrent.BlockingQueue; import java.util.concurrent.ConcurrentMap; import java.net.http.HttpResponse; import java.util.concurrent.TimeUnit; public class RequestJson implements Runnable { volatile int status; private static final int maxStatusTry = 3; private final BlockingQueue<RequestNode> requestQueue; private final BlockingQueue<RequestNode> requestQueue0; private final BlockingQueue<ResponseNode> responseQueue; private final ConcurrentMap<String, String> errorUsers; private final Request request; private final int sleepMills; private final static String[] refererKey = {"/followers", "/following", "/following/topics", "/following/questions"}; RequestJson(CookieProvider cookieProvider, ProxyProvider proxyProvider, int maxTryNum, int sleepMills, BlockingQueue<RequestNode> requestQueue, BlockingQueue<RequestNode> requestQueue0, BlockingQueue<ResponseNode> responseQueue, ConcurrentMap<String, String> errorUsers) { this.request = new Request(cookieProvider, proxyProvider, maxTryNum); this.requestQueue = requestQueue; this.requestQueue0 = requestQueue0; this.responseQueue = responseQueue; this.errorUsers = errorUsers; this.sleepMills = sleepMills; } int checkStatus(HttpResponse<String> response, RequestNode requestNode) throws InterruptedException { // status不为200时重复请求,多次失败则记录到errorUsers int status = response.statusCode(); String body = response.body(); String user = requestNode.user; int tryCount = requestNode.tryCount; if (status != 200 && status != 403) { if (tryCount > maxStatusTry) { errorUsers.put(user, status + " " + body); util.logWarning("ERRORUSER 3 " + user + " " + status + " " + body); return -1; } else { requestQueue0.put(new RequestNode(user, requestNode.type, requestNode.url, requestNode.id, requestNode.totalRequestNum, tryCount + 1, requestNode.requestID)); return 0; } } return status; } String getReferer(String user, String type) { String prefix = "https://www.zhihu.com/people/" + user; switch (type) { case "follower": return prefix + refererKey[0]; case "followee": return prefix + refererKey[1]; case "topic": return prefix + refererKey[2]; case "question": return prefix + refererKey[3]; default: return ""; } } @Override public void run() { RequestNode requestNode = null; int httpErrorCount = 0; try { //noinspection InfiniteLoopStatement while (true) { Thread.sleep(System.currentTimeMillis() % sleepMills); boolean newRequestFlag = false; if (requestNode == null) { //先在requestQueue0取,取不到再到requestQueue取 if ((requestNode = requestQueue0.poll(1000, TimeUnit.MILLISECONDS)) == null) { requestNode = requestQueue.poll(1000, TimeUnit.MILLISECONDS); if (requestNode == null) continue; synchronized (requestQueue) { requestQueue.notify(); } } newRequestFlag = true; } if (errorUsers.containsKey(requestNode.user)) { requestNode = null; continue; } try { HttpResponse<String> response; String referer = getReferer(requestNode.user, requestNode.type); response = request.request(requestNode.url, referer); /*if (newRequestFlag) { response = request.request(requestNode.url); } else { response = request.request(requestNode.url, null); httpErrorCount=0; }*/ int flag = checkStatus(response, requestNode); if (flag == 0 || flag == -1) { requestNode = null; continue; } if (flag == 403) { /*util.print(response.body()); response = request.request("https://www.zhihu.com/api/v4/anticrawl/captcha_appeal",referer); util.print(response.body()); System.exit(0);*/ if (request.getProxy() == null) { status = -1; util.logWarning("403 null"); while (!request.changeProxy()) { Thread.sleep(500); } status = 0; } //util.logSevere("Response status code 403. Need login."); //return; else { util.logWarning("403 " + request.getProxy()); request.getProxy().setError(); request.changeProxy(); } continue; } responseQueue.put(new ResponseNode(requestNode, response.statusCode(), response.body())); requestNode = null; } catch (IOException e) { if (e.getMessage().equals("Network Error")) { Thread.sleep(500); /*if(httpErrorCount++>10) { util.logSevere("nonproxy HTTPNORESPONSE 10 times\nThread terminate.",e); errorUsers.put(requestNode.user, "Network Error"); Thread.currentThread().interrupt(); }*/ util.logWarning("nonproxy HTTPNORESPONSE ", e); } else { util.logWarning("proxy HTTPNORESPONSE ", e); } request.changeProxy(); } } } catch (InterruptedException e) { util.logWarning("RequestJson Interrupted", e); Thread.currentThread().interrupt(); } } }
java
<gh_stars>10-100 { "variants": { "type=callisto_grunt": { "model": "galaxyspace:callisto_grunt"}, "type=callisto_stone": { "model": "galaxyspace:callisto_stone"} } }
json
# test-project Test github project
markdown
<gh_stars>0 import discord from discord.ext import commands import dotenv import os from glob import glob import traceback from ..db import db # Loading the environment variables dotenv.load_dotenv() token = os.getenv("BOT_TOKEN") error_guild_id = os.getenv("GUILD_ID") error_channel_id = os.getenv("CHANNEL_ID") feedback_channel_id=os.getenv("FEEDBACK_ID") guild_logs_id=os.getenv('GUILD_LOG_ID') intents = discord.Intents.default() # Allowing mentions in messages of the bot mentions = discord.AllowedMentions(everyone=False, users=True, roles=False, replied_user=True) # Cogs COGS = [path.split("\\")[-1][:-3] for path in glob("./lib/cogs/*.py")] # Owner IDS OWNER_ID = 650664682046226432 # Prefix cache implementation prefix_cache={} async def get_prefix(user,message): if message.guild is None: prefix = "dexy" return commands.when_mentioned_or(prefix)(user, message) elif message.guild.id in prefix_cache: return commands.when_mentioned_or(*prefix_cache[message.guild.id])(user, message) else: prefix=db.field("SELECT Prefix FROM guilds WHERE GuildID = ?",message.guild.id) try: prefix=prefix.split(",") except: prefix=['dexy'] if len(prefix_cache)>120: prefix_cache.pop(tuple(prefix_cache.keys())[0]) prefix_cache[message.guild.id]=prefix return commands.when_mentioned_or(*prefix_cache[message.guild.id])(user, message) async def update(): for guild in bot.guilds: try: db.execute("INSERT INTO guilds (GuildID) VALUES (?)", guild.id) except: pass class Bot(commands.Bot): def __init__(self): self.TOKEN = token self.ready = False self.owner_id = OWNER_ID self.reconnect = True self.prefix_cache=prefix_cache self.feedback_webhook=feedback_channel_id super().__init__(case_insensitive=True, allowed_mentions=mentions, intents=intents, command_prefix=get_prefix,strip_after_prefix=True, owner_id=OWNER_ID,max_messages=None) def setup(self): for ext in os.listdir("./lib/cogs"): if ext.endswith(".py") and not ext.startswith("_"): try: self.load_extension(f"lib.cogs.{ext[:-3]}") print(f" {ext[:-3]} cog loaded") except Exception: desired_trace = traceback.format_exc() print(desired_trace) print("setup complete") self.load_extension('jishaku') print("jishaku loaded") print("setup complete") def run(self, version): print("running setup...") self.setup() print("running bot...") super().run(self.TOKEN, reconnect=True) async def process_commands(self, message): ctx = await self.get_context(message, cls=commands.Context) if ctx.command is not None: if not self.ready: await ctx.send("I'm not ready to receive commands. Please wait a few seconds.") else: await self.invoke(ctx) async def on_connect(self): await update() self.error_channel:discord.TextChannel=await self.fetch_channel(error_channel_id) self.error_webhook=await self.error_channel.webhooks() self.error_webhook=self.error_webhook[0] self.guild_log:discord.TextChannel=await self.fetch_channel(guild_logs_id) self.guild_log=await self.guild_log.webhooks() self.guild_log=self.guild_log[0] print("updated") print("bot connected") async def on_disconnect(self): print("bot disconnected") async def on_command_error(self, ctx:commands.Context, err): embed=discord.Embed(title='An error occurred',colour=ctx.me.colour) embed.add_field(name='Error description',value=f"```\n{err}\n```",inline=False) embed.add_field(name='Still confused?',value='Join the [support server](https://discord.gg/FBFTYp7nnq) and ask about this there!') try: await ctx.send(embed=embed)#f"Something went wrong \n ```\n{err}\n```") except: await ctx.author.send(f"I cannot send embeds or messages in {ctx.channel.mention}!") try: embed=discord.Embed(title='Error',description=f'{err}') embed.add_field(name='Command used -',value=f'{ctx.message.content}',inline=False) await self.error_webhook.send(embed=embed) except: raise err async def on_guild_join(self, guild:discord.Guild): try: db.execute("INSERT INTO guilds (GuildID) VALUES (?)", guild.id) except: pass embed=discord.Embed(title='Guild added',description=f'ID : {guild.id}\n NAME : {guild.name}\n OWNERID : {guild.owner_id}')#\n OWNER_NAME : {guild.owner.name}#{guild.owner.discriminator}') await self.guild_log.send(embed=embed) async def on_guild_remove(self, guild:discord.Guild): embed=discord.Embed(title='Guild left',description=f'ID : {guild.id}\n NAME : {guild.name}\n OWNERID : {guild.owner_id}')# OWNER_NAME : {guild.owner.name}#{guild.owner.discriminator}') await self.guild_log.send(embed=embed) # async def on_guild_(self, guild): # db.execute("DELETE FROM guilds WHERE GuildID = ?", guild.id) async def on_message(self, message:discord.Message): if message.author.bot:return return await super().on_message(message) async def on_ready(self): await update() self.ready = True print("bot ready") bot = Bot()
python
/* * Copyright 2002,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jelly.tags.util; import org.apache.commons.jelly.TagLibrary; /** Implements general utility tags. * * @author <a href="mailto:<EMAIL>"><NAME></a> * @version $Revision: 155420 $ */ public class UtilTagLibrary extends TagLibrary { public UtilTagLibrary() { registerTag("available", AvailableTag.class); registerTag("file", FileTag.class); registerTag("loadText", LoadTextTag.class); registerTag("properties", PropertiesTag.class); registerTag("replace", ReplaceTag.class); registerTag("sleep", SleepTag.class); registerTag("sort", SortTag.class); registerTag("tokenize", TokenizeTag.class); } }
java
<reponame>FudanYuan/neo4j<gh_stars>10-100 {"title": "Ultrametric Semantics of Reactive Programs.", "fields": ["functional reactive programming", "well founded semantics", "denotational semantics", "operational semantics", "cartesian closed category"], "abstract": "We describe a denotational model of higher-order functional reactive programming using ultra metric spaces and non expansive maps, which provide a natural Cartesian closed generalization of causal stream functions and guarded recursive definitions. We define a type theory corresponding to this semantics and show that it satisfies normalization. Finally, we show how to efficiently implement reactive programs written in this language using an imperatively updated data flow graph, and give a separation logic proof that this low-level implementation is correct with respect to the high-level semantics.", "citation": "Citations (69)", "departments": ["Microsoft", "Microsoft"], "authors": ["<NAME>.....http://dblp.org/pers/hd/k/Krishnaswami:Neelakantan_R=", "<NAME>.....http://dblp.org/pers/hd/b/Benton:Nick"], "conf": "lics", "year": "2011", "pages": 10}
json
The Tineco Pure One S11 is a solid alternative to Shark vacuum cleaners from a lesser-known brand. Find out if it’s the right cordless vacuum for your needs. Buying Guide We’ve gathered the best vacuums from Shark for every occasion, whether you’re looking for lightweight, cordless, canister, or even robot. If you’re a cat person, this wet-and-dry vacuum will clean your floors with less effort from you. Vacuum frenzy From the Dyson V8 to the new V15s Detect Submarine wet-dry vacuum – there’s a vacuum deal frenzy on right now. Updated Corded, cordless, uprights or robots – these are the best vacuum cleaners money can buy. Spring savings! Dyson is holding a Spring Sale, with big savings to be had on vacuum cleaners, hair styling tools and more. Dyson V15s Detect Submarine review: does the handstick king's first vacuum mop sink or swim? It cleans well and is priced quite well for a Dyson, but it has flaws that need to be fixed. Get the hottest deals available in your inbox plus news, reviews, opinion, analysis and more from the TechRadar team.
english
<filename>app/javascript/dashboard/i18n/locale/pt_BR/privacy.json { "PRIVACY": { "PRIV1": { "TITLE": "Políticas de privacidade do Xfiv Chat", "PAR1": "No chat do Xfiv, acessível a partir de www.Xfiv.com, uma das nossas principais prioridades é a privacidade dos nossos visitantes. Este documento de Política de Privacidade contém os tipos de informação recolhidos e registados pelo chat do Xfiv e como o utilizamos." , "PAR2": "Se você tiver perguntas adicionais ou precisar de mais informações sobre nossa Política de Privacidade, não hesite em nos contatar." }, "PRIV2": { "TITLE": "Arquivos de log", "PAR1": "O chat do Xfiv segue um procedimento padrão para usar arquivos de log. Esses arquivos registram os visitantes quando eles visitam sites. Todas as empresas de hospedagem fazem isso e fazem parte da análise de serviços de hospedagem. As informações coletadas pelos arquivos de log incluem o protocolo da Internet ( Endereços IP), tipo de navegador, provedor de serviços de Internet (ISP), carimbo de data e hora, páginas de referência / saída e, possivelmente, o número de cliques. Eles não estão vinculados a nenhuma informação de identificação pessoal. A finalidade das informações é para analisar tendências, administrar o site, rastrear a movimentação de usuários no site e coletar informações demográficas. ", "TITLE2": "Cookies e web beacons", "PAR2": "Como qualquer outro site, o chat do Xfiv usa 'cookies'. Esses cookies são usados ​​para armazenar informações, incluindo as preferências do visitante e as páginas do site que o visitante acessou ou visitou. A informação é usada para otimizar a experiência do usuário, personalizando o conteúdo do nosso site com base no tipo de navegador do visitante e / ou outras informações. " }, "PRIV3": { "TITLE": "Políticas de privacidade", "PAR1": "Pode consultar esta lista para encontrar a Política de Privacidade de cada um dos anunciantes parceiros do chat Xfiv.", "PAR2": "Servidores de anúncios de terceiros ou redes de anúncios usam tecnologias como cookies, JavaScript ou Web Beacons que são usados ​​em seus respectivos anúncios e links que aparecem no bate-papo Xfiv, que são enviados diretamente para o navegador dos usuários. recebe automaticamente o seu endereço IP quando isso ocorre. Estas tecnologias são utilizadas para medir a eficácia das suas campanhas publicitárias e / ou para personalizar o conteúdo publicitário que vê nos sites que visita. ", "PAR3": "Observe que o chat do Xfiv não tem acesso ou controle sobre esses cookies usados ​​por anunciantes terceiros." }, "PRIV4": { "TITLE": "Políticas de privacidade de terceiros", "PAR1": "A Política de Privacidade do chat Xfiv não se aplica a outros anunciantes ou sites. Portanto, recomendamos que você consulte as respectivas Políticas de Privacidade desses servidores de anúncios de terceiros para obter informações mais detalhadas. Você pode incluir suas práticas e instruções sobre como para desativar certas opções. ", "PAR2": "Você pode optar por desativar os cookies através das opções individuais do seu navegador. Informações mais detalhadas sobre o gerenciamento de cookies com navegadores específicos podem ser encontradas nos respectivos sites dos navegadores. O que são cookies?" }, "PRIV5": { "TITLE": "Informações para crianças", "PAR1": "Outra parte de nossa prioridade é adicionar proteção para crianças durante o uso da Internet. Encorajamos os pais e responsáveis ​​a observar, participar e / ou monitorar e orientar sua atividade online.", "PAR2": "Xfiv Chat não coleta intencionalmente nenhuma informação de identificação pessoal de crianças menores de 13 anos. Se você acredita que seu filho forneceu este tipo de informação em nosso site, recomendamos fortemente que você entre em contato conosco imediatamente e nós faremos nosso melhor fazê-lo imediatamente. remover essas informações de nossos registros. " }, "PRIV6": { "TITLE": "Apenas política de privacidade online", "PAR1": "Esta Política de Privacidade aplica-se apenas às nossas atividades online e é válida para os visitantes do nosso site no que diz respeito às informações que compartilharam e / ou coletaram no chat Xfiv. Esta política não se aplica a qualquer informação coletada offline ou através de canais que não esse site. " }, "PRIV7": { "TITLE": "Consentimento", "PAR1": "Ao utilizar o nosso site, aceita a nossa Política de Privacidade e aceita os seus Termos e Condições." } } }
json
'use strict'; /* –––––––––––––––––––– * Load plugins * –––––––––––––––––––– */ const autoprefixer = require('autoprefixer'); const browsersync = require('browser-sync').create(); const cssnano = require('cssnano'); const del = require('del'); const eslint = require('gulp-eslint'); const gulp = require('gulp'); const plumber = require('gulp-plumber'); const postcss = require('gulp-postcss'); const rename = require('gulp-rename'); const sass = require('gulp-sass'); const webpack = require('webpack'); const webpackconfig = require('./webpack.config.js'); const webpackstream = require('webpack-stream'); /* –––––––––––––––––––– * Task Definitions * –––––––––––––––––––– */ function browserSync(done) { /** * Initiate BrowserSync **/ browsersync.init({ server: { baseDir: './' }, port: 8080 }); done(); } function browserSyncReload(done) { /** * Browser Refresh When Updates Deteceted **/ browsersync.reload(); done(); } function cleanDirectories() { /** * Clean Old Assets - Remove previously compiled files before re-compiling **/ return del([ './static/', './templates/' ]); } function cssTasks() { /** * Process scss & convert to css; **/ return gulp .src('./assets/scss/**/*.scss') .pipe(plumber()) .pipe(sass({ outputStyle: 'expanded' })) // converts into static css; .pipe(gulp.dest('./static/css/')) .pipe(rename({ suffix: '.min' })) .pipe(postcss([ autoprefixer(), cssnano() ])) .pipe(gulp.dest('./static/css/')) .pipe(browsersync.stream()); } function scriptsLint() { /** * Linting JS scripts; **/ return gulp .src([ './assets/js/**/*.js', './gulpfile.js' ]) .pipe(plumber()) .pipe(eslint()) .pipe(eslint.format()) .pipe(eslint.failAfterError()); } function scriptsPrep() { /** * Transpile, Concatenate & Minify javaScript scripts; **/ return gulp .src([ './assets/js/**/*.js' ]) .pipe(plumber()) .pipe(webpackstream(webpackconfig, webpack)) .pipe(gulp.dest('./static/js/')) .pipe(browsersync.stream()); } function copyLibraries() { /** * Task Copies Latest jquery & fontawesome packages; **/ return ( gulp .src('./node_modules/@fortawesome/fontawesome-free/css/**/*') .pipe(gulp .dest('./static/css/vendor/fontawesome-free/css')), gulp .src('./node_modules/@fortawesome/fontawesome-free/webfonts/**/*') .pipe(gulp .dest('./static/css/vendor/fontawesome-free/webfonts')), gulp .src('./node_modules/jquery/dist/jquery.min.js') .pipe(gulp .dest('./static/js')) ); } function copyHtml() { /** task makes a copy of 'index.html' to 'templates directory' * this is needed for Flask to run **/ return gulp .src('./index.html') .pipe(gulp .dest('./templates')); } function watchFiles() { /** * Watch (& Reload) if changes made to files **/ gulp.watch('./assets/scss/**/*.scss', cssTasks); gulp.watch('./assets/js/**/*.js', gulp.series(scriptsLint, scriptsPrep)); gulp.watch('./index.html', browserSyncReload, copyHtml); } /* –––––––––––––––––––– * COMPLEX TASKS & EXPORTS * –––––––––––––––––––– */ // define complex tasks const javaScriptTasks = gulp.series(scriptsLint, scriptsPrep, copyLibraries); const build = gulp.series(cleanDirectories, copyLibraries, copyHtml, gulp.parallel(cssTasks, javaScriptTasks)); const watch = gulp.series(cleanDirectories, copyLibraries, copyHtml, cssTasks, javaScriptTasks, gulp.parallel(watchFiles, browserSync)); // export tasks exports.css = cssTasks; exports.js = javaScriptTasks; exports.clean = cleanDirectories; exports.build = build; exports.watch = watch; exports.default = build;
javascript
(function moduleExporter(name, closure) { "use strict"; var entity = GLOBAL["WebModule"]["exports"](name, closure); if (typeof module !== "undefined") { module["exports"] = entity; } return entity; })("MP4Probe", function moduleClosure(global, WebModule, VERIFY /*, VERBOSE */) { "use strict"; // --- technical terms / data structure -------------------- /* - DiagnosticInformationObject: Object - timescale: UINT32 - duration: UINT32 - duration_time: HHMMSSString - "00:00:00.000" - playback_rate: Number - 1.0 (typical) - volume: Number - 0.0 - 1.0 - trackLength: UINT8 - maybe 1 or 2 - video: VideoTrackInfoObject - track_ID: UINT8 - width: UINT32 - height: UINT32 - duration: UINT32 - duration_time: HHMMSSString - "00:00:00.000" - timescale: UINT32 - codec: String - "AVC", "" - chunkLength": UINT16, - sampleLength": UINT16, - audio: AudioTrackInfoObject - track_ID: UINT8 - volume: Number - 0.0 - 1.0 - duration: UINT32 - duration_time: HHMMSSString - "00:00:00.000" - timescale: UINT32 - codec: String - "AAC", "" - chunkLength": UINT16, - sampleLength": UINT16, */ // --- dependency modules ---------------------------------- var Bit = WebModule["Bit"]; var HexDump = WebModule["HexDump"]; var MP4Parser = WebModule["MP4Parser"]; var NALUnitType = WebModule["NALUnitType"]; // --- import / local extract functions -------------------- var _split8 = Bit["split8"]; // Bit.split8(u32:UINT32, bitPattern:UINT8Array|Uint8Array):UINT32Array // --- define / local variables ---------------------------- // --- class / interfaces ---------------------------------- var MP4Probe = { "getDiagnostic": MP4Probe_getDiagnostic, // MP4Probe.diagnostic(tree:MP4BoxTreeObject):DiagnosticInformationObject "dumpSamples": MP4Probe_dumpSamples, // MP4Probe.dumpSamples(tree:MP4BoxTreeObject):void "dumpTree": MP4Probe_dumpTree, // MP4Probe.dumpTree(tree:MP4BoxTreeObject):void "repository": "https://github.com/uupaa/MP4Probe.js", }; // --- implements ------------------------------------------ function MP4Probe_getDiagnostic(tree) { // @arg MP4BoxTreeObject // @ret DiagnosticInformationObject //{@dev if (VERIFY) { $valid($type(tree, "MP4BoxTreeObject"), MP4Probe_getDiagnostic, "tree"); } //}@dev var video = _getDefaultVideoInfo(); var audio = _getDefaultAudioInfo(); var mvhd = _mvhd(tree); var trak = _trak(tree); for (var i = 0, iz = trak.length; i < iz; ++i) { if ( _isVideoTrack(tree, i) ) { // track[i] is video track. _setVideoTrackInfo(tree, i, video); } else { // track[i] is audio track. _setAudioTrackInfo(tree, i, audio); } } return { "timescale": mvhd["timescale"], "duration": mvhd["duration"], "duration_time": _toHHMMSSTime(mvhd["duration"] / mvhd["timescale"]), "playback_rate": mvhd["rate"] / 0x10000, // 0x10000 >> 16 -> 1.0 "volume": mvhd["volume"] / 0x0100, "trackLength": trak.length, "video": video, "audio": audio, }; } function _setVideoTrackInfo(tree, trackIndex, video) { var stsd = _stbl(tree, trackIndex)["stsd"]; var tkhd = _tkhd(tree, trackIndex); var mdhd = _mdhd(tree, trackIndex); var chunkLength = _getChunkLength(tree, trackIndex); video["track_ID"] = tkhd["track_ID"]; // 1 or 2 (maybe 1) video["width"] = tkhd["width"] >>> 16; video["height"] = tkhd["height"] >>> 16; video["duration"] = mdhd["duration"]; video["duration_time"] = _toHHMMSSTime(mdhd["duration"] / mdhd["timescale"]); video["timescale"] = mdhd["timescale"]; video["codec"] = "avc1" in stsd ? "AVC" : "UNKNOWN"; video["chunkLength"] = chunkLength; for (var i = 0, iz = chunkLength; i < iz; ++i) { video["sampleLength"] += _getSampleLength(tree, trackIndex, i); } } function _setAudioTrackInfo(tree, trackIndex, audio) { var stsd = _stbl(tree, trackIndex)["stsd"]; var tkhd = _tkhd(tree, trackIndex); var mdhd = _mdhd(tree, trackIndex); var chunkLength = _getChunkLength(tree, trackIndex); audio["track_ID"] = tkhd["track_ID"]; // 1 or 2 (maybe 1) audio["codec"] = "mp4a" in stsd ? "AAC" : "UNKNOWN"; audio["timescale"] = mdhd["timescale"]; audio["duration"] = mdhd["duration"]; audio["duration_time"] = _toHHMMSSTime(mdhd["duration"] / mdhd["timescale"]); audio["volume"] = mdhd["volume"] >>> 8; audio["chunkLength"] = chunkLength; for (var i = 0, iz = chunkLength; i < iz; ++i) { audio["sampleLength"] += _getSampleLength(tree, trackIndex, i); } } function MP4Probe_dumpSamples(tree) { // @arg MP4BoxTreeObject var nals = MP4Parser["parse_mdat"](tree["root"]["mdat"]["data"]); for (var i = 0, iz = nals.length; i < iz; ++i) { var nalUnitSize = nals[i][0] << 24 | nals[i][1] << 16 | nals[i][2] << 8 | nals[i][3]; var field = _split8(nals[i][4], [1, 2, 5]); var nal_unit_type = field[2]; HexDump(nals[i], { "title": "MP4Parser_mdat_dump NALUnit[" + i + "], " + NALUnitType[nal_unit_type] + ", NALUnitSize = " + nalUnitSize + " bytes", "rule": { "size": { "begin": 0, "end": 4, "bold": true } } }); } } function MP4Probe_dumpTree(tree) { // @arg MP4BoxTreeObject console.info( JSON.stringify(tree, _dump_replacer, 2) ); } function _dump_replacer(key, value) { // TypedArray more than 5 bytes to omit. if (value.BYTES_PER_ELEMENT && value.length >= 5) { return "[" + [value[0].toString(16), value[1].toString(16), value[2].toString(16), value[3].toString(16)].join(",") + ", ...]"; } // NumberArray more than 5 bytes to omit. if (Array.isArray(value) && typeof value[0] === "number" && value.length >= 5) { return "[" + [value[0].toString(16), value[1].toString(16), value[2].toString(16), value[3].toString(16)].join(",") + ", ...]"; } return value; } function _getDefaultVideoInfo() { // @ret Object - { track_ID, width, height, duration, ... } return { "track_ID": 0, "width": 0, "height": 0, "duration": 0, "duration_time": "", "timescale": 0, "codec": "", // "AVC" or "" "chunkLength": 0, "sampleLength": 0, }; } function _getDefaultAudioInfo() { // @ret Object - { track_ID, volume, duration, ... } return { "track_ID": 0, "volume": 0.0, "duration": 0, "duration_time": "", "timescale": 0, "codec": "", // "AAC" or "" "chunkLength": 0, "sampleLength": 0, }; } function _isVideoTrack(tree, // @arg MP4BoxTreeObject trackIndex) { // @arg UINT8 // @ret Boolean var hdlr = _hdlr(tree, trackIndex); var tkhd = _tkhd(tree, trackIndex); if (hdlr["handler_type"] === 0x76696465) { // "vide" if (tkhd["width"] && tkhd["height"]) { return true; // is Video track } } return false; // is Audio track } function _mvhd(tree) { return tree["root"]["moov"]["mvhd"]; } function _mdhd(tree, trackIndex) { return tree["root"]["moov"]["trak"][trackIndex]["mdia"]["mdhd"]; } function _trak(tree) { return tree["root"]["moov"]["trak"]; } function _tkhd(tree, trackIndex) { return tree["root"]["moov"]["trak"][trackIndex]["tkhd"]; } function _hdlr(tree, trackIndex) { return tree["root"]["moov"]["trak"][trackIndex]["mdia"]["hdlr"]; } function _stbl(tree, trackIndex) { return tree["root"]["moov"]["trak"][trackIndex]["mdia"]["minf"]["stbl"]; } function _getChunkLength(tree, trackIndex) { return _stbl(tree, trackIndex)["stsc"]["entry_count"] || 0; } function _getSampleLength(tree, trackIndex, chunkIndex) { return _stbl(tree, trackIndex)["stsc"]["samples"][chunkIndex]["samples_per_chunk"] || 0; } function _toHHMMSSTime(num) { // @arg Number - 61.23 // @ret String - "00:01:01.230" var hour = 60 * 60, min = 60; var hh = 0, mm = 0, ss = 0, ms = 0.0; hh = (num / hour) | 0; num -= hh * hour; mm = (num / min) | 0; num -= mm * min; ss = num | 0; num -= ss; ms = num; return ("00" + hh).slice(-2) + ":" + ("00" + mm).slice(-2) + ":" + ("00" + ss).slice(-2) + "." + ("" + ms.toFixed(3)).slice(2); } return MP4Probe; // return entity });
javascript
<reponame>hertleinj/image-killer<gh_stars>1-10 import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ name: 'truncate' }) export class Truncate implements PipeTransform { transform(value: string, uri: boolean) { if (uri === true) { let limit = value.lastIndexOf('\\'); return `...\\${value.substr(limit, value.length)}`; } else if (value.length > 20) { return `${value.substr(0, 20)}...` ; } return value; } }
typescript
We've had a lot of explosive volcanic eruptions to discuss over the past few months, but now it's time for a couple places where lava flows dominate to take center stage. Two of the most active shield volcanoes on Earth saw some new developments last week: Kilauea on Hawai'i and Piton de la Fournaise on Reunion Island. Let's run down the action: After some intense inflation across Kilauea's summit and a dramatic rise in the summit lava lake, new lava flows have started issuing from the Puʻu ʻŌʻō vent on the East Rift Zone. This demonstrates some of the interconnectedness of the Kilauea magmatic system, where changes in the volcano at the summit can manifest over 18 kilometers down the slopes with with new lava flows at Puʻu ʻŌʻō. The lava flows coincided with a period of strong inflation at the summit and then deflation at Puʻu ʻŌʻō. The new lava flows are all less than one kilometer long and are no threat to anyone on the island (unlike the infamous Pahoa flow). The USGS map of the new flows shows just how small they are compared to the current active lava flow field fed by the lava tube system under the East Rift. You can check out some video taken of the new flows after an overflight of the area yesterday. In it, you can see the flows flanked by growing levees. They could eventually crust completely over to form some new lava tubes. A thermal image (below) shows how the flows are confined up slope and then branched into into a lava delta when they reached flatter ground. Not to be left out, the long-term inflation persists on the Southwest Rift Zone along with deep earthquakes, suggesting that magma is lurking somewhere beneath that arm of the volcano. No signs that an eruption will happen soon, but it's still rumbling. Meanwhile, halfway across the world in the Indian Ocean, Piton de la Fournaise had its first eruption of 2016. This eruption is centered on the southwestern side of the volcano near the Château Fort cone. It is following the same pattern as most eruptions from the shield volcano, where a new fissure opens that has a few lava fountains that feed new lava flows. The eruption was preceded by inflation that started earlier in the month and volcanic tremor that began a few hours before the eruption, both caused by magma making its way to the surface. Check out some great images and video of the eruption! The last eruption at the remote island volcano lasted from August through October 2015. This eruption could follow that pattern, although over the last century, duration of eruptions have varied greatly.
english
{"componentChunkName":"component---src-templates-tags-tsx","path":"/tag/npm","result":{"data":{"allMarkdownRemark":{"totalCount":2,"edges":[{"node":{"excerpt":"cra 프로젝트를 docker를 이용해 빌드하려고 컨테이너에서 을 실행하도록 했는데 다음과 같은 에러를 마주하게 된다. 아무래도 에러는 특정 모듈이 linux…","fields":{"slug":"/post/2021-01-17-yarn-incompatible-error/"},"id":"f876b723-d495-5430-8707-937142966a77","frontmatter":{"date":"2021-01-17T10:03:58.000Z","title":"에러 “error fsevents@2.0.7: The platform ”linux“ is incompatible with this module.”, ”error Found incompatible module.”를 만났을 때","tags":["javascript","node","npm","yarn","docker","error"],"categories":["javascript"],"description":null}}},{"node":{"excerpt":"Yarn or NPM…","fields":{"slug":"/post/2020-12-02-package-lock-yarn-lock-conversion/"},"id":"6f0bdce7-9ae1-54ab-9f66-536c19ca9b0f","frontmatter":{"date":"2020-12-02T13:11:10.000Z","title":"yarn.lock package-lock.json 간 변환","tags":["javascript","yarn","npm","package","lock"],"categories":["javascript"],"description":null}}}],"nodes":[{"excerpt":"cra 프로젝트를 docker를 이용해 빌드하려고 컨테이너에서 을 실행하도록 했는데 다음과 같은 에러를 마주하게 된다. 아무래도 에러는 특정 모듈이 linux…","fields":{"slug":"/post/2021-01-17-yarn-incompatible-error/"},"id":"f876b723-d495-5430-8707-937142966a77","frontmatter":{"date":"2021-01-17T10:03:58.000Z","title":"에러 “error fsevents@2.0.7: The platform ”linux“ is incompatible with this module.”, ”error Found incompatible module.”를 만났을 때","tags":["javascript","node","npm","yarn","docker","error"],"categories":["javascript"],"description":null}},{"excerpt":"Yarn or NPM…","fields":{"slug":"/post/2020-12-02-package-lock-yarn-lock-conversion/"},"id":"6f0bdce7-9ae1-54ab-9f66-536c19ca9b0f","frontmatter":{"date":"2020-12-02T13:11:10.000Z","title":"yarn.lock package-lock.json 간 변환","tags":["javascript","yarn","npm","package","lock"],"categories":["javascript"],"description":null}}]}},"pageContext":{"tag":"npm"}},"staticQueryHashes":["2880150720"]}
json
package email type emailConfigs struct { webRedirectDirConfig Configs []platformConfig `json:"platforms" required:"true"` } type platformConfig struct { Platform string `json:"platform" required:"true"` Credentials string `json:"credentials" required:"true"` } type webRedirectDirConfig struct { WebRedirectDirOnSuccess string `json:"web_redirect_dir_on_success" required:"true"` WebRedirectDirOnFailure string `json:"web_redirect_dir_on_failure" required:"true"` }
go
Gujarat were able to chase Saurashtra's 269 through a collective batting performance from their top-order. Saurashtra were put in to bat and their wicketkeeper opener Sheldon Jackson scored 109. Contributions from Rahul Dave (36), Chirag Jani (31) and Kuldeep Raval's quick fire 30 off 18 balls, helped them put up a sizable score, as they finished 269 for 6. Gujarat started assuredly, with openers Priyank Panchal and wicketkeeper captain Parthiv Patel putting up 136 runs for the first wicket. From there a platform was set and Manprit Juneja chipped in with a vital 66. Abdulahad Malik and Juneja steered the team within a few runs of the target before Juneja fell to Saurya Sanandiya. Gujarat won the match with six wickets in hand, in the 47th over. A belligerent 86 not out by Yusuf Pathan, with a combined effort by the bowlers, helped Baroda to a four-wicket win against Maharashtra at the Poona Club Ground. Chasing 178, Baroda were in trouble at 34 for 3 in the 11th over, when Pathan came in to bat. Within the next 61 balls, Baroda added 70 runs via Pathan and Ambati Rayudu, who scored 40. Pathan stuck till the end, hitting six sixes in his 55-ball knock, to see his side home in the 29th over. Maharashtra's innings was based on short but significant knocks by their middle-order batsmen. After being put in to bat, they lost wickets regularly to struggle to 113 for 7 in the 36th over, before Shrikant Mundhe and Akshay Darekar rescued them by adding 58 runs. But this contribution wasn't enough as they were bundled out for 177. Half-centuries from Rohan Prem and Sanju Samson helped Kerala to a six-wicket victory against Goa in Porvorim. Kerala were comfortable in their chase of 223, through a strong top-order batting performance. After opener VA Jagadeesh fell in the seventh over, Karimuttathu Rakesh and Prem added 54 runs, before Samson and Prem put on a century stand that virtually sealed the contest. Goa steadily lost wickets after choosing to bat. Their captain and opener Sagun Kamat attempted to anchor the innings, but departed after scoring 71. Towards the latter stages of the innings, Robin d'Souza scored 50 off 42 deliveries to push them beyond 200. Karnataka squeezed home by one wicket against Andhra, with only two balls remaining in the match. After Andhra were put into bat, AG Pradeep (55), Amol Muzumdar (39) and B Sumanth (39) led them to 228 before they were dismissed in 48 overs. Vinay Kumar was the pick of the bowlers with 4 for 38. Robin Uthappa continued his good form with another fifty, with fellow opener Lokesh Rahul contributing 75. Despite the rest of the Karnataka middle order getting starts, no one was able to push on, with Bodavarapu Sudhakar taking some vital wickets to temper the chase. Ultimately Raju Bhatkal and KP Appanna held their nerve, taking Karnataka to yet another win as they continued their unbeaten streak in the competition. A responsible knock from Dinesh Karthik helped Tamil Nadu beat Hyderabad by 26 runs. Karthik scored a run-a-ball 119, as he put on 108 runs for the third wicket with B Aparajith, who scored 51. Tamil Nadu looked set for a big total before Chama Milind struck twice to help stop the run flow towards the end of the innings. Tamil Nadu ended up with 262 for 9 after fifty overs. Hyderabad started their chase strongly before opener Kolla Sumanth was run out, to leave them at 82 for 1. This was the first of three run-outs in the innings, which hampered Hyderabad's chase. Dwaraka Ravi Teja (43), Bavanaka Sandeep (42) and Sundeep Rajan (52) all got starts, but couldn't continue on to take their team home. P Amarnath took three wickets at the end to help dismiss Hyderabad for 236. An attacking century from opener Puneet Yadav propelled Rajasthan to a commanding victory over Railways, by seven wickets, in Indore. Yadav, with a 117-ball 123 - his highest List A score - put on 112 runs with fellow opener Siddharth Saraf, and 98 runs with captain Robin Bist, to help them reach their target of 232 in the 44th over. Railways' top order was also productive, but at 215 for 6, they couldn't accelerate towards the end of the innings, as their last six wickets fell for just 18 runs added. Mahesh Rawat, their captain, top-scored with 81. Seamer Raman Chahar and spinner Madhur Khatri took three wickets each. A five-wicket haul from Jatin Saxena gave Madhya Pradesh a 68-run victory against Vidarbha. After MP chose to bat, seamer Shrikant Wagh, who finished with six wickets, struck early to dismiss both their openers with just 37 on the board. Saxena (61) and Naman Ojha then put together a 136-run partnership for the third wicket to help stabilise the innings. Ojha would finish on 83, with Harpreet Singh contributing an aggressive 39. Wagh returned to pick off three more wickets near the end to leave MP on 263 for 8. In Vidarbha's chase, legspinner Saxena was instrumental in keeping Vidarbha's chase under control. Akshay Kolhar (45), Shalabh Shrivastava (33) and Akshay Wadkar (35) were unable to build on their respective starts as Vidarbha were ultimately dismissed for 195 in 47.1 overs. The win gave them top spot in the points table.
english
<reponame>MetaOfX/python-spanner-orm # python3 # Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import datetime import logging import unittest from unittest import mock from absl.testing import parameterized from spanner_orm import condition from spanner_orm import error from spanner_orm import field from spanner_orm import query from spanner_orm.tests import models from google.cloud.spanner_v1.proto import type_pb2 def now(): return datetime.datetime.now(tz=datetime.timezone.utc) class QueryTest(parameterized.TestCase): @mock.patch('spanner_orm.table_apis.sql_query') def test_where(self, sql_query): sql_query.return_value = [] models.UnittestModel.where_equal(int_=3, transaction=True) (_, sql, parameters, types), _ = sql_query.call_args expected_sql = 'SELECT .* FROM table WHERE table.int_ = @int_0' self.assertRegex(sql, expected_sql) self.assertEqual(parameters, {'int_0': 3}) self.assertEqual(types, {'int_0': field.Integer.grpc_type()}) @mock.patch('spanner_orm.table_apis.sql_query') def test_count(self, sql_query): sql_query.return_value = [[0]] column, value = 'int_', 3 models.UnittestModel.count_equal(int_=3, transaction=True) (_, sql, parameters, types), _ = sql_query.call_args column_key = '{}0'.format(column) expected_sql = r'SELECT COUNT\(\*\) FROM table WHERE table.{} = @{}'.format( column, column_key) self.assertRegex(sql, expected_sql) self.assertEqual({column_key: value}, parameters) self.assertEqual(types, {column_key: field.Integer.grpc_type()}) def test_count_allows_force_index(self): force_index = condition.force_index('test_index') count_query = query.CountQuery(models.UnittestModel, [force_index]) sql = count_query.sql() expected_sql = 'SELECT COUNT(*) FROM table@{FORCE_INDEX=test_index}' self.assertEqual(expected_sql, sql) @parameterized.parameters( condition.limit(1), condition.order_by( ('int_', condition.OrderType.DESC))) def test_count_only_allows_where_and_from_segment_conditions(self, condition): with self.assertRaises(error.SpannerError): query.CountQuery(models.UnittestModel, [condition]) def select(self, *conditions): return query.SelectQuery(models.UnittestModel, list(conditions)) def test_query_limit(self): key, value = 'limit0', 2 select_query = self.select(condition.limit(value)) self.assertEndsWith(select_query.sql(), ' LIMIT @{}'.format(key)) self.assertEqual(select_query.parameters(), {key: value}) self.assertEqual(select_query.types(), {key: field.Integer.grpc_type()}) select_query = self.select() self.assertNotRegex(select_query.sql(), 'LIMIT') def test_query_limit_offset(self): limit_key, limit = 'limit0', 2 offset_key, offset = 'offset0', 5 select_query = self.select(condition.limit(limit, offset=offset)) self.assertEndsWith(select_query.sql(), ' LIMIT @{} OFFSET @{}'.format(limit_key, offset_key)) self.assertEqual(select_query.parameters(), { limit_key: limit, offset_key: offset }) self.assertEqual(select_query.types(), { limit_key: field.Integer.grpc_type(), offset_key: field.Integer.grpc_type() }) def test_query_order_by(self): order = ('int_', condition.OrderType.DESC) select_query = self.select(condition.order_by(order)) self.assertEndsWith(select_query.sql(), ' ORDER BY table.int_ DESC') self.assertEmpty(select_query.parameters()) self.assertEmpty(select_query.types()) select_query = self.select() self.assertNotRegex(select_query.sql(), 'ORDER BY') def test_query_order_by_with_object(self): order = (models.UnittestModel.int_, condition.OrderType.DESC) select_query = self.select(condition.order_by(order)) self.assertEndsWith(select_query.sql(), ' ORDER BY table.int_ DESC') self.assertEmpty(select_query.parameters()) self.assertEmpty(select_query.types()) select_query = self.select() self.assertNotRegex(select_query.sql(), 'ORDER BY') @parameterized.parameters(('int_', 5, field.Integer.grpc_type()), ('string', 'foo', field.String.grpc_type()), ('timestamp', now(), field.Timestamp.grpc_type())) def test_query_where_comparison(self, column, value, grpc_type): condition_generators = [ condition.greater_than, condition.not_less_than, condition.less_than, condition.not_greater_than, condition.equal_to, condition.not_equal_to ] for condition_generator in condition_generators: current_condition = condition_generator(column, value) select_query = self.select(current_condition) column_key = '{}0'.format(column) expected_where = ' WHERE table.{} {} @{}'.format( column, current_condition.operator, column_key) self.assertEndsWith(select_query.sql(), expected_where) self.assertEqual(select_query.parameters(), {column_key: value}) self.assertEqual(select_query.types(), {column_key: grpc_type}) @parameterized.parameters( (models.UnittestModel.int_, 5, field.Integer.grpc_type()), (models.UnittestModel.string, 'foo', field.String.grpc_type()), (models.UnittestModel.timestamp, now(), field.Timestamp.grpc_type())) def test_query_where_comparison_with_object(self, column, value, grpc_type): condition_generators = [ condition.greater_than, condition.not_less_than, condition.less_than, condition.not_greater_than, condition.equal_to, condition.not_equal_to ] for condition_generator in condition_generators: current_condition = condition_generator(column, value) select_query = self.select(current_condition) column_key = '{}0'.format(column.name) expected_where = ' WHERE table.{} {} @{}'.format( column.name, current_condition.operator, column_key) self.assertEndsWith(select_query.sql(), expected_where) self.assertEqual(select_query.parameters(), {column_key: value}) self.assertEqual(select_query.types(), {column_key: grpc_type}) @parameterized.parameters( ('int_', [1, 2, 3], field.Integer.grpc_type()), ('int_', (4, 5, 6), field.Integer.grpc_type()), ('string', ['a', 'b', 'c'], field.String.grpc_type()), ('timestamp', [now()], field.Timestamp.grpc_type())) def test_query_where_list_comparison(self, column, values, grpc_type): condition_generators = [condition.in_list, condition.not_in_list] for condition_generator in condition_generators: current_condition = condition_generator(column, values) select_query = self.select(current_condition) column_key = '{}0'.format(column) expected_sql = ' WHERE table.{} {} UNNEST(@{})'.format( column, current_condition.operator, column_key) list_type = type_pb2.Type( code=type_pb2.ARRAY, array_element_type=grpc_type) self.assertEndsWith(select_query.sql(), expected_sql) self.assertEqual(select_query.parameters(), {column_key: values}) self.assertEqual(select_query.types(), {column_key: list_type}) def test_query_combines_properly(self): select_query = self.select( condition.equal_to('int_', 5), condition.not_equal_to('string_array', ['foo', 'bar']), condition.limit(2), condition.order_by(('string', condition.OrderType.DESC))) expected_sql = ('WHERE table.int_ = @int_0 AND table.string_array != ' '@string_array1 ORDER BY table.string DESC LIMIT @limit2') self.assertEndsWith(select_query.sql(), expected_sql) def test_only_one_limit_allowed(self): with self.assertRaises(error.SpannerError): self.select(condition.limit(2), condition.limit(2)) def test_force_index(self): select_query = self.select(condition.force_index('test_index')) expected_sql = 'FROM table@{FORCE_INDEX=test_index}' self.assertEndsWith(select_query.sql(), expected_sql) def test_force_index_with_object(self): select_query = self.select( condition.force_index(models.UnittestModel.test_index)) expected_sql = 'FROM table@{FORCE_INDEX=test_index}' self.assertEndsWith(select_query.sql(), expected_sql) def includes(self, relation, *conditions, foreign_key_relation=False): include_condition = condition.includes(relation, list(conditions), foreign_key_relation) return query.SelectQuery( models.ForeignKeyTestModel if foreign_key_relation else models.RelationshipTestModel, [include_condition], ) @parameterized.parameters((models.RelationshipTestModel.parent, True), (models.ForeignKeyTestModel.foreign_key_1, False)) def test_bad_includes_args(self, relation_key, foreign_key_relation): with self.assertRaisesRegex(ValueError, 'Must pass'): self.includes( relation_key, foreign_key_relation=foreign_key_relation, ) @parameterized.named_parameters( ( 'legacy_relationship', { 'relation': 'parent' }, r'SELECT RelationshipTestModel\S* RelationshipTestModel\S* ' r'ARRAY\(SELECT AS STRUCT SmallTestModel\S* SmallTestModel\S* ' r'SmallTestModel\S* FROM SmallTestModel WHERE SmallTestModel.key = ' r'RelationshipTestModel.parent_key\)', ), ( 'legacy_relationship_with_object_arg', { 'relation': models.RelationshipTestModel.parent }, r'SELECT RelationshipTestModel\S* RelationshipTestModel\S* ' r'ARRAY\(SELECT AS STRUCT SmallTestModel\S* SmallTestModel\S* ' r'SmallTestModel\S* FROM SmallTestModel WHERE SmallTestModel.key = ' r'RelationshipTestModel.parent_key\)', ), ( 'foreign_key_relationship', { 'relation': 'foreign_key_1', 'foreign_key_relation': True }, r'SELECT ForeignKeyTestModel\S* ForeignKeyTestModel\S* ForeignKeyTestModel\S* ForeignKeyTestModel\S* ' r'ARRAY\(SELECT AS STRUCT SmallTestModel\S* SmallTestModel\S* ' r'SmallTestModel\S* FROM SmallTestModel WHERE SmallTestModel.key = ' r'ForeignKeyTestModel.referencing_key_1\)', ), ( 'foreign_key_relationship_with_object_arg', { 'relation': models.ForeignKeyTestModel.foreign_key_1, 'foreign_key_relation': True }, r'SELECT ForeignKeyTestModel\S* ForeignKeyTestModel\S* ForeignKeyTestModel\S* ForeignKeyTestModel\S* ' r'ARRAY\(SELECT AS STRUCT SmallTestModel\S* SmallTestModel\S* ' r'SmallTestModel\S* FROM SmallTestModel WHERE SmallTestModel.key = ' r'ForeignKeyTestModel.referencing_key_1\)', ), ) def test_includes(self, includes_kwargs, expected_sql): select_query = self.includes(**includes_kwargs) # The column order varies between test runs self.assertRegex(select_query.sql(), expected_sql) self.assertEmpty(select_query.parameters()) self.assertEmpty(select_query.types()) @parameterized.parameters(({ 'relation': models.RelationshipTestModel.parent, 'foreign_key_relation': True },), ({ 'relation': models.ForeignKeyTestModel.foreign_key_1, 'foreign_key_relation': False },)) def test_error_mismatched_params(self, includes_kwargs): with self.assertRaisesRegex(ValueError, 'Must pass'): self.includes(**includes_kwargs) def test_includes_subconditions_query(self): select_query = self.includes('parents', condition.equal_to('key', 'value')) expected_sql = ( 'WHERE SmallTestModel.key = RelationshipTestModel.parent_key ' 'AND SmallTestModel.key = @key0') self.assertRegex(select_query.sql(), expected_sql) def includes_result(self, related=1): child = {'parent_key': 'parent_key', 'child_key': 'child'} result = [child[name] for name in models.RelationshipTestModel.columns] parent = {'key': 'key', 'value_1': 'value_1', 'value_2': None} parents = [] for _ in range(related): parents.append([parent[name] for name in models.SmallTestModel.columns]) result.append(parents) return child, parent, [result] def fk_includes_result(self, related=1): child = { 'referencing_key_1': 'parent_key', 'referencing_key_2': 'child', 'referencing_key_3': 'child', 'self_referencing_key': 'child' } result = [child[name] for name in models.ForeignKeyTestModel.columns] parent = {'key': 'key', 'value_1': 'value_1', 'value_2': None} parents = [] for _ in range(related): parents.append([parent[name] for name in models.SmallTestModel.columns]) result.append(parents) return child, parent, [result] @parameterized.named_parameters( ( 'legacy_relationship', { 'relation': 'parent' }, lambda x: x.parent, lambda x: x.includes_result(related=1), ), ( 'foreign_key_relationship', { 'relation': 'foreign_key_1', 'foreign_key_relation': True }, lambda x: x.foreign_key_1, lambda x: x.fk_includes_result(related=1), ), ) def test_includes_single_related_object_result( self, includes_kwargs, referenced_table_fn, includes_result_fn, ): select_query = self.includes(**includes_kwargs) child_values, parent_values, rows = includes_result_fn(self) result = select_query.process_results(rows)[0] self.assertIsInstance( referenced_table_fn(result), models.SmallTestModel, ) for name, value in child_values.items(): self.assertEqual(getattr(result, name), value) for name, value in parent_values.items(): self.assertEqual(getattr(referenced_table_fn(result), name), value) @parameterized.named_parameters( ( 'legacy_relationship', { 'relation': 'parent' }, lambda x: x.parent, lambda x: x.includes_result(related=0), ), ( 'foreign_key_relationship', { 'relation': 'foreign_key_1', 'foreign_key_relation': True }, lambda x: x.foreign_key_1, lambda x: x.fk_includes_result(related=0), ), ) def test_includes_single_no_related_object_result(self, includes_kwargs, referenced_table_fn, includes_result_fn): select_query = self.includes(**includes_kwargs) child_values, _, rows = includes_result_fn(self) result = select_query.process_results(rows)[0] self.assertIsNone(referenced_table_fn(result)) for name, value in child_values.items(): self.assertEqual(getattr(result, name), value) def test_includes_subcondition_result(self): select_query = self.includes('parents', condition.equal_to('key', 'value')) child_values, parent_values, rows = self.includes_result(related=2) result = select_query.process_results(rows)[0] self.assertLen(result.parents, 2) for name, value in child_values.items(): self.assertEqual(getattr(result, name), value) for name, value in parent_values.items(): self.assertEqual(getattr(result.parents[0], name), value) @parameterized.named_parameters( ( 'legacy_relationship', { 'relation': 'parent' }, lambda x: x.includes_result(related=2), ), ( 'foreign_key_relationship', { 'relation': 'foreign_key_1', 'foreign_key_relation': True }, lambda x: x.fk_includes_result(related=2), ), ) def test_includes_error_on_multiple_results_for_single( self, includes_kwargs, includes_result_fn): select_query = self.includes(**includes_kwargs) _, _, rows = includes_result_fn(self) with self.assertRaises(error.SpannerError): _ = select_query.process_results(rows) @parameterized.parameters(True, False) def test_includes_error_on_invalid_relation(self, foreign_key_relation): with self.assertRaises(error.ValidationError): self.includes('bad_relation', foreign_key_relation=foreign_key_relation) @parameterized.parameters( ('bad_column', 0, 'parent', False), ('bad_column', 0, 'foreign_key_1', True), ('child_key', 'good value', 'parent', False), ('child_key', 'good value', 'foreign_key_1', False), ('key', ['bad value'], 'parent', False), ('key', ['bad value'], 'foreign_key_1', False), ) def test_includes_error_on_invalid_subconditions(self, column, value, relation, foreign_key_relation): with self.assertRaises(error.ValidationError): self.includes( relation, condition.equal_to(column, value), foreign_key_relation, ) def test_or(self): condition_1 = condition.equal_to('int_', 1) condition_2 = condition.equal_to('int_', 2) select_query = self.select(condition.or_([condition_1], [condition_2])) expected_sql = '((table.int_ = @int_0) OR (table.int_ = @int_1))' self.assertEndsWith(select_query.sql(), expected_sql) self.assertEqual(select_query.parameters(), {'int_0': 1, 'int_1': 2}) self.assertEqual(select_query.types(), { 'int_0': field.Integer.grpc_type(), 'int_1': field.Integer.grpc_type() }) if __name__ == '__main__': logging.basicConfig() unittest.main()
python
package controllers import ( "strconv" "github.com/gin-gonic/gin" "twreporter.org/go-api/models" "twreporter.org/go-api/storage" ) // NewsController has methods to handle requests which wants posts, topics ... etc news resource. type NewsController struct { Storage storage.NewsStorage } // NewNewsController ... func NewNewsController(s storage.NewsStorage) *NewsController { return &NewsController{s} } // GetQueryParam pares url param func (nc *NewsController) GetQueryParam(c *gin.Context) (err error, mq models.MongoQuery, limit int, offset int, sort string, full bool) { where := c.Query("where") _limit := c.Query("limit") _offset := c.Query("offset") _full := c.Query("full") sort = c.Query("sort") // provide default param if error occurs limit, _ = strconv.Atoi(_limit) offset, _ = strconv.Atoi(_offset) full, _ = strconv.ParseBool(_full) if limit < 0 { limit = 0 } if offset < 0 { offset = 0 } if where == "" { where = "{}" } err = models.GetQuery(where, &mq) return }
go
Bangkok: Six official websites of Thai government were hacked today allegedly by an Islamic group from Tunisia which posted pictures of Rohingya Muslims fleeing persecution in Myanmar on the webpages. The Islamic group calling itself Fallag Gassrini & Dr Lamouchi, left messages saying: "Your sites have been hacked by Fallag Gassrini & Dr Lamouchi hacker group from Tunisia. You have to give respect to our people. We, the Fallaga team, are Muslims. We are peace-loving people. " They also posted pictures of Rohingya Muslims fleeing persecution in Myanmar and Muslim child victims of bomb attacks were posted on the sites, Bangkok Post reported. This hacker group previously worked with other Islamic groups and hacked several Israeli and French websites. An official at the Ministry of Information and Technology Communication said the hacking was conducted simultaneously worldwide, using the Linux command line.
english
<reponame>lbittencurt/beagle-web-core<filename>cspell.json { "version": "0.1", "language": "en", "words": [ "rendering", "renderization", "everytime", "lifecycles", "middlewares", "snapshotted", "servicos", "tecnologia", "inovacao", "unmock", "JSONs", "oftenly", "navigations", "serializable" ] }
json
Intraday move largely to be northbound if prices stay above the downside hurdle of 61700 region and such bullish sentiments possibly to test 62900 or even more. Although a direct fall below 61700 may dent our buying expectation. Major price recovery may be seen by reclaiming trades above 5340 region. Failed to achieve such trades may gradually push prices lower to 5100 region. Present weakness may extend only by tangible trades below 279 region. Which if remain undisturbed could boost pries higher in the later session. Determined trades above 746. 50 would be a sign of fresh buying towards 751 or even more. Inability to sustain trades above the same may gradually squeeze down prices lower . Prices likely to consolidate with mild negative bias. However, a direct rise through 1545 could boost prices higher in the later session. Present recovery move likely to be upheld towards the upside objective of 285 or even higher. Even in this positive sentiments, a surprise fall below 280 may dent our buying expectation. Witnessing buying sentiments possibly to stretch higher in the upcoming session as long as prices remain above 187 region. But a direct fall below the same may push price lower. If prices remain above the downside hurdle of 215. 80 could boost prices higher in the later session. Although a surprise fall below the same may dent our buying sentiments.
english
|To Noah and to his sons with him, God also said this: |“Behold, I will establish my covenant with you, and with your offspring after you, |and with every living soul that is with you: as much with the birds as with the cattle and all the animals of the earth that have gone forth from the ark, and with all the wild beasts of the earth. |And God said: “This is the sign of the pact that I grant between me and you, and to every living soul that is with you, for perpetual generations. |I will place my arc in the clouds, and it will be the sign of the pact between myself and the earth. |And when I obscure the sky with clouds, my arc will appear in the clouds. |And I will remember my covenant with you, and with every living soul that enlivens flesh. And there will no longer be waters from a great flood to wipe away all that is flesh.
english