text
stringlengths
1
1.04M
language
stringclasses
25 values
<reponame>KvasirSG/Begynder-Java-Opgaver public class Opg3 { public static void main(String[] args){ int number = 5; String name = "<NAME>"; char c = 'q'; System.out.println(number); System.out.println(name); System.out.println(c); } }
java
As we all know director Vetrimaran who has delivered the multiple national award winner 'Visaranai' will take up 'Vada Chennai' as his next. Dhanush, Samantha and Andrea will be playing the lead role in this flick that will deal with three decades of underworld history of North Chennai. The film will be produced by Dhanush under his Wunderbar Films banner. Now the latest development is that Lyca Productions after distributing 'Visaranai' in a massive number of theaters backed by brilliant promotions will be teaming up again with the phenomenally successful duo of Dhanush and Vetri for 'Vada Chennai'. Lyca which is currently producing the mega budget sci-fi flick '2. 0' with Superstar Rajinikanth and Shankar, have earlier released 'Naanum Rowdy Dhaan' and 'Visaranai' both produced by Dhanush. Recently Lyca quashed the rumors linking them with Dhanush's upcoming film 'Kodi'. 'Vada Chennai' will have the musical score of Santosh Narayanan. Raju Mahalingam, the Creative Head of Lyca has confirmed the news with the Tweet attached below. Follow us on Google News and stay updated with the latest!
english
<filename>src/storage/cloud_storage/object.rs //! The File type for the CloudStorage use core::{ pin::Pin, task::{Context, Poll}, }; use tokio::io::AsyncRead; /// The File type for the CloudStorage #[derive(Clone, Debug)] pub struct Object { data: Vec<u8>, index: usize, } impl Object { pub(crate) fn new(data: Vec<u8>) -> Object { Object { data, index: 0 } } fn read(&mut self, buffer: &mut [u8]) -> Result<usize, std::io::Error> { for (i, item) in buffer.iter_mut().enumerate() { if i + self.index < self.data.len() { *item = self.data[i + self.index]; } else { self.index += i; return Ok(i); } } self.index += buffer.len(); Ok(buffer.len()) } } impl AsyncRead for Object { fn poll_read(self: Pin<&mut Self>, _cx: &mut Context<'_>, buf: &mut [u8]) -> Poll<std::io::Result<usize>> { Poll::Ready(self.get_mut().read(buf)) } }
rust
package com.todolist.security; import java.io.IOException; import java.util.ArrayList; import javax.servlet.FilterChain; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.web.authentication.www.BasicAuthenticationFilter; import com.todolist.constants.SecurityConstants; import io.jsonwebtoken.Claims; import io.jsonwebtoken.Jwts; import io.jsonwebtoken.security.Keys; public class AuthorizationFilter extends BasicAuthenticationFilter { public AuthorizationFilter(AuthenticationManager authManager) { super(authManager); } @Override protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException { //receives the token from the request header where the header name "Authorization" String header = request.getHeader(SecurityConstants.HEADER_NAME); if (header == null) { chain.doFilter(request, response); return; }else { // extract token where header variable is of the form "Bearer token" header=header.split(" ")[1]; } //authenticating user details UsernamePasswordAuthenticationToken authentication = authenticate(request); SecurityContextHolder.getContext().setAuthentication(authentication); chain.doFilter(request, response); } private UsernamePasswordAuthenticationToken authenticate(HttpServletRequest request) { //extracting the token from request header String token = request.getHeader(SecurityConstants.HEADER_NAME); token=token.split(" ")[1]; if (token != null) { Claims user = Jwts.parser() .setSigningKey(Keys.hmacShaKeyFor(SecurityConstants.KEY.getBytes())) .parseClaimsJws(token) .getBody(); if (user != null) { //returning the user details from the token return new UsernamePasswordAuthenticationToken(user, null, new ArrayList()); }else{ return null; } } return null; } }
java
<reponame>mudssrali/tailwindcss-components<gh_stars>1-10 { "files.exclude": { "/node_modules": true }, "editor.insertSpaces": false, "editor.autoIndent": "none", "editor.tabSize": 4, }
json
Renault will discontinue car assembly operations at its Flins factory outside Paris and turn the site into a research, recycling and repair centre by 2024 as part of a broader restructuring, the company said on Wednesday. The loss-making carmaker said it aims to employ 3,000 people at the revamped site by 2030, including staff from its nearby Choisy-le-Roi plant, which has a workforce of 260 but is earmarked for closure. Renault, which had been struggling with waning profitability and sales before the coronavirus pandemic hit, this year announced 4,600 job cuts in France as part of a 2 billion euro ($2. 38 billion) cost savings plan.
english
{"ast":null,"code":"const getBourbons = () => {\n return dispatch => {\n dispatch({\n type: 'LOADING_BOURBONS'\n });\n fetch(\"http://localhost:3001/bourbons\").then(response => response.json()).then(bourbonData => dispatch({\n type: 'BOURBONS',\n payload: bourbonData\n }));\n };\n};\n\nconst addBourbon = bourbon => {\n return {\n type: 'ADD_BOURBON',\n bourbon\n };\n};\n\nconst removeBourbon = id => {\n return {\n type: 'DELETE_Bourbon',\n id\n };\n};\n\nexport { getBourbons, addBourbon, removeBourbon };","map":{"version":3,"sources":["/Users/user/Development/projects/bourbon_journal/bourbon_journal_frontend/src/actions/BourbonsActions.js"],"names":["getBourbons","dispatch","type","fetch","then","response","json","bourbonData","payload","addBourbon","bourbon","removeBourbon","id"],"mappings":"AAAA,MAAMA,WAAW,GAAG,MAAM;AACtB,SAAOC,QAAQ,IAAI;AACfA,IAAAA,QAAQ,CAAC;AAACC,MAAAA,IAAI,EAAE;AAAP,KAAD,CAAR;AACAC,IAAAA,KAAK,CAAC,gCAAD,CAAL,CACCC,IADD,CACMC,QAAQ,IAAIA,QAAQ,CAACC,IAAT,EADlB,EAECF,IAFD,CAEMG,WAAW,IAAIN,QAAQ,CAAC;AAACC,MAAAA,IAAI,EAAE,UAAP;AAAmBM,MAAAA,OAAO,EAAED;AAA5B,KAAD,CAF7B;AAGH,GALD;AAMH,CAPD;;AASA,MAAME,UAAU,GAAGC,OAAO,IAAI;AAC1B,SAAO;AACLR,IAAAA,IAAI,EAAE,aADD;AAELQ,IAAAA;AAFK,GAAP;AAID,CALH;;AAOA,MAAMC,aAAa,GAAGC,EAAE,IAAI;AACxB,SAAO;AACLV,IAAAA,IAAI,EAAE,gBADD;AAELU,IAAAA;AAFK,GAAP;AAID,CALH;;AAOA,SACIZ,WADJ,EAEIS,UAFJ,EAGIE,aAHJ","sourcesContent":["const getBourbons = () => {\n return dispatch => {\n dispatch({type: 'LOADING_BOURBONS'})\n fetch(\"http://localhost:3001/bourbons\")\n .then(response => response.json())\n .then(bourbonData => dispatch({type: 'BOURBONS', payload: bourbonData}))\n }\n}\n\nconst addBourbon = bourbon => {\n return {\n type: 'ADD_BOURBON',\n bourbon\n };\n };\n \nconst removeBourbon = id => {\n return {\n type: 'DELETE_Bourbon',\n id\n };\n };\n\nexport {\n getBourbons,\n addBourbon,\n removeBourbon\n }"]},"metadata":{},"sourceType":"module"}
json
// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. /** * Adds a random Arctic Monkeys song to the page. */ function addRandomAMSong() { const songs = [['Mardy Bum', 'https://www.youtube.com/embed/dO368WjwyFs?autoplay=1'], ['A Certain Romance', 'https://www.youtube.com/embed/zMupng6KQeE?autoplay=1'], ['I Wanna Be Yours', 'https://www.youtube.com/embed/fJLQCf4mFP0?autoplay=1'], ['No 1 Party Anthem ', 'https://www.youtube.com/embed/pDYlWAf-ekk?autoplay=1'], ['Snap Out of It', 'https://www.youtube.com/embed/1_O_T6Aq85E?autoplay=1'], ['Arabella', 'https://www.youtube.com/embed/Nj8r3qmOoZ8?autoplay=1'], ['Teddy Picker', 'https://www.youtube.com/embed/2A2XBoxtcUA?autoplay=1'], ['505', 'https://www.youtube.com/embed/qU9mHegkTc4?autoplay=1'], ['I Bet You Look Good On The Dancefloor', 'https://www.youtube.com/embed/pK7egZaT3hs?autoplay=1'], ['R U Mine?', 'https://www.youtube.com/embed/VQH8ZTgna3Q?autoplay=1'], ['Old Yellow Bricks', 'https://www.youtube.com/embed/xLaeOrDmWQ4?autoplay=1'], ['Fluorescent Adolescent', 'https://www.youtube.com/embed/ma9I9VBKPiw?autoplay=1'], ['Riot Van', 'https://www.youtube.com/embed/2XSOI72rZlw?autoplay=1'], ['Do I Wanna Know', 'https://www.youtube.com/embed/bpOSxM0rNPM?autoplay=1'], ['When The Sun Goes Down', 'https://www.youtube.com/embed/EqkBRVukQmE?autoplay=1']]; // Pick a random AM song. const song = songs[Math.floor(Math.random() * songs.length)]; // Add it to the page. const songContainer = document.getElementById('song-container'); songContainer.innerText = song[0]; // Add video to the page. const songVideo = document.getElementById('song-video'); songVideo.style.display = 'inline-block'; songVideo.src = song[1]; } function getSentiment() { const sentiment = document.getElementById('analysis-results'); sentiment.style.display = 'inline-block'; }
javascript
{ "name": "Royal Protocol", "symbol": "RYP", "address": "0xaDB0A3e96E6cC22c0781c7C793FeD99968De426e", "decimals": 18, "dharmaVerificationStatus": "UNVERIFIED" }
json
from __future__ import division from collections import defaultdict import itertools import sys import os import sqlite3 import click from kSpider2.click_context import cli import glob class kClusters: source = [] target = [] source2 = [] target2 = [] seq_to_kmers = dict() names_map = dict() components = defaultdict(set) def __init__(self, logger_obj, index_prefix, cut_off_threshold): self.Logger = logger_obj self.names_file = index_prefix + ".namesMap" self.cut_off_threshold = cut_off_threshold self.seqToKmers_file = index_prefix + "_kSpider_seqToKmersNo.tsv" self.pairwise_file = index_prefix + "_kSpider_pairwise.tsv" self.uncovered_seqs = set() self.shared_kmers_threshold = 200 self.seq_to_clusterid = dict() self.max_cluster_id = 0 self.Logger.INFO("Loading TSV pairwise file") self.load_seq_to_kmers(self.seqToKmers_file) self.tsv_get_namesmap() def load_seq_to_kmers(self, tsv): with open(tsv) as KMER_COUNT: next(KMER_COUNT) for line in KMER_COUNT: seq_ID, no_of_kmers = tuple(line.strip().split('\t')[1:]) self.seq_to_kmers[int(seq_ID)] = int(no_of_kmers) def ids_to_names(self, cluster): new_cluster = [] for _id in cluster: new_cluster.append(self.names_map[int(_id)]) return new_cluster def tsv_get_namesmap(self): with open(self.names_file, 'r') as namesMap: next(namesMap) # skip the header for row in namesMap: row = row.strip().split() self.names_map[int(row[0])] = row[1] def tsv_build_graph(self): with open(self.pairwise_file, 'r') as pairwise_tsv: next(pairwise_tsv) # skip header for row in pairwise_tsv: row = row.strip().split() seq1 = int(row[1]) seq2 = int(row[2]) shared_kmers = int(row[3]) containment = 0.0 min_seq = float( min(self.seq_to_kmers[seq1], self.seq_to_kmers[seq2])) containment = shared_kmers / min_seq if containment < self.cut_off_threshold: continue if shared_kmers < self.shared_kmers_threshold: self.source2.append(seq1) self.target2.append(seq2) elif shared_kmers >= self.shared_kmers_threshold: self.source.append(seq1) self.target.append(seq2) # # For covering clusters with single sequence uncovered_seqs_1 = set(self.names_map.keys()) - \ set(self.source).union(set(self.target)) for seq in uncovered_seqs_1: self.uncovered_seqs.add(seq) # OR: # for i in range(1, len(self.names_map) + 1, 1): # self.source.append(i) # self.target.append(i) def clustering(self): registers = defaultdict(lambda: None) def find(x): l = registers[x] if l is not None: l = find(l) registers[x] = l return l return x def union(x, y): lx, ly = find(x), find(y) if lx != ly: registers[lx] = ly for i in range(len(self.source)): union(self.source.pop(), self.target.pop()) for x in registers: self.components[find(x)].add(x) temp_components = self.components.copy() self.components.clear() for cluster_id, (k, v) in enumerate(temp_components.items(), 1): self.components[cluster_id] = set(v) for seq in v: self.seq_to_clusterid[seq] = cluster_id temp_components.clear() self.post_clustering() def post_clustering(self): registers2 = defaultdict(lambda: None) local_components = defaultdict(set) covered_seqs = set() def find(x): l = registers2[x] if l is not None: l = find(l) registers2[x] = l return l return x def union(x, y): lx, ly = find(x), find(y) if lx != ly: registers2[lx] = ly for i in range(len(self.source2)): union(self.source2.pop(), self.target2.pop()) for x in registers2: local_components[find(x)].add(x) self.components = dict(self.components) covered_clusters = set() for cluster2_id, (k, v) in enumerate(local_components.items(), 1): for seq in v: covered_seqs.add(seq) for seq in v: if seq in self.seq_to_clusterid: cluster_id = self.seq_to_clusterid[seq] to_be_added = set() for i in v: if i not in self.seq_to_clusterid: to_be_added.add(i) self.components[cluster_id] = self.components[cluster_id].union( to_be_added) covered_clusters.add(k) continue self.uncovered_seqs = self.uncovered_seqs - covered_seqs uncovered_clusters = set(local_components.keys()) - covered_clusters max_id = len(self.components) for i, unc in enumerate(uncovered_clusters, 1): max_id += 1 self.components[max_id] = local_components[unc] for seq in self.uncovered_seqs: max_id += 1 self.components[max_id] = {seq} def export_kCluster(self): kCluster_file_name = f"kSpider_{self.cut_off_threshold:.2f}%_" kCluster_file_name += os.path.basename( self.pairwise_file).split(".")[0] kCluster_file_name += ".clusters.tsv" with open(kCluster_file_name, 'w') as kClusters: kClusters.write("kClust_id\tseqs_ids\n") for cluster_id, (k, v) in enumerate(self.components.items(), 1): kClusters.write( f"{cluster_id}\t{'|'.join(self.ids_to_names(v))}\n") self.Logger.INFO(f"Total Number Of Clusters: {cluster_id}") """ TODO: New help messages 1. containment cutoff (sim_cutoff): cluster sequences with (containment > cutoff) where containment = shared kmers % to the total kmers in the smallest node. 2. connectivity cutoff (con_cutoff): cluster sequences with (connectivity > cutoff) where connectivity = shared kmers % to the total kmers in the largest node. 3. min count cutoff (min_count): the min kmers count of a node to connect two clusters, otherwise the node will be reported twice in both clusters. """ @cli.command(name="cluster", help_priority=5) @click.option('-c', '--cutoff', required=False, type=click.FloatRange(0, 1, clamp=False), default=0.0, show_default=True, help="cluster sequences with (containment > cutoff)") @click.option('-i', '--index-prefix', "index_prefix", required=True, type=click.STRING, help="kProcessor index file prefix") @click.pass_context def main(ctx, index_prefix, cutoff): """Sequence clustering.""" kCl = kClusters(logger_obj=ctx.obj, index_prefix=index_prefix, cut_off_threshold=cutoff) ctx.obj.INFO("Building the main graph...") kCl.tsv_build_graph() ctx.obj.INFO("Clustering...") kCl.clustering() ctx.obj.INFO("Exporting ...") kCl.export_kCluster()
python
Begin typing your search above and press return to search. 'Kashmir issue main cause of India-Pakistan tension' Islamabad, September 23: Terming the Kashmir dispute as the main reason of tension with India, Pakistan Prime Minister waz Sharif has urged New Delhi to hold talks on all issues, including Kashmir. The issue should also be raised at other platforms besides bilateral talks between the two neighbouring countries, Geo TV quoted Sharif as saying on Tuesday. “Sooner the issue is resolved, the better it will be for both the countries,” he said, adding Pakistan will continue playing its due role for peace and stability in the region. (IANS)
english
XFL 2-Minute Rule Explained: What is So Unique About XFL’s Approach to The 2-Minute Period? The XFL is officially in its second week of games this season, and its popularity seems to only be increasing as time passes. In the myriad of new things this league brings to its fans, the most popular change of all is the different set of rules they follow. In that, one particular rule seems to stick out more than others. We are talking about the XFL’s 2-minute rule. The XFL’s 2-minute period has been the topic of discussion among many fans and enthusiasts recently. More so because of the number of rules that govern the clock during that period. Many think that this might be the one rule that the XFL may have gone overboard with. However, the XFL has its reasons. Valid ones, too, at that. Blandino also explained one other interesting addition to the 2-minute period. He says, “We also added the college first-down rules. So if the runner makes the line again in the field of play, the clock will stop. And wind on the ready-for-play”. Blandino explains that the league hopes the teams have more opportunities to mount a comeback with the extra time on their hands. The XFL is steadily rising in popularity among the footballing community, especially NFL fans. With their season snug tightly between every other major football league’s schedule, the XFL has given fans the opportunity to watch their games without having to choose. What’s more, they are proving to be an entertaining source of football, second perhaps only to the NFL itself. Though it doesn’t seem that the XFL wants to disturb that balance. In fact, they are keener to act as a minor league to the NFL, in the near future. XFL officials have already stated that the hope is to become a “launching pad” for those athletes vying for a spot in the NFL. Will the XFL be able to retain the increasing number of viewers? Or is it too destined to fade away, like its predecessors?
english
<reponame>sizmailov/pyxmolpp2 #include "xmol/io/pdb/PdbRecord.h" #include "xmol/io/pdb/exceptions.h" #include <fstream> using namespace xmol::io; using namespace xmol::io::pdb; const std::vector<int>& PdbRecordType::getFieldColons(const FieldName& fieldName) const { auto col = fieldColons.find(fieldName); if (col != fieldColons.end()) { return col->second; } throw PdbUknownRecordField("Unknown field" +fieldName.str() + "`"); } void PdbRecordType::set_field(const FieldName& fieldName, const std::vector<int>& colons) { fieldColons[fieldName] = colons; } StandardPdbRecords::StandardPdbRecords() { this->recordTypes = detail::get_bundled_records(); } const PdbRecordType& AlteredPdbRecords::get_record( const RecordName& recordTypeName) const { auto it = recordTypes.find(recordTypeName); if (it != recordTypes.end()) { return it->second; } return basic->get_record(recordTypeName); } void AlteredPdbRecords::alter_record(RecordName recordTypeName, FieldName fieldName, std::vector<int> colons) { auto it = recordTypes.find(recordTypeName); if (it != recordTypes.end()) { // alter owned record it->second.set_field(fieldName, colons); } else { try { // copy record from backup and alter field auto record = recordTypes.emplace(recordTypeName, basic->get_record(recordTypeName)); record.first->second.set_field(fieldName, colons); } catch (std::out_of_range&) { // create new record with single field recordTypes.emplace(recordTypeName, PdbRecordType({{fieldName, colons}})); } } } const PdbRecordType& StandardPdbRecords::get_record(const RecordName& recordTypeName) const { auto col = recordTypes.find(recordTypeName); if (col != recordTypes.end()) { return col->second; } throw PdbUknownRecord("Unknown record `" + recordTypeName.str() + "`"); } const basic_PdbRecords& StandardPdbRecords::instance() { const static StandardPdbRecords singleton; return singleton; }
cpp
To succeed in a competitive examination is no more a child's play. If you desire to rake in extra bucks in supplementary education industry, cash in on this lucrative sector, as it already enjoys a bigger slice of the education industry pie. THE field of education today has become very competitive. Students have to appear in board examinations, aspiring for high scores. They must also strive to get through the entrance tests for admission at a prestigious institution. This puts pressure on them. Moreover, parents also want to enhance the mental skills of their children. Here, the role of supplementary education becomes significant. Building child's self-confidence, improving his skills through systems like abacus calculations, developing his personality and offering him coaching services are the areas catered to by supplementary education in India. Currently, categories such as child skill development, coaching, tutoring and test preparation are gradually flourishing. Besides supporting formal education (Pre-schools & K-12 segment), the supplementary education segment is branching out in a big way. Whether it is for clearing board examinations, or the medical or non-medical entrance tests, the demand for coaching classes has risen offering business opportunities in this segment. India's supplementary education segment today has the largest share in the education space, as it's been growing at a faster rate. For edupreneurs, franchising has always been regarded as the apt business model. India's supplementary education industry is highly organised as it is led by top-notch players such as SmartQ, Promise, Ideal Classes Pvt. Ltd, Vidyalankar, Career Launcher, and a host of others. Currently, Ideal Classes operates its units in 43 cities with 34 franchise and 9 company-owned outlets. An Ideal Classes centre would require space of 800 sq.ft with investment starting from Rs 4 lakh to Rs 6 lakh. For scaling up their presence across the country, the company will be adding at least 50 centres across B & C cities. Once a franchise deal is clinched, franchisors render their complete support to its franchisees through a set of extensive training systems. IDEAL maintains quality standards at the franchisee-owned branches by taking such steps as deputing quality teachers, providing study materials and technology, etc. Similarly, Career Launcher focuses on providing counseling, business development, soft skills and academic training to its franchisees. The franchisees may face problems related to logistics, course content and their franchisor's marketing initiatives. Therefore, a centralised logistic process with predefined procedures and deadlines is the way out. Besides, a stiff competition from the unorganised market, delivering quality content, and inability of conversion franchisees to maintain the brand's standards are some of the other obstacles. About the challenges they faced while setting up their organisation, Dipanjan Das cited customer apprehension regarding quality maintenance as one of them. Therefore, they select business partners carefully and provide them business assistance in key areas. The underlying message is that the supplementary education industry's growth looks promising. This is what Career Launcher's Dipanjan Das also believes. “It should grow at a 25 per cent Compound Annual Growth Rate over the next five years,” he said. Besides, the industry is also anticipated to be more organised with time. Therefore, the supplementary education industry is poised for a faster growth. Franchising is being hailed as the safest route for edupreneurs to earn enduring profits.
english
Tollywood superstar Mahesh Babu has always been a family person. No matter how busy he is, he always makes time to spend time with family and whenever he is free he loves to go family vacations to foreign. Mahesh Babu who recently got back to India from the long US schedule is spotted in a picture shared by his better half Namrata Shirodkar. Namrata shared a selfie picture of herself with her close friend when they attended a birthday party, last night. Interestingly, Mahesh is also seen in that picture hiding behind Namrata. Only a part of his face is viable. It is too cute to watch Mahesh covering his face behind Namrata. The duo ladies are looking gorgeous where Mahesh is looking handsome. On the work front, Mahesh is currently busy with the shooting of his upcoming movie 'Maharshi' under the direction of Vamsi Paidipally. Pooja Hegde is playing the female lead in the movie. Dil Raju in association with PVP and Ashwini Dutt is Bankrolling this project.
english
<gh_stars>0 {"organizations": [], "uuid": "2106a2ca0599b82603713c9712bc40bdb11f29ec", "thread": {"social": {"gplus": {"shares": 0}, "pinterest": {"shares": 0}, "vk": {"shares": 0}, "linkedin": {"shares": 0}, "facebook": {"likes": 0, "shares": 0, "comments": 0}, "stumbledupon": {"shares": 0}}, "site_full": "www.tripadvisor.com", "main_image": "https://media-cdn.tripadvisor.com/media/photo-s/06/db/ed/56/apex-temple-court-hotel.jpg", "site_section": "https://www.tripadvisor.com/Hotel_Review-g186338-d2539103-Reviews-Apex_Temple_Court_Hotel-London_England.html", "section_title": "Apex Temple Court Hotel - UPDATED 2017 Reviews &amp; Price Comparison (London, England) - TripAdvisor", "url": "https://www.tripadvisor.com/ShowUserReviews-g186338-d2539103-r469172581-Apex_Temple_Court_Hotel-London_England.html", "country": "US", "domain_rank": 189, "title": "Great Stay", "performance_score": 0, "site": "tripadvisor.com", "participants_count": 2, "title_full": "Great Stay - Review of Apex Temple Court Hotel, London, England - TripAdvisor", "spam_score": 0.0, "site_type": "discussions", "published": "2017-03-21T02:00:00.000+02:00", "replies_count": 1, "uuid": "2106a2ca0599b82603713c9712bc40bdb11f29ec"}, "author": "F6078RCchristopherc", "url": "https://www.tripadvisor.com/ShowUserReviews-g186338-d2539103-r469172581-Apex_Temple_Court_Hotel-London_England.html", "ord_in_thread": 0, "title": "Great Stay", "locations": [], "entities": {"persons": [], "locations": [], "organizations": []}, "highlightText": "", "language": "english", "persons": [], "text": "Excellent location and great rooms and friendly staff - better than We were expecting. We visit London a lot and this hotel exceeded many of the 5 star offerings we have stayed in. Highly recommended !!", "external_links": [], "published": "2017-03-21T02:00:00.000+02:00", "crawled": "2017-03-31T21:05:52.729+03:00", "highlightTitle": ""}
json
Bollywood actress Sridevi and her husband Bonney Kapoor on Tuesday campaigned for Rashtriya Lok Dal (RLD) candidate Amar Singh in Fatehpur Sikri in Uttar Pradesh. Huge crowds turned up to see Sridevi, causing traffic jams on the national highway, witnesses said. Amar Singh's RLD has an alliance with the Congress. He is pitted against Samajwadi Party's Pakshlika Singh and BJP's Choudhary Babu Lal. The Aam Admi Party has fielded Laxmi Choudhary. (This story has not been edited by News18 staff and is published from a syndicated news agency feed - IANS)
english
Ranveer Singh is celebrity par excellence — his insane fan-following is testament. Besides his exceptionally impressive and versatile filmography list, there’s more to the actor that makes him stand out. Ranveer is the kind of actor who captures eyeballs right when he walks into a room; his charisma, energy and stellar aura only make up for half of his personality. Because, how can we not talk about his A1-style game? As a beauty writer, since I’m keen on exploring the many facets of ‘men in beauty,’ I’m perpetually impressed by the fabulous looks of Ranveer — his hairstyles in particular. His mane is one of his main features; his hairstyles are so refreshing. On his birthday today, I list down some of his best hairstyles. Boys, are you taking notes? Who said the perfect after-wash blowout doesn’t exist … for men? Ranveer looks exceedingly stylish with this fresh mane that complements his in-place beard perfectly. A sexy set-back hairstyle is always a good idea, especially on days when your hair is oily and greasy. After all, we all need some end-minute fixes, right? So, pick up some hair gel or wax and pull back your hair like Ranveer. Taking the appeal of a man bun to a whole new level, Ranveer is raising the bars here. Do you agree? Sync in with the Gen-Z vibes to the core as you put on a bucket hat on your head and call it a day! What’s better than one ponytail? Duh, two. Look sport-ready, gym-ready even, in this uber-dapper hairdo that’s perfect to keep up the style while sticking to convenience.
english
{"notifications": [{"type": "notificationTray", "item": {"unreadCount": 0}}], "response": {"friends": {"items": [{"tips": {"count": 0}, "contact": {}, "firstName": "Jerry", "gender": "male", "lastName": "Wang", "id": "4251038", "bio": "", "photo": {"prefix": "https://igx.4sqi.net/img/user/", "suffix": "/blank_boy.png", "default": true}, "homeCity": "Unnamed Location", "lists": {"groups": [{"items": [], "count": 2, "type": "created"}]}}, {"tips": {"count": 0}, "contact": {"twitter": "sharivalentino", "facebook": "684907894"}, "firstName": "Shari", "gender": "female", "lastName": "Chong", "id": "5736951", "bio": "", "photo": {"prefix": "https://igx.4sqi.net/img/user/", "suffix": "/OUM3OF4NOOXBLFJD.jpg"}, "homeCity": "Singapore", "lists": {"groups": [{"items": [], "count": 2, "type": "created"}]}}, {"tips": {"count": 7}, "contact": {"twitter": "graceleett", "facebook": "10155275841353644"}, "firstName": "Grace", "gender": "female", "lastName": "Lee", "id": "5018841", "bio": "", "photo": {"prefix": "https://igx.4sqi.net/img/user/", "suffix": "/X2FPOQHMUYEMSUWL.jpg"}, "homeCity": "Singapore", "lists": {"groups": [{"items": [], "count": 2, "type": "created"}]}}, {"tips": {"count": 0}, "contact": {"facebook": "663777815"}, "firstName": "Shaokang", "gender": "male", "lastName": "Ma", "id": "5189265", "bio": "", "photo": {"prefix": "https://igx.4sqi.net/img/user/", "suffix": "/IG3QWV5KBLBM40DF.jpg"}, "homeCity": "Singapore", "lists": {"groups": [{"items": [], "count": 2, "type": "created"}]}}, {"tips": {"count": 0}, "contact": {"facebook": "728772799"}, "firstName": "Xavier", "gender": "male", "lastName": "Chong", "id": "4508304", "bio": "", "photo": {"prefix": "https://igx.4sqi.net/img/user/", "suffix": "/blank_boy.png", "default": true}, "homeCity": "Singapore", "lists": {"groups": [{"items": [], "count": 2, "type": "created"}]}}, {"tips": {"count": 1}, "contact": {"twitter": "jacqmong", "facebook": "624807463"}, "firstName": "Jacqueline", "gender": "female", "id": "3346401", "bio": "", "photo": {"prefix": "https://igx.4sqi.net/img/user/", "suffix": "/54I13K1F5Z5QBK1Y.jpg"}, "homeCity": "Singapore", "lists": {"groups": [{"items": [], "count": 2, "type": "created"}]}}, {"tips": {"count": 2}, "contact": {"facebook": "756542885"}, "firstName": "hydroyves", "gender": "male", "id": "1153558", "bio": "", "photo": {"prefix": "https://igx.4sqi.net/img/user/", "suffix": "/ZCIA1OLK2BKN1S2P.jpg"}, "homeCity": "Singapore", "lists": {"groups": [{"items": [], "count": 2, "type": "created"}]}}, {"tips": {"count": 1}, "contact": {"facebook": "1404633957"}, "firstName": "SIYING_SIYING", "gender": "female", "id": "18438455", "bio": "Found \u2764 at Heart of God Church . Found fun in GM (;", "photo": {"prefix": "https://igx.4sqi.net/img/user/", "suffix": "/GBFEKUBTZJV0HGAR.jpg"}, "homeCity": "Singapore", "lists": {"groups": [{"items": [], "count": 2, "type": "created"}]}}, {"tips": {"count": 0}, "contact": {}, "firstName": "Goodboy", "gender": "male", "lastName": "Sam", "id": "5763909", "bio": "", "photo": {"prefix": "https://igx.4sqi.net/img/user/", "suffix": "/blank_boy.png", "default": true}, "homeCity": "New York, NY", "lists": {"groups": [{"items": [], "count": 2, "type": "created"}]}}, {"tips": {"count": 0}, "contact": {}, "firstName": "Jason", "gender": "male", "lastName": "Leo", "id": "5054928", "bio": "", "photo": {"prefix": "https://igx.4sqi.net/img/user/", "suffix": "/5VYIJDWYZP2CKTPR.jpg"}, "homeCity": "Singapore", "lists": {"groups": [{"items": [], "count": 2, "type": "created"}]}}, {"tips": {"count": 0}, "contact": {}, "firstName": "Orion", "gender": "male", "lastName": "Mega", "id": "3542310", "bio": "", "photo": {"prefix": "https://igx.4sqi.net/img/user/", "suffix": "/4EVLTWYTXBZH1WTA.jpg"}, "homeCity": "Singapore", "lists": {"groups": [{"items": [], "count": 2, "type": "created"}]}}, {"tips": {"count": 0}, "contact": {"facebook": "524263336"}, "firstName": "<NAME>", "gender": "male", "lastName": "Lim", "id": "2971017", "bio": "", "photo": {"prefix": "https://igx.4sqi.net/img/user/", "suffix": "/YZRMSBSMCK1HMAS2.jpg"}, "homeCity": "Singapore", "lists": {"groups": [{"items": [], "count": 2, "type": "created"}]}}, {"tips": {"count": 3}, "contact": {"facebook": "763789637"}, "firstName": "Robert", "gender": "male", "lastName": "Tan", "id": "38302566", "bio": "", "photo": {"prefix": "https://igx.4sqi.net/img/user/", "suffix": "/XTPJQCFDNC4SGMHA.jpg"}, "homeCity": "Brunei and Muara", "lists": {"groups": [{"items": [], "count": 2, "type": "created"}]}}], "count": 13}, "checksum": "daaf20e84f37e4a0379d640d6e7e0acfdb75fbbb"}, "meta": {"requestId": "5965f3b59fb6b77be2023099", "code": 200}}
json
{ "name": "MobileVLCKit", "version": "3.0.2", "summary": "MobileVLCKit is an Objective-C wrapper for libvlc's external interface on iOS.", "homepage": "https://code.videolan.org/videolan/VLCKit", "license": { "type": "LGPL v2.1", "file": "COPYING.txt" }, "documentation_url": "https://wiki.videolan.org/VLCKit/", "social_media_url": "https://twitter.com/videolan", "platforms": { "ios": "7.0" }, "authors": { "<NAME>": "<EMAIL>", "<NAME>": "<EMAIL>", "<NAME>": "<EMAIL>", "<NAME>": "<EMAIL>", "<NAME>": "<EMAIL>", "<NAME>": "<EMAIL>", "<NAME>": "<EMAIL>", "<NAME>": "<EMAIL>", "<NAME>": "<EMAIL>", "VideoLAN": "<EMAIL>", "<NAME>": "<EMAIL>", "<NAME>": "<EMAIL>", "<NAME>": "<EMAIL>", "<NAME>": "<EMAIL>", "<NAME>": "<EMAIL>", "<NAME>": "<EMAIL>", "<NAME>": "<EMAIL>", "<NAME>": "<EMAIL>", "<NAME>": "<EMAIL>", "<NAME>": "<EMAIL>", "<NAME>": "<EMAIL>", "<NAME>": "<EMAIL>", "<NAME>": "<EMAIL>", "<NAME>": "<EMAIL>", "<NAME>": "<EMAIL>", "<NAME>": "<EMAIL>", "<NAME>": "<EMAIL>", "<NAME>": "<EMAIL>", "<NAME>": "<EMAIL>", "<NAME>": "<EMAIL>", "<NAME>": "<EMAIL>", "<NAME>": "<EMAIL>", "<NAME>": "<EMAIL>", "<NAME>": "<EMAIL>", "<NAME>": "<EMAIL>", "<NAME>": "<EMAIL>", "<NAME>": "<EMAIL>", "<NAME>": "<EMAIL>", "<NAME>": "<EMAIL>", "<NAME>": "<EMAIL>", "<NAME>": "<EMAIL>", "<NAME>": "<EMAIL>", "<NAME>": "<EMAIL>", "<NAME>": "<EMAIL>" }, "source": { "http": "https://download.videolan.org/pub/cocoapods/prod/MobileVLCKit-3.0.2-fe6c71f-158cb80053.tar.xz", "sha256": "afdabe939333ed8b6204798d6bb5598801e24a8a499a93aa5b3c3534d038078b" }, "ios": { "vendored_frameworks": "MobileVLCKit.framework" }, "source_files": "MobileVLCKit.framework/Headers/*.h", "public_header_files": "MobileVLCKit.framework/Headers/*.h", "frameworks": [ "QuartzCore", "CoreText", "AVFoundation", "Security", "CFNetwork", "AudioToolbox", "OpenGLES", "CoreGraphics", "VideoToolbox", "CoreMedia" ], "libraries": [ "c++", "xml2", "z", "bz2", "iconv" ], "requires_arc": false, "xcconfig": { "CLANG_CXX_LANGUAGE_STANDARD": "c++11", "CLANG_CXX_LIBRARY": "libc++" } }
json
<reponame>conda-forge/repodata-shards<gh_stars>0 { "channeldata": { "activate.d": false, "binary_prefix": false, "deactivate.d": false, "description": "geosnap is an open-source, Python package for exploring, modeling, and visualizing neighborhood dynamics. It provides a suite of tools for creating socio-spatial datasets, harmonizing those datasets into consistent set of time-static boundaries, and modeling neighborhood change using classic and spatial statistical methods.", "dev_url": "https://github.com/spatialucr/geosnap", "doc_source_url": null, "doc_url": "http://spatialucr.github.io/geosnap", "home": "http://github.com/spatialucr/geosnap", "icon_hash": null, "icon_url": null, "identifiers": null, "keywords": null, "license": "BSD-3-Clause", "post_link": false, "pre_link": false, "pre_unlink": false, "recipe_origin": null, "run_exports": {}, "source_git_url": null, "source_url": "https://pypi.io/packages/source/g/geosnap/geosnap-0.3.1.tar.gz", "subdirs": [ "noarch" ], "summary": "Geospatial Neighborhood Analysis in Python", "tags": null, "text_prefix": false, "timestamp": 1588620567, "version": "0.3.1" }, "channeldata_version": 1, "feedstock": null, "labels": [ "main" ], "package": "geosnap-0.3.1-py_0.tar.bz2", "repodata": { "build": "py_0", "build_number": 0, "depends": [ "appdirs", "cenpy >=1.0", "dash", "dash-bootstrap-components", "geopandas", "giddy >=2.2.1", "libpysal", "matplotlib-base", "palettable", "pandas", "pip", "pyarrow >=0.14.1", "python >=3", "quilt3 >=3.1.11", "region >=0.2.0", "scikit-learn", "seaborn", "spenc", "tobler >=0.2.1", "tqdm", "xlrd" ], "license": "BSD-3-Clause", "license_family": "BSD", "md5": "5173a28613e66aa330029587d63ed881", "name": "geosnap", "noarch": "python", "sha256": "68abd454bd67cb4038b41a6de3ae66f4b498c707fc05dadb5863589f8d571b24", "size": 50593, "subdir": "noarch", "timestamp": 1588620567632, "version": "0.3.1" }, "repodata_version": 1, "subdir": "noarch", "url": "https://github.com/regro/releases/releases/download/noarch/geosnap-0.3.1-py_0.tar.bz2/geosnap-0.3.1-py_0.tar.bz2" }
json
Blog growth is frustratingly slow for many people. Here’s a look back one year after coming on to the blog at Yotpo, about what worked, what didn’t – and what we learned in the process. You’ve heard it once and you’ll hear it again: blogging is a marathon, not a sprint. And for marketing teams in quickly growing companies, blogging can seem frustratingly slow. But the age-old adage stays true: blogging takes time and patience. For the impatient among us, that’s the last thing we want to hear. We want quick results, instant insights, and the type of stellar results other bloggers brag about. Trust me – we tried to hack the system. Our meetings about the blog went a little like this: A slideshare! That’s the answer. No, no, an infographic, that will do it! Hacky listicles are the way to go! Let’s just guest post for big blogs and watch the traffic pour in! And, my personal favorite: Let’s just make a viral post! But these are outliers. This is not the norm. The majority of blogs are doomed to slow – but steady! – growth. Take a look at our Google Analytics traffic growth over the past year. From January to June, not a lot of action. But then, almost right on the six-month mark, our traffic spiked. And from there it continued to grow. The growth has been slow, but in the past year, we’ve seen: After a year of blogging, here are the top 10 lessons I’ve learned: 1) It takes a year to know what your blog is about. We initially built the blog strategy based on what we thought our customers wanted: tips for how to increase eCommerce traffic, engagement, and conversions. We created eBooks and pillars and groups of posts around this plan, but we quickly realized that this plan was not only way too broad, but a difficult strategy to execute. Over the past year, we’ve figured out which posts resonate best with our readers, based on successes as well as mistakes. Through this journey, we learned what worked and what didn’t, which guided us towards a more focused strategy. Ending the year in 2015, for the first time this year, I can say that I clearly understand what our blog is about. So what is the Yotpo blog all about? Marketing, eCommerce, and reviews, and it’s packed with data-driven guides, important industry trends, expert tips, and success stories from online store owners. 2) Planning is underrated. Make a plan. Make a million plans. You’ll want to use these as reference when planning your content strategy as well as to look back on to see how your strategy has changed over time. When designing our content strategy plan, I used Hubspot‘s strategy for organizing content as a guide. Take a look at how Hubspot explains the type of posts they publish: For our blog, we have divided the posts into medium, topic, and purpose. - Medium means the format of the post – is it a data insight, trends & tips article, updates from Yotpo, or a success story? - Topic breaks these posts down according to the core issue they tackle. Our main topics are marketing, eCommerce, and reviews. But within these topics, there are plenty of other topics, like traffic, engagement, and UGC strategy. - The purpose follows the Hubspot model. What’s our intention with the post? Is it a TOFU post designed to drive traffic? A promo post for a Slideshare or infographic? Or is it a deep tactical post derived from Yotpo data. For planning, I use Coschedule to map out our content calendar, good ‘ol sticky notes (on the computer) for weekly to-do’s and reminders, and Google docs to brainstorm topics and create quarterly plans. When you create plans, I suggest dividing them according to content strategy and KPIs. In other words, your strategy for what posts to write should be different than your strategy for optimizing for conversion or growing referral traffic. What we have found works best is to let quarterly goals (grow traffic, increase conversions, etc.) help guide our content strategy, but not dictate it. So for example, in Q4, we had mostly top-of-funnel posts designed to grow traffic rather than focusing on data-heavy posts closely related to our product that we hoped would lead to conversions. 3) You can’t do it all. So don’t try. As blog manager, I want to create the best blog possible. But between optimizing CTAs, A/B testing, design, post layout, and managing requests for guest blog posts and looking over freelancers, writing often got pushed to the bottom of the list. The quality of our posts suffered, and it was clear I wasn’t paying enough attention to content strategy and creation. In Q4, my manager and I made a resolution that all I was going to worry about was writing great posts to increase traffic. As hard as it was for me to turn my mind off from worrying about conversion, it allowed me to take time to get our content back on track. That’s not to say you shouldn’t be a multi-tasker or that I’m not also focused on conversion. You should definitely be responsible for the blog from start to finish. But you need to understand that time is limited and prioritize what matters rather than trying to do it all. Figure out how to best use your coworkers’ skills to help you reach your goals. It may take me two hours to figure out how to improve conversions on a certain landing page, but a 15-minute meeting with our UX designer works even better. You’re not an island. Do what you can – and ask for help when you can’t. 4) It’s not easy to find good freelancers. We tried, oh we tried. We searched on sites like eLance, but we struggled to find a fabulous writer who also had a deep understanding of content marketing and our industry. In the end, we did find quite a few good freelancers. Our best success was finding people through our personal and professional networks, and by taking advantage of a promo on inbound.org to post an internship position for free. Inbound.org ended up being our best for leads on qualified candidates, mainly because people on inbound.org are already in the industry and have a basic understanding of what content marketing blogging is. Another big tip is to not blow your budget by asking every candidate to write a sample. A great way to level the playing field is to ask freelancers for title samples first. You’ll be able to really easily weed out those who “get” what your blog is about and those who may be great writers, but don’t think like marketers. We looked everywhere, but the truth is, there’s nothing as valuable as having an in-house writer who knows the industry, the company goals, and the blog strategy. In the end though, it’s very difficult to find a freelancer who can produce the same quality content as an in-house writer – and sometimes financially, it’s smarter to just hire someone in house. 5) Have your eye everywhere. Great writers read. In the fast-paced world of content marketing, it can be difficult for marketers to stop and take some time to read for pleasure each day. I give myself about an hour each day to just read posts that interest me online. They don’t necessarily need to be related to marketing, or eCommerce, or really anything. But they’re huge sources of inspiration. My two favorite newsletters are Next Draft and MediaRedef, which curate the best posts from around the web. Even on my busiest days, I take some time to scan through these newsletters and check out a few longform articles. I may not have time to finish the whole read, but I save them for later, and just that little bit of reading for pleasure gets the creative juices in my head flowing. 6) Don’t obsess over the analytics. The first six months of managing the blog at Yotpo, I constantly refreshed Google Analytics, waiting to see the same type of insane results I read about in so many other posts. Checking month to month, or week to week, is pretty fruitless. You’ll drive yourself insane checking. What’s most important is to see trends. I look back at the data when creating quarterly goals (as you can see below), but content strategy is equal parts data and instinct. If I based all my strategy off these numbers, I doubt it would be very effective. A few months isn’t enough to really see trends in a blog. You should, of course, be checking stats regularly, but don’t necessarily go all up in arms and change your entire plan because of one post that did really well. The best strategy decisions are made after taking more time to absorb long-term changes. 7) Use your users and subscribers! One of our most successful initiatives has been including blog posts in our product newsletters. As you can see, our biggest spikes in traffic happened when product newsletters were sent out. Here’s a look at total traffic: And here’s a look at traffic from our product newsletters: Focus on building up your email subscriber list and marketing to users. 8) Quality is so, so much more important than quantity. And quality takes time. We experimented with different amount of blog posts per week, varying between two to five. The more we posted, the worse the posts got. I just didn’t have the same amount of time to put into each post. There is just so much content on the web that people don’t want to read the same old stuff anymore. Content marketers who want to stand out need to have really unique ideas and original ways to add value. 9) SEO is a b*tch. I know it’s important to write posts that will be found, but SEO is one tough nut to crack. It’s always important to optimize posts, and this is one habit I definitely encourage, but actually figuring out which keywords to optimize for is another story. Even with the help of an SEO consultant, it’s been difficult finding relevant and achievable SEO keywords to target. Plus, even when we do identify the right keywords, they don’t always fit nicely into a post. I’ve learned that keywords are best for informing the content creation process, not defining it. We use keywords as a general guideline, but often the posts that do best for us weren’t created with SEO in mind. Most of our top posts for organic traffic weren’t created for SEO purposes at all – it just so happens that they started ranking well. 10) Don’t get discouraged. Cliche, but true. I like to see results and measure successes. With blogging, it’s not always that easy. Believe in yourself and your goals enough that you can keep going even when certain KPIs start to drop. There’s no hacks that will replace that. When we looked at the blogs we loved and knew were successful (like Buffer, Groove, and Shopify) one thing was clear — they just wrote awesome content. No doubt it was informed by keywords and good research (the CoSchedule bloghas a spooky habit of knowing exactly what we are discussing this week) and built by outreach to influencers and supported by a few amazing “viral-y” posts, but ultimately these blogs just consistently produce well-written, well-researched and useful posts. So that’s the secret: Just keep swimming. Get the most important tech news in your inbox each week.
english
/* * Copyright (C) 2020 Temporal Technologies, Inc. All Rights Reserved. * * Copyright 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Modifications copyright (C) 2017 Uber Technologies, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not * use this file except in compliance with the License. A copy of the License is * located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file 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 io.temporal.internal.replay; import io.temporal.proto.decision.Decision; import io.temporal.proto.decision.DecisionType; import io.temporal.proto.decision.RequestCancelExternalWorkflowExecutionDecisionAttributes; import io.temporal.proto.decision.StartChildWorkflowExecutionDecisionAttributes; import io.temporal.proto.event.HistoryEvent; final class ChildWorkflowDecisionStateMachine extends DecisionStateMachineBase { private StartChildWorkflowExecutionDecisionAttributes startAttributes; private String runId; public ChildWorkflowDecisionStateMachine( DecisionId id, StartChildWorkflowExecutionDecisionAttributes startAttributes) { super(id); this.startAttributes = startAttributes; } /** Used for unit testing */ ChildWorkflowDecisionStateMachine( DecisionId id, StartChildWorkflowExecutionDecisionAttributes startAttributes, DecisionState state) { super(id, state); this.startAttributes = startAttributes; } @Override public Decision getDecision() { switch (state) { case CREATED: return createStartChildWorkflowExecutionDecision(); case CANCELED_AFTER_STARTED: return createRequestCancelExternalWorkflowExecutionDecision(); default: return null; } } @Override public void handleDecisionTaskStartedEvent() { switch (state) { case CANCELED_AFTER_STARTED: state = DecisionState.CANCELLATION_DECISION_SENT; break; default: super.handleDecisionTaskStartedEvent(); } } @Override public void handleStartedEvent(HistoryEvent event) { stateHistory.add("handleStartedEvent"); switch (state) { case INITIATED: state = DecisionState.STARTED; break; case CANCELED_AFTER_INITIATED: state = DecisionState.CANCELED_AFTER_STARTED; break; default: } stateHistory.add(state.toString()); } @Override public void handleCancellationFailureEvent(HistoryEvent event) { switch (state) { case CANCELLATION_DECISION_SENT: stateHistory.add("handleCancellationFailureEvent"); state = DecisionState.STARTED; stateHistory.add(state.toString()); break; default: super.handleCancellationFailureEvent(event); } } @Override public boolean cancel(Runnable immediateCancellationCallback) { switch (state) { case STARTED: stateHistory.add("cancel"); state = DecisionState.CANCELED_AFTER_STARTED; stateHistory.add(state.toString()); return true; default: return super.cancel(immediateCancellationCallback); } } @Override public void handleCancellationEvent() { switch (state) { case STARTED: stateHistory.add("handleCancellationEvent"); state = DecisionState.COMPLETED; stateHistory.add(state.toString()); break; default: super.handleCancellationEvent(); } } @Override public void handleCompletionEvent() { switch (state) { case STARTED: case CANCELED_AFTER_STARTED: stateHistory.add("handleCompletionEvent"); state = DecisionState.COMPLETED; stateHistory.add(state.toString()); break; default: super.handleCompletionEvent(); } } private Decision createRequestCancelExternalWorkflowExecutionDecision() { return Decision.newBuilder() .setRequestCancelExternalWorkflowExecutionDecisionAttributes( RequestCancelExternalWorkflowExecutionDecisionAttributes.newBuilder() .setWorkflowId(startAttributes.getWorkflowId()) .setRunId(runId)) .setDecisionType(DecisionType.RequestCancelExternalWorkflowExecution) .build(); } private Decision createStartChildWorkflowExecutionDecision() { return Decision.newBuilder() .setStartChildWorkflowExecutionDecisionAttributes(startAttributes) .setDecisionType(DecisionType.StartChildWorkflowExecution) .build(); } }
java
<reponame>LoseYourself/etl_designer_3.0 /******************************************************************************* * * Pentaho Data Integration * * Copyright (C) 2002-2012 by Pentaho : http://www.pentaho.com * ******************************************************************************* * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ******************************************************************************/ package org.pentaho.di.ui.core.gui; import org.eclipse.jface.util.Geometry; import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.Point; import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Monitor; import org.eclipse.swt.widgets.Shell; /** * This class stores information about a screen, window, etc. * * @author Matt * @since 08-04-2004 * */ public class WindowProperty { private String name; private boolean maximized; private Rectangle rectangle; public WindowProperty(String name, boolean maximized, Rectangle rectangle) { this.name = name; this.maximized = maximized; this.rectangle = rectangle; } public WindowProperty(String name, boolean maximized, int x, int y, int width, int height) { this.name = name; this.maximized = maximized; this.rectangle = new Rectangle(x, y, width, height); } public WindowProperty(Shell shell) { name = shell.getText(); maximized = shell.getMaximized(); rectangle = shell.getBounds(); } public void setShell(Shell shell) { setShell(shell, false); } public void setShell(Shell shell, boolean onlyPosition) { setShell(shell, onlyPosition, -1, -1); } public void setShell(Shell shell, int minWidth, int minHeight) { setShell(shell, false, minWidth, minHeight); } /** * Performs calculations to size and position a dialog If the size passed in * is too large for the primary monitor client area, it is shrunk to fit. If * the positioning leaves part of the dialog outside the client area, it is * centered instead Note that currently, many of the defaults in * org.pentaho.di.ui.core/default.properties have crazy values. This causes * the failsafe code in here to fire a lot more than is really necessary. * * @param shell * The dialog to position and size * @param onlyPosition * Unused argument. If the window is outside the viewable client are, * it must be resized to prevent inaccessibility. * @param minWidth * @param minHeight */ public void setShell(Shell shell, boolean onlyPosition, int minWidth, int minHeight) { shell.setMaximized(maximized); shell.setBounds(rectangle); if (minWidth > 0 || minHeight > 0) { Rectangle bounds = shell.getBounds(); if (bounds.width < minWidth) bounds.width = minWidth; if (bounds.height < minHeight) bounds.height = minHeight; shell.setSize(bounds.width, bounds.height); } // Just to double check: what is the preferred size of this dialog? // This computed is a minimum. If the minimum is smaller than the // size of the current shell, we make it larger. // Point computedSize = shell.computeSize(SWT.DEFAULT, SWT.DEFAULT); Rectangle shellSize = shell.getBounds(); if (shellSize.width<computedSize.x) shellSize.width=computedSize.x; if (shellSize.height<computedSize.y) shellSize.height=computedSize.y; shell.setBounds(shellSize); Rectangle entireClientArea = shell.getDisplay().getClientArea(); Rectangle resizedRect = Geometry.copy(shellSize); constrainRectangleToContainer(resizedRect, entireClientArea); // If the persisted size/location doesn't perfectly fit // into the entire client area, the persisted settings // likely were not meant for this configuration of monitors. // Relocate the shell into either the parent monitor or if // there is no parent, the primary monitor then center it. // if (!resizedRect.equals(shellSize) || isClippedByUnalignedMonitors(resizedRect, shell.getDisplay())) { Monitor monitor = shell.getDisplay().getPrimaryMonitor(); if (shell.getParent() != null) { monitor = shell.getParent().getMonitor(); } Rectangle monitorClientArea = monitor.getClientArea(); constrainRectangleToContainer(resizedRect, monitorClientArea); resizedRect.x = monitorClientArea.x + (monitorClientArea.width - resizedRect.width) / 2; resizedRect.y = monitorClientArea.y + (monitorClientArea.height - resizedRect.height) / 2; shell.setBounds(resizedRect); } } /** * @param constrainee * @param container */ private void constrainRectangleToContainer(Rectangle constrainee, Rectangle container) { Point originalSize = Geometry.getSize(constrainee); Point containerSize = Geometry.getSize(container); Point oversize = Geometry.subtract(originalSize, containerSize); if (oversize.x > 0) { constrainee.width = originalSize.x - oversize.x; } if (oversize.y > 0) { constrainee.height = originalSize.y - oversize.y; } // Detect if the dialog was positioned outside the container Geometry.moveInside(constrainee, container); } /** * This method is needed in the case where the display has multiple monitors, but * they do not form a uniform rectangle. In this case, it is possible for Geometry.moveInside() * to not detect that the window is partially or completely clipped. * We check to make sure at least the upper left portion of the rectangle is visible to give the * user the ability to reposition the dialog in this rare case. * @param constrainee * @param display * @return */ private boolean isClippedByUnalignedMonitors(Rectangle constrainee, Display display) { boolean isClipped; Monitor[] monitors = display.getMonitors(); if (monitors.length > 0) { // Loop searches for a monitor proving false isClipped = true; for (Monitor monitor : monitors) { if (monitor.getClientArea().contains(constrainee.x + 10, constrainee.y + 10)) { isClipped = false; break; } } } else { isClipped = false; } return isClipped; } public String getName() { return name; } public void setName(String name) { this.name = name; } public boolean isMaximized() { return maximized; } public void setMaximized(boolean maximized) { this.maximized = maximized; } public Rectangle getRectangle() { return rectangle; } public void setRectangle(Rectangle rectangle) { this.rectangle = rectangle; } public int getX() { return rectangle.x; } public int getY() { return rectangle.y; } public int getWidth() { return rectangle.width; } public int getHeight() { return rectangle.height; } public int hashCode() { return name.hashCode(); } public boolean equal(Object obj) { return ((WindowProperty)obj).getName().equalsIgnoreCase(name); } }
java
<gh_stars>1-10 #![feature(optin_builtin_traits)] #![cfg_attr(test, feature(test))] //! Incomplete protocol interface for [AIRMASH][0]. This crate provides //! a strongly typed interface for communicating with an airmash server. //! Since there can (in the future) be multiple protocol versions, this //! crate must be used with another crate such as [airmash-protocol-v5][1] //! that provides a serialization layer. //! //! # Library Usage //! Once you have gotten an instance of [`Protocol`][2], it can be used to //! serialize and deserialize to and from the wire representation of that //! protocol version. //! //! ``` //! # extern crate airmash_protocol; //! # use airmash_protocol::*; //! # use std::mem; //! # use std::error::Error; //! # // Just some error type that implements Error //! # use std::fmt::Error as FmtError; //! # //! # fn main() -> Result<(), Box<Error>> { //! # // This is required since if this example were to actually run //! # // it would immediately cause undefined behaviour. //! # return Ok(()); //! # // This crate doesn't have any protocol implementations, but we can pretend it does by //! # // not actually being able to make them //! # let protocol_from_elsewhere: Box<Protocol<SerializeError = FmtError, DeserializeError = FmtError>> = unsafe{ mem::uninitialized() }; //! # let bytes_from_elsewhere: Vec<u8> = unsafe{ mem::uninitialized() }; //! let protocol = protocol_from_elsewhere; //! let bytes = bytes_from_elsewhere; //! //! // To deserialize a packet from the server //! let packet: ServerPacket = protocol.deserialize_server(&bytes)?; //! //! // To deserialize a packet from a client //! let packet: ClientPacket = protocol.deserialize_client(&bytes)?; //! # } //! ``` //! //! The [`ProtocolSerializationExt`][3] trait is also provided to allow //! for less typing when doing lots of serialization or deserialization. //! //! [0]: https://airma.sh //! [1]: https://crates.io/crates/airmash-protocol-v5 //! [2]: trait.Protocol.html //! [3]: trait.ProtocolSerializationExt.html #[cfg(test)] extern crate test; #[macro_use] extern crate lazy_static; extern crate fnv; #[macro_use] extern crate dimensioned; #[macro_use] extern crate derive_more; #[macro_use] extern crate enum_primitive_derive; extern crate num_traits; #[cfg(feature = "serde")] #[cfg_attr(feature = "serde", macro_use)] extern crate serde; #[cfg(feature = "specs")] extern crate specs; #[cfg(feature = "specs")] #[cfg_attr(feature = "specs", macro_use)] extern crate specs_derive; #[macro_use] mod detail; mod consts; mod enums; mod packets; mod traits; mod types; mod client_packet; mod server_packet; #[cfg(feature = "serde")] pub mod custom; pub mod error; pub use self::client_packet::*; pub use self::enums::*; pub use self::packets::*; pub use self::server_packet::*; pub use self::traits::*; pub use self::types::*;
rust
<gh_stars>0 © 2021 APrivateUser. All Rights Reserved.
markdown
Pope Francis plunged into the melting pot of New York after reminding the country of its immigrant origins in the first papal speech before Congress on Thursday. Over an intense 40 hours set to start with a sunset evening prayer service at St. Patrick’s Cathedral, he will address world leaders at the United Nations, participate in an interfaith service at the Sept. 11 memorial museum at ground zero and celebrate Mass at Madison Square Garden. Thousands of people lined the streets leading to the recently spruced up cathedral to greet the popular pontiff. They cheered, waved flags and adoringly chanted his name. The pope, who’s making his first trip to the United States, planned to visit a school on Friday and take a processional drive through Central Park. In Washington earlier Thursday, the pope had waded into bitter disputes while speaking to Congress, entreating the nation to share its immense wealth with those less fortunate. He urged Congress and the nation to abolish the death penalty, fight global warming and embrace immigrants. Lawmakers gave rousing ovations to the leader of the world’s Catholics despite obvious disagreements over some of his pleas. After he addressed Congress, the first pontiff to do so, he underscored his message by traveling directly to a downtown Washington church, where he mingled with needy and homeless people, blessed their noontime meal and walked among them while they ate. Soon after, he headed by plane to New York, second stop on his three-city first visit to the US After arriving at John F. Kennedy International Airport in Queens, he boarded a helicopter to Manhattan, where the cathedral is located. The pope addresses the UN on Friday and wraps up his visit this weekend in Philadelphia, where he speaks in front of Independence Hall and celebrates Mass on the Benjamin Franklin Parkway. At the Capitol, the remarkable sight of the pope speaking in the House chamber seemed to delight lawmakers of all persuasions, though he offered an agenda more to Democrats’ liking. Besides his focus on climate change and immigration, he denounced arms sales and seemed to allude approvingly to the Iran nuclear deal and recent actions by President Barack Obama’s administration to open relations with Cuba, done with his urging. Republicans, too, heard something to like in his references to the sanctity of life and family relations, reminders that even the more open Catholic Church over which Francis presides still condemns abortion and gay marriage. For all the spectacle, it seemed unlikely the pope’s visit would break congressional inertia on the issues dear to him, with no action in sight from the Republican majority on global warming or immigration. After the address, Francis appeared high on a Capitol balcony and addressed a cheering crowd of thousands below on the lawn and the Mall beyond who had watched his speech on giant TV screens. “Buenos dias,” he called out in the language of his native Argentina and millions of U. S. immigrants, legal and not. The crowd thundered its response. Francis asked the crowd to pray for him, as he always does. But speaking in Spanish, he added a line to acknowledge that not everyone there was a believer. “If among you there are some who don’t believe or who cannot pray, I ask that you send good wishes my way,” he said, to tumultuous applause. “God bless America! ” he concluded, as he had in the House chamber. After leaving the Capitol, the pope brought encouragement to a much smaller group: a gathering of homeless and needy people at St. Patrick’s Church and Catholic Charities in Washington. He decried a lack of housing for the poor and declared there is “no justification whatsoever” for homelessness. New York was next in his jam-packed tour, which began last weekend in Cuba and included a White House ceremony and Washington parade in his popemobile on Wednesday. Late Thursday, he was to preside over a vespers service at St. Patrick’s Cathedral. On Friday, at the United Nations, he is sure to make many of the points emphasized in Washington — a need for openness to immigrants and for the world to share its riches with the needy. At the Capitol in Washington, the packed House chamber included Supreme Court justices, Cabinet officials and lawmakers of both major political parties, some of whom bowed their heads in deference as Francis walked down the center aisle to approach the dais where presidents deliver their State of the Union speeches. “Mr. Speaker, the pope of the Holy See,” bellowed the sergeant at arms. Behind the pope sat Democratic Vice President Joe Biden and Republican House Speaker John Boehner, the first and second in line to the presidency, both Catholics. His appeal comes amid the worst refugee crisis since World War II: Europe has been overwhelmed by hundreds of thousands of people fleeing war in Syria and Iraq, and there are widespread conflicts and poverty in Africa. In the U. S. , tens of thousands of families and unaccompanied minors from Central America have surged across the southern U. S. border as violence has flared at home. For now, Congress has deadlocked on immigration legislation, and the chances for progress have only grown more remote amid the hardline rhetoric of the U. S. presidential campaign. Republican front-runner Donald Trump has painted Mexican immigrants as criminals and has said he would build a wall along the border and force Mexico to pay for it. Francis has called for a more welcoming attitude toward migrants across the board and has backed that up with a modest welcome of his own: The Vatican recently took in two refugee families and has committed to care for them while they await their asylum applications. On another contentious subject, he advocated abolition of the death penalty in the U. S. , something that enjoys support from a number of lawmakers of both parties at the federal level. He spoke out against fundamentalism of all kinds while urging care in combating it. At the Capitol, his mention of climate change drew standing cheers from Democrats while Republicans stood to applaud the reference to opposing abortion. Republicans in particular also loudly applauded as Francis asserted the importance of family life and bemoaned that “fundamental relationships are being called into question as is the very basis of marriage and the family. ” The Catholic Church opposes gay marriage, recently legalized by the Supreme Court.
english
1/ It seems like the dominant lockdown justification is moving from "We need to bend the curve" (buy time for ICU system to increase capacity) to "We need to save every life". As ideal as it would be to "save every life", the shifting justification is troubling. Here's why: 2/ Americans are now fully aware that there is a circulating virus for which there is no vaccine and no widespread proven treatment. Now that we're aware of the virus, we can price in risk of infection/hospitalization/death to every decision we make. Now that we're aware of the virus, we can price in risk of infection/hospitalization/death to every decision we make. 3/ A higher-risk person should act accordingly. Maybe self-quarantine until there's a vaccine. A lower-risk person should leave home, work, eat out, and keep economy going. But socially distance, wash hands, + take reasonable precautions in case he's an asymptomatic carrier. A lower-risk person should leave home, work, eat out, and keep economy going. But socially distance, wash hands, + take reasonable precautions in case he's an asymptomatic carrier. 4/ If you're a lower-risk person who wants to act like a higher-risk person, fine, self-quarantine. Reduce your chances of getting COVID to as near-zero as possible. You do you. 5/ Having a sense of how at-risk you are, you can price in the risk of Death From Coronavirus the way you price the risk of ***every other decision you make***. 7/ because the people who *they* transmit it to are assuming the risk of getting COVID by going to the store, going to the gym, leaving their apartment, etc. And the people who are interacting with those people are assuming *that* related risk. 8/ Exponential/Multiplicative risk has ZERO to do with this specific issue, bc I am addressing personal risk levels in a scenario where either the curve has been sufficiently bent or the healthcare capacity line has been sufficiently raised. 9/ The early arguments (like 2-4 weeks ago early) for these lockdowns was bc we had to "bend the curve" aka make sure our ICU system isn't overwhelmed. That was a much more compelling argument, from a societal POV, than "We need to save every life." 10/ I know that sounds harsh, but stay with me. There's a base assumption in the US that if you need intensive care, you're going to get it. Any threat to that assumption is societally dangerous. There's a base assumption in the US that if you need intensive care, you're going to get it. Any threat to that assumption is societally dangerous. 11/ because the ICU is overrun, similar situations spread across thousands of hospitals in the US for days or weeks would be a threat, in a sense, to one of our basic assumptions about America: that the ER is there if you need it. 12/ What does the country look like when we can't count on our local ER in an emergency? We don't want to find out. 13/ increasing it where there are shortages, proponents of the lockdown are moving off the "bend the curve" justification and towards the "We need to save every life" justification. But, and here finally is my main point: 14/ That justification has no limiting principle. Bc if we're still locked down not to bend the curve but to "save every life", why should we ever open up? Why should we let people make decisions that increase their risk of injury or death? Why, IOW, assume the risks of freedom?
english
UFC Strawweight Champion, Zhang Weili is currently enjoying her first title reign in the promotion. The Chinese fighter defeated Jessica Andrade at UFC on ESPN+15 via first-round knockout and captured the UFC Strawweight Title in an emphatic victory. In an interview with ESPN's Ariel Helwani, Zhang stated that for her next title defense, the reigning UFC Strawweight Champion is willing to put her title on the line against former champion Rose Namajunas. Having won the UFC Strawweight Championship last year, Zhang Weili marked the first defense of her newly won title at UFC 248 when she defeated former champion Joanna Jedrzejczyk via split decision, in a fight that was widelly-regared as one of the best women's fights' of all time. Weili is now looking forward to her next defense of the UFC Strawweight Championship, as the Chinese fighter told Ariel Helwani that she wants to step into the Octagon against another former champ, in the form of Rose Namajunas. The reigning UFC Strawweight Champion believes that Namajunas is currently the "most-skilled martial artist" in the UFC's Strawweight Division, with the exception of the champion herself. Here is what Zhang Weili said: Could we expect a title fight between Zhang Weili and Rose Namajunas? Zhang Weili could very well end up defending the UFC Strawweight Championship next against Rose Namajunas. The reigning UFC Strawweight Champion last competed in March 2020 and could very well step back into the Octagon by the end of the year once again. As for Namajunas, the former champion was last seen in Octagon action at UFC 237 when she lost the UFC Strawweight Title to Jessica Andrade in Brazil. 'Thug Rose' was set to make her return to the Octagon at UFC 249, as she was scheduled for a rematch against Andrade, however, the former decided to pull-out due to her manager citing a pair of family deaths related to COVID-19.
english
And we’re off: the TC New York Mini Meet-Up is on for tonight, May 8, from 6pm-10pm at Bar 13 on 13th St. and University Pl. It will be a Blastoise. Special thanks to our volunteers and good old Jordan for spearheading the entire operation. A special thank you goes out to our sponsors. And thank you for making this a potential success. You can RSVP on our PlanCast page for the Meet-Up. Remember: don’t give us paper. Give us a small card with your website on it and prepare a 40 second elevator pitch. Also, we are the ones with the free drink tickets so look for folks in TechCrunch T-shirts and/or Jordan, Peter Ha, Chris, Matt Burns, or I. Yext helps provide amazing local search results with PowerListings, a local information hub that syncs listings across a network of premium sites and mobile apps. With Yext PowerListings, small and large businesses can quickly and easily update their business information, photos and specials from one central location. Today, Yext PowerListings syncs information for over 45,000 locations. Traducto is a powerful and easy to use translation and localization app. With Traducto users can leverage human translation to translate documents, emails, newsletters, social postings, marketing materials and more. TraductoPro allows developers to convert iOS or Mac apps, into a multilingual application, making the app available to a wider global audience. By making it simple to localize your application and offering 16 different language translations, TraductoPro is designed to reduce the pain typically associated with localization. Our integrated approach combines automating app localization through direct Xcode integration, with a high quality human translation service all within a single application. TraductoPro offers support for content translations, app store metadata and Xcode projects localization. WhatRunsWhere is a competitive intelligence service for online media buying. It allows you to look up what advertisers are doing online; where they are running ads, who they are buying their inventory through and what exact ads they are using. WhatRunsWhere allows you to see what is happening on any website; who is advertising there, who’s selling the inventory for them and what ads are they using. With data from multiple countries and actionable insights regarding the data, WhatRunsWhere quickly allows anyone to dissect advertising campaigns resulting in reduced risk and a higher ROI media buying process. Parlor® is the creator of unique branded communication applications: GroupCallTM, TopicTalkTM and MobiCastTM. Our goal is to make useful tools to communicate globally, both efficiently and for free. We will be unleashing these three awesome applications on iOS and Android at TechCrunch Disrupt NYC 2012. Follow us at http://Parlor.fm for news and updates. Speak to any business in the world with MyGenieTM, a location-based 2-way communication platform that allows iPhone and Android users to speak to businesses in real-time! It’s free, it’s quick, and it’s simple to use. No need to find a manager, an email address, or a telephone # to contact. With MyGenieTM consumers send questions, comments, complaints, feedback, and more (can also upload photos) directly to any business they choose via their smart phones. Businesses can immediately respond (and include special offers) via a business portal. MyGenieTM, not just ratings, not just feedback, it’s anything and everything you want it to be! Free on Apple App Store and Android Market. Return on Change (RoC) connects innovative startups and investors who are looking to change tomorrow’s world today. Entrepreneurs with great ideas need capital funding to jumpstart their businesses, and investors are looking to help fund the next big idea. RoC provides the online medium through which startup companies and entrepreneurs will be able to pool capital through crowdsourcing. For more information about Return on Change, please visit www.returnonchange.com or contact RoC at RoC@returnonchange.com. PeoplePerHour is Europe’s leading marketplace connecting startups and entrepreneurs to freelance talent worldwide and we’ve just landed in NYC! Project by project we’re awakening an enormous latent workforce, from the stay at home mom and the retiree to the moonlighter and the hobbyist, removing the constraints of the traditional 9-5 office. Be it for a quick logo design, building a website, copywriting or a small translation... we’re helping businesses keep their core lean and to get the job done fast. Our vision is for this to be the defining factor in the future of work. TouchTunes Interactive Networks is the largest interactive out-of-home entertainment network in North America. TouchTunes provides entertainment and marketing solutions to 52,000 bars and restaurants. Founded in 1998, the network has become the largest of its kind with 54M monthly users who played more than 900 million songs in 2011. The TouchTunes mobile app allows consumers in bars, restaurants, hotels, retail and arenas to play any song from our catalog without having to leave their seat and is socially integrated. TouchTunes network is the largest digital out-of-home advertising network in the US (Nielsen) and includes TouchTunesTV, a unique screen-within-a-screen interactive television experience that provides custom advertising capabilities, venue promotions and social networking opportunities. TouchTunes is a privately held U.S. corporation with offices in New York City, Arlington Heights, Illinois and Montreal, Canada. For further information, please visit us at touchtunes.com.
english
<gh_stars>0 --- --- <h2 id="객체지향-프로그래밍-object-oriented">[객체지향 프로그래밍] (Object Oriented)</h2> <h5 id="다형성폴리모피즘-polymorphism"><strong>다형성</strong>(폴리모피즘, Polymorphism)</h5> <p>객체지향 프로그래밍의 특징중 <strong>다형성</strong>(폴리모피즘, Polymorphism)이 있다. 폴리모피즘은 왜 필요한 걸까?<br> 다음같이 Bouncer(경비원)클래스를 만들자 이때, 경비원 클래스는 다음같이 동물을 짖게해 건물을 지킨다</p> <p><em>Bouncer.java</em></p> <pre><code>public class Bouncer { public void barkAnimal(Animal animal) { if (animal instanceof Tiger) { System.out.println("어흥"); } else if (animal instanceof Lion) { System.out.println("으르렁"); } } public static void main(String[] args) { Tiger tiger = new Tiger(); Lion lion = new Lion(); Bouncer bouncer= new Bouncer(); bouncer.barkAnimal(tiger); bouncer.barkAnimal(lion); } } </code></pre> <p>barkAnimal메소드는 입력으로 받은 animal객체가 Tiger인 경우 "어흥"을 출력, Lion인 경우 "으르렁"출력</p> <blockquote> <p>※ <code>instanceof</code> 는 특정객체가 특정클래스의 객체인지를 조사할때 사용되는 자바의 내장키워드<br> <code>animal instanceof Tiger</code>는 “animal객체가 <code>new Tiger</code>로 만들어진 객체인가?” 를 묻는 조건식</p> </blockquote> <p>barkAnimal메소드의 입력자료형은 Tiger,Lion이 아닌 Animal<br> 하지만 barkAnimal메소드를 호출시 tiger,lion객체를 전달할 수 있다. 이게 가능한 이유는 Tiger,Lion클래스가 Animal이란 부모 클래스를 상속한 자식 클래스이기 때문<br> 자식 클래스에의해 만들어진 객체는 언제나 부모 클래스의 자료형으로 사용가능(이전에 공부했던 IS-A 관계)</p> <p>즉, 다음 코딩이 가능</p> <pre><code>Animal tiger = new Tiger(); Animal lion = new Lion(); </code></pre> <p>결과:</p> <pre><code>어흥 으르렁 </code></pre> <p>Crocodile, Leopard등이 추가되면 barkAnimal메소드는 다음처럼 수정되어야 함</p> <pre><code>public void barkAnimal(Animal animal) { if (animal instanceof Tiger) { System.out.println("어흥"); } else if (animal instanceof Lion) { System.out.println("으르렁"); } else if (animal instanceof Crocodile) { System.out.println("쩝쩝"); } else if (animal instanceof Leopard) { System.out.println("캬옹"); } } </code></pre> <p>인터페이스로 더 나은 해법이 있다<br> 다음처럼 Barkable이란 인터페이스를 작성</p> <p><em>Barkable.java</em></p> <pre><code>public interface Barkable { public void bark(); } </code></pre> <p>그리고 Tiger클래스, Lion클래스가 Barkable인터페이스를 구현하도록 변경</p> <p><em>Tiger.java</em></p> <pre><code>public class Tiger extends Animal implements Predator, Barkable { public String getFood() { return "apple"; } public void bark() { System.out.println("어흥"); } } </code></pre> <p>인터페이스는 위와같이 콤마(,)로 여러개를 implements할 수 있다. Tiger클래스는 Predator인터페이스와 Barkable인터페이스를 implements</p> <p>Tiger클래스는 bark메소드 실행시 “어흥” 출력<br> <em>Lion.java</em></p> <pre><code>public class Lion extends Animal implements Predator, Barkable { public String getFood() { return "banana"; } public void bark() { System.out.println("으르렁"); } } </code></pre> <p>Lion클래스는 bark 메소드 실행시 “으르렁” 출력<br> 이렇게 Tiger, Lion클래스에 bark메소드를 구현하면 Bouncer클래스의 barkAnimal메소드를 다음처럼 수정</p> <p><em>바뀌기 전</em></p> <pre><code>public void barkAnimal(Animal animal) { if (animal instanceof Tiger) { System.out.println("어흥"); } else if (animal instanceof Lion) { System.out.println("으르렁"); } } </code></pre> <p><em>바뀐 후</em></p> <pre><code>public void barkAnimal(Barkable animal) { animal.bark(); } </code></pre> <p>barkAnimal메소드의 입력자료형이 Animal에서 Barkable로 변경 그리고 animal의 객체타입을 체크해 “어흥” 또는 "으르렁"을 출력하던 부분이을 그냥bark 메소드를 호출하도록 변경. 이렇게 변경했더니 복잡한 조건문도 사라지고 누가봐도 명확한 코드가 됨</p> <blockquote> <p>※ 폴리모피즘을 이용하면 위예에서 보듯 복잡한 if else의 조건문을 간단하게 처리할 수 있는 경우가 많다.</p> </blockquote> <p>위예제에서 사용한 tiger, lion객체는 각각 Tiger, Lion클래스의 객체이면서 Animal클래스의 객체이기도 하고 Barkable, Predator 인터페이스의 객체이기도 하다. 이런이유로 barkAnimal메소드의 입력자료형을 Animal에서 Barkable로 바꾸어 사용할 수 있다</p> <p>이렇게 하나의 객체가 여러개의 자료형 타입을 가질수 있는 것을 객체지향에서 <strong>다형성, 폴리모피즘(Polymorphism)</strong><br> 즉 Tiger클래스의 객체는 다음같이 여러자료형으로 표현</p> <pre><code>Tiger tiger = new Tiger(); Animal animal = new Tiger(); Predator predator = new Tiger(); Barkable barkable = new Tiger(); </code></pre> <p>Predator로 선언된 predator객체와 Barkable로 선언된 barkable 객체는 사용할 수 있는 메소드가 서로 다르다<br> predator객체는 <code>getFood()</code>메소드가 선언된 Predator인터페이스의 객체이므로 getFood메소드만 호출가능. 이와마찬가지로 Barkable로 선언된 barkable객체는 bark메소드만 호출가능</p> <p>만약 getFood메소드와 bark메소드를 모두 사용하고 싶다면?<br> Predator, Barkable인터페이스를 구현한 Tiger로 선언된 tiger객체를 사용하거나 다음같이 getFood, bark메소드를 모두 포함하는 새인터페이스를 새로 만들어 사용</p> <p><em>BarkablePredator.java</em></p> <pre><code>public interface BarkablePredator { public void bark(); public String getFood(); } </code></pre> <p>또는</p> <pre><code>public interface BarkablePredator extends Predator, Barkable { } </code></pre> <p>두번째 방법은 기존 인터페이스를 활용하는 방법. 두번째 방법대로면 Predator의 getFood메소드, Barkable의 bark메소드를 그대로 상속받을 수 있다</p> <p>인터페이스는 일반클래스와는 달리 <strong>extends</strong>를 이용해 여러러 인터페이스(Predator, Barkable)를 동시 상속가능<br> 즉, 다중상속 지원(※ 일반클래스는 단일상속만 가능)</p> <p>Lion 클래스를 위에서 작성한 BarkablePredator인터페이스를 구현하도록 수정</p> <p><em>Lion.java</em></p> <pre><code>public class Lion extends Animal implements BarkablePredator { public String getFood() { return "banana"; } public void bark() { System.out.println("으르렁"); } } </code></pre> <p>이렇게 Lion클래스를 수정후 Bouncer클래스를 실행해도 역시 다음같이 동일한 결과값 출력</p> <pre><code>어흥 으르렁 </code></pre> <p>Bouncer클래스의 barkAnimal메소드의 입력자료형이 Barkable이더라도 BarkablePredator를 구현한 lion객체 전달가능<br> 이유는 BarkablePredator는 Barkable인터페이스를 상속받은 자식 인터페이스이기 때문. 자식 인터페이스로 생성한 객체의 자료형은 부모 인터페이스로 사용하는 것이 가능(자식 클래스의 객체 자료형을 부모 클래스의 자료형으로 사용가능하다는 점과 동일)</p> <p>다음은 최종적으로 완성된 Barkable, BarkablePredator인터페이스와 Tiger, Lion, Bouncer클래스</p> <p><em>Barkable.java</em></p> <pre><code>public interface Barkable { public void bark(); } </code></pre> <p><em>BarkablePredator.java</em></p> <pre><code>public interface BarkablePredator extends Barkable, Predator { } </code></pre> <p><em>Tiger.java</em></p> <pre><code>public class Tiger extends Animal implements Predator, Barkable { public String getFood() { return "apple"; } public void bark() { System.out.println("어흥"); } } </code></pre> <p><em>Lion.java</em></p> <pre><code>public class Lion extends Animal implements BarkablePredator { public String getFood() { return "banana"; } public void bark() { System.out.println("으르렁"); } } </code></pre> <p><em>Bouncer.java</em></p> <pre><code>public class Bouncer { public void barkAnimal(Barkable animal) { animal.bark(); } public static void main(String[] args) { Tiger tiger = new Tiger(); Lion lion = new Lion(); Bouncer bouncer= new Bouncer(); bouncer.barkAnimal(tiger); bouncer.barkAnimal(lion); } } </code></pre>
markdown
<gh_stars>1-10 --- title: Birlikte dışarı Excel ms.author: pebaum author: pebaum manager: scotv ms.audience: Admin ms.topic: article ms.service: o365-administration ROBOTS: NOINDEX, NOFOLLOW localization_priority: Normal ms.collection: Adm_O365 ms.custom: - "9006404" - "13986" ms.openlocfilehash: 8443329f0a417d432c5a718e57d7eb178b52b325 ms.sourcegitcommit: a097d1f8915a31ed8460b5b68dccc8d87e563cc0 ms.translationtype: MT ms.contentlocale: tr-TR ms.lasthandoff: 09/22/2021 ms.locfileid: "59506904" --- # <a name="exporting-with-excel"></a>Birlikte dışarı Excel Bu seçenekte **Yer Alan Excel** seçeneğini Microsoft Office SharePoint Online, zaman zaman sorun oluşabilir. Sorun giderme bilgileri için [bkz. Excel Online'dan SharePoint.](https://docs.microsoft.com/office/troubleshoot/excel/cannot-export-to-excel)
markdown
<reponame>fahimfarhan/cancer-web-app<gh_stars>0 from django import forms from presentingfeatures.models import Status, Investigation class StatusForm(forms.ModelForm): class Meta: model = Status fields = ('details', 'advice') class UploadForm(forms.ModelForm): type_choice = [ ('Others', 'Others'), ('Marker', 'Marker'), ('X-ray', 'X-ray'), ('USG', 'USG'), ('CT-Scan', 'CT-Scan'), ('MRI', 'MRI'), ('MRS', 'MRS'), ('PET', 'PET'), ('Echo', 'Echo'), ('CBC', 'CBC'), ('RBS', 'RBS'), ('LFT', 'LFT'), ('KFT', 'KFT'), ('Serum-Electrolytes', 'Serum-Electrolytes'), ] type = forms.ChoiceField(widget=forms.Select, choices=type_choice) class Meta: model = Investigation fields = ('type', 'file',)
python
<gh_stars>100-1000 { "name": "Manubot", "author": "<NAME>", "license": "CC0", "raster": "http://hexb.in/hexagons/manubot.png", "vector": "http://hexb.in/vector/manubot.svg", "description": "Manubot is a workflow and set of tools for the next generation of scholarly publishing." }
json
<reponame>edwmrkg/PracticalTest02<gh_stars>0 package ro.pub.cs.systems.eim.practicaltest02; import android.util.Log; import android.widget.EditText; import android.widget.TextView; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.net.InetAddress; import java.net.Socket; import java.net.UnknownHostException; public class ClientThread extends Thread { private Socket socket; private int port; private String currency; private TextView rateTextView; public ClientThread(int port, String currency, TextView rateTextView) { this.port = port; this.currency = currency; this.rateTextView = rateTextView; } @Override public void run() { try { socket = new Socket(InetAddress.getLocalHost(), port); if (socket == null) return; BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(socket.getInputStream())); PrintWriter printWriter = new PrintWriter(socket.getOutputStream(), true); printWriter.println(currency); String info; while ((info = bufferedReader.readLine()) != null) { Log.d("[CLIENT]", info); final String infoFinal = info; rateTextView.post(new Runnable() { @Override public void run() { rateTextView.setText(infoFinal); } }); } } catch (UnknownHostException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } finally { try { socket.close(); } catch (IOException e) { e.printStackTrace(); } } } }
java
<reponame>garvit1608/us-data-json {"geometry": {"type": "Point", "coordinates": [-97.32, 39.17]}, "type": "Feature", "id": "67458", "properties": {"other_cities": "", "city": "Longford", "state": "KS", "county": "Clay County"}}
json
<filename>test/data/stages/systemd.unit/diff.json { "added_files": [ "/usr/lib/systemd/system/nm-cloud-setup.service.d", "/usr/lib/systemd/system/nm-cloud-setup.service.d/10-rh-enable-for-ec2.conf" ], "deleted_files": [], "differences": {} }
json
IranianTruth informs us about a short video on “transsexuality in Iran” authored by Yasmin Vossoughian & Kouross Esmaeli. Egypt-based blogger Maryanne Stroud Gabbani started blogging in 2003 at the age of 54, after becoming frustrated with trying to answer people individually regarding how it was that she was so happy living in a place that the news said was so opposed to "western women". She figured that hopefully a blog would reach more people and give Egypt a human face and has never looked back since. A 1,000 women in swimsuits? Fonzy, a Lebanese blogger living in Kuwait, wishes the record would be broken over and over again. Bahraini blogger Ammaro gives us an insight into shopping — from a man's perspective. The beatroot and Dr. Sean's Diary write about the Women's Party of Poland. Bahraini blogger Mahmood Al Yousif reports about two girls in Khobar, Saudi Arabia, who sprayed the notorious religious police with pepper spray. Beauty is skin deep. Not so, argues Nouri the Moor from Algeria in this post, where he discusses the obsession of darker toned women with skin lightening cream. Scraps of Moscow links to resources on trafficking in women in Moldova. Copydude writes about what may pass as Soviet roadside art, and about a misadventure with a Russian woman in Kaliningrad. IMHO. bm thinks that fixing the problems with Bermuda's youth requires a return to family values. Mahmud Ahmadinejad,Iranian president,said,in Columbia University,”we do not have homosexuals in Iran like you do in your country. ”Watch the film. A group of Saudi women are campaigning for the right to drive in the only country in the world which bans women from driving, reports The Arabist. Israellycool reports the split between Jane Felix-Browne, the 51-year-old, six-times-married grandmother who fell in love with the 27-year-old son of Osama bin Laden. Mohmmad Masih in his blog, Sineh Sorkh, writes [Fa]that several Iranian feminists have recently left country. The blogger says that these women activists have found a place to stay in UK,Netherlands and USA. The blogger adds that Iranian feminist movement is disappearing. The Zambian blogsphere is growing. Two years ago one would struggle to find a regularly updated blog covering any meaningful issues. I am happy to report that is now changing. New blogs are being created at pace faster than I can count. And the good news is that what were personal entries are now being transformed into meaningful blogs that seek to encourage dialogue and trading of ideas. Egyptian blogger Mosfata Hussein introduces us to TV presenter Booby Julia. “As a blogger, a doctor and an Egyptian citizen. It is my duty to bring forward the latest socio-cultural phenomena happening in my environment. I would like to introduce to you BOOBY JULIA! ” he explains. Ultra Violet on sexual harassment in the workplace in India and on corporate reactions. ‘To my sweet and lovely wife: “Love” is but a fraction of the feelings I have for you. Thank you for making my life as beautiful and complete as it is today,’ writes Subzero Blue from Tunisia, in a post dedicated to his wife on their fifth wedding anniversary. Natalia Antonova writes about Ukrainian prostitutes and Ukrainian feminism.
english
const { cwd, chdir, makeTempDir, mkdir, open, platform, remove, symlink } = Deno; import { FileInfo } from "deno"; import { walk, walkSync, WalkOptions } from "./walk.ts"; import { test, assert, TestFunction } from "../testing/mod.ts"; const isWindows = platform.os === "win"; export async function testWalk( setup: (string) => void | Promise<void>, t: TestFunction ): Promise<void> { const name = t.name; async function fn() { const orig_cwd = cwd(); const d = await makeTempDir(); chdir(d); try { await setup(d); await t(); } finally { chdir(orig_cwd); remove(d, { recursive: true }); } } test({ name, fn }); } async function walkArray( dirname: string = ".", options: WalkOptions = {} ): Promise<Array<string>> { const arr: string[] = []; for await (const f of walk(dirname, { ...options })) { arr.push(f.path.replace(/\\/g, "/")); } arr.sort(); const arr_sync = Array.from(walkSync(dirname, options), (f: FileInfo) => f.path.replace(/\\/g, "/") ).sort(); assert.equal(arr, arr_sync); return arr; } async function touch(path: string): Promise<void> { await open(path, "w"); } function assertReady(expectedLength: number) { const arr = Array.from(walkSync(), (f: FileInfo) => f.path); assert.equal(arr.length, expectedLength); } testWalk( async (d: string) => { await mkdir(d + "/empty"); }, async function emptyDir() { const arr = await walkArray(); assert.equal(arr.length, 0); } ); testWalk( async (d: string) => { await touch(d + "/x"); }, async function singleFile() { const arr = await walkArray(); assert.equal(arr.length, 1); assert.equal(arr[0], "./x"); } ); testWalk( async (d: string) => { await touch(d + "/x"); }, async function iteratable() { let count = 0; for (const f of walkSync()) { count += 1; } assert.equal(count, 1); for await (const f of walk()) { count += 1; } assert.equal(count, 2); } ); testWalk( async (d: string) => { await mkdir(d + "/a"); await touch(d + "/a/x"); }, async function nestedSingleFile() { const arr = await walkArray(); assert.equal(arr.length, 1); assert.equal(arr[0], "./a/x"); } ); testWalk( async (d: string) => { await mkdir(d + "/a/b/c/d", true); await touch(d + "/a/b/c/d/x"); }, async function depth() { assertReady(1); const arr_3 = await walkArray(".", { maxDepth: 3 }); assert.equal(arr_3.length, 0); const arr_5 = await walkArray(".", { maxDepth: 5 }); assert.equal(arr_5.length, 1); assert.equal(arr_5[0], "./a/b/c/d/x"); } ); testWalk( async (d: string) => { await touch(d + "/x.ts"); await touch(d + "/y.rs"); }, async function ext() { assertReady(2); const arr = await walkArray(".", { exts: [".ts"] }); assert.equal(arr.length, 1); assert.equal(arr[0], "./x.ts"); } ); testWalk( async (d: string) => { await touch(d + "/x.ts"); await touch(d + "/y.rs"); await touch(d + "/z.py"); }, async function extAny() { assertReady(3); const arr = await walkArray(".", { exts: [".rs", ".ts"] }); assert.equal(arr.length, 2); assert.equal(arr[0], "./x.ts"); assert.equal(arr[1], "./y.rs"); } ); testWalk( async (d: string) => { await touch(d + "/x"); await touch(d + "/y"); }, async function match() { assertReady(2); const arr = await walkArray(".", { match: [/x/] }); assert.equal(arr.length, 1); assert.equal(arr[0], "./x"); } ); testWalk( async (d: string) => { await touch(d + "/x"); await touch(d + "/y"); await touch(d + "/z"); }, async function matchAny() { assertReady(3); const arr = await walkArray(".", { match: [/x/, /y/] }); assert.equal(arr.length, 2); assert.equal(arr[0], "./x"); assert.equal(arr[1], "./y"); } ); testWalk( async (d: string) => { await touch(d + "/x"); await touch(d + "/y"); }, async function skip() { assertReady(2); const arr = await walkArray(".", { skip: [/x/] }); assert.equal(arr.length, 1); assert.equal(arr[0], "./y"); } ); testWalk( async (d: string) => { await touch(d + "/x"); await touch(d + "/y"); await touch(d + "/z"); }, async function skipAny() { assertReady(3); const arr = await walkArray(".", { skip: [/x/, /y/] }); assert.equal(arr.length, 1); assert.equal(arr[0], "./z"); } ); testWalk( async (d: string) => { await mkdir(d + "/a"); await mkdir(d + "/b"); await touch(d + "/a/x"); await touch(d + "/a/y"); await touch(d + "/b/z"); }, async function subDir() { assertReady(3); const arr = await walkArray("b"); assert.equal(arr.length, 1); assert.equal(arr[0], "b/z"); } ); testWalk(async (d: string) => {}, async function onError() { assertReady(0); const ignored = await walkArray("missing"); assert.equal(ignored.length, 0); let errors = 0; const arr = await walkArray("missing", { onError: e => (errors += 1) }); // It's 2 since walkArray iterates over both sync and async. assert.equal(errors, 2); }); testWalk( async (d: string) => { await mkdir(d + "/a"); await mkdir(d + "/b"); await touch(d + "/a/x"); await touch(d + "/a/y"); await touch(d + "/b/z"); try { await symlink(d + "/b", d + "/a/bb"); } catch (err) { assert(isWindows); assert(err.message, "Not implemented"); } }, async function symlink() { // symlink is not yet implemented on Windows. if (isWindows) { return; } assertReady(3); const files = await walkArray("a"); assert.equal(files.length, 2); assert(!files.includes("a/bb/z")); const arr = await walkArray("a", { followSymlinks: true }); assert.equal(arr.length, 3); assert(arr.some(f => f.endsWith("/b/z"))); } );
typescript
A detailed breakdown of the Moto G8 Plus and the Xiaomi Mi A3 to help you choose the right one. A detailed breakdown of the Moto G8 Plus and the Xiaomi Mi A3 to help you choose the right one. ASUS ROG Phone 2 gaming accessories are now finally on sale in India via Flipkart. Vivo has launched a new gaming phone in China, the iQOO Neo 855, which has support for 33W fast charging. Honor president has confirmed that the Honor V30 series will launch in November. Realme X2 Pro has been made official in China with Snapdragon 855 Plus, a 90Hz display and 50W fast charging. The Red Magic 3S by Nubia is now confirmed to launch in India on October 17 and will be the company’s flagship smartphone offering in the country. OPPO's latest flagship has been launched in China and expected to arrive soon in India. We compare the recently unveiled OnePlus 7T Pro with the Apple iPhone 11 to find out which one is better. OnePlus is expected to unveil the OnePlus 7T Pro – an improved version of the OnePlus 7 Pro from earlier this year, but don't expect to see major changes. An apparent leak of the Honor V30 suggests that the phone will sport a dual punch-hole camera setup. Instagram is testing a dark mode that not only works on Android 10, but on some of previous versions too. ASUS has finally unveiled the ASUS ROG Phone 2 in India. Starting at INR 37,999 the phone will compete with phones like the OnePlus 7 and the Nubia Red Magic 3.
english
Giant-killer Isha Lakhani failed to cross the final hurdle when she went down tamely to eighth seed Akgul Amanmuradova of Uzbekistan 2-6, 3-6 in the women's singles final of the $25,000 NSCI-ITF women's tennis tournament in Mumbai on Saturday. Lakhani, who had accounted for top seed Shiho Hisamatsu of Japan and seventh seed Sania Mirza of India in the earlier rounds, could not produce the form she had shown earlier in the week and lost in sixty-seven minutes. The Indian, who was playing her first big final in front of home crowd, seemed nervous at the start of the match and could not get her act together against a much faster and fitter opponent. Lakhani lost her serve in the second, fourth and eighth games of the first set to lose 2-6. Her serve, which had stood out in earlier matches, went to pieces with the Indian serving as many as five double faults. It was not any better in the second set as Lakhani struggled with her serve. Amanmuradova took full advantage of this and with two crucial breaks in the fourth and eighth games wrapped the match at 6-3. With this win, Amanmuradova was richer by USD 3,000 and 25 ITF points while the Indian had to be content with just USD 1,700 and 17 ITF points.The second seeded Indian pair of Rushmi Chakravarthi and Sai Jayalaxmi lost in the doubles final to top seeds Gabriala Navratilova and Hana Sromova of Czech Republic 1-6, 1-6 in just 40 minutes.
english
<filename>src/repository/user-file.repository.ts import {BaseRepository} from "./base.repository"; import {Inject, Injectable} from "@nestjs/common"; import {Db} from "mongodb"; import {UserFile} from "../domain/user-file.domain"; @Injectable() export class UserFileRepository extends BaseRepository { constructor(@Inject("TINY_DB") database: Db) { super(database); } collectionName(): string { return "user_file"; } async insert(userFile: UserFile): Promise<void> { const document = this.toDocument(userFile); await this.getCollection().insertOne(document); } private toDocument(userFile: UserFile) { return { user_id: userFile.userId, file_type: userFile.fileType, file_path: userFile.filePath, } } }
typescript
<reponame>uk-gov-mirror/ONSdigital.babbage<gh_stars>0 {"description":{"summary":"","keywords":[],"metaDescription":"","title":"Surveys"},"markdown":["###Taking part in a survey?\n\n**Social surveys**\n\nGeneral information about ONS social surveys and the A to Z of social surveys have further details about social surveys. You can also call the freephone Survey Enquiry Line:\n\n\nTel: + 44 (0) 800 298 5313 \n\n(Minicom users should dial 18001 before this number) \n\nOpen 9am to 9pm Monday to Thursday \n9am to 8pm Friday \n9am to 1pm on Saturday\n\n**Business surveys**\n\nGeneral information about ONS business surveys and the A-Z of business surveys have further details about business surveys.\n\nEmail: <EMAIL>\n\nPlease include a contact telephone number, in case we need to clarify your enquiry.\n\nDo not use this email address to provide data. We are unable to guarantee the confidentiality of all data sent to us by email. Please return data by using the fax number on the front of the survey, or by post to: \n\nOffice for National Statistics, Room A012, Government Buildings. Cardiff Road, Newport, South Wales, NP10 8XG. \n"],"type":"static_page","uri":"/about/surveys","breadcrumb":[{"uri":"/"},{"uri":"/about"}],"links":[],"fileName":"surveys"}
json
<reponame>suarezd/blog.eleven-labs.com --- layout: post title: generator-gulp-angular 1.0.0 stable released lang: fr permalink: /fr/generator-gulp-angular-1-0-0-stable-released/ authors: - mehdy date: '2015-10-16 11:07:54 +0200' date_gmt: '2015-10-16 09:07:54 +0200' categories: - Javascript tags: - AngularJS - Yeoman - Gulp --- Intro ===== It has now been more than a year since I ([@Swiip](https://twitter.com/Swiip)), quickly followed by [@zckrs](https://twitter.com/Zckrs), started working on our Yeoman generator. Today we’re celebrating the release of our first major and stable version : [generator-gulp-angular 1.0.0](https://www.npmjs.com/package/generator-gulp-angular){:rel="nofollow noreferrer"}. At first we simply wanted to make a good merge of [generator-gulp-webapp](https://github.com/yeoman/generator-gulp-webapp) and [generator-angular](https://github.com/yeoman/generator-angular){:rel="nofollow noreferrer"} as I worked on Angular and got tired of Grunt's verbosity. Then, the project popularity started to increase and so did its ambition. Philosophy ========== We followed all the precepts of Yeoman adding our own: - Provide a well written seed project following the best recommendations in terms of folder structure and code style. - Offer lots of options to enable the user to start instantly with the best tooling and optimization adapted to the latest technologies. - Use the concept of automatic injection in different parts of the project: scripts tags both vendor and sources in the index.html, styles files, vendor, css or preprocessed. - Provide a test coverage, as perfect as possible, of the code of the generator but also of the generated code. Technologies supported ====================== We are not joking around when we talk about this being a stable version. We integrated lots of technologies and languages, from Coffee to Typescript, from Sass to Stylus. The amount of combinations exceeds several millions! We wrote tests, documentation and fixed issues for 12 minor versions and 2 release candidates, to be able to deliver a perfectly configured seed project, no matter the options you choose. ![technologies-gga](/assets/2015-10-16-generator-gulp-angular-1-0-0-stable-released/generator-gulp-angular-logo.png) Optimization served =================== We integrated many optimizations for your web application using some Gulp plugins : - *browserSync*: full-featured development web server with livereload and devices sync - *ngAnnotate*: convert simple injection to complete syntax to be minification proof - *angular-templatecache*: all HTML partials will be converted to JS to be bundled in the application - *ESLint*: The pluggable linting utility for JavaScript - *watch*: watch your source files and recompile them automatically - *useref*: allow configuration of your files in comments of your HTML file - *uglify*: optimize all your JavaScript - *clean-css*: optimize all your CSS - *rev*: add a hash in the file names to prevent browser cache problems - *karma*: out of the box unit test configuration with karma - *protractor*: out of the box e2e test configuration with protractor 2.0.0 on the road... ==================== But the v1 is not the end of the road. While maintaining the v1 branch, we started a new Github organization called [FountainJS](https://github.com/FountainJS){:rel="nofollow noreferrer"} targeting a futuristic v2 version. As the context of the build tools has greatly evolved over a year, it will be a reboot of the code base. The major selling point will be to use Yeoman's generators composition, to upgrade to Gulp 4 and to write it in ES6. Finally, I hope to open new horizons in terms of options: dependency management for sure, but also, why not Web frameworks (someone talked about React?) and also a backend. Go try out [generator-gulp-angular](https://www.npmjs.com/package/generator-gulp-angular) v1.0.0 release! Any feedbacks, issues, or investment on the new [FountainJS](https://github.com/FountainJS) project will always be appreciated. [generator-gulp-angular-logo](https://www.npmjs.com/package/generator-gulp-angular){:rel="nofollow noreferrer"}
markdown
<gh_stars>1-10 {"status":"OK","responseTime":15,"message":[],"Results":{"county":[{"geographyType":"COUNTY2000","stateFips":"02","fips":"02090","name":"Fairbanks North Star"},{"geographyType":"COUNTY2000","stateFips":"51","fips":"51600","name":"Fairfax"},{"geographyType":"COUNTY2000","stateFips":"09","fips":"09001","name":"Fairfield"},{"geographyType":"COUNTY2000","stateFips":"51","fips":"51059","name":"Fairfax"},{"geographyType":"COUNTY2000","stateFips":"45","fips":"45039","name":"Fairfield"},{"geographyType":"COUNTY2000","stateFips":"39","fips":"39045","name":"Fairfield"}]}}
json
{ "id": 20851, "title": [ "[Rasulis' Room]" ], "description": [ "The vaulted dark mahogany ceiling of this room rises above black marble walls and a thick black carpet, framing a large fireplace by the north wall and bookshelves upon the south. Several comfortable leather armchairs rest before the fire, facing a portrait hung above the mantel, while a large four-poster bed rests nearby. The glaes windows are shielded by long velvet curtains, providing privacy for the occupants." ], "paths": [ "Obvious exits: none" ], "location": "Wehnimer's Landing", "wayto": { "20849": "go doors" }, "timeto": { "20849": 0.2 } }
json
''' Copyright (c) 2014, <NAME> All rights reserved. https://github.com/agoragames/pluto/blob/master/LICENSE.txt '''
python
--- layout: default title: Recommendations permalink: /recommendations --- <div class="chart-placeholder"> <h3>Tokenless Authentication Requests</h3> <canvas data-url="{{ site.dataURL }}/tokenless-authentication.tsv" data-type="history" ></canvas> <div class="info-box"> <p> If your GitHub Enterprise appliance is configured to use <a href="https://help.github.com/enterprise/2.11/admin/guides/user-management/using-ldap/">LDAP authentication</a>, then every request against GitHub requires an additional request against LDAP. </p> <p> At best, this delays GitHub requests because GitHub needs to wait for the LDAP requests first. At worst, GitHub requests will fail if the LDAP requests fail (for instance, because the LDAP server is overloaded with requests). </p> </div> <div class="info-box"> <p> To avoid these problems, users should use <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access tokens (via HTTPS)</a> or <a href="https://help.github.com/articles/connecting-to-github-with-ssh/">SSH keys</a> to authenticate. GitHub will check those without additional requests. </p> </div> </div> <div class="chart-placeholder"> <table data-url="{{ site.dataURL }}/tokenless-authentication-detailed.tsv"></table> </div>
html
Video game developer Epic Games has added new for-kids accounts in 'Fortnite', 'Rocket League' and 'Fall Guys' games. 'Cabined Accounts' will provide a personalised experience that is safe and inclusive for younger players, the developer said in a blogpost on Wednesday. "We believe that creating a rich experience within the same overall game or product is the best way to empower younger players to meaningfully participate without compromising on safety or privacy," it said. While signing in, all players will be required to enter their date of birth. If someone indicates they are under 13 or their country's age of digital consent, then their account will be considered a "Cabined Account" and they will be asked to enter a parent or guardian's email address to start the parental consent procedure. The parent or guardian of the player will get an email informing them about their child's Epic account. Explained: What is e-EPIC, who is eligible and how can you download it? Parents can examine information about Epic's privacy policies, provide permission for extra features, set up parental controls, and verify their adult status via SuperAwesome's Kids Web Services by following the links in the email. Since Cabined Accounts are built on Epic Account Services, it will also apply to younger gamers and developers that use the Epic Games Launcher. While waiting for parental approval, younger players or developers using the Launcher can browse and access their library but cannot purchase new games or use specific Unreal Engine features. (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
#!/usr/bin/env python3 # Copyright (c) 2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test logic for setting nMinimumChainWork on command line. Nodes don't consider themselves out of "initial block download" until their active chain has more work than nMinimumChainWork. Nodes don't download blocks from a peer unless the peer's best known block has more work than nMinimumChainWork. While in initial block download, nodes won't relay blocks to their peers, so test that this parameter functions as intended by verifying that block relay only succeeds past a given node once its nMinimumChainWork has been exceeded. """ import time from test_framework.test_framework import BitcoinTestFramework from test_framework.util import assert_equal, connect_nodes # 2 hashes required per regtest block (with no difficulty adjustment) REGTEST_WORK_PER_BLOCK = 2 class MinimumChainWorkTest(BitcoinTestFramework): def set_test_params(self): self.setup_clean_chain = True self.num_nodes = 3 self.extra_args = [[], ["-minimumchainwork=0x65"], ["-minimumchainwork=0x65"]] self.node_min_work = [0, 101, 101] def setup_network(self): # This test relies on the chain setup being: # node0 <- node1 <- node2 # Before leaving IBD, nodes prefer to download blocks from outbound # peers, so ensure that we're mining on an outbound peer and testing # block relay to inbound peers. self.setup_nodes() for i in range(self.num_nodes-1): connect_nodes(self.nodes[i+1], self.nodes[i]) def run_test(self): # Start building a chain on node0. node2 shouldn't be able to sync until node1's # minchainwork is exceeded starting_chain_work = REGTEST_WORK_PER_BLOCK # Genesis block's work self.log.info( "Testing relay across node {} (minChainWork = {})".format( 1, self.node_min_work[1])) starting_blockcount = self.nodes[2].getblockcount() num_blocks_to_generate = int( (self.node_min_work[1] - starting_chain_work) / REGTEST_WORK_PER_BLOCK) self.log.info("Generating {} blocks on node0".format( num_blocks_to_generate)) hashes = self.nodes[0].generate(num_blocks_to_generate) self.log.info("Node0 current chain work: {}".format( self.nodes[0].getblockheader(hashes[-1])['chainwork'])) # Sleep a few seconds and verify that node2 didn't get any new blocks # or headers. We sleep, rather than sync_blocks(node0, node1) because # it's reasonable either way for node1 to get the blocks, or not get # them (since they're below node1's minchainwork). time.sleep(3) self.log.info("Verifying node 2 has no more blocks than before") self.log.info("Blockcounts: {}".format( [n.getblockcount() for n in self.nodes])) # Node2 shouldn't have any new headers yet, because node1 should not # have relayed anything. assert_equal(len(self.nodes[2].getchaintips()), 1) assert_equal(self.nodes[2].getchaintips()[0]['height'], 0) assert self.nodes[1].getbestblockhash( ) != self.nodes[0].getbestblockhash() assert_equal(self.nodes[2].getblockcount(), starting_blockcount) self.log.info("Generating one more block") self.nodes[0].generate(1) self.log.info("Verifying nodes are all synced") # Because nodes in regtest are all manual connections (eg using # addnode), node1 should not have disconnected node0. If not for that, # we'd expect node1 to have disconnected node0 for serving an # insufficient work chain, in which case we'd need to reconnect them to # continue the test. self.sync_all() self.log.info("Blockcounts: {}".format( [n.getblockcount() for n in self.nodes])) if __name__ == '__main__': MinimumChainWorkTest().main()
python
import gulp from "gulp"; import chalk from "chalk"; import { GitHandler, NpmHandler } from "organon"; import "./test"; import "./lint"; import "./dist-clean"; import "./doc"; import "./dist-test"; import "./todo"; import "./types"; const sanityCheck = async () => { try { const cwd = process.cwd(); const git = new GitHandler(cwd); const npm = new NpmHandler(cwd); await Promise.all([ git.outputReport("git-report/report.json"), npm.outputReport("npm-report/report.json"), ]); const warnMessages = [ chalk.red("The following warnings were encountered during sanity check:"), ].concat(git.getErrorMessages(), npm.getErrorMessages()); if (warnMessages.length > 1) { console.warn(warnMessages.join("\n - ")); } } catch (e) { console.error(e); } }; gulp.task("sanity-check", sanityCheck); gulp.task( "prepublish", gulp.series( "test", gulp.parallel("lint", "dist-clean", "doc"), "dist-test", gulp.parallel("types", "todo", "sanity-check") ) );
typescript
<reponame>iweinzierl/movie-database-backend<filename>src/main/java/com/github/iweinzierl/moviedatabase/backend/controller/LentMovieInfoController.java package com.github.iweinzierl.moviedatabase.backend.controller; import com.github.iweinzierl.moviedatabase.backend.domain.LentMovieInfo; import com.github.iweinzierl.moviedatabase.backend.domain.Movie; import com.github.iweinzierl.moviedatabase.backend.persistence.LentMovieInfoRepository; import com.github.iweinzierl.moviedatabase.backend.persistence.MovieRepository; import com.google.common.base.Strings; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import java.time.LocalDate; import java.util.List; @RestController public class LentMovieInfoController { private static final Logger LOG = LoggerFactory.getLogger(LentMovieInfoController.class); @Autowired private LentMovieInfoRepository repository; @Autowired private MovieRepository movieRepository; @RequestMapping(path = "/api/lent", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity<List<LentMovieInfo>> list() { final List<LentMovieInfo> allLentMovies = repository.findAll(); if (allLentMovies == null || allLentMovies.isEmpty()) { LOG.info("No lent movies found."); return new ResponseEntity<>(HttpStatus.NOT_FOUND); } return ResponseEntity.ok(allLentMovies); } @RequestMapping(path = "/api/lent", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity<LentMovieInfo> lendMovie(@RequestBody LentMovieInfo lentMovieInfo) { final LentMovieInfo alreadyLentMovie = repository.findOne(lentMovieInfo.getMovieId()); if (alreadyLentMovie != null) { LOG.warn("Movie '{}' is already lent to: {}", alreadyLentMovie.getMovieId(), alreadyLentMovie.getPerson()); return new ResponseEntity<>(HttpStatus.CONFLICT); } final Movie movie = movieRepository.findById(lentMovieInfo.getMovieId()); if (movie == null) { LOG.warn("Movie '{}' not in collection!", lentMovieInfo.getMovieId()); return new ResponseEntity<>(HttpStatus.NOT_FOUND); } if (Strings.isNullOrEmpty(lentMovieInfo.getPerson())) { LOG.warn("{person} is null in lent movie info object!"); return new ResponseEntity<>(HttpStatus.BAD_REQUEST); } if (lentMovieInfo.getLentDate() == null) { LOG.debug("Set lent date to NOW"); lentMovieInfo.setLentDate(LocalDate.now()); } final LentMovieInfo saved = repository.save(lentMovieInfo); if (saved != null && !Strings.isNullOrEmpty(saved.getMovieId())) { return ResponseEntity.ok(saved); } return new ResponseEntity<>(HttpStatus.EXPECTATION_FAILED); } @RequestMapping(path = "/api/lent/{id}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity<LentMovieInfo> getByMovieId(@PathVariable("id") String movieId) { final LentMovieInfo lentMovieInfo = repository.findOne(movieId); if (lentMovieInfo != null) { return ResponseEntity.ok(lentMovieInfo); } else { return new ResponseEntity<>(HttpStatus.NOT_FOUND); } } @RequestMapping(path = "/api/lent/{id}", method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity<LentMovieInfo> movieReturned(@PathVariable("id") String movieId) { final LentMovieInfo lentMovieInfo = repository.findOne(movieId); if (lentMovieInfo != null) { repository.delete(lentMovieInfo); return ResponseEntity.ok(lentMovieInfo); } else { return new ResponseEntity<>(HttpStatus.NOT_FOUND); } } }
java
Tax payers have been foxed by the financial terms. Financial Year (FY) or Fiscal Year is the year for income earned and Assessment Year (AY) is for income assessed thereby taxes are paid and Income Tax Return (ITR) filed. Advance Tax is paid before the end of the FY in four deadlines: June 15 (25%), September 15 (50%), December 15 (75%) and March 15 (100%). 15th March is the last day for payable of Advance Tax for the FY 2018-19. Advance Tax applies to all tax payers, salaried, freelancers and business. Senior citizens who do not run a business are exempted from paying advance tax. Individual whose tax liability is Rs. 10,000 or more in a FY have to pay Advance Tax. Generally employer, including PDA (Pension Disbursing Agency) deducted the TDS. Interest is applicable on late payment if it is not paid according to schedule. Tax paid after FY called Self- Assessment Tax i. e. AY 2019-20 before filling the IT Returns. There is no specific date for paying this tax by filling a Tax Challan ITNS 280 at specified bank branches or online. There are tax exemptions under Section 10 or 54 where leave travel allowance, interest from tax-free bonds, or long-term capital gains on equity funds are excluded from the gross total income. For calculating taxes, permissible deductions under Section 80 (80C to 80U) are deducted from gross total income. 4% for education cess and secondary and higher secondary cess is to be added. Kamal Baruah, Garal, Guwahati. In present era of austerity and national airliner already under heavy debt, Air India should curtail freebies to its directors and staffers, including free air-passes for family-members. Management and staff of public sector Air India should get benefits according to rules of the Union Government and not at all in an arbitrarily manner decided by its own board-members who have a definite conflict of interest in such anti-public decisions for which they themselves are beneficiaries. The Union Government should also study facilities including of free air tickets provided by private sector national airliners for family members of their staffers. It may be pointed out that facilities and benefits provided to staffers of national airliner can and must not be compared with those of international airliners where some countries are so rich that they have aeroplanes with fittings and accessories made of gold! The Union Civil Aviation Ministry should swiftly act for ensuring real austerity in Air India. Madhu Agrawal, 1775 Kucha Lattushah, Delhi-110006 (India).
english
{ "directions": [ "Heat oil in a wide 8-quart heavy pot over moderately high heat until hot but not smoking, then saut\u00e9 onion, celery, bell pepper, and garlic, stirring occasionally, until golden, 10 to 12 minutes. Add turkey and saut\u00e9, stirring occasionally and breaking up large lumps with a wooden spoon, until meat is no longer pink, about 5 minutes. Stir in salt and pepper.", "Pur\u00e9e tomatoes with juice, ketchup, molasses, vinegar, Worcestershire sauce, and Tabasco in a blender until smooth. Add to turkey and simmer, uncovered, stirring occasionally, until sauce is thickened, 25 to 30 minutes.", "Serve turkey sloppy joes on split Cheddar buttermilk biscuits." ], "ingredients": [ "3 tablespoons olive oil", "1 large onion, chopped", "2 celery ribs, chopped", "1 red bell pepper, chopped", "4 garlic cloves, finely chopped", "2 1/2 lb ground turkey (not labeled \"all breast meat\")", "1 teaspoon salt", "1/2 teaspoon black pepper", "1 (28- to 32-oz) can whole tomatoes in juice", "1/2 cup ketchup", "2 tablespoons molasses (not blackstrap)", "2 tablespoons cider vinegar", "1 1/2 tablespoons Worcestershire sauce", "1 1/4 teaspoons Tabasco, or to taste", "Cheddar buttermilk biscuits" ], "language": "en-US", "source": "www.epicurious.com", "tags": [ "Sandwich", "Tomato", "turkey", "Saut\u00e9", "Kid-Friendly", "Back to School", "Cheddar", "Gourmet" ], "title": "Turkey Sloppy Joes on Cheddar Buttermilk Biscuits", "url": "http://www.epicurious.com/recipes/food/views/turkey-sloppy-joes-on-cheddar-buttermilk-biscuits-230464" }
json
/* Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2019 the ZAP development team * * 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. */ use super::ZapApiError; use super::ZapService; use serde_json::Value; use std::collections::HashMap; /** * This file was automatically generated. */ /** * Shows the parameters for the specified site, or for all sites if the site is not specified */ pub fn params(service: &ZapService, site: String) -> Result<Value, ZapApiError> { let mut params = HashMap::new(); params.insert("site".to_string(), site); super::call(service, "params", "view", "params", params) }
rust
<reponame>diablodale/depthai-bootloader-shared<gh_stars>1-10 #pragma once // std #include <cstdint> #include <map> // project #include "Type.hpp" #include "Section.hpp" #include "Memory.hpp" namespace dai { namespace bootloader { namespace request { enum Command : uint32_t { USB_ROM_BOOT = 0, BOOT_APPLICATION, UPDATE_FLASH, GET_BOOTLOADER_VERSION, BOOT_MEMORY, UPDATE_FLASH_EX, UPDATE_FLASH_EX_2, NO_OP, GET_BOOTLOADER_TYPE, SET_BOOTLOADER_CONFIG, GET_BOOTLOADER_CONFIG, BOOTLOADER_MEMORY, }; struct BaseRequest { BaseRequest(Command command) : cmd(command){} Command cmd; }; // Specific request PODs struct UsbRomBoot : BaseRequest { // Common UsbRomBoot() : BaseRequest(USB_ROM_BOOT) {} static constexpr auto VERSION = "0.0.2"; static constexpr const char* NAME = "UsbRomBoot"; }; struct BootApplication : BaseRequest { // Common BootApplication() : BaseRequest(BOOT_APPLICATION) {} // Data static constexpr const char* VERSION = "0.0.2"; static constexpr const char* NAME = "BootApplication"; }; struct UpdateFlash : BaseRequest { // Common UpdateFlash() : BaseRequest(UPDATE_FLASH) {} // Data enum Storage : uint32_t { SBR, BOOTLOADER }; Storage storage; uint32_t totalSize; uint32_t numPackets; static constexpr const char* VERSION = "0.0.2"; static constexpr const char* NAME = "UpdateFlash"; }; struct GetBootloaderVersion : BaseRequest { // Common GetBootloaderVersion() : BaseRequest(GET_BOOTLOADER_VERSION) {} // Data static constexpr const char* VERSION = "0.0.2"; static constexpr const char* NAME = "GetBootloaderVersion"; }; // 0.0.12 or higher struct BootMemory : BaseRequest { // Common BootMemory() : BaseRequest(BOOT_MEMORY) {} // Data uint32_t totalSize; uint32_t numPackets; static constexpr const char* VERSION = "0.0.12"; static constexpr const char* NAME = "BootMemory"; }; // UpdateFlashEx - Additional options struct UpdateFlashEx : BaseRequest { // Common UpdateFlashEx() : BaseRequest(UPDATE_FLASH_EX) {} // Data Memory memory; Section section; uint32_t totalSize; uint32_t numPackets; static constexpr const char* VERSION = "0.0.12"; static constexpr const char* NAME = "UpdateFlashEx"; }; // UpdateFlashEx2 - Additional options struct UpdateFlashEx2 : BaseRequest { // Common UpdateFlashEx2() : BaseRequest(UPDATE_FLASH_EX_2) {} // Data Memory memory; uint32_t offset; uint32_t totalSize; uint32_t numPackets; static constexpr const char* VERSION = "0.0.12"; static constexpr const char* NAME = "UpdateFlashEx2"; }; struct GetBootloaderType : BaseRequest { // Common GetBootloaderType() : BaseRequest(GET_BOOTLOADER_TYPE) {} // Data static constexpr const char* VERSION = "0.0.12"; static constexpr const char* NAME = "GetBootloaderType"; }; // 0.0.14 or higher struct SetBootloaderConfig : BaseRequest { // Common SetBootloaderConfig() : BaseRequest(SET_BOOTLOADER_CONFIG) {} // Data Memory memory = Memory::AUTO; int64_t offset = -1; uint32_t clearConfig = 0; uint32_t totalSize = 0; uint32_t numPackets = 0; static constexpr const char* VERSION = "0.0.14"; static constexpr const char* NAME = "SetBootloaderConfig"; }; struct GetBootloaderConfig : BaseRequest { // Common GetBootloaderConfig() : BaseRequest(GET_BOOTLOADER_CONFIG) {} // Data Memory memory = Memory::AUTO; int64_t offset = -1; uint32_t maxSize = 0; static constexpr const char* VERSION = "0.0.14"; static constexpr const char* NAME = "GetBootloaderConfig"; }; struct BootloaderMemory : BaseRequest { // Common BootloaderMemory() : BaseRequest(BOOTLOADER_MEMORY) {} // Data static constexpr const char* VERSION = "0.0.14"; static constexpr const char* NAME = "BootloaderMemory"; }; } namespace response { enum Command : uint32_t { FLASH_COMPLETE = 0, FLASH_STATUS_UPDATE, BOOTLOADER_VERSION, BOOTLOADER_TYPE, GET_BOOTLOADER_CONFIG, BOOTLOADER_MEMORY, BOOT_APPLICATION, }; struct BaseResponse { BaseResponse(Command command) : cmd(command){} Command cmd; }; // Specific request PODs struct FlashComplete : BaseResponse { // Common FlashComplete() : BaseResponse(FLASH_COMPLETE) {} // Data uint32_t success; char errorMsg[64]; static constexpr const char* VERSION = "0.0.2"; static constexpr const char* NAME = "FlashComplete"; }; struct FlashStatusUpdate : BaseResponse { // Common FlashStatusUpdate() : BaseResponse(FLASH_STATUS_UPDATE) {} // Data float progress; static constexpr const char* VERSION = "0.0.2"; static constexpr const char* NAME = "FlashStatusUpdate"; }; struct BootloaderVersion : BaseResponse { // Common BootloaderVersion() : BaseResponse(BOOTLOADER_VERSION) {} // Data uint32_t major, minor, patch; static constexpr const char* VERSION = "0.0.2"; static constexpr const char* NAME = "BootloaderVersion"; }; struct BootloaderType : BaseResponse { // Common BootloaderType() : BaseResponse(BOOTLOADER_TYPE) {} // Data Type type; static constexpr const char* VERSION = "0.0.12"; static constexpr const char* NAME = "BootloaderType"; }; // 0.0.14 struct GetBootloaderConfig : BaseResponse { // Common GetBootloaderConfig() : BaseResponse(GET_BOOTLOADER_CONFIG) {} // Data uint32_t success; char errorMsg[64]; uint32_t totalSize; uint32_t numPackets; static constexpr const char* VERSION = "0.0.14"; static constexpr const char* NAME = "GetBootloaderConfig"; }; struct BootloaderMemory : BaseResponse { // Common BootloaderMemory() : BaseResponse(BOOTLOADER_MEMORY) {} // Data Memory memory; static constexpr const char* VERSION = "0.0.14"; static constexpr const char* NAME = "BootloaderMemory"; }; struct BootApplication : BaseResponse { // Common BootApplication() : BaseResponse(BOOT_APPLICATION) {} // Data uint32_t success; char errorMsg[64]; static constexpr const char* VERSION = "0.0.14"; static constexpr const char* NAME = "BootApplication"; }; } } // namespace bootloader } // namespace dai
cpp
<filename>packages/tsx-editor/src/transpiler/transpileHelpers.test.ts import fs from 'fs'; import path from 'path'; import { IDiagnostic, _getLineStarts, _getErrorLineInfo, _getErrorMessages, _supportedPackageToGlobalMap } from './transpileHelpers'; import { SUPPORTED_PACKAGES } from '../utilities/defaultSupportedPackages'; // Real diagnostics copied from loading ./examples/class.txt in the editor while type checking wasn't set up const exampleLines = fs .readFileSync(path.join(__dirname, 'examples/class.txt')) .toString() .split(/\r?\n/g); const example = exampleLines.join('\n'); const exampleCRLF = exampleLines.join('\r\n'); const diagnostics: IDiagnostic[] = [ { start: 23, length: 7, messageText: "Cannot find module 'react'.", code: 2307, category: 1 }, { start: 192, length: 3, messageText: "Cannot find namespace 'JSX'.", code: 2503, category: 1 }, { start: 225, length: 32, messageText: "JSX element implicitly has type 'any'.", code: 7026, category: 1 } ]; const lineStarts = [0, 32, 100, 101, 173, 206, 219, 258, 278, 305, 343, 361, 381, 400, 459, 518, 577, 588, 601, 608, 612, 614]; const lineStartsCRLF = [0, 33, 102, 104, 177, 211, 225, 265, 286, 314, 353, 372, 393, 413, 473, 533, 593, 605, 619, 627, 632, 635]; describe('_getLineStarts', () => { it('works with LF', () => { expect(_getLineStarts(example)).toEqual(lineStarts); }); it('works with CRLF', () => { expect(_getLineStarts(exampleCRLF)).toEqual(lineStartsCRLF); }); }); describe('_getErrorLineInfo', () => { it('works', () => { expect(_getErrorLineInfo(diagnostics[0], lineStarts)).toEqual({ line: 1, col: 24 }); expect(_getErrorLineInfo(diagnostics[1], lineStarts)).toEqual({ line: 5, col: 20 }); expect(_getErrorLineInfo(diagnostics[2], lineStarts)).toEqual({ line: 7, col: 7 }); }); it('works at last line of file', () => { expect(_getErrorLineInfo({ start: 615, messageText: 'fake', code: 0, category: 1 }, lineStarts)).toEqual({ line: 22, col: 2 }); }); }); describe('_getErrorMessages', () => { it('works', () => { expect(_getErrorMessages(diagnostics, example)).toEqual([ "Line 1 - Cannot find module 'react'. (TS2307)", "Line 5 - Cannot find namespace 'JSX'. (TS2503)", "Line 7 - JSX element implicitly has type 'any'. (TS7026)" ]); }); it('works with object messageText', () => { const { messageText, code, ...rest } = diagnostics[0]; const diagnostic = { ...rest, code: 0, messageText: { messageText: messageText as string, code } }; expect(_getErrorMessages([diagnostic], example)).toEqual(["Line 1 - Cannot find module 'react'. (TS2307)"]); }); }); describe('_supportedPackageToGlobalMap', () => { it('works', () => { expect(_supportedPackageToGlobalMap(SUPPORTED_PACKAGES)).toEqual({ 'office-ui-fabric-react': 'Fabric', '@uifabric/foundation': 'Fabric', '@uifabric/icons': 'Fabric', '@uifabric/merge-styles': 'Fabric', '@uifabric/styling': 'Fabric', '@uifabric/utilities': 'Fabric', '@uifabric/react-hooks': 'FabricReactHooks', '@uifabric/example-data': 'FabricExampleData' }); }); it('is memoized', () => { const result1 = _supportedPackageToGlobalMap(SUPPORTED_PACKAGES); const result2 = _supportedPackageToGlobalMap(SUPPORTED_PACKAGES); expect(result1).toBe(result2); const result3 = _supportedPackageToGlobalMap([{ globalName: 'Foo', packages: [{ packageName: 'foo' }] }]); expect(result3).not.toEqual(result2); }); });
typescript
2 Gideon answered: Don't be upset! Even though you came later, you were able to do much more than I did. It's just like the grape harvest: The grapes your tribe doesn't even bother to pick are better than the best grapes my family can grow. 3 (A) Besides, God chose you to capture Raven and Wolf. I didn't do a thing compared to you. By the time Gideon had finished talking, the men of Ephraim had calmed down and were no longer angry with him. 10 Zebah and Zalmunna were in Karkor[b] with an army of 15,000 troops. They were all that was left of the army of the eastern nations, because 120,000 of their warriors had been killed in the battle. 11 Gideon reached the enemy camp by going east along Nomad[c] Road past Nobah and Jogbehah. He made a surprise attack, 12 and the enemy panicked. Zebah and Zalmunna tried to escape, but Gideon chased and captured them. 13 After the battle, Gideon set out for home. As he was going through Heres Pass, 14 he caught a young man who lived in Succoth. Gideon asked him who the town officials of Succoth were, and the young man wrote down 77 names. 20 Gideon turned to Jether, his oldest son. “Kill them!” Gideon said. But Jether was young,[e] and he was too afraid to even pull out his sword. Gideon jumped up and killed them both. Then he took the gold ornaments from the necks of their camels. The enemy soldiers had been Ishmaelites,[f] and they wore gold earrings. 25 The Israelite soldiers replied, “Of course we will give you the earrings.” Then they spread out a robe on the ground and tossed the earrings on it. 26 The total weight of this gold was nearly 20 kilograms. In addition, there was the gold from the camels' ornaments and from the beautiful jewelry worn by the Midianite kings. Gideon also took their purple robes. The Midianites had been defeated so badly that they were no longer strong enough to attack Israel. And so Israel was at peace for the remaining 40 years of Gideon's life. 30 Gideon had many wives and 70 sons. 31 He even had a wife[h] who lived at Shechem.[i] They had a son, and Gideon named him Abimelech. 32 Gideon lived to be an old man. And when he died, he was buried in the family tomb in his hometown of Ophrah, which belonged to the Abiezer clan. 33 Soon after Gideon's death, the Israelites turned their backs on God again. They set up idols of Baal and worshiped Baal Berith[j] as their god. 34 The Israelites forgot that the Lord was their God, and that he had rescued them from the enemies who lived around them. 35 Besides all that, the Israelites were unkind to Gideon's family, even though Gideon had done so much for Israel. - 8.9 tower: Towers were often part of a town wall. - 8.10 Karkor: About 160 kilometers east of the Dead Sea. - 8.11 Nomad: A person who lives in a tent and moves from place to place. - 8.20 young: Gideon wanted to insult the kings by having a young boy kill them. - 8.24 Ishmaelites: According to Genesis 25.1,2, 12, both Ishmaelites and Midianites were descendants of Abraham. It is possible that in this passage “Ishmaelites” has the meaning “nomadic traders,” while “Midianites” (verses 22,26-29) refers to their ethnic origin. - 8.31 wife: This translates a Hebrew word for a woman who was legally bound to a man, but without the full privileges of a wife. - 8.31 who lived at Shechem: Sometimes marriages were arranged so that the wife lived with her parents, and the husband visited her from time to time. Copyright © 1995 by American Bible Society For more information about CEV, visit www.bibles.com and www.cev.bible.
english
The DDMA banned celebrations of Chhath Puja in public places to contain the spread of Covid-19. The order has now triggered a political war in the national capital. By Amit Bhardwaj: A former Congress MP from Delhi is appealing to the Arvind Kejriwal government to not hurt the sentiments of Purvanchalis. A sitting BJP MP organised a meeting of the Chhath Puja committees and challenged the order passed by the DDMA. Meanwhile, the ruling Aam Aadmi Party (AAP) is playing extra cautious on the issue. In totality, the DDMA’s order to ban the Chhath Puja celebrations in public places has taken the national capital’s politics by storm. Now that the civic body polls are barely six months away, each political party would want the Purvanchali voters to rally behind them. Otherwise, their ships might sink. On September 30, the DDMA issued fresh guidelines for Covid-19 management in the national capital. Ahead of the festive season, Delhi’s disaster management authority decided to ease off norms related to public gatherings. In its order, while the DDMA allowed Dussehra celebrations and Ramlila -- play based on the Ramayana it has disallowed fairs and food stalls around such venues. The organisers have been asked to ensure that the social distancing norms are followed and separate entry and exit points are made at the Durga Puja sites. However, the DDMA decided to ban Chhath Puja celebrations in public places. As per the order, for the second year in a row, the Chhath Puja cannot be organised at public places such as temples, lakes and water bodies in Delhi. Chhath Puja is considered one of the biggest festivals for those hailing from eastern Uttar Pradesh, Bihar and Jharkhand. The decision has not gone down well with the Purvanchali community living in Delhi. Chhath Puja committees have expressed their ire against the DDMA order and demanded the rollback of the restrictions. Several like Vinit Kumar question the logic behind the DDMA order. “When the Ramlila can be permitted, the Dussehra events can be organised in Delhi with social distancing, then why can’t we celebrate Chhath Puja? ” Vinit Kumar, president of Delhi’s Narela-based Chhath Puja society, questioned. “We, as organisers, had already started the awareness campaign in our area and were appealing to families who would participate in the fasting and puja to get both doses of vaccine before the festival. In fact, we had decided to stop the entry of those who would fail to produce the certificate of both doses. The Chhath Parva is a month and a half away, and we were confident that all our participants would have been vaccinated by then,” Kumar told India Today. He further added that the Delhi government and the Lieutenant Governor should have shown trust in the vaccines and waited for a while before issuing any administrative order related to the biggest religious function of the Purvanchalis. Shiva Ram Pandey has been managing the affairs of one of the oldest Chhath ghats in Delhi, near ITO. He, too, questioned the logic behind the DDMA’s order and cited its dichotomies. Pandey said that the ban on the Chhath Puja celebrations in public places has hurt the pride of the Purvanchali community. Controversy fueling Purvanchali politics of Delhi. Those who hail from eastern Uttar Pradesh and Bihar are collectively referred to as Purvanchalis. The community forms nearly 25 to 30 per cent vote bank of the national capital. And no political party can imagine an electoral victory without rallying the community behind them. The politics around the Chhath Puja celebrations is not new to Delhi. In the pre-Covid days, the AAP-led Delhi government and the BJP-ruled Municipal Corporations (MCD) used to compete when it came to investing resources in the construction and management of Chhath ghats in Delhi. This festival is possibly the easiest way to stay relevant amongst the community which can sway the voting sentiment in the national capital. Hence, both the Congress and the BJP are trying to put the incumbent AAP on the back foot over the issue. “It is unfortunate that the public celebrations of Chhath Puja have been banned by the DDMA. Chhath is not just a matter of faith for the Purvanchalis, it is an integral part of our culture and identity,” former Congress MP Mahabal Mishra said. Mishra, a Purvanchali himself, requested the LG and Chief Minister Arvind Kejriwal to allow Chhath celebrations and not hurt the sentiments of the community. BJP MP Manoj Tiwari has gone all aggressive on the issue. He organised a meeting of Chhath Puja committees to mount pressure on the Kejriwal government. Tiwari, who hails from the Purvanchali community, has termed the DDMA order as “an injustice”. “Chhath Puja is a festival of social distancing. Families who observe fast and do Chhath Parva follow extremely high-level sanitization and cleanlinessMoreover, now that the Covid situation in Delhi is under control, there is no point in banning the public celebrations of our festival,” the north-east Delhi MP said targeting the AAP government. Tiwari has said that if the DDMA order is not rolled back, they are ready to challenge it and defy the guidelines. “Arvind Kejriwal should have consulted Delhi MPs before taking this decision. We are going to challenge Kejriwal Government’s orderWe are going to perform Chhath Puja (in public places). However, we will follow the Covid protocols,” Tiwari told India Today. The BJP leader claimed that he has sought CM Kejriwal’s time to discuss the issue. Meanwhile, the AAP is yet to break its silence over the brewing controversy. Possibly, because it wants to play extra cautious when it comes to the Purvanchali turf. The MCD polls are barely six months away and the community is going to play a crucial role in it. Hence, in the days to come, each political party in Delhi would become even more competitive to garner the Purvanchali support in their favour. It seems the controversy triggered by the DDMA order is not going to settle anytime soon.
english
Prior to the night of 10 July, Aaron Judge, the New York Yankees’ 6ft 7in, 282lbs rookie right fielder, had already hammered out a reputation as a prodigious young slugger, having blasted 30 home runs, at an average of 416 feet, in the Yankees’ first 89 games. But then came the annual Home Run Derby in Miami, which Judge won by bashing 47 dingers. Those 47 home runs covered a distance of four miles – and caused yet another sizable aftershock in the already impressive, and still growing, Aaron Judge marketing earthquake. Because he is modest, focused and a Yankee, the 25-year-old has been compared favorably with Derek Jeter. But Jeter was four inches shorter and 87lbs lighter. Jeter hit 260 home runs, but it took him 20 years. Judge slipped into a slump after the All-Star Game and acknowledged that he has much work to do. Even if you include his 27-game audition late last season – in the major leagues you can still be a rookie in your second season if you had fewer than 150 bats in your debut year – he has not played a full season. But Judge, who makes $507,500 in salary, appears to have the potential to make hundreds of millions. “Baseball, it seems right now, has lots of reluctant stars, who really are letting their play do the talking, from Mike Trout to now Aaron Judge,” Joe Favorito, a veteran sports business consultant and professor at Columbia University, told the Guardian. “Given the length of the season, it’s understandable to some extent, but when you see the interest that is there, combined with what athletes in the NBA and the NFL can do during the season, marketability becomes a question of time management combined with the interest of the person. Some athletes will leave dollars on the table to be ultra selective and just concentrate on their craft. Because of a relative lack of exposure internationally, baseball players tend to draw fewer endorsements than players in other sports, like soccer, tennis and basketball. But the money is not shabby. According to Forbes, Jeter made more than $130m in endorsements during his playing career, which ended in 2015. Bryce Harper, the Washington Nationals outfielder, signed a record 10-year endorsement contract with Under Armour last year that was estimated to be worth more than $1m a year. Forbes said San Francisco catcher Buster Posey drew $4m in endorsements last year on top of his $20.6m salary. On top of that is the playing contract Judge could clinch if he can keep up his standards on the field consistently. Giancarlo Stanton – another player famed for his home run power – signed a 13-year, $325m contract (not including endorsements) in November 2014. Speculation is that Harper will be baseball’s first $400m player. Noah Garden, executive vice president for business for Major League Baseball, told the Guardian last week that there has been an extraordinary increase in the sales of Aaron Judge merchandise in the last few months. For one, Judge has had the top-selling jersey since the beginning of May. Replicas of the jersey he wore during the Home Run Derby, were the best-selling All-Star jerseys in the last 10 years, with sales doubling after the derby. During All-Star Week, the most popular searches on MLBShop.com was Judge-related. Judge was adopted as an infant and grew up in Linden, California, a small town whose annual highlight, at least until this year, had been its cherry festival. He played collegiately at Fresno State and was a first-round draft choice of the Yankees in 2013. In 1,297 at-bats over three minor-league seasons, however, Judge hit a mere 56 home runs. He had 19 home runs in 93 games last year at the Yankees’ top farm club in Scranton, Pennsylvania, and hit only four home runs in his month-long stint with the Yankees last year. But the Yankees were rebuilding and had a place for him to play. He hit 10 home runs in April, but seven more in May then another 10 in June. Not only was Judge drawing attention, but fans wanted to buy Judge merchandise. According to Jeff Heckman, the director of e-commerce at Topps, the famous baseball trading card company, there has been a “tremendous surge” in the amount of Judge items sold on Topps.com in July. For example, he said, the company offers a print-on-demand trading card called Topps NOW, which marks events immediately after they happen. When asked what he thought made Judge so appealing, Heckman said there was much more to it than his ability to pound 450-foot homers deep into the night. An extended run of success for Judge is hardly guaranteed, and he would not be the first big-league slugger to start out fast, then cool off. Jose Abreu bashed 28 home runs in his first 79 games with the Chicago White Sox in 2014. He has hit an average of one homer every five games since. Judge, too, plays for a Yankees team that was a pleasant surprise in the first half of the season but has struggled recently, and it is unlikely that Judge will be powering the Yankees to the playoffs, let alone the World Series. But he has earned a name for himself – and a couple of home-run calls, all word plays on his last name, from Yankees’ radio announcer John Sterling. Judge is determined to keep improving. Millions of dollars for him and the companies he represents, are waiting to be had.
english
#include "llightprobe.h" #include "llightmapper.h" #include "llighttypes.h" #include "core/math/aabb.h" namespace LM { int LightProbes::Create(LightMapper &lm) { // return; // save locally m_pLightMapper = &lm; // get the aabb (smallest) of the world bound. AABB bb = lm.GetTracer().GetWorldBound_contracted(); // can't make probes for a non existant world if (bb.get_shortest_axis_size() <= 0.0f) return -1; // use the probe density to estimate the number of voxels m_Dims = lm.GetTracer().EstimateVoxelDims(lm.m_Settings_ProbeDensity); m_DimXTimesY = (m_Dims.x * m_Dims.y); Vector3 voxel_dims; m_Dims.To(voxel_dims); print_line("Probes voxel dims : " + String(Variant(voxel_dims))); // voxel dimensions and start point m_VoxelSize = bb.size / voxel_dims; // start point is offset by half a voxel m_ptMin = bb.position + (m_VoxelSize * 0.5f); m_Probes.resize(m_Dims.x * m_Dims.y * m_Dims.z); return m_Dims.z; } void LightProbes::Process(int stage) { int z = stage; // for (int z=0; z<m_Dims.z; z++) // { for (int y=0; y<m_Dims.y; y++) { for (int x=0; x<m_Dims.x; x++) { CalculateProbe(Vec3i(x, y, z)); } } // } } void LightProbes::Save() { String filename = m_pLightMapper->m_Settings_CombinedFilename; filename = filename.get_basename(); filename += ".probe"; Save(filename); // Save("lightprobes.probe"); } void LightProbes::CalculateProbe_Old(const Vec3i &pt) { Vector3 pos; GetProbePosition(pt, pos); LightProbe *pProbe = GetProbe(pt); assert (pProbe); // do multiple tests per light const int nLightTests = 9; Vector3 ptLightSpacing = m_VoxelSize / (nLightTests+2); for (int l=0; l<m_pLightMapper->m_Lights.size(); l++) { const LightMapper_Base::LLight &light = m_pLightMapper->m_Lights[l]; // the start of the mini grid for each voxel Vector3 ptLightStart = pos - (ptLightSpacing * ((nLightTests -1) / 2)); int nHits = 0; for (int lt_z=0; lt_z<nLightTests; lt_z++) { for (int lt_y=0; lt_y<nLightTests; lt_y++) { for (int lt_x=0; lt_x<nLightTests; lt_x++) { // ray from probe to light Ray r; r.o = ptLightStart; r.o.x += (lt_x * ptLightSpacing.x); r.o.y += (lt_y * ptLightSpacing.y); r.o.z += (lt_z * ptLightSpacing.z); Vector3 offset = light.pos - r.o; float dist_to_light = offset.length(); // NYI if (dist_to_light == 0.0f) continue; r.d = offset / dist_to_light; // to start with just trace a ray to each light Vector3 bary; float nearest_t; int tri_id = m_pLightMapper->m_Scene.FindIntersect_Ray(r, bary, nearest_t); // light blocked if ((tri_id != -1) && (nearest_t < dist_to_light)) continue; nHits++; } // for lt_x } // for lt_y } // for lt_z if (nHits) { // light got through.. // pProbe->m_fLight += 1.0f; LightProbe::Contribution * pCont = pProbe->m_Contributions.request(); pCont->light_id = l; // calculate power based on distance //pCont->power = CalculatePower(light, dist_to_light, pos); pCont->power = (float) nHits / (float) (nLightTests * nLightTests * nLightTests); //print_line("\tprobe " + pt.ToString() + " light " + itos (l) + " power " + String(Variant(pCont->power))); } } // indirect light pProbe->m_Color_Indirect = m_pLightMapper->Probe_CalculateIndirectLight(pos); // apply gamma float gamma = 1.0f / m_pLightMapper->m_Settings_Gamma; pProbe->m_Color_Indirect.r = powf(pProbe->m_Color_Indirect.r, gamma); pProbe->m_Color_Indirect.g = powf(pProbe->m_Color_Indirect.g, gamma); pProbe->m_Color_Indirect.b = powf(pProbe->m_Color_Indirect.b, gamma); Color col_ind; pProbe->m_Color_Indirect.To(col_ind); //print_line("\tprobe " + pt.ToString() + " indirect " + String(Variant(col_ind))); } void LightProbes::CalculateProbe(const Vec3i &pt) { Vector3 pos; GetProbePosition(pt, pos); LightProbe *pProbe = GetProbe(pt); assert (pProbe); // do multiple tests per light const int nSamples = m_pLightMapper->m_Settings_ProbeSamples / 8; for (int l=0; l<m_pLightMapper->m_Lights.size(); l++) { const LightMapper_Base::LLight &light = m_pLightMapper->m_Lights[l]; // for a spotlight, we can cull completely in a lot of cases. // and we MUST .. because otherwise the cone ray generator will have infinite loop. if (light.type == LightMapper_Base::LLight::LT_SPOT) { Ray r; r.o = light.spot_emanation_point; r.d = pos - r.o; r.d.normalize(); float dot = r.d.dot(light.dir); //float angle = safe_acosf(dot); //if (angle >= light.spot_angle_radians) dot -= light.spot_dot_max; if (dot <= 0.0f) continue; } /* AABB bb; bb.position = m_ptMin; bb.position.x += m_VoxelSize.x * pt.x; bb.position.y += m_VoxelSize.y * pt.y; bb.position.z += m_VoxelSize.z * pt.z; bb.size = m_VoxelSize; */ //int nClear = 0; // store as a float for number of clear paths, because spotlights have a falloff for the cone float fClear = 0.0f; //bool LightMapper::Process_BackwardSample_Light(const LLight &light, const Vector3 &ptSource, const Vector3 &ptNormal, FColor &color, float power) // dummy not really needed //Vector3 ptNormal = Vector3(0, 1, 0); //FColor fcol; //fcol.Set(0.0f); // test single ray from probe to light centre //if (!m_pLightMapper->m_Scene.TestIntersect_Line(pos, light.pos)) // fClear = nSamples; int sample_count = 0; for (int sample=0; sample<nSamples; sample++) { // random start position in bounding box // Vector3 ptStart = bb.position; // ptStart.x += Math::randf() * bb.size.x; // ptStart.y += Math::randf() * bb.size.y; // ptStart.z += Math::randf() * bb.size.z; Vector3 ptStart = pos; float multiplier; bool disallow_sample; bool bClear = m_pLightMapper->Probe_SampleToLight(light, ptStart, multiplier, disallow_sample); // don't count samples if there is not path from the light centre to the light sample if (!disallow_sample) sample_count++; if (bClear) { fClear += multiplier; } } // for sample if (fClear > 0.0f) { // light got through.. // pProbe->m_fLight += 1.0f; LightProbe::Contribution * pCont = pProbe->m_Contributions.request(); pCont->light_id = l; // calculate power based on distance //pCont->power = CalculatePower(light, dist_to_light, pos); assert (sample_count); pCont->power = (float) fClear / (float) (sample_count); //print_line("\tprobe " + pt.ToString() + " light " + itos (l) + " power " + String(Variant(pCont->power))); } } // indirect light pProbe->m_Color_Indirect = m_pLightMapper->Probe_CalculateIndirectLight(pos); // apply gamma float gamma = 1.0f / m_pLightMapper->m_Settings_Gamma; pProbe->m_Color_Indirect.r = powf(pProbe->m_Color_Indirect.r, gamma); pProbe->m_Color_Indirect.g = powf(pProbe->m_Color_Indirect.g, gamma); pProbe->m_Color_Indirect.b = powf(pProbe->m_Color_Indirect.b, gamma); Color col_ind; pProbe->m_Color_Indirect.To(col_ind); //print_line("\tprobe " + pt.ToString() + " indirect " + String(Variant(col_ind))); } float LightProbes::CalculatePower(const LightMapper_Base::LLight &light, float dist, const Vector3 &pos) const { // ignore light energy for getting more detail, we can apply the light energy at runtime //float power = m_pLightMapper->LightDistanceDropoff(dist, light, 1.0f); // now we are calculating distance func in the shader, power can be used to represent how many rays hit the light, // and also the cone of a spotlight float power = 1.0f; return power; } void LightProbes::Save_Vector3(FileAccess *f, const Vector3 &v) { f->store_float(v.x); f->store_float(v.y); f->store_float(v.z); } void LightProbes::Normalize_Indirect() { float max = 0.0f; for (int n=0; n<m_Probes.size(); n++) { FColor &col = m_Probes[n].m_Color_Indirect; if (col.r > max) max = col.r; if (col.g > max) max = col.g; if (col.b > max) max = col.b; } // can't normalize if (max == 0.0f) { print_line("WARNING LightProbes::Normalize_Indirect : Can't normalize, range too small"); return; } float mult = 1.0f / max; for (int n=0; n<m_Probes.size(); n++) { FColor &col = m_Probes[n].m_Color_Indirect; col *= mult; } } void LightProbes::Save(String pszFilename) { Normalize_Indirect(); // try to open file for writing FileAccess *f = FileAccess::open(pszFilename, FileAccess::WRITE); ERR_FAIL_COND_MSG(!f, "Cannot create file at path '" + String(pszFilename) + "'."); // fourcc f->store_string("Prob"); // version f->store_16(100); // first save dimensions f->store_16(m_Dims.x); f->store_16(m_Dims.y); f->store_16(m_Dims.z); // minimum pos Save_Vector3(f, m_ptMin); // voxel size Save_Vector3(f, m_VoxelSize); // num lights f->store_16(m_pLightMapper->m_Lights.size()); for (int n=0; n<m_pLightMapper->m_Lights.size(); n++) { // light info const LightMapper_Base::LLight &light = m_pLightMapper->m_Lights[n]; // type f->store_8(light.type); // pos, direction Save_Vector3(f, light.pos); Save_Vector3(f, light.dir); // energy f->store_float(light.energy); f->store_float(light.range); // color f->store_float(light.color.r); f->store_float(light.color.g); f->store_float(light.color.b); f->store_float(light.spot_angle_radians); } // now save voxels .. 2 passes to make easier to compress with zip. // the first pass will be easily compressable for (int z=0; z<m_Dims.z; z++) { for (int y=0; y<m_Dims.y; y++) { for (int x=0; x<m_Dims.x; x++) { LightProbe * probe = GetProbe(Vec3i(x, y, z)); probe->Save(f); } } } for (int z=0; z<m_Dims.z; z++) { for (int y=0; y<m_Dims.y; y++) { for (int x=0; x<m_Dims.x; x++) { LightProbe * probe = GetProbe(Vec3i(x, y, z)); probe->Save_Secondary(f); } } } if (f) { f->close(); memdelete(f); } } void LightProbe::Save_Secondary(FileAccess *f) { // color uint8_t r, g, b; m_Color_Indirect.To_u8(r, g, b, 1.0f); f->store_8(r); f->store_8(g); f->store_8(b); int nContribs = m_Contributions.size(); if (nContribs > 255) nContribs = 255; for (int n=0; n<nContribs; n++) { const Contribution &c = m_Contributions[n]; //f->store_8(c.light_id); // convert power to linear 0 to 255 float p = c.power; p *= 0.5f; p *= 255.0f; int i = p; i = CLAMP(i, 0, 255); f->store_8(i); } } void LightProbe::Save(FileAccess *f) { // number of contributions int nContribs = m_Contributions.size(); if (nContribs > 255) nContribs = 255; // store number of contribs f->store_8(nContribs); for (int n=0; n<nContribs; n++) { const Contribution &c = m_Contributions[n]; f->store_8(c.light_id); // convert power to linear 0 to 255 // float p = c.power; // p *= 0.5f; // p *= 255.0f; // int i = p; // i = CLAMP(i, 0, 255); // f->store_8(i); } } } // namespace
cpp
{"word":"arthrostraca","definition":"One of the larger divisions of Crustacea, so called because the thorax and abdomen are both segmented; Tetradecapoda. It includes the Amphipoda and Isopoda."}
json
/******************************************************************************* * (c) Copyright 2019 Micro Focus or one of its affiliates. * * Licensed under the MIT License (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://opensource.org/licenses/MIT * * 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.fortify.plugin.jenkins; import java.io.File; import java.io.IOException; import java.util.Iterator; import org.apache.commons.io.FileUtils; import org.apache.commons.lang.StringUtils; import org.jenkinsci.remoting.RoleChecker; import hudson.FilePath; import hudson.remoting.VirtualChannel; public class RemoteService implements FilePath.FileCallable<FPRSummary> { private static final long serialVersionUID = 229830219491170076L; private final String fpr; private final StringBuilder logMsg; public RemoteService(String fpr) { this.fpr = fpr; this.logMsg = new StringBuilder(); } @Override public FPRSummary invoke(File workspace, VirtualChannel channel) throws IOException { FPRSummary summary = new FPRSummary(); File realFPR = locateFPR(workspace, fpr); summary.setFprFile(new FilePath(realFPR)); // setup log message to FPRSummary String s = logMsg.toString(); if (!StringUtils.isBlank(s)) { summary.log(s); } return summary; } private static File locateFPR(File workspace, String fprPath) { File fpr = new File(fprPath); // If full path, locate FPR outside workspace if (fpr.isAbsolute()) { if (fpr.exists()) { return fpr; } else { throw new RuntimeException("Analysis results file '" + fpr + "' doesn't exist!"); } } // If relative path, search in workspace File fprInWorkspace = locateFPRInWorkspace(workspace, fprPath); if (null == fprInWorkspace) { throw new RuntimeException( "Can't locate analysis results file '" + fpr + "' under workspace: " + workspace.getAbsolutePath()); } return fprInWorkspace; } @SuppressWarnings("unchecked") private static File locateFPRInWorkspace(File path, String preferredFileName) { String ext[] = { "fpr", "zip" }; //adding zip extension to support third-party results upload Iterator<File> iterator = FileUtils.iterateFiles(path, ext, true); long latestTime = 0; File latestFile = null; while (iterator.hasNext()) { File file = iterator.next(); if (isEmpty(preferredFileName) || preferredFileName.equalsIgnoreCase(file.getName())) { if (null == latestFile) { latestTime = file.lastModified(); latestFile = file; } else { // if this file is newer, we will use this file if (latestTime < file.lastModified()) { latestTime = file.lastModified(); latestFile = file; // else if the last modified time is the same, but this file's file name is // shorter, we will use this one // this to assume, if you copy the file, the file name is usually "Copy of // XXX.fpr" } else if (latestTime == file.lastModified() && latestFile.getName().length() > file.getName().length()) { latestFile = file; } } } } return latestFile; } private static boolean isEmpty(String str) { return (null == str || str.length() == 0); } @Override public void checkRoles(RoleChecker arg0) throws SecurityException { // do nothing at this time } }
java
England pacers James Anderson and Mark Wood were a happy duo at the end of the fifth and final Ashes 2015 Test at the Oval on Sunday. The pair played their respective roles in helping their team continue their dominance over Australia on home soil for more than a decade now. England emerged winners of the series by a 3-2 margin, with Australia giving veterans Michael Clarke and Chris Rogers a happy farewell with an innings and 46-run win in the series finale. Anderson recorded figures of 6 for 47 in Australia’s first innings in the third Test at Edgbaston, which England won by eight wickets. He was however, ruled out of the rest of the series due to a side strain. Mark Wood, on the other hand, was excited at the prospect of holding the urn for the first time in his career, having made his debut earlier this year. “Feels pretty good to be honest. Smaller than I thought though! But obviously a great feeling,” Wood was quoted as saying after the match.
english
[ { "line": 1, "column": 2, "rule": "stylus/selector-pseudo-class-case", "severity": "error", "text": "Expected \":Hover\" to be \":HOVER\" (stylus/selector-pseudo-class-case)" }, { "line": 2, "column": 2, "rule": "stylus/selector-pseudo-class-case", "severity": "error", "text": "Expected \":hover\" to be \":HOVER\" (stylus/selector-pseudo-class-case)" }, { "line": 9, "column": 9, "rule": "stylus/selector-pseudo-class-case", "severity": "error", "text": "Expected \":hover\" to be \":HOVER\" (stylus/selector-pseudo-class-case)" }, { "line": 17, "column": 7, "rule": "stylus/selector-pseudo-class-case", "severity": "error", "text": "Expected \":hover\" to be \":HOVER\" (stylus/selector-pseudo-class-case)" }, { "line": 27, "column": 13, "rule": "stylus/selector-pseudo-class-case", "severity": "error", "text": "Expected \":hover\" to be \":HOVER\" (stylus/selector-pseudo-class-case)" }, { "line": 35, "column": 4, "rule": "stylus/selector-pseudo-class-case", "severity": "error", "text": "Expected \":hover\" to be \":HOVER\" (stylus/selector-pseudo-class-case)" }, { "line": 36, "column": 15, "rule": "stylus/selector-pseudo-class-case", "severity": "error", "text": "Expected \":hover\" to be \":HOVER\" (stylus/selector-pseudo-class-case)" }, { "line": 41, "column": 33, "rule": "stylus/selector-pseudo-class-case", "severity": "error", "text": "Expected \":hover\" to be \":HOVER\" (stylus/selector-pseudo-class-case)" }, { "line": 47, "column": 3, "rule": "stylus/selector-pseudo-class-case", "severity": "error", "text": "Expected \":hover\" to be \":HOVER\" (stylus/selector-pseudo-class-case)" }, { "line": 52, "column": 3, "rule": "stylus/selector-pseudo-class-case", "severity": "error", "text": "Expected \":hover\" to be \":HOVER\" (stylus/selector-pseudo-class-case)" }, { "line": 57, "column": 6, "rule": "stylus/selector-pseudo-class-case", "severity": "error", "text": "Expected \":hover\" to be \":HOVER\" (stylus/selector-pseudo-class-case)" } ]
json
#[macro_export] macro_rules! log { (warn:$($arg:tt)*) => { println!("{} {}", yansi::Paint::yellow("[clevert]").bold(), format!($($arg)*)); }; (error:$($arg:tt)*) => { println!("{} {}", yansi::Paint::red("[clevert]").bold(), format!($($arg)*)); }; (stay:$($arg:tt)*) => { print!("\r{} {}", yansi::Paint::cyan("[clevert]").bold(), format!($($arg)*)); use std::io::Write; std::io::stdout().flush().unwrap(); }; ($($arg:tt)*) => { println!("{} {}", yansi::Paint::cyan("[clevert]").bold(), format!($($arg)*)); }; }
rust
<filename>README.md # vue-endpoints vue-endpoints is a small wrapper for projects which require multiple API endpoints. It uses [axios](https://github.com/axios/axios#axios) and is inspired by [vue-axios](https://github.com/imcvampire/vue-axios#vue-axios). Please go check them both out. ## Installing Using npm: ```bash $ npm install vue-endpoints ``` Using yarn: ```bash $ yarn add vue-endpoints ``` ## Usage in Vue 3 With typescript: ```ts import { createApp } from "vue"; import { AxiosRequestConfig } from "axios"; import VueEndpoints, { createVueEndpoints } from "vue-endpoints"; const configurationsFirstInstance: AxiosRequestConfig = { baseURL: "/firstEndpoint", }; const configurationsSecondInstance: AxiosRequestConfig = { baseURL: "/secondEndpoint" }; const onSuccess = (config: AxiosRequestConfig) => { const { method, baseURL = "", url } = config; console.log(`%c Made ${method} request to ${baseURL + url}`, 'color:green; font-weight:800'); return config; }; const apiInstances = [ { name: "firstInstance", configs: configurationsFirstInstance, interceptors: { request: { onSuccess }, }, }, { name: "secondInstance", configs: configurationsSecondInstance }, ]; const vueEndpoints: VueEndpoints = createVueEndpoints({ baseApi: "firstInstance", apiInstances, }); createApp(App) .use(vueEndpoints) .mount("#app"); ``` Without typescript: ```js import { createApp } from "vue"; import { AxiosRequestConfig } from "axios"; import VueEndpoints from "vue-endpoints"; const configurationsFirstInstance = { baseURL: "/firstEndpoint", }; const configurationsSecondInstance = { baseURL: "/secondEndpoint" }; const onSuccess = (config) => { const { method, baseURL = "", url } = config; console.log(`%c Made ${method} request to ${baseURL + url}`, 'color:green; font-weight:800'); return config; }; const apiInstances = [ { name: "firstInstance", configs: configurationsFirstInstance, interceptors: { request: { onSuccess }, }, }, { name: "secondInstance", configs: configurationsSecondInstance }, ]; // alternative assignment const vueEndpoints = new VueEndpoints({ apiInstances }); createApp(App) .use(vueEndpoints) .mount("#app"); ``` In Vue component: ```js export default { computed: { option1(){ return this.$baseApi.get("/url/to/api"); }, //or option2(){ return this.$apiEndpoints.getApi("nameOfApi").get("/url/to/api"); }, }, } ``` ## API ##### createVueEndpoints(params?: PluginOptions): VueEndpoints ```js const vueEndpoints = createVueEndpoints({ /* Default base API will be the first API instance of instances-array */ baseApi: "someName", [{name:"someName", configs:{...axiosConfigurations}}], }); ``` ##### setBaseApi(name: string): void ```js const vueEndpoints = createVueEndpoints({ [{name:"someName", configs:{...axiosConfigurations}}], }); vueEndpoints.setBaseApi("someName") ``` #### getApi(name: string): AxiosInstance | undefined; ```js const vueEndpoints = createVueEndpoints({ [{name:"someName", configs:{...axiosConfigurations}}], }); const someNameApi = vueEndpoints.getApi("someName"); ``` #### apiInstances: ApiInstances[] ```html <template> {{ myInstances[0].name }} </template> ``` ```js <script> export default { computed: { myInstances() { return this.$apiEndpoints.apiInstances; }, }, }; </script> ``` ## vue-2 compatibility For now this tool is only compatible in [vue-3](https://v3.vuejs.org/). ## License [MIT](/LICENSE)
markdown
In a remarkable display of sports diplomacy, the President of the Board of Control for Cricket in India (BCCI), Roger Binny, and Vice-President Rajeev Shukla returned from their two-day visit to Pakistan, which culminated at the iconic Attari-Wagah border in Amritsar. The visit was orchestrated in response to a gracious invitation from the Pakistan Cricket Board (PCB), inviting members of the Asian Cricket Council (ACC) and various cricket boards to partake in the Asia Cup matches hosted in Lahore. During their sojourn, Binny and Shukla had the privilege of meeting players from Pakistan, Bangladesh, Afghanistan, and Sri Lanka teams at a splendid gala dinner. Shukla, evidently pleased with the trip, expressed his admiration for the PCB’s warm hospitality. The PCB had earnestly advocated for the revival of cricketing ties between India and Pakistan, although Shukla affirmed that the final decision rested with the central government. Binny, echoing Shukla’s sentiments, described the experience as nothing short of “fantastic.” Drawing parallels with the hospitality they received during their test match in 1984, he lauded the warm reception they received in Pakistan. “We were treated like kings over there, so it was an excellent time for us. We were able to meet all the Pakistan officials and the Pakistan Cricket Board. They are very happy with the outcome of us coming there, as we were so happy to be there also at the same time,” Binny exclaimed. The pinnacle of the Asia Cup 2023 in Pakistan approaches as Bangladesh gears up to clash with Pakistan in the final showdown in Lahore on Wednesday. This highly anticipated encounter marks the commencement of the Super Four stage, with the subsequent matches scheduled to transpire in Colombo. In a display of unparalleled cricketing prowess, Pakistan and India have advanced to the Super Four stage from Group A, while Sri Lanka and Bangladesh have similarly earned their rightful places from Group B. Cricket aficionados are eagerly awaiting the monumental showdown between India and Pakistan, slated for September 10, a clash that transcends borders and captivates the cricketing world. As the tournament unfolds, the cricketing fraternity eagerly anticipates the battles that will unfold on the field. With the sporting spirits soaring high, this Asia Cup 2023 promises to be a spectacle of skill, camaraderie, and sportsmanship. Amidst the resounding cheers and fervent hopes of fans, cricket unites nations, transcending political boundaries and forging friendships that endure beyond the boundary ropes. With India, Pakistan, Sri Lanka, and Bangladesh locking horns in a fierce competition, the Asia Cup 2023 promises to be a cricketing extravaganza, etching unforgettable memories in the hearts of cricket enthusiasts across the globe. As the excitement builds, the cricketing world looks forward to a tournament that celebrates not just cricket, but the spirit of unity, respect, and the enduring bond of sportsmanship.
english
The stand named Warner Stand was opened up by His Royal Highness, The Duke of Edinburg. His Royal Highness was awarded Honorary Life Membership for MCC in 1948, and also served as President of the Club twice, from 1949-50 and 1974-75. The official capacity of the Warner Stand is 2,656 which now boast of a world-class match control facility, an outstanding restaurant and catering provision and other sustainable features that reduce carbon footprint amongst others. The new Stand has been designed by Populous, known for being the architects of the London 2012 Olympic Stadium. The stand will be open to be used during England’s first ODI against Ireland on Sunday. “It has been a real team effort to get to this point as, with its tight geographical location at Lord’s, it was a challenging brief to our design and construction partners,” he explained. “From the vast improvement in facilities and sight lines to the impressive semi-translucent roof with oak beams, the new Warner Stand can rightly take its place alongside its architecturally-celebrated neighbouring stands,” Ebdon concluded.
english
import React from 'react'; import PropTypes from 'prop-types'; import { useForkRef } from '../utils/reactHelpers'; import debounce from 'debounce'; // < 1kb payload overhead when lodash/debounce is > 3kb. function getStyleValue(computedStyle, property) { return parseInt(computedStyle[property], 10) || 0; } const useEnhancedEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect; /** * @ignore - internal component. * * To make public in v4+. */ const Textarea = React.forwardRef(function Textarea(props, ref) { const { onChange, rowsMax, rowsMin, style, value, ...other } = props; const { current: isControlled } = React.useRef(value != null); const inputRef = React.useRef(); const [state, setState] = React.useState({}); const handleRef = useForkRef(ref, inputRef); const syncHeight = React.useCallback(() => { const input = inputRef.current; const savedValue = input.value; const savedHeight = input.style.height; const savedOverflow = input.style.overflow; input.style.overflow = 'hidden'; input.style.height = '0'; // The height of the inner content input.value = savedValue || props.placeholder || 'x'; const innerHeight = input.scrollHeight; const computedStyle = window.getComputedStyle(input); const boxSizing = computedStyle['box-sizing']; // Measure height of a textarea with a single row input.value = 'x'; const singleRowHeight = input.scrollHeight; // The height of the outer content let outerHeight = innerHeight; if (rowsMin != null) { outerHeight = Math.max(Number(rowsMin) * singleRowHeight, outerHeight); } if (rowsMax != null) { outerHeight = Math.min(Number(rowsMax) * singleRowHeight, outerHeight); } outerHeight = Math.max(outerHeight, singleRowHeight); if (boxSizing === 'content-box') { outerHeight -= getStyleValue(computedStyle, 'padding-bottom') + getStyleValue(computedStyle, 'padding-top'); } else if (boxSizing === 'border-box') { outerHeight += getStyleValue(computedStyle, 'border-bottom-width') + getStyleValue(computedStyle, 'border-top-width'); } input.style.overflow = savedOverflow; input.style.height = savedHeight; input.value = savedValue; setState(prevState => { // Need a large enough different to update the height. // This prevents infinite rendering loop. if (innerHeight > 0 && Math.abs((prevState.innerHeight || 0) - innerHeight) > 1) { return { innerHeight, outerHeight, }; } return prevState; }); }, [setState, rowsMin, rowsMax, props.placeholder]); React.useEffect(() => { const handleResize = debounce(() => { syncHeight(); }, 166); // Corresponds to 10 frames at 60 Hz. window.addEventListener('resize', handleResize); return () => { handleResize.clear(); window.removeEventListener('resize', handleResize); }; }, [syncHeight]); useEnhancedEffect(() => { syncHeight(); }); const handleChange = event => { if (!isControlled) { syncHeight(); } if (onChange) { onChange(event); } }; return ( <textarea value={value} onChange={handleChange} ref={handleRef} style={{ height: state.outerHeight, overflow: state.outerHeight === state.innerHeight ? 'hidden' : null, ...style, }} {...other} /> ); }); Textarea.propTypes = { /** * @ignore */ className: PropTypes.string, /** * @ignore */ onChange: PropTypes.func, /** * @ignore */ placeholder: PropTypes.string, /** * Maximum number of rows to display when multiline option is set to true. */ rowsMax: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), /** * Minimum number of rows to display when multiline option is set to true. */ rowsMin: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), /** * @ignore */ style: PropTypes.object, /** * @ignore */ value: PropTypes.any, }; export default Textarea;
javascript
<gh_stars>1-10 package main import ( "flag" "fmt" _ "net/http" _ "os" "github.com/golang/glog" _ "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" "k8s.io/client-go/pkg/api/v1" "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" ) var ( version = "xxx:REPLACE:DURING:BUILD" kubeconfig = flag.String("kubeconfig", "/etc/kubernetes/kubeconfig", "Absolute path to the kubeconfig file") isInCluster = flag.Bool("is-in-cluster", false, `Whether the controller is run inside k8s or not (default: false)`) svcFallback = flag.String("fallback-service", "", `The name of the fallback service in "namespace/name" format.`) ) func main() { glog.Infof("Caddy Ingress Controller version %v", version) flag.Parse() config, err := getClusterConfig(*isInCluster, *kubeconfig) if err != nil { glog.Fatalf("Failed to get cluster configuration: %v", err) } clientset, err := kubernetes.NewForConfig(config) if err != nil { glog.Fatalf("Failed to create kubernetes client: %v", err) } //watchNamespace, namespaceGiven, err := clientConfig.Namespace() //if err != nil { // glog.Fatalf("Unexpected error: %v", err) //} //if !namespaceGiven { // watchNamespace = v1.NamespaceAll //} ingressController, err := NewIngressController(clientset, *svcFallback) if err != nil { glog.Fatalf("Could not create ingress controller: %v", err) } //go ingressController.RunHealthz(8080) ingressController.WatchNamespace(v1.NamespaceAll) } func getClusterConfig(isInCluster bool, kubeconfig string) (*rest.Config, error) { if isInCluster { config, err := rest.InClusterConfig() if err != nil { return nil, fmt.Errorf("Could not initialize in-cluster context: %v", err) } return config, nil } config, err := clientcmd.BuildConfigFromFlags("", kubeconfig) if err != nil { return nil, fmt.Errorf("Could not use current context from %s: %v", kubeconfig, err) } return config, nil }
go
{ "name": "snowpack-demo", "version": "1.0.0", "description": "", "main": "index.js", "dependencies": { "react": "^16.13.1", "react-dom": "^16.13.1", "react-router": "^5.2.0", "react-router-config": "^5.1.1", "react-router-dom": "^5.2.0" }, "devDependencies": { "@babel/plugin-proposal-class-properties": "^7.10.1", "@babel/plugin-proposal-decorators": "^7.10.1", "@babel/plugin-proposal-do-expressions": "^7.10.1", "@babel/plugin-proposal-export-default-from": "^7.10.1", "@babel/plugin-proposal-export-namespace-from": "^7.10.1", "@babel/plugin-proposal-function-sent": "^7.10.1", "@babel/plugin-proposal-json-strings": "^7.10.1", "@babel/plugin-proposal-logical-assignment-operators": "^7.10.1", "@babel/plugin-proposal-nullish-coalescing-operator": "^7.10.1", "@babel/plugin-proposal-numeric-separator": "^7.10.1", "@babel/plugin-proposal-optional-chaining": "^7.10.1", "@babel/plugin-proposal-pipeline-operator": "^7.10.1", "@babel/plugin-proposal-throw-expressions": "^7.10.1", "@babel/plugin-syntax-dynamic-import": "^7.8.3", "@babel/plugin-syntax-export-default-from": "^7.10.1", "@babel/plugin-syntax-import-meta": "^7.10.1", "@babel/plugin-transform-runtime": "^7.10.1", "@babel/preset-react": "^7.10.1", "@snowpack/app-scripts-react": "^1.1.4", "@snowpack/plugin-babel": "^1.0.0", "node-sass": "^4.14.1", "prettier": "^2.0.5", "sass": "^1.26.8", "snowpack": "^2.4.0" }, "scripts": { "start": "snowpack dev --port 8081", "build": "snowpack build", "format": "prettier --write \"src/**/*.{js,jsx}\"", "lint": "prettier --check \"src/**/*.{js,jsx}\"" }, "author": "", "license": "MIT" }
json
import socket from '../socket' /** * ACTION TYPES */ const LOAD_ROOM = 'LOAD_ROOM' const LOAD_MESSAGES = 'LOAD_MESSAGES' const LOAD_MESSAGE = 'LOAD_MESSAGE' /** * INITIAL STATE */ const initialState = { id: 0, host: {}, name: '', size: 0, players: [], spectators: [], messages: [], storyMessages: [], prompt: '', state: '', curPlayer: -1, dieClass: '' } /** * ACTION CREATORS */ export const roomUpdate = room => ({ room, type: LOAD_ROOM }) export const loadMessages = messages => ({ messages, type: LOAD_MESSAGES }) export const loadMessage = message => ({ message, type: LOAD_MESSAGE }) /** * THUNK CREATORS */ export const requestRoomJoin = id => { socket.emit('req_room_join', id) } export const requestRoomLeave = id => { socket.emit('req_room_leave', id) } export const requestRoomMessageCreate = text => { socket.emit('req_room_message_create', text) } export const requestRoomGameStart = () => { socket.emit('req_room_game_start') } export const requestRoomStoryMessageCreate = text => { socket.emit('req_room_story_message_create', text) } /** * REDUCER */ export default function(state = initialState, action) { switch (action.type) { case LOAD_ROOM: return { ...state, ...action.room } case LOAD_MESSAGE: return { ...state, messages: [...state.messages, action.message] } case LOAD_MESSAGES: return { ...state, messages: action.messages } default: return state } }
javascript
use crate::{ hittables::hittable::HitRecord, rays::ray::Ray, utils::{ random_number_utils::random_f64, vec3_utils::{dot, min, reflect, refract, unit_vector}, }, vectors::vec3::Vec3, }; use super::material::Material; use std::option::Option; pub struct Dielectric { pub ir: f64, } impl Dielectric { fn reflectance(&self, cosine: f64, ref_idx: f64) -> f64 { let mut r0 = (1.0 - ref_idx) / (1.0 + ref_idx); r0 = r0 * r0; r0 + (1.0 - r0) * (1.0 - cosine).powf(5.0) } } impl Material for Dielectric { fn scatter(&self, r_in: &Ray, rec: &HitRecord) -> Option<(Ray, Vec3)> { let attenuation = Vec3::new_with_values(1.0, 1.0, 1.0); let refraction_ratio = match rec.front_face { true => 1.0 / self.ir, false => self.ir, }; let unit_direction = unit_vector(r_in.direction()); let cos_theta = min(dot(&-unit_direction, &rec.normal), 1.0); let sin_theta = (1.0 - cos_theta * cos_theta).sqrt(); let cannot_refract = refraction_ratio * sin_theta > 1.0; let direction: Vec3; if cannot_refract || self.reflectance(cos_theta, refraction_ratio) > random_f64() { direction = reflect(&unit_direction, &rec.normal); } else { direction = refract(&unit_direction, &rec.normal, refraction_ratio) } let scattered = Ray { orig: rec.p, dir: direction, }; Some((scattered, attenuation)) } }
rust
The Centre for Science and Environment (CSE), a non-governmental organization based in New Delhi, has set up the Pollution Monitoring Laboratory (PML) to monitor environmental pollution. PML is an ISO 9001:2008 accredited laboratory certified by SWISSCERT Pvt. Ltd. for conducting Pollution Monitoring and Scientific Studies on Environmental Samples. Gurugram (erstwhile Gurgaon), a satellite town in the National Capital Region (NCR) and referred to as a ‘Millennium City’, is one of Haryana’s largest urban centres. What does the decision to save groundwater in Punjab or Haryana have to do with air pollution in Delhi? Plenty. We need to know this because many actions have unintended and deadly consequences. It was way back in 1986 that Rajiv Gandhi had launched the Ganga Action Plan. But years later, after much water (sewage) and money has flowed down the river, it is as bad as it could get. Why are we failing and what needs to be done differently to clean this and many other rivers? The outrage over the suspension of an official, Durga Shakti Nagpal, for simply doing her job—check illegal sand mining in the rivers of Uttar Pradesh—has highlighted a crucial issue. It is now evident that illegal mining of sand from rivers and beaches is rampant and the underbelly of this industry (I’m calling it industry for want of a better word) is powerful and connected. Worse still, all this is happening in violation of the orders of the apex court of the country. The Public Hearing for the Haryana Atomic Power Project at Gorakhpur, Haryana, was held on July 17 in Gorakhpur village. The project concerns the construction of four nuclear power plants, in Gorakhpur Haryana, with a capacity of 700 mega watts (MW) each by Nuclear Power Corporation of India Limited (NPCIL). Panchkula, March 14 2013 The sustainable buildings team of Centre for Science and Environment (CSE) co-organised a half day workshop on March 14, 2013 with the Department of Renewable Energy, Haryana (DRE) and HAREDA (Haryana Renewable Energy Development Agency).The venue of the workshop was the new HAREDA office : Akshay Urja Bhawan, which has received a tentative five star GRIHA rating. The government seems to be succeeding in pushing through the proposal to build a nuclear power plant in Fatehabad district of Haryana. Much of the opposition seems to have melted away after the farmers affected by the project received compensation at the rate of Rs 46 lakh per acre (0.4 hectare) from the Haryana government. When the kerosene supply went down sharply in Nagpur four years ago, Bharat Parihar's business of renting out Petromax lamps to vegetable vendors began to look fragile. New Delhi, February 4, 2009: The burgeoning compact fluorescent lamp (CFL) sector in India is faced with some key concerns, and the most critical of them is the problem of disposal of mercury used in CFLs: this was the consensus at a Round Table meeting on the sector, organised here today by the New Delhi-based research and advocacy organisation, Centre for Science and Environment (CSE).
english
body { margin: 0; font-family: Arial, Helvetica, sans-serif; } /* Page header*/ header{ display: flex; position: fixed; width: calc(100% - 20px); left: 0; padding: 10px; justify-content: space-between; align-items: flex-start; flex-direction: row; } img { width: 350px; height: 170px; } /* Background */ main{ display: flex; flex-direction: column; height: 100vh; justify-content: space-between; align-items: center; background-color: #0962627a; background-position: center; background-image: url("inicio.svg"); background-size: contain; background-repeat: no-repeat; } /* Footer with buttons*/ footer{ position: fixed; left: 0; bottom: 0; width: 100%; background-color: #51341F } #buttons{ display: flex; width: 80%; margin: auto; align-items: flex-end; padding-bottom: 10px; justify-content: center; flex-direction: row; flex-wrap: nowrap; align-content: flex-start; } #btn-play { border-radius: 60px; background-image: url("icons/play.svg"); width: 110px; height: 110px; margin-top: 15px; background-color: #4EA466; } button { width: 70px; height: 70px; font-weight: 500; color: #000; background-color: #A07048; border: none; border-radius: 45px; box-shadow: 0px 8px 15px rgba(0, 0, 0, 0.1); transition: all 0.3s ease 0s; cursor: pointer; outline: none; background-size: 30px; background-position: center; background-repeat: no-repeat; } button:hover, #btn-play:hover, #btn-login:hover { background-color: #26b179; transform: translateY(-7px); } #btn-setting{ position: relative; transform: translateY(0px); left: calc(100% - 70px); } #btn-setting { background-image: url("icons/sound.svg"); } #btn-ranking { background-image: url("icons/ranking.svg"); } #btn-howToPlay { background-image: url("icons/question.svg"); } /* The Modal (background) */ .modal { display: none; /* Hidden by default */ position: fixed; /* Stay in place */ z-index: 1; /* Sit on top */ padding-top: 100px; /* Location of the box */ left: 0; top: 0; width: 100%; /* Full width */ height: 100%; /* Full height */ overflow: auto; /* Enable scroll if needed */ background-color: rgb(0,0,0); /* Fallback color */ background-color: rgba(0, 0, 0, 0.603); /* Black w/ opacity */ } /* Modal Content */ .menu-background{ background-image: url("./menu/menu.svg"); background-size: contain; background-repeat: no-repeat; margin: auto; /*padding: 20px;*/ border: 1px solid rgba(136, 136, 136, 0); width: 500px; height: 500px; } /* The Close Button */ .close { color: #aaaaaa; float: right; font-size: 50px; font-weight: bold; padding-top: 40px; padding-right: 100px; } .close:hover, .close:focus { color: #000; text-decoration: none; cursor: pointer; } .menu-title { position: absolute; } /*#place-1 { color: #DAA520; } #place-2 { color: #A3A2A0; } #place-3 { color: #CD7F32; }*/
css
import React from 'react'; import {getLeafsOfGroup} from '../../../helpers/getLeafsOfGroup'; import Dialog from 'material-ui/Dialog'; import FlatButton from 'material-ui/FlatButton'; import RaisedButton from 'material-ui/RaisedButton'; import SelectField from '../../global/SelectField'; /** Dialog for creating/editing sewing or tacketed attribute */ export default class VisualizationDialog extends React.Component { constructor(props) { super(props); this.state = { startLeaf: null, endLeaf: null, } } componentWillReceiveProps() { this.setState({ startLeaf: null, endLeaf: null, }); } handleChange = (type, value) => { this.setState({[type]:value}); } renderMenuItem = (item, index) => { if (item.id) { return { value:item.id, text:"Leaf " + (this.props.leafIDs.indexOf(item.id)+1), } } else { return { value:"spine", text:"Spine", } } } onCreate = () => { let attributeValue = this.state.startLeaf==="spine"?[this.state.endLeaf]:[this.state.startLeaf,this.state.endLeaf]; this.props.updateGroup(this.props.type, attributeValue); this.props.closeDialog(); } render() { let isCreateAction = (this.props.type!=="" && this.props.group[this.props.type].length===0); const actions = [ <FlatButton label={isCreateAction?"Cancel" : "Close"} primary={true} keyboardFocused={true} onClick={()=>{this.props.closeDialog()}} />, <RaisedButton label={"Submit"} primary={true} onClick={this.onCreate} style={isCreateAction?{marginLeft:10}:{display:"none"}} />, <RaisedButton label={"Remove " + this.props.type} style={isCreateAction?{display:"none"}:{float:"left"}} labelStyle={{color:"#b53c3c"}} onClick={()=>{this.props.delete(); this.props.closeDialog()}} />, ]; let selectFields = []; let leafMembersOfCurrentGroup = [{id:null}].concat(getLeafsOfGroup(this.props.activeGroup, this.props.Leafs, false)); if (isCreateAction) { // Create new sewing/tacket let selectField1 = ( <SelectField key="GroupVizSelect1" id="GroupVizSelect1" floatingLabelText={"Start of " + this.props.type} label={"Start of " + this.props.type} value={this.state.startLeaf} onChange={(v)=>this.handleChange("startLeaf",v)} data={leafMembersOfCurrentGroup.map((v,i)=>this.renderMenuItem(v,0))} />) let selectField2 = ( <SelectField key="GroupVizSelect2" id="GroupVizSelect2" floatingLabelText={"End of " + this.props.type} value={this.state.endLeaf} onChange={(v)=>this.handleChange("endLeaf",v)} data={leafMembersOfCurrentGroup.filter((item) => (item.id !== null && (this.state.startLeaf === null || this.state.startLeaf === "spine" || this.props.leafIDs.indexOf(item.id) > this.props.leafIDs.indexOf(this.state.startLeaf)))).map((v,i,a)=>this.renderMenuItem(v,1))} />) selectFields.push(selectField1); selectFields.push(selectField2); } else if (this.props.type!=="" && this.props.group[this.props.type].length>0) { // Edit existing sewing/tacket const leafStart = this.props.group[this.props.type].length===2? this.props.Leafs[this.props.group[this.props.type][0]] : null; const leafEnd = this.props.group[this.props.type].length===2? this.props.Leafs[this.props.group[this.props.type][1]] : this.props.Leafs[this.props.group[this.props.type][0]]; const data1 = [{ id: null }].concat(leafMembersOfCurrentGroup.filter((item) => (item.id !== null && this.props.leafIDs.indexOf(item.id) < this.props.leafIDs.indexOf(leafEnd.id)+1))); const data2 = leafMembersOfCurrentGroup.filter((item) => (leafStart === null && item.id !== null) || (leafStart !== null && item.id !== null && this.props.leafIDs.indexOf(item.id) > this.props.leafIDs.indexOf(leafStart.id)+1)); let selectField1 = ( <SelectField key="GroupVizSelect1" id="GroupVizSelect1" floatingLabelText={"Start of " + this.props.type} value={leafStart!==null?leafStart.id:"spine"} onChange={(v)=>this.props.handleTacketSewingChange(this.props.type, v, 0)} data={data1.map((v,i)=>this.renderMenuItem(v,0))} />) let selectField2 = ( <SelectField key="GroupVizSelect2" id="GroupVizSelect2" floatingLabelText={"End of " + this.props.type} value={leafEnd.id} onChange={(v)=>this.props.handleTacketSewingChange(this.props.type, v, 1)} data={data2.map((v,i)=>this.renderMenuItem(v,1))} />) selectFields.push(selectField1); selectFields.push(selectField2); } return ( <div> <Dialog title={isCreateAction? "Add " + this.props.type + " attribute" : "Edit " + this.props.type + " attribute"} actions={actions} modal={false} open={this.props.open} onRequestClose={()=>this.props.closeDialog()} contentStyle={{width: "30%", minWidth:"320px", maxWidth:"450px"}} > {selectFields} </Dialog> </div> ); } }
javascript
<reponame>wangyeIsClever/myProject package GOF23.A1_abstractFactory; public class BenzFactory implements CarFactory{ public Engine createEngine() { return new BenzEngine(); } public Wheel createWheel() { return new BenzWheel(); } public Chassis createChassis() { return new BenzChassis(); } }
java
<reponame>Malien/wasm-web-checkers<filename>src/rs/checkers/checkers-rs-bin/src/main.rs use std::time::Instant; use checkers_rs::{alphabeta, minimax, Board, Player, Position}; fn main() { let mut board = Board::default(); // let position = unsafe { Position::new_unchecked(2, 5) }; // match checkers_rs::moves_for(&board, position) { // None => { // println!("Cell {:?} is not a piece", board.cell_at(position)); // } // Some(moves) => { // let mvs: Vec<_> = moves.iter().map(|mv| mv.to).collect(); // println!("Moves: {:?}", mvs); // } // } println!("{}", board); // SAFETY: This is fine, since I'm not dumb to pass in wrong values for Position construction unsafe { println!("{:?}", board.cell_at(Position::new_unchecked(1, 0))); println!("{:?}", board.cell_at(Position::new_unchecked(0, 5))); println!("{:?}", board.cell_at(Position::new_unchecked(0, 0))); println!("{:?}", board.cell_at(Position::new_unchecked(0, 3))); board.move_cell(Position::new_unchecked(0, 5), Position::new_unchecked(1, 4)); } println!("{}", board); println!("{:?}", checkers_rs::alphabeta(&board, Player::White, 3)); // benchmark(); } fn benchmark() { let board = Board::default(); for search_depth in 2..=7 { for iteration in 0..5 { let start_time = Instant::now(); let _ = minimax(&board, Player::White, search_depth); println!( "rs-native\tminimax\t\t{}\t{}\t{}", iteration, search_depth, start_time.elapsed().as_millis() ) } } for search_depth in 2..=12 { for iteration in 0..5 { let start_time = Instant::now(); let _ = alphabeta(&board, Player::White, search_depth); println!( "rs-native\talphabeta\t{}\t{}\t{}", iteration, search_depth, start_time.elapsed().as_millis() ) } } }
rust
As the heatwave severely impacts public life, with an air quality index (AQI) score of 158 at 9:40 am today (April 17, 2023), Dhaka ranked 5th in the list of cities worldwide with the worst air quality. India’s Delhi, Nepal’s Kathmandu and Thailand’s Chiang Mai occupied the first three spots in the list, with AQI scores of 228, 198 and 165, respectively. An AQI between 101 and 150 is considered 'unhealthy', AQI between 201 and 300 is said to be 'very unhealthy', while a reading of 301+ is considered 'hazardous', posing serious health risks to residents. In Bangladesh, the AQI is based on five criteria pollutants -- Particulate Matter (PM10 and PM2.5), NO2, CO, SO2 and Ozone. Dhaka has long been grappling with air pollution issues. Its air quality usually turns unhealthy in winter and improves during the monsoon. Air pollution consistently ranks among the top risk factors for death and disability worldwide. As per the World Health Organization (WHO), air pollution kills an estimated seven million people worldwide every year, largely as a result of increased mortality from stroke, heart disease, chronic obstructive pulmonary disease, lung cancer and acute respiratory infections.
english
use std::os::unix::ffi::OsStrExt; use std::{env, ffi, ptr, path}; use libc; use UNKNOWN_EXECUTABLE; pub fn execv_if_possible(program_path: &path::Path) -> i32 { if program_path == path::Path::new(UNKNOWN_EXECUTABLE) { print_err!("Couldn't restart using exec: executable unknown! See previous \"failed to \ find current executable\" error."); return 1; } // We're just going to exit the program anyways if we succeed or fail, so this function won't do anything other than unwrap IO errors. // Get the program as a CString let program = ffi::CString::new(program_path.as_os_str().as_bytes()).unwrap(); // Argument vector, passed to execv. let mut argv_vec = Vec::new(); // Printable argument vector, used for printing arguments before executing. let mut printable_args = Vec::new(); // We don't use skip(1) on env::args() here, because the execv() needs the first argument to // be the program, just like env::args(). for arg in env::args() { // Just use &*arg so that printable_args can then have the ownership. argv_vec.push(ffi::CString::new(&*arg).unwrap().as_ptr()); printable_args.push(arg); } // Push a null pointer so that argv_vec is null terminated for execv. argv_vec.push(ptr::null()); println!("Executing `{:?}` (arguments: `{:?}`", program_path, printable_args); unsafe { libc::execv(program.as_ptr(), argv_vec.as_mut_ptr()); } print_err!("Executing using execv failed!"); return 1; }
rust
Talent brings success and fame. But only professionalism provides a long career in the film industry. Many talented celebrities faded out soon due to their attitude. A young hero is gaining such a name. He has delivered a massive blockbuster recently and is hailed as the most promising star. From script to production, he involves and interferes in everything. He reportedly changes shooting schedules according to his moods. Producers have to do whatever he demands. Directors on these projects have little say. One of his projects is having a lot of problems as the film’s heroine is also giving trouble to the makers. But sulking producers say he should change his attitude and turn professional otherwise despite the enormous talent he would not see growth in his career.
english
<gh_stars>1-10 { "Name": "Poignée pistolet Izhmash pour PP-19-01", "ShortName": "P.Pist PP-19-011", "Description": "Poignée pistolet Izhmash pour pistolet mitrailleur Vityaz et carabine Saiga-9." }
json
{ "type": "dishwasher", "model":"LG", "text": "LG Dishwashers Have Connect WiFi connectivity Fully or Semi integrated With DoorOpen Assist , Free Standing Dishwashers And Compact", "source_link": "http://www.lg.com/uk/dishwashers/all-dishwashers", "manual":"LGDishwasher.pdf", "price":"230" }
json
Kyrie Irving, when he is on the court, is one hell of a player, isn’t he? The man’s flash and flare with the ball in his hands is something close to unprecedented in NBA history. It’s almost like the very essence of New York’s historic street basketball style wasn’t just breathed, it was heaved into the NBA. Of course, with that king of game, also come the fans who want to copy him. They want to copy everything he does, every jersey he wears, and of course, every shoe he puts on. And because of this, his signature line with Nike has been just so profitable for both him and the company. The thing is though, according to recent reports the shoe line may be discontinued. In fact, the man may not even remain a Nike athlete for too long. Allow us to explain exactly what’s going on here. As we said earlier, when he is on the court, Kyrie Irving is one hell of a player. The problem is, those times aren’t exactly the most consistent ones in the world. Every season, the player experiences one reason or another to miss large chunks of the season. Injuries, of course, are justified. But, apart from that, the athlete has been known to take games off for a multitude of different reasons. And of course, he even missed most of this past regular season because he refused to take the vaccine. These could be nice to further the different causes he pays attention to, and believes he must do something about. But, one of the consequences are that, his marketability drops significantly. And as a result of that reality... well this report has surfaced. Take a look at the Instagram post below. Kyrie Irving’s current deal at Nike has been valued at $11 million, which frankly, seems like a small price to pay, given the profits his shoes bring to the company. Whether this man plays or not, the fact of the matter is, Kyries have become a staple amongst fans who like to dabble in the sport. What’s more is, they are pretty darn popular amongst pure sneakerheads as well. All things considered, if this report is indeed true, Nike could be on the verge of a catastrophic mistake here. And frankly, it is one we’d hate to see happen.
english
Dusseldorf (Germany), June 3 (IANS) The Indian men’s hockey team conceded two late goals in the final quarter to go down 1-2 to Belgium in their opening match of the three-nation invitational tournament here. Despite taking a 1-0 lead in the third quarter through a splendid penalty corner conversion by Harmanpreet Singh, India conceded two goals via Cedric Charlier (52nd minute) and Tom Boon (55th) in the final quarter to lose the tie on Friday. Riding high on their impressive 5-2 win against Germany in their first match on Thursday, Belgium got off the block against India with vigour. But the Indian defence led by Rupinder Pal Singh, Harmanpreet and Surender Kumar, who played his 50th international match, prevented the Belgian side from taking an early lead. After ending the first quarter in a stalemate, India were quick to earn their first penalty corner or PC in the 19th minute. Though dragflicker Harmanpreet’s attempt was well-struck and fierce, it was blocked by the Belgian defender’s stick thus missing out on a 1-0 lead. But soon after, India forward Ramandeep Singh, who is back in action after an injury break, did well to win the team their second PC. He was tactical with his dribble to find the foot of Belgian defender inside the striking circle. However, Belgium goalkeeper Jeremy Gucassoff denied India an early celebration as he came up with an impressive save to keep Harmanpreet from converting the goal, and ended the second quarter with the score reading 0-0. The 10-minute break saw some vital strategic changes brought in by chief coach Roelant Oltmans as India came up with an improvised attack. It paid off with the team winning their fourth PC of the match only minutes into the third quarter but Harmanpreet was unlucky yet again as his fiercely-struck flick was blocked away by the Belgian defenders. Though he was quick to get the rebound and attempt a reverse hit on goal, he was slightly off target with the ball hitting the crossbar. However, the lost attempts did little to dent his spirit as he scored in India’s fifth attempt at PC and earned the much-needed 1-0 lead in the 38th minute of the match. A stylish dragflicker that he is, Harmanpreet beautifully struck the ball to the bottom right of the Belgium keeper giving him no chance to defend. There was plenty of action in the fourth quarter with Belgium coming back into the game by earning their first PC of the match. Though India’s defence denied them a goal, Charlier succeeded in winning an equaliser for his team in the 52nd minute with a field goal. Though Belgium won back-to-back PCs soon after, Surender was impressive in his defence to deny them the opportunity. But India ended up conceding their second goal when Boon converted a PC in the 55th minute to win the match.
english
Pakistan’s wicketkeeper-batter Kamran Akmal has hailed the Indian cricket system for grooming young players by giving them opportunities at the top level. According to Akmal, by doing so, the Indian cricket team is constantly building towards the future. A young Team India, led by Shikhar Dhawan in the absence of a number of senior players, whitewashed West Indies 3-0 in the recently-concluded one-day series. Reflecting on India’s impressive performance in the series, Akmal attributed the triumph to an ever-growing pool of talent in the country. Speaking on his official YouTube channel, he opined: Akmal continued: India won the one-day series in West Indies without regular skipper Rohit Sharma and seniors like Virat Kohli, Jasprit Bumrah, Rishabh Pant and Hardik Pandya. Speaking about the major positives for India from the West Indies ODIs, Akmal stated that the performances of upcoming players like Shubman Gill stood out. He said: “The biggest positive for India from the West Indies series has been the performance of the bench strength. India will not have a problem when big names like Rohit, Kohli and Dhawan retire because players like Shubman Gill will take over the mantle and ensure that Indian cricket keeps moving forward in the right direction." Impressed by Gill’s batting, he added: Gill was the Player of the Series for scoring 205 runs at an average of 102.50 and a strike rate of over 100. He registered a career-best ODI score of 98* in the third one-dayer on Wednesday, July 27.
english
<reponame>DenisKolesnik/TIL<gh_stars>0 # Pairwise test with PICT ### Pict moded, output, json data
markdown
Pitanje: Da li se umnogostručuje nagrada za udjeljivanje sadake u posljednjoj trećini ramazana ili se ovi dani odlikuju noćnim namazomi i zikrom u noćima tih dana? Pitanje: Da li se umnogostručuje nagrada za udjeljivanje sadake-milostinje u posljednjoj trećini ramazana ili se ovi dani odlikuju noćnim namazomi i zikrom u noćima tih dana? Odgovor: Sva hvala pripada Allahu; Preneseno je od Poslanika, sallallahu alejhi ve sellem, da je oživljavao posljednih deset dana ramazana namazom i zikrom. Udjeljivanje milostinje je vrijednije u ramazanu u odnosu na druge mjesece, i nije nam poznato iz Sunneta da se posebno nagrađuje za udjeljivanje milostinje u zadnjoj trećini ramazana. Učenjaci smatraju da bilo koje djelo koje se uradi u odlikovanom vremenom da se, isto tako, posebno nagrađuje, a nema sumnje da je posljednih deset noći vrijednije od drugih noći, gdje se noć lejletu-l-kadra posebno odlikuje, a koja je bolja od hiljadu mjeseci. Nije sporno da musliman u ramazanu bude širokogrudniji i umnogostruči svoje udjeljivanje sadake. Naš Poslanik, sallallahu 'alejhi ve sellem, bio je najdarežljiviji čovjek, a najviše je udjeljivao upravo u ramazanu. (Buhari, br. 6., Muslim, br. 2308.) Naučna klasifikacija:
english
<reponame>sadanand-singh/blog_nevola_archive { "private": true, "version": "1.0.0", "license": "MIT", "name": "reckoning.dev", "description": "Sadanand Singh's Notes", "author": "<NAME> <<EMAIL>>", "repository": "<EMAIL>:sadanand-singh/reckoning.dev", "scripts": { "build": "gatsby build && cp -R _redirects public/", "dev": "gatsby develop", "clean": "gatsby clean" }, "dependencies": { "@narative/gatsby-theme-novela": "^0.11.3", "gatsby": "^2.18.17", "gatsby-plugin-google-analytics": "^2.1.31", "gatsby-plugin-mailchimp": "^5.1.2", "gatsby-plugin-manifest": "^2.2.34", "gatsby-remark-katex": "^3.1.20", "gatsby-remark-responsive-iframe": "^2.2.30", "highcharts": "^8.0.0", "highcharts-react-official": "^2.2.2", "katex": "^0.11.1", "react": "^16.12.0", "react-dom": "^16.12.0", "react-image-gallery": "^1.0.3", "react-twitter-widgets": "^1.7.1" } }
json
export const OSU_API_URL = 'https://osu.ppy.sh/'; export const CLIENT_ID = 6010;
typescript
Former US President Donald Trump who has been kicked out of most social media platforms following the Capitol Hill violence unleashed by his supporters earlier this year has hit out the likes of Facebook and Twitter. "He used to come to the White House to kiss my a**," Trump told Gutfeld of Zuckerberg. "And I'd say, 'Oh, that's nice. ' I have the head of Facebook coming with his lovely wife. “You know, when I went onto Twitter like 12 years ago, Twitter was a failed operation and it became successful and a lot of people said I had a lot to do with it,” he said. Before he was permanently banned by Twitter, Trump's account was one of the most followed on the platform. Trump also spoke about his class-action lawsuits against Facebook, Twitter, and YouTube, over allegations that they silenced conservatives on their platforms and invited "anyone who wants to join" to become a plaintiff in the plea.
english
{ "AzureAd": { "Instance": "https://login.microsoftonline.com/", "TenantId": "", "ClientId": "", "ApplicationIdURI": "", "AppSecret": "", "AuthUrl": "/oauth2/v2.0/token", "ValidIssuers": "https://login.microsoftonline.com/TENANT_ID/v2.0,https://sts.windows.net/TENANT_ID/" }, "Logging": { "LogLevel": { "Default": "Information", "Microsoft": "Warning", "Microsoft.Hosting.Lifetime": "Information" } }, "AllowedHosts": "*", "AzureClientId": "", "SharePointClientId": "", "AppSecret": "", "Resource": "", "ListId": "", "StorageTableEndPoint": "", "TenantSharePointDomain": "https://contosotown.sharepoint.com", "BaseUrl": "update your baseurl", "GroupsEndPoint": "https://graph.microsoft.com/v1.0/groups/", "TeamId": "", "TeamMembersCount": 8, "UsersEndPoint": "https://graph.microsoft.com/v1.0/users/", "TeamsConfiguration": { "DeepLinkBaseUrl": "https://teams.microsoft.com/l/entity/", "TrainingVideoUrl": "", "ChannelChatUrl": "", "ShiftsAppId": "", "TasksAppId": "", "NewsAppId": "", "PayStubsAppId": "", "BenefitsAppId": "", "RewardsAppId": "", "KudosAppId": "", "SurveyAppId": "", "SupportAppId": "", "TrainingAppId": "", "PortalAppId": "", "InsightsAppId": "", "ReportAppId": "", "TeamId": "", "HandBookUrl": "" }, "ApplicationInsights": { "InstrumentationKey": "" } }
json
Former ONE flyweight Muay Thai world champion ‘The General’ Jonathan Haggerty is heading into perhaps the biggest fight of his professional career. However, he’s already looking ahead to a potential future. The 26-year-old Englishman will be looking to capture the ONE bantamweight Muay Thai world title tonight when he takes on reigning champion Nong-O Hama at ONE Fight Night 9 in Bangkok, Thailand. Haggerty is confident of victory and says that after taking Muay Thai gold, he will be coming for the kickboxing belt, currently held by Nong-O’s friend Petchtanong Petchfergus. During a recent interview with The MMA Superfan, Jonathan Haggerty went as far as saying that Petchtanong would be an easier fight than Nong-O: Watch the interview below: ‘The General’ will lock horns with the legendary Nong-O Hama for the ONE bantamweight Muay Thai world title at ONE Fight Night 9. The event broadcasts live from the iconic Lumpinee Boxing Stadium tonight, April 21, and will stream for free to fans in the United States and Canada with a Prime Video subscription. Haggerty is moving up in weight officially to challenge Nong-O for the belt. Both men made weight and hydration, with Nong-O coming in at 144 pounds, while Haggerty clocked in at 143. 5 pounds. Both Jonathan Haggerty and Nong-O Hama appear ripped and ready to put on a show for the fans. Stay tuned to Sportskeeda for live results from ONE Fight Night 9: Nong-O vs. Haggerty on Prime Video, as the event happens.
english
<filename>src/app/core/services/mqtt/mqtt-service.ts import { Injectable } from '@angular/core'; /** Configurações. */ import { CONFIGURACOES_MQTT } from './config/configuracoes'; /** Environment. */ import { environment } from 'src/environments/environment'; /** MQTT - https://www.npmjs.com/package/mqtt */ import * as mqtt from 'mqtt'; /** HI BASE 32 - https://www.npmjs.com/package/hi-base32 */ import { encode } from 'hi-base32'; /** OTPLIB - https://github.com/yeojz/otplib */ declare var otplib: any; /** HMAC (SHA-1) - https://caligatio.github.io/jsSHA/ */ declare var jsSHA: any; /** PAKO - http://nodeca.github.io/pako/ */ declare var pako: any; @Injectable({ providedIn: 'root' }) export class MqttService { static mqttService: any = {}; public static abrirConexao(clientId: number) { if (!MqttService.mqttService.client) { MqttService.mqttService.clientId = `${clientId}-${Math.floor((Math.random() * 999999999) + 1)}`; MqttService.mqttService.mqtt = mqtt; MqttService.mqttService.host = environment.mqtt.host; MqttService.mqttService.port = environment.mqtt.port; MqttService.mqttService.listaOnMessage = []; MqttService.mqttService.listaManterConexao = []; MqttService.mqttService.listaTimeout = {}; MqttService.conectar(); } } public static conectar() { const opcoesConexao = { clientId: MqttService.mqttService.clientId, protocol: environment.mqtt.protocol, host: MqttService.mqttService.host, port: MqttService.mqttService.port, hostname: MqttService.mqttService.host, path: '/mqtt', protocolId: 'MQTT', protocolVersion: 4, clean: true, reconnectPeriod: 2000, rejectUnauthorized: false, keepalive: 50 }; MqttService.mqttService.client = MqttService.mqttService.mqtt.connect(opcoesConexao); MqttService.mqttService.client.on('connect', function (): any { console.warn('Client conectado'); }.bind(MqttService.mqttService)); MqttService.mqttService.client.on('close', function (): any { console.warn('Client desconectado'); }); MqttService.mqttService.client.on('message', function (topico, message): any { const uuid = MqttService.pegarUuid(topico); const funcao = MqttService.mqttService.listaOnMessage[uuid]; funcao(topico, MqttService.analisarResultado(message)); if (!MqttService.mqttService.listaManterConexao[uuid]) { delete MqttService.mqttService.listaOnMessage[uuid]; if (MqttService.mqttService.listaTimeout[uuid]) { clearTimeout(MqttService.mqttService.listaTimeout[uuid]); delete MqttService.mqttService.listaTimeout[uuid]; } MqttService.mqttService.client.unsubscribe(topico); if (CONFIGURACOES_MQTT.habilitarTopicosSucessoFalha) { let index = topico.indexOf(CONFIGURACOES_MQTT.topicoFalha); if (index > 0) { const subTopico = `${topico.slice(0, index)}${CONFIGURACOES_MQTT.topicoSucesso}${topico.slice(index + 7)}`; MqttService.mqttService.client.unsubscribe(subTopico); } else { index = topico.lastIndexOf(CONFIGURACOES_MQTT.topicoSucesso); const subTopico = `${topico.slice(0, index)}${CONFIGURACOES_MQTT.topicoFalha}/${topico.slice(index + 8)}`; MqttService.mqttService.client.unsubscribe(subTopico); } } } }.bind(MqttService.mqttService)); } public static subscribe(topico, uuid, onMessage, manterConexao) { if (!topico || !uuid || !onMessage) { return false; } if (manterConexao) { MqttService.mqttService.listaManterConexao[uuid] = true; } MqttService.mqttService.listaOnMessage[uuid] = onMessage; if (CONFIGURACOES_MQTT.habilitarTopicosSucessoFalha) { MqttService.mqttService.client.subscribe( MqttService.retornarTopicoSucessoUuid(topico, uuid) ); MqttService.mqttService.client.subscribe( MqttService.retornarTopicoFalhaUuid(topico, uuid) ); } else { MqttService.mqttService.client.subscribe(`${topico}/${uuid}`); } } public static publish(parametrosRequisicao, topico, uuid, timeout) { if (!MqttService.mqttService.client) { return false; } if (timeout) { MqttService.mqttService.listaTimeout[uuid] = setTimeout(function (): any { if (CONFIGURACOES_MQTT.habilitarTopicosSucessoFalha) { MqttService.mqttService.client.unsubscribe(MqttService.retornarTopicoSucessoUuid(topico, uuid)); MqttService.mqttService.client.unsubscribe(MqttService.retornarTopicoFalhaUuid(topico, uuid)); MqttService.mqttService.listaOnMessage[uuid](MqttService.retornarTopicoFalhaUuid(topico, uuid), 'timeout'); } else { MqttService.mqttService.client.unsubscribe(`${topico}/${uuid}`); MqttService.mqttService.listaOnMessage[uuid](`${topico}/${uuid}`, 'timeout'); } }.bind(MqttService.mqttService), timeout); } else { timeout = 0; } const apiKey = `MQTT-CLIENT-WEB-${Math.floor((Math.random() * 999999999) + 1)}`; const secret = encode(`${apiKey}${topico}`); const signature = ''; otplib.authenticator.options = { step: 600, // Tempo em segundos. digits: 6 }; const token = otplib.authenticator.generate(secret); try { otplib.authenticator.check(token, secret); } catch (error) { throw new Error(`Erro ao gerar o token: ${error}`); } const objetoRequisicao: any = { meta: { uuid }, header: { apiKey, signature, nonce: parseInt(token, 10) }, envelope: { parametrosRequisicao, timeout } }; try { const objHmac = new jsSHA('SHA-1', 'TEXT'); objHmac.setHMACKey(apiKey, 'TEXT'); objHmac.update(`${topico}${JSON.stringify(objetoRequisicao.envelope)}`); objetoRequisicao.header.signature = objHmac.getHMAC('HEX'); } catch (error) { throw new Error(`Erro ao gerar o signature: ${error}`); } MqttService.mqttService.client.publish(topico, JSON.stringify(objetoRequisicao), { qos: 2 }); } static retornarTopicoSucessoUuid(topico, uuid) { return `${topico}/${CONFIGURACOES_MQTT.topicoSucesso}/${uuid}`; } static retornarTopicoFalhaUuid(topico, uuid) { return `${topico}/${CONFIGURACOES_MQTT.topicoFalha}/${uuid}`; } public static close() { if (MqttService.mqttService) { MqttService.mqttService.client.end(); delete MqttService.mqttService.client; } // tslint:disable-next-line: forin for (const key in MqttService.mqttService.listaTimeout) { clearTimeout(MqttService.mqttService.listaTimeout[key]); } } static analisarResultado(mensagem: any) { let resposta: any; // tslint:disable-next-line: no-bitwise const bytesDaMensagem = mensagem[0] & 0xff | ((mensagem[1] << 8) & 0xff00); if ((bytesDaMensagem === 0x8b1f)) { resposta = pako.inflate(mensagem, { to: 'string' }); } else { resposta = `${mensagem}`; } try { resposta = JSON.parse(resposta.replace('\n', '')); if (resposta?.[CONFIGURACOES_MQTT.objetoRespostaBackEnd]) { if (resposta[CONFIGURACOES_MQTT.objetoRespostaBackEnd][CONFIGURACOES_MQTT.objetoArrayInternoRespostaBackEnd]) { return resposta[CONFIGURACOES_MQTT.objetoRespostaBackEnd][CONFIGURACOES_MQTT.objetoArrayInternoRespostaBackEnd]; } return resposta[CONFIGURACOES_MQTT.objetoRespostaBackEnd]; } } catch (error) { return 'Resposta inválida do back-end!'; } return null; } static pegarUuid(topico) { return topico.substring(topico.lastIndexOf('/') + 1); } }
typescript
'Cosmic Hand Hitting Wall', the Youngest Nebulae to Hit the Scene dubbed 'Hand of God' How Amazing! The NASA Chandra Xray Observatory has taken a new picture and as the timeless saying goes, a picture is worth a thousand words. After 14 years of data collection and other massively important things Astronomers do, they now have hit some pay dirt. The Nebula MSH 15-20 also known as, the 'Cosmic Hand Hitting A Wall', or simply 'Hand of God', check out the video above to learn even more about it. I have to admit that the name does actually fit pretty well. It shows us just how shape and energy can form some of the creators classics even in a Cosmic magnanimous size. One does wonder, what exactly is this Cosmic Hand coming into contact with is anyones' guess.
english
<filename>.codedoc/node_modules/@codedoc/core/dist/es5/components/misc/github/search.d.ts import { RendererLike, ComponentThis } from '@connectv/html'; export interface SearchOptions { repo: string; user: string; root: string; pick: string; drop: string; label?: string; } export declare function GithubSearch(this: ComponentThis, options: SearchOptions, renderer: RendererLike<any, any>): HTMLElement; export declare const GithubSearch$: any;
typescript
<reponame>33kk/uso-archive { "id": 17124, "info": { "name": "Phrases.org.uk Remove Ad and Black theme", "description": "1. Remove Ad from the left hand side\r\n2. Apply dark theme on the page", "additionalInfo": null, "format": "uso", "category": "phrases", "createdAt": "2009-04-19T20:28:00.000Z", "updatedAt": "2009-04-19T20:28:00.000Z", "license": "NO-REDISTRIBUTION", "author": { "id": 22509, "name": "freewill", "paypalEmail": "<EMAIL>" } }, "stats": { "installs": { "total": 80, "weekly": 0 } }, "screenshots": { "main": { "name": "17124_after.png", "archived": false } }, "discussions": { "stats": { "discussionsCount": 0, "commentsCount": 0 }, "data": [] }, "style": { "css": "@namespace url(http://www.w3.org/1999/xhtml);\r\n\r\n@-moz-document domain(\"www.phrases.org.uk\") {\r\n\r\n*{background-color: transparent !important; color: lightgrey !important;}\r\np{border: none !important;}\r\na{color: lightgrey !important;}\r\na:visited{color: #FF0000 !important; font-weight: bold !important;}\r\na:link{color: #CCCC00 !important; font-weight: bold !important;}\r\n\r\nbody {\r\n\tbackground: #333 url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAFCCAMAAAAHcEfNAAAABGdBTUEAAK/<KEY>\") \r\ntop left repeat-x !important;\r\n}\r\n\r\n\r\n/** Site specific */\r\n#google_ads_frame1 {display: none !important;}\r\n/* .menuitem-front {display: none !important;} */\r\n.meanings-body {\r\nfont-family: trebuchet, arial !important; \r\n}\r\n}\r\n" } }
json
NAIROBI, Kenya, Jul 3 – The government on Friday allayed fears that Swine Fu was likely to spread in the country after the Kenya Medical Research Institute confirmed nine new cases of the virus among 33 visiting British Students. Public Health Minister Beth Mugo said all British medical students were still in quarantine and had been receiving medication to suppress the virus. “The 33 British students and their team leader currently confined at the Duke of Breeze hotel in Kisumu have all been given treatment for Swine Flu having been exposed to the virus by virtue of interaction with the first (34th) case,” she said. She said their treatment was due to end on Friday after which they cannot transmit the deadly A (H1N1) virus. Mrs Mugo assured that the staff at the Duke of Breeze Hotel in Kisumu where the students have been under quarantine, as well as pupils at various schools visited by the Britons, had all tested negative for the flu. The driver of the bus in which the students travelled from Nairobi to Kisumu was also said to be free of the virus. Mrs Mugo said the British students were expected to return to the UK on Sunday. A 20-year old British student from Nottingham University Medical School was on the field trip when realised that he had flu-like symptoms last Saturday and immediately sought medical assistance. He turned out to be the first confirmed case of Swine Flu in Kenya. The students arrived in Kenya on June 21. The British High Commission in Kenya on Friday clarified the students were not in Kenya to conduct health camps. The commission’s spokeswoman Charley Williams said the Britons were in Nyanza to tour projects that they have been raising funds for while back in the UK. Meanwhile, East African Community Partner States have been urged to step up public health education on Swine Flu to avoid panic, after two cases were detected in Kenya and Uganda. A statement from the EAC Secretariat said the Kenyan and Ugandan authorities had instituted appropriate measures to minimise and eliminate the spread of the disease. In the Ugandan case, authorities confirmed that a 40-year-old man who arrived in the country on June 26 from London via Nairobi to Entebbe without any symptoms was later confirmed to have Influenza A (H1N1) on July 1. Ugandan authorities further confirmed that the man was under isolation in Entebbe and in good condition. As of July 1 – according to World Health Organization – the Flu epidemic which started in Mexico two-months ago had already infected 77,201 people and killed 332. WHO has since declared it a pandemic at level six. At level six, there is human-to-human spread, characterised by community level outbreaks in at least one other country in different WHO regions. Designation of this phase indicates that a global pandemic is underway. The symptoms of A (H1N1) include fever, lethargy, lack of appetite, aching body, coughing, runny nose, sore throat, nausea, vomiting and or diarrhoea. The symptoms are very much like those of the common cold. According to the EAC Senior Livestock and Fisheries Officer Timothy Wesonga, the disease can be avoided through good personal hygiene. “It is recommended that hands should be washed thoroughly with soap and water after touching contaminated surfaces. While sneezing or coughing, a handkerchief or tissue should be used. Crowded places should be avoided. People who show influenza-like symptoms should seek medical assistance” advised Mr Wesonga.
english
<gh_stars>1-10 import tensorflow as tf import tflearn import random import numpy as np #X = [[random.random(),random.random()] for x in range(1000)] X = np.random.random([10,4,4,2]) Y = [[0] for x in X] g1 = tf.Graph() g2 = tf.Graph() with g1.as_default(): input_layer = tflearn.input_data(shape=[None, 4, 4, 2]) net = tflearn.conv_2d(input_layer, 256, 3, activation=None) net = tflearn.batch_normalization(net) net = tflearn.activation(net, activation='relu') # block 2 tmp = tflearn.conv_2d(net, 256, 3, activation=None) tmp = tflearn.batch_normalization(tmp) tmp = tflearn.activation(tmp, activation='relu') tmp = tflearn.conv_2d(tmp, 256, 3, activation=None) tmp = tflearn.batch_normalization(tmp) net = tflearn.activation(net + tmp, activation='relu') final = tflearn.fully_connected(net, 1, activation='tanh') sgd = tflearn.optimizers.SGD(learning_rate=0.01, lr_decay=0.95, decay_step=200000) regression = tflearn.regression(final, optimizer=sgd, loss='mean_square', metric='R2') m = tflearn.DNN(regression) with g2.as_default(): input_layer = tflearn.input_data(shape=[None, 4, 4, 2]) net = tflearn.conv_2d(input_layer, 128, 3, activation=None) net = tflearn.batch_normalization(net) net = tflearn.activation(net, activation='relu') # block 2 tmp = tflearn.conv_2d(net, 128, 3, activation=None) tmp = tflearn.batch_normalization(tmp) net = tflearn.activation(net + tmp, activation='relu') final = tflearn.fully_connected(net, 1, activation='tanh') sgd = tflearn.optimizers.SGD(learning_rate=0.01, lr_decay=0.95, decay_step=200000) regression = tflearn.regression(final, optimizer=sgd, loss='mean_square', metric='R2') m2 = tflearn.DNN(regression) m.fit(X, Y, n_epoch = 10) print(m.predict( [X[0]] )) with g1.as_default(): m.save('m1') m2.fit(X, Y, n_epoch = 10) print(m.predict( [X[0]] )) with g2.as_default(): m2.save('m2')
python