text
stringlengths 1
1.04M
| language
stringclasses 25
values |
|---|---|
The National Drug Law Enforcement Agency (NDLEA) has arrested two “fake couple” identified as Ilonzeh Kingsley and Ilonzeh Nonyelum for allegedly ingesting 184 wraps of cocaine. The NDLEA said the The NDLEA said the duo was heading to India for a purported medical treatment before they were arrested at the Lagos airport.
In a statement on Sunday, Femi Babafemi, NDLEA spokesperson, said part of the cocaine seized from the couple was concealed in the woman’s private part.
“The two suspects were intercepted at the screening point 1, terminal 1 of the international wing of the Lagos airport on Tuesday 1st August 2023 while attempting to board an Ethiopian airline flight to India,” Babafemi said.The NDLEA spokesperson said the documents of the suspects depict that they are couple but it was later discovered that the travel papers were fraudulently obtained for the purpose of drug trafficking.
He said the male suspect was on bail over alleged drug trafficking before he was arrested again. “The lady later gave her real name as Ngogbike Nkechi. During her interview, she confessed that she was recruited in her church in Aba, Abia state where she lives,” the NDLEA spokesperson said.Read more:
NDLEA arrests India-bound ‘couple’ with 184 wraps of cocaine, intercepts other drugs consignmentThe National Drug Law Enforcement Agency, NDLEA, has announced the arrest of one Mr. Ilonzeh Kingsley Onyebuchi and Mrs. Ilonzeh Roseline Nonyelum,
India-bound ‘Couple’ Excretes 184 Wraps Of Cocaine After Arrest At Lagos Airport, Woman Hides Drug In Private Parts | Sahara ReportersOperatives of the National Drug Law Enforcement Agency, NDLEA, have arrested a fake couple for ingesting 184 wraps of cocaine weighing 3.322 kilograms with 100 grams of the drug also concealed in the woman’s private parts. The fake couple were identified as Mr. Ilonzeh Kingsley Onyebuchi and Mrs. Ilonzeh Roseline Nonyelum. They were purportedly going for medical treatment in India.
JUST IN: Tinubu writes senate on plan to deploy troops to Niger Republic | TheCablePresident Bola Tinubu has written to the national assembly about a military intervention in Niger Republic amid the coup.
|
english
|
<reponame>dfirence/pe-compass-samples
{"pe_name":"cfgbkend.dll","pe_type":267,"pe_size":63488,"pe_subsystem":2,"pe_subsystem_caption":"The Windows graphical user interface (GUI) subsystem","pe_path":"c:\\Windows\\WinSxS\\wow64_microsoft-windows-t..vices-configbackend_31bf3856ad364e35_10.0.18362.1_none_b34711e5a3312818\\cfgbkend.dll","pe_timedate_stamp":2463292473,"pe_timedate_human":"2048-01-22T07:54:33.000Z","ImageDLLImports":[{"name":"ntdll.dll","imports":13,"functions":["RtlUnwind","_chkstk","_wcsicmp","memcpy","memcpy_s","memmove","memmove_s","memset","wcscat_s","wcschr","wcscpy_s","wcsncpy_s","wcstok_s"]},{"name":"msvcrt.dll","imports":13,"functions":["_XcptFilter","__dllonexit","_amsg_exit","_callnewh","_errno","_initterm","_lock","_onexit","_purecall","_unlock","free","malloc","realloc"]},{"name":"regapi.dll","imports":14,"functions":["RegCdCreateW","RegCreateMonitorConfigW","RegCreateUserConfigW","RegPdEnumerateW","RegPdQueryW","RegWdEnumerateW","RegWdQueryW","RegWinStationCreateW","RegWinStationDeleteW","RegWinStationEnumerateW","RegWinStationQueryExNew","RegWinStationQueryExtendedSettingsW","RegWinStationQueryW","RegWinStationSetExtendedSettingsW"]},{"name":"winsta.dll","imports":9,"functions":["ServerLicensingClose","ServerLicensingGetAvailablePolicyIds","ServerLicensingGetPolicy","ServerLicensingOpenW","ServerLicensingSetPolicy","WinStationEnumerateW","WinStationFreeMemory","_WinStationReadRegistry","_WinStationUpdateSettings"]},{"name":"kernel32.dll","imports":31,"functions":["CompareStringW","DeleteCriticalSection","DisableThreadLibraryCalls","EnterCriticalSection","FindResourceExW","FreeLibrary","GetCurrentProcess","GetCurrentProcessId","GetCurrentThreadId","GetLastError","GetModuleFileNameW","GetModuleHandleW","GetProcAddress","GetSystemTimeAsFileTime","GetTickCount","InitializeCriticalSection","LeaveCriticalSection","LoadLibraryExW","LoadResource","LocalAlloc","LocalFree","MultiByteToWideChar","OutputDebugStringA","QueryPerformanceCounter","RaiseException","SetUnhandledExceptionFilter","SizeofResource","Sleep","TerminateProcess","UnhandledExceptionFilter","lstrcmpiW"]},{"name":"user32.dll","imports":3,"functions":["CharNextW","LoadStringW","UnregisterClassA"]},{"name":"oleaut32.dll","imports":0,"functions":[]},{"name":"advapi32.dll","imports":33,"functions":["AllocateAndInitializeSid","BuildExplicitAccessWithNameW","BuildSecurityDescriptorW","BuildTrusteeWithSidW","CheckTokenMembership","ConvertSidToStringSidW","CreateWellKnownSid","EqualSid","FreeSid","GetExplicitEntriesFromAclW","GetSecurityDescriptorDacl","GetSecurityDescriptorLength","GetSecurityDescriptorOwner","GetSecurityDescriptorSacl","GetTrusteeNameW","InitializeAcl","InitializeSecurityDescriptor","IsValidSecurityDescriptor","LookupAccountNameW","LookupAccountSidW","MakeSelfRelativeSD","RegCloseKey","RegCreateKeyExW","RegDeleteKeyW","RegDeleteValueW","RegEnumKeyExW","RegEnumKeyW","RegOpenKeyExW","RegQueryInfoKeyW","RegQueryValueExW","RegSetValueExW","SetEntriesInAclW","SetSecurityDescriptorDacl"]},{"name":"utildll.dll","imports":2,"functions":["SetupAsyncCdConfig","WinEnumerateDevices"]},{"name":"api-ms-win-core-com-l1-1-0.dll","imports":5,"functions":["CoCreateInstance","CoTaskMemAlloc","CoTaskMemFree","CoTaskMemRealloc","StringFromGUID2"]},{"name":"api-ms-win-shcore-registry-l1-1-0.dll","imports":1,"functions":["SHDeleteKeyW"]}],"ImageDLLExports":{"exports":8,"functions":["CLSID_CfgComp","DllCanUnloadNow","DllGetClassObject","DllRegisterServer","DllUnregisterServer","IID_ICfgComp","IID_ISettingsComp","IID_ISettingsComp2"]},"ImageHashSignatures":{"md5":"08d08ef294a2452347c2d5669a663b80","sha2":"374d447d0eafdea59e777e3db1303b1f397bfc8fda045c2e89e2867adf04eebd"}}
|
json
|
Tel Aviv, May 9 The Israeli government's 12-month budget deficit increased significantly from 300 million shekels ($82 million) to 4. 9 billion shekels in a month, mainly due to the shrinking tax revenues, according to data released by the Finance Ministry.
The Israeli government's total tax revenues decreased by a real rate of 8. 9 per cent year-on-year in the first four months of 2023, Xinhua news agency quoted the Ministry as saying.
The decrease was mainly due to a steep decline in the collection of real estate taxes by 34. 9 per cent year-on-year during January-April, and by 48. 9 per cent in April alone compared to April last year, with both figures in real terms.
"The frequent increases in the base interest rate by Israel's central bank substantially reduced the number of apartment buyers due to the difficulty of taking out a mortgage," Gad Lior, senior analyst for Yedioth Ahronoth daily newspaper, told Xinhua.
|
english
|
package com.orasi.web.webelements;
import java.util.ArrayList;
import java.util.List;
import org.openqa.selenium.By;
import org.openqa.selenium.Dimension;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.Point;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.internal.Coordinates;
import org.openqa.selenium.internal.Locatable;
import org.openqa.selenium.internal.WrapsElement;
import org.openqa.selenium.support.FindBy;
import com.orasi.Beta;
import com.orasi.web.webelements.impl.ElementImpl;
import com.orasi.web.webelements.impl.internal.ImplementedBy;
/**
* wraps a web element interface with extra functionality. Anything added here
* will be added to all descendants.
*/
@ImplementedBy(ElementImpl.class)
public interface Element extends WebElement, WrapsElement, Locatable {
/**
* @author Justin
* @see main.java.com.orasi.core.interfaces.impl.ElementImpl#clear()
* @summary - used to clear text entry areas; has not effect on any other
* elements
*/
@Override
void clear();
WebDriver getWrappedDriver();
/**
* @author Justin
* @summary - draws the focus to an object using Actions
*/
void focus();
/**
* @author Justin
* @see org.openqa.selenium.WebElement#click()
* @summary - default Selenium click
*/
@Override
void click();
/**
* @summary - click an element using a JavascriptExecutor
* @param driver
* - Current active WebDriver object
*/
void jsClick();
/**
* @author Justin
* @see org.openqa.selenium.WebElement#click()
* @summary - draws the focus to an object and clicks the object using
* Actions
* @param driver
* - Current active WebDriver object
*/
void focusClick();
/**
* @author Justin
* @param keysToSend
* - an array of characters or string literals
* @see main.java.com.orasi.core.interfaces.impl.ElementImpl#sendKeys(java.lang.CharSequence...)
* @summary - sends the char sequence to the element if the sequnce is not
* an empty string
*/
/**
* @author Justin
* @see main.java.com.orasi.core.interfaces.impl.ElementImpl#onBlur()
* @summary - triggers the onBlure FireEvent in the DOM
*/
void onBlur();
@Override
void sendKeys(CharSequence... keysToSend);
/**
* @author Justin
* @see org.openqa.selenium.WebElement#submit
* @summary - submits form to remote server; exception thrown if the element
* is not within a form
*/
@Override
void submit();
/**
* @author Justin
* @param by
* - Search for specified {@link By} location and return it's
* {@link WebElement}
* @return {@link WebElement}
* @see main.java.com.orasi.core.interfaces.impl.ElementImpl#findElement()
*/
@SuppressWarnings("unchecked")
@Override
Element findElement(By by);
/**
* @author Justin
* @param by
* - Search for specified {@link By} location and return all
* elements found in a {@link List}
* @return {@link List}
* @see main.java.com.orasi.core.interfaces.impl.ElementImpl#findElements()
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
List<WebElement> findElements(By by);
/**
* @author Justin
* @param name
* - Search for specified attribute and return it's value
* @return {@link String} Value of specified attribute
* @see main.java.com.orasi.core.interfaces.impl.ElementImpl#getAttribute()
*/
@Override
String getAttribute(String name);
@SuppressWarnings("rawtypes")
ArrayList getAllAttributes();
/**
* @author Justin
* @param propertyName
* - Search for specified property and return it's value
* @return {@link String} Value of specified property
* @see main.java.com.orasi.core.interfaces.impl.ElementImpl#getCssValue()
*/
@Override
String getCssValue(String propertyName);
/**
* @return {@link Coordinates}
* @see org.orasi.chameleon.interfaces.impl.ElementImpl#getCoordinates();
*/
@Override
Coordinates getCoordinates();
/**
* @author Justin
* @return {@link Point} Return x and y location
* @see main.java.com.orasi.core.interfaces.impl.ElementImpl#getLocation()
*/
@Override
Point getLocation();
/**
* @author Justin
* @return {@link Dimension} Return height and width of element
* @see main.java.com.orasi.core.interfaces.impl.ElementImpl#getSize()
*/
@Override
Dimension getSize();
/**
* @author Justin
* @return {@link String} Text value in element
* @see main.java.com.orasi.core.interfaces.impl.ElementImpl#getText()
*/
@Override
String getText();
/**
* @author Justin
* @return {@link String} Tag value in element
* @see main.java.com.orasi.core.interfaces.impl.ElementImpl#getTagName()
*/
@Override
String getTagName();
/**
* @author Justin
* @return {@link Boolean} Return TRUE if element is enabled, FALSE if it is
* not
* @see main.java.com.orasi.core.interfaces.impl.ElementImpl#isEnabled()
*/
@Override
boolean isEnabled();
@Override
boolean isSelected();
/**
* @author Justin
* @return {@link Boolean} Return TRUE if element is Displayed, FALSE if it
* is not
* @see main.java.com.orasi.core.interfaces.impl.ElementImpl#isDisplayed()
*/
@Override
boolean isDisplayed();
/**
* @summary - Returns true when the inner element is ready to be used.
* @author Justin
* @return boolean true for an initialized WebElement, or false if we were
* somehow passed a null WebElement.
*/
boolean elementWired();
/**
* @author Justin
* @return locator - type of element that was used to create element using
* {@link FindBy}
*/
// By getElementLocator();
/**
* @author Justin
* @return {@link By} locator value of element that was used to create
* element using {@link FindBy}
*/
// String getElementIdentifier();
/**
* @author Justin
* @return locator identifier and the value of element that was used to
* create element using {@link FindBy}
*/
String getElementLocatorInfo();
/**
* @summary - Used to highlight and element on a page
* @author Waits
* @param driver
* @return NA
*/
public void highlight();
/**
* @summary - Used to highlight and element on a page
* @author Waits
* @param driver
* - Current active WebDriver object
*/
public void scrollIntoView();
@Beta
@Override
public <X> X getScreenshotAs(OutputType<X> target);
/**
* Used to determine if the desired element is visible on the screen
* Will wait for default element timeout unless new timeout is passed in
* If object is not visible within the time, handle the error based default handler
* or by boolean passed in
*
* @author Justin
* @param args
* Optional arguments </br>
* <b>timeout</b> - the maximum time in seconds the method should try to sync. Called
* with syncVisible(10)</br>
* <b>failTestOnSyncFailure </b>- if TRUE, the test will throw an exception and
* fail the script. If FALSE, the script will
* not fail, instead a FALSE will be returned
* to the calling function. Called with
* syncVisible(10, false)
*/
public boolean syncVisible(Object... args);
/**
* Used to determine if the desired element is hidden on the screen
* Will wait for default element timeout unless new timeout is passed in
* If object is not hidden within the time, handle the error based default handler
* or by boolean passed in
*
* @author Justin
* @param args
* Optional arguments </br>
* <b>timeout</b> - the maximum time in seconds the method should try to sync. Called
* with syncHidden(10)</br>
* <b>failTestOnSyncFailure </b>- if TRUE, the test will throw an exception and
* fail the script. If FALSE, the script will
* not fail, instead a FALSE will be returned
* to the calling function. Called with
* syncHidden(10, false)
*/
public boolean syncHidden(Object... args);
/**
* Used to determine if the desired element is enabled on the screen
* Will wait for default element timeout unless new timeout is passed in
* If object is not enabled within the time, handle the error based default handler
* or by boolean passed in
*
* @author Justin
* @param args
* Optional arguments </br>
* <b>timeout</b> - the maximum time in seconds the method should try to sync. Called
* with syncEnabled(10)</br>
* <b>failTestOnSyncFailure </b>- if TRUE, the test will throw an exception and
* fail the script. If FALSE, the script will
* not fail, instead a FALSE will be returned
* to the calling function. Called with
* syncEnabled(10, false)
*/
public boolean syncEnabled(Object... args);
/**
* Used to determine if the desired element is disabled on the screen
* Will wait for default element timeout unless new timeout is passed in
* If object is not disabled within the time, handle the error based default handler
* or by boolean passed in
*
* @author Justin
* @param args
* Optional arguments </br>
* <b>timeout</b> - the maximum time in seconds the method should try to sync. Called
* with syncDisabled(10)</br>
* <b>failTestOnSyncFailure </b>- if TRUE, the test will throw an exception and
* fail the script. If FALSE, the script will
* not fail, instead a FALSE will be returned
* to the calling function. Called with
* syncDisabled(10, false)
*/
public boolean syncDisabled(Object... args);
/**
* Used to determine if the desired text is present in the desired element
* Will wait for default element timeout unless new timeout is passed in
* If text is not present within the time, handle the error based default handler
* or by boolean passed in
*
* @author Justin
* @param text
* - Text to search for
* @param args
* Optional arguments </br>
* <b>timeout</b> - the maximum time in seconds the method should try to sync. Called
* with syncTextInElement("text", 10)</br>
* <b>failTestOnSyncFailure </b>- if TRUE, the test will throw an exception and
* fail the script. If FALSE, the script will
* not fail, instead a FALSE will be returned
* to the calling function. Called with
* syncTextInElement("text", 10, false)
*/
public boolean syncTextInElement(String text, Object... args);
/**
* Used to determine if the desired text is present in the desired element
* Will wait for default element timeout unless new timeout is passed in
* If text is not present within the time, handle the error based default handler
* or by boolean passed in
*
* @author Justin
* @param regex
* (Required) The regular expression that should match to text the element should contain in either its text or 'value' attribute
* @param args
* Optional arguments </br>
* <b>timeout</b> - the maximum time in seconds the method should try to sync. Called
* with syncTextMatchesInElement("text", 10)</br>
* <b>failTestOnSyncFailure </b>- if TRUE, the test will throw an exception and
* fail the script. If FALSE, the script will
* not fail, instead a FALSE will be returned
* to the calling function. Called with
* syncTextMatchesInElement("text", 10, false)
*/
public boolean syncTextMatchesInElement(String regex, Object... args);
/**
* Used to determine if the desired text is present in the desired attribute of Element
* Will wait for default element timeout unless new timeout is passed in
* If value is not present within the time, handle the error based default handler
* or by boolean passed in
*
* @author Justin
* @param attribute
* (Required) - Element attribute to view
* @param value
* (Required) - The text the element attribute should contain in either its text or value attribute
* @param args
* Optional arguments </br>
* <b>timeout</b> - the maximum time in seconds the method should try to sync. Called
* with syncAttributeContainsValue("attribute, "value", 10)</br>
* <b>failTestOnSyncFailure </b>- if TRUE, the test will throw an exception and
* fail the script. If FALSE, the script will
* not fail, instead a FALSE will be returned
* to the calling function. Called with
* syncAttributeContainsValue("attribute", "value", 10, false)
*/
public boolean syncAttributeContainsValue(String attribute, String value, Object... args);
/**
* Used to determine if the desired text is present in the desired attribute of Element
* Will wait for default element timeout unless new timeout is passed in
* If value is not present within the time, handle the error based default handler
* or by boolean passed in
*
* @author Justin
* @param attribute
* (Required) - Element attribute to view
* @param regex
* (Required) - The regular expression that should match the text of the element attribute
* @param args
* Optional arguments </br>
* <b>timeout</b> - the maximum time in seconds the method should try to sync. Called
* with syncAttributeMatchesValue("attribute", "regex", 10)</br>
* <b>failTestOnSyncFailure </b>- if TRUE, the test will throw an exception and
* fail the script. If FALSE, the script will
* not fail, instead a FALSE will be returned
* to the calling function. Called with
* syncAttributeMatchesValue("attribute", "regex", 10, false)
*/
public boolean syncAttributeMatchesValue(String attribute, String regex, Object... args);
/**
* Used to determine if the desired text is present in the desired CSS Property of Element
* Will wait for default element timeout unless new timeout is passed in
* If value is not present within the time, handle the error based default handler
* or by boolean passed in
*
* @author Justin
* @param cssProperty
* (Required) - Element CSS Property to match
* @param regex
* (Required) - The regular expression that should match the text of the element CSS Property
* @param args
* Optional arguments </br>
* <b>timeout</b> - the maximum time in seconds the method should try to sync. Called
* with syncCssPropertyContainsValue("property", "value", 10)</br>
* <b>failTestOnSyncFailure </b>- if TRUE, the test will throw an exception and
* fail the script. If FALSE, the script will
* not fail, instead a FALSE will be returned
* to the calling function. Called with
* syncCssPropertyContainsValue("property", "value", 10, false)
*/
public boolean syncCssPropertyContainsValue(String cssProperty, String value, Object... args);
/**
* Used to determine if the desired text is present in the desired CSS Property of Element
* Will wait for default element timeout unless new timeout is passed in
* If value is not present within the time, handle the error based default handler
* or by boolean passed in
*
* @author Justin
* @param cssProperty
* (Required) - Element CSS Property to match
* @param regex
* (Required) - The regular expression that should match the text of the element CSS Property
* @param args
* Optional arguments </br>
* <b>timeout</b> - the maximum time in seconds the method should try to sync. Called
* with syncCssPropertyMatchesValue("property", "value", 10)</br>
* <b>failTestOnSyncFailure </b>- if TRUE, the test will throw an exception and
* fail the script. If FALSE, the script will
* not fail, instead a FALSE will be returned
* to the calling function. Called with
* syncCssPropertyMatchesValue("property", "value", 10, false)
*/
public boolean syncCssPropertyMatchesValue(String cssProperty, String regex, Object... args);
public boolean syncInFrame(Object... args);
}
|
java
|
"use strict";
const BrowserWebSocket = require("./BrowserWebSocket");
const WebSocket = BrowserWebSocket.available ? BrowserWebSocket : require("ws");
const Constants = require("../../Constants");
const heartbeat = new WeakMap();
class BaseSocket extends WebSocket {
constructor(url) {
super(url);
this.readyState = Constants.ReadyState.CONNECTING;
this.on("open", () => this.readyState = Constants.ReadyState.OPEN);
const close = () => {
this.unsetHeartbeat();
this.readyState = Constants.ReadyState.CLOSED;
};
this.on("close", close);
this.on("error", close);
this._connectionTimer = null;
}
_startTimeout(callback, time) {
this._stopTimeout();
this._connectionTimer = setTimeout(callback, time);
}
_stopTimeout() {
if (!this._connectionTimer) return;
clearTimeout(this._connectionTimer);
this._connectionTimer = null;
}
get connected() {
return this.readyState == Constants.ReadyState.OPEN;
}
get connecting() {
return this.readyState == Constants.ReadyState.CONNECTING;
}
send(op, data) {
let m = {op: op, d: data};
try {
super.send(JSON.stringify(m));
} catch (e) { console.error(e.stack); }
}
setHeartbeat(callback, msec) {
if (typeof callback !== "function")
throw new TypeError("Heartbeat callback is not a function");
if (!this.connected)
return;
this.unsetHeartbeat();
heartbeat.set(this, setInterval(() => {
if (!this.connected)
return this.close();
callback();
}, msec));
}
unsetHeartbeat() {
var handle = heartbeat.get(this);
if (handle !== undefined) clearInterval(handle);
heartbeat.delete(this);
}
close(code, data) {
super.close(code, data);
this.unsetHeartbeat();
this._stopTimeout();
// wait close frame for 5 seconds instead of default 30
if (this._closeTimer && this._closeTimer._onTimeout) {
var callback = this._closeTimer._onTimeout;
setTimeout(() => callback(), 5000);
}
clearTimeout(this._closeTimer);
}
}
module.exports = BaseSocket;
|
javascript
|
{
"Bivoltine": "Two generations per year",
"Facultative Multivoltine": "One or more generations per year",
"Facultative Semivoltine": "Life Cycle requires one year or more",
"Multivoltine": "More than one generation per year",
"Semivoltine": "Life Cycle requires more than one year",
"Univoltine": "One generation per year"
}
|
json
|
<gh_stars>0
{"id":"27095914-5459-4e86-95b0-94d8e69fb19c","name":"Physics","code":"2C3F","qualification":"pgce_with_qts","startDate":"2022-09-01T09:00:00.000Z","applicationsOpenDate":"2021-10-12T00:00:00.000Z","programType":"SD","fundingType":"fee","studyMode":"F","ageRange":"13_to_18","subjectLevel":"secondary","isSend":"no","subjects":[{"id":"bf97cd0a-224c-43d3-a021-84143df13e8d","code":"F3","name":"Physics"}],"locations":[{"id":"f0aa5873-d227-4622-a6d6-1a32eaea9c5f","name":"Main Site","isPublished":"Y","status":"R","vacancies":"F"}],"trainingProvider":{"id":"f6a7120c-ffbb-4f8c-ae14-d9b3cd3ee59f","code":"14K","name":"Biddulph High School"},"accreditedBody":{"id":"62d5803b-89ca-4e21-bb6f-5c74944c56ad","code":"B25","name":"Birmingham City University"},"profPost":"BO","degreeGrade":"1","english":"1","maths":"1","acceptPendingGcse":"no","acceptGcseEquivalency":"no","acceptEnglishGcseEquivalency":"no","acceptMathsGcseEquivalency":"no","courseLength":"OneYear","feesUK":9250,"aboutCourse":"After an Induction Programme at the university, you will be in school on two block placements to gain a supported understanding of the role of the teacher. Within a school, you will receive expert support from a subject or class mentor who will hold weekly meetings with you to help you to prepare, teach and review lessons and develop your subject knowledge. Each school or college will have a professional mentor who will help you to understand the organisation of the school, pastoral care systems and the legal and social framework of school including supporting services. Associate Teachers have a phased introduction to teaching that will reflect your personal needs. Initially you will observe the regular teacher, help with group work and then move towards sharing classes with the teacher before eventually taking classes yourself. As well as teaching your subject, you will be required to contribute generally to the life of the school. The University element of the course is designed to engage Associate Teachers in critical reflection on the nature of education. Group and individual tutorials in the university will give you an opportunity to discuss your ideas and the challenges you may face.","interviewProcess":"","howSchoolPlacementsWork":"The school experience is based in local, carefully selected partnership schools. \r\n*You will complete 2 placements, covering the age range 11-18.\r\n*The first placement will run from September to the end of January and the second from February to mid-June.","personalQualities":"","otherRequirements":"","status":1,"createdAt":"2021-07-06T10:53:46.283Z","updatedAt":"2021-08-10T09:51:50.559Z","canSponsorStudentVisa":"yes","cycle":"2022"}
|
json
|
(Under M/O Housing and Urban Poverty Alleviation )
Intimation letter and list for individual Deed of Assignment for Flats/ Parking at Jaipur Ph-I & II as on 31/05/2021.
Misc Administrative Charges for all Allottees/Beneficiaries of Housing Projects.
Intimation letters for allotment of Vacant Car Parking space at Jaipur Ph-II Scheme.
Formation of '
Final Installment called. Last date of payment is 01/10/2012.
Scheme was announced during early’ 2008. Construction progressing. Fifth installment called with 11th Mar 2011 as the last date of payment.Technical Brochures dispatched to all beneficiaries.
|
english
|
.logo {
font-size: 1.5em;
display: inline;
}
|
css
|
Frostpunk, the successful strategy game from 11 bit studios that challenges players to manage a community in a post-apocalyptic world experiencing a new ice age, has unveiled a new trailer. Showcasing stunning CGI and hinting at the same tension and tough decisions as the original game, the exciting news is that we now have a release year. Frostpunk 2 is set to launch in 2024.
Announced for PC, with releases planned on Steam, GOG, and the Epic Games Store, we still don’t have a more specific date than the vague 2024. However, what’s certain is that Frostpunk 2 will deliver more campaigns, more challenging situations, and once again force us to make morally difficult decisions. We’ll be faced with choices where we must decide between the death and suffering of dozens or hundreds of people in order to ensure the survival of our city for just one more day.
Some of the links added in the article are part of affiliate campaigns and may represent benefits for Softonic.
|
english
|
Ahead of coronavirus lockdown 5. 0, a team of researchers at Jamia Millia Islamia has developed a possible drug for the treatment of Covid-19.
By India Today Web Desk: Coronavirus lockdown 5. 0 might just happen soon. The entire world is facing a huge problem due to the novel coronavirus disease and it needs immediate effective treatment using available drugs in the market, called drug repurposing. It is very efficient to apply computer-aided drug design techniques to quickly identify promising drug repurposing candidates, especially after the release of detailed 3D structures of key viral proteins.
Dr Imtiyaz Hassan’s laboratory at the Centre for Interdisciplinary Research in Basic Sciences (CIRBSc), Jamia Millia Islamia (JMI) took advantage of a recently released crystal structure of SARS-CoV-2 main protease, to screen FDA approved drugs, as a possible therapeutic option.
After extensive research, Dr. Hassan and his team identified Glecaprevir and Maraviroc as the best inhibitors SARS-CoV-2 main protease, which can be used as a possible therapeutic agent to address Covid-19 patients.
Glecaprevir is an antiviral drug used in the treatment of Hepatitis-C virus-infected patients and Maraviroc is used to prevent HIV1 infection.
The repurposing of approved drugs provided an alternative approach to rapidly identify potential leads to develop effective and safe drugs against emerging Covid-19.
Although both drugs are clinically safe, even then some clinical trials should be conducted for their further use in the clinical management of severe Covid-19 patients being treated in hospitals.
Dr. Hassan quoted this work is a great effort of his students Dr. Anas Shamsi, Taj Mohammad, and Saleha Anwar who worked day-night even in the lockdown situation.
The present work is well recognized by the Editor of Bioscience Reports which is a home for sound scientific research in all areas of cell biology and molecular life sciences. It's a matter of pride and great satisfaction that the editor has selected figures of his paper as a Cover Page in the forthcoming issue of the Journal.
The full paper is available at (DOI: https://doi. org/10. 1042/BSR20201256).
Dr. Hassan's lab is running several research projects related to the design and development of anticancer molecules. But, considering the current need they put all their efforts as Corona worrier to discover new drugs to fight Covid-19 from the last three months. He also said that the methods of design and development of molecules for both are similar.
Dr. Hassan has also submitted three research proposals related to the drug design and development against novel coronavirus to Indian funding agencies.
So far Dr. Hassan has submitted six different papers related to SARS-CoV-2 genome, structure, evolution, pathogenesis, diagnosis and therapies to leading international journals for publication.
Dr. Imtiyaz Hassan is a decorated scientist having unique distinction of being a Fellow of Royal Society of Biology, U. K. (FRSB) as well as Fellow of Royal Society of Chemistry, U. K. (FRSC), has vast experience in the area of structure-based drug design and discovery.
|
english
|
<filename>links.py
import re
import base64
from Crypto.Cipher import AES
from Crypto.Protocol.KDF import PBKDF2
from Crypto.Hash import SHA256
import binascii
class Link(object):
def __init__(self, link, quality, rsk=None):
self.link = link
self.quality = quality
self.rsk = rsk
def is_valid(self):
regex = re.compile(
r'^(?:http|ftp)s?://' # http:// or https://
r'(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?)|' # domain...
r'localhost|' # localhost...
r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})' # ...or ip
r'(?::\d+)?' # optional port
r'(?:/?|[/?]\S+)$', re.IGNORECASE)
return re.match(regex, self.link)
def is_encoded(self):
raise NotImplementedError()
def decode(self):
raise NotImplementedError()
def __repr__(self):
return '<quality : {quality}, link : {link}>'.format(quality=self.quality, link=self.link)
class PlainLink(Link):
def is_encoded(self):
return False
def decode(self):
return self.link
class Base64Link(Link):
def is_encoded(self):
return True
def decode(self):
try:
decoded = base64.b64decode(self.link)
except TypeError:
return None
self.link = decoded
if not self.is_valid():
return None
if decoded is None:
return None
return PlainLink(decoded, self.quality)
class AESLink(Link):
def is_encoded(self):
return True
def decode(self):
a = "a5e8d2e9c1721ae0e84ad660c472c1f3"
#Hash rsk key to get decryption key
sha = SHA256.new()
sha.update(self.rsk)
encKey = sha.digest()
AES_KEY = AES.new(encKey, AES.MODE_CBC, a.decode('hex'))
val = AES_KEY.decrypt(base64.b64decode(self.link))
unpad = lambda s: s[:-ord(s[len(s) - 1:])]
val = unpad(val)
self.link = val
if self.is_valid():
return PlainLink(self.link, self.quality)
else:
return None
def unpad(self, text, k=16):
'''
Remove the PKCS#7 padding from a text string
Made by https://gist.github.com/chrix2
'''
nl = len(text)
val = int(binascii.hexlify(text[-1]), 16)
if val > k:
raise ValueError('Input is not padded or padding is corrupt')
l = nl - val
return text[:l]
def ensure_unicode(self, v):
if isinstance(v, str):
v = v.decode('utf8')
return unicode(v)
|
python
|
import {Injectable} from '@angular/core';
import {
HttpRequest,
HttpHandler,
HttpEvent,
HttpInterceptor,
} from '@angular/common/http';
import {Observable} from 'rxjs';
import {tap} from 'rxjs/operators';
import {Router} from '@angular/router';
import {MatSnackBar} from '@angular/material/snack-bar';
@Injectable()
export class GlobalInterceptor implements HttpInterceptor {
constructor(
private router: Router,
private _snackbar: MatSnackBar
) {
}
intercept(request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {
const newHeader = request.headers.append('Authorization', `${localStorage.getItem('token')}`);
const newRequest = request.clone({headers: newHeader});
return next.handle(newRequest).pipe(
tap(
// Succeeds when there is a response; ignore other events
event => {
console.log('Receive Response')
},
// Operation failed; error is an HttpErrorResponse
error => {
if (error.status === 401) {
this.router.navigate(['login']);
localStorage.removeItem('token');
}
if (error.error) {
this._snackbar.open(error?.error?.status?.message, 'Close', {
duration: 2000
})
}
}
)
);
}
}
|
typescript
|
<gh_stars>1-10
package io.github.lama06.lamamod.client.events;
import io.github.lama06.lamamod.common.util.ChatMessage;
import io.github.lama06.lamamod.common.events.Event;
import io.github.lama06.lamamod.common.events.EventResult;
public interface MessageSentCallback {
Event<MessageSentCallback> BEFORE_SENT = new Event<>((listeners) -> (msg) -> {
for (MessageSentCallback listener : listeners) {
EventResult result = listener.onChatMessage(msg);
if (result == EventResult.CANCEL) {
return result;
}
}
return EventResult.PASS;
});
EventResult onChatMessage(ChatMessage msg);
}
|
java
|
<filename>index/p/pressure-cooker-macaroni-and-cheese.json<gh_stars>10-100
{
"directions": [
"Place chicken broth, rotini, water, heavy cream, mild Cheddar cheese, sharp Cheddar cheese, extra-sharp Cheddar cheese, cream cheese, butter, Parmesan cheese, yellow mustard, salt, and black pepper in a pressure cooker. Seal and bring to high pressure according to manufacturer's instructions. Once full pressure is reached, cook for 7 minutes.",
"Release pressure using quick-release method according to manufacturer's instructions."
],
"image": "https://imagesvc.meredithcorp.io/v3/mm/image?q=85&c=sc&poi=face&w=2787&h=1459&url=https%3A%2F%2Fimages.media-allrecipes.com%2Fuserphotos%2F3327791.jpg",
"ingredients": [
"3 cups chicken broth",
"1 pound rotini pasta",
"2 cups water",
"8 fluid ounces heavy whipping cream",
"1 cup shredded mild Cheddar cheese",
"1 cup shredded sharp Cheddar cheese",
"1 cup shredded extra-sharp Cheddar cheese",
"\u00bd (8 ounce) package cream cheese",
"3 tablespoons butter",
"1 tablespoon grated Parmesan cheese",
"1 teaspoon yellow mustard",
"salt and ground black pepper to taste"
],
"language": "en-US",
"source": "allrecipes.com",
"tags": [],
"title": "Pressure Cooker Macaroni and Cheese",
"url": "http://allrecipes.com/recipe/246122/pressure-cooker-macaroni-and-cheese/"
}
|
json
|
<gh_stars>1-10
package com.tony;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
/**
* @author jiangwenjie 2021/2/24
*/
@RunWith(JUnit4.class)
public class UnitTest {
}
|
java
|
TechRadar Gaming is reporting live from Gamescom 2023 on the latest and greatest developments in gaming and hardware.
Speaking directly to the devs of upcoming craft-'em-up survival game Nightingale, TRG can confirm that the game will feature an Arachnophobia Mode, removing all spiders from the game.
Nightingale is set in a Victorian-inspired alternate future with up to six players at a time jumping from fantasy realm to fantasy realm battling beasties and gathering loot.
There's no word on whether these spiders will also be Victorian-themed, rocking jaunty little bonnets, petticoats, or corsets as they try to devour you. It doesn't matter though, because during a press demo, it was confirmed to TRG that Inflexion Games will merely allow you to not perceive them.
This feature, the developers explain, is one of the top-requested features that came from community feedback - however, it wasn't revealed how exactly it would be implemented or appear in the game.
As a reminder of more about the game, check out the new trailer during this week's Gamescom Opening Night Live 2023 event below.
Nightingale is an open-world survival and crafting game that will immerse players in those aforementioned Victorian-themed mysterious environments in a land called Fae. Here, players will journey to “the last known bastion of humanity” - the city of Nightingale. Playing as a Realmwalker, players will have to navigate arcane portals spread across a land full of mystery, otherworldly horrors, and weird and wonderful beasts.
The game is also coming to early access in a matter of months as spelled out by Aaryn Flynn, CEO of developer Inflexion Games: “After years of dedicated work from the team, we are thrilled to announce that Nightingale will enter early access on February 22, 2024", he said. Continuing to take in community feedback as mentioned above, and mirroring the success of other games to have gone into early access for periods of time, no less than Baldur's Gate 3, this confirms the importance of the game's community and the information it provides to the devs, and seems pivotal in Nightingale's journey to its full release.
If you're looking for more games that share themes with Nightingale, then check out our guides to the best open-world PC games and best survival games.
Get the hottest deals available in your inbox plus news, reviews, opinion, analysis, deals and more from the TechRadar team.
Jake Tucker is the editor in chief of TechRadar Gaming and has worked at sites like NME, MCV, Trusted Reviews and many more. He collects vinyl, likes first-person shooters and turn-based tactics titles, but hates writing bios. Jake currently lives in London, and is bouncing around the city trying to eat at all of the nice restaurants.
|
english
|
/*
Q Light Controller
inputprofileeditor.cpp
Copyright (C) <NAME>
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.txt
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#include <QTreeWidgetItem>
#include <QTextBrowser>
#include <QTreeWidget>
#include <QToolButton>
#include <QMessageBox>
#include <QTabWidget>
#include <QSettings>
#include <QCheckBox>
#include <QDialog>
#include <QTimer>
#include <QDebug>
#include <QFile>
#include <QList>
#include <QDir>
#include "qlcinputprofile.h"
#include "qlcchannel.h"
#include "inputchanneleditor.h"
#include "inputprofileeditor.h"
#include "inputoutputmap.h"
#include "apputil.h"
#define SETTINGS_GEOMETRY "inputprofileeditor/geometry"
#define KColumnNumber 0
#define KColumnName 1
#define KColumnType 2
#define KColumnValues 3
/****************************************************************************
* Initialization
****************************************************************************/
InputProfileEditor::InputProfileEditor(QWidget* parent, QLCInputProfile* profile,
InputOutputMap *ioMap)
: QDialog(parent)
, m_ioMap(ioMap)
, m_wizardActive(false)
, m_latestItem(NULL)
{
Q_ASSERT(ioMap != NULL);
setupUi(this);
m_midiGroupSettings->setVisible(false);
connect(m_typeCombo, SIGNAL(currentIndexChanged(int)),
this, SLOT(slotTypeComboChanged(int)));
/* Connect the buttons to slots */
connect(m_addButton, SIGNAL(clicked()),
this, SLOT(slotAddClicked()));
connect(m_removeButton, SIGNAL(clicked()),
this, SLOT(slotRemoveClicked()));
connect(m_editButton, SIGNAL(clicked()),
this, SLOT(slotEditClicked()));
connect(m_wizardButton, SIGNAL(clicked(bool)),
this, SLOT(slotWizardClicked(bool)));
connect(m_tree, SIGNAL(itemClicked(QTreeWidgetItem*,int)),
this, SLOT(slotItemClicked(QTreeWidgetItem*,int)));
connect(m_tree, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)),
this, SLOT(slotEditClicked()));
connect(m_movementCombo, SIGNAL(currentIndexChanged(int)),
this, SLOT(slotMovementComboChanged(int)));
connect(m_sensitivitySpin, SIGNAL(valueChanged(int)),
this, SLOT(slotSensitivitySpinChanged(int)));
connect(m_extraPressCheck, SIGNAL(toggled(bool)),
this, SLOT(slotExtraPressChecked(bool)));
connect(m_lowerSpin, SIGNAL(valueChanged(int)),
this, SLOT(slotLowerValueSpinChanged(int)));
connect(m_upperSpin, SIGNAL(valueChanged(int)),
this, SLOT(slotUpperValueSpinChanged(int)));
/* Listen to input data */
connect(m_ioMap, SIGNAL(inputValueChanged(quint32, quint32, uchar, const QString&)),
this, SLOT(slotInputValueChanged(quint32, quint32, uchar, const QString&)));
if (profile == NULL)
{
m_profile = new QLCInputProfile();
}
else
{
m_profile = new QLCInputProfile(*profile);
if ((QFile::permissions(m_profile->path()) &
QFile::WriteUser) == 0)
{
QMessageBox::warning(this, tr("File not writable"),
tr("You do not have permission to write to "
"the file %1. You might not be able to "
"save your modifications to the profile.")
.arg(QDir::toNativeSeparators(
m_profile->path())));
}
}
QList<QLCInputProfile::Type> types = QLCInputProfile::types();
for (int i = 0; i < types.size(); ++i)
{
const QLCInputProfile::Type type = types.at(i);
m_typeCombo->addItem(QLCInputProfile::typeToString(type), type);
if (m_profile->type() == type)
{
m_typeCombo->setCurrentIndex(i);
if (type == QLCInputProfile::Midi)
{
m_midiGroupSettings->setVisible(true);
m_noteOffCheck->setChecked(m_profile->midiSendNoteOff());
}
}
}
/* Profile manufacturer & model */
m_manufacturerEdit->setText(m_profile->manufacturer());
m_modelEdit->setText(m_profile->model());
m_behaviourBox->hide();
m_feedbackGroup->hide();
/* Fill up the tree with profile's channels */
fillTree();
/* Timer that clears the input data icon after a while */
m_timer = new QTimer(this);
m_timer->setSingleShot(true);
connect(m_timer, SIGNAL(timeout()), this, SLOT(slotTimerTimeout()));
QSettings settings;
QVariant var = settings.value(SETTINGS_GEOMETRY);
if (var.isValid() == true)
restoreGeometry(var.toByteArray());
AppUtil::ensureWidgetIsVisible(this);
}
InputProfileEditor::~InputProfileEditor()
{
QSettings settings;
settings.setValue(SETTINGS_GEOMETRY, saveGeometry());
delete m_profile;
}
void InputProfileEditor::fillTree()
{
m_tree->clear();
QMapIterator <quint32,QLCInputChannel*> it(m_profile->channels());
while (it.hasNext() == true)
{
it.next();
updateChannelItem(new QTreeWidgetItem(m_tree), it.value());
}
m_tree->header()->resizeSections(QHeaderView::ResizeToContents);
}
void InputProfileEditor::updateChannelItem(QTreeWidgetItem* item,
QLCInputChannel* ch)
{
quint32 num;
Q_ASSERT(item != NULL);
Q_ASSERT(ch != NULL);
num = m_profile->channelNumber(ch);
item->setText(KColumnNumber, QString("%1").arg(num + 1, 4, 10, QChar('0')));
item->setText(KColumnName, ch->name());
item->setText(KColumnType, QLCInputChannel::typeToString(ch->type()));
item->setIcon(KColumnType, ch->icon());
}
void InputProfileEditor::setOptionsVisibility(QLCInputChannel::Type type)
{
bool showBox = true;
bool showMovement = false;
bool showSensitivity = false;
bool showButtonOpts = false;
if (type == QLCInputChannel::Slider || type == QLCInputChannel::Knob)
{
showMovement = true;
showSensitivity = true;
m_sensitivitySpin->setRange(10, 100);
}
else if (type == QLCInputChannel::Encoder)
{
showSensitivity = true;
m_sensitivitySpin->setRange(1, 20);
}
else if (type == QLCInputChannel::Button)
{
showButtonOpts = true;
}
else
showBox = false;
m_movementLabel->setVisible(showMovement);
m_movementCombo->setVisible(showMovement);
m_sensitivityLabel->setVisible(showSensitivity);
m_sensitivitySpin->setVisible(showSensitivity);
m_extraPressCheck->setVisible(showButtonOpts);
m_feedbackGroup->setVisible(showButtonOpts);
m_behaviourBox->setVisible(showBox);
}
void InputProfileEditor::slotTypeComboChanged(int)
{
if (currentProfileType() == QLCInputProfile::Midi)
m_midiGroupSettings->setVisible(true);
else
m_midiGroupSettings->setVisible(false);
}
/****************************************************************************
* OK & Cancel
****************************************************************************/
void InputProfileEditor::reject()
{
/* Don't allow closing the dialog in any way when the wizard is on */
if (m_buttonBox->isEnabled() == false)
return;
QDialog::reject();
}
void InputProfileEditor::accept()
{
/* Don't allow closing the dialog in any way when the wizard is on */
if (m_buttonBox->isEnabled() == false)
return;
m_profile->setManufacturer(m_manufacturerEdit->text());
m_profile->setModel(m_modelEdit->text());
m_profile->setType(currentProfileType());
if (currentProfileType() == QLCInputProfile::Midi)
m_profile->setMidiSendNoteOff(m_noteOffCheck->isChecked());
/* Check that we have at least the bare necessities to save the profile */
if (m_profile->manufacturer().isEmpty() == true ||
m_profile->model().isEmpty() == true)
{
QMessageBox::warning(this, tr("Missing information"),
tr("Manufacturer and/or model name is missing."));
}
else
{
QDialog::accept();
}
}
/****************************************************************************
* Editing
****************************************************************************/
QList<QLCInputChannel *> InputProfileEditor::selectedChannels()
{
QList<QLCInputChannel *> channels;
QListIterator <QTreeWidgetItem*>it(m_tree->selectedItems());
while (it.hasNext() == true)
{
QTreeWidgetItem *item = it.next();
Q_ASSERT(item != NULL);
quint32 chnum = item->text(KColumnNumber).toUInt() - 1;
QLCInputChannel *channel = m_profile->channel(chnum);
Q_ASSERT(channel != NULL);
channels.append(channel);
}
return channels;
}
void InputProfileEditor::slotAddClicked()
{
QLCInputChannel* channel = new QLCInputChannel();
InputChannelEditor ice(this, m_profile, channel, currentProfileType());
add:
if (ice.exec() == QDialog::Accepted)
{
channel->setType(ice.type());
channel->setName(ice.name());
if (m_profile->channel(ice.channel()) == NULL)
{
m_profile->insertChannel(ice.channel(), channel);
updateChannelItem(new QTreeWidgetItem(m_tree), channel);
}
else
{
QMessageBox::warning(this,
tr("Channel already exists"),
tr("Channel %1 already exists")
.arg(ice.channel() + 1));
goto add;
}
}
else
{
delete channel;
}
}
void InputProfileEditor::slotRemoveClicked()
{
QList <QTreeWidgetItem*> selected;
QTreeWidgetItem* next = NULL;
/* Ask for confirmation if we're deleting more than one channel */
selected = m_tree->selectedItems();
if (selected.count() > 1)
{
int r;
r = QMessageBox::question(this, tr("Delete channels"),
tr("Delete all %1 selected channels?")
.arg(selected.count()),
QMessageBox::Yes | QMessageBox::No);
if (r == QMessageBox::No)
return;
}
/* Remove all selected channels */
QMutableListIterator <QTreeWidgetItem*> it(selected);
while (it.hasNext() == true)
{
QTreeWidgetItem *item = it.next();
Q_ASSERT(item != NULL);
/* Remove & Delete the channel object */
quint32 chnum = item->text(KColumnNumber).toUInt() - 1;
m_profile->removeChannel(chnum);
/* Choose the closest item below or above the removed items
as the one that is selected after the removal */
next = m_tree->itemBelow(item);
if (next == NULL)
next = m_tree->itemAbove(item);
delete item;
}
m_tree->setCurrentItem(next);
}
void InputProfileEditor::slotEditClicked()
{
QLCInputChannel* channel;
quint32 chnum;
QTreeWidgetItem* item;
if (m_tree->selectedItems().count() == 1)
{
/* Just one item selected. Edit that. */
item = m_tree->currentItem();
if (item == NULL)
return;
/* Find the channel object associated to the selected item */
chnum = item->text(KColumnNumber).toUInt() - 1;
channel = m_profile->channel(chnum);
Q_ASSERT(channel != NULL);
/* Edit the channel and update its item if necessary */
InputChannelEditor ice(this, m_profile, channel, currentProfileType());
edit:
if (ice.exec() == QDialog::Accepted)
{
QLCInputChannel* another;
another = m_profile->channel(ice.channel());
if (another == NULL || another == channel)
{
if (ice.channel() != QLCChannel::invalid())
m_profile->remapChannel(channel, ice.channel());
if (ice.name().isEmpty() == false)
channel->setName(ice.name());
if (ice.type() != QLCInputChannel::NoType)
{
if (ice.type() != channel->type())
setOptionsVisibility(ice.type());
channel->setType(ice.type());
if (m_sensitivitySpin->isVisible())
m_sensitivitySpin->setValue(channel->movementSensitivity());
}
updateChannelItem(item, channel);
}
else
{
QMessageBox::warning(this,
tr("Channel already exists"),
tr("Channel %1 already exists")
.arg(ice.channel() + 1));
goto edit;
}
}
}
else if (m_tree->selectedItems().count() > 1)
{
/* Multiple channels selected. Apply changes to all of them */
InputChannelEditor ice(this, NULL, NULL, QLCInputProfile::Dmx);
if (ice.exec() == QDialog::Accepted)
{
QListIterator <QTreeWidgetItem*>
it(m_tree->selectedItems());
while (it.hasNext() == true)
{
item = it.next();
Q_ASSERT(item != NULL);
chnum = item->text(KColumnNumber).toUInt() - 1;
channel = m_profile->channel(chnum);
Q_ASSERT(channel != NULL);
/* Set only name and type and only if they
have been modified. */
if (ice.name().isEmpty() == false)
channel->setName(ice.name());
if (ice.type() != QLCInputChannel::NoType)
channel->setType(ice.type());
updateChannelItem(item, channel);
}
}
}
}
void InputProfileEditor::slotWizardClicked(bool checked)
{
if (checked == true)
{
QMessageBox::information(this, tr("Channel wizard activated"),
tr("You have enabled the input channel wizard. After "
"clicking OK, wiggle your mapped input profile's "
"controls. They should appear into the list. "
"Click the wizard button again to stop channel "
"auto-detection.\n\nNote that the wizard cannot "
"tell the difference between a knob and a slider "
"so you will have to do the change manually."));
m_wizardActive = true;
}
else
{
m_wizardActive = false;
}
m_buttonBox->setEnabled(!checked);
m_tab->setTabEnabled(0, !checked);
}
void InputProfileEditor::slotItemClicked(QTreeWidgetItem *item, int col)
{
Q_UNUSED(col)
quint32 chNum = item->text(KColumnNumber).toUInt() - 1;
QLCInputChannel *ich = m_profile->channel(chNum);
if (ich != NULL)
{
setOptionsVisibility(ich->type());
if (ich->type() == QLCInputChannel::Slider || ich->type() == QLCInputChannel::Knob)
{
if (ich->movementType() == QLCInputChannel::Absolute)
{
m_movementCombo->setCurrentIndex(0);
m_sensitivitySpin->setEnabled(false);
}
else
{
m_movementCombo->setCurrentIndex(1);
m_sensitivitySpin->setValue(ich->movementSensitivity());
m_sensitivitySpin->setEnabled(true);
}
}
else if (ich->type() == QLCInputChannel::Encoder)
{
m_sensitivitySpin->setValue(ich->movementSensitivity());
m_sensitivitySpin->setEnabled(true);
}
else if (ich->type() == QLCInputChannel::Button)
{
m_extraPressCheck->setChecked(ich->sendExtraPress());
m_lowerSpin->blockSignals(true);
m_upperSpin->blockSignals(true);
m_lowerSpin->setValue(ich->lowerValue());
m_upperSpin->setValue(ich->upperValue());
m_lowerSpin->blockSignals(false);
m_upperSpin->blockSignals(false);
}
}
else
setOptionsVisibility(QLCInputChannel::NoType);
}
void InputProfileEditor::slotMovementComboChanged(int index)
{
if (index == 1)
m_sensitivitySpin->setEnabled(true);
else
m_sensitivitySpin->setEnabled(false);
foreach(QLCInputChannel *channel, selectedChannels())
{
if (channel->type() == QLCInputChannel::Slider ||
channel->type() == QLCInputChannel::Knob)
{
if (index == 1)
channel->setMovementType(QLCInputChannel::Relative);
else
channel->setMovementType(QLCInputChannel::Absolute);
}
}
}
void InputProfileEditor::slotSensitivitySpinChanged(int value)
{
foreach(QLCInputChannel *channel, selectedChannels())
{
if ((channel->type() == QLCInputChannel::Slider ||
channel->type() == QLCInputChannel::Knob) &&
channel->movementType() == QLCInputChannel::Relative)
channel->setMovementSensitivity(value);
else if (channel->type() == QLCInputChannel::Encoder)
channel->setMovementSensitivity(value);
}
}
void InputProfileEditor::slotExtraPressChecked(bool checked)
{
foreach(QLCInputChannel *channel, selectedChannels())
{
if(channel->type() == QLCInputChannel::Button)
channel->setSendExtraPress(checked);
}
}
void InputProfileEditor::slotLowerValueSpinChanged(int value)
{
foreach(QLCInputChannel *channel, selectedChannels())
{
if (channel->type() == QLCInputChannel::Button)
channel->setRange(uchar(value), uchar(m_upperSpin->value()));
}
}
void InputProfileEditor::slotUpperValueSpinChanged(int value)
{
foreach(QLCInputChannel *channel, selectedChannels())
{
if (channel->type() == QLCInputChannel::Button)
channel->setRange(uchar(m_lowerSpin->value()), uchar(value));
}
}
void InputProfileEditor::slotInputValueChanged(quint32 universe,
quint32 channel,
uchar value,
const QString& key)
{
QTreeWidgetItem* latestItem = NULL;
Q_UNUSED(universe);
/* Get a list of items that represent the given channel. Basically
the list should always contain just one item. */
QList <QTreeWidgetItem*> list;
if (channel == UINT_MAX && key.isEmpty() == false)
list = m_tree->findItems(key, Qt::MatchExactly, KColumnName);
else
list = m_tree->findItems(QString("%1").arg(channel + 1, 4, 10, QChar('0')), Qt::MatchExactly,
KColumnNumber);
if (list.size() != 0)
latestItem = list.first();
if (list.size() == 0 && m_wizardActive == true)
{
/* No channel items found. Create a new channel to the
profile and display it also in the tree widget */
QLCInputChannel* ch = new QLCInputChannel();
if(key.isEmpty())
ch->setName(tr("Button %1").arg(channel + 1));
else
ch->setName(key);
ch->setType(QLCInputChannel::Button);
m_profile->insertChannel(channel, ch);
latestItem = new QTreeWidgetItem(m_tree);
updateChannelItem(latestItem, ch);
}
else if (m_wizardActive == true)
{
/* Existing channel & item found. Modify their contents. */
latestItem = list.first();
QVariant var = latestItem->data(KColumnValues, Qt::UserRole);
QStringList values(var.toStringList());
if (values.size() > 3)
{
/* No need to collect any more values, since this channel has
been judged to be a slider when count == 3 (see below). */
}
else if (values.contains(QString("%1").arg(value)) == false)
{
values << QString("%1").arg(value);
values.sort();
latestItem->setData(KColumnValues, Qt::UserRole, values);
}
/* Change the channel type only the one time when its value
count goes over 2. I.e. when a channel can have more than
two distinct values, it can no longer be a button. */
if (values.size() == 3)
{
QLCInputChannel* ch = m_profile->channel(channel);
Q_ASSERT(ch != NULL);
if (ch->type() == QLCInputChannel::Button)
{
ch->setType(QLCInputChannel::Slider);
if(key.isEmpty())
ch->setName(tr("Slider %1").arg(channel + 1));
else
ch->setName(key);
updateChannelItem(latestItem, ch);
}
}
}
if (latestItem != NULL)
{
if (m_latestItem != NULL)
m_latestItem->setIcon(KColumnNumber, QIcon());
m_latestItem = latestItem;
m_latestItem->setIcon(KColumnNumber, QIcon(":/input.png"));
m_tree->scrollToItem(m_latestItem);
m_timer->start(250);
}
}
void InputProfileEditor::slotTimerTimeout()
{
if (m_latestItem != NULL)
m_latestItem->setIcon(KColumnNumber, QIcon());
m_latestItem = NULL;
}
/****************************************************************************
* Profile
****************************************************************************/
const QLCInputProfile* InputProfileEditor::profile() const
{
return m_profile;
}
QLCInputProfile::Type InputProfileEditor::currentProfileType() const
{
return static_cast<QLCInputProfile::Type>(m_typeCombo->itemData(m_typeCombo->currentIndex()).toInt());
}
|
cpp
|
With their eyes firmly on getting the World Cup combination right, a spirited India will look to continue their dominance over Australia, this time at home, when they play the first Twenty20 International game. The seven-match tour comprising two T20Is and five ODIs will be India's last international assignment before the ICC World Cup which starts on May 30 in England and Wales. India won a historic Test and ODI series Down Under last month and Virat Kohli - back after a break to lead the side - and coach Ravi Shastri will look to get a few places sealed before the mega event. The likes of Rishabh Pant and all-rounder Vijay Shankar are aiming to make the final cut to the World Cup. While Pant edged out Dinesh Karthik in the ODI side, Shankar proved his mettle in New Zealand with some good displays with the bat. With Hardik Pandya out injured, it will be a great opportunity for Shankar to strenghthen his case while Pant will also look to make the most of the chances he gets. Coming to India's bowling department, pace spearhead Jasprit Bumrah is back after a break. Bumrah is two shy of his personal tally of 50 wickets in T20I cricket, an achievement only in possession of Ravichandran Ashwin. All eyes will be on rookie leg-break bowler Mayank Markande who could make his debut in international cricket. But India could go in with the tested pair of Yuzvendra Chahal and Krunal Pandya, who have done reasonably well for the home team in recent times. The tourists led by Aaron Finch may not have played T20Is since their last series against India three months back, but they are fresh from their extended Big Bash League with six players, including the skipper, featuring in the all-Melbourne final on February 17.
|
english
|
<filename>18_minimum_path_sum.cpp<gh_stars>0
class Solution {
public:
int minPathSum(vector<vector<int>>& grid) {
int n=grid.size();
int m=grid[0].size();
for(int i=n-1;i>=0;i--){
for(int j=m-1;j>=0;j--){
if(j<m-1 && i<n-1) grid[i][j]+=min(grid[i][j+1], grid[i+1][j]);
else if(j<m-1) grid[i][j]+=grid[i][j+1];
else if(i<n-1) grid[i][j]+=grid[i+1][j];
}
}
return grid[0][0];
}
};
|
cpp
|
<reponame>labs12-mom-caller/Front-End
import Aside from './Aside';
import Button from './Button';
import H3 from './H3';
import Img from './Img';
import P from './P';
import User from './User';
import UserInfo from './UserInfo';
export { Aside, Button, H3, Img, P, User, UserInfo };
|
javascript
|
{
"id": "redwood-aprica-antlers",
"labels": [
"Material"
],
"data": {
"name": "Redwood Aprica Antlers"
}
}
|
json
|
<filename>package.json
{
"name": "corsen",
"version": "1.0.3",
"description": "A universal Cross-Origin Resource Sharing(CORS) middleware",
"main": "src/index.js",
"files": [
"src/index.js"
],
"scripts": {
"test": "NODE_ENV=test mocha --check-leaks -R spec -t 5000 test/*.test.js",
"test-cov": "NODE_ENV=test istanbul cover _mocha -- --check-leaks -t 5000 test/*.test.js",
"ci": "npm run lint && npm run test-cov",
"lint": "standard --fix src/*.js test/*.test.js | snazzy",
"autod": "autod -w --prefix '^'"
},
"dependencies": {
"vary": "^1.1.2"
},
"devDependencies": {
"autod": "*",
"injectar": "^1.2.1",
"istanbul": "*",
"mocha": "3",
"snazzy": "^8.0.0",
"standard": "^14.3.1"
},
"homepage": "https://github.com/fralonra/corsen",
"repository": {
"type": "git",
"url": "git://github.com/fralonra/corsen.git"
},
"bugs": {
"url": "https://github.com/fralonra/corsen/issues"
},
"keywords": [
"cors",
"Cross-Origin Resource Sharing"
],
"engines": {
"node": ">= 8.0.0"
},
"standard": {
"env": [
"mocha"
]
},
"author": "zoron (https://github.com/fralonra/)",
"license": "MIT"
}
|
json
|
<reponame>marktreble/f3f-timer<filename>f3Ftimer/src/main/assets/public_html/api/getRaceData.java
[{
"time":1,
"live":"0",
"race_name":"North Yorkshire Open 2014",
"race_status":"1",
"ftd":{
"pilot":1,
"time":"32.57"
},
"round_winners":[1,3,5,1],
"pilots":["<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>"],
"times":[
["32.57","40.18","35.22","36.01","33.30","35.18","38.28"],
["35.19","38.28","33.19","37.33","38.24","35.18","38.28"],
["37.22","35.02","35.22","36.12","33.01","35.18","38.28"],
["34.12","37.04","36.43","36.43","42.20","35.18","38.28"],
["31.72","33.04","32.99","48.33","36.99","0",""]
],
"penalties":[
["0","0","300","0","0","0","0"],
["0","0","0","0","0","0","0"],
["0","0","0","0","0","0","0"],
["0","0","0","0","0","0","0"],
["0","100","0","0","0","100","0"]
]
}]
|
java
|
{
"componentChunkName": "component---node-modules-gatsby-theme-buzzing-src-gatsby-theme-blog-core-templates-post-query-js",
"path": "/ja/reddit/r/SideProject/comments/pjtfxx/txtpaper_api_and_web_app_for_converting_web_page/",
"result": {"data":{"site":{"siteMetadata":{"title":"业余项目分享交流","author":"Buzzing.cc","description":"用中文浏览reddit业余项目讨论","keywords":["buzzing","业余项目","程序员"],"siteUrl":"https://sideproject.buzzing.cc","telegram":"@buzzingcc","iconUrl":"https://sideproject.buzzing.cc/avatar.png","defaultSocialImageUrl":null,"social":[{"name":"SideProject","url":"https://www.reddit.com/r/SideProject/","external":true},{"name":"Buzzing","url":"https://www.buzzing.cc/","external":true}],"menuLinks":[],"disqus":null,"utterances":null,"localize":[{"title":"Buzzing on Side Project","description":"See what's buzzing on Side Project in your native language","keywords":["buzzing","Side Project"],"locale":"en","social":{"name":null,"url":null,"external":null},"menuLinks":[{"name":"Weekly Selection","url":"/issues","external":null}]},{"title":"業餘項目分享交流","description":"用中文瀏覽reddit業餘項目討論","keywords":["buzzing","業餘項目","程序員"],"locale":"zh-Hant","social":null,"menuLinks":[]},{"title":"サイドプロジェクト","description":"人気のサイドプロジェクトを日本語で閲覧","keywords":["buzzing","サイドプロジェクト"],"locale":"ja","social":null,"menuLinks":[]}]}},"blogPost":{"id":"RedditPost-pjtfxx","excerpt":"","body":"","slug":"/reddit/r/SideProject/comments/pjtfxx/txtpaper_api_and_web_app_for_converting_web_page/","title":"txtpaper - API and web app for converting web page article text into ePub, Kindle and PDF files","tags":["SideProject","reddit"],"date":"September 07, 2021","dateISO":"2021-09-07T20:54:11.000Z","datetime":"2021-09-07 20:54","image":null,"imageAlt":null,"socialImage":null,"__typename":"SocialMediaPost","thirdPartyId":"pjtfxx","provider":"Reddit","url":"https://www.reddit.com/r/SideProject/comments/pjtfxx/txtpaper_api_and_web_app_for_converting_web_page/","originalUrl":"https://www.reddit.com/r/SideProject/comments/pjtfxx/txtpaper_api_and_web_app_for_converting_web_page/","imageRemote":null,"video":null,"channel":"SideProject","channelUrl":"https://www.reddit.com/r/SideProject","author":"afellowhumanperson","authorUrl":"https://www.reddit.com/user/afellowhumanperson","authorImage":null,"authorImageRemote":null,"authorSlug":"afellowhumanperson","score":5,"views":null,"sharedCount":null,"likeCount":null,"sharedContent":null,"parent":{"localize":[{"title":"txtpaper - ウェブページの記事テキストをePub、Kindle、PDFファイルに変換するためのAPIとウェブアプリ。","the_new_excerpt":null,"locale":"ja"},{"title":"txtpaper - 将网页文章文本转换为ePub、Kindle和PDF文件的API和Web应用程序","the_new_excerpt":null,"locale":"zh"},{"title":"txtpaper - 將網頁文章文本轉換爲ePub、Kindle和PDF文件的API和Web應用程序","the_new_excerpt":null,"locale":"zh-Hant"}]}},"previous":{"id":"RedditPost-pjms4p","excerpt":"","slug":"/reddit/r/SideProject/comments/pjms4p/yourtrail_simple_dashboard_to_make_the_most_of/","title":"YourTrail - Simple dashboard to make the most of your day","date":"September 07, 2021","__typename":"SocialMediaPost","provider":"Reddit","parent":{"localize":[{"title":"YourTrail - 一日を有効に使うためのシンプルなダッシュボード","the_new_excerpt":null,"locale":"ja"},{"title":"YourTrail - 简单的仪表板,让你的每一天都得到充分的利用","the_new_excerpt":null,"locale":"zh"},{"title":"YourTrail - 簡單的儀表板,讓你的每一天都得到充分的利用","the_new_excerpt":null,"locale":"zh-Hant"}]}},"next":{"id":"RedditPost-pjpouz","excerpt":"","slug":"/reddit/r/SideProject/comments/pjpouz/free_and_open_api_to_access_historical_foreign/","title":"Free and open API to access historical foreign exchange rates in USD based on statistical data provided by the Bank for International Settlements","__typename":"SocialMediaPost","date":"September 07, 2021","provider":"Reddit","parent":{"localize":[{"title":"国際決済銀行(Bank for International Settlements)が提供する統計データに基づく、米ドル建ての外国為替レートの履歴にアクセスするための無料かつオープンなAPIです。","the_new_excerpt":null,"locale":"ja"},{"title":"根据国际清算银行提供的统计数据,免费开放的API可以访问以美元计的历史外汇汇率。","the_new_excerpt":null,"locale":"zh"},{"title":"根據國際清算銀行提供的統計數據,免費開放的API可以訪問以美元計的歷史外匯匯率。","the_new_excerpt":null,"locale":"zh-Hant"}]}}},"pageContext":{"basePath":"/","pageType":"detail","id":"RedditPost-pjtfxx","previousId":"RedditPost-pjms4p","nextId":"RedditPost-pjpouz","maxWidth":1024,"siteMetadata":null,"locale":"ja","hrefLang":"ja-JA","originalPath":"/reddit/r/SideProject/comments/pjtfxx/txtpaper_api_and_web_app_for_converting_web_page/","dateFormat":"YYYY-MM-DD"}},
"staticQueryHashes": ["1239077767","2744905544","3280999885"]}
|
json
|
A private member bill to regulate the appointment of judges through the National Judicial Commission was on Friday introduced in Rajya Sabha by CPI(M)’s Bikash Ranjan Bhattacharyya but was opposed by AAP MP Raghav Chadha.
The National Judicial Commission Bill, 2022 was introduced after the majority of voice votes were in its favour.
Bhattacharyya moved the bill that aims to regulate the procedure to be followed by the National Judicial Commission for recommending people for appointment as the Chief Justice of India and other judges of the Supreme Court and Chief Justices and other judges of High Courts.
The bill, if approved, will also regulate their transfers and to lay down judicial standards and provide for accountability of judges, and establish credible and expedient mechanism for investigating into individual complaints for misbehaviour or incapacity of a judge of the apex court or of a high court and to regulate the procedure for such investigation.
It also proposes for the presentation of an address by parliament to the president in relation to proceeding for removal of a judge and for matters connected therewith or incidental thereto.
Aam Aadmi Party (AAP) member Chadha opposed the bill, saying the concept of NJAC has come under consideration of the Supreme Court three times in 1993, 1998 and 2016.
“All three times, while giving importance to independence of judiciary, the Supreme Court dismissed the framework of the NJAC. I have stood to oppose the NJAC which my honourable colleague has introduced,” Chadha said.
“We are attempting to do an constitutional impossibility. I think a system of judges appointment, collegium system is working very well.
“There can be scope of improvement in it which can be done through conversation with judiciary. We should not give any handle to central government so that they enter in appointment of judges,” Chadha said.
|
english
|
My wife works with a team of researchers @UofStThomasMN (including @vivaldojenkins) doing work that documents and maps #StreetArt.
Have you seen examples of #COVID19-related #StreetArt where you live?
If so, you can contribute to a crowd-sourced data collection project that can help document the emergence of urban art that speaks to and about the #Pandemic.
If so, you can contribute to a crowd-sourced data collection project that can help document the emergence of urban art that speaks to and about the #Pandemic.
Please send images of #COVID19 street art (e.g., #murals, #graffiti, #stickers) along with this basic information (street address, nearby landmark, coordinates, date of image) to [email protected].
Additional information (artists, specific people depicted, stories told through art, etc.) about the #COVID19 #StreetArt that you document and can send along are very welcome!
|
english
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["profile-lists-profile-lists-module"], {
/***/
"./node_modules/raw-loader/dist/cjs.js!./src/app/tabs/profile/profile-lists/profile-lists.page.html":
/*!**********************************************************************************************************!*\
!*** ./node_modules/raw-loader/dist/cjs.js!./src/app/tabs/profile/profile-lists/profile-lists.page.html ***!
\**********************************************************************************************************/
/*! exports provided: default */
/***/
function node_modulesRawLoaderDistCjsJsSrcAppTabsProfileProfileListsProfileListsPageHtml(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */
__webpack_exports__["default"] = "<ion-header>\n <ion-toolbar color=\"primary\">\n <ion-title>Profile-lists</ion-title>\n </ion-toolbar>\n</ion-header>\n\n<ion-content>\n <ion-card *ngFor=\"let user of users\">\n <ion-card-header>\n <ion-card-title [innerHTML]=\"user.username\"></ion-card-title>\n <ion-card-subtitle>{{ user.nom }}</ion-card-subtitle>\n <ion-label>\n latitude : {{ user.prenom }}\n </ion-label>\n </ion-card-header>\n <ion-card-content>\n <img [src]=\"user.photo\" *ngIf=\"user.photo\" class=\"post-img\">\n <!-- <div [innerHTML]=\"stone.excerpt.rendered\"></div> -->\n <!-- <ion-button expand=\"full\" fill=\"clear\" [routerLink]=\"['/', 'tabs','stone','stones', user.id]\" text-right>Read\n More...</ion-button> -->\n </ion-card-content>\n </ion-card>\n</ion-content>";
/***/
},
/***/
"./src/app/tabs/profile/profile-lists/profile-lists-routing.module.ts":
/*!****************************************************************************!*\
!*** ./src/app/tabs/profile/profile-lists/profile-lists-routing.module.ts ***!
\****************************************************************************/
/*! exports provided: ProfileListsPageRoutingModule */
/***/
function srcAppTabsProfileProfileListsProfileListsRoutingModuleTs(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */
__webpack_require__.d(__webpack_exports__, "ProfileListsPageRoutingModule", function () {
return ProfileListsPageRoutingModule;
});
/* harmony import */
var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
/*! tslib */
"./node_modules/tslib/tslib.es6.js");
/* harmony import */
var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
/*! @angular/core */
"./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
/* harmony import */
var _angular_router__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
/*! @angular/router */
"./node_modules/@angular/router/__ivy_ngcc__/fesm2015/router.js");
/* harmony import */
var _profile_lists_page__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
/*! ./profile-lists.page */
"./src/app/tabs/profile/profile-lists/profile-lists.page.ts");
var routes = [{
path: '',
component: _profile_lists_page__WEBPACK_IMPORTED_MODULE_3__["ProfileListsPage"]
}];
var ProfileListsPageRoutingModule = function ProfileListsPageRoutingModule() {
_classCallCheck(this, ProfileListsPageRoutingModule);
};
ProfileListsPageRoutingModule = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"])({
imports: [_angular_router__WEBPACK_IMPORTED_MODULE_2__["RouterModule"].forChild(routes)],
exports: [_angular_router__WEBPACK_IMPORTED_MODULE_2__["RouterModule"]]
})], ProfileListsPageRoutingModule);
/***/
},
/***/
"./src/app/tabs/profile/profile-lists/profile-lists.module.ts":
/*!********************************************************************!*\
!*** ./src/app/tabs/profile/profile-lists/profile-lists.module.ts ***!
\********************************************************************/
/*! exports provided: ProfileListsPageModule */
/***/
function srcAppTabsProfileProfileListsProfileListsModuleTs(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */
__webpack_require__.d(__webpack_exports__, "ProfileListsPageModule", function () {
return ProfileListsPageModule;
});
/* harmony import */
var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
/*! tslib */
"./node_modules/tslib/tslib.es6.js");
/* harmony import */
var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
/*! @angular/core */
"./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
/* harmony import */
var _angular_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
/*! @angular/common */
"./node_modules/@angular/common/__ivy_ngcc__/fesm2015/common.js");
/* harmony import */
var _angular_forms__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
/*! @angular/forms */
"./node_modules/@angular/forms/__ivy_ngcc__/fesm2015/forms.js");
/* harmony import */
var _ionic_angular__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(
/*! @ionic/angular */
"./node_modules/@ionic/angular/__ivy_ngcc__/fesm2015/ionic-angular.js");
/* harmony import */
var _profile_lists_routing_module__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(
/*! ./profile-lists-routing.module */
"./src/app/tabs/profile/profile-lists/profile-lists-routing.module.ts");
/* harmony import */
var _profile_lists_page__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(
/*! ./profile-lists.page */
"./src/app/tabs/profile/profile-lists/profile-lists.page.ts");
var ProfileListsPageModule = function ProfileListsPageModule() {
_classCallCheck(this, ProfileListsPageModule);
};
ProfileListsPageModule = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"])({
imports: [_angular_common__WEBPACK_IMPORTED_MODULE_2__["CommonModule"], _angular_forms__WEBPACK_IMPORTED_MODULE_3__["FormsModule"], _ionic_angular__WEBPACK_IMPORTED_MODULE_4__["IonicModule"], _profile_lists_routing_module__WEBPACK_IMPORTED_MODULE_5__["ProfileListsPageRoutingModule"]],
declarations: [_profile_lists_page__WEBPACK_IMPORTED_MODULE_6__["ProfileListsPage"]]
})], ProfileListsPageModule);
/***/
},
/***/
"./src/app/tabs/profile/profile-lists/profile-lists.page.scss":
/*!********************************************************************!*\
!*** ./src/app/tabs/profile/profile-lists/profile-lists.page.scss ***!
\********************************************************************/
/*! exports provided: default */
/***/
function srcAppTabsProfileProfileListsProfileListsPageScss(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */
__webpack_exports__["default"] = "\n/*# sourceMappingURL=data:application/json;base64,<KEY>= */";
/***/
},
/***/
"./src/app/tabs/profile/profile-lists/profile-lists.page.ts":
/*!******************************************************************!*\
!*** ./src/app/tabs/profile/profile-lists/profile-lists.page.ts ***!
\******************************************************************/
/*! exports provided: ProfileListsPage */
/***/
function srcAppTabsProfileProfileListsProfileListsPageTs(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */
__webpack_require__.d(__webpack_exports__, "ProfileListsPage", function () {
return ProfileListsPage;
});
/* harmony import */
var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
/*! tslib */
"./node_modules/tslib/tslib.es6.js");
/* harmony import */
var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
/*! @angular/core */
"./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
/* harmony import */
var src_app_services_api_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
/*! src/app/services/api.service */
"./src/app/services/api.service.ts");
/* harmony import */
var _ionic_angular__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
/*! @ionic/angular */
"./node_modules/@ionic/angular/__ivy_ngcc__/fesm2015/ionic-angular.js");
var ProfileListsPage = /*#__PURE__*/function () {
function ProfileListsPage(api, loadingCtrl) {
_classCallCheck(this, ProfileListsPage);
this.api = api;
this.loadingCtrl = loadingCtrl;
this.page = 1;
this.users = [];
this.totalPages = 0;
this.totalUsers = 0;
}
_createClass(ProfileListsPage, [{
key: "ngOnInit",
value: function ngOnInit() {
this.loadUsers();
}
}, {
key: "loadUsers",
value: function loadUsers() {
return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
var _this = this;
var loading;
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return this.loadingCtrl.create({//message: "Loading Users",
});
case 2:
loading = _context.sent;
_context.next = 5;
return loading.present();
case 5:
this.api.getUsers(this.page).subscribe(function (res) {
console.log("res: ", res);
_this.users = res.users;
_this.totalPages = res.totalPages;
_this.totalUsers = res.totalUsers;
}, function (err) {
console.log("errors :", err);
}, function () {
loading.dismiss();
});
case 6:
case "end":
return _context.stop();
}
}
}, _callee, this);
}));
}
}]);
return ProfileListsPage;
}();
ProfileListsPage.ctorParameters = function () {
return [{
type: src_app_services_api_service__WEBPACK_IMPORTED_MODULE_2__["ApiService"]
}, {
type: _ionic_angular__WEBPACK_IMPORTED_MODULE_3__["LoadingController"]
}];
};
ProfileListsPage = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"])({
selector: "app-profile",
template: Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(
/*! raw-loader!./profile-lists.page.html */
"./node_modules/raw-loader/dist/cjs.js!./src/app/tabs/profile/profile-lists/profile-lists.page.html"))["default"],
styles: [Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(
/*! ./profile-lists.page.scss */
"./src/app/tabs/profile/profile-lists/profile-lists.page.scss"))["default"]]
})], ProfileListsPage);
/***/
}
}]);
//# sourceMappingURL=profile-lists-profile-lists-module-es5.js.map
|
javascript
|
// @ts-nocheck
/*
* jsCalendar v1.4.5-beta
*
*
* MIT License
*
* Copyright (c) 2020 <NAME>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
var jsCalendar = (function(){
// Constructor
function JsCalendar(){
// No parameters
if (arguments.length === 0) {
// Do nothing
return;
}
else {
// Construct calendar
this._construct(arguments);
}
}
// Version
JsCalendar.version = 'v1.4.5-beta';
// Sub-Constructor
JsCalendar.prototype._construct = function(args) {
// Parse arguments
args = this._parseArguments(args);
// Set a target
this._setTarget(args.target);
// Init calendar
this._init(args.options);
// Init target
this._initTarget();
// Set date
this._setDate(
(args.date !== null) ? args.date :
(this._target.dataset.hasOwnProperty('date')) ? this._target.dataset.date :
new Date()
);
// If invalid date
if (!this._now) throw new Error('jsCalendar: Date is outside range.');
// Extensions call init
this.extensionsCall('init', []);
// Create
this._create();
// Update
this._update();
};
// Languages
JsCalendar.prototype.languages = {
// Default English language
en : {
// Months Names
months : ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
// Days Names
days : ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
// Default handlers
_dateStringParser : function(key, date) {return JsCalendar._defaultDateStringParser(key, date, this);},
_dayStringParser : function(key, date) {return JsCalendar._defaultDayStringParser(key, date, this);}
}
};
// Extensions object
JsCalendar.extension = {};
JsCalendar.prototype.extensionCall = function(extension, method, args) {
extension = JsCalendar.extension[extension];
return extension[method].apply(extension, args);
};
JsCalendar.prototype.extensionsCall = function(method, args) {
args = [this].concat(args);
for (var i in JsCalendar.extension) {
if (JsCalendar.extension.hasOwnProperty(i) && JsCalendar.extension[i].hasOwnProperty(method)) {
this.extensionCall(i, method, args);
}
}
};
// Init calendar
JsCalendar.prototype._init = function(options) {
// Init elements object
this._elements = {};
// Events init
this._events = {};
this._events.date = [];
this._events.month = [];
this._events.day_render = [];
this._events.date_render = [];
this._events.month_render = [];
// Dates variables
this._now = null;
this._date = null;
this._selected = [];
// Language object
this.language = {};
// Parse options
this._parseOptions(options);
};
// Parse options
JsCalendar.prototype._parseArguments = function(args) {
// Arguments object
var obj = {
target : null,
date : null,
options : {}
};
// If no arguments
if (args.length === 0) {
// Throw an error
throw new Error('jsCalendar: No parameters were given.');
}
// Only 1 argument
else if (args.length === 1) {
// If target element
if (
(
// If html element
((typeof HTMLElement === 'object') ? (args[0] instanceof HTMLElement) : args[0]) &&
(typeof args[0] === 'object') && (args[0] !== null) && (args[0].nodeType === 1) &&
(typeof args[0].nodeName === 'string')
) || (
// Or string
typeof args[0] === 'string'
)
) {
obj.target = args[0];
}
// Options argument
else {
// Init arguments
obj.options = args[0];
// Get target
if (typeof args[0].target !== 'undefined') {
obj.target = args[0].target;
}
else {
// Throw an error
throw new Error('jsCalendar: Not target was given.');
}
// Get date
if (typeof args[0].date !== 'undefined') {
obj.date = args[0].date;
}
}
}
// Many arguments
else {
// First is target
obj.target = args[0];
// If date
if (args.length >= 2) {
obj.date = args[1];
}
// If options
if (args.length >= 3) {
obj.options = args[2];
}
}
// Return object
return obj;
};
// Default options
JsCalendar.options = {
language : 'en',
zeroFill : false,
monthFormat : 'month',
dayFormat : 'D',
firstDayOfTheWeek : 1,
navigator : true,
navigatorPosition : 'both',
min : false,
max : false,
onMonthRender : false,
onDayRender : false,
onDateRender : false
};
// Parse options
JsCalendar.prototype._parseOptions = function(doptions) {
// Options Object
this._options = {};
// Input options object (dirty)
var options = {};
// Load default and input options
for (var item in JsCalendar.options) {
// Default options
if (JsCalendar.options.hasOwnProperty(item)) {
this._options[item] = JsCalendar.options[item];
}
// Dynamic options
if (doptions.hasOwnProperty(item)) {
options[item] = doptions[item];
}
// Dataset options
else if (this._target.dataset.hasOwnProperty(item)) {
options[item] = this._target.dataset[item];
}
}
// Also load alias
item = 'fdotw'
if (doptions.hasOwnProperty(item)) {
options[item] = doptions[item];
}
else if (this._target.dataset.hasOwnProperty(item)) {
options[item] = this._target.dataset[item];
}
// Check options
if (typeof options.zeroFill !== 'undefined'){
if (options.zeroFill === 'false' || !options.zeroFill) {
this._options.zeroFill = false;
}
else {
this._options.zeroFill = true;
}
}
if (typeof options.monthFormat !== 'undefined'){
this._options.monthFormat = options.monthFormat;
}
if (typeof options.dayFormat !== 'undefined'){
this._options.dayFormat = options.dayFormat;
}
if (typeof options.navigator !== 'undefined'){
if (options.navigator === 'false' || !options.navigator) {
this._options.navigator = false;
}
else {
this._options.navigator = true;
}
}
if (typeof options.navigatorPosition !== 'undefined'){
this._options.navigatorPosition = options.navigatorPosition;
}
// Language
if (typeof options.language === 'string' && typeof this.languages[options.language] !== 'undefined'){
this._options.language = options.language;
}
// Set language
this.setLanguage(this._options.language);
// Set first day of the week
if (typeof options.fdotw !== 'undefined'){
options.firstDayOfTheWeek = options.fdotw;
}
if (typeof options.firstDayOfTheWeek !== 'undefined'){
// If day number
if (typeof options.firstDayOfTheWeek === 'number') {
// Range check (no need to check for bigger than 7 but I don't trust anyone)
if (options.firstDayOfTheWeek >= 1 && options.firstDayOfTheWeek <= 7) {
this._options.firstDayOfTheWeek = options.firstDayOfTheWeek;
}
}
// If string
if (typeof options.firstDayOfTheWeek === 'string') {
// If day number
if (options.firstDayOfTheWeek.match(/^[1-7]$/)) {
this._options.firstDayOfTheWeek = parseInt(options.firstDayOfTheWeek, 10);
}
// else use it as a day name
else {
// So find day
this._options.firstDayOfTheWeek = this.language.days.indexOf(options.firstDayOfTheWeek) + 1;
// Range check (no need to check for bigger then 7 but I don't trust anyone)
if (this._options.firstDayOfTheWeek < 1 || this._options.firstDayOfTheWeek > 7) {
this._options.firstDayOfTheWeek = 1;
}
}
}
}
// Set min calendar date
if (typeof options.min !== 'undefined' && options.min !== 'false' && options.min !== false) {
// Parse date
this._options.min = tools.parseDate(options.min);
}
// Set max calendar date
if (typeof options.max !== 'undefined' && options.max !== 'false' && options.max !== false) {
// Parse date
this._options.max = tools.parseDate(options.max);
}
// Set render handlers
if (typeof options.onMonthRender !== 'undefined') {
// Passed as function name string
if (
typeof options.onMonthRender === 'string' &&
typeof window[options.onMonthRender] === 'function'
) {
this._on('month_render', window[options.onMonthRender]);
}
// Passed as function
else if (typeof options.onMonthRender === 'function') {
this._on('month_render', options.onMonthRender);
}
}
if (typeof options.onDayRender !== 'undefined') {
// Passed as function name string
if (
typeof options.onDayRender === 'string' &&
typeof window[options.onDayRender] === 'function'
) {
this._on('day_render', window[options.onDayRender]);
}
// Passed as function
else if (typeof options.onDayRender === 'function') {
this._on('day_render', options.onDayRender);
}
}
if (typeof options.onDateRender !== 'undefined') {
// Passed as function name string
if (
typeof options.onDateRender === 'string' &&
typeof window[options.onDateRender] === 'function'
) {
this._on('date_render', window[options.onDateRender]);
}
// Passed as function
else if (typeof options.onDateRender === 'function') {
this._on('date_render', options.onDateRender);
}
}
};
// Set target
JsCalendar.prototype._setTarget = function(element) {
// Parse target
var target = tools.getElement(element);
// If target not found
if (!target) {
// Throw an error
throw new Error('jsCalendar: Target was not found.');
}
else {
// Save element
this._target = target;
// Link object to list
var id = this._target.id;
if (id && id.length > 0) {
jsCalendarObjects['#' + id] = this;
}
}
};
// Init target
JsCalendar.prototype._initTarget = function() {
// Add class
if (this._target.className.length > 0){
this._target.className += ' ';
}
this._target.className += 'jsCalendar';
// Create table
this._elements.table = document.createElement('table');
// Create table header
this._elements.head = document.createElement('thead');
this._elements.table.appendChild(this._elements.head);
// Create table body
this._elements.body = document.createElement('tbody');
this._elements.table.appendChild(this._elements.body);
// Insert on page
this._target.appendChild(this._elements.table);
};
// Check if date in range
JsCalendar.prototype._isDateInRange = function(date) {
// If no range
if (this._options.min === false && this._options.max === false) {
return true;
}
// Parse date
date = tools.parseDate(date);
// Check min
if (this._options.min !== false && this._options.min.getTime() > date.getTime()) {
return false;
}
// Check max
if (this._options.max !== false && this._options.max.getTime() < date.getTime()) {
return false;
}
// In range
return true;
};
// Set a Date
JsCalendar.prototype._setDate = function(date) {
// Parse date
date = tools.parseDate(date);
// Check date not in range
if (!this._isDateInRange(date)) {
return;
}
// Set data
this._now = date;
this._date = new Date(this._now.getFullYear(), this._now.getMonth(), 1);
};
// Convert to date string
JsCalendar.prototype._parseToDateString = function(date, format) {
var lang = this.language;
return format.replace(/(MONTH|month|MMM|mmm|mm|m|MM|M|DAY|day|DDD|ddd|dd|d|DD|D|YYYY|yyyy)/g, function(key) {
return lang.dateStringParser(key, date);
});
};
// Get visible month
JsCalendar.prototype._getVisibleMonth = function(date) {
// For date
if (typeof date === 'undefined') {
// Get saved date
date = this._date;
}
else {
date = tools.parseDate(date);
}
// Get month's first day
var first = new Date(date.getTime());
first.setDate(1);
// First day of the month index
var firstDay = first.getDay() - (this._options.firstDayOfTheWeek - 1);
if (firstDay < 0) {
firstDay += 7;
}
// Get month's name
var lang = this.language;
var name = this._options.monthFormat.replace(/(MONTH|month|MMM|mmm|##|#|YYYY|yyyy)/g, function(key) {
return lang.dateStringParser(key, first);
});
// Get visible days
var days = this._getVisibleDates(date);
var daysInMonth = new Date(first.getFullYear(), first.getMonth() + 1, 0).getDate();
var current = -1;
// If this is the month
if (first.getFullYear() === this._now.getFullYear() && first.getMonth() === this._now.getMonth()) {
// Calculate current
current = firstDay + this._now.getDate() - 1;
}
// Return object
return {
name : name,
days : days,
start : firstDay + 1,
current : current,
end : firstDay + daysInMonth
};
};
// Get visible dates
JsCalendar.prototype._getVisibleDates = function(date) {
// For date
if (typeof date === 'undefined') {
// Get saved date
date = this._date;
}
else {
date = tools.parseDate(date);
}
// Visible days array
var dates = [];
// Get first day of the month
var first = new Date(date.getTime());
first.setDate(1);
first.setHours(0, 0, 0, 0);
// Count days of previous month to show
var previous = first.getDay() - (this._options.firstDayOfTheWeek - 1);
if (previous < 0) {
previous += 7;
}
// Set day to month's first
var day = new Date(first.getTime());
// Previous month's days
while (previous > 0) {
// Calculate previous day
day.setDate(day.getDate() - 1);
day.setHours(0, 0, 0, 0);
// Add page on frond of the list
dates.unshift(new Date(day.getTime()));
// Previous
previous --;
}
// Set day to month's first
day = new Date(first.getTime());
// This month's days
do {
// Add page on back of the list
dates.push(new Date(day.getTime()));
// Calculate next day
day.setDate(day.getDate() + 1);
day.setHours(0, 0, 0, 0);
// Repeat until next month
} while (day.getDate() !== 1);
// Next month's days
var next = 42 - dates.length;
// Add days left
while (next > 0) {
// Add page on back of the list
dates.push(new Date(day.getTime()));
// Calculate next day
day.setDate(day.getDate() + 1);
day.setHours(0, 0, 0, 0);
// Next
next --;
}
// Return days
return dates;
};
// Create calendar
JsCalendar.prototype._create = function() {
var i, j;
// Save instance
var that = this;
// Set created flag
this._elements.created = true;
// Head rows
this._elements.headRows = [];
for (i = 0; i < 2; i++) {
this._elements.headRows.push(document.createElement('tr'));
this._elements.head.appendChild(this._elements.headRows[i]);
}
// Month row
var title_header = document.createElement('th');
title_header.setAttribute('colspan', 7);
this._elements.headRows[0].className = 'jsCalendar-title-row';
this._elements.headRows[0].appendChild(title_header);
this._elements.headLeft = document.createElement('div');
this._elements.headLeft.className = 'jsCalendar-title-left';
title_header.appendChild(this._elements.headLeft);
this._elements.month = document.createElement('div');
this._elements.month.className = 'jsCalendar-title-name';
title_header.appendChild(this._elements.month);
this._elements.headRight = document.createElement('div');
this._elements.headRight.className = 'jsCalendar-title-right';
title_header.appendChild(this._elements.headRight);
// Navigation
if (this._options.navigator) {
this._elements.navLeft = document.createElement('div');
this._elements.navLeft.className = 'jsCalendar-nav-left';
this._elements.navRight = document.createElement('div');
this._elements.navRight.className = 'jsCalendar-nav-right';
if (this._options.navigatorPosition === 'left') {
this._elements.headLeft.appendChild(this._elements.navLeft);
this._elements.headLeft.appendChild(this._elements.navRight);
}
else if (this._options.navigatorPosition === 'right') {
this._elements.headRight.appendChild(this._elements.navLeft);
this._elements.headRight.appendChild(this._elements.navRight);
}
else {
this._elements.headLeft.appendChild(this._elements.navLeft);
this._elements.headRight.appendChild(this._elements.navRight);
}
// Event listeners
this._elements.navLeft.addEventListener('click', function(event){
that.previous();
var date = new Date(that._date.getTime());
date.setDate(1);
that._eventFire('month', date, event);
}, false);
this._elements.navRight.addEventListener('click', function(event){
that.next();
var date = new Date(that._date.getTime());
date.setDate(1);
that._eventFire('month', date, event);
}, false);
}
// Days row
this._elements.headRows[1].className = 'jsCalendar-week-days';
title_header.className = 'jsCalendar-title';
this._elements.days = [];
for (i = 0; i < 7; i++) {
this._elements.days.push(document.createElement('th'));
this._elements.headRows[1].appendChild(this._elements.days[
this._elements.days.length - 1
]);
}
// Body rows
this._elements.bodyRows = [];
this._elements.bodyCols = [];
// 6 rows
for (i = 0; i < 6; i++) {
this._elements.bodyRows.push(document.createElement('tr'));
this._elements.body.appendChild(this._elements.bodyRows[i]);
// 7 days
for (j = 0; j < 7; j++) {
this._elements.bodyCols.push(document.createElement('td'));
this._elements.bodyRows[i].appendChild(this._elements.bodyCols[i * 7 + j]);
this._elements.bodyCols[i * 7 + j].addEventListener('click', (function(index){
return function (event) {
that._eventFire('date', that._active[index], event);
};
})(i * 7 + j), false);
}
}
// Extensions call create
this.extensionsCall('create', [this._elements]);
};
// Select dates on calendar
JsCalendar.prototype._selectDates = function(dates) {
// Copy array instance
dates = dates.slice();
// Parse dates
for (var i = 0; i < dates.length; i++) {
dates[i] = tools.parseDate(dates[i]);
dates[i].setHours(0, 0, 0, 0);
dates[i] = dates[i].getTime();
}
// Insert dates on array
for (i = dates.length - 1; i >= 0; i--) {
// If not already selected
if (this._selected.indexOf(dates[i]) < 0) {
this._selected.push(dates[i]);
}
}
};
// Un-select dates on calendar
JsCalendar.prototype._unselectDates = function(dates) {
// Copy array instance
dates = dates.slice();
// Parse dates
for (var i = 0; i < dates.length; i++) {
dates[i] = tools.parseDate(dates[i]);
dates[i].setHours(0, 0, 0, 0);
dates[i] = dates[i].getTime();
}
// Remove dates of the array
var index;
for (i = dates.length - 1; i >= 0; i--) {
// If selected
index = this._selected.indexOf(dates[i]);
if (index >= 0) {
this._selected.splice(index, 1);
}
}
};
// Unselect all dates on calendar
JsCalendar.prototype._unselectAllDates = function() {
// While not empty
while (this._selected.length) {
this._selected.pop();
}
};
// Update calendar
JsCalendar.prototype._update = function() {
// Get month info
var month = this._getVisibleMonth(this._date);
// Save data
this._active = month.days.slice();
// Update month name
this._elements.month.textContent = month.name;
// Check zeros filling
var prefix = (this._options.zeroFill) ? '0' : '';
// Populate days
var text;
for (var i = month.days.length - 1; i >= 0; i--) {
text = month.days[i].getDate();
this._elements.bodyCols[i].textContent = (text < 10 ? prefix + text : text);
// If date is selected
if (this._selected.indexOf(month.days[i].getTime()) >= 0) {
this._elements.bodyCols[i].className = 'jsCalendar-selected';
}
else {
this._elements.bodyCols[i].removeAttribute('class');
}
}
// Previous month
for (i = 0; i < month.start - 1; i++) {
this._elements.bodyCols[i].className = 'jsCalendar-previous';
}
// Current day
if (month.current >= 0) {
if (this._elements.bodyCols[month.current].className.length > 0) {
this._elements.bodyCols[month.current].className += ' jsCalendar-current';
}
else {
this._elements.bodyCols[month.current].className = 'jsCalendar-current';
}
}
// Next month
for (i = month.end; i < month.days.length; i++) {
this._elements.bodyCols[i].className = 'jsCalendar-next';
}
// Set days of the week locale
for (i = 0; i < 7; i++) {
var that = this;
this._elements.days[i].textContent = this._options.dayFormat.replace(/(DAY|day|DDD|ddd|DD|dd|D)/g, function(key) {
return that.language.dayStringParser(
key,
(i + that._options.firstDayOfTheWeek - 1) % 7
);
});
}
// Call render handlers
var j;
if (this._events.month_render.length > 0) {
var date = month.days[month.start - 1];
// Clear any style
this._elements.month.removeAttribute('style');
// Call the render handlers
for (j = 0; j < this._events.month_render.length; j++) {
this._events.month_render[j].call(this,
// Month index
date.getMonth(),
// Pass the html element
this._elements.month,
// Info about that month
{
start : new Date(date.getFullYear(), date.getMonth(), 1, 0, 0, 0, 0),
end : new Date(date.getFullYear(), date.getMonth() + 1, 0, 23, 59, 59, 999),
numberOfDays : month.end - month.start + 1
}
);
}
}
if (this._events.day_render.length > 0) {
for (i = 0; i < 7; i++) {
// Clear any style
this._elements.days[i].removeAttribute('style');
// Call the render handler
for (j = 0; j < this._events.day_render.length; j++) {
this._events.day_render[j].call(this,
// Day index
(i + this._options.firstDayOfTheWeek - 1) % 7,
// Pass the html element
this._elements.days[i],
// Info about that day
{
position : i
}
);
}
}
}
if (this._events.date_render.length > 0) {
for (i = 0; i < month.days.length; i++) {
// Clear any style
this._elements.bodyCols[i].removeAttribute('style');
// Call the render handler
for (j = 0; j < this._events.date_render.length; j++) {
this._events.date_render[j].call(this,
// Date should be clonned
new Date(month.days[i].getTime()),
// Pass the html element
this._elements.bodyCols[i],
// Info about that date
{
isCurrent : (month.current == i),
isSelected : (this._selected.indexOf(month.days[i].getTime()) >= 0),
isPreviousMonth : (i + 1 < month.start),
isCurrentMonth : (month.start <= i + 1 && i + 1 <= month.end),
isNextMonth : (month.end < i + 1),
position : {x: i%7, y: Math.floor(i/7)}
}
);
}
}
}
// Extensions call update
this.extensionsCall('update', [month]);
};
// Fire all event listeners
JsCalendar.prototype._eventFire = function(name, date, event) {
if (!this._events.hasOwnProperty(name)) return;
// Search events
for (var i = 0; i < this._events[name].length; i++) {
(function(callback, instance) {
// Call asynchronous
setTimeout(function(){
// Call callback
callback.call(instance, event, new Date(date.getTime()));
}, 0);
})(this._events[name][i], this);
}
};
// Add a event listener
// This method will be exposed on the future
JsCalendar.prototype._on = function(name, callback) {
// If callback is a function
if(typeof callback === 'function'){
// Add to the list
this._events[name].push(callback);
}
// Not a function
else {
// Throw an error
throw new Error('jsCalendar: Invalid callback function.');
}
// Return
return this;
};
// Add a event listeners
JsCalendar.prototype.onDateClick = function(callback) {
return this._on('date', callback);
};
JsCalendar.prototype.onMonthChange = function(callback) {
return this._on('month', callback);
};
JsCalendar.prototype.onDayRender = function(callback) {
return this._on('day_render', callback);
};
JsCalendar.prototype.onDateRender = function(callback) {
return this._on('date_render', callback);
};
JsCalendar.prototype.onMonthRender = function(callback) {
return this._on('month_render', callback);
};
// Goto a date
JsCalendar.prototype.set = function(date){
// Set new date
this._setDate(date);
// Refresh
this.refresh();
// Return
return this;
};
// Set min date
JsCalendar.prototype.min = function(date){
// If value
if (date) {
// Set min date
this._options.min = tools.parseDate(date);
}
// Disable
else {
this._options.min = false;
}
// Refresh
this.refresh();
// Return
return this;
};
// Set max date
JsCalendar.prototype.max = function(date){
// If value
if (date) {
// Set max date
this._options.max = tools.parseDate(date);
}
// Disable
else {
this._options.max = false;
}
// Refresh
this.refresh();
// Return
return this;
};
// Refresh
// Safe _update
JsCalendar.prototype.refresh = function(date) {
// If date provided
if (typeof date !== 'undefined') {
// If date is in range
if (this._isDateInRange(date)) {
this._date = tools.parseDate(date);
}
}
// If calendar elements ready
if (this._elements.created === true) {
this._update();
}
// Return
return this;
};
// Next month
JsCalendar.prototype.next = function(n){
// Next number
if (typeof n !== 'number') {
n = 1;
}
// Calculate date
var date = new Date(this._date.getFullYear(), this._date.getMonth() + n, 1);
// If date is not in range
if (!this._isDateInRange(date)) {
return this;
}
// Set date
this._date = date;
this.refresh();
// Return
return this;
};
// Next month
JsCalendar.prototype.previous = function(n){
// Next number
if (typeof n !== 'number') {
n = 1;
}
// Calculate date (last day of previous month)
var date = new Date(this._date.getFullYear(), this._date.getMonth() - n + 1, 0);
// If date is not in range
if (!this._isDateInRange(date)) {
return this;
}
// Set date
this._date = date;
this.refresh();
// Return
return this;
};
// Goto a date
JsCalendar.prototype.goto = function(date){
this.refresh(date);
// Return
return this;
};
// Reset to the date
JsCalendar.prototype.reset = function(){
this.refresh(this._now);
// Return
return this;
};
// Select dates
JsCalendar.prototype.select = function(dates, shouldRefresh = true){
// If no arguments
if (typeof dates === 'undefined') {
// Return
return this;
}
// If dates not array
if (!(dates instanceof Array)) {
// Lets make it an array
dates = [dates];
}
// Select dates
this._selectDates(dates);
// Refresh
if (true === shouldRefresh) {
this.refresh();
}
// Return
return this;
};
// Unselect dates
JsCalendar.prototype.unselect = function(dates, shouldRefresh = true){
// If no arguments
if (typeof dates === 'undefined') {
// Return
return this;
}
// If dates not array
if (!(dates instanceof Array)) {
// Lets make it an array
dates = [dates];
}
// Unselect dates
this._unselectDates(dates);
// Refresh
if (true === shouldRefresh) {
this.refresh();
}
// Return
return this;
};
// Unselect all dates
JsCalendar.prototype.clearselect = function(shouldRefresh = true){
// Unselect all dates
this._unselectAllDates();
// Refresh
if (true === shouldRefresh) {
this.refresh();
}
// Return
return this;
};
// Unselect all dates (alias)
JsCalendar.prototype.clearSelected = JsCalendar.prototype.clearselect;
// Get selected dates
JsCalendar.prototype.getSelected = function(options){
// Check if no options
if (typeof options !== 'object') {
options = {};
}
// Copy selected array
var dates = this._selected.slice();
// Options - Sort array
if (options.sort) {
if (options.sort === true) {
dates.sort();
}
else if (typeof options.sort === 'string') {
if (options.sort.toLowerCase() === 'asc') {
dates.sort();
}
else if (options.sort.toLowerCase() === 'desc'){
dates.sort();
dates.reverse();
}
}
}
// Options - Data type
if (options.type && typeof options.type === 'string') {
var i;
// Convert to date object
if (options.type.toLowerCase() === 'date'){
for (i = dates.length - 1; i >= 0; i--) {
dates[i] = new Date(dates[i]);
}
}
// If not a timestamp - convert to custom format
else if (options.type.toLowerCase() !== 'timestamp') {
for (i = dates.length - 1; i >= 0; i--) {
dates[i] = this._parseToDateString(new Date(dates[i]), options.type);
}
}
}
// Return dates
return dates;
};
// Check if date is selected
JsCalendar.prototype.isSelected = function(date){
// If no arguments or null
if (typeof date === 'undefined' || date === null) {
// Return
return false;
}
// Parse date
date = tools.parseDate(date);
date.setHours(0, 0, 0, 0);
date = date.getTime();
// If selected
if (this._selected.indexOf(date) >= 0) {
return true;
}
// If not selected
else {
return false;
}
};
// Check if date is visible in calendar
JsCalendar.prototype.isVisible = function(date){
// If no arguments or null
if (typeof date === 'undefined' || date === null) {
// Return
return false;
}
// Parse date
date = tools.parseDate(date);
date.setHours(0, 0, 0, 0);
date = date.getTime();
// Get visible dates
var visible = this._getVisibleDates();
// Check if date is inside visible dates
if (visible[0].getTime() <= date && visible[visible.length - 1].getTime() >= date) {
return true;
}
// Not visible
else {
return false;
}
};
// Check if date is in active month
JsCalendar.prototype.isInMonth = function(date){
// If no arguments or null
if (typeof date === 'undefined' || date === null) {
// Return
return false;
}
// Parse date and get month
var month = tools.parseDate(date);
month.setHours(0, 0, 0, 0);
month.setDate(1);
// Parse active month date
var active = tools.parseDate(this._date);
active.setHours(0, 0, 0, 0);
active.setDate(1);
// If same month
if (month.getTime() === active.getTime()) {
return true;
}
// Other month
else {
return false;
}
};
// Set language
JsCalendar.prototype.setLanguage = function(code) {
// Check if language exist
if (typeof code !== 'string'){
// Throw an error
throw new Error('jsCalendar: Invalid language code.');
}
if (typeof this.languages[code] === 'undefined'){
// Throw an error
throw new Error('jsCalendar: Language not found.');
}
// Change language
this._options.language = code;
// Set new language as active
var language = this.languages[code];
this.language.months = language.months;
this.language.days = language.days;
this.language.dateStringParser = language._dateStringParser;
this.language.dayStringParser = language._dayStringParser;
// Refresh calendar
this.refresh();
// Return
return this;
};
// Static foo methods (well... not really static)
// Auto init calendars
JsCalendar.autoFind = function() {
// Get all auto-calendars
var calendars = document.getElementsByClassName('auto-jsCalendar');
// For each auto-calendar
for (var i = 0; i < calendars.length; i++) {
// If not loaded
if (calendars[i].getAttribute('jsCalendar-loaded') !== 'true') {
// Set as loaded
calendars[i].setAttribute('jsCalendar-loaded', 'true');
// Create
new JsCalendar({target: calendars[i]});
}
}
};
// Tools
var tools = JsCalendar.tools = {};
// Parse to javascript date object
tools.parseDate = function(date, silent) {
// If set now date
if (typeof date === 'undefined' || date === null || date === 'now') {
// Get date now
date = new Date();
}
// If date is string
else if (typeof date === 'string') {
// Parse date string
date = date.replace(/-/g,'/').match(/^(\d{1,2})\/(\d{1,2})\/(\d{4,4})$/i);
// If match
if (date !== null) {
var month_index = parseInt(date[2], 10) - 1;
// Parse date
date = new Date(date[3], month_index, date[1]);
// Check if date does not exist
if (!date || date.getMonth() !== month_index) {
// Throw an error
if (!silent) throw new Error('jsCalendar: Date does not exist.');
return null;
}
}
// Can't parse string
else {
// Throw an error
if (!silent) throw new Error('jsCalendar: Failed to parse date.');
return null;
}
}
// If it is a number
else if (typeof date === 'number') {
// Get time from timestamp
date = new Date(date);
}
// If it not a date
else if (!(date instanceof Date)) {
// Throw an error
if (!silent) throw new Error('jsCalendar: Invalid date.');
return null;
}
// Return date
return new Date(date.getTime());
};
tools.stringToDate = tools.parseDate;
// Date to string
tools.dateToString = function(date, format, lang) {
// Find lang
var languages = JsCalendar.prototype.languages;
if (!lang || !languages.hasOwnProperty(lang)) {
lang = 'en';
}
// Call parser
return JsCalendar.prototype._parseToDateString.apply(
{language : {
months : languages[lang].months,
days : languages[lang].days,
dateStringParser : languages[lang]._dateStringParser,
dayStringParser : languages[lang]._dayStringParser
}},
[date, format]
);
};
// Get element
tools.getElement = function(element) {
// Check if not valid
if (!element) {
return null;
}
// If string
if (typeof element === 'string') {
// Get element by id
if (element[0] === '#') {
return document.getElementById(element.substring(1));
}
// Get element by class-name
else if (element[0] === '.') {
return document.getElementsByClassName(element.substring(1))[0];
}
}
// or if it is HTML element (just a naive-simple check)
else if (element.tagName && element.nodeName && element.ownerDocument && element.removeAttribute) {
return element;
}
// Unknown
return null;
};
// Get a new object
JsCalendar.new = function(){
// Create new object
var obj = new JsCalendar();
// Construct calendar
obj._construct(arguments);
// Return new object
return obj;
};
// Manage existing jsCalendar objects
var jsCalendarObjects = {};
JsCalendar.set = function(identifier, calendar){
if (calendar instanceof JsCalendar) {
jsCalendarObjects[identifier] = calendar;
return true;
}
throw new Error('jsCalendar: The second parameter is not a jsCalendar.');
};
JsCalendar.get = function(identifier){
if (jsCalendarObjects.hasOwnProperty(identifier)) {
return jsCalendarObjects[identifier];
}
return null;
};
JsCalendar.del = function(identifier){
if (jsCalendarObjects.hasOwnProperty(identifier)) {
delete jsCalendarObjects[identifier];
return true;
}
return false;
};
// Add a new language
JsCalendar.addLanguage = function(language){
// Check if language object is valid
if (typeof language === 'undefined') {
// Throw an error
throw new Error('jsCalendar: No language object was given.');
}
// Check if valid language code
if (typeof language.code !== 'string') {
// Throw an error
throw new Error('jsCalendar: Invalid language code.');
}
// Check language months
if (!(language.months instanceof Array)) {
// Throw an error
throw new Error('jsCalendar: Invalid language months.');
}
if (language.months.length !== 12) {
// Throw an error
throw new Error('jsCalendar: Invalid language months length.');
}
// Check language days
if (!(language.days instanceof Array)) {
// Throw an error
throw new Error('jsCalendar: Invalid language days.');
}
if (language.days.length !== 7) {
// Throw an error
throw new Error('jsCalendar: Invalid language days length.');
}
// Now save language
JsCalendar.prototype.languages[language.code] = language;
// Generate language string format handlers
language._dateStringParser = (
language.hasOwnProperty('dateStringParser') ?
function(key, date) {return language.dateStringParser(key, date) || JsCalendar._defaultDateStringParser(key, date, language);} :
function(key, date) {return JsCalendar._defaultDateStringParser(key, date, language);}
);
language._dayStringParser = (
language.hasOwnProperty('dayStringParser') ?
function(key, day) {return language.dayStringParser(key, day) || JsCalendar._defaultDayStringParser(key, day, language);} :
function(key, day) {return JsCalendar._defaultDayStringParser(key, day, language);}
);
};
// Exetnsion load
JsCalendar.ext = function(id, extension) {
JsCalendar.extension[id] = extension;
};
// Default function to handle date-string parsing
JsCalendar._defaultDateStringParser = function(key, date, lang){
switch(key) {
case 'MONTH':
case 'month':
return lang.months[date.getMonth()];
case 'MMM':
case 'mmm':
return lang.months[date.getMonth()].substring(0, 3);
case 'mm':
return lang.months[date.getMonth()].substring(0, 2);
case 'm':
return lang.months[date.getMonth()].substring(0, 1);
case 'MM':
return (date.getMonth() < 9 ? '0' : '') + (date.getMonth() + 1);
case 'M':
return date.getMonth() + 1;
case '##':
return (date.getMonth() < 9 ? '0' : '') + (date.getMonth() + 1);
case '#':
return date.getMonth() + 1;
case 'DAY':
case 'day':
return lang.days[date.getDay()];
case 'DDD':
case 'ddd':
return lang.days[date.getDay()].substring(0, 3);
case 'dd':
return lang.days[date.getDay()].substring(0, 2);
case 'd':
return lang.days[date.getDay()].substring(0, 1);
case 'DD':
return (date.getDate() <= 9 ? '0' : '') + date.getDate();
case 'D':
return date.getDate();
case 'YYYY':
case 'yyyy':
return date.getFullYear();
}
};
// Default function to handle date-string parsing
JsCalendar._defaultDayStringParser = function(key, day, lang){
switch(key) {
case 'DAY':
case 'day':
return lang.days[day];
case 'DDD':
case 'ddd':
return lang.days[day].substring(0, 3);
case 'DD':
case 'dd':
return lang.days[day].substring(0, 2);
case 'D':
return lang.days[day].substring(0, 1);
}
};
// Load any language on the load list
(function(){
// If a list exist
if (typeof window.jsCalendar_language2load !== 'undefined') {
// While list not empty
while (window.jsCalendar_language2load.length) {
// Make it asynchronous
(function (language) {
// Return timeout callback
return function() {
JsCalendar.addLanguage(language);
};
})(window.jsCalendar_language2load.pop());
}
// Clean up useless list
delete window.jsCalendar_language2load;
}
})();
// Init auto calendars
// After the page loads
window.addEventListener('load', function() {
// Get calendars
JsCalendar.autoFind();
}, false);
// Return
return JsCalendar;
})();
export {jsCalendar}
|
typescript
|
England reached the Euro 2020 final with a tense 2-1 win against Denmark after extra time at Wembley on Wednesday.
AFP Sport looks at three things we learned after Harry Kane’s goal sent England to their first major final in 55 years:
Raheem strength:
Raheem Sterling ended England’s last European Championship campaign vilified after a lacklustre performance in their humiliating exit against minnows Iceland in 2016.
Fast-forward five years and the England fans who had turned Sterling into public enemy number one were cheering his name to the Wembley rafters.
It was Sterling who carried the biggest threat for England on a night when Denmark’s obdurate defence posed a formidable barrier.
Even in extra time, when England were in danger of being taken to the lottery of a penalty shoot-out, Sterling kept demanding the ball as he probed away at the Denmark rearguard.
The Manchester City winger finally got his reward in the 104th minute when his surge was halted by Joakim Maehle’s foul.
Denmark protested but VAR gave the penalty and Harry Kane fired home the rebound after his spot-kick was saved.
After a troubled season with Premier League champions City that saw him lose his place at times, Sterling has been revitalised with England.
He has scored three times in Euro 2020 and was heavily involved in England’s equaliser against the Danes when his run towards Bukayo Saka’s cross forced Simon Kjaer to turn the ball into his own net.
No wonder England boss Gareth Southgate wrapped Sterling in a huge embrace during the post-match celebrations.
“I thought Raheem was a thorn in their side all night,” Southgate said.
Schmeichel’s cheeky dig was a reference to the “Three Lions” anthem that features the line “Football’s coming home”, which England supporters have been optimistically chanting throughout the tournament.
England captain Harry Kane had responded to Schmeichel’s taunt by insisting his team were in position to finally end their long wait to reach a title match.
It was Kane who had the last laugh as his 104th-minute goal ended Denmark’s brave resistance — but not before Schmeichel did everything in his power to frustrate England.
Schmeichel made superb saves to repel Raheem Sterling’s close-range effort in the first half and Harry Maguire’s looping header early in the second period.
The Leicester keeper also denied Kane when the England captain threatened with a low shot in extra time, then pushed away Jack Grealish’s long-range blast.
The last Danish goalkeeper to have more saves in a Euro match than Schmeichel’s six against England was his father Peter in 1992 against Germany.
Fittingly, the game would be settled with a duel between Kane and Schmeichel.
Schmeichel plunged low to his left to keep out Kane’s spot-kick but the Tottenham striker was quickest to react as he sent Wembley into ecstasy.
With England in desperate need of a quick response to Denmark’s shock opener, Bukayo Saka showed why Gareth Southgate has such faith in the teenager.
The Arsenal forward delivered a vibrant display in the last-16 victory against Germany before missing Saturday’s quarter-final win against Ukraine with a minor knock suffered in training.
Jadon Sancho impressed in Saka’s absence, but Southgate opted to recall his precocious youngster rather than keep Manchester United’s new signing in the starting line-up.
Any doubts that Southgate had made the wrong call by dropping the more experienced Sancho were erased by Saka in the 39th minute.
Accelerating onto Harry Kane’s pass, Saka timed his run perfectly to beat the Denmark offside trap.
He raced into the penalty area and whipped a low cross towards Raheem Sterling, with Simon Kjaer’s attempt to block only succeeding in diverting the ball into his own net.
Saka was still having an impact when he was surprisingly replaced by Jack Grealish and will surely have a role to play in the final.
|
english
|
South Korean actress Oh In-hye was declared dead by authorities on Monday (September 14) after she was found to be in an unconscious state in her home in Incheon earlier in the day. The 36-year-old actress was rushed to a hospital in a critical condition after she was found in an unresponsive state and without any pulse at her home at early morning 5AM. An acquaintance of the actress alerted emergency services after Oh In-hye was found lying motionless.
Prior to being taken to the hospital, paramedic services performed cardiopulmonary resuscitation (CPR) including other emergency procedures in order to get her breathing again. Eventually, her pulse had stabilized although she had not regained consciousness. Oh In-Hye was pronounced dead later in the day despite treatment being administered. A private funeral service is scheduled to take place at Incheon's Inha University Hospital after which her funeral will be held on Wednesday. An investigation into the actress' death is already underway and an apparent suicide attempt is suspected.
Oh In-Hye debuted in the 2011 film, Sin of a Family, and then went on to star in Red Vacance Black Wedding, Eating, Talking, Faucking, A Journey with Korean Masters, No Breathing, Secret Travel and The Plan in 2014. She grabbed headlines in 2011 when she attended the Busan International Film Festival by wearing a revealing red dress on the red carpet.
தந்தையின் உடல்நிலையில் நல்ல முன்னேற்றம் ஏற்பட்டிருப்பதாக எஸ். பி. சரண் பதிவு !
அட்டகாசமாய் வெளியான அச்சம் மடம் நாணம் பயிர்ப்பு படத்தின் ஃபர்ஸ்ட் லுக் போஸ்டர் !
|
english
|
British Prime Minister Boris Johnson on Saturday called the deal struck at the UN COP26 climate change summit "a big step forward" but warned there was "a huge amount more to do".
"There is still a huge amount more to do in the coming years," Johnson said after the Glasgow summit.
"But today's agreement is a big step forward and, critically, we have the first ever international agreement to phase down coal and a roadmap to limit global warming to 1. 5 degrees," he added.
Nearly 200 nations came together on the global deal to combat climate change after two weeks of painful negotiation, but fell short of what science says is needed to contain dangerous temperature rises.
British leader Johnson, whose government hosted the event, said "we asked nations to come together for our planet at COP26, and they have answered that call.
"I hope that we will look back on COP26 in Glasgow as the beginning of the end of climate change, and I will continue to work tirelessly towards that goal," he added.
Britain's COP26 president Alok Sharma rounded up the marathon negotiations telling delegates: "It is now decision time. And the choices you are set to make are vitally important. "
But China and India insisted that language on fossil fuels be weakened in the final summit decision text.
|
english
|
[](https://badge.fury.io/rb/influxdb-process)
[](https://travis-ci.org/vassilevsky/influxdb-process)
# InfluxDB::Process
Gathers metrics from the Ruby process it is executed in and sends them to an InfluxDB database.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'influxdb-process'
```
And then execute:
$ bundle
Or do all this at once:
$ bundle add influxdb-process
## Usage
This library assumes that you already have a working InfluxDB client instance.
It does not attempt to create one for you.
If not, see [InfluxDB Ruby](https://github.com/influxdata/influxdb-ruby) for client initialization instructions.
Let's say you have the client in the `influxdb` variable, as it says.
Add this to any place in your Ruby program:
```ruby
InfluxDB::Process::Instrumentation.new(influxdb).start
```
When you deploy this, the process where this code is executed will create a new thread.
It will periodically collect process metrics and send them to InfluxDB via the provided client.
Alternatively, you can instrument whenever you want (after each request / job / batch):
```ruby
# in an initializer, once
p = InfluxDB::Process::Instrumentation.new(influxdb)
# later, in an appropriate place, as many times as needed
p.instrument
```
You can pass additional options to customize the behavior of this gem. Here they are (with default values):
```ruby
InfluxDB::Process::Instrumentation.new(
influxdb,
memory_series: 'process_memory',
object_series: 'process_objects',
interval: 10, # seconds
process: $PROGRAM_NAME
)
```
Metrics will be tagged with process name.
By default, `$0`/`$PROGRAM_NAME` will be used.
You can set your own process name via an additional keyword argument in the constructor. For example:
```ruby
InfluxDB::Process::Instrumentation.new(influxdb, process: 'report_generator')
```
You can also set the `INFLUXDB_PROCESS_NAME` environment variable:
INFLUXDB_PROCESS_NAME=cache_cleaner bundle exec ruby ...
It will take precedence over the keyword argument.
## Limitations
System memory metrics (total, resident, shared memory used by the process as seen from the OS) are read
from the `/proc` filesystem. They are not reported on systems where it is not available.
## Development
After checking out the repo, run `bin/setup` to install dependencies.
You can also run `bin/console` for an interactive prompt that will allow you to experiment.
How to test this gem:
* Install and run InfluxDB
* Create a `test` database in it
* Run `make points`
It will generate metrics and push them to the `test` database.
To install this gem onto your local machine, run `bundle exec rake install`.
To release a new version:
* Update the version number in `version.rb`
* Run `bundle exec rake release`, which will do the following:
* create a git tag for the version
* push git commits and tags
* push the `.gem` file to [rubygems.org](https://rubygems.org)
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/vassilevsky/influxdb-process
## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
markdown
|
Microsoft’s SwiftKey keyboard has been upgraded for Android, and now offers an Urdu (English) keyboard. The other languages to receive SwiftKey keyboard support include Alsatian, Fongbe, Norman, and Warlpiri. The update, though, has only been made available to Android devices.
SwiftKey keyboard’s latest version can be downloaded from Google Play Store, as there’s no word if iOS will get an update soon. The latest SwiftKey update has also taken care of bugs, such as the punctuation slider on Swiftkey’s virtual keyboard. In earlier versions, it would trigger the period (. ) as a user slides a finger over it. Also, Instagram users will not face issues with tagging users, as in the previous editions of SwiftKey, the keyboard would automatically shut down during tagging. In addition, users can also apply a layout fix, made available in the Dvorak + Split + Undock settings option.
Also read: Asus Zenfone Max Pro M1 first impressions: Can it beat Xiaomi Redmi Note 5 Pro?
With the addition of Urdu(English), SwiftKey now offers support for more than 200 languages. Popular choices among users include English (US, UK, AU, CA), Spanish (ES, LA, US), Portuguese (PT, BR), German, Turkish and French, among others. SwiftKey offers users an artificial intelligence-based typing experience, with the SwiftKey Flow option, to enable swipe-to-type flow. It also includes bilingual autocorrect, an emoji keyboard and over 70 colours, designs and themes.
|
english
|
<filename>src/providers/ThemeSwitchProvider.js
// Generated by ReScript, PLEASE EDIT WITH CARE
import * as React from "react";
var themeSwitchContext = React.createContext(function (param) {
});
var provider = themeSwitchContext.Provider;
function ThemeSwitchProvider(Props) {
var value = Props.value;
var children = Props.children;
return React.createElement(provider, {
value: value,
children: children
});
}
var make = ThemeSwitchProvider;
export {
themeSwitchContext ,
provider ,
make ,
}
/* themeSwitchContext Not a pure module */
|
javascript
|
<filename>gear/hardware/n/neon.json
{
"name": "Neon",
"description": "Neon markers.",
"url": "https://www.expomarkers.com/markers/neon"
}
|
json
|
<filename>ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java
package com.ruoyi.system.mapper;
import com.ruoyi.system.domain.SysRole;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* <p>
* 角色信息表 Mapper 接口
* </p>
*
* @author wxx
* @since 2020-01-06
*/
@Mapper
public interface SysRoleMapper {
/**
* 根据用户ID查询角色
*
* @param userId 用户ID
* @return 角色列表
*/
public List<SysRole> selectRolesByUserId(Long userId);
}
|
java
|
/*-
* #%L
* Baleen 3
* %%
* Copyright (C) 2020 Dstl
* %%
* 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.
* #L%
*/
import React from 'react'
import { render, renderDark, userEvent } from '../../utils/test'
import { SearchInput } from '.'
it('renders without error', () => {
const { asFragment } = render(<SearchInput onSearch={jest.fn()} />)
expect(asFragment()).toMatchSnapshot()
})
it('renders dark without error', () => {
const { asFragment } = renderDark(<SearchInput onSearch={jest.fn()} />)
expect(asFragment()).toMatchSnapshot()
})
it('Calls onSearch with value when clicked', async () => {
jest.useFakeTimers()
const onSearch = jest.fn()
const { getByRole } = render(<SearchInput onSearch={onSearch} />)
await userEvent.type(getByRole('textbox', { name: /search/i }), 'test')
jest.runTimersToTime(200)
expect(onSearch).toBeCalledWith('test')
})
it('Calls onSearch with "" when cleared', async () => {
const onSearch = jest.fn()
const { getByRole } = render(<SearchInput onSearch={onSearch} />)
await userEvent.type(getByRole('textbox', { name: /search/i }), 'test')
userEvent.click(getByRole('button', { name: /clear/i }))
expect(onSearch).toBeCalledWith('')
})
|
typescript
|
<gh_stars>1-10
#property-editor .property span {
/*
margin-left:5px;
margin-right:5px;
padding-left:3px;
padding-right:3px;
*/
}
.contenu.hidden{
height:0px;
overflow-y:hidden;
-webkit-transition: height 1s ease;
}
.contenu.visible{
height:auto;
/*overflow-y:hidden;*/
-webkit-transition: height 1s ease;
}
.tool-box table{
}
#property-editor td span{
padding-left:5px;
padding-right:5px;
}
#property-editor tr{
height:30px;
}
#property-editor .box{
border-bottom:solid 1px #ddd;
margin-bottom:20px;
}
#property-editor .property-value {
width:100px;
height:25px;
border:solid 1px #ddd;
}
#property-editor .preview canvas{
border:solid 1px #ddd;
}
#property-editor {
position:absolute;
-webkit-transition: top 1s ease;
}
/*
border-bottom: 1px solid #ddd;
#property-editor nav.menu:before{
background-color:#ddd;
width:50px;
height:50px;
content: " ";
position:absolute;
-webkit-transform:rotate(45deg);
left:-25px;
top:50px;
box-shadow: 0 0 2px 3px #aaa;
}*/
#property-editor nav.menu{
}
#property-editor nav.menu ul{
list-style: none;
}
#property-editor nav.menu li{
float: left;
/*position: relative;*/
padding : 10px;
}
#property-editor{
min-width:220px;
max-width:300px;
min-height:200px;
background-color:#fff;
padding:10px;
box-shadow: 0 0 2px 3px #ddd;
}
|
css
|
Infosys Q3 Results Preview: Infosys is widely expected to offer a conservative commentary on the demand environment. This is particularly in the backdrop of a large deal cancellation that the company saw in the last quarter. Last month, Infosys said that a $1.5 billion deal that it had signed with a global company in the September quarter was terminated.
While TCS is seen reporting a moderate growth in revenue in constant currency terms sequentially, Infosys will see the topline declining by more than 1 per cent, according to estimates given by brokerage firms.
In the September 2023 quarter, JK Lakshmi Cement's revenue grew by 12% year-on-year to Rs1,452 crore. Its sales volume grew by 10%, which was similar to the 11% volume growth at the sector level. The operating profit before depreciation and amortisation (EBITDA) grew by 17% to Rs705 per tonne. Net profit grew by 41% to Rs83 crore.
One global crisis to another. This probably sums up the story of the real estate sector in India. It was the global financial crisis of 2008, which hit the real estate sector very badly. It was the global covid crisis, which got it out from the dumps. Excess inventory, over leveraged balance sheets and weak demand were some of the factors which plagued the sector till 2020. Post that period, excess liquidity, the need to have a bigger house, companies having learnt lessons about what not to do when time is good probably defines the listed real estate sector in India.
The revenue for the period under review, however, climbed only marginally to Rs 4,914.3 crore, as compared to Rs 4,908.9 crore in the preceding year. Its income from other operations jumped 33% year-on-year to Rs 296 crore.
Consolidated crude steel production for the quarter stood at 6.43 million tonnes, higher by 11% YoY and lower by 2% QoQ. The company had taken certain scheduled shutdowns at Indian operations during the quarter, hence the average capacity utilisation for Q1FY24 was 92% compared to 96% in Q4FY23, the exchange filing said.
Venky's India, one of the largest poultry firms in India, reported a 56% decline in consolidated profit after tax for Q1 2021 as a result of high costs of poultry feed ingredients and lower sales. Although revenue from its poultry segment fell by 3%, profit margins were severely affected due to steep increases in soya and maize costs, causing core profit margins to fall to 3.26% from 6.99%. Shareholders have been recommended a dividend of 6 rupees per share for the 2023 fiscal year. The Animal Health Products division in Maharashtra is on track, with construction ending in June.
Pidilite Industries reported healthy growth in its core businesses, which helped drive overall performance. The consumer businesses grew over 20% in value and double digits in volume. The B2B growth was around 13%. Rural and semi-urban areas are gradually returning to demand, creating a greater growth rate than urban areas. The pigments business has faced an impact due to the near-recession in western markets.
It has however gained 7% since the company’s March 2023 quarter result on April 25 driven by strong growth in the IT services segment, sustained new deal wins, stable operating margin and improving revenue per client.
Indian Hotels CEO, Puneet Chhatwal, anticipates a rise in healthy room rates and occupancy as demand for travel outpaces supply over the next two years. He anticipates growth in business travel recovery, as well as growth in the leisure industry. Additionally, he notes that the Taj brand has been integral in allowing the company to gain more market share and grow.
The company's software and consulting businesses rose 6% and 8.2%, respectively, at constant currency in the first quarter, in line with IBM's targets. Big Blue also reiterated its full-year free cash flow forecast of $10.5 billion.
In the bull case scenario, the brokerage values Nifty at a 10-year average (20.8x) and arrives at a bull case target of 22,487 (23,015 at a 5% premium to LPA earlier). Whereas, bear case Nifty can trade at a 25% discount to LPA (20% earlier) with a target of 16,866 (17,533 earlier), it said.
Nykaa Q2 Results: In an exchange filing, Nykaa said its EBITDA improved to Rs 61 crore vs Rs 28.8 crore in the year-ago period. Its consolidated margin also improved to 4.9% against 3.3% on a YoY basis.
The employee attrition rate elevated during the quarter on an annual basis through the company management has cited a moderating trend on a quarterly basis. The net employee addition for the quarter was the lowest at 9,840 in nine quarters, signalling the beginning of moderation in the hiring frenzy seen over the past few quarters.
According to the average of the estimates by ETIG and eight brokerages, the dollar-denominated revenue of TCS is expected to grow by 1.9% sequentially to $ 6,824.5 mn compared with the 2.6% growth in the previous quarter. A weaker euro and pound against the dollar will affect the reported growth even though the constant currency (CC) growth is expected to be higher at 3-4%.
|
english
|
<reponame>kitingChris/azure-docs.de-de<filename>includes/azure-postgresql-hyperscale-create-db.md<gh_stars>0
---
title: include file
description: include file
author: jonels-msft
ms.service: postgresql
ms.subservice: hyperscale-citus
ms.topic: include
ms.date: 05/14/2019
ms.author: jonels
ms.custom: include file
ms.openlocfilehash: c07e352288d7dc1d0bf198fd74c8baaded3a2d23
ms.sourcegitcommit: 3e98da33c41a7bbd724f644ce7dedee169eb5028
ms.translationtype: HT
ms.contentlocale: de-DE
ms.lasthandoff: 06/18/2019
ms.locfileid: "67178334"
---
Wenn Sie kein Azure-Abonnement besitzen, können Sie ein [kostenloses Konto](https://azure.microsoft.com/free/) erstellen, bevor Sie beginnen.
## <a name="sign-in-to-the-azure-portal"></a>Melden Sie sich auf dem Azure-Portal an.
Melden Sie sich beim [Azure-Portal](https://portal.azure.com) an.
## <a name="create-an-azure-database-for-postgresql---hyperscale-citus"></a>Erstellen einer Azure Database for PostgreSQL-Instanz: Hyperscale (Citus)
Führen Sie die folgenden Schritte aus, um eine Azure-Datenbank für PostgreSQL-Server zu erstellen:
1. Klicken Sie im Azure-Portal links oben auf **Ressource erstellen**.
2. Wählen Sie auf der Seite **Neu** die Option **Datenbanken** und dann auf der Seite **Datenbanken** die Option **Azure-Datenbank für PostgreSQL** aus.
3. Klicken Sie als Bereitstellungsoption auf die Schaltfläche **Erstellen** unter **Hyperscale-Servergruppe (Citus) – VORSCHAU**.
4. Geben Sie im Formular für den neuen Server folgende Informationen an:
- Ressourcengruppe: Klicken Sie auf den Link **Neue erstellen** unterhalb des Textfelds für dieses Feld. Geben Sie einen Namen ein, z.B. **myresourcegroup**.
- Servergruppenname: Geben Sie einen eindeutigen Namen für die neue Servergruppe ein, der ebenfalls für eine Serverunterdomäne verwendet wird.
- Administratorbenutzername: muss derzeit **citus** lauten und kann nicht geändert werden.
- Kennwort: muss mindestens 8 Zeichen lang sein und Zeichen aus drei der folgenden Kategorien enthalten: Großbuchstaben des englischen Alphabets, Kleinbuchstaben des englischen Alphabets, Ziffern (0–9) und nicht alphanumerische Zeichen (!, $, #, % usw.).
- Standort: Verwenden Sie den Standort, der Ihren Benutzern am nächsten ist, damit sie möglichst schnell auf die Daten zugreifen können.
> [!IMPORTANT]
> Das hier angegebene Kennwort für den Serveradministrator ist erforderlich, um die Anmeldung am Server und bei den zugehörigen Datenbanken auszuführen. Behalten Sie diese Angaben im Kopf, oder notieren Sie sie zur späteren Verwendung.
5. Klicken Sie auf **Servergruppe konfigurieren**. Übernehmen Sie die Einstellungen in diesem Abschnitt unverändert, und klicken Sie auf **Speichern**.
6. Klicken Sie auf **Bewerten + erstellen** und dann auf **Erstellen**, um den Server bereitzustellen. Die Bereitstellung dauert einige Minuten.
7. Die Seite leitet zur Überwachung der Bereitstellung um. Wenn sich der Livestatus von **Ihre Bereitstellung wird ausgeführt** in **Ihre Bereitstellung wurde abgeschlossen** ändert, klicken Sie links auf der Seite auf das Menüelement **Ausgaben**.
8. Die Seite „Ausgaben“ enthält einen Koordinatorhostnamen mit einer Schaltfläche daneben, um den Wert in die Zwischenablage zu kopieren. Notieren Sie diese Informationen zur späteren Verwendung.
## <a name="configure-a-server-level-firewall-rule"></a>Konfigurieren einer Firewallregel auf Serverebene
Der Dienst Azure Database for PostgreSQL – Hyperscale (Citus) (Vorschauversion) verwendet eine Firewall auf der Serverebene. Standardmäßig hindert die Firewall alle externen Anwendungen und Tools daran, eine Verbindung mit dem Koordinatorknoten und mit internen Datenbanken herzustellen. Sie müssen eine Regel zum Öffnen der Firewall für einen bestimmten IP-Adressbereich hinzufügen.
1. Klicken Sie im Abschnitt **Ausgaben**, in dem Sie zuvor den Hostnamen des Koordinatorknotens kopiert hatten, zurück zum Menüelement **Übersicht**.
2. Suchen Sie den Namen der Servergruppe Ihrer Bereitstellung, und klicken Sie darauf. (Der Name der Servergruppe hat *kein* Suffix. Elemente, deren Namen z. B. auf „-c“, „-w0“ oder „-w1“ enden, sind nicht die Servergruppe.)
3. Klicken Sie im Menü auf der linken Seite unter **Sicherheit** auf **Firewall**.
4. Klicken Sie auf den Link **+ Firewallregel für die aktuelle Client-IP-Adresse hinzufügen**.
5. Klicken Sie abschließend auf die Schaltfläche **Speichern**.
> [!NOTE]
> Der Azure-PostgreSQL-Server kommuniziert über Port 5432. Wenn Sie versuchen, eine Verbindung aus einem Unternehmensnetzwerk heraus herzustellen, wird der ausgehende Datenverkehr über Port 5432 von der Firewall Ihres Netzwerks unter Umständen nicht zugelassen. In diesem Fall können Sie nur dann eine Verbindung mit Ihrem Azure SQL-Datenbank-Server herstellen, wenn Ihre IT-Abteilung Port 5432 öffnet.
>
## <a name="connect-to-the-database-using-psql"></a>Herstellen einer Verbindung mit der Datenbank mithilfe von psql
Wenn Sie Ihren Azure Database for PostgreSQL-Server erstellt haben, wird eine Standarddatenbank mit dem Namen **citus** erstellt. Um eine Verbindung mit Ihrem Datenbankserver herzustellen, benötigen Sie eine Verbindungszeichenfolge und das Administratorkennwort.
1. Rufen Sie die Verbindungszeichenfolge ab. Klicken Sie auf der Seite der Servergruppe auf das Menüelement **Verbindungszeichenfolgen**. (Sie finden es unter **Einstellungen**.) Suchen Sie die markierte Zeichenfolge **C++ (libpq)** . Sie hat folgendes Format:
```
host=hostname.postgres.database.azure.com port=5432 dbname=citus user=citus password={<PASSWORD>} sslmode=require
```
Kopieren Sie die Zeichenfolge. Sie müssen „{your\_password}“ durch das Administratorkennwort ersetzen, das Sie weiter oben ausgewählt haben. Das System speichert Ihr Kennwort nicht als Klartext, daher kann es in der Verbindungszeichenfolge nicht angezeigt werden.
2. Öffnen Sie auf Ihrem lokalen Computer ein Terminalfenster.
3. Stellen Sie an der Eingabeaufforderung mit dem Hilfsprogramm [psql](https://www.postgresql.org/docs/current/app-psql.html) eine Verbindung mit Ihrem Azure Database for PostgreSQL-Server her. Übergeben Sie die Verbindungszeichenfolge in Anführungszeichen, und achten Sie darauf, dass sie Ihr Kennwort enthält:
```bash
psql "{connection_string}"
```
Der folgende Befehl stellt z. B. eine Verbindung mit dem Koordinatorknoten der Servergruppe **mydemoserver** her:
```bash
psql "host=mydemoserver-c.postgres.database.azure.com port=5432 dbname=citus user=citus password={<PASSWORD>} sslmode=require"
```
|
markdown
|
<gh_stars>1-10
package com.interview.codechef.ccdsapfoundation_1.slidingwindow;
public class LongestTurbulentArray {
//https://leetcode.com/problems/longest-turbulent-subarray/
public int maxTurbulenceSize( int[] A ) {
int i = 0, max = 0, len = 0;
while (i + 1 < A.length) {
if ((i % 2 == 0) && A[i] < A[i + 1]) {
len++;
} else if ((i % 2 == 1) && A[i] > A[i + 1]) {
len++;
} else {
len = 0;
}
i++;
max = Math.max(max, len);
}
// or
int i1 = 0, max1 = 0, len1 = 0;
while (i1 + 1 < A.length) {
if ((i1 % 2 == 0) && A[i1] > A[i1 + 1]) {
len1++;
} else if ((i1 % 2 == 1) && A[i1] < A[i1 + 1]) {
len1++;
} else {
len1 = 0;
}
i1++;
max1 = Math.max(max1, len1);
}
return Math.max(max, max1) + 1; //+1 for starting element zero index
}
}
|
java
|
Match 6 of the ECS T10 Kummerfeld League 2020 pits PSV Hann Munden against SC Europa Cricket at the Kummerfeld Sports Verein. PSV Hann Munden have already played three games on the first day and will have a better understanding of the conditions at the venue.
With a brilliant win against KSV Cricket on Day 1 headlining their campaign so far, PSV look to sustain their bid for a top four finish. Their opponents, SC Europa Cricket, play their first game of the tournament and will be hoping for a win to kick-start their campaign.
With both teams looking for the win, Dream11 fans are in for a treat on Tuesday.
I Amini, M Muhammad, S Darwesh, W Amini, M Herath, M Khan Jr, R Khan, A Sharma, D Khan Aryubi, H Shinwari, I Zazai, U Farooq, B Shinwari, D Rana, I Khan Jr, S Ahmad, V Thakar, G Akbar Dargey, A Soni, A Wajid Khan.
The bowlers have been rampant in the tournament with extra bounce and pace on offer. While the spinners haven't got much help from the pitch, the pacers should be key to either's side success with batsmen having to keep their attacking instincts at bay early on. 75-80 should be a match-winning total on this surface with both sides looking to field upon winning the toss.
|
english
|
What's the story?
Tonight at Fyter Fest, All Elite Wrestling Superstar Cody Rhodes was on the receiving end of a brutal chair shot to the head, courtesy Shawn Spears aka Tye Dillinger.
AEW has just posted a photo update on Cody, stating that he hasn't suffered a concussion.
AEW EVP and wrestler Cody Rhodes faced Darby Allin at tonight's Fyter Fest event. The mind games began almost immediately, as Allin brought in a body bag to the ring with "Cody 1-1" spray-painted on it.
A thunderous Cross Rhodes led to Cody attempting a pin on Allin, but he missed the three-count by a second, as the 20-minute time limit prevented him from winning the match.
Suddenly, Shawn Spears came to the ring and hit Cody with a chair shot to the head. Spears stared at Brandi before making his way out of the ring. A string of wrestlers came out to check on Cody as he bled profusely.
All Elite Wrestling's official Twitter account has just posted an update on Cody Rhodes. The tweet shows a photo of the back of Cody's head, as he stares at a monitor to watch the show from a backstage area. Rhodes received 12 stitches to contain the opening. Thankfully, he hasn't suffered a concussion and is fine. Here's the tweet posted by AEW:
What's next?
It seems like we are in for a heated rivalry between Cody Rhodes and Shawn Spears. We'll keep you updated as this story develops further.
What was your reaction to Cody getting busted open after the match? Are you a fan of chair shots to the head? Sound off in the comment section!
What's next for The Bloodline?
|
english
|
{"word":"rankly","definition":"With rank or vigorous growth; luxuriantly; hence, coarsely; grossly; as, weeds grow rankly."}
|
json
|
<reponame>hovhannest/Bomberman_SDL
#include "Engine.h"
#ifdef _WIN32
#include <Windows.h>
#include <PathCch.h>
#endif //_WIN32
#include <SDL.h>
#include <SDL_ttf.h>
#include <stdlib.h>
#include <time.h>
#include <string>
#include "Log/Log.h"
#include "Utils/Exception.h"
#include "../Game/Constants.h"
#include "Utils/OperatingSystem.h"
Bomberman::Engine::Engine()
{
SDL_Init(SDL_INIT_EVERYTHING);
TTF_Init();
setPath();
srand(static_cast<unsigned>(time(0)));
}
Bomberman::Engine::~Engine()
{
SDL_Quit();
}
void Bomberman::Engine::setPath()
{
#if defined(_WIN32)
char exePath[MAX_PATH];
int result;
result = GetModuleFileNameA(NULL, exePath, MAX_PATH);
if (ERROR_INSUFFICIENT_BUFFER == result || 0 == result) {
Log::get() << "Could not get executable path" << NativeOperationException();
}
std::string resourcesPath(exePath);
size_t separatorPos = resourcesPath.rfind(dirSeparator);
if (std::string::npos == separatorPos) {
Log::get() << "Executable path is incorrect" << NativeOperationException();
}
resourcesPath.erase(separatorPos + 1); // Do not delete the '\'
resourcesPath.append(Constants::DIR_RESOURCES);
if (!SetCurrentDirectoryA(resourcesPath.c_str())) {
Log::get() << "Could not set resources path" << NativeOperationException();
}
#endif
}
|
cpp
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/captive_portal/content/captive_portal_tab_helper.h"
#include <memory>
#include "base/bind_helpers.h"
#include "base/callback.h"
#include "base/macros.h"
#include "components/captive_portal/content/captive_portal_service.h"
#include "components/captive_portal/content/captive_portal_tab_reloader.h"
#include "components/embedder_support/pref_names.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/testing_pref_service.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/navigation_simulator.h"
#include "content/public/test/test_renderer_host.h"
#include "content/public/test/test_utils.h"
#include "content/public/test/web_contents_tester.h"
#include "net/base/net_errors.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
using content::NavigationSimulator;
namespace captive_portal {
namespace {
const char* const kStartUrl = "http://whatever.com/index.html";
const char* const kHttpUrl = "http://whatever.com/";
const char* const kHttpsUrl = "https://whatever.com/";
// Used for cross-process navigations. Shouldn't actually matter whether this
// is different from kHttpsUrl, but best to keep things consistent.
const char* const kHttpsUrl2 = "https://cross_process.com/";
} // namespace
class MockCaptivePortalTabReloader : public CaptivePortalTabReloader {
public:
MockCaptivePortalTabReloader()
: CaptivePortalTabReloader(nullptr, nullptr, base::Callback<void()>()) {}
MOCK_METHOD1(OnLoadStart, void(bool));
MOCK_METHOD2(OnLoadCommitted, void(int, net::ResolveErrorInfo));
MOCK_METHOD0(OnAbort, void());
MOCK_METHOD1(OnRedirect, void(bool));
MOCK_METHOD2(OnCaptivePortalResults,
void(CaptivePortalResult, CaptivePortalResult));
};
class CaptivePortalTabHelperTest : public content::RenderViewHostTestHarness {
public:
CaptivePortalTabHelperTest()
: mock_reloader_(new testing::StrictMock<MockCaptivePortalTabReloader>) {}
~CaptivePortalTabHelperTest() override {}
void SetUp() override {
content::RenderViewHostTestHarness::SetUp();
pref_service_.registry()->RegisterBooleanPref(
embedder_support::kAlternateErrorPagesEnabled, true);
captive_portal_service_ = std::make_unique<CaptivePortalService>(
browser_context(), &pref_service_);
// Load kStartUrl. This ensures that any subsequent navigation to kHttpsUrl2
// will be properly registered as cross-process. It should be different than
// the rest of the URLs used, otherwise unit tests will clasify navigations
// as same document ones, which would be incorrect.
content::WebContentsTester* web_contents_tester =
content::WebContentsTester::For(web_contents());
web_contents_tester->NavigateAndCommit(GURL(kStartUrl));
tab_helper_.reset(new CaptivePortalTabHelper(
web_contents(), captive_portal_service_.get(), base::DoNothing()));
tab_helper_->SetTabReloaderForTest(mock_reloader_);
}
void TearDown() override {
tab_helper_.reset();
captive_portal_service_.reset();
content::RenderViewHostTestHarness::TearDown();
}
// Simulates a successful load of |url|.
void SimulateSuccess(const GURL& url) {
EXPECT_CALL(mock_reloader(), OnLoadStart(url.SchemeIsCryptographic()))
.Times(1);
auto navigation = content::NavigationSimulator::CreateBrowserInitiated(
url, web_contents());
navigation->Start();
EXPECT_CALL(mock_reloader(),
OnLoadCommitted(net::OK, net::ResolveErrorInfo(net::OK)))
.Times(1);
navigation->Commit();
}
// Simulates a connection timeout while requesting |url|.
void SimulateTimeout(const GURL& url) {
EXPECT_CALL(mock_reloader(), OnLoadStart(url.SchemeIsCryptographic()))
.Times(1);
auto navigation = content::NavigationSimulator::CreateBrowserInitiated(
url, web_contents());
navigation->Fail(net::ERR_TIMED_OUT);
EXPECT_CALL(
mock_reloader(),
OnLoadCommitted(net::ERR_TIMED_OUT, net::ResolveErrorInfo(net::OK)))
.Times(1);
navigation->CommitErrorPage();
}
// Simulates a secure DNS network error while requesting |url|.
void SimulateSecureDnsNetworkError(const GURL& url) {
EXPECT_CALL(mock_reloader(), OnLoadStart(url.SchemeIsCryptographic()))
.Times(1);
auto navigation = content::NavigationSimulator::CreateBrowserInitiated(
url, web_contents());
navigation->SetResolveErrorInfo({net::ERR_CERT_COMMON_NAME_INVALID,
true /* is_secure_network_error */});
navigation->Fail(net::ERR_NAME_NOT_RESOLVED);
EXPECT_CALL(mock_reloader(),
OnLoadCommitted(net::ERR_NAME_NOT_RESOLVED,
net::ResolveErrorInfo(
net::ERR_CERT_COMMON_NAME_INVALID, true)))
.Times(1);
navigation->CommitErrorPage();
}
// Simulates an abort while requesting |url|.
void SimulateAbort(const GURL& url) {
EXPECT_CALL(mock_reloader(), OnLoadStart(url.SchemeIsCryptographic()))
.Times(1);
auto navigation = content::NavigationSimulator::CreateBrowserInitiated(
url, web_contents());
navigation->Start();
EXPECT_CALL(mock_reloader(), OnAbort()).Times(1);
navigation->Fail(net::ERR_ABORTED);
// Make sure that above call resulted in abort, for tests that continue
// after the abort.
EXPECT_CALL(mock_reloader(), OnAbort()).Times(0);
}
// Simulates an abort while loading an error page.
void SimulateAbortTimeout(const GURL& url) {
EXPECT_CALL(mock_reloader(), OnLoadStart(url.SchemeIsCryptographic()))
.Times(1);
auto navigation = content::NavigationSimulator::CreateBrowserInitiated(
url, web_contents());
navigation->Start();
EXPECT_CALL(mock_reloader(), OnAbort()).Times(1);
navigation->Fail(net::ERR_TIMED_OUT);
navigation->AbortCommit();
// Make sure that above call resulted in abort, for tests that continue
// after the abort.
EXPECT_CALL(mock_reloader(), OnAbort()).Times(0);
}
CaptivePortalTabHelper* tab_helper() { return tab_helper_.get(); }
// Simulates a captive portal redirect by calling the Observe method.
void ObservePortalResult(CaptivePortalResult previous_result,
CaptivePortalResult result) {
CaptivePortalService::Results results;
results.previous_result = previous_result;
results.result = result;
EXPECT_CALL(mock_reloader(),
OnCaptivePortalResults(previous_result, result))
.Times(1);
tab_helper()->Observe(results);
}
MockCaptivePortalTabReloader& mock_reloader() { return *mock_reloader_; }
void SetIsLoginTab() { tab_helper()->SetIsLoginTab(); }
private:
TestingPrefServiceSimple pref_service_;
std::unique_ptr<CaptivePortalService> captive_portal_service_;
std::unique_ptr<CaptivePortalTabHelper> tab_helper_;
// Owned by |tab_helper_|.
testing::StrictMock<MockCaptivePortalTabReloader>* mock_reloader_;
DISALLOW_COPY_AND_ASSIGN(CaptivePortalTabHelperTest);
};
TEST_F(CaptivePortalTabHelperTest, HttpSuccess) {
SimulateSuccess(GURL(kHttpUrl));
}
TEST_F(CaptivePortalTabHelperTest, HttpTimeout) {
SimulateTimeout(GURL(kHttpUrl));
}
TEST_F(CaptivePortalTabHelperTest, HttpsSuccess) {
SimulateSuccess(GURL(kHttpsUrl));
EXPECT_FALSE(tab_helper()->IsLoginTab());
}
TEST_F(CaptivePortalTabHelperTest, HttpsTimeout) {
SimulateTimeout(GURL(kHttpsUrl));
// Make sure no state was carried over from the timeout.
SimulateSuccess(GURL(kHttpsUrl));
EXPECT_FALSE(tab_helper()->IsLoginTab());
}
TEST_F(CaptivePortalTabHelperTest, HttpsSecureDnsNetworkError) {
SimulateSecureDnsNetworkError(GURL(kHttpsUrl));
// Make sure no state was carried over from the secure DNS network error.
SimulateSuccess(GURL(kHttpsUrl));
EXPECT_FALSE(tab_helper()->IsLoginTab());
}
TEST_F(CaptivePortalTabHelperTest, HttpsAbort) {
SimulateAbort(GURL(kHttpsUrl));
// Make sure no state was carried over from the abort.
SimulateSuccess(GURL(kHttpsUrl));
EXPECT_FALSE(tab_helper()->IsLoginTab());
}
// A cross-process navigation is aborted by a same-site navigation.
TEST_F(CaptivePortalTabHelperTest, AbortCrossProcess) {
SimulateAbort(GURL(kHttpsUrl2));
// Make sure no state was carried over from the abort.
SimulateSuccess(GURL(kHttpUrl));
EXPECT_FALSE(tab_helper()->IsLoginTab());
}
// Abort while there's a provisional timeout error page loading.
TEST_F(CaptivePortalTabHelperTest, HttpsAbortTimeout) {
SimulateAbortTimeout(GURL(kHttpsUrl));
// Make sure no state was carried over from the timeout or the abort.
SimulateSuccess(GURL(kHttpsUrl));
EXPECT_FALSE(tab_helper()->IsLoginTab());
}
// Abort a cross-process navigation while there's a provisional timeout error
// page loading.
TEST_F(CaptivePortalTabHelperTest, AbortTimeoutCrossProcess) {
SimulateAbortTimeout(GURL(kHttpsUrl2));
// Make sure no state was carried over from the timeout or the abort.
SimulateSuccess(GURL(kHttpsUrl));
EXPECT_FALSE(tab_helper()->IsLoginTab());
}
// Opposite case from above - a same-process error page is aborted in favor of
// a cross-process one.
TEST_F(CaptivePortalTabHelperTest, HttpsAbortTimeoutForCrossProcess) {
SimulateSuccess(GURL(kHttpsUrl));
SimulateAbortTimeout(GURL(kHttpsUrl));
// Make sure no state was carried over from the timeout or the abort.
SimulateSuccess(GURL(kHttpsUrl2));
EXPECT_FALSE(tab_helper()->IsLoginTab());
}
// A provisional same-site navigation is interrupted by a cross-process
// navigation without sending an abort first.
TEST_F(CaptivePortalTabHelperTest, UnexpectedProvisionalLoad) {
GURL same_site_url = GURL(kHttpUrl);
GURL cross_process_url = GURL(kHttpsUrl2);
// A same-site load for the original RenderViewHost starts.
EXPECT_CALL(mock_reloader(),
OnLoadStart(same_site_url.SchemeIsCryptographic()))
.Times(1);
std::unique_ptr<NavigationSimulator> same_site_navigation =
NavigationSimulator::CreateRendererInitiated(same_site_url, main_rfh());
same_site_navigation->Start();
same_site_navigation->ReadyToCommit();
// It's unexpectedly interrupted by a cross-process navigation, which starts
// navigating before the old navigation cancels.
EXPECT_CALL(mock_reloader(), OnAbort()).Times(1);
EXPECT_CALL(mock_reloader(),
OnLoadStart(cross_process_url.SchemeIsCryptographic()))
.Times(1);
std::unique_ptr<NavigationSimulator> cross_process_navigation =
NavigationSimulator::CreateBrowserInitiated(cross_process_url,
web_contents());
cross_process_navigation->Start();
// The cross-process navigation fails.
cross_process_navigation->Fail(net::ERR_FAILED);
EXPECT_CALL(mock_reloader(),
OnLoadCommitted(net::ERR_FAILED, net::ResolveErrorInfo(net::OK)))
.Times(1);
cross_process_navigation->CommitErrorPage();
}
// Similar to the above test, except the original RenderViewHost manages to
// commit before its navigation is aborted.
TEST_F(CaptivePortalTabHelperTest, UnexpectedCommit) {
GURL same_site_url = GURL(kHttpUrl);
GURL cross_process_url = GURL(kHttpsUrl2);
// A same-site load for the original RenderViewHost starts.
EXPECT_CALL(mock_reloader(),
OnLoadStart(same_site_url.SchemeIsCryptographic()))
.Times(1);
std::unique_ptr<NavigationSimulator> same_site_navigation =
NavigationSimulator::CreateRendererInitiated(same_site_url, main_rfh());
same_site_navigation->ReadyToCommit();
// It's unexpectedly interrupted by a cross-process navigation, which starts
// navigating before the old navigation commits.
EXPECT_CALL(mock_reloader(), OnAbort()).Times(1);
EXPECT_CALL(mock_reloader(),
OnLoadStart(cross_process_url.SchemeIsCryptographic()))
.Times(1);
std::unique_ptr<NavigationSimulator> cross_process_navigation =
NavigationSimulator::CreateBrowserInitiated(cross_process_url,
web_contents());
cross_process_navigation->Start();
// The cross-process navigation fails.
cross_process_navigation->Fail(net::ERR_FAILED);
// The same-site navigation succeeds.
EXPECT_CALL(mock_reloader(), OnAbort()).Times(1);
EXPECT_CALL(mock_reloader(),
OnLoadStart(same_site_url.SchemeIsCryptographic()))
.Times(1);
EXPECT_CALL(mock_reloader(),
OnLoadCommitted(net::OK, net::ResolveErrorInfo(net::OK)))
.Times(1);
same_site_navigation->Commit();
}
// Simulates navigations for a number of subframes, and makes sure no
// CaptivePortalTabHelper function is called.
TEST_F(CaptivePortalTabHelperTest, HttpsSubframe) {
GURL url = GURL(kHttpsUrl);
content::RenderFrameHostTester* rfh_tester =
content::RenderFrameHostTester::For(main_rfh());
content::RenderFrameHost* subframe1 = rfh_tester->AppendChild("subframe1");
// Normal load.
NavigationSimulator::NavigateAndCommitFromDocument(url, subframe1);
// Timeout.
content::RenderFrameHost* subframe2 = rfh_tester->AppendChild("subframe2");
NavigationSimulator::NavigateAndFailFromDocument(url, net::ERR_TIMED_OUT,
subframe2);
// Abort.
content::RenderFrameHost* subframe3 = rfh_tester->AppendChild("subframe3");
NavigationSimulator::NavigateAndFailFromDocument(url, net::ERR_ABORTED,
subframe3);
}
// Simulates a subframe erroring out at the same time as a provisional load,
// but with a different error code. Make sure the TabHelper sees the correct
// error.
TEST_F(CaptivePortalTabHelperTest, HttpsSubframeParallelError) {
if (content::AreAllSitesIsolatedForTesting()) {
// http://crbug.com/674734 Fix this test with Site Isolation
return;
}
// URL used by both frames.
GURL url = GURL(kHttpsUrl);
content::RenderFrameHostTester* rfh_tester =
content::RenderFrameHostTester::For(main_rfh());
content::RenderFrameHost* subframe = rfh_tester->AppendChild("subframe");
// Loads start.
EXPECT_CALL(mock_reloader(), OnLoadStart(url.SchemeIsCryptographic()))
.Times(1);
std::unique_ptr<NavigationSimulator> main_frame_navigation =
NavigationSimulator::CreateRendererInitiated(url, main_rfh());
std::unique_ptr<NavigationSimulator> subframe_navigation =
NavigationSimulator::CreateRendererInitiated(url, subframe);
main_frame_navigation->Start();
subframe_navigation->Start();
// Loads return errors.
main_frame_navigation->Fail(net::ERR_UNEXPECTED);
subframe_navigation->Fail(net::ERR_TIMED_OUT);
// Error page load finishes.
subframe_navigation->CommitErrorPage();
EXPECT_CALL(mock_reloader(), OnLoadCommitted(net::ERR_UNEXPECTED,
net::ResolveErrorInfo(net::OK)))
.Times(1);
main_frame_navigation->CommitErrorPage();
}
// Simulates an HTTP to HTTPS redirect, which then times out.
TEST_F(CaptivePortalTabHelperTest, HttpToHttpsRedirectTimeout) {
GURL http_url(kHttpUrl);
EXPECT_CALL(mock_reloader(), OnLoadStart(false)).Times(1);
std::unique_ptr<NavigationSimulator> navigation =
NavigationSimulator::CreateRendererInitiated(http_url, main_rfh());
navigation->Start();
GURL https_url(kHttpsUrl);
EXPECT_CALL(mock_reloader(), OnRedirect(true)).Times(1);
navigation->Redirect(https_url);
navigation->Fail(net::ERR_TIMED_OUT);
EXPECT_CALL(mock_reloader(), OnLoadCommitted(net::ERR_TIMED_OUT,
net::ResolveErrorInfo(net::OK)))
.Times(1);
navigation->CommitErrorPage();
}
// Simulates an HTTPS to HTTP redirect.
TEST_F(CaptivePortalTabHelperTest, HttpsToHttpRedirect) {
GURL https_url(kHttpsUrl);
EXPECT_CALL(mock_reloader(), OnLoadStart(https_url.SchemeIsCryptographic()))
.Times(1);
std::unique_ptr<NavigationSimulator> navigation =
NavigationSimulator::CreateRendererInitiated(https_url, main_rfh());
navigation->Start();
GURL http_url(kHttpUrl);
EXPECT_CALL(mock_reloader(), OnRedirect(http_url.SchemeIsCryptographic()))
.Times(1);
navigation->Redirect(http_url);
EXPECT_CALL(mock_reloader(),
OnLoadCommitted(net::OK, net::ResolveErrorInfo(net::OK)))
.Times(1);
navigation->Commit();
}
// Simulates an HTTP to HTTP redirect.
TEST_F(CaptivePortalTabHelperTest, HttpToHttpRedirect) {
GURL http_url(kHttpUrl);
EXPECT_CALL(mock_reloader(), OnLoadStart(http_url.SchemeIsCryptographic()))
.Times(1);
std::unique_ptr<NavigationSimulator> navigation =
NavigationSimulator::CreateRendererInitiated(http_url, main_rfh());
navigation->Start();
EXPECT_CALL(mock_reloader(), OnRedirect(http_url.SchemeIsCryptographic()))
.Times(1);
navigation->Redirect(http_url);
EXPECT_CALL(mock_reloader(),
OnLoadCommitted(net::OK, net::ResolveErrorInfo(net::OK)))
.Times(1);
navigation->Commit();
}
// Tests that a subframe redirect doesn't reset the timer to kick off a captive
// portal probe for the main frame if the main frame request is taking too long.
TEST_F(CaptivePortalTabHelperTest, SubframeRedirect) {
GURL http_url(kHttpUrl);
content::RenderFrameHostTester* rfh_tester =
content::RenderFrameHostTester::For(main_rfh());
content::RenderFrameHost* subframe = rfh_tester->AppendChild("subframe");
std::unique_ptr<NavigationSimulator> main_frame_navigation =
NavigationSimulator::CreateRendererInitiated(http_url, main_rfh());
std::unique_ptr<NavigationSimulator> subframe_navigation =
NavigationSimulator::CreateRendererInitiated(http_url, subframe);
EXPECT_CALL(mock_reloader(), OnLoadStart(false)).Times(1);
main_frame_navigation->Start();
subframe_navigation->Start();
GURL https_url(kHttpsUrl);
subframe_navigation->Redirect(https_url);
EXPECT_CALL(mock_reloader(),
OnLoadCommitted(net::OK, net::ResolveErrorInfo(net::OK)))
.Times(1);
main_frame_navigation->Commit();
}
TEST_F(CaptivePortalTabHelperTest, LoginTabLogin) {
EXPECT_FALSE(tab_helper()->IsLoginTab());
SetIsLoginTab();
EXPECT_TRUE(tab_helper()->IsLoginTab());
ObservePortalResult(RESULT_INTERNET_CONNECTED, RESULT_INTERNET_CONNECTED);
EXPECT_FALSE(tab_helper()->IsLoginTab());
}
TEST_F(CaptivePortalTabHelperTest, LoginTabError) {
EXPECT_FALSE(tab_helper()->IsLoginTab());
SetIsLoginTab();
EXPECT_TRUE(tab_helper()->IsLoginTab());
ObservePortalResult(RESULT_INTERNET_CONNECTED, RESULT_NO_RESPONSE);
EXPECT_FALSE(tab_helper()->IsLoginTab());
}
TEST_F(CaptivePortalTabHelperTest, LoginTabMultipleResultsBeforeLogin) {
EXPECT_FALSE(tab_helper()->IsLoginTab());
SetIsLoginTab();
EXPECT_TRUE(tab_helper()->IsLoginTab());
ObservePortalResult(RESULT_INTERNET_CONNECTED, RESULT_BEHIND_CAPTIVE_PORTAL);
EXPECT_TRUE(tab_helper()->IsLoginTab());
ObservePortalResult(RESULT_BEHIND_CAPTIVE_PORTAL,
RESULT_BEHIND_CAPTIVE_PORTAL);
EXPECT_TRUE(tab_helper()->IsLoginTab());
ObservePortalResult(RESULT_NO_RESPONSE, RESULT_INTERNET_CONNECTED);
EXPECT_FALSE(tab_helper()->IsLoginTab());
}
TEST_F(CaptivePortalTabHelperTest, NoLoginTab) {
EXPECT_FALSE(tab_helper()->IsLoginTab());
ObservePortalResult(RESULT_INTERNET_CONNECTED, RESULT_BEHIND_CAPTIVE_PORTAL);
EXPECT_FALSE(tab_helper()->IsLoginTab());
ObservePortalResult(RESULT_BEHIND_CAPTIVE_PORTAL, RESULT_NO_RESPONSE);
EXPECT_FALSE(tab_helper()->IsLoginTab());
ObservePortalResult(RESULT_NO_RESPONSE, RESULT_INTERNET_CONNECTED);
EXPECT_FALSE(tab_helper()->IsLoginTab());
}
} // namespace captive_portal
|
cpp
|
<reponame>anik511/Demo-Website
@import url(https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.4.3/css/mdb.min.css);
/*menu................................*/
.navbar{background:rgba(241, 7, 7, 0.63) !important;}
.nav-item::after{content:'';display:block;width:0px;height:2px;background:rgb(206, 21, 21)!important;transition: 0.2s; }
.nav-item:hover::after{width:100%;}
.navbar-dark .navbar-nav .active > .nav-link, .navbar-dark .navbar-nav .nav-link.active, .navbar-dark .navbar-nav .nav-link.show, .navbar-dark .navbar-nav .show > .nav-link,.navbar-dark .navbar-nav .nav-link:focus, .navbar-dark .navbar-nav .nav-link:hover{color:#fec400;}
.nav-link{padding:15px 5px;transition:0.2s;}
.dropdown-item.active, .dropdown-item:active{color:#212529;}
.dropdown-item:focus, .dropdown-item:hover{color: #D50000;}
.sec1 {
background:linear-gradient(45deg, #689F38 32%, #FFB300 100%);;
}
body{
background:linear-gradient(45deg, #FF6F00 32%, #FFB300 100%);;
}
a {
color: rgb(3, 14, 26) !important;
text-decoration: none !important;
}
a:visited {
text-decoration: none !important;
}
a:active {
text-decoration: underline !important;
}
.border-or {
border-color: #E65100;
background-color: #E65100;
}
.border-or :hover {
border-color: #E65100;
}
.dropdown:hover>.dropdown-menu{display: block; }
.dropdown-width{
width: 300px;
}
.text-1{
text-align: center !important;
margin: 0px 0px 0px 122px;
}
.menu-text{
font-size: 15px;
}
.btn-orange {
color: #fff;
background-color: #FF6D00;
border-color: #FB8C00;
width: 100% !important;
margin: 0px 0px 0px 12px;
}
.btn-black{
margin: 0px 0px 0px 12px;
}
.btn-orange :hover {
color: #fff;
background-color: #FF6F00;
border-color: #FB8C00;
}
.faf {
padding: 20px;
font-size: 30px;
width: 50px;
text-align: center;
text-decoration: none;
}
.fag i{
padding: 9px 4px 4px 4px;
font-size: 23px;
width: 40px;
text-align: center;
text-decoration: none;
margin-bottom: -5px;
background-color: #E64A19;
border-radius: 15%;
color: white;
}
.new-ul {
list-style: none;
font-size: 12px;
}
.new-ul li::before {
content: "\2022";
color: lavender;
font-weight: bold;
display: inline-block;
width: 1em;
margin-left: -1em;
}
.fag :hover{
background-color: #BF360C;
color: white;
}
.text-2{
font-family: 'Roboto Mono', monospace;
}
.i-color{
color: #FB8C00;
}
.fv-circle{
height: 18px;
width: 18px;
border-radius: 50%;
background: #dae0e5;
float: right;
margin: 2px 0px 0px 4px;
font-size: 12px;
text-align: center;
}
.learnMore{
color: #FB8C00;
}
@media screen and (max-width: 990px) {
.marginForsmallScreen{
margin-top: 10px !important;
}
.mr-auto{
margin: 10px 0px 10px 0px;
}
}
/*menu............................ end*/
/* 1st */
.mrtop{
margin-top: 50px;
}
.mrtop1{
margin-bottom: 50px;
background-color: transparent;
}
.letsGo{
color: whitesmoke !important;
}
.mar-up{
margin-top: 40px !important;
}
.img-szfrom{
height: 25%;
width: 100%;
}
#back-v {
background-image: url(../img/erms.png);
background-position: right bottom, left top;
background-repeat: no-repeat, repeat;
background-size: 85%;
padding: 315px 0px 0px 350px;
}
.play-red{
background-color: rgba(236, 13, 13, 0.726);
}
.jumbotron {
margin: -60px 0px 0px -100px;
background-color: transparent;
}
@media screen and (max-width: 1200px){
#back-v {
background-size: 70%;
padding: 420px 0px 0px 350px;
}
.play-red {
margin: -44px 0px 0px -42px;
}
/* .jumbotron {
margin: -350px 0px 0px -166px;
} */
@media screen and (max-width: 990px) {
.mrtop1 {
margin-bottom: 50px;
margin: 0px 0px 0px -96px;
}
#back-v {
padding: 415px 0px 0px 425px !important;
}
.play-red {
margin: -510px 0px 0px -42px;
}
.jumbotron {
background-color: transparent !important;
margin: -325px 0px 0px -166px;
padding: initial
}
@media screen and (max-width: 770px) {
.jumbotron {
background-color: transparent !important;
margin: -265px 0px 0px -166px;
padding: initial
}
.play-red {
margin: -370px 0px 0px -145px;
}
@media screen and (max-width: 520px) {
.mrtop1 {
margin-bottom: 50px;
margin: 0px 0px 0px -55px;
}
#back-v {
padding: 350px 0px 0px 355px !important;
}
.play-red {
margin: -355px 0px 0px -120px;
}
@media screen and (max-width: 480px) {
#back-v {
padding: 350px 0px 0px 300px !important;
}
.play-red {
margin: -224px 0px 0px -154px;
}
}
}
}
}
}
/* card */
.sec2{
background-image: url("../img/baked-beer-cheese-724216.jpg");
/* Create the parallax scrolling effect */
background-attachment: fixed;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
.mr-botom{
margin-bottom: 35px;
}
/* videoback */
header {
position: relative;
background-color: black;
height: 120vh;
min-height: 25rem;
width: 100%;
overflow: hidden;
}
header video {
position: absolute;
top: 50%;
left: 50%;
min-width: 100%;
min-height: 100%;
width: auto;
height: auto;
z-index: 0;
-ms-transform: translateX(-50%) translateY(-50%);
-moz-transform: translateX(-50%) translateY(-50%);
-webkit-transform: translateX(-50%) translateY(-50%);
transform: translateX(-50%) translateY(-50%);
}
header .container {
position: relative;
z-index: 2;
}
header .overlay {
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
background-color: black;
opacity: 0.5;
z-index: 1;
}
@media (pointer: coarse) and (hover: none) {
header {
background: url('https://source.unsplash.com/XT5OInaElMw/1600x900') black no-repeat center center scroll;
}
header video {
display: none;
}
}
/* videoback */
.title:after {
content: "";
display: block;
background-color: #FFD148;
height: 1px;
margin: 1.25rem auto;
width: 100px;
}
.title-text{
font-family: 'Shrikhand', cursive;
font-size: 40px;
}
.title-new{
color: #ffffff ;
}
.title-new p{
color: #ffffff ;
}
.title-1{
margin-bottom: 40px;
padding-top: 60px;
}
.mr-card{
margin-bottom: 20px;
margin-top: 40px;
}
.check-icon{
color: #096115;
}
.cross-icon{
color: #ff0202;
}
.mr-card-img{
margin: -40px 0px 0px 8px;
width: 95%
}
.btn-textcolor {
color: rgb(255, 255, 255) !important;
}
.mr-card-btm{
padding-bottom: 40px;
}
/* card */
/* collaps */
.rgba-stylish-strong{
background-color: #D50000 !important;
}
.rgba-grey-light{
background-color: #FB8C00 !important;
}
/* collaps */
/* Coverflow effect */
/* Coverflow effect */
/* livedemo */
.title1:after {
content: "";
display: block;
text-align: center;
background-color: rgb(255, 0, 0);
height: 1px;
margin: .8rem auto;
width: 200px;
}
.title-text1{
font-family: 'Shrikhand', cursive;
margin-top: 100px;
}
.title-2 {
margin-bottom: 25px;
margin-top: 20px;
color: white;
}
.liveDemo-img{
width: 100%;
margin-top: 60px;
}
.table thead th {
color: rgba(80, 226, 67, 0.966);
}
/* live demo */
/* modal */
/* modal */
/* start footer */
#myFooter {
background-color: #3c3d41;
color: white;
padding-top: 30px;
}
#myFooter .footer-copyright {
background-color: #333333;
padding-top: 3px;
padding-bottom: 3px;
text-align: center;
}
#myFooter .row {
margin-bottom: 60px;
}
#myFooter .navbar-brand {
margin-top: 45px;
height: 65px;
}
#myFooter .footer-copyright p {
margin: 10px;
color: #ccc;
}
#myFooter ul {
list-style-type: none;
padding-left: 0;
line-height: 1.7;
}
#myFooter h5 {
font-size: 18px;
color: white;
font-weight: bold;
margin-top: 30px;
}
#myFooter h2 a{
font-size: 50px;
text-align: center;
color: #fff!important;
}
#myFooter a {
color: #d2d1d1!important;
text-decoration: none!important;
}
#myFooter a:hover,
#myFooter a:focus {
text-decoration: none!important;
color: white!important;
}
#myFooter .social-networks {
text-align: center;
padding-top: 30px;
padding-bottom: 16px;
}
#myFooter .social-networks a {
font-size: 32px;
color: #f9f9f9!important;
padding: 10px;
transition: 0.2s;
}
#myFooter .social-networks a:hover {
text-decoration: none;
}
#myFooter .facebook:hover {
color: #0077e2 !important;
}
.table-dark {
margin: 0px 0px 0px -31px;
}
#myFooter .google:hover {
color: #ef1a1a!important;
}
#myFooter .twitter:hover {
color: #00aced!important;
}
#myFooter .btn {
color: white;
background-color: #d84b6b;
border-radius: 20px;
border: none;
width: 150px;
display: block;
margin: 0 auto;
margin-top: 10px;
line-height: 25px;
}
.btn1{
background-color: #FB8C00 !important;
}
@media screen and (max-width: 767px) {
#myFooter {
text-align: center;
}
}
/* CSS used for positioning the footers at the bottom of the page. */
/* You can remove this. */
.content{
flex: 1 0 auto;
-webkit-flex: 1 0 auto;
min-height: 200px;
}
#myFooter{
flex: 0 0 auto;
-webkit-flex: 0 0 auto;
}
/* end footer */
|
css
|
{"id":"../assets/img/GitHub-Mark-64px.png","dependencies":[{"name":"/Users/jwamin/sandbox.nosync/github/jwamin.github.io/package.json","includedInParent":true,"mtime":1565566105841}],"generated":{"js":"module.exports = \"/99e3644e44d804436038107ea35e61ac.png\";"},"sourceMaps":null,"error":null,"hash":"438c17272c5f0e9f4a6da34d3e4bc5bd","cacheData":{"env":{}}}
|
json
|
<reponame>yzqdev/myblog<filename>myblog-server/src/main/java/com/site/blog/util/UserUtil.java
package com.site.blog.util;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.site.blog.model.entity.AdminUser;
/**
* @author yzq
* @description
* @date:Created time 2021/8/11 22:02
* @modified By:
*/
public class UserUtil {
public static AdminUser getUserByUserCode(int userCode) {
AdminUser u = new AdminUser();
u.setAdminUserId(userCode);
return u.selectOne(new QueryWrapper<>(u));
}
}
|
java
|
against the senior team in October last year.
Bulow and Smith last played for Australia in the Rose Bowl series against New Zealand in 2007, while Britt was dropped after a poor ODI series against England in February last year. Renee Chappell was called up to the national squad for the 2008 Rose Bowl series but did not get a single game.
Eighteen-year old Healy, who is a wicketkeeper like her uncle, the former Test player Ian, said the news of being named in the squad came as a shock. Healy said her uncle had been a willing mentor in her career so far and was always happy to help her out with tips on the game. "Watching him keep for Australia definitely inspired me to do better things when I was younger. Knowing how much work he put in to get to where he wanted definitely helped me learn a few things about how I can better myself as a cricketer," Healy was quoted as saying in the ICC website.
She expected the top four teams - Australia, England, New Zealand and India - to be extremely competitive in the tournament. "However competition could come from any of the other seven sides so it will be a tough tournament for the Australian girls."
Australia preliminary women's World Cup squad: Karen Rolton (capt), Lisa Sthalekar, Alex Blackwell, Kate Blackwell, Melissa Bulow, Kris Britt, Sarah Andrews, Jessica Cameron, Renee Chappell, Leonie Coleman, Lauren Ebsary, Sarah Edwards, Rene Farrell, Jodie Fields, Corinne Hall, Rachel Haynes, Alyssa Healy, Jessica Jonassen, Delissa Kimmince, Shelley Nitschke, Erin Osborne, Ellyse Perry, Kirsten Pike, Leah Poulton,, Emma Sampson, Clea Smith, , Selena Tainton, Jo-Ann Verrall, Elyse Villani, Julie Woerner.
|
english
|
package me.nithanim.gw2api.v2.api.characters;
import me.nithanim.gw2api.v2.common.Item;
@lombok.NoArgsConstructor
@lombok.AllArgsConstructor
@lombok.Getter
@lombok.EqualsAndHashCode
@lombok.ToString
public class Bag {
private int id;
private int size;
private Item[] inventory;
}
|
java
|
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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.kioea.www.zookeeper.curator;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import org.apache.zookeeper.WatchedEvent;
import org.apache.zookeeper.Watcher;
import org.apache.zookeeper.ZooKeeper;
/**
* <p>
* Utility to simulate a ZK session dying. See: <a href="http://wiki.apache.org/hadoop/ZooKeeper/FAQ#A4">ZooKeeper FAQ</a>
* </p>
*
* <blockquote>
* In the case of testing we want to cause a problem, so to explicitly expire a session an
* application connects to ZooKeeper, saves the session id and password, creates another
* ZooKeeper handle with that id and password, and then closes the new handle. Since both
* handles reference the same session, the close on second handle will invalidate the session
* causing a SESSION_EXPIRED on the first handle.
* </blockquote>
*/
public class KillSession
{
/**
* Kill the given ZK session
*
* @param client the client to kill
* @param connectString server connection string
* @throws Exception errors
*/
public static void kill(ZooKeeper client, String connectString) throws Exception
{
kill(client, connectString, new Timing().forWaiting().milliseconds());
}
/**
* Kill the given ZK session
*
* @param client the client to kill
* @param connectString server connection string
* @param maxMs max time ms to wait for kill
* @throws Exception errors
*/
public static void kill(ZooKeeper client, String connectString, int maxMs) throws Exception
{
long startTicks = System.currentTimeMillis();
final CountDownLatch sessionLostLatch = new CountDownLatch(1);
Watcher sessionLostWatch = new Watcher()
{
@Override
public void process(WatchedEvent event)
{
sessionLostLatch.countDown();
}
};
client.exists("/___CURATOR_KILL_SESSION___" + System.nanoTime(), sessionLostWatch);
final CountDownLatch connectionLatch = new CountDownLatch(1);
Watcher connectionWatcher = new Watcher()
{
@Override
public void process(WatchedEvent event)
{
if ( event.getState() == Event.KeeperState.SyncConnected )
{
connectionLatch.countDown();
}
}
};
ZooKeeper zk = new ZooKeeper(connectString, maxMs, connectionWatcher, client.getSessionId(), client.getSessionPasswd());
try
{
if ( !connectionLatch.await(maxMs, TimeUnit.MILLISECONDS) )
{
throw new Exception("KillSession could not establish duplicate session");
}
try
{
zk.close();
}
finally
{
zk = null;
}
while ( client.getState().isConnected() && !sessionLostLatch.await(100, TimeUnit.MILLISECONDS) )
{
long elapsed = System.currentTimeMillis() - startTicks;
if ( elapsed > maxMs )
{
throw new Exception("KillSession timed out waiting for session to expire");
}
}
}
finally
{
if ( zk != null )
{
zk.close();
}
}
}
}
|
java
|
<gh_stars>0
package com.ts89park.tdd;
import com.google.common.annotations.VisibleForTesting;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
public class WebSiteReader {
public String readContentFromLink(final String link) {
StringBuilder builder = new StringBuilder();
try (InputStream urlStream = new URL(link).openStream()) {
builder = getContentFromUrl(urlStream);
} catch (Exception e) {
// Ignore
}
return builder.toString();
}
@VisibleForTesting
public StringBuilder getContentFromUrl(InputStream urlStream) throws Exception {
StringBuilder content = new StringBuilder();
BufferedReader urlReader = new BufferedReader(new InputStreamReader(urlStream));
String line;
while ((line = urlReader.readLine()) != null) {
content.append(" ");
content.append(line);
}
return content;
}
}
|
java
|
With a positive and progressive attitude to customer's interest, our enterprise continually improves our products excellent to meet the wants of customers and further focuses on safety, reliability, environmental requirements, and innovation of Fromage Tray, Black Plastic Dog Bowl, 32oz Dog Bowl, Cat Water Bowl Shallow,Marble Dinnerware Set. Our Enterprise Core Principle: The prestige 1st ;The quality guarantee ;The customer are supreme. The product will supply to all over the world, such as Europe, America, Australia,Philippines, Mecca,Lahore, Poland.We integrate all our advantages to continuously innovate, improve and optimize our industrial structure and product performance. We will always believe in and work on it. Welcome to join us to promote green light, together we will make a better Future!
|
english
|
<reponame>chrisolsen/ui-components
import React, { ChangeEvent, FC } from 'react';
import classnames from 'classnames';
import './radio.scss';
import { TestProps } from '../../experimental/common';
interface Props {
value: string;
label?: string;
name?: string;
disabled?: boolean;
checked?: boolean;
onChange?: (value: string) => void;
}
export const GoARadio: FC<Props & TestProps> = (props) => {
function getCss(): string {
return classnames({
'goa-radio': true,
'goa-radio--disabled': props.disabled,
});
}
function onRadioChange(e: ChangeEvent<HTMLInputElement>) {
props.onChange(e.target.value);
}
return (
<label className={getCss()}>
<input
type="radio"
name={props.name}
value={props.value}
checked={props.checked}
disabled={props.disabled}
onChange={onRadioChange}
/>
<div className='goa-radio-icon'></div>
<span className="goa-radio-label">{props.children || props.label}</span>
</label>
);
};
export default GoARadio;
|
typescript
|
3 Huajca majtacti ten iicnihua José yajque tali Egipto quicohuatij trigo. 4 Pero Jacob amo quicahuili ma yahui Benjamín, inelicni José pampa moilhui nohueli ipantisquía se tamanti cati fiero. 5 Huajca itelpocahua Israel yajque inihuaya nochi sequinoc cati yahuiyayaj tacohuatij pampa campa hueli ipan nochi tali Canaán oncayaya mayanti.
6 Huan José eliyaya gobernador ipan tali Egipto huan yaya cati quinnamaquiltiyaya trigo nochi masehualme cati ajsiyayaj ten campa hueli talme. Huan quema iicnihua José monextijque iixpa, motancuaquetzque huan mohuijtzonque talchi quej momatque tatepanitaj. 7 Huan José quinixmatqui iicnihua quema quinitac, pero quichijqui quej amo quinixmatiyaya. Quincamanalhui ica cualanti huan quinilhui:
―¿Canque anhualahuij?
Huan quiilhuijque:
―Tihualahuij tali Canaán para titacohuaquij.
8 Huan masque José quinixmatqui iicnihua, inijuanti amo quiixmatque. 9 Huan quielnamijqui nopa temicti cati quipixqui ten iicnihua achtohuiya huan quinilhui:
―Amo neli anhualahuij para antacohuase. Anhualajtoque anquiitaquij quenicatza eltoc total huan canica huelis antechtanise.
10 Huan inijuanti quinanquilijque:
―¡Amo, tate! Timotequipanojcahua tihualajtoque tijcohuaquij trigo. 11 Nochi tojuanti tiiconehua san se tacat. Ticuajcualme. Amo quema tiyajtoque ipan se altepet para tijtachilise quenicatza huelis tijtanise.
12 Huan José quiijto:
―¡Amo neli! Anhualahuij para anquiitaquij quenicatza huan canica huelis antechtanise ipan total.
13 Pero inijuanti tananquilijque:
―Timotequipanojcahua tiitztoque 12 tiicnime ica san se tacat huan tiitztoque ipan tali Canaán. Toicni teipan ejquet mocajqui ihuaya totata huan se ayecmo aqui tohuaya.
14 Pero José sempa quinilhui:
―Temachti amojuanti antachiyani, 15 pero ica ya ni tiquitase. Ica itanahuatil Faraón, nitanahuatía para amo huelis anquisase nica hasta ma huala amoicni teipan ejquet. 16 Ma yahui se ten amojuanti para quicuiti. Nopa sequij mocahuase tzactoque. Tiquitase sinta nelía cati anquiijtojtoque. Sinta amo, huajca nijmatis melahuac antachiyaj pampa anquinequij antechtanise.
17 Huan José quintzajqui nochi inijuanti para eyi tonati, 18 pero ica ihualhuictaca quinilhui:
―Na nijtepanita Toteco Dios, huajca xijchihuaca ya ni huan nimechcahuilis anitztose. 19 Sinta nelía ancuajcualme, ma mocahua tzactoc san se ten amojuanti. Huan sequinoc amojuanti xijhuicaca trigo para ma tacuaca amofamilia. 20 Pero monequi techhualiquilica amoicni teipan ejquet para tiquitase sinta anquiijtojtoque cati melahuac. Pero sinta amo, huajca anmiquise.
Huan inijuanti quicualcajque, 21 pero moilhuiyayaj se ica seyoc:
―Melahuac fiero tijchihuilijque toicni. Amo tijtacaquilijque quema tahuel mocuesohuayaya huan techtajtaniyaya ma tijtasojtaca. Huan yeca ama topani eltoc ni cuesoli.
22 Huan Rubén quinilhui:
―Na nimechilhui para amo teno xijchihuilica, pero amo antechcajque huan ama monequi titaxtahuase por imiquilis.
23 Pero amo quimatiyayaj sinta José quimachiliyaya inincamanal pampa José quinnojnotzayaya ica inincamanal egiptome huan seyoc quinixtomiliyaya cati quiijtohua. 24 Huan José mohuejcatali ten iicnihua para amo huelis quiitase huan pejqui choca. Teipa moyoltali huan mocuetqui campa itztoyaj para quincamanalhui. Huan quiiyocaquixti Simeón huan iniixpa quinnahuati itequipanojcahua ma quiilpica. 25 Teipa tanahuati ma quintemitilica inincoxtalhua iicnihua huan ma quicuepilica sese itomi ipan inincoxtal. Nojquiya tanahuati ma quinmacaca tacualisti para ipan ojti. Huan itequipanojcahua quej nopa quichijque. 26 Huan quintamamaltijque ininburrojhua huan quistejque.
27 Huan quema ajsitoj campa tonilisquíaj, se ten inijuanti quitapo icoxtal para quitamacas iburro huan quiitac itomi eltoya icoxtalijtic. 28 Huajca quinilhui iicnihua:
―¡Xiquitaca nechcuepilijque notomi! ¡Nica eltoc ipan nocoxtal!
Huan nochi momajmatijque miyac, huan huihuipicayayaj huan moilhuiyayaj se ica seyoc:
―¿Taya techchihuilijtoc Toteco Dios?
29 Huan quema ajsitoj tali Canaán, quipohuilijque inintata, Jacob, nochi cati quinpanotoya, quiilhuijque:
30 ―Nopa tacat cati tanahuatía ipan nopa tali technojnotzqui ica cualanti huan techilhui para san tiyajtoyaj titajtachiyatij ipan ital para huelis tijtanisquíaj. 31 Pero tiquilhuijque para ticuali masehualme huan amo quema tijtajtachilijtoque se tali. 32 Tiquilhuijque para tieliyayaj 12 tiicnime ten san se tacat, huan se ayecmo itztoc tohuaya. Nojquiya tiquilhuijque para nopa teipan ejquet mocajtoya mohuaya ta nica ipan Canaán. 33 Huajca ya techilhui para monequi quiitas sinta nelía ticuajcualme. Quiijto monequi se ten tojuanti ma mocahua nopona huan para nopa sequinoc tojuanti ma tijhualicaca trigo para tofamilias cati mayanaj, 34 pero quiijto teipa monequi tijhuiquilise toicni teipan ejquet. Quej nopa quiijto para melahuac quimatis sinta ticuali masehualme o san titachiyani. Huan quiijto para quej nopa quimajcahuas toicni huan huelis titacohuase ipan ital ica cuali.
35 Huan quema iicnihua José quiixcuetque inincoxtal, quiitaque para ipan sese inincoxtal oncayaya ininpilbolsa ica nopa tomi cati quihuicatoyaj. Huajca inijuanti huan inintata momajmatijque. 36 Huan Jacob quinilhui:
―Antechquixtilise nochi noconehua. José ayecmo aqui tohuaya, Simeón nojquiya, huan ama antechquixtilise Benjamín. Amo teno quisa cuali para na.
37 Huajca Rubén quiilhui itata:
―Xijcahua Benjamín ma yahui. Huan nijmocuitahuis huan nimitzcuepilis. Sinta amo nimitzcuepilis, huelis tiquinmictis nochi ome noconehua.
38 Pero Jacob quiilhui:
―Nocone amo yas amohuaya. Iicni ya mijqui huan san ya mocahua. Sinta ipantis cati fiero ipan ojti, antechchihuilise ma nihuehuejmiqui ica tequipacholi.
|
english
|
<gh_stars>0
package com.fjx.prize.job.task;
import com.fjx.prize.commons.db.entity.*;
import com.fjx.prize.commons.config.RedisKeys;
import com.fjx.prize.commons.db.entity.*;
import com.fjx.prize.commons.db.mapper.CardGameMapper;
import com.fjx.prize.commons.db.mapper.CardGameProductMapper;
import com.fjx.prize.commons.db.mapper.CardGameRulesMapper;
import com.fjx.prize.commons.db.mapper.GameLoadMapper;
import com.fjx.prize.commons.utils.RedisUtil;
import com.fjx.prize.job.annotation.ElasticSimpleJob;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import org.apache.commons.lang3.time.DateUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.*;
/**
1. 活动开始前一分钟扫描所有要开始的活动
2. 将活动信息加载进redis
3. 将活动策略信息加载进redis
4. 按活动奖品信息,生成对应的个数的时间戳做令牌,从小到大排好顺序,右侧入队
5. 以令牌为key,对应的奖品为value,建立映射关系,为中奖后获取奖品做准备
6.抽奖开始,从令牌队列左侧获取令牌
7.如果令牌小于当前时间,说明中奖,找到令牌对应的奖品,抽走即可
8.如果令牌大于当前时间,说明未中奖,从左侧将令牌还回队列
* 活动信息预热,每隔1分钟执行一次
* 查找未来1分钟内(含),要开始的活动
*/
@Component
@ElasticSimpleJob(cron = "0 * * * * ?")
public class GameTask implements SimpleJob {
private final static Logger log = LoggerFactory.getLogger(GameTask.class);
@Autowired
private CardGameMapper gameMapper;
@Autowired
private CardGameProductMapper gameProductMapper;
@Autowired
private CardGameRulesMapper gameRulesMapper;
@Autowired
private GameLoadMapper gameLoadMapper;
@Autowired
private RedisUtil redisUtil;
@Override
public void execute(ShardingContext shardingContext) {
// 当前时间,进入方法的第一个时间,代码执行存在一定的时间,如果到了毫秒级别就会出错,所以当前时间一定是要在进入方法时的时间。
Date now = new Date();
// 创建活动对象
CardGameExample example = new CardGameExample();
// 查询将来1分钟内要开始的活动 (Criteria : 是一个查询构建器)
CardGameExample.Criteria criteria = example.createCriteria();
// 开始时间大于当前时间 (andStarttimeGreaterThan :由三部分组成,分别是java 代码的中and + 实体类中的字段Starttime + GreaterThan)
criteria.andStarttimeGreaterThan(now);
// 开始时间小于等于(当前时间+1分钟) LessThanOrEqualTo :小于等于
// 这两段代码 就是开始时间大于当前时间,小于等于(当前时间+一分钟)
criteria.andStarttimeLessThanOrEqualTo(DateUtils.addMinutes(now,1));
// 获取活动列表
List<CardGame> list = gameMapper.selectByExample(example);
if(list.size() == 0){
//没有查到要开始的活动
log.info("活动个数 = 0");
return;
}
// 查询到有将要开始的活动
log.info("活动个数 = {}",list.size());
// 有相关活动数据,则将活动数据预热,进redis
list.forEach(game ->{
//活动开始时间
long start = game.getStarttime().getTime();
//活动结束时间
long end = game.getEndtime().getTime();
//计算活动结束时间到现在还有多少秒,作为redis key过期时间
long expire = (end - now.getTime())/1000;
// long expire = -1; //永不过期
//活动持续时间(ms)
long duration = end - start;
//活动基本信息,将活动状态设为1 表示已经加载,此时才可以将活动信息加载到redis缓存中
game.setStatus(1);
redisUtil.set(RedisKeys.INFO+game.getId(),game,-1);
log.info("加载活动信息:{},{},{},{}", game.getId(),game.getTitle(),game.getStarttime(),game.getEndtime());
// 根据活动id,加载活动奖品信息
List<CardProductDto> products = gameLoadMapper.getByGameId(game.getId());
Map<Integer, CardProduct> productMap = new HashMap<>(products.size());
// 将奖品的id 和奖品的详细信息 以k-v 形式存放子productMap中
products.forEach(product -> productMap.put(product.getId(),product));
log.info("加载活动奖品信息:{}",productMap.size());
//奖品数量等配置信息(活动id +商品id + 商品数量)
CardGameProductExample productExample = new CardGameProductExample();
productExample.createCriteria().andGameidEqualTo(game.getId());
// 获取活动id +奖品id +奖品数量的中间表
List<CardGameProduct> gameProducts = gameProductMapper.selectByExample(productExample);
log.info("load bind product:{}",gameProducts.size());
//令牌桶,令牌是一个long 类型的时间戳
List<Long> tokenList = new ArrayList();
gameProducts.forEach(cgp ->{
// amount 是奖品的个数 ,有多个个奖品就有多少个令牌,一个令牌对应一个奖品
// 生成amount个start到end之间的随机时间戳做令牌
for (int i = 0; i < cgp.getAmount(); i++) {
// rnd = 活动的开始时间+活动的持续时间内的一个随机时间,此时就是一个令牌,代表该时刻发放一个奖品
// 此时存在一个问题,如果活动持续时间很短,但是奖品的数量很多,就会造成相同的时间有多个奖品,这就存在问题了
long rnd = start + new Random().nextInt((int)duration);
// 为什么乘1000,再额外加一个随机数呢? - 防止时间段奖品多时重复
// 记得取令牌判断时间时,除以1000,还原真正的时间戳
long token = rnd * 1000 + new Random().nextInt(999);
// 将令牌放入令牌桶,此时令牌桶内的令牌是无序的
tokenList.add(token);
// 以令牌做key,对应的商品为value,创建redis缓存
log.info("令牌 -> 活动名称 : {} -> {}",token/1000 ,productMap.get(cgp.getProductid()).getName());
// token到实际奖品之间建立映射关系
// 以活动id+令牌为key,以商品的详细信息作为value
redisUtil.set(RedisKeys.TOKEN + game.getId() +"_"+token,productMap.get(cgp.getProductid()),expire);
}
});
//排序后放入redis队列
Collections.sort(tokenList);
log.info("加载排序好的令牌:{}",tokenList);
// 从右侧压入队列,从左到右,时间戳逐个增大
redisUtil.rightPushAll(RedisKeys.TOKENS + game.getId(),tokenList);
// 设置令牌的过期时间
redisUtil.expire(RedisKeys.TOKENS + game.getId(),expire);
//加载活动的奖品策略配置信息
CardGameRulesExample rulesExample = new CardGameRulesExample();
rulesExample.createCriteria().andGameidEqualTo(game.getId());
List<CardGameRules> rules = gameRulesMapper.selectByExample(rulesExample);
// 遍历策略,存入redis hset ,以活动id为组,用户等级为key,用户最大中奖次数或可抽奖次数为value
// 不同等级的会员,可抽奖次数和最大中奖次数不同
rules.forEach(r -> {
// 最大中奖次数
redisUtil.hset(RedisKeys.MAXGOAL +game.getId(),r.getUserlevel()+"",r.getGoalTimes());
// 可抽奖的次数
redisUtil.hset(RedisKeys.MAXENTER +game.getId(),r.getUserlevel()+"",r.getEnterTimes());
log.info("加载活动规则:会员级别={},可抽奖此处={},最大中奖数={}",r.getUserlevel(),r.getEnterTimes(),r.getGoalTimes());
});
// 设置过期时间
redisUtil.expire(RedisKeys.MAXGOAL +game.getId(),expire);
redisUtil.expire(RedisKeys.MAXENTER +game.getId(),expire);
//活动状态变更为已预热,禁止管理后台再随便变动
game.setStatus(1);
gameMapper.updateByPrimaryKey(game);
});
}
}
|
java
|
<filename>dev/isct_propseg/documentation/html/correction_tips.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>sct_segmentation_propagation: Correction Tips</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="logo_neuropoly.png"/></td>
<td style="padding-left: 0.5em;">
<div id="projectname">sct_segmentation_propagation
 <span id="projectnumber">0.2.4</span>
</div>
<div id="projectbrief">Spinal Cord Segmentation Module</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li class="current"><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Pages</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">Correction Tips </div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>What to do if the propagated segmentation fails or contains local errors ?</p>
<p>Due to contrast variations in MR imaging protocols, the contrast between the spinal cord and the cerebro-spinal fluid (CSF) can differ between MR volumes. Therefore, our propagated segmentation method may fail sometimes in presence of artefact, low contrast, etc. Here above, we propose some protocols to correct some segmentation failures.</p>
<h1><a class="anchor" id="orient"></a>
Bad orientation and lack of CSF</h1>
<p>The computation of the spinal cord orientation, at each iteration of the propagation, can fail in lack of spinal cord/CSF contrast. Particularly, this situation can lead to an local over-segmentation or even to a propagation which has stopped too soon, resulting in a partial spinal cord segmentation.</p>
<p>Two correction protocols can be used to improve the segmentation : <b>add centerline information</b> and <b>correct the image</b></p>
<h2><a class="anchor" id="centerline"></a>
Add the spinal cord centerline</h2>
<p>The spinal cord orientation is computed at each propagation iteration by minimizing/maximizing (depending on the contrast type) the sum of gradient magnitude at vertices positions. Bad contrast or error propagation can make orientation computation difficult.</p>
<p>Centerline information can be provided (using "-init-centerline" parameter) to assure a correct orientation of the propagated deformable model. Spinal cord centerline can be a nifti image, with non-null values on centerline voxels. The orientation of the spinal cord will then be computed using a B-spline approximating the set of points extracted from this input image. Propagation will start at the center of the centerline (this can be change using "-init" parameter) and stop at its edges. Centerline can also be provided by a texte file, where each row contain x, y and z world coordinates (not pixel coordnates) of a point of the spinal cord, from the bottom to the top of the spinal cord.</p>
<h2><a class="anchor" id="image_correct"></a>
Correction of the image</h2>
<p>MR images can sometimes present local absence of contrast, making the spinal cord segmentation impossible. Therefore, this situation can only be resolved by correcting the initial image. FSL View (<a href="http://fsl.fmrib.ox.ac.uk/fsl/fslview/">http://fsl.fmrib.ox.ac.uk/fsl/fslview/</a>) is a powerfull software allowing to easily create a mask or correct an image.</p>
<p>You can enhance the contrast between the spinal ord and the CSF by changing the values of voxels when necessary.</p>
<h1><a class="anchor" id="detect"></a>
Wrong spinal crod detection</h1>
<p>In precence of other circular or elliptical structures in the image and at low contrast-to-noise ratio, the spinal cord detection module can fail. You can verify the detection by using "-detect-display" parameter, writing a PNG axial image with a white cross at the detected spinal cord position.</p>
<p>In case of failure, two choices are possible:</p>
<ol type="1">
<li>You change the starting position of the propagation (and the detection) in the image, by using "-init" parameter. You can provide a fraction (between 0 and 1) of the image in the inferior-superior director or the number of the desired slice.</li>
<li>Using "-init-mask" parameter, you can provide a binary mask (an MR volume, same header than input image) containing three non-null voxel, at the center of the spinal cord, separated by 4-5 mm in the axial direction. The center point will be used as the starting position and the two other point will be used to compute the spinal cord orientation in the top and bottom direction. At the same time, you should provide the initial spinal cord radius approximation using the parameter "-detect-radius". The default value is 4 mm. </li>
</ol>
</div></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 17 2014 16:15:15 for sct_segmentation_propagation by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.6
</small></address>
</body>
</html>
|
html
|
import pytest
import concepts
def test_empty_objects():
with pytest.raises(ValueError, match=r'empty objects'):
concepts.Context((), ('spam',), [(False,)])
def test_empty_properies():
with pytest.raises(ValueError, match=r'empty properties'):
concepts.Context(('spam',), (), [(False,)])
def test_duplicate_object():
with pytest.raises(ValueError, match=r'duplicate objects'):
concepts.Context(('spam', 'spam'),
('ham', 'eggs'),
[(True, False), (False, True)])
def test_duplicate_property():
with pytest.raises(ValueError, match=r'duplicate properties'):
concepts.Context(('spam', 'eggs'),
('ham', 'ham'),
[(True, False), (False, True)])
def test_object_property_overlap():
with pytest.raises(ValueError, match=r'overlap'):
concepts.Context(('spam', 'eggs'),
('eggs', 'ham'),
[(True, False), (False, True)])
def test_invalid_bools_1():
with pytest.raises(ValueError, match=r'bools is not 2 items of length 2'):
concepts.Context(('spam', 'eggs'),
('camelot', 'launcelot'),
[(True, False)])
def test_invalid_bools_2():
with pytest.raises(ValueError, match=r'bools is not 2 items of length 2'):
concepts.Context(('spam', 'eggs'),
('camelot', 'launcelot'),
[(True, False, False), (False, True)])
def test_init():
c = concepts.Context(('spam', 'eggs'),
('camelot', 'launcelot'),
[(True, False), (False, True)])
assert c.objects == ('spam', 'eggs')
assert c.properties == ('camelot', 'launcelot')
assert c.bools == [(True, False), (False, True)]
def test_copy(context):
context = concepts.Context(context.objects,
context.properties,
context.bools)
assert context.lattice is not None
copy = context.copy()
assert copy == context
assert 'lattice' not in copy.__dict__
def test_eq_noncontext(context):
assert not (context == object())
def test_eq_true(context):
assert context == concepts.Context(context.objects,
context.properties,
context.bools)
def test_eq_false(context):
d = context.definition()
d.move_object('3pl', 0)
assert not context == concepts.Context(*d)
def test_ne_concontext(context):
assert context != object()
def test_ne_true(context):
d = context.definition()
d.move_object('3pl', 0)
assert context != concepts.Context(*d)
def test_ne_false(context):
assert not context != concepts.Context(context.objects,
context.properties,
context.bools)
def test_crc32(context):
assert context.crc32() == 'b9d20179' == context.definition().crc32()
def test_minimize_infimum(context):
assert list(context._minimize((), context.properties)) == [context.properties]
def test_raw(context):
Objects = context._Objects # noqa: N806
Properties = context._Properties # noqa: N806
assert context.intension(['1sg', '1pl'], raw=True) == Properties('1001010000')
assert context.extension(['+1', '+sg'], raw=True) == Objects('100000')
assert context.neighbors(['1sg'], raw=True) == \
[(Objects('110000'), Properties('1001010000')),
(Objects('101000'), Properties('0000011001')),
(Objects('100010'), Properties('0001001001'))]
def test_tofile(tmp_path, context, filename='context.cxt', encoding='utf-8'):
filepath = tmp_path / filename
context.tofile(str(filepath), encoding=encoding)
assert filepath.read_text(encoding=encoding) == '''\
B
6
10
1sg
1pl
2sg
2pl
3sg
3pl
+1
-1
+2
-2
+3
-3
+sg
+pl
-sg
-pl
X..X.XX..X
X..X.X.XX.
.XX..XX..X
.XX..X.XX.
.X.XX.X..X
.X.XX..XX.
'''
def test_definition(context):
assert context.definition() == (context.objects,
context.properties,
context.bools)
|
python
|
*{
margin: 0;
padding: 0;
}
.contenedor1{
width: 100%;
margin: 0 auto;
overflow: hidden;
}
body
{
background-color:#23A0D8;
font-family:"Helvetica",Arial;
}#contenido
{
text-align: center;
}
h1
{
color: azure;
}
#textoPr
{
background-color: #076D93;
color: #FFF;
margin: 0 auto;
text-align: center;
border-radius: 20px;
padding: 20px;
box-shadow: 0px 0px 20px rgba(0,0,0,0.80);
}
#textoPro
{
background-color: #076D93;
color: #FFF;
margin: 0 auto;
text-align: center;
border-radius: 20px;
padding: 20px;
box-shadow: 0px 0px 20px rgba(0,0,0,0.80);
}
#table {
text-align: center;
}
button {
border: none;
background: #3a7999;
color: #f2f2f2;
padding: 10px;
font-size: 18px;
border-radius: 15px;
position: relative;
box-sizing: border-box;
transition: all 500ms ease;
}
button:before {
content:'';
position: absolute;
top: 0px;
left: 0px;
width: 100%;
height: 0px;
background: rgba(255,255,255,0.3);
border-radius: 5px;
transition: all 2s ease;
}
button:hover:before {
height: 42px;
}
h2{
text-align: center;
border: none;
background: #3a7999;
color: #f2f2f2;
padding: 30px;
font-size: 18px;
border-radius: 15px;
position: relative;
box-sizing: border-box;
transition: all 500ms ease;
}
a
{
color: black;
font-weight: bold;
}
|
css
|
The hustle and bustle of city life mean people are too busy commuting from one place to another with little time to spare a thought to their surroundings. However, sometimes despite this busyness people do come together to help each other get through an inconvenience. Recently, a few people in Mumbai came together and pushed a bus that was stranded in the middle of the road. A video capturing this moment is winning over netizens.
Twitter user medoh (@medohh777) shared this video Saturday and wrote, “Good morning, So this is the precious moment when those people ignoring the busy schedule and helping eachother for a moment, Doest matter how much you late or upto but helping eachother is all we do! ! ”.
Soon, the video got thousands of views. While retweeting the video, the Mumbai police wrote, “Mumbai Moments – Ctrl+S! The strength of Mumbai is in its every “Mumbaikars” hand Our friend in #Khaki saw it and added extra support to boost the city…#MumbaiDiaries #TogetherWeCan #Mumbaikar #MumbaiVibes #AmchiMumbai #AmchiMumbaiPolice”.
A Twitter user recalled, “Pushed so many random vehicles when we use to go to college . . you just have to ask, mumbai is going to help”.
|
english
|
<reponame>pcwalton/string-cache<filename>src/atom.rs
// Copyright 2014 The Servo Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use phf::PhfMap;
use std::fmt;
use std::hash::{Hash, Hasher, sip};
use std::mem;
use std::ptr;
use std::slice;
use std::slice::bytes;
use std::str;
use std::sync::atomics::{AtomicInt, SeqCst};
use sync::Mutex;
use sync::one::{Once, ONCE_INIT};
use std::rt::heap;
#[path="../shared/static_atom.rs"]
mod static_atom;
// Inline atoms are probably buggy on big-endian architectures.
#[allow(dead_code)]
#[static_assert]
static IS_LITTLE_ENDIAN: bool = cfg!(target_endian = "little");
static mut global_string_cache_ptr: *mut Mutex<StringCache> = 0 as *mut _;
static ENTRY_ALIGNMENT: uint = 16;
// Macro-generated tables for static atoms.
static static_atom_map: PhfMap<&'static str, u32> = static_atom_map!();
static static_atom_array: &'static [&'static str] = static_atom_array!();
// NOTE: Deriving Eq here implies that a given string must always
// be interned the same way.
#[repr(u8)]
#[deriving(Eq, PartialEq)]
enum AtomType {
Dynamic = 0,
Inline = 1,
Static = static_atom::STATIC_TAG,
}
struct StringCache {
hasher: sip::SipHasher,
buckets: [*mut StringCacheEntry, ..4096],
}
struct StringCacheEntry {
next_in_bucket: *mut StringCacheEntry,
hash: u64,
ref_count: AtomicInt,
string: String,
}
impl StringCacheEntry {
fn new(next: *mut StringCacheEntry, hash: u64, string_to_add: &str) -> StringCacheEntry {
StringCacheEntry {
next_in_bucket: next,
hash: hash,
ref_count: AtomicInt::new(1),
string: string_to_add.to_string(),
}
}
}
impl StringCache {
fn new() -> StringCache {
StringCache {
hasher: sip::SipHasher::new(),
buckets: unsafe { mem::zeroed() },
}
}
fn add(&mut self, string_to_add: &str) -> u64 {
let hash = self.hasher.hash(&string_to_add);
let bucket_index = (hash & (self.buckets.len()-1) as u64) as uint;
let mut ptr = self.buckets[bucket_index];
while ptr != ptr::mut_null() {
let value = unsafe { &*ptr };
if value.hash == hash && value.string.as_slice() == string_to_add {
break;
}
ptr = value.next_in_bucket;
}
if ptr == ptr::mut_null() {
unsafe {
ptr = heap::allocate(mem::size_of::<StringCacheEntry>(), ENTRY_ALIGNMENT)
as *mut StringCacheEntry;
ptr::write(ptr,
StringCacheEntry::new(self.buckets[bucket_index], hash, string_to_add));
}
self.buckets[bucket_index] = ptr;
} else {
unsafe {
(*ptr).ref_count.fetch_add(1, SeqCst);
}
}
assert!(ptr != ptr::mut_null());
ptr as u64
}
fn remove(&mut self, key: u64) {
let ptr = key as *mut StringCacheEntry;
let value: &mut StringCacheEntry = unsafe { mem::transmute(ptr) };
if value.ref_count.fetch_sub(1, SeqCst) == 1 {
let bucket_index = (value.hash & (self.buckets.len()-1) as u64) as uint;
let mut current = self.buckets[bucket_index];
let mut prev: *mut StringCacheEntry = ptr::mut_null();
while current != ptr::mut_null() {
if current == ptr {
if prev != ptr::mut_null() {
unsafe { (*prev).next_in_bucket = (*current).next_in_bucket };
} else {
unsafe { self.buckets[bucket_index] = (*current).next_in_bucket };
}
break;
}
prev = current;
unsafe { current = (*current).next_in_bucket };
}
assert!(current != ptr::mut_null());
unsafe {
ptr::read(ptr as *const StringCacheEntry);
heap::deallocate(ptr as *mut u8,
mem::size_of::<StringCacheEntry>(), ENTRY_ALIGNMENT);
}
}
}
}
#[deriving(Eq, Hash, PartialEq)]
pub struct Atom {
/// This field is public so that the `atom!()` macro can use it.
/// You should not otherwise access this field.
pub data: u64,
}
impl Atom {
pub fn from_static(atom_id: u32) -> Atom {
Atom {
data: static_atom::add_tag(atom_id),
}
}
pub fn from_slice(string_to_add: &str) -> Atom {
match static_atom_map.find_equiv(&string_to_add) {
Some(&atom_id) => {
Atom::from_static(atom_id)
},
None => {
if string_to_add.len() < 8 {
Atom::from_inline(string_to_add)
} else {
Atom::from_dynamic(string_to_add)
}
}
}
}
pub fn as_slice<'t>(&'t self) -> &'t str {
let (atom_type, string_len) = self.get_type_and_inline_len();
let ptr = self as *const Atom as *const u8;
match atom_type {
Inline => {
unsafe {
let data = ptr.offset(1) as *const [u8, ..7];
str::raw::from_utf8((*data).slice_to(string_len))
}
},
Static => {
*static_atom_array.get(static_atom::remove_tag(self.data) as uint)
.expect("bad static atom")
},
Dynamic => {
let hash_value = unsafe { &*(self.data as *const StringCacheEntry) };
hash_value.string.as_slice()
}
}
}
#[inline]
fn from_inline(string: &str) -> Atom {
assert!(string.len() < 8);
let mut string_data: u64 = 0;
unsafe { slice::raw::mut_buf_as_slice(&mut string_data as *mut u64 as *mut u8, 7,
|b| bytes::copy_memory(b, string.as_bytes())) };
Atom {
data: (Inline as u64) | (string.len() as u64 << 4) | (string_data << 8),
}
}
#[inline]
fn from_dynamic(string: &str) -> Atom {
static mut START: Once = ONCE_INIT;
unsafe {
START.doit(|| {
let cache = box Mutex::new(StringCache::new());
global_string_cache_ptr = mem::transmute(cache);
});
}
let mut string_cache = unsafe { &*global_string_cache_ptr }.lock();
let hash_value_address = string_cache.add(string);
Atom {
data: hash_value_address | Dynamic as u64
}
}
#[inline]
fn get_type(&self) -> AtomType {
unsafe { mem::transmute((self.data & 0xf) as u8) }
}
#[inline]
fn get_type_and_inline_len(&self) -> (AtomType, uint) {
let atom_type = self.get_type();
let len = match atom_type {
Static | Dynamic => 0,
Inline => ((self.data & 0xf0) >> 4) as uint
};
(atom_type, len)
}
}
impl Clone for Atom {
fn clone(&self) -> Atom {
let atom_type = self.get_type();
match atom_type {
Dynamic => {
let hash_value = unsafe { &mut *(self.data as *mut StringCacheEntry) };
hash_value.ref_count.fetch_add(1, SeqCst);
}
_ => {}
}
Atom {
data: self.data
}
}
}
impl Drop for Atom {
fn drop(&mut self) {
match self.get_type() {
Dynamic => {
let mut string_cache = unsafe { &*global_string_cache_ptr }.lock();
string_cache.remove(self.data);
},
_ => {}
}
}
}
impl fmt::Show for Atom {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "Atom('{:s}' type={:?})", self.as_slice(), self.get_type())
}
}
impl PartialOrd for Atom {
fn partial_cmp(&self, other: &Atom) -> Option<Ordering> {
self.data.partial_cmp(&other.data)
}
fn lt(&self, other: &Atom) -> bool {
if self.data == other.data {
return false;
}
self.as_slice() < other.as_slice()
}
}
impl Ord for Atom {
fn cmp(&self, other: &Atom) -> Ordering {
if self.data == other.data {
return Equal;
}
self.as_slice().cmp(&other.as_slice())
}
}
#[cfg(test)]
mod tests {
use std::task::spawn;
use super::{Atom, Static, Inline, Dynamic};
use test::Bencher;
#[test]
fn test_as_slice() {
let s0 = Atom::from_slice("");
assert!(s0.as_slice() == "");
let s1 = Atom::from_slice("class");
assert!(s1.as_slice() == "class");
let i0 = Atom::from_slice("blah");
assert!(i0.as_slice() == "blah");
let s0 = Atom::from_slice("BLAH");
assert!(s0.as_slice() == "BLAH");
let d0 = Atom::from_slice("zzzzzzzzzz");
assert!(d0.as_slice() == "zzzzzzzzzz");
let d1 = Atom::from_slice("ZZZZZZZZZZ");
assert!(d1.as_slice() == "ZZZZZZZZZZ");
}
#[test]
fn test_types() {
let s0 = Atom::from_slice("");
assert!(s0.get_type_and_inline_len() == (Static, 0));
let s1 = Atom::from_slice("id");
assert!(s1.get_type_and_inline_len() == (Static, 0));
let s1 = Atom::from_slice("body");
assert!(s1.get_type_and_inline_len() == (Static, 0));
// "z" is a static atom
let i0 = Atom::from_slice("c");
assert!(i0.get_type_and_inline_len() == (Inline, 1));
let i1 = Atom::from_slice("zz");
assert!(i1.get_type_and_inline_len() == (Inline, 2));
let i2 = Atom::from_slice("zzz");
assert!(i2.get_type_and_inline_len() == (Inline, 3));
let i3 = Atom::from_slice("zzzz");
assert!(i3.get_type_and_inline_len() == (Inline, 4));
let i4 = Atom::from_slice("zzzzz");
assert!(i4.get_type_and_inline_len() == (Inline, 5));
let i5 = Atom::from_slice("zzzzzz");
assert!(i5.get_type_and_inline_len() == (Inline, 6));
let i6 = Atom::from_slice("zzzzzzz");
assert!(i6.get_type_and_inline_len() == (Inline, 7));
let d0 = Atom::from_slice("zzzzzzzz");
assert!(d0.get_type_and_inline_len() == (Dynamic, 0));
let d1 = Atom::from_slice("zzzzzzzzzzzzz");
assert!(d1.get_type_and_inline_len() == (Dynamic, 0));
}
#[test]
fn test_equality() {
let s0 = Atom::from_slice("fn");
let s1 = Atom::from_slice("fn");
let s2 = Atom::from_slice("loop");
let i0 = Atom::from_slice("blah");
let i1 = Atom::from_slice("blah");
let i2 = Atom::from_slice("blah2");
let d0 = Atom::from_slice("zzzzzzzz");
let d1 = Atom::from_slice("zzzzzzzz");
let d2 = Atom::from_slice("zzzzzzzzz");
assert!(s0 == s1);
assert!(s0 != s2);
assert!(i0 == i1);
assert!(i0 != i2);
assert!(d0 == d1);
assert!(d0 != d2);
assert!(s0 != i0);
assert!(s0 != d0);
assert!(i0 != d0);
}
#[test]
fn ord() {
fn check(x: &str, y: &str) {
assert_eq!(x < y, Atom::from_slice(x) < Atom::from_slice(y));
assert_eq!(x.cmp(&y), Atom::from_slice(x).cmp(&Atom::from_slice(y)));
}
check("a", "body");
check("asdf", "body");
check("zasdf", "body");
check("z", "body");
check("a", "bbbbb");
check("asdf", "bbbbb");
check("zasdf", "bbbbb");
check("z", "bbbbb");
}
#[test]
fn clone() {
let s0 = Atom::from_slice("fn");
let s1 = s0.clone();
let s2 = Atom::from_slice("loop");
let i0 = Atom::from_slice("blah");
let i1 = i0.clone();
let i2 = Atom::from_slice("blah2");
let d0 = Atom::from_slice("zzzzzzzz");
let d1 = d0.clone();
let d2 = Atom::from_slice("zzzzzzzzz");
assert!(s0 == s1);
assert!(s0 != s2);
assert!(i0 == i1);
assert!(i0 != i2);
assert!(d0 == d1);
assert!(d0 != d2);
assert!(s0 != i0);
assert!(s0 != d0);
assert!(i0 != d0);
}
#[test]
fn test_threads() {
for _ in range(0u32, 100u32) {
spawn(proc() {
let _ = Atom::from_slice("a dynamic string");
let _ = Atom::from_slice("another string");
});
}
}
#[bench]
fn bench_strings(b: &mut Bencher) {
let mut strings0 = vec!();
let mut strings1 = vec!();
for _ in range(0u32, 1000u32) {
strings0.push("a");
strings1.push("b");
}
let mut eq_count = 0u32;
b.iter(|| {
for (s0, s1) in strings0.iter().zip(strings1.iter()) {
if s0 == s1 {
eq_count += 1;
}
}
});
}
#[bench]
fn bench_atoms(b: &mut Bencher) {
let mut atoms0 = vec!();
let mut atoms1 = vec!();
for _ in range(0u32, 1000u32) {
atoms0.push(Atom::from_slice("a"));
atoms1.push(Atom::from_slice("b"));
}
let mut eq_count = 0u32;
b.iter(|| {
for (a0, a1) in atoms0.iter().zip(atoms1.iter()) {
if a0 == a1 {
eq_count += 1;
}
}
});
}
#[test]
fn atom_macro() {
assert_eq!(atom!(body), Atom::from_slice("body"));
assert_eq!(atom!("body"), Atom::from_slice("body"));
assert_eq!(atom!("font-weight"), Atom::from_slice("font-weight"));
}
#[test]
fn match_atom() {
assert_eq!(2u, match Atom::from_slice("head") {
atom!(br) => 1u,
atom!(html) | atom!(head) => 2u,
_ => 3u,
});
assert_eq!(3u, match Atom::from_slice("body") {
atom!(br) => 1u,
atom!(html) | atom!(head) => 2u,
_ => 3u,
});
assert_eq!(3u, match Atom::from_slice("zzzzzz") {
atom!(br) => 1u,
atom!(html) | atom!(head) => 2u,
_ => 3u,
});
}
}
|
rust
|
{
"name": "TypeBot",
"version": "1.1.0",
"description": "A typing robot",
"dependencies": {
"johnny-five": "^0.9.19"
},
"author": "<NAME> <<EMAIL>>",
"license": "MIT"
}
|
json
|
"""
Module responsible for translating g2p data into GA4GH native
objects.
"""
import re
import bisect
import rdflib
from rdflib import RDF
import candig.server.exceptions as exceptions
import candig.server.datamodel.sequence_annotations as sequence_annotations
import candig.server.datamodel.genotype_phenotype as g2p
import candig.schemas.protocol as protocol
# annotation keys
TYPE = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'
LABEL = 'http://www.w3.org/2000/01/rdf-schema#label'
HAS_QUALITY = 'http://purl.obolibrary.org/obo/BFO_0000159'
FALDO_LOCATION = "http://biohackathon.org/resource/faldo#location"
FALDO_BEGIN = "http://biohackathon.org/resource/faldo#begin"
FALDO_END = "http://biohackathon.org/resource/faldo#end"
FALDO_POSITION = "http://biohackathon.org/resource/faldo#position"
FALDO_REFERENCE = "http://biohackathon.org/resource/faldo#reference"
MEMBER_OF = 'http://purl.obolibrary.org/obo/RO_0002350'
ASSOCIATION = "http://purl.org/oban/association"
HAS_SUBJECT = "http://purl.org/oban/association_has_subject"
class PhenotypeAssociationFeatureSet(
g2p.G2PUtility, sequence_annotations.Gff3DbFeatureSet):
"""
An rdf object store. The cancer genome database
[Clinical Genomics Knowledge Base]
(http://nif-crawler.neuinfo.org/monarch/ttl/cgd.ttl),
published by the Monarch project, was the source of Evidence.
"""
def __init__(self, parentContainer, localId):
super(PhenotypeAssociationFeatureSet, self).__init__(
parentContainer, localId)
# mimic featureset
def populateFromRow(self, featureSetRecord):
"""
Populates the instance variables of this FeatureSet from the specified
DB row.
"""
self._dbFilePath = featureSetRecord.dataurl
self.setAttributesJson(featureSetRecord.attributes)
self.populateFromFile(self._dbFilePath)
def populateFromFile(self, dataUrl):
"""
Populates the instance variables of this FeatureSet from the specified
data URL.
Initialize dataset, using the passed dict of sources
[{source,format}] see rdflib.parse() for more
If path is set, this backend will load itself
"""
self._dbFilePath = dataUrl
# initialize graph
self._rdfGraph = rdflib.ConjunctiveGraph()
# save the path
self._dataUrl = dataUrl
self._scanDataFiles(self._dataUrl, ['*.ttl'])
# extract version
cgdTTL = rdflib.URIRef("http://data.monarchinitiative.org/ttl/cgd.ttl")
versionInfo = rdflib.URIRef(
'http://www.w3.org/2002/07/owl#versionInfo')
self._version = None
for _, _, obj in self._rdfGraph.triples((cgdTTL, versionInfo, None)):
self._version = obj.toPython()
# setup location cache
self._initializeLocationCache()
# mimic featureset
def getFeature(self, compoundId):
"""
find a feature and return candig representation, use compoundId as
featureId
"""
feature = self._getFeatureById(compoundId.featureId)
feature.id = str(compoundId)
return feature
def _getFeatureById(self, featureId):
"""
find a feature and return candig representation, use 'native' id as
featureId
"""
featureRef = rdflib.URIRef(featureId)
featureDetails = self._detailTuples([featureRef])
feature = {}
for detail in featureDetails:
feature[detail['predicate']] = []
for detail in featureDetails:
feature[detail['predicate']].append(detail['object'])
pbFeature = protocol.Feature()
term = protocol.OntologyTerm()
# Schema for feature only supports one type of `type`
# here we default to first OBO defined
for featureType in sorted(feature[TYPE]):
if "obolibrary" in featureType:
term.term = self._featureTypeLabel(featureType)
term.term_id = featureType
pbFeature.feature_type.MergeFrom(term)
break
pbFeature.id = featureId
# Schema for feature only supports one type of `name` `symbol`
# here we default to shortest for symbol and longest for name
feature[LABEL].sort(key=len)
pbFeature.gene_symbol = feature[LABEL][0]
pbFeature.name = feature[LABEL][-1]
pbFeature.attributes.MergeFrom(protocol.Attributes())
for key in feature:
for val in sorted(feature[key]):
pbFeature.attributes.attr[key].values.add().string_value = val
if featureId in self._locationMap:
location = self._locationMap[featureId]
pbFeature.reference_name = location["chromosome"]
pbFeature.start = location["begin"]
pbFeature.end = location["end"]
return pbFeature
# mimic featureset
def getFeatures(self, referenceName=None, start=None, end=None,
startIndex=None, maxResults=None,
featureTypes=None, parentId=None,
name=None, geneSymbol=None, numFeatures=10):
# query to do search
query = self._filterSearchFeaturesRequest(
referenceName, geneSymbol, name, start, end)
featuresResults = self._rdfGraph.query(query)
featureIds = set()
try:
for row in featuresResults.bindings:
featureIds.add(row['feature'].toPython())
except re.error:
raise exceptions.BadFeatureSetSearchRequestRegularExpression()
if startIndex:
startPosition = int(startIndex)
else:
startPosition = 0
for i, featureId in enumerate(featureIds):
if i < startPosition:
continue
feature = self._getFeatureById(featureId)
# _getFeatureById returns native id, cast to compound
feature.id = self.getCompoundIdForFeatureId(feature.id)
yield feature
def _baseQuery(self):
return """
PREFIX OBAN: <http://purl.org/oban/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT
?feature
?feature_label
WHERE {
?association a OBAN:association .
?association OBAN:association_has_subject ?feature .
?feature rdfs:label ?feature_label .
#%FILTER%
}
ORDER BY ?feature
"""
def _filterSearchFeaturesRequest(self, reference_name, gene_symbol, name,
start, end):
"""
formulate a sparql query string based on parameters
"""
filters = []
query = self._baseQuery()
filters = []
location = self._findLocation(reference_name, start, end)
if location:
filters.append("?feature = <{}>".format(location))
if gene_symbol:
filters.append('regex(?feature_label, "{}")')
if name:
filters.append(
'regex(?feature_label, "{}")'.format(name))
# apply filters
filter = "FILTER ({})".format(' && '.join(filters))
if len(filters) == 0:
filter = ""
query = query.replace("#%FILTER%", filter)
return query
def _findLocation(self, reference_name, start, end):
"""
return a location key form the locationMap
"""
try:
# TODO - sequence_annotations does not have build?
return self._locationMap['hg19'][reference_name][start][end]
except:
return None
def _initializeLocationCache(self):
"""
CGD uses Faldo ontology for locations, it's a bit complicated.
This function sets up an in memory cache of all locations, which
can be queried via:
locationMap[build][chromosome][begin][end] = location["_id"]
"""
# cache of locations
self._locationMap = {}
locationMap = self._locationMap
triples = self._rdfGraph.triples
Ref = rdflib.URIRef
associations = []
for subj, _, _ in triples((None, RDF.type, Ref(ASSOCIATION))):
associations.append(subj.toPython())
locationIds = []
for association in associations:
for _, _, obj in triples((Ref(association),
Ref(HAS_SUBJECT), None)):
locationIds.append(obj.toPython())
locations = []
for _id in locationIds:
location = {}
location["_id"] = _id
for subj, predicate, obj in triples((Ref(location["_id"]),
None, None)):
if not predicate.toPython() in location:
location[predicate.toPython()] = []
bisect.insort(location[predicate.toPython()], obj.toPython())
if FALDO_LOCATION in location:
locations.append(location)
for location in locations:
for _id in location[FALDO_LOCATION]:
# lookup faldo region, ensure positions are sorted
faldoLocation = {}
faldoLocation["_id"] = _id
for subj, predicate, obj in triples((Ref(faldoLocation["_id"]),
None, None)):
if not predicate.toPython() in faldoLocation:
faldoLocation[predicate.toPython()] = []
bisect.insort(faldoLocation[predicate.toPython()],
obj.toPython())
faldoBegins = []
for _id in faldoLocation[FALDO_BEGIN]:
faldoBegin = {}
faldoBegin["_id"] = _id
for subj, predicate, obj in triples(
(Ref(faldoBegin["_id"]),
None, None)):
faldoBegin[predicate.toPython()] = obj.toPython()
faldoBegins.append(faldoBegin)
faldoReferences = []
for _id in faldoLocation[FALDO_BEGIN]:
faldoReference = {}
faldoReference["_id"] = faldoBegin[FALDO_REFERENCE]
for subj, predicate, obj in triples(
(Ref(faldoReference["_id"]),
None, None)):
faldoReference[predicate.toPython()] = obj.toPython()
faldoReferences.append(faldoReference)
faldoEnds = []
for _id in faldoLocation[FALDO_END]:
faldoEnd = {}
faldoEnd["_id"] = _id
for subj, predicate, obj in triples((Ref(faldoEnd["_id"]),
None, None)):
faldoEnd[predicate.toPython()] = obj.toPython()
faldoEnds.append(faldoEnd)
for idx, faldoReference in enumerate(faldoReferences):
if MEMBER_OF in faldoReference:
build = faldoReference[MEMBER_OF].split('/')[-1]
chromosome = faldoReference[LABEL].split(' ')[0]
begin = faldoBegins[idx][FALDO_POSITION]
end = faldoEnds[idx][FALDO_POSITION]
if build not in locationMap:
locationMap[build] = {}
if chromosome not in locationMap[build]:
locationMap[build][chromosome] = {}
if begin not in locationMap[build][chromosome]:
locationMap[build][chromosome][begin] = {}
if end not in locationMap[build][chromosome][begin]:
locationMap[build][chromosome][begin][end] = {}
locationMap[build][chromosome][begin][end] = \
location["_id"]
locationMap[location["_id"]] = {
"build": build,
"chromosome": chromosome,
"begin": begin,
"end": end,
}
|
python
|
What’s the story?
Dabang Mumbai entered the final of the Hockey India League for the very first time as they defeated the Delhi Waveriders by a 2-0 margin at the Sector 42 Stadium in Chandigarh. They dominated proceedings from the outset, scoring in the 26th minute through Robbert Kempermann, and then hitting the post twice in the later stages.
Goalkeeper David Harte saved a penalty stroke from Delhi’s Iain Lewers in the second quarter and had to be alert till the very end to earn his clean sheet. Mumbai’s skipper and talisman Florian Fuchs expressed his delight at his side’s victory in the post-match press conference.
“I’m overwhelmed, I must say,” said the German. “It’s the first time we are in the final and our performance today was excellent too. I’m really happy. ” He did admit that his team could have been more efficient in front of goal. “We could have made things easier for ourselves towards the end of the game. But our defence was perfect and we played very well as a team,” he said.
Delhi coach Cedric D’Souza was disappointed with the Waveriders’ performance, saying that his side ‘blew it’. “We can’t blame the loss on our luck. We gave far too much space to our opponents at times and didn’t take our chances when they appeared,” said the former India coach.
The Mumbai side had topped the table in the league, winning six out of their ten matches while the Waveriders made it through by the narrowest of margins on goal difference. When the sides met in the league stages, it was Mumbai that claimed victory by a 3-2 margin on both occasions.
After a dull first quarter, the game burst into life as Kempermann scored from a penalty corner situation. Instead of going for the routine drag-flick option, Mumbai opted to play the ball out to the Dutchman at the outer circle, who trapped it, entered the penalty area and smacked a low shot into the corner with a reverse hit in the 26th minute.
Delhi were awarded a penalty stroke in the very next minute after a foul on Mandeep Singh, but Lewers’ effort was pushed onto the crossbar by Mumbai’s Irish keeper. That was to be the turning point of the match as Mumbai didn’t let their guard down after that. They earned six penalty corners, out of which only one was converted, and hit the woodwork twice in the final quarter through Johan Bjorkman and Affan Yousuf’s efforts.
What’s next?
The Hockey India League will come to a close on Sunday as Mumbai will face off against the Kalinga Lancers in the final. Prior to that game, the Delhi Waveriders will play the UP Wizards in the third-place playoff.
In a cagey and tactical game, Dabang Mumbai outmuscled the Waveriders to book a place in the final. The final will be contested between the two table-toppers from the league stage and promises to be a nail-biter.
|
english
|
//
//
// Longest substring without duplicate chars.
//
//
#include <iostream>
#include <array>
using namespace std;
// Use a lastSeen table to record the last index of chars observed
//
// 1/ Scan thru the string, left->right, looks for char that we have seen previously
// 2/ If found a dup, reset starting index and check if last substring the longest
//
int lengthOfLongestSubstring(string str) {
array <int, 127> lastSeen{}; // printable chars assii code = 32-126
// remember the str index of the char was seen
int start = 0;
int longest = 1;
int slen = str.size();
if (slen <= 1)
return slen;
// Init lastseen table with negative index, i.e. never seen
// since index could be from 0 to slen-1
//
for (int i = 0; i < 127; i++) lastSeen[i] = -1;
for (int i = 0; i < slen; i++) {
int ch = str[i];
// check if we have seen this arr[i] elem
if (lastSeen[ch] >= 0) {
// yes, it is a dup char
longest = max(longest, i-start); // is this substring longer than a prev one
start = max(start, lastSeen[ch]+1); // start over from the next char of lastseen char
}
lastSeen[ch] = i; // record where this char was seen
}
// is the last substring longer than a prev one
longest = max(longest, slen-start);
return longest;
}
int main()
{
string str;
cout << "Enter a string: ";
cin >> str;
cout << endl;
cout << lengthOfLongestSubstring(str) << endl;
}
|
cpp
|
[
{
"request": {
"body": "source[object]=card&source[number]=4111111111111111&source[cvc]=123&source[exp_month]=12&source[exp_year]=2020",
"headers": {
"Authorization": "Bearer non_empty_secret_key_string",
"Content-Type": "application/x-www-form-urlencoded",
"User-Agent": "Stripe/v1 stripity-stripe/1.4.0"
},
"method": "post",
"options": [],
"request_body": "",
"url": "https://api.stripe.com/v1/customers/cus_8r2j7zRowtrski/sources"
},
"response": {
"body": "{\n \"id\": \"card_8wdRRGS43PIzGs\",\n \"object\": \"card\",\n \"address_city\": null,\n \"address_country\": null,\n \"address_line1\": null,\n \"address_line1_check\": null,\n \"address_line2\": null,\n \"address_state\": null,\n \"address_zip\": null,\n \"address_zip_check\": null,\n \"brand\": \"Visa\",\n \"country\": \"US\",\n \"customer\": \"cus_8wdRiJUcG4EOci\",\n \"cvc_check\": \"pass\",\n \"dynamic_last4\": null,\n \"exp_month\": 12,\n \"exp_year\": 2020,\n \"fingerprint\": \"Ze2h9CyiqlKZzGuV\",\n \"funding\": \"unknown\",\n \"last4\": \"1111\",\n \"metadata\": {},\n \"name\": null,\n \"tokenization_method\": null\n}\n",
"headers": {
"Server": "nginx",
"Date": "Thu, 04 Aug 2016 11:38:04 GMT",
"Content-Type": "application/json",
"Content-Length": "569",
"Connection": "keep-alive",
"Access-Control-Allow-Credentials": "true",
"Access-Control-Allow-Methods": "GET, POST, HEAD, OPTIONS, DELETE",
"Access-Control-Allow-Origin": "*",
"Access-Control-Max-Age": "300",
"Cache-Control": "no-cache, no-store",
"Request-Id": "req_8wdRp5na0zbVAg",
"Stripe-Version": "2016-07-06",
"Strict-Transport-Security": "max-age=31556926; includeSubDomains"
},
"status_code": 200,
"type": "ok"
}
},
{
"request": {
"body": "exp_month=11",
"headers": {
"Authorization": "Bearer non_empty_secret_key_string",
"Content-Type": "application/x-www-form-urlencoded",
"User-Agent": "Stripe/v1 stripity-stripe/1.4.0"
},
"method": "post",
"options": [],
"request_body": "",
"url": "https://api.stripe.com/v1/customers/cus_8r2j7zRowtrski/sources/card_8wdRRGS43PIzGs"
},
"response": {
"body": "{\n \"id\": \"card_8wdRRGS43PIzGs\",\n \"object\": \"card\",\n \"address_city\": null,\n \"address_country\": null,\n \"address_line1\": null,\n \"address_line1_check\": null,\n \"address_line2\": null,\n \"address_state\": null,\n \"address_zip\": null,\n \"address_zip_check\": null,\n \"brand\": \"Visa\",\n \"country\": \"US\",\n \"customer\": \"cus_8wdRiJUcG4EOci\",\n \"cvc_check\": \"pass\",\n \"dynamic_last4\": null,\n \"exp_month\": 11,\n \"exp_year\": 2020,\n \"fingerprint\": \"Ze2h9CyiqlKZzGuV\",\n \"funding\": \"unknown\",\n \"last4\": \"1111\",\n \"metadata\": {},\n \"name\": null,\n \"tokenization_method\": null\n}\n",
"headers": {
"Server": "nginx",
"Date": "Thu, 04 Aug 2016 11:38:04 GMT",
"Content-Type": "application/json",
"Content-Length": "569",
"Connection": "keep-alive",
"Access-Control-Allow-Credentials": "true",
"Access-Control-Allow-Methods": "GET, POST, HEAD, OPTIONS, DELETE",
"Access-Control-Allow-Origin": "*",
"Access-Control-Max-Age": "300",
"Cache-Control": "no-cache, no-store",
"Request-Id": "req_8wdRLhCminnDBF",
"Stripe-Version": "2016-07-06",
"Strict-Transport-Security": "max-age=31556926; includeSubDomains"
},
"status_code": 200,
"type": "ok"
}
}
]
|
json
|
Hello all,
I've a HP desktop and I need a wireless adapter for desktop to connect it to wireless modem.
Requirement Details:
-My budget is Rs.1000/-.
-the adapter must be supported in both windows and linux(fedora) platform.
I have a Ainol Novo Elf2 tablet which I wish to connect to Internet. Please do not suggest me to buy a WiFi router and use WiFi, I want to know if it's possible using an adapter.
I recently bought a new battery for my ASUS Eee PC 1201N. It was detected by my laptop however it won't charge at all.I had taken the laptop overseas, and had problems with the AC adapter. The power there is 220, compared to North America where it's 110.
I have a Dell Vostro 1540 lap with win7 ultimate. Recently I reinstalled my OS due to bluescreen error.The problem with wireless adapter is it is unable to start displaying code 10 error..Can anyone help me with this..???
Requirement :
Budget : 1k (will increase if required)
1) What is the difference between 150mbps and 300mbps adapter...range or file transfer speed?
Any suggestion ?????
when ever i am trying to access network connection properties in windows 8 ...i keep getting an unexpected error!!
the same happens to the wifi adapter also...but i can go online using the wifi connection!!!
plz help!!
Hello guys,
I'm planing to buy Corsair 300R which doesn't come with the Usb 3.0 to Usb2.0 adapter.
My mobo: DH67CL doesn't comes with Usb 3.0 Internal Header.
Anyone who owns Corsair Carbide 400r and don't need the Adapter do let me know. I'll buy it.
I was playing a game, and suddenly compu started freezing, then the graphics became like this: :shock:
Then I did reset it, and the windows logo came up like this: :shock:
Then found the desktop resolution went to a lower one and the adapter details is showing like this : :confused:
I have bought this iBall Lappie USB 4-port hub. It has a small optional power adapter pin at the back which is slightly larger than the new 2mm Nokia charger pin. (May be the older Nokia charger pin may fit here.)
|
english
|
<filename>old/nodejs/kx/docker-secret.ts
import * as pulumi from "@pulumi/pulumi";
import * as k8s from "@pulumi/kubernetes";
import * as input from "@pulumi/kubernetes/types/input";
import * as utils from "./utils";
// DockerSecretBuilderArgs implements the spec settings for a
// dockerconfigjson typed Kubernetes Secret.
export type DockerSecretBuilderArgs = {
namespace?: pulumi.Input<string>;
labels?: pulumi.Input<any>;
dockerConfigJson?: pulumi.Input<string>;
};
// Pulumi namespace for the new DockerSecretBuilder pulumi.ComponentResource
const pulumiComponentNamespace: string = "pulumi:kx:DockerSecretBuilder";
// DockerSecretBuilder implements a dockerconfigjson Kubernetes Secret, with the
// specified DockerSecretBuilderArgs.
export class DockerSecretBuilder extends pulumi.ComponentResource {
public readonly dockerSecretBuilderName: string;
public readonly dockerSecretBuilderProvider: k8s.Provider;
public readonly dockerSecretBuilder: input.core.v1.Secret;
constructor(
name: string,
provider: k8s.Provider,
args: DockerSecretBuilderArgs,
opts?: pulumi.ComponentResourceOptions,
) {
super(pulumiComponentNamespace, name, args, opts);
if (args.dockerConfigJson === undefined ||
provider === undefined) {
return {} as DockerSecretBuilder;
}
this.dockerSecretBuilderName = name;
this.dockerSecretBuilderProvider = provider;
// Create dockerSecretBuilder base.
this.dockerSecretBuilder = makeDockerSecretBuilderBase(
name,
args.dockerConfigJson,
args.namespace,
args.labels,
);
}
// Create a new Secret from the DockerSecretBuilder.
public toSecret = function(): k8s.core.v1.Secret {
return new k8s.core.v1.Secret(
this.dockerSecretBuilderName,
this.dockerSecretBuilder,
{
provider: this.dockerSecretBuilderProvider,
},
);
};
}
// Create a base for a generic dockerconfigjson Kubernetes Secret.
export function makeDockerSecretBuilderBase(
name: string,
dockerConfigJson: pulumi.Input<string>,
namespace?: pulumi.Input<string>,
labels?: pulumi.Input<any>,
): input.core.v1.Secret {
return {
type: "kubernetes.io/dockerconfigjson",
metadata: {
labels: utils.objOrDefault(labels, []),
namespace: utils.objOrDefault(namespace, "default"),
},
data: {
".dockerconfigjson": dockerConfigJson,
},
};
}
|
typescript
|
import os, re
FILE_DIR = os.path.dirname(os.path.abspath(__file__))
README_PATH = os.path.join(FILE_DIR, os.pardir, 'README.md')
README_CODE_PATH = os.path.join(FILE_DIR, 'README_commands.py')
CODE_INIT = '''
#------------ CODE INIT ------------
# make sure imports from ../src work
import os, sys
FILE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.join(FILE_DIR, os.pardir, 'src'))
# simulate console output of expressions
_p_ = None
# print result of last expression
def _p():
global _p_
if _p_ is not None:
print(_p_.__repr__())
_p_ = None
#------------ CODE INIT ------------
'''
insideCode = False
codeType = None
linePrev = None
def _isExpression(line):
STATEMENT_STARTS = ['def ', 'import ', 'from ', 'print(']
line = line.strip()
for start in STATEMENT_STARTS:
if line.startswith(start): return False
# assignment?
if re.match(r'^[A-Za-z0-9_]+[ \t]*=.*', line): return False
return len(line) > 0
with open(README_PATH) as fileIn:
with open(README_CODE_PATH, 'w') as fileOut:
fileOut.write(CODE_INIT)
for line in fileIn:
if line.startswith('```'):
insideCode = not insideCode
if insideCode:
codeType = line[3:].strip()
else:
if linePrev and linePrev.startswith('>>> ') and _isExpression(linePrev[4:]):
#print("linePrev='%s'" % linePrev)
fileOut.write('_p()\n')
codeType = None
linePrev = None
continue
if insideCode and codeType == 'python':
if line.startswith('>>> '):
command = line[4:]
if _isExpression(command):
command = '_p_= ' + command
fileOut.write(command)
elif line.startswith('#'):
fileOut.write(line)
elif len(line.strip()) > 0 and linePrev and _isExpression(linePrev[4:]):
fileOut.write('_p()\n')
linePrev = line
|
python
|
JAMUGURIHAT: Sootea MLA Padma Hazarika on Sunday inaugurated 7 model Anganwadi centres out of 11 model Anganwadi centres in various parts of Sootea LAC, including Edenbari, Sonai Miri, Gamani, Rangachakuwa, Koroiani Chapari, Samar Dalani and Pahusuwa model Anganwadi centres, besides 4 Jal Jeevan schemes.
The Jal Jeevan schemes inaugurated are Jal Jeevan scheme of Charduar, No 2 Borpothar Jal Jeevan scheme of Dhalaibil, Bakola Jal Jeevan scheme, Bakola Jal Jeevan scheme and Nabapur Jal Jeevan scheme. The other four model Anganwadi centres and two Jal Jeevan schemes were inaugurated by local ZPC members and AP (Anchalik Panchayat).
Inaugurating the model Anganwadi centers and Jal Jeevan schemes, MLA Hazarika stated about various developmental schemes undertaken by the State as well as the Central governments. The inaugural sessions were attended by Joy Doley and Nirabi Hazarika, Child Development Project Officers of Sootea and Naduar respectively, along with others.
Also Watch:
|
english
|
function clock() {
function hourToSeconds(seconds) {
const data = new Date(seconds * 1000);
return data.toLocaleTimeString('pt-BR', {
hour12: false,
timeZone: 'UTC'
});
}
const clock = document.querySelector('.clock');
let seconds = 0;
let timer;
function clockStart() {
timer = setInterval(function() {
seconds++;
clock.innerHTML = hourToSeconds(seconds);
}, 1000);
}
document.addEventListener('click', function(e) {
const el = e.target;
if (el.classList.contains('reset')) {
clearInterval(timer);
clock.innerHTML = '00:00:00';
clock.classList.remove('pause');
seconds = 0;
}
if (el.classList.contains('start')) {
clock.classList.remove('pause');
clearInterval(timer);
clockStart();
}
if (el.classList.contains('pause')) {
clearInterval(timer);
clock.classList.add('pause');
}
});
}
clock();
|
javascript
|
A child works at a factory. (File Photo)
MELAMCHI: As many as 104 child workers have been found at wards no 7 and 8 of Melamchi Municipality alone.
Among them, girl children are 100 and boys four. It was revealed by the study conducted by the Women Self Reliance Centre.
Fifty-two percent of the child workers range from 9 to 14 years, while others belong to 15 to 18 years.
Moreover, 15. 85 percent of the total child workers are out of school. The rest of them work in the rug industries every morning and evening and go to school during the daytime.
However, they have not attended the school regularly, the study added.
The Centre made public the study report at Malamchi on Wednesday. The child laborers were not however involved in brick kilns.
Most of the child laborers involved in rug making were from wards no 7 and 8, according to Evaluation and Monitoring Officer at the Centre, Dhruba Sapkota.
Moreover, most of the rug industries being run on a small scale at home are not registered at municipalities or other concerned bodies.
Even the ward office lacks record on it, admits ward chairperson Tankaraj Giri.
The study further said the children working at rug making facilities were suffering from back pain and eyesore.
Some of them even reported mental problems. Although the law does not permit the children below 14-year in child labour, the parents themselves were found allowing it.
The study report mentioned that 61 percent of the child labours were facing financial problems at home, while 39 percent were engaged in it due to pressure from parents.
Similarly, 47 percent of them do not know about their daily wages, while the parents of 87 percent child labours receive children’s wage themselves.
They are bound to work from two to 10 hours a day.
|
english
|
{"css/ng-wig.css":"<KEY>,"css/ng-wig.min.css":"<KEY>,"ng-wig.js":"<KEY>,"ng-wig.min.js":"<KEY>}
|
json
|
<filename>Space/client/src/components/ide/Ide.css
.ace_content {
box-shadow: 0px 2px 10px #e0e0e0 !important;
}
.inputBox {
border: none;
box-shadow: 0px 1px 5px #bbbbbb !important;
outline: none;
}
#run-button{
max-width:8vw;
}
#input-run-box{
border-radius: 10px;
}
.outputBox{
border-radius: 10px;
border: none;
box-shadow: 0px 1px 5px #bbbbbb !important;
outline: none;
}
@media screen and (max-width:600px){
#run-button{
max-width:20vw;
}
#ide-div{
padding:50px;
}
}
|
css
|
import * as AppRootPath from "app-root-path";
import {
createWebpackConfig,
DEFAULT_BUILD_CONFIG,
DEFAULT_METADATA_SCHEMA,
} from "userscripter/build";
import METADATA from "./metadata";
import * as CONFIG from "./src/config";
import * as SITE from "./src/site";
import U from "./src/userscript";
export default createWebpackConfig({
buildConfig: {
...DEFAULT_BUILD_CONFIG({
rootDir: AppRootPath.path,
id: U.id,
now: new Date(),
}),
sassVariables: { CONFIG, SITE },
},
metadata: METADATA,
metadataSchema: DEFAULT_METADATA_SCHEMA,
env: process.env,
});
|
typescript
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" calibration_rig.py: trilateration microphone calibration
Since trilateration doesn't account for the acoustic properties of the sound
source, the results will be skewed. To account for this, it's possible
to use machine learning to build a lookup table-like model which takes
the inputs of the microphones and outputputs the cartesian coordinates
without actually touching any of the math behind trilateration
A 3D printer is used as a precise calibration rig to train the model. A
cellphone is zip tied to the head which produces the approprate tone, and
data is captured every 20mm
https://kevinponce.com/blog/python/send-gcode-through-serial-to-a-3d-printer-using-python/
"""
__version__ = "1.0"
__author__ = "<NAME>"
__copyright__ = "Copyright 2021, <NAME>"
__license__ = "Apache 2.0"
import serial
import time
from acoustic_fixture import AcousticFixture as AF, BUFFER, AMPLITUDE_SIZE
import pickle
start_time = time.time()
# Initialize the acoustic fixture in calibration mode
af = AF(cal_mode=True)
# Assume lower left corner of the fixture is located at (0, 0, 0)
FIXTURE_HEIGHT = 56 # Distance to the top of the microphones
PHONE_CENTER = (170, 125, 8)
STEP = 20
X_MAX = 80
Y_MAX = 80
Z_MAX = 120
# Wait for the machine to return ok
def waitFor(ser, response):
ret = ""
while True:
if ser.in_waiting:
while ser.in_waiting:
ret = ser.readline().decode("utf-8")
print("[%12.6f] %s" % (time.time() - start_time, ret.replace("\n", "").replace("\r", "")))
if ret == response:
break
# Write a gcode command to the printer
def sendCommand(ser, gcode):
# Make sure we terminate our gcode
if gcode[-2:] != "\r\n":
gcode += "\r\n"
# Send the command
print("> %s" % (gcode.replace("\n", "").replace("\r", "")))
ser.write(str.encode(gcode))
time.sleep(0.1)
waitFor(ser, "ok\n")
print("Connecting to printer...")
ser = serial.Serial("COM4", 115200)
waitFor(ser, "LCD status changed\n") # Wait for the system to initialize
prompt = "Remove the acoustic fixture and phone, then press enter to home all axis"
sendCommand(ser, "M0 %s" % (prompt))
sendCommand(ser, "G28 0 W") # Home the system
sendCommand(ser, "G1 F9000") # Set the feed rate
# Move to the phone installation position
sendCommand(ser, "G1 X%d Y%d Z%d" % PHONE_CENTER)
sendCommand(ser, "M400") # Wait for moves to finish
prompt = "Install the phone into the holder with the bottom flush to the bed"
sendCommand(ser, "M0 %s" % (prompt))
# Make the bed accessable to the user so we can install the acoustic fixture
sendCommand(ser, "G1 X0 Y200 Z100")
sendCommand(ser, "M400") # Wait for moves to finish
prompt = "Install the acoustic fixture onto the print table"
sendCommand(ser, "M0 %s" % (prompt))
HEIGHT_OFFSET = 20
center_x, center_y, center_z = PHONE_CENTER
center_z += FIXTURE_HEIGHT + HEIGHT_OFFSET # start some distance above the mics
cal_dict = {}
num_datapoints = 0
FWD = True
REV = False
x_dir = FWD
y_dir = FWD
z_dir = FWD
# Cycle through the training at least 3 times
for i in range(3):
# Step through each calibration point
for z in range(0, Z_MAX + STEP, STEP):
y_range = range(-Y_MAX, Y_MAX + STEP, STEP) if x_dir == FWD else range(Y_MAX, -(Y_MAX + STEP), -STEP)
for y in y_range:
x_range = range(-X_MAX, X_MAX + STEP, STEP) if x_dir == FWD else range(X_MAX, -(X_MAX + STEP), -STEP)
for x in x_range:
sendCommand(ser, "G1 X%d Y%d Z%d" % (x + center_x, y + center_y, z + center_z))
sendCommand(ser, "M400")
time.sleep(0.5) # Wait 500ms for the fixture to stabalize before capturing data
# initialize the array of data if it doesn't exit
k = (x, y, z + HEIGHT_OFFSET)
if k not in cal_dict:
cal_dict[k] = []
# discard the first buffer since the fixture class is asynchronous
af.update()
# Take 10 samples of data
for i in range(AMPLITUDE_SIZE):
# fill the buffer with new data
af.update()
# copy the buffer into our training data set
cal_dict[k].append(af.buf_copy)
num_datapoints += 1
# print the average for debug purposes only
print("[%12.6f] M1: %.4f, M2: %.4f, M3: %.4f, n: %d" % (time.time() - start_time, af.amplitude_avg[0], af.amplitude_avg[1], af.amplitude_avg[2], num_datapoints))
# Reverse the direction of x
x_dir = ~x_dir
# Reverse the direction of y
y_dir = ~y_dir
# Dump the training data in binary format
pickle.dump(cal_dict, open("training_data.db", 'wb'))
end_time = time.time() - start_time
print("All done! Captured %d samples in %d minutes and %d seconds." % (num_datapoints, int(end_time/60), int(end_time) % 60))
ser.close
|
python
|
As per Allcargo Group's latest Environmental, Social, and Governance (ESG) report, the company has aimed to achieve carbon neutrality by 2040. The logistics operator plans to associate itself only with carriers who are using greener fuels. The report also revealed the company's ESG goals including energy and emissions, occupational health and safety, diversity, equity, and inclusion (DEI) among other things.
The internet and digital technology have altered the way Indians live, work and play, from shopping online to making digital payments. As the country hot-steps into its 75th year as a free nation, we take a closer look.
|
english
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML
><HEAD
><TITLE
>Revision History</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="Bash Guide for Beginners"
HREF="index.html"><LINK
REL="UP"
TITLE="Introduction"
HREF="f32.html"><LINK
REL="PREVIOUS"
TITLE="New versions, translations and availability"
HREF="intro_03.html"><LINK
REL="NEXT"
TITLE="Contributions"
HREF="intro_05.html"><link rel="stylesheet" type="text/css" href="../bookstyle.css"> </HEAD
><BODY
CLASS="section"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Bash Guide for Beginners</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="intro_03.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Introduction</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="intro_05.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="intro_04"
></A
>4. Revision History</H1
><P
> <DIV
CLASS="revhistory"
><TABLE
WIDTH="100%"
BORDER="0"
><TR
><TH
ALIGN="LEFT"
VALIGN="TOP"
COLSPAN="3"
><B
>Revision History</B
></TH
></TR
><TR
><TD
ALIGN="LEFT"
>Revision 1.11</TD
><TD
ALIGN="LEFT"
>2008-12-27</TD
><TD
ALIGN="LEFT"
>Revised by: MG</TD
></TR
><TR
><TD
ALIGN="LEFT"
COLSPAN="3"
>Processed input from readers.</TD
></TR
><TR
><TD
ALIGN="LEFT"
>Revision 1.10</TD
><TD
ALIGN="LEFT"
>2008-06-06</TD
><TD
ALIGN="LEFT"
>Revised by: MG</TD
></TR
><TR
><TD
ALIGN="LEFT"
COLSPAN="3"
>address change</TD
></TR
><TR
><TD
ALIGN="LEFT"
>Revision 1.9</TD
><TD
ALIGN="LEFT"
>2006-10-10</TD
><TD
ALIGN="LEFT"
>Revised by: MG</TD
></TR
><TR
><TD
ALIGN="LEFT"
COLSPAN="3"
>Incorporated reader remarks, added index using DocBook tags.</TD
></TR
><TR
><TD
ALIGN="LEFT"
>Revision 1.8</TD
><TD
ALIGN="LEFT"
>2006-03-15</TD
><TD
ALIGN="LEFT"
>Revised by: MG</TD
></TR
><TR
><TD
ALIGN="LEFT"
COLSPAN="3"
>clarified example in Chap4, corrected here doc in chap9, general checks and correction of typos, added link to Chinese and Ukrainian translation, note and stuff to know about awk in chap6.</TD
></TR
><TR
><TD
ALIGN="LEFT"
>Revision 1.7</TD
><TD
ALIGN="LEFT"
>2005-09-05</TD
><TD
ALIGN="LEFT"
>Revised by: MG</TD
></TR
><TR
><TD
ALIGN="LEFT"
COLSPAN="3"
>Corrected typos in chapter 3, 6 and 7, incorporated user remarks, added a note in chap7.</TD
></TR
><TR
><TD
ALIGN="LEFT"
>Revision 1.6</TD
><TD
ALIGN="LEFT"
>2005-03-01</TD
><TD
ALIGN="LEFT"
>Revised by: MG</TD
></TR
><TR
><TD
ALIGN="LEFT"
COLSPAN="3"
>Minor debugging, added more keywords, info about new Bash 3.0, took out blank image.</TD
></TR
><TR
><TD
ALIGN="LEFT"
>Revision 1.0</TD
><TD
ALIGN="LEFT"
>2004-04-27</TD
><TD
ALIGN="LEFT"
>Revised by: TM</TD
></TR
><TR
><TD
ALIGN="LEFT"
COLSPAN="3"
>Initial release for LDP; more exercises, more markup, less errors and abuse; added glossary.</TD
></TR
><TR
><TD
ALIGN="LEFT"
>Revision 1.0-beta</TD
><TD
ALIGN="LEFT"
>2003-04-20</TD
><TD
ALIGN="LEFT"
>Revised by: MG</TD
></TR
><TR
><TD
ALIGN="LEFT"
COLSPAN="3"
>Pre-release</TD
></TR
></TABLE
></DIV
>
</P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="intro_03.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="intro_05.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>New versions, translations and availability</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="f32.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Contributions</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>
|
html
|
With dependable high quality approach, great reputation and excellent customer support, the series of products and solutions produced by our firm are exported to lots of countries and regions for Covid-19 Self Test Kit Ebay, Urine Pregnancy Test Hcg Level, Test Troponina, Hcg Pregnancy Test,Mop Morphine Test. Trust us and you will gain more. Please feel free to contact us for more information, we assure you of our best attention at all times. The product will supply to all over the world, such as Europe, America, Australia,Nigeria, Indonesia,luzern, Netherlands.We put the product quality and customer's benefits to the first place. Our experienced salesmen supply prompt and efficient service. Quality control group make sure the best quality. We believe quality comes from detail. If you have demand, allow us to work together to get success.
|
english
|
import { Component } from '@angular/core';
import { Observable, Subject, of } from 'rxjs';
import * as op from 'rxjs/operators';
import { Hero } from 'app/api/hero';
import { HeroService } from './hero.service';
@Component({
selector: 'my-hero-search',
templateUrl: './hero-search.component.html',
styleUrls: ['./hero-search.component.css'],
providers: [HeroService]
})
export class HeroSearchComponent {
private readonly searchTerms = new Subject<string>();
// debounceTime(300): wait for 300ms between events
// distinctUntilChanged(): ignore if next search term is same as previous
// switchMap(): switch from search terms to search results
heroes: Observable<Hero[]> = this.searchTerms.pipe(
op.debounceTime(300),
op.distinctUntilChanged(),
op.switchMap(term => {
if (term) {
return this.heroService.search(term);
} else {
return of<Hero[]>([]);
}
}),
op.catchError(error => {
// TODO: real error handling
console.log(`Error in component ... ${error}`);
return of<Hero[]>([]);
}),
op.shareReplay(1),
);
constructor(private heroService: HeroService) {}
search(term: string): void {
// Send search term into input stream
this.searchTerms.next(term);
}
gotoDetail(hero: Hero): void {
this.heroService.gotoDetail(hero.id);
}
}
|
typescript
|
package com.snorlon.sevestralkingdoms.Places;
import java.util.ArrayList;
import java.util.List;
import com.snorlon.sevestralkingdoms.Buildings.Blacksmith;
import com.snorlon.sevestralkingdoms.Buildings.BuildingBase;
import com.snorlon.sevestralkingdoms.Buildings.GeneralStore;
import com.snorlon.sevestralkingdoms.Buildings.GuardTower;
import com.snorlon.sevestralkingdoms.Buildings.Guild;
import com.snorlon.sevestralkingdoms.Buildings.Hospital;
import com.snorlon.sevestralkingdoms.Buildings.HouseBuilding;
import com.snorlon.sevestralkingdoms.Buildings.Inn;
import com.snorlon.sevestralkingdoms.Buildings.Market;
import com.snorlon.sevestralkingdoms.Buildings.Spellshop;
import com.snorlon.sevestralkingdoms.GameComponents.Common;
import com.snorlon.sevestralkingdoms.GameTools.Core;
import com.snorlon.sevestralkingdoms.Items.Bag;
public class Town extends Map
{
public static int buildingPlotCounts = 8;
int money = 0;
int OwnerLoyalty = 50;
int PlayerLoyalty = 0;
//buildings to implement
/*
*
* Battle Simulator (Training)
*/
//Building Requirements
/*
* Enterable
* Each has its own menu and functionality, ala inventorymanager
* Can be captured/downgraded/destroyed
*/
//Need to hold materials in town for upgrades (ex: wood)
Bag stockroom = null;
double taxRate = 0.075;//default tax rate for products
BuildingBase building[] = new BuildingBase[buildingPlotCounts];
boolean hasPort = false;
int Loyalty = 50;
//goes up with quests
//goes down by doing things such as taking from funds or recruiting for army
//While high, population may go up?
//While low, population may go down?
//Buildings may be destroyed when really low?
//Upgrade based on population
//Population auto-increases with tourism
//Citizens may move between cities of their own accord
public Town(Core gameCore, Location nLocation)
{
super(gameCore, nLocation);
stockroom = new Bag(coreModule, 200);
//TEMPORARY
//generate a few buildings here
//buildings.add(new Inn(coreModule, 555, 787));
//buildings.add(new GeneralStore(coreModule, 698, 413));
//buildings.add(new GuardTower(coreModule, 382, 125));
//generate some pathing nodes
}
public int getOwnerLoyalty()
{
return OwnerLoyalty;
}
public int getPlayerLoyalty()
{
return PlayerLoyalty;
}
public void setOwnerLoyalty(int nVal)
{
OwnerLoyalty = nVal;
}
public void setPlayerLoyalty(int nVal)
{
PlayerLoyalty = nVal;
}
public void addOwnerLoyalty(int nVal)
{
OwnerLoyalty += nVal;
if(OwnerLoyalty > 100)
OwnerLoyalty = 100;
}
public void addPlayerLoyalty(int nVal)
{
PlayerLoyalty += nVal;
if(PlayerLoyalty > 100)
PlayerLoyalty = 100;
}
public boolean hasBuildingPlot()
{
//pick a random spot for the building (if available)
ArrayList<Integer> slots = new ArrayList<Integer>();
for(int i=1; i<=8; i++)
{
if(building[i-1] != null)
{
if(building[i-1] == null)
slots.add(i);
}
}
if(slots.size() <= 0)
{
slots.clear();
return false;//no slots to build on, get rekt son!
}
slots.clear();
return true;
}
public void SpawnBuilding(String buildingType, int buildingLevel)
{
int i;
if(buildingType.equals("Spaceport"))
{
hasPort = true;;
return;
}
for(i=7; i>=0; i--)
{
if(building[i] == null)
break;
}
if(i>7 || i<0)
{
System.out.println("Disaster! No room for building!");
return;//no slots to build on, get rekt son!
}
if(buildingType.equals("Inn"))
{
building[i] = new Inn(coreModule, this, buildingLevel);
}
else if(buildingType.equals("General Store"))
{
building[i] = new GeneralStore(coreModule, this, buildingLevel);
}
else if(buildingType.equals("Guard Tower"))
{
building[i] = new GuardTower(coreModule, this, buildingLevel);
}
else if(buildingType.equals("Hospital"))
{
building[i] = new Hospital(coreModule, this, buildingLevel);
}
else if(buildingType.equals("Blacksmith"))
{
building[i] = new Blacksmith(coreModule, this, buildingLevel);
}
else if(buildingType.equals("Spellshop"))
{
building[i] = new Spellshop(coreModule, this, buildingLevel);
}
else if(buildingType.equals("Market"))
{
building[i] = new Market(coreModule, this, buildingLevel);
}
else if(buildingType.equals("House"))
{
building[i] = new HouseBuilding(coreModule, this, buildingLevel);
}
else if(buildingType.equals("Guild"))
{
building[i] = new Guild(coreModule, this, buildingLevel);
}
else
{
System.out.println("Building of type "+buildingType+" does not exist!");
}
}
public void postInit()
{
for(BuildingBase b : building)
{
if(b!=null)
b.initialize();
}
}
public boolean hasSpaceport()
{
return hasPort;
}
public BuildingBase getBuilding(String buildingType)
{
for(int i=0; i<buildingPlotCounts; i++)
{
if(building[i]!=null)
{
if(building[i].getName().equals(buildingType))
{
return building[i];
}
}
}
return null;
}
public int getTaxedAmount(int value)
{
int amount = (int) (value*taxRate) + value;
if(amount>99999)
amount = 99999;
if(amount <0)
amount = 0;
return amount;
}
public BuildingBase[] getBuildings()
{
return building;
}
public int getPlotCount()
{
return buildingPlotCounts;
}
public void stepTurn()
{
for(int i=0; i<buildingPlotCounts; i++)
{
if(building[i]!=null)
{
building[i].stepTurn();
}
}
//up military strength
ourLocation.MilitaryPower+=2;
//if we have a guard tower, increase military buildup
for(BuildingBase b : building)
{
if(b!=null && b instanceof GuardTower)
{
ourLocation.MilitaryPower+=3*b.getLevel();
}
}
//cap military strength
if(ourLocation.MilitaryPower > ourLocation.level*10)
{
ourLocation.MilitaryPower = ourLocation.level*10;
}
//update loyalty if applicable
//if player loyalty exceeds faction loyalty, trend towards that
if(PlayerLoyalty >= OwnerLoyalty+1 && ourLocation.controllingFaction == Common.FACTION_PLAYER)
OwnerLoyalty+=2;
else if(PlayerLoyalty >= OwnerLoyalty+20)
{
ChangeOwnership(Common.FACTION_PLAYER);
System.out.println("Player took ownership of "+ourLocation.name+" through reputation!");
}
//check if need for rebellion
if(OwnerLoyalty < 20 && ourLocation.controllingFaction != Common.FACTION_NONE)
{
//rebel
ChangeOwnership(Common.FACTION_NONE);
ourLocation.MilitaryPower = (int) Math.floor(ourLocation.MilitaryPower*0.1);
System.out.println("Faction lost ownership of "+ourLocation.name+" through reputation!");
}
}
public void takeLoyalty(int amount)
{
OwnerLoyalty -= amount;
//all player loyalty is hit when the player fucks up or does something dickish
if(ourLocation.controllingFaction == Common.FACTION_PLAYER)
{
PlayerLoyalty -= amount;
}
}
public void ChangeOwnership(String nfaction)
{
ourLocation.controllingFaction = nfaction;
OwnerLoyalty = 60;
}
public int getMoney()
{
return money;
}
public double getTaxRate()
{
return taxRate;
}
public void setMoney(int nMoney)
{
money = nMoney;
}
public void setTax(double newTax)
{
taxRate = newTax;
}
public void giveMoney(int m)
{
money += m;
}
}
|
java
|
<gh_stars>1-10
{"derivation": "from a derivative of (to equip) meaning furniture, especially a pack-saddle (which in the East is merely a bag of netted rope);", "kjv_def": "net", "lemma": "\u03c3\u03b1\u03b3\u03ae\u03bd\u03b7", "frequency": 1, "strongs_def": " a \"seine\" for fishing", "outline": "<ol><li> a large fishing net, a drag net</li></ol>"}
|
json
|
#!/usr/bin/env python
import vtk
def main():
graph = vtk.vtkMutableDirectedGraph()
v1 = graph.AddVertex()
v2 = graph.AddChild(v1)
graph.AddChild(v1)
graph.AddChild(v2)
# equivalent to:
# V1 = g.AddVertex()
# V2 = g.AddVertex()
# V3 = g.AddVertex()
# V4 = g.AddVertex()
# g.AddEdge ( V1, V2 )
# g.AddEdge ( V1, V3 )
# g.AddEdge ( V2, V4 )
tree = vtk.vtkTree()
success = tree.CheckedShallowCopy(graph)
print('Success?', success)
# std::cout << 'Success? ' << success << std::endl
treeLayoutView = vtk.vtkGraphLayoutView()
treeLayoutView.AddRepresentationFromInput(tree)
treeLayoutView.SetLayoutStrategyToTree()
treeLayoutView.ResetCamera()
treeLayoutView.Render()
treeLayoutView.GetInteractor().Start()
if __name__ == '__main__':
main()
|
python
|
//define consol if not exists
if ( typeof console == 'undefined' ) console = { log: function(str) {} };
//shortcut to o3_lang._, checks if o3_lang is defined
function o3_lang_( value, language ) {
return typeof o3_lang == 'undefined' ? value : o3_lang._( value, language );
}
//shortcut to o3_lang.n_, checks if o3_lang is defined
function o3_langn_( value, nr, language ) {
return typeof o3_lang == 'undefined' ? value : o3_lang.n_( value, nr, language );
}
//same as jQuery.ajax with O3 debug tool
function o3_ajax( url, settings ) { //todo optimize
if ( typeof settings != 'undefined' ) {
var success = settings.success ? settings.success : function() {},
error = settings.error ? settings.error : function() {};
console.log('AJAX: '+url);
//fix error 0x2ef3
o3_fix_0x2ef3( url );
settings.success = function (data) { if ( typeof data.o3_console != 'undefined' && typeof data.o3_console != 'undefined' ) for ( var i = 0; i < data.o3_console.length; i++ ) console.log(data.o3_console[i]); success(data); };
settings.error = function (jqXHR, status, error_thrown) {
console.log('AJAX Status: '+status);
if ( status == 'parsererror' ) console.log('AJAX Response: '+jqXHR.responseText);
console.log('AJAX Error: '+error_thrown);
error(jqXHR, status, error_thrown);
};
return jQuery.ajax( url, settings );
} else {
console.log('AJAX: '+url.url);
//fix error 0x2ef3
o3_fix_0x2ef3( url.url );
var success = url.success ? url.success : function() {},
error = url.error ? url.error : function() {};
url.success = function (data) { if ( typeof data.o3_console != 'undefined' && typeof data.o3_console != 'undefined' ) for ( var i = 0; i < data.o3_console.length; i++ ) console.log(data.o3_console[i]); success(data); };
url.error = function (jqXHR, status, error_thrown) {
console.log('AJAX Status: '+status);
if ( status == 'parsererror' ) console.log('AJAX Response: '+jqXHR.responseText);
console.log('AJAX Error: '+error_thrown);
error(jqXHR, status, error_thrown);
};
return jQuery.ajax( url );
};
};
//fix msie/edge hanging/error on ajax post
function o3_fix_0x2ef3( url ) {
if ( typeof XMLHttpRequest != 'undefined' && navigator.appVersion.indexOf("Trident") != -1 || navigator.appVersion.indexOf("Edge/") != -1 /* || navigator.appVersion.indexOf("Safari") != -1 */ ) {
//get url
url = typeof url == 'undefined' ? window.location : url;
//if relative use window location
if ( !(new RegExp('^(?:[a-z]+:)?//', 'i')).test(url) ) {
url = window.location.protocol+'//'+window.location.hostname+( window.location.port != '' ? ':'+window.location.port : '' );
} else {
var url_info = o3_url_info(url);
if ( url_info !== false ) {
url = url_info.protocol+'//'+url_info.hostname+':'+url_info.port;
} else {
return;
}
}
//only if protocol is https
if ( url.toString().toLowerCase().indexOf('https:') === 0 ) {
console.log('fix0x2ef3'+url);
jQuery.ajax({
async: false,
url: url
});
};
};
};
/*
* Create ajax handler
* @param url Request Url
* @param data Data to send
* @param onSuccess On success callback
* @param onError On error callback
* @param onFail On fail callback
*/
function o3_ajax_call( url, data, onSuccess, onError, onFail ) {
return o3_ajax({
type: "POST",
url: url,
data: data,
dataType: "json",
success: function (data) {
if ( data && typeof data.redirect != 'undefined' && data.redirect != '' ) {
window.location = data.redirect;
} else {
if ( data && data.success === true ) {
if ( onSuccess ) {
if ( typeof onSuccess == 'function')
onSuccess( data );
} else {
if ( data.success_msg )
alert( o3_lang_(data.success_msg) );
}
} else {
if ( onError ) {
if ( typeof onError == 'function')
onError( data );
} else {
if ( data.error_msg )
alert( o3_lang_(data.error_msg) );
}
}
}
},
error: function (jqXHR, status, error) {
if ( onFail ) {
if ( typeof onFail == 'function')
onFail( jqXHR, status, error );
} else {
alert( o3_lang_(O3_ERR_GENERAL) );
}
}
});
};
//create script
function o3_write_script(url){
document.write('<script src="'+ url + '" type="text/javascript"></script>');
}
//dynamic load javascript
function o3_load_script( url, async, onload ) {
async = typeof async == 'undefined' ? true : async;
var s = document.createElement('script');
s.type = 'text/javascript';
s.src = url;
s.onload = onload;
var x = document.getElementsByTagName('script')[0];
x.parentNode.insertBefore(s, x);
}
//alias for o3_load_script
function o3_script( url, async ) {
o3_load_script( url, async );
};
//check for condition and runc function when is true
function o3_trigger( func, cond, delay ) {
return new (function( func, cond, delay ){
var t = this;
delay = typeof delay == 'undefined' ? 100 : delay;
t.interval = setInterval( function() {
if ( cond() ) {
clearInterval(t.interval);
func();
};
}, delay );
})( func, cond, delay );
};
//local storage & cookies
//set value and expiration of cookie
function o3_set_cookie( name, value, seconds ) {
var expires = "";
if ( typeof seconds != 'undefined' ) {
var date = new Date();
date.setTime(date.getTime() + (seconds * 1000));
expires = "; expires=" + date.toGMTString();
};
document.cookie = name + "=" + value + expires + "; path=/";
};
//unset cookie by name
function o3_unset_cookie( name ) {
var expires = "",
value = "",
seconds = -3600;
var date = new Date();
date.setTime(date.getTime() + (seconds * 1000));
expires = "; expires=" + date.toGMTString();
document.cookie = name + "=" + value + expires + "; path=/";
};
//get value of cookie
function o3_get_cookie( name ) {
var name = name + "=",
cookies = document.cookie.split(';');
for( var i = 0; i < cookies.length; i++ ) {
var c = cookies[i];
while ( c.charAt(0) == ' ' )
c = c.substring(1);
if ( c.indexOf(name) != -1 )
return c.substring( name.length, c.length );
}
return "";
};
/*
* Check if html5 storage available
*/
function o3_is_html5_storage() {
try {
return 'localStorage' in window && window['localStorage'] !== null;
} catch (e) {
return false;
};
};
/*
* Get or set
*/
function o3_html5_store( index, value ) {
if ( o3_is_html5_storage() ) {
if ( typeof value != 'undefined' ) {
return localStorage.setItem( index, value.toString() );
} else {
return localStorage.getItem( index );
};
};
};
//array functions
/*
* Update elements in array
*/
function o3_array_update( arr, func, data ) {
if ( typeof func == 'function' )
for ( prop in arr ) {
if ( func(arr[prop]) )
arr[prop] = data;
};
};
/*
if (!('o3_array_update' in Array.prototype))
Array.prototype.o3_array_update = function( func, data ) {
o3_array_update( this, func, data );
};
*/
/*
* Remove elements from array
*/
function o3_array_remove( arr, func ) {
if ( typeof func == 'function' )
for ( prop in arr ) {
if ( func(arr[prop]) ) {
var index = arr.indexOf( arr[prop] );
if ( index > -1 )
arr.splice( index, 1 );
};
};
};
//file/url functions
/*
* Add parameter(s) to url
*/
function o3_param2url( url, param ){
if ( typeof url == 'string' ) {
url += (url.split('?')[1] ? '&':'?') + param;
return url;
};
return false;
};
/*
* Get basename from path
*/
function o3_basename( path ) {
if ( typeof path == 'string' && path.length > 0 )
return path.split(/[\\/]/).pop();
return false;
};
/**
* Break apart any url into parts
*/
function o3_url_info( url ) {
if ( 'createElement' in document ) {
//create a link in the DOM and set its href
var link = document.createElement('a');
link.setAttribute('href', url);
//return an easy-to-use object that breaks apart the path
return {
hostname: link.hostname,
port: link.port,
search: link.search,
path: link.pathname,
protocol: link.protocol
};
};
return false;
};
|
javascript
|
A recounting of Indian freedom fighters instantly strikes with prominent names such as Mahatma Gandhi, Bal Gangadhar Tilak, Bhagat Singh, Jawaharlal Nehru among others. Though all of them played significant roles in Indian independence movement, we often fail to recognize those who led several successful movements at the grassroot level against the British. Their stories are not often talked about.
June 9 marks the death anniversary of one such tribal freedom fighter, who pioneered the “Hul” rebellion against the British Raj. Known as “Dharti Aba”, Birsa Munda had led the movement that forced the colonial Raj to move out of the indigenous land of the tribals in what is now Jharkhand.
Birsa Munda was born on November 15,1875 in Ulihatu, Jharkhand. As the name suggests, he belonged to the ‘Munda’ tribe of Chota Nagpur region. Little did he know about the Christian missionaries; like many other tribes, he too was too forced to become a Christian in order to enroll and study further in the German Mission School.
Birsa later discovered the motive and missions of the missionaries and the discrepancy in ruling the indigenous land and hefty taxation, which was the source of revenue of the British raj. Soon he came back to his tribe out of the fallacy, formed a new religion called “Birsait” that used to worship only one god. He was given the name “Dharti Aba”, which was rapidly accepted by many due to his growing influence and understanding.
The ignorance by the British Raj and the significant rise of caste Hindu zamindars (land owners), mahajans (moneylenders), darogas (police officers) and their unlawful activities led to the surge of discontent among the tribals. This discontent sparked the agitation against the fallacy and oppression of the Raj.
Birsa believed in the Abua Disom (self-rule) which is the only way to protect the rights of the tribes. He raised “Abua raj seter jana, maharani raj tundu jana” which means ‘End the kingdom of the queen, create our kingdom’, which became one of the famous slogans which helped to organise his guerrilla army and attack the British army in different parts of the plateau.
Birsa died on June 9, 1990 while being in Ranchi jail due to his bad health of cholera but his followers refrain from the official statement. After his death the Hul faded, but forced the authority to enact the Chota Nagpur Tenancy Act which entitled the freedom of millions of tribes.
His legacy strives till date and the State of Jharkhand was made out of Bihar on his birth anniversary in 2000.
|
english
|
<filename>mulequiz/src/main/resources/web/s/main.css
:root {
--global-font-size: 13px;
--global-line-height: 1.6em;
--global-space: 6px;
--background-color: #222225;
--page-width: 60em;
--font-color: #e8e9ed;
--invert-font-color: #222225;
--tertiary-color: #a3abba;
--secondary-color: #a3abba;
--primary-color: #62c4ff;
--progress-bar-background: #3f3f44;
--progress-bar-fill: #62c4ff;
--code-bg-color: #3f3f44;
--input-style: solid;
--display-h1-decoration: none;
--animate-duration: 800ms;
--animate-delay: 0.1s;
}
html, body, #app{
height: 100%;
}
#intro {
padding: 12px;
}
#app {
padding: 12px;
display: grid;
grid-template-columns: 1fr;
grid-template-rows: min-content 1fr min-content min-content;
}
#header {
grid-row: 1;
}
#messages {
grid-row: 2;
overflow: scroll;
padding-top: 10px;
}
#newmsg {
grid-row: 3;
}
#footer {
grid-row: 4;
}
#new {
padding-bottom: 32px;
}
.btn-start {
padding: 0.1em 1.6em;
font-size: 0.8em;
}
.input-nickname {
border: 1px var(--input-style) var(--font-color);
font-family: var(--font-stack);
}
|
css
|
Mumbai : With the rampant mushrooming of escort services and sex rackets in the state, the situation has gone alarming. Taking serious note of the situation, the Bombay high court on Friday rapped the state for its poor investigation into advertisements, including the online ones that offer escort services.
“Your mandate is to give a clean and peaceful society to the citizens,” said a bench of Chief Justice Manjula Chellur and Justice Girish Kulkarni while hearing a PIL filed by Ali Ahmed Siddiqui, who said sex rackets were being run under the guise of escort services. The bench said the “grievance canvassed by the petitioner is of a very serious nature which touches upon the moral integrity of the country and requires better handling of investigation by responsible officers of the department”. It has summoned the heads of the social services branch, the crime branch and the CID on Monday.
The government’s advocate, Poornima Kantharia, said that the police has been apprising the court of action taken. But the judges said they are not satisfied with it. Siddiqui’s advocate Debashish Mitra said he could demonstrate that the phone lines are working and the websites are active. But Kantharia reiterated that action has been taken and since phone numbers have changed, the police are unable to trace the persons responsible.
|
english
|
Arunachal Pradesh Chief Minister Nabam Tuki on Wednesday finally got a Council of Ministers in place,15 days after he took over,with Jarkar Gamlin,elder brother of ousted chief minister Jarbom Gamlin,also finding a berth.
The 11 ministers who were sworn in at a function at Raj Bhavan in Itanagar by Governor J J Singh,also included four members who are said to have stood by Jarbom Gamlin while the Congress government in the state was almost defunct for the past two months due to internal bickering.
Tukis Cabinet included four new faces Tapang Taloh,Kamlung Mosang,Rajesh Tacho and Jarkar Gamlin. Of these,Tapang Taloh was deputy speaker for the past two years.
Six others who were members in the Gamlin Cabinet Atum Welly,Setong Sena,Tanga Byaling,Bosiram Siram,Chowna Mein and Pema Khandu were also inducted.
Newlai Tingkhatra,the 11th minister sworn in had served as a minister under three chief ministers Gegong Apang,Mukut Mithi and Dorjee Khandu,but was not in the Gamlin government.
|
english
|
{"name": "swapi-graphene", "description": "GraphQL Starwars API using Graphene and Django", "license": null, "starNum": 136, "folkNum": 26, "watchNum": 136, "topic": []}
|
json
|
{
"country": "VA, USA",
"home": "http://lithespeed.com/",
"name": "<NAME>",
"twitter": "saugustine"
}
|
json
|
<reponame>Munchic/pysam<filename>tests/StreamFiledescriptors_test.py<gh_stars>0
import os
import subprocess
import threading
import errno
import unittest
from pysam import AlignmentFile
DATADIR = os.path.abspath(os.path.join(
os.path.dirname(__file__),
"pysam_data"))
def alignmentfile_writer_thread(infile, outfile):
def _writer_thread(infile, outfile):
"""read from infile and write to outfile"""
try:
i = 0
for record in infile:
outfile.write(record)
i += 1
except IOError as e:
if e.errno != errno.EPIPE:
pass
finally:
outfile.close()
writer = threading.Thread(target=_writer_thread, args=(infile, outfile))
writer.daemon = True
writer.start()
return writer
class StreamTest(unittest.TestCase):
def stream_process(self, proc, in_stream, out_stream, writer):
with AlignmentFile(proc.stdout) as infile:
read = 0
for record in infile:
read += 1
return 0, read
def test_text_processing(self):
proc = subprocess.Popen('head -n200',
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
shell=True)
in_stream = AlignmentFile('pysam_data/ex1.bam')
out_stream = AlignmentFile(proc.stdin, 'wh', header=in_stream.header)
writer = alignmentfile_writer_thread(in_stream,
out_stream)
written, read = self.stream_process(proc,
in_stream,
out_stream,
writer)
self.assertEqual(read, 198)
def test_samtools_processing(self):
proc = subprocess.Popen('samtools view -b -f 4',
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
shell=True)
in_stream = AlignmentFile('pysam_data/ex1.bam')
out_stream = AlignmentFile(proc.stdin, 'wb', header=in_stream.header)
writer = alignmentfile_writer_thread(in_stream,
out_stream)
written, read = self.stream_process(proc,
in_stream,
out_stream,
writer)
self.assertEqual(read, 35)
if __name__ == "__main__":
unittest.main()
|
python
|
Graduate Aptitude Test in Engineering GATE 2021 Result has been declared and is now availabe online. Candidates who have appeared for the examination can now check their results online on the direct link provided below. IIT Bombay has released the result 3 days ahead of scheduled date of March 22. Check your result on GOAPS link below now.
The final answer keys of GATE, was released day before by the institute, signalling the early release of the result. A total of 913275 admit cards were issued by IIT Bombay. Of these, a total of 711542 candidates appeared for the various papers this year. Candidates are also advised to go through the important instructions regarding the SCORE CARD and other GATE Result information.
All those who have appeared for the examination are advised to keep a check on the official website regarding announcements. The scorecard would be made available on gate. iitb. ac. in as well.
|
english
|
Usaha kekal kami adalah sikap "menghormati pasaran, mengambil kira adat, menganggap sains" serta teori "kualiti asas, mempunyai keyakinan pada yang pertama dan pengurusan yang maju" untuk Sijil IOS Ketukangan Indah Mengurangkan Kelajuan Planetary , Kami telah membina reputasi yang boleh dipercayai di kalangan ramai pelanggan.Kualiti & diutamakan pelanggan sentiasa kami usahakan.Kami tidak berusaha keras untuk menghasilkan produk yang lebih baik.Nantikan kerjasama jangka panjang dan faedah bersama!
Pencarian abadi kami adalah sikap "menghormati pasaran, menganggap adat, menganggap sains" serta teori "kualiti yang asas, mempunyai keyakinan pada yang pertama dan pengurusan yang maju" untukPengurang Planet, pengurang, Pengurangan Kelajuan, Banyak item mematuhi sepenuhnya garis panduan antarabangsa yang paling ketat dan dengan perkhidmatan penghantaran kadar pertama kami, anda akan menghantarnya pada bila-bila masa dan di mana-mana tempat.Dan kerana Kayo berurusan dalam keseluruhan spektrum peralatan perlindungan, pelanggan kami tidak sepatutnya membuang masa membeli-belah.
Dengan peningkatan berterusan pengeluaran dan pengukuran, kami telah memajukan lagi sifat dan prestasi kotak gear planet siri ini.
Konfigurasi Mekanikal:
Pemacu hidrostatik IGC-T80 terdiri daripada kotak gear planet dan brek pelbagai cakera jenis basah.Pengubahsuaian tersuai untuk peranti anda tersedia pada bila-bila masa.
Siri IGC-T80Kotak Gear PlanetaryParameter Utama:
BERAT (Kg)
|
english
|
and even of angels?
If I did not love others,
or a clanging cymbal.
and all knowledge?
that moved mountains?
I would be nothing,
unless I loved others.
I would gain nothing,
unless I loved others.
4 Love is patient and kind,
never jealous, boastful,
proud, or 5 rude.
or quick tempered.
of wrongs that others do.
6 Love rejoices in the truth,
but not in evil.
7 Love is always supportive,
loyal, hopeful,
and trusting.
8 Love never fails!
will stop,
be spoken.
will be forgotten.
9 We don't know everything,
are not complete.
will someday appear,
will then disappear.
11 When we were children,
as children do.
But when we grew up,
we quit our childish ways.
in a mirror.
face to face.
We don't know everything,
but then we will,
understands us.
13 For now there are faith,
hope, and love.
But of these three,
the greatest is love.
13 If I speak in the tongues[a](A) of men or of angels, but do not have love, I am only a resounding gong or a clanging cymbal. 2 If I have the gift of prophecy(B) and can fathom all mysteries(C) and all knowledge,(D) and if I have a faith(E) that can move mountains,(F) but do not have love, I am nothing. 3 If I give all I possess to the poor(G) and give over my body to hardship that I may boast,[b](H) but do not have love, I gain nothing.
4 Love is patient,(I) love is kind. It does not envy, it does not boast, it is not proud.(J) 5 It does not dishonor others, it is not self-seeking,(K) it is not easily angered,(L) it keeps no record of wrongs.(M) 6 Love does not delight in evil(N) but rejoices with the truth.(O) 7 It always protects, always trusts, always hopes, always perseveres.(P)
8 Love never fails. But where there are prophecies,(Q) they will cease; where there are tongues,(R) they will be stilled; where there is knowledge, it will pass away. 9 For we know in part(S) and we prophesy in part, 10 but when completeness comes,(T) what is in part disappears. 11 When I was a child, I talked like a child, I thought like a child, I reasoned like a child. When I became a man, I put the ways of childhood(U) behind me. 12 For now we see only a reflection as in a mirror;(V) then we shall see face to face.(W) Now I know in part; then I shall know fully, even as I am fully known.(X)
13 And now these three remain: faith, hope and love.(Y) But the greatest of these is love.(Z)
Copyright © 1995 by American Bible Society For more information about CEV, visit www.bibles.com and www.cev.bible.
Holy Bible, New International Version®, NIV® Copyright ©1973, 1978, 1984, 2011 by Biblica, Inc.® Used by permission. All rights reserved worldwide.
NIV Reverse Interlinear Bible: English to Hebrew and English to Greek. Copyright © 2019 by Zondervan.
|
english
|
Dillon Danis’ claims that the boxing contest between Jake Paul and Anderson Silva was rigged has found a home, with UFC Middleweight contender seconding the claim in a cryptic tweet.
The Jake Paul-Anderson Silva bout came to a close this past Saturday night with Paul picking up a unanimous decision victory over the former UFC Middleweight champion, Anderson Silva. The triumph could prove to be a pivotal and acute moment in the 25-year-old’s boxing career.
The pinnacle of the contest was obtained when Paul knocked down Silva in the eighth and final round. However, fans and certain fighters have seemed to notice an apparent discrepancy in the knockdown.
After Dillon Danis, UFC Middleweight contender Paulo Costa reckons that the contest was rigged. Taking to Twitter, Paulo Costa tweeted a laughable quote, which included UFC President, Dana White.
Dillon Danis had previously tweeted the following as well.
Was the Jake Paul-Anderson Silva contest manipulated?
As has been the theme since his highlight reel knockout of former UFC Welterweight champion, Tyron Woodley, Jake Paul has come under scrutiny and been on the receiving end of questions regarding whether the contests were fixed.
In his match against Woodley, fans deduced an apparent sign from ‘The Chosen One’, a split second before he was knocked out cold with an overhand right from Jake Paul.
Against Anderson Silva, footage has emerged that although the initial jab connected with Silva’s face, one specific angle has displayed that there wasn’t any concrete contact on the straight right landed on the ‘Spider’.
Yet, at the very base, someone who holds the reputation and credibility that Anderson Silva does, would not take a ‘dive’ for money. No matter the amount.
The fact remains that on that very night, Jake Paul was the superior combatant inside the squared circle.
A potential Paulo Costa-Jake Paul showdown?!
Paulo Costa has been an active member of the Twitter community. ‘Borrachinha’ has been a facetious force on the platform, to say the least. His antics have earned him a large following, needless to say.
Costa had recently taken to his favorite platform to call out Jake Paul, in a video that displayed his tremendous physique, and immaculate shadowboxing. The ‘Eraser’ had channeled his inner Mike Tyson and paid an ode to the boxing legend with the footage.
Provided that the fight comes to fruition, it would make for an intriguing contest, but make no mistake, Paulo Costa will be the clear favorite going into the fight.
|
english
|
*{padding:0; margin:0; border:0; list-style:none;}
a{color: #717171;text-decoration: none;cursor: pointer;}
body{width: 100%;background: #FAFBFB url(../img/crm-bg.jpg)no-repeat;-webkit-background-size: 100%;background-size: 100% 700px;color: #3A3A3A;font-size: 12px;font-family: '微软雅黑';font-style: normal}
#header{width: 980px;height: 100px;margin: auto;border-bottom: 1px solid #929291;}
#header h1{width: 200px;margin-top: 30px;margin-left:10px;font-size: 28px;line-height: 30px;color: white;float: left;}
#header h1 img{margin-right: 10px;vertical-align: middle;}
#header h1 span{display: inline-block;vertical-align: middle;}
#header ul{float: right;color: white;}
#header ul li{float: left;padding:0 10px;font-size: 14px;line-height: 100px;transition: all 0.5s;}
#header ul li a{color: white;font-weight: lighter;}
#header ul li:hover a{color: skyblue;}
#con{width: 980px;height: 635px;margin: auto;overflow: hidden;}
#con .left{width: 600px;height: 500px;float: left;margin-top: 100px;}
#con .left h2{font-size: 40px;color: white;margin-bottom: 20px;}
#con .left>p{width: 600px;line-height: 24px;font-size: 14px;color: #CECCC8;}
#con .left>p span{color:#C92133;}
#con .left .icon{margin-top: 30px;overflow: hidden;}
#con .left .icon dl{float: left;width: 170px;margin: 10px;text-align: center;}
#con .left .icon dl dd{margin-top: 10px;}
#con .left .icon dl h3{color: white;font-weight: normal;}
#con .left .icon dl:nth-of-type(3) dt{height: 60px;color:#1163A8;font-size: 32px; line-height: 120px;height: 120px}
#con .left .icon dl p{margin-top: 10px;color: #CECCC8;}
#con .right{float: right;margin-top:100px;margin-right: 20px; }
#con .right input{display: block;line-height: 30px;width: 300px;height: 30px;margin-bottom: 20px;outline: none;border: 1px solid #ccc;border-right: 10px;padding-left: 10px}
#con .right input:nth-of-type(3){width: 310px;color: white;background: red;border: none;font-size: 14px;cursor: pointer;}
#footer{width: 980px;overflow: hidden;margin: auto;}
#footer p{font-size: 24px;color: #323130;text-align: center;width: 980px;}
#footer .detail{margin-top: 20px;}
#footer .detail dl{float: left;width: 30%;margin:10px;overflow: hidden;}
#footer .detail dl dt{font-size: 16px;margin-bottom: 10px}
#footer .detail dl dd{line-height: 20px;}
|
css
|
Samsung Galaxy Note 20 series will be the most powerful with improved hardware, but probably almost the same design which we saw in the last year's Galaxy Note 10 lineup. A latest leaked render shows off the upcoming Galaxy Note 20 from all angles and suggests that it might retain similar design elements like the centred punch-hole display.
Tipster Ice Universe shared the high-resolution render on Twitter and the phone can be seen sporting a black colour paint job and a rectangular-shaped camera array housing three sensors alongside an LED flash.
The most notable difference between the Galaxy Note 10 and the Galaxy Note 20 in terms of design could be the camera placing. The Note 10 brought the boring triple camera module planted vertically on the back panel while now the Galaxy Note 20 is expected to grace a rectangle-shaped array.
The lineup was earlier tipped to be powered by an octa-core Samsung Exynos 992 chipset instead of the Exynos 990 SoC. But, now tipster Max Weinbach suggests that there are no references to any new chipset besides the Snapdragon 865 Plus in the firmware of One UI 2. 5 and both the Galaxy Note 20 and Note 20 Ultra will continue using the Exynos 990 processor.
This might not be good news for users as Samsung Galaxy Note 20 is expected to bring improved performance. But, now it appears users might have to stick with Exynos 990 at least in India while in markets like the U. S, the handset is tipped to bring the latest Qualcomm Snapdragon 865 Plus processor.
|
english
|
Ara Mela Me Sali Jaam Badue song is a Bhojpuri pop song from the Maai Lorawa Pochh Da Na released on 2018. Music of Ara Mela Me Sali Jaam Badue song is composed by Kalika Studio Ara. Ara Mela Me Sali Jaam Badue was sung by Dasai Yadav. Download Ara Mela Me Sali Jaam Badue song from Maai Lorawa Pochh Da Na on Raaga.com.
|
english
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.