text
stringlengths
1
1.04M
language
stringclasses
25 values
3The men of Judah said to their relatives of the tribe of Simeon, “Come with us to the land that has been allotted to us, and fight together with us against the Canaanites. Then we'll do the same for you and your allotted land.” So the tribe of Simeon joined with them. 4The men of Judah attacked the Canaanites and Perizzites, and the Lord handed them over in defeat. They killed ten thousand of the enemy at the town of Bezek. 5There they confronted Adoni-bezek and fought with him, defeating the Canaanites and Perizzites. 6Adoni-bezek ran away, but they chased after him and captured him, and then cut off his thumbs and big toes. 7Adoni-bezek said, “I had seventy kings with their thumbs and big toes cut off picking up left-overs from under my table. Now God has paid me back in the same way what I did to them.” They took him to Jerusalem where he died. 8The men of Judah attacked Jerusalem and conquered it. They killed the inhabitants with the sword and burned the town down. 9After this the men of Judah went to fight against the Canaanites living in the hill country, in the Negev, and in the foothills of the lowlands. 10They attacked the Canaanites who lived Hebron (previously known as Kiriath Arba) and defeated Sheshai, Ahiman, and Talmai. 11From there they went on to attack the people living in Debir (previously known as Kiriath Sepher). 13Othniel, son of Kenaz, Caleb's younger brother, was the one captured it, so he gave him his daughter Acsah in marriage. 15“Please give me a blessing,” she replied. “You gave me land that's like the desert, so please give me springs of water as well.” So Caleb gave her the upper and lower springs. 16The descendants of Moses' father-in-law, the Kenite, went with the people of Judah from the city of palms to the wilderness of Judah in the Negev near Arad where they settled among the people. 17Then Judah joined Simeon and defeated the Canaanites living in Zephath. They completely destroyed the town, so they named it Hormah. 18Judah also captured the towns of Gaza, Ashkelon, and Ekron, each with its surrounding territory. 19The Lord was with Judah, and they took over the hill country, but they could not drive out the people living on the plain because they had iron chariots. 20As Moses had stipulated, Hebron was given to Caleb, who drove out from it the descendants of three sons of Anak. 21However, Benjamin could not drive out the Jebusites, the inhabitants of Jerusalem, so the Jebusites live among the people of Benjamin in Jerusalem to this very day. 22The descendants of Joseph went and attacked the town of Bethel, and the Lord was with them. 23They sent spies to investigate Bethel, which was previously known as Luz. 25The man showed them the way into the town, and they killed all the inhabitants except the man and his family, whom they let go. 26The man moved to the country of the Hittites, and built a town there and called it Luz, which is its name to this day. 27However, Manasseh didn't drive out the people living in the towns of Beth Shan, Taanach, Dor, Ibleam, Megiddo and their surrounding villages because the Canaanites insisted on living in the land. 28When the Israelites grew stronger, they made the Canaanites do forced labor, but they never completely drove them out. 29Ephraim didn't drive out the Canaanites living in the town of Gezer, so the Canaanites went on living there among them. 30Zebulun didn't drive out the people living in the towns of Kitron and Nahalol, so the Canaanites went on living there among them. However, the Canaanites were made to do forced labor for the people of Zebulun. 31Asher didn't drive out the people living in the towns of Acco, Sidon, Ahlab, Achzib, Helbah, Aphik, and Rehob, 32so the people of Asher went on living there among the Canaanite inhabitants of the land because they hadn't driven them out. 33Naphtali didn't drive out the people living in the towns of Beth-shemesh and Beth-anath. So the people of Asher went on living there among the Canaanite inhabitants of the land because they hadn't driven them out. However, the people of Beth-shemesh and Beth-anath were made to do forced labor for the people of Naphtali. 34The Amorites pushed the people of Dan back into the hill country—they did not let them come down into the lowlands. 35The Amorites insisted on remaining in Mount Heres, Aijalon, and Shaalbim, but when the tribes of Joseph grew stronger, the Amorites were made to do forced labor. 36The border with the Amorites ran from Scorpion Pass through Sela and on up from there.
english
{"title":"<NAME> (T) (1R256T)","text":"Set:\tThe Fellowship of the Ring\nKind:\tShadow\nCulture:\tSauron\nTwilight:\t5\nCard Type:\tMinion • Orc\nStrength:\t9\nVitality:\t4\nSite:\t6\nGame Text:\tFor each companion you can spot, this minion is strength +1.\nLore:\tSauron's hatred lives in the hearts of his minions.\nRarity:\tR\nNotes:\tTengwar","scanUrl":"https://lotrtcgwiki.com/wiki/_media/cards:lotr01256t.jpg"}
json
The first look of Manoj Bajpayee’s role of a gay professor in director Hansal Mehta’s next film ‘Aligarh’ is out. In the picture, award winning actor Manoj Bajapyee with his grey hair, beard and a brown suit, is seen clinging on to his bag. Director Hansal Mehta, who won National Award for his last release ‘Shahid’, is also co-producing Aligarh. ‘Aligarh’ is reportedly based on the real life incident of Dr Shrinivas Ramchandra Siras, who was terminated from his job because of his sexuality. Siras, who was the professor of Marathi at the Aligarh Muslim University, later committed suicide. Rajkummar Rao, who was also part of Shahid, will play the role of a journalist in the film, which is likely to release later this year. Click for more updates and latest Bollywood news along with Entertainment updates. Also get latest news and top headlines from India and around the world at The Indian Express.
english
<filename>Modules/Newsletter/module.json { "name": "Newsletter", "alias": "newsletter", "description": "The CynoInfotech Newsletter Module.", "order": 100, "providers": [ "Modules\\Newsletter\\Providers\\NewsletterServiceProvider" ] }
json
Former Premier League forward Noel Whelan has urged Liverpool to sign an out-and-out number 9 this summer. Transfer expert Fabrizio Romano reported that Sadio Mane has made up his mind on leaving Liverpool this summer. With Bayern Munich chasing the signature of the Senegalese international, the Reds will need to look for a capable replacement. Whelan has insisted that the Merseyside club would benefit from the signing of a natural centre-forward. He has advised the Reds to follow in the footsteps of Manchester City, who have also bolstered their forward line with two strikers. They signed Argentine attacker Julian Alvarez in January and continued to make a statement by signing Erling Haaland earlier this month. Whelan told Football Insider: “There may well be a thought of getting a natural number nine this summer after looking at that. Especially after Man City have gone out and done just that already. I think it would certainly help them break teams down and score these all-important goals. " Whelan has insisted that Liverpool have plenty of creators in their squad but lack a figure like Reds legends John Aldridge and Ian Rush. He added: Liverpool haven't had an out-and-out number 9 up front featuring on a weekly basis for a long time now. The only natural striker they had was Divock Origi who decided many games on his own but was never a regular in the starting XI. The Reds have played three finals this season and have failed to score a single goal despite being the side dominating possession. They won the Carabao Cup and FA Cup finals against Chelsea on penalties while losing the Champions League final against Real Madrid. They have also drawn in all six games against the Premier League's top four - Manchester City, Chelsea and Tottenham Hotspur - this campaign. Adding a natural finisher to the side could help the Reds become more decisive in big games. With Manchester City significantly strengthening up front, the Reds cannot afford to fall behind their biggest challengers. According to Portuguese newspaper Correio da Manha, via Sport Witness, the Reds are ready to 'do everything' in their power to sign Benfica striker Darwin Nunez. The Uruguay international could prove to be exactly the player the Reds have been craving for.
english
RRR is undoubtedly the most awaited magnum opus of the Indian film industry. Rajamouli is making sure to promote it as an international film by casting actors belonging to various nationalities. While NTR and Ram Charan are playing protagonists in it, Ajay Devgan, Alia Bhatt, Olivia Morris, and Shriya Saran are playing the leading roles. NTR’s Ramaraju for Bheem teaser shook Youtube with its skyrocketing views. It showcased NTR in a ripped avatar with enticing emotions. While NTR is playing the role of Komaram Bheem in RRR, Ram Charan is essaying Alluri Sitaramaraju’s character. Jakkanna is canning the scenes on the leading star cast currently in Hyderabad. Grapevine says that NTR will appear as an old man in a scene that is going to be the major highlight of RRR. This getup is touted to be extraordinary and NTR’s fans started circulating the scoop on social media lately. Rajamouli is going to finish the portions of NTR by February and the latter will start Trivikram’s Ayinanu Poyi Ravale Hastinaku from March.
english
Liverpool have undoubtedly been one of the most formidable sides in Europe for the past few years now. The Reds have been extremely clever with their recruitment under Jurgen Klopp and have barely misfired in terms of their transfer targets. The Reds have some world-class players in every position and have a very reliable bench for rotational purposes as well. However, former Premier League defender Damien Delaney believes that this Liverpool side is not nearly as perfect as it seems. He has highlighted one such area where he believes the Reds need to strengthen up. While speaking on the YouTube channel Off The Ball, Delaney suggested that Jurgen Klopp should add more quality to their midfield. The Irishman said: James Milner has been a great servant to the Merseyside club throughout his tenure, but at 36, he's in the twilight of his career and can only fill in on a few occasions. Jordan Henderson will be 32 in the summer and Liverpool do benefit hugely from having a leadership figure like him in midfield. However, Delaney thinks he has shown signs of slowing down. “Henderson’s slowing down a little bit now, that’s probably the one area where they have weakness. In an amazing team, that’s probably the one area where they could strengthen. Midfield is an area Liverpool could look at in the summer." The Reds lost Georginio Wijnaldum on a free last summer as he left to join Paris Saint-Germain. However, the manager has trusted the likes of Curtis Jones and Harvey Elliot to handle the responsibilities of the first team. The young stars have repaid his faith well. As such, the Merseyside club have not faced any harm from not bringing in a midfielder before the season began. Jurgen Klopp's men will visit Pep Guardiola's side at the Etihad on Matchday 32 on April 10 in the English top-flight. This is a fixture that could potentially decide the winners of the season. Over the last few years, this has been a nail-biting rivalry in England. The two teams have put on a spectacle whenever they have clashed against each other. When they faced-off on Liverpool's home soil earlier in the season, it was a gripping affair that ended 2-2. The visitors trail Manchester City by only one point, who are at the top of the division with their tally of 73. It would be interesting to see how the title hopes shift after 90 minutes of enthralling football at the Etihad.
english
.delay-800 { animation-delay: 800ms; }
css
<reponame>rbins-swap-team/NoosDrift<gh_stars>0 { "protected": "false", "title": "MK Form test 144", "summary": "MK testing forms 144", "tags": ["tag1","tag2","tag3"], "simulation_type": "forward", "simulation_start_time": "2019-12-19T01:00:00Z", "simulation_end_time": "2019-12-22T20:00:00Z", "drifter_type": "oil", "drifter_name": "heavy crude oil", "total_mass": 5000, "geometry": "point", "lon": "10.6", "lat": "57.9", "radius": 0, "number": 1000, "release_times": "2019-12-19T01:00:00Z", "cone": true, "twoDthreeD": "3D", "beaching": true, "buoyancy": true, "dissolution": true, "evaporation": true, "horizontal_spreading": true, "natural_vertical_dispersion": true, "sedimentation": true }
json
Gift Ideas for libra bestie – September is just round the corner and you must be grappling with ideas what to gift your Libra bestie whose birthday is just round the corner. Like water fertilizes earth, she makes your a better person by her support, care and even loving insults. That is the spirit of your friendship and there is no one who can replace her in your life. Obviously, she deserves the best gift from you on her birthday. You are not alien to her behavioral pattern, her likes and dislikes but ideas fail you sometimes when it comes to brainstorm the perfect gift idea for her, we completely understand. When you have a Libra bestie, you need to know that she is a sucker for balance in her life and enjoys her personal space as much as she likes to be in a group. She is the seventh sign of zodiac calendar who radiates charm and has stickler for all things beautiful. Here are some Gift Ideas for libra bestie : Classy clothes: She vouches for fuss-free dressing and buys into only classy stuff. Gift her something that matches her immaculate sense of aesthetics. Opt for the clear-cut and elegant designs which are timeless like a branded trenchcoat or a cool sweater. Sophisticated jewelry: She is repelled to the idea of wearing anything garish so classy knick-knacks will score well with her. The one that you give her should not be ostentious because she has a discriminating eye and stylish taste. Jewelry to her is adding a little sparkle to the monotony as opposed to the flambuoyant ideas of Leo and high on monetary worth like the Taurus. When you are choosing jewelry for your Libra, you won’t need to break your bank but will need to have selectively classy taste, just the way she has. Good fragrances: When someone like everything urbane, gift her perfumes, she will go all lovestruck. If you really want to sweep your bestie off her feet, make no delays to buy her branded perfumes whose fragrance is warm and delicate. The floral fragrances, for that matter will be your best bargain. Here are the two brand suggestions for you, Paco Rabane or Elizabeth Taylor. Something artistic: In the same vein as dressing to the nines, your Libra girlfriend likes to deck up her home and keep things in order too. The distinctive feature about a Libra is that they are very much fond of art and will always have a favorite genre. If you gift her something from the said genre, she will be over the moon instantly. You can also contemplate gifting her artistic flower vases, faux plants, scented candle holders, some classy wall décor or rugs. Throw her a party: The best thing about a Libra is she is very easy-going and loves to hang out with like minded people. No wonder, she becomes popular among a group in a jiffy for her breezy ways. The best gift you can give your bestie is to throw her a party where she can enjoy in her level of merriment. Gift Ideas for libra bestie – We really hope your bestie likes your gift, all the best!
english
Yes the lovely Ileana Dcruz was found stripping. Here is the full story. It`s all due to the mischief of Saif Ali Khan this funny incident occurs in 'Happy Ending'. One of the funniest scenes of the film, Saif Ali Khan teaches Ileana Dcruz how to ask for a hitch hike. Saif tells Ileana to strip for a lift. And Ileana Being a sport decides to strip. So right in the middle of Pacific Coast highway (Highway between San Fransisco to Los Angles) , Ileana dcruz stripes right up to get a ride ! ! ! All set to release on the 21st November, Eros International's and Illuminati Films Happy Ending stars Saif Ali Khan, Ileana Dcruz, Govinda , Kalki and Ranvir Shorey. Follow us on Google News and stay updated with the latest!
english
Remember Me? What's New? before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. விரும்பத்தகாத தளங்களை கூகிள் தேடலில் (Google Search) தவிர்ப்பது எப்படி? Last Post By: Copyright © 2010-2023 DragonByte Technologies Ltd.
english
The bill for bifurcation of Andhra Pradesh was Monday tabled in the state assembly amid protests by legislators from Rayalaseema and coastal Andhra regions . Amidst noisy scenes, the Assembly Secretary Raja Sadaram read out the letter sent by the President and the brief contents of the bill. Legislators from the two sides stormed the Speaker's podium, holding placards and raising slogans in support of their respective demands, and disrupted the proceedings. The legislators from Telangana Rashtra Samithi (TRS) stood as a wall to fend off their counterparts from Seemandhra (Rayalaseema and coastal Andhra) who were raising slogans opposing the bifurcation. Following uproar, the Speaker adjourned the House for 30 minutes. While Speaking at the media point in the Assembly premises the Telangana legislators, hailed that the introduction of the bill as the historic occasion However, Other side Seemandhra leaders denounced the manner in which the government introduced the bill in the House. Some of TRS MLAs and Telangana Congress MLAs threw chairs at the YSRCP MLAs for protesting the T-bill. Situation turns worse with YSR Congress Party MLAs taking to burning the Telangana Bill in protest. Congregating at the media point in the Assembly, the YSRCP MLAs send out a strong message by burning the Telangana Bill, in defiance to the proposed state division and shouting 'Jai Samaikyandhra'. They even questioned the motive behind introducing the T Bill in the Assembly without conducting Business Advisory Council.
english
GREE, a Tokyo-based mobile gaming company worth $2.8 billion, is deepening its partnership with Yahoo! Japan through the creation of a joint venture that will build social games for smartphones. The new venture will have about 200 million yen or $2.2 million in funding and will be named GxYz. The point of the new company is to marry GREE’s strength in building games with Yahoo! Japan’s reach. Yahoo! Japan is one of the most highly trafficked portals in Japan and Yahoo’s 35 percent stake in the company put its value at around $6.8 billion, according to the company’s last quarterly filing with the SEC. The creation of GxYz deepens an earlier partnership from November of last year, when both companies agreed to develop some sort of entertainment partnership. That deal paved the way for GREE’s social games to get traffic from Yahoo! Japan’s mobile sites. The company’s board will have three directors from GREE and two from Yahoo! Japan. It’s being led by Tomoyuki Isaka, who has been a senior manager of social game development for GREE.
english
#legendbar { position: absolute; /*width: 25%; height: 2%;*/ width: 200px; height: 10px; background-color: red; right: 10%; bottom: 10%; } .legendbarlabel { top: 20px; position: absolute; } #legendbartitle { top: -20px; position: absolute; } #legendbarmin { left: 0px; } #legendbarmax { right: 0px; }
css
<filename>112_Path Sum.py # Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: def hasPathSum(self, root: 'TreeNode', sum: 'int') -> 'bool': if not root: return False def helper(node,val): if not node: return False val -= node.val if node.left is None and node.right is None: return val == 0 return helper(node.left, val) or helper(node.right, val) return helper(root,sum)
python
<reponame>ellanan/apod-api { "title": "Supermoon and Space Station", "explanation": "What are those specks in front of the Moon? They are silhouettes of the International Space Station (ISS). Using careful planning and split-second timing, a meticulous lunar photographer captured ten images of the ISS passing in front of last month's full moon. But this wasn't just any full moon -- this was the first of the three consecutive 2016 supermoons. A supermoon is a full moon that appears a few percent larger and brighter than most other full moons. The featured image sequence was captured near Dallas, Texas. Occurring today is the second supermoon of this series, a full moon that is the biggest and brightest not only of the year, but of any year since 1948. To see today's super-supermoon yourself, just go outside at night and look up. The third supermoon of this year's series will occur in mid-December.", "date": "2016-11-14", "hdurl": "https://apod.nasa.gov/apod/image/1611/ISStransit_Smith_3000.jpg", "service_version": "v1", "copyright": "<NAME>", "media_type": "image", "url": "https://apod.nasa.gov/apod/image/1611/ISStransit_Smith_960.jpg" }
json
<filename>src/DotNetWebApiServer/appsettings.json { "Logging": { "LogLevel": { "Default": "Warning" } }, "ConnectionString": { "LabDb": "server = localhost\\SQLEXPRESS; database = LabDB; trusted_connection = true;" }, "AllowedHosts": "*" }
json
export { default as downloadPdf } from './downloadPdf'; export { default as downloadXls } from './downloadXls'; export { default as fileCsv } from './fileCsv'; export { default as filesList } from './filesList'; export { default as fileZip } from './fileZip'; export { default as invoice } from './invoice'; export { default as note } from './note'; export { default as noteAdd } from './noteAdd'; export { default as noteEdit } from './noteEdit'; export { default as noteLink } from './noteLink'; export { default as receipt } from './receipt';
javascript
<filename>devlin2/modular_square/rtl/gen_reduction_lut.py<gh_stars>10-100 #!/usr/bin/python3 ################################################################################ # Copyright 2019 Supranational 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 # # 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. ################################################################################ import sys import getopt ################################################################################ # Parameters to set ################################################################################ REDUNDANT_ELEMENTS = 2 NONREDUNDANT_ELEMENTS = 8 NUM_SEGMENTS = 4 WORD_LEN = 16 EXTRA_ELEMENTS = 2 NUM_URAM = 0 # TODO - we probably don't need these hardcoded values anymore if (NONREDUNDANT_ELEMENTS == 128): M = 6314466083072888893799357126131292332363298818330841375588990772701957128924885547308446055753206513618346628848948088663500368480396588171361987660521897267810162280557475393838308261759713218926668611776954526391570120690939973680089721274464666423319187806830552067951253070082020241246233982410737753705127344494169501180975241890667963858754856319805507273709904397119733614666701543905360152543373982524579313575317653646331989064651402133985265800341991903982192844710212464887459388853582070318084289023209710907032396934919962778995323320184064522476463966355937367009369212758092086293198727008292431243681 else: M = 302934307671667531413257853548643485645 try: opts, args = getopt.getopt(sys.argv[1:],"hM:r:n:w:", \ ["modulus=","redundant=", \ "nonredundant=", "wordlen=", "urams="]) except getopt.GetoptError: print ('gen_reduction_lut.py -M <modulus> -r <num redundant>', \ '-nr <num nonredundant> -wl <word length> -u <num_uram>') sys.exit(2) for opt, arg in opts: if opt == '-h': print ('gen_reduction_lut.py -M <modulus> -r <num redundant>', \ '-nr <num nonredundant> -wl <word length> -u <num_uram>') sys.exit() elif opt in ("-M", "--modulus"): M = int(arg) elif opt in ("-r", "--redundant"): REDUNDANT_ELEMENTS = int(arg) elif opt in ("-n", "--nonredundant"): NONREDUNDANT_ELEMENTS = int(arg) elif opt in ("-w", "--wordlen"): WORD_LEN = int(arg) elif opt in ("-u", "--urams"): NUM_URAM = int(arg) print () print ('Parameter Values') print ('---------------------') print ('REDUNDANT_ELEMENTS ', REDUNDANT_ELEMENTS) print ('NONREDUNDANT_ELEMENTS', NONREDUNDANT_ELEMENTS) print ('WORD_LEN ', WORD_LEN) print ('NUM_SEGMENTS ', NUM_SEGMENTS) print ('EXTRA_ELEMENTS ', EXTRA_ELEMENTS) print ('M ', hex(M)) print () ################################################################################ # Calculated parameters ################################################################################ SEGMENT_ELEMENTS = (NONREDUNDANT_ELEMENTS // NUM_SEGMENTS) LUT_NUM_ELEMENTS = REDUNDANT_ELEMENTS + (SEGMENT_ELEMENTS*2) + \ EXTRA_ELEMENTS LOOK_UP_WIDTH = WORD_LEN // 2 LUT_SIZE = 2**LOOK_UP_WIDTH LUT_WIDTH = WORD_LEN * NONREDUNDANT_ELEMENTS; # Sanitize URAM and BRAM counts if NUM_URAM > LUT_NUM_ELEMENTS - 1: NUM_URAM = LUT_NUM_ELEMENTS - 1 NUM_BRAM = LUT_NUM_ELEMENTS - NUM_URAM ################################################################################ # Compute the reduction tables ################################################################################ print ('Creating', LUT_NUM_ELEMENTS, 'files') print ('reduction_lut_{0:03d}.dat'.format(0)) print (' ... ') print ('reduction_lut_{0:03d}.dat'.format(LUT_NUM_ELEMENTS-1)) for i in range (LUT_NUM_ELEMENTS): Filename = list('reduction_lut_{0:03d}.dat'.format(i)) f = open(''.join(Filename), 'w') # Polynomial degree offset for V7V6 offset = (SEGMENT_ELEMENTS*2) # Compute base reduction value for the coefficient degree t_v7v6 = (2**((i + NONREDUNDANT_ELEMENTS + offset) * WORD_LEN)) % M t_v5v4 = (2**((i + NONREDUNDANT_ELEMENTS) * WORD_LEN)) % M # Each address represents a different value stored in the coefficient for j in range (LUT_SIZE): cur_v7v6 = (t_v7v6 * j) % M f.write(hex(cur_v7v6)[2:].zfill(LUT_WIDTH // 4)) f.write('\n') for j in range (LUT_SIZE): cur_v5v4 = (t_v5v4 * j) % M f.write(hex(cur_v5v4)[2:].zfill(LUT_WIDTH // 4)) f.write('\n') f.close() ################################################################################ # Generate RTL to read in files ################################################################################ # This should not really be necessary # Required since parameterizing RTL to read in data was failing synthesis f = open('reduction_lut.sv', 'w') emit = \ '''/******************************************************************************* Copyright 2019 Supranational 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 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. *******************************************************************************/ module reduction_lut #( parameter int REDUNDANT_ELEMENTS = 2, parameter int NONREDUNDANT_ELEMENTS = 8, parameter int NUM_SEGMENTS = 4, parameter int WORD_LEN = 16, parameter int BIT_LEN = 17, parameter int DIN_LEN = 8, parameter int NUM_ELEMENTS = REDUNDANT_ELEMENTS+ NONREDUNDANT_ELEMENTS, parameter int LOOK_UP_WIDTH = int\'(WORD_LEN / 2), parameter int SEGMENT_ELEMENTS = int\'(NONREDUNDANT_ELEMENTS / NUM_SEGMENTS), parameter int EXTRA_ELEMENTS = 2, parameter int LUT_NUM_ELEMENTS = REDUNDANT_ELEMENTS+EXTRA_ELEMENTS+ (SEGMENT_ELEMENTS*2) ) ( input logic clk, input logic [LOOK_UP_WIDTH:0] lut_addr[LUT_NUM_ELEMENTS], input logic shift_high, input logic shift_overflow, output logic [BIT_LEN-1:0] lut_data[NUM_ELEMENTS][LUT_NUM_ELEMENTS], ''' f.write(emit) if NUM_URAM == 0: f.write("/* verilator lint_off UNUSED */") emit = \ ''' input we, input [DIN_LEN-1:0] din, input din_valid ''' f.write(emit) if NUM_URAM == 0: f.write("/* verilator lint_on UNUSED */") emit = \ ''' ); // There is twice as many entries due to low and high values localparam int NUM_LUT_ENTRIES = 2**(LOOK_UP_WIDTH+1); localparam int LUT_WIDTH = WORD_LEN * NONREDUNDANT_ELEMENTS; localparam int NUM_URAM = %(NUM_URAM)s; localparam int NUM_BRAM = LUT_NUM_ELEMENTS-NUM_URAM; localparam int XFERS_PER_URAM = (LUT_WIDTH*NUM_LUT_ENTRIES)/DIN_LEN; logic [LUT_WIDTH-1:0] lut_read_data[LUT_NUM_ELEMENTS]; ''' f.write(emit % {'NUM_URAM':NUM_URAM}) ########################################################################## # URAM Only ########################################################################## if NUM_URAM > 0: f.write(" logic [LUT_WIDTH-1:0] lut_read_data_uram[NUM_URAM];") emit = \ ''' logic [NUM_URAM-1:0] we_uram; genvar i; generate for(i = 0; i < NUM_URAM; i++) begin : urams uram_wide #(.DATA_LEN(NONREDUNDANT_ELEMENTS*WORD_LEN), .ADDR_LEN(LOOK_UP_WIDTH+1), .DIN_LEN(DIN_LEN) ) u1(.clk(clk), .we(we_uram[i] && we), .din(din), .din_valid(din_valid), .addr(lut_addr[i]), .dout(lut_read_data_uram[i])); end endgenerate // Enable writing data into the URAMs logic [$clog2(XFERS_PER_URAM):0] write_uram_xfers; always_ff @(posedge clk) begin if(!we) begin we_uram <= {{(NUM_URAM-1){1'b0}}, 1'b1}; write_uram_xfers <= XFERS_PER_URAM[$clog2(XFERS_PER_URAM):0]; end else if(|we_uram && din_valid) begin if(write_uram_xfers == 1) begin we_uram <= we_uram << 1; write_uram_xfers <= XFERS_PER_URAM[$clog2(XFERS_PER_URAM):0]; end else begin write_uram_xfers <= write_uram_xfers - 1; end end end ''' f.write(emit) ########################################################################## # BRAM Only ########################################################################## if NUM_BRAM > 0: f.write(" logic [LUT_WIDTH-1:0] lut_read_data_bram[NUM_BRAM];") emit = \ ''' logic [BIT_LEN-1:0] lut_output[NUM_ELEMENTS][LUT_NUM_ELEMENTS]; // Delay to align with data from memory logic shift_high_1d; logic shift_overflow_1d; always_ff @(posedge clk) begin shift_high_1d <= shift_high; shift_overflow_1d <= shift_overflow; end ''' f.write(emit) block_str = ' (* rom_style = "block" *) logic [LUT_WIDTH-1:0] lut_{0:03d}[NUM_LUT_ENTRIES];\n' for i in range (NUM_BRAM): f.write(block_str.format(i+NUM_URAM)) read_str = ' $readmemh("reduction_lut_{0:03d}.dat", lut_{0:03d});\n' f.write('\n initial begin\n') for i in range (NUM_BRAM): f.write(read_str.format(i+NUM_URAM)) f.write(' end\n') #assign_str = ' lut_read_data[{0:d}] <= lut_{0:03d}[lut_addr[{0:d}]][LUT_WIDTH-1:0];\n' assign_str = ' lut_read_data_bram[{0:d}] <= lut_{1:03d}[lut_addr[{1:d}]];\n' f.write('\n always_ff @(posedge clk) begin\n') for i in range (NUM_BRAM): f.write(assign_str.format(i, i+NUM_URAM)) f.write(' end\n') ########################################################################## # Mixed URAM/BRAM ########################################################################## emit = \ ''' // Read data out of the memories always_comb begin ''' f.write(emit) emit = \ ''' for (int k=0; k<NUM_URAM; k=k+1) begin lut_read_data[k] = lut_read_data_uram[k]; end ''' if NUM_URAM > 0: f.write(emit) emit = \ ''' for (int k=0; k<NUM_BRAM; k=k+1) begin lut_read_data[k+NUM_URAM] = lut_read_data_bram[k]; end ''' if NUM_BRAM > 0: f.write(emit) emit = \ ''' end always_comb begin for (int k=0; k<LUT_NUM_ELEMENTS; k=k+1) begin for (int l=NONREDUNDANT_ELEMENTS; l<NUM_ELEMENTS; l=l+1) begin lut_output[l][k] = '0; end end for (int k=0; k<LUT_NUM_ELEMENTS; k=k+1) begin for (int l=0; l<NONREDUNDANT_ELEMENTS+1; l=l+1) begin // TODO - should be unique, fails when in reset if (shift_high_1d) begin if (l < NONREDUNDANT_ELEMENTS) begin lut_output[l][k][BIT_LEN-1:LOOK_UP_WIDTH] = {{(BIT_LEN-WORD_LEN){1'b0}}, lut_read_data[k][(l*WORD_LEN)+:LOOK_UP_WIDTH]}; end if (l == 0) begin lut_output[l][k][LOOK_UP_WIDTH-1:0] = \'0; end else begin lut_output[l][k][LOOK_UP_WIDTH-1:0] = lut_read_data[k][((l-1)*WORD_LEN)+LOOK_UP_WIDTH+:LOOK_UP_WIDTH]; end end else if (shift_overflow_1d) begin if (l == 0) begin lut_output[l][k] = \'0; end else begin lut_output[l][k] = {{(BIT_LEN-WORD_LEN){1\'b0}}, lut_read_data[k][((l-1)*WORD_LEN)+:WORD_LEN]}; end end else begin if (l < NONREDUNDANT_ELEMENTS) begin lut_output[l][k] = {{(BIT_LEN-WORD_LEN){1\'b0}}, lut_read_data[k][(l*WORD_LEN)+:WORD_LEN]}; end end end end end // Need above loops in combo block for Verilator to process always_comb begin lut_data = lut_output; end endmodule ''' f.write(emit) f.close()
python
Bhubaneswar, April 13 Senior BJP leader and spokesperson Sambit Patra on Thursday slammed Odisha government for its move to hand over 15,000 acres land of private and agricultural landowners in Puri district to Vedanta Foundation to set up a university. Patra held a press conference here a day after the Supreme Court's order against Odisha government's move to provide land to Anil Agarwal Foundation in Puri. The BJP leader said the Odisha government had signed an MoU with Anil Agarwal Foundation in 2006 to provide around 15,000 acres contiguous land in Puri district to establish a university. Many affected people have challenged it and in 2010, the then Lokpal had termed it illegal. Later, the Orissa High Court had also pronounced it as illegal, Patra said. Through a special leave petition, the Odisha government and the Foundation had moved the Supreme Court, which pronounced its judgment on Wednesday, he said. The SC has criticised the Odisha government, which has tried to grab the land of thousands of farmers and poor people in Puri, Patra said. The court, in its order said, the most important aspect, which is required to be considered is the non-application of mind by the state government on environmental aspects and passing of two rivers from the acquired lands in question. "It is not in dispute that from the lands in question two rivers namely 'Nuanai' and 'Nala' are flowing, which as such were acquired by the state government. The control of the rivers would be with the said private company, which would violate the Doctrine of Public Trust," Patra reads out the court order. The government has moved to hand over two rivers to the company. If the rivers are given to a private company, the residents will be affected, he said. Though there is a Wildlife Sanctuary, which is just adjacent across the road to the proposed university and the lands acquired, the state government has not considered it, the BJP spokesperson pointed out. "The state government was only concerned about the private company and how to give benefit to the company, not the public and farmers, who are affected by the project," he stated. The apex court has also asked the beneficiary company - Anil Agarwal Foundation, to deposit Rs 5 lakh. Reacting on this, BJD spokesperson Sasmit Patra said, "Present Odisha BJP president Manmohan Samal was the revenue minister when land was allotted to Vedanta. Senior BJP leader Samir Dey was the education minister during the time. Both the leaders had supported the move of the government in the Assembly at that time. " From the statement of Sambit Patra, it is clear that there is in-deference between BJP leaders in Odisha, he added.
english
import { BUTTONS } from 'wix-rich-content-plugin-commons'; import { getModalStyles } from 'wix-rich-content-editor-common'; import { Modals } from '../modals'; import { MediaReplaceIcon } from '../icons'; import { CreateInlineButtons, TranslationFunction } from 'wix-rich-content-common'; import { SoundCloudPluginEditorConfig } from '../types'; const createInlineButtons: CreateInlineButtons = ({ t, isMobile, settings, }: { t: TranslationFunction; settings: SoundCloudPluginEditorConfig; isMobile: boolean; }) => { const icon = settings?.toolbar?.icons?.replace || MediaReplaceIcon; return [ { keyName: 'sizeSmallCenter', type: BUTTONS.SIZE_SMALL_CENTER, mobile: false }, { keyName: 'sizeContent', type: BUTTONS.SIZE_CONTENT, mobile: false }, { keyName: 'sizeFullWidth', type: BUTTONS.SIZE_FULL_WIDTH, mobile: false }, { keyName: 'separator1', type: BUTTONS.SEPARATOR, mobile: false }, { keyName: 'sizeSmallLeft', type: BUTTONS.SIZE_SMALL_LEFT, mobile: false }, { keyName: 'sizeSmallRight', type: BUTTONS.SIZE_SMALL_RIGHT, mobile: false }, { keyName: 'separator2', type: BUTTONS.SEPARATOR, mobile: false }, { keyName: 'replace', type: BUTTONS.EXTERNAL_MODAL, icon, modalName: Modals.SOUND_CLOUD_URL_INPUT, modalStyles: getModalStyles({ fullScreen: false, isMobile }), mobile: true, tooltipTextKey: 'ReplaceSoundCloudButton_Tooltip', t, }, { keyName: 'delete', type: BUTTONS.DELETE, mobile: true }, ]; }; export default createInlineButtons;
typescript
<filename>datasets/2D/SIGN/writer003/sessionA/right-1-22.json {"name":"right","subject":3,"date":"11122009-044959","paths":{"Pen":{"strokes":[{"x":-1191,"y":10,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":0,"stroke_id":0},{"x":-1217,"y":12,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":1,"stroke_id":0},{"x":-1225,"y":12,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":2,"stroke_id":0},{"x":-1225,"y":20,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":3,"stroke_id":0},{"x":-1221,"y":20,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":4,"stroke_id":0},{"x":-1195,"y":20,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":5,"stroke_id":0},{"x":-1160,"y":16,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":6,"stroke_id":0},{"x":-1103,"y":12,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":7,"stroke_id":0},{"x":-1030,"y":2,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":8,"stroke_id":0},{"x":-934,"y":-4,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":9,"stroke_id":0},{"x":-820,"y":-19,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":10,"stroke_id":0},{"x":-688,"y":-34,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":11,"stroke_id":0},{"x":-542,"y":-54,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":12,"stroke_id":0},{"x":-381,"y":-74,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":13,"stroke_id":0},{"x":-215,"y":-96,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":14,"stroke_id":0},{"x":-43,"y":-114,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":15,"stroke_id":0},{"x":122,"y":-132,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":16,"stroke_id":0},{"x":282,"y":-148,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":17,"stroke_id":0},{"x":436,"y":-155,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":18,"stroke_id":0},{"x":573,"y":-165,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":19,"stroke_id":0},{"x":695,"y":-165,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":20,"stroke_id":0},{"x":798,"y":-165,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":21,"stroke_id":0},{"x":881,"y":-165,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":22,"stroke_id":0},{"x":881,"y":-165,"w":null,"z":null,"alpha":null,"beta":null,"gamma":null,"t":23,"stroke_id":0}]}},"device":{"osBrowserInfo":"Fujitsu-Siemens Stylistic ST5022 Tablet PC","resolutionHeight":null,"resolutionWidth":null,"windowHeight":null,"windowWidth":null,"pixelRatio":null,"mouse":false,"pen":true,"finger":false,"acceleration":false,"webcam":false}}
json
import { CommandHandler, ICommandHandler } from '@nestjs/cqrs'; import { Result } from 'src/shared/core/class/result'; import { ModuleRef } from '@nestjs/core'; import { DeleteCommand } from '../impl/delete.command'; import { IEntity } from '../../../../core/interfaces/IEntity'; import { IEntityService } from '../../../../core/interfaces/IEntityService'; @CommandHandler(DeleteCommand) export class DeleteCommandHandler<E extends IEntity> implements ICommandHandler<DeleteCommand> { constructor( readonly _moduleRef: ModuleRef, readonly serviceSymbol: string ) { } async execute({ entityId , contextId }: DeleteCommand): Promise<Result<void>> { const service = await this._moduleRef.resolve(this.serviceSymbol, contextId as any) as IEntityService<E>; return service.deleteById(entityId); } }
typescript
For some, working remotely means staking a claim at a local coffee shop. For others, it’s staying home in sweats, rarely emerging during daylight hours. And then there are the lucky ones, the digital nomads — who somehow fit working in with hitting the beach. In any case, working from home means you’ll develop your own habits — some good and others bad. And worst case scenario, you’re looking at a day marred by procrastination, isolation, and our favorite — digital loafing. Here are some ways to strike a balance. Even if it sounds miserable right now, you’ll thank us down the road. One of the hardest parts of remote work is revealed within the name — it’s isolating at times. We lack the camaraderie of a traditional office plan, occasionally pining for idle chatter about that new lunch spot down the street or how Bob from accounting spent the weekend. Without the built-in interaction, you’ll find in a traditional office; solo workers must “make their own fun,” so to speak. While it can be challenging to close the laptop from time to time, giving yourself the space to do something leisurely like grab lunch with a friend, go to a happy hour, or have some people over for a meal can do you a lot of good. There’s always going to be something you could be doing — whether that’s fine-tuning your website or digging around for new leads. On the flip side, remote work is a relatively new way of life, and for that reason, many people don’t “get” why you’re not always available. Explain (nicely) to friends and family that you will not be available during specific working hours, and stick to them. Over time, those people will begin to get the message that your flexibility doesn’t mean you can shirk your responsibilities at any given moment. Eating well is hands down one of the best things you can do to stay sane, energized, and focused. It’s well documented at this point that nutrition plays a significant role in making sure our brains are operating smoothly. Additionally, you’ll want to make sure you stock the kitchen with healthy options. Even the most productive workers among us wander into the kitchen out of boredom, especially if you know that it’s packed with sweet and salty treats. Save the junk food for the odd occasion and don’t keep in the house. Instead, load up on fruits, veggies, and some quick protein sources. It’s critical that you carve out a designated workspace in your home. Now, many people have some constraints—there might not be enough space for a full-on home office. Still, you can always create a workspace in the corner of a room — dedicated just to work. What we’re getting at is, you need to create a physical distance between your work and your life outside of work. The reason for this is, having a designated workspace kicks your brain into gear — going into your office each day provides a trigger that says, “get to work” and will, ideally, help you fight distractions. The second part of this is building in environmental changes. If you work from a home office, spending a few hours working from a coffee shop or the local library can give your creativity a bit of a boost. 4. Stop multitasking. Seriously. Look around in any working environment — the coffee shop, the coworking space, and so on — and chances are you’ll see several folks looking at phones while emailing, writing, or working on some presentation slides. We like to think we’re skilled at multitasking — it makes us feel like we’re checking off to-do list items like a badass. But, multitasking also means we remember less and make more mistakes. And, if you’re trying to promote a greater sense of well-being, these little mistakes can be sources of stress and shame down the road. Think about it, when a client gets back to you with a laundry list of mistakes, it sucks, right? Practice doing one thing at a time. Set a timer — for say, 20 or 30 minutes at a time. Initially, it may be difficult to do just one thing at a time, but practice makes perfect. Over time, you’ll find that you’ve improved your turnaround time and accuracy. When you’re working from home, failing to be productive means that you’re leaving money on the table. It’s not like the days at the office where, despite those post-lunch slumps, you can still count on money coming in at a predictable interval. So, when there’s a disconnect between your work and your mental state—focusing becomes this uphill battle. As such, you’ll want to adapt your work habits to your energy levels. Many people are more detail-oriented in the morning or more creative during the evening. At first, you might want to start tracking these things. You probably already know whether you’re a morning person or a night owl, but diving deeper into your natural rhythms can help you tap into a productive routine. A messy desk or a poorly equipped office will hinder productivity — and clutter the mind. Studies have shown that clutter can contribute to stress, procrastination, and a lack of focus — all killers for an effective day spent working from home. If your desk is in a state of disrepair, spend just 15 minutes throwing out the La Croix cans, coffee cups, and energy bar wrappers. We promise it will make a world of difference. Invest in things like calendars, planners, and the pens you like most, but keep the office supplies to a minimum. Imposter Syndrome, a term that’s been around since the 1970s, has gotten a lot of play in the media over the past few years. The term refers to a phenomenon, primarily in high achieving women that feel as though they are intellectual phonies. We bring this up because imposter syndrome can do a number on your motivation. Because you don’t witness colleagues’ activities, you might find yourself comparing yourself to others in similar positions — better credentials, a style you like better than your own, the list goes on. When you’re off on your own, managing your time with little oversight, you’re also spending a lot of time alone without any feedback—and in some cases, may feel like a fraud. Keep tabs of your achievements and positive feedback you receive — and check in with your remote connections from time to time. Healthy habits mean a lot more than simply eating more vegetables. From a productivity standpoint, your job is to create routines that work for you and stick to them. Get dressed every day and ditch the Doritos. Make your home office a personalized productivity center — and for God’s sake, drink water. How you deal with the challenges associated with working from home will set the tone for your success down the road — a productive life with the space for friends, family, and a little alone time, too.
english
Barcelona, Feb 2 (IANS) First half goals from Luis Suarez and Lionel Messi gave FC Barcelona a 2-1 win away to Atletico Madrid in the first leg of their King’s Cup semi-final at the Vicente Calderon Stadium here. Barcelona dominated the first half of the game here on Wednesday, but rode their luck in the second half as Atletico pressed for an equalising goal after Antoine Griezmann had headed them back into the tie with 30 minutes remaining, reports Xinhua. Both sides fielded arguably their strongest team but the inclusion of Juanfran on the right of the Atletico midfield implied coach Diego Simeone was cautious of the threat posed by Messi, Suarez and Neymar. His caution was to no effect because Barcelona needed only six minutes to open the scoring. Javier Mascherano won possession in midfield and found Suarez, who slipped the ball past Stefan Savic before beating Moya with low finish. Suarez and Neymar then contrived to miss a guilt edge chance on the break, before Messi doubled their lead on 33 minutes with a typical piece of brilliance as he fired home a 25 shot which went in off the post. It was all Barcelona from then on and Atletico’s only chance before the break came when Koke shot over the bar from the edge of the Barcelona penalty area. Simeone reacted by replacing right back Sime Vrsaljko with striker Fernando Torres and Atletico looked more aggressive at the start of the second half, getting their reward just before the hour when Griezmann nodded home after Godin had set him up with a smart header following a free kick. Three minutes later only a point blank save from Barcelona keeper Jasper Cillessen denied Griezmann his second after a low cross from Felipe Luis. The game was gaining intensity and Neymar saw a yellow card, ruling him out of the return leg, shortly before Griezmann was also booked for a poor challenge on Barcelona substitute Rafinha. Messi stepped up and his free kick was bound for the top corner before Moya produced a flying save to keep his side in the game. At the other end Kevin Gameiro missed an overhead kick, while Torres’ flick went agonisingly wide of the post. Torres then shot wide after Gabi had robbed Mascherano on the edge of the Barcelona area as Atletico continued to press for the equalising goal, which despite several near misses failed to arrive.
english
<!DOCTYPE html> <html lang="pt-br"> <head> <title>Curso de CSS - Icons</title> <meta charset="utf-8" /> <!-- Arquivos de suporte para a apresentação do material, não fazem parte do exercício --> <link href="https://fonts.googleapis.com/css2?family=Work+Sans&display=swap" rel="stylesheet" /> <link href="../../ref.css" rel="stylesheet" type="text/css" /> <link rel="stylesheet" href="./style.css" type="text/css"> <!-- --------------------------------------------------------------------------------- --> <!-- Coloque suas modificações a partir daqui --> </head> <body> <div> <div> <h1>Ícones</h1> <p> Uma das práticas mais comuns hoje é utilizar SVG como fonte de ícones. </p> </div> <section> <h2>Uso direto do SVG</h2> <p> A primeira forma mais simples é colocar o conteúdo do SVG direto no lugar onde se deseja renderizar o ícone. </p> <div> <!-- Coloque aqui os seus elementos estilizados --> <svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!-- Font Awesome Free 5.15.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M320 448v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24V120c0-13.255 10.745-24 24-24h72v296c0 30.879 25.121 56 56 56h168zm0-344V0H152c-13.255 0-24 10.745-24 24v368c0 13.255 10.745 24 24 24h272c13.255 0 24-10.745 24-24V128H344c-13.2 0-24-10.8-24-24zm120.971-31.029L375.029 7.029A24 24 0 0 0 358.059 0H352v96h96v-6.059a24 24 0 0 0-7.029-16.97z"/></svg> </div> </section> <section> <h2>Uso referenciado do SVG</h2> <p> Uma segunda forma, para reaproveitar o mesmo SVG, é definindo símboloes e referenciando-os. </p> <div> <!-- Coloque aqui os seus elementos estilizados --> </div> </section> <section> <h2>Via CSS</h2> <p> Uma terceira forma é utilizando o pseudo-elemento <code>hover</code> e usando como o SVG como background </p> <div> <!-- Coloque aqui os seus elementos estilizados --> </section> </div> </body> </html>
html
Castries, St Lucia: The family of Nobel laureate Derek Walcott says he has died at his home in St Lucia. He was 87. Walcott was a prolific and versatile poet whose dazzling, painterly work captured the essence of his native Caribbean and earned him a reputation as one of the greatest writers of the second half of the 20th century. Walcott was long the most prominent citizen of the eastern Caribbean island nation of St. Lucia and the region's most eminent poet. (This story has not been edited by News18 staff and is published from a syndicated news agency feed - Associated Press)
english
Don’t Miss Out on the Latest Updates. Subscribe to Our Newsletter Today! As a part of Make in India initiative, the central government has started distributing indigenous ventilators to hospitals across the country to fight against the Covid pandemic. In the first slot, about 3000 domestic ventilators have been distributed to states. Ventilators are life-saving medical equipment required for Covid patients, as some of them tend to develop acute respiratory disease syndrome (ARDS). On May 1, the Union Health Ministry, in a press statement, had indicated the projected demand of 75,000 ventilators till June. Accordingly, orders were rushed including the requirements of the state governments. “So far, at least 3000 country-made ventilators have been distributed to states, which will be placed in various hospitals; few are under dispatch,” a senior government official confirmed to ANI. In the coming days, the domestic production of ventilators is going to speed up, added the official. Taking forward Make in India initiative, local manufacturers of ventilators were identified. They were guided about specifications, finalising the training and other protocols, creating new supply chains. They were also helped with logistic issues with suppliers and state governments and the arrangement of consumables and etc were also decided. The major domestic players include Bharat Electronics Limited (BEL) in collaboration with Skanray to whom orders for 30,000 ventilators were given. Domestic manufacturer AgVa (in collaboration with automobile company- Maruti Suzuki Limited) was asked for a consignment of 10,000 ventilators. The AMTZ (AP Medtech Zone) received orders for about 13,500 units. Besides them, another Indian firm, Jyoti CNC, got orders to develop 5,000 ventilators. In the meantime, orders have been placed on international companies like Hamilton, Mindray and Draeger to supply ventilators. Ministry of External Affairs is also approaching suppliers in China for sourcing 10,000 ventilators from them. As per the union health ministry, till June 2020– the total projected demand of Personal Protective Equipment (PPE) kits has been estimated to be Rs. 2. 01 crore. “Till today, the government has distributed over one crore PPE to various States/UTs,” adding that more than one crore N-95 masks have been provided to them so far. For breaking news and live news updates, like us on Facebook or follow us on Twitter and Instagram. Read more on Latest Viral News on India. com.
english
- Movies Tamannaah Bhatia Grooves To Kaavaalaa Song With Fan At Mumbai Airport; Says 'He Is Doing Better Than Me' - News Who is Monk Amogh Lila Das and Why Has ISKCON Banned Him? - Travel Have you been to Vishveshwaraya Falls in Mandya yet? If not, this is the best time! Summer, the season that shines bright in the eyes; when the sun is happy and high up in the sky! This is the season which you feel absolutely thrilled to receive. All your summer favorites are out in the open. It’s time for some fashion moments. All those woolens will go hiding in the closet and out comes those short denims and cool sleeveless that you are bound to flaunt this season. Summers are known for bringing in the season of mangoes. It’s the season when the breeze is warm, the climate hot and the fruits absolutely chilled. The love for summer does not end with these bits! It goes on to holidays, vacations and lot of thrills in life. Summer offers a wide variety of colors to your life. The heat is on but that does not stop you from enjoying does it? While we are on the topic of summer, it becomes essential to discuss which colors will keep you happy while in the kitchen. This heated atmosphere needs cool colors to help you sweep in the happy atmosphere. Here are a few color choices that you can choose from for the summer kitchen. It will not just make the kitchen summer happy but also give in some happiness to you. When the sun’s yellow, the climate’s yellow, how can your kitchen not be yellow? This bright color will definitely bring in some happiness on your face. You can probably pull up some amazing curtains that are yellow or paint the walls a warm yellow this summer. Of course, if you don’t want too much of yellow, you can combine it with shades of grey. This is yet another summer color that will definitely cool your eyes and mind. Blue has a pretty serene effect to it. It is ideal for summer kitchen. You could have blue tiles to your kitchen or have some accessories arranged that is blue in color. You can even get the kitchen curtains blue. With blue you can bring in peace and unwind in the kitchen while having a cup of coffee. It becomes the princess’ kitchen when you paint it pink, but it is one of the best summer shades. You can have a drapery that’s pink with some towels or accessories in that shade. It gives an intensifying touch to your kitchen and makes it look pretty even in summer. Pink can give it a pretty happy touch. Beauty of lime, it goes with any kind of furniture and accessory. The beauty of lime lies in the shade itself! It is one of the prettiest shades ever and painting your kitchen lime would be the best decision for summer. A hint of lime really spices up your life! Don’t believe it? Try having salsa or a cocktail without lime and you would know. Spice up your kitchen style with a dash of lime. Oh yes! This color gives your kitchen the pastel shade that seems perfect for the summers. It stands out perfectly even if there are other colors in that place. It will suit all your furniture and in fact make your kitchen appear glorious. You can get accessories of this color for your kitchen. Ideal color for the summer kitchen! - beauty3 Kitchen Herbs That Are A Blessing To Your Skin And How To Use? - healthUsing Plastic Cutting Boards: How Safe Is It? Which Is Safer Wood Or Plastic Cutting Boards?
english
<reponame>SoPra-FS20-Group10/client import React from "react"; import PIECE from "../shared/Other/Pieces"; import Piece from "../shared/models/Piece"; class PieceBag extends React.Component{ constructor(props) { super(props); this.state = { pieceBag: null, }; this.initPieceBag = this.initPieceBag.bind(this); } componentDidMount() { this.initPieceBag(); console.log("Mounted"); } initPieceBag() { let pieceBag = []; let id = 0; for (let i = 0; i < 10; i++) { let piece = new Piece({id: id, text: PIECE.A.text, score: PIECE.A.score}) pieceBag.push(piece); id++; } for (let i = 0; i < 3; i++) { let piece = new Piece({id: id, text: PIECE.A.text, score: PIECE.A.score}) pieceBag.push(piece); id++; } for (let i = 0; i < 3; i++) { let piece = new Piece({id: id, text: PIECE.A.text, score: PIECE.A.score}) pieceBag.push(piece); id++; } for (let i = 0; i < 5; i++) { let piece = new Piece({id: id, text: PIECE.A.text, score: PIECE.A.score}) pieceBag.push(piece); id++; } for (let i = 0; i < 13; i++) { let piece = new Piece({id: id, text: PIECE.A.text, score: PIECE.A.score}) pieceBag.push(piece); id++; } for (let i = 0; i < 3; i++) { let piece = new Piece({id: id, text: PIECE.A.text, score: PIECE.A.score}) pieceBag.push(piece); id++; } for (let i = 0; i < 4; i++) { let piece = new Piece({id: id, text: PIECE.A.text, score: PIECE.A.score}) pieceBag.push(piece); id++; } for (let i = 0; i < 3; i++) { let piece = new Piece({id: id, text: PIECE.A.text, score: PIECE.A.score}) pieceBag.push(piece); id++; } for (let i = 0; i < 10; i++) { let piece = new Piece({id: id, text: PIECE.A.text, score: PIECE.A.score}) pieceBag.push(piece); id++; } { let piece = new Piece({id: id, text: PIECE.A.text, score: PIECE.A.score}) pieceBag.push(piece); id++; } { let piece = new Piece({id: id, text: PIECE.A.text, score: PIECE.A.score}) pieceBag.push(piece); id++;} for (let i = 0; i < 5; i++) { let piece = new Piece({id: id, text: PIECE.A.text, score: PIECE.A.score}) pieceBag.push(piece); id++; } for (let i = 0; i < 3; i++) { let piece = new Piece({id: id, text: PIECE.A.text, score: PIECE.A.score}) pieceBag.push(piece); id++; } for (let i = 0; i < 7; i++) { let piece = new Piece({id: id, text: PIECE.A.text, score: PIECE.A.score}) pieceBag.push(piece); id++; } for (let i = 0; i < 9; i++) { let piece = new Piece({id: id, text: PIECE.A.text, score: PIECE.A.score}) pieceBag.push(piece); id++; } for (let i = 0; i < 3; i++) { let piece = new Piece({id: id, text: PIECE.A.text, score: PIECE.A.score}) pieceBag.push(piece); id++; } { let piece = new Piece({id: id, text: PIECE.A.text, score: PIECE.A.score}) pieceBag.push(piece); id++; } for (let i = 0; i < 7; i++) { let piece = new Piece({id: id, text: PIECE.A.text, score: PIECE.A.score}) pieceBag.push(piece); id++; } for (let i = 0; i < 5; i++) { let piece = new Piece({id: id, text: PIECE.A.text, score: PIECE.A.score}) pieceBag.push(piece); id++; } for (let i = 0; i < 7; i++) { let piece = new Piece({id: id, text: PIECE.A.text, score: PIECE.A.score}) pieceBag.push(piece); id++; } for (let i = 0; i < 5; i++) { let piece = new Piece({id: id, text: PIECE.A.text, score: PIECE.A.score}) pieceBag.push(piece); id++; } for (let i = 0; i < 3; i++) { let piece = new Piece({id: id, text: PIECE.A.text, score: PIECE.A.score}) pieceBag.push(piece); id++; } for (let i = 0; i < 3; i++) { let piece = new Piece({id: id, text: PIECE.A.text, score: PIECE.A.score}) pieceBag.push(piece); id++; } { let piece = new Piece({id: id, text: PIECE.A.text, score: PIECE.A.score}) pieceBag.push(piece); id++; } for (let i = 0; i < 3; i++) { let piece = new Piece({id:id,text:PIECE.A.text, score:PIECE.A.score}) pieceBag.push(piece); id++; } { let piece = new Piece({id: id, text: PIECE.A.text, score: PIECE.A.score}) pieceBag.push(piece); } console.log(pieceBag); this.setState({ pieceBag:pieceBag, }) console.log(this.state); } getPieceById(id){ return this.state.pieceBag[id]; } } export default PieceBag;
javascript
<filename>package.json { "name": "netatmo-munisense-connector", "version": "1.0.0", "description": "Simple program to import netatmo weather station sensor values into the Munisense backoffice", "main": "index.js", "author": "<NAME>", "license": "CC0-1.0", "dependencies": { "netatmo": "^2.1.0", "sync-disk-cache": "^1.2.2", "xmlhttprequest": "^1.8.0" } }
json
/** * @module error-handler */ // var debug = require( 'debug' )( 'error-handler' ); /** * @param {module:api-controller~ExpressRequest} req - HTTP request * @param {Error} error - Error object. */ function getErrorMessage(req, error) { if (error.message) { // convert certain set of messages into a more readable // and translated message if (/ECONNREFUSED/.test(error.message)) { return req.i18n.t('error.econnrefused'); } // else output the message untranslated return error.message; } if (error.translationKey) { // return translated message return req.i18n.t(error.translationKey, error.translationParams); } // return error code return error.code; } module.exports = { /** * @param {Error} err - Error object * @param {module:api-controller~ExpressRequest} req - HTTP request * @param {module:api-controller~ExpressResponse} res - HTTP response * @param {Function} next - Express callback */ // Express uses arguments length to determine whether a callback is an error handler. // eslint-disable-next-line no-unused-vars production(err, req, res, next) { // eslint-disable-line no-unused-vars const body = { code: err.status || 500, message: getErrorMessage(req, err), }; const contentType = res.get('Content-type'); res.status(err.status || 500); if (contentType && contentType.indexOf('application/json') === 0) { res.json(body); } else { res.render('error', body); } }, /** * @param {Error} err - Error object * @param {module:api-controller~ExpressRequest} req - HTTP request * @param {module:api-controller~ExpressResponse} res - HTTP response * @param {Function} next - Express callback */ // Express uses arguments length to determine whether a callback is an error handler. // eslint-disable-next-line no-unused-vars development(err, req, res, next) { // eslint-disable-line no-unused-vars const body = { code: err.status || 500, message: getErrorMessage(req, err), stack: err.stack, }; const contentType = res.get('Content-type'); res.status(err.status || 500); if (contentType && contentType.indexOf('application/json') === 0) { res.json(body); } else { res.render('error', body); } }, /** * @param {module:api-controller~ExpressRequest} req - HTTP request * @param {module:api-controller~ExpressResponse} res - HTTP response * @param {Function} next - Express callback */ 404(req, res, next) { const error = new Error(req.i18n.t('error.pagenotfound')); error.status = 404; next(error); }, };
javascript
Brasilia, Aug 23: Brazilian President Jair Bolsonaro and his main rival, former president Luiz Inacio Lula da Silva, traded blows on Monday ahead of the upcoming presidential election in October. Although they didn't debate face-to-face, the two politicians each gave landmark interviews where Bolsonaro's unfounded claims of electoral fraud were a key point of contention. During a 40-minute interview on Journal Nacional, an evening news program that has the highest ratings in the country, Bolsonaro once again made claims about electoral fraud in Brazil. He did not provide any evidence. Bolsonaro, a former army captain, also said he believes the military should have a role in deciding the transparency of the vote. "The results of the vote will be respected, as long as the election is clean and transparent," he said. As the president's speech went to air on Monday night, residents in Brazil's largest cities could be heard banging their pots and pans outside their windows, shouting "out with Bolsonaro. " 'He's a cheap copy of Trump' Earlier on Monday, Lula, who has consistently led opinion polls, gave his first press conference to foreign journalists since his presidential campaign officially kicked off earlier this month. Lula accused Bolsonaro of spreading "fake news" about the electoral system, and slammed the president's supporters for spreading falsehoods about the religious beliefs of both himself and his new wife, Rosangela da Silva. "He's a cheap copy of Trump," Lula said of the far-right Brazilian president. Lula also pledged to combat deforestation and illegal gold mining in the Amazon if elected.
english
window.requirejs = { entries: window.Ember.__loader.registry }; export default window.Ember.__loader.require;
javascript
Curious about what Scorpio’ health, love life, career, and business look like today? These predictions by the renowned astro-numerologist Siddharth S Kumaar should help. You may feel revitalized when you wake up if you maintain a nutritious diet, engage in some light physical activity, and receive a sufficient amount of sleep. This may allow you to feel ready to face the day. You should make it a habit to go to a dermatologist regularly, and you should also make it a point to adhere to the standards for other procedures that are considered to be good skin care practices. It is possible that, in the long run, it will be beneficial to invest some time and effort into a tentative romantic relationship that is currently in the process of blossoming. Having concerns about the potential disruption that could take place in your romantic life is not a realistic response on your part. On an emotional level, having a close friend or partner can make you feel better without making you feel unnecessarily dependent on them. This will allow you to feel better about yourself. For a relationship to be healthy, this is necessary. You can easily progress in your current position or enter the workforce today, regardless of whether you are contemplating entering the workforce or striving to advance in the position you are now holding. There is a possibility that you could find employment in a different sector of the economy or even in a country that is not your own country. You have access to a variety of opportunities. There is a good chance that your capacity to get things done will significantly improve if you make an effort to become more proactive and reactive. To ensure that you can sustain your financial stability, it is necessary for you to keep a close eye on your finances and to make decisions regarding the household budget that are prudent at present. Whenever it comes to the establishment of financial duties, an increased level of monitoring is essential, and joint ventures should not be an exception to this rule. On the other hand, investments or insurance policies that have been held for a considerable amount of time have the potential to provide a profit for the financier. Sidhharrth S Kumaar, the Founder and Chief Happiness Officer of NumroVani, is a registered pharmacist who turned into an Astro Numerologist. He started learning occult sciences at the age of six after reading and researching them and their application to the contemporary world for around one and a half decades. He has been practicing this for about a decade as well. He is a pioneer of Zero Numerology and Karm Positioning System, which help individuals and businesses solve real-life problems using the hidden gems of occult sciences. He has published 10+ research papers and also has authored 2 books on Numerology and Life.
english
<filename>manpages-zh/man1/psql.1.html <!DOCTYPE html> <HTML><HEAD><TITLE>Man page of PSQL</TITLE> <meta charset="utf-8"> <link rel="stylesheet" href="/css/main.css" type="text/css"> </head> <body> <header class="site-header"> <div class="wrap"> <div class="site-title"><a href="/manpages-zh/index.html">linux manpages 中文版</a></div> <div class="site-description">{"type":"documentation"}</div> </div> </header> <div class="page-content"><div class="wrap"> <H1>PSQL</H1> Section: PostgreSQL Client Applications (1)<BR>Updated: 2003-11-02<BR><A HREF="#index">Index</A> <A HREF="/manpages-zh/index.html">Return to Main Contents</A><HR> <A NAME="lbAB">&nbsp;</A> <H2>NAME</H2> psql - PostgreSQL 交互终端 <P> <A NAME="lbAC">&nbsp;</A> <H2>SYNOPSIS</H2> <P> <B>psql</B> [<B></B><I>option</I><B></B>...<B></B>] [<B></B><I>dbname</I><B></B> [<B></B><I>username</I><B></B>]<B></B>] <A NAME="lbAD">&nbsp;</A> <H2>DESCRIPTION 描述</H2> <P> <B>psql</B> 是一个以终端为基础的 PostgreSQL 前端。它允许你交互地键入查询,把它们发出给 PostgreSQL, 然后看看查询的结果。另外,输入可以来自一个文件。还有, 它提供了一些元命令和多种类 shell 地特性来实现书写脚本以及对大量任务的自动化。 <A NAME="lbAE">&nbsp;</A> <H2>OPTIONS 选项</H2> <DL COMPACT> <DT><B>-a</B><DD> <DT><B>--echo-all</B><DD> <BR>&nbsp;在读取行时向屏幕打印所有内容。&nbsp;这个选项在脚本处理时比交互模式时更有用。这个选项等效于设置变量&nbsp;ECHO&nbsp;为&nbsp;all。 <DT><B>-A</B><DD> <DT><B>--no-align</B><DD> <BR>&nbsp;切换为非对齐输出模式。(缺省输出模式是对齐的。) <DT><B>-c</B><I>command</I><B></B><DD> <DT><B>--command</B><I>command</I><B></B><DD> 声明 psql 将执行一条查询字串, command,然后退出。这一点在 shell 脚本里很有用。 <I>command</I> 必须是一条完全可以被服务器分析的查询字串(也就是说,它不包含 psql特有的特性), 或者是一个反斜杠命令。这样你就不会混合 SQL 和 psql 元命令。要想混合使用,你可以把字串定向到<B>psql</B> 里,象这样: echo &quot;\x\ select * from foo;&quot; | psql。 <P> <BR>&nbsp;如果命令字串包含多个&nbsp;SQL&nbsp;命令,那么他们在一个事务里处理,&nbsp;除非在字串里包含了明确的&nbsp;BEGIN/COMMIT&nbsp;命令把他们分成多个事务。&nbsp;这个和从&nbsp;psql&nbsp;的标准输入里给它填充相同字串不同。 <DT><B>-d</B><I>dbname</I><B></B><DD> <DT><B>--dbname</B><I>dbname</I><B></B><DD> <BR>&nbsp;声明想要联接的数据库名称。等效于在命令行行上把&nbsp;dbname&nbsp;&nbsp;声明为第一个非选项参数。 <DT><B>-e</B><DD> <DT><B>--echo-queries</B><DD> <BR>&nbsp;显示所由发送给服务器的查询。&nbsp;等效于把变量&nbsp;ECHO&nbsp;设置为&nbsp;queries。 <DT><B>-E</B><DD> <DT><B>--echo-hidden</B><DD> <BR>&nbsp;回显由<B>\d</B>&nbsp;和其他反斜杠命令生成的实际查询。&nbsp;如果你希望在你自己的程序里包含类似的功能,&nbsp;你就可以使用这个选项。这等效于在psql里设置变量ECHO_HIDDEN。 <DT><B>-f</B><I>filename</I><B></B><DD> <DT><B>--file</B><I>filename</I><B></B><DD> <BR>&nbsp;使用&nbsp;filename作为命令的语句源而不是交互式读入查询。&nbsp;在处理完文件后,psql&nbsp;结束。这个选项在很多方面等效于内部命令<B>\i</B>。 <P> 如果<I>filename</I> 是- (连字符),则从标准输入读取。 <P> <BR>&nbsp;使用这个选项与用&nbsp;psql&nbsp;&lt;&nbsp;filename&nbsp;&nbsp;有微小的区别。通常,两者都回按照你预期那样运行,但是使用&nbsp;-f打开了一些很好的特性,&nbsp;比如带行号的错误信息。而且,使用这个选项还有可能有减小启动负荷的机会。&nbsp;另一方面,如果你把所有内容手工输入,&nbsp;使用&nbsp;shell&nbsp;输入定向的方式(理论上)能保证生成和你已经得到的完全一样的输出(译注:重复运行命令)。 <DT><B>-F</B><I>separator</I><B></B><DD> <DT><B>--field-separator</B><I>separator</I><B></B><DD> <BR>&nbsp;使用&nbsp;separator&nbsp;作为域分隔符。等效于 <B>\pset fieldsep</B> 或<B>\f</B>。 <DT><B>-h</B><I>hostname</I><B></B><DD> <DT><B>--host</B><I>hostname</I><B></B><DD> <BR>&nbsp;声明正在运行服务器的主机名。&nbsp;如果主机名以斜扛开头,则它被用做到&nbsp;Unix&nbsp;域套接字的路径。 <DT><B>-H</B><DD> <DT><B>--html</B><DD> <BR>&nbsp;打开HTML格式输出。等效于\pset&nbsp;format&nbsp;html&nbsp;或<B>\H</B>&nbsp;命令。 <DT><B>-l</B><DD> <DT><B>--list</B><DD> <BR>&nbsp;列出所有可用的数据库,然后退出。其他非联接选项将被忽略。类似于内部命令 <B>\list</B>。 <DT><B>-o</B><I>filename</I><B></B><DD> <DT><B>--output</B><I>filename</I><B></B><DD> <BR>&nbsp;将所有查询输出定向到文件&nbsp;filename。这个选项等效于命令<B>\o</B>。 <DT><B>-p</B><I>port</I><B></B><DD> <DT><B>--port</B><I>port</I><B></B><DD> <BR>&nbsp;声明被服务器侦听的&nbsp;TCP&nbsp;端口或使用的缺省本地&nbsp;Unix&nbsp;主控套接字文件句柄。&nbsp;缺省的是环境变量PGPORT的值,如果没有设置的话是编译是声明的端口,通常是&nbsp;5432。 <DT><B>-P</B><I>assignment</I><B></B><DD> <DT><B>--pset</B><I>assignment</I><B></B><DD> <BR>&nbsp;允许你在命令行上以<B>\pset</B>&nbsp;的风格设置打印选项。&nbsp;要注意的是你在这里用等号分割名称和值,而不能用空格。&nbsp;因此要把输出格式设置为&nbsp;LaTeX,你可以敲入&nbsp;-P&nbsp;format=latex。 <DT><B>-q</B><DD> <DT><B>--quiet</B><DD> <BR>&nbsp;声明&nbsp;psql&nbsp;将安静地执行处理任务。&nbsp;缺省时psql将打印欢迎和许多其他输出信息。&nbsp;如果使用了此选项,这些都不出现。这在和&nbsp;-c&nbsp;选项一起使用时很有效。在&nbsp;psql&nbsp;里,你可以通过设置&nbsp;QUIET&nbsp;变量实现同样效果。 <DT><B>-R</B><I>separator</I><B></B><DD> <DT><B>--record-separator</B><I>separator</I><B></B><DD> <BR>&nbsp;使用&nbsp;separator&nbsp;做为记录分隔符。&nbsp;等效于<B>\pset&nbsp;recordsep</B>&nbsp;命令。 <DT><B>-s</B><DD> <DT><B>--single-step</B><DD> <BR>&nbsp;进入单步模式运行。意味着每个查询在发往服务器之前都要提示用户,&nbsp;用这个选项也可以取消执行。此选项主要用于调试脚本。 <DT><B>-S</B><DD> <DT><B>--single-line</B><DD> <BR>&nbsp;进入单行运行模式,这时每个命令都将由换行符结束,象分号那样。 <P> <DL COMPACT><DT><DD> <B>Note:</B> 注意: 注意这个模式是给那些坚持要这个特性的人的,我们不鼓励你这么用。 实际上,如果你在一行里混合使用 SQL 和元命令,执行的顺序对不熟练的用户而言不总是清晰的。 </DL> <P> <DT><B>-t</B><DD> <DT><B>--tuples-only</B><DD> <BR>&nbsp;关闭打印列名称和结果行计数脚注等信息。完全等效于元命令<B>\t</B>。 <DT><B>-T</B><I>table_options</I><B></B><DD> <DT><B>--table-attr</B><I>table_options</I><B></B><DD> <BR>&nbsp;允许你声明放在&nbsp;HTML&nbsp;table&nbsp;标记里的选项。&nbsp;参阅<B>\pset</B>&nbsp;获取细节。 <DT><B>-u</B><DD> <BR>&nbsp;让&nbsp;psql&nbsp;在和数据库联接之提示输入用户的用户名和口令。 <P> <BR>&nbsp;这个选项已经废弃了,因为它在概念上有漏洞。&nbsp;(提示输入非缺省用户名和提示输入服务器要求的口令是完全两码事。)我们鼓励你用&nbsp;-U&nbsp;和&nbsp;-W&nbsp;选项取代。 <DT><B>-U</B><I>username</I><B></B><DD> <DT><B>--username</B><I>username</I><B></B><DD> <BR>&nbsp;以用户&nbsp;username&nbsp;&nbsp;代替缺省用户与数据库联接。(当然,你必须有这么做的权限。) <DT><B>-v</B><I>assignment</I><B></B><DD> <DT><B>--set</B><I>assignment</I><B></B><DD> <DT><B>--variable</B><I>assignment</I><B></B><DD> <BR>&nbsp;进行一次变量分配,象内部命令<B>\set</B>&nbsp;那样。&nbsp;注意,如果有变量名和值的话,你必须在命令行上用等号分隔它们。要重置一个变量,&nbsp;去掉等号。这个分配是在启动的很早的阶段进行的,所以为内部使用保留的变量可能被再次覆盖。 <DT><B>-V</B><DD> <DT><B>--version</B><DD> <BR>&nbsp;显示psql版本。 <DT><B>-W</B><DD> <DT><B>--password</B><DD> <BR>&nbsp;要求&nbsp;psql&nbsp;在与一个数据库联接前提示输入口令。&nbsp;这个选项将在整个会话过程中有效,即使你用元命令&nbsp;<B>\connect</B>&nbsp;改变了所联接的数据库。 <P> 在当前版本里,如果服务器要求口令认证,psql 自动提出一个口令提示符。因为目 前这个特性是以一个"hack"为基础, 自动识别有可能奇怪地失效,因此用这个选项 强制一个提示符。 如果没有声明口令提示符而服务器要求口令认证,那么联接企图 将失败。 <DT><B>-x</B><DD> <DT><B>--expanded</B><DD> <BR>&nbsp;打开扩展表格式模式。等效于<B>\x</B>。&nbsp; <DT><B>-X,</B><DD> <DT><B>--no-psqlrc</B><DD> <BR>&nbsp;不读取启动文件&nbsp;<I>~/.psqlrc</I>。 <DT><B>-?</B><DD> <DT><B>--help</B><DD> <BR>&nbsp;显示关于psql命令行参数的帮助。 </DL> <A NAME="lbAF">&nbsp;</A> <H2>EXIT STATUS 退出状态</H2> <P> 如果正常结束,那么<B>psql</B> 向 shell 返回 0,如果自身发生致命错误,则返回 1(内存用尽,未找到文件等), 如果和数据库的连接失效而且会话不再活跃则返回 2,如果脚本中发生错误并且设置了 ON_ERROR_STOP 则返回 3。 <A NAME="lbAG">&nbsp;</A> <H2>USAGE 用法</H2> <A NAME="lbAH">&nbsp;</A> <H3>CONNECTING TO A DATABASE 与一个数据库联接</H3> <P> <B>psql</B> 是一个普通的 PostgreSQL 客户端应用。为了与一个数据库联接,你需要知道你的目标数据库, 服务器的主机名和端口号以及你希望以哪个用户的身份进行联接等信息。 我们可以通过命令行参数告诉 psql 这些信息,分别是 -d, -h,-p,和 -U。 如果有个参数不属于任何选项开关,那么它会被解释成数据库名(或者是用户名-如果数据库名称也给出了。)。 不是所有这些选项都是必须的,缺省的也可以。如果你省略主机名, psql 将通过 Unix 域套接字与本地主机的服务器相联。 缺省的端口号是编译时确定的。因为数据库服务器使用同样的缺省值, 所以在大多数设置下,你可能不需要声明端口号。缺省的用户名是你的 Unix 用户名,与数据库同名。 要注意的是你不能用任意用户名与任何数据库相联。你的数据库管理员应该告诉你你的访问权限。 你可以通过设置几个环境变量 PGDATABASE, PGHOST,PGPORT 和 PGUSER 为对应的值的方法节约几次敲击。 <P> <BR>&nbsp;如果因为任何原因而无法与数据库相联(例如,权限不够,服务器没有运行等),&nbsp;psql&nbsp;将返回一个错误并退出。 <A NAME="lbAI">&nbsp;</A> <H3>ENTERING SQL COMMANDS 输入 SQL 命令</H3> <P> <BR>&nbsp;通常状况下,psql&nbsp;提供一个带有&nbsp;psql&nbsp;正在与之联接的接数据库名的,后缀&nbsp;=&gt;的提示符。例如, <P> <PRE> $<B>psql testdb</B> Welcome to psql 7.4beta5, the PostgreSQL interactive terminal. Type: \copyright for distribution terms \h for help with SQL commands \? for help on internal slash commands \g or terminate with semicolon to execute query \q to quit testdb=&gt; </PRE> <P> <BR>&nbsp;用户可以在这个提示符下键入SQL&nbsp;查询。&nbsp;通常,输入的行将在命令终止分号出现时送到服务器。&nbsp;一行的终止并不结束命令!因此命令可以因清晰起见跨越好几行。如果命令发送出去而且没有错误,&nbsp;命令结果会显示在屏幕上。 <P> <BR>&nbsp;当命令正在进行时,psql&nbsp;同样还轮询由&nbsp;LISTEN&nbsp;[<B><A HREF="/manpages-zh/index.html?7+listen">listen</A></B>(7)]&nbsp;和&nbsp;NOTIFY&nbsp;[<B><A HREF="/cgi-bin/man/man2html?7+notify">notify</A></B>(7)]&nbsp;生成的异步通知信号。 <A NAME="lbAJ">&nbsp;</A> <H3>META-COMMANDS 元命令</H3> <P> <BR>&nbsp;你在&nbsp;psql&nbsp;里输入的任何以不带引号的反斜杠('\')开头的东西都是&nbsp;psql&nbsp;元命令,这些命令是由&nbsp;psql&nbsp;自己处理的。这些命令也是令&nbsp;psql&nbsp;可用于管理或书写脚本的原因。&nbsp;元命令更常见的叫法是斜杠或反斜杠命令。 <P> <BR>&nbsp;一个&nbsp;psql&nbsp;命令的格式是反斜杠后面紧跟一个命令动词,然后是任意参数。&nbsp;参数与命令动词和其他参数以任意个空白字符间隔。 <P> <BR>&nbsp;要在参数里面包含空白,你必须用单引号把它包围起来。&nbsp;要在这样的参数里包含单引号,前面加一个反斜杠。&nbsp;任何包含在单引号里的东西会被进一步进行类&nbsp;C&nbsp;的替换,把 \n (new line),\t (tab), \<I>digits</I>, \0<I>digits</I>, 和 \0x<I>digits</I> (给出的十进制,八进制,或十六进制码的字符)替换掉。 <P> <BR>&nbsp;如果一个不带引号的参数以冒号(:)开头,&nbsp;它会被当作一个psql&nbsp;变量,并且该变量的值会最终成为真正的参数值。&nbsp;(译注:类似&nbsp;ecpg&nbsp;和&nbsp;pl/pgsql&nbsp;的变量用法。) <P> <BR>&nbsp;用反引号&nbsp;(&quot;backticks&quot;&nbsp;`)&nbsp;包围的内容被当作一个命令行传入&nbsp;shell。&nbsp;该命令的输出(删除了结尾的新行)被当作参数值。上面描述的逃逸(字符)序列在反引号里也生效。 <P> <BR>&nbsp;有些命令以一个&nbsp;SQL&nbsp;标识的名称(如,一个表名)为参数。&nbsp;这些参数遵循&nbsp;SQL&nbsp;语法关于双引号的规则:&nbsp;不带双引号的标识强制成小写,&nbsp;而双引号保护字母不受大小写转换,并且允许在标识符中使用空白。&nbsp;在双引号中,成对的双引号在结果名字中分析成一个双引号。比如,&nbsp;FOO&quot;BAR&quot;BAZ&nbsp;解析成&nbsp;fooBARbaz,而&nbsp;&quot;A&nbsp;weird&quot;&quot;&nbsp;name&quot;&nbsp;变成&nbsp;A&nbsp;weird&quot;&nbsp;name。 name. <P> <BR>&nbsp;对参数的分析在碰到另一个不带引号的反斜杠时停止。&nbsp;这里会认为是一个新的元命令的开始。特殊序列&nbsp;\\&nbsp;(双反斜杠)标识参数的结尾并将继续分析后面的&nbsp;SQL&nbsp;命令(如果存在的话)。这样&nbsp;SQL&nbsp;和&nbsp;psql命令可以自由的在一行里面混合。&nbsp;但是在任何情况下,一条元命令的参数不能延续超过行尾。 <P> <BR>&nbsp;下列元命令是已定义的: <DL COMPACT> <DT><B>\a</B><DD> <BR>&nbsp;如果目前的表输出格式是不对齐的,切换成对齐的。&nbsp;如果是对齐的,切换成不对齐。这条命令是为了向后兼容。参阅<B>\pset</B>&nbsp;获取一个通用的解决方法。 <DT><B>\cd [</B><I>directory</I><B>]</B><DD> <BR>&nbsp;把当前工作目录改变到&nbsp;directory。&nbsp;没有参数是则改变到当前用户的家目录。 <P> <DL COMPACT><DT><DD> <B>Tip:</B> 提示: 要打印出你的当前工作目录,使用\!pwd. </DL> <P> <DT><B>\C [</B><I>title</I><B> ]</B><DD> <BR>&nbsp;把正在打印的表的标题设置为一个查询的结果或者取消这样的设置。&nbsp;这条命令等效于 \pset title<I>title</I>. (这条命令的名称源于 &quot;caption&quot;,因为以前只是用于在一个 HTML 表里面设置标题。) <DT><B>\connect (or\c) [</B><I>dbname</I><B> [</B><I>username</I><B> ] ]</B><DD> <BR>&nbsp;与一个新的数据库建立一个联接,使用/不用一个用户名。&nbsp;前面的联接将关闭。如果&nbsp;dbname&nbsp;是&nbsp;-,那么就假设是当前数据库名称。 <P> <BR>&nbsp;如果省略&nbsp;username,则假设是当前用户名。 <P> <BR>&nbsp;作为一条特殊规则,不带任何参数运行<B>\connect</B>&nbsp;&nbsp;将以缺省用户身份与缺省数据库连接(正如你不带任何参数运行&nbsp;psql&nbsp;一样。) <P> <BR>&nbsp;如果联接失败(用户名错,访问拒绝等),那么将保留前面的联接--当且仅当在&nbsp;psql&nbsp;处于交互模式下如此。&nbsp;如果运行的是非交互的脚本,处理会马上停止,并返回一个错误。&nbsp;选择这样的区别是一方面为用户使用方便考虑,另一方面为保证脚本不会碰巧操作了错误的数据库的安全机制考虑的。 <DT><B>\copy</B><I>table</I><B></B><DD> <BR>&nbsp;执行前端(客户端)拷贝。这是一个运行&nbsp;SQL&nbsp;&nbsp;COPY&nbsp;命令的操作,&nbsp;不同的是&nbsp;SQL&nbsp;COPY&nbsp;是服务器在读写指明的文件,而&nbsp;psql&nbsp;读写文件并作为本地的文件系统和服务器之间的路由取出或写入数据。&nbsp;这意味着文件访问性和权限都是本地用户的,而不是服务器的,因此不需要&nbsp;SQL&nbsp;超级用户权限。 <P> <BR>&nbsp;这条命令的语法是模拟&nbsp;SQL&nbsp;COPY&nbsp;命令的。(参考它的描述获取细节。)&nbsp;要注意的是由此而来,有一些特殊的分析规则应用于<B>\copy</B>&nbsp;命令。&nbsp;尤其是变量替换规则和反斜杠代换规则不起作用。 <P> <DL COMPACT><DT><DD> <B>Tip:</B> 提示: 此操作不象 SQL COPY 命令这样高效, 因为所有数据必须通过客户端/服务器联接。对于大数据量的操作,另一种方法更可行。 </DL> <P> <P> <DL COMPACT><DT><DD> <B>Note:</B> 注意: 注意在客户端和服务器拷贝时对 stdin 和 stdout 的解释的区别:在前端拷贝时,这些总是指 psql的输入和输出流。在服务器拷贝时 stdin 来自 COPY 本身的标准输入(比如,一个带有 -f 选项的脚本), 而 stdout 指的是查询输出流(参阅下面的<B>\o</B> 元命令)。 </DL> <P> <DT><B>\copyright</B><DD> <BR>&nbsp;显示&nbsp;PostgreSQL&nbsp;的版权和版本信息。 <DT><B>\d [</B><I>pattern</I><B> ]</B><DD> <BR>&nbsp;对于每个匹配pattern的关系(表,视图,索引或者序列),&nbsp;显示所有列,它们的类型,和任何特殊属性,象NOT&nbsp;NULL或缺省等--只要存在。&nbsp;如果实际上这个关系是一个表,任何已定义的索引,主键,唯一约束相关的索引,规则,约束,和触发器也同样显示出来,&nbsp;如果关系是一个视图,还显示视图的定义。&nbsp;(&quot;匹配模式&quot;在下面定义。) <P> 从\d+ 来的命令也是一样的,只不过还显示与表的列关联的注解。 <P> <DL COMPACT><DT><DD> <B>Note:</B> 注意: 如果如果不带任何pattern调用<B>\d</B> , 等效于<B>\dtvs</B>,将显示一个所有表,视图和序列的列表。 这完全是出于方便的考虑。 </DL> <P> <DT><B>\da [</B><I>pattern</I><B> ]</B><DD> <BR>&nbsp;列出所有可用聚集函数,以及它们操作的数据类型。如果声明了&nbsp;pattern,那么只显示匹配(正则表达式)的聚集函数。 <DT><B>\dc [</B><I>pattern</I><B> ]</B><DD> <BR>&nbsp;列出所有字符集之间的可用转换。如果声明了&nbsp;pattern,&nbsp;则只列出那些匹配模式的转换。 <DT><B>\dC</B><DD> <BR>&nbsp;列出所有类型转换。 <DT><B>\dd [</B><I>pattern</I><B> ]</B><DD> <BR>&nbsp;显示所有匹配&nbsp;pattern&nbsp;&nbsp;的描述,如果没有给出参数,显示所有可视对象。&nbsp;但是不管怎样,只有那些有描述内容的对象才显示出来。&nbsp;(&quot;对象&quot;包括聚集,函数,操作符,类型,&nbsp;关系(表,视图,索引,序列,大对象),规则和触发器。)例如: <P> <PRE> =&gt;<B>\dd version</B> Object descriptions Schema | Name | Object | Description ------------+---------+----------+--------------------------- pg_catalog | version | function | PostgreSQL version string (1 row) </PRE> <P> <BR>&nbsp;可以用<B>COMMENT&nbsp;&nbsp;SQL</B>&nbsp;命令生成对对象的描述。 <DT><B>\dD [</B><I>pattern</I><B> ]</B><DD> <BR>&nbsp;列出所有可用域。如果声明了&nbsp;pattern,那么只显示匹配的域。 <DT><B>\df [</B><I>pattern</I><B> ]</B><DD> <BR>&nbsp;列出所有可用函数,以及它们的参数和返回的数据类型。如果声明了&nbsp;pattern,那么只显示匹配(正则表达式)的函数。如果使用了\df+&nbsp;的形式,每个函数的附加信息,包括语言和描述也会显示出来。 <P> <DL COMPACT><DT><DD> <B>Note:</B> 注意: 为了减少混乱,\df 并不显示数据类型的 I/O 函数。 这样是通过忽略那些接受或者返回类型 cstring 的函数实现的。 </DL> <P> <DT><B>\distvS [</B><I>pattern</I><B> ]</B><DD> <BR>&nbsp;这不是一个实际上的命令名称:字母&nbsp;i,s,t,v,S&nbsp;分别代表索引(index),&nbsp;序列(sequence),表(table),视图(view)和系统表(system&nbsp;table)。&nbsp;你可以以任意顺序声明任意或者所有这些字母获得这些对象的一个列表。&nbsp;字幕&nbsp;S&nbsp;把列表限制于系统对象;如果没有&nbsp;S,则只显示非系统对象。&nbsp;如果在命令名上附加了&nbsp;+,那么还会列出和每个对象相关联的描述,如果有的话。 <P> <BR>&nbsp;如果声明了&nbsp;pattern,那么只列出匹配模式的对象。 <DT><B>\dl</B><DD> 这是<B>\lo_list</B> 的别名,显示一个大对象的列表。 <DT><B>\dn [</B><I>pattern</I><B> ]</B><DD> <BR>&nbsp;列出所有可用模式(名字空间)。如果声明了&nbsp;pattern&nbsp;&nbsp;(一个正则表达式),那么只列出匹配模式的模式名。 <DT><B>\do [</B><I>pattern</I><B> ]</B><DD> <BR>&nbsp;列出所有可用操作符,以及它们的操作数和返回的数据类型。&nbsp;如果声明了&nbsp;pattern,那么只显示匹配模式的操作符。 <DT><B>\dp [</B><I>pattern</I><B> ]</B><DD> <BR>&nbsp;生成一列可用的表和它们相关的权限。&nbsp;如果声明了&nbsp;pattern,&nbsp;那么只列出名字可以匹配模式的表。 <P> <BR>&nbsp;命令<B><A HREF="/manpages-zh/index.html?7+grant">grant</A></B>(7)&nbsp;和<B><A HREF="/cgi-bin/man/man2html?7+revoke">revoke</A></B>(7)&nbsp;用于设置访问权限。参阅<B><A HREF="/cgi-bin/man/man2html?7+grant">grant</A></B>(7)&nbsp;获取更多信息。 <DT><B>\dT [</B><I>pattern</I><B> ]</B><DD> <BR>&nbsp;列出所有数据类型或只显示那些匹配&nbsp;pattern的。这条命令的\dT+&nbsp;形式显示更多信息。 <DT><B>\du [</B><I>pattern</I><B> ]</B><DD> <BR>&nbsp;列出所有已配置用户或者只列出那些匹配&nbsp;pattern&nbsp;的用户。 <DT><B>\edit (or\e) [</B><I>filename</I><B> ]</B><DD> 如果声明了 filename, 则编辑此文件并且在编辑器退出后将其内容拷贝回查询缓 冲区。 如果没有给出参数,则把当前查询缓冲区内容拷贝到一个临时文件然后以相 同方式编辑。 <P> 然后根据一般的psql规则重新分析查询缓冲区, 这时整个缓冲区当作一个单行。 (因此你无法用这个方法制作"脚本",用<B>\i</B> 做脚本。) 这还意味着 如果该查询以分号结尾(或者包含分号),它就会马上被执行。否则它只是在查询 缓冲区里等待。 <P> <DL COMPACT><DT><DD> <B>Tip:</B> 提示: psql 搜索环境变量 PSQL_EDITOR,EDITOR 和 VISUAL(以此顺序)查找要用到哪个编辑器。如果上面的都没有设置,使用<I>/bin/vi</I>。 </DL> <P> <DT><B>\echo</B><I>text</I><B> [ ... ]</B><DD> <BR>&nbsp;向标准输出打印参数,用一个空格分隔并且最后跟着一个新行。&nbsp;这个特性在显示脚本的输出时会有用。例如: <P> <PRE> =&gt;<B>\echo `date`</B> Tue Oct 26 21:40:57 CEST 1999 </PRE> <BR>&nbsp;果第一个参数是一个无引号的&nbsp;-n,那么不会写出结尾的新行。 <P> <DL COMPACT><DT><DD> <B>Tip:</B> 提示: 如果你使用<B>\o</B> 命令重定向你的查询的输出,你可能会用<B>\qecho</B> 取代这条命令。 </DL> <P> <DT><B>\encoding [</B><I>encoding</I><B> ]</B><DD> <BR>&nbsp;设置客户端字符编码方式。不带参数时,这条命令显示当前的编码方式。 <DT><B>\f [</B><I>string</I><B> ]</B><DD> <BR>&nbsp;为不对齐的查询输出设置域分隔符。缺省时是竖条(|)。&nbsp;参阅<B>\pset</B>&nbsp;获取设置输出选项的通用方法。 <DT><B>\g [ {</B><I>filename</I><B> | |</B><I>command</I><B> } ]</B><DD> <BR>&nbsp;把当前的查询输入缓冲区的内容发送给服务器并且把输出输出到可选的&nbsp;filename&nbsp;&nbsp;或者把输出定向到一个独立的&nbsp;Unix&nbsp;shell&nbsp;执行&nbsp;command。&nbsp;单独一个\g&nbsp;实际上等效于一个分号。一个带有参数的\g&nbsp;是&quot;一次性&quot;的\o&nbsp;命令的代用品。 <DT><B>\help (or\h) [</B><I>command</I><B> ]</B><DD> <BR>&nbsp;给出指定&nbsp;SQL&nbsp;命令的语法帮助。如果没有给出&nbsp;command&nbsp;,那么&nbsp;psql&nbsp;将列出可获得语法帮助的所有命令。如果&nbsp;command&nbsp;&nbsp;是一个星号(&quot;*&quot;),则显示所有&nbsp;SQL&nbsp;命令的语法帮助。 <P> <DL COMPACT><DT><DD> <B>Note:</B> 注意: 为简化敲击,包含多个单字的命令不需要引用。因此键入<I>\help alter table</I> 是正确的。 </DL> <P> <DT><B>\H</B><DD> <BR>&nbsp;打开&nbsp;HTML&nbsp;查询输出格式。如果&nbsp;HTML&nbsp;&nbsp;格式已经打开,则切换回缺省的对齐的文本格式。&nbsp;这个命令是为了兼容和方便,参阅<B>\pset</B>&nbsp;获取设置其他输出选项的内容。 <DT><B>\i</B><I>filename</I><B></B><DD> <BR>&nbsp;从文件filename中读取并把其内容当作从键盘输入的那样执行查询。 <P> <DL COMPACT><DT><DD> <B>Note:</B> 注意: 如果你想在屏幕上看到读入的行,你必须对所有行设置变量 ECHO 为 all。 </DL> <P> <DT><B>\l (or\list)</B><DD> <BR>&nbsp;列出服务器上所有数据库的名字和它们的所有者以及字符集编码。在命令名称后面加一个&nbsp;&quot;+&quot;&nbsp;还可以看到对数据库的描述。 <DT><B>\lo_export</B><I>loid</I><B></B><I>filename</I><B></B><DD> <BR>&nbsp;从数据库里读取&nbsp;OID&nbsp;为&nbsp;loid&nbsp;&nbsp;的大对象并把她写到&nbsp;filename里。&nbsp;注意这个功能与服务器函数&nbsp;lo_export&nbsp;有些微小的区别,&nbsp;lo_export&nbsp;运行时带着运行数据库服务器的用户权限,&nbsp;而且是在服务器的文件系统上。 <P> <DL COMPACT><DT><DD> <B>Tip:</B> 提示: 使用<B>\lo_list</B> 查看大对象的 OID。 OID. </DL> <P> <DT><B>\lo_import</B><I>filename</I><B> [</B><I>comment</I><B> ]</B><DD> <BR>&nbsp;把文件存储为一个&nbsp;PostgreSQL&nbsp;大对象。可以带着一个该对象的注解选项。例如: <P> <PRE> foo=&gt;<B>\lo_import '/home/peter/pictures/photo.xcf' 'a picture of me'</B> lo_import 152801 </PRE> <BR>&nbsp;响应表明此大对象得到一个对象标识&nbsp;152801,如果你还想访问该对象,就应该把这个对象标识记住。&nbsp;因此,我们建议总是给每个对象关联一个人类可读的注解。那样就可以用<B>\lo_list</B>&nbsp;命令看到这些注解。 <P> <BR>&nbsp;注意这条命令与服务器端的&nbsp;lo_import&nbsp;有一些区别,因为这条命令是本地用户在本地文件系统上操作,&nbsp;而不是以服务器用户在服务器文件系统上操作。 <DT><B>\lo_list</B><DD> <BR>&nbsp;显示一个目前存储在该数据库里的所有&nbsp;PostgreSQL&nbsp;大对象和它们的所有者的列表。 <DT><B>\lo_unlink</B><I>loid</I><B></B><DD> <BR>&nbsp;从数据库里删除OID为<I>loid</I>&nbsp;的大对象。 <P> <DL COMPACT><DT><DD> <B>Tip:</B> 提示: 使用<B>\lo_list</B> 查找大对象的 OID。 OID. </DL> <P> <DT><B>\o [ {</B><I>filename</I><B> | |</B><I>command</I><B>} ]</B><DD> <BR>&nbsp;把后面的查询结果保存到文件&nbsp;filename&nbsp;&nbsp;里或者把后面的查询结果定向到一个独立的&nbsp;Unix&nbsp;shell&nbsp;执行&nbsp;command。&nbsp;如果没有声明参数,查询输出重置为标准输出。 <P> &quot;查询结果&quot;包括所有表,命令响应和从数据库服务器来的提示, 同样还有各种各样查询数据库的反斜杠命令的输出(如<B>\d</B>),但是没有错误信息。 <P> <DL COMPACT><DT><DD> <B>Tip:</B> 提示: 要用文本分散查询结果之间的输出,用<B>\qecho</B>。 </DL> <P> <DT><B>\p</B><DD> <BR>&nbsp;打印当前查询缓冲区到标准输出。 <DT><B>\pset</B><I>parameter</I><B> [</B><I>value</I><B> ]</B><DD> <BR>&nbsp;这条命令设置影响查询结果表输出的选项。parameter&nbsp;&nbsp;描述要设置的选项是哪一个。value&nbsp;的语意也取决于它。 <P> <BR>&nbsp;可调节的打印选项有: <DL COMPACT><DT><DD> <DL COMPACT> <DT><B>format</B><DD> <BR>&nbsp;设置输出格式为&nbsp;unaligned,aligned,html,&nbsp;或&nbsp;latex之一。允许使用唯一的缩写。(这也意味着一个字母就够了。) <P> &quot;Unaligned&quot; (不对齐)把一条记录的所有字段都输出到一行, 用当前有效的域分隔符分隔。这主要用于生成那些要被其他程序读取的输出(tab分隔,逗号分隔)。 &quot;Aligned&quot; (对齐)模式是标准的,人类可读的,格式化好了的文本输出,也是缺省。 &quot;HTML&quot; 和 &quot;LaTeX&quot; 模式把表输出为可用于文档里的对应标记语言。它们还不是完整的文档! (可能对于 HTML 变化还不是太大,但是在 LaTeX 里,你必须有一个完整的文档包装器。) <DT><B>border</B><DD> <BR>&nbsp;第二个参数必须是一个数字。通常,数字越大,表就有越宽的边界和越多的线,&nbsp;但是这个参数取决于实际的格式。在HTML模式里,&nbsp;这个参数会直接翻译成border=...属性,在其他的模式里,&nbsp;只有值&nbsp;0&nbsp;(无边界),1&nbsp;(内部分隔线)和&nbsp;2&nbsp;(表框架)有意义。 <DT><B>expanded (or x)</B><DD> <BR>&nbsp;在正常和扩展格式之间切换。当打开扩展格式时,所有的输出都是两列,&nbsp;字段名称在左,数据在右。&nbsp;这个模式在数据无法放进通常的&quot;水平&quot;模式的屏幕时很有用。 <P> <BR>&nbsp;所有四种输出模式都支持扩展格式。 <DT><B>null</B><DD> <BR>&nbsp;第二个参数是一个字串,用以代表字段的值为&nbsp;null&nbsp;时的打印输出。&nbsp;缺省是什么都不打,这样很容易和类似一个空字串混淆。&nbsp;因此,我们可能选择\pset&nbsp;null&nbsp;'(null)'。 <DT><B>fieldsep</B><DD> <BR>&nbsp;声明在非对齐模式时的域分隔符。&nbsp;这样我们就可以创建其他程序希望的tab或逗号分隔的输出。要设置&nbsp;tab&nbsp;域分隔符,&nbsp;键入\pset&nbsp;fieldsep&nbsp;' '。缺省域分隔符是&nbsp;'|'&nbsp;(一个竖条符号)。 <DT><B>footer</B><DD> <BR>&nbsp;切换默认足标的显示&nbsp;(x&nbsp;rows)。 <DT><B>recordsep</B><DD> <BR>&nbsp;声明在非对齐模式时的记录分隔符。缺省是换行符。 <DT><B>tuples_only (或 t)</B><DD> <BR>&nbsp;在完全显示和只显示记录之间切换。&nbsp;完全显示将显示象列头,标题和各种脚注等信息。&nbsp;只显示记录模式将只显示实际的表数据。 <DT><B>title [</B><I>text</I><B> ]</B><DD> <BR>&nbsp;为任何随后打印的表设置标题。&nbsp;这个参数可以用于给你的输出一个描述性标记。&nbsp;如果不带参数,重置标题。 <DT><B>tableattr (or T) [</B><I>text</I><B> ]</B><DD> <BR>&nbsp;允许你声明放在&nbsp;HTML&nbsp;table&nbsp;标记里的任何属性。例如,可以是&nbsp;cellpadding&nbsp;或&nbsp;bgcolor。注意你可能不需要在这里声明&nbsp;border&nbsp;,因为已经在\pset&nbsp;border&nbsp;里用过了。 <DT><B>pager</B><DD> <BR>&nbsp;控制查询和psql帮助输出的分页器。如果设置了环境变量&nbsp;PAGER,&nbsp;输出被定向到指定程序,否则使用系统缺省(比如&nbsp;more)。 <P> <BR>&nbsp;如果关闭了分页器,则不使用它,如果打开了,程序只在需要的时候使用分页器,也就是说,&nbsp;输出是到终端,而且那个表很可能无法与屏幕匹配。&nbsp;(psql&nbsp;在决定何时分页时不是很完美。)\pset&nbsp;pager&nbsp;开关分页器。我们也可以把分页器设置为&nbsp;always,导致我们在任何情况下都使用分页器。 </DL> </DL> </DL> <P> <P> <BR>&nbsp;可以在&nbsp;&quot;Examples&nbsp;例子&quot;&nbsp;节看到这些不同格式输出的示例。 <P> <DL COMPACT><DT><DD> <B>Tip:</B> 提示: 有很多用于<B>\pset</B> 的快速命令。参阅 <B>\a</B>,<B>\C</B>,<B>\H</B>, <B>\t</B>,<B>\T</B>, 和<B>\x</B>。 </DL> <P> <P> <DL COMPACT><DT><DD> <B>Note:</B> 注意: 无参数运行<B>\pset</B> 是错误的。 以后这样调用将显示当前打印选项状态。 </DL> <P> <DL COMPACT> <DT><B>\q</B><DD> <BR>&nbsp;退出&nbsp;psql&nbsp;程序。 <DT><B>\qecho</B><I>text</I><B> [ ... ]</B><DD> <BR>&nbsp;这条命令等效于<B>\echo</B>&nbsp;,区别是所有输出将写入由<B>\o</B>&nbsp;设置的输出通道。 <DT><B>\r</B><DD> <BR>&nbsp;重置(清空)查询缓冲区。 <DT><B>\s [</B><I>filename</I><B> ]</B><DD> <BR>&nbsp;将命令行历史打印出或是存放到&nbsp;filename。&nbsp;如果省略&nbsp;filename,&nbsp;历史将输出到标准输出。这个选项只有在&nbsp;psql&nbsp;配置成使用&nbsp;GNU&nbsp;历史库后才生效。 <P> <DL COMPACT><DT><DD> <B>Note:</B> 注意: 在当前版本里,这个( GNU 历史库)不再是必须的了, 实际上,在程序结束时自动保存命令行历史。每次 psql 启动都会装载命令行历史。 </DL> <P> <DT><B>\set [</B><I>name</I><B> [</B><I>value</I><B> [ ... ]]]</B><DD> <BR>&nbsp;设置内部变量&nbsp;name&nbsp;&nbsp;为&nbsp;value&nbsp;或着如果给出了多于一个值,&nbsp;设置为所有这些值的联接结果。如果没有给出第二个参数,只设变量不设值。要重置一个变量,使用<B>\unset</B>&nbsp;命令。 <P> <BR>&nbsp;有效的变量名可以包含字符,数字和下划线。&nbsp;参阅下面的&nbsp;&quot;Variables&nbsp;变量&quot;&nbsp;获取细节。 <P> <BR>&nbsp;尽管你可以设置任何变量为任意值,&nbsp;psql对一些变量特殊对待。它们在关于变量的节里面有文档。 <P> <DL COMPACT><DT><DD> <B>Note:</B> 注意: 这条命令是完全和 SQL 命令 SET [<B><A HREF="/manpages-zh/index.html?7+set">set</A></B>(7)] 不一样的。 </DL> <P> <DT><B>\t</B><DD> <BR>&nbsp;切换输出的列/字段名的信息头和行记数脚注。&nbsp;这条命令等效于\pset&nbsp;tuples_only,提供主要为了方便。 <DT><B>\T</B><I>table_options</I><B></B><DD> <BR>&nbsp;允许你在使用HTML输出模式时声明放在&nbsp;table&nbsp;标记里的属性。&nbsp;这条命令等效于\pset&nbsp;tableattr&nbsp;table_options。 <DT><B>\timing</B><DD> 切换每个 SQL 语句使用的时间,单位是毫秒。 <DT><B>\w {</B><I>filename</I><B> |</B><I>|command</I><B>}</B><DD> <BR>&nbsp;将当前查询缓冲区输出到文件&nbsp;filename&nbsp;&nbsp;或者定向到&nbsp;Unix&nbsp;命令&nbsp;command。 <DT><B>\x</B><DD> <BR>&nbsp;切换扩展行格式。等效于\pset&nbsp;expanded。 <DT><B>\z [</B><I>pattern</I><B> ]</B><DD> <BR>&nbsp;生成一个带有访问权限列表的数据库中所有表的列表。&nbsp;如果给出任何pattern,则被当成一个规则表达式,&nbsp;只显示匹配的表。 <P> <BR>&nbsp;命令<B><A HREF="/manpages-zh/index.html?7+grant">grant</A></B>(7)&nbsp;和<B><A HREF="/cgi-bin/man/man2html?7+revoke">revoke</A></B>(7)&nbsp;用于设置访问权限。&nbsp;参阅<B><A HREF="/cgi-bin/man/man2html?7+grant">grant</A></B>(7)&nbsp;获取更多信息。 <P> <BR>&nbsp;这是<B>\dp</B>(&quot;显示权限&quot;)的别名。 <DT><B>\! [</B><I>command</I><B> ]</B><DD> <BR>&nbsp;返回到一个独立的&nbsp;Unix&nbsp;shell&nbsp;或者执行&nbsp;Unix&nbsp;命令&nbsp;command。&nbsp;参数不会被进一步解释,shell&nbsp;将看到全部参数。 <DT><B>\?</B><DD> <BR>&nbsp;获得关于反斜杠命令的帮助信息。 </DL> <P> <P> <BR>&nbsp;各种\d&nbsp;命令都接受一个&nbsp;pattern&nbsp;&nbsp;参数,声明要显示的对象名字。*&nbsp;表示&quot;任何字符序列&quot;,&nbsp;而&nbsp;?&nbsp;表示&quot;任何单个字符&quot;。(这个表示法和&nbsp;Unix&nbsp;的&nbsp;shell&nbsp;文件名模式兼容。)&nbsp;高级用户也可以使用正则表达式表示法,比如字符表,[0-9]&nbsp;这样的东西来匹配&quot;任意数字&quot;。&nbsp;要让任何这些模式匹配字符可以安字面方式解析,那就应该用双引号包围它们。 <P> <BR>&nbsp;一个包含(无引号的)句点的模式会被解析承一个模式名的模式后面跟着一个对象名的模式。&nbsp;比如,\dt&nbsp;foo*.bar*&nbsp;显示所有以foo&nbsp;开头的模式里的以&nbsp;bar&nbsp;开头的表名字。&nbsp;如果没有出现句点,那么这个模式只匹配在当前模式搜索路径中可见的对象。 <P> <BR>&nbsp;如果完全省略&nbsp;pattern&nbsp;参数,&nbsp;那么\d&nbsp;命令显示所有在当前模式搜索路径中可见的对象。&nbsp;要查阅在数据库中的所有对象,使用模式&nbsp;*.*。 <A NAME="lbAK">&nbsp;</A> <H3>ADVANCED FEATURES 高级特性</H3> <A NAME="lbAL">&nbsp;</A> <H3>VARIABLES 变量</H3> <P> <B>psql</B> 提供类似通常 Unix 命令 shell 那样的变量替换特性。 变量只是简单的名称/数值对, 这里的值可以是任何长度的任何值。要设置一个变量,使用 psql 元命令 <B>\set</B>: <P> <PRE> testdb=&gt;<B>\set foo bar</B> </PRE> <BR>&nbsp;把变量&quot;foo&quot;&nbsp;设置为值&nbsp;&quot;bar&quot;。&nbsp;要检索变量的内容,在变量名前面放上冒号然后把它用在任意斜杠命令里: <P> <PRE> testdb=&gt;<B>\echo :foo</B> bar </PRE> <P> <DL COMPACT><DT><DD> <B>Note:</B> 注意: <B>\set</B> 的参数服从和其他命令一样的替换规则。 因此你可以构造有趣的引用,象\set :foo 'something' 这样, 获得分别象Perl或 PHP那样有名的&quot;软连接(soft links)&quot;或&quot;变量 变量&quot;。 不幸的是(或者 万幸的?),用这些构造不能做任何有用的事情。另一方面,\set bar :foo 是一个非常有效的拷贝变量的方法。 </DL> <P> <P> <BR>&nbsp;如果你不带第二个参数调用<B>\set</B>,&nbsp;那么只是设置这个变量而没有值。&nbsp;要重置(或删除)一个变量,使用命令<B>\unset</B>。 <P> <B>psql</B> 的内部变量可以包括任意顺序, 任意数量的字母,数字和下划线。 有一些常用变量被 psql 另眼相待。它们是一些选项设置, 这些选项在运行时可以通过改变变量的值或者改变一些应用的表现状态而改变。 尽管你可以把这些变量用于其他用途,但是我们不鼓励这么做,因为程序的特性可能会很快变得非常奇怪。 通常,所有特殊对待的变量都是由大写字母组成(可能还有数字和下划线)。 为了保证和未来的最大限度的兼容性,请避免使用这样的变量。 下面是一个所有特殊对待的变量列表。 <DL COMPACT> <DT><B>AUTOCOMMIT</B><DD> <BR>&nbsp;如果是&nbsp;on(缺省),那么每个&nbsp;SQL&nbsp;命令都在成功完成后自动提交。&nbsp;要推迟这种模式下的提交,你必须输入一个&nbsp;BEGIN&nbsp;或者&nbsp;START&nbsp;TRANSACTION&nbsp;SQL&nbsp;命令。&nbsp;如果是&nbsp;off&nbsp;或者未设置,SQL&nbsp;命令不会提交,知道你明确地发出&nbsp;COMMIT&nbsp;或者&nbsp;END。&nbsp;关闭自动提交的模式是通过为你明确发出一个&nbsp;BEGIN&nbsp;实现的,&nbsp;它是放在任何尚未在一个事务块中并且自己不是&nbsp;BEGIN&nbsp;或者其它事务控制命令的前面。 <P> <DL COMPACT><DT><DD> <B>Note:</B> 注意: 在关闭自动提交的模式下,你必须明确放弃任何失败的事务,方法是执行 ABORT 或者 ROLLBACK。 还要注意如果你不提交就退出会话,你的工作会丢失。 </DL> <P> <P> <DL COMPACT><DT><DD> <B>Note:</B> 注意: 自动提交打开方式是 PostgreSQL 传统的行为, 但是关闭自动提交更接近 SQL 规范。如果你喜欢关闭自动提交,你应该在你的<I>.psqlrc</I> 文件里设置它。 </DL> <P> <DT><B>DBNAME</B><DD> <BR>&nbsp;你正在联接着的数据库名称。&nbsp;每次你与一个数据库联结都会设置这个值(包括程序启动),但是可以删除。 <DT><B>ECHO</B><DD> <BR>&nbsp;如果置为&nbsp;all,&nbsp;输入的或者来自一个脚本的所有行在分析或执行前都写到标准输出。&nbsp;要在程序启动时声明这些,使用&nbsp;-a如果设置为&nbsp;queries,&nbsp;psql&nbsp;只是在查询发送给服务器之前打印出来。&nbsp;实现这个功能的命令行选项是&nbsp;-e。 <DT><B>ECHO_HIDDEN</B><DD> <BR>&nbsp;当设置了这个变量并且一个反斜杠命令查询数据库时,首先显示查询。&nbsp;这样你可以学习&nbsp;PostgreSQL&nbsp;&nbsp;内部的东西并且在你自己的程序里提供类似功能。如果你设置该变量的值为&nbsp;&quot;noexec&quot;,查询只是显示出来但是实际上不发送到服务器和执行。 <DT><B>ENCODING</B><DD> <BR>&nbsp;当前的客户端字符集编码。 <DT><B>HISTCONTROL</B><DD> <BR>&nbsp;如果这个变量设置为&nbsp;ignorespace,&nbsp;以空格开始的行将不会进入历史列表。&nbsp;如果设置为变量&nbsp;ignoredups,&nbsp;与以前历史记录里匹配的行也不会进入历史记录。值&nbsp;ignoreboth是上面两个的结合。&nbsp;如果删除此变量或者其值为任何与上面的值不同的东西,&nbsp;所有交互模式读入的行都被保存入历史列表。 <P> <DL COMPACT><DT><DD> <B>Note:</B> 注意: 这个特性是无耻地从<B>bash</B> 里剽窃来的。 </DL> <P> <DT><B>HISTSIZE</B><DD> <BR>&nbsp;存在命令历史里的命令的个数。缺省值是&nbsp;500。 <P> <DL COMPACT><DT><DD> <B>Note:</B> 注意: 这个特性是无耻地从<B>bash</B> 里剽窃来的。 </DL> <P> <DT><B>HOST</B><DD> <BR>&nbsp;当前你正联接的数据库服务器主机。&nbsp;这是在每次你与数据库联接时(包括程序启动)设置的,但是可以删除。 <DT><B>IGNOREEOF</B><DD> <BR>&nbsp;如果删除此变量,向一个交互的&nbsp;psql会话发送一个&nbsp;EOF&nbsp;(通常是<B>Control</B>+<B>D</B>)将终止应用。如果设置为一个数字值,那么在应用终止前该数值的&nbsp;EOF&nbsp;字符将被忽略。&nbsp;如果设置了此变量但是没有数字值,缺省是&nbsp;10。 <P> <DL COMPACT><DT><DD> <B>Note:</B> 注意: 这个特性是无耻地从<B>bash</B> 里剽窃来的。 </DL> <P> <DT><B>LASTOID</B><DD> <BR>&nbsp;最后影响的oid值,即为从一条&nbsp;INSERT&nbsp;或&nbsp;lo_insert&nbsp;命令返回的值。&nbsp;此变量只保证在下一条&nbsp;SQL&nbsp;命令的结果显示之前有效。 <DT><B>ON_ERROR_STOP</B><DD> <BR>&nbsp;缺省时,如果非交互的脚本碰到一个错误,象一条错误的&nbsp;SQL&nbsp;命令或者内部元命令,处理会继续进行。&nbsp;这是&nbsp;psql&nbsp;的传统特性,&nbsp;但是有时候我们不太希望这样。如果设置了这个变量,脚本处理将马上停止。&nbsp;如果该脚本是从另外一个脚本调用的,那个脚本也会按同样的方式停止。&nbsp;如果最外层的脚本不是从一次交互的&nbsp;psql&nbsp;&nbsp;会话中调用的而是用&nbsp;-f&nbsp;选项调用的,psql&nbsp;&nbsp;将返回错误代码&nbsp;3,以示这个情况与致命错误条件的区别(错误代码&nbsp;1)。 <DT><B>PORT</B><DD> <BR>&nbsp;当前你正在联接的数据库服务器的端口。&nbsp;这是在每次你与数据库联接时(包括程序启动)设置的,但是可以删除。 <DT><B>PROMPT1</B><DD> <DT><B>PROMPT2</B><DD> <DT><B>PROMPT3</B><DD> <BR>&nbsp;这些指明psql&nbsp;显示的提示符看上去象什么。&nbsp;参阅下面的&nbsp;&quot;Prompting&nbsp;提示符&quot;。 <DT><B>QUIET</B><DD> <BR>&nbsp;这个变量等效于命令行选项&nbsp;-q。&nbsp;可能在交互模式下没有什么用。 <DT><B>SINGLELINE</B><DD> <BR>&nbsp;这个变量等效于设置命令行选项&nbsp;-S。你可以在运行时删除或设置它。 <DT><B>SINGLESTEP</B><DD> <BR>&nbsp;这个变量等效于命令行选项<B>-s</B>。 <DT><B>USER</B><DD> <BR>&nbsp;当前你正用于联接的数据库用户。&nbsp;这是在每次你与数据库联接时(包括程序启动)设置的,但是可以删除/重置。 <DT><B>VERBOSITY</B><DD> <BR>&nbsp;这个选项可以设置为值&nbsp;default,verbose,或者&nbsp;terse&nbsp;&nbsp;以控制错误报告的冗余行。 </DL> <A NAME="lbAM">&nbsp;</A> <H3>SQL INTERPOLATION 代换</H3> <P> <BR>&nbsp;一个附加的&nbsp;psql&nbsp;变量的有用特性是你可以把它们替换(&quot;代换&quot;)成正规的&nbsp;SQL&nbsp;语句。这样做的语法同样还是变量名前面加一个冒号(:)。 <P> <PRE> testdb=&gt;<B>\set foo 'my_table'</B> testdb=&gt;<B>SELECT * FROM :foo;</B> </PRE> <BR>&nbsp;将会查询表my_table。变量的值是逐字拷贝的,&nbsp;所以它甚至可以包含不对称的引号或反斜杠命令。你必须保证你输入的东西是有意义的。&nbsp;变量替换将不会在引号引起来的&nbsp;SQL&nbsp;语句里面发生。 <P> <BR>&nbsp;利用这个功能的一个时髦的应用是通过使用一个随后的语句中最后插入的&nbsp;OID&nbsp;建立一个外键仿真场景。&nbsp;另一个可能用到这个机制的地方是把一个文件的内容拷贝到一个字段里面去。&nbsp;首先把文件装载到一个变量然后象上面那样处理。 <P> <PRE> testdb=&gt;<B>\set content '\'' `cat my_file.txt` '\''</B> testdb=&gt;<B>INSERT INTO my_table VALUES (:content);</B> </PRE> <BR>&nbsp;这样处理的一个可能问题是&nbsp;my_file.txt&nbsp;&nbsp;可能包含单引号。这些需要被逃逸以免在处理第三行时不会导致语法错误。&nbsp;可以使用程序&nbsp;sed&nbsp;来做这个处理: <P> <PRE> testdb=&gt;<B>\set content '\'' `sed -e &quot;s/'/\\\\\\'/g&quot; &lt; my_file.txt` '\''</B> </PRE> <BR>&nbsp;观察正确数量的反斜杠(6)!你可以这样解释它:在&nbsp;psql&nbsp;分析完这行后,它把&nbsp;sed&nbsp;-e&nbsp;&quot;s/'/\\\'/g&quot;&nbsp;&lt;&nbsp;my_file.txt&nbsp;传递给shell。&nbsp;shell&nbsp;将对双引号里的东西做其处理然后用参数&nbsp;-e&nbsp;和 <BR>&nbsp;s/'/\\'/g&nbsp;执行&nbsp;sed。当&nbsp;sed分析这些时,&nbsp;它将把双反斜杠替换为单个反斜杠然后进行替换。&nbsp;可能有时候你认为所有&nbsp;Unix&nbsp;命令使用同一个逃逸字符是个好事。&nbsp;但具有讽刺意味的事实是你可能不得不逃逸所有反斜杠,因为&nbsp;SQL&nbsp;文本常量同样也惨遭这种解释。&nbsp;这种情况下你可能最好在外部准备文件。 <P> <BR>&nbsp;因为冒号也可以合法的出现在&nbsp;SQL&nbsp;命令里,便有下面规则的应用:&nbsp;如果没有设置变量,字符序列&nbsp;&quot;冒号+名称&quot;&nbsp;不会被改变。&nbsp;在任何情况下你都可以用反斜杠逃逸冒号以保护它免于被解释。&nbsp;(变量的冒号语法是&nbsp;SQL&nbsp;用于嵌入查询语言的标准,如&nbsp;ECPG。用于数组片段和类型转换的冒号语法是&nbsp;PostgreSQL&nbsp;扩展,因此有冲突。) <A NAME="lbAN">&nbsp;</A> <H3>PROMPTING 提示符</H3> <P> <B>psql</B> 使用的提示符可以根据你的喜好客户化。三个变量 PROMPT1,PROMPT2,和 PROMPT3 包含描述提示符的外观的字串和特殊逃逸序列。Prompt 1 是 psql 请求一个新命令时的使用的正常提示符。 Prompt 2 是在一个命令输入期待更多输入时(因为查询没有用一个分号结束或者引号没有关闭)显示的提示符。 Prompt 3 在你运行一个 SQL COPY 命令和等待你在终端上键入记录时使用。 <P> <BR>&nbsp;相应的提示符变量的值是按字面打印的,除非碰到一个百分号(%)。这时某些其他的文本被替换,&nbsp;替换为何物取决于下一个字符。已定义的替换是: <DL COMPACT> <DT><B>%M</B><DD> <BR>&nbsp;数据库服务器主机名全名(带着域名),如果联接是通过&nbsp;Unix&nbsp;域套接字进行的就是&nbsp;[local],&nbsp;或者如果&nbsp;Unix&nbsp;域套接字不是编译的缺省位置,就是&nbsp;[local:<I>/dir/name</I>]。 <DT><B>%m</B><DD> <BR>&nbsp;数据库服务器的主机名删去第一个点后面的部分剩下的东西。&nbsp;或者如果联接是通过&nbsp;Unix&nbsp;域套接字,就是&nbsp;[local]。 <DT><B>%&gt;</B><DD> <BR>&nbsp;数据库服务器正在侦听的端口号。 <DT><B>%n</B><DD> <BR>&nbsp;数据库会话的用户名。&nbsp;(这个值的扩展可能在一个数据库会话过程中因为<B>SET&nbsp;SESSION&nbsp;AUTHORIZATION</B>&nbsp;命令而改变。) <DT><B>%/</B><DD> 当前数据库名称。 <DT><B>%~</B><DD> 类似 %/, 但如果数据库是你的缺省数据库输出是&quot;~&quot; (波浪线(tilde))。 <DT><B>%#</B><DD> <BR>&nbsp;如果会话用户是数据库超级用户,使用&nbsp;&quot;#&quot;,否则用&quot;&gt;&quot;。&nbsp;(这个值的扩展可能在一个数据库会话过程中因为<B>SET&nbsp;SESSION&nbsp;AUTHORIZATION</B>&nbsp;命令而改变。) <DT><B>%R</B><DD> <BR>&nbsp;对于&nbsp;prompt&nbsp;1&nbsp;通常是&nbsp;=,但是如果是单行模式则是&nbsp;^,而如果会话与数据库断开(如果onnect&nbsp;失败可能发生)是&nbsp;!。对于&nbsp;prompt&nbsp;2&nbsp;该序列被&nbsp;-,*,一个单引号或者一个双引号代替,&nbsp;这取决于&nbsp;psql是否等待更多的输入(因为查询没有终止,或着正在一个&nbsp;/*&nbsp;...&nbsp;*/注释里面,或者因为你在引号里面)。对于&nbsp;prompt&nbsp;3&nbsp;该序列不解释成任何东西。<DT><B>%x</B><DD> <BR>&nbsp;事务状态:如果不在事务块里,是一个空字串,如果在事务块里,是&nbsp;*,&nbsp;如果在一个失败的事务块里是&nbsp;!,或者无法判断事务状态时为&nbsp;?&nbsp;&nbsp;(比如,因为没有连接)。 <DT><B>%</B><I>digits</I><B></B><DD> <BR>&nbsp;如果&nbsp;digits&nbsp;以&nbsp;0x&nbsp;开头,&nbsp;那么其余字符被解释成一个十六进制数字并且替换为对应(十六进制码)的字符。&nbsp;如果第一个数字是&nbsp;0,该字符被解释成一个八进制数字并且替换为对应的(八进制码)的字符。&nbsp;否则认为是一个十进制数字。 <DT><B>%:</B><I>name</I><B>:</B><DD> psql变量name的值。参阅 &quot;Variables 变量&quot; 节获取细节。 <DT><B>%`</B><I>command</I><B>`</B><DD> command的输出, 类似于通常的反引号(back-tick)替换。 </DL> <P> <BR>&nbsp;要在提示符里插入百分号,键入%%。缺省提示符等效于&nbsp;'%/%R%#&nbsp;'&nbsp;用于&nbsp;prompts&nbsp;1&nbsp;和&nbsp;2,以及'&gt;&gt;&nbsp;'&nbsp;用于&nbsp;prompt&nbsp;3。 <P> <DL COMPACT><DT><DD> <B>Note:</B> 注意: 这个特性是无耻地从tcsh 里剽窃来的。 </DL> <P> <A NAME="lbAO">&nbsp;</A> <H3>COMMAND-LINE EDITING 命令行编辑</H3> <P> <B>psql</B> 为了编辑和检索命令行的方便支持 readline 和历史库。 命令历史存放在你的家目录的一个叫 .psql_history 的文件里, 并且当 psql 启动的时候会装载进来。 还支持 Tab 补齐,尽管该补齐逻辑并不是一个 SQL 分析器必备的。 如果因某些原因你不喜欢 tab 补齐,你可以把下面几行放在你的家目录的一个叫<I>.inputrc</I> 的文件里关闭这个特性: <P> <PRE> $if psql set disable-completion on $endif </PRE> (这不是 psql 的特性, 是<B>Readline</B> 的。参考它的文档获取更多细节。) <A NAME="lbAP">&nbsp;</A> <H2>ENVIRONMENT 环境</H2> <DL COMPACT> <DT><B>HOME</B><DD> <BR>&nbsp;初始化文件(.psqlrc)和命令历史文件(<I>.psql_history</I>)的目录。 <DT><B>PAGER</B><DD> <BR>&nbsp;如果查询结果在一页里放不下,那么它们被定向到这个命令。&nbsp;典型的值是&nbsp;more&nbsp;或者&nbsp;less。&nbsp;缺省的是平台相关的。我们可以用<B>\pset</B>&nbsp;命令关闭分页器。 <DT><B>PGDATABASE</B><DD> <BR>&nbsp;缺省连接的数据库 <DT><B>PGHOST</B><DD> <DT><B>PGPORT</B><DD> <DT><B>PGUSER</B><DD> <BR>&nbsp;缺省连接参数 <DT><B>PSQL_EDITOR</B><DD> <DT><B>EDITOR</B><DD> <DT><B>VISUAL</B><DD> <B>\e</B> 命令使用的编辑器。这些变量是按照上面的顺序检查的;设置最早的最先使用。 <DT><B>SHELL</B><DD> <B>\!</B> 命令执行的命令。 <DT><B>TMPDIR</B><DD> <BR>&nbsp;存储临时文件的目录。缺省是<I>/tmp</I>。 </DL> <A NAME="lbAQ">&nbsp;</A> <H2>FILES</H2> <DL COMPACT> <DT>&bull;<DD> <BR>&nbsp;在启动之前,psql&nbsp;视图读取并&nbsp;执行来自文件<I>$HOME/.psqlrc</I>&nbsp;的命令。&nbsp;它将用于设置客户端或者服务器的风格(使用<B>\set</B>&nbsp;和<B>SET</B>&nbsp;命令)。 <DT>&bull;<DD> <BR>&nbsp;命令行历史存储在<I>$HOME/.psql_history</I>。 </DL> <A NAME="lbAR">&nbsp;</A> <H2>NOTES 注意</H2> <DL COMPACT> <DT>&bull;<DD> <BR>&nbsp;一些&nbsp;psql的早期版本允许一个单字母的反斜杠命令(元命令)的第一个参数直接跟在命令后面,&nbsp;而不用空白间隔。出于兼容性原因,这个特性仍然在某些程度上被支持,但是我不准备在这里详细解释,因为我不鼓励这样使用。&nbsp;不过如果你收到莫名其妙的信息,想想这个用法。例如 <P> <PRE> testdb=&gt;<B>\foo</B> Field separator is &quot;oo&quot;. </PRE> <BR>&nbsp;可能不是你想要的东西。 <DT>&bull;<DD> <B>psql</B> 只能与同版本的服务器平稳地工作。 这不意味着其他组合会完全失败,但是可能有微小的或者不那么微小的问题。 如果服务器的版本不同,反斜杠命令是特别容易失效的。 </DL> <A NAME="lbAS">&nbsp;</A> <H2>EXAMPLES 例子</H2> <P> <BR>&nbsp;第一个例子演示了如何把一个查询分成多个行进行输入。注意提示符的变化: <P> <PRE> testdb=&gt;<B>CREATE TABLE my_table (</B> testdb(&gt;<B> first integer not null default 0,</B> testdb(&gt;<B> second text</B> testdb-&gt;<B>);</B> CREATE TABLE </PRE> <BR>&nbsp;现在再看看表定义: <P> <PRE> testdb=&gt;<B>\d my_table</B> Table &quot;my_table&quot; Attribute | Type | Modifier -----------+---------+-------------------- first | integer | not null default 0 second | text | </PRE> <BR>&nbsp;把提示符变成更有趣的东西: <P> <PRE> testdb=&gt;<B>\set PROMPT1 '%n@%m %~%R%# '</B> <A HREF="mailto:peter@localhost">peter@localhost</A> testdb=&gt; </PRE> <BR>&nbsp;假设你用数据填充了表并且想看一眼: <P> <PRE> <A HREF="mailto:peter@localhost">peter@localhost</A> testdb=&gt; SELECT * FROM my_table; first | second -------+-------- 1 | one 2 | two 3 | three 4 | four (4 rows) </PRE> <BR>&nbsp;你可以用<B>\pset</B>&nbsp;命令让这个查询看起来不一样: <P> <PRE> <A HREF="mailto:peter@localhost">peter@localhost</A> testdb=&gt;<B>\pset border 2</B> Border style is 2. <A HREF="mailto:peter@localhost">peter@localhost</A> testdb=&gt;<B>SELECT * FROM my_table;</B> +-------+--------+ | first | second | +-------+--------+ | 1 | one | | 2 | two | | 3 | three | | 4 | four | +-------+--------+ (4 rows) <A HREF="mailto:peter@localhost">peter@localhost</A> testdb=&gt;<B>\pset border 0</B> Border style is 0. <A HREF="mailto:peter@localhost">peter@localhost</A> testdb=&gt;<B>SELECT * FROM my_table;</B> first second ----- ------ 1 one 2 two 3 three 4 four (4 rows) <A HREF="mailto:peter@localhost">peter@localhost</A> testdb=&gt;<B>\pset border 1</B> Border style is 1. <A HREF="mailto:peter@localhost">peter@localhost</A> testdb=&gt;<B>\pset format unaligned</B> Output format is unaligned. <A HREF="mailto:peter@localhost">peter@localhost</A> testdb=&gt;<B>\pset fieldsep &quot;,&quot;</B> Field separator is &quot;,&quot;. <A HREF="mailto:peter@localhost">peter@localhost</A> testdb=&gt;<B>\pset tuples_only</B> Showing only tuples. <A HREF="mailto:peter@localhost">peter@localhost</A> testdb=&gt;<B>SELECT second, first FROM my_table;</B> one,1 two,2 three,3 four,4 </PRE> <BR>&nbsp;还可以用短(缩写)命令: <P> <PRE> <A HREF="mailto:peter@localhost">peter@localhost</A> testdb=&gt;<B>\a\t\x</B> Output format is aligned. Tuples only is off. Expanded display is on. <A HREF="mailto:peter@localhost">peter@localhost</A> testdb=&gt;<B>SELECT * FROM my_table;</B> -[ RECORD 1 ]- first | 1 second | one -[ RECORD 2 ]- first | 2 second | two -[ RECORD 3 ]- first | 3 second | three -[ RECORD 4 ]- first | 4 second | four </PRE> <A NAME="lbAT">&nbsp;</A> <H2>译者</H2> <B>Postgresql 中文网站</B> <B>何伟平 &lt;<A HREF="mailto:<EMAIL>"><EMAIL></A>&gt;</B> <P> <HR> <A NAME="index">&nbsp;</A><H2>Index</H2> <DL> <DT><A HREF="#lbAB">NAME</A><DD> <DT><A HREF="#lbAC">SYNOPSIS</A><DD> <DT><A HREF="#lbAD">DESCRIPTION 描述</A><DD> <DT><A HREF="#lbAE">OPTIONS 选项</A><DD> <DT><A HREF="#lbAF">EXIT STATUS 退出状态</A><DD> <DT><A HREF="#lbAG">USAGE 用法</A><DD> <DL> <DT><A HREF="#lbAH">CONNECTING TO A DATABASE 与一个数据库联接</A><DD> <DT><A HREF="#lbAI">ENTERING SQL COMMANDS 输入 SQL 命令</A><DD> <DT><A HREF="#lbAJ">META-COMMANDS 元命令</A><DD> <DT><A HREF="#lbAK">ADVANCED FEATURES 高级特性</A><DD> <DT><A HREF="#lbAL">VARIABLES 变量</A><DD> <DT><A HREF="#lbAM">SQL INTERPOLATION 代换</A><DD> <DT><A HREF="#lbAN">PROMPTING 提示符</A><DD> <DT><A HREF="#lbAO">COMMAND-LINE EDITING 命令行编辑</A><DD> </DL> <DT><A HREF="#lbAP">ENVIRONMENT 环境</A><DD> <DT><A HREF="#lbAQ">FILES</A><DD> <DT><A HREF="#lbAR">NOTES 注意</A><DD> <DT><A HREF="#lbAS">EXAMPLES 例子</A><DD> <DT><A HREF="#lbAT">译者</A><DD> </DL> <HR> This document was created by <A HREF="/manpages-zh/index.html">man2html</A>, using the manual pages.<BR> Time: 13:12:03 GMT, December 24, 2015 </div></div> </body> </HTML>
html
<filename>src/tablestore/core/error.cpp /* BSD 3-Clause License Copyright (c) 2017, Alibaba Cloud All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "tablestore/core/error.hpp" #include "tablestore/util/mempiece.hpp" #include "tablestore/util/prettyprint.hpp" using namespace std; using namespace aliyun::tablestore::util; namespace aliyun { namespace tablestore { namespace core { const string OTSError::kErrorCode_CouldntResolveHost("OTSCouldntResolveHost"); const string OTSError::kErrorCode_CouldntConnect("OTSCouldntConnect"); const string OTSError::kErrorCode_WriteRequestFail("OTSWriteRequestFail"); const string OTSError::kErrorCode_CorruptedResponse("OTSCorruptedResponse"); const string OTSError::kErrorCode_NoAvailableConnection("OTSNoAvailableConnection"); const string OTSError::kErrorCode_SslHandshakeFail("OTSSslHandshakeFail"); const string OTSError::kErrorCode_OTSOutOfColumnCountLimit("OTSOutOfColumnCountLimit"); const string OTSError::kErrorCode_OTSObjectNotExist("OTSObjectNotExist"); const string OTSError::kErrorCode_OTSServerBusy("OTSServerBusy"); const string OTSError::kErrorCode_OTSCapacityUnitExhausted("OTSCapacityUnitExhausted"); const string OTSError::kErrorCode_OTSTooFrequentReservedThroughputAdjustment( "OTSTooFrequentReservedThroughputAdjustment"); const string OTSError::kErrorCode_OTSInternalServerError("OTSInternalServerError"); const string OTSError::kErrorCode_OTSQuotaExhausted("OTSQuotaExhausted"); const string OTSError::kErrorCode_OTSRequestBodyTooLarge("OTSRequestBodyTooLarge"); const string OTSError::kErrorCode_OTSTimeout("OTSTimeout"); const string OTSError::kErrorCode_OTSObjectAlreadyExist("OTSObjectAlreadyExist"); const string OTSError::kErrorCode_OTSTableNotReady("OTSTableNotReady"); const string OTSError::kErrorCode_OTSConditionCheckFail("OTSConditionCheckFail"); const string OTSError::kErrorCode_OTSOutOfRowSizeLimit("OTSOutOfRowSizeLimit"); const string OTSError::kErrorCode_OTSInvalidPK("OTSInvalidPK"); const string OTSError::kErrorCode_OTSRequestTimeout("OTSRequestTimeout"); const string OTSError::kErrorCode_OTSMethodNotAllowed("OTSMethodNotAllowed"); const string OTSError::kErrorCode_OTSAuthFailed("OTSAuthFailed"); const string OTSError::kErrorCode_OTSServerUnavailable("OTSServerUnavailable"); const string OTSError::kErrorCode_OTSParameterInvalid("OTSParameterInvalid"); const string OTSError::kErrorCode_OTSRowOperationConflict("OTSRowOperationConflict"); const string OTSError::kErrorCode_OTSPartitionUnavailable("OTSPartitionUnavailable"); OTSError::OTSError(Predefined def) { switch(def) { case kPredefined_CouldntResoveHost: init(kHttpStatus_CouldntResolveHost, kErrorCode_CouldntResolveHost); break; case kPredefined_CouldntConnect: init(kHttpStatus_CouldntConnect, kErrorCode_CouldntConnect); break; case kPredefined_OperationTimeout: init(kHttpStatus_OperationTimeout, kErrorCode_OTSRequestTimeout); break; case kPredefined_WriteRequestFail: init(kHttpStatus_WriteRequestFail, kErrorCode_WriteRequestFail); break; case kPredefined_CorruptedResponse: init(kHttpStatus_CorruptedResponse, kErrorCode_CorruptedResponse); break; case kPredefined_NoConnectionAvailable: init(kHttpStatus_NoAvailableConnection, kErrorCode_NoAvailableConnection); break; case kPredefined_OTSOutOfColumnCountLimit: init(400, kErrorCode_OTSOutOfColumnCountLimit); break; case kPredefined_OTSObjectNotExist: init(404, kErrorCode_OTSObjectNotExist); break; case kPredefined_OTSServerBusy: init(503, kErrorCode_OTSServerBusy); break; case kPredefined_OTSCapacityUnitExhausted: init(403, kErrorCode_OTSCapacityUnitExhausted); break; case kPredefined_OTSTooFrequentReservedThroughputAdjustment: init(403, kErrorCode_OTSTooFrequentReservedThroughputAdjustment); break; case kPredefined_OTSInternalServerError: init(500, kErrorCode_OTSInternalServerError); break; case kPredefined_OTSQuotaExhausted: init(403, kErrorCode_OTSQuotaExhausted); break; case kPredefined_OTSRequestBodyTooLarge: init(413, kErrorCode_OTSRequestBodyTooLarge); break; case kPredefined_OTSTimeout: init(503, kErrorCode_OTSTimeout); break; case kPredefined_OTSObjectAlreadyExist: init(409, kErrorCode_OTSObjectAlreadyExist); break; case kPredefined_OTSTableNotReady: init(404, kErrorCode_OTSTableNotReady); break; case kPredefined_OTSConditionCheckFail: init(403, kErrorCode_OTSConditionCheckFail); break; case kPredefined_OTSOutOfRowSizeLimit: init(400, kErrorCode_OTSOutOfRowSizeLimit); break; case kPredefined_OTSInvalidPK: init(400, kErrorCode_OTSInvalidPK); break; case kPredefined_OTSMethodNotAllowed: init(405, kErrorCode_OTSMethodNotAllowed); break; case kPredefined_OTSAuthFailed: init(403, kErrorCode_OTSAuthFailed); break; case kPredefined_OTSServerUnavailable: init(503, kErrorCode_OTSServerUnavailable); break; case kPredefined_OTSParameterInvalid: init(400, kErrorCode_OTSParameterInvalid); break; case kPredefined_OTSRowOperationConflict: init(409, kErrorCode_OTSRowOperationConflict); break; case kPredefined_OTSPartitionUnavailable: init(503, kErrorCode_OTSPartitionUnavailable); break; case kPredefined_SslHandshakeFail: init(kHttpStatus_SslHandshakeFail, kErrorCode_SslHandshakeFail); break; } } void OTSError::init(int64_t hs, const string& ec) { mHttpStatus = hs; mErrorCode = ec; } void OTSError::prettyPrint(string& out) const { out.append("{\"HttpStatus\": "); pp::prettyPrint(out, mHttpStatus); out.append(", \"ErrorCode\": \""); out.append(mErrorCode); out.append("\", \"Message\": \""); out.append(mMessage); if (!mRequestId.empty()) { out.append("\", \"RequestId\": \""); out.append(mRequestId); } if (!mTraceId.empty()) { out.append("\", \"TraceId\": \""); out.append(mTraceId); } out.append("\"}"); } void OTSError::setHttpStatusFromErrorCode(const string& _ec) { MemPiece ec = MemPiece::from(_ec); if (ec == MemPiece::from(kErrorCode_CouldntResolveHost)) { mHttpStatus = kHttpStatus_CouldntResolveHost; } else if (ec == MemPiece::from(kErrorCode_CouldntConnect)) { mHttpStatus = kHttpStatus_CouldntConnect; } else if (ec == MemPiece::from(kErrorCode_OTSRequestTimeout)) { mHttpStatus = kHttpStatus_OperationTimeout; } else if (ec == MemPiece::from(kErrorCode_WriteRequestFail)) { mHttpStatus = kHttpStatus_WriteRequestFail; } else if (ec == MemPiece::from(kErrorCode_CorruptedResponse)) { mHttpStatus = kHttpStatus_CorruptedResponse; } else if (ec == MemPiece::from(kErrorCode_NoAvailableConnection)) { mHttpStatus = kHttpStatus_NoAvailableConnection; } else if (ec == MemPiece::from(kErrorCode_OTSOutOfColumnCountLimit)) { mHttpStatus = 400; } else if (ec == MemPiece::from(kErrorCode_OTSObjectNotExist)) { mHttpStatus = 404; } else if (ec == MemPiece::from(kErrorCode_OTSServerBusy)) { mHttpStatus = 503; } else if (ec == MemPiece::from(kErrorCode_OTSCapacityUnitExhausted)) { mHttpStatus = 403; } else if (ec == MemPiece::from(kErrorCode_OTSTooFrequentReservedThroughputAdjustment)) { mHttpStatus = 403; } else if (ec == MemPiece::from(kErrorCode_OTSInternalServerError)) { mHttpStatus = 500; } else if (ec == MemPiece::from(kErrorCode_OTSQuotaExhausted)) { mHttpStatus = 403; } else if (ec == MemPiece::from(kErrorCode_OTSRequestBodyTooLarge)) { mHttpStatus = 413; } else if (ec == MemPiece::from(kErrorCode_OTSTimeout)) { mHttpStatus = 503; } else if (ec == MemPiece::from(kErrorCode_OTSObjectAlreadyExist)) { mHttpStatus = 409; } else if (ec == MemPiece::from(kErrorCode_OTSTableNotReady)) { mHttpStatus = 404; } else if (ec == MemPiece::from(kErrorCode_OTSConditionCheckFail)) { mHttpStatus = 403; } else if (ec == MemPiece::from(kErrorCode_OTSOutOfRowSizeLimit)) { mHttpStatus = 400; } else if (ec == MemPiece::from(kErrorCode_OTSInvalidPK)) { mHttpStatus = 400; } else if (ec == MemPiece::from(kErrorCode_OTSMethodNotAllowed)) { mHttpStatus = 405; } else if (ec == MemPiece::from(kErrorCode_OTSAuthFailed)) { mHttpStatus = 403; } else if (ec == MemPiece::from(kErrorCode_OTSServerUnavailable)) { mHttpStatus = 503; } else if (ec == MemPiece::from(kErrorCode_OTSParameterInvalid)) { mHttpStatus = 400; } else if (ec == MemPiece::from(kErrorCode_OTSRowOperationConflict)) { mHttpStatus = 409; } else if (ec == MemPiece::from(kErrorCode_OTSPartitionUnavailable)) { mHttpStatus = 503; } else if (ec == MemPiece::from(kErrorCode_SslHandshakeFail)) { mHttpStatus = kHttpStatus_SslHandshakeFail; } else { mHttpStatus = 400; } } bool isCurlError(const OTSError& err) { return err.httpStatus() > 0 && err.httpStatus() <= 99; } bool isTemporary(const OTSError& err) { if (err.httpStatus() >= 500 && err.httpStatus() <= 599) { return true; } if (err.httpStatus() >= 400 && err.httpStatus() <= 499) { MemPiece code = MemPiece::from(err.errorCode()); MemPiece msg = MemPiece::from(err.message()); if (code == MemPiece::from("OTSQuotaExhausted") && msg == MemPiece::from("Too frequent table operations.")) { return true; } else if (code == MemPiece::from("OTSRowOperationConflict")) { return true; } else if (code == MemPiece::from("OTSTableNotReady")) { return true; } else if (code == MemPiece::from("OTSTooFrequentReservedThroughputAdjustment")) { return true; } else if (code == MemPiece::from("OTSCapacityUnitExhausted")) { return true; } else if (code == MemPiece::from("OTSRequestTimeout")) { return true; } } if (isCurlError(err)) { switch(err.httpStatus()) { case OTSError::kHttpStatus_CouldntResolveHost: case OTSError::kHttpStatus_CouldntConnect: case OTSError::kHttpStatus_OperationTimeout: case OTSError::kHttpStatus_WriteRequestFail: case OTSError::kHttpStatus_CorruptedResponse: case OTSError::kHttpStatus_NoAvailableConnection: return true; default: break; } } return false; } } // namespace core } // namespace tablestore } // namespace aliyun
cpp
Disclaimer: This review of Cryptid is based on the first episode that was screened at the Cannes International Series Festival. Here’s a weird confession. Before watching this, I didn’t know the meaning of ‘cryptid’. In case you are with me on this, here’s the Merriam-Webster definition of the word: “an animal (such as Sasquatch or the Loch Ness Monster) that has been claimed to exist but never proven to exist”. Here’s another weird confession. Although I know exactly what cryptid is referring to, I have not seen a single movie or TV show with that word in it and apparently there are a bunch of them with that name. There’s a 2020 movie by Brad Rego that’s on the way, there’s a 2006 movie, there’s a 2014 TV series, and there’s a 2013 movie by Michael Kazlo. Given the curious cat that I am, I went through some of the trailers for those movies and/or TV shows and well, I can vouch for the fact that this Swedish is a bold addition to this horror sub-genre. Cryptid is directed by David Berron and written by Morgan Jensen and Henrik Jansson-Schweizer. The cinematography is by Matti Eerikäinen, editing by Tussilago AB, Harri Ylönen, Inka Lahti, and Otto Ikäheimonen, and score by Anders Niska, and Klas Wahl. The cast features Maja-Johanna Englander, Julius Fleischanderl, Astrid Morberg, Johan Hedenberg, Oscar Zia, Angelina Håkansson. The official synopsis for the series states that “as a chain of horrific and unexplainable events start to unfold in a small town on the northern hemisphere, an ensemble of high school students will be forced to face their darkest fears in order to overcome a supernatural force feeding on chaos and the misery of mankind”. And boy-o-boy does it make that very apparent in the first few minutes itself by literally exploding what looks like the most popular kid in the school in the middle of the cafeteria. Before coming to the horror aspect of the show, can I just make one last confession? I love stories set in a small town. If it belongs to the horror genre, then that’s great. If it doesn’t, it still works for me. Why? Because smaller the confines, the greater the bond between the characters. And there’s something neat about a close-knit community surviving relentless attacks from an unidentifiable entity. By the way, by ‘close-knit’, I don’t necessarily mean that they all have to love each other. Knowing each other is just fine because it means that they have some form of shared history between them and seeing how that history effects their current decision is hugely satisfying. The showrunners of Cryptid know that and they reveal those very connections and shared histories between their characters slowly and then start to shake them up. Alright, about the horror aspect of Cryptid. So, unlike the definition of the title, the first abnormal thing that we get to witness is, as mentioned before, a full-body explosion. We legit don’t get any explanation. Sebastian (Oscar Zia) complains about some itching after a, for the sake of keeping things civil in here, cat-eating session. He gets a soda, starts developing boils on his body, and then just explodes. Then through some clever editing, sound-editing and storytelling, we get to know that this isn’t the first time something supernatural has happened and that too of this magnitude, which brings me back to the town’s history. Much like Dark or Stranger Things or It, there’s an undercurrent of anxiety that the elders are witnessing something they’ve seen before and are trying to brush it under the rug to avoid accepting that what’s happening is real. It’s an over-exaggerated metaphor for the skeletons small towns usually have and that’s exactly why I like it. Final verdict. I think I am going to have sleepless nights not just because what I saw was nerve-wracking but also because I got to watch only one episode. They packed so much into that 20-minute long one episode that I want more of Cryptid! I am bummed, but in a good way. This is October i.e. Halloween month and I am always up for quality horror no matter what shape or form it comes in. And, by the looks of it, Cryptid is in good shape and bad form with its use of practical effects, hypnotic cinematography and editing, ominous storytelling, and pitch perfect acting. I wish that it gets an international release so that I and many other fans can watch the entirety of the series.
english
<reponame>roggerJose/nightfall<gh_stars>1-10 import { deferConfig as defer } from 'config/defer'; module.exports = { web3Host: process.env.BLOCKCHAIN_HOST, web3Port: process.env.BLOCKCHAIN_PORT, web3ProviderURL: defer(function getWeb3ProviderURL() { return `${this.web3Host}:${this.web3Port}`; }), authenticationApi: { host: process.env.AUTHENTICATION_API_HOST, port: process.env.AUTHENTICATION_API_PORT, url: defer(function getauthenticationApiURL() { return `${this.authenticationApi.host}:${this.authenticationApi.port}`; }), }, };
javascript
<filename>src/main/java/WayofTime/bloodmagic/routing/IMasterRoutingNode.java package WayofTime.bloodmagic.routing; import net.minecraft.util.math.BlockPos; import java.util.List; public interface IMasterRoutingNode extends IRoutingNode { boolean isConnected(List<BlockPos> path, BlockPos nodePos); void addNodeToList(IRoutingNode node); void addConnections(BlockPos pos, List<BlockPos> connectionList); void addConnection(BlockPos pos1, BlockPos pos2); void removeConnection(BlockPos pos1, BlockPos pos2); }
java
from utils import copy_vocab import run_setting from train import train_lm, train_cls, get_model_name from nltk import ToktokTokenizer as ToktokTokenizer_ from fastai.text.data import NumericalizeProcessor, TextList, ItemLists, TokenizeProcessor from fastai.basic_data import DatasetType from fastai.text.transform import Tokenizer, BaseTokenizer from sklearn.metrics import f1_score, accuracy_score import numpy as np import pandas as pd import torch from pathlib import Path from collections import defaultdict import argparse data_folder = Path('../data/text_cls') class ToktokTokenizer(BaseTokenizer): "Basic class for a tokenizer function." def __init__(self, lang: str): self.lang = lang self.base = ToktokTokenizer_() def tokenizer(self, t: str): return self.base.tokenize(t) def get_tokenizer(lang): if lang == 'th': from pythainlp.ulmfit import ThaiTokenizer, pre_rules_th, post_rules_th return Tokenizer(tok_func=ThaiTokenizer, lang='th', pre_rules=pre_rules_th, post_rules=post_rules_th) else: return Tokenizer(tok_func=ToktokTokenizer, lang=lang) def get_tokenizer_preprocesser(args): tokenizer = get_tokenizer(args.target_lang) return TokenizeProcessor(tokenizer=tokenizer, chunksize=10000, mark_fields=False) def eval_multiclass(preds, y_true): preds = np.argmax(preds, axis=-1) f1_macro = f1_score(y_true, preds, average='macro') acc = accuracy_score(y_true, preds) scores = dict(F1_macro=f1_macro, Acc=acc) return scores def eval_multilabel(pred_probs, y_true): preds = (pred_probs > 0.5).astype(int) f1_macro = f1_score(y_true, preds, average='macro') acc = accuracy_score(y_true, preds) scores = dict(F1_macro=f1_macro, Acc=acc) return scores def print_scores(scores): str_out = ', '.join( f'{metric}: {value:.4f}' for metric, value in scores.items()) print(str_out) def print_scores_summary(scores): str_out = ', '.join( f'{metric}: {np.mean(values):.4f}' for metric, values in scores.items()) print('Mean:', str_out) str_out = ', '.join( f'{metric}: {np.std(values):.4f}' for metric, values in scores.items()) print('Std :', str_out) FALSY_STRINGS = {'off', 'false', '0'} TRUTHY_STRINGS = {'on', 'true', '1'} def bool_flag(s): """ Parse boolean arguments from the command line. """ if s.lower() in FALSY_STRINGS: return False elif s.lower() in TRUTHY_STRINGS: return True else: raise argparse.ArgumentTypeError("Invalid value for a boolean flag!") def none_or_str(s): if s is None or s.lower() == 'none': return None return s def none_or_int(s): if s is None or s.lower() == 'none': return None return int(s) def main(): parser = argparse.ArgumentParser() parser.add_argument('run', type=str) parser.add_argument('--name', type=str, required=True) parser.add_argument('--runs', type=int, default=5) # DHG arguments parser.add_argument('--langs', type=str, default='en') parser.add_argument('--dict', type=str, default='word2word') parser.add_argument('--directed', type=bool_flag, default=True) parser.add_argument('--w2v', type=none_or_str, default='fasttext') parser.add_argument('--reverse', type=bool_flag, default=False) parser.add_argument('--add_from_dict', type=int, default=0) parser.add_argument('--save_temp', type=bool_flag, default=True) parser.add_argument('--use_temp_only', type=bool_flag, default=False) # DHGNet arguments parser.add_argument('--conv', type=str, default='hgnn') parser.add_argument('--gnn_layers', type=int, default=2) parser.add_argument('--layer_norm', type=bool_flag, default=True) parser.add_argument('--residual', type=str, default=True) parser.add_argument('--freeze_cross', type=bool_flag, default=True) # Classifier->AWDLSTM arguments parser.add_argument('--emb_sz', type=int, default=300) parser.add_argument('--rnn_layers', type=int, default=3) parser.add_argument('--tie_weights', type=bool_flag, default=True) # Training arguments parser.add_argument('--pretrain_align_epochs', type=int, default=50) parser.add_argument('--pretrain_lm_epochs', type=int, default=200) parser.add_argument('--train_cls_epochs', type=int, default=20) parser.add_argument('--load_lm_gnn', type=none_or_str, default=None) args = parser.parse_args() args = run_setting.update(args) print(args) assert args.pretrain_lm_epochs or args.train_cls_epochs model_name = get_model_name(args) folder = data_folder / f'{args.dataset}' model_path = folder train_df = pd.read_csv(folder / 'train_df.csv') valid_df = pd.read_csv(folder / 'valid_df.csv') test_df = pd.read_csv(folder / 'test_df.csv') if args.label_col is None and args.multi_label: args.label_col = list(train_df.columns[1:]) text_col = args.text_col label_col = args.label_col vocab = None vocab_path = folder / 'models' / f'{model_name}_vocab.pkl' vocab_path.parent.mkdir(exist_ok=True) # prepare vocab from dataset data_prep = TextList.from_df(train_df, model_path, cols=[text_col], processor=[ get_tokenizer_preprocesser(args), NumericalizeProcessor(vocab=vocab)]) data_prep = data_prep.process() vocab = data_prep.vocab args.num_lm_vocab = len(vocab.itos) del data_prep is_print_model = True numericalizer = NumericalizeProcessor(vocab=copy_vocab(vocab)) def _train_lm(): nonlocal is_print_model, numericalizer if numericalizer is None: numericalizer = NumericalizeProcessor(vocab=copy_vocab(vocab)) processor = [get_tokenizer_preprocesser(args), numericalizer] train_data = TextList.from_df(train_df, model_path, cols=[ text_col], processor=processor) val_data = TextList.from_df(valid_df, model_path, cols=[ text_col], processor=processor) data_lm = (ItemLists(model_path, train=train_data, valid=val_data) .label_for_lm() .databunch(bs=64) ) train_lm(data_lm, args, print_model=is_print_model) data_lm.vocab.save(vocab_path) is_print_model = False del data_lm torch.cuda.empty_cache() def _train_cls(): nonlocal is_print_model, numericalizer if numericalizer is None: numericalizer = NumericalizeProcessor(vocab=copy_vocab(vocab)) processor = [get_tokenizer_preprocesser(args), numericalizer] train_data = TextList.from_df(train_df, model_path, cols=[ text_col], processor=processor) val_data = TextList.from_df(valid_df, model_path, cols=[ text_col], processor=processor) data_cls = (ItemLists(model_path, train=train_data, valid=val_data) .label_from_df(label_col, label_cls=None) .add_test(TextList.from_df(test_df, model_path, cols=[text_col], processor=processor)) .databunch(bs=32) ) learn = train_cls(data_cls, args, print_model=is_print_model) is_print_model = False return learn if args.pretrain_lm_epochs > 0: _train_lm() if args.train_cls_epochs <= 0: return valid_scores = defaultdict(list) test_scores = defaultdict(list) for i_run in range(args.runs): print(f'===== RUN #{i_run} =====') learn = _train_cls() for _m in learn.model.modules(): if hasattr(_m, '_need_update'): _m._need_update = True y_val, y_test = np.array( valid_df[label_col]), np.array(test_df[label_col]) if not args.multi_label: y_val, y_test = np.vectorize(learn.data.c2i.get)( y_val), np.vectorize(learn.data.c2i.get)(y_test) probs, y = learn.get_preds(DatasetType.Valid, ordered=True) preds = probs.numpy() if not args.multi_label: scores = eval_multiclass(preds, y_val) else: scores = eval_multilabel(preds, y_val) print_scores(scores) for metric, value in scores.items(): valid_scores[metric].append(value) probs, y = learn.get_preds(DatasetType.Test, ordered=True) preds = probs.numpy() if not args.multi_label: scores = eval_multiclass(preds, y_test) else: scores = eval_multilabel(preds, y_test) print_scores(scores) for metric, value in scores.items(): test_scores[metric].append(value) del learn torch.cuda.empty_cache() print('===== END RUN =====') print() print('Valid') print_scores_summary(valid_scores) print('Test') print_scores_summary(test_scores) if __name__ == '__main__': main()
python
use std::ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Sub, SubAssign}; use serde::{Deserialize, Serialize}; /// Represents a hex point in axial coordinate space #[derive( Debug, Clone, Default, Copy, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, )] pub struct Axial { pub q: i32, pub r: i32, } impl std::fmt::Display for Axial { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "[{}, {}]", self.q, self.r) } } unsafe impl Send for Axial {} impl Axial { pub const ZERO: Axial = Axial { q: 0, r: 0 }; pub const NEIGHBOURS: [Axial; 6] = [ Axial::new(1, 0), Axial::new(1, -1), Axial::new(0, -1), Axial::new(-1, 0), Axial::new(-1, 1), Axial::new(0, 1), ]; #[must_use] pub const fn new(q: i32, r: i32) -> Self { Self { q, r } } /// Return the "Manhattan" distance between two points in a hexagonal coordinate space /// Interprets points as axial coordiantes /// See https://www.redblobgames.com/grids/hexagons/#distances for more information #[must_use] pub fn hex_distance(self, rhs: Axial) -> u32 { let [ax, ay, az] = self.hex_axial_to_cube(); let [bx, by, bz] = rhs.hex_axial_to_cube(); let x = (ax - bx).abs(); let y = (ay - by).abs(); let z = (az - bz).abs(); x.max(y).max(z).try_into().unwrap() } /// Convert self from a hexagonal axial vector to a hexagonal cube vector #[inline] pub const fn hex_axial_to_cube(self) -> [i32; 3] { let x = self.q; let z = self.r; let y = -x - z; [x, y, z] } #[inline] #[must_use] pub const fn hex_cube_to_axial([q, _, r]: [i32; 3]) -> Self { Self { q, r } } /// Get the neighbours of this point starting at top left and going counter-clockwise #[inline] pub const fn hex_neighbours(self) -> [Axial; 6] { let n = Self::NEIGHBOURS; [ Axial::new(self.q + n[0].q, self.r + n[0].r), Axial::new(self.q + n[1].q, self.r + n[1].r), Axial::new(self.q + n[2].q, self.r + n[2].r), Axial::new(self.q + n[3].q, self.r + n[3].r), Axial::new(self.q + n[4].q, self.r + n[4].r), Axial::new(self.q + n[5].q, self.r + n[5].r), ] } #[must_use] pub fn hex_neighbour(self, i: usize) -> Axial { self + Self::NEIGHBOURS[i] } /// Return the index in `hex_neighbours` of the neighbour if applicable. None otherwise. /// `q` and `r` must be in the set {-1, 0, 1}. /// To get the index of the neighbour of a point /// ```rust /// use caolo_sim::geometry::Axial; /// let point = Axial::new(42, 69); /// let neighbour = Axial::new(42, 68); /// // `neighbour - point` will result in the vector pointing from `point` to `neighbour` /// let i = Axial::neighbour_index(neighbour - point); /// assert_eq!(i, Some(2)); /// ``` #[inline] #[must_use] pub fn neighbour_index(ax: Axial) -> Option<usize> { Self::NEIGHBOURS .iter() .enumerate() .find(|(_i, bx)| ax == **bx) .map(|(i, _)| i) } #[inline] #[must_use] pub fn rotate_right_around(self, center: Axial) -> Axial { let p = self - center; let p = p.rotate_right(); p + center } #[inline] #[must_use] pub fn rotate_left_around(self, center: Axial) -> Axial { let p = self - center; let p = p.rotate_left(); p + center } #[inline] #[must_use] pub const fn rotate_right(self) -> Axial { let [q, r, s] = self.hex_axial_to_cube(); Self::hex_cube_to_axial([-r, -s, -q]) } #[inline] #[must_use] pub fn rotate_left(self) -> Axial { let [q, r, s] = self.hex_axial_to_cube(); Self::hex_cube_to_axial([-s, -q, -r]) } #[inline] #[must_use] pub const fn as_array(self) -> [i32; 2] { [self.q, self.r] } #[inline] #[must_use] pub fn dist(self, other: Self) -> u32 { self.hex_distance(other) } #[must_use] pub fn to_pixel_pointy(self, size: f32) -> [f32; 2] { let Axial { q, r } = self; let [q, r] = [q as f32, r as f32]; const SQRT_3: f32 = 1.732_050_8; let x = size * (SQRT_3 * q + SQRT_3 / 2.0 * r); let y = size * (3. / 2. * r); [x, y] } } impl AddAssign for Axial { fn add_assign(&mut self, rhs: Self) { self.q += rhs.q; self.r += rhs.r; } } impl Add for Axial { type Output = Self; fn add(mut self, rhs: Self) -> Self { self += rhs; self } } impl SubAssign for Axial { fn sub_assign(&mut self, rhs: Self) { self.q -= rhs.q; self.r -= rhs.r; } } impl Sub for Axial { type Output = Self; fn sub(mut self, rhs: Self) -> Self { self -= rhs; self } } impl MulAssign<i32> for Axial { fn mul_assign(&mut self, rhs: i32) { self.q *= rhs; self.r *= rhs; } } impl Mul<i32> for Axial { type Output = Self; fn mul(mut self, rhs: i32) -> Self { self *= rhs; self } } impl DivAssign<i32> for Axial { fn div_assign(&mut self, rhs: i32) { self.q /= rhs; self.r /= rhs; } } impl Div<i32> for Axial { type Output = Self; fn div(mut self, rhs: i32) -> Self { self /= rhs; self } } #[cfg(test)] mod tests { use super::*; #[test] fn basic_arithmetic() { let p1 = Axial::new(0, 0); let p2 = Axial::new(-1, 2); let sum = p1 + p2; assert_eq!(sum, p2); assert_eq!(sum - p2, p1); } #[test] fn distance_simple() { let a = Axial::new(0, 0); let b = Axial::new(1, 3); assert_eq!(a.hex_distance(b), 4); for p in a.hex_neighbours().iter() { assert_eq!(p.hex_distance(a), 1); } } #[test] fn neighbour_indices() { let p = Axial::new(13, 42); let neighbours = p.hex_neighbours(); for (i, n) in neighbours.iter().cloned().enumerate() { let j = Axial::neighbour_index(n - p); assert_eq!(j, Some(i)); } } }
rust
import { Directive } from '@angular/core'; export class AtlasPopupDirective { constructor() { } } AtlasPopupDirective.decorators = [ { type: Directive, args: [{ selector: '[amPopup]' },] } ]; AtlasPopupDirective.ctorParameters = () => []; //# sourceMappingURL=data:application/json;base64,<KEY>=
javascript
:root { font-size: 16px; } .flex-center { display: flex; align-items: center; justify-content: center; } .flex-grow { flex-grow: 1; } .width-full { width: 100%; } .page { position: relative; height: 100%; @media (--breakpoint-small) { padding: 4px; } } .loading { display: block; width: 100%; height: 100%; } .el-message.in-place { position: relative; left: unset; top: unset; transform: unset; } body .el-dialog { &__body { @media (--breakpoint-small) { padding: 0; } } }
css
Former Bihar Chief Minister Lalu Prasad Yadav on Tuesday became very angry over Delhi Chief Minister Arvind Kejriwal's demand for the arrest of Congress president Sonia Gandhi on the payoffs in the AgustaWestland kickbacks to top Congress leadership. He said Kejriwal was overdoing things. Lalu took the opportunity to get back to the episode of his grabbing Kejriwal and embracing him when the Delhi Chief Minister attended the swearing-in of the re-elected Bihar Chief Minister Nitish Kumar. At that time, asked why he embraced a tainted Chief Minister Lalu, Kejriwal had replied that he was helpless as he was grabbed and embraced in the Bihari style by Lalu. This was on the mind of Lalu when he reacted to Kejriwal's remark against Sonia Gandhi. `What,' he said, `is Kejriwal a heroine who should be grabbed and embraced? ' (for his remark against Sonia). Lalu is one of those leaders who does not forget.
english
<filename>bin/sort.py #!/usr/bin/env python3 """ usage: sort.py [-h] sort lines options: -h, --help show this help message and exit quirks: sorts tabs as different than spaces sorts some spaces ending a line as different than none ending a line examples: Oh no! No examples disclosed!! 💥 💔 💥 """ # FIXME: doc -k$N,$N and -n and maybe little else is worth learning # FIXME: ass -k-1,-1 for negative field indexing # FIXME: think into the mess at "sort" vs "LC_ALL=C sort" import sys import argdoc def main(): args = argdoc.parse_args() sys.stderr.write("{}\n".format(args)) sys.stderr.write("{}\n".format(argdoc.format_usage().rstrip())) sys.stderr.write("sort.py: error: not implemented\n") sys.exit(2) # exit 2 from rejecting usage if __name__ == "__main__": main() # copied from: git clone https://github.com/pelavarre/pybashish.git
python
In a statement that could stoke controversy, Rashtriya Lok Samta Dal (RLSP) chief Upendra Kushwaha Tuesday urged the people of Bihar and mahagathbandhan allies to protect their vote even if it takes to pick up weapons, ANI reported. Kushwaha’s remarks were in regard to the videos of EVMs being allegedly transported and stored in unauthorised vehicles that emerged online on Tuesday. “We have received news that a vehicle carrying EVMs was recovered and the officials there had no answer for that. Incidents like these create doubts in the people’s mind which is legitimate. There is anger among the people and the state and central government are responsible to handle it. If they won’t do it then the people and mahagathbandhan will not sit quietly,” he added. Meanwhile, 22 opposition parties met the election commission Tuesday demanding tallying of VVPAT slips with EVM results. Their demand included the matching of at least 5 EVMs with VVPAT in a constituency and if it does not match, then verify all EVMs at a constituency. RLSP is a part of the Congress-RJD alliance in Bihar since it broke ties with BJP-JD(U) faction in 2018.
english
Iga Swiatek added another chapter to her increasingly impressive French Open resume after beating an ailing Lesia Tsurenko in the fourth round on Monday. World No. 1 Swiatek, who's also the defending champion, surged to a 5-1 lead before Tsurenko called it quits shortly after taking a medical timeout. Swiatek burst to a 4-1 lead on Suzanne Lenglen before Tsurenko called for the physio and had her blood pressure checked. Swiatek held serve again for 5-1 before Tsurenko called it quits. The win was Swiatek's 25th in 27 matches at Roland Garros, giving her a stunning win percentage of 92.6, just behind Margaret Court (95.2%) and ahead of Chris Evert (92.3%) in the Open Era. Swiatek's first loss at the claycourt Major came on her debut in 2019, a 6-1, 6-0 mauling against Simona Halep in the fourth round. Her second loss came two years later when the 2020 champion lost in the quarterfinal to Maria Sakkari (6-4, 6-4). The 22-year-old won her second Roland Garros title last year and is looking good for a third in 2023. Iga Swiatek will face Coco Gauff in the last eight - a rematch of the pair's 2022 final - at Roland Garros. The Swiatek-Gauff clash will be the second time French Open finalists meet in the subsequent edition's quarterfinals. Chris Evert overcame Virginia Ruzici in the 1980 final and also won their 1981 quarterfinal clash. Ahead of her last-eight clash with the defending champion, Gauff - who beat Anna-Karolina Schmiedlova in the fourth round - said that she will rewatch her 2022 title clash with Swiatek. The American said in her post-match press conference: "From a scouting standpoint, I have to rewatch that match because I don't think I've played her on clay since, I've played her on other surfaces. I don't know if the surface will matter that much. So I will rewatch some previous matches to see where I've gone wrong." Gauff added: "But, yeah, I guess the revisiting part for like the mentality, yeah, I mean, it's in the past. You know, in a positive way, not like I lost in the final, I don't want to think about it. It's more so I don't want to make the final my biggest accomplishment, I guess. I want to keep moving forward and keep reaching further heights." Iga Swiatek has won her last 11 matches at Roland Garros, so Gauff will have her task cut out.
english
import numpy as np import pandas as pd from munch import Munch from plaster.run.priors import ParamsAndPriors, Prior, Priors from plaster.tools.aaseq.aaseq import aa_str_to_list from plaster.tools.schema import check from plaster.tools.schema.schema import Schema as s from plaster.tools.utils import utils from plaster.tools.c_common import c_common_tools class SimV2Params(ParamsAndPriors): channel__priors__columns = ( "ch_i", "channel_name", "bg_mu", "bg_sigma", "dye_name", "gain_mu", "gain_sigma", "index", "p_bleach", "row_k_sigma", ) dye__label__priors__columns = ( "channel_name", "dye_name", "aa", "label_name", "ptm_only", "p_non_fluorescent", "ch_i", "bg_mu", "bg_sigma", "gain_mu", "gain_sigma", "row_k_sigma", "p_bleach", ) defaults = Munch( n_pres=1, n_mocks=0, n_edmans=1, dyes=[], labels=[], allow_edman_cterm=False, enable_ptm_labels=False, use_lognormal_model=False, is_survey=False, n_samples_train=5000, n_samples_test=1000, ) schema = s( s.is_kws_r( priors_desc=Priors.priors_desc_schema, n_pres=s.is_int(bounds=(0, None)), n_mocks=s.is_int(bounds=(0, None)), n_edmans=s.is_int(bounds=(0, None)), n_samples_train=s.is_int(bounds=(1, None)), n_samples_test=s.is_int(bounds=(1, None)), dyes=s.is_list( elems=s.is_kws_r(dye_name=s.is_str(), channel_name=s.is_str(),) ), labels=s.is_list( elems=s.is_kws_r( aa=s.is_str(), dye_name=s.is_str(), label_name=s.is_str(), ptm_only=s.is_bool(required=False, noneable=True), ) ), channels=s.is_dict(required=False), allow_edman_cterm=s.is_bool(required=False, noneable=True), enable_ptm_labels=s.is_bool(required=False, noneable=True), use_lognormal_model=s.is_bool(), is_survey=s.is_bool(), ) ) def __init__(self, **kwargs): # _skip_setup_dfs is True in fixture mode super().__init__(source="SimV2Params", **kwargs) self._setup_dfs() def validate(self): super().validate() all_dye_names = list(set([d.dye_name for d in self.dyes])) # No duplicate dye names self._validate( len(all_dye_names) == len(self.dyes), "The dye list contains a duplicate" ) # No duplicate labels self._validate( len(list(set(utils.listi(self.labels, "aa")))) == len(self.labels), "There is a duplicate label in the label_set", ) # All labels have a legit dye name [ self._validate( label.dye_name in all_dye_names, f"Label {label.label_name} does not have a valid matching dye_name", ) for label in self.labels ] # Channel mappings mentioned_channels = {dye.channel_name: False for dye in self.dyes} if "channels" in self: # Validate that channel mapping is complete for channel_name, ch_i in self.channels.items(): self._validate( channel_name in mentioned_channels, f"Channel name '{channel_name}' was not found in dyes", ) mentioned_channels[channel_name] = True self._validate( all([mentioned for _, mentioned in mentioned_channels.items()]), "Not all channels in dyes were enumerated in channels", ) else: # No channel mapping: assign them self["channels"] = { ch_name: i for i, ch_name in enumerate(sorted(mentioned_channels.keys())) } @property def n_cycles(self): return self.n_pres + self.n_mocks + self.n_edmans def channel_names(self): return [ ch_name for ch_name, _ in sorted(self.channels.items(), key=lambda item: item[1]) ] def ch_i_by_name(self): return self.channels @property def n_channels(self): # if self.is_photobleaching_run: # return 1 return len(self.channels) @property def n_channels_and_cycles(self): return self.n_channels, self.n_cycles def _setup_dfs(self): """ Assemble all of the priors into several dataframes indexed differently. (Call after validate) * self.channel__priors: ch_i, ch_name, bg_mu, bg_sigma, gain_mu, gain_sigma, row_k_sigma, p_bleach --> Note, does NOT have p_non_fluorescent because this is a dye property * self.dye__label__priors: aa, label_name, dye_name, ch_i, ch_name, bg_mu, bg_sigma, gain_mu, gain_sigma, row_k_sigma, p_bleach p_non_fluorescent, """ # if self.is_photobleaching_run: # # Not sure what these should be yet # # self._ch_by_aa = {} # # self._channel__priors = pd.DataFrame(columns=self.channel__priors__columns) # # self._dye__label__priors = pd.DataFrame(columns=self.dye__label__priors__columns) # self.dyes = [Munch(dye_name="zero", channel_name="zero")] # self.channels = Munch(zero=0) # self.labels = [ # dict(aa=".", dye_name="zero", label_name="zero", ptm_only=False) # ] labels_df = pd.DataFrame(self.labels) # labels_df: (aa, dye_name, label_name, ptm_only) # assert len(labels_df) > 0 dyes_df = pd.DataFrame(self.dyes) # dyes_df: (dye_name, channel_name) # assert len(dyes_df) > 0 # LOOKUP dye priors dye_priors = [] for dye in self.dyes: # SEARCH priors by dye name and if not found by channel p_non_fluorescent = self.priors.get_exact( f"p_non_fluorescent.{dye.dye_name}" ) if p_non_fluorescent is None: p_non_fluorescent = self.priors.get( f"p_non_fluorescent.ch_{dye.channel_name}" ) dye_priors += [ Munch(dye_name=dye.dye_name, p_non_fluorescent=p_non_fluorescent.prior,) ] dye_priors_df = pd.DataFrame(dye_priors) # dye_priors_df: (dye_name, p_non_fluorescent) dyes_df = utils.easy_join(dyes_df, dye_priors_df, "dye_name") # dyes_df: (dye_name, channel_name, p_non_fluorescent) # TODO: LOOKUP label priors # (p_failure_to_bind_aa, p_failure_to_attach_to_dye) # LOOKUP channel priors ch_priors = pd.DataFrame( [ dict( channel_name=channel_name, ch_i=ch_i, bg_mu=self.priors.get(f"bg_mu.ch_{ch_i}").prior, bg_sigma=self.priors.get(f"bg_sigma.ch_{ch_i}").prior, gain_mu=self.priors.get(f"gain_mu.ch_{ch_i}").prior, gain_sigma=self.priors.get(f"gain_sigma.ch_{ch_i}").prior, row_k_sigma=self.priors.get(f"row_k_sigma.ch_{ch_i}").prior, p_bleach=self.priors.get(f"p_bleach.ch_{ch_i}").prior, ) for channel_name, ch_i in self.channels.items() ] ) # ch_priors: (channel_name, ch_i, ...) self._channel__priors = ( utils.easy_join(dyes_df, ch_priors, "channel_name") .drop(columns=["p_non_fluorescent"]) .drop_duplicates() .reset_index() ) # self._channel__priors: ( # 'ch_i', 'channel_name', 'bg_mu', 'bg_sigma', 'dye_name', # 'gain_mu', 'gain_sigma', 'index', 'p_bleach', 'row_k_sigma', # ) # SANITY check channel__priors group_by_ch = self._channel__priors.groupby("ch_i") for field in ( "bg_mu", "bg_sigma", "gain_mu", "gain_sigma", "row_k_sigma", ): assert np.all(group_by_ch[field].nunique() == 1) assert "p_non_fluorescent" not in self._channel__priors.columns labels_dyes_df = utils.easy_join(labels_df, dyes_df, "dye_name") self._dye__label__priors = utils.easy_join( labels_dyes_df, ch_priors, "channel_name" ).reset_index(drop=True) # self._dye__label__priors: ( # 'channel_name', 'dye_name', 'aa', 'label_name', # 'ptm_only', 'p_non_fluorescent', 'ch_i', 'bg_mu', 'bg_sigma', # 'gain_mu', 'gain_sigma', 'row_k_sigma', 'p_bleach' # ) self._ch_by_aa = { row.aa: row.ch_i for row in self._dye__label__priors.itertuples() } def ch_by_aa(self): return self._ch_by_aa def dye__label__priors(self): """ DataFrame( 'channel_name', 'dye_name', 'aa', 'label_name', 'ptm_only', 'p_non_fluorescent', 'ch_i', 'bg_mu', 'bg_sigma', 'gain_mu', 'gain_sigma', 'row_k_sigma', 'p_bleach' ) """ return self._dye__label__priors def channel__priors(self): """ DataFrame( 'ch_i', 'channel_name', 'bg_mu', 'bg_sigma', 'dye_name', 'gain_mu', 'gain_sigma', 'index', 'p_bleach', 'row_k_sigma', ) """ return self._channel__priors def by_channel(self): return self._channel__priors.set_index("ch_i") def to_label_list(self): """Summarize labels like: ["DE", "C"]""" return [ "".join( [label.aa for label in self.labels if label.dye_name == dye.dye_name] ) for dye in self.dyes ] def to_label_str(self): """Summarize labels like: DE,C""" return ",".join(self.to_label_list()) def cycles_array(self): cycles = np.zeros((self.n_cycles,), dtype=c_common_tools.CycleKindType) i = 0 for _ in range(self.n_pres): cycles[i] = c_common_tools.CYCLE_TYPE_PRE i += 1 for _ in range(self.n_mocks): cycles[i] = c_common_tools.CYCLE_TYPE_MOCK i += 1 for _ in range(self.n_edmans): cycles[i] = c_common_tools.CYCLE_TYPE_EDMAN i += 1 return cycles def pcbs(self, pep_seq_df): """ pcb stands for (p)ep_i, (c)hannel_i, (b)right_probability This is a structure that is liek a "flu" but with an extra bright probability. Each peptide has a row for each amino acid That row has a columns (pep_i, ch_i, p_bright) And it will have np.nan for ch_i and p_bright **IF THERE IS NO LABEL** bright_probability is the inverse of all the ways a dye can fail to be visible ie the probability that a dye is active. pep_seq_df: Any DataFrame with an "aa" column Returns: contiguous ndarray(:, 3) where there 3 columns are: pep_i, ch_i, p_bright """ labelled_pep_df = pep_seq_df.join( self.dye__label__priors().set_index("aa"), on="aa", how="left" ) # p_bright = is the product of (1.0 - ) all the ways the dye can fail to be visible. labelled_pep_df["p_bright"] = ( # TODO: Sim needs to be converted to use priors sampling # at which point this function needs to be refactored # so that the parameters of the priors can be sampled in C. 1.0 - np.array( [ i.sample() if isinstance(i, Prior) else np.nan for i in labelled_pep_df.p_non_fluorescent ] ) # TODO: Add label priors # * (1.0 - labelled_pep_df.p_failure_to_attach_to_dye) # * (1.0 - labelled_pep_df.p_failure_to_bind_aa) ) labelled_pep_df.sort_values(by=["pep_i", "pep_offset_in_pro"], inplace=True) return np.ascontiguousarray( labelled_pep_df[["pep_i", "ch_i", "p_bright"]].values ) @classmethod def from_aa_list_fixture(cls, aa_list, priors=None, **kwargs): """ This is a helper to generate channel when you have a list of aas. For example, two channels where ch0 is D&E and ch1 is Y. ["DE", "Y"]. """ check.list_or_tuple_t(aa_list, str) allowed_aa_mods = ["[", "]"] assert all( [ (aa.isalpha() or aa in allowed_aa_mods) for aas in aa_list for aa in list(aas) ] ) dyes = [ Munch(dye_name=f"dye_{ch}", channel_name=f"ch_{ch}") for ch, _ in enumerate(aa_list) ] # Note the extra for loop because "DE" needs to be split into "D" & "E" # which is done by aa_str_to_list() - which also handles PTMs like S[p] labels = [ Munch( aa=aa, dye_name=f"dye_{ch}", label_name=f"label_{ch}", ptm_only=False, ) for ch, aas in enumerate(aa_list) for aa in aa_str_to_list(aas) ] return cls(dyes=dyes, labels=labels, priors=priors, **kwargs)
python
<reponame>jwzimmer/tv-tropes { "MeaningfulTitles": [ "NeverTrustATitle", "TheArchmage", "AristocratsAreEvil", "TheBrigadier", "BlueCollarWarlock", "TheCaptain", "ColonelBadass", "CommandingCoolness", "CourtMage", "DrillSergeantNasty", "EarnYourTitle", "TheEmperor", "EnsignNewbie", "EvilChancellor", "TheEvilPrince", "FourStarBadass", "GeneralFailure", "GeneralRipper", "GodSaveUsFromTheQueen", "TheGoodCaptain", "TheGoodChancellor", "TheGoodKing", "InsaneAdmiral", "MajorlyAwesome", "MorallyAmbiguousDoctorate", "PrincessClassic", "TheProfessor", "SergeantRock", "TheWisePrince" ] }
json
A local court in north Bengal’s Cooch Behar district has issued a non-bailable warrant against Union minister John Barla for allegedly holding a political rally without taking proper permission in the run up to the 2019 Lok Sabha elections. Barla, the then BJP candidate from Alipurduar for the general elections, was allegedly present in the rally within Boxirhat police station limits of Tufanganj block-II on April 4, 2019. A complaint was lodged against him for not taking permission to hold the rally, thereby violating the election model code of conduct. “An election official had lodged a complaint against him and three others at the Boxirhat police station,” said Sanjay Barman, assistant public prosecutor of the Tufanganj sub-divisional judicial magistrate court. Barla received several summons to be present for hearing but he did not turn up, the court claimed. The last time Barla was summoned to appear before the Tufanganj sub-divisional judicial magistrate court was on November 15. The court issued a non-bailable warrant against him for his no-show to the summons, personally or through a lawyer. Adip Bhujel, one of Barla’s personal secretaries, said, “The local police used to inform about the summons. ” However, he did not say if the Union minister received those. Barla is a resident of Laxmipara Tea Garden under Banarhat police station. Repeated attempts by HT to elicit response from Barla were turned down. “Barla does not have any lawyer,” one of his personal assistants said.
english
The 'Be Clear on Cancer' campaign has warned that persistent cough, which has lasted for three weeks or more, could be a symptom of the fatal disease. It was aimed at reducing the number of deaths from lung cancer and especially targets people over the age of 50, because they are most vulnerable, the BBC reported. Health Secretary Jeremy Hunt said that the message from this campaign is clear - if you have a persistent cough, go and see your doctor. He asserted that the earlier lung cancer is diagnosed, the more likely that the treatment will be successful. Among other symptoms of the condition include a cough that has got worse or changes, repeated chest infections, coughing up blood, breathlessness, feeling more tired than usual for some time, unexplained weight loss and an ache or pain in your chest or shoulder that has lasted some time. Read more Health News.
english
If you have a long-time friend who is in dire need of funds, do help to the extent that will not leave you financially bereft. While we reiterate that money can ruin the best of friendships, especially if you do not get back the money you have loaned, this argument stands for friends who have gone out of the way to help you in the past and have stood by you through thick and thin. Even if you need to dish out financial help for a sustained period, do so. The caveat here is, of course, that you do not endanger your own finances or your family. Another leak you should allow is spending on entertainment, eating out, even taking a brief holiday, if you have been exceptionally frugal trying to meet a goal. Sometimes, the single-minded intent of achieving a goal requires financial sacrifices on the part of the entire family, resulting in cutting out discretionary expenses. However, excessive thriftiness can backfire if it begins to affect the mental health of family members and leads to constant fights and conflicts. In such situations, it is better to allow these financial leaks and let off pressure. The caveat here is, of course, not to indulge in expensive activities or to do it on a consistent basis. A similar, but specific, situation is often faced by women in the family, where they let go of their personal needs to fulfill those of their children or spouse. Managing a budget or preventing wasteful expenditure is not the duty of a single family member, but a joint effort. If the situation calls for frugality, be it due to the loss of job, high goal value, or financial emergency, the entire family needs to be taken into confidence, with the remedial measures to be taken by everyone, not just the woman. So if you are a wife or a mother who has been especially hard on herself financially, allow yourself a few money leaks, be it a personal purchase or eating out with friends. This will not only induce financial empathy among children, but also teach them the value of working as a team during a financial crisis. Another situation where you can allow your budget to withstand a few fissures is when it comes to your parents. If they have been like most Indian parents who have made sacrifices to ensure you got a good education and life, have offered financial help freely whenever you have required it even as an adult, pitched in during your initial earning years or financed your startup dreams, you should allow those leaks in your budget. Even if you are the secondary earning member in the family, do not hesitate to offer financial help to your parents if they are going through a crisis or just need a nudge every now and then. Make sure, however, that you share it with your spouse and do not compromise your own goals. All of us have been in a financial dilemma when it comes to relationships. How do you say no to a friend who wants you to invest in his new business venture? Should you take a loan from your married brother? Are you concerned about your wife’s impulse buying? If you have any such concerns that are hard to resolve, write in to us at etwealth@timesgroup.com with ‘Wealth Whines’ as the subject. Disclaimer: The advice in this column is not from a licensed healthcare professional and should not be construed as psychological counselling, therapy or medical advice. ET Wealth and the writer will not be responsible for the outcome of the suggestions made in the column. (Your legal guide on estate planning, inheritance, will and more.) Download The Economic Times News App to get Daily Market Updates & Live Business News.
english
<reponame>cjh1/github-plugin // Copyright (C) 2013 The Android Open Source Project // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package com.googlesrouce.gerrit.plugins.github.git; import java.io.File; import java.io.IOException; import org.apache.commons.io.FileUtils; import org.eclipse.jgit.api.CloneCommand; import org.eclipse.jgit.lib.ProgressMonitor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.google.gerrit.server.account.GroupBackend; import com.google.gerrit.server.git.MetaDataUpdate; import com.google.gerrit.server.project.ProjectCache; import com.google.inject.Inject; import com.google.inject.assistedinject.Assisted; import com.googlesource.gerrit.plugins.github.GitHubConfig; public class GitCloneStep extends ImportStep { private static final Logger LOG = LoggerFactory.getLogger(GitImporter.class); private final File gitDir; private File destinationDirectory; public interface Factory { GitCloneStep create(@Assisted("organisation") String organisation, @Assisted("name") String repository); } @Inject public GitCloneStep(GitHubConfig gitConfig, MetaDataUpdate.User metaDataUpdateFactory, GroupBackend groupBackend, ProjectCache projectCache, GitHubRepository.Factory gitHubRepoFactory, @Assisted("organisation") String organisation, @Assisted("name") String repository) throws GitDestinationAlreadyExistsException, GitDestinationNotWritableException { super(gitConfig.gitHubUrl, organisation, repository, gitHubRepoFactory); LOG.debug("GitHub Clone " + organisation + "/" + repository); this.gitDir = gitConfig.gitDir; this.destinationDirectory = getDestinationDirectory(organisation, repository); } private File getDestinationDirectory(String organisation, String repository) throws GitDestinationAlreadyExistsException, GitDestinationNotWritableException { File orgDirectory = new File(gitDir, organisation); File destDirectory = new File(orgDirectory, repository + ".git"); if (destDirectory.exists() && isNotEmpty(destDirectory)) { throw new GitDestinationAlreadyExistsException(destDirectory); } if (!orgDirectory.exists()) { if (!orgDirectory.mkdirs()) { throw new GitDestinationNotWritableException(destDirectory); } } return destDirectory; } @Override public void doImport(ProgressMonitor progress) throws GitCloneFailedException, GitDestinationAlreadyExistsException, GitDestinationNotWritableException { CloneCommand clone = new CloneCommand(); String sourceUri = getSourceUri(); clone.setURI(sourceUri); clone.setBare(true); clone.setDirectory(destinationDirectory); if (progress != null) { clone.setProgressMonitor(progress); } try { LOG.info(sourceUri + "| Clone into " + destinationDirectory); clone.call(); } catch (Throwable e) { throw new GitCloneFailedException(sourceUri, e); } } private boolean isNotEmpty(File destDirectory) { return destDirectory.listFiles().length > 0; } public File getDestinationDirectory() { return destinationDirectory; } public boolean rollback() { File gitDirectory = destinationDirectory; if(!gitDirectory.exists()) { return false; } try { FileUtils.deleteDirectory(gitDirectory); return true; } catch (IOException e) { LOG.error("Cannot clean-up output Git directory " + gitDirectory); return false; } } }
java
<filename>app/CustomStyles/customerManagementStyles.css<gh_stars>0  .view { left: 60px; position: relative; opacity: 0.95; } .card { background-color:#efefef; border: 1px solid black; height:80px; width: 225px; margin-bottom: 20px; } .cardHeader { background-color: #006dcc; font-size:10pt; color:white; padding:4px; } .cardHeaderNew { background-color:#fbc51a; font-size:10pt; color:white; padding:4px; } .cardClose { color: white; font-weight:bold; margin-right:5px; } .cardContainer { width:90%; } .cardBody { padding-left: 5px; } .lastRow { background-color: #ccc; } .indent { margin-left:20px; } .ordersTable { width:800px; margin-left:20px; } .orders th, .customerOrders th { width:25%; cursor: pointer; } .ordersTable tr:first-child th { background-color: #006dcc; color: #fff; font-weight: bold; } #submitCustomer { margin-left:50px; margin-top: -8px; } footer { margin-top:10px; font-weight: bold; }
css
<filename>App/Services/contatoService.js //No Service é onde vão ficar as regras de negócio //E acesso externo a serviços via AJAX //Injetamos o objeto HTTP pra fazer chamadas AJAX //AJAXSON aplicacao.service("contatoService", function ($http) { //var servico = "http://localhost:3000/api"; var servico = location.protocol+"//"+location.host+"/api"; console.log("Serv=",servico); //O THIS aqui dentro dos métodos é como se //Fosse o modificador PUBLIC (VISIBILIDADE) this.Listar = function () { return $http({ url: servico, method: "GET" }); }; this.Cadastrar = function (novoContato) { return $http({ url: servico, method: "POST", data: novoContato }); }; });
javascript
<reponame>GoZOo/Drupaloscopy 8.0-alpha2:0752bd643984ee065f6f1fd9351f2bb4dfbbb8e9666b6fd7da678ed8a24f053e
css
Set the songs from Shah Rukh Khan's Pathaan as your caller music to keep your callers entertained while they wait for you to answer the phone. iPhone users can finally start using 5G Internet services. Apple has finally released the iOS 16. 2 beta update for compatible iPhones. The update brings 5G network support for Airtel and Jio iPhone beta users. Apple will enable 5G in the iOS 16 Beta software programme next week for the select iPhone users in the country, the tech giant confirmed on Wednesday. Those using iPhone 14, iPhone 13, iPhone 12 and iPhone SE (third generation) models will get an upcoming software update on 5G. Apple has confirmed that eligible iPhone users in India will be able to use 5G services from December. Once Apple rolls out the software update, Indian iPhone users with Airtel and Reliance Jio network in the selected cities will be able to use 5G. Customers in Delhi, Mumbai, Chennai, Bengaluru, Hyderabad, Siliguri, Nagpur, and Varanasi, according to Airtel, will begin enjoying the cutting-edge Airtel 5G Plus services in phases as the company continues to build its network and complete the rollout. Sunil Bharti Mittal said the nation's oldest private telecom operator is launching 5G mobile services in eight major cities and will cover most parts by March 2023 and the entire country by March 2024. In 2014, 1GB of data used to cost Rs 300 but now it has come to Rs 10. "Internet users now consume 14GB per month. This used to cost Rs 4,200 per month in 2014. But now it costs somewhere between Rs 125 to Rs 150," PM Modi said. Reliance Industries chief Mukesh Ambani took the stage and said that Jio’s ‘true’ 5G services will reach all parts of the country by December 2023. Jio is rapidly progressing to roll out 5G services within this month. PM Modi launched 5G services in India on Saturday. The 5G will first be rolled out in select metro cities and people will be able to experience 10 times the faster internet speed than 4G. 5G offers speed multiple times faster than 4G, supports lag-free connectivity, and can enable billions of connected devices to share data in real time. Following the exhibition's opening, PM Modi visited pavilions put up by several telecom carriers and technology companies to get a firsthand look at what 5G can achieve. The PM was given a personal presentation by Mukesh Ambani's eldest son, Akash Ambani, who just took over as Chairman of Jio Infocomm, Reliance Industries' digital subsidiary. PM Modi launched 5G services in India on Saturday. The 5G will first be rolled out in select metro cities and people will be able to experience 10 times the faster internet speed than 4G. The 5G network is making its public debut in India at the India Mobile Congress. PM Modi is launching the next-generation mobile network in India in the festive season and the telecom giants are also expected to announce their 5G plans soon. If you still don’t know if your phone supports 5G network, here is a step-by-step guide for you to help you out. The three major telecom operators of the country -- Reliance Jio, Bharti Airtel and Vodafone-Idea -- will demonstrate one area each where the spectrum holds the potential to revolutionise everyday lives. Under Pichai, Google has made massive investments in India. It has announced an investment of about $10 billion under Google for India digitization. It also has partnerships with Bharti Airtel and Reliance's Jio.
english
After testing hundreds of frogs representing dozens of species on an amphibian version of a treadmill, researchers have determined that colorful, highly poisonous frogs have the greatest aerobic capacities. Earlier studies had suggested a link between poison and metabolism in frogs, but involved just a handful species. Of course, unless you've always dreamed of putting frogs on treadmills, or plan to bet on frog races, the results might seem a bit academic. But they raise a fascinating natural history question: Why are colorful, poisonous frogs the fittest? University of Texas, Austin, biologists Juan Santos and David Cannatella, who described their frog experiments March 28 in the Proceedings of the National Academy of Sciences, have a few ideas. In frogs, especially bright colors generally signify toxicity, informing predators of their prospective meal's unpalatability. But whereas most poisonous animals produce venom naturally, the frogs distill it from their food. To find the right insects, they forage far and wide, rather than waiting for whatever fare passes by. Evolution would seem to have produced aerobic adaptations that help poisonous frogs roam, then amplified coloration as a defensive signal. It's also possible that bright coloration evolved first, providing some sort of advantage -- predator defense, perhaps, or help finding mates -- that allowed those frogs to range farther than their drab brethren. That in turn could have allowed them to specialize in eating uncommon, toxin-enabling insects. Both evolutionary paths are likely represented among poisonous frogs, wrote Santos and Cannatella. To study these questions in further detail, new methodologies would help -- including, perhaps, analyses on frog coloration as seen through their predators' eyes, rather than our own. Image: Poison dart frog (Tambako the Jaguar/Flickr) See Also: Citation: "Phenotypic integration emerges from aposematism and scale in poison frogs." By Juan C. Santos and David C. Cannatella. Proceedings of the National Academy of Sciences, published online before print, March 28, 2011.
english
Pathaan is roaring in theatres and the response is unprecedented. With the release of the Shah Rukh Khan – Deepika Padukone – John Abraham starrer, the opening day in cinema halls are going houseful with fans cheering, whistling, screaming, dancing in theatres. A day prior to the release, Yash Raj Films hosted a special screening which was attended by Karan Johar. Today, the filmmaker took to his official Instagram account to praise the visual spectacle. Taking a jab on the Hindi films being boycotted and slandered in the past couple of years, Karan said, “And love you BOLLYWOOD! You may have been slandered and “boycotted” but no one can deny that when you come into your own no one can stand in your way!" He concluded by saying, “PATHAAN MUBARAK to alll!!!! ( no spoiler but the Best sequence of the film is with BHAI and BHAIJAAN) I stood up and clapped !!!!!” while talking about Salman Khan cameo in Pathaan. Meanwhile, Shah Rukh Khan stars alongside Deepika Padukone and John Abraham. Helmed by Siddharth Anand of War fame, the film has arrived in theatres in Hindi, Tamil and Telugu. Catch us for latest Bollywood News, New Bollywood Movies update, Box office collection, New Movies Release , Bollywood News Hindi, Entertainment News, Bollywood Live News Today & Upcoming Movies 2024 and stay updated with latest hindi movies only on Bollywood Hungama.
english
झारखण्ड राज्य के पहले मुख्यमंत्री कौन थे ? 2.झारखण्ड राज्य के प्रथम राज्यपाल कौन थे? 3.झारखण्ड राज्य के गठन के समय उसमें ज़िलों की संख्या कितनी थी? 4.झारखण्ड राज्य का सबसे ऊँचा पर्वत शिखर कौन-सा है? झारखण्ड हैं, जिनकी ऊँचाई लगभग 914 मीटर है। इन पठारों को यहाँ 'पाट' कहा जाता है। झारखण्ड में उच्चतम बिंदु झारखण्ड' कहाँ स्थित है? नीचे दिए गए विषय पर सवाल जवाब के लिए टॉपिक के लिंक पर क्लिक करें Culture Current affairs International Relations Security and Defence Social Issues English Antonyms English Language English Related Words English Vocabulary Ethics and Values Geography Geography - india Geography -physical Geography-world River Gk GK in Hindi (Samanya Gyan) Hindi language History History - ancient History - medieval History - modern History-world Age Aptitude- Ratio Aptitude-hindi Aptitude-Number System Aptitude-speed and distance Aptitude-Time and works Area Art and Culture Average Decimal Geometry Interest L.C.M.and H.C.F Mixture Number systems Partnership Percentage Pipe and Tanki Profit and loss Ratio Series Simplification Time and distance Train Trigonometry Volume Work and time Biology Chemistry Science Science and Technology Chattishgarh Delhi Gujarat Haryana Jharkhand Jharkhand GK Madhya Pradesh Maharashtra Rajasthan States Uttar Pradesh Uttarakhand Bihar Computer Knowledge Economy Indian culture Physics PolityLabels: , , , , ,
english
Why you can trust TechRadar We spend hours testing every product or service we review, so you can be sure you’re buying the best. Find out more about how we test. The Fossil Q Accomplice and its accompanying app are compatible with Android OS 5.0 devices and above and iOS 9.0 devices and above. Syncing the watch to your phone is a fast and easy process. Simply turn on your phone’s Bluetooth and hold a button on the watch until it enters pairing mode (indicated by three vibrations) and you should be good to pair. After this you simply use an easy step-by-step set-up guide in the app which will take you through the main features and help you set up your preferences. The app is neat and easy to understand. The home page will give you a breakdown of your main button functions, steps taken and notification assignations. The device section allows you to change your 3 main button functions while the notifications tab lets you to decide which contacts and apps you receive notifications for. The stats section is a more in-depth breakdown of your physical activity for the day. An area where hybrid watches really trounce their smartwatch counterparts is in battery life. While you’ll probably find yourself charging a smartwatch most nights, hybrid watches use ordinary coin cell batteries and last around six months. This is, naturally, because hybrid watches do less than smartwatches and don’t have a screen to power but it really is such a benefit. The watch battery for the Q Accomplice is easy to change on your own using the provided tool and the replacements are reasonably affordable. Not having used it for half a year, we can't say whether the Q Accomplice battery really does last a full 6 months, but these estimates tend to be fairly accurate. It's worth noting, though, that if you turn on the notification vibrations you definitely won't get the full six months out of it. Emma Boyle is TechRadar’s ex-Gaming Editor, and is now a content developer and freelance journalist. She has written for magazines and websites including T3, Stuff and The Independent. Emma currently works as a Content Developer in Edinburgh.
english
<gh_stars>0 package smlstlmnt import "testing" type TestCase struct { Input []int Expected int } func Test_smallest_element(t *testing.T) { tests := []TestCase{ {[]int{-1, 1, -2, 2}, -2}, {[]int{1}, 1}, } for _, test := range tests { smallest := SmallestElement(test.Input) if smallest != test.Expected { t.Error("Smallest element of", test.Input, "is expected to be", test.Expected, "but got", smallest) } } }
go
import {NgModule} from '@angular/core'; import {CommonModule} from '@angular/common'; import {PlanCreateComponent} from './plan-create/plan-create.component'; import {PlanDeleteComponent} from './plan-delete/plan-delete.component'; import {PlanListComponent} from './plan-list/plan-list.component'; import {PlanComponent} from './plan.component'; import {CoreModule} from '../../../core/core.module'; import {SharedModule} from '../../../shared/shared.module'; import { PlanDetailComponent } from './plan-detail/plan-detail.component'; @NgModule({ declarations: [PlanCreateComponent, PlanDeleteComponent, PlanListComponent, PlanComponent, PlanDetailComponent], exports: [ PlanListComponent ], imports: [ CommonModule, CoreModule, SharedModule ] }) export class PlanModule { }
typescript
Hope you didn’t download The Hurt Locker with BitTorrent because it looks like the film’s producers may be coming after you. They’re looking at a multi-million dollar copyright infringement lawsuit that would target “tens of thousands” of users. Let’s discuss this for a moment. One of the main reasons why the lawsuit has been put into action is because the movie, despite its critical acclaim, only made a little more than $16 million at the box office. Part of that is because the movie wasn’t even in theaters as it was winning awards left and right. A movie can’t make money if people can’t see it, you know? The other, far more ominous (not to mention convenient) reason is that, well, people pirated the movie! A version of the movie had been available online for quite a while before its U.S. theatrical release, but downloads didn’t pick up till Oscar season. The lawsuit will target people who downloaded the movie via BitTorrent. It’s not exactly sure what sites are being targeted, whether or not “private” sites are among them, but do not be surprised if you get a nice letter in the mail soon. Like other such actions, you’ll probably be asked to cough up a certain amount of money, presumably in the thousands of dollars, or face the wrath of the court system. The point isn’t so much to make, I don’t know, another $16 million, but rather to scare y’all from hopping aboard the BitTorrent bandwagon. I will end with this: if you’re downloading from BitTorrent in 2010, you really are rolling the dice. Stop! You may be better off walking into a Best Buy and physically stealing a copy of The Hurt Locker on Blu-ray than downloading a rip from some BitTorrent site. I’m almost positive the fine and/or punishment for theft is less than the fine and/or punishment for copyright infringement at this point. And no, that makes zero sense, but whatever. Or, as Ron just said on Ron and Fez, you’re not entitled to The Hurt Locker simply because it exists.
english
<filename>data/wpackagist-plugin/pr/proud-mother-with-an-autistic-child-ribbon-plugin/package.json {"packages":{"wpackagist-plugin\/proud-mother-with-an-autistic-child-ribbon-plugin":{"1.0":{"name":"wpackagist-plugin\/proud-mother-with-an-autistic-child-ribbon-plugin","version":"1.0","version_normalized":"1.0.0.0","uid":272786,"dist":{"type":"zip","url":"https:\/\/downloads.wordpress.org\/plugin\/proud-mother-with-an-autistic-child-ribbon-plugin.zip?timestamp=1330363873"},"source":{"type":"svn","url":"https:\/\/plugins.svn.wordpress.org\/proud-mother-with-an-autistic-child-ribbon-plugin\/","reference":"trunk"},"homepage":"https:\/\/wordpress.org\/plugins\/proud-mother-with-an-autistic-child-ribbon-plugin\/","require":{"composer\/installers":"~1.0"},"type":"wordpress-plugin"},"dev-trunk":{"name":"wpackagist-plugin\/proud-mother-with-an-autistic-child-ribbon-plugin","version":"dev-trunk","version_normalized":"9999999-dev","uid":272787,"time":"2012-02-27 17:31:13","dist":{"type":"zip","url":"https:\/\/downloads.wordpress.org\/plugin\/proud-mother-with-an-autistic-child-ribbon-plugin.zip?timestamp=1330363873"},"source":{"type":"svn","url":"https:\/\/plugins.svn.wordpress.org\/proud-mother-with-an-autistic-child-ribbon-plugin\/","reference":"trunk"},"homepage":"https:\/\/wordpress.org\/plugins\/proud-mother-with-an-autistic-child-ribbon-plugin\/","require":{"composer\/installers":"~1.0"},"type":"wordpress-plugin"}}}}
json
Asian Games Gold Medallist Dingko Singh was flown from Imphal to Delhi by SpiceJet’s air ambulance service on Saturday for his liver cancer treatment. The 41-year-old former boxer reached the capital in the evening (6:15pm), accompanied by his wife, Ngangom Babai Devi and headed to the Institute of Liver and Biliary Sciences (ILBS) in an ambulance, straight from the airport. At a time when no airline is operational due to lockdown, the airline provided the air ambulance service free of charge to the Padma awardee. The decision to fly Dingko to Delhi in an air ambulance was taken by SpiceJet Chairman and Managing Director Ajay Singh, who is also the President of the Boxing Federation of India. Ajay Singh, Chairman & Managing Director, SpiceJet and President, Boxing Federation of India, said, “I am to happy share that Dingko, our champion boxer, has reached Delhi and has been taken to hospital for further treatment. SpiceJet is honoured to have provided its air ambulance service to our national hero and fly him to Delhi for his treatment and we wish him a speedy recovery.” Boxing Federation of India will be keeping a close watch on the boxing legend’s treatment and progress.
english
package com.github.yellowstonegames.grid; import com.github.tommyettinger.ds.ObjectList; import javax.annotation.Nonnull; import java.util.List; /** * A simple line-drawing algorithm that only takes orthogonal steps; may be useful for LOS in games that use Manhattan * distances for measurements. * Algorithm is from http://www.redblobgames.com/grids/line-drawing.html#stepping , thanks Amit! */ public class OrthoLine implements LineDrawer { /** * A buffer of Coord as an ObjectList; this is cleared and reused by the drawLine() methods, so its state can only * be certain until you make another call to one of those methods. The drawLine() overloads that explicitly take a * buffer argument don't use this field. */ public final ObjectList<Coord> lastLine; /** * Makes a new OrthoLine and initializes its only state, {@link #lastLine}. */ public OrthoLine(){ lastLine = new ObjectList<>(); } /** * Draws a line from (startX, startY) to (endX, endY) using only N/S/E/W movement. * Consider reusing an ObjectList instead of allocating a new one each time, if * possible; this method allocates an ObjectList per call, but * {@link #line(int, int, int, int, ObjectList)} does not. * Returns an ObjectList of Coord in order. * * @param startX x of starting point * @param startY y of starting point * @param endX x of ending point * @param endY y of ending point * @return ObjectList of Coord, including (startX, startY) and (endX, endY) and all points walked between */ public static ObjectList<Coord> line(int startX, int startY, int endX, int endY) { return line(startX, startY, endX, endY, null); } /** * Draws a line from (startX, startY) to (endX, endY) using only N/S/E/W movement. * If {@code buffer} is not null, it will be cleared and reused; if it is null, then * a new ObjectList will be allocated. Reusing {@code buffer} across multiple calls * is a good way to reduce GC pressure. Returns an ObjectList of Coord in order. * * @param startX x of starting point * @param startY y of starting point * @param endX x of ending point * @param endY y of ending point * @param buffer an ObjectList of Coord that will be reused and cleared if not null; will be modified * @return ObjectList of Coord, including (startX, startY) and (endX, endY) and all points walked between */ public static ObjectList<Coord> line(int startX, int startY, int endX, int endY, ObjectList<Coord> buffer) { int dx = endX - startX, dy = endY - startY, nx = Math.abs(dx), ny = Math.abs(dy); int signX = dx >> 31 | 1, signY = dy >> 31 | 1, workX = startX, workY = startY; if(buffer == null) { buffer = new ObjectList<>(1 + nx + ny); } else { buffer.clear(); buffer.ensureCapacity(1 + nx + ny); } buffer.add(Coord.get(startX, startY)); for (int ix = 0, iy = 0; ix <= nx || iy <= ny; ) { if ((0.5f + ix) / nx < (0.5f + iy) / ny) { workX += signX; ix++; } else { workY += signY; iy++; } buffer.add(Coord.get(workX, workY)); } return buffer; } /** * Draws a line from (startX, startY) to (endX, endY) using only N/S/E/W movement. * If {@code buffer} is not null, it will be cleared and reused; if it is null, then * a new ObjectList will be allocated. Reusing {@code buffer} across multiple calls * is a good way to reduce GC pressure. Returns an ObjectList of Coord in order. * * @param startX x of starting point * @param startY y of starting point * @param endX x of ending point * @param endY y of ending point * @param buffer an ObjectList of Coord that will be reused and cleared if not null; will be modified * @return ObjectList of Coord, including (startX, startY) and (endX, endY) and all points walked between */ public static ObjectList<Coord> line(int startX, int startY, int endX, int endY, int maxLength, ObjectList<Coord> buffer) { int dx = endX - startX, dy = endY - startY, nx = Math.abs(dx), ny = Math.abs(dy); maxLength = Math.max(0, Math.min(1 + nx + ny, maxLength)); int signX = dx >> 31 | 1, signY = dy >> 31 | 1, workX = startX, workY = startY; if(buffer == null) { buffer = new ObjectList<>(maxLength); } else { buffer.clear(); buffer.ensureCapacity(maxLength); } if(maxLength == 0) return buffer; buffer.add(Coord.get(startX, startY)); for (int ix = 0, iy = 0; (ix <= nx || iy <= ny) && buffer.size() < maxLength; ) { if ((0.5f + ix) / nx < (0.5f + iy) / ny) { workX += signX; ix++; } else { workY += signY; iy++; } buffer.add(Coord.get(workX, workY)); } return buffer; } /** * Checks whether the starting point can see the target point, using the {@code resistanceMap} * to determine whether the line of sight is obstructed, and filling the list of cells along the line of sight into * {@code buffer}. {@code resistanceMap} must not be null; it can be initialized in the same way as FOV's resistance * maps can with {@link FOV#generateResistances(char[][])} or {@link FOV#generateSimpleResistances(char[][])}. * {@code buffer} may be null (in which case a temporary ObjectList is allocated, which can be wasteful), or may be * an existing ObjectList of Coord (which will be cleared if it has any contents). If the starting point can see the * target point, this returns true and buffer will contain all Coord points along the line of sight; otherwise this * returns false and buffer will only contain up to and including the point that blocked the line of sight. * @param start the starting point * @param target the target point * @param resistanceMap a resistance map as produced by {@link FOV#generateResistances(char[][])}; 0 is visible and 1 is blocked * @param buffer an ObjectList of Coord that will be reused and cleared if not null; will be modified * @return true if the starting point can see the target point; false otherwise */ public static boolean reachable(@Nonnull Coord start, @Nonnull Coord target, @Nonnull float[][] resistanceMap, ObjectList<Coord> buffer){ return reachable(start.x, start.y, target.x, target.y, 0x7FFFFFFF, resistanceMap, buffer); } /** * Checks whether the starting point can see the target point, using the {@code resistanceMap} * to determine whether the line of sight is obstructed, and filling the list of cells along the line of sight into * {@code buffer}. {@code resistanceMap} must not be null; it can be initialized in the same way as FOV's resistance * maps can with {@link FOV#generateResistances(char[][])} or {@link FOV#generateSimpleResistances(char[][])}. * {@code buffer} may be null (in which case a temporary ObjectList is allocated, which can be wasteful), or may be * an existing ObjectList of Coord (which will be cleared if it has any contents). If the starting point can see the * target point, this returns true and buffer will contain all Coord points along the line of sight; otherwise this * returns false and buffer will only contain up to and including the point that blocked the line of sight. * @param startX the x-coordinate of the starting point * @param startY the y-coordinate of the starting point * @param targetX the x-coordinate of the target point * @param targetY the y-coordinate of the target point * @param resistanceMap a resistance map as produced by {@link FOV#generateResistances(char[][])}; 0 is visible and 1 is blocked * @param buffer an ObjectList of Coord that will be reused and cleared if not null; will be modified * @return true if the starting point can see the target point; false otherwise */ public static boolean reachable(int startX, int startY, int targetX, int targetY, @Nonnull float[][] resistanceMap, ObjectList<Coord> buffer){ return reachable(startX, startY, targetX, targetY, 0x7FFFFFFF, resistanceMap, buffer); } /** * Checks whether the starting point can see the target point, using the {@code maxLength} and {@code resistanceMap} * to determine whether the line of sight is obstructed, and filling the list of cells along the line of sight into * {@code buffer}. {@code resistanceMap} must not be null; it can be initialized in the same way as FOV's resistance * maps can with {@link FOV#generateResistances(char[][])} or {@link FOV#generateSimpleResistances(char[][])}. * {@code buffer} may be null (in which case a temporary ObjectList is allocated, which can be wasteful), or may be * an existing ObjectList of Coord (which will be cleared if it has any contents). If the starting point can see the * target point, this returns true and buffer will contain all Coord points along the line of sight; otherwise this * returns false and buffer will only contain up to and including the point that blocked the line of sight. * @param startX the x-coordinate of the starting point * @param startY the y-coordinate of the starting point * @param targetX the x-coordinate of the target point * @param targetY the y-coordinate of the target point * @param maxLength the maximum permitted length of a line of sight * @param resistanceMap a resistance map as produced by {@link FOV#generateResistances(char[][])}; 0 is visible and 1 is blocked * @param buffer an ObjectList of Coord that will be reused and cleared if not null; will be modified * @return true if the starting point can see the target point; false otherwise */ public static boolean reachable(int startX, int startY, int targetX, int targetY, int maxLength, @Nonnull float[][] resistanceMap, ObjectList<Coord> buffer) { int dx = targetX - startX, dy = targetY - startY, nx = Math.abs(dx), ny = Math.abs(dy); int signX = dx >> 31 | 1, signY = dy >> 31 | 1, x = startX, y = startY; int dist = nx + ny; if(buffer == null) { buffer = new ObjectList<>(dist + 1); } else { buffer.clear(); } if(maxLength <= 0) return false; if(startX == targetX && startY == targetY) { buffer.add(Coord.get(startX, startY)); return true; // already at the point; we can see our own feet just fine! } float decay = 1f / dist; float currentForce = 1f; for (int ix = 0, iy = 0; (ix <= nx || iy <= ny) && buffer.size() < maxLength; ) { buffer.add(Coord.get(x, y)); if (x == targetX && y == targetY) { return true; } if (x != startX || y != startY) { //don't discount the start location even if on resistant cell currentForce -= resistanceMap[x][y]; } currentForce -= decay; if (currentForce <= -0.001f) { return false; //too much resistance } if ((0.5f + ix) / nx < (0.5f + iy) / ny) { x += signX; ix++; } else { y += signY; iy++; } } return false;//never got to the target point } /** * Checks whether the starting point can see the target point, using the {@code resistanceMap} to determine whether * the line of sight is obstructed, without storing the line of points along the way. {@code resistanceMap} must not * be null; it can be initialized in the same way as FOV's resistance maps can with * {@link FOV#generateResistances(char[][])} or {@link FOV#generateSimpleResistances(char[][])}. If the starting * point can see the target point, this returns true; otherwise this returns false. * @param start the starting point * @param target the target point * @param resistanceMap a resistance map as produced by {@link FOV#generateResistances(char[][])}; 0 is visible and 1 is blocked * @return true if the starting point can see the target point; false otherwise */ public static boolean reachable(@Nonnull Coord start, @Nonnull Coord target, @Nonnull float[][] resistanceMap){ return reachable(start.x, start.y, target.x, target.y, 0x7FFFFFFF, resistanceMap); } /** * Checks whether the starting point can see the target point, using the {@code resistanceMap} to determine whether * the line of sight is obstructed, without storing the line of points along the way. {@code resistanceMap} must not * be null; it can be initialized in the same way as FOV's resistance maps can with * {@link FOV#generateResistances(char[][])} or {@link FOV#generateSimpleResistances(char[][])}. If the starting * point can see the target point, this returns true; otherwise this returns false. * @param startX the x-coordinate of the starting point * @param startY the y-coordinate of the starting point * @param targetX the x-coordinate of the target point * @param targetY the y-coordinate of the target point * @param resistanceMap a resistance map as produced by {@link FOV#generateResistances(char[][])}; 0 is visible and 1 is blocked * @return true if the starting point can see the target point; false otherwise */ public static boolean reachable(int startX, int startY, int targetX, int targetY, @Nonnull float[][] resistanceMap){ return reachable(startX, startY, targetX, targetY, 0x7FFFFFFF, resistanceMap); } /** * Checks whether the starting point can see the target point, using the {@code maxLength} and {@code resistanceMap} * to determine whether the line of sight is obstructed, without storing the line of points along the way. * {@code resistanceMap} must not be null; it can be initialized in the same way as FOV's resistance maps can with * {@link FOV#generateResistances(char[][])} or {@link FOV#generateSimpleResistances(char[][])}. If the starting * point can see the target point, this returns true; otherwise this returns false. * @param startX the x-coordinate of the starting point * @param startY the y-coordinate of the starting point * @param targetX the x-coordinate of the target point * @param targetY the y-coordinate of the target point * @param maxLength the maximum permitted length of a line of sight * @param resistanceMap a resistance map as produced by {@link FOV#generateResistances(char[][])}; 0 is visible and 1 is blocked * @return true if the starting point can see the target point; false otherwise */ public static boolean reachable(int startX, int startY, int targetX, int targetY, int maxLength, @Nonnull float[][] resistanceMap) { if(maxLength <= 0) return false; int dx = targetX - startX, dy = targetY - startY, nx = Math.abs(dx), ny = Math.abs(dy); int signX = dx >> 31 | 1, signY = dy >> 31 | 1, x = startX, y = startY; int dist = nx + ny, traveled = 0; if(startX == targetX && startY == targetY) { return true; // already at the point; we can see our own feet just fine! } float decay = 1f / dist; float currentForce = 1f; for (int ix = 0, iy = 0; (ix <= nx || iy <= ny) && traveled < maxLength; ) { ++traveled; if (x == targetX && y == targetY) { return true; } if (x != startX || y != startY) { //don't discount the start location even if on resistant cell currentForce -= resistanceMap[x][y]; } currentForce -= decay; if (currentForce <= -0.001f) { return false; //too much resistance } if ((0.5f + ix) / nx < (0.5f + iy) / ny) { x += signX; ix++; } else { y += signY; iy++; } } return false;//never got to the target point } /** * Draws a line from start to end using only N/S/E/W movement. * Consider reusing an ObjectList instead of allocating a new one each time, if * possible; this method allocates an ObjectList per call, but * {@link #line(int, int, int, int, ObjectList)} does not. * Returns an ObjectList of Coord in order. * * @param start starting point * @param end ending point * @return ObjectList of Coord, including start and end and all points walked between */ public static ObjectList<Coord> line(Coord start, Coord end) { return line(start.x, start.y, end.x, end.y); } /** * Draws a line from (startX, startY) to (endX, endY) using only N/S/E/W movement. * Allocates a new exactly-sized array of Coord, in order, and returns it. * * @param startX x of starting point * @param startY y of starting point * @param endX x of ending point * @param endY y of ending point * @return array of Coord, including (startX, startY) and (endX, endY) and all points walked between */ public static Coord[] lineArray(int startX, int startY, int endX, int endY) { int dx = endX - startX, dy = endY - startY, nx = Math.abs(dx), ny = Math.abs(dy); int signX = dx >> 31 | 1, signY = dy >> 31 | 1, workX = startX, workY = startY; Coord[] drawn = new Coord[nx + ny + 1]; drawn[0] = Coord.get(startX, startY); for (int i = 1, ix = 0, iy = 0; ix <= nx || iy <= ny; i++) { if ((0.5f + ix) / nx < (0.5f + iy) / ny) { workX += signX; ix++; } else { workY += signY; iy++; } drawn[i] = Coord.get(workX, workY); } return drawn; } /** * Draws a line from (startX, startY) to (endX, endY) using only N/S/E/W movement. * Allocates a new exactly-sized array of Coord, in order, and returns it. * * @param startX x of starting point * @param startY y of starting point * @param endX x of ending point * @param endY y of ending point * @return array of Coord, including (startX, startY) and (endX, endY) and all points walked between */ public static Coord[] lineArray(int startX, int startY, int endX, int endY, int maxLength) { int dx = endX - startX, dy = endY - startY, nx = Math.abs(dx), ny = Math.abs(dy); maxLength = Math.max(0, Math.min(nx + ny + 1, maxLength)); int signX = dx >> 31 | 1, signY = dy >> 31 | 1, workX = startX, workY = startY; Coord[] drawn = new Coord[maxLength]; if(maxLength == 0) return drawn; drawn[0] = Coord.get(startX, startY); for (int i = 1, ix = 0, iy = 0; ix <= nx || iy <= ny; i++) { if ((0.5f + ix) / nx < (0.5f + iy) / ny) { workX += signX; ix++; } else { workY += signY; iy++; } drawn[i] = Coord.get(workX, workY); } return drawn; } /** * Draws a line from start to end using only N/S/E/W movement. * Allocates a new exactly-sized array of Coord, in order, and returns it. * * @param start starting point * @param end ending point * @return array of Coord, including start and end and all points walked between */ public static Coord[] lineArray(Coord start, Coord end) { return lineArray(start.x, start.y, end.x, end.y); } /** * Given an array of Coord as produced by {@link #lineArray(Coord, Coord)} or * {@link #lineArray(int, int, int, int)}, this gets a char array of box-drawing characters that connect when drawn * at the corresponding Coord positions in the given line. This can be useful for drawing highlight lines or showing * what path something will take, as long as it only uses 4-way orthogonal connections between Coords. Any * connections that require a diagonal will not be handled by this method (returning a straight line without much * accuracy), and any Coords that aren't adjacent will cause an {@link IllegalStateException} if this has to draw a * line between them. If this method is called on the result of this class' lineArray() method, then it should * always return a valid result; if it is called on a path made with some other method, then it shouldn't throw an * exception but may produce a low-quality (visually disconnected) line. * * @param line a Coord array where each Coord is orthogonally adjacent to its neighbor(s) in the array; usually * produced via {@link #lineArray(Coord, Coord)} or {@link #lineArray(int, int, int, int)} * @return a char array of box-drawing chars that will connect when drawn at the same points as in line */ public static char[] lineChars(Coord[] line) { // ─│┌┐└┘├┤┬┴┼ if(line == null) return null; int len = line.length; if(len == 0) return new char[0]; if(len == 1) return new char[]{'─'}; char[] cs = new char[len]; cs[0] = line[0].x == line[1].x ? '│' : '─'; cs[len - 1] = line[len - 1].x == line[len - 2].x ? '│' : '─'; Coord before, current, next; for (int i = 1; i < len - 1; i++) { before = line[i-1]; current = line[i]; next = line[i+1]; switch (before.toGoTo(current)) { case RIGHT: switch (current.toGoTo(next)) { case DOWN: cs[i] = '┘'; break; case UP: cs[i] = '┐'; break; default: cs[i] = '─'; break; } break; case LEFT: switch (current.toGoTo(next)) { case DOWN: cs[i] = '└'; break; case UP: cs[i] = '┌'; break; default: cs[i] = '─'; break; } break; case UP: switch (current.toGoTo(next)) { case LEFT: cs[i] = '┐'; break; case RIGHT: cs[i] = '┌'; break; default: cs[i] = '│'; break; } break; default: switch (current.toGoTo(next)) { case LEFT: cs[i] = '┘'; break; case RIGHT: cs[i] = '└'; break; default: cs[i] = '│'; break; } } } return cs; } /** * Given a List of Coord as produced by {@link #line(Coord, Coord)} or {@link #line(int, int, int, int)}, this * gets a char array of box-drawing characters that connect when drawn at the corresponding Coord positions in the * given line. This can be useful for drawing highlight lines or showing what path something will take, as long as * it only uses 4-way orthogonal connections between Coords. Any connections that require a diagonal will not be * handled by this method (returning a straight line without much accuracy), and any Coords that aren't adjacent * will cause an {@link IllegalStateException} if this has to draw a line between them. If this method is called on * the result of this class' line() method, then it should always return a valid result; if it is called on a path * made with some other method, then it shouldn't throw an exception but may produce a low-quality (visually * disconnected) line. * * @param line a List of Coord where each Coord is orthogonally adjacent to its neighbor(s) in the List; usually * produced via {@link #line(Coord, Coord)} or {@link #line(int, int, int, int)} * @return a char array of box-drawing chars that will connect when drawn at the same points as in line */ public static char[] lineChars(List<Coord> line) { // ─│┌┐└┘├┤┬┴┼ if(line == null) return null; int len = line.size(); if(len == 0) return new char[0]; if(len == 1) return new char[]{'─'}; char[] cs = new char[len]; cs[0] = line.get(0).x == line.get(1).x ? '│' : '─'; cs[len - 1] = line.get(len - 1).x == line.get(len - 2).x ? '│' : '─'; Coord before, current, next; for (int i = 1; i < len - 1; i++) { before = line.get(i-1); current = line.get(i); next = line.get(i+1); switch (before.toGoTo(current)) { case RIGHT: switch (current.toGoTo(next)) { case DOWN: cs[i] = '┘'; break; case UP: cs[i] = '┐'; break; default: cs[i] = '─'; break; } break; case LEFT: switch (current.toGoTo(next)) { case DOWN: cs[i] = '└'; break; case UP: cs[i] = '┌'; break; default: cs[i] = '─'; break; } break; case UP: switch (current.toGoTo(next)) { case LEFT: cs[i] = '┐'; break; case RIGHT: cs[i] = '┌'; break; default: cs[i] = '│'; break; } break; default: switch (current.toGoTo(next)) { case LEFT: cs[i] = '┘'; break; case RIGHT: cs[i] = '└'; break; default: cs[i] = '│'; break; } } } return cs; } /** * Gets the last line drawn using the internal buffer this carries, rather than an explicitly-specified buffer. * * @return an ObjectList of Coord that contains the last line drawn with this BresenhamLine's internal buffer */ @Override public ObjectList<Coord> getLastLine() { return lastLine; } /** * Generates a 2D Bresenham line between two points. Reuses {@link #lastLine} * and returns it as the buffer; later calls to drawLine() without a buffer * will probably clear lastLine (which is the same ObjectList this returns) * as they are run. * @param a the starting point * @param b the ending point * @return The path between {@code a} and {@code b}. */ @Override public ObjectList<Coord> drawLine(Coord a, Coord b) { lastLine.clear(); return line(a.x, a.y, b.x, b.y, lastLine); } /** * Generates a 2D Bresenham line between two points. Reuses {@link #lastLine} * and returns it as the buffer; later calls to drawLine() without a buffer * will probably clear lastLine (which is the same ObjectList this returns) * as they are run. * <br> * Uses ordinary Coord values for points, and these can be pooled * if they are within what the current pool allows (it starts, * by default, pooling Coords with x and y between -3 and 255, * inclusive). If the Coords are pool-able, it can significantly * reduce the work the garbage collector needs to do, especially * on Android. * * @param startX the x coordinate of the starting point * @param startY the y coordinate of the starting point * @param targetX the x coordinate of the target point * @param targetY the y coordinate of the target point * @return a ObjectList of Coord points along the line */ @Override public ObjectList<Coord> drawLine(int startX, int startY, int targetX, int targetY) { lastLine.clear(); // largest positive int for maxLength; a ObjectList cannot actually be given that many elements on the JVM return line(startX, startY, targetX, targetY, 0x7fffffff, lastLine); } /** * Generates a 2D Bresenham line between two points, stopping early if * the number of Coords returned reaches maxLength (measured using * Chebyshev distance, where diagonally adjacent cells are considered * exactly as distant as orthogonally-adjacent cells). Reuses {@link #lastLine} * and returns it as the buffer; later calls to drawLine() without a buffer * will probably clear lastLine (which is the same ObjectList this returns) * as they are run. * <br> * Uses ordinary Coord values for points, and these can be pooled * if they are within what the current pool allows (it starts, * by default, pooling Coords with x and y between -3 and 255, * inclusive). If the Coords are pool-able, it can significantly * reduce the work the garbage collector needs to do, especially * on Android. * * @param startX the x coordinate of the starting point * @param startY the y coordinate of the starting point * @param targetX the x coordinate of the target point * @param targetY the y coordinate of the target point * @return a ObjectList of Coord points along the line */ @Override public ObjectList<Coord> drawLine(int startX, int startY, int targetX, int targetY, int maxLength) { lastLine.clear(); return line(startX, startY, targetX, targetY, maxLength, lastLine); } /** * Generates a 2D Bresenham line between two points. If you want to save * some memory, you can reuse an ObjectList of Coord, {@code buffer}, * which will be cleared and filled with the resulting line of Coord. * If {@code buffer} is null, this will create a new ObjectList of Coord * and return that. * <br> * Uses ordinary Coord values for points, and these can be pooled * if they are within what the current pool allows (it starts, * by default, pooling Coords with x and y between -3 and 255, * inclusive). If the Coords are pool-able, it can significantly * reduce the work the garbage collector needs to do, especially * on Android. * * @param startX the x coordinate of the starting point * @param startY the y coordinate of the starting point * @param targetX the x coordinate of the target point * @param targetY the y coordinate of the target point * @param buffer an ObjectList of Coord that will be reused and cleared if not null; will be modified * @return an ObjectList of Coord points along the line */ @Override public ObjectList<Coord> drawLine(int startX, int startY, int targetX, int targetY, ObjectList<Coord> buffer) { return line(startX, startY, targetX, targetY, buffer); } /** * Checks whether the starting point can see the target point, using the {@code resistanceMap} * to determine whether the line of sight is obstructed, and filling the list of cells along the line of sight into * {@code buffer}. {@code resistanceMap} must not be null; it can be initialized in the same way as FOV's resistance * maps can with {@link FOV#generateResistances(char[][])} or {@link FOV#generateSimpleResistances(char[][])}. * {@code buffer} may be null (in which case a temporary ObjectList is allocated, which can be wasteful), or may be * an existing ObjectList of Coord (which will be cleared if it has any contents). If the starting point can see the * target point, this returns true and buffer will contain all Coord points along the line of sight; otherwise this * returns false and buffer will only contain up to and including the point that blocked the line of sight. * @param start the starting point * @param target the target point * @param resistanceMap a resistance map as produced by {@link FOV#generateResistances(char[][])}; 0 is visible and 1 is blocked * @param buffer an ObjectList of Coord that will be reused and cleared if not null; will be modified * @return true if the starting point can see the target point; false otherwise */ @Override public boolean isReachable(@Nonnull Coord start, @Nonnull Coord target, @Nonnull float[][] resistanceMap, ObjectList<Coord> buffer){ return reachable(start.x, start.y, target.x, target.y, resistanceMap, buffer); } /** * Generates a 2D Bresenham line between two points, stopping early if * the number of Coords returned reaches maxLength (measured using * Chebyshev distance, where diagonally adjacent cells are considered * exactly as distant as orthogonally-adjacent cells). If you want to save * some memory, you can reuse an ObjectList of Coord, {@code buffer}, * which will be cleared and filled with the resulting line of Coord. * If {@code buffer} is null, this will create a new ObjectList of Coord * and return that. * <br> * Uses ordinary Coord values for points, and these can be pooled * if they are within what the current pool allows (it starts, * by default, pooling Coords with x and y between -3 and 255, * inclusive). If the Coords are pool-able, it can significantly * reduce the work the garbage collector needs to do, especially * on Android. * * @param startX the x coordinate of the starting point * @param startY the y coordinate of the starting point * @param targetX the x coordinate of the target point * @param targetY the y coordinate of the target point * @param maxLength the largest count of Coord points this can return; will stop early if reached * @param buffer an ObjectList of Coord that will be reused and cleared if not null; will be modified * @return an ObjectList of Coord points along the line */ @Override public ObjectList<Coord> drawLine(int startX, int startY, int targetX, int targetY, int maxLength, ObjectList<Coord> buffer) { return line(startX, startY, targetX, targetY, maxLength, buffer); } /** * Checks whether the starting point can see the target point, using the {@code resistanceMap} * to determine whether the line of sight is obstructed, and filling the list of cells along the line of sight into * {@code buffer}. {@code resistanceMap} must not be null; it can be initialized in the same way as FOV's resistance * maps can with {@link FOV#generateResistances(char[][])} or {@link FOV#generateSimpleResistances(char[][])}. * {@code buffer} may be null (in which case a temporary ObjectList is allocated, which can be wasteful), or may be * an existing ObjectList of Coord (which will be cleared if it has any contents). If the starting point can see the * target point, this returns true and buffer will contain all Coord points along the line of sight; otherwise this * returns false and buffer will only contain up to and including the point that blocked the line of sight. * @param startX the x-coordinate of the starting point * @param startY the y-coordinate of the starting point * @param targetX the x-coordinate of the target point * @param targetY the y-coordinate of the target point * @param resistanceMap a resistance map as produced by {@link FOV#generateResistances(char[][])}; 0 is visible and 1 is blocked * @param buffer an ObjectList of Coord that will be reused and cleared if not null; will be modified * @return true if the starting point can see the target point; false otherwise */ @Override public boolean isReachable(int startX, int startY, int targetX, int targetY, @Nonnull float[][] resistanceMap, ObjectList<Coord> buffer){ return reachable(startX, startY, targetX, targetY, resistanceMap, buffer); } /** * Checks whether the starting point can see the target point, using the {@code maxLength} and {@code resistanceMap} * to determine whether the line of sight is obstructed, and filling the list of cells along the line of sight into * {@code buffer}. The {@code maxLength} is measured using Chebyshev distance, where diagonally adjacent cells are * considered exactly as distant as orthogonally-adjacent cells. * {@code resistanceMap} must not be null; it can be initialized in the same way as FOV's resistance * maps can with {@link FOV#generateResistances(char[][])} or {@link FOV#generateSimpleResistances(char[][])}. * {@code buffer} may be null (in which case a temporary ObjectList is allocated, which can be wasteful), or may be * an existing ObjectList of Coord (which will be cleared if it has any contents). If the starting point can see the * target point, this returns true and buffer will contain all Coord points along the line of sight; otherwise this * returns false and buffer will only contain up to and including the point that blocked the line of sight. * @param startX the x-coordinate of the starting point * @param startY the y-coordinate of the starting point * @param targetX the x-coordinate of the target point * @param targetY the y-coordinate of the target point * @param maxLength the maximum permitted length of a line of sight * @param resistanceMap a resistance map as produced by {@link FOV#generateResistances(char[][])}; 0 is visible and 1 is blocked * @param buffer an ObjectList of Coord that will be reused and cleared if not null; will be modified * @return true if the starting point can see the target point; false otherwise */ @Override public boolean isReachable(int startX, int startY, int targetX, int targetY, int maxLength, @Nonnull float[][] resistanceMap, ObjectList<Coord> buffer) { return reachable(startX, startY, targetX, targetY, maxLength, resistanceMap, buffer); } /** * Checks whether the starting point can see the target point, using the {@code resistanceMap} to determine whether * the line of sight is obstructed, without storing the line of points along the way. {@code resistanceMap} must not * be null; it can be initialized in the same way as FOV's resistance maps can with * {@link FOV#generateResistances(char[][])} or {@link FOV#generateSimpleResistances(char[][])}. If the starting * point can see the target point, this returns true; otherwise this returns false. * @param start the starting point * @param target the target point * @param resistanceMap a resistance map as produced by {@link FOV#generateResistances(char[][])}; 0 is visible and 1 is blocked * @return true if the starting point can see the target point; false otherwise */ @Override public boolean isReachable(@Nonnull Coord start, @Nonnull Coord target, @Nonnull float[][] resistanceMap){ return reachable(start.x, start.y, target.x, target.y, resistanceMap); } /** * Checks whether the starting point can see the target point, using the {@code resistanceMap} * to determine whether the line of sight is obstructed, without storing the line of points along the way. * {@code resistanceMap} must not be null; it can be initialized in the same way as FOV's resistance maps can with * {@link FOV#generateResistances(char[][])} or {@link FOV#generateSimpleResistances(char[][])}. If the starting * point can see the target point, this returns true; otherwise this returns false. * @param startX the x-coordinate of the starting point * @param startY the y-coordinate of the starting point * @param targetX the x-coordinate of the target point * @param targetY the y-coordinate of the target point * @param resistanceMap a resistance map as produced by {@link FOV#generateResistances(char[][])}; 0 is visible and 1 is blocked * @return true if the starting point can see the target point; false otherwise */ @Override public boolean isReachable(int startX, int startY, int targetX, int targetY, @Nonnull float[][] resistanceMap){ return reachable(startX, startY, targetX, targetY, resistanceMap); } /** * Checks whether the starting point can see the target point, using the {@code maxLength} and {@code resistanceMap} * to determine whether the line of sight is obstructed, without storing the line of points along the way. * {@code resistanceMap} must not be null; it can be initialized in the same way as FOV's resistance maps can with * {@link FOV#generateResistances(char[][])} or {@link FOV#generateSimpleResistances(char[][])}. If the starting * point can see the target point, this returns true; otherwise this returns false. * @param startX the x-coordinate of the starting point * @param startY the y-coordinate of the starting point * @param targetX the x-coordinate of the target point * @param targetY the y-coordinate of the target point * @param maxLength the maximum permitted length of a line of sight * @param resistanceMap a resistance map as produced by {@link FOV#generateResistances(char[][])}; 0 is visible and 1 is blocked * @return true if the starting point can see the target point; false otherwise */ @Override public boolean isReachable(int startX, int startY, int targetX, int targetY, int maxLength, @Nonnull float[][] resistanceMap){ return reachable(startX, startY, targetX, targetY, maxLength, resistanceMap); } /** * Generates a 2D Bresenham line between two points. * This allocates a new array with each call, sized to fit the * line exactly. It does not change {@link #lastLine}. * * @param a the starting point * @param b the ending point * @return The path between {@code a} and {@code b}. */ @Override public Coord[] drawLineArray(Coord a, Coord b) { return lineArray(a.x, a.y, b.x, b.y); } /** * Generates a 2D Bresenham line between two points. Returns an array * of Coord instead of a ObjectList. * This allocates a new array with each call, sized to fit the * line exactly. * <br> * Uses ordinary Coord values for points, and these can be pooled * if they are within what the current pool allows (it starts, * by default, pooling Coords with x and y between -3 and 255, * inclusive). If the Coords are pool-able, it can significantly * reduce the work the garbage collector needs to do, especially * on Android. * * @param startX the x coordinate of the starting point * @param startY the y coordinate of the starting point * @param targetX the x coordinate of the target point * @param targetY the y coordinate of the target point * @return an array of Coord points along the line */ @Override public Coord[] drawLineArray(int startX, int startY, int targetX, int targetY) { // largest positive int for maxLength; it is extremely unlikely that this could be reached return lineArray(startX, startY, targetX, targetY, 0x7fffffff); } /** * Generates a 2D Bresenham line between two points, stopping early if * the number of Coords returned reaches maxLength.. Returns an array * of Coord instead of an ObjectList. * This allocates a new array with each call, sized to fit the * line exactly. * <br> * Uses ordinary Coord values for points, and these can be pooled * if they are within what the current pool allows (it starts, * by default, pooling Coords with x and y between -3 and 255, * inclusive). If the Coords are pool-able, it can significantly * reduce the work the garbage collector needs to do, especially * on Android. * * @param startX the x coordinate of the starting point * @param startY the y coordinate of the starting point * @param targetX the x coordinate of the target point * @param targetY the y coordinate of the target point * @param maxLength the largest count of Coord points this can return; will stop early if reached * @return an array of Coord points along the line */ @Override public Coord[] drawLineArray(int startX, int startY, int targetX, int targetY, int maxLength) { return lineArray(startX, startY, targetX, targetY, maxLength); } }
java
use crate::rc_vec; use core::mem; #[test] pub fn downgrade_upgrade() { let v1 = rc_vec![1, 2, 3, 4]; let w = v1.downgrade(); let v2 = w.upgrade().unwrap(); assert_eq!(&*v1, [1, 2, 3, 4]); assert_eq!(&*v2, [1, 2, 3, 4]); } #[test] pub fn upgrade_should_fail() { let v = rc_vec![1, 2, 3, 4]; let w = v.downgrade(); mem::drop(v); assert_eq!(w.upgrade(), None); } #[test] pub fn upgrade_after_clone() { let v1 = rc_vec![1, 2, 3, 4]; let w = v1.downgrade(); let v2 = v1.clone(); mem::drop(v1); let v3 = w.upgrade().unwrap(); assert_eq!(&*v2, [1, 2, 3, 4]); assert_eq!(&*v3, [1, 2, 3, 4]); } #[test] pub fn upgrade_after_clone_dropped() { let v1 = rc_vec![1, 2, 3, 4]; let w = v1.downgrade(); let v2 = v1.clone(); mem::drop(v2); let v3 = w.upgrade().unwrap(); assert_eq!(&*v1, [1, 2, 3, 4]); assert_eq!(&*v3, [1, 2, 3, 4]); } #[test] pub fn upgrade_after_orig_and_clone_dropped_should_fail() { let v1 = rc_vec![1, 2, 3, 4]; let w = v1.downgrade(); let v2 = v1.clone(); mem::drop(v1); mem::drop(v2); assert_eq!(w.upgrade(), None); }
rust
Ho Ho Ho! With Christmas just around the corner, take a look back at the best holiday-themed moments from WWE History. Toys for tots? More like Stunners for Santa! Ah, the holiday season. Whether you celebrate Hanukkah, Christmas, the Yuletide, Kwanzaa, or nothing at all, you can still appreciate the trappings of the season. From delicious baked goods to ugly sweaters, from the scent of evergreen to freshly fallen snow, there's a lot to love about the holidays. But while some of us are gathering together with friends and family, the WWE Superstars are still doing what they do best; causing mayhem and beating the snot out of each other. A promotion like the WWE, which has been around for decades, of course has enjoyed a number of holiday themed moments over the years. Ever since the Monday Night Wars, when RAW began airing live every week, it's become more convenient for WWE to have holiday themed antics. Most of the time, these moments are played for laughs. Without further ado, here are the ten best Christmas and holiday moments from WWE history. A certain Texas Rattlesnake pops up a few times on our list, so keep your eyes peeled lest you eat a Stone Cold Stunner! Degeneration X has a storied history in WWE. They began as a heel team, with the villainous Shawn Michaels and Triple H trying their best to get fired so they could join their 'friends down south' (a thinly veiled reference to Kevin Nash and Scott Hall, who had joined WCW a year prior). Eventually, the faction would transition to babyface, and the addition of the New Age Outlaws brought the stable up to full strength. Years later, DX would pop up again, but this time only featuring Triple H and HBK as they tormented Vince McMahon with their sophomoric antics. One hilarious moment happened when DX filmed their own Christmas themed merch hawking bit on RAW. Michaels complained about being cold while watching a WWE DVD, and Triple H offered him a blanket. HBK then complained that either his arms were cold or that he couldn't reach his snacks. So the quick-thinking Triple H provided his best friend with a DX Snuggie -- blanket with arm holes. This was at a time when DX had a separate segment each week on RAW to showcase their hilarious yet edgy skits. Add Hornswoogle to the mix and you will surely have some goofy subplots as well. Hornswoggle is either one of your favorite comedic characters from WWE history or someone who annoys you to tears. There's really no middle ground on this man. The performer, who is has a genetic condition resulting in diminutive height, first came to prominence when he would accompany Fit Finlay to the ring. Well, accompany isn't quite accurate. The truth is that Hornswoggle hid under the ring and emerged to distract and attack Finlay's opponents when they weren't looking. Eventually Hornswoggle would be revealed to be the 'son' of Vince McMahon and even join DX, but through it all he never spoke. Until one fine day in the Christmas season of 2011. Horsnwoggle won a battle royal which entitled him to a wish from Santa Claus (Mick Foley in the suit). Hornswoggle's wish? To be able to speak. Foley granted his request, and then Hornswoggle wouldn't shut up. This might look like a page straight out of WCW's book. But the WWE too are known for their bizarre storylines. In the history of WWE, the Invasion angle is considered by many to be one of the biggest disappointments of all time. Post Monday Night Wars, WCW fans had hoped to see their favorite superstars arrive on WWE television. However, when WWE purchased their flagging rival, they didn't offer nearly enough money for some of WCW's biggest stars to jump to WWE. This led to many of the more famous and popular WCW stars, such as Sting and Lex Luger, not to appear on either RAW or SmackDown during this very crucial storyline. Despite the rather lackluster response fans had to the angle, there were some funny moments. One of them was when Vince McMahon (leader of Team WWF) and Stone Cold (leader of Team WCW/ECW) had competing Christmas parties for their respective teams. Stone Cold led his team in a Christmas Carol sing along. Some pro wrestlers, like The Rock and Chris Jericho, are actually accomplished singers. Stone Cold Steve Austin, on the other hand, is not. The results were predictably hilarious, and proof that Stone Cold wasn't a one trick pony. WWE has endured a lot of criticism for throwing together two singles stars with little in common into a tag team. This doesn't work out very often, but sometimes you find yourself with a gem of a team. The Miz and John Morrison struggled to be recognized as singles wrestlers, but when WWE put them together as a team, it was magic. It may be one of the reasons WWE keeps using this tactic. One of the times the thrown-together team worked exceptionally well was when Big Show and Chris Jericho became a pair. The fans quickly dubbed them Jeri-Show on social media, and the duo actually adopted that as their official team name. They won the WWE Tag Titles and seemed inseparable. When Chris Jericho was drafted to RAW, however, their team was forced to disband. That is, until Big Show asked Santa Claus to grant his Christmas wish; to be reunited with his best friend Jericho. Santa quickly agreed, but then Hornswoggle emerged from under the ring to reveal it was none other than Jericho under the white beard. Sadly, the reunion quickly soured for the best friends. The moment also officially recognizes Hornswoggle as the mascot for DX and his induction into the notorious faction. There's no doubt that Vincent Kennedy McMahon, Jr. , is one of the most accomplished heels in all of wrestling. There are few other men who can bring a chorus of resounding boos just by walking out to the ring like he can. During the Attitude Era, Mr. McMahon was the WWE equivalent of Darth Vader. To that end, when WWE presented its first annual Tribute to the Troops in Iraq, Vince McMahon appeared in the ring and started talking his usual trash. That's when Santa Claus arrived to try to spread some Christmas cheer. McMahon attacked poor Santa, but he would regret that decision later when Stone Cold revealed himself to be the man behind the beard. McMahon would soon eat a Stunner, much to the delight of the gathered troops. Stone Cold has never failed to utilize an opportunity to put his boss in his rightful place. When John Cena first debuted, he was a 'white meat' babyface who stood up to a bullying Kurt Angle. The only problem was fans didn't care for him. So Cena developed the Doctor of Thuganomics character, an ostensible heel who wound up being so popular he was turned babyface. Eventually Cena would leave the raps and profanity behind and turn his ball cap forwards, becoming the 'heroic' John Cena. The parallels between Cena and a super hero are myriad and layered. He fights for truth and justice, and always sticks up for what is right. This was on full display on an episode of RAW in 2008 when Santino Marella and Beth Phoenix came out to the ring and promised to tell the children the 'truth about Santa Claus. ' But John Cena came out to save the day, challenging Santino and Beth to a mixed tag match. Cena would partner with Trish Stratus and they would prevent Santino from spilling the beans about Santa Claus' true identity. #4 Jillian Hall sings (sort of) "I'll Be Home For Christmas" Jillian Hall is one of the more underrated in-ring performers in WWE history. She had been trained by Fit Finlay and Lance Storm, and was one of the more athletic and powerful women performers during the Divas era. Unfortunately, she was a female Superstar in WWE just a few years too early. The Women's Evolution was a long way off, and Hall struggled to find a place on the roster in spite of her obvious talents. For a time, her biggest moment was when The Boogeyman bit a 'tumor' off of her face and ate it. Then Jillian Hall found a gimmick that really worked for her; a wannabe pop singer with a terrible, awful voice. In an ironic twist, her album of cover songs was actually a hit, gaining millions of downloads. During the period when she used the bad singing gimmick, she performed a Christmas carol on RAW, to the joy of absolutely no one. It was a cringe-worthy episode to say the least. For our number three moment on the best WWE Christmas moments countdown, we travel all the way back to 1997. It was the height of the Attitude Era, and Stone Cold Steve Austin's popularity had begun to transcend pro wrestling. The Texas Rattlesnake appeared on the cover of TV Guide Magazine (a staple of most households at the time) and had guest-starring roles on such shows as Nash Bridges. On the RAW before Christmas that year, Santa Claus came out to the ring, ostensibly to spread Christmas cheer. However, this Santa was a real villain, mocking one young fan at ringside relentlessly. This didn't sit well with Stone Cold Steve Austin. After verbally berating the fake Santa, he then delivered a brutal seated Stunner that cemented him as a true hero in the hearts of fans young and old. Austin was as unpredictable as they came and even Santa had to learn this the hard way. The Twelve Days of Christmas is one of the oldest and most often recited Christmas Carols in the western world. The song dates back to long ago, but that didn't stop the 'Most Electrifying Man in Sports Entertainment", The Rock, from adding his own spin to the holiday classic. While the original song details such things as 'seven lords a leaping' and 'a partridge in a pear tree', Rock's updated lyrics were definitely WWE centric. He was going to be taking on former WWE star Test that night: On the night Test faced the Great One, this is what he'll see: 12 Sharpshooters stinging, 11 Eyebrows raising, 10 Spines-a-busting, 9 Noggins knocking, 8 Kicks-a-kicking, 7 Punches punching, 6 Suplex smashing, 5 Seconds of the people chanting The Rocks name. 4 Rock Bottoms, and an a**-kicking all over New Orleans. It was a great way to trash talk his opponent while still spreading holiday cheer. Way back at WWE In Your House 5: Season's Beatings, we got our first look at the short lived WWE superstar Xanta Claus. If you'll notice from his color scheme, he's the opposite of Santa Claus in every way. Whereas Santa wears red and white, Xanta wears red and black. His beard is likewise black instead of white, and of course, this being pro wrestling, he hailed from the South Pole rather than the North Pole. The evil twin brother of Santa also had the habit of taking presents rather than giving them. He became a short lived heel and ally of Ted DiBiase during WWE's New Generation era. The gimmick didn't last long, and Xanta Claus was soon confined to the scrap heap of history. It wasn't all bad for Xanta Claus, however. He would go on to great success as Balls Mahoney in ECW and later, WWE. There you have it; Ten of the best WWE Christmas moments. We hope you have a happy holiday, and thanks for reading! Have you checked out Sportskeeda's new feature here? Vote for your favorite match at this location, folks.
english
Sportskeeda Content Manager Riju Dasgupta and Senior Editor Bill Apter scored each match from this year's Hell in a Cell. Let us know your scores as well! Match rating from 0-10, with 10 being the best. Winner: Bianca Belair pinned Asuka after a devastating slam by Lynch. Becky was ready to pin Asuka, but Bianca tossed Becky out of the ring and pinned the stunned Asuka. HANDICAP MATCH: Lashley vs. Omos and MVP: Kevin Owens vs. Ezekiel: APTER SCORE: I've been looking forward to this match since interviewing Ezekiel a few days ago. Winner: Owens pinned Ezekiel after a Stunner. Winners: The Judgement Day as Edge pinned Balor after a knockout spear. APTER SCORE: Non-stop action with many false finishes. Ripley vs. Liv had so many great spots, as did AJ and Edge. Lots of exciting brawling in this match and I give it a 9/10. RIJU SCORE: Great match again. Loved the spots with Rhea Ripley and Finn Balor. Edge picking up a win was overdue. Maybe this faction could face The Bloodline someday? 6. 5/10! NO HOLDS BARRED -- ANYTHING GOES: Winner: Madcap -- locking Corbin's head into the top part of a chair, and slamming the steel steps onto the chair, injuring Corbin's neck -- just like Corbin did to Moss a few weeks ago. Corbin went out on a stretcher. UNITED STATES CHAMPIONSHIP: MAIN EVENT, HELL IN A CELL: APTER SCORE: Rollins came out wearing a Dusty Rhodes polka-dot outfit and mimicking the American Dream. Cody came out with the right side of his chest covered with a large black and blue blotch from his torn pectoral injury. Rollins went after it regularly. Rollins showed no mercy bashing Cody into the cage and using a kendo stick and even the steel steps on the injured area. Rollins whipped Cody repeatedly with a belt with polka dot emblems on it. Rollins set up a table to put Cody through, but Rhodes moved as Rollins came diving off the top ropes, sending Rollins through the table. Cody went under the ring and brought a bull-rope into the ring (something his father Dusty was famous for). Rollins put one end onto his wrist, and with the other end of Cody's wrist we had a Texas Bullrope match inside the Hell in a Cell cage! After a few minutes they took the bullrope off their wrists and Rollins put Cody through a table that was propped in the corner! Rollins brought a sledgehammer onto the battlefield. Cody knocked it out of Rollin's hands. Rollins tried for a Pedigree but Cody turned it around and Pedigreed Rollins! Seth used his patented Sidewalk Slam and pinned but Cody kicked out at the two count. Both then used the Cross-Rhodes for near falls!
english
.main-header-content{width: 290px;margin: 0 auto;padding-top: 120px;} .main-header {height: 656px;background: url(image/bg.png) no-repeat;background-size: 100% 100%;} .main-wrapper{background-color: #fff;} .user-authentication{float: left;padding-left: 20px;margin: 36px 0;} .user-name {margin-bottom: 20px;font-size: 18px;color: #F4F4F4;} .user-info{margin-top: 90px;text-align: center;} .user-info>span:first-child{margin-right: 46px;} .user-info>a{margin-left: 10px;color: #F4F4F4;} .main-bottom {padding: 27px 30px 34px;background: #fff;} .title{margin-bottom: 14px;font-size: 18px;font-weight: bold;} .advantage-wrapper{margin-right: -40px;} .advantage-wrapper>li{float: left;margin-right: 40px;padding: 0 30px;width: 258px;height: 144px;border: 1px solid #d8d7d9;} .advantage-wrapper div{margin: 30px 0 15px;font-size: 18px;text-align: center;} .main-bottom .iconfont {margin-right: 6px;color: #f5a623;} .advantage-wrapper p{font-size: 16px;line-height: 24px;} /*单选按钮的选中的状态*/ .icon-danxuan{ color: #00A2FF; } .icon-danxuan1{ color: #e4e4e4; } /*表格上面的*/ .search-wrapper-l{ float: left; } .linestyle{ border-bottom: 2px solid #00A2FF; padding-bottom: 10px; } .search-wrapper-l .remind{ position: absolute; top: 96px; left: 318px; display: inline-block; padding: 0 3px; height: 15px; line-height: 15px; font-size: 10px; border: 1px solid #00A2FF; border-radius: 50%; -moz-border-radius: 50%; -webkit-border-radius: 50%; -o-border-radius: 50%; color: #00A2FF; } .search-wrapper-l .remind1{ position: absolute; top: 95px; left:87px; display: inline-block; padding: 0 3px; height: 15px; line-height: 15px; font-size: 10px; border: 1px solid #00A2FF; border-radius: 50%; -moz-border-radius: 50%; -webkit-border-radius: 50%; -o-border-radius: 50%; color: #00a2ff; } .line{ padding: 0 35px; } /*下面的表格的状态*/ .main-content .search-contents .cor{ color: #ffae00; } .main-content .search-contents .fontsize{ font-size: 14px; } .main-content .search-contents .search-wrapper{ float: right; overflow: hidden; position: relative; width: 150px; height: 40px; line-height: 40px; display: inline-block; border-radius: 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px; -o-border-radius: 4px; background: #fff; color: #adadad; border: none; } .main-content .search-contents .search-wrapper label i{ display: inline-block; padding-right: 5px; } /*面包屑的样式*/ .menus{ color: #00A2FF; margin-bottom: 58px; } .menus a{ display: inline-block; } .menus i{ display: inline-block; padding: 0px 25px; } /*表格表头的颜色*/ .tabel-default th{ background: #b2e3ff; } .main-content .search-contents>span:nth-child(1){ display: inline-block; height: 40px; line-height: 28px; font-size: 16px; font-family: "微软雅黑"; } /*表头的字的颜色*/ .main-wrapper .tabel-default thead{ color: #fff; } /*表格每列的宽*/ .main-wrapper .tabel-default thead tr th:nth-child(1){ width: 8%; } .main-wrapper .tabel-default thead tr th:nth-child(2){ width: 15%; } .main-wrapper .tabel-default thead tr th:nth-child(3){ width: 15%; } .main-wrapper .tabel-default thead tr th:nth-child(4){ width: 51%; } .main-wrapper .tabel-default thead tr th:nth-child(5){ width: 16%; } .main-wrapper .tabel-default tbody tr td{ height: 45px; line-height: 45px; padding: 14px 0; } .main-wrapper .tabel-default tbody { box-shadow: 0px 2px 5px #ccc; } .main-wrapper .tabel-default tbody tr td:nth-child(4)i{ display: inline-block; color: red; } .main-wrapper .tabel-default tbody .long i{ color:#00A2FF; font-size: 28px; } .main-wrapper .tabel-default tbody .long1 i{ color:#e4e4e4; font-size: 28px; } .main-wrapper .tabel-default thead .llong label i{ color:#e4e4e4; font-size: 28px; } .main-wrapper .tabel-default tbody .table-info{ line-height: 28px; display: inline-block; width: 590px; /*padding: 25px 0;*/ text-align: left; position: relative; left: 15px; } /*表格查看详情的样式*/ .main-wrapper .tabel-default tbody .table-info .ta-info-i{ /* float: right; */ color: #00A2FF; cursor: pointer; position: absolute; bottom: 0; right: 0; line-height: initial; background: #fff; padding: 3px 10px; } .main-wrapper .tabel-default tbody .table-info .ta-info-i i{ font-size: 16px; } .tabel-default .new-tr td{ background: #fff7e5; } .main-content{ padding: 28px 28px; background: #fff; } .tabel-default tr{ border-color: #fff; border-bottom: 1px solid #e4e4e4; } .search-content{ margin-bottom: 10px; } .tabel-default .iconfont{ font-size: 18px; /*color: #00a2ff;*/ } .tabel-default .iconfont .iconfont{ margin-left: 10px; } .tabel-default .icon-duoxuan-weixuan{ color: #fff; background: #fff; } /*消息管理的样式*/ .main-wrapper{ width: 1280px; position: relative; } /*表格左下角的*/ .main-wrapper .leftquar{ display: inline-block; padding: 50px 7px; position: absolute; } .main-wrapper .leftquar span{ cursor: pointer; } /*表格左下角的删除标记为已读*/ .main-wrapper .leftquar .leftquar-info{ margin-left: 35px; } /*消息管理的暂无消息的样式*/ .main-wrapper .main-content .nonemessage{ height: 598px; } .main-wrapper .main-content img{ width: 65%; height: 80%; padding: 72px 180px; } /*消息管理的分页的样式*/ .pagination { margin-top: 50px; text-align: center; background-color: #fff; } /*已读消息的颜色*/ .iccon{ float: left; /*margin-top: 28px;*/ } /*全选之前的颜色*/ .icon-radio_nor{ color: #e4e4e4; } /*全选之后的颜色*/ .icon-danxuanxuan{ color: #00a2ff; } .icon-weidu,.icon-delete{ color: #00a2ff; } /*查看详情的样式*/ .main-wrapper .tabel-default tbody tr td .unfold{ overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; } table tbody tr:hover { background: none; }
css
<reponame>lchirione/MovTrack-App<filename>app/build/intermediates/compatible_screen_manifest/googleRelease/output-metadata.json { "version": 3, "artifactType": { "type": "COMPATIBLE_SCREEN_MANIFEST", "kind": "Directory" }, "applicationId": "org.traccar.movtrack", "variantName": "googleRelease", "elements": [] }
json
<reponame>Ryebread4/Rustionary {"word":"cracowes","definition":"Long-toed boots or shoes formerly worn in many parts of Europe; -- so called from Cracow, in Poland, where they were first worn in the fourteenth century. Fairholt."}
json
{ "source_article_link": "https://timesofindia.indiatimes.com/india/gau-rakshak-among-3-held-in-maha-for-plotting-bomb-blasts/articleshow/65360681.cms?&utm_source=Articleshow&utm_medium=Organic&utm_campaign=Related_Stories", "title": "Gau rakshak among 3 held in Maha for plotting bomb blasts", "date_published": "2018-08-11T03:33:33+05:30", "source_type": "news_article", "source_name": "timesofindia.indiatimes.com", "image_link": [], "article_body": "MUMBAI: Barely five days before Independence Day, ATS arrested three persons, including two from Nalasopara, on Friday for plotting bomb blasts to disturb communal harmony and having links with terrorist organisations. Twenty bombs and bombmaking materials were found in a bungalow in the northern suburb. <NAME>, 40, a gau rakshak with the <NAME>, and his associate <NAME>, 25, were detained in Nalasopara late on Thursday. <NAME>, 39, who claims to be a businessman, was nabbed in Pune and brought to Mumbai. The opposition Congress said Raut has been associated with the Sanatan Sanstha for long and shared dais with Sanatan leaders, and called for the group to be declared a terrorist organisation. The state junior home minister said it was too early to link Raut and the others to any organisation as the ATS has not completed its probe, but they will be probed for links with the murders of <NAME>, and <NAME>. \u201cWe have booked all three accused for criminal conspiracy under the IPC, having association with a terrorist gang or organisation under UAPA, and other laws,\u201d said <NAME>, state ATS chief. \u201cWe got information that a group was planning to carry out bomb blasts to disturb communal harmony,\u201d an officer said.", "description": "MUMBAI: Barely five days before Independence Day, ATS arrested three persons, including two from Nalasopara, on Friday for plotting bomb blasts to disturb communal harmony and having links with terrorist organisations. Twenty bombs and bombmaking materials were found in a bungalow in the northern suburb. <NAME>, 40, a gau rakshak with the <NAME>, and his associate <NAME>, 25, were detained in Nalasopara late on Thursday. <NAME>, 39, who claims to be a businessman, was nabbed in Pune and brought to Mumbai. The opposition Congress said Raut has been associated with the Sanatan Sanstha for long and shared dais with Sanatan leaders, and called for the group to be declared a terrorist organisation. The state junior home minister said it was too early to link Raut and the others to any organisation as the ATS has not completed its probe, but they will be probed for links with the murders of <NAME>, and <NAME>.", "time_scraped": "2018-08-19 00:44:11.423844", "article_id": "65360681", "article_category": "IndiaNews", "image_details": [] }
json
In 2016, K. Praveen Kumar of the Congress appeared to buck the trend of the Communist Party of India’s (CPI) four-and-a-half-decades of successive election victories from Nadapuram. But he lost to incumbent MLA E. K. Vijayan by a narrow margin of 4,759 votes. Nadapuram chose a non-CPI candidate only twice in the past 54 years, when Hameedali Shamnad of the Indian Union Muslim League and E. V. Kumaran of the CPI(M) won from here in 1960 and 1965, respectively. Since 1970, only CPI candidates have emerged victorious. They are M. Kumaran, Kandalottu Kunhambu, K. T. Kanaran, Sathyan Mokeri, Benoy Viswam, and Mr. Vijayan. As another poll season arrives, voters of this segment may have a sense of déjà vu with both Mr. Vijayan, who won from here in 2011 as well, and Mr. Kumar being rumoured as the front runners. Though it was earlier reported that the CPI would not give ticket to two-time legislators, the party is learnt to have relaxed the norm to allow one more term to them. This was what increased the probability of Mr. Vijayan’s candidature. A former district secretary of the CPI, Mr. Vijayan is considered to be an amiable and approachable politician. The names of All India Youth Federation leader P. Gavas and National Federation of Indian Women functionary P. Vasantham too are doing the rounds as probable candidates. Mr. Kumar, one of the general secretaries of the Kerala Pradesh Congress Committee, meanwhile, had been active in the socio-political sphere of Nadapuram even after his defeat last time. No other name seems to have figured on the United Democratic Front candidate list. K. P. Vijayalakshmi, K. K. Ranjith, and N. B. Gopinath are in the candidate list of the National Democratic Alliance.
english
<filename>sp2-security-mybatisplus/src/main/java/com/zgy/learn/springsecurity/controller/ThymeleafController.java package com.zgy.learn.springsecurity.controller; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; /** * @author: pray-journey.io * @date: 2021/2/22 */ @Controller public class ThymeleafController { // 任意一个权限都可以 @PreAuthorize("hasAnyAuthority('user', 'admin')") @RequestMapping("/thymeleaf") public String thymeleaf() { return "thymeleaf"; } }
java
<reponame>mcrowe/safe-async-express-errors import { NextFunction, Request, RequestHandler, Response } from 'express' export type AsyncRequestHandler = (req: Request, res: Response, next: NextFunction) => Promise<any> export default function safe(fn: AsyncRequestHandler): RequestHandler { return (req: Request, res: Response, next: NextFunction): any => { return (<AsyncRequestHandler> fn)(req, res, next).catch(next) } }
typescript
{ "ConnectionStrings": { "DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=OpenId-Connect-Talk-host-aspnet-identity;Trusted_Connection=True;MultipleActiveResultSets=true" }, "Logging": { "IncludeScopes": false, "LogLevel": { "Default": "Warning" } }, "ActiveDirectory": { "DomainName": "__SET_IN_USER_SECRETS__" , "DomainUser": "__SET_IN_USER_SECRETS__", "DomainPassword": "__<PASSWORD>" //this password it's intended in clear text, use an encryption system for a real scenario } }
json
// Package libvirt extracts libvirt metadata from install configurations. package libvirt import ( "github.com/openshift-metalkube/kni-installer/pkg/types" "github.com/openshift-metalkube/kni-installer/pkg/types/libvirt" ) // Metadata converts an install configuration to libvirt metadata. func Metadata(config *types.InstallConfig) *libvirt.Metadata { return &libvirt.Metadata{ URI: config.Platform.Libvirt.URI, } }
go
import React, { useState, useLayoutEffect, useCallback } from 'react'; import { useTranslation } from 'react-i18next'; import { createUseStyles } from 'react-jss'; import { Description, Switch } from '../../../components'; import { useCurrentAccount, useApi, useForceUpdate } from '../../../hooks'; import { notificationHelper } from '../../../utils'; import useMargin from '../hooks/useMargin'; import useMarginEnable from '../hooks/useMarginEnable'; type TotalBalanceProps = {}; const TotalBalance: React.FC<TotalBalanceProps> = () => { const classes = useStyles(); const { t } = useTranslation(); const api = useApi(); const { address } = useCurrentAccount(); const setState = useMargin(state => state.setState); const allowanceEnable = useMarginEnable(); const [loading, setLoading] = useState(false); const [tick, forceUpdate] = useForceUpdate(); useLayoutEffect(() => { if (api.asEthereum.margin.allowance) { const subscription = api.asEthereum.margin.allowance(address).subscribe((result: string) => { setState(state => { state.allowance = result; }); }); return () => subscription?.unsubscribe(); } }, [address, api, tick, setState]); const handleSubmit = useCallback( async value => { if (!api.asEthereum.margin.grant) return; setLoading(true); try { return value ? await notificationHelper(api.asEthereum.margin.grant(address)) : await notificationHelper(api.asEthereum.margin.grant(address, '0')); } finally { forceUpdate(); setLoading(false); } }, [api, address, forceUpdate], ); return ( <Description layout="vertical" label={t('ENABLE TRADING')} align="flex-end"> <Switch className={classes.switch} checked={allowanceEnable} onChange={value => handleSubmit(value)} disabled={loading} loading={loading} /> </Description> ); }; const useStyles = createUseStyles(theme => ({ switch: { marginTop: '0.125rem', }, })); export default TotalBalance;
typescript
{"h":[{"d":[{"e":["`Mapapihimaw~ `ko~ `raritriten~ `a~ `panay~.要收割的稻子會派人去守護的。"],"f":"被派人守護、看守。"}]}],"stem":"himaw","t":"mapapihimaw"}
json
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <title>Acupuntura e Masoterapia Chinesa</title> <!-- Bootstrap Core CSS --> <link href="css/bootstrap.css" rel="stylesheet"> <!-- Custom CSS --> <link href="css/stylish-portfolio.css" rel="stylesheet"> <!-- Custom Fonts --> <link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"> <link href="http://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,700,300italic,400italic,700italic" rel="stylesheet" type="text/css"> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <!-- Navigation --> <a id="menu-toggle" href="#" class="btn btn-dark btn-lg toggle"><i class="fa fa-bars"></i></a> <nav id="sidebar-wrapper" > <ul class="sidebar-nav"> <a id="menu-close" href="#" class="btn btn-light btn-lg pull-right toggle"><i class="fa fa-times"></i></a> <li class="sidebar-brand"> <a href="#top">Vânia Neto</a> </li> <li> <a href="#top">Home</a> </li> <li> <a href="#about">Sobre</a> </li> <li> <a href="#services">Serviços</a> </li> <li> <a href="#portfolio">Portfolio</a> </li> <li> <a href="#contact">Contato</a> </li> </ul> </nav> <!-- Header --> <header id="top" class="header"> <div class="text-vertical-center"> <h1>Acupuntura e Masoterapia Chinesa</h1> <br> <a href="#about" class="btn btn-dark btn-lg">Saiba Mais</a> </div> </header> <!-- About --> <section id="about" class="about"> <div class="container"> <div class="row"> <div class="col-lg-14 text-center"> <h2>Sobre</h2> <p class="lead text-left"> <strong>Vânia Neto</strong> </p> <p class="lead text-left"> Formada em: </p> <p class="lead text-left about-graduation"> <strong>Acupuntura</strong>: <ul > <li class="text-left">CEMETRAC – Centro de Estudos da Medicina Tradicional Chinesa - Linhagem taoísta “Agulha de Ouro”, curso ministrado pelo renomado professor <NAME>, vice-presidente da Federação de Acupuntura e Moxabustão e membro do Conselho Executivo da Federação Mundial das Sociedades de Medicina Chinesa. </li> <li class="text-left">PRO SALUS, curso ministrado pelo renomado professor Dr. <NAME>, médico colaborador e orientador dos Trabalhos Científicos em Acupuntura do Departamento de Urologia da UNIFESP-EPM; Doutor pela World Federation of Chinese Medicine Societies (WFCMS); Vice-presidente da Associação Mundial de Auriculomedicina; Diretor Científico da Associação Z<NAME> (AZYMEC). </li> </ul> </p> <p class="lead text-left about-graduation"> <strong><NAME></strong> <ul > <li class="text-left"> CEMETRAC - Centro de Estudos da Medicina Tradicional Chinesa, curso ministrado pelo conceituado professor de Medicina Chinesa <NAME>, Doutor pela World Federation of Chinese Medicine Societies (WFCMS); professor de Acupuntura, <NAME>, I Ching em escolas como: CEMETRA, EBRAMEC e Sociedade Taoista do Brasil. </li> </ul> </p> <p class="lead text-left about-graduation"> <strong>Laserterapia e eletroacupuntura</strong> <ul > <li class="text-left"> Curso ministrado pelo conceituado professor <NAME>, Pós-Graduado em Medicina Tradicional Chinesa – CETN / Faculdades Libertas, Professor de Acupuntura - MTC, disciplina de Doenças Crônicas e Degenerativas e Acupuntura Japonesa – tratamento e diagnóstico / Ryodoraku - CETN / Faculdade Libertas. </li> </ul> </p> </div> </div> <!-- /.row --> </div> <!-- /.container --> </section> <!-- Services --> <!-- The circle icons use Font Awesome's stacked icon classes. For more information, visit http://fontawesome.io/examples/ --> <section id="services" class="services bg-primary"> <div class="container"> <div class="row text-center"> <div class="col-lg-14 col-lg-offset-1"> <h2>Serviços</h2> <hr class="small"> <div class="row"> <div class="col-md-3 col-sm-6"> <div class="service-item"> <img class="img-portfolio img-responsive" src="img/icon1.jpg"> </span> <h4> <strong>Acupuntura</strong> </h4> <a href="#acupuntura" class="btn btn-light">Saiba Mais</a> </div> </div> <div class="col-md-3 col-sm-6"> <div class="service-item"> <img class="img-portfolio img-responsive" src="img/icon2.jpg"> </span> <h4> <strong>Massagem Terapêutica Tui Na</strong> </h4> <a href="#tuiNa" class="btn btn-light">Saiba Mais</a> </div> </div> <div class="col-md-3 col-sm-6"> <div class="service-item"> <img class="img-portfolio img-responsive" src="img/icon3.jpg"> </span> <h4> <strong>Tui Na Pediátrico</strong> </h4> <a href="#tuiNa2" class="btn btn-light">Saiba Mais</a> </div> </div> <div class="col-md-3 col-sm-6"> <div class="service-item"> <img class="img-portfolio img-responsive" src="img/icon4.jpg"> </span> <h4> <strong>Ventosoterapia</strong> </h4> <a href="#ventosoterapia" class="btn btn-light">Saiba Mais</a> </div> </div> </div> <div class="row"> <div class="col-md-3 col-sm-6"> <div class="service-item"> <img class="img-portfolio img-responsive" src="img/icon5.jpg"> </span> <h4> <strong>G<NAME></strong> </h4> <a href="#guasha" class="btn btn-light">Saiba Mais</a> </div> </div> <div class="col-md-3 col-sm-6"> <div class="service-item"> <img class="img-portfolio img-responsive" src="img/icon6.jpg"> </span> <h4> <strong>Moxabustão</strong> </h4> <a href="#moxabustao" class="btn btn-light">Saiba Mais</a> </div> </div> <div class="col-md-3 col-sm-6"> <div class="service-item"> <img class="img-portfolio img-responsive" src="img/icon7.jpg"> </span> <h4> <strong>Eletroacupuntura</strong> </h4> <a href="#eletroacupuntura" class="btn btn-light">Saiba Mais</a> </div> </div> <div class="col-md-3 col-sm-6"> <div class="service-item"> <img class="img-portfolio img-responsive" src="img/icon8.png"> </span> <h4> <strong>Laserpuntura</strong> </h4> <a href="#laserpuntura" class="btn btn-light">Saiba Mais</a> </div> </div> </div> <div class="row"> <div class="col-md-3 col-sm-6"> <div class="service-item"> <img class="img-portfolio img-responsive" src="img/icon9.jpg"> </span> <h4> <strong>Ilib</strong> </h4> <a href="#ilib" class="btn btn-light">Saiba Mais</a> </div> </div> <div class="col-md-3 col-sm-6"> <div class="service-item"> <img class="img-portfolio img-responsive" src="img/icon10.jpg"> </span> <h4> <strong>Auriculoterapia</strong> </h4> <a href="#auriculoterapia" class="btn btn-light">Saiba Mais</a> </div> </div> </div> <!-- /.row (nested) --> </div> <!-- /.col-lg-10 --> </div> <!-- /.row --> </div> <!-- /.container --> </section> <!-- Callout --> <aside class="callout"> <div class="text-vertical-center"> <h1>“A mente é a causa de todas as doenças e o coração é a fonte de toda cura.” (Osho)</h1> </div> </aside> <!-- Portfolio --> <section id="portfolio" class="portfolio"> <div class="container"> <div class="row"> <div class="col-lg-10 col-lg-offset-1 text-center"> <h2>Portfólio</h2> <hr class="small"> <div class="row"> <div class="col-md-12"> <div class="portfolio-item"> <section id="acupuntura"> <h3> <strong>Acupuntura</strong> </h3> <img class="img-portfolio img-responsive" src="img/acupuntura.jpg"> <h4> A acupuntura é uma técnica de tratamento da Medicina Chinesa que estimula o próprio organismo a melhorar seu funcionamento através de aplicação de agulhas em pontos específicos do corpo localizados nos Meridianos, que são canais onde circulam nossas energias (Qi). Os pontos dos meridianos fazem a ligação energética de nossos órgãos e vísceras e através da manipulação desta energia a acupuntura traz o equilíbrio de volta ao corpo. </h4> <h4> É um recurso terapêutico eficaz no tratamento de: alergia, asma, bronquite, derrame, AVC, gastrite, esofagite, ciatalgia, cervicalgia, lombalgia, cistite, tendinite, rinite, sinusite, artrite, artrose, gripe, resfriado, hipertensão, hipotensão, infertilidade, insônia, ansiedade, depressão, reumatismo, estresse, rosácea, psoríase, vícios, incontinência urinária, impotência sexual, obesidade, anorexia, problemas circulatórios, problemas emocionais, etc. Na verdade, a maioria das doenças podem ser tratadas pela acupuntura. Sua ação foi comprovada pela Organização Mundial da Saúde. </h4> <h4> Estudos recentes comprovam a eficácia do tratamento com acupuntura em pacientes com CÂNCER, diminuindo os efeitos colaterais da quimioterapia. </h4> <h4> O procedimento é feito com agulhas descartáveis e geralmente não causa dor, apenas é sentido uma picada ou pequeno choque nos pontos mais sensíveis. </h4> </section> </div> </div> </div> <div class="row"> <div class="col-md-12"> <div class="portfolio-item"> <section id="tuiNa"> <h3> <strong>Massagem Terapêutica Tui Na</strong> </h3> <img class="img-portfolio img-responsive" src="img/tuiNa2.jpg"> <h4> Método da Medicina Chinesa que usa as mãos como instrumento para tratar doenças, na qual são usadas manipulações para estimular os pontos, para corrigir o desequilíbrio energético e alcançar os efeitos curativos. Ele promove o fluxo do sangue, alivia a dor, acalma a Mente e dissolve estagnações. </h4> <h4> <strong>Tui</strong> significa “empurrar” e <strong>Na</strong> significa “agarrar” e tem como objetivo aumentar (tonificar) ou diminuir (sedar) a circulação de energia em um canal ou local. É uma técnica muito usada e valorizada na China, por ser uma técnica simples, com grandes efeitos terapêuticos, pois basta simplesmente as mãos para que ela seja realizada. </h4> </section> </div> </div> </div> <div class="row"> <div class="col-md-12"> <div class="portfolio-item"> <section id="tuiNa2"> <h3> <strong> Tui Na Pediátrico</strong> </h3> <img class="img-portfolio img-responsive" src="img/tuiNa3.png"> <h4> Tratamento terapêutico pediátrico através da massagem Tui Na, usado para substituir a acupuntura. Como a energia da criança é forte e vibrante elas costumas reagir ao tratamento mais rapidamente que o adulto. </h4> <h4> Sua prática envolve um grande numero riquíssimo de manobras e técnicas, que permitem um estímulo e tratamento adequado, de acordo com a patologia apresentada pelo paciente. É uma técnica muito valorizada e difundida no oriente, pois ela é a origem de várias massagens, entre elas o Shiatsu. Essa prática é usada na China tanto para curar doenças como para estimular o desenvolvimento físico e mental saudável. É usada em bebês e crianças há pelo menos 700 anos, porque é uma terapia simples, segura, indolor e não tem contra-indicação. </h4> <h4> A massagem Tui Na é feita em pontos específicos do corpo, onde o fluxo do Qi (energia) pode ser manipulado. Ela restaura e estimula o fluxo suave do Qi, por todo o organismo. </h4> <h4> Utilizado para tratar doenças como: cólica, dor de ouvido, rinites, falta de apetite, diarreia, constipação, hiperatividade, problemas de digestão, insônia, terror noturno, medo, doenças respiratórias, má nutrição, vômitos, febre, tosse convulsiva, etc. </h4> </section> </div> </div> </div> <div class="row"> <div class="col-md-12"> <div class="portfolio-item"> <section id="ventosoterapia"> <h3> <strong>Ventosoterapia</strong> </h3> <img class="img-portfolio img-responsive" src="img/ventosoterapia.jpg"> <h4> O uso da ventosa no Oriente foi desenvolvido com base na acupuntura. Existem vários tipos de ventosa como: argila, vidro, bambu, plástico. É feita através de um bombeamento de ar. A diferença de pressão entre o ar interior e exterior acaba por gerar uma força de sucção e tem a função de limpar as toxinas acumuladas no organismo. A estagnação de sangue, escuro e sujo, nos músculos das costas ou das articulações é considerada pela Medicina Oriental como um dos elementos causadores de doenças, a ventosa drena este sangue, promovendo o livre fluxo da energia. A Ventosa é usada para aliviar as dores musculares, melhorar o sistema circulatório e até mesmo, para redução de celulite e gordura localizada, lombalgias, dores abdominais e muitas outras patologias. </h4> <h4> Pode-se utilizar a ventosa para produzir o “efeito massagem” que consistem em mover as ventosas sobre as superfícies grandes e lisas do corpo, tais como as costas e as coxas. Esta massagem tem o efeito de remover a pele ressecada pela abertura dos poros e pela transpiração. Ela aumenta o fluxo da linfa, reduzindo o edema, matem a flexibilidade dos músculos, retira as adesões e as fibroses e mobiliza o funcionamento dos órgãos, descongestiona o bloqueio de energia, ativa a circulação e o funcionamento geral do corpo. </h4> </section> </div> </div> </div> <div class="row"> <div class="col-md-12"> <div class="portfolio-item"> <section id="guasha"> <h3> <strong><NAME></strong> </h3> <img class="img-portfolio img-responsive" src="img/guasha.jpg"> <h4> É o tratamento feito sem utilização de agulhas, mas sim através de uma raspagem com uma espátula de chifre de búfalo ou com a pedra de jade em locais previamente selecionados, estimulando-se locais da pele, alterando a circulação sanguínea. Ele pode proporcionar efeitos iguais ao da Acupuntura, que estimula a circulação sanguínea a partir da estimulação de certos locais, promovendo assim a desobstrução dos meridianos, liberando o fluxo de energia e trazendo o relaxamento muscular. </h4> </section> </div> </div> </div> <div class="row"> <div class="col-md-12"> <div class="portfolio-item"> <section id="moxabustao"> <h3> <strong>Moxabustão</strong> </h3> <img class="img-portfolio img-responsive" src="img/moxabustao.jpg"> <h4> Proveniente da Medicina Tradicional Chinesa, a Moxabustão é uma técnica que assim como a acupuntura age estimulando os pontos energéticos para fortalecer e estimular a circulação do Qi (energia) e do sangue, eliminar a estagnação, dispersar o frio e a umidade. Sua técnica consiste no aquecimento de pontos de acupuntura através da queima de ervas medicinais e seu calor é extremamente penetrante e eficaz. </h4> <h4> As Moxas mais usadas são feitas de folhas de Artemísia ou Carvão. A moxa de Artemísia pode ser usada em bastão, sobre o cabo da agulha, na caixa de madeira, em cone sobre a pele, com sobreposição de sal, gengibre, alho. </h4> <h4> É muito indicada para tratar de: ansiedade, estresse, depressão, cansaço, fraqueza, enxaqueca, cólica menstrual, enurese, paralisia facial, asma, bronquite, epicondilite, diarréia, incontinência urinária, impotência sexual, infertilidade, dores nos joelhos, tornozelos, nas costas, ombros, calcanhares, ciático, cervical, lombar, tendinite, bursite, artrite. </h4> </section> </div> </div> </div> <div class="row"> <div class="col-md-12"> <div class="portfolio-item"> <section id="eletroacupuntura"> <h3> <strong>Eletroacupuntura</strong> </h3> <img class="img-portfolio img-responsive" src="img/eletroacupuntura1.jpg"> <h4> A eletroacupuntura é mais uma das terapias que tem como base a Acupuntura e é aplicado por aparelhos elétricos que, conectados às agulhas ou eletrodos, transmite estímulos aos pontos de acupuntura. A corrente elétrica que passa pelo corpo através da agulha, produz estímulos elétricos, que substituem as manipulações manuais. </h4> <h4> Geralmente é mais utilizada de dores fortes ou lesões mais graves. </h4> <h4> É indicada para: estresse, depressão, insônia enxaqueca, TPM, traumas em geral, reumatismo, lombalgia, cervicalgia, ciatalgia, bursite, tendinite, artrite, tratamento estético. </h4> </section> </div> </div> </div> <div class="row"> <div class="col-md-12"> <div class="portfolio-item"> <section id="laserpuntura"> <h3> <strong>Laserpuntura</strong> </h3> <img class="img-portfolio img-responsive" src="img/laserpuntura.png"> <h4> É uma técnica onde se utiliza o Laser de baixa potência em substituição das agulhas de acupuntura. Além de promover a ação das agulhas, tem ação analgésica e anti-inflamatória. É uma excelente opção para quem tem medo de agulha. </h4> <h4> É indicado para: alergias, alterações emocionais, ansiedade, artrite, artrose, ATM, ciatalgia, lombalgia, depressão, dores musculares e osteomusculares, enxaqueca, epicondilite, nevralgia, reumatismo, sinusite, cicatrização de feridas, etc. </h4> </section> </div> </div> </div> <div class="row"> <div class="col-md-12"> <div class="portfolio-item"> <section id="ilib"> <h3> <strong>Ilib</strong> </h3> <img class="img-portfolio img-responsive" src="img/ilib.jpg" style="width:60%; height:auto"> <h4> É uma técnica de Irradiação Intravascular do Sangue com Laser. É aplicada através de uma pulseira. É indolor e não tem efeitos colaterais. Esta técnica promove a ativação celular, tem efeito antioxidante, ação anti-inflamatória, melhora o sistema imunológico, promove o aumento da circulação sanguínea, a oxigenação, nutre os tecidos. Isso resulta na prevenção e tratamento de diversas doenças como: artrite, artrose, inflamações e tensões musculares, diabetes, aftas, queimaduras, herpes, colesterol, hipertensão, entre outras doenças cardiovasculares e do sistema vascular periférico. Atua no combate a dores, promove relaxamento e alívio de estresse, auxilia na cicatrização, no tratamento do sistema respiratório, asma. Estes efeitos terapêuticos favorecem o rejuvenescimento, o bem-estar e a qualidade de vida. </h4> </section> </div> </div> </div> <div class="row"> <div class="col-md-12"> <div class="portfolio-item"> <section id="auriculoterapia"> <h3> <strong>Auriculoterapia</strong> </h3> <img class="img-portfolio img-responsive" src="img/auriculoterapia2.jpg"> <h4> A auriculoterapia é uma técnica de diagnóstico e tratamento baseada no pavilhão auricular. Através da auriculoterapia podemos tratar os desequilíbrios energéticos que são os causadores das doenças. O interessante é que pelo exame da orelha podemos antecipar o tratamento de doenças que ainda não se instalaram, pois ela já dá sinais do início do desequilíbrio. </h4> <h4> Nossa orelha possui pontos que correspondem a todos os órgãos e vísceras e ao estimulá-los com sementes, esferas, cristais, o cérebro recebe um impulso que desencadeia uma séria de fenômenos físicos, relacionados com a área do corpo, produzindo a cura. É possível o tratamento tanto de origem fisiológica quanto emocional. </h4> </section> </div> </div> </div> </div> <!-- /.col-lg-10 --> </div> <!-- /.row --> </div> <!-- /.container --> </section> <!-- Call to Action --> <aside class="call-to-action bg-primary"> <div class="container"> <div class="row"> <div class="col-lg-12 text-center"> <h3>Marque uma consulta.</h3> </div> </div> </div> </aside> <!-- Map --> <section id="contact" class="map"> <iframe width="100%" height="100%" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://www.google.com/maps/embed?pb=!1m14!1m8!1m3!1d3656.7385014396987!2d-46.643493199999995!3d-23.577833499999997!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x94ce59905bce8029%3A0xd342b8273d9da763!2sR.+Estela%2C+265+-+Vila+Mariana%2C+S%C3%A3o+Paulo+-+SP%2C+04011-001!5e0!3m2!1spt-BR!2sbr!4v1425327382060"></iframe> <iframe width="200" height="150" frameborder="0" style="border:0"></iframe> <br /> <small> <a href="https://www.google.com.br/maps/place/R.+Estela,+265+-+Vila+Mariana,+S%C3%A3o+Paulo+-+SP,+04011-001/@-23.5778335,-46.6434932,17z/data=!3m1!4b1!4m2!3m1!1s0x94ce59905bce8029:0xd342b8273d9da763"></a> </small> </section> <br/> <!-- Footer --> <footer> <div class="container"> <div class="row"> <div class="col-lg-10 col-lg-offset-1 text-center"> <h4><strong><NAME></strong> </h4> <p><NAME>, 265 – Casa 11 – Vila Mariana (prox. Metrô Paraíso)</p> <ul class="list-unstyled"> <li><i class="fa fa-phone fa-fw"></i> (11) 3280-6020</li> <li><i class="fa fa-phone fa-fw"></i> (11) 99156-0620</li> <li><i class="fa fa-envelope-o fa-fw"></i> <a href="mailto:<EMAIL>"><EMAIL></a> </li> </ul> <br> <ul class="list-inline"> <li> <a href="https://www.facebook.com/vania.neto.921"><i class="fa fa-facebook fa-fw fa-3x"></i></a> </li> </ul> <hr class="small"> <p class="text-muted">Copyright &copy; <NAME> 2019</p> </div> </div> </div> </footer> <!-- jQuery --> <script src="js/jquery.js"></script> <!-- Bootstrap Core JavaScript --> <script src="js/bootstrap.min.js"></script> <!-- Custom Theme JavaScript --> <script> // Closes the sidebar menu $("#menu-close").click(function(e) { e.preventDefault(); $("#sidebar-wrapper").toggleClass("active"); }); // Opens the sidebar menu $("#menu-toggle").click(function(e) { e.preventDefault(); $("#sidebar-wrapper").toggleClass("active"); }); // Scrolls to the selected menu item on the page $(function() { $('a[href*=#]:not([href=#])').click(function() { if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') || location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); if (target.length) { $('html,body').animate({ scrollTop: target.offset().top }, 1000); return false; } } }); }); </script> </body> </html>
html
#include "bingo_container_set.h" #include "bingo_multibit_tree.h" using namespace bingo; ContainerSet::ContainerSet() { _inc_count = 0; _inc_total_ones_count = 0; } void ContainerSet::setParams(int fp_size, int container_size, int min_ones_count, int max_ones_count) { profTimerStart(t, "cs_set_params"); _fp_size = fp_size; _min_ones_count = min_ones_count; _max_ones_count = max_ones_count; _container_size = container_size; _increment.allocate(_container_size * _fp_size); _indices.allocate(_container_size); } int ContainerSet::getContCount() const { return _set.size() + 1; } int ContainerSet::getMinBorder() const { return _min_ones_count; } int ContainerSet::getMaxBorder() const { return _max_ones_count; } bool ContainerSet::add(const byte* fingerprint, int id, int fp_ones_count) { if (_inc_count == _container_size) throw Exception("ContainerSet: Increment is full"); byte* inc = _increment.ptr(); int* indices = _indices.ptr(); memcpy(inc + _inc_count * _fp_size, fingerprint, _fp_size); indices[_inc_count] = id; _inc_total_ones_count += (fp_ones_count == -1 ? bitGetOnesCount(fingerprint, _fp_size) : fp_ones_count); _inc_count++; if (_inc_count == _container_size) return true; return false; } void ContainerSet::buildContainer() { profIncCounter("trees_count", 1); MultibitTree& cont = _set.push<int>(_fp_size); cont.build(_increment, _indices, _container_size, _min_ones_count, _max_ones_count); _increment.allocate(_container_size * _fp_size); _indices.allocate(_container_size); _inc_count = 0; } void ContainerSet::splitSet(ContainerSet& new_set) { if (_set.size() > 0) throw Exception("ContainerSet: Set with built containers can't be splited"); int new_border = (_inc_total_ones_count / _inc_count) + 1; int inc_count_cur = 0; new_set._inc_count = 0; _inc_total_ones_count = 0; new_set._inc_total_ones_count = 0; for (int i = 0; i < _inc_count; i++) { int ones_count = bitGetOnesCount(_increment.ptr() + i * _fp_size, _fp_size); if (ones_count < new_border) { memcpy(_increment.ptr() + inc_count_cur * _fp_size, _increment.ptr() + i * _fp_size, _fp_size); _indices[inc_count_cur] = (int)_indices[i]; inc_count_cur++; _inc_total_ones_count += ones_count; } else { memcpy(new_set._increment.ptr() + new_set._inc_count * _fp_size, _increment.ptr() + i * _fp_size, _fp_size); new_set._indices[new_set._inc_count] = (int)_indices[i]; new_set._inc_count++; new_set._inc_total_ones_count += ones_count; } } new_set._min_ones_count = new_border; new_set._max_ones_count = _max_ones_count; _max_ones_count = new_border - 1; _inc_count = inc_count_cur; } void ContainerSet::findSimilar(const byte* query, SimCoef& sim_coef, double min_coef, Array<SimResult>& sim_indices) { sim_indices.clear(); static int idx = 0; // int query_bit_number = bitGetOnesCount(query, _fp_size); QS_DEF(Array<SimResult>, cell_sim_indices); for (int i = 0; i < _set.size(); i++) { MultibitTree& container = _set[i]; cell_sim_indices.clear(); container.findSimilar(query, sim_coef, min_coef, cell_sim_indices); sim_indices.concat(cell_sim_indices); } cell_sim_indices.clear(); _findSimilarInc(query, sim_coef, min_coef, cell_sim_indices); sim_indices.concat(cell_sim_indices); idx++; } void ContainerSet::optimize() { if (_inc_count < _container_size / 10) return; profIncCounter("trees_count", 1); MultibitTree& cont = _set.push<int>(_fp_size); cont.build(_increment, _indices, _inc_count, _min_ones_count, _max_ones_count); _increment.allocate(_container_size * _fp_size); _indices.allocate(_container_size); _inc_count = 0; } int ContainerSet::getSimilar(const byte* query, SimCoef& sim_coef, double min_coef, Array<SimResult>& sim_fp_indices, int cont_idx) { profTimerStart(cs_s, "getSimilar"); if (cont_idx >= getContCount()) throw Exception("ContainerSet: Incorrect container index"); if (cont_idx == _set.size()) { { profTimerStart(cs_s, "inc_findSimilar"); _findSimilarInc(query, sim_coef, min_coef, sim_fp_indices); profIncCounter("inc_findSimilar_count", sim_fp_indices.size()); } return sim_fp_indices.size(); } MultibitTree& container = _set[cont_idx]; { profTimerStart(cs_s, "set_findSimilar"); container.findSimilar(query, sim_coef, min_coef, sim_fp_indices); profIncCounter("set_findSimilar_count", sim_fp_indices.size()); } return sim_fp_indices.size(); } int ContainerSet::_findSimilarInc(const byte* query, SimCoef& sim_coef, double min_coef, Array<SimResult>& sim_indices) { byte* inc = _increment.ptr(); int* indices = _indices.ptr(); sim_indices.clear(); int query_bit_number = bitGetOnesCount(query, _fp_size); for (int i = 0; i < _inc_count; i++) { byte* fp = inc + i * _fp_size; int fp_bit_number = bitGetOnesCount(fp, _fp_size); double coef = sim_coef.calcCoef(fp, query, query_bit_number, fp_bit_number); if (coef < min_coef) continue; sim_indices.push(SimResult(indices[i], (float)coef)); } return sim_indices.size(); }
cpp
from http.server import BaseHTTPRequestHandler import os import subprocess import time from typing import ClassVar, Dict, List, Optional, Tuple from onceml.components.base import BaseComponent, BaseExecutor from onceml.orchestration.Workflow.types import PodContainer from onceml.types.artifact import Artifact from onceml.types.channel import Channels from onceml.types.state import State import onceml.types.channel as channel import threading import shutil from onceml.templates import ModelServing import json from onceml.utils.logger import logger from onceml.thirdParty.PyTorchServing import run_ts_serving, outputMar from onceml.thirdParty.PyTorchServing import TS_PROPERTIES_PATH, TS_INFERENCE_PORT, TS_MANAGEMENT_PORT from .Utils import generate_onceml_config_json, queryModelIsExist, registerModelJob, get_handler_path, get_handler_module import pathlib from onceml.utils.json_utils import objectDumps import onceml.global_config as global_config import onceml.utils.pipeline_utils as pipeline_utils from deprecated.sphinx import deprecated from onceml.types.component_msg import Component_Data_URL class _executor(BaseExecutor): def __init__(self): super().__init__() self.ensemble_models = [] ''' model serving template class ''' self.model_serving_cls = None self.lock = threading.Lock() # 当前正在serving的实例 self.model_serving_instance: ModelServing = None self._ts_process = None self.model_timer_thread = None @property def ts_process(self) -> subprocess.Popen: """获得当前的ts serving的Popen实例 """ return self._ts_process @ts_process.setter def ts_process(self, process: subprocess.Popen): """设置ts serving的Popen """ self._ts_process = process def Cycle(self, state: State, params: dict, data_dir, input_channels: Optional[Dict[str, Channels]] = None, input_artifacts: Optional[Dict[str, Artifact]] = None) -> Channels: training_channels = list(input_channels.values())[0] latest_checkpoint = state["model_checkpoint"] if training_channels["checkpoint"] <= latest_checkpoint: # 尝试提交最新的model if not queryModelIsExist(self.component_msg["model_name"]): mar_file = os.path.join( data_dir, "{}-{}.mar".format(self.component_msg["model_name"], str(state["model_checkpoint"]))) if os.path.exists(mar_file): if not registerModelJob( url=os.path.abspath(mar_file), handler=get_handler_module() ): logger.error("register failed") return None to_use_model_dir = os.path.join(list(input_artifacts.values())[ 0].url, "checkpoints", str(training_channels["checkpoint"])) os.makedirs(data_dir, exist_ok=True) # 打包.mar文件 if not outputMar( model_name=self.component_msg["model_name"], handler=get_handler_path(), extra_file="{},{}".format(to_use_model_dir, os.path.join( data_dir, "onceml_config.json")), export_path=data_dir, version=str(training_channels["checkpoint"])): logger.error("outputMar failed") return None # 将.mar文件重命名 os.rename(os.path.join(data_dir, "{}.mar".format( self.component_msg["model_name"])), os.path.join(data_dir, "{}-{}.mar".format( self.component_msg["model_name"], str(training_channels["checkpoint"])))) #提交 .mar if not registerModelJob( url=os.path.abspath( os.path.join(data_dir, "{}-{}.mar".format(self.component_msg["model_name"], str(training_channels["checkpoint"])))), handler=get_handler_module()): logger.error("register failed") return None state["model_checkpoint"] = training_channels["checkpoint"] return None @deprecated(reason="not use", version="0.0.1") def register_model_timer(self, state, data_dir): '''注册模型的定时器 现在的torch serving有一些问题:进程莫名退出,这时候pod的相应容器会自动重启,然后需要main容器里的框架定时进行注册 ''' def put_model(): #尝试提交 .mar while True: # 先查询 if not queryModelIsExist(self.component_msg["model_name"]): mar_file = os.path.join( data_dir, "{}-{}.mar".format(self.component_msg["model_name"], str(state["model_checkpoint"]))) if os.path.exists(mar_file): if not registerModelJob( url=os.path.abspath(mar_file), handler=get_handler_module() ): logger.error("register failed") time.sleep(2) # 创建线程 self.model_timer_thread = threading.Thread(target=put_model) def pre_execute(self, state: State, params: dict, data_dir: str): self.ensemble_models = params["ensemble_models"] self.model_serving_cls: type = params["model_serving_cls"] # 启动ts serving进程 # self.ts_process = run_ts_serving( # TS_PROPERTIES_PATH, model_store=os.path.abspath(data_dir)) initial_mar_file = os.path.join( data_dir, "{}-{}.mar".format(self.component_msg["model_name"], str(state["model_checkpoint"]))) if os.path.exists(initial_mar_file): # 提交一个.mar文件到ts serving if not registerModelJob(url=initial_mar_file, handler=get_handler_module(), maxtry=10): logger.error("register failed") # 生成handler的runtime 的配置onceml_config.json with open(os.path.join(data_dir, "onceml_config.json"), "w") as f: f.write(objectDumps(generate_onceml_config_json( working_dir=global_config.PROJECTDIR, module=self.model_serving_cls.__module__, cls_name=self.model_serving_cls.__name__, task=self.component_msg["task_name"], model=self.component_msg["model_name"], project_name=self.component_msg["project"]))) pipeline_utils.update_pipeline_model_serving_component_id( self.component_msg["project"], self.component_msg["task_name"], self.component_msg["model_name"], self.component_msg['component_id']) @deprecated(reason="not use", version="0.0.1") def exit_execute(self): """结束时,也停止响应的ts serving进程 """ if self.ts_process is not None: self.ts_process.terminate() self.ts_process.wait() self.ts_process.kill() @deprecated(reason="not use", version="0.0.1") def _POST_predict(self, req_handler: BaseHTTPRequestHandler): content_length = int(req_handler.headers['Content-Length']) post_data = req_handler.rfile.read(content_length).decode( 'utf-8') # <--- Gets the data itself '''todo:add ensemble ''' logger.info("收到predict请求") self.lock.acquire() use_instance = self.model_serving_instance self.lock.release() logger.info("获得use_instance") if use_instance is None: req_handler.send_response(200) req_handler.send_header('Content-type', 'application/json') req_handler.end_headers() req_handler.wfile.write("no available model".encode('utf-8')) else: res = self.model_serving_instance.serving(post_data, None) req_handler.send_response(200) req_handler.send_header('Content-type', 'application/json') req_handler.end_headers() req_handler.wfile.write(json.dumps(res).encode('utf-8')) class CycleModelServing(BaseComponent): def __init__(self, model_generator_component: BaseComponent, model_serving_cls, ensemble_models: list = [], **args): """部署模型 接收modelGenerator的更新的模型的消息,从而对部署的模型进行更新 """ super().__init__(executor=_executor, inputs=[model_generator_component], model_serving_cls=model_serving_cls, ensemble_models=ensemble_models, **args) self.state = { "model_checkpoint": -1, # 当前使用的模型的版本号(用模型的时间戳来辨别) } def extra_svc_port_internal(self) -> List[Tuple[str, str, int]]: return [("ts", "TCP", TS_INFERENCE_PORT)] def extra_pod_containers_internal(self) -> List[PodContainer]: ''' 注册torch serving ''' frameworks = super().extra_pod_containers_internal() ts = PodContainer("ts") ts.command = ['python'] ts.args = ["-m", "onceml.thirdParty.PyTorchServing.initProcess", "--model_store", "{}".format(os.path.join( global_config.OUTPUTSDIR, self.artifact.url, Component_Data_URL.ARTIFACTS.value))] ts.SetReadinessProbe([str(TS_INFERENCE_PORT), "/ping"]) ts.SetLivenessProbe([str(TS_INFERENCE_PORT), "/ping"]) return frameworks+[ts]
python
""" Check that we have a valid class to work upon in our live tile notifications """ from django.core.exceptions import ImproperlyConfigured from mezzanine.utils.importing import import_dotted_path from mezzanine.conf import settings model_class_path, fields = settings.WINDOWS_TILE_MODEL try: import_dotted_path(model_class_path) except ImportError: raise ImproperlyConfigured("The WINDOWS_TILE_MODEL setting contains %s modle which can not be imported" %model_class_path)
python
Helsinki has an ambitious plan for its future. By 2025, the Finnish capital intends to revamp its public transport system to such an extent that private car ownership becomes pointless. The bold initiative is not just about providing more buses, trains, or taxis, but about creating a new transport infrastructure based on cutting-edge technology and a single, affordable payment system. The theory goes like this: imagine a family that has opted not to own a car. When they want to drop the kids off at school, they simply arrange an on-demand bus service instead. They use ridesharing and buses to get to work, and in the holidays they rent a car to travel to their summer house. When they need to get around Helsinki, they use city bikes, renting a locker to store any heavy bags. If the weather changes while they're out cycling, a journey planner will alert them and suggest another way of reaching their destination without getting soaked. Under the plan, all these services will be accessed through a single online platform. People will be able to buy their transport in service packages that work like mobile phone tariffs: either as a complete monthly deal or pay as you go options based on individual usage. Any number of companies can use the platform to offer transport packages, and if users find their travel needs change, they'll be able to switch packages or moved to a rival with a better deal. It sounds like part Google Maps, part City Mapper, part Boris Bikes, part Uber, and part capitalist free for all — but the Helsinki vision isn't as farfetched as it might sound. The inspiration behind an initiative that would send many cityplanners running for the hills comes from a master's thesis by transport engineer Sonja Heikkilä. Commissioned by the Helsinki City Planning Department, Heikkilä's thesis argued young people's changing attitudes towards cars, coupled with the growing functionality and takeup of mobile technology, could transform the way people get around the capital. "The vision is that all kinds of [transport] services will be used together through a single portal," Heikkilä says. "In addition to traditional public transport, it would include taxis, car-sharing, and services that don't even exist yet. A proactive route planner will suggest journeys based on real-time traffic data and alert users to changes caused by accidents or changes in weather conditions." It's a drastic change from the current system. Like most cities, public transport in Helsinki is currently run entirely by local authorities, combining traditional bus, train and tram services alongside a mixture of licensed and private taxis. Moving to the system envisioned by Heikkilä will be no small task, but the foundations are already being laid. In June the Finnish Ministry of Transport and Communications rolled out Traffic Lab, a real-time traffic information service being developed in partnership between local government and businesses. Traffic Lab will compensate companies in the programme for anonymous traffic data they collect from private vehicles whose owners have opted into the system. The data could include, for example, traffic information and driving logs from traffic apps or in-car navigation systems and will be collected through a mixture of existing in-car systems and newly-installed ones, producing a combination of information over GPS, short-range radio signals and mobile networks. "I now declare Finland as the country for open traffic experiments – Finland is a Traffic Lab," proclaimed Henna Virkkunen, Finland's transport and local government minister, in June. The aim is to install Traffic Lab-compatible devices in up to 60,000 vehicles, with the scheme running until the end of 2015. Then, the data will be made available to any interested company, Finnish or foreign, and used to plan, audit, and research the new transport services required for the 2025 plan. What new transport services could be used to fill the immense gap that would be left by any major drop in private car use? HSL, the Helsinki Regional Transport Authority, admits it doesn't yet have all the answers, but one interesting new service already in operation could point the way. HSL has been trialling Kutsuplus (which translates from the Finnish as 'Invitation Plus'), a clever on-demand minibus service, since 2013. Passengers book a Kutsuplus minibus online. Once the request is filed, the Kutsuplus system determines which of a 15-strong fleet of minibuses is best positioned to collect the passenger and take them to their destination. The minibus is then dynamically rerouted by the system — such changes happen all along the journey as the minibus collects and drops off new passengers throughout the city, who all have access to free wi-fi along the way. The service uses a proprietary platform developed by Finnish tech start-up Ajelo which it claims can be scaled up to support fleet sizes of more than 1,000 vehicles. To make the service work, the system needs be able to do millions of calculations in a day. For example, during one busy day in May, 8,000 separate trip requests were made by the users of the service. The system made five million A-to-B route evaluations, adjusting the routes of a fleet of 10 vehicles, each with nine seats, operating for around 16 hours during that day — all on the fly. Currently Kutsuplus has more than 13,000 registered users and payment — a trip costs less than a taxi but more than a bus — is made before the journey using a virtual ‘Trip Wallet', part of the Kutsuplus website. Money is loaded into the wallet via online payment services or credit card and the same wallet can be shared between several family members or between workers in the same company. At the moment the service uses a web-based UI optimised both for desktop use and mobile devices, but a family of mobile apps is under development which will allow for additional payment options beyond those found in the Trip Wallet. But even the online payment options are primitive compared to what Helsinki is planning. "The city wants to build a framework for an open market where companies can operate and offer their services in different combinations. The City doesn't want to decree what services are offered, but help to facilitate the establishment of an ecosystem that enables private companies to produce a variety of them," Heikkilä says. "There would be several commercial [transport] operators offering these services, in the same way as in telecommunications today. The customers could choose the operator and the service package they want." The best part of this approach is passengers can vote with their feet: if they aren't satisfied with the package offered by one transport provider, they can switch to another. But data and services are only half the battle. Equally important is giving them the platform to flourish — and that currently presents a problem. "At the moment, the Finnish laws stipulate quite strictly what kinds of services are offered and there isn't much room for innovation," Heikkilä says. It's something Teemu Sihvola, CEO of the startup Ajelo which created the platform behind the Kutsuplus service, also agrees will need to change. "To make [a car-free Helsinki] happen in just 10 years requires not only innovation but also courage from the public sector," he says. "New innovations in transport have to work hand in hand. Not competing against each other but complementing each other to provide a service network that in time will make private cars obsolete." The first of several necessary changes will begin in early 2015 when a pilot project will launch in Vallila, a borough of Helsinki. The pilot will test a new kind of a service package based on existing transport services, including trains, trams, buses, parking, taxis, car-sharing, and Kutsuplus. The details of the pilot are still in the planning phase and it will be the first of many, but the aim is to create a single mobile user interface through which all mobility services can be accessed and paid for. Users can easily monitor their monthly transport costs and optimise how they use different services, helping them to see when the use of a car isn't economical or necessary. "The technology elements needed to build this kind of transport operator-based system is starting to be there but we need a structure that enables building the system," says Sampo Hietanen, CEO of ITS (Intelligent Transport Systems and Services) Finland. "This includes legal challenges like getting rid of the monopoly in selling public transport tickets. The biggest technological challenges are in the validation of payments, as there is no unified system in use, and in enabling different systems to communicate with each other. "Helsinki is planning to be the first city in the world to open up different public transport-related data, like live traffic data and its payment system, is a huge step." While Finland is aiming to be first, it isn't alone. Neighbouring Sweden is currently trialling its UbiGo service in Gothenburg which combines public transport, car-sharing, rental car service, taxi and a bicycle system in a single app alongside 24/7 support and a gamefication element for those who choose environmentally-friendly options. Similar trials are also underway in Austria and Germany, among other countries. More widely the European Union has also detailed its objective of combining a user's mobility and transportation needs under a single service agreement. Perhaps predictably, that meeting was hosted in Helsinki. The city seems convinced that if it can lead by example, others will follow.
english
<reponame>HolgerJeromin/direktvermarkter<gh_stars>10-100 {"type":"Feature","id":"node/6165545221","properties":{"amenity":"vending_machine","vending":"sweets; food","id":"node/6165545221"},"geometry":{"type":"Point","coordinates":[10.4196264,53.2492293]}}
json
<reponame>ryanYtan/main { "courseCode": "YHU2203", "courseCredit": "5", "description": "This course will examine a number of artistic masterpieces from the Western tradition, ranging from medieval Byzantine icons to contemporary installation art. We will delve deeply into each of the selected artworks, simultaneously examining their extraordinary uniqueness and their capacity to represent an entire cultural epoch, both aesthetically and conceptually. Along the way we will ask what makes these works 'masterpieces' and debate how and why they came to form the Western artistic 'canon.'", "faculty": "Yale-NUS College", "fulfillRequirements": [ "YHU4207" ], "title": "Masterpieces of Western Art: Renaissance to the Present" }
json
import glob import os import numpy as np import scipy from scipy import signal import fabio import matplotlib.pyplot as plt import center_approx import integration import peakfindingrem import peakfinding import scipy.optimize as optimize import scipy.stats from scipy import interpolate from lmfit import minimize, Parameters import cv2 from scipy.ndimage import filters from scipy.fftpack import rfft, irfft from skimage.restoration import denoise_bilateral demo = True # def find_arcs(img, cen): # img = img * (img > 1) # img = np.log(img + 1) / np.log(np.max(img)) * 255 # img = np.array(img, dtype=np.uint8) # img = img * Pilatus2M_Mask() # # plt.imshow(img) # plt.show() # # plt.imshow(img) # # plt.show() # # search theta # Nradial = 25 # # arclist = [] # # for Theta in np.linspace(-180.0, 0.0, Nradial, endpoint=False): # mask = arcmask(img, cen, [0, img.shape[0]], [Theta, Theta + 180.0 / Nradial]) # # if demo: # plt.imshow(img * mask) # plt.show() # # thetaprofile = radial_integrate(mask * img, cen) # # print thetaprofile # # peakRs = findpeaks(thetaprofile) # # print peakRs # # if demo: # fig = plt.figure() # # h = fig.add_subplot(211) # plt.plot(thetaprofile) # plt.plot(peakRs, thetaprofile[peakRs], 'r*') # limits = h.axis() # h = fig.add_subplot(212) # plt.imshow(signal.cwt(thetaprofile, signal.ricker, np.arange(5, 100))) # cwtlimits = h.axis() # h.axis([limits[0], limits[1], cwtlimits[2], cwtlimits[3], ]) # fig.tight_layout() # plt.show() # # for peakR in peakRs: # Rwidth = 20 # mask = arcmask(img, cen, (-0.5 * Rwidth + peakR, 0.5 * Rwidth + peakR), (-180.0, 0.0)) # if demo: # plt.imshow(img * mask) # plt.show() # # Rprofile = alt_integrate(img * mask, cen) # # Nangle = 50.0 # peakThetas = np.array(findpeaks(Rprofile)) # # if demo: # plt.plot(np.linspace(0, np.pi * 2, Rprofile.__len__()), Rprofile) # plt.plot(peakThetas / Nangle, Rprofile[peakThetas], 'r*') # plt.show() # # peakThetas = peakThetas / Nangle # print 'Here', peakThetas # # #add peak to arclist # for peakTheta in peakThetas: # arclist.append([peakR * np.cos(peakTheta), peakR * np.sin(peakTheta)]) # # arclist = np.array(arclist) # plt.imshow(img) # plt.plot(cen[0] - arclist[:, 0], cen[1] - arclist[:, 1], 'r*') # plt.show() def findpeaks(Y): # Find peaks using continuous wavelet transform; parameter is the range of peak widths (may need tuning) # plt.plot(Y) # plt.show() Y = np.nan_to_num(Y) peakindices = scipy.signal.find_peaks_cwt(Y, np.arange(20, 100), noise_perc=5, min_length=10) # peakindices=peakutils.indexes(Y, thres=0.6,min_dist=20) return peakindices # def radial_integrate(img, cen): # # Radial integration # y, x = np.indices(img.shape) # r = np.sqrt((x - cen[0]) ** 2 + (y - cen[1]) ** 2) # r = np.rint(r).astype(np.int) # # tbin = np.bincount(r.ravel(), img.ravel()) # # nr = np.bincount(r.ravel(), (img > 0).ravel()) # radialprofile = tbin / nr # # return radialprofile # def alt_integrate(img, cen): # # Radial integration # N = 50 # y, x = np.indices((img.shape)) # r = (np.arctan2(y - cen[1], x - cen[0]) + np.pi) * N # r = np.rint(r).astype(np.int) # tbin = np.bincount(r.ravel(), img.ravel()) # nr = np.bincount(r.ravel(), (img > 0).ravel()) # radialprofile = tbin / nr # # return radialprofile # def Pilatus2M_Mask(): # row = 1679 # col = 1475 # mask = np.zeros((row, col)) # # row_start = 196 # row_gap_size = 16 # row_num_gaps = 7 # # col_start = 488 # col_gap_size = 6 # col_num_gaps = 2 # # start = row_start # for i in range(1, row_num_gaps + 1): # mask[start:start + row_gap_size, :] = 1 # start = start + row_gap_size + row_start # start = col_start # for j in range(1, col_num_gaps + 1): # mask[:, start:start + col_gap_size] = 1 # start = start + col_gap_size + col_start # # return 1 - mask # def arcmask(img, cen, Rrange, Thetarange): # mask = np.zeros_like(img) # #print cen, Rrange,Thetarange # if min(Rrange)==0: # cv2.ellipse(mask, (int(cen[0]),int(cen[1])), (int(max(Rrange)),int(max(Rrange))), 0, min(Thetarange), int(max(Thetarange)), 255, -1) # else: # cv2.ellipse(mask, (int(cen[0]),int(cen[1])), (int(min(Rrange)),int(min(Rrange))), 0, min(Thetarange), int(max(Thetarange)), 255, int(max(Rrange)-min(Rrange))) # #cv2.ellipse(mask,(256,256),(100,50),0,0,180,255,-1) # # plt.imshow(mask) # plt.show() # return mask/255 def arcmask(img, cen, Rrange, Thetarange): y, x = np.indices((img.shape)) r = np.sqrt((x - cen[0]) ** 2 + (y - cen[1]) ** 2) theta = np.arctan2(y - cen[1], x - cen[0]) / (2 * np.pi) * 360.0 mask = ((min(Rrange) < r) & (r < max(Rrange)) & (min(Thetarange) < theta) & (theta < max(Thetarange))) #plt.imshow(mask) #plt.show() return mask def scanforarcs(radialprofile, cen): # h = 35 # radialprofile=signal.convolve(radialprofile,signal.gaussian(h, std=8)) # test = np.max(radialprofile) / h #print 't', test peakmax, peakmin = peakfindingrem.peakdet(range(len(radialprofile)), radialprofile, 10) peakind = peakmax[:, 0] # for i in range(np.size(peakind)): # plt.axvline(peakind[i],color='b') # plt.plot(radialprofile) # plt.show() # accurancy = 50 # x = np.zeros((np.size(peakind), accurancy)) #y = np.zeros((np.size(peakind), accurancy)) #xinf = np.zeros((np.size(peakind), accurancy)) #yinf = np.zeros((np.size(peakind), accurancy)) #xsup = np.zeros((np.size(peakind), accurancy)) #ysup = np.zeros((np.size(peakind), accurancy)) # for i in range(0, np.size(peakind)): #Delta = peakind[i] / 10 #theta = np.linspace(0, 2 * np.pi, accurancy) #x[i] = cen[0] + (peakind[i]) * np.cos(theta) #y[i] = cen[1] + (peakind[i]) * np.sin(theta) #xinf[i] = cen[0] + (peakind[i] - Delta) * np.cos(theta) #xsup[i] = cen[0] + (peakind[i] + Delta) * np.cos(theta) #yinf[i] = cen[1] + (peakind[i] - Delta) * np.sin(theta) #ysup[i] = cen[1] + (peakind[i] + Delta) * np.sin(theta) return peakind def mirroredgaussian(theta, a, b, c, d): val = (gaussian(theta, a, b, c, d) + gaussian(2 * np.pi - theta, a, b, c, d)) / 2. return val def gaussian(x, a, b, c, d): val = abs(a) * np.exp(-(x - b) ** 2. / c ** 2.) + abs(d) return val def vonmises(x, A, mu, kappa): return A * scipy.stats.vonmises.pdf(2 * (x - mu), kappa) def mirroredvonmises(x, A, mu, kappa, floor): return A * (scipy.stats.vonmises.pdf(2 * (mu - x), kappa) + scipy.stats.vonmises.pdf(2 * (mu - x), kappa)) / 2 + floor # 2*(mu-(np.pi-x)) tworoot2ln2 = 2. * np.sqrt(2. * np.log(2.)) def residual(params, x, data): A = params['A'].value mu = params['mu'].value kappa = params['kappa'].value floor = params['floor'].value model = mirroredvonmises(x, A, mu, kappa, floor) return data - model def gaussianresidual(params, x, data, sig=1): A = params['A'].value mu = params['mu'].value sigma = params['sigma'].value floor = params['floor'].value model = gaussian(x, A, mu, sigma, floor) resids = data - model # print resids weighted = np.sqrt(resids ** 2 / sig ** 2) return weighted def findgisaxsarcs(img, cen, experiment): radialprofile = integration.pixel_2Dintegrate(img, (cen[1], cen[0]), experiment.mask) # arcs = scanforarcs(radialprofile, cen) arcs = peakfinding.findpeaks(None, radialprofile, (100, 50), gaussianwidthsigma=3, minimumsigma=100) # print arcs plt.plot(radialprofile) plt.plot(arcs[0], arcs[1], 'ok') #plt.show() arcs = arcs[0] output = [] _, unique = np.unique(arcs, return_index=True) for qmu in arcs[unique]: chiprofile = np.nan_to_num(integration.chi_2Dintegrate(img, (cen[1], cen[0]), qmu, mask=experiment.mask)) plt.plot(np.arange(0, np.pi, 1 / 30.), chiprofile, 'r') # filter out missing chi missingpointfloor = np.percentile(chiprofile, 15) badpoints = np.where(chiprofile < missingpointfloor)[0] goodpoints = np.where(chiprofile >= missingpointfloor)[0] chiprofile[badpoints] = np.interp(badpoints, goodpoints, chiprofile[goodpoints]) plt.plot(np.arange(0, np.pi, 1 / 30.), chiprofile, 'k') # f=rfft(chiprofile) # plt.plot(f) # f[-20:]=0 # chiprofile=irfft(chiprofile) try: params = Parameters() params.add('A', value=np.max(chiprofile), min=0) params.add('mu', value=np.pi / 2, min=0, max=np.pi) params.add('kappa', value=0.1, min=0) params.add('floor', value=0.1, min=0) x = np.arange(0, np.pi, 1 / 30.) out = minimize(residual, params, args=(x, chiprofile)) print params # print params['A'].stderr # popt, pcov = optimize.curve_fit(vonmises, np.arange(0, np.pi, 1 / 30.), np.nan_to_num(chiprofile), # # print(popt) except RuntimeError: print('Fit failed at ' + qmu) continue if params['kappa'].stderr > 100 or params['A'].stderr > 100: isring = True else: isring = False popt = [params['A'].value, params['mu'].value, params['kappa'].value, params['floor'].value] A, chimu, kappa, baseline = popt FWHM = np.arccos(np.log(.5 * np.exp(kappa) + .5 * np.exp(-kappa)) / kappa) output.append([qmu, A, chimu, FWHM, baseline, isring]) # plt.plot(np.arange(0, np.pi, 1 / 30.), chiprofile) # plt.plot(np.arange(0, np.pi, 1 / 30.), mirroredvonmises(np.arange(0, np.pi, 1 / 30.), *popt)) # plt.show() return output def inpaint(img,mask): filled = None if False: img = img / (2 ^ 16 - 1) * 255 plt.imshow(img.astype(np.uint8)) plt.show() plt.imshow(mask) #TODO: check that mask corners are correct plt.show() kernel = np.ones((3, 3),np.uint8) mask = cv2.dilate(mask.astype(np.uint8), kernel, iterations=1) filled = cv2.inpaint(img.astype(np.uint8), mask.astype(np.uint8), 3, cv2.INPAINT_TELEA) plt.imshow(img) plt.show() return elif True: valid = ~mask.astype(np.bool) coords = np.array(np.nonzero(valid)).T values = img[valid] it = interpolate.LinearNDInterpolator(coords, values) filled = it(list(np.ndindex(img.shape))).reshape(img.shape) plt.imshow(np.rot90(filled)) plt.show() return filled def findmaxs(orig): img = orig.copy() img = filters.gaussian_filter(img, 3) img = filters.minimum_filter(img, 4) img = filters.median_filter(img, 4) img -= np.min(img) img = denoise_bilateral(img, sigma_range=0.5, sigma_spatial=15) # plt.imshow(np.rot90(img)) #plt.show() #img = filters.percentile_filter(img,50,50) maxima = ((img == filters.maximum_filter(img, (10, 10))) & ( filters.maximum_filter(img, (50, 50)) > 1.5 * filters.minimum_filter(img, (50, 50))) & (img > 2)) maximachis, maximaqs = np.where(maxima == 1) plt.imshow(np.rot90(orig), interpolation='nearest') plt.plot(maximachis, 1000 - maximaqs, 'o', markersize=10, markeredgecolor='red', markerfacecolor="None", mew="4") plt.ylim([1000, 0]) plt.xlim([0, 1000]) plt.show() return maximachis, maximaqs def fitarc(chiprofile): try: params = Parameters() params.add('A', value=np.max(chiprofile), min=0) params.add('mu', value=np.pi / 2, min=0, max=np.pi) params.add('kappa', value=0.1, min=0) params.add('floor', value=0.1, min=0) x = np.arange(0, np.pi, 1 / 30.) out = minimize(residual, params, args=(x, chiprofile)) print params # print params['A'].stderr # popt, pcov = optimize.curve_fit(vonmises, np.arange(0, np.pi, 1 / 30.), np.nan_to_num(chiprofile), # p0=[np.max(np.nan_to_num(chiprofile)), np.pi / 2, .1, 0]) # print(popt) except RuntimeError: print('Fit failed.') if params['kappa'].stderr > 100 or params['A'].stderr > 100: isring = True else: isring = False popt = [params['A'].value, params['mu'].value, params['kappa'].value, params['floor'].value] A, chimu, kappa, baseline = popt FWHM = np.arccos(np.log(.5 * np.exp(kappa) + .5 * np.exp(-kappa)) / kappa) return A, chimu, FWHM, baseline, isring def fitarcgaussian(chiprofile, chi): try: params = Parameters() x = np.arange(np.size(chiprofile)) roi = np.ones_like(chiprofile) roi[chi - 30:chi + 30] = .0001 # roi/=1000 # plt.plot(chiprofile,'') #plt.plot(roi * np.max(chiprofile * roi), 'g') #plt.plot(roi*chiprofile,'k') params.add('A', value=np.max(chiprofile * (1 - roi)), min=0) params.add('mu', value=chi, min=0, max=len(chiprofile)) params.add('sigma', value=20, min=0) params.add('floor', value=0.1, min=0) out = minimize(gaussianresidual, params, args=(x, chiprofile, roi), method='nelder') #print params # print params['A'].stderr # popt, pcov = optimize.curve_fit(vonmises, np.arange(0, np.pi, 1 / 30.), np.nan_to_num(chiprofile), # p0=[np.max(np.nan_to_num(chiprofile)), np.pi / 2, .1, 0]) # print(popt) except RuntimeError: print('Fit failed.') if params['sigma'].stderr > 100 or params['A'].stderr > 100: isring = False #True else: isring = False popt = [params['A'].value, params['mu'].value, params['sigma'].value, params['floor'].value] #plt.plot(x, gaussian(x, *popt), 'r') # plt.show() # A, chimu, sigma, baseline = popt # FWHM = sigma * tworoot2ln2 return popt def findgisaxsarcs2(img, experiment): img = img.T.copy() cake, _, _ = integration.cake(img, experiment, mask=experiment.mask) # TODO: refactor these parameters and check .T maskcake, _, _ = integration.cake(experiment.mask.T, experiment) from fabio import edfimage fabimg = edfimage.edfimage(cake) filename = 'cake.edf' fabimg.write(filename) fabimg = edfimage.edfimage(maskcake) filename = 'cake_MASK.edf' fabimg.write(filename) img = inpaint(cake, maskcake) fabimg = edfimage.edfimage(img) filename = 'cake_LINEAR_INFILL.edf' fabimg.write(filename) maxchis, maxqs = findmaxs(img) out =[] for chi, q in zip(maxchis, maxqs): # roi=np.ones_like(img) #roi[chi - 10:chi + 10, q - 5:q + 5]=10 #roi=np.sum(roi,axis=1) slice = img[:, q - 5:q + 5] if np.max(slice) / np.min(slice) < 2: pass # continue chiprofile = np.sum(slice, axis=1) x = np.arange(np.size(chiprofile)) #plt.plot(chiprofile) params = fitarcgaussian(chiprofile, chi) if params['mu'] > chi + 5 or params['mu'] < chi - 5: continue params.add('q', value=q) out.append(params) #plt.show() # plt.imshow(np.log(img)) #plt.show() return out if __name__ == "__main__": import xicam.config experiment = xicam.config.experiment() experiment.setvalue('Detector', 'pilatus2m') experiment.setvalue('Pixel Size X',172e-6) experiment.setvalue('Pixel Size Y', 172e-6) experiment.mask = experiment.getDetector().calc_mask() for imgpath in glob.glob(os.path.join("../GISAXS samples/", '*.edf')): print "Opening", imgpath # read image img = fabio.open(imgpath).data # find center # cen = center_approx.center_approx(img) cen = center_approx.gisaxs_center_approx(img) experiment.setcenter(cen) arcs = findgisaxsarcs2(img, experiment) # print cen # print arcs ax = plt.gca() plt.axvline(cen[0], color='r') plt.axhline(cen[1], color='r') plt.imshow(np.log(img)) from matplotlib.patches import Arc qratio =1.78 for arc in arcs: print arc if not np.isnan(arc['sigma'].value): if False: arcartist = [Arc(xy=cen, width=arc['q'] * 2, height=arc['q'] * 2, angle=-90, theta1=0, theta2=360)] # Arc ax.add_artist(arcartist[0]) arcartist[0].set_lw(3) else: angle = -arc['mu'].value / 1000 * 360 theta1 = -abs(arc['sigma'].value * tworoot2ln2) / 1000 * 360 / 2 theta2 = abs(arc['sigma'].value * tworoot2ln2) / 1000 * 360 / 2 arcartist = [ Arc(xy=cen, width=arc['q'].value * 2 * qratio, height=arc['q'].value * 2 * qratio, angle=angle, theta1=theta1, theta2=theta2)] # Arc for artist in arcartist: ax.add_artist(artist) artist.set_lw(3) # for i in range(1, np.size(x, 0)): # plt.plot(y[i], x[i], color='g') # plt.plot(yinf[i], xinf[i], color='r') # plt.plot(ysup[i], xsup[i], color='r') plt.show() # popt, pcov = optimize.curve_fit(gaussian, np.arange(np.size(a)), np.nan_to_num(a)) # print("Scale = %.3f +/- %.3f" % (popt[0], np.sqrt(pcov[0, 0]))) #print("Offset = %.3f +/- %.3f" % (popt[1], np.sqrt(pcov[1, 1]))) #print("Sigma = %.3f +/- %.3f" % (popt[2], np.sqrt(pcov[2, 2]))) # print(vimodel.A) # print vimodel.mu # print vimodel.FWHM # find arcs # arcs = find_arcs(img, cen) #draw arcs #drawarcs(img,arcs)
python
Suspected Israeli airstrikes targeted the Syrian province of Homs early on Saturday, state media reported. Syria's state news agency, SANA, said the country's air defences responded to Israeli missiles in the sky over Homs and shot down some of them. It was not immediately clear if there were any casualties. The Britain-based opposition war monitor Syrian Observatory for Human Rights said Israeli missiles had destroyed an ammunition depot belonging to the Lebanese militant group Hezbollah at a military airport in the countryside of Homs. The observatory said it was the second time Israel targeted the site in a month. On April 2, state media reported Israeli airstrikes hit several sites in Homs, wounding five soldiers. The observatory said two Hezbollah members were killed by the earlier attrack. There was no immediate statement from Israeli authorities on the strikes, Israel, which has vowed to stop Iranian entrenchment next door, has carried out hundreds of strikes on targets in government-controlled parts of neighboring Syria in recent years, but rarely acknowledges them. Earlier this year, suspected Israeli strikes in Syria intensified, culminating in an exchange on the border on April 8, when the Israeli military said its forces attacked targets in Syria after six rockets were launched from southern Syria toward the Israeli-occupied Golan Heights. On Monday, Syrian pro-government media said Israel shelled targets in southern Syria near the Golan Heights, causing unspecified material damage.
english
<filename>client/ws-client/src/main/java/com/nortal/sk/client/ws/processor/WsAuthProcessor.java package com.nortal.sk.client.ws.processor; import com.nortal.sk.client.processor.StateHolder; public interface WsAuthProcessor extends WsProcessor<StateHolder> { }
java
Last week, we brought you six of the best tech books of 2017, which you promptly purchased in bulk as last-minute holiday gifts for your loved ones. No? Well, here’s another chance. We’re back this week with five more recommendations to close out the year. This week’s books take a turn for the historical: Leslie Berlin and Noam Cohen offer complementary histories of Silicon Valley and the key personalities that define it today, while Brian Dear takes a deep dive into PLATO, a prescient 1960s-era computer network that enjoyed a brief heyday on college campuses before fading into obscurity. It’s not all about the past. Rachel Botsman looks at how modern technology is rapidly reworking centuries-old networks of trust, and Jean Twenge highlights several surprising trends defining the lives of today’s adolescents. In case you missed it, be sure to check out our first six recommendations, which include a look at the darker side of the Instagram influencer economy and a portrait of a WWII-era woman codebreaker who, until now, has gone largely uncredited for her groundbreaking work. Happy reading! Social networks, news on your screen, multiplayer online games, porn, hacking: Virtually all of the stuff that makes up today’s internet could be found 40 years ago on a once-groundbreaking, now-mostly-forgotten computer network called PLATO. Conceived in the 1960s at the University of Illinois at Urbana-Champaign as a form of computer-assisted education, PLATO flourished on many campuses in the 1970s: It gave the first generation of teen geeks a free-play zone in which they could send messages, play pranks on one another, and dream of new frontiers for human-computer interaction. You've probably never heard of PLATO. Its technology was advanced—plasma graphics and touch-screens, in the 1960s!—but it depended on mainframe computer systems that would soon be outmoded, and the personal computer revolution turned it into a backwater, cut off from the digital mainstream. Author Brian Dear is determined to remedy PLATO’s obscurity, and his groundbreaking, exhaustive history, The Friendly Orange Glow, is a lovingly detailed biography of both the system and the subculture that it fostered. Dear’s book will let PLATO take its rightful place among digital-history milestones such as Douglas Engelbart’s “Mother of all Demos,” Xerox PARC’s graphical innovations, and the WELL’s pioneering online community. It’s a tired cliche that each generation looks at the next with a mixture of bewilderment and disgust. But after reading iGen, Jean Twenge’s exploration of Generation Z (the next group to come of age after my cohort, the Millennials) I’m genuinely perplexed. What is going on with kids today? “iGen” is Twenge’s shrewd nickname for this first fully wired generation. Born in 1995 and later, iGen’s childhood and adolescence have been permeated by technology. Smartphones are a ubiquitous presence; for them there is no time before the internet. Twenge combines national demographic data with scattered interviews to find commonalities across race and socioeconomic lines. Reader, these core qualities are shocking. Each generation is supposed to grow up faster than the last, but iGen bucks this trend. Today’s teens are less likely to date, to drive, to drink alcohol, and to be sexually active than teens from earlier generations. There’s also this horrifying fact: They don’t really fight with their parents. What teenagers are these? What is going on? Twenge points to smartphones. “The devices they hold in their hand have both extended their childhoods and isolated them from true human contact,” she writes. According to Twenge, this delayed maturity makes them ill-equipped to enter adulthood. The tech industry’s leadership has a well-documented love for intellectual puzzles, IQ tests, and quantitative reasoning. In The Know-It-Alls, former New York Times columnist Noam Cohen identifies this trait as both a connecting thread and an Achilles heel for the titans of Silicon Valley. On the one hand, he writes, their belief in a benign fusion of hacker sensibilities and entrepreneurial business unlocked wealth and power and built a massive new economy. On the other, their idolization of reason over emotion and individualism over the collective good has left them with dangerous blind spots in applying their knowledge on a wider social and political stage. And we’re just beginning to reckon with their cost. How did Silicon Valley become the world’s most bountiful producer of cutting-edge tech and the riches that spring from it? Leslie Berlin delightfully answers the question by producing a web of intertwined profiles of seven people who played key but relatively unsung roles in the region’s rise during the late 1970s through the 1980s. That’s the period that saw the personal computer revolution, the foundations of the internet, the institutionalization of venture capital, the creation and monetization of biotech, and—this is a surprise—the opening of opportunities to women like engineer and ASK founder Sandra Kurtzig, who was the first woman to take a Silicon Valley company public. (Only in the latter area has the Valley gone backwards.) The great promise of the internet is that it would bring us together, but as 2017 draws to a close, there’s evidence everywhere that it may be doing the opposite. Rachel Botsman believes this is a trust problem. Trust, which Botsman defines as a confident relationship with the unknown, is the currency that allows us to live among each other—conduct business; raise children; shore up our democracy. For centuries, we’ve depended on institutions like churches, governments, and the New York Times to confer that trust. Now, we’re rapidly losing faith in our institutions. How, then, can we figure out who is trustworthy?
english
Feedback (2) Best Cargo Consolidation Meaning Service – International Air Transport – ZHYT LOGISTICS Detail: Product detail pictures: Related Product Guide: We are experienced manufacturer. Wining the majority of the crucial certifications of its market for Best Cargo Consolidation Meaning Service – International Air Transport – ZHYT LOGISTICS , The product will supply to all over the world, such as: Nepal, Ireland, Grenada, Most problems between suppliers and clients are due to poor communication. Culturally, suppliers can be reluctant to question items they do not understand. We break down people barriers to ensure you get what you want to the level you expect, when you want it. Faster delivery time and the product you want is our Criterion . Goods just received, we are very satisfied, a very good supplier, hope to make persistent efforts to do better.
english
<reponame>rBurgett/voluntaryvixens.com { "TITLE": "Episode 75 - Sandwiches and Satire with Robbie the Fire", "NUMBER": 75, "DESCRIPTION": "This week the Vixens are joined by comedian and podcast host, Robbie \"The Fire\" Bernstein to discuss female humor in comedy vs. the real world, sandwiches and other important life skills.", "CONTENT": "This week the Vixens are joined by comedian and podcast host, Robbie \"The Fire\" Bernstein to discuss female humor in comedy vs. the real world, sandwiches and other important life skills.", "IMAGE": "", "ITUNES_IMAGE": "", "FILE": "vv_0075.mp3", "DATE": "2021-03-11T12:30:33.175Z", "EXPLICIT": true }
json
Pixar's latest feature film has set a new Disney Plus movie record just one week after it was broken by The Little Mermaid. The Little Mermaid's live-action remake has proven to be incredibly popular since its Disney Plus debut on September 6. The Little Mermaid's live-action remake is set to make a splash on Disney's main streaming service very soon. The great Disney composer talks working with Lin-Manuel Miranda on the new songs. Ranked From Alice in Wonderland to The Little Mermaid, here's every Disney live-action film remake, ranked from worst to best. Rob Marshall tells us about 3 movies that had an impact on his new version of a classic, and 2 that didn't. Get the hottest deals available in your inbox plus news, reviews, opinion, analysis and more from the TechRadar team.
english
The Central Board of School Education (CBSE) declared a special marking scheme for Class 10 students in its associated schools on Saturday after the Class 10 Board exams were cancelled this year due to the Covid-19 pandemic. The results, which will be released on June 20, will be based on students’ success in unit exams, the half-yearly assessment, and other factors. The Board declared Saturday the results of the pre-Board examination conducted by colleges, as well as the results of the pre-Board examination conducted by schools. The unit test will be worth 10 points, the mid-term assessment will be worth 30 points, and the pre-Board examination will be worth 40 points, for a total of 80 points. According to CBSE rules, the remaining 20 marks will be used for school-based internal evaluation. The three categories — unit test, mid-term exam, and pre-Board exams — were used to describe the special marking scheme, according to the Board, since they are common to most CBSE-affiliated schools. To parse the results, all CBSE schools have been instructed to form an internal result committee comprised of the principal and seven teachers. If a school has administered more than one test or exam in each of the three categories, the resulting committee will be free to assign a weighting to each test/exam within that category, subject to the total maximum marks awarded to that category. “For example, if a school has completed two or three pre-Board exams, it will decide to take the average of the three exams, take the best performance in the three tests, or assign each exam a weightage as considered appropriate,” according to the Board’s notice. The Board has told schools that the marks awarded “shall be in consonance” with the school’s past performance in the Class 10 Board exams, in order to prevent mark inflation. Schools have been given until May 25 to finalise their results and send them to the Board by June 5. By June 11, the internal appraisal marks (out of 20) must be submitted. On June 20, the CBSE will release the Class results. According to the CBSE notice, any applicant who is dissatisfied with the marks assigned to him or her will be given the opportunity to sit in an exam as and when the conditions are conducive to holding the exams. The announcement of the special marking scheme comes only two weeks after the Union government cancelled the Class 10 exams due to rising concerns about a Covid-19 outbreak in the region. On the other hand, the Class 12 Board exams have been postponed, and the Education Ministry will review the situation on June 1 to determine new dates and make an announcement at least two weeks before the exams begin. The post CBSE Board Class 10th result will be release on 20 June 2021, Check new marking scheme appeared first on Breaking News For Engineering MBA Medical Law Entrance Exams.
english
package roles import ( "strconv" "github.com/starshine-sys/bcr" ) func (bot *Bot) setRoles(ctx *bcr.Context) (err error) { id, err := strconv.ParseInt(ctx.Args[0], 0, 0) if err != nil { _, err = ctx.Replyc(bcr.ColourRed, "Couldn't parse your input as an ID.") return } cat, err := bot.categoryID(ctx.Guild.ID, id) if err != nil { _, err = ctx.Replyc(bcr.ColourRed, "No category with that ID found.") } roles, _ := ctx.GreedyRoleParser(ctx.Args[1:]) var ids []uint64 for _, r := range roles { ids = append(ids, uint64(r.ID)) } err = bot.categoryRoles(cat.ID, ids) if err != nil { return bot.Report(ctx, err) } _, err = ctx.Reply("Roles in %v updated!", cat.Name) return }
go
What is translation in biology? After transcription, it is the second part of the central dogma of molecular biology, which describes the use of a genetic code for the manufacture of amino acid chains. Three major molecular classes of ribonucleic acid (RNA) are involved in the expression of genes that are encoded in the deoxyribonucleic acid (DNA) of the cell. It: - Information RNA (mRNA) - Portable RNA (tRNA) - Ribosomal RNA (rRNA) During translation, the first two kinds of RNA play a special role. In biology, translation is a complex process, during which the protein is synthesized from the information contained in the RNA molecule (mRNA). The sequence of mRNA is read using a genetic code. The translation itself occurs in a structure called the ribosome, which is a kind of factory for the synthesis of proteins. This cell organelle has small and large subunits and is a complex molecule consisting of several ribosomal RNA molecules, as well as a number of proteins. What is translation in biology? Translation is the second step after transcription. During these processes, the genetic code is converted into amino acids that are linked together by peptide bonds. Chains of amino acids are called polypeptides and are located inside the ribosomes, tiny organelle cells, which play an important role in the process of protein synthesis. The following definition can be given: translation in biology is a cellular process in which chains of amino acids are formed by decoding. Synthesis of the protein occurs in the cytoplasm, where the ribosomes are located. What is translation in biology and how is the assembly of the polypeptide actually going on? There are three important steps - initiation, elongation and termination. The same terms are also used in transcription to describe the stages of creating an RNA chain. The zero phase is activation, when the desired amino acid covalently binds to a suitable RNA (tRNA) and becomes "charged". Although this is not technically a stage of broadcasting, this step is just as necessary as all subsequent ones. So, consider the stages of translation in biology in more detail: - Initiation. At this stage, mRNA is attached to tRNA, which is attached to said amino acid. All together, they combine in a ribosome. - Elongation. This is the relative elongation by the addition of amino acids, accompanied by the formation of peptide bonds. Ultimately, a polypeptide is created. The process of addition continues again and again until the chain reaches its limit, and this is about a hundred amino acids. - Termination. When the signal for the completion of biosynthesis is obtained, the polypeptide is separated from the ribosome. When a new protein is released, the entire translation complex breaks up. What is translation in biology? This is a very complex and simultaneously surprisingly harmonious and precise process, which includes many components. All movements, reactions and other manipulations are perfectly coordinated. The transformation of genes into proteins essentially takes place in two stages: transcription and translation. Despite the fact that during the first no synthesis of protein does not occur, without it, the second is not possible. Translation is the final stage in the implementation of information at the gene level. This process can only take place in living cells and it is much more complicated than the previous matrix syntheses of replication and transcription. All kinds of RNA, twenty kinds of amino acids, various enzymes and so on are involved in the translation. The dominant center of all events is a cellular organelle, like a ribosome. An amazing fact is the coherence of the work of all interacting elements of protein biosynthesis: the specificity of many enzymes is directed toward mutual recognition at the molecular level. Even accidentally detected malfunctions and errors are instantly eliminated by those enzymes that, in principle, do not answer for them. As the cellular ribosomes move along the information RNA, its starting site is gradually released, to which another ribosome joins. And the number of such organelles, working simultaneously on the same molecule, can reach several tens. Thus, only one matrix base is used to synthesize a number of molecular duplexes of the polypeptide. Such a beneficial cooperation has been called a polyribosome (polysome). Depending on what proteins are needed for a particular cell or the whole organism, there is a multi-stage polypeptide biosynthesis controlled by genes and some regulatory mechanisms that operate smoothly and consistently at certain stages of the release of genetic information, including during translation.
english