text
stringlengths
1
1.04M
language
stringclasses
25 values
<filename>11/Kleine Anfrage/11-158078.json { "vorgangId": "158078", "VORGANG": { "WAHLPERIODE": "11", "VORGANGSTYP": "Kleine Anfrage", "TITEL": "Umfang der Hermes-Kredite an die Dritte Welt (G-SIG: 11000355)", "INITIATIVE": "Fraktion Die Grünen", "AKTUELLER_STAND": "Beantwortet", "SIGNATUR": "", "GESTA_ORDNUNGSNUMMER": "", "WICHTIGE_DRUCKSACHE": [ { "DRS_HERAUSGEBER": "BT", "DRS_NUMMER": "11/263", "DRS_TYP": "Kleine Anfrage", "DRS_LINK": "http://dipbt.bundestag.de:80/dip21/btd/11/002/1100263.pdf" }, { "DRS_HERAUSGEBER": "BT", "DRS_NUMMER": "11/368", "DRS_TYP": "Antwort", "DRS_LINK": "http://dipbt.bundestag.de:80/dip21/btd/11/003/1100368.pdf" } ], "EU_DOK_NR": "", "SACHGEBIET": [ "Wirtschaft", "Entwicklungspolitik" ], "SCHLAGWORT": [ "Afrika", "Dritte Welt", "Entwicklungsland", "Geld und Kredit", { "_fundstelle": "true", "__cdata": "Hermes-Kreditversicherungs-AG" }, "Schulden" ], "ABSTRAKT": "Gesamtsumme, Art und Aufteilung der von der Bundesregierung entschädigten und noch nicht zurückgeflossenen Forderungen gegenüber Staaten der Dritten Welt aus Hermes-Bürgschaften; Umschuldungen und deren Konditionen; Bereitschaft zum Schuldenerlaß; Verbesserung der Rückzahlungsmodalitäten für afrikanische Länder " }, "VORGANGSABLAUF": { "VORGANGSPOSITION": [ { "ZUORDNUNG": "BT", "URHEBER": "Kleine Anfrage, Urheber : Fraktion Die Grünen ", "FUNDSTELLE": "11.05.1987 - BT-Drucksache 11/263", "FUNDSTELLE_LINK": "http://dipbt.bundestag.de:80/dip21/btd/11/002/1100263.pdf", "PERSOENLICHER_URHEBER": { "PERSON_TITEL": "Dr.", "VORNAME": "Ludger", "NACHNAME": "Volmer", "FUNKTION": "MdB", "FRAKTION": "Die Grünen", "AKTIVITAETSART": "Kleine Anfrage" } }, { "ZUORDNUNG": "BT", "URHEBER": "Antwort, Urheber : Bundesregierung, Bundesministerium für Wirtschaft (federführend)", "FUNDSTELLE": "27.05.1987 - BT-Drucksache 11/368", "FUNDSTELLE_LINK": "http://dipbt.bundestag.de:80/dip21/btd/11/003/1100368.pdf" } ] } }
json
<filename>libs/core/src/lib/message-page/message-page.module.ts import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { MessagePageComponent } from './message-page.component'; import { MessagePageActionsComponent } from './message-page-actions/message-page-actions.component'; import { MessagePageMoreComponent } from './message-page-more/message-page-more.component'; import { MessagePageTitleComponent } from './message-page-title/message-page-title.component'; import { MessagePageSubtitleComponent } from './message-page-subtitle/message-page-subtitle.component'; @NgModule({ declarations: [ MessagePageComponent, MessagePageActionsComponent, MessagePageMoreComponent, MessagePageTitleComponent, MessagePageSubtitleComponent ], imports: [CommonModule], exports: [ MessagePageComponent, MessagePageActionsComponent, MessagePageMoreComponent, MessagePageTitleComponent, MessagePageSubtitleComponent ] }) export class MessagePageModule {}
typescript
<gh_stars>0 const { response } = require('express'); const UserSchema = require('../models/user'); const { calculateDewPoint, calculateSunsetSunriseQuality, removeDiacritics } = require('../models/sunsetCalculator'); //TODO: posiblemente cambie const axios = require('axios'); module.exports = { // Add a new site to the user's list of sites addSite: async ( req, res = response ) => { // First we verify that the user exists, if not, we register it. const { id, name, email } = req.body; let user = await UserSchema.findOne({ id }); if(!user) { user = new UserSchema({ id, name, email, sites: [] }); try { await user.save(); console.log(`User created with id: ${user._id}`); } catch ( err ) { res.status(503).send(`Error: ${err.message}`); console.log(err.message); } } // We check that the cities we receive are not already had by the user let sites = req.body.sites; sites = sites.filter(val => !user.sites.includes(val)); // We save sites Array.prototype.push.apply(user.sites, sites); await user.save() .then( res.status(200).send("List updated") ) .catch( err => handleError(err) ); }, //Remove a site from the list removeSite: async (req, res = response) => { const { id, name, email } = req.body; let user = await UserSchema.findOne({ id }); let sites = req.body.sites; let oldsites = user.sites; sites = oldsites.filter(elem => !sites.includes(elem)); // filter the site to be removed user.sites = sites; //replace the old array with a new one and save await user.save() .then( res.status(200).send("List updated") ) .catch( err => handleError(err) ); }, updateSite: async (req, res = response) => { // const { id, name, email } = req.body; // let user = await UserSchema.findOne({ id }); // // We check that the cities we receive are not already had by the user // let site_update = req.body.sites; // let oldsites = user.sites; // sites = oldsites.filter(elem => !sites.includes(elem)); // // We save sites // user.sites = sites; // await user.save() // .then( // res.status(200).send("List updated") // ) // .catch( // err => handleError(err) // ); }, getSites: async ( req, res = response ) => { const { id } = req.body; let user = await UserSchema.findOne({ id }); const key = process.env.KEY; let info = []; if (user) { user.sites.forEach( site => { // We eliminate diacritics let url_site = site.split(' ').join('%20'); url_site = removeDiacritics(url_site); let url = `http://api.weatherapi.com/v1/forecast.json?key=${key}&q=${url_site}&days=5&aqi=yes&alerts=no`; axios.get(url).then( resp => { // We calculate if it is a good sunrise let currentDaySunrise = calculateSunsetSunriseQuality( resp.data.forecast.forecastday[0].hour[6].cloud, resp.data.forecast.forecastday[0].hour[6].temp_c, resp.data.current.air_quality["us-epa-index"], resp.data.forecast.forecastday[0].hour[6].humidity, resp.data.forecast.forecastday[0].hour[6].wind_kph, resp.data.forecast.forecastday[0].hour[6].precip_mm, resp.data.current.vis_km ); // We calculate if it is a good sunset let currentDaySunset = calculateSunsetSunriseQuality( resp.data.forecast.forecastday[0].hour[18].cloud, resp.data.forecast.forecastday[0].hour[18].temp_c, resp.data.current.air_quality["us-epa-index"], resp.data.forecast.forecastday[0].hour[18].humidity, resp.data.forecast.forecastday[0].hour[18].wind_kph, resp.data.forecast.forecastday[0].hour[18].precip_mm, resp.data.current.vis_km ); let site_info = { name: site, last_days: [ { date: resp.data.forecast.forecastday[0].date, sunrise: resp.data.forecast.forecastday[0].astro.sunrise, sunrise_temp: resp.data.forecast.forecastday[0].hour[6].temp_c, good_sunrise: currentDaySunrise, sunset: resp.data.forecast.forecastday[0].astro.sunset, sunset_temp: resp.data.forecast.forecastday[0].hour[18].temp_c, good_sunset: currentDaySunset }, { date: resp.data.forecast.forecastday[1].date, sunrise: resp.data.forecast.forecastday[1].astro.sunrise, sunrise_temp: resp.data.forecast.forecastday[1].hour[6].temp_c, sunset: resp.data.forecast.forecastday[1].astro.sunset, sunset_temp: resp.data.forecast.forecastday[1].hour[18].temp_c, }, { date: resp.data.forecast.forecastday[2].date, sunrise: resp.data.forecast.forecastday[2].astro.sunrise, sunrise_temp: resp.data.forecast.forecastday[2].hour[6].temp_c, sunset: resp.data.forecast.forecastday[2].astro.sunset, sunset_temp: resp.data.forecast.forecastday[2].hour[18].temp_c, } ] }; // console.log(site_info); info.push(site_info); console.log(info); }) .catch( err => { console.log(err); }) }); console.log(info); res.status(200).json(info); } }, // Obtain information from a specific site getSite: async ( req, res = response ) => { const { city_name } = req.body; const key = process.env.KEY; const url = `http://api.weatherapi.com/v1/forecast.json?key=${key}&q=${city_name}&days=5&aqi=yes&alerts=no`; axios.get(url).then( resp => { // We calculate if it is a good sunrise let currentDaySunrise = calculateSunsetSunriseQuality( resp.data.forecast.forecastday[0].hour[6].cloud, resp.data.forecast.forecastday[0].hour[6].temp_c, resp.data.current.air_quality["us-epa-index"], resp.data.forecast.forecastday[0].hour[6].humidity, resp.data.forecast.forecastday[0].hour[6].wind_kph, resp.data.forecast.forecastday[0].hour[6].precip_mm, resp.data.current.vis_km ); // We calculate if it is a good sunset let currentDaySunset = calculateSunsetSunriseQuality( resp.data.forecast.forecastday[0].hour[18].cloud, resp.data.forecast.forecastday[0].hour[18].temp_c, resp.data.current.air_quality["us-epa-index"], resp.data.forecast.forecastday[0].hour[18].humidity, resp.data.forecast.forecastday[0].hour[18].wind_kph, resp.data.forecast.forecastday[0].hour[18].precip_mm, resp.data.current.vis_km ); // Create a new JSON object array let info = [ { date: resp.data.forecast.forecastday[0].date, sunrise: resp.data.forecast.forecastday[0].astro.sunrise, sunrise_temp: resp.data.forecast.forecastday[0].hour[6].temp_c, good_sunrise: currentDaySunrise, sunset: resp.data.forecast.forecastday[0].astro.sunset, sunset_temp: resp.data.forecast.forecastday[0].hour[18].temp_c, good_sunset: currentDaySunset }, { date: resp.data.forecast.forecastday[1].date, sunrise: resp.data.forecast.forecastday[1].astro.sunrise, sunrise_temp: resp.data.forecast.forecastday[1].hour[6].temp_c, sunset: resp.data.forecast.forecastday[1].astro.sunset, sunset_temp: resp.data.forecast.forecastday[1].hour[18].temp_c, }, { date: resp.data.forecast.forecastday[2].date, sunrise: resp.data.forecast.forecastday[2].astro.sunrise, sunrise_temp: resp.data.forecast.forecastday[2].hour[6].temp_c, sunset: resp.data.forecast.forecastday[2].astro.sunset, sunset_temp: resp.data.forecast.forecastday[2].hour[18].temp_c, } ]; console.log( info ); res.status(200).send( info ); }) .catch( err => { console.log(err); }); } }3
javascript
<filename>src/cli/src/commands/update/def.ts<gh_stars>1-10 import { validateDefintion } from '../../main.js' export = validateDefintion({ command: 'update [what]', alias: 'u', options: [ ['-r, --only-remote', 'Only remote'], ['-l, --only-local', 'Only local'] ], description: 'Update the remote and the local instances of BALDR. What: config, vue, api, media; without all', checkExecutable: [ 'curl', 'git', 'npx', 'ssh', 'systemctl', '/usr/local/bin/ansible-playbook-localhost.sh', 'ansible-playbook' ] })
typescript
Thuingaleng Muivah, general secretary of the National Socialist Council of Nagalim (Isak-Muivah), will hold talks with Prime Minister Manmohan Singh and Union Home Minister P. Chidambaram in New Delhi next week, Union Home Secretary G. K. Pillai said on Saturday. Mr. Pillai told journalists on the sidelines of a special attestation parade held at the Assam rifles Training Centre and School here that Mr. Muivah was on his way to New Delhi for the next round of peace talks. He was coming at the invitation of the government. He said there would be a sustained dialogue with the NSCN (IM) and the government would be as flexible as possible to solve the problem with peace and honour. Mr. Pillai said he was hopeful of a positive outcome, though he refused to divulge the agenda. Since the government initiated the talks, it would continue the process and try to bring it to a conclusion. He, however, said a final solution had to be worked out with all underground groups. Representatives of Western Sumi Hoho urged Mr. Pillai to convey to the Centre that all underground groups should be taken on board before a solution is arrived at. They told him that it was the people who suffered, as they had to pay taxes to the elected government as well as the parallel governments run by the underground groups. Women groups said women and children were the worst sufferers of the prolonged conflict. Sandeep Dikshit reports from New Delhi: Naga leaders will also hold talks with R. S. Pandey, a former Petroleum Secretary and former Chief Secretary of Nagaland, who has recently been appointed as interlocutor, official sources said. The Naga leaders arriving from Amsterdam will be given a home-coming reception late at night, mainly by students living in the capital. Nagas from Myanmar will join their brethren from Arunachal Pradesh, Nagaland and Manipur to organise a felicitation to press for unity among the NSCN factions and continuation of the peace agreement. “The political maturity exhibited by the two entities is highly appreciated. The Nagas hope both will demonstrate the political will and come up with an honourable solution to the protracted conflict. To demonstrate our support to both the entities, the Nagas in Delhi are organising a reception for all the NSCN,” said Abu of the Naga People’s Movement for Human Rights. The NSCN and the Indian government opened a political dialogue in 1997 and have held 67 rounds of talks so far. The last round, held in March 2009 in Zurich, remained inconclusive. Mr. Muivah is also expected to travel to Nagaland to take stock of the situation arising out of the clashes between his larger NSCN faction and another led by S. S. Khaplang.
english
PC George, an Independent MLA elected from Poonjar constituency in Kerala, courted controversy Tuesday night when he broke a stop barrier at a toll plaza in Thrissur district. The incident, which took place around 11 pm Tuesday, was caught on the CCTV camera installed at the plaza. The visuals showed George stepping out of the car and breaking the stop barrier at the Paliakkara toll plaza before his car took off. When asked to clarify, George defended his action and pointed fingers at the ‘inefficiency’ of the toll plaza officials. “I was supposed to accompany the chief minister as part of the all-party delegation to meet the prime minister today. I had a train to catch from Kozhikode to my home but the train got cancelled. So I had to take the car all the way. Around 11 pm, my car reached the toll plaza in Paliakkara. Note that there are ‘MLA’ stickers at the front and back of the car. According to central government rules, an MLA doesn’t have to pay the toll on national highways,” he said on phone. “I kept requesting them to let me go. They (toll officials) saw the ‘MLA’ sticker but kept looking the other way. I even offered to pay the toll because I wanted to get out of there. I waited for almost 3 minutes. By then, about 20 cars had lined up behind our car and they were all honking. That’s why I got out of the car and broke the barrier. I don’t regret it at all,” he added. George said he has written complaints to the Chief Minister and the Speaker about the ‘harassment’ he faced at the hands of the toll officials. “As a public representative, my right to travel was being curtailed,” he added. The toll officials have filed a complaint at the Puthukad police station against the MLA’s actions. An officer said the complainant stated that he couldn’t see the ‘MLA’ sticker on the car and hence the delay occurred. Police confirmed that legislators and parliamentarians in the state are not required to pay toll tax on national highways. This is not the first time when George has been accused of indulging in such activity. Last year, he had assaulted a staff of the MLAs hostel canteen. Incidentally, a chargesheet in that regard was also filed against him on Wednesday.
english
{ "private": true, "name": "html-vault", "description": "Store a secret securely in a standalone HTML file.", "version": "0.1.0", "keywords": [ "secret", "encrypt", "decrypt", "sodium", "html", "share" ], "author": "<NAME> <<EMAIL>>", "homepage": "https://derhuerst.github.io/html-vault/", "repository": "derhuerst/html-vault", "bugs": "https://github.com/derhuerst/todo-name/issues", "license": "ISC", "engines": { "node": ">=14" }, "dependencies": { "file-saver": "^2.0.1", "self-decrypting-html-page": "^3.0.0", "sodium-encryption": "^1.2.3" }, "devDependencies": { "@babel/core": "^7.15.4", "@babel/preset-env": "^7.15.4", "babel-preset-minify": "^0.5.0", "babelify": "^10.0.0", "browserify": "^17.0.0", "envify": "^4.1.0", "uglifyify": "^5.0.1" }, "scripts": { "dev": "browserify src/index.js >dist/bundle.js", "build": "env NODE_ENV=production browserify -g [ babelify --presets [@babel/preset-env] ] -g envify -g uglifyify src/index.js >dist/bundle.js" } }
json
<filename>src/WebsiteBundle/Resources/public/css/custom.css /* ---------------------------------------------------------------- Custom styles -----------------------------------------------------------------*/ /* line 5, ../sass/custom.scss */ #section-contact { border-top: 5px solid rgba(0, 0, 0, 0.2); padding: 60px 0 80px 0; } /* line 15, ../sass/custom.scss */ .center-info { list-style-type: none; } /* line 17, ../sass/custom.scss */ .center-info li { border-bottom: 1px solid #E5E5E5; font-size: 18px; font-weight: 300; padding: 18px 0; } /* line 22, ../sass/custom.scss */ .center-info li span { color: #333; text-transform: uppercase; font-weight: 600; font-size: 15px; } /* line 36, ../sass/custom.scss */ .project-info h3 { font-size: 18px; text-transform: uppercase; } /* line 43, ../sass/custom.scss */ .mission-statement { padding: 100px; background-color: #232E64; } /* line 48, ../sass/custom.scss */ .mission-statement .heading-block h2 { text-transform: none; color: #fff; font-weight: 400; } .partnership-logo img { max-width: 100%; max-height: 100px; } .fmm-header-image{ background-image: url('/bundles/website/images/bgs/xmas-bg.jpg'); padding: 120px 0; } /* Mentorship program */ .mentorship-hero { text-align: center; } .mentorship-hero h1 { font-size: 65px; margin-bottom: 0; font-weight: bold; } .mentorship-hero h2{ text-shadow: 2px 2px rgba(232, 39, 40, .5); } .mentorship-hero h2 span { font-size: 25px; text-shadow: none; } .button.button-border.button-desc { background-color: #000; line-height: 1; BORDER: 0; color: #fff; } .lsrs { text-align: center; } .lsrs h3 { font-weight: normal; font-style: italic; font-family: 'Crete Round', serif; margin-bottom: 0; } .lsrs a { transition: all .2s ease-in-out; color: #e82728; } .lsrs a:hover { color: #d22425; } .motiv-mentee { /* border: 1px solid #ddd;*/ padding: 20px 40px; } .motiv-mentee h3 span { font-family: 'Crete Round',serif; font-style: italic; color: #e82728; } .mentorship-contact { text-align: center; }
css
the body is a beautiful work of art to be displayed how you want it to be. recognize the tools of disempowerment so you can escape from them and do what the hell you want without guilt or shame. i need you to recognize this. because your body is beautiful. your natural essence is beautiful and worthy of display of any type.
english
Tecno has been expanding its budget portfolio in India and the Camon 17 series comes as the latest offering by the brand in this category. The device adorns a tall 6. 82-inch display which has the modern punch-hole cutout at the centre top. The panel used is IPS LCD which offers 1080 x 2460 pixel FHD+ resolution and has 500 nits peak brightness. The display also supports a standard 60Hz refresh rate. This is suitable for watching shows and movies on the go and also stream 1080p videos online. The bezels are narrow; except for the chin. The back of the Tecno Camon 17 features a gradient skin and has a vertical camera module on the top-left and the Camon branding at the bottom left. The Tecno Camon 17 is a mid-range smartphone that uses the MediaTek Helio G85 processor. This octa-core chipset is gaming-oriented and has a clock speed of 2GHz. Aiding the processor is ARM Mali-G52 GPU and 6GB RAM. This is enough for swift multitasking with multiple apps running in the background. The device comes with an onboard storage capacity of 128GB. The handset also has expandable storage support via a microSD card to suffice the additional storage requirements. The Tecno Camon 17 has been announced in India at Rs. 12,999. The device is available in 6GB RAM and 128GB storage configuration. The color options available will be Frost Silver, Deep Sea, and Tranquil Green. The sub Rs. 15,000 price tag makes it a decent entrant in the budget smartphone category in India. The primary rivals which this handset gets in the country are the Realme C21, Realme C25, and the Narzo 30. The Tecno Camon 17’s optics is handled by a quad-lens setup at the rear where the primary sensor is a 64MP lens. The remaining sensors include a pair of 2MP sensors and an additional AI lens. The camera app supports AI Portrait, Super Macro, 2K Timelapse, Video Blur, and slow-motion video recording features. There is a Super Night Shot and Super Night View Portrait mode for low light photography. Upfront, the device features a 16MP selfie camera with an f/2. 0 aperture. The device has a good camera setup overall for a budget smartphone. The Tecno Camon 17 features a rear-mounted fingerprint scanner for security. The device has run on Android 11 OS-based in the HiOS v7. 6 interface. The also offers some other unique features such as Game Turbo Mode 2,0, voice changer, and Anti Theft alarm amongst others. The smartphone draws its fuel via a 5,000 mAh battery which gets 18W fast charging support. The Tecno Camon 17 is a feature-rich smartphone overall for a budget offering. The FHD+ display and quad-camera setup with a 64MP main sensor does remain the key highlights. However, other aspects such as fast charging supported battery and a gaming-oriented chipset also gives it an edge over the rivals. Yes, the smartphone features a rear-mounted fingerprint sensor along with face unlock. The Realme 8 and the Redmi Note 10 can be considered as the Tecno Camon 17 alternatives. It has 16MP selfie shooter with an aperture of f/2. 2. The Tecno Camon 17 comes in single 6GB RAM variant. If you are looking for a smartphone under Rs. 15,000 then the Camon 17 would not be a bad choice with a 5,000 mAh battery, the Helio G85 chipset, and so on. The Tecno Camon 17 does not support any dedicated night mode; however, the smartphone has dual flash support that can help to capture images in low-light. Yes, the smartphone supports microSD slot for additional storage expansion of up to 256GB. No, the smartphone does not support 5G network. The Tecno Camon 17 supports a screen refresh rate of 90Hz. Rating a smartphone is a tedious process and a lot of parameters have to be considered before judging the overall performance of the device such as display, camera, processor, RAM, storage, battery, and the pricing. So, here are how these specs will affect the real-life usage of a device and why how we meticulously consider each of these points to rate a smartphone. Cameras have evolved a lot over the last few years and multi-camera setup is a new norm. We consider various parameters like MP count, aperture size, pixel size, image stabilization to rate a camera system of a smartphone out of 5. Any device that scores more than 3. 5 can take good photos and videos and if a phone scores over 4, then it will be one of the best camera smartphones in the market. Though battery seems like an underrated feature and we look at the battery capacity, fast charging supporting technology, and even the wireless charging capability is also taken into consideration to rate smartphone's battery capability. The display is the face of a smartphone. And there are a lot of parameters like the panel technology (IPS LCD, OLED, TFT) and other parameters also taken into consideration like the resolution, pixel density, and refresh rate. A smartphone could have great specs, but if it is not priced well then you might not get the best value-for-money. So, we compare a smartphone with the contemporaries to rate the value-for-money of a device out of 5. This aspect is decided on various sub specifics, such as availability of microSD card slot, the amount of RAM the device offers, processor capability, and the network support. This parameter has more weightage when compared to other departments.
english
<reponame>J-Massey/postproc # we import necessary libraries and functions import matplotlib.pyplot as plt from sklearn.linear_model import LinearRegression from sklearn.linear_model import Ridge from sklearn.linear_model import Lasso from sklearn.model_selection import train_test_split import numpy as np data = np.load('../scaling_correction/data.npy') X_train, X_test, y_train, y_test = train_test_split(data[:, 0:-1], data[:, -1], test_size=0.1, shuffle=False) # we define an ordinary linear regression model (OLS) linearModel=LinearRegression() linearModel.fit(X_train, y_train) # evaluating the model on training and testing sets linear_model_train_r2=linearModel.score(X_train, y_train) # returns the r square value of the training set linear_model_test_r2=linearModel.score(X_test, y_test) print('Linear model training set r^2..:', linear_model_train_r2) print('Lineer model testing r^2..:', linear_model_test_r2) # here we define a Ridge regression model with lambda(alpha)=0.01 ridge=Ridge(alpha=0.01) # low alpha means low penalty ridge.fit(X_train, y_train) ridge_train_r2=ridge.score(X_train, y_train) ridge_test_r2=ridge.score(X_test, y_test) print('Ridge model (alpha=0.01) train r^2..:', ridge_train_r2) print('Ridge model (alpha=0.01) test r^2..:', ridge_test_r2) # we define a another Ridge regression model with lambda(alpha)=100 ridge2=Ridge(alpha=100) # when we increase alpha, model can not learn the data because of the low variance ridge2.fit(X_train, y_train) ridge2_train_r2=ridge2.score(X_train, y_train) ridge2_test_r2=ridge2.score(X_test, y_test) print('Ridge model (alpha=100) train r^2..:', ridge2_train_r2) print('Ridge model (alpha=100) test r^2..:', ridge2_test_r2) # visualize the values of the beta parameters plt.figure(figsize=(8,6)) plt.plot(ridge.coef_, alpha=0.7, linestyle='none', marker='*', markersize=15, color='red', label=r'Ridge: $\lambda=0.01$') plt.plot(ridge2.coef_, alpha=0.7, linestyle='none', marker='d', markersize=15, color='blue', label=r'Ridge: $\lambda=100$') plt.plot(linearModel.coef_, alpha=0.7, linestyle='none', marker='v', markersize=15, color='orange', label=r'Linear Model') plt.xlabel('Attributes', fontsize=16) plt.ylabel('Attribute parameters', fontsize=16) plt.legend(fontsize=16, loc=4) plt.show()
python
Deogaon: The annual Sulia Yatra was solemnised in adherence with Covid protocols in Bolangir district, but two shrines were stained with blood of scores of goats, sheep and fowls which were sacrificed according to the tradition Tuesday. According to reports, like every year, hundreds of birds and animals were sacrificed amid tight security arrangements at Bada Khala in Khairguda and Sana Khala in Kumuria village under Deogaon block. Sulia Yatra is based on the culture and tradition of Kondh tribals. At midnight of Monday, ‘nisi puja’ was solemnised. Tuesday morning, priest Jhankar Barua and Kondh tribals armed with their traditional weapons took out a ‘he-goat’ called Pata Boda in a procession amid beating of drums and other musical instruments to the shrine. Khairguda is the main hub of the celebration where at the altar of Sulia Budha, the presiding deity is situated. The rituals started in the morning hours. Traditional weapons were also worshipped on the occasion. As per tradition, Pata Boda was sacrificed at the altar. Then, hundreds of animals and fowls donated by devotees from the district and outside were sacrificed. The shrine was splattered with sacrificial blood. Similar scene was witnessed at Sana Khala shrine. However, this year, due to Covid restrictions, the administration did not allow shops and marketing platforms around the shrines. Priests and members of Sulia Puja Committee had under gone Covid tests to ensure their participation in the Jatra. Similarly, Sulia yatra was organised at Chandrapur shrine in Jarasingh panchayat amid Covid guidelines. Police forces were deployed at these shrines to keep the law and order.
english
import {Directive, ElementRef, Inject, Output} from '@angular/core'; import {typedFromEvent} from '@taiga-ui/cdk'; import {filter, map, tap, throttleTime} from 'rxjs/operators'; @Directive({ selector: '[tuiCarouselScroll]', }) export class TuiCarouselScrollDirective { @Output() readonly tuiCarouselScroll = typedFromEvent( this.elementRef.nativeElement, 'wheel', ).pipe( filter(({deltaX}) => Math.abs(deltaX) > 20), throttleTime(500), map(({deltaX}) => Math.sign(deltaX)), tap(() => { // So we always have space to scroll and overflow-behavior saves us from back nav this.elementRef.nativeElement.scrollLeft = 10; }), ); constructor( @Inject(ElementRef) private readonly elementRef: ElementRef<HTMLElement>, ) {} }
typescript
{ "name": "schema", "version": "1.0.0", "description": "Schemas for Tender project", "main": "index.js", "directories": { "test": "test" }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "repository": { "type": "git", "url": "https://github.com/cemtopkaya/tender-schema" }, "keywords": [ "Tender", "JSON", "Schema" ], "author": "<NAME>", "license": "MIT", "bugs": { "url": "https://github.com/cemtopkaya/tender-schema/issues" }, "homepage": "https://github.com/cemtopkaya/tender-schema" }
json
angular.module('docsApp').constant('BUILDCONFIG', { "ngVersion": "1.7.5", "version": "1.1.11", "repository": "https://github.com/angular/material", "commit": "<PASSWORD>", "date": "2018-12-21 11:26:02 -0800" });
javascript
FIFA will hold a >presidential election on February 26 , giving Sepp Blatter seven more months in power before leaving the scandal-tainted governing body. The date was chosen by FIFA’s executive committee on Monday, after Blatter announced plans to resign four days following his re-election in May amid American and Swiss criminal investigations into corruption. The 79-year-old Blatter, who first joined FIFA 40 years ago, has held onto the most world powerful job in world soccer since 1998. FIFA’s 209 members, who elected Blatter to a fifth term in May, will return to Zurich next year to select a new president almost nine months after Blatter’s resignation statement. Potential contenders include UEFA president Michel Platini and Prince Ali bin al-Hussein, who lost to Blatter in May. >Former Brazil great Zico and Liberia football federation president Musa Bility have said they will seek the five nominations required by the Oct. 26 deadline. FIFA announced the election date shortly before a scheduled news conference by Blatter. The FIFA executive committee meeting was also due to discuss ways of reforming the organization to regain the trust of fans and sponsors, including presidential term limits. Prince Ali on Monday joined World Cup sponsor Coca-Cola and former FIFA advisers Transparency International in calling for Blatter to be excluded from the process of shaping the organization’s future after a litany of scandals on his watch. “President Blatter’s resignation cannot be dragged out any longer. He must leave now,” Prince Ali, a FIFA vice president for four years until May, said in a statement to the AP . “An interim independent leadership must be appointed to administer the process of the elections, in addition to the reforms that are being discussed prior to the elections,” he added. Reformers want FIFA to appoint a respected figure from outside the sport to oversee the next election and reforms of FIFA. Kofi Annan, the former United Nations secretary general from Ghana, has been mentioned for the role. “The rumors linking Mr. Annan to the FIFA job are just that- rumors,” Annan’s office told the AP, stressing that he is currently “fully committed” to other roles. Also Read: >Key questions answered: Why did Blatter resign and what now for FIFA?
english
<gh_stars>0 { "name": "@ronomon/mime", "version": "3.6.0", "lockfileVersion": 1, "requires": true, "dependencies": { "@ronomon/base64": { "version": "github:OrcaOcean/base64#15bd25711696cd8e06333313953a8daa13ed9a9e", "from": "github:OrcaOcean/base64", "requires": { "@ronomon/queue": "^3.0.0", "nan": "^2.14.1" } }, "@ronomon/queue": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/@ronomon/queue/-/queue-3.0.1.tgz", "integrity": "<KEY> }, "@ronomon/quoted-printable": { "version": "github:OrcaOcean/quoted-printable#bee112882daf16428f89f568c1a0d45658325c0a", "from": "github:OrcaOcean/quoted-printable", "requires": { "@ronomon/queue": "^3.0.0", "nan": "^2.14.0" } }, "iconv": { "version": "2.3.5", "resolved": "https://registry.npmjs.org/iconv/-/iconv-2.3.5.tgz", "integrity": "sha512-U5ajDbtDfadp7pvUMC0F2XbkP5vQn9Xrwa6UptePl+cK8EILxapAt3sXers9B3Gxagk+zVjL2ELKuzQvyqOwug==", "requires": { "nan": "^2.14.0", "safer-buffer": "^2.1.2" } }, "nan": { "version": "2.14.1", "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz", "integrity": "<KEY> }, "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "<KEY> } } }
json
WASHINGTON: The United States announced Friday it will not take in any new foreign students seeking online-only study, after rescinding a hotly contested order to expel those already here and preparing for that because of the pandemic.Read more: Cameron Highland's pricey new land lease will raise vegetable prices | New Straits TimesKUALA LUMPUR: The increase of the land lease pricing in Cameron Highlands to RM4,500 per 0.4ha a year from the RM900 under the temporary occupation licence (TOL) will pose a great burden on consumers. Malaysia records nine new Covid-19 cases today | New Straits TimesNSTnation The Health Ministry announced nine new Covid19 cases in Malaysia as of noon today. Pompeo calls for 'free world' to triumph over China's 'new tyranny' | New Straits TimesWASHINGTON: US Secretary of State Mike Pompeo called Thursday on “free nations” to triumph over the threat of what he said was a “new tyranny” from China. Indonesia sees 1,761 new Covid-19 cases in 24 hours | New Straits TimesJAKARTA: Indonesia registered 1,761 new Covid-19 cases today, bringing the tally of infections in the country to 95,418. Brazil sets record of 68,000 new daily Covid-19 cases | New Straits TimesBRASILIA: Brazil recorded a new daily record of coronavirus cases on Wednesday with nearly 68,000 infections, a sign Covid-19 is still far from being brought under control in the hard-hit country. Papua New Guinea calls for WHO's help to deal with Covid-19 | New Straits TimesSYDNEY: Papua New Guinea has asked for World Health Organization help after a rapidly spreading new coronavirus outbreak sparked preparations for large-scale community transmission in the under-resourced country.
english
/* * Copyright 2019-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.yofish.yyconfig.common.framework.apollo.core.enums; import com.yofish.yyconfig.common.common.utils.YyStringUtils; public final class EnvUtils { public static Env transformEnv(String envName) { if (YyStringUtils.isBlank(envName)) { return Env.UNKNOWN; } switch (envName.trim().toUpperCase()) { case "LPT": return Env.LPT; case "FAT": case "FWS": return Env.FAT; case "UAT": return Env.UAT; case "PRO": case "PROD": return Env.PROD; case "DEV": return Env.DEV; case "LOCAL": return Env.LOCAL; case "TEST": return Env.TEST; case "PRE": return Env.PRE; case "TOOLS": return Env.TOOLS; default: return Env.UNKNOWN; } } }
java
<reponame>lyubenblagoev/postfix-rest-server<gh_stars>10-100 package com.lyubenblagoev.postfixrest.configuration; import com.lyubenblagoev.postfixrest.security.CustomUserDetailsPasswordService; import com.lyubenblagoev.postfixrest.security.CustomUserDetailsService; import com.lyubenblagoev.postfixrest.security.JwtAuthenticationFilter; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.security.authentication.dao.DaoAuthenticationProvider; import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.config.http.SessionCreationPolicy; import org.springframework.security.core.userdetails.UserDetailsPasswordService; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; @Configuration @EnableWebSecurity public class SecurityConfiguration extends WebSecurityConfigurerAdapter { private final CustomUserDetailsService userDetailsService; private final UserDetailsPasswordService userDetailsPasswordService; private final JwtAuthenticationFilter jwtAuthenticationFilter; @Value("${users.passwords.bcrypt-password-encoder.strength:-1}") private int bCryptPasswordEncoderStrength; public SecurityConfiguration(CustomUserDetailsService userDetailsService, CustomUserDetailsPasswordService userDetailsPasswordService, JwtAuthenticationFilter jwtAuthenticationFilter) { this.userDetailsService = userDetailsService; this.userDetailsPasswordService = userDetailsPasswordService; this.jwtAuthenticationFilter = jwtAuthenticationFilter; } @Override protected void configure(AuthenticationManagerBuilder auth) { auth.authenticationProvider(basicAuthenticationProvider()); } @Override protected void configure(HttpSecurity http) throws Exception { http.sessionManagement() .sessionCreationPolicy(SessionCreationPolicy.STATELESS); http.authorizeRequests() .antMatchers("/api/v1/auth/**").permitAll() .antMatchers("/api/v1/**").authenticated() .anyRequest().permitAll() .and() .headers().frameOptions().sameOrigin() .and() .formLogin().disable() .csrf().disable() .httpBasic().disable() .cors(Customizer.withDefaults()) .addFilterBefore(jwtAuthenticationFilter, UsernamePasswordAuthenticationFilter.class); } @Bean DaoAuthenticationProvider basicAuthenticationProvider() { DaoAuthenticationProvider authenticationProvider = new DaoAuthenticationProvider(); authenticationProvider.setPasswordEncoder(passwordEncoder()); authenticationProvider.setUserDetailsService(userDetailsService); authenticationProvider.setUserDetailsPasswordService(userDetailsPasswordService); return authenticationProvider; } @Bean PasswordEncoder passwordEncoder() { return new BCryptPasswordEncoder(bCryptPasswordEncoderStrength); } }
java
<filename>packages/zaml-editor/src/VisualEditor/VisualNode.tsx import _ from 'lodash'; import React from 'react'; import * as zaml from '@zaml/parser'; import classNames from 'classnames'; import './VisualNode.scss'; const { NodeType } = zaml; interface Props { node?: zaml.Node; selectedNode?: zaml.Node; } export default class VisualNode extends React.Component<Props> { static propTypes = { } render() { const { node, selectedNode } = this.props; let element: string | null; if (!node) return null; const selected = node === selectedNode; let children: any = []; if (node.type === NodeType.ROOT) { element = 'div'; } else if (node.type === NodeType.PARAGRAPH) { element = 'p'; } else if (node.type === NodeType.TEXT) { element = 'span'; } else if (node.type === NodeType.ENTITY) { if (node.name === 'LINK') { return ( <a className="zaml-entity" node-name="link" node-id={node.id} href={node.attributes.url} > <VisualNode node-id={node.children[0].id} {...this.props} node={node.children[0]} /> </a> ); } else { element = 'span'; } } else if (node.type === NodeType.TAG) { // children.push( // <span key="attributes" className="attributes">{node.name}</span> // ); if (node.isBlock) { element = 'div'; } else { element = 'span'; } } else { element = null; } if (!element) { return null; } if (!_.isEmpty(node.children)) { children.push( <span key="children" className="children"> {_.map(node.children, (child, i) => ( <VisualNode {...this.props} key={i} node={child} /> ))} </span> ); } else if (node.type === 'text') { children.push( node.content ); } return React.createElement(element, { className: classNames('zaml-node', `${node.type}`, { block: node.isBlock, selected }), 'node-name': node.name && node.name.toLowerCase(), 'node-id': node.id, }, children); } }
typescript
<reponame>mijieu/topbisgo<gh_stars>0 { "document": { "invoiceNumber": "N.º de fatura %invoiceNumber%", "invoiceHeadline": "N.º de fatura %invoiceNumber%", "stornoHeadline": "N.º de estorno %stornoNumber% para o n.º de fatura %invoiceNumber%", "stornoNumber": "N.º de cancelamento %stornoNumber%", "deliveryNoteNumber": "N.º de nota de entrega %deliveryNoteNumber%", "deliveryNoteHeadline": "N.º de nota de entrega %deliveryNoteNumber% para encomenda n.º %orderNumber%", "creditNoteNumber": "Nota de crédito %creditNoteNumber%", "creditNoteHeadline": "N.º de vale %creditNoteNumber% para o n.º de fatura %invoiceNumber%", "customerNumber": "Cliente não: %customerNumber%", "date": "Data %date%", "comment": "Comentário: %comment%", "orderDate": "Data da encomenda %orderDate%", "deliveryDate": "Prazo de entrega %deliveryDate%", "page": "Página %pageNumber%", "orderNumber": "Ordem não: %orderNumber%", "taxNumber": "Imposto não: %taxNumber%", "vatId": "IVA Reg.N.o: %vatId%", "taxOffice": "Escritório tributário: %taxOffice%", "bankAccount": "Conta bancária", "bankIban": "IBAN %bankIban%", "bankBic": "BIC %bankBic%", "placeOfJurisdiction": "Competência judiciária de %placeOfJurisdiction%", "serviceDateNotice": "Data do serviço equivalente à data da fatura", "placeOfFulfillment": "Local de cumprimento %placeOfFulfillment%", "intraCommunity": "Entrega intracomunitária (UE)", "shippingAddress": "Endereço de envio", "phoneNumber": "Número de telefone: %phoneNumber%", "email": "Endereço de e-mail: %email%", "ceo": "Gerente", "lineItems": { "header": { "position": "Item", "label": "Designação", "tax": "IVA", "quantity": "Qtde", "unitPrice": "Preço unitário", "productNumber": "Prod. N.º", "total": "Total" }, "tax": "acrescido de %taxRate%% de IVA", "total": "Total:", "roundedTotal": "Total arredondado:", "totalNet": "Total (líquido):", "shippingCosts": "Custos de envio" }, "paymentShippingInfo": { "paymentMethod": "Tipo de pagamento selecionado: %paymentMethod%", "shippingMethod": "Tipo de envio selecionado: %shippingMethod%", "additionalInfo": "Os produtos permanecem como nossa propriedade até ao pagamento integral." } }, "filter": { "sortByNameAscending": "Nome, A-Z", "sortByNameDescending": "Nome, Z-A", "sortByPriceAscending": "Preço, crescente", "sortByPriceDescending": "Preço, decrescente", "sortByScore": "Melhores resultados" } }
json
{"backdrop_path":null,"created_by":[{"id":1212625,"credit_id":"<KEY>","name":"<NAME>","gender":2,"profile_path":null},{"id":1212626,"credit_id":"<KEY>","name":"<NAME>","gender":2,"profile_path":null}],"episode_run_time":[30],"first_air_date":"1983-09-10","genres":[{"id":16,"name":"Animation"},{"id":9648,"name":"Mystery"},{"id":35,"name":"Comedy"}],"homepage":"","id":230,"in_production":false,"languages":["es","en"],"last_air_date":"1983-12-10","last_episode_to_air":{"air_date":"1983-12-10","episode_number":26,"id":2296682,"name":"Wedding Bell Boos! (2)","overview":"The guys go home to Plymouth, Massachussetts for the wedding of Shaggy's sister Maggie to Wilfred, but when the ghost of their long dead realative McBaggy Rogers appears and wants back his old ring that is hiding a map to the family treasure, will Maggie get married without it?","production_code":"","season_number":1,"show_id":230,"still_path":null,"vote_average":0.0,"vote_count":0},"name":"The New Scooby and Scrappy-Doo Show","next_episode_to_air":null,"networks":[{"name":"ABC","id":2,"logo_path":"/ndAvF4JLsliGreX87jAc9GdjmJY.png","origin_country":"US"}],"number_of_episodes":26,"number_of_seasons":1,"origin_country":["US"],"original_language":"en","original_name":"The New Scooby and Scrappy-Doo Show","overview":"The New Scooby and Scrappy Doo Show is the sixth incarnation of the Hanna-Barbera Saturday morning cartoon Scooby-Doo. It premiered on September 10, 1983, and ran for one season on ABC as a half-hour program made up of two eleven-minute short cartoons. \n\nThe show is a return to the mystery solving format and reintroduces Daphne after a four-year absence. The plots of each episode feature her, Shaggy, Scooby-Doo, and Scrappy-Doo solving supernatural mysteries under the cover of being reporters for a teen magazine.","popularity":9.648,"poster_path":"/hKZL0OVHfKxuCPnhhCQl7nVkPRf.jpg","production_companies":[],"seasons":[{"air_date":"1983-09-10","episode_count":26,"id":743,"name":"Season 1","overview":"","poster_path":"/spkFWanydYtKggpI5349fxN4Aew.jpg","season_number":1}],"status":"Ended","type":"Scripted","vote_average":6.6,"vote_count":14}
json
<filename>arch/common/dbt/mc/x86/reverse-allocator.cpp /* SPDX-License-Identifier: MIT */ #include <dbt/mc/x86/reverse-allocator.h> #include <dbt/mc/x86/formatter.h> #include <dbt/util/list.h> //#define PDEBUG #define VERIFY #define SUPPORT_VOLATILE #define CLEVER_ALLOCATION_STRATEGY using namespace captive::arch::dbt::mc::x86; using namespace captive::arch::dbt::util; #define MAX_PHYS_REGISTERS 24 template<typename UnderlyingType = dbt_u64, int NrBits = sizeof(UnderlyingType) * 8 > struct BitSet { static_assert(NrBits <= sizeof(UnderlyingType) * 8, "NrBits does not fit within underlying data type"); typedef BitSet<UnderlyingType, NrBits> Self; typedef int IndexType; BitSet() : state(0) { } BitSet(const BitSet& _o) : state(_o.state) { } inline operator UnderlyingType() const { return state; } inline void wipe() { state = 0; } inline void set(IndexType i) { state |= ((UnderlyingType) 1u << i); } inline void clear(IndexType i) { state &= ~((UnderlyingType) 1u << i); } inline bool is_set(IndexType i) const { return !!(state & ((UnderlyingType) 1u << i)); } inline bool is_clear(IndexType i) const { return !(state & ((UnderlyingType) 1u << i)); } inline IndexType find_first_set() const { if (state == 0) return -1; return __builtin_ffsll(state) - 1; } inline IndexType find_first_clear() const { if (~state == 0) return -1; return __builtin_ffsll(~state) - 1; } inline IndexType find_first_set_via_mask(UnderlyingType mask) const { if (state & mask == 0) return -1; return __builtin_ffsll(state & mask) - 1; } inline IndexType find_first_clear_via_mask(UnderlyingType mask) const { if (((~state) & mask) == 0) return -1; return __builtin_ffsll((~state) & mask) - 1; } friend Self operator|(const Self& lhs, const Self& rhs) { Self r; r.state = lhs.state | rhs.state; return r; } void operator|=(const Self& other) { state |= other.state; } private: UnderlyingType state; }; struct VirtualRegister { Instruction *first_def, *last_use; dbt_u64 physical_register_index; BitSet<> interference; int last_control_flow_count; }; bool ReverseAllocator::allocate(Instruction* head) { const X86PhysicalRegister& invalid_reg = X86PhysicalRegisters::RIZ; if (!number_and_legalise_instructions(head)) return false; // Allocate the dense vreg map. dbt_u64 nr_vregs = _vreg_allocator.next_index(); if (nr_vregs > 20000) { _support.debug_printf("there are too many vregs: %lu\n", nr_vregs); _support.assertion_fail("too many vregs"); return false; } VirtualRegister *vregs = (VirtualRegister *) _support.alloc(sizeof(VirtualRegister) * nr_vregs, AllocClass::DATA); if (!vregs) return false; // Initialise the vreg map. for (unsigned int i = 0; i < nr_vregs; i++) { vregs[i].first_def = nullptr; vregs[i].last_use = nullptr; vregs[i].physical_register_index = invalid_reg.unique_index(); vregs[i].last_control_flow_count = 0; } // Calculate VREG live ranges if (!calculate_vreg_live_ranges(vregs, head)) { _support.free(vregs, AllocClass::DATA); return false; } // Make fake uses for volatile memory accesses #ifdef SUPPORT_VOLATILE for (unsigned int i = 0; i < nr_vregs; i++) { if (vregs[i].first_def != nullptr && vregs[i].last_use == nullptr) { #ifdef PDEBUG _support.debug_printf("dead live range for vreg %lu\n", i); #endif Instruction *insn = vregs[i].first_def; if (insn->is_volatile()) { #ifdef PDEBUG _support.debug_printf("volatile instruction, so creating fake use for vreg %lu\n", i); Formatter __fmt; _support.debug_printf("[%u] %s\n", insn->nr, __fmt.format_instruction(insn)); #endif if (insn->kind() != InstructionKind::MOV) { _support.assertion_fail("fake use: not a mov"); } auto vreg_operand = insn->get_operand(1); if (!vreg_operand.is_reg() || !vreg_operand.reg.reg.is_virtual()) { _support.assertion_fail("fake use: not a vreg operand"); } insn->set_operand(1, Operand::make_register(X86PhysicalRegisters::R14, vreg_operand.reg.width)); } } } #endif // Perform allocation if (!do_allocate(vregs, head)) { _support.free(vregs, AllocClass::DATA); return false; } if (!commit(head, vregs)) { _support.free(vregs, AllocClass::DATA); return false; } #ifdef VERIFY if (!verify(head)) { _support.free(vregs, AllocClass::DATA); return false; } #endif if (!fixup_calls(head)) { _support.free(vregs, AllocClass::DATA); } _support.free(vregs, AllocClass::DATA); return true; } bool ReverseAllocator::calculate_vreg_live_ranges(VirtualRegister *vregs, Instruction *head) { #ifdef PDEBUG VirtualRegister *last_vreg = nullptr; #endif int cur_control_flow_count = 0; Instruction *current = head; do { if (current->is_control_flow()) { cur_control_flow_count++; } Instruction::UseDefList usedeflist; current->get_usedefs(usedeflist); for (unsigned int use_def_index = 0; use_def_index < usedeflist.next; use_def_index++) { const auto& usedef = usedeflist.get(use_def_index); if (!usedef.is_valid()) continue; // Skip invalid usedefs if (!usedef.is_def()) continue; // Skip non-def usedefs if (!usedef.reg.is_virtual()) continue; // Skip non-virtual registers VirtualRegister *vreg = &vregs[usedef.reg.unique_index()]; #ifdef PDEBUG if (vreg > last_vreg) { last_vreg = vreg; } #endif if (vreg->first_def == nullptr) { #ifdef PDEBUG _support.debug_printf("new definition of vreg %u\n", usedef.reg.unique_index()); #endif vreg->first_def = current; vreg->last_control_flow_count = cur_control_flow_count; } else if (vreg->last_use == nullptr && !usedef.is_usedef()) { #ifdef PDEBUG _support.debug_printf("definition of vreg %u, without use (and not a usedef) lcfc=%u, ccfc=%u\n", usedef.reg.unique_index(), vreg->last_control_flow_count, cur_control_flow_count); #endif #if 1 // Was there any intermediate controlflow/uses? if (vreg->last_control_flow_count == cur_control_flow_count) { #ifdef PDEBUG _support.debug_printf(" no control flow! killing %u\n", vregs[usedef.reg.unique_index()].first_def->nr); #endif vreg->first_def->change_kind(InstructionKind::DEAD); vreg->first_def = current; } #endif } } for (unsigned int use_def_index = 0; use_def_index < usedeflist.next; use_def_index++) { const auto& usedef = usedeflist.get(use_def_index); if (!usedef.is_valid()) continue; // Skip invalid usedefs if (!usedef.is_use()) continue; // Skip non-use usedefs if (!usedef.reg.is_virtual()) continue; // Skip non-virtual registers VirtualRegister *vreg = &vregs[usedef.reg.unique_index()]; #ifdef PDEBUG if (vreg > last_vreg) { last_vreg = vreg; } #endif vreg->last_use = current; } current = current->next(); } while (current != head); #ifdef PDEBUG if (last_vreg != nullptr) { for (VirtualRegister *vreg = vregs; vreg != last_vreg + 1; vreg++) { if (vreg->first_def == nullptr && vreg->last_use == nullptr) continue; dbt_u64 fd = -1, lu = -1; if (vreg->first_def != nullptr) { fd = vreg->first_def->nr; } if (vreg->last_use != nullptr) { lu = vreg->last_use->nr; } _support.debug_printf("vreg %lu: start:%lu, end:%lu\n", (vreg - vregs), fd, lu); } } #endif return true; } #define GPR_MASK 0x0000FFFF #define SSE_MASK 0xFFFF0000 bool ReverseAllocator::do_allocate(VirtualRegister* vregs, Instruction* head) { dbt_u64 phys_reg_tracking[MAX_PHYS_REGISTERS]; BitSet<> live_phys_regs; // HACK live_phys_regs.set(X86PhysicalRegisters::R15.unique_index()); live_phys_regs.set(X86PhysicalRegisters::BP.unique_index()); live_phys_regs.set(X86PhysicalRegisters::SP.unique_index()); phys_reg_tracking[X86PhysicalRegisters::R15.unique_index()] = X86PhysicalRegisters::R15.unique_index(); phys_reg_tracking[X86PhysicalRegisters::BP.unique_index()] = X86PhysicalRegisters::BP.unique_index(); phys_reg_tracking[X86PhysicalRegisters::SP.unique_index()] = X86PhysicalRegisters::SP.unique_index(); Instruction *last = head->prev(); Instruction *current = last; do { #ifdef PDEBUG { Formatter __debug_formatter; _support.debug_printf("@ %lu = %s\n", current->nr, __debug_formatter.format_instruction(current)); } #endif Instruction::UseDefList usedeflist; current->get_usedefs(usedeflist); bool skip = false; for (unsigned int use_def_index = 0; use_def_index < usedeflist.next; use_def_index++) { const auto& usedef = usedeflist.get(use_def_index); if (!usedef.is_valid()) continue; // Skip invalid usedefs if (!usedef.is_def()) continue; // Skip non-def usedefs dbt_u64 register_index = usedef.reg.unique_index(); if (usedef.reg.is_virtual()) { // Definition of VREG VirtualRegister *vreg = &vregs[register_index]; if (vreg->first_def == current) { if (vreg->last_use == nullptr) { #ifdef PDEBUG _support.debug_printf("def of unused vreg %u\n", register_index); #endif skip = true; break; } else { // If this is the first def, then release the allocated vreg live_phys_regs.clear(vreg->physical_register_index); #ifdef PDEBUG _support.debug_printf("ending live-range of vreg %u in preg %u\n", register_index, vreg->physical_register_index); #endif } } } else { if (register_index > MAX_PHYS_REGISTERS) { _support.assertion_fail("definition of invalid preg"); return false; } // Definition of PREG if (live_phys_regs.is_set(register_index)) { live_phys_regs.clear(register_index); if (phys_reg_tracking[register_index] > MAX_PHYS_REGISTERS) { dbt_u64 conflicting_vreg_index = phys_reg_tracking[register_index]; VirtualRegister *conflicting_vreg = &vregs[conflicting_vreg_index]; #ifdef PDEBUG _support.debug_printf("def of preg %u, but it's tracking vreg %u!\n", register_index, conflicting_vreg_index); #endif // Find a new preg for the vreg dbt_u64 mask = usedef.reg.is_sse() ? SSE_MASK : GPR_MASK; dbt_u64 new_preg = conflicting_vreg->interference.find_first_clear_via_mask(mask); if (new_preg == (dbt_u64) - 1) { #ifdef PDEBUG _support.debug_printf("vreg %u interference=%08x\n", conflicting_vreg_index, (dbt_u64) conflicting_vreg->interference); #endif _support.assertion_fail("out of registers in re-assignment"); } #ifdef PDEBUG _support.debug_printf("re-assigning vreg %u to preg %u (%08x)\n", conflicting_vreg_index, new_preg, (dbt_u64) conflicting_vreg->interference); #endif conflicting_vreg->physical_register_index = new_preg; phys_reg_tracking[conflicting_vreg->physical_register_index] = conflicting_vreg_index; live_phys_regs.set(conflicting_vreg->physical_register_index); vregs[conflicting_vreg_index].interference = live_phys_regs; // Update ALL vreg interferences for (int i = 0; i < MAX_PHYS_REGISTERS; i++) { if (live_phys_regs.is_set(i)) { #ifdef PDEBUG _support.debug_printf(" updating preg=%u, vreg=%u, prev=%08x, cur=%08x\n", i, phys_reg_tracking[i], (dbt_u64) vregs[phys_reg_tracking[i]].interference, (dbt_u64) live_phys_regs); #endif vregs[phys_reg_tracking[i]].interference |= live_phys_regs; } } } #ifdef PDEBUG _support.debug_printf("ending live-range of preg %u, tracking %u\n", register_index, phys_reg_tracking[register_index]); #endif } } } if (!skip) { for (unsigned int use_def_index = 0; use_def_index < usedeflist.next; use_def_index++) { const auto& usedef = usedeflist.get(use_def_index); if (!usedef.is_valid()) continue; // Skip invalid usedefs if (!usedef.is_use()) continue; // Skip non-use usedefs dbt_u64 register_index = usedef.reg.unique_index(); if (usedef.reg.is_virtual()) { // Use of VREG VirtualRegister *vreg = &vregs[register_index]; if (vreg->last_use == current || vreg->physical_register_index == 32) { // If this is the last use, then allocate a register to start tracking this vreg #ifdef PDEBUG dbt_u64 xxx = (dbt_u64) live_phys_regs; #endif // Now, hold the phone. We need to find a register of the correct class. dbt_u64 mask = usedef.reg.is_sse() ? SSE_MASK : GPR_MASK; #ifdef CLEVER_ALLOCATION_STRATEGY // Try to be smart about this if (current->kind() == InstructionKind::MOV || current->kind() == InstructionKind::MOVZX) { auto& srcop = current->get_operand(0); auto& dstop = current->get_operand(1); if (srcop.is_reg() && srcop.reg.reg.is_virtual() && dstop.is_reg() && !dstop.reg.reg.is_special()) { if (dstop.reg.reg.is_virtual()) { #ifdef PDEBUG _support.debug_printf(" selecting register for mov vreg->vreg instruction\n"); #endif vreg->physical_register_index = live_phys_regs.find_first_clear_via_mask(mask); } else { #ifdef PDEBUG _support.debug_printf(" selecting register for mov vreg->preg instruction - want preg=%u\n", dstop.reg.reg.unique_index()); #endif if (live_phys_regs.is_clear(dstop.reg.reg.unique_index())) { #ifdef PDEBUG _support.debug_printf(" available!\n", dstop.reg.reg.unique_index()); #endif vreg->physical_register_index = dstop.reg.reg.unique_index(); } else { #ifdef PDEBUG _support.debug_printf(" not available!\n", dstop.reg.reg.unique_index()); #endif vreg->physical_register_index = live_phys_regs.find_first_clear_via_mask(mask); } } } else { vreg->physical_register_index = live_phys_regs.find_first_clear_via_mask(mask); } } else { #endif vreg->physical_register_index = live_phys_regs.find_first_clear_via_mask(mask); #ifdef CLEVER_ALLOCATION_STRATEGY } #endif if (vreg->physical_register_index < 0) { _support.assertion_fail("out of registers in allocation"); } phys_reg_tracking[vreg->physical_register_index] = register_index; live_phys_regs.set(vreg->physical_register_index); vregs[register_index].interference = live_phys_regs; // TODO: Update ALL vreg interferences for (int i = 0; i < MAX_PHYS_REGISTERS; i++) { if (live_phys_regs.is_set(i)) { #ifdef PDEBUG _support.debug_printf(" updating preg=%u, vreg=%u, prev=%08x, cur=%08x\n", i, phys_reg_tracking[i], (dbt_u64) vregs[phys_reg_tracking[i]].interference, (dbt_u64) live_phys_regs); #endif vregs[phys_reg_tracking[i]].interference |= live_phys_regs; } } #ifdef PDEBUG _support.debug_printf("starting live-range of vreg %u, allocated to preg %u (%08x, %08x)\n", register_index, vreg->physical_register_index, xxx, (dbt_u64) live_phys_regs); #endif } } else { if (register_index > 32) { _support.assertion_fail("use of invalid preg"); return false; } // Use of PREG if (live_phys_regs.is_set(register_index) && phys_reg_tracking[register_index] != register_index) { dbt_u64 conflicting_vreg_index = phys_reg_tracking[register_index]; VirtualRegister *conflicting_vreg = &vregs[conflicting_vreg_index]; #ifdef PDEBUG _support.debug_printf("conflicting use of preg %u, currently tracking %u\n", register_index, conflicting_vreg_index); #endif // Find a new preg for the vreg dbt_u64 mask = usedef.reg.is_sse() ? SSE_MASK : GPR_MASK; dbt_u64 new_preg = conflicting_vreg->interference.find_first_clear_via_mask(mask); if (new_preg == (dbt_u64) - 1) { #ifdef PDEBUG _support.debug_printf("vreg %u interference=%08x\n", conflicting_vreg_index, (dbt_u64) conflicting_vreg->interference); #endif _support.assertion_fail("out of registers in re-assignment"); } #ifdef PDEBUG _support.debug_printf("re-assigning vreg %u to preg %u (%08x)\n", conflicting_vreg_index, new_preg, (dbt_u64) conflicting_vreg->interference); #endif conflicting_vreg->physical_register_index = new_preg; phys_reg_tracking[conflicting_vreg->physical_register_index] = conflicting_vreg_index; live_phys_regs.set(conflicting_vreg->physical_register_index); vregs[conflicting_vreg_index].interference = live_phys_regs; // Update ALL vreg interferences for (int i = 0; i < MAX_PHYS_REGISTERS; i++) { if (live_phys_regs.is_set(i)) { #ifdef PDEBUG _support.debug_printf(" updating preg=%u, vreg=%u, prev=%08x, cur=%08x\n", i, phys_reg_tracking[i], (dbt_u64) vregs[phys_reg_tracking[i]].interference, (dbt_u64) live_phys_regs); #endif vregs[phys_reg_tracking[i]].interference |= live_phys_regs; } } phys_reg_tracking[register_index] = register_index; } else { phys_reg_tracking[register_index] = register_index; live_phys_regs.set(register_index); vregs[register_index].interference = live_phys_regs; // Update ALL vreg interferences for (int i = 0; i < MAX_PHYS_REGISTERS; i++) { if (live_phys_regs.is_set(i)) { #ifdef PDEBUG _support.debug_printf(" updating preg=%u, vreg=%u, prev=%08x, cur=%08x\n", i, phys_reg_tracking[i], (dbt_u64) vregs[phys_reg_tracking[i]].interference, (dbt_u64) live_phys_regs); #endif vregs[phys_reg_tracking[i]].interference |= live_phys_regs; } } #ifdef PDEBUG _support.debug_printf("starting live-range of preg %u (%08x)\n", register_index, (dbt_u64) live_phys_regs); #endif } } } } current = current->prev(); } while (current != last); return true; } bool ReverseAllocator::commit(Instruction* head, const VirtualRegister* vreg_to_preg) { static const X86PhysicalRegister * assignments[] = { &X86PhysicalRegisters::A, &X86PhysicalRegisters::C, &X86PhysicalRegisters::D, &X86PhysicalRegisters::B, &X86PhysicalRegisters::RIZ, &X86PhysicalRegisters::RIZ, &X86PhysicalRegisters::SI, &X86PhysicalRegisters::DI, &X86PhysicalRegisters::R8, &X86PhysicalRegisters::R9, &X86PhysicalRegisters::R10, &X86PhysicalRegisters::R11, &X86PhysicalRegisters::R12, &X86PhysicalRegisters::R13, &X86PhysicalRegisters::R14, &X86PhysicalRegisters::R15, &X86PhysicalRegisters::XMM0, &X86PhysicalRegisters::XMM1, &X86PhysicalRegisters::XMM2, &X86PhysicalRegisters::XMM3, &X86PhysicalRegisters::XMM4, &X86PhysicalRegisters::XMM5, &X86PhysicalRegisters::XMM6, &X86PhysicalRegisters::XMM7, }; Instruction *current = head; do { if (current->kind() != InstructionKind::DEAD) { for (unsigned int i = 0; i < Instruction::NR_OPERANDS; i++) { const auto& operand = current->get_operand(i); if (operand.is_reg()) { if (operand.reg.reg.is_virtual()) { dbt_u64 preg_index = vreg_to_preg[operand.reg.reg.unique_index()].physical_register_index; if (preg_index == X86PhysicalRegisters::RIZ.unique_index()) { current->change_kind(InstructionKind::DEAD); break; } if (preg_index >= (sizeof(assignments) / sizeof(assignments[0]))) { #ifdef PDEBUG _support.debug_printf("illegal vreg %u to preg %u @ %u (reg operand)\n", operand.reg.reg.unique_index(), preg_index, current->nr); #endif _support.assertion_fail("assignment of preg out of range"); } #ifdef PDEBUG _support.debug_printf("committing vreg %u to preg %u @ %u (reg operand)\n", operand.reg.reg.unique_index(), preg_index, current->nr); #endif current->get_operand_nc(i).reg.reg = *assignments[preg_index]; } } else if (operand.is_mem()) { if (operand.mem.base_register.is_virtual()) { dbt_u64 preg_index = vreg_to_preg[operand.mem.base_register.unique_index()].physical_register_index; if (preg_index >= (sizeof(assignments) / sizeof(assignments[0]))) { _support.assertion_fail("assignment of preg out of range"); } #ifdef PDEBUG _support.debug_printf("committing vreg %u to preg %u @ %u (mem base operand)\n", operand.reg.reg.unique_index(), preg_index, current->nr); #endif current->get_operand_nc(i).mem.base_register = *assignments[preg_index]; } if (operand.mem.index_register.is_virtual()) { dbt_u64 preg_index = vreg_to_preg[operand.mem.index_register.unique_index()].physical_register_index; if (preg_index >= (sizeof(assignments) / sizeof(assignments[0]))) { _support.assertion_fail("assignment of preg out of range"); } #ifdef PDEBUG _support.debug_printf("committing vreg %u to preg %u @ %u (mem idx operand)\n", operand.reg.reg.unique_index(), preg_index, current->nr); #endif current->get_operand_nc(i).mem.index_register = *assignments[preg_index]; } } } } switch (current->kind()) { case InstructionKind::MOV: case InstructionKind::MOVQ: case InstructionKind::MOVDQA: if (current->get_operand(0) == current->get_operand(1)) { current->change_kind(InstructionKind::DEAD); } break; default: break; } current = current->next(); } while (current != head); return true; } bool ReverseAllocator::verify(const Instruction* head) { const Instruction *current = head; do { #ifndef PDEBUG if (!verify_instruction(current)) { #endif Formatter __fmt; _support.debug_printf("[%u] %s\n", current->nr, __fmt.format_instruction(current)); #ifndef PDEBUG return false; } #endif current = current->next(); } while (current != head); return true; } bool ReverseAllocator::verify_instruction(const Instruction* insn) { if (insn->kind() == InstructionKind::DEAD) return true; for (int i = 0; i < Instruction::NR_OPERANDS; i++) { auto op = insn->get_operand(0); if (op.is_reg()) { if (op.reg.reg.is_virtual()) { _support.debug_printf("verification failed: instruction has virtual register operand\n"); return false; } } else if (op.is_mem()) { if (op.mem.base_register.is_virtual()) { _support.debug_printf("verification failed: instruction has virtual base register operand\n"); return false; } if (op.mem.index_register.is_virtual()) { _support.debug_printf("verification failed: instruction has virtual index register operand\n"); return false; } } } return true; } bool ReverseAllocator::decorate_call(Instruction *call_instruction, int nr_args) { static const X86PhysicalRegister * caller_saved[] = { // Caller Saved &X86PhysicalRegisters::A, &X86PhysicalRegisters::R10, &X86PhysicalRegisters::R11, // Function Arguments &X86PhysicalRegisters::R9, &X86PhysicalRegisters::R8, &X86PhysicalRegisters::C, &X86PhysicalRegisters::D, &X86PhysicalRegisters::SI, &X86PhysicalRegisters::DI }; for (int i = 0; i < (3 + (6 - nr_args)); i++) { auto reg = caller_saved[i]; auto push = _support.alloc_obj<Instruction>(InstructionKind::PUSH); auto pop = _support.alloc_obj<Instruction>(InstructionKind::POP); push->set_operand(0, Operand::make_register(*reg, 64)); pop->set_operand(0, Operand::make_register(*reg, 64)); call_instruction->prev()->insert_after(push); call_instruction->insert_after(pop); } return true; } bool ReverseAllocator::fixup_calls(Instruction *head) { Instruction *current = head; do { switch (current->kind()) { case InstructionKind::CALL: case InstructionKind::CALL0: case InstructionKind::CALL1: case InstructionKind::CALL2: case InstructionKind::CALL3: case InstructionKind::CALL4: case InstructionKind::CALL5: case InstructionKind::CALL6: if (!decorate_call(current, 0)) { return false; } break; default: break; } current = current->next(); } while (current != head); return true; } bool ReverseAllocator::number_and_legalise_instructions(Instruction *head) { dbt_u64 idx = 0; Instruction *current = head; do { // Number the instruction. current->nr = idx++; // Any mem -> mem instructions must be performed via a temporary register if (current->match2() == InstructionMatch::MEM_MEM) { auto op0 = current->get_operand(0); // auto op1 = current->get_operand(1); auto tmp = Operand::make_register(_vreg_allocator.alloc_vreg(X86RegisterClasses::GENERAL_PURPOSE), op0.mem.access_width); auto mov_to_tmp = _support.alloc_obj<Instruction>(InstructionKind::MOV); mov_to_tmp->set_operand(0, op0); mov_to_tmp->set_operand(1, tmp); current->prev()->insert_after(mov_to_tmp); current->set_operand(0, tmp); mov_to_tmp->nr = current->nr; current->nr = idx++; } else if (current->kind() == InstructionKind::JMP) { if (current->get_operand(0).label.target == current->next()) { current->change_kind(InstructionKind::DEAD); } } #ifdef PDEBUG { Formatter __fmt; _support.debug_printf("[%u] %s\n", current->nr, __fmt.format_instruction(current)); } #endif current = current->next(); } while (current != head); return true; }
cpp
<reponame>ChrisKeefe/685Rust // move_semantics3.rs // Make me compile without adding new lines-- just changing existing lines! // (no lines with multiple semicolons necessary!) // Execute `rustlings hint move_semantics3` for hints :) // In this exercise, why is it possible to make vec0 mutable when it is passed as // an argument? It wasn't declared as mutable initially. Are we shadowing? Is // this just a normal behavior of `mut`, that we can make a thing mutable or // immutable at will? fn main() { let vec0 = Vec::new(); let mut vec1 = fill_vec(vec0); println!("{} has length {} content `{:?}`", "vec1", vec1.len(), vec1); vec1.push(88); println!("{} has length {} content `{:?}`", "vec1", vec1.len(), vec1); } fn fill_vec(mut vec: Vec<i32>) -> Vec<i32> { vec.push(22); vec.push(44); vec.push(66); vec }
rust
<gh_stars>1-10 { "@metadata": { "authors": [ "Alison", "Kscanne", "Nmacu" ] }, "cite-ve-dialog-reference-options-section": "Roghanna", "cite-ve-dialog-referenceslist-title": "<NAME>", "cite-ve-toolbar-group-label": "Luaigh" }
json
import React from "react"; import { render, fireEvent, act, screen, waitFor, } from "@testing-library/react"; import { createMemoryHistory } from "history"; import { Route, Router } from "react-router-dom"; import BackendService from "../../services/BackendService"; import EditDetails from "../EditDetails"; jest.mock("../../hooks"); jest.mock("../../services/BackendService"); const history = createMemoryHistory(); history.push("/admin/dashboard/edit/123/header"); jest.spyOn(history, "push"); beforeEach(async () => { await act(async () => { render( <Router history={history}> <Route path="/admin/dashboard/edit/:dashboardId/header"> <EditDetails /> </Route> </Router> ); }); }); test("submits form with the entered values", async () => { await act(async () => { fireEvent.submit(screen.getByTestId("EditDetailsForm")); }); expect(BackendService.editDashboard).toBeCalledWith( "123", "My AWS Dashboard", "", false, "Some description", "", {} ); }); test("invokes cancel function when use clicks cancel", async () => { await act(async () => { fireEvent.click(screen.getByRole("button", { name: "Cancel" })); }); expect(history.push).toHaveBeenCalledWith("/admin/dashboard/edit/123"); }); test("renders a preview of dashboard name and description", async () => { fireEvent.input(screen.getByLabelText("Dashboard Name"), { target: { value: "Foo Bar", }, }); fireEvent.input(screen.getByLabelText("Description - optional"), { target: { value: "FizzBuzz", }, }); const description = screen.getByText("FizzBuzz"); const name = screen.getByRole("heading", { name: "Foo Bar" }); await waitFor(() => expect(name).toBeInTheDocument()); await waitFor(() => expect(description).toBeInTheDocument()); });
typescript
<reponame>dtanzer/website { "name": "<NAME>, Osnabrück & Bielefeld", "url": "https://www.softwerkskammer.org/groups/socramob", "location": { "city": "Niedersachsen/NRW, Germany", "coordinates": [8.02097649761589, 52.16992136590494] } }
json
Panaji: Actor Yami Gautam believes films from South are turning out to be pan-India successes as filmmakers are able to share their vision withoy hurdle. "This is time to improvise and work on what we need to do," Yami said during a session at the ongoing Goa Fest 2022 on Thursday. The 33-year-old actor asserts producers are still interested in backing projects with big stars as they sideline story-oriented films. My husband, Aditya (Dhar), who directed "Uri", even after three years of the film's release, is working on one of his most ambitious films. But for him to explain his vision to producers. . . There were just two or three who understood that and are working towards it, she said. The director needs more free hand in expressing their vision. We need to focus more on the story and the script. . . We need to straighten our priorities," the actor added. Citing examples of the films like "Baahubali" franchise, "KGF" series, "Pushpa" and "RRR", Yami said these films prove that producers trusted their directors and the story. The actors who are there (in these films) are huge stars, especially in the southern film industry and have a pan-India audience. I don't think that it stopped them anywhere. They believed in the director's vision and went for it, she added. Rather than considering films from the South a competition, the actor said she is happy that stories in other languages are also becoming popular in North India.
english
<reponame>elvejohansson/facebook-clone<gh_stars>0 :root { --background: #edf0f5; --accent: #1977F2; } * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Montserrat', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; } html { font-size: 16px; } body { background: var(--background); } h1 { font-weight: 800; color: var(--accent); } button { border: none; outline: none; background: var(--accent); font-size: 1rem; font-weight: 600; color: #fff; padding: 1rem 4rem; border-radius: 5px; cursor: pointer; } .link { text-decoration: none; cursor: pointer; }
css
<gh_stars>1-10 class Vector: #exercise 01 def __init__(self,inputlist): self._vector = [] _vector = inputlist #exercise 02 def __str__(self): return "<" + str(self._vector).strip("[]") + ">" #exercise 03 def dim(self): return len(self._vector) #exercise 04 def get(self,index): return self._vector[index] def set(self,index,value): self._vector[index] = value def scalar_product(self, scalar): return [scalar * x for x in self._vector] #exercise 05 def add(self, other_vector): if not isinstance(other_vector) == True and type(other_vector) == Vector: raise TypeError elif not self.dim() == other_vector.dim(): raise ValueError else: return self.scalar_product(other_vector) #exercise 06 def equals(self,other_vector): if not self.dim() == other_vector.dim(): return False elif self == other_vector: return True else: for i in range(self.dim()): if self._vector[i] != other_vector._vector[i]: return False else: return True
python
<reponame>reddyprasade/Data-Analysis-with-Python- # -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2018-05-18 07:59 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('app', '0004_auto_20180518_1257'), ] operations = [ migrations.AlterField( model_name='crimes_against_women', name='Rape_Cases_Reported', field=models.IntegerField(null=True), ), migrations.AlterField( model_name='crimes_against_women', name='Victims_Above_50_Yrs', field=models.IntegerField(null=True), ), migrations.AlterField( model_name='crimes_against_women', name='Victims_Between_10to14_Yrs', field=models.IntegerField(null=True), ), migrations.AlterField( model_name='crimes_against_women', name='Victims_Between_14to18_Yrs', field=models.IntegerField(null=True), ), migrations.AlterField( model_name='crimes_against_women', name='Victims_Between_18to30_Yrs', field=models.IntegerField(null=True), ), migrations.AlterField( model_name='crimes_against_women', name='Victims_Between_30to50_Yrs', field=models.IntegerField(null=True), ), migrations.AlterField( model_name='crimes_against_women', name='Victims_Upto_10_Yrs', field=models.IntegerField(null=True), ), migrations.AlterField( model_name='crimes_against_women', name='Victims_of_Rape_Total', field=models.IntegerField(null=True), ), ]
python
Elon Musk could potentially appoint Linda Yaccarino of NBCUniversal as the new Twitter CEO. Musk tweeted that he had identified a new chief executive for Twitter, without revealing the person's name. Musk said he will take the role of Twitter’s executive chair as she will be starting in around six weeks. Yaccarino has over ten years of experience at NBCUniversal. Yaccarino led NBCU's advertising sales division and played a vital role in the company. Yaccarino obtained her education at Penn State University, majoring in liberal arts and telecommunications. She spent 19 years at Turner Entertainment and worked in the network's advertising sales operations. Yaccarino has in the past praised Elon Musk for his dedication and work ethic. She also said that Musk needed to be given time to turn things around at Twitter. It will be a big blow to the company after the departure of Yaccarino from NBCUniversal. Thanks for Reading.
english
import { call, take } from "redux-saga/effects"; import { SagaGenerator } from "../../../generics"; import { TRIGGER_CREATE_RELATED_ITEM, TRIGGER_CREATE_ORDERED_ITEM, TriggerCreateRelatedItemAction, TriggerCreateOrderedItemAction, } from "../redux-reducers"; import { MetaAction } from "../types"; export function* createRelatedItemSaga(): SagaGenerator { const action: MetaAction<TriggerCreateRelatedItemAction> = yield take( TRIGGER_CREATE_RELATED_ITEM ); const { payload: { item, relationship }, meta, } = action; const manager = meta?.manager; if (manager) { yield call(() => manager.addRelatedItem(item, relationship)); } } export function* createOrderedItemSaga(): SagaGenerator { const action: MetaAction<TriggerCreateOrderedItemAction> = yield take( TRIGGER_CREATE_ORDERED_ITEM ); const { payload: { item, order, orderRelationship, relationships }, meta, } = action; const manager = meta?.manager; if (manager) { yield call(() => manager.addOrderedItem(item, order, orderRelationship, relationships) ); } }
typescript
After the series of flops, the super success of iSmart Shankar has brought back the lost glory to Ram Pothineni. After such kind of success, he is generally expected to move forward with his further projects with the utmost care. But it seems, the actor is not taking any such precautions. Kishore Tirumala, who earlier offered a class hit like Nenu Sailaja to Ram, also gave an average film like Unnadokate Zindagi. Now, the director is eager to team with the Ready star, for one more time. Earlier, the duo planned to remake Tamil film Thada, but it was put on hold for various unknown reasons. But finally, Kishore once again approached Ram, with the refined version of the same film. Ram has liked the changes, Kishore made to Thada remake project and thus gave his nod. It should be noted that Kishore Tirumala is known for his class projects and even his last film Chithralahari is a pure class film and was also successful at the box office. But after an out and out mass film like iSmart Shankar, it is not advisable for Ram, to go back to the class directors again. It could be a risky stunt and he may also lose his hard earned comeback through Puri’s blockbuster.
english
{"brief":"jackal","long":"<i>Meaning:</i> a \"jackal\" (as a \"burrower\").<br/><i>Usage:</i> fox.<br/><i>Source:</i> or \"שֻׁעָל\"; from the same as \"H8168\";"}
json
<filename>authors/apps/escalation/tests/test_escalation.py import json from rest_framework.views import status from .basetest import BaseTest class EscalationArticlesTest(BaseTest): """ Test cases for article escalation """ msg = "Sorry we couldn't find that article." snitch = "You can't report your article." user_delete = "Only Admins can delete a reported article" report_twice = "You are not allowed to report twice" admin_delete = "You successfully deleted the article" get_admin = "Only Admins can get reported article" def test_escalation_of_a_404_article(self): """ Test successful escalation of an article that doesn't exist """ token = self.user1.token() self.client.credentials( HTTP_AUTHORIZATION='Bearer ' + token) resp = self.escalate_an_article() self.assertEqual(resp.status_code, status.HTTP_404_NOT_FOUND) self.assertEqual(resp.data["detail"], self.msg) def test_escalation_of_an_article(self): """ Test successful article escalation """ token = self.user1.token() self.client.credentials( HTTP_AUTHORIZATION='Bearer ' + token) resp = self.escalate_an_article_successfully() self.assertEqual(resp.status_code, status.HTTP_201_CREATED) def test_update_escalation_of_an_article(self): """ Test successful updating an escalation """ token = self.user1.token() self.client.credentials( HTTP_AUTHORIZATION='Bearer ' + token) resp = self.update_an_escalated_article() self.assertEqual(resp.status_code, status.HTTP_201_CREATED) def test_escalation_of_an_article_with_author(self): """ Test escalation with author """ token = self.user2.token() self.client.credentials( HTTP_AUTHORIZATION='Bearer ' + token) resp = self.escalate_an_article_successfully() self.assertEqual(resp.status_code, status.HTTP_400_BAD_REQUEST) def test_escalation_of_an_article_twice(self): """ Test unsuccessful article escalation twice """ token = self.user1.token() self.client.credentials( HTTP_AUTHORIZATION='Bearer ' + token) resp = self.escalate_an_article_twice() self.assertEqual(resp.status_code, status.HTTP_400_BAD_REQUEST) self.assertEqual(resp.data["error"], self.report_twice) def test_delete_of_an_escalated_article_with_user(self): """ Test unsuccessful article escalation deletion """ token = self.user1.token() self.client.credentials( HTTP_AUTHORIZATION='Bearer ' + token) resp = self.delete_article() self.assertEqual(resp.status_code, status.HTTP_403_FORBIDDEN) self.assertEqual(resp.data["error"], self.user_delete) def test_delete_of_an_escalated_article_with_admin(self): """ Test successful article escalation deletion """ token = self.user3.token() self.client.credentials( HTTP_AUTHORIZATION='Bearer ' + token) resp = self.delete_article() self.assertEqual(resp.status_code, status.HTTP_200_OK) self.assertEqual(resp.data["message"], self.admin_delete) def test_getting_of_an_escalated_article_with_admin(self): """ Test successful getting escalated articles """ token = self.user3.token() self.client.credentials( HTTP_AUTHORIZATION='Bearer ' + token) self.escalate_an_article_successfully() resp = self.get_article() self.assertEqual(resp.status_code, status.HTTP_200_OK) self.assertEqual(resp.data.get("escalated articles")[0].get('article').get('title'), 'this is mine') def test_getting_of_an_escalated_article_with_users(self): """ Test unsuccessful getting escalated articles """ token = self.user1.token() self.client.credentials( HTTP_AUTHORIZATION='Bearer ' + token) resp = self.get_article() self.assertEqual(resp.status_code, status.HTTP_403_FORBIDDEN) self.assertEqual(resp.data["error"], self.get_admin)
python
{ "question": "Example Checkboxes Question", "info": "Additional information for this question", "required": 0, "response_type": "multi", "response_scale": [ "Option A", "Option B", "Option C" ] }
json
Netgear has recently launched its new Nighthawk X4S AC2600 smart Wi-Fi router device for consumers in India. The new Wi-Fi router is priced at Rs. 33,000 and comes with a three year warranty respectively. The Nighthawk X4S router is powered by a 1.7GHz dual-core processor. The 802.11ac router provides Wi-Fi speeds up to 2.53 Gbps and supports up to four data streams in each Wi-Fi band. “You can stream your favorite 4K HD video to one device and play an intense multi-user online video game on a different device, with greater clarity and less buffering, throughout your home,” said Netgear CEO Patrick C.S Lo. “Four high performance external antennas with powerful amplifiers combine with Beamforming+ to ensure the best Wi-Fi coverage and reliability throughout large homes and even backyards, by focusing Wi-Fi directly at connected devices,” added Lo. Also, ReadySHARE Vault, a free software application, automatically backs up Windows-based PCs on your network to a USB hard drive connected to Nighthawk X4S”, commented a Netgear official. The router also supports MU-MIMO technology for simultaneous streaming to multiple devices seamlessly. It also boasts of four external antennas with powerful amplifiers combined with Beamforming, which ensures the best Wi-Fi coverage and its reliability is found and measured throughout. Another advantage is that as far as connectivity is concerned, the router also offers five Gigabit Ethernet ports with 4 LAN and 1 WAN port each for ensuring multiple fast wired connections. The Netgear router also boasts of two USB 3.0 ports and 1 eSATA port for storage ready access, thus making the device more flexible. The new Wave 2 Wi-Fi feature also helps to improve the Wi-Fi range for mobile devices, particularly. Another hot feature of the router is that it supports application-aware and device-aware dynamic QoS technology, for optimising the connection speed. This helps to reduce slow internet lag and buffering. It also has the provision to support both 4G as well as 4.5G technologies, along with the current 3G and 3.5G technologies. Furthermore, it also includes numerous other features such as VPN support for secure remote access, guest network access and customised free URL for FTP server. The router offers options for smart parental controls and can be set up easily with the help of the new Netgear Genie App that has been released alongside. Finally, the other software feature includes ReadyShare Vault, which backs up the current Windows PC that you use on your network automatically to a USB hard drive connected to the router. So, what are you waiting for? Grab the new router and enjoy your Internet surfing as well as doing multi-tasking jobs as well, before the stocks goes out completely sooner or later. (Sources – Nasdaq, Techzine)
english
Los bastardos Movie Streaming Watch Online. A 24 hour period in the lives of Fausto and Jesus, two undocumented Mexican day-laborers in L.A. Each day another task, each day the same pressure to find money. They go about their daily routine, standing on the corner at the Home Improvement Store waiting for work to come. Today, the job they are given is well paid compared to their poor usual wages.
english
package org.codehaus.cake.test.util.memory; public interface IgnoreMemoryUsage { }
java
Reference (R) John Ritter's outstanding character is that of sympathy, mingled with hospitality. John Ritter have a great urge to make others a little happier for having met John Ritter. No higher quality could be possessed than this but it is one that may be carried to excess. John Ritter spend lot of time and money for the sake of others.John Ritter's tastes are of a cultured order and, at heart, John Ritter have a love for literary and artistic work of a high grade, though the commercial existence, which John Ritter must probably follow, may force them out of sight.Regarding money, John Ritter have peculiar views. At times John Ritter deny John Ritter'sself legitimate necessaries and at others, John Ritter spend somewhat recklessly. John Ritter will always give in response to the call of charity. On some occasions, John Ritter put John Ritter'sself to considerable trouble in order to save a few rupees on the price of an article John Ritter desire to purchase.John Ritter's chief weakness is that John Ritter are somewhat easily impressed. In fact, John Ritter believe too much of what John Ritter hear. Unscrupulous people are quick to notice this defect in John Ritter and they are certain to trade it sooner or later. Therefore, be on John Ritter's guard and avoid being victimised by someone who may come to John Ritter in the guise of a friend. John Ritter are a person who live in fantasy. Hypersensitive, many of John Ritter have inferiority complexes, feeling slighted by taking the most unrelated incident as personal insult. It is important that John Ritter do not indulge in drugs or alcohol, for this adds to John Ritter's unclarity. John Ritter be honest with John Ritter'sself and others, and attempt to be as realistic as possible, for John Ritter tend toward escapism. Music, colours and nature are very positive in smoothing John Ritter's overly sensitive being.John Ritter are a sensible person by nature, which will also help John Ritter to handle various situations in life. John Ritter are likely to experience obstacles in John Ritter's studies but will face each and every situation without succumbing to fear. John Ritter's urge to acquire more and more knowledge will help John Ritter climb the ladder of success. In the initial phase of John Ritter's life, John Ritter may encounter certain difficulties, but John Ritter will prove to be lucky in John Ritter's studies solely because of John Ritter's concentration skills. Sometimes, John Ritter may find it difficult to remember certain things, but thinking hard during such time can make everything crystal clear. This aspect of John Ritter's character will help John Ritter to succeed in the realm of John Ritter's studies. Children will give John Ritter tremendous motivation to set goals and accomplish them. John Ritter feel a responsibility to them and must not let them down. Use this motivating factor to its fullest, but be sure that John Ritter's are doing what John Ritter want to do and not directing John Ritter's efforts in an area which John Ritter do not like just because of John Ritter's sense of responsibility.
english
<filename>backward_platform/Java/MenuTestDemo/app/src/main/java/www/dander/com/menutestdemo/MainActivity.java<gh_stars>1-10 package www.dander.com.menutestdemo; import android.content.Intent; import android.net.Uri; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.Button; import android.widget.Toast; public class MainActivity extends AppCompatActivity { Button button1; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); button1 = (Button) findViewById(R.id.button); button1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { //Toast.makeText(MainActivity.this, "You click Button", Toast.LENGTH_SHORT).show(); // finish(); // Intent intent = new Intent("com.example.activitytest.ACTION_START"); // intent.addCategory("com.example.activitytest.MY_CATEGORY"); // startActivity(intent); // Intent intent = new Intent(Intent.ACTION_VIEW); // intent.setData(Uri.parse("http://www.baidu.com")); // startActivity(intent); // String data = "Hello Main3Activity"; // Intent intent = new Intent(MainActivity.this, Main3Activity.class); // intent.putExtra("extra_data", data); // startActivity(intent); Intent intent1 = new Intent(MainActivity.this, Main3Activity.class); startActivityForResult(intent1, 1); } }); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { switch (requestCode) { case 1: if (resultCode == RESULT_OK) { String dataBack = data.getStringExtra("data_return"); Log.d("MainActivity", dataBack); } break; default: } } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.add_item: Toast.makeText(this, "You click add item", Toast.LENGTH_SHORT).show(); break; case R.id.remove_item: Toast.makeText(this, "You click remove item", Toast.LENGTH_SHORT).show(); break; } return true; } }
java
const client = { sandbox: process.env.REACT_APP_PAYPAL_SANDBOX, production: process.env.REACT_APP_PAYPAL_PRODUCTION }; exports.client = client;
javascript
To celebrate Indira Gandhi’s birth centenary on Nov. 19, Vayu, a Delhi-based design house, commissioned sarees inspired by those worn by the late Prime Minister. This design challenge was given to Vimor Sarees, a handloom house in Bengaluru since 1970s. Vimor was started by Jimmy Nanjappa in 1967 and is now run by her daughter Pavithra Muddaya, who is a textile designer. “I already had 6 designs of Mrs. Gandhi’s sarees as she had bought sarees from us. Then I got a few more designs from her personal collection and created 14 patterns in various colour palettes,” said Pavithra Muddaya, who created a total of 112 sarees which were exhibited at Vayu Design Store in Bikaner House, New Delhi and were later sold. These sarees that range from Rs. 7,000 to Rs. 50,000 comes wrapped in a piece of mulmul (a fine, soft cotton muslin) with a Vyjayanthimala (rosary) in a black box. “It’s all sold out in Delhi, but I have the rights to recreate it so they will be available in our Vimor Store in Victoria Layout, Bengaluru, soon,” said Pavithra Muddaya. It turns out that most of the elite of Delhi have been sourcing their handlooms from Vimor, since the 1970s. Appaneravanda Pavithra Muddaya lives in Bengaluru and is married to Dr. Kongera Muddaya. She continues to manage the family handloom business with the help of her daughter Vipra and son Arup.
english
<filename>layouts/index.js export * from 'mdx-deck' export { default as Background } from './background' export { default as FullScreenCode } from './full-screen-code' export { default as Title } from './title' export { default as QuoteSlide } from './quote-slide'
javascript
MIAMI GARDENS — When Erik Ezukanma played Pee Wee football and was a freshman in high school, it turns out he was a running back. Now, it makes sense. The Dolphins' receiver played a Deebo Samuel-type role in Sunday's defeat of the Chargers. He lined up at running back. He lined up at receiver. There were pitches and end-arounds alike. "I've watched Deebo since I was in college and just the way he was breaking tackles," Ezukanma said Wednesday. "I feel like we play similar. So with me, adding that to my arsenal, it definitely helped to watch more of his tape and highlights." At 6-foot-2, 206 pounds, Ezukanma is the tallest and heaviest of Miami's six receivers on the roster. "I think this year, obviously, he's been able to play a lot of different positions, which is kind of opening some more opportunities for him and obviously when the ball is in his hands, he's a real threat," said Dolphins tight end Durham Smythe. "So I think the more chances we can get him the ball in space, the better for this offense." Ezukanma was a fourth-round pick in 2022 but played only one game with one catch as a rookie. "I feel like in both OTAs and the spring, (coaches) have been able to trust me with the playbook and I've done everything I could to reflect it," Ezukanma said. "Now they're putting plays in for me to get the ball, putting me in different places so we can manipulate the defense." When Mike McDaniel needed a player to draw a pass interference on a long pass just before halftime on Sunday, he and Tua Tagovailoa called Ezukanma's number. It worked, as Chargers defensive back J.C. Jackson shockingly fouled him to set up a key field goal. "I just ran the route, hoping that they would, you know, tackle me, or try to stop me from getting the ball," he said. "And that's exactly what they did." McDaniel explained that the coaching staff tries to approach the best use of each player with an open mind. "For that game, it made sense to try to introduce that a bit," McDaniel said. "I believe he was in the backfield during the go-ahead touchdown, right? I’m pretty sure he was lined up in the backfield, at least that’s what I called." With both Jaylen Waddle and Raheem Mostert dinged up, Erik Ezukanma has a chance to see increased involvement. The Dolphins involved him early as a run game extension. More: Erik Ezukanma is '10 times' better in Dolphins Year 2. Here's why. Ezukanma understands he needs to use his size to be a factor. "Being elusive, being relentless, trying to break tackles," he said. "I see edges of defenders and it's, I just don't let one person tackle me." After a tough rookie year, Ezukanma has been sporting a big smile since Sunday. "We want to contribute," he said. Joe Schad is a journalist at The Palm Beach Post. You can reach him at jschad@pbpost.com and follow him on social media platforms @schadjoe. Sign up for Joe's free weekly Dolphins Pulse Newsletter. Help support our work by subscribing.
english
CM Punk's pipebomb on WWE RAW will go down as one of the most iconic moments in the history of professional wrestling. The All Elite Wrestling star hasn't been part of WWE since 2014, but he's still often spoken about when it comes to the history of the company. WWE recently acknowledged CM Punk last week on SmackDown in a video package to celebrate Roman Reigns' 1,000-day reign as Universal Champion. But there have been many iconic moments on RAW over the last few decades, and one former WWE Superstar seemingly believes one of his moments is right up there with Punks. When a wrestling social media account asked fans to tell them what they think of when they see the old HD RAW stage, a fan tagged Matt Cardona and showed videos of Zack Ryder being pushed off the stage in a wheelchair and CM Punk's pipebomb. Cardona replied and called both moments iconic, tweeting out: "Two iconic moments. . . ," Matt Cardona said in a tweet. CM Punk hasn't been seen in All Elite Wrestling since All Out when he tore his triceps in a match for the AEW World Heavyweight Championship against Jon Moxley. Following the event, Punk vented his frustrations in the media scrum and fought with The Elite backstage shortly after that—an event many fans still refer to this day as Brawl Out. But Punk's injury has healed, and he's returning to the company as All Elite Wrestling plans to launch its second two-hour show of the week, AEW Collision. Punk will be competing on the show in the United Center in Chicago as he teams with AEW World Tag Team Champions FTR to take on Jay White, Juice Robinson, and Ring of Honor World Television Champion Samoa Joe. What do you make of Matt Cardona's tweet? Are you excited about Punk's return to All Elite Wrestling later this month? Let us know your thoughts by sounding off in the comments section below.
english
Years before Reliance Jio made recharging data packs as easy as ordering your lunch, we had to approach shops and buy data packs in bulk with cash! Most of those lasted for about a month. A picture of one such ‘ancient’ Airtel scratch card made netizens get nostalgic recently. Taking to X (formerly Twitter), a user shared a picture of the iconic bright red scratch card along with the caption, “Data prices in Ancient India.” The card offered 35 MG, 2G Data for Rs 9 only. The offer was valid for only 24 hours! The tweet went viral on the microblogging site, amassing 299.3K views and 10K likes. Several commenters went down memory lane. One user pointed out that the increased accessibility of the Internet had led to a deterioration of the quality of content online as any Tom Dick & Harry has an Internet connection at their fingertips. “It kept away all the filth on Indian social media,” remarked an X user. Some reminisced how they used to save videos, pictures and content, so as to access them when the data pack was exhausted. However, some users were grateful that the Internet became an affordable service and not a luxury like it was before. “Thank God and Thank Ambani for Jio. People may blame Jio all they want for the spread of the Internet to Chappris. However, I will always support the increasing economic viability and efficiency of technologies. Chapprification is just the consequence of economic prosperity,” a tweet read.
english
<filename>package.json<gh_stars>0 { "name": "@hapi/rule-for-loop", "version": "1.2.1", "description": "ESLint rule to enforce for loop syntax", "main": "lib/index.js", "repository": "https://github.com/hapijs/rule-for-loop.git", "keywords": [ "eslint", "hapi", "eslintrule", "for" ], "dependencies": {}, "devDependencies": { "@hapi/code": "6.x.x", "@hapi/lab": "20.x.x", "eslint": "6.x.x" }, "scripts": { "test": "lab -t 100 -a @hapi/code -L" }, "license": "BSD-3-Clause" }
json
# -*- coding: utf-8 -*- # Copyright © 2018 PyHelp Project Contributors # https://github.com/jnsebgosselin/pyhelp # # This file is part of PyHelp. # Licensed under the terms of the GNU General Public License. # ---- Standard Library Imports import os import os.path as osp # ---- Third Party imports import numpy as np import geopandas as gpd import netCDF4 import pandas as pd # ---- Local Libraries Imports from pyhelp.preprocessing import write_d10d11_allcells, format_d10d11_inputs from pyhelp.processing import run_help_allcells from pyhelp.utils import savedata_to_hdf5 from pyhelp.weather_reader import ( save_precip_to_HELP, save_airtemp_to_HELP, save_solrad_to_HELP, read_cweeds_file, join_daily_cweeds_wy2_and_wy3) FNAME_CONN_TABLES = 'connect_table.npy' class HELPManager(object): def __init__(self, workdir, year_range, path_togrid=None): super(HELPManager, self).__init__() self.year_range = year_range self.set_workdir(workdir) self._setup_connect_tables() if path_togrid is not None: self.load_grid(path_togrid) else: self.grid = None @property def cellnames(self): if self.grid is not None: return self.grid['cid'].tolist() else: return [] @property def inputdir(self): """ Return the path to the folder where the HELP input files are going to be saved in the working directory. This folder is created in case it doesn't already exist in the file system. """ inputdir = osp.join(self.workdir, 'help_input_files') if not osp.exists(inputdir): os.makedirs(inputdir) return inputdir @property def workdir(self): """Return the path to the current working directory.""" return os.getcwd() def set_workdir(self, dirname): """Set the working directory of the manager.""" if not osp.exists(dirname): os.makedirs(dirname) os.chdir(dirname) # ---- Connect tables @property def path_connect_tables(self): return osp.join(self.inputdir, FNAME_CONN_TABLES) def _setup_connect_tables(self): """Setup the connect tables dictionary.""" if osp.exists(self.path_connect_tables): self.connect_tables = np.load(self.path_connect_tables).item() else: self.connect_tables = {} def _save_connect_tables(self): """Save the connect tables dictionary to a numpy binary file.""" np.save(self.path_connect_tables, self.connect_tables) # ---- HELP grid def load_grid(self, path_togrid): """ Load the grid that contains the infos required to evaluate regional groundwater recharge with HELP. """ self.grid = load_grid_from_csv(path_togrid) return self.grid # ---- Input files creation def generate_d13_from_cweeds(self, d13fname, fpath_cweed2, fpath_cweed3, cellnames=None): """ Generate the HELP D13 input file for solar radiation from wy2 and wy3 CWEEDS files at a given location. """ d13fpath = osp.join(self.inputdir, d13fname) if cellnames is None: cellnames = self.cellnames else: # Keep only the cells that are in the grid. cellnames = self.grid['cid'][self.grid['cid'].isin(cellnames)] print('Reading CWEEDS files...', end=' ') daily_wy2 = read_cweeds_file(fpath_cweed2, format_to_daily=True) daily_wy3 = read_cweeds_file(fpath_cweed3, format_to_daily=True) wy23_df = join_daily_cweeds_wy2_and_wy3(daily_wy2, daily_wy3) indexes = np.where((wy23_df['Years'] >= self.year_range[0]) & (wy23_df['Years'] <= self.year_range[1]))[0] print('done') print('Generating HELP D13 file for solar radiation...', end=' ') save_solrad_to_HELP(d13fpath, wy23_df['Years'][indexes], wy23_df['Irradiance'][indexes], 'CAN_QC_MONTREAL-INTL-A_7025251', wy23_df['Latitude']) print('done') if self.year_range[1] > np.max(wy23_df['Years']): print("Warning: there is no solar radiation data after year %d." % np.max(wy23_df['Years'])) if self.year_range[0] < np.min(wy23_df['Years']): print("Warning: there is no solar radiation data before year %d." % np.min(wy23_df['Years'])) # Update the connection table. print("\rUpdating the connection table...", end=' ') d13_connect_table = {cid: d13fpath for cid in cellnames} self.connect_tables['D13'] = d13_connect_table self._save_connect_tables() print("done") def generate_d10d11_input_files(self, cellnames=None, sf_edepth=1, sf_ulai=1): """Prepare the D10 and D11 input datafiles for each cell.""" d10d11_inputdir = osp.join(self.inputdir, 'd10d11_input_files') if not osp.exists(d10d11_inputdir): os.makedirs(d10d11_inputdir) # Only keep the cells that are going to be run in HELP because we # don't need the D10 or D11 input files for those that aren't. cellnames = self.get_run_cellnames(cellnames) d10data, d11data = format_d10d11_inputs(self.grid, cellnames, sf_edepth, sf_ulai) # Write the D10 and D11 input files. d10_conn_tbl, d11_conn_tbl = write_d10d11_allcells( d10d11_inputdir, d10data, d11data) # Update the connection table. print("\rUpdating the connection table...", end=' ') self.connect_tables['D10'] = d10_conn_tbl self.connect_tables['D11'] = d11_conn_tbl self._save_connect_tables() print("done") def generate_d4d7_from_MDELCC_grid(self, path_netcdf_dir, cellnames=None): """ Prepare the D4 and D7 input datafiles for each cell from the interpolated grid of the MDDELCC. """ d4d7_inputdir = osp.join(self.inputdir, 'd4d7_input_files') if not osp.exists(d4d7_inputdir): os.makedirs(d4d7_inputdir) cellnames = self.get_run_cellnames(cellnames) N = len(cellnames) # Get the latitudes and longitudes of the resulting cells. lat_dd, lon_dd = self.get_latlon_for_cellnames(cellnames) # Generate the connectivity table between the HELP grid and the # MDDELCC interpolated daily weather grid. print('Generating the connectivity table for each cell...', end=' ') meteo_manager = NetCDFMeteoManager(path_netcdf_dir) d4_conn_tbl = {} d7_conn_tbl = {} data = [] for i, cellname in enumerate(cellnames): lat_idx, lon_idx = meteo_manager.get_idx_from_latlon( lat_dd[i], lon_dd[i]) d4fname = osp.join( d4d7_inputdir, '%03d_%03d.D4' % (lat_idx, lon_idx)) d7fname = osp.join( d4d7_inputdir, '%03d_%03d.D7' % (lat_idx, lon_idx)) d4_conn_tbl[cellnames[i]] = d4fname d7_conn_tbl[cellnames[i]] = d7fname data.append([lat_idx, lon_idx, d4fname, d7fname]) print('done') # Fetch the daily weather data from the netCDF files. data = np.unique(data, axis=0) lat_indx = data[:, 0].astype(int) lon_idx = data[:, 1].astype(int) years = range(self.year_range[0], self.year_range[1]+1) tasavg, precip, years = meteo_manager.get_data_from_idx( lat_indx, lon_idx, years) # Convert and save the weather data to D4 and D7 HELP input files. N = len(data) for i in range(N): print(("\rGenerating HELP D4 and D7 files for location " + "%d of %d (%0.1f%%)...") % (i+1, N, (i+1)/N * 100), end=' ') lat = meteo_manager.lat[lat_indx[i]] lon = meteo_manager.lon[lon_idx[i]] d4fname, d7fname = data[i, 2], data[i, 3] city = 'Meteo Grid at lat/lon %0.1f ; %0.1f' % (lat, lon) # Fill -999 with 0 in daily precip. precip_i = precip[:, i] precip_i[precip_i == -999] = 0 # Fill -999 with linear interpolation in daily air temp. tasavg_i = tasavg[:, i] time_ = np.arange(len(tasavg_i)) indx = np.where(tasavg_i != -999)[0] tasavg_i = np.interp(time_, time_[indx], tasavg_i[indx]) if not osp.exists(d4fname): save_precip_to_HELP(d4fname, years, precip_i, city) if not osp.exists(d7fname): save_airtemp_to_HELP(d7fname, years, tasavg_i, city) print('done') # Update the connection table. print("\rUpdating the connection table...", end=' ') self.connect_tables['D4'] = d4_conn_tbl self.connect_tables['D7'] = d7_conn_tbl self._save_connect_tables() print('done') def run_help_for(self, path_outfile=None, cellnames=None, tfsoil=0): """ Run help for the cells listed in cellnames and save the result in an hdf5 file. """ # Convert from Celcius to Farenheight tfsoil = (tfsoil * 1.8) + 32 tempdir = osp.join(self.inputdir, ".temp") if not osp.exists(tempdir): os.makedirs(tempdir) run_cellnames = self.get_run_cellnames(cellnames) cellparams = {} for cellname in run_cellnames: fpath_d4 = self.connect_tables['D4'][cellname] fpath_d7 = self.connect_tables['D7'][cellname] fpath_d13 = self.connect_tables['D13'][cellname] fpath_d10 = self.connect_tables['D10'][cellname] fpath_d11 = self.connect_tables['D11'][cellname] fpath_out = osp.abspath(osp.join(tempdir, str(cellname) + '.OUT')) daily_out = 0 monthly_out = 1 yearly_out = 0 summary_out = 0 unit_system = 2 # IP if 1 else SI simu_nyear = self.year_range[1] - self.year_range[0] + 1 cellparams[cellname] = (fpath_d4, fpath_d7, fpath_d13, fpath_d11, fpath_d10, fpath_out, daily_out, monthly_out, yearly_out, summary_out, unit_system, simu_nyear, tfsoil) output = run_help_allcells(cellparams) if path_outfile: savedata_to_hdf5(output, path_outfile) return output def calc_surf_water_cells(self, evp_surf, path_netcdf_dir, path_outfile=None, cellnames=None): cellnames = self.get_water_cellnames(cellnames) lat_dd, lon_dd = self.get_latlon_for_cellnames(cellnames) meteo_manager = NetCDFMeteoManager(path_netcdf_dir) N = len(cellnames) lat_indx = np.empty(N).astype(int) lon_indx = np.empty(N).astype(int) for i, cellname in enumerate(cellnames): lat_indx[i], lon_indx[i] = meteo_manager.get_idx_from_latlon( lat_dd[i], lon_dd[i]) year_range = np.arange( self.year_range[0], self.year_range[1] + 1).astype(int) tasavg, precip, years = meteo_manager.get_data_from_idx( lat_indx, lon_indx, year_range) # Fill -999 with 0 in daily precip. precip[precip == -999] = 0 nyr = len(year_range) output = {} for i, cellname in enumerate(cellnames): data = {} data['years'] = year_range data['rain'] = np.zeros(nyr) data['evapo'] = np.zeros(nyr) + evp_surf data['runoff'] = np.zeros(nyr) for k, year in enumerate(year_range): indx = np.where(years == year)[0] data['rain'][k] = np.sum(precip[indx, i]) data['runoff'][k] = data['rain'][k] - evp_surf output[cellname] = data if path_outfile: savedata_to_hdf5(output, path_outfile) return output # # For cells for which the context is 2, convert recharge and deep # # subrunoff into superfical subrunoff. # cellnames_con_2 = cellnames[self.grid[fcon] == 2].tolist() # for cellname in cellnames_con_2: # output[cellname]['subrun1'] += output[cellname]['subrun2'] # output[cellname]['subrun1'] += output[cellname]['recharge'] # output[cellname]['subrun2'][:] = 0 # output[cellname]['recharge'][:] = 0 # # For cells for which the context is 3, convert recharge into # # deep runoff. # cellnames_con_3 = cellnames[self.grid[fcon] == 3].tolist() # for cellname in cellnames_con_3: # output[cellname]['subrun2'] += output[cellname]['recharge'] # output[cellname]['recharge'][:] = 0 # # Comput water budget for cells for which the context is 0. # cellnames_con_2 = cellnames[self.grid[fcon] == 0].tolist() # # meteo_manager = NetCDFMeteoManager(path_netcdf_dir) # # for cellname in cellnames_run0: # Save the result to an hdf5 file. # ---- Utilities def get_water_cellnames(self, cellnames): """ Take a list of cellnames and return only those that are considered to be in a surface water area. """ if cellnames is None: cellnames = self.cellnames else: # Keep only the cells that are in the grid. cellnames = self.grid['cid'][self.grid['cid'].isin(cellnames)] # Only keep the cells for which context is 0. cellnames = self.grid['cid'][cellnames][self.grid['context'] == 0] return cellnames.tolist() def get_run_cellnames(self, cellnames): """ Take a list of cellnames and return only those that are in the grid and for which HELP can be run. """ if cellnames is None: cellnames = self.cellnames else: # Keep only the cells that are in the grid. cellnames = self.grid['cid'][self.grid['cid'].isin(cellnames)] # Only keep the cells that are going to be run in HELP because we # don't need the D4 or D7 input files for those that aren't. cellnames = self.grid['cid'][cellnames][self.grid['run'] == 1].tolist() return cellnames def get_latlon_for_cellnames(self, cells): """ Return a numpy array with latitudes and longitudes of the provided cells cid. Latitude and longitude for cids that are missing from the grid are set to nan. """ lat = np.array(self.grid['lat_dd'].reindex(cells).tolist()) lon = np.array(self.grid['lon_dd'].reindex(cells).tolist()) return lat, lon class NetCDFMeteoManager(object): def __init__(self, dirpath_netcdf): super(NetCDFMeteoManager, self).__init__() self.dirpath_netcdf = dirpath_netcdf self.lat = [] self.lon = [] self.setup_ncfile_list() self.setup_latlon_grid() def setup_ncfile_list(self): """Read all the available netCDF files in dirpath_netcdf.""" self.ncfilelist = [] for file in os.listdir(self.dirpath_netcdf): if file.endswith('.nc'): self.ncfilelist.append(osp.join(self.dirpath_netcdf, file)) def setup_latlon_grid(self): if self.ncfilelist: netcdf_dset = netCDF4.Dataset(self.ncfilelist[0], 'r+') self.lat = np.array(netcdf_dset['lat']) self.lon = np.array(netcdf_dset['lon']) netcdf_dset.close() def get_idx_from_latlon(self, latitudes, longitudes, unique=False): """ Get the i and j indexes of the grid meshes from a list of latitude and longitude coordinates. If unique is True, only the unique pairs of i and j indexes will be returned. """ try: lat_idx = [np.argmin(np.abs(self.lat - lat)) for lat in latitudes] lon_idx = [np.argmin(np.abs(self.lon - lon)) for lon in longitudes] if unique: ijdx = np.vstack({(i, j) for i, j in zip(lat_idx, lon_idx)}) lat_idx = ijdx[:, 0].tolist() lon_idx = ijdx[:, 1].tolist() except TypeError: lat_idx = np.argmin(np.abs(self.lat - latitudes)) lon_idx = np.argmin(np.abs(self.lon - longitudes)) return lat_idx, lon_idx def get_data_from_latlon(self, latitudes, longitudes, years): """ Return the daily minimum, maximum and average air temperature and daily precipitation """ lat_idx, lon_idx = self.get_idx_from_latlon(latitudes, longitudes) return self.get_data_from_idx(lat_idx, lon_idx, years) def get_data_from_idx(self, lat_idx, lon_idx, years): try: len(lat_idx) except TypeError: lat_idx, lon_idx = [lat_idx], [lon_idx] tasmax_stacks = [] tasmin_stacks = [] precip_stacks = [] years_stack = [] for year in years: print('\rFetching daily weather data for year %d...' % year, end=' ') filename = osp.join(self.dirpath_netcdf, 'GCQ_v2_%d.nc' % year) netcdf_dset = netCDF4.Dataset(filename, 'r+') tasmax_stacks.append( np.array(netcdf_dset['tasmax'])[:, lat_idx, lon_idx]) tasmin_stacks.append( np.array(netcdf_dset['tasmin'])[:, lat_idx, lon_idx]) precip_stacks.append( np.array(netcdf_dset['pr'])[:, lat_idx, lon_idx]) years_stack.append( np.zeros(len(precip_stacks[-1][:])).astype(int) + year) netcdf_dset.close() print('done') tasmax = np.vstack(tasmax_stacks) tasmin = np.vstack(tasmin_stacks) precip = np.vstack(precip_stacks) years = np.hstack(years_stack) return (tasmax + tasmin)/2, precip, years def load_grid_from_csv(path_togrid): """ Load the csv that contains the infos required to evaluate regional groundwater recharge with HELP. """ print('Reading HELP grid from csv...', end=' ') grid = pd.read_csv(path_togrid) print('done') fname = osp.basename(path_togrid) req_keys = ['cid', 'lat_dd', 'lon_dd', 'run'] for key in req_keys: if key not in grid.keys(): raise KeyError("No attribute '%s' found in %s" % (key, fname)) # Make sure that cid is a str. grid['cid'] = np.array(grid['cid']).astype(str) # Set 'cid' as the index of the dataframe. grid.set_index(['cid'], drop=False, inplace=True) return grid
python
<reponame>eregon/pylos package pylos; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.nio.channels.FileChannel; import java.util.Properties; import java.util.logging.ConsoleHandler; import java.util.logging.FileHandler; import java.util.logging.Handler; import java.util.logging.Level; import java.util.logging.Logger; import java.util.logging.SimpleFormatter; public class Config { public static int[] RESOLUTION = { 800, 640 }; public static int AI_DEPTH = 4; public static boolean LOW_GRAPHICS = false; public static int RMI_PORT = 1723; public static long CREATE_RMI_REGISTRY_TIMEOUT = 5000; public final static boolean CAN_MOVE_OTHER = false; public final static boolean FIRE = false; static final File logDir = new File(Pylos.rootPath + "/log"); static final File defaultPropertiesFile = new File(Pylos.rootPath + "/assets/Configuration/config.properties"); static final File propertiesFile = new File(Pylos.rootPath + "/config.properties"); public static void configureProject() { Properties properties = new Properties(); if (!propertiesFile.exists()) { FileChannel input = null, output = null; try { input = new FileInputStream(defaultPropertiesFile).getChannel(); output = new FileOutputStream(propertiesFile).getChannel(); input.transferTo(0, input.size(), output); } catch (Exception e) { System.err.println("Could not copy default configuration file: " + e); } finally { try { if (input != null) input.close(); if (output != null) output.close(); } catch (IOException e) { } } } try { properties.load(new FileInputStream(propertiesFile)); RESOLUTION[0] = Integer.valueOf(properties.getProperty("screen.width", Integer.toString(RESOLUTION[0]))); RESOLUTION[1] = Integer.valueOf(properties.getProperty("screen.height", Integer.toString(RESOLUTION[1]))); AI_DEPTH = Integer.valueOf(properties.getProperty("ai.depth", Integer.toString(AI_DEPTH))); LOW_GRAPHICS = Boolean.valueOf(properties.getProperty("graphics.low", Boolean.toString(LOW_GRAPHICS))); RMI_PORT = Integer.valueOf(properties.getProperty("rmi.port", Integer.toString(RMI_PORT))); CREATE_RMI_REGISTRY_TIMEOUT = Integer.valueOf(properties.getProperty("rmi.timeout", Long.toString(CREATE_RMI_REGISTRY_TIMEOUT))); } catch (Exception e) { e.printStackTrace(); } configureLogger(); } public static void configureLogger() { // Hide everything under Warning for default handlers for (Handler handler : Logger.getLogger("").getHandlers()) { handler.setLevel(Level.WARNING); } if (!logDir.exists()) { try { logDir.mkdir(); } catch (Exception e) { System.err.println("Could not create log dir"); } } createFileLogger(Pylos.logger); createFileLogger(Pylos.AIlogger); createFileLogger(Logger.getLogger("com.jme3")); Logger.getLogger("com.jme3").setLevel(Level.WARNING); createFileLogger(Logger.getLogger("de.lessvoid.nifty")); } public static void createFileLogger(Logger logger) { try { FileHandler fh = new FileHandler(logDir + "/" + logger.getName() + ".log"); fh.setFormatter(new SimpleFormatter()); logger.addHandler(fh); } catch (Exception e) { ConsoleHandler ch = new ConsoleHandler(); logger.addHandler(ch); e.printStackTrace(); } } }
java
<gh_stars>10-100 { "user": "xingrz", "repos": 1, "login": "xingrz", "id": 288288, "avatar_url": "https://avatars1.githubusercontent.com/u/288288?v=3", "url": "https://api.github.com/users/xingrz", "html_url": "https://github.com/xingrz", "followers_url": "https://api.github.com/users/xingrz/followers", "following_url": "https://api.github.com/users/xingrz/following{/other_user}", "gists_url": "https://api.github.com/users/xingrz/gists{/gist_id}", "starred_url": "https://api.github.com/users/xingrz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/xingrz/subscriptions", "organizations_url": "https://api.github.com/users/xingrz/orgs", "repos_url": "https://api.github.com/users/xingrz/repos", "events_url": "https://api.github.com/users/xingrz/events{/privacy}", "received_events_url": "https://api.github.com/users/xingrz/received_events", "type": "User", "site_admin": false, "name": "XiNGRZ", "company": "@oxoooo ", "blog": "https://xingrz.me", "location": "Canton, China", "email": "<EMAIL>", "hireable": null, "bio": "这个世界会好吗", "public_repos": 133, "public_gists": 26, "followers": 392, "following": 77, "created_at": "2010-05-27T04:00:50Z", "updated_at": "2017-02-23T17:35:34Z" }
json
What's the story? AC Milan and Brazil legend Kaka has already picked his favorite for the Ballon d'Or 2019, with that player being neither Cristiano Ronaldo nor Lionel Messi. The 2007 Ballon d'Or and FIFA World Player of the Year thinks that it's time the honor is bestowed upon a defender and according to him Liverpool's formidable center-back Virgil van Dijk is the only defender worthy of the golden trophy at the moment. Until last year, when Real Madrid star Luka Modric was voted as the winner at the ceremonious gala, Kaka remained the last player to have lifted the trophy, considered to be the biggest individual decoration in football. Over the years, it has been seen that more often than not, there has been an inclination towards awarding this highly sought-after prize to attackers, with strikers, attacking midfielders and wingers taking home the trophy 15 times since the turn of the century. In what can be described as an exception, Fabio Cannavaro won the award in 2006 and he remains the last defender with the honor to his name. With Van Dijk winning the UEFA Champions League with the Reds and also being voted the PFA Players' Player of the Year, he has a strong claim to the award. Now former winner Kaka has backed him to clinch the acclaimed prize, joining plenty other admirers of the Dutch captain. He told Sky Italia (Via Liverpool Echo): "We will see what happens in the future. Would I give the Ballon d’Or to Virgil van Dijk? I had some discussions talking about it with friends and with my brother and the name we chose is really his." "He had a great season in the Premier League and won the Champions League playing in a crazy way." He also called for defenders to get recognition at the ceremony. He added: "We’ll see what the judges will decide but it’s time to reward a defender." What's next? Messi has had a great season with Barcelona and his odds for lifting the trophy for a record sixth time remain high. He will be assured of the title if he wins the Copa America with Argentina. In the meantime, we will have to wait and see if this is the year a defender rises above the flamboyant attackers. Van Dijk's Netherlands will face Ronaldo's Portugal in the maiden UEFA Nations League final on 10 June.
english
At a time when the entire world was dealing with the outbreak of the Covid-19 pandemic, Indian companies, too, struggled to continue operations and deal with broken supply chains and rapidly changing consumer demand. However, one company —Procter & Gamble Hygiene and Health Care (PGHH) — managed to deliver strong double-digit growth in both sales and profit after tax for the 12 months ended June 2021 (FY21). Remarkably, the toughest year for the company in several decades also turned out to be a comeback year for it. The Vicks-to-Whisper manufacturer delivered strong sales during the first half of the past decade, with a 20. 04 per cent compounded annual growth rate (CAGR) over FY10-15. While sales stagnated over the next three years, it made a strong comeback during the pandemic period, especially in FY21, led by increasing sales in the feminine hygiene care segment. TO READ THE FULL STORY, SUBSCRIBE NOW NOW AT JUST RS 249 A MONTH. What you get on Business Standard Premium? - Unlock 30+ premium stories daily hand-picked by our editors, across devices on browser and app. - Pick your 5 favourite companies, get a daily email with all news updates on them. - Full access to our intuitive epaper - clip, save, share articles from any device; newspaper archives from 2006. - Preferential invites to Business Standard events. - Curated newsletters on markets, personal finance, policy & politics, start-ups, technology, and more.
english
<filename>resources/in/ayush-and-health-science-university-chhattisgarh.json {"name":"<NAME>","alt_name":null,"country":"India","state":null,"address":{"street":"G. E. Roas","city":"Raipur","province":"Chhattisgarh","postal_code":"429001"},"contact":{"telephone":null,"website":"http:\/\/cghealthuniv.com\/","email":null,"fax":null},"funding":"Public","languages":null,"academic_year":null,"accrediting_agency":null}
json
The Indian women’s hockey team remained unbeaten on their South Africa tour thus far, registering a 2-2 draw against the host in its fourth match on Sunday. This was India’s last match against the South African side before it takes on world No.1 Netherlands on January 23. Vaishnavi Vithal Palkhe, playing in her debut tour for the senior side, starred for India scoring two goals that helped them hold South Africa to a draw. South Africa made a strong start on Sunday, after a series of losses against India. The home team had lost 1-5, 0-7 and 0-4 to India thus far. Determined to end the matches against India on a good note, South Africa were first to make a breakthrough when they capitalised on an Indian infringement. The penalty stroke awarded to them was utilised well with Quanita Bobbs beating young goalie Bichu Devi Kharibam to convert the goal in the eighth minute. India was able to equalise in the 29th minute when a good PC variation helped it score a goal. It was Vaishnavi who did well to remain calm and pump the ball into the post. South Africa managed to snatch the lead again when Tarryn Lombard struck a field goal in the 35th minute. The next few minutes remained tense. Vaishnavi finally brought some respite when she converted a PC in the 51st minute. India did well to tighten their defence in the dying minutes of the match to ensure they walk away with a draw.
english
NAIROBI, Kenya Apr 22 – Azimio Leader Raila Odinga has called on the Catholic Church to join forces with him in his pursuit of finding the “truth” on what transpired during the August 2022 elections. Odinga made the plea on Saturday in a statement that was in response to the Catholic Bishops’ stance that his demonstrations were “violent, unconstitutional, and uncalled for”. The former Prime Minister however disagreed with the “church’s characterization of the public protests” noting that they have always been peaceful and faulted the police for the ensuing violence. “We hope that the church will join Kenyans in seeking to establish the truth about last year’s elections by scrutinizing the servers in the best interests of the nation,” Odinga said. Odinga invited the Catholic Church “to partner with Kenyans in calling on the State to respect section 37 of the Constitution”. “Every person has the right, peaceably and unarmed, to assemble, demonstrate, picket, and present petitions to public authorities,” he said. He maintained that the opening of the servers will set the record straight on who won the election. “The core doctrine of Christianity, which is a belief in the truth, the whole truth, and nothing but the truth, guides the push for a forensic audit,” he said. Azimio coalition on March 20, 2023, launched anti-government protests premised on the issues of the election and the high cost of living. For straight two weeks, the coalition staged protests in Nairobi that degenerated into violence. Odinga later suspended them after President Ruto invited them for talks via parliament. Odinga who has since threatened to call for fresh demonstrations wants the process to be extra-parliamentary. A fourteen-member committee, consisting of seven members from the Kenya Kwanza Alliance and the Azimio team, will begin talks on electoral reforms and other issues that may arise. The Co-Chairs of the parliamentary bi-partisan team met on April 20, 2023, and resolved to develop separate frameworks that will guide the talks.
english
<filename>rust/pyapi/src/_helpers/mod.rs<gh_stars>0 use crate::pypath; use pyo3::prelude::*; use pyo3::types::PyDict; use std::collections::HashMap; pub fn to_py_paths<T: std::fmt::Display>(paths: &Vec<T>) -> PyResult<Vec<PyObject>> { let gil = Python::acquire_gil(); let py = gil.python(); let mut retn: Vec<PyObject> = vec![]; for p in paths { retn.push(pypath!(py, format!("{}", p))); } Ok(retn) } pub fn hashmap_to_pydict<'p>( py: Python<'p>, hmap: &HashMap<String, String>, ) -> PyResult<&'p PyDict> { let py_config = PyDict::new(py); for (k, v) in hmap.iter() { py_config.set_item(k, v)?; } Ok(py_config) }
rust
/** * Copyright (C) 2019 Expedia Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.hotels.beans.sample.mutable; import java.math.BigInteger; import java.util.List; import lombok.Getter; import lombok.Setter; /** * Mutable object instantiable only through a Builder. */ @Getter @Setter public final class MutableToFooWithBuilder { private String name; private BigInteger id; private List<String> list; private List<MutableToSubFoo> nestedObjectList; private MutableToSubFoo nestedObject; private MutableToFooWithBuilder() { } public static class Builder { private String name; private BigInteger id; private List<String> list; private List<MutableToSubFoo> nestedObjectList; private MutableToSubFoo nestedObject; public Builder withName(final String name) { this.name = name; return this; } public Builder withId(final BigInteger id) { this.id = id; return this; } public MutableToFooWithBuilder build() { MutableToFooWithBuilder mutableToFooWithBuilder = new MutableToFooWithBuilder(); mutableToFooWithBuilder.id = this.id; mutableToFooWithBuilder.name = this.name; mutableToFooWithBuilder.list = this.list; mutableToFooWithBuilder.nestedObjectList = this.nestedObjectList; mutableToFooWithBuilder.nestedObject = this.nestedObject; return mutableToFooWithBuilder; } } }
java
65-year-old Hollywood actor Bill Murray, who is known as the main actor in the films "Groundhog Day" and "Ghostbusters", is famous for his extraordinary behavior. The other day he again surprised fans with an unusual trick: he worked as a bartender in one of the New York bars. However, as it turned out later, the owner of the institution was the first son of actor Homer. The fact that the celebrity of Hollywood will spill alcohol in the bar 21 Greenpoint, it became known on September 15. On the site of the institution the administration published the following announcement: "We are pleased to inform you that on the 16th and 17th of September at the bar counter you will be served by the legendary Bill Murray. He will be commissioned to work with tequila, and all other cocktails for you will be prepared by the chief of the bar Sean McClure. Come! It will be fun! ". The plan to attract new customers at the bar 21 Greenpoint worked. Clients came to the institution in droves and drank it until morning. In the midst of night Murray turned to the audience: "I'm very happy that my son Homer did not follow in my footsteps and did not become an actor. I am very pleased to tell you that he decided to support our family tradition - to invite people to his place, to sit them at the table and treat everyone with a drink. Let's drink to Homer, to his partners, friends and all those who came to support him on this wonderful evening. " - Bill Murray or Tom Hanks? For his life, the actor has repeatedly found himself behind the bar. 6 years ago, Bill surprised not only the guests of the Shangro-La restaurant in Austin, Texas, but also many of his fans. One day he decided to support the owners of the establishment and offered them their help as a barman. In addition, Murray "worked" as a waiter in the film "Coffee and Cigarettes" by Jim Jarmusch. To this role, Bill approached very seriously, about a week of training to carry food and drinks, and also pour them on glasses. Judging by how reverently the famous actor treat this profession, the eldest son Bill has everything with the bar should turn out.
english
<filename>Classes/ex17.py """" Crie uma Fazenda de Bichinhos instanciando vários objetos bichinho e mantendo o controle deles através de uma lista. Imite o funcionamento do programa básico, mas ao invés de exigis que o usuário tome conta de um único bichinho, exija que ele tome conta da fazenda inteira. Cada opção do menu deveria permitir que o usuário executasse uma ação para todos os bichinhos (alimentar todos os bichinhos, brincar com todos os bichinhos, ou ouvir a todos os bichinhos). Para tornar o programa mais interessante, dê para cada bichinho um nivel inicial aleatório de fome e tédio. """ # todo: terminar
python
<reponame>NachiMK/nodejs { "S3DataFile": "s3://int-ods-data/unit-test/client-benefits/schema-builder/client-benefits-bare-data.json", "Overwrite": "yes", "S3SchemaFile": "s3://int-ods-data/unit-test/client-benefits/schema-builder/client-benefits-bare-combined-20190123_124601663.json", "S3OutputBucket": "int-ods-data", "S3UniformJsonPrefix": "unit-test/client-benefits/bare-UniformJSON-", "S3FlatJsonPrefix": "unit-test/client-benefits/bare-FlatJSON-", "TableName": "client-benefits", "BatchId": 111, "LogLevel": "info" }
json
<reponame>dmayerdesign/giv { "minify": true, "options": [ "setClasses" ], "feature-detects": [ "canvas", "video", "css/animations", "css/backgroundsize", "css/backgroundsizecover", "css/boxsizing", "css/flexbox", "css/fontface", "css/transforms", "css/transforms3d", "css/transitions", "svg/asimg", "touchevents" ] }
json
{ "vorgangId": "237539", "VORGANG": { "WAHLPERIODE": "19", "VORGANGSTYP": "Schriftliche Frage", "TITEL": "Eingang von im Zusammenhang mit Geldwäsche bzw. Terrorfinanzierung stehenden Transaktionen in den Geldkreislauf", "AKTUELLER_STAND": "Beantwortet", "SIGNATUR": "", "GESTA_ORDNUNGSNUMMER": "", "WICHTIGE_DRUCKSACHE": { "DRS_HERAUSGEBER": "BT", "DRS_NUMMER": "19/3068", "DRS_TYP": "Schriftliche Fragen", "DRS_LINK": "http://dipbt.bundestag.de:80/dip21/btd/19/030/1903068.pdf" }, "EU_DOK_NR": "", "SCHLAGWORT": [ "Financial Intelligence Unit Deutschland", { "_fundstelle": "true", "__cdata": "Geldwäsche" }, { "_fundstelle": "true", "__cdata": "Terrorismus" } ], "ABSTRAKT": "Originaltext der Frage(n): \r\n \r\nWie viele Transaktionen (Geldwert in Euro), die im Zusammenhang mit Geldwäsche stehen oder der Terrorfinanzierung dienen, konnten die zuständigen Behörden seit dem 26. Juni 2017 bis heute nicht vor einem Eingang in den Geldkreislauf anhalten oder aussetzen (vgl. Schriftliche Stellungnahme des Thüringer Landeskriminalamtes zum Fachgespräch im Finanzausschuss des Deutschen Bundestages am 21. März 2018 zur \"Aktuellen Situation bei der Financial Intelligence Unit\"; bitte in tabellarischer Form sortiert nach Datum der Meldung nach § 43 Absatz 1 des Geldwäschegesetzes und Datum der Weiterleitung der Financial Intelligence Unit an die zuständigen Ermittlungsbehörden der Bundesländer auflisten)?" }, "VORGANGSABLAUF": { "VORGANGSPOSITION": { "ZUORDNUNG": "BT", "URHEBER": "Schriftliche Frage/Schriftliche Antwort ", "FUNDSTELLE": "29.06.2018 - BT-Drucksache 19/3068, Nr. 2", "FUNDSTELLE_LINK": "http://dipbt.bundestag.de:80/dip21/btd/19/030/1903068.pdf", "PERSOENLICHER_URHEBER": [ { "VORNAME": "Markus", "NACHNAME": "Herbrand", "FUNKTION": "MdB", "FRAKTION": "FDP", "AKTIVITAETSART": "Frage" }, { "VORNAME": "Christine", "NACHNAME": "Lambrecht", "FUNKTION": "Parl. Staatssekr.", "RESSORT": "Bundesministerium der Finanzen", "AKTIVITAETSART": "Antwort" } ] } } }
json
Every woman who has decided to take on herself and reduce weight, is faced with the need to choose a method. There are a lot of them - these are different diets, and nutrition systems , and exercise complexes. The latter is very much - Chinese, Japanese, Thai gymnastics for weight loss, classic Soviet options and much more. In addition to exercises based on statics or repetitions, there is also a breathing gymnastics for weight loss - bodyflex , oxysize and many others. Let's consider some variants. Tibetan gymnastics for weight loss "Oko revival" Such gymnastics to lose weight helps not the first generation of people. It was brought to Europe very long ago and has already gained popularity. The complex is designed for 15 minutes, there are only 5 exercises. According to the theory of Tibetan monks, there are 19 vortices in the human body - energy centers (7 main chakras and 12 additional chakras). It is important to make sure that the energy circulates in them quickly. - The starting position is standing, hands are stretched to the sides at shoulder level. Rotate around your axis from left to right until light dizziness. Beginners can be limited to 3-5 revolutions. The maximum number of revolutions is not more than 21. - The starting position - lying on the back, hands along the trunk, palms with tightly connected fingers on the floor, the head is raised, the chin is pressed to the chest. Raise straight up straight legs, without lifting the pelvis from the floor. Then slowly lower the head and legs to the floor. Repeat from the beginning. - The starting position is on the knees, palms on the back surface of the muscles of the thighs, under the buttocks. Tilt your head forward, press the chin to your chest. Tilting the head back-up, put the chest up and bend the spine back, then return to the starting position. Repeat from the beginning. - Sitting on the floor with an even back, stretch straight legs in front of him, feet are located approximately on the width of the shoulders. Place your hands on the floor at the sides of your hips, your fingers look forward. Lower your head, pressing your chin to your chest. Tilt your head, and then lift the trunk to a horizontal position. Hips and body at the end should be located in one horizontal plane. Quit for a few seconds and return to the starting position. - The starting position - the forefoot lying flattened, the emphasis on the toes and palms wider than the shoulders, the knees and the pelvis of the floor do not touch, the fingers of the hands look forward. First tilt your head as far as you can. Then assume a position where the body looks like an upwardly directed acute angle, press the chin to the chest. At the same time, press your chin against your chest. Return to the starting position. It is important to breathe properly. Begin with a deep exhalation and go to a deep breath. Watch your breath, do not knock it down or delay it. Chinese gymnastics involves a small complex of fairly simple exercises. This complex is recommended to be performed daily in the mornings. Exercise "The Whole" The starting position - lying on the floor, legs together, bent at an angle of 90 degrees parallel to the floor. Slowly inhale, while drawing in the stomach. Hold your breath. Exhaling, slowly inflate the stomach. Repeat 30-60 times. Optimal exercise on an empty stomach or during a feeling of hunger. It will pass, and it is worth to refrain from food for a while. Exercise "The Big Panda" The starting position - sitting on the floor, the stomach is drawn in, the legs near the chest, are clasped in hands. Lean back, keeping balance. The code of the back will be close to the floor, in one move, go back to the starting position, without letting the knees out of your hands. Repeat 5-6 times. Then do the same, but with a slope first left, then right. Repeat six times. Repeat these exercises regularly, and you will forget about problems with excess weight!
english
New Delhi: Tata Motors is offering various benefits and offers on Tata Harrier, Safari, Tigor and Tiago during the moth of September. Tata Motors is also offering discounts on the Tata Tigor CNG for the first time this month. Let’s take a detailed look at the deals and discounts offered by Tata Motors this month. The Tata Harrier gets a total discount of Rs 40,000 in the form of exchange bonus while offering an additional Rs 5,000 as a corporate discount. The discount applies to all variants of the Harrier SUV, which is powered by a standard 168bhp 2. 0-litre diesel engine mated to a manual or automatic gearbox. The Tata Safari also gets benefits worth Rs 40,000 in the form of an exchange bonus, while the automaker does not offer any corporate discounts. Also, like the Harrier, all variants of the Tata Safari have an edge. Tata Motors is offering benefits on Tigor CNG variants for the first time. Tata Tigor CNG will get Rs 15,000 cashback and Rs 10,000 exchange bonus for a total of Rs 25,000. The Tigor CNG is powered by a 1. 2-litre engine producing 69bhp and 95Nm of torque, mated to a manual gearbox. Also Read :- Cyrus Mistry Accident: How Safe Is Mercedes GLC? The Tata Tigor gets benefits worth Rs 20,000 on all variants which includes Rs 10,000 cashback and Rs 10,000 exchange bonus. The petrol Tata Tigor is powered by the same 1. 2-litre engine as the CNG variant but develops 84 bhp of power and 113 Nm of torque. The Tata Tiago hatchback will get a cash discount of Rs 10,000 and an exchange bonus of Rs 10,000, taking the total benefits to Rs 20,000. Some dealerships are also offering an additional Rs 3,000 corporate discount on the hatchback. However, unlike the Tigor, the CNG variants of the Tiago do not get any discounts.
english
<filename>packages/engine/src/scene/functions/loaders/TransformFunctions.test.ts<gh_stars>0 import { ComponentJson } from '@xrengine/common/src/interfaces/SceneInterface' import assert from 'assert' import { Euler, Quaternion } from 'three' import { Engine } from '../../../ecs/classes/Engine' import { createWorld } from '../../../ecs/classes/World' import { getComponent, hasComponent } from '../../../ecs/functions/ComponentFunctions' import { createEntity } from '../../../ecs/functions/EntityFunctions' import { TransformComponent } from '../../../transform/components/TransformComponent' import { deserializeTransform } from './TransformFunctions' const EPSILON = 10e-8 describe('TransformFunctions', () => { it('deserializeTransform', () => { const world = createWorld() Engine.currentWorld = world const entity = createEntity() const quat = new Quaternion().random() const euler = new Euler().setFromQuaternion(quat, 'XYZ') const sceneComponentData = { position: { x: 1, y: 2, z: 3 }, rotation: { x: euler.x, y: euler.y, z: euler.z }, scale: { x: 1.25, y: 2.5, z: 5 } } const sceneComponent: ComponentJson = { name: 'transform', props: sceneComponentData } deserializeTransform(entity, sceneComponent) assert(hasComponent(entity, TransformComponent)) const { position, rotation, scale } = getComponent(entity, TransformComponent) assert.equal(position.x, 1) assert.equal(position.y, 2) assert.equal(position.z, 3) // must compare absolute as negative quaternions represent equivalent rotations assert(Math.abs(rotation.x) - Math.abs(quat.x) < EPSILON) assert(Math.abs(rotation.y) - Math.abs(quat.y) < EPSILON) assert(Math.abs(rotation.z) - Math.abs(quat.z) < EPSILON) assert(Math.abs(rotation.w) - Math.abs(quat.w) < EPSILON) assert.equal(scale.x, 1.25) assert.equal(scale.y, 2.5) assert.equal(scale.z, 5) }) })
typescript
“Sengol” holds significant symbolism as it was originally presented to the first Prime Minister of India, Jawaharlal Nehru. Union home minsiter Amit Shah said Monday a golden sceptre called 'Sengol' would be installed at a prominent spot in the new Parliament building, which is to be inaugurated by prime minister Narendra Modi - despite a massive protest by the opposition, which has demanded President Droupadi Murmu do the honours - at noon on Sunday. The sceptre, or the 'Sengol', is a significant item; it was presented to Jawaharlal Nehru, India's first prime minister, as a symbol of the transfer of power from the British. The word 'Sengol' is believed to have been derived from the Tamil word 'semmai', which refers to excellence. Shah emphasised the role played by the 'Sengol' sceptre in the transfer of power and said that on being told of its importance (and after due verification), Modi ensured it would hold pride of place in the new Parliament building. "The day of new Parliament House inauguration was chosen after deciding this should be put before the nation," Shah said. History of 'Sengol' The importance of the 'Sengol' sceptre emerged when Lord Mountbatten, the then Viceroy of British India, asked Nehru about a symbolic transfer of power. Nehru sought the advice of C Rajagopalachari, the last Governor-General of India and who hailed from Thorapalli in Tamil Nadu's Krishnagiri district (then the Madras Presidency). Rajaji, as he was popularly called, suggested the use of the 'Sengol'; he was inspired by the the Chola dynasty, where a similar ceremony was held to transfer power between kings. In addition to the presentation of the sceptre, an order called 'aanai' in Tamil - which bestowed on the new ruler the responsibility to govern with unwavering adherence to the principles of 'dharma - was also handed down to the new king. Rajaji enlisted the support of a religious body in Tamil Nadu's Tanjore district to craft the 'Sengol'. Chennai-based jewellers Vummidi Bangaru Chetty created the object. On August 14, 1947, a momentous occasion unfolded as three priests from the Tanjore religous body carried the 'Sengol', presiding over proceedings with great reverence. They then handed the 'Sengol' to Nehru, thereby marking the transfer of power. The 'Sengol' is five feet long and features the majestic figure of Nandi, the divine bull, on top as a representation of 'nyaya', or the embodiment of justice and fairness.
english
''' Created on Oct 2020 @author: <NAME> @copyright: MIT license, see http://opensource.org/licenses/MIT ''' from abc import ABCMeta, abstractmethod from typing import Optional from ..command import ICommand class IService(metaclass=ABCMeta): @abstractmethod def __call__(self, command: ICommand) -> Optional[object]: pass
python
package com.gnufsociety.openchallenge.customui; import android.content.Context; import android.graphics.Color; import android.support.v4.content.ContextCompat; import android.util.AttributeSet; import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.view.animation.BounceInterpolator; import android.widget.ImageButton; import com.gnufsociety.openchallenge.R; /** * Created by Leonardo on 14/01/2017. */ /** * New view that extends ImageButton, with like animation and image changing * **/ public class FavoriteButton extends ImageButton { public boolean liked = false; public FavoriteButton(Context context, AttributeSet attrs) { super(context, attrs); } //if button is liked set to false and change public void likeIt(){ likeAnimation(); } private void likeAnimation() { Animation anim = AnimationUtils.loadAnimation(this.getContext(), R.anim.anim_scale); //bounce effect anim.setInterpolator(new BounceInterpolator()); anim.setAnimationListener(new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { //change favorite image when animation start setLike(); } @Override public void onAnimationEnd(Animation animation) { } @Override public void onAnimationRepeat(Animation animation) { } }); startAnimation(anim); } private void setLike(){ if (liked){ setImageResource(R.drawable.favorite_border_16); setColorFilter(ContextCompat.getColor(getContext(),R.color.white)); liked = false; } else { setImageResource(R.drawable.favorite_16); setColorFilter(Color.RED); liked = true; } } public void colorLike(){ setImageResource(R.drawable.favorite_16); setColorFilter(Color.RED); } public void decolorLike(){ setImageResource(R.drawable.favorite_border_16); setColorFilter(ContextCompat.getColor(getContext(),R.color.white)); } }
java
The judgement will decide the fate of the Eknath Shinde government in Maharashtra and also of the ousted Shiv Sena leader Udhhav Thackrey while answering some important questions of law. By Srishti Ojha: A Constitution bench headed by the Chief Justice of India (CJI), DY Chandrachud, will deliver its crucial verdict today in the pleas pertaining to the Maharashtra political crisis. The judgement will decide the fate of the Eknath Shinde government in Maharashtra and also of the ousted Shiv Sena leader Udhhav Thackrey while answering some important questions of law. In August last year, a bench, led by then CJI NV Ramana, had observed that the case matters merit reference under Article 145(3) of the Constitution to a five-judge bench, as it raises other substantial questions of law as to the interpretation of the Constitution. The following questions of law were referred to and will be decided on by the Constitution bench of the top court tomorrow: 1. Whether a notice for the removal of a Speaker restricts him from continuing with disqualification proceedings under the Tenth Schedule of the Constitution, as held by this Court in Nebam Rebia (supra)? 2. Whether a petition under Article 226 or Article 32 lies, inviting a decision on a disqualification petition by the High Courts or the Supreme Court, as the case may be? 3. Can a court hold that a member is "deemed" to be disqualified, by virtue of his/her actions, absent a decision by the Speaker? 4. What is the status of proceedings in the House during the pendency of disqualification petitions against the members? 5. If the decision of a Speaker that a member has incurred disqualification under the Tenth Schedule relates back to the date of the action complained of, then what is the status of proceedings that took place? during the pendency of a disqualification petition? 6. What is the impact of the removal of Paragraph 3 of the Tenth Schedule? 7. What is the scope of the power of the Speaker to determine the Whip and the leader of the house legislature party? What is the interplay of the same with respect to the provisions of the Tenth Schedule? 8. Are intra-party decisions amenable to judicial review? What is the scope of the same? 9. What is the extent of discretion and power of the Governor to invite a person to form the Government, and whether the same is amenable to judicial review? 10. What is the scope of the powers of the Election Commission of India with respect to the determination of a split within a party?
english
Hubbali, May 9 (IANS) After a month-long high-decibel campaign for the May 10 Assembly polls in Karnataka, the political parties are now into a silent door-to-door campaigning to ensure that votes fall in their kitty. Congress leader and former Chief Minister of Karnataka, Jagadish Shettar went to meet several of his old accomplices, relatives and family friends. He also paid a visit to the Lingayat mutts and also the local temples. His wife Shilpa Shettar and daughter-in-law, Sreya Angadi accompanied the leader. Shettar, a six-term MLA from Hubbali on a BJP ticket, had joined Congress after he was denied a ticket. He had complained that he was humiliated by leaders like Dharmendra Pradhan, who as the election in-charge of Karnataka, wanted him to retire from active public life. Shettar said that he is only 67 and has ten more years of politics left in him. He resigned from the BJP and joined Congress and is contesting from his traditional seat of Hubbali- Dharward centre. Pitted against BJP state general secretary, Mahesh Tengipkayi, Shettar is confident that he would win with a good majority. Speaking to IANS on the penultimate day of campaign at his Hubbali residence, the former Chief Minister said, "The BJP is fighting the elections to defeat Jagadish Shettar whereas we are fighting for a win. This is retrogressive politics of the BJP and people of Hubbali would give a fitting reply. I am confident of a victory with a good margin. " The BJP candidate Mahesh Tengipikayi also exuded confidence in his victory and had told IANS on Monday that the BJP would win with a huge margin in the traditional BJP bastion of Hubbali central. The Congress candidate from the Gadag Assembly seat, H. K. Patil also was going around meeting people and acquaintances and visited a few temples and mosques in the area. H. K. Patil, the sitting MLA is fighting a tough battle with Anil Menasinakai of the BJP. While Patil had won the seat with a huge margin in 2013, in 2018 he had to contend with a margin of 1. 800 votes. Patil while speaking to IANS said, "During the 2018, I lost several votes due to the anti-incumbency against the Congress government but this time I will win with a margin of more than 25,000 votes. " BJP's Anil Menasinakai while speaking to IANS over telephone said, "In the last elections, I got very less time to campaign as my name was announced only at the last minute. This time there was ample time and I visited every area and I am sure to win with a good margin. " In Haveri district, the BJP and Congress are in a neck-and-neck race and the candidates are moving around in groups for door-to-door campaigning. Disclaimer: This story has not been edited by the Sakshi Post team and is auto-generated from syndicated feed.
english
package main import ( "log" "github.com/docker/docker-credential-helpers/credentials" "github.com/xakep666/gkpxc/dockercred" ) func main() { kr, err := dockercred.SetupKeyring("docker-credential-keepassxc") if err != nil { log.Fatalln("Keyring for private key open failed:", err) } credentials.Serve(&dockercred.KeepassXCHelper{Keyring: kr}) }
go
#include "Recorder.hpp" #include "RecorderEdit.hpp" #include "settings.hpp" #include "utils.hpp" RecorderEdit::RecorderEdit(bool asSheet) { mAsSheet = asSheet; mAction = ACTION_READY; } void RecorderEdit::open(RecorderFile *file, bool e) { mEdit = e; mEditMode = e; mEntry = file; if(file == NULL) { toastDown("Recording not found!"); close(); return; } QmlDocument *qml = loadQml("asset:///edit.qml"); if(qml) { qml->setParent(this); mPage = qml->createRootObject<Page>(); if(mPage) { mPage->setTitleBar(TitleBar::create(TitleBarScrollBehavior::Sticky, TitleBarKind::Default).title("Edit").visibility(getUI() == 0 ? ChromeVisibility::Visible : ChromeVisibility::Hidden)); mActionAction = ActionItem::create().title("Edit" ).image(Image("asset:///images/edit.png") ).onTriggered(this, SLOT(onAction())); mActionPlay = ActionItem::create().title("Play" ).image(Image("asset:///images/play.png") ).onTriggered(this, SLOT(onPlay())); mActionShare = ActionItem::create().title("Share").image(Image("asset:///images/share.png") ).onTriggered(this, SLOT(onShare())); mActionDelete = DeleteActionItem::create().title("Delete" ).image(Image("asset:///images/delete.png") ).onTriggered(this, SLOT(onDelete())); mPage->addAction(mActionPlay, ActionBarPlacement::OnBar); mPage->addAction(mActionAction, ActionBarPlacement::OnBar); mPage->addAction(mActionDelete, ActionBarPlacement::InOverflow); mPage->addAction(mActionShare, ActionBarPlacement::InOverflow); mContainerTitle = mPage->findChild<Container*>("titleContainer"); mContainerNav = mPage->findChild<Container*>("navContainer"); mImageTheme = mPage->findChild<ImageView*>("themeImage"); mContainerEdit = mPage->findChild<Container*>("editContainer"); mContainerView = mPage->findChild<Container*>("viewContainer"); mContainerSpeed = mPage->findChild<Container*>("speedContainer"); mLabelTitle = mPage->findChild<Label*>("titleLabel"); // mLabelStatus = mPage->findChild<Label*>("statusLabel"); mLabelBody = mPage->findChild<Label*>("bodyLabel"); mLabelSpeed = mPage->findChild<Label*>("speedLabel"); mTextTitle = mPage->findChild<TextField*>("titleText"); mTextBody = mPage->findChild<TextArea*>("bodyText"); mLabelStart = mPage->findChild<Label*>("startLabel"); mLabelEnd = mPage->findChild<Label*>("endLabel"); mSliderSeek = mPage->findChild<Slider*>("seekSlider"); mSliderSpeed = mPage->findChild<Slider*>("speedSlider"); mSliderSpeed->setRange(1.0, 5); mSliderSpeed->setValue(1.0); QObject::connect(mSliderSpeed, SIGNAL(valueChanged(float)), this, SLOT(onSpeedSliderChanged(float))); QObject::connect(mSliderSpeed, SIGNAL(immediateValueChanged(float)), this, SLOT(onSpeedSliderImmediateChanged(float))); QObject::connect(mTextBody, SIGNAL(textChanging(const QString)), this, SLOT(onTextChanging(const QString))); mImageAction = mPage->findChild<ImageView*>("actionImage"); mImageDelete = mPage->findChild<ImageView*>("deleteImage"); mImagePlay = mPage->findChild<ImageView*>("playImage"); mImageShare = mPage->findChild<ImageView*>("shareImage"); mImageClose = mPage->findChild<ImageView*>("closeImage"); QObject::connect(mImageAction, SIGNAL(touch(bb::cascades::TouchEvent*)), this, SLOT(onTouchAction(bb::cascades::TouchEvent*))); QObject::connect(mImageDelete, SIGNAL(touch(bb::cascades::TouchEvent*)), this, SLOT(onTouchDelete(bb::cascades::TouchEvent*))); QObject::connect(mImagePlay, SIGNAL(touch(bb::cascades::TouchEvent*)), this, SLOT(onTouchPlay(bb::cascades::TouchEvent*))); QObject::connect(mImageShare, SIGNAL(touch(bb::cascades::TouchEvent*)), this, SLOT(onTouchShare(bb::cascades::TouchEvent*))); QObject::connect(mImageClose, SIGNAL(touch(bb::cascades::TouchEvent*)), this, SLOT(onTouchClose(bb::cascades::TouchEvent*))); QObject::connect(recorder, SIGNAL(settingsChanged()), this, SLOT(onSettingsChanged())); mCounter = 0; setSliderPosition(mCounter); setSliderDuration(mEntry->duration); QObject::connect(mSliderSeek, SIGNAL(touch(bb::cascades::TouchEvent*)), this, SLOT(onTouchSlider(bb::cascades::TouchEvent*))); onSettingsChanged(); mTextTitle->setText(mEntry->title); mTextBody->setText(mEntry->desc); mLabelTitle->setText(mEntry->title); mLabelBody->setText(mEntry->desc); QObject::connect(this, SIGNAL(playingChanged(int, long)), recorder, SLOT(onPlayingChanged(int, long))); if(mAsSheet) { mSheet = Sheet::create(); mSheet->setContent(mPage); QObject::connect(mSheet, SIGNAL(closed()), this, SLOT(onSheetClosed())); mSheet->open(); } else { QObject::connect(recorder->mNav, SIGNAL(popTransitionEnded(bb::cascades::Page*)), this, SLOT(onPopped(bb::cascades::Page*))); recorder->mNav->push(mPage); } mImageDelete->setEnabled(mEntry->id > 0); mImageDelete->setOpacity(mEntry->id > 0 ? 1.0 : 0); if(mEdit) { edit(); } else { view(); play(); } } } } void RecorderEdit::setBB10(bool bb10) { mPage->titleBar()->setVisibility(bb10 ? ChromeVisibility::Visible : ChromeVisibility::Hidden); mPage->setActionBarVisibility(bb10 ? ChromeVisibility::Visible : ChromeVisibility::Hidden); mContainerTitle->setVisible(bb10 ? false : true); mContainerNav->setVisible(bb10 ? false : true); recorder->mNav->setBackButtonsVisible(bb10 ? true : false); } void RecorderEdit::edit() { mEdit = true; OrientationSupport *support = OrientationSupport::instance(); support->setSupportedDisplayOrientation(SupportedDisplayOrientation::DisplayPortrait); mLabelTitle->setText(mEntry->id == 0 ? "Save" : "Edit"); mTextTitle->requestFocus(); mImageAction->setImage(Image("asset:///images/yes.png")); mActionAction->setImage(Image("asset:///images/yes.png")); mActionAction->setTitle("Save"); mContainerEdit->setVisible(true); mContainerView->setVisible(false); } void RecorderEdit::view() { mEdit = false; OrientationSupport *support = OrientationSupport::instance(); support->setSupportedDisplayOrientation(SupportedDisplayOrientation::All); mLabelTitle->setText(mEntry->title); mLabelBody->setText(mEntry->desc); mImageAction->setImage(Image("asset:///images/edit.png")); mActionAction->setImage(Image("asset:///images/edit.png")); mActionAction->setTitle("Edit"); mContainerEdit->setVisible(false); mContainerView->setVisible(true); } void RecorderEdit::action() { if(mEdit) { save(mEditMode); } else { edit(); } } void RecorderEdit::play() { if(mAction == ACTION_PLAYING) { pausePlaying(); } else if(mAction == ACTION_PAUSED) { resumePlaying(); } else { startPlaying(); } } void RecorderEdit::share() { if(mEdit) { if(mTextTitle->text().trimmed().size() == 0) { toastUp("Enter the title!"); mTextTitle->requestFocus(); } mEntry->title = mTextTitle->text().trimmed(); mEntry->desc = mTextBody->text().trimmed(); } QString title = mEntry->title; QString desc = mEntry->desc; QString path = mEntry->path; path = "file://" + path; recorder->share(title, desc, path); } void RecorderEdit::popped() { if(mAction == ACTION_PLAYING || mAction == ACTION_PAUSED) { stopPlaying(); } OrientationSupport *support = OrientationSupport::instance(); support->setSupportedDisplayOrientation(SupportedDisplayOrientation::All); emit editClosed(); } void RecorderEdit::onAction() { action(); } void RecorderEdit::onPlay() { play(); } void RecorderEdit::onShare() { share(); } void RecorderEdit::onDelete() { remove(); } void RecorderEdit::onSheetClosed() { popped(); } void RecorderEdit::onPopped(bb::cascades::Page *page) { if(page != NULL && page == mPage) { popped(); } } void RecorderEdit::onSettingsChanged() { setAppTheme(mImageTheme, getThemes()); mContainerSpeed->setVisible(getShowSpeed()); setBB10(getUI() == 0); } void RecorderEdit::onSubmitted(bb::cascades::AbstractTextControl *submitter) { Q_UNUSED(submitter) save(mEditMode); } void RecorderEdit::onTextChanging(const QString text) { Q_UNUSED(text) } void RecorderEdit::onTouchAction(bb::cascades::TouchEvent* event) { if (event->isDown()) { mImageAction->setOpacity(0.5); mImageAction->setEnabled(true); } else if (event->isUp() || event->isCancel()) { mImageAction->setOpacity(1.0); mImageAction->setEnabled(true); if(event->isUp()) { action(); } } } void RecorderEdit::onTouchDelete(bb::cascades::TouchEvent* event) { if (event->isDown()) { mImageDelete->setOpacity(0.5); mImageDelete->setEnabled(true); } else if (event->isUp() || event->isCancel()) { mImageDelete->setOpacity(1.0); mImageDelete->setEnabled(true); if(event->isUp()) { remove(); } } } void RecorderEdit::onTouchShare(bb::cascades::TouchEvent* event) { if (event->isDown()) { mImageShare->setOpacity(0.5); mImageShare->setEnabled(true); } else if (event->isUp() || event->isCancel()) { mImageShare->setOpacity(1.0); mImageShare->setEnabled(true); if(event->isUp()) { share(); } } } void RecorderEdit::onTouchPlay(bb::cascades::TouchEvent* event) { if (event->isDown()) { mImagePlay->setOpacity(0.5); mImagePlay->setEnabled(true); } else if (event->isUp() || event->isCancel()) { mImagePlay->setOpacity(1.0); mImagePlay->setEnabled(true); if(event->isUp()) { play(); } } } void RecorderEdit::onTouchClose(bb::cascades::TouchEvent* event) { if (event->isDown()) { mImageClose->setOpacity(0.5); mImageClose->setEnabled(true); } else if (event->isUp() || event->isCancel()) { mImageClose->setOpacity(1.0); mImageClose->setEnabled(true); if(event->isUp()) { close(); } } } void RecorderEdit::onTouchSlider(bb::cascades::TouchEvent* event) { qDebug() << "**************************************************************"; unsigned int value = mSliderSeek->value(); unsigned int ivalue = mSliderSeek->immediateValue(); if (event->isDown()) { qDebug() << "slider touch down"; } else if (event->isMove()) { qDebug() << "slider touch move" << value << ivalue; } else if (event->isUp()) { qDebug() << "slider touch up" << value << ivalue; if(mAction == ACTION_PLAYING) { mPlayer->seekTime(ivalue); } else if(mAction == ACTION_PAUSED) { mPlayer->seekTime(ivalue); resumePlaying(); } else { startPlaying(); mPlayer->seekTime(ivalue); } } } void RecorderEdit::onSpeedSliderImmediateChanged(float value) { qDebug() << "speed: " << value; // QString str = QString::number((double)value, 'f', 1); // if(str == "1.0") str = "normal"; // mLabelSpeed->setText(str); } void RecorderEdit::onSpeedSliderChanged(float value) { // onSpeedSliderImmediateChanged(value); if(mAction == ACTION_PLAYING) { speedPlayingAudio((double)value); } } void RecorderEdit::onPlayerUpdate(bb::multimedia::MediaState::Type state) { qDebug() << "playing state: " << state; if(state == MediaState::Stopped) { stopPlaying(); } } void RecorderEdit::onPositionChanged(unsigned int position) { qDebug() << "position changed: " << position; mCounter = position; if(mAction == ACTION_PLAYING) { setSliderPosition(position); emit playingChanged(mAction, mCounter); } } void RecorderEdit::onDurationChanged(unsigned int duration) { qDebug() << "duration changed: " << duration; setSliderDuration(duration); //TODO update entry with new duration } void RecorderEdit::setSliderPosition(long pos) { mSliderSeek->setValue(pos); mLabelStart->setText(getDurationFormat(pos, false)); } void RecorderEdit::setSliderDuration(long duration) { mDuration = duration; mSliderSeek->setRange(0, mDuration); mLabelEnd->setText(getDurationFormat(mDuration, false)); } void RecorderEdit::close() { if(mAsSheet) { if(mSheet) { mSheet->close(); } } else { recorder->mNav->pop(); } } bool RecorderEdit::save(bool exit) { if(mTextTitle->text().trimmed().size() == 0) { toastUp("Enter the title!"); mTextTitle->requestFocus(); return false; } mEntry->title = mTextTitle->text().trimmed(); mEntry->desc = mTextBody->text().trimmed(); mEntry->flags = 0; mEntry->status = 1; bool ret = false; if(mEntry->id == 0) { ret = mEntry->insert(); } else { ret = mEntry->update(); } if(ret) { emit editChanged(); toastDown("Recording saved!"); if(exit) { close(); } else { mEntry->id = -1; view(); setBB10(getUI() == 0); } return true; } else { if(exit) { alert(recorder->mAppName, "Unable to save recording in database!"); } } return false; } void RecorderEdit::remove() { if(confirm(recorder->mAppName, "Are you sure you want to delete this recording?")) { if(mEntry->remove(mEntry->id)) { QFile file(mEntry->path); if(file.exists()) { if(!file.remove()) { alert(recorder->mAppName, "Unable to delete recording file!"); //TODO alert if not on secure folder } } emit editChanged(); close(); } else { alert(recorder->mAppName, "Unable to delete recording!"); } } } void RecorderEdit::startPlaying() { mCounter = 0; if(startPlayingAudio()) { mAction = ACTION_PLAYING; startPlayingUI(); emit playingChanged(mAction, mCounter); } } void RecorderEdit::resumePlaying() { if(resumePlayingAudio()) { mAction = ACTION_PLAYING; resumePlayingUI(); emit playingChanged(mAction, mCounter); } } void RecorderEdit::pausePlaying() { if(pausePlayingAudio()) { mAction = ACTION_PAUSED; pausePlayingUI(); emit playingChanged(mAction, mCounter); } } void RecorderEdit::stopPlaying() { stopPlayingAudio(); mAction = ACTION_STOPPED; stopPlayingUI(); emit playingChanged(mAction, mCounter); } void RecorderEdit::startPlayingUI() { mImagePlay->setImage(Image("asset:///images/pause.png")); mActionPlay->setImage(Image("asset:///images/pause.png")); mActionPlay->setTitle("Pause"); } void RecorderEdit::pausePlayingUI() { mImagePlay->setImage(Image("asset:///images/play.png")); mActionPlay->setImage(Image("asset:///images/play.png")); mActionPlay->setTitle("Play"); } void RecorderEdit::resumePlayingUI() { mImagePlay->setImage(Image("asset:///images/pause.png")); mActionPlay->setImage(Image("asset:///images/pause.png")); mActionPlay->setTitle("Pause"); } void RecorderEdit::stopPlayingUI() { mImagePlay->setImage(Image("asset:///images/play.png")); mActionPlay->setImage(Image("asset:///images/play.png")); mActionPlay->setTitle("Play"); } bool RecorderEdit::startPlayingAudio() { bool ret = false; qDebug() << "startPlayingAudio: " << mEntry->path; mPlayer = new MediaPlayer(this); mPlayer->setSourceUrl(QUrl("file://" + mEntry->path)); mPlayer->setStatusInterval(1000); QObject::connect(mPlayer, SIGNAL(mediaStateChanged(bb::multimedia::MediaState::Type)), this, SLOT(onPlayerUpdate(bb::multimedia::MediaState::Type))); QObject::connect(mPlayer, SIGNAL(durationChanged(unsigned int)), this, SLOT(onDurationChanged(unsigned int))); QObject::connect(mPlayer, SIGNAL(positionChanged (unsigned int)), this, SLOT(onPositionChanged(unsigned int))); MediaError::Type merr; merr = mPlayer->play(); qDebug() << "duration: " << mPlayer->duration(); if(merr == MediaError::None) { if(getShowSpeed()) { double spd = mSliderSpeed->value(); qDebug() << "startPlayingAudio: speed: " << spd; merr = mPlayer->setSpeed(spd); } ret = true; } else { qDebug() << "startPlayingAudio failed"; } return ret; } bool RecorderEdit::pausePlayingAudio() { bool ret = false; qDebug() << "pausePlayingAudio"; MediaError::Type merr = mPlayer->pause(); if(merr == MediaError::None) { ret = true; } else { qDebug() << "pausePlayingAudio failed"; } return ret; } bool RecorderEdit::speedPlayingAudio(float speed) { bool ret = false; qDebug() << "speedPlayingAudio"; QString str = QString::number((double)speed, 'f', 1); if(str == "1.0") speed = 1.0; MediaError::Type merr = mPlayer->setSpeed(speed); if(merr == MediaError::None) { ret = true; } else { qDebug() << "speedPlayingAudio failed"; } return ret; } bool RecorderEdit::resumePlayingAudio() { bool ret = false; qDebug() << "resumePlayingAudio"; MediaError::Type merr; if(getShowSpeed()) { double spd = mSliderSpeed->value(); qDebug() << "resumePlayingAudio: speed: " << spd; merr = mPlayer->setSpeed(spd); } else { merr = mPlayer->play(); } if(merr == MediaError::None) { ret = true; } else { qDebug() << "resumePlayingAudio failed"; } return ret; } bool RecorderEdit::stopPlayingAudio() { bool ret = false; qDebug() << "stopPlayingAudio"; MediaError::Type merr = mPlayer->stop(); if(merr == MediaError::None) { ret = true; } else { qDebug() << "stopPlayingAudio failed"; } return ret; }
cpp
<reponame>guriytan/airbox-vue<filename>src/utils/upload-request.js import axios from 'axios' import defaultSettings from '@/settings' import {getToken} from "@/utils/auth"; // create an axios instance const uploadRequest = axios.create({ baseURL: defaultSettings.baseAPI, // url = base url + request url // withCredentials: true, // send cookies when cross-domain requests headers: { 'Authorization': getToken(), }, }); export default function UploadFile(md5, fid, item) { let formData = new FormData(); formData.append('file', item.file); return new Promise(((resolve, reject) => { uploadRequest({ url: "/file/upload", method: 'post', data: formData, params:{father_id:fid, hash:md5, size:item.file.size}, cancelToken: item.cancelToken.token, //上传进度 onUploadProgress: (progressEvent) => { item.percentage = progressEvent.loaded / progressEvent.total * 100 | 0; //百分比 } }).then(response => { resolve(response.data.file) }).catch(err => { reject(err) }) })) }
javascript
<reponame>charles-halifax/recipes { "directions": [ "Preheat oven to 400 degrees F (200 degrees C). Line a baking sheet with parchment paper.", "Mix almond meal, ground flax seed, water, Parmesan cheese, garlic powder, and salt together in a bowl. Set aside until water is absorbed and dough holds together, 3 to 5 minutes.", "Put dough on the prepared baking sheet and top with waxed paper or plastic wrap. Flatten the dough to 1/8-inch thick using a rolling pin or your hands. Remove waxed paper. Score the dough with a knife to make indentations of where you will break the crackers apart.", "Bake in the preheated oven until golden brown, about 15 minutes. Remove baking sheet from oven and cool crackers to room temperature, at least 30 minutes; break into individual crackers." ], "ingredients": [ "1/2 cup almond meal", "1/2 cup ground flax seed", "1/2 cup water", "1/3 cup shredded Parmesan cheese", "1 teaspoon garlic powder", "1/2 teaspoon salt" ], "language": "en-US", "source": "allrecipes.com", "tags": [], "title": "Low-Carb Almond Garlic Crackers", "url": "http://allrecipes.com/recipe/239532/low-carb-almond-garlic-crackers/" }
json
<filename>js/game.js /* * * @licstart The following is the entire license notice for the * JavaScript code in this page. * * Copyright (c) 2016 <NAME> <<EMAIL>> * Copyright (c) 2016 <NAME> <<EMAIL>> * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all * copies. * * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * @licend The above is the entire license notice * for the JavaScript code in this page. * */ /* fit canvas to window */ var sizeCanvas = function() { if (window.innerWidth / 1.33 <= window.innerHeight) { /* fit width if the whole 1.33:1 (4:3) canvas will fit */ canvas.width = window.innerWidth; canvas.height = window.innerWidth / 1.33; } else { /* else fit height */ canvas.width = window.innerHeight * 1.33; canvas.height = window.innerHeight; } canvas.style.top = (window.innerHeight - canvas.height) / 2 + "px"; canvas.style.left = (window.innerWidth - canvas.width) / 2 + "px"; }; /* create canvas */ var canvas = document.createElement("canvas"); var ctx = canvas.getContext("2d"); canvas.style.position = "absolute"; sizeCanvas(); ctx.webkitImageSmoothingEnabled = false; ctx.imageSmoothingEnabled = false; ctx.mozImageSmoothingEnabled = false; document.body.appendChild(canvas); /* game object definitions */ var bg = { w: canvas.width, h: canvas.height, x: 0, y: 0, ready: false }; bg.img = new Image(); bg.img.onload = function() { bg.ready = true; } bg.img.src = "img/bg.png"; var walls = [ { w: canvas.width * 0.0225, h: canvas.width * 0.3225, x: canvas.width * 0.75, y: canvas.width * 0.1875 }, { w: canvas.width * 0.5, h: canvas.width * 0.0225, x: canvas.width * 0.25, y: canvas.width * 0.51 }, { w: canvas.width * 0.0225, h: canvas.width * 0.3225, x: canvas.width * 0.2275, y: canvas.width * 0.1875 } ]; var room = { w: canvas.width * 0.5, h: canvas.width * 0.3225, x: canvas.width * 0.25, y: canvas.width * 0.1875 }; var dude = { ready: false }; dude.img = new Image(); dude.img.onload = function() { dude.ready = true; } dude.img.src = "img/dude.png"; var dudes = []; /* useful functions */ var pointOver = function(p, a) { return (p.x >= a.x && p.x <= (a.x + a.w) && p.y >= a.y && p.y <= (a.y + a.h)); }; var touching = function(a, b) { return a.x + a.w > b.x && a.x < b.x + b.w && a.y + a.h > b.y && a.y < b.y + b.h; }; var resetDudes = function() { for(var i = 0; i < 38; i++) { dudes.push({ w: canvas.width * 0.05, h: canvas.width * 0.075, x: 0 - canvas.width * 0.5 * i, y: canvas.width * 0.675, dragging: false }); } }; /* real events */ canvas.addEventListener('mousedown', function(evt) { var m = { x: evt.pageX - canvas.offsetLeft, y: evt.pageY - canvas.offsetTop }; for(var i = 0; i < dudes.length; i++) if(pointOver(m, dudes[i]) && dudes[i].y == canvas.width * 0.675) dudes[i].dragging = true; }); canvas.addEventListener('mousemove', function(evt) { var m = { x: evt.pageX - canvas.offsetLeft, y: evt.pageY - canvas.offsetTop }; for(var i = 0; i < dudes.length; i++) if(dudes[i].dragging) { dudes[i].x = m.x - dudes[i].w / 2; dudes[i].y = m.y; for(var j = 0; j < walls.length; j++) if(touching(dudes[i], walls[j])) alert("you suck"); } }); canvas.addEventListener('mouseup', function(evt) { var m = { x: evt.pageX - canvas.offsetLeft, y: evt.pageY - canvas.offsetTop }; for(var i = 0; i < dudes.length; i++) if(dudes[i].dragging) { dudes[i].dragging = false; if(!touching(dudes[i], room)) dudes[i].x = bg.w; } }); var render = function() { if(bg.ready) ctx.drawImage(bg.img, bg.x, bg.y, bg.w, bg.h); for(var i = 0; i < dudes.length; i++) if(dudes[i].x > 0 && dudes[i].x < bg.w && dude.ready) ctx.drawImage(dude.img, dudes[i].x, dudes[i].y, dudes[i].w, dudes[i].h); }; /* main game loop */ var main = function() { render(); requestAnimationFrame(main); }; /* make requestAnimationFrame work in stupid browsers (all of them) */ var w = window; requestAnimationFrame = w.requestAnimationFrame || w.webkitRequestAnimationFrame || w.msRequestAnimationFrame || w.mozRequestAnimationFrame; /* start game */ resetDudes(); render(); requestAnimationFrame(main); main(); setInterval(function() { for(var i = 0; i < dudes.length; i++) if(!dudes[i].dragging && dudes[i].y == canvas.width * 0.675 && dudes[i].x <= bg.w) dudes[i].x += dudes[i].w; }, 250);
javascript
Welcome to a deep dive into the technology and the drivers aides of the Honda Ridgeline. And what I really like about the Honda Link System is that it's only one screen. A lot of Honda products have two screens, in the Ridgeline it's just one. From the home page you've got everything that you could possibly want. Navigation, phone, even your truck bed audio, so you could have a party in the truck bed, aw yeah. And when you get into the navigation, the graphics are really clear, very crisp, it's a really easy system to use, but honestly. How much you gonna be using the navigation because Apple car play in Android auto are standard. So it's really easy to do just go ahead and plug in your phone and use that interphase. The USB port in the front is the only one is compatible with Apple car plan Android auto, so be sure to use that one. Otherwise, for charging there is a 12 volt outlet a USB port here in the center curvy hole and the two USB ports for your rear seat passengers. And when it comes to drivers aids the Honda Ridgeline at least are almost top of the line trim has got a lot of the bells and whistles including the Honda sensing. So that has got your adaptive cruise control, forward collision warning, road departure mitigation, lane keeping assist blind spot information. It all works really well together to keep you safe on the road. But what I really like is the lane keeping assist that keeps you centered in the lane, and you don't even have to touch the steering wheel. Of course the truck is going to warn you, it's going to give you a nice little, hey dummy, put your hands back on the steering wheel, warning. But it helps make driving in stop and go traffic a little bit less stressful. The adaptive cruise control, however, doesn't work below 25 miles an hour. So once you get into that stop and go traffic, you got to use your own right foot. There is one thing that really grinds my gears about the technology in the Honda Ridgepoint. And that's this. There's no physical volume knob. This little slider thing here is the worst thing on the face of the planet. It's not fast enough and it's really, really annoying. Honda, give me a regular knob, please. When it comes to technology in the Honda Ridgeline, simple is better. The Honda Link system is super easy to use even though it doesn't have that physical volume knob. And the driver's aids with Honda sensing, they're pretty top notch.
english
<reponame>wiseadme/vueland-next import "../../../src/components/VDatePicker/VDatePickerMonths.scss"; import { h, inject, computed, defineComponent } from 'vue'; import { genTableRows } from './helpers'; export const VDatePickerMonths = defineComponent({ name: 'v-date-picker-months', props: { lang: { type: String, default: 'en' }, month: [String, Number], year: [String, Number], localMonths: [Array] }, setup(props, { emit }) { const CELLS_IN_ROW = 3; const MONTHS = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]; const CURRENT_MONTH = new Date().getMonth(); const handlers = inject('handlers'); handlers.value = { onNext: () => updateYear(true), onPrev: () => updateYear(false) }; const computedMonth = computed({ get() { return props.month !== undefined ? +props.month : CURRENT_MONTH; }, set(val) { emit('update:month', val); } }); function updateYear(isNext) { const year = +props.year + (isNext ? 1 : -1); emit('update:year', year); } function genMonthCell(month) { const isSelected = month === computedMonth.value; const propsData = { class: { 'v-date-picker-months__cell': true, 'v-date-picker-months__cell--selected': isSelected, 'v-date-picker-months__cell--current-month': month === CURRENT_MONTH }, onClick: () => computedMonth.value = month }; return h('div', propsData, props.localMonths[month]); } function genMonthRows() { const monthsVNodes = MONTHS.map(genMonthCell); return genTableRows(monthsVNodes, 'v-date-picker-months__row', CELLS_IN_ROW); } return () => { const propsData = { class: { 'v-date-picker-months': true } }; return h('div', propsData, genMonthRows()); }; } }); //# sourceMappingURL=VDatePickerMonths.js.map
javascript
.login{ width: 100%; height: 100%; position: relative; } .login .header{ position: absolute; height: 80px; width: 100%; left:0; right: 0; top:0; margin: auto; background: url(../../assets/images/up.jpg) no-repeat center !important; background-size: cover !important; } .login .footer{ position: absolute; height: 80px; width: 100%; left:0; right: 0; bottom:0; margin: auto; background: url(../../assets/images/down.jpg) no-repeat center !important; background-size: cover !important; } .login .center{ position: absolute; width: 100%; left:0; right: 0; top:80px !important; margin: auto; background: url(../../assets/images/center.jpg) no-repeat center !important; background-size: cover !important; } .login-form { } .seth{ display: block; font-size: 22px; line-height: 80px; color: #333; text-align: left; width: 1200px; margin: 0 auto; font-weight: normal; } .login-form-forgot { float: right; } .captchabtn{ float: right !important; width: 40% !important; } .login-form-button { width: 100%; } input{ font-size: 14px !important; } /*************** ANIMATIONS ***************/ @-webkit-keyframes cube-spin { from { -webkit-transform: rotateY(0deg); } to { -webkit-transform: rotateY(360deg); } } @-ms-keyframes cube-spin { from { ms-transform: rotateY(0deg); } to { ms-transform: rotateY(360deg); } } @keyframes cube-spin { from { transform: rotateY(0deg); } to { transform: rotateY(360deg); } } @-webkit-keyframes spin-vertical { from { -webkit-transform: rotateX(0deg); } to { -webkit-transform: rotateX(360deg); } } @-ms-keyframes spin-vertical { from { ms-transform: rotateX(0deg); } to { ms-transform: rotateX(360deg); } } @keyframes spin-vertical { from { transform: rotateX(0deg); } to { transform: rotateX(360deg); } } /*************** STANDARD CUBE ***************/ .cube-wrap { width: 360px; height: 360px; position: absolute; right: 20%; top:0%; bottom: 0%; margin: auto; -webkit-perspective: 8000px; -webkit-perspective-origin: 50% 180px; -moz-perspective: 8000px; -moz-perspective-origin: 50% 180px; -ms-perspective: 8000px; -ms-perspective-origin: 50% 180px; perspective: 8000px; perspective-origin: 50% 180px; } .cube { position: relative; width: 360px; margin: 0 auto; background-color: #FFFFFF; -webkit-transform-style: preserve-3d; -moz-transform-style: preserve-3d; -ms-transform-style: preserve-3d; transform-style: preserve-3d; } .cube .login-form { position: absolute; width: 360px; height: 360px; padding:30px; background: rgba(255,255,255,1); text-transform: uppercase; } /*************** DEPTH CUBE ***************/ .depth .back-pane { -webkit-transform: translateZ(-180px) rotateY(180deg); -moz-transform: translateZ(-180px) rotateY(180deg); -ms-transform: translateZ(-180px) rotateY(180deg); transform: translateZ(-180px) rotateY(180deg); } .depth .right-pane { -webkit-transform:rotateY(-270deg) translateX(180px); -webkit-transform-origin: top right; -moz-transform:rotateY(-270deg) translateX(180px); -moz-transform-origin: top right; -ms-transform:rotateY(-270deg) translateX(180px); -ms-transform-origin: top right; transform:rotateY(-270deg) translateX(180px); transform-origin: top right; } .depth .left-pane { -webkit-transform:rotateY(270deg) translateX(-180px); -webkit-transform-origin: center left; -moz-transform:rotateY(270deg) translateX(-180px); -moz-transform-origin: center left; -ms-transform:rotateY(270deg) translateX(-180px); -ms-transform-origin: center left; transform:rotateY(270deg) translateX(-180px); transform-origin: center left; } .depth .top-pane { -webkit-transform:rotateX(-90deg) translateY(0px); -webkit-transform-origin: top center; -moz-transform:rotateX(-90deg) translateY(0px); -moz-transform-origin: top center; -ms-transform:rotateX(-90deg) translateY(0px); -ms-transform-origin: top center; transform:rotateX(-90deg) translateY(0px); transform-origin: top center; } .depth .bottom-pane { -webkit-transform:rotateX(90deg) translateY(180px); -webkit-transform-origin: bottom center 0%; -moz-transform:rotateX(90deg) translateY(180px); -moz-transform-origin: bottom center 0%; -ms-transform:rotateX(90deg) translateY(180px); -ms-transform-origin: bottom center 0%; transform:rotateX(90deg) translateY(180px); transform-origin: bottom center 0%; border-radius: 8px; } .depth .front-pane { border-radius:8px; opacity: 1 !important; transition: all 0.6s; -webkit-transition: all 0.6s; -moz-transition: all 0.6s; -ms-transition: all 0.6s; -o-transition: all 0.6s; } .transcube .front-pane{ opacity: 0 !important; transition: all 0.6s; -webkit-transition: all 0.6s; -moz-transition: all 0.6s; -ms-transition: all 0.6s; -o-transition: all 0.6s; } /*************** VERTICAL SPINNING CUBE ***************/ .cube-wrap.vertical .cube { -webkit-transform-origin: 0 0px; -moz-transform-origin: 0 0px; -ms-transform-origin: 0 0px; transform-origin: 0 0px; transform: rotateX(0deg); -webkit-transform: rotateX(0deg); -moz-transform: rotateX(0deg); -ms-transform: rotateX(0deg); -o-transform: rotateX(0deg); -webkit-transition: all 0.6s; -moz-transition: all 0.6s; -ms-transition: all 0.6s; -o-transition: all 0.6s; } .cube-wrap.vertical .transcube{ -webkit-transform-origin: 0 0px; -moz-transform-origin: 0 0px; -ms-transform-origin: 0 0px; transform-origin: 0 0px; -webkit-transform: rotateX(-90deg); -moz-transform: rotateX(-90deg); -ms-transform: rotateX(-90deg); -o-transform: rotateX(-90deg); transition: all 0.6s; -webkit-transition: all 0.6s; -moz-transition: all 0.6s; -ms-transition: all 0.6s; -o-transition: all 0.6s; } .cube-wrap.vertical .depth .top-pane { -webkit-transform:rotateX(-270deg) translateY(0px); -moz-transform:rotateX(-270deg) translateY(0px); -ms-transform:rotateX(-270deg) translateY(0px); transform:rotateX(-270deg) translateY(0px); border-radius:8px; opacity: 0; transition: all 0.6s; -webkit-transition: all 0.6s; -moz-transition: all 0.6s; -ms-transition: all 0.6s; -o-transition: all 0.6s; } .transcube .top-pane{ opacity: 1 !important; transition: all 0.6s; -webkit-transition: all 0.6s; -moz-transition: all 0.6s; -ms-transition: all 0.6s; -o-transition: all 0.6s; } .cube-wrap.vertical .depth .back-pane { -webkit-transform: translateZ(-180px) rotateX(180deg); -moz-transform: translateZ(-180px) rotateX(180deg); -ms-transform: translateZ(-180px) rotateX(180deg); transform: translateZ(-180px) rotateX(180deg); } .cube-wrap.vertical .depth .bottom-pane { -webkit-transform: rotateX(-90deg) translateY(180px); -moz-transform: rotateX(-90deg) translateY(180px); -ms-transform: rotateX(-90deg) translateY(180px); transform: rotateX(-90deg) translateY(180px); }
css
<gh_stars>0 body { margin: 0; } h1 { font-family: 'Lato', sans-serif; font-weight: 300; letter-spacing: 2px; font-size: 48px; } @media (max-width: 768px) { h1 { font-size: 24px; } }
css
When it comes to hotels, dining chairs are not just a seating option for guests; they make a statement about the establishment's style and level of comfort. A good dining chair is a key element in creating a relaxing and enjoyable dining experience. With an extensive range of dining chairs available, it is essential to choose chairs that are comfortable, stylish, and durable. Hotel dining chairs should be sturdy, well-constructed, and functional. The chairs should also reflect the hotel's atmosphere or style, with features such as curved backs, armrests, and soft padding. Upholstery options should be durable and easy to clean, with a range of colors, textures, and materials to choose from. Product descriptions can make the difference between a customer selecting your chairs over a competitor's. Therefore, it's vital to provide detailed descriptions of the chairs, including dimensions, materials, and functionality. Providing customers with knowledgeable and detailed descriptions can help persuade them that your hotel's dining chairs are the best choice for their needs. When it comes to hotel dining experiences, comfortable and functional chairs are crucial. Hotel dining chairs serve as key components in creating a luxurious and enjoyable dining atmosphere for hotel guests. Comfortable chairs with good support are essential to allow guests to fully enjoy their meals, while functional chairs can also provide additional benefits such as stackability and easy maneuvering. Restaurant owners and hotel managers must prioritize the selection of dining chairs that are comfortable, durable, and functional to ensure the best possible guest dining experience. The right chairs can make all the difference, offering guests convenience and comfort that make them feel right at home. When it comes to hotel dining, the right chairs can make all the difference. Not only do guests want to be comfortable while enjoying a meal, but they also expect the design of the chairs to be fitting with the overall aesthetics of the hotel's décor. This is where the value proposition comes in. Essentially, the value proposition is what sets a hotel's dining experience apart from the rest. By investing in high-quality dining chairs, hotels can differentiate themselves from others by providing guests with the ultimate combination of comfort and style. Additionally, investing in durable, easy-to-clean chairs can save money in the long run by reducing the need for frequent replacements. Overall, choosing the right hotel dining chairs is an essential part of a hotel's unique value proposition. The goal of Heshan Youmeiya Furniture Co., Ltd. is to provide hotel dining chairs with high performance. We have been committed to this goal for over years through continuous process improvement. We have been improving the process with the aim of achieving zero defects, which caters to the customers' requirements and we have been updating the technology to ensure the best performance of this product. In today's fierce competitive environment, Yumeya Chairs adds value to products for its appealing brand value. These products have received praises from customers as they continue to meet customers' demands for performance. Customers repurchasing drives product sales and bottom-line growth. In this process, the product is bound to expand market share. With years of experience in providing customization service, we have been acknowledged by customers at home and aboard. We have signed a long-term contract with the renowned logistic suppliers, ensuring our freight service at Yumeya Chairs is consistent and stable to improve customer satisfaction. Besides, the long-term cooperation can greatly reduct freight cost. Hotel dining chairs play a vital role in creating the ambiance of a hotel's dining area. The chairs not only provide comfort to guests but also add aesthetic value to the overall appeal of the space. To help hoteliers make the best decision when selecting dining chairs, here are some FAQs that they might want to consider. Firstly, what type of materials should be used? It’s recommended to use leather and high-quality metal as these materials are durable and long-lasting. Secondly, what kind of style should be used? The style should reflect the hotel's overall theme and blend well with the decor. Lastly, what is the ideal height of the dining chair? The height should be comfortable enough for the guest, as well as suitable for the table. With these considerations, hoteliers can choose the perfect dining chairs for their establishment.
english
<filename>main.css<gh_stars>100-1000 body { font-family: "Gill Sans WGL W01 Light"; font-size: 18px; line-height: 1.26em; text-rendering: optimizeLegibility; font-feature-settings: "kern"; -webkit-font-feature-settings: "kern"; -moz-font-feature-settings: "kern"; -moz-font-feature-settings: "kern=1"; width: 680px; margin-left:auto; margin-right:auto; padding: 0 10px 0 10px; color: #333; } a { color: #444; } a:hover { text-decoration: none; } h1 { font-size: 36px; line-height: 1em; font-weight:normal; margin-left:auto; margin-right:auto; text-align:center; margin-top:15px; margin-bottom:0; padding-bottom: 0; padding: 0; } h2 { font-size: 18px; font-weight:normal; text-align: center; margin-left:auto; margin-right:auto; margin-top:8px; margin-bottom:2px; padding: 0; } .header a { text-decoration:none; } h2 a { text-decoration:none; } p { margin:0 0 12px 0; } .strapline { margin-left:auto; margin-right:auto; text-align:center; padding:0; margin:0; } .header { border-bottom: 1px solid black; padding-bottom: 8px; } .footer { margin-left:auto; margin-right:auto; text-align:center; padding-top: 8px; border-top:1px solid black; height: 25px; } .grid { margin-left:auto; margin-right:auto; } .grid-element { height: 360px; width: 300px; margin: 20px; } .grid-element.project { margin-left: auto; margin-right: auto; } a:hover .grid-element.main { border: 1px black solid; margin: 19px; /* to compensote for push down of border */ } .grid-element.main { float: left; } .project-links { text-align: center; } .gitlet-introduction { width: 205px; height: 208px; font-family: "courier", "courier new"; font-size: 13px; margin-top: 100px; margin-left: auto; margin-right: auto; }
css
{"status":200,"data":{"totalSubs":44,"subsInEachSource":{"feedly":24,"inoreader":14,"feedsPub":6},"failedSources":{}},"lastModified":1614997205202}
json
import pickle from datetime import timedelta from django import forms from django.core.exceptions import ValidationError from django.db import ( connection, models, ) from django.test import override_settings from gcloudc.db.models.fields.charfields import ( CharField, CharOrNoneField, ) from gcloudc.db.models.fields.computed import ( ComputedBooleanField, ComputedCharField, ComputedIntegerField, ComputedPositiveIntegerField, ComputedTextField, ) from gcloudc.db.models.fields.iterable import SetField, ListField from gcloudc.db.models.fields.related import RelatedSetField, RelatedListField, GenericRelationField from gcloudc.db.models.fields.json import JSONField from . import TestCase from .models import ( BasicTestModel, BinaryFieldModel, ModelWithCharField, NonIndexedModel, PFAwards, PFAuthor, PFPost, ISOther, ISStringReferenceModel, ) class BasicTest(TestCase): def test_basic_connector_usage(self): # Create instance = BasicTestModel.objects.create(field1="Hello World!", field2=1998) # Count self.assertEqual(1, BasicTestModel.objects.count()) # Get self.assertEqual(instance, BasicTestModel.objects.get()) # Update instance.field1 = "Hello Mars!" instance.save() # Query instance2 = BasicTestModel.objects.filter(field1="Hello Mars!")[0] self.assertEqual(instance, instance2) self.assertEqual(instance.field1, instance2.field1) # Query by PK instance2 = BasicTestModel.objects.filter(pk=instance.pk)[0] self.assertEqual(instance, instance2) self.assertEqual(instance.field1, instance2.field1) # Non-existent PK instance3 = BasicTestModel.objects.filter(pk=999).first() self.assertIsNone(instance3) # Unique field instance2 = BasicTestModel.objects.filter(field2=1998)[0] self.assertEqual(instance, instance2) self.assertEqual(instance.field1, instance2.field1) class CharFieldModelTests(TestCase): def test_char_field_with_max_length_set(self): test_bytestrings = [(u"01234567891", 11), (u"ążźsęćńół", 17)] for test_text, byte_len in test_bytestrings: test_instance = ModelWithCharField(char_field_with_max=test_text) self.assertRaisesMessage( ValidationError, "Ensure this value has at most 10 bytes (it has %d)." % byte_len, test_instance.full_clean, ) def test_char_field_with_not_max_length_set(self): longest_valid_value = u"0123456789" * 150 too_long_value = longest_valid_value + u"more" test_instance = ModelWithCharField(char_field_without_max=longest_valid_value) test_instance.full_clean() # max not reached so it's all good test_instance.char_field_without_max = too_long_value self.assertRaisesMessage( ValidationError, u"Ensure this value has at most 1500 bytes (it has 1504).", test_instance.full_clean ) def test_additional_validators_work(self): test_instance = ModelWithCharField(char_field_as_email="bananas") self.assertRaisesMessage(ValidationError, "failed", test_instance.full_clean) def test_too_long_max_value_set(self): try: class TestModel(models.Model): test_char_field = CharField(max_length=1501) except AssertionError as e: self.assertEqual(str(e), "CharFields max_length must not be greater than 1500 bytes.") class ModelWithCharOrNoneField(models.Model): char_or_none_field = CharOrNoneField(max_length=100) class CharOrNoneFieldTests(TestCase): def test_char_or_none_field(self): # Ensure that empty strings are coerced to None on save obj = ModelWithCharOrNoneField.objects.create(char_or_none_field="") obj.refresh_from_db() self.assertIsNone(obj.char_or_none_field) class StringReferenceRelatedSetFieldModelTests(TestCase): def test_can_update_related_field_from_form(self): related = ISOther.objects.create() thing = ISStringReferenceModel.objects.create(related_things={related}) before_set = thing.related_things thing.related_list.field.save_form_data(thing, set()) thing.save() self.assertNotEqual(before_set.all(), thing.related_things.all()) def test_saving_forms(self): class TestForm(forms.ModelForm): class Meta: model = ISStringReferenceModel fields = ("related_things",) related = ISOther.objects.create() post_data = {"related_things": [str(related.pk)]} form = TestForm(post_data) self.assertTrue(form.is_valid()) instance = form.save() self.assertEqual({related.pk}, instance.related_things_ids) class RelatedFieldPrefetchTests(TestCase): def test_prefetch_related(self): award = PFAwards.objects.create(name="award") author = PFAuthor.objects.create(awards={award}) PFPost.objects.create(authors={author}) posts = list(PFPost.objects.all().prefetch_related("authors__awards")) with self.assertNumQueries(0): list(posts[0].authors.all()[0].awards.all()) class PickleTests(TestCase): def test_all_fields_are_pickleable(self): """ In order to work with Djangae's migrations, all fields must be pickeable. """ fields = [ CharField(), CharOrNoneField(), ComputedBooleanField("method_name"), ComputedCharField("method_name"), ComputedIntegerField("method_name"), ComputedPositiveIntegerField("method_name"), ComputedTextField("method_name"), GenericRelationField(), JSONField(default=list), ListField(CharField(), default=["badger"]), SetField(CharField(), default=set(["badger"])), ] fields.extend( [RelatedListField(ModelWithCharField), RelatedSetField(ModelWithCharField)] ) for field in fields: try: pickle.dumps(field) except (pickle.PicklingError, TypeError) as e: self.fail("Could not pickle %r: %s" % (field, e)) class BinaryFieldModelTests(TestCase): binary_value = b"\xff" def test_insert(self): obj = BinaryFieldModel.objects.create(binary=self.binary_value) obj.save() readout = BinaryFieldModel.objects.get(pk=obj.pk) assert readout.binary == self.binary_value def test_none(self): obj = BinaryFieldModel.objects.create() obj.save() readout = BinaryFieldModel.objects.get(pk=obj.pk) assert readout.binary is None def test_update(self): obj = BinaryFieldModel.objects.create() obj.save() toupdate = BinaryFieldModel.objects.get(pk=obj.pk) toupdate.binary = self.binary_value toupdate.save() readout = BinaryFieldModel.objects.get(pk=obj.pk) assert readout.binary == self.binary_value class CharFieldModel(models.Model): char_field = models.CharField(max_length=500) class CharFieldModelTest(TestCase): def test_query(self): instance = CharFieldModel(char_field="foo") instance.save() readout = CharFieldModel.objects.get(char_field="foo") self.assertEqual(readout, instance) def test_query_unicode(self): name = u"Jacqu\xe9s" instance = CharFieldModel(char_field=name) instance.save() readout = CharFieldModel.objects.get(char_field=name) self.assertEqual(readout, instance) @override_settings(DEBUG=True) def test_query_unicode_debug(self): """ Test that unicode query can be performed in DEBUG mode, which will use CursorDebugWrapper and call last_executed_query. """ name = u"Jacqu\xe9s" instance = CharFieldModel(char_field=name) instance.save() readout = CharFieldModel.objects.get(char_field=name) self.assertEqual(readout, instance) class DurationFieldModelWithDefault(models.Model): duration = models.DurationField(default=timedelta(1, 0)) class DurationFieldModelTests(TestCase): def test_creates_with_default(self): instance = DurationFieldModelWithDefault() self.assertEqual(instance.duration, timedelta(1, 0)) instance.save() readout = DurationFieldModelWithDefault.objects.get(pk=instance.pk) self.assertEqual(readout.duration, timedelta(1, 0)) def test_none_saves_as_default(self): instance = DurationFieldModelWithDefault() # this could happen if we were reading an existing instance out of the database that didn't have this field instance.duration = None instance.save() readout = DurationFieldModelWithDefault.objects.get(pk=instance.pk) self.assertEqual(readout.duration, timedelta(1, 0)) class ModelWithNonNullableFieldAndDefaultValue(models.Model): some_field = models.IntegerField(null=False, default=1086) class NonIndexedModelFieldsTests(TestCase): def test_long_textfield(self): long_text = "A" * 1501 instance = NonIndexedModel() instance.content = long_text instance.save() def test_big_binaryfield(self): long_binary = ("A" * 1501).encode('utf-8') instance = NonIndexedModel() instance.binary = long_binary instance.save() # ModelWithNonNullableFieldAndDefaultValueTests verifies that we maintain same # behavior as Django with respect to a model field that is non-nullable with default value. class ModelWithNonNullableFieldAndDefaultValueTests(TestCase): def _create_instance_with_null_field_value(self): instance = ModelWithNonNullableFieldAndDefaultValue.objects.create(some_field=1) client = connection.connection.gclient entity = client.get( client.key( ModelWithNonNullableFieldAndDefaultValue._meta.db_table, instance.pk, namespace=connection.settings_dict.get("NAMESPACE", ""), ) ) del entity["some_field"] client.put(entity) instance.refresh_from_db() return instance def test_none_in_db_reads_as_none_in_model(self): instance = self._create_instance_with_null_field_value() self.assertIsNone(instance.some_field) def test_none_in_model_saved_as_default(self): instance = self._create_instance_with_null_field_value() instance.save() instance.refresh_from_db() self.assertEqual(instance.some_field, 1086)
python
{"Bacon.js":"sha256-irbR/gB1RGg74EAnyd+M+RTmhAoJlD4i9Oc9cMW/+Uo=","Bacon.min.js":"sha256-qYqyD66ycx9K7f4TLBK9lM2QtSpe7Y+gYOMPrSqK2kQ="}
json
Geneva, Jan 24 (IANS) The World Health Organization (WHO) has announced that it was “too early” to declare the outbreak of the novel coronavirus in China a public health emergency of international concern (PHEIC), while warning that the number of cases may increase as much about the virus remains unknown. “I am not declaring a public health emergency of the international concern today. As it was yesterday, the Emergency Committee was divided over whether the outbreak of novel coronavirus represents a PHEIC or not,” WHO Director-General Tedros Adhanom Ghebreyesus told the media here on Thursday night after a closed-door meeting of the Emergency Committee. “Make no mistake, though, this is an emergency in China. But it has not yet become a global health emergency. It may yet become one,” Tedros said, adding that WHO’s risk assessment is that the outbreak is a very high risk in China, and a high risk regionally and globally. “I wish to reiterate that the fact I am not declaring a PHEIC today should not be taken as a sign that WHO does not think the situation is serious, or that we are not taking it seriously,” the WHO chief said. The UN health agency extended its Emergency Committee discussions on whether to declare a PHEIC from Wednesday to Thursday. The PHEIC is defined by the WHO as an extraordinary event that is determined to constitute a public health risk to other states through the international spread of disease and to potentially require a coordinated international response. Tedros said that 584 cases were reported to the WHO, including 17 deaths. A total of 575 of those cases and all of the deaths have been reported in China, with other cases reported in Japan, South Korea, Singapore, Thailand, the US and Vietnam. Tedros said China has taken measures it believes appropriate to contain the spread of coronavirus in Wuhan, where the virus appears to have originated, and other cities, and WHO hoped that they will be both effective and short in their duration. For the moment, the WHO does not recommend any broader restrictions on travel or trade, and recommends exit screening at airports as part of a comprehensive set of containment measures. All countries should have in place measures to detect cases of coronavirus, including at health facilities, Tedros said.
english
TS PECET Results 2023 is released! G Deva of Jangaon has topped the TSPECT Results 2023 for the BPEd Program and N Pravallika of Nalgonda district has topped the DPEd program respectively. Check the TS PECET Rankcard 2023 link below. The Telangana State Physical Education Common Entrance Test or TS PECET Results 2023 is released! As per the result stats, 96. 50 per cent students have cleared the exam. TSCHE has issued the TS PECET Rankcard 2023 link on the official website- pecet. tsche. ac. in. Candidates can use their application number and date of birth to access the same. Check the TS PECET Toppers 2023 and result link below. TSCHE Chairman Prof. R Limbadri along with Satavahana University Vice Chancellor Prof. S Mallesh and TSCHE Vice Chairman Prof. V Venkata Ramana declared the TS PECET Result 2023 via a press conference. As many as 1,193 candidates attended the admission test for the BPEd programme, out of which 96. 65 per cent have qualified. Similarly, 576 candidates appeared for DPEd Couse and 96. 18 per cent qualified. G Deva of Jangaon has topped the TSPECT Results 2023 for the BPEd Programme and N Pravallika of Nalgonda district have topped the DPEd programme respectively. Check the steps mentioned below to know how to download the rankcard. - Visit the official site of TS PECET- pecet. tsche. ac. in. - Click on TS PECET 2023 Rank Card link displayed on the home page. - Enter the login credentials and submit. - TS PECET rank card will be displayed on the screen. Telangana state has 1,660 seats in 16 BPEd colleges and 350 seats in four DPEd colleges and the admission on these seats is done via counselling. Manipur Unrest: CM N Biren Singh Hints At Involvement Of 'External Forces' In Ethnic Violence, Calls It 'Pre-Planned'
english
bypassed him for elevation to the apex court,Chief Justice of Delhi High Court Justice A P Shah chose the day before his retirement to publicly express his sense of hurt. The Chief Justice under whom the Delhi High Court legalised gay sex,ruled that the office of the Chief Justice of India came under the Right to Information Act and forced the Delhi government to come up with new parole guidelines,Shah said: It is for the people to judge whether I deserved (to be elevated to the Supreme Court) or not. But I cannot pretend that I am not hurt. A sense of hurt is always there. The 62-year-old judge had kept quiet at the time the collegium overlooked him one of the seniormost High Court chief justices while recommending names of other junior judges in October 2008 for the apex court. The move was widely questioned,but after initial reluctance,the government had accepted the collegiums decision. Set to retire from office on Friday,Shah,however,added these things happen in life and said the disappointment didnt diminish his enthusiasm for the institution. During his 21-month tenure as the Chief Justice,Shah came to be known for pro-poor policies,transparency,reasonableness in public policies and for taking up the cause of the disabled. Speaking about the landmark judgment legalising consensual homosexual sex between adults,he said: I did not switch on TV channels till late in the evening because I was not sure about the reactions from various quarters. When I attended a workshop with some German members and also some gay rights activists in 1997,I had categorically said to them that it would be very difficult for an Indian court to legalise homosexual sex. I did not realise it then that I would be deciding the issue one day. Fellow judges had by and large hailed the verdict,Justice Shah said. The other judgment his tenure will always be known for is bringing the office of the CJI under the purview of the RTI. Though the case was unusual,he said,it was overridden by several other significant concerns. The judgment was too significant as it decided on two important issues the independence of judiciary and the scope of the RTI Act, said Justice Shah. With the Central Government repeatedly expressing its commitment to formulate the judges accountability Bill,he admitted there was corruption in the judiciary,but emphasised that in the superior courts,it was minimal. I will not be telling the truth if I say corruption does not exist in the judiciary, he said. Having also served as a judge in the Mumbai High Court and as the Chief Justice of Madras High Court,Justice Shah called his tenure as the Chief Justice of the Delhi High Court very satisfying. I consider Bombay court one of the most professional courts while in Delhi,you are assisted not only by erudite judges but also by senior lawyers who regularly appear before the Supreme Court. Moreover,the Bar is also very cooperative. However,the work culture at the Madras High Court is marred by casteism and clashes involving Bar members, he said. Hailing from Solapur in Maharashtra,Justice Shah said he wasnt planning to take up any assignment and wanted to work for the poor and disabled. 5 important verdicts by benches headed by Chief Justice A P Shah: * Legalisation of consensual homsexual sex in July 2009. * Bringing office of the Chief Justice of India under the ambit of the RTI. Rules judicial independence is not a judges privilege but a responsibility cast upon him. * Acting on PILs complaining of flawed parole guidelines,asks the Delhi government to come up with new and equitable parole guidelines with a time frame to decide such applications.
english
Melbourne: Archaeologists with the Australian National University (ANU) have discovered fossils of seven giant rat species on East Timor in Southeast Asia with the largest up to 10 times the size of modern rats. Lead researcher Julien Louys from ANU said these are the largest known rats to have ever existed. "They are what you would call mega-fauna. The biggest one is about five kilos, the size of a small dog," Louys said. Just to put that in perspective, a large modern rat would be about half a kilo. The work is part of the From Sunda to Sahul project which is looking at the earliest human movement through Southeast Asia. Researchers are now trying to work out exactly what caused the rats to die out. Louys said the earliest records of humans on East Timor date around 46,000 years ago, and they lived with the rats for thousands of years. "We know they are eating the giant rats because we have found bones with cut and burn marks," he said. "The funny thing is that they were co-existing till about a thousand years ago. The reason we think they became extinct is because that was when metal tools started to be introduced in Timor, people could start to clear forests at a much larger scale," Louys explained. Louys said the project team is hoping to get an idea of when humans first moved through the islands of Southeast Asia, how they were doing it and what impact they had on the ecosystem. "We're trying to find the earliest human records as well as what was there before humans arrived," Louys said.
english
The 25-year-old England fast bowler Jofra Archer is ready to re-join the English Test squad after his second negative result in the COVID-19 test report. Barbados-born Jofra Archer was in both the final 13-member English squads for the first two Tests of the ongoing three-match home Test series against West Indies. The right-arm fast bowler appeared in the opening game of this series at Southampton, where England lost by four wickets. Though he finished with the wicket-less bowling figures during the West Indies’ first innings (0/61), he managed to pick up three crucial wickets in the fourth innings (3/45) of that match. Just a few hours before the beginning of the second Test in this ongoing series at Manchester, Archer was dropped from the team for breaching team’s bio-secure protocols. Archer had made an unauthorised trip to his home after the first Test defeat. In a result, he spent five days of self-isolation and also underwent two COVID-19 tests. As both the COVID-19 tests have negative results, Archer now has been added in the English Test squad. Earlier, Archer faced wide criticism for breaching team’s bio-secure protocols. While the youngster felt sorry and apologised for his action, he got huge support from the teammates. As Archer finally escaped from the big punishment as he was only fined and officially warned in writing, he became available for the final game of this Test series but he still had to undergo with two negative COVID-19 test reports. Once again, Old Trafford (Manchester) will host the third or final match of this ongoing Test series between 24th and 28th July. At present, the series is standing with 1-1 after the second Test. While West Indies won the first Test by four wickets, England levelled the series after winning the second Test by 113 runs.
english
A senior Pakistani intelligence official said on Saturday the U. S. is seeking to expand the areas where American missiles can target Taliban and al-Qaeda operatives but that Pakistan has refused the request because of domestic opposition to the strikes. The U. S. military launched more than 100 strikes this year, killing hundreds. Most have been in North Waziristan, where the Pakistani military has refused to stage its own ground offensive against the militant mini-state. This week alone, drone attacks killed 24 alleged militants, destroying a house and two moving vehicles. Pakistan privately tolerates the strikes along its north-western border as a “necessary evil” but cannot sanction widening them into more-populated areas, said the official with the Pakistani Inter Service Intelligence agency, or ISI. He spoke on condition of anonymity because he was not authorised to speak to the press. He would not specify which new areas the American side hoped to target, but an article in the Washington Post identified one as around Quetta, the capital of the south-western province of Baluchistan, where Afghan Taliban chief Mullah Mohammad Omar is believed to operate. The American drones now operate in designated “boxes” in Pakistan’s Federally Administrated Tribal Areas located along the lawless, mountainous border with Afghanistan, the ISI official said. He confirmed that U. S. officials had sought both to enlarge the current boxes and establish new ones outside the tribal zone where senior Taliban and al-Qaeda operatives are suspected to be operating. The Pakistani side denied the request because the risk of civilian casualties was too great, the official said. The missile strikes already inspire deep outrage among much of the Pakistani populace, he said, and the government cannot afford to inflame more resentment by expanding them into more populated areas. Pakistan’s refusal to allow strikes over a broader area is a sign of the tension between the U. S. and its key ally over the programme. The missile attacks are rarely acknowledged by Washington and Pakistan officially considers them to be a violation of its sovereignty. Critics condemn the programme as amounting to assassinations that violate international law. Pakistan’s Foreign Ministry spokesman Abdul Basit condemned any suggestion of expanding the American drones’ range. “We have very clearly conveyed that we will not in any case accept the expansion of the area of these drone attacks,” Mr. Basit told local Aaj television on Saturday. He also repeated the official line that Pakistan wants all the missile attacks to stop. Mr. Basit also rejected the Post ’s assertion that the Pakistan had agreed to an increased CIA presence in Quetta, where the American spy agency would work with the ISI to hunt down Taliban leaders.
english
/** * Copyright 2014 Mozilla Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // Class: IIMEClient module Shumway.AVMX.AS.flash.text.ime { import notImplemented = Shumway.Debug.notImplemented; import axCoerceString = Shumway.AVMX.axCoerceString; export interface IIMEClient { // JS -> AS Bindings compositionStartIndex: number /*int*/; compositionEndIndex: number /*int*/; verticalTextLayout: boolean; selectionAnchorIndex: number /*int*/; selectionActiveIndex: number /*int*/; updateComposition: (text: string, attributes: ASVector<any>, compositionStartIndex: number /*int*/, compositionEndIndex: number /*int*/) => void; confirmComposition: (text: string = null, preserveSelection: boolean = false) => void; getTextBounds: (startIndex: number /*int*/, endIndex: number /*int*/) => flash.geom.Rectangle; selectRange: (anchorIndex: number /*int*/, activeIndex: number /*int*/) => void; getTextInRange: (startIndex: number /*int*/, endIndex: number /*int*/) => string; // AS -> JS Bindings // _compositionStartIndex: number /*int*/; // _compositionEndIndex: number /*int*/; // _verticalTextLayout: boolean; // _selectionAnchorIndex: number /*int*/; // _selectionActiveIndex: number /*int*/; } }
typescript
{ "name": "timer", "version": "1.0.0", "main": "index.js", "license": "MIT", "scripts": { "dev": "npm run development", "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", "watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", "watch-poll": "npm run watch -- --watch-poll", "hot": "cross-env NODE_ENV=development webpack-dev-server --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", "prod": "npm run production", "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" }, "devDependencies": { "autoprefixer": "^7.1.1", "babel-cli": "^6.24.1", "babel-core": "^6.26.0", "babel-helper-vue-jsx-merge-props": "^2.0.2", "babel-loader": "^7.1.2", "babel-plugin-syntax-dynamic-import": "^6.18.0", "babel-plugin-syntax-jsx": "^6.18.0", "babel-plugin-transform-es2015-destructuring": "^6.23.0", "babel-plugin-transform-object-rest-spread": "^6.23.0", "babel-plugin-transform-runtime": "^6.23.0", "babel-plugin-transform-vue-jsx": "^3.4.3", "babel-preset-env": "^1.6.0", "babel-preset-es2015": "^6.24.1", "babel-preset-es2016": "^6.24.1", "babel-preset-stage-2": "^6.24.1", "babel-preset-vue": "^1.0.2", "browser-sync": "^2.18.∂13", "browser-sync-webpack-plugin": "^1.2.0", "path": "^0.12.7", "postcss-clearfix": "^1.0.0", "postcss-cssnext": "^2.11.0", "postcss-import": "^10.0.0", "postcss-loader": "^2.0.6", "postcss-scss": "^1.0.2", "vue": "^2.4.2", "vue-resource": "^1.3.4", "vue-router": "^2.7.0", "vuex": "^3.0.0", "webpack": "^3.5.2", "webpack-combine-loaders": "^2.0.3", "webpack-dev-server": "^2.4.2", "webpack-merge": "^4.1.0" }, "dependencies": { "body-parser": "^1.18.2", "cross-env": "^5.0.5", "express": "^4.16.2", "laravel-mix": "^2.1.0", "mongodb": "^2.2.33", "pug": "^2.0.0-rc.4", "timer-stopwatch": "^0.2.0" } }
json
I am forced to respond to two rejoinders to my article, “Unwarranted fears on Mullaiperiyar” (published in The Hindu on December 31, 2011), one of them by Ramaswamy R. Iyer (January 2, 2012) and the other by a friend and an esteemed former Kerala Minister, N. K. Premachandran (January 3), as I found some factual errors, and statements that are far from the truth. To Mr. Iyer's averment that “Periyar is not an inter-State river,” I would like to point out that a river whose catchment lies in more than one State is an inter-State river. As per the Water Atlas of Kerala (1995), published by Kerala's own Centre for Water Resources Development and Management, of the 5,398-sq km of the catchment of Mullaiperiyar, 114 sq km is in Tamil Nadu. When it comes to “rights,” Tamil Nadu has the right to maintain the dam and also draw water under the lease agreement, whether Mr. Iyer agrees on that or not. Besides, Tamil Nadu has usage rights over the waters as its usage period exceeds a century: this is an internationally accepted principle on water-sharing. The “sense of grievance” over the alleged unfairness over the 1886 agreement between the Maharaja of Travancore and the British government in India that Mr. Iyer finds to be “pervasive,” is baseless since the Kerala and Tamil Nadu governments ratified the original agreement and also entered into a supplementary agreement in 1970 as equal States. This agreement was not a colonial trick, but an attempt at mutual cooperation between the States, initiated by democratically elected eminent leaders. In fact, the very idea behind my writing to The Hindu was to bring out the simple fact that Tamil Nadu is truly concerned about the safety of the dam and has been investing huge resources not just to strengthen the dam but to create a structure that is as good as a new one. It was in that context that I said that Kerala was physically preventing Tamil Nadu from undertaking work on strengthening it. Mr. Premachandran conveniently ignores it, while Mr. Iyer callously says he has nothing to say on that. Mr. Premachandran's claim that Kerala “has always respected the judiciary and unflinchingly abided by its verdicts,” is far from the truth. The entire world knows that Kerala amended its Act to circumvent the Supreme Court's 2006 verdict, which allowed an increase in the storage level to 142 ft initially and 152 ft finally after completion of the strengthening process. While ordering status quo , the Supreme Court Bench made it clear that there “would be no impediment for Tamil Nadu to carry out maintenance and repairs for upkeep” of the dam. Mr. Iyer's philosophical statement, “if, hypothetically speaking, the dam were to burst, waters will cease to flow to Tamil Nadu,” holds no water as no gravity dam has burst anywhere in the world. If at all there is a risk of a dam-burst in Kerala, it is with the Idukki dam, which is an arch-dam. To Mr. Iyer's question, “should all the credit for diversion be given to Pennycuick and none to the Maharaja who agreed to it? ”, my reply is: Yes, we bow our heads in reverence to the Maharaja of Travancore, Visakham Thirunal Rama Varma, too. In fact, during the discussions with Pennycuick from 1862 onwards, the Maharaja was for a joint venture with the profit accrued from the revenue to be shared on agreed basis. But later he pulled out and preferred to accept lease rent for the land submerged, which only goes to prove that the King did not sign the agreement under any duress. Today, it is Kerala that is refusing to acknowledge the Maharaja's wisdom and vision in protecting his people from the annual floods in the Periyar — and getting some income by leasing a piece of land that was lying waste between hills. The dam tamed so effectively the roguish river that was causing devastation before flowing into the Arabian Sea, that the Maharaja approached the British government to build another dam in southern Travancore, where the Kodaiyar was wreaking havoc in Nanjilnadu, the southern rice bowl of his kingdom. It was that effort that led to the construction of the Pechiparai dam, which now stands tall, even a hundred years later, in Kanyakumari district that was acceded to Tamil Nadu during the reorganisation of States. In the same reorganisation process, had Peermedu and Devikulam taluks of Idukki district been acceded to Tamil Nadu, perhaps I would not have been writing this now. Finally, to allay Mr. Premachandran's fear of the Idukki dam bursting in the (imaginary) event of the Mullaiperiyar dam giving way, I have a piece of advice for Kerala: Please keep the storage level [in the Idukki dam] a little low. After all, the Idukki water goes waste, flowing into the Arabian Sea.
english
iPhone failing to do basic tasks at messages and calls can frustrate users. If you frequently face iPhone not sending text messages issue, read along to troubleshoot it without taking a trip to the nearest Apple center. There are multiple factors behind iPhone not sending text messages. Maybe, it’s a sketchy network connection, an expired carrier plan, an incorrect network setting, or an issue from your local carrier. Whatever the reason, we will go through them step-by-step and fix the message problems in no time. You must have an active network connection to send text messages. Before you type your messages and hit the send button, peek in the top right corner to confirm two or three network bars. If you occasionally face network issues in your area, you should consider switching to another carrier. You can enable and disable the Airplane mode on your iPhone and reset the network connection. Step 1: Swipe down from the top-right corner to open Control Center. The iPhone users with a physical Home button can swipe up from the bottom of the screen. Step 2: Enable Airplane mode and wait for a few seconds. Step 3: Disable it and try sending a text message again. If you are a prepaid user, check your current plan with your carrier. You might have reached the text message limit in your plan. You should either upgrade to a higher plan or get an add-on (if it’s available with your carrier) and start sending text messages without an error. If your local carrier is facing an outage, you will continue to face errors in sending text messages on your iPhone. You can confirm the issue on social media or head to Downdetector and search for your local carrier. You shall notice high outage graphs and familiar user comments. Wait for the carrier to fix the issue from their end, and you are good to go. 5. Change Conversation Line (Dual-SIM iPhone) If you are using a dual-SIM iPhone, make sure to use the correct conversation line to send a message. You might not have the required text message plan on both SIMs. Step 1: Open Messages and select a conversation. Step 2: Tap on the contact name at the top. Step 3: Tap on the conversation line and select the relevant SIM to send a text message. A wrong network setting tweak can lead to text messages not sending issues on your iPhone. iOS allows you to reset network settings on your iPhone. Here’s what you need to do. Step 1: Open the Settings app on iPhone. Step 2: Scroll to General. Confirm your decision. Resetting network settings will revert your iPhone’s saved Wi-Fi, Bluetooth, and VPN connections. The option won’t touch your apps or files. Read our dedicated post to learn what happens when you reset network settings on iPhone and Android. You will continue to face an error with text messages due to incorrect date and time settings on your iPhone. Let’s set the record straight. Step 1: Open the Settings app on iPhone. Step 2: Scroll to General. Step 3: Select Date & Time. Step 4: Enable the‘ Set Automatically’ toggle or pick a relevant time zone. Did you drop your iPhone recently and start to notice network issues? Grab a SIM ejector tool and remove your SIM card. Reinsert the SIM card and try sending a text message. In most cases, carriers bundle new firmware with system updates. You can update your iPhone to the latest version and enjoy a flawless text messaging experience. Occasionally, carriers do release new updates to download on your iPhone. Here’s how you can install them. Step 1: Open the Settings app on iPhone. Step 2: Go to the General menu on iPhone (refer to the steps above). Step 3: Select About. Step 3: Scroll to the Personal menu. Step 4: Tap on Network Provider, and iOS will install the latest firmware. If you still face errors with sending text messages on your iPhone, it’s time to contact the carrier and sort out the issue on your account. You can also ask your colleagues on the same carrier to confirm the issue. When your iPhone fails to send text messages, you can temporarily switch to WhatsApp, Telegram, or Signal to stay in touch with friends and family. Which trick worked for you? Share your experience in the comments below. The above article may contain affiliate links which help support Guiding Tech. However, it does not affect our editorial integrity. The content remains unbiased and authentic.
english
<filename>network/src/main/java/io/h2cone/network/nio/SingleThreadedReactor.java /* * Copyright 2020 hehuang https://github.com/h2cone * * 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 io.h2cone.network.nio; import io.h2cone.network.staff.ChannelHandler; import io.h2cone.network.staff.DefaultChannelHandler; import java.io.IOException; import java.net.InetSocketAddress; import java.nio.ByteBuffer; import java.nio.channels.SelectionKey; import java.nio.channels.Selector; import java.nio.channels.ServerSocketChannel; import java.nio.channels.SocketChannel; import java.util.Iterator; import java.util.Set; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; /** * Reactor Pattern # Single threaded version * <p> * http://gee.cs.oswego.edu/dl/cpjslides/nio.pdf */ public class SingleThreadedReactor { static class Reactor implements Runnable { final Selector selector; final ServerSocketChannel serverSocketChannel; final ChannelHandler channelHandler; public Reactor(int port, ChannelHandler channelHandler) throws IOException { selector = Selector.open(); serverSocketChannel = ServerSocketChannel.open(); serverSocketChannel.socket().bind(new InetSocketAddress(port)); serverSocketChannel.configureBlocking(false); SelectionKey selectionKey = serverSocketChannel.register(selector, SelectionKey.OP_ACCEPT); selectionKey.attach(new Acceptor()); // (1) this.channelHandler = channelHandler; } @Override public void run() { try { while (!Thread.interrupted()) { selector.select(); Set<SelectionKey> selectionKeys = selector.selectedKeys(); Iterator<SelectionKey> iterator = selectionKeys.iterator(); while (iterator.hasNext()) { SelectionKey selectionKey = iterator.next(); dispatch(selectionKey); // (2) iterator.remove(); } selectionKeys.clear(); } } catch (IOException e) { e.printStackTrace(); } } private void dispatch(SelectionKey selectionKey) { Runnable runnable = (Runnable) selectionKey.attachment(); if (runnable != null) { runnable.run(); // (3) } } class Acceptor implements Runnable { @Override public void run() { try { SocketChannel socketChannel = serverSocketChannel.accept(); if (socketChannel != null) { new Handler(selector, socketChannel, channelHandler); // (4) } } catch (IOException e) { e.printStackTrace(); } } } static class Handler implements Runnable { final SelectionKey selectionKey; final SocketChannel socketChannel; final ChannelHandler channelHandler; ByteBuffer inputBuf = ByteBuffer.allocate(1024); ByteBuffer outputBuf = ByteBuffer.allocate(1024); static int READING = 0, WRITING = 1; int state = READING; public Handler(Selector selector, SocketChannel socketChannel, ChannelHandler channelHandler) throws IOException { this.socketChannel = socketChannel; this.socketChannel.configureBlocking(false); // (5) selectionKey = this.socketChannel.register(selector, 0); selectionKey.attach(this); selectionKey.interestOps(SelectionKey.OP_READ); selector.wakeup(); this.channelHandler = channelHandler; } @Override public void run() { try { if (state == READING) { read(); } else if (state == WRITING) { write(); } } catch (Exception e) { e.printStackTrace(); } } private void read() throws IOException { channelHandler.read(socketChannel, inputBuf); if (channelHandler.inputCompleted(inputBuf)) { channelHandler.process(inputBuf, outputBuf); state = WRITING; selectionKey.interestOps(SelectionKey.OP_WRITE); } } private void write() throws IOException { channelHandler.write(socketChannel, outputBuf); if (channelHandler.outputCompleted(outputBuf)) { selectionKey.cancel(); // (6) } } } } public static void main(String[] args) throws IOException { int port = args.length == 0 ? 8080 : Integer.parseInt(args[0]); ExecutorService executorService = Executors.newSingleThreadExecutor(); executorService.execute(new Reactor(port, new DefaultChannelHandler())); System.out.printf("server running on %s\n", port); } }
java
Legendary leg-spinner Shane Warne has picked his national side skipper Steven Smith and Indian captain Virat Kohli among the world best batsmen, but he further rates the former above than batting mainstay from the subcontinent in the Test fold. “To me Steve Smith is the best Test batsman in the world,” Warne in his column for News Corp wrote. It’s important to point out that the 48-year-old cricket-turned-commentator Warne believes Smith has got the better of Kohli when it comes to the traditional format. (Read Also: SA vs IND 2018: Graeme Smith Feels South African Bowlers Will Have an Edge Over the Indian Batsmen) However, Warne reiterated the modern-day 29-year-old Indian batsman Kohli stand out on the top when it comes to across the formats contest in the gentleman’s game. “Virat Kohli is the best across all three formats of the game, but across five days, Smith is the man,” Warne added. Warne went on to consider the 28-year-old Smith is having a stellar run while donning the white which subsequently saw the former picking world’s 11 best batsmen on the best list. On the other side, the reason Warne set was the right-handed batsman Kohli’s disastrous England tour in 2014. It’s pertinent to mention that Kohli managed to post just 134 runs in 10 innings of the five-Test fixtures. His highest score was 39, as he collected runs at the unimpressive average of 13.40. “The hole in Kohli’s CV on the Test match stage is in England and the pressure is on the fiery but very likeable Indian to carry over some double-ton magic from home soil to that country when his team tours next year,” Warne mentioned. In 63 Tests, Kohli amassed 5,268 runs at an average of 53.75. He smashed 20 hundreds and 15 fifties, as Smith featured in 59 Tests for Australia in which he scored 5796 runs at an average of 62.32. He smashed 22 hundreds and 21 fifties. However, Warne observed Smith, who has averaged over 43 in the United Kingdom, has smashed three hundreds in England during the Ashes campaign, as the unorthodox in style further scored heavily during the ongoing Ashes 2017-18. “To me, a great batsman has to have made a hundred in three key countries: in England, against the Duke ball on seaming and swinging pitches; in Australia, on our fast-paced, bouncy tracks,” Warne further added. Interestingly, the list includes Smith and his counterpart Kohli at the 10th and 11th place, as Warne see best in the New South Wales-based star top-order batsman. “And of course, in the dust bowls of India, on pitches that spin and spit,” Warne wrote on Smith. With Kohli and Smith, who are known for amassing runs at will and have simultaneously shouldered the responsibility even in the difficult situations for the respective teams from time-to-time. The first two positions were claimed by the Windies’ Viv Richards and batting stalwart Brian Lara, as legendary Indian batsman Sachin Tendulkar is placed at the third position. Interestingly, Warne feels Greg Chappell is fourth on the list alongside former skipper Ricky Ponting and Allan Border. Former South African all-rounder Jacques Kallis is seventh on the list with England’s Graham Gooch sealing the eighth spot, as known for his pyrotechnics AB de Villiers has earned the ninth place. VIDEO OF THE DAY: Since making his debut in 1992, Warne played 194 One-day Internationals, 145 Tests. He bagged 708 Test scalps in 273 innings, and 293 wickets in 191 innings of 194 ODIs.
english
**Bhubaneswar:** The Biju Janata Dal (BJD) today moved the Election Commission and reported a formal complaint on the ‘forged’ intelligence report on the Chief Minister’s candidature, which is making rounds since Monday. Apprising the Chief Electoral Officer about the issue, BJD leaders alleged that the BJP has utilised an incredible social media document for ‘petty electoral gains’. “We strongly object to the circulation of the forged report. If the CEO does not act on the perpetrators treating the circulation of the fake report as an exception, it will soon turn into a practice,” BJD Spokesperson, Sasmit Patra said.
english