{ // 获取包含Hugging Face文本的span元素 const spans = link.querySelectorAll('span.whitespace-nowrap, span.hidden.whitespace-nowrap'); spans.forEach(span => { if (span.textContent && span.textContent.trim().match(/Hugging\s*Face/i)) { span.textContent = 'AI快站'; } }); }); // 替换logo图片的alt属性 document.querySelectorAll('img[alt*="Hugging"], img[alt*="Face"]').forEach(img => { if (img.alt.match(/Hugging\s*Face/i)) { img.alt = 'AI快站 logo'; } }); } // 替换导航栏中的链接 function replaceNavigationLinks() { // 已替换标记,防止重复运行 if (window._navLinksReplaced) { return; } // 已经替换过的链接集合,防止重复替换 const replacedLinks = new Set(); // 只在导航栏区域查找和替换链接 const headerArea = document.querySelector('header') || document.querySelector('nav'); if (!headerArea) { return; } // 在导航区域内查找链接 const navLinks = headerArea.querySelectorAll('a'); navLinks.forEach(link => { // 如果已经替换过,跳过 if (replacedLinks.has(link)) return; const linkText = link.textContent.trim(); const linkHref = link.getAttribute('href') || ''; // 替换Spaces链接 - 仅替换一次 if ( (linkHref.includes('/spaces') || linkHref === '/spaces' || linkText === 'Spaces' || linkText.match(/^s*Spacess*$/i)) && linkText !== 'OCR模型免费转Markdown' && linkText !== 'OCR模型免费转Markdown' ) { link.textContent = 'OCR模型免费转Markdown'; link.href = 'https://fast360.xyz'; link.setAttribute('target', '_blank'); link.setAttribute('rel', 'noopener noreferrer'); replacedLinks.add(link); } // 删除Posts链接 else if ( (linkHref.includes('/posts') || linkHref === '/posts' || linkText === 'Posts' || linkText.match(/^s*Postss*$/i)) ) { if (link.parentNode) { link.parentNode.removeChild(link); } replacedLinks.add(link); } // 替换Docs链接 - 仅替换一次 else if ( (linkHref.includes('/docs') || linkHref === '/docs' || linkText === 'Docs' || linkText.match(/^s*Docss*$/i)) && linkText !== '模型下载攻略' ) { link.textContent = '模型下载攻略'; link.href = '/'; replacedLinks.add(link); } // 删除Enterprise链接 else if ( (linkHref.includes('/enterprise') || linkHref === '/enterprise' || linkText === 'Enterprise' || linkText.match(/^s*Enterprises*$/i)) ) { if (link.parentNode) { link.parentNode.removeChild(link); } replacedLinks.add(link); } }); // 查找可能嵌套的Spaces和Posts文本 const textNodes = []; function findTextNodes(element) { if (element.nodeType === Node.TEXT_NODE) { const text = element.textContent.trim(); if (text === 'Spaces' || text === 'Posts' || text === 'Enterprise') { textNodes.push(element); } } else { for (const child of element.childNodes) { findTextNodes(child); } } } // 只在导航区域内查找文本节点 findTextNodes(headerArea); // 替换找到的文本节点 textNodes.forEach(node => { const text = node.textContent.trim(); if (text === 'Spaces') { node.textContent = node.textContent.replace(/Spaces/g, 'OCR模型免费转Markdown'); } else if (text === 'Posts') { // 删除Posts文本节点 if (node.parentNode) { node.parentNode.removeChild(node); } } else if (text === 'Enterprise') { // 删除Enterprise文本节点 if (node.parentNode) { node.parentNode.removeChild(node); } } }); // 标记已替换完成 window._navLinksReplaced = true; } // 替换代码区域中的域名 function replaceCodeDomains() { // 特别处理span.hljs-string和span.njs-string元素 document.querySelectorAll('span.hljs-string, span.njs-string, span[class*="hljs-string"], span[class*="njs-string"]').forEach(span => { if (span.textContent && span.textContent.includes('huggingface.co')) { span.textContent = span.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } }); // 替换hljs-string类的span中的域名(移除多余的转义符号) document.querySelectorAll('span.hljs-string, span[class*="hljs-string"]').forEach(span => { if (span.textContent && span.textContent.includes('huggingface.co')) { span.textContent = span.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } }); // 替换pre和code标签中包含git clone命令的域名 document.querySelectorAll('pre, code').forEach(element => { if (element.textContent && element.textContent.includes('git clone')) { const text = element.innerHTML; if (text.includes('huggingface.co')) { element.innerHTML = text.replace(/huggingface.co/g, 'aifasthub.com'); } } }); // 处理特定的命令行示例 document.querySelectorAll('pre, code').forEach(element => { const text = element.innerHTML; if (text.includes('huggingface.co')) { // 针对git clone命令的专门处理 if (text.includes('git clone') || text.includes('GIT_LFS_SKIP_SMUDGE=1')) { element.innerHTML = text.replace(/huggingface.co/g, 'aifasthub.com'); } } }); // 特别处理模型下载页面上的代码片段 document.querySelectorAll('.flex.border-t, .svelte_hydrator, .inline-block').forEach(container => { const content = container.innerHTML; if (content && content.includes('huggingface.co')) { container.innerHTML = content.replace(/huggingface.co/g, 'aifasthub.com'); } }); // 特别处理模型仓库克隆对话框中的代码片段 try { // 查找包含"Clone this model repository"标题的对话框 const cloneDialog = document.querySelector('.svelte_hydration_boundary, [data-target="MainHeader"]'); if (cloneDialog) { // 查找对话框中所有的代码片段和命令示例 const codeElements = cloneDialog.querySelectorAll('pre, code, span'); codeElements.forEach(element => { if (element.textContent && element.textContent.includes('huggingface.co')) { if (element.innerHTML.includes('huggingface.co')) { element.innerHTML = element.innerHTML.replace(/huggingface.co/g, 'aifasthub.com'); } else { element.textContent = element.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } } }); } // 更精确地定位克隆命令中的域名 document.querySelectorAll('[data-target]').forEach(container => { const codeBlocks = container.querySelectorAll('pre, code, span.hljs-string'); codeBlocks.forEach(block => { if (block.textContent && block.textContent.includes('huggingface.co')) { if (block.innerHTML.includes('huggingface.co')) { block.innerHTML = block.innerHTML.replace(/huggingface.co/g, 'aifasthub.com'); } else { block.textContent = block.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } } }); }); } catch (e) { // 错误处理但不打印日志 } } // 当DOM加载完成后执行替换 if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', () => { replaceHeaderBranding(); replaceNavigationLinks(); replaceCodeDomains(); // 只在必要时执行替换 - 3秒后再次检查 setTimeout(() => { if (!window._navLinksReplaced) { console.log('[Client] 3秒后重新检查导航链接'); replaceNavigationLinks(); } }, 3000); }); } else { replaceHeaderBranding(); replaceNavigationLinks(); replaceCodeDomains(); // 只在必要时执行替换 - 3秒后再次检查 setTimeout(() => { if (!window._navLinksReplaced) { console.log('[Client] 3秒后重新检查导航链接'); replaceNavigationLinks(); } }, 3000); } // 增加一个MutationObserver来处理可能的动态元素加载 const observer = new MutationObserver(mutations => { // 检查是否导航区域有变化 const hasNavChanges = mutations.some(mutation => { // 检查是否存在header或nav元素变化 return Array.from(mutation.addedNodes).some(node => { if (node.nodeType === Node.ELEMENT_NODE) { // 检查是否是导航元素或其子元素 if (node.tagName === 'HEADER' || node.tagName === 'NAV' || node.querySelector('header, nav')) { return true; } // 检查是否在导航元素内部 let parent = node.parentElement; while (parent) { if (parent.tagName === 'HEADER' || parent.tagName === 'NAV') { return true; } parent = parent.parentElement; } } return false; }); }); // 只在导航区域有变化时执行替换 if (hasNavChanges) { // 重置替换状态,允许再次替换 window._navLinksReplaced = false; replaceHeaderBranding(); replaceNavigationLinks(); } }); // 开始观察document.body的变化,包括子节点 if (document.body) { observer.observe(document.body, { childList: true, subtree: true }); } else { document.addEventListener('DOMContentLoaded', () => { observer.observe(document.body, { childList: true, subtree: true }); }); } })(); \n\n\n"}}},{"rowIdx":904,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a Go program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid Go code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical Go concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., goroutines, interfaces). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching Go. It should be similar to a school exercise, a tutorial, or a Go course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching Go. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\npackage api\n\ntype NotifierApi interface {\n\tNotify(Target string, Message string) (StatusCode int, Error error)\n}\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"go"},"label":{"kind":"number","value":3,"string":"3"},"text":{"kind":"string","value":"package api\n\ntype NotifierApi interface {\n\tNotify(Target string, Message string) (StatusCode int, Error error)\n}\n"}}},{"rowIdx":905,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a C++ program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid C++ code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical C++ concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., memory management). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching C++. It should be similar to a school exercise, a tutorial, or a C++ course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching C++. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\n/*\n * Settlers3D - Copyright (C) 2001-2003 ()\n * \n * This program is free software; you can redistribute it and/or modify it \n * under the terms of the GNU General Public License as published by the Free \n * Software Foundation; either version 2 of the License, or (at your option) \n * any later version.\n * \n * This program is distributed in the hope that it will be useful, but \n * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY \n * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License \n * for more details.\n */\n\n#include \"stdafx.h\"\n#include \"AIUnit.h\"\n#include \"defineGame.h\"\n\n//conditional includes\n#ifndef AI_DLL\n#include \"settlers.h\"\n#endif\n\n#ifdef _DEBUG\n#undef THIS_FILE\nstatic char THIS_FILE[]=__FILE__;\n#define new DEBUG_NEW\n#endif\n\nIMPLEMENT_SERIAL(CAIUnit, CObject, 1)\n\n//////////////////////////////////////////////////////////////////////\n// constructor\n//////////////////////////////////////////////////////////////////////\nCAIUnit::CAIUnit()\n{\n\tint i;\n\n\t//no ID yet\n\tm_uiID = 0;\n\n\t//no style yet\n\tm_iStyle = AI_STYLE_DEFAULT;\n\n\t//reset all weights\n\tfor(i = 0; i < RES_SIZE; i++)\n\t{\n\t\tm_dWeights[i] = 1.0;\n\t}\n\n\t//repeat multiplier\n\tm_dRepeatMult = 1.0;\n}\n\n//////////////////////////////////////////////////////////////////////\n// copy constructor\n//////////////////////////////////////////////////////////////////////\nCAIUnit::CAIUnit(const CAIUnit &data)\n{\n\tcopy(data);\n}\n\n//////////////////////////////////////////////////////////////////////\n// destructor\n//////////////////////////////////////////////////////////////////////\nCAIUnit::~CAIUnit()\n{\n\n}\n\n//////////////////////////////////////////////////////////////////////\n// assignment operator\n//////////////////////////////////////////////////////////////////////\nCAIUnit &CAIUnit::operator =(const CAIUnit &data)\n{\n\tcopy(data);\n\n\treturn *this;\n}\n\n//////////////////////////////////////////////////////////////////////\n// streamline copy function\n///////////\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"cpp"},"label":{"kind":"number","value":2,"string":"2"},"text":{"kind":"string","value":"/*\n * Settlers3D - Copyright (C) 2001-2003 ()\n * \n * This program is free software; you can redistribute it and/or modify it \n * under the terms of the GNU General Public License as published by the Free \n * Software Foundation; either version 2 of the License, or (at your option) \n * any later version.\n * \n * This program is distributed in the hope that it will be useful, but \n * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY \n * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License \n * for more details.\n */\n\n#include \"stdafx.h\"\n#include \"AIUnit.h\"\n#include \"defineGame.h\"\n\n//conditional includes\n#ifndef AI_DLL\n#include \"settlers.h\"\n#endif\n\n#ifdef _DEBUG\n#undef THIS_FILE\nstatic char THIS_FILE[]=__FILE__;\n#define new DEBUG_NEW\n#endif\n\nIMPLEMENT_SERIAL(CAIUnit, CObject, 1)\n\n//////////////////////////////////////////////////////////////////////\n// constructor\n//////////////////////////////////////////////////////////////////////\nCAIUnit::CAIUnit()\n{\n\tint i;\n\n\t//no ID yet\n\tm_uiID = 0;\n\n\t//no style yet\n\tm_iStyle = AI_STYLE_DEFAULT;\n\n\t//reset all weights\n\tfor(i = 0; i < RES_SIZE; i++)\n\t{\n\t\tm_dWeights[i] = 1.0;\n\t}\n\n\t//repeat multiplier\n\tm_dRepeatMult = 1.0;\n}\n\n//////////////////////////////////////////////////////////////////////\n// copy constructor\n//////////////////////////////////////////////////////////////////////\nCAIUnit::CAIUnit(const CAIUnit &data)\n{\n\tcopy(data);\n}\n\n//////////////////////////////////////////////////////////////////////\n// destructor\n//////////////////////////////////////////////////////////////////////\nCAIUnit::~CAIUnit()\n{\n\n}\n\n//////////////////////////////////////////////////////////////////////\n// assignment operator\n//////////////////////////////////////////////////////////////////////\nCAIUnit &CAIUnit::operator =(const CAIUnit &data)\n{\n\tcopy(data);\n\n\treturn *this;\n}\n\n//////////////////////////////////////////////////////////////////////\n// streamline copy function\n//////////////////////////////////////////////////////////////////////\nvoid CAIUnit::copy(const CAIUnit &data)\n{\n\t//AI name\n\tm_strName\t\t\t= data.m_strName;\n\n\t//AI player ID\n\tm_uiID\t\t\t\t= data.m_uiID;\n\n\t//playing style\n\tm_iStyle\t\t\t= data.m_iStyle;\n}\n\n//////////////////////////////////////////////////////////////////////\n// save or load this puppy\n//////////////////////////////////////////////////////////////////////\nvoid CAIUnit::Serialize(CArchive &ar)\n{\n\t//save information\n\tif(ar.IsStoring())\n\t{\n\t\tsave(ar);\n\t}\n\t//load information\n\telse\n\t{\n\t\tload(ar);\n\t}\n}\n\n//////////////////////////////////////////////////////////////////////\n// load data\n//////////////////////////////////////////////////////////////////////\nvoid CAIUnit::load(CArchive &ar)\n{\n\t//name\n\tar >> m_strName;\n\n\t//AI player ID\n\tar >> m_uiID;\n\n\t//playing style\n\tar >> m_iStyle;\n}\n\n//////////////////////////////////////////////////////////////////////\n// save data\n//////////////////////////////////////////////////////////////////////\nvoid CAIUnit::save(CArchive &ar)\n{\n\t//name\n\tar << m_strName;\n\n\t//AI player ID\n\tar << m_uiID;\n\n\t//playing style\n\tar << m_iStyle;\n}\n\n//////////////////////////////////////////////////////////////////////\n// set the AI playing style\n//////////////////////////////////////////////////////////////////////\nvoid CAIUnit::addStyle(int iStyle)\n{\n\t//set style\n\tm_iStyle |= iStyle;\n\n\t//set weights\n\tswitch(iStyle)\n\t{\n\tcase AI_STYLE_CITIES:\n\t\tm_dWeights[RES_TIMBER]\t\t*= 0.5f;\n\t\tm_dWeights[RES_WHEAT]\t\t*= 0.9f;\n\t\tm_dWeights[RES_ORE]\t\t\t*= 1.0f;\n\t\tm_dWeights[RES_CLAY]\t\t*= 0.5f;\n\t\tm_dWeights[RES_SHEEP]\t\t*= 0.5f;\n\t\tm_dWeights[RES_DESERT]\t\t*= 0.0f;\n\t\tm_dWeights[RES_OCEAN]\t\t*= 0.0f;\n\t\tm_dWeights[RES_PORT3]\t\t*= 0.5f;\n\t\tm_dWeights[RES_PORTTIMBER]\t*= 0.3f;\n\t\tm_dWeights[RES_PORTWHEAT]\t*= 0.3f;\n\t\tm_dWeights[RES_PORTORE]\t\t*= 0.3f;\n\t\tm_dWeights[RES_PORTCLAY]\t*= 0.3f;\n\t\tm_dWeights[RES_PORTSHEEP]\t*= 0.3f;\n\t\tm_dWeights[RES_GOLD]\t\t*= 1.0f;\n\t\tm_dRepeatMult *= 1.1f;\n\t\tbreak;\n\tcase AI_STYLE_EXPAND:\n\t\tm_dWeights[RES_TIMBER]\t\t*= 0.9f;\n\t\tm_dWeights[RES_WHEAT]\t\t*= 0.7f;\n\t\tm_dWeights[RES_ORE]\t\t\t*= 0.4f;\n\t\tm_dWeights[RES_CLAY]\t\t*= 1.0f;\n\t\tm_dWeights[RES_SHEEP]\t\t*= 0.6f;\n\t\tm_dWeights[RES_DESERT]\t\t*= 0.0f;\n\t\tm_dWeights[RES_OCEAN]\t\t*= 0.0f;\n\t\tm_dWeights[RES_PORT3]\t\t*= 0.5f;\n\t\tm_dWeights[RES_PORTTIMBER]\t*= 0.3f;\n\t\tm_dWeights[RES_PORTWHEAT]\t*= 0.3f;\n\t\tm_dWeights[RES_PORTORE]\t\t*= 0.3f;\n\t\tm_dWeights[RES_PORTCLAY]\t*= 0.3f;\n\t\tm_dWeights[RES_PORTSHEEP]\t*= 0.3f;\n\t\tm_dWeights[RES_GOLD]\t\t*= 1.0f;\n\t\tm_dRepeatMult *= 0.2f;\n\t\tbreak;\n\tcase AI_STYLE_DEV_CARDS:\n\t\tm_dWeights[RES_TIMBER]\t\t*= 0.5f;\n\t\tm_dWeights[RES_WHEAT]\t\t*= 0.8f;\n\t\tm_dWeights[RES_ORE]\t\t\t*= 0.9f;\n\t\tm_dWeights[RES_CLAY]\t\t*= 0.5f;\n\t\tm_dWeights[RES_SHEEP]\t\t*= 0.8f;\n\t\tm_dWeights[RES_DESERT]\t\t*= 0.0f;\n\t\tm_dWeights[RES_OCEAN]\t\t*= 0.0f;\n\t\tm_dWeights[RES_PORT3]\t\t*= 0.5f;\n\t\tm_dWeights[RES_PORTTIMBER]\t*= 0.3f;\n\t\tm_dWeights[RES_PORTWHEAT]\t*= 0.3f;\n\t\tm_dWeights[RES_PORTORE]\t\t*= 0.3f;\n\t\tm_dWeights[RES_PORTCLAY]\t*= 0.3f;\n\t\tm_dWeights[RES_PORTSHEEP]\t*= 0.3f;\n\t\tm_dWeights[RES_GOLD]\t\t*= 1.0f;\n\t\tm_dRepeatMult *= 0.5f;\n\t\tbreak;\n\tcase AI_STYLE_PORTS:\n\t\t//easier to get resources that are more common\n\t\tm_dWeights[RES_TIMBER]\t\t*= 0.6f;\n\t\tm_dWeights[RES_WHEAT]\t\t*= 0.6f;\n\t\tm_dWeights[RES_ORE]\t\t\t*= 0.4f;\n\t\tm_dWeights[RES_CLAY]\t\t*= 0.4f;\n\t\tm_dWeights[RES_SHEEP]\t\t*= 0.6f;\n\t\tm_dWeights[RES_DESERT]\t\t*= 0.0f;\n\t\tm_dWeights[RES_OCEAN]\t\t*= 0.0f;\n\t\tm_dWeights[RES_PORT3]\t\t*= 0.5f;\n\t\tm_dWeights[RES_PORTTIMBER]\t*= 0.8f;\n\t\tm_dWeights[RES_PORTWHEAT]\t*= 0.8f;\n\t\tm_dWeights[RES_PORTORE]\t\t*= 0.8f;\n\t\tm_dWeights[RES_PORTCLAY]\t*= 0.8f;\n\t\tm_dWeights[RES_PORTSHEEP]\t*= 0.8f;\n\t\tm_dWeights[RES_GOLD]\t\t*= 1.0f;\n\t\tm_dRepeatMult *= 2.5f;\n\t\tbreak;\n\t}\n}"}}},{"rowIdx":906,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a Markdown document. Evaluate its educational value, considering both Markdown usage and the content itself. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the document uses basic Markdown syntax correctly (e.g., headers, lists, or emphasis), regardless of content.\n- Add another point if the document's content has some educational value, even if it's basic or limited in scope. The Markdown usage should be correct but might not be diverse.\n- Award a third point if the document demonstrates a good range of Markdown features (e.g., links, images, code blocks) AND the content provides clear, accurate information on a topic. The structure should be logical and easy to follow.\n- Give a fourth point if the document is well-suited for teaching both its subject matter and effective Markdown usage. It should use varied Markdown elements to enhance the presentation of educational content, similar to a well-crafted tutorial or lesson.\n- Grant a fifth point if the document is exceptional both in its use of Markdown and the educational value of its content. It should demonstrate advanced Markdown features (e.g., tables, task lists, footnotes), have an engaging structure, and provide comprehensive, high-quality educational content on its topic. The document should serve as an excellent example of using Markdown for educational purposes.\n\nThe extract:\n# LogsArithmeticProcessor\n\n## Properties\n\nName | Type | Description | Notes\n------------ | ------------- | ------------- | -------------\n**Expression** | Pointer to **string** | Arithmetic operation between one or more log attributes. | \n**IsEnabled** | Pointer to **bool** | Whether or not the processor is enabled. | [optional] [default to false]\n**IsReplaceMissing** | Pointer to **bool** | If &#x60;true&#x60;, it replaces all missing attributes of expression by &#x60;0&#x60;, &#x60;false&#x60; skip the operation if an attribute is missing. | [optional] [default to false]\n**Name** | Pointer to **string** | Name of the processor. | [optional] \n**Target** | Pointer to **string** | Name of the attribute that contains the result of the arithmetic operation. | \n**Type** | Pointer to [**LogsArithmeticProcessorType**](LogsArithmeticProcessorType.md) | | [default to \"arithmetic-processor\"]\n\n## Methods\n\n### NewLogsArithmeticProcessor\n\n`func NewLogsArithmeticProcessor(expression string, target string, type_ LogsArithmeticProcessorType, ) *LogsArithmeticProcessor`\n\nNewLogsArithmeticProcessor instantiates a new LogsArithmeticProcessor object\nThis constructor will assign default values to properties that have it defined,\nand makes sure properties required by API are set, but the set of arguments\nwill change when the set of required properties is changed\n\n### NewLogsArithmeticProcessorWithDefaults\n\n`func NewLogsArithmeticProcessorWithDefaults() *LogsArithmeticProcessor`\n\nNewLogsArithmeticProcessorWithDefaults instantiates a new LogsArithmeticProcessor object\nThis constructor will only assign default values to properties that have it defined,\nbut it doesn't guarantee that properties required by API are set\n\n### GetExpression\n\n`func (o *LogsArithmeticProcessor) GetExpression() string`\n\nGetExpression returns the Expression field if non-nil, zero value otherwise.\n\n### GetExpressionOk\n\n`func (o *LogsArithmeticProcessor) GetExpressionOk() (*string, bool)`\n\nGetExpressionOk returns a tu\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"markdown"},"label":{"kind":"number","value":3,"string":"3"},"text":{"kind":"string","value":"# LogsArithmeticProcessor\n\n## Properties\n\nName | Type | Description | Notes\n------------ | ------------- | ------------- | -------------\n**Expression** | Pointer to **string** | Arithmetic operation between one or more log attributes. | \n**IsEnabled** | Pointer to **bool** | Whether or not the processor is enabled. | [optional] [default to false]\n**IsReplaceMissing** | Pointer to **bool** | If &#x60;true&#x60;, it replaces all missing attributes of expression by &#x60;0&#x60;, &#x60;false&#x60; skip the operation if an attribute is missing. | [optional] [default to false]\n**Name** | Pointer to **string** | Name of the processor. | [optional] \n**Target** | Pointer to **string** | Name of the attribute that contains the result of the arithmetic operation. | \n**Type** | Pointer to [**LogsArithmeticProcessorType**](LogsArithmeticProcessorType.md) | | [default to \"arithmetic-processor\"]\n\n## Methods\n\n### NewLogsArithmeticProcessor\n\n`func NewLogsArithmeticProcessor(expression string, target string, type_ LogsArithmeticProcessorType, ) *LogsArithmeticProcessor`\n\nNewLogsArithmeticProcessor instantiates a new LogsArithmeticProcessor object\nThis constructor will assign default values to properties that have it defined,\nand makes sure properties required by API are set, but the set of arguments\nwill change when the set of required properties is changed\n\n### NewLogsArithmeticProcessorWithDefaults\n\n`func NewLogsArithmeticProcessorWithDefaults() *LogsArithmeticProcessor`\n\nNewLogsArithmeticProcessorWithDefaults instantiates a new LogsArithmeticProcessor object\nThis constructor will only assign default values to properties that have it defined,\nbut it doesn't guarantee that properties required by API are set\n\n### GetExpression\n\n`func (o *LogsArithmeticProcessor) GetExpression() string`\n\nGetExpression returns the Expression field if non-nil, zero value otherwise.\n\n### GetExpressionOk\n\n`func (o *LogsArithmeticProcessor) GetExpressionOk() (*string, bool)`\n\nGetExpressionOk returns a tuple with the Expression field if it's non-nil, zero value otherwise\nand a boolean to check if the value has been set.\n\n### SetExpression\n\n`func (o *LogsArithmeticProcessor) SetExpression(v string)`\n\nSetExpression sets Expression field to given value.\n\n\n### GetIsEnabled\n\n`func (o *LogsArithmeticProcessor) GetIsEnabled() bool`\n\nGetIsEnabled returns the IsEnabled field if non-nil, zero value otherwise.\n\n### GetIsEnabledOk\n\n`func (o *LogsArithmeticProcessor) GetIsEnabledOk() (*bool, bool)`\n\nGetIsEnabledOk returns a tuple with the IsEnabled field if it's non-nil, zero value otherwise\nand a boolean to check if the value has been set.\n\n### SetIsEnabled\n\n`func (o *LogsArithmeticProcessor) SetIsEnabled(v bool)`\n\nSetIsEnabled sets IsEnabled field to given value.\n\n### HasIsEnabled\n\n`func (o *LogsArithmeticProcessor) HasIsEnabled() bool`\n\nHasIsEnabled returns a boolean if a field has been set.\n\n### GetIsReplaceMissing\n\n`func (o *LogsArithmeticProcessor) GetIsReplaceMissing() bool`\n\nGetIsReplaceMissing returns the IsReplaceMissing field if non-nil, zero value otherwise.\n\n### GetIsReplaceMissingOk\n\n`func (o *LogsArithmeticProcessor) GetIsReplaceMissingOk() (*bool, bool)`\n\nGetIsReplaceMissingOk returns a tuple with the IsReplaceMissing field if it's non-nil, zero value otherwise\nand a boolean to check if the value has been set.\n\n### SetIsReplaceMissing\n\n`func (o *LogsArithmeticProcessor) SetIsReplaceMissing(v bool)`\n\nSetIsReplaceMissing sets IsReplaceMissing field to given value.\n\n### HasIsReplaceMissing\n\n`func (o *LogsArithmeticProcessor) HasIsReplaceMissing() bool`\n\nHasIsReplaceMissing returns a boolean if a field has been set.\n\n### GetName\n\n`func (o *LogsArithmeticProcessor) GetName() string`\n\nGetName returns the Name field if non-nil, zero value otherwise.\n\n### GetNameOk\n\n`func (o *LogsArithmeticProcessor) GetNameOk() (*string, bool)`\n\nGetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise\nand a boolean to check if the value has been set.\n\n### SetName\n\n`func (o *LogsArithmeticProcessor) SetName(v string)`\n\nSetName sets Name field to given value.\n\n### HasName\n\n`func (o *LogsArithmeticProcessor) HasName() bool`\n\nHasName returns a boolean if a field has been set.\n\n### GetTarget\n\n`func (o *LogsArithmeticProcessor) GetTarget() string`\n\nGetTarget returns the Target field if non-nil, zero value otherwise.\n\n### GetTargetOk\n\n`func (o *LogsArithmeticProcessor) GetTargetOk() (*string, bool)`\n\nGetTargetOk returns a tuple with the Target field if it's non-nil, zero value otherwise\nand a boolean to check if the value has been set.\n\n### SetTarget\n\n`func (o *LogsArithmeticProcessor) SetTarget(v string)`\n\nSetTarget sets Target field to given value.\n\n\n### GetType\n\n`func (o *LogsArithmeticProcessor) GetType() LogsArithmeticProcessorType`\n\nGetType returns the Type field if non-nil, zero value otherwise.\n\n### GetTypeOk\n\n`func (o *LogsArithmeticProcessor) GetTypeOk() (*LogsArithmeticProcessorType, bool)`\n\nGetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise\nand a boolean to check if the value has been set.\n\n### SetType\n\n`func (o *LogsArithmeticProcessor) SetType(v LogsArithmeticProcessorType)`\n\nSetType sets Type field to given value.\n\n\n\n[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)\n\n\n"}}},{"rowIdx":907,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a Rust program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid Rust code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical Rust concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., ownership, lifetimes). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching Rust. It should be similar to a school exercise, a tutorial, or a Rust course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching Rust. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\nuse std::env::var;\nuse std::fs::File;\nuse std::io::BufReader;\n\n#[allow(dead_code)]\npub fn open_assets_file(name: &str) -> anyhow::Result> {\n let path = format!(\n \"{}/tests/assets/{}\",\n var(\"CARGO_MANIFEST_DIR\").expect(\"No environment value `CARGO_MANIFEST_DIR`\"),\n name\n );\n let file = File::open(path)?;\n return Ok(BufReader::new(file));\n}\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"rust"},"label":{"kind":"number","value":2,"string":"2"},"text":{"kind":"string","value":"use std::env::var;\nuse std::fs::File;\nuse std::io::BufReader;\n\n#[allow(dead_code)]\npub fn open_assets_file(name: &str) -> anyhow::Result> {\n let path = format!(\n \"{}/tests/assets/{}\",\n var(\"CARGO_MANIFEST_DIR\").expect(\"No environment value `CARGO_MANIFEST_DIR`\"),\n name\n );\n let file = File::open(path)?;\n return Ok(BufReader::new(file));\n}\n"}}},{"rowIdx":908,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a Swift program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid Swift code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical Swift concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., protocols, extensions). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching Swift. It should be similar to a school exercise, a tutorial, or a Swift course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching Swift. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\n//\n// yellow1ViewController.swift\n// createPlaylist NightHack4 kwk2020\n//\n// Created by on 7/14/20.\n// Copyright © 2020 . All rights reserved.\n//\n\nimport UIKit\n\nclass yellow1ViewController: UIViewController {\n\n @IBOutlet var yesterday: UIImageView!\n \n @IBOutlet var bbibbi: UIImageView!\n \n @IBOutlet var happiness: UIImageView!\n \n @IBOutlet var nextPage: UIButton!\n \n override func viewDidLoad() {\n super.viewDidLoad()\n yesterday.isHidden = true\n bbibbi.isHidden = true\n happiness.isHidden = true\n nextPage.isHidden = true\n\n // Do any additional setup after loading the view.\n }\n \n\n @IBAction func blockB(_ sender: Any) {\n yesterday.isHidden = false\n bbibbi.isHidden = true\n happiness.isHidden = true\n nextPage.isHidden = false\n }\n \n @IBAction func IU(_ sender: Any) {\n yesterday.isHidden = true\n bbibbi.isHidden = false\n happiness.isHidden = true\n nextPage.isHidden = false\n }\n \n @IBAction func redVelvet(_ sender: Any) {\n yesterday.isHidden = true\n bbibbi.isHidden = true\n happiness.isHidden = false\n nextPage.isHidden = false\n }\n /*\n // MARK: - Navigation\n\n // In a storyboard-based application, you will often want to do a little preparation before navigation\n override func prepare(for segue: UIStoryboardSegue, sender: Any?) {\n // Get the new view controller using segue.destination.\n // Pass the selected object to the new view controller.\n }\n */\n\n}\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"swift"},"label":{"kind":"number","value":2,"string":"2"},"text":{"kind":"string","value":"//\n// yellow1ViewController.swift\n// createPlaylist NightHack4 kwk2020\n//\n// Created by on 7/14/20.\n// Copyright © 2020 . All rights reserved.\n//\n\nimport UIKit\n\nclass yellow1ViewController: UIViewController {\n\n @IBOutlet var yesterday: UIImageView!\n \n @IBOutlet var bbibbi: UIImageView!\n \n @IBOutlet var happiness: UIImageView!\n \n @IBOutlet var nextPage: UIButton!\n \n override func viewDidLoad() {\n super.viewDidLoad()\n yesterday.isHidden = true\n bbibbi.isHidden = true\n happiness.isHidden = true\n nextPage.isHidden = true\n\n // Do any additional setup after loading the view.\n }\n \n\n @IBAction func blockB(_ sender: Any) {\n yesterday.isHidden = false\n bbibbi.isHidden = true\n happiness.isHidden = true\n nextPage.isHidden = false\n }\n \n @IBAction func IU(_ sender: Any) {\n yesterday.isHidden = true\n bbibbi.isHidden = false\n happiness.isHidden = true\n nextPage.isHidden = false\n }\n \n @IBAction func redVelvet(_ sender: Any) {\n yesterday.isHidden = true\n bbibbi.isHidden = true\n happiness.isHidden = false\n nextPage.isHidden = false\n }\n /*\n // MARK: - Navigation\n\n // In a storyboard-based application, you will often want to do a little preparation before navigation\n override func prepare(for segue: UIStoryboardSegue, sender: Any?) {\n // Get the new view controller using segue.destination.\n // Pass the selected object to the new view controller.\n }\n */\n\n}\n"}}},{"rowIdx":909,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a TypeScript program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid TypeScript code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical TypeScript concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., generics, decorators). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching TypeScript. It should be similar to a school exercise, a tutorial, or a TypeScript course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching TypeScript. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\nimport { Injectable } from \"@angular/core\";\nimport { Resolve, ActivatedRouteSnapshot, RouterStateSnapshot } from \"@angular/router\";\nimport { Observable } from \"rxjs/Observable\";\nimport { IProduct } from \"./product\";\nimport { ProductService } from \"./product-service\";\n\n@Injectable()\nexport class ProductListCanResolveGuard implements Resolve\n{\n constructor(private _productService : ProductService){\n\n }\n \n \n\n errorMessage: any;\n resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) \n {\n console.log('ProductListCanResolveGuard.resolve')\n \n \n return this._productService.getProducts();\n \n// return this._productService.getProducts();\n // this._productService.getProducts().map(products=>products);\n \n // this._productService.getProducts()\n // .subscribe(s => {\n // // this.products = s;\n // console.log('got the response');\n // return s;\n // }, e => {\n // console.log('error in ProductListCanResolveGuard.resolve : ' + e);\n // this.errorMessage = e;\n // }\n // // this.errorMessage = e})\n \n // );\n //return this.products;\n\n\n // this._productService.getProducts().map((p)=>{\n // console.log('in map');\n // return p;\n\n // });\n\n // console.log('ProductListCanResolveGuard.resolve after getProducts()');\n\n\n }\n\n}\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"typescript"},"label":{"kind":"number","value":2,"string":"2"},"text":{"kind":"string","value":"\nimport { Injectable } from \"@angular/core\";\nimport { Resolve, ActivatedRouteSnapshot, RouterStateSnapshot } from \"@angular/router\";\nimport { Observable } from \"rxjs/Observable\";\nimport { IProduct } from \"./product\";\nimport { ProductService } from \"./product-service\";\n\n@Injectable()\nexport class ProductListCanResolveGuard implements Resolve\n{\n constructor(private _productService : ProductService){\n\n }\n \n \n\n errorMessage: any;\n resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) \n {\n console.log('ProductListCanResolveGuard.resolve')\n \n \n return this._productService.getProducts();\n \n// return this._productService.getProducts();\n // this._productService.getProducts().map(products=>products);\n \n // this._productService.getProducts()\n // .subscribe(s => {\n // // this.products = s;\n // console.log('got the response');\n // return s;\n // }, e => {\n // console.log('error in ProductListCanResolveGuard.resolve : ' + e);\n // this.errorMessage = e;\n // }\n // // this.errorMessage = e})\n \n // );\n //return this.products;\n\n\n // this._productService.getProducts().map((p)=>{\n // console.log('in map');\n // return p;\n\n // });\n\n // console.log('ProductListCanResolveGuard.resolve after getProducts()');\n\n\n }\n\n}"}}},{"rowIdx":910,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a shell script. Evaluate whether it has a high educational value and could help teach shell scripting. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the script contains valid shell commands, even if it's not educational, like simple system calls or basic file operations.\n- Add another point if the script addresses practical shell scripting concepts (e.g., variables, conditionals), even if it lacks comments.\n- Award a third point if the script is suitable for educational use and introduces key concepts in shell scripting, even if the topic is somewhat advanced (e.g., functions, process management). The script should be well-structured and contain some comments.\n- Give a fourth point if the script is self-contained and highly relevant to teaching shell scripting. It should be similar to a tutorial example or a shell scripting course section, demonstrating good practices in script organization.\n- Grant a fifth point if the script is outstanding in its educational value and is perfectly suited for teaching shell scripting. It should be well-written, easy to understand, and contain step-by-step explanations in comments.\n\nThe extract:\n#!/usr/bin/env bash\n\nenv GOOS=linux GOARCH=amd64 go build -o out/linux_64_my_ip\n\nenv GOOS=windows GOARCH=amd64 go build -o out/windows_64_my_ip.exe\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"shell"},"label":{"kind":"number","value":2,"string":"2"},"text":{"kind":"string","value":"#!/usr/bin/env bash\n\nenv GOOS=linux GOARCH=amd64 go build -o out/linux_64_my_ip\n\nenv GOOS=windows GOARCH=amd64 go build -o out/windows_64_my_ip.exe"}}},{"rowIdx":911,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a Swift program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid Swift code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical Swift concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., protocols, extensions). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching Swift. It should be similar to a school exercise, a tutorial, or a Swift course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching Swift. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\n//\n// RepositoryRequest.swift\n//\n\nimport Foundation\n\nclass RepositoryFactory {\n static let globalDataRepository = GlobalDataRepository()\n static let globalSocketRepostitory = GlobalSocketRepository()\n static let commonRepository = CommonRepository()\n static let transcriptionRepository = TranscriptionRepository()\n}\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"swift"},"label":{"kind":"number","value":1,"string":"1"},"text":{"kind":"string","value":"//\n// RepositoryRequest.swift\n//\n\nimport Foundation\n\nclass RepositoryFactory {\n static let globalDataRepository = GlobalDataRepository()\n static let globalSocketRepostitory = GlobalSocketRepository()\n static let commonRepository = CommonRepository()\n static let transcriptionRepository = TranscriptionRepository()\n}\n"}}},{"rowIdx":912,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a Ruby program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid Ruby code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical Ruby concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., metaprogramming, blocks). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching Ruby. It should be similar to a school exercise, a tutorial, or a Ruby course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching Ruby. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\nrequire 'nokogiri'\nrequire 'pry'\nrequire 'pry-nav'\n\n\nclass Import \n\n def initialize(gpxFile, route_id = nil)\n\n @gpxFile = gpxFile\n @route_id = route_id\n @points = []\n end\n\n def initializer\n parse\n if @route_id\n create_run(@route_id)\n else\n create_route\n create_run(@route.id)\n end \n end\n\n \n private\n\n def parse \n @doc = Nokogiri::XML(File.open(@gpxFile))\n #@doc.xpath(\"//xmlns:trkpt\") returning all data\n trackpoints = @doc.search(\"trkpt\")\n ## parsing xml doc by accessing child arrays in order by position\n trackpoints.each do |trkpt|\n @points << [trkpt.attributes['lat'].value.to_f, trkpt.attributes['lon'].value.to_f, DateTime.parse(trkpt.children[3].children[0].text)]\n end \n end\n\n def create_route_checkpoints\n data_points = []\n checkpoints = []\n\n data_points << @points.first\n last_point = @points.last \n points.drop(1).pop\n @points.slice((@points.length/5).round)\n @points.each do |slice|\n @data_points << slice.last\n end\n data_points << last_point\n\n data_points.each do |point|\n gps_point = GpsPoint.new(latitude: point[0], longitude: point[1], gps_timestamp: point[2])\n gps_point.save\n checkpoints << gps_point \n end\n checkpoints\n end\n\n def create_run_points\n run_points = []\n\n @points.each do |point|\n gps_point = GpsPoint.new(latitude: point[0], longitude: point[1], gps_timestamp: point[2])\n gps_point.save\n run_points << gps_point\n end\n run_points\n end\n\n def create_run(route_id)\n run = Run.new(gps_points: create_run_points, route_id: route_id)\n run.save\n end\n\n def create_route\n # @route= Route.new(gps_points: create_route_checkpoints)\n @route= Route.new()\n # @route = Route.create(gps_points: create_route_checkpoints)\n end\n\nend\n\nnewimport = Import.new(\"LunchRun.gpx\")\nnewimport.initializer\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"ruby"},"label":{"kind":"number","value":3,"string":"3"},"text":{"kind":"string","value":"require 'nokogiri'\nrequire 'pry'\nrequire 'pry-nav'\n\n\nclass Import \n\n def initialize(gpxFile, route_id = nil)\n\n @gpxFile = gpxFile\n @route_id = route_id\n @points = []\n end\n\n def initializer\n parse\n if @route_id\n create_run(@route_id)\n else\n create_route\n create_run(@route.id)\n end \n end\n\n \n private\n\n def parse \n @doc = Nokogiri::XML(File.open(@gpxFile))\n #@doc.xpath(\"//xmlns:trkpt\") returning all data\n trackpoints = @doc.search(\"trkpt\")\n ## parsing xml doc by accessing child arrays in order by position\n trackpoints.each do |trkpt|\n @points << [trkpt.attributes['lat'].value.to_f, trkpt.attributes['lon'].value.to_f, DateTime.parse(trkpt.children[3].children[0].text)]\n end \n end\n\n def create_route_checkpoints\n data_points = []\n checkpoints = []\n\n data_points << @points.first\n last_point = @points.last \n points.drop(1).pop\n @points.slice((@points.length/5).round)\n @points.each do |slice|\n @data_points << slice.last\n end\n data_points << last_point\n\n data_points.each do |point|\n gps_point = GpsPoint.new(latitude: point[0], longitude: point[1], gps_timestamp: point[2])\n gps_point.save\n checkpoints << gps_point \n end\n checkpoints\n end\n\n def create_run_points\n run_points = []\n\n @points.each do |point|\n gps_point = GpsPoint.new(latitude: point[0], longitude: point[1], gps_timestamp: point[2])\n gps_point.save\n run_points << gps_point\n end\n run_points\n end\n\n def create_run(route_id)\n run = Run.new(gps_points: create_run_points, route_id: route_id)\n run.save\n end\n\n def create_route\n # @route= Route.new(gps_points: create_route_checkpoints)\n @route= Route.new()\n # @route = Route.create(gps_points: create_route_checkpoints)\n end\n\nend\n\nnewimport = Import.new(\"LunchRun.gpx\")\nnewimport.initializer \n\n\n\n\n\n\n"}}},{"rowIdx":913,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a Ruby program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid Ruby code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical Ruby concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., metaprogramming, blocks). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching Ruby. It should be similar to a school exercise, a tutorial, or a Ruby course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching Ruby. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\nmodule TagsHelper\n\n def tags_hash\n return @tags_hash if @tags_hash\n @tags_hash = {}\n posts.each do |post|\n post.tags.each do |tag|\n @tags_hash[tag] ||=0\n @tags_hash[tag] += 1\n end if post.tags\n end\n @tags_hash\n end\n \n def write_tags(page)\n output = page.tags.collect do |t|\n \"#{t}\"\n end\n \n output.join(', ')\n end\n \n def posts_with_tag(tag, limit=:all, find_options=nil)\n posts.delete_if { |post| !(post.tags && post.tags.include?(tag)) }\n end\nend\n\nWebby::Helpers.register(TagsHelper)\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"ruby"},"label":{"kind":"number","value":-1,"string":"-1"},"text":{"kind":"string","value":"module TagsHelper\n\n def tags_hash\n return @tags_hash if @tags_hash\n @tags_hash = {}\n posts.each do |post|\n post.tags.each do |tag|\n @tags_hash[tag] ||=0\n @tags_hash[tag] += 1\n end if post.tags\n end\n @tags_hash\n end\n \n def write_tags(page)\n output = page.tags.collect do |t|\n \"#{t}\"\n end\n \n output.join(', ')\n end\n \n def posts_with_tag(tag, limit=:all, find_options=nil)\n posts.delete_if { |post| !(post.tags && post.tags.include?(tag)) }\n end\nend\n\nWebby::Helpers.register(TagsHelper)\n"}}},{"rowIdx":914,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a Java program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid Java code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical Java concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., concurrent programming). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching Java. It should be similar to a school exercise, a tutorial, or a Java course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching Java. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\npackage co.com.edutva.ctl;\n\nimport java.text.SimpleDateFormat;\nimport java.time.Duration;\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.Iterator;\nimport java.util.List;\nimport java.util.Locale;\nimport java.util.Set;\n\nimport org.apache.log4j.Logger;\nimport org.zkoss.zk.ui.Component;\nimport org.zkoss.zk.ui.event.Event;\nimport org.zkoss.zk.ui.event.EventListener;\nimport org.zkoss.zk.ui.event.Events;\nimport org.zkoss.zk.ui.util.GenericForwardComposer;\nimport org.zkoss.zul.Bandbox;\nimport org.zkoss.zul.Button;\nimport org.zkoss.zul.Combobox;\nimport org.zkoss.zul.Comboitem;\nimport org.zkoss.zul.ComboitemRenderer;\nimport org.zkoss.zul.DefaultTreeModel;\nimport org.zkoss.zul.Div;\nimport org.zkoss.zul.Grid;\nimport org.zkoss.zul.Groupbox;\nimport org.zkoss.zul.Intbox;\nimport org.zkoss.zul.Label;\nimport org.zkoss.zul.ListModelList;\nimport org.zkoss.zul.Listbox;\nimport org.zkoss.zul.Listcell;\nimport org.zkoss.zul.Listitem;\nimport org.zkoss.zul.ListitemRenderer;\nimport org.zkoss.zul.Messagebox;\nimport org.zkoss.zul.Row;\nimport org.zkoss.zul.Rows;\nimport org.zkoss.zul.Textbox;\n\n//import co.com.edutva.tva2v616.GenreType;\n//import co.com.edutva.tva2v616.KeywordType;\n//import co.com.edutva.tva2v616.SegmentInformationType;\n\nimport org.zkoss.zul.Tree;\nimport org.zkoss.zul.Treecell;\nimport org.zkoss.zul.Treechildren;\nimport org.zkoss.zul.Treeitem;\nimport org.zkoss.zul.TreeitemRenderer;\nimport org.zkoss.zul.Treerow;\nimport org.zkoss.zul.Window;\n\nimport co.com.edutva.bd.Classification;\nimport co.com.edutva.edutvav1.ControlledTermType;\nimport co.com.edutva.edutvav1.EducationalAudienceType;\nimport co.com.edutva.edutvav1.EducationalContextAttributesType;\nimport co.com.edutva.edutvav1.EducationalResourceType;\nimport co.com.edutva.edutvav1.EducationalResultsType;\nimport co.com.edutva.edutvav1.ExtendedSegmentDescriptionType;\nimport co.com.edutva.edutvav1.GenreType;\nimport co.com.edutva.edutvav1.KeywordType;\nimport co.com.edutva.edutvav1.LanguageType;\nimport co.com.edutva.\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"java"},"label":{"kind":"number","value":1,"string":"1"},"text":{"kind":"string","value":"package co.com.edutva.ctl;\n\nimport java.text.SimpleDateFormat;\nimport java.time.Duration;\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.Iterator;\nimport java.util.List;\nimport java.util.Locale;\nimport java.util.Set;\n\nimport org.apache.log4j.Logger;\nimport org.zkoss.zk.ui.Component;\nimport org.zkoss.zk.ui.event.Event;\nimport org.zkoss.zk.ui.event.EventListener;\nimport org.zkoss.zk.ui.event.Events;\nimport org.zkoss.zk.ui.util.GenericForwardComposer;\nimport org.zkoss.zul.Bandbox;\nimport org.zkoss.zul.Button;\nimport org.zkoss.zul.Combobox;\nimport org.zkoss.zul.Comboitem;\nimport org.zkoss.zul.ComboitemRenderer;\nimport org.zkoss.zul.DefaultTreeModel;\nimport org.zkoss.zul.Div;\nimport org.zkoss.zul.Grid;\nimport org.zkoss.zul.Groupbox;\nimport org.zkoss.zul.Intbox;\nimport org.zkoss.zul.Label;\nimport org.zkoss.zul.ListModelList;\nimport org.zkoss.zul.Listbox;\nimport org.zkoss.zul.Listcell;\nimport org.zkoss.zul.Listitem;\nimport org.zkoss.zul.ListitemRenderer;\nimport org.zkoss.zul.Messagebox;\nimport org.zkoss.zul.Row;\nimport org.zkoss.zul.Rows;\nimport org.zkoss.zul.Textbox;\n\n//import co.com.edutva.tva2v616.GenreType;\n//import co.com.edutva.tva2v616.KeywordType;\n//import co.com.edutva.tva2v616.SegmentInformationType;\n\nimport org.zkoss.zul.Tree;\nimport org.zkoss.zul.Treecell;\nimport org.zkoss.zul.Treechildren;\nimport org.zkoss.zul.Treeitem;\nimport org.zkoss.zul.TreeitemRenderer;\nimport org.zkoss.zul.Treerow;\nimport org.zkoss.zul.Window;\n\nimport co.com.edutva.bd.Classification;\nimport co.com.edutva.edutvav1.ControlledTermType;\nimport co.com.edutva.edutvav1.EducationalAudienceType;\nimport co.com.edutva.edutvav1.EducationalContextAttributesType;\nimport co.com.edutva.edutvav1.EducationalResourceType;\nimport co.com.edutva.edutvav1.EducationalResultsType;\nimport co.com.edutva.edutvav1.ExtendedSegmentDescriptionType;\nimport co.com.edutva.edutvav1.GenreType;\nimport co.com.edutva.edutvav1.KeywordType;\nimport co.com.edutva.edutvav1.LanguageType;\nimport co.com.edutva.edutvav1.MediaRelTimePointType;\nimport co.com.edutva.edutvav1.SegmentInformationType;\nimport co.com.edutva.edutvav1.SynopsisType;\nimport co.com.edutva.edutvav1.TVAMediaTimeType;\nimport co.com.edutva.edutvav1.TermNameType;\nimport co.com.edutva.edutvav1.TextualType;\nimport co.com.edutva.edutvav1.TitleType;\nimport co.com.edutva.ngc.VrblSstmNgc;\nimport co.com.edutva.utl.Constantes;\nimport co.com.edutva.utl.LectorCS;\nimport co.com.edutva.utl.LocaleComparator;\n\n@SuppressWarnings(\"rawtypes\")\npublic class SegmentoCtl extends GenericForwardComposer implements\nComboitemRenderer, TreeitemRenderer, ListitemRenderer {\n\n\t/**\n\t * \n\t */\n\tprivate static final long serialVersionUID = -3416200163129525093L;\n\n\t/**\n\t * Log de la aplicaci&oacute;n (log4j).\n\t */\n\tprivate Logger logger = Logger.getLogger(this.getClass());\n\t\n\tprotected Window winSegmento;\n\tprotected Div divPrincipal;\n\t\n\tprotected Window parentWindow;\n\t\n\tprotected Grid gridView;\n\tprotected Textbox txtViewTituloSgmt;\n\tprotected Textbox txtViewTiempoInicial;\n\tprotected Textbox txtViewTiempoFinal;\n\tprotected Textbox txtViewDescrSgmt;\n\tprotected Textbox txtViewPalabrasClave;\n\tprotected Textbox txtViewGenreSgmt;\n\tprotected Textbox txtViewTipoInteractividadSgmt;\n\tprotected Textbox txtViewTipoRecursoSgmt;\n\tprotected Textbox txtViewEducationalUse;\n\tprotected Textbox txtViewEducationalContext;\n\tprotected Textbox txtViewEducationalRole;\n\tprotected Textbox txtViewAgeRange;\n\tprotected Textbox txtViewLanguage;\n\tprotected Listbox lstbxViewAnnotations;\n\tprotected Textbox txtViewAbilitySgmt;\n\t\n\tprotected Grid gridCreate;\n\tprotected Textbox txtTituloSgmt;\n\tprotected Textbox txtDescrSgmt;\n\tprotected Grid gridPalabrasClaveSgmt;\n\tprotected Tree treesGenreSgmt;\n\tprotected Bandbox cbxIdiomaSgmt;\n\tprotected Intbox ibxInicioSgmtH;\n\tprotected Intbox ibxInicioSgmtM;\n\tprotected Intbox ibxInicioSgmtS;\n\tprotected Intbox ibxFinSgmtH;\n\tprotected Intbox ibxFinSgmtM;\n\tprotected Intbox ibxFinSgmtS;\n\n\t///.----------educativo------------\t\n\tprotected Groupbox grpMetadataEduResource;\n\tprotected Groupbox grpMetadataEduContext;\n\tprotected Groupbox grpMetadataEduAudience;\n\tprotected Groupbox grpMetadataEduAnotation;\n\tprotected Groupbox grpMetadataEduResults;\n\n\tprotected Combobox cbxTipoInteractividad;\n\tprotected Bandbox cbxTipoRecurso;\n\tprotected Listbox lstbxTipoRecurso;\n\tprotected Textbox txtEducationalUse;\n\t\n\tprotected Bandbox cbxEducationalContext;\n\tprotected Listbox lstbxEducationalContext;\n\t\n\tprotected Bandbox cbxEducationalRole;\n\tprotected Listbox lstbxEducationalRole;\n\tprotected Tree treeAgeRange;\n\tprotected Bandbox cbxEduIdioma;\n\tprotected Listbox lstbxEduIdiomas;\n\tprotected Textbox txtEduFiltroIdiomas;\n\t\n\tprotected Listbox lstbxAnnotations;\n\t\n\tprotected Tree treeAbility;\t\n\t\n\tprotected Button btnAceptar;\n\tprotected Button btnCancelar;\t\n\t\n\tprivate SegmentInformationType segment;\n\tpublic List segmentos;\n\t\n\tpublic Set generos;\n\tpublic List idiomas;\n\t\n\tpublic List lstEduAnnotations;\n\tprotected Textbox txtAnnotation;\n\n\tpublic List localesLst;//lista todos los idiomas\n\tpublic List localesEduLstSelect; //lista de los idiomas seleccionados en caract educativas\n\t\t\n\tprivate VrblSstmNgc vrblSstmNgc;\n\t\n\tpublic VrblSstmNgc getVrblSstmNgc() {\n\t\treturn vrblSstmNgc;\n\t}\n\n\tpublic void setVrblSstmNgc(VrblSstmNgc vrblSstmNgc) {\n\t\tthis.vrblSstmNgc = vrblSstmNgc;\n\t}\n\t\n\t\n\t@SuppressWarnings(\"unchecked\")\n\t@Override\n\tpublic void doAfterCompose(Component comp) throws Exception {\n\t\tsuper.doAfterCompose(comp);\t\n\t\tsegment = (SegmentInformationType)execution.getArg().get(\"segment\");\n\t\tsegmentos = (List)execution.getArg().get(\"segmentos\");\n\t\tparentWindow = (Window) execution.getArg().get(\"parentWindow\");\n\t\t\n\t\t//campos para heredar del recurso:\n\t\tgeneros = (Set)execution.getArg().get(\"generos\");\n\t\t//idiomas = (Set)execution.getArg().get(\"idiomas\");\n\t\tidiomas = (List)execution.getArg().get(\"idiomas\");\n\t\t\n\t\tlocalesEduLstSelect = new ArrayList<>();\n\t\t\n\t\tlstEduAnnotations = new ArrayList();\n\t}\n\t\n\t@SuppressWarnings(\"unchecked\")\n\tpublic void onCreate$winSegmento() {\n\t\tif (logger.isDebugEnabled())\n\t\t\tlogger.debug(new StringBuilder(\"Ingresando a crear/ver segmento \")\n\t\t\t\t\t.append(self.getId()));\n\t\ttry {\t\t\n\t\t\tif(segment!=null){\n\t\t\t\tbtnAceptar.setVisible(false);\n\t\t\t\tbtnCancelar.setVisible(false);\n\t\t\t\t\n\t\t\t\twinSegmento.setTitle(new StringBuilder().append(\"Descripción del segmento educativo: \").append(segment.getDescription().getTitle().get(0).getValue()).toString());\n\t\t\t\tgridView.setVisible(true);\n\t\t\t\t\t\t\t\t\n\t\t\t\t//Título\n\t\t\t\ttxtViewTituloSgmt.setValue(segment.getDescription().getTitle().get(0).getValue());\n\t\t\t\t\n\t\t\t\t//Tiempos\n\t\t\t\tDuration tInicio = Duration.parse(segment.getSegmentLocator().getMediaRelTimePoint().getValue());\n\t\t\t\tDuration duration = Duration.parse(segment.getSegmentLocator().getMediaDuration());\n\t\t\t\tDuration tFinal = tInicio.plus(duration);\n\t\t\t\t\n\t\t\t\ttxtViewTiempoInicial.setValue(tInicio.toString().substring(2, tInicio.toString().length()));\n\t\t\t\ttxtViewTiempoFinal.setValue(tFinal.toString().substring(2, tFinal.toString().length()));\n\t\t\t\t\n\t\t\t\t//Descripción\n\t\t\t\ttxtViewDescrSgmt.setValue(segment.getDescription().getSynopsis().get(0).getValue());\n\t\t\t\t\n\t\t\t\t//Palabras clave\n\t\t\t\tStringBuilder keywords = new StringBuilder(64);\n\t\t\t\tfor(KeywordType keyword : segment.getDescription().getKeyword()){\n\t\t\t\t\tkeywords.append(keyword.getValue()).append(\", \");\n\t\t\t\t}\n\t\t\t\ttxtViewPalabrasClave.setValue(keywords.toString().substring(0, keywords.length()-2));\n\t\t\t\t\n\t\t\t\t//Géneros\n\t\t\t\tif(segment.getDescription().getGenre()!=null && !segment.getDescription().getGenre().isEmpty()){\n\t\t\t\t\tStringBuilder genres = new StringBuilder(64);\n\t\t\t\t\tfor(GenreType genre : segment.getDescription().getGenre()){\n\t\t\t\t\t\tgenres.append(genre.getName().getValue()).append(\"\\n\");\n\t\t\t\t\t}\n\t\t\t\t\ttxtViewGenreSgmt.setValue(genres.toString());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tEducationalContextAttributesType educationalAttr = (EducationalContextAttributesType)((ExtendedSegmentDescriptionType)segment.getDescription()).getContextAttributes().get(0);\n\t\t\t\t\n\t\t\t\t//Tipo de interactividad\n\t\t\t\tif(educationalAttr.getEducationalResource().getInteractivityType()!=null ){\n\t\t\t\t\ttxtViewTipoInteractividadSgmt.setValue(educationalAttr.getEducationalResource().getInteractivityType().getName().getValue());\n\t\t\t\t}\n\t\t\t\t//Tipo de recurso\n\t\t\t\tif(educationalAttr.getEducationalResource().getEducationalType()!=null && !educationalAttr.getEducationalResource().getEducationalType().isEmpty()){\n\t\t\t\t\tStringBuilder tipos = new StringBuilder(64);\n\t\t\t\t\tfor(ControlledTermType tipo : educationalAttr.getEducationalResource().getEducationalType()){\n\t\t\t\t\t\ttipos.append(tipo.getName().getValue()).append(\", \");\n\t\t\t\t\t}\n\t\t\t\t\ttxtViewTipoRecursoSgmt.setValue(tipos.substring(0, tipos.length()-2));\n\t\t\t\t}\n\n\t\t\t\t//Uso educativo\n\t\t\t\tif(educationalAttr.getEducationalResource().getEducationalUse()!=null ){\n\t\t\t\t\ttxtViewEducationalUse.setValue(((TextualType)educationalAttr.getEducationalResource().getEducationalUse().get(0)).getValue());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Contexto\n\t\t\t\tif(educationalAttr.getEducationalContext()!=null && !educationalAttr.getEducationalContext().isEmpty()){\n\t\t\t\t\tStringBuilder contextos = new StringBuilder(64);\n\t\t\t\t\tfor(ControlledTermType context : educationalAttr.getEducationalContext()){\n\t\t\t\t\t\tcontextos.append(context.getName().getValue()).append(\", \");\n\t\t\t\t\t}\n\t\t\t\t\ttxtViewEducationalContext.setValue(contextos.substring(0, contextos.length()-2));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Rol de usuario obj\n\t\t\t\tif(educationalAttr.getEducationalAudience().getEducationalRole()!=null && !educationalAttr.getEducationalAudience().getEducationalRole().isEmpty()){\n\t\t\t\t\tStringBuilder roles = new StringBuilder(64);\n\t\t\t\t\tfor(ControlledTermType role : educationalAttr.getEducationalAudience().getEducationalRole()){\n\t\t\t\t\t\troles.append(role.getName().getValue()).append(\", \");\n\t\t\t\t\t}\n\t\t\t\t\ttxtViewEducationalRole.setValue(roles.substring(0, roles.length()-2));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Rango de edad\n\t\t\t\tif(educationalAttr.getEducationalAudience().getTypicalAgeRange()!=null && !educationalAttr.getEducationalAudience().getTypicalAgeRange().isEmpty()){\n\t\t\t\t\tStringBuilder edades = new StringBuilder(64);\n\t\t\t\t\tfor(ControlledTermType edad : educationalAttr.getEducationalAudience().getTypicalAgeRange()){\n\t\t\t\t\t\tedades.append(edad.getName().getValue()).append(\", \");\n\t\t\t\t\t}\n\t\t\t\t\ttxtViewAgeRange.setValue(edades.substring(0, edades.length()-2));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Idioma\n\t\t\t\tif(educationalAttr.getEducationalAudience().getLanguage()!=null && !educationalAttr.getEducationalAudience().getLanguage().isEmpty()){\n\t\t\t\t\tStringBuilder idiomas = new StringBuilder(64);\n\t\t\t\t\tfor(LanguageType idioma : educationalAttr.getEducationalAudience().getLanguage()){\n\t\t\t\t\t\tidiomas.append(idioma.getValue()).append(\", \");\n\t\t\t\t\t}\n\t\t\t\t\ttxtViewLanguage.setValue(idiomas.substring(0, idiomas.length()-2));\n\t\t\t\t}\n\n\t\t\t\t// Anotaciones\n\t\t\t\tif(educationalAttr.getAnnotation()!=null && !educationalAttr.getAnnotation().isEmpty()){\n\t\t\t\t\tListModelList annotationModel = new ListModelList(educationalAttr.getAnnotation());\n\t\t\t\t\tlstbxViewAnnotations.setModel(annotationModel);\n\t\t\t\t\tlstbxViewAnnotations.setItemRenderer(this);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Competencias\n\t\t\t\tif(educationalAttr.getEducationalResults().getAbility()!=null && !educationalAttr.getEducationalResults().getAbility().isEmpty()){\n\t\t\t\t\tStringBuilder abilities = new StringBuilder(64);\n\t\t\t\t\tfor(ControlledTermType ability : educationalAttr.getEducationalResults().getAbility()){\n\t\t\t\t\t\tabilities.append(ability.getName().getValue()).append(\"\\n\");\n\t\t\t\t\t}\n\t\t\t\t\ttxtViewAbilitySgmt.setValue(abilities.toString());\n\t\t\t\t}\n\t\t\t}else {\n\t\t\t\t// TAMAÑO DE LA VENTANA\n//\t\t\t\tdivPrincipal.setHeight(new StringBuilder()\n//\t\t\t\t.append((Integer) session\n//\t\t\t\t\t\t.getAttribute(Constantes.ALTO_ESCRITORIO)-60)\n//\t\t\t\t.append(\"px\").toString());\n\t\t\t\t\n\t\t\t\tgridCreate.setVisible(true);\n\t\t\t\tgrpMetadataEduResource.setVisible(true);\n\t\t\t\tgrpMetadataEduContext.setVisible(true);\n\t\t\t\tgrpMetadataEduAudience.setVisible(true);\n\t\t\t\tgrpMetadataEduAnotation.setVisible(true);\n\t\t\t\tgrpMetadataEduResults.setVisible(true);\n\t\t\t\t\n\t\t\t\t// Lectura de classification schemes\n\t\t\t\tLectorCS lector = new LectorCS();\n\t\t\t\t\n\t\t\t\t// Agrego fila para ingreso de palabras clave en la sección segmento\n\t\t\t\tRows rowsPalabrasClaveSgmt = new Rows();\n\t\t\t\trowsPalabrasClaveSgmt.setParent(gridPalabrasClaveSgmt);\n\t\t\t\tnuevaFilaPalabrasClave(gridPalabrasClaveSgmt);\n\t\t\t\t\n\t\t\t\t// Datos de EducationalUseCS\n\t\t\t\tlector.setClassificationScheme(new StringBuilder(vrblSstmNgc.obtenerVrblSstm(Constantes.RUTA_CLASSIFICATION_SCHEMES)).append(vrblSstmNgc.obtenerVrblSstm(Constantes.CS_EDUCATIONAL_USE)).toString());\n\t\t\t\tListModelList tiposRecEduModel = new ListModelList(lector.getElements());\n\t\t\t\ttiposRecEduModel.setMultiple(true);\n\t\t\t\tlstbxTipoRecurso.setModel(tiposRecEduModel);\n\t\t\t\tlstbxTipoRecurso.setItemRenderer(this);\n\t\t\t\t\n\t\t\t\t// Datos de EducationalContextCS\n\t\t\t\tlector.setClassificationScheme(new StringBuilder(vrblSstmNgc.obtenerVrblSstm(Constantes.RUTA_CLASSIFICATION_SCHEMES)).append(vrblSstmNgc.obtenerVrblSstm(Constantes.CS_EDUCATIONAL_CONTEXT)).toString());\n\t\t\t\tListModelList classificationModelContext = new ListModelList(lector.getElements());\n\t\t\t\tclassificationModelContext.setMultiple(true);\n\t\t\t\tlstbxEducationalContext.setModel(classificationModelContext);\n\t\t\t\tlstbxEducationalContext.setItemRenderer(this);\n\t\t\t\t\n\t\t\t\t// Datos IntendedEducationalUserCS\n\t\t\t\tlector.setClassificationScheme(new StringBuilder(vrblSstmNgc.obtenerVrblSstm(Constantes.RUTA_CLASSIFICATION_SCHEMES)).append(vrblSstmNgc.obtenerVrblSstm(Constantes.CS_INTENDED_EDUCATIONAL_USER)).toString());\n\t\t\t\tListModelList educationalRoleModel = new ListModelList(lector.getElements());\n\t\t\t\teducationalRoleModel.setMultiple(true);\n\t\t\t\tlstbxEducationalRole.setModel(educationalRoleModel);\n\t\t\t\tlstbxEducationalRole.setItemRenderer(this);\n\t\t\t\t\n\t\t\t\t// Datos de AbilityCS\n\t\t\t\tlector.setClassificationScheme(new StringBuilder(vrblSstmNgc.obtenerVrblSstm(Constantes.RUTA_CLASSIFICATION_SCHEMES)).append(vrblSstmNgc.obtenerVrblSstm(Constantes.CS_ABILITY)).toString());\n\t\t\t\tClassificationTreeNode rootNodeAbility = new ClassificationTreeNode(null); \n\t\t\t\textractClasificationTreeNode(lector.getElements(), rootNodeAbility);\t\n\t\t\t\tDefaultTreeModel classificationModelAbility = new DefaultTreeModel(rootNodeAbility);\n\t\t\t\tclassificationModelAbility.setMultiple(true);\n\t\t\t\ttreeAbility.setModel(classificationModelAbility);\n\t\t\t\ttreeAbility.setItemRenderer(this);\n\t\t\t\t\n\t\t\t\t// Datos de AgeRangeCS\n\t\t\t\tlector.setClassificationScheme(new StringBuilder(vrblSstmNgc.obtenerVrblSstm(Constantes.RUTA_CLASSIFICATION_SCHEMES)).append(vrblSstmNgc.obtenerVrblSstm(Constantes.CS_AGE_RANGE)).toString());\n\t\t\t\tClassificationTreeNode rootNodeAgeRange = new ClassificationTreeNode(null); \n\t\t\t\textractClasificationTreeNode(lector.getElements(), rootNodeAgeRange);\t\n\t\t\t\tDefaultTreeModel classificationModelAgeRange = new DefaultTreeModel(rootNodeAgeRange);\n\t\t\t\tclassificationModelAgeRange.setMultiple(true);\n\t\t\t\ttreeAgeRange.setModel(classificationModelAgeRange);\n\t\t\t\ttreeAgeRange.setItemRenderer(this);\n\t\t\t\t\n\t\t\t\t// Datos InteractivityCS\n\t\t\t\tlector.setClassificationScheme(new StringBuilder(vrblSstmNgc.obtenerVrblSstm(Constantes.RUTA_CLASSIFICATION_SCHEMES)).append(vrblSstmNgc.obtenerVrblSstm(Constantes.CS_INTERACTIVITY_TYPE)).toString());\n\t\t\t\tListModelList interactivityType = new ListModelList(lector.getElements());\n\t\t\t\tcbxTipoInteractividad.setModel(interactivityType);\n\t\t\t\tcbxTipoInteractividad.setItemRenderer(this);\n\t\t\t\t\t\t\t\t\n\t\t\t\t// Árbol que contiene los géneros definidos en el estándar TVA\n\t\t\t\tlector.setClassificationScheme(new StringBuilder(vrblSstmNgc.obtenerVrblSstm(Constantes.RUTA_CLASSIFICATION_SCHEMES)).append(vrblSstmNgc.obtenerVrblSstm(Constantes.CS_CONTENT)).toString());\n\t\t\t\tClassificationTreeNode rootNodeGenre = new ClassificationTreeNode(null); \n\t\t\t\textractClasificationTreeNode(lector.getElements(), rootNodeGenre);\t\n\t\t\t\tDefaultTreeModel classificationModelGenreSgmnt = new DefaultTreeModel(rootNodeGenre);\n\t\t\t\tclassificationModelGenreSgmnt.setMultiple(true);\n\t\t\t\ttreesGenreSgmt.setModel(classificationModelGenreSgmnt); //Para la sección de segmentos\n\t\t\t\ttreesGenreSgmt.setItemRenderer(this);\n\t\t\t\t\n\t\t\t\t// Combobox que contiene los idiomas\n\t\t\t\tLocale locales[] = SimpleDateFormat.getAvailableLocales();\n\t\t\t\t//List localesLst = new ArrayList();\n\t\t\t\tlocalesLst = new ArrayList();\n\t\t\t\tfor (int i = 1; i < locales.length; i++) {// el primero viene vacío\n\t\t\t\t\tlocalesLst.add(locales[i]);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tlocalesLst.sort(new LocaleComparator(true, 1));\n\t\t\t\t\n\t\t\t\tListModelList eduIdiomasModel = new ListModelList(localesLst);\n\t\t\t\teduIdiomasModel.setMultiple(true);\n\t\t\t\tlstbxEduIdiomas.setModel(eduIdiomasModel);\n\t\t\t\tlstbxEduIdiomas.setItemRenderer(this);\n\t\t\t\tlstbxEduIdiomas.renderAll();\n\t\t\t\t\n\t\t\t\tcargarDatosHeredados();\n\t\t\t}\t\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(new StringBuilder(e.getClass().getName()).append(\": \")\n\t\t\t\t\t.append(e.getMessage()), e);\n\t\t}\n\t}\n\t\n\t@SuppressWarnings(\"unchecked\")\n\tpublic void cargarDatosHeredados(){\n\t\t\n\t\tfinal boolean heredarGeneros;\n\t\tfinal boolean heredarIdiomas;\n\t\t\n\t\tif(generos!=null && !generos.isEmpty()){\n\t\t\theredarGeneros = true;\n\t\t}else {\n\t\t\theredarGeneros = false;\n\t\t}\n\t\t\n\t\tif(idiomas!=null && !idiomas.isEmpty()){\n\t\t\theredarIdiomas = true;\n\t\t}else {\n\t\t\theredarIdiomas = false;\n\t\t}\n\t\t\n\t\t//if(generos!=null && !generos.isEmpty()){\n\t\tif(heredarGeneros){\n\t\t\twinSegmento.setVisible(false);\n\t\t\tMessagebox.show(\n\t\t\t\t\t\"¿Desea heredar los géneros establecidos para todo el recurso?\",\n\t\t\t\t\t\"Heredar géneros\", Messagebox.OK | Messagebox.NO,\n\t\t\t\t\tMessagebox.QUESTION, new EventListener() {\n\t\t\t\t\t\tpublic void onEvent(Event evt) throws InterruptedException {\n\t\t\t\t\t\t\tif (evt.getName().equals(\"onOK\")) {\n\t\t\t\t\t\t\t\tfor (Treeitem genreItem : generos) {\n\t\t\t\t\t\t\t\t\tfor (Treeitem treeitem : treesGenreSgmt.getItems()) {\n\t\t\t\t\t\t\t\t\t\tif (((Classification) treeitem.getValue())\n\t\t\t\t\t\t\t\t\t\t\t\t.getName()\n\t\t\t\t\t\t\t\t\t\t\t\t.trim()\n\t\t\t\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(((Classification)genreItem.getValue()).getName().trim())) {\n\t\t\t\t\t\t\t\t\t\t\ttreeitem.setSelected(true);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(!heredarIdiomas){\n\t\t\t\t\t\t\t\t\twinSegmento.setVisible(true);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\t\tif(!heredarIdiomas){\n\t\t\t\t\t\t\t\t\twinSegmento.setVisible(true);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t}\n\t\t\n\t\t//if(idiomas!=null && !idiomas.isEmpty()){\n\t\tif(heredarIdiomas){\n\t\t\twinSegmento.setVisible(false);\n\t\t\tMessagebox.show(\n\t\t\t\t\"¿Desea heredar los idiomas de la audiencia objetivo establecidos para todo el recurso?\",\n\t\t\t\t\"Heredar idiomas\", Messagebox.OK | Messagebox.NO,\n\t\t\t\tMessagebox.QUESTION, new EventListener() {\n\t\t\t\t\tpublic void onEvent(Event evt) throws InterruptedException {\n\t\t\t\t\t\tif (evt.getName().equals(\"onOK\")) {\n\t\t\t\t\t\t\tfor (Locale idioma : idiomas) {\n\t\t\t\t\t\t\t\tfor (Listitem listitem : lstbxEduIdiomas.getItems()) {\n\t\t\t\t\t\t\t\t\tif (((Locale) listitem.getValue())\n\t\t\t\t\t\t\t\t\t\t\t.toString()\n\t\t\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(idioma.toString())) {\n\t\t\t\t\t\t\t\t\t\tlistitem.setSelected(true);\n\t\t\t\t\t\t\t\t\t\tlocalesEduLstSelect.add((Locale) listitem.getValue());\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonSelect$lstbxEduIdiomas();\n\t\t\t\t\t\t\twinSegmento.setVisible(true);\n\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\twinSegmento.setVisible(true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}\n\t\t\n\t}\n\t\n\t/**\n\t * M&eacute;todo que se encarga de agregar una fila para permitir el ingreso\n\t * de m&aacute palabras clave de un segmento\n\t * \n\t * @author \n\t */\n\tpublic void onClick$btnAgregarFilaPalabrasClaveSgmt() {\n\t\tnuevaFilaPalabrasClave(gridPalabrasClaveSgmt);\n\t}\n\t\n\t/**\n\t * M&eacute;todo que se encarga de eliminar una fila de ingreso de palabras clave de un segmento\n\t * \n\t * @author \n\t */\n\tpublic void onClick$btnEliminarFilaPalabrasClaveSgmt() {\n\t\tif (gridPalabrasClaveSgmt.getRows().getChildren().size() != 1) {\n\t\t\tgridPalabrasClaveSgmt.getRows().removeChild(\n\t\t\t\t\tgridPalabrasClaveSgmt.getRows().getLastChild());\n\t\t}\n\t}\n\t\n\t@SuppressWarnings(\"unchecked\")\n\tpublic void onChange$txtEduFiltroIdiomas(){\t\n\t\tString lang = txtEduFiltroIdiomas.getText().toLowerCase();\n\t\t\n\t\tList localesLstTmp = new ArrayList();\n\t\t \n for (Iterator i = localesLst.iterator(); i.hasNext();) {\n \tLocale tmp = i.next();\n if (tmp.getDisplayName().toLowerCase().contains(lang)) {\n \tlocalesLstTmp.add(tmp);\n }\n }\n \n localesLstTmp.sort(new LocaleComparator(true, 1));\n\n\t\tListModelList idiomasModel = new ListModelList(localesLstTmp);\n\t\tidiomasModel.setMultiple(true);\n\t\tlstbxEduIdiomas.setModel(idiomasModel);\n\t\tlstbxEduIdiomas.setItemRenderer(this);\n\t\tlstbxEduIdiomas.renderAll();\n\t\t\n\t\t//seleccionar los que ya estaban seleccionados\n\t\tif (localesEduLstSelect != null && !localesEduLstSelect.isEmpty()) {\n\t\t\tfor (Locale languageSelected : localesEduLstSelect) {\n\t\t\t\tfor (Listitem listitem : lstbxEduIdiomas.getItems()) {\n\t\t\t\t\tif (((Locale) listitem.getValue()).toString()\n\t\t\t\t\t\t\t.equalsIgnoreCase(\n\t\t\t\t\t\t\t\t\tlanguageSelected.toString())) {\n\t\t\t\t\t\tlistitem.setSelected(true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tonSelect$lstbxEduIdiomas();\n\t\t}\n\t}\n\t\n\t/**\n\t * \n\t */\n\tpublic void onSelect$lstbxEduIdiomas(){\t\n//\t\tsetVisibleLstbxValuesOnCombobox(lstbxEduIdiomas, cbxEduIdioma);\n\t\tsetVisibleLstbxValuesOnCombobox(localesEduLstSelect, cbxEduIdioma);\n\t}\n\t\n\t/**\n\t * \n\t */\n\tpublic void onSelect$lstbxTipoRecurso(){\t\n\t\tsetVisibleLstbxValuesOnCombobox(lstbxTipoRecurso, cbxTipoRecurso);\n\t}\n\t\n\t/**\n\t * \n\t */\n\tpublic void onSelect$lstbxEducationalRole(){\t\n\t\tsetVisibleLstbxValuesOnCombobox(lstbxEducationalRole, cbxEducationalRole);\n\t}\n\t\n\tpublic void onOpen$grpMetadataEduResource() {\n\t\tchangeGroupboxCaptionArrow(grpMetadataEduResource);\n\t}\n\n\tpublic void onOpen$grpMetadataEduContext() {\n\t\tchangeGroupboxCaptionArrow(grpMetadataEduContext);\n\t}\n\tpublic void onOpen$grpMetadataEduAudience() {\n\t\tchangeGroupboxCaptionArrow(grpMetadataEduAudience);\n\t}\n\t\n\tpublic void onOpen$grpMetadataEduAnotation() {\n\t\tchangeGroupboxCaptionArrow(grpMetadataEduAnotation);\n\t}\n\t\n\tpublic void onOpen$grpMetadataEduResults() {\n\t\tchangeGroupboxCaptionArrow(grpMetadataEduResults);\n\t}\n\t\n\t@SuppressWarnings(\"unchecked\")\n\tpublic void onClick$btnAddAnnotation(){\n\t\ttry {\n\t\t\t/*HashMap map = new HashMap>();\n\t\t\tmap.put(\"parentWindow\", winSegmento);\n\t\t\tWindow window = (Window)Executions.createComponents(\n\t \"annotation.zul\", null, map);\n\t window.doModal();*/ \n\t\t\tif(txtAnnotation.getValue()!=null && !txtAnnotation.getValue().trim().isEmpty()){\n\t\t\t\tString annotation = txtAnnotation.getText();\n\t\t \n\t\t TextualType annotationTT = new TextualType();\n\t\t\t\tannotationTT.setValue(annotation);\n\t\t\t\tannotationTT.setLang(\"es\");\n\t\t\t\t\n\t\t\t\tlstEduAnnotations.add(annotationTT);\n\t\t\t\t\n\t\t ListModelList annotationsModel = new ListModelList(lstEduAnnotations);\n\t\t annotationsModel.setMultiple(true);\n\t\t\t\tlstbxAnnotations.setModel(annotationsModel);\n\t\t\t\tlstbxAnnotations.setItemRenderer(this);\n\t\t\t\t\n\t\t\t\ttxtAnnotation.setText(null);\n\t\t\t\tlstbxAnnotations.setVisible(true);\n\t\t\t}else {\n\t\t\t\tMessagebox.show(\"No ha ingresado la nueva anotación.\", \"Información\", Messagebox.OK, Messagebox.INFORMATION);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(new StringBuilder(e.getClass().getName()).append(\": \")\n\t\t\t\t\t.append(e.getMessage()), e);\n\t\t}\n\t}\n\t\n\t@SuppressWarnings(\"unchecked\")\n\tpublic void onClick$btnDeleteAnnotation(){\n\t\ttry {\n\t\t\tif (!lstbxAnnotations.getSelectedItems().isEmpty()){\n\t\t\t\tfor(Listitem listitem : lstbxAnnotations.getSelectedItems()){\n\t\t\t\t\tTextualType annotation = listitem.getValue();\n\t\t\t\t\t// ELIMINAR DEL ARCHIVO DESCRIPTOR\n\t\t\t\t\tlstEduAnnotations.remove(annotation);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// VOLVER A RENDERIZAR\n\t\t\t\tListModelList annotationsModel = new ListModelList(lstEduAnnotations);\n\t\t\t\tannotationsModel.setMultiple(true);\n\t\t\t\tlstbxAnnotations.setModel(annotationsModel);\n\t\t\t\tlstbxAnnotations.setItemRenderer(this);\n\t\t\t\t\n\t\t\t\tif(lstEduAnnotations.isEmpty()){\n\t\t\t\t\tlstbxAnnotations.setVisible(false);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(new StringBuilder(e.getClass().getName()).append(\": \")\n\t\t\t\t\t.append(e.getMessage()), e);\n\t\t}\n\t}\n\t\n\t/**\n\t * Evento que cierra la ventana y cancela la operación de crear un segmento.\n\t * @throws InterruptedException\n\t */\n\tpublic void onClick$btnCancelar() throws InterruptedException {\n\t\tself.detach();\n\t\tEvents.sendEvent(new Event(\"onCloseWinSegment\", parentWindow, null));\n\t}\n\t\n\t/**\n\t * Evento que crea un segmento con la información ingresada en el formulario\n\t * \n\t * @author \n\t */\n\tpublic void onClick$btnAceptar() {\n\t\ttry {\n\t\t\tString validador = validarCamposObligatoriosSgmt();\n\t\t\t\n\t\t\tif (validador==null) {\n\t\t\t\tif(validarNombreSgmt(txtTituloSgmt.getValue().trim())){\n\t\t\t\t\t// AÑADIR SEGMENTO AL ARCHIVO DESCRIPTOR\n\t\t\t\t\tsegment = new SegmentInformationType();\n\t\t\t\t\tsegment.setSegmentId(String.valueOf(segment.hashCode()));//id obligatorio para el segmento, lo genero a partir del id del objeto\n\t\t\t\t\t//BasicSegmentDescriptionType segmentDescriptionType = new BasicSegmentDescriptionType();\n\t\t\t\t\tExtendedSegmentDescriptionType segmentDescriptionType = new ExtendedSegmentDescriptionType();\n\t\t\t\t\t\n\t\t\t\t\t// Título del segmento:\n\t\t\t\t\tTitleType titleType = new TitleType();\n\t\t\t\t\ttitleType.setValue(txtTituloSgmt.getValue().trim());\n\t\t\t\t\tsegmentDescriptionType.getTitle().add(titleType);\n\t\t\t\t\t\n\t\t\t\t\t// Ubicación del segmento\n\t\t\t\t\tjava.time.Duration jInicioSgmnt = java.time.Duration.ZERO;\n\t\t\t\t\tif(ibxInicioSgmtH.getValue()!=null){\n\t\t\t\t\t\tjInicioSgmnt = jInicioSgmnt.plus(java.time.Duration.ofHours(ibxInicioSgmtH.getValue().longValue()));\n\t\t\t\t\t}\n\t\t\t\t\tif(ibxInicioSgmtM.getValue()!=null){\n\t\t\t\t\t\tjInicioSgmnt = jInicioSgmnt.plus(java.time.Duration.ofMinutes(ibxInicioSgmtM.getValue().longValue()));\n\t\t\t\t\t}\n\t\t\t\t\tif(ibxInicioSgmtS.getValue()!=null){\n\t\t\t\t\t\tjInicioSgmnt = jInicioSgmnt.plus(java.time.Duration.ofSeconds(ibxInicioSgmtS.getValue().longValue()));\n\t\t\t\t\t}\n\t\t\t\t\tMediaRelTimePointType inicioSgmnt = new MediaRelTimePointType();\n\t\t\t\t\tinicioSgmnt.setValue(jInicioSgmnt.toString());\n\t\t\t\t\tTVAMediaTimeType tiemposSgmt = new TVAMediaTimeType();\n\t\t\t\t\ttiemposSgmt.setMediaRelTimePoint(inicioSgmnt); //tiempo de inicio\n\t\t\t\t\t\n\t\t\t\t\tjava.time.Duration jFinSgmnt = java.time.Duration.ZERO;\n\t\t\t\t\tif(ibxFinSgmtH.getValue()!=null){\n\t\t\t\t\t\tjFinSgmnt = jFinSgmnt.plus(java.time.Duration.ofHours(ibxFinSgmtH.getValue().longValue()));\n\t\t\t\t\t}\n\t\t\t\t\tif(ibxFinSgmtM.getValue()!=null){\n\t\t\t\t\t\tjFinSgmnt = jFinSgmnt.plus(java.time.Duration.ofMinutes(ibxFinSgmtM.getValue().longValue()));\n\t\t\t\t\t}\n\t\t\t\t\tif(ibxFinSgmtS.getValue()!=null){\n\t\t\t\t\t\tjFinSgmnt = jFinSgmnt.plus(java.time.Duration.ofSeconds(ibxFinSgmtS.getValue().longValue()));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tjava.time.Duration duration = jFinSgmnt.minus(jInicioSgmnt);\n\t\t\t\t\ttiemposSgmt.setMediaDuration(duration.toString()); //duración\n\t\t\t\t\t\n\t\t\t\t\tsegment.setSegmentLocator(tiemposSgmt);\n\t\t\t\t\t\n\t\t\t\t\t// Descripción del segmento\n\t\t\t\t\tSynopsisType synopsisType = new SynopsisType();\n\t\t\t\t\tsynopsisType.setValue(txtDescrSgmt.getValue().trim());\n\t\t\t\t\tsegmentDescriptionType.getSynopsis().add(synopsisType);\n\t\n\t\t\t\t\t// Palabras clave\n\t\t\t\t\tfor (Component rowKey : gridPalabrasClaveSgmt.getRows().getChildren()) {\n\t\t\t\t\t\tfor (Component txbKey : rowKey.getChildren()) {\n\t\t\t\t\t\t\tif (!((Textbox) txbKey).getValue().isEmpty()) {\n\t\t\t\t\t\t\t\tKeywordType keywordType = new KeywordType();\n\t\t\t\t\t\t\t\tkeywordType.setValue(((Textbox) txbKey).getValue());\n\t\t\t\t\t\t\t\tif (segmentDescriptionType.getKeyword().isEmpty()) {\n\t\t\t\t\t\t\t\t\tkeywordType.setType(Constantes.MAIN_KEYWORD);\n\t\t\t\t\t\t\t\t} else if (segmentDescriptionType.getKeyword().size() == 1) {\n\t\t\t\t\t\t\t\t\tkeywordType.setType(Constantes.SECOND_KEYWORD);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tkeywordType.setType(Constantes.OTHER_KEYWORD);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tsegmentDescriptionType.getKeyword().add(keywordType);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\n\t\t\t\t\t// Género\n\t\t\t\t\tSet genreSelectedItems = (Set) treesGenreSgmt.getSelectedItems();\n\t\t\t\t\tfor(Treeitem item : genreSelectedItems){\n\t\t\t\t\t\tGenreType newGenre = new GenreType();\n\t\t\t\t\t\tStringBuilder href = new StringBuilder(64).append(\"urn:tva:metadata:cs:ContentCS:2011:\");\n\t\t\t\t\t\thref.append(((Classification)item.getValue()).getTermID());\n\t\t\t\t\t\tnewGenre.setHref(href.toString());\n\t\t\t\t\t\tTermNameType genreName = new TermNameType();\n\t\t\t\t\t\tgenreName.setValue(((Classification)item.getValue()).getName());\n\t\t\t\t\t\tnewGenre.setName(genreName);\n\t\t\t\t\t\tsegmentDescriptionType.getGenre().add(newGenre);\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// LA INFORMACIÓN EDUCATIVA ES UN ATRIBUTO DE CONTEXTO DEL SEGMENTO\n\t\t\t\t\tsegmentDescriptionType.getContextAttributes().add(crearInfoEducativa());\n\t\t\t\t\t\n\t\t\t\t\tsegment.setDescription(segmentDescriptionType);\n\t\t\t\t\tsegmentos.add(segment);\n\t\t\t\t\t\n\t\t\t\t\tfinal HashMap map = new HashMap();\n\t\t\t map.put(\"segmentos\", segmentos);\n\t\t\t map.put(\"segmento\", segment);\n\t\t\t\t\tMessagebox.show(\"Segmento educativo creado exitosamente.\", \"Información\", Messagebox.OK, Messagebox.INFORMATION);\n\t\t\t\t\tself.detach();\n\t\t\t Events.sendEvent(new Event(\"onSegmentCreated\", parentWindow, map));\n\t\t\t\t}else {\n\t\t\t\t\tMessagebox.show(\"Ya existe un segmento con el mismo nombre, por favor ingrese un nombre diferente.\", \"Error\", Messagebox.OK, Messagebox.ERROR);\n\t\t\t\t\ttxtTituloSgmt.setValue(\"\");\n\t\t\t\t}\n\t\t\t}else {\n\t\t\t\tMessagebox.show(new StringBuilder().append(\"Los siguientes campos obligatorios no han sido ingresados: \\n\").append(validador).toString(), \"Información\", Messagebox.OK, Messagebox.INFORMATION);\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(new StringBuilder(e.getClass().getName()).append(\": \")\n\t\t\t\t\t.append(e.getMessage()), e);\n\t\t}\n\t}\n\t\n\t/**\n\t * Método que obtiene los metadatos educativos ingresados por el usuario\n\t * \n\t * @author \n\t * @return EducationalContextAttributesType eAttributesType\n\t */\n\tprivate EducationalContextAttributesType crearInfoEducativa()\n\t\t\tthrows Exception {\n\t\t/*\n\t\t * EJEMPLO PARA: EducationalUse: Animation \n\t\t * \n\t\t * IntendedUser: Teachers\n\t\t * \n\t\t */\n\n\t\tEducationalContextAttributesType eAttributesType = new EducationalContextAttributesType();\n\n\t\t// Lector de classification schemes\n\t\tLectorCS lector = new LectorCS();\n\n\t\t// Instancia de EducationalResourceType para agregar los metadatos relacionados con el recurso educativo\n\t\tEducationalResourceType educationalResourceType = new EducationalResourceType();\n\t\teAttributesType.setEducationalResource(educationalResourceType);\n\t\t\n\t\t// PARA AGREGAR EL TIPO DE INTERACTIVIDAD\n\t\tif(cbxTipoInteractividad.getSelectedItem()!=null){\n\t\t\tControlledTermType interactivityTypeCT = new ControlledTermType();\n\t\t\tlector.setClassificationScheme(new StringBuilder(vrblSstmNgc.obtenerVrblSstm(Constantes.RUTA_CLASSIFICATION_SCHEMES)).append(vrblSstmNgc.obtenerVrblSstm(Constantes.CS_INTERACTIVITY_TYPE)).toString());\n\t\t\tStringBuilder href = new StringBuilder(lector.getUri()).append(\":\");\n\t\t\thref.append(((Classification)cbxTipoInteractividad.getSelectedItem().getValue()).getTermID());\n\t\t\tinteractivityTypeCT.setHref(href.toString());\n\t\t\tTermNameType nmbInteractivity = new TermNameType();\n\t\t\tnmbInteractivity.setValue(((Classification)cbxTipoInteractividad.getSelectedItem().getValue()).getName());\n\t\t\tinteractivityTypeCT.setName(nmbInteractivity);\n\t\t\teducationalResourceType.setInteractivityType(interactivityTypeCT);\n\t\t}\n\t\t\n\t\t// PARA AGREGAR EL TIPO DE RECURSO\n\t\tif(lstbxTipoRecurso.getSelectedItems()!=null && !lstbxTipoRecurso.getSelectedItems().isEmpty()){\n\t\t\tfor(Listitem item : lstbxTipoRecurso.getSelectedItems()){\n\t\t\t\tControlledTermType educationalUseCT = new ControlledTermType();\n\t\t\t\tlector.setClassificationScheme(new StringBuilder(vrblSstmNgc.obtenerVrblSstm(Constantes.RUTA_CLASSIFICATION_SCHEMES)).append(vrblSstmNgc.obtenerVrblSstm(Constantes.CS_EDUCATIONAL_USE)).toString());\n\t\t\t\tStringBuilder href = new StringBuilder(lector.getUri()).append(\":\");\n\t\t\t\thref.append(((Classification)item.getValue()).getTermID());\n\t\t\t\teducationalUseCT.setHref(href.toString());\n\t\t\t\tTermNameType nmbEducationalUse = new TermNameType();\n\t\t\t\tnmbEducationalUse.setValue(((Classification)item.getValue()).getName());\n\t\t\t\teducationalUseCT.setName(nmbEducationalUse);\n\t\t\t\teducationalResourceType.getEducationalType().add(educationalUseCT);\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\t// PARA AGREGAR EL USO EDUCATIVO\n\t\tif(!txtEducationalUse.getValue().trim().isEmpty()){\n\t\t\tTextualType educationalUseTT = new TextualType();\n\t\t\teducationalUseTT.setValue(txtEducationalUse.getValue().trim());\n\t\t\teducationalUseTT.setLang(\"es\");\n\t\t\teducationalResourceType.getEducationalUse().add(educationalUseTT);\t\t\n\t\t}\n\t\t\n\t\t// PARA AGREGAR EL CONTEXTO EDUCATIVO\n\t\tif(lstbxEducationalContext.getSelectedItems()!=null && !lstbxEducationalContext.getSelectedItems().isEmpty()){\n\t\t\tfor(Listitem item : lstbxEducationalContext.getSelectedItems()){\n\t\t\t\tControlledTermType eduContextCT = new ControlledTermType();\n\t\t\t\tlector.setClassificationScheme(new StringBuilder(vrblSstmNgc.obtenerVrblSstm(Constantes.RUTA_CLASSIFICATION_SCHEMES)).append(vrblSstmNgc.obtenerVrblSstm(Constantes.CS_EDUCATIONAL_CONTEXT)).toString());\n\t\t\t\tStringBuilder href = new StringBuilder(lector.getUri()).append(\":\");\n\t\t\t\thref.append(((Classification)item.getValue()).getTermID());\n\t\t\t\teduContextCT.setHref(href.toString());\n\t\t\t\tTermNameType nmbContext = new TermNameType();\n\t\t\t\tnmbContext.setValue(((Classification)item.getValue()).getName());\n\t\t\t\teduContextCT.setName(nmbContext);\n\t\t\t\teAttributesType.getEducationalContext().add(eduContextCT);\n\t\t\t}\n\t\t}\n\t\t\t\n\t\t// Instancia de EducationalAudienceType para agregar los metadatos relacionados con la audiencia educativa\n\t\tEducationalAudienceType educationalAudienceType = new EducationalAudienceType();\n\t\teAttributesType.setEducationalAudience(educationalAudienceType);\n\t\t\n\t\t// PARA AGREGAR EL ROL DEL USUARIO\n\t\tif(lstbxEducationalRole.getSelectedItems()!=null && !lstbxEducationalRole.getSelectedItems().isEmpty()){\n\t\t\tfor(Listitem item : lstbxEducationalRole.getSelectedItems()){\n\t\t\t\tControlledTermType educationalRoleCT = new ControlledTermType();\n\t\t\t\tlector.setClassificationScheme(new StringBuilder(vrblSstmNgc.obtenerVrblSstm(Constantes.RUTA_CLASSIFICATION_SCHEMES)).append(vrblSstmNgc.obtenerVrblSstm(Constantes.CS_INTENDED_EDUCATIONAL_USER)).toString());\n\t\t\t\tStringBuilder href = new StringBuilder(lector.getUri()).append(\":\");\n\t\t\t\thref.append(((Classification)item.getValue()).getTermID());\n\t\t\t\teducationalRoleCT.setHref(href.toString());\n\t\t\t\tTermNameType nmbEducationalRole = new TermNameType();\n\t\t\t\tnmbEducationalRole.setValue(((Classification)item.getValue()).getName());\n\t\t\t\teducationalRoleCT.setName(nmbEducationalRole);\n\t\t\t\teducationalAudienceType.getEducationalRole().add(educationalRoleCT);\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\t// PARA AGREGAR EL RANGO DE EDAD TÍPICO\n\t\tif(treeAgeRange.getSelectedItems()!=null && !treeAgeRange.getSelectedItems().isEmpty()){\n\t\t\tfor(Treeitem item : treeAgeRange.getSelectedItems()){\n\t\t\t\tControlledTermType ageRangeCT = new ControlledTermType();\n\t\t\t\tlector.setClassificationScheme(new StringBuilder(vrblSstmNgc.obtenerVrblSstm(Constantes.RUTA_CLASSIFICATION_SCHEMES)).append(vrblSstmNgc.obtenerVrblSstm(Constantes.CS_AGE_RANGE)).toString());\n\t\t\t\tStringBuilder href = new StringBuilder(lector.getUri()).append(\":\");\n\t\t\t\thref.append(((Classification)item.getValue()).getTermID());\n\t\t\t\tageRangeCT.setHref(href.toString());\n\t\t\t\tTermNameType nmbAgeRange = new TermNameType();\n\t\t\t\tnmbAgeRange.setValue(((Classification)item.getValue()).getName());\n\t\t\t\tageRangeCT.setName(nmbAgeRange);\n\t\t\t\teducationalAudienceType.getTypicalAgeRange().add(ageRangeCT);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// PARA AGREGAR EL IDIOMA DEL USUARIO OBJETIVO\n\t\t/*if(lstbxEduIdiomas.getSelectedItems()!=null && !lstbxEduIdiomas.getSelectedItems().isEmpty()){\n\t\t\tfor(Listitem item : lstbxEduIdiomas.getSelectedItems()){\n\t\t\t\tLanguageType languaje = new LanguageType();\n\t\t\t\tlanguaje.setValue(((Locale) item.getValue()).toString().replace(\"_\", \"-\"));\t\n\t\t\t\teducationalAudienceType.getLanguage().add(languaje);\n\t\t\t}\t\t\t\n\t\t}*/\n\t\tif (localesEduLstSelect != null\t&& !localesEduLstSelect.isEmpty()) {\n\t\t\tfor (Locale locale : localesEduLstSelect) {\n\t\t\t\tLanguageType languaje = new LanguageType();\n\t\t\t\tlanguaje.setValue(locale.toString().replace(\"_\", \"-\"));\n\t\t\t\teducationalAudienceType.getLanguage().add(languaje);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// PARA AGREGAR LA DESCRIPCIÓN EDUCATIVA (anotaciones)\n\t\tif(lstEduAnnotations!=null && !lstEduAnnotations.isEmpty()){\n\t\t\teAttributesType.getAnnotation().addAll(lstEduAnnotations);\n\t\t}\n\n\t\t// Instancia de EducationalResultsType para agregar los metadatos relacionados con la audiencia educativa\n\t\tEducationalResultsType educationalResultsType = new EducationalResultsType();\n\t\teAttributesType.setEducationalResults(educationalResultsType);\n\t\t\n\t\t// PARA AGREGAR LAS HABILIDADES\n\t\tif(treeAbility.getSelectedItems()!=null && !treeAbility.getSelectedItems().isEmpty()){\n\t\t\tfor(Treeitem item : treeAbility.getSelectedItems()){\n\t\t\t\tControlledTermType abilityCT = new ControlledTermType();\n\t\t\t\tlector.setClassificationScheme(new StringBuilder(vrblSstmNgc.obtenerVrblSstm(Constantes.RUTA_CLASSIFICATION_SCHEMES)).append(vrblSstmNgc.obtenerVrblSstm(Constantes.CS_ABILITY)).toString());\n\t\t\t\tStringBuilder href = new StringBuilder(lector.getUri()).append(\":\");\n\t\t\t\thref.append(((Classification)item.getValue()).getTermID());\n\t\t\t\tabilityCT.setHref(href.toString());\n\t\t\t\tTermNameType nmbAbility = new TermNameType();\n\t\t\t\tnmbAbility.setValue(((Classification)item.getValue()).getName());\n\t\t\t\tabilityCT.setName(nmbAbility);\n\t\t\t\teducationalResultsType.getAbility().add(abilityCT);\n\t\t\t}\n\t\t}\n\t\n\t\treturn eAttributesType;\n\t}\n\t\n\t/*@SuppressWarnings(\"unchecked\")\n\tpublic void onAnnotationCreated(Event event){\n\t\tHashMap map = (HashMap) event.getData();\n String annotation = (String) map.get(\"annotation\");\n \n TextualType annotationTT = new TextualType();\n\t\tannotationTT.setValue(annotation);\n\t\tannotationTT.setLang(\"es\");\n\t\t\n\t\tlstEduAnnotations.add(annotationTT);\n\t\t\n ListModelList annotationsModel = new ListModelList(lstEduAnnotations);\n annotationsModel.setMultiple(true);\n\t\tlstbxAnnotations.setModel(annotationsModel);\n\t\tlstbxAnnotations.setItemRenderer(this);\n\t}*/\n\t\n\t/**\n\t * Método que verifica si existe algún segmento que tenga el nombre especificado en los parámetros.\n\t * \n\t * @author \n\t * @param nombreSgmt\n\t * @return\n\t */\n\tprivate boolean validarNombreSgmt(String nombreSgmt) {\n\t\tboolean validador = true;\n\t\tif(segmentos!=null && !segmentos.isEmpty()){\n\t\t\tfor(SegmentInformationType segment : segmentos){\n\t\t\t\tif(segment.getDescription().getTitle().get(0).getValue().equalsIgnoreCase(nombreSgmt)){\n\t\t\t\t\tvalidador = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn validador;\n\t}\n\t\n\t/**\n\t * M&eacute;todo que valida que los campos obligatorios sean ingresados por el usuario\n\t * \n\t * @author \n\t * @return \n\t */\n\tprivate String validarCamposObligatoriosSgmt() {\n\t\tboolean validador = true;\n\t\tStringBuilder campos = new StringBuilder();\t\n\t\t\n\t\t// Título obigatorio\n\t\tif(txtTituloSgmt.getValue()==null || txtTituloSgmt.getValue().trim().isEmpty()){\n\t\t\tcampos.append(\"- Título\\n\");\n\t\t\tvalidador = false;\n\t\t}\n\t\t\n\t\t// Descripción obligatoria\n\t\tif (txtDescrSgmt.getValue()==null || txtDescrSgmt.getValue().trim().isEmpty()) {\n\t\t\tcampos.append(\"- Sinopsis\\n\");\n\t\t\tvalidador = false;\n\t\t}\n\n\t\t// Al menos una palabra clave\n\t\tint palabrasClaves =0;\n\t\tfor(Component txbKey : gridPalabrasClaveSgmt.getRows().getChildren().get(0).getChildren()){\n\t\t\tif (!((Textbox) txbKey).getValue().isEmpty()) {\n\t\t\t\tpalabrasClaves ++;\n\t\t\t}\n\t\t}\n\t\tif(palabrasClaves<=0){\n\t\t\tcampos.append(\"- Palabras clave\\n\");\n\t\t\tvalidador = false;\n\t\t}\t\t\n\t\t\n\t\t// Tiempo de inicio\n\t\tint nulos = 0;\n\t\tif(ibxInicioSgmtH.getValue()==null){\n\t\t\tnulos++;\n\t\t}\n\t\tif(ibxInicioSgmtM.getValue()==null){\n\t\t\tnulos++;\n\t\t}\n\t\tif(ibxInicioSgmtS.getValue()==null){\n\t\t\tnulos++;\n\t\t}\t\n\t\tif(nulos==3){\n\t\t\tcampos.append(\"- Tiempo inicial\\n\");\n\t\t\tvalidador = false;\n\t\t}\n\t\t\n\t\tif(cbxTipoInteractividad.getSelectedItem()==null){\n\t\t\tcampos.append(\"- Tipo de interactividad\\n\");\n\t\t\tvalidador = false;\n\t\t}\n\t\t\n\t\tif(!(lstbxTipoRecurso.getSelectedItems()!=null && !lstbxTipoRecurso.getSelectedItems().isEmpty())){\n\t\t\tcampos.append(\"- Tipo de recurso\\n\");\n\t\t\tvalidador = false;\n\t\t}\n\t\t\n\t\tif(txtEducationalUse.getValue()==null || txtEducationalUse.getValue().trim().isEmpty()){\n\t\t\tcampos.append(\"- Uso educativo\\n\");\n\t\t\tvalidador = false;\n\t\t}\n\t\t\n\t\tif(!(lstbxEducationalContext.getSelectedItems()!=null && !lstbxEducationalContext.getSelectedItems().isEmpty())){\n\t\t\tcampos.append(\"- Contexto\\n\");\n\t\t\tvalidador = false;\n\t\t}\n\t\t\n\t\tif(!(lstbxEducationalRole.getSelectedItems()!=null && !lstbxEducationalRole.getSelectedItems().isEmpty())){\n\t\t\tcampos.append(\"- Rol del usuario objetivo\\n\");\n\t\t\tvalidador = false;\n\t\t}\n\t\t\n\t\tif(!(treeAgeRange.getSelectedItems()!=null && !treeAgeRange.getSelectedItems().isEmpty())){\n\t\t\tcampos.append(\"- Rango de edad típico\\n\");\n\t\t\tvalidador = false;\n\t\t}\n\t\t\n\t\tif(!(lstbxEduIdiomas.getSelectedItems()!=null && !lstbxEduIdiomas.getSelectedItems().isEmpty())){\n\t\t\tcampos.append(\"- Idioma\\n\");\n\t\t\tvalidador = false;\n\t\t}\n\t\t\n\t\t// Al menos una anotación\n\t\tif(!(lstEduAnnotations!=null && !lstEduAnnotations.isEmpty())){\n\t\t\tcampos.append(\"- Anotaciones\\n\");\n\t\t\tvalidador = false;\n\t\t}\n\t\t\n\t\tif(!(treeAbility.getSelectedItems()!=null && !treeAbility.getSelectedItems().isEmpty())){\n\t\t\tcampos.append(\"- Competencias\\n\");\n\t\t\tvalidador = false;\n\t\t}\n\t\t\n\t\tif(validador){\n\t\t\treturn null;\n\t\t}else {\n\t\t\treturn campos.toString();\n\t\t}\n\t}\n\t\n\t/**\n\t * Limplia al formulario de ingreso de parámetros para un segmento\n\t * \n\t * @author \n\t */\n//\tprivate void limpiarFormularioSegmento() {\n//\t\ttxtTituloSgmt.setValue(\"\");\n//\t\ttxtDescrSgmt.setValue(\"\");\n//\t\ttreesGenreSgmt.setSelectedItem(null);\n//\t\tibxInicioSgmtH.setValue(null);\n//\t\tibxInicioSgmtM.setValue(null);\n//\t\tibxInicioSgmtS.setValue(null);\n//\t\tibxFinSgmtH.setValue(null);\n//\t\tibxFinSgmtM.setValue(null);\n//\t\tibxFinSgmtS.setValue(null);\n//\t\tfor (Iterator iter=gridPalabrasClaveSgmt.getRows().getChildren().iterator(); iter.hasNext();) {\n//\t\t\t @SuppressWarnings(\"unused\")\n//\t\t\tfinal Row row = (Row) iter.next();\n//\t\t\t iter.remove(); \n//\t\t\t}\n//\t\tnuevaFilaPalabrasClave(gridPalabrasClaveSgmt);\t\n//\t\t\n//\t\t//Limpieza de los componentes educativos del segmento\n//\t\tfg\n//\t}\n\t\n\t/**\n\t * Agrega una fila de textbox para ingresar palabras claves\n\t * \n\t * @author \n\t */\n\t@SuppressWarnings(\"unused\")\n\tprivate void nuevaFilaPalabrasClave(Grid grid) {\n\t\tRow row = new Row();\n\t\tfor (Component column : grid.getColumns().getChildren()) {\n\t\t\tTextbox textbox = new Textbox();\n\t\t\ttextbox.setWidth(\"95%\");\n\t\t\trow.getChildren().add(textbox);\n\t\t}\n\t\trow.setParent(grid.getRows());\n\t}\n\t\n\t/**\n\t * Método que extrae las clasificaciones de una clasificación para agregarlas a un nodo (para el render del árbol).\n\t * \n\t * @param classificationLst\n\t * @param rootNode\n\t * @author \n\t */\n\tprivate void extractClasificationTreeNode(List classificationLst, ClassificationTreeNode rootNode) {\n\t\t// Recorro la lista de clasificaciones\n\t\tfor(Classification c : classificationLst){\n\t\t\t// Cada clasificación se representa por un TreeNode:\n\t\t\tClassificationTreeNode classificationNode = new ClassificationTreeNode(c);\n\t\t\t// Si la clasificación tiene otra lista de clasificaciones, se le hace el mismo proceso:\n\t\t\tif(c.getClassifications()!=null && !c.getClassifications().isEmpty()){\n\t\t\t\textractClasificationTreeNode(c.getClassifications(), classificationNode);\n\t\t\t}\n\t\t\trootNode.add(classificationNode);\t\n\t\t}\n\t}\n\t\n\t/**\n\t * \n\t * @param lstbx\n\t * @param cbx\n\t */\n\tprivate void setVisibleLstbxValuesOnCombobox(Listbox lstbx, Bandbox cbx) {\n\t\tStringBuilder valorVisible = new StringBuilder(64);\n\t\tif(lstbx.getSelectedItems()!=null && !lstbx.getSelectedItems().isEmpty()){\n\t\t\tif(lstbx.getSelectedItem().getValue() instanceof Locale){\n\t\t\t\tvalorVisible.append(((Locale)lstbx.getSelectedItem().getValue()).toString());\n\t\t\t}else {\n\t\t\t\tvalorVisible.append((((Classification)lstbx.getSelectedItem().getValue()).getName()).toString());\n\t\t\t}\n\t\t\t\n\t\t\tif(lstbx.getSelectedItems().size()>1){\n\t\t\t\tvalorVisible.append(\",...\");\n\t\t\t}\n\t\t}\n\t\tcbx.setValue(valorVisible.toString());\n\t}\n\t\n\tprivate void setVisibleLstbxValuesOnCombobox(List lst, Bandbox cbx) {\n\t\tStringBuilder valorVisible = new StringBuilder(64);\n\t\tif (lst != null\t&& !lst.isEmpty()) {\t\n\t\t\tvalorVisible.append(((Locale) lst.get(0)).toString());\n\t\t\tif (lst.size() > 1) {\n\t\t\t\tvalorVisible.append(\",...\");\n\t\t\t}\n\t\t}\n\t\tcbx.setValue(valorVisible.toString());\n\t}\n\t\n\tprivate void changeGroupboxCaptionArrow(Groupbox grp) {\n\t\tif(grp.isOpen()){\n\t\t\tgrp.getCaption().setImage(\"/imgs/arrow_up.png\");\n\t\t}else {\n\t\t\tgrp.getCaption().setImage(\"/imgs/arrow_down.png\");\n\t\t}\n\t}\n\n\t/**\n\t * Render para los combobox que contienen valores controlados de un\n\t * classificationScheme\n\t * \n\t * @author \n\t */\n\t@Override\n\tpublic void render(Comboitem item, Object data, int index) throws Exception {\n\t\titem.setLabel(((Classification) data).getName());\n\t\titem.setValue(data);\n\t\t\n\t\tif(!((Classification) data).getDefinition().isEmpty()){\n\t\t\titem.setTooltiptext(((Classification) data).getDefinition());\n\t\t}\n\t}\n\t\n\t/**\n\t * Render para el árbol que contiene los géneros definidos en TVA\n\t * \n\t * @author \n\t */\n\t@Override\n\tpublic void render(final Treeitem treeItem, Object data, int index) throws Exception {\t\n\t\t\n\t\tClassificationTreeNode treeNode = (ClassificationTreeNode) data;\n\t\tClassification classification = (Classification) treeNode.getData();\n\n\t\ttreeItem.setValue(classification);\n\t\t//debe estar abierto para que realice la carga de todo el arbol desde el inicio y poder al evento ON_CLICK definido para cada uno.\n\t\ttreeItem.setOpen(true);\n\t\t\n\t\tTreerow dataRow = new Treerow();\n\t\tdataRow.setParent(treeItem);\n\t\tdataRow.setTooltiptext(classification.getDefinition());\n\t\tdataRow.appendChild(new Treecell(classification.getName()));\n\t\t\n\t\tdataRow.addEventListener(Events.ON_CLICK, new EventListener() {\n\t\t\t@Override\n public void onEvent(Event event) throws Exception {\n\n\t\t\t\tif (treeItem.isSelected()) {\n\t\t\t\t\t// Seleccionar los hijos\n\t\t\t\t\tif (((Classification) treeItem.getValue())\n\t\t\t\t\t\t\t.getClassifications() != null\n\t\t\t\t\t\t\t&& !((Classification) treeItem.getValue())\n\t\t\t\t\t\t\t\t\t.getClassifications().isEmpty()) {\n\t\t\t\t\t\tselectTreeitemChildren(treeItem, true);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Se des-seleccionan sus hijos\n\t\t\t\t\tif (((Classification) treeItem.getValue())\n\t\t\t\t\t\t\t.getClassifications() != null\n\t\t\t\t\t\t\t&& !((Classification) treeItem.getValue())\n\t\t\t\t\t\t\t\t\t.getClassifications().isEmpty()) {\n\t\t\t\t\t\tselectTreeitemChildren(treeItem, false);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Seleccionar o des-seleccionar los nodos padre\n\t\t\t\tif (treeItem.getParent() != null && // el padre siempre es de\n\t\t\t\t\t\t\t\t\t\t\t\t\t// tipo TreeChildren\n\t\t\t\t\t\ttreeItem.getParent().getParent() != null && // El padre\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// del padre\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// puede ser\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// un\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// treeItem\n\t\t\t\t\t\ttreeItem.getParent().getParent() instanceof Treeitem) { // Si\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// el\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// padre\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// del\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// padre\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// es\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// un\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// treeitem\n\t\t\t\t\tif (treeItem.isSelected()) {// si el item se está\n\t\t\t\t\t\t\t\t\t\t\t\t// seleccionando\n\t\t\t\t\t\t// Se seleccionan sus padres\n\t\t\t\t\t\tselectTreeitemParent(treeItem, true);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tselectTreeitemParent(treeItem, false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tprivate void selectTreeitemParent(Treeitem treeItem, boolean select) {\n\t\t\t\tif (treeItem.getParent().getParent() instanceof Treeitem) {\n\t\t\t\t\tTreeitem treeitemParent = (Treeitem) treeItem.getParent()\n\t\t\t\t\t\t\t.getParent();\n\t\t\t\t\tif (select) {\n\t\t\t\t\t\t// Verificar si todos sus hermanos están seleccionados\n\t\t\t\t\t\t// para seleccionar el padre\n\t\t\t\t\t\tif (areAllChildrenSelected(treeitemParent)) {\n\t\t\t\t\t\t\ttreeitemParent.setSelected(select);\n\t\t\t\t\t\t\tselectTreeitemParent(treeitemParent, select);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Des-seleccionar a los padres\n\t\t\t\t\t\ttreeitemParent.setSelected(select);\n\t\t\t\t\t\tif (treeitemParent.getParent().getParent() != null\n\t\t\t\t\t\t\t\t&& treeitemParent.getParent().getParent() instanceof Treeitem) {\n\t\t\t\t\t\t\tselectTreeitemParent(treeitemParent, select);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tprivate boolean areAllChildrenSelected(Treeitem parent) {\n\t\t\t\tboolean validador = true;\n\n\t\t\t\tfor (Component component : parent.getChildren()) {\n\t\t\t\t\tif (component instanceof Treechildren) {\n\t\t\t\t\t\tfor (Treeitem co : ((Treechildren) component)\n\t\t\t\t\t\t\t\t.getItems()) {\n\t\t\t\t\t\t\tif (!co.isSelected()) {\n\t\t\t\t\t\t\t\tvalidador = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn validador;\n\t\t\t}\n\n\t\t\tprivate void selectTreeitemChildren(Treeitem treeItem,\n\t\t\t\t\tboolean select) {\n\t\t\t\tfor (Component comp : treeItem.getChildren()) {\n\t\t\t\t\tif (comp instanceof Treechildren\n\t\t\t\t\t\t\t&& ((Treechildren) comp).getItems() != null\n\t\t\t\t\t\t\t&& !((Treechildren) comp).getItems().isEmpty()) {\n\t\t\t\t\t\tfor (Component c : ((Treechildren) comp).getItems()) {\n\t\t\t\t\t\t\tif (c instanceof Treeitem) {\n\t\t\t\t\t\t\t\t((Treeitem) c).setSelected(select);\n\t\t\t\t\t\t\t\tselectTreeitemChildren((Treeitem) c, select);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n });\n\t}\n\n\t@SuppressWarnings(\"unchecked\")\n\t@Override\n\tpublic void render(final Listitem item, Object data, int index) throws Exception {\n\t\tif (data instanceof Locale) {\n\t\t\t\n\t\t\tfinal Locale locale = (Locale) data;\n\t\t\titem.setValue(locale);\n\t\t\t\n\t\t\tListcell identificadorCell = new Listcell();\n\t\t\tidentificadorCell.setParent(item);\n\t\t\tLabel lblIdentificador = new Label(locale.toString());\n\t\t\tlblIdentificador.setParent(identificadorCell);\n\t\t\tlblIdentificador.setWidth(\"100%\");\n\t\t\t\t\t\n\t\t\tListcell nombreCell = new Listcell();\n\t\t\tnombreCell.setParent(item);\n\t\t\tLabel lblnombre = new Label(locale.getDisplayName());\n\t\t\tlblnombre.setParent(nombreCell);\n\t\t\tlblnombre.setWidth(\"100%\");\n\t\t\t\n\t\t\tListcell countryCell = new Listcell();\n\t\t\tcountryCell.setParent(item);\n\t\t\tLabel lblCountry = new Label(locale.getDisplayCountry());\n\t\t\tlblCountry.setParent(countryCell);\n\t\t\tlblCountry.setWidth(\"100%\");\n\t\t\t\n\t\t\titem.addEventListener(Events.ON_CLICK, new EventListener() {\n\t\t\t\tpublic void onEvent(Event arg0) throws Exception {\t\n\t\t\t\t\tif(item.isSelected()){\n\t\t\t\t\t\tlocalesEduLstSelect.add(locale);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tlocalesEduLstSelect.remove(locale);\n\t\t\t\t\t}\n\t\t\t\t\tonSelect$lstbxEduIdiomas();\n\t\t\t\t}\n\t\t\t});\n\t\t}else if (data instanceof Classification) {\n\t\t\tClassification classification = (Classification) data;\n\t\t\titem.setValue(data);\n\t\t\t\t\t\t\n\t\t\tListcell checkCell = new Listcell();\n\t\t\tcheckCell.setParent(item);\n\t\t\t\n\t\t\tListcell classificationCell = new Listcell();\n\t\t\tclassificationCell.setParent(item);\n\t\t\tLabel lblClassification = new Label(classification.getName());\n\t\t\tlblClassification.setParent(classificationCell);\n\t\t\tlblClassification.setWidth(\"100%\");\n\t\t}else if (data instanceof TextualType) {\n\t\t\tTextualType textualType = (TextualType) data;\n\t\t\titem.setValue(textualType);\n\t\t\t\t\t\n\t\t\tListcell textCell = new Listcell();\n\t\t\ttextCell.setParent(item);\n\t\t\tLabel lblText = new Label(textualType.getValue());\n\t\t\tlblText.setParent(textCell);\n\t\t\tlblText.setWidth(\"100%\");\n\t\t}\t\n\t}\n}\n"}}},{"rowIdx":915,"cells":{"prompt":{"kind":"string","value":"Below is an extract of SQL code. Evaluate whether it has a high educational value and could help teach SQL and database concepts. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the code contains valid SQL syntax, even if it's just basic queries or simple table operations.\n- Add another point if the code addresses practical SQL concepts (e.g., JOINs, subqueries), even if it lacks comments.\n- Award a third point if the code is suitable for educational use and introduces key concepts in SQL and database management, even if the topic is somewhat advanced (e.g., indexes, transactions). The code should be well-structured and contain some comments.\n- Give a fourth point if the code is self-contained and highly relevant to teaching SQL. It should be similar to a database course exercise, demonstrating good practices in query writing and database design.\n- Grant a fifth point if the code is outstanding in its educational value and is perfectly suited for teaching SQL and database concepts. It should be well-written, easy to understand, and contain explanatory comments that clarify the purpose and impact of each part of the code.\n\nThe extract:\nDESC you;\r\n--查询表中所有数据SELECT*FROM 表名;\r\nSELECT*FROM you;\r\nSELECT*FROM stu;\r\n--插入操作 INSERT\r\n--向表you中插入信息\r\n--INSERT INTO 表名(列名1。。。) VALUES(列值1。。。);\r\nINSERT INTO you(my1,my2,my3,my4,my5,my6,my7,my8,my9)\r\nVALUES(1,'me','i am',20.55,'what a you doing?','10:10:10','1999-10-11','1999-10-10 10:10:10','ewadadsad'); \r\n--查看数据库编码的具体信息\r\nSHOW VARIABLES LIKE 'character%';\r\n--临时更改客户端和服务器结果集的编码\r\nSET character_set_client = utf8;\r\nSET character_set_results = gbk;\r\n--修改操作 UPDATE\r\n--将my1的内容全部修改成10\r\nUPDATE you SET my1 = 10;\r\n--将my1 =10的my5改成什么鬼\r\nUPDATE you SET my5='什么鬼' WHERE my1 =10;\r\n--将my1 = 10的my3 my5 修改成以下内容\r\nUPDATE you SET my5='honey wenjiejie',my3 = 18.0 WHERE my1 =10;\r\n--将my3 = 18.0的my1在基础上增加20\r\nUPDATE you SET my1 = my1+20 WHERE my3 = 18.0;\r\n--删除操作 DELETE \r\n--DELETE 表名 WHERE 列名=值\r\n--删除my1为1的一行记录\r\nDELETE FROM you WHERE my1 =1;\r\n--删除you中所有的记录\r\nDELETE FROM you;\r\n--使用TRUNCATE删除表中记录\r\nTRUNCATE FROM you;\r\n--DELETE 删除表中的数据,表结构还在;删除后的数据可以找回\r\n--TRUNCATE 删除是把表直接DROP掉,然后再创建一个同样的新表。\r\n--删除的数据不能找回。执行速度比DELETE快。\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"sql"},"label":{"kind":"number","value":4,"string":"4"},"text":{"kind":"string","value":"DESC you;\r\n--查询表中所有数据SELECT*FROM 表名;\r\nSELECT*FROM you;\r\nSELECT*FROM stu;\r\n--插入操作 INSERT\r\n--向表you中插入信息\r\n--INSERT INTO 表名(列名1。。。) VALUES(列值1。。。);\r\nINSERT INTO you(my1,my2,my3,my4,my5,my6,my7,my8,my9)\r\nVALUES(1,'me','i am',20.55,'what a you doing?','10:10:10','1999-10-11','1999-10-10 10:10:10','ewadadsad'); \r\n--查看数据库编码的具体信息\r\nSHOW VARIABLES LIKE 'character%';\r\n--临时更改客户端和服务器结果集的编码\r\nSET character_set_client = utf8;\r\nSET character_set_results = gbk;\r\n--修改操作 UPDATE\r\n--将my1的内容全部修改成10\r\nUPDATE you SET my1 = 10;\r\n--将my1 =10的my5改成什么鬼\r\nUPDATE you SET my5='什么鬼' WHERE my1 =10;\r\n--将my1 = 10的my3 my5 修改成以下内容\r\nUPDATE you SET my5='honey wenjiejie',my3 = 18.0 WHERE my1 =10;\r\n--将my3 = 18.0的my1在基础上增加20\r\nUPDATE you SET my1 = my1+20 WHERE my3 = 18.0;\r\n--删除操作 DELETE \r\n--DELETE 表名 WHERE 列名=值\r\n--删除my1为1的一行记录\r\nDELETE FROM you WHERE my1 =1;\r\n--删除you中所有的记录\r\nDELETE FROM you;\r\n--使用TRUNCATE删除表中记录\r\nTRUNCATE FROM you;\r\n--DELETE 删除表中的数据,表结构还在;删除后的数据可以找回\r\n--TRUNCATE 删除是把表直接DROP掉,然后再创建一个同样的新表。\r\n--删除的数据不能找回。执行速度比DELETE快。"}}},{"rowIdx":916,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a JavaScript program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid JavaScript code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical JavaScript concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., asynchronous programming). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching JavaScript. It should be similar to a school exercise, a tutorial, or a JavaScript course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching JavaScript. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\nangular.module('OpenPlanModalService', ['ui.bootstrap'])\n\n.service('openPlanModal', ['$uibModal', function($uibModal) {\n var self = this;\n\n self.open = function(title, plans, openFn) {\n var modalInstance = $uibModal.open({\n templateUrl: 'js/modals/open-plan/open-plan-modal.html',\n animation: false,\n backdrop: false,\n size: 'lg',\n controller: ['$scope', function(modalScope) {\n modalScope.title = title;\n modalScope.query = {};\n modalScope.selectedPlan = null;\n modalScope.plans = plans;\n\n modalScope.selected = function(plan){\n modalScope.selectedPlan = plan;\n };\n\n modalScope.open = function() {\n openFn(modalScope.selectedPlan)\n .then(function() {\n modalInstance.close();\n });\n };\n\n modalScope.cancel = function(){\n modalInstance.close();\n };\n }]\n });\n };\n}]);\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"javascript"},"label":{"kind":"number","value":2,"string":"2"},"text":{"kind":"string","value":"angular.module('OpenPlanModalService', ['ui.bootstrap'])\n\n.service('openPlanModal', ['$uibModal', function($uibModal) {\n var self = this;\n\n self.open = function(title, plans, openFn) {\n var modalInstance = $uibModal.open({\n templateUrl: 'js/modals/open-plan/open-plan-modal.html',\n animation: false,\n backdrop: false,\n size: 'lg',\n controller: ['$scope', function(modalScope) {\n modalScope.title = title;\n modalScope.query = {};\n modalScope.selectedPlan = null;\n modalScope.plans = plans;\n\n modalScope.selected = function(plan){\n modalScope.selectedPlan = plan;\n };\n\n modalScope.open = function() {\n openFn(modalScope.selectedPlan)\n .then(function() {\n modalInstance.close();\n });\n };\n\n modalScope.cancel = function(){\n modalInstance.close();\n };\n }]\n });\n };\n}]);\n"}}},{"rowIdx":917,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a Rust program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid Rust code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical Rust concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., ownership, lifetimes). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching Rust. It should be similar to a school exercise, a tutorial, or a Rust course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching Rust. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\nuse crate::vector::Vector3;\nuse crate::ray::Ray;\nuse crate::sphere::HitRecord;\nuse rand::Rng;\n\n#[derive(Copy, Clone, Debug)]\npub enum SurfaceType {\n Diffuse,\n Reflective { fuzz: f64 },\n Refractive { ref_idx: f64 }\n}\n\n#[derive(Copy, Clone, Debug)]\npub struct Material {\n pub albedo: Vector3,\n pub surface: SurfaceType\n}\n\npub fn reflect(v: Vector3, n: Vector3) -> Vector3 {\n return v - 2.0 * v.dot(n) * n;\n}\n\npub fn refract(uv: Vector3, n: Vector3, etai_over_etat: f64) -> Vector3 {\n let cos_theta = -uv.dot(n);\n let r_out_perp = etai_over_etat * (uv + cos_theta * n);\n let r_out_parallel = -(1.0 - r_out_perp.norm()).abs().sqrt() * n;\n return r_out_perp + r_out_parallel;\n}\n\npub fn schlick(cosine: &f64, ref_idx: &f64) -> f64 {\n let mut r0 = (1.0 - ref_idx) / (1.0 + ref_idx);\n r0 = r0 * r0;\n return r0 + (1.0 - r0) * ((1.0 - cosine).powf(5.0));\n}\n\nimpl Material {\n pub fn init() -> Self {\n Self {\n albedo: Vector3::zero(),\n surface: SurfaceType::Diffuse\n }\n }\n\n pub fn scatter(&self, ray: &Ray, rec: &HitRecord, attenuation: &mut Vector3, scattered: &mut Ray) -> bool {\n match self.surface {\n // Diffuse\n SurfaceType::Diffuse => {\n let scatter_direction = rec.normal + Vector3::random_unit_vector();\n *scattered = Ray{origin: rec.p, direction: scatter_direction};\n *attenuation = self.albedo;\n return true;\n },\n // Reflective\n SurfaceType::Reflective { mut fuzz } => {\n fuzz = if fuzz < 1.0 { fuzz } else { 1.0 };\n let reflected = reflect(Vector3::unit_vector(ray.direction), rec.normal);\n *scattered = Ray{origin: rec.p, direction: reflected + fuzz * Vector3::random_in_unit_sphere()};\n *attenuation = self.albedo;\n return scattered.direction.dot(rec.normal) > 0.0;\n },\n // Refractive\n SurfaceType::Refractive { ref_idx } => {\n *attenuation = Vector3::from_one(1.0);\n let etai_over_etat = if rec.front_face { 1.0 / ref_idx } else { ref_idx };\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"rust"},"label":{"kind":"number","value":4,"string":"4"},"text":{"kind":"string","value":"use crate::vector::Vector3;\nuse crate::ray::Ray;\nuse crate::sphere::HitRecord;\nuse rand::Rng;\n\n#[derive(Copy, Clone, Debug)]\npub enum SurfaceType {\n Diffuse,\n Reflective { fuzz: f64 },\n Refractive { ref_idx: f64 }\n}\n\n#[derive(Copy, Clone, Debug)]\npub struct Material {\n pub albedo: Vector3,\n pub surface: SurfaceType\n}\n\npub fn reflect(v: Vector3, n: Vector3) -> Vector3 {\n return v - 2.0 * v.dot(n) * n;\n}\n\npub fn refract(uv: Vector3, n: Vector3, etai_over_etat: f64) -> Vector3 {\n let cos_theta = -uv.dot(n);\n let r_out_perp = etai_over_etat * (uv + cos_theta * n);\n let r_out_parallel = -(1.0 - r_out_perp.norm()).abs().sqrt() * n;\n return r_out_perp + r_out_parallel;\n}\n\npub fn schlick(cosine: &f64, ref_idx: &f64) -> f64 {\n let mut r0 = (1.0 - ref_idx) / (1.0 + ref_idx);\n r0 = r0 * r0;\n return r0 + (1.0 - r0) * ((1.0 - cosine).powf(5.0));\n}\n\nimpl Material {\n pub fn init() -> Self {\n Self {\n albedo: Vector3::zero(),\n surface: SurfaceType::Diffuse\n }\n }\n\n pub fn scatter(&self, ray: &Ray, rec: &HitRecord, attenuation: &mut Vector3, scattered: &mut Ray) -> bool {\n match self.surface {\n // Diffuse\n SurfaceType::Diffuse => {\n let scatter_direction = rec.normal + Vector3::random_unit_vector();\n *scattered = Ray{origin: rec.p, direction: scatter_direction};\n *attenuation = self.albedo;\n return true;\n },\n // Reflective\n SurfaceType::Reflective { mut fuzz } => {\n fuzz = if fuzz < 1.0 { fuzz } else { 1.0 };\n let reflected = reflect(Vector3::unit_vector(ray.direction), rec.normal);\n *scattered = Ray{origin: rec.p, direction: reflected + fuzz * Vector3::random_in_unit_sphere()};\n *attenuation = self.albedo;\n return scattered.direction.dot(rec.normal) > 0.0;\n },\n // Refractive\n SurfaceType::Refractive { ref_idx } => {\n *attenuation = Vector3::from_one(1.0);\n let etai_over_etat = if rec.front_face { 1.0 / ref_idx } else { ref_idx };\n\n let unit_direction = Vector3::unit_vector(ray.direction);\n\n let mut cos_theta = -unit_direction.dot(rec.normal);\n cos_theta = if cos_theta < 1.0 { cos_theta } else { 1.0 };\n let sin_theta = (1.0 - cos_theta * cos_theta).sqrt();\n\n if etai_over_etat * sin_theta > 1.0 {\n let reflected = reflect(unit_direction, rec.normal);\n *scattered = Ray{origin: rec.p, direction: reflected};\n return true;\n }\n\n let reflect_prob = schlick(&cos_theta, &etai_over_etat);\n\n let mut rng = rand::thread_rng();\n if rng.gen::() < reflect_prob {\n let reflected = reflect(unit_direction, rec.normal);\n *scattered = Ray{origin: rec.p, direction: reflected};\n return true;\n }\n\n let refracted = refract(unit_direction, rec.normal, etai_over_etat);\n *scattered = Ray{origin: rec.p, direction: refracted};\n return true;\n }\n }\n }\n}\n"}}},{"rowIdx":918,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a Rust program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid Rust code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical Rust concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., ownership, lifetimes). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching Rust. It should be similar to a school exercise, a tutorial, or a Rust course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching Rust. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\nuse super::addres_mode::AddressMode;\nuse super::instruction::Instruction;\nuse super::Cpu6502;\n\nuse std::collections::HashMap;\n\nconst HEX_TABLE: &str = \"0123456789ABCDEF\";\n\nfn to_hex(value: u32, hex_size: u8) -> String {\n let mut temp_value = value;\n let mut text = Vec::::new();\n\n // inicia o array com o tamanho do hex_size com zeros\n text.resize(hex_size as usize, 0);\n\n // começar do ultimo caracter para o primeiro\n for i in (0..hex_size).rev() {\n // identifica o caracter hex correpondente aos ultimos 4 bits\n let c = HEX_TABLE.as_bytes()[(temp_value & 0xF) as usize];\n text[i as usize] = c;\n\n // mover 4 bits para a direita para poder achar o valor do proximos 4 bits\n temp_value >>= 4;\n }\n\n String::from_utf8(text).unwrap()\n}\n\nimpl Cpu6502 {\n pub fn complete(&self) -> bool {\n self.cycles == 0\n }\n\n pub fn disassemble_instruction(&mut self) -> String {\n let mut addr = self.pc as u32;\n let mut value: u8 = 0;\n let mut lo: u8 = 0;\n let mut hi: u8 = 0;\n\n let mut instruction_line = format!(\"${}: \", to_hex(addr, 4));\n let opcode = self.read(addr as u16);\n addr += 1;\n let instruction = Instruction::from(opcode);\n instruction_line += &format!(\"{} \", instruction.name);\n\n match instruction.addres_mode {\n AddressMode::IMP => {\n instruction_line += \" {IMP}\";\n }\n AddressMode::IMM => {\n value = self.bus_read(addr as u16, true);\n instruction_line += &format!(\"#${} {{IMM}}\", to_hex(value as u32, 2));\n }\n AddressMode::ZP0 => {\n lo = self.bus_read(addr as u16, true);\n instruction_line += &format!(\"${} {{ZP0}}\", to_hex(lo as u32, 2));\n }\n AddressMode::ZPX => {\n lo = self.bus_read(addr as u16, true);\n instruction_line += &format!(\"${}, X {{ZPX}}\", to_hex(lo as u32,\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"rust"},"label":{"kind":"number","value":4,"string":"4"},"text":{"kind":"string","value":"use super::addres_mode::AddressMode;\nuse super::instruction::Instruction;\nuse super::Cpu6502;\n\nuse std::collections::HashMap;\n\nconst HEX_TABLE: &str = \"0123456789ABCDEF\";\n\nfn to_hex(value: u32, hex_size: u8) -> String {\n let mut temp_value = value;\n let mut text = Vec::::new();\n\n // inicia o array com o tamanho do hex_size com zeros\n text.resize(hex_size as usize, 0);\n\n // começar do ultimo caracter para o primeiro\n for i in (0..hex_size).rev() {\n // identifica o caracter hex correpondente aos ultimos 4 bits\n let c = HEX_TABLE.as_bytes()[(temp_value & 0xF) as usize];\n text[i as usize] = c;\n\n // mover 4 bits para a direita para poder achar o valor do proximos 4 bits\n temp_value >>= 4;\n }\n\n String::from_utf8(text).unwrap()\n}\n\nimpl Cpu6502 {\n pub fn complete(&self) -> bool {\n self.cycles == 0\n }\n\n pub fn disassemble_instruction(&mut self) -> String {\n let mut addr = self.pc as u32;\n let mut value: u8 = 0;\n let mut lo: u8 = 0;\n let mut hi: u8 = 0;\n\n let mut instruction_line = format!(\"${}: \", to_hex(addr, 4));\n let opcode = self.read(addr as u16);\n addr += 1;\n let instruction = Instruction::from(opcode);\n instruction_line += &format!(\"{} \", instruction.name);\n\n match instruction.addres_mode {\n AddressMode::IMP => {\n instruction_line += \" {IMP}\";\n }\n AddressMode::IMM => {\n value = self.bus_read(addr as u16, true);\n instruction_line += &format!(\"#${} {{IMM}}\", to_hex(value as u32, 2));\n }\n AddressMode::ZP0 => {\n lo = self.bus_read(addr as u16, true);\n instruction_line += &format!(\"${} {{ZP0}}\", to_hex(lo as u32, 2));\n }\n AddressMode::ZPX => {\n lo = self.bus_read(addr as u16, true);\n instruction_line += &format!(\"${}, X {{ZPX}}\", to_hex(lo as u32, 2));\n }\n AddressMode::ZPY => {\n lo = self.bus_read(addr as u16, true);\n instruction_line += &format!(\"${}, Y {{ZPY}}\", to_hex(lo as u32, 2));\n }\n AddressMode::IZX => {\n lo = self.bus_read(addr as u16, true);\n instruction_line += &format!(\"${}, X {{IZX}}\", to_hex(lo as u32, 2));\n }\n AddressMode::IZY => {\n lo = self.bus_read(addr as u16, true);\n instruction_line += &format!(\"${}, Y {{IZY}}\", to_hex(lo as u32, 2));\n }\n AddressMode::ABS => {\n lo = self.bus_read(addr as u16, true);\n addr += 1;\n hi = self.bus_read(addr as u16, true);\n instruction_line +=\n &format!(\"${} {{ABS}}\", to_hex(((hi as u32) << 8) | lo as u32, 4));\n }\n AddressMode::ABX => {\n lo = self.bus_read(addr as u16, true);\n addr += 1;\n hi = self.bus_read(addr as u16, true);\n instruction_line +=\n &format!(\"${}, X {{ABX}}\", to_hex(((hi as u32) << 8) | lo as u32, 2));\n }\n AddressMode::ABY => {\n lo = self.bus_read(addr as u16, true);\n addr += 1;\n hi = self.bus_read(addr as u16, true);\n instruction_line +=\n &format!(\"${}, Y {{ABY}}\", to_hex(((hi as u32) << 8) | lo as u32, 2));\n }\n AddressMode::IND => {\n lo = self.bus_read(addr as u16, true);\n addr += 1;\n hi = self.bus_read(addr as u16, true);\n instruction_line +=\n &format!(\"(${}) {{IND}}\", to_hex(((hi as u32) << 8) | lo as u32, 2));\n }\n AddressMode::REL => {\n value = self.bus_read(addr as u16, true);\n addr += 1;\n instruction_line += &format!(\n \"${} [${}] {{REL}}\",\n to_hex(value as u32, 2),\n to_hex(addr + value as u32, 4)\n );\n }\n _ => {}\n };\n\n return instruction_line;\n }\n\n // This is the disassembly function. Its workings are not required for emulation.\n // It is merely a convenience function to turn the binary instruction code into\n // human readable form. Its included as part of the emulator because it can take\n // advantage of many of the CPUs internal operations to do this.\n pub fn disassemble(&mut self, start: u16, stop: u16) -> HashMap {\n let mut addr: u32 = start as u32;\n let mut value: u8 = 0;\n let mut lo: u8 = 0;\n let mut hi: u8 = 0;\n\n // criar map\n let mut map_lines = HashMap::::new();\n let mut line_addr: u16 = 0;\n\n while addr <= stop as u32 {\n line_addr = addr as u16;\n\n let mut s_inst = format!(\"${}: \", to_hex(addr, 4));\n\n let opcode = self.read(addr as u16);\n addr += 1;\n let instruction = Instruction::from(opcode);\n s_inst += &format!(\"{} \", instruction.name);\n\n match instruction.addres_mode {\n AddressMode::IMP => {\n s_inst += \" {IMP}\";\n }\n AddressMode::IMM => {\n value = self.bus_read(addr as u16, true);\n addr += 1;\n s_inst += &format!(\"#${} {{IMM}}\", to_hex(value as u32, 2));\n }\n AddressMode::ZP0 => {\n lo = self.bus_read(addr as u16, true);\n addr += 1;\n hi = 0x00;\n s_inst += &format!(\"${} {{ZP0}}\", to_hex(lo as u32, 2));\n }\n AddressMode::ZPX => {\n lo = self.bus_read(addr as u16, true);\n addr += 1;\n hi = 0x00;\n s_inst += &format!(\"${}, X {{ZPX}}\", to_hex(lo as u32, 2));\n }\n AddressMode::ZPY => {\n lo = self.bus_read(addr as u16, true);\n addr += 1;\n hi = 0x00;\n s_inst += &format!(\"${}, Y {{ZPY}}\", to_hex(lo as u32, 2));\n }\n AddressMode::IZX => {\n lo = self.bus_read(addr as u16, true);\n addr += 1;\n hi = 0x00;\n s_inst += &format!(\"${}, X {{IZX}}\", to_hex(lo as u32, 2));\n }\n AddressMode::IZY => {\n lo = self.bus_read(addr as u16, true);\n addr += 1;\n hi = 0x00;\n s_inst += &format!(\"${}, Y {{IZY}}\", to_hex(lo as u32, 2));\n }\n AddressMode::ABS => {\n lo = self.bus_read(addr as u16, true);\n addr += 1;\n hi = self.bus_read(addr as u16, true);\n addr += 1;\n s_inst += &format!(\"${} {{ABS}}\", to_hex(((hi as u32) << 8) | lo as u32, 2));\n }\n AddressMode::ABX => {\n lo = self.bus_read(addr as u16, true);\n addr += 1;\n hi = self.bus_read(addr as u16, true);\n addr += 1;\n s_inst += &format!(\"${}, X {{ABX}}\", to_hex(((hi as u32) << 8) | lo as u32, 2));\n }\n AddressMode::ABY => {\n lo = self.bus_read(addr as u16, true);\n addr += 1;\n hi = self.bus_read(addr as u16, true);\n addr += 1;\n s_inst += &format!(\"${}, Y {{ABY}}\", to_hex(((hi as u32) << 8) | lo as u32, 2));\n }\n AddressMode::IND => {\n lo = self.bus_read(addr as u16, true);\n addr += 1;\n hi = self.bus_read(addr as u16, true);\n addr += 1;\n s_inst += &format!(\"(${}) {{IND}}\", to_hex(((hi as u32) << 8) | lo as u32, 2));\n }\n AddressMode::REL => {\n value = self.bus_read(addr as u16, true);\n addr += 1;\n s_inst += &format!(\n \"${} [${}] {{REL}}\",\n to_hex(value as u32, 2),\n to_hex(addr + value as u32, 4)\n );\n }\n _ => {}\n };\n\n map_lines.insert(line_addr, s_inst);\n }\n\n map_lines\n }\n}\n"}}},{"rowIdx":919,"cells":{"prompt":{"kind":"string","value":"Below is an extract of SQL code. Evaluate whether it has a high educational value and could help teach SQL and database concepts. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the code contains valid SQL syntax, even if it's just basic queries or simple table operations.\n- Add another point if the code addresses practical SQL concepts (e.g., JOINs, subqueries), even if it lacks comments.\n- Award a third point if the code is suitable for educational use and introduces key concepts in SQL and database management, even if the topic is somewhat advanced (e.g., indexes, transactions). The code should be well-structured and contain some comments.\n- Give a fourth point if the code is self-contained and highly relevant to teaching SQL. It should be similar to a database course exercise, demonstrating good practices in query writing and database design.\n- Grant a fifth point if the code is outstanding in its educational value and is perfectly suited for teaching SQL and database concepts. It should be well-written, easy to understand, and contain explanatory comments that clarify the purpose and impact of each part of the code.\n\nThe extract:\n-- phpMyAdmin SQL Dump\n-- version 4.9.0.1\n-- https://www.phpmyadmin.net/\n--\n-- Host: 127.0.0.1\n-- Generation Time: Jul 27, 2019 at 11:26 AM\n-- Server version: 10.3.16-MariaDB\n-- PHP Version: 7.3.6\n\nSET SQL_MODE = \"NO_AUTO_VALUE_ON_ZERO\";\nSET AUTOCOMMIT = 0;\nSTART TRANSACTION;\nSET time_zone = \"+00:00\";\n\n\n/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;\n/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;\n/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;\n/*!40101 SET NAMES utf8mb4 */;\n\n--\n-- Database: `job`\n--\n\n-- --------------------------------------------------------\n\n--\n-- Table structure for table `applicants`\n--\n\nCREATE TABLE `applicants` (\n `a_id` bigint(20) UNSIGNED NOT NULL,\n `user_id` bigint(200) NOT NULL DEFAULT -1,\n `first_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `last_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `image` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `resume` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `skills` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;\n\n--\n-- Dumping data for table `applicants`\n--\n\nINSERT INTO `applicants` (`a_id`, `user_id`, `first_name`, `last_name`, `email`, `image`, `resume`, `skills`, `created_at`, `updated_at`) VALUES\n(1, 1, '', 'Islam', '', '1564181016.jpg', '1564181160.pdf', 'manik', '2019-07-25 12:36:06', '2019-07-25 12:36:06'),\n(2, 9, '', 'Manik', '', NULL, NULL, NULL, '2019-07-27 03:03:12', '2019-07-27 03:03:12');\n\n-- --------------------------------------------------------\n\n--\n-- Table structure for table `appliedjobs`\n--\n\nCREATE TABLE `appliedjobs` (\n `appliedjob_id` bigint(20) UNSIGNED NOT NULL,\n `applicant_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"sql"},"label":{"kind":"number","value":2,"string":"2"},"text":{"kind":"string","value":"-- phpMyAdmin SQL Dump\n-- version 4.9.0.1\n-- https://www.phpmyadmin.net/\n--\n-- Host: 127.0.0.1\n-- Generation Time: Jul 27, 2019 at 11:26 AM\n-- Server version: 10.3.16-MariaDB\n-- PHP Version: 7.3.6\n\nSET SQL_MODE = \"NO_AUTO_VALUE_ON_ZERO\";\nSET AUTOCOMMIT = 0;\nSTART TRANSACTION;\nSET time_zone = \"+00:00\";\n\n\n/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;\n/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;\n/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;\n/*!40101 SET NAMES utf8mb4 */;\n\n--\n-- Database: `job`\n--\n\n-- --------------------------------------------------------\n\n--\n-- Table structure for table `applicants`\n--\n\nCREATE TABLE `applicants` (\n `a_id` bigint(20) UNSIGNED NOT NULL,\n `user_id` bigint(200) NOT NULL DEFAULT -1,\n `first_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `last_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `image` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `resume` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `skills` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;\n\n--\n-- Dumping data for table `applicants`\n--\n\nINSERT INTO `applicants` (`a_id`, `user_id`, `first_name`, `last_name`, `email`, `image`, `resume`, `skills`, `created_at`, `updated_at`) VALUES\n(1, 1, '', 'Islam', '', '1564181016.jpg', '1564181160.pdf', 'manik', '2019-07-25 12:36:06', '2019-07-25 12:36:06'),\n(2, 9, '', 'Manik', '', NULL, NULL, NULL, '2019-07-27 03:03:12', '2019-07-27 03:03:12');\n\n-- --------------------------------------------------------\n\n--\n-- Table structure for table `appliedjobs`\n--\n\nCREATE TABLE `appliedjobs` (\n `appliedjob_id` bigint(20) UNSIGNED NOT NULL,\n `applicant_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `company_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `job_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;\n\n--\n-- Dumping data for table `appliedjobs`\n--\n\nINSERT INTO `appliedjobs` (`appliedjob_id`, `applicant_id`, `company_id`, `job_id`, `created_at`, `updated_at`) VALUES\n(1, '1', '3', '1', '2019-07-26 07:37:47', '2019-07-26 07:37:47'),\n(2, '1', '3', '2', '2019-07-26 07:40:24', '2019-07-26 07:40:24'),\n(3, '1', '3', '3', '2019-07-26 07:41:38', '2019-07-26 07:41:38');\n\n-- --------------------------------------------------------\n\n--\n-- Table structure for table `companies`\n--\n\nCREATE TABLE `companies` (\n `c_id` bigint(20) UNSIGNED NOT NULL,\n `user_id` bigint(200) DEFAULT NULL,\n `first_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `last_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `bussiness_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;\n\n--\n-- Dumping data for table `companies`\n--\n\nINSERT INTO `companies` (`c_id`, `user_id`, `first_name`, `last_name`, `email`, `bussiness_name`, `created_at`, `updated_at`) VALUES\n(1, 2, 'Adbur', 'Rahim', '', 'Namespace IT', '2019-07-25 12:36:45', '2019-07-25 12:36:45'),\n(3, 8, 'Abdur', 'Khalek', '', 'Namespace IT', '2019-07-25 14:13:38', '2019-07-25 14:13:38');\n\n-- --------------------------------------------------------\n\n--\n-- Table structure for table `jobdetails`\n--\n\nCREATE TABLE `jobdetails` (\n `id` bigint(20) UNSIGNED NOT NULL,\n `company_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `job_title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `job_description` varchar(2000) COLLATE utf8mb4_unicode_ci NOT NULL,\n `salary` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `job_location` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `country` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;\n\n--\n-- Dumping data for table `jobdetails`\n--\n\nINSERT INTO `jobdetails` (`id`, `company_id`, `job_title`, `job_description`, `salary`, `job_location`, `country`, `created_at`, `updated_at`) VALUES\n(1, '3', 'Junior Software Engineer', 'We`re looking for 30 fresh software engineers for our team. We`re looking for 30 fresh software engineers for our team. We`re looking for 30 fresh software engineers for our team. We`re looking for 30 fresh software engineers for our team.', '30000', 'Dhaka', 'Bangladesh', '2019-07-25 15:44:45', '2019-07-25 15:44:45'),\n(2, '3', 'Software Engineer', 'We`re looking for 30 fresh software engineers for our team. We`re looking for 30 fresh software engineers for our team. We`re looking for 30 fresh software engineers for our team. We`re looking for 30 fresh software engineers for our team.', '40000', 'Dhaka', 'Bangladesh', '2019-07-25 15:46:16', '2019-07-25 15:46:16'),\n(3, '3', 'Senior Software Engineer', 'We`re looking for 30 fresh software engineers for our team.We`re looking for 30 fresh software engineers for our team.We`re looking for 30 fresh software engineers for our team.We`re looking for 30 fresh software engineers for our team.', '60000', 'Dhaka', 'Bangladesh', '2019-07-25 15:48:54', '2019-07-25 15:48:54'),\n(6, '1', 'Junior Software Engineer', 'Graduation from Computer Science and Engineering. Graduation from Computer Science and Engineering. Graduation from Computer Science and Engineering', '30000', 'Dhaka', 'Bangladesh', '2019-07-27 00:39:02', '2019-07-27 02:24:51');\n\n-- --------------------------------------------------------\n\n--\n-- Table structure for table `migrations`\n--\n\nCREATE TABLE `migrations` (\n `id` int(10) UNSIGNED NOT NULL,\n `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `batch` int(11) NOT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;\n\n--\n-- Dumping data for table `migrations`\n--\n\nINSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES\n(1, '2014_10_12_000000_create_users_table', 1),\n(2, '2014_10_12_100000_create_password_resets_table', 1),\n(3, '2019_07_25_064524_create_company_table', 1),\n(4, '2019_07_25_064616_create_applicant_table', 1),\n(5, '2019_07_25_064705_create_jobdetails_table', 1),\n(6, '2019_07_25_064750_create_appliedjob_table', 1);\n\n-- --------------------------------------------------------\n\n--\n-- Table structure for table `password_resets`\n--\n\nCREATE TABLE `password_resets` (\n `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `created_at` timestamp NULL DEFAULT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;\n\n-- --------------------------------------------------------\n\n--\n-- Table structure for table `users`\n--\n\nCREATE TABLE `users` (\n `id` bigint(20) UNSIGNED NOT NULL,\n `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `user_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `email_verified_at` timestamp NULL DEFAULT NULL,\n `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;\n\n--\n-- Dumping data for table `users`\n--\n\nINSERT INTO `users` (`id`, `name`, `email`, `user_type`, `email_verified_at`, `password`, `remember_token`, `created_at`, `updated_at`) VALUES\n(1, '', '', 'applicant', NULL, '$2y$10$ic59exG.LPq24PyAFxedjuQD19GeBCxfHuk2Ggy7qevbuW9UEvJ9y', NULL, '2019-07-25 12:36:06', '2019-07-25 12:36:06'),\n(2, 'AdburRahim', '', 'company', NULL, '$2y$10$XUe7U8zu/740rj1MWLTlx.NqFULoOb8v.QfFVFyhnYbeClSjcADv6', NULL, '2019-07-25 12:36:46', '2019-07-25 12:36:46'),\n(4, 'AbdurKhalek', '', 'company', NULL, '$2y$10$d991G5rbUpt1ano4679D0OIoqkkRMO0ErjGTQ12omqEgJdC21j6uq', NULL, '2019-07-25 14:02:19', '2019-07-25 14:02:19'),\n(8, 'AbdurKhalek', '', 'company', NULL, '$2y$10$vMm/frdKGfgK4ImeltRI8u0scwEMcATUfjO9tQ4.Ok0g/eHXr5PfG', NULL, '2019-07-25 14:13:38', '2019-07-25 14:13:38'),\n(9, 'Md. AbdullahManik', '', 'applicant', NULL, '$2y$10$RKSZXOGzDdD8GStTwJ/WreA5Pli93RWA/v3kj3QeF2O5IqGSYLAE2', NULL, '2019-07-27 03:03:11', '2019-07-27 03:03:11');\n\n--\n-- Indexes for dumped tables\n--\n\n--\n-- Indexes for table `applicants`\n--\nALTER TABLE `applicants`\n ADD PRIMARY KEY (`a_id`),\n ADD UNIQUE KEY `applicants_email_unique` (`email`);\n\n--\n-- Indexes for table `appliedjobs`\n--\nALTER TABLE `appliedjobs`\n ADD PRIMARY KEY (`appliedjob_id`);\n\n--\n-- Indexes for table `companies`\n--\nALTER TABLE `companies`\n ADD PRIMARY KEY (`c_id`),\n ADD UNIQUE KEY `companies_email_unique` (`email`);\n\n--\n-- Indexes for table `jobdetails`\n--\nALTER TABLE `jobdetails`\n ADD PRIMARY KEY (`id`);\n\n--\n-- Indexes for table `migrations`\n--\nALTER TABLE `migrations`\n ADD PRIMARY KEY (`id`);\n\n--\n-- Indexes for table `password_resets`\n--\nALTER TABLE `password_resets`\n ADD KEY `password_resets_email_index` (`email`);\n\n--\n-- Indexes for table `users`\n--\nALTER TABLE `users`\n ADD PRIMARY KEY (`id`),\n ADD UNIQUE KEY `users_email_unique` (`email`);\n\n--\n-- AUTO_INCREMENT for dumped tables\n--\n\n--\n-- AUTO_INCREMENT for table `applicants`\n--\nALTER TABLE `applicants`\n MODIFY `a_id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;\n\n--\n-- AUTO_INCREMENT for table `appliedjobs`\n--\nALTER TABLE `appliedjobs`\n MODIFY `appliedjob_id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;\n\n--\n-- AUTO_INCREMENT for table `companies`\n--\nALTER TABLE `companies`\n MODIFY `c_id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;\n\n--\n-- AUTO_INCREMENT for table `jobdetails`\n--\nALTER TABLE `jobdetails`\n MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;\n\n--\n-- AUTO_INCREMENT for table `migrations`\n--\nALTER TABLE `migrations`\n MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;\n\n--\n-- AUTO_INCREMENT for table `users`\n--\nALTER TABLE `users`\n MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;\nCOMMIT;\n\n/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;\n/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;\n/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;\n"}}},{"rowIdx":920,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a Java program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid Java code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical Java concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., concurrent programming). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching Java. It should be similar to a school exercise, a tutorial, or a Java course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching Java. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\npackage riparazioni;\n\nimport java.util.Arrays;\n\npublic class DittaRiparazioni {\n\n private Tecnico[] tecnici;\n private int numTecnici;\n\n private Riparazione[] riparazioni;\n private int numRiparazioni;\n\n\n public DittaRiparazioni(Riparazione[] riparazioni, Tecnico[] tecnici){\n this.tecnici = tecnici;\n this.riparazioni = riparazioni;\n numTecnici = 0;\n for(Tecnico t : tecnici)\n if(t != null)\n numTecnici++;\n numRiparazioni = 0;\n for(Riparazione r : riparazioni)\n if(r != null)\n numRiparazioni++;\n }\n\n public Tecnico[] getTecnici(){\n return tecnici;\n }\n\n public boolean aggiungiRiparazione(Riparazione r){\n if (esisteRiparazioneDatoIndirizzo(r.getIndirizzo()))\n return false;\n if(numRiparazioni == riparazioni.length)\n return false;\n riparazioni[numRiparazioni] = r;\n numRiparazioni++;\n return true;\n }\n\n\n private boolean esisteRiparazioneDatoIndirizzo(String indirizzo){\n for (int i = 0; i < numRiparazioni; i++) {\n if (riparazioni[i].getIndirizzo().equals(indirizzo))\n return true;\n }\n\n return false;\n }\n\n\n public boolean aggiungiTecnico(Tecnico t){\n if (esisteTecnicoDatoNome(t.getNome()))\n return false;\n\n if (numTecnici == tecnici.length)\n return false;\n\n tecnici[numTecnici] = t;\n numTecnici++;\n return true;\n }\n\n\n private boolean esisteTecnicoDatoNome(String nome){\n for (int i = 0; i < numTecnici; i++) {\n if (tecnici[i] == null)\n break;\n\n if (tecnici[i].getNome().equals(nome))\n return true;\n }\n\n return false;\n }\n\n\n\n public Riparazione[] riparazioniInAttesa(){\n Riparazione[] inAttesa = new Riparazione[riparazioni.length];\n int countInAttesa = 0;\n\n for (int i = 0; i < numRiparazioni;\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"java"},"label":{"kind":"number","value":3,"string":"3"},"text":{"kind":"string","value":"package riparazioni;\n\nimport java.util.Arrays;\n\npublic class DittaRiparazioni {\n\n private Tecnico[] tecnici;\n private int numTecnici;\n\n private Riparazione[] riparazioni;\n private int numRiparazioni;\n\n\n public DittaRiparazioni(Riparazione[] riparazioni, Tecnico[] tecnici){\n this.tecnici = tecnici;\n this.riparazioni = riparazioni;\n numTecnici = 0;\n for(Tecnico t : tecnici)\n if(t != null)\n numTecnici++;\n numRiparazioni = 0;\n for(Riparazione r : riparazioni)\n if(r != null)\n numRiparazioni++;\n }\n\n public Tecnico[] getTecnici(){\n return tecnici;\n }\n\n public boolean aggiungiRiparazione(Riparazione r){\n if (esisteRiparazioneDatoIndirizzo(r.getIndirizzo()))\n return false;\n if(numRiparazioni == riparazioni.length)\n return false;\n riparazioni[numRiparazioni] = r;\n numRiparazioni++;\n return true;\n }\n\n\n private boolean esisteRiparazioneDatoIndirizzo(String indirizzo){\n for (int i = 0; i < numRiparazioni; i++) {\n if (riparazioni[i].getIndirizzo().equals(indirizzo))\n return true;\n }\n\n return false;\n }\n\n\n public boolean aggiungiTecnico(Tecnico t){\n if (esisteTecnicoDatoNome(t.getNome()))\n return false;\n\n if (numTecnici == tecnici.length)\n return false;\n\n tecnici[numTecnici] = t;\n numTecnici++;\n return true;\n }\n\n\n private boolean esisteTecnicoDatoNome(String nome){\n for (int i = 0; i < numTecnici; i++) {\n if (tecnici[i] == null)\n break;\n\n if (tecnici[i].getNome().equals(nome))\n return true;\n }\n\n return false;\n }\n\n\n\n public Riparazione[] riparazioniInAttesa(){\n Riparazione[] inAttesa = new Riparazione[riparazioni.length];\n int countInAttesa = 0;\n\n for (int i = 0; i < numRiparazioni; i++) {\n if (riparazioni[i].getStato().equals(StatoRiparazione.inAttesa))\n {\n inAttesa[countInAttesa] = riparazioni[i];\n countInAttesa++;\n }\n }\n\n return inAttesa;\n }\n\n public Riparazione[] getRiparazioni() {\n return riparazioni;\n }\n\n public Riparazione getRiparazioneMaxPriorita(){\n Riparazione risultato = null;\n\n for (int i = 0; i < numRiparazioni; i++) {\n\n if (riparazioni[i].getStato().equals(StatoRiparazione.inAttesa))\n {\n if (risultato == null)\n risultato = riparazioni[i];\n else if (riparazioni[i].getPriorita() > risultato.getPriorita())\n risultato = riparazioni[i];\n }\n }\n\n return risultato;\n }\n\n\n\n public boolean assegnaProssimaRiparazione(){\n Tecnico tecnicoLibero = null;\n for (int i = 0; i < numTecnici; i++) {\n if (tecnici[i].getStato().equals(StatoTecnico.DISPONIBILE))\n {\n tecnicoLibero = tecnici[i];\n break;\n }\n }\n\n if (tecnicoLibero == null)\n return false;\n\n Riparazione maxPriorita = getRiparazioneMaxPriorita();\n\n maxPriorita.setStato(StatoRiparazione.inCorso);\n tecnicoLibero.setRiparazione(maxPriorita);\n\n return true;\n }\n\n\n public boolean setRiparazioneTerminata(String nomeTecnico) {\n Tecnico tecnico = cercaTecnicoPerNome(nomeTecnico);\n\n if (tecnico == null){\n System.out.println(\"nome tecnico non trovato\");\n return false;\n }\n\n if (tecnico.getRiparazione() == null)\n {\n System.out.println(\"il tecnico specificato non ha una riparazione in corso\");\n return false;\n }\n\n tecnico.getRiparazione().setStato(StatoRiparazione.terminata);\n tecnico.setRiparazione(null);\n\n return true;\n }\n\n private Tecnico cercaTecnicoPerNome(String nomeTecnico) {\n for (int i = 0; i < numTecnici; i++) {\n if (tecnici[i].getNome().equals(nomeTecnico))\n return tecnici[i];\n }\n\n return null;\n }\n\n public void mandaTecniciInFerie(String[] tecniciInFerie){\n for (String tecnicoInFerie : tecniciInFerie) {\n Tecnico t = cercaTecnicoPerNome(tecnicoInFerie);\n if(t != null)\n t.mettiInFerie();\n }\n }\n\n public static void main(String[] args) {\n Tecnico[] tecnici = {new Tecnico(\"mario\"), new Tecnico(\"giorgio\")};\n DittaRiparazioni d = new DittaRiparazioni(new Riparazione[5], tecnici);\n d.aggiungiRiparazione(new Riparazione(\"via roma\", 4));\n d.aggiungiRiparazione(new Riparazione(\"via milano\", 4));\n d.aggiungiRiparazione(new Riparazione(\"via milano2\", 4));\n d.aggiungiRiparazione(new Riparazione(\"via milano3\", 4));\n d.aggiungiRiparazione(new Riparazione(\"via milan4\", 4));\n d.aggiungiRiparazione(new Riparazione(\"via milano5\", 4));\n System.out.println(Arrays.toString(d.getRiparazioni()));\n System.out.println(d.getRiparazioneMaxPriorita());\n System.out.println(d.assegnaProssimaRiparazione());\n System.out.println(d.assegnaProssimaRiparazione());\n System.out.println(d.getRiparazioneMaxPriorita());\n System.out.println(!d.assegnaProssimaRiparazione());\n }\n\n}\n"}}},{"rowIdx":921,"cells":{"prompt":{"kind":"string","value":"Below is an extract of SQL code. Evaluate whether it has a high educational value and could help teach SQL and database concepts. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the code contains valid SQL syntax, even if it's just basic queries or simple table operations.\n- Add another point if the code addresses practical SQL concepts (e.g., JOINs, subqueries), even if it lacks comments.\n- Award a third point if the code is suitable for educational use and introduces key concepts in SQL and database management, even if the topic is somewhat advanced (e.g., indexes, transactions). The code should be well-structured and contain some comments.\n- Give a fourth point if the code is self-contained and highly relevant to teaching SQL. It should be similar to a database course exercise, demonstrating good practices in query writing and database design.\n- Grant a fifth point if the code is outstanding in its educational value and is perfectly suited for teaching SQL and database concepts. It should be well-written, easy to understand, and contain explanatory comments that clarify the purpose and impact of each part of the code.\n\nThe extract:\nPROMPT LOG TO F900_00_LOGGER.log\nPROMPT .\nSET AUTOCOMMIT OFF\nSET AUTOPRINT ON\nSET ECHO ON\nSET FEEDBACK ON\nSET PAUSE OFF\nSET SERVEROUTPUT ON SIZE 1000000\nSET TERMOUT ON\nSET TRIMOUT ON\nSET VERIFY ON\nSET trims on pagesize 3000\nSET auto off\nSET verify off echo off define on\nWHENEVER OSERROR EXIT FAILURE ROLLBACK\nWHENEVER SQLERROR EXIT FAILURE ROLLBACK\n\ndefine patch_name = 'F900_00_LOGGER'\ndefine patch_desc = 'Substitute views required for embedded install.'\ndefine patch_path = 'feature/F900/F900_00_LOGGER/'\nSPOOL F900_00_LOGGER.log\nCONNECT &&LOGGER_user/&&LOGGER_password@&&database\nset serveroutput on;\nselect user||'@'||global_name Connection from global_name;\n\n\nPROMPT VIEWS\n\nPROMPT dba_objects.vw \n@&&patch_path.dba_objects.vw;\nShow error;\n\nPROMPT dba_source.vw \n@&&patch_path.dba_source.vw;\nShow error;\n\nPROMPT dba_tab_columns.vw \n@&&patch_path.dba_tab_columns.vw;\nShow error;\n\nPROMPT dba_tables.vw \n@&&patch_path.dba_tables.vw;\nShow error;\n\nCOMMIT;\nCOMMIT;\nPROMPT \nPROMPT install_lite.sql - COMPLETED.\nspool off;\n\n\nCOMMIT;\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"sql"},"label":{"kind":"number","value":1,"string":"1"},"text":{"kind":"string","value":"PROMPT LOG TO F900_00_LOGGER.log\nPROMPT .\nSET AUTOCOMMIT OFF\nSET AUTOPRINT ON\nSET ECHO ON\nSET FEEDBACK ON\nSET PAUSE OFF\nSET SERVEROUTPUT ON SIZE 1000000\nSET TERMOUT ON\nSET TRIMOUT ON\nSET VERIFY ON\nSET trims on pagesize 3000\nSET auto off\nSET verify off echo off define on\nWHENEVER OSERROR EXIT FAILURE ROLLBACK\nWHENEVER SQLERROR EXIT FAILURE ROLLBACK\n\ndefine patch_name = 'F900_00_LOGGER'\ndefine patch_desc = 'Substitute views required for embedded install.'\ndefine patch_path = 'feature/F900/F900_00_LOGGER/'\nSPOOL F900_00_LOGGER.log\nCONNECT &&LOGGER_user/&&LOGGER_password@&&database\nset serveroutput on;\nselect user||'@'||global_name Connection from global_name;\n\n\nPROMPT VIEWS\n\nPROMPT dba_objects.vw \n@&&patch_path.dba_objects.vw;\nShow error;\n\nPROMPT dba_source.vw \n@&&patch_path.dba_source.vw;\nShow error;\n\nPROMPT dba_tab_columns.vw \n@&&patch_path.dba_tab_columns.vw;\nShow error;\n\nPROMPT dba_tables.vw \n@&&patch_path.dba_tables.vw;\nShow error;\n\nCOMMIT;\nCOMMIT;\nPROMPT \nPROMPT install_lite.sql - COMPLETED.\nspool off;\n\n\nCOMMIT;\n\n"}}},{"rowIdx":922,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a C program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid C code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical C concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., kernel development and compiler design). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching C. It should be similar to a school exercise, a tutorial, or a C course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching C. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\n/*\n * player.c\n *\n * Created on: 10 mars 2020\n * Author: korantin\n */\n\n\n#include \"player.h\"\n\nuint8_t moveShipLR(t_character *tab_ship, uint8_t way, t_pos old_pos) {\n\n\tif (way == LEFT) {\n\t\ttab_ship[old_pos - 1] = tab_ship[old_pos];\n\t\ttab_ship[old_pos] = ' ';\n\t\told_pos -= 1;\n\t} else if (way == RIGHT) {\n\t\ttab_ship[old_pos + 1] = tab_ship[old_pos];\n\t\ttab_ship[old_pos] = ' ';\n\t\told_pos += 1;\n\t}\n\t//vt100_clear_line();\n\treturn old_pos;\n}\n\nvoid movePlayerRocket(t_rocket *rocket, uint8_t *shoot) {\n\tif (*shoot == TRUE)\n\t{\n\t\trocket->pos_y -= 1;\n\n\t\t/* Affichage de la rocket */\n\t\tvt100_move(rocket->pos_x, rocket->pos_y);\n\t\tserial_putchar(rocket->rocket);\n\n\t\tif (rocket->old_pos_y != PLAYER_POSITION_Y)\n\t\t{\n\t\t\tvt100_move(rocket->old_pos_x, rocket->old_pos_y);\n\t\t\tserial_putchar(' ');\n\t\t}\n\n\t\t/* On sauvgarde l'ancienne position de la rocket */\n\t\trocket->old_pos_x = rocket->pos_x;\n\t\trocket->old_pos_y = rocket->pos_y;\n\n\t\tif (rocket->pos_y == 1)\n\t\t{\n\t\t\tvt100_move(rocket->old_pos_x, rocket->old_pos_y);\n\t\t\tserial_putchar(' ');\n\t\t\t*shoot = FALSE;\n\n\t\t}\n\t\telse\n\t\t{\n\t\t\t*shoot = TRUE;\n\t\t}\n\t}\n}\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"c"},"label":{"kind":"number","value":3,"string":"3"},"text":{"kind":"string","value":"/*\n * player.c\n *\n * Created on: 10 mars 2020\n * Author: korantin\n */\n\n\n#include \"player.h\"\n\nuint8_t moveShipLR(t_character *tab_ship, uint8_t way, t_pos old_pos) {\n\n\tif (way == LEFT) {\n\t\ttab_ship[old_pos - 1] = tab_ship[old_pos];\n\t\ttab_ship[old_pos] = ' ';\n\t\told_pos -= 1;\n\t} else if (way == RIGHT) {\n\t\ttab_ship[old_pos + 1] = tab_ship[old_pos];\n\t\ttab_ship[old_pos] = ' ';\n\t\told_pos += 1;\n\t}\n\t//vt100_clear_line();\n\treturn old_pos;\n}\n\nvoid movePlayerRocket(t_rocket *rocket, uint8_t *shoot) {\n\tif (*shoot == TRUE)\n\t{\n\t\trocket->pos_y -= 1;\n\n\t\t/* Affichage de la rocket */\n\t\tvt100_move(rocket->pos_x, rocket->pos_y);\n\t\tserial_putchar(rocket->rocket);\n\n\t\tif (rocket->old_pos_y != PLAYER_POSITION_Y)\n\t\t{\n\t\t\tvt100_move(rocket->old_pos_x, rocket->old_pos_y);\n\t\t\tserial_putchar(' ');\n\t\t}\n\n\t\t/* On sauvgarde l'ancienne position de la rocket */\n\t\trocket->old_pos_x = rocket->pos_x;\n\t\trocket->old_pos_y = rocket->pos_y;\n\n\t\tif (rocket->pos_y == 1)\n\t\t{\n\t\t\tvt100_move(rocket->old_pos_x, rocket->old_pos_y);\n\t\t\tserial_putchar(' ');\n\t\t\t*shoot = FALSE;\n\n\t\t}\n\t\telse\n\t\t{\n\t\t\t*shoot = TRUE;\n\t\t}\n\t}\n}\n\n\n"}}},{"rowIdx":923,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a C# program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\nAdd 1 point if the program contains valid C# code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\nAdd another point if the program addresses practical C# concepts, even if it lacks comments.\nAward a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., LINQ, reflection). The code should be well-structured and contain some comments.\nGive a fourth point if the program is self-contained and highly relevant to teaching C#. It should be similar to a school exercise, a tutorial, or a C# course section.\nGrant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching C#. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\npublic interface ISwitch\n{\n}\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"csharp"},"label":{"kind":"number","value":1,"string":"1"},"text":{"kind":"string","value":"public interface ISwitch\n{\n}"}}},{"rowIdx":924,"cells":{"prompt":{"kind":"string","value":"Below is an extract from an HTML document. Evaluate whether it has a high educational value and could help teach web development. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the document contains valid HTML markup, even if it's not educational, like boilerplate code or standard tags.\n- Add another point if the document addresses practical HTML concepts and uses semantic elements appropriately.\n- Award a third point if the document is suitable for educational use and introduces key web concepts, even if the topic is somewhat advanced (e.g., forms, metadata). The code should be well-structured and use clear, descriptive naming.\n- Give a fourth point if the document is self-contained and highly relevant to teaching HTML. It should be similar to a school exercise, a tutorial, or an HTML course section for early learners.\n- Grant a fifth point if the document is outstanding in its educational value and is perfectly suited for teaching HTML to beginners. It should be well-organized, easy to understand, and ideally include some explanatory comments or demonstrate best practices in HTML structure.\n\nThe extract:\n系统性能工具篇(perf) | dupengair的blog

系统性能工具篇(perf)

dupengair的blog

日拱一卒 精而悟道

系统性能工具篇(perf)

Oct 12, 2016 | 系统性能

系统性能工具篇(perf)

dupengair的blog

日拱一卒 精而悟道

系统性能工具篇(perf)

Oct 12, 2016 | 系统性能 | Hits

\n

系统性能工具篇(perf)


\n

一、介绍

    \n
  1. perf原名为Linux性能计数器(Performance Conunters for Linux),是一整套工具集,在2.6.31推出
  2. \n
  3. 现命名为Linux性能事件(Linux Performance Events),一个工具作为一个子命令,如perf stat执行stat命令
  4. \n
  5. 子命令

    \n
    annotate    读取perf.data,并显示注释\ndiff        分析两个perf.data文件之间的差异\nevlist        列出一个perf.data文件里的事件名称\nscript        读取perf.data,显示跟踪输出\nrecord        跟踪运行命令,记录到perf.data\nreport        读取perf.data并分析显示\ninject        过滤和加强事件流,加入额外信息\nkmem        内核内存slab属性跟踪\nkvm            kvm客户机操作系统跟踪\nlist        列出所有符号事件类型\nlock        分析锁事件\nprobe        定义新的动态跟踪点        \nsched        内核调度器跟踪        \nstat        跟踪运行命令,收集性能计数器统计信息\ntimechart    可视化系统在某个负载期间的总体性能\ntop            系统分析工具\n
  6. \n
  7. 基本原理
      \n
    • 对被检测对象进行采样,最简单是在tick中进行采样,在采样点判断程序上下文,如果程序90%cpu在某函数上,采样点分布也应该是这个概率,如果采样频率足够高,则结果会比较可靠
    • \n
    • 以时间点采样,获得程序运行时间分布
    • \n
    • 以cache missing采样,获得cache失效的代码
    • \n
    • 处理器硬件特性,PMU
        \n
      • 流水线:多级流水线,一个时钟周期内多条指令分别被流水线分开处理
      • \n
      • 超标量体系:处理器内部有多个执行单元,允许一个时钟周期发射多条指令
      • \n
      • 乱序执行
      • \n
      • 分支预测
      • \n
      \n
    • \n
    • Tracepoints:内核源代码中的一些hook
    • \n
    \n
  8. \n
  9. perf事件

    \n
      \n
    • Hardware event:PMU硬件事件,如cache misses
    • \n
    • Software event:内核产生的事件,如进程上下文切换,tick等
    • \n
    • Tracepoint event:内核静态tracepiont触发的事件

      \n
      ➜ perf list\nList of pre-defined events (to be used in -e):\n\n  branch-misses                                      [Hardware event]\n  stalled-cycles-backend OR idle-cycles-backend      [Hardware event]\n  stalled-cycles-frontend OR idle-cycles-frontend    [Hardware event]\n\n  alignment-faults                                   [Software event]\n  context-switches OR cs                             [Software event]\n  cpu-clock                                          [Software event]\n  cpu-migrations OR migrations                       [Software event]\n  dummy                                              [Software event]\n  emulation-faults                                   [Software event]\n  major-faults                                       [Software event]\n  minor-faults                                       [Software event]\n  page-faults OR faults                              [Software event]\n  task-clock                                         [Software event]\n\n  L1-dcache-load-misses                              [Hardware cache event]\n  L1-dcache-loads                                    [Hardware cache event]\n  L1-dcache-prefetch-misses                          [Hardware cache event]\n  L1-dcache-prefetches                               [Hardware cache event]\n  L1-dcache-store-misses                             [Hardware cache event]\n  L1-dcache-stores                                   [Hardware cache event]\n  L1-icache-load-misses                              [Hardware cache event]\n  L1-icache-loads                                    [Hardware cache event]\n  branch-load-misses                                 [Hardware cache event]\n  branch-loads                                       [Hardware cache event]\n  dTLB-load-misses                                   [Hardware cache event]\n  dTLB-loads                                         [Hardware cache event]\n  dTLB-store-misses                                  [Hardware cache event]\n  dTLB-stores                                        [Hardware cache event]\n  iTLB-load-misses                                   [Hardware cache event]\n  iTLB-loads                                         [Hardware cache event]\n\n  mem-loads OR cpu/mem-loads/                        [Kernel PMU event]\n\n  rNNN                                               [Raw hardware event descriptor]\n  cpu/t1=v1[,t2=v2,t3 ...]/modifier                  [Raw hardware event descriptor]\n   (see &apos;man perf-list&apos; on how to encode it)\n\n  mem:&lt;addr&gt;[/len][:access]                          [Hardware breakpoint]\n\n  block:block_bio_backmerge                          [Tracepoint event]\n  block:block_bio_bounce                             [Tracepoint event]\n  block:block_bio_complete                           [Tracepoint event]\n  block:block_bio_frontmerge                         [Tracepoint event]\n  block:block_bio_queue                              [Tracepoint event]\n  block:block_bio_remap                              [Tracepoint event]\n  ...\n
    • \n
    \n
  10. \n
\n

二、分析系统性能

    \n
  1. 使用perf top发现程序问题

    \n
      \n
    • 测试程序

      \n
      // test.c\nint func() \n{\n    int c = 0;\n    while(1)\n        c++;\n    return c;\n}\n\nvoid main()\n{\n    func();\n}\n\ngcc test.c -o test\n
    • \n
    • 使用perf top进行测试

      \n
      -&gt; perf top\nSamples: 39K of event &apos;cpu-clock&apos;, Event count (approx.): 5070747076                      │ 10 int  func()\nOverhead  Shared Object          Symbol                                                   │  9 {\n  99.43%  test                   [.] func                                                 │  8     int c = 0;\n   0.15%  [kernel]               [k] _raw_spin_unlock_irqrestore                          │  7     while(1)\n   0.07%  [e1000]                [k] e1000_xmit_frame                                     │  6         c++;\n   0.03%  docker                 [.] runtime.scanobject                                   │  5     return c - 1;\n   0.03%  [kernel]               [k] clear_page_orig                                      │  4 }\n   0.02%  docker                 [.] runtime.heapBitsForObject                            │  3\n   0.01%  docker                 [.] runtime.atomicor8                                    │  2 void main()\n   0.01%  docker                 [.] runtime.greyobject                                   │  1 {\n   0.01%  perf                   [.] 0x0000000000084d34                                   │11      func();\n

      0.01% perf [.] 0x000000000007a657

      \n
      ...\n
        \n
      • 很容易发现,系统cpu高的罪魁祸首是test进程的func函数,占用了99%的cpu
      • \n
      • 可以将光标移动到test行enter,此时可以进入针对该程序的操作菜单(都是些强大到变态得令人发指的功能~~)

        \n
        Annotate func                                                                                                                                                                       \nZoom into test(4983) thread                                                                                                                                                         \nZoom into test DSO                                                                                                                                                                  \nBrowse map details                                                                                                                                                                  \nRun scripts for samples of thread [test]                                                                                                                                            \nRun scripts for samples of symbol [func]                                                                                                                                            \nRun scripts for all samples                                                                                                                                                         \nExit     \n
          \n
        • Annotata func -&gt; 在运行态下实时打印程序汇编指令

          \n
          func  /home/almond/perf/test\n       │\n       │\n       │\n       │    Disassembly of section .text:\n       │\n       │    00000000004004f6 &lt;func&gt;:\n       │    func():\n       │      push   %rbp\n       │      mov    %rsp,%rbp\n       │      movl   $0x0,-0x4(%rbp)\n  0.00 │ b:┌─→addl   $0x1,-0x4(%rbp)\n100.00 │   └──jmp    b   \n
            \n
          • 看得出一条跳转到和运算的指令占用了100%的cpu
          • \n
          • 更加黑科技的是,在当前正在执行的指令上enter,就可以直接单步查看当前指令的运行过程,简直是欺负我没文化呀
          • \n
          \n
        • \n
        • Zoom into test(4983) thread -&gt; 查看程序内部运行状态

          \n
          Samples: 752K of event &apos;cpu-clock&apos;, Event count (approx.): 11520564279, Thread: test(4983)\nOverhead  Shared Object   Symbol                                                                                                                                                    \n  99.87%  test            [.] func                                                                                                                                                  \n   0.00%  [nf_conntrack]  [k] nf_ct_deliver_cached_events                                                                                                                           \n   0.00%  [kernel]        [k] ip_rcv   \n
        • \n
        • Zoom into test DSO -&gt; 多核情况下不同cpu的执行情况

          \n
            Samples: 35K of event &apos;cpu-clock&apos;, Event count (approx.): 6011362194, DSO: test\n  Overhead  Symbol                                                                                                                                                                    \n    86.59%  [.] func                                                                                                                                                                  \n    13.09%  [.] func                                                              \n\n- 虚拟机是双核的,看得出来即使是单线程cpu bound型程序,也是可以在多核上运行的,颠覆了以前的错误认知\n
        • \n
        • Browse map details -&gt; 进程的内存映射情况

          \n
          /home/almond/perf/test\n 3a8  400 g _init                                                                                                                                                                   \n 3e0  3f0 g __libc_start_main@plt                                                                                                                                                   \n 3f0  400 g __gmon_start__@plt                                                                                                                                                      \n 400  430 g _start                                                                                                                                                                  \n 430  470 l deregister_tm_clones                                                                                                                                                    \n 470  4b0 l register_tm_clones                                                                                                                                                      \n 4b0  4d0 l __do_global_dtors_aux                                                                                                                                                   \n 4d0  4f6 l frame_dummy                                                                                                                                                             \n 4f6  507 g func                                                                                                                                                                    \n 507  517 g main                                                                                                                                                                    \n 520  585 g __libc_csu_init                                                                                                                                                         \n 590  592 g __libc_csu_fini                                                                                                                                                         \n 594 1000 g _fini\n
            \n
          • 要恶补《程序员的自我修养》了,当时看了觉得无聊的知识顿时生动起来@_@
          • \n
          \n
        • \n
        • Run scripts for samples of thread [test] 试了没反应,留待后续发掘

          \n
        • \n
        • Run scripts for samples of symbol [func] 试了没反应,留待后续发掘
        • \n
        \n
      • \n
      \n
    • \n
    \n
  2. \n
\n

三、分析调用栈

    \n
  1. 分析

    \n
    ➜sudo perf record -a  -g test_cfg\nWorkload failed: No such file or directory\n\n➜ll\n# total 1.1M\n-rw------- 1 root   root   434K Sep 30 22:11 perf.data\n-rwxrwxr-x 1 almond almond 187K Sep 27 15:51 test_cfg\n-rwxrwxrwx 1 almond almond  892 Sep 27 13:33 test_cfg.cpp\n
  2. \n
  3. 读取结果

    \n
    ➜sudo perf report --stdio\n# To display the perf.data header info, please use --header/--header-only options.\n#\n#\n# Total Lost Samples: 0\n#\n# Samples: 32  of event &apos;cpu-clock&apos;\n# Event count (approx.): 8000000\n#\n# Children      Self  Command  Shared Object           Symbol\n# ........  ........  .......  ......................  ...............................\n#\n    93.75%     0.00%  swapper  [kernel.kallsyms]       [k] cpu_startup_entry\n            |\n            ---cpu_startup_entry\n               |\n               |--53.33%-- rest_init\n               |          start_kernel\n               |          x86_64_start_reservations\n               |          x86_64_start_kernel\n               |\n                --46.67%-- start_secondary\n
  4. \n
\n

三、分析调度器延时

    \n
  1. 分析

    \n
    ➜  sudo perf sched record ./test_BiTraverse\nPretraverse: 0 1 3 7 8 4 9 10 2 5 11 12 6 13 14\nMidtraverse: 7 3 8 1 9 4 10 0 11 5 12 2 13 6 14\nPosttraverse: 7 8 3 9 10 4 1 11 12 5 13 14 6 2 0\n[ perf record: Woken up 1 times to write data ]\n[ perf record: Captured and wrote 0.404 MB perf.data (164 samples) ]\n
  2. \n
  3. 查看结果

    \n
      \n
    • 查看平均延时和最大延时

      \n
      ➜ sudo perf sched latency\n -----------------------------------------------------------------------------------------------------------------\n  Task                  |   Runtime ms  | Switches | Average delay ms | Maximum delay ms | Maximum delay at       |\n -----------------------------------------------------------------------------------------------------------------\n  rcuos/1:18            |      0.149 ms |        2 | avg:    0.029 ms | max:    0.045 ms | max at: 125151.326540 s\n  tmux:2736             |      0.202 ms |        1 | avg:    0.020 ms | max:    0.020 ms | max at: 125151.338195 s\n  rcuos/0:9             |      0.195 ms |        3 | avg:    0.019 ms | max:    0.021 ms | max at: 125151.330488 s\n  test_BiTraverse:7001  |      1.327 ms |       10 | avg:    0.017 ms | max:    0.062 ms | max at: 125151.338179 s\n  kworker/u128:1:6932   |      0.017 ms |        1 | avg:    0.009 ms | max:    0.009 ms | max at: 125151.334474 s\n  rcu_sched:7           |      0.087 ms |        6 | avg:    0.005 ms | max:    0.006 ms | max at: 125151.330452 s\n  migration/0:11        |      0.000 ms |        1 | avg:    0.004 ms | max:    0.004 ms | max at: 125151.322444 s\n  perf:6998             |      0.134 ms |        2 | avg:    0.003 ms | max:    0.003 ms | max at: 125151.338332 s\n  kworker/1:1:36        |      0.083 ms |        6 | avg:    0.002 ms | max:    0.003 ms | max at: 125151.338117 s\n -----------------------------------------------------------------------------------------------------------------\n  TOTAL:                |      2.194 ms |       32 |\n  ---------------------------------------------------\n
    • \n
    \n
  4. \n
\n
* 查看报告\n\n        ➜ sudo perf report --stdio\n        # To display the perf.data header info, please use --header/--header-only options.\n        #\n        #\n        # Total Lost Samples: 0\n        #\n        # Samples: 44  of event &apos;sched:sched_switch&apos;\n        # Event count (approx.): 44\n        #\n        # Overhead  Command          Shared Object     Symbol\n        # ........  ...............  ................  ..............\n        #\n            29.55%  swapper          [kernel.vmlinux]  [k] __schedule\n            18.18%  test_BiTraverse  [kernel.vmlinux]  [k] __schedule\n            13.64%  kworker/1:1      [kernel.vmlinux]  [k] __schedule\n            13.64%  rcu_sched        [kernel.vmlinux]  [k] __schedule\n             9.09%  perf             [kernel.vmlinux]  [k] __schedule\n             6.82%  rcuos/0          [kernel.vmlinux]  [k] __schedule\n             4.55%  rcuos/1          [kernel.vmlinux]  [k] __schedule\n             2.27%  kworker/u128:1   [kernel.vmlinux]  [k] __schedule\n             2.27%  migration/0      [kernel.vmlinux]  [k] __schedule\n        ...\n
分享到
"}}},{"rowIdx":925,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a shell script. Evaluate whether it has a high educational value and could help teach shell scripting. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the script contains valid shell commands, even if it's not educational, like simple system calls or basic file operations.\n- Add another point if the script addresses practical shell scripting concepts (e.g., variables, conditionals), even if it lacks comments.\n- Award a third point if the script is suitable for educational use and introduces key concepts in shell scripting, even if the topic is somewhat advanced (e.g., functions, process management). The script should be well-structured and contain some comments.\n- Give a fourth point if the script is self-contained and highly relevant to teaching shell scripting. It should be similar to a tutorial example or a shell scripting course section, demonstrating good practices in script organization.\n- Grant a fifth point if the script is outstanding in its educational value and is perfectly suited for teaching shell scripting. It should be well-written, easy to understand, and contain step-by-step explanations in comments.\n\nThe extract:\n#!/usr/bin/env bash\n# Licensed to Elasticsearch B.V. under one or more contributor\n# license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright\n# ownership. Elasticsearch B.V. licenses this file to you under\n# the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http:#www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied. See the License for the\n# specific language governing permissions and limitations\n# under the License.\n\n#\n# For the Jenkins step and optional docker compose file\n# then query all the docker containers and export their\n# docker logs as individual files.\n#\n\nset -euo pipefail\n\nSTEP=${1:-\"\"}\nDOCKER_COMPOSE=${2:-\"docker-compose.yml\"}\n\nDOCKER_INFO_DIR=\"docker-info/${STEP}\"\nmkdir -p \"${DOCKER_INFO_DIR}\"\n\nif [ -e \"${DOCKER_COMPOSE}\" ] ; then\n cp \"${DOCKER_COMPOSE}\" \"${DOCKER_INFO_DIR}\"\nfi\ncd \"${DOCKER_INFO_DIR}\"\n\ndocker ps -a &> docker-containers.txt\n\nDOCKER_IDS=$(docker ps -aq)\n\nfor id in ${DOCKER_IDS}\ndo\n docker ps -af id=\"${id}\" --no-trunc &> \"${id}-cmd.txt\"\n docker logs \"${id}\" &> \"${id}.log\" || echo \"It is not possible to grab the logs of ${id}\"\n (docker inspect \"${id}\" | jq 'del(.[].Config.Env)' &> \"${id}-inspect.json\") || echo \"It is not possible to grab the inspect of ${id}\"\ndone\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"shell"},"label":{"kind":"number","value":3,"string":"3"},"text":{"kind":"string","value":"#!/usr/bin/env bash\n# Licensed to Elasticsearch B.V. under one or more contributor\n# license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright\n# ownership. Elasticsearch B.V. licenses this file to you under\n# the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http:#www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied. See the License for the\n# specific language governing permissions and limitations\n# under the License.\n\n#\n# For the Jenkins step and optional docker compose file\n# then query all the docker containers and export their\n# docker logs as individual files.\n#\n\nset -euo pipefail\n\nSTEP=${1:-\"\"}\nDOCKER_COMPOSE=${2:-\"docker-compose.yml\"}\n\nDOCKER_INFO_DIR=\"docker-info/${STEP}\"\nmkdir -p \"${DOCKER_INFO_DIR}\"\n\nif [ -e \"${DOCKER_COMPOSE}\" ] ; then\n cp \"${DOCKER_COMPOSE}\" \"${DOCKER_INFO_DIR}\"\nfi\ncd \"${DOCKER_INFO_DIR}\"\n\ndocker ps -a &> docker-containers.txt\n\nDOCKER_IDS=$(docker ps -aq)\n\nfor id in ${DOCKER_IDS}\ndo\n docker ps -af id=\"${id}\" --no-trunc &> \"${id}-cmd.txt\"\n docker logs \"${id}\" &> \"${id}.log\" || echo \"It is not possible to grab the logs of ${id}\"\n (docker inspect \"${id}\" | jq 'del(.[].Config.Env)' &> \"${id}-inspect.json\") || echo \"It is not possible to grab the inspect of ${id}\"\ndone\n"}}},{"rowIdx":926,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a Rust program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid Rust code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical Rust concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., ownership, lifetimes). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching Rust. It should be similar to a school exercise, a tutorial, or a Rust course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching Rust. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\n// for the capital I\n#![allow(non_snake_case)]\n\nuse nalgebra as na;\nuse na::{ Vector3 };\n\nuse crate::scene::Light;\n\n\npub struct PointLight {\n // Intensity (color)\n pub I: Vector3,\n\n // Position in space:\n pub p: Vector3\n}\n\n\nimpl PointLight {\n pub fn new(I: Vector3, p: Vector3) -> PointLight\n {\n return PointLight { I, p };\n }\n}\n\n\nimpl Light for PointLight {\n fn direction(&self, q: &Vector3, dir: &mut Vector3, max_t: &mut f64)\n {\n *dir = self.p - *q;\n *max_t = dir.norm();\n dir.normalize_mut();\n }\n\n fn get_intensity(&self) -> Vector3\n {\n return self.I;\n }\n}\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"rust"},"label":{"kind":"number","value":3,"string":"3"},"text":{"kind":"string","value":"// for the capital I\n#![allow(non_snake_case)]\n\nuse nalgebra as na;\nuse na::{ Vector3 };\n\nuse crate::scene::Light;\n\n\npub struct PointLight {\n // Intensity (color)\n pub I: Vector3,\n\n // Position in space:\n pub p: Vector3\n}\n\n\nimpl PointLight {\n pub fn new(I: Vector3, p: Vector3) -> PointLight\n {\n return PointLight { I, p };\n }\n}\n\n\nimpl Light for PointLight {\n fn direction(&self, q: &Vector3, dir: &mut Vector3, max_t: &mut f64)\n {\n *dir = self.p - *q;\n *max_t = dir.norm();\n dir.normalize_mut();\n }\n\n fn get_intensity(&self) -> Vector3\n {\n return self.I;\n }\n}\n"}}},{"rowIdx":927,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a PHP program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid PHP code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical PHP concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., object-oriented programming, namespaces). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching PHP. It should be similar to a school exercise, a tutorial, or a PHP course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching PHP. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\nassertEquals(2, $chartRangeFilter->filterColumnIndex);\n }\n\n public function testSettingColumnLabelWithConstructor()\n {\n $chartRangeFilter = new ChartRangeFilter('lines');\n\n $this->assertEquals('lines', $chartRangeFilter->filterColumnLabel);\n }\n\n /**\n * @depends testSettingColumnLabelWithConstructor\n * @covers \\Khill\\Lavacharts\\Dashboards\\Filters\\ChartRangeFilter::getType\n */\n public function testGetType()\n {\n $chartRangeFilter = new ChartRangeFilter('donuts');\n\n $this->assertEquals('ChartRangeFilter', $chartRangeFilter->getType());\n }\n}\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"php"},"label":{"kind":"number","value":2,"string":"2"},"text":{"kind":"string","value":"assertEquals(2, $chartRangeFilter->filterColumnIndex);\n }\n\n public function testSettingColumnLabelWithConstructor()\n {\n $chartRangeFilter = new ChartRangeFilter('lines');\n\n $this->assertEquals('lines', $chartRangeFilter->filterColumnLabel);\n }\n\n /**\n * @depends testSettingColumnLabelWithConstructor\n * @covers \\Khill\\Lavacharts\\Dashboards\\Filters\\ChartRangeFilter::getType\n */\n public function testGetType()\n {\n $chartRangeFilter = new ChartRangeFilter('donuts');\n\n $this->assertEquals('ChartRangeFilter', $chartRangeFilter->getType());\n }\n}\n"}}},{"rowIdx":928,"cells":{"prompt":{"kind":"string","value":"Below is an extract from an HTML document. Evaluate whether it has a high educational value and could help teach web development. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the document contains valid HTML markup, even if it's not educational, like boilerplate code or standard tags.\n- Add another point if the document addresses practical HTML concepts and uses semantic elements appropriately.\n- Award a third point if the document is suitable for educational use and introduces key web concepts, even if the topic is somewhat advanced (e.g., forms, metadata). The code should be well-structured and use clear, descriptive naming.\n- Give a fourth point if the document is self-contained and highly relevant to teaching HTML. It should be similar to a school exercise, a tutorial, or an HTML course section for early learners.\n- Grant a fifth point if the document is outstanding in its educational value and is perfectly suited for teaching HTML to beginners. It should be well-organized, easy to understand, and ideally include some explanatory comments or demonstrate best practices in HTML structure.\n\nThe extract:\n
中資股紛設黨委 凌駕公司利益

中資股紛設黨委 凌駕公司利益

【本報訊】為加強在港上市內企的影響力,近年最具體一招,無疑是將黨委工作寫入公司章程,藉此明確黨委在公司之職責,令不少內企的政治主導凌駕於企業經濟利益。

翻查今年內企公告,不少銀行在章程上已加入黨建工作,當中包括央企持有的銀行如光大銀行(6818)等。事實上,近年城商行已陸續加入黨委,有分析指由於過往城商行偏好向國企或龍頭企業貸款,故加強黨委控制、甚至凌駕城商行管理層,可有助增加小微貸款,並讓利予企業,以推動政府經濟政策。

共產黨員加入新地董事局

黨建工作也開始指向證券業,包括中金國際(3908)及中州證券(1375)。而不少地方公用企業如廣深鐵路(525)、成都高速(1785)、雲南水務(6839)等均在章程上加入黨委;此外最奇特是出版教科書業務為主的新華文軒,也加入黨委相關條文於章程上,似乎希望進一步加強黨對教育事業的控制。

作為香港經濟命脈的本地地產企業亦出現變化,當中新地(016)委任前華潤置地(1109)主席兼潤地黨委書記吳向東為獨立非執董,是四大地產商中首次有共產黨員加入董事局。

恒地(012)聯席主席兼董事總經理李家傑及李家誠、長和(001)及長實(1113)系李澤鉅、新世界(017)主席鄭家純及執行副主席鄭志剛,亦身兼現任或前任中央或地方政協,與內地政治關係只能延伸絕不可能割斷。

\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"html"},"label":{"kind":"number","value":1,"string":"1"},"text":{"kind":"string","value":"
中資股紛設黨委 凌駕公司利益

中資股紛設黨委 凌駕公司利益

【本報訊】為加強在港上市內企的影響力,近年最具體一招,無疑是將黨委工作寫入公司章程,藉此明確黨委在公司之職責,令不少內企的政治主導凌駕於企業經濟利益。

翻查今年內企公告,不少銀行在章程上已加入黨建工作,當中包括央企持有的銀行如光大銀行(6818)等。事實上,近年城商行已陸續加入黨委,有分析指由於過往城商行偏好向國企或龍頭企業貸款,故加強黨委控制、甚至凌駕城商行管理層,可有助增加小微貸款,並讓利予企業,以推動政府經濟政策。

共產黨員加入新地董事局

黨建工作也開始指向證券業,包括中金國際(3908)及中州證券(1375)。而不少地方公用企業如廣深鐵路(525)、成都高速(1785)、雲南水務(6839)等均在章程上加入黨委;此外最奇特是出版教科書業務為主的新華文軒,也加入黨委相關條文於章程上,似乎希望進一步加強黨對教育事業的控制。

作為香港經濟命脈的本地地產企業亦出現變化,當中新地(016)委任前華潤置地(1109)主席兼潤地黨委書記吳向東為獨立非執董,是四大地產商中首次有共產黨員加入董事局。

恒地(012)聯席主席兼董事總經理李家傑及李家誠、長和(001)及長實(1113)系李澤鉅、新世界(017)主席鄭家純及執行副主席鄭志剛,亦身兼現任或前任中央或地方政協,與內地政治關係只能延伸絕不可能割斷。

"}}},{"rowIdx":929,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a Rust program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid Rust code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical Rust concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., ownership, lifetimes). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching Rust. It should be similar to a school exercise, a tutorial, or a Rust course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching Rust. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\nuse super::widget::Widget;\nuse utils::shared::{share, Shared};\nuse std::rc::Rc;\n\npub fn widget_of(child: T) -> Shared where T: Widget + 'static {\n\tlet shared_ref: Shared = share(child);\n\t{\n\t\tlet widget_ref: Shared = shared_ref.clone() as Shared;\n\t\tshared_ref.borrow_mut().set_this(Rc::downgrade(&widget_ref));\n\t}\n\tshared_ref\n}\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"rust"},"label":{"kind":"number","value":2,"string":"2"},"text":{"kind":"string","value":"use super::widget::Widget;\nuse utils::shared::{share, Shared};\nuse std::rc::Rc;\n\npub fn widget_of(child: T) -> Shared where T: Widget + 'static {\n\tlet shared_ref: Shared = share(child);\n\t{\n\t\tlet widget_ref: Shared = shared_ref.clone() as Shared;\n\t\tshared_ref.borrow_mut().set_this(Rc::downgrade(&widget_ref));\n\t}\n\tshared_ref\n}\n"}}},{"rowIdx":930,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a Go program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid Go code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical Go concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., goroutines, interfaces). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching Go. It should be similar to a school exercise, a tutorial, or a Go course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching Go. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\n/*\nCopyright (c) 2017 \n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, sub to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n*/\n\npackage api\n\nimport (\n\t\"errors\"\n\t\"reflect\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/Jeffail/leaps/lib/api/events\"\n)\n\n//------------------------------------------------------------------------------\n\ntype tOutput struct {\n\tstdout []byte\n\tstderr []byte\n\terr error\n}\n\ntype mockRunner struct {\n\tcmds map[string]tOutput\n}\n\nfunc (m mockRunner) CMDRun(cmd string) ([]byte, []byte, error) {\n\to, ok := m.cmds[cmd]\n\tif ok {\n\t\treturn o.stdout, o.stderr, o.err\n\t}\n\treturn nil, nil, errors.New(\"cmd does not exist\")\n}\n\n//------------------------------------------------------------------------------\n\nfunc TestBasicCMDBroker(t *testing.T) {\n\teBroker := NewCMDBroker([]string{\"foo\", \"bar\"}, mockRunner{\n\t\tcmds: map[string]tOutput{\n\t\t\t\"foo\": {stdout: []byte(\"foo out\")},\n\t\t\t\"bar\": {stderr: []byte(\"bar err\"), err: errors.New(\"bar failed\")},\n\t\t},\n\t}, time.Second, logger, stats)\n\n\tdEmitter1 := &dudEmitter{\n\t\treqHandlers: map[string]RequestHandler{},\n\t\tresHandlers: ma\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"go"},"label":{"kind":"number","value":4,"string":"4"},"text":{"kind":"string","value":"/*\nCopyright (c) 2017 \n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, sub to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n*/\n\npackage api\n\nimport (\n\t\"errors\"\n\t\"reflect\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/Jeffail/leaps/lib/api/events\"\n)\n\n//------------------------------------------------------------------------------\n\ntype tOutput struct {\n\tstdout []byte\n\tstderr []byte\n\terr error\n}\n\ntype mockRunner struct {\n\tcmds map[string]tOutput\n}\n\nfunc (m mockRunner) CMDRun(cmd string) ([]byte, []byte, error) {\n\to, ok := m.cmds[cmd]\n\tif ok {\n\t\treturn o.stdout, o.stderr, o.err\n\t}\n\treturn nil, nil, errors.New(\"cmd does not exist\")\n}\n\n//------------------------------------------------------------------------------\n\nfunc TestBasicCMDBroker(t *testing.T) {\n\teBroker := NewCMDBroker([]string{\"foo\", \"bar\"}, mockRunner{\n\t\tcmds: map[string]tOutput{\n\t\t\t\"foo\": {stdout: []byte(\"foo out\")},\n\t\t\t\"bar\": {stderr: []byte(\"bar err\"), err: errors.New(\"bar failed\")},\n\t\t},\n\t}, time.Second, logger, stats)\n\n\tdEmitter1 := &dudEmitter{\n\t\treqHandlers: map[string]RequestHandler{},\n\t\tresHandlers: map[string]ResponseHandler{},\n\t\tsendChan: make(chan dudSendType),\n\t}\n\n\tgo eBroker.NewEmitter(\"foo1\", \"bar1\", dEmitter1)\n\n\tif err := compareGlobalMetadata(dEmitter1, events.GlobalMetadataMessage{\n\t\tMetadata: events.MetadataBody{\n\t\t\tType: events.CMDList,\n\t\t\tBody: events.CMDListMetadataMessage{\n\t\t\t\tCMDS: []string{\"foo\", \"bar\"},\n\t\t\t},\n\t\t},\n\t}); err != nil {\n\t\tt.Error(err)\n\t}\n\n\tif _, ok := dEmitter1.reqHandlers[events.GlobalMetadata]; !ok {\n\t\tt.Error(\"Global metadata handler was not bound\")\n\t}\n\tif dEmitter1.closeHandler == nil {\n\t\tt.Error(\"Close handler was not bound\")\n\t}\n\n\tif exp, act := 1, len(eBroker.emitters); exp != act {\n\t\tt.Errorf(\"Wrong count of emitters: %v != %v\", exp, act)\n\t}\n\n\tdEmitter1.reqHandlers[events.GlobalMetadata]([]byte(`{\n\t\t\"metadata\": {\n\t\t\t\"type\": \"cmd\",\n\t\t\t\"body\": {\n\t\t\t\t\"cmd\": {\n\t\t\t\t\t\"id\": 0\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}`))\n\n\tif err := compareGlobalMetadata(dEmitter1, events.GlobalMetadataMessage{\n\t\tMetadata: events.MetadataBody{\n\t\t\tType: events.CMDOutput,\n\t\t\tBody: events.CMDMetadataMessage{\n\t\t\t\tCMDData: events.CMDData{\n\t\t\t\t\tID: 0,\n\t\t\t\t\tStdout: \"foo out\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}); err != nil {\n\t\tt.Error(err)\n\t}\n\n\tdEmitter1.reqHandlers[events.GlobalMetadata]([]byte(`{\n\t\t\"metadata\": {\n\t\t\t\"type\": \"cmd\",\n\t\t\t\"body\": {\n\t\t\t\t\"cmd\": {\n\t\t\t\t\t\"id\": 1\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}`))\n\n\tif err := compareGlobalMetadata(dEmitter1, events.GlobalMetadataMessage{\n\t\tMetadata: events.MetadataBody{\n\t\t\tType: events.CMDOutput,\n\t\t\tBody: events.CMDMetadataMessage{\n\t\t\t\tCMDData: events.CMDData{\n\t\t\t\t\tID: 1,\n\t\t\t\t\tStderr: \"bar err\",\n\t\t\t\t\tError: \"bar failed\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}); err != nil {\n\t\tt.Error(err)\n\t}\n\n\terrExp := events.APIError{\n\t\tT: \"ERR_BAD_REQ\",\n\t\tErr: \"CMD Index was out of bounds\",\n\t}\n\n\terrAct := dEmitter1.reqHandlers[events.GlobalMetadata]([]byte(`{\n\t\t\"metadata\": {\n\t\t\t\"type\": \"cmd\",\n\t\t\t\"body\": {\n\t\t\t\t\"cmd\": {\n\t\t\t\t\t\"id\": 2\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}`))\n\n\tif !reflect.DeepEqual(errExp, errAct) {\n\t\tt.Errorf(\"Unexpected result from oob cmd: %v != %v\", errExp, errAct)\n\t}\n\n\tdEmitter1.closeHandler()\n\n\tif exp, act := 0, len(eBroker.emitters); exp != act {\n\t\tt.Errorf(\"Wrong count of emitters: %v != %v\", exp, act)\n\t}\n}\n\n//------------------------------------------------------------------------------\n"}}},{"rowIdx":931,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a Markdown document. Evaluate its educational value, considering both Markdown usage and the content itself. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the document uses basic Markdown syntax correctly (e.g., headers, lists, or emphasis), regardless of content.\n- Add another point if the document's content has some educational value, even if it's basic or limited in scope. The Markdown usage should be correct but might not be diverse.\n- Award a third point if the document demonstrates a good range of Markdown features (e.g., links, images, code blocks) AND the content provides clear, accurate information on a topic. The structure should be logical and easy to follow.\n- Give a fourth point if the document is well-suited for teaching both its subject matter and effective Markdown usage. It should use varied Markdown elements to enhance the presentation of educational content, similar to a well-crafted tutorial or lesson.\n- Grant a fifth point if the document is exceptional both in its use of Markdown and the educational value of its content. It should demonstrate advanced Markdown features (e.g., tables, task lists, footnotes), have an engaging structure, and provide comprehensive, high-quality educational content on its topic. The document should serve as an excellent example of using Markdown for educational purposes.\n\nThe extract:\n# MAE-494-Team-Eagle\nFiles developed for UAH MAE 494 course\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"markdown"},"label":{"kind":"number","value":1,"string":"1"},"text":{"kind":"string","value":"# MAE-494-Team-Eagle\nFiles developed for UAH MAE 494 course\n"}}},{"rowIdx":932,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a Rust program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid Rust code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical Rust concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., ownership, lifetimes). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching Rust. It should be similar to a school exercise, a tutorial, or a Rust course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching Rust. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\nuse std::collections::HashMap;\n\nstruct BiMap {\n char_codes_to_bytes: HashMap,\n bytes_to_char_codes: HashMap,\n}\n\nimpl BiMap {\n fn new() -> BiMap {\n BiMap{\n char_codes_to_bytes: HashMap::new(),\n bytes_to_char_codes: HashMap::new(),\n }\n }\n \n fn insert(&mut self, ch: char, code: u8) {\n self.char_codes_to_bytes.insert(ch, code);\n self.bytes_to_char_codes.insert(code, ch);\n }\n \n fn get_code(&self, ch: &char) -> u8 {\n self.char_codes_to_bytes[ch]\n }\n \n fn get_char(&self, byte: &u8) -> char {\n self.bytes_to_char_codes[byte]\n }\n}\n\nlazy_static! {\n static ref CHAR_CODE_MAP: BiMap = {\n let mut m = BiMap::new();\n m.insert(' ', 0);\n\t m.insert('A', 1);\n\t m.insert('B', 2);\n\t m.insert('C', 3);\n\t m.insert('D', 4);\n\t m.insert('E', 5);\n\t m.insert('F', 6);\n\t m.insert('G', 7);\n\t m.insert('H', 8);\n\t m.insert('I', 9);\n\t m.insert('∆', 10);\n\t m.insert('J', 11);\n\t m.insert('K', 12);\n\t m.insert('L', 13);\n\t m.insert('M', 14);\n\t m.insert('N', 15);\n\t m.insert('O', 16);\n\t m.insert('P', 17);\n\t m.insert('Q', 18);\n\t m.insert('R', 19);\n\t m.insert('∑', 20);\n\t m.insert('∏', 21);\n\t m.insert('S', 22);\n\t m.insert('T', 23);\n\t m.insert('U', 24);\n\t m.insert('V', 25);\n\t m.insert('W', 26);\n\t m.insert('X', 27);\n\t m.insert('Y', 28);\n\t m.insert('Z', 29);\n\t m.insert('0', 30);\n\t m.insert('1', 31);\n\t m.insert('2', 32);\n\t m.insert('3', 33);\n\t m.insert('4', 34);\n\t m.insert('5', 35);\n\t m.insert('6', 36);\n\t m.insert('7', 37);\n\t m.insert('8', 38);\n\t m.insert('9', 39);\n\t m.insert('.', 40);\n\t m.insert(',', 41);\n\t m.insert('(', 42);\n\t m.insert(')', 43);\n\t m.insert('+', 44);\n\t m.insert('-', 45);\n\t m.insert('*', 46);\n\t m.insert('/', 47);\n\t m.insert('=', 48);\n\t m.insert('$', 49);\n\t m.insert('<', 50);\n\t m.insert('>', 51);\n\t m.insert('@', 52);\n\t m.insert(';', 53);\n\t m.insert(':', 54);\n\t m.insert('\\'', 55);\n m\n };\n}\n\npub fn get_code(char_code: &char) -> u8 {\n CHAR_CODE_MAP.get_code(char_code)\n}\n\npub fn ge\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"rust"},"label":{"kind":"number","value":4,"string":"4"},"text":{"kind":"string","value":"use std::collections::HashMap;\n\nstruct BiMap {\n char_codes_to_bytes: HashMap,\n bytes_to_char_codes: HashMap,\n}\n\nimpl BiMap {\n fn new() -> BiMap {\n BiMap{\n char_codes_to_bytes: HashMap::new(),\n bytes_to_char_codes: HashMap::new(),\n }\n }\n \n fn insert(&mut self, ch: char, code: u8) {\n self.char_codes_to_bytes.insert(ch, code);\n self.bytes_to_char_codes.insert(code, ch);\n }\n \n fn get_code(&self, ch: &char) -> u8 {\n self.char_codes_to_bytes[ch]\n }\n \n fn get_char(&self, byte: &u8) -> char {\n self.bytes_to_char_codes[byte]\n }\n}\n\nlazy_static! {\n static ref CHAR_CODE_MAP: BiMap = {\n let mut m = BiMap::new();\n m.insert(' ', 0);\n\t m.insert('A', 1);\n\t m.insert('B', 2);\n\t m.insert('C', 3);\n\t m.insert('D', 4);\n\t m.insert('E', 5);\n\t m.insert('F', 6);\n\t m.insert('G', 7);\n\t m.insert('H', 8);\n\t m.insert('I', 9);\n\t m.insert('∆', 10);\n\t m.insert('J', 11);\n\t m.insert('K', 12);\n\t m.insert('L', 13);\n\t m.insert('M', 14);\n\t m.insert('N', 15);\n\t m.insert('O', 16);\n\t m.insert('P', 17);\n\t m.insert('Q', 18);\n\t m.insert('R', 19);\n\t m.insert('∑', 20);\n\t m.insert('∏', 21);\n\t m.insert('S', 22);\n\t m.insert('T', 23);\n\t m.insert('U', 24);\n\t m.insert('V', 25);\n\t m.insert('W', 26);\n\t m.insert('X', 27);\n\t m.insert('Y', 28);\n\t m.insert('Z', 29);\n\t m.insert('0', 30);\n\t m.insert('1', 31);\n\t m.insert('2', 32);\n\t m.insert('3', 33);\n\t m.insert('4', 34);\n\t m.insert('5', 35);\n\t m.insert('6', 36);\n\t m.insert('7', 37);\n\t m.insert('8', 38);\n\t m.insert('9', 39);\n\t m.insert('.', 40);\n\t m.insert(',', 41);\n\t m.insert('(', 42);\n\t m.insert(')', 43);\n\t m.insert('+', 44);\n\t m.insert('-', 45);\n\t m.insert('*', 46);\n\t m.insert('/', 47);\n\t m.insert('=', 48);\n\t m.insert('$', 49);\n\t m.insert('<', 50);\n\t m.insert('>', 51);\n\t m.insert('@', 52);\n\t m.insert(';', 53);\n\t m.insert(':', 54);\n\t m.insert('\\'', 55);\n m\n };\n}\n\npub fn get_code(char_code: &char) -> u8 {\n CHAR_CODE_MAP.get_code(char_code)\n}\n\npub fn get_char(byte: &u8) -> char {\n CHAR_CODE_MAP.get_char(byte)\n}\n"}}},{"rowIdx":933,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a Swift program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid Swift code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical Swift concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., protocols, extensions). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching Swift. It should be similar to a school exercise, a tutorial, or a Swift course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching Swift. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\n//\n// MYTPoCTests.swift\n// MYTPoCTests\n//\n// Created by Mukesh on 27/05/18.\n// Copyright © 2018 murugananda. All rights reserved.\n//\n\nimport XCTest\n@testable import MYTPoC\n\nclass MYTPoCTests: XCTestCase {\n \n override func setUp() {\n super.setUp()\n // Put setup code here. This method is called before the invocation of each test method in the class.\n }\n \n // Common Test for both list screen and map screen\n \n func testListApi() {\n\n let exception = self.expectation(description: \"Waiting for block to complete\")\n \n // **** Params to check for list screen **** //\n \n let params = [\"p1Lat\": 53.694865, \"p1Lon\": 9.757589, \"p2Lat\": 53.394655, \"p2Lon\": 10.099891]\n \n // **** Params to check for map screen with bounds ***** //\n \n// let params = [\"p1Lat\": 55.784899, \"p1Lon\": 37.649820, \"p2Lat\": 55.784899, \"p2Lon\": 37.585447, \"p3Lat\": 55.726651, \"p3Lon\": 37.649820, \"p4Lat\": 55.726651, \"p4Lon\": 37.585447]\n \n let listDetailURL = URL.init(string: RequestURLHelper.baseURL)!\n \n MYTWebManager.sharedManager.getDataBySending(params as NSDictionary, toURL: listDetailURL, withSuccess: { (response, userInfo) in\n \n exception.fulfill()\n XCTAssertNotNil(response, \"Response is nil for the requested URL\")\n \n do {\n let decodedJson = try JSONSerialization.data(withJSONObject: response!, options: .prettyPrinted)\n \n XCTAssertNotNil(decodedJson, \"Json value is nil\")\n \n let decoder = JSONDecoder()\n let listResponse = try decoder.decode(CodableContainer.self, from: decodedJson)\n \n XCTAssertNotNil(listResponse, \"Unexpected data type or missing values for the requested URL\")\n\n }\n catch {\n XCTAssertNil(error, \"\\(error.localizedDescription)\")\n }\n }, withFai\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"swift"},"label":{"kind":"number","value":2,"string":"2"},"text":{"kind":"string","value":"//\n// MYTPoCTests.swift\n// MYTPoCTests\n//\n// Created by Mukesh on 27/05/18.\n// Copyright © 2018 murugananda. All rights reserved.\n//\n\nimport XCTest\n@testable import MYTPoC\n\nclass MYTPoCTests: XCTestCase {\n \n override func setUp() {\n super.setUp()\n // Put setup code here. This method is called before the invocation of each test method in the class.\n }\n \n // Common Test for both list screen and map screen\n \n func testListApi() {\n\n let exception = self.expectation(description: \"Waiting for block to complete\")\n \n // **** Params to check for list screen **** //\n \n let params = [\"p1Lat\": 53.694865, \"p1Lon\": 9.757589, \"p2Lat\": 53.394655, \"p2Lon\": 10.099891]\n \n // **** Params to check for map screen with bounds ***** //\n \n// let params = [\"p1Lat\": 55.784899, \"p1Lon\": 37.649820, \"p2Lat\": 55.784899, \"p2Lon\": 37.585447, \"p3Lat\": 55.726651, \"p3Lon\": 37.649820, \"p4Lat\": 55.726651, \"p4Lon\": 37.585447]\n \n let listDetailURL = URL.init(string: RequestURLHelper.baseURL)!\n \n MYTWebManager.sharedManager.getDataBySending(params as NSDictionary, toURL: listDetailURL, withSuccess: { (response, userInfo) in\n \n exception.fulfill()\n XCTAssertNotNil(response, \"Response is nil for the requested URL\")\n \n do {\n let decodedJson = try JSONSerialization.data(withJSONObject: response!, options: .prettyPrinted)\n \n XCTAssertNotNil(decodedJson, \"Json value is nil\")\n \n let decoder = JSONDecoder()\n let listResponse = try decoder.decode(CodableContainer.self, from: decodedJson)\n \n XCTAssertNotNil(listResponse, \"Unexpected data type or missing values for the requested URL\")\n\n }\n catch {\n XCTAssertNil(error, \"\\(error.localizedDescription)\")\n }\n }, withFail: { (error, userInfo) in\n \n XCTFail(userInfo!)\n }) { (error, userInfo) in\n \n XCTFail(userInfo!)\n }\n\n self.waitForExpectations(timeout: 20.0, handler: nil)\n }\n \n override func tearDown() {\n // Put teardown code here. This method is called after the invocation of each test method in the class.\n super.tearDown()\n }\n \n func testExample() {\n // This is an example of a functional test case.\n // Use XCTAssert and related functions to verify your tests produce the correct results.\n }\n \n func testPerformanceExample() {\n // This is an example of a performance test case.\n self.measure {\n // Put the code you want to measure the time of here.\n }\n }\n \n}\n"}}},{"rowIdx":934,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a JavaScript program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid JavaScript code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical JavaScript concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., asynchronous programming). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching JavaScript. It should be similar to a school exercise, a tutorial, or a JavaScript course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching JavaScript. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\nvar mySql = require('mysql');\nrequire = ('dotenv/config');\n\nvar connect = mySql.createConnection({\n host:'localhost',\n user:'Kuzmanoska',\n password:'',\n database:'bank'\n});\n\nconnect.connect((error)=>{\n if(error){\n console.log('Problem with DataBase connection:' + error.message)\n }\n else{\n console.log('DataBase connected!')\n }\n});\n\nmodule.exports = connect;\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"javascript"},"label":{"kind":"number","value":2,"string":"2"},"text":{"kind":"string","value":"var mySql = require('mysql');\nrequire = ('dotenv/config');\n\nvar connect = mySql.createConnection({\n host:'localhost',\n user:'Kuzmanoska',\n password:'',\n database:'bank'\n});\n\nconnect.connect((error)=>{\n if(error){\n console.log('Problem with DataBase connection:' + error.message)\n }\n else{\n console.log('DataBase connected!')\n }\n});\n\nmodule.exports = connect;"}}},{"rowIdx":935,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a Go program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid Go code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical Go concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., goroutines, interfaces). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching Go. It should be similar to a school exercise, a tutorial, or a Go course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching Go. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\npackage Formatter\n\nimport (\n\t\"beego/app/models\"\n)\n\nfunc UserFormatter(model models.User) map[string]interface{} {\n\treturn map[string]interface{}{\n\t\t\"id\" : model.Id,\n\t\t\"name\" : model.Name,\n\t\t\"mobile\" : model.Mobile,\n\t\t\"password\" : model.Password,\n\t\t\"created_at\" : model.CreatedAt,\n\t}\n}\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"go"},"label":{"kind":"number","value":3,"string":"3"},"text":{"kind":"string","value":"package Formatter\n\nimport (\n\t\"beego/app/models\"\n)\n\nfunc UserFormatter(model models.User) map[string]interface{} {\n\treturn map[string]interface{}{\n\t\t\"id\" : model.Id,\n\t\t\"name\" : model.Name,\n\t\t\"mobile\" : model.Mobile,\n\t\t\"password\" : model.Password,\n\t\t\"created_at\" : model.CreatedAt,\n\t}\n}\n"}}},{"rowIdx":936,"cells":{"prompt":{"kind":"string","value":"Below is an extract from an HTML document. Evaluate whether it has a high educational value and could help teach web development. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the document contains valid HTML markup, even if it's not educational, like boilerplate code or standard tags.\n- Add another point if the document addresses practical HTML concepts and uses semantic elements appropriately.\n- Award a third point if the document is suitable for educational use and introduces key web concepts, even if the topic is somewhat advanced (e.g., forms, metadata). The code should be well-structured and use clear, descriptive naming.\n- Give a fourth point if the document is self-contained and highly relevant to teaching HTML. It should be similar to a school exercise, a tutorial, or an HTML course section for early learners.\n- Grant a fifth point if the document is outstanding in its educational value and is perfectly suited for teaching HTML to beginners. It should be well-organized, easy to understand, and ideally include some explanatory comments or demonstrate best practices in HTML structure.\n\nThe extract:\n\n\nFree ClickPLAY Quickfire 1 flash arcade game.\n\n\n\n\n

\nFree flash games.\n

\n

Play free online flash games.

\n
\n

Action | Adventure | Board | Casino | Driving | Dress Up | Fighting | Puzzles | Shooting | Education | Sports | Rhythm | Strategy | Customize | Jigsaw | Other

\n
\n

Play ClickPLAY Quickfire 1 flash game.

\n

\n\n\n

Play free ClickPLAY Quickfire 1 flash game.

\n\n
\n\n\"ClickPLAY\n\nPrimary Category: Puzzles.
\nSecondary Categories: .
\nC\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"html"},"label":{"kind":"number","value":3,"string":"3"},"text":{"kind":"string","value":"\n\nFree ClickPLAY Quickfire 1 flash arcade game.\n\n\n\n\n

\nFree flash games.\n

\n

Play free online flash games.

\n
\n

Action | Adventure | Board | Casino | Driving | Dress Up | Fighting | Puzzles | Shooting | Education | Sports | Rhythm | Strategy | Customize | Jigsaw | Other

\n
\n

Play ClickPLAY Quickfire 1 flash game.

\n

\n\n\n

Play free ClickPLAY Quickfire 1 flash game.

\n\n
\n\n\"ClickPLAY\n\nPrimary Category: Puzzles.
\nSecondary Categories: .
\nContent Rating: Everyone.\n
\n

\n
\n\n

Game Description:

Solve the puzzle - click play :)\n\n
\n\t\t\t\t\t\t\n\n
\n
\n

Play Instructions:

\n\n
\n\n
\n

Control Scheme:

\n\nFire: na.
\n\nMovement: na.
\nJump: na.\n
\n\nTags: ninjadoodle, clickplay, quickfire.
\nSize: 640x480.\n
\n\t\t\t\t\n

Game Embed Code:

\n

\n\n

Related games:

\n
\n \"Adorable\n

Adorable H...

I got a job in city. I am staying with my friend's house, without my appearance she locked me inside and went out. Today is my first day, it's getting late! please help me to escape from this house.
\n
\n \n

Azure bay....

You have to find five objects that hidden on the pictures.
\n
\n \"Flea\n

Flea Bath...

you have 30 seconds to get all the fleas off Paco-chan..good luck!
\n
\n \"Gearzzle\n

Gearzzle 2...

Move blue gears around in the field to connect the green gear with the red one. Can you solve the puzzle?
\n
\n \"FISP\"\n

FISP...

FISP is a collection of ten frustrating sliding puzzles, in which your goal is to slide a gold square piece to the goal squares, through a maze of other awkwardly-shaped pieces. How many can you complete?
\n
\n


\n

\n
\n

Action | Adventure | Board | Casino | Driving | Dress Up | Fighting | Puzzles | Shooting | Education | Sports | Rhythm | Strategy | Customize | Jigsaw | Other

\n

\nPosted by Free flash game web site creator tool from\n Boysofts.com. Free php script downloads.\n

\n
\n\n"}}},{"rowIdx":937,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a Markdown document. Evaluate its educational value, considering both Markdown usage and the content itself. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the document uses basic Markdown syntax correctly (e.g., headers, lists, or emphasis), regardless of content.\n- Add another point if the document's content has some educational value, even if it's basic or limited in scope. The Markdown usage should be correct but might not be diverse.\n- Award a third point if the document demonstrates a good range of Markdown features (e.g., links, images, code blocks) AND the content provides clear, accurate information on a topic. The structure should be logical and easy to follow.\n- Give a fourth point if the document is well-suited for teaching both its subject matter and effective Markdown usage. It should use varied Markdown elements to enhance the presentation of educational content, similar to a well-crafted tutorial or lesson.\n- Grant a fifth point if the document is exceptional both in its use of Markdown and the educational value of its content. It should demonstrate advanced Markdown features (e.g., tables, task lists, footnotes), have an engaging structure, and provide comprehensive, high-quality educational content on its topic. The document should serve as an excellent example of using Markdown for educational purposes.\n\nThe extract:\n---\nlayout: singleidea\nauthors: [RGRN]\ncategory: [vanilla]\ntags: [pit, ranged combat]\n---\nCreatures in pits are very hard to hit with projectiles.\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"markdown"},"label":{"kind":"number","value":2,"string":"2"},"text":{"kind":"string","value":"---\nlayout: singleidea\nauthors: [RGRN]\ncategory: [vanilla]\ntags: [pit, ranged combat]\n---\nCreatures in pits are very hard to hit with projectiles.\n"}}},{"rowIdx":938,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a C program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid C code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical C concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., kernel development and compiler design). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching C. It should be similar to a school exercise, a tutorial, or a C course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching C. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\n../plc-src/POUS.h\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"c"},"label":{"kind":"number","value":1,"string":"1"},"text":{"kind":"string","value":"../plc-src/POUS.h"}}},{"rowIdx":939,"cells":{"prompt":{"kind":"string","value":"Below is an extract from an HTML document. Evaluate whether it has a high educational value and could help teach web development. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the document contains valid HTML markup, even if it's not educational, like boilerplate code or standard tags.\n- Add another point if the document addresses practical HTML concepts and uses semantic elements appropriately.\n- Award a third point if the document is suitable for educational use and introduces key web concepts, even if the topic is somewhat advanced (e.g., forms, metadata). The code should be well-structured and use clear, descriptive naming.\n- Give a fourth point if the document is self-contained and highly relevant to teaching HTML. It should be similar to a school exercise, a tutorial, or an HTML course section for early learners.\n- Grant a fifth point if the document is outstanding in its educational value and is perfectly suited for teaching HTML to beginners. It should be well-organized, easy to understand, and ideally include some explanatory comments or demonstrate best practices in HTML structure.\n\nThe extract:\n\r\n\r\n\r\n\tSmart Start\r\n\t\r\n\r\n\r\n
\r\n\t
\r\n\t\t

My Website

\r\n\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t

\r\n\t\t\t\t
\r\n\t\t\t \r\n\t\t
\r\n
\r\n
\r\n\r\n
\r\n\r\n\r\n
\r\n\t
\r\n\t\t

Minor Smart Industry\r\n\t\t

\r\n\t
\r\n
\r\n \r\n\r\n\r\n
\r\n\t
\r\n\t\t
\r\n\r\n

Smart Value Proposition Design

\r\n \r\n Onderwerp: Co-design

\r\n \r\n

Introductie

\r\n \r\n

In dit artikel wordt aan\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"html"},"label":{"kind":"number","value":3,"string":"3"},"text":{"kind":"string","value":"\r\n\r\n\r\n\tSmart Start\r\n\t\r\n\r\n\r\n

\r\n\t
\r\n\t\t

My Website

\r\n\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t

\r\n\t\t\t\t
\r\n\t\t\t \r\n\t\t
\r\n
\r\n
\r\n\r\n
\r\n\r\n\r\n
\r\n\t
\r\n\t\t

Minor Smart Industry\r\n\t\t

\r\n\t
\r\n
\r\n \r\n\r\n\r\n
\r\n\t
\r\n\t\t
\r\n\r\n

Smart Value Proposition Design

\r\n \r\n Onderwerp: Co-design

\r\n \r\n

Introductie

\r\n \r\n

In dit artikel wordt aan de hand van\r\n wetenschappelijke artikelen en onderzoeksinstanties onderzoek gedaan naar het\r\n begrip co-design. Daarnaast worden andere manieren van design uitgelicht.

\r\n \r\n

Co-design

\r\n \r\n

Het lectoraat Co-Design (z.d.) van de\r\n Hogeschool Utrecht geeft de volgende definitie van co-design: 'Co-design bied\r\n een aanpak die inzichten in de context van de mensen verbindt met technologische\r\n mogelijkheden'. Co-design staat voor collaborative of cooperative design.\r\n Hiermee wordt bedoeld dat er door verschillende partijen met elk zijn eigen\r\n expertise of inzicht naar een probleem wordt gekeken om een passende oplossing\r\n hiervoor te vinden. Door samen met ieder zijn inzicht of expertise naar dit\r\n specifieke probleem te kijken wordt het mogelijk gemaakt om samen tot een\r\n (technologische) innovatie(s) te komen (Codesign, z.d.).

\r\n \r\n

Het begrip co-design begint steeds populairder\r\n te worden, wanneer je het begrip zoekt op google krijg je alleen al\r\n 13.110.000.000 resultaten. Wanneer je het begrip zoekt op Google Scholar krijg\r\n je 189.000 resultaten. Dit in vergelijking met 2007: Google 1.700.000\r\n resultaten en Google Scholar 11.800 resultaten (Sanders &amp; Stappers, 2007).

\r\n \r\n

Co-design vs co-creation

\r\n \r\n

Co-design wordt vaak verward met co-creation\r\n of mensen denken dat het het zelfde is. Co-creation wordt gezien als elke\r\n creatieve samenwerking tussen twee of meer mensen. Dit kan dus op elk gebied\r\n zijn. Co-design is een gedeelte van co-creation, het betreft het ontwerpproces\r\n waar getrainde en ongetrainde mensen samen aan werken. Het richt zich dus meer\r\n op het daadwerkelijke ontwerpproces (Sanders &amp; Stappers, 2008). Een\r\n praktijkvoorbeeld van co-creation zijn Youtube en Wikipedia, dit zijn\r\n platformen waar mensen informatie en content voor elkaar kunnen maken. Echter\r\n wanneer Youtube zijn website wilt verbeteren en de gebruikers hiervoor meerdere\r\n malen om hun mening vraag over het uiterlijk van de website is het weer\r\n co-design (Nina, 2015).

\r\n \r\n

Vraagstukken

\r\n \r\n

Co-design is op erg veel vraagstukken\r\n toepasbaar, zolang je maar goed genoeg zoekt naar de juiste partner(s) om samen\r\n mee te werken. Echter voor zeer specifieke projecten waarbij echt maar vanuit 1\r\n invalshoek gekeken kan worden is co-design niet mogelijk. Youtube is net\r\n genoemd als voorbeeld. Het is belangrijk dat co-design en co-creation niet door\r\n elkaar gehaald worden.

\r\n \r\n

Co-design vs design/system thinking

\r\n \r\n

Het grootste verschil tussen co-design en\r\n design/system thinking is dat bij design thinking en system thinking, zoals het\r\n woord al zegt, het erg procesmatig verloopt (Learning for sustainability, z.d.).\r\n Er zijn 6 verschillende stappen die belangrijk zijn in dit proces. Deze stappen\r\n zijn te vinden in figuur 1 (Thoring &amp; Müller, 2011).

\r\n \r\n

\"\"

\r\n \r\n

Om een Smart co-design te krijgen is het\r\n belangrijk om samen met andere te werken om een probleem op te lossen, net\r\n zoals bij een co-design. De focus moet hierbij extra liggen op technologische\r\n ontwikkelingen en innovaties. Het is van belang dat je samenwerkt met de\r\n betrokkenen en de eventuele gebruiker van het probleem (Kudo, 2016).

\r\n \r\n

Conclusie

\r\n \r\n

Co-design is het samenwerken met verschillende\r\n expertises en gezichtspunten om een (innovatieve) oplossing te vinden voor een\r\n probleem. Co-design kun je laten vallen onder co-creation, dit is het alles\r\n omvattende begrip van creatieve samenwerking van twee of meer mensen. Co-design\r\n richt zich meer op het ontwerpproces. Smart co-design is de samenwerking tussen\r\n verschillende partijen om op een innovatieve manier met technologische\r\n producten een innovatieve oplossing te vinden voor problemen.

\r\n \r\n

Interview vragen:

\r\n \r\n

Wat vind jij de meest interessante co-design?

\r\n \r\n

Wat is volgens jou het verschil tussen\r\n co-design en co-creation?

\r\n \r\n

&nbsp;

\r\n \r\n

Bronnenlijst

\r\n \r\n

Codesigners.nl. (z.d.) Over het lectoraat\r\n Co-Design. (Hogeschool Utrecht). Geraadpleegd op 26 september 2020, van https://codesigners.nl/

\r\n \r\n

.. (2016, 16 Juni). Co-design, Co-creation, and Co-production of Smart\r\n Mobility Systems. Geraadpleegd op 26\r\n september 2020, van https://link.springer.com/chapter/10.1007/978-3-319-40093-8_54

\r\n \r\n

&nbsp;

\r\n \r\n

Learningforsustainability.com. (z.d.) Design\r\n thinking and co-design. Geraadpleegd\r\n op 26 september 2020, van https://learningforsustainability.net/design-thinking/

\r\n \r\n

&nbsp;

\r\n \r\n

Nina. (2015, 16 juni). Een introductie van\r\n Co-design en Co-creation. Geraadpleegd op 26 september 2020, van http://studio22eight.nl/een-introductie-van-co-design-en-co-creation/

\r\n \r\n

&nbsp;

\r\n \r\n

. &amp; . (2008, 24 Juni). Co-creation and the new landscapes of design. Geraadpleegd op 26 september 2020, van https://www.tandfonline.com/doi/full/10.1080/15710880701875068

\r\n \r\n

&nbsp;

\r\n \r\n

. &amp; .. (2011, 9 september). Understanding\r\n Design thinking: A process model based on method engineering. Geraadpleegd op 26 september 2020, van https://www.designsociety.org/publication/30932/Understanding+Design+Thinking%3A+A+Process+Model+based+on+Method+Engineering

\r\n \r\n

&nbsp;

\r\n \r\n

De kwaliteit van het ingeleverde werk\r\n wordt beoordeeld aan de hand van de volgende criteria:

\r\n \r\n
Kwaliteit kennismateriaal
\r\n \r\n

De kwaliteit van het kennismateriaal is\r\n getoetst volgens de volgende criteria:

\r\n \r\n

-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r\n Betrouwbaarheid\r\n uitgever

\r\n \r\n

-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r\n Aantal citaten

\r\n \r\n

-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r\n Datum van\r\n publicatie

\r\n \r\n
Kwaliteit zoekstrategie
\r\n \r\n

Ik ben begonnen door op het reguliere\r\n google 'Co-design' te zoeken. Hiervoor heb ik gekozen zodat ik een eenvoudige\r\n uitleg krijg van het begrip. Om de informatie over de uitleg van dit begrip\r\n betrouwbaar te hebben heb ik gekozen voor de site codesigners.nl, deze site is\r\n onderdeel van het lectoraat Co-design van de Hogeschool Utrecht.

\r\n \r\n

Om meer inhoudelijke informatie te vinden\r\n ben ik opzoek gegaan via Google Scholar. Ik heb verschillende zoektermen gebruikt zoals: Co-design,\r\n co-creation, system thinking, design thinking, smart co-design, industry 4.0\r\n co-design en industry 5.0 co-design.

\r\n \r\n

Daarnaast heb ik tussen de literatuurlijst\r\n gekeken van de gebruikte bronnen om nog meer informatie te vergaren.

\r\n \r\n
Kwaliteit bepaling bruikbaarheid en\r\n selectiemethode
\r\n \r\n

Om de bruikbaarheid van de bronnen te\r\n bepalen heb ik de volgende selectiemethode gebruikt:

\r\n \r\n

-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r\n Samenvatting\r\n lezen

\r\n \r\n

-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r\n Globaal door\r\n het artikel lezen

\r\n \r\n

-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r\n Door middel\r\n van de zoekfunctie belangrijke trefwoorden zoeken

\r\n \r\n

Om de betrouwbaarheid van de artikelen te\r\n controleren heb ik gekeken naar:

\r\n \r\n

-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r\n Instantie/auteurs

\r\n \r\n

-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r\n Belangen van\r\n instantie/auteurs, waarom is dit artikel geschreven?

\r\n \r\n

-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r\n Datum van\r\n publicatie

\r\n \r\n
Kwaliteit peer review
\r\n \r\n

Ik heb Luuk en Nick hun stuk gereviewed. Dit\r\n hebben zij ook voor mij gedaan. Als eerste is de feedback op mijn stuk te\r\n vinden, vervolgens is de gegeven feedback te vinden.

\r\n \r\n

Van Luuk

\r\n \r\n

Algemeen:

\r\n \r\n

Gebruik bronvermelding bij de vergelijking met\r\n zoekresultaten uit 2007.

\r\n \r\n

Goed het verschil tussen co-design en\r\n co-creation uitgelegd met een duidelijk voorbeeld.

\r\n \r\n

In figuur 1 staan 6 stappen, maar je schrijft\r\n 5 op. Ik zou dit nog even veranderen.

\r\n \r\n

Duidelijke conclusie. Klopt het dat je bedoeld\r\n dat er vanuit verschillende gezichtspunten gewerkt wordt?

\r\n \r\n

Prima onderzoek. Ik zou nog wel even de\r\n bronnenlijst op alfabetische volgorde zetten.

\r\n \r\n

Zoekstrategie, bepaling bruikbaarheid en\r\n selectiemethode.

\r\n \r\n

Je beschrijft duidelijk je zoekstrategie. Ook\r\n slim dat je bij de literatuurlijsten kijkt van je gebruikte bronnen om zo\r\n vergelijkbare bronnen te kunnen vinden.

\r\n \r\n

Je beschrijft je selectiemethode, maar past\r\n hem vervolgens niet toe op je artikelen. Wellicht kan je hier kort noteren wat\r\n de resultaten zijn van je selectiemethode op je gebruikte bronnen.

\r\n \r\n

Peer review van Nick

\r\n \r\n

Algemeen:

\r\n \r\n

Tekst is prima te lezen. Soms wordt er net iets teveel\r\n spreektaal gebruikt.

\r\n \r\n

De verwijzing naar je figuur is niet correct conform APA\r\n normen. \"... in het onderstaande figuur' wordt dan' '... op Figuur 1'.

\r\n \r\n

Dit boekje gebruikt de HAN als APA bijbel:&nbsp;https://www.auteursrechten.nl/files/auteursrechten/2019-09/surf_de-apa-richtlijnen-uitgelegd_versie-november-2018.pdf.

\r\n \r\n

&nbsp;Kwaliteit kennismateriaal:

\r\n \r\n

Er staat een bron tussen, (Nina, 2016), wat eigenlijk een\r\n soort blog is van een bedrijf. De informatie klopt waarschijnlijk wel gewoon,\r\n maar een wetenschappelijk artikel is beter voor de betrouwbaarheid.

\r\n \r\n

&nbsp;Kwaliteit zoekstrategie:

\r\n \r\n

Misschien had je eerst alleen op Google Scholar kunnen\r\n zoeken en als daar niets uit komt pas naar de reguliere Google overstappen.

\r\n \r\n

Misschien had je kunnen definiëren welke zoekwoorden je\r\n precies hebt gebruikt om de herhaalbaarheid van je onderzoek te verbeteren.

\r\n \r\n

&nbsp;Kwaliteit bruikbaarheid en selectiemethode:

\r\n \r\n

Specificeren wat volgens jou de betrouwbaarheidscheck is.

\r\n \r\n

&nbsp;

\r\n \r\n

Peer review voor Nick

\r\n \r\n

Reviewed: Nick

\r\n \r\n

Reviewer: Job

\r\n \r\n

Per onderdeel zullen er tips gegeven worden om\r\n het artikel naar een hoger niveau te tillen.

\r\n \r\n

Algemeen

\r\n \r\n

Het\r\n eerste dat mij opvalt is dat op je voorblad staat: Wat is co-creatie? In je\r\n inleiding herhaal je dat dit onderzoek over co-creatie gaat. Ik dacht echter\r\n dat het onderzoek hoofdzakelijk ging over co-design. En dat co-design en\r\n co-creatie veel met elkaar te maken hebt klopt, maar volgens mij was de\r\n bedoeling dat dit onderzoek hoofdzakelijk over co-design gaat.

\r\n \r\n

Onderzoekstrategie\r\n

\r\n \r\n

Als\r\n tip voor de onderzoekstrategie wil ik je mee geven om ook tussen de\r\n bronnenlijsten van de door jou gebruikte bronnen te kijken. Hier staan vaak ook\r\n erg interessante bronnen die vaak wat dieper in gaan op een onderwerp.\r\n Daarnaast denk ik dat de zoektermen als 'smart', 'industry 4.0' en 'industry\r\n 5.0' een toegevoegde waarde zullen hebben voor je artikel. Een van de vragen is\r\n namelijk wat is Smart co-design?

\r\n \r\n

Bruikbaarheid en selectiemethode

\r\n \r\n

Ik\r\n vind dat je goed onderbouwd waarom je niet voor datum van publicatie filter\r\n hebt gekozen. Om de bruikbaarheid van een artikel te bepalen kun je ook gebruik\r\n maken van de zoekfunctie, typ hier voor jou relevante termen in om te kijken of\r\n ze terug komen in het artikel. Dan kun je globaal rond die termen lezen om te kijken\r\n of het bruikbaar is.

\r\n \r\n

Resultaten\r\n van het onderzoek

\r\n \r\n

Je\r\n begint heel logisch en goed met de uitleg van wat is co-design. Daarna stel je\r\n de vraag: welke positie heeft co-creatie ten opzichte van co-design. Ik zou\r\n deze vraag echter andersom stellen, aangezien dit onderzoek voornamelijk moet\r\n gaan over co-design en co-creatie maar een gedeelte van t onderzoek is.

\r\n \r\n

Je geeft een goed voorbeeld van co-design, dit\r\n helpt om het begrip beter te begrijpen.

\r\n \r\n

Conclusie

\r\n \r\n

Typfoutje: co-design kan in veel\r\n verschillende... ipv ik.

\r\n \r\n

&nbsp;

\r\n \r\n

Ik mis wel het stukje over Smart Co-design,\r\n dit is onderdeel van de opdracht en ik zou je aanraden dit nog toe te voegen.

\r\n \r\n

Daarnaast vind ik dat je een goed leesbaar en\r\n interessant stuk hebt geschreven.

\r\n \r\n

&nbsp;

\r\n \r\n

Peer review voor Luuk

\r\n \r\n

Peer review Luuk

\r\n \r\n

Reviewer: Job

\r\n \r\n

Per onderdeel zullen er tips gegeven worden om\r\n het artikel naar een hoger niveau te kunnen tillen.

\r\n \r\n

-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r\n Onderzoeksaanpak

\r\n \r\n

Je\r\n zou je zoektermen nog kunnen uitbreiden of breder kunnen maken. Denk\r\n bijvoorbeeld aan industry 4.0 of 5.0 in plaats van Smart Industry. Daarnaast\r\n vind je vaak interessante bronnen tussen de literatuurlijsten van gevonden\r\n bronnen. In deze bronnen gaan ze vaak dieper op het onderwerp in waarover\r\n geciteerd is.

\r\n \r\n

-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r\n Co-design vs co-creatie

\r\n \r\n

Ik snap niet helemaal waarom je hier de uitleg\r\n van de keuze voor deze bron hebt neer gezet. Dit lijkt me niet een stuk voor in\r\n je artikel? Maar juist bij de onderzoeksverantwoording(die\r\n beoordelingscriteria) .

\r\n \r\n

-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r\n Vraagstukken

\r\n \r\n

Je geeft aan dat co-design bij veel\r\n verschillende dingen gebruikt kan worden, zoals bijv. om klimaatverandering\r\n tegen te gaan. Misschien dat je wat beter kunt uitleggen waarom je dit\r\n voorbeeld geeft en waarom dit dan juist gebruikt kan worden?

\r\n \r\n

&nbsp;

\r\n \r\n

Je hebt nog niet aangegeven hoe je de\r\n kwaliteit van je bronnen hebt beoordeeld, op die van Sanders &amp; Stappers na\r\n dan. Dit geld ook voor de bruikbaarheid en selectiemethode.

\r\n \r\n

&nbsp;

\r\n \r\n
\r\n\t
\r\n\r\n\t\r\n
\r\n\r\n\r\n\r\n
\r\n\t

Copyright &copy; 2020

\r\n\r\n
\r\n\t\r\n\r\n
\r\n
\r\n\r\n"}}},{"rowIdx":940,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a PHP program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid PHP code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical PHP concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., object-oriented programming, namespaces). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching PHP. It should be similar to a school exercise, a tutorial, or a PHP course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching PHP. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\nparent = false;\n\n $this->blocks = array(\n );\n }\n\n protected function doDisplay(array $context, array $blocks = array())\n {\n // line 1\n echo \"
\n
\n

getAttribute(($context[\"header\"] ?? null), \"section_title_align\", array());\n echo \"; margin: \";\n echo $this->getAttribute(($context[\"header\"] ?? null), \"margin\", array());\n echo \"\\\"> \";\n echo $this->env->getExtension('Grav\\Common\\Twig\\TwigExtension')->markdownFunction($this->getAttribute(($context[\"header\"] ?? null), \"section_title\", array()));\n echo \"

\n
\n
\";\n }\n\n public function getTemplateName()\n {\n return \"modular/section_title.html.twig\";\n }\n\n public function isTraitable()\n {\n return false;\n }\n\n public function getDebugInfo()\n {\n return array ( 23 => 3, 19 => 1,);\n }\n\n /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */\n public function getSource()\n {\n @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);\n\n return $this->getSourceContext()->getCode();\n }\n\n public function getSourceContext()\n {\n return new Twig_Source(\"
\r\n
\r\n

{{ header.section_title|markdown }}

\r\n
\r\n
\", \"modular/section_title.html.twig\", \"/Applications/XAMPP/xamppfiles/htdocs/mowede/us\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"php"},"label":{"kind":"number","value":1,"string":"1"},"text":{"kind":"string","value":"parent = false;\n\n $this->blocks = array(\n );\n }\n\n protected function doDisplay(array $context, array $blocks = array())\n {\n // line 1\n echo \"
\n
\n

getAttribute(($context[\"header\"] ?? null), \"section_title_align\", array());\n echo \"; margin: \";\n echo $this->getAttribute(($context[\"header\"] ?? null), \"margin\", array());\n echo \"\\\"> \";\n echo $this->env->getExtension('Grav\\Common\\Twig\\TwigExtension')->markdownFunction($this->getAttribute(($context[\"header\"] ?? null), \"section_title\", array()));\n echo \"

\n
\n
\";\n }\n\n public function getTemplateName()\n {\n return \"modular/section_title.html.twig\";\n }\n\n public function isTraitable()\n {\n return false;\n }\n\n public function getDebugInfo()\n {\n return array ( 23 => 3, 19 => 1,);\n }\n\n /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */\n public function getSource()\n {\n @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);\n\n return $this->getSourceContext()->getCode();\n }\n\n public function getSourceContext()\n {\n return new Twig_Source(\"
\r\n
\r\n

{{ header.section_title|markdown }}

\r\n
\r\n
\", \"modular/section_title.html.twig\", \"/Applications/XAMPP/xamppfiles/htdocs/mowede/user/themes/bootstrap/templates/modular/section_title.html.twig\");\n }\n}\n"}}},{"rowIdx":941,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a C program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid C code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical C concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., kernel development and compiler design). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching C. It should be similar to a school exercise, a tutorial, or a C course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching C. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\ntypedef struct \n{\n\tunsigned int value:26;\n}\nint26;\n\ntypedef struct \n{\n\tunsigned int value:16;\n}\nint16;\n\ntypedef struct \n{\n\tunsigned int value:4;\n}\nint4;\n\ntypedef struct \n{\n\tunsigned int addr:22;\n}\nvirtualAddr;\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"c"},"label":{"kind":"number","value":1,"string":"1"},"text":{"kind":"string","value":"typedef struct \n{\n\tunsigned int value:26;\n}\nint26;\n\ntypedef struct \n{\n\tunsigned int value:16;\n}\nint16;\n\ntypedef struct \n{\n\tunsigned int value:4;\n}\nint4;\n\ntypedef struct \n{\n\tunsigned int addr:22;\n}\nvirtualAddr;"}}},{"rowIdx":942,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a Go program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid Go code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical Go concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., goroutines, interfaces). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching Go. It should be similar to a school exercise, a tutorial, or a Go course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching Go. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\npackage db\n\nimport (\n\t\"database/sql\"\n\n\t\"github.com/MninaTB/dnadb/intern/model\"\n)\n\nconst (\n\tselectBreed = `SELECT id, name, mail, internet, country FROM breed`\n\tselectBreedByID = selectBreed + ` WHERE id = ?`\n\tdeleteBreedByID = `DELETE FROM breed WHERE id = ?`\n\tinsertBreed = `INSERT INTO breed (id, name, mail, internet, country)\n\t\t\t\t\t VALUES(?,?,?,?,?)`\n)\n\n// NewBreedRepo - TODO\nfunc NewBreedRepo(db *sql.DB) *BreedRepo {\n\treturn &BreedRepo{db: db}\n}\n\n// BreedRepo - TODO\ntype BreedRepo struct {\n\tdb *sql.DB\n}\n\n// GetByID - TODO\nfunc (b *BreedRepo) GetByID(id string) (*model.Breed, error) {\n\trow := b.db.QueryRow(selectBreedByID, id)\n\tbreed := &model.Breed{}\n\terr := row.Scan(&breed.ID, &breed.Name, &breed.Mail, &breed.Internet, &breed.Country)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn breed, nil\n}\n\n// List - TODO\nfunc (b *BreedRepo) List() ([]*model.Breed, error) {\n\trows, err := b.db.Query(selectBreed)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar breeds []*model.Breed\n\tfor rows.Next() {\n\t\tbreed := &model.Breed{}\n\t\terr := rows.Scan(&breed.ID, &breed.Name, &breed.Mail, &breed.Internet, &breed.Country)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tbreeds = append(breeds, breed)\n\t}\n\treturn breeds, nil\n}\n\n// Create - TODO\nfunc (b *BreedRepo) Create(breed *model.Breed) error {\n\t_, err := b.db.Exec(insertBreed, breed.ID, breed.Name, breed.Mail, breed.Internet, breed.Country)\n\treturn err\n}\n\n// Delete - TODO\nfunc (b *BreedRepo) Delete(id string) error {\n\t_, err := b.db.Exec(deleteBreedByID, id)\n\treturn err\n}\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"go"},"label":{"kind":"number","value":3,"string":"3"},"text":{"kind":"string","value":"package db\n\nimport (\n\t\"database/sql\"\n\n\t\"github.com/MninaTB/dnadb/intern/model\"\n)\n\nconst (\n\tselectBreed = `SELECT id, name, mail, internet, country FROM breed`\n\tselectBreedByID = selectBreed + ` WHERE id = ?`\n\tdeleteBreedByID = `DELETE FROM breed WHERE id = ?`\n\tinsertBreed = `INSERT INTO breed (id, name, mail, internet, country)\n\t\t\t\t\t VALUES(?,?,?,?,?)`\n)\n\n// NewBreedRepo - TODO\nfunc NewBreedRepo(db *sql.DB) *BreedRepo {\n\treturn &BreedRepo{db: db}\n}\n\n// BreedRepo - TODO\ntype BreedRepo struct {\n\tdb *sql.DB\n}\n\n// GetByID - TODO\nfunc (b *BreedRepo) GetByID(id string) (*model.Breed, error) {\n\trow := b.db.QueryRow(selectBreedByID, id)\n\tbreed := &model.Breed{}\n\terr := row.Scan(&breed.ID, &breed.Name, &breed.Mail, &breed.Internet, &breed.Country)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn breed, nil\n}\n\n// List - TODO\nfunc (b *BreedRepo) List() ([]*model.Breed, error) {\n\trows, err := b.db.Query(selectBreed)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar breeds []*model.Breed\n\tfor rows.Next() {\n\t\tbreed := &model.Breed{}\n\t\terr := rows.Scan(&breed.ID, &breed.Name, &breed.Mail, &breed.Internet, &breed.Country)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tbreeds = append(breeds, breed)\n\t}\n\treturn breeds, nil\n}\n\n// Create - TODO\nfunc (b *BreedRepo) Create(breed *model.Breed) error {\n\t_, err := b.db.Exec(insertBreed, breed.ID, breed.Name, breed.Mail, breed.Internet, breed.Country)\n\treturn err\n}\n\n// Delete - TODO\nfunc (b *BreedRepo) Delete(id string) error {\n\t_, err := b.db.Exec(deleteBreedByID, id)\n\treturn err\n}\n"}}},{"rowIdx":943,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a Java program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid Java code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical Java concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., concurrent programming). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching Java. It should be similar to a school exercise, a tutorial, or a Java course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching Java. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\npackage curs5;\r\n\r\npublic class TestCalculator {\r\n\r\n public static void main(String[] args) {\r\n Calculator calc = new Calculator();\r\n calc.askTheUser();\r\n calc.calculateValues();\r\n calc.printResult();\r\n }\r\n}\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"java"},"label":{"kind":"number","value":-1,"string":"-1"},"text":{"kind":"string","value":"package curs5;\r\n\r\npublic class TestCalculator {\r\n\r\n public static void main(String[] args) {\r\n Calculator calc = new Calculator();\r\n calc.askTheUser();\r\n calc.calculateValues();\r\n calc.printResult();\r\n }\r\n}\r\n"}}},{"rowIdx":944,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a C# program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\nAdd 1 point if the program contains valid C# code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\nAdd another point if the program addresses practical C# concepts, even if it lacks comments.\nAward a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., LINQ, reflection). The code should be well-structured and contain some comments.\nGive a fourth point if the program is self-contained and highly relevant to teaching C#. It should be similar to a school exercise, a tutorial, or a C# course section.\nGrant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching C#. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing DataModels;\nusing LiteDbService.Interfaces;\nusing LiteDB;\n\nnamespace LiteDbService\n{\n public class TestLiteManagerService : LiteManagerService\n {\n public TestLiteManagerService() : base(\"\")\n {\n }\n\n public override string CurrentDb\n {\n get\n {\n if (string.IsNullOrEmpty(_currentDb))\n {\n _currentDb = @\"C:\\db\\TestData.db\";\n }\n return _currentDb;\n }\n }\n }\n}\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"csharp"},"label":{"kind":"number","value":1,"string":"1"},"text":{"kind":"string","value":"using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing DataModels;\nusing LiteDbService.Interfaces;\nusing LiteDB;\n\nnamespace LiteDbService\n{\n public class TestLiteManagerService : LiteManagerService\n {\n public TestLiteManagerService() : base(\"\")\n {\n }\n\n public override string CurrentDb\n {\n get\n {\n if (string.IsNullOrEmpty(_currentDb))\n {\n _currentDb = @\"C:\\db\\TestData.db\";\n }\n return _currentDb;\n }\n }\n }\n}\n"}}},{"rowIdx":945,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a C# program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\nAdd 1 point if the program contains valid C# code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\nAdd another point if the program addresses practical C# concepts, even if it lacks comments.\nAward a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., LINQ, reflection). The code should be well-structured and contain some comments.\nGive a fourth point if the program is self-contained and highly relevant to teaching C#. It should be similar to a school exercise, a tutorial, or a C# course section.\nGrant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching C#. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\nusing System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing System.Threading.Tasks;\r\nusing Majorsilence.MediaService.Dto;\r\nusing Majorsilence.MediaService.RepoInterfaces;\r\nusing Microsoft.AspNetCore.Mvc;\r\n\r\nnamespace Majorsilence.MediaService.WebService.Controllers\r\n{\r\n [Route(\"api/[controller]\")]\r\n [ApiController]\r\n public class BaseAddressController : ControllerBase\r\n {\r\n\r\n /// \r\n /// \r\n ///This service will return list of base media addresses that can be\r\n ///used to stream video and cover art.\r\n ///\r\n ///Returns Address\r\n ///\r\n /// \r\n /// \r\n /// \r\n [HttpGet]\r\n public ActionResult> Get()\r\n {\r\n // TODO: switch this to a config file or database\r\n var list = new List();\r\n list.Add(new BaseAddressInfo()\r\n {\r\n Address = \"http://files.majorsilence.com/mediaservice/\"\r\n });\r\n return list;\r\n }\r\n\r\n }\r\n\r\n public class BaseAddressInfo\r\n {\r\n public string Address { get; set; }\r\n }\r\n}\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"csharp"},"label":{"kind":"number","value":3,"string":"3"},"text":{"kind":"string","value":"using System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing System.Threading.Tasks;\r\nusing Majorsilence.MediaService.Dto;\r\nusing Majorsilence.MediaService.RepoInterfaces;\r\nusing Microsoft.AspNetCore.Mvc;\r\n\r\nnamespace Majorsilence.MediaService.WebService.Controllers\r\n{\r\n [Route(\"api/[controller]\")]\r\n [ApiController]\r\n public class BaseAddressController : ControllerBase\r\n {\r\n\r\n /// \r\n /// \r\n ///This service will return list of base media addresses that can be\r\n ///used to stream video and cover art.\r\n ///\r\n ///Returns Address\r\n ///\r\n /// \r\n /// \r\n /// \r\n [HttpGet]\r\n public ActionResult> Get()\r\n {\r\n // TODO: switch this to a config file or database\r\n var list = new List();\r\n list.Add(new BaseAddressInfo()\r\n {\r\n Address = \"http://files.majorsilence.com/mediaservice/\"\r\n });\r\n return list;\r\n }\r\n\r\n }\r\n\r\n public class BaseAddressInfo\r\n {\r\n public string Address { get; set; }\r\n }\r\n}\r\n"}}},{"rowIdx":946,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a C program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid C code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical C concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., kernel development and compiler design). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching C. It should be similar to a school exercise, a tutorial, or a C course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching C. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\nchar* ram[10];\nchar* getCellFromRAM(int i);\nvoid removeFromRAM(PCB* pcb);\nvoid addToRAM(FILE *p, int *start, int *end);\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"c"},"label":{"kind":"number","value":2,"string":"2"},"text":{"kind":"string","value":"char* ram[10];\nchar* getCellFromRAM(int i);\nvoid removeFromRAM(PCB* pcb);\nvoid addToRAM(FILE *p, int *start, int *end);\n"}}},{"rowIdx":947,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a Kotlin program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid Kotlin code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical Kotlin concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., coroutines, extension functions). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching Kotlin. It should be similar to a school exercise, a tutorial, or a Kotlin course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching Kotlin. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\npackage pl.wojciechkabat.hotchilli.services\n\ninterface TranslationService {\n fun getTranslation(key: String, languageCode: String): String\n}\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"kotlin"},"label":{"kind":"number","value":2,"string":"2"},"text":{"kind":"string","value":"package pl.wojciechkabat.hotchilli.services\n\ninterface TranslationService {\n fun getTranslation(key: String, languageCode: String): String\n}"}}},{"rowIdx":948,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a Swift program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid Swift code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical Swift concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., protocols, extensions). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching Swift. It should be similar to a school exercise, a tutorial, or a Swift course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching Swift. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\n//\n// Issue.swift\n// github\n//\n// Created by on 8/7/17.\n// Copyright © 2017 . All rights reserved.\n//\n\nimport Foundation\n\nstruct Issue {\n let url: String\n let title: String\n let user: String\n}\n\nextension Issue {\n init?(dict: JSONDict) {\n guard let url = dict[\"url\"] as? String, let title = dict[\"title\"] as? String,\n let user_dict = dict[\"user\"] as? JSONDict else { return nil }\n \n self.url = url\n self.title = title\n self.user = user_dict[\"login\"] as! String\n }\n \n static func fromRepo(_ name: String) -> Resource<[Issue]> {\n let issueURL = URL(string: \"https://api.github.com/repos/architecture-study/\\(name)/issues\")!\n let resource = Resource<[Issue]>(url: issueURL, parseJSON: { json in\n guard let dict = json as? [JSONDict] else { return nil }\n return dict.flatMap(Issue.init)\n })\n return resource\n }\n}\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"swift"},"label":{"kind":"number","value":3,"string":"3"},"text":{"kind":"string","value":"//\n// Issue.swift\n// github\n//\n// Created by on 8/7/17.\n// Copyright © 2017 . All rights reserved.\n//\n\nimport Foundation\n\nstruct Issue {\n let url: String\n let title: String\n let user: String\n}\n\nextension Issue {\n init?(dict: JSONDict) {\n guard let url = dict[\"url\"] as? String, let title = dict[\"title\"] as? String,\n let user_dict = dict[\"user\"] as? JSONDict else { return nil }\n \n self.url = url\n self.title = title\n self.user = user_dict[\"login\"] as! String\n }\n \n static func fromRepo(_ name: String) -> Resource<[Issue]> {\n let issueURL = URL(string: \"https://api.github.com/repos/architecture-study/\\(name)/issues\")!\n let resource = Resource<[Issue]>(url: issueURL, parseJSON: { json in\n guard let dict = json as? [JSONDict] else { return nil }\n return dict.flatMap(Issue.init)\n })\n return resource\n }\n}\n"}}},{"rowIdx":949,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a JavaScript program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid JavaScript code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical JavaScript concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., asynchronous programming). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching JavaScript. It should be similar to a school exercise, a tutorial, or a JavaScript course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching JavaScript. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\nconst smartgrid = require('smart-grid');\n\nconst options = {\n outputStyle: 'scss',\n columns: 24,\n}\n\nsmartgrid('./src/utilities/', options);\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"javascript"},"label":{"kind":"number","value":2,"string":"2"},"text":{"kind":"string","value":"const smartgrid = require('smart-grid');\n\nconst options = {\n outputStyle: 'scss',\n columns: 24,\n}\n\nsmartgrid('./src/utilities/', options);"}}},{"rowIdx":950,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a Swift program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid Swift code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical Swift concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., protocols, extensions). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching Swift. It should be similar to a school exercise, a tutorial, or a Swift course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching Swift. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\n//\n// TextToSpeechError.swift\n// Aimybox\n//\n// Created by on 01.12.2019.\n//\n\nimport Foundation\n\npublic\nenum TextToSpeechError: Error {\n /**\n Speech is empty and will be skipped.\n */\n case emptySpeech(AimyboxSpeech)\n /**\n Sent when speakers are unvailable.\n */\n case speakersUnavailable\n /**\n */\n case speechSequenceCancelled([AimyboxSpeech])\n\n}\n\npublic\nextension TextToSpeechError {\n\n func forward(to delegate: TextToSpeechDelegate?, by tts: TextToSpeech?) {\n guard let delegate = delegate, let tts = tts else {\n return\n }\n\n switch self {\n case .emptySpeech(let speech):\n delegate.tts(tts, speechSkipped: speech)\n case .speakersUnavailable:\n delegate.ttsSpeakersUnavailable(tts)\n case .speechSequenceCancelled(let sequence):\n delegate.tts(tts, speechSequenceCancelled: sequence)\n }\n }\n\n}\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"swift"},"label":{"kind":"number","value":3,"string":"3"},"text":{"kind":"string","value":"//\n// TextToSpeechError.swift\n// Aimybox\n//\n// Created by on 01.12.2019.\n//\n\nimport Foundation\n\npublic\nenum TextToSpeechError: Error {\n /**\n Speech is empty and will be skipped.\n */\n case emptySpeech(AimyboxSpeech)\n /**\n Sent when speakers are unvailable.\n */\n case speakersUnavailable\n /**\n */\n case speechSequenceCancelled([AimyboxSpeech])\n\n}\n\npublic\nextension TextToSpeechError {\n\n func forward(to delegate: TextToSpeechDelegate?, by tts: TextToSpeech?) {\n guard let delegate = delegate, let tts = tts else {\n return\n }\n\n switch self {\n case .emptySpeech(let speech):\n delegate.tts(tts, speechSkipped: speech)\n case .speakersUnavailable:\n delegate.ttsSpeakersUnavailable(tts)\n case .speechSequenceCancelled(let sequence):\n delegate.tts(tts, speechSequenceCancelled: sequence)\n }\n }\n\n}\n"}}},{"rowIdx":951,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a C# program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\nAdd 1 point if the program contains valid C# code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\nAdd another point if the program addresses practical C# concepts, even if it lacks comments.\nAward a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., LINQ, reflection). The code should be well-structured and contain some comments.\nGive a fourth point if the program is self-contained and highly relevant to teaching C#. It should be similar to a school exercise, a tutorial, or a C# course section.\nGrant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching C#. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\n// Copyright (c) 2021 Alachisoft\n// \n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// \n// http://www.apache.org/licenses/LICENSE-2.0\n// \n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License\nnamespace Alachisoft.NCache.Caching.Topologies.Clustered\n{\n class ClusterOperation\n {\n object _operation;\n object _lockInfo;\n object _result;\n\n public ClusterOperation(object operation, object lockInfo)\n {\n _operation = operation;\n _lockInfo = lockInfo;\n }\n public object Operation\n {\n get { return _operation; }\n }\n public object LockInfo\n {\n get { return _lockInfo; }\n }\n public object Result\n {\n get { return _result; }\n set { _result = value; }\n }\n }\n}\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"csharp"},"label":{"kind":"number","value":1,"string":"1"},"text":{"kind":"string","value":"// Copyright (c) 2021 Alachisoft\n// \n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// \n// http://www.apache.org/licenses/LICENSE-2.0\n// \n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License\nnamespace Alachisoft.NCache.Caching.Topologies.Clustered\n{\n class ClusterOperation\n {\n object _operation;\n object _lockInfo;\n object _result;\n\n public ClusterOperation(object operation, object lockInfo)\n {\n _operation = operation;\n _lockInfo = lockInfo;\n }\n public object Operation\n {\n get { return _operation; }\n }\n public object LockInfo\n {\n get { return _lockInfo; }\n }\n public object Result\n {\n get { return _result; }\n set { _result = value; }\n }\n }\n}"}}},{"rowIdx":952,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a Kotlin program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid Kotlin code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical Kotlin concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., coroutines, extension functions). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching Kotlin. It should be similar to a school exercise, a tutorial, or a Kotlin course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching Kotlin. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\npackage com.paprika.thali.data\n\nimport com.paprika.thali.data.db.DbHelper\nimport com.paprika.thali.data.network.ApiHelper\n\n/**\n * Created by vicky on 7/12/17.\n */\ninterface DataManager : DbHelper, ApiHelper {\n}\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"kotlin"},"label":{"kind":"number","value":2,"string":"2"},"text":{"kind":"string","value":"package com.paprika.thali.data\n\nimport com.paprika.thali.data.db.DbHelper\nimport com.paprika.thali.data.network.ApiHelper\n\n/**\n * Created by vicky on 7/12/17.\n */\ninterface DataManager : DbHelper, ApiHelper {\n}"}}},{"rowIdx":953,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a Swift program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid Swift code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical Swift concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., protocols, extensions). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching Swift. It should be similar to a school exercise, a tutorial, or a Swift course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching Swift. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\n//\n// Cell.swift\n// TheGreatGame\n//\n// Created by Олег on 26.05.17.\n// Copyright © 2017 The Great Game. All rights reserved.\n//\n\nimport UIKit\nimport Avenues\nimport TheGreatKit\n\nprotocol CellFiller {\n \n associatedtype CellType\n associatedtype Content\n \n func setup(_ cell: CellType, with content: Content, forRowAt indexPath: IndexPath)\n \n}\n\nfinal class Cell : CellFiller {\n \n private let _setup: (CellType, Content, IndexPath) -> ()\n init(setup: @escaping (CellType, Content, IndexPath) -> ()) {\n self._setup = setup\n }\n \n func setup(_ cell: CellType, with content: Content, forRowAt indexPath: IndexPath) {\n _setup(cell, content, indexPath)\n }\n \n}\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"swift"},"label":{"kind":"number","value":2,"string":"2"},"text":{"kind":"string","value":"//\n// Cell.swift\n// TheGreatGame\n//\n// Created by Олег on 26.05.17.\n// Copyright © 2017 The Great Game. All rights reserved.\n//\n\nimport UIKit\nimport Avenues\nimport TheGreatKit\n\nprotocol CellFiller {\n \n associatedtype CellType\n associatedtype Content\n \n func setup(_ cell: CellType, with content: Content, forRowAt indexPath: IndexPath)\n \n}\n\nfinal class Cell : CellFiller {\n \n private let _setup: (CellType, Content, IndexPath) -> ()\n init(setup: @escaping (CellType, Content, IndexPath) -> ()) {\n self._setup = setup\n }\n \n func setup(_ cell: CellType, with content: Content, forRowAt indexPath: IndexPath) {\n _setup(cell, content, indexPath)\n }\n \n}\n"}}},{"rowIdx":954,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a shell script. Evaluate whether it has a high educational value and could help teach shell scripting. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the script contains valid shell commands, even if it's not educational, like simple system calls or basic file operations.\n- Add another point if the script addresses practical shell scripting concepts (e.g., variables, conditionals), even if it lacks comments.\n- Award a third point if the script is suitable for educational use and introduces key concepts in shell scripting, even if the topic is somewhat advanced (e.g., functions, process management). The script should be well-structured and contain some comments.\n- Give a fourth point if the script is self-contained and highly relevant to teaching shell scripting. It should be similar to a tutorial example or a shell scripting course section, demonstrating good practices in script organization.\n- Grant a fifth point if the script is outstanding in its educational value and is perfectly suited for teaching shell scripting. It should be well-written, easy to understand, and contain step-by-step explanations in comments.\n\nThe extract:\nflutter build web\nsudo docker build -t tobiasritter/cardgame_client_flutter .\nsudo docker push tobiasritter/cardgame_client_flutter\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"shell"},"label":{"kind":"number","value":1,"string":"1"},"text":{"kind":"string","value":"flutter build web\nsudo docker build -t tobiasritter/cardgame_client_flutter .\nsudo docker push tobiasritter/cardgame_client_flutter"}}},{"rowIdx":955,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a Java program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid Java code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical Java concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., concurrent programming). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching Java. It should be similar to a school exercise, a tutorial, or a Java course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching Java. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\n/*\r\n * Comet4J Copyright(c) 2011, http://code.google.com/p/comet4j/ This code is\r\n * licensed under BSD license. Use it as you wish, but keep this copyright\r\n * intact.\r\n */\r\npackage org.comet4j.demo.talker;\r\n\r\nimport java.util.HashMap;\r\nimport java.util.Map;\r\n\r\n/**\r\n * 应用全局存储\r\n * @author \r\n * @date 2011-2-25\r\n */\r\n\r\npublic class AppStore {\r\n\r\n\tprivate static Map map;\r\n\tprivate static AppStore instance;\r\n\r\n\tpublic static AppStore getInstance() {\r\n\r\n\t\tif (instance == null) {\r\n\t\t\tinstance = new AppStore();\r\n\t\t\tmap = new HashMap();\r\n\t\t}\r\n\t\treturn instance;\r\n\t}\r\n\r\n\tpublic void put(String key, String value) {\r\n\t\tmap.put(key, value);\r\n\t}\r\n\r\n\tpublic String get(String key) {\r\n\t\treturn map.get(key);\r\n\t}\r\n\r\n\tpublic Map getMap() {\r\n\t\treturn map;\r\n\t}\r\n\r\n\tpublic void destroy() {\r\n\t\tmap.clear();\r\n\t\tmap = null;\r\n\t}\r\n\r\n}\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"java"},"label":{"kind":"number","value":2,"string":"2"},"text":{"kind":"string","value":"/*\r\n * Comet4J Copyright(c) 2011, http://code.google.com/p/comet4j/ This code is\r\n * licensed under BSD license. Use it as you wish, but keep this copyright\r\n * intact.\r\n */\r\npackage org.comet4j.demo.talker;\r\n\r\nimport java.util.HashMap;\r\nimport java.util.Map;\r\n\r\n/**\r\n * 应用全局存储\r\n * @author \r\n * @date 2011-2-25\r\n */\r\n\r\npublic class AppStore {\r\n\r\n\tprivate static Map map;\r\n\tprivate static AppStore instance;\r\n\r\n\tpublic static AppStore getInstance() {\r\n\r\n\t\tif (instance == null) {\r\n\t\t\tinstance = new AppStore();\r\n\t\t\tmap = new HashMap();\r\n\t\t}\r\n\t\treturn instance;\r\n\t}\r\n\r\n\tpublic void put(String key, String value) {\r\n\t\tmap.put(key, value);\r\n\t}\r\n\r\n\tpublic String get(String key) {\r\n\t\treturn map.get(key);\r\n\t}\r\n\r\n\tpublic Map getMap() {\r\n\t\treturn map;\r\n\t}\r\n\r\n\tpublic void destroy() {\r\n\t\tmap.clear();\r\n\t\tmap = null;\r\n\t}\r\n\r\n}\r\n"}}},{"rowIdx":956,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a Rust program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid Rust code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical Rust concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., ownership, lifetimes). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching Rust. It should be similar to a school exercise, a tutorial, or a Rust course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching Rust. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\nuse std::collections::HashMap;\nuse std::sync::Mutex;\n\nlazy_static! {\n static ref EVENTS : Mutex> = Mutex::new(HashMap::new());\n}\n\npub fn clear_events() {\n EVENTS.lock().unwrap().clear();\n}\n\npub fn record_event(event: T, n : i32) {\n let event_name = event.to_string();\n let mut events_lock = EVENTS.lock();\n let mut events = events_lock.as_mut().unwrap();\n if let Some(e) = events.get_mut(&event_name) {\n *e += n;\n } else {\n events.insert(event_name, n);\n }\n}\n\npub fn get_event_count(event: T) -> i32 {\n let event_name = event.to_string();\n let events_lock = EVENTS.lock();\n let events = events_lock.unwrap();\n if let Some(e) = events.get(&event_name) {\n *e\n } else {\n 0\n }\n}\n\npub fn clone_events() -> HashMap {\n EVENTS.lock().unwrap().clone()\n}\n\npub fn load_events(events : HashMap) {\n EVENTS.lock().unwrap().clear();\n events.iter().for_each(|(k,v)| {\n EVENTS.lock().unwrap().insert(k.to_string(), *v);\n });\n}\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"rust"},"label":{"kind":"number","value":2,"string":"2"},"text":{"kind":"string","value":"use std::collections::HashMap;\nuse std::sync::Mutex;\n\nlazy_static! {\n static ref EVENTS : Mutex> = Mutex::new(HashMap::new());\n}\n\npub fn clear_events() {\n EVENTS.lock().unwrap().clear();\n}\n\npub fn record_event(event: T, n : i32) {\n let event_name = event.to_string();\n let mut events_lock = EVENTS.lock();\n let mut events = events_lock.as_mut().unwrap();\n if let Some(e) = events.get_mut(&event_name) {\n *e += n;\n } else {\n events.insert(event_name, n);\n }\n}\n\npub fn get_event_count(event: T) -> i32 {\n let event_name = event.to_string();\n let events_lock = EVENTS.lock();\n let events = events_lock.unwrap();\n if let Some(e) = events.get(&event_name) {\n *e\n } else {\n 0\n }\n}\n\npub fn clone_events() -> HashMap {\n EVENTS.lock().unwrap().clone()\n}\n\npub fn load_events(events : HashMap) {\n EVENTS.lock().unwrap().clear();\n events.iter().for_each(|(k,v)| {\n EVENTS.lock().unwrap().insert(k.to_string(), *v);\n });\n}"}}},{"rowIdx":957,"cells":{"prompt":{"kind":"string","value":"Below is an extract from an HTML document. Evaluate whether it has a high educational value and could help teach web development. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the document contains valid HTML markup, even if it's not educational, like boilerplate code or standard tags.\n- Add another point if the document addresses practical HTML concepts and uses semantic elements appropriately.\n- Award a third point if the document is suitable for educational use and introduces key web concepts, even if the topic is somewhat advanced (e.g., forms, metadata). The code should be well-structured and use clear, descriptive naming.\n- Give a fourth point if the document is self-contained and highly relevant to teaching HTML. It should be similar to a school exercise, a tutorial, or an HTML course section for early learners.\n- Grant a fifth point if the document is outstanding in its educational value and is perfectly suited for teaching HTML to beginners. It should be well-organized, easy to understand, and ideally include some explanatory comments or demonstrate best practices in HTML structure.\n\nThe extract:\n---\nlayout: default\ntitle: \"大数据学习遇到的问题,大数据薪资多高岗位空缺大\"\n---\n\n{{ \"%3Cdiv+id%3D%22article_content%22+class%3D%22article_content+clearfix+csdn-tracking-statistics%22+data-pid%3D%22blog%22+data-mod%3D%22popu_307%22+data-dsm%3D%22post%22%3E+%0A+%3Clink+rel%3D%22stylesheet%22+href%3D%22https%3A%2F%2Fcsdnimg.cn%2Frelease%2Fphoenix%2Ftemplate%2Fcss%2Fck_htmledit_views-f57960eb32.css%22%3E+%0A+%3Clink+rel%3D%22stylesheet%22+href%3D%22https%3A%2F%2Fcsdnimg.cn%2Frelease%2Fphoenix%2Ftemplate%2Fcss%2Fck_htmledit_views-f57960eb32.css%22%3E+%0A+%3Cdiv+class%3D%22htmledit_views%22+id%3D%22content_views%22%3E+%0A++%3Cp%3E%E5%A4%A7%E6%95%B0%E6%8D%AE%E4%B8%BA%E4%BB%80%E4%B9%88%E8%BF%99%E4%B9%88%E7%81%AB%E7%83%AD%EF%BC%8C%E4%BB%8E%E4%BB%A5%E4%B8%8B%E6%96%B9%E9%9D%A2%E6%9D%A5%E7%9C%8B%EF%BC%9A%3C%2Fp%3E+%0A++%3Cp%3E%E4%BA%BA%E6%B0%91%E6%97%A5%E6%8A%A5%E5%AE%98%E6%96%B9%E5%BE%AE%E4%BF%A1%E5%85%AC%E4%BC%97%E5%B9%B3%E5%8F%B0%E5%8F%91%E5%B8%83%E4%BA%86%E4%B8%80%E7%AF%87%E6%96%87%E7%AB%A0%EF%BC%8C%E5%85%AC%E5%B8%83%E5%B7%B2%E6%9C%8935%E6%89%80%E9%AB%98%E6%A0%A1%E8%8E%B7%E6%89%B9%E2%80%9C%E6%95%B0%E6%8D%AE%E7%A7%91%E5%AD%A6%E4%B8%8E%E5%A4%A7%E6%95%B0%E6%8D%AE%E6%8A%80%E6%9C%AF%E2%80%9D%E4%B8%93%E4%B8%9A%EF%BC%8C%E4%BD%BF%E5%A4%A7%E6%95%B0%E6%8D%AE%E5%8F%97%E5%88%B0%E6%9B%B4%E5%A4%9A%E5%AE%B6%E9%95%BF%E7%9A%84%E5%85%B3%E6%B3%A8%EF%BC%8C%E5%A4%A7%E6%95%B0%E6%8D%AE%E4%B9%9F%E8%A2%AB%E8%B6%8A%E6%9D%A5%E8%B6%8A%E5%A4%9A%E7%9A%84%E4%BA%BA%E9%87%8D%E8%A7%86%E3%80%82%3C%2Fp%3E+%0A++%3Cp%3E%3Cimg+alt%3D%22%22+class%3D%22has%22+src%3D%22%2F%2Fupload-images.jianshu.io%2Fupload_images%2F5875695-2bcbfdff5b8d1910.jpg%3FimageMogr2%2Fauto-orient%2Fstrip%257CimageView2%2F2%2Fw%2F300%2Fformat%2Fwebp%22%3E%3C%2Fp%3E+%0A++%3Cp%3E%E9%AB%98%E6%A0%A1%E5%BC%80%E5%8A%9E%E7%9B%B8%E5%85%B3%E4%B8%93%E4%B8%9A%E4%B9%9F%E4%B8%8D%E8%83%BD%E7%BC%93%E8%A7%A3%E5%A4%A7%E6%95%B0%E6%8D%AE%E4%BA%BA%E6%89%8D%E7%A8%80%E7%BC%BA%E7%9A%84%E7%8E%B0%E7%8A%B6%EF%BC%8C%E6%AF%95%E7%AB%9F%E4%B8%93%E4%B8%9A%E6%98%AF2017%E5%B9%B4%E5%BC%80%E5%8A%9\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"html"},"label":{"kind":"number","value":1,"string":"1"},"text":{"kind":"string","value":"---\nlayout: default\ntitle: \"大数据学习遇到的问题,大数据薪资多高岗位空缺大\"\n---\n\n{{ \"%3Cdiv+id%3D%22article_content%22+class%3D%22article_content+clearfix+csdn-tracking-statistics%22+data-pid%3D%22blog%22+data-mod%3D%22popu_307%22+data-dsm%3D%22post%22%3E+%0A+%3Clink+rel%3D%22stylesheet%22+href%3D%22https%3A%2F%2Fcsdnimg.cn%2Frelease%2Fphoenix%2Ftemplate%2Fcss%2Fck_htmledit_views-f57960eb32.css%22%3E+%0A+%3Clink+rel%3D%22stylesheet%22+href%3D%22https%3A%2F%2Fcsdnimg.cn%2Frelease%2Fphoenix%2Ftemplate%2Fcss%2Fck_htmledit_views-f57960eb32.css%22%3E+%0A+%3Cdiv+class%3D%22htmledit_views%22+id%3D%22content_views%22%3E+%0A++%3Cp%3E%E5%A4%A7%E6%95%B0%E6%8D%AE%E4%B8%BA%E4%BB%80%E4%B9%88%E8%BF%99%E4%B9%88%E7%81%AB%E7%83%AD%EF%BC%8C%E4%BB%8E%E4%BB%A5%E4%B8%8B%E6%96%B9%E9%9D%A2%E6%9D%A5%E7%9C%8B%EF%BC%9A%3C%2Fp%3E+%0A++%3Cp%3E%E4%BA%BA%E6%B0%91%E6%97%A5%E6%8A%A5%E5%AE%98%E6%96%B9%E5%BE%AE%E4%BF%A1%E5%85%AC%E4%BC%97%E5%B9%B3%E5%8F%B0%E5%8F%91%E5%B8%83%E4%BA%86%E4%B8%80%E7%AF%87%E6%96%87%E7%AB%A0%EF%BC%8C%E5%85%AC%E5%B8%83%E5%B7%B2%E6%9C%8935%E6%89%80%E9%AB%98%E6%A0%A1%E8%8E%B7%E6%89%B9%E2%80%9C%E6%95%B0%E6%8D%AE%E7%A7%91%E5%AD%A6%E4%B8%8E%E5%A4%A7%E6%95%B0%E6%8D%AE%E6%8A%80%E6%9C%AF%E2%80%9D%E4%B8%93%E4%B8%9A%EF%BC%8C%E4%BD%BF%E5%A4%A7%E6%95%B0%E6%8D%AE%E5%8F%97%E5%88%B0%E6%9B%B4%E5%A4%9A%E5%AE%B6%E9%95%BF%E7%9A%84%E5%85%B3%E6%B3%A8%EF%BC%8C%E5%A4%A7%E6%95%B0%E6%8D%AE%E4%B9%9F%E8%A2%AB%E8%B6%8A%E6%9D%A5%E8%B6%8A%E5%A4%9A%E7%9A%84%E4%BA%BA%E9%87%8D%E8%A7%86%E3%80%82%3C%2Fp%3E+%0A++%3Cp%3E%3Cimg+alt%3D%22%22+class%3D%22has%22+src%3D%22%2F%2Fupload-images.jianshu.io%2Fupload_images%2F5875695-2bcbfdff5b8d1910.jpg%3FimageMogr2%2Fauto-orient%2Fstrip%257CimageView2%2F2%2Fw%2F300%2Fformat%2Fwebp%22%3E%3C%2Fp%3E+%0A++%3Cp%3E%E9%AB%98%E6%A0%A1%E5%BC%80%E5%8A%9E%E7%9B%B8%E5%85%B3%E4%B8%93%E4%B8%9A%E4%B9%9F%E4%B8%8D%E8%83%BD%E7%BC%93%E8%A7%A3%E5%A4%A7%E6%95%B0%E6%8D%AE%E4%BA%BA%E6%89%8D%E7%A8%80%E7%BC%BA%E7%9A%84%E7%8E%B0%E7%8A%B6%EF%BC%8C%E6%AF%95%E7%AB%9F%E4%B8%93%E4%B8%9A%E6%98%AF2017%E5%B9%B4%E5%BC%80%E5%8A%9E%EF%BC%8C%E6%9C%80%E6%97%A9%E7%9A%84%E4%B8%80%E6%89%B9%E6%AF%95%E4%B8%9A%E7%94%9F%E4%B9%9F%E8%A6%813.4%E5%B9%B4%E4%BB%A5%E5%90%8E%E4%BA%86%EF%BC%8C%E8%BF%9C%E6%B0%B4%E6%95%91%E4%B8%8D%E4%BA%86%E8%BF%91%E7%81%AB%EF%BC%8C%E6%89%80%E4%BB%A5%EF%BC%8C%E5%BF%AB%E9%80%9F%E5%AD%A6%E4%B9%A0%E6%88%90%E4%B8%BA%E5%BF%85%E8%A6%81%E3%80%82%E3%80%90%E5%A4%A7%E6%95%B0%E6%8D%AE%E5%BC%80%E5%8F%91%E5%AD%A6%E4%B9%A0%E8%B5%84%E6%96%99%E9%A2%86%E5%8F%96%E6%96%B9%E5%BC%8F%E3%80%91%EF%BC%9A%E5%8A%A0%E5%85%A5%E5%A4%A7%E6%95%B0%E6%8D%AE%E6%8A%80%E6%9C%AF%E5%AD%A6%E4%B9%A0%E4%BA%A4%E6%B5%81%E7%BE%A4458345782%EF%BC%8C%E7%82%B9%E5%87%BB%E5%8A%A0%E5%85%A5%E7%BE%A4%E8%81%8A%EF%BC%8C%E7%A7%81%E4%BF%A1%E7%AE%A1%E7%90%86%E5%91%98%E5%8D%B3%E5%8F%AF%E5%85%8D%E8%B4%B9%E9%A2%86%E5%8F%96%3C%2Fp%3E+%0A++%3Cp%3E%E5%85%A8%E7%90%83%E9%A1%B6%E5%B0%96%E7%AE%A1%E7%90%86%E5%92%A8%E8%AF%A2%E5%85%AC%E5%8F%B8%E9%BA%A6%E8%82%AF%E9%94%A1%28McKinsey%29%E5%87%BA%E5%85%B7%E7%9A%84%E4%B8%80%E4%BB%BD%E8%AF%A6%E7%BB%86%E5%88%86%E6%9E%90%E6%8A%A5%E5%91%8A%E6%98%BE%E7%A4%BA%EF%BC%9A%3C%2Fp%3E+%0A++%3Cp%3E%E9%A2%84%E8%AE%A1%E5%88%B02018%E5%B9%B4%EF%BC%8C%E5%A4%A7%E6%95%B0%E6%8D%AE%E6%88%96%E8%80%85%E6%95%B0%E6%8D%AE%E5%B7%A5%E4%BD%9C%E8%80%85%E7%9A%84%E5%B2%97%E4%BD%8D%E9%9C%80%E6%B1%82%E5%B0%86%E6%BF%80%E5%A2%9E%EF%BC%8C%E5%85%B6%E4%B8%AD%E5%A4%A7%E6%95%B0%E6%8D%AE%E7%A7%91%E5%AD%A6%E5%AE%B6%E7%9A%84%E7%BC%BA%E5%8F%A3%E5%9C%A8140000%E5%88%B0190000%E4%B9%8B%E9%97%B4%EF%BC%8C%E5%AF%B9%E4%BA%8E%E6%87%82%E5%BE%97%E5%A6%82%E4%BD%95%E5%88%A9%E7%94%A8%E5%A4%A7%E6%95%B0%E6%8D%AE%E5%81%9A%E5%86%B3%E7%AD%96%E7%9A%84%E5%88%86%E6%9E%90%E5%B8%88%E5%92%8C%E7%BB%8F%E7%90%86%E7%9A%84%E5%B2%97%E4%BD%8D%E7%BC%BA%E5%8F%A3%E5%88%99%E5%B0%86%E8%BE%BE%E5%88%B0%3Cstrong%3E1500000%3C%2Fstrong%3E%EF%BC%81%3C%2Fp%3E+%0A++%3Cp%3E%E5%9C%A8%E4%BA%92%E8%81%94%E7%BD%91%E6%97%B6%E4%BB%A3%EF%BC%8C%E6%AF%8F%E5%A4%A9%E9%83%BD%E6%9C%89%E6%B5%B7%E9%87%8F%E7%9A%84%E6%95%B0%E6%8D%AE%E4%BF%A1%E6%81%AF%E4%BA%A7%E7%94%9F%EF%BC%8C%E6%95%B0%E6%8D%AE%E7%9A%84%E5%A4%84%E7%90%86%E5%8F%98%E5%BE%97%E8%B6%8A%E6%9D%A5%E8%B6%8A%E5%A4%8D%E6%9D%82%EF%BC%8C%E5%BE%88%E5%A4%9A%E5%A4%A7%E5%85%AC%E5%8F%B8%E5%B7%B2%E7%BB%8F%E5%9C%A8%E5%AF%BB%E6%B1%82%E6%8B%A5%E6%9C%89%E5%AE%9E%E6%88%98%E7%BB%8F%E9%AA%8C%E7%9A%84%E9%AB%98%E6%89%8B%E6%9D%A5%E5%A1%AB%E5%85%85%E8%87%AA%E5%B7%B1%E5%AE%9E%E5%8A%9B%E3%80%82%3C%2Fp%3E+%0A++%3Cp%3E%E7%A7%91%E5%A4%9A%E5%A4%A7%E6%95%B0%E6%8D%AE%E5%AD%A6%E5%91%98%E7%9A%84%E5%B0%B1%E4%B8%9A%E8%96%AA%E8%B5%84%E4%B9%9F%E8%BE%BE%E5%88%B0%E4%BA%868K%EF%BC%8C%E8%BF%98%E4%BB%85%E6%98%AF%E5%88%9A%E5%88%9A%E6%AF%95%E4%B8%9A%E5%9F%BA%E6%9C%AC%E6%97%A0%E7%BB%8F%E9%AA%8C%E7%9A%84%E6%83%85%E5%86%B5%E4%B8%8B%E3%80%82%3C%2Fp%3E+%0A++%3Cp%3E%E9%9A%8F%E7%9D%80%E4%BC%81%E4%B8%9A%E6%8B%9B%E8%81%98%E8%81%8C%E4%BD%8D%E7%9A%84%E8%B6%8A%E6%9D%A5%E8%B6%8A%E7%BB%86%E5%8C%96%EF%BC%8C%E5%AF%B9%E5%B2%97%E4%BD%8D%E8%A6%81%E6%B1%82%E8%B6%8A%E6%9D%A5%E8%B6%8A%E7%BB%86%EF%BC%8C%E7%A7%91%E5%A4%9A%E5%A4%A7%E6%95%B0%E6%8D%AE%E8%B4%B4%E5%90%88%E4%BC%81%E4%B8%9A%E7%9A%84%E9%9C%80%E6%B1%82%E4%B8%BA%E4%BC%81%E4%B8%9A%E6%8F%90%E4%BE%9B%E9%AB%98%E6%B0%B4%E5%B9%B3%E7%9A%84%E6%8A%80%E6%9C%AF%E4%BA%BA%E6%89%8D%E3%80%82%E7%BB%8F%E8%BF%87%E4%B8%80%E5%B9%B4%E5%A4%9A%E7%9A%84%E6%97%B6%E9%97%B4%EF%BC%8C%E6%BD%9C%E5%BF%83%E7%A0%94%E5%8F%91%EF%BC%8C%E4%BB%8A%E5%B9%B4%E5%B9%B4%E5%88%9D%E8%8E%B7%E5%BE%97%E4%BA%86%E5%B7%A5%E4%BF%A1%E9%83%A8%E5%85%A8%E5%9B%BD5%E5%A4%A7%E4%BC%98%E7%A7%80%E8%AF%BE%E7%A8%8B%E4%B9%8B%E4%B8%80%EF%BC%8C%E6%98%AF%E5%85%B6%E4%B8%AD%E5%94%AF%E4%B8%80%E5%A4%A7%E6%95%B0%E6%8D%AE%E7%B1%BB%E8%AF%BE%E7%A8%8B%E3%80%82%3C%2Fp%3E+%0A++%3Cp%3E%3Cstrong%3E%E2%80%9C%E5%A4%A7%E6%95%B0%E6%8D%AE%E2%80%9D%E4%B8%93%E4%B8%9A%E5%AD%A6%E4%BB%80%E4%B9%88%EF%BC%9F%3C%2Fstrong%3E%3C%2Fp%3E+%0A++%3Cp%3E%E5%A4%A7%E6%95%B0%E6%8D%AE%E9%A2%86%E5%9F%9F%E4%B8%89%E4%B8%AA%E5%A4%A7%E7%9A%84%E6%8A%80%E6%9C%AF%E6%96%B9%E5%90%91%EF%BC%8C%E8%BF%99%E4%BA%9B%E4%B8%8D%E5%90%8C%E7%9A%84%E6%8A%80%E6%9C%AF%E6%96%B9%E5%90%91%EF%BC%8C%E5%AF%B9%E5%BA%94%E4%BC%81%E4%B8%9A%E7%9A%84%E5%93%AA%E4%BA%9B%E6%8B%9B%E8%81%98%E5%B2%97%E4%BD%8D%EF%BC%9F%3C%2Fp%3E+%0A++%3Cp%3E00001.%3C%2Fp%3E+%0A++%3Cp%3E%3Cstrong%3EHadoop%E5%A4%A7%E6%95%B0%E6%8D%AE%E5%BC%80%E5%8F%91%E6%96%B9%E5%90%91%3C%2Fstrong%3E%3C%2Fp%3E+%0A++%3Cp%3E00002.%3C%2Fp%3E+%0A++%3Cp%3E%3Cimg+alt%3D%22%22+class%3D%22has%22+src%3D%22%2F%2Fupload-images.jianshu.io%2Fupload_images%2F5875695-62c731aec981dd02.jpg%3FimageMogr2%2Fauto-orient%2Fstrip%257CimageView2%2F2%2Fw%2F600%2Fformat%2Fwebp%22%3E%3C%2Fp%3E+%0A++%3Cp%3E00003.%3C%2Fp%3E+%0A++%3Cp%3E%E5%B8%82%E5%9C%BA%E9%9C%80%E6%B1%82%E6%97%BA%E7%9B%9B%EF%BC%8C%E5%A4%A7%E6%95%B0%E6%8D%AE%E5%9F%B9%E8%AE%AD%E7%9A%84%E4%B8%BB%E4%BD%93%EF%BC%8C%E4%B9%9F%E6%98%AF%E7%A7%91%E5%A4%9A%E5%A4%A7%E6%95%B0%E6%8D%AE%E6%9C%80%E4%B8%BB%E8%A6%81%E7%9A%84%E8%AF%BE%E7%A8%8B%3C%2Fp%3E+%0A++%3Cp%3E00004.%3C%2Fp%3E+%0A++%3Cp%3E%3Cstrong%3E%E5%AF%B9%E5%BA%94%E5%B2%97%E4%BD%8D%EF%BC%9A%3C%2Fstrong%3E%E5%A4%A7%E6%95%B0%E6%8D%AE%E5%BC%80%E5%8F%91%E5%B7%A5%E7%A8%8B%E5%B8%88%E7%88%AC%E8%99%AB%E5%B7%A5%E7%A8%8B%E5%B8%88%E6%95%B0%E6%8D%AE%E5%88%86%E6%9E%90%E5%B8%88%E7%AD%89%3C%2Fp%3E+%0A++%3Cp%3E00005.%3C%2Fp%3E+%0A++%3Cp%3E00006.%3C%2Fp%3E+%0A++%3Cp%3E%3Cstrong%3E%E6%95%B0%E6%8D%AE%E6%8C%96%E6%8E%98%E3%80%81%E6%95%B0%E6%8D%AE%E5%88%86%E6%9E%90%26amp%3B%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0%E6%96%B9%E5%90%91%3C%2Fstrong%3E%3C%2Fp%3E+%0A++%3Cp%3E00007.%3C%2Fp%3E+%0A++%3Cp%3E%3Cimg+alt%3D%22%22+class%3D%22has%22+src%3D%22%2F%2Fupload-images.jianshu.io%2Fupload_images%2F5875695-702e2ba2f226bc33.jpg%3FimageMogr2%2Fauto-orient%2Fstrip%257CimageView2%2F2%2Fw%2F627%2Fformat%2Fwebp%22%3E%3C%2Fp%3E+%0A++%3Cp%3E00008.%3C%2Fp%3E+%0A++%3Cp%3E%E5%AD%A6%E4%B9%A0%E8%B5%B7%E7%82%B9%E9%AB%98%E3%80%81%E9%9A%BE%E5%BA%A6%E5%A4%A7%3C%2Fp%3E+%0A++%3Cp%3E00009.%3C%2Fp%3E+%0A++%3Cp%3E%3Cstrong%3E%E5%AF%B9%E5%BA%94%E5%B2%97%E4%BD%8D%EF%BC%9A%3C%2Fstrong%3E%E6%95%B0%E6%8D%AE%E7%A7%91%E5%AD%A6%E5%AE%B6%E3%80%81%E6%95%B0%E6%8D%AE%E6%8C%96%E6%8E%98%E5%B7%A5%E7%A8%8B%E5%B8%88%E3%80%81%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0%E5%B7%A5%E7%A8%8B%E5%B8%88%E7%AD%89%3C%2Fp%3E+%0A++%3Cp%3E00010.%3C%2Fp%3E+%0A++%3Cp%3E00011.%3C%2Fp%3E+%0A++%3Cp%3E%3Cstrong%3E%E5%A4%A7%E6%95%B0%E6%8D%AE%E8%BF%90%E7%BB%B4%26amp%3B%E4%BA%91%E8%AE%A1%E7%AE%97%E6%96%B9%E5%90%91%3C%2Fstrong%3E%3C%2Fp%3E+%0A++%3Cp%3E00012.%3C%2Fp%3E+%0A++%3Cp%3E%3Cimg+alt%3D%22%22+class%3D%22has%22+src%3D%22%2F%2Fupload-images.jianshu.io%2Fupload_images%2F5875695-34cd9854a4fac38a.jpg%3FimageMogr2%2Fauto-orient%2Fstrip%257CimageView2%2F2%2Fw%2F400%2Fformat%2Fwebp%22%3E%3C%2Fp%3E+%0A++%3Cp%3E00013.%3C%2Fp%3E+%0A++%3Cp%3E%E5%B8%82%E5%9C%BA%E9%9C%80%E6%B1%82%E4%B8%AD%E7%AD%89%3C%2Fp%3E+%0A++%3Cp%3E00014.%3C%2Fp%3E+%0A++%3Cp%3E%3Cstrong%3E%E5%AF%B9%E5%BA%94%E5%B2%97%E4%BD%8D%EF%BC%9A%3C%2Fstrong%3E%E5%A4%A7%E6%95%B0%E6%8D%AE%E8%BF%90%E7%BB%B4%E5%B7%A5%E7%A8%8B%E5%B8%88%3C%2Fp%3E+%0A++%3Cp%3E00015.%3C%2Fp%3E+%0A++%3Cp%3E%3Cstrong%3E%E7%B2%BE%E9%80%9A%E4%BB%BB%E4%BD%95%E6%96%B9%E5%90%91%E4%B9%8B%E4%B8%80%E8%80%85%EF%BC%8C%E5%9D%87%E4%BC%9A+%E2%80%9C+%E5%89%8D%EF%BC%88%E9%92%B1%EF%BC%89%E2%80%9D%E9%80%94%E6%97%A0%E9%87%8F%E3%80%82%3C%2Fstrong%3E%3C%2Fp%3E+%0A++%3Cp%3E%E4%B8%89%E4%B8%AA%E6%96%B9%E5%90%91%E4%B8%AD%EF%BC%8C%E5%A4%A7%E6%95%B0%E6%8D%AE%E5%BC%80%E5%8F%91%E6%98%AF%E5%9F%BA%E7%A1%80%E3%80%82%E4%BB%A5Hadoop%E5%BC%80%E5%8F%91%E5%B7%A5%E7%A8%8B%E5%B8%88%E4%B8%BA%E4%BE%8B%EF%BC%8CHadoop%E5%85%A5%E9%97%A8%E6%9C%88%E8%96%AA%E5%B7%B2%E7%BB%8F%E8%BE%BE%E5%88%B0%E4%BA%86+8K+%E4%BB%A5%E4%B8%8A%EF%BC%8C%E5%B7%A5%E4%BD%9C1%E5%B9%B4%E6%9C%88%E8%96%AA%E5%8F%AF%E8%BE%BE%E5%88%B0+1.2W+%E4%BB%A5%E4%B8%8A%EF%BC%8C%E5%85%B7%E6%9C%892-3%E5%B9%B4%E5%B7%A5%E4%BD%9C%E7%BB%8F%E9%AA%8C%E7%9A%84hadoop%E4%BA%BA%E6%89%8D%E5%B9%B4%E8%96%AA%E5%8F%AF%E4%BB%A5%E8%BE%BE%E5%88%B0+30%E4%B8%87%E2%80%9450%E4%B8%87%EF%BC%8C%E4%B8%80%E8%88%AC%E9%9C%80%E8%A6%81%E5%A4%A7%E6%95%B0%E6%8D%AE%E5%A4%84%E7%90%86%E7%9A%84%E5%85%AC%E5%8F%B8%E5%9F%BA%E6%9C%AC%E4%B8%8A%E9%83%BD%E6%98%AF%E5%A4%A7%E5%85%AC%E5%8F%B8%EF%BC%8C%E6%89%80%E4%BB%A5%E5%AD%A6%E4%B9%A0%E5%A4%A7%E6%95%B0%E6%8D%AE%E4%B8%93%E4%B8%9A%E4%B9%9F%E6%98%AF%E8%BF%9B%E5%A4%A7%E5%85%AC%E5%8F%B8%E7%9A%84%E6%8D%B7%E5%BE%84%E3%80%82%3C%2Fp%3E+%0A++%3Cp%3E2%3Cstrong%3E%E5%90%84%E5%9C%B0%E7%BA%B7%E7%BA%B7%E5%87%BA%E5%8F%B0%E6%94%BF%E7%AD%96%EF%BC%8C%E6%94%AF%E6%8C%81%E5%A4%A7%E6%95%B0%E6%8D%AE%E4%BA%A7%E4%B8%9A%E5%8F%91%E5%B1%95%3C%2Fstrong%3E%3C%2Fp%3E+%0A++%3Cp%3E%3Cstrong%3E%E7%A6%8F%E5%BB%BA%3C%2Fstrong%3E%3C%2Fp%3E+%0A++%3Cp%3E%E6%97%A5%E5%89%8D%EF%BC%8C%E5%8E%A6%E9%97%A8%E5%B8%82%E6%94%BF%E5%BA%9C%E5%8F%91%E5%B8%83%E4%BA%86%E3%80%8A%E5%8E%A6%E9%97%A8%E5%B8%82%E4%BF%83%E8%BF%9B%E5%A4%A7%E6%95%B0%E6%8D%AE%E5%8F%91%E5%B1%95%E5%B7%A5%E4%BD%9C%E5%AE%9E%E6%96%BD%E6%96%B9%E6%A1%88%E3%80%8B%EF%BC%8C%E5%8E%A6%E9%97%A8%E5%B8%82%E5%B0%86%E4%BB%A5%E6%94%BF%E5%BA%9C%E5%A4%A7%E6%95%B0%E6%8D%AE%E5%BC%80%E6%94%BE%E5%BC%80%E5%8F%91%E4%B8%BA%E5%85%88%E5%AF%BC%EF%BC%8C%E6%8E%A8%E5%8A%A8%E5%A4%A7%E6%95%B0%E6%8D%AE%E6%8A%80%E6%9C%AF%E4%B8%8E%E7%A4%BE%E4%BC%9A%E7%BB%8F%E6%B5%8E%E5%90%84%E9%A2%86%E5%9F%9F%E5%BA%94%E7%94%A8%E7%9A%84%E6%B7%B1%E5%BA%A6%E8%9E%8D%E5%90%88%EF%BC%9B%E4%BB%A5%E4%BC%81%E4%B8%9A%E4%B8%BA%E4%B8%BB%E4%BD%93%EF%BC%8C%E7%AA%81%E7%A0%B4%E5%A4%A7%E6%95%B0%E6%8D%AE%E5%85%B3%E9%94%AE%E6%8A%80%E6%9C%AF%E7%A0%94%E5%8F%91%EF%BC%8C%E7%9D%80%E5%8A%9B%E6%8E%A8%E8%BF%9B%E6%95%B0%E6%8D%AE%E6%B1%87%E9%9B%86%E5%92%8C%E5%8F%91%E6%8E%98%EF%BC%8C%E6%B7%B1%E5%8C%96%E5%A4%A7%E6%95%B0%E6%8D%AE%E5%9C%A8%E5%90%84%E8%A1%8C%E4%B8%9A%E5%88%9B%E6%96%B0%E5%BA%94%E7%94%A8%EF%BC%8C%E9%87%8D%E7%82%B9%E9%94%A4%E7%82%BC%E8%8B%A5%E5%B9%B2%E4%BC%98%E5%8A%BF%E4%BA%A7%E4%B8%9A%E7%8E%AF%E8%8A%82%EF%BC%8C%E5%85%A8%E9%9D%A2%E6%8F%90%E5%8D%87%E5%8E%A6%E9%97%A8%E5%B8%82%E5%A4%A7%E6%95%B0%E6%8D%AE%E4%BA%A7%E4%B8%9A%E5%8F%91%E5%B1%95%E6%B0%B4%E5%B9%B3%E3%80%82%3C%2Fp%3E+%0A++%3Cp%3E%3Cimg+alt%3D%22%22+class%3D%22has%22+src%3D%22%2F%2Fupload-images.jianshu.io%2Fupload_images%2F5875695-0141e5b9a5941870.jpg%3FimageMogr2%2Fauto-orient%2Fstrip%257CimageView2%2F2%2Fw%2F640%2Fformat%2Fwebp%22%3E%3C%2Fp%3E+%0A++%3Cp%3E%3Cstrong%3E%E5%B1%B1%E8%A5%BF%3C%2Fstrong%3E%3C%2Fp%3E+%0A++%3Cp%3E2017%E5%B9%B43%E6%9C%8816%E6%97%A5%EF%BC%8C%E5%9C%A8%E5%8C%97%E4%BA%AC%E5%9B%BD%E9%99%85%E4%BC%9A%E8%AE%AE%E4%B8%AD%E5%BF%83%E4%B8%BE%E8%A1%8C%E7%9A%84%E5%B1%B1%E8%A5%BF%E7%9C%81%E5%A4%A7%E6%95%B0%E6%8D%AE%E4%BA%A7%E4%B8%9A%E5%8F%91%E5%B1%95%E4%B8%BB%E9%A2%98%E5%B3%B0%E4%BC%9A%E4%B8%8A%EF%BC%8C%E5%B1%B1%E8%A5%BF%E9%A6%96%E6%AC%A1%E5%85%AC%E5%B8%83%E4%BA%86%E3%80%8A%E5%B1%B1%E8%A5%BF%E7%9C%81%E5%A4%A7%E6%95%B0%E6%8D%AE%E5%8F%91%E5%B1%95%E8%A7%84%E5%88%92%282017-2020%E5%B9%B4%29%E3%80%8B%E3%80%81%E3%80%8A%E5%B1%B1%E8%A5%BF%E7%9C%81%E4%BF%83%E8%BF%9B%E5%A4%A7%E6%95%B0%E6%8D%AE%E5%8F%91%E5%B1%95%E5%BA%94%E7%94%A8%E7%9A%84%E8%8B%A5%E5%B9%B2%E6%94%BF%E7%AD%96%E3%80%8B%E5%92%8C%E3%80%8A%E5%B1%B1%E8%A5%BF%E7%9C%81%E4%BF%83%E8%BF%9B%E5%A4%A7%E6%95%B0%E6%8D%AE%E5%8F%91%E5%B1%95%E5%BA%94%E7%94%A82017%E5%B9%B4%E8%A1%8C%E5%8A%A8%E8%AE%A1%E5%88%92%E3%80%8B%E3%80%82%E5%88%B02020%E5%B9%B4%EF%BC%8C%E5%B1%B1%E8%A5%BF%E5%A4%A7%E6%95%B0%E6%8D%AE%E7%9B%B8%E5%85%B3%E4%BA%A7%E4%B8%9A%E4%BA%A7%E5%80%BC%E5%B0%86%E5%AE%9E%E7%8E%B01000%E4%BA%BF%E5%85%83%E4%BB%A5%E4%B8%8A%E3%80%82%3C%2Fp%3E+%0A++%3Cp%3E%3Cstrong%3E%E8%B4%B5%E5%B7%9E%3C%2Fstrong%3E%3C%2Fp%3E+%0A++%3Cp%3E2017%E5%B9%B43%E6%9C%8816%E6%97%A5%EF%BC%8C%E8%B4%B5%E9%98%B3%E5%B8%82%E6%97%85%E5%8F%91%E5%A7%94%E5%87%BA%E5%8F%B0%E3%80%8A%E8%B4%B5%E9%98%B3%E5%B8%82%E5%A4%A7%E6%95%B0%E6%8D%AE%E6%97%85%E6%B8%B8%E9%A2%86%E5%9F%9F%E5%BA%94%E7%94%A8%E4%B8%89%E5%B9%B4%E8%A1%8C%E5%8A%A8%E8%AE%A1%E5%88%92%E3%80%8B%E5%BE%81%E6%B1%82%E6%84%8F%E8%A7%81%E7%A8%BF%E3%80%82%E5%BE%81%E6%B1%82%E6%84%8F%E8%A7%81%E7%A8%BF%E6%8F%90%E5%87%BA%EF%BC%8C%E5%88%9B%E6%96%B0%E6%97%85%E6%B8%B8%E8%A1%8C%E4%B8%9A%E7%AE%A1%E7%90%86%E5%92%8C%E6%97%85%E6%B8%B8%E5%85%AC%E5%85%B1%E6%9C%8D%E5%8A%A1%E6%A8%A1%E5%BC%8F%EF%BC%8C%E5%88%B02019%E5%B9%B4%EF%BC%8C%E5%85%A8%E5%B8%82%E6%89%93%E9%80%A0%E6%99%BA%E6%85%A7%E6%97%85%E6%B8%B8%E7%A4%BA%E8%8C%83%E4%BC%81%E4%B8%9A3%E8%87%B35%E4%B8%AA%EF%BC%8C%E5%BC%95%E8%BF%9B%E5%92%8C%E5%9F%B9%E8%82%B2%E5%A4%A7%E6%95%B0%E6%8D%AE%E6%97%85%E6%B8%B8%E4%BC%81%E4%B8%9A5%E8%87%B310%E5%AE%B6%EF%BC%8C%E6%97%85%E6%B8%B8%E5%A4%A7%E6%95%B0%E6%8D%AE%E7%9B%B8%E5%85%B3%E4%BA%A7%E4%B8%9A%E4%BA%A7%E5%80%BC%E5%B0%86%E8%BE%BE200%E4%BA%BF%E5%85%83%EF%BC%8C%E6%97%85%E6%B8%B8%E4%B8%9A%E6%80%81%E9%80%90%E6%AD%A5%E5%90%91%E7%BB%BC%E5%90%88%E6%80%A7%E3%80%81%E8%9E%8D%E5%90%88%E6%80%A7%E8%BD%AC%E5%9E%8B%E3%80%82%3C%2Fp%3E+%0A++%3Cp%3E%3Cstrong%3E%E5%B9%BF%E8%A5%BF%3C%2Fstrong%3E%3C%2Fp%3E+%0A++%3Cp%3E%E6%97%A5%E5%89%8D%EF%BC%8C%E5%B9%BF%E8%A5%BF%E5%8D%B0%E5%8F%91%E3%80%8A%E5%85%B3%E4%BA%8E%E7%BB%84%E7%BB%87%E7%94%B3%E6%8A%A52017%E5%B9%B4%E5%B7%A5%E4%B8%9A%E4%BA%91%E4%B8%8E%E5%B7%A5%E4%B8%9A%E5%A4%A7%E6%95%B0%E6%8D%AE+%E8%AF%95%E7%82%B9%E7%A4%BA%E8%8C%83%E9%A1%B9%E7%9B%AE%E7%9A%84%E9%80%9A%E7%9F%A5%E3%80%8B%E3%80%82%E8%AF%A5%E7%9C%81%E5%B0%86%E7%A7%AF%E6%9E%81%E6%8E%A8%E8%BF%9B%E5%B7%A5%E4%B8%9A%E4%BA%91%E5%92%8C%E5%B7%A5%E4%B8%9A%E5%A4%A7%E6%95%B0%E6%8D%AE%E8%AF%95%E7%82%B9%E7%A4%BA%E8%8C%83%E5%BA%94%E7%94%A8%EF%BC%8C%E9%BC%93%E5%8A%B1%E8%A1%8C%E4%B8%9A%E9%BE%99%E5%A4%B4%E4%BC%81%E4%B8%9A%E5%BB%BA%E7%AB%8B%E9%9D%A2%E5%90%91%E8%A1%8C%E4%B8%9A%E7%9A%84%E5%B7%A5%E4%B8%9A%E4%BA%91%E5%92%8C%E5%B7%A5%E4%B8%9A%E5%A4%A7%E6%95%B0%E6%8D%AE%E8%AF%95%E7%82%B9%E7%A4%BA%E8%8C%83%E5%B9%B3%E5%8F%B0%EF%BC%8C%E5%AE%9E%E7%8E%B0%E5%AE%89%E5%85%A8%E4%BF%9D%E9%9A%9C%E6%9C%89%E5%8A%9B%EF%BC%8C%E6%9C%8D%E5%8A%A1%E5%88%9B%E6%96%B0%E3%80%81%E6%8A%80%E6%9C%AF%E5%88%9B%E6%96%B0%E5%92%8C%E7%AE%A1%E7%90%86%E5%88%9B%E6%96%B0%E5%8D%8F%E5%90%8C%E6%8E%A8%E8%BF%9B%E7%9A%84%E5%B7%A5%E4%B8%9A%E4%BA%91%E8%AE%A1%E7%AE%97%E5%92%8C%E5%B7%A5%E4%B8%9A%E5%A4%A7%E6%95%B0%E6%8D%AE%E5%8F%91%E5%B1%95%E6%A0%BC%E5%B1%80%EF%BC%8C%E5%B8%A6%E5%8A%A8%E7%9B%B8%E5%85%B3%E4%BA%A7%E4%B8%9A%E5%BF%AB%E9%80%9F%E5%8F%91%E5%B1%95%E3%80%82%3C%2Fp%3E+%0A++%3Cp%3E3%3Cstrong%3E%E2%80%9C%E5%A4%A7%E6%95%B0%E6%8D%AE%E2%80%9D%E4%B8%93%E4%B8%9A%E6%AF%95%E4%B8%9A%E4%BB%A5%E5%90%8E%E5%B9%B2%E4%BB%80%E4%B9%88%EF%BC%9F%3C%2Fstrong%3E%3C%2Fp%3E+%0A++%3Cp%3E%E4%BA%8B%E5%AE%9E%E4%B8%8A%EF%BC%8C%E5%A4%A7%E6%95%B0%E6%8D%AE%E5%B7%A5%E4%BD%9C%E8%80%85%E5%8F%AF%E4%BB%A5%E6%96%BD%E5%B1%95%E6%8B%B3%E8%84%9A%E7%9A%84%E9%A2%86%E5%9F%9F%E9%9D%9E%E5%B8%B8%E5%B9%BF%E6%B3%9B%EF%BC%8C%E4%BB%8E%E5%9B%BD%E9%98%B2%E9%83%A8%E3%80%81%E4%BA%92%E8%81%94%E7%BD%91%E5%88%9B%E4%B8%9A%E5%85%AC%E5%8F%B8%E5%88%B0%E9%87%91%E8%9E%8D%E6%9C%BA%E6%9E%84%EF%BC%8C%E5%88%B0%E5%A4%84%E9%9C%80%E8%A6%81%E5%A4%A7%E6%95%B0%E6%8D%AE%E9%A1%B9%E7%9B%AE%E6%9D%A5%E5%81%9A%E5%88%9B%E6%96%B0%E9%A9%B1%E5%8A%A8%E3%80%82%E6%95%B0%E6%8D%AE%E5%88%86%E6%9E%90%E6%88%96%E6%95%B0%E6%8D%AE%E5%A4%84%E7%90%86%E7%9A%84%E5%B2%97%E4%BD%8D%E6%8A%A5%E9%85%AC%E4%B9%9F%E9%9D%9E%E5%B8%B8%E4%B8%B0%E5%8E%9A%EF%BC%8C%E5%9C%A8%E7%A1%85%E8%B0%B7%EF%BC%8C%E5%85%A5%E9%97%A8%E7%BA%A7%E7%9A%84%E6%95%B0%E6%8D%AE%E7%A7%91%E5%AD%A6%E5%AE%B6%E7%9A%84%E6%94%B6%E5%85%A5%E5%B7%B2%E7%BB%8F%E6%98%AF6%E4%BD%8D%E6%95%B0%E4%BA%86%28%E7%BE%8E%E5%85%83%29%E3%80%82%3C%2Fp%3E+%0A++%3Cp%3E%E7%9B%AE%E5%89%8D%E5%A4%A7%E6%95%B0%E6%8D%AE%E6%96%B9%E5%90%91%E5%AD%A6%E5%91%98%E5%B0%B1%E4%B8%9A%E7%9A%84%E5%B2%97%E4%BD%8D%E4%B8%BB%E8%A6%81%E4%B8%BA%E5%A4%A7%E6%95%B0%E6%8D%AE%E5%BC%80%E5%8F%91%E5%B7%A5%E7%A8%8B%E5%B8%88%EF%BC%8C%E8%B4%9F%E8%B4%A3%E5%A4%A7%E6%95%B0%E6%8D%AE%E5%A4%84%E7%90%86%E7%A8%8B%E5%BA%8F%E7%9A%84%E5%BC%80%E5%8F%91%E3%80%82%3C%2Fp%3E+%0A++%3Cp%3E%E4%BB%8E%E5%B0%B1%E4%B8%9A%E5%AD%A6%E5%91%98%E7%9A%84%E5%8F%8D%E9%A6%88%E6%9D%A5%E7%9C%8B%EF%BC%8C%E6%88%91%E4%BB%AC%E7%9A%84%E5%AD%A6%E5%91%98%E5%AE%8C%E5%85%A8%E5%8F%AF%E4%BB%A5%E8%83%9C%E4%BB%BB%E8%BF%99%E6%A0%B7%E7%9A%84%E5%B7%A5%E4%BD%9C%EF%BC%8C%E5%B9%B6%E4%B8%94%E6%9C%89%E4%B8%8D%E5%B0%91%E5%AD%A6%E5%91%98%E5%9C%A8%E5%B7%A5%E4%BD%9C%E4%B8%AD%E6%88%90%E4%B8%BA%E4%BA%86%E5%9B%A2%E9%98%9F%E4%B8%AD%E7%9A%84%E4%BD%BC%E4%BD%BC%E8%80%85%E3%80%82%3Cstrong%3E%3Ca+href%3D%22https%3A%2F%2Fblog.csdn.net%2Fyoooooooooooooop%2Farticle%2Fdetails%2F90300777%3F_wv%3D1027%26amp%3Bk%3D5IdLDUk%22+rel%3D%22nofollow%22%3E%E3%80%90%E5%A4%A7%E6%95%B0%E6%8D%AE%E5%BC%80%E5%8F%91%E5%AD%A6%E4%B9%A0%E8%B5%84%E6%96%99%E9%A2%86%E5%8F%96%E6%96%B9%E5%BC%8F%E3%80%91%EF%BC%9A%E5%8A%A0%E5%85%A5%E5%A4%A7%E6%95%B0%E6%8D%AE%E6%8A%80%E6%9C%AF%E5%AD%A6%E4%B9%A0%E4%BA%A4%E6%B5%81%E7%BE%A4%EF%BC%8C%E7%82%B9%E5%87%BB%E5%8A%A0%E5%85%A5%E7%BE%A4%E8%81%8A%EF%BC%8C%E7%A7%81%E4%BF%A1%E7%AE%A1%E7%90%86%E5%91%98%E5%8D%B3%E5%8F%AF%E5%85%8D%E8%B4%B9%E9%A2%86%E5%8F%96%3C%2Fa%3E%3C%2Fstrong%3E%3C%2Fp%3E+%0A++%3Cp%3E%26nbsp%3B%3C%2Fp%3E+%0A+%3C%2Fdiv%3E+%0A%3C%2Fdiv%3E\" | url_decode}}"}}},{"rowIdx":958,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a shell script. Evaluate whether it has a high educational value and could help teach shell scripting. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the script contains valid shell commands, even if it's not educational, like simple system calls or basic file operations.\n- Add another point if the script addresses practical shell scripting concepts (e.g., variables, conditionals), even if it lacks comments.\n- Award a third point if the script is suitable for educational use and introduces key concepts in shell scripting, even if the topic is somewhat advanced (e.g., functions, process management). The script should be well-structured and contain some comments.\n- Give a fourth point if the script is self-contained and highly relevant to teaching shell scripting. It should be similar to a tutorial example or a shell scripting course section, demonstrating good practices in script organization.\n- Grant a fifth point if the script is outstanding in its educational value and is perfectly suited for teaching shell scripting. It should be well-written, easy to understand, and contain step-by-step explanations in comments.\n\nThe extract:\n#!/bin/bash\ndocker run --rm -it \\\n\t\t-v /black/localhome/glerma/soft/dwi-flip-bvec/config.json:/flywheel/v0/config.json \\\n -v /black/localhome/glerma/TESTDATA/flipbvec/input:/flywheel/v0/input \\\n -v /black/localhome/glerma/TESTDATA/flipbvec/output:/flywheel/v0/output \\\n vistalab/dwi-flip-bvec:1.0.0\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"shell"},"label":{"kind":"number","value":2,"string":"2"},"text":{"kind":"string","value":"#!/bin/bash\ndocker run --rm -it \\\n\t\t-v /black/localhome/glerma/soft/dwi-flip-bvec/config.json:/flywheel/v0/config.json \\\n -v /black/localhome/glerma/TESTDATA/flipbvec/input:/flywheel/v0/input \\\n -v /black/localhome/glerma/TESTDATA/flipbvec/output:/flywheel/v0/output \\\n vistalab/dwi-flip-bvec:1.0.0\n"}}},{"rowIdx":959,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a C# program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\nAdd 1 point if the program contains valid C# code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\nAdd another point if the program addresses practical C# concepts, even if it lacks comments.\nAward a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., LINQ, reflection). The code should be well-structured and contain some comments.\nGive a fourth point if the program is self-contained and highly relevant to teaching C#. It should be similar to a school exercise, a tutorial, or a C# course section.\nGrant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching C#. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing Microsoft.Extensions.FileProviders;\n\nnamespace GoM.Core\n{\n public interface IGomContext\n {\n string RootPath { get; }\n\n IReadOnlyCollection Repositories { get; }\n\n IReadOnlyCollection Feeds { get; }\n }\n}\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"csharp"},"label":{"kind":"number","value":1,"string":"1"},"text":{"kind":"string","value":"using System;\nusing System.Collections.Generic;\nusing System.Text;\nusing Microsoft.Extensions.FileProviders;\n\nnamespace GoM.Core\n{\n public interface IGomContext\n {\n string RootPath { get; }\n\n IReadOnlyCollection Repositories { get; }\n\n IReadOnlyCollection Feeds { get; }\n }\n}\n"}}},{"rowIdx":960,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a Kotlin program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid Kotlin code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical Kotlin concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., coroutines, extension functions). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching Kotlin. It should be similar to a school exercise, a tutorial, or a Kotlin course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching Kotlin. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\npackage com.stepwise.quotes\n\nimport android.content.res.Resources\nimport com.stepwise.quotes.domain.model.Quote\nimport com.stepwise.quotes.ui.mainpage.MainPageMVP\nimport com.stepwise.quotes.ui.mainpage.MainPageViewModel\nimport com.stepwise.quotes.ui.mainpage.Presenter\nimport com.stepwise.quotes.ui.mainpage.addquote.CreateQuoteErrorViewModel\nimport com.stepwise.quotes.ui.mainpage.quotelist.QuoteListItemViewModel\nimport kotlinx.coroutines.*\nimport kotlinx.coroutines.test.resetMain\nimport kotlinx.coroutines.test.runBlockingTest\nimport kotlinx.coroutines.test.setMain\nimport org.junit.After\nimport org.junit.Before\nimport org.junit.Test\nimport org.mockito.Mockito.*\n\n@ExperimentalCoroutinesApi\n@ObsoleteCoroutinesApi\nclass MainPageMVPTests {\n private lateinit var mockModel: MainPageMVP.Model\n private lateinit var mockView: MainPageMVP.View\n private lateinit var presenter: Presenter\n private lateinit var item: Quote\n private val mainThreadSurrogate = newSingleThreadContext(\"UI thread\")\n\n @Before\n fun setup() {\n mockModel = mock(MainPageMVP.Model::class.java)\n mockView = mock(MainPageMVP.View::class.java)\n presenter = Presenter(mockModel, mock(Resources::class.java, RETURNS_MOCKS))\n presenter.setView(mockView)\n\n item = Quote(-1,\"A title\", \"A description\")\n Dispatchers.setMain(mainThreadSurrogate)\n }\n\n @After\n fun tearDown() {\n Dispatchers.resetMain()\n mainThreadSurrogate.close()\n }\n\n @Test\n fun loadContentFromRepositoryIntoView_WhenContentRequested() = runBlockingTest {\n val listToSupply = listOf(item).map{ QuoteListItemViewModel.fromContent(it) }\n val viewModelToExpect = MainPageViewModel(listToSupply)\n\n `when`(mockModel.getContent()).thenReturn(listOf(item))\n\n presenter.loadContent()\n verify(mockModel, times(1)).getContent()\n verify(mockView, times(1)).updateContent(viewModelToExpect)\n\n }\n\n @Test\n fun navigateToAddItemCalled_WhenO\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"kotlin"},"label":{"kind":"number","value":3,"string":"3"},"text":{"kind":"string","value":"package com.stepwise.quotes\n\nimport android.content.res.Resources\nimport com.stepwise.quotes.domain.model.Quote\nimport com.stepwise.quotes.ui.mainpage.MainPageMVP\nimport com.stepwise.quotes.ui.mainpage.MainPageViewModel\nimport com.stepwise.quotes.ui.mainpage.Presenter\nimport com.stepwise.quotes.ui.mainpage.addquote.CreateQuoteErrorViewModel\nimport com.stepwise.quotes.ui.mainpage.quotelist.QuoteListItemViewModel\nimport kotlinx.coroutines.*\nimport kotlinx.coroutines.test.resetMain\nimport kotlinx.coroutines.test.runBlockingTest\nimport kotlinx.coroutines.test.setMain\nimport org.junit.After\nimport org.junit.Before\nimport org.junit.Test\nimport org.mockito.Mockito.*\n\n@ExperimentalCoroutinesApi\n@ObsoleteCoroutinesApi\nclass MainPageMVPTests {\n private lateinit var mockModel: MainPageMVP.Model\n private lateinit var mockView: MainPageMVP.View\n private lateinit var presenter: Presenter\n private lateinit var item: Quote\n private val mainThreadSurrogate = newSingleThreadContext(\"UI thread\")\n\n @Before\n fun setup() {\n mockModel = mock(MainPageMVP.Model::class.java)\n mockView = mock(MainPageMVP.View::class.java)\n presenter = Presenter(mockModel, mock(Resources::class.java, RETURNS_MOCKS))\n presenter.setView(mockView)\n\n item = Quote(-1,\"A title\", \"A description\")\n Dispatchers.setMain(mainThreadSurrogate)\n }\n\n @After\n fun tearDown() {\n Dispatchers.resetMain()\n mainThreadSurrogate.close()\n }\n\n @Test\n fun loadContentFromRepositoryIntoView_WhenContentRequested() = runBlockingTest {\n val listToSupply = listOf(item).map{ QuoteListItemViewModel.fromContent(it) }\n val viewModelToExpect = MainPageViewModel(listToSupply)\n\n `when`(mockModel.getContent()).thenReturn(listOf(item))\n\n presenter.loadContent()\n verify(mockModel, times(1)).getContent()\n verify(mockView, times(1)).updateContent(viewModelToExpect)\n\n }\n\n @Test\n fun navigateToAddItemCalled_WhenOnAddItemTapped() {\n presenter.onAddItemTapped()\n verify(mockView, times(1)).navigateToAddItem()\n }\n\n @Test\n fun creatingNewItem_WithoutTitle_WillShowError() = runBlockingTest {\n presenter.createNewItem(\"\", \"Description\")\n\n val expectedErrorVM = CreateQuoteErrorViewModel(\"\", null)\n verify(mockView, times(1)).createNewItemError(expectedErrorVM)\n verify(mockView, never()).onNewItemCreated(MockitoHelper.anyObject())\n verify(mockModel, never()).createNewItem(MockitoHelper.anyObject(), MockitoHelper.anyObject())\n }\n\n @Test\n fun creatingNewItem_WithoutDescription_WillShowError() = runBlockingTest {\n presenter.createNewItem(\"Title\", \"\")\n\n val expectedErrorVM = CreateQuoteErrorViewModel(null, \"\")\n verify(mockView, times(1)).createNewItemError(expectedErrorVM)\n verify(mockView, never()).onNewItemCreated(MockitoHelper.anyObject())\n verify(mockModel, never()).createNewItem(MockitoHelper.anyObject(), MockitoHelper.anyObject())\n }\n\n @Test\n fun creatingNewItem_Correctly_WillCreateNewItemInModel() = runBlockingTest {\n val newItem = Quote(-1, \"Title\", \"Description\")\n `when`(mockModel.createNewItem(\"Title\", \"Description\")).thenReturn(newItem)\n\n presenter.createNewItem(\"Title\", \"Description\")\n\n verify(mockView, never()).createNewItemError(MockitoHelper.anyObject())\n verify(mockView, times(1)).onNewItemCreated(QuoteListItemViewModel.fromContent(newItem))\n verify(mockModel, times(1)).createNewItem(\"Title\", \"Description\")\n }\n\n // Using Mockito matchers with kotlin: http://derekwilson.net/blog/2018/08/23/mokito-kotlin\n object MockitoHelper {\n fun anyObject(): T {\n any()\n return uninitialized()\n }\n @Suppress(\"UNCHECKED_CAST\")\n fun uninitialized(): T = null as T\n }\n}\n"}}},{"rowIdx":961,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a Swift program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid Swift code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical Swift concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., protocols, extensions). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching Swift. It should be similar to a school exercise, a tutorial, or a Swift course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching Swift. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\n//\n// Note.swift\n// YourDiary\n//\n// Created by Apple on 2019/11/5.\n// Copyright © 2019 feng. All rights reserved.\n//\nimport Foundation\nimport UIKit\nclass Note: NSObject, NSCoding{\n func encode(with aCoder: NSCoder) {\n aCoder.encode(year, forKey: \"yearKey\")\n aCoder.encode(month, forKey: \"monthKey\")\n aCoder.encode(day, forKey: \"dayKey\")\n aCoder.encode(weekday, forKey: \"weekdayKey\")\n aCoder.encode(noteContent, forKey: \"contentKey\")\n aCoder.encode(noteImages, forKey: \"imagesKey\")\n aCoder.encode(mood, forKey: \"moodKey\")\n aCoder.encode(weather, forKey: \"weatherKey\")\n }\n \n required init?(coder aDecoder: NSCoder) {\n year = aDecoder.decodeObject(forKey: \"yearKey\") as? Int\n month = aDecoder.decodeObject(forKey: \"monthKey\") as? Int\n day = aDecoder.decodeObject(forKey: \"dayKey\") as? Int\n weekday = aDecoder.decodeObject(forKey: \"weekdayKey\") as? String\n noteContent = aDecoder.decodeObject(forKey: \"contentKey\") as? String\n noteImages = aDecoder.decodeObject(forKey: \"imagesKey\") as? [UIImage]\n mood = aDecoder.decodeObject(forKey: \"moodKey\") as? UIImage\n weather = aDecoder.decodeObject(forKey: \"weatherKey\") as? UIImage\n \n }\n \n var year: Int!\n var month: Int!\n var day: Int!\n var weekday: String!\n var noteContent: String!\n var noteImages: [UIImage]?\n var mood: UIImage?\n var weather: UIImage?\n \n //发现项目的根目录\n static let DocumentsDirectory = FileManager().urls(for: .documentDirectory, in: .userDomainMask).first!\n //在项目的根目录下创建子目录\n static let ArchiveURL = DocumentsDirectory.appendingPathComponent(\"noteList\")\n \n init(year: Int?, month: Int?, day: Int?, weekday: String?, noteContent: String?, noteImages: [UIImage]?, mood: UIImage?, weather: UIImage?) {\n self.year = year\n self.month = month\n self.day = day\n self.weekday = weekday\n self.noteContent = noteContent\n self.\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"swift"},"label":{"kind":"number","value":2,"string":"2"},"text":{"kind":"string","value":"//\n// Note.swift\n// YourDiary\n//\n// Created by Apple on 2019/11/5.\n// Copyright © 2019 feng. All rights reserved.\n//\nimport Foundation\nimport UIKit\nclass Note: NSObject, NSCoding{\n func encode(with aCoder: NSCoder) {\n aCoder.encode(year, forKey: \"yearKey\")\n aCoder.encode(month, forKey: \"monthKey\")\n aCoder.encode(day, forKey: \"dayKey\")\n aCoder.encode(weekday, forKey: \"weekdayKey\")\n aCoder.encode(noteContent, forKey: \"contentKey\")\n aCoder.encode(noteImages, forKey: \"imagesKey\")\n aCoder.encode(mood, forKey: \"moodKey\")\n aCoder.encode(weather, forKey: \"weatherKey\")\n }\n \n required init?(coder aDecoder: NSCoder) {\n year = aDecoder.decodeObject(forKey: \"yearKey\") as? Int\n month = aDecoder.decodeObject(forKey: \"monthKey\") as? Int\n day = aDecoder.decodeObject(forKey: \"dayKey\") as? Int\n weekday = aDecoder.decodeObject(forKey: \"weekdayKey\") as? String\n noteContent = aDecoder.decodeObject(forKey: \"contentKey\") as? String\n noteImages = aDecoder.decodeObject(forKey: \"imagesKey\") as? [UIImage]\n mood = aDecoder.decodeObject(forKey: \"moodKey\") as? UIImage\n weather = aDecoder.decodeObject(forKey: \"weatherKey\") as? UIImage\n \n }\n \n var year: Int!\n var month: Int!\n var day: Int!\n var weekday: String!\n var noteContent: String!\n var noteImages: [UIImage]?\n var mood: UIImage?\n var weather: UIImage?\n \n //发现项目的根目录\n static let DocumentsDirectory = FileManager().urls(for: .documentDirectory, in: .userDomainMask).first!\n //在项目的根目录下创建子目录\n static let ArchiveURL = DocumentsDirectory.appendingPathComponent(\"noteList\")\n \n init(year: Int?, month: Int?, day: Int?, weekday: String?, noteContent: String?, noteImages: [UIImage]?, mood: UIImage?, weather: UIImage?) {\n self.year = year\n self.month = month\n self.day = day\n self.weekday = weekday\n self.noteContent = noteContent\n self.noteImages = noteImages\n self.mood = mood\n self.weather = weather\n }\n}\n"}}},{"rowIdx":962,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a Rust program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid Rust code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical Rust concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., ownership, lifetimes). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching Rust. It should be similar to a school exercise, a tutorial, or a Rust course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching Rust. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\n//! The `holoterminal` module\n//!\n//! This module will control the animations and graphics built into the\n//! application.\nmod wrappers;\n\nuse cursive::Cursive;\nuse cursive::traits::*;\nuse cursive::views::*;\nuse cursive::align::HAlign;\n\nuse super::force::drinks_served;\nuse self::wrappers::*;\n\n//To Do: Add a ton of documentation to all the `holoterminal` functions\npub fn startup(tui: &mut Cursive) {\n // Intro Screen\n tui.add_fullscreen_layer(\n Dialog::text(\"Welcome to the Hall of the Tauntaun King!\")\n .h_align(HAlign::Center)\n .button(\"Start Game\", character_select)\n .button(\"Quit\", shutdown)\n .full_screen(),\n );\n}\n\nfn character_select(tui: &mut Cursive) {\n // Character Select & Login\n let select = SelectView::::new()\n .on_submit(stronghold)\n .with_id(\"select\")\n .fixed_size((10, 5));\n let buttons = LinearLayout::vertical()\n .child(Button::new(\"Add new\", build_character))\n .child(Button::new(\"Delete\", delete_name))\n .child(DummyView)\n .child(Button::new(\"Quit\", Cursive::quit));\n\n tui.add_layer(\n Dialog::around(\n LinearLayout::horizontal()\n .child(select)\n .child(DummyView)\n .child(buttons),\n ).title(\"Select your hero\"),\n );\n}\n\nfn build_character(tui: &mut Cursive) {\n // fn ok(tui: &mut Cursive, name: &str) {\n // tui.call_on_id(\"select\", |view: &mut SelectView| {\n // view.add_item_str(name);\n // });\n // tui.pop_layer();\n // }\n\n // tui.add_layer(Dialog::around(EditView::new()\n // .on_submit(ok)\n // .with_id(\"name\")\n // .fixed_width(10))\n // .title(\"Enter a new name\")\n // .button(\"Ok\", |s| {\n // let name = extract_edit(s, \"name\");\n // ok(s, &name);\n // })\n // .button(\"Cancel\", |s| s.pop_layer()));\n\n fn fill_entity(t: &mut Cursive) {}\n\n tu\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"rust"},"label":{"kind":"number","value":3,"string":"3"},"text":{"kind":"string","value":"//! The `holoterminal` module\n//!\n//! This module will control the animations and graphics built into the\n//! application.\nmod wrappers;\n\nuse cursive::Cursive;\nuse cursive::traits::*;\nuse cursive::views::*;\nuse cursive::align::HAlign;\n\nuse super::force::drinks_served;\nuse self::wrappers::*;\n\n//To Do: Add a ton of documentation to all the `holoterminal` functions\npub fn startup(tui: &mut Cursive) {\n // Intro Screen\n tui.add_fullscreen_layer(\n Dialog::text(\"Welcome to the Hall of the Tauntaun King!\")\n .h_align(HAlign::Center)\n .button(\"Start Game\", character_select)\n .button(\"Quit\", shutdown)\n .full_screen(),\n );\n}\n\nfn character_select(tui: &mut Cursive) {\n // Character Select & Login\n let select = SelectView::::new()\n .on_submit(stronghold)\n .with_id(\"select\")\n .fixed_size((10, 5));\n let buttons = LinearLayout::vertical()\n .child(Button::new(\"Add new\", build_character))\n .child(Button::new(\"Delete\", delete_name))\n .child(DummyView)\n .child(Button::new(\"Quit\", Cursive::quit));\n\n tui.add_layer(\n Dialog::around(\n LinearLayout::horizontal()\n .child(select)\n .child(DummyView)\n .child(buttons),\n ).title(\"Select your hero\"),\n );\n}\n\nfn build_character(tui: &mut Cursive) {\n // fn ok(tui: &mut Cursive, name: &str) {\n // tui.call_on_id(\"select\", |view: &mut SelectView| {\n // view.add_item_str(name);\n // });\n // tui.pop_layer();\n // }\n\n // tui.add_layer(Dialog::around(EditView::new()\n // .on_submit(ok)\n // .with_id(\"name\")\n // .fixed_width(10))\n // .title(\"Enter a new name\")\n // .button(\"Ok\", |s| {\n // let name = extract_edit(s, \"name\");\n // ok(s, &name);\n // })\n // .button(\"Cancel\", |s| s.pop_layer()));\n\n fn fill_entity(t: &mut Cursive) {}\n\n tui.add_layer(\n Dialog::new()\n .title(\"Create your loving Alter Ego!\")\n .button(\"Ok\", fill_entity)\n .content(\n ListView::new()\n .child(\n \"Name\",\n EditView::new()\n .with_id(\"name\")\n .fixed_width(10))\n .delimiter()\n .child(\n \"Class\",\n SelectView::new()\n .popup()\n .item_str(\"0-18\")\n .item_str(\"19-30\")\n .item_str(\"31-40\")\n .item_str(\"41+\")\n .with_id(\"class\")\n )\n .with(|list| for i in 0..50 {\n list.add_child(&format!(\"Item {}\", i), EditView::new());\n }),\n ),\n );\n}\n\n//To Do: Assign Admin privileges for character deletion\nfn delete_name(s: &mut Cursive) {\n let mut select = s.find_id::>(\"select\").unwrap();\n match select.selected_id() {\n None => s.add_layer(Dialog::info(\"No name to remove\")),\n Some(focus) => {\n select.remove_item(focus);\n }\n }\n}\n\nfn cantina(tui: &mut Cursive) {\n tui.add_layer(\n Dialog::around(EditView::new().with_id(\"cantina\").fixed_width(10))\n .title(\"What would you like to order?\")\n .button(\"Ok\", |t| {\n let drink = extract_edit(t, \"cantina\");\n drinks_served(&drink);\n t.pop_layer();\n }),\n );\n}\n\n// To Do: Look into TrackedView and easy callbacks to return to `Home` page\nfn stronghold(tui: &mut Cursive, name: &String) {\n // Load in necessary callbacks\n tui.add_global_callback('/', cantina);\n\n // Home Screen\n tui.clear();\n tui.add_fullscreen_layer(\n Dialog::text(format!(\"Name: {}\\nAwesome: yes\", name))\n .title(format!(\"{}'s info\", name))\n .button(\"Quit\", Cursive::quit)\n .full_screen(),\n );\n}\n\npub fn shutdown(tui: &mut Cursive) {\n tui.quit();\n}\n"}}},{"rowIdx":963,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a PHP program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid PHP code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical PHP concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., object-oriented programming, namespaces). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching PHP. It should be similar to a school exercise, a tutorial, or a PHP course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching PHP. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\n\"\n"},"language":{"kind":"string","value":"php"},"label":{"kind":"number","value":1,"string":"1"},"text":{"kind":"string","value":",\n /// Actual number of bytes.\n actual: usize,\n },\n\n /// Hex contains invalid characters, odd length, etc.\n #[error(\"Invalid hex: {0}\")]\n InvalidHex(hex::FromHexError),\n}\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"rust"},"label":{"kind":"number","value":2,"string":"2"},"text":{"kind":"string","value":"// Copyright (c) 2023 The Bitcoin developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n//! Module for errors in this crate.\n\nuse thiserror::Error;\n\n/// Errors indicating some data doesn't map to some object.\n#[derive(Clone, Debug, Error, PartialEq)]\npub enum DataError {\n /// Expect a fixed length which was not met.\n #[error(\n \"Invalid length, expected {expected} bytes but got {actual} bytes\"\n )]\n InvalidLength {\n /// Expected number of bytes.\n expected: usize,\n /// Actual number of bytes.\n actual: usize,\n },\n\n /// Expected bytes with multiple allowed lengths, none of which were met.\n #[error(\n \"Invalid length, expected one of {expected:?} but got {actual} bytes\"\n )]\n InvalidLengthMulti {\n /// List of expected number of bytes.\n expected: Vec,\n /// Actual number of bytes.\n actual: usize,\n },\n\n /// Hex contains invalid characters, odd length, etc.\n #[error(\"Invalid hex: {0}\")]\n InvalidHex(hex::FromHexError),\n}\n"}}},{"rowIdx":965,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a Ruby program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid Ruby code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical Ruby concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., metaprogramming, blocks). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching Ruby. It should be similar to a school exercise, a tutorial, or a Ruby course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching Ruby. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\nmodule Sinatra\n module YitoExtension\n module BookingPickupReturnPlaceDefinitionsManagement\n\n def self.registered(app)\n\n #\n # Pickup/return places\n #\n app.get '/admin/booking/booking-place-defs/?*', :allowed_usergroups => ['booking_manager','staff'] do \n\n locals = {:booking_pickup_return_place_defs => 20}\n load_em_page :booking_pickup_return_place_defs_management, \n :booking_pickup_return_place_defs, false, :locals => locals\n\n end\n\n #\n # Pickup/return places edition\n #\n app.get '/admin/booking/booking-pickup-return-places/:id', :allowed_usergroups => ['booking_manager', 'staff'] do\n\n if @pickup_return_place_definition = ::Yito::Model::Booking::PickupReturnPlaceDefinition.get(params[:id])\n @show_translations = settings.multilanguage_site\n if @multiple_rental_locations = BookingDataSystem::Booking.multiple_rental_locations\n @rental_locations = ::Yito::Model::Booking::RentalLocation.all\n else\n @rental_locations = []\n end\n load_page :booking_pickup_return_place_definition_edition\n else\n status 404\n end\n\n end\n\n end\n\n end\n end\nend\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"ruby"},"label":{"kind":"number","value":2,"string":"2"},"text":{"kind":"string","value":"module Sinatra\n module YitoExtension\n module BookingPickupReturnPlaceDefinitionsManagement\n\n def self.registered(app)\n\n #\n # Pickup/return places\n #\n app.get '/admin/booking/booking-place-defs/?*', :allowed_usergroups => ['booking_manager','staff'] do \n\n locals = {:booking_pickup_return_place_defs => 20}\n load_em_page :booking_pickup_return_place_defs_management, \n :booking_pickup_return_place_defs, false, :locals => locals\n\n end\n\n #\n # Pickup/return places edition\n #\n app.get '/admin/booking/booking-pickup-return-places/:id', :allowed_usergroups => ['booking_manager', 'staff'] do\n\n if @pickup_return_place_definition = ::Yito::Model::Booking::PickupReturnPlaceDefinition.get(params[:id])\n @show_translations = settings.multilanguage_site\n if @multiple_rental_locations = BookingDataSystem::Booking.multiple_rental_locations\n @rental_locations = ::Yito::Model::Booking::RentalLocation.all\n else\n @rental_locations = []\n end\n load_page :booking_pickup_return_place_definition_edition\n else\n status 404\n end\n\n end\n\n end\n\n end\n end\nend"}}},{"rowIdx":966,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a C++ program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid C++ code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical C++ concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., memory management). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching C++. It should be similar to a school exercise, a tutorial, or a C++ course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching C++. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\n#ifndef PARSPH_V2_UTILS_H\n#define PARSPH_V2_UTILS_H\n\n#include \"parSPH_V2_numeric.h\"\n\n#define max(a,b) (((a) > (b)) ? (a) : (b))\n#define min(a,b) (((a) < (b)) ? (a) : (b))\n\nnamespace utils\n{\n\tbool circleLineIntersect(const VEC3D& startLine, const VEC3D& endLine, const VEC3D& sphereCenter, double radius);\n\tbool circlePlaneIntersect(const VEC3D& p1, const VEC3D& p2, const VEC3D& p3, const VEC3D& p4, const VEC3D& sphereCenter, double radius);\n\n\tint packIntegerPair(int z1, int z2);\n\tint packIntegerPair3(int z1, int z2, int z3 = 0);\n\n\tVEC3D calcMirrorPosition2Line(VEC3D& lp1, VEC3D& lp2, VEC3D& vp, VEC3D& le);\n}\n\n#endif\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"cpp"},"label":{"kind":"number","value":2,"string":"2"},"text":{"kind":"string","value":"#ifndef PARSPH_V2_UTILS_H\n#define PARSPH_V2_UTILS_H\n\n#include \"parSPH_V2_numeric.h\"\n\n#define max(a,b) (((a) > (b)) ? (a) : (b))\n#define min(a,b) (((a) < (b)) ? (a) : (b))\n\nnamespace utils\n{\n\tbool circleLineIntersect(const VEC3D& startLine, const VEC3D& endLine, const VEC3D& sphereCenter, double radius);\n\tbool circlePlaneIntersect(const VEC3D& p1, const VEC3D& p2, const VEC3D& p3, const VEC3D& p4, const VEC3D& sphereCenter, double radius);\n\n\tint packIntegerPair(int z1, int z2);\n\tint packIntegerPair3(int z1, int z2, int z3 = 0);\n\n\tVEC3D calcMirrorPosition2Line(VEC3D& lp1, VEC3D& lp2, VEC3D& vp, VEC3D& le);\n}\n\n#endif"}}},{"rowIdx":967,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a Rust program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid Rust code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical Rust concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., ownership, lifetimes). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching Rust. It should be similar to a school exercise, a tutorial, or a Rust course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching Rust. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\nuse crate::{\n constants::{MAX_PRECISION_U32, POWERS_10, U32_MASK},\n decimal::{CalculationResult, Decimal},\n ops::array::{\n add_by_internal, cmp_internal, div_by_u32, is_all_zero, mul_by_u32, mul_part, rescale_internal, shl1_internal,\n },\n};\n\nuse core::cmp::Ordering;\nuse num_traits::Zero;\n\npub(crate) fn add_impl(d1: &Decimal, d2: &Decimal) -> CalculationResult {\n // Convert to the same scale\n let mut my = d1.mantissa_array3();\n let mut my_scale = d1.scale();\n let mut ot = d2.mantissa_array3();\n let mut other_scale = d2.scale();\n rescale_to_maximum_scale(&mut my, &mut my_scale, &mut ot, &mut other_scale);\n let mut final_scale = my_scale.max(other_scale);\n\n // Add the items together\n let my_negative = d1.is_sign_negative();\n let other_negative = d2.is_sign_negative();\n let mut negative = false;\n let carry;\n if !(my_negative ^ other_negative) {\n negative = my_negative;\n carry = add_by_internal3(&mut my, &ot);\n } else {\n let cmp = cmp_internal(&my, &ot);\n // -x + y\n // if x > y then it's negative (i.e. -2 + 1)\n match cmp {\n Ordering::Less => {\n negative = other_negative;\n sub_by_internal3(&mut ot, &my);\n my[0] = ot[0];\n my[1] = ot[1];\n my[2] = ot[2];\n }\n Ordering::Greater => {\n negative = my_negative;\n sub_by_internal3(&mut my, &ot);\n }\n Ordering::Equal => {\n // -2 + 2\n my[0] = 0;\n my[1] = 0;\n my[2] = 0;\n }\n }\n carry = 0;\n }\n\n // If we have a carry we underflowed.\n // We need to lose some significant digits (if possible)\n if carry > 0 {\n if final_scale == 0 {\n return CalculationResult::Overflow;\n }\n\n // Copy it over to a temp array for modification\n let mut temp = [my[0], my[1],\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"rust"},"label":{"kind":"number","value":2,"string":"2"},"text":{"kind":"string","value":"use crate::{\n constants::{MAX_PRECISION_U32, POWERS_10, U32_MASK},\n decimal::{CalculationResult, Decimal},\n ops::array::{\n add_by_internal, cmp_internal, div_by_u32, is_all_zero, mul_by_u32, mul_part, rescale_internal, shl1_internal,\n },\n};\n\nuse core::cmp::Ordering;\nuse num_traits::Zero;\n\npub(crate) fn add_impl(d1: &Decimal, d2: &Decimal) -> CalculationResult {\n // Convert to the same scale\n let mut my = d1.mantissa_array3();\n let mut my_scale = d1.scale();\n let mut ot = d2.mantissa_array3();\n let mut other_scale = d2.scale();\n rescale_to_maximum_scale(&mut my, &mut my_scale, &mut ot, &mut other_scale);\n let mut final_scale = my_scale.max(other_scale);\n\n // Add the items together\n let my_negative = d1.is_sign_negative();\n let other_negative = d2.is_sign_negative();\n let mut negative = false;\n let carry;\n if !(my_negative ^ other_negative) {\n negative = my_negative;\n carry = add_by_internal3(&mut my, &ot);\n } else {\n let cmp = cmp_internal(&my, &ot);\n // -x + y\n // if x > y then it's negative (i.e. -2 + 1)\n match cmp {\n Ordering::Less => {\n negative = other_negative;\n sub_by_internal3(&mut ot, &my);\n my[0] = ot[0];\n my[1] = ot[1];\n my[2] = ot[2];\n }\n Ordering::Greater => {\n negative = my_negative;\n sub_by_internal3(&mut my, &ot);\n }\n Ordering::Equal => {\n // -2 + 2\n my[0] = 0;\n my[1] = 0;\n my[2] = 0;\n }\n }\n carry = 0;\n }\n\n // If we have a carry we underflowed.\n // We need to lose some significant digits (if possible)\n if carry > 0 {\n if final_scale == 0 {\n return CalculationResult::Overflow;\n }\n\n // Copy it over to a temp array for modification\n let mut temp = [my[0], my[1], my[2], carry];\n while final_scale > 0 && temp[3] != 0 {\n div_by_u32(&mut temp, 10);\n final_scale -= 1;\n }\n\n // If we still have a carry bit then we overflowed\n if temp[3] > 0 {\n return CalculationResult::Overflow;\n }\n\n // Copy it back - we're done\n my[0] = temp[0];\n my[1] = temp[1];\n my[2] = temp[2];\n }\n\n CalculationResult::Ok(Decimal::from_parts(my[0], my[1], my[2], negative, final_scale))\n}\n\npub(crate) fn sub_impl(d1: &Decimal, d2: &Decimal) -> CalculationResult {\n add_impl(d1, &(-*d2))\n}\n\npub(crate) fn div_impl(d1: &Decimal, d2: &Decimal) -> CalculationResult {\n if d2.is_zero() {\n return CalculationResult::DivByZero;\n }\n if d1.is_zero() {\n return CalculationResult::Ok(Decimal::zero());\n }\n\n let dividend = d1.mantissa_array3();\n let divisor = d2.mantissa_array3();\n let mut quotient = [0u32, 0u32, 0u32];\n let mut quotient_scale: i32 = d1.scale() as i32 - d2.scale() as i32;\n\n // We supply an extra overflow word for each of the dividend and the remainder\n let mut working_quotient = [dividend[0], dividend[1], dividend[2], 0u32];\n let mut working_remainder = [0u32, 0u32, 0u32, 0u32];\n let mut working_scale = quotient_scale;\n let mut remainder_scale = quotient_scale;\n let mut underflow;\n\n loop {\n div_internal(&mut working_quotient, &mut working_remainder, &divisor);\n underflow = add_with_scale_internal(\n &mut quotient,\n &mut quotient_scale,\n &mut working_quotient,\n &mut working_scale,\n );\n\n // Multiply the remainder by 10\n let mut overflow = 0;\n for part in working_remainder.iter_mut() {\n let (lo, hi) = mul_part(*part, 10, overflow);\n *part = lo;\n overflow = hi;\n }\n // Copy temp remainder into the temp quotient section\n working_quotient.copy_from_slice(&working_remainder);\n\n remainder_scale += 1;\n working_scale = remainder_scale;\n\n if underflow || is_all_zero(&working_remainder) {\n break;\n }\n }\n\n // If we have a really big number try to adjust the scale to 0\n while quotient_scale < 0 {\n copy_array_diff_lengths(&mut working_quotient, &quotient);\n working_quotient[3] = 0;\n working_remainder.iter_mut().for_each(|x| *x = 0);\n\n // Mul 10\n let mut overflow = 0;\n for part in &mut working_quotient {\n let (lo, hi) = mul_part(*part, 10, overflow);\n *part = lo;\n overflow = hi;\n }\n for part in &mut working_remainder {\n let (lo, hi) = mul_part(*part, 10, overflow);\n *part = lo;\n overflow = hi;\n }\n if working_quotient[3] == 0 && is_all_zero(&working_remainder) {\n quotient_scale += 1;\n quotient[0] = working_quotient[0];\n quotient[1] = working_quotient[1];\n quotient[2] = working_quotient[2];\n } else {\n // Overflow\n return CalculationResult::Overflow;\n }\n }\n\n if quotient_scale > 255 {\n quotient[0] = 0;\n quotient[1] = 0;\n quotient[2] = 0;\n quotient_scale = 0;\n }\n\n let mut quotient_negative = d1.is_sign_negative() ^ d2.is_sign_negative();\n\n // Check for underflow\n let mut final_scale: u32 = quotient_scale as u32;\n if final_scale > MAX_PRECISION_U32 {\n let mut remainder = 0;\n\n // Division underflowed. We must remove some significant digits over using\n // an invalid scale.\n while final_scale > MAX_PRECISION_U32 && !is_all_zero(&quotient) {\n remainder = div_by_u32(&mut quotient, 10);\n final_scale -= 1;\n }\n if final_scale > MAX_PRECISION_U32 {\n // Result underflowed so set to zero\n final_scale = 0;\n quotient_negative = false;\n } else if remainder >= 5 {\n for part in &mut quotient {\n if remainder == 0 {\n break;\n }\n let digit: u64 = u64::from(*part) + 1;\n remainder = if digit > 0xFFFF_FFFF { 1 } else { 0 };\n *part = (digit & 0xFFFF_FFFF) as u32;\n }\n }\n }\n\n CalculationResult::Ok(Decimal::from_parts(\n quotient[0],\n quotient[1],\n quotient[2],\n quotient_negative,\n final_scale,\n ))\n}\n\npub(crate) fn mul_impl(d1: &Decimal, d2: &Decimal) -> CalculationResult {\n // Early exit if either is zero\n if d1.is_zero() || d2.is_zero() {\n return CalculationResult::Ok(Decimal::zero());\n }\n\n // We are only resulting in a negative if we have mismatched signs\n let negative = d1.is_sign_negative() ^ d2.is_sign_negative();\n\n // We get the scale of the result by adding the operands. This may be too big, however\n // we'll correct later\n let mut final_scale = d1.scale() + d2.scale();\n\n // First of all, if ONLY the lo parts of both numbers is filled\n // then we can simply do a standard 64 bit calculation. It's a minor\n // optimization however prevents the need for long form multiplication\n let my = d1.mantissa_array3();\n let ot = d2.mantissa_array3();\n if my[1] == 0 && my[2] == 0 && ot[1] == 0 && ot[2] == 0 {\n // Simply multiplication\n let mut u64_result = u64_to_array(u64::from(my[0]) * u64::from(ot[0]));\n\n // If we're above max precision then this is a very small number\n if final_scale > MAX_PRECISION_U32 {\n final_scale -= MAX_PRECISION_U32;\n\n // If the number is above 19 then this will equate to zero.\n // This is because the max value in 64 bits is 1.84E19\n if final_scale > 19 {\n return CalculationResult::Ok(Decimal::zero());\n }\n\n let mut rem_lo = 0;\n let mut power;\n if final_scale > 9 {\n // Since 10^10 doesn't fit into u32, we divide by 10^10/4\n // and multiply the next divisor by 4.\n rem_lo = div_by_u32(&mut u64_result, 2_500_000_000);\n power = POWERS_10[final_scale as usize - 10] << 2;\n } else {\n power = POWERS_10[final_scale as usize];\n }\n\n // Divide fits in 32 bits\n let rem_hi = div_by_u32(&mut u64_result, power);\n\n // Round the result. Since the divisor is a power of 10\n // we check to see if the remainder is >= 1/2 divisor\n power >>= 1;\n if rem_hi >= power && (rem_hi > power || (rem_lo | (u64_result[0] & 0x1)) != 0) {\n u64_result[0] += 1;\n }\n\n final_scale = MAX_PRECISION_U32;\n }\n return CalculationResult::Ok(Decimal::from_parts(\n u64_result[0],\n u64_result[1],\n 0,\n negative,\n final_scale,\n ));\n }\n\n // We're using some of the high bits, so we essentially perform\n // long form multiplication. We compute the 9 partial products\n // into a 192 bit result array.\n //\n // [my-h][my-m][my-l]\n // x [ot-h][ot-m][ot-l]\n // --------------------------------------\n // 1. [r-hi][r-lo] my-l * ot-l [0, 0]\n // 2. [r-hi][r-lo] my-l * ot-m [0, 1]\n // 3. [r-hi][r-lo] my-m * ot-l [1, 0]\n // 4. [r-hi][r-lo] my-m * ot-m [1, 1]\n // 5. [r-hi][r-lo] my-l * ot-h [0, 2]\n // 6. [r-hi][r-lo] my-h * ot-l [2, 0]\n // 7. [r-hi][r-lo] my-m * ot-h [1, 2]\n // 8. [r-hi][r-lo] my-h * ot-m [2, 1]\n // 9.[r-hi][r-lo] my-h * ot-h [2, 2]\n let mut product = [0u32, 0u32, 0u32, 0u32, 0u32, 0u32];\n\n // We can perform a minor short circuit here. If the\n // high portions are both 0 then we can skip portions 5-9\n let to = if my[2] == 0 && ot[2] == 0 { 2 } else { 3 };\n\n for (my_index, my_item) in my.iter().enumerate().take(to) {\n for (ot_index, ot_item) in ot.iter().enumerate().take(to) {\n let (mut rlo, mut rhi) = mul_part(*my_item, *ot_item, 0);\n\n // Get the index for the lo portion of the product\n for prod in product.iter_mut().skip(my_index + ot_index) {\n let (res, overflow) = add_part(rlo, *prod);\n *prod = res;\n\n // If we have something in rhi from before then promote that\n if rhi > 0 {\n // If we overflowed in the last add, add that with rhi\n if overflow > 0 {\n let (nlo, nhi) = add_part(rhi, overflow);\n rlo = nlo;\n rhi = nhi;\n } else {\n rlo = rhi;\n rhi = 0;\n }\n } else if overflow > 0 {\n rlo = overflow;\n rhi = 0;\n } else {\n break;\n }\n\n // If nothing to do next round then break out\n if rlo == 0 {\n break;\n }\n }\n }\n }\n\n // If our result has used up the high portion of the product\n // then we either have an overflow or an underflow situation\n // Overflow will occur if we can't scale it back, whereas underflow\n // with kick in rounding\n let mut remainder = 0;\n while final_scale > 0 && (product[3] != 0 || product[4] != 0 || product[5] != 0) {\n remainder = div_by_u32(&mut product, 10u32);\n final_scale -= 1;\n }\n\n // Round up the carry if we need to\n if remainder >= 5 {\n for part in product.iter_mut() {\n if remainder == 0 {\n break;\n }\n let digit: u64 = u64::from(*part) + 1;\n remainder = if digit > 0xFFFF_FFFF { 1 } else { 0 };\n *part = (digit & 0xFFFF_FFFF) as u32;\n }\n }\n\n // If we're still above max precision then we'll try again to\n // reduce precision - we may be dealing with a limit of \"0\"\n if final_scale > MAX_PRECISION_U32 {\n // We're in an underflow situation\n // The easiest way to remove precision is to divide off the result\n while final_scale > MAX_PRECISION_U32 && !is_all_zero(&product) {\n div_by_u32(&mut product, 10);\n final_scale -= 1;\n }\n // If we're still at limit then we can't represent any\n // significant decimal digits and will return an integer only\n // Can also be invoked while representing 0.\n if final_scale > MAX_PRECISION_U32 {\n final_scale = 0;\n }\n } else if !(product[3] == 0 && product[4] == 0 && product[5] == 0) {\n // We're in an overflow situation - we're within our precision bounds\n // but still have bits in overflow\n return CalculationResult::Overflow;\n }\n\n CalculationResult::Ok(Decimal::from_parts(\n product[0],\n product[1],\n product[2],\n negative,\n final_scale,\n ))\n}\n\npub(crate) fn rem_impl(d1: &Decimal, d2: &Decimal) -> CalculationResult {\n if d2.is_zero() {\n return CalculationResult::DivByZero;\n }\n if d1.is_zero() {\n return CalculationResult::Ok(Decimal::zero());\n }\n\n // Rescale so comparable\n let initial_scale = d1.scale();\n let mut quotient = d1.mantissa_array3();\n let mut quotient_scale = initial_scale;\n let mut divisor = d2.mantissa_array3();\n let mut divisor_scale = d2.scale();\n rescale_to_maximum_scale(&mut quotient, &mut quotient_scale, &mut divisor, &mut divisor_scale);\n\n // Working is the remainder + the quotient\n // We use an aligned array since we'll be using it a lot.\n let mut working_quotient = [quotient[0], quotient[1], quotient[2], 0u32];\n let mut working_remainder = [0u32, 0u32, 0u32, 0u32];\n div_internal(&mut working_quotient, &mut working_remainder, &divisor);\n\n // Round if necessary. This is for semantic correctness, but could feasibly be removed for\n // performance improvements.\n if quotient_scale > initial_scale {\n let mut working = [\n working_remainder[0],\n working_remainder[1],\n working_remainder[2],\n working_remainder[3],\n ];\n while quotient_scale > initial_scale {\n if div_by_u32(&mut working, 10) > 0 {\n break;\n }\n quotient_scale -= 1;\n working_remainder.copy_from_slice(&working);\n }\n }\n\n CalculationResult::Ok(Decimal::from_parts(\n working_remainder[0],\n working_remainder[1],\n working_remainder[2],\n d1.is_sign_negative(),\n quotient_scale,\n ))\n}\n\npub(crate) fn cmp_impl(d1: &Decimal, d2: &Decimal) -> Ordering {\n // Quick exit if major differences\n if d1.is_zero() && d2.is_zero() {\n return Ordering::Equal;\n }\n let self_negative = d1.is_sign_negative();\n let other_negative = d2.is_sign_negative();\n if self_negative && !other_negative {\n return Ordering::Less;\n } else if !self_negative && other_negative {\n return Ordering::Greater;\n }\n\n // If we have 1.23 and 1.2345 then we have\n // 123 scale 2 and 12345 scale 4\n // We need to convert the first to\n // 12300 scale 4 so we can compare equally\n let left: &Decimal;\n let right: &Decimal;\n if self_negative && other_negative {\n // Both are negative, so reverse cmp\n left = d2;\n right = d1;\n } else {\n left = d1;\n right = d2;\n }\n let mut left_scale = left.scale();\n let mut right_scale = right.scale();\n let mut left_raw = left.mantissa_array3();\n let mut right_raw = right.mantissa_array3();\n\n if left_scale == right_scale {\n // Fast path for same scale\n if left_raw[2] != right_raw[2] {\n return left_raw[2].cmp(&right_raw[2]);\n }\n if left_raw[1] != right_raw[1] {\n return left_raw[1].cmp(&right_raw[1]);\n }\n return left_raw[0].cmp(&right_raw[0]);\n }\n\n // Rescale and compare\n rescale_to_maximum_scale(&mut left_raw, &mut left_scale, &mut right_raw, &mut right_scale);\n cmp_internal(&left_raw, &right_raw)\n}\n\n#[inline]\nfn add_part(left: u32, right: u32) -> (u32, u32) {\n let added = u64::from(left) + u64::from(right);\n ((added & U32_MASK) as u32, (added >> 32 & U32_MASK) as u32)\n}\n\n#[inline(always)]\nfn sub_by_internal3(value: &mut [u32; 3], by: &[u32; 3]) {\n let mut overflow = 0;\n let vl = value.len();\n for i in 0..vl {\n let part = (0x1_0000_0000u64 + u64::from(value[i])) - (u64::from(by[i]) + overflow);\n value[i] = part as u32;\n overflow = 1 - (part >> 32);\n }\n}\n\nfn div_internal(quotient: &mut [u32; 4], remainder: &mut [u32; 4], divisor: &[u32; 3]) {\n // There are a couple of ways to do division on binary numbers:\n // 1. Using long division\n // 2. Using the complement method\n // ref: http://paulmason.me/dividing-binary-numbers-part-2/\n // The complement method basically keeps trying to subtract the\n // divisor until it can't anymore and placing the rest in remainder.\n let mut complement = [\n divisor[0] ^ 0xFFFF_FFFF,\n divisor[1] ^ 0xFFFF_FFFF,\n divisor[2] ^ 0xFFFF_FFFF,\n 0xFFFF_FFFF,\n ];\n\n // Add one onto the complement\n add_one_internal4(&mut complement);\n\n // Make sure the remainder is 0\n remainder.iter_mut().for_each(|x| *x = 0);\n\n // If we have nothing in our hi+ block then shift over till we do\n let mut blocks_to_process = 0;\n while blocks_to_process < 4 && quotient[3] == 0 {\n // memcpy would be useful here\n quotient[3] = quotient[2];\n quotient[2] = quotient[1];\n quotient[1] = quotient[0];\n quotient[0] = 0;\n\n // Increment the counter\n blocks_to_process += 1;\n }\n\n // Let's try and do the addition...\n let mut block = blocks_to_process << 5;\n let mut working = [0u32, 0u32, 0u32, 0u32];\n while block < 128 {\n // << 1 for quotient AND remainder. Moving the carry from the quotient to the bottom of the\n // remainder.\n let carry = shl1_internal(quotient, 0);\n shl1_internal(remainder, carry);\n\n // Copy the remainder of working into sub\n working.copy_from_slice(remainder);\n\n // Add the remainder with the complement\n add_by_internal(&mut working, &complement);\n\n // Check for the significant bit - move over to the quotient\n // as necessary\n if (working[3] & 0x8000_0000) == 0 {\n remainder.copy_from_slice(&working);\n quotient[0] |= 1;\n }\n\n // Increment our pointer\n block += 1;\n }\n}\n\n#[inline]\nfn copy_array_diff_lengths(into: &mut [u32], from: &[u32]) {\n for i in 0..into.len() {\n if i >= from.len() {\n break;\n }\n into[i] = from[i];\n }\n}\n\n#[inline]\nfn add_one_internal4(value: &mut [u32; 4]) -> u32 {\n let mut carry: u64 = 1; // Start with one, since adding one\n let mut sum: u64;\n for i in value.iter_mut() {\n sum = (*i as u64) + carry;\n *i = (sum & U32_MASK) as u32;\n carry = sum >> 32;\n }\n\n carry as u32\n}\n\n#[inline]\nfn add_by_internal3(value: &mut [u32; 3], by: &[u32; 3]) -> u32 {\n let mut carry: u32 = 0;\n let bl = by.len();\n for i in 0..bl {\n let res1 = value[i].overflowing_add(by[i]);\n let res2 = res1.0.overflowing_add(carry);\n value[i] = res2.0;\n carry = (res1.1 | res2.1) as u32;\n }\n carry\n}\n\n#[inline]\nconst fn u64_to_array(value: u64) -> [u32; 2] {\n [(value & U32_MASK) as u32, (value >> 32 & U32_MASK) as u32]\n}\n\nfn add_with_scale_internal(\n quotient: &mut [u32; 3],\n quotient_scale: &mut i32,\n working_quotient: &mut [u32; 4],\n working_scale: &mut i32,\n) -> bool {\n // Add quotient and the working (i.e. quotient = quotient + working)\n if is_all_zero(quotient) {\n // Quotient is zero so we can just copy the working quotient in directly\n // First, make sure they are both 96 bit.\n while working_quotient[3] != 0 {\n div_by_u32(working_quotient, 10);\n *working_scale -= 1;\n }\n copy_array_diff_lengths(quotient, working_quotient);\n *quotient_scale = *working_scale;\n return false;\n }\n\n if is_all_zero(working_quotient) {\n return false;\n }\n\n // We have ensured that our working is not zero so we should do the addition\n\n // If our two quotients are different then\n // try to scale down the one with the bigger scale\n let mut temp3 = [0u32, 0u32, 0u32];\n let mut temp4 = [0u32, 0u32, 0u32, 0u32];\n if *quotient_scale != *working_scale {\n // TODO: Remove necessity for temp (without performance impact)\n fn div_by_10(target: &mut [u32], temp: &mut [u32; N], scale: &mut i32, target_scale: i32) {\n // Copy to the temp array\n temp.copy_from_slice(target);\n // divide by 10 until target scale is reached\n while *scale > target_scale {\n let remainder = div_by_u32(temp, 10);\n if remainder == 0 {\n *scale -= 1;\n target.copy_from_slice(temp);\n } else {\n break;\n }\n }\n }\n\n if *quotient_scale < *working_scale {\n div_by_10(working_quotient, &mut temp4, working_scale, *quotient_scale);\n } else {\n div_by_10(quotient, &mut temp3, quotient_scale, *working_scale);\n }\n }\n\n // If our two quotients are still different then\n // try to scale up the smaller scale\n if *quotient_scale != *working_scale {\n // TODO: Remove necessity for temp (without performance impact)\n fn mul_by_10(target: &mut [u32], temp: &mut [u32], scale: &mut i32, target_scale: i32) {\n temp.copy_from_slice(target);\n let mut overflow = 0;\n // Multiply by 10 until target scale reached or overflow\n while *scale < target_scale && overflow == 0 {\n overflow = mul_by_u32(temp, 10);\n if overflow == 0 {\n // Still no overflow\n *scale += 1;\n target.copy_from_slice(temp);\n }\n }\n }\n\n if *quotient_scale > *working_scale {\n mul_by_10(working_quotient, &mut temp4, working_scale, *quotient_scale);\n } else {\n mul_by_10(quotient, &mut temp3, quotient_scale, *working_scale);\n }\n }\n\n // If our two quotients are still different then\n // try to scale down the one with the bigger scale\n // (ultimately losing significant digits)\n if *quotient_scale != *working_scale {\n // TODO: Remove necessity for temp (without performance impact)\n fn div_by_10_lossy(\n target: &mut [u32],\n temp: &mut [u32; N],\n scale: &mut i32,\n target_scale: i32,\n ) {\n temp.copy_from_slice(target);\n // divide by 10 until target scale is reached\n while *scale > target_scale {\n div_by_u32(temp, 10);\n *scale -= 1;\n target.copy_from_slice(temp);\n }\n }\n if *quotient_scale < *working_scale {\n div_by_10_lossy(working_quotient, &mut temp4, working_scale, *quotient_scale);\n } else {\n div_by_10_lossy(quotient, &mut temp3, quotient_scale, *working_scale);\n }\n }\n\n // If quotient or working are zero we have an underflow condition\n if is_all_zero(quotient) || is_all_zero(working_quotient) {\n // Underflow\n return true;\n } else {\n // Both numbers have the same scale and can be added.\n // We just need to know whether we can fit them in\n let mut underflow = false;\n let mut temp = [0u32, 0u32, 0u32];\n while !underflow {\n temp.copy_from_slice(quotient);\n\n // Add the working quotient\n let overflow = add_by_internal(&mut temp, working_quotient);\n if overflow == 0 {\n // addition was successful\n quotient.copy_from_slice(&temp);\n break;\n } else {\n // addition overflowed - remove significant digits and try again\n div_by_u32(quotient, 10);\n *quotient_scale -= 1;\n div_by_u32(working_quotient, 10);\n *working_scale -= 1;\n // Check for underflow\n underflow = is_all_zero(quotient) || is_all_zero(working_quotient);\n }\n }\n if underflow {\n return true;\n }\n }\n false\n}\n\n/// Rescales the given decimals to equivalent scales.\n/// It will firstly try to scale both the left and the right side to\n/// the maximum scale of left/right. If it is unable to do that it\n/// will try to reduce the accuracy of the other argument.\n/// e.g. with 1.23 and 2.345 it'll rescale the first arg to 1.230\n#[inline(always)]\nfn rescale_to_maximum_scale(left: &mut [u32; 3], left_scale: &mut u32, right: &mut [u32; 3], right_scale: &mut u32) {\n if left_scale == right_scale {\n // Nothing to do\n return;\n }\n\n if is_all_zero(left) {\n *left_scale = *right_scale;\n return;\n } else if is_all_zero(right) {\n *right_scale = *left_scale;\n return;\n }\n\n if left_scale > right_scale {\n rescale_internal(right, right_scale, *left_scale);\n if right_scale != left_scale {\n rescale_internal(left, left_scale, *right_scale);\n }\n } else {\n rescale_internal(left, left_scale, *right_scale);\n if right_scale != left_scale {\n rescale_internal(right, right_scale, *left_scale);\n }\n }\n}\n\n#[cfg(test)]\nmod test {\n // Tests on private methods.\n //\n // All public tests should go under `tests/`.\n\n use super::*;\n use crate::prelude::*;\n\n #[test]\n fn it_can_rescale_to_maximum_scale() {\n fn extract(value: &str) -> ([u32; 3], u32) {\n let v = Decimal::from_str(value).unwrap();\n (v.mantissa_array3(), v.scale())\n }\n\n let tests = &[\n (\"1\", \"1\", \"1\", \"1\"),\n (\"1\", \"1.0\", \"1.0\", \"1.0\"),\n (\"1\", \"1.00000\", \"1.00000\", \"1.00000\"),\n (\"1\", \"1.0000000000\", \"1.0000000000\", \"1.0000000000\"),\n (\n \"1\",\n \"1.00000000000000000000\",\n \"1.00000000000000000000\",\n \"1.00000000000000000000\",\n ),\n (\"1.1\", \"1.1\", \"1.1\", \"1.1\"),\n (\"1.1\", \"1.10000\", \"1.10000\", \"1.10000\"),\n (\"1.1\", \"1.1000000000\", \"1.1000000000\", \"1.1000000000\"),\n (\n \"1.1\",\n \"1.10000000000000000000\",\n \"1.10000000000000000000\",\n \"1.10000000000000000000\",\n ),\n (\n \"0.6386554621848739495798319328\",\n \"11.815126050420168067226890757\",\n \"0.638655462184873949579831933\",\n \"11.815126050420168067226890757\",\n ),\n (\n \"0.0872727272727272727272727272\", // Scale 28\n \"843.65000000\", // Scale 8\n \"0.0872727272727272727272727\", // 25\n \"843.6500000000000000000000000\", // 25\n ),\n ];\n\n for &(left_raw, right_raw, expected_left, expected_right) in tests {\n // Left = the value to rescale\n // Right = the new scale we're scaling to\n // Expected = the expected left value after rescale\n let (expected_left, expected_lscale) = extract(expected_left);\n let (expected_right, expected_rscale) = extract(expected_right);\n\n let (mut left, mut left_scale) = extract(left_raw);\n let (mut right, mut right_scale) = extract(right_raw);\n rescale_to_maximum_scale(&mut left, &mut left_scale, &mut right, &mut right_scale);\n assert_eq!(left, expected_left);\n assert_eq!(left_scale, expected_lscale);\n assert_eq!(right, expected_right);\n assert_eq!(right_scale, expected_rscale);\n\n // Also test the transitive case\n let (mut left, mut left_scale) = extract(left_raw);\n let (mut right, mut right_scale) = extract(right_raw);\n rescale_to_maximum_scale(&mut right, &mut right_scale, &mut left, &mut left_scale);\n assert_eq!(left, expected_left);\n assert_eq!(left_scale, expected_lscale);\n assert_eq!(right, expected_right);\n assert_eq!(right_scale, expected_rscale);\n }\n }\n}\n"}}},{"rowIdx":968,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a Ruby program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid Ruby code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical Ruby concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., metaprogramming, blocks). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching Ruby. It should be similar to a school exercise, a tutorial, or a Ruby course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching Ruby. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\nrequire 'test_helper'\n\nclass EntregaHelperTest < ActionView::TestCase\nend\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"ruby"},"label":{"kind":"number","value":2,"string":"2"},"text":{"kind":"string","value":"require 'test_helper'\n\nclass EntregaHelperTest < ActionView::TestCase\nend\n"}}},{"rowIdx":969,"cells":{"prompt":{"kind":"string","value":"Below is an extract of SQL code. Evaluate whether it has a high educational value and could help teach SQL and database concepts. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the code contains valid SQL syntax, even if it's just basic queries or simple table operations.\n- Add another point if the code addresses practical SQL concepts (e.g., JOINs, subqueries), even if it lacks comments.\n- Award a third point if the code is suitable for educational use and introduces key concepts in SQL and database management, even if the topic is somewhat advanced (e.g., indexes, transactions). The code should be well-structured and contain some comments.\n- Give a fourth point if the code is self-contained and highly relevant to teaching SQL. It should be similar to a database course exercise, demonstrating good practices in query writing and database design.\n- Grant a fifth point if the code is outstanding in its educational value and is perfectly suited for teaching SQL and database concepts. It should be well-written, easy to understand, and contain explanatory comments that clarify the purpose and impact of each part of the code.\n\nThe extract:\n-- phpMyAdmin SQL Dump\n-- version 4.2.11\n-- http://www.phpmyadmin.net\n--\n-- Host: localhost\n-- Generation Time: Oct 11, 2015 at 06:51 PM\n-- Server version: 5.6.21\n-- PHP Version: 5.6.3\n\nSET SQL_MODE = \"NO_AUTO_VALUE_ON_ZERO\";\nSET time_zone = \"+00:00\";\n\n\n/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;\n/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;\n/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;\n/*!40101 SET NAMES utf8 */;\n\n--\n-- Database: `kudus_green_park`\n--\n\n-- --------------------------------------------------------\n\n--\n-- Table structure for table `m_info_rth`\n--\n\nCREATE TABLE IF NOT EXISTS `m_info_rth` (\n `id_rth` varchar(20) NOT NULL,\n `kecamatan` varchar(10) NOT NULL,\n `desa` varchar(10) NOT NULL,\n `status_lahan` int(10) NOT NULL,\n `jenis` int(10) NOT NULL,\n `luas` varchar(150) NOT NULL,\n `jenis_tanaman` varchar(200) NOT NULL,\n `fungsi` text NOT NULL,\n `detail_peta` varchar(100) NOT NULL,\n `pengelola` varchar(100) NOT NULL,\n `nama` varchar(100) DEFAULT NULL,\n `alamat` varchar(300) DEFAULT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=utf8;\n\n--\n-- Dumping data for table `m_info_rth`\n--\n\nINSERT INTO `m_info_rth` (`id_rth`, `kecamatan`, `desa`, `status_lahan`, `jenis`, `luas`, `jenis_tanaman`, `fungsi`, `detail_peta`, `pengelola`, `nama`, `alamat`) VALUES\n('12333', '1', '1', 1, 1, '3888', 'rumput', 'tongkrongan', '', 'pemerintah', 'alun alun', 'depan ramayana');\n\n-- --------------------------------------------------------\n\n--\n-- Table structure for table `m_photo`\n--\n\nCREATE TABLE IF NOT EXISTS `m_photo` (\n`idphoto` int(11) NOT NULL,\n `id_rth` varchar(20) NOT NULL,\n `fileName` varchar(100) NOT NULL,\n `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP\n) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8;\n\n--\n-- Dumping data for table `m_photo`\n--\n\nINSERT INTO `m_photo` (`idphoto`, `id_rth`, `fileName`, `time`) VALUES\n(38, '12333', '1444577139_2lNw63dGIkW9.JPG', '2015-10-\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"sql"},"label":{"kind":"number","value":3,"string":"3"},"text":{"kind":"string","value":"-- phpMyAdmin SQL Dump\n-- version 4.2.11\n-- http://www.phpmyadmin.net\n--\n-- Host: localhost\n-- Generation Time: Oct 11, 2015 at 06:51 PM\n-- Server version: 5.6.21\n-- PHP Version: 5.6.3\n\nSET SQL_MODE = \"NO_AUTO_VALUE_ON_ZERO\";\nSET time_zone = \"+00:00\";\n\n\n/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;\n/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;\n/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;\n/*!40101 SET NAMES utf8 */;\n\n--\n-- Database: `kudus_green_park`\n--\n\n-- --------------------------------------------------------\n\n--\n-- Table structure for table `m_info_rth`\n--\n\nCREATE TABLE IF NOT EXISTS `m_info_rth` (\n `id_rth` varchar(20) NOT NULL,\n `kecamatan` varchar(10) NOT NULL,\n `desa` varchar(10) NOT NULL,\n `status_lahan` int(10) NOT NULL,\n `jenis` int(10) NOT NULL,\n `luas` varchar(150) NOT NULL,\n `jenis_tanaman` varchar(200) NOT NULL,\n `fungsi` text NOT NULL,\n `detail_peta` varchar(100) NOT NULL,\n `pengelola` varchar(100) NOT NULL,\n `nama` varchar(100) DEFAULT NULL,\n `alamat` varchar(300) DEFAULT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=utf8;\n\n--\n-- Dumping data for table `m_info_rth`\n--\n\nINSERT INTO `m_info_rth` (`id_rth`, `kecamatan`, `desa`, `status_lahan`, `jenis`, `luas`, `jenis_tanaman`, `fungsi`, `detail_peta`, `pengelola`, `nama`, `alamat`) VALUES\n('12333', '1', '1', 1, 1, '3888', 'rumput', 'tongkrongan', '', 'pemerintah', 'alun alun', 'depan ramayana');\n\n-- --------------------------------------------------------\n\n--\n-- Table structure for table `m_photo`\n--\n\nCREATE TABLE IF NOT EXISTS `m_photo` (\n`idphoto` int(11) NOT NULL,\n `id_rth` varchar(20) NOT NULL,\n `fileName` varchar(100) NOT NULL,\n `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP\n) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8;\n\n--\n-- Dumping data for table `m_photo`\n--\n\nINSERT INTO `m_photo` (`idphoto`, `id_rth`, `fileName`, `time`) VALUES\n(38, '12333', '1444577139_2lNw63dGIkW9.JPG', '2015-10-11 15:25:41'),\n(39, '12333', '1444577140_dVzLfxoRoKU3.JPG', '2015-10-11 15:25:41');\n\n-- --------------------------------------------------------\n\n--\n-- Table structure for table `m_testimoni`\n--\n\nCREATE TABLE IF NOT EXISTS `m_testimoni` (\n `id` int(5) NOT NULL,\n `nama` varchar(30) NOT NULL,\n `judul` varchar(30) NOT NULL,\n `isi` varchar(200) NOT NULL,\n `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,\n `updated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'\n) ENGINE=InnoDB DEFAULT CHARSET=latin1;\n\n-- --------------------------------------------------------\n\n--\n-- Table structure for table `s_bentuk`\n--\n\nCREATE TABLE IF NOT EXISTS `s_bentuk` (\n `id` int(10) NOT NULL,\n `bentuk` varchar(50) NOT NULL,\n `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,\n `updated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'\n) ENGINE=InnoDB DEFAULT CHARSET=latin1;\n\n-- --------------------------------------------------------\n\n--\n-- Table structure for table `s_desa`\n--\n\nCREATE TABLE IF NOT EXISTS `s_desa` (\n `id` varchar(20) NOT NULL,\n `id_kecamatan` varchar(10) NOT NULL,\n `nama` varchar(30) NOT NULL,\n `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,\n `updated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'\n) ENGINE=InnoDB DEFAULT CHARSET=latin1;\n\n--\n-- Dumping data for table `s_desa`\n--\n\nINSERT INTO `s_desa` (`id`, `id_kecamatan`, `nama`, `created`, `updated`) VALUES\n('1', '1', '', '2015-10-11 07:48:03', '0000-00-00 00:00:00'),\n('2', '1', 'Janggalan', '2015-10-11 07:48:03', '0000-00-00 00:00:00'),\n('3', '1', 'Demangan', '2015-10-11 07:48:03', '0000-00-00 00:00:00'),\n('4', '2', 'Getaspejaten', '2015-10-11 07:49:39', '0000-00-00 00:00:00'),\n('5', '2', 'Jati Kulon', '2015-10-11 07:49:39', '0000-00-00 00:00:00'),\n('6', '3', 'Wonosoco', '2015-10-11 07:50:23', '0000-00-00 00:00:00'),\n('7', '3', 'Lambangan', '2015-10-11 07:50:23', '0000-00-00 00:00:00');\n\n-- --------------------------------------------------------\n\n--\n-- Table structure for table `s_jenis_rth`\n--\n\nCREATE TABLE IF NOT EXISTS `s_jenis_rth` (\n `id` varchar(10) NOT NULL,\n `jenis` varchar(50) NOT NULL,\n `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,\n `updated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'\n) ENGINE=InnoDB DEFAULT CHARSET=latin1;\n\n-- --------------------------------------------------------\n\n--\n-- Table structure for table `s_kecamatan`\n--\n\nCREATE TABLE IF NOT EXISTS `s_kecamatan` (\n `id` varchar(10) NOT NULL,\n `nama` varchar(30) NOT NULL,\n `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,\n `updated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'\n) ENGINE=InnoDB DEFAULT CHARSET=latin1;\n\n--\n-- Dumping data for table `s_kecamatan`\n--\n\nINSERT INTO `s_kecamatan` (`id`, `nama`, `created`, `updated`) VALUES\n('1', 'Kota', '2015-10-11 07:46:51', '0000-00-00 00:00:00'),\n('2', 'Undaan', '2015-10-11 07:46:51', '0000-00-00 00:00:00'),\n('3', 'Demangan', '2015-10-11 07:46:51', '0000-00-00 00:00:00'),\n('4', 'Bae', '2015-10-11 07:46:51', '0000-00-00 00:00:00'),\n('5', 'Gebog', '2015-10-11 07:46:51', '0000-00-00 00:00:00');\n\n-- --------------------------------------------------------\n\n--\n-- Table structure for table `s_status_lahan`\n--\n\nCREATE TABLE IF NOT EXISTS `s_status_lahan` (\n `id` int(5) NOT NULL,\n `status` varchar(30) NOT NULL,\n `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,\n `updated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'\n) ENGINE=InnoDB DEFAULT CHARSET=latin1;\n\n-- --------------------------------------------------------\n\n--\n-- Table structure for table `s_user`\n--\n\nCREATE TABLE IF NOT EXISTS `s_user` (\n`iduser` int(11) NOT NULL,\n `nama_lengkap` varchar(60) NOT NULL,\n `username` varchar(45) DEFAULT NULL,\n `password` varchar(100) DEFAULT NULL,\n `role` varchar(20) DEFAULT NULL\n) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8;\n\n--\n-- Dumping data for table `s_user`\n--\n\nINSERT INTO `s_user` (`iduser`, `nama_lengkap`, `username`, `password`, `role`) VALUES\n(20, 'test', 'ananana', ', NULL),\n(23, 'valentino', 'valent', '$2y$10$0RtZED7Dfu/EDRwAm4T1bOZvt9XKTTotzyJveT3fpfA7HYnqnrH/e', NULL);\n\n--\n-- Indexes for dumped tables\n--\n\n--\n-- Indexes for table `m_info_rth`\n--\nALTER TABLE `m_info_rth`\n ADD PRIMARY KEY (`id_rth`);\n\n--\n-- Indexes for table `m_photo`\n--\nALTER TABLE `m_photo`\n ADD PRIMARY KEY (`idphoto`);\n\n--\n-- Indexes for table `s_desa`\n--\nALTER TABLE `s_desa`\n ADD PRIMARY KEY (`id`);\n\n--\n-- Indexes for table `s_user`\n--\nALTER TABLE `s_user`\n ADD PRIMARY KEY (`iduser`);\n\n--\n-- AUTO_INCREMENT for dumped tables\n--\n\n--\n-- AUTO_INCREMENT for table `m_photo`\n--\nALTER TABLE `m_photo`\nMODIFY `idphoto` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=40;\n--\n-- AUTO_INCREMENT for table `s_user`\n--\nALTER TABLE `s_user`\nMODIFY `iduser` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=24;\n/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;\n/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;\n/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;\n"}}},{"rowIdx":970,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a Markdown document. Evaluate its educational value, considering both Markdown usage and the content itself. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the document uses basic Markdown syntax correctly (e.g., headers, lists, or emphasis), regardless of content.\n- Add another point if the document's content has some educational value, even if it's basic or limited in scope. The Markdown usage should be correct but might not be diverse.\n- Award a third point if the document demonstrates a good range of Markdown features (e.g., links, images, code blocks) AND the content provides clear, accurate information on a topic. The structure should be logical and easy to follow.\n- Give a fourth point if the document is well-suited for teaching both its subject matter and effective Markdown usage. It should use varied Markdown elements to enhance the presentation of educational content, similar to a well-crafted tutorial or lesson.\n- Grant a fifth point if the document is exceptional both in its use of Markdown and the educational value of its content. It should demonstrate advanced Markdown features (e.g., tables, task lists, footnotes), have an engaging structure, and provide comprehensive, high-quality educational content on its topic. The document should serve as an excellent example of using Markdown for educational purposes.\n\nThe extract:\nArticle 199\n----\nSi les époux ou l'un d'eux sont décédés sans avoir découvert la fraude, l'action\ncriminelle peut être intentée par tous ceux qui ont intérêt de faire déclarer le\nmariage valable, et par le procureur de la République.\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"markdown"},"label":{"kind":"number","value":2,"string":"2"},"text":{"kind":"string","value":"Article 199\n----\nSi les époux ou l'un d'eux sont décédés sans avoir découvert la fraude, l'action\ncriminelle peut être intentée par tous ceux qui ont intérêt de faire déclarer le\nmariage valable, et par le procureur de la République.\n"}}},{"rowIdx":971,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a Kotlin program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid Kotlin code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical Kotlin concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., coroutines, extension functions). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching Kotlin. It should be similar to a school exercise, a tutorial, or a Kotlin course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching Kotlin. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\npackage com.wtm.dgomez.qa\n\nimport graphql.kickstart.tools.GraphQLQueryResolver\nimport org.springframework.stereotype.Component\n\n@Component\nclass QaQuery(private val repository: QaRepository): GraphQLQueryResolver {\n\n fun getRecentQa(): List {\n return repository.findAll()\n }\n}\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"kotlin"},"label":{"kind":"number","value":3,"string":"3"},"text":{"kind":"string","value":"package com.wtm.dgomez.qa\n\nimport graphql.kickstart.tools.GraphQLQueryResolver\nimport org.springframework.stereotype.Component\n\n@Component\nclass QaQuery(private val repository: QaRepository): GraphQLQueryResolver {\n\n fun getRecentQa(): List {\n return repository.findAll()\n }\n}"}}},{"rowIdx":972,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a Rust program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid Rust code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical Rust concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., ownership, lifetimes). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching Rust. It should be similar to a school exercise, a tutorial, or a Rust course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching Rust. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\npub fn raindrops(n: usize) -> String {\r\n let factor_mappers = [\r\n (3, \"i\"), (5, \"a\"), (7, \"o\")\r\n ];\r\n\r\n let string_number = factor_mappers\r\n .iter()\r\n .map(|&(x, y)| {\r\n if n % x == 0 {\r\n format!(\"Pl{}ng\", y.to_string())\r\n } else {\r\n \"\".to_string()\r\n }\r\n })\r\n .collect::>()\r\n .join(\"\");\r\n\r\n if string_number.is_empty() {\r\n n.to_string()\r\n } else {\r\n string_number\r\n }\r\n}\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"rust"},"label":{"kind":"number","value":3,"string":"3"},"text":{"kind":"string","value":"pub fn raindrops(n: usize) -> String {\r\n let factor_mappers = [\r\n (3, \"i\"), (5, \"a\"), (7, \"o\")\r\n ];\r\n\r\n let string_number = factor_mappers\r\n .iter()\r\n .map(|&(x, y)| {\r\n if n % x == 0 {\r\n format!(\"Pl{}ng\", y.to_string())\r\n } else {\r\n \"\".to_string()\r\n }\r\n })\r\n .collect::>()\r\n .join(\"\");\r\n\r\n if string_number.is_empty() {\r\n n.to_string()\r\n } else {\r\n string_number\r\n }\r\n}\r\n"}}},{"rowIdx":973,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a JavaScript program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid JavaScript code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical JavaScript concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., asynchronous programming). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching JavaScript. It should be similar to a school exercise, a tutorial, or a JavaScript course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching JavaScript. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\nconst mrGreen = {\n firstName: \"Jacob\",\n lastName: \"Green\",\n color: \"green\",\n nameCol: \"beige\",\n description: \"He has a lot of connections\",\n age: 45,\n image: \"assets/green.png\",\n occupation: \"Entrepreneur\"\n}\n\nconst profPlum = {\n firstName: \"Victor\",\n lastName: \"Plum\",\n color: \"purple\",\n nameCol: \"beige\",\n description: \"With his good looks and charm he has found a dark side being sneaky.\",\n age: 36,\n image: \"assets/plum.png\",\n occupation: \"Professor\"\n}\n\nconst missScarlet = {\n firstName: \"Cassandra\",\n lastName: \"Scarlet\",\n color: \"red\",\n nameCol: \"beige\",\n description: \"A movie star who will do anything to stay in the spotlight\",\n age: 25,\n image: \"scarlett.png\",\n occupation: \"Actress\"\n}\n\nconst mrsPeacock = {\n firstName: \"Eleanor\",\n lastName: \"Peacock\",\n color: \"blue\",\n nameCol: \"beige\",\n description: \"Despite her innocent looks, she is a formidable politician.\",\n age: 52,\n image: \"assets/peacock.png\",\n occupation: \"Socialite\"\n}\n\nconst mrMustard = {\n firstName: \"Jack\",\n lastName: \"Mustard\",\n color: \"orange\",\n nameCol: \"beige\",\n description: \"An expert in weapons and conspiracy\",\n age: 58,\n image: \"assets/mustard.png\",\n occupation: \"Colonel\"\n}\n\nconst mrsWhite = {\n firstName: \"Mrs\",\n lastName: \"White\",\n color: \"white\",\n nameCol: \"beige\",\n description: \"Claiming to have loved her employer, but is no longer happy in her work\",\n age: 62,\n image: \"assets/white.png\",\n occupation: \"Housekeeper\"\n};\n\nconst rope = {\n name: \"rope\",\n image: \"assets/rope.png\"\n}\n\nconst knife = {\n name: \"knife\",\n image: \"assets/knife.png\"\n}\n\nconst candleStick = {\n name: \"candlestick\",\n image: \"assets/candlestick.png\"\n}\n\nconst dumbBell = {\n name: \"dumbbell\",\n image: \"assets/dumbbell.png\"\n}\n\nconst poison = {\n name: \"drop of poison\",\n image: \"assets/poison.png\"\n}\n\nconst axe = {\n name: \"axe\",\n image: \"assets/axe.png\"\n}\n\nconst bat = {\n name: \"bat\",\n image: \"assets/bat.png\"\n}\n\nconst trophy = {\n name: \"trophy\",\n image: \"assets/trophy.png\"\n}\n\nco\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"javascript"},"label":{"kind":"number","value":2,"string":"2"},"text":{"kind":"string","value":"const mrGreen = {\n firstName: \"Jacob\",\n lastName: \"Green\",\n color: \"green\",\n nameCol: \"beige\",\n description: \"He has a lot of connections\",\n age: 45,\n image: \"assets/green.png\",\n occupation: \"Entrepreneur\"\n}\n\nconst profPlum = {\n firstName: \"Victor\",\n lastName: \"Plum\",\n color: \"purple\",\n nameCol: \"beige\",\n description: \"With his good looks and charm he has found a dark side being sneaky.\",\n age: 36,\n image: \"assets/plum.png\",\n occupation: \"Professor\"\n}\n\nconst missScarlet = {\n firstName: \"Cassandra\",\n lastName: \"Scarlet\",\n color: \"red\",\n nameCol: \"beige\",\n description: \"A movie star who will do anything to stay in the spotlight\",\n age: 25,\n image: \"scarlett.png\",\n occupation: \"Actress\"\n}\n\nconst mrsPeacock = {\n firstName: \"Eleanor\",\n lastName: \"Peacock\",\n color: \"blue\",\n nameCol: \"beige\",\n description: \"Despite her innocent looks, she is a formidable politician.\",\n age: 52,\n image: \"assets/peacock.png\",\n occupation: \"Socialite\"\n}\n\nconst mrMustard = {\n firstName: \"Jack\",\n lastName: \"Mustard\",\n color: \"orange\",\n nameCol: \"beige\",\n description: \"An expert in weapons and conspiracy\",\n age: 58,\n image: \"assets/mustard.png\",\n occupation: \"Colonel\"\n}\n\nconst mrsWhite = {\n firstName: \"Mrs\",\n lastName: \"White\",\n color: \"white\",\n nameCol: \"beige\",\n description: \"Claiming to have loved her employer, but is no longer happy in her work\",\n age: 62,\n image: \"assets/white.png\",\n occupation: \"Housekeeper\"\n};\n\nconst rope = {\n name: \"rope\",\n image: \"assets/rope.png\"\n}\n\nconst knife = {\n name: \"knife\",\n image: \"assets/knife.png\"\n}\n\nconst candleStick = {\n name: \"candlestick\",\n image: \"assets/candlestick.png\"\n}\n\nconst dumbBell = {\n name: \"dumbbell\",\n image: \"assets/dumbbell.png\"\n}\n\nconst poison = {\n name: \"drop of poison\",\n image: \"assets/poison.png\"\n}\n\nconst axe = {\n name: \"axe\",\n image: \"assets/axe.png\"\n}\n\nconst bat = {\n name: \"bat\",\n image: \"assets/bat.png\"\n}\n\nconst trophy = {\n name: \"trophy\",\n image: \"assets/trophy.png\"\n}\n\nconst pistol = {\n name: \"pistol\",\n image: \"assets/pistol.png\"\n};\n\n\nconst diningRoom = {\n name: \"dining room\",\n image: \"assets/diningroom.png\"\n}\n\nconst conservatory = {\n name: \"conservatory\",\n image: \"assets/conservatory.png\"\n}\n\nconst kitchen = {\n name: \"kitchen\",\n image: \"assets/kitchen.png\"\n}\n\nconst library = {\n name: \"library\",\n image: \"assets/Library.png\"\n}\n\nconst billiardRoom = {\n name: \"billiard room\",\n image: \"assets/billiardRoom.png\"\n}\n\nconst ballRoom = {\n name: \"ballroom\",\n image: \"assets/ballroom.png\"\n}\n\nconst hall = {\n name: \"hall\",\n image: \"assets/hall.png\"\n}\n\nconst spa = {\n name: \"spa\",\n image: \"assets/spa.png\"\n}\n\nconst livingRoom = {\n name: \"livingroom\",\n image: \"assets/livingroom.png\"\n};\n\n\nconst suspects = [\n mrGreen,\n profPlum,\n missScarlet,\n mrsPeacock,\n mrMustard,\n mrsWhite\n];\n\n\nconst weapons = [\n rope,\n knife,\n candleStick,\n dumbBell,\n poison,\n axe,\n bat,\n trophy,\n pistol\n];\n\nconst rooms = [\n diningRoom,\n conservatory,\n kitchen,\n library,\n billiardRoom,\n ballRoom,\n hall,\n spa,\n livingRoom\n];\n\nconst randomSelector = array => {\n return array[Math.floor(Math.random() * array.length)]\n};\n\n\nconst mystery = {\n}\n\n\nconst pickKiller = () => {\n\n mystery.killer = randomSelector(suspects);\n\n const theKiller = document.getElementById(\"killer\")\n const theKillerImage = document.getElementById(\"killerImage\")\n const theKillerTitel = document.getElementById(\"killerTitel\")\n const theKillerName = document.getElementById(\"killerName\")\n const theKillerAge = document.getElementById(\"killerAge\")\n const theKillerOccupation = document.getElementById(\"killerOccupation\")\n const theKillerDescription = document.getElementById(\"killerDescription\")\n\n theKiller.style.background = \"beige\"\n theKillerTitel.style.background = mystery.killer.color\n theKillerName.style.background = mystery.killer.color\n theKillerAge.style.background = mystery.killer.color\n theKillerOccupation.style.background = mystery.killer.nameCol\n theKillerDescription.style.background = mystery.killer.nameCol\n theKillerImage.setAttribute(\"src\", mystery.killer.image)\n\n theKillerName.innerHTML =\n mystery.killer.firstName + \" \" + mystery.killer.lastName + \",\"\n\n theKillerAge.innerHTML =\n mystery.killer.age\n\n theKillerOccupation.innerHTML =\n mystery.killer.occupation\n\n theKillerDescription.innerHTML =\n mystery.killer.description\n}\n\nconst pickWeapon = () => {\n mystery.weapon = randomSelector(weapons);\n\n const theWeapon = document.getElementById(\"weapon\")\n const theWeaponHolder = document.getElementById(\"weaponHolder\")\n const theWeaponName = document.getElementById(\"weaponName\")\n const theWeaponImage = document.getElementById(\"weaponImage\")\n\n theWeapon.style.background = \"beige\"\n theWeaponHolder.style.background = \"silver\"\n theWeaponName.style.background = \"silver\"\n theWeaponImage.setAttribute(\"src\", mystery.weapon.image)\n theWeaponName.innerHTML =\n mystery.weapon.name\n}\n\nconst pickRoom = () => {\n\n mystery.room = randomSelector(rooms);\n const theRoom = document.getElementById(\"room\")\n const theRoomHolder = document.getElementById(\"roomHolder\")\n const theRoomName = document.getElementById(\"roomName\")\n const theRoomImage = document.getElementById(\"roomImage\")\n\n theRoom.style.background = \"beige\"\n theRoomHolder.style.background = \"silver\"\n theRoomName.style.background = \"silver\"\n theRoomImage.setAttribute(\"src\", mystery.room.image)\n theRoomName.innerHTML =\n mystery.room.name\n}\n\n\nconst revealMystery = () => {\n let theTruth = document.getElementById(\"mystery\")\n\n if (mystery.killer && mystery.weapon && mystery.room) {\n theTruth.innerHTML =\n `The murder was committed by ${mystery.killer.firstName} ${mystery.killer.lastName}, in the ${mystery.room.name} with a ${mystery.weapon.name}.`\n }\n else {\n theTruth.innerHTML =\n `No mystery is yet to be revealed`\n }\n}\n"}}},{"rowIdx":974,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a Markdown document. Evaluate its educational value, considering both Markdown usage and the content itself. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the document uses basic Markdown syntax correctly (e.g., headers, lists, or emphasis), regardless of content.\n- Add another point if the document's content has some educational value, even if it's basic or limited in scope. The Markdown usage should be correct but might not be diverse.\n- Award a third point if the document demonstrates a good range of Markdown features (e.g., links, images, code blocks) AND the content provides clear, accurate information on a topic. The structure should be logical and easy to follow.\n- Give a fourth point if the document is well-suited for teaching both its subject matter and effective Markdown usage. It should use varied Markdown elements to enhance the presentation of educational content, similar to a well-crafted tutorial or lesson.\n- Grant a fifth point if the document is exceptional both in its use of Markdown and the educational value of its content. It should demonstrate advanced Markdown features (e.g., tables, task lists, footnotes), have an engaging structure, and provide comprehensive, high-quality educational content on its topic. The document should serve as an excellent example of using Markdown for educational purposes.\n\nThe extract:\nLeaflet.TextPath\n================\n\nShows a text along a Polyline.\n\nCheck out the [demo](http://makinacorpus.github.com/Leaflet.TextPath/) !\n\nUsage\n-----\n\nFor example, show path orientation on mouse over :\n\n```\n var layer = L.polyLine(...);\n \n layer.on('mouseover', function () {\n this.setText(' ► ', {repeat: true, attributes: {fill: 'red'}});\n });\n\n layer.on('mouseout', function () {\n this.setText(null);\n });\n```\n\nScreenshot\n----------\n\n![screenshot](https://raw.github.com/makinacorpus/Leaflet.TextPath/master/screenshot.png)\n\nCredits\n-------\n\nThe main idea comes from 's *[Getting serious about SVG](http://mapbox.com/osmdev/2012/11/20/getting-serious-about-svg/)*\n\nAuthors\n-------\n\n[![Makina Corpus](http://depot.makina-corpus.org/public/logo.gif)](http://makinacorpus.com)\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"markdown"},"label":{"kind":"number","value":4,"string":"4"},"text":{"kind":"string","value":"Leaflet.TextPath\n================\n\nShows a text along a Polyline.\n\nCheck out the [demo](http://makinacorpus.github.com/Leaflet.TextPath/) !\n\nUsage\n-----\n\nFor example, show path orientation on mouse over :\n\n```\n var layer = L.polyLine(...);\n \n layer.on('mouseover', function () {\n this.setText(' ► ', {repeat: true, attributes: {fill: 'red'}});\n });\n\n layer.on('mouseout', function () {\n this.setText(null);\n });\n```\n\nScreenshot\n----------\n\n![screenshot](https://raw.github.com/makinacorpus/Leaflet.TextPath/master/screenshot.png)\n\nCredits\n-------\n\nThe main idea comes from 's *[Getting serious about SVG](http://mapbox.com/osmdev/2012/11/20/getting-serious-about-svg/)*\n\nAuthors\n-------\n\n[![Makina Corpus](http://depot.makina-corpus.org/public/logo.gif)](http://makinacorpus.com)\n"}}},{"rowIdx":975,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a Swift program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid Swift code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical Swift concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., protocols, extensions). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching Swift. It should be similar to a school exercise, a tutorial, or a Swift course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching Swift. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\n//\n// GREditProfileViewController.swift\n// Grocerest\n//\n// Created by on 19/02/16.\n// Copyright © 2016 grocerest. All rights reserved.\n//\n\nimport Foundation\nimport UIKit\nimport SwiftyJSON\nimport Haneke\nimport RealmSwift\nimport SwiftLoader\nimport AVFoundation\nimport MobileCoreServices\n\nclass GREditProfileViewController: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate {\n \n let realm = try! Realm()\n var userData: JSON? {\n didSet {\n self.managedView.userData = self.userData\n self.setupCallbacks()\n }\n }\n var userCategories = [String]()\n var currentImage:UIImage = UIImage()\n \n var delegate : GRProfileUpdateProtocol?\n \n override var prefersStatusBarHidden : Bool {\n return false\n }\n \n override var preferredStatusBarStyle : UIStatusBarStyle {\n return .default\n }\n \n fileprivate var managedView: GREditProfileView {\n return self.view as! GREditProfileView\n }\n \n override func loadView() {\n super.loadView()\n view = GREditProfileView()\n managedView.delegate = self\n }\n \n override func viewDidLoad() {\n super.viewDidLoad()\n getUserData()\n self.setupCallbacks()\n }\n \n override func viewDidAppear(_ animated: Bool) {\n super.viewDidAppear(animated)\n userCategories.removeAll()\n }\n \n func setupViews() {\n //. 0 Image\n let type = AvatarType.cells\n managedView.profileImageView.setUserProfileAvatar(GRUser.sharedInstance.picture!, name: GRUser.sharedInstance.firstname!, lastName: GRUser.sharedInstance.lastname!, type: type)\n\n }\n \n func closeButtonWasPressed(_ sender:UIButton){\n self.dismiss(animated: true, completion: { () -> Void in\n self.delegate?.formatUserProfile()\n })\n }\n \n func getUserData() {\n GrocerestAPI.getUser(GrocerestAPI.userId!) { data, error in\n \n if G\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"swift"},"label":{"kind":"number","value":2,"string":"2"},"text":{"kind":"string","value":"//\n// GREditProfileViewController.swift\n// Grocerest\n//\n// Created by on 19/02/16.\n// Copyright © 2016 grocerest. All rights reserved.\n//\n\nimport Foundation\nimport UIKit\nimport SwiftyJSON\nimport Haneke\nimport RealmSwift\nimport SwiftLoader\nimport AVFoundation\nimport MobileCoreServices\n\nclass GREditProfileViewController: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate {\n \n let realm = try! Realm()\n var userData: JSON? {\n didSet {\n self.managedView.userData = self.userData\n self.setupCallbacks()\n }\n }\n var userCategories = [String]()\n var currentImage:UIImage = UIImage()\n \n var delegate : GRProfileUpdateProtocol?\n \n override var prefersStatusBarHidden : Bool {\n return false\n }\n \n override var preferredStatusBarStyle : UIStatusBarStyle {\n return .default\n }\n \n fileprivate var managedView: GREditProfileView {\n return self.view as! GREditProfileView\n }\n \n override func loadView() {\n super.loadView()\n view = GREditProfileView()\n managedView.delegate = self\n }\n \n override func viewDidLoad() {\n super.viewDidLoad()\n getUserData()\n self.setupCallbacks()\n }\n \n override func viewDidAppear(_ animated: Bool) {\n super.viewDidAppear(animated)\n userCategories.removeAll()\n }\n \n func setupViews() {\n //. 0 Image\n let type = AvatarType.cells\n managedView.profileImageView.setUserProfileAvatar(GRUser.sharedInstance.picture!, name: GRUser.sharedInstance.firstname!, lastName: GRUser.sharedInstance.lastname!, type: type)\n\n }\n \n func closeButtonWasPressed(_ sender:UIButton){\n self.dismiss(animated: true, completion: { () -> Void in\n self.delegate?.formatUserProfile()\n })\n }\n \n func getUserData() {\n GrocerestAPI.getUser(GrocerestAPI.userId!) { data, error in\n \n if GrocerestAPI.isRequestUnsuccessful(for: data, and: error) {\n return\n }\n \n self.userData = data\n self.setupViews()\n \n for category in data[\"categories\"].arrayValue {\n self.userCategories.append(category.string!)\n }\n \n persistUserWithData(data)\n }\n }\n \n // MARK: Image picker\n \n func editUserPhoto(_ sender:UIButton) {\n let imagePicker = UIImagePickerController()\n imagePicker.delegate = self\n imagePicker.sourceType = UIImagePickerControllerSourceType.photoLibrary\n imagePicker.mediaTypes = [kUTTypeImage as NSString as String]\n imagePicker.allowsEditing = true\n self.present(imagePicker, animated: true, completion: nil)\n }\n \n func imagePickerController(_ picker: UIImagePickerController!, didFinishPickingImage image: UIImage!, editingInfo: NSDictionary!){\n dismiss(animated: true) { () -> Void in\n self.managedView.profileImageView.layoutIfNeeded()\n // Set Image manually\n self.managedView.profileImageView.onEditionPreviewPhoto(image)\n self.currentImage = self.resizeImage(image, newWidth: 400)\n self.sendImage()\n }\n }\n \n func resizeImage(_ image: UIImage, newWidth: CGFloat) -> UIImage {\n let scale = newWidth / image.size.width\n let newHeight = image.size.height * scale\n UIGraphicsBeginImageContext(CGSize(width: newWidth, height: newHeight))\n image.draw(in: CGRect(x: 0, y: 0, width: newWidth, height: newHeight))\n let newImage = UIGraphicsGetImageFromCurrentImageContext()\n UIGraphicsEndImageContext()\n return newImage!\n }\n \n func sendImage() {\n SwiftLoader.show(title: \"Sending Image\", animated: true)\n\n let url:URL = URL(string: \"\\(GrocerestAPI.API_URL)user/\\(GrocerestAPI.userId!)/picture\")!\n let fileName = \"image\"\n let image = self.currentImage\n // TODO: scale down image size\n // handle orientation ?\n let data:Data = UIImageJPEGRepresentation(image, 1.0)!\n let request: NSMutableURLRequest = NSMutableURLRequest(url: url)\n request.httpMethod = \"PUT\"\n \n let boundary = \"----------V2ymHFg03esomerandomstuffhbqgZCaKO6jy\";\n let fullData = self.photoDataToFormData(data, boundary:boundary, fileName:fileName)\n \n request.setValue(\"Bearer \\(GrocerestAPI.bearerToken!)\", forHTTPHeaderField: \"Authorization\")\n \n request.setValue(\"multipart/form-data; boundary=\" + boundary,\n forHTTPHeaderField: \"Content-Type\")\n \n request.setValue(String(fullData.count), forHTTPHeaderField: \"Content-Length\")\n \n request.httpBody = fullData\n request.httpShouldHandleCookies = false\n \n let session = URLSession.shared\n \n let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { data, response, error in\n guard error == nil else {\n if let errorMessage = error?.localizedDescription {\n print(\"error: \\(errorMessage)\")\n }\n DispatchQueue.main.async { SwiftLoader.hide() }\n return\n }\n \n DispatchQueue.main.async { SwiftLoader.hide() }\n self.userState()\n }) \n \n dataTask.resume()\n }\n \n func photoDataToFormData(_ data:Data,boundary:String,fileName:String) -> Data {\n let fullData = NSMutableData()\n \n // 1 - Boundary should start with -\n let lineOne = \"--\" + boundary + \"\\r\\n\"\n fullData.append(lineOne.data(\n using: String.Encoding.utf8,\n allowLossyConversion: false)!)\n \n // 2\n let lineTwo = \"Content-Disposition: form-data; name=\\\"image\\\"; filename=\\\"\" + fileName + \"\\\"\\r\\n\"\n NSLog(lineTwo)\n fullData.append(lineTwo.data(\n using: String.Encoding.utf8,\n allowLossyConversion: false)!)\n \n // 3\n let lineThree = \"Content-Type: image/jpg\\r\\n\\r\\n\"\n fullData.append(lineThree.data(\n using: String.Encoding.utf8,\n allowLossyConversion: false)!)\n \n // 4\n fullData.append(data)\n \n // 5\n let lineFive = \"\\r\\n\"\n fullData.append(lineFive.data(\n using: String.Encoding.utf8,\n allowLossyConversion: false)!)\n \n // 6 - The end. Notice -- at the start and at the end\n let lineSix = \"--\" + boundary + \"--\\r\\n\"\n fullData.append(lineSix.data(\n using: String.Encoding.utf8,\n allowLossyConversion: false)!)\n \n return fullData as Data\n }\n\n func userState() {\n GrocerestAPI.getUser(GrocerestAPI.userId!) { data, error in\n \n if GrocerestAPI.isRequestUnsuccessful(for: data, and: error) {\n return\n }\n \n if let picture = data[\"picture\"].string {\n print(\"my photo: \\(data[\"picture\"].string)\")\n let cache = Haneke.Shared.imageCache\n cache.remove(key: picture, formatName: \"profilePicture\")\n cache.removeAll()\n }\n \n persistUserWithData(data)\n self.setupViews()\n }\n }\n \n func setupCallbacks() {\n let table = managedView.tableView\n \n table.favoriteCategories.onTap = {\n let categoriesViewController = GRCategoryListViewController()\n categoriesViewController.onEdition = true\n self.present(categoriesViewController, animated: true, completion: nil)\n }\n \n table.password.onTap = {\n GRPasswordChangeAlertViewController.show { password in\n if password != nil {\n GrocerestAPI.changePassword(GrocerestAPI.userId!, fields: [\"new_password\": password!]) { res, err in\n if res.count == 0 {\n let alert = UIAlertController(title: \"Cambio password\", message: \"Password cambiata con successo.\", preferredStyle: .alert)\n let dismissAlertAction = UIAlertAction(title: \"Ok\", style: .default, handler: { _ in\n alert.dismiss(animated: true, completion: nil)\n })\n alert.addAction(dismissAlertAction)\n self.present(alert, animated: true, completion: nil)\n }\n }\n }\n }\n }\n \n table.firstName.onTap = {\n if self.userData != nil {\n GRNameChangeAlertViewController.show(title: \"Cambia il nome\", name: self.userData![\"firstname\"].stringValue, placeholder: \"Nome\", errorMessage: \"Il nome non può essere vuoto\") { firstname in\n if firstname != nil && self.userData![\"firstname\"].stringValue != firstname! {\n GrocerestAPI.updateUser(GrocerestAPI.userId!, fields: [\"firstname\": firstname!])\n self.userData![\"firstname\"].string = firstname!\n }\n }\n }\n }\n \n table.secondName.onTap = {\n if self.userData != nil {\n GRNameChangeAlertViewController.show(title: \"Cambia il cognome\", name: self.userData![\"lastname\"].stringValue, placeholder: \"Cognome\", errorMessage: \"Il cognome non può essere vuoto\") { lastname in\n if lastname != nil && self.userData![\"lastname\"].stringValue != lastname! {\n GrocerestAPI.updateUser(GrocerestAPI.userId!, fields: [\"lastname\": lastname!])\n self.userData![\"lastname\"].string = lastname!\n }\n }\n }\n }\n \n table.birthdate.onTap = {\n var birthdate: Date? = nil\n if self.userData != nil && !self.userData![\"birthdate\"].stringValue.isEmpty {\n birthdate = Date(timeIntervalSince1970: Double(self.userData![\"birthdate\"].stringValue)! / 1000)\n }\n GRDateSelectorAlertViewController.show(title: \"Data di nascita\", unspecifiedButtonText: \"Nessuna data\", initialDate: birthdate) { date in\n if let date = date {\n let unixTime = Int(date.timeIntervalSince1970 * 1000)\n self.userData?[\"birthdate\"].string = String(unixTime)\n GrocerestAPI.updateUser(GrocerestAPI.userId!, fields: [\"birthdate\": unixTime])\n } else {\n self.userData?[\"birthdate\"].string = nil\n // TODO: why not nil?\n GrocerestAPI.updateUser(GrocerestAPI.userId!, fields: [\"birthdate\": NSNull()])\n }\n }\n }\n \n table.gender.onTap = {\n let data = [\"Maschio\",\"Femmina\"]\n var selected: String?\n if let previousGender = self.userData?[\"gender\"].string {\n selected = (previousGender == \"F\" ? \"Femmina\" : \"Maschio\")\n }\n GRSelectorAlertViewController.show(title: \"Sesso\", unspecifiedButtonText: \"Non specificato\", data: data, selected: selected) { gender in\n if gender != nil {\n let oneLetterGender = (gender! == \"Maschio\" ? \"M\" : \"F\")\n GrocerestAPI.updateUser(GrocerestAPI.userId!, fields: [\"gender\": oneLetterGender])\n self.userData?[\"gender\"].string = oneLetterGender\n } else {\n GrocerestAPI.updateUser(GrocerestAPI.userId!, fields: [\"gender\": \"\"])\n self.userData?[\"gender\"].string = nil\n }\n }\n }\n \n table.family.onTap = {\n let data = [\"Single\", \"Coppia\", \"Con figli\"]\n GRSelectorAlertViewController.show(title: \"Nucleo familiare\", unspecifiedButtonText: \"Non specificato\", data: data, selected: self.userData?[\"family\"].string) { family in\n if family != nil {\n GrocerestAPI.updateUser(GrocerestAPI.userId!, fields: [\"family\": family!])\n } else {\n GrocerestAPI.updateUser(GrocerestAPI.userId!, fields: [\"family\": \"\"])\n }\n self.userData?[\"family\"].string = family\n }\n }\n }\n\n}\n"}}},{"rowIdx":976,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a C++ program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid C++ code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical C++ concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., memory management). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching C++. It should be similar to a school exercise, a tutorial, or a C++ course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching C++. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\n#include \"UGVNavigator.hpp\"\n\nUGVNavigator::UGVNavigator(WheeledRobot* t_robot, block_frequency t_bf) : TimedBlock(t_bf) {\n m_robot = t_robot;\n}\n\nvoid UGVNavigator::loopInternal() {\n switch (mainUGVNavMissionStateManager.getMissionState()) {\n case UGVNavState::WARMINGUP: {\n //TODO: add idle check\n //TODO: add utility check\n mainUGVNavMissionStateManager.updateMissionState(UGVNavState::IDLE);\n break;\n }\n case UGVNavState::MOVING: {\n if(m_robot->reachedPosition()) {\n mainUGVNavMissionStateManager.updateMissionState(UGVNavState::REACHEDGOAL);\n }\n break;\n }\n case UGVNavState::REACHEDGOAL: {\n break;\n }\n default:\n break;\n }\n}\n\nvoid UGVNavigator::receive_msg_data(DataMessage* t_msg) {} // NOT IMPLEMENTED, LEGACY FUNCTION\n\nvoid UGVNavigator::receive_msg_data(DataMessage* t_msg, int t_channel_id) {\n if(t_channel_id == (int)CHANNELS::INTERNAL_STATE_UPDATER) {\n if(t_msg->getType() == msg_type::INTEGER) {\n if(mainUGVNavMissionStateManager.getMissionState() == UGVNavState::WARMINGUP) {\n Logger::getAssignedLogger()->log(\"UGV Is Still Warming Up, please wait\", LoggerLevel::Warning);\n }\n else {\n switch ((UGVNavState)((IntegerMsg*)t_msg)->data) {\n case UGVNavState::IDLE: {\n this->reset();\n mainUGVNavMissionStateManager.updateMissionState(UGVNavState::IDLE);\n Logger::getAssignedLogger()->log(\"MM Changed UGV Nav State To IDLE\", LoggerLevel::Info);\n break; \n }\n case UGVNavState::UTILITY: {\n m_robot->stop();\n mainUGVNavMissionStateManager.updateMissionState(UGVNavState::UTILITY);\n Logger::getAssignedLogger()->log(\"MM Changed UGV Nav State To Utility\", LoggerLevel::Warning)\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"cpp"},"label":{"kind":"number","value":2,"string":"2"},"text":{"kind":"string","value":"#include \"UGVNavigator.hpp\"\n\nUGVNavigator::UGVNavigator(WheeledRobot* t_robot, block_frequency t_bf) : TimedBlock(t_bf) {\n m_robot = t_robot;\n}\n\nvoid UGVNavigator::loopInternal() {\n switch (mainUGVNavMissionStateManager.getMissionState()) {\n case UGVNavState::WARMINGUP: {\n //TODO: add idle check\n //TODO: add utility check\n mainUGVNavMissionStateManager.updateMissionState(UGVNavState::IDLE);\n break;\n }\n case UGVNavState::MOVING: {\n if(m_robot->reachedPosition()) {\n mainUGVNavMissionStateManager.updateMissionState(UGVNavState::REACHEDGOAL);\n }\n break;\n }\n case UGVNavState::REACHEDGOAL: {\n break;\n }\n default:\n break;\n }\n}\n\nvoid UGVNavigator::receive_msg_data(DataMessage* t_msg) {} // NOT IMPLEMENTED, LEGACY FUNCTION\n\nvoid UGVNavigator::receive_msg_data(DataMessage* t_msg, int t_channel_id) {\n if(t_channel_id == (int)CHANNELS::INTERNAL_STATE_UPDATER) {\n if(t_msg->getType() == msg_type::INTEGER) {\n if(mainUGVNavMissionStateManager.getMissionState() == UGVNavState::WARMINGUP) {\n Logger::getAssignedLogger()->log(\"UGV Is Still Warming Up, please wait\", LoggerLevel::Warning);\n }\n else {\n switch ((UGVNavState)((IntegerMsg*)t_msg)->data) {\n case UGVNavState::IDLE: {\n this->reset();\n mainUGVNavMissionStateManager.updateMissionState(UGVNavState::IDLE);\n Logger::getAssignedLogger()->log(\"MM Changed UGV Nav State To IDLE\", LoggerLevel::Info);\n break; \n }\n case UGVNavState::UTILITY: {\n m_robot->stop();\n mainUGVNavMissionStateManager.updateMissionState(UGVNavState::UTILITY);\n Logger::getAssignedLogger()->log(\"MM Changed UGV Nav State To Utility\", LoggerLevel::Warning);\n break;\n }\n default:\n break;\n }\n }\n }\n }\n else if(t_channel_id == (int)CHANNELS::FIRE_POSITION_UPDATER) {\n if(t_msg->getType() == msg_type::VECTOR3D) {\n Logger::getAssignedLogger()->log(\"Fire Position Received\",LoggerLevel::Info);\n Vector3DMessage* t_direction_msg = (Vector3DMessage*)t_msg;\n m_FireLocation = t_direction_msg->getData().project_xy();\n m_Map->setObjectLocation(m_FireLocation);\n Vector3D t_vec = m_Map->getNormalToObject();\n m_ExtLocation = t_vec.project_xy();\n m_ExtHeading = t_vec.z;\n }\n }\n else if(t_channel_id == (int)CHANNELS::POSITION_ADJUSTMENT) { //TODO: check functionality\n if(t_msg->getType() == msg_type::FLOAT) {\n FloatMsg* t_float_msg = (FloatMsg*) t_msg;\n Logger::getAssignedLogger()->log(\"Adjustment Command Received: %f\", t_float_msg->data, LoggerLevel::Info);\n double t_step_size = double(t_float_msg->data);\n m_robot->setGoal(m_PathGenerator.generateParametricPath(m_robot->getCurrentPosition(), t_step_size));\n m_robot->move();\n mainUGVNavMissionStateManager.updateMissionState(UGVNavState::MOVING);\n }\n }\n else if(t_channel_id == (int)CHANNELS::CHANGE_POSE) {\n if(t_msg->getType() == msg_type::POSE) {\n PoseMsg* t_pose_msg = (PoseMsg*) t_msg;\n m_robot->setGoal({t_pose_msg->pose.x, t_pose_msg->pose.y, t_pose_msg->pose.yaw});\n m_robot->move();\n mainUGVNavMissionStateManager.updateMissionState(UGVNavState::MOVING);\n }\n }\n else if(t_channel_id == (int)CHANNELS::GO_TO_FIRE) {\n m_robot->setGoal({m_ExtLocation.x, m_ExtLocation.y, m_ExtHeading});\n m_robot->move();\n mainUGVNavMissionStateManager.updateMissionState(UGVNavState::MOVING);\n }\n}\n\nvoid UGVNavigator::setScanningPath(Rectangle* t_rect) {\n m_PathGenerator.setTrack(*t_rect);\n}\n\nvoid UGVNavigator::setMap(Map2D* t_map) {\n m_Map = t_map;\n}\n\nvoid UGVNavigator::reset() {\n m_robot->stop();\n}"}}},{"rowIdx":977,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a C++ program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid C++ code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical C++ concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., memory management). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching C++. It should be similar to a school exercise, a tutorial, or a C++ course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching C++. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\n#include \n#include \n\nusing namespace std;\n\nint ties_election(const vector& v) {\n int total = accumulate(v.begin(), v.end(), 0);\n if (total & 1) {\n return -1;\n }\n vector > dp(v.size()+1, vector(total/2+1, 0));\n dp[0][0] = 1;\n for (int i = 1; i <= v.size(); i++) {\n for (int j = 1; j < total/2+1; j++) {\n dp[i][j] = dp[i-1][j] + (j >= v[i-1]) ? d[i-1][j-v[i-1]] : 0;\n }\n }\n return dp[v.size()][total/2];\n}\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"cpp"},"label":{"kind":"number","value":2,"string":"2"},"text":{"kind":"string","value":"#include \n#include \n\nusing namespace std;\n\nint ties_election(const vector& v) {\n int total = accumulate(v.begin(), v.end(), 0);\n if (total & 1) {\n return -1;\n }\n vector > dp(v.size()+1, vector(total/2+1, 0));\n dp[0][0] = 1;\n for (int i = 1; i <= v.size(); i++) {\n for (int j = 1; j < total/2+1; j++) {\n dp[i][j] = dp[i-1][j] + (j >= v[i-1]) ? d[i-1][j-v[i-1]] : 0;\n }\n }\n return dp[v.size()][total/2];\n}\n"}}},{"rowIdx":978,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a Rust program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid Rust code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical Rust concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., ownership, lifetimes). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching Rust. It should be similar to a school exercise, a tutorial, or a Rust course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching Rust. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\nuse super::*;\n\npub use option_env as call_on;\n\npub\nfn option_env (input: TokenStream2)\n -> Result>\n{\n let CompileTimeString(ref s) = parse2(input)?;\n Ok(::std::env::var(s).ok())\n}\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"rust"},"label":{"kind":"number","value":2,"string":"2"},"text":{"kind":"string","value":"use super::*;\n\npub use option_env as call_on;\n\npub\nfn option_env (input: TokenStream2)\n -> Result>\n{\n let CompileTimeString(ref s) = parse2(input)?;\n Ok(::std::env::var(s).ok())\n}\n"}}},{"rowIdx":979,"cells":{"prompt":{"kind":"string","value":"Below is an extract from a Swift program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the program contains valid Swift code, even if it's not educational, like boilerplate code, configurations, or niche concepts.\n- Add another point if the program addresses practical Swift concepts, even if it lacks comments.\n- Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., protocols, extensions). The code should be well-structured and contain some comments.\n- Give a fourth point if the program is self-contained and highly relevant to teaching Swift. It should be similar to a school exercise, a tutorial, or a Swift course section.\n- Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching Swift. It should be well-written, easy to understand, and contain step-by-step explanations and comments.\n\nThe extract:\n//\n// LoyalySignUpViewController.swift\n// SmylePaymentTerminal\n//\n// Created by on 2019-09-13.\n// Copyright © 2019 . All rights reserved.\n//\n\nimport UIKit\n\nclass LoyalySignUpViewController: UIViewController, MessagingProtocol {\n \n var user: User?\n \n func readMessage(message: String) {\n \n }\n \n\n override func viewDidLoad() {\n super.viewDidLoad()\n\n // Do any additional setup after loading the view.\n }\n \n @IBAction func yes(_ sender: Any) {\n performSegue(withIdentifier: \"enrolled\", sender: self)\n }\n \n @IBAction func no(_ sender: Any) {\n performSegue(withIdentifier: \"cancelled\", sender: self)\n }\n \n // MARK: - Navigation\n\n // In a storyboard-based application, you will often want to do a little preparation before navigation\n override func prepare(for segue: UIStoryboardSegue, sender: Any?) {\n if let des = segue.destination as? EnrollmentConfirmedViewController {\n \n des.user = self.user\n \n } else if let des = segue.destination as? EnrollmentCancelledViewController {\n \n des.user = self.user\n \n }\n }\n \n\n}\n\nAfter examining the extract: \n- Briefly justify your total score, up to 100 words.\n- Conclude with the score using the format: \"Educational score: \"\n"},"language":{"kind":"string","value":"swift"},"label":{"kind":"number","value":2,"string":"2"},"text":{"kind":"string","value":"//\n// LoyalySignUpViewController.swift\n// SmylePaymentTerminal\n//\n// Created by on 2019-09-13.\n// Copyright © 2019 . All rights reserved.\n//\n\nimport UIKit\n\nclass LoyalySignUpViewController: UIViewController, MessagingProtocol {\n \n var user: User?\n \n func readMessage(message: String) {\n \n }\n \n\n override func viewDidLoad() {\n super.viewDidLoad()\n\n // Do any additional setup after loading the view.\n }\n \n @IBAction func yes(_ sender: Any) {\n performSegue(withIdentifier: \"enrolled\", sender: self)\n }\n \n @IBAction func no(_ sender: Any) {\n performSegue(withIdentifier: \"cancelled\", sender: self)\n }\n \n // MARK: - Navigation\n\n // In a storyboard-based application, you will often want to do a little preparation before navigation\n override func prepare(for segue: UIStoryboardSegue, sender: Any?) {\n if let des = segue.destination as? EnrollmentConfirmedViewController {\n \n des.user = self.user\n \n } else if let des = segue.destination as? EnrollmentCancelledViewController {\n \n des.user = self.user\n \n }\n }\n \n\n}\n"}}},{"rowIdx":980,"cells":{"prompt":{"kind":"string","value":"Below is an extract from an HTML document. Evaluate whether it has a high educational value and could help teach web development. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:\n\n- Add 1 point if the document contains valid HTML markup, even if it's not educational, like boilerplate code or standard tags.\n- Add another point if the document addresses practical HTML concepts and uses semantic elements appropriately.\n- Award a third point if the document is suitable for educational use and introduces key web concepts, even if the topic is somewhat advanced (e.g., forms, metadata). The code should be well-structured and use clear, descriptive naming.\n- Give a fourth point if the document is self-contained and highly relevant to teaching HTML. It should be similar to a school exercise, a tutorial, or an HTML course section for early learners.\n- Grant a fifth point if the document is outstanding in its educational value and is perfectly suited for teaching HTML to beginners. It should be well-organized, easy to understand, and ideally include some explanatory comments or demonstrate best practices in HTML structure.\n\nThe extract:\n\n\n\n\n\n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n\n Les Golden Knights écrasent les Stars et s’approchent de la finale | Radio-Canada Mini\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n \n\n