text
stringlengths
1
1.04M
language
stringclasses
25 values
Vince McMahon has been WWE's preeminent authority for decades. Over the years, he has created multiple megastars, such as Stone Cold Steve Austin, The Rock, and The Undertaker. Likewise, McMahon is also responsible for the majority of WWE's consequential booking decisions. While plenty of these choices paid off, there have also been many times when stars have expressed their unhappiness with these decisions. Occasionally, these instances have led to heated discussions with the WWE Chairman. Here are five superstars who have had heated arguments with The Boss. Bret "The Hitman" Hart is one of the most recognizable wrestlers who ever competed for WWE. He was one of the company's top stars for several years, but the relationship between the two sides imploded in 1997. McMahon was unable to afford the terms of Hart's 20-year contract due to financial hardships caused by the rise of WCW in 1996. With this in mind, he allowed the WWF Champion to sign a contract with the rival promotion. Hart was set to wrestle his last match at Survivor Series 1997, but he opposed the idea of losing his title to Shawn Michaels at the event. After a heated conversation, it was decided that the match would end in a disqualification. However, plans were changed at the last moment, and Michaels became the WWF Champion due to the legendary Montreal Screwjob. This outcome infuriated Hart, and he even spat on Vince McMahon's face. He went on to punch the chairman in the eye after everyone moved backstage. The aftermath of this shocking situation was described on an episode of Dark Side of the Ring. Thankfully, the issue was settled several years later, and Hart returned to WWE in 2010. In an episode of Confession Of The Hitman, the former WWF Champion admitted that he had forgiven HBK and Vince McMahon. "I think for anybody in life, I think I could say and give a message – it’s important to forgive," said Hart. "And it sets yourself free in a lot of the time by showing forgiveness. And I’ve forgiven and moved on, and I’m a much happier man for it." The Montreal Screwjob remains one of the most controversial incidents in the history of sports entertainment. For a brief period of rime, Nailz was one of the most prevalent WWF superstars in the early '90s. He might have been in line for a major push before he put his hands on Vince McMahon. The powerhouse had a financial dispute with the WWE Chairman regarding his contract. The Boss did not accept Nailz' proposal, which led to a heated argument between the two. Nailz went on to physically assault Vince McMahon in anger, and he was subsequently released from the company. He even made allegations against McMahon regarding steroid issues, but these claims were later proven wrong. Over the years, many superstars have confronted McMahon regarding their contracts. However, only a select few have crossed the line and physically assaulted their boss. Mustafa Ali has often impressed fans with his in-ring skills, and it always seemed like he was destined for stardom. But after being featured in underwhelming storylines for several years, he has publicly requested his release from the company. According to Sean Ross Sapp of Fightful Select, Ali was involved in a heated argument with the WWE Chairman before he asked for his release. The company had offered a new character to the former Retribution, and he reportedly he didn't care for the pitch. This disagreement led to a verbal conflict between Ali and McMahon. Back in November 2021, Ali was set to debut a new character that would introduce the WWE Universe to his "New America", but the company dropped the idea. Due to these changed plans, Ali has been missing from WWE programming since the beginning of November. At this time, it's unclear whether WWE will grant Ali's request. But he's an exceptionally talented superstar, so it's easy to imagine how he could thrive elsewhere. Brock Lesnar is among the biggest draws in WWE History, and he is believed to have a dominating nature backstage. Over the years, there have been multiple reports about the reigning WWE Champion arguing with Vince McMahon. At WrestleMania 34, Lesnar defeated Roman Reigns to retain his Universal Championship. Despite this win, he was in a furious mood when he returned backstage and legitimately threw the championship at McMahon. The Boss went on to yell some expletives at Lesnar with some expletives. A video of the incident is available on YouTube. Thankfully, they have seemingly settled this heat, and they are currently on good terms; The Beast Incarnate continues to be a vital asset for WWE. The Undertaker has remained one of Vince McMahon's closest friends. However, throughout his legendary career, he often raised his voice as the locker room leader. As a result, it's not surprising to hear that The Phenom has had multiple disputes with the WWE Chairman. For example, the two men were involved in a heated argument shortly after the infamous Montreal Screwjob incident. While speaking on The Bill Simmons Podcast, The Undertaker revealed that he was unhappy with the way McMahon took the title from Bret Hart. "I was pissed ... I was pissed about the whole thing because I felt like there, I possibly could've been used to get what we needed," said The Undertaker. "Take Shawn out of this, let me do it, and then I'll do business on the other side, and I think Bret probably would've went for that." He further revealed that he personally approached McMahon to make sure that such an incident would never happen again. '''If this kind of s*** happens again, you've got to involve me here, because it doesn't have to go down like this,'" The Undertaker continued. "And he [Vince McMahon] agreed. I guess it all worked out. It was sad. I'm really tight with Bret. Bret could've done some things differently; Shawn could've done things differently; Vince could've done things differently." McMahon seemingly listened to The Undertaker's message, as the Montreal Screwjob remains a unique incident. Decades later, the friendship between McMahon and The Undertaker continues to this day. The Phenom still occasionally appears on WWE programming, even after he retired in 2020. Poll : Which argument surprised you the most?
english
My new edema strategy might be working. I am still at it with this edema nightmare, but there might be light at the end of the tunnel. I am still not walking and now it's been about 10 days. I am a bit stir crazy, but I think this will go on until the leaking in my legs is stopped or almost stopped. I decided to research some exercises I can do that will: - strengthen me in general, since I can tell I am becoming very weak. One day I will be done with the edema, and I do not want to be too weak to carry on at that point. in one video I watched, the person stated that you need to get the fluid back to your trunk so that it can be urinated out. He said, "The fluid is not going to come out of your legs." I wish. But that got me thinking. Whenever I take the diuretic pill, I end up feeling sticky all over my body. This starts about an hour after I take the pill and goes on for many hours. So I think this is the local fluid coming out of my skin. This is everywhere and why I am so bloated up. In the past I have just been rinsing off a bit in the sink. I have expensive gauze bandages on my legs and do not want to change them more than I have to. I am in SE Asia where the shower is right near the toilet. I decided to try to shower this gunk off of me as soon as I felt it while avoiding my lower legs. The floodgates opened. I ended up showering at least 8 times in about 12 hours after taking that one pill. I would shower off and then be all sticky again in less than 2 hours. I also ended up needing to urinate way more often. Previously, there has been no odor to the fluid coming out. But with this showering idea, the smell of the stuff on my skin was DISGUSTING! After the first time showering, I was wanting to shower to not be sticky AND to get rid of the smell. So I'm thinking that what is sticky on my skin has just been sitting there for months under my skin. Inert, rotting fluid, doing me no good. This shower routine was completely exhausting and why I have not posted in a few days. I have been sleeping and also horribly dehydrated. The first day after this, I woke up with my tongue swollen and lips cracked. The good news is that my body is less bloated now. And it is surely more comfortable not to be sticky for hours on end. Tonight I just took half of the diuretic, and again was all sticky at 2 hours and at 3.5 hours. So it looks like I will be getting rid of more of this fluid. And yes, it smells terrible. In a couple of days I will try a full pill again and see how it goes. I hope that my theory is correct and that the fluid will leave quicker now. I hope you have enjoyed this gross story as much as I have. Anything to get this edema in my rear view mirror works for me. My post is for the "What does today mean for you" contest by @freedomshift for @team-ccc. Today I feel hopeful that I will soon be in better health. I feel somewhat better now, but have a long way to go. My photo for this post is of the limes I get here in Kuala Lumpur. They are tiny, inexpensive, plentiful and delicious. I make lime-aid to help with edema, an squeeze them on a lot of what I eat. This is my major Vitamin C source as well. The more yellow these limes are, the better. Then they are softer and sweeter. This is an Invitation to join #ccc for Guaranteed 👍 Daily Income 💵 and Payout 💸 for Newbies (2.0) 🐟 🐜 🐛 in #ccc 👣 and Follow 👣 the Honor Code 🏅 - the Creed (Conditions and Limits Inside) the latest update <<< please click to read.
english
The Central Bureau of Investigation had arrested the now-suspended railway officials on July 7. A special court in Odisha on Friday sent three railway officials accused in connection with the Balasore train accident to judicial custody, PTI reported. The three accused persons – senior section engineer Arun Kumar Mahanta, section engineer Mohammad Amir Khan and technician Pappu Kumar – were arrested by the Central Bureau of Investigation on July 7. On that day, the special court had granted five-day remand of the accused to the central agency. On July 11, the court had extended the remand period for four more days at the request of the investigating agency. The court will next hear the matter on July 27. The three accused have been booked under sections 304 (culpable homicide not amounting to murder) and 201 (destruction of evidence) of the Indian Penal Code and under Section 153 of the Railways Act, which deals with endangering the safety of rail travellers. On Wednesday, the Railways had also suspended seven employees, including Kumar, Khan, and Mahanta. Among those suspended are the station master on duty on the day of the accident, the traffic inspector at Balasore, the signal technician, and the assistant divisional signal and telecom engineer.
english
<filename>tasks/componentfeaturesandpricing_api_azure_component_current_billing_features_update.json { "description": "Update current billing features for an Application Insights component.", "input_method": "stdin", "parameters":{ "datavolumecap":{ "description": "An Application Insights component daily data volume cap", "type": "Optional[String[1]]" } , "resource_group_name":{ "description": "The name of the resource group.", "type": "Optional[String[1]]" } , "api_version":{ "description": "Client Api Version.", "type": "Optional[String[1]]" } , "subscription_id":{ "description": "The Azure subscription ID.", "type": "Optional[String[1]]" } , "resource_name":{ "description": "The name of the Application Insights component resource.", "type": "Optional[String[1]]" } , "billing_features_properties":{ "description": "Properties that need to be specified to update billing features for an Application Insights component.", "type": "Optional[String[1]]" } , "currentbillingfeatures":{ "description": "Current enabled pricing plan. When the component is in the Enterprise plan, this will list both 'Basic' and 'Application Insights Enterprise'.", "type": "Optional[String[1]]" } } }
json
"Tani pra, Job, dëgjo atë që kam për të thënë dhe vëru veshin gjithë fjalëve të mia! 2 Ja, unë po hap gojën dhe gjuha ime flet në gojën time. 3 Fjalët e mia burojnë nga një zemër e drejtë, buzët e mia do të thonë njohuri të pastra. 4 Fryma e Perëndisë më ka krijuar dhe fryma e të Plotfuqishmit më jep jetë. 5 Në rast se mundesh, m'u përgjigj; përgatitu gjithashtu të mbrosh pozitat e tua. 6 Ja, unë jam i barabartë me ty përpara Perëndisë; edhe unë jam formuar nga argjili. 7 Ja, asnjë frikë nga unë nuk duhet të të lemerisë, dhe dora ime nuk do të rëndojë mbi ty. 8 Por ti u ke thënë veshëve të mi dhe dëgjova tingullin e fjalëve të tua, që thonin: 9 "Una jam i pastër, pa mëkat; jam i pafajmë, nuk ka asnjë faj tek unë. 10 Por Perëndia gjen kundër meje shkaqe armiqësie dhe më konsideron armikun e tij; 11 i fut këmbët e mia në pranga dhe kqyr gjithë hapat e mia". 12 Mirë, pra, unë të them se këtu nuk ke të drejtë, sepse Perëndia është më i madh se njeriu. 13 Pse hahesh me të, kur ai nuk jep llogari për asnjë nga veprimet e tij? 14 Në fakt Perëndia flet në një mënyrë apo në një tjetër por njeriu nuk e vë re: 15 në një ëndërr, në një vegim të natës, kur një gjumë i rëndë i zë njerëzit, kur dremitin në shtretërit e tyre. 16 Atëherë ai hap veshët e njerëzve dhe vulos paralajmërimet që u bën, 17 për ta larguar njeriun nga veprimet e tij dhe për ta mbajtur larg nga kryelartësia, 18 për të shpëtuar shpirtin e tij nga gropa dhe për të penguar që jeta e tij të mbarojë nga shpata. 19 Njeriu paralajmërohet gjithashtu me dhembjen në shtratin e vet dhe me torturën e pandërprerë të kockave të tij, 20 aq sa i neveritet buka dhe madje edhe ushqimet më të shijshme. 21 Mishi konsumohet sa mbyll e hap sytë, ndërsa kockat e tij, që më parë nuk dukeshin, tani dalin jashtë; 22 kështu shpirti i tij i afrohet gropës dhe jeta e tij atyre që sjellin vdekjen. 23 Por në rast se pranë tij ka një engjëll, një interpret, një i vetëm ndër një mijë, që t'i tregojë njeriut detyrën e tij. 24 Perëndisë i vjen keq për të dhe thotë: "Kurseje që të mos zbresë në gropë; gjeta shpengimin për të". 25 Atëherë mishi i tij do të bëhet më i freskët se kur ishte fëmijë dhe ai do të kthehet në ditët e rinisë së tij. 26 Do t'i lutet fort Perëndisë, do të gjejë hir pranë tij dhe do të mund të sodisë fytyrën e tij me gëzim, sepse Perëndia do ta ketë rivendosur njeriun në drejtësinë e tij. 27 Duke iu drejtuar njerëzve, do të thotë: "Kam mëkatuar dhe kam shkelur drejtësinë, dhe nuk u ndëshkova siç e meritoja. 28 Perëndia i ka shpenguar shpirtin tim, që të mos zbriste në gropë dhe jeta ime mund të shohë dritën". 29 Ja, Perëndia e bën këtë dy herë, tri herë me njeriun, 30 për të shpëtuar shpirtin e tij nga gropa dhe për ta ndriçuar me dritën e jetës. 31 Ki kujdes, Jobi, dëgjomë; rri në heshtje, dhe unë do të flas. 32 Në qoftë se ke diçka për të thënë, përgjigjmu, folë, sepse do të dëshiroja të të jepja të drejtë. 33 Përndryshe dëgjomë; hesht dhe unë do të të mësoj diturinë".
english
{"template":{"small":"https://static-cdn.jtvnw.net/emoticons/v1/{image_id}/1.0","medium":"https://static-cdn.jtvnw.net/emoticons/v1/{image_id}/2.0","large":"https://static-cdn.jtvnw.net/emoticons/v1/{image_id}/3.0"},"channels":{"houseof3000":{"title":"HouseOf3000","channel_id":102361583,"link":"http://twitch.tv/houseof3000","desc":null,"plans":{"$4.99":"15692","$9.99":"31795","$24.99":"31796"},"id":"houseof3000","first_seen":null,"badge":"https://static-cdn.jtvnw.net/badges/v1/5008bfc0-da69-4695-a1b2-1997624e5d7b/1","badge_starting":"https://static-cdn.jtvnw.net/badges/v1/5008bfc0-da69-4695-a1b2-1997624e5d7b/3","badge_3m":null,"badge_6m":null,"badge_12m":null,"badge_24m":null,"badges":[{"image_url_1x":"https://static-cdn.jtvnw.net/badges/v1/5008bfc0-da69-4695-a1b2-1997624e5d7b/1","image_url_2x":"https://static-cdn.jtvnw.net/badges/v1/5008bfc0-da69-4695-a1b2-1997624e5d7b/2","image_url_4x":"https://static-cdn.jtvnw.net/badges/v1/5008bfc0-da69-4695-a1b2-1997624e5d7b/3","description":"Subscriber","title":"Subscriber","click_action":"subscribe_to_channel","click_url":""}],"bits_badges":null,"cheermote1":null,"cheermote100":null,"cheermote1000":null,"cheermote5000":null,"cheermote10000":null,"set":15692,"emotes":[{"code":"ho3kSleeper","image_id":77136,"set":15692},{"code":"ho3kSpiritBomb","image_id":78417,"set":15692},{"code":"ho3kMensa","image_id":211222,"set":31795},{"code":"ho3kMikeChamp","image_id":209951,"set":31796},{"code":"ho3kHeader","image_id":211199,"set":15692},{"code":"ho3kWow","image_id":211705,"set":15692},{"code":"ho3kGuessies","image_id":286032,"set":15692}]}}}
json
Bhopal: Right-wing groups including the Vishva Hindu Parishad organised an awareness rally for the Ram temple donation drive, which took off from Khajuri village in the Bhopal district of Madhya Pradesh Sunday amid saffron flags, blaring music and a huge crowd. The local police was also present. The rally started at around 4 pm, with the organisers and children sitting inside an open jeep informing people about the drive. Women came out in large numbers and even sang devotional songs. The DJ too played devotional songs as children danced to the tunes. Similar rallies are being organised across the country to inform the people about the upcoming donation drive for the construction of Ram temple in Ayodhya. The drive will begin from 15 January. “We were informed about this rally by a local and we decided to be part of Ram ji ki baraat,” said Kaanta Mevada, a resident of Khajuri. More such rallies and processions will be organised in the next few days.
english
As per the official notification, the vacancy for the posts of lecturers in the polytechnic colleges will be held through recruitment process, which will be conducted for 15 subjects. There are 219 vacancies for Mechanical Engineering, 134 for Computer Engineering, 118 for Electronics and Communication Engineering, and 112 for Civil Engineering among others. However, the vacancies are not available for lecturer in architecture. A total of 1060 vacancies are up for recruitment through TB TRB Polytechnic lecturer application process. The application process will start soon and other important dates are expected to release by the TNTRB by next week. All the interested candidates who want to fill the application form for TN TRB Polytechnic Lecturer Recruitment 2019 should be below the age of 57 to apply for the lecturer post. For education qualification, the candidate should have passed Bachelor’s degree in engineering in the appropriate branch, with at least 60 per cent marks. The Master’s degree (first class) in an appropriate branch is required for non-engineering subjects.
english
<reponame>andybangs/react-matchable<filename>src/sagas/index.js import fetch from 'isomorphic-fetch'; import { take, fork, put, call } from 'redux-saga/effects'; import { requestQuiz, receiveQuiz, setState, tickTimer } from '../actions'; import { FETCH_QUIZ } from '../constants'; import { PLAYING, END } from '../constants/gameStates'; import demoQuiz from '../../mock_api/authorQuiz'; function fetchQuizApi(id) { // TODO: Replace mock API return fetch(`http://localhost:5555/${id}`) .then(res => { if (!res.ok) throw Error(res.statusText); return res.json(); }) .catch(err => { console.error(err); console.log('Demo quiz returned from failed fetchQuizApi call'); return demoQuiz; }); } function* fetchQuiz(id) { yield put(requestQuiz()); const quiz = yield call(fetchQuizApi, id); yield put(receiveQuiz(quiz)); } function* watchFetch() { while (true) { const action = yield take(FETCH_QUIZ); yield fork(fetchQuiz, action.id); } } // wait :: Number -> Promise function wait(ms) { return new Promise(resolve => { setTimeout(() => resolve(), ms); }); } function* runTimer(getState) { while (getState().quiz.data.gameState !== PLAYING) { while (true) { yield call(wait, 1000); if (getState().quiz.data.gameState === PLAYING) { if (getState().timer.seconds > 0) { yield put(tickTimer()); } else { yield put(setState(END)); } } else { break; } } } } export default [watchFetch, runTimer];
javascript
Using apocalyptic images, three presidents and seven foreign ministers have warned that a warmer world is also a more violent one. At a ministerial meeting of the Security Council, the officials Thursday urged the UN’s most powerful body to do more to address the security implications of climate change and make global warming a key part of all UN peacekeeping operations. The leaders and ministers pushing for more UN action said warming is making the world less safe, pointing to Africa’s conflict-plagued Sahel region and Syria and Iraq as examples. . The Security Council first discussed the impact of climate on peace and security in 2007 and has held a number of meetings about it since, most recently in February. But it remains off the council’s agenda because of divisions among members. That means there can be no legally binding resolutions or official requests for action. For years, academics who study conflict and climate change have been highlighting how events like a once-in-a-millennium Syrian drought have exacerbated conflicts without being the sole causes. It’s a more nuanced approach to understanding conflict – and to developing tools that reduce its impact on societies. “Look at almost every place where you see threats to international peace and security today, and you’ll find that climate change is making things less peaceful, less secure, and rendering our response even more challenging,” US Secretary of State Antony Blinken said. He cited a list of nations including Syria, Mali, Yemen, South Sudan and Ethiopia. Russian and Chinese diplomats reiterated their countries’ objections to putting climate change on the agenda of the council, which is charged with maintaining international peace and security, when other UN and international forums are addressing the entire climate issue. Still, most of the leaders who spoke Thursday morning painted a gloomy picture for the planet as a whole. They said climate change needs to be fought in the same way the world is battling the coronavirus because, for the planet, it is a matter of life and death. Decisions at the November UN climate conference in Glasgow, Scotland “will decide whether this decade will be remembered as the decade when we started to save the planet or the beginning of the end,” said Estonia President Kersti Jaljulaid. And the previous evening, British Prime Minister Boris Johnson, who will host the climate negotiations in Scotland, gave a speech that started with a lesson on extinction among mammals – and then reminded the world that humans, too, are mammals.
english
<gh_stars>0 {"remainingRequest":"/Users/c5281434/Documents/Project/yshopmall_qd-master/node_modules/_babel-loader@8.1.0@babel-loader/lib/index.js!/Users/c5281434/Documents/Project/yshopmall_qd-master/src/api/monitor/log.js","dependencies":[{"path":"/Users/c5281434/Documents/Project/yshopmall_qd-master/src/api/monitor/log.js","mtime":1590767910000},{"path":"/Users/c5281434/Documents/Project/yshopmall_qd-master/node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/Users/c5281434/Documents/Project/yshopmall_qd-master/node_modules/_babel-loader@8.1.0@babel-loader/lib/index.js","mtime":499162500000}],"contextDependencies":[],"result":["\"use strict\";\n\nvar _interopRequireDefault = require(\"/Users/c5281434/Documents/Project/yshopmall_qd-master/node_modules/@babel/runtime/helpers/interopRequireDefault\");\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getErrDetail = getErrDetail;\nexports.delAllError = delAllError;\nexports.delAllInfo = delAllInfo;\n\nvar _request = _interopRequireDefault(require(\"@/utils/request\"));\n\nfunction getErrDetail(id) {\n return (0, _request.default)({\n url: 'api/logs/error/' + id,\n method: 'get'\n });\n}\n\nfunction delAllError() {\n return (0, _request.default)({\n url: 'api/logs/del/error',\n method: 'delete'\n });\n}\n\nfunction delAllInfo() {\n return (0, _request.default)({\n url: 'api/logs/del/info',\n method: 'delete'\n });\n}",null]}
json
/**/__twttr.receiveCount({"count":25,"url":"http:\/\/openexchangerates.github.io\/accounting.js\/"});
json
How to create a sub-member? - Click on Add New Sub-Member button. - Here you need to give required permission to the Sub-Member and click on save button. What do you think about the above article?
english
<gh_stars>1-10 /* * Copyright (C) 2014-2015 Open Source Robotics 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. * */ #include <boost/bind.hpp> #include <boost/thread/recursive_mutex.hpp> #include <string> #include <vector> #include "gazebo/common/MouseEvent.hh" #include "gazebo/rendering/ogre_gazebo.h" #include "gazebo/rendering/DynamicLines.hh" #include "gazebo/rendering/Visual.hh" #include "gazebo/rendering/JointVisual.hh" #include "gazebo/rendering/UserCamera.hh" #include "gazebo/rendering/Scene.hh" #include "gazebo/rendering/RenderTypes.hh" #include "gazebo/gui/GuiIface.hh" #include "gazebo/gui/KeyEventHandler.hh" #include "gazebo/gui/MouseEventHandler.hh" #include "gazebo/gui/GuiEvents.hh" #include "gazebo/gui/MainWindow.hh" #include "gazebo/gui/model/JointInspector.hh" #include "gazebo/gui/model/ModelEditorEvents.hh" #include "gazebo/gui/model/JointMaker.hh" using namespace gazebo; using namespace gui; std::map<JointMaker::JointType, std::string> JointMaker::jointTypes; std::map<JointMaker::JointType, std::string> JointMaker::jointMaterials; ///////////////////////////////////////////////// JointMaker::JointMaker() { this->unitVectors.push_back(ignition::math::Vector3d::UnitX); this->unitVectors.push_back(ignition::math::Vector3d::UnitY); this->unitVectors.push_back(ignition::math::Vector3d::UnitZ); this->newJointCreated = false; this->mouseJoint = NULL; this->modelSDF.reset(); this->jointType = JointMaker::JOINT_NONE; this->jointCounter = 0; this->jointMaterials[JOINT_FIXED] = "Gazebo/Red"; this->jointMaterials[JOINT_HINGE] = "Gazebo/Orange"; this->jointMaterials[JOINT_HINGE2] = "Gazebo/DarkYellow"; this->jointMaterials[JOINT_SLIDER] = "Gazebo/Green"; this->jointMaterials[JOINT_SCREW] = "Gazebo/DarkGrey"; this->jointMaterials[JOINT_UNIVERSAL] = "Gazebo/Blue"; this->jointMaterials[JOINT_BALL] = "Gazebo/Purple"; this->jointMaterials[JOINT_GEARBOX] = "Gazebo/Indigo"; this->jointTypes[JOINT_FIXED] = "fixed"; this->jointTypes[JOINT_HINGE] = "revolute"; this->jointTypes[JOINT_HINGE2] = "revolute2"; this->jointTypes[JOINT_SLIDER] = "prismatic"; this->jointTypes[JOINT_SCREW] = "screw"; this->jointTypes[JOINT_UNIVERSAL] = "universal"; this->jointTypes[JOINT_BALL] = "ball"; this->jointTypes[JOINT_GEARBOX] = "gearbox"; this->jointTypes[JOINT_NONE] = "none"; this->connections.push_back( event::Events::ConnectPreRender( boost::bind(&JointMaker::Update, this))); this->connections.push_back( gui::model::Events::ConnectOpenJointInspector( boost::bind(&JointMaker::OpenInspector, this, _1))); this->connections.push_back( gui::model::Events::ConnectShowJointContextMenu( boost::bind(&JointMaker::ShowContextMenu, this, _1))); this->connections.push_back( gui::model::Events::ConnectSetSelectedJoint( boost::bind(&JointMaker::OnSetSelectedJoint, this, _1, _2))); this->connections.push_back( event::Events::ConnectSetSelectedEntity( boost::bind(&JointMaker::OnSetSelectedEntity, this, _1, _2))); this->inspectAct = new QAction(tr("Open Joint Inspector"), this); connect(this->inspectAct, SIGNAL(triggered()), this, SLOT(OnOpenInspector())); this->updateMutex = new boost::recursive_mutex(); // Gazebo event connections this->connections.push_back( gui::model::Events::ConnectLinkInserted( boost::bind(&JointMaker::OnLinkInserted, this, _1))); this->connections.push_back( gui::model::Events::ConnectLinkRemoved( boost::bind(&JointMaker::OnLinkRemoved, this, _1))); } ///////////////////////////////////////////////// JointMaker::~JointMaker() { if (this->mouseJoint) { delete this->mouseJoint; this->mouseJoint = NULL; } { boost::recursive_mutex::scoped_lock lock(*this->updateMutex); while (this->joints.size() > 0) { std::string jointName = this->joints.begin()->first; this->RemoveJoint(jointName); } this->joints.clear(); } delete this->updateMutex; } ///////////////////////////////////////////////// void JointMaker::Reset() { boost::recursive_mutex::scoped_lock lock(*this->updateMutex); this->newJointCreated = false; if (this->mouseJoint) { delete this->mouseJoint; this->mouseJoint = NULL; } this->jointType = JointMaker::JOINT_NONE; this->selectedVis.reset(); this->hoverVis.reset(); this->inspectName = ""; this->selectedJoints.clear(); this->scopedLinkedNames.clear(); while (!this->joints.empty()) { std::string jointId = this->joints.begin()->first; this->RemoveJoint(jointId); } this->joints.clear(); } ///////////////////////////////////////////////// void JointMaker::EnableEventHandlers() { MouseEventHandler::Instance()->AddDoubleClickFilter("model_joint", boost::bind(&JointMaker::OnMouseDoubleClick, this, _1)); MouseEventHandler::Instance()->AddReleaseFilter("model_joint", boost::bind(&JointMaker::OnMouseRelease, this, _1)); MouseEventHandler::Instance()->AddPressFilter("model_joint", boost::bind(&JointMaker::OnMousePress, this, _1)); KeyEventHandler::Instance()->AddPressFilter("model_joint", boost::bind(&JointMaker::OnKeyPress, this, _1)); } ///////////////////////////////////////////////// void JointMaker::DisableEventHandlers() { MouseEventHandler::Instance()->RemoveDoubleClickFilter("model_joint"); MouseEventHandler::Instance()->RemoveReleaseFilter("model_joint"); MouseEventHandler::Instance()->RemovePressFilter("model_joint"); MouseEventHandler::Instance()->RemoveMoveFilter("model_joint"); KeyEventHandler::Instance()->RemovePressFilter("model_joint"); } ///////////////////////////////////////////////// void JointMaker::RemoveJoint(const std::string &_jointId) { boost::recursive_mutex::scoped_lock lock(*this->updateMutex); auto jointIt = this->joints.find(_jointId); if (jointIt != this->joints.end()) { // Copy the ID before it is deleted std::string jointId = _jointId; JointData *joint = jointIt->second; rendering::ScenePtr scene = joint->hotspot->GetScene(); scene->GetManager()->destroyBillboardSet(joint->handles); scene->RemoveVisual(joint->hotspot); scene->RemoveVisual(joint->visual); joint->visual->Fini(); if (joint->jointVisual) { rendering::JointVisualPtr parentAxisVis = joint->jointVisual ->GetParentAxisVisual(); if (parentAxisVis) { parentAxisVis->GetParent()->DetachVisual( parentAxisVis->GetName()); scene->RemoveVisual(parentAxisVis); } joint->jointVisual->GetParent()->DetachVisual( joint->jointVisual->GetName()); scene->RemoveVisual(joint->jointVisual); } joint->hotspot.reset(); joint->visual.reset(); joint->jointVisual.reset(); joint->parent.reset(); joint->child.reset(); joint->inspector->hide(); delete joint->inspector; delete joint; this->joints.erase(jointIt); gui::model::Events::modelChanged(); gui::model::Events::jointRemoved(jointId); } } ///////////////////////////////////////////////// void JointMaker::RemoveJointsByLink(const std::string &_linkName) { std::vector<std::string> toDelete; for (auto it : this->joints) { JointData *joint = it.second; if (joint->child->GetName() == _linkName || joint->parent->GetName() == _linkName) { toDelete.push_back(it.first); } } for (unsigned i = 0; i < toDelete.size(); ++i) this->RemoveJoint(toDelete[i]); toDelete.clear(); } ///////////////////////////////////////////////// std::vector<JointData *> JointMaker::GetJointDataByLink( const std::string &_linkName) const { std::vector<JointData *> linkJoints; for (auto jointIt : this->joints) { JointData *jointData = jointIt.second; if (jointData->child->GetName() == _linkName || jointData->parent->GetName() == _linkName) { linkJoints.push_back(jointData); } } return linkJoints; } ///////////////////////////////////////////////// bool JointMaker::OnMousePress(const common::MouseEvent &_event) { rendering::UserCameraPtr camera = gui::get_active_camera(); if (_event.Button() == common::MouseEvent::MIDDLE) { QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor)); camera->HandleMouseEvent(_event); return true; } else if (_event.Button() != common::MouseEvent::LEFT) return false; if (this->jointType != JointMaker::JOINT_NONE) return false; // intercept mouse press events when user clicks on the joint hotspot visual rendering::VisualPtr vis = camera->GetVisual(_event.Pos()); if (vis) { if (this->joints.find(vis->GetName()) != this->joints.end()) { // stop event propagation as we don't want users to manipulate the // hotspot return true; } } return false; } ///////////////////////////////////////////////// bool JointMaker::OnMouseRelease(const common::MouseEvent &_event) { rendering::UserCameraPtr camera = gui::get_active_camera(); if (this->jointType == JointMaker::JOINT_NONE) { rendering::VisualPtr vis = camera->GetVisual(_event.Pos()); if (vis) { if (this->joints.find(vis->GetName()) != this->joints.end()) { // trigger joint inspector on right click if (_event.Button() == common::MouseEvent::RIGHT) { this->inspectName = vis->GetName(); this->ShowContextMenu(this->inspectName); return true; } else if (_event.Button() == common::MouseEvent::LEFT) { // Not in multi-selection mode. if (!(QApplication::keyboardModifiers() & Qt::ControlModifier)) { this->DeselectAll(); this->SetSelected(vis, true); } // Multi-selection mode else { auto it = std::find(this->selectedJoints.begin(), this->selectedJoints.end(), vis); // Highlight and select clicked joint if not already selected // Otherwise deselect if already selected this->SetSelected(vis, it == this->selectedJoints.end()); } } } else this->DeselectAll(); return false; } } else { if (_event.Button() == common::MouseEvent::LEFT) { if (this->hoverVis) { if (this->hoverVis->IsPlane()) { QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor)); camera->HandleMouseEvent(_event); return true; } // Pressed parent link if (!this->selectedVis) { if (this->mouseJoint) return false; this->hoverVis->SetEmissive(common::Color(0, 0, 0)); this->selectedVis = this->hoverVis; this->hoverVis.reset(); // Create joint data with selected visual as parent // the child will be set on the second mouse release. this->mouseJoint = this->CreateJointLine("JOINT_LINE", this->selectedVis); } // Pressed child link else if (this->selectedVis != this->hoverVis) { if (this->hoverVis) this->hoverVis->SetEmissive(common::Color(0, 0, 0)); if (this->selectedVis) this->selectedVis->SetEmissive(common::Color(0, 0, 0)); this->mouseJoint->child = this->hoverVis; JointData *newJoint = this->CreateJoint(this->mouseJoint->parent, this->mouseJoint->child); this->Stop(); this->mouseJoint = newJoint; this->newJointCreated = true; gui::model::Events::modelChanged(); } } } QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor)); camera->HandleMouseEvent(_event); return true; } return false; } ///////////////////////////////////////////////// JointData *JointMaker::CreateJointLine(const std::string &_name, rendering::VisualPtr _parent) { rendering::VisualPtr jointVis( new rendering::Visual(_name, _parent->GetParent())); jointVis->Load(); rendering::DynamicLines *jointLine = jointVis->CreateDynamicLine(rendering::RENDERING_LINE_LIST); math::Vector3 origin = _parent->GetWorldPose().pos - _parent->GetParent()->GetWorldPose().pos; jointLine->AddPoint(origin); jointLine->AddPoint(origin + math::Vector3(0, 0, 0.1)); jointVis->GetSceneNode()->setInheritScale(false); jointVis->GetSceneNode()->setInheritOrientation(false); std::string jointVisName = jointVis->GetName(); std::string leafName = jointVisName; size_t pIdx = jointVisName.rfind("::"); if (pIdx != std::string::npos) leafName = jointVisName.substr(pIdx+2); JointData *jointData = new JointData(); jointData->dirty = false; jointData->name = leafName; jointData->visual = jointVis; jointData->parent = _parent; jointData->line = jointLine; jointData->type = this->jointType; jointData->line->setMaterial(this->jointMaterials[jointData->type]); return jointData; } ///////////////////////////////////////////////// JointData *JointMaker::CreateJoint(rendering::VisualPtr _parent, rendering::VisualPtr _child) { std::stringstream ss; ss << _parent->GetName() << "_JOINT_" << this->jointCounter++; JointData *jointData = this->CreateJointLine(ss.str(), _parent); jointData->child = _child; // Inspector jointData->inspector = new JointInspector(this); jointData->inspector->setModal(false); connect(jointData->inspector, SIGNAL(Applied()), jointData, SLOT(OnApply())); MainWindow *mainWindow = gui::get_main_window(); if (mainWindow) { connect(gui::get_main_window(), SIGNAL(Close()), jointData->inspector, SLOT(close())); } // setup the joint msg jointData->jointMsg.reset(new msgs::Joint); jointData->jointMsg->set_name(jointData->name); if (jointData->parent) { std::string jointParentName = jointData->parent->GetName(); std::string leafName = jointParentName; size_t pIdx = jointParentName.rfind("::"); if (pIdx != std::string::npos) leafName = jointParentName.substr(pIdx+2); jointData->jointMsg->set_parent(leafName); jointData->jointMsg->set_parent_id(jointData->parent->GetId()); } if (jointData->child) { std::string jointChildName = jointData->child->GetName(); std::string leafName = jointChildName; size_t pIdx = jointChildName.rfind("::"); if (pIdx != std::string::npos) leafName = jointChildName.substr(pIdx+2); jointData->jointMsg->set_child(leafName); jointData->jointMsg->set_child_id(jointData->child->GetId()); } msgs::Set(jointData->jointMsg->mutable_pose(), ignition::math::Pose3d::Zero); jointData->jointMsg->set_type( msgs::ConvertJointType(this->GetTypeAsString(jointData->type))); unsigned int axisCount = JointMaker::GetJointAxisCount(jointData->type); for (unsigned int i = 0; i < axisCount; ++i) { msgs::Axis *axisMsg; if (i == 0u) { axisMsg = jointData->jointMsg->mutable_axis1(); } else if (i == 1u) { axisMsg = jointData->jointMsg->mutable_axis2(); } else { gzerr << "Invalid axis index[" << i << "]" << std::endl; continue; } if (jointData->type == JointMaker::JOINT_GEARBOX) msgs::Set(axisMsg->mutable_xyz(), ignition::math::Vector3d::UnitZ); else { msgs::Set(axisMsg->mutable_xyz(), this->unitVectors[i%this->unitVectors.size()]); } axisMsg->set_use_parent_model_frame(false); axisMsg->set_limit_lower(-GZ_DBL_MAX); axisMsg->set_limit_upper(GZ_DBL_MAX); axisMsg->set_limit_effort(-1); axisMsg->set_limit_velocity(-1); axisMsg->set_damping(0); // Add angle field after we've checked that index i is valid jointData->jointMsg->add_angle(0); } jointData->jointMsg->set_limit_erp(0.2); jointData->jointMsg->set_suspension_erp(0.2); jointData->inspector->Update(jointData->jointMsg); return jointData; } ///////////////////////////////////////////////// JointMaker::JointType JointMaker::ConvertJointType(const std::string &_type) { for (auto iter : jointTypes) if (iter.second == _type) return iter.first; return JOINT_NONE; } ///////////////////////////////////////////////// std::string JointMaker::GetJointMaterial(const std::string &_type) { auto it = jointMaterials.find(ConvertJointType(_type)); if (it != jointMaterials.end()) return it->second; else return ""; } ///////////////////////////////////////////////// void JointMaker::AddJoint(const std::string &_type) { this->AddJoint(this->ConvertJointType(_type)); } ///////////////////////////////////////////////// void JointMaker::AddJoint(JointMaker::JointType _type) { this->jointType = _type; if (_type != JointMaker::JOINT_NONE) { // Add an event filter, which allows the JointMaker to capture mouse events. MouseEventHandler::Instance()->AddMoveFilter("model_joint", boost::bind(&JointMaker::OnMouseMove, this, _1)); } else { // Remove the event filters. MouseEventHandler::Instance()->RemoveMoveFilter("model_joint"); // signal the end of a joint action. emit JointAdded(); } } ///////////////////////////////////////////////// void JointMaker::Stop() { if (this->jointType != JointMaker::JOINT_NONE) { this->newJointCreated = false; if (this->mouseJoint) { this->mouseJoint->visual->DeleteDynamicLine(this->mouseJoint->line); rendering::ScenePtr scene = this->mouseJoint->visual->GetScene(); scene->RemoveVisual(this->mouseJoint->visual); this->mouseJoint->visual.reset(); delete this->mouseJoint; this->mouseJoint = NULL; } this->AddJoint(JointMaker::JOINT_NONE); if (this->hoverVis) this->hoverVis->SetEmissive(common::Color(0, 0, 0)); if (this->selectedVis) this->selectedVis->SetEmissive(common::Color(0, 0, 0)); this->selectedVis.reset(); this->hoverVis.reset(); } } ///////////////////////////////////////////////// bool JointMaker::OnMouseMove(const common::MouseEvent &_event) { // Get the active camera and scene. rendering::UserCameraPtr camera = gui::get_active_camera(); if (_event.Dragging()) { // this enables the joint maker to pan while connecting joints QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor)); camera->HandleMouseEvent(_event); return true; } rendering::VisualPtr vis = camera->GetVisual(_event.Pos()); // Highlight visual on hover if (vis) { if (this->hoverVis && this->hoverVis != this->selectedVis) this->hoverVis->SetEmissive(common::Color(0.0, 0.0, 0.0)); // only highlight editor links by making sure it's not an item in the // gui tree widget or a joint hotspot. rendering::VisualPtr rootVis = vis->GetRootVisual(); if (rootVis->IsPlane()) this->hoverVis = vis->GetParent(); else if (!gui::get_entity_id(rootVis->GetName()) && vis->GetName().find("_UNIQUE_ID_") == std::string::npos) { this->hoverVis = vis->GetParent(); if (!this->selectedVis || (this->selectedVis && this->hoverVis != this->selectedVis)) this->hoverVis->SetEmissive(common::Color(0.5, 0.5, 0.5)); } } // Case when a parent link is already selected and currently // extending the joint line to a child link if (this->selectedVis && this->hoverVis && this->mouseJoint && this->mouseJoint->line) { math::Vector3 parentPos; // Set end point to center of child link if (!this->hoverVis->IsPlane()) { if (this->mouseJoint->parent) { parentPos = this->GetLinkWorldCentroid(this->mouseJoint->parent) - this->mouseJoint->line->GetPoint(0); this->mouseJoint->line->SetPoint(1, this->GetLinkWorldCentroid(this->hoverVis) - parentPos); } } else { // Set end point to mouse plane intersection math::Vector3 pt; camera->GetWorldPointOnPlane(_event.Pos().X(), _event.Pos().Y(), math::Plane(math::Vector3(0, 0, 1)), pt); if (this->mouseJoint->parent) { parentPos = this->GetLinkWorldCentroid(this->mouseJoint->parent) - this->mouseJoint->line->GetPoint(0); this->mouseJoint->line->SetPoint(1, this->GetLinkWorldCentroid(this->hoverVis) - parentPos + pt); } } } return true; } ///////////////////////////////////////////////// void JointMaker::OnOpenInspector() { if (this->inspectName.empty()) return; this->OpenInspector(this->inspectName); this->inspectName = ""; } ///////////////////////////////////////////////// void JointMaker::OpenInspector(const std::string &_jointId) { JointData *joint = this->joints[_jointId]; if (!joint) { gzerr << "Joint [" << _jointId << "] not found." << std::endl; return; } joint->OpenInspector(); } ///////////////////////////////////////////////// bool JointMaker::OnMouseDoubleClick(const common::MouseEvent &_event) { rendering::UserCameraPtr camera = gui::get_active_camera(); rendering::VisualPtr vis = camera->GetVisual(_event.Pos()); if (vis) { if (this->joints.find(vis->GetName()) != this->joints.end()) { this->OpenInspector(vis->GetName()); return true; } } return false; } ///////////////////////////////////////////////// bool JointMaker::OnKeyPress(const common::KeyEvent &_event) { if (_event.key == Qt::Key_Delete) { if (!this->selectedJoints.empty()) { for (auto jointVis : this->selectedJoints) { this->RemoveJoint(jointVis->GetName()); } this->DeselectAll(); return true; } } return false; } ///////////////////////////////////////////////// void JointMaker::OnDelete() { if (this->inspectName.empty()) return; this->RemoveJoint(this->inspectName); this->inspectName = ""; } ///////////////////////////////////////////////// void JointMaker::CreateHotSpot(JointData *_joint) { if (!_joint) return; rendering::UserCameraPtr camera = gui::get_active_camera(); // Joint hotspot visual name is the JointId for easy access when clicking std::string jointId = _joint->visual->GetName() + "_UNIQUE_ID_"; rendering::VisualPtr hotspotVisual( new rendering::Visual(jointId, _joint->visual, false)); // create a cylinder to represent the joint hotspotVisual->InsertMesh("unit_cylinder"); Ogre::MovableObject *hotspotObj = (Ogre::MovableObject*)(camera->GetScene()->GetManager()->createEntity( _joint->visual->GetName(), "unit_cylinder")); hotspotObj->getUserObjectBindings().setUserAny(Ogre::Any(jointId)); hotspotVisual->GetSceneNode()->attachObject(hotspotObj); hotspotVisual->SetMaterial(this->jointMaterials[_joint->type]); hotspotVisual->SetTransparency(0.7); // create a handle at the parent end Ogre::BillboardSet *handleSet = camera->GetScene()->GetManager()->createBillboardSet(1); handleSet->setAutoUpdate(true); handleSet->setMaterialName("Gazebo/PointHandle"); Ogre::MaterialPtr mat = Ogre::MaterialManager::getSingleton().getByName( this->jointMaterials[_joint->type]); Ogre::ColourValue color = mat->getTechnique(0)->getPass(0)->getDiffuse(); color.a = 0.5; double linkSize = std::min(0.1, _joint->parent->GetBoundingBox().GetSize().GetLength()*0.05); linkSize = std::max(linkSize, 0.01); double dimension = linkSize; handleSet->setDefaultDimensions(dimension, dimension); Ogre::Billboard *parentHandle = handleSet->createBillboard(0, 0, 0); parentHandle->setColour(color); Ogre::SceneNode *handleNode = hotspotVisual->GetSceneNode()->createChildSceneNode(); handleNode->attachObject(handleSet); handleNode->setInheritScale(false); handleNode->setInheritOrientation(false); _joint->handles = handleSet; hotspotVisual->SetVisibilityFlags(GZ_VISIBILITY_GUI | GZ_VISIBILITY_SELECTABLE); hotspotVisual->GetSceneNode()->setInheritScale(false); this->joints[jointId] = _joint; camera->GetScene()->AddVisual(hotspotVisual); _joint->hotspot = hotspotVisual; _joint->inspector->SetJointId(_joint->hotspot->GetName()); std::string parentName = _joint->parent->GetName(); std::string childName = _joint->child->GetName(); gui::model::Events::jointInserted(jointId, _joint->name, jointTypes[_joint->type], parentName, childName); } ///////////////////////////////////////////////// void JointMaker::Update() { boost::recursive_mutex::scoped_lock lock(*this->updateMutex); if (this->newJointCreated) { this->CreateHotSpot(this->mouseJoint); this->mouseJoint = NULL; this->newJointCreated = false; } // Update each joint for (auto it : this->joints) { JointData *joint = it.second; if (joint->hotspot) { if (joint->child && joint->parent) { bool poseUpdate = false; if (joint->parentPose != joint->parent->GetWorldPose() || joint->childPose != joint->child->GetWorldPose() || joint->childScale != joint->child->GetScale()) { joint->parentPose = joint->parent->GetWorldPose(); joint->childPose = joint->child->GetWorldPose(); joint->childScale = joint->child->GetScale(); poseUpdate = true; } // Create / update joint visual if (joint->dirty || poseUpdate) { joint->Update(); } } } } } ///////////////////////////////////////////////// void JointMaker::AddScopedLinkName(const std::string &_name) { this->scopedLinkedNames.push_back(_name); } ///////////////////////////////////////////////// std::string JointMaker::GetScopedLinkName(const std::string &_name) { for (unsigned int i = 0; i < this->scopedLinkedNames.size(); ++i) { std::string scopedName = this->scopedLinkedNames[i]; size_t idx = scopedName.find("::" + _name); if (idx != std::string::npos) return scopedName; } return _name; } ///////////////////////////////////////////////// void JointMaker::GenerateSDF() { this->modelSDF.reset(new sdf::Element); sdf::initFile("model.sdf", this->modelSDF); this->modelSDF->ClearElements(); // loop through all joints for (auto jointsIt : this->joints) { JointData *joint = jointsIt.second; sdf::ElementPtr jointElem = this->modelSDF->AddElement("joint"); msgs::JointPtr jointMsg = joint->jointMsg; unsigned int axisCount = GetJointAxisCount(joint->type); for (unsigned int i = axisCount; i < 2u; ++i) { if (i == 0u) jointMsg->clear_axis1(); else if (i == 1u) jointMsg->clear_axis2(); } jointElem = msgs::JointToSDF(*jointMsg.get(), jointElem); sdf::ElementPtr parentElem = jointElem->GetElement("parent"); std::string parentName = joint->parent->GetName(); size_t pIdx = parentName.find("::"); if (pIdx != std::string::npos) parentName = parentName.substr(pIdx+2); parentElem->Set(parentName); sdf::ElementPtr childElem = jointElem->GetElement("child"); std::string childName = joint->child->GetName(); size_t cIdx = childName.find("::"); if (cIdx != std::string::npos) childName = childName.substr(cIdx+2); childElem->Set(childName); } } ///////////////////////////////////////////////// sdf::ElementPtr JointMaker::GetSDF() const { return this->modelSDF; } ///////////////////////////////////////////////// std::string JointMaker::GetTypeAsString(JointMaker::JointType _type) { std::string jointTypeStr = ""; auto iter = jointTypes.find(_type); if (iter != jointTypes.end()) jointTypeStr = iter->second; return jointTypeStr; } ///////////////////////////////////////////////// unsigned int JointMaker::GetJointAxisCount(JointMaker::JointType _type) { if (_type == JOINT_FIXED) { return 0; } else if (_type == JOINT_HINGE) { return 1; } else if (_type == JOINT_HINGE2) { return 2; } else if (_type == JOINT_SLIDER) { return 1; } else if (_type == JOINT_SCREW) { return 1; } else if (_type == JOINT_UNIVERSAL) { return 2; } else if (_type == JOINT_BALL) { return 0; } else if (_type == JOINT_GEARBOX) { return 2; } return 0; } ///////////////////////////////////////////////// JointMaker::JointType JointMaker::GetState() const { return this->jointType; } ///////////////////////////////////////////////// math::Vector3 JointMaker::GetLinkWorldCentroid( const rendering::VisualPtr _visual) { math::Vector3 centroid; int count = 0; for (unsigned int i = 0; i < _visual->GetChildCount(); ++i) { if (_visual->GetChild(i)->GetName().find("_JOINT_VISUAL_") == std::string::npos) { centroid += _visual->GetChild(i)->GetWorldPose().pos; count++; } } centroid /= count; return centroid; } ///////////////////////////////////////////////// unsigned int JointMaker::GetJointCount() { return this->joints.size(); } ///////////////////////////////////////////////// void JointData::OnApply() { // Get data from inspector msgs::Joint *inspectorMsg = this->inspector->GetData(); if (!inspectorMsg) return; this->jointMsg->CopyFrom(*inspectorMsg); // Name if (this->name != this->jointMsg->name()) gui::model::Events::jointNameChanged(this->hotspot->GetName(), this->jointMsg->name()); this->name = this->jointMsg->name(); // Type this->type = JointMaker::ConvertJointType( msgs::ConvertJointType(this->jointMsg->type())); // Parent if (this->jointMsg->parent() != this->parent->GetName()) { // Get scoped name std::string oldName = this->parent->GetName(); std::string scope = oldName; size_t idx = oldName.rfind("::"); if (idx != std::string::npos) scope = oldName.substr(0, idx+2); rendering::VisualPtr parentVis = gui::get_active_camera()->GetScene() ->GetVisual(scope + this->jointMsg->parent()); if (parentVis) this->parent = parentVis; else gzwarn << "Invalid parent, keeping old parent" << std::endl; } // Child if (this->jointMsg->child() != this->child->GetName()) { // Get scoped name std::string oldName = this->child->GetName(); std::string scope = oldName; size_t idx = oldName.rfind("::"); if (idx != std::string::npos) scope = oldName.substr(0, idx+2); rendering::VisualPtr childVis = gui::get_active_camera()->GetScene() ->GetVisual(scope + this->jointMsg->child()); if (childVis) { this->child = childVis; if (this->jointVisual) childVis->AttachVisual(this->jointVisual); } else gzwarn << "Invalid child, keeping old child" << std::endl; } this->dirty = true; gui::model::Events::modelChanged(); } ///////////////////////////////////////////////// void JointData::OnOpenInspector() { this->OpenInspector(); } ///////////////////////////////////////////////// void JointData::OpenInspector() { this->inspector->Update(this->jointMsg); this->inspector->Open(); } ///////////////////////////////////////////////// void JointData::Update() { // get origin of parent link visuals math::Vector3 parentOrigin = this->parent->GetWorldPose().pos; // get origin of child link visuals math::Vector3 childOrigin = this->child->GetWorldPose().pos; // set position of joint hotspot math::Vector3 dPos = (childOrigin - parentOrigin); math::Vector3 center = dPos * 0.5; double length = std::max(dPos.GetLength(), 0.001); this->hotspot->SetScale( math::Vector3(0.008, 0.008, length)); this->hotspot->SetWorldPosition(parentOrigin + center); // set orientation of joint hotspot math::Vector3 u = dPos.Normalize(); math::Vector3 v = math::Vector3::UnitZ; double cosTheta = v.Dot(u); double angle = acos(cosTheta); math::Vector3 w = (v.Cross(u)).Normalize(); math::Quaternion q; q.SetFromAxis(w, angle); this->hotspot->SetWorldRotation(q); // set new material if joint type has changed std::string material = JointMaker::jointMaterials[this->type]; if (this->hotspot->GetMaterialName() != material) { // Note: issue setting material when there is a billboard child, // seems to hang so detach before setting and re-attach later. Ogre::SceneNode *handleNode = this->handles->getParentSceneNode(); this->handles->detachFromParent(); this->hotspot->SetMaterial(material); this->hotspot->SetTransparency(0.7); handleNode->attachObject(this->handles); Ogre::MaterialPtr mat = Ogre::MaterialManager::getSingleton().getByName(material); Ogre::ColourValue color = mat->getTechnique(0)->getPass(0)->getDiffuse(); color.a = 0.5; this->handles->getBillboard(0)->setColour(color); // notify joint changes std::string parentName = this->parent->GetName(); std::string childName = this->child->GetName(); gui::model::Events::jointChanged(this->hotspot->GetName(), this->name, JointMaker::jointTypes[this->type], parentName, childName); } // set pos of joint handle this->handles->getBillboard(0)->setPosition( rendering::Conversions::Convert(parentOrigin - this->hotspot->GetWorldPose().pos)); this->handles->_updateBounds(); // Update msg msgs::JointPtr jointUpdateMsg = this->jointMsg; unsigned int axisCount = JointMaker::GetJointAxisCount(this->type); for (unsigned int i = axisCount; i < 2u; ++i) { if (i == 0u) jointUpdateMsg->clear_axis1(); else if (i == 1u) jointUpdateMsg->clear_axis2(); } // Joint visual if (this->jointVisual) { this->jointVisual->UpdateFromMsg(jointUpdateMsg); } else { std::string childName = this->child->GetName(); std::string jointVisName = childName; size_t idx = childName.find("::"); if (idx != std::string::npos) jointVisName = childName.substr(0, idx+2); jointVisName += "_JOINT_VISUAL_"; gazebo::rendering::JointVisualPtr jointVis( new gazebo::rendering::JointVisual(jointVisName, this->child)); jointVis->Load(jointUpdateMsg); this->jointVisual = jointVis; } // Line now connects the child link to the joint frame this->line->SetPoint(0, this->child->GetWorldPose().pos - this->child->GetParent()->GetWorldPose().pos); this->line->SetPoint(1, this->jointVisual->GetWorldPose().pos - this->child->GetParent()->GetWorldPose().pos); this->line->setMaterial(JointMaker::jointMaterials[this->type]); this->dirty = false; } ///////////////////////////////////////////////// void JointMaker::ShowContextMenu(const std::string &_name) { auto it = this->joints.find(_name); if (it == this->joints.end()) return; QMenu menu; if (this->inspectAct) menu.addAction(this->inspectAct); this->inspectName = _name; QAction *deleteAct = new QAction(tr("Delete"), this); connect(deleteAct, SIGNAL(triggered()), this, SLOT(OnDelete())); menu.addAction(deleteAct); menu.exec(QCursor::pos()); } ///////////////////////////////////////////////// void JointMaker::OnSetSelectedEntity(const std::string &/*_name*/, const std::string &/*_mode*/) { this->DeselectAll(); } ///////////////////////////////////////////////// void JointMaker::OnSetSelectedJoint(const std::string &_name, const bool _selected) { this->SetSelected(_name, _selected); } ///////////////////////////////////////////////// void JointMaker::SetSelected(const std::string &_name, const bool _selected) { auto it = this->joints.find(_name); if (it == this->joints.end()) return; this->SetSelected((*it).second->hotspot, _selected); } ///////////////////////////////////////////////// void JointMaker::SetSelected(rendering::VisualPtr _jointVis, const bool _selected) { if (!_jointVis) return; _jointVis->SetHighlighted(_selected); auto it = std::find(this->selectedJoints.begin(), this->selectedJoints.end(), _jointVis); if (_selected) { if (it == this->selectedJoints.end()) { this->selectedJoints.push_back(_jointVis); model::Events::setSelectedJoint(_jointVis->GetName(), _selected); } } else { if (it != this->selectedJoints.end()) { this->selectedJoints.erase(it); model::Events::setSelectedJoint(_jointVis->GetName(), _selected); } } } ///////////////////////////////////////////////// void JointMaker::DeselectAll() { while (!this->selectedJoints.empty()) { rendering::VisualPtr vis = this->selectedJoints[0]; vis->SetHighlighted(false); this->selectedJoints.erase(this->selectedJoints.begin()); model::Events::setSelectedJoint(vis->GetName(), false); } } ///////////////////////////////////////////////// void JointMaker::CreateJointFromSDF(sdf::ElementPtr _jointElem, const std::string &_modelName) { msgs::Joint jointMsg = msgs::JointFromSDF(_jointElem); // Parent std::string parentName = _modelName + "::" + jointMsg.parent(); rendering::VisualPtr parentVis = gui::get_active_camera()->GetScene()->GetVisual(parentName); // Child std::string childName = _modelName + "::" + jointMsg.child(); rendering::VisualPtr childVis = gui::get_active_camera()->GetScene()->GetVisual(childName); if (!parentVis || !childVis) { gzerr << "Unable to load joint. Joint child / parent not found" << std::endl; return; } JointData *joint = new JointData(); joint->name = jointMsg.name(); joint->parent = parentVis; joint->child = childVis; joint->type = this->ConvertJointType(msgs::ConvertJointType(jointMsg.type())); std::string jointVisName = _modelName + "::" + joint->name; joint->jointMsg.reset(new msgs::Joint); joint->jointMsg->CopyFrom(jointMsg); joint->jointMsg->set_parent_id(joint->parent->GetId()); joint->jointMsg->set_child_id(joint->child->GetId()); // Inspector joint->inspector = new JointInspector(this); joint->inspector->Update(joint->jointMsg); joint->inspector->setModal(false); connect(joint->inspector, SIGNAL(Applied()), joint, SLOT(OnApply())); // Visuals rendering::VisualPtr jointVis( new rendering::Visual(jointVisName, parentVis->GetParent())); jointVis->Load(); rendering::DynamicLines *jointLine = jointVis->CreateDynamicLine(rendering::RENDERING_LINE_LIST); math::Vector3 origin = parentVis->GetWorldPose().pos - parentVis->GetParent()->GetWorldPose().pos; jointLine->AddPoint(origin); jointLine->AddPoint(origin + math::Vector3(0, 0, 0.1)); jointVis->GetSceneNode()->setInheritScale(false); jointVis->GetSceneNode()->setInheritOrientation(false); joint->visual = jointVis; joint->line = jointLine; joint->dirty = true; this->CreateHotSpot(joint); } ///////////////////////////////////////////////// void JointMaker::OnLinkInserted(const std::string &_linkName) { std::string leafName = _linkName; size_t idx = _linkName.rfind("::"); if (idx != std::string::npos) leafName = _linkName.substr(idx+2); this->linkList[_linkName] = leafName; this->EmitLinkInserted(_linkName); } ///////////////////////////////////////////////// void JointMaker::OnLinkRemoved(const std::string &_linkName) { if (this->linkList.erase(_linkName)) this->EmitLinkRemoved(_linkName); } ///////////////////////////////////////////////// std::map<std::string, std::string> JointMaker::LinkList() const { return this->linkList; } ///////////////////////////////////////////////// void JointMaker::ShowJoints(bool _show) { for (auto iter : this->joints) { rendering::VisualPtr vis = iter.second->hotspot; if (vis) { vis->SetVisible(_show); vis->SetHighlighted(false); } if (iter.second->jointVisual) iter.second->jointVisual->SetVisible(_show); } this->DeselectAll(); }
cpp
We now have our individual sales group, layout team, technical team, QC crew and package group. Now we have strict high-quality control procedures for each procedure. Also, all of our workers are experienced in printing discipline for biker shorts plus size, Custom Cycling Clothing , Sportswear Surf Shorts , Womens Two Piece Tracksuit ,Active Yoga Shorts . By 10 years effort, we attract customers by competitive price and excellent service. Moreover, it's our honest and sincerity, which help us always be clients' first choice. The product will supply to all over the world, such as Europe, America, Australia,El Salvador , Melbourne ,Las Vegas , Czech Republic .To meet the requirements of individual customers for each bit more perfect service and stable quality products. We warmly welcome customers around the world to visit us, with our multi-faceted cooperation, and jointly develop new markets, create a brilliant future!
english
The success of Endrendrum Punnagai is spreading fast, thanks to the movieÂs rejuvenated youth and the vibrant energy of the actors. In a recent TV show, Trisha and Jiiva had fun talking about the amazing journey of EP and the fun on sets and a little more about themselves as well. EP also had Vinay Rai, Andrea and Santhanam in the lead cast. When quipped about who will she be proposing if a chance pops and without the slightest pinch of hesitation she replied that she would be happy to propose to biggie Salman Khan. A big fan of Salman right from her childhood days, she quoted how much she adores Salman in the industry. Follow us on Google News and stay updated with the latest!
english
<filename>discussions/444588.json [ { "Id": "1047081", "ThreadId": "444588", "Html": "Hi,\r<br />\n<br />\ni know that this is a general question, but please help, i am starting in C#.\r<br />\n<br />\nI have a dialog \r<br />\n<br />\n<a href=\"https://cloudpt.pt/link/8208acee-95d8-4d95-b72b-e1a853f345cb/EnvioEmail_1.png\" rel=\"nofollow\">https://cloudpt.pt/link/8208acee-95d8-4d95-b72b-e1a853f345cb/EnvioEmail_1.png</a>,\r<br />\n<br />\nI called the dialog like this.\r<br />\n<br />\n<a href=\"https://cloudpt.pt/link/6ea75b2c-7373-472d-8abd-bd18eac7772b/EnvioEmail_2.png\" rel=\"nofollow\">https://cloudpt.pt/link/6ea75b2c-7373-472d-8abd-bd18eac7772b/EnvioEmail_2.png</a>\r<br />\n<br />\nHow to get the textboxs values in parent window?\r<br />\n<br />\nThanks<br />\n", "PostedDate": "2013-05-22T06:02:17.423-07:00", "UserRole": null, "MarkedAsAnswerDate": null }, { "Id": "1048281", "ThreadId": "444588", "Html": "See <a href=\"https://mui.codeplex.com/discussions/439306\" rel=\"nofollow\">this discussion</a><br />\n", "PostedDate": "2013-05-24T08:13:47.763-07:00", "UserRole": null, "MarkedAsAnswerDate": null }, { "Id": "1050486", "ThreadId": "444588", "Html": "I try that solution and didn´t work.\r<br />\n<br />\nI close the usercontrol like this.<br />\n<pre><code>Window parentwin = Window.GetWindow(this);\nparentwin.Close();</code></pre>\n\nPlease help.<br />\n", "PostedDate": "2013-05-30T00:58:04.197-07:00", "UserRole": null, "MarkedAsAnswerDate": null } ]
json
<reponame>kehao-study/bridge_compile package com.bridge.console.model.vo; import lombok.Data; import java.util.List; /** * @author Jay * @version v1.0 * @description 请添加类描述 * @date 2019-01-25 18:25 */ @Data public class TeamAndAccountVO { /** * 团队列表k/v */ List<EnumVO> teamList; /** * 账号列表k/v */ List<EnumVO> accountList; }
java
Disclaimer*: The articles shared under 'Your Voice' section are sent to us by contributors and we neither confirm nor deny the authenticity of any facts stated below. Parhlo will not be liable for any false, inaccurate, inappropriate or incomplete information presented on the website. Read our disclaimer. Pornography has by far become the greatest disease to have ravaged the minds of today’s generation. It all usually starts with a so-called ‘friend’ telling you devilishly not to search for so and so on the internet, or in other cases, completely encouraging its use. It may have been a dirty advertisement on the side of your computer screen which first caught your attention, or maybe even the first day you sat in middle school where the mischievous pre-teens invited you for a ‘fun’ chat. Whatever the case, pornography is one such element that has started taking deep roots within our society. Recent statistics show that boys are exposed to such explicit content at the ages of around 11-13 whereas girls usually find out about it around 16. Now there’s no questioning the fact that our hormones do start kicking in around this period of life, but that gives us no excuse to validate any uncontrolled expression of our desires. Indeed, what I would like to focus upon is the nature of desire itself. It is easily noticeable that desires come in response to knowledge of a precedented experience. For example, a person who doesn’t drink alcohol doesn’t need it, since their bodies haven’t entered the habitual cycle of addiction. Hence, there is no trigger for a desire to drink the alcohol, and hence no expectations with regard to a ‘release’ or any ‘pleasure’ that can be derived from the substance yet. However, if there is an element of curiosity within a person or a weak foundation of moral values, it might be considered a primary trigger towards the consumption of the substance which causes the individual to enter the cycle. Sex is a basic desire within man and is also referred to as the very energy with which life is sustained. Without it, there can scarcely be any other means for which reproduction of future generations can be continued. However, the very desire of ‘lust’ can also be rather destructive if not kept under control. All crimes that do occur are all as a result of uncontrolled expression of one’s desires. Likewise, sexual harassment to is a crime and it too occurs due to an uncontrolled expression of lust. The need to have sexual intimacy with a woman, or well, to say the least, her body, may arise due to a lack of a love, or it may even arise as a response to dissolving tensions within one’s life. This eventually leads to pornography in the absence of a partner or due to the current values associated with the religion of the people (e.g Islam prohibiting Zina (unlawful sexual intercourse)). The very act of sex acts as a safety valve on it’s to release the accumulated stress and gives an individual a glimpse of freedom from the confines of everyday mundane life. That is why most men find it comforting, and prioritize it as a means to seek relaxation. The main issue arises when a loose grip on values followed by a crushing urge for sexual release causes an individual to disregard the other person as not a fellow human being, but rather to degrade them as a piece of flesh and to seek their physical body for the sake of fulfilling one’s own desires. This truly represents a rather animalistic state of mind with a yearning to dominate the other and shows just as to how a lack of values may mold one’s self to such ugly forms. To end this article, what I would like to say, as a guy who’s heart has been deeply affected by the ongoing crisis, to all those that have transgressed and those that have suffered such incessant oppression that, indeed, there is no crime that is left unheeded in the eyes of God, and that there is no injustice that shall not be retributed, and there is no crime which will be left unchastised. Change your ways before you reduce yourself from a man to that which is more worst than any beast to walk upon the face of this earth. To the parents, what I would like to say is that you must install a rock-solid foundation of values within your children in their early years; keep them under your wings and monitor them closely in their interactions with other people. Teach them the Golden Rule, which tells us to ‘not do unto others what you do not want for yourself.’ In fact, this very statement should be addressed throughout life, and in all of its walks and aspects. And to those victims that have suffered sexual abuse/harassment, especially the women: you were and still are entirely innocent, and know that you will not be left empty-handed for what you had to experience without recompense, yet if you ever find it in your hearts to forgive such ugly, prudent beasts for what they did to you, then may you be forever blessed, for none may possess as much strength as equivalent to you. I pray, from the depths of my heart that no one has to suffer anything like this in their lives. Amen.
english
<gh_stars>1-10 import { query, insert, update as updateQuery, remove as removeQuery } from './../lib/database' import { hash } from '../lib/crypto' import { getCurrentUnixTimeStamp } from '../lib/time-stamp' import { findActivePollByUserId, updatePollResultMaxVotes } from './poll/poll-result-repository' import { createPollUserWithPollResultId, existAsPollUserInCurrentVote } from './poll/poll-user-repository' export async function findOneById (id) { const result = await query('SELECT * FROM event_user WHERE id = ?', [id]) return Array.isArray(result) ? result[0] || null : null } export async function findOneByUsernameAndEventId (username, eventId) { const result = await query('SELECT event_user.* FROM event_user INNER JOIN event ON event_user.event_id = event.id WHERE event_user.username = ? AND event.id = ? AND event.deleted = 0', [username, eventId]) return Array.isArray(result) ? result[0] || null : null } export async function findEventUserByEventId (eventId) { return await query('SELECT * FROM event_user WHERE event_id = ? ORDER BY online DESC, public_name ASC', [eventId]) } export async function findOnlineEventUserByEventId (eventId) { return await query('SELECT * FROM event_user WHERE event_id = ? AND verified = 1 AND online = 1 AND allow_to_vote = 1 ORDER BY public_name ASC', [eventId]) } export async function toggleUserOnlineStateByRequestToken (token, online) { const sql = ` UPDATE event_user INNER JOIN jwt_refresh_token ON jwt_refresh_token.event_user_id = event_user.id SET event_user.online = ? WHERE jwt_refresh_token.token = ? ` // Update online state. await query(sql, [online, token]) // Fetch event user id for further processing. const result = await query('SELECT event_user_id FROM jwt_refresh_token WHERE token = ?', [token]) const pollResultId = await findActivePollByUserId(result[0].eventUserId) if (pollResultId) { const userExists = await existAsPollUserInCurrentVote(pollResultId.id, result[0].eventUserId) if (userExists === null) { const newPollUser = await createPollUserWithPollResultId(pollResultId.id, result[0].eventUserId) if (newPollUser) { await updatePollResultMaxVotes(pollResultId.id, result[0].eventUserId) } } } return Array.isArray(result) ? result[0] || null : null } export async function create (input) { input.createDatetime = getCurrentUnixTimeStamp() if (input.password) { input.password = await hash(input.password) } return await insert('event_user', input) } export async function update (input) { if (input.password) { input.password = await hash((input.password)) } await updateQuery('event_user', input) } export async function remove (id) { await query('DELETE FROM jwt_refresh_token WHERE event_user_id = ?', [id]) return await removeQuery('event_user', id) } export async function setEventUserOnline (id) { return await query('UPDATE event_user SET online = true WHERE id = ? AND online = false', [id]) }
javascript
Yokohama, May 31: Japan lost 0-2 to Ghana in the Kirin Challenge Cup at the Nissan Stadium in Yokohama on Wednesday, leaving new head coach Akira Nishino with lots to think about before the national football team begin their World Cup Campaign in Russia on June 19. A goal in each half by Ghana captain and Atletico Madrid midfielder Thomas Partey and Levente UD’s Emmanuel Boateng sealed the deal for the Black Stars against a very average-looking Samurai Blue in rainy conditions in front of a disappointed crowd of 64,520 Japanese fans, reported Xinhua news agency. With a 26-man squad to pick from to face Ghana in Wednesday’s friendly before deciding on the final 23 who will head to Russia, the Samurai Blue, based on their form shown again the African team who didn’t qualify for the World Cup, played well in spells but were outgunned overall. Japan’s World Cup Group Group H sees it placed alongside Senegal, Poland and Colombia. Japan will open their World Cup account against Colombia on June 19 and will face Senegal five days later. Their campaign against Poland in the final game of the group stages will take place four days after that. Under Halilhodzic’s stewardship, Japan reached the 2018 World Cup Finals after their 2-0 win against Australia on August 31, 2017, which sealed their progression from Asia’s Group B at the third round stage. According to FIFA, Japan are ranked lowest in their group at 60 in the world, compared to Senegal at 28, Colombia at 16 and Poland at 10.
english
<gh_stars>1-10 Index,Facility_Name,Facility_Type,Street_No,Street_Name,City,Prov_Terr,Postal_Code f06f9e6bef6035a201d9,Deer Island Community School,Public,711,route 772 fairhaven,Fairhaven,NB,E5V1T1
json
Umesh Prahladrao Kolhe, a 54-year-old chemist, was murdered on June 21 in Maharashtra’s Amravati district. Investigators suspect Kolhe was murdered in retaliation for a social media post supporting BJP candidate Nupur Sharma, who made controversial remarks about the Prophet during a TV debate. On June 21, between 10 p. m. and 10. 30 p. m. , Umesh Kolhe was on his way home after closing his shop, ‘Amit Medical Store. ’ Sanket, 27, was riding with his wife Vaishnavi on another scooter. After an initial investigation prompted by a complaint from Umesh Kohle’s son Sanket Kohle, the City Kotwali Police Station in Amravati arrested two people on June 23: Muddsir Ahemad, 22, and Shahrukh Pathan, 25. Their interrogation revealed the involvement of four more people, three of whom were arrested on June 25: Abdul Thoufik, 24, Shoaib Khan, 22, and Atib Rashid, 22. Shamim Ahmed Firoz Ahmed has escaped. Kolhe was rushed to a nearby Axon Hospital with the assistance of bystanders, where he died during treatment. According to the officer, one of the suspects instructed the other five specific tasks for the murder. When he left the medical store, he asked two of them to keep an eye on Kolhe and notify the other three. Kolhe was obstructed and assaulted by the other three. Following Saket’s complaint, the City Kotwali police station filed an FIR.
english
package com.genersoft.iot.vmp.gb28181.event.offline; import com.genersoft.iot.vmp.conf.RedisKeyExpirationEventMessageListener; import com.genersoft.iot.vmp.conf.UserSetup; import com.genersoft.iot.vmp.gb28181.event.SipSubscribe; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.DependsOn; import org.springframework.data.redis.connection.Message; import org.springframework.data.redis.connection.RedisConnection; import org.springframework.data.redis.listener.KeyExpirationEventMessageListener; import org.springframework.data.redis.listener.RedisMessageListenerContainer; import org.springframework.stereotype.Component; import com.genersoft.iot.vmp.common.VideoManagerConstants; import com.genersoft.iot.vmp.gb28181.event.EventPublisher; import org.springframework.util.StringUtils; import java.util.Properties; /** * @description:设备心跳超时监听,借助redis过期特性,进行监听,监听到说明设备心跳超时,发送离线事件 * @author: swwheihei * @date: 2020年5月6日 上午11:35:46 */ @Component public class KeepaliveTimeoutListenerForPlatform extends RedisKeyExpirationEventMessageListener { private Logger logger = LoggerFactory.getLogger(KeepaliveTimeoutListenerForPlatform.class); @Autowired private EventPublisher publisher; @Autowired private UserSetup userSetup; @Autowired private SipSubscribe sipSubscribe; public KeepaliveTimeoutListenerForPlatform(RedisMessageListenerContainer listenerContainer, UserSetup userSetup) { super(listenerContainer, userSetup); } /** * 监听失效的key * @param message * @param pattern */ @Override public void onMessage(Message message, byte[] pattern) { // 获取失效的key String expiredKey = message.toString(); logger.debug(expiredKey); // 平台心跳到期,需要重发, 判断是否已经多次未收到心跳回复, 多次未收到,则重新发起注册, 注册尝试多次未得到回复,则认为平台离线 String PLATFORM_KEEPLIVEKEY_PREFIX = VideoManagerConstants.PLATFORM_KEEPALIVE_PREFIX + userSetup.getServerId() + "_"; String PLATFORM_REGISTER_PREFIX = VideoManagerConstants.PLATFORM_REGISTER_PREFIX + userSetup.getServerId() + "_"; String KEEPLIVEKEY_PREFIX = VideoManagerConstants.KEEPLIVEKEY_PREFIX + userSetup.getServerId() + "_"; String REGISTER_INFO_PREFIX = VideoManagerConstants.PLATFORM_REGISTER_INFO_PREFIX + userSetup.getServerId() + "_"; if (expiredKey.startsWith(PLATFORM_KEEPLIVEKEY_PREFIX)) { String platformGBId = expiredKey.substring(PLATFORM_KEEPLIVEKEY_PREFIX.length(),expiredKey.length()); publisher.platformKeepaliveExpireEventPublish(platformGBId); }else if (expiredKey.startsWith(PLATFORM_REGISTER_PREFIX)) { String platformGBId = expiredKey.substring(PLATFORM_REGISTER_PREFIX.length(),expiredKey.length()); publisher.platformRegisterCycleEventPublish(platformGBId); }else if (expiredKey.startsWith(KEEPLIVEKEY_PREFIX)){ String deviceId = expiredKey.substring(KEEPLIVEKEY_PREFIX.length(),expiredKey.length()); publisher.outlineEventPublish(deviceId, KEEPLIVEKEY_PREFIX); }else if (expiredKey.startsWith(REGISTER_INFO_PREFIX)) { String callid = expiredKey.substring(REGISTER_INFO_PREFIX.length()); SipSubscribe.EventResult eventResult = new SipSubscribe.EventResult(); eventResult.callId = callid; eventResult.msg = "注册超时"; eventResult.type = "register timeout"; if (sipSubscribe.getErrorSubscribe(callid) != null) { sipSubscribe.getErrorSubscribe(callid).response(eventResult); } } } }
java
<gh_stars>0 import cv2 import numpy as np def extract_white(image): lower_white = np.array([240, 240, 240]) upper_white = np.array([255, 255, 255]) img_mask = cv2.inRange(image, lower_white, upper_white) _, img_mask = cv2.threshold(img_mask, 130, 255, cv2.THRESH_BINARY) return img_mask def get_rects(mask): contours, _ = cv2.findContours(mask, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)[-2:] rects = [] for contour in contours: approx = cv2.convexHull(contour) rect = cv2.boundingRect(approx) rects.append(np.array(rect)) return rects def draw_rects(rects, img, n): height, width = img.shape[:2] for rect in rects: if rect[2]*rect[3]>height*width/n: cv2.rectangle(img, tuple(rect[0:2]), tuple(rect[0:2]+rect[2:4]), (0,0,255), thickness=2) return img def cut_out_text(rects, img, n): height, width = img.shape[:2] new_rects = [rect for rect in rects if rect[2] * rect[3] > height * width / n] if new_rects: min_x = min(new_rects, key=(lambda x: x[0])) min_y = min(new_rects, key=(lambda x: x[1])) max_w = max(new_rects, key=(lambda x: x[0] + x[2])) max_h = max(new_rects, key=(lambda x: x[1] + x[3])) max_rect = np.array([min_x[0], min_y[1], max_w[0] - min_x[0] + max_w[2], max_h[1] - min_y[1] + max_h[3]]) text_img = img[max_rect[1]:max_rect[1]+max_rect[3], max_rect[0]:max_rect[0]+max_rect[2]] else: text_img = img return text_img def draw_max_rect(rects, img, n): height, width = img.shape[:2] new_rects = [rect for rect in rects if rect[2] * rect[3] > height * width / n] if new_rects: min_x = min(new_rects, key=(lambda x: x[0])) min_y = min(new_rects, key=(lambda x: x[1])) max_w = max(new_rects, key=(lambda x: x[0] + x[2])) max_h = max(new_rects, key=(lambda x: x[1] + x[3])) max_rect = np.array([min_x[0], min_y[1], max_w[0] - min_x[0] + max_w[2], max_h[1] - min_y[1] + max_h[3]]) cv2.rectangle(img, tuple(max_rect[0:2]), tuple(max_rect[0:2]+max_rect[2:4]), (0,0,255), thickness=2) return img def run(img): paper_mask = extract_white(img) rects = get_rects(paper_mask) fin_img = draw_max_rect(rects, img, 10000) return fin_img if __name__ == "__main__": image = cv2.imread('images00/image65.jpg') fin_img = run(image) cv2.imwrite('text00/image65.jpg', fin_img) cv2.imshow("TEXT", fin_img) while(1): if cv2.waitKey(10) > 0: break
python
<filename>src/__fixtures__/classes/code.js class NonTestableClass { someFunction() { return 'NonTestableClass'; } } // @testable class TestableClass { someFunction() { return 'TestableClass'; } } // @testable export class AlreadyExportedClass { someFunction() { return 'AlreadyExportedClass'; } }
javascript
<reponame>Tinynull/wonderful-spring-boot package info.zhaoliang.wonderful.response; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import info.zhaoliang.wonderful.exception.RspExtException; import info.zhaoliang.wonderful.exception.RspExtResultCode; import info.zhaoliang.wonderful.utils.BeanUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * 符合 Restful的响应体. CommunicationResponse 支持几种高级操作 1,把bean里面的属性插到data中,支持单个添加也支持多次添加。 2,把data中的属性反回到bean中。 * 3,把list.bean插到data的key中以list形式储存。 4,把bean插到data的key中以list形式储存。 5,把key value插到data的key中以list的每个数据中. * * @author ?? * @version v1.0 2018/06/19 */ public class RestFulRespUtil { /**日志输出对象.**/ protected static final Logger logger = LoggerFactory.getLogger(RestFulRespUtil.class); /** * 把bean属性数据填充到resp的data(map结构)里面,以key value储存. value: 13243344 resp.data: {name:"fdfsf"} resp.data: * {name:"fdfsf",key:13243344} * * @param resp 响应类 * @param key 键 * @param value 值 */ public static void addDataField(CommunicationResponse resp, String key, Object value) { Map<String, Object> map = new HashMap<>(20); map.put(key, value); fillDataField(resp, map); } /** * 把bean属性数据填充到resp的data(map结构)里面,以key value储存. bean: {name:"name",date:15648649687} resp.data: {} resp.data: * {name:"name",date:15648649687} * * @param resp 响应类 * @param bean 存储结果对象 */ public static void fillDataField(CommunicationResponse resp, Object bean) { resp.keepDataNotNull(); Map<String, Object> map = BeanUtil.describe(bean); resp.addDatas(map); } /** * 把bean属性数据填充到resp的data(map结构)里面下的mapKey,以map储存. bean: {name:"name",date:15648649687} resp.data: {} resp.data: * {mapKey:{name:"name",date:15648649687}} * * @param resp 响应类 * @param mapKey map数据 * @param bean 存储结果对象 */ public static void fillDataMap(CommunicationResponse resp, String mapKey, Object bean) { resp.keepDataNotNull(); Object map = resp.getData().get(mapKey); map = merge(map, bean); resp.getData().put(mapKey, map); } /** * 合并数据. * * @param targ 目标类 * @param bean 结果类 * @return Object */ @SuppressWarnings("unchecked") private static Object merge(Object targ, Object bean) { if (targ == null) { targ = new LinkedHashMap<String, Object>(); } else if (!(targ instanceof Map)) { Map<String, Object> tempTrag = new LinkedHashMap<String, Object>(); tempTrag.putAll(BeanUtil.describe(targ)); targ = tempTrag; } ((Map<String, Object>) targ).putAll(BeanUtil.describe(bean)); return targ; } /** * 合并数据. * * @param targ 目标类 * @param key 键 * @param value 值 * @return Object */ private static Object merge(Object targ, String key, Object value) { Map<String, Object> map = new HashMap<String, Object>(20); map.put(key, value); return merge(targ, map); } /** * 把value追加到resp的data(map结构)里面下的mapKey,以key value储存. value: {name:"name",date:15648649687} resp.data: * {mapKey:{name:"name",date:15648649687}} resp.data: {mapKey:{name:"name",date:15648649687,key:value}} * * @param resp 响应体 * @param mapKey map数据的key * @param key 键 * @param value 值 */ public static void addDataMap(CommunicationResponse resp, String mapKey, String key, Object value) { Map<String, Object> map = new HashMap<>(20); map.put(key, value); fillDataMap(resp, mapKey, map); } /** * 把list.bean属性数据填充到resp的data(map结构)里面的tableKey,以[{key:value}],[{key:value}],[{key:value}]储存. list.bean: * [{key:value},{key:value},{key:value}] resp.data: {} resp.data: {tableKey:[{key:value},{key:value},{key:value}]} * * @param resp 响应体 * @param tableKey data中list数据的key * @param list list数据 */ @SuppressWarnings("unchecked") public static void fillDataTable(CommunicationResponse resp, String tableKey, List<? extends Object> list) { resp.keepDataNotNull(); @SuppressWarnings("rawtypes") List beanList = holdDataTable(resp, tableKey); for (Object bean : list) { beanList.add(BeanUtil.describe(bean)); } } /** * 把bean中的属性数据填充 到data中tableKey对应的list中的多个bean中使用 list中的多个bean扩展属性. key:key1 value:value1 resp.data: * {tableKey:[{key:value},{key:value},{key:value}]} resp.data: * {tableKey:[{key:value,key1:value1},{key:value,key1:value1},{key:value,key1:value1}]} * * @param resp 响应体 * @param tableKey data中list数据的key * @param key 键 * @param value 值 */ @SuppressWarnings("unchecked") public static void fillDataTableField(CommunicationResponse resp, String tableKey, String key, String value) { resp.keepDataNotNull(); if (resp.getData().get(tableKey) == null) { return; } @SuppressWarnings("rawtypes") List beanList = holdDataTable(resp, tableKey); for (int i = 0; i < beanList.size(); i++) { Object map = beanList.get(i); map = merge(map, key, value); beanList.set(i, map); } } /** * 把bean追加到 resp.data中tableKey 对应的list中. resp.data: {tableKey:[{key:value},{key:value},{key:value}]} bean: {key2:value2} * resp.data: {tableKey:[{key:value},{key:value},{key:value},{key2:value2}]} * * @param resp 响应体 * @param tableKey data中list数据的key * @param bean 结果对象 */ public static void addDataTableElement(CommunicationResponse resp, String tableKey, Object bean) { fillDataTable(resp, tableKey, Arrays.asList(bean)); } /** * 确保data 存在某个key且value为list. * * @param resp 响应体 * @param tableKey data中list数据的key * @return List<?> */ private static List<?> holdDataTable(CommunicationResponse resp, String tableKey) { resp.keepDataNotNull(); List<?> beanList = (List<?>) resp.getData().get(tableKey); if (beanList == null) { beanList = new ArrayList<>(); resp.getData().put(tableKey, beanList); } else if (!(beanList instanceof List)) { logger.error("转换错误", String.format("无法把data中的属性%s当成%s使用,目前只支持List", tableKey, beanList.getClass())); throw new RspExtException(RspExtResultCode.DATA_CONVERT_ERROR); } return beanList; } }
java
<gh_stars>1-10 #include <cmath> #include <cstdio> #include "elevator_door_status.h" using std::vector; ElevatorDoorStatus::ElevatorDoorStatus() { } ElevatorDoorStatus::~ElevatorDoorStatus() { } void ElevatorDoorStatus::set_reference(vector<float> scan) { ref = scan; } ElevatorDoorStatus::DoorState ElevatorDoorStatus::detect(vector<float> scan) { static int scan_count = 0; scan_count++; if (!ref.size() || ref.size() != scan.size()) return INVALID_DATA; vector<float> diff = ref; // find sum of differences on the right and left sides of the scan float left_sum = 0, left_idx_sum = 0; float right_sum = 0, right_idx_sum = 0; for (size_t i = 0; i < scan.size(); i++) { diff[i] -= scan[i]; if (diff[i] > 0) continue; // we're only looking for holes, not filled space if (i < scan.size() / 2) { left_sum += diff[i]; left_idx_sum++; } else { right_sum += diff[i]; right_idx_sum++; } } //if (left_sum < -3 || right_sum < -3) // depends on how far away you are // printf("%.05f %.05f\n", left_sum, right_sum); if (left_sum < -3) return LEFT_OPEN; else if (right_sum < -3) return RIGHT_OPEN; else return ALL_CLOSED; }
cpp
*{ margin: 0; padding: 0; box-sizing: border-box;} html, body{ height: 100%;} header{ width: 100%; height: 50%; /*padding-top: 50px;*/ /*overflow: hidden;*/ /*background-color: green;*/ } .box{ width: 30%; padding-top: 30%; margin: 0 auto; /*border-radius: 20px;*/ /*border-top-right-radius: 30px;*/ position: relative; /*background-color: rgba(52, 155, 235, 0.4);*/ } .teste{ margin: 50px auto; position: absolute; left: 0; top: 0; width: 100%; height: 100%; border-radius: 50%; background-color: black; } .transform{ width: 40%; max-width: 300px; height: 300px; border: 3px solid #ccc; border-radius: 8px; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); /*X e Y*/ transition: 2s; } .transform:hover{ transform: translate(-50%, -50%) rotate(360deg) scale(4, 2); }
css
<reponame>wxm201411/bctos { "id":"toolsCommon", "name":"toolsCommon", "title":"toos setting", "version":"1.1", "hidden":1, "source":{ "className":"x-item-file x-ini" }, "description":"some configs", "auther":{ "copyright":"kodcloud.", "homePage":"http://www.kodcloud.com", }, "configItem":{ } }
json
The iPod rumors are now at full speed. Today's tidbit is a spy-shot of what may be the new iPod Touch front panel, showing a hole for - presumably - a front-facing, FaceTime-compatible camera. The photos, inexplicably sent to MacRumors from an iPhone parts supplier which obviously wishes to lose its part-supplying job, show the front panel inside and out. The front of the front, as it were, shows the words "Apple © 2010" on the ribbon-cable to the right (click through to the MacRumors page to see the full-sized images). Unfortunately it is also dated 10-04-29, which looks like April 10th of this year, rather a long time ago for such a new model. Could this just be an iPhone 4 panel? Recent Apple product launches has been much worse-kept secrets than usual, too, so the flood of leaks is not only expected but likely to be showing the real thing. I have said before that the iPod Touch is likely to get a camera. Combine this new shot with yesterday's picture of an iPod Touch with a rear-facing camera and it looks like we might be getting two of the things. See Also: Follow us for real-time tech news: Charlie Sorrel and Gadget Lab on Twitter.
english
//----------------------------------*-C++-*----------------------------------// // Copyright 2020 UT-Battelle, LLC, and other Celeritas developers. // See the top-level COPYRIGHT file for details. // SPDX-License-Identifier: (Apache-2.0 OR MIT) //---------------------------------------------------------------------------// //! \file MuBremsstrahlungInteractor.hh //---------------------------------------------------------------------------// #pragma once #include "base/Macros.hh" #include "base/Types.hh" #include "physics/base/Interaction.hh" #include "physics/base/ParticleTrackView.hh" #include "base/StackAllocator.hh" #include "physics/base/Secondary.hh" #include "physics/base/Units.hh" #include "physics/material/ElementView.hh" #include "physics/material/MaterialView.hh" #include "MuBremsstrahlung.hh" namespace celeritas { namespace detail { //---------------------------------------------------------------------------// /*! * Muon bremsstrahlung. * * This is a model for the Bremsstrahlung process for muons. Given an incident * muon, the class computes the change to the incident muon direction and * energy, and it adds a single secondary gamma to the secondary stack. * * \note This performs the same sampling routine as in Geant4's * G4MuBremsstrahlungModel class, as documented in section 11.2 * of the Geant4 Physics Reference (release 10.6). */ class MuBremsstrahlungInteractor { public: // Construct with shared and state data inline CELER_FUNCTION MuBremsstrahlungInteractor(const MuBremsstrahlungInteractorPointers& shared, const ParticleTrackView& particle, const Real3& inc_direction, StackAllocator<Secondary>& allocate, const MaterialView& material, ElementComponentId elcomp_id); // Sample an interaction with the given RNG template<class Engine> inline CELER_FUNCTION Interaction operator()(Engine& rng); private: template<class Engine> inline CELER_FUNCTION real_type sample_cos_theta(real_type gamma_energy, Engine& rng) const; inline CELER_FUNCTION real_type differential_cross_section(real_type gamma_energy) const; // Shared constant physics properties const MuBremsstrahlungInteractorPointers& shared_; // Incident direction const Real3& inc_direction_; // Allocate space for one or more secondary particles StackAllocator<Secondary>& allocate_; // Element properties const ElementView element_; // Incident particle const ParticleTrackView& particle_; }; //---------------------------------------------------------------------------// } // namespace detail } // namespace celeritas #include "MuBremsstrahlungInteractor.i.hh"
cpp
#include <cstdio> int main() { float f = (float)(3.0); return f; }
cpp
const endpoint = 'https://reyeselsamad.com/api/graphql'; export default endpoint;
javascript
<gh_stars>0 {"date":20200908,"state":"SC","positive":125908,"negative":888243,"pending":null,"hospitalizedCurrently":766,"hospitalizedCumulative":8182,"inIcuCurrently":213,"inIcuCumulative":null,"onVentilatorCurrently":118,"onVentilatorCumulative":null,"recovered":51431,"dataQualityGrade":"A+","lastUpdateEt":"9/7/2020 23:59","dateModified":"2020-09-07T23:59:00Z","checkTimeEt":"09/07 19:59","death":2912,"hospitalized":8182,"dateChecked":"2020-09-07T23:59:00Z","totalTestsViral":1012044,"positiveTestsViral":162047,"negativeTestsViral":849997,"positiveCasesViral":123801,"deathConfirmed":2772,"deathProbable":140,"totalTestEncountersViral":null,"totalTestsPeopleViral":null,"totalTestsAntibody":64981,"positiveTestsAntibody":5645,"negativeTestsAntibody":59336,"totalTestsPeopleAntibody":null,"positiveTestsPeopleAntibody":null,"negativeTestsPeopleAntibody":null,"totalTestsPeopleAntigen":null,"positiveTestsPeopleAntigen":null,"totalTestsAntigen":null,"positiveTestsAntigen":null,"fips":"45","positiveIncrease":301,"negativeIncrease":4140,"total":1014151,"totalTestResultsSource":"posNeg","totalTestResults":1014151,"totalTestResultsIncrease":4441,"posNeg":1014151,"deathIncrease":5,"hospitalizedIncrease":11,"hash":"e2695cc1f680884aabf5258c543d48aece1c3e68","commercialScore":0,"negativeRegularScore":0,"negativeScore":0,"positiveScore":0,"score":0,"grade":""}
json
Met Gala 2023: The theme for this year was 'Karl Lagerfeld: A Line of Beauty', celebrating the legacy of iconic designer. New Delhi: The mecca of fashion - Met Gala 2023 is here and our favourite stars made sure to turn heads in gorgeous outfits. This year, representing India at a global stage, actress Alia Bhatt made her stunning debut in a pearl white Prabal Gurung gown. The Met Gala took place on May 1 at the Metropolitan Museum of Art in New York. This year Alia Bhatt, Priyanka Chopra, Natasha Poonawalla and Isha Ambani were seen at the grand exhibit. Priyanka Chopra and her singer hubby Nick Jonas twinned in black outfits, giving major couple goals. Priyanka turned heads in a black Valentino dress and flaunted her 11.6-carat diamond necklace. The Met Gala was established in 1948 by fashion publicist Eleanor Lambert as a fundraiser for the newly founded Costume Institute to mark the opening of its annual exhibit. This year's theme for the event is titled 'Karl Lagerfeld: A Line of Beauty', which will honour the artistic brilliance of the late designer and trace his evolution. On the work front, Alia is looking forward to her Hollywood debut with 'Heart of Stone' co-starring Gal Gadot. Back home, she will be seen in 'Rocky Aur Rani ki Prem Kahaani' with Ranveer Singh. The actress will also be seen in Jee Le Zaraa with Priyanka Chopra and Katrina Kaif and, Rocky Aur Rani Ki Prem Kahaani with Ranveer Singh. The film also stars Dharmendra, Jaya Bachchan and Shabana Azmi. The year 2022 was a highly rewarding year for her both on personal and professional fronts as she married Ranbir Kapoor and also welcomed their daughter Raha in November 2022. Her projects like 'Gangubai Kathiawadi', 'RRR', 'Brahmastra' and 'Darlings', were all major successes.
english
{ "title": "Brain Tumor Detection", "description": "", "category": { "title": "Image Processing Projects (CO543)", "code": "co543", "api_url": "http://api.ce.pdn.ac.lk/projects/v1/co543/" }, "project_url": "https://projects.ce.pdn.ac.lk/co543/e15/Brain-Tumor-Detection", "repo_url": "https://github.com/cepdnaclk/e15-co543-Brain-Tumor-Detection", "page_url": "#" }
json
<gh_stars>0 /* * (C) 2007-2010 Alibaba Group Holding Limited. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * */ package com.taobao.common.tfs.packet; public interface Transcoder { byte[] encode(Object object); Object decode(byte[] data); Object decode(byte[] data, int offset, int size); }
java
package org.point85.app.operator; import java.util.Collections; import java.util.List; import org.point85.app.AppUtils; import org.point85.app.DialogController; import org.point85.app.ImageManager; import org.point85.app.Images; import org.point85.app.MaterialNode; import org.point85.domain.persistence.PersistenceService; import org.point85.domain.plant.Material; import javafx.fxml.FXML; import javafx.scene.control.TreeItem; import javafx.scene.control.TreeView; public class MaterialSelectorController extends DialogController { // materials @FXML private TreeView<MaterialNode> tvMaterials; // selected material private Material selectedMaterial; // initialize public void initialize() throws Exception { // images for buttons setImages(); // add the tree view listener for reason selection tvMaterials.getSelectionModel().selectedItemProperty().addListener((observableValue, oldValue, newValue) -> { try { onSelectMaterial(oldValue, newValue); } catch (Exception e) { AppUtils.showErrorDialog(e); } }); tvMaterials.setShowRoot(false); // fill in the top-level reason nodes populateCategories(); } // material selected in the hierarchy private void onSelectMaterial(TreeItem<MaterialNode> oldItem, TreeItem<MaterialNode> newItem) throws Exception { if (newItem == null) { return; } // leaf node is material if (newItem.getValue().isMaterial()) { selectedMaterial = newItem.getValue().getMaterial(); return; } else { // category selected selectedMaterial = null; } // show the material children too List<Material> children = PersistenceService.instance() .fetchMaterialsByCategory(newItem.getValue().getCategory()); Collections.sort(children); boolean hasTreeChildren = newItem.getChildren().size() > 0 ? true : false; // check to see if the node's children have been previously shown if (!hasTreeChildren) { newItem.getChildren().clear(); for (Material child : children) { MaterialNode materialNode = new MaterialNode(child); TreeItem<MaterialNode> materialItem = new TreeItem<>(materialNode); newItem.getChildren().add(materialItem); } } newItem.setExpanded(true); tvMaterials.refresh(); } // the single root for all material categories private TreeItem<MaterialNode> getRootMaterialItem() throws Exception { if (tvMaterials.getRoot() == null) { Material rootMaterial = new Material(); rootMaterial.setName(Material.ROOT_MATERIAL_NAME); tvMaterials.setRoot(new TreeItem<>(new MaterialNode(rootMaterial))); } return tvMaterials.getRoot(); } // populate the tree view categories private void populateCategories() throws Exception { // fetch the categories List<String> categories = PersistenceService.instance().fetchMaterialCategories(); Collections.sort(categories); getRootMaterialItem().getChildren().clear(); for (String category : categories) { MaterialNode categoryNode = new MaterialNode(category); TreeItem<MaterialNode> categoryItem = new TreeItem<>(categoryNode); categoryItem.setGraphic(ImageManager.instance().getImageView(Images.CATEGORY)); getRootMaterialItem().getChildren().add(categoryItem); } // refresh tree view tvMaterials.setRoot(getRootMaterialItem()); tvMaterials.refresh(); } public Material getSelectedMaterial() { return selectedMaterial; } }
java
attempts. Ever since the novel became a hit in Tamil Nadu, many movie makers attempted to work on it, but they could not turn their pursuit into a film. The novel is based on the 10th-century Chola period and the fights within the ruling clan. The role played by spies of the empire, its military leaders and the politics behind it are all shown in the movie.
english
@(result: CompleteResult) @main("Result") { <head> <style> body { background-color: #A9A9A9; margin: 20px; } </style> </head> <div class="jumbotron text-center"> <div class="container"> <a href="/" class="lang-logo"> <img src=@result.imageUrl> </a> @if(result != null){ <h1>@result.characterTitle</h1> } <p>@result.descText</p> </div> </div> }
html
<reponame>malikfaizanhaider/apocalypto import { css } from '../../base/src/index'; const styles = css ` .fill-submask-2 { animation: spectrum-fill-mask-2 1s linear infinite } @keyframes spectrum-fill-mask-1 { 0% { transform: rotate(90deg) } 1.69% { transform: rotate(72.3deg) } 3.39% { transform: rotate(55.5deg) } 5.08% { transform: rotate(40.3deg) } 6.78% { transform: rotate(25deg) } 8.47% { transform: rotate(10.6deg) } 10.17% { transform: rotate(0deg) } 11.86% { transform: rotate(0deg) } 13.56% { transform: rotate(0deg) } 15.25% { transform: rotate(0deg) } 16.95% { transform: rotate(0deg) } 18.64% { transform: rotate(0deg) } 20.34% { transform: rotate(0deg) } 22.03% { transform: rotate(0deg) } 23.73% { transform: rotate(0deg) } 25.42% { transform: rotate(0deg) } 27.12% { transform: rotate(0deg) } 28.81% { transform: rotate(0deg) } 30.51% { transform: rotate(0deg) } 32.2% { transform: rotate(0deg) } 33.9% { transform: rotate(0deg) } 35.59% { transform: rotate(0deg) } 37.29% { transform: rotate(0deg) } 38.98% { transform: rotate(0deg) } 40.68% { transform: rotate(0deg) } 42.37% { transform: rotate(5.3deg) } 44.07% { transform: rotate(13.4deg) } 45.76% { transform: rotate(20.6deg) } 47.46% { transform: rotate(29deg) } 49.15% { transform: rotate(36.5deg) } 50.85% { transform: rotate(42.6deg) } 52.54% { transform: rotate(48.8deg) } 54.24% { transform: rotate(54.2deg) } 55.93% { transform: rotate(59.4deg) } 57.63% { transform: rotate(63.2deg) } 59.32% { transform: rotate(67.2deg) } 61.02% { transform: rotate(70.8deg) } 62.71% { transform: rotate(73.8deg) } 64.41% { transform: rotate(76.2deg) } 66.1% { transform: rotate(78.7deg) } 67.8% { transform: rotate(80.6deg) } 69.49% { transform: rotate(82.6deg) } 71.19% { transform: rotate(83.7deg) } 72.88% { transform: rotate(85deg) } 74.58% { transform: rotate(86.3deg) } 76.27% { transform: rotate(87deg) } 77.97% { transform: rotate(87.7deg) } 79.66% { transform: rotate(88.3deg) } 81.36% { transform: rotate(88.6deg) } 83.05% { transform: rotate(89.2deg) } 84.75% { transform: rotate(89.2deg) } 86.44% { transform: rotate(89.5deg) } 88.14% { transform: rotate(89.9deg) } 89.83% { transform: rotate(89.7deg) } 91.53% { transform: rotate(90.1deg) } 93.22% { transform: rotate(90.2deg) } 94.92% { transform: rotate(90.1deg) } 96.61% { transform: rotate(90deg) } 98.31% { transform: rotate(89.8deg) } to { transform: rotate(90deg) } } @keyframes spectrum-fill-mask-2 { 0% { transform: rotate(180deg) } 1.69% { transform: rotate(180deg) } 3.39% { transform: rotate(180deg) } 5.08% { transform: rotate(180deg) } 6.78% { transform: rotate(180deg) } 8.47% { transform: rotate(180deg) } 10.17% { transform: rotate(179.2deg) } 11.86% { transform: rotate(164deg) } 13.56% { transform: rotate(151.8deg) } 15.25% { transform: rotate(140.8deg) } 16.95% { transform: rotate(130.3deg) } 18.64% { transform: rotate(120.4deg) } 20.34% { transform: rotate(110.8deg) } 22.03% { transform: rotate(101.6deg) } 23.73% { transform: rotate(93.5deg) } 25.42% { transform: rotate(85.4deg) } 27.12% { transform: rotate(78.1deg) } 28.81% { transform: rotate(71.2deg) } 30.51% { transform: rotate(89.1deg) } 32.2% { transform: rotate(105.5deg) } 33.9% { transform: rotate(121.3deg) } 35.59% { transform: rotate(135.5deg) } 37.29% { transform: rotate(148.4deg) } 38.98% { transform: rotate(161deg) } 40.68% { transform: rotate(173.5deg) } 42.37% { transform: rotate(180deg) } 44.07% { transform: rotate(180deg) } 45.76% { transform: rotate(180deg) } 47.46% { transform: rotate(180deg) } 49.15% { transform: rotate(180deg) } 50.85% { transform: rotate(180deg) } 52.54% { transform: rotate(180deg) } 54.24% { transform: rotate(180deg) } 55.93% { transform: rotate(180deg) } 57.63% { transform: rotate(180deg) } 59.32% { transform: rotate(180deg) } 61.02% { transform: rotate(180deg) } 62.71% { transform: rotate(180deg) } 64.41% { transform: rotate(180deg) } 66.1% { transform: rotate(180deg) } 67.8% { transform: rotate(180deg) } 69.49% { transform: rotate(180deg) } 71.19% { transform: rotate(180deg) } 72.88% { transform: rotate(180deg) } 74.58% { transform: rotate(180deg) } 76.27% { transform: rotate(180deg) } 77.97% { transform: rotate(180deg) } 79.66% { transform: rotate(180deg) } 81.36% { transform: rotate(180deg) } 83.05% { transform: rotate(180deg) } 84.75% { transform: rotate(180deg) } 86.44% { transform: rotate(180deg) } 88.14% { transform: rotate(180deg) } 89.83% { transform: rotate(180deg) } 91.53% { transform: rotate(180deg) } 93.22% { transform: rotate(180deg) } 94.92% { transform: rotate(180deg) } 96.61% { transform: rotate(180deg) } 98.31% { transform: rotate(180deg) } to { transform: rotate(180deg) } } @keyframes spectrum-fills-rotate { 0% { transform: rotate(-90deg) } to { transform: rotate(270deg) } } :host { display: inline-block; position: relative; direction: ltr } .track, :host { width: var(--cm-progresscircle-medium-width, var(--cm-global-dimension-size-400)); height: var(--cm-progresscircle-medium-height, var(--cm-global-dimension-size-400)) } .track { box-sizing: border-box; border-style: solid; border-width: var(--cm-progresscircle-medium-border-size); border-radius: var(--cm-progresscircle-medium-width, var(--cm-global-dimension-size-400)) } :host([dir=ltr]) .fills { left: 0 } :host([dir=rtl]) .fills { right: 0 } .fills { position: absolute; top: 0; width: 100%; height: 100% } .fill { box-sizing: border-box; width: var(--cm-progresscircle-medium-width, var(--cm-global-dimension-size-400)); height: var(--cm-progresscircle-medium-height, var(--cm-global-dimension-size-400)); border-style: solid; border-width: var(--cm-progresscircle-medium-border-size); border-radius: var(--cm-progresscircle-medium-width, var(--cm-global-dimension-size-400)) } .fillMask1, .fillMask2 { width: 50%; height: 100%; transform-origin: 100% center; transform: rotate(180deg); overflow: hidden; position: absolute } .fillSubMask1, .fillSubMask2 { width: 100%; height: 100%; transform-origin: 100% center; overflow: hidden; transform: rotate(-180deg) } .fillMask2 { transform: rotate(0deg) } :host([size=small]), :host([size=small]) .fill, :host([size=small]) .track { width: var(--cm-progresscircle-small-width, var(--cm-global-dimension-size-200)); height: var(--cm-progresscircle-small-height, var(--cm-global-dimension-size-200)) } :host([size=small]) .fill, :host([size=small]) .track { border-style: solid; border-width: var(--cm-progresscircle-small-border-size); border-radius: var(--cm-progresscircle-small-width, var(--cm-global-dimension-size-200)) } :host([size=large]), :host([size=large]) .fill, :host([size=large]) .track { width: var(--cm-progresscircle-large-width, var(--cm-global-dimension-size-800)); height: var(--cm-progresscircle-large-height, var(--cm-global-dimension-size-800)) } :host([size=large]) .fill, :host([size=large]) .track { border-style: solid; border-width: var(--cm-progresscircle-large-border-size, var(--cm-global-dimension-size-50)); border-radius: var(--cm-progresscircle-large-width, var(--cm-global-dimension-size-800)) } :host([indeterminate]) .fills { will-change: transform; transform: translateZ(0); animation: spectrum-fills-rotate 1s cubic-bezier(.25, .78, .48, .89) infinite; transform-origin: center } :host([indeterminate]) .fillSubMask1 { will-change: transform; transform: translateZ(0); animation: spectrum-fill-mask-1 1s linear infinite } :host([indeterminate]) .fillSubMask2 { will-change: transform; transform: translateZ(0); animation: spectrum-fill-mask-2 1s linear infinite } .track { border-color: var(--cm-progresscircle-medium-track-color, var(--cm-alias-track-color-default)) } .fill { border-color: var(--cm-progresscircle-medium-track-fill-color, var(--cm-global-color-blue-400)) } :host([over-background]) .track { border-color: var(--cm-progresscircle-medium-over-background-track-color, var(--cm-alias-track-color-over-background)) } :host([over-background]) .fill { border-color: var(--cm-progresscircle-medium-over-background-track-fill-color, var(--cm-global-color-static-white)) } :host([indeterminate][over-background]) .track { border-color: var(--cm-progresscircle-medium-over-background-track-color, var(--cm-alias-track-color-over-background)) } :host([indeterminate][over-background]) .fill { border-color: var(--cm-progresscircle-medium-over-background-track-fill-color, var(--cm-global-color-static-white)) } `; export default styles; //# sourceMappingURL=progress-circle.css.js.map
javascript
{ "meta": { "charset": "utf-8", "language": "ru", "plural": "(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)" }, "data": { "": { "Author": "Автор", "Back": "Назад", "Best": "Лучшее", "Cancel": "Отмена", "Close Guide": "Закрыть гид", "Exit": "Выход", "Exit from app?": "Выйти из приложения?", "Guide": "Гид", "In order to apply a new language, you must restart the application": "Для того чтобы применить новый язык необходимо перезагрузить приложение", "Interface language": "Язык интерфейса", "Language": "Язык", "Live broadcasts are not supported": "Прямые трансляции не поддерживаются", "Main": "Главная", "No videos": "Нет видео", "Off": "Выключен", "Ok": "Ок", "On": "Включен", "Search": "Поиск", "Settings": "Настройки", "Video is not available": "Видео недоступно", "Youtube": "Youtube", "Youtube.com is a world famous video hosting, which allows users to watch, upload and share videos with their friends.": "Youtube.com популярный мировой видеохостинг, где пользователи могут добавлять, просматривать, комментировать и делиться с друзьями видеозаписями.", "ago": "назад", "day": [ "день", "дня", "дней" ], "hour": [ "час", "часа", "часов" ], "minute": [ "минута", "минуты", "минут" ], "month": [ "месяц", "месяца", "месяцев" ], "second": [ "секунда", "секунды", "се" ], "subscriber": [ "подписчик", "подписчика", "подписчиков" ], "view": [ "просмотр", "просмотра", "просмотров" ], "year": [ "год", "года", "лет" ] } } }
json
{ "name": "jquery.input", "main": "jquery.input.js", "version": "0.1.0", "homepage": "https://github.com/DubFriend/jquery.input", "description": "\"A Common interface for html input elements.\"", "keywords": [ "input", "form", "interface" ], "authors": [ "<NAME>" ], "license": "MIT", "ignore": [ "**/.*", "node_modules", "bower_components", "test", "tests" ] }
json
<filename>kmom05/dom/style/kmom05.css .box { position: absolute; z-index: 1; } .center { top: 50%; left: 50%; } .green { background-color: green; } .size100 { height: 100px; width: 100px; } .size200 { height: 200px; width: 200px; } .selected { border: 4px solid black; } .circle { border-radius: 50%; } .animateSize { transition: width 1s, height 1s; }
css
<filename>src/api/Caens.js // @flow import Entity from './Entity'; import type { APIPayload, } from './Entity'; export default class Caens extends Entity { delete( id: number, ): Promise<Object> { return this._deleteID("industry-classifications", id); } update( id: number, payload: APIPayload, ): Promise<Object> { return this._update("industry-classifications", id, payload); } create( payload: APIPayload, ): Promise<Object> { return this._post("industry-classifications", payload); } list( params: APIPayload, ): Promise<Object> { return this._get("industry-classifications", params); } getByID( id: number, ): Promise<Object> { return this._getID("industry-classifications", id); } }
javascript
<reponame>FuqiX/biosamples-v4<gh_stars>0 package uk.ac.ebi.biosamples.model.facet.content; import java.util.Arrays; import java.util.Map; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; public class LabelCountEntry implements Comparable<LabelCountEntry>{ private final String label; private final long count; private LabelCountEntry(String label, long count) { this.label = label; this.count = count; } public String getLabel() { return label; } public long getCount() { return count; } @Override public int compareTo(LabelCountEntry o) { return Long.compare(this.count, o.count); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("LabelCountEntry("); sb.append(label); sb.append(","); sb.append(count); sb.append(")"); return sb.toString(); } @JsonCreator public static LabelCountEntry build(@JsonProperty("label") String label, @JsonProperty("count") long count) { if (label == null || label.trim().length() == 0) { throw new IllegalArgumentException("label must not be blank"); } return new LabelCountEntry(label.trim(), count); } @JsonCreator public static LabelCountEntry build(Map<String, String> entryMap) { if (isValidLabelCount(entryMap)) { return new LabelCountEntry(entryMap.get("label"), Long.parseLong(entryMap.get("count"))); } throw new RuntimeException("Provided object is not suitable to be converted to LabelCountEntry"); } public static Boolean isValidLabelCount(Map<String, String> content) { return content.keySet().containsAll(Arrays.asList("label", "count")); } }
java
<filename>src/aws/s3_bucket.rs use crate::{ aws::ClientDetails, client::{ClientType, NukerClient}, config::ResourceConfig, handle_future_with_return, resource::{EnforcementState, NTag, Resource, ResourceState}, Error, Result, }; use async_trait::async_trait; use rusoto_core::Region; use rusoto_s3::{ Bucket, Delete, DeleteBucketPolicyRequest, DeleteBucketRequest, DeleteObjectsRequest, GetBucketAclRequest, GetBucketLocationRequest, GetBucketPolicyRequest, GetBucketPolicyStatusRequest, GetBucketTaggingRequest, GetBucketVersioningRequest, GetPublicAccessBlockRequest, Grant, ListObjectVersionsRequest, ListObjectsV2Request, ObjectIdentifier, PolicyStatus, PublicAccessBlockConfiguration, PutBucketVersioningRequest, S3Client, Tag, VersioningConfiguration, S3, }; use tracing::{debug, trace, warn}; static S3_PUBLIC_GROUPS: [&str; 2] = [ "http://acs.amazonaws.com/groups/global/AuthenticatedUsers", "http://acs.amazonaws.com/groups/global/AllUsers", ]; #[derive(Clone)] pub struct S3BucketClient { client: S3Client, region: Region, account_num: String, config: ResourceConfig, dry_run: bool, } impl S3BucketClient { pub fn new(cd: &ClientDetails, config: &ResourceConfig, dry_run: bool) -> Self { S3BucketClient { client: S3Client::new_with_client(cd.client.clone(), cd.region.clone()), region: cd.region.clone(), account_num: cd.account_number.clone(), config: config.clone(), dry_run, } } async fn package_resources(&self, buckets: Vec<Bucket>) -> Vec<Resource> { let mut resources: Vec<Resource> = Vec::new(); for bucket in buckets { let bucket_name = bucket.name.unwrap(); let arn = format!("arn:aws:s3:::{}", bucket_name); let tags = self.get_tags_for_bucket(&bucket_name).await; resources.push(Resource { id: bucket_name, arn: Some(arn), type_: ClientType::S3Bucket, region: self.region.clone(), tags: self.package_tags(tags), state: Some(ResourceState::Available), start_time: None, enforcement_state: EnforcementState::SkipUnknownState, enforcement_reason: None, resource_type: None, dependencies: None, termination_protection: None, }) } resources } fn resource_name_is_not_dns_compliant(&self, bucket_id: &str) -> bool { bucket_id.contains('.') } async fn is_bucket_public(&self, bucket_id: &str) -> bool { let mut ps_is_public = false; let mut grants_is_public = false; // Check the Bucket Policy Status if let Some(policy_status) = self.get_bucket_policy_status(bucket_id).await { if policy_status.is_public == Some(true) { debug!("Bucket ({}) policy status is public", bucket_id); ps_is_public = true; } } // Check the ACLs to see if grantee is AllUsers or AllAuthenticatedUsers if let Some(grants) = self.get_acls_for_bucket(bucket_id).await { debug!("Bucket ({}) grants - {:?}", bucket_id, grants); for grant in grants { if let Some(grantee) = grant.grantee { // TODO: https://github.com/rusoto/rusoto/issues/1703 - type_ is not getting populated // if grantee.type_.as_str() == "Group" && if let Some(group_type) = grantee.uri { if S3_PUBLIC_GROUPS.contains(&group_type.as_str()) { debug!("Bucket ({}) grants are public", bucket_id); grants_is_public = true; } } } } } if ps_is_public || grants_is_public { true } else { false } } async fn get_buckets(&self) -> Result<Vec<Bucket>> { let result = self.client.list_buckets().await?; let mut buckets: Vec<Bucket> = Vec::new(); for bucket in result.buckets.unwrap_or_default() { match self .client .get_bucket_location(GetBucketLocationRequest { bucket: bucket.name.as_ref().unwrap().to_string(), ..Default::default() }) .await { Ok(bucket_loc_res) => { let bucket_loc = if !bucket_loc_res .location_constraint .as_ref() .unwrap() .is_empty() { bucket_loc_res .location_constraint .as_ref() .unwrap() .as_str() } else { Region::UsEast1.name() }; let region = self.region.name(); if bucket_loc == region { buckets.push(bucket); } } Err(err) => { warn!( resource = ?bucket.name, reason = ?err, "Failed getting bucket location." ); } } } Ok(buckets) } async fn get_acls_for_bucket(&self, bucket_id: &str) -> Option<Vec<Grant>> { match self .client .get_bucket_acl(GetBucketAclRequest { bucket: bucket_id.to_string(), ..Default::default() }) .await { Ok(result) => result.grants, Err(err) => { trace!( "Failed to get ACL Grants for bucket {} - {:?}", bucket_id, err ); None } } } #[allow(dead_code)] async fn get_public_access_block( &self, bucket_id: &str, ) -> Option<PublicAccessBlockConfiguration> { match self .client .get_public_access_block(GetPublicAccessBlockRequest { bucket: bucket_id.to_string(), ..Default::default() }) .await { Ok(result) => result.public_access_block_configuration, Err(err) => { trace!( "Failed to get public_access_block for bucket {} - {:?}", bucket_id, err ); None } } } async fn get_bucket_policy_status(&self, bucket_id: &str) -> Option<PolicyStatus> { match self .client .get_bucket_policy_status(GetBucketPolicyStatusRequest { bucket: bucket_id.to_string(), ..Default::default() }) .await { Ok(result) => result.policy_status, Err(err) => { trace!( "Failed to get bucket policy status for bucket {} - {:?}", bucket_id, err ); None } } } async fn delete_objects_in_bucket(&self, bucket: &str) -> Result<()> { trace!(resource = bucket, "Deleting objects"); let mut next_token: Option<String> = None; // Delete all objects from the bucket loop { let req = self.client.list_objects_v2(ListObjectsV2Request { bucket: bucket.to_owned(), continuation_token: next_token, ..Default::default() }); if let Ok(result) = handle_future_with_return!(req) { if let Some(objects) = result.contents { debug!( resource = bucket, objects_count = objects.len(), "Deleting Objects" ); match self .client .delete_objects(DeleteObjectsRequest { bucket: bucket.to_owned(), // bypass_governance_retention: Some(true), delete: Delete { objects: objects .iter() .map(|o| ObjectIdentifier { key: o.key.as_ref().unwrap().to_owned(), ..Default::default() }) .collect(), ..Default::default() }, ..Default::default() }) .await { Ok(r) => { if let Some(errors) = r.errors { for error in errors { warn!( resource = bucket, "Failed delete_object with errors: {:?}", error ); } } else { debug!( resource = bucket, deleted_count = r.deleted.as_ref().unwrap().len(), "Successfully deleted objects" ); } } Err(err) => { warn!(resource = bucket, error = ?err, "Failed delete_objects"); } } } if result.next_continuation_token.is_none() { break; } else { next_token = result.next_continuation_token; } } else { break; } } Ok(()) } async fn delete_versions_in_bucket(&self, bucket: &str) -> Result<()> { trace!(resource = bucket, "Deleting Object Versions"); // Delete all object versions(required for versioned buckets) let mut next_key_token: Option<String> = None; loop { match self .client .list_object_versions(ListObjectVersionsRequest { bucket: bucket.to_owned(), key_marker: next_key_token, ..Default::default() }) .await { Ok(result) => { trace!( resource = bucket, is_truncated = ?result.is_truncated, "list_object_versions" ); if let Some(versions) = result.versions { debug!( resource = bucket, versions_count = versions.len(), "Deleting Object Versions" ); // delete object versions match self .client .delete_objects(DeleteObjectsRequest { bucket: bucket.to_owned(), // bypass_governance_retention: Some(true), delete: Delete { objects: versions .iter() .map(|v| ObjectIdentifier { key: v.key.as_ref().unwrap().to_owned(), version_id: v.version_id.to_owned(), ..Default::default() }) .collect(), ..Default::default() }, ..Default::default() }) .await { Ok(r) => { if let Some(errors) = r.errors { for error in errors { warn!( resource = bucket, "Failed delete_object with errors: {:?}", error ); } } else { debug!( resource = bucket, deleted_count = r.deleted.as_ref().unwrap().len(), "Deleted objects" ); } } Err(err) => { warn!(resource = bucket, error = ?err, "Failed delete_objects - versions"); } } } if let Some(delete_markers) = result.delete_markers { debug!( resource = bucket, del_markers_count = delete_markers.len(), "Deleting Object Delete Markers" ); // delete object versions match self .client .delete_objects(DeleteObjectsRequest { bucket: bucket.to_owned(), // bypass_governance_retention: Some(true), delete: Delete { objects: delete_markers .iter() .map(|m| ObjectIdentifier { key: m.key.as_ref().unwrap().to_owned(), version_id: m.version_id.to_owned(), ..Default::default() }) .collect(), ..Default::default() }, ..Default::default() }) .await { Ok(r) => { if let Some(errors) = r.errors { for error in errors { warn!( resource = bucket, "Failed delete_object_markers with errors: {:?}", error ); } } else { debug!( resource = bucket, deleted_count = r.deleted.as_ref().unwrap().len(), "Deleted objects markers" ); } } Err(err) => { warn!(resource = bucket, error = ?err, "Failed delete_objects - delete_markers"); } } } if result.is_truncated == Some(true) { next_key_token = result.next_key_marker; } else { break; } } Err(err) => { warn!(resource = bucket, error = ?err, "Failed getting object versions."); break; } } } Ok(()) } async fn suspend_versioning(&self, bucket: &str) -> Result<()> { debug!(resource = bucket, "Checking and suspending versioning"); match self .client .get_bucket_versioning(GetBucketVersioningRequest { bucket: bucket.to_owned(), ..Default::default() }) .await { Ok(result) => { if let Some(status) = result.status { match &*status { "Enabled" => { match self .client .put_bucket_versioning(PutBucketVersioningRequest { bucket: bucket.to_owned(), versioning_configuration: VersioningConfiguration { status: Some("Suspended".to_string()), ..Default::default() }, ..Default::default() }) .await { Ok(()) => { debug!(resource = bucket, "Suspended versioning."); } Err(err) => { warn!(resource = bucket, error = ?err, "Failed disabling versioning"); return Err(Error::from(err)); } } } "Suspended" => { trace!(resource = bucket, "Versioning is disabled."); } _ => {} } } } Err(err) => { warn!(resource = bucket, error = ?err, "Failed versioning status."); } } Ok(()) } async fn delete_bucket_policy(&self, bucket: &str) -> Result<()> { debug!(resource = bucket, "Checking and deleting bucket policy"); match self .client .get_bucket_policy(GetBucketPolicyRequest { bucket: bucket.to_string(), ..Default::default() }) .await { Ok(result) => { if let Some(_policy) = result.policy { match self .client .delete_bucket_policy(DeleteBucketPolicyRequest { bucket: bucket.to_string(), ..Default::default() }) .await { Ok(()) => trace!(resource = bucket, "Deleted bucket policy"), Err(err) => { warn!(resource = bucket, error = ?err, "Failed deleting bucket policy") } } } else { trace!(resource = bucket, "No policy associated with bucket."); } } Err(err) => warn!(resource = bucket, error = ?err, "Failed fetching bucket policy."), } Ok(()) } async fn delete_bucket<'a>(&self, bucket: &str) -> Result<()> { debug!(resource = bucket, "Deleting"); if !self.dry_run { if let Ok(()) = self.delete_bucket_policy(bucket).await { if let Ok(()) = self.suspend_versioning(bucket).await { if let Ok(()) = self.delete_objects_in_bucket(bucket).await { if let Ok(()) = self.delete_versions_in_bucket(bucket).await { trace!(resource = bucket, "Attempting to delete bucket"); match self .client .delete_bucket(DeleteBucketRequest { bucket: bucket.to_owned(), ..Default::default() }) .await { Ok(()) => trace!(resource = bucket, "Successfully deleted bucket."), Err(err) => { warn!(resource = bucket, error = ?err, "Failed deleting bucket.") } } } } } } } Ok(()) } async fn get_tags_for_bucket(&self, bucket: &str) -> Option<Vec<Tag>> { let result = self .client .get_bucket_tagging(GetBucketTaggingRequest { bucket: bucket.to_owned(), ..Default::default() }) .await; if let Ok(tags_output) = result { Some(tags_output.tag_set) } else { None } } fn package_tags(&self, tags: Option<Vec<Tag>>) -> Option<Vec<NTag>> { tags.map(|ts| { ts.iter() .map(|tag| NTag { key: Some(tag.key.clone()), value: Some(tag.value.clone()), }) .collect() }) } } #[async_trait] impl NukerClient for S3BucketClient { async fn scan(&self) -> Result<Vec<Resource>> { trace!("Init S3 Bucket resource scanner"); let buckets = self.get_buckets().await?; Ok(self.package_resources(buckets).await) } async fn dependencies(&self, _resource: &Resource) -> Option<Vec<Resource>> { None } async fn additional_filters( &self, resource: &Resource, _config: &ResourceConfig, ) -> Option<bool> { if self.resource_name_is_not_dns_compliant(&resource.id) { debug!( resource = resource.id.as_str(), "Bucket naming is not DNS compliant." ); return Some(true); } else if self.is_bucket_public(&resource.id).await { debug!( resource = resource.id.as_str(), "Bucket is publicly accessible." ); return Some(true); } Some(false) } async fn stop(&self, resource: &Resource) -> Result<()> { self.delete_bucket(&resource.id).await } async fn delete(&self, resource: &Resource) -> Result<()> { self.delete_bucket(&resource.id).await } }
rust
<reponame>hostvilleng/dorcas-hub-business [ { "id": "box-1", "name": "Box 1", "ns": ["ns1.hostville.website", "ns2.hostville.website"], "capacity": 100, "api_endpoint": "https://host67.registrar-servers.com:2087", "api_id": "<KEY>", "api_secret": "<KEY>", "provider": "cpanel" } ]
json
Thursday March 08, 2018, When it comes to entrepreneurship, women have many odds stacked against them. But the instinct to face insurmountable challenges has made women entrepreneurs who they are – successful and a force to be reckoned with. Why do women find entrepreneurship challenging? There are plenty of reasons – for some, it’s getting a foothold in what is still essentially a boy’s club. For others, it’s finding investors who take them seriously. We can go and on with many reasons. But to top them all is the proverbial work-life conundrum… a balance that is expected only from women. So how have women entrepreneurs reached where they are now? How did they face each challenge, each obstacle, and every thorn in the path? And more importantly, what did they learn from the challenges and how did they overcome them? HerStory asked women entrepreneurs from various sectors about the challenges they faced and how they faced them head-on. Read on to find out more. “When I started out, nobody told me what direction to take. I had to make my own path. I believe that to venture on to a new beginning, what a person needs most is self-confidence. Sure, we may get inspired or influenced by the people we meet, or the stories we read, but nothing pushes you forward like the voice that comes from within, but ultimately, if you've to create something new, you've to work bottom up with a strong vision. I believe each one of us needs to probe within. Everybody is capable — it's the confidence that decides the path ahead. That apart, there have been people who have inspired me to work hard all my life — my family, my parents. The idea of being a 'self-made woman' and making a difference is what has inspired me to begin my journey and take it this far. Although, being a woman entrepreneur in India, I've had to face the glass ceiling along the way, I always had the confidence to get past those hurdles and carve my own niche. “My biggest challenge as an entrepreneur was to keep myself going undeterred and committed to bringing mental healthcare to everyone, in the wake of too many setbacks. An entrepreneur's journey looks glamorous and sorted and one wherein passion runs high at all times; but in reality, it's riddled with struggles. A new idea, a new service that an entrepreneur knows will change the world, will not be adopted the day it comes out, especially if it's a paradigm shift. One has to build the market from ground up. I too had to struggle incredibly hard to build a market for mental health services. And in this time-taking process, some people who joined my vision early on, started leaving, personal money got tight, the hope started getting replaced with hopelessness. My own energy started fading — that was the most challenging aspect of it. I overcame it by going to the basics first. Answering one question at a time. Is there a need for what I offer? The answer was yes. Is the need large enough? The answer was yes. Is ours a great service that can tackle this? The answer again was yes. Are these challenges impossible to overcome? The answer was no. This gave me a lot of clarity. I then started picking up small wins, finding answers for next steps. That allowed me to take failures in my stride and as a guiding light for the strategy ahead. Any entrepreneur must not fear but look forward to the key clues that take the journey forward! Being a woman entrepreneur in the late-80s, trying to scale up in a highly unorganised industry domain like beauty and wellness services was one of my biggest challenges initially. While people were familiar with the ubiquitous 'beauty parlour', the idea of a holistic wellness solutions provider which combined scientific weight management programmes with advanced hair and skin treatments was a new concept. I struggled to raise capital, and banks were apprehensive of something that was hardly deemed as sustainable and scalable. The support of my family along with my persistence helped me overcome most of these challenges. My greatest inspiration has always been my mother. Not having conformed to the gender norms, I felt brave enough to give in to the feeling of venturing into an area that had always interested me. I could not have done this without the support of my husband Mukesh, who always had belief in my abilities. The reason I chose this path was because of the belief that I could do more. It was sheer perseverance and my interest in transforming lives that made me stay on this path. In 2000, when I began my career in the nightclub business, I opened my first lounge bar in Bangalore called 180 Proof. My biggest challenge was that people didn’t know how to engage or have a dialogue with a woman. Was this gender bias or was it simply that they hadn’t ever seen a woman in this territory? I was perceived as a very young girl and looked younger than my years, so people wondered if I could stand my ground. The way I overcame this was by making my word very powerful — I only committed to what I could do or deliver. Over time, this became my mantra for success. More recently, at Jagatjit Industry, I have faced bias from my own gender. Sometimes I believe women are more chauvinistic than men but I believe this stems from jealousy, resentment, and lack of opportunities for these women. For my part, I try to create a diverse workspace, give women opportunities and support their growth in different ways, which include mentoring. “Coming from a non-manufacturing background, starting my own venture in the space of electric vehicles, which is so technologically dynamic, was a big challenge. But I was determined to take up the challenge, as I believed that I would make it. Also, with this venture, I realised that with the right kind of support, women can leave behind clichés and perceptions and carve a niche for themselves in any industry of their choice. As an electric vehicle manufacturer, we are proud of our 40 percent women workforce who work as a team in a sector which is conventionally dominated by men. And I must say, they are doing their job with great will and hard work. Ampere Electric Vehicle Pvt Ltd. It is certainly not easy being a working woman in any workplace. Men form the majority in most setups, and unfortunately, they form an alliance. It is therefore not easy to break into the proverbial ‘boys club’ and make space for oneself as a woman. The problem lies in deep gender biases and stereotypes of course — in their collective subconscious, a woman’s place is considered to be at home. For me, I started my entrepreneurial journey together with my journey as a mother. Every day is a management challenge because I have to create a fine balance between my role as a mother and as an entrepreneur, both being very demanding. We must stop thinking along these lines. I've never thought of myself as a ‘woman’ entrepreneur, rather just as an entrepreneur, who also happens to be a woman. The challenges are the same with people of both genders. Being an entrepreneur brings its own set of challenges — reaching out to investors and consumers, setting up the production unit was all a challenge in itself. But I was backed by a strong and supportive team that made all this happen. Also, I believe, women cannot expect anyone else to fight for them. There are no handouts. You will have to stand your ground. I will work, travel, miss family events as much as my husband or my father. Having said that, as a working mother, I do find myself making adjustments to other people with kids and more so with working mothers. As a woman entrepreneur, I feel my challenge is more internal than external. Two things, in particular, stand out for me personally. The first is a cautious approach. I prefer to weigh my next steps keeping in mind that it would have consequences on people, money, time, and effort. Go Big or go bust is not a personal philosophy! I’d prefer to scale as the business grows. While I may set my sights on X, I often hear of my male counterparts talking in terms of 100X. Surrounding yourself with colleagues and external partners who complement your limitations is a great way to break out of your comfort zone. Kiran Ray Chaudhury, “My biggest challenge as a woman entrepreneur has been — managing my business in India from my two homes (Gurugram and New York) which are 10.5 hours apart; and having my child in New York, while continuing to stay highly engaged with my business, through my pregnancy and beyond. Following are the three ways I was able to overcome or address this challenge: A woman entrepreneur faces a plethora of problems when it comes to embarking upon her own entrepreneurial venture. Banks and other financial institutions often do not consider women entrepreneurs as "serious" applicants for setting up their projects and they are hesitant to provide financial assistance. Kanchan Naikawadi, Changing biases and mindsets was the biggest challenge I faced when I founded JobsForHer in March 2015. I was told by a lot of women that they were being advised to hide the ‘gap’ in their resumes as most companies perceived the ‘gap’ negatively. The same was corroborated when we started speaking to companies to recruit women on a break as many brashly proclaimed that they didn’t want to hire women, women on a break, or mothers. Over the last three years, we have made huge progress in changing the mindsets of both women and companies. Women are now confident about the ‘gap’ in their resumes and portray it in the right light. And companies are now not only taking back women returnees but firms such as Barclays, Capgemini, Citi, EY, Sapient, Dell, Mindtree, PayPal, Intuit, are also working with us closely for several engagement and recruitment solutions for their diversity requirements across India. How seriously do people take women who want to run their own business in contrast to their male counterparts? A large majority will agree that the entrepreneurship plans of women are considered as frivolous at the first instinct. I certainly believe that getting a buy-in from all stakeholders, both personal and professional, is one of the biggest challenges that almost every woman has to face when she sets out on her entrepreneurial quest. It’s the early stages of any new enterprise that require maximum amount of time, energy, and focus. These are the very years wherein women face far more added pressures than men do! While proving myself, acquiring some amount of backing from my investors and being taken seriously at work as well as at home is a challenge, there is an added conflict in expectations. The professional life predetermines that I fit into a man’s role, the home front demands that I continue to comply with all the duties of a daughter-in-law, wife, and mother. The perennial question, which I, along with many women have always been asked is, “how do you balance work and home?” I would love to see my husband fumble over that question if directed to him. Priti Rathi Gupta, The biggest challenge I have faced is learning how to deal with daily fires that constantly need my attention, while still dedicating time to the bigger picture. From the moment I enter the office, my time is filled with working with our team to set goals, get updates, and figure out how to solve various problems, from vendor issues to tech bugs. However, if I spent all my time dousing daily fires that always seem urgent, I wouldn’t have time to dedicate to bigger projects like our discussion board for brides, where we need to plan the best marketing strategy, and get customer feedback on features well in advance. Hence, to make sure that I am spending time every day on the bigger picture, I actually schedule it in my calendar as an appointment with myself to ensure I am giving our larger projects the thought that they deserve! "Entrepreneurship is hard, for men and women alike. Struggle with funding, scaling up, compliances and finding the right talent to make your dream profitable is always a challenge. Adding to that, as in my case, the challenges as a young female entrepreneur in a male-dominated and somewhat patriarchal industry were further heightened. Moving from an impression of 'just a young woman with a fancy degree' to earning my respect as a ‘businesswoman’ has been a struggle with people I have both worked and interacted with. However, the best way to overcome this was to not take it personally or let it bother me, and eventually gain the respect and trust by letting my work speak for itself. " "I've faced a singular challenge since the beginning of my career: gender stereotypes. As the managing director for Rapaport India, for several years, my ‘well-wishers’ told me that the diamond business was cut-throat; therefore, there was no place for the fairer gender. When I openly condemned the influx of blood diamonds into India, I was again advised to back off from such 'bold' actions since 'it wasn't my place'. I never let stereotypes stop me then, and I still continue to battle them every day. Today, as a full-time mother and entrepreneur, people often ask me how I'm managing the ‘impossible task’ of juggling Healthhunt, my startup, and my little one, Aramnaya. A career isn't a woman's nemesis; in fact, I believe that motherhood and an active career can beautifully complement each other.... provided we purge ourselves of the stereotypical notions pertaining to the roles each gender is supposed to play." Entrepreneurship itself presents new challenges every day. Being a woman entrepreneur, you have certain advantages as well as disadvantages and a lot would depend on the idea/sector/execution bandwidth. A lot of times, we believe the challenge is bigger than it truly is. I have seen women hesitate to take a risk because they fear failure. That’s a strong factor that comes in their way to success. While the corporate world is still prejudiced and judgmental of working women, the entrepreneurship space is a level playing field. As a woman, I have not faced any issues and have always been taken seriously for my work. As an entrepreneur, once you take onus of your actions, your gender will not be a driver or differentiator. Your actions will speak for yourself. And as the founder, homeowners, and guests have placed trust in me because of the work that I do, and not my gender.
english
package com.ssafy.algorithm.bj; import java.io.*; public class Bj772_2_1 { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); static String s1, s2; static int answer; static int[] dp; // 1. 문자를 모두 arrayList에 둔다. // 2. 맨 처음에 public static void main(String[] args) throws IOException { s1 = br.readLine(); s2 = br.readLine(); dp = new int[s1.length()]; // 같은 문자면 저장, 다른 문자면 pass int s2Index = 0; int s1Length = s1.length(); int s2Length = s2.length(); for(int i=0;i<s1Length;++i){ } } }
java
<reponame>JLLeitschuh/bulk-security-pr-generator { "project_name": "joachim-rodrigues/graphiteIntegrator", "files": { "/pom.xml": 2 }, "pull_request": "https://github.com/joachim-rodrigues/graphiteIntegrator/pull/7", "report": { "files_fixed": 1, "vulnerabilities_fixed": 2 } }
json
On Japan’s southern tip, some initiatives to revitalize local businesses are making minute but continued success, offering a silver lining for a region that has long suffered from an aging population and sinking economy. Nagasaki, which has seen its once-dominant shipbuilding industry wane due to global competition, is today symbolic of Japan’s demographic challenge. It has one of the fastest shrinking populations, as younger people head for bigger cities searching for work. But it is trying to reinvent itself as an IT hub and has created data science programs at local universities. That has helped lure big tech firms like Kyocera Corp and Fujifilm Holdings Corp, which have set up research and development centers. The prefecture offers subsidies to firms that bring in jobs and investment. Last year alone, it signed contracts with a record of 13 companies, mainly in IT and finance. According to the latest available data, electronic parts production made up 33% of the prefecture’s gross domestic product (GDP) as of 2017. That was up from 14% in 2010 and exceeded 18% for shipbuilding. Local lender Juhachi-Shinwa Bank wants to help revive a fishing industry hit by falling prices. Bank officials are working with the local government on a subscription system to connect local fishers with Tokyo consumers. Under the scheme, consumers who pay a monthly fee will have fresh fish shipped to them directly. “Nagasaki is an exemplar of the challenges Japan faces,” said Kousei Kuwasaki, of Juhachi-Shinwa Bank.
english
Kathmandu - The Bibeksheel Nepali Dal and Sajha Party have announced unification. Following the unification, the parties will now be known as Bibeksheel Sajha Party. Ujjwal Thapa who led the Bibeksheel Dal and Rabindra Mishra, who founded the Sajha Party are now the joint-convenors of the new party. Speaking at a press conference organised to announce the unification here Wednesday, Mr Mishra said the party will work to transform the country into a middle-income country by 2030. Convenor Thapa said the two parties united for economic development and prosperity of the country. A 34-member central executive committee of the party was also announced following the unification, along with the formation of a coordination committee. The party will elect one convenor each for every province.
english
import json import os class JsonLoader: """ JsonLoader is used to load the data from all structured json files associated with the DeepInterpolation package. """ def __init__(self, path): self.path = path self.load_json() def load_json(self): """ This function load the json file from the path recorded in the class instance. Parameters: None Returns: None """ with open(self.path, "r") as read_file: self.json_data = json.load(read_file) print("done") def set_default(self, parameter_name, default_value): """ set default forces the initialization of a parameter if it was not present in the json file. If the parameter is already present in the json file, nothing will be changed. Parameters: parameter_name (str): name of the paramter to initialize default_value (Any): default parameter value Returns: None """ if not (parameter_name in self.json_data): self.json_data[parameter_name] = default_value def get_type(self): """ json types define the general category of the object the json file applies to. For instance, the json can apply to a data Generator type Parameters: None Returns: str: Description of the json type """ return self.json_data["type"] def get_name(self): """ Each json type is sub-divided into different names. The name defines the exact construction logic of the object and how the parameters json data is used. For instance, a json file can apply to a Generator type using the AudioGenerator name when generating data from an audio source. Type and Name fully defines the object logic. Parameters: None Returns: str: Description of the json name """ return self.json_data["name"] class JsonSaver: """ JsonSaver is used to save dict data into individual file. """ def __init__(self, dict_save): self.dict = dict_save def save_json(self, path): """ This function save the json file into the path provided. Parameters: str: path: str Returns: None """ with open(path, "w") as write_file: json.dump(self.dict, write_file) os.chmod(path, 0o777) class ClassLoader: """ ClassLoader allows to select and create a specific Type and Name object from the available library of objects. It then uses the parameters in the json file to create a specific instance of that object. It returns that object and the ClassLoader object should then be deleted. """ from deepinterpolation import network_collection from deepinterpolation import generator_collection from deepinterpolation import trainor_collection from deepinterpolation import inferrence_collection def __init__(self, json_path): json_class = JsonLoader(json_path) self.json_path = json_path self.local_type = json_class.get_type() self.local_name = json_class.get_name() def find_and_build(self): """ This function searches the available classes available for object 'type' and 'name' and returns a callback to instantiate. Parameters: None Returns: obj: an instantiation callback of the object requested when creating ClassLoader with a json file """ if self.local_type == "network": local_object = getattr(self.network_collection, self.local_name) return local_object elif self.local_type == "generator": local_object = getattr(self.generator_collection, self.local_name) return local_object elif self.local_type == "trainer": local_object = getattr(self.trainor_collection, self.local_name) return local_object elif self.local_type == "inferrence": local_object = getattr(self.inferrence_collection, self.local_name) return local_object
python
<gh_stars>0 --- pid: 00760pl label: People key: people location: British Columbia keywords: People, Men, Interiors description: 'Derry Family: Uncle Bret in British Columbia circa 1907' named_persons: rights: This photo is property of Lake County Public Library. creation_date: c. 1907 ingest_date: '2021-04-06' latitude: longitude: format: Photo source: Scanned Photo order: '3318' layout: cmhc_item thumbnail: "/img/derivatives/iiif/images/00760pl/full/250,/0/default.jpg" full: "/img/derivatives/iiif/images/00760pl/full/1140,/0/default.jpg" manifest: "/img/derivatives/iiif/00760pl/manifest.json" collection: cmhc ! '': ---
markdown
<gh_stars>1-10 __author__ = '<NAME>' class TextEncoder(object): @classmethod def encode(cls, categories): categories_matrix = [[0 for i in range(0, len(categories))] for j in range(0, len(categories))] true_index = 0 for i in range(0, len(categories)): categories[i][true_index] = categories[i] true_index += 1 return categories_matrix
python
{"origin": "http://wallbase.cc/wallpaper/111239", "download_link": "http://wallpapers.wallbase.cc/manga-anime/wallpaper-111239.jpg", "views": 2626, "x_resolution": 1440, "filetype": "jpg", "site": "wallbase.cc", "y_resolution": 900, "colors": ["#454783", "#6c82c5", "#1a1746", "#dbd2d6", "#a1b2d6"], "comments": [""], "favorites": 15, "descriptors": ["<NAME>", "movies", "<NAME>", "shinigami", "Studio Ghibli", "gods"], "uploader": " 4chan"}
json
<filename>covid19-web/src/main/java/cn/tju/xiaoyin/system/vo/UserVo.java package cn.tju.xiaoyin.system.vo; import lombok.Data; /** * @author yinck * @version 1.0 * @date 2021-01-07 00:37 */ @Data public class UserVo { private String username; private String nickname; private String email; private Integer sex; private Long departmentId; }
java
/* eslint-disable no-undef */ import C from '../lib/index.js'; describe('md5', () => { it('vector 1', () => { expect(C.MD5('').toString()).toBe('d41d8cd98f00b204e9800998ecf8427e'); }); });
javascript
The Gujarat government on Tuesday decided to impose night curfew in nine more cities of the state in a bid to stem the spread of coronavirus. With this, the night curfew is now being enforced in 29 cities of Gujarat. The state government also announced new restrictions in these 29 cities, including closure of restaurants, swimming pools, cinema halls, shopping complexes and water parks, till May 5. It also announced curbs on APMCs, public transport, religious gatherings, funerals and marriage functions across the state. The night curfew from 8 pm to 6 am was already in place since April 7 in 20 cities, including Ahmedabad, Surat, Rajkot and Vadodara. “Now, the state government has decided to enforce the night curfew in nine more cities – Himmatnagar, Navsari, Veraval, Valsad, Porbandar, Botad, Viramgam, Chhotaudepur and Palanpur – from April 28," an official release said. Chief Minister Vijay Rupani took the decision during a high-level meeting on Tuesday after taking into consideration Union Home Ministry’s latest guidelines to control the spread of the coronavirus, it said. Informing further about the new curbs, the release said while essential services and factories will continue to function in these cities, the government has ordered closure of restaurants, swimming pools, cinema halls, shopping complexes and water parks in these 29 cities till May 5. Other establishments like beauty parlours, gardens, salons, gyms, auditoriums and malls would also remain shut in these cities, it said. Besides all the APMCs (agriculture produce market committees) across the state will also remain closed, and only market yards trading in vegetables and fruits will be allowed to function. All religious places in the state will also remain shut for the public, and only 20 people will be allowed at a funeral, the release said, adding that the upper limit for marriage gatherings is 50. Public transport buses across the state would function with 50 per cent capacity, it added. Gujarat’s COVID-19 tally crossed the 5 lakh-mark on Monday to reach 5,10,373 with the addition of 14,340 new cases, the highest rise in a single day so far. With a record 158 fatalities in a day, the Covid-19 toll in Gujarat rose to 6,486, as per the state health department. Read all the Latest News, Breaking News and Coronavirus News here. Follow us on Facebook, Twitter and Telegram. (This story has not been edited by News18 staff and is published from a syndicated news agency feed - PTI)
english
<filename>templates/registration/password_change_done.html {% extends "base.html" %} {% block menu %} {% endblock %} {% block sidebar %} {% endblock %} {% block userlinks %} {% endblock %} {% block content %} <h4>Password changed</h4> Thanks, your password has been changed. Please login <a href="{% url 'login' %}">here</a>. {% endblock %}
html
<reponame>dann1kid/FahlOres [ { code: "tennantite", _comment: "Surface tennantite deposits", triesPerChunk: 0.2, generator: "disc-followsurface", attributes: { inblock: { code: "rock-*", name: "rock", allowedVariants: ["andesite", "granite", "basalt", "peridotite", "claystone", "sandstone", "shale", "chalk", "chert", "conglomerate", "phyllite", "slate"] }, placeblock: { code: "ore-*-tennantite-{rock}", name: "grade", allowedVariantsByInBlock: { "@rock-(andesite|granite|peridotite|claystone|sandstone|shale|chalk|chert|conglomerate|phyllite|slate)": ["poor", "medium"], "rock-basalt": ["poor", "medium", "rich"] } }, surfaceBlock: { code: "looseores-tennantite-{rock}-free" }, surfaceBlockChance: 0.33, radius: { dist: "uniform", avg: 4.25, var: 1 }, yPosRel: {dist: "uniform", avg: 0.965, var: 0.03 }, thickness: { dist: "stronginvexp", avg: 1, var: 1 }, } }, { code: "tennantite", _comment: "Deep native tennantite deposits", triesPerChunk: 25, withOreMap: true, handbookPageCode: "item-nugget-tennantite", generator: "disc-followsurface", attributes: { inblock: { code: "rock-*", name: "rock", allowedVariants: ["andesite", "granite", "basalt", "peridotite", "claystone", "sandstone", "shale", "chalk", "chert", "conglomerate", "phyllite", "slate"] }, placeblock: { code: "ore-*-tennantite-{rock}", name: "grade", allowedVariantsByInBlock: { "rock-andesite": ["poor", "medium", "rich"], "rock-granite": ["poor", "medium", "rich"], "rock-basalt": ["poor", "medium", "bountiful"], "rock-peridotite": ["poor", "medium", "rich"], "rock-claystone": ["poor", "medium"], "rock-sandstone": ["poor", "medium"], "rock-shale": ["poor", "medium"], "rock-chalk": ["poor", "medium"], "rock-chert": ["poor", "medium"], "rock-conglomerate": ["poor", "medium"], "rock-phyllite": ["poor", "medium", "rich"], "rock-slate": ["poor", "medium", "rich"] } }, radius: { dist: "uniform", avg: 7, var: 3 }, yPosRel: {dist: "uniform", avg: 0.3, var: 0.3 }, thickness: { dist: "stronginvexp", avg: 1, var: 2 } } } ]
json
Mohammed Siraj and Kuldeep Yadav have been on the bench, carrying drinks for both of the two T20Is against Sri Lanka so far. However, both were involved in a hilarious incident during the second T20I on Saturday in Dharamsala. This incident is of the 10th over of Sri Lanka’s innings after Yuzvendra Chahal, the leg-spinner, had dismissed left-hander Charith Asalanka. Chahal delivered a flatter leg-break on length in line with the stumps. Asalanka, a newcomer at the crease, went for the sweep shot to a ball that went straight. Asalanka failed to connect with his sweep while he was down on his knee as the ball hit him on his front pad. The umpire, in this case, Jayaraman Madanagopal, was quick to raise his finger as Chahal had his first wicket of the night. Asalanka, though, referred to this decision by taking a review. To no one’s surprise, he was plumb out as the ball was projected on Hawkeye to be crashing the middle of the middle stump. Now here comes the funny part involving Siraj and Kuldeep that has got the fans in splits. As the umpire, Madanagopal, was about to raise his finger again on the direction of third umpire Anil Chaudhary, first Siraj and then Kuldeep, both running in with drinks, went behind the umpire to signal the out decision. Gets even funnier: while Mohammed Siraj did stop for a fraction of a second behind the umpire to raise his finger, Kuldeep Yadav just kept going on with his hand raised. Kuldeep, sporting a cute smile, had a small jump behind the umpire while also brushing Madanagopal on the side and hitting the umpire’s arm!! The umpire then was apparently apologising to Kuldeep after the leggie brushed his hand. You can watch this rib-tickling incident here: Fans have been left in cracking up over this amusing act from Siraj and Kuldeep. Bechara khud kuldeep ko sorry bola ? This reminded cricket followers of former India cricketer Suresh Raina, who also used to do such out signal behind the umpire. Talking about Sri Lanka, the visitors have posted a big total of 183 runs on the back of two brilliant innings: opener Pathum Nissanka anchored the innings after struggling early on, ending up with 75 off 53 balls, before skipper Dasun Shanaka provided his side with a late hitting, remaining unbeaten on 47 off just 19 balls. For India, Harshal Patel was the most expensive bowler, leaking 52 runs. All five Indian bowlers picked one wicket each.
english
After the enormous success of Bhool Bhulaiyaa 2, there has been a big leap in Kartik Aaryan’s popularity. The actor who made his debut with Pyaar Ka Punchnama in 2011 has secured his position as a leading actor with an upward trajectory. The actor recently posed for the cameras sporting a big smile, with his puppy named Katori. The actor was seen in a loose white full-sleeved tee and blue denim jeans. He accessorised with his staple ultra-thin sunglasses.
english
<gh_stars>1-10 {"elapsed":"0.477","endpoint-url":"https://www.chelmsford.gov.uk/EasySiteWeb/GatewayLink.aspx?alId=1095043","entry-date":"2020-03-09T00:05:54.907607","exception":"SSLError"}
json
#!/usr/bin/python3.5 class MyClass: "This is a class" a = 10; def func(self): print('Hello World'); return 3; def my_function(a: MyClass): return a.func(); def other_function(b: my_function): a = MyClass(); return my_function(a); def object_function(obj: object): return 3;
python
{ "type": "minecraft:smelting", "ingredient": { "item": "foodmod:raw_pepperoni_pizza" }, "result": "foodmod:pepperoni_pizza", "experience": 0.2, "cookingtime": 199 }
json
<reponame>krishna2nd/chrome-exts<gh_stars>0 // Chrome App bug: script.async = false; doesn't work. // So we have to wait until the script is done loading (function() { var loading = false; var newUrls = true; /** @const {!Array{!Array{string}}} */ var urls = []; var MODULE_LOAD_REGEX = /goog\.retrieveAndExec_\("(.*)",\s*true,\s*false\)/; function appendScript(url, opt_sourceText) { if (!url && opt_sourceText) { var match = MODULE_LOAD_REGEX.exec(opt_sourceText); if (match) { url = match[1]; } } if(newUrls) { urls.unshift([url]); newUrls = false; setTimeout(function() { newUrls = true; }, 0); if(!loading) { loading = true; (function next() { var myUrls = urls[0]; var url = myUrls[0]; var script = document.createElement('script'); script.src = url; script.async = false; script.charset = "UTF-8"; script.onload = script.onerror = function() { myUrls.shift(); while(urls.length && !urls[0].length) { urls.shift(); } if(urls.length) { next(); } else { loading = false; } }; document.head.appendChild(script); })(); } } else { urls[0].push(url); } return true; } window.CLOSURE_NO_DEPS = true; window.CLOSURE_IMPORT_SCRIPT = appendScript; window.CLOSURE_UNCOMPILED_DEFINES = { 'goog.json.USE_NATIVE_JSON': true, 'goog.NEVER_TRANSPILE': true, 'goog.defineClass.SEAL_CLASS_INSTANCES': false }; appendScript('/js/zone/zone.js'); appendScript('/js/jquery/jquery.js'); appendScript('/js/jquery/jquery.lucid.redirect.js'); appendScript('/js/xregexp/xregexp-min.js'); appendScript('/js/xregexp/xregexp-unicode-base.js'); appendScript('/js/xregexp/xregexp-unicode-categories.js'); appendScript('/js/app/config/chart.js'); appendScript('/js/i18n/i18n.js'); appendScript('/js/i18n/generated/compiled/chromechart_background/en.js'); appendScript('/js/closure/bin/chromechart_background.js'); appendScript('/js/plugins/dfd.js'); appendScript('/js/plugins/aws.js'); appendScript('/js/plugins/computation.js'); appendScript('/js/plugins/erd.js'); appendScript('/js/plugins/table.js'); appendScript('/js/plugins/gcp.js'); appendScript('/js/plugins/orgchart.js'); appendScript('/js/plugins/flowchart.js'); appendScript('/js/plugins/ios.js'); appendScript('/js/plugins/freehand.js'); appendScript('/js/plugins/ui.js'); appendScript('/js/plugins/ui2.js'); appendScript('/js/plugins/imagesearch.js'); appendScript('/js/plugins/mindmap.js'); appendScript('/js/plugins/bpmn2.js'); appendScript('/js/plugins/android.js'); appendScript('/js/plugins/rubik.js'); appendScript('/js/plugins/video.js'); appendScript('/js/plugins/floorplan.js'); appendScript('/js/plugins/aws2.js'); appendScript('/js/plugins/uml.js'); appendScript('/js/plugins/serverrack.js'); appendScript('/js/plugins/ee.js'); appendScript('/js/plugins/ios7.js'); appendScript('/js/plugins/timeline.js'); appendScript('/js/plugins/shapes.js'); appendScript('/js/plugins/default.js'); appendScript('/js/plugins/valuestream.js'); appendScript('/js/plugins/equation.js'); appendScript('/js/plugins/bpmn.js'); appendScript('/js/plugins/cisco.js'); appendScript('/js/plugins/ipad.js'); appendScript('/js/plugins/processing.js'); appendScript('/js/plugins/userimage.js'); appendScript('/js/plugins/techclipart.js'); appendScript('/js/plugins/azure.js'); appendScript('/js/plugins/orgchart2.js'); appendScript('/js/plugins/enterprise.js'); appendScript('/js/plugins/network.js'); appendScript('/js/plugins/sitemap.js'); appendScript('/js/plugins/commonshapes.js'); appendScript('/js/plugins/ui3.js'); appendScript('/js/plugins/externalshapes.js'); appendScript('/js/plugins/venn.js'); appendScript('/js/plugins/iphone.js'); appendScript('/js/chromechart/background.js'); })();
javascript
// Dependencies const { createSecureHeaders } = require('next-secure-headers') const withPWA = require('next-pwa') // Enviroment const isProd = process.env.NODE_ENV === 'production' // Exporting nextjs config module.exports = withPWA({ pwa: { dest: 'public', disable: !isProd }, // Secure headers async headers() { return [ { source: '/(.*)', headers: createSecureHeaders({ contentSecurityPolicy: { directives: { baseUri: 'self', formAction: 'self', frameAncestors: true }, }, frameGuard: 'deny', noopen: 'noopen', nosniff: 'nosniff', xssProtection: 'sanitize', forceHTTPSRedirect: [ true, { maxAge: 60 * 60 * 24 * 360, includeSubDomains: true }], referrerPolicy: 'same-origin' }) } ] } })
javascript
<reponame>juliolmuller/xom-sharepoint // console.log(require('../index')) const SP = require('../index') new SP()
javascript
use ockam::{route, Context, Result, TcpTransport}; #[ockam::node] async fn main(ctx: Context) -> Result<()> { // Initialize the TCP Transport. let tcp = TcpTransport::create(&ctx).await?; // Expect second command line argument to be the TCP address of a target TCP server. // For example: 127.0.0.1:5000 // // Create a TCP Transport Outlet - at Ockam Worker address "outlet" - // that will connect, as a TCP client, to the target TCP server. // // This Outlet will: // 1. Unwrap the payload of any Ockam Routing Message that it receives from an Inlet // and send it as raw TCP data to the target TCP server. First such message from // an Inlet is used to remember the route back the Inlet. // // 2. Wrap any raw TCP data it receives, from the target TCP server, // as payload of a new Ockam Routing Message. This Ockam Routing Message will have // its onward_route be set to the route to an Inlet, that it knows about, because of // a previous message from the Inlet. let outlet_target = std::env::args().nth(2).expect("no outlet target given"); tcp.create_outlet("outlet", outlet_target).await?; // Expect first command line argument to be the TCP address on which to start an Inlet // For example: 127.0.0.1:4001 // // Create a TCP Transport Inlet that will listen on the given TCP address as a TCP server. // // The Inlet will: // 1. Wrap any raw TCP data it receives from a TCP client as payload of a new // Ockam Routing Message. This Ockam Routing Message will have its onward_route // be set to the route to a TCP Transport Outlet. This route is provided as the 2nd // argument of the create_inlet() function. // // 2. Unwrap the payload of any Ockam Routing Message it receives back from the Outlet // and send it as raw TCP data to a connected TCP client. let inlet_address = std::env::args().nth(1).expect("no inlet address given"); tcp.create_inlet(inlet_address, route!["outlet"]).await?; // We won't call ctx.stop() here, // so this program will keep running until you interrupt it with Ctrl-C. Ok(()) }
rust
<filename>Datamodel/Metadata/Movie_review/TopicModel/HTML/531_0/rules.json {"topic_45": {"num_tags": 20, "name": "topic_45", "full_name": "topic_45", "num_included_tokens": 20}, "topic_19": {"num_tags": 3, "name": "topic_19", "full_name": "topic_19", "num_included_tokens": 3}, "topic_47": {"num_tags": 20, "name": "topic_47", "full_name": "topic_47", "num_included_tokens": 20}, "topic_40": {"num_tags": 2, "name": "topic_40", "full_name": "topic_40", "num_included_tokens": 2}, "topic_36": {"num_tags": 1, "name": "topic_36", "full_name": "topic_36", "num_included_tokens": 1}, "topic_12": {"num_tags": 16, "name": "topic_12", "full_name": "topic_12", "num_included_tokens": 16}, "topic_25": {"num_tags": 1, "name": "topic_25", "full_name": "topic_25", "num_included_tokens": 1}, "topic_17": {"num_tags": 4, "name": "topic_17", "full_name": "topic_17", "num_included_tokens": 4}, "topic_20": {"num_tags": 17, "name": "topic_20", "full_name": "topic_20", "num_included_tokens": 17}, "topic_21": {"num_tags": 1, "name": "topic_21", "full_name": "topic_21", "num_included_tokens": 1}, "topic_7": {"num_tags": 1, "name": "topic_7", "full_name": "topic_7", "num_included_tokens": 1}, "topic_4": {"num_tags": 8, "name": "topic_4", "full_name": "topic_4", "num_included_tokens": 8}, "topic_22": {"num_tags": 1, "name": "topic_22", "full_name": "topic_22", "num_included_tokens": 1}, "topic_15": {"num_tags": 1, "name": "topic_15", "full_name": "topic_15", "num_included_tokens": 1}, "topic_1": {"num_tags": 19, "name": "topic_1", "full_name": "topic_1", "num_included_tokens": 19}, "topic_48": {"num_tags": 12, "name": "topic_48", "full_name": "topic_48", "num_included_tokens": 12}}
json
<filename>README.md # Android Swipe Layout This is the brother of [AndroidViewHover](https://github.com/daimajia/AndroidViewHover). One year ago, I started to make an app named [EverMemo](https://play.google.com/store/apps/details?id=com.zhan_dui.evermemo) with my good friends. The designer gave me a design picture, the design like this: ![](http://ww1.sinaimg.cn/mw690/610dc034jw1ejoquidvvsg208i0630u4.gif) I found it was pretty hard to achieve this effect, cause you had to be very familiar with the Android Touch System. It was beyond my ability that moment, and I also noticed that there was no such a concept library... Time passed, finally...as you see right now. ## Demo ![](http://ww2.sinaimg.cn/mw690/610dc034jw1ejoplapwtqg208n0e74dx.gif) [Download Demo](https://github.com/daimajia/AndroidSwipeLayout/releases/download/v1.0.0/AndroidSwipeLayout-Demo-1.0.1-snapshot.apk) Before I made this, I actually found some libraries (eg.[SwipeListView](https://github.com/47deg/android-swipelistview)) that helps developers to integrate swiping with your UI component. But they have too much limitation, only in ListView, or some other limitations. When I start to make this library, I set some goals: - Can be easily integrated in anywhere, ListView, GridView, ViewGroup etc. - Can receive `onOpen`,`onClose`,`onUpdate` callbacks. - Can notifiy the hidden children how much they have shown. - Can be nested each other. ## Usage ### Step 1 #### Gradle ```groovy dependencies { compile "com.daimajia.swipelayout:library:1.0.3@aar" } ``` #### Maven ```xml <dependency> <groupId>com.daimajia.swipelayout</groupId> <artifactId>library</artifactId> <version>1.0.3</version> <type>apklib</type> </dependency> ``` #### Eclipse [AndroidSwipeLayout-v1.0.3.jar](https://github.com/daimajia/AndroidSwipeLayout/releases/download/v1.0.3/AndroidSwipeLayout-v1.0.3.jar) ### Step 2 [Wiki Usage](https://github.com/daimajia/AndroidSwipeLayout/wiki/usage) ## Wiki [Go to Wiki](https://github.com/daimajia/AndroidSwipeLayout/wiki) ## About me A student in mainland China. Welcome to [offer me an internship](mailto:<EMAIL>). If you have any new idea about this project, feel free to [contact me](mailto:<EMAIL>). :smiley:
markdown
Ranpur: The body of Swati, a three-year-old girl who had gone missing since December 11, was recovered from a pond at Badhipatna village under Sarankul block in Nayagarh district Tuesday. Some local residents spotted the body of the minor girl. They immediately informed the victim’s family members and the police. Police immediately reached the spot and recovered the body and sent it for post-mortem. The minor’s body had grievous injury marks around the eyes. Locals alleged that the miscreants who killed her had tried to gouge out her eyes. Meanwhile, the victim’s father Sanjay alleged that local residents are behind the death of his daughter. He said that his daughter had never gone out of the village. The police are also tight-lipped about the incident. They have said that only the post-mortem report will provide them some leads in solving the case. Swati was last seen at about 2. 00pm Friday while playing near her house. Thereafter, she went missing. Family members lodged a complaint with the police at the Rajsunakhala outpost after failing to locate her. The gruesome deaths of Pari and Swati have shocked people across Nayagarh district. They are so panic-stricken that they are not allowing their children to go out and play.
english
import React, { useState } from 'react'; import { addParameters } from '@storybook/react'; import { Button, Text } from 'rebass'; import Modal from '../components/Modal'; import { AnimatePresence } from 'framer-motion'; import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport'; import { Input } from '@rebass/forms'; addParameters({ viewport: { viewports: INITIAL_VIEWPORTS, }, }); export default { title: 'Modal', component: Modal, }; export const Base = () => { const [isOpen, setIsOpen] = useState(false); return ( <> <Button variant="primary" marginX="auto" m={5} onClick={() => setIsOpen(true)}> Open me </Button> <AnimatePresence> {isOpen && ( <Modal close={() => setIsOpen(false)}> <Text variant="heading" textAlign="center"> Failure </Text> <Text variant="base" textAlign="center" marginTop={4}> Failure to connect to Ethereum blockchain </Text> <Input id="token" name="token" type="text" placeholder="<KEY>" /> </Modal> )} </AnimatePresence> </> ); };
typescript
Wayne Dyer has researched hundreds of translations of the Tao Te Ching to write 81 essays on how to apply the age-old wisdom of Lao Tzu in the modern world. Wayne devoted an entire year of his life to reading, researching and meditating on the teachings of Lao Tzu, putting them into practice every day, finally writing these essays to present Lao Tzu's messages to you as himself. wanted to introduce them to you. This recording deserves to be listened to slowly, one verse a day. Each verse is accompanied by an essay, which will help you understand and live the Tao and the way daily. As Wayne says: Practicing the wisdom of Tao will forever change the way you look at your own life. You will then live in a new world, in tune with nature. Wayne Dyer spent an entire year of his life reading, researching and meditating on the teachings of Lao Tzu, putting them into practice every day, ultimately writing these essays to bring Lao Tzu's messages to you. Lao Tzu's Tao Te Ching is one of the most profound books in the history of philosophy and spirituality.
english
from colorama import Style, Fore import gamepiece header = ' 0 1 2 3 4 5 6 7' footer = ' +---+---+---+---+---+---+---+---+' def construct_board(): print("\n" * 100) print Fore.CYAN + "______ _ _ _ _____ _ _" print "| ___ \ (_) | / __ \ | | | " print "| |_/ / |_| |_ ___| / \/ |__ ___ ___| | _____ _ __ ___ " print "| ___ \ | | __|_ / | | '_ \ / _ \/ __| |/ / _ \ '__/ __|" print "| |_/ / | | |_ / /| \__/\ | | | __/ (__| < __/ | \__ \\" print "\____/|_|_|\__/___|\____/_| |_|\___|\___|_|\_\___|_| |___/" + Fore.RESET print print print header print footer for y in range(0, 8): to_print = chr(y + 97).upper() + ' ' for x in range(0, 9): piece = gamepiece.get_piece(str(x) + str(y)) if piece: to_print += '| ' + piece.get_team() + 'O' + Style.RESET_ALL + ' ' else: to_print += '| ' print to_print print footer def init_board(): gamepiece.init_pieces() construct_board() def update_board(): construct_board()
python
During his Oxford days, Murtaza Bhutto earned a reputation for being something of a playboy. He was a regular feature on London's cocktail circuit, always with a pretty girl in tow. Today, he has exchanged his Saville Row suits for battle-dress and the pretty girls for a Kalashnikov. Q. What was Al Zulfikar's involvement in the PIA hijacking? A. Some members of Al Zulfikar on their own initiative hijacked a Pakistani airliner on March 2. I did not take part in the planning. It was an individual act by Commando Al Zulfikar, Karachi division, and two other co-workers. We consider the final result as a victory for the people of Pakistan. Fifty four people who had been tortured in Zia's torture chambers were released because of it. The pity is that they did not accept our demands earlier; because of the delay one person was killed. The greatest irony was that Zia accepted the demands only because the hijackers had threatened to kill three Americans on board. He was not concerned about the lives of his own countrymen. Q. What is the strength of your organisation ? A. We have several thousand people trained inside Pakistan. Almost all of them are armed. In all the four provinces. Not a single one has been discovered by Zia's Gestapo. We have our bases inside Pakistan, we have people working in the Pakistan army, the police force and in the foreign service. Q. Why don't you launch new attacks then? A. It is a matter of tactics. We are basing our policies on an ad hoc basis. If Zia goes ahead and does something, tortures our people, we conduct an operation. We warned Zia that if my mother (Nusrat Bhutto) and sister (Benazir Bhutto) continue to be humiliated and kept in jail, we will conduct our operations on a very large scale. Then we will have to teach Zia a lesson he will not forget. Right now we don't want to because we don't want bloodshed. We are hoping that the political process will take its own path. We are hoping that the developments will follow peaceful patterns. It is Zia and his band of armymen who have decided to impose their will by force on the people of Pakistan. That is terrorism. Q. Does your organisation plan any more hijackings? A. I am opposed to hijacking. Q. What about allegations in the Pakistan press that your mother and sister knew about the hijacking or that they were involved in its planning? A. It is absolutely false. We do not keep them informed about our activities for their own safety. They disapprove our actions. They are against any acts of violence. Q. In Pakistan nowadays you can hear even from the members of the Pakistan People's Party (PPP) that they did not approve of the hijacking and that they think this action has destroyed some of their very limited possibilities to organise mass demonstrations against the Zia regime. A. That's an excuse. The largest demonstrations took place after the hijacking for three days. The demonstrations collapsed when Zia cracked down and arrested people. I think the overwhelming majority of the Pakistan people welcome the path we have taken, because they feel there is no other way. Q. Even two years after your father's execution there hasn't been any real uprising in Pakistan against Zia-ul-Haq. How do you explain this ? A. The tyranny that Zia has unleashed in Pakistan is unprecedented in our history. You react to something which you know. What Zia is doing in Pakistan is unfamiliar to the people in our area. They do not know how to react to it, they still probably live in shock. Zia has tortured to death their undisputed leader. He has sent women to torture cells. No one has been spared. It will take some time for the people to absorb this shock, to become immune to this form of brutalisation. The explosion will come, and then no one will be able to stop it. Q. What kind of democracy are you aiming at ? A. For the moment we are forced to take armed action to restore freedom. We want democracy with established political parties and elections. The best process we know it may have its faults - but it is democracy. We want non-alignment in foreign policy, absolutely avoiding all military pacts. Q. There are rumours and hints about your contacts with some left-wing Muslim states. You hare been in Libya and Syria. On the walls of this room are hanging the portraits of Gaddafi, Assad and Arafat. A. There are many countries which support the struggle of the people of Pakistan. We have friends all over the world, some of them are Arabs. I have been to Libya and Syria. I have also visited England and the United States. Q. Among the younger members of the the People's Party is there a growing sympathy for the Soviets ? A. This is correct. There is greater sympathy for the Soviet Union, there is sympathy for the Afghan Democratic Republic. If for no other reason, they see these two countries have taken up a principled line. They are not going in for expediency. It's purely for this reason that there is great respect for Indira Gandhi who has taken up the matter of the people of Pakistan. Q. Are you not running the risk of being used as a tool by countries that would like to destabilise Pakistan ? A. We are not going to split Pakistan, we are going to preserve its unity. If Zia's dictatorship continues in this manner, maybe Pakistan cannot survive in its present form. We are not playing into the hands of any country that would want to destabilise Pakistan. Q. What kind of actions is Al Zulfikar planning in Pakistan ? A. We have certain targets we consider legitimate. We are not going to bomb innocent people. Q. Has Al Zulfikar contacts with other militant organisations ? A. We have no contacts with terrorist organisations. The plo are our friends, they are freedom fighters. We have nothing to do with the Baader-Meinhof, gang, the Red Brigade or the ira.
english
<reponame>KnowingNothing/akg-test #!/usr/bin/env python3 # coding: utf-8 # Copyright 2019 Huawei Technologies 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. """operator dsl function: rec_positive""" import akg.topi import akg from akg.utils import kernel_exec as utils from akg.utils import validation_check as vc_util @vc_util.check_input_type(akg.tvm.tensor.Tensor) def rec_positive(x): """ Calculate 1/x when data in x are all positive, used by dsl tanh and focalloss_grad. Args: x (tvm.tensor.Tensor): Tensor of type float16, float32. data in x must be positive. Returns: tvm.tensor.Tensor, the same type as inputs. """ vc_util.ops_dtype_check(x.dtype, vc_util.DtypeForDavinci.ALL_FLOAT) need_conv = utils.product_is_mini() and x.dtype == "float32" x_fp16 = x if need_conv: x_fp16 = x.astype("float16") log = akg.topi.log(x_fp16) neg_log = akg.topi.negative(log) res = akg.lang.cce.vexp(neg_log) return res.astype(x.dtype) if need_conv else res
python
New Delhi: In a boost to cash-starved real estate industry, government today relaxed rules for FDI in the construction sector by reducing minimum built-up area as well as capital requirement and easing the exit norms. The proposal to amend the FDI policy in construction development sector was approved by the Union Cabinet. In view of depleting FDI inflow in construction and real estate sector in last couple of years, the Cabinet decided to reduce the minimum floor area to 20,000 sq mt from the earlier 50,000 sq mt. It also brought down the minimum capital requirement to $5 million from $10 million. In case of development of serviced plots, the condition of minimum land of 10 hectares has been completely removed, an official statement said. Although 100 per cent foreign direct investment was allowed in townships, housing and built-up infrastructure and construction developments since 2005, the government had imposed certain conditions. "These measures are expected to result in enhanced inflows into the construction development sector. . . It is likely to attract investments in new areas and encourage development of plots for serviced housing given the shortage of land in and around urban agglomerations as well as the high cost of land. "The measure is also expected to result in creation of much needed low cost affordable housing in the country and development of smart cities," the statement said. Although the Cabinet has not reduced the 3-year lock-in period, it has permitted foreign investors to exit on project completion or 3 years from the date of final investment subject to the development of trunk infrastructure. The government said the relaxation was necessary as FDI inflows in the sector, which witnessed a steady rise during 2006-07 and 2009-10, have started declining. "To step up investment in construction development with its backward and forward linkages for many other sectors of the economy, it is felt that some liberalisation and rationalisation of the FDI policy. . . could be the necessary catalyst to give a boost to the sector," it added. Between April 2000 and August 2014, the construction sector received FDI worth $23. 75 billion or 10 per cent of the total FDI attracted by India during the period. Realtors apex body CREDAI president C Shekar Reddy said it would help developers get an alternative route of funding for their projects.
english
Disha Patani has been on a roll of late. After delivering a box-office hit along with Tiger Shroff in Baaghi 2, the actor signed on for Salman Khan’s next mega project Bharat. And now, a report in a leading daily claims that she is all set to play the lead opposite Salman Khan in the sequel to his 2014 blockbuster Kick. The report claims that the actress has been spotted visiting producer Sajid Nadiadwala’s office a few times recently and rumour has it that she is in talks with him for signing on as the female lead for Kick 2. Although we haven’t heard any confirmation from the concerned parties, we sure are excited at the idea of this fresh pairing. Meanwhile, we have also heard that Disha will be part of Tiger Shroff’s Baaghi 3. Well, for those of you wondering how can she be in the film since she died, according to the grapevine the film will have a fresh script with the same pair.
english
Rai said Kejriwal had met with AAP MLAs and councillors seeking their opinion on the issue and there was consensus that he should not resign and run the government from jail. He said from December 21 to December 24, the AAP will hold 'Jan Samvad' in every ward of the city to discuss the alleged liquor scam with people as well as "the BJP's conspiracy to get Kejriwal arrested and seek their opinion if he should resign as Delhi chief minister if arrested, Rai added. Addressing farmers during the closing ceremony of the Haryana Agricultural Development Fair at the HAU varsity here, Khattar said Haryana remains committed to the welfare of farmers. He also praised the farmers for their exceptional contributions, not only in the realm of agriculture but also across various fields. Chief Minister Ashok Gehlot of Rajasthan will embark on a nine-day visit to 18 districts as part of the 'Mission-2030' campaign. The campaign aims to gather suggestions from the public to make Rajasthan a model state by 2030. Gehlot will hold public meetings, interact with various groups, and visit temples during his visit. The campaign is significant as it precedes the upcoming Rajasthan assembly polls. To a query on the ongoing Maratha reservation issue, Maharashtra Congress president Nana Patole said, "Caste-based census is the only option for a permanent solution to provide reservation and give justice for all sections of the society. The previous government led by prime minister Manmohan Singh government had worked on this aspect and a census was carried out in 2011. The Maharashtra Congress has launched its 'Jan Samvad Yatra' to address issues such as unemployment and inflation and highlight the alleged misdeeds of the government. However, the yatra was temporarily suspended in Marathwada after tension arose due to a police lathi-charge on Maratha quota agitators. The yatra aims to reach out to people and galvanize the party's cadre. Nana Patole accused the government of ordering the police to lathi-charge protestors seeking Maratha reservation in Jalna to divert attention from the INDIA alliance meeting. Patole claimed that women and children were also injured in the incident. The two-day meeting of the INDIA alliance was held in Mumbai and attended by representatives from 28 opposition parties. Haryana Chief Minister Manohar Lal Khattar Saturday increased the annual income limit under the Ayushman Bharat Yojana from Rs 1.8 lakh to Rs 3 lakh, a move to raise the number of state beneficiaries under the scheme. Khattar made this announcement during the 'Jan Samvad programme' at Bakana village in the Yamunanagar district, said an official release. Haryana Chief Minister Manohar Lal Khattar said the problem of contaminated water coming towards Dharuhera from the neighbouring state of Rajasthan's Bhiwadi area will be resolved soon in a meeting with top officials of concerned departments from both states. The National Green Tribunal has imposed a fine of INR 45 crore on Rajasthan for releasing polluted water from Bhiwadi towards Dharuhera; however, Rajasthan has approached the court and got a stay on the matter. The Haryana state government is considering a pension scheme for unmarried individuals in the 45-60 age group, according to Chief Minister Manohar Lal Khattar. A decision on the scheme will be made within a month. Khattar made the announcement during a 'Jan Samvad' event in Karnal, where he also planted saplings, announced the construction of a Sanskriti Model School, and directed officials to construct a new building for a government school and a road in Kalampura. Khandu said that hydropower energy generation multiplied manifold, built and upgraded hundreds of new schools, hospitals and airports, given a large fillip to agriculture and allied sectors, promoted eco-tourism and sustainable tourism opportunities, besides maintaining a record recovery rate of over 99% during the unprecedented COVID-19 pandemic. "Today, we should discuss electricity. We will discuss other issues as well. I will visit Gujarat every week and hold 'jan samvad' (public dialogue) on the issues of corruption, agriculture, MSP (minimum support price)," he said. Bihar Chief Minister Nitish Kumar had reached Kalyan Vigha village on Saturday on the occasion of the 16th death anniversary of his wife Late Manju Sinha. During his visit, the Chief Minister interacted with the local people and listened to their problems during the Jan Samvad program organized at Kalyan Vigha Middle School. Participating in the "Aatmanirbhar Narishakti se Samvad" (dialogue with self-reliant women), the prime minister interacted with the women self-help groups (SHGs) promoted under the Deendayal Antyodaya Yojana-National Rural Livelihoods Mission (DAY-NRLM) via video-conferencing. On June 7, Union home minister Amit Shah did the first Bihar Samvad virtual rally, which was followed by a series of such rallies across the country to highlight the achievements of one year of the Narendra Modi government. In Bihar, the BJP leadership is doing 3-4 such rallies every day and trying to cover all the 243 assembly constituencies. BJP’s Rajya Sabha MP Jyotiraditya Scindia addressed the first two rallies, asking people to choose between the partnership between himself and CM Shivraj Singh Chouhan, or that of Kamal Nath and Digvijaya Singh, terming the latter as Kauravas. According to the Union Ministry of Health and Family Welfare, India witnessed its highest-ever spike of 11,929 new cases in the last 24 hours, the total number of coronavirus cases in the country rose to 3,20,922.With 311 deaths reported in the last 24 hours, the Covid-19 death toll has now reached 9,195. "As BJP workers, we have been stressing that whether it is Article 370, 35-A, building of Ram temple, CAA, these were never issues of politics or votes for us nor are they today," Union Minister Narendra Singh Tomar said at the 'Haryana Jan Samvad' rally. Addressing the Jan Samvad virtual rally for BJP supporters of West Bengal, Shah said ‘Sonar Bangla’ has now been reduced to a state where there is appeasement politics, communal riots, deterioration of law and order, rampant corruption and where the poor are deprived of the benefits of welfare schemes. Union minister Smriti Irani will address BJP's first virtual rally in the national capital on June 13, highlighting the achievements of the Modi government in the last one year, party's Delhi unit chief Adesh Gupta said on Tuesday. After the national executive meet at Patna on Saturday, the party had asked Yadav to refuse the invitation for the August 27 rally as his participation would constitute a serious violation of party principles.
english
The Abu Dhabi Grand Prix brought the 2021 F1 season to a dramatic end. It has been reported that the FIA has set a deadline to conclude the investigation into the controversial events of the race. According to a BBC report, seven-time champion Lewis Hamilton will make a decision about his future in the sport only after the final investigation into the final laps of the season finale is completed. With enough time until the first winter test in Barcelona, the FIA will announce the findings from the investigation on February 3. F1 Sky Sports reporter Craig Slater revealed: “I can report that three weeks is how long the FIA have set themselves to deal with this matter. Work only began in earnest on it on Monday [January 10], that’s to say this FIA commission started to interview those involved. " He added: Max Verstappen clinched the world championship from race leader Hamilton on the very last lap of the race, right after the VSC that came out after Nicolas Latifi found himself in the wall. Chaotic decisions by F1 race director Michael Masi, who allowed a last racing lap to go ahead, eventually resulted in a scenario where Verstappen was able to overtake the Briton after having followed him all evening. Mercedes protested the decision post-race, but this was not upheld by the FIA. While Mercedes did protest the decisions made by the FIA regarding the last lap of the Abu Dhabi Grand Prix, team principal Toto Wolff did not blame Verstappen or Red Bull for how things unfolded that evening. As reported by formula1. com Wolff, said: "I would have been totally okay with Max and Red Bull winning the championship on Sunday. And this situation is nothing to do with Max. He is a worthy champion, his driving is exceptional and Red Bull are fierce competitors, and I have the greatest respect [for] the people working there. "
english
Rio de Janeiro, June 3: Manchester City forward Gabriel Jesus has been training with his former football club Palmeiras as he prepares for Brazil's intertiol friendlies against Argenti and Australia. The 20-year-old has surprised his former teammates by using the Brazilian Serie A club's gymsium to keep in shape, despite being on vacation, reports Xinhua news agency. Jesus even stopped to sign autographs for fans outside Palmeiras' Sao Paulo headquarters on Friday. "Even though he's on a break, he's training and that shows his level of discipline," Palmeiras coach Cuca told reporters. The Brazil tiol team No. 9 has been an instant success at Manchester City since joining the English Premier League outfit in January.
english
import { B, D, g, i } from './LoadScene' import AudioManager from './audio' export class Container extends Phaser.GameObjects.Container { constructor(scene: Phaser.Scene, x, y, children?) { super(scene, x, y, children) scene.add.existing(this) } set hitArea(rect: Phaser.GameObjects.Rectangle) { this.setInteractive(rect, Phaser.Geom.Rectangle.Contains) } addChild(gameObject: Phaser.GameObjects.GameObject) { super.add(gameObject) } } class Sprite extends Phaser.GameObjects.Sprite { constructor(scene, x, y, texture, frame?) { super(scene, x, y, texture, frame) this.setOrigin(0) scene.add.existing(this) } } class Texture extends Phaser.Textures.Texture { constructor(manager, key, source) { super(manager, key, source) } get baseTexture() { return this.source[0] } } class StartBtn extends Container { constructor(scene: Phaser.Scene, x = 0, y = 0) { super(scene, x, y); const frameKey = 'titleStartText.gif'; const textureKey = 'game_ui'; const texture = scene.textures.get(textureKey); const frame = texture.frames[frameKey]; const {cutX, cutY, height, width} = frame; var t = this; (this.hitArea = new Phaser.GameObjects.Rectangle(scene,0,50,i.GAME_WIDTH,i.GAME_HEIGHT - 170)); var o = new Texture(scene.textures, frameKey, (texture.source[0] as any).source); o.add('__BASE', 0, cutX, cutY, width, height); return o.baseTexture.scaleMode = Phaser.ScaleModes.NEAREST, t.img = new Sprite(scene, 0, 0, o), t.img.x = i.GAME_CENTER, t.img.y = 330, t.img.setOrigin(.5), t.flashCover = new Phaser.GameObjects.Graphics(scene), t.flashCover.fillStyle(16777215, 1), t.flashCover.fillRect(0, 0, i.GAME_WIDTH, i.GAME_HEIGHT - 120), t.flashCover.alpha = 0, // t.interactive = !0, // t.buttonMode = !0, t } onOver() { this.img.scaleX = 1.05, this.img.scaleY = 1.05 } onOut() { this.img.scaleX = 1, this.img.scaleY = 1 } onDown() {} onUp() { TweenMax.killTweensOf(this.flashCover), AudioManager.play("se_decision"), this.onFlash() } onFlash() { this.flashCover.alpha = .3, TweenMax.to(this.flashCover, 1.5, { alpha: 0 }) } addedToScene() { this.tl = new TimelineMax({ repeat: -1, yoyo: !0 }); this.scene.time.addEvent({ callback: () => { this.tl.to(this.img, .3, { delay: .1, alpha: 0 }).to(this.img, .8, { alpha: 1 }) } }) this.on("pointerover", this.onOver.bind(this)), this.on("pointerout", this.onOut.bind(this)), this.on("pointerdown", this.onDown.bind(this)), this.scene.input.on("pointerupoutside", this.onOut.bind(this)), this.on("pointerup", this.onUp.bind(this)) } } export class Scene extends Phaser.Scene { constructor(sceneKey) { super(sceneKey) } init() { this.events.once('shutdown', this.sceneRemoved, this) } nextScene() { this.scene.stop() } sceneRemoved() { // // Loop from the end let i = this.children.length - 1 while (i >= 0) { // Get child let child = this.children.list[i] // Check for image or sprite if (child.type === 'Image' || child.type === 'Sprite') { // Remove child child.destroy() // Remove all its tweens this.tweens.killTweensOf(child) } // Decrement i-- } } } export default class TitleScene extends Scene { // variables private belt: Phaser.GameObjects.Graphics private bg: Phaser.GameObjects.TileSprite private logo: Phaser.GameObjects.Sprite private startBtn: Container private subTitle: Phaser.GameObjects.Sprite private titleG: Phaser.GameObjects.Sprite private titleGWrap: Phaser.GameObjects.Container private copyright: Phaser.GameObjects.Text constructor() { super('title-scene') } create() { this.bg = this.add.tileSprite(0, 0, i.GAME_WIDTH, i.GAME_HEIGHT, 'title_bg').setOrigin(0) const scaleY = i.GAME_HEIGHT / this.bg.displayTexture.source[0].height this.bg.setTileScale(1, scaleY), this.titleGWrap = this.add.container(), this.titleG = this.add.sprite(0, 0, 'game_ui', 'titleG.gif').setOrigin(0), this.titleGWrap.add(this.titleG), this.titleGWrap.x = i.GAME_WIDTH, this.titleGWrap.y = 100, this.logo = this.add.sprite(0, 0, 'game_ui', 'logo.gif'), this.logo.x = this.logo.width / 2, this.logo.setScale(2), this.logo.y = -this.logo.height / 2; var t = "subTitle" + ("ja" == i.LANG ? "" : "En") + ".gif"; this.subTitle = this.add.sprite(0, 0, 'game_ui', t), this.subTitle.x = this.subTitle.width / 2, this.subTitle.setScale(3), this.subTitle.y = -this.logo.height / 2, this.belt = this.add.graphics(), this.belt.fillStyle(0, 1), this.belt.fillRect(0, 0, i.GAME_WIDTH, 120), this.belt.y = i.GAME_HEIGHT - 120; this.startBtn = new StartBtn(this), this.startBtn.on("pointerup", this.titleStart.bind(this)), // this.startBtn.interactive = !1, // this.startBtn.alpha = 0, this.copyright = this.add.text(0, 0, '© CodeMonkey.Games 2021', { fontFamily: 'Press Start 2P', fontSize: '34px', strokeThickness: 0.15 }).setOrigin(0, 1), this.copyright.x = 32, this.copyright.y = i.GAME_HEIGHT - this.copyright.height - 6, this.scoreTitleTxt = this.add.sprite(0, 0, 'game_ui', "hiScoreTxt.gif").setOrigin(0), this.scoreTitleTxt.x = 32, this.scoreTitleTxt.y = this.copyright.y - 66; this.fadeOutBlack = this.add.graphics(), this.fadeOutBlack.fillStyle(0), this.fadeOutBlack.fillRect(0, 0, i.GAME_WIDTH, i.GAME_HEIGHT), this.fadeOutBlack.alpha = 0; var e = new TimelineMax({ onComplete: function() {}, onCompleteScope: this }); e.to(this.titleGWrap, 2, { x: i.GAME_WIDTH / 2 - this.titleG.width / 2 + 5, y: 20, ease: Quint.easeOut }, "+=0.0"), e.addCallback(function() {}, "-=0.1", null, this), e.to(this.logo, .9, { y: 75, ease: Quint.easeIn }, "-=0.8"), e.to(this.logo, .9, { scaleX: 1, scaleY: 1, ease: Quint.easeIn }, "-=0.9"), e.to(this.subTitle, .9, { y: 130, ease: Quint.easeIn }, "-=0.82"), e.to(this.subTitle, .9, { scaleX: 1, scaleY: 1, ease: Quint.easeIn }, "-=0.9") } update() { this.bg.tilePositionX += .5 } private sceneRemoved() { // F.dlog("TitleScene.sceneRemoved() Start."), // fn(dn(e.prototype), "sceneRemoved", this).call(this), super.sceneRemoved(); D.caDamage = B.resource.recipe.data.playerData.caDamage, D.playerMaxHp = B.resource.recipe.data.playerData.maxHp, D.playerHp = D.playerMaxHp, D.shootMode = B.resource.recipe.data.playerData.defaultShootName, D.shootSpeed = B.resource.recipe.data.playerData.defaultShootSpeed, D.combo = 0, D.maxCombo = 0, D.score = 0, D.cagage = 0, D.stageId = 0, D.continueCnt = 0, D.akebonoCnt = 0, D.shortFlg = !1; //, // B.Scene = new hn, // B.Manager.game.stage.addChild(B.Scene), this.scene.start('adv-scene'); // F.dlog("TitleScene.sceneRemoved() End.") } private titleStart() { this.startBtn.off("pointerup", this.titleStart.bind(this))//, this.startBtn.interactive = !1, this.startBtn.buttonMode = !1, TweenMax.to(this.fadeOutBlack, 1, { alpha: 1, onComplete: this.nextScene, onCompleteScope: this }) } }
typescript
'SSB can play key role to curb trans-border wildlife crimes' As many as 40 SSB officers and personnel participated in the workshop and significantly requested for a two-day long workshop with practical sessions. GUWAHATI: Personnel of Sashastra Seema Bal (SSB) entrusted to guard India's border with Bhutan were sensitized and enlightened on Friday on the key roles they are expected to play in curbing trans-border wildlife crimes that are thriving across nations on the globe. Wildlife Crime Control Bureau (WCCB) and Aaranyak (www. aaranyak. org) successfully conducted workshop on prevention of wildlife crime and intelligence gathering with 23rd Battalion of SSB at Lalpool, Udalguri district on Friday. The programme was a part of theongoing series of programmes organised to raise awareness level among the SSB personnel in Assam and Arunachal Pradesh about the need to curb wildlife crimes in the region. The initiative undertaken by the Aaranyak, a top-notch biodiversity conservation and research organization based in Guwahati and WCCB also aims to sensitize the SSB personnel entrusted with guarding the countries frontier. Internationally reputed rhino-conservation experts and the CEO of Aaranyak, Dr Bibhab Kumar Taklukdar started the workshop by making a detail fact-studded presentation on wildlife crime scenario across the globe. He specifically discussed how SSB personnel can help prevent wildlife crimes by reducing trans-border crimes, entry and exit of illegal wildlife products in and out of India. He also stressed on preventing smuggling and other illegal activities across border, which pose threat to national security. SSB's Assistant Commandant, Rajat Pandey inaugurated the programme by welcoming participants and explaining the purpose of the workshop. Assistant Director of WCCB, J. Baro also highlighted how SSB has an important role in prevention of wildlife crimes and trade in wildlife parts. He called for strengthening intelligence gathering apparatus, patrolling and raising awareness level among personnel on wildlife crime scenario and relevant law provisions in vogue to deal with such crimes. He also discussed about various cases WCCB were involved in and the details of seizures of different wildlife products. Intelligence assistant of the WCCB, Hiten Bora spoke about intelligence gathering, steps for detaining offenders, about informants and informers as well as about decoy dealing. The session also had practical session on identifying various wildlife products first hand. Deputy Commandant of the SSB Anil Kumar Pal concluded the workshop by thanking all the participants. He also distributed the certificates along with Dr Bibhab Kumar Talukdar. As many as 40 SSB officers and personnel participated in the workshop provided positive feedback and significantly requested for a two-day long workshop with practical sessions.
english
/* ********************************************************************* */ /* Load and combine data that is split into archives */ /* ********************************************************************* */ var Combine = { _targets: [], _targetIndex: 0, // target: build target // name: intended filepath of built object // size: expected size of built object. // data: combined data // downloaded: total amount of data downloaded // pieces: array of name, offset and data objects // numExpectedFiles: total number of files expected in description // lastRequestedPiece: index of last data file requested (strictly ascending) // totalLoadedPieces: counts the number of data files received //MAX_CONCURRENT_XHR: 6, // remove comment if throttling of XHR is desired. isCompleted: false, // status of process _onCombineCompleted: [], // signature: name, data. _onAllTargetsBuilt:[], // signature: void _onDownloadProgress: [], // signature: downloaded, total _totalDownloadBytes: 0, _archiveLocation: "split", addProgressListener: function(callback) { if (typeof callback !== 'function') { throw "Invalid callback registration"; } this._onDownloadProgress.push(callback); }, addCombineCompletedListener: function(callback) { if (typeof callback !== 'function') { throw "Invalid callback registration"; } this._onCombineCompleted.push(callback); }, addAllTargetsBuiltListener: function(callback) { if (typeof callback !== 'function') { throw "Invalid callback registration"; } this._onAllTargetsBuilt.push(callback); }, // descriptUrl: location of text file describing files to be preloaded process: function(descriptUrl) { var xhr = new XMLHttpRequest(); xhr.open('GET', descriptUrl); xhr.responseType = 'text'; xhr.onload = function(evt) { Combine.onReceiveDescription(xhr); }; xhr.send(null); }, cleanUp: function() { this._targets = []; this._targetIndex = 0; this.isCompleted = false; this._onCombineCompleted = []; this._onAllTargetsBuilt = []; this._onDownloadProgress = []; this._totalDownloadBytes = 0; }, onReceiveDescription: function(xhr) { var json = JSON.parse(xhr.responseText); this._targets = json.content; this._totalDownloadBytes = 0; var targets = this._targets; for(var i=0; i<targets.length; ++i) { this._totalDownloadBytes += targets[i].size; } this.requestContent(); }, requestContent: function() { var target = this._targets[this._targetIndex]; if (1 < target.pieces.length) { target.data = new Uint8Array(target.size); } var limit = target.pieces.length; if (typeof this.MAX_CONCURRENT_XHR !== 'undefined') { limit = Math.min(limit, this.MAX_CONCURRENT_XHR); } for (var i=0; i<limit; ++i) { this.requestPiece(target, i); } }, requestPiece: function(target, index) { if (index < target.lastRequestedPiece) { throw "Request out of order"; } target.lastRequestedPiece = index; target.progress = {}; var item = target.pieces[index]; var xhr = new XMLHttpRequest(); xhr.open('GET', this._archiveLocation + '/' + item.name, true); xhr.responseType = 'arraybuffer'; xhr.onprogress = function(evt) { if (evt.total && evt.lengthComputable) { target.progress[item.name] = {}; target.progress[item.name].total = evt.total; } if (evt.loaded && evt.lengthComputable) { target.progress[item.name].downloaded = evt.loaded; Combine.updateProgress(target); } }; xhr.onload = function(evt) { item.data = new Uint8Array(xhr.response); item.dataLength = item.data.length; Combine.copyData(target, item); Combine.onPieceLoaded(target, item); item.data = undefined; }; xhr.send(null); }, updateProgress: function(target) { var total_downloaded = 0; for (var p in target.progress) { total_downloaded += target.progress[p].downloaded; } for(i = 0; i<this._onDownloadProgress.length; ++i) { this._onDownloadProgress[i](total_downloaded, this._totalDownloadBytes); } }, copyData: function(target, item) { if (1 == target.pieces.length) { target.data = item.data; } else { var start = item.offset; var end = start + item.data.length; if (0 > start) { throw "Buffer underflow"; } if (end > target.data.length) { throw "Buffer overflow"; } target.data.set(item.data, item.offset); } }, onPieceLoaded: function(target, item) { if (typeof target.totalLoadedPieces === 'undefined') { target.totalLoadedPieces = 0; } ++target.totalLoadedPieces; if (target.totalLoadedPieces == target.pieces.length) { this.finalizeTarget(target); ++this._targetIndex; for (var i=0; i<this._onCombineCompleted.length; ++i) { this._onCombineCompleted[i](target.name, target.data); } if (this._targetIndex < this._targets.length) { this.requestContent(); } else { this.isCompleted = true; for (i=0; i<this._onAllTargetsBuilt.length; ++i) { this._onAllTargetsBuilt[i](); } } } else { var next = target.lastRequestedPiece + 1; if (next < target.pieces.length) { this.requestPiece(target, next); } } }, finalizeTarget: function(target) { var actualSize = 0; for (var i=0;i<target.pieces.length; ++i) { actualSize += target.pieces[i].dataLength; } if (actualSize != target.size) { throw "Unexpected data size"; } if (1 < target.pieces.length) { var output = target.data; var pieces = target.pieces; for (i=0; i<pieces.length; ++i) { var item = pieces[i]; // Bounds check var start = item.offset; var end = start + item.dataLength; if (0 < i) { var previous = pieces[i - 1]; if (previous.offset + previous.dataLength > start) { throw "Segment underflow"; } } if (pieces.length - 2 > i) { var next = pieces[i + 1]; if (end > next.offset) { throw "Segment overflow"; } } } } } }; /* ********************************************************************* */ /* Default splash and progress visualisation */ /* ********************************************************************* */ var Progress = { progress_id: "defold-progress", bar_id: "defold-progress-bar", addProgress : function (canvas) { /* Insert default progress bar below canvas */ canvas.insertAdjacentHTML('afterend', '<div id="' + Progress.progress_id + '" class="canvas-app-progress"><div id="' + Progress.bar_id + '" class="canvas-app-progress-bar" style="width: 0%;">0%</div></div>'); Progress.bar = document.getElementById(Progress.bar_id); Progress.progress = document.getElementById(Progress.progress_id); }, updateProgress: function (percentage, text) { Progress.bar.style.width = percentage + "%"; text = (typeof text === 'undefined') ? Math.round(percentage) + "%" : text; Progress.bar.innerText = text; }, removeProgress: function () { Progress.progress.remove(); } }; /* ********************************************************************* */ /* Default input override */ /* ********************************************************************* */ var CanvasInput = { arrowKeysHandler : function(e) { switch(e.keyCode) { case 37: case 38: case 39: case 40: // Arrow keys case 32: e.preventDefault(); e.stopPropagation(); // Space default: break; // do not block other keys } }, onFocusIn : function(e) { window.addEventListener("keydown", CanvasInput.arrowKeysHandler, false); }, onFocusOut: function(e) { window.removeEventListener("keydown", CanvasInput.arrowKeysHandler, false); }, addToCanvas : function(canvas) { canvas.addEventListener("focus", CanvasInput.onFocusIn, false); canvas.addEventListener("blur", CanvasInput.onFocusOut, false); canvas.focus(); CanvasInput.onFocusIn(); } }; /* ********************************************************************* */ /* Module is Emscripten namespace */ /* ********************************************************************* */ var Module = { noInitialRun: true, _filesToPreload: [], _archiveLoaded: false, print: function(text) { console.log(text); }, printErr: function(text) { console.error(text); }, setStatus: function(text) { console.log(text); }, runApp: function(app_canvas_name, splash_image, archive_location) { app_canvas_name = (typeof app_canvas_name === 'undefined') ? 'canvas' : app_canvas_name; splash_image = (typeof splash_image === 'undefined') ? 'splash_image.png' : splash_image; archive_location = (typeof archive_location === 'undefined') ? 'split' : archive_location; Module.canvas = document.getElementById(app_canvas_name); Module.canvas.style.background = 'no-repeat center url("' + splash_image + '")'; // Override game keys CanvasInput.addToCanvas(Module.canvas); // Load Facebook API var fb = document.createElement('script'); fb.type = 'text/javascript'; fb.src = '//connect.facebook.net/en_US/sdk.js'; document.head.appendChild(fb); // Add progress visuals Progress.addProgress(Module.canvas); // Load and assemble archive Combine.addCombineCompletedListener(Module.onArchiveFileLoaded); Combine.addAllTargetsBuiltListener(Module.onArchiveLoaded); Combine.addProgressListener(Module.onArchiveLoadProgress); Combine._archiveLocation = archive_location; Combine.process(archive_location + '/archive_files.json'); }, onArchiveLoadProgress: function(downloaded, total) { Progress.updateProgress(downloaded / total * 100); }, onArchiveFileLoaded: function(name, data) { Module._filesToPreload.push({path: name, data: data}); }, onArchiveLoaded: function() { Combine.cleanUp(); Module._archiveLoaded = true; Progress.updateProgress(100, "Starting..."); if(typeof Module.run == 'undefined') { /* If we are waiting for engine, let it autostart. */ Module.noInitialRun = false; } else { Module.preloadAll(); Progress.removeProgress(); Module.callMain(); } }, preloadAll: function() { for (var i = 0; i < Module._filesToPreload.length; ++i) { var item = Module._filesToPreload[i]; FS.createPreloadedFile("", item.path, item.data, true, true); } }, preInit: [function() { /* Mount filesystem on preinit */ var dir = DMSYS.GetUserPersistentDataRoot(); FS.mkdir(dir); if (window.__indexedDB) { FS.mount(IDBFS, {}, dir); FS.syncfs(true, function(err) { if(err) { throw "FS syncfs error: " + err; } }); } }], preRun: [function() { /* If archive is loaded, preload all its files */ if(Module._archiveLoaded) { Module.preloadAll(); } }], postRun: [function() { if(Module._archiveLoaded) { Progress.removeProgress(); } }], }; window.onerror = function() { Module.setStatus('Exception thrown, see JavaScript console'); Module.setStatus = function(text) { if (text) Module.printErr('[post-exception status] ' + text); }; };
javascript
Nuvvala Nenila is romantic entertainer with some commercial ingredients. Lead actors' performances are the main highlights in the film. Trinathrao Nakkina's wonderful story, Sai Karthik's music and background score, Gnanasekhar's cinematography, Uday Bhagwatulu's dialogues and few comedy scenes are other attractions of the film. Some routine scenes and slow-paced narration are its two big drawbacks. Besides direction, Trinathrao Nakkina has also penned the story for Nuvvala Nenila. He has taken inspiration from director Sang-woo Kim's Seducing Mr Perfect. The film seems to be an unofficial remake of the Korean film. The movie has a very good concept, but the director has failed to execute the same on the screen. The film might bore the viewers due to some cliched scenes and dragging narration. Krishna (Varun Sandesh), a young entrepreneur, returns India to fulfill his father's last wish by taking over Ashoka Industries firm. One day, a girl Mahalakshmi (Poorna) bumps into his car. Interestingly, Krish is her boss and he decides to appoint her as his assistant. However, she decides to flirt him. Why does she take such a decision? What does happen next? Answers to these questions will form the crux. Varun Sandesh has delivered good performance, which is one big asset of Nuvvala Nenila. Poorna has good scope for performance and she has done her best. The chemistry between the lead pair is superb. Vennala Kishore has tried his best to tickle the funny bones of the audience. Dhanraj, Arun Kumar, Uttej, Giridhar and others have done justice to their respective roles in the movie. Nuvvala Nenila has decent production values and Sai Karthik's music and background score is the main highlight the technical front. Couple of his songs are really good to listen. Gnanasekhar's camera work is another big asset of the film. Especially, his picturisation of songs is a visual treat. Other technical departments have also delivered commendable works. Overall, Nuvvala Nenila is a copy of the Korean film Seducing Mr Perfect and director Trinathrao Nakkina has brought it to the screens with some changes to suit the taste of the Telugu audience. It is good entertainer and it can be watched for its novel concept and Varun-Poorna's performance. Continue to see Nuvvala Nenila Review by viewers in the slideshow. My Review on #NuvvalaNenila . . A Poor freemake of South Korean film "Seducing Mr. Perfect". Damn I missed watching @iamvarunsandesh 's nuvvila nenila premier, heard its come out really well.
english
import os import collections import copy from openpype.api import Anatomy from openpype_modules.ftrack.lib import BaseAction, statics_icon class CreateFolders(BaseAction): identifier = "create.folders" label = "Create Folders" icon = statics_icon("ftrack", "action_icons", "CreateFolders.svg") def discover(self, session, entities, event): for entity_item in event["data"]["selection"]: if entity_item.get("entityType").lower() in ("task", "show"): return True return False def interface(self, session, entities, event): if event["data"].get("values", {}): return with_interface = False for entity in entities: if entity.entity_type.lower() != "task": with_interface = True break if "values" not in event["data"]: event["data"]["values"] = {} event["data"]["values"]["with_interface"] = with_interface if not with_interface: return title = "Create folders" entity_name = entity["name"] msg = ( "<h2>Do you want create folders also" " for all children of your selection?</h2>" ) if entity.entity_type.lower() == "project": entity_name = entity["full_name"] msg = msg.replace(" also", "") msg += "<h3>(Project root won't be created if not checked)</h3>" items = [ { "type": "label", "value": msg.format(entity_name) }, { "type": "label", "value": "With all chilren entities" }, { "name": "children_included", "type": "boolean", "value": False }, { "type": "hidden", "name": "with_interface", "value": with_interface } ] return { "items": items, "title": title } def launch(self, session, entities, event): '''Callback method for custom action.''' if "values" not in event["data"]: return with_interface = event["data"]["values"]["with_interface"] with_childrens = True if with_interface: with_childrens = event["data"]["values"]["children_included"] filtered_entities = [] for entity in entities: low_context_type = entity["context_type"].lower() if low_context_type in ("task", "show"): if not with_childrens and low_context_type == "show": continue filtered_entities.append(entity) if not filtered_entities: return { "success": True, "message": 'Nothing was created' } project_entity = self.get_project_from_entity(filtered_entities[0]) project_name = project_entity["full_name"] project_code = project_entity["name"] task_entities = [] other_entities = [] self.get_all_entities( session, entities, task_entities, other_entities ) hierarchy = self.get_entities_hierarchy( session, task_entities, other_entities ) task_types = session.query("select id, name from Type").all() task_type_names_by_id = { task_type["id"]: task_type["name"] for task_type in task_types } anatomy = Anatomy(project_name) work_keys = ["work", "folder"] work_template = anatomy.templates for key in work_keys: work_template = work_template[key] publish_keys = ["publish", "folder"] publish_template = anatomy.templates for key in publish_keys: publish_template = publish_template[key] project_data = { "project": { "name": project_name, "code": project_code } } collected_paths = [] for item in hierarchy: parent_entity, task_entities = item parent_data = copy.deepcopy(project_data) parents = parent_entity["link"][1:-1] hierarchy_names = [p["name"] for p in parents] hierarchy = "/".join(hierarchy_names) if hierarchy_names: parent_name = hierarchy_names[-1] else: parent_name = project_name parent_data.update({ "asset": parent_entity["name"], "hierarchy": hierarchy, "parent": parent_name }) if not task_entities: # create path for entity collected_paths.append(self.compute_template( anatomy, parent_data, work_keys )) collected_paths.append(self.compute_template( anatomy, parent_data, publish_keys )) continue for task_entity in task_entities: task_type_id = task_entity["type_id"] task_type_name = task_type_names_by_id[task_type_id] task_data = copy.deepcopy(parent_data) task_data["task"] = { "name": task_entity["name"], "type": task_type_name } # Template wok collected_paths.append(self.compute_template( anatomy, task_data, work_keys )) # Template publish collected_paths.append(self.compute_template( anatomy, task_data, publish_keys )) if len(collected_paths) == 0: return { "success": True, "message": "No project folders to create." } self.log.info("Creating folders:") for path in set(collected_paths): self.log.info(path) if not os.path.exists(path): os.makedirs(path) return { "success": True, "message": "Successfully created project folders." } def get_all_entities( self, session, entities, task_entities, other_entities ): if not entities: return no_task_entities = [] for entity in entities: if entity.entity_type.lower() == "task": task_entities.append(entity) else: no_task_entities.append(entity) if not no_task_entities: return task_entities other_entities.extend(no_task_entities) no_task_entity_ids = [entity["id"] for entity in no_task_entities] next_entities = session.query(( "select id, parent_id" " from TypedContext where parent_id in ({})" ).format(self.join_query_keys(no_task_entity_ids))).all() self.get_all_entities( session, next_entities, task_entities, other_entities ) def get_entities_hierarchy(self, session, task_entities, other_entities): task_entity_ids = [entity["id"] for entity in task_entities] full_task_entities = session.query(( "select id, name, type_id, parent_id" " from TypedContext where id in ({})" ).format(self.join_query_keys(task_entity_ids))) task_entities_by_parent_id = collections.defaultdict(list) for entity in full_task_entities: parent_id = entity["parent_id"] task_entities_by_parent_id[parent_id].append(entity) output = [] if not task_entities_by_parent_id: return output other_ids = set() for entity in other_entities: other_ids.add(entity["id"]) other_ids |= set(task_entities_by_parent_id.keys()) parent_entities = session.query(( "select id, name from TypedContext where id in ({})" ).format(self.join_query_keys(other_ids))).all() for parent_entity in parent_entities: parent_id = parent_entity["id"] output.append(( parent_entity, task_entities_by_parent_id[parent_id] )) return output def compute_template(self, anatomy, data, anatomy_keys): filled_template = anatomy.format_all(data) for key in anatomy_keys: filled_template = filled_template[key] if filled_template.solved: return os.path.normpath(filled_template) self.log.warning( "Template \"{}\" was not fully filled \"{}\"".format( filled_template.template, filled_template ) ) return os.path.normpath(filled_template.split("{")[0]) def register(session): """Register plugin. Called when used as an plugin.""" CreateFolders(session).register()
python
The Average True Range indicator (ATR) is used for measuring market volatility. ATR forex indicator was introduced by Welles Wilder who described it in his book “New Concepts in Technical Trading Systems”. Since then, the ATR forex indicator has been applied as a part of other trading systems. The Average True Range indicator often reaches peaks at the bottoms after prices fall sharply on the back of massive sell-offs. Low readings of the indicator correspond to continuous periods of horizontal moves that are seen at peaks and during consolidation. ATR can be interpreted in the same way as other volatility indicators. To make an accurate forecast based on ATR trading, one should stick to the following principles: the higher the reading, the higher the possibility of trend reversal; the lower the reading, the weaker the trend momentum. ATR Calculation: True Range is the biggest value among these three variables: - difference between the current high and low; - difference between the previous closing price and the current high; - difference between the previous closing price and the current low. What is ATR in simple words? It is the moving average of the readings within the true range.
english
<gh_stars>0 {"id": 1029, "url": "https://minefi.hosting.augure.com/Augure_Minefi/r/ContenuEnLigne/Download?id=F8F5013D-4488-45FB-A30A-11B092A5F28B&filename=631%20-%20M.%20Olivier%20DUSSOPT%20se%20rendra%20en%20Tunisie%20%28Tunis%29%20jeudi%207%20et%20vendredi%208%20mars%202019.pdf", "author": null, "title": "631 - M. Olivier DUSSOPT se rendra en Tunisie (Tunis) jeudi 7 et vendredi 8 mars 2019", "text": " \n \n \n \n \n \n \n \n \n<NAME> DUSSOPT, Secrétaire d’État, \nauprès du Ministre de l’Action et des Comptes publics \n \n Paris, le 6 mars 2019 \n \n \nNOTE AUX REDACTIONS \n \n \n<NAME> DUSSOPT, Secrétaire d’État auprès du Ministre de l’Action et des \nComptes publics se rendra en Tunisie (Tunis) jeudi 7 et vendredi 8 mars 2019 \n \n \n \nM. Olivier DUSSOPT, Secrétaire d’État auprès du Ministre de l’Action et des Comptes publics, se \nrendra en Tunisie, à Tunis, jeudi 7 et vendredi 8 mars 2019 pour la Conférence de lancement du \njumelage « Appui institutionnel à la mise en œuvre de la stratégie de modernisation de la fonction \npublique » entre la Tunisie, la Belgique et la France. \n \nLe Secrétaire d’État Olivier DUSSOPT s’entretiendra avec <NAME>, Ministre de la \nFonction publique, de la modernisation de l’administration et des politiques publiques ainsi que \n<NAME>, Ministre auprès du chef du Gouvernement, secrétaire général du \nGouvernement, puis participera à une Conférence-débat à l’École nationale d’administration de \nTunis sur le thème de la réforme de la fonction publique. \n \nA l’issue de son allocution d’ouverture de la Conférence de lancement du jumelage, le Secrétaire \nd’Etat s’entretiendra avec <NAME>, Maire de Tunis et présidente de la \nFédération nationale des villes tunisiennes, puis se rendra au Musée du Bardo pour un dépôt de \ngerbe en mémoire des victimes de l’attentat. \n \nLe Secrétaire d’État s’entretiendra enfin avec <NAME>, Ministre auprès du chef du \nGouvernement chargé des grandes réformes, et avec <NAME>, Ministre des affaires \nlocales et de l’environnement. \n \nCes différentes rencontres seront l’occasion pour le Secrétaire d’État Olivier DUSSOPT d’échanger \navec ses homologues sur la stratégie de modernisation de la fonction publique que souhaite mettre en \nœuvre le Gouvernement de la République Tunisienne. \n \n \n \n \n \n\n \n \nProgramme : \n \nJeudi 7 mars 2019 \n \n11h30 Entretien avec <NAME>, Ministre de la Fonction publique, de la modernisation \nde l’administration et des politiques publiques \n \nKasbah \n \n13h00 Déjeuner, à l’invitation de <NAME>, avec les acteurs du jumelage \n<NAME> \n \n15h00 Conférence-débat à l’École nationale d’administration de Tunis sur le thème de la réforme \nde la fonction publique \nÉcole nationale d’administration de Tunis \n \n17h00 Entretien avec <NAME>, Ministre auprès du chef du Gouvernement, \nsecrétaire général du Gouvernement \nKasbah \n \n \nVendredi 8 mars 2019 \n \n09h30 Allocution d’ouverture de la Conférence de lancement du jumelage « Appui institutionnel à \nla mise en œuvre de la stratégie de modernisation de la fonction publique tunisienne » \n<NAME> (Berges du Lac), Tunis \n \n11h30 Entretien avec <NAME>, Maire de Tunis, présidente de la Fédération \nnationale des villes tunisiennes \nMairie de Tunis \n \n12h45 Dépôt de gerbe en mémoire des victimes de l’attentat du Bardo, suivi d’une visite du musée \nMusée national du Bardo \n \n \n15h30 Entretien avec <NAME>, Ministre auprès du chef du Gouvernement chargé des \ngrandes réformes \nKasbah \n \n17h00 Entretien avec <NAME>, Ministre des affaires locales et de l’environnement \n \n \n \nContact presse : Cabinet de M. le Secrétaire d’État Olivier DUSSOPT : \n<EMAIL> / 01 53 18 45 75 \n", "published_date": "2019-03-06", "section": "Communiques"}
json
#!/usr/bin/env python # coding: utf-8 # In[1]: xs = [1,2,3,4,5,6,7,8] ys = [] for x in xs: ys.append(x*x) print(xs) print(ys) # In[2]: xs = [1,2,3,4,5,6,7,8] ys = [x*x for x in xs] print(xs) print(ys) # In[4]: students = ["Max", "Min", "Xi", "Feng", "Ding"] #lengths = [] #for student in students: # lengths.append(len(student)) lengths = [len(student) for student in students] print(lengths) # In[5]: get_ipython().run_line_magic('matplotlib', 'inline') import matplotlib.pyplot as plt plt.plot(xs, ys) plt.show # In[ ]:
python
<filename>Engine/Game/Assets/Arrow.cs.meta.json<gh_stars>1-10 {"Script":{"Directory Script":"Assets\/Arrow.cs","UUID Resource":73630869,"Name":"Arrow","PathDLL":"Library\/Scripts\/73630869.dll","Type":4,"Last Write":1521978170}}
json
{ "name": "MyBuildHelper", "version": "0.0.2", "summary": "MyBuildHelper can help to handle some common build configurations for iOS.", "description": "MyBuildHelper可以在创建项目工程时快速辅助搭建项目,包含常用的常规的项目架构目录、三方工具、以及常用pod库文件名列表。后续还会不断完善补充...", "homepage": "https://github.com/eyu1988/MyBuildHelper", "license": { "type": "MIT" }, "authors": { "Lucas": "<EMAIL>" }, "platforms": { "ios": "8.0" }, "source": { "git": "https://github.com/eyu1988/MyBuildHelper.git", "tag": "0.0.2" }, "source_files": "BaseViewController.{h,m}" }
json
# coding=utf-8 import time import hashlib import tornado.web import tornado.locale from bson.objectid import ObjectId from . import BaseHandler from .utils import username_validator, email_validator class SignupHandler(BaseHandler): def get(self): if self.current_user: self.redirect(self.get_argument('next', '/')) self.render('account/signup.html') def post(self): self.recaptcha_validate() username = self.get_argument('username', None) email = self.get_argument('email', '').lower() password = self.get_argument('password', None) password2 = self.get_argument('password2', None) if not (username and email and password and password2): self.flash('Please fill the required field') if password != password2: self.flash("Password doesn't match") if username and not username_validator.match(username): self.flash('Username is invalid') if email and not email_validator.match(email): self.flash('Not a valid email address') if username and \ self.db.members.find_one({'name_lower': username.lower()}): self.flash('This username is already registered') if email and self.db.members.find_one({'email': email}): self.flash('This email is already registered') if self.messages: self.render('account/signup.html') return password = <PASSWORD>(password + username.<PASSWORD>() role = 1 if not self.db.members.count(): role = 5 self.db.members.insert({ 'name': username, 'name_lower': username.lower(), 'password': password, 'email': email, 'website': '', 'description': '', 'created': time.time(), 'language': self.settings['default_locale'], 'role': role, # TODO:send mail. 'like': [], # topics 'follow': [], # users 'favorite': [] # nodes }) self.set_secure_cookie('user', password, expires_days=30) self.redirect(self.get_argument('next', '/')) class SigninHandler(BaseHandler): def get(self): if self.current_user: self.redirect(self.get_argument('next', '/')) self.render('account/signin.html') def post(self): username = self.get_argument('username', '').lower() password = self.get_argument('password', None) if not (username and password): self.flash('Please fill the required field') password = hashlib.sha1(password + username).hexdigest() member = self.db.members.find_one({'name_lower': username, 'password': password}) if not member: self.flash('Invalid account or password') self.render('account/signin.html') return self.set_secure_cookie('user', password, expires_days=30) self.redirect(self.get_argument('next', '/')) class SignoutHandler(BaseHandler): def get(self): user_name = self.get_argument('user', None) if user_name != self.current_user['name']: raise tornado.web.HTTPError(403) self.clear_cookie('user') self.redirect(self.get_argument('next', '/')) class SettingsHandler(BaseHandler): @tornado.web.authenticated def get(self): self.render('account/settings.html', locales=self.application.locales) @tornado.web.authenticated def post(self): website = self.get_argument('website', '') description = self.get_argument('description', '') pushover = self.get_argument('pushover', '') language = self.get_argument('language') if len(description) > 1500: self.flash("The description is too long") self.db.members.update({'_id': self.current_user['_id']}, {'$set': { 'website': website, 'description': description, 'language': language, 'pushover': pushover }}) self.flash('Saved successfully', type='success') self.redirect('/account/settings') class ChangePasswordHandler(BaseHandler): @tornado.web.authenticated def post(self): old_password = self.get_argument('old_password', None) new_password = self.get_argument('new_password', None) if not (old_password and new_password): self.flash('Please fill the required field') key = old_password + self.current_user['name'].lower() password = hashlib.sha1(key).hexdigest() if password != self.current_user['password']: self.flash('Invalid password') if self.messages: self.redirect('/account/settings') return key = new_password + self.current_user['name'].lower() password = str(hashlib.sha1(key).hexdigest()) self.db.members.update({'_id': self.current_user['_id']}, {'$set': {'password': password}}) self.set_secure_cookie('user', password, expires_days=30) self.flash('Saved successfully', type='success') self.redirect('/account/settings') class NotificationsHandler(BaseHandler): @tornado.web.authenticated def get(self): p = int(self.get_argument('p', 1)) notis = self.db.notifications.find({ 'to': self.current_user['name_lower'] }, sort=[('created', -1)]) notis_count = notis.count() per_page = self.settings['notifications_per_page'] notis = notis[(p - 1) * per_page:p * per_page] self.render('account/notifications.html', notis=notis, notis_count=notis_count, p=p) class NotificationsClearHandler(BaseHandler): @tornado.web.authenticated def get(self): self.db.notifications.remove({'to': self.current_user['name_lower']}) self.redirect('/') class NotificationsRemoveHandler(BaseHandler): @tornado.web.authenticated def get(self, id): self.db.notifications.remove({'_id': ObjectId(id)}) self.redirect(self.get_argument('next', '/account/notifications')) handlers = [ (r'/account/signup', SignupHandler), (r'/account/signin', SigninHandler), (r'/account/signout', SignoutHandler), (r'/account/settings', SettingsHandler), (r'/account/password', ChangePasswordHandler), (r'/account/notifications', NotificationsHandler), (r'/account/notifications/clear', NotificationsClearHandler), (r'/account/notifications/(\w+)/remove', NotificationsRemoveHandler), ]
python
{ "contract": "0xdee6c61630e8363f96f4fe4085b66795b79cefc7", "tool": "smartcheck", "start": 1563342620.788586, "end": 1563342633.2155778, "duration": 12.426991939544678, "analysis": [ { "name": "SOLIDITY_ERC20_APPROVE", "patternId": "af782c", "severity": 2, "line": 106, "column": 4, "content": "functionapprove(address_spender,uint256_value)publicreturns(boolsuccess){allowed[msg.sender][_spender]=_value;emitApproval(msg.sender,_spender,_value);returntrue;}" }, { "name": "SOLIDITY_ERC20_TRANSFER_SHOULD_THROW", "patternId": "550a42", "severity": 1, "line": 73, "column": 4, "content": "functiontransfer(address_to,uint256_value)publicreturns(boolsuccess){if(balances[msg.sender]>=_value&&_value>0){balances[msg.sender]-=_value;balances[_to]+=_value;emitTransfer(msg.sender,_to,_value);returntrue;}else{returnfalse;}}" }, { "name": "SOLIDITY_ERC20_TRANSFER_SHOULD_THROW", "patternId": "550a42", "severity": 1, "line": 88, "column": 4, "content": "functiontransferFrom(address_from,address_to,uint256_value)publicreturns(boolsuccess){if(balances[_from]>=_value&&allowed[_from][msg.sender]>=_value&&_value>0){balances[_to]+=_value;balances[_from]-=_value;allowed[_from][msg.sender]-=_value;emitTransfer(_from,_to,_value);returntrue;}else{returnfalse;}}" }, { "name": "SOLIDITY_PRAGMAS_VERSION", "patternId": "23fc32", "severity": 1, "line": 1, "column": 16, "content": "^" }, { "name": "SOLIDITY_REDUNDANT_FALLBACK_REJECT", "patternId": "b85a32", "severity": 1, "line": 135, "column": 25, "content": "{revert(\"fallback not allow used\");}" }, { "name": "SOLIDITY_VISIBILITY", "patternId": "b51ce0", "severity": 1, "line": 116, "column": 4, "content": "mapping(address=>uint256)balances;" }, { "name": "SOLIDITY_VISIBILITY", "patternId": "b51ce0", "severity": 1, "line": 117, "column": 4, "content": "mapping(address=>mapping(address=>uint256))allowed;" } ] }
json
<filename>app/src/main/java/com/homehub/dragan/myhomehub/Classes/view/MultiSwipeRefreshLayout.java<gh_stars>1-10 package com.homehub.dragan.myhomehub.Classes.view; import android.content.Context; import android.support.v4.view.ViewPager; import android.support.v4.widget.SwipeRefreshLayout; import android.util.AttributeSet; import android.view.View; /** * A descendant of {@link android.support.v4.widget.SwipeRefreshLayout} which supports multiple * child views triggering a refresh gesture. You set the views which can trigger the gesture via * {@link #setSwipeableChildren(int...)}, providing it the child ids. */ public class MultiSwipeRefreshLayout extends SwipeRefreshLayout { private View[] mSwipeableChildren; boolean isIdle = true; public MultiSwipeRefreshLayout(Context context) { super(context); } public MultiSwipeRefreshLayout(Context context, AttributeSet attrs) { super(context, attrs); } /** * Set the children which can trigger a refresh by swiping down when they are visible. These * views need to be a descendant of this view. */ public void setSwipeableChildren(final int... ids) { assert ids != null; // Iterate through the ids and find the Views mSwipeableChildren = new View[ids.length]; for (int i = 0; i < ids.length; i++) { mSwipeableChildren[i] = findViewById(ids[i]); } } public void setSwipeableChildren(ViewPager mViewPager) { mViewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() { @Override public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { } @Override public void onPageSelected(int position) { //Log.d("Yo", "onPageSelected" + position); } @Override public void onPageScrollStateChanged(int state) { isIdle = state == ViewPager.SCROLL_STATE_IDLE; } }); } /** * This method controls when the swipe-to-refresh gesture is triggered. By returning false here * we are signifying that the view is in a state where a refresh gesture can start. * <p> * <p>As {@link android.support.v4.widget.SwipeRefreshLayout} only supports one direct child by * default, we need to manually iterate through our swipeable children to see if any are in a * state to trigger the gesture. If so we return false to start the gesture. */ @Override public boolean canChildScrollUp() { return !isIdle; } /** * Utility method to check whether a {@link View} can scroll up from it's current position. * Handles platform version differences, providing backwards compatible functionality where * needed. */ private static boolean canViewScrollUp(View view) { return view.canScrollVertically(-1); } }
java
Kuzhaloothum Poomthennale song is a Malayalam compilation song from the Urumi And Fresh Hits released on . Music of Kuzhaloothum Poomthennale song is composed by Mohan Sithara. Kuzhaloothum Poomthennale was sung by G. Venugopal, Sujatha. Download Kuzhaloothum Poomthennale song from Urumi And Fresh Hits on Raaga.com.
english
<reponame>1a1a11a/rustcommon // Copyright 2021 Twitter, Inc. // Licensed under the Apache License, Version 2.0 // http://www.apache.org/licenses/LICENSE-2.0 use crate::*; pub trait MetricsLib { // counters fn get_counter(&self, metric: &dyn Metric) -> Result<u64, MetricsError>; fn increment_counter_by(&self, metric: &dyn Metric, value: u64); fn set_counter(&self, metric: &dyn Metric, value: u64); // gauges fn get_gauge(&self, metric: &dyn Metric) -> Result<i64, MetricsError>; fn set_gauge(&self, metric: &dyn Metric, value: i64); fn increment_gauge_by(&self, metric: &dyn Metric, value: i64); fn decrement_gauge_by(&self, metric: &dyn Metric, value: i64); } impl<T> MetricsLib for std::boxed::Box<T> where T: ?Sized + MetricsLib, { fn set_counter(&self, metric: &dyn Metric, value: u64) { self.as_ref().set_counter(metric, value) } fn get_counter(&self, metric: &dyn Metric) -> Result<u64, MetricsError> { self.as_ref().get_counter(metric) } fn increment_counter_by(&self, metric: &dyn Metric, value: u64) { self.as_ref().increment_counter_by(metric, value) } fn get_gauge(&self, metric: &dyn Metric) -> Result<i64, MetricsError> { self.as_ref().get_gauge(metric) } fn set_gauge(&self, metric: &dyn Metric, value: i64) { self.as_ref().set_gauge(metric, value) } fn increment_gauge_by(&self, metric: &dyn Metric, value: i64) { self.as_ref().increment_gauge_by(metric, value) } fn decrement_gauge_by(&self, metric: &dyn Metric, value: i64) { self.as_ref().decrement_gauge_by(metric, value) } }
rust