text stringlengths 1 1.04M | language stringclasses 25 values |
|---|---|
package forticlient
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
)
type JSONSystemCertificateDownload struct {
Mkey string `json:"mkey"`
Type string `json:"type"`
}
// Downloads certificate from Fortigate
func (c *FortiSDKClient) ReadSystemCertificateDownload(data *JSONSystemCertificateDownload, vdomparam string) (res string, err error) {
HTTPMethod := "GET"
path := "/api/v2/monitor/system/certificate/download"
mkey := data.Mkey
cert_type := data.Type
params := make(map[string][]string)
params["mkey"] = []string{mkey}
params["type"] = []string{cert_type}
req := c.NewRequest(HTTPMethod, path, ¶ms, nil, 0)
err = req.Send3(vdomparam)
if err != nil || req.HTTPResponse == nil {
err = fmt.Errorf("cannot send request %s", err)
return
}
body, err := ioutil.ReadAll(req.HTTPResponse.Body)
req.HTTPResponse.Body.Close() //#
if err != nil || body == nil {
err = fmt.Errorf("cannot get response body %s", err)
return
}
log.Printf("FOS-fortios reading response: %s", string(body))
// if success returns string containing certificate so we want to parse and check it
// didn't fail such as if requesting a cert that doesn't exist
var result map[string]interface{}
json.Unmarshal([]byte(string(body)), &result)
if result["status"] == "error" {
err = fortiAPIErrorFormat(result, string(body))
if err != nil {
err = fmt.Errorf("error downloading certificate: %s", err)
return
}
}
res = string(body)
return
}
| go |
package org.reactor.jira.response;
import org.reactor.jira.model.JiraSprintWithDetails;
import org.reactor.response.ReactorResponse;
import org.reactor.response.renderer.ReactorResponseRenderer;
public class JiraSprintDetailsResponse implements ReactorResponse {
private static final char DIVIDER_CHARACTER = '-';
private JiraSprintWithDetails jiraSprintWithDetails;
public JiraSprintDetailsResponse(JiraSprintWithDetails jiraSprintWithDetails) {
this.jiraSprintWithDetails = jiraSprintWithDetails;
}
@Override
public void renderResponse(ReactorResponseRenderer responseRenderer) {
printSprintHeader(responseRenderer);
printSprintDates(responseRenderer);
}
private void printSprintDates(ReactorResponseRenderer responseRenderer) {
responseRenderer.renderTextLine("Start date: %s", jiraSprintWithDetails.getStartDate());
if (jiraSprintWithDetails.isActive()) {
responseRenderer.renderTextLine("This sprint is still active!");
} else {
responseRenderer.renderTextLine("Completed date: %s", jiraSprintWithDetails.getCompleteDate());
}
}
private void printSprintHeader(ReactorResponseRenderer responseRenderer) {
String header = jiraSprintWithDetails.getName();
responseRenderer.renderTextLine(header);
generateDivider(responseRenderer, header.length());
}
private void generateDivider(ReactorResponseRenderer responseRenderer, int length) {
StringBuilder dividerBuffer = new StringBuilder();
for (int index = 0; index < length; index++) {
dividerBuffer.append(DIVIDER_CHARACTER);
}
responseRenderer.renderTextLine(dividerBuffer.toString());
}
}
| java |
export class Sheet {
id: number;
name: string;
style: string;
date: string;
sheet: string;
finished: boolean;
specs: boolean;
xml: boolean;
pdf: boolean;
}
export interface SheetPage {
content: Sheet[];
pageable: {
sort: {
sorted: boolean,
unsorted: boolean,
empty: boolean,
},
offset: number,
pageSize: number,
pageNumber: number,
paged: boolean,
unpaged: boolean,
};
totalPages: number;
totalElements: number;
last: boolean;
size: boolean;
number: number;
numberOfElements: number;
sort: {
sorted: boolean,
unsorted: boolean,
empty: boolean,
};
first: boolean;
empty: boolean;
}
| typescript |
<filename>projectName/core/generator_files/templates/generator_template_angular_controller.html
/*************************************************************************************************
** Modulo Controller **
**************************************************************************************************/
/*------------------------------- Area Modulo Controller --------------------------------*/
// angular.module se compone de ('Nombre del modulo',[dependencias]) Inyectables
var app = angular.module("{nameApp}", []);
/*------------------------------- Area Modulo Controller --------------------------------*/
/*------------------------------- Area Modulo Controller --------------------------------*/
//.controller ('Nombre Controller', directiva en function($scope)) Inyectables
app.controller('{nameApp}_Controller', function($scope, $timeout, $rootScope, $http) {
/*-------------------------- Area de Declaracion ------------------------------*/
//*************************( Contenido del controller )********************************
$scope.variable = "variable";
//**************************************************************************************
//*************************( Contenido del controller global)***************************
//Variable Global rootScope
$rootScope.variable = "variable global"
//**************************************************************************************
/*-------------------------- Area de Declaracion ------------------------------*/
/*-------------------------- $apis ------------------------------*/
//*************************( Consulta a Base de Datos )********************************
$scope.$api = {
/**
* Para hacer un request por POST
* @return JSON en Consola
*/
consultaPost: function() {
/**
* dataService Realiza la peticion POST data (Para enviar parametros por POST )
* @type $http
*/
var dataService = $http({
method: 'POST',
url: 'http://localhost/projectName/site_media/html/modules/servicioMC/servicioController.php',
data: {
nombre: 'ejemplo'
},
headers: {
'Content-Type': 'application/json'
}
});
/**
* Control de respuesta
* @param $http response Peticion
* @return none
*/
dataService.then(function(response){
console.log(response.data);
},function(response){
console.log("Error");
});
},
/**
* Para hacer un request por GET
* @return JSON en Consola
*/
consultaGet: function() {
/**
* dataService Realiza la peticion GET params (Para enviar parametros por GET ?String=String )
* @type $http
*/
var dataService = $http({
method: 'GET',
url: 'http://localhost/projectName/site_media/html/modules/servicioMC/servicioController.php',
params: {
nombre: 'ejemplo'
},
headers: {
'Content-Type': 'application/json'
}
});
/**
* Control de respuesta
* @param $http response Peticion
* @return none
*/
dataService.then(function(response){
console.log(response.data);
},function(response){
console.log("Error");
});
}
};
//**************************************************************************************
/*-------------------------- $apis ------------------------------*/
/*-------------------------- $gui ------------------------------*/
//*************************( Ejecuciones de la pantalla )******************************
$scope.$gui = {
ejemplo: function() {
$scope.variable = "Nuevo Valor pantalla";
}
};
//**************************************************************************************
/*-------------------------- $gui ------------------------------*/
/*-------------------------- $tools ------------------------------*/
//************************* ( Ejecuciones Simples ) ********************************
$scope.$tools = {
ejemplo: function() {
$scope.variable = "Nuevo Valor Tools";
}
};
//**************************************************************************************
/*-------------------------- $tools ------------------------------*/
/*-------------------------- $complexSystem ------------------------------*/
//*************************( Ejecuciones Complejas ) ********************************
$scope.$complexSystem = {
ejemplo: function() {
$scope.variable = "Nuevo Valor Complejo";
}
};
//**************************************************************************************
/*-------------------------- $complexSystem ------------------------------*/
/*-------------------------- Arranque ------------------------------*/
console.log("Hello World!");
//Ejemplo de ejecucion
$scope.$complexSystem.ejemplo();
console.log($scope.variable);
/**
* Request GET
*/
$scope.$api.consultaGet();
/**
* Request POST
*/
$scope.$api.consultaPost();
/*-------------------------- Arranque ------------------------------*/
})
/*---------------------------------------------Area Modulo Controller-----------------------------------------------*/
//************************************************************************************************************************
| html |
{"cam/image_array":"4035_cam-image_array_.jpg","user/throttle":0.0,"user/angle":0.07988561689853668,"user/mode":"user"} | json |
<reponame>pocsap/Webchat
{
"application":{
"title": "日本語タイトル",
"hello": "こんにちは、%{name}!",
"welcome": "こんにちは!\nようこそ %{headerTitle} へ!",
"welcomeWithName": "こんにちは %{userId} さん!\nようこそ %{headerTitle} へ!"
},
"message":{
"forLang&Intent": "[自動送信メッセージ] ブラウザ言語から判断して日本語で処理するようにします。",
"reset": "チャット内容をリセットしてください。",
"askUserID": "あなたの SAP User ID を教えてください"
},
"dropArea":{
"areaMessage": "ここをクリックしてファイルを選択するか、直接ファイルをここにドロップしてください。",
"acceptedExtentions": "もしファイルが拒否された場合は、インシデントが作成されてからそこに直接添付してください。"
},
"botMessage":{
"sendingDropFiles": "ドロップされたファイルを中間サーバーに転送しています。",
"sendFilesSuccess": "ドロップされたファイルを正常に中間サーバーに転送しました。",
"sendFilesFailed": "ドロップされたファイルの中間サーバーへの転送に失敗しました。"
},
"triggerPhrase":{
"calendar": "**発生日時**を入力してください",
"dropArea": "添付するファイルを選択、もしくはドロップエリアにドロップしてください。"
}
} | json |
Actress Mary Elizabeth Winstead, known for her work in films like "Final Destination 3" and "The Thing", has landed a series regular role on comedy-crime drama anthology TV series "Fargo".
She will star opposite Ewan McGregor and Carrie Coon.
Winstead, 31, will play Nikki Swango, a crafty and alluring recent parolee with a passion for competitive bridge playing. Nikki is a woman with a plan, focused on always being at least one move ahead of her opponents, reported Aceshowbiz.
"Fargo" season three is set in 2010, a few years after the events in the first season and a few decades after season two.
READ ALSO:
It centres on brothers named Emmit and Ray Stussy, both played by McGregor, who not only look quite different but also lead two different lives.
The older one, Emmit, is the Parking Lot King of Minnesota. A handsome, self-made, real estate mogul and family man, he sees himself as an American success story. His slightly younger brother, on the other hand, is more of a cautionary tale. Balding and pot-bellied, Ray is the kind of guy who peaked in high school. Now a parole officer, he has a huge chip on his shoulder about the hand he's been dealt, and he blames Emmit for his misfortunes.
Coon plays Gloria Burgle, the chief of the Eden Valley police, and a newly divorced mother, who is struggling to understand this new world around her where people connect more intimately with their phones than the people right in front of them.
Production on the new season is slated to begin later this year for a 2017 premiere.
Actress Mary Elizabeth Winstead, known for her work in films like "Final Destination 3" and "The Thing", has landed a series regular role on comedy-crime drama anthology TV series "Fargo".
| english |
اِنَّ الَّذِيْنَ يُؤْذُوْنَ اللّٰهَ وَرَسُوْلَهٗ لَعَنَهُمُ اللّٰهُ فِى الدُّنْيَا وَالْاٰخِرَةِ وَاَعَدَّ لَهُمْ عَذَابًا مُّهِيْنًا ( الأحزاب: ٥٧ )
Innal lazeena yu'zoonal laaha wa Rasoolahoo la'anahumul laahu fid dunyaa wal Aakhirati wa a'adda lahum 'azaabam muheenaa (al-ʾAḥzāb 33:57)
Sahih International:
Indeed, those who abuse Allah and His Messenger – Allah has cursed them in this world and the Hereafter and prepared for them a humiliating punishment. (Al-Ahzab [33] : 57)
Surely, those who annoy Allah and His Messenger are cursed by Allah in this world and in the Hereafter, and He has prepared for them a humiliating punishment.
Surely those who offend Allah[[ By attributing children to Him or associating gods with Him in worship. ]] and His Messenger[[ By calling him a liar or speaking ill of him and his family. ]] are condemned by Allah in this world and the Hereafter. And He has prepared for them a humiliating punishment.
Those who offend Allah and His Messenger are cursed by Allah in this world and in the Hereafter, and He has prepared for them a humiliating punishment.
Those who hurt God and His Messenger -- them God has cursed in the present world and the world to come, and has prepared for them a humbling chastisement.
Verily those who annoy Allah and His apostle, --Allah hath cursed them in the world and the Hereafter, and hath gotten ready for them a torment Ignominious.
Those who annoy Allah and His Messenger - Allah has cursed them in this World and in the Hereafter, and has prepared for them a humiliating Punishment.
Verily those who cause annoyance to Allah and His Messenger - Allah has cursed them in this world and in the Hereafter and has prepared for them a humiliating chastisement.
Those who offend God and His Prophet will be damned in this world and the next. There is a shameful punishment ready for them.
Indeed those who trouble Allah and His Noble Messenger – upon them is Allah’s curse in the world and in the Hereafter, and Allah has kept prepared a disgraceful punishment for them. (To disrespect / trouble the Holy Prophet – peace and blessings be upon him – is blasphemy.)
Indeed those who offend Allah and His Apostle are cursed by Allah in the world and the Hereafter, and He has prepared a humiliating punishment for them.
Those who affront God and His Messenger (through disrespect for Him in words and acts and for His Messenger and Islamic values), God certainly curses them (excludes them from His mercy) in this world and the Hereafter, and has prepared for them a shameful, humiliating punishment.
Verily, those who malign Allâh and His Messenger (and are guilty of false accusation), Allâh has condemned them in this world and in the next and He has prepared a humiliating punishment for them.
That truly those who harm mildly God and His messengers, God cursed/humiliated them in the present world, and the end (other life), and He prepared for them a disgracing/degrading torture.
Indeed those who trouble Allah and His Noble Messenger – upon them is Allah’s curse in the world and in the Hereafter, and Allah has kept prepared a disgraceful punishment for them. (To disrespect / trouble the Holy Prophet – peace and blessings be upon him – is blasphemy.)
Surely Allah and His angels bless the Prophet; O you who believe! Call for Divine blessings on him and salute him with a becoming salutation.
Verily, those who annoy Allah and His Messenger (SAW) Allah has cursed them in this world, and in the Hereafter, and has prepared for them a humiliating torment.
Surely Allah and His angels bless the Prophet. O you who believe, call for blessings on him and salute him with a (becoming) salutation.
Surely (as for) those who speak evil things of Allah and His Apostle, Allah has cursed them in this world and the here after, and He has prepared for them a chastisement bringing disgrace.
Lo! those who malign Allah and His messenger, Allah hath cursed them in the world and the Hereafter, and hath prepared for them the doom of the disdained.
Those who annoy God and His Messenger will be condemned by God in this life and in the life to come. He has prepared for them a humiliating torment.
Those who (try to) hurt Allah and His Messenger shall be cursed by Allah in this present life and in the Everlasting Life, and He has prepared for them a humbling punishment.
Verily, those who annoy Allah and His Messenger, Allah has cursed them in this world and in the Hereafter, and has prepared for them a humiliating torment.
Those who annoy God and His Messenger shall be cursed by God in this world and in the Hereafter. God has prepared for them a humiliating punishment.
Those who insult God and His Messenger, God has cursed them in this life and in the Hereafter, and has prepared for them a demeaning punishment.
Indeed those who are injurious to God and His Messenger -- and they are the disbelievers, who attribute to God what He is exalted above of such things as [His having] a son or a partner and they deny His Messenger -- God has cursed them in this world and the Hereafter, He has banished them [from His mercy], and has prepared for them a humiliating chastisement, and that is the Fire.
Whoever annoys Allah and His Messenger, is cursed in this World and the Hereafter Here,
Allah says;
Verily, those who annoy Allah and His Messenger, Allah has cursed them in this world and in the Hereafter, and has prepared for them a humiliating torment.
Allah warns and threatens those who annoy Him by going against His commands and doing that which He has forbidden, and who persist in doing so, and those who annoy His Messenger by accusing him of having faults or shortcomings -- Allah forbid.
Ikrimah said that the Ayah;
(Verily, those who annoy Allah and His Messenger), was revealed concerning those who make pictures or images.
In The Two Sahihs, it is reported that Abu Hurayrah said;
"The Messenger of Allah said;
Allah says;"The son of Adam annoys Me by inveighing against time, but I am time, for I cause the alternation of night and day.""
The meaning of this Hadith is that in the Jahiliyyah they used to say, "How bad time is, it has done such and such to us!"
They used to attribute the deeds of Allah to time, and inveigh against it, but the One Who did that was Allah, may He be exalted. So, He forbade them from this.
Al-`Awfi reported that Ibn Abbas said that the Ayah,
(Verily, those who annoy Allah and His Messenger), was revealed about those who slandered the Prophet over his marriage to Safiyyah bint Huyay bin Akhtab. The Ayah appears to be general in meaning and to apply to all those who annoy him in any way, because whoever annoys him annoys Allah, just as whoever obeys him obeys Allah.
| english |
<reponame>33kk/uso-archive<gh_stars>100-1000
{
"id": 179114,
"info": {
"name": "PaymoApp Tuneup",
"description": "Small visual improvements",
"additionalInfo": "- There is less emphasis on adding tasks buttons, on meta-canban boards.\r\n- Reduced visual noise of task list names in meta-canban boards",
"format": "uso",
"category": "paymoapp",
"createdAt": "2020-01-14T06:23:06.000Z",
"updatedAt": "2020-05-22T04:45:11.000Z",
"license": "NO-REDISTRIBUTION",
"author": {
"id": 276601,
"name": "nikitakozin"
}
},
"stats": {
"installs": {
"total": 5,
"weekly": 1
}
},
"screenshots": {
"main": {
"name": "179114_after.png",
"archived": true
}
},
"discussions": {
"stats": {
"discussionsCount": 0,
"commentsCount": 0
},
"data": []
},
"style": {
"css": "@-moz-document domain(\"app.paymoapp.com\") {\r\n.task__tag { border: 0; }\r\n.task__tag--project-board,\r\n.task__tag--tasklist-board { padding-left: 0; }\r\n.task__tag--tasklist-board .icon-tasklist-tag { display: none; }\r\n.x6-metakanban .kanban-add-card-button {\r\n\tbox-shadow: none;\r\n\tbackground: transparent;\r\n\tpadding: 9px 10px 8px 10px;\r\n\tborder: 0;\r\n}\r\n.x6-metakanban .kanban-add-card-button:hover {\r\n\tbox-shadow: none;\r\n\ttransition: none;\r\n\tcolor: #383838;\r\n}\r\n\r\n.x6-metakanban .kanban-add-card-button:hover .x6-btn-inner-icon-text-small,\r\n.x6-metakanban .kanban-add-card-button:hover .x6-btn-icon-el-icon-text-small {\r\n\tcolor: #383838\r\n}\r\n\r\n.kanban-card:hover {\r\n\ttransition: none;\r\n}\r\n\r\n.project-code { display: none; }\r\n.simple .subtitle { opacity: .5; float: left; display: none; }\r\n.simple .subtitle:after {\r\n\tcontent: \"·\";\r\n\tpadding: 0 10px;\r\n}\r\n.simple .description { float: left; opacity: .5; display: none !important; }\r\n.simple .description .label { display: none; }\r\n}"
}
} | json |
body{
margin:0;
padding:0;
}
h1{
text-align:center;
color:white;
font-size:70px;
font-family: 'Megrim', cursive;
} | css |
{
"name": "ESP8266Time",
"version": "1.0.0",
"keywords": "Arduino, ESP8266, Time, Internal RTC",
"description": "An Arduino library for setting and retrieving internal RTC time on ESP8266 boards",
"repository":
{
"type": "git",
"url": "https://github.com/3tawi/Esp8266Time"
},
"authors":
[
{
"name": "3tawi",
"youtube": "https://www.youtube.com/c/GreatProjects",
"maintainer": true
}
],
"frameworks": "arduino",
"platforms": "esp8266"
}
| json |
package nl.knaw.huc.service.task;
import nl.knaw.huc.core.Version;
import nl.knaw.huc.db.VersionsDao;
import org.jdbi.v3.core.Handle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class DeleteVersion implements InTransactionRunner {
private static final Logger log = LoggerFactory.getLogger(DeleteVersion.class);
private final Version version;
public DeleteVersion(Version version) {
this.version = version;
}
@Override
public void executeIn(Handle transaction) {
log.debug("Deleting version: {}", version);
transaction.attach(VersionsDao.class).delete(version.getId());
new DeleteContents(version.getContentsSha()).executeIn(transaction);
}
}
| java |
var modal = document.getElementById("addmod");
var button = document.getElementById("open");
//document.getElementById("button").disabled = true;
var span = document.getElementsByClassName("close")[0];
var span1 = document.getElementsByClassName("close1")[0];
button.onclick = function() {
modal.style.display = 'block';
}
span.onclick = function() {
modal.style.display = "none";
}
span1.onclick = function() {
modal.style.display = "none";
}
window.onclick = function(event) {
if (event.target == modal) {
modal.style.display = "none";
}
}
var modala = document.getElementById("editwala");
var buttona = document.getElementById("open1");
var spana = document.getElementsByClassName("closee")[0];
const span1a = document.getElementsByClassName("close0")[0];
buttona.onclick = function() {
modala.style.display = 'block';
}
spana.onclick = function() {
modala.style.display = "none";
}
span1a.onclick = function() {
modala.style.display = "none";
}
window.onclick = function(event) {
if (event.target == modala) {
modala.style.display = "none";
}
}
var modalaa = document.getElementById("delmod1");
var buttonaa = document.getElementById("op");
var spanaa = document.getElementsByClassName("closeee")[0];
const span1aa = document.getElementsByClassName("close22")[0];
buttonaa.onclick = function() {
modalaa.style.display = 'block';
}
spanaa.onclick = function() {
modalaa.style.display = "none";
}
span1aa.onclick = function() {
modalaa.style.display = "none";
}
window.onclick = function(event) {
if (event.target == modalaa) {
modalaa.style.display = "none";
}
}
function toggle(source) {
var checkboxes = document.querySelectorAll('input[type="checkbox"]');
for (var i = 0; i < checkboxes.length; i++) {
if (checkboxes[i] != source)
checkboxes[i].checked = source.checked;
}
}
const showHeader=()=>{
const headerData=JSON.parse(headers);
const tableMain=document.getElementById("main-table");
let tableRowEle='<tr class="header">';
headerData.forEach(tableRow => {
tableRowEle+=`<th class='${String(tableRow).toLowerCase()}'>`+String(tableRow)+'</th>';
});
tableRowEle+='</tr>';
tableMain.innerHTML+=tableRowEle;
}
const showTableonload=(check=true)=>{
if(check)
{
showHeader();//
}
const headerData=data;
const tableMain=document.getElementById("main-table");
headerData.forEach(tableRow=>{
let tableRowEle='<tr>';
Object.entries(tableRow).forEach(entry=>{
const[key,value]=entry;
tableRowEle+=`<td class="${key}">`+value+'</td>';
});
tableRowEle+='</tr>';
tableMain.innerHtml+=tableRowEle;
});
}
const fetchTabledata=()=>{
fetch('http://localhost:8080/H2HBABBA2553/fetch')
.then(response=>{
return response.json()
})
.then(jsonResult=>{
showTableonload(jsonResult)
})
.catch(error=>{
console.log(error)
})
}
(
function(){
fetchTabledata()
}
)()
function clearcontent(elementID)
{
document.getElementById(elementID).innerHTML="";
}
const myPaginationfunc=()=>
{
clearcontent('tableyeh');
start=start+1;
showTable();
}
const myPaginationfunctwo=()=>
{
clearcontent('tableyeh');
start=start-1;
showTable();
}
const submitnow=()=>{
const name_customer=document.getElementById("name_customer".value);
const cust_number=document.getElementById("cust_number".value);
const invoice_id=document.getElementById("invoice_id".value);
const due_in_date=document.getElementById("due_in_date".value);
const total_open_amount=document.getElementById("total_open_amount".value);
fetch(`http://localhost:8080/H2HBABBA2553/add?name_customer=${name_customer}&cust_number=${cust_number}&invoice_id=${invoice_id}&due_in_date=${due_in_date}&total_open_amount=${total_open_amount}`,
{
method:'POST'
}).then(()=>{
showTable()
})
}
| javascript |
<filename>operator/database/kinds/backups/s3/backup/job.go<gh_stars>0
package backup
import (
"github.com/caos/orbos/pkg/labels"
"github.com/caos/zitadel/operator/helpers"
"github.com/caos/zitadel/pkg/databases/db"
batchv1 "k8s.io/api/batch/v1"
"k8s.io/api/batch/v1beta1"
corev1 "k8s.io/api/core/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
func getCronJob(
namespace string,
nameLabels *labels.Name,
cron string,
jobSpecDef batchv1.JobSpec,
) *v1beta1.CronJob {
return &v1beta1.CronJob{
ObjectMeta: v1.ObjectMeta{
Name: nameLabels.Name(),
Namespace: namespace,
Labels: labels.MustK8sMap(nameLabels),
},
Spec: v1beta1.CronJobSpec{
Schedule: cron,
ConcurrencyPolicy: v1beta1.ForbidConcurrent,
JobTemplate: v1beta1.JobTemplateSpec{
Spec: jobSpecDef,
},
},
}
}
func getJob(
namespace string,
nameLabels *labels.Name,
jobSpecDef batchv1.JobSpec,
) *batchv1.Job {
return &batchv1.Job{
ObjectMeta: v1.ObjectMeta{
Name: nameLabels.Name(),
Namespace: namespace,
Labels: labels.MustK8sMap(nameLabels),
},
Spec: jobSpecDef,
}
}
func getJobSpecDef(
nodeselector map[string]string,
tolerations []corev1.Toleration,
accessKeyIDName string,
accessKeyIDKey string,
secretAccessKeyName string,
secretAccessKeyKey string,
sessionTokenName string,
sessionTokenKey string,
backupName string,
image string,
command string,
env *corev1.EnvVar,
) batchv1.JobSpec {
var envs []corev1.EnvVar
if env != nil {
envs = []corev1.EnvVar{*env}
}
return batchv1.JobSpec{
Template: corev1.PodTemplateSpec{
Spec: corev1.PodSpec{
RestartPolicy: corev1.RestartPolicyNever,
NodeSelector: nodeselector,
Tolerations: tolerations,
Containers: []corev1.Container{{
Name: backupName,
Image: image,
Command: []string{
"/bin/bash",
"-c",
command,
},
Env: envs,
VolumeMounts: []corev1.VolumeMount{{
Name: internalSecretName,
MountPath: certPath,
}, {
Name: accessKeyIDKey,
SubPath: accessKeyIDKey,
MountPath: accessKeyIDPath,
}, {
Name: secretAccessKeyKey,
SubPath: secretAccessKeyKey,
MountPath: secretAccessKeyPath,
}, {
Name: sessionTokenKey,
SubPath: sessionTokenKey,
MountPath: sessionTokenPath,
}},
ImagePullPolicy: corev1.PullIfNotPresent,
}},
Volumes: []corev1.Volume{{
Name: internalSecretName,
VolumeSource: corev1.VolumeSource{
Secret: &corev1.SecretVolumeSource{
SecretName: db.CertsSecret,
DefaultMode: helpers.PointerInt32(defaultMode),
},
},
}, {
Name: accessKeyIDKey,
VolumeSource: corev1.VolumeSource{
Secret: &corev1.SecretVolumeSource{
SecretName: accessKeyIDName,
},
},
}, {
Name: secretAccessKeyKey,
VolumeSource: corev1.VolumeSource{
Secret: &corev1.SecretVolumeSource{
SecretName: secretAccessKeyName,
},
},
}, {
Name: sessionTokenKey,
VolumeSource: corev1.VolumeSource{
Secret: &corev1.SecretVolumeSource{
SecretName: sessionTokenName,
},
},
}},
},
},
}
}
| go |
<gh_stars>1-10
(function () {
'use strict';
angular
.module('app.adpForms')
.directive('adpFormFieldContainer', adpFormFieldContainer);
function adpFormFieldContainer(AdpAttrs) {
return {
restrict: 'E',
scope: {
args: '<',
enabled: '<?',
},
templateUrl: 'app/adp-forms/directives/adp-form-field-container/adp-form-field-container.html',
require: '^^form',
transclude: true,
link: function (scope, el, attrs, formCtrl) {
(function init() {
AdpAttrs(el.find('.input-container')[0], scope.args);
setClassCondition();
})();
function setClassCondition() {
if (!conditionsEnabled()) {
scope.successCondition = false;
scope.errorCondition = false;
return;
}
scope.form = formCtrl;
scope.successCondition = successCondition;
scope.errorCondition = errorCondition;
}
function conditionsEnabled() {
if (_.isNil(scope.enabled)) {
return true;
}
return scope.enabled;
}
function successCondition() {
var model = scope.form[scope.args.fieldSchema.fieldName];
if (_.isNil(model)) {
return false;
}
if (scope.args.fieldSchema.required) {
return false;
}
return (model.$dirty && model.$valid) && !!model.$viewValue;
}
function errorCondition() {
var model = scope.form[scope.args.fieldSchema.fieldName];
if (_.isNil(model)) {
return false;
}
return (scope.form.$submitted || model.$dirty) && model.$invalid;
}
}
}
}
})();
| javascript |
#<NAME>
#Jan 28 17
#Voyager Prgm
#Calculates the position of voyager and round trip time of radio comunication given a date after
#variables
# initiald, the initial distance at 9/25/2009
# mph, how fast the space craft is going in mph
# days, days after 9/25/09
# calcdm, calculated distance in miles
# calcdk, calculated dist in kilo
# calcda, calculated dist in au
# time, time it takes for radio waves to travel back and forth
#imports date time and curency handeling because i hate string formating (this takes the place of #$%.2f"%)
import locale
locale.setlocale( locale.LC_ALL, '' )
#use locale.currency() for currency formating
print("Welcome to the Voyager 1 Program\n")
#initializes all the values
initiald = 16637000000
mph = 38241
#ask the user to input the number fo days
days = int(input("How many days after 09/25/09 do you wish to know postion for? "))
#does the maths
calcdm = initiald + days*24*mph
calcdk = calcdm*1.609344
calcda = calcdm/92955887.6
time = 2*calcdm/670616629
print("The Distance in miles is", calcdm,"Miles")
print("The Distance in kilometers is ", calcdk,"KM")
print("The distance in astronomical units is ",calcda,"AU")
print("The round trip radio communications time is ",time,"Hours")
input("\nPress Enter to exit")
| python |
package twofer
import "fmt"
// ExampleShareWith() is an Example function. Examples are testable snippets of
// Go code that are used for documenting and verifying the package API.
// They may be present in some exercises to demonstrate the expected use of the
// exercise API and can be run as part of a package's test suite.
//
// When an Example test is run the data that is written to standard output is
// compared to the data that comes after the "Output: " comment.
//
// Below the result of ShareWith() is passed to standard output
// using fmt.Println, and this is compared against the expected output.
// If they are equal, the test passes.
func ExampleShareWith() {
h := ShareWith("")
fmt.Println(h)
// Output: One for you, one for me.
}
| go |
package org.jabref.gui.externalfiletype;
import org.jabref.gui.actions.SimpleCommand;
public class EditExternalFileTypesAction extends SimpleCommand {
@Override
public void execute() {
CustomizeExternalFileTypesDialog editor = new CustomizeExternalFileTypesDialog();
editor.showAndWait();
}
}
| java |
<reponame>vkuznet/h2o
#!/usr/bin/python
import argparse
import boto
import os, time, sys, socket
import h2o_cmd
import h2o
import h2o_hosts
import json
import commands
import traceback
'''
Simple EC2 utility:
* to setup clooud of 5 nodes: ./ec2_cmd.py create --instances 5
* to terminated the cloud : ./ec2_cmd.py terminate --hosts <host file returned by previous command>
'''
DEFAULT_NUMBER_OF_INSTANCES = 4
DEFAULT_HOSTS_FILENAME = 'ec2-config-{0}.json'
DEFAULT_REGION = 'us-east-1'
DEFAULT_INSTANCE_NAME='node_{0}'.format(os.getenv('USER'))
ADVANCED_SSH_OPTIONS='-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o GlobalKnownHostsFile=/dev/null'
'''
Default EC2 instance setup
'''
DEFAULT_EC2_INSTANCE_CONFIGS = {
'us-east-1':{
'image_id' : 'ami-cf5132a6', #'ami-30c6a059', #'ami-b85cc4d1', # 'ami-cd9a11a4',
'security_groups' : [ 'MrJenkinsTest' ],
'key_name' : 'mrjenkins_test',
'instance_type' : 'm1.xlarge',
'region' : 'us-east-1',
'pem' : '~/.ec2/keys/mrjenkins_test.pem',
'username' : '0xdiag',
'aws_credentials' : '~/.ec2/AwsCredentials.properties',
'hdfs_config' : '~/.ec2/core-site.xml',
},
'us-west-1':{
'image_id' : 'ami-a6cbe6e3', # 'ami-cd9a11a4',
'security_groups' : [ 'MrJenkinsTest' ],
'key_name' : 'mrjenkins_test',
'instance_type' : 'm1.xlarge',
'pem' : '~/.ec2/keys/mrjenkins_test.pem',
'username' : '0xdiag',
'aws_credentials' : '~/.ec2/AwsCredentials.properties',
'hdfs_config' : '~/.ec2/core-site.xml',
'region' : 'us-west-1',
},
}
''' Memory mappings for instance kinds '''
MEMORY_MAPPING = {
'm1.small' : { 'xmx' : 1 },
'm1.medium' : { 'xmx' : 3 },
'm1.large' : { 'xmx' : 5 }, # $0.24/hr
'm1.xlarge' : { 'xmx' : 12 }, # $0.48/hr
'm2.xlarge' : { 'xmx' : 13 }, # $0.41/hr
'm2.2xlarge' : { 'xmx' : 30 }, # $0.82/hr
'm2.4xlarge' : { 'xmx' : 64 }, # $1.64/hr
'm3.medium' : { 'xmx' : 3 },
'm3.large' : { 'xmx' : 5 },
'm3.xlarge' : { 'xmx' : 12 }, # $0.50/hr
'm3.2xlarge' : { 'xmx' : 26 }, # $1.00/hr
'c1.medium' : { 'xmx' : 1 },
'c1.xlarge' : { 'xmx' : 6 }, # $0.58/hr
'c3.large' : { 'xmx' : 3 },
'c3.xlarge' : { 'xmx' : 5 }, # $0.30/hr
'c3.2xlarge' : { 'xmx' : 12 },
'c3.4xlarge' : { 'xmx' : 27 },
'c3.8xlarge' : { 'xmx' : 56 },
'cc2.8xlarge' : { 'xmx' : 56 },
'hi1.4xlarge' : { 'xmx' : 56 }, # $3.10/hr 60.5GB dram. 8 cores/8 threads. 2TB SSD. 10GE
'cr1.8xlarge' : { 'xmx' : 230}, # $4.60/hr 244GB dram. 2 E5-2670. 240GB SSD. 10GE
'g2.2xlarge' : { 'xmx' : 12 },
'i2.xlarge' : { 'xmx' : 27 },
'i2.2xlarge' : { 'xmx' : 57 },
'cg1.4xlarge' : { 'xmx' : 19 },
'i2.4xlarge' : { 'xmx' : 116},
'hs1.8xlarge' : { 'xmx' : 112},
'i2.8xlarge' : { 'xmx' : 236},
}
''' EC2 API default configuration. The corresponding values are replaces by EC2 user config. '''
EC2_API_RUN_INSTANCE = {
'image_id' :None,
'min_count' :1,
'max_count' :1,
'key_name' :None,
'security_groups' :None,
'user_data' :None,
'addressing_type' :None,
'instance_type' :None,
'placement' :None,
'monitoring_enabled':False,
'subnet_id' :None,
'block_device_map':None,
'disable_api_termination':False,
'instance_initiated_shutdown_behavior':None
}
def inheritparams(parent, kid):
newkid = {}
for k,v in kid.items():
if parent.has_key(k):
newkid[k] = parent[k]
return newkid
def find_file(base):
f = base
if not os.path.exists(f): f = os.path.expanduser(base)
if not os.path.exists(f): f = os.path.expanduser("~")+ '/' + base
if not os.path.exists(f):
return None
return f
''' Returns a boto connection to given region '''
def ec2_connect(region):
check_required_env_variables()
import boto.ec2
conn = boto.ec2.connect_to_region(region)
if not conn:
raise Exception("\033[91m[ec2] Cannot create EC2 connection into {0} region!\033[0m".format(region))
return conn
def check_required_env_variables():
ok = True
if not os.environ['AWS_ACCESS_KEY_ID']:
warn("AWS_ACCESS_KEY_ID need to be defined!")
ok = False
if not os.environ['AWS_SECRET_ACCESS_KEY']:
warn("AWS_SECRET_ACCESS_KEY need to be defined!")
ok = False
if not ok: raise Exception("\033[91m[ec2] Missing AWS environment variables!\033[0m")
''' Run number of EC2 instance.
Waits forthem and optionaly waits for ssh service.
'''
def run_instances(count, ec2_config, region, waitForSSH=True, tags=None):
'''Create a new reservation for count instances'''
ec2params = inheritparams(ec2_config, EC2_API_RUN_INSTANCE)
ec2params.setdefault('min_count', count)
ec2params.setdefault('max_count', count)
reservation = None
conn = ec2_connect(region)
try:
reservation = conn.run_instances(**ec2params)
log('Reservation: {0}'.format(reservation.id))
log('Waiting for {0} EC2 instances {1} to come up, this can take 1-2 minutes.'.format(len(reservation.instances), reservation.instances))
start = time.time()
time.sleep(1)
for instance in reservation.instances:
while instance.update() == 'pending':
time.sleep(1)
h2o_cmd.dot()
if not instance.state == 'running':
raise Exception('\033[91m[ec2] Error waiting for running state. Instance is in state {0}.\033[0m'.format(instance.state))
log('Instances started in {0} seconds'.format(time.time() - start))
log('Instances: ')
for inst in reservation.instances: log(" {0} ({1}) : public ip: {2}, private ip: {3}".format(inst.public_dns_name, inst.id, inst.ip_address, inst.private_ip_address))
if waitForSSH:
# kbn: changing to private address, so it should fail if not in right domain
# used to have the public ip address
wait_for_ssh([ i.private_ip_address for i in reservation.instances ])
# Tag instances
try:
if tags:
conn.create_tags([i.id for i in reservation.instances], tags)
except:
warn('Something wrong during tagging instances. Exceptions IGNORED!')
print sys.exc_info()
pass
return reservation
except:
print "\033[91mUnexpected error\033[0m :", sys.exc_info()
if reservation:
terminate_reservation(reservation, region)
raise
''' Wait for ssh port
'''
def ssh_live(ip, port=22):
return h2o_cmd.port_live(ip,port)
def terminate_reservation(reservation, region):
terminate_instances([ i.id for i in reservation.instances ], region)
def terminate_instances(instances, region):
'''terminate all the instances given by its ids'''
if not instances: return
conn = ec2_connect(region)
log("Terminating instances {0}.".format(instances))
conn.terminate_instances(instances)
log("Done")
def stop_instances(instances, region):
'''stop all the instances given by its ids'''
if not instances: return
conn = ec2_connect(region)
log("Stopping instances {0}.".format(instances))
conn.stop_instances(instances)
log("Done")
def start_instances(instances, region):
'''Start all the instances given by its ids'''
if not instances: return
conn = ec2_connect(region)
log("Starting instances {0}.".format(instances))
conn.start_instances(instances)
log("Done")
def reboot_instances(instances, region):
'''Reboot all the instances given by its ids'''
if not instances: return
conn = ec2_connect(region)
log("Rebooting instances {0}.".format(instances))
conn.reboot_instances(instances)
log("Done")
def wait_for_ssh(ips, port=22, skipAlive=True, requiredsuccess=3):
''' Wait for ssh service to appear on given hosts'''
log('Waiting for SSH on following hosts: {0}'.format(ips))
for ip in ips:
if not skipAlive or not ssh_live(ip, port):
log('Waiting for SSH on instance {0}...'.format(ip))
count = 0
while count < requiredsuccess:
if ssh_live(ip, port):
count += 1
else:
count = 0
time.sleep(1)
h2o_cmd.dot()
def dump_hosts_config(ec2_config, reservation, filename=DEFAULT_HOSTS_FILENAME, save=True, h2o_per_host=1):
if not filename: filename=DEFAULT_HOSTS_FILENAME
cfg = {}
f = find_file(ec2_config['aws_credentials'])
if f: cfg['aws_credentials'] = f
else: warn_file_miss(ec2_config['aws_credentials'])
f = find_file(ec2_config['pem'])
if f: cfg['key_filename'] = f
else: warn_file_miss(ec2_config['key_filename'])
f = find_file(ec2_config['hdfs_config'])
if f: cfg['hdfs_config'] = f
else: warn_file_miss(ec2_config['hdfs_config'])
cfg['username'] = ec2_config['username']
cfg['use_flatfile'] = True
cfg['h2o_per_host'] = h2o_per_host
cfg['java_heap_GB'] = MEMORY_MAPPING[ec2_config['instance_type']]['xmx']
cfg['java_extra_args'] = '' # No default Java arguments '-XX:MaxDirectMemorySize=1g'
cfg['base_port'] = 54321
cfg['ip'] = [ i.private_ip_address for i in reservation.instances ]
cfg['ec2_instances'] = [ { 'id': i.id, 'private_ip_address': i.private_ip_address, 'public_ip_address': i.ip_address, 'public_dns_name': i.public_dns_name } for i in reservation.instances ]
cfg['ec2_reservation_id'] = reservation.id
cfg['ec2_region'] = ec2_config['region']
# cfg['redirect_import_folder_to_s3_path'] = True
# New! we can redirect import folder to s3n thru hdfs, now (ec2)
cfg['redirect_import_folder_to_s3n_path'] = True
# put ssh commands into comments
cmds = get_ssh_commands(ec2_config, reservation)
idx = 1
for cmd in cmds:
cfg['ec2_comment_ssh_{0}'.format(idx)] = cmd
idx += 1
if save:
# save config
filename = filename.format(reservation.id)
with open(filename, 'w+') as f:
f.write(json.dumps(cfg, indent=4))
log("Host config dumped into {0}".format(filename))
log("To terminate instances call:")
log("\033[93mpython ec2_cmd.py terminate --hosts {0}\033[0m".format(filename))
log("To start H2O cloud call:")
log("\033[93mpython ec2_cmd.py start_h2o --hosts {0}\033[0m".format(filename))
log("To watch cloud in browser follow address:")
log(" http://{0}:{1}".format(reservation.instances[0].public_dns_name, cfg['base_port']))
return (cfg, filename)
def get_ssh_commands(ec2_config, reservation, ssh_options=""):
cmds = []
if not ssh_options: ssh_options = ""
for i in reservation.instances:
cmds.append( "ssh -i ~/.ec2/keys/mrjenkins_test.pem {1} ubuntu@{0}".format(i.private_ip_address,ssh_options) )
return cmds
def dump_ssh_commands(ec2_config, reservation):
cmds = get_ssh_commands(ec2_config, reservation)
for cmd in cmds:
print cmd
# for cleaning /tmp after it becomes full, or any one string command (can separate with semicolon)
def execute_using_ssh_commands(ec2_config, reservation, command_string='df'):
if not command_string: log("Nothing to execute. Exiting...")
cmds = get_ssh_commands(ec2_config, reservation, ADVANCED_SSH_OPTIONS)
for cmd in cmds:
c = cmd + " '" + command_string + "'"
print "\n"+c
ret,out = commands.getstatusoutput(c)
print out
def load_ec2_region(region):
for r in DEFAULT_EC2_INSTANCE_CONFIGS:
if r == region:
return region
raise Exception('\033[91m[ec2] Unsupported EC2 region: {0}. The available regions are: {1}\033[0m'.format(region, [r for r in DEFAULT_EC2_INSTANCE_CONFIGS ]))
def load_ec2_config(config_file, region, instance_type=None, image_id=None):
if config_file:
f = find_file(config_file)
with open(f, 'rb') as fp:
ec2_cfg = json.load(fp)
else:
ec2_cfg = {}
for k,v in DEFAULT_EC2_INSTANCE_CONFIGS[region].items():
ec2_cfg.setdefault(k, v)
if instance_type: ec2_cfg['instance_type'] = instance_type
if image_id : ec2_cfg['image_id' ] = image_id
return ec2_cfg
def load_ec2_reservation(reservation, region):
conn = ec2_connect(region)
lr = [ r for r in conn.get_all_instances() if r.id == reservation ]
if not lr: raise Exception('Reservation id {0} not found !'.format(reservation))
return lr[0]
def load_hosts_config(config_file):
f = find_file(config_file)
with open(f, 'rb') as fp:
host_cfg = json.load(fp)
return host_cfg
def log(msg):
print "\033[92m[ec2] \033[0m", msg
def warn(msg):
print "\033[92m[ec2] \033[0m \033[91m{0}\033[0m".format(msg)
def warn_file_miss(f):
warn("File {0} is missing! Please update the generated config manually.".format(f))
def invoke_hosts_action(action, hosts_config, args, ec2_reservation=None):
ids = [ inst['id'] for inst in hosts_config['ec2_instances'] ]
ips = [ inst['private_ip_address'] for inst in hosts_config['ec2_instances'] ]
region = hosts_config['ec2_region']
if (action == 'terminate'):
terminate_instances(ids, region)
elif (action == 'stop'):
stop_instances(ids, region)
elif (action == 'reboot'):
reboot_instances(ids, region)
wait_for_ssh(ips, skipAlive=False, requiredsuccess=10)
elif (action == 'start'):
start_instances(ids, region)
# FIXME after start instances receive new IPs: wait_for_ssh(ips)
elif (action == 'distribute_h2o'):
pass
elif (action == 'start_h2o'):
try:
h2o.config_json = args.hosts
log("Starting H2O cloud...")
h2o_hosts.build_cloud_with_hosts(timeoutSecs=120, retryDelaySecs=5)
h2o.touch_cloud()
log("Cloud started. Let's roll!")
log("You can start for example here \033[93mhttp://{0}:{1}\033[0m".format(hosts_config['ec2_instances'][0]['public_dns_name'],hosts_config['base_port']))
if args.timeout:
log("Cloud will shutdown after {0} seconds or use Ctrl+C to shutdown it.".format(args.timeout))
time.sleep(args.timeout)
else:
log("To kill the cloud please use Ctrl+C as usual.")
while (True): time.sleep(3600)
except:
print traceback.format_exc()
finally:
log("Goodbye H2O cloud...")
h2o.tear_down_cloud()
log("Cloud is gone.")
elif (action == 'stop_h2o'):
pass
elif (action == 'clean_tmp'):
execute_using_ssh_commands(hosts_config, ec2_reservation, command_string='sudo rm -rf /tmp/*; df')
elif (action == 'nexec'):
execute_using_ssh_commands(hosts_config, ec2_reservation, command_string=args.cmd)
def report_reservations(region, reservation_id=None):
conn = ec2_connect(region)
reservations = conn.get_all_instances()
if reservation_id: reservations = [i for i in reservations if i.id == reservation_id ]
log('Reservations:')
for r in reservations: report_reservation(r); log('')
def report_reservation(r):
log(' Reservation : {0}'.format(r.id))
log(' Instances : {0}'.format(len(r.instances)))
for i in r.instances:
log(' [{0} : {4}] {5} {1}/{2}/{3} {6}'.format(i.id, i.public_dns_name, i.ip_address, i.private_ip_address,i.instance_type, format_state(i.state), format_name(i.tags)))
def format_state(state):
if state == 'stopped': return '\033[093mSTOPPED\033[0m'
if state == 'running': return '\033[092mRUNNING\033[0m'
if state == 'terminated': return '\033[090mTERMINATED\033[0m'
return state.upper()
def format_name(tags):
if 'Name' in tags: return '\033[91m<{0}>\033[0m'.format(tags['Name'])
else: return '\033[94m<NONAME>\033[0m'
def merge_reservations(reservations):
pass
def create_tags(**kwargs):
tags = { }
for key,value in kwargs.iteritems():
tags[key] = value
return tags
def main():
parser = argparse.ArgumentParser(description='H2O EC2 instances launcher')
parser.add_argument('action', choices=['help', 'demo', 'create', 'terminate', 'stop', 'reboot', 'start', 'distribute_h2o', 'start_h2o', 'show_defaults', 'dump_reservation', 'show_reservations', 'clean_tmp','nexec'], help='EC2 instances action!')
parser.add_argument('-c', '--config', help='Configuration file to configure NEW EC2 instances (if not specified default is used - see "show_defaults")', type=str, default=None)
parser.add_argument('-i', '--instances', help='Number of instances to launch', type=int, default=DEFAULT_NUMBER_OF_INSTANCES)
parser.add_argument('-H', '--hosts', help='Hosts file describing existing "EXISTING" EC2 instances ', type=str, default=None)
parser.add_argument('-r', '--region', help='Specifies target create region', type=str, default=DEFAULT_REGION)
parser.add_argument('--reservation', help='Reservation ID, for example "r-1824ec65"', type=str, default=None)
parser.add_argument('--name', help='Name for launched instances', type=str, default=DEFAULT_INSTANCE_NAME)
parser.add_argument('--timeout', help='Timeout in seconds.', type=int, default=None)
parser.add_argument('--instance_type', help='Enfore a type of EC2 to launch (e.g., m2.2xlarge).', type=str, default=None)
parser.add_argument('--cmd', help='Shell command to be executed by nexec.', type=str, default=None)
parser.add_argument('--image_id', help='Override defautl image_id', type=str, default=None)
parser.add_argument('--h2o_per_host', help='Number of JVM launched per node', type=int, default=1)
args = parser.parse_args()
ec2_region = load_ec2_region(args.region)
if (args.action == 'help'):
parser.print_help()
elif (args.action == 'create' or args.action == 'demo'):
ec2_config = load_ec2_config(args.config, ec2_region, args.instance_type, args.image_id)
tags = create_tags(Name=args.name)
log("EC2 region : {0}".format(ec2_region))
log("EC2 itype : {0}".format(ec2_config['instance_type']))
log("EC2 ami : {0}".format(ec2_config['image_id']))
log("EC2 config : {0}".format(ec2_config))
log("Instances : {0}".format(args.instances))
log("Tags : {0}".format(tags))
reservation = run_instances(args.instances, ec2_config, ec2_region, tags=tags)
hosts_cfg, filename = dump_hosts_config(ec2_config, reservation, filename=args.hosts, h2o_per_host=args.h2o_per_host)
dump_ssh_commands(ec2_config, reservation)
if (args.action == 'demo'):
args.hosts = filename
try:
invoke_hosts_action('start_h2o', hosts_cfg, args)
finally:
invoke_hosts_action('terminate', hosts_cfg, args)
elif (args.action == 'show_defaults'):
print
print "\033[92mConfig\033[0m : {0}".format(json.dumps(DEFAULT_EC2_INSTANCE_CONFIGS,indent=2))
print "\033[92mInstances\033[0m : {0}".format(DEFAULT_NUMBER_OF_INSTANCES)
print "\033[92mSupported regions\033[0m : {0}".format( [ i for i in DEFAULT_EC2_INSTANCE_CONFIGS ] )
print
elif (args.action == 'merge_reservations'):
merge_reservations(args.reservations, args.region)
elif (args.action == 'dump_reservation'):
ec2_config = load_ec2_config(args.config, ec2_region)
ec2_reservation = load_ec2_reservation(args.reservation, ec2_region)
dump_hosts_config(ec2_config, ec2_reservation, filename=args.hosts)
elif (args.action == 'show_reservations'):
report_reservations(args.region, args.reservation)
else:
if args.hosts:
hosts_config = load_hosts_config(args.hosts)
if hosts_config['ec2_reservation_id']: ec2_reservation = load_ec2_reservation(hosts_config['ec2_reservation_id'], ec2_region)
else: ec2_reservation = None
elif args.reservation: # TODO allows for specifying multiple reservations and merge them
ec2_config = load_ec2_config(args.config, ec2_region)
ec2_reservation = load_ec2_reservation(args.reservation, ec2_region)
hosts_config,_ = dump_hosts_config(ec2_config, ec2_reservation, save=False)
invoke_hosts_action(args.action, hosts_config, args, ec2_reservation)
if (args.action == 'terminate' and args.hosts):
log("Deleting {0} host file.".format(args.hosts))
os.remove(args.hosts)
if __name__ == '__main__':
main()
| python |
A password will be e-mailed to you.
Balbir Singh Sidhu handed over appointment letters to 58 laboratory technicians. .
Will Ram Rahim Would be able to get out of jail?
Kangar consoles death of Tehsildar Jaswinder Singh Tiwana. .
Contact us:
© Domain Registered With Hosting Crow. | english |
<reponame>AnnoyingDog99/GEngine
#pragma once
#include "gen_device.hpp"
// std
#include <memory>
#include <unordered_map>
#include <vector>
namespace gen
{
class GenDescriptorSetLayout
{
public:
class Builder
{
public:
Builder(GenDevice &genDevice) : genDevice{genDevice} {}
Builder &addBinding(
uint32_t binding,
VkDescriptorType descriptorType,
VkShaderStageFlags stageFlags,
uint32_t count = 1);
std::unique_ptr<GenDescriptorSetLayout> build() const;
private:
GenDevice &genDevice;
std::unordered_map<uint32_t, VkDescriptorSetLayoutBinding> bindings{};
};
GenDescriptorSetLayout(
GenDevice &genDevice, std::unordered_map<uint32_t, VkDescriptorSetLayoutBinding> bindings);
~GenDescriptorSetLayout();
GenDescriptorSetLayout(const GenDescriptorSetLayout &) = delete;
GenDescriptorSetLayout &operator=(const GenDescriptorSetLayout &) = delete;
VkDescriptorSetLayout getDescriptorSetLayout() const { return descriptorSetLayout; }
private:
GenDevice &genDevice;
VkDescriptorSetLayout descriptorSetLayout;
std::unordered_map<uint32_t, VkDescriptorSetLayoutBinding> bindings;
friend class GenDescriptorWriter;
};
class GenDescriptorPool
{
public:
class Builder
{
public:
Builder(GenDevice &genDevice) : genDevice{genDevice} {}
Builder &addPoolSize(VkDescriptorType descriptorType, uint32_t count);
Builder &setPoolFlags(VkDescriptorPoolCreateFlags flags);
Builder &setMaxSets(uint32_t count);
std::unique_ptr<GenDescriptorPool> build() const;
private:
GenDevice &genDevice;
std::vector<VkDescriptorPoolSize> poolSizes{};
uint32_t maxSets = 1000;
VkDescriptorPoolCreateFlags poolFlags = 0;
};
GenDescriptorPool(
GenDevice &genDevice,
uint32_t maxSets,
VkDescriptorPoolCreateFlags poolFlags,
const std::vector<VkDescriptorPoolSize> &poolSizes);
~GenDescriptorPool();
GenDescriptorPool(const GenDescriptorPool &) = delete;
GenDescriptorPool &operator=(const GenDescriptorPool &) = delete;
bool allocateDescriptor(
const VkDescriptorSetLayout descriptorSetLayout, VkDescriptorSet &descriptor) const;
void freeDescriptors(std::vector<VkDescriptorSet> &descriptors) const;
void resetPool();
private:
GenDevice &genDevice;
VkDescriptorPool descriptorPool;
friend class GenDescriptorWriter;
};
class GenDescriptorWriter
{
public:
GenDescriptorWriter(GenDescriptorSetLayout &setLayout, GenDescriptorPool &pool);
GenDescriptorWriter &writeBuffer(uint32_t binding, VkDescriptorBufferInfo *bufferInfo);
GenDescriptorWriter &writeImage(uint32_t binding, VkDescriptorImageInfo *imageInfo);
bool build(VkDescriptorSet &set);
void overwrite(VkDescriptorSet &set);
private:
GenDescriptorSetLayout &setLayout;
GenDescriptorPool &pool;
std::vector<VkWriteDescriptorSet> writes;
};
} // namespace gen | cpp |
The ICC on Monday (October 3) announced the complete fixtures and groupings of the Women’s Twenty20 World Cup 2023 in South Africa. Ten teams will divide into two groups in quest for a semifinal berth. Bangladesh's women’s team will play in Group A. Let’s take a look at Bangladesh’s group phase fixtures for the ICC Women’s Twenty20 World Cup 2023.
Bangladesh women's team earned a spot in the main event in South Africa after recently winning the ICC Women's T20 World Cup Qualifier in the United Arab Emirates. The Irish team also progressed following their second-place finish in the qualifier competition.
Following confirmation of the participating teams, the International Cricket Council released the itinerary for the eighth edition of the Women's T20 World Cup on Monday. The schedule includes who will play who in the group stage. In Group A, Bangladesh will face defending champions Australia, New Zealand, South Africa, and Sri Lanka.
The Bangladesh women’s team will play their first match against Sri Lanka on February 12 and end their group phase fixtures with a match against the host South Africa on February 21. Here are Bangladesh’s complete group phase fixtures for the 2023 ICC Women’s Twenty20 World Cup.
Bangladesh women's team has never advanced to the knockout round in the T20 World Cup tournament. The chances of the tigresses competing in the semifinals of the forthcoming ICC Women's Twenty20 World Cup 2023 are also extremely small. According to Bangladesh’s fixtures, they can start their campaign with a victory over Sri Lanka. However, their other competitors are far stronger and among the favourites to win the competition.
Read: How much prize money will be on offer at the ICC T20 World Cup 2022 in Australia?
| english |
Russian tennis player Daria Kasatkina was born on May 7, 1997, and is currently the top singles player in Russia. In 2018, she achieved her career-high singles ranking of No. 8, and she is currently ranked No. 14 by the WTA. Kasatkina has won six singles and one doubles WTA titles till date.
Kasatkina’s elder brother introduced her to tennis and she excelled as a junior, winning the junior 2014 French Open and the European 16s Championships. At the age of 18, Kasatkina was No. 32 in the world and won her first WTA title at the Charleston Open in 2017. At the Premier Mandatory Indian Wells Open in 2018, Kasatkina finished second to Naomi Osaka, and this helped her gain notoriety in 2018.
Does Daria Kasatkina have a Grand Slam?
No, Daria Kasatkina does not have a Grand Slam title as of August 2023.
The semifinals of the 2022 French Open and the quarterfinals of the 2018 Wimbledon have been Daria Kasatkina's best major results till date. She has also made it to the fourth round of the 2017 US Open and the third round of the 2016 and 2022 Australian Open.
In Grand Slam doubles, she has reached the third round of the 2016 Wimbledon, 2017 US Open, and 2019 French Open. At the Australian Open, her best finish was reaching the second round in 2016.
The following are the specifics of her aforementioned singles Grand Slams:
Being the 20th seed, Kasatkina began the 2022 French Open. She overcame qualifiers Fernanda Contreras, Shelby Rogers, Rebecca Šramková, and Camila Giorgi to get to the quarterfinals, matching her best performance from the tournament from last year.
Then she advanced a step further by defeating Veronika Kudermetova, to advance to her first Grand Slam semifinal. Eventually, she was defeated by world No. 1 Iga Świątek in straight sets.
At the 2018 Wimbledon, she lost to eventual champion and former world No. 11 Angelique Kerber in the quarterfinal.
Kasatkina first advanced to the fourth round of a Grand Slam tournament at the 2017 US Open. She managed to defeat French Open champion Jelena Ostapenko, but was later defeated by qualifier Kaia Kanepi.
In 2016, Kasatkina competed in her first Australian Open and advanced to the third round. Before falling to then world No. 1 Serena Williams, she defeated Anna Karolina Schmiedlová in the opening round.
After beating qualifiers Stefanie Vögele and Magda Linette, Kasatkina advanced to the third round of the 2022 Australian Open as the 25th seed before losing to then seventh seed Iga Świątek.
Q. Has Daria Kasatkina won a Grand Slam?
A. No, Daria Kasatkina has not won a Grand Slam title as of August 2023.
A. No, Daria Kasatkina has not won a Grand Slam title as of August 2023.
Q. What are Daria Kasatkina's best Grand Slam singles performances?
A. Daria Kasatkina reached the semifinals at the 2022 French Open and the quarterfinals at the 2018 Wimbledon.
A. Daria Kasatkina reached the semifinals at the 2022 French Open and the quarterfinals at the 2018 Wimbledon.
Q. What is Daria Kasatkina's best result in Grand Slam doubles?
A. Daria Kasatkina reached the second round of the 2016 Australian Open in doubles.
A. Daria Kasatkina reached the second round of the 2016 Australian Open in doubles.
Q. What is Daria Kasatkina's current singles ranking?
A. Daria Kasatkina's current singles ranking is No. 14.
A. Daria Kasatkina's current singles ranking is No. 14.
Q. How many singles titles has Daria Kasatkina won on the WTA Tour?
A. On the WTA Tour, Daria Kasatkina has won six singles titles.
A. On the WTA Tour, Daria Kasatkina has won six singles titles.
| english |
<filename>test/tests.json
{
"blocks.dataSource": [
"spec/dataSource/api.js",
"spec/dataSource/configuration.js",
"spec/dataSource/events.js"
],
"blocks.mvc": [
"spec/mvc/application.js",
"spec/mvc/collection.js",
"spec/mvc/history.js",
"spec/mvc/model.js",
"spec/mvc/property.js",
"spec/mvc/router.js",
"spec/mvc/validation.js",
"spec/mvc/view.js"
],
"blocks.query": [
"spec/query/attribute-queries.js",
"spec/query/contexts.js",
"spec/query/custom-queries.js",
"spec/query/element.js",
"spec/query/expressions.js",
"spec/query/extenders.js",
"spec/query/html-parsing.js",
"spec/query/observable.array.js",
"spec/query/observables.comments.js",
"spec/query/observables.dom.js",
"spec/query/observables.js",
"spec/query/public-methods.js",
"spec/query/queries.comments.js",
"spec/query/queries.js"
]
} | json |
Puducherry: Hours after she jumped into the sea with her four sisters and her parents, a young woman in Puducherry was allegedly raped.
Late last week, a family from Bihar decided to commit suicide together. The five sisters had been evicted from the famous Aurobindo Ashram, where they had live for over a decade before accusing the management of sexual misconduct. Early in December, the Supreme Court ruled against them and said they would have to leave the hermitage's residential quarters. One of the sisters climbed up to the water tank and threatened to jump to her death. She was coaxed into changing her mind by the police. (Read: Family Evicted From Aurobindo Ashram in Puducherry Attempts Suicide, 3 Dead)
The next morning, the sisters and their parents, who lived in the town, plunged into the sea. Two women and their mother died. The father and three of his daughters were rescued by fishermen and hospitalized.
One of them says she was raped while she lay on the beach after being left there by the fishermen who had saved her life.
Two men have now been arrested for the alleged assault.
"We are awaiting the medical report. We have also gathered other evidence," said senior police officer Praveen Ranjan Kumar who is handling the case. | english |
package genetics_test
import (
"testing"
"github.com/google/go-cmp/cmp"
"github.com/inlined/rand"
"github.com/inlined/xkcd"
"github.com/inlined/genetics"
)
func TestParentSelection(t *testing.T) {
for _, test := range []struct {
tag string
strategy genetics.NaturalSelection
numSelected int
fitness []genetics.Fitness
rand rand.Rand
expectedParents []int
}{
{
tag: "SUS pick every other (even)",
strategy: genetics.StochasticUniversalSampling{},
numSelected: 3,
fitness: []genetics.Fitness{2, 2, 2, 2, 2, 2},
rand: xkcd.Rand(1),
expectedParents: []int{0, 2, 4},
}, {
tag: "SUS pick every other (odd)",
strategy: genetics.StochasticUniversalSampling{},
numSelected: 3,
fitness: []genetics.Fitness{2, 2, 2, 2, 2, 2},
rand: xkcd.Rand(3),
expectedParents: []int{1, 3, 5},
}, {
// This is an edge case and a major sign to switch the selection mechanism to ranked scoring
// TODO: should this also return a diversity score to help automate the scoring algorithm?
tag: "SUS top-exclusively",
strategy: genetics.StochasticUniversalSampling{},
numSelected: 3,
fitness: []genetics.Fitness{10, 1, 1},
rand: xkcd.Rand(1),
expectedParents: []int{0, 0, 0},
}, {
tag: "SUS redundant picks",
strategy: genetics.StochasticUniversalSampling{},
numSelected: 3,
fitness: []genetics.Fitness{10, 1, 1},
rand: xkcd.Rand(2),
expectedParents: []int{0, 0, 1},
}, {
tag: "Ranked wheel begin",
strategy: genetics.RankedSelection{},
numSelected: 3,
fitness: []genetics.Fitness{10, 5, 1}, // Ranked weights: 3 2 1; d=6/3=2
rand: xkcd.Rand(0),
expectedParents: []int{0, 0, 1},
}, {
tag: "Ranked wheel end",
strategy: genetics.RankedSelection{},
numSelected: 3, // d=6/3=2
fitness: []genetics.Fitness{10, 5, 1}, // Ranked weights: 3 2 1
rand: xkcd.Rand(1),
expectedParents: []int{0, 1, 2},
}, {
tag: "Ranked wheel scrambled",
strategy: genetics.RankedSelection{},
numSelected: 2, // d = 10 / 2 = 5
fitness: []genetics.Fitness{4, 20, 16, 3}, // Ranked weights: 2, 4, 3, 1
rand: xkcd.Rand(4),
expectedParents: []int{2, 3},
}, {
tag: "Tournament of 1", // To some extent, this verifies I understand the cryptic rules for deal()
strategy: genetics.TournamentSelection{Size: 1},
numSelected: 2, // d = 10 / 2 = 5
fitness: []genetics.Fitness{4, 20, 16, 3}, // Ranked weights: 2, 4, 3, 1
rand: xkcd.Rand(3, 1), // deal {3}, {1}
expectedParents: []int{3, 1},
}, {
tag: "Tournament of 2",
strategy: genetics.TournamentSelection{Size: 2},
numSelected: 2, // d = 10 / 2 = 5
fitness: []genetics.Fitness{4, 20, 16, 3}, // Ranked weights: 2, 4, 3, 1
rand: xkcd.Rand(3, 2, 1, 2), // deal {3, 2}, {1, 2}
expectedParents: []int{2 /* winner of 3 vs 2 */, 1 /* winner of 1 vs 2 */},
},
} {
t.Run(test.tag, func(t *testing.T) {
got := test.strategy.SelectParents(test.rand, test.numSelected, test.fitness)
if diff := cmp.Diff(got, test.expectedParents); diff != "" {
t.Fatalf("Got wrong indexes; got=%v; want=%v; diff=%v", got, test.expectedParents, diff)
}
})
}
}
| go |
Though GM Quader and Raushon Ershad are apparently at loggerheads over the leadership of the Jatiya Party, its Secretary General Mujibul Haque Chunnu on Thursday said no conspiracy can crack the unity of their party.
“The Jatiya Party is united under the leadership of its Chairman GM Quader. There’s no division in the party. No conspiracy can break its unity,” he said.
He said they are not taking into cognizance the letter of Begum Raushon Ershad which went viral on social media on Wednesday.
In a statement, Raushon on Wednesday 'suspended' the special power bestowed upon the party chairman by its constitution's section 20/1/Ka and announced to reinstate all relieved leaders of the party, including Mashiur Rahman Ranga.
She also sent a letter to Jatiya Party Chairman GM Quader asking him to comply with the suspension and other decisions. But Raushon does not have the authority to take any such action as per the party charter.
Replying to a question, Chunnu said Ranga's statement about Jatiya Party's constitution and Article 20 is contradictory.
| english |
Key West is such a cool city. Yes, it’s a city, it’s a small town, it’s its own republic. When you complete the Miami to Key West drive you are rewarded with one of the most beautiful communities in Florida. Yes, we love our hometown of Saint Augustine, but Key West is equally beautiful in a different way. These are our picks for the best things to do in Key West on a short trip.
While Key West was used by shippers and smugglers for a long time and shifted control over the years, the city wasn’t plotted or built up until the 1820s. Much of the iconic architecture was built in the 1880s and after. It’s a beautiful city to tour on foot, and if you don’t have a lot of time, just a weekend is plenty for all of these fun things to do.
We’ve picked our favorite activities, for their cultural, Keys-ness and enjoyment factors. Add a few of these great things to do in Key West to your and you’ll have great memories for years to come. PS: if you’re traveling as a family, we have more recommendations for fun things to do with kids in Key West too! If you have any additional questions, send us a note and we’ll help you out as best and as quickly as possible!
This was our absolute favorite thing to do in Key West. We took the ferry out to Dry Tortugas National Park (a whole day adventure) and spent hours exploring old Fort Jefferson, snorkeling around the moat wall and walking the beaches. You need to read all about it to understand what a unique thing to do this trip is. If there’s one thing that is BUCKET LIST of Florida, it’s this adventure to one of the most remote National Parks in the USA! Book it here!!
Of all the tours we’ve done in all the places we’ve been, going out through the sandbars and mangrove islands with Island to Island Charters has been our favorite. Spending the day exploring the waters of Key West with Captain Ally was remarkable. We got to swim and snorkel, saw sharks and spotted eagle rays, and then we hung out with dolphins. It was all amazing and all based on what sort of activities our family was interested in.
Hands down, this is the BEST experience for any family in the Florida Keys (and no, we get no commission from saying so.) If you’re visiting with another small family, this can be cost-effective if you can split it together!
The giant manta ray in the mural is awesome. The many Wyland murals to see on a Florida Keys road trip are inspiring. Our kids love the art and have recreated their own versions, us adults are just in awe with each mural. Such amazing public art.
Ride the Conch Trail (tour)
One of the best things to do in Key West is to ride the Conch Train. Operated by Historic Tours of America (they do one in Saint Augustine too!) it’s a comprehensive tour of the historic old town and neighborhoods of KW. You get to hear stories of the city, see some of the most famous sights in Key West (like the Southernmost Point), and you can get on and off in several places around town.
The Conch Train tour lasts about 75 minutes and covers a lot of ground. The best place to catch it is near Mallory Square and the KW Aquarium. For the many tours we’ve done in many cities across the USA, the Conch Train is my favorite.
Book the Conch Train Tour here!
Eco-tourism is becoming increasingly important as more and more people travel to new places. Add a jaunt with either Key West Ecotours or with Honest Ecotours to your Florida Keys road trip. We really like Honest Ecotours for a few reasons:
- The Java Cat is small and agile (Key West Eco tours) or Honest Eco’s boat, the Squid, is fully eco-friendly (including solar power)
Honest Eco and Key West Ecotours really do a wonderful job with kids and adults alike. They provide healthy, fresh snacks and are well prepared for even inclement weather days. Honest Eco also does sunset cruises (we did a Pride sailing) and private voyages.
The cheapest thing to do in Key West is to wander the historic town area. It’s beautiful and there are chickens everywhere. Parking downtown is a little expensive, but it’s worth it for the time you save and the ease of finding a spot. Once parked, enjoy the Mallory Square area, then walk through the Truman White House complex towards the Key West Lighthouse.
Stop into Ernest Hemmingway’s House (and museum) and then enjoy a stroll past banyan trees and historic homes as you make your way to First Flight (brewery and restaurant) where the first PanAm Airways office was. Visit the Audubon House and Tropical Gardens, hit up a few museums in the historic quarter and you’re done.
There are tons of wonderful stops to make along the way, and lots of key lime pie and martinis to enjoy as well. Walking Key West on foot is a great all day or afternoon activity and it’s the best way to see the city at your own pace.
Book a Private Guided Walking Tour or Key West Literary Tour here!
I’ll admit that the admission to the very small Key West Aquarium might not seem worth it initially, but it’s such a cool place. The interior feels like you’ve stepped onto Captain Nemo’s Nautilus, and the sharks in the middle of the aquarium are really cool.
Being a very old attraction, some of the features and design look like they’re from another time… which they are. It’s all very vintage. Pop outside for a wonderful living mangrove exhibit and enjoy the view from above. This is great with kids, but if you’re looking to take a break from the sun AND want to do a little learning about the wildlife in the Florida Keys, this is a great spot!
We do a lot of kayaking tours and paddling on our own, but Night Kayaking KW is a must-do, experienced kayaker or not. Heading through the mangrove tunnels and shallow coves around KW, Night Kayaking gives you a totally new view of nature.
The kayaks have a plexiglass bottom and are outfitted with LED lights to see underwater. We saw sharks, lobsters, tarpon, sea hares and more. It was really a memorable experience and one of the most unique things to do in KW.
I am such a sucker for lighthouses and the KW Lighthouse is one of the prettiest. It’s one of the best things to do in Key West both as a sight and as a unique activity.
There is a museum on sight about Key West’s nautical history, and then you can climb the lighthouse tower as well. I love it! You’ll also find some great lighthouse exhibits, a gigantic banyan tree and more. Spending an hour or two here is one of the best things to do in Key West!
As I mentioned before, there aren’t a ton of beaches in the Florida Keys to visit on your road trip, but Key West has a few beach spots. The following are the easiest beaches to access with the best surroundings. They aren’t all-natural, so it’s a mixed bag when it comes to sand and obstacles, but they serve the purpose of cooling off and relaxing when you visit KW.
These are the best beaches IN Key West for relaxing or swimming:
If you spend time at Rest Beach, there is a really cool pier that goes pretty far out into the water. The views are beautiful and there’s a fair amount of wildlife living along the pier structure. Check it out!
Doing a Florida Keys road trip isn’t typically a beach trip, but it’s all about the culture and other natural sights. Enjoy what you like, but we don’t recommend the Keys if you truly want a beach destination.
This is just a quick hits list of the best thing to do in Key West. Really, you can easily spend a whole week in Key West and have a different adventure every day. Be sure to check out our other Florida Keys travel ideas. We spend so much time in the Keys that we always have more to share. Please be sure to leave a comment or send us a note if you have any additional tips or questions about Key West and the rest of the islands!
The post 10 Best Things to Do in Key West appeared first on 2TravelDads.
| english |
There seems to be an innate connection between Dhanush and Rajinikanth.
And this is not merely because Dhanush is the son-in-law of the Superstar.
Dhanush may be finding Rajini to be having some kind of talismanic success.
After a long time, Dhanush had a blockbuster hit with Thiruvilaiyadal Arambham.
One of the major hits of the film was the song Ennama Kannu. This is a remix of RajiniÂs yesteryear hit in Mr Bharat.
The song and several other factors catapulted the movie to big heights. The fact that Dhanush was paired with Shreya, RajiniÂs heroine in Sivaji, also underlined DhanushÂs Rajini connection.
His current movie is Parattai Engira Azhagu Sundaram. Now, Parattai is the name of the legendary character of Rajini in 16 Vayadhinile.
Meanwhile, DhanushÂs new movie is named Pollathavan.
There again, there is a big hit in the same name starring, you guessed it, Rajini in the lead.
Dhanush sure is filling into his f-i-lÂs shoes.
Follow us on Google News and stay updated with the latest! | english |
#include <Universe.hpp>
#include <iostream>
int main()
{
int universeSetupStatus = 0;
Universe currentUniverse = Universe(&universeSetupStatus);
if (universeSetupStatus == 0)
currentUniverse.EventLoop();
else
std::cout << "Universe creation failed with code " << universeSetupStatus << std::endl;
return 0;
}
| cpp |
'''
Created on Dec 29, 2014
@author: xuebin
email: <EMAIL>
department of geography
university of Georgia
'''
import twitter
# import json
import sys
import logging
import traceback
from bs4 import BeautifulSoup
import urllib2
import psycopg2
import time
# import urllib2
'''
handle log
'''
# create logger with 'spam_application'
logger = logging.getLogger('GetTwitter')
logger.setLevel(logging.DEBUG)
# create file handler which logs even debug messages
fh = logging.FileHandler('GetTwitter.log')
fh.setLevel(logging.DEBUG)
# create console handler with a higher log level
ch = logging.StreamHandler()
ch.setLevel(logging.ERROR)
# create formatter and add it to the handlers
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
fh.setFormatter(formatter)
ch.setFormatter(formatter)
# add the handlers to the logger
logger.addHandler(fh)
logger.addHandler(ch)
'''
OAUTH
'''
CONSUMER_KEY = ""
CONSUMER_SECRET = ""
OAUTH_TOKEN = ""
OATH_TOKEN_SECRET = ""
auth = twitter.oauth.OAuth(OAUTH_TOKEN,OATH_TOKEN_SECRET,CONSUMER_KEY,CONSUMER_SECRET)
twitter_api = twitter.Twitter(auth=auth)
ngo_tweet_list = [""]
def GetTweetIDByName(name,start,end):
'''
get real time tweets ID from twitter.com/search
by time and name
return tweets ID
insert collected tweet ID into postgresql table
'''
try:
name = name
start = start
end = end
# url = "https://twitter.com/search?q=lang%3Aen%20near%3A%22Athens%2CGA%22%20within%3A15mi&src=typd"
url = "https://twitter.com/search?f=realtime&q=from%3A"+name+"%20since%3A"+start+"%20until%3A"+end+"&src=typd"
tweets = urllib2.urlopen(url).read()
# print tweets
soup = BeautifulSoup(tweets)
tweetID=[]
# install the tweets ID
# i=0
for li in soup.find_all("li", attrs = {"data-item-type":"tweet"}):
# find the li tag in which the name of data-item-type is tweet
# i = i+1
tweetID.append(li["data-item-id"])
# append the tweet id to the list
# print i
# # print tweetID
connection = psycopg2.connect(dbname = '', user = '',password='')
cursor = connection.cursor()
for tweetid in tweetID:
try:
cursor.execute('SELECT tweetid FROM tweetid WHERE tweetid =' +"'"+str(tweetid)+"'")
test = cursor.fetchone()
# print test
if (test):
print "duplicated tweet id: "+tweetid
else:
# print "start" +start
# print "end" + end
cursor.execute('INSERT INTO tweetid (tweetid,tweetuser,starttime,endtime)'
'VALUES(%s,%s,%s,%s)',
(tweetid,name,start,end,))
except psycopg2.IntegrityError:
exc_type, exc_value, exc_traceback = sys.exc_info()
lines = traceback.format_exception(exc_type, exc_value, exc_traceback)
print "warning: duplicated tweetid" # Log it or whatever here
logger.info(''.join('!! ' + line for line in lines) )
pass
except:
exc_type, exc_value, exc_traceback = sys.exc_info()
lines = traceback.format_exception(exc_type, exc_value, exc_traceback)
print ''.join('!! ' + line for line in lines) # Log it or whatever here
logger.info(''.join('!! ' + line for line in lines) )
connection.commit()
cursor.close()
connection.close()
print"\t total tweets", len(tweetID)
# print tweetID[0]
# print tweetID[len(tweetID)-1]
# print url
# print soup
except:
exc_type, exc_value, exc_traceback = sys.exc_info()
lines = traceback.format_exception(exc_type, exc_value, exc_traceback)
print ''.join('!! ' + line for line in lines) # Log it or whatever here
logger.info(''.join('!! ' + line for line in lines) )
def InsertStatus(search_results):
'''
insert tweet into postgresql table
'''
connection = psycopg2.connect(dbname = '', user = '',password='')
cursor = connection.cursor()
try:
for statue in search_results:
# print json.dumps(statue)
# print statue
tweetid = statue["id_str"]
tweetuser = statue["user"]["screen_name"].encode('utf-8','ignore')
collected_time = statue["created_at"]
createyear = collected_time.split(" ")[5]
createmonth = collected_time.split(" ")[1]
createday = collected_time.split(" ")[2]
createtime = collected_time.split(" ")[3]
# print statue["entities"]["hashtags"]
if len(statue["entities"]["hashtags"])>0:
# hashtags = json.dumps(statue["entities"]["hashtags"])
hashtags = ''.join(hashtag["text"]+',' for hashtag in statue["entities"]["hashtags"])
else:
hashtags = None
if len(statue["entities"]["user_mentions"])>0:
mention = ''.join(user["screen_name"]+',' for user in statue["entities"]["user_mentions"])
# mention = json.dumps(statue["entities"]["user_mentions"])
else:
mention = None
if statue["in_reply_to_screen_name"]:
replyuser = statue["in_reply_to_screen_name"].encode('utf-8','ignore')
else:
replyuser = None
if "retweeted_status" in statue:
retweetuser = statue["retweeted_status"]["user"]["screen_name"].encode('utf-8','ignore')
else:
retweetuser = None
text = statue["text"].encode('utf-8','ignore')
try:
cursor.execute('SELECT tweetid FROM tweet WHERE tweetid =' +"'"+str(tweetid)+"'")
test = cursor.fetchone()
# print test
if (test):
print "duplicated tweet id: "+tweetid
else:
cursor.execute('INSERT INTO tweet (tweetid,tweetuser,year,month,day,time,hashtags,mention,replyuser,retweetuser,text)'
'VALUES(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)',
[tweetid,tweetuser,createyear,createmonth,createday,createtime,hashtags,mention,replyuser,retweetuser,text])
except psycopg2.IntegrityError:
exc_type, exc_value, exc_traceback = sys.exc_info()
lines = traceback.format_exception(exc_type, exc_value, exc_traceback)
print "warning: duplicated tweetid" # Log it or whatever here
logger.info(''.join('!! ' + line for line in lines) )
pass
except:
exc_type, exc_value, exc_traceback = sys.exc_info()
lines = traceback.format_exception(exc_type, exc_value, exc_traceback)
print ''.join('!! ' + line for line in lines) # Log it or whatever here
logger.info(''.join('!! ' + line for line in lines) )
connection.commit()
cursor.close()
connection.close()
# return current month and year for date check
return createmonth,createyear
except :
exc_type, exc_value, exc_traceback = sys.exc_info()
lines = traceback.format_exception(exc_type, exc_value, exc_traceback)
print ''.join('!! ' + line for line in lines) # Log it or whatever here
logger.info(''.join('!! ' + line for line in lines) )
def GetTweetFromUser(username):
'''
get tweet from user time line
'''
try:
search_results = twitter_api.statuses.user_timeline(screen_name =username)
except twitter.TwitterHTTPError:
exc_type, exc_value, exc_traceback = sys.exc_info()
lines = traceback.format_exception(exc_type, exc_value, exc_traceback)
print "rate limit exceeded" # Log it or whatever here
logger.info(''.join('!! ' + line for line in lines) )
time.sleep(900)
# search_results = twitter_api.statuses.home_timeline(screen_name =username,contributor_details ='True')
# statuses=search_results["statuses"]
# json_result = json.dumps(search_results)
# print json_result
earliest_month, earliest_year = InsertStatus(search_results)
# print earliest_month
while(len(search_results)>1 and (earliest_month == "Dec" or earliest_month =="Nov" or earliest_month == "Oct" ) and (earliest_year == "2014" or earliest_year == "2015") ):
'''
use max_id to retrieve earlier tweets
'''
try:
# print "\t later tweetid: %s", (search_results[0]["id_str"])
# print "\t earlier tweetid: %s", (search_results[len(search_results)-1]["id_str"])
print "\t current month: " , (earliest_month)
try:
search_results = twitter_api.statuses.user_timeline(screen_name =username,max_id =search_results[len(search_results)-1]["id_str"] )
except twitter.TwitterHTTPError:
exc_type, exc_value, exc_traceback = sys.exc_info()
lines = traceback.format_exception(exc_type, exc_value, exc_traceback)
print "rate limit exceeded" # Log it or whatever here
logger.info(''.join('!! ' + line for line in lines) )
time.sleep(900)
earliest_month,earliest_year = InsertStatus(search_results)
except :
exc_type, exc_value, exc_traceback = sys.exc_info()
lines = traceback.format_exception(exc_type, exc_value, exc_traceback)
print ''.join('!! ' + line for line in lines) # Log it or whatever here
logger.info(''.join('!! ' + line for line in lines) )
# print len(ngo_tweet_list)
# GetTweetFromUser("xuebinwei")
def GetTweetIDbySearch():
'''
collect public tweets ID for each user day by day
'''
i = 0
for ngo_tweet in ngo_tweet_list:
i = i +1
try:
print "------- "+ str(i)
print "get tweet of " + str(ngo_tweet)
for month in range(10,12):
print "\t month of: ",(month)
for day in range(1,31):
GetTweetIDByName(ngo_tweet,'2014-'+str(month)+'-'+str(day),'2014-'+str(month)+'-'+str(day+1))
# GetTweetFromUser(ngo_tweet)
except :
exc_type, exc_value, exc_traceback = sys.exc_info()
lines = traceback.format_exception(exc_type, exc_value, exc_traceback)
print ''.join('!! ' + line for line in lines) # Log it or whatever here
logger.info(''.join('!! ' + line for line in lines) )
continue
# GetTweetIDbySearch()
def GetTweetbyREST():
'''
collect tweets of each user
'''
i = 0
for ngo_tweet in ngo_tweet_list:
i = i +1
try:
print "------- "+ str(i)
print "get tweet of " + str(ngo_tweet)
GetTweetFromUser(ngo_tweet)
except :
exc_type, exc_value, exc_traceback = sys.exc_info()
lines = traceback.format_exception(exc_type, exc_value, exc_traceback)
print ''.join('!! ' + line for line in lines) # Log it or whatever here
logger.info(''.join('!! ' + line for line in lines) )
continue
GetTweetbyREST()
| python |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>~/code/vim-markdown/spec/features/lists_with_fenced_codeblocks.md.html</title>
<meta name="Generator" content="Vim/7.4">
<meta name="plugin-version" content="vim7.4_v1">
<meta name="syntax" content="markdown">
<meta name="settings" content="use_css,pre_wrap,no_foldcolumn,expand_tabs,prevent_copy=">
<meta name="colorscheme" content="none">
<style type="text/css">
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffff; }
body { font-family: monospace; color: #000000; background-color: #ffffff; }
* { font-size: 1em; }
.Constant { color: #c00000; }
.Special { color: #c000c0; }
-->
</style>
<script type='text/javascript'>
<!--
-->
</script>
</head>
<body>
<pre id='vimCodeElement'>
<span class="Special">```ruby</span>
<span class="Constant"># This is a fenced code block</span>
<span class="Constant">def ruby; end</span>
<span class="Special">```</span>
<span class="Constant"> ```ruby</span>
<span class="Constant"> # This is not a fenced code block but a code block</span>
<span class="Constant"> def ruby; end</span>
<span class="Constant"> ```</span>
<span class="Special">* </span>First level, first item
First level, first item with <span class="Special">`</span><span class="Constant">inline</span><span class="Special">`</span> element <span class="Special">``</span><span class="Constant">foo</span><span class="Special">``</span> <span class="Special">``</span><span class="Constant">foo</span><span class="Special">``</span>
Still first level, first item, the following it's not a fenced code block but an inline code block
<span class="Special">```</span><span class="Constant">ruby</span>
<span class="Constant"> def ruby; end</span>
<span class="Constant"> </span><span class="Special">```</span>
Still first level, first item, the following it's a fenced code block because it's preceded by an empty line
<span class="Special"> ```ruby</span>
<span class="Constant"> def ruby; end</span>
<span class="Special"> ```</span>
<span class="Special">* </span>First level, first item
<span class="Special"> * </span>Second level, first item
<span class="Special"> * </span>Third level, first item
<span class="Special"> * </span>Fourth level, first item
<span class="Special"> ```ruby</span>
<span class="Constant"> # This is a fenced code block and not a code block even it has 8 leading spaces because it's contained in a fourth level list item</span>
<span class="Constant"> def ruby; end</span>
<span class="Special"> ```</span>
<span class="Special">* </span>First level, first item
<span class="Special"> ```ruby</span>
<span class="Constant"> def ruby; end</span>
<span class="Special"> ```</span>
<span class="Special"> ```ruby</span>
<span class="Constant"> def ruby; end</span>
<span class="Special"> ```</span>
<span class="Special"> ```ruby</span>
<span class="Constant"> def ruby; end</span>
<span class="Special"> ```</span>
<span class="Constant"> ```ruby</span>
<span class="Constant"> # This is not a fenced code block because it has 8 leading white spaces and so it's a code block</span>
<span class="Constant"> def ruby; end</span>
<span class="Constant"> ```</span>
</pre>
</body>
</html>
<!-- vim: set foldmethod=manual : -->
| html |
As newcomers in the world of discrete graphics cards, the best hope for Intel’s Arc A770 and A750 was that they wouldn’t be terrible. And Intel mostly delivered in raw power, but the two budget-focused GPUs have been lagging in the software department. Over the course of the last few months, Intel has corrected course.
Through a series of driver updates, Intel has delivered close to double the performance in DirectX 9 titles compared to launch, as well as steep upgrades in certain DirectX 11 and DirectX 12 games. I caught up with Intel’s Tom Petersen and Omar Faiz to find out how Intel was able to rearchitect its drivers, and more importantly, how it’s continuing to drive software revisions in the future.
Before getting into Intel’s advancements, though, we have to talk about what a driver is doing in your games in the first place. A graphics card driver sits below the Application Programming Interface (API) of the game you’re playing, and it translates the instructions for the API into instructions that the hardware can understand.
An API like DirectX takes instructions from the game and translates them into a standardized set of commands that any graphics card can understand. The driver comes after, taking those standardized instructions and optimizing them for a particular hardware architecture. That’s why an AMD driver won’t work for an Nvidia graphics card, or an Intel driver won’t work for an AMD one.
Intel’s problems mainly focused around DirectX 9. It’s considered a legacy API at this point, but a large swath of games are still designed to run on DX9, including Counter-Strike: Global Offensive, Team Fortress 2, League of Legends, and Guild Wars 2.
Originally, Intel used D3D9on12 for DX9, which is a translation layer that uses DirectX 12 to understand DirectX 9 instructions. Petersen said he believes Intel “did the right thing at the time,” but D3D9on12 proved to be too inefficient. Performance was left on the table, with less powerful GPUs sometimes offering twice the performance of Intel’s graphics cards in DX9 games.
Intel essentially started from scratch, implementing native DX9 support and leverage translation tools like DXVK — a Vulkan-based translation layer for DX9. And it worked. In Counter-Strike Global Offensive, I measured around 190 frames per second (fps) with the launch driver and 395 fps with the latest driver; a 108% increase. Similarly, Payday 2 saw around a 45% boost going from the launch driver to the latest version with the Arc A750 based on my testing.
Average performance is one area of focus, but that wasn’t the only issue with Intel’s initial drivers. Petersen explained that the engineering team “fixed some of the fundamental resource allocation” issues in the driver, helping improve consistency by ensuring the driver doesn’t run into bottlenecks that cause big shifts in frame time.
Both were careful not to overpromise, which is an issue Intel has run into with its Arc GPUs in the past. But the short record is certainly in Intel’s favor. Since launch, the cards have seen 15 new drivers (six WHQL, nine beta), including release day optimizations for 27 new games. That beats AMD and matches Nvidia’s pace. In fact, Intel was the only one with a driver ready for Hogwarts Legacy at launch (a game that Nvidia still hasn’t released a Game Ready Driver for).
Although Intel has made big strides with its drivers, there’s still a long road ahead. One area that needs attention is XeSS, Intel’s AI-based upscaling tool that serves as an alternative to Nvidia’s Deep Learning Super Sampling (DLSS).
XeSS is a great tool, but it lacks in a couple areas: game support and sharpness. Intel has been adding support for new games like Hogwarts Legacy and Call of Duty: Modern Warfare 2, but it’s going up against the years of work Nvidia has had to add DLSS to hundreds of games. Intel hopes implementing XeSS in these games will be an easy road for developers, though.
As Petersen explained, “[DLSS and XeSS] both rely on, you know, effectively certain types of data coming from the game to a separate DLL file. Same as XeSS. And we’ve kind of got the advantage of being a fast follower because, obviousl,y they were there first. So we can make it very easy to integrate XeSS.” This backbone is what has enabled modders to splice AMD’s FidelityFX Super Resolution into games that only support DLSS. The same is theoretically possible with XeSS.
One area I pressed on was a driver-based upscaling tool, similar to Nvidia Image Scaling or AMD’s Radeon Super Resolution. Petersen and Faiz were again careful to not promise anything, but they noted that it’s “not technically impossible.” That would fill in the gaps Intel currently has in its lineup, but we might not see such a tool for a while (if at all).
Like DLSS, XeSS uses a neural network to perform the upscaling. Nvidia clearly has a big head start in its training model, so it could be a few years before Intel’s training data is able to match what Team Green has been chipping away at for years.
Intel is the largest GPU supplier in the world through its integrated graphics, but the discrete realm is a different beast. The company has proved it has the chops to compete in the lower-end segment, especially with the new aggressive pricing of the Arc A750. But there’s still a lot more work ahead.
Leaks say Intel plans on building on this foundation with a refresh to Alchemist in late 2023 and a new generation in 2024, but that’s just a rumor for now. What’s certain is that Intel is clearly standing by its gaming GPUs, and in a time of rising GPU prices, a third player is a welcome addition to bring some much-needed competition. Let’s just hope the momentum in drivers and game support coming off the launch keeps up through several generations.
This article is part of ReSpec – an ongoing biweekly column that includes discussions, advice, and in-depth reporting on the tech behind PC gaming.
| english |
Vancouver, Feb 3 (IANS): Spain fought off Davis Cup elimination by winning the doubles competition against Canada 4-6, 6-4, 6-7, 6-3, 6-2 on the hardcourts of the University of British Columbia campus.
The top-ranked Spaniards trail hosts Canada 1-2 with two singles rubbers set for Sunday to decide what country advances to the quarterfinals in World Group (top-16 countries) play.
Entering Saturday 2-0 up, the Canadian doubles team, featuring 40-year-old veteran Daniel Nestor and 22-year-old Vasek Pospisil, got off to a strong start when they took the opening set 6-4 against the Spanish pairing of Marcel Granollers and Marc Lopez.
After Canada won the third set in a tie-breaker, five-time Davis Cup champions Spain, playing without their top four players including Rafael Nadal and David Ferrer, roared back to take the next two sets and the match.
Granollers, who was beaten in straight sets in singles against Frank Dancevic Friday, said he felt fresh during the match and was up for playing Sunday if chosen by Spanish captain Alex Corretja.
“After that first set we played very good. It was a long match, five sets, it’s not easy for my body but I think we finished the fifth set very fresh and finished the match very good,” said Granollers, who regularly plays doubles with Lopez on the ATP circuit.
Nestor, No. 4 in doubles, made numerous key shots to give the hosts the early momentum. He put Canada ahead 5-4 with a backhand that Granollers couldn’t return and in the next game executed a forehand on the final point that blazed past the Spaniards.
Granollers and Lopez, who captured the ATP World Tour doubles title last year, dead-locked the match in the next set. After breaking serve in the third game, the Spaniards took advantage of the Canadians’ 11 unforced errors to win 6-4.
The Canadians immediately answered Spain in the next set breaking serve in the third game to roll out to a 3-0 lead. With Canada 4-1 up, Spain reeled off the next three games, including breaking serve in the seventh game, to draw even. After the Spaniards took the opening point in the third-set tie-breaker, the Canadians took five straight points to win 7-4 and take the set.
With everything on the line for Spain, the Davis Cup runner-ups to Czech Republic last year, Granollers and Lopez easily won the fourth set 6-3.
The crucial moment in the deciding set came when Nestor double faulted with Canada 30-40 down as Spain broke serve to go 2-1 up. Lopez then served a love-game in the fourth game to put the visitors in a commanding position and then broke serve in the next to silence the crowd.
It was revealed after the match that Nestor was feeling ill from the fourth set.
With Corretja putting his team through practice after the doubles rubber, Canadian captain Martin Laurendeau said he had no idea who the visitors would field Sunday in the opening singles match against his top player, World No. 15 Milos Raonic.
Pospisil added the Canadian team was still feeling confident.
“We’re still in a great position. Today, again, we gave ourselves the best chance of winning. We’re not too far from closing the deal today. But we have two strong singles guys (Raonic and Dancevic) going for us tomorrow and the whole team’s feeling really good and confident,” said Pospisil, currently ranked No. 131 in singles.
Despite getting new life with the doubles point, Corretja, who helped Spain to its first Davis Cup title in 2000 as a player, said he wasn’t relieved.
“I will feel relieved tomorrow night if we win 3-2. It’s obviously nice to get the chance to play tomorrow. It would have been very bad for us not to reach Sunday but I’m not feeling relief right now. I feel happy for the players that they did a great effort and won. We were almost out and today we’re still in it,” he said.
The winner of Canada-Spain will face the victor of Croatia-Italy in the quarterfinals in April. Italy currently leads the tie 2-1. | english |
<reponame>hetmanchuk/control
import { Injectable } from '@angular/core';
import { Actions, Effect, ofType } from '@ngrx/effects';
import { distinctUntilChanged, map, mergeMap, switchMap } from 'rxjs/operators';
import { HttpClient } from '@angular/common/http';
import { Action } from '@ngrx/store';
import { Observable } from 'rxjs';
import { Chart } from './apps.reducer';
import {
AppCommonActions,
AppCommonActionTypes,
AppDetailActionTypes, LoadAppDetails,
SetAppDetails, LoadChartsSuccess,
} from './actions';
@Injectable()
export class AppsEffects {
@Effect()
loadCharts: Observable<Action> = this.actions$.pipe(
ofType(AppCommonActionTypes.LoadCharts),
mergeMap(
(action: AppCommonActions) => this.http.get(`/v1/api/helm/repositories/${action.payload}/charts`),
(action: AppCommonActions, charts) => {
return new LoadChartsSuccess({ repo: action.payload, charts });
}
),
);
@Effect()
appFilter: Observable<Action> = this.actions$.pipe(
ofType(AppCommonActionTypes.AppFilter),
distinctUntilChanged()
);
@Effect()
loadChartDetails: Observable<SetAppDetails> = this.actions$.pipe(
ofType(AppDetailActionTypes.LoadAppDetails),
map((action: LoadAppDetails) => action.payload),
switchMap(({ repo, chart }) => this.http.get(`/v1/api/helm/repositories/${repo}/charts/${chart}`)),
map((chart: Chart) => new SetAppDetails(chart)),
);
constructor(
private actions$: Actions,
private http: HttpClient,
) {
}
}
| typescript |
Avengers actor Jeremy Renner is finally opening up about his lethal accident. As per the authorities, the star landed in trouble after his snow plow started rolling without any indication, and practically ran him over.
This marks the first statement from The Hurt Locker star, who is still in critical condition. The star was found by authorities after being run over by the 6,500 kg vehicle, and was subsequently airlifted to a hospital.
The Hawkeye actor posted a picture of himself on Instagram on Tuesday, January 3, stating that he is "too messed up to type." While he remains in intensive care, this ultimately proves to be a hopeful moment for his friends, family, and fans who are hoping for his successful recovery.
Jeremy Renner recently took to Instagram to let his fans know about his condition. He thanked everyone on social media for wishing him well. However, he added that he is "too messed up now to type." The caption to his post read:
"Thank you all for your kind words. 🙏. Im too messed up now to type. But I send love to you all."
Despite suffering orthopedic injuries and blunt force trauma to the chest, the 51-year-old actor was still seen smiling for the camera, reassuring fans that he is on his way to recovery.
The Hawkeye star was airlifted from his home near Reno, Nevada. He went through a series of surgeries to treat his injuries. A witness told TMZ that one of Renner's neighbors was a doctor who placed a tourniquet on his bleeding leg and kept him in a steady condition until paramedics reached the scene.
How was Jeremy Renner run over by his snow plow?
Darin Balaam, the Washoe County sheriff, spoke about the incident at a press conference on Tuesday. As per the investigation, the department found that Renner was caught under a snow plow while trying to free his car from the snow.
"Mr. Renner went to retrieve his PistenBully or Sno-Cat – an extremely large piece of snow removal equipment weighing at least 14,330 pounds [6,500kg] — in an effort to get his vehicle moving."
Jeremy Renner apparently saw success in freeing the vehicle and bringing it back. However, as he stepped out of the PistenBully to talk to a family member, the vehicle started rolling.
To stop the vehicle from going out of control, Renner attempted to get back into the driver's seat. Sadly, he was caught in the momentum of the vehicle, which led to the tragic accident.
Detailing the incident, the County Sheriff said:
"After successfully towing his vehicle from its stuck location, Mr Renner got out of his PistenBully to speak to his family member. At this point, it was observed that the PistenBully started to roll. In an effort to stop the rolling PistenBully, Mr Renner attempts to get in the driver’s seat of the PistenBully. Based on our investigation, it is at this point that Mr Renner is run over by the PistenBully."
The County Sheriff further added that the department suspects a possible mechanical failure in the snow plow.
The northern Nevada region, where Jeremy Renner was residing, saw heavy snowstorms around Christmas and new year. 10,000+ Washoe county residents also saw a crippling loss of power.
| english |
<filename>app/build/generated/source/r/debug/com/wass08/vlcsimpleplayer/R.java
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package com.wass08.vlcsimpleplayer;
public final class R {
public static final class attr {
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int metaButtonBarButtonStyle=0x7f010001;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int metaButtonBarStyle=0x7f010000;
}
public static final class color {
public static final int black_overlay=0x7f050000;
}
public static final class drawable {
public static final int ic_action_pause_over_video=0x7f020000;
public static final int ic_action_play_over_video=0x7f020001;
public static final int ic_launcher=0x7f020002;
}
public static final class id {
public static final int action_settings=0x7f08000a;
public static final int button_start=0x7f080009;
public static final int textView=0x7f080007;
public static final int url_getter=0x7f080008;
public static final int vlc_button_play_pause=0x7f080003;
public static final int vlc_container=0x7f080000;
public static final int vlc_duration=0x7f080005;
public static final int vlc_overlay=0x7f080002;
public static final int vlc_overlay_title=0x7f080006;
public static final int vlc_seekbar=0x7f080004;
public static final int vlc_surface=0x7f080001;
}
public static final class layout {
public static final int activity_fullscreen_vlc_player=0x7f030000;
public static final int activity_media_selector=0x7f030001;
}
public static final class menu {
public static final int menu_media_selector=0x7f070000;
}
public static final class string {
public static final int action_settings=0x7f060000;
public static final int app_name=0x7f060001;
public static final int button_start=0x7f060002;
public static final int default_url=0x7f060003;
public static final int dummy_button=0x7f060004;
public static final int dummy_content=0x7f060005;
public static final int instruction=0x7f060006;
public static final int title_activity_fullscreen_vlc_player=0x7f060007;
}
public static final class style {
/** Customize your theme here.
*/
public static final int AppTheme=0x7f040002;
public static final int ButtonBar=0x7f040003;
public static final int ButtonBarButton=0x7f040004;
public static final int FullscreenActionBarStyle=0x7f040000;
public static final int FullscreenTheme=0x7f040001;
}
public static final class styleable {
/** Attributes that can be used with a ButtonBarContainerTheme.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #ButtonBarContainerTheme_metaButtonBarButtonStyle com.wass08.vlcsimpleplayer:metaButtonBarButtonStyle}</code></td><td></td></tr>
<tr><td><code>{@link #ButtonBarContainerTheme_metaButtonBarStyle com.wass08.vlcsimpleplayer:metaButtonBarStyle}</code></td><td></td></tr>
</table>
@see #ButtonBarContainerTheme_metaButtonBarButtonStyle
@see #ButtonBarContainerTheme_metaButtonBarStyle
*/
public static final int[] ButtonBarContainerTheme = {
0x7f010000, 0x7f010001
};
/**
<p>This symbol is the offset where the {@link com.wass08.vlcsimpleplayer.R.attr#metaButtonBarButtonStyle}
attribute's value can be found in the {@link #ButtonBarContainerTheme} array.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
@attr name com.wass08.vlcsimpleplayer:metaButtonBarButtonStyle
*/
public static final int ButtonBarContainerTheme_metaButtonBarButtonStyle = 1;
/**
<p>This symbol is the offset where the {@link com.wass08.vlcsimpleplayer.R.attr#metaButtonBarStyle}
attribute's value can be found in the {@link #ButtonBarContainerTheme} array.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
@attr name com.wass08.vlcsimpleplayer:metaButtonBarStyle
*/
public static final int ButtonBarContainerTheme_metaButtonBarStyle = 0;
};
}
| java |
Mumbai: Lovebirds Aly Goni and Jasmin Bhasin are living together during this lockdown. Recently Aly has shared a funny video with Jasmin.
Aly Goni captioned the video, “Bohot socha bahar jaake sab ki tarha pose maarenge with nice view butttt hum dono lazy hai toh yehi ho paya humse dekhlo 😂🤣🤣🤣 @jasminbhasin2806 (sic)” (I thought a lot about going out like everyone else and clicking a picture with a good pose but we both are too lazy to go out and this is what we could produce).
Replying to this, Jasmin wrote,”Hhahahaha, you posted this without asking me @alygoni” with red face emojis.
Meanwhile, on the work front, Jasmin was last seen in Maninder Bhuttar’s track, Pani Di Gal. As for Aly, the Naagin actor shared the screen with Jasmin for Tony Kakkar’s Tera Suit. The song marked Jasmin and Aly’s first collaboration post their stint in Salman Khan hosted Bigg Boss 14. | english |
<reponame>cyokodog/TocJS
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>TOC JS</title>
<link rel="stylesheet" href="css/all.css">
</head>
<body>
<div class="sidebar">
</div>
<div class="main">
<h1><span class="logo">TocJS</span></h1>
<div class="demo">demo <a href="?01">01</a> <a href="?02">02</a> <a href="?03">03</a> </div>
<h2>前書き</h2>
<h3>オブジェクトの使用法とプロパティ</h3>
<p>...</p>
<h3>プロトタイプ</h3>
<h4>パターン1</h4>
<p>...</p>
<h4>パターン2</h4>
<p>...</p>
<h3>hasOwnProperty</h3>
<p>...</p>
<h3>for inループ</h3>
<p>...</p>
<h2>関数</h2>
<h3>関数の宣言と式</h3>
<p>...</p>
<h3>thisはどのように動作するのか</h3>
<p>...</p>
<h3>クロージャと参照</h3>
<p>...</p>
<h3>オブジェクトのarguments</h3>
<p>...</p>
<h2>配列</h2>
<h3>配列の繰り返しとプロパティ</h3>
<p>...</p>
<h3>Arrayコンストラクター</h3>
<p>...</p>
<h2>型</h2>
<h3>等価と比較</h3>
<p>...</p>
<h3>typeof演算子</h3>
<p>...</p>
<h3>instanceofオペレーター</h3>
<p>...</p>
<h3>型変換</h3>
<h4>String</h4>
<p>...</p>
<h4>Number</h4>
<p>...</p>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script> (window.jQuery || document .write('<script src="js/jquery-1.11.2.min.js"><\/script>')); </script>
<script src="js/all.js"></script>
</body>
</html>
| html |
package com.datamelt.artikel.app.web.util;
import java.text.SimpleDateFormat;
import java.util.Date;
public class Timestamp
{
private static SimpleDateFormat formatter = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss");
public static String convertFromUnixTimestamp(long unixTimestamp)
{
return formatter.format(new Date(unixTimestamp));
}
public static long convertFromDateString(String dateString) throws Exception
{
return formatter.parse(dateString).getTime();
}
}
| java |
<reponame>JuanCamiloD1/EK300
const Discord = require("discord.js");
var rpts = ["SÃÂ", "No", "Tal vez", "No sé", "áClaro!", "Si <3", "No >:("]; // Las Respuestas
module.exports = (client, message, args) => {
let pregunt = args.slice(1).join(' '); //Si falta la pregunta
if(!pregunt) return message.channel.send(':x: | Falta la pregunta.');
const embed = new Discord.RichEmbed() //Creamos el embed
.setTitle('Command | 8Ball')
.setThumbnail(message.author.avatarURL)
.addField('Su pregunta es:', args, true)
.addField('Mi respuesta es:', rpts[Math.floor(Math.random() * rpts.length)], true)
message.channel.send(embed)
} | javascript |
By all accounts, Y Combinator’s latest Demo Day held last month for its Winter 2012 class was a biggie. With 66 companies presenting their apps, it was pretty impossible to name a startup that was the clear star of the group. But judging from the industry and investor buzz over the past few weeks since then, Socialcam, a mobile app for shooting, editing, and sharing smartphone videos, has emerged as one of the standout companies from this latest YC batch.
So we were pleased have the chance to talk with Socialcam’s co-founder and CEO Michael Seibel last week when we visited Founders Den, the co-working space in downtown San Francisco. Watch the interview above to hear Seibel talk about how Socialcam looks at growth just two weeks at a time, why his team chose to work in Founders Den rather than renting out its own office, why now is an extremely good time to be a tech startup founder, and more.
Of course, something big has happened since we sat down with Seibel: Now that Instagram has been snapped up by Facebook in an eye-popping $1 billion deal, it’s become even more clear that the excitement around apps like Socialcam may just be getting started. Tech investors are now looking even more feverishly for the next big hit in the mobile media space — an “Instagram for video” play. Socialcam stands out in part because its team has already had one proven success, having been born last year as a spin-out from the well-known video sharing website Justin.tv. Socialcam was co-founded as a standalone entity by Justin.tv founder and namesake Justin Kan, former Justin.tv co-founder and CEO Seibel, and former Justin.tv senior engineer Ammon Bartram. Seibel and Bartram now serve as Socialcam’s CEO and CTO, respectively; Kan pulled away to work on his own Y Combinator Winter 2012 startup, Exec.
Socialcam is of course not the only startup looking to make shooting and sharing mobile phone videos as easy and fun as possible. Viddy, Klip, Mobli, and even the infamous Color are all in the running, to name just a few. It’s still early to tell which apps will be the winners, but it’s safe to say that this week’s Instagram deal has turned up the heat for all the players involved.
| english |
It's official – Adam Pearce is dealing with a lot of issues on the road to WrestleMania.
In the past several months, Pearce has been doing his absolute best trying to handle the chaos across both WWE RAW and SmackDown. But without any help, he's been with way too much on his plate.
One of his main issues lately has been factions like The Judgment Day and The Bloodline attacking people and causing havoc across both RAW and SmackDown.
The Judgment Day's Finn Balor took to social media this afternoon and posted an angry photo of himself screaming at WWE referee Eddie Orengo. Balor stated that he is developing major issues with authority, calling out Adam Pearce in the process.
"I am developing major issues with authority (take note @ScrapDaddyAP @EddieOrengoWWE @WWE_DaniloA) *photo emoji* @timmsy," Finn Balor said in a tweet.
Dealing with factions like The Judgment Day wasn't bad enough; now Adam Pearce has a returning Chelsea Green to deal with her long list of demands to make her happy on WWE RAW.
When Green demanded Pearce deliver the swiss chocolate she asked for, the WWE official made a joke out of it on social media by posting a picture of a Swiss Miss chocolate packet instead.
While many had a good laugh, Chelsea Green was less than thrilled by Pearce's tweet and demanded to speak to his manager instead, tweeting out:
"Is there somebody above you? I'd like to speak to YOUR manager. Please forward me his contact info," Chelsea Green said in a tweet.
What do you make of Finn Balor's tweet? Do you think Pearce is in over his head on the road to WrestleMania? Let us know your thoughts by sounding off in the comments section below.
What's next for The Bloodline?
Poll : Should WWE give Adam Pearce additional help? | english |
Поповер — небольшой немодальный диалог без затемнения, который открывается рядом с триггерным элементом. Он может содержать текст, поля ввода, любые другие элементы управления.
<!-- example(popover-common) -->
### Когда использовать
Возможные кейсы использования поповера:
* Нужно добавить на страницу интерактивный диалог, но без лишней модальности. Например, настройку фильтров в таблице.
### Структура компонента
<div style="margin-top: 15px;">
<img src="./assets/images/popover/popover__structure.jpg" alt="popover structure" style="max-width: 528px"/>
</div>
#### Обязательные элементы
* Указатель
* Тело поповера с основным текстом.
#### Необязательные элементы
* Шапка
* Контролы в теле
* Футер
* Кнопки в футере (нежелательны, потому что создают модальность)
#### Размеры
Поповер имеет фиксированную ширину. Чтобы оптимально использовать пространство, полезно заложить несколько вариантов ширины поповера.
| Предустановка | Ширина |
|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Small | 200 |
| Normal | 400 по умолчанию |
| Large | 640 |
Высота поповера зависит от контента. Рекомендуемая максимальная высота — 480px (может быть увеличена на усмотрение дизайнера).
<div class="mc-alert mc-alert_info" style="margin-top: 15px;">
<i class="mc mc-icon mc-info-o_16 mc-alert__icon"></i>
<span>Поповер должен оставаться относительно небольшим. Если вам нужно показать много контента, возьмите <a href="/modal" mc-link pseudo>модальный диалог</a> или <a href="/sidepanel" mc-link pseudo>сайдпанель</a>.</span>
</div>
### Описание работы
#### Как открыть поповер
Поповер появляется после взаимодействия с триггерным элементом. Событие для открытия поповера — клик.
При открытом поповере фоновая страница не блокируется, все интерактивные элементы (например, [ссылки](/link) и [кнопки](/button)) доступны и при наведении получают ховер.
#### Как закрыть поповер
* Клик мимо поповера
* Клик по кнопкам «Отмена» или «Применить» в футере (если есть)
* Нажатие на ESC
* Проскроллить страницу (опционально, см. поведение при скролле)
##### Сохранение изменений при закрытии
Поповер с кнопкой «Применить» работает как модальный диалог: изменения применяются только нажатием на кнопку. Другие способы закрыть поповер не сохраняют изменения.
Поповер без терминальных кнопок сохраняет изменения в реальном времени. Закрытие кликом мимо поповера или клавишей ESC не сбрасывает изменения.
### Поведение при скролле
Скролл не блокируется. По умолчанию при скролле поповер не закрывается и скроллится вместе со страницей, оставаясь в том месте, откуда был открыт.
<div class="mc-alert mc-alert_warning" style="margin-top: 15px;">
<i class="mc mc-icon mc-error_16 mc-alert__icon"></i>
Поповер может быть закрыт при скролле страницы; какое поведение выбрать — решает проектировщик.
</div>
<!-- example(popover-scroll) -->
### Выравнивание
<div class="mc-alert mc-alert_info" style="margin-top: 15px;">
<i class="mc mc-icon mc-info-o_16 mc-alert__icon"></i>
Учитывайте контекст, в котором появляется поповер. Настройте выравнивание так, чтобы поповер не закрывал важный контент.
</div>
##### По центру элемента
Указатель по центру поповера, целится в центр триггерного элемента.
<!-- example(popover-placement-center) -->
##### По краю элемента
Край поповера выравнивается по краю триггерного элемента, указатель на фиксированном расстоянии от края поповера. Если элемент слишком маленький, указатель выравнивается по центру элемента.
<!-- example(popover-placement-edges) -->
__Динамическое выравнивание__
Если для поповера не хватает места, он попытается перейти в другое положение. Например, из положения «снизу в центре» в положение «сверху в центре».
### Фокус и работа с клавиатурой
Если поповер содержит интерактивные элементы, он управляется по правилам модального окна (смотри [Модальный диалог](/modal)).
После закрытия поповера фокус переходит на триггерный элемент. Это поведение по умолчанию. Есть несколько случаев, когда полезно переместить фокус на другой элемент.
| Клавиша | Поведение |
|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| <span class="hot-key-Button">Tab</span> | Перевести фокус на триггерный элемент / с него |
| <span class="hot-key-Button">Space</span> \ <span class="hot-key-Button">↵</span>| Открыть поповер |
| <span class="hot-key-Button">Esc</span> | Свернуть поповер |
### Валидация
Форма внутри поповера подчиняется [общим правилам валидации](/validation).
Поповер остается открытым, пока ошибки не будут исправлены.
### Связанные компоненты
[Дропдаун](/dropdown) — кнопка-меню, открывающая выпадающий список доступных действий. Работает как группа контролов: в таб-последовательность попадает только триггерный элемент. Поповер же работает по логике модального диалога: при открытии перехватывает фокус и ведет его по контролам.
[Тултип](/tooltip) — маленькое сообщение, которое показывается при наведении указателя на элемент интерфейса. В нем не может быть интерактивных элементов или изображений. В поповере можно выстроить интерактивное взаимодействие, поместить больше текста, добавить заголовок. В этом смысле он похож на упрощенный модальный диалог.
| markdown |
<gh_stars>0
package chapter.android.aweme.ss.com.homework.widget;
import com.bumptech.glide.annotation.GlideModule;
import com.bumptech.glide.module.AppGlideModule;
@GlideModule
public class GeneratedAppGlideModule extends AppGlideModule {
@Override
public boolean isManifestParsingEnabled() {
return false;
}
}
| java |
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Intro arquitectura basada en microservicios</title>
<link rel="stylesheet" href="css/reveal.css">
<link rel="stylesheet" href="css/theme/beige.css">
<link rel="stylesheet" href="css/extra.css">
<!-- Theme used for syntax highlighting of code -->
<link rel="stylesheet" href="lib/css/zenburn.css">
<!-- Printing and PDF exports -->
<script>
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = window.location.search.match( /print-pdf/gi ) ? 'css/print/pdf.css' : 'css/print/paper.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
</script>
</head>
<body>
<div class="reveal">
<div class="slides">
<section><h1>Arquitectura basada en microservicios</h1>
<h2><code>@jjmerelo</code> para <code>@iv_gii</code></h2>
</section>
<section><h1>Diseñando un API REST</h1>
<aside class='notes'>Hay buenas y malas formas de <a
href¿'https://hackernoon.com/restful-api-designing-guidelines-the-best-practices-60e1d954e7c9'>creat
un API REST</a>. El API debe crearse alrededor de
colecciones y usar (y no repetir) los verbos de
HTTP</aside>
</section>
<section><h1>Publicando una <a
href='https://github.com/JJ/tests-python/blob/master/HitosIV.py'>clase</a></h1>
<pre><code>def uno(self,hito_id):
if hito_id > len(self.hitos['hitos']) or hito_id < 0:
raise IndexError("Índice fuera de rango")
return self.hitos['hitos'][hito_id]</code></pre>
<aside class='notes'>El resto, en el enlace. Este es uno de
los que vamos a publicar</aside>
</section>
<section><h1>Usemos <a
href='https://github.com/timothycrosley/hug'>Hug</a></h1>
<img
src='https://github.com/timothycrosley/hug/raw/develop/artwork/logo.png'
alt='logo'>
<aside class='notes'>Hug es más rápido que Flask, documenta
automáticamente, es más fácil de usar y me ha aceptado pull
requests. Así que mola más que Flask-RESTful o cualquier
otro. Pyramid, por ejemplo, parece un poco más complicado</aside>
</section>
<section><pre><code>"""Hitos de IV servidos para usted"""
import hug
from HitosIV import HitosIV
estos_hitos = HitosIV()
@hug.get('/all')
def all():
"""Devuelve todos los hitos"""
return { "hitos": estos_hitos.todos_hitos() }</code></pre>
<aside class='notes'>Una función bastante simple, que devuelve
todos los hitos, y lo hace en forma de JSON, que puede ser
interpretado fácilmente por cualquier cliente. La @ indica
que se trata de un <em>decorador</em>, es decir, un
envoltorio de una función. Como Python odia la programación
funcional, ha encontrado esta forma extraña de definir
encadenamiento de funciones.</aside>
</section>
<!-- test -->
<section>
<section
data-background='https://farm9.staticflickr.com/8077/8309408339_88aca34090_o_d.jpg'>
<aside class='notes'>Si no lo pruebas, está roto</aside>
</section>
<section
data-background='https://farm9.staticflickr.com/8257/8661569286_065098e959_k_d.jpg'>
<aside class='notes'>Hablamos de <a href='https://en.wikipedia.org/wiki/Unit_testing'>tests unitarios</a>; tests que
se hacen sobre una sola función, sin hacer referencia a su
integración en el resto de una aplicación compleja</aside>
</section>
<section><pre><code>import hug
import hugitos
def test_should_have_correct_API():
data = hug.test.get(hugitos, '/all')
assert data.status == "200 OK"
assert data.data['hitos']['hitos'][0]['file'] == "0.Repositorio"
</code></pre>
<aside class='notes'>Usa simplemente <code>assert</code>. Se
tendrá que testear con <code>pytest</code>. En este caso,
usamos un sistema de test, <code>hug.test</code>, que nos
evita tener que <em>levantar</em> el servidor y tirar de
él.</aside>
</section>
</section>
<!-- Usando parámetros -->
<section>
<section>
<pre><code>@hug.get('/one/{id}')
def one( id: int ):
"""Devuelve un hito"""
return { "hito": estos_hitos.uno( id ) }</code></pre>
<aside class='notes'>En este caso necesitamos un
parámetro, y se lo pasamos directamente como parte del
URL. Si no se usa este método, se pasan como parámetros
con "?variable=valor". Viene a ser lo mismo. </aside>
</section>
<section>><h1>Si no se prueba...</h1>
<pre><code>def test_should_return_at_least_one_element():
data = hug.test.get(hugitos, '/one/0')
assert data.status == "200 OK"
assert data.data['hito']['file'] == "0.Repositorio"
</code></pre>
<aside class='notes'>Usamos directamente el nombre de la
clase importada y la variable <code>estos_hitos</code>
que hemos usado en el test anterior</aside></section>
<section
data-background='img/hug.png'><h1>Ejecutando</h1></section>
<section><h1>Sirviendo</h1>
<img src='img/all.png' alt='sirviendo todos'>
<img class='fragment' src='img/one.png' alt='Sirviendo uno'>
</section>
</section>
<section><h1>Publicando en la web</h1>
<h2 class='fragment'>Heroku, OpenShift</h2>
<aside class='notes'>También ciertos servicios dentro de la nube de Azure o Google, o zeit.co si se usa JavaScript</aside>
</section>
<section>
<h1>REST <em>frameworks</em> FTW</h1>
<h1 class='fragment'>Usa siempre tests</h1>
<h1 class='fragment'>Diseña con cuidado</h1>
</section>
<section><h1>Créditos</h1>
<ul class='credits'>
<li><a
href='https://www.flickr.com/photos/psd/4967856349/in/album-72157624761570609/'>REST
cards</a></li>
<li><a
href='https://www.flickr.com/photos/girliemac/albums/72157628409467125/with/6512628175/'>Gatos
con estados HTTP</a></li>
<li>Uno de <a
href='https://www.flickr.com/photos/56380734@N05/8661569286/'>Comrade
King</a></li>
</ul>
</section>
</div>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.js"></script>
<script>
// More info about config & dependencies:
// - https://github.com/hakimel/reveal.js#configuration
// - https://github.com/hakimel/reveal.js#dependencies
Reveal.initialize({
history: true,
width: '99%',
dependencies: [
{ src: 'plugin/notes/notes.js', async: true },
{ src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }
]
});
</script>
</body>
</html>
| html |
????? Delhi से बाहर है और Computer Aided Process Design, BE BTech-Bachelor of Engineering or Technology वर्ष 2014-2018 से KEC-Krishna Engineering College Ghaziabad, APJ Abdul Kalam Technological University का अध्ययन किया है।
| english |
<reponame>odbalogun/areavas-bl<gh_stars>0
from flask import Flask, url_for, render_template
from flask.blueprints import Blueprint
from flask_security import Security
from flask_admin import helpers as admin_helpers
from flasgger import Swagger
from adminlte.admin import AdminLte, admins_store
from api.admin.base import FaLink
from api.admin.views import AdminView, SubscriberView, CategoryView, BillingView, UnsubscriptionView
from api.utils.extensions import ma
from pages.views import blueprint as page_blueprint
import api.routes
from api.models import db, AdminUser, Category, BillingLog, UnsubscriptionLog, Subscription
from config import ConfigObject
app = Flask(__name__)
app.config.from_object(ConfigObject)
db.init_app(app)
db.app = app
ma.init_app(app)
# migrate = Migrate(app, db)
# AdminLTE Panel
# todo fix admin portal
security = Security(app, admins_store)
admin = AdminLte(app, skin='green', name='StickerAdmin', short_name="<b>S</b>A", long_name="<b>Sticker</b>Admin")
admin.add_link(FaLink(name="Documentation", icon_value='fa-book', icon_type="fa", url='/docs/'))
admin.add_view(CategoryView(Category, db.session, name="Categories", menu_icon_value='fa-list-alt'))
admin.add_view(SubscriberView(Subscription, db.session, name="Subscribers", menu_icon_value='fa-users'))
# admin.add_view(AdminView(User, db.session, name="Subscribers", menu_icon_value='fa-users'))
admin.add_view(BillingView(BillingLog, db.session, name="Billing Logs", menu_icon_value='fa-credit-card'))
admin.add_view(UnsubscriptionView(UnsubscriptionLog, db.session, name="Unsubscription Logs", menu_icon_value='fa-list'))
admin.add_view(AdminView(AdminUser, db.session, name="Administrators", menu_icon_value='fa-user-secret'))
admin.add_link(FaLink(name="Logout", icon_value='fa-sign-out', icon_type="fa", url='/admin/logout'))
@security.context_processor
def security_context_processor():
return dict(
admin_base_template=admin.base_template,
admin_view=admin.index_view,
h=admin_helpers,
get_url=url_for
)
# Blueprints
app.url_map.strict_slashes = False
for blueprint in vars(api.routes).values():
if isinstance(blueprint, Blueprint):
app.register_blueprint(blueprint)
app.register_blueprint(page_blueprint)
# Swagger
app.config['SWAGGER'] = {
"swagger_version": "2.0",
"title": "Sticker",
"specs": [
{
"version": None,
"title": "API Docs",
"description": None,
"termsOfService": None,
"endpoint": 'spec',
"route": '/spec/',
"rule_filter": lambda rule: True # all in
}
],
"static_url_path": "/docs/",
"specs_route": "/docs/"
}
Swagger(app)
# Custom error pages
@app.errorhandler(404)
def not_found_error(error):
return render_template('errors/404.html'), 404
@app.errorhandler(500)
def internal_error(error):
return render_template('errors/500.html'), 500
if __name__ == '__main__':
app.run(host=ConfigObject.APP_HOST, port=ConfigObject.APP_PORT)
| python |
package org.mikeneck.graalvm;
import org.gradle.api.Task;
import org.gradle.api.provider.Provider;
import org.gradle.api.tasks.Internal;
public interface InstallNativeImageTask extends Task {
@Internal
Provider<GraalVmHome> getGraalVmHome();
}
| java |
/// Implementation of Andrew's monotone chain 2D convex hull algorithm.
/// Asymptotic complexity: O(n log n).
/// Practical performance: 0.5-1.0 seconds for n=1000000 on a 1GHz machine.
#include <algorithm>
#include <vector>
#include <iostream>
#include <cmath>
using namespace std;
typedef double coord_t; /// coordinate type
typedef double coord2_t; /// must be big enough to hold 2*max(|coordinate|)^2
struct Point {
coord_t x, y;
Point(coord_t x = 0, coord_t y = 0)
{
this->x = x;
this->y = y;
}
static double CrossProduct(const Point &a, const Point &b)
{
return a.x * b.y - a.y * b.x;
}
Point operator + (const Point &other) const
{
return Point(this->x + other.x, this->y + other.y);
}
Point operator - (const Point &other) const
{
return Point(this->x - other.x, this->y - other.y);
}
bool operator < (const Point &p) const
{
return x < p.x || (x == p.x && y < p.y);
}
};
/// 2D cross product of OA and OB vectors, i.e. z-component of their 3D cross product.
/// Returns a positive value, if OAB makes a counter-clockwise turn,
/// negative for clockwise turn, and zero if the points are collinear.
coord2_t cross(const Point &O, const Point &A, const Point &B)
{
return (A.x - O.x) * (B.y - O.y) - (A.y - O.y) * (B.x - O.x);
}
/// Returns a list of points on the convex hull in counter-clockwise order.
/// Note: the last point in the returned list is the same as the first one.
vector<Point> convex_hull(vector<Point> points)
{
int n = points.size(),
k = 0;
vector<Point> hull(2*n);
/// Sort points lexicographically
sort(points.begin(), points.end());
/// Build lower hull
for (int i = 0; i < n; ++i)
{
while (k >= 2 &&
cross(hull[k-2], hull[k-1], points[i]) <= 0)
{
k--;
}
hull[k++] = points[i];
}
/// Build upper hull
for (int i = n-2, t = k+1; i >= 0; i--)
{
while (k >= t &&
cross(hull[k-2], hull[k-1], points[i]) <= 0)
{
k--;
}
hull[k++] = points[i];
}
hull.resize(k);
return hull;
}
double calculate_surface(vector<Point> polyPoints)
{
Point basePoint = polyPoints[0];
double surface = 0;
for(int i=1; i<polyPoints.size() - 1; i++)
{
Point baseToFirst = polyPoints[i] - basePoint;
Point baseToSecond = polyPoints[i + 1] - basePoint;
surface += Point::CrossProduct(baseToFirst, baseToSecond) / 2;
}
return abs(surface);
}
int main()
{
int n;
cin>>n;
vector<Point> poly;
for(int i=0; i<n; i++)
{
double x, y;
cin>>x>>y;
poly.push_back(Point(x,y));
}
cout<<calculate_surface(convex_hull(poly))<<endl;
}
| cpp |
| School Size:
Course Categories (4)
Facilities (11)
This ranking of language schools in Tarlac is 100% transparent. It is exclusively based on the objective criteria of authentic reviews of clients who booked their language course at our site, and whose attendance was verified. The primary ranking criteria is the average overall student satisfaction rating (detailed information about the methodology).
Interested in online courses?
Have a look at our top picks of Live Online English courses at the best prices.
Why Tarlac? Escape the crowds of major Filipino cities and visit Tarlac for a more genuine insight into life here. Food lovers are spoiled for choice with so many options to indulge in authentic Filipino cuisine. Learn about the city's history in the Aquino museum and how a revolution that started here inspired the world. An environmentally rich destination offering many sports opportunities such as the favourite trek to the picturesque Mount Pinatubo for views of the stunning turquoise waters in the volcanic Crater Lake.
- Source: Population data retrieved from GeoNames on Dec 15, 2022.
- GeoNames is an open source and crowd-sourced database of geographic data.
Time zone: +2h. (GMT +8)
Currency: PHP (1 PHP = 1.4615 INR)
Visa: Nationals from India require a visa to enter and study in Philippines. Check visa requirements for nationals from other countries.
Visa requirements data last updated on 01 Dec. 2022 (Source)
For the most up-to-date visa information please consult with the embassy or consulate of Philippines in your country. List of embassies and consulates of Philippines on the official website - .
Cost of Living:
- Source: Own research based on different data sources including Mercer Cost of Living Ranking 2022, UBS Prices and Earnings Report among others.
- Last update: January 2023.
- Big Mac price (Philippines average):
156.72 PHP (15% more expensive than in India)
Mains electricity:
Didn't find what you are looking for?
Interested in a specific type of course? See other 4 different English course types in Tarlac.
Interested in language travel to other cities? Have a look at English language schools in other cities in Philippines such as Boracay Island, Cebu City, Lapu-Lapu City, Mandaue or see our list of all schools in Philippines. You may also want to consult options outside Philippines for learning English.
| english |
The Indian cricket team has suffered a huge blow in terms of preparing themselves for the ICC T20 World Cup, starting next month. The three-dimensional all-rounder Ravindra Jadeja has suffered injury woes and undergone knee surgery. He will next start his rehab at the National Cricket Academy in Bengaluru.
A report in PTI earlier stated that Jadeja is set to be ruled out of the World Cup, citing the recovery time needed. Jadeja, who Axar Patel replaced in the ongoing Asia Cup, will need to heal his knee before making a return.
India faced the music in the ongoing tourney in Jaddu’s absence. They lost both Super Four games against Pakistan and Sri Lanka, respectively. India are out of the final. They need both SL and Afghanistan to beat Pakistan, besides beating the Afghans themselves.
We decode why Jadeja’s absence could hurt India’s chances in the T20 World Cup.
Jadeja is one of the best all-rounders in modern-day cricket, and his contributions across formats are telling. Besides being the second spinner, he adds a lot of depth to India’s batting down the order. His attributes are something India could have used well in Aussie conditions. Jadeja often comes in at crucial junctures and plays these match-winning knocks. This was most recently seen in the clash against Pakistan. He chipped in with a valiant 35 and shared a solid stand with Hardik Pandya in a close encounter.
Jadeja has done a fine job for India in 2022. His knocks with the bat read as 3*, 45*, 22*, 46*, 7, 16, 27, and 35. These are solid numbers for someone at number six or seven. With the ball, the left-arm spinner has compiled 5 wickets.
India lack a specialist to replace Jadeja. They don’t have that character who can give them the confidence with the ball and sturdiness with the bat in those middle and death overs. India have a rookie in Deepak Hooda in the international scenario, but he hardly gets to bowl. Axar seems a decent option, but he doesn’t offer the pedigree in terms of batting in crunch matches. In 25 T20Is, he has 21 wickets and 147 runs with a best of 20*.
Having a balanced side is a key factor in T20Is. With no Jadeja, India look weaker. Jadeja is a strong finisher with big shots up his sleeves. Someone like Hooda and Axar can crack the shots but don’t have that experience. Both batting and bowling-wise, India are relevantly down in Jadeja’s absence. India could be forced to play four specialist bowlers and the fifth option in Hardik Pandya. If someone has a poor day, the rhythm can get unsettled.
Do the management trust Hooda and Axar?
Axar came in as Jadeja’s replacement but hasn’t yet got a game. The management preferred Hooda instead, and he hasn’t got a single over against both PAK and SL. So a lack of trust in the management can be evident here. These doubts aren’t viable when picking the World Cup squad as you need 15 players who can be equally crucial. So it remains to be seen who gets the nod for the global event between the two. Or there could be a chance where both players get the nod.
Stand-by players: Shardul Thakur, Deepak Hooda, Axar Patel, Sanju Samson, Shreyas Iyer.
| english |
{"i18n.ar.umd.min.js":"sha256-V4vFfVhoYZeMFP8d99e4l72SsvMpN3rk6X7X8lqtoB4=","i18n.bg.umd.min.js":"sha256-pBWgCj08aqkJnGvTVGaAhHKUc+TEfEXA+Gip6WaJxeM=","i18n.ca.umd.min.js":"sha256-Ca7R1RAhSpvYeUkBiI75Z/I+yRCzimNMadB0D1jziuw=","i18n.cs.umd.min.js":"sha256-t6u9HTPWOl8JvC2xpM3lJ4X2g0G6pViwxMHGa7F+rzs=","i18n.de.umd.min.js":"sha256-uHPcregQnGOZ4Vz42+8hqi3j0i/dyIt9SZFuP+0h6kE=","i18n.el.umd.min.js":"sha256-99A+HxRYX4vl0m/kd7CqV58Kh5AEgUib4Oaepgt20L4=","i18n.en-uk.umd.min.js":"sha256-riKrEHLI7Wi4D31jDZY546SB6wthQJRPuc0HAZOliHE=","i18n.en-us.umd.min.js":"sha256-dnVBNKIfFaJaT0G9drCI9dT+0K7Cp3SrZAM1CVAw1XA=","i18n.es.umd.min.js":"sha256-f5fQskw1L0Fc+/6b6pQqHq/cVy/FqUazbuQBZ0RPRF4=","i18n.fa-ir.umd.min.js":"sha256-mUXiH7Cx7hDH+A5fpq8RaX60XwjhOjpo82xUNroN2tQ=","i18n.fr.umd.min.js":"sha256-IARyCY459O7R4O9+wmhh7C1e6CVXAjA8H+hrqfFXINc=","i18n.gn.umd.min.js":"sha256-rZ0LyHDNuEt89h8Lncg1ddsvnFVXz61pvRjI86Un8Lo=","i18n.he.umd.min.js":"sha256-n40ls96TOTOFLyhxdlIEsHS5+6o3nOU3Xac7vDNxq1o=","i18n.hr.umd.min.js":"sha256-/4US8CN1orfbOfEn97JkIAIFuXBtuOPBNPeDjuIIRh8=","i18n.id.umd.min.js":"sha256-VEmeaKQvGdhjV0oh1DOGkuNQRm6YSAnzdU3eKI4ZB/8=","i18n.it.umd.min.js":"sha256-S7/qAQxBzCOabgI+Zcfq4VgyJ/fReOd8j1QClSC/MK0=","i18n.ja.umd.min.js":"sha256-JvBU2NahrrEoYaz+9FfjM17Ks0zOy2vQIuzp44lfAn4=","i18n.ko-kr.umd.min.js":"sha256-wn3O6ezfldVCiW4T28w3DALRTssGySVLlntPAjrfjNA=","i18n.lu.umd.min.js":"sha256-CpA4dknYBxqm2fTFXXudSCJg8kyZS/SuYB41CZFEpYw=","i18n.lv.umd.min.js":"sha256-X1Zq0qwQAaU7GARTo951KdWZHjuTmStvcpBqlaCf3Bo=","i18n.nb-no.umd.min.js":"sha256-MQIAOELzKkLg6n3Ig8ZUlzEsqnVLiVG9hTdJJMYOdUE=","i18n.nl.umd.min.js":"sha256-iX6vCrZbRYYRIq9tgvyk3MKu0RdMqKeqpMCBkHbxHUs=","i18n.pl.umd.min.js":"sha256-f3CGkXhU4JxFWOWEPVUsWiXxCTNKKzdjpPaeC0wWH1c=","i18n.pt-br.umd.min.js":"sha256-sx4+v9fVxtqpfiCUwdJerGaTFhIoXFzYEMPfZncDneg=","i18n.pt.umd.min.js":"sha256-Qpzf1e3m4tIpPVWmWJyUgbK8wt9bqPzNQZDlLb+up/U=","i18n.ro.umd.min.js":"sha256-cfWLEysdNAXbJoUPiso7b/WzJLN8B/WXhiLbZhYnVOg=","i18n.rs.umd.min.js":"sha256-63b2V01x/9O4NRist6C7IJqH6CK8dUzj2qUkCPVw6NU=","i18n.ru.umd.min.js":"sha256-v0Ag1w+C3IHL+e7A8Gidl+tvfB0bo22ztx5ZRGq5XBk=","i18n.sk.umd.min.js":"sha256-sq+6dFEBdIhYqDCu8tYk4zn5BeNGbluuy8+NODezuhI=","i18n.sl.umd.min.js":"sha256-aKYcOfhQGwA33UlYDWk+oMeF2UO9dxgIyD91gkyAh+w=","i18n.sv.umd.min.js":"sha256-WmehfJ+Wr58d0LAPMU7r28QPZ3xMQRsdy1k+O2dJrtA=","i18n.th.umd.min.js":"sha256-QCNupoGyjZNOlxL994B/HFa/LZSLG1w9pGBMcL65N7I=","i18n.tr.umd.min.js":"sha256-YeGHAB1L5Bi1FheOamkJeo8YcbCrR1qHViLDuIumRPw=","i18n.uk.umd.min.js":"sha256-u0BM5UgQptG6nv3O4JnKfUqNxH/mB8q7Kawn9w3ZrwA=","i18n.vi.umd.min.js":"sha256-iwhs0J52b2ZPbT2ylFmleLJcBaNDOFlcPPT49aWlyHY=","i18n.zh-hans.umd.min.js":"sha256-xCTDgdsu7O2czrsazYnIylFkeGSwjZlbE8hAivjxQ38=","i18n.zh-hant.umd.min.js":"sha256-2qbBLOaIG1OA9J8SsIERIw82HfeczhITnVu/FGEcDlc=","icons.fontawesome-pro.umd.min.js":"sha256-tDyNJmoJDQV8lNtEnSajcC5UYtEEhZqgRBE7v0YSRRE=","icons.fontawesome.umd.min.js":"sha256-3mwXp3Aoavle4Tnw6BMy4+keDdUYK6yziU3O9LskaIc=","icons.ionicons.umd.min.js":"sha256-3StfIDnkVtBeZKsxQO9LjbN+nf9DLVsP3B7cbxm6EyQ=","icons.material-icons.umd.min.js":"sha256-0YoiFMuZFR+CzdQCGZ5p2kl9wZsjoADGKV/Ouki4X24=","icons.mdi.umd.min.js":"sha256-iuZGWhbwzKFqiq0Fd0XooI/e8t0gkgYQ9c3cUUspzrU=","quasar.addon.css":"sha256-XLP2gW+kjFoziYo7xtxwWX54QIIbrfhPEZnA5Ero6qE=","quasar.addon.min.css":"sha256-sgam1sftp7TFJJgj5kjAVrfEDZDMj8BDPVGwRDbTu/4=","quasar.addon.rtl.css":"sha256-yD8OuGkwmpZrr/2hfOK2fUHdIE0l7gQq4bXXI0B66Jc=","quasar.addon.rtl.min.css":"sha256-YD7+EZlBMmhoNhjtWatFWDitJ+YqdMvcOoI5GTzFwvM=","quasar.ie.polyfills.umd.min.js":"sha256-+BpxSJZkQNjm/qb/PesSxwtUsma9g2wsjR1/yO0O1NQ=","quasar.ios.css":"sha256-5ICy4JBoOHWszI7Jw7oR/FkoD6usaFGErotDeR3PqKU=","quasar.ios.min.css":"sha256-Q+6gtNKO9i/Y6rY1HKo4/l3ohjluXHfvfKiT7yuhhno=","quasar.ios.rtl.css":"sha256-7DjSE2E3tYA/rNuzQXA/HLv2+fRzGUC8HWuPtzTPXLs=","quasar.ios.rtl.min.css":"sha256-vrSnfu9QP9iMEIBWPHofYTlSb1sOs3qYCWpT75LAbEo=","quasar.ios.umd.js":"sha256-p1UifVsd7ivuvpSBE60E6ZiY0WCFsWm6+5pFlXhS14o=","quasar.ios.umd.min.js":"sha256-A34+V5Vvv4BNVHYIIu5KeyTytMfFFZMv0e5t9U2Sc04=","quasar.mat.css":"sha256-ue+S2+opCyV7xRMUAgLkEe8ayz6yee1QPbZJsu4WaIg=","quasar.mat.min.css":"sha256-U+y0XzN10nYrj1DArhpruQssA/v/LyJDlMLsQDjFYU4=","quasar.mat.rtl.css":"sha256-DBvIFUQHdk+u1/scCXR/T8fS2g3n3p4UfSiagIE9X9g=","quasar.mat.rtl.min.css":"sha256-U6BeljULWz0+2tv0adUyPJ3Mlv3es0yskiYWpPEVViQ=","quasar.mat.umd.js":"sha256-vE80+8dY23LNiIyUjgligStGqcKARyzHGbhEJOwoJec=","quasar.mat.umd.min.js":"sha256-urC1+1UvFq75hHks9ZVUBkrA5PCzWkLPhDjkwuyMTrM="} | json |
# Example: Disable Call Recording
api.disable_call_recording('c-callId')
| python |
Shakib to Nathan Ellis, out Bowled!!The arm ball slinged in and Nathan Ellis missed the line to be clean bowled. The batter prodded forward but missed it. The ball slided between pad and bat to bring about the ninth wicket for Bangladesh. Australia on the verge of embarrassment. Nathan Ellis b Shakib 1(7)
| english |
This is starting period of Shani's Sade Sati. In this period Saturn will be transiting in 12th house from the Moon. It generally indicates financial loss, problems by hidden enemies, aimless travel, disputes, and poverty. During this period, Ivan Lendl may face problems created by Ivan Lendl's hidden enemies. Relationship with Ivan Lendl's colleagues will not good enough and they will create problems in Ivan Lendl's work environment. Ivan Lendl may also face challenges on Ivan Lendl's domestic front. This may create pressure and tension. Ivan Lendl needs to exercise control over Ivan Lendl's spending otherwise it be lead to bigger financial problems. Long distance travels may not be fruitful during this period. Saturn's nature is of delay and dejection, but generally Ivan Lendl will get results eventually, so be patient and wait for Ivan Lendl's turn. Take this period as learning period, put Ivan Lendl's hard work and things will fall in place. Ivan Lendl advised not to take high risks in business matters in this period.
This is the peak of Shani's Sade Sati. Generally this phase of Saturn is the most difficult one. Saturn transiting over natal Moon indicates health problems, character assassination, problems in relationship, mental afflictions, and sorrows. Ivan Lendl will find it difficult to achieve success in this period. Ivan Lendl may not get results of Ivan Lendl's hard work and feel restricted. Ivan Lendl's constitution and immune system will not be strong. As first house is the house of health, Ivan Lendl should start exercising and taking care of Ivan Lendl's health, otherwise Ivan Lendl can be caught by chronic diseases. Ivan Lendl may suffer from depression, unknown fear or phobia. Ivan Lendl's will lack clarity in thinking, action, and decision making. Ivan Lendl will be spiritually inclined and will be attracted by intricacies of nature. Acceptance and doing basics right will sail Ivan Lendl out of this period.
This is 'setting' period of Shani's Sade Sati. Saturn will be transiting in the 2nd house from the natal Moon, which indicates difficulty on financial and domestic front. Ivan Lendl will start feeling slight relief after having two difficult phases of Sade Sati. Still, misunderstandings and financial stress can be seen during this period. Expenses may keep soaring high and Ivan Lendl need to continue exercising control. Sudden financial losses and fear of theft is also a possibility. Ivan Lendl may be pessimistic in thinking, Ivan Lendl is advised to deal with matters enthusiastically. Ivan Lendl will require paying good attention to family and personal front, otherwise those can also lead to a bigger problem. For students, education may be slightly affected and they will have to work harder to hold on to their existing level. Results will be slow and almost always with the delay. This is a period which indicates danger and apart from other things, Ivan Lendl need to be careful while driving. If possible, stay away from non-veg and Ivan Lendl's drinking habits to keep Saturn happy. Ivan Lendl will be able to sail through this period by intelligently handling Ivan Lendl's domestic and financial matters.
| english |
<reponame>fireloudapp/location
[{"id":17301,"Name":"Berberati","state_id":1257,"state_code":"HS","state_name":"Mambéré-Kadéï","country_id":42,"country_code":"CF","country_name":"Central African Republic","latitude":"4.31211000","longitude":"15.88948000","wikiDataId":"Q2626276"},{"id":17314,"Name":"Carnot","state_id":1257,"state_code":"HS","state_name":"Mambéré-Kadéï","country_id":42,"country_code":"CF","country_name":"Central African Republic","latitude":"4.94273000","longitude":"15.87735000","wikiDataId":"Q598667"},{"id":17317,"Name":"Gamboula","state_id":1257,"state_code":"HS","state_name":"Mambéré-Kadéï","country_id":42,"country_code":"CF","country_name":"Central African Republic","latitude":"4.11775000","longitude":"15.13926000","wikiDataId":"Q962947"}] | json |
module.exports = function (util) {
var trans = util.trans
, assert = util.assert
, add = util.add
, sum = util.sum
, square = util.square;
describe('map', function () {
it('should map the transformation state - object1', function () {
var o = 'abc'
, t = trans(o).map('toUpperCase').value();
assert.strictEqual(t, 'ABC');
});
it('should map the transformation state - object2', function () {
var o = { a: 'abc' }
, t = trans(o).map('a', 'toUpperCase').value();
assert.strictEqual(t, 'ABC');
});
it('should map the transformation state - object3', function () {
var o = { a: { b: 'abc' } }
, t = trans(o).map('a', 'b', ['substring', 1, 3], 'toUpperCase').value();
assert.strictEqual(t, 'BC');
});
it('should map the transformation state - object3', function () {
var o = { a: { b: { c: 1 } } }
, t = trans(o).map('a', 'b', 'c').value();
assert.strictEqual(t, 1);
});
it('should map the transformation state - array1a', function () {
var o = [ 1, 2, 3 ]
, t = trans(o).map('.', [add, 1]).value();
assert.deepEqual(t, [ 2, 3, 4 ]);
});
it('should accept functions in array format1', function () {
var o = [ 1, 2, 3 ]
, t = trans(o).map('.', [add, 5]).value();
assert.deepEqual(t, [ 6, 7, 8 ]);
});
it('should pass in the element index when iterating through an array', function () {
var o = [ 'a', 'b', 'c', 'd' ]
, t = trans(o).map('.', function (x) { return x + this.getIndex(); }).value();
assert.deepEqual(t, [ 'a0', 'b1', 'c2', 'd3' ]);
});
it('should accept functions in array format2', function () {
var o = [ 'ab', 'cde' ]
, t = trans(o).map('.', ['concat', 'ww', 'zz']).value();
assert.deepEqual(t, [ 'abwwzz', 'cdewwzz' ]);
});
it('should map the transformation state - array 1', function () {
var o = [ { b: 1, c: 3 }, { b: 2, c: 3 } ]
, t = trans(o).map('.', function(x) { return x.b + x.c; }).value();
assert.deepEqual(t, [ 4, 5 ] );
});
it('should map the transformation state - array1b', function () {
var o = [ { a: 1 }, { a: 2 }, {a: 3 } ]
, t = trans(o).map('.', 'a', [add, 1]).value();
assert.deepEqual(t, [ 2, 3, 4 ]);
});
it('should map the transformation state - array1c', function () {
var o = [ { a: { b: 1 } }, { a: { b: 2 } }, {a: { b: 3 } } ]
, t = trans(o).map('.', 'a', 'b', [add, 1]).value();
assert.deepEqual(t, [ 2, 3, 4 ]);
});
it('should map the transformation state - array1d', function () {
var o = [
{ a: [ { b: 1 }, { b: 2 } ] }
, { a: [ { b: 2 }, { b: 2 } ] }
, { a: [ { b: 1 }, { b: 3 } ] }
, { a: [ { b: 3 }, { b: 4 } ] } ]
, t = trans(o).map('.', 'a', '.', 'b', [add, 5]).value();
assert.deepEqual(t, [ [ 6, 7 ], [ 7, 7 ], [ 6, 8 ], [ 8, 9 ] ]);
});
it('should map the transformation state - array1e', function () {
var o = [
{ a: [ { b: 1 }, { b: 2 } ] }
, { a: [ { b: 2 }, { b: 2 } ] }
, { a: [ { b: 1 }, { b: 3 } ] }
, { a: [ { b: 3 }, { b: 4 } ] } ]
, t = trans(o).map('.', 'a').value();
assert.deepEqual(t, [
[ { b: 1 }, { b: 2 } ]
, [ { b: 2 }, { b: 2 } ]
, [ { b: 1 }, { b: 3 } ]
, [ { b: 3 }, { b: 4 } ] ]);
});
it('should map the transformation state - array2', function () {
var o = [ 'abc', 'de', 'defg' ]
, t = trans(o).map('length').value();
assert.deepEqual(t, 3);
});
it('should map the transformation state - array2', function () {
var o = [ 'abc', 'de', 'defg' ]
, t = trans(o).map('length').value();
assert.deepEqual(t, 3);
});
it('should map the transformation state - array3', function () {
var o = [ 'abc', 'de', 'defg' ]
, t = trans(o).map('.', 'length').value();
assert.deepEqual(t, [ 3, 2, 4 ]);
});
it('should apply multiple transformers in the given order', function () {
var o = [ 1, 2, 3 ]
, e1 = trans(o).map('.', square, [add, 1]).value()
, e2 = trans(o).map('.', [add, 1], square).value();
assert.deepEqual(e1, [ 2, 5, 10 ]);
assert.deepEqual(e2, [ 4, 9, 16 ]);
});
it('should allow passing field names for transformers', function () {
var o = [ 1, 2, 3 ]
, t = trans(o).map('length', [add, 2]).value();
assert.strictEqual(t, o.length + 2);
});
it('should work with transformers that return null', function () {
var o = 'abc'
, t = trans(o).map(function () { return null; }).value();
assert.strictEqual(t, null);
});
it('should collect values from nested arrays', function () {
var o = [
[ { a: { b: 1 } }, { a: { b: 2 } } ]
, [ { a: { b: 3 } } ]
, [ { a: { b: 4 } }, { a: { b: 5 } } ] ]
, t = trans(o).map('.', '.', 'a','b', [add, 5]);
assert.deepEqual(t.value(), [ [ 6, 7 ], [ 8 ], [ 9, 10 ] ]);
assert.deepEqual(t.map('.', sum).value(), [ 13, 8, 19 ]);
assert.deepEqual(t.map(sum).value(), 40);
});
it('should allow passing hash maps as transformers', function () {
var o = [ 1, 2, 3, 4 ]
, nums = { 1: 'one', 2: 'two', 3: 'three', 4: 'four' }
, t = trans(o).map('.', nums).value();
assert.deepEqual(t, [ 'one', 'two', 'three', 'four' ]);
});
it('should fail if a null transformer is specified', function () {
assert.throws(function () {
trans({ a: 1 }).map(null);
}, /could not apply transformer null/i);
});
it('should fail if an invalid transformer is specified', function () {
assert.throws(function () {
trans({ a: 1 }).map(1);
}, /could not apply transformer 1/i);
});
});
describe('mapf', function () {
it('should map the object at the given field - object', function () {
var o = { a: 1 }
, t = trans(o).mapf('a', [add, 1]).value();
assert.deepEqual(t, { a: 2 });
});
it('should behave like map if the specified field is null', function () {
var o = [ 1, 2 ]
, t = trans(o).mapf(null, 'length').value();
assert.strictEqual(t, 2);
});
it('should map the object at the given field - array1a', function () {
var o = { a: { b: [ 1, 2, 3 ] } }
, t = trans(o).mapf('a.b.', square, [add, 1]).value();
assert.deepEqual(t, { a: { b: [ 2, 5, 10 ] } });
});
it('should map the object at the given field - array1b', function () {
var o = { a: { b: [ 1, 2, 3 ] } }
, t = trans(o).mapf('a.b', 'length', [add, 1]).value();
assert.deepEqual(t, { a: { b: 4 } });
});
it('should replace an array with its first element', function () {
var o = { a: { b: [ 1, 2, 3 ] } }
, t = trans(o).mapf('a.b', 'shift').value();
assert.deepEqual(t, { a: { b: 1 } });
});
it('should replace an array with its last element', function () {
var o = { a: { b: [ 1, 2, 3 ] } }
, t = trans(o).mapf('a.b', 'pop').value();
assert.deepEqual(t, { a: { b: 3 } });
});
it('should take only the first x elements from an array', function () {
var o = { a: { b: [ 1, 2, 3, 4, 4, 5, 8 ] } }
, t = trans(o).mapf('a.b', ['slice', 0, 3]).value();
assert.deepEqual(t, { a: { b: [ 1, 2, 3 ] } });
});
it('should map the object at the given field - array2', function () {
var o = { a: [ { b: 1 }, { b: 2 }, { b: 3 } ] }
, t = trans(o).mapf('a.b', [add, 1], square).value();
assert.deepEqual(t, { a: [ { b: 4 }, { b: 9 }, { b: 16 } ] });
});
it('should map the object at the given field - array3', function () {
var o = { a: [ { b: { c: 1 } }, { b: { c: 2 } }, { b: { c: 3 } } ] }
, t = trans(o).mapf('a.b.c', [add, 1], square).value();
assert.deepEqual(t, { a: [ { b: { c: 4 } }, { b: { c: 9 } }, { b: { c: 16 } } ] });
});
it('should map the object at the given field - array4', function () {
var o = [ { a: { b: { c: 'abc' } } }, { a: { b: { c: 'def' } } } ]
, t = trans(o).mapf('a.b.c', 'toUpperCase').value();
assert.deepEqual(t, [ { a: { b: { c: 'ABC' } } }, { a: { b: { c: 'DEF' } } } ]);
});
it('should map the object at the given field - array5', function () {
var o = [
{ a: [ { b: { c: 1 } }, { b: { c: 2 } } ] }
, { a: [ { b: { c: 2 } }, { b: { c: 3 } } ] } ]
, t = trans(o).mapf('a.b.c', [add, 1]).value();
assert.deepEqual(t, [
{ a: [ { b: { c: 2 } }, { b: { c: 3 } } ] }
, { a: [ { b: { c: 3 } }, { b: { c: 4 } } ] } ]);
});
it('should map the object at the given field - array6', function () {
var o = { a: [ { b: [ 1, 1, 2 ] }, { b: [ 3, 3 ] }, { b: [ 1, 2, 3 ] } ] }
, t = trans(o).mapf('a.b.', [add, 1]).value();
assert.deepEqual(t, { a: [ { b: [ 2, 2, 3 ] }, { b: [ 4, 4 ] }, { b: [ 2, 3, 4 ] } ] });
});
it('should map the object at the given field - array7', function () {
var o = { a: [ { b: [ 1, 1, 2 ] }, { b: [ 3, 3 ] }, { b: [ 1, 2, 3 ] } ] }
, t = trans(o).mapf('a.b', 'length').value();
assert.deepEqual(t, { a: [ { b: 3 }, { b: 2 }, { b: 3 } ] });
});
it('should create missing fields 1', function () {
var o = [ { a: { b: 1 } }, { a: { } }, { a: { b: 3 } } ]
, t = trans(o).mapf('a.b', [add, 1]).value();
assert.deepEqual(t, [ { a: { b: 2 } }, { a: { b: 1 } }, { a: { b: 4 } } ]);
});
it('should create missing fields 2', function () {
var o = { a: { b: {} } }
, t = trans(o).mapf('a.b.c', [add, 1]).value();
assert.deepEqual(t, { a: { b: { c: 1 } } });
});
it('should work with nested fields', function () {
var o = { a: { b: { c: 'abc' } } }
, t = trans(o).mapf('a.b.c', 'toUpperCase').value();
assert.deepEqual(t, { a: { b: { c: 'ABC' } } });
});
it('should work with nested arrays', function () {
var o = { a: [ [ { b: 1 } ], [ { b: 2 } ] ] }
, t = trans(o).mapf('a.b', [add, 1]).value();
assert.deepEqual(t, { a: [ [ { b: 2 } ], [ { b: 3 } ] ] });
});
it('should handle empty objects', function () {
var o = [ {}, {} ]
, t = trans(o).mapf('b', [ add, 1 ]).value();
assert.deepEqual(t, [ { b: 1 }, { b: 1 } ]);
});
it('should pass the index when iterating arrays 1', function () {
var o = { a: [
{ b: [ 'a', 'b', 'c' ] }
, { b: [ 'd', 'e' ] }
, { b: [ 'f' ] } ] }
, t = trans(o).mapf('a.b.', function(x) { return x + this.getIndex(); }).value();
assert.deepEqual(t, { a: [
{ b: [ 'a0', 'b1', 'c2' ] }
, { b: [ 'd0', 'e1' ] }
, { b: [ 'f0' ] } ] });
});
it('should pass the index when iterating arrays 2', function () {
var o = [
{ a: [ { b: [ 'aa', 'ab' ] }, { b: [ 'ac', 'ad', 'ae' ] } ] }
, { a: [ { b: [ 'ba', 'bb' ] }, { b: [ 'bc', 'bd', 'be' ] } ] }
, { a: [ { b: [ 'ca', 'cb' ] }, { b: [ 'cc', 'cd', 'ce' ] } ] }
, { a: [ { b: [ 'da', 'db' ] }, { b: [ 'dc', 'dd', 'de' ] } ] } ]
, t = trans(o)
.map('.', 'a', '.', 'b', '.', function (x) { return x + this.getIndex(); })
.value();
assert.deepEqual(t, [
[ [ 'aa0', 'ab1' ], [ 'ac0', 'ad1', 'ae2' ] ]
, [ [ 'ba0', 'bb1' ], [ 'bc0', 'bd1', 'be2' ] ]
, [ [ 'ca0', 'cb1' ], [ 'cc0', 'cd1', 'ce2' ] ]
, [ [ 'da0', 'db1' ], [ 'dc0', 'dd1', 'de2' ] ]
]);
});
});
describe('mapff', function () {
it('should map the object at the given field - object', function () {
var o = { a: 1 }
, t = trans(o).mapff('a', 'c', [add, 1]).value();
assert.deepEqual(t, { a: 1, c: 2 });
});
it('should iterate the array when there is a final dot in the field name', function () {
var o = { a: { b: [ 1, 2, 3 ] } }
, t = trans(o).mapff('a.b.', 'c', square, [add, 1]).value();
assert.deepEqual(t, { a: { b: [ 1, 2, 3 ] }, c: [ 2, 5, 10 ] });
});
it('should not iterate the array when there is no final dot in the field name', function () {
var o = { a: { b: [ 1, 2, 3 ] } }
, t = trans(o).mapff('a.b', 'c', 'length', [add, 1], square).value();
assert.deepEqual(t, { a: { b: [ 1, 2, 3 ] }, c: 16 });
});
it('should map the object at the given field - array1c', function () {
var o = { a: { b: [ 1, 2, 3 ] } }
, t = trans(o).mapff('a.b.', 'a.b', square, [add, 1]).value();
assert.deepEqual(t, { a: { b: [ 2, 5, 10 ] } });
});
it('should map the object at the given field - array1d', function () {
var o = { a: { b: [ 1, 2, 3 ] } }
, t = trans(o).mapff('a.b', 'a.b', sum).value();
assert.deepEqual(t, { a: { b: 6 } });
});
it('should map the object at the given field - array2a', function () {
var o = { a: [ { b: 1 }, { b: 2 }, { b: 3 } ] }
, t = trans(o).mapff('a.b', 'a.c', [add, 1], square).value();
assert.deepEqual(t, { a: [ { b: 1, c: 4 } , { b: 2, c: 9 } , { b: 3, c: 16 } ] });
});
it('should map the object at the given field - array2b', function () {
var o = { a: [ { b: 1 }, { b: 2 }, { b: 3 } ] }
, t = trans(o).mapff('a.b', 'c', '.', [add, 1], square).value();
assert.deepEqual(t, { a: [ { b: 1 }, { b: 2 }, { b: 3 } ] , c: [ 4, 9, 16 ] });
});
it('should map the object at the given field - array2c', function () {
var o = { a: [ { b: 1 }, { b: 2 }, { b: 3 } ] }
, t = trans(o).mapff('a', 'c').value();
assert.deepEqual(t, {
a: [ { b: 1 }, { b: 2 }, { b: 3 } ]
, c: [ { b: 1 }, { b: 2 }, { b: 3 } ] });
});
it('should map the correct source to the correct destination', function () {
var o = { a: [ { b: 1 }, { b: 2 }, { b: 3 } ], e: [ { b: 1 }, { b: 2 } ] }
, t = trans(o).mapff('a.b', 'e.c').value();
assert.deepEqual(t, {
a: [ { b: 1 }, { b: 2 }, { b: 3 } ]
, e: [ { b: 1, c: [ 1, 2, 3 ] }, { b: 2, c: [ 1, 2, 3 ] } ]
});
});
it('should map the correct source to the correct destination - nested arrays', function () {
var o = { a: [ { b: 1 }, { b: 2 }, { b: 3 } ], e: [ [ { b: 1 } ], [ { b: 2 } ] ] }
, t = trans(o).mapff('a.b', 'e.c').value();
assert.deepEqual(t, {
a: [ { b: 1 }, { b: 2 }, { b: 3 } ]
, e: [ [ { b: 1, c: [ 1, 2, 3 ] } ], [ { b: 2, c: [ 1, 2, 3 ] } ] ]
});
});
it('should create a field on the target object(s)', function () {
var o = { a: [ { b: 1 }, { b: 2 }, { b: 3 } ] }
, t = trans(o).mapff('a.c', 'a.c', function () { return 'a'; }).value();
assert.deepEqual(t, { a: [ { b: 1, c: 'a' } , { b: 2, c: 'a' } , { b: 3, c: 'a' } ] });
});
it('should work with nested fields within an array', function () {
var o = { a: [ { b: { c: 1 } }, { b: { c: 2 } }, { b: { c: 3 } } ] }
, t = trans(o).mapff('a.b.c', 'd', '.', [add, 1], square).value();
assert.deepEqual(t, {
a: [ { b: { c: 1 } }, { b: { c: 2 } }, { b: { c: 3 } } ]
, d: [ 4, 9, 16 ]
});
});
it('should replace nested fields within arrays 1', function () {
var o = { a: [ { b: { c: 1 } }, { b: { c: 2 } }, { b: { c: 3 } } ] }
, t = trans(o).mapff('a.b.c', 'a.b', [add, 1], square).value();
assert.deepEqual(t, { a: [ { b: 4 }, { b: 9 }, { b: 16 } ] });
});
it('should replace nested fields within arrays 2', function () {
var o = [ { a: { b: { c: 'abc' } } }, { a: { b: { c: 'def' } } } ]
, t = trans(o).mapff('a.b.c', 'a', 'toUpperCase').value();
assert.deepEqual(t, [ { a: 'ABC' }, { a: 'DEF' } ]);
});
it('should map fields within the proper object 1', function () {
var o = { a: [ { b: { c: 1 } }, { b: { c: 2 } }, { b: { c: 3 } } ] }
, t = trans(o).mapff('a.b.c', 'a.b.d', [add, 1], square).value();
assert.deepEqual(t, { a: [
{ b: { c: 1, d: 4 } }
, { b: { c: 2, d: 9 } }
, { b: { c: 3, d: 16 } } ] });
});
it('should map fields within the proper object 2', function () {
var o = [
{ a: { b: { c: 'abc' } } }
, { a: { b: { c: 'def' } } } ]
, t = trans(o).mapff('a.b.c', 'd', 'toUpperCase').value();
assert.deepEqual(t, [
{ a: { b: { c: 'abc' } }, d: 'ABC' }
, { a: { b: { c: 'def' } }, d: 'DEF' }
]);
});
it('should map fields within the proper object 3', function () {
var o = [
{ a: [ { b: { c: 1 } }, { b: { c: 2 } } ] }
, { a: [ { b: { c: 2 } }, { b: { c: 3 } } ] } ]
, t = trans(o).mapff('a.b.c', 'd', '.', [add, 1], square).value();
assert.deepEqual(t, [
{ a: [ { b: { c: 1 } }, { b: { c: 2 } } ], d: [ 4, 9 ] }
, { a: [ { b: { c: 2 } }, { b: { c: 3 } } ], d: [ 9, 16 ] } ]);
});
it('should map fields within the proper object 4', function () {
var o = [
{ a: [ { b: { c: 1 } }, { b: { c: 2 } } ] }
, { a: [ { b: { c: 2 } }, { b: { c: 3 } } ] } ]
, t = trans(o).mapff('a.b.c', 'a.b', [add, 1], square).value();
assert.deepEqual(t, [
{ a: [ { b: 4 }, { b: 9 } ] }
, { a: [ { b: 9 }, { b: 16 } ] } ]);
});
it('should map fields within the proper object 5', function () {
var o = [
{ a: [ { b: { c: 1 } }, { b: { c: 2 } } ] }
, { a: [ { b: { c: 2 } }, { b: { c: 3 } } ] } ]
, t = trans(o).mapff('a.b.c', 'a', '.', [add, 1], square).value();
assert.deepEqual(t, [
{ a: [ 4, 9 ] }
, { a: [ 9, 16 ] } ]);
});
it('should map fields within the proper object 6', function () {
var o = [
{ a: [ { b: { c: 1 } }, { b: { c: 2 } } ] }
, { a: [ { b: { c: 2 } }, { b: { c: 3 } } ] } ]
, t = trans(o).mapff('a.b.c', 'a.b.d', [add, 1], square).value();
assert.deepEqual(t, [
{ a: [ { b: { c: 1, d: 4 } }, { b: { c: 2, d: 9 } } ] }
, { a: [ { b: { c: 2, d: 9 } }, { b: { c: 3, d: 16 } } ] } ]);
});
it('should map fields within the proper object 7', function () {
var o = [ { a: [ { b: { c: 1 } }, { b: { c: 2 } } ] }, { a: [ { b: { c: 3 } } ] } ]
, t = trans(o).mapff('a.b.c', 'e', sum).value();
assert.deepEqual(t, [
{ a: [ { b: { c: 1 } }, { b: { c: 2 } } ], e: 3 }
, { a: [ { b: { c: 3 } } ], e: 3 } ]);
});
it('should not skip missing fields 1', function () {
var o = [ { a: { b: 1 } }, { a: { } }, { a: { b: 3 } } ]
, t = trans(o).mapff('a.b', 'c', [add, 1]).value();
assert.deepEqual(t, [
{ a: { b: 1 }, c: 2 }
, { a: { }, c: 1 }
, { a: { b: 3 }, c: 4 }
]);
});
it('should not skip missing fields 2', function () {
var o = { a: { b: {} } }
, t = trans(o).mapff('a.b.c', 'd', [add, 1]).value();
assert.deepEqual(t, { a: { b: {} }, d: 1 });
});
it('should not skip missing fields 3', function () {
var o = [ { a: { b: 1 } }, { a: { b: 2 } }, { a: {} }, { a: {} } ]
, t = trans(o)
.mapff('a.b', 'a.b', function (x) { return x || 100; })
.value();
assert.deepEqual(t, [
{ a: { b: 1 } }
, { a: { b: 2 } }
, { a: { b: 100 } }
, { a: { b: 100 } } ]);
});
it('should allow nested fields', function () {
var o = { a: { b: { c: 'abcde' } } }
, t = trans(o)
.mapff('a.b.c', 'a.d', 'toUpperCase', util.truncate)
.value();
assert.deepEqual(t, { a: { b: { c: 'abcde' }, d: 'ABC' } });
});
it('should override fields with the same name 1', function () {
var o = { a: { b: 3 } }
, t = trans(o).mapff('a.b', 'a').value();
assert.deepEqual(t, { a: 3 });
});
it('should override fields with the same name 2', function () {
var o = {
a: [ { b: 1 }, { b: 2 }, { b: 3 } ]
, e: [ { b: 1, c: 'a' }, { b: 2, c: 'b' } ] }
, t = trans(o).mapff('a.b', 'e.c').value();
assert.deepEqual(t, {
a: [ { b: 1 }, { b: 2 }, { b: 3 } ]
, e: [ { b: 1, c: [ 1, 2, 3 ] }, { b: 2, c: [ 1, 2, 3 ] } ]
});
});
it('should override fields with the same name 3', function () {
var o = {
a: [ { b: '1' }, { b: '2' }, { b: '3' } ]
, e: [ { b: 1, c: 'a' }, { b: 2, c: 'b' } ] }
, t = trans(o).mapff('a.b', 'e.c', '.', function (x) { return x + ':' + this.getIndex(); }).value();
assert.deepEqual(t, {
a: [ { b: '1' }, { b: '2' }, { b: '3' } ]
, e: [
{ b: 1, c: [ '1:0', '2:1', '3:2' ] }
, { b: 2, c: [ '1:0', '2:1', '3:2' ] }
]
});
});
it('should work with nested arrays 1', function () {
var o = [ [ { a: { b: 1 } }, { a: { b: 2 } } ], [ { a: { b: 3 } } ] ]
, t = trans(o).mapff('a.b', 'a.c', [add, 2]).value();
assert.deepEqual(t, [
[ { a: { b: 1, c: 3 } }, { a: { b: 2, c: 4 } } ]
, [ { a: { b: 3, c: 5 } } ]
]);
});
it('should work with nested arrays 2', function () {
var o = [ [ { a: { b: 1 } }, { a: { b: 2 } } ], [ { a: { b: 3 } } ] ]
, t = trans(o).mapff('a.b', 'c', [add, 2]).value();
assert.deepEqual(t, [
[ { a: { b: 1 }, c: 3 }, { a: { b: 2 }, c: 4 } ]
, [ { a: { b: 3 }, c: 5 } ]
]);
});
it('should make all array indexes available', function () {
var o = [
{ a: { b: [ { c: [ 'a', 'b' ] }, { c: [ 'c', 'd', 'e' ] } ] } }
, { a: { b: [ { c: [ 'f', 'g', 'k' ] }, { c: [ 'l', 'm', 'n', 'o' ] }, { c: [ 'r', 's' ] } ] } }
, { a: { b: [ { c: [ 't', 'u', 'v', 'w' ] } ] } }
]
, t = trans(o).mapff('a.b.c.', null, '.', function (x) {
return x + ':' + this.getIndexes() + ':' + this.getIndex();
}).value();
assert.deepEqual(t, [
[ [ 'a:0,0,0:0', 'b:1,0,0:1' ], [ 'c:0,1,0:0', 'd:1,1,0:1', 'e:2,1,0:2' ] ]
, [
[ 'f:0,0,1:0', 'g:1,0,1:1', 'k:2,0,1:2' ]
, [ 'l:0,1,1:0', 'm:1,1,1:1', 'n:2,1,1:2', 'o:3,1,1:3' ]
, [ 'r:0,2,1:0', 's:1,2,1:1' ]
]
, [ [ 't:0,0,2:0', 'u:1,0,2:1', 'v:2,0,2:2', 'w:3,0,2:3' ] ] ]);
});
it('should parse field paths properly', function () {
var o = [ { names: { taught: [ 1, 2, 4 ] } }, { names: { taught: [ 1 ] } } ]
, t = trans(o).mapff('names.taught', 'names.taughtCount', 'length').value();
assert.deepEqual(t, [
{ names: { taught: [ 1, 2, 4 ], taughtCount: 3 } }
, { names: { taught: [ 1 ], taughtCount: 1 } }
]);
});
it('should replace the whole object when the destination field is null 1', function () {
var o = [ 1, 2, 3 ]
, t = trans(o).mapff(null, null, 'length').value();
assert.strictEqual(t, 3);
});
it('should replace the whole object when the destination field is null 2', function () {
var o = [ 1, 2, 3 ]
, t = trans(o).mapff('.', null, [add, 1]).value();
assert.deepEqual(t, [2, 3, 4]);
});
it('should replace the whole object when the destination field is null 3', function () {
var o = [ { a: { b: [ 1, 2 ] } }, { a: { b: [ 4 ] } }, { a: { b: [ 6, 7 ,8 ] } } ]
, t = trans(o).mapff('a.b').value();
assert.deepEqual(t, [ [ 1, 2 ], [ 4 ], [ 6, 7, 8 ] ]);
});
it('should replace the whole object when the destination field is null 3b', function () {
var o = [ { a: { b: [ 'a', 'b' ] } }, { a: { b: [ 'c' ] } }, { a: { b: [ 'd', 'e' ,'f' ] } } ]
, t = trans(o).mapff('a.b.', null, function (x) { return x + this.getIndex(); }).value();
assert.deepEqual(t, [ [ 'a0', 'b1' ], [ 'c0' ], [ 'd0', 'e1', 'f2' ] ]);
});
it('should replace the whole object when the destination field is null 4', function () {
var o = [
{ a: [ { b: [ 1, 2 ] }, { b: [ 3, 4 ] } ] }
, { a: [ { b: [ 4 ] }, { b: [ 11, 22 ] }, { b: [ 199 ] } ] }
, { a: [ { b: [ 6, 7 ,8 ] } ] } ]
, t = trans(o).mapff('a.b').value();
assert.deepEqual(t, [
[ [ 1, 2 ], [ 3, 4 ] ]
, [ [ 4 ], [ 11, 22 ], [ 199 ] ]
, [ [ 6, 7, 8 ] ]
]);
});
it('should handle falsy values 1', function () {
var o = { a: 0 }
, t = trans(o).mapff('a', 'b', square).value();
assert.deepEqual(t, { a: 0, b: 0 });
});
it('should handle falsy values 2', function () {
var o = { a: { b: 0 } }
, t = trans(o).mapff('a.b', 'a.c', square).value();
assert.deepEqual(t, { a: { b: 0, c: 0 }});
});
it('should handle falsy values 3', function () {
var t = trans(0).mapff(null, null, square).value();
assert.strictEqual(t, 0);
});
it('should handle empty arrays', function () {
var t = trans([]).mapff('a.b', 'a.c', [ add, 1 ]).value();
assert.deepEqual(t, []);
});
it('should handle empty objects', function () {
var o = [ {}, {} ]
, t = trans(o).mapff('a', 'b', [ add, 1 ]).value();
assert.deepEqual(t, [ { b: 1 }, { b: 1 } ]);
});
it('should replace the whole object when the destination field is null 5', function () {
var o = [ { a: { b: 1 } }, { a: { b: 2 } }, { a: {} }, { a: {} } ]
, t = trans(o)
.mapff('a.b', null, function (x) { return x || 100; }, [add, 2])
.value();
assert.deepEqual(t, [ 3, 4, 102, 102 ]);
});
it('should allow setting a field on the source object 1', function () {
var o = { a: { b: 1, c: 2 } }
, t = trans(o).mapff('a', 'a.d', function (x) { return x.b + x.c; }).value();
assert.deepEqual(t, { a: { b: 1, c: 2, d: 3 } });
});
it('should allow setting a field on the source object 2', function () {
var o = { a: [ { b: 1 }, { b: 2 } ] }
, t = trans(o).mapff('a', 'a.c', 'b', [ add, 1 ]).value();
assert.deepEqual(t, { a: [ { b: 1, c: 2 }, { b: 2, c: 3 } ] });
});
it('should allow setting a field on the source object 3', function () {
var o = [ { a: [ { b: 1 }, { b: 2 } ] }, { a: [ { b: 2 } ] } ]
, t = trans(o).mapff(null, 'a.c', 'a', 'length').value();
assert.deepEqual(t, [
{ a: [ { b: 1, c: 2 }, { b: 2, c: 2 } ] }
, { a: [ { b: 2, c: 1 } ] } ]);
});
it('should allow setting a field on the source object 4', function () {
var o = [ { a: [ { b: { c: 1 } }, { b: { c: 2 } } ] }, { a: [ { b: { c: 3 } } ] } ]
, t = trans(o).mapff(null, 'a.b.d', 'a', 'length').value();
assert.deepEqual(t, [
{ a: [ { b: { c: 1, d: 2 } }, { b: { c: 2, d: 2 } } ] }
, { a: [ { b: { c: 3, d: 1 } } ] } ]);
});
it('should allow setting a field on the source object 5', function () {
var o = [ { a: [ { b: { c: 1 } }, { b: { c: 2 } } ] }, { a: [ { b: { c: 3 } } ] } ]
, t = trans(o).mapff('a.b', 'a.b.d', function (x) { return x.c + 1; }).value();
assert.deepEqual(t, [
{ a: [ { b: { c: 1, d: 2 } }, { b: { c: 2, d: 3 } } ] }
, { a: [ { b: { c: 3, d: 4 } } ] } ]);
});
it('should allow setting a field on the source object 6', function () {
var o = { a: 1, b: 2 }
, t = trans(o).mapff(null, 'c', function (x) { return x.a + x.b; }).value();
assert.deepEqual(t, { a: 1, b: 2, c: 3 });
});
it('should allow setting a field on the source object 7', function () {
var o = [ { b: 1, c: 3 }, { b: 2, c: 3 } ]
, t = trans(o).mapff(null, 'd', function(x) { return x.b + x.c; }).value();
assert.deepEqual(t, [ { b: 1, c: 3, d: 4 }, { b: 2, c: 3, d: 5 } ]);
});
it('should allow setting a field on the source object 8', function () {
var o = { a: [ { b: 1, c: 3 }, { b: 2, c: 3 } ] }
, t = trans(o).mapff('a', 'a.d', function(x) { return x.b + x.c; }).value();
assert.deepEqual(t, { a: [ { b: 1, c: 3, d: 4 }, { b: 2, c: 3, d: 5 } ] });
});
it('should allow setting a field on the source object 9', function () {
var o = { a: [ { b: 1, c: 3 }, { b: 2, c: 3 } ] }
, t = trans(o).mapff('a', 'd', '.', function(x) { return x.b + x.c; }).value();
assert.deepEqual(t, { a: [ { b: 1, c: 3 }, { b: 2, c: 3 } ], d: [ 4, 5 ] });
});
it('should allow setting a field on the source object 10', function () {
var o = { a: [ { b: 1, c: 3 }, { b: 2, c: 3 } ] }
, t = trans(o).mapff(null, 'a.d', function(obj) { return obj.a.length; }).value();
assert.deepEqual(t, { a: [ { b: 1, c: 3, d: 2 }, { b: 2, c: 3, d: 2 } ] });
});
it('should allow setting a field on the source object 11', function () {
var o = { a: [ { b: 1, c: 3 }, { b: 2, c: 3 } ] }
, t = trans(o).mapff(null, 'a.d', 'a', '.', 'b').value();
assert.deepEqual(t, { a: [ { b: 1, c: 3, d: [ 1, 2 ] }, { b: 2, c: 3, d: [ 1, 2 ] } ] });
});
it('should allow setting a field on the source object 12', function () {
var o = [
{ a: [ { b: 1, c: 3 }, { b: 2, c: 3 } ] },
{ a: [ { b: 5, c: 3 }, { b: 7, c: 3 } ] } ]
, t = trans(o).mapff('a', 'a.d', function(x) { return x.b + x.c; }).value();
assert.deepEqual(t, [
{ a: [ { b: 1, c: 3, d: 4 }, { b: 2, c: 3, d: 5 } ] },
{ a: [ { b: 5, c: 3, d: 8 }, { b: 7, c: 3, d: 10 } ] }
]);
});
it('should allow setting a field on the source object - nested arrays', function () {
var o = [
[ { a: { b: 1, c: 10 } }, { a: { b: 2, c: 20 } } ]
, [ { a: { b: 3, c: 30 } } ] ]
, t = trans(o).mapff('a', 'a.e', function (x) { return x.b + x.c; }).value();
assert.deepEqual(t, [
[ { a: { b: 1, c: 10, e: 11 } }, { a: { b: 2, c: 20, e: 22 } } ]
, [ { a: { b: 3, c: 30, e: 33 } } ]
]);
});
it('should fail when the destination field is not on an object', function () {
assert.throws(function () {
trans({ a: { b: 1 }, c: { d: 1 } }).mapff('a.b', 'c.d.e');
}, Error);
});
});
};
| javascript |
With the funds allotted to the police department by the government for investigation of cases remaining underutilised, Director General of Police (DGP) VK Bhawra has written to the senior officials to appoint a nodal officer to ensure that the money is used properly and conduct random checks as to where the investigation officers are arranging money from.
In a letter to Commissioner of police and Senior Superintendents of Police (SSPs) on Thursday, Bhawra asked them to appoint a nodal officer of superintendent of police or deputy superintendent of police rank so that the funds would be utilised properly.
The district police heads have also been asked to hold seminars for the investigation officers to make them aware about the funds and the way to utilise it. They have also been asked to check random cases to find out from where the investigation officer had arranged the money.
The police department issues ₹ 5 crore per year to the police stations as expenditure for investigating the cases and stationery. In 2020-2021, the police department spent only ₹ 1. 90 crore, which is only 38% of the allotted funds and the rest of the money lapsed. In 2021-2022, the police used ₹ 4. 18 (83. 6%) crore out of the allotted money.
In the fiscal year 2022-2023, the government has already issued ₹ 1. 22 crore as first instalment for the first quarter of the year.
According to the police personnel, the department issues them ₹ 3,000 per case that includes reply of the writ petitions, court fees of the cases, DNA-Narco test, removal of dead bodies and other tasks, which is insufficient. In case of filing one reply, the advocates charge ₹ 3,000 to 5,000.
An SHO, on the condition of anonymity, said that only one official vehicle of the police station, which is used by the SHO, gets fuel from the department, while they have to arrange fuel on their own for other vehicles used for duty. Moreover, in case of conducting raids in other states, they have to manage the expenditure on their own.
The police personnel also said that claiming the funds is a tiring and lengthy procedure, so they merely go for it. On an average, the Ludhiana police lodge 7,500 FIRs every year, which means nearly 45% of the total funds is required in Ludhiana police commissionerate only. | english |
package io.sentry;
import io.sentry.util.Objects;
import java.util.Random;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.TestOnly;
final class TracingSampler {
private final @NotNull SentryOptions options;
private final @NotNull Random random;
public TracingSampler(final @NotNull SentryOptions options) {
this(Objects.requireNonNull(options, "options are required"), new Random());
}
@TestOnly
TracingSampler(final @NotNull SentryOptions options, final @NotNull Random random) {
this.options = options;
this.random = random;
}
boolean sample(final @Nullable SamplingContext samplingContext) {
if (samplingContext != null && samplingContext.getTransactionContexts().getSampled() != null) {
return samplingContext.getTransactionContexts().getSampled();
} else if (samplingContext != null && options.getTracesSampler() != null) {
return sample(options.getTracesSampler().sample(samplingContext));
} else if (samplingContext != null
&& samplingContext.getTransactionContexts().getParentSampled() != null) {
return samplingContext.getTransactionContexts().getParentSampled();
} else if (options.getTracesSampleRate() != null) {
return sample(options.getTracesSampleRate());
} else {
return false;
}
}
private boolean sample(final @NotNull Double aDouble) {
return !(aDouble < random.nextDouble());
}
}
| java |
GUWAHATI, June 13: A sensitization programme on the Rights of Persons with Disabilities Act, 2016 was organized by the Assam State Legal Services Authority in collaboration with Shishu Sarothi at Guwahati on Wednesday for members of the Juvenile Justice Board, Child Welfare Committee, Protection Officers (Institutional and Non-institutional Care), and Secretaries of District Legal Services Authorities from five districts – Kamrup, Nalbari, Darrang, Morigaon and Nagaon. The programme was also participated by Inspectors of Police, CID, Assam, Special Educator from NIPCCD and a counselor from Childline, officials from ASLSA, Social Welfare and Assam State Child Protection Society, a press release said.
In his inaugural speech, ASLSA member secretary SN Sarma highlighted the importance of upholding rights of persons with disabilities as envisaged under the law if one has to ensure that no one is left behind in the process of development. SS Meenakshi Sundaram, Secretary, Social Welfare who graced the occasion as the chief guest, emphasized the importance of government functionaries being aware of the rights of persons with disabilities and the corresponding accountability of duty bearers to ensure those rights. Sharing that he was glad to attend the day’s programme and learn disability rights, he also underlined the fact that the new disability law only lays down the basic minimum that is mandated for disabled people and nothing stops the government from providing for more.
The programme made an endeavour to create awareness amongst the stakeholders concerned on rights of persons with disabilities and more specifically, on the rights of children with disabilities. | english |
<reponame>michelcareau/DSpace<gh_stars>100-1000
/**
* The contents of this file are subject to the license and copyright
* detailed in the LICENSE and NOTICE files at the root of the source
* tree and available online at
*
* http://www.dspace.org/license/
*/
package org.dspace.content;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.MatcherAssert.assertThat;
import java.util.List;
import org.dspace.builder.CollectionBuilder;
import org.dspace.builder.CommunityBuilder;
import org.dspace.builder.EntityTypeBuilder;
import org.dspace.builder.ItemBuilder;
import org.dspace.builder.RelationshipBuilder;
import org.dspace.builder.RelationshipTypeBuilder;
import org.junit.Test;
/**
* This class carries out the same test cases as {@link RelationshipMetadataServiceIT} with a few modifications.
*/
public class RightTiltedRelationshipMetadataServiceIT extends RelationshipMetadataServiceIT {
/**
* Similar to the parent implementation, but set the tilted property of isIssueOfVolume.
*/
@Override
protected void initJournalVolumeIssue() throws Exception {
context.turnOffAuthorisationSystem();
Community community = CommunityBuilder.createCommunity(context).build();
Collection col = CollectionBuilder.createCollection(context, community)
.withEntityType("JournalIssue")
.build();
Collection col2 = CollectionBuilder.createCollection(context, community)
.withEntityType("JournalVolume")
.build();
EntityType journalIssueEntityType = EntityTypeBuilder.createEntityTypeBuilder(context, "JournalIssue").build();
EntityType publicationVolumeEntityType =
EntityTypeBuilder.createEntityTypeBuilder(context, "JournalVolume").build();
leftItem = ItemBuilder.createItem(context, col)
.withPublicationIssueNumber("2").build();
rightItem = ItemBuilder.createItem(context, col2)
.withPublicationVolumeNumber("30").build();
RelationshipType isIssueOfVolume =
RelationshipTypeBuilder
.createRelationshipTypeBuilder(context, journalIssueEntityType, publicationVolumeEntityType,
"isJournalVolumeOfIssue", "isIssueOfJournalVolume",
null, null, null, null).build();
isIssueOfVolume.setTilted(RelationshipType.Tilted.RIGHT);
relationshipTypeService.update(context, isIssueOfVolume);
relationship =
RelationshipBuilder.createRelationshipBuilder(context, leftItem, rightItem, isIssueOfVolume).build();
context.restoreAuthSystemState();
}
@Test
@Override
public void testGetJournalRelationshipMetadata() throws Exception {
initJournalVolumeIssue();
//leftItem is the journal issue item
//verify the publicationvolume.volumeNumber virtual metadata
List<MetadataValue> volumeList =
itemService.getMetadata(leftItem, "publicationvolume", "volumeNumber", null, Item.ANY);
assertThat(volumeList.size(), equalTo(0));
//rightItem is the journal volume item
//verify the publicationissue.issueNumber virtual metadata
List<MetadataValue> issueList =
itemService.getMetadata(rightItem, "publicationissue", "issueNumber", null, Item.ANY);
assertThat(issueList.size(), equalTo(1));
assertThat(issueList.get(0).getValue(), equalTo("2"));
//request the virtual metadata of the journal issue
List<RelationshipMetadataValue> issueRelList =
relationshipMetadataService.getRelationshipMetadata(leftItem, true);
assertThat(issueRelList.size(), equalTo(0));
//request the virtual metadata of the journal volume
List<RelationshipMetadataValue> volumeRelList =
relationshipMetadataService.getRelationshipMetadata(rightItem, true);
assertThat(volumeRelList.size(), equalTo(2));
assertThat(volumeRelList.get(0).getValue(), equalTo("2"));
assertThat(volumeRelList.get(0).getMetadataField().getMetadataSchema().getName(), equalTo("publicationissue"));
assertThat(volumeRelList.get(0).getMetadataField().getElement(), equalTo("issueNumber"));
assertThat(volumeRelList.get(0).getMetadataField().getQualifier(), equalTo(null));
assertThat(volumeRelList.get(0).getAuthority(), equalTo("virtual::" + relationship.getID()));
assertThat(volumeRelList.get(1).getValue(), equalTo(String.valueOf(leftItem.getID())));
assertThat(volumeRelList.get(1).getMetadataField().getMetadataSchema().getName(),
equalTo(MetadataSchemaEnum.RELATION.getName()));
assertThat(volumeRelList.get(1).getMetadataField().getElement(), equalTo("isIssueOfJournalVolume"));
assertThat(volumeRelList.get(1).getAuthority(), equalTo("virtual::" + relationship.getID()));
}
}
| java |
pub use self::imp::*;
#[cfg(all(
regex_runtime_teddy_avx2,
target_arch = "x86_64",
))]
mod imp;
#[cfg(not(all(
regex_runtime_teddy_avx2,
target_arch = "x86_64",
)))]
#[path = "fallback.rs"]
mod imp;
| rust |
<gh_stars>1-10
import { createReducer, on } from '@ngrx/store';
import {
ProductCategoryAddModalActions,
ProductCategoryDeleteModalActions,
ProductCategoryListViewActions,
ProductCategoryApiActions
} from '@app/product-category/state/actions';
export interface State {
ids: number[];
loading: boolean;
loaded: boolean;
deleting: boolean;
deleted: boolean;
adding: boolean;
added: boolean;
}
export const INITIAL_STATE: State = {
ids: [],
adding: false,
added: false,
deleting: false,
deleted: false,
loading: false,
loaded: false
};
export const reducer = createReducer(
INITIAL_STATE,
on(ProductCategoryListViewActions.loadProductCategories, state => ({
...state,
loading: true,
loaded: false
})),
on(ProductCategoryApiActions.loadProductCategorySuccess, (state, { productCategories }) => ({
...state,
loading: false,
loaded: true,
ids: productCategories.result
})),
on(ProductCategoryApiActions.loadProductCategoryFailure, state => ({
...state,
loading: false,
loaded: false
})),
on(ProductCategoryAddModalActions.addProductCategory, state => ({
...state,
adding: true,
added: false
})),
on(ProductCategoryApiActions.addProductCategorySuccess, (state, { productCategory }) => ({
...state,
ids: [...state.ids, productCategory.result],
adding: false,
added: true
})),
on(
ProductCategoryApiActions.addProductCategoryFailure,
ProductCategoryListViewActions.showAddProductCategoryModal,
state => ({
...state,
adding: false,
added: false
})
),
on(ProductCategoryDeleteModalActions.deleteProductCategory, state => ({
...state,
deleting: true,
deleted: false
})),
on(ProductCategoryApiActions.deleteProductCategorySuccess, (state, { id }) => ({
...state,
ids: state.ids.filter(productCategoryId => productCategoryId !== id),
deleting: false,
deleted: true
})),
on(
ProductCategoryApiActions.deleteProductCategoryFailure,
ProductCategoryListViewActions.showDeleteProductCategoryModal,
state => ({
...state,
deleting: false,
deleted: false
})
)
);
export const getIds = (state: State) => state.ids;
export const getDeleting = (state: State) => state.deleting;
export const getDeleted = (state: State) => state.deleted;
export const getAdding = (state: State) => state.adding;
export const getAdded = (state: State) => state.added;
export const getLoading = (state: State) => state.loading;
export const getLoaded = (state: State) => state.loaded;
| typescript |
<filename>src/main/java/com/serverworld/worldSocket/paperspigot/events/MessagecomingEvent.java
package com.serverworld.worldSocket.paperspigot.events;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.json.JSONObject;
public class MessagecomingEvent extends Event{
private static final HandlerList HANDLERS = new HandlerList();
final String msg;
private String sender;
private String receiver;
private String type;
private String channel;
private String message;
public HandlerList getHandlers() {
return HANDLERS;
}
public static HandlerList getHandlerList() {
return HANDLERS;
}
public MessagecomingEvent(String msg) {
this.msg = msg;
JsonParser jsonParser = new JsonParser();
JsonObject jsonmsg = jsonParser.parse(msg).getAsJsonObject();
JSONObject json = new JSONObject(msg);
sender = json.getString("sender");
receiver = json.getString("receiver");
type = json.getString("type");
channel = json.getString("channel");
message = json.getString("message");
}
public String getSender() {
return this.sender;
}
public String getReceiver() {
return receiver;
}
public String getType() {
return type;
}
public String getChannel() {
return channel;
}
public String getMessage() {
return message;
}
}
| java |
{
"name": "<NAME>",
"area": "Playa Nazuchi",
"description": "En el antiguo idioma de los habitantes primigenios de Inazuma, “nazuchi” significa “cuidado con delicadeza por la mano de los dioses”. Resulta irónico, entonces, que la Playa Nazuchi haya sido devastada por la guerra desde hace miles de años y que se haya convertido en un nido de piratas y ladrones.",
"region": "Inazuma",
"sortorder": 208
} | json |
<reponame>CanadaHonk/smartcord<gh_stars>1-10
// AuthorID: 707309693449535599
const Plugin = require("../plugin");
module.exports = new Plugin({
name: "UwU" /* Human-readable plugin name. */,
author:
"Armagan#4869 & smartfridge#5834" /* [Optional] Put your name here to give yourself credit for making it :) */,
description:
"changes discord to be more OwO" /* Description of what this plugin does. */,
preload: false /* [Optional] If true, load this before Discord has finished starting up */,
color:
"#666" /* [Optional] The color that this plugin shows in logs and in the plugin settings tab. Any valid CSS color will work here. */,
disabledByDefault: true /* [Optional] If true, disable the plugin until the user enables it in settings */,
load: function () {
/* What your plugin does when Discord is loaded, or when the plugin is reloaded. */
kaomoji = [
"(*^ω^)",
"(◕‿◕✿)",
"(◕ᴥ◕)",
"ʕ•ᴥ•ʔ",
"ʕ→ᴥ←ʔ",
"(*^.^*)",
"owo",
"OwO",
"(。♥‿♥。)",
"uwu",
"UwU",
"(* ̄з ̄)",
">w<",
"^w^",
"(つ✧ω✧)つ",
"(/ =ω=)/",
];
messages = EDApi.findModule("Messages").Messages;
Object.entries(messages).forEach(([k, v]) => {
if (typeof v === "string") {
messages[k] = v
.replace(/(?:l|r)/g, "w")
.replace(/(?:L|R)/g, "W")
.replace(/n([aeiou])/g, "ny$1")
.replace(/N([aeiou])|N([AEIOU])/g, "Ny$1")
.replace(/ove/g, "uv")
.replace(/in/g, "w")
.replace(/IN/g, "W")
.replace(/nd(?= |$)/g, "ndo")
.replace(
/!+/g,
` ${kaomoji[Math.floor(Math.random() * kaomoji.length)]}`
)
.replace(/TY/g, `TWY`)
.replace(/ty/g, `twy`);
}
});
},
unload: function () {
/* What your plugin does when it is disabled or being reloaded. */
},
});
| javascript |
It's fvckin awesome. Leaves Arrow way behind. If Guardians Of The Galaxy was the space opera superhero film, and Captain America 2 was the political thriller superhero film, this is basically the ugly noir superhero film that happens to run for ten hours or so and is split into multiple parts. And it's beautiful man, dark and violent (like, even by normal standards, let alone Marvel Cinematic Universe ones. Some crazy **** already) and coasts along coherently and smoothly. If you're okay with a bit of a slow burn in between the fun, you'll love it.
And, like, the fights just have this weight and sluggishness to them that makes you feel as exhausted as Murdock is just by watching, which is neat. It's like watching the Bourne Trilogy all over again. Really adds to the atmosphere. Performances great all 'round, especially Cox, Dawson and Woll and especially when they're all beat to ****.
Binge it. I promise you won't regret it.
PPS: Maybe a Daredevil TV thread after more people watch it??
| english |
The government on Wednesday slashed the newly-introduced windfall tax on petrol, diesel, aviation fuel, and crude oil following global oil price ease from a sharp spike.
The move, which is effective from July 20, will give relief to top fuel exporters like Reliance Industries, and oil explorers like Oil and Natural Gas Corporation (ONGC).
The Centre has scrapped a Rs 6 per litre tax on the export of petrol completely and reduced the same on aviation turbine fuel (ATF) to Rs 4 a litre from Rs 6 per litre. Besides, the tax on diesel has been reduced to Rs 11 from Rs 13 per litre, according to a government notification. Further, tax on domestically-produced crude has been cut by 27 per cent to Rs 17,000 per tonne.
A windfall tax is a one-off tax levied on companies deemed to have made unreasonably high profits, normally due to unusually favourable market factors.
TO READ THE FULL STORY, SUBSCRIBE NOW NOW AT JUST RS 249 A MONTH.
What you get on Business Standard Premium?
- Unlock 30+ premium stories daily hand-picked by our editors, across devices on browser and app.
- Pick your 5 favourite companies, get a daily email with all news updates on them.
- Full access to our intuitive epaper - clip, save, share articles from any device; newspaper archives from 2006.
- Preferential invites to Business Standard events.
- Curated newsletters on markets, personal finance, policy & politics, start-ups, technology, and more. | english |
Mumbai: The Bombay High Court on Thursday stayed proceedings against Dr. Rustom Soonawala in a four year old rape case against him. Justice A M Badar admitted a petition filed by the 50-year-old doctor to quash the case. The judge observed he had made out an arguable case on facts to question the FIR lodged by a patient with Khar police in May 2013.
Dr Soonawala’s counsel Aabad Ponda cited the American Academy of Forensic Sciences to argue his case that the doctor was “framed”.
A study by the Academy states that DNA can be found not only within three-four days after coitus but also within seven days post-coitus using enhanced methods of detection. Justice Badar referred and relied on the American study and also on an expert medical paper cited by Ponda which shows that “in the absence of the discharge of semen, male epithelial cells can be found in vaginal swabs.” Justice Badar did not observe in this case, neither sperm cell nor male epithelial cells were found.
After a session’s court initially rejected his plea, the HC granted Dr Soonawala pre-arrest bail in May 2013, a relief which even the Supreme Court upheld as a rare order in a rape case. The woman patient had alleged that the doctor raped her in his Khar clinic while her husband and a female attendant waited outside the examination room. Police said her vaginal swab was taken and medical examination done.
The doctor moved the HC last April to quash the FIR. His counsel Ponda even if the doctor had touched her at least epithelial cells would have been found. He stressed the doctor was framed as he was fighting the “hawker menace” for a decade. He said the doctor offered to give his samples for testing soon after the FIR but police initially refused to take them. Ponda said forensic reports later showed there was “no male DNA” found on her person. He said the victim kept changing her account of what happened.
Advocate Vijay Hiremath appearing for the complainant, opposed the doctor’s plea. He said the court can’t disbelieve the FIR at this stage. The prosecutor too said the doctor’s plea is dismissed. But the HC said though a “roving inquiry” cannot be made at this stage nor can the evidence be appreciated to find out if case is true or false, Ponda had made out an arguable case to admit the petition to find out whether the case amounts to an abuse of process of court.
The HC will hear his quashing plea after the vacation.
| english |
{
"id": "sidePaneViewsActivateCallsApp1",
"name": "sidePaneViewsActivateCallsApp1",
"loaderConfig": {
"paths": {
"sidePaneViewsActivateCallsApp1": "./dapp/tests/unit/sidePaneViewsActivateCalls"
}
},
"modules": [
],
"controllers": [
"dapp/controllers/delite/Init",
"dapp/controllers/Logger",
"dapp/controllers/delite/Load",
"dapp/controllers/delite/Transition",
"dapp/controllers/History"
],
"dependencies": [
"deliteful/LinearLayout",
"deliteful/ViewStack",
"deliteful/SidePane"
],
"appLogging": {
"logAll": 0
},
"parseOnLoad": true,
"alwaysUseDefaultView" : true, // ignore any url hash when starting the app
"defaultView": "sp1header1+sp1centerParent+sp1center1+sp1right1+sp1footer1",
"views": {
"sp1header1": {
"parentSelector": "#sp1headerViewStack",
"controller": "sidePaneViewsActivateCallsApp1/headerController1.js",
"template": "sidePaneViewsActivateCallsApp1/headerTemplate1.html"
},
"sp1leftParent": {
"parentSelector": "#sp1leftPane",
"controller": "sidePaneViewsActivateCallsApp1/parentController1.js",
"template": "sidePaneViewsActivateCallsApp1/leftSubParentTemplate.html",
"defaultView": "left1",
"views": {
"sp1left1": {
"parentSelector": "#sp1leftViewStack",
"controller": "sidePaneViewsActivateCallsApp1/leftController1.js",
"template": "sidePaneViewsActivateCallsApp1/leftTemplate1.html"
},
"sp1left2": {
"parentSelector": "#sp1leftViewStack",
"controller": "sidePaneViewsActivateCallsApp1/leftController1.js",
"template": "sidePaneViewsActivateCallsApp1/leftTemplate1.html"
}
}
},
"sp1centerParent": {
"loadViewsInOrder": true,
"parentSelector": "#sp1centerLinearLayout",
"controller": "sidePaneViewsActivateCallsApp1/parentController1.js",
"template": "sidePaneViewsActivateCallsApp1/subParentTemplate.html"
},
"sp1center1": {
"parentSelector": "#sp1centerViewStack",
"controller": "sidePaneViewsActivateCallsApp1/centerController1.js",
"template": "sidePaneViewsActivateCallsApp1/centerTemplate1.html"
},
"sp1right1": {
"parentSelector": "#sp1rightPane",
"controller": "sidePaneViewsActivateCallsApp1/rightController1.js",
"template": "sidePaneViewsActivateCallsApp1/rightTemplate1.html"
},
"sp1right2": {
"parentSelector": "#sp1rightPane",
"controller": "sidePaneViewsActivateCallsApp1/rightController1.js",
"template": "sidePaneViewsActivateCallsApp1/rightTemplate1.html"
},
"sp1footer1": {
"parentSelector": "#sp1footerViewStack",
"controller": "sidePaneViewsActivateCallsApp1/footerController1.js",
"template": "sidePaneViewsActivateCallsApp1/footerTemplate1.html"
}
}
}
| json |
{
"extends": ["tslint:latest", "tslint-config-prettier"],
"rules": {
"no-console": false,
"no-unused-variable": true,
"no-var-requires": false,
// dumb rules, that shouldn't exist. just why...
"ordered-imports": false,
"object-literal-sort-keys": false
}
}
| json |
116/7 (17. 0 ov)
119/4 (16. 1 ov)
172/7 (20. 0 ov)
157 (20. 0 ov)
The 31-year-old stole limelight during the quarter-final stage of prestigious 50-over tournament when he bowled one of the most memorable ferocious spells.
The Steven Smith-led side are coming off a terrible series against South Africa wherein they lost the three-match series 1-2.
Neither attacking nor defensive, that's Misbah-ul-Haq brand of cricket. He doesn't go for the kill right away. You realise it only when it is too late to save yourself.
Ravichandran Ashwin routed England with 6 for 112 and 6 for 55 at Wankhede Stadium in Mumbai in the ongoing series, dishing out an innings defeat for the tourists.
Sid O’Linn made his debut during the South African Test tour of England in 1960, after a season in which he scored 619 runs at 68. 78 for Transvaal.
November 2013, Mitchell Johnson not only dismantled the England batting but also inflicted severe psychological blow to the side that needed a shake up to find its feet from the 0-5 nightmare. 3 years later, Alastair Cook's men found themselves in the Indian shores and in a similar situation.
CA and the England and WCB have confirmed the 2017-18 Men’s Ashes Test schedule, along with the five England One-Day Internationals (ODIs) scheduled for January, following the Test Series.
Having lost the series, there has been a lot of criticism coming along the England's way and more prominently skipper Alastair Cook's way. But amidst all the defeat's, there is something which can't be overlooked about Cook, because it is Alastair Cook! | english |
Andy Murray has expressed his sadness that Wimbledon has been cancelled but says health and safety must be the priority amid the coronavirus crisis.
The All England Lawn Tennis Club on Wednesday confirmed that the grass-court grand slam, which was due to start on June 29, will not go ahead for the first time since World War II.
That announcement had been expected due to the spread of COVID-19, which has killed more than 46,000 people worldwide.
Murray, a two-time winner of his home major in London, had hoped to make his latest return from a hip injury in Miami last month but it remains to be seen when he will make another competitive comeback.
The former world number one is naturally disappointed he will not play at SW19 and Queen's Club this year, yet he knows organisers had no alternative.
He posted on Facebook: "Very sad that the Fever-Tree Championships and Wimbledon have been cancelled this year but with all that is going on in the world right now, everyone's health is definitely the most important thing!
"Looking forward to getting back out on the grass next year already! Hope everyone is staying safe and healthy. #StayHomeSaveLives."
The ATP and WTA announced the suspension of their tours had been extended until July 13, but US Open organisers say the tournament will go ahead as scheduled as it stands.
| english |
#include "CharacterBase.h"
// Sets default values
ACharacterBase::ACharacterBase(const class FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
// Set this character to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
}
// Called when the game starts or when spawned
void ACharacterBase::BeginPlay()
{
Super::BeginPlay();
Life = MaxLife;
}
float ACharacterBase::GetCurrentLife()
{
return Life;
}
void ACharacterBase::UpdateLife(float lifeChange)
{
Life += lifeChange;
if (Life > MaxLife)
{
Life = MaxLife;
}
}
//________________________________________________________________________
// Called every frame
void ACharacterBase::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
}
//// Called to bind functionality to input
//void ACharacterBase::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
//{
// Super::SetupPlayerInputComponent(PlayerInputComponent);
//
//}
| cpp |
<filename>legocms-parent/legocms-core/src/main/java/com/legocms/core/dto/sys/SysPermissionDetailInfo.java
package com.legocms.core.dto.sys;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import com.legocms.core.dto.TypeInfo;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class SysPermissionDetailInfo extends SysPermissionInfo {
private static final long serialVersionUID = -6394862700783489411L;
private int sort;
private boolean menu;
private Date createTime;
private TypeInfo parent = new TypeInfo();
private List<TypeInfo> lang = new ArrayList<TypeInfo>();
public void addLang(TypeInfo info) {
lang.add(info);
}
}
| java |
<reponame>synergynet/synergyview
/**
* File: IntervalAnnotation.java Copyright (c) 2010 phyokyaw This program is
* free software; you can redistribute it and/or modify it under the terms of
* the GNU General Public License as published by the Free Software Foundation;
* either version 2 of the License, or (at your option) any later version. This
* program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU General Public License for more details.
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc., 59 Temple
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
package synergyviewcore.annotations.model;
import javax.persistence.Entity;
import synergyviewcore.util.DateTimeHelper;
/**
* The Class IntervalAnnotation.
*
* @author phyokyaw
*/
@Entity
public class IntervalAnnotation extends Annotation {
/** The Constant PROP_DURATION. */
public static final String PROP_DURATION = "duration";
/** The duration. */
private long duration;
/**
* Gets the duration.
*
* @return the duration
*/
public long getDuration() {
return duration;
}
/**
* Gets the formatted duration.
*
* @return the formatted duration
*/
public String getFormattedDuration() {
return DateTimeHelper.getHMSFromMilliFormatted(duration);
}
/**
* Sets the duration.
*
* @param duration
* the duration to set
*/
public void setDuration(long duration) {
this.firePropertyChange(PROP_DURATION, this.duration, this.duration = duration);
}
}
| java |
//! This module implements the global `Symbol` object.
//!
//! The data type symbol is a primitive data type.
//! The `Symbol()` function returns a value of type symbol, has static properties that expose
//! several members of built-in objects, has static methods that expose the global symbol registry,
//! and resembles a built-in object class, but is incomplete as a constructor because it does not
//! support the syntax "`new Symbol()`".
//!
//! Every symbol value returned from `Symbol()` is unique.
//!
//! More information:
//! - [MDN documentation][mdn]
//! - [ECMAScript reference][spec]
//!
//! [spec]: https://tc39.es/ecma262/#sec-symbol-value
//! [mdn]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol
#[cfg(test)]
mod tests;
use crate::{
builtins::BuiltIn,
gc::{Finalize, Trace},
object::ConstructorBuilder,
property::Attribute,
value::{RcString, RcSymbol, Value},
BoaProfiler, Context, Result,
};
/// A structure that contains the JavaScript well known symbols.
#[derive(Debug, Clone)]
pub struct WellKnownSymbols {
async_iterator: RcSymbol,
has_instance: RcSymbol,
is_concat_spreadable: RcSymbol,
iterator: RcSymbol,
match_: RcSymbol,
match_all: RcSymbol,
replace: RcSymbol,
search: RcSymbol,
species: RcSymbol,
split: RcSymbol,
to_primitive: RcSymbol,
to_string_tag: RcSymbol,
unscopables: RcSymbol,
}
impl WellKnownSymbols {
pub(crate) fn new() -> (Self, u64) {
let mut count = 0;
let async_iterator = Symbol::new(count, Some("Symbol.asyncIterator".into())).into();
count += 1;
let has_instance = Symbol::new(count, Some("Symbol.hasInstance".into())).into();
count += 1;
let is_concat_spreadable =
Symbol::new(count, Some("Symbol.isConcatSpreadable".into())).into();
count += 1;
let iterator = Symbol::new(count, Some("Symbol.iterator".into())).into();
count += 1;
let match_ = Symbol::new(count, Some("Symbol.match".into())).into();
count += 1;
let match_all = Symbol::new(count, Some("Symbol.matchAll".into())).into();
count += 1;
let replace = Symbol::new(count, Some("Symbol.replace".into())).into();
count += 1;
let search = Symbol::new(count, Some("Symbol.search".into())).into();
count += 1;
let species = Symbol::new(count, Some("Symbol.species".into())).into();
count += 1;
let split = Symbol::new(count, Some("Symbol.split".into())).into();
count += 1;
let to_primitive = Symbol::new(count, Some("Symbol.toPrimitive".into())).into();
count += 1;
let to_string_tag = Symbol::new(count, Some("Symbol.toStringTag".into())).into();
count += 1;
let unscopables = Symbol::new(count, Some("Symbol.unscopables".into())).into();
count += 1;
(
Self {
async_iterator,
has_instance,
is_concat_spreadable,
iterator,
match_,
match_all,
replace,
search,
species,
split,
to_primitive,
to_string_tag,
unscopables,
},
count,
)
}
/// The `Symbol.asyncIterator` well known symbol.
///
/// A method that returns the default AsyncIterator for an object.
/// Called by the semantics of the `for-await-of` statement.
#[inline]
pub fn async_iterator_symbol(&self) -> RcSymbol {
self.async_iterator.clone()
}
/// The `Symbol.hasInstance` well known symbol.
///
/// A method that determines if a `constructor` object
/// recognizes an object as one of the `constructor`'s instances.
/// Called by the semantics of the instanceof operator.
#[inline]
pub fn has_instance_symbol(&self) -> RcSymbol {
self.has_instance.clone()
}
/// The `Symbol.isConcatSpreadable` well known symbol.
///
/// A Boolean valued property that if `true` indicates that
/// an object should be flattened to its array elements
/// by `Array.prototype.concat`.
#[inline]
pub fn is_concat_spreadable_symbol(&self) -> RcSymbol {
self.is_concat_spreadable.clone()
}
/// The `Symbol.iterator` well known symbol.
///
/// A method that returns the default Iterator for an object.
/// Called by the semantics of the `for-of` statement.
#[inline]
pub fn iterator_symbol(&self) -> RcSymbol {
self.iterator.clone()
}
/// The `Symbol.match` well known symbol.
///
/// A regular expression method that matches the regular expression
/// against a string. Called by the `String.prototype.match` method.
#[inline]
pub fn match_symbol(&self) -> RcSymbol {
self.match_.clone()
}
/// The `Symbol.matchAll` well known symbol.
///
/// A regular expression method that returns an iterator, that yields
/// matches of the regular expression against a string.
/// Called by the `String.prototype.matchAll` method.
#[inline]
pub fn match_all_symbol(&self) -> RcSymbol {
self.match_all.clone()
}
/// The `Symbol.replace` well known symbol.
///
/// A regular expression method that replaces matched substrings
/// of a string. Called by the `String.prototype.replace` method.
#[inline]
pub fn replace_symbol(&self) -> RcSymbol {
self.replace.clone()
}
/// The `Symbol.search` well known symbol.
///
/// A regular expression method that returns the index within a
/// string that matches the regular expression.
/// Called by the `String.prototype.search` method.
#[inline]
pub fn search_symbol(&self) -> RcSymbol {
self.search.clone()
}
/// The `Symbol.species` well known symbol.
///
/// A function valued property that is the `constructor` function
/// that is used to create derived objects.
#[inline]
pub fn species_symbol(&self) -> RcSymbol {
self.species.clone()
}
/// The `Symbol.split` well known symbol.
///
/// A regular expression method that splits a string at the indices
/// that match the regular expression.
/// Called by the `String.prototype.split` method.
#[inline]
pub fn split_symbol(&self) -> RcSymbol {
self.split.clone()
}
/// The `Symbol.toPrimitive` well known symbol.
///
/// A method that converts an object to a corresponding primitive value.
/// Called by the `ToPrimitive` (`Value::to_primitve`) abstract operation.
#[inline]
pub fn to_primitive_symbol(&self) -> RcSymbol {
self.to_primitive.clone()
}
/// The `Symbol.toStringTag` well known symbol.
///
/// A String valued property that is used in the creation of the default
/// string description of an object.
/// Accessed by the built-in method `Object.prototype.toString`.
#[inline]
pub fn to_string_tag_symbol(&self) -> RcSymbol {
self.to_string_tag.clone()
}
/// The `Symbol.unscopables` well known symbol.
///
/// An object valued property whose own and inherited property names are property
/// names that are excluded from the `with` environment bindings of the associated object.
#[inline]
pub fn unscopables_symbol(&self) -> RcSymbol {
self.unscopables.clone()
}
}
#[derive(Debug, Finalize, Trace, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct Symbol {
hash: u64,
description: Option<RcString>,
}
impl Symbol {
pub(crate) fn new(hash: u64, description: Option<RcString>) -> Self {
Self { hash, description }
}
}
impl BuiltIn for Symbol {
const NAME: &'static str = "Symbol";
fn attribute() -> Attribute {
Attribute::WRITABLE | Attribute::NON_ENUMERABLE | Attribute::CONFIGURABLE
}
fn init(context: &mut Context) -> (&'static str, Value, Attribute) {
// https://tc39.es/ecma262/#sec-well-known-symbols
let well_known_symbols = context.well_known_symbols();
let symbol_async_iterator = well_known_symbols.async_iterator_symbol();
let symbol_has_instance = well_known_symbols.has_instance_symbol();
let symbol_is_concat_spreadable = well_known_symbols.is_concat_spreadable_symbol();
let symbol_iterator = well_known_symbols.iterator_symbol();
let symbol_match = well_known_symbols.match_symbol();
let symbol_match_all = well_known_symbols.match_all_symbol();
let symbol_replace = well_known_symbols.replace_symbol();
let symbol_search = well_known_symbols.search_symbol();
let symbol_species = well_known_symbols.species_symbol();
let symbol_split = well_known_symbols.split_symbol();
let symbol_to_primitive = well_known_symbols.to_primitive_symbol();
let symbol_to_string_tag = well_known_symbols.to_string_tag_symbol();
let symbol_unscopables = well_known_symbols.unscopables_symbol();
let _timer = BoaProfiler::global().start_event(Self::NAME, "init");
let attribute = Attribute::READONLY | Attribute::NON_ENUMERABLE | Attribute::PERMANENT;
let symbol_object = ConstructorBuilder::with_standard_object(
context,
Self::constructor,
context.standard_objects().symbol_object().clone(),
)
.name(Self::NAME)
.length(Self::LENGTH)
.static_property("asyncIterator", symbol_async_iterator, attribute)
.static_property("hasInstance", symbol_has_instance, attribute)
.static_property("isConcatSpreadable", symbol_is_concat_spreadable, attribute)
.static_property("iterator", symbol_iterator, attribute)
.static_property("match", symbol_match, attribute)
.static_property("matchAll", symbol_match_all, attribute)
.static_property("replace", symbol_replace, attribute)
.static_property("search", symbol_search, attribute)
.static_property("species", symbol_species, attribute)
.static_property("split", symbol_split, attribute)
.static_property("toPrimitive", symbol_to_primitive, attribute)
.static_property("toStringTag", symbol_to_string_tag, attribute)
.static_property("unscopables", symbol_unscopables, attribute)
.method(Self::to_string, "toString", 0)
.callable(true)
.constructable(false)
.build();
(Self::NAME, symbol_object.into(), Self::attribute())
}
}
impl Symbol {
/// The amount of arguments this function object takes.
pub(crate) const LENGTH: usize = 0;
/// Returns the `Symbol`s description.
pub fn description(&self) -> Option<&str> {
self.description.as_deref()
}
/// Returns the `Symbol`s hash.
pub fn hash(&self) -> u64 {
self.hash
}
/// The `Symbol()` constructor returns a value of type symbol.
///
/// It is incomplete as a constructor because it does not support
/// the syntax `new Symbol()` and it is not intended to be subclassed.
///
/// More information:
/// - [ECMAScript reference][spec]
/// - [MDN documentation][mdn]
///
/// [spec]: https://tc39.es/ecma262/#sec-symbol-description
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/Symbol
pub(crate) fn constructor(_: &Value, args: &[Value], ctx: &mut Context) -> Result<Value> {
let description = match args.get(0) {
Some(ref value) if !value.is_undefined() => Some(value.to_string(ctx)?),
_ => None,
};
Ok(ctx.construct_symbol(description).into())
}
fn this_symbol_value(value: &Value, ctx: &mut Context) -> Result<RcSymbol> {
match value {
Value::Symbol(ref symbol) => return Ok(symbol.clone()),
Value::Object(ref object) => {
let object = object.borrow();
if let Some(symbol) = object.as_symbol() {
return Ok(symbol);
}
}
_ => {}
}
Err(ctx.construct_type_error("'this' is not a Symbol"))
}
/// `Symbol.prototype.toString()`
///
/// This method returns a string representing the specified `Symbol` object.
///
/// /// More information:
/// - [MDN documentation][mdn]
/// - [ECMAScript reference][spec]
///
/// [spec]: https://tc39.es/ecma262/#sec-symbol.prototype.tostring
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toString
#[allow(clippy::wrong_self_convention)]
pub(crate) fn to_string(this: &Value, _: &[Value], ctx: &mut Context) -> Result<Value> {
let symbol = Self::this_symbol_value(this, ctx)?;
let description = symbol.description().unwrap_or("");
Ok(Value::from(format!("Symbol({})", description)))
}
}
| rust |
WWE Hall of Famer Edge made his debut in World Championship Wrestling under the ring name Damon Striker. He was in the receiving end of several sqaush matches and lost to several WCW superstars such as Meng and Kevin Sullivan.
He finally got his calling when he was noticed by WWE and signed with the company under his current ring name Edge. He teamed up with Christian and together they won the WWE tag team championship multiple times.
Edge went on to recieve a big push as a singles competitor and won the WWE Championship four times and the World Heavyweight Championship seven times. He went from a jobber in WCW to a main eventer in WWE. | english |
<filename>src/components/container.js<gh_stars>0
/* global tw */
import styled from 'react-emotion'
export const Container = styled('div')`
${tw(['flex', 'flex-col', 'items-center'])};
`
export const AbsoluteContainer = styled('div')`
${tw(['absolute', 'flex', 'items-center', 'justify-center', 'pin'])};
`
| javascript |
Raghavendra Lawrence, the actor-choreographer-director, has decided to take a break from direction. Instead, he will focus on acting. His immediate venture, if sources are to be believed, will be the Tamil remake of Telugu hit 'Pataas'.
"Lawrence decided to shift focus to acting since it takes so much time to direct a movie. So, after playing the lead role in a few films, he will wield the megaphone again," sources said.
The Tamil version of 'Pataas' will be produced by R B Chaudhary's Super Good Films and it will be directed by a leading filmmaker. In the meantime, Lawrence is also ready with a few scripts.
Follow us on Google News and stay updated with the latest!
| english |
<filename>test/e2e/helpers/application-helpers.ts
// Copyright 2020 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.
import type * as puppeteer from 'puppeteer';
import {$, $$, click, getBrowserAndPages, goToResource, waitFor, waitForFunction} from '../../shared/helper.js';
export async function navigateToApplicationTab(target: puppeteer.Page, testName: string) {
await goToResource(`application/${testName}.html`);
await click('#tab-resources');
// Make sure the application navigation list is shown
await waitFor('.storage-group-list-item');
}
export async function navigateToServiceWorkers() {
const SERVICE_WORKER_ROW_SELECTOR = '[aria-label="Service Workers"]';
await click(SERVICE_WORKER_ROW_SELECTOR);
}
export async function doubleClickSourceTreeItem(selector: string) {
const element = await waitFor(selector);
element.evaluate(el => el.scrollIntoView(true));
await click(selector, {clickOptions: {clickCount: 2}});
}
export async function getDataGridData(selector: string, columns: string[]) {
// Wait for Storage data-grid to show up
await waitFor(selector);
const dataGridNodes = await $$('.data-grid-data-grid-node:not(.creation-node)');
const dataGridRowValues = await Promise.all(dataGridNodes.map(node => node.evaluate((row: Element, columns) => {
const data: {[key: string]: string|null} = {};
for (const column of columns) {
const columnElement = row.querySelector(`.${column}-column`);
data[column] = columnElement ? columnElement.textContent : '';
}
return data;
}, columns)));
return dataGridRowValues;
}
export async function getTrimmedTextContent(selector: string) {
const elements = await $$(selector);
return Promise.all(elements.map(element => element.evaluate(e => {
return (e.textContent || '')
.trim()
.replace(/\n/gm, ' ') // replace new line character with space
.replace(/\s+/gm, ' '); // replace multiple spaces with single space
})));
}
export async function getFrameTreeTitles() {
const treeTitles = await $$('[aria-label="Resources Section"] ~ ol .tree-element-title');
return Promise.all(treeTitles.map(node => node.evaluate(e => e.textContent)));
}
export async function getStorageItemsData(columns: string[]) {
return getDataGridData('.storage-view table', columns);
}
export async function filterStorageItems(filter: string) {
const element = await $('.toolbar-input-prompt') as puppeteer.ElementHandle;
await element.type(filter);
}
export async function clearStorageItemsFilter() {
await click('.toolbar-input .toolbar-input-clear-button');
}
export async function clearStorageItems() {
await waitFor('#storage-items-delete-all');
await click('#storage-items-delete-all');
}
export async function selectCookieByName(name: string) {
const {frontend} = getBrowserAndPages();
await waitFor('.cookies-table');
const cell = await waitForFunction(async () => {
const tmp = await frontend.evaluateHandle(name => {
const result = [...document.querySelectorAll('.cookies-table .name-column')]
.map(c => ({cell: c, textContent: c.textContent || ''}))
.find(({textContent}) => textContent.trim() === name);
return result ? result.cell : undefined;
}, name);
return tmp.asElement() || undefined;
});
await cell.click();
}
export async function waitForQuotaUsage(p: (quota: number) => boolean) {
await waitForFunction(async () => {
const storageRow = await waitFor('.quota-usage-row');
const quotaString = await storageRow.evaluate(el => el.textContent || '');
const [usedQuotaText, modifier] =
quotaString.replace(/^\D*([\d.]+)\D*(kM?)B.used.out.of\D*\d+\D*.?B.*$/, '$1 $2').split(' ');
let usedQuota = Number.parseInt(usedQuotaText, 10);
if (modifier === 'k') {
usedQuota *= 1000;
} else if (modifier === 'M') {
usedQuota *= 1000000;
}
return p(usedQuota);
});
}
export async function getPieChartLegendRows() {
const pieChartLegend = await waitFor('.pie-chart-legend');
const rows = await pieChartLegend.evaluate(legend => {
const rows = [];
for (const tableRow of legend.children) {
const row = [];
for (const cell of tableRow.children) {
row.push(cell.textContent);
}
rows.push(row);
}
return rows;
});
return rows;
}
| typescript |
package com.twizo.controllers.sms;
import com.google.gson.JsonSyntaxException;
import com.twizo.controllers.TwizoController;
import com.twizo.dataaccess.RequestType;
import com.twizo.dataaccess.Worker;
import com.twizo.dataaccess.jsonparams.SmsParams;
import com.twizo.exceptions.SmsException;
import com.twizo.exceptions.TwizoCallException;
import com.twizo.exceptions.TwizoJsonParseException;
import com.twizo.models.Sms;
import com.twizo.models.SmsType;
import com.twizo.services.sms.JsonSmsService;
import com.twizo.services.sms.SmsService;
import javafx.util.Pair;
/**
* This file is part of the Twizo Java API
*
* For the full copyright and licence information, please view the Licence file that was distributed
* with this source code
*
* (c) Twizo - <EMAIL>
*/
public class ApiSmsController extends TwizoController implements SmsController {
private final SmsService smsService;
/**
* Create a new ApiSmsController instance
*
* @param worker Api worker
*/
public ApiSmsController(Worker worker) {
super(worker);
smsService = new JsonSmsService();
}
/**
* Create and sendSimple a new Sms and parse the result to a Sms object
*
* @param params Parameters which will be added to the request
* @param type type of Sms (simple/advanced)
* @return Result of Sms creation
* @throws TwizoCallException when something goes wrong during calling the API
* @throws TwizoJsonParseException when something goes wrong during JSON parsing
* @throws SmsException when something goes wrong during the process
*/
@Override
public Sms[] send(SmsParams params, SmsType type) throws TwizoCallException, TwizoJsonParseException, SmsException {
switch (type) {
case SIMPLE:
return smsService.parseNewSms(
worker.execute("sms/submitsimple", processParams(params), RequestType.POST));
case ADVANCED:
if (params.getDcs() != null && isBinary(params)) {
params.setBody(Integer.decode(params.getBody()).toString().toUpperCase());
}
return smsService
.parseNewSms(
worker.execute("sms/submit", processParams(params), RequestType.POST));
default:
return new Sms[0];
}
}
/**
* Send a simple sms
*
* @param recipient recipient of the sms
* @param body body of the sms
* @param sender sender of the sms
* @return Result of sms creation
* @throws TwizoCallException when something goes wrong during calling the API
* @throws TwizoJsonParseException when something goes wrong during JSON parsing
* @throws SmsException when something goes wrong during the process
*/
@Override
public Sms sendSimple(String recipient, String body, String sender) throws TwizoCallException,
TwizoJsonParseException, SmsException {
SmsParams params = new SmsParams();
params.setBody(body);
params.setSender(sender);
params.setRecipients(new String[]{recipient});
return smsService.parseNewSms(
worker.execute("sms/submitsimple", processParams(params),
RequestType.POST))[0];
}
/**
* Get the status of a Sms and parse it to a Sms object
*
* @param messageId Id of Sms
* @return Result of GET request to get information about a specific sms
* @throws TwizoCallException when something goes wrong during calling the API
* @throws TwizoJsonParseException when something goes wrong during JSON parsing
* @throws SmsException when something goes wrong during the process
*/
@Override
public Sms getStatus(String messageId) throws TwizoCallException, TwizoJsonParseException, SmsException {
return smsService.parseSms(
worker.execute(String.format("sms/submit/%s", messageId), null, RequestType.GET));
}
/**
* Poll results about Sms delivery reports.
*
* @return Array of Sms objects
* @throws TwizoCallException when something goes wrong during calling the API
* @throws TwizoJsonParseException when something goes wrong during JSON parsing
* @throws SmsException when something goes wrong during the process
*/
@Override
public Sms[] getDeliveryReports() throws TwizoCallException, TwizoJsonParseException, SmsException {
Pair<String, Sms[]> result = smsService
.parseDeliveryReports(worker.execute("sms/poll", null, RequestType.GET));
// Delete the delivery reports by using the batchId
worker.execute(String.format("sms/poll/%s", result.getKey()), null,
RequestType.DELETE);
return result.getValue();
}
/**
* This method increases the change parameters added to request are properly formatted
*
* @param params parameters to process
* @return Json string with parameters
* @throws SmsException when something goes wrong during the process
* @throws TwizoJsonParseException when something goes wrong when parsing JSON
*/
private String processParams(SmsParams params) throws SmsException, TwizoJsonParseException {
if (params != null) {
// Check if mandatory parameter value recipients is filled in and matches constraints
if (params.getRecipients() != null || params.getRecipients().length < 1
|| params.getRecipients().length > 1000) {
String[] recipients = params.getRecipients();
for (int i = 0; i < recipients.length; i++) {
if (recipients[i] != null) {
recipients[i] = processPhoneNumber(recipients[i]);
}
}
} else {
throw new SmsException("Recipients doesn't match constraints");
}
try {
return gson.toJson(params);
} catch (JsonSyntaxException ex) {
throw new TwizoJsonParseException(ex);
}
} else {
throw new SmsException("Params can't be null");
}
}
/**
* Check if sms is binary for hexadecimal conversion
*
* @param params Parameter object to be checked
* @return true if binary, false if not
*/
private boolean isBinary(SmsParams params) {
boolean binary = false;
if ((params.getDcs() & 200) == 0) {
binary = (params.getDcs() & 4) > 0;
} else if ((params.getDcs() & 248) == 240) {
binary = (params.getDcs() & 4) > 0;
}
return binary;
}
}
| java |
Do you ever find yourself wondering, “What is Web3?” You’re not alone. The idea is having a moment, whether you’re measuring by VC funding, lobbying blitzes, or incomprehensible corporate announcements. But it can be hard to tell what all the hype is about.
To believers, Web3 represents the next phase of the internet and, perhaps, of organizing society. Web 1.0, the story goes, was the era of decentralized, open protocols, in which most online activity involved navigating to individual static webpages. Web 2.0, which we’re living through now, is the era of centralization, in which a huge share of communication and commerce takes place on closed platforms owned by a handful of super-powerful corporations—think Google, Facebook, Amazon—subject to the nominal control of centralized government regulators. Web3 is supposed to break the world free of that monopolistic control.
At the most basic level, Web3 refers to a decentralized online ecosystem based on the blockchain. Platforms and apps built on Web3 won’t be owned by a central gatekeeper, but rather by users, who will earn their ownership stake by helping to develop and maintain those services.
Gavin Wood coined the term Web3 (originally Web 3.0) in 2014. At the time, he was fresh off of helping develop Ethereum, the cryptocurrency that is second only to Bitcoin in prominence and market size. Today he runs the Web3 Foundation, which supports decentralized technology projects, as well as Parity Technologies, a company focused on building blockchain infrastructure for Web3. Wood, who is based in Switzerland, spoke with me last week over video about where Web 2.0 went wrong, his vision of the future, and why we all need to be less trusting. The following interview is a transcript of our conversation, lightly edited for clarity and length.
WIRED: As I understand it, the idea of Web3 at its most basic level is that the current setup, Web 2.0, is no good. So before we talk about what Web3 would entail, how would you describe the problems with the status quo?
Gavin Wood: I think the model for Web 2.0 was much the same as the model for society before the internet existed. If you go back 500 years, people basically just stuck to their little villages and townships. And they traded with people that they knew. And they relied on, broadly speaking, the social fabric, to ensure that expectations were credible, were likely to actually happen: These apples are not rotten, or this horseshoe doesn’t break after three weeks.
And that works reasonably well, because it’s difficult and very time-consuming and expensive to move between towns. So you have a reasonably high level of credibility that someone is going to stick around and they don't want to be exiled.
But as society moved into something larger-scale, and we have cities and countries and international organizations, we moved on to this weird kind of brand reputation thing. We've created these powerful but regulated bodies, and the regulators, in principle, ensure that our expectations are met. There are certain statutory requirements that, to operate in a particular industry, you must fulfill.
This is not a great solution, for a few reasons. One of them is, it's very hard to regulate new industries. The government is slow, it takes a while to catch up. Another is that regulators are imperfect. And especially when they work closely with the industry, oftentimes there's a bit of a revolving door relationship between the industry and the regulator.
Another is simply a regulatory body has very limited firepower. It's how much money the government puts into it. And so necessarily, regulation is going to be patchy. They will be able to regulate maybe the biggest offenders but they aren’t able to retain a really strong influence all the time everywhere. And of course, the regulators and the laws differ from jurisdiction to jurisdiction. If you go somewhere in the EU, then Activity X is fine; if you go somewhere else, then it’s not fine. And as we become a very international society, this effectively means that your expectations are still not being met.
So we need to move beyond this. But unfortunately, Web 2.0 very much still exists in this very centralized model.
Are we really talking about a failure of technology? Or are we talking about a failure of governance and regulation and competition policy? It sounds like you’re saying: Yes, it’s a failure of regulation, but the answer isn’t better regulation; there needs to be a new layer of technology, because regulatory failures are inevitable. Am I characterizing your view correctly?
Yeah, absolutely. The model is broken.
So let's talk about what should replace it. We've been talking about why Web 2.0 is not working. What's your handy elevator definition of Web3?
What does “less trust” mean?
I have a particular meaning of trust that’s essentially faith. It's the belief that something will happen, that the world will work in a certain way, without any real evidence or rational arguments as to why it will do that. So we want less of that, and we want more truth—which what I really mean is a greater reason to believe that our expectations will be met.
Yes and no. I think trust in itself is actually just a bad thing all around. Trust implies that you are you're placing some sort of authority in somebody else, or in some organization, and they will be able to use this authority in some arbitrary way. As soon as it becomes credible trust, it's not really trust anymore. There is a mechanism, a rationale, an argument, a logical mechanism—whatever— but in my mind, it's not trust.
You've written that Web3 will bust platform monopolies like Google and Facebook. Can you explain how it will do that?
Yeah, I guess the thing is, I don't know if it's going to—I mean, I think it's a logical improvement. And I think in the grander scheme, it’s inevitable. Either it’s inevitable or society’s going down the pan. But in terms of concrete, it’s a much more difficult question to answer.
But, OK. In terms of technology, what do we have? We have cryptography. Cryptography, at its basic level, allows me to talk to my friend but for the communication channel to be public or go through a third party with me still having a good level of expectation, credible expectation, that it will be a private conversation. It will be as private as if we were in a field and chatting to each other and could see there was nobody around.
Just taking encrypted communication as an example, that so far seems very compatible with corporate monopoly. Like, WhatsApp offers encrypted communication. There’s some controversy over the degree to which that is truly satisfying your desire for privacy, but I would still argue that that’s an example of encrypted communication that’s controlled by one of the most powerful companies in the world and has billions of users.
It sounds like open source software would accomplish what you’re talking about, but you’re not just describing open source software. When we talk about Web3, we're talking about the blockchain, which is a completely different way of architecting the internet. So how, technologically, do you achieve this lack of dependence on trust?
I think a degree of truth is necessary. And by this I mean openness, transparency. Blockchain technology uses both cryptography and certain game theory economics to deliver its service. We need to understand the node infrastructure of the network; is it really peer-to-peer or is it actually run from one data center by a company that manufactures and sells hardware and is required to be consulted before a new node can come online? The details make the difference as to whether it's basically just Web 2.0 in disguise or whether it is actually legitimately open, transparent, decentralized, peer-to-peer.
Let's drill down on the idea of “decentralized.” I mean, the internet already is decentralized, right? Internet protocols are not owned by a company. While on a practical level, people tend to route their behavior through gatekeeper platforms, they don't necessarily have to. You don't have to message on Facebook, it's just convenient. So when we talk about centralization and decentralization, what does that mean?
In essence, it means I personally can become a provider or a co-provider of this overall service just as easily as anybody else in the world.
How realistic is that, though? From where I sit, it’s hard to imagine anyone outside of a small subset of people with high technical literacy actually exercising that right to participate in providing the service. And in that scenario, it sounds like you would have a different kind of centralization. Perhaps it would be more than just, you know, a handful of all-powerful CEOs, but it would still be a small subset of people for whom that's a meaningful freedom.
There's a big difference between having a right or a freedom that you could execute if you had bothered educating yourself well enough, and the inability at a very basic and fundamental level of doing something because you lack the inclusion in an exclusive group. If I educate myself well enough on material that is freely available, and that's all that is required to become a co-provider of the service, then that is a free service.
I went to law school, and I could say, look, anybody could learn the law. Anybody could study, get into law school, and then study for the bar. But in fact, at least in the US, it is a guild with very high barriers to entry, most notably cost. Even if the barriers to entry in the legal profession are higher than in programming, that doesn't necessarily mean that the barriers to entry in the world that you come from are not meaningfully high. I understand the distinction you’re drawing, but I wonder if that's sort of a naive—forgive me—reading of social arrangements to think that everybody just kind of has the choice to go become an expert Web3 programmer?
No, of course. In principle, this isn't about being a Web3 programmer. You should be able to enjoy most of the ability to evaluate something without being an in-depth core developer. But there are an awful lot more programmers in the world than there are lawyers. And there's a good reason for that. Programming a machine actually only requires knowledge of a language that is reasonably straightforward to learn. You can be in a random little village in India, that just happens to have an internet point, and you can learn JavaScript in a week. You can't do that with American law.
I’m not going to try and persuade you that literally every person in the world could do this. But the point is that the more people that can do this, the lower the barrier, the better.
This still feels a little abstract. Someone who's reading this might be thinking, “What would I be doing in a Web3 world?” Can you sketch out what that might look like? A certain a certain kind of activity or app interface or transaction?
I think I think the initial breed of Web3 applications will probably be mostly small iterations on Web 2.0 applications. But one thing that Web3 brings that Web 2.0 cannot easily service is financial obligations or economically strong applications. This is where individuals in a peer to peer fashion can have economic services between themselves.
This isn't about sending money per se, but it's about sending things that are or can be credibly rare, or credibly difficult, or credibly expensive in some way. So we can imagine, for example, dating apps where you can send virtual flowers, but we can only send one bunch of virtual flowers per day, regardless of how much you pay. And one could imagine, therefore, that sending a bunch of flowers every day to the same person is a very strong signal that they're into you. And this is a signal that you can’t game—that's the whole point. You can't pay to send more flowers.
I don't mean to be a killjoy, but I feel like Tinder could just add that functionality to Tinder.
They could, right. They sort of do—there’s the star thing that you can only do once per day. But guess what? They're a profit-motivated company. So if you pay Tinder enough, you can just send as many stars as you want.
But won’t companies built on Web3 still have the same market incentives as Web 2.0 companies? I could be missing something obvious, but it's hard to think of technological developments throughout history that didn’t allow for more concentration of political or economic power. So why should we expect this blockchain-based, decentralized Web3 to break the mold?
I've always been into technology, since being a youth. I learned to code when I was like eight years old. I've never seen a technology that existed to limit one’s power. As you've said, every technology that I can think of has served to make the user more powerful. They can do more stuff. They can be richer, they can fulfill the service that they provide faster or better or to more people. Blockchain doesn't do that. It's fundamentally different. It's effectively a social construct. It's a set of rules. And the only thing that these rules have going for themselves is that there is no one with arbitrary power within the system. You can be reasonably certain, especially if you're a coder, then you can you can look at the code and know that it's doing the right thing. But you can also be reasonably certain just on the basis of the fact that so many people have joined the network on the back of this expectation. And if this expectation were not met, they would just leave the network.
A lot of people have gravitated toward crypto because they see it as a way to overthrow the existing political order or the power of central banks. But you've suggested that Web3 will help support the liberal, postwar order. How do you see it doing that?
I think the services and the expectations that we have are under threat because of the centralization of power that the technology allows. It's just a fact. There's not much that has come along before Facebook and Google that allowed that level of power for such few people. It's not that I don’t think Facebook and Google and all the rest of it deserve to be displaced, but that's not exactly the crux of Web3. For me, Web3 is actually much more of a larger sociopolitical movement that is moving away from arbitrary authorities into a much more rationally based liberal model. And this is the only way I can see of safeguarding the liberal world, the life that we have come to enjoy over the last 70 years. It's the only way that we can actually keep it going 70 more years into the future. And at the moment, I think we are very much flirting with quite a different direction.
- 📩 The latest on tech, science, and more: Get our newsletters!
- Why can’t people teleport?
| english |
Jatiya Party's mayoral candidate for Sylhet City Corporation election, Nazrul Islam Babul, has alleged that BCL and Jubo League leaders and activists are booting out agents for the ‘plough’ symbol from various centres.“I have been getting repeated calls from different centres that ‘plough’ agents are being thrown out from centres and not allowed to enter many centres,” he said.
He made the allegation while talking to reporters after casting his vote at Ananda Niketan School in the city at 9:30 am on Wednesday (June 21, 2023).“I have been saying from the beginning that attempts are being made to influence the election. I have come to cast my vote at Ananda Niketan School. Muscle strength is being demonstrated here,” he said.“I just got the news that all the agents of ‘plough’ have been booted from Sylhet Government Pilot High School centre by the goons of Chhatra League and Jubo League. I strongly condemn this. I'm going to the centre right now. I will file a written complaint with the Election Commission,” said the Jatiya Party leader.
Read: Sylhet city polls: Voting peaceful so far"The EVM did not work for an hour in the morning. It could also be part of the plot. The Election Commission, the administration, and the returning officers are all in the pockets of the ‘boat’ candidate,” he added.
Directorate General of Health Services (DGHS) on Monday ordered the closure of all activities of Praava Health Care on allegations of various irregularities.
DGHS Additional Director General (administration) Prof. Nasima Sultana, confirmed the development to UNB.
She said that various allegations have been received against Praava Health Care.
“Later we investigated it and all their activities have been stopped,” she said.
It was learned that DGHS also received several allegations of incorrect Covid-19 sample testing against Praava Health Care.
Praava Health Care is a private organization. Along with telemedicine it provided medical services through a clinic in capital’s Banani. It shot to prominence during the COVID-19 pandemic by offering a service whereby they would pick up the sample for a Covid-19 from the subject's home.
| english |
Paris Saint-Germain (PSG) are leading the Ligue 1 title race after 28 games. Christophe Galtier's men are seven points ahead of second-placed Marseille.
Meanwhile, Inter Milan have entered the race to sign Parisians attacker Lionel Messi. Elsewhere, the Parisians are engaged in talks to sign N'Golo Kante. On that note, here's a look at the key PSG transfer stories as on March 27, 2023:
Inter Milan have entered the race to sign Lionel Messi, according to journalist Sergio A. Gonzalez via Sempre Inter.
The seven-time Ballon d’Or winner is in the final few months of his contract with PSG, but the Parisians are yet to tie him down to an extension. Barcelona and Inter Miami have an interest in the Argentinean and want to secure his services on a Bosman move. The Nerazzurri have reportedly joined the race now.
Messi continues to be at the peak of his powers, as was evident at the 2022 FIFA World Cup in Qatar. The 35-year-old powered his team all the way, finally getting his hands on the Holy Grail of Football. The Parisians remain keen to continue their association with the Argentinean and are working behind the scenes to keep him at the club.
However, taking to Twitter, Gonzalez said that talks are at a standstill in Paris. He added that Javier Zenetti’s presence at Inter could help convince Messi to move to the San Siro.
"Early morning Messi bombshell. A reliable source tells me that Inter intend to sign Leo. Zanetti would be a factor. Contract extension talks are deadlocked in Paris; Barca are restricted by FFP and seemingly on the River Thebes – Will Pupi (Zanetti) manage to get him?” wrote Gonzalez.
Messi has amassed 18 goals and 17 assists in 32 games across competitions this season for PSG.
PSG are still in touch with N’Golo Kante to chalk out a move this summer, according to 90 Min.
The Frenchman is set to become a free agent at the end of the season, but Chelsea are negotiating terms for a new deal. However, the 31-year-old remains free to talk to potential suitors at the moment, and the Parisians are attempting to lure him away from Stamford Bridge. Kante has been a revelation for the Premier League giants, registering 262 appearances, amassing 13 goals and 15 assists.
The Parisians are expected to put extra effort into strengthening their midfield this summer and have set their sights on the Frenchman. However, PSG’s pursuit of the player could end in disappointment, as the 31-year-old is reportedly happy in London and wants to extend his stay with the Blues.
Kylian Mbappe has spoken highly of his compatriot Adrien Rabiot. The Juventus midfielder’s contract expires at the end of the season, and he's likely to leave Turin this summer. A return to PSG could be on the cards, despite the fact that the two parties did not part under the best of circumstances. However, it now appears that the player has earned Mbappe’s seal of approval.
Speaking recently, as cited by Football Italia, Mbappe said that Rabiot has now grown into a calmer player.
He added:
Rabiot could help address a glaring gap in the Parisians’ midfield this summer.
| english |
<filename>packages/xml-views-completion/api.d.ts
import {
XMLAttribute,
XMLElement,
XMLDocument,
XMLAstNode,
} from "@xml-tools/ast";
import { DocumentCstNode } from "@xml-tools/parser";
import { IToken } from "chevrotain";
import {
UI5Aggregation,
UI5Class,
UI5Event,
UI5Namespace,
UI5Prop,
UI5Association,
UI5SemanticModel,
UI5EnumValue,
} from "@ui5-language-assistant/semantic-model-types/api";
import { CodeAssistSettings } from "@ui5-language-assistant/settings";
export function getXMLViewCompletions(
opts: GetXMLViewCompletionsOpts
): UI5XMLViewCompletion[];
export interface GetXMLViewCompletionsOpts {
model: UI5SemanticModel;
offset: number;
cst: DocumentCstNode;
ast: XMLDocument;
tokenVector: IToken[];
settings: CodeAssistSettings;
}
export type UI5CompletionNode =
| UI5Namespace
| UI5Class
| UI5Aggregation
| UI5Event
| UI5Prop
| UI5Association
| UI5EnumValue
| BooleanValue;
export type UI5XMLViewCompletion =
| UI5NodeXMLViewCompletion
| BooleanValueInXMLAttributeValueCompletion;
export type UI5NodeXMLViewCompletion =
| UI5ClassesInXMLTagNameCompletion
| UI5AggregationsInXMLTagNameCompletion
| UI5EnumsInXMLAttributeValueCompletion
| UI5PropsInXMLAttributeKeyCompletion
| UI5EventsInXMLAttributeKeyCompletion
| UI5AssociationsInXMLAttributeKeyCompletion
| UI5NamespacesInXMLAttributeKeyCompletion
| UI5NamespacesInXMLAttributeValueCompletion;
export type UI5XMLViewCompletionTypeName =
| "UI5ClassesInXMLTagName"
| "UI5AggregationsInXMLTagName"
| "UI5EnumsInXMLAttributeValue"
| "UI5PropsInXMLAttributeKey"
| "UI5EventsInXMLAttributeKey"
| "UI5AssociationsInXMLAttributeKey"
| "UI5NamespacesInXMLAttributeKey"
| "UI5NamespacesInXMLAttributeValue"
| "BooleanValueInXMLAttributeValue";
/**
* Note that this interface does not deal with "Editor Behavior". e.g:
* - The Text to insert may differ from the label.
* - Additional text insertions may be needed:
* - Align open and close tags.
* - Add '>' to close a tag.
* - Add quotes to wrap an attribute's value.
*
* Rather it should contain the completion "pure" data.
*/
export interface BaseXMLViewCompletion<
XML extends XMLAstNode,
UI5 extends UI5CompletionNode
> {
type: UI5XMLViewCompletionTypeName;
// The Node we want to suggest as a possible completion.
// Note this carries all the additional semantic data (deprecated/description/...).
ui5Node: UI5;
// The specific ASTNode where the completion happened
// may be useful for LSP Layer to implement Editor Level Logic.
// - e.g: the "additional text insertions" mentioned above.
astNode: XML;
}
export interface UI5ClassesInXMLTagNameCompletion
extends BaseXMLViewCompletion<XMLElement, UI5Class> {
type: "UI5ClassesInXMLTagName";
}
export interface UI5AggregationsInXMLTagNameCompletion
extends BaseXMLViewCompletion<XMLElement, UI5Aggregation> {
type: "UI5AggregationsInXMLTagName";
}
export interface UI5EnumsInXMLAttributeValueCompletion
extends BaseXMLViewCompletion<XMLAttribute, UI5EnumValue> {
type: "UI5EnumsInXMLAttributeValue";
}
export interface UI5PropsInXMLAttributeKeyCompletion
extends BaseXMLViewCompletion<XMLAttribute, UI5Prop> {
type: "UI5PropsInXMLAttributeKey";
}
export interface UI5EventsInXMLAttributeKeyCompletion
extends BaseXMLViewCompletion<XMLAttribute, UI5Event> {
type: "UI5EventsInXMLAttributeKey";
}
export interface UI5AssociationsInXMLAttributeKeyCompletion
extends BaseXMLViewCompletion<XMLAttribute, UI5Association> {
type: "UI5AssociationsInXMLAttributeKey";
}
export interface UI5NamespacesInXMLAttributeKeyCompletion
extends BaseXMLViewCompletion<XMLAttribute, UI5Namespace> {
type: "UI5NamespacesInXMLAttributeKey";
}
export interface UI5NamespacesInXMLAttributeValueCompletion
extends BaseXMLViewCompletion<XMLAttribute, UI5Namespace> {
type: "UI5NamespacesInXMLAttributeValue";
}
export interface BooleanValue {
kind: "BooleanValue";
// The name of the suggestion
name: string;
// The literal value that we want to suggest as a possible completion
value: boolean;
}
export interface BooleanValueInXMLAttributeValueCompletion
extends BaseXMLViewCompletion<XMLAttribute, BooleanValue> {
type: "BooleanValueInXMLAttributeValue";
}
/** Check if the suggestion is a UI5 semantic model xml completion according to its type property */
export function isUI5NodeXMLViewCompletion(
suggestion: UI5XMLViewCompletion
): suggestion is UI5NodeXMLViewCompletion;
| typescript |
The first FIFA 16 gameplay trailer has been unveiled. And while fans have been clamoring for numerous gameplay tweaks and refinements, EA have surpassed everyone’s expectations by announcing the inclusion of 12 national woman’s teams. The female squads include the USA, Canada, England, Brazil, Spain, and Germany, with each team’s starting 11 fully face-scanned. Unfortunately, there will be no Ultimate Team for the new squads (Source – The Guardian).
The trailer also revealed a release date, so start polishing those boots and tightening those laces for September 24, 2015. Here is the video in all its glory:
If that trailer has you ready for more, and September feels like a long way off, then we have a little something to keep you going. Our Spanish sister site has been donning its fedora and trench coat to do a little sleuthing about what fans want from FIFA 16 as part of its Secret Level series – here is what it discovered.
Despite high hopes for FIFA 15, many fans were disappointed. The game was not the leap forward hoped for with the new generation of consoles. This dissatisfaction became a recurring theme as we dug into what FIFA 16 could do better. Feel free to add you own ideas in the comments, or send them to daniel.caceres@softonic.com.
Okay, let’s kick this off.
Surely this isn’t asking much. All we want are competent goalies. They don’t all have to be Iker Casillas in his prime (we would settle for Massimo Taibi) just as long as they don’t feel like they are actively trying to help the opposition.
If you don’t believe us just check out this video:
Oh come on ref, he barely touched him!
The second complaint tackles the other end of FIFA 15’s AI issues, the referees never miss a thing. Not one. In fact, they occasionally went as far as making stuff up just for something to do. In fairness they never seemed to pick on one team over another, and it did keep players on their toes during matches, but it really broke the flow of the game. All we want for FIFA 16 are refs who want a good, flowing game.
Champions League and Europa League!
One thing we love about the yearly battle between FIFA and PES is the duel of licenses. FIFA usually has the upper hand, but it has always been missing the Champions League and Europa League. If EA really wants to put it in the back of the net with FIFA 16, it needs to seize these two licenses.
While we are comparing PES and FIFA, there is another area where Konami easily beat EA’s game last year: the tactics editor. Although FIFA 15 was an improvement over previous years, it was still overly complicated while providing limited editing options. By contrast, PES 15 had a fluid editor that was full of options... just what we want.
Videogame fans may remember modes like this from the days of Doom. Codes you could enter in a game to make your character invincible. Well, in FIFA 15 the same experience could be discovered if you had control of certain players. We know that Messi and Cristiano Ronaldo are incredible, but in FIFA 15 giving the ball to them was like asking the other team to play wearing flippers. If EA Sports could bring these gods down to the level of mortal stars in FIFA 16, that would be great.
Have you ever finished a game of FIFA 15 with a nil-nil draw? Or with just one or two goals scored? No, I thought not, because close games in FIFA 15 are a myth.
FIFA 16 must find a way to tighten up these results. We want every goal to feel like an achievement worth celebrating, and then to have that palpable tension of knowing the opposition could catch up at any time. Something else that PES manages very well.
As an example, look what happened to one of our Italian colleagues.
Whenever FIFA’s team and player stats are revealed football fans get angry because the data does not match reality. EA Sports should be more careful with this, not because the fans are complaining, but because the fans are right – the stats are not accurate. In FIFA 15 teams like Atletico Madrid and Inter Milan launched with hugely inflated stats, a situation that needs to be avoided in 16.
Let us pause for a moment to reflect on all the improvements we want in FIFA 16. More realistic AI, more realistic difficulty, more realistic stats, and tactical options... damn, I was really building momentum there – but in short more realism across the board (and tactical options). FIFA 15 was about the spectacle, hopefully FIFA 16 will be about the sport.
Still need more football before FIFA 16?
Need more of a football fix before September 24th, here are a few recommendations.
The latest installment of the franchise. It is not the best, but it did solve many of FIFA 14’s problems.
You may be surprised, but last year’s PES was a big improvement over recent years. It’s worth taking a look.
If you are more interested in the tactics and players than in the running and sweating, Football Manager 2015 is the game for you.
| english |
---
layout: about
lang: es
title: Acerca de - Beet Network
---
| markdown |
Shah Rukh Khan, his daughter Suhana Khan and actor Shanaya Kapoor are enjoying the KKR vs RCB IPL match in Kolkata.
After calling him ‘flagbearer of nepotism’ and ‘movie mafia’, Kangana Ranaut has slammed Karan Johar with a new name over his video with Anushka Sharma.
Bengali actor Prosenjit Chatterjee revealed in a new interview that regional actors do not get a lot of offers from the film industry in Mumbai.
Priyanka Chopra and her daughter Malti Marie Chopra Jonas visited Mumbai's Siddhivinayak Temple. Check out their video.
Nysa Devgan and her friends have reached Rajasthan for holiday. Her friend Orhan Awatramani shared photos from their royal dinner.
Raveena Tandon returned to Mumbai after receiving her Padma Shri award in Delhi. She was spotted with her daughter at Mumbai airport.
Insisting that filmmakers should not cross the limit, Salman Khan has extended his support for censorship of digital platforms.
Kareena Kapoor was asked by a fan if she invites her friends and family to her chat show as other celebs refuse to come or because she doesn't call them.
A video from NMACC gala, where Gauri Khan seemingly refused to be interviewed by Anusha Dandekar had surfaced online. Now Anusha has reacted to the same.
Salman Khan spoke about why Hindi films are failing to bring the audience to the theatres as he schooled 'today's filmmakers' on their 'understanding of India'.
Vivek Agnihotri, Apurva Asrani slammed Karan Johar after an old video of his ‘confession’ of trying to sabotage Anushka Sharma's career surfaced online.
Madhu Chopra reveals Priyanka Chopra lost many projects because she refused to do certain scenes as she recalled actor-daughter's initial years in Bollywood.
Speaking exclusively to Barkha Dutt on Mojo Story, Manoj Bajpayee said him and his wife Shabana Raza have never had differences on religion.
Siddharth Anand will direct YRF's Tiger vs Pathaan featuring Shah Rukh Khan and Salman Khan as Indian spies, as per a new report.
Kiara Advani, who is shooting for Satyaprem Ki Katha in Kashmir, posed in snow and shared the picture on Instagram. She also showed her surroundings.
Rani Mukerji posed with Jim Sarbh, Vaibhavi Merchant and on-screen husband Anirban Bhattacharya at Mrs Chatterjee Vs Norway success bash.
Parineeti Chopra was smiling while interacting with photographers at the Mumbai airport on Wednesday night. She said she was going to London.
The first look of Hanuman from Om Raut's next big budget film Adipurush was unveiled on Hanuman Jayanti. Devdatta Nage plays Hanuman in the film.
At Padma Awards 2023, Raveena Tandon posed with her family. She also met filmmaker SS Rajamouli during the event at Rashtrapati Bhavan.
Priyanka Chopra has signed an action film with John Cena and Idris Elba, the shooting of which will start in May. She is currently promoting her series Citadel.
Malaika Arora opened up about the time when people thought of her only as ‘a sexy bombshell’. She said that it bothered her when she wasn't taken seriously.
For the first time, Karan Singh Grover and Bipasha Basu have shared pictures of daughter Devi without hiding her face. Their fans and friends have blessed her.
In 1990, Salman Khan said he thought we would be getting the Best Actor award and had invited his family to the show. However, it went to Jackie Shroff.
Urvashi Rautela questioned the intentions of a placard which read ‘Thank God Urvashi is not here. ’ It is seemingly related to Rishabh Pant.
At a conference, Salman Khan was asked about actors of the new generations. Responding to it, he gave out a witty reply.
Rani Mukerji recently opened up about romancing Shah Rukh Khan. The two have worked together in several films.
Filmmaker Vivek Agnihotri reacted to a Twitter user expressed displeasure about the language of paparazzi at the NMACC gala as ‘uncivil and embarrassing’.
Raveena Tandon and MM Keeravaani received the Padma Shri Awards in attendance of Prime Minister Narendra Modi and Union Home Minister Amit Shah.
Johnny Lever revealed that his father was an alcoholic and he dropped out of school because he felt frustrated after asking for money to pay school fees. | english |
<reponame>adrianwit/endly
{"dateOfBirth":"2002-02-11 12:00:00","email":"<EMAIL>","hashedPassword":"<PASSWORD>","name":"abc"}
| json |
Multi-talented Siddharth and Sharwanand are teamed up for the first time for an immeasurable love story called ‘Mahasamudram’. In this film, both look powerful and intense.
The ‘RX 100′ director Ajay Bhupathi has wrapped up the entire shoot of Mahasamudram. The promotional content including the leading actors’ posters followed by 90’s heroine Rambha tribute song has gained the attention of movie lovers.
Amid positivity, Mahasamudram is ready to hit the shores of the box office on 14th October. Also starring Anu Emmanuel, Aditi Rao Hydari and Jagapathi Babu, music is composed by Chaitan Bhardwaj, produced by Anil Sunkara under AK Entertainments, written and directed by Ajay Bhupathi.
With Mahasamudram’s release, it is confirmed that Rajamouli’s RRR release is pushed back to 2022. | english |
<reponame>mukul2259/ims_apk<gh_stars>0
/*
* Copyright (c) 2015, 2016 Qualcomm Technologies, Inc.
* All Rights Reserved.
* Confidential and Proprietary - Qualcomm Technologies, Inc.
*/
package org.codeaurora.ims;
import android.os.AsyncResult;
import android.os.SystemProperties;
import android.telecom.VideoProfile;
import android.telecom.Connection.VideoProvider;
import android.telephony.ims.ImsCallProfile;
import com.android.ims.ImsConfig;
import android.telephony.ims.ImsReasonInfo;
import com.android.internal.telephony.Call;
import com.android.internal.telephony.CarrierAppUtils;
import com.android.internal.telephony.DriverCall;
import com.qualcomm.ims.utils.Log;
import org.codeaurora.ims.ImsRilException;
import org.codeaurora.ims.QtiCallConstants;
public class ImsCallUtils {
private static String TAG = "ImsCallUtils";
private static final int MIN_VIDEO_CALL_PHONE_NUMBER_LENGTH = 7;
public static final int CONFIG_TYPE_INVALID = -1;
public static final int CONFIG_TYPE_INT = 1;
public static final int CONFIG_TYPE_STRING = 2;
//TODO: Remove these configs when it is added to the ImsConfig class.
/**
* LTE threshold.
* Handover from LTE to WiFi if LTE < THLTE1 and WiFi >= VOWT_A.
*/
public static final int TH_LTE1 = 56;
/**
* LTE threshold.
* Handover from WiFi to LTE if LTE >= THLTE3 or (WiFi < VOWT_B and LTE >= THLTE2).
*/
public static final int TH_LTE2 = 57;
/**
* LTE threshold.
* Handover from WiFi to LTE if LTE >= THLTE3 or (WiFi < VOWT_B and LTE >= THLTE2).
*/
public static final int TH_LTE3 = 58;
/**
* 1x threshold.
* Handover from 1x to WiFi if 1x < TH1x
*/
public static final int TH_1x = 59;
/**
* WiFi threshold.
* Handover from LTE to WiFi if LTE < THLTE1 and WiFi >= VOWT_A.
*/
public static final int VOWT_A = 60;
/**
* WiFi threshold.
* Handover from WiFi to LTE if LTE >= THLTE3 or (WiFi < VOWT_B and LTE >= THLTE2).
*/
public static final int VOWT_B = 61;
/**
* LTE ePDG timer.
* Device shall not handover back to LTE until the T_ePDG_LTE timer expires.
*/
public static final int T_EPDG_LTE = 62;
/**
* WiFi ePDG timer.
* Device shall not handover back to WiFi until the T_ePDG_WiFi timer expires.
*/
public static final int T_EPDG_WIFI = 63;
/**
* 1x ePDG timer.
* Device shall not re-register on 1x until the T_ePDG_1x timer expires.
*/
public static final int T_EPDG_1X = 64;
/**
* MultiEndpoint status: Enabled (1), or Disabled (0).
* Value is in Integer format.
*/
public static final int VICE_SETTING_ENABLED = 65;
public static final int SESSION_MERGE_STARTED = 1;
public static final int SESSION_MERGE_COMPLETED = 2;
public static final int SESSION_MERGE_FAILED = 3;
/** Checks if a call type is any valid video call type with or without direction
*/
public static boolean isVideoCall(int callType) {
return callType == CallDetails.CALL_TYPE_VT
|| callType == CallDetails.CALL_TYPE_VT_TX
|| callType == CallDetails.CALL_TYPE_VT_RX
|| callType == CallDetails.CALL_TYPE_VT_PAUSE
|| callType == CallDetails.CALL_TYPE_VT_RESUME
|| callType == CallDetails.CALL_TYPE_VT_NODIR;
}
/** Check if call type is valid for lower layers
*/
public static boolean isValidRilModifyCallType(int callType){
return callType == CallDetails.CALL_TYPE_VT
|| callType == CallDetails.CALL_TYPE_VT_TX
|| callType == CallDetails.CALL_TYPE_VT_RX
|| callType == CallDetails.CALL_TYPE_VOICE
|| callType == CallDetails.CALL_TYPE_VT_NODIR;
}
/** Checks if videocall state transitioned to Video Paused state
* @param conn - Current connection object
* @param dc - Latest DriverCallIms instance
*/
public static boolean isVideoPaused(ImsCallSessionImpl conn, DriverCallIms dc) {
int currCallType = conn.getInternalCallType();
DriverCallIms.State currCallState = conn.getInternalState();
int nextCallType = dc.callDetails.call_type;
DriverCallIms.State nextCallState = dc.state;
boolean isHoldingPaused = isVideoCall(currCallType)
&& (currCallState == DriverCallIms.State.HOLDING)
&& isVideoCallTypeWithoutDir(nextCallType)
&& (nextCallState == DriverCallIms.State.ACTIVE);
boolean isActivePaused = (isVideoCall(currCallType)
&& (currCallState == DriverCallIms.State.ACTIVE)
&& isVideoCallTypeWithoutDir(nextCallType)
&& (nextCallState == DriverCallIms.State.ACTIVE));
return isHoldingPaused || isActivePaused;
}
/** Detects active video call
*/
public static boolean canVideoPause(ImsCallSessionImpl conn) {
return isVideoCall(conn.getInternalCallType()) && conn.isCallActive();
}
/** Checks if videocall state transitioned to Video Resumed state
* @param conn - Current connection object
* @param dc - Latest DriverCallIms instance
*/
public static boolean isVideoResumed(ImsCallSessionImpl conn, DriverCallIms dc) {
int currCallType = conn.getInternalCallType();
DriverCallIms.State currCallState = conn.getInternalState();
int nextCallType = dc.callDetails.call_type;
DriverCallIms.State nextCallState = dc.state;
return (isVideoCallTypeWithoutDir(currCallType)
&& (currCallState == DriverCallIms.State.ACTIVE)
&& isVideoCall(nextCallType)
&& (nextCallState == DriverCallIms.State.ACTIVE));
}
/** Checks if AVP Retry needs to be triggered during dialing
* @param conn - Current connection object
* @param dc - Latest DriverCallIms instance
*/
public static boolean isAvpRetryDialing(ImsCallSessionImpl conn, DriverCallIms dc) {
int currCallType = conn.getInternalCallType();
DriverCallIms.State currCallState = conn.getInternalState();
int nextCallType = dc.callDetails.call_type;
DriverCallIms.State nextCallState = dc.state;
boolean dialingAvpRetry = (isVideoCall(currCallType)
&& (currCallState == DriverCallIms.State.DIALING || currCallState == DriverCallIms.State.ALERTING)
&& isVideoCallTypeWithoutDir(nextCallType)
&& nextCallState == DriverCallIms.State.ACTIVE);
return (conn.getImsCallModification().isAvpRetryAllowed() && dialingAvpRetry);
}
/** Checks if AVP Retry needs to be triggered during upgrade
* @param conn - Current connection object
* @param dc - Latest DriverCallIms instance
*/
public static boolean isAvpRetryUpgrade(ImsCallSessionImpl conn, DriverCallIms dc) {
int currCallType = conn.getInternalCallType();
DriverCallIms.State currCallState = conn.getInternalState();
int nextCallType = dc.callDetails.call_type;
DriverCallIms.State nextCallState = dc.state;
boolean upgradeAvpRetry = (currCallType == CallDetails.CALL_TYPE_VOICE
&& currCallState == DriverCallIms.State.ACTIVE
&& isVideoCallTypeWithoutDir(nextCallType)
&& nextCallState == DriverCallIms.State.ACTIVE);
return (conn.getImsCallModification().isAvpRetryAllowed() && upgradeAvpRetry);
}
/** Checks if a call type is video call type with direction
* @param callType
*/
public static boolean isVideoCallTypeWithDir(int callType) {
return callType == CallDetails.CALL_TYPE_VT
|| callType == CallDetails.CALL_TYPE_VT_RX
|| callType == CallDetails.CALL_TYPE_VT_TX;
}
/** Checks if a incoming call is video call
* @param callSession - Current connection object
*/
public static boolean isIncomingVideoCall(ImsCallSessionImpl callSession) {
return (isVideoCall(callSession.getInternalCallType()) &&
(callSession.getInternalState() == DriverCallIms.State.INCOMING ||
callSession.getInternalState() == DriverCallIms.State.WAITING));
}
/** Checks if a call is incoming call
* @param callSession - Current connection object
*/
public static boolean isIncomingCall(ImsCallSessionImpl callSession) {
return (callSession.getInternalState() == DriverCallIms.State.INCOMING ||
callSession.getInternalState() == DriverCallIms.State.WAITING);
}
/** Checks if a call is not CS video call
* @param details - Current call details
*/
public static boolean isNotCsVideoCall(CallDetails details) {
return isVideoCall(details.call_type) &&
(details.call_domain != CallDetails.CALL_DOMAIN_CS);
}
/** Checks if a call type is video call type without direction
* @param callType
*/
public static boolean isVideoCallTypeWithoutDir(int callType) {
return callType == CallDetails.CALL_TYPE_VT_NODIR;
}
public static int convertVideoStateToCallType(int videoState) {
int callType = CallDetails.CALL_TYPE_VOICE;
switch (videoState) {
case VideoProfile.STATE_AUDIO_ONLY:
callType = CallDetails.CALL_TYPE_VOICE;
break;
case VideoProfile.STATE_RX_ENABLED:
callType = CallDetails.CALL_TYPE_VT_RX;
break;
case VideoProfile.STATE_TX_ENABLED:
callType = CallDetails.CALL_TYPE_VT_TX;
break;
case VideoProfile.STATE_BIDIRECTIONAL:
callType = CallDetails.CALL_TYPE_VT;
break;
case VideoProfile.STATE_PAUSED:
callType = CallDetails.CALL_TYPE_VT_NODIR;
break;
}
return callType;
}
public static int convertCallTypeToVideoState(int callType) {
int videoState = VideoProfile.STATE_AUDIO_ONLY;
switch (callType) {
case CallDetails.CALL_TYPE_VOICE:
videoState = VideoProfile.STATE_AUDIO_ONLY;
break;
case CallDetails.CALL_TYPE_VT_RX:
videoState = VideoProfile.STATE_RX_ENABLED;
break;
case CallDetails.CALL_TYPE_VT_TX:
videoState = VideoProfile.STATE_TX_ENABLED;
break;
case CallDetails.CALL_TYPE_VT:
videoState = VideoProfile.STATE_BIDIRECTIONAL;
break;
case CallDetails.CALL_TYPE_VT_PAUSE:
case CallDetails.CALL_TYPE_VT_NODIR:
videoState = VideoProfile.STATE_PAUSED;
break;
}
return videoState;
}
public static int convertToInternalCallType(int imsCallProfileCallType) {
int internalCallType = CallDetails.CALL_TYPE_UNKNOWN;
switch (imsCallProfileCallType) {
case ImsCallProfile.CALL_TYPE_VOICE:
case ImsCallProfile.CALL_TYPE_VOICE_N_VIDEO:
internalCallType = CallDetails.CALL_TYPE_VOICE;
break;
case ImsCallProfile.CALL_TYPE_VT:
case ImsCallProfile.CALL_TYPE_VIDEO_N_VOICE:
internalCallType = CallDetails.CALL_TYPE_VT;
break;
case ImsCallProfile.CALL_TYPE_VT_NODIR:
internalCallType = CallDetails.CALL_TYPE_VT_NODIR;
break;
case ImsCallProfile.CALL_TYPE_VT_TX:
internalCallType = CallDetails.CALL_TYPE_VT_TX;
break;
case ImsCallProfile.CALL_TYPE_VS_RX:
internalCallType = CallDetails.CALL_TYPE_VT_RX;
break;
default:
Log.e(TAG, "convertToInternalCallType invalid calltype " + imsCallProfileCallType);
break;
}
return internalCallType;
}
public static VideoProfile convertToVideoProfile(int callType, int callQuality) {
VideoProfile videoCallProfile = new VideoProfile(
convertCallTypeToVideoState(callType), callQuality);
// TODO in future - add quality to CallDetails
return videoCallProfile;
}
public static int convertImsErrorToUiError(int error) {
if (error == CallModify.E_CANCELLED) {
return VideoProvider.SESSION_MODIFY_REQUEST_TIMED_OUT;
} else if (error == CallModify.E_SUCCESS || error == CallModify.E_UNUSED) {
return VideoProvider.SESSION_MODIFY_REQUEST_SUCCESS;
} else if (error == QtiCallConstants.SESSION_MODIFY_REQUEST_FAILED_LOW_BATTERY) {
return QtiCallConstants.SESSION_MODIFY_REQUEST_FAILED_LOW_BATTERY;
} else {
return VideoProvider.SESSION_MODIFY_REQUEST_FAIL;
}
}
/**
* Utility method to detect if call type has changed
* @return boolean - true if both driver calls are not null and call type has changed
*/
public static boolean hasCallTypeChanged(DriverCallIms dc, DriverCallIms dcUpdate) {
return (dc != null && dcUpdate != null &&
dc.callDetails.call_type != dcUpdate.callDetails.call_type);
}
/**
* Utility method to detect if call type has changed from Video to Volte
* @return boolean - true if both driver calls are not null and call type
* has changed from Video to Volte
*/
public static boolean hasCallTypeChangedToVoice(DriverCallIms dc, DriverCallIms dcUpdate) {
return (dc != null && dcUpdate != null && isVideoCall(dc.callDetails.call_type) &&
dcUpdate.callDetails.call_type == CallDetails.CALL_TYPE_VOICE);
}
/**
* Utility method to get modify call error code from exception
* @return int - session modify request errors. Valid values are
* {@link VideoProvider#SESSION_MODIFY_REQUEST_FAIL},
* {@link VideoProvider#SESSION_MODIFY_REQUEST_INVALID},
* {@link VideoProvider#SESSION_MODIFY_REQUEST_TIMED_OUT},
* {@link VideoProvider#SESSION_MODIFY_REQUEST_REJECTED_BY_REMOTE},
* {@link QtiCallConstants#SESSION_MODIFY_REQUEST_FAILED_LOW_BATTERY}
*
*/
public static int getUiErrorCode(Throwable ex) {
int status = VideoProvider.SESSION_MODIFY_REQUEST_FAIL;
if (ex instanceof ImsRilException) {
ImsRilException imsRilException = (ImsRilException) ex;
status = getUiErrorCode(imsRilException.getErrorCode());
}
return status;
}
public static int getUiErrorCode(int imsErrorCode) {
int status = VideoProvider.SESSION_MODIFY_REQUEST_SUCCESS;
switch (imsErrorCode) {
case ImsQmiIF.E_SUCCESS:
case ImsQmiIF.E_UNUSED:
status = VideoProvider.SESSION_MODIFY_REQUEST_SUCCESS;
break;
case ImsQmiIF.E_CANCELLED:
status = VideoProvider.SESSION_MODIFY_REQUEST_TIMED_OUT;
break;
case ImsQmiIF.E_REJECTED_BY_REMOTE:
status = VideoProvider.SESSION_MODIFY_REQUEST_REJECTED_BY_REMOTE;
break;
case ImsQmiIF.E_INVALID_PARAMETER:
status = VideoProvider.SESSION_MODIFY_REQUEST_INVALID;
break;
case QtiCallConstants.SESSION_MODIFY_REQUEST_FAILED_LOW_BATTERY:
status = QtiCallConstants.SESSION_MODIFY_REQUEST_FAILED_LOW_BATTERY;
break;
default:
status = VideoProvider.SESSION_MODIFY_REQUEST_FAIL;
}
return status;
}
public static boolean isConfigRequestValid(int item, int requestType) {
int configType = CONFIG_TYPE_INVALID;
switch (item) {
case ImsConfig.ConfigConstants.VOCODER_AMRMODESET:
case ImsConfig.ConfigConstants.VOCODER_AMRWBMODESET:
case ImsConfig.ConfigConstants.DOMAIN_NAME:
case ImsConfig.ConfigConstants.LBO_PCSCF_ADDRESS:
case ImsConfig.ConfigConstants.SMS_PSI:
configType = CONFIG_TYPE_STRING;
break;
case ImsConfig.ConfigConstants.SIP_SESSION_TIMER:
case ImsConfig.ConfigConstants.MIN_SE:
case ImsConfig.ConfigConstants.CANCELLATION_TIMER:
case ImsConfig.ConfigConstants.TDELAY:
case ImsConfig.ConfigConstants.SILENT_REDIAL_ENABLE:
case ImsConfig.ConfigConstants.SIP_T1_TIMER:
case ImsConfig.ConfigConstants.SIP_T2_TIMER:
case ImsConfig.ConfigConstants.SIP_TF_TIMER:
case ImsConfig.ConfigConstants.VLT_SETTING_ENABLED:
case ImsConfig.ConfigConstants.LVC_SETTING_ENABLED:
case ImsConfig.ConfigConstants.SMS_FORMAT:
case ImsConfig.ConfigConstants.SMS_OVER_IP:
case ImsConfig.ConfigConstants.PUBLISH_TIMER:
case ImsConfig.ConfigConstants.PUBLISH_TIMER_EXTENDED:
case ImsConfig.ConfigConstants.CAPABILITIES_CACHE_EXPIRATION:
case ImsConfig.ConfigConstants.AVAILABILITY_CACHE_EXPIRATION:
case ImsConfig.ConfigConstants.CAPABILITIES_POLL_INTERVAL:
case ImsConfig.ConfigConstants.SOURCE_THROTTLE_PUBLISH:
case ImsConfig.ConfigConstants.MAX_NUMENTRIES_IN_RCL:
case ImsConfig.ConfigConstants.CAPAB_POLL_LIST_SUB_EXP:
case ImsConfig.ConfigConstants.GZIP_FLAG:
case ImsConfig.ConfigConstants.EAB_SETTING_ENABLED:
case ImsConfig.ConfigConstants.VOICE_OVER_WIFI_ROAMING:
case ImsConfig.ConfigConstants.VOICE_OVER_WIFI_MODE:
case ImsConfig.ConfigConstants.MOBILE_DATA_ENABLED:
case ImsConfig.ConfigConstants.VOLTE_USER_OPT_IN_STATUS:
case ImsConfig.ConfigConstants.KEEP_ALIVE_ENABLED:
case ImsConfig.ConfigConstants.REGISTRATION_RETRY_BASE_TIME_SEC:
case ImsConfig.ConfigConstants.REGISTRATION_RETRY_MAX_TIME_SEC:
case ImsConfig.ConfigConstants.SPEECH_START_PORT:
case ImsConfig.ConfigConstants.SPEECH_END_PORT:
case ImsConfig.ConfigConstants.SIP_INVITE_REQ_RETX_INTERVAL_MSEC:
case ImsConfig.ConfigConstants.SIP_INVITE_RSP_WAIT_TIME_MSEC:
case ImsConfig.ConfigConstants.SIP_INVITE_RSP_RETX_WAIT_TIME_MSEC:
case ImsConfig.ConfigConstants.SIP_NON_INVITE_REQ_RETX_INTERVAL_MSEC:
case ImsConfig.ConfigConstants.SIP_NON_INVITE_TXN_TIMEOUT_TIMER_MSEC:
case ImsConfig.ConfigConstants.SIP_INVITE_RSP_RETX_INTERVAL_MSEC:
case ImsConfig.ConfigConstants.SIP_ACK_RECEIPT_WAIT_TIME_MSEC:
case ImsConfig.ConfigConstants.SIP_ACK_RETX_WAIT_TIME_MSEC:
case ImsConfig.ConfigConstants.SIP_NON_INVITE_REQ_RETX_WAIT_TIME_MSEC:
case ImsConfig.ConfigConstants.SIP_NON_INVITE_RSP_RETX_WAIT_TIME_MSEC:
case ImsConfig.ConfigConstants.AMR_WB_OCTET_ALIGNED_PT:
case ImsConfig.ConfigConstants.AMR_WB_BANDWIDTH_EFFICIENT_PT:
case ImsConfig.ConfigConstants.AMR_OCTET_ALIGNED_PT:
case ImsConfig.ConfigConstants.AMR_BANDWIDTH_EFFICIENT_PT:
case ImsConfig.ConfigConstants.DTMF_WB_PT:
case ImsConfig.ConfigConstants.DTMF_NB_PT:
case ImsConfig.ConfigConstants.AMR_DEFAULT_MODE:
case ImsConfig.ConfigConstants.VIDEO_QUALITY:
case TH_LTE1:
case TH_LTE2:
case TH_LTE3:
case TH_1x:
case VOWT_A:
case VOWT_B:
case T_EPDG_LTE:
case T_EPDG_WIFI:
case T_EPDG_1X:
case VICE_SETTING_ENABLED:
configType = CONFIG_TYPE_INT;
break;
}
return configType == requestType;
}
public static int convertImsConfigToProto(int config) {
switch(config) {
case ImsConfig.ConfigConstants.VOCODER_AMRMODESET:
return ImsQmiIF.CONFIG_ITEM_VOCODER_AMRMODESET;
case ImsConfig.ConfigConstants.VOCODER_AMRWBMODESET:
return ImsQmiIF.CONFIG_ITEM_VOCODER_AMRWBMODESET;
case ImsConfig.ConfigConstants.SIP_SESSION_TIMER:
return ImsQmiIF.CONFIG_ITEM_SIP_SESSION_TIMER;
case ImsConfig.ConfigConstants.MIN_SE:
return ImsQmiIF.CONFIG_ITEM_MIN_SESSION_EXPIRY;
case ImsConfig.ConfigConstants.CANCELLATION_TIMER:
return ImsQmiIF.CONFIG_ITEM_CANCELLATION_TIMER;
case ImsConfig.ConfigConstants.TDELAY:
return ImsQmiIF.CONFIG_ITEM_T_DELAY;
case ImsConfig.ConfigConstants.SILENT_REDIAL_ENABLE:
return ImsQmiIF.CONFIG_ITEM_SILENT_REDIAL_ENABLE;
case ImsConfig.ConfigConstants.SIP_T1_TIMER:
return ImsQmiIF.CONFIG_ITEM_SIP_T1_TIMER;
case ImsConfig.ConfigConstants.SIP_T2_TIMER:
return ImsQmiIF.CONFIG_ITEM_SIP_T2_TIMER;
case ImsConfig.ConfigConstants.SIP_TF_TIMER:
return ImsQmiIF.CONFIG_ITEM_SIP_TF_TIMER;
case ImsConfig.ConfigConstants.VLT_SETTING_ENABLED:
return ImsQmiIF.CONFIG_ITEM_VLT_SETTING_ENABLED;
case ImsConfig.ConfigConstants.LVC_SETTING_ENABLED:
return ImsQmiIF.CONFIG_ITEM_LVC_SETTING_ENABLED;
case ImsConfig.ConfigConstants.DOMAIN_NAME:
return ImsQmiIF.CONFIG_ITEM_DOMAIN_NAME;
case ImsConfig.ConfigConstants.SMS_FORMAT:
return ImsQmiIF.CONFIG_ITEM_SMS_FORMAT;
case ImsConfig.ConfigConstants.SMS_OVER_IP:
return ImsQmiIF.CONFIG_ITEM_SMS_OVER_IP;
case ImsConfig.ConfigConstants.PUBLISH_TIMER:
return ImsQmiIF.CONFIG_ITEM_PUBLISH_TIMER;
case ImsConfig.ConfigConstants.PUBLISH_TIMER_EXTENDED:
return ImsQmiIF.CONFIG_ITEM_PUBLISH_TIMER_EXTENDED;
case ImsConfig.ConfigConstants.CAPABILITIES_CACHE_EXPIRATION:
return ImsQmiIF.CONFIG_ITEM_CAPABILITIES_CACHE_EXPIRATION;
case ImsConfig.ConfigConstants.AVAILABILITY_CACHE_EXPIRATION:
return ImsQmiIF.CONFIG_ITEM_AVAILABILITY_CACHE_EXPIRATION;
case ImsConfig.ConfigConstants.CAPABILITIES_POLL_INTERVAL:
return ImsQmiIF.CONFIG_ITEM_CAPABILITIES_POLL_INTERVAL;
case ImsConfig.ConfigConstants.SOURCE_THROTTLE_PUBLISH:
return ImsQmiIF.CONFIG_ITEM_SOURCE_THROTTLE_PUBLISH;
case ImsConfig.ConfigConstants.MAX_NUMENTRIES_IN_RCL:
return ImsQmiIF.CONFIG_ITEM_MAX_NUM_ENTRIES_IN_RCL;
case ImsConfig.ConfigConstants.CAPAB_POLL_LIST_SUB_EXP:
return ImsQmiIF.CONFIG_ITEM_CAPAB_POLL_LIST_SUB_EXP;
case ImsConfig.ConfigConstants.GZIP_FLAG:
return ImsQmiIF.CONFIG_ITEM_GZIP_FLAG;
case ImsConfig.ConfigConstants.EAB_SETTING_ENABLED:
return ImsQmiIF.CONFIG_ITEM_EAB_SETTING_ENABLED;
case ImsConfig.ConfigConstants.VOICE_OVER_WIFI_ROAMING:
return ImsQmiIF.CONFIG_ITEM_VOICE_OVER_WIFI_ROAMING;
case ImsConfig.ConfigConstants.VOICE_OVER_WIFI_MODE:
return ImsQmiIF.CONFIG_ITEM_VOICE_OVER_WIFI_MODE;
case ImsConfig.ConfigConstants.LBO_PCSCF_ADDRESS:
return ImsQmiIF.CONFIG_ITEM_LBO_PCSCF_ADDRESS;
case ImsConfig.ConfigConstants.MOBILE_DATA_ENABLED:
return ImsQmiIF.CONFIG_ITEM_MOBILE_DATA_ENABLED;
case ImsConfig.ConfigConstants.VOLTE_USER_OPT_IN_STATUS:
return ImsQmiIF.CONFIG_ITEM_VOLTE_USER_OPT_IN_STATUS;
case ImsConfig.ConfigConstants.KEEP_ALIVE_ENABLED:
return ImsQmiIF.CONFIG_ITEM_KEEP_ALIVE_ENABLED;
case ImsConfig.ConfigConstants.REGISTRATION_RETRY_BASE_TIME_SEC:
return ImsQmiIF.CONFIG_ITEM_REGISTRATION_RETRY_BASE_TIME_SEC;
case ImsConfig.ConfigConstants.REGISTRATION_RETRY_MAX_TIME_SEC:
return ImsQmiIF.CONFIG_ITEM_REGISTRATION_RETRY_MAX_TIME_SEC;
case ImsConfig.ConfigConstants.SPEECH_START_PORT:
return ImsQmiIF.CONFIG_ITEM_SPEECH_START_PORT;
case ImsConfig.ConfigConstants.SPEECH_END_PORT:
return ImsQmiIF.CONFIG_ITEM_SPEECH_END_PORT;
case ImsConfig.ConfigConstants.SIP_INVITE_REQ_RETX_INTERVAL_MSEC:
return ImsQmiIF.CONFIG_ITEM_SIP_INVITE_REQ_RETX_INTERVAL_MSEC;
case ImsConfig.ConfigConstants.SIP_INVITE_RSP_WAIT_TIME_MSEC:
return ImsQmiIF.CONFIG_ITEM_SIP_INVITE_RSP_WAIT_TIME_MSEC;
case ImsConfig.ConfigConstants.SIP_INVITE_RSP_RETX_WAIT_TIME_MSEC:
return ImsQmiIF.CONFIG_ITEM_SIP_INVITE_RSP_RETX_WAIT_TIME_MSEC;
case ImsConfig.ConfigConstants.SIP_NON_INVITE_REQ_RETX_INTERVAL_MSEC:
return ImsQmiIF.CONFIG_ITEM_SIP_NON_INVITE_REQ_RETX_INTERVAL_MSEC;
case ImsConfig.ConfigConstants.SIP_NON_INVITE_TXN_TIMEOUT_TIMER_MSEC:
return ImsQmiIF.CONFIG_ITEM_SIP_NON_INVITE_TXN_TIMEOUT_TIMER_MSEC;
case ImsConfig.ConfigConstants.SIP_INVITE_RSP_RETX_INTERVAL_MSEC:
return ImsQmiIF.CONFIG_ITEM_SIP_INVITE_RSP_RETX_INTERVAL_MSEC;
case ImsConfig.ConfigConstants.SIP_ACK_RECEIPT_WAIT_TIME_MSEC:
return ImsQmiIF.CONFIG_ITEM_SIP_ACK_RECEIPT_WAIT_TIME_MSEC;
case ImsConfig.ConfigConstants.SIP_ACK_RETX_WAIT_TIME_MSEC:
return ImsQmiIF.CONFIG_ITEM_SIP_ACK_RETX_WAIT_TIME_MSEC;
case ImsConfig.ConfigConstants.SIP_NON_INVITE_REQ_RETX_WAIT_TIME_MSEC:
return ImsQmiIF.CONFIG_ITEM_SIP_NON_INVITE_REQ_RETX_WAIT_TIME_MSEC;
case ImsConfig.ConfigConstants.SIP_NON_INVITE_RSP_RETX_WAIT_TIME_MSEC:
return ImsQmiIF.CONFIG_ITEM_SIP_NON_INVITE_RSP_RETX_WAIT_TIME_MSEC;
case ImsConfig.ConfigConstants.AMR_WB_OCTET_ALIGNED_PT:
return ImsQmiIF.CONFIG_ITEM_AMR_WB_OCTET_ALIGNED_PT;
case ImsConfig.ConfigConstants.AMR_WB_BANDWIDTH_EFFICIENT_PT:
return ImsQmiIF.CONFIG_ITEM_AMR_WB_BANDWIDTH_EFFICIENT_PT;
case ImsConfig.ConfigConstants.AMR_OCTET_ALIGNED_PT:
return ImsQmiIF.CONFIG_ITEM_AMR_OCTET_ALIGNED_PT;
case ImsConfig.ConfigConstants.AMR_BANDWIDTH_EFFICIENT_PT:
return ImsQmiIF.CONFIG_ITEM_AMR_BANDWIDTH_EFFICIENT_PT;
case ImsConfig.ConfigConstants.DTMF_WB_PT:
return ImsQmiIF.CONFIG_ITEM_DTMF_WB_PT;
case ImsConfig.ConfigConstants.DTMF_NB_PT:
return ImsQmiIF.CONFIG_ITEM_DTMF_NB_PT;
case ImsConfig.ConfigConstants.AMR_DEFAULT_MODE:
return ImsQmiIF.CONFIG_ITEM_AMR_DEFAULT_MODE;
case ImsConfig.ConfigConstants.SMS_PSI:
return ImsQmiIF.CONFIG_ITEM_SMS_PSI;
case ImsConfig.ConfigConstants.VIDEO_QUALITY:
return ImsQmiIF.CONFIG_ITEM_VIDEO_QUALITY;
case TH_LTE1:
return ImsQmiIF.CONFIG_ITEM_THRESHOLD_LTE1;
case TH_LTE2:
return ImsQmiIF.CONFIG_ITEM_THRESHOLD_LTE2;
case TH_LTE3:
return ImsQmiIF.CONFIG_ITEM_THRESHOLD_LTE3;
case TH_1x:
return ImsQmiIF.CONFIG_ITEM_THRESHOLD_1x;
case VOWT_A:
return ImsQmiIF.CONFIG_ITEM_THRESHOLD_WIFI_A;
case VOWT_B:
return ImsQmiIF.CONFIG_ITEM_THRESHOLD_WIFI_B;
case T_EPDG_LTE:
return ImsQmiIF.CONFIG_ITEM_T_EPDG_LTE;
case T_EPDG_WIFI:
return ImsQmiIF.CONFIG_ITEM_T_EPDG_WIFI;
case T_EPDG_1X:
return ImsQmiIF.CONFIG_ITEM_T_EPDG_1x;
case VICE_SETTING_ENABLED:
return ImsQmiIF.CONFIG_ITEM_VCE_SETTING_ENABLED;
default:
throw new IllegalArgumentException();
}
}
public static boolean isActive(DriverCallIms dc) {
return (dc != null && dc.state == DriverCallIms.State.ACTIVE);
}
/**
* Maps the proto exception error codes passed from lower layers (RIL) to internal error codes.
*/
public static int toUiErrorCode(ImsRilException ex) {
switch (ex.getErrorCode()) {
case ImsQmiIF.E_HOLD_RESUME_FAILED:
return QtiCallConstants.ERROR_CALL_SUPP_SVC_FAILED;
case ImsQmiIF.E_HOLD_RESUME_CANCELED:
return QtiCallConstants.ERROR_CALL_SUPP_SVC_CANCELLED;
case ImsQmiIF.E_REINVITE_COLLISION:
return QtiCallConstants.ERROR_CALL_SUPP_SVC_REINVITE_COLLISION;
default:
return QtiCallConstants.ERROR_CALL_CODE_UNSPECIFIED;
}
}
/**
* Maps the proto exception error codes passed from lower layers (RIL) to Ims error codes.
*/
public static int toImsErrorCode(ImsRilException ex) {
switch (ex.getErrorCode()) {
case ImsQmiIF.E_HOLD_RESUME_FAILED:
return ImsReasonInfo.CODE_SUPP_SVC_FAILED;
case ImsQmiIF.E_HOLD_RESUME_CANCELED:
return ImsReasonInfo.CODE_SUPP_SVC_CANCELLED;
case ImsQmiIF.E_REINVITE_COLLISION:
return ImsReasonInfo.CODE_SUPP_SVC_REINVITE_COLLISION;
default:
return ImsReasonInfo.CODE_UNSPECIFIED;
}
}
/**
* Check is carrier one supported or not
*/
public static boolean isCarrierOneSupported() {
String property = SystemProperties.get("persist.radio.atel.carrier");
return "405854".equals(property);
}
/**
* Checks if the vidoCall number is valid,ignore the special characters and invalid length
*
* @param number the number to call.
* @return true if the number is valid
*
* @hide
*/
public static boolean isVideoCallNumValid(String number) {
if (number == null || number.isEmpty()
|| number.length() < MIN_VIDEO_CALL_PHONE_NUMBER_LENGTH) {
Log.w(TAG, "Phone number invalid!");
return false;
}
/*if the first char is "+",then remove it,
* this for support international call
*/
if(number.startsWith("+")) {
number = number.substring(1, number.length());
}
//Check non-digit characters '#', '+', ',', and ';'
if (number.contains("#") || number.contains("+") ||
number.contains(",") || number.contains(";") ||
number.contains("*")) {
return false;
}
return true;
}
/**
* Creates ImsReasonInfo object from proto structure.
*/
public static ImsReasonInfo getImsReasonInfo(ImsQmiIF.SipErrorInfo error,
int errorCode) {
if (error == null) {
return new ImsReasonInfo(errorCode, 0);
} else {
Log.d(TAG, "Sip error code:" + error.getSipErrorCode() +
" error string :" + error.getSipErrorString());
return new ImsReasonInfo(errorCode, error.getSipErrorCode(),
error.getSipErrorString());
}
}
/**
* Creates ImsReasonInfo object from async result.
*/
public static ImsReasonInfo getImsReasonInfo(AsyncResult ar)
{
ImsQmiIF.SipErrorInfo sipErrorInfo = null;
int code = ImsReasonInfo.CODE_UNSPECIFIED;
if(ar != null) {
sipErrorInfo = (ImsQmiIF.SipErrorInfo) ar.result;
if(ar.exception != null) {
code = ImsCallUtils.toImsErrorCode((ImsRilException)ar.exception);
}
}
return getImsReasonInfo(sipErrorInfo, code);
}
}
| java |
Enormous tech M&A deals have been announced recently: EMC/Dell, WDC/SanDisk, Lam-Research/KLC-Tencor. These follow a very busy year of large tech M&A, with Avago/Broadcom, Nokia/Alcatel-Lucent and Intel/Altera.
However, with the large number of multi-billion dollar mergers, there is a nagging feeling that the traditional tech buyers are doing fewer acquisitions of smaller VC-backed startup companies, acquisitions that usually close for a few hundreds of millions of dollars.
So, it’s interesting to look at some recent actual data via research firms tracking this activity. Given my interest area — enterprise tech/IT/software — I took a look at the specific buyers in this space.
Looking at this PitchBook report from August, where they track transactions going back to 2010, and doing a comparison of the time windows of 2010-2012 and 2013-2015 (the report only goes up to the first half of 2015, so I added some recent deals announced up to the end of October 2015) reveals the following trends with IT/software buyers:
Microsoft. Eight deals in 2010-2012 going up to 18 deals in 2013-2015, with the pace going strong over the last few months. Clearly with a new CEO and increased focus on cloud and security, Microsoft is very active in the market.
Cisco. Shows flat in the original report — eight deals in each period — but has accelerated over the last couple of months with five more deals, and recently three deals announced in three days. With a new CEO, increased focus on security and the fear of being left behind in the shifting landscape of IT, Cisco has the firepower to keep buying.
EMC. EMC seems to be maintaining a steady pace of deals, and the Virtustream deal is a landmark deal for EMC in the fight to stay relevant in the cloud era. However, with the Dell merger (if it closes), it is pretty clear the deal pace for EMC and VMware will slow down.
The last one obviously is not surprising, given Dell going private. HP does not show in the report, but their activity is flat and will probably decrease for a while until the new Hewlett Packard Enterprise company is back in buying mode.
So the picture becomes clear. With the exception of a few that can be aggressive and increase their activity, the rest are slowing down. Although cash balances are pretty healthy, there are many reasons for slowing down. Some companies are busy with sorting out internal activities. In many cases, expected M&A valuations have shot up considerably (a sign of the times), there has been activist involvement in some of the mature companies, etc.
With the decline of activity of the old guard, expect activity to ramp up for the new public companies of recent years: Box, New Relic, ServiceNow, Palo Alto Networks, Workday and Splunk, just to name a few. Some private companies have also become active in recent years: Dropbox, Docker and Cloudera.
Other existing players continue to be active, but on a smaller scale: Blackberry, Red Hat, SAP, Teradata, F5, Check Point, Symantec/Veritas, etc. Expect the large cloud/consumer players to do more IT/software deals: Google, Apple, Amazon and Intel.
The overall pace, however, is slowing down. Private startup companies should take the long-term view of building independent, lasting businesses.
| english |
<reponame>HiBrowser/Hi-Browser
{"text":"","historical":"Legislative History of Laws\n\nLaw 19-21, the \"Fiscal Year 2012 Budget Support Act of 2011\", was introduced in Council and assigned Bill No. 19-203, which was referred to the Committee of the Whole. The Bill was adopted on first and second readings on May 25, 2011, and June 14, 2011, respectively. Signed by the Mayor on July 22, 2011, it was assigned Act No. 19-98 and transmitted to both Houses of Congress for its review. D.C. Law 19-21 became effective on September 14, 2011.\n\nMiscellaneous Notes\n\nShort title: Section 3021 of D.C. Law 19-21 provided that subtitle C of title III of the act may be cited as \"Office of the Deputy Mayor for Public Safety and Justice Establishment Act of 2011\".\n\nDC CODE § 1-301.191\n\nCurrent through December 11, 2012","credits":"(Sept. 14, 2011, D.C. Law 19-21, § 3022, 58 DCR 6226.)","sections":[{"prefix":"a","text":" Pursuant to § 1-204.04(b), the Council establishes the Office of the Deputy Mayor for Public Safety and Justice (\"Office\"), as a separate agency, subordinate to the Mayor, within the executive branch of the District of Columbia government, which shall be headed by the Deputy Mayor for Public Safety and Justice."},{"prefix":"b","text":" Except as provided in subsection (d) of this section, the Deputy Mayor for Public Safety and Justice shall be appointed to head the Office pursuant to § 1-523.01(a)."},{"prefix":"c","text":" The Office shall:"},{"prefix":"1","text":" Be responsible for providing guidance and support to, and coordination of, public safety and of justice agencies within the District of Columbia government;"},{"prefix":"2","text":" Ensure accountability through general oversight over public safety and justice agencies, as well as the programs under the jurisdiction of the Office, including those listed in paragraph (5) of this subsection;"},{"prefix":"3","text":" Promote, coordinate, and oversee collaborative efforts among District government agencies, and between District and federal government agencies, to ensure public safety and enhance the delivery of public-safety and justice services;"},{"prefix":"4","text":" Serve as a liaison to federal government agencies associated with criminal justice or public-safety issues, in the coordination, planning, and implementation of public-safety and justice matters; and"},{"prefix":"5","text":"(A) Oversee and provide administrative support for the:"},{"prefix":"i","text":" Access to Justice Initiative;"},{"prefix":"ii","text":" Motor Vehicle Theft Prevention Commission;"},{"prefix":"iii","text":" Corrections Information Council;"},{"prefix":"iv","text":" Office of Justice Grants Administration; and"},{"prefix":"v","text":" Office of Victim Services."},{"prefix":"B","text":" Funding for the programs listed in subparagraph (A) of this paragraph shall be specified by the annual Budget Request Act adopted by the Council. Nothing in this paragraph shall prevent the Office from contributing administrative and other support to further the purpose of these programs."},{"prefix":"d","text":" Subsection (b) of this section shall not apply to the Deputy Mayor for Public Safety and Justice who is the incumbent head of the Office on September 14, 2011."}],"division":{"identifier":"I","text":"Government of District."},"title":{"identifier":"1","text":"Government Organization. (Refs & Annos)"},"chapter":{"identifier":"3","text":"Specified Governmental Authority."},"subchapter":{"identifier":"I","text":"Additional Governmental Powers and Responsibilities."},"part":{"identifier":"L","text":"Office of the Deputy Mayor for Public Safety and Justice."},"heading":{"title":"1","chaptersection":"301","identifier":"1-301.19","catch_text":"1. Office of the Deputy Mayor for Public Safety and Justice; establishment; authority."}} | json |
{"moment-range.bare.js":"<KEY>,"moment-range.bare.min.js":"<KEY>,"moment-range.js":"<KEY>,"moment-range.min.js":"<KEY>} | json |
If you spent the long weekend drinking enough rum to kill a pirate army, you’re not alone. Fifth of July, colloquially known as National Hangover Day, is a time for reflecting and repenting. Luckily for all our dumb asses, there’s a bright spot: Tonight, SpaceX will attempt to relaunch the rocket it was supposed to launch yesterday. It’s a Fifth of July miracle!
This weekend, SpaceX aborted both of its attempts to launch a satellite payload on behalf of communications satellite services provider Intelsat. Earlier today, however, the Luxembourg-based company tweeted that SpaceX has given it the green light for tonight—the 58-minute launch window will open at 7:37pm EDT.
The Orlando Sentinel reports that there will be no attempt to recover the Falcon 9 rocket that will blast off tonight from Pad 39A in Cape Canaveral, Florida. The satellite will be placed in a high geostationary transfer orbit, and there’s not enough fuel to bring the rocket back to Earth for recovery.
Still, it’ll be fun to watch a hunk of metal take off into Earth’s atmosphere, especially after the mission was scrubbed two days in a row. According to Elon Musk, SpaceX spent the Fourth of July “doing a full review of rocket & pad systems” to prep for tonight’s launch. Sunday’s launch was cancelled due to a computer guidance system error. Monday’s launch is still a bit of a mystery—Gizmodo has reached out to SpaceX for a statement regarding it and will update this post if and when we hear back.
If all goes according to plan, this will mark SpaceX’s third launch in two weeks. Speaking of plans, your hungover ass definitely doesn’t have any tonight, so sit back, relax, and (hopefully) enjoy a nice rocket launch. You can do that below, as soon as the launch window opens:
| english |
package org.firstinspires.ftc.teamswerve;
import com.qualcomm.hardware.bosch.BNO055IMU;
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;
import com.qualcomm.robotcore.eventloop.opmode.TeleOp;
import com.qualcomm.robotcore.hardware.DcMotor;
import org.firstinspires.ftc.robotcore.external.Func;
import org.firstinspires.ftc.robotcore.external.navigation.AngleUnit;
import org.firstinspires.ftc.robotcore.external.navigation.Orientation;
import org.firstinspires.ftc.robotcore.external.navigation.AxesReference;
import org.firstinspires.ftc.robotcore.external.navigation.Orientation;
import java.util.Locale;
/**
* Program used to control Drive-A-Bots.YAY!!
* This can be a good reference for drive controls.
*/
//@TeleOp(name="JustinOmniDrive", group = "Swerve")
// @Disabled
public class JustinOmniDrive extends LinearOpMode
{
DcMotor motorFront = null;
DcMotor motorBack = null;
DcMotor motorLeft = null;
DcMotor motorRight = null;
double currentAngle;
double startAngle;
double imuAngle;
double robotAngle;
double anglePivot;
double jy;
double jx;
double error;
double pivot;
double kAngle;
double jpivot;//for pivoting
double speedMotorFront;
double speedMotorBack;
double speedMotorLeft;
double speedMotorRight;
//double currentAngleY;
//double currentAngleZ;
Orientation angles;
//----------------------------------------------------------------------------------------------
// State
//----------------------------------------------------------------------------------------------
// The IMU sensor object
BNO055IMU imu;
// Drive mode constants
@Override public void runOpMode() throws InterruptedException
{
// Initialize hardware and other important things
initializeRobot();
robotAngle = imu.getAngularOrientation().firstAngle;
// Wait until start button has been pressed
waitForStart();
robotAngle = imu.getAngularOrientation().firstAngle;
//robotAngle = adjustAngles(robotAngle);
anglePivot = robotAngle;
// Main loop
while(opModeIsActive())
{
omniDriveDiagonal();
telemetry.update();
idle();
}
}
/*
* Controls the robot with two joysticks
* Left joystick controls left side
* Right joystick controls right side
public void omniDrive()
{
double jx;
double jy;
double jt;
double jp;
jt = gamepad1. left_stick_x;
jx = gamepad1.right_stick_x;
jy = -gamepad1.right_stick_y;
motorFront.setPower(jx);
motorBack.setPower(jx);
motorLeft.setPower(jy);
motorRight.setPower(jy);
motorFront.setPower(jt);
motorBack.setPower(-jt);
motorLeft.setPower(jt);
motorRight.setPower(-jt);
}
*/
public void omniDriveDiagonal()
{
jy = -gamepad1.right_stick_y;
jx = gamepad1.right_stick_x;
jpivot = gamepad1.left_stick_x;
anglePivot = 2 * (anglePivot - jpivot);
anglePivot = adjustAngles(anglePivot);
kAngle = 0.035;
robotAngle = imu.getAngularOrientation().firstAngle;
//robotAngle = adjustAngles(robotAngle);
error = robotAngle - anglePivot;
error = adjustAngles(error);
pivot = error * kAngle;
speedMotorFront = jx - jy - pivot;
speedMotorBack = -jx + jy - pivot;
speedMotorLeft = jx + jy - pivot;
speedMotorRight = -jx - jy - pivot;
motorFront.setPower(speedMotorFront);
motorBack.setPower(speedMotorBack);
motorLeft.setPower(speedMotorLeft);
motorRight.setPower(speedMotorRight);
}
// normalizing the angle to be between -180 to 180
public double adjustAngles(double angle)
{
while(angle > 180)
angle -= 360;
while(angle < -180)
angle += 360;
return angle;
}
public void initializeRobot()
{
// Initialize motors to be the hardware motors
motorFront = hardwareMap.dcMotor.get("motorFront");
motorBack = hardwareMap.dcMotor.get("motorBack");
motorLeft = hardwareMap.dcMotor.get("motorLeft");
motorRight = hardwareMap.dcMotor.get("motorRight");
// We're not using encoders, so tell the motor controller
motorFront.setMode(DcMotor.RunMode.RUN_USING_ENCODER);
motorBack.setMode(DcMotor.RunMode.RUN_USING_ENCODER);
motorLeft.setMode(DcMotor.RunMode.RUN_USING_ENCODER);
motorRight.setMode(DcMotor.RunMode.RUN_USING_ENCODER);
// The motors will run in opposite directions, so flip one
//THIS IS SET UP FOR TANK MODE WITH OUR CURRENT DRIVABOTS
//DON'T CHANGE IT!
//motorFront.setDirection(DcMotor.Direction.REVERSE);
//motorLeft.setDirection(DcMotor.Direction.REVERSE);
// Set up the parameters with which we will use our IMU. Note that integration
// algorithm here just reports accelerations to the logcat log; it doesn't actually
// provide positional information.
BNO055IMU.Parameters parameters = new BNO055IMU.Parameters();
parameters.angleUnit = BNO055IMU.AngleUnit.DEGREES;
parameters.accelUnit = BNO055IMU.AccelUnit.METERS_PERSEC_PERSEC;
//parameters.calibrationDataFile = "AdafruitIMUCalibration.json"; // see the calibration sample opmode
//parameters.loggingEnabled = true;
parameters.loggingEnabled = false;
parameters.loggingTag = "IMU";
// Retrieve and initialize the IMU. We expect the IMU to be attached to an I2C port
// on a Core Device Interface Module, configured to be a sensor of type "AdaFruit IMU",
// and named "imu".
imu = hardwareMap.get(BNO055IMU.class, "imu");
imu.initialize(parameters);
// Set up telemetry data
configureDashboard();
}
public void configureDashboard()
{
telemetry.addLine()
.addData("Power | Front: ", new Func<String>() {
@Override public String value() {
return formatNumber(motorFront.getPower());
}
})
.addData("Back: ", new Func<String>() {
@Override public String value() {
return formatNumber(motorBack.getPower());
}
})
.addData("Power | Left: ", new Func<String>() {
@Override public String value() {
return formatNumber(motorLeft.getPower());
}
})
.addData("Right: ", new Func<String>() {
@Override public String value() {
return formatNumber(motorRight.getPower());
}
})
.addData("anglePivot", new Func<String>() {
@Override public String value() {
// return formatAngle(angles.angleUnit, startAngle);
return formatNumber(anglePivot);
}
})
.addData("robotAngle", new Func<String>() {
@Override public String value() {
// return formatAngle(angles.angleUnit, imuAngle);
return formatNumber(robotAngle);
}
});
}
//----------------------------------------------------------------------------------------------
// Formatting
//----------------------------------------------------------------------------------------------
String formatAngle(AngleUnit angleUnit, double angle) {
return formatDegrees(AngleUnit.DEGREES.fromUnit(angleUnit, angle));
}
String formatDegrees(double degrees){
return String.format(Locale.getDefault(), "%.1f", AngleUnit.DEGREES.normalize(degrees));
}
public String formatNumber(double d)
{
return String.format("%.2f", d);
}
}
| java |
<filename>front-end/src/profiles/barabash_dmitro_volodimirovich.json
{"Department":"Генеральна Прокуратура України","Region":"Загальнодержавний","Position":"Прокурор відділу нагляду за додержанням законів при проваджені оперативно-розшукової діяльності, досудового розслідування та підтриманням державного обвинувачення управління нагляду за додержанням законів органами Державної фіскальної служби України Департаменту нагляду за додержанням законів у кримінальному провадженні та координації правоохоронної діяльності Генеральної прокуратури України","Name":"<NAME>","Декларації 2013":"","Декларації 2014":"","Декларації 2015":"https://public.nazk.gov.ua/declaration/ca230145-2bde-4daa-a379-7b47c2119227","Декларації 2016":"https://public.nazk.gov.ua/declaration/24ea2ab6-1f38-4718-a8c0-336ac9abc96d","Фото":"","Як живе":"","Декларації доброчесності":"http://www.gp.gov.ua/integrity_profile/files/82b37a157473f62a7e8a8a0e73a1d09d.pdf","type":"prosecutor","key":"barabash_dmitro_volodimirovich","analytics":[{"y":2015,"fi":154653,"fc":1,"ff":0.24,"ffa":1},{"y":2016,"i":238225,"c":1,"k":24.09,"ka":1,"fi":486269,"fc":1,"ff":96.6,"ffa":3},{"y":2017,"i":457894,"c":1,"k":24.09,"ka":1,"fi":132647,"fc":2,"ff":63,"ffa":1}],"declarationsLinks":[{"id":"nacp_ca230145-2bde-4daa-a379-7b47c2119227","year":2015,"provider":"declarations.com.ua.opendata"},{"id":"nacp_5fdeb8c0-37c5-41a4-b46c-5d2e359a1f8c","year":2016,"provider":"declarations.com.ua.opendata"},{"id":"nacp_eb5942ed-5218-486a-89e2-f821e396c8be","year":2017,"provider":"declarations.com.ua.opendata"}]} | json |
Kolkata, Jan 22: A woman was allegedly molested inside an empty women’s compartment of a running local train near Dumdum station in West Bengal’s North 24 Parganas district, a senior official of the Eastern Railway said. On the basis of a complaint, the GRP and RPF arrested a 32-year-old man on Saturday evening for his alleged involvement in the incident, he said.
The accused, a resident of Rahara in North 24 Parganas district, was booked under IPC sections 323 (voluntarily causing hurt) and 354 (Assault or criminal force to woman with intent to outrage her modesty). The victim, who is a tattoo artist, video-recorded the man using her mobile phone which helped the railway police personnel identify and arrest him.
“The GRP and the RPF jointly arrested the accused. They checked the video grab made by the woman as well as CCTV footage to identify the accused man," the official said. The woman in her late 20s had boarded the Santipur-Sealdah train from Phulia in Nadia district on Friday at around 6. 30 pm. it reached Dumdum, there was no other passenger in that women’s compartment and the accused got into it in that station. She started a Facebook Live session when the man allegedly demanded money from her and touched her inappropriately.
As per the complaint lodged by the victim at the Dumdum GRP, the man had got down at Sealdah, the next station the train stopped after Dumdum.
Read all the Latest India News here(This story has not been edited by News18 staff and is published from a syndicated news agency feed - PTI) | english |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.