Instantly share code, notes, and snippets.

View rest.js
function urlMaker(urls) {
var results = [];
return new Promise((res, rej) => {
for (var i = 0; i < urls.length; i++) {
request(urls[i]).then(r => results.push(r));
while(1) {
if (result.length === i+1) {
break;
}
}
View maind.js
function request(url) {
return new Promise((res, rej) => {
const delayTime = Math.floor(Math.random() * 10000) + 1;
setTimeout(() => res(url), delayTime);
});
}
function reqUrls(args) {
return new Promise((resolve, reject) => {
View main.js
function log(a) {
console.log(a);
}
function debounce(func, time) {
var timer = null;
return function (a) {
new Promise((resolve, reject) => {
if (timer) {
clearTimeout(timer);
View main.js
(function () {
// task 1
function log(a) {
console.log(a);
}
function debounce(func, time) {
var timeId = null;
return function (a) {
if (timeId) {
View InfSum15.cpp
#include "pch.h"
#include <iostream>
#include <stdio.h>
#include <windows.h>
#include <math.h>
double myFact(int n);
int main()
{
View InfSum12.cpp
#include "pch.h"
#include <iostream>
#include <stdio.h>
#include <windows.h>
#include <math.h>
double myFact(int n);
int main()
{
View InfSum9.cpp
#include "pch.h"
#include <iostream>
#include <stdio.h>
#include <windows.h>
#include <math.h>
double myFact(int n);
int main()
{
View FactSum15.cpp
#include "pch.h"
#include <stdio.h>
#include <windows.h>
#include <math.h>
#include <iostream>
double myFact(int n);
int main()
{
View FactSum12.cpp
#include "pch.h"
#include <stdio.h>
#include <windows.h>
#include <math.h>
double myFact(int n);
int main()
{
SetConsoleOutputCP(1251);
View FactSum9.cpp
#include "pch.h"
#include <stdio.h>
#include <windows.h>
#include <math.h>
double myFact(int n);
int main()
{
double x, sum = 0, ctg, min, fac;