<br />
<font size='1'><table class='xdebug-error xe-notice' dir='ltr' border='1' cellspacing='0' cellpadding='1'>
<tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> Notice: Undefined index: host in /srv/SaraFannTest/public/index.php on line <i>33</i></th></tr>
<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>
<tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr>
<tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='center'>0.0001</td><td bgcolor='#eeeeec' align='right'>356992</td><td bgcolor='#eeeeec'>{main}( )</td><td title='/srv/SaraFannTest/public/index.php' bgcolor='#eeeeec'>.../index.php<b>:</b>0</td></tr>
</table></font>
<br />
<font size='1'><table class='xdebug-error xe-notice' dir='ltr' border='1' cellspacing='0' cellpadding='1'>
<tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> Notice: Undefined index: scheme in /srv/SaraFannTest/public/index.php on line <i>34</i></th></tr>
<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>
<tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr>
<tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='center'>0.0001</td><td bgcolor='#eeeeec' align='right'>356992</td><td bgcolor='#eeeeec'>{main}( )</td><td title='/srv/SaraFannTest/public/index.php' bgcolor='#eeeeec'>.../index.php<b>:</b>0</td></tr>
</table></font>
<template id="picture-template" style="display: none">
<a href="">
<img src="" width="182" height="182" class="pictures">
</a>
</template>
<div id="place"></div>
const template = document.querySelector('#picture-template').content;
const place = document.querySelector('#place')
const pictures = template.querySelector('.pictures');
for (let i = 1; i<25; i++ ) {
const pictureClone = pictures.cloneNode(true);
pictureClone.setAttribute('src', 'photos/' + i + '.jpg');
place.appendChild(pictureClone);
}
function findAll(haystack, needle) {
const str = haystack.toLowerCase();
const target = needle.toLowerCase();
const r = [];
let z;
for(let i = 0; i <= str.length; i++) {
if(!~(z = str.indexOf(target, i))) break;
r.push(z);
i = z + needle.length;
}
return r.length ? r : false;
}
function findAllTwo(str, target) {
let position = 0, z,
result = [];
while (~(z = str.indexOf(target, position))) {
result.push(z);
position = z + target.length;
}
return result;
}
for( let i = 0; ~(z = str.indexOf(target, i)); i++)
но это нечитабельно build:
context: .
args:
APP_HOME: $APP_HOME
data: function () {
return {
order: {
param: 'default state'
},
}
},
initOrder() {
return HTTP.get('/orders/id=' + this.$route.params.id)
.then((response) => {
this.loaded = true;
this.order = response.data;
});
},
this.initOrder().then(this.initOptions);
async initOrder()
ну и переписав его как асинк-функцию. let perm = true;
const delay = 1000;
socket.on("notify", function (data) {
if (!perm) return;
perm = false;
setTimeout(() => perm = true, delay);
// here do actions
});
> (1e+21 / 100).toFixed(2)
'10000000000000000000.00'
> (1e+21 / 10).toFixed(2)
'100000000000000000000.00'
> (1e+21 / 1).toFixed(2)
'1e+21'
const time = "06:56 30.3.18"
function parseDate(dateString) {
if (!dateString) return new Date();
const regexp = /(\d+):(\d+)\s(\d+).(\d+).(\d+)/;
if(!regexp.test(dateString)) throw new Error('date string format error');
const d =regexp.exec(dateString);
if (d[5].length == 2) d[5] = `20${d[5]}`;
return new Date(d[5], d[4] - 1, d[3], d[1], d[2]);
}
const date1 = new Date(2018, 2, 30, 6, 56);
const date2 = parseDate(time);
console.assert(date1.getTime() == date2.getTime());