Turecko-americká vycházející matematická hvězda Levent Alpöge ze společnosti Anthropic vyvolal pozdvižení oznámením (PDF), že s pomocí superinteligence Claude od Antropicu dokázal vyřešit jeden ze sedmi největších matematických problémů tisíciletí, slavnou Riemannovu hypotézu (prvočísla se mezi čísly objevují zdánlivě nepravidelně, hypotéza tvrdí, že za jejich rozmístěním je určitý řád). Svůj důkaz uvolnil jako open-source
… více »
var start = function () {
isRuns = true;
$('#pageMainImgDiv').hide();
nahravej();
};
var stop = function () {
// vynechan dialog ohledne ukonceni a dalsi akce ohledne manipulace s prvky na html strance
isRuns = false;
$('#pageMainImgDiv').show();
};
var nahravej = function () {
var timing = 5000;
var newSrc = "mujImage.png";
var img = new Image();
img.src = 'images/' + newSrc;
img.onload = function () {
var canvas = document.getElementById('mainCanvas');
var context = canvas.getContext('2d');
context.canvas.width = window.innerWidth;
context.canvas.height = window.innerHeight;
var x = (canvas.width - img.width ) * 0.5;
var y = (canvas.height - img.height) * 0.5;
img.width = img.width * 0.50;
img.height = img.height * 0.50;
context.drawImage(img, x, y);
if (isRuns) {
setTimeout(function () {
console.log('Probiha timer');
context.clearRect(0, 0, canvas.width, canvas.height);
var res = prompt("Vlož čas", "5");
if (isNaN(res)) {
alert('Chyba není číslo!');
} else {
console.log('Vlozeno ' + res);
nahravej();
}
}, timing);
}else {
context.clearRect(0, 0, canvas.width, canvas.height);
}
};
}
};
Řešení dotazu:
var id=window.setTimeout(...);S tým id sa to potom dá zrušiť volaním clearTimeout():
window.clearTimeout(id);
Tiskni
Sdílej: