$.ajax({
xhr: function() {
var xhr = new window.XMLHttpRequest();
xhr.addEventListener("progress", function(evt) {
if (evt.lengthComputable) {
var percentComplete = evt.loaded / evt.total;
//Do something with download progress
}
}, false);
return xhr;
},
type: 'POST',
url: "/",
data: {},
success: function(data){
//Do something on success
}
});
mov ah, al
int 20h
mov ax, 0h
push cx
if(random.NextDouble() <= 0.8){
//из questionList
}
else{
//из sentenceList
}
как описать две функции, которые принимают и возвращают подобные tuple?там точно решена
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace experience_with_tuples
{
class Program
{
static void Main(string[] args)
{
var t = (1, "test", true);
ConOut_tuple(job_with_tuple(t));
// хотя можно и так. но не забываем про скобки
ConOut_tuple(job_with_tuple((1, "test", true)));
}
static (int, string, bool) job_with_tuple((int, string, bool) t)
{
(var i, var s, var b) = t;
i++;
s += " successful";
b = !b;
return (i, s, b);
}
static void ConOut_tuple((int, string, bool) t) =>
Console.WriteLine(
t.Item1 + Environment.NewLine +
t.Item2 + Environment.NewLine +
$"detected errors: {t.Item3}"
);
}
}
public (int, int) MovePoint(int x, int y)
{
// bla-bla-bla
// изменения x, y
return (x, y);
}
...
(var newX, var newY) = MovePoint(oldX, oldY);