text stringlengths 1 1.04M | language stringclasses 25 values |
|---|---|
<filename>keys/AUFW02_de.json<gh_stars>10-100
{"code": "AUFW02", "lang": "de", "description": null, "name": "Aufwendungen (Unternehmen ab 250.000 EUR Umsatz)", "type": "Merkmal"} | json |
{"endpoint-url":"https://www.braintree.gov.uk/download/downloads/id/7439/bdc_brownfield_land_register_2017.csv","entry-date":"2018-05-22T00:00:00.000000","resource":"4d3d9f776e2d89c7c820cbf06474e1788492ab73a48dab5e324978870e73c5cb"} | json |
<reponame>charles-halifax/recipes
{
"directions": [
"Cook cauliflower in large pot of boiling salted water until tender, about 10 minutes. Drain; transfer to large bowl and mash coarsely with potato masher.",
"Heat 3 tablespoons oil in heavy large skillet over medium-high heat. Add leeks and saut\u00e9 until tender and just beginning to color, about 5 minutes. Add leek mixture to cauliflower. Mix in matzo meal. Beat eggs, 1 tablespoon parsley, 1 tablespoon dill, salt, and pepper in small bowl to blend; stir into cauliflower mixture.",
"Brush 11x7-inch baking dish with 1 tablespoon oil. Spread cauliflower mixture evenly in prepared dish. Mix almonds, remaining 7 tablespoons parsley, 7 tablespoons dill, and 2 tablespoons oil in medium bowl to blend. Sprinkle evenly over kugel. (Can be made 8 hours ahead. Cover and chill.)",
"Preheat oven to 350\u00b0F. Bake kugel uncovered until set in center and beginning to brown on top, about 35 minutes. Let stand 10 minutes."
],
"ingredients": [
"8 cups cauliflower florets (from 2 medium heads of cauliflower)",
"6 tablespoons olive oil, divided",
"4 cups coarsely chopped leeks (white and pale green parts; from 3 large)",
"6 tablespoons unsalted matzo meal",
"3 large eggs",
"1/2 cup chopped fresh parsley, divided",
"1/2 cup chopped fresh dill, divided",
"1 1/2 teaspoons salt",
"1/2 teaspoon coarsely ground black pepper",
"1/3 cup almonds, toasted, chopped"
],
"language": "en-US",
"source": "www.epicurious.com",
"tags": [
"Vegetable",
"Side",
"Bake",
"Passover",
"Vegetarian",
"Casserole/Gratin",
"Almond",
"Cauliflower",
"Leek",
"Spring",
"Kosher",
"Pescatarian",
"Dairy Free",
"Peanut Free",
"Soy Free",
"No Sugar Added"
],
"title": "Cauliflower-Leek Kugel with Almond-Herb Crust",
"url": "http://www.epicurious.com/recipes/food/views/cauliflower-leek-kugel-with-almond-herb-crust-231889"
}
| json |
Hello Inc., a Chinese mobility firm focused on bike-sharing that is also known as Hellobike, announced a brand upgrade on Monday.
Hello Inc., a Chinese mobility firm focused on bike-sharing that is also known as Hellobike, announced a brand upgrade on Monday.
On Wednesday, Hello Inc. announced the launch of its own self-driving car rental service. Users can open the Hello Inc. APP, click and enter Hello Car Rental interface, and select the time and location of renting a car.
In last week’s VC news, Chinese AR platform provider HiAR raised $42 million in its recent Series C round of financing, German-Chinese robotics firm Agile Robots raked in a whopping $220 million, and more.
According to a source related to investment institutions, comprehensive mobile travel platform Hello Inc. is to complete a new round of financing, coming in at a higher valuation than before.
Hello Inc., an app-based urban transportation provider, has scrapped plans for a U.S. initial public offering just three months after the firm submitted its prospectus to the US Securities and Exchange Commission (SEC), according to information disclosed Wednesday on the SEC website.
The Chinese government warned on Thursday that companies involved in the sharing economy need to comply with regulation and price their services properly.
When it seemed like we were about to hear the eulogy to the troubled industry, Meituan-Dianping and Didi Chuxing – companies that timely bought into bike-sharing flag-bearers Mobike and Bluegogo – started revitalizing their bicycle fleets.
We also support Hindi language, do you want change to it?
हम यह भी हिन्दी भाषा का समर्थन है, आप इसे करने के लिए परिवर्तन करना चाहते हैं?Yes(ह)
We also support Punjabi language, do you want change to it?
ਸਾਨੂੰ ਇਹ ਵੀ ਪੰਜਾਬੀ ਭਾਸ਼ਾ ਨੂੰ ਸਹਿਯੋਗ ਹੈ, ਤੁਹਾਨੂੰ ਇਸ ਨੂੰ ਕਰਨ ਲਈ ਤਬਦੀਲੀ ਚਾਹੁੰਦੇ ਹੋ?Yes(ਜ)
We also support Bengali language, do you want change to it?
আমরা বাংলা ভাষা সমর্থন, আপনি এটি পরিবর্তন করতে চান?Yes(হ)
We also support Burmese language, do you want change to it?
We also support Nepali language, do you want change to it?
हामी पनि नेपाली भाषा समर्थन, तपाईं यसलाई परिवर्तन गर्न चाहनुहुन्छ?Yes(ह)
We also support Tagalog language, do you want change to it?
Sinusuportahan din namin ang Tagalog wika, ang gusto mong pagbabago dito?Yes(oo)
We also support Malay language, do you want change to it?
Kami juga menyokong bahasa Melayu, adakah anda mahu perubahan kepadanya?Yes(yes)
We also support Indonesian language, do you want change to it?
Kami juga mendukung bahasa Indonesia, apakah Anda ingin perubahan untuk itu?Yes(Iya)
We also support Thai language, do you want change to it?
| english |
Missouri high school teacher Megan Gaither was placed on administrative leave and suspended after appearing in an adult content video on OnlyFans.
Administrators at a Missouri high school suspended a second teacher after learning about her OnlyFans site activity. In an interview with the St. Louis Post-Dispatch, 31-year-old Megan Gaither revealed that she was placed on leave on October 27 from her roles as a varsity cheerleading coach and English teacher when district authorities learned about her OnlyFans account.
Gaither stated in the interview that she needed the additional money because she owed over $125,000 in educational loans which is why she created an account on the direct-to-subscribers website.
According to Gaither, "teaching does not financially support a person." Stretching those paychecks over the summer is incredibly difficult. I did it for that reason." The investigation states that Gaither received about $47,500 in payment, which also included a stipend for mentoring the school's cheerleading squad.
The teacher said that she deleted her OnlyFans account at the same time as Brianna Coppage, another English teacher, was put on leave due to her involvement in the sale of explicit material. Gaither was exposed for her racy side project a few weeks later. Before Gaither deleted the account, she said that she was earning an additional $3,000 to $5,000 a month from about 1,500 subscribers. The thirty-one-year-old expressed that her content was faceless so that she could stay anonymous on the site.
How a student discovered Gaither's account?
When Gaither appeared in a video that Coppage's account uploaded in the middle of October, rumors regarding her involvement on the platform started to circulate. Gaither was reportedly seen in a public photo sporting the identical outfit that was worn in the video that was uploaded on OnlyFans, even though the video did not feature her face. It was shot at a party.
According to Gaither, a student wrote a message saying they "knew her secret" under her classroom door after the video was uploaded. The district administration allegedly informed her that the leave was imposed due to "professionalism and student communication," a claim she refutes.
Former English teacher Brianna Coppage, her colleague, was placed on leave after it was discovered that she and her spouse were running an OnlyFans page. Coppage recently left to focus solely on pornography.
After district officials learned about Coppage's controversial side gig—which she took on to augment her pitiful $42,000 salary—she was suspended on September 27. After quitting her job as a teacher and garnering international attention, the former educator informed Fox News that she has made about $1 million selling porn.
| english |
{
"id": "d196-126",
"text": "-\nHovey — 5*\nWeH, a a I have said, and as the director of the DO&A agency -•.Professor\nFeiS’iz of the University of Trieste would agree — not too much should be read\ninto these responses to the questions of the pollsters on Italian attitudes\ntoward America and Russia. But they do provide us with the most scientific\nevidence we have an the attitudes of ordinary Italian clttams on these broad\nquestions. I thought you might find these results aa *»t««9tta8 «**»«.\n<NAME>, reporting. Ihis program was recorded In theRoae^studios\nitadiotslsvlsione Italians for the National Association of .educational droad-\ncasters — and this Is the J&ASB Network."
} | json |
<reponame>sunshower-io/sunshower-base
package io.sunshower.common.configuration;
public interface ValueHolder {
String value();
}
| java |
import { IParcel } from 'actions/parcelsActions';
import { Label } from 'components/common/Label';
import * as React from 'react';
import { ReactElement } from 'react';
import { ListGroup } from 'react-bootstrap';
import { Link, useLocation } from 'react-router-dom';
import queryString from 'query-string';
interface IAssociatedBuildings {
/** the selected property information */
propertyInfo: IParcel | null;
/** link that opens the sidebar to create a new building associated to the parcel */
addAssociatedBuildingLink: ReactElement;
/** whether the user has the correct agency/permissions to edit property details */
canEditDetails: boolean;
}
/**
* Component that displays the associated buildings of a parcel
* as a clickable list
* @param propertyInfo the selected parcel
* @param addAssociatedBuildingLink link to create a new associated building
* @param canEditDetails whether the user can edit the parcel details
*/
export const AssociatedBuildingsList: React.FC<IAssociatedBuildings> = ({
propertyInfo,
addAssociatedBuildingLink,
canEditDetails,
}) => {
const location = useLocation();
return (
<>
<ListGroup>
<Label className="header" style={{ margin: '5px 0px' }}>
Associated Buildings
</Label>
<ListGroup.Item>Click a building name to view its details</ListGroup.Item>
{propertyInfo?.buildings?.length ? (
propertyInfo?.buildings?.map((building, buildingId) => (
<ListGroup.Item key={buildingId}>
<Link
className="styled-link"
to={{
pathname: `/mapview`,
search: queryString.stringify({
...queryString.parse(location.search),
sidebar: true,
disabled: true,
loadDraft: false,
buildingId: building.id,
}),
}}
>
{building.name}
</Link>
</ListGroup.Item>
))
) : (
<ListGroup.Item>This parcel has no associated buildings</ListGroup.Item>
)}
</ListGroup>
{canEditDetails && (
<ListGroup>
<ListGroup.Item>{addAssociatedBuildingLink}</ListGroup.Item>
</ListGroup>
)}
</>
);
};
export default AssociatedBuildingsList;
| typescript |
Steven Spielberg was reportedly tapped to helm Marvel Studios' upcoming Fantastic Four movie.
Yes, you read that right. According to multiple sources, including former Montclair Film Festival director Mike Sampson and Variety's Adam B. Vary, the legendary director turned down the opportunity to helm the highly anticipated Marvel movie. Those reports emerged after a wild rumor, which swept the internet on July 14, that Spielberg would be announced as the Fantastic Four movie's director during Marvel Studios' presentation at D23 Expo on Saturday, September 10.
The surprising piece of gossip originated on the Marvel Studios Spoilers Reddit page. A Tales From The Mod Queue post, which regularly shares unverified information from various Marvel leakers, included a snippet that linked Spielberg with a dual director-producer role on the Fantastic Four reboot. The post also indicated that the E.T, Jurassic Park, and Saving Private Ryan helmer was in final negotiations to join the growing roster of Marvel Cinematic Universe (MCU) directors.
Unsurprisingly, it wasn't long before this particular leak made its way out onto the wider internet. The post led to various actors, comic book characters, and upcoming Marvel Phase 4 projects trending on Twitter, with Spielberg and Fantastic Four among that number.
However, while it appears that Marvel Studios did reach out to Spielberg – according to Sampson, anyway – to helm its Fantastic Four movie, the multi-award winning director wasn't interested.
It should be noted that Marvel Studios Spoilers page moderators stressed the importance of taking everything in the Reddit thread with a giant pinch of salt. The initial post suggested readers shouldn't read too much into it, while moderator JohannSchmidt1943 confirmed that the information in that post was unverified.
Still, that didn't stop Marvel fans from being whipped into a frenzy by the rumor tying Spielberg to the MCU's Fantastic Four film. That is, until the likes of Sampson, Vary, and Collider's Steve Weintraub poured cold water on this piece of conjecture.
Disney and Marvel hadn't responded to our request for comment on the rumor by the time of publication. We'll update this article if either studio provides an official line on the speculation.
Analysis: would Spielberg have been a good fit?
Yes, we believe he would have been. Spielberg is one of the best sci-fi directors around, with Close Encounters of the Third Kind joining E.T. and Jurassic Park in being all-time classics. The iconic director's other sci-fi works, such as A.I., Minority Report, War of the Worlds, and Ready Player One weren't as well received as the previous trio, but they still have their fair share of fans worldwide. Spielberg's influence on the sci-fi genre stretches far and wide, too, with hit Netflix shows like Stranger Things and Sweet Tooth (the live-action series and graphic novels) being heavily inspired by his works.
Given the sci-fi leanings of the Fantastic Four, then, Spielberg would have been a natural fit for the superhero flick's director. His keen cinematic eye, coupled with his vast experience in this genre, could have put a unique spin on the Fantastic Four's origins, albeit one in keeping with how they're created in the comics and how the iconic quartet will fit into the forever-expanding MCU.
Marvel insiders, such as Greatphase, have already suggested that the MCU's Fantastic Four film will take inspiration from one legendary sci-fi series in Star Trek. Getting someone of the caliber of Spielberg on board to direct such a film, then, would have made for fascinating and fan-hyping viewing. Unfortunately, it seems that Spielberg won't be joining the MCU in a directing capacity.
He's not the only one, either. Bryce Dallas Howard has also denied her involvement in Marvel's Fantastic Four film; the Jurassic World star saying she hasn't been approached to be the movie's director or to play Sue Storm/The Invisible Woman.
Meanwhile, fans remain hopeful that John Krasinski will be retained as Reed Richards/Mr. Fantastic in the main MCU timeline. Krasinski made a crowd pleasing cameo as the same character in Doctor Strange in the Multiverse of Madness. It's unclear, though, if Marvel will ask him to return. The Tales From the Mod Queue thread suggests he won't be but, as we've learned, it's best to take any rumors about Marvel's Fantastic Four film reboot with a massive heaping of salt.
For more MCU-based content, check out our Ms Marvel ending explainer, or read up on She-Hulk: Attorney at Law, the next MCU TV show to land on Disney Plus.
Get the hottest deals available in your inbox plus news, reviews, opinion, analysis, deals and more from the TechRadar team.
As TechRadar's senior entertainment reporter, Tom covers all of the latest movies, TV shows, and streaming service news that you need to know about. You'll regularly find him writing about the Marvel Cinematic Universe, Star Wars, Netflix, Prime Video, Disney Plus, and many other topics of interest.
An NCTJ-accredited journalist, Tom also writes reviews, analytical articles, opinion pieces, and interview-led features on the biggest franchises, actors, directors and other industry leaders. You may see his quotes pop up in the odd official Marvel Studios video, too, such as this Moon Knight TV spot.
Away from work, Tom can be found checking out the latest video games, immersing himself in his favorite sporting pastime of football, reading the many unread books on his shelf, staying fit at the gym, and petting every dog he comes across.
Got a scoop, interesting story, or an intriguing angle on the latest news in entertainment? Feel free to drop him a line.
| english |
export enum CEP47Events {
MintOne = "cep47_mint_one",
TransferToken = "cep47_transfer_token",
BurnOne = "cep47_burn_one",
MetadataUpdate = 'cep47_metadata_update'
}
export enum ERC20Events {
Transfer = "transfer",
Approve = "approve"
}
export const DEFAULT_TTL = 1800000;
| typescript |
<reponame>vic/on-nix-pkgs
{
"out": [
"/lib/python3.8/site-packages/api/__init__.py",
"/lib/python3.8/site-packages/api/__pycache__/__init__.cpython-38.pyc",
"/lib/python3.8/site-packages/api/__pycache__/soma_api.cpython-38.pyc",
"/lib/python3.8/site-packages/api/soma_api.py",
"/lib/python3.8/site-packages/pysoma-0.0.10.dist-info/INSTALLER",
"/lib/python3.8/site-packages/pysoma-0.0.10.dist-info/METADATA",
"/lib/python3.8/site-packages/pysoma-0.0.10.dist-info/RECORD",
"/lib/python3.8/site-packages/pysoma-0.0.10.dist-info/REQUESTED",
"/lib/python3.8/site-packages/pysoma-0.0.10.dist-info/WHEEL",
"/lib/python3.8/site-packages/pysoma-0.0.10.dist-info/direct_url.json",
"/lib/python3.8/site-packages/pysoma-0.0.10.dist-info/top_level.txt",
"/nix-support/propagated-build-inputs"
]
} | json |
<reponame>KacperDrewniak/lr_frontend
{"componentChunkName":"component---src-templates-leader-page-js","path":"/Krzysztof-Hanzlik","result":{"pageContext":{"imie":"Krzysztof","nazwisko":"Hanzlik","motto":"Motto","tekst":"adssadsadsad as\nASDASD\nASD\nASD\nA\nSD\nASDASD\nASDADSDASDAS","obraz":[{"url":"/uploads/Zrzut_ekranu_z_2020_08_15_01_43_01_2faf8f6384.png"}]}},"staticQueryHashes":["3802390426"]} | json |
Gram Sadak Yojana (PMGSY)
persons and above in hill States, the tribal and the desert areas.
habitations were eligible for coverage under the programme,
to be connected:- 1,35,436 nos.
lakh km. (approx.)
lakh km. (approx.)
verification by States, 54,648 habitations are targeted to be connected under Bharat Nirman.).
(60 % of the target) was to be funded by the Govt. of India and 77,652 km.
(40%) by the States/UTs.
as under:
Habitations (in Nos.)
Road Length (in km)
Upgradation of roads (in km)
In addition,
Road length in km.
Road length in km.
have been deployed in Bihar, Jharkhand and Tripura.
has been allowed since April 2006 with a view to expedite project clearances.
consultants have been engaged in Madhya Pradesh, Chhattisgarh,
West Bengal, Assam and Orissa.
for the implementation has been increased from 718 in 2004 to 981 in 2009.
from 25 to 50 m.
amended to facilitate participation of smaller as well as large contractors.
States to float large sized packages above Rs. 10 Cr.
packages of at least Rs. 1 crore.
Ø Joint ventures have been permitted.
introduced for timely completion of projects.
Reports (DPRs).
and are scheduled to be held in other States also.
donation by the local owners or acquisition.
taken up under PMGSY from the payment of NPV.
of private land required for road construction.
be motivated to voluntarily donate the land required. However, in densely populated areas of Bihar,
Pradesh, Uttar Pradesh and Assam,
administration to overcome this constraint.
backlog – Assam, Chattisgarh, Madhya Pradesh, Orissa and West Bengal.
completion of projects has been introduced.
(f) E-Procurement:
process, e-procurement of bids has been made mandatory.
has started in the States of Andhra Pradesh, Assam, Orissa,
Haryana, Karnataka, Madhya Pradesh and Gujarat.
NIC during 2009-10. The remaining States would be covered in 2010-11.
of road works taken up under PMGSY.
monitoring strategy has been adopted for the current year (2009-10):
– By December, 2009.
are targeted for completion in 2010-11.
PMGSY by the Ministry of Rural Development.
| english |
{"name":"diagonal_upRight","subject":1002,"date":"7122009-014219","paths":{"Pen":{"strokes":[{"x":-639,"y":485,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":0,"stroke_id":0},{"x":-621,"y":460,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":1,"stroke_id":0},{"x":-591,"y":421,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":2,"stroke_id":0},{"x":-554,"y":373,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":3,"stroke_id":0},{"x":-514,"y":307,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":4,"stroke_id":0},{"x":-454,"y":226,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":5,"stroke_id":0},{"x":-386,"y":135,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":6,"stroke_id":0},{"x":-303,"y":33,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":7,"stroke_id":0},{"x":-214,"y":-81,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":8,"stroke_id":0},{"x":-114,"y":-196,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":9,"stroke_id":0},{"x":-13,"y":-313,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":10,"stroke_id":0},{"x":97,"y":-428,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":11,"stroke_id":0},{"x":201,"y":-540,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":12,"stroke_id":0},{"x":304,"y":-643,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":13,"stroke_id":0},{"x":402,"y":-734,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":14,"stroke_id":0},{"x":491,"y":-811,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":15,"stroke_id":0},{"x":571,"y":-875,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":16,"stroke_id":0},{"x":634,"y":-931,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":17,"stroke_id":0},{"x":694,"y":-968,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":18,"stroke_id":0},{"x":735,"y":-1001,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":19,"stroke_id":0},{"x":767,"y":-1032,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":20,"stroke_id":0},{"x":789,"y":-1055,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":21,"stroke_id":0},{"x":802,"y":-1076,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":22,"stroke_id":0},{"x":810,"y":-1089,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":23,"stroke_id":0}]}},"device":{"osBrowserInfo":"Fujitsu-Siemens Lenovo X61 Tablet PC","resolutionHeight":null,"resolutionWidth":null,"windowHeight":null,"windowWidth":null,"pixelRatio":null,"mouse":false,"pen":true,"finger":false,"acceleration":false,"webcam":false}} | json |
<reponame>amethyst/handsome-voxels
use super::generate_mesh_vertices_with_surface_nets;
use crate::{
assets::{BoundedMesh, IndexedPosColorNormVertices, MeshLoader},
voxel::{ArrayMaterialId, LocalVoxelCache, VoxelMap},
};
use amethyst::{assets::ProgressCounter, core::ecs::prelude::*};
use building_blocks::prelude::*;
use std::collections::HashMap;
/// Loads the vertices for chunks into `ChunkMesh` objects.
#[derive(SystemData)]
pub struct VoxelMeshLoader<'a> {
pub mesh_loader: MeshLoader<'a>,
}
#[derive(Clone)]
pub struct ChunkMesh {
pub material_array_id: ArrayMaterialId,
pub mesh: BoundedMesh,
}
#[derive(Default)]
pub struct VoxelMeshes {
pub chunk_meshes: HashMap<Point3i, ChunkMesh>,
}
impl<'a> VoxelMeshLoader<'a> {
pub fn start_loading_all_chunks(
&mut self,
voxel_map: &VoxelMap,
chunk_cache: &LocalVoxelCache,
progress: &mut ProgressCounter,
) -> VoxelMeshes {
let chunk_meshes = voxel_map
.voxels
.storage()
.chunk_keys()
.filter_map(|chunk_key| {
let chunk_extent = voxel_map
.voxels
.indexer
.extent_for_chunk_with_min(chunk_key.minimum);
let vertices =
generate_mesh_vertices_with_surface_nets(voxel_map, &chunk_extent, chunk_cache);
vertices.map(|v| (chunk_key.minimum, self.start_loading_chunk(v, progress)))
})
.collect();
VoxelMeshes { chunk_meshes }
}
pub fn start_loading_chunk(
&self,
vertices: IndexedPosColorNormVertices,
progress: &mut ProgressCounter,
) -> ChunkMesh {
let mesh = self
.mesh_loader
.start_loading_pos_color_norm_mesh(vertices, &mut *progress);
ChunkMesh {
// TODO: support multiple array materials
material_array_id: ArrayMaterialId(1),
mesh,
}
}
}
| rust |
<reponame>influentialpublishers/browser-sync-middleware-spa
{
"name": "browser-sync-middleware-spa",
"version": "1.0.0",
"description": "A single page application middleware for the BrowserSync server",
"main": "index.js",
"scripts": {
"test": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha"
},
"repository": {
"type": "git",
"url": "git+https://github.com/influentialpublishers/browser-sync-middleware-spa.git"
},
"keywords": [
"browser-sync",
"webapp",
"middleware"
],
"author": "<NAME> <<EMAIL>>",
"license": "MIT",
"bugs": {
"url": "https://github.com/influentialpublishers/browser-sync-middleware-spa/issues"
},
"homepage": "https://github.com/influentialpublishers/browser-sync-middleware-spa#readme",
"devDependencies": {
"coveralls": "^2.11.6",
"istanbul": "^0.4.1",
"mocha": "^2.3.4"
}
}
| json |
<gh_stars>0
html, body { margin:0; padding:0; }
body {
/* font: 14px "Helvetica Neue", Helvetica, Arial, sans-serif; */
font: 16px "Helvetica Neue", Tahoma,Helvetica,Arial, "Hiragino Sans GB", "Microsoft Yahei",sans-serif;
margin: 8px;
}
button:focus{
outline: none;
}
#main-content-wrapper {
margin: 0 auto;
width: 85%
}
@media only screen and (max-width: 750px) and (min-width: 300px) {
#main-content-wrapper {
width: 100%!important;
}
}
.nav{
font-size: 14px;
display: flex;
position: relative;
align-items: center;
list-style:none;
margin:0;
padding:0;
height: 24px;
background-color: #fe6601;
}
.nav li{
display:inline;
position: relative;
/* top: 1px; */
margin-left: 2px;
}
.nav li a.active-route {
color: #fff;
}
.nav > li:first-child {
font-weight: bold;
}
.nav li:nth-child(n+3)::after{
content: "|";
color: #000;
}
/* hide vertical bar of the last 2 list items */
.nav li:last-child::after, .nav li:nth-last-child(2)::after {
display: none;
}
.nav a{
display:inline-block;
padding:5px;
font-family: Verdana, Geneva, sans-serif
}
.nav a:link {
color: #000;
text-decoration: none;
}
.nav a:visited {
text-decoration: none;
color: #000;
}
.auth-action{
position: absolute!important;
right: 6px;
}
.auth-action ul li:not(:first-child):before{
content: "|";
color: #000;
padding: 0 6px;
}
.auth-action ul li:hover{
cursor: pointer;
}
.content-wrapper {
background-color: #f6f6ef;
padding-top: 10px;
color: #828282;
}
/*
.content-wrapper .topic-link:link {
color: #000;
text-decoration: none;
}
.content-wrapper .topic-link:visited {
color: #828282;
text-decoration: none;
}
*/
.content-wrapper .topic-domain {
font-size: 12px;
color: #828282;
margin-top: 4px;
margin-left: 8px;
}
.content-wrapper .rank {
color: #828282;
margin-right: 4px;
/* font-size: 12px; */
}
.content-wrapper .topic-text {
margin-left: 12px;
color: #828282;
}
.topic-title a:link{
color: #000;
text-decoration: none;
}
.topic-title a:visited{
color: #828282;
text-decoration: none;
}
.vote-arrow {
padding-right: 2px;
color: #828282;
font-size: 12px;
}
.vote-arrow:hover{
cursor: pointer;
}
.subtext{
margin:4px 0 6px 0;
padding-left: 14px;
list-style: none;
color: #828282;
font-size: 11px;
}
.subtext li{
display: inline;
}
.subtext li a:link, .subtext li a:visited{
text-decoration: none;
}
.subtext li:not(:first-child):before{ /* refactor this into .auth-action ul li:..... */
content: "|";
color: #000;
padding: 0 6px;
}
.subtext li a{
color: #828282!important;
}
.add-reply {
margin-left: 12px;
margin-top: 6px;
padding-bottom: 12px;
font-size: 11px;
text-decoration: underline;
color: #000;
}
.add-reply:hover{
cursor: pointer;
}
.comment-text {
color: #000;
margin-left: 12px;
font-family: Verdana, Geneva, sans-serif;
font-size: 13px;
}
.show-hide-comment {
padding-left: 8px;
font-family: Verdana, Geneva, sans-serif;
font-size: 10px;
}
.show-hide-comment:hover{
cursor: pointer;
}
.tab-list {
padding-left: 0;
margin-top:60px;
margin-bottom: 0
}
.tab-list-item {
background-color: #CCC;
font-size: 1.4em;
display: inline-block;
list-style: none;
margin-bottom: -1px;
padding: 0.5rem 0.75rem;
}
.tab-list-item:hover {
cursor: pointer;
}
.tab-list-active {
background-color: white;
}
#overlay {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: rgba(0, 0, 0, 0.7);
transition: opacity 500ms;
visibility: hidden;
opacity: 0;
}
#overlay.show {
visibility: visible;
opacity: 1;
}
.popup {
padding: 20px;
background: #fff;
width: 520px;
position: relative;
transition: all 5s ease-in-out;
}
.popup .close {
position: absolute;
top: 2px;
right: 16px;
transition: all 200ms;
font-size: 30px;
font-weight: bold;
text-decoration: none;
color: #9E9E9E;
}
.popup .close:hover {
color: #fe6601;
cursor: pointer;
}
#login-signup-form fieldset {
margin-top: 10px;
border: 0;
}
#login-signup-form input, #login-signup-form button {
box-sizing: border-box;
width: 220px;
height: 46px;
display: block;
margin: 18px auto;
padding: 8px;
font-size: 18px;
}
#login-signup-form button{
border: 0;
background-color: #fd6602;
color: #FFF;
transition: background-color 0.5s ease;
}
#login-signup-form button:hover{
cursor: pointer;
}
#login-signup-form button.disabled{
background-color: #9E9E9E;
transition: background-color 0.5s ease
}
#login-signup-form button.disabled:hover{
cursor: not-allowed;
}
input:focus, textarea:focus {
/* outline: none; */
/* border: 1px solid #757575; */
outline: 1px solid #757575;
/* border: 0; */
/* box-shadow: 0 0 1px #757575; */
/* box-shadow: 1px 1px 1px 1px rgba(117, 117, 117, 1); */
/* border: 1px solid red; */
/*
border-color: #D8000C;
box-shadow: none;
*/
/* box-shadow: 0 0 1px 0 #757575; */
}
.server-msg {
display: flex;
justify-content: space-evenly;
height: 25px;
position: relative;
top: 4px;
}
.server-msg label {
padding: 4px;
font-size: 12px;
color: #D8000C;
background-color: #FFD2D2;
border-radius: 4px;
}
#form-new-topic .form-field {
margin-bottom: 6px;
}
#form-new-topic label {
margin-left: 4px;
color: #828282;
font-size:14px;
width: 35px;
display: inline-block;
}
#form-new-topic input, #form-new-topic textarea {
width: 410px
}
/*
.clear {
clear:both; display:block; overflow:hidden; visibility:hidden; height:0;
}
*/
| css |
The Minnesota Wild (11-12-4) host the Vancouver Canucks (20-9-1) at Xcel Energy Center in St Paul on Saturday at 2 p.m. ET.
In their last game on Thursday, Minnesota claimed a 3-2 home win against the Calgary Flames, winning the shootout 2-1. On the same day, Vancouver beat the Florida Panthers 4-0 at home.
Tune in to BSN, BSWI and NHL Network to witness the clash.
The Vancouver Canucks, on a four game winning streak, are poised to continue their success against the Wild.
With an average of Dakota Joshua 3.83 goals per game, Vancouver displayed offensive prowess in their last outing, scoring four goals on just 18 shots. Dakota Joshua notched up two goals, complemented by a goal from Brock Boeser and an assist by J.T Miller.
Defensively solid, the Canucks concede an average of 2.47 goals per game. In their recent game, they secured a shutout, emphasizing the importance of a strong defensive effort for continued success.
Goaltender, Thatcher Demko, with a 15-7-0 record in 22 games, has a 2.31 GAA and an impressive .923 save percentage, having stopped all 36 shots faced in the last game.
Meanwhile, riding a two-game winning streak, the Minnesota Wild aim to extend their success by beating the Canucks, securing their third straight win and seventh in nine games.
Minnesota is averaging 3.04 goals per game, scoring three on 32 shots in their recent game. Marco Rossi and Matt Boldy contributed a goal apiece, with an assist from Marcus Johansson.
Goaltender Filip Gustavsson stopped 35 of 37 shots he faced, boasting a 7-7-2 record in 17 games, along with a 2.97 GAA and a .903 save percentage.
- The Wild and Canucks have faced off in 112 games, including regular season and playoff.
- The Wild hold an overall record of 53-53-5-1 (49.6%) against the Canucks.
- In regular season contests alone, the Wild have a 48-47-5-1 (50%) against the Canucks.
- The Wild's lengthiest winning streak against the Canucks spans six games, initiating on Oct 26, 2021, with a 3-2 win and continuing until Mar 2, 2023.
- This season, the Wild have had two shutouts, and their skaters average 15.9 hits and 16.6 blocked shots per game. Meanwhile, the Canucks have achieved four shutouts.
- The Canucks hold a faceoff win rate of 50.5%, ranking 15th in the NHL, while the Wild rank 32nd with a faceoff win percentage of 45.1%.
Minnesota have proven successful as the favorite in eight of 13 games this season. When facing odds shorter than -114 in 11 games, the Wild have secured victories seven times, indicating a 53.3% probability of winning the upcoming game.
The Canucks, labeled as the underdog in 14 games this season, have upset their opponents in nine of them. Vancouver holds an 8-5 record in games with odds at -108 or longer, with a 51.9% chance of emerging victorious.
Poll : Who will be the winner?
| english |
<filename>pokemon_combat/body_part.py
from enum import Enum, auto
class BodyPart(Enum):
NOTHING = auto() # ничего (начальное состояние)
HEAD = auto() # голова
BELLY = auto() # живот
LEGS = auto() # ноги
@classmethod
def min_index(cls):
return cls.HEAD.value
@classmethod
def max_index(cls):
return cls.LEGS.value
@classmethod
def has_item(cls, name):
return name in cls._member_names_
| python |
# measurement_server
A Simple JSON REST API for a database of scientific measurements taken at various locations.
## Execution
1. Install dependencies
```bash
pip install Flask Flask-Jsonpify Flask-RESTful SQLAlchemy
```
2. Start server
```bash
python measurement_server.py
# Server now running on port 9000
```
## API reference
### `/area` - List all areas
Returns an array of every Area in the database.
#### Example usage
```json
// GET /area
[
{"area_id": 1, "name": "Grand Canyon", "lat": 30, "long": 20},
{"area_id": 2, "name": "<NAME>", "lat": 50, "long": 40},
{"area_id": 3, "name": "Kennesaw", "lat": 70, "long": 60},
{"area_id": 4, "name": "Mount Hood", "lat": 90, "long": 80},
{"area_id": 5, "name": "Mount Rainer", "lat": 121.5, "long": 46.5},
{"area_id": 6, "name": "<NAME>", "lat": 93, "long": 44},
{"area_id": 7, "name": "Mount St. Helens", "lat": 122, "long": 46}
]
```
#### Area object
| Property | Type | Value |
| --------- | ------- | --------------------------------------- |
| `area_id` | integer | Id |
| `name` | string | The name of the area |
| `lat` | number | The latitude (in degrees) of this area |
| `long` | number | The longitude (in degrees) of this area |
### `/area/<area_id>/location` - List locations in area
Returns an array of Locations which match the given `area_id`.
#### Example usage
```json
// GET /area/1/location
[
{"loc_id": 11, "name": "South rim", "alt": 200, "area_id": 1},
{"loc_id": 12, "name": "North rim", "alt": 300, "area_id": 1},
{"loc_id": 13, "name": "<NAME>", "alt": 100, "area_id": 1}
]
```
#### Location object
| Property | Type | Value |
| --------- | ------- | ------------------------------------- |
| `loc_id` | integer | Unique ID |
| `name` | string | Name of the location |
| `alt` | number | Altitude (in feet??) |
| `area_id` | integer | The ID of the area the location is in |
### `/location/<loc_id>/measurement` - List measurements for location
Returns an array of Measurements taken in the given location.
#### Example usage
```json
// GET /location/11/measurement
[
{"m_id": 1100, "loc_id": 11, "val": 44.82004560587978},
{"m_id": 1101, "loc_id": 11, "val": 38.91602608079564},
{"m_id": 1102, "loc_id": 11, "val": 44.178163488614025},
{"m_id": 1103, "loc_id": 11, "val": 46.41919904550956},
{"m_id": 1104, "loc_id": 11, "val": 46.345502885760894},
{"m_id": 1105, "loc_id": 11, "val": 43.1501772579135},
{"m_id": 1106, "loc_id": 11, "val": 44.31037965295677},
{"m_id": 1107, "loc_id": 11, "val": 41.692298340629186},
{"m_id": 1108, "loc_id": 11, "val": 43.28018622019225},
{"m_id": 1109, "loc_id": 11, "val": 39.07856683302732}
]
```
#### Measurement object
| Property | Type | Value |
| -------- | ------- | ------------------------------------------------------ |
| `m_id` | integer | A unique ID for the measurement |
| `loc_id` | integer | The ID of the location where the measurement was taken |
| `val` | number | The value of the measurement |
### `/area/AREA_ID/category` - Get categories for area
#### Example usage
```json
// GET /area/4/category
[
{"cat_id": 31, "name": "Volcanos", "description": "Areas that are on volcanoes"},
{"cat_id": 33, "name": "West", "description": "Areas that are in the west"}
]
```
#### Category object
| Property | Type | Value |
| ------------ | ------- | ------------------------------ |
| `cat_id` | integer | A unique ID for this category |
| `name` | string | The name of this category |
| `descripton` | string | A description of that category |
### `/area/AREA_ID/average_measurement` - Get the average measurement for area
#### Example usage
```json
// GET /area/1/average_measurement
46.26524716693247
```
### `/area/AREA_ID/number_locations` Get the number of locations for area
#### Example usage
```json
// GET /area/1/number_locations
3
``` | markdown |
<filename>gcp/roles/cloudkms.cryptoKeyDecrypter.json
{
"description": "Enables Decrypt operations",
"etag": "AA==",
"includedPermissions": [
"cloudkms.cryptoKeyVersions.useToDecrypt",
"cloudkms.locations.get",
"cloudkms.locations.list",
"resourcemanager.projects.get"
],
"name": "roles/cloudkms.cryptoKeyDecrypter",
"stage": "GA",
"title": "Cloud KMS CryptoKey Decrypter"
}
| json |
<reponame>mingyeow/mingyeow.github.io
---
layout: default
---
<header>
<!-- <h1>{{ site.title | escape }}</h1> -->
</header>
<main>
{{ content }}
<hr />
{%- if site.posts.size > 0 -%}
<h2>{{ page.list_title | default: "Writing" }}</h2>
<ul class="more-space">
<li> <a class="post-link" href="https://files.kyber.network/DMM-Feb21.pdf">Dynamic Market Maker - A New Line Of Research For AMMs (Whitepaper)</a> </li>
{%- for post in site.posts limit:10 -%}
<li><a class="post-link" href="{{ post.url | relative_url }}">{{ post.title | escape }}</a></li>
{%- endfor -%}
</ul>
{%- endif -%}
</main> | html |
<filename>11.JSFundamentals/03.SyntaxOperatorsAndLogicFlowExercise/10.ComposeTag.js<gh_stars>1-10
function tag(params) {
let location = params[0];
let alternateText = params[1];
console.log(`<img src="${location}" alt="${alternateText}">`);
}
tag(['smiley.gif', 'Smiley Face']); | javascript |
In this Kencha film, Prajwal Devaraj, Pragnya played the primary leads.
The Kencha was released in theaters on 10 Jul 2009.
The soundtracks and background music were composed by Rajesh Ramanathan for the movie Kencha.
The movie Kencha belonged to the Drama, genre.
| english |
Fortnite Chapter 3 witnessed the arrival of the friendly neighbourhood Spider-Man onto the island to help the Seven regain control of the island. The developers even added his iconic Web Shooters and a Daily Bugle POI, allowing players to immerse into the action entirely. While superhero skins or collabs are nothing new, the Spider-Man collab has been a monumental event, with many calling it the best skin in the game.
The last chapter brought Superman onto the island to help loopers fight the alien invasion. Now, the community has come up with a brilliant makeover idea for our spidey, which many think was long overdue.
Generally, every superhero has a different outfit that sets them apart. A superhero outfit is not just another piece of clothing, and it stands for a lot of things like hope and peace, among others. However, a common denominator among most superhero costumes is the cape.
While every superhero prefers costume design, most have openly endorsed their love for capes. However, one superhero who despises wearing a cape is Spider-Man.
The web-slinger doesn't like the idea of capes and thinks it is disrespectful. While our spidey must have his reasons for this, a Fortnite player has developed a concept that shows Spider-Man wearing a cape and swinging around the island.
Going by Janzo543 on Reddit, the Fortnite player shares concept images of Spider-Man wearing a black and red futuristic-looking cape with a spidey symbol. The new cape is somewhat reminiscent of Superman but with a modern touch. You can take a look at the post below.
As can be seen from the post, the new cape on spidey looks cool, giving him a brand new sleek look. While looks can be quite a subjective affair, this new concept cape design indeed appears to be an excellent fit for Spider-Man.
This concept could be a fantastic addition to Fortnite, and the developers can give it their own twist by adding some unique modifications. | english |
/*!
* OS.js - JavaScript Cloud/Web Desktop Platform
*
* Copyright (c) 2011-2017, <NAME> <<EMAIL>>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* @author <NAME> <<EMAIL>>
* @licence Simplified BSD License
*/
/*eslint valid-jsdoc: "off"*/
(function(CoreWM, Panel, PanelItem, Utils, API, GUI, VFS) {
'use strict';
/////////////////////////////////////////////////////////////////////////////
// ITEM
/////////////////////////////////////////////////////////////////////////////
/**
* PanelItem: Buttons
*/
function PanelItemButtons(settings) {
PanelItem.apply(this, ['PanelItemButtons', 'Buttons', settings, {
buttons: [
{
title: API._('LBL_SETTINGS'),
icon: 'categories/applications-system.png',
launch: 'ApplicationSettings'
}
]
}]);
}
PanelItemButtons.prototype = Object.create(PanelItem.prototype);
PanelItemButtons.constructor = PanelItem;
PanelItemButtons.prototype.init = function() {
var self = this;
var root = PanelItem.prototype.init.apply(this, arguments);
this.renderButtons();
var ghost;
var lastTarget;
var removeTimeout;
var lastPadding = null;
function clearGhost() {
removeTimeout = clearTimeout(removeTimeout);
ghost = Utils.$remove(ghost);
lastTarget = null;
if ( lastPadding !== null ) {
self._$container.style.paddingRight = lastPadding;
}
}
function createGhost(target) {
if ( !target || !target.parentNode ) {
return;
}
if ( target.tagName !== 'LI' && target.tagName !== 'UL' ) {
return;
}
if ( lastPadding === null ) {
lastPadding = self._$container.style.paddingRight;
}
if ( target !== lastTarget ) {
clearGhost();
ghost = document.createElement('li');
ghost.className = 'Ghost';
if ( target.tagName === 'LI' ) {
try {
target.parentNode.insertBefore(ghost, target);
} catch ( e ) {}
} else {
target.appendChild(ghost);
}
}
lastTarget = target;
self._$container.style.paddingRight = '16px';
}
GUI.Helpers.createDroppable(this._$container, {
onOver: function(ev, el, args) {
if ( ev.target && !Utils.$hasClass(ev.target, 'Ghost') ) {
createGhost(ev.target);
}
},
onLeave : function() {
clearTimeout(removeTimeout);
removeTimeout = setTimeout(function() {
clearGhost();
}, 1000);
// clearGhost();
},
onDrop : function() {
clearGhost();
},
onItemDropped: function(ev, el, item, args) {
if ( item && item.data && item.data.mime === 'osjs/application' ) {
var appName = item.data.path.split('applications:///')[1];
self.createButton(appName);
}
clearGhost();
},
onFilesDropped: function(ev, el, files, args) {
clearGhost();
}
});
return root;
};
PanelItemButtons.prototype.clearButtons = function() {
Utils.$empty(this._$container);
};
PanelItemButtons.prototype.renderButtons = function() {
var self = this;
var systemButtons = {
applications: function(ev) {
OSjs.Applications.CoreWM.showMenu(ev);
},
settings: function(ev) {
var wm = OSjs.Core.getWindowManager();
if ( wm ) {
wm.showSettings();
}
},
exit: function(ev) {
OSjs.API.signOut();
}
};
this.clearButtons();
(this._settings.get('buttons') || []).forEach(function(btn, idx) {
var menu = [{
title: 'Remove button',
onClick: function() {
self.removeButton(idx);
}
}];
var callback = function() {
API.launch(btn.launch);
};
if ( btn.system ) {
menu = null; //systemMenu;
callback = function(ev) {
ev.stopPropagation();
systemButtons[btn.system](ev);
};
}
self.addButton(btn.title, btn.icon, menu, callback);
});
};
PanelItemButtons.prototype.removeButton = function(index) {
var buttons = this._settings.get('buttons');
buttons.splice(index, 1);
this.renderButtons();
this._settings.save();
};
PanelItemButtons.prototype.createButton = function(appName) {
var pkg = OSjs.Core.getPackageManager().getPackage(appName);
var buttons = this._settings.get('buttons');
buttons.push({
title: appName,
icon: pkg.icon,
launch: appName
});
this.renderButtons();
this._settings.save();
};
PanelItemButtons.prototype.addButton = function(title, icon, menu, callback) {
var sel = document.createElement('li');
sel.title = title;
sel.innerHTML = '<img alt="" src="' + API.getIcon(icon) + '" />';
sel.setAttribute('role', 'button');
sel.setAttribute('aria-label', title);
Utils.$bind(sel, 'mousedown', function(ev) {
ev.preventDefault();
ev.stopPropagation();
});
Utils.$bind(sel, 'click', callback, true);
Utils.$bind(sel, 'contextmenu', function(ev) {
ev.preventDefault();
ev.stopPropagation();
if ( menu ) {
API.createMenu(menu, ev);
}
});
this._$container.appendChild(sel);
};
/////////////////////////////////////////////////////////////////////////////
// EXPORTS
/////////////////////////////////////////////////////////////////////////////
OSjs.Applications = OSjs.Applications || {};
OSjs.Applications.CoreWM = OSjs.Applications.CoreWM || {};
OSjs.Applications.CoreWM.PanelItems = OSjs.Applications.CoreWM.PanelItems || {};
OSjs.Applications.CoreWM.PanelItems.Buttons = PanelItemButtons;
})(OSjs.Applications.CoreWM.Class, OSjs.Applications.CoreWM.Panel, OSjs.Applications.CoreWM.PanelItem, OSjs.Utils, OSjs.API, OSjs.GUI, OSjs.VFS);
| javascript |
{"js-data-debug.js":"sha256-Dv8AXPDL1/jewsGvRTWomfn5gzoT/kcysd6Cv1xJ78M=","js-data-debug.min.js":"sha256-bylzCh4npQ96AzNpcjYopCsXu0pliAOU+oFo2jiHs/g=","js-data.js":"sha256-HpidixFkd4OmM5Bf6ypRX+/M9wWHv4DYCRJ1xxy7L94=","js-data.min.js":"sha256-4hDcUbWOAHP+UHtGQ04MOvlFR3nuwdNsFyIMw6boC4A="} | json |
New Delhi: In the wake of the prevailing pandemic, the International Olympic Committee (IOC) has issued a set of guidelines for shooting and hockey matches in the upcoming Tokyo Games. While losing semifinalists in hockey will get another shot at Olympic gold if one of the finalist teams is forced out due to Covid, a Covid-infected team/athlete can be replaced in mixed team shooting events if tested positive for the virus before the competition.
This has been made clear in the Games’ Sport-Specific Regulations (SSR) unveiled on Sunday. The IOC developed the SSR as a contingency measure that will be put in motion in case a confirmed Covid case is reported in any sport so as to ensure smooth conduct of events.
“In hockey, teams unable to compete due to Covid will not be disqualified and will be marked as DNS (Did Not Start). In case a team in the knockout stages is no longer able to compete due to Covid, their minimum ranking achieved will be protected and, if time allows, their opponent will advance to the next round.
“Therefore, if a team is unable to participate in the final, the team that was eliminated by the Covid impacted team will be brought into the final to compete for the medal on the field of play.
“The other losing semi-finalist will be awarded the bronze medal,” the regulations developed for hockey read.
The regulations, however, did not say what could be the possible scenario if both finalist teams end up being affected by the virus. It also did not specify what happens in case Covid ends up affecting even the losing semifinalists.
Similarly for shooting, if an athlete/team is not able to compete due to Covid, they will not be disqualified and will be marked as DNS. There will be no change to the competition format or groupings, as per the IOC’s Tokyo 2020 SSR.
“For the mixed team event, in case an athlete can no longer take part in the event, but the NOC (National Olympic Committee) has another athlete on-site, the NOC can replace an athlete team member,” the IOC stated.
However, the same leeway has not been granted to the individual events in shooting, which will see 356 athletes from as many as 100 countries competing for glory in Tokyo, with the women’s 10m air rifle and 10m air pistol events drawing maximum participants.
Last month, the IOC Executive Board had underlined the three main principles to provide consistency across sports where possible while developing the guidelines.
“The minimum result of the athlete/team will be protected, considering the phase of competition at which they could not compete.
The Tokyo Olympics are scheduled to be held from July 23 to August 8 under extraordinary circumstances owing to the raging pandemic.
The Games were turned into a ‘TV-only event’ after the Japanese government barred spectators inside venues following the imposition of an emergency to control the spread of the deadly virus. | english |
<gh_stars>0
package com.cyl.musiclake.player;
import android.annotation.SuppressLint;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothHeadset;
import android.bluetooth.BluetoothProfile;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.media.AudioManager;
import android.media.audiofx.AudioEffect;
import android.os.Build;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.IBinder;
import android.os.Looper;
import android.os.Message;
import android.os.PowerManager;
import android.support.v4.media.session.PlaybackStateCompat;
import android.telephony.PhoneStateListener;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.core.app.NotificationCompat;
import androidx.media.session.MediaButtonReceiver;
import com.cyl.musiclake.R;
import com.cyl.musiclake.api.music.MusicApi;
import com.cyl.musiclake.api.net.ApiManager;
import com.cyl.musiclake.api.net.RequestCallBack;
import com.cyl.musiclake.bean.Music;
import com.cyl.musiclake.data.PlayHistoryLoader;
import com.cyl.musiclake.data.PlayQueueLoader;
import com.cyl.musiclake.common.Constants;
import com.cyl.musiclake.common.Extras;
import com.cyl.musiclake.event.MetaChangedEvent;
import com.cyl.musiclake.event.PlaylistEvent;
import com.cyl.musiclake.event.StatusChangedEvent;
import com.cyl.musiclake.player.playback.PlayProgressListener;
import com.cyl.musiclake.player.playqueue.PlayQueueManager;
import com.cyl.musiclake.ui.music.playpage.PlayerActivity;
import com.cyl.musiclake.ui.widget.appwidgets.StandardWidget;
import com.cyl.musiclake.utils.CoverLoader;
import com.cyl.musiclake.utils.FileUtils;
import com.cyl.musiclake.utils.LogUtil;
import com.cyl.musiclake.utils.NetworkUtils;
import com.cyl.musiclake.utils.SPUtils;
import com.cyl.musiclake.utils.SystemUtils;
import com.cyl.musiclake.utils.ToastUtils;
import org.greenrobot.eventbus.EventBus;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Random;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.TimeUnit;
import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
public class MusicPlayerService extends Service {
private static final String TAG = "MusicPlayerService";
public static final String ACTION_SERVICE = "com.cyl.music_lake.service";// 广播标志
// 通知栏
public static final String ACTION_NEXT = "com.cyl.music_lake.notify.next";// 下一首广播标志
public static final String ACTION_PREV = "com.cyl.music_lake.notify.prev";// 上一首广播标志
public static final String ACTION_PLAY_PAUSE = "com.cyl.music_lake.notify.play_state";// 播放暂停广播
public static final String ACTION_CLOSE = "com.cyl.music_lake.notify.close";// 播放暂停广播
public static final String ACTION_IS_WIDGET = "ACTION_IS_WIDGET";// 播放暂停广播
public static final String ACTION_LYRIC = "com.cyl.music_lake.notify.lyric";// 播放暂停广播
public static final String PLAY_STATE_CHANGED = "com.cyl.music_lake.play_state";// 播放暂停广播
public static final String PLAY_STATE_LOADING_CHANGED = "com.cyl.music_lake.play_state_loading";// 播放loading
public static final String DURATION_CHANGED = "com.cyl.music_lake.duration";// 播放时长
public static final String TRACK_ERROR = "com.cyl.music_lake.error";
public static final String SHUTDOWN = "com.cyl.music_lake.shutdown";
public static final String REFRESH = "com.cyl.music_lake.refresh";
public static final String PLAY_QUEUE_CLEAR = "com.cyl.music_lake.play_queue_clear"; //清空播放队列
public static final String PLAY_QUEUE_CHANGE = "com.cyl.music_lake.play_queue_change"; //播放队列改变
public static final String META_CHANGED = "com.cyl.music_lake.metachanged";//状态改变(歌曲替换)
public static final String SCHEDULE_CHANGED = "com.cyl.music_lake.schedule";//定时广播
public static final String CMD_TOGGLE_PAUSE = "toggle_pause";//按键播放暂停
public static final String CMD_NEXT = "next";//按键下一首
public static final String CMD_PREVIOUS = "previous";//按键上一首
public static final String CMD_PAUSE = "pause";//按键暂停
public static final String CMD_PLAY = "play";//按键播放
public static final String CMD_STOP = "stop";//按键停止
public static final String CMD_FORWARD = "forward";//按键停止
public static final String CMD_REWIND = "reward";//按键停止
public static final String SERVICE_CMD = "cmd_service";//状态改变
public static final String FROM_MEDIA_BUTTON = "media";//状态改变
public static final String CMD_NAME = "name";//状态改变
public static final String UNLOCK_DESKTOP_LYRIC = "unlock_lyric"; //音量改变增加
public static final int TRACK_WENT_TO_NEXT = 2; //下一首
public static final int RELEASE_WAKELOCK = 3; //播放完成
public static final int TRACK_PLAY_ENDED = 4; //播放完成
public static final int TRACK_PLAY_ERROR = 5; //播放出错
public static final int PREPARE_ASYNC_UPDATE = 7; //PrepareAsync装载进程
public static final int PLAYER_PREPARED = 8; //mediaplayer准备完成
public static final int AUDIO_FOCUS_CHANGE = 12; //音频焦点改变
public static final int VOLUME_FADE_DOWN = 13; //音量改变减少
public static final int VOLUME_FADE_UP = 14; //音量改变增加
private final int NOTIFICATION_ID = 0x123;
private long mNotificationPostTime = 0;
private int mServiceStartId = -1;
/**
* 错误次数,超过最大错误次数,自动停止播放
*/
private int playErrorTimes = 0;
private int MAX_ERROR_TIMES = 1;
private static final boolean DEBUG = true;
private MusicPlayerEngine mPlayer = null;
public PowerManager.WakeLock mWakeLock;
private PowerManager powerManager;
public Music mPlayingMusic = null;
private List<Music> mPlayQueue = new ArrayList<>();
private List<Integer> mHistoryPos = new ArrayList<>();
private int mPlayingPos = -1;
private int mNextPlayPos = -1;
private String mPlaylistId = Constants.PLAYLIST_QUEUE_ID;
//广播接收者
ServiceReceiver mServiceReceiver;
HeadsetReceiver mHeadsetReceiver;
StandardWidget mStandardWidget;
HeadsetPlugInReceiver mHeadsetPlugInReceiver;
IntentFilter intentFilter;
private FloatLyricViewManager mFloatLyricViewManager;
private MediaSessionManager mediaSessionManager;
private AudioAndFocusManager audioAndFocusManager;
private NotificationManager mNotificationManager;
private NotificationCompat.Builder mNotificationBuilder;
private Notification mNotification;
private IMusicServiceStub mBindStub = new IMusicServiceStub(this);
private boolean isRunningForeground = false;
private boolean isMusicPlaying = false;
//暂时失去焦点,会再次回去音频焦点
private boolean mPausedByTransientLossOfFocus = false;
//播放缓存进度
private int percent = 0;
boolean mServiceInUse = false;
//工作线程和Handler
private MusicPlayerHandler mHandler;
private HandlerThread mWorkThread;
//主线程Handler
private Handler mMainHandler;
private boolean showLyric;
private static MusicPlayerService instance;
//歌词定时器
private Timer lyricTimer;
public static MusicPlayerService getInstance() {
return instance;
}
private static List<PlayProgressListener> listenerList = new ArrayList<>();
public static void addProgressListener(PlayProgressListener listener) {
listenerList.add(listener);
}
public static void removeProgressListener(PlayProgressListener listener) {
listenerList.remove(listener);
}
private Disposable disposable = Observable
.interval(500, TimeUnit.MILLISECONDS)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(v -> {
for (int i = 0; i < listenerList.size(); i++) {
listenerList.get(i).onProgressUpdate(getCurrentPosition(), getDuration());
}
});
public class MusicPlayerHandler extends Handler {
private final WeakReference<MusicPlayerService> mService;
private float mCurrentVolume = 1.0f;
public MusicPlayerHandler(final MusicPlayerService service, final Looper looper) {
super(looper);
mService = new WeakReference<>(service);
}
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
MusicPlayerService service = mService.get();
synchronized (mService) {
switch (msg.what) {
case VOLUME_FADE_DOWN:
mCurrentVolume -= 0.05f;
if (mCurrentVolume > 0.2f) {
sendEmptyMessageDelayed(VOLUME_FADE_DOWN, 10);
} else {
mCurrentVolume = 0.2f;
}
service.mPlayer.setVolume(mCurrentVolume);
break;
case VOLUME_FADE_UP:
mCurrentVolume += 0.01f;
if (mCurrentVolume < 1.0f) {
sendEmptyMessageDelayed(VOLUME_FADE_UP, 10);
} else {
mCurrentVolume = 1.0f;
}
service.mPlayer.setVolume(mCurrentVolume);
break;
case TRACK_WENT_TO_NEXT: //mplayer播放完毕切换到下一首
// service.setAndRecordPlayPos(service.mNextPlayPos);
mMainHandler.post(() -> service.next(true));
// service.updateCursor(service.mPlayQueue.get(service.mPlayPos).mId);
// service.bumpSongCount(); //更新歌曲的播放次数
break;
case TRACK_PLAY_ENDED://mPlayer播放完毕且暂时没有下一首
if (PlayQueueManager.INSTANCE.getPlayModeId() == PlayQueueManager.PLAY_MODE_REPEAT) {
service.seekTo(0, false);
mMainHandler.post(service::play);
} else {
mMainHandler.post(() -> service.next(true));
}
break;
case TRACK_PLAY_ERROR://mPlayer播放错误
LogUtil.e(TAG, "TRACK_PLAY_ERROR " + msg.obj + "---");
ToastUtils.show("Song play address is abnormal, please switch other songs");
playErrorTimes++;
if (playErrorTimes < MAX_ERROR_TIMES) {
mMainHandler.post(() -> service.next(true));
} else {
mMainHandler.post(service::pause);
}
break;
case RELEASE_WAKELOCK://释放电源锁
service.mWakeLock.release();
break;
case PREPARE_ASYNC_UPDATE:
percent = (int) msg.obj;
LogUtil.e(TAG, "PREPARE_ASYNC_UPDATE Loading ... " + percent);
notifyChange(PLAY_STATE_LOADING_CHANGED);
break;
case PLAYER_PREPARED:
//执行prepared之后 准备完成,更新总时长
//准备完成,可以播放
LogUtil.e(TAG, "PLAYER_PREPARED");
isMusicPlaying = true;
updateNotification(false);
notifyChange(PLAY_STATE_CHANGED);
break;
case AUDIO_FOCUS_CHANGE:
switch (msg.arg1) {
case AudioManager.AUDIOFOCUS_LOSS://失去音频焦点
case AudioManager.AUDIOFOCUS_LOSS_TRANSIENT://暂时失去焦点
if (service.isPlaying()) {
mPausedByTransientLossOfFocus =
msg.arg1 == AudioManager.AUDIOFOCUS_LOSS_TRANSIENT;
}
mMainHandler.post(service::pause);
break;
case AudioManager.AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK:
removeMessages(VOLUME_FADE_UP);
sendEmptyMessage(VOLUME_FADE_DOWN);
break;
case AudioManager.AUDIOFOCUS_GAIN://重新获取焦点
//重新获得焦点,且符合播放条件,开始播放
if (!service.isPlaying()
&& mPausedByTransientLossOfFocus) {
mPausedByTransientLossOfFocus = false;
mCurrentVolume = 0f;
service.mPlayer.setVolume(mCurrentVolume);
mMainHandler.post(service::play);
} else {
removeMessages(VOLUME_FADE_DOWN);
sendEmptyMessage(VOLUME_FADE_UP);
}
break;
default:
}
break;
}
}
}
}
@Override
public void onCreate() {
super.onCreate();
LogUtil.e(TAG, "onCreate");
instance = this;
//初始化广播
initReceiver();
//初始化参数
initConfig();
//初始化电话监听服务
initTelephony();
//初始化通知
initNotify();
//初始化音乐播放服务
initMediaPlayer();
}
/**
* 参数配置,AudioManager、锁屏
*/
@SuppressLint("InvalidWakeLockTag")
private void initConfig() {
//初始化主线程Handler
mMainHandler = new Handler(Looper.getMainLooper());
PlayQueueManager.INSTANCE.getPlayModeId();
//初始化工作线程
mWorkThread = new HandlerThread("MusicPlayerThread");
mWorkThread.start();
mHandler = new MusicPlayerHandler(this, mWorkThread.getLooper());
//电源键
powerManager = (PowerManager) getSystemService(POWER_SERVICE);
mWakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "PlayerWakelockTag");
mFloatLyricViewManager = new FloatLyricViewManager(this);
//初始化和设置MediaSessionCompat
mediaSessionManager = new MediaSessionManager(mBindStub, this, mMainHandler);
audioAndFocusManager = new AudioAndFocusManager(this, mHandler);
}
/**
* 释放通知栏;
*/
private void releaseServiceUiAndStop() {
if (isPlaying() || mHandler.hasMessages(TRACK_PLAY_ENDED)) {
return;
}
if (DEBUG) LogUtil.d(TAG, "Nothing is playing anymore, releasing notification");
cancelNotification();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
mediaSessionManager.release();
if (!mServiceInUse) {
savePlayQueue(false);
stopSelf(mServiceStartId);
}
}
/**
* 重新加载当前进度
*/
public void reloadPlayQueue() {
mPlayQueue.clear();
mHistoryPos.clear();
mPlayQueue = PlayQueueLoader.INSTANCE.getPlayQueue();
mPlayingPos = SPUtils.getPlayPosition();
if (mPlayingPos >= 0 && mPlayingPos < mPlayQueue.size()) {
mPlayingMusic = mPlayQueue.get(mPlayingPos);
updateNotification(true);
seekTo(SPUtils.getPosition(), true);
notifyChange(META_CHANGED);
}
notifyChange(PLAY_QUEUE_CHANGE);
}
/**
* 初始化电话监听服务
*/
private void initTelephony() {
TelephonyManager telephonyManager = (TelephonyManager) this
.getSystemService(Context.TELEPHONY_SERVICE);// 获取电话通讯服务
telephonyManager.listen(new ServicePhoneStateListener(),
PhoneStateListener.LISTEN_CALL_STATE);// 创建一个监听对象,监听电话状态改变事件
}
/**
* 初始化音乐播放服务
*/
private void initMediaPlayer() {
mPlayer = new MusicPlayerEngine(this);
mPlayer.setHandler(mHandler);
reloadPlayQueue();
}
/**
* 初始化广播
*/
private void initReceiver() {
//实例化过滤器,设置广播
intentFilter = new IntentFilter(ACTION_SERVICE);
mServiceReceiver = new ServiceReceiver();
mHeadsetReceiver = new HeadsetReceiver();
mStandardWidget = new StandardWidget();
mHeadsetPlugInReceiver = new HeadsetPlugInReceiver();
intentFilter.addAction(ACTION_NEXT);
intentFilter.addAction(ACTION_PREV);
intentFilter.addAction(META_CHANGED);
intentFilter.addAction(SHUTDOWN);
intentFilter.addAction(ACTION_PLAY_PAUSE);
//注册广播
registerReceiver(mServiceReceiver, intentFilter);
registerReceiver(mHeadsetReceiver, intentFilter);
registerReceiver(mHeadsetPlugInReceiver, intentFilter);
registerReceiver(mStandardWidget, intentFilter);
}
/**
* 启动Service服务,执行onStartCommand
*
* @param intent
* @param flags
* @param startId
* @return
*/
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
LogUtil.d(TAG, "Got new intent " + intent + ", startId = " + startId);
mServiceStartId = startId;
mServiceInUse = true;
if (intent != null) {
final String action = intent.getAction();
if (SHUTDOWN.equals(action)) {
LogUtil.e("Music player is about to close");
// mShutdownScheduled = true;
releaseServiceUiAndStop();
return START_NOT_STICKY;
}
handleCommandIntent(intent);
}
return START_NOT_STICKY;
}
/**
* 绑定Service
*
* @param intent
* @return
*/
@Nullable
@Override
public IBinder onBind(Intent intent) {
return mBindStub;
}
private void setAndRecordPlayPos(int mNextPlayPos) {
mPlayingPos = mNextPlayPos;
}
/**
* 下一首
*/
public void next(Boolean isAuto) {
synchronized (this) {
mPlayingPos = PlayQueueManager.INSTANCE.getNextPosition(isAuto, mPlayQueue.size(), mPlayingPos);
LogUtil.e(TAG, "next: " + mPlayingPos);
stop(false);
playCurrentAndNext();
}
}
/**
* 上一首
*/
public void prev() {
synchronized (this) {
// if (!NetworkUtils.isNetworkAvailable(this)) {
// ToastUtils.show("网络不可用,请检查网络连接");
// return;
// }
mPlayingPos = PlayQueueManager.INSTANCE.getPreviousPosition(mPlayQueue.size(), mPlayingPos);
LogUtil.e(TAG, "prev: " + mPlayingPos);
stop(false);
playCurrentAndNext();
}
}
/**
* 播放当前歌曲
*/
private void playCurrentAndNext() {
synchronized (this) {
if (mPlayingPos >= mPlayQueue.size() || mPlayingPos < 0) {
return;
}
mPlayingMusic = mPlayQueue.get(mPlayingPos);
//更新当前歌曲
notifyChange(META_CHANGED);
updateNotification(true);
//更新播放播放状态
isMusicPlaying = false;
notifyChange(PLAY_STATE_CHANGED);
updateNotification(false);
LogUtil.e(TAG, "playingSongInfo:" + mPlayingMusic.toString());
if (mPlayingMusic.getUri() == null || !Objects.equals(mPlayingMusic.getType(), Constants.LOCAL) || mPlayingMusic.getUri().equals("") || mPlayingMusic.getUri().equals("null")) {
if (!NetworkUtils.isNetworkAvailable(this)) {
ToastUtils.show("The network is unavailable, please check the network connection");
} else {
ApiManager.request(MusicApi.INSTANCE.getMusicInfo(mPlayingMusic), new RequestCallBack<Music>() {
@Override
public void success(Music result) {
LogUtil.e(TAG, "-----" + result.toString());
mPlayingMusic = result;
saveHistory();
playErrorTimes = 0;
mPlayer.setDataSource(mPlayingMusic.getUri());
}
@Override
public void error(String msg) {
LogUtil.e(TAG, "Play abnormally-----" + msg);
checkPlayErrorTimes();
}
});
}
}
saveHistory();
mHistoryPos.add(mPlayingPos);
if (mPlayingMusic.getUri() != null) {
if (!mPlayingMusic.getUri().startsWith(Constants.IS_URL_HEADER) && !FileUtils.exists(mPlayingMusic.getUri())) {
checkPlayErrorTimes();
} else {
playErrorTimes = 0;
mPlayer.setDataSource(mPlayingMusic.getUri());
}
}
mediaSessionManager.updateMetaData(mPlayingMusic);
audioAndFocusManager.requestAudioFocus();
final Intent intent = new Intent(AudioEffect.ACTION_OPEN_AUDIO_EFFECT_CONTROL_SESSION);
intent.putExtra(AudioEffect.EXTRA_AUDIO_SESSION, getAudioSessionId());
intent.putExtra(AudioEffect.EXTRA_PACKAGE_NAME, getPackageName());
sendBroadcast(intent);
if (mPlayer.isInitialized()) {
mHandler.removeMessages(VOLUME_FADE_DOWN);
mHandler.sendEmptyMessage(VOLUME_FADE_UP); //组件调到正常音量
// isMusicPlaying = true;
// notifyChange(PLAY_STATE_CHANGED);
}
}
}
/**
* 异常播放,自动切换下一首
*/
private void checkPlayErrorTimes() {
if (playErrorTimes > MAX_ERROR_TIMES) {
pause();
} else {
playErrorTimes++;
ToastUtils.show("Play address is abnormal, automatically switch to the next song");
next(false);
}
}
/**
* 停止播放
*
* @param remove_status_icon
*/
public void stop(boolean remove_status_icon) {
if (mPlayer != null && mPlayer.isInitialized()) {
mPlayer.stop();
}
if (remove_status_icon) {
cancelNotification();
}
if (remove_status_icon) {
isMusicPlaying = false;
}
}
/**
* 获取下一首位置
*
* @return
*/
private int getNextPosition(Boolean isAuto) {
int playModeId = PlayQueueManager.INSTANCE.getPlayModeId();
if (mPlayQueue == null || mPlayQueue.isEmpty()) {
return -1;
}
if (mPlayQueue.size() == 1) {
return 0;
}
if (playModeId == PlayQueueManager.PLAY_MODE_REPEAT && isAuto) {
if (mPlayingPos < 0) {
return 0;
} else {
return mPlayingPos;
}
} else if (playModeId == PlayQueueManager.PLAY_MODE_RANDOM) {
return new Random().nextInt(mPlayQueue.size());
} else {
if (mPlayingPos == mPlayQueue.size() - 1) {
return 0;
} else if (mPlayingPos < mPlayQueue.size() - 1) {
return mPlayingPos + 1;
}
}
return mPlayingPos;
}
/**
* 获取上一首位置
*
* @return
*/
private int getPreviousPosition() {
int playModeId = PlayQueueManager.INSTANCE.getPlayModeId();
if (mPlayQueue == null || mPlayQueue.isEmpty()) {
return -1;
}
if (mPlayQueue.size() == 1) {
return 0;
}
if (playModeId == PlayQueueManager.PLAY_MODE_REPEAT) {
if (mPlayingPos < 0) {
return 0;
}
} else if (playModeId == PlayQueueManager.PLAY_MODE_RANDOM) {
mPlayingPos = new Random().nextInt(mPlayQueue.size());
return new Random().nextInt(mPlayQueue.size());
} else {
if (mPlayingPos == 0) {
return mPlayQueue.size() - 1;
} else if (mPlayingPos > 0) {
return mPlayingPos - 1;
}
}
return mPlayingPos;
}
/**
* 根据位置播放音乐
*
* @param position
*/
public void playMusic(int position) {
if (position >= mPlayQueue.size() || position == -1) {
mPlayingPos = PlayQueueManager.INSTANCE.getNextPosition(true, mPlayQueue.size(), position);
} else {
mPlayingPos = position;
}
if (mPlayingPos == -1)
return;
playCurrentAndNext();
}
/**
* 音乐播放
*/
public void play() {
if (mPlayer.isInitialized()) {
mPlayer.start();
isMusicPlaying = true;
notifyChange(PLAY_STATE_CHANGED);
audioAndFocusManager.requestAudioFocus();
mHandler.removeMessages(VOLUME_FADE_DOWN);
mHandler.sendEmptyMessage(VOLUME_FADE_UP); //组件调到正常音量
updateNotification(false);
} else {
playCurrentAndNext();
}
}
public int getAudioSessionId() {
synchronized (this) {
return mPlayer.getAudioSessionId();
}
}
/**
* 【在线音乐,搜索的音乐】加入播放队列并播放音乐
*
* @param music
*/
public void play(Music music) {
if (music == null) return;
if (mPlayingPos == -1 || mPlayQueue.size() == 0) {
mPlayQueue.add(music);
mPlayingPos = 0;
} else if (mPlayingPos < mPlayQueue.size()) {
mPlayQueue.add(mPlayingPos, music);
} else {
mPlayQueue.add(mPlayQueue.size(), music);
}
//发送播放列表改变
notifyChange(PLAY_QUEUE_CHANGE);
LogUtil.e(TAG, music.toString());
mPlayingMusic = music;
playCurrentAndNext();
}
/**
* 下一首播放
*
* @param music 设置的歌曲
*/
public void nextPlay(Music music) {
if (mPlayQueue.size() == 0) {
play(music);
} else if (mPlayingPos < mPlayQueue.size()) {
mPlayQueue.add(mPlayingPos + 1, music);
//发送播放列表改变
notifyChange(PLAY_QUEUE_CHANGE);
}
}
/**
* 切换歌单播放
* 1、歌单不一样切换,不一样不切换
* 2、相同歌单只切换歌曲
* 3、相同歌曲不重新播放
*
* @param musicList 歌单
* @param id 歌曲位置id
* @param pid 歌单id
*/
public void play(List<Music> musicList, int id, String pid) {
LogUtil.d(TAG, "musicList = " + musicList.size() + " id = " + id + " pid = " + pid + " mPlaylistId =" + mPlaylistId);
if (musicList.size() <= id) return;
if (mPlaylistId.equals(pid) && id == mPlayingPos) return;
if (!mPlaylistId.equals(pid) || mPlayQueue.size() == 0 || mPlayQueue.size() != musicList.size()) {
setPlayQueue(musicList);
mPlaylistId = pid;
}
mPlayingPos = id;
playCurrentAndNext();
}
/**
* 播放暂停
*/
public void playPause() {
if (isPlaying()) {
pause();
} else {
if (mPlayer.isInitialized()) {
play();
} else {
playCurrentAndNext();
}
}
}
/**
* 暂停播放
*/
public void pause() {
if (DEBUG) LogUtil.d(TAG, "Pausing playback");
synchronized (this) {
mHandler.removeMessages(VOLUME_FADE_UP);
mHandler.sendEmptyMessage(VOLUME_FADE_DOWN);
if (isPlaying()) {
isMusicPlaying = false;
notifyChange(PLAY_STATE_CHANGED);
updateNotification(false);
TimerTask task = new TimerTask() {
public void run() {
final Intent intent = new Intent(
AudioEffect.ACTION_CLOSE_AUDIO_EFFECT_CONTROL_SESSION);
intent.putExtra(AudioEffect.EXTRA_AUDIO_SESSION, getAudioSessionId());
intent.putExtra(AudioEffect.EXTRA_PACKAGE_NAME, getPackageName());
sendBroadcast(intent); //由系统接收,通知系统audio_session将关闭,不再使用音效
mPlayer.pause();
}
};
Timer timer = new Timer();
timer.schedule(task, 200);
}
}
}
/**
* 是否正在播放音乐
*
* @return 是否正在播放音乐
*/
public boolean isPlaying() {
return isMusicPlaying;
}
/**
* 跳到输入的进度
*/
public void seekTo(long pos, boolean isInit) {
LogUtil.e(TAG, "seekTo " + pos);
if (mPlayer != null && mPlayer.isInitialized() && mPlayingMusic != null) {
mPlayer.seek(pos);
LogUtil.e(TAG, "seekTo success");
} else if (isInit) {
// playCurrentAndNext();
// mPlayer.seek(pos);
// mPlayer.pause();
LogUtil.e(TAG, "seekTo failure");
}
}
@Override
public boolean onUnbind(Intent intent) {
LogUtil.e(TAG, "onUnbind");
mServiceInUse = false;
savePlayQueue(false);
releaseServiceUiAndStop();
stopSelf(mServiceStartId);
return true;
}
/**
* 保存播放队列
*
* @param full 是否存储
*/
private void savePlayQueue(boolean full) {
if (full) {
PlayQueueLoader.INSTANCE.updateQueue(mPlayQueue);
}
if (mPlayingMusic != null) {
//保存歌曲id
SPUtils.saveCurrentSongId(mPlayingMusic.getMid());
}
//保存歌曲id
SPUtils.setPlayPosition(mPlayingPos);
//保存歌曲进度
SPUtils.savePosition(getCurrentPosition());
LogUtil.e(TAG, "Save song id=" + mPlayingPos + " Song progress= " + getCurrentPosition());
}
private void saveHistory() {
PlayHistoryLoader.INSTANCE.addSongToHistory(mPlayingMusic);
savePlayQueue(false);
}
/**
* 获取正在播放的歌曲[本地|网络]
*/
public void removeFromQueue(int position) {
try {
LogUtil.e(TAG, position + "---" + mPlayingPos + "---" + mPlayQueue.size());
if (position == mPlayingPos) {
mPlayQueue.remove(position);
if (mPlayQueue.size() == 0) {
clearQueue();
} else {
playMusic(position);
}
} else if (position > mPlayingPos) {
mPlayQueue.remove(position);
} else if (position < mPlayingPos) {
mPlayQueue.remove(position);
mPlayingPos = mPlayingPos - 1;
}
notifyChange(PLAY_QUEUE_CLEAR);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 获取正在播放的歌曲[本地|网络]
*/
public void clearQueue() {
mPlayingMusic = null;
isMusicPlaying = false;
mPlayingPos = -1;
mPlayQueue.clear();
mHistoryPos.clear();
savePlayQueue(true);
stop(true);
notifyChange(META_CHANGED);
notifyChange(PLAY_STATE_CHANGED);
notifyChange(PLAY_QUEUE_CLEAR);
}
/**
* 获取正在播放进度
*/
public long getCurrentPosition() {
if (mPlayer != null && mPlayer.isInitialized()) {
return mPlayer.position();
} else {
return 0;
}
}
/**
* 获取总时长
*/
public long getDuration() {
if (mPlayer != null && mPlayer.isInitialized() && mPlayer.isPrepared()) {
return mPlayer.duration();
}
return 0;
}
/**
* 是否准备播放
*
* @return
*/
public boolean isPrepared() {
if (mPlayer != null) {
return mPlayer.isPrepared();
}
return false;
}
/**
* 发送更新广播
*
* @param what 发送更新广播
*/
private void notifyChange(final String what) {
if (DEBUG) LogUtil.d(TAG, "notifyChange: what = " + what);
switch (what) {
case META_CHANGED:
mFloatLyricViewManager.loadLyric(mPlayingMusic);
updateWidget(META_CHANGED);
// notifyChange(PLAY_STATE_CHANGED);
EventBus.getDefault().post(new MetaChangedEvent(mPlayingMusic));
break;
case PLAY_STATE_CHANGED:
updateWidget(ACTION_PLAY_PAUSE);
mediaSessionManager.updatePlaybackState();
EventBus.getDefault().post(new StatusChangedEvent(isPrepared(), isPlaying(), percent * getDuration()));
break;
case PLAY_QUEUE_CLEAR:
case PLAY_QUEUE_CHANGE:
EventBus.getDefault().post(new PlaylistEvent(Constants.PLAYLIST_QUEUE_ID, null));
break;
case PLAY_STATE_LOADING_CHANGED:
//播放loading
EventBus.getDefault().post(new StatusChangedEvent(isPrepared(), isPlaying(), percent * getDuration()));
break;
}
}
/**
* 更新桌面小控件
*/
private void updateWidget(String action) {
Intent intent = new Intent(action);
intent.putExtra(ACTION_IS_WIDGET, true);
intent.putExtra(Extras.PLAY_STATUS, isPlaying());
if (action.equals(META_CHANGED)) {
intent.putExtra(Extras.SONG, mPlayingMusic);
}
sendBroadcast(intent);
}
/**
* 获取标题
*
* @return
*/
public String getTitle() {
if (mPlayingMusic != null) {
return mPlayingMusic.getTitle();
}
return null;
}
/**
* 获取歌手专辑
*
* @return
*/
public String getArtistName() {
if (mPlayingMusic != null) {
return mPlayingMusic.getArtist();
// return ConvertUtils.getArtistAndAlbum(mPlayingMusic.getArtist(), mPlayingMusic.getAlbum());
}
return null;
}
/**
* 获取专辑名
*
* @return
*/
private String getAlbumName() {
if (mPlayingMusic != null) {
return mPlayingMusic.getArtist();
}
return null;
}
/**
* 获取当前音乐
*
* @return
*/
public Music getPlayingMusic() {
if (mPlayingMusic != null) {
return mPlayingMusic;
}
return null;
}
/**
* 设置播放队列
*
* @param playQueue 播放队列
*/
public void setPlayQueue(List<Music> playQueue) {
mPlayQueue.clear();
mHistoryPos.clear();
mPlayQueue.addAll(playQueue);
notifyChange(PLAY_QUEUE_CHANGE);
savePlayQueue(true);
}
/**
* 获取播放队列
*
* @return 获取播放队列
*/
public List<Music> getPlayQueue() {
if (mPlayQueue.size() > 0) {
return mPlayQueue;
}
return mPlayQueue;
}
/**
* 获取当前音乐在播放队列中的位置
*
* @return 当前音乐在播放队列中的位置
*/
public int getPlayPosition() {
if (mPlayingPos >= 0) {
return mPlayingPos;
} else return 0;
}
/**
* 初始化通知栏
*/
private void initNotify() {
mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
final String albumName = getAlbumName();
final String artistName = getArtistName();
String text = TextUtils.isEmpty(albumName)
? artistName : artistName + " - " + albumName;
int playButtonResId = isMusicPlaying
? R.drawable.ic_pause : R.drawable.ic_play;
Intent nowPlayingIntent = new Intent(this, PlayerActivity.class);
nowPlayingIntent.setAction(Constants.DEAULT_NOTIFICATION);
PendingIntent clickIntent = PendingIntent.getActivity(this, 0, nowPlayingIntent, PendingIntent.FLAG_UPDATE_CURRENT);
if (mNotificationPostTime == 0) {
mNotificationPostTime = System.currentTimeMillis();
}
mNotificationBuilder = new NotificationCompat.Builder(this, initChannelId())
.setSmallIcon(R.drawable.ic_music)
.setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
.setContentIntent(clickIntent)
.setContentTitle(getTitle())
.setContentText(text)
.setWhen(mNotificationPostTime)
.addAction(playButtonResId, "",
retrievePlaybackAction(ACTION_PLAY_PAUSE))
.addAction(R.drawable.ic_skip_previous,
"",
retrievePlaybackAction(ACTION_PREV))
.addAction(R.drawable.ic_skip_next,
"",
retrievePlaybackAction(ACTION_NEXT))
.addAction(R.drawable.ic_lyric,
"",
retrievePlaybackAction(ACTION_LYRIC))
.addAction(R.drawable.ic_clear,
"",
retrievePlaybackAction(ACTION_CLOSE))
.setDeleteIntent(MediaButtonReceiver.buildMediaButtonPendingIntent(
this, PlaybackStateCompat.ACTION_STOP));
if (SystemUtils.isJellyBeanMR1()) {
mNotificationBuilder.setShowWhen(false);
}
if (SystemUtils.isLollipop()) {
//线控
isRunningForeground = true;
mNotificationBuilder.setVisibility(NotificationCompat.VISIBILITY_PUBLIC);
androidx.media.app.NotificationCompat.MediaStyle style = new androidx.media.app.NotificationCompat.MediaStyle()
.setMediaSession(mediaSessionManager.getMediaSession())
.setShowActionsInCompactView(1, 0, 2, 3, 4);
mNotificationBuilder.setStyle(style);
}
if (mPlayingMusic != null) {
CoverLoader.INSTANCE.loadImageViewByMusic(this, mPlayingMusic, bitmap -> {
mNotificationBuilder.setLargeIcon(bitmap);
mNotification = mNotificationBuilder.build();
mNotificationManager.notify(NOTIFICATION_ID, mNotification);
return null;
});
}
mNotification = mNotificationBuilder.build();
}
/**
* 创建Notification ChannelID
*
* @return 频道id
*/
private String initChannelId() {
// 通知渠道的id
String id = "music_lake_01";
// 用户可以看到的通知渠道的名字.
CharSequence name = "Music Lake";
// 用户可以看到的通知渠道的描述
String description = "Notification bar playback control";
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
int importance = NotificationManager.IMPORTANCE_LOW;
NotificationChannel mChannel;
mChannel = new NotificationChannel(id, name, importance);
mChannel.setDescription(description);
mChannel.enableLights(false);
mChannel.enableVibration(false);
//最后在notificationmanager中创建该通知渠道
mNotificationManager.createNotificationChannel(mChannel);
}
return id;
}
private PendingIntent retrievePlaybackAction(final String action) {
Intent intent = new Intent(action);
intent.setComponent(new ComponentName(this, MusicPlayerService.class));
return PendingIntent.getService(this, 0, intent, 0);
}
public String getAudioId() {
if (mPlayingMusic != null) {
return mPlayingMusic.getMid();
} else {
return null;
}
}
/**
* 显示桌面歌词
* 开个定时器定时刷新桌面歌词
*
* @param show
*/
public void showDesktopLyric(boolean show) {
if (show) {
// 开启定时器,每隔0.5秒刷新一次
if (lyricTimer == null) {
lyricTimer = new Timer();
lyricTimer.scheduleAtFixedRate(new TimerTask() {
@Override
public void run() {
if (isMusicPlaying){
//正在播放时刷新
mFloatLyricViewManager.updateLyric(getCurrentPosition(), getDuration());
}
}
}, 0, 1);
}
} else {
if (lyricTimer != null) {
lyricTimer.cancel();
lyricTimer = null;
}
mFloatLyricViewManager.removeFloatLyricView(this);
}
}
/**
* 电话监听
*/
private class ServicePhoneStateListener extends PhoneStateListener {
@Override
public void onCallStateChanged(int state, String incomingNumber) {
LogUtil.d(TAG, "TelephonyManager state=" + state + ",incomingNumber = " + incomingNumber);
switch (state) {
case TelephonyManager.CALL_STATE_OFFHOOK: //接听状态
case TelephonyManager.CALL_STATE_RINGING: //响铃状态
pause();
break;
}
}
}
/**
* 更新状态栏通知
*
* @param isChange 是否改变歌曲信息
*/
private void updateNotification(boolean isChange) {
if (isChange) {
if (mPlayingMusic != null) {
CoverLoader.INSTANCE.loadImageViewByMusic(this, mPlayingMusic, bitmap -> {
mNotificationBuilder.setLargeIcon(bitmap);
mNotification = mNotificationBuilder.build();
mNotificationManager.notify(NOTIFICATION_ID, mNotification);
return null;
});
}
mNotificationBuilder.setContentTitle(getTitle());
mNotificationBuilder.setContentText(getArtistName());
mNotificationBuilder.setTicker(getTitle() + "-" + getArtistName());
}
LogUtil.d("Playback status = " + isPlaying());
if (isMusicPlaying)
mNotificationBuilder.mActions.get(0).icon = R.drawable.ic_pause;
else
mNotificationBuilder.mActions.get(0).icon = R.drawable.ic_play;
mNotification = mNotificationBuilder.build();
mFloatLyricViewManager.updatePlayStatus(isMusicPlaying);
if (mPlayingMusic != null) {
startForeground(NOTIFICATION_ID, mNotification);
mNotificationManager.notify(NOTIFICATION_ID, mNotification);
}
}
/**
* 取消通知
*/
private void cancelNotification() {
stopForeground(true);
mNotificationManager.cancel(NOTIFICATION_ID);
isRunningForeground = false;
}
/**
* Service broadcastReceiver 监听service中广播
*/
private class ServiceReceiver extends BroadcastReceiver {
// public ServiceReceiver() {
// intentFilter.addAction(Intent.ACTION_SCREEN_OFF);
// }
@Override
public void onReceive(Context context, Intent intent) {
LogUtil.d(TAG, intent.getAction());
// if (intent.getAction() != null && intent.getAction().equals(Intent.ACTION_SCREEN_OFF)) {
// LogUtil.e(TAG, "屏幕熄灭进入锁屏界面");
// Intent lockScreen = new Intent(MusicPlayerService.this, LockScreenPlayerActivity.class);
// lockScreen.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// startActivity(lockScreen);
// }
if (!intent.getBooleanExtra(ACTION_IS_WIDGET, false)) {
handleCommandIntent(intent);
}
}
}
/**
* Intent处理
*
* @param intent
*/
private void handleCommandIntent(Intent intent) {
final String action = intent.getAction();
final String command = SERVICE_CMD.equals(action) ? intent.getStringExtra(CMD_NAME) : null;
if (DEBUG)
LogUtil.d(TAG, "handleCommandIntent: action = " + action + ", command = " + command);
if (CMD_NEXT.equals(command) || ACTION_NEXT.equals(action)) {
next(false);
} else if (CMD_PREVIOUS.equals(command) || ACTION_PREV.equals(action)) {
prev();
} else if (CMD_TOGGLE_PAUSE.equals(command) || PLAY_STATE_CHANGED.equals(action)
|| ACTION_PLAY_PAUSE.equals(action)) {
if (isPlaying()) {
pause();
mPausedByTransientLossOfFocus = false;
} else {
play();
}
} else if (UNLOCK_DESKTOP_LYRIC.equals(command)) {
mFloatLyricViewManager.saveLock(false, true);
} else if (CMD_PAUSE.equals(command)) {
pause();
mPausedByTransientLossOfFocus = false;
} else if (CMD_PLAY.equals(command)) {
play();
} else if (CMD_STOP.equals(command)) {
pause();
mPausedByTransientLossOfFocus = false;
seekTo(0, false);
releaseServiceUiAndStop();
} else if (ACTION_LYRIC.equals(action)) {
startFloatLyric();
} else if (ACTION_CLOSE.equals(action)) {
stop(true);
stopSelf();
releaseServiceUiAndStop();
System.exit(0);
}
}
/**
* 开启歌词
*/
private void startFloatLyric() {
if (SystemUtils.isOpenFloatWindow()) {
showLyric = !showLyric;
SPUtils.putAnyCommit(SPUtils.SP_KEY_FLOAT_LYRIC_LOCK, false);
showDesktopLyric(showLyric);
} else {
SystemUtils.applySystemWindow();
}
}
/**
* 耳机插入广播接收器
*/
public class HeadsetPlugInReceiver extends BroadcastReceiver {
public HeadsetPlugInReceiver() {
if (Build.VERSION.SDK_INT >= 21) {
intentFilter.addAction(AudioManager.ACTION_HEADSET_PLUG);
} else {
intentFilter.addAction(Intent.ACTION_HEADSET_PLUG);
}
}
@Override
public void onReceive(Context context, Intent intent) {
if (intent != null && intent.hasExtra("state")) {
//通过判断 "state" 来知道状态
final boolean isPlugIn = intent.getExtras().getInt("state") == 1;
LogUtil.e(TAG, "Headphone plugged in :" + isPlugIn);
}
}
}
/**
* 耳机拔出广播接收器
*/
private class HeadsetReceiver extends BroadcastReceiver {
final BluetoothAdapter bluetoothAdapter;
public HeadsetReceiver() {
intentFilter.addAction(AudioManager.ACTION_AUDIO_BECOMING_NOISY); //有线耳机拔出变化
intentFilter.addAction(BluetoothHeadset.ACTION_CONNECTION_STATE_CHANGED); //蓝牙耳机连接变化
bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
}
@Override
public void onReceive(Context context, Intent intent) {
if (isRunningForeground) {
//当前是正在运行的时候才能通过媒体按键来操作音频
switch (intent.getAction()) {
case BluetoothHeadset.ACTION_CONNECTION_STATE_CHANGED:
LogUtil.e("Bluetooth headset plug-in status changed");
if (bluetoothAdapter != null &&
BluetoothProfile.STATE_DISCONNECTED == bluetoothAdapter.getProfileConnectionState(BluetoothProfile.HEADSET) &&
isPlaying()) {
//蓝牙耳机断开连接 同时当前音乐正在播放 则将其暂停
pause();
}
break;
case AudioManager.ACTION_AUDIO_BECOMING_NOISY:
LogUtil.e("Wired headset plug-in status changed");
if (isPlaying()) {
//有线耳机断开连接 同时当前音乐正在播放 则将其暂停
pause();
}
break;
}
}
}
}
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR2)
@Override
public void onDestroy() {
super.onDestroy();
LogUtil.e(TAG, "onDestroy");
disposable.dispose();
// Remove any sound effects
final Intent audioEffectsIntent = new Intent(
AudioEffect.ACTION_CLOSE_AUDIO_EFFECT_CONTROL_SESSION);
audioEffectsIntent.putExtra(AudioEffect.EXTRA_AUDIO_SESSION, getAudioSessionId());
audioEffectsIntent.putExtra(AudioEffect.EXTRA_PACKAGE_NAME, getPackageName());
sendBroadcast(audioEffectsIntent);
savePlayQueue(false);
//释放mPlayer
if (mPlayer != null) {
mPlayer.stop();
isMusicPlaying = false;
mPlayer.release();
mPlayer = null;
}
// 释放Handler资源
if (mHandler != null) {
mHandler.removeCallbacksAndMessages(null);
mHandler = null;
}
// 释放工作线程资源
if (mWorkThread != null && mWorkThread.isAlive()) {
mWorkThread.quitSafely();
mWorkThread.interrupt();
mWorkThread = null;
}
audioAndFocusManager.abandonAudioFocus();
cancelNotification();
//注销广播
unregisterReceiver(mServiceReceiver);
unregisterReceiver(mHeadsetReceiver);
unregisterReceiver(mHeadsetPlugInReceiver);
unregisterReceiver(mStandardWidget);
if (mWakeLock.isHeld())
mWakeLock.release();
}
}
| java |
{"id": "<KEY>", "title": "New Rule: No Dao issue discussion in graveyard (general chat)", "body": "We should keep all voting and dao decision discussions to The Horde Lounge to avoid toxicity and also keep our plans private. Discussing major changes to a project in the general chat can create FUD for potential new members. \n\nProposals for new votes, ideas for marketing, changes to governance or mint should all be reserved to holder channels. Discussion of general existence of DAO and how it works should be discussed everywhere.", "choices": ["Yes", "No"], "start": 1635012000, "end": 1635030000, "snapshot": "13473955", "state": "closed", "author": "0xd<PASSWORD>", "space": {"id": "zombiezdao.eth", "name": "<NAME>"}, "votes": 17, "votes_data": [{"id": "Qmes4Eki4kQ2nj13a8atqfTEJcakX96hqMy5gZaPUGyZa7", "voter": "0x230f7DFda86C61a9c5ec31d29269Bd23Ef5D79bd", "created": 1635029284, "choice": 1, "space": {"id": "zombiezdao.eth"}}, {"id": "QmS8Xq3vegYU148YvKkzbcG3PfPKpe9KnwBJWUtKWAsgpv", "voter": "0x8E63F00e836fC24CdE6643bCA02008cd54E0EA4f", "created": 1635026127, "choice": 1, "space": {"id": "zombiezdao.eth"}}, {"id": "<KEY>", "voter": "0xcf9556304Df79AE71813E30711232Ec401832FD7", "created": 1635024250, "choice": 1, "space": {"id": "zombiezdao.eth"}}, {"id": "<KEY>", "voter": "<KEY>", "created": 1635022419, "choice": 1, "space": {"id": "zombiezdao.eth"}}, {"id": "<KEY>", "voter": "<KEY>", "created": 1635022121, "choice": 1, "space": {"id": "zombiezdao.eth"}}, {"id": "<KEY>", "voter": "0x1A8beC7F9Ab7e4FB662cB1c4fAc48026da4db7C2", "created": 1635020238, "choice": 1, "space": {"id": "zombiezdao.eth"}}, {"id": "QmUDDxCe6swbnX3g1h1MtavLZdmvyHz7Cuf1e2piPaLcCn", "voter": "0xc48d912C6596a0138e058323fD9929209A66Cfd8", "created": 1635018944, "choice": 1, "space": {"id": "zombiezdao.eth"}}, {"id": "<KEY>", "voter": "0x3232c13ace394e0E45a61E044cC70A7e3728Bc38", "created": 1635018689, "choice": 1, "space": {"id": "zombiezdao.eth"}}, {"id": "<KEY>", "voter": "0x9E1359eEa97403b0c6F880506a9CA6a3E5744Ec4", "created": 1635018526, "choice": 1, "space": {"id": "zombiezdao.eth"}}, {"id": "<KEY>", "voter": "<KEY>", "created": 1635018260, "choice": 1, "space": {"id": "zombiezdao.eth"}}, {"id": "<KEY>", "voter": "<KEY>", "created": 1635017167, "choice": 1, "space": {"id": "zombiezdao.eth"}}, {"id": "<KEY>", "voter": "<KEY>", "created": 1635017009, "choice": 1, "space": {"id": "zombiezdao.eth"}}, {"id": "<KEY>", "voter": "0x7c2cD22CB845C81f205782677e19cE59EF71c55c", "created": 1635016895, "choice": 1, "space": {"id": "zombiezdao.eth"}}, {"id": "<KEY>", "voter": "0x5CE258282080A3E26DD5cd597613F72e293b07F7", "created": 1635015877, "choice": 1, "space": {"id": "zombiezdao.eth"}}, {"id": "<KEY>", "voter": "0x0CbEbb1035a791f0c4D5A96C03dd0610b877128A", "created": 1635015220, "choice": 1, "space": {"id": "zombiezdao.eth"}}, {"id": "QmYrZsoQtWNWndTqGLwChJpZDHoUvGTi7Sk5GiusXi74iP", "voter": "0x7481078d233AA0d5D5bDa4aCac9CCe6607753Bec", "created": 1635014536, "choice": 1, "space": {"id": "zombiezdao.eth"}}, {"id": "QmRoddT28MN5YDS6w9w8y8AmJRaZjymL8PCTfJ2qwLwd53", "voter": "<KEY>", "created": 1635012213, "choice": 1, "space": {"id": "zombiezdao.eth"}}]} | json |
<reponame>czak/mini-kvm-rs
//! Definitions of KVM capabilities.
use crate::kvm_sys;
use std::convert::Into;
/// Definition of capabilities that return a bool value indicating whether the capability is
/// supported or not.
#[repr(u64)]
pub enum CapBool {
/// Check if capabilities can be queried on VM fds (`KVM_CAP_CHECK_EXTENSION_VM`).
CheckExtensionVm = kvm_sys::KVM_CAP_CHECK_EXTENSION_VM,
}
impl Into<u64> for CapBool {
fn into(self) -> u64 {
self as u64
}
}
/// Definition of capabilities that return an integer value indicating the amount of the queried
/// capability.
#[repr(u64)]
pub enum CapInt {
/// Get the recommended max VPCUs (`KVM_CAP_NR_VCPUS`).
NrVcpus = kvm_sys::KVM_CAP_NR_VCPUS,
/// Get the possible max VPCUs (`KVM_CAP_MAX_VCPUS`).
MaxVcpus = kvm_sys::KVM_CAP_MAX_VCPUS,
}
impl Into<u64> for CapInt {
fn into(self) -> u64 {
self as u64
}
}
| rust |
<filename>src/components/Img.ts
import Component from "../components/Component";
import Vector2 from "../data/Vector2";
import Colour from "../data/Colour";
export default class Img extends Component {
private _imageLoaded : boolean;
private _image : HTMLImageElement;
private _imagePath : string;
public set imagePath(value : string) {
this._imageLoaded = false;
this._imagePath = value;
this._image = new Image();
this._image.src = this._imagePath;
this._image.onload = this.OnImageLoaded.bind(this);
}
public get imagePath() : string {
return this._imagePath;
}
constructor() {
super();
}
OnImageLoaded() {
this._image.onload = null;
this._imageLoaded = true;
}
Update() { }
Draw(context : CanvasRenderingContext2D) {
if(this._imageLoaded) {
context.save();
context.translate(-this.gameObject.transform.position.x, -this.gameObject.transform.position.y);
context.drawImage(this._image,
//source image coordinates/sizing.
0,
0,
this._image.width,
this._image.height,
//destination coordinates/sizing
this.gameObject.transform.bounds.xMin,
this.gameObject.transform.bounds.yMin,
this.gameObject.width,
this.gameObject.height);
context.restore();
}
}
} | typescript |
<filename>GUI/README.md
# BEMOSS™ Launcher Wizard
<img src="BEMOSS_logo.png" alt="bemoss logo" height="64px">
## Get Started:
BEMOSS™ Launcher Wizard is the graph user interface for Building Energy Management Open Source Software, which is developed by Advanced Research Institute, Virginia Tech.
To install BEMOSS™, please visit the [Wiki](https://github.com/bemoss/bemoss_gui/wiki) for installation instruction.
## Brief Introduction:
BEMOSS™ Launcher Wizard provides both developers and non-developers the convenience to install, run, configure and debug BEMOSS™. Below is the brief introduction of what BEMOSS™ Launcher Wizard can be used to.
### Get Started with BEMOSS™ Launcher Wizard
To get BEMOSS™ Launcher Wizard running, some packages might needed, if you do not have these package, the first time you start BEMOSS™ Launcher Wizard using the file startBEMOSS_GUI.sh, those packages will be automatically installed.<br>
To be more specific, packages needed are ImageTK and netifaces, these two packages can also be installed by typing the commands below in you Terminal:
```
$ sudo apt-get install python-imaging-tk
$ sudo apt-get install python-netifaces
```
<br>
### Main Panel
<img src="demo_pics/Main Panel.JPG" alt="main panel" height="400px" align="center">
From Main Panel, you can:
- Find out web server IP
- Run BEMOSS
- Run as a BEMOSS node
- Stop BEMOSS
- Go to Advanced Setting
### Installation Detection
If BEMOSS™ is not installed, click any of these three buttons will prompt with BEMOSS™ installation request. Click OK to install BEMOSS.<br>
<img src="demo_pics/BEMOSS_Install.JPG" alt="install prompt" height="400px" align="center">
### Tab1: Setting
<img src="demo_pics/BEMOSS_Settings_File.JPG" alt="setting" height="400px">
Setting tab is mainly designed for selecting devices to be discovered before BEMOSS™ starts running.<br>
- Get Data: When press this button, what is currently on settings.py will be showed on UI;
- Submit: After changes have been made, click submit will change the content of settings.py.
### Tab2: VOLTTRON
<img src="demo_pics/View_Agent_Status_Password_Success.JPG" alt="volttron" height="400px">
<br>
This tab mainly designed for VOLTTRON interaction.<br>
- View Agent Status: click this button to display agents' status, first time click might need system password.
- Start/Stop Agents: Individual agents can be stopped or started here, specify the agent ID in the blank.
- Agent Repackage: Agent code can be repackaged by one click: first all agents belong to the type of agent needs to be repackaged will stop, then agent code repackage, finally agents start.
### Tab 3: Database
<img src="demo_pics/Databases_Related_corrected.JPG" alt="databases" height="400px">
<br>
This tab cope with database related issue, it is divided by two sections: one for Postgresql, one for Cassandra:<br>
- Open configuration files of Postgresql: both postgresql.conf and pg_hba.conf will be open by either gedit or leafpad, system password might be needed
<br>
- Start Pgadmin3
- Delete Cassandra setting's file in bemoss_os folder
- Delete Cassandra data
- Connect to Cassandra in terminal, Cassandra log in information will be needed.
### Tab 4: System Monitoring
<img src="demo_pics/System_Monitoring.JPG" alt="system monitoring" height="400px">
<br>
- Average Load/CPU/Memory information will be displayed, support auto update.
| markdown |
{"remainingRequest":"E:\\XiangMu\\ant-design-pro-vue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!E:\\XiangMu\\ant-design-pro-vue\\src\\components\\Charts\\MiniSmoothArea.vue?vue&type=script&lang=js&","dependencies":[{"path":"E:\\XiangMu\\ant-design-pro-vue\\src\\components\\Charts\\MiniSmoothArea.vue","mtime":1562294713025},{"path":"E:\\XiangMu\\ant-design-pro-vue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"E:\\XiangMu\\ant-design-pro-vue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"E:\\XiangMu\\ant-design-pro-vue\\node_modules\\babel-loader\\lib\\index.js","mtime":499162500000},{"path":"E:\\XiangMu\\ant-design-pro-vue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"E:\\XiangMu\\ant-design-pro-vue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\r\nexport default {\r\n name: 'MiniSmoothArea',\r\n props: {\r\n prefixCls: {\r\n type: String,\r\n default: 'ant-pro-smooth-area'\r\n },\r\n scale: {\r\n type: [Object, Array],\r\n required: true\r\n },\r\n dataSource: {\r\n type: Array,\r\n required: true\r\n }\r\n },\r\n data () {\r\n return {\r\n height: 100\r\n }\r\n }\r\n}\r\n",null]} | json |
<reponame>tonyxxq/RoomAI
#!/bin/python
| python |
// Approach #1: Dependency retention -- retention des dépendances
/*
Il ya pas de abstraction ou paramétrisation,
Le code décisionnel et code impure (IO, del externes.. etc) sont mélangés
Pros:
- Rapid à faire (scriptings, prototypes, etc)
Cons:
- Pas facile à tester (ou même pas testable de tout)
- Difficile de refactor (car en chaîne pas facile à tester, donc pas backup des tests fiables)
- Les sections de code que pourraient être déterministes sont mélangés
*/
import {isLeft} from 'fp-ts/lib/Either';
import {Profile} from './business-types';
import {
defaultDbService,
defaultEmailService,
defaultSmtpCredentials,
globalLogger
} from './default-services';
export const updateCustomerProfile = async function* (
newProfile: Profile
): AsyncGenerator<unknown, void, unknown> {
const dbConnection = defaultDbService.NewDbConnection();
const smtpCredentials = defaultSmtpCredentials;
const currentProfile = await defaultDbService.QueryProfile(dbConnection)(newProfile.userId);
if (isLeft(currentProfile)) return;
if (currentProfile.right !== newProfile) {
globalLogger.Info('Updating Profile');
yield defaultDbService.UpdateProfile(dbConnection)(newProfile);
}
if (currentProfile.right.emailAddress !== newProfile.emailAddress) {
const emailMessage = {
To: newProfile.emailAddress,
Body: 'Please verify your email'
};
globalLogger.Info('Sending email');
yield defaultEmailService.SendChangeNotification(smtpCredentials)(emailMessage);
}
};
| typescript |
<reponame>dominichamon/golint<gh_stars>1-10
package golisp
import (
"errors"
"fmt"
"log"
"math"
"reflect"
)
type env struct {
outer *env
m map[string]*object
}
// TODO: test
// get returns the value of the key from the innermost scope.
func (e *env) get(key string) (*object, error) {
ee, err := e.find(key)
if err != nil {
return nil, err
}
return ee.m[key], nil
}
// find returns the innermost scope that contains the key
func (e *env) find(key string) (*env, error) {
_, ok := e.m[key]
if ok {
return e, nil
}
if e.outer != nil {
return e.outer.find(key)
}
return nil, fmt.Errorf("%q not found", key)
}
// define creates a new key in the current scope.
func (e *env) define(key string, value *object) {
e.m[key] = value
}
// set overrides the value of an existing key wherever it is in scope.
func (e *env) set(key string, value *object) error {
ee, err := e.find(key)
if err != nil {
return err
}
ee.define(key, value)
return nil
}
var globalEnv env = env{
outer: nil,
m: map[string]*object{
// operators
"+": newObject(func(o ...*object) (*object, error) {
if len(o) == 1 {
return nil, errors.New("expected at least two arguments to +")
}
var res float64
var isint bool
for _, v := range o {
isint = isint && (v.t == TYPE_INT)
f, err := v.toFloat()
if err != nil {
return nil, err
}
res += f
}
if isint {
return newObject(int64(res)), nil
}
return newObject(res), nil
}),
"-": newObject(func(o ...*object) (*object, error) {
if len(o) != 2 {
return nil, errors.New("expected two arguments to -")
}
a, err := o[0].toFloat()
if err != nil {
return nil, err
}
b, err := o[1].toFloat()
if err != nil {
return nil, err
}
res := a - b
if o[0].t == TYPE_INT && o[1].t == TYPE_INT {
return newObject(int64(res)), nil
}
return newObject(res), nil
}),
"*": newObject(func(o ...*object) (*object, error) {
if len(o) != 2 {
return nil, errors.New("expected two arguments to *")
}
a, err := o[0].toFloat()
if err != nil {
return nil, err
}
b, err := o[1].toFloat()
if err != nil {
return nil, err
}
res := a * b
if o[0].t == TYPE_INT && o[1].t == TYPE_INT {
return newObject(int64(res)), nil
}
return newObject(res), nil
}),
"/": newObject(func(o ...*object) (*object, error) {
if len(o) != 2 {
return nil, errors.New("expected two arguments to /")
}
a, err := o[0].toFloat()
if err != nil {
return nil, err
}
b, err := o[1].toFloat()
if err != nil {
return nil, err
}
res := a / b
if o[0].t == TYPE_INT && o[1].t == TYPE_INT {
return newObject(int64(res)), nil
}
return newObject(res), nil
}),
">": newObject(func(o ...*object) (*object, error) {
if len(o) != 2 {
return nil, errors.New("expected two arguments to >")
}
a, err := o[0].toFloat()
if err != nil {
return nil, err
}
b, err := o[1].toFloat()
if err != nil {
return nil, err
}
return newObject(a > b), nil
}),
"<": newObject(func(o ...*object) (*object, error) {
if len(o) != 2 {
return nil, errors.New("expected two arguments to <")
}
a, err := o[0].toFloat()
if err != nil {
return nil, err
}
b, err := o[1].toFloat()
if err != nil {
return nil, err
}
return newObject(a < b), nil
}),
">=": newObject(func(o ...*object) (*object, error) {
if len(o) != 2 {
return nil, errors.New("expected two arguments to >=")
}
a, err := o[0].toFloat()
if err != nil {
return nil, err
}
b, err := o[1].toFloat()
if err != nil {
return nil, err
}
return newObject(a >= b), nil
}),
"<=": newObject(func(o ...*object) (*object, error) {
if len(o) != 2 {
return nil, errors.New("expected two arguments to <=")
}
a, err := o[0].toFloat()
if err != nil {
return nil, err
}
b, err := o[1].toFloat()
if err != nil {
return nil, err
}
return newObject(a <= b), nil
}),
"=": newObject(func(o ...*object) (*object, error) {
if len(o) != 2 {
return nil, errors.New("expected two arguments to =")
}
a, err := o[0].toFloat()
if err != nil {
return nil, err
}
b, err := o[1].toFloat()
if err != nil {
return nil, err
}
return newObject(a == b), nil
}),
// math
"abs": newObject(func(o ...*object) (*object, error) {
if len(o) != 1 {
return nil, errors.New("expected one argument to abs")
}
if o[0].t == TYPE_FLOAT {
return newObject(math.Abs(o[0].f)), nil
} else if o[0].t == TYPE_INT {
return newObject(math.Abs(float64(o[0].i))), nil
}
return nil, errors.New("expected float or int argument to abs")
}),
"pow": newObject(func(o ...*object) (*object, error) {
f0, err := o[0].toFloat()
if err != nil {
return nil, err
}
f1, err := o[1].toFloat()
if err != nil {
return nil, err
}
return newObject(math.Pow(f0, f1)), nil
}),
"expt": newObject(func(o ...*object) (*object, error) {
f0, err := o[0].toFloat()
if err != nil {
return nil, err
}
f1, err := o[1].toFloat()
if err != nil {
return nil, err
}
return newObject(math.Pow(f0, f1)), nil
}),
"sqrt": newObject(func(o ...*object) (*object, error) {
f, err := o[0].toFloat()
if err != nil {
return nil, err
}
return newObject(math.Sqrt(f)), nil
}),
"round": newObject(func(o ...*object) (*object, error) {
f, err := o[0].toFloat()
if err != nil {
return nil, err
}
return newObject(math.Trunc(f)), nil
}),
"sin": newObject(func(o ...*object) (*object, error) {
if len(o) != 1 {
return nil, errors.New("expected one argument to sin")
}
if o[0].t == TYPE_FLOAT {
return newObject(math.Sin(o[0].f)), nil
} else if o[0].t == TYPE_INT {
return newObject(math.Sin(float64(o[0].i))), nil
}
return nil, errors.New("expected float or int argument to sin")
}),
"cos": newObject(func(o ...*object) (*object, error) {
if len(o) != 1 {
return nil, errors.New("expected one argument to cos")
}
if o[0].t == TYPE_FLOAT {
return newObject(math.Cos(o[0].f)), nil
} else if o[0].t == TYPE_INT {
return newObject(math.Cos(float64(o[0].i))), nil
}
return nil, errors.New("expected float or int argument to cos")
}),
"pi": newObject(math.Pi),
"begin": newObject(func(o ...*object) (*object, error) {
return newObject(o), nil
}),
// list manipulation
"car": newObject(func(o ...*object) (*object, error) {
if len(o) != 1 {
return nil, errors.New("expected one argument to car")
}
x := o[0]
if x.t != TYPE_LIST {
return nil, errors.New("expected list as argument to car")
}
return x.l[0], nil
}),
"cdr": newObject(func(o ...*object) (*object, error) {
if len(o) != 1 {
return nil, errors.New("expected one argument to cdr")
}
x := o[0]
if x.t != TYPE_LIST {
return nil, errors.New("expected list as argument to cdr")
}
return newObject(x.l[1:]), nil
}),
"cons": newObject(func(o ...*object) (*object, error) {
if len(o) != 2 {
return nil, errors.New("expected two arguments to cons")
}
if o[1].t != TYPE_LIST {
return nil, errors.New("expected list as second argument to cons")
}
l := append([]*object{o[0]}, o[1].l...)
return newObject(l), nil
}),
"eq?": newObject(func(o ...*object) (*object, error) {
return newObject(&o[0] == &o[1]), nil
}),
"equal?": newObject(func(o ...*object) (*object, error) {
return newObject(reflect.DeepEqual(o[0], o[1])), nil
}),
"length": newObject(func(o ...*object) (*object, error) {
if len(o) != 1 {
return nil, errors.New("expected one argument to len")
}
if o[0].t != TYPE_LIST {
return nil, errors.New("expected list as argument to len")
}
return newObject(len(o[0].l)), nil
}),
"list": newObject(func(o ...*object) (*object, error) {
return newObject(o), nil
}),
"list?": newObject(func(o ...*object) (*object, error) {
if len(o) != 1 {
return nil, errors.New("expected one argument to list?")
}
return newObject(o[0].t == TYPE_LIST), nil
}),
"map": newObject(func(o ...*object) (*object, error) {
fn := o[0]
if fn.t != TYPE_FN && fn.t != TYPE_LAMBDA {
return nil, errors.New("expected callable for first argument to map")
}
args := o[1]
if args.t != TYPE_LIST {
return nil, errors.New("expected list for second argument to map")
}
res := []*object{}
for _, arg := range args.l {
var r *object
var err error
log.Printf("mapping with arg %+v", arg)
if fn.t == TYPE_FN {
r, err = fn.fn(arg)
} else if fn.t == TYPE_LAMBDA {
r, err = fn.lambda.call(arg)
}
if err != nil {
return nil, err
}
res = append(res, r)
}
return newObject(res), nil
}),
"null?": newObject(func(o ...*object) (*object, error) {
return newObject(reflect.DeepEqual(o[0], nil)), nil
}),
"number?": newObject(func(o ...*object) (*object, error) {
return newObject(o[0].t == TYPE_INT || o[0].t == TYPE_FLOAT), nil
}),
"procedure?": newObject(func(o ...*object) (*object, error) {
if len(o) != 1 {
return nil, errors.New("expected one argument to procedure?")
}
return newObject(o[0].t == TYPE_FN || o[0].t == TYPE_LAMBDA), nil
}),
"symbol?": newObject(func(o ...*object) (*object, error) {
if len(o) != 1 {
return nil, errors.New("expected one argument to symbol?")
}
return newObject(o[0].t == TYPE_SYMBOL), nil
}),
},
}
| go |
EVEN AS the proposal is yet to take off in 17 schools seven months after the order was issued, the Chandigarh Administration on Thursday issued an order to open playgrounds of all 110 govenment schools for the benefit of children staying in neighbourhoods near the schools. The children will be able to play here after school hours.
Following complaints by residents that there are no lighting facilities at the playgrounds of 17 government schools that were opened by the MC last year, Mayor Arun Sood in a meeting with the education and finance secretary Sarvjit Singh Thursday proposed that floodlights be installed at the schools. Singh issued orders that playgrounds at all 110 government schools should be opened and floodlights could be installed there.
“In 2012-13, the Municipal Corporation and UT administration had proposed to open the Government Senior Secondary School of Sector 21 on pilot basis. The proposal failed to take off as the administration had decided to provide guards and proper fencing which wasn’t done,” said Mukesh Bassi, local councillor.
Facing flak for not being able to work on their pilot project, the MC had last year decided to open playgrounds at 17 government schools for the children, though most of them remain out of bounds for children. As per the guidelines, two guards were to be provided by the administration and a physical education teacher by the school. A first-aid kit was also said to be made available. The proposal is yet to take off.
Director (school education) Rubinderjit Singh Brar said work on levelling and fencing was in progress at these 17 schools.
“The work of fencing has been completed while that of levelling in the grounds will take another 15 days to be completed. I had ordered all principals to keep the schools open for the children,” added Brar.
Chief Engineer Mukesh Anand has been given directives to install floodlights.
Municipal Commissioner Baldeo Purushartha said that they had made a token provision in the budget this time, for spending money on the basic infrastructure at the playgrounds wherever it was required.
The UT Administration is in the process of constructing seven sports complex at various locations of the city wherein indoor stadiums, swimming pools would be provided. The complexes would be open to children, too. | english |
Menal is a small town located on the Chittorgarh–Bundi Road, 90 km away from Chittorgarh. The beautiful landscape and the old temples of the place resemble that of Khajuraho; therefore, this place is also known by the name 'Mini Khajuraho'.
The place is already full of several ancient Buddhist temples, and excavations continue to unveil many more shrines. Apart from temples, the region also has beautiful waterfalls, and dense forests, making it a noted picnic spot. | english |
<reponame>Simage/TileMapBase
__version__ = "0.4.6"
from .tiles import init, get_cache
from .mapping import project, to_lonlat, Extent, Plotter, extent_from_frame
from .utils import start_logging
from . import tiles
from . import mapping
from . import utils
from . import ordnancesurvey
| python |
<filename>src/pages/Componentes/Footer/footer.css
.footer-div{
display: flex;
justify-content: flex-start;
align-items: center;
margin-left: 30px;
}
.footer-div svg{
margin-left: 5px;
}
.Nome-forinho-footer{
color: firebrick;
text-align: center;
font-size: 50px;
}
.texto-footer{
color: gray;
padding: 5px;
}
| css |
/*
* Copyright 2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.jayway.awaitility.pollinterval;
import org.junit.Test;
import java.util.concurrent.TimeUnit;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
public class FibonacciPollIntervalTest {
@Test public void
fibonacci_small_number() {
// Given
// When
int fibonacci = new FibonacciPollInterval(TimeUnit.MILLISECONDS).fibonacci(10);
// Then
assertThat(fibonacci, is(55));
}
@Test public void
fibonacci_large_number() {
// Given
// When
int fibonacci = new FibonacciPollInterval(TimeUnit.MILLISECONDS).fibonacci(120);
// Then
assertThat(fibonacci, is(428607904));
}
} | java |
{
"name": "@polareclipse/polaris-app-sdk",
"version": "1.0.1",
"description": "App sdk to connect to polaris webshop",
"author": "<NAME> <<EMAIL>> (https://www.polareclip.se)",
"license": "MIT",
"homepage": "https://github.com/polareclipse/polaris-app-sdk",
"keywords": [],
"main": "dist/polaris-app-sdk.js",
"module": "dist/polaris-app-sdk.esm.js",
"browser": "dist/polaris-app-sdk.umd.js",
"files": [
"dist"
],
"scripts": {
"dev": "rollup -c -w",
"test": "jest",
"tdd": "jest --watch",
"build": "run-s lint build:rollup build:types build:docs",
"build:rollup": "rollup -c",
"build:types": "tsc -p ./tsconfig.json --outDir build --declaration true && api-extractor run && rimraf build",
"build:docs": "typedoc src --out docs",
"lint": "eslint ./src/**/*.ts --fix",
"prepublish": "lint && test"
},
"devDependencies": {
"@microsoft/api-extractor": "^7.19.2",
"@rollup/plugin-commonjs": "^21.0.1",
"@rollup/plugin-node-resolve": "^13.0.6",
"@rollup/plugin-typescript": "^8.3.0",
"@types/jest": "^27.0.3",
"@typescript-eslint/eslint-plugin": "^5.6.0",
"@typescript-eslint/parser": "^5.6.0",
"eslint": "^7.32.0",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.2.0",
"jest": "^27.4.3",
"npm-run-all": "^4.1.5",
"rimraf": "^3.0.2",
"rollup": "^2.61.0",
"standard-version": "^9.3.2",
"ts-jest": "^27.1.1",
"ts-node": "^10.4.0",
"typedoc": "^0.22.10",
"typescript": "^4.5.2"
}
}
| json |
/*
* Copyright (C) 2007-2021 Crafter Software Corporation. All Rights Reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as published by
* the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
(function ({ content, search, classes }, { operators }) {
const pathRegExp = /^\/(.*?)\.xml$/;
function getCookie(name) {
var v = document.cookie.match('(^|;) ?' + name + '=([^;]*)(;|$)');
return v ? v[2] : null;
}
function isAuthoring() {
const html = document.documentElement;
const attr = html.getAttribute('data-craftercms-preview');
return (
attr === '${modePreview?c}' || // Otherwise disable/enable if you want to see pencils in dev server.
attr === 'true'
);
}
function getICE(model, fieldId = null) {
return (craftercms?.guest?.getICEAttributes({
model,
fieldId,
isAuthoring: authoring
}))
}
const authoring = isAuthoring();
const { crafterConf } = classes;
crafterConf.configure({
baseUrl: '',
site: getCookie('crafterSite')
});
const { map } = operators;
const { createQuery } = search;
const searchContent = search.search;
const { parseDescriptor, preParseSearchResults } = content;
var browser = new Vue({
el: '#browser',
data: {
types: [
{
id: '1',
label: 'January',
labelField: 'internal-name',
contentType: '/component/fact'
},
{
id: '2',
label: 'February',
labelField: 'internal-name',
contentType: '/component/fact'
},
{
id: '3',
label: 'March',
labelField: 'internal-name',
contentType: '/component/fact'
},
{
id: '4',
label: 'April',
labelField: 'internal-name',
contentType: '/component/fact'
},
{
id: '5',
label: 'May',
labelField: 'internal-name',
contentType: '/component/fact'
},
{
id: '6',
label: 'June',
labelField: 'internal-name',
contentType: '/component/fact'
},
{
id: '7',
label: 'July',
labelField: 'internal-name',
contentType: '/component/fact'
},
{
id: '8',
label: 'August',
labelField: 'internal-name',
contentType: '/component/fact'
},
{
id: '9',
label: 'September',
labelField: 'internal-name',
contentType: '/component/fact'
},
{
id: '10',
label: 'October',
labelField: 'internal-name',
contentType: '/component/fact'
},
{
id: '11',
label: 'November',
labelField: 'internal-name',
contentType: '/component/fact'
},
{
id: '12',
label: 'December',
labelField: 'internal-name',
contentType: '/component/fact'
},
],
selectedType: null,
items: [],
selectedItem: null,
selectedItemNumUpdates: 0,
},
methods: {
setType: function (type) {
this.selectedType = type;
this.selectedItem = null;
var self = this;
searchContent(
createQuery('elasticsearch', {
'query': {
'bool': {
'filter': [
{
'match': {
'content-type': type.contentType
},
'match': {
'factMonth_s': type.id
}
}
]
}
},
'sort': {
'createdDate_dt': { 'order': 'desc' }
}
})
).pipe(
map(({ hits, ...rest }) => ({
...rest,
hits: hits.map(({ _source }) => parseDescriptor(
preParseSearchResults(_source)
))
}))
).subscribe((results) => {
self.items = results;
});
},
setItem: function (item) {
this.selectedItem = item;
this.selectedItemNumUpdates = 0;
},
updateItem: function(args) {
const itemIndex = this.items.hits.findIndex(item => {
return item.craftercms.id === args.modelId
});
this.items.hits[itemIndex][args.fieldId] = args.value;
},
deregisterItems: function() {
document.querySelectorAll('[data-craftercms-model-id]').forEach((el) => {
const record = craftercms.guest.elementRegistry.fromElement(el);
// This is supposed to be before updating DOM, but query is returning both old and new elements
if (record) {
craftercms?.guest?.elementRegistry.deregister(record.id);
}
});
},
registerItems: function() {
document.querySelectorAll('[data-craftercms-model-id]').forEach((element) => {
let //
path = element.getAttribute('data-craftercms-model-path'),
modelId = element.getAttribute('data-craftercms-model-id'),
fieldId = element.getAttribute('data-craftercms-field-id'),
index = element.getAttribute('data-craftercms-index'),
label = element.getAttribute('data-craftercms-label');
if ((index !== null) && (index !== undefined) && !index.includes('.')) {
// Unsure if somewhere, the system relies on the index being an integer/number.
// Affected inventory:
// - Guest.moveComponent() - string type handled
index = parseInt(index, 10);
}
craftercms?.guest?.elementRegistry.register({ element, modelId, fieldId, index, label, path });
});
},
getICE
},
watch: {
selectedItem: function() {
this.deregisterItems();
this.$nextTick(function() {
if (this.selectedItem) {
this.registerItems();
}
});
}
},
mounted: function() {
const self = this;
$(function () {
const sub = craftercms.guest?.contentController?.operations$.subscribe((op) => {
if (op.type === 'UPDATE_FIELD_VALUE_OPERATION') {
self.updateItem(op.args);
self.selectedItemNumUpdates++;
}
});
})
}
});
})(craftercms, rxjs); | javascript |
<reponame>niiknow/zipcode-us
{"localities": ["Barry Square, CT", "Hartford, CT", "Htfd, CT"], "state": "CT", "postal_code": "06114", "locality": "Hartford, CT", "lat": 41.740854, "region": {"fips": "09", "abbr": "CT", "name": "Connecticut"}, "city": "Hartford", "type": "STANDARD", "lng": -72.670695, "counties": [{"fips": "003", "name": "Hartford County"}]} | json |
<filename>libcore/security/src/main/java/java/security/spec/package.html
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<html>
<body>
<p>
This package provides the classes and interfaces needed to specify keys and parameter for
encryption and signing algorithms. Following standards are supported:
(1) PKCS#1 RSA encryption standard;
(2) FIPS-186 DSA (signature) standard;
(3) PKCS#8 private key information standard.
Keys may be specified via algorithm or in a more abstract and general way with ASN.1.
The parameters for the Elliptic Curve (EC) encryption algorithm are only specified as
input parameters to the relevant EC-generator.
</p>
</body>
</html> | html |
<filename>sass/style.css
body {
padding: 15px;
}
header {
margin-top: 5px;
}
header .navbar {
-webkit-box-shadow: 0 8px 6px -6px #999;
box-shadow: 0 8px 6px -6px #999;
}
header .active {
border-bottom: 1px solid #c5c5c5;
}
header #logo {
max-width: 80%;
min-width: 20px;
min-height: 20px;
}
header .card-title {
position: absolute;
top: 6rem;
right: 18rem;
color: white;
font-size: 2.5rem;
}
header .card-title_1 {
position: absolute;
top: 10rem;
right: 7rem;
color: white;
font-size: 2.8rem;
}
header #ctn_banner {
margin-top: 10px;
}
header #ctn_banner img {
max-height: 500px;
}
#main {
padding: 2%;
}
#main #crear-mensualidad {
padding: 2%;
}
#main #mis-tabs #crear-mensualidad #btn-agregar-mensualidad {
border-radius: 20px;
}
#main #mis-tabs #crear-mensualidad #tbl-mensualidades {
margin-top: 25px;
}
/*# sourceMappingURL=style.css.map */ | css |
The country is likely to lift the state of emergency on Thursday, 45 days after it was imposed.
Maldives charged nine people, including the jailed chief justice and former president, for terrorism on Tuesday, AP reported. The country is likely to lift the state of emergency on Thursday, 45 days after it was imposed.
Former President Maumoon Abdul Gayoom, Chief Justice Abdulla Saeed and Justice Ali Hameed of the Supreme Court, four MPs, and a former police chief were among those charged with terrorism. If convicted, they could be imprisoned for 10 to 15 years.
The nine people “conspired to instigate a coup with a Supreme Court order [on February 1] for the release of [political] prisoners”, the prosecutor’s office said, according to Maldives Independent.
President Abdulla Yameen had defied the court’s order for four days, before imposing a 15-day state of emergency. He later extended it for another month. Hours after the emergency was imposed, Gayoom and the two judges were arrested at midnight. Gayoom was the president of Maldives from 1978 to 2008.
On Monday, Maldives’ ambassador to Sri Lanka, Mohamed Hussain Shareef, said the island nation would not extend the state of emergency beyond Thursday and would charge Gayoom and the two judges with bribery. Gayoom is accused of bribing the judges and a Supreme Court official to overthrow the government. They were also charged with obstruction of justice on Tuesday.
| english |
<reponame>robert-monk/synth
{"doctors":[{"date_joined":"2017-12-25","hospital_id":1,"id":1,"name":"<KEY>"},{"date_joined":null,"hospital_id":3,"id":2,"name":"<KEY>"},{"date_joined":null,"hospital_id":10,"id":3,"name":null},{"date_joined":"2017-08-20","hospital_id":null,"id":4,"name":"<KEY>"},{"date_joined":"2015-01-29","hospital_id":6,"id":5,"name":"<KEY>"},{"date_joined":null,"hospital_id":11,"id":6,"name":null},{"date_joined":"2018-06-09","hospital_id":2,"id":7,"name":null}],"hospitals":[{"address":"<KEY>","hospital_name":null,"id":1},{"address":"<KEY>","hospital_name":"vJXdAqU9Ns9ycOsChvqaHH","id":2},{"address":null,"hospital_name":null,"id":3},{"address":"<KEY>","hospital_name":"<KEY>","id":4},{"address":"<KEY>","hospital_name":"<KEY>","id":5},{"address":null,"hospital_name":"<KEY>","id":6},{"address":null,"hospital_name":"<KEY>","id":7},{"address":null,"hospital_name":null,"id":8},{"address":null,"hospital_name":null,"id":9},{"address":"<KEY>","hospital_name":null,"id":10},{"address":"<KEY>","hospital_name":null,"id":11}],"patients":[{"address":null,"date_joined":"2016-06-28","doctor_id":9,"id":1,"name":"<KEY>","phone":null,"ssn":null},{"address":null,"date_joined":null,"doctor_id":8,"id":2,"name":null,"phone":null,"ssn":"ETWk5UAVt0"},{"address":null,"date_joined":null,"doctor_id":8,"id":3,"name":null,"phone":"a8fjwRSTUcqLgnCf1","ssn":"6G"}]}
| json |
{
"name" : "uuid-js",
"description" : "A js library to generate and parse UUIDs,TimeUUIDs and generate TimeUUID based on Date for range selections",
"version" : "0.7.5",
"author" : "<NAME> <<EMAIL>>",
"homepage": "http://github.com/pnegri/uuid-js",
"contributors": [
{ "name": "<NAME>", "github": "https://github.com/ctavan" },
{ "name": "<NAME> <<EMAIL>>" }
],
"main" : "./lib/uuid.js",
"directories": {
"lib":"./lib"
},
"dependencies" : {
},
"devDependencies": {
"sinon": "1.2.0"
},
"repository" : {
"type":"git",
"url":"git://github.com/pnegri/uuid-js.git"
},
"engines" : { "node" : ">= 0.4.0" }
}
| json |
<filename>bitcoin-regtest/bitcoin-regtest-core/src/integTest/java/org/tbk/bitcoin/regtest/scenario/BitcoinRegtestScenarioTest.java
package org.tbk.bitcoin.regtest.scenario;
import com.google.common.base.Stopwatch;
import com.msgilligan.bitcoinj.rpc.BitcoinClient;
import lombok.extern.slf4j.Slf4j;
import org.bitcoinj.core.Sha256Hash;
import org.junit.jupiter.api.MethodOrderer;
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.Bean;
import org.springframework.test.context.ActiveProfiles;
import org.tbk.bitcoin.regtest.mining.RegtestMiner;
import org.tbk.bitcoin.regtest.mining.RegtestMinerImpl;
import org.tbk.spring.testcontainer.bitcoind.BitcoindContainer;
import org.tbk.spring.testcontainer.test.MoreTestcontainerTestUtil;
import reactor.core.publisher.Mono;
import java.util.List;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
@Slf4j
@SpringBootTest
@ActiveProfiles("test")
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
class BitcoinRegtestScenarioTest {
@SpringBootApplication(proxyBeanMethods = false)
public static class BitcoinContainerClientTestApplication {
public static void main(String[] args) {
new SpringApplicationBuilder()
.sources(BitcoinContainerClientTestApplication.class)
.web(WebApplicationType.NONE)
.run(args);
}
@Bean
public RegtestMiner regtestMiner(BitcoinClient bitcoinJsonRpcClient) {
return new RegtestMinerImpl(bitcoinJsonRpcClient);
}
@Bean
public BitcoinRegtestActions bitcoinRegtestActions(RegtestMiner regtestMiner) {
return new BitcoinRegtestActions(regtestMiner);
}
}
@Autowired
private BitcoindContainer<?> bitcoindContainer;
@Autowired
private BitcoinRegtestActions bitcoinRegtestActions;
@Test
@Order(1)
void contextLoads() {
assertThat(bitcoinRegtestActions, is(notNullValue()));
assertThat(bitcoindContainer, is(notNullValue()));
assertThat("bitcoind daemon container is running", bitcoindContainer.isRunning(), is(true));
Boolean ranForMinimumDuration = MoreTestcontainerTestUtil.ranForMinimumDuration(bitcoindContainer).block();
assertThat("container ran for the minimum amount of time to be considered healthy", ranForMinimumDuration, is(true));
}
@Test
void itShouldHaveFluentSyntaxToMineBlocks() {
Stopwatch sw = Stopwatch.createStarted();
List<Sha256Hash> blockHashes = Mono.from(bitcoinRegtestActions.mineBlock())
.concatWith(bitcoinRegtestActions.mineBlock())
.concatWith(bitcoinRegtestActions.mineBlock())
.flatMapIterable(it -> it)
.collectList()
.block();
log.debug("Finished after {}", sw.stop());
assertThat(blockHashes, hasSize(3));
}
}
| java |
<gh_stars>1-10
{
"title": "Comet Ikeya-Zhang Brightens",
"explanation": "In the last week, Comet Ikeya-Zhang has become bright enough to be just visible to the unaided eye. Based on its present activity, observers are optimistic that Ikeya-Zhang will become substantially brighter. This composite color image from March 3rd, captured with a wide-field telescope, shows this active comet's bright, condensed coma and a delightful array of subtle structures in its developing tail. The bluish tail stretches for 5 degrees or so against a background of stars in the constellation Pisces. In the coming days look for the comet hanging low in the western evening sky (below a bright yellowish Mars), eventually becoming difficult to see in the March twilight. But after April begins, Ikeya-Zhang will become a predawn object climbing higher into the morning sky as the month progresses. Cataloged as comet C/2002 C1, improved orbit determinations now make it seem very likely that Comet Ikeya-Zhang has been around here before. Refined calculations indicate this comet's last trip through the inner Solar System was 341 years ago, in 1661, when it was recorded as a bright comet.",
"date": "2002-03-07",
"hdurl": "https://apod.nasa.gov/apod/image/0203/ikzhMarz3_rhemann_big.jpg",
"service_version": "v1",
"copyright": "<NAME>",
"media_type": "image",
"url": "https://apod.nasa.gov/apod/image/0203/ikzhMarz3_rhemann.jpg"
} | json |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Q02a</title>
<style>
div {
background-color: blue;
}
</style>
</head>
<body>
<div>
<h1>THERE IS FLOATING WATER IN SPACE</h1>
<p>There is a water vapour floating in space around 10 billion light years away. It holds 140 trillion times the water in the oceans on Earth.</p>
</div>
</body>
</html> | html |
with a motion poster, and fans and sister queens can't stop gushing over this news!
fame and produced by Utekar and Narendra Hirawat's NH Studioz, will star debutant Adnan Ali in the lead alongside the stunning queen Gayatri and is hit the big screen on 17th June 2022.
Unveiling the motion poster and announcing the news, an elated Gayatri wrote, "Ittu Si Baat kehni hai, sunoge?
Introducing the Motion Poster of my new film #IttuSiBaat!
Releasing in Cinemas on 17th June 2022!"
As per reports, the story is set in the small town of Chunar, near Varanasi, and follows an upcoming cricketer who falls in love with his childhood friend. Taking to the Instagram director, Laxman wrote, "This season of love, me and @nh_studioz present to you the Motion Poster of our new film #IttuSiBaat, a passionate love story that will surely bring some warmth in your hearts! Releasing in cinemas on 17th June 2022." ALSO READ:
Dia Mirza and Shreya Dhanwanthary starrer Gray shed light on the importance of consent!
| english |
<reponame>myoukaku/bksge
/**
* @file fence.hpp
*
* @brief Fence クラスの定義
*
* @author myoukaku
*/
#ifndef BKSGE_CORE_RENDER_D3D12_DETAIL_FENCE_HPP
#define BKSGE_CORE_RENDER_D3D12_DETAIL_FENCE_HPP
#include <bksge/core/render/d3d12/detail/fwd/fence_fwd.hpp>
#include <bksge/core/render/d3d12/detail/fwd/device_fwd.hpp>
#include <bksge/core/render/d3d12/detail/fwd/command_queue_fwd.hpp>
#include <bksge/core/render/d3d_common/d3d12.hpp>
#include <bksge/core/render/d3d_common/com_ptr.hpp>
#include <vector>
namespace bksge
{
namespace render
{
namespace d3d12
{
class Fence
{
public:
explicit Fence(Device* device, ::UINT frame_buffer_count);
~Fence();
void Close(void);
void WaitForGpu(CommandQueue* command_queue, ::UINT frame_index);
void MoveToNextFrame(CommandQueue* command_queue, ::UINT frame_index);
private:
// noncopyable
Fence(Fence const&) = delete;
Fence& operator=(Fence const&) = delete;
private:
ComPtr<ID3D12FenceN> m_fence;
std::vector<::UINT64> m_values;
::HANDLE m_event;
};
} // namespace d3d12
} // namespace render
} // namespace bksge
#include <bksge/fnd/config.hpp>
#if defined(BKSGE_HEADER_ONLY)
#include <bksge/core/render/d3d12/detail/inl/fence_inl.hpp>
#endif
#endif // BKSGE_CORE_RENDER_D3D12_DETAIL_FENCE_HPP
| cpp |
<filename>dragonfly/response.py
from dragonfly.constants import REASON_PHRASES
class Response:
"""
The base :class:`Response` class that is readable by the WSGI server.
Parameters
----------
:param content: The content that will be delivered to the user. This defaults to empty.
:type content: str
:param content_type: The MIME type. This defaults to 'text/html'.
:type content_type: str
:param status_code: The HTTP status code. This defaults to success (200).
:type status_code: int
:param reason_phrase: A written meaning of the HTTP status code. If left as `None` the reason phrase will be chosen from a pre-determined list.
:type reason_phrase: int
"""
def __init__(self, content='', content_type='text/html', status_code=200, reason_phrase=None):
self._content_type = content_type
self._original_content = content
self.content = content
self.status = None
self.set_content()
self.set_status(status_code, reason_phrase)
self.headers = [
('Content-type', self._content_type),
('Content-Length', str(len(self.content)))
]
def set_content(self):
"""
Converts the given content to bytes.
"""
try:
self.content = bytes(str(self._original_content), 'utf-8')
except:
raise Exception("Content cannot be converted to a string")
def set_status(self, status_code, reason_phrase):
"""
Sets the status of the :class:`Response` object. If the ``reason_phrase`` is ``None`` then a reason phrase that corresponds
to the status code will be retrieved from a ``constants`` file.
:param status_code: The status code of the response.
:type status_code: int
:param reason_phrase: The reason phrase to accompany the status code. This can be `None`.
:type reason_phrase: str
"""
reason_phrase = REASON_PHRASES[status_code] if reason_phrase is None else reason_phrase
self.status = f"{status_code} {reason_phrase}"
def header(self, field_name, field_value):
"""
Updates an existing header or creates a new one.
:param field_name: The header field name.
:type field_name: str
:param field_value: The header field value.
:type field_value: str
"""
# Check if a header exists with the given field name
loc = next((i for i, v in enumerate(self.headers) if v[0] == field_name), None)
new_header = (field_name, field_value)
if loc is None:
self.headers.append(new_header)
else:
self.headers[loc] = new_header
def translate_deferred(self, deferred):
"""
Merges the given :class:`DeferredResponse<dragonfly.response.DeferredResponse>` object to this :class:`Response<dragonfly.response.Response>` instance.
:param deferred: The :class:`DeferredResponse<dragonfly.response.DeferredResponse>` object.
:type deferred: :class:`DeferredResponse<dragonfly.response.DeferredResponse>`
"""
for key, value in deferred.headers.items():
self.header(key, value)
class ErrorResponse(Response):
"""
A :class:`Response<dragonfly.response.Response>` object that returns an error page.
:param error_message: The error message.
:type error_message: str
:param status_code: The status code.
:type status_code: int
"""
def __init__(self, error_message, status_code):
generated_html = \
f'''<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>{error_message} - {status_code}</title>
<link rel="stylesheet" href="https://bootswatch.com/4/materia/bootstrap.min.css">
</head>
<body style="background-color: #eee">
<div class="jumbotron">
<h1 class="display-3">Error {status_code}</h1>
<p class="lead">{error_message}</p>
</div>
</body>
</html>
'''
super().__init__(content=generated_html, content_type='text/html', status_code=status_code)
class RedirectResponse(Response):
"""A :class:`Response<dragonfly.response.Response>` object that redirects the user to the given location."""
def __init__(self, location):
super().__init__(content_type='', status_code=302)
self.header('Location', location)
class DeferredResponse:
"""
Allows headers for a future response to be set before it exists.
This singleton enables attributes of any :class:`Response<dragonfly.response.Response>` object returned in the normal fashion, i.e through the
:meth:`dispatch_route<dragonfly.routes.router.Router.dispatch_route>` method, to be set before it exists. The primary use of this class would be in the `before` method
of a middleware.
"""
def __init__(self):
self.headers = {}
def header(self, field_name, field_value):
"""Define the headers to be set on the real :class:`Response` object."""
self.headers[field_name] = field_value
deferred_response = DeferredResponse()
| python |
<reponame>ericoporto/bash-language-server
{
"private": true,
"scripts": {
"clean": "rm -rf *.log */*.log */out node_modules vscode-client/node_modules server/node_modules",
"postinstall": "cd server && yarn install && cd ../vscode-client && yarn install && cd ..",
"compile": "tsc -b",
"watch": "tsc -b -w",
"lint": "yarn lint:bail --fix",
"lint:bail": "eslint . --ext js,ts,tsx --cache",
"test": "jest --runInBand",
"test:coverage": "yarn run test --coverage",
"test:watch": "yarn run test --watch",
"verify": "yarn run lint && yarn run compile && yarn run test",
"verify:bail": "yarn run lint:bail && yarn run compile && yarn run test:coverage",
"reinstall-server": "npm uninstall -g ags-script-language-server && yarn compile && npm i -g ./server",
"link-server": "npm uninstall -g ags-script-language-server && yarn compile && yarn unlink ags-script-language-server && cd server && yarn link && cd ../vscode-client && yarn link ags-script-language-server"
},
"devDependencies": {
"@types/jest": "^25.1.3",
"@types/node": "^12.7.5",
"@typescript-eslint/eslint-plugin": "^2.21.0",
"@typescript-eslint/parser": "^2.21.0",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.10.0",
"eslint-plugin-jest": "^22.17.0",
"eslint-plugin-prettier": "^3.1.2",
"eslint-plugin-simple-import-sort": "^4.0.0",
"jest": "25.0.0",
"prettier": "^1.19.1",
"ts-jest": "^25.2.1",
"typescript": "^3.8.3",
"vscode-languageserver": "^6.1.1"
},
"dependencies": {},
"resolutions": {
"sane": "^3.0.2"
},
"jest": {
"testEnvironment": "node",
"timers": "fake",
"clearMocks": true,
"moduleFileExtensions": [
"js",
"json",
"node",
"ts"
],
"modulePathIgnorePatterns": [
"<rootDir>/server/out",
"<rootDir>/vscode-client/out"
],
"transform": {
"\\.ts$": "ts-jest"
},
"globals": {
"ts-jest": {
"tsConfig": "./server/tsconfig.json"
}
},
"testMatch": [
"<rootDir>/**/__tests__/*.ts"
],
"setupFiles": [
"./setupJest.ts"
],
"collectCoverageFrom": [
"**/*.ts",
"!**/__test__/*",
"!testing/*"
],
"coverageReporters": [
"text-summary",
"lcov",
"html"
]
}
}
| json |
Pictures are taken from various sources for spreading knowledge.
this is a non- commercial blog. Thanks for your great pictures.
If any word is split into two lines, it is shown with ……… dots (in the answers). No abbreviation like Insat, IRRS etc are used. Only names of persons or missions are used.
| english |
<reponame>chaosky/UnifiedOddsSdkJava<gh_stars>1-10
/*
* Copyright (C) Sportradar AG. See LICENSE for full license governing this code
*/
package com.sportradar.unifiedodds.sdk.di;
import com.google.inject.AbstractModule;
import com.google.inject.Binder;
import com.google.inject.Singleton;
import com.google.inject.TypeLiteral;
import com.google.inject.name.Names;
import com.sportradar.uf.sportsapi.datamodel.MarketDescriptions;
import com.sportradar.unifiedodds.sdk.SnapshotRequestManager;
import com.sportradar.unifiedodds.sdk.impl.*;
/**
* An injection module which is used to customise some of the SDK internal components
*/
public class CustomisableSDKModule extends AbstractModule {
/**
* Configures a {@link Binder} via the exposed methods.
*/
@Override
protected final void configure() {
bind(ChannelMessageConsumer.class).to(provideMessageConsumerImplementationClass());
bind(SnapshotRequestManager.class).to(provideSnapshotRequestSchedulerImplementationClass()).in(Singleton.class);
bind(new TypeLiteral<ObservableDataProvider<MarketDescriptions>>() { })
.annotatedWith(Names.named("AdditionalMarketMappingsProvider"))
.to(providesAdditionalMarketMappingsProviderClass())
.in(Singleton.class);
}
/**
* Binds the message receiver that should be used to process received messages
*/
protected Class<? extends ChannelMessageConsumer> provideMessageConsumerImplementationClass() {
return ChannelMessageConsumerImpl.class;
}
/**
* Binds the snapshot request manager that should be used to manage recovery requests
*/
protected Class<? extends SnapshotRequestManager> provideSnapshotRequestSchedulerImplementationClass() {
return DefaultSnapshotRequestManager.class;
}
/**
* Binds the optional additional market mappings provider
*/
protected Class<? extends ObservableDataProvider<MarketDescriptions>> providesAdditionalMarketMappingsProviderClass() {
return DefaultAdditionalMarketMappingsProvider.class;
}
}
| java |
<filename>src/charts/line/useAnimatedPath.ts
import {
useAnimatedProps,
useAnimatedReaction,
useSharedValue,
withTiming,
} from 'react-native-reanimated';
import { usePrevious } from '../../utils';
import { interpolatePath } from './utils';
export default function useAnimatedPath({
enabled = true,
path,
}: {
enabled?: boolean;
path: string;
}) {
const transition = useSharedValue(0);
const previousPath = usePrevious(path);
useAnimatedReaction(
() => {
return path;
},
(_, previous) => {
if (previous) {
transition.value = 0;
transition.value = withTiming(1);
}
},
[path]
);
const animatedProps = useAnimatedProps(() => {
let d = path || '';
if (previousPath && enabled) {
const pathInterpolator = interpolatePath(previousPath, path, null);
d = pathInterpolator(transition.value);
}
return {
d,
};
});
return { animatedProps };
}
| typescript |
import del from 'del';
import gulp from 'gulp';
import gulpIf from 'gulp-if';
import minimist from 'minimist';
import gulpSass from 'gulp-sass';
import undertaker from 'undertaker';
import mergeStream from 'merge-stream';
import gulpSourcemaps from 'gulp-sourcemaps';
interface Options extends minimist.ParsedArgs {
production: boolean;
}
const options: Options = minimist(process.argv.slice(2), {
boolean: ['production', 'watch'],
default: {
watch: false,
production: process.env.NODE_ENV === 'production',
},
}) as unknown as minimist.ParsedArgs & Options;
const gulpIfSourcemapsInit = () => gulpIf(!options.production, gulpSourcemaps.init());
const gulpIfSourcemapsWrite = (_path = './') => gulpIf(!options.production, gulpSourcemaps.write(_path));
function gulpTaskIf(condition: boolean, task: gulp.TaskFunction): undertaker.TaskFunction {
const newTask: undertaker.TaskFunction = (callback) => {
if(condition) {
gulp.series(task)(callback);
} else {
callback();
}
};
return (newTask.displayName = task.name, newTask);
}
export function clean() {
return del([
'dist/views/**/*',
'dist/styles/**/*',
'dist/assets/**/*',
]);
}
function styles() {
return gulp.src('src/styles/**/*.{sass,scss}')
.pipe(gulpIfSourcemapsInit())
.pipe(gulpSass({ outputStyle: options.production ? 'compressed' : 'expanded' }).on('error', gulpSass.logError))
.pipe(gulpIfSourcemapsWrite())
.pipe(gulp.dest('dist/styles'));
}
function asserts() {
return mergeStream(
gulp.src('src/assets/**/*')
.pipe(gulp.dest('dist/assets/')),
gulp.src('src/views/**/*')
.pipe(gulp.dest('dist/views/')),
);
}
function watch() {
gulp.watch('src/styles/**/*.{sass,scss}', styles);
gulp.watch(['src/assets/**/*', 'src/views/**/*'], asserts);
return Promise.resolve();
}
exports.build = gulp.series(
clean,
gulp.parallel(
styles,
asserts,
),
gulpTaskIf(options.watch, gulp.parallel(watch)),
);
| typescript |
<reponame>fabriziobertoglio1987/android-app-test
package com.example.mobileapp;
import android.app.Activity;
import android.webkit.JavascriptInterface;
import android.widget.Toast;
import com.basecamp.turbolinks.TurbolinksSession;
/**
* Created by root on 20/12/17.
*/
public class WebService {
Activity mContext;
WebService(Activity c) {
mContext = c;
}
// Adding javascript interface as done from
// https://github.com/tamcgoey/dasher-app-android/blob/master/src/main/java/com/usedashnow/dasher/DashWebService.java
// and https://stackoverflow.com/questions/21749425/android-webview-addjavascriptinterface-does-not-work-if-the-webview-is-created-i
// It creates and interface between the Java Android App and then Javascript Webview
@JavascriptInterface
public void showToast(String toast) {
Toast.makeText(mContext, toast, Toast.LENGTH_LONG).show();
}
}
| java |
package cn.iocoder.yudao.userserver.modules.member.controller;
import cn.iocoder.yudao.userserver.modules.member.controller.user.SysUserProfileController;
import cn.iocoder.yudao.userserver.modules.member.service.user.MbrUserService;
import cn.iocoder.yudao.userserver.modules.system.service.sms.SysSmsCodeService;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.springframework.http.MediaType;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.result.MockMvcResultHandlers;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
/**
* {@link SysUserProfileController} 的单元测试类
*
* @author 宋天
*/
// TODO @宋天:controller 的单测可以不写哈,因为收益太低了。未来我们做 qa 自动化测试
public class SysUserProfileControllerTest {
private MockMvc mockMvc;
@InjectMocks
private SysUserProfileController sysUserProfileController;
@Mock
private MbrUserService userService;
@Mock
private SysSmsCodeService smsCodeService;
@Before // TODO @宋天:使用 junit5 哈
public void setup() {
// 初始化
MockitoAnnotations.openMocks(this);
// 构建mvc环境
mockMvc = MockMvcBuilders.standaloneSetup(sysUserProfileController).build();
}
@Test
@Ignore
public void testUpdateMobile_success() throws Exception {
//模拟接口调用
this.mockMvc.perform(post("/system/user/profile/update-mobile")
.contentType(MediaType.APPLICATION_JSON_VALUE)
.content("{\"mobile\":\"15819844280\",\"code\":\"123456\"}}"))
.andExpect(status().isOk())
.andDo(MockMvcResultHandlers.print());
// TODO @宋天:方法的结尾,不用空行哈
}
}
| java |
<filename>K/KA9/04.html
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<meta name="robots" content="noindex">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no">
<link rel="stylesheet" href="../../css/problempager.css">
<link rel="stylesheet" href="/css/bgStaticBoard.css">
<title>michy problem</title>
</head>
<body>
<header>
<span id="sectionTitle" class="sectionTitle">アンカー外し その5</span> 
<span>(KA9-04)</span> 
</header>
<nav>
<button id="selectfirst"><<</button> 
<button id="selectprev"><</button></button> 
<button id="return2menu">Idx</button> 
<button id="selectnext">></button> 
<button id="selectlast">>></button> 
<button id="showanswer">Desc</button> 
<button id="resetscr">Rst SCR</button> 
</nav>
<article>
<div class="doAction">マネーゲームで黒に42が出ました。</div>
<div class="gamesituation"></div>
<div class="bgcontainer">
<div><div id="board" class="board"></div>
<div class="pipinfo">pips 黒=99 白=121</div>
<div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div>
<div class="answertable"></div>
<div class="description">明日はポジションのアップを休んで、明後日に新しいやつを載せますね。<br>
<br>
key><br>
20/14<br>
ですから、こういう局面で自分はよく怒られるんですよw<br>
ボードが勝っていて、相手のエースにブロット付き、おまけに一番打ち込みたい2はアウターとデュプっているので、飛び出します。自分は相当実戦的な人間なんで、自分が間違えにくいようにプレーするのは非常に重要だと思っています。<br>
<br>
bluex2><br>
5/1 4/2で耐えます。<br>
<br>
相手のほうが遅れているとはいえ、12pブロットがいなくなるのはもうそれほど遠いことではなくなったと思います。今外すと5pを攻めてくるのも気が進みません(しかもリターンで1p打ててもそれ自体が相手の穴開きプライムの奥深くであまりうれしくない)。このムーブ後はインナーが堅くなってまだいきなりアンカーを外したりしなくてすむのがうれしいと思っています。<br>
ピップは黒99.白121.確かにかなり勝っています。<br>
<br>
nori><br>
難しいことは考えずに20/16 3/2<br>
<br>
もし白の立場で、黒が耐えるプレーをしてきたら、もっと壊してくれることを期待して13ptを意図的に残すかも。<br>
<br>
shun><br>
20/14<br>
<br>
20/16 4/3との比較です。自分のインナーのブロットを解消するか、ショット数最小を優先するか。<br>
インナーのブロットのカバー目が多いので、ここは逃げを優先。<br>
<br>
daichan><br>
5/1,4/2<br>
<br>
これは迷います。20/14で2のデュプリも有力そうですし、我慢するにしても8pを崩す選択もありえます。<br>
インナーブロットを消して5pボードにしておくことが、一番価値が高いと思ったのでこれにします。<br>
<br>
yu><br>
20/14<br>
<br>
4/2 5/1と耐えるのも考えたのですが、相手がアンカーを外した場合その後に困りそう。より能動的な方が楽しそうなので20/14で。<br>
<br>
salukido><br>
20/14<br>
<br>
アンカーで耐えてもあと、2,3手は厳しそうだし、今出ないと相手のインナーも強化され、まずい気がする。<br>
<br>
takamasa><br>
これは、5/1 4/2と自重で。<br>
<br>
この局面は、一手待ちの価値はあると思います。白番で、アンカーはずしも非常に危険でヒットできれば勝ちですし、12ポイントを動かすのも17、18ポイントを動かすのもプラスにならず、黒の次回のアンカーはずしがしやすくなります。<br>
<br>
ある意味、白は今がこの局面における最高形に近く、次手に発展となる手が少ない(4ゾロ、6ゾロとか)。<br>
<br>
一手待ち 5/1 4/2 に一票。<br>
<br>
H.S><br>
飛び出しでみます。<br>
20/14で。<br>
ここでゾロ目に期待する方針で、バックマン割らなかった場合、駒の進み具合からいってどうしても黒が先に厳しくなる可能性大です。<br>
それならあえてコチラから割ってみます。<br>
<br>
vin><br>
5/1 4/2<br>
<br>
耐えます。<br>
20ポイントのアンカーは、4以上で飛び越えられるので、<br>
次にこちらがクラッシュする目が比較的少なく、いつでも<br>
飛び出せると考えておきます。ならば、1回待てば、白の<br>
12ptのブロットや、18ptのスペアが消えて、条件がより<br>
良くなるかもしれない。<br>
白が12ptのブロットを動かした後、4以上ふたつの9通りで<br>
2枚飛び出せる、という期待もできます。<br>
もし白が12ptを残せば、6通りのショットと、55,66のぞろ目で<br>
勝ちになると思います。また、ヒットしたときにインナーブロット<br>
があるのも嫌なので、ここで一手耐えるのは、価値が十分に<br>
高いと思います。<br>
<br>
西本><br>
一巡の安全の確保。4/2 5/1で。<br>
待っていれば何とかなるんじゃないかと言う感じ(単なる問題の先送り?)。<br>
<br>
ピップは99-119。<br>
<br>
michihito_k><br>
アンカー外しを選ぶ場合、2の目は4/2でしょう。<br>
インナーを強化することには明らかなメリットがありますが、バックマンが<br>
16ポイントか14ポイントかには、劇的な違いはないからです。<br>
さて大きな問題はアンカーを外すのか外さないのか?<br>
<br>
・ ピップでリードしている<br>
・ インナーは黒の方が強い<br>
・ 相手陣にはインナーブロット有り<br>
・ 5/1 4/2では死に駒が発生する<br>
<br>
これだけ条件が揃っており、私にはアンカー外しが正解に思えましたが、<br>
次の事柄はアンカーを保つことを支持します。<br>
(1) プライムという観点からは白が勝る<br>
(2) アンカーを外してもバックマンが着地できるわけではなく、二枚がバラバラ<br>
(3) 黒がヒットされた場合、1の目でリターンヒットできることは嬉しいが、<br>
同時にその駒はプライムの奥深くにエンターすることになる(bluex2さん指摘)<br>
(4) アンカーを外せば相手に12通りもの良い目を与える<br>
(11 22 23 24 33 34 44 46)<br>
(5) 先読みをすると悪くない(takamasa、vinさんの意見が参考になりました)<br>
<br>
このようにアンカー外しを支持すると思われた事柄のうち二つが覆されて、<br>
5/1 4/2が最善となります。<br>
<br>
michihito_k><br>
「ここでアンカーを外せば、相手に良い目を12通りも与えてしまう。<br>
それに対して5/1 4/2ならば、駒を殺すがインナーを強化する。<br>
そして次に相手のアウターブロットをヒットする、バックマンが二枚とも安全に<br>
飛び出すなどの楽しみがあり、悪くない」<br>
<br>
1. M 5/1 4/2 Eq.: 0.104<br>
0.2% 9.6% 61.0% 39.0% 7.2% 0.2%<br>
- money cubeless eq.: 0.246 ア0.016.<br>
2. M 8/4 8/6 Eq.: 0.073 (-0.031)<br>
0.4% 10.9% 59.2% 40.8% 7.3% 0.2%<br>
- money cubeless eq.: 0.222 ア0.018.<br>
3. M 20/16 4/2 Eq.: -0.004 (-0.108)<br>
0.6% 16.6% 55.3% 44.7% 11.6% 0.3%<br>
- money cubeless eq.: 0.160 ア0.020.<br>
4. M 20/14 Eq.: -0.062 (-0.166)<br>
0.5% 13.5% 55.1% 44.9% 13.5% 0.5%<br>
- money cubeless eq.: 0.102 ア0.017.<br>
depth 11,180 games,played 2-ply (precise),<br>
<br>
michihito_k><br>
keyさん、「時分は相当実戦的な人間なので」という一文が印象に残りました。<br>
<br>
ピップカウントはbluex2さんに軍配が上がりました。<br>
残念です、西本さん(笑)。<br>
<br>
salukidoさん、初書き込みですね。<br>
これからもよろしくお願いします~<br>
<br>
正答数はvinさん38個、H.Sさん35個、keyさん31個、bluex2さん29個。<br>
<br>
西本><br>
確かに99-121だ・・・。せっかく問題に正解したのに・・・(T_T)。<br>
</div>
</div>
<hr>
<pre id="gnuanalysis" class="gnuanalysis"> 1. Cubeful 2-ply 10/4* 8/4 Eq.: -0.174
0.413 0.190 0.006 - 0.587 0.180 0.013
2. Cubeful 2-ply 24/14* Eq.: -0.176 (-0.001)
0.412 0.180 0.009 - 0.588 0.287 0.030
3. Cubeful 0-ply 24/18 8/4* Eq.: -0.326 (-0.152)
0.337 0.148 0.006 - 0.663 0.393 0.065
4. Cubeful 0-ply 11/7 10/4* Eq.: -0.420 (-0.245)
0.290 0.080 0.002 - 0.710 0.233 0.023
5. Cubeful 0-ply 11/5 8/4* Eq.: -0.460 (-0.286)
0.270 0.080 0.001 - 0.730 0.310 0.045
</pre>
</article>
<script src="/js/jquery-3.6.0.min.js"></script>
<script src="/js/BgUtil_class.js"></script>
<script src="/js/BgXgid_class.js"></script>
<script src="/js/BgChequer_class.js"></script>
<script src="/js/BgStaticBoard_class.js"></script>
<script>
const categoryid = "KA9";
const probnum = "04";
const showpipflg = false;
const board = new BgBoard("#board", "boardStyle5", "ccw");
board.showBoard("XGID=-BAbCCB-B---a----bcbBbb-a-:1:-1:1:42:0:0:3:0:10");
</script>
<script src="../../js/examscore.js"></script>
<script src="../../js/problempager.js"></script>
</body>
</html>
| html |
import numpy as np
import dnplab as dnp
def get_gauss_3d(std_noise=0.0):
x = np.r_[0:100]
y = np.r_[0:100]
z = np.r_[0:100]
noise = std_noise * np.random.randn(len(x), len(y), len(z))
gauss = np.exp(-1.0 * (x - 50) ** 2.0 / (10.0 ** 2))
gauss_3d = (
gauss.reshape(-1, 1, 1) * gauss.reshape(1, -1, 1) * gauss.reshape(1, 1, -1)
)
gauss_3d += noise
return x, y, z, gauss_3d
def test3d(std_noise=0.0):
x, y, z, gauss_3d = get_gauss_3d(std_noise)
test_data = dnp.DNPData(gauss_3d, ["x", "y", "z"], [x, y, z])
return test_data
| python |
<filename>examples/rss/main.go
package main
import (
"fmt"
"gioui.org/app"
"gioui.org/font/gofont"
"gioui.org/io/system"
"gioui.org/layout"
"gioui.org/widget/material"
"github.com/mmcdole/gofeed"
)
func main() {
gofont.Register()
th := material.NewTheme()
fp := gofeed.NewParser()
feed, _ := fp.ParseURL("http://feeds.twit.tv/twit.xml")
fmt.Println(feed.Title)
go func() {
w := app.NewWindow()
// START INIT OMIT
list := &layout.List{
Axis: layout.Vertical,
}
gtx := layout.NewContext(w.Queue())
// END INIT OMIT
for e := range w.Events() {
if e, ok := e.(system.FrameEvent); ok {
gtx.Reset(e.Config, e.Size)
list.Layout(gtx, len(feed.Items), func(i int) {
f := feed.Items[i]
layout.Flex{Axis: layout.Vertical}.Layout(gtx,
layout.Rigid(func() {
th.H5(f.Title).Layout(gtx)
}),
layout.Rigid(func() {
th.Body1(f.Content).Layout(gtx)
}),
layout.Rigid(func() {
//th.Body2(f.Image).Layout(gtx)
}),
)
})
e.Frame(gtx.Ops)
}
}
}()
app.Main()
}
| go |
The Government should realise that irrespective of any number of killed in Kashmir, it is essential to destroy the terrorists’ factory, that is, Pakistan to completely eliminate the terrorism.
Srinagar (J&K) – An Army Colonel and a Major were among five security personnel martyred in an encounter at a village in Handwara in north Kashmir that also saw the elimination of two terrorists, officials said on 2nd May night.
Army officers Col Ashutosh Sharma and Major Anuj, and Jammu and Kashmir Police Sub-Inspector Shakeel Qazi were among the deceased, they said.
Col Sharma was leading a team to rescue civilians who had been taken hostage by the terrorists hiding in a house at the Chanjmullah area of Handwara in frontier Kupwara District of north Kashmir on Saturday, the officials said.
As the hostages were being rescued, the team, which also consisted of a Lance Naik and a Rifleman, came under heavy fire which was effectively retaliated by the security personnel in the outer cordon, they said. In the early hours of Sunday, a major offensive was launched by the security forces as there had been no contact with the Colonel or his team, the officials said.
Colonel Ashutosh Sharma, the CO [Commanding Officer], who led from the front had been decorated with Sena Medal twice earlier too, He was active in Kashmir for a long period. He is the first Colonel-ranked officer to become martyred while fighting with the terrorists in the last 5 years. Earlier, Col M. N. Roy of 42 Rashtriya Rifles was martyred in January 2015 and Colonel Santosh Mahadik, of 41 Rashtriya Rifles was martyred in November 2015.
Prime Minister Narendra Modi said in his message, “Tributes to our courageous soldiers and security personnel martyred in Handwara. Their valour and sacrifice will never be forgotten. They served the nation with utmost dedication and worked tirelessly to protect our citizens. Condolences to their families and friends”. | english |
{% extends 'recipes/base.html' %}
{% block title %}RESTRICTED{% endblock %}
{% block body_block %}
<div class="hero-unit">
<h1>This Page is Restricted</h1>
{% if user.is_authenticated %}
<strong>You are able to read this because you are logged in</strong><br />
{% else %}
<a href="/recipes/login.html">Please Log In</a>
{% endif %}
</div>
{% endblock %}
| html |
The mental health community has explored the top ten common mental illnesses in students. Teenage years are a vulnerable period in our lives. We explore our identities, transition to adulthood, and step out of childhood as students. The combined effect of these transitions can disorient the student and lead to a mental imbalance.
While there is greater awareness about mental health issues, our students remain at the greatest risk. They are exposed to various life challenges and external stressors that can further impact their well-being.
Teenage mental health challenges have been increasingly recognized and acknowledged in recent years. While the section below covers the top ten most common mental illnesses in students, there can also be other disorders that have a rare occurrence but can equally impact a student's well-being.
Mental health awareness should begin at school. It is crucial to understand and identify the link between teens and mental health in high school. As we explore their connection, the realization will dawn that students are as susceptible to mental health conditions as any other age group.
Note: The following are the top ten common mental illnesses in students. It is also important to note that these conditions are not arranged according to their prevalence or ranking.
MDD is one of the most common mental illnesses in students. Sometimes, it may go unnoticed or undetected due to the labeling of the student as 'lazy' or 'bored'. Unfortunately, students are at the highest risk of developing this condition.
At school, they may experience difficulty paying attention, may sleep during classes, may not be able to participate in activities, or may seem isolated from the rest of the group. The signs and symptoms of teenage depression may not be as evident as they are in adults, and that's why a more thorough assessment is required.
Anxiety lies on a spectrum and can affect students in various ways and forms. For some students, it might manifest as social anxiety—the fear and nervousness in social situations—or panic disorder, characterized as the fear of experiencing recurrent panic attacks. Each student might experience these top ten common mental illnesses in students differently.
While there is greater recognition of anxiety stemming from exams, there is less so for anxiety disorders and their impact on the mental well-being of students. Some of the symptoms of anxiety disorders are worrisome thoughts, physiological symptoms, restlessness, palpitation, and catastrophic thinking.
3) Attention Deficit Hyperactivity Disorder (ADHD)
Many students at an early age get diagnosed with ADHD, which is also linked to emotional problems in teenagers. This condition is characterized by significant difficulties in attention, impulsivity, and hyperactivity. Students can sometimes struggle when it comes to communication with this disorder. Individuals with ADHD may be seen as different and made to feel isolated in social circles.
Communication helps us empathize and get closer to one another, and if your communication is made tricky by your diagnosis, it can start to feel very lonely and isolating. Receiving an accurate ADHD diagnosis is crucial to the treatment process and your well-being journey.
Eating disorders are a range of conditions that are characterized by an unstable pattern of eating, or, in simple words, a difficult relationship with food. Anorexia, bulimia nervosa, and binge eating disorders are the most common types of eating disorders.
Young students are often at risk of developing these conditions due to constant comparison and peer pressure to look 'perfect'. Unlike the prevalent stereotypes, even male students can experience eating dysfunction. A student may start following extreme diets, skip meals, go on never-ending runs, and stash laxatives at home.
Do you know what PTSD is? According to the National Institute of Mental Health, post-traumatic stress disorder (PTSD) is a disorder that develops in some people who have experienced a shocking, scary, or dangerous event. And not everyone with PTSD has experienced a severe negative event. Sometimes, learning that a friend or family member experienced trauma can cause PTSD.
At times students don't realize that what they have experienced is trauma. Research on trauma has shown that emotional neglect, viewing violence at home, any form of abandonment, or childhood abuse can be considered traumatic experiences. A student exposed to these experiences may be vulnerable to developing PTSD.
When students exhibit excessive reactions to a stressful or traumatic incident, they may be diagnosed with adjustment disorder. Stressors lie on a continuum and can be associated with relationships, education, social groups, or communities. Symptoms improve with time if the student receives the right support and help. The main treatment is talk therapy, but some providers might recommend medications like anti-anxiety medications.
What may look like major adjustments for adults may not be the same for students. Major adjustments for students may include moving to a different city, familiar transitions, the loss of a pet, changes in schools, and other factors.
OCD is one of the top ten common mental illnesses in students and also adults. It is still so misunderstood, and there are so many things that we as a community need to understand and grasp. Yes, obsessions and compulsions are the main features, but it can also have additional features. For some students, the worst part of having this disorder isn’t the intrusive thoughts or the rituals, but the loneliness they feel.
This generally stems from the feeling that others can’t comprehend your experience. Students with OCD also get frustrated because they can’t just stop doing rituals or worrying about feeling different and isolated.
If you’re feeling lonely and misunderstood, please know you are not alone. It can be difficult to feel isolated from the rest of the world, but with evidence-based treatment and community, loneliness can be alleviated. Like most mental health conditions, even OCD lies on a continuum. For instance, some students may develop a deep obsession with organization and perfectionism.
Borderline personality disorder (BPD) is a psychological condition characterized by a cluster of symptoms and is also among the top ten most common mental illnesses in students. Those suffering from BPD display an intense fear of abandonment, a need for validation, and distorted thinking. They have an unstable sense of self and identity and often struggle in their interpersonal relationships.
A student with BPD is likely to act out in classes, have an unstable pattern of relationships, and have difficulty mentalizing. Research has moved closer to finding the diagnosis and treatment strategies for students with BPD. Since it is a personality condition, it can be difficult to manage it.
Our society has evolved into a digital one. The most recent version of the DSM now identifies internet gaming disorders. Lately, the number of students dependent on online gaming has surged. However, internet addiction is still not an official diagnosis.
The internet can be viewed as a valuable tool for various reasons. However, these tools have also made us dependent on our devices, so much so that it impacts our well-being. What mental health professionals are seeing is a steep rise in the use of the internet, even by children and students. This not only makes them susceptible to developing addictions but also exposes them to external threats, such as cyberbullying.
When was the last time that you saw a teenager who was not glued to their phone? This heightened use has also become a coping mechanism for parents who may give devices to their children as a way of distracting them. Social media can significantly impact students' mental health.
Suicidal ideation and behavior are among the top ten common mental illnesses in students. These thoughts may not always be around: I want to die" or "I want my life to end." The reality is that suicidal thoughts come in many different shapes and forms. It could show up in the form of feeling hopeless about life or overwhelmed by grief and loss. There is also an unfortunate connection between bullying and suicidal ideation.
The point here is to be aware of these signs, for example, if someone posts something like "No one cares about me in life" on social media", it is always better to reach out to them than potentially regret not doing so in the future. It is crucial to talk to people about the top ten common mental illnesses in students to keep them well informed.
The top ten common mental illnesses in students have become very prevalent, and at some point, everyone can experience some sort of mental health problem. Nonetheless, there are many harmful attitudes toward teenagers' emotional difficulties that fuel stigma and discrimination and make it more difficult to seek help.
The first step that we can take as a community is to spread awareness about the top ten common mental illnesses in students and let people understand the symptoms and features associated with each one of them. The second step is to raise awareness in places such as schools and colleges about the importance of mental health among students.
Janvi Kapur is a counselor with a Master's degree in applied psychology with a specialization in clinical psychology.
What do you think of this story? Tell us in the comments section below.
| english |
FOUR-TIME Shiromani Akali Dal (Badal) legislator from Patti and former cabinet minister Adesh Partap Singh Karion faced the first defeat of his career Saturday. Drug addiction was a major election issue in Punjab and Patti has been badly hit by the menace. Registering his first victory against Karion following three consecutive defeats, Congress candidate Harminder Singh Gill said drug addiction was the biggest issue in Patti, which is part of border district Tarn Taran.
Food and Civil Supplies Minister Adhes Partap Singh Karion based his election campaign on the Atta-Dal scheme run by his department. He had claimed that there were 36,000 beneficiaries of Atta Dal schemes in Patti city alone. He was unavailable for comment Saturday.
Patti had hit headlines last year when a man, Mukhtiar Singh Patti, had taken out procession across the town with dead body of his son on his shoulders and submitted a memorandum to Prime Minister Narendra Modi claiming that his son was a victim of drug addiction.
He said, “Our second priority will be to deal with drug addicts. They need support and sympathy. We will make plan to bring them back in the mainstream. ” Gill was defeated in 2012 by just 59 votes and had lost by 30,000 votes in 2002. Patti falls in ‘Panthak’ district in Tarn Taran where SAD was always strong but lost all four assembly constituencies to Congress in results declared on Saturday.
Gill was also defeated from the Khadoor Sahib Parliamentary seat in 2014 by SAD candidate Ranjit Singh Brahmpura. Gill finally tasted success and won seat by 8,363 votes. He polled 64,671 votes against 56,254 for Karion. AAP candidate Ranjit Singh Cheema got 18,489 votes. Patti has two drug de-addiction centres: An opioid substitution therapy centre and one drug rehabilitation centre. | english |
{"geometry": {"type": "Point", "coordinates": [-93.94, 29.97]}, "type": "Feature", "id": "77651", "properties": {"other_cities": "", "city": "Port Neches", "state": "TX", "county": "Jefferson County"}} | json |
#PRIMARY IMPORTS
import discord, os, datetime, sys, json, traceback, logging
#SECONDARY IMPORTS
from apscheduler.schedulers.asyncio import AsyncIOScheduler
from discord.ext import commands
from data import config
#LOGGING
logger = logging.getLogger("ivry")
logger.debug("errors.py Started")
class Errors(commands.Cog):
def __init__(self, client):
self.client = client
#ERROR MESSAGES
@commands.Cog.listener()
async def on_command_error(self, ctx, error):
if hasattr(ctx.command, 'on_error'):
return
cog = ctx.cog
if cog:
if cog._get_overridden_method(cog.cog_command_error) is not None:
return
ignored = (commands.CommandNotFound)
error = getattr(error, 'original', error)
if isinstance(error, ignored):
return
#COMMAND ERROR
elif isinstance(error, commands.CommandError):
embed = discord.Embed(title=f"Type = `Fatal`",color=0x9B59B6, timestamp=ctx.message.created_at)
embed.set_author(name="IVRY Error", icon_url=self.client.user.avatar_url)
embed.add_field(name = "Error", value="`Internal Command Error`", inline=True)
embed.add_field(name = "Error Point", value=f"`{ctx.command}`", inline=True)
embed.add_field(name = "Trace Back", value=f"```CSS\n{error}```", inline=False)
embed.set_footer(text=f"{config.version} | {config.shards}")
await ctx.send(embed=embed)
print(f'[WARNING] A Fatal internal Command Error occured in execution of {ctx.command}')
logger.debug(f"[ERROR] {ctx.command} | {error}")
#CONVERSION ERROR
elif isinstance(error, commands.ConversionError):
embed = discord.Embed(title = f"Type = `Fatal`",color=0x9B59B6, timestamp=ctx.message.created_at)
embed.set_author(name="IVRY Error", icon_url=self.client.user.avatar_url)
embed.add_field(name = "Error", value="`Internal Command Conversion Error`", inline=True)
embed.add_field(name = "Error Point", value=f"`{ctx.command}`", inline=True)
embed.add_field(name = "Trace Back", value=f"```CSS\n{error}```", inline=False)
embed.set_footer(text=f"{config.version} | {config.shards}")
await ctx.send(embed=embed)
print(f'[WARNING] A Fatal internal Conversion Error occured in execution of {ctx.command}')
logger.debug(f"[ERROR] {ctx.command} | {error}")
#USER INPUT ERROR
elif isinstance(error, commands.UserInputError):
embed = discord.Embed(title = f"Type = `Fatal`",color=0x9B59B6, timestamp=ctx.message.created_at)
embed.set_author(name="IVRY Error", icon_url=self.client.user.avatar_url)
embed.add_field(name = "Error", value="`Internal User Input Error`", inline=True)
embed.add_field(name = "Error Point", value=f"`{ctx.command}`", inline=True)
embed.add_field(name = "Trace Back", value=f"```CSS\n{error}```", inline=False)
embed.set_footer(text=f"{config.version} | {config.shards}")
await ctx.send(embed=embed)
print(f'[WARNING] A Fatal internal User Input Error occured in execution of {ctx.command}')
logger.debug(f"[ERROR] {ctx.command} | {error}")
#MISSING REQUIRED ARGUMENT
elif isinstance(error, commands.MissingRequiredArgument):
embed = discord.Embed(title = f"Type = `Fatal`",color=0x9B59B6, timestamp=ctx.message.created_at)
embed.set_author(name="IVRY Error", icon_url=self.client.user.avatar_url)
embed.add_field(name = "Error", value="`Internal Command Conversion Error`", inline=True)
embed.add_field(name = "Error Point", value=f"`{ctx.command}`", inline=True)
embed.add_field(name = "Trace Back", value=f"```CSS\n{error}```", inline=False)
embed.set_footer(text=f"{config.version} | {config.shards}")
await ctx.send(embed=embed)
print(f'[WARNING] A Fatal internal Conversion Error occured in execution of {ctx.command}')
logger.debug(f"[ERROR] {ctx.command} | {error}")
#TOO MANY ARGUMENTS
elif isinstance(error, commands.TooManyArguments):
embed = discord.Embed(title = f"Type = `Fatal`",color=0x9B59B6, timestamp=ctx.message.created_at)
embed.set_author(name="IVRY Error", icon_url=self.client.user.avatar_url)
embed.add_field(name = "Error", value="`Internal Command Conversion Error`", inline=True)
embed.add_field(name = "Error Point", value=f"`{ctx.command}`", inline=True)
embed.add_field(name = "Trace Back", value=f"```CSS\n{error}```", inline=False)
embed.set_footer(text=f"{config.version} | {config.shards}")
await ctx.send(embed=embed)
print(f'[WARNING] A Fatal internal Conversion Error occured in execution of {ctx.command}')
logger.debug(f"[ERROR] {ctx.command} | {error}")
#BAD ARGUMENT
elif isinstance(error, commands.BadArgument):
embed = discord.Embed(title = f"Type = `Fatal`",color=0x9B59B6, timestamp=ctx.message.created_at)
embed.set_author(name="IVRY Error", icon_url=self.client.user.avatar_url)
embed.add_field(name = "Error", value="`Internal Bad Argument Error`", inline=True)
embed.add_field(name = "Error Point", value=f"`{ctx.command}`", inline=True)
embed.add_field(name = "Trace Back", value=f"```CSS\n{error}```", inline=False)
embed.set_footer(text=f"{config.version} | {config.shards}")
await ctx.send(embed=embed)
print(f'[WARNING] A Fatal internal Bad Argument Error occured in execution of {ctx.command}')
logger.debug(f"[ERROR] {ctx.command} | {error}")
#MESSAGE NOT FOUND
elif isinstance(error, commands.MessageNotFound):
embed = discord.Embed(title = f"Type = `Fatal`",color=0x9B59B6, timestamp=ctx.message.created_at)
embed.set_author(name="IVRY Error", icon_url=self.client.user.avatar_url)
embed.add_field(name = "Error", value="`Internal Message Not Found Error`", inline=True)
embed.add_field(name = "Error Point", value=f"`{ctx.command}`", inline=True)
embed.add_field(name = "Trace Back", value=f"```CSS\n{error}```", inline=False)
embed.set_footer(text=f"{config.version} | {config.shards}")
await ctx.send(embed=embed)
print(f'[WARNING] A Fatal internal Message Not Found Error occured in execution of {ctx.command}')
logger.debug(f"[ERROR] {ctx.command} | {error}")
#MEMBER NOT FOUND
elif isinstance(error, commands.MemberNotFound):
embed = discord.Embed(title = f"Type = `Fatal`",color=0x9B59B6, timestamp=ctx.message.created_at)
embed.set_author(name="IVRY Error", icon_url=self.client.user.avatar_url)
embed.add_field(name = "Error", value="`Internal Member Not Found Error`", inline=True)
embed.add_field(name = "Error Point", value=f"`{ctx.command}`", inline=True)
embed.add_field(name = "Trace Back", value=f"```CSS\n{error}```", inline=False)
embed.set_footer(text=f"{config.version} | {config.shards}")
await ctx.send(embed=embed)
print(f'[WARNING] A Fatal internal Bad Member Not Found occured in execution of {ctx.command}')
logger.debug(f"[ERROR] {ctx.command} | {error}")
#USER NOT FOUND
elif isinstance(error, commands.UserNotFound):
embed = discord.Embed(title = f"Type = `Fatal`",color=0x9B59B6, timestamp=ctx.message.created_at)
embed.set_author(name="IVRY Error", icon_url=self.client.user.avatar_url)
embed.add_field(name = "Error", value="`Internal User Not Found Error`", inline=True)
embed.add_field(name = "Error Point", value=f"`{ctx.command}`", inline=True)
embed.add_field(name = "Trace Back", value=f"```CSS\n{error}```", inline=False)
embed.set_footer(text=f"{config.version} | {config.shards}")
await ctx.send(embed=embed)
print(f'[WARNING] A Fatal internal User Not Found Error occured in execution of {ctx.command}')
logger.debug(f"[ERROR] {ctx.command} | {error}")
#CHANNEL NOT FOUND
elif isinstance(error, commands.ChannelNotFound):
embed = discord.Embed(title = f"Type = `Fatal`",color=0x9B59B6, timestamp=ctx.message.created_at)
embed.set_author(name="IVRY Error", icon_url=self.client.user.avatar_url)
embed.add_field(name = "Error", value="`Internal Channel Not Found Error`", inline=True)
embed.add_field(name = "Error Point", value=f"`{ctx.command}`", inline=True)
embed.add_field(name = "Trace Back", value=f"```CSS\n{error}```", inline=False)
embed.set_footer(text=f"{config.version} | {config.shards}")
await ctx.send(embed=embed)
print(f'[WARNING] A Fatal internal Channel Not Found Error occured in execution of {ctx.command}')
logger.debug(f"[ERROR] {ctx.command} | {error}")
#CHANNEL NOT READABLE
elif isinstance(error, commands.ChannelNotReadable):
embed = discord.Embed(title = f"Type = `Fatal`",color=0x9B59B6, timestamp=ctx.message.created_at)
embed.set_author(name="IVRY Error", icon_url=self.client.user.avatar_url)
embed.add_field(name = "Error", value="`Internal Channel Not Readable Error`", inline=True)
embed.add_field(name = "Error Point", value=f"`{ctx.command}`", inline=True)
embed.add_field(name = "Trace Back", value=f"```CSS\n{error}```", inline=False)
embed.set_footer(text=f"{config.version} | {config.shards}")
await ctx.send(embed=embed)
print(f'[WARNING] A Fatal internal Channel Not Readable Error occured in execution of {ctx.command}')
logger.debug(f"[ERROR] {ctx.command} | {error}")
#BAD COLOR ARGUMENT
elif isinstance(error, commands.BadColourArgument):
embed = discord.Embed(title = f"Type = `Fatal`",color=0x9B59B6, timestamp=ctx.message.created_at)
embed.set_author(name="IVRY Error", icon_url=self.client.user.avatar_url)
embed.add_field(name = "Error", value="`Internal Bad Colour Argument Error`", inline=True)
embed.add_field(name = "Error Point", value=f"`{ctx.command}`", inline=True)
embed.add_field(name = "Trace Back", value=f"```CSS\n{error}```", inline=False)
embed.set_footer(text=f"{config.version} | {config.shards}")
await ctx.send(embed=embed)
print(f'[WARNING] A Fatal internal Bad Colour Argument Error occured in execution of {ctx.command}')
logger.debug(f"[ERROR] {ctx.command} | {error}")
#ROLE NOT FOUND
elif isinstance(error, commands.RoleNotFound):
embed = discord.Embed(title = f"Type = `Fatal`",color=0x9B59B6, timestamp=ctx.message.created_at)
embed.set_author(name="IVRY Error", icon_url=self.client.user.avatar_url)
embed.add_field(name = "Error", value="`Internal Role Not Found Error`", inline=True)
embed.add_field(name = "Error Point", value=f"`{ctx.command}`", inline=True)
embed.add_field(name = "Trace Back", value=f"```CSS\n{error}```", inline=False)
embed.set_footer(text=f"{config.version} | {config.shards}")
await ctx.send(embed=embed)
print(f'[WARNING] A Fatal internal Role Not Found Error occured in execution of {ctx.command}')
logger.debug(f"[ERROR] {ctx.command} | {error}")
#BAD INVITE ARGUMENT
elif isinstance(error, commands.BadInviteArgument):
embed = discord.Embed(title = f"Type = `Fatal`",color=0x9B59B6, timestamp=ctx.message.created_at)
embed.set_author(name="IVRY Error", icon_url=self.client.user.avatar_url)
embed.add_field(name = "Error", value="`Internal Command Conversion Error`", inline=True)
embed.add_field(name = "Error Point", value=f"`{ctx.command}`", inline=True)
embed.add_field(name = "Trace Back", value=f"```CSS\n{error}```", inline=False)
embed.set_footer(text=f"{config.version} | {config.shards}")
await ctx.send(embed=embed)
print(f'[WARNING] A Fatal internal Conversion Error occured in execution of {ctx.command}')
logger.debug(f"[ERROR] {ctx.command} | {error}")
#EMOJI NOT FOUND
elif isinstance(error, commands.EmojiNotFound):
embed = discord.Embed(title = f"Type = `Fatal`",color=0x9B59B6, timestamp=ctx.message.created_at)
embed.set_author(name="IVRY Error", icon_url=self.client.user.avatar_url)
embed.add_field(name = "Error", value="`Internal Emoji Not Found Error`", inline=True)
embed.add_field(name = "Error Point", value=f"`{ctx.command}`", inline=True)
embed.add_field(name = "Trace Back", value=f"```CSS\n{error}```", inline=False)
embed.set_footer(text=f"{config.version} | {config.shards}")
await ctx.send(embed=embed)
print(f'[WARNING] A Fatal internal Emoji Not Found Error occured in execution of {ctx.command}')
logger.debug(f"[ERROR] {ctx.command} | {error}")
#PARTIAL EMOJI CONVERSION FAILURE
elif isinstance(error, commands.PartialEmojiConversionFailure):
embed = discord.Embed(title = f"Type = `Fatal`",color=0x9B59B6, timestamp=ctx.message.created_at)
embed.set_author(name="IVRY Error", icon_url=self.client.user.avatar_url)
embed.add_field(name = "Error", value="`Internal Partial Emoji Conversion Failure Error`", inline=True)
embed.add_field(name = "Error Point", value=f"`{ctx.command}`", inline=True)
embed.add_field(name = "Trace Back", value=f"```CSS\n{error}```", inline=False)
embed.set_footer(text=f"{config.version} | {config.shards}")
await ctx.send(embed=embed)
print(f'[WARNING] A Fatal internal Partial Emoji Conversion Failure Error occured in execution of {ctx.command}')
logger.debug(f"[ERROR] {ctx.command} | {error}")
#BAD BOOL ARGUMENT
elif isinstance(error, commands.BadBoolArgument):
embed = discord.Embed(title = f"Type = `Fatal`",color=0x9B59B6, timestamp=ctx.message.created_at)
embed.set_author(name="IVRY Error", icon_url=self.client.user.avatar_url)
embed.add_field(name = "Error", value="`Internal Bad Bool Argument Error`", inline=True)
embed.add_field(name = "Error Point", value=f"`{ctx.command}`", inline=True)
embed.add_field(name = "Trace Back", value=f"```CSS\n{error}```", inline=False)
embed.set_footer(text=f"{config.version} | {config.shards}")
await ctx.send(embed=embed)
print(f'[WARNING] A Fatal internal Bad Bool Argument Error occured in execution of {ctx.command}')
logger.debug(f"[ERROR] {ctx.command} | {error}")
#BAD UNION ARGUMENT
elif isinstance(error, commands.BadUnionArgument):
embed = discord.Embed(title = f"Type = `Fatal`",color=0x9B59B6, timestamp=ctx.message.created_at)
embed.set_author(name="IVRY Error", icon_url=self.client.user.avatar_url)
embed.add_field(name = "Error", value="`Internal Bad Union Argument Error`", inline=True)
embed.add_field(name = "Error Point", value=f"`{ctx.command}`", inline=True)
embed.add_field(name = "Trace Back", value=f"```CSS\n{error}```", inline=False)
embed.set_footer(text=f"{config.version} | {config.shards}")
await ctx.send(embed=embed)
print(f'[WARNING] A Fatal internal Bad Union Argument Error occured in execution of {ctx.command}')
logger.debug(f"[ERROR] {ctx.command} | {error}")
#ARGUMENT PARSING ERROR
elif isinstance(error, commands.ArgumentParsingError):
embed = discord.Embed(title = f"Type = `Fatal`",color=0x9B59B6, timestamp=ctx.message.created_at)
embed.set_author(name="IVRY Error", icon_url=self.client.user.avatar_url)
embed.add_field(name = "Error", value="`Internal Argument Parsing Error`", inline=True)
embed.add_field(name = "Error Point", value=f"`{ctx.command}`", inline=True)
embed.add_field(name = "Trace Back", value=f"```CSS\n{error}```", inline=False)
embed.set_footer(text=f"{config.version} | {config.shards}")
await ctx.send(embed=embed)
print(f'[WARNING] A Fatal internal Argument Parsing Error occured in execution of {ctx.command}')
logger.debug(f"[ERROR] {ctx.command} | {error}")
#UNEXPECTED QUOTE ERROR
elif isinstance(error, commands.UnexpectedQuoteError):
embed = discord.Embed(title = f"Type = `Fatal`",color=0x9B59B6, timestamp=ctx.message.created_at)
embed.set_author(name="IVRY Error", icon_url=self.client.user.avatar_url)
embed.add_field(name = "Error", value="`Internal Unexpected Quote Error`", inline=True)
embed.add_field(name = "Error Point", value=f"`{ctx.command}`", inline=True)
embed.add_field(name = "Trace Back", value=f"```CSS\n{error}```", inline=False)
embed.set_footer(text=f"{config.version} | {config.shards}")
await ctx.send(embed=embed)
print(f'[WARNING] A Fatal internal Unexpected Quote Error occured in execution of {ctx.command}')
logger.debug(f"[ERROR] {ctx.command} | {error}")
#INVALID END OF QUOTED STRING
elif isinstance(error, commands.InvalidEndOfQuotedStringError):
embed = discord.Embed(title = f"Type = `Fatal`",color=0x9B59B6, timestamp=ctx.message.created_at)
embed.set_author(name="IVRY Error", icon_url=self.client.user.avatar_url)
embed.add_field(name = "Error", value="`Internal Invalid End Of Quoted String Error`", inline=True)
embed.add_field(name = "Error Point", value=f"`{ctx.command}`", inline=True)
embed.add_field(name = "Trace Back", value=f"```CSS\n{error}```", inline=False)
embed.set_footer(text=f"{config.version} | {config.shards}")
await ctx.send(embed=embed)
print(f'[WARNING] A Fatal internal Invalid End Of Quoted String Error occured in execution of {ctx.command}')
logger.debug(f"[ERROR] {ctx.command} | {error}")
#EXPECTED CLOSING QUOTE ERROR
elif isinstance(error, commands.ExpectedClosingQuoteError):
embed = discord.Embed(title = f"Type = `Fatal`",color=0x9B59B6, timestamp=ctx.message.created_at)
embed.set_author(name="IVRY Error", icon_url=self.client.user.avatar_url)
embed.add_field(name = "Error", value="`Internal Expected Closing Quote Error`", inline=True)
embed.add_field(name = "Error Point", value=f"`{ctx.command}`", inline=True)
embed.add_field(name = "Trace Back", value=f"```CSS\n{error}```", inline=False)
embed.set_footer(text=f"{config.version} | {config.shards}")
await ctx.send(embed=embed)
print(f'[WARNING] A Fatal internal Expected Closing Quote Error occured in execution of {ctx.command}')
logger.debug(f"[ERROR] {ctx.command} | {error}")
#COMMAND NOT FOUND
elif isinstance(error, commands.CommandNotFound):
embed = discord.Embed(title = f"Type = `Fatal`",color=0x9B59B6, timestamp=ctx.message.created_at)
embed.set_author(name="IVRY Error", icon_url=self.client.user.avatar_url)
embed.add_field(name = "Error", value="`Internal Command Not Found Error`", inline=True)
embed.add_field(name = "Error Point", value=f"`{ctx.command}`", inline=True)
embed.add_field(name = "Trace Back", value=f"```CSS\n{error}```", inline=False)
embed.set_footer(text=f"{config.version} | {config.shards}")
await ctx.send(embed=embed)
print(f'[WARNING] A Fatal internal Command Not Found Error occured in execution of {ctx.command}')
logger.debug(f"[ERROR] {ctx.command} | {error}")
#CHECK FAILURE
elif isinstance(error, commands.CheckFailure):
embed = discord.Embed(title = f"Type = `Fatal`",color=0x9B59B6, timestamp=ctx.message.created_at)
embed.set_author(name="IVRY Error", icon_url=self.client.user.avatar_url)
embed.add_field(name = "Error", value="`Internal Check Failure Error`", inline=True)
embed.add_field(name = "Error Point", value=f"`{ctx.command}`", inline=True)
embed.add_field(name = "Trace Back", value=f"```CSS\n{error}```", inline=False)
embed.set_footer(text=f"{config.version} | {config.shards}")
await ctx.send(embed=embed)
print(f'[WARNING] A Fatal internal Check Failure Error occured in execution of {ctx.command}')
logger.debug(f"[ERROR] {ctx.command} | {error}")
#CHECK ANY FAILURE
elif isinstance(error, commands.CheckAnyFailure):
embed = discord.Embed(title = f"Type = `Fatal`",color=0x9B59B6, timestamp=ctx.message.created_at)
embed.set_author(name="IVRY Error", icon_url=self.client.user.avatar_url)
embed.add_field(name = "Error", value="`Internal Check Any Failure Error`", inline=True)
embed.add_field(name = "Error Point", value=f"`{ctx.command}`", inline=True)
embed.add_field(name = "Trace Back", value=f"```CSS\n{error}```", inline=False)
embed.set_footer(text=f"{config.version} | {config.shards}")
await ctx.send(embed=embed)
print(f'[WARNING] A Fatal internal Check Any Failure Error occured in execution of {ctx.command}')
logger.debug(f"[ERROR] {ctx.command} | {error}")
#PRIVATE MESSAGE ONLY
elif isinstance(error, commands.PrivateMessageOnly):
embed = discord.Embed(title = f"Type = `Fatal`",color=0x9B59B6, timestamp=ctx.message.created_at)
embed.set_author(name="IVRY Error", icon_url=self.client.user.avatar_url)
embed.add_field(name = "Error", value="`Internal Private Message Only Error`", inline=True)
embed.add_field(name = "Error Point", value=f"`{ctx.command}`", inline=True)
embed.add_field(name = "Trace Back", value=f"```CSS\n{error}```", inline=False)
embed.set_footer(text=f"{config.version} | {config.shards}")
await ctx.send(embed=embed)
print(f'[WARNING] A Fatal internal Private Message Only Error occured in execution of {ctx.command}')
logger.debug(f"[ERROR] {ctx.command} | {error}")
#NO PRIVATE MESSAGE
elif isinstance(error, commands.NoPrivateMessage):
embed = discord.Embed(title = f"Type = `Fatal`",color=0x9B59B6, timestamp=ctx.message.created_at)
embed.set_author(name="IVRY Error", icon_url=self.client.user.avatar_url)
embed.add_field(name = "Error", value="`Internal No Private Message Error`", inline=True)
embed.add_field(name = "Error Point", value=f"`{ctx.command}`", inline=True)
embed.add_field(name = "Trace Back", value=f"```CSS\n{error}```", inline=False)
embed.set_footer(text=f"{config.version} | {config.shards}")
await ctx.send(embed=embed)
print(f'[WARNING] A Fatal internal No Private Message Error occured in execution of {ctx.command}')
logger.debug(f"[ERROR] {ctx.command} | {error}")
#NOT OWNER
elif isinstance(error, commands.NotOwner):
embed = discord.Embed(title = f"Type = `Fatal`",color=0x9B59B6, timestamp=ctx.message.created_at)
embed.set_author(name="IVRY Error", icon_url=self.client.user.avatar_url)
embed.add_field(name = "Error", value="`Internal Not Owner Error`", inline=True)
embed.add_field(name = "Error Point", value=f"`{ctx.command}`", inline=True)
embed.add_field(name = "Trace Back", value=f"```CSS\n{error}```", inline=False)
embed.set_footer(text=f"{config.version} | {config.shards}")
await ctx.send(embed=embed)
print(f'[WARNING] A Fatal internal Not Owner Error occured in execution of {ctx.command}')
logger.debug(f"[ERROR] {ctx.command} | {error}")
#MISSING PERMISSIONS
elif isinstance(error, commands.MissingPermissions):
embed = discord.Embed(title = f"Type = `Fatal`",color=0x9B59B6, timestamp=ctx.message.created_at)
embed.set_author(name="IVRY Error", icon_url=self.client.user.avatar_url)
embed.add_field(name = "Error", value="`Internal Missing Permissions Error`", inline=True)
embed.add_field(name = "Error Point", value=f"`{ctx.command}`", inline=True)
embed.add_field(name = "Trace Back", value=f"```CSS\n{error}```", inline=False)
embed.set_footer(text=f"{config.version} | {config.shards}")
await ctx.send(embed=embed)
print(f'[WARNING] A Fatal internal Missing Permissions Error occured in execution of {ctx.command}')
logger.debug(f"[ERROR] {ctx.command} | {error}")
#MISSING ROLE
elif isinstance(error, commands.MissingRole):
embed = discord.Embed(title = f"Type = `Fatal`",color=0x9B59B6, timestamp=ctx.message.created_at)
embed.set_author(name="IVRY Error", icon_url=self.client.user.avatar_url)
embed.add_field(name = "Error", value="`Internal Missing Role Error`", inline=True)
embed.add_field(name = "Error Point", value=f"`{ctx.command}`", inline=True)
embed.add_field(name = "Trace Back", value=f"```CSS\n{error}```", inline=False)
embed.set_footer(text=f"{config.version} | {config.shards}")
await ctx.send(embed=embed)
print(f'[WARNING] A Fatal internal Missing Role Error occured in execution of {ctx.command}')
logger.debug(f"[ERROR] {ctx.command} | {error}")
#BOT MISSING ROLE
elif isinstance(error, commands.BotMissingRole):
embed = discord.Embed(title = f"Type = `Fatal`",color=0x9B59B6, timestamp=ctx.message.created_at)
embed.set_author(name="IVRY Error", icon_url=self.client.user.avatar_url)
embed.add_field(name = "Error", value="`Internal Bot Missing Role Error`", inline=True)
embed.add_field(name = "Error Point", value=f"`{ctx.command}`", inline=True)
embed.add_field(name = "Trace Back", value=f"```CSS\n{error}```", inline=False)
embed.set_footer(text=f"{config.version} | {config.shards}")
await ctx.send(embed=embed)
print(f'[WARNING] A Fatal internal Bot Missing Role Error occured in execution of {ctx.command}')
logger.debug(f"[ERROR] {ctx.command} | {error}")
#MISSING ANY ROLE
elif isinstance(error, commands.MissingAnyRole):
embed = discord.Embed(title = f"Type = `Fatal`",color=0x9B59B6, timestamp=ctx.message.created_at)
embed.set_author(name="IVRY Error", icon_url=self.client.user.avatar_url)
embed.add_field(name = "Error", value="`Internal Missing Any Role Error`", inline=True)
embed.add_field(name = "Error Point", value=f"`{ctx.command}`", inline=True)
embed.add_field(name = "Trace Back", value=f"```CSS\n{error}```", inline=False)
embed.set_footer(text=f"{config.version} | {config.shards}")
await ctx.send(embed=embed)
print(f'[WARNING] A Fatal internal Missing Any Role Error occured in execution of {ctx.command}')
logger.debug(f"[ERROR] {ctx.command} | {error}")
#BOT MISSING ANY ROLE
elif isinstance(error, commands.BotMissingAnyRole):
embed = discord.Embed(title = f"Type = `Fatal`",color=0x9B59B6, timestamp=ctx.message.created_at)
embed.set_author(name="IVRY Error", icon_url=self.client.user.avatar_url)
embed.add_field(name = "Error", value="`Internal Bot Missing Any Role Error`", inline=True)
embed.add_field(name = "Error Point", value=f"`{ctx.command}`", inline=True)
embed.add_field(name = "Trace Back", value=f"```CSS\n{error}```", inline=False)
embed.set_footer(text=f"{config.version} | {config.shards}")
await ctx.send(embed=embed)
print(f'[WARNING] A Fatal internal Bot Missing Any Role Error occured in execution of {ctx.command}')
logger.debug(f"[ERROR] {ctx.command} | {error}")
#NSFW CHANNEL REQUIRED
elif isinstance(error, commands.NSFWChannelRequired):
embed = discord.Embed(title = f"Type = `Fatal`",color=0x9B59B6, timestamp=ctx.message.created_at)
embed.set_author(name="IVRY Error", icon_url=self.client.user.avatar_url)
embed.add_field(name = "Error", value="`Internal NSFW Channel Required Error`", inline=True)
embed.add_field(name = "Error Point", value=f"`{ctx.command}`", inline=True)
embed.add_field(name = "Trace Back", value=f"```CSS\n{error}```", inline=False)
embed.set_footer(text=f"{config.version} | {config.shards}")
await ctx.send(embed=embed)
print(f'[WARNING] A Fatal internal NSFW Channel Required Error occured in execution of {ctx.command}')
logger.debug(f"[ERROR] {ctx.command} | {error}")
#DISABLED COMMAND
elif isinstance(error, commands.DisabledCommand):
embed = discord.Embed(title = f"Type = `Fatal`",color=0x9B59B6, timestamp=ctx.message.created_at)
embed.set_author(name="IVRY Error", icon_url=self.client.user.avatar_url)
embed.add_field(name = "Error", value="`Internal Disabled Command Error`", inline=True)
embed.add_field(name = "Error Point", value=f"`{ctx.command}`", inline=True)
embed.add_field(name = "Trace Back", value=f"```CSS\n{error}```", inline=False)
embed.set_footer(text=f"{config.version} | {config.shards}")
await ctx.send(embed=embed)
print(f'[WARNING] A Fatal internal Disabled Command Error occured in execution of {ctx.command}')
logger.debug(f"[ERROR] {ctx.command} | {error}")
#COMMAND INVOKE ERROR
elif isinstance(error, commands.CommandInvokeError):
embed = discord.Embed(title = f"Type = `Fatal`",color=0x9B59B6, timestamp=ctx.message.created_at)
embed.set_author(name="IVRY Error", icon_url=self.client.user.avatar_url)
embed.add_field(name = "Error", value="`Internal Command Invoke Error`", inline=True)
embed.add_field(name = "Error Point", value=f"`{ctx.command}`", inline=True)
embed.add_field(name = "Trace Back", value=f"```CSS\n{error}```", inline=False)
embed.set_footer(text=f"{config.version} | {config.shards}")
await ctx.send(embed=embed)
print(f'[WARNING] A Fatal internal Command Invoke Error occured in execution of {ctx.command}')
logger.debug(f"[ERROR] {ctx.command} | {error}")
#COMMAND ON COOLDOWN
elif isinstance(error, commands.CommandOnCooldown):
embed = discord.Embed(title = f"Type = `Fatal`",color=0x9B59B6, timestamp=ctx.message.created_at)
embed.set_author(name="IVRY Error", icon_url=self.client.user.avatar_url)
embed.add_field(name = "Error", value="`Internal Command On Cooldown Error`", inline=True)
embed.add_field(name = "Error Point", value=f"`{ctx.command}`", inline=True)
embed.add_field(name = "Trace Back", value=f"```CSS\n{error}```", inline=False)
embed.set_footer(text=f"{config.version} | {config.shards}")
await ctx.send(embed=embed)
print(f'[WARNING] A Fatal internal Command On Cooldown Error occured in execution of {ctx.command}')
logger.debug(f"[ERROR] {ctx.command} | {error}")
#MAX CONCURRENCY REACHED
elif isinstance(error, commands.MaxConcurrencyReached):
embed = discord.Embed(title = f"Type = `Fatal`",color=0x9B59B6, timestamp=ctx.message.created_at)
embed.set_author(name="IVRY Error", icon_url=self.client.user.avatar_url)
embed.add_field(name = "Error", value="`Internal Max Concurrency Reached Error`", inline=True)
embed.add_field(name = "Error Point", value=f"`{ctx.command}`", inline=True)
embed.add_field(name = "Trace Back", value=f"```CSS\n{error}```", inline=False)
embed.set_footer(text=f"{config.version} | {config.shards}")
await ctx.send(embed=embed)
print(f'[WARNING] A Fatal internal Max Concurrency Reached Error occured in execution of {ctx.command}')
logger.debug(f"[ERROR] {ctx.command} | {error}")
#EXTENSION ERROR
elif isinstance(error, commands.ExtensionError):
embed = discord.Embed(title = f"Type = `Fatal`",color=0x9B59B6, timestamp=ctx.message.created_at)
embed.set_author(name="IVRY Error", icon_url=self.client.user.avatar_url)
embed.add_field(name = "Error", value="`Internal EXT Error`", inline=True)
embed.add_field(name = "Error Point", value=f"`{ctx.command}`", inline=True)
embed.add_field(name = "Trace Back", value=f"```CSS\n{error}```", inline=False)
embed.set_footer(text=f"{config.version} | {config.shards}")
await ctx.send(embed=embed)
print(f'[WARNING] A Fatal internal Extension Error occured in execution of {ctx.command}')
logger.debug(f"[ERROR] {ctx.command} | {error}")
#EXTENSION ALREADY LOADED
elif isinstance(error, commands.ExtensionAlreadyLoaded):
embed = discord.Embed(title = f"Type = `Fatal`",color=0x9B59B6, timestamp=ctx.message.created_at)
embed.set_author(name="IVRY Error", icon_url=self.client.user.avatar_url)
embed.add_field(name = "Error", value="`Internal EXT Already Loaded Error`", inline=True)
embed.add_field(name = "Error Point", value=f"`{ctx.command}`", inline=True)
embed.add_field(name = "Trace Back", value=f"```CSS\n{error}```", inline=False)
embed.set_footer(text=f"{config.version} | {config.shards}")
await ctx.send(embed=embed)
print(f'[WARNING] A Fatal internal Extension Already Loaded Error occured in execution of {ctx.command}')
logger.debug(f"[ERROR] {ctx.command} | {error}")
#EXTENSION NOT LOADED
elif isinstance(error, commands.ExtensionNotLoaded):
embed = discord.Embed(title = f"Type = `Fatal`",color=0x9B59B6, timestamp=ctx.message.created_at)
embed.set_author(name="IVRY Error", icon_url=self.client.user.avatar_url)
embed.add_field(name = "Error", value="`Internal EXT Not Loaded Error`", inline=True)
embed.add_field(name = "Error Point", value=f"`{ctx.command}`", inline=True)
embed.add_field(name = "Trace Back", value=f"```CSS\n{error}```", inline=False)
embed.set_footer(text=f"{config.version} | {config.shards}")
await ctx.send(embed=embed)
print(f'[WARNING] A Fatal internal Extension Not Loaded Error occured in execution of {ctx.command}')
logger.debug(f"[ERROR] {ctx.command} | {error}")
#NO ENTRY POINT ERROR
elif isinstance(error, commands.NoEntryPointError):
embed = discord.Embed(title = f"Type = `Fatal`",color=0x9B59B6, timestamp=ctx.message.created_at)
embed.set_author(name="IVRY Error", icon_url=self.client.user.avatar_url)
embed.add_field(name = "Error", value="`Internal No Entry Point Error`", inline=True)
embed.add_field(name = "Error Point", value=f"`{ctx.command}`", inline=True)
embed.add_field(name = "Trace Back", value=f"```CSS\n{error}```", inline=False)
embed.set_footer(text=f"{config.version} | {config.shards}")
await ctx.send(embed=embed)
print(f'[WARNING] A Fatal internal No Entrypoint Error occured in execution of {ctx.command}')
logger.debug(f"[ERROR] {ctx.command} | {error}")
#EXTENSION FAILED
elif isinstance(error, commands.ExtensionFailed):
embed = discord.Embed(title = f"Type = `Fatal`",color=0x9B59B6, timestamp=ctx.message.created_at)
embed.set_author(name="IVRY Error", icon_url=self.client.user.avatar_url)
embed.add_field(name = "Error", value="`Internal EXT Failed Error`", inline=True)
embed.add_field(name = "Error Point", value=f"`{ctx.command}`", inline=True)
embed.add_field(name = "Trace Back", value=f"```CSS\n{error}```", inline=False)
embed.set_footer(text=f"{config.version} | {config.shards}")
await ctx.send(embed=embed)
print(f'[WARNING] A Fatal internal Extension Failed Error occured in execution of {ctx.command}')
logger.debug(f"[ERROR] {ctx.command} | {error}")
#EXTENSION NOT FOUND
elif isinstance(error, commands.ExtensionNotFound):
embed = discord.Embed(title = f"Type = `Fatal`",color=0x9B59B6, timestamp=ctx.message.created_at)
embed.set_author(name="IVRY Error", icon_url=self.client.user.avatar_url)
embed.add_field(name = "Error", value="`Internal EXT Not Found Error`", inline=True)
embed.add_field(name = "Error Point", value=f"`{ctx.command}`", inline=True)
embed.add_field(name = "Trace Back", value=f"```CSS\n{error}```", inline=False)
embed.set_footer(text=f"{config.version} | {config.shards}")
await ctx.send(embed=embed)
print(f'[WARNING] A Fatal internal Extension Not Found Error occured in execution of {ctx.command}')
logger.debug(f"[ERROR] {ctx.command} | {error}")
#CLIENT EXCEPTION
#COMMAND REGISTRATION ERROR
elif isinstance(error, commands.CommandRegistrationError):
embed = discord.Embed(title = f"Type = `Fatal`",color=0x9B59B6, timestamp=ctx.message.created_at)
embed.set_author(name="IVRY Error", icon_url=self.client.user.avatar_url)
embed.add_field(name = "Error", value="`Internal Command Registration Error`", inline=True)
embed.add_field(name = "Error Point", value=f"`{ctx.command}`", inline=True)
embed.add_field(name = "Trace Back", value=f"```CSS\n{error}```", inline=False)
embed.set_footer(text=f"{config.version} | {config.shards}")
await ctx.send(embed=embed)
print(f'[WARNING] A Fatal internal Command Registration Error occured in execution of {ctx.command}')
logger.debug(f"[ERROR] {ctx.command} | {error}")
else:
print('Ignoring exception in command {}:'.format(ctx.command), file=sys.stderr)
traceback.print_exception(type(error), error, error.__traceback__, file=sys.stderr)
def setup(client):
client.add_cog(Errors(client)) | python |
console.log("start")
const deck = () => {
const names = ['2','3','4','5','6','7','8','9','10','J','Q','K','A'];
const suits = ['Hearts','Diamonds','Spades','Clubs'];
const deckOfCards = names.map(name => suits.map(suit => {
return {
name: name,
suit: suit
}
})
)
.reduce((tempDeck, card) => tempDeck.concat(card));
let currentDeck = [];
let selectedCards = [];
let score = 0;
const genDeck = () => {
let numberOfCards = 10;
currentDeck = [];
if(document.getElementById('easy-rd').checked) {
numberOfCards = 10;
}else if(document.getElementById('medium-rd').checked) {
numberOfCards = 20;
}else if(document.getElementById('hard-rd').checked) {
numberOfCards = 40;
}else if(document.getElementById('night-rd').checked) {
numberOfCards = 52;
}
let tempDeck = deckOfCards.slice();
console.log("deckOfCards: "+deckOfCards.length)
for (let i = 0; i < numberOfCards; i++) {
let index = Math.floor(Math.random() * tempDeck.length);
currentDeck.push(tempDeck[index]);
currentDeck.push(tempDeck[index]);
tempDeck.splice(index, 1);
}
// paint();
}
const shuffle = () => {
let shuffeledDeck = [];
for (var card of currentDeck) {
let index = Math.floor(Math.random() * shuffeledDeck.length);
shuffeledDeck.splice(index, 0, card)
}
currentDeck = shuffeledDeck;
paint();
}
const getDeck = () => currentDeck;
const toggleCardVisibility = (card, bool) => {
if (bool) {
card.querySelector(".name").classList.add("show");
card.querySelector(".suit").classList.add("show");
} else {
card.querySelector(".name").classList.remove("show");
card.querySelector(".suit").classList.remove("show");
}
}
const updateScore = () => {
console.log("you scored a point!");
score++;
document.getElementById("currentScore").innerHTML = score;
}
const compareSelectedCards = () => {
let card1 = selectedCards[0];
let card2 = selectedCards[1];
if (card1.getAttribute('value') == card2.getAttribute('value')) {
updateScore();
makeUsed(card1.id, card2.id);
}
}
const makeUsed = (id1, id2) => {
currentDeck[id1].used = true;
currentDeck[id2].used = true;
let finished = currentDeck.reduce((flag, card) => {
console.log(flag, card.used);
return flag && card.used;
}, true);
if(finished){
let boardDiv = document.getElementById("board");
var gameOverDiv = document.createElement('div');
gameOverDiv.className = "game-over";
gameOverDiv.innerHTML = '<span>You Won!!!</span>';
boardDiv.appendChild(gameOverDiv);
};
}
const clearSelected = () => {
if (selectedCards.length >= 2){
// console.log(currentDeck[selectedCards[0].id].used, currentDeck[selectedCards[1].id].used)
if (!currentDeck[selectedCards[0].id].used && !currentDeck[selectedCards[1].id].false) {
toggleCardVisibility(selectedCards[0], false);
toggleCardVisibility(selectedCards[1], false);
}
selectedCards = [];
}
}
const addToSelected = (card) => {
clearSelected();
if (selectedCards.length < 2) {
if (selectedCards.length == 1 && selectedCards[0].id == card.id)
return;
selectedCards.push(card);
toggleCardVisibility(card, true);
// console.log(selectedCards);
if (selectedCards.length == 2)
compareSelectedCards();
return true;
}
}
const cardClicked = (e) => {
let target = e.target;
if (target !== e.currentTarget){ //If board is selected ignore
if (target.nodeName == "SPAN") //select parent if span is clicked
if (target.parentElement.className == "card") {
target = target.parentElement;
} else return;
if (target.className != "card")
return;
addToSelected(target);
var clickedItem = target.getAttribute('value');
// console.log("Hello " + clickedItem);
}
e.stopPropagation();
}
const paint = () => {
if (document.getElementById("board"))
document.getElementById("board").remove();
let boardDiv = document.createElement('div');
boardDiv.setAttribute('id', 'board');
let count = 0;
console.log("currentDeck: "+currentDeck.length);
for(var card of currentDeck) {
let div = document.createElement("div");
let clicked = 0;
let previousCards = [];
let ascii;
card.id = count;
div.className = "card";
div.setAttribute('value', card.name + card.suit);
div.setAttribute('id', count++);
if(card.suit == 'Diamonds') {
ascii = "♦";
} else {
ascii = "&" + card.suit.toLowerCase() + ';';
}
card.id = count;
div.innerHTML = '<span class="name">' + card.name + '</span><span class="suit">' + ascii + '</span>';
boardDiv.appendChild(div);
}
let gameDiv = document.getElementById("memory-game");
gameDiv.appendChild(boardDiv);
boardDiv.addEventListener("click", cardClicked, false)
// paintControls();
}
const paintControls = () => {
if (document.getElementById("game-controls"))
document.getElementById("game-controls").remove();
let gameDiv = document.getElementById("memory-game");
var scoreDiv = document.createElement('div');
scoreDiv.setAttribute("id", "game-controls");
scoreDiv.classList.add("game-controls");
scoreDiv.innerHTML = '<span class="score"><small>Score: </small><span id="currentScore">' + score + '</span></span>'+
'<button id="start-button">Start</button>'+
'<span class="radio-group">'+
'<input class="radio-input" type="radio" id="easy-rd" name="radio-category" checked/><label class="radio-label" for="easy-rd">Easy <small>(10 pairs)</small></label>'+
'<input class="radio-input" type="radio" id="medium-rd" name="radio-category"/><label class="radio-label" for="medium-rd">Medium <small>(20 pairs)</small></label>'+
'<input class="radio-input" type="radio" id="hard-rd" name="radio-category"/><label class="radio-label" for="hard-rd">Hard <small>(40 pairs)</small></label>'+
'<input class="radio-input" type="radio" id="night-rd" name="radio-category"/><label class="radio-label" for="night-rd">Hard <small>(52 pairs)</small></label>'+
'</span>';
gameDiv.appendChild(scoreDiv);
document.getElementById("start-button").addEventListener("click", (e) => {
// e.target.disabled = true;
genDeck();
shuffle();
}, false)
}
return {
deckOfCards,
genDeck,
shuffle,
getDeck,
paintControls
};
}
const deck1 = deck();
deck1.paintControls();
// deck1.genDeck();
// deck1.shuffle(); | javascript |
#container {
position: relative;
display: inline-block;
font-family: sans-serif;
}
svg {
border: 1px solid;
border-radius: 5px;
}
#tooltip {
position: absolute;
border-radius: 5px;
padding: 5px;
background-color: black;
color: white;
opacity: 0.8;
text-align: center;
}
| css |
Rakul Preet Singh turns Dr Fatima for 'Doctor G'
Rakul Preet Singh has bagged yet another important project in Bollywood. She has been enlisted to play a medico in 'Doctor G', which is headlined by the versatile Ayushmann Khurrana. Helmed by Anubhuti Kashyap, the is a campus comedy that has the male lead playing a doctor named Dr Uday Gupta.
"And finally super happy to share this with you all !! Dr Uday and Dr Fatima coming soooon," Rakul today wrote, reacting to the news.
Rakul is also doing two other Hindi films. Titled 'Thank God', one of them is a comedy entertainer starring Ajay Devgn. The other one is 'Mayday', starring Ajay Devgn and Amitabh Bachchan. The latter has her in the role of a pilot.
The 'Nannaku Prematho' actress's next release in Telugu is 'Check', starring Nithiin in the lead. As a lawyer, she bats for the male lead in this Chandrasekhar Yeleti flick.
Follow us on Google News and stay updated with the latest!
| english |
Mentored more than 10000 Students.
Mentored more than 10000 Students.
Mentored more than 10000 Students.
Ques: Why prepare with Safalta. com?
Ques: How to get the access of course?
Ans: Student can directly buy the course by visiting below links directed towards Safalta App or Safalta. com website.
Ques: Does this course cover UP Board and other NCERT based State Boards?
Ans: Yes. This course has been designed for UP Board along with other NCERT based State Boards and CBSE Board. Students will get the benefit from this course for their future competitive exams as well.
Ques: What is the Teaching Methodology Safalta. com adopted?
Ques: How will the classes be conducted?
Ans: Classes will be conducted on Safalta App in live mode. Students will be able to see the classes schedule on app and link will be provided to join the classes.
Ques: In which language classes are going to be conducted?
Ans: Teachers will be using a mix of English and Hindi so that the students of both English and Hindi mediums can be benefited by the classes.
Ques: At what time of the day classes will be conducted?
Ans: For 10th board classes will be conducted during 6:00 PM to 9:30 PM Monday to Saturday and for 12th board classes will be conducted between 4:00 PM to 9:00 PM Monday to Saturday.
Ques: How will I get my doubts solved?
Ans: Students can ask the doubts any time on the Safalta App our team of experts will be solving the doubts 24*7.
Ques: What are the subjects going to be covered in 12th Board online live session by Safalta. com?
Ans: Class 12th boards can be called as the foundation of higher classes which is extremely important for career and thus it is important for students to learn and understand the concepts thoroughly. So, to help you with Class 12th subjects we have listed the subjects included in this course.
Ques: Where would the students get the recorded classes, PDF notes and practice questions?
Ans: Students will be getting the recorded classes PDF notes and practice questions on Safalta App.
Ques: Are these classes going to provide any benefits for my future competitions?
Ans: Yes, you are going to the get the classes by expert teachers they have more than 10 years of teaching experience in teaching board students and other reputed competitive examinations like JEE NEET NDA KVPY NTSE and Olympiad.
Ques: Will I get all subjects classes in INR 299?
Ans: Yes, You will get all subjects classes in INR 299 and you can buy any subject in just INR 99.
Ques: How to Connect with a support specialist team?
10+ Years of Experience Manish Sir is a mentor cum friend in teaching Hindi. He has qualified CTET, DSSSB, TGT exam multiple times. he teaches in a manner that is easy to understand and focussed on the latest exam trends.
22 years of Teaching Experience for Boards/JEE/NTSE/KVPY Students, Mentored more than 100000 Students.
Studied from London, Cambridge University Exp: 10+ Year Trained students from 6-45 years from Hungary, France, Argentina, Kazakhstan and India also Trained students/trainees for IELTS, Basic English, Accent Neutralization and Phonetics.
Seems like you are not sure about this course.
How about a special 10% discount. | english |
On the latest episode of his podcast, The Schaub Show, Brendan Schaub gave his thoughts on Jorge Masvidal possibly facing charges after attacking Colby Covington in Miami. The former UFC heavyweight stated that while he likes Masvidal, he disapproves of how 'Gamebred' chose to attack Covington.
Harking back to their UFC 272 headliner, Schaub pointed out that Jorge Masvidal had five rounds and a big paycheck to do as he pleased with Covington but failed to get his desired outcome. In fact, the Cuban native was utterly smothered and overwhelmed by 'Chaos'. Schaub said:
"You [Jorge Masvidal] got your a*s whooped... Colby beat his a*s for 25 minutes, dude. And then you [Masvidal] retaliate by finding out what restaurant's he at and sucker-punching him?... It's so stupid, and for what? Did it feel good to sucker-punch a guy and clip his tooth when you got literally destroyed for 25 minutes legally by commission in the sport?"
Brendan Schaub proceeded to slam all those supporting sucker-punching of any kind, calling it "the most b**ch sh*t in the world." Alluding to the recent controversy of Will Smith slapping Chris Rock at the Academy Awards, Schaub continued:
"Will Smith, basically a cheap shot, too. It's just b**ch tendencies, dude. Soft sh*t. Society's getting softer and softer. Anybody who's sticking up for Will Smith, sticking up for Masvidal - it's just soft, beta, soy boy sh*t."
Schaub urged Masvidal to make better choices to send a better message to his children.
Watch the segment and full episode below:
Although Schaub made it clear that he doesn't support sucker-punching, he did take the time to try and persuade Colby Covington to drop the charges. Given Covington and Masvidal's long history and the fact that 'Gamebred' is a father, Schaub said:
"I was surprised he [Covington] is pressing charges... If you press charges and he [Masvidal] is found guilty, which he will be, he's looking at time, dude. You really want to put Masvidal away for, I don't know, 2 years, 3 years, over this? Seems a little excessive. I wish, you know, someone can get in Colby's ear and just be like, 'Don't press charges, dude. Don't do that, man.'"
The MMA world appears to be divided in its opinion on whether Colby Covington should pursue legal action, primarily due to Jorge Masvidal's name value and the fact that he's in the final run of his career.
| english |
<reponame>afrostalin/CEVPlayer
// Copyright (C) 2017-2020 <NAME>. All rights reserved. Contacts: <<EMAIL>>
// License: https://github.com/afrostalin/CEVPlayer/blob/master/LICENSE
#include "StdAfx.h"
#include "PluginEnv.h"
#include "TextureVideoPlayerComponent.h"
#include "Video/TextureVideoQueue.h"
#include <CrySchematyc/Utils/EnumFlags.h>
#include <CrySchematyc/Env/Elements/EnvComponent.h>
#include <CrySchematyc/Env/Elements/EnvFunction.h>
#include <CrySchematyc/Env/Elements/EnvSignal.h>
#include <CrySchematyc/ResourceTypes.h>
#include <CrySchematyc/MathTypes.h>
#include <CrySchematyc/IObject.h>
namespace CEVPlayer
{
static void ReflectType(Schematyc::CTypeDesc<CTextureVideoPlayerComponent::SOnStartPlaySignal>& desc)
{
desc.SetGUID("672B590C-E387-4357-BDD0-A3C3884277C5"_cry_guid);
desc.SetLabel("OnStartPlay");
desc.SetDescription("Executed when video start playing to texture");
}
static void ReflectType(Schematyc::CTypeDesc<CTextureVideoPlayerComponent::SOnPausedSignal>& desc)
{
desc.SetGUID("92C48065-FC02-4CD3-A609-AF6384498627"_cry_guid);
desc.SetLabel("OnPaused");
desc.SetDescription("Executed when video paused");
}
static void ReflectType(Schematyc::CTypeDesc<CTextureVideoPlayerComponent::SOnResumedSignal>& desc)
{
desc.SetGUID("176C5938-389B-470F-886D-CD13A82D9744"_cry_guid);
desc.SetLabel("OnResumed");
desc.SetDescription("Executed when video resumed");
}
static void ReflectType(Schematyc::CTypeDesc<CTextureVideoPlayerComponent::SOnStoppedSignal>& desc)
{
desc.SetGUID("7F0EFF91-47B4-45F1-982E-F15613C9D4FB"_cry_guid);
desc.SetLabel("OnStopped");
desc.SetDescription("Executed when video stopped");
}
void CTextureVideoPlayerComponent::Register(Schematyc::CEnvRegistrationScope& componentScope)
{
{
auto pFunction = SCHEMATYC_MAKE_ENV_FUNCTION(&CTextureVideoPlayerComponent::Play, "1240FF98-3145-48BD-B282-4AEC7D647C1D"_cry_guid, "Play");
pFunction->SetDescription("Start play video to texture");
pFunction->SetFlags(Schematyc::EEnvFunctionFlags::Construction);
pFunction->BindInput(1, 'val1', "VideoFilename", "Video file name without folder and extension (e.g. logo)");
pFunction->BindInput(2, 'val2', "OutputTextureName", "Output texture name for using in materials. Can't be null");
pFunction->BindInput(3, 'val3', "IsPreloaded", "File will be preloaded in memory before playing");
pFunction->BindInput(4, 'val4', "IsLooped", "Video can be looped here");
pFunction->BindInput(5, 'val5', "CanPlayInEditor", "Video can be play in editor");
componentScope.Register(pFunction);
}
{
auto pFunction = SCHEMATYC_MAKE_ENV_FUNCTION(&CTextureVideoPlayerComponent::Pause, "33121C57-8DDE-4845-9357-F4E34F6E77C9"_cry_guid, "Pause");
pFunction->SetDescription("Pause current playing video");
pFunction->SetFlags(Schematyc::EEnvFunctionFlags::Construction);
componentScope.Register(pFunction);
}
{
auto pFunction = SCHEMATYC_MAKE_ENV_FUNCTION(&CTextureVideoPlayerComponent::Resume, "B6D31737-C79E-4A36-874D-A685A7C6E9FC"_cry_guid, "Resume");
pFunction->SetDescription("Resume paused video");
pFunction->SetFlags(Schematyc::EEnvFunctionFlags::Construction);
componentScope.Register(pFunction);
}
{
auto pFunction = SCHEMATYC_MAKE_ENV_FUNCTION(&CTextureVideoPlayerComponent::Stop, "1EA6B0BD-4ED5-4C66-9AE0-1CC92DAD6AF7"_cry_guid, "Stop");
pFunction->SetDescription("Stop playing video");
pFunction->SetFlags(Schematyc::EEnvFunctionFlags::Construction);
componentScope.Register(pFunction);
}
componentScope.Register(SCHEMATYC_MAKE_ENV_SIGNAL(CTextureVideoPlayerComponent::SOnStartPlaySignal));
componentScope.Register(SCHEMATYC_MAKE_ENV_SIGNAL(CTextureVideoPlayerComponent::SOnPausedSignal));
componentScope.Register(SCHEMATYC_MAKE_ENV_SIGNAL(CTextureVideoPlayerComponent::SOnResumedSignal));
componentScope.Register(SCHEMATYC_MAKE_ENV_SIGNAL(CTextureVideoPlayerComponent::SOnStoppedSignal));
}
void CTextureVideoPlayerComponent::ReflectType(Schematyc::CTypeDesc<CTextureVideoPlayerComponent>& desc)
{
desc.SetGUID("1AE1AB31-50A4-4D83-BAF0-FFB48CABF0B2"_cry_guid);
desc.SetEditorCategory("Video");
desc.SetLabel("TextureVideoPlayer");
desc.SetDescription("Play video to texture");
desc.SetIcon("icons:General/Camera.ico");
desc.SetComponentFlags({ IEntityComponent::EFlags::Attach, IEntityComponent::EFlags::ClientOnly });
desc.AddMember(&CTextureVideoPlayerComponent::m_IsAutoPlay, 'auto', "autoplay", "IsAutoPlay", "If set it to true - video start play when game started", false);
desc.AddMember(&CTextureVideoPlayerComponent::m_VideoFileName, 'vide', "videofile", "VideoFileName", "Video file name witout folder and extension", "");
desc.AddMember(&CTextureVideoPlayerComponent::m_OutputFileName, 'text', "outtexture", "OutputTextureName", "Output texture name for using in materials. Can't be null. Need start for $ simbol. (e.g. $videoplayer_1)", "");
desc.AddMember(&CTextureVideoPlayerComponent::m_IsPreloaded, 'prel', "preloaded", "IsPreloaded", "If set it to true - before playing video his will be loaded in memory", true);
desc.AddMember(&CTextureVideoPlayerComponent::m_IsLooped, 'loop', "looped", "IsLooped", "If set it to true - video will be looped", false);
desc.AddMember(&CTextureVideoPlayerComponent::m_IsCanPlayInEditor, 'edit', "canplayineditor", "IsCanPlayInEditor", "If set it to true - video can be played in editor mode", false);
}
void CTextureVideoPlayerComponent::Initialize()
{
}
void CTextureVideoPlayerComponent::OnShutDown()
{
Stop();
}
Cry::Entity::EventFlags CTextureVideoPlayerComponent::GetEventMask() const
{
return EEntityEvent::GameplayStarted;
}
void CTextureVideoPlayerComponent::ProcessEvent(const SEntityEvent& event)
{
switch (event.event)
{
case EEntityEvent::GameplayStarted:
{
if (m_IsAutoPlay)
{
Play(m_VideoFileName, m_OutputFileName, m_IsPreloaded, m_IsLooped, m_IsCanPlayInEditor);
}
break;
}
default:
break;
}
}
void CTextureVideoPlayerComponent::Play(Schematyc::CSharedString videoFile, Schematyc::CSharedString outputTexture, bool preload, bool looped, bool canPlayInEditor)
{
if (videoFile.empty())
{
LogError("<CTextureVideoPlayerComponent> Can't play video, because video file name empty, check you component settings and try again!");
return;
}
if (outputTexture.empty())
{
LogError("<CTextureVideoPlayerComponent> Can't play video, because output texture name empty, check you component settings and try again!");
return;
}
if (gEnv->IsEditor() && !canPlayInEditor)
{
LogError("<CTextureVideoPlayerComponent> Can't play video, because playing blocking in editor mode!");
return;
}
if (!m_IsAutoPlay)
{
m_VideoFileName = videoFile;
m_OutputFileName = outputTexture;
m_IsPreloaded = preload;
m_IsLooped = looped;
m_IsCanPlayInEditor = canPlayInEditor;
}
if (mEnv != nullptr && mEnv->pTextureVideoQueue != nullptr)
{
mEnv->pTextureVideoQueue->PlayVideo(this, videoFile.c_str(), outputTexture.c_str(), preload, looped);
}
}
void CTextureVideoPlayerComponent::Pause()
{
if (mEnv != nullptr && mEnv->pTextureVideoQueue != nullptr)
{
mEnv->pTextureVideoQueue->PauseVideo(m_OutputFileName.c_str());
}
}
void CTextureVideoPlayerComponent::Resume()
{
if (mEnv != nullptr && mEnv->pTextureVideoQueue != nullptr)
{
mEnv->pTextureVideoQueue->ResumeVideo(m_OutputFileName.c_str());
}
}
void CTextureVideoPlayerComponent::Stop()
{
if (mEnv != nullptr && mEnv->pTextureVideoQueue != nullptr)
{
mEnv->pTextureVideoQueue->StopVideo(m_OutputFileName.c_str());
}
}
void CTextureVideoPlayerComponent::OnVideoPlayerEvent(const char* videoFileName, EVideoPlayerEvents event)
{
if (gEnv->pSystem != nullptr && gEnv->pSystem->IsQuitting())
{
return;
}
Schematyc::IObject* const pSchematycObject = m_pEntity->GetSchematycObject();
if (pSchematycObject == nullptr)
{
return;
}
switch (event)
{
case EVideoPlayerEvents::OnPlay:
pSchematycObject->ProcessSignal(SOnStartPlaySignal(), GetGUID());
break;
case EVideoPlayerEvents::OnPause:
pSchematycObject->ProcessSignal(SOnPausedSignal(), GetGUID());
break;
case EVideoPlayerEvents::OnResume:
pSchematycObject->ProcessSignal(SOnResumedSignal(), GetGUID());
break;
case EVideoPlayerEvents::OnStop:
pSchematycObject->ProcessSignal(SOnStoppedSignal(), GetGUID());
break;
default:
break;
}
}
} | cpp |
{"DOMAIN":"Bacteria","PHYLUM":"Firmicutes","CLASS":"Bacilli","ORDER":"Bacillales","FAMILY":"Bacillaceae","GENUS":"Bacillus","SPECIES":"bacillus cereus","STRAIN":"null","MISC":"null","GENOME":"multiple strains","JSONCREATED":"null"} | json |
The US on Tuesday said it supports India's emergence as a leading global power and a vital partner in efforts to ensure that the strategic Indo-Pacific is a region of peace, stability, and growing prosperity and economic inclusion, as America's top diplomat arrived in New Delhi on his first visit.
In a fact sheet, the State Department said the defence cooperation between the US and India was reaching new heights, including through information sharing, liaison officers, and increasingly complex exercises like Malabar.
The United States supports India's emergence as a leading global power and vital partner in efforts to ensure that the Indo-Pacific is a region of peace, stability, and growing prosperity and economic inclusion, it said after Secretary of State Antony Blinken landed in New Delhi on a two-day visit.
During his maiden visit to India as the top American diplomat, Blinken will meet Prime Minister Narendra Modi and External Affairs Minister S Jaishankar to discuss a wide range of issues, including continued cooperation on COVID-19 response efforts, Indo-Pacific engagement, shared regional security interests, shared democratic values, and addressing the climate crisis.
US-India defense cooperation is reaching new heights, including through information sharing, liaison officers, increasingly complex exercises like Malabar, and defense enabling agreements, such as the secure communications agreement COMCASA. As of 2020, the United States has authorized over USD 20 billion in defense sales to India, the State Department said.
Through the US-India Defense Technology and Trade Initiative, the United States and India work together on co-production and co-development of defence equipment. The United States and India are also closely coordinating on regional security issues, such as Afghanistan, it said.
According to the fact sheet, the two countries cooperate on a wide range of diplomatic, economic and security issues, including defence, non-proliferation, regional cooperation in the Indo-Pacific, shared democratic values, counterterrorism, climate change, health, energy, trade and investment, peacekeeping, the environment, education, science and technology, agriculture, space, and oceans.
India, the US and several other world powers have been talking about the need to ensure a free, open and thriving Indo-Pacific in the backdrop of China's rising military manoeuvring in the region. The Chinese military is also actively eying the strategic Indian Ocean region to step up Beijing's influence.
China claims nearly all of the disputed South China Sea, though Taiwan, the Philippines, Brunei, Malaysia, and Vietnam all claim parts of it. Beijing has built artificial islands and military installations in the South China Sea.
In 2017, India, Australia, Japan, and the US gave shape to the long-pending proposal of setting up the 'Quad' or the Quadrilateral coalition to counter China's aggressive behaviour in the Indo-Pacific region.
In 2008, the United States and India signed an agreement, making India a full partner in the governance and funding of the Fulbright Programme. An increase in exchanges under the agreement has allowed for the development of new and innovative programmes, and India now has the largest Fulbright Scholar (faculty) programme in the world.
In FY 2019, this funding provided opportunities for 61 US Scholars, 66 Indian Scholars, 80 US students, including 29 English Teaching Assistants, and 55 Indian students, including 13 Foreign Language Teaching Assistants.
The United States and India are working to expand cooperation in international organisations. America welcomed India joining the UN Security Council in January 2021 for a two-year term. In October 2020, India hosted the third 2+2 Ministerial Dialogue, and the United States looks forward to the next 2+2 later this year, the fact sheet said.
Asserting that India is a leading global power and a key US partner in the Indo-Pacific and beyond, the State Department said at the inaugural Quad Leaders' Summit in March, President Joe Biden and Prime Minister Modi joined their Japanese and Australian counterparts in pledging to respond to the economic and health impacts of COVID-19.
The four leaders also agreed to combat the climate crisis, and address shared challenges, including in cyber-space, critical technologies, counterterrorism, quality infrastructure investment, humanitarian assistance and disaster relief, and maritime security.
Noting that the US stands with the people of India as they continue to battle the COVID-19 pandemic, it said the US has contributed more than USD 200 million for India's COVID-19 relief and response efforts since the pandemic began, including more than USD 50 million in emergency supplies and training for more than 218,000 frontline health workers on infection prevention and control, benefitting more than 43 million Indians.
Earlier this year, the US and India initiated renewal of a memorandum of understanding to collaborate through an International Center of Excellence in Research focused on infectious diseases, including COVID-19 and other emerging threats.
The United States and India are partnering to strengthen the global response to COVID-19, on issues ranging from addressing infectious disease outbreaks to strengthening health systems to securing global supply chains, said the fact sheet.
US pharmaceutical companies have coordinated with Indian companies since the beginning of the pandemic. This cooperation includes voluntary licensing and technology transfer agreements to increase global manufacturing capacity for COVID-19 vaccines, therapies, and conducting clinical trials, it said.
The State Department said that it looks forward to furthering cooperation with India on tackling the climate crisis and raising global ambition ahead of the 26th UN Climate Change Conference of the Parties (COP26) in Glasgow, United Kingdom, in November.
(Only the headline and picture of this report may have been reworked by the Business Standard staff; the rest of the content is auto-generated from a syndicated feed. ) | english |
Thank you for making FranchiseIndia 2016 A Grand Success.
Prestigious Brands.
Premium Investor. Real Advice.
The vision of the Growth Summit will be to mainly focus on Building high growth Consumer Industry Businessess.
The Consumer Industry today is more directed and personalized where; the changing face of the consumer, evolving geopolitical dynamics, new patterns of personal consumption, technological advancements, and structural industry shifts have largely affected the industry to change and become more consumer driven.
Pau Abello PellicerPau Abello PellicerManaging Director, Roca Bathroom Products Pvt. Ltd.
Session Highlights:
Session Highlights:
- How to find your `entrepreneurial sweet spot`. Finding the best business idea for you.
- Qualifying the idea: What risks should be considered when launching your startup?
- How scalable is it for you to launch new products or offering?
- What is the best launch strategy for a startup?
Session Highlights:
Session Highlights:
| english |
<gh_stars>1-10
{"url": "https://popculture.com/celebrity/2017/06/11/scott-disick-fathers-day-plans-kourtney-kardashian/", "text": "<NAME> has big summer plans!\n\nThe father of three is back in the U.S. now after his quick trip to the French Riviera and dished about his upcoming summer party schedule to E! News.\n\n\"I haven't made any specific plans, but probably do a little bit more traveling. A little Hamptons. A little Europe. Not exactly positive. I'm trying to figure it out now, but hoping to get to see some of my best friends from back home,\" she said.\n\nUP NEXT: Kourtney Kardashian Spills Her Best Tips for Sexy Curves and a Tight Tummy\n\nWhen asked about whether or not he had any Father's Day plans with Mason, Penelope and Reign, Disick admitted he didn't.\n\n\"I don't know if I made those plans. I think someone should make them for me,\" he said. \"I didn't make any, but hopefully someone made some for me, but we'll see!\"\n\nLast year, the reality star said he had a wonderful time on the holiday.\n\nMORE NEWS: <NAME> and Kourtney Kardashian Aren't Speaking After His Wild Cannes Trip\n\n\"Last year we had an awesome time. We went to the zoo, had a great time, had lunch on the water in Santa Barbara, it was as good as I could've asked for I guess,\" he said.\n\nWith all the rumored drama surrounding Disick and ex Kourtney Kardashian, we wonder if she'll be up for making those Father's Day plans this year?", "images": ["https://media.comicbook.com/2017/01/scott-disick-228892.jpg"], "top_img": "https://media.comicbook.com/2017/01/scott-disick-228892.jpg", "keywords": [], "authors": [], "canonical_link": "https://popculture.com/celebrity/2017/06/11/scott-disick-fathers-day-plans-kourtney-kardashian/", "title": "<NAME> Admits He Doesn't Have Any Father's Day Plans While Partying in Vegas", "meta_data": {"description": "<NAME> has big summer plans!The father of three is back in the U.S. now after his quick trip to the French Riviera and dished about his upcoming summer party schedule to E! News.'I haven't made any specific plans, but probably do a little bit more traveling. A little Hamptons. A little [...]", "keywords": "Kourtney Kardashian,Keeping Up With the Kardashians", "twitter": {"card": "summary", "site": "ComicBook", "creator": "ComicBook", "title": "<NAME> Admits He Doesn't Have Any Father's Day Plans While Partying in Vegas", "description": "<NAME> has big summer plans!The father of three is back in the U.S. now after his quick [...]", "image": "https://media.comicbook.com/2017/01/scott-disick-228892.jpg"}, "og": {"title": "<NAME> Admits He Doesn't Have Any Father's Day Plans While Partying in Vegas", "type": "article", "url": "https://popculture.com/celebrity/2017/06/11/scott-disick-fathers-day-plans-kourtney-kardashian/", "image": {"identifier": "https://media.comicbook.com/2017/01/scott-disick-228892.jpg", "width": 640, "height": 320}, "site_name": "Celebrity", "description": "<NAME> has big summer plans!The father of three is back in the U.S. now after his quick [...]"}, "fb": {"app_id": 398373180287205, "pages": 1075190092524035}, "google-site-verification": "iPoSsgn-BS2aFT9iphBFS8eF6I23H2Le3DRVOCodjJg", "p": {"domain_verify": "<KEY>"}, "viewport": "width=device-width, initial-scale=1, maximum-scale=1,user-scalable=0", "theme-color": "#ffffff"}, "movies": [], "publish_date": 1497153600.0, "source": "https://popculture.com", "summary": ""} | json |
package com.messagebus.client.api;
import com.google.common.base.Strings;
import com.messagebus.client.IRequestListener;
import com.messagebus.client.MessageResponseTimeoutException;
import com.messagebus.client.Messagebus;
import com.messagebus.client.MessagebusSinglePool;
import com.messagebus.client.core.BaseTestCase;
import com.messagebus.client.message.model.Message;
import com.messagebus.client.message.model.MessageFactory;
import com.messagebus.common.Constants;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.util.concurrent.TimeUnit;
/**
* Created by yanghua on 3/20/15.
*/
public class RequestResponse extends BaseTestCase {
private static final Log logger = LogFactory.getLog(RequestResponse.class);
@Override
public void setUp() throws Exception {
}
@Override
public void tearDown() throws Exception {
}
public void testRequestAndResponse() throws Exception {
new Thread(new Runnable() {
@Override
public void run() {
final String secret = "muciasnajjkasbdfbaskjdfkjkasja";
MessagebusSinglePool singlePool = new MessagebusSinglePool(zkConnectionStr);
final Messagebus client = singlePool.getResource();
client.response(secret, new IRequestListener() {
@Override
public Message onRequest(Message requestMsg) {
if (Strings.isNullOrEmpty(requestMsg.getCorrelationId())) {
logger.info("got requested message : " + requestMsg.getCorrelationId());
}
assertNotNull(requestMsg);
assertEquals("test", new String(requestMsg.getContent(), Constants.CHARSET_OF_UTF8));
Message respMsg = MessageFactory.createMessage();
respMsg.setContentType("text/plain");
respMsg.setContentEncoding("utf-8");
respMsg.setCorrelationId(requestMsg.getCorrelationId());
respMsg.setContent("test".getBytes(Constants.CHARSET_OF_UTF8));
return respMsg;
}
}, 15, TimeUnit.SECONDS);
singlePool.returnResource(client);
singlePool.destroy();
}
}).start();
String secret = "<KEY>";
String token = "<KEY>";
MessagebusSinglePool singlePool = new MessagebusSinglePool(zkConnectionStr);
Messagebus client = singlePool.getResource();
Message msg = MessageFactory.createMessage();
msg.setContentType("text/plain");
msg.setContentEncoding("utf-8");
msg.setContent("test".getBytes(Constants.CHARSET_OF_UTF8));
Message responseMsg = null;
try {
responseMsg = client.request(secret, "erpDemoResponse", msg, token, 10);
} catch (MessageResponseTimeoutException e) {
e.printStackTrace();
}
singlePool.returnResource(client);
singlePool.destroy();
assertNotNull(responseMsg);
assertEquals("test", new String(responseMsg.getContent(), Constants.CHARSET_OF_UTF8));
}
}
| java |
{
"description": "Selectors - Class selectors (css3-modsel-13)",
"selectors": {
"li": "css3-modsel-13.expected0.html",
".t1": "css3-modsel-13.expected1.html",
"li.t2": "css3-modsel-13.expected2.html",
".t3": "css3-modsel-13.expected3.html"
},
"src": "css3-modsel-13.src.html"
} | json |
<filename>index/f/frozen-strawberry-lemonade.json<gh_stars>10-100
{
"directions": [
"Place the ice cubes, water and lemonade concentrate into the container of a blender. Process until ice is finely blended. Add strawberries, and puree until well blended. Taste, and adjust flavors if you like. This recipe is very flexible."
],
"ingredients": [
"2 cups ice cubes",
"1 cup water",
"1 (6 ounce) can frozen lemonade concentrate",
"5 large fresh strawberries, hulled"
],
"language": "en-US",
"source": "allrecipes.com",
"tags": [],
"title": "Frozen Strawberry Lemonade",
"url": "http://allrecipes.com/recipe/71929/frozen-strawberry-lemonade/"
}
| json |
Free !!
Free !!
Strategies of products what the patanjali Ayurved Ltd producing new products how they are promoting,
follows various companies, these companies and employers can view Konanki's resume.
Upload your resume to get best job opportunities.
Register free!
| english |
Wednesday January 27, 2021,
The economic crisis unleashed by the COVID-19 pandemic has impacted the entire world. For an economy like India where fast pace of growth is critical to its poverty alleviation and human development goals, a recessionary phase has been a major setback. Despite all sectors opening up and the economy resuming post lockdown, unemployment continues to be a major concern.
According to the latest data from the Centre for Monitoring Indian Economy (CMIE), the national unemployment rate was at a six month high of 9.06 percent. On the other hand, the rural unemployment rate was also pegged at a high of 9.15 percent.
Evidently, re-opening of the economy has not been sufficient to ensure adequate job opportunities and resumption of work for millions of people. In rural India, which saw a massive reverse migration post the lockdown, the demand for the work under the Mahatma Gandhi Employment Guarantee Act (MNREGA) scheme has surged in recent months, indicating that rural workers are facing paucity of work opportunities.
Data shows that demand for work by households under MNREGA increased by as much as 55.4 percent in December 2020.
prioritises job creation and boosting entrepreneurial activity, particularly in rural India to engineer an economic revival.
More than ever before, today there is the need for inducing a new entrepreneurial energy in India’s small towns and villages. An entrepreneurial revolution needs an ecosystem that supports the formation and thriving of new business enterprises. For millions of people who are unable to find jobs, it is essential that adequate policy support is provided to enable them to start their own micro and small enterprises.
In rural areas where a majority of the population is still dependent on agriculture, it is all the more important to promote non-agricultural activities and businesses. There are plenty of opportunities for entrepreneurial pursuits in food processing, dairy, livestock, fisheries, warehousing, and logistics. In addition, promoting non-agricultural pursuits such as light manufacturing, handicrafts, retail, construction and financial services must be given impetus.
Awareness, business skilling, and ease of starting business are key elements to nudge rural youth towards entrepreneurial activities. There is a need to create skilled and aware entrepreneurs who can exploit those opportunities.
Providing business skill training to rural youth and making micro credit easily available are essential elements to enable a rural entrepreneurial revolution.
The government must announce dedicated measures towards this endeavour including setting up of promotional agencies for entrepreneurial development, instituting single window clearances and making micro credit available easily.
Globally, the increasing realisation that unsustainable human lifestyles are pushing the human race progressively towards catastrophe has given a new impetus to sustainable development. Investing in sustainable energy is one essential element of sustainable development.
India has already set itself the ambitious target of having around 60 percent of its energy from clean sources by 2030. Rural India, which has sufficient land and access to abundant sun, wind, as well as biomass is ripe for setting up multiple renewable energy projects.
India needs to promote setting up of renewable energy enterprises in rural India and set the target of meeting rural India’s energy requirements from renewable energy.
Promoting setting up of small but numerous energy projects using solar, wind and biomass energy will not only make rural India self-sufficient in energy, but also generate plenty of work opportunities in the hinterland.
Setting up rainwater harvesting projects across rural areas is another useful intervention that will not only generate work opportunities in the short term, but also help replenish India’s depleting underground water resources over the long term.
India has been one of the engines of the global economy and India’s economic revival is critical to the global economy as well. Over the past year, the Government has created hope in the economy through its Aatma Nirbhar Bharat initiative that seeks to boost local manufacturing and production. This initiative must be supported by strong measures to boost entrepreneurial capacity and boost Indian manufacturing by making exports competitive.
The government must create a competitive tariff structure that favours imports of raw materials over imports of finished goods.
A difficult taxation system is a bane for entrepreneurs. It is high time that the GST structure is made less complex and ease of taxation is improved particularly for MSMEs to make tax compliance easier and simpler.
While there is a lot of entrepreneurial energy in the country, what is lacking is sufficient support to wantrepreneurs and small entrepreneurs in the form of business training and skilling. This paucity is felt particularly more in rural areas and small towns.
The government must also lay due focus on making business training programmes accessible to a large population in the country. Affordable, easily accessible and readily consumable business training modules are key to help millions of youth convert their latent entrepreneurial ability into action.
(Disclaimer: The views and opinions expressed in this article are those of the author and do not necessarily reflect the views of YourStory.)
| english |
India strives to have a relationship with China that is built on mutual sensitivity, respect and interest, External Affairs Minister S Jaishankar has said as he asserted that the betterment and strengthening of the Indo-Pacific is a shared objective of New Delhi and Washington, amid Beijing's growing military muscle-flexing in the region.
China, which has territorial disputes with many countries in the strategic Indo-Pacific, has been opposing the US' proactive policy specifically in the disputed South China Sea.
"We continue to strive for a relationship with China, but one that is built on mutual sensitivity, mutual respect and mutual interest," Mr Jaishankar told a group of Indian reporters on Wednesday as he concluded his four-day visit to Washington and held talks with top US officials, including Secretary of State Antony Blinken and Defence Secretary Lloyd Austin.
The relations between India and China have soured over the incursion by Chinese troops in eastern Ladakh in May 2020, leading to a prolonged military standoff that is still unresolved.
India has made it clear to China that peace and tranquillity along the Line of Actual Control (LAC) were key for the overall development of the bilateral ties.
Responding to a question on how India and the US are planning to handle a belligerent China, Mr Jaishankar said the two countries have a shared objective of betterment and strengthening of the Indo-Pacific region.
"Where Indian and US interests converge, and they do, I think, is on the stability and the security, the progress, the prosperity, the development of the Indo Pacific. Because you have seen, even in the case of Ukraine, a war fought a great distance away, has the potential, has the capability of actually creating turbulence across the world in terms of implications for the daily lives of people," he said.
Mr Jaishankar said the world today is very globalised, extremely interlocked, and interdependent.
"It is therefore to say that we have skin in the game is an understatement. I think we have vital stakes today in ensuring that the larger region is stable, that it is secured; that there is cooperation and that the focus is on the right things," he said.
"To my view, what we have seen in recent years, is an India whose interests and inclinations extend sufficiently eastwards into the Pacific and the United States, which is open enough to work flexibly and comfortably with partners going beyond the orthodox limitations in the past of treaties and alliances," he said.
Mr Jaishankar said the world has changed and everyone appreciates that no single country by itself can shoulder the responsibilities or the burdens of international peace and common good.
"To me, in a globalised world, countries are conscious today that the world is not unipolar, it's not bipolar, they need there to be multiple players, they need to work together, there are common interests at stake out here. The rest of the region actually looks at the more capable countries to pull their weight and work together. I think that's the kind of situation," he said.
"India-US is one part of it, we have a bigger gathering, coordination in terms of the quad, but there are still bigger ones. If you look at two new initiatives, the Indo Pacific Economic Framework and the Indo Pacific initiative for maritime domain awareness, they extend beyond them. They are open and they have multiple players out there," he noted.
In November 2017, the US, Australia, India and Japan gave shape to the long-pending proposal of setting up the Quad to develop a new strategy to keep the critical sea routes in the Indo-Pacific free of any influence, amidst China's muscle flexing in the region.
China claims nearly all of the disputed South China Sea, though Taiwan, the Philippines, Brunei, Malaysia and Vietnam all claim parts of it. Beijing has built artificial islands and military installations in the South China Sea. Beijing is also involved in a maritime dispute with Japan over the East China Sea.
"I believe in defining international affairs and in positive terms, that's usually how diplomacy is done. So, I would urge you to think of it as really, betterment or strengthening of the Indo Pacific as a shared objective between us," Mr Jaishankar said.
(Except for the headline, this story has not been edited by NDTV staff and is published from a syndicated feed. ) | english |
{
"id": "2bba1891-98eb-4621-9c81-6488ec98e793",
"name": "<NAME>",
"img": "https://imgur.com/Ln8xFkh",
"links": {
"website": "",
"linkedin": "https://www.linkedin.com/in/carlos-gomez-pro/",
"github": "https://github.com/Carlitos5963"
},
"jobTitle": "Software Engineer/Web Developer",
"location": {
"city": "San Diego",
"state": "California",
"country": "United States"
}
}
| json |
Mahanagar Gas (MGL) has announced its first inorganic acquisition in the CGD space, Unison Enviro Pvt Ltd (UEPL), from the latter’s erstwhile promoters Ashoka Buildcon and North Haven India Infra (a Morgan Stanley affiliate). MGL has acquired 100% stake in the fledgling CGD player and has stated UEPL equity value at Rs5. 3bn, which implies an enterprise value of ~Rs6. 4bn (gross debt on the books of UEPL as of FY22, stood at Rs1. 13bn). The transaction value implies a price/sales multiple of 8. 3x and EV/EBITDA of 3,128x! While this may seem exorbitant, we note UEPL has 3 reasonably large GAs in its portfolio (37,362sqkm, ~10mn population and ~2mn households in aggregate). We also note that development so far in the first 3 years has been slow (our estimate based on the reported FY22 revenues suggests volumes at Rs2bn, which more than justifies the acquisition cost. We sense the acquired areas can add a meaningful NPV of Rs5bn for MGL (~Rs50/sh). We view this as a significant move forward to address longstanding concerns on growth avenues for MGL beyond the Mumbai Metropolitan Region (MMR). Reiterate BUY.
* Meaningful potential in the areas acquired: UEPL has rights to 3 GAs, comprising of Ratnagiri, Chitradurga & Devangere, and Latur & Osmanabad, districts. While these areas do seem primarily rural, we believe the large populations and some industrial/commercial potential in each of these districts can support reasonable volumes of 0. 2-0. 25mmscmd in 3-4 years. This implies aggregate ~1mmscmd additional volumes by FY28E for MGL (company’s Q3 run rate was 3. 4mmscmd).
* Valuations look reasonable for the medium term: While the marketing exclusivity for Ratnagiri ended in CY22 and rest of the areas will end in CY27, network exclusivity for all GAs exist till CY41-CY43. We believe total volume potential from the 5 GAs combined can be ~1mmscmd over 3-5 years which, @Rs5. 5-6/scm of EBITDA, can translate to an EBITDA of ~Rs2. 1bn by FY28E. Discounting back to FY24E (@10%), we see the implied EV/EBITDA multiple of 4. 3x for the UEPL acquisition as reasonable.
* Maintain BUY: At CMP, the stock trades at 8. 9x FY25E EPS and 3. 9x EV/EBITDA, which we believe offers attractive risk reward. We remain bullish on MGL for next 12-18 months. We estimate an EPS CAGR of 19% over FY23-FY25E, supported by volume CAGR of ~9%, gross margins of Rs14. 7/scm and EBITDA/scm of Rs9. 6/scm. With a strong signal to secure long-term growth via inorganic acquisitions, prospects appear bright. We value the core business via DCF methodology at Rs1,075/sh (WACC @10. 9%, EBITDA/scm @Rs 9. 5, TV growth at 1. 5%). We have also tried to do a roughcut DCF valuation of the newly acquired areas (WACC @10. 8%, EBITDA/scm Rs6, TV 3. 5%), which works out to Rs50/sh. This leads to a target price of Rs1,125/sh for MGL implying 24% upside. Maintain BUY.
* Key downside risks: i) Higher gas prices, ii) inability to pass on gas cost increases, iii) sharp fall in alternate fuel prices for CNG (petrol/diesel), iv) slower execution. | english |
Many people prioritize setting up their workout program, but they don’t often give their nutritional planning as much attention. Lifting weights can be relatively simple, but managing macronutrients and determining an effective calorie intake can be more challenging.
Rather than trying to construct an effective diet plan on your own, you might be ready to enlist the help of a professional, but who?
If you search around the web, you’re likely to find services offered by Dietitians, as well as by nutritionists. While the occupations might sound identical, they actually have very different and distinct roles and responsibilities.
Both professionals offer nutrition-based counseling, but they’re distinguished by their educational requirements, their potential to help a variety of clients and goals, even their technical legal standing. Here’s an extensive look at what really lies behind these two confusing titles.
Education Requirements — What Do They Know?
The self-determined criteria might include getting a formal education in nutrition or obtaining a certification in nutrition offered by various organizations, such as Precision Nutrition or the International Sports Sciences Association (ISSA). However, neither a higher education degree nor an accredited certification are technically required before being labeled a nutritionist.
What education is required to become a registered dietitian? Quite a bit. In the US, for example, a four-year undergraduate degree in nutrition and a seven to 12-month unpaid dietetic internship are mandatory.
After which prospective dietitians obtain registration by passing the Registered Dietitian Examination offered by the Commission on Dietetics Registration (CDR) of the Academy of Nutrition and Dietetics (AND). Hence the title “registered dietitian” (RD).
Many dietitians have gone on to obtain a master’s degree and/or PhD in nutrition or related fields. In fact, starting in January 2024, prospective dietitians will be required to obtain a master’s degree in nutrition to qualify for completing the RD examination. (1)
As a snapshot of what a dietitian needs to study, an undergraduate degree in nutrition includes courses in preparatory math, general chemistry, organic chemistry, biochemistry, and microbiology.
The curriculum also includes courses that make up what is called a Didactic Program in Dietetics (DPD), which includes Introduction into Dietetics and Nutrition, Community Nutrition, Medical Nutrition Therapy (MNT), Advanced Concepts in Nutrition, Food Service Management, Energy and Exercise, Nutrition Communication, Research Methodology, Food and Culture, Contemporary Nutrition, and Advanced Concepts in Nutrition.
A seven-month-long dietetic internship program consists of 1,200 to 1,500 hours of training supervised by preceptors (experienced RDs). This training involves working in rotations for clinical nutrition in a skilled nursing facility and hospital; community nutrition in a non-profit or government agency or health-maintenance organization, such as Women, Infants, and Children (WIC) or Meals on Wheels; and food service management in a school and skilled nursing facility or hospital.
Aside from nutritionists and dietitians, there is also an occupational designation of nutrition professionals called Certified Dietitian-Nutritionists (CDN). To be a CDN, one has to complete an undergraduate degree in nutrition, complete 10 years of experience in nutritional practice (usually under the supervision of a registered dietitian), and show proof of education and experience to the Office of Professions of the Department of Education.
Services Provided — What Do They Do?
Both dietitians and nutritionists can provide nutrition education and counseling to people looking for weight control, body composition and physical performance goals, or general well-being.
However, nutritionists are generally not legally allowed to provide advice for those medical conditions. So it would be beyond the scope of practice for a nutritionist to consult with a person with diabetes, for example.
Dietitians can provide those types of services for a variety of medical conditions such as bariatrics, kidney disease, hyperlipidemia (high cholesterol), cardiovascular diseases, or diabetes.
Dietitians can also work with people in various stages of life including pediatrics, pregnancy, and advanced age. Additionally, dietitians can write prescriptions for enteral (tube-feeding) and parenteral (intravenous) nutrition in skilled nursing facilities and hospitals.
Both dietitians and nutritionists may work for athletic teams, in private practice, or in fitness and weight loss centers. However, because of their education, training, legal status, and ability to care for health conditions, dietitians can also be found working in hospitals, skilled-nursing facilities, academia, public health programs, health maintenance organizations, and government agencies.
Know Your Goal — Which Do You Need?
When the time comes that you’re ready to let a professional develop a goal-focused nutrition plan, whether it’s for building muscle or shedding fat, you might decide to invest in working with either a nutritionist or a dietitian.
If you are someone with no current medical conditions that are managed by nutrition (high cholesterol, diabetes, kidney disease, etc.) and your goals are to improve your overall well-being or just to increase your own general education on nutrition, you can choose either a dietitian or nutritionist.
For more tangible goals such as weight loss, muscle gain, contest prep for physique competitions like bodybuilding, or optimal physical performance — whether it’s for a traditional sport like baseball or a strength sport like powerlifting — you could also be well-served by either a dietitian or nutritionist.
However, if you need the nutrition-based management of medical conditions, you should look for counseling from a dietitian. Their training requires more in-depth education and experience working with significant medical issues, which allows more appropriate and more accurate recommendations.
Whether you seek the services of an individual nutritionist or dietitian, be sure to review their education and general credentials. It’s also important to check their history working in the specific area of nutrition you’ll be utilizing them for.
If you are a powerlifter, athlete, or bodybuilder and you’re aiming to meet strength, performance, or body composition goals, check to see if the nutrition professional you are considering has experience counseling others with the same goals. The nutritionist or dietitian might even have personal experience reaching those goals.
Similarly, if you are seeking nutrition counseling for a medical condition, look into the background and success rate of a prospective dietitian. With the advent of social media and personal/professional websites, many nutrition professionals may have photo collections showcasing the results and testimonials from their clients.
Now you’re ready to make a proper decision as to which of the seemingly interchangeable occupational designations can help you best plan your diet. You also now have a better idea of who will be taking care of your, or your loved ones’, nutritional needs when it comes to healthcare institutions. The right (or wrong) nutrition professional could end up being the difference between success and failure or fitness and sickness.
| english |
{"data":{"site":{"siteMetadata":{"home":{"title":"Join the Fight Against PPE Shortage","description":"Create and Donate 3D-Printed Personal Protective Equipment for local hospitals, firefighters, schools, and others in need."}}}}} | json |
My recent New Yorker article (a partial excerpt from my forthcoming book, Imagine) is now freely available online. It's about the ideal way to generate ideas in a group and covers everything from the failures of brainstorming to the importance of working with people you don't know very well. Here's the introduction:
In the late nineteen-forties, Alex Osborn, a partner in the advertising agency B.B.D.O., decided to write a book in which he shared his creative secrets. At the time, B.B.D.O. was widely regarded as the most innovative firm on Madison Avenue. Born in 1888, Osborn had spent much of his career in Buffalo, where he started out working in newspapers, and his life at B.B.D.O. began when he teamed up with another young adman he’d met volunteering for the United War Work Campaign. By the forties, he was one of the industry’s grand old men, ready to pass on the lessons he’d learned. His book “Your Creative Power” was published in 1948. An amalgam of pop science and business anecdote, it became a surprise best-seller. Osborn promised that, by following his advice, the typical reader could double his creative output. Such a mental boost would spur career success—“To get your foot in the door, your imagination can be an open-sesame”—and also make the reader a much happier person. “The more you rub your creative lamp, the more alive you feel,” he wrote.
“Your Creative Power” was filled with tricks and strategies, such as always carrying a notebook, to be ready when inspiration struck. But Osborn’s most celebrated idea was the one discussed in Chapter 33, “How to Organize a Squad to Create Ideas.” When a group works together, he wrote, the members should engage in a “brainstorm,” which means “using the brain to storm a creative problem—and doing so in commando fashion, with each stormer attacking the same objective.” For Osborn, brainstorming was central to B.B.D.O.’s success. Osborn described, for instance, how the technique inspired a group of ten admen to come up with eighty-seven ideas for a new drugstore in ninety minutes, or nearly an idea per minute. The brainstorm had turned his employees into imagination machines.
The book outlined the essential rules of a successful brainstorming session. The most important of these, Osborn said—the thing that distinguishes brainstorming from other types of group activity—was the absence of criticism and negative feedback. If people were worried that their ideas might be ridiculed by the group, the process would fail. “Creativity is so delicate a flower that praise tends to make it bloom while discouragement often nips it in the bud,” he wrote. “Forget quality; aim now to get a quantity of answers. When you’re through, your sheet of paper may be so full of ridiculous nonsense that you’ll be disgusted. Never mind. You’re loosening up your unfettered imagination—making your mind deliver.” Brainstorming enshrined a no-judgments approach to holding a meeting.
The underlying assumption of brainstorming is that if people are scared of saying the wrong thing, they’ll end up saying nothing at all. The appeal of this idea is obvious: it’s always nice to be saturated in positive feedback. Typically, participants leave a brainstorming session proud of their contribution. The whiteboard has been filled with free associations. Brainstorming seems like an ideal technique, a feel-good way to boost productivity. But there is a problem with brainstorming. It doesn’t work.
| english |
package org.recipesearch.web.controllers;
import org.recipesearch.core.dao.UserDao;
import org.recipesearch.core.po.Authority;
import org.recipesearch.core.po.User;
import javax.annotation.Resource;
import org.parancoe.web.test.ControllerTest;
import org.springframework.web.servlet.HandlerAdapter;
import org.springframework.web.servlet.ModelAndView;
public class AdminUsersControllerTest extends ControllerTest {
@Resource
private AdminUsersController controller;
@Resource(
name =
"org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter#0")
private HandlerAdapter methodHandler;
@Resource
private UserDao userDao;
@Override
public Class[] getFixtureClasses() {
return new Class[]{Authority.class, User.class};
}
public void testNotNull() {
assertNotNull(controller);
assertNotNull(userDao);
}
public void testEditAndSaveUser() throws Exception {
// Testing the method handler supports the controller
assertTrue(methodHandler.supports(controller));
// Retrieve a person for testing
User user = userDao.findByUsername("parancoe");
assertNotNull(user);
// Test edit (showing form)
resetRequestAndResponse();
req.setMethod("GET");
req.setRequestURI("/admin/users/" + user.getId() + "/edit");
ModelAndView mv = methodHandler.handle(req, res, controller);
assertEquals("admin/users/edit", mv.getViewName());
assertTrue(mv.getModelMap().containsAttribute("userBean"));
assertNotNull(req.getSession().getAttribute("userBean"));
// Test store (posting form)
resetRequestAndResponse();
req.setMethod("POST");
req.setRequestURI("/admin/users/" + user.getId());
req.addParameter("user.username", "parancoe3");
mv = methodHandler.handle(req, res, controller);
assertEquals("redirect:", mv.getViewName());
// Check on the DB
user = userDao.get(user.getId());
assertNotNull(user);
assertEquals("parancoe3", user.getUsername());
}
public void testEditAndSaveUserWithId() throws Exception {
// Testing the method handler supports the controller
assertTrue(methodHandler.supports(controller));
// Retrieve a person for testing
User user = userDao.findByUsername("parancoe");
assertNotNull(user);
// Test edit (showing form)
resetRequestAndResponse();
req.setMethod("GET");
req.setRequestURI("/admin/users/" + user.getId() + "/edit");
ModelAndView mv = methodHandler.handle(req, res, controller);
assertEquals("admin/users/edit", mv.getViewName());
assertTrue(mv.getModelMap().containsAttribute("userBean"));
assertNotNull(req.getSession().getAttribute("userBean"));
// Test store (posting form)
resetRequestAndResponse();
req.setMethod("POST");
req.setRequestURI("/admin/users/" + user.getId());
req.addParameter("user.username", "parancoe3");
// user.id will be ignored because the it's a disallowed field configured
// in the init binder of the controller
req.addParameter("user.id", "56");
mv = methodHandler.handle(req, res, controller);
assertEquals("redirect:", mv.getViewName());
// Check on the DB
user = userDao.get(user.getId());
assertNotNull(user);
assertEquals("parancoe3", user.getUsername());
}
public void testDelete() throws Exception {
// Testing the method handler supports the controller
assertTrue(methodHandler.supports(controller));
// Retrieve a person for testing
User user = userDao.findByUsername("parancoe");
assertNotNull(user);
// Test edit (showing form)
resetRequestAndResponse();
req.setMethod("DELETE");
req.setRequestURI("/admin/users/" + user.getId());
ModelAndView mv = methodHandler.handle(req, res, controller);
assertEquals("redirect:", mv.getViewName());
// Check on the DB
user = userDao.findByUsername("parancoe");
assertNull(user);
}
}
| java |
{
"id": 97176,
"info": {
"name": "Simpler Google: Brandless",
"description": "Many visual elements have been removed, and colours changed - resulting in a much more minimal look for the Google search engine. \r\n\r\nThis provides the same functionality as the original style (style 96376) but removes logos and the 'apps' button.",
"additionalInfo": "21/1/2014:-\r\n~Bug fix: see changelog for 'Simpler Google'\r\n\r\n15/1/2014:-\r\n~Initial release\r\n - Code based upon original style: see changelog from same day for more details",
"format": "uso",
"category": "google",
"createdAt": "2014-01-15T17:25:05.000Z",
"updatedAt": "2014-01-21T18:21:32.000Z",
"license": "NO-REDISTRIBUTION",
"author": {
"id": 251424,
"name": "ProcrastinatingProductively",
"homepage": "http://procrastinatingproductively.tumblr.com/"
}
},
"stats": {
"installs": {
"total": 220,
"weekly": 0
}
},
"screenshots": {
"main": {
"name": "97176-after.png",
"archived": false
}
},
"discussions": {
"stats": {
"discussionsCount": 0,
"commentsCount": 0
},
"data": []
},
"style": {
"css": "@-moz-document url-prefix(\"https://www.google.\"), url-prefix(\"http://www.google.\") {\r\n*{\r\n -webkit-border-radius: 0px !important;\r\n border-radius: 0px !important;\r\n -webkit-box-shadow: none !important;\r\n box-shadow: none !important;\r\n}\r\n \r\n \r\n \r\n \r\n/* BRANDLESS */ \r\n \r\n#gb{\r\n position: fixed !important;\r\n z-index: 1000 !important;\r\n }\r\n \r\n#lga{\r\n display: none !important;\r\n }\r\n \r\n \r\n \r\n \r\n \r\n/* NORMAL */\r\n \r\n.gb_q{\r\n display: none !important;\r\n }\r\n \r\n.gb_na{\r\n display: none !important;\r\n }\r\n \r\n.fbar{\r\n display: none !important;\r\n }\r\n\r\n.gb_Da{\r\n display: none !important;\r\n }\r\n \r\n.gb_db, .gb_J, .gb_i{\r\n display: none !important;\r\n }\r\n \r\n#gbqfsb, .gbqfba{\r\n display: none !important;\r\n }\r\n\r\n.ab_button{\r\n background: none !important;\r\n border: none !important;\r\n }\r\n \r\n#hdtb_msb .hdtb-tl-sel, #hdtb_msb .hdtb-tl-sel:hover{\r\n background: none !important;\r\n border: none !important;\r\n }\r\n\r\n.ksb, .ab_button{\r\n background-image: none !important;\r\n border: none !important;\r\n }\r\n \r\na{\r\n text-decoration: none !important;\r\n }\r\n\r\n.ads-container{\r\n display: none !important;\r\n }\r\n \r\ntable#nav a{\r\n color: #000000 !important;\r\n }\r\n\r\n#prm{\r\n display: none !important;\r\n}\r\n\r\n#hdtbSum{\r\n border-bottom: none !important;\r\n}\r\n\r\n#hdtb_msb .hdtb_mitem.hdtb_msel, #hdtb_msb .hdtb_mitem.hdtb_msel_pre{\r\n border-bottom: none !important;\r\n}\r\n\r\n.ksb:hover, .ab_button:hover, #hdtb_tls:hover{\r\n background: none !important;\r\n border: none !important;\r\n }\r\n\r\n.cdr_sep{\r\n display: none !important;\r\n }\r\n \r\n.hdtb-loc{\r\n border-top: none !important;\r\n }\r\n\r\n.gssb_c{\r\n position: fixed !important;\r\n }\r\n}"
}
} | json |
import React from 'react';
import { Link } from 'react-router-dom';
import AlbumTracks from '../AlbumTracks';
import Image from '../Image';
interface Owner {
id: string;
name?: string;
}
interface Image {
height: number;
url: string;
width: number;
}
interface Item {
artists: Owner[];
duration_ms: number;
id: string;
name: string;
track_number: number;
}
interface Tracks {
items: Item[];
}
export interface AlbumProps {
artists: Owner[];
id: string;
images: Image[];
name: string;
tracks?: Tracks;
}
function Album(props: AlbumProps): JSX.Element {
const { artists, id, images, name, tracks } = props;
return (
<div>
<figure>
{images[1] && (
<Link to={`/albums/${id}`}>
<Image {...images[1]} alt={name} />
</Link>
)}
<figcaption>
<h3>
<Link to={`/albums/${id}`}>{name}</Link>
</h3>
{artists[0] && (
<h4>
<Link to={`/artists/${artists[0].id}`}>{artists[0].name}</Link>
</h4>
)}
</figcaption>
</figure>
{tracks && <AlbumTracks items={tracks.items} />}
</div>
);
}
export default Album;
| typescript |
/*
Copyright libCellML Contributors
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 "libcellml/when.h"
namespace libcellml {
/**
* @brief The When::WhenImpl struct.
*
* The private implementation for the When class.
*/
struct When::WhenImpl
{
std::string mCondition; /**< A string of math for determining the condition for transitioning from False to True.*/
std::string mValue; /**< A string of math for assigning.*/
};
When::When()
: mPimpl(new WhenImpl())
{
}
When::~When()
{
delete mPimpl;
}
When::When(const When &rhs)
: OrderedEntity(rhs)
, mPimpl(new WhenImpl())
{
mPimpl->mCondition = rhs.mPimpl->mCondition;
mPimpl->mValue = rhs.mPimpl->mValue;
}
When::When(When &&rhs) noexcept
: OrderedEntity(std::move(rhs))
, mPimpl(rhs.mPimpl)
{
rhs.mPimpl = nullptr;
}
When &When::operator=(When rhs)
{
OrderedEntity::operator=(rhs);
rhs.swap(*this);
return *this;
}
void When::swap(When &rhs)
{
std::swap(this->mPimpl, rhs.mPimpl);
}
void When::setCondition(const std::string &condition)
{
mPimpl->mCondition = condition;
}
std::string When::condition() const
{
return mPimpl->mCondition;
}
void When::setValue(const std::string &value)
{
mPimpl->mValue = value;
}
std::string When::value() const
{
return mPimpl->mValue;
}
} // namespace libcellml
| cpp |
No society neglects its children so much and basks in its economic glory as we do. Lalita Panicker elaborates.
Perhaps the most heart-rending image of the recent Gaza crisis was that of a man kneeling beside the bodies of his three small children. They lay like broken dolls on the floor of the mortuary as the father, half-crazed with grief, begged them to get up. He needed them, he pleaded. Clearly, in the great offensive that was meant to change the rules of the game with Hamas, Israel thought nothing of shelling homes irrespective of whether children would be hit. This is not to say that Hamas is any greater respecter of child rights. It too has thought nothing of sending in so-called jihadi cowards to attack schoolchildren in Israel.
The disturbing element in all this is that children no longer seem off limits to those ostensibly engaged in conflict.
Instead, they are seen as a legitimate currency of war. As the International Court of Justice opens its hearings, we are told horrific tales of how rebel Congolese leader Thomas Lubanga recruited children to pillage, rape and kill in that benighted land. Long ago and far away, there was some honour among thieves. Even the most venal would not deliberately attack children and women.
If you look through a website on Iraqi children in this war and the glorious one fought by George Bush Sr, it is likely that you will not be able to sleep for many nights. The effects of depleted uranium from shelling has led to such horrendous birth defects that it is clear that the affected children will not live to even reach their teens. The same shelling and killing goes on now. The aggressors do not differentiate between legitimate combatants and innocent children.
If the verbally challenged former secretary of defence Donald Rumsfeld felt that ‘stuff happens’ in conflict situations,
Closer home, as the Sri Lankan army closes in on the psychopath V. Prabhakaran, the one legacy of his that we will remember is his use of child soldiers to further his warped dream of some greater homeland. But why go so far afield? What about our own dismal record on preserving child rights? Now while the Indian state might not deliberately target children, it doesn’t do much to protect them. As a society, we seem to have become immune to the suffering of children and to the fact that they have special needs. We are very big on setting up a National Commission for Children and ratifying every convention possible on child rights. Oh yes, and we just had National Girl Child Day last week. It is meant to discourage gender bias.
Most effective, we are sure. It’s just that not too many people seem to be taking notice of this.
We pretend to be among the most family-minded people in the world, our culture values apparently automatically protect children. The truth is very far from it. Most child abuse, which incidentally is not recognised as a crime in the Indian Penal Code 1860, takes place at home at the hands of a trusted relative, even parent. Not too many of us quail at employing underage children in our homes. And as for children begging at street corners, well, it makes for lovely seminar conversation but who’s got the time to push to make laws protecting children work.
Now Amitabh Bachchan may have a thing or two to say about this. But Danny Boyle was spot on when he showed in his now famous Slumdog Millionaire how deep the exploitation of children runs in Indian society. They are sold to organised beggar gangs, girl children sold into prostitution and trafficked. But how often have these issues figured in Parliament? How often have our political worthies actually debated how to counter this? Do they approach this subject with anything near the passion they feel about caste-class alliances? Why are we asking these questions when the answer is staring us in the face?
But let us rejoice in our growing economy, in the way we have marketed Incredible India. Sure, the tourists may be coming in droves, Mumbai or no Mumbai. But alongside comes the sinister tourist who is not here to take in the attractions of God’s own country or the Taj. He is here to prey on defenceless children. Children from poor families being given as ‘guides’ to aging paedophiles for the duration of their stay. Once they have abused the children, they escape to the safety of their countries in the knowledge that India is not going to try to catch up with them.
Now you may think it’s a long stretch to compare war crimes against children to the apathy towards children in India. The net result is the same. The child is traumatised, robbed of his or her childhood. The child soldiers in Congo and other parts of the world — there are 250,000 at present — are forced into a brutal adult world they do not understand. Their toys are lethal weapons and their tender minds brainwashed to accept violence. As the poor man in Gaza weeping over his lost children, we too have been guilty of not protecting our children from the perils of a nasty brutish adult world. Or perhaps the aam admi — the State is so committed to protecting — does not include children. Or maybe it’s that they don’t have votes and, therefore, matter that much less.
It’s a pity that the self-appointed custodians of our morals see so much wrong in dancing in bars or wearing minimal clothing. We wonder if the doughty activists of the Maharashtra Navnirman Sena have ever thought of the plight of the millions of children who live in Mumbai’s slums, the daily abuse that many face, the deprivation that they suffer. No, we needed Danny Boyle to show us all that.
No society that neglects its children so much has any right to bask in its economic glory as we do. Sorry to end on such a negative note, but at the end of the tunnel, there seems to be another tunnel as far as children are concerned. | english |
<reponame>PacktPublishing/Building-Web-UIs-with-Bootstrap-4-V<gh_stars>1-10
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Working with Dynamic Tabs and Pills</title>
<meta name="author" content="flip.hr">
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/app.css" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-12">
<ul class="nav nav-tabs" id="contentTab">
<li class="nav-item">
<a class="nav-link active" data-toggle="tab" href="#popular">Popular articles</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#recent">Recent articles</a>
</li>
</ul>
</div><!-- .col-md-12 -->
</div><!-- .row -->
<div class="tab-content" id="contentTabContent">
<div class="tab-pane fade show active" id="popular">
<div class="row">
<div class="col-md-12">
<ul class="nav nav-pills nav-fill">
<li class="nav-item">
<a class="nav-link active" href="#">All categories</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Category 1</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Category 2</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Category 3</a>
</li>
</ul>
</div><!-- .col-md-12 -->
</div><!-- .row -->
<div class="row">
<div class="col-sm-6 col-md-4">
<h3 class="text-primary">Column 1</h3>
<div class="phone-center">
<img src="https://picsum.photos/200/200" class="img-fluid rounded p-2 float-md-left">
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
</div>
</div><!-- .col -->
<div class="col-sm-6 col-md-4">
<h3 class="text-success">Column 2</h3>
<p class="text-center">Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. <NAME>, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source.</p>
<p><p><img src="https://picsum.photos/400/400" class="img-fluid rounded-circle img-grayscale"></p></p>
</div><!-- .col -->
<div class="col-sm-12 col-md-4">
<h3>Column 3</h3>
<p class="text-center">It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English.</p>
<div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item" src="https://www.youtube.com/embed/zpOULjyy-n8?rel=0" allowfullscreen></iframe>
</div>
</div><!-- .col -->
</div><!-- .row -->
</div><!-- #popular -->
<div class="tab-pane fade show" id="recent">
<div class="row">
<div class="col-sm-6 col-md-4">
<h3 class="text-primary">Column 4</h3>
<div class="phone-center">
<img src="https://picsum.photos/200/200" class="img-fluid rounded p-2 float-md-left">
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
</div>
</div><!-- .col -->
<div class="col-sm-6 col-md-4">
<h3 class="text-success">Column 5</h3>
<p class="text-center">Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. <NAME>, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source.</p>
<p><p><img src="https://picsum.photos/400/400" class="img-fluid rounded-circle img-grayscale"></p></p>
</div><!-- .col -->
<div class="col-sm-12 col-md-4">
<h3>Column 6</h3>
<p class="text-center">It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English.</p>
<div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item" src="https://www.youtube.com/embed/zpOULjyy-n8?rel=0" allowfullscreen></iframe>
</div>
</div><!-- .col -->
</div><!-- .row -->
</div><!-- #popular -->
</div><!-- .tab-content -->
</div><!-- .container -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="js/bootstrap.bundle.min.js"></script>
</body>
</html> | html |
<filename>bioProcessBlock.java
interface bioProcessBlock{
double run(int waterp, int nitrogenp, int t, int d, int h);
double getPlantC();
double getAlgalC();
double getAlgalN();
double getDeadAlgalC();
double getDeadAlgalN();
void add2AlgalC(double cc);
void add2AlgalN(double nn);
double getPlantUptake();
double getAlgalUptake();
double getRemove();
} | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.