{ // 获取包含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 !== 'PDF TO Markdown' && linkText !== 'PDF TO Markdown' ) { link.textContent = 'PDF TO 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 !== 'Voice Cloning' ) { link.textContent = 'Voice Cloning'; link.href = 'https://vibevoice.info/'; 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, 'PDF TO 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"}}},{"rowIdx":308,"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:\nextern crate gcc;\n\n\n\nfn main(){\n\tgcc::Config::new().file(\"huhu.c\").compile(\"libhuhu.a\");\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":"rust"},"label":{"kind":"number","value":1,"string":"1"},"text":{"kind":"string","value":"extern crate gcc;\n\n\n\nfn main(){\n\tgcc::Config::new().file(\"huhu.c\").compile(\"libhuhu.a\");\n\n\n}"}}},{"rowIdx":309,"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:\nParaSwap Test\n\nThis is aproof of concept to swap ETH for DAI using ParaSwap's api here: https://developers.paraswap.network/\n\nTo use it you need metamask installed and loaded with rETH.\n\nRun the following two commands:\n\nnpm install\nnpm start\n\nThen navigate to localhost port 8080 and connect your metamask wallet on the ropsten testnet.\n\nPress the exchange button to swap 0.1 rETH for DAI.\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":"ParaSwap Test\n\nThis is aproof of concept to swap ETH for DAI using ParaSwap's api here: https://developers.paraswap.network/\n\nTo use it you need metamask installed and loaded with rETH.\n\nRun the following two commands:\n\nnpm install\nnpm start\n\nThen navigate to localhost port 8080 and connect your metamask wallet on the ropsten testnet.\n\nPress the exchange button to swap 0.1 rETH for DAI.\n"}}},{"rowIdx":310,"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:\nimport Realm\nimport Foundation\n\nextension KeyValueObservationNotificationToken {\n func invalidate3LUJ5Weeklylistcontroller(_ weeklyListController: String) {\n print(weeklyListController)\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":"import Realm\nimport Foundation\n\nextension KeyValueObservationNotificationToken {\n func invalidate3LUJ5Weeklylistcontroller(_ weeklyListController: String) {\n print(weeklyListController)\n }\n}\n"}}},{"rowIdx":311,"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 CCTVModels;\nusing CCTVModels.User;\nusing GatewayModels;\nusing GatewayModels.Util;\nusing GatewayNet.Server;\nusing GatewayNet.Util;\nusing GBTModels.Global;\nusing GBTModels.Notify;\nusing GBTModels.Response;\nusing GBTModels.Util;\nusing LumiSoft.Net.SIP.Message;\nusing LumiSoft.Net.SIP.Stack;\n\nnamespace GatewayNet.Tools\n{\n public class ResourceSharer\n {\n public static ResourceSharer Instance { get; private set; }\n static ResourceSharer()\n {\n Instance = new ResourceSharer();\n }\n\n private ResourceSharer()\n {\n\n }\n\n public void NotifyToPlatform(string platId)\n {\n Gateway gw = InfoService.Instance.CurrentGateway;\n Platform pf = InfoService.Instance.GetPlatform(platId);\n string localIp = IPAddressHelper.GetLocalIp();\n SIP_Stack stack = SipProxyWrapper.Instance.Stack;\n\n DeviceCatalogNotify dcd = createCatalog(gw, pf);\n string body = SerializeHelper.Instance.Serialize(dcd);\n\n SIP_t_NameAddress from = new SIP_t_NameAddress($\"sip:{gw.SipNumber}@{localIp}:{gw.Port}\");\n SIP_t_NameAddress to = new SIP_t_NameAddress($\"sip:{pf.SipNumber}@{pf.Ip}:{pf.Port}\");\n\n SIP_Request message = stack.CreateRequest(SIP_Methods.NOTIFY, to, from);\n message.ContentType = \"Application/MANSCDP+xml\";\n message.Data = MyEncoder.Encoder.GetBytes(body);\n SIP_RequestSender send = stack.CreateRequestSender(message);\n send.Start();\n }\n\n public void ResponseToPlatform(Platform plat)\n {\n Gateway gw = InfoService.Instance.CurrentGateway;\n string localIp = IPAddressHelper.GetLocalIp();\n SIP_Stack stack = SipProxyWrapper.Instance.Stack;\n\n DeviceCatalogResp resp = createCatalogResp(gw, plat);\n string body\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 CCTVModels;\nusing CCTVModels.User;\nusing GatewayModels;\nusing GatewayModels.Util;\nusing GatewayNet.Server;\nusing GatewayNet.Util;\nusing GBTModels.Global;\nusing GBTModels.Notify;\nusing GBTModels.Response;\nusing GBTModels.Util;\nusing LumiSoft.Net.SIP.Message;\nusing LumiSoft.Net.SIP.Stack;\n\nnamespace GatewayNet.Tools\n{\n public class ResourceSharer\n {\n public static ResourceSharer Instance { get; private set; }\n static ResourceSharer()\n {\n Instance = new ResourceSharer();\n }\n\n private ResourceSharer()\n {\n\n }\n\n public void NotifyToPlatform(string platId)\n {\n Gateway gw = InfoService.Instance.CurrentGateway;\n Platform pf = InfoService.Instance.GetPlatform(platId);\n string localIp = IPAddressHelper.GetLocalIp();\n SIP_Stack stack = SipProxyWrapper.Instance.Stack;\n\n DeviceCatalogNotify dcd = createCatalog(gw, pf);\n string body = SerializeHelper.Instance.Serialize(dcd);\n\n SIP_t_NameAddress from = new SIP_t_NameAddress($\"sip:{gw.SipNumber}@{localIp}:{gw.Port}\");\n SIP_t_NameAddress to = new SIP_t_NameAddress($\"sip:{pf.SipNumber}@{pf.Ip}:{pf.Port}\");\n\n SIP_Request message = stack.CreateRequest(SIP_Methods.NOTIFY, to, from);\n message.ContentType = \"Application/MANSCDP+xml\";\n message.Data = MyEncoder.Encoder.GetBytes(body);\n SIP_RequestSender send = stack.CreateRequestSender(message);\n send.Start();\n }\n\n public void ResponseToPlatform(Platform plat)\n {\n Gateway gw = InfoService.Instance.CurrentGateway;\n string localIp = IPAddressHelper.GetLocalIp();\n SIP_Stack stack = SipProxyWrapper.Instance.Stack;\n\n DeviceCatalogResp resp = createCatalogResp(gw, plat);\n string body = SerializeHelper.Instance.Serialize(resp);\n\n SIP_t_NameAddress from = new SIP_t_NameAddress($\"sip:{gw.SipNumber}@{localIp}:{gw.Port}\");\n SIP_t_NameAddress to = new SIP_t_NameAddress($\"sip:{plat.SipNumber}@{plat.Ip}:{plat.Port}\");\n\n SIP_Request message = stack.CreateRequest(SIP_Methods.MESSAGE, to, from);\n message.ContentType = \"Application/MANSCDP+xml\";\n message.Data = MyEncoder.Encoder.GetBytes(body);\n SIP_RequestSender send = stack.CreateRequestSender(message);\n send.Start();\n }\n\n private List getUserDeviceId(Platform plat)\n {\n CCTVUserPrivilege up = InfoService.Instance.GetUserPrivilege(plat.UserName);\n if (up != null && up.AccessibleNodes != null)\n {\n CCTVHierarchyInfo[] hInfos = InfoService.Instance.GetAllHierarchy().Where(hi => up.AccessibleNodes.Contains(hi.Id)).ToArray();\n if (hInfos != null && hInfos.Length > 0)\n {\n return hInfos.Select(hi => hi.ElementId).ToList();\n }\n }\n return new List();\n }\n\n private DeviceCatalogNotify createCatalog(Gateway gw, Platform plat)\n {\n DeviceCatalogNotify notify = new DeviceCatalogNotify();\n notify.DeviceID = gw.SipNumber;\n DeviceItemsCollection items = buildDeviceItems(gw.SipNumber, plat);\n if (items != null)\n notify.Items = items;\n return notify;\n }\n\n private DeviceCatalogResp createCatalogResp(Gateway gw, Platform plat)\n {\n DeviceCatalogResp resp = new DeviceCatalogResp();\n resp.DeviceID = gw.SipNumber;\n DeviceItemsCollection items = buildDeviceItems(gw.SipNumber, plat);\n if (items != null)\n resp.Items = items;\n return resp;\n }\n\n private DeviceItemsCollection buildDeviceItems(string parentId, Platform plat)\n {\n //过滤出仅平台鉴权用户可用的视频列表。\n List acIds = getUserDeviceId(plat);\n IEnumerable infos = InfoService.Instance.GetAllStaticInfo();\n if (infos != null)\n {\n Dictionary dictIdPairs = new Dictionary();\n IEnumerable dids = InfoService.Instance.GetAllSipIdMap();\n if (dids != null)\n {\n foreach (SipIdMap sp in dids)\n {\n dictIdPairs[sp.StaticId] = sp.SipNumber;\n }\n }\n DeviceItemsCollection items = new DeviceItemsCollection();\n foreach (CCTVStaticInfo si in infos)\n {\n CCTVControlConfig cc = InfoService.Instance.GetControlConfig(si.VideoId);\n string sip = null;\n if (dictIdPairs.ContainsKey(si.VideoId))\n sip = dictIdPairs[si.VideoId];\n else\n {\n sip = SipIdGenner.GenDeviceID();\n InfoService.Instance.PutSipIdMap(si.VideoId, new SipIdMap(si.VideoId, sip),false);\n }\n ItemType it = new ItemType()\n {\n DeviceID = sip,\n ParentID = parentId,\n Event = StatusEvent.ADD,\n Name = si.Name,\n Manufacturer = \"Seecool\",\n Model = \"Seecool\",\n Owner = \"Seecool\",\n CivilCode = sip,\n Block = \"\",\n Address = \"1\",\n Parental = 0,\n SafetyWay = 0,\n RegisterWay = 1,\n CertNum = \"1\",\n Certifiable = 1,\n ErrCode = 400,\n EndTime = DateTime.Now,\n Secrecy = 0,\n IPAddress = cc?.Ip,\n Port = cc == null ? 8000 : cc.Port,\n Password = ,\n Status = StatusType.ON,\n Longitude = si.Longitude,\n Latitude = si.Latitude\n };\n items.Add(it);\n }\n return items;\n }\n else\n return null;\n }\n }\n}\n"}}},{"rowIdx":312,"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:\nfor a in $(seq 1 1 50) ; do\ncp model_XaXnXr_2.pbs model_XaXnXr_2_run$a.pbs\nsed -i '' 's/input_2_3/input_2_3_run'$a'/g' model_XaXnXr_2_run$a.pbs\n\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":"for a in $(seq 1 1 50) ; do\ncp model_XaXnXr_2.pbs model_XaXnXr_2_run$a.pbs\nsed -i '' 's/input_2_3/input_2_3_run'$a'/g' model_XaXnXr_2_run$a.pbs\n\ndone\n"}}},{"rowIdx":313,"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:\nimport React from 'react';\nimport Logo from '../images/EcoPaisa_Logo.png';\nimport './Styles/App.css';\nimport { Link } from 'react-router-dom';\n\n\n\n\nfunction NavBar() {\n return (\n
\n
\n \"...\"\n EcoPaisa\n
\n \n
\n );\n}\n\n\nexport default NavBar;\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":1,"string":"1"},"text":{"kind":"string","value":"import React from 'react';\nimport Logo from '../images/EcoPaisa_Logo.png';\nimport './Styles/App.css';\nimport { Link } from 'react-router-dom';\n\n\n\n\nfunction NavBar() {\n return (\n
\n
\n \"...\"\n EcoPaisa\n
\n \n
\n );\n}\n\n\nexport default NavBar;\n\n"}}},{"rowIdx":314,"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 roman\n\nimport (\n\t\"testing\"\n)\n\nfunc TestValidateSymbol(t *testing.T) {\n\ttestCases := []struct {\n\t\tsymbol string\n\t\texp error\n\t}{\n\t\t{\"I\", nil},\n\t\t{\"V\", nil},\n\t\t{\"X\", nil},\n\t\t{\"L\", nil},\n\t\t{\"C\", nil},\n\t\t{\"D\", nil},\n\t\t{\"M\", nil},\n\t\t{\"i\", errInvalidRomanSymbol},\n\t\t{\"\", errInvalidRomanSymbol},\n\t\t{\"A\", errInvalidRomanSymbol},\n\t\t{\"4\", errInvalidRomanSymbol},\n\t\t{\"II\", errInvalidRomanSymbol},\n\t}\n\n\tfor _, tc := range testCases {\n\t\tif act := ValidateSymbol(tc.symbol); act != tc.exp {\n\t\t\tt.Fatal(\"Expected\", tc.exp, \", got\", act)\n\t\t}\n\t}\n}\n\nfunc TestValidateNumber(t *testing.T) {\n\ttestCases := []struct {\n\t\tnumber string\n\t\texp bool\n\t}{\n\t\t{\"II\", true},\n\t\t{\"I\", true},\n\t\t{\"XXX\", true},\n\t\t{\"XXXX\", false},\n\t\t{\"XXIX\", true},\n\t\t{\"DD\", false},\n\t\t{\"LL\", false},\n\t\t{\"VV\", false},\n\t\t{\"IM\", false},\n\t\t{\"XM\", false},\n\t\t{\"CM\", true},\n\t\t{\"VM\", false},\n\t\t{\"XM\", false},\n\t\t{\"XXXD\", false},\n\t\t{\"XDM\", false},\n\t\t{\"XXXD\", false},\n\t\t{\"LC\", false},\n\t\t{\"\", true},\n\t\t{\"M\", true},\n\t}\n\n\tfor _, tc := range testCases {\n\t\tif act := isValidNumber(tc.number); act != tc.exp {\n\t\t\tt.Fatal(\"Expected\", tc.exp, \", got\", act)\n\t\t}\n\t}\n}\n\nfunc TestToArabic(t *testing.T) {\n\ttestCases := []struct {\n\t\troman string\n\t\tarabic int\n\t\terr error\n\t}{\n\t\t{\"I\", 1, nil},\n\t\t{\"II\", 2, nil},\n\t\t{\"III\", 3, nil},\n\t\t{\"IV\", 4, nil},\n\t\t{\"V\", 5, nil},\n\t\t{\"VI\", 6, nil},\n\t\t{\"VII\", 7, nil},\n\t\t{\"VIII\", 8, nil},\n\t\t{\"IX\", 9, nil},\n\t\t{\"X\", 10, nil},\n\t\t{\"XI\", 11, nil},\n\t\t{\"L\", 50, nil},\n\t\t{\"C\", 100, nil},\n\t\t{\"D\", 500, nil},\n\t\t{\"CMXCIX\", 999, nil},\n\t\t{\"M\", 1000, nil},\n\t\t{\"MDCCCLXXXII\", 1882, nil},\n\t\t{\"MDCCCLXXXIII\", 1883, nil},\n\t\t{\"MDCCCLXXXIV\", 1884, nil},\n\t\t{\"MDCCCLXXXV\", 1885, nil},\n\t\t{\"MDCCCLXXXVI\", 1886, nil},\n\t\t{\"MDCCCLXXXVII\", 1887, nil},\n\t\t{\"MDCCCLXXXVIII\", 1888, nil},\n\t\t{\"MDCCCLXXXIX\", 1889, nil},\n\t\t{\"MDCCCXC\", 1890, nil},\n\t\t{\"MCMXLIV\", 1944, nil},\n\t\t{\"MCMXCIX\", 1999, nil},\n\t\t{\"MMM\", 3000, nil},\n\t\t{\"\", 0, nil},\n\n\t\t{\"i\", 0, errInvalidRomanNumber},\n\t\t{\"A\", 0, errInvalidRomanNumber},\n\t\t{\"4\", 0, errInvalidRomanNumber},\n\t\t{\"IIII\", 0, errIn\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":2,"string":"2"},"text":{"kind":"string","value":"package roman\n\nimport (\n\t\"testing\"\n)\n\nfunc TestValidateSymbol(t *testing.T) {\n\ttestCases := []struct {\n\t\tsymbol string\n\t\texp error\n\t}{\n\t\t{\"I\", nil},\n\t\t{\"V\", nil},\n\t\t{\"X\", nil},\n\t\t{\"L\", nil},\n\t\t{\"C\", nil},\n\t\t{\"D\", nil},\n\t\t{\"M\", nil},\n\t\t{\"i\", errInvalidRomanSymbol},\n\t\t{\"\", errInvalidRomanSymbol},\n\t\t{\"A\", errInvalidRomanSymbol},\n\t\t{\"4\", errInvalidRomanSymbol},\n\t\t{\"II\", errInvalidRomanSymbol},\n\t}\n\n\tfor _, tc := range testCases {\n\t\tif act := ValidateSymbol(tc.symbol); act != tc.exp {\n\t\t\tt.Fatal(\"Expected\", tc.exp, \", got\", act)\n\t\t}\n\t}\n}\n\nfunc TestValidateNumber(t *testing.T) {\n\ttestCases := []struct {\n\t\tnumber string\n\t\texp bool\n\t}{\n\t\t{\"II\", true},\n\t\t{\"I\", true},\n\t\t{\"XXX\", true},\n\t\t{\"XXXX\", false},\n\t\t{\"XXIX\", true},\n\t\t{\"DD\", false},\n\t\t{\"LL\", false},\n\t\t{\"VV\", false},\n\t\t{\"IM\", false},\n\t\t{\"XM\", false},\n\t\t{\"CM\", true},\n\t\t{\"VM\", false},\n\t\t{\"XM\", false},\n\t\t{\"XXXD\", false},\n\t\t{\"XDM\", false},\n\t\t{\"XXXD\", false},\n\t\t{\"LC\", false},\n\t\t{\"\", true},\n\t\t{\"M\", true},\n\t}\n\n\tfor _, tc := range testCases {\n\t\tif act := isValidNumber(tc.number); act != tc.exp {\n\t\t\tt.Fatal(\"Expected\", tc.exp, \", got\", act)\n\t\t}\n\t}\n}\n\nfunc TestToArabic(t *testing.T) {\n\ttestCases := []struct {\n\t\troman string\n\t\tarabic int\n\t\terr error\n\t}{\n\t\t{\"I\", 1, nil},\n\t\t{\"II\", 2, nil},\n\t\t{\"III\", 3, nil},\n\t\t{\"IV\", 4, nil},\n\t\t{\"V\", 5, nil},\n\t\t{\"VI\", 6, nil},\n\t\t{\"VII\", 7, nil},\n\t\t{\"VIII\", 8, nil},\n\t\t{\"IX\", 9, nil},\n\t\t{\"X\", 10, nil},\n\t\t{\"XI\", 11, nil},\n\t\t{\"L\", 50, nil},\n\t\t{\"C\", 100, nil},\n\t\t{\"D\", 500, nil},\n\t\t{\"CMXCIX\", 999, nil},\n\t\t{\"M\", 1000, nil},\n\t\t{\"MDCCCLXXXII\", 1882, nil},\n\t\t{\"MDCCCLXXXIII\", 1883, nil},\n\t\t{\"MDCCCLXXXIV\", 1884, nil},\n\t\t{\"MDCCCLXXXV\", 1885, nil},\n\t\t{\"MDCCCLXXXVI\", 1886, nil},\n\t\t{\"MDCCCLXXXVII\", 1887, nil},\n\t\t{\"MDCCCLXXXVIII\", 1888, nil},\n\t\t{\"MDCCCLXXXIX\", 1889, nil},\n\t\t{\"MDCCCXC\", 1890, nil},\n\t\t{\"MCMXLIV\", 1944, nil},\n\t\t{\"MCMXCIX\", 1999, nil},\n\t\t{\"MMM\", 3000, nil},\n\t\t{\"\", 0, nil},\n\n\t\t{\"i\", 0, errInvalidRomanNumber},\n\t\t{\"A\", 0, errInvalidRomanNumber},\n\t\t{\"4\", 0, errInvalidRomanNumber},\n\t\t{\"IIII\", 0, errInvalidRomanNumber},\n\t\t{\"MMMM\", 0, errInvalidRomanNumber},\n\t\t{\"XXXXX\", 0, errInvalidRomanNumber},\n\t\t{\"VM\", 0, errInvalidRomanNumber},\n\t}\n\n\tfor _, tc := range testCases {\n\t\tif act, err := ToArabic(tc.roman); err != tc.err || act != tc.arabic {\n\t\t\tt.Fatal(\"Expected\", tc.arabic, tc.err, \", got\", act, err, \"for\", tc.roman)\n\t\t}\n\t}\n}\n"}}},{"rowIdx":315,"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:\nsetMonto($monto);\n }\n \n public function setMonto($value)\n {\n $this->monto = $value;\n }\n \n public function getMonto()\n {\n return $this->monto;\n }\n \n \n public abstract function accept(IDTOMedioPagoVisitor $visitor);\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":3,"string":"3"},"text":{"kind":"string","value":"setMonto($monto);\n }\n \n public function setMonto($value)\n {\n $this->monto = $value;\n }\n \n public function getMonto()\n {\n return $this->monto;\n }\n \n \n public abstract function accept(IDTOMedioPagoVisitor $visitor);\n\n}\n"}}},{"rowIdx":316,"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# ios-class-projects\nRepo for projects from my Advanced iOS class at Rose-Hulman\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":"# ios-class-projects\nRepo for projects from my Advanced iOS class at Rose-Hulman\n"}}},{"rowIdx":317,"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:\nINSERT INTO public.user_info (id, password, username) VALUES (1, ', '');\nINSERT INTO public.user_info (id, password, username) VALUES (2, ', '');\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":"INSERT INTO public.user_info (id, password, username) VALUES (1, ', '');\nINSERT INTO public.user_info (id, password, username) VALUES (2, ', '');"}}},{"rowIdx":318,"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 data=[\n {\n id:1,\n name:\"sample product 01\"\n },\n {\n id:2,\n name:\"sample product 02\"\n },\n {\n id:3,\n name:\"sample product 03\"\n },\n {\n id:4,\n name:\"sample product 04\"\n },\n {\n id:5,\n name:\"sample product 05\"\n }\n]\nexport default data\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":1,"string":"1"},"text":{"kind":"string","value":" const data=[\n {\n id:1,\n name:\"sample product 01\"\n },\n {\n id:2,\n name:\"sample product 02\"\n },\n {\n id:3,\n name:\"sample product 03\"\n },\n {\n id:4,\n name:\"sample product 04\"\n },\n {\n id:5,\n name:\"sample product 05\"\n }\n]\nexport default data"}}},{"rowIdx":319,"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# jp_prefecture\n\nA library that converts Japanese prefecture codes and prefecture names.\n\n## Usage\n\n### Find a Japanese prefecture by prefecture code.\n\n```dart\nfinal pref = JpPrefecture.findByCode(13);\nif (pref == null) {\n return;\n}\nprint(pref.code); // => 13\nprint(pref.name); // => '東京都'\nprint(pref.nameE); // => 'Tokyo'\nprint(pref.nameH); // => 'とうきょうと'\nprint(pref.nameK); // => 'トウキョウト'\nprint(pref.area); // => '関東'\nprint(pref.type); // => '都'\n```\n\n### Find a Japanese prefecture by prefecture name.\n\n```dart\nfinal pref = JpPrefecture.findByName('東京都');\nif (pref == null) {\n return;\n}\nprint(pref.code); // => 13\nprint(pref.name); // => '東京都'\nprint(pref.nameE); // => 'Tokyo'\nprint(pref.nameH); // => 'とうきょうと'\nprint(pref.nameK); // => 'トウキョウト'\nprint(pref.area); // => '関東'\nprint(pref.type); // => '都'\n```\n\n### Get all Japanese prefectures.\n\n```dart\nfinal prefs = JpPrefecture.all;\nprint(prefs.first.code); // => 1\nprint(prefs.first.name); // => '北海道'\nprint(prefs.first.nameE); // => 'Hokkaido'\nprint(prefs.first.nameH); // => 'ほっかいどう'\nprint(prefs.first.nameK); // => 'ホッカイドウ'\nprint(prefs.first.area); // => '北海道'\nprint(prefs.first.type); // => '道'\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":"markdown"},"label":{"kind":"number","value":3,"string":"3"},"text":{"kind":"string","value":"# jp_prefecture\n\nA library that converts Japanese prefecture codes and prefecture names.\n\n## Usage\n\n### Find a Japanese prefecture by prefecture code.\n\n```dart\nfinal pref = JpPrefecture.findByCode(13);\nif (pref == null) {\n return;\n}\nprint(pref.code); // => 13\nprint(pref.name); // => '東京都'\nprint(pref.nameE); // => 'Tokyo'\nprint(pref.nameH); // => 'とうきょうと'\nprint(pref.nameK); // => 'トウキョウト'\nprint(pref.area); // => '関東'\nprint(pref.type); // => '都'\n```\n\n### Find a Japanese prefecture by prefecture name.\n\n```dart\nfinal pref = JpPrefecture.findByName('東京都');\nif (pref == null) {\n return;\n}\nprint(pref.code); // => 13\nprint(pref.name); // => '東京都'\nprint(pref.nameE); // => 'Tokyo'\nprint(pref.nameH); // => 'とうきょうと'\nprint(pref.nameK); // => 'トウキョウト'\nprint(pref.area); // => '関東'\nprint(pref.type); // => '都'\n```\n\n### Get all Japanese prefectures.\n\n```dart\nfinal prefs = JpPrefecture.all;\nprint(prefs.first.code); // => 1\nprint(prefs.first.name); // => '北海道'\nprint(prefs.first.nameE); // => 'Hokkaido'\nprint(prefs.first.nameH); // => 'ほっかいどう'\nprint(prefs.first.nameK); // => 'ホッカイドウ'\nprint(prefs.first.area); // => '北海道'\nprint(prefs.first.type); // => '道'\n```\n"}}},{"rowIdx":320,"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 owner::Owner;\nuse vec2::Vec2;\n\npub type UnitId = usize;\n\n#[derive(Clone, Debug)]\npub struct Unit {\n // Generic\n pub id: UnitId,\n pub kind: UnitType,\n pub owner: Owner,\n pub pos: Vec2,\n pub health: i64,\n \n // Specific\n pub resources: i64\n}\n\nimpl Unit {\n pub fn new(owner: Owner, pos: Vec2, kind: UnitType) -> Unit {\n Unit {\n id: 0,\n kind: kind,\n owner: owner,\n pos: pos,\n health: kind.max_health(),\n resources: 0\n }\n }\n}\n\npub type UnitTypeId = usize;\n\n#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]\npub enum UnitType {\n Worker\n}\n\nimpl UnitType {\n pub fn to_id(self) -> UnitTypeId {\n match self {\n UnitType::Worker => 0\n }\n }\n \n pub fn from_id(id: UnitTypeId) -> Option {\n Some(match id {\n 0 => UnitType::Worker,\n _ => { return None; }\n })\n }\n\n pub fn max_health(self) -> i64 {\n match self {\n UnitType::Worker => 15\n }\n }\n\n pub fn radius(self) -> f64 {\n match self {\n UnitType::Worker => 15.\n }\n }\n\n pub fn speed(self) -> f64 {\n match self {\n UnitType::Worker => 10.\n }\n }\n\n pub fn cost(self) -> i64 {\n match self {\n UnitType::Worker => 50\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":"rust"},"label":{"kind":"number","value":3,"string":"3"},"text":{"kind":"string","value":"use owner::Owner;\nuse vec2::Vec2;\n\npub type UnitId = usize;\n\n#[derive(Clone, Debug)]\npub struct Unit {\n // Generic\n pub id: UnitId,\n pub kind: UnitType,\n pub owner: Owner,\n pub pos: Vec2,\n pub health: i64,\n \n // Specific\n pub resources: i64\n}\n\nimpl Unit {\n pub fn new(owner: Owner, pos: Vec2, kind: UnitType) -> Unit {\n Unit {\n id: 0,\n kind: kind,\n owner: owner,\n pos: pos,\n health: kind.max_health(),\n resources: 0\n }\n }\n}\n\npub type UnitTypeId = usize;\n\n#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]\npub enum UnitType {\n Worker\n}\n\nimpl UnitType {\n pub fn to_id(self) -> UnitTypeId {\n match self {\n UnitType::Worker => 0\n }\n }\n \n pub fn from_id(id: UnitTypeId) -> Option {\n Some(match id {\n 0 => UnitType::Worker,\n _ => { return None; }\n })\n }\n\n pub fn max_health(self) -> i64 {\n match self {\n UnitType::Worker => 15\n }\n }\n\n pub fn radius(self) -> f64 {\n match self {\n UnitType::Worker => 15.\n }\n }\n\n pub fn speed(self) -> f64 {\n match self {\n UnitType::Worker => 10.\n }\n }\n\n pub fn cost(self) -> i64 {\n match self {\n UnitType::Worker => 50\n }\n }\n}\n"}}},{"rowIdx":321,"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.nambv.demo.newsappdemo.ui.common\n\nimport androidx.recyclerview.widget.DiffUtil\nimport androidx.recyclerview.widget.ListAdapter\n\nabstract class BaseAdapter(diffCallback: DiffUtil.ItemCallback) :\n ListAdapter(diffCallback)\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.nambv.demo.newsappdemo.ui.common\n\nimport androidx.recyclerview.widget.DiffUtil\nimport androidx.recyclerview.widget.ListAdapter\n\nabstract class BaseAdapter(diffCallback: DiffUtil.ItemCallback) :\n ListAdapter(diffCallback)"}}},{"rowIdx":322,"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\r\n \r\n \r\n Home Monitoring Equipment Charleston SC\r\n\t\r\n \r\n\t\r\n\r\n
\r\n
\r\n
\r\n
\r\n \r\n\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n Are You Looking To Get a Home Security System Installed?\r\n

Compare Price Quotes & Save Upto 35%. Its Simple, fast and free.

\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n Home

Home Monitoring Equipment in Charleston SC

\n

\n\n

\n

Request Free Quotes For Home Security System

\n

Just\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":"\r\n\r\n\r\n\r\n \r\n \r\n Home Monitoring Equipment Charleston SC\r\n\t\r\n \r\n\t\r\n\r\n

\r\n
\r\n
\r\n
\r\n \r\n\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n Are You Looking To Get a Home Security System Installed?\r\n

Compare Price Quotes & Save Upto 35%. Its Simple, fast and free.

\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n Home

Home Monitoring Equipment in Charleston SC

\n

\n\n

\n

Request Free Quotes For Home Security System

\n

Just fill out the simple form below and local representative will be in touch shortly

\n\n\n\n\n
\n

Your home, since it can be quieted from your telephone lines meaning that even if you have actually 2 set up within a specific zone of some executions, a classification is beneficial as this is easily available along with the aid you style and establish timely resourcesAFB is likewise happy tohouse the Helen Keller Archives and 50% off the add on lowNow we don't get any AI driven functions based on over the morning the method of supplying your home or put out the fire. The Wyze Webcam can also catch video to the cloud, but the totally free account is restricted to 12-second clips every 5 minutes. That means the camera will wait 5 minutes before it has the ability to record once again, which implies you might be missing a lot. Wyze's recently released Complete Motion Capture solves this problem for $1.50 each month per camera. It makes it possible for recording of all motion the camera senses, for up to five minutes in a row. If motion continues beyond that window, the camera ends one clip and quickly begins another, with no spaces in between. Recordings are simple to find under the Occasions tab at the bottom of the app. Without the membership, you still get the limited cloud recording and microSD recording, but we don't recommend that for home security due to the fact that if it's taken, you do not have a backup.

\n

Contact the ISG today to read more about our video surveillance and security camera options. Alarm Relay controls whatever from our In-house Specialist Monitoring Station. We pick each representative carefully, and we treat your home security as if it were our own. This means you get an instant action from a genuine person. Every minute. Every day. Guaranteed. A few minutes into the DIY installation, our tester got stuck getting her control panel up and online-- it just wouldn't link. An aid window popped up with a number to call, and a Frontpoint representative helped her troubleshoot the connection. After about 10 minutes, he could tell there was a problem with the circuit board. Definitely not ideal-- however the representative asked forgiveness and delivered her replacement control panel overnight.

\n

Video Surveillance And Privacy Rights Charleston

\n

Equipment includes things like your door and window sensing units, motion sensors, control board, and so on. The cost completely depends on which provider you select, but expect to pay a few hundred dollars for a basic bundle--$ 200 would be considered cheap for a starter pack of home security equipment. That stated, it can run cheaper if you go with a company that runs a lot of offers on equipment (like Frontpoint). Last but not least, the ADT Pulse + Smart Home Connect bundle let you control all your clever home equipment through a single app. That's a hassle-free way to incorporate a wise home system.

\n

Mentioning recordings, BT are decidedly generous with their cloud-based storage. You get one month of complimentary recordings conserved to the cloud from whenever the camera spots motion, allowing you to pull whatever you desire. Or you can slot in an SD card and conserve everything (up until you run out of space, obviously) In addition, you get notices sent to your mobile whenever motion is spotted and you can by hand record videos to your camera reel from there.

\n

Storage: We restricted our screening to cameras with cloud storage, whether it's free or for a regular monthly fee. Local storage on a microSD card is also good to have; feel in one's bones that locally kept footage can be taken if someone notices the camera. With wise home combination, simple installation, and a discreet appearance, an increasing number of house owners go with the benefit of a wireless home security system. Plus, SimpliSafe is adept on the equipment front. You can discover everything from window sensing units to leakage detectors to carbon monoxide sensors.

\n

Outdoor Surveillance Camera in Charleston SC

\n

Video surveillance system monitoring goes beyond the standard surveillance system by enabling trained professionals to respond to an occurrence in real-time. Live feed from your cameras is monitored by either trained in-house staff members or expert and specific security company. If you have high-risk and valuable products, it's a good idea to work with a skilled company with highly-trained professionals to deal with surveillance monitoring activities. They tend to take notice of detail and are equipped with the necessary abilities to deal with any security scenario.

\n

Video surveillance monitoring is as old as the extremely principle of camera surveillance. Video surveillance has actually come a long method, spanning several decades. The very first video surveillance system was a Closed-Circuit Television (CCTV) set up in 1942 by German scientists to monitor the launch of rockets. The innovation slowly developed into the highly advanced yet cost effective systems readily available today. The very first usages of CCTV cameras needed monitoring the feed in real-time - i.e., they did not have the methods to tape video and watch it later on. Although video surveillance was monitored out of need in the early days, nowadays it is an intentional practice to improve the result of security systems.

\n

PTZ cameras can rapidly pan left to right, tilt up and down, and zoom in on items. With customized pre-programmed capabilities, you can quickly see areas of interest like your parking area, front entrance, or high-traffic areas. The Town of Mamaroneck needs an \"Alarm User License\" for all facilities geared up with alarm devices. Applications can be submitted at the Town Clerk's office. The application charge is $30. Built with a compact design and a long range WiFi antenna, the cameras can be put practically anywhere. Plug in your cameras to a neighboring source of power and set them up near your entrances inside or outside to monitor what is happening around the night, house or day.

\n

With a kid en route, you may wish to add a camera to your nursery - no issue. When your kids become more mobile, you can add extra sensors to kitchen area cabinets or the freezer. If you're taking a trip more for business and require to work with a petsitter, it's simple to include a wise lock to let them go and come. Vivint's monitoring charges are in line with our other top security companies, which is impressive given the sophisticated exclusive equipment and services that include a Vivint home security system. We likewise like that Vivint gives you the choice to buy your equipment outright, which suggests you're off the hook for a long-term agreement-- however that does require a significant up-front payment.

\n

Local Home Security Companies in South Carolina

\n

For those on a budget, we recommend the Wyze Web cam 1080p for indoor use. It costs about $25, yet has an unexpected number of features for the price, and offers you 14 days of rolling cloud storage totally free. Fast forward and today, customers have smart devices, home networks and wireless innovation-- all of which the smart alarm system can make use of. People can buy door sensing units to discover if someone is outside or door locks that can be monitored and possibly controlled from one's cellular phone.

\n

Prices - ADT uses three separate packages, which vary in terms of options supplied. The basic home security bundle is $28.99 per month. Home automation and control expenses around $36.99 and video services come in at $52.99. Installation and other charges may apply. Contractually, this is a 3-year agreement with a six-month trial. Fortunately is this suggests ADT accepts cancellations without penalty for the very first 6 months - however only if the company stops working to deal with any installation or service-related concerns. If you're not able to prove this, early cancellation costs apply.

\n

Home Surveillance Cameras Charleston SC 29412

\n

Digital Watchdog - Digital Watchdog offers a vast array of both IP and analog security cameras, with recorders, network gadgets, software, and mobile apps specifically created for both types. Their website's item selector permits you to compare approximately 4 designs at the same time, assisting you to narrow down their vast array of items based upon your security needs. You can also use their quote builder for pricing help and their calculator tools to identify how much bandwidth and storage you'll require for their different camera alternatives.

\n

You can choose from SimpliSafe's original award-winning system or their latest line of equipment. Both systems offer impressive, reliable home security. With the more recent system, you will pay more, but that higher price includes a system that is smaller, faster, and stronger. At half the size of the initial system, the tiny sensing units are almost invisible. The new system works 5 times much faster, and the alarm is 50% louder to frighten intruders.

\n

Houston clients have actually been putting their safety in the hands of Fort Knox ® Home Security for over 40 years. As a company based in Texas and committed to Texas clients, we comprehend the private requirements of customers throughout the state. Fort Knox ® has worked hard to get a good track record with our Houston consumers as a company with low rates and fast response times, thanks to our professionals with 20+ years of experience, and our company-owned monitoring center.

\n

\n \n

\n
\n Smart Home Security System Charleston South Carolina\n
\n Rated 4.9/5 based on 317 reviews.
\n
Previous     Next\n
Areas Around Charleston South Carolina
Best Alarm Systems Redlands CA
CCTV Security System Edmonds WA
Intrusion Alarm System Ogden UT
Security Monitoring Companies Elgin IL
Home Burglar Alarm Systems Yucaipa CA
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n \r\n\r\n \r\n"}}},{"rowIdx":323,"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 com.wukong.hezhi.ui.view;\n\nimport android.annotation.TargetApi;\nimport android.app.Activity;\nimport android.content.Context;\nimport android.content.res.TypedArray;\nimport android.graphics.Bitmap;\nimport android.graphics.BitmapFactory;\nimport android.graphics.Matrix;\nimport android.graphics.Rect;\nimport android.graphics.RectF;\nimport android.hardware.Camera;\nimport android.hardware.Camera.Parameters;\nimport android.hardware.Camera.ShutterCallback;\nimport android.media.MediaRecorder;\nimport android.media.MediaRecorder.AudioEncoder;\nimport android.media.MediaRecorder.AudioSource;\nimport android.media.MediaRecorder.OnErrorListener;\nimport android.media.MediaRecorder.OutputFormat;\nimport android.media.MediaRecorder.VideoEncoder;\nimport android.media.MediaRecorder.VideoSource;\nimport android.os.Build;\nimport android.util.AttributeSet;\nimport android.util.Log;\nimport android.view.LayoutInflater;\nimport android.view.MotionEvent;\nimport android.view.SurfaceHolder;\nimport android.view.SurfaceHolder.Callback;\nimport android.view.SurfaceView;\nimport android.view.View;\nimport android.view.View.OnClickListener;\nimport android.widget.ImageView;\nimport android.widget.LinearLayout;\nimport android.widget.ProgressBar;\n\nimport com.scan.lib.camera.PictureCallback;\nimport com.wukong.hezhi.R;\nimport com.wukong.hezhi.constants.HezhiConfig;\nimport com.wukong.hezhi.utils.BitmapCompressUtil;\nimport com.wukong.hezhi.utils.FileUtil;\nimport com.wukong.hezhi.utils.PermissionUtil;\nimport com.wukong.hezhi.utils.ScreenUtil;\nimport com.wukong.hezhi.utils.ThreadUtil;\nimport com.wukong.hezhi.utils.ViewShowAniUtil;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.Comparator;\nimport java.util.List;\nimport java.util.Timer;\nimport java.util.TimerTask;\n\n@SuppressWarnings(\"deprecation\")\npublic class MovieRecorderView extends LinearLayout implements OnErrorListener, OnClickListener {\n\tprivate static final String LOG_TAG = \"Mov\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":"package com.wukong.hezhi.ui.view;\n\nimport android.annotation.TargetApi;\nimport android.app.Activity;\nimport android.content.Context;\nimport android.content.res.TypedArray;\nimport android.graphics.Bitmap;\nimport android.graphics.BitmapFactory;\nimport android.graphics.Matrix;\nimport android.graphics.Rect;\nimport android.graphics.RectF;\nimport android.hardware.Camera;\nimport android.hardware.Camera.Parameters;\nimport android.hardware.Camera.ShutterCallback;\nimport android.media.MediaRecorder;\nimport android.media.MediaRecorder.AudioEncoder;\nimport android.media.MediaRecorder.AudioSource;\nimport android.media.MediaRecorder.OnErrorListener;\nimport android.media.MediaRecorder.OutputFormat;\nimport android.media.MediaRecorder.VideoEncoder;\nimport android.media.MediaRecorder.VideoSource;\nimport android.os.Build;\nimport android.util.AttributeSet;\nimport android.util.Log;\nimport android.view.LayoutInflater;\nimport android.view.MotionEvent;\nimport android.view.SurfaceHolder;\nimport android.view.SurfaceHolder.Callback;\nimport android.view.SurfaceView;\nimport android.view.View;\nimport android.view.View.OnClickListener;\nimport android.widget.ImageView;\nimport android.widget.LinearLayout;\nimport android.widget.ProgressBar;\n\nimport com.scan.lib.camera.PictureCallback;\nimport com.wukong.hezhi.R;\nimport com.wukong.hezhi.constants.HezhiConfig;\nimport com.wukong.hezhi.utils.BitmapCompressUtil;\nimport com.wukong.hezhi.utils.FileUtil;\nimport com.wukong.hezhi.utils.PermissionUtil;\nimport com.wukong.hezhi.utils.ScreenUtil;\nimport com.wukong.hezhi.utils.ThreadUtil;\nimport com.wukong.hezhi.utils.ViewShowAniUtil;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.Comparator;\nimport java.util.List;\nimport java.util.Timer;\nimport java.util.TimerTask;\n\n@SuppressWarnings(\"deprecation\")\npublic class MovieRecorderView extends LinearLayout implements OnErrorListener, OnClickListener {\n\tprivate static final String LOG_TAG = \"MovieRecorderView\";\n\n\tprivate Context context;\n\n\tprivate SurfaceView surfaceView;\n\tprivate SurfaceHolder surfaceHolder;\n\tprivate ImageView change_camera_iv;\n\tprivate ProgressBar progressBar;\n\n\tprivate MediaRecorder mediaRecorder;\n\tprivate Camera camera;\n\tprivate Timer timer;// 计时器\n\n\tprivate int mWidth;// 视频录制分辨率宽度\n\tprivate int mHeight;// 视频录制分辨率高度\n\tprivate boolean isOpenCamera;// 是否一开始就打开摄像头\n\tprivate int recordMaxTime;// 最长拍摄时间\n\tprivate int timeCount;// 时间计数\n\tprivate File recordFile = null;// 视频文件\n\tprivate long sizePicture = 0;\n\t/** 手机拍摄时旋转的角度(屏幕朝脸,顺时针旋转) */\n\tprivate int angle = 0;\n\n\tpublic MovieRecorderView(Context context) {\n\t\tthis(context, null);\n\t}\n\n\tpublic MovieRecorderView(Context context, AttributeSet attrs) {\n\t\tthis(context, attrs, 0);\n\t}\n\n\t@TargetApi(Build.VERSION_CODES.HONEYCOMB)\n\tpublic MovieRecorderView(Context context, AttributeSet attrs, int defStyle) {\n\t\tsuper(context, attrs, defStyle);\n\t\tthis.context = context;\n\n\t\tTypedArray a = context.obtainStyledAttributes(attrs, R.styleable.MovieRecorderView, defStyle, 0);\n\t\tmWidth = a.getInteger(R.styleable.MovieRecorderView_record_width, 640);// 默认640\n\t\tmHeight = a.getInteger(R.styleable.MovieRecorderView_record_height, 360);// 默认360\n\n\t\tisOpenCamera = a.getBoolean(R.styleable.MovieRecorderView_is_open_camera, true);// 默认打开摄像头\n\t\trecordMaxTime = a.getInteger(R.styleable.MovieRecorderView_record_max_time, 11);// 默认最大拍摄时间为10s\n\n\t\tLayoutInflater.from(context).inflate(R.layout.layout_video, this);\n\t\tsurfaceView = (SurfaceView) findViewById(R.id.surface_view);\n\t\tchange_camera_iv = (ImageView) findViewById(R.id.change_camera_iv);\n\t\tchange_camera_iv.setOnClickListener(this);\n\t\t// TODO 需要用到进度条,打开此处,也可以自己定义自己需要的进度条,提供了拍摄进度的接口\n\t\tprogressBar = (ProgressBar) findViewById(R.id.progress_bar);\n\t\tprogressBar.setMax(recordMaxTime);// 设置进度条最大量\n\t\tsurfaceHolder = surfaceView.getHolder();\n\t\tsurfaceHolder.addCallback(new CustomCallBack());\n\t\tsurfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);\n\n\t\ta.recycle();\n\t}\n\n\t/**\n\t * SurfaceHolder回调\n\t */\n\tprivate class CustomCallBack implements Callback {\n\t\t@Override\n\t\tpublic void surfaceCreated(SurfaceHolder holder) {\n\t\t\tif (!isOpenCamera)\n\t\t\t\treturn;\n\t\t\ttry {\n\t\t\t\tinitCamera();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t\t@Override\n\t\tpublic void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {\n\n\t\t}\n\n\t\t@Override\n\t\tpublic void surfaceDestroyed(SurfaceHolder holder) {\n\t\t\tif (!isOpenCamera)\n\t\t\t\treturn;\n\t\t\tfreeCameraResource();\n\t\t}\n\t}\n\n\t/**\n\t * 初始化摄像头\n\t */\n\tpublic void initCamera() throws IOException {\n\t\tsetCameraVisible(true);// 重置后摄像头可以翻转\n\t\tif (camera != null) {\n\t\t\tfreeCameraResource();\n\t\t}\n\t\ttry {\n\t\t\tif (!checkCameraFacing(Camera.CameraInfo.CAMERA_FACING_FRONT)) {\n\t\t\t\tcamera = Camera.open(Camera.CameraInfo.CAMERA_FACING_FRONT);// TODO\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 默认打开前置摄像头\n\t\t\t} else if (checkCameraFacing(Camera.CameraInfo.CAMERA_FACING_BACK)) {\n\t\t\t\tcamera = Camera.open(Camera.CameraInfo.CAMERA_FACING_BACK);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tfreeCameraResource();\n\t\t\t((Activity) context).finish();\n\t\t}\n\t\tif (camera == null)\n\t\t\treturn;\n\n\t\tsetCameraParams();\n\t\tcamera.setDisplayOrientation(90);\n\t\tcamera.setPreviewDisplay(surfaceHolder);\n\t\tcamera.startPreview();\n\t}\n\n\tboolean cameraBack = true;\n\n\tpublic void changeCamera() {\n\t\tsetCameraVisible(true);// 重置后摄像头可以翻转\n\t\tif (camera != null) {\n\t\t\tfreeCameraResource();\n\t\t}\n\t\ttry {\n\t\t\tif (cameraBack) {\n\t\t\t\tcamera = Camera.open(Camera.CameraInfo.CAMERA_FACING_FRONT);// 默认打开前置摄像头\n\t\t\t\tcameraBack = false;\n\t\t\t} else {\n\t\t\t\tcamera = Camera.open(Camera.CameraInfo.CAMERA_FACING_BACK);\n\t\t\t\tcameraBack = true;\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tfreeCameraResource();\n\t\t\t((Activity) context).finish();\n\t\t}\n\t\tif (camera == null)\n\t\t\treturn;\n\t\tsetCameraParams();\n\t\ttry {\n\t\t\tcamera.setDisplayOrientation(90);\n\t\t\tcamera.setPreviewDisplay(surfaceHolder);\n\t\t\tcamera.startPreview();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}\n\n\t/** 设置摄像头按钮的显示状态 */\n\tprivate void setCameraVisible(boolean isChangable) {\n\t\tif (change_camera_iv != null) {\n\t\t\tif (isChangable) {\n\t\t\t\tViewShowAniUtil.playAni(change_camera_iv, true);\n\t\t\t} else {\n\t\t\t\tViewShowAniUtil.playAni(change_camera_iv, false);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * 检查是否有摄像头\n\t *\n\t * @param facing\n\t * 前置还是后置\n\t * @return\n\t */\n\tprivate boolean checkCameraFacing(int facing) {\n\t\tint cameraCount = Camera.getNumberOfCameras();\n\t\tCamera.CameraInfo info = new Camera.CameraInfo();\n\t\tfor (int i = 0; i < cameraCount; i++) {\n\t\t\tCamera.getCameraInfo(i, info);\n\t\t\tif (facing == info.facing) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tParameters params;\n\n\t/**\n\t * 设置摄像头为竖屏\n\t */\n\tprivate void setCameraParams() {\n\t\tif (camera != null) {\n\t\t\tparams = camera.getParameters();\n\t\t\tparams.set(\"orientation\", \"portrait\");\n\t\t\tparams.setZoom(1);\n\t\t\tsetPreviewSize();\n\t\t\t// 手机支持的最大像素\n\t\t\tList supportedPictureSizes = params.getSupportedPictureSizes();\n\t\t\tfor (Camera.Size size : supportedPictureSizes) {\n\t\t\t\tsizePicture = (size.height * size.width) > sizePicture ? size.height * size.width : sizePicture;\n\t\t\t}\n\n\t\t\t// 实现Camera自动对焦\n\t\t\tList focusModes = params.getSupportedFocusModes();\n\t\t\tif (focusModes != null) {\n\t\t\t\tfor (String mode : focusModes) {\n\t\t\t\t\tmode.contains(\"continuous-video\");\n\t\t\t\t\tparams.setFocusMode(\"continuous-video\");\n\t\t\t\t}\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tcamera.setParameters(params);\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO: handle exception\n\t\t\t}\n\n\t\t}\n\t}\n\n\t/**\n\t * 根据手机支持的视频分辨率,设置预览尺寸\n\t */\n\tprivate void setPreviewSize() {\n\t\tif (camera == null) {\n\t\t\treturn;\n\t\t}\n\t\t// 获取手机支持的分辨率集合,并以宽度为基准降序排序\n\t\tList previewSizes = params.getSupportedPreviewSizes();\n\t\tCollections.sort(previewSizes, new Comparator() {\n\t\t\t@Override\n\t\t\tpublic int compare(Camera.Size lhs, Camera.Size rhs) {\n\t\t\t\tif (lhs.width > rhs.width) {\n\t\t\t\t\treturn -1;\n\t\t\t\t} else if (lhs.width == rhs.width) {\n\t\t\t\t\treturn 0;\n\t\t\t\t} else {\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tfloat tmp = 0f;\n\t\tfloat minDiff = 100f;\n\t\tfloat ratio = ScreenUtil.screenRatioW2H(); // 高宽比率最接近屏幕宽度的分辨率\n\t\tCamera.Size best = null;\n\t\tfor (Camera.Size s : previewSizes) {\n\t\t\ttmp = Math.abs(((float) s.height / (float) s.width) - ratio);\n\t\t\tLog.e(LOG_TAG, \"setPreviewSize: width:\" + s.width + \"...height:\" + s.height);\n\t\t\t// LogUtil.e(LOG_TAG,\"tmp:\" + tmp);\n\t\t\tif (tmp < minDiff) {\n\t\t\t\tminDiff = tmp;\n\t\t\t\tbest = s;\n\t\t\t}\n\t\t}\n\t\tparams.setPreviewSize(best.width, best.height);// 预览比率\n\t\tLog.e(LOG_TAG, \"setPreviewSize BestSize: width:\" + best.width + \"...height:\" + best.height);\n\t}\n\n\t/**\n\t * 根据手机支持的视频分辨率,设置录制尺寸\n\t */\n\tprivate void setVideoSize() {\n\t\tif (camera == null) {\n\t\t\treturn;\n\t\t}\n\t\t// 获取手机支持的分辨率集合,并以宽度为基准降序排序\n\t\tList previewSizes = params.getSupportedPreviewSizes();\n\t\tCollections.sort(previewSizes, new Comparator() {\n\t\t\t@Override\n\t\t\tpublic int compare(Camera.Size lhs, Camera.Size rhs) {\n\t\t\t\tif (lhs.width > rhs.width) {\n\t\t\t\t\treturn -1;\n\t\t\t\t} else if (lhs.width == rhs.width) {\n\t\t\t\t\treturn 0;\n\t\t\t\t} else {\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tfloat tmp = 0f;\n\t\tfloat minDiff = 100f;\n\t\tfloat ratio = ScreenUtil.screenRatioW2H();// 高宽比率最接近屏幕宽度的分辨率\n\t\tCamera.Size best = null;\n\t\tfor (Camera.Size s : previewSizes) {\n\t\t\ttmp = Math.abs(((float) s.height / (float) s.width) - ratio);\n\t\t\tLog.e(LOG_TAG, \"setVideoSize: width:\" + s.width + \"...height:\" + s.height);\n\t\t\tif (tmp < minDiff) {\n\t\t\t\tminDiff = tmp;\n\t\t\t\tbest = s;\n\t\t\t}\n\t\t}\n\t\tLog.e(LOG_TAG, \"setVideoSize BestSize: width:\" + best.width + \"...height:\" + best.height);\n\t\t// 设置录制尺寸\n\t\tmWidth = best.width;\n\t\tmHeight = best.height;\n\t}\n\n\t/**\n\t * 根据手机支持的照片分辨率,设置图片尺寸\n\t */\n\tprivate void setPictureSize() {\n\t\tif (camera == null) {\n\t\t\treturn;\n\t\t}\n\t\t// 获取手机支持的分辨率集合,并以宽度为基准降序排序\n\t\tList pictureSizes = params.getSupportedPictureSizes();\n\t\tCollections.sort(pictureSizes, new Comparator() {\n\t\t\t@Override\n\t\t\tpublic int compare(Camera.Size lhs, Camera.Size rhs) {\n\t\t\t\tif (lhs.width > rhs.width) {\n\t\t\t\t\treturn -1;\n\t\t\t\t} else if (lhs.width == rhs.width) {\n\t\t\t\t\treturn 0;\n\t\t\t\t} else {\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tCamera.Size best = null;\n\t\tboolean start = true;\n\t\tfor (Camera.Size s : pictureSizes) {\n\t\t\tLog.e(LOG_TAG, \"setPictureSize: width:\" + s.width + \"...height:\" + s.height);\n\t\t\tif (start && s.height < 1000) {// 选择最适合的分辨率\n\t\t\t\tstart = false;\n\t\t\t\tbest = s;\n\t\t\t}\n\t\t}\n\t\tLog.e(LOG_TAG, \"setPictureSize BestSize: width:\" + best.width + \"...height:\" + best.height);\n\t\tparams.setPictureSize(best.width, best.height);// 拍照保存比\n\t}\n\n\t/**\n\t * 释放摄像头资源\n\t */\n\tprivate void freeCameraResource() {\n\t\ttry {\n\t\t\tif (camera != null) {\n\t\t\t\tcamera.setPreviewCallback(null);\n\t\t\t\tcamera.stopPreview();\n\t\t\t\tcamera.lock();\n\t\t\t\tcamera.release();\n\t\t\t\tcamera = null;\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\tcamera = null;\n\t\t}\n\t}\n\n\tprivate String videoPath;\n\n\t/**\n\t * 创建视频文件\n\t */\n\tprivate void createRecordDir() {\n\t\tFile sampleDir = new File(HezhiConfig.VIDEO_PATH);\n\t\tif (!sampleDir.exists()) {\n\t\t\tsampleDir.mkdirs();\n\t\t}\n\t\ttry {\n\t\t\t// TODO 文件名用的时间戳,可根据需要自己设置,格式也可以选择3gp,在初始化设置里也需要修改\n\t\t\tvideoPath = HezhiConfig.VIDEO_PATH + System.currentTimeMillis() + \".mp4\";\n\t\t\trecordFile = new File(videoPath);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}\n\n\tpublic String getPath() {\n\t\treturn videoPath;\n\t}\n\n\t/**\n\t * 录制视频初始化\n\t */\n\tprivate void initRecord() throws Exception {\n\t\tmediaRecorder = new MediaRecorder();\n\t\tmediaRecorder.reset();\n\t\tif (camera != null) {\n\t\t\tcamera.unlock();\n\t\t\tmediaRecorder.setCamera(camera);\n\t\t}\n\n\t\tmediaRecorder.setOnErrorListener(this);\n\t\tmediaRecorder.setPreviewDisplay(surfaceHolder.getSurface());\n\t\tmediaRecorder.setVideoSource(VideoSource.CAMERA);// 视频源\n\t\tif (PermissionUtil.audioPermission()) {\n\t\t\tmediaRecorder.setAudioSource(AudioSource.MIC);// 音频源\n\t\t}\n\t\tmediaRecorder.setOutputFormat(OutputFormat.MPEG_4);// 视频输出格式\n\t\tif (PermissionUtil.audioPermission()) {\n\t\t\tmediaRecorder.setAudioEncoder(AudioEncoder.AAC);// 音频格式\n\t\t}\n\t\tmediaRecorder.setVideoSize(mWidth, mHeight);// 设置分辨率\n\n\t\tif (sizePicture < 5000000) {// 这里设置可以调整清晰度\n\t\t\tmediaRecorder.setVideoEncodingBitRate(5 * 1024 * 512);\n\t\t} else if (sizePicture < 10000000) {\n\t\t\tmediaRecorder.setVideoEncodingBitRate(15 * 1024 * 512);\n\t\t} else {\n\t\t\tmediaRecorder.setVideoEncodingBitRate(25 * 1024 * 512);\n\t\t}\n\n\t\tif (cameraBack) {\n\t\t\tmediaRecorder.setOrientationHint(getBackCameraAngle());\n\t\t} else {\n\t\t\tmediaRecorder.setOrientationHint(getFrontCameraAngle());\n\t\t}\n\n\t\tmediaRecorder.setVideoEncoder(VideoEncoder.H264);// 视频录制格式\n\t\t// mediaRecorder.setMaxDuration(Constant.MAXVEDIOTIME * 1000);\n\t\tmediaRecorder.setOutputFile(recordFile.getAbsolutePath());\n\t\tmediaRecorder.prepare();\n\t\tmediaRecorder.start();\n\t}\n\n\tpublic void record(int angle) {\n\t\tthis.angle = angle;\n\t\trecord(null);\n\t}\n\n\t/** 后置摄像头,输出录像/照片旋转的角度 */\n\tprivate int getBackCameraAngle() {\n\t\treturn 90 + angle == 360 ? 0 : 90 + angle;\n\t}\n\n\t/** 前置摄像头,输出录像/照片旋转的角度 */\n\tprivate int getFrontCameraAngle() {\n\t\treturn 270 - angle;\n\t}\n\n\t/**\n\t * 开始录制视频\n\t *\n\t * @param onRecordFinishListener\n\t * 达到指定时间之后回调接口\n\t */\n\tpublic void record(final OnRecordFinishListener onRecordFinishListener) {\n\t\tif (onRecordFinishListener == null) {\n\t\t\tthis.onRecordFinishListener = new OnRecordFinishListener() {\n\n\t\t\t\t@Override\n\t\t\t\tpublic void onRecordFinish() {\n\t\t\t\t\t// TODO Auto-generated method stub\n\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\tthis.onRecordFinishListener = onRecordFinishListener;\n\t\tsetVideoSize();\n\t\tsetCameraVisible(false);// 录制中禁止翻转摄像头\n\t\tcreateRecordDir();\n\t\ttry {\n\t\t\tif (!isOpenCamera) {// 如果未打开摄像头,则打开\n\t\t\t\tinitCamera();\n\t\t\t}\n\t\t\tinitRecord();\n\t\t\ttimeCount = 0;// 时间计数器重新赋值\n\t\t\ttimer = new Timer();\n\t\t\ttimer.schedule(new TimerTask() {\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\ttimeCount++;\n\t\t\t\t\tprogressBar.setProgress(timeCount);// 设置进度条\n\t\t\t\t\tif (onRecordProgressListener != null) {\n\t\t\t\t\t\tonRecordProgressListener.onProgressChanged(recordMaxTime, timeCount);\n\t\t\t\t\t}\n\n\t\t\t\t\t// 达到指定时间,停止拍摄\n\t\t\t\t\tif (timeCount == recordMaxTime) {\n\t\t\t\t\t\tstop();\n\t\t\t\t\t\tif (MovieRecorderView.this.onRecordFinishListener != null)\n\t\t\t\t\t\t\tMovieRecorderView.this.onRecordFinishListener.onRecordFinish();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, 0, 1000);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tif (mediaRecorder != null) {\n\t\t\t\tmediaRecorder.release();\n\t\t\t}\n\t\t\tfreeCameraResource();\n\t\t}\n\t}\n\n\t/** 拍照 */\n\tpublic void photo(int angle, PhotoCallback photoCallback) {\n\t\tthis.angle = angle;\n\t\tif (photoCallback == null) {\n\t\t\tthis.photoCallback = new PhotoCallback() {\n\n\t\t\t\t@Override\n\t\t\t\tpublic void onSucess(String path) {\n\t\t\t\t\t// TODO Auto-generated method stub\n\n\t\t\t\t}\n\n\t\t\t\t@Override\n\t\t\t\tpublic void onFail(String msg) {\n\t\t\t\t\t// TODO Auto-generated method stub\n\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\tthis.photoCallback = photoCallback;\n\t\tsetPictureSize();\n\t\tsetCameraVisible(false);// 录制中禁止翻转摄像头\n\t\tif (camera != null) {\n\t\t\ttry {\n\t\t\t\tcamera.setParameters(params);\n\t\t\t\tcamera.takePicture(shutterCallback, null, pictureCallback);\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate ShutterCallback shutterCallback = new ShutterCallback() {\n\n\t\t@Override\n\t\tpublic void onShutter() { // 不做任何处理,会发出系统快门声音\n\n\t\t}\n\t};\n\n\tpublic interface PhotoCallback {\n\t\tvoid onSucess(String path);\n\n\t\tvoid onFail(String msg);\n\t}\n\n\tprivate PhotoCallback photoCallback;\n\tprivate Bitmap bitmapBottomCompress = null;// 压缩后的图片\n\t// 创建一个PictureCallback对象,并实现其中的onPictureTaken方法\n\tprivate PictureCallback pictureCallback = new PictureCallback() {\n\t\t// 该方法用于处理拍摄后的照片数据\n\t\t@Override\n\t\tpublic void onPictureTaken(byte[] data, Camera camera) {\n\t\t\t// 停止照片拍摄\n\t\t\ttry {\n\t\t\t\tcamera.stopPreview();\n\t\t\t} catch (Exception e) {\n\t\t\t\tphotoCallback.onFail(\"拍照失败\");\n\t\t\t}\n\t\t\tif (data == null) {\n\t\t\t\tphotoCallback.onFail(\"拍照失败\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfinal byte[] dt = data;\n\t\t\tnew Thread(new Runnable() {\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tBitmap photo = BitmapFactory.decodeByteArray(dt, 0, dt.length);\n\t\t\t\t\tBitmap bitmapBottomCompress = BitmapCompressUtil.compress(photo);// 压缩后的图片后再旋转,否则容易内存溢出\n\t\t\t\t\tMatrix m = new Matrix();\n\t\t\t\t\tif (cameraBack) {// 如果是后置摄像头,将图片顺时针旋转90度\n\t\t\t\t\t\tm.setRotate(getBackCameraAngle(), (float) bitmapBottomCompress.getWidth() / 2,\n\t\t\t\t\t\t\t\t(float) bitmapBottomCompress.getHeight() / 2);\n\t\t\t\t\t} else {// 如果是后置摄像头,将图片顺时针旋转270度\n\t\t\t\t\t\tm.setRotate(getFrontCameraAngle(), (float) bitmapBottomCompress.getWidth() / 2,\n\t\t\t\t\t\t\t\t(float) bitmapBottomCompress.getHeight() / 2);\n\t\t\t\t\t}\n\t\t\t\t\tBitmap bmRotate = Bitmap.createBitmap(bitmapBottomCompress, 0, 0, bitmapBottomCompress.getWidth(),\n\t\t\t\t\t\t\tbitmapBottomCompress.getHeight(), m, true);// 旋转后的图片\n\t\t\t\t\tfinal String picPath = FileUtil.saveBitmap2File(bmRotate, HezhiConfig.PIC_PATH,\n\t\t\t\t\t\t\tSystem.currentTimeMillis() + \".png\");// 保存图片\n\t\t\t\t\tThreadUtil.runOnUiThread(new Runnable() {\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\tphotoCallback.onSucess(picPath);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t}\n\t\t\t}).start();\n\t\t}\n\t};\n\n\t/**\n\t * 停止拍摄\n\t */\n\tpublic void stop() {\n\t\tstopRecord();\n\t\treleaseRecord();\n\t\tfreeCameraResource();\n\t}\n\n\t/**\n\t * 停止录制\n\t */\n\tpublic void stopRecord() {\n\t\tprogressBar.setProgress(0);\n\t\tif (timer != null)\n\t\t\ttimer.cancel();\n\t\tif (mediaRecorder != null) {\n\t\t\tmediaRecorder.setOnErrorListener(null);// 设置后防止崩溃\n\t\t\tmediaRecorder.setPreviewDisplay(null);\n\t\t\ttry {\n\t\t\t\tmediaRecorder.stop();\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * 释放资源\n\t */\n\tprivate void releaseRecord() {\n\t\tif (mediaRecorder != null) {\n\t\t\tmediaRecorder.setOnErrorListener(null);\n\t\t\ttry {\n\t\t\t\tmediaRecorder.release();\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\tmediaRecorder = null;\n\t}\n\n\t/**\n\t * 获取当前录像时间\n\t *\n\t * @return timeCount\n\t */\n\tpublic int getTimeCount() {\n\t\treturn timeCount;\n\t}\n\n\t/**\n\t * 设置最大录像时间\n\t *\n\t * @param recordMaxTime\n\t */\n\tpublic void setRecordMaxTime(int recordMaxTime) {\n\t\tthis.recordMaxTime = recordMaxTime;\n\t}\n\n\t/**\n\t * 返回录像文件\n\t *\n\t * @return recordFile\n\t */\n\tpublic File getRecordFile() {\n\t\treturn recordFile;\n\t}\n\n\t/**\n\t * 录制完成监听\n\t */\n\tprivate OnRecordFinishListener onRecordFinishListener;\n\n\t/**\n\t * 录制完成接口\n\t */\n\tpublic interface OnRecordFinishListener {\n\t\tvoid onRecordFinish();\n\t}\n\n\t/**\n\t * 录制进度监听\n\t */\n\tprivate OnRecordProgressListener onRecordProgressListener;\n\n\t/**\n\t * 设置录制进度监听\n\t *\n\t * @param onRecordProgressListener\n\t */\n\tpublic void setOnRecordProgressListener(OnRecordProgressListener onRecordProgressListener) {\n\t\tthis.onRecordProgressListener = onRecordProgressListener;\n\t}\n\n\t/**\n\t * 录制进度接口\n\t */\n\tpublic interface OnRecordProgressListener {\n\t\t/**\n\t\t * 进度变化\n\t\t *\n\t\t * @param maxTime\n\t\t * 最大时间,单位秒\n\t\t * @param currentTime\n\t\t * 当前进度\n\t\t */\n\t\tvoid onProgressChanged(int maxTime, int currentTime);\n\t}\n\n\t@Override\n\tpublic void onError(MediaRecorder mr, int what, int extra) {\n\t\ttry {\n\t\t\tif (mr != null)\n\t\t\t\tmr.reset();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}\n\n\t@Override\n\tpublic void onClick(View v) {\n\t\t// TODO Auto-generated method stub\n\t\tswitch (v.getId()) {\n\t\tcase R.id.change_camera_iv:\n\t\t\tchangeCamera();\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t@Override\n\tpublic boolean onTouchEvent(MotionEvent event) {\n\t\tif (event.getPointerCount() == 1) {\n\t\t\thandleFocusMetering(event, camera);\n\t\t}\n\t\treturn super.onTouchEvent(event);\n\t}\n\n\tprivate String TAG = \"MovieRecorderView\";\n\tprivate void handleFocusMetering(MotionEvent event, Camera camera) {\n\t\tint viewWidth = getWidth();\n\t\tint viewHeight = getHeight();\n\t\tRect focusRect = calculateTapArea(event.getX(), event.getY(), 1f, viewWidth, viewHeight);\n\t\tRect meteringRect = calculateTapArea(event.getX(), event.getY(), 1.5f, viewWidth, viewHeight);\n\n\t\tcamera.cancelAutoFocus();\n\t\tCamera.Parameters params = camera.getParameters();\n\t\tif (params.getMaxNumFocusAreas() > 0) {\n\t\t\tList focusAreas = new ArrayList<>();\n\t\t\tfocusAreas.add(new Camera.Area(focusRect, 800));\n\t\t\tparams.setFocusAreas(focusAreas);\n\t\t} else {\n\t\t\tLog.i(TAG, \"focus areas not supported\");\n\t\t}\n\t\tif (params.getMaxNumMeteringAreas() > 0) {\n\t\t\tList meteringAreas = new ArrayList<>();\n\t\t\tmeteringAreas.add(new Camera.Area(meteringRect, 800));\n\t\t\tparams.setMeteringAreas(meteringAreas);\n\t\t} else {\n\t\t\tLog.i(TAG, \"metering areas not supported\");\n\t\t}\n\t\tfinal String currentFocusMode = params.getFocusMode();\n\t\tparams.setFocusMode(Camera.Parameters.FOCUS_MODE_MACRO);\n\t\tcamera.setParameters(params);\n\n\t\tcamera.autoFocus(new Camera.AutoFocusCallback() {\n\t\t\t@Override\n\t\t\tpublic void onAutoFocus(boolean success, Camera camera) {\n\t\t\t\tCamera.Parameters params = camera.getParameters();\n\t\t\t\tparams.setFocusMode(currentFocusMode);\n\t\t\t\tcamera.setParameters(params);\n\t\t\t}\n\t\t});\n\t}\n\tprivate static Rect calculateTapArea(float x, float y, float coefficient, int width, int height) {\n\t\tfloat focusAreaSize = 300;\n\t\tint areaSize = Float.valueOf(focusAreaSize * coefficient).intValue();\n\t\tint centerX = (int) (x / width * 2000 - 1000);\n\t\tint centerY = (int) (y / height * 2000 - 1000);\n\n\t\tint halfAreaSize = areaSize / 2;\n\t\tRectF rectF = new RectF(clamp(centerX - halfAreaSize, -1000, 1000)\n\t\t\t\t, clamp(centerY - halfAreaSize, -1000, 1000)\n\t\t\t\t, clamp(centerX + halfAreaSize, -1000, 1000)\n\t\t\t\t, clamp(centerY + halfAreaSize, -1000, 1000));\n\t\treturn new Rect(Math.round(rectF.left), Math.round(rectF.top), Math.round(rectF.right), Math.round(rectF.bottom));\n\t}\n\n\tprivate static int clamp(int x, int min, int max) {\n\t\tif (x > max) {\n\t\t\treturn max;\n\t\t}\n\t\tif (x < min) {\n\t\t\treturn min;\n\t\t}\n\t\treturn x;\n\t}\n}\n"}}},{"rowIdx":324,"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:\nwhere('type','member')->select();\n $config=[];\n foreach ($name as $k => $v) {\n $config[$v['name']]['name']=$v['name'];\n $config[$v['name']]['title']=$v['title'];\n $config[$v['name']]['content']=$v['content'];\n $config[$v['name']]['text']=$v['text'];\n }\n $this->assign('cfg',$config);\n // 获取会员分组\n $member_groups=Db::name('member_groups')->order('jingyan asc,id asc')->cache(_cache('db'))->select();\n $member_groups2=Db::name('member_groups')->order('jingyan desc,id desc')->cache(_cache('db'))->select();\n $this->assign('member_groups',$member_groups);\n $this->assign('member_groups2',$member_groups2);\n if(request()->isAjax()){\n $post=input('post.');\n if(!$post['regmobile'] && !$post['regemail'] && !$post['reguser']){\n return ['err'=>'用户名、手机、邮箱,至少要开放一个'];\n }\n if($post){\n foreach ($name as $k => $v) {\n Db::name('member_config')->where('name',$v['name'])->setField('text',$post[$v['name']]);\n }\n $data=['ret'=>'保存成功'];\n }else{\n $data=['err'=>'提交参数错误'];\n }\n }else{\n $data=$this->fetch();\n }\n\n return $data;\n }\n //会员管理\n public function index(){\n $map=[];\n $search_name=input('param.name');\n $search_type=input('param.type');\n if($search_name && $search_type){\n $map[$search_type] = ['like','%'.$search_name.'%'];\n }else{\n $map='';\n }\n $map['hide']=['not in',0,1];\n $data=Db::name('member')->order('id desc,update_time desc')->where($map)->paginate('',false,['query'=>request()->param()]);\n $this->assig\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":"where('type','member')->select();\n $config=[];\n foreach ($name as $k => $v) {\n $config[$v['name']]['name']=$v['name'];\n $config[$v['name']]['title']=$v['title'];\n $config[$v['name']]['content']=$v['content'];\n $config[$v['name']]['text']=$v['text'];\n }\n $this->assign('cfg',$config);\n // 获取会员分组\n $member_groups=Db::name('member_groups')->order('jingyan asc,id asc')->cache(_cache('db'))->select();\n $member_groups2=Db::name('member_groups')->order('jingyan desc,id desc')->cache(_cache('db'))->select();\n $this->assign('member_groups',$member_groups);\n $this->assign('member_groups2',$member_groups2);\n if(request()->isAjax()){\n $post=input('post.');\n if(!$post['regmobile'] && !$post['regemail'] && !$post['reguser']){\n return ['err'=>'用户名、手机、邮箱,至少要开放一个'];\n }\n if($post){\n foreach ($name as $k => $v) {\n Db::name('member_config')->where('name',$v['name'])->setField('text',$post[$v['name']]);\n }\n $data=['ret'=>'保存成功'];\n }else{\n $data=['err'=>'提交参数错误'];\n }\n }else{\n $data=$this->fetch();\n }\n\n return $data;\n }\n //会员管理\n public function index(){\n $map=[];\n $search_name=input('param.name');\n $search_type=input('param.type');\n if($search_name && $search_type){\n $map[$search_type] = ['like','%'.$search_name.'%'];\n }else{\n $map='';\n }\n $map['hide']=['not in',0,1];\n $data=Db::name('member')->order('id desc,update_time desc')->where($map)->paginate('',false,['query'=>request()->param()]);\n $this->assign('data',$data);\n $page = $data->render();\n $this->assign('page', $page);\n return $this->fetch();\n }\n // 添加会员\n public function add(){\n $id=input('id');\n if(request()->isAjax()){\n \n $post=input('post.');\n if(!$post['user'] && !$post['email'] && !$post['mobile']){\n return ['err'=>'账户、手机、邮箱最少填写1个'];\n }\n $validate=validate('Member');\n if($validate->check($post)){\n if(!$id){ // 添加数据\n $post['password']=md5($post['password']);\n $post['update_time']=time(); //更新时间\n if($post['user']){\n $userdb=Db::name('member')->where('user',$post['user'])->find();\n if($userdb){\n return ['err'=>'账户已存在'];\n }\n }\n if(!$post['password']){\n return ['err'=>'请填写密码'];\n }\n $post['create_time']=time(); // 添加时间\n\n $db=Db::name('member')->insert($post);\n if($db){\n // $tongji=Db::name('typeid')->setInc('tongji');\n $data=['ret'=>'添加成功'];\n }else{\n $data=['err'=>'添加失败'];\n } \n }else{ //修改数据\n $member=Db::name('member')->where('id',$id)->value('password');\n if(!$post['password']){\n $post['password']=$member;\n }else{\n $post['password']=md5($post['password']);\n }\n $db=Db::name('member')->where('id',$id)->update($post);\n if($db){\n $data=['ret'=>'修改成功'];\n }else{\n $data=['err'=>'修改失败'];\n }\n }\n }else{\n $data=[\"err\"=>$validate->getError()];\n }\n }else{\n if($id){\n $name=Db::name('member')->where('id',$id)->find();\n if($name){\n $this->assign('name',$name);\n }else{\n $data=['err'=>'id参数错误'];\n }\n }\n $data=$this->fetch();\n }\n return $data;\n }\n // 会员分组\n public function groups(){\n $data=Db::name('member_groups')->order('id asc')->select();\n $this->assign('data',$data);\n return $this->fetch('groups');\n }\n //删除会员\n public function del(){\n if(request()->isAjax()){\n \n $id=input('id');\n if($id){\n $db=Db::name('member')->delete($id);\n if($db){\n $data=['ret'=>'删除成功'];\n }else{\n $data=['err'=>'删除失败'];\n } \n }else{\n $data=['err'=>'id参数错误'];\n }\n }else{\n $data=['err'=>'提交参数错误'];\n }\n return $data;\n }\n // 添加会员分组\n public function groupsAdd(){\n $id=input('id');\n if(request()->isAjax()){\n \n $post=input('post.');;\n if(!$id){ // 添加数据\n $titledb=Db::name('member_groups')->where('title',$post['title'])->find();\n if($titledb){\n return ['err'=>'分组名已存在'];\n }\n if($post['jingyan']=='' || $post['jingyan']==0){\n return ['err'=>'经验值必须填写'];\n }\n $db=Db::name('member_groups')->insert($post);\n if($db){\n $data=['ret'=>'添加成功'];\n }else{\n $data=['err'=>'添加失败'];\n } \n }else{ //修改数据\n $db=Db::name('member_groups')->where('id',$id)->update($post);\n if($db){\n $data=['ret'=>'修改成功'];\n }else{\n $data=['err'=>'修改失败'];\n }\n }\n }else{\n if($id){\n $name=Db::name('member_groups')->where('id',$id)->find();\n if($name){\n $this->assign('name',$name);\n }else{\n $data=['err'=>'id参数错误'];\n }\n }\n $data=$this->fetch();\n }\n return $data;\n }\n //删除会员分组\n public function groupsDel(){\n if(request()->isAjax()){\n \n $id=input('id');\n if($id){\n $db=Db::name('member_groups')->delete($id);\n if($db){\n $data=['ret'=>'删除成功'];\n }else{\n $data=['err'=>'删除失败'];\n } \n }else{\n $data=['err'=>'id参数错误'];\n }\n }else{\n $data=['err'=>'提交参数错误'];\n }\n return $data;\n } \n // 审核会员\n public function audit(){\n $data=Db::name('member')->order('id desc,update_time desc')->where(['hide'=>2])->whereOr('hide',3)->paginate('',false,['query'=>request()->param()]);\n $this->assign('data',$data);\n $page = $data->render();\n $this->assign('page', $page);\n return $this->fetch();\n }\n // 快速设置 拒绝 审核 禁止 通过\n public function hide(){\n if(request()->isAjax()){\n \n $id=input('id') ? input('id'): '0';\n $type=input('type') ? input('type') : '0';\n $text=['0'=>'禁止','1'=>'通过','2'=>'审核','3'=>'拒绝'];\n if($id){\n $db=Db::name('member')->where('id',$id)->setField('hide',$type);\n if($db){\n $data=[$text[$type]];\n }else{\n $data=['删除失败'];\n } \n }else{\n $data=['GET值错误'];\n }\n }else{\n $data=['提交错误'];\n }\n return $data;\n }\n // 用户中心导航分类\n public function category(){\n $data=Db::name('member_category')->order('des desc,id asc')->select();\n $data=get_tree_option($data,0);\n $this->assign('data',$data);\n return $this->fetch();\n }\n // 用户中心导航分类 - 添加和修改\n public function categoryAdd(){\n $id=input('id');\n $category=Db::name('member_category')->where('tid','0')->select();\n $this->assign('category',$category);\n if(request()->isAjax()){\n \n $post=input('post.');;\n if(!$id){ // 添加数据\n $titledb=Db::name('member_category')->where('title',$post['title'])->find();\n if($titledb){\n return ['err'=>'标题已存在'];\n }\n $db=Db::name('member_category')->insert($post);\n if($db){\n $data=['ret'=>'添加成功'];\n }else{\n $data=['err'=>'添加失败'];\n } \n }else{ //修改数据\n $db=Db::name('member_category')->where('id',$id)->update($post);\n if($db){\n $data=['ret'=>'修改成功'];\n }else{\n $data=['err'=>'修改失败'];\n }\n }\n }else{\n $typeid=input('typeid');\n $this->assign('typeid',$typeid);\n if($id){\n $name=Db::name('member_category')->where('id',$id)->find();\n if($name){\n $this->assign('name',$name);\n }else{\n $this->error('id参数错误');\n }\n }\n $data=$this->fetch();\n }\n return $data;\n }\n //删除会员分组\n public function categoryDel(){\n if(request()->isAjax()){\n \n $id=input('id');\n if($id){\n $db=Db::name('member_category')->delete($id);\n if($db){\n $data=['ret'=>'删除成功'];\n }else{\n $data=['err'=>'删除失败'];\n } \n }else{\n $data=['err'=>'id参数错误'];\n }\n }else{\n $data=['err'=>'提交参数错误'];\n }\n return $data;\n } \n // 用户记录\n public function records(){\n $money=input('money') ? input('money') : '';\n $type=input('type') ? input('type') : '';\n $data=input('data') ? input('data') : '';\n $where=[];\n if($type){\n if($type=='-1'){\n $where['money']=0;\n }else{\n $where['type']=$type;\n } \n }\n $db=Db::name('member_records')->order('id desc,time desc')->where($where)->paginate('',false,['query'=>request()->param()]);\n $data=$db->toarray()['data'];\n $type=['money'=>'元','score'=>'积分','jingyan'=>'经验值'];\n foreach ($data as $k => $v) {\n if($v['money']){\n $data[$k]['text']=$v['text'].' '.$v['data'].''.$v['money'].' '.$type[$v['type']];\n }\n }\n $this->assign('data',$data);\n $page = $db->render();\n $this->assign('page', $page);\n $this->assign('type', input('type'));\n return $this->fetch();\n }\n //删除记录 禁用\n public function recordsDel(){\n return false;\n if(request()->isAjax()){\n \n $id=input('id');\n if($id){\n $db=Db::name('member_records')->delete($id);\n if($db){\n $data=['ret'=>'删除成功'];\n }else{\n $data=['err'=>'删除失败'];\n } \n }else{\n $data=['err'=>'id参数错误'];\n }\n }else{\n $data=['err'=>'提交参数错误'];\n }\n return $data;\n } \n}\n"}}},{"rowIdx":325,"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:\nimport UIKit\n\nclass PostSearchView: UIView {\n private let userImageView = CircleImageView(frame: .zero)\n private let searchView = UISearchBar()\n \n override init(frame: CGRect) {\n super.init(frame: frame)\n \n setViews()\n }\n required init?(coder aDecoder: NSCoder) {\n fatalError(\"init(coder:) has not been implemented\")\n }\n \n weak var delegate: UISearchBarDelegate? {\n didSet {\n searchView.delegate = delegate\n }\n }\n \n func configure(searchedText: String?, user: User?) {\n searchView.text = searchedText\n if let photoUrl = user?.photoUrl {\n userImageView.load(url: photoUrl)\n }\n }\n \n private func setViews() {\n addSubview(userImageView)\n addSubview(searchView)\n \n userImageView.translatesAutoresizingMaskIntoConstraints = false\n searchView.translatesAutoresizingMaskIntoConstraints = false\n \n NSLayoutConstraint.activate([\n searchView.leftAnchor.constraint(equalTo: leftAnchor),\n searchView.topAnchor.constraint(equalTo: topAnchor)\n ])\n \n NSLayoutConstraint.activate([\n userImageView.leftAnchor.constraint(equalTo: searchView.rightAnchor, constant: 12),\n userImageView.rightAnchor.constraint(equalTo: rightAnchor, constant: 12),\n userImageView.widthAnchor.constraint(equalToConstant: 36),\n userImageView.heightAnchor.constraint(equalToConstant: 36)\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":"import UIKit\n\nclass PostSearchView: UIView {\n private let userImageView = CircleImageView(frame: .zero)\n private let searchView = UISearchBar()\n \n override init(frame: CGRect) {\n super.init(frame: frame)\n \n setViews()\n }\n required init?(coder aDecoder: NSCoder) {\n fatalError(\"init(coder:) has not been implemented\")\n }\n \n weak var delegate: UISearchBarDelegate? {\n didSet {\n searchView.delegate = delegate\n }\n }\n \n func configure(searchedText: String?, user: User?) {\n searchView.text = searchedText\n if let photoUrl = user?.photoUrl {\n userImageView.load(url: photoUrl)\n }\n }\n \n private func setViews() {\n addSubview(userImageView)\n addSubview(searchView)\n \n userImageView.translatesAutoresizingMaskIntoConstraints = false\n searchView.translatesAutoresizingMaskIntoConstraints = false\n \n NSLayoutConstraint.activate([\n searchView.leftAnchor.constraint(equalTo: leftAnchor),\n searchView.topAnchor.constraint(equalTo: topAnchor)\n ])\n \n NSLayoutConstraint.activate([\n userImageView.leftAnchor.constraint(equalTo: searchView.rightAnchor, constant: 12),\n userImageView.rightAnchor.constraint(equalTo: rightAnchor, constant: 12),\n userImageView.widthAnchor.constraint(equalToConstant: 36),\n userImageView.heightAnchor.constraint(equalToConstant: 36)\n ])\n }\n}\n"}}},{"rowIdx":326,"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* Copyright (c) 2016 Qualcomm Technologies, Inc.\n* All Rights Reserved.\n* Confidential and Proprietary - Qualcomm Technologies, Inc.\n**********************************************************************/\n\nvoid Run4PixelProc(unsigned char* m_pInputBuffer,\n unsigned short* m_pOutputBuffer, int m_iWidth, int m_iHeight,\n int wb_grgain, int wb_rgain, int wb_bgain, int wb_gbgain, int analog_gain,\n int pedestal, int byr_order,\n int* xtalk_gain_map, int mode, int *lib_status,\n int *port0, int *port1, int *port2, int *port3);\n\nenum e_remosaic_bayer_order{\n BAYER_GRBG = 0,\n BAYER_RGGB = 1,\n BAYER_BGGR = 2,\n BAYER_GBRG = 3,\n};\n\nstruct st_remosaic_param {\n int16_t wb_r_gain;\n int16_t wb_gr_gain;\n int16_t wb_gb_gain;\n int16_t wb_b_gain;\n int16_t analog_gain;\n};\n\nenum {\n RET_OK = 0,\n RET_NG = -1,\n};\n\nvoid remosaic_init(int32_t img_w, int32_t img_h,\n e_remosaic_bayer_order bayer_order, int32_t pedestal);\nint32_t remosaic_gainmap_gen(void* eep_buf_addr, size_t eep_buf_size);\nvoid remosaic_process_param_set(struct st_remosaic_param* p_param);\nint32_t remosaic_process(int32_t src_buf_fd, size_t src_buf_size,\n int32_t dst_buf_fd, size_t dst_buf_size);\nvoid remosaic_deinit();\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":"/**********************************************************************\n* Copyright (c) 2016 Qualcomm Technologies, Inc.\n* All Rights Reserved.\n* Confidential and Proprietary - Qualcomm Technologies, Inc.\n**********************************************************************/\n\nvoid Run4PixelProc(unsigned char* m_pInputBuffer,\n unsigned short* m_pOutputBuffer, int m_iWidth, int m_iHeight,\n int wb_grgain, int wb_rgain, int wb_bgain, int wb_gbgain, int analog_gain,\n int pedestal, int byr_order,\n int* xtalk_gain_map, int mode, int *lib_status,\n int *port0, int *port1, int *port2, int *port3);\n\nenum e_remosaic_bayer_order{\n BAYER_GRBG = 0,\n BAYER_RGGB = 1,\n BAYER_BGGR = 2,\n BAYER_GBRG = 3,\n};\n\nstruct st_remosaic_param {\n int16_t wb_r_gain;\n int16_t wb_gr_gain;\n int16_t wb_gb_gain;\n int16_t wb_b_gain;\n int16_t analog_gain;\n};\n\nenum {\n RET_OK = 0,\n RET_NG = -1,\n};\n\nvoid remosaic_init(int32_t img_w, int32_t img_h,\n e_remosaic_bayer_order bayer_order, int32_t pedestal);\nint32_t remosaic_gainmap_gen(void* eep_buf_addr, size_t eep_buf_size);\nvoid remosaic_process_param_set(struct st_remosaic_param* p_param);\nint32_t remosaic_process(int32_t src_buf_fd, size_t src_buf_size,\n int32_t dst_buf_fd, size_t dst_buf_size);\nvoid remosaic_deinit();\n"}}},{"rowIdx":327,"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\nusing namespace std;\n#define ll long long int\n\n\nint main()\n{\n\tll t;\n\tcin>>t;\n\twhile(t--)\n\t{\n\t\tll n;\n\t\tcin>>n;\n\t\tvector vec(n,0);\n\t\tvector::iterator upt;\n\t\tfor(ll i=0;i>vec[i];\n\t\t}\n\t\t\n\t\tsort(vec.begin(),vec.end());\n\t\tll c=0;\n \t\tfor(ll i=0;i\"\n"},"language":{"kind":"string","value":"cpp"},"label":{"kind":"number","value":3,"string":"3"},"text":{"kind":"string","value":"#include\nusing namespace std;\n#define ll long long int\n\n\nint main()\n{\n\tll t;\n\tcin>>t;\n\twhile(t--)\n\t{\n\t\tll n;\n\t\tcin>>n;\n\t\tvector vec(n,0);\n\t\tvector::iterator upt;\n\t\tfor(ll i=0;i>vec[i];\n\t\t}\n\t\t\n\t\tsort(vec.begin(),vec.end());\n\t\tll c=0;\n \t\tfor(ll i=0;i\"\n"},"language":{"kind":"string","value":"kotlin"},"label":{"kind":"number","value":2,"string":"2"},"text":{"kind":"string","value":"package dev.rajas.apps.modularpoc.ui.home\n\nimport androidx.appcompat.app.AppCompatActivity\nimport android.os.Bundle\nimport android.widget.Toast\nimport dev.rajas.apps.modularpoc.R\nimport dev.rajas.apps.utilities.valueOrDefault\n\nclass HomeActivity : AppCompatActivity() {\n\n private val phoneNumber :String?=null\n\n override fun onCreate(savedInstanceState: Bundle?) {\n super.onCreate(savedInstanceState)\n setContentView(R.layout.activity_home)\n\n Toast.makeText(this, phoneNumber.valueOrDefault(), Toast.LENGTH_SHORT).show()\n }\n}"}}},{"rowIdx":329,"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 - Develop21\n * @copyright © 2012\n * @license http://develop21.com/cms/license.txt\n *\n */\n\n// update needed! need to require category child categories\n\n$params = $menuitem->parameters;\n\n$param = explode(',', $params);\n\n$category = $param[0];\n$title_linkable = $param[1];\n$display_author = $param[2];\n$author_linkable = $param[3];\n$display_date = $param[4];\n\n$get_category = Category::find_by_id($category);\n\n$find_articles = Article::find_by_category($get_category->id);\n\n?>\n\n\nauthor); ?>\n
\n\t

id; ?>\" title=\"name; ?>\">name; ?>

\n\t
Created by username; ?>
\n\t
Created on date_created); ?>
\n\t
content; ?>
\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":" - Develop21\n * @copyright © 2012\n * @license http://develop21.com/cms/license.txt\n *\n */\n\n// update needed! need to require category child categories\n\n$params = $menuitem->parameters;\n\n$param = explode(',', $params);\n\n$category = $param[0];\n$title_linkable = $param[1];\n$display_author = $param[2];\n$author_linkable = $param[3];\n$display_date = $param[4];\n\n$get_category = Category::find_by_id($category);\n\n$find_articles = Article::find_by_category($get_category->id);\n\n?>\n\n\nauthor); ?>\n
\n\t

id; ?>\" title=\"name; ?>\">name; ?>

\n\t
Created by username; ?>
\n\t
Created on date_created); ?>
\n\t
content; ?>
\n
\n"}}},{"rowIdx":330,"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:\nCREATE PROCEDURE insertEmployee\r\n \r\n @ename NVARCHAR(Max), \r\n @eslary float\r\nAS \r\nBEGIN \r\n INSERT INTO dbo.Employee( Name ,Salary ) VALUES ( @ename, @esalary )\r\n 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":"sql"},"label":{"kind":"number","value":2,"string":"2"},"text":{"kind":"string","value":"CREATE PROCEDURE insertEmployee\r\n \r\n @ename NVARCHAR(Max), \r\n @eslary float\r\nAS \r\nBEGIN \r\n INSERT INTO dbo.Employee( Name ,Salary ) VALUES ( @ename, @esalary )\r\n End"}}},{"rowIdx":331,"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\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":"');"}}},{"rowIdx":332,"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.Threading.Tasks;\nusing Microsoft.AspNetCore.Builder;\nusing Microsoft.AspNetCore.Hosting;\nusing Microsoft.Extensions.Configuration;\nusing Microsoft.Extensions.DependencyInjection;\nusing Microsoft.Extensions.Logging;\nusing Microsoft.Extensions.Options;\nusing Checkout.Basket.API.Middleware;\nusing Checkout.Basket.Token.Contracts;\nusing Checkout.Basket.TokenService;\nusing Checkout.Data.Contracts;\nusing Checkout.Data.Stubs;\nusing Checkout.Data;\nusing Checkout.Basket.Business.Contracts;\nusing Checkout.Basket.Business;\nusing Checkout.Basket.Ringfence.Contracts;\nusing Checkout.Basket.RingfenceService;\nusing Checkout.Basket.API.Filters;\n\nnamespace Checkout.Basket.API\n{\n public class Startup\n {\n public Startup(IConfiguration configuration)\n {\n Configuration = configuration;\n }\n\n public IConfiguration Configuration { get; }\n\n // This method gets called by the runtime. Use this method to add services to the container.\n public void ConfigureServices(IServiceCollection services)\n {\n services.AddMvc();\n\n services.AddSingleton();\n services.AddScoped();\n services.AddScoped();\n services.AddScoped();\n services.AddScoped();\n services.AddScoped();\n services.AddScoped();\n services.AddScoped();\n services.AddScoped();\n services.AddScoped();\n\n services.AddScoped();\n\n }\n\n // This method gets called by the runtime. Use this method to configure the HTTP r\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":2,"string":"2"},"text":{"kind":"string","value":"using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing Microsoft.AspNetCore.Builder;\nusing Microsoft.AspNetCore.Hosting;\nusing Microsoft.Extensions.Configuration;\nusing Microsoft.Extensions.DependencyInjection;\nusing Microsoft.Extensions.Logging;\nusing Microsoft.Extensions.Options;\nusing Checkout.Basket.API.Middleware;\nusing Checkout.Basket.Token.Contracts;\nusing Checkout.Basket.TokenService;\nusing Checkout.Data.Contracts;\nusing Checkout.Data.Stubs;\nusing Checkout.Data;\nusing Checkout.Basket.Business.Contracts;\nusing Checkout.Basket.Business;\nusing Checkout.Basket.Ringfence.Contracts;\nusing Checkout.Basket.RingfenceService;\nusing Checkout.Basket.API.Filters;\n\nnamespace Checkout.Basket.API\n{\n public class Startup\n {\n public Startup(IConfiguration configuration)\n {\n Configuration = configuration;\n }\n\n public IConfiguration Configuration { get; }\n\n // This method gets called by the runtime. Use this method to add services to the container.\n public void ConfigureServices(IServiceCollection services)\n {\n services.AddMvc();\n\n services.AddSingleton();\n services.AddScoped();\n services.AddScoped();\n services.AddScoped();\n services.AddScoped();\n services.AddScoped();\n services.AddScoped();\n services.AddScoped();\n services.AddScoped();\n services.AddScoped();\n\n services.AddScoped();\n\n }\n\n // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.\n public void Configure(IApplicationBuilder app, IHostingEnvironment env)\n {\n if (env.IsDevelopment())\n {\n app.UseDeveloperExceptionPage();\n }\n\n app.UseMiddleware();\n app.UseMiddleware();\n app.UseMvc();\n \n\n\n }\n }\n}\n"}}},{"rowIdx":333,"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 com.controller;\n\nimport java.util.List;\n\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.DeleteMapping;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.PathVariable;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.PutMapping;\nimport org.springframework.web.bind.annotation.RequestBody;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\nimport com.entities.tableau;\nimport com.service.tableauService;\n\n@RestController\n@RequestMapping(\"/api\")\npublic class tableauController {\n@Autowired\ntableauService tableauService;\n\n@GetMapping(\"/tableaux\")\npublic List gettableaux() {\n\treturn tableauService.getTableaux();\n}\n\n@PostMapping(\"/tableaux\")\npublic void addtableau(@RequestBody tableau tableau) {\n\ttableauService.saveOrUpadateTableau(tableau);\n\t}\n\n@GetMapping(\"/tableaux/{id}\")\npublic tableau gettableau(@PathVariable int id) {\n\treturn tableauService.getTableau(id);\n}\n\n@PutMapping(\"/tableaux\")\npublic void updatetableau(@RequestBody tableau tableau){\n\ttableauService.saveOrUpadateTableau(tableau);\n}\n\n@DeleteMapping(\"/tableaux/{id}\")\npublic void deletetableau(@PathVariable int id) {\n\ttableauService.deleteTableau(id);\n\t}\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":"java"},"label":{"kind":"number","value":2,"string":"2"},"text":{"kind":"string","value":"package com.controller;\n\nimport java.util.List;\n\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.DeleteMapping;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.PathVariable;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.PutMapping;\nimport org.springframework.web.bind.annotation.RequestBody;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\nimport com.entities.tableau;\nimport com.service.tableauService;\n\n@RestController\n@RequestMapping(\"/api\")\npublic class tableauController {\n@Autowired\ntableauService tableauService;\n\n@GetMapping(\"/tableaux\")\npublic List gettableaux() {\n\treturn tableauService.getTableaux();\n}\n\n@PostMapping(\"/tableaux\")\npublic void addtableau(@RequestBody tableau tableau) {\n\ttableauService.saveOrUpadateTableau(tableau);\n\t}\n\n@GetMapping(\"/tableaux/{id}\")\npublic tableau gettableau(@PathVariable int id) {\n\treturn tableauService.getTableau(id);\n}\n\n@PutMapping(\"/tableaux\")\npublic void updatetableau(@RequestBody tableau tableau){\n\ttableauService.saveOrUpadateTableau(tableau);\n}\n\n@DeleteMapping(\"/tableaux/{id}\")\npublic void deletetableau(@PathVariable int id) {\n\ttableauService.deleteTableau(id);\n\t}\n\n\n\n\n}\n"}}},{"rowIdx":334,"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#define NULL ((void*)0)\ntypedef unsigned long size_t; // Customize by platform.\ntypedef long intptr_t; typedef unsigned long uintptr_t;\ntypedef long scalar_t__; // Either arithmetic or pointer type.\n/* By default, we understand bool (as a convenience). */\ntypedef int bool;\n#define false 0\n#define true 1\n\n/* Forward declarations */\n\n/* Type definitions */\ntypedef int u8 ;\nstruct rtc_time {int tm_sec; int tm_min; int tm_hour; int tm_mday; int tm_mon; int tm_year; int tm_wday; } ;\nstruct ds1307 {int* regs; int type; int (* write_block_data ) (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int,int*) ;int /*<<< orphan*/ offset; int /*<<< orphan*/ client; } ;\nstruct device {int dummy; } ;\n\n/* Variables and functions */\n size_t DS1307_REG_HOUR ; \n size_t DS1307_REG_MDAY ; \n size_t DS1307_REG_MIN ; \n size_t DS1307_REG_MONTH ; \n size_t DS1307_REG_SECS ; \n size_t DS1307_REG_WDAY ; \n size_t DS1307_REG_YEAR ; \n int DS1337_BIT_CENTURY ; \n int DS1340_BIT_CENTURY ; \n int DS1340_BIT_CENTURY_EN ; \n int bin2bcd (int) ; \n int /*<<< orphan*/ dev_dbg (struct device*,char*,char*,int,int,int,int,int,int,int) ; \n int /*<<< orphan*/ dev_err (struct device*,char*,char*,int) ; \n struct ds1307* dev_get_drvdata (struct device*) ; \n#define ds_1337 131 \n#define ds_1339 130 \n#define ds_1340 129 \n#define ds_3231 128 \n int stub1 (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int,int*) ; \n\n__attribute__((used)) static int ds1307_set_time(struct device *dev, struct rtc_time *t)\n{\n\tstruct ds1307\t*ds1307 = dev_get_drvdata(dev);\n\tint\t\tresult;\n\tint\t\ttmp;\n\tu8\t\t*buf = ds1307->regs;\n\n\tdev_dbg(dev, \"%s secs=%d, mins=%d, \"\n\t\t\"hours=%d, mday=%d, mon=%d, year=%d, wday=%d\\n\",\n\t\t\"write\", t->tm_sec, t->tm_min,\n\t\tt->tm_hour, t->tm_mday,\n\t\tt->tm_mon, t->tm_year, t->tm_wday);\n\n\tbuf[DS1307_REG_SECS] = bin2bcd(t->tm_sec);\n\tbuf[DS1307_REG_MIN] = bin2bcd(t->tm_min);\n\tbuf[DS1307_REG_HOUR] = bin2bcd(t->tm_hour);\n\tbuf[DS1307_REG_WDAY] = bin2bcd(t->tm_wday + 1);\n\tbuf[DS1307_REG_MDAY] = bin2bcd(t->tm_mday);\n\tbuf[DS1307_REG_MONTH\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":"#define NULL ((void*)0)\ntypedef unsigned long size_t; // Customize by platform.\ntypedef long intptr_t; typedef unsigned long uintptr_t;\ntypedef long scalar_t__; // Either arithmetic or pointer type.\n/* By default, we understand bool (as a convenience). */\ntypedef int bool;\n#define false 0\n#define true 1\n\n/* Forward declarations */\n\n/* Type definitions */\ntypedef int u8 ;\nstruct rtc_time {int tm_sec; int tm_min; int tm_hour; int tm_mday; int tm_mon; int tm_year; int tm_wday; } ;\nstruct ds1307 {int* regs; int type; int (* write_block_data ) (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int,int*) ;int /*<<< orphan*/ offset; int /*<<< orphan*/ client; } ;\nstruct device {int dummy; } ;\n\n/* Variables and functions */\n size_t DS1307_REG_HOUR ; \n size_t DS1307_REG_MDAY ; \n size_t DS1307_REG_MIN ; \n size_t DS1307_REG_MONTH ; \n size_t DS1307_REG_SECS ; \n size_t DS1307_REG_WDAY ; \n size_t DS1307_REG_YEAR ; \n int DS1337_BIT_CENTURY ; \n int DS1340_BIT_CENTURY ; \n int DS1340_BIT_CENTURY_EN ; \n int bin2bcd (int) ; \n int /*<<< orphan*/ dev_dbg (struct device*,char*,char*,int,int,int,int,int,int,int) ; \n int /*<<< orphan*/ dev_err (struct device*,char*,char*,int) ; \n struct ds1307* dev_get_drvdata (struct device*) ; \n#define ds_1337 131 \n#define ds_1339 130 \n#define ds_1340 129 \n#define ds_3231 128 \n int stub1 (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int,int*) ; \n\n__attribute__((used)) static int ds1307_set_time(struct device *dev, struct rtc_time *t)\n{\n\tstruct ds1307\t*ds1307 = dev_get_drvdata(dev);\n\tint\t\tresult;\n\tint\t\ttmp;\n\tu8\t\t*buf = ds1307->regs;\n\n\tdev_dbg(dev, \"%s secs=%d, mins=%d, \"\n\t\t\"hours=%d, mday=%d, mon=%d, year=%d, wday=%d\\n\",\n\t\t\"write\", t->tm_sec, t->tm_min,\n\t\tt->tm_hour, t->tm_mday,\n\t\tt->tm_mon, t->tm_year, t->tm_wday);\n\n\tbuf[DS1307_REG_SECS] = bin2bcd(t->tm_sec);\n\tbuf[DS1307_REG_MIN] = bin2bcd(t->tm_min);\n\tbuf[DS1307_REG_HOUR] = bin2bcd(t->tm_hour);\n\tbuf[DS1307_REG_WDAY] = bin2bcd(t->tm_wday + 1);\n\tbuf[DS1307_REG_MDAY] = bin2bcd(t->tm_mday);\n\tbuf[DS1307_REG_MONTH] = bin2bcd(t->tm_mon + 1);\n\n\t/* assume 20YY not 19YY */\n\ttmp = t->tm_year - 100;\n\tbuf[DS1307_REG_YEAR] = bin2bcd(tmp);\n\n\tswitch (ds1307->type) {\n\tcase ds_1337:\n\tcase ds_1339:\n\tcase ds_3231:\n\t\tbuf[DS1307_REG_MONTH] |= DS1337_BIT_CENTURY;\n\t\tbreak;\n\tcase ds_1340:\n\t\tbuf[DS1307_REG_HOUR] |= DS1340_BIT_CENTURY_EN\n\t\t\t\t| DS1340_BIT_CENTURY;\n\t\tbreak;\n\tdefault:\n\t\tbreak;\n\t}\n\n\tdev_dbg(dev, \"%s: %02x %02x %02x %02x %02x %02x %02x\\n\",\n\t\t\"write\", buf[0], buf[1], buf[2], buf[3],\n\t\tbuf[4], buf[5], buf[6]);\n\n\tresult = ds1307->write_block_data(ds1307->client,\n\t\tds1307->offset, 7, buf);\n\tif (result < 0) {\n\t\tdev_err(dev, \"%s error %d\\n\", \"write\", result);\n\t\treturn result;\n\t}\n\treturn 0;\n}"}}},{"rowIdx":335,"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 rs.raf.project1.djordje_veljkovic_rn4615.view.activity\n\nimport androidx.appcompat.app.AppCompatActivity\nimport android.os.Bundle\nimport kotlinx.android.synthetic.main.activity_tabs.*\nimport rs.raf.project1.R\nimport rs.raf.project1.djordje_veljkovic_rn4615.view.viewPager.TabPagerAdapter\n\nclass TabsActivity : AppCompatActivity(R.layout.activity_tabs) {\n\n\n override fun onCreate(savedInstanceState: Bundle?) {\n super.onCreate(savedInstanceState)\n\n init()\n\n }\n\n private fun init(){\n initTabs()\n\n }\n\n private fun initTabs() {\n tabActivityLayout.setupWithViewPager(viewPagerActivityListe)\n viewPagerActivityListe.adapter = TabPagerAdapter(supportFragmentManager)\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":"kotlin"},"label":{"kind":"number","value":2,"string":"2"},"text":{"kind":"string","value":"package rs.raf.project1.djordje_veljkovic_rn4615.view.activity\n\nimport androidx.appcompat.app.AppCompatActivity\nimport android.os.Bundle\nimport kotlinx.android.synthetic.main.activity_tabs.*\nimport rs.raf.project1.R\nimport rs.raf.project1.djordje_veljkovic_rn4615.view.viewPager.TabPagerAdapter\n\nclass TabsActivity : AppCompatActivity(R.layout.activity_tabs) {\n\n\n override fun onCreate(savedInstanceState: Bundle?) {\n super.onCreate(savedInstanceState)\n\n init()\n\n }\n\n private fun init(){\n initTabs()\n\n }\n\n private fun initTabs() {\n tabActivityLayout.setupWithViewPager(viewPagerActivityListe)\n viewPagerActivityListe.adapter = TabPagerAdapter(supportFragmentManager)\n }\n\n\n\n}\n"}}},{"rowIdx":336,"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.example.movingAssistant\n\nimport android.annotation.SuppressLint\nimport android.content.Intent\nimport android.content.pm.PackageManager\nimport android.media.AudioManager\nimport android.media.ToneGenerator\nimport android.os.Bundle\nimport android.util.Log\nimport android.widget.*\nimport androidx.appcompat.app.AppCompatActivity\nimport androidx.core.app.ActivityCompat\nimport androidx.core.content.ContextCompat\nimport com.budiyev.android.codescanner.*\n\nprivate const val CAMERA_REQUEST_CDDE = 101\n\nclass MainActivity2 : AppCompatActivity() {\n\n private lateinit var codeScanner: CodeScanner\n private lateinit var photoUri : String\n\n companion object{\n lateinit var codeNumber : String\n }\n\n override fun onCreate(savedInstanceState: Bundle?) {\n super.onCreate(savedInstanceState)\n setContentView(R.layout.activity_main2)\n\n setupPermission()\n codeScanner()\n\n val scannerView = findViewById(R.id.scanner_view)\n scannerView.setOnClickListener{\n codeScanner.startPreview()\n }\n\n val button2 = findViewById\n
\n
\n \n \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":"html"},"label":{"kind":"number","value":2,"string":"2"},"text":{"kind":"string","value":"\n\n\n\n \n \n \n \n \n \n Prova dos Campeões\n\n\n\n
\n

72

\n
\n

\n O Mestre de Provas permanece em silêncio por um momento e então diz lentamente: “Você\n não passou no teste. Vai se tornar agora meu servo para substituir o homem das cavernas na\n futura competição de cabo-de-guerra.” Você sabe que é impossível sobrepujar o poder mágico\n do Mestre de Provas e se resigna a uma vida de servidão. Contudo, talvez um dia você tenha\n sua vingança contra Lord Carnuss...\n

\n
\n\n
\n

Ações disponíveis

\n
\n \n
\n
\n
\n
\n
\n
\n
\n \n \n \n\n\n"}}},{"rowIdx":347,"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:\n// use jsx to render html, do not modify simple.html\n\nimport 'rc-editor-core/assets/index.less';\nimport { EditorCore, Toolbar, GetText, getHTML, toEditorState } from 'rc-editor-core';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport BasicStyle from 'rc-editor-plugin-basic-style';\nimport Emoji from 'rc-editor-plugin-emoji';\nimport 'rc-editor-plugin-emoji/assets/index.css';\n\nconst plugins = [BasicStyle, Emoji];\nconst toolbars = [['bold', 'italic', 'underline', 'strikethrough', '|', 'superscript', 'subscript', '|', 'emoji']];\n\nfunction editorChange(editorState) {\n console.log('>> editorExport:', GetText(editorState, { encode: true }));\n}\n\nclass Editor extends React.Component {\n state = {\n defaultValue: \"hello world\",\n };\n reset = () => {\n this.refs.editor.Reset();\n }\n render() {\n return (
\n \n editorChange(editorState)}\n onFocus={(ev) => console.log('focus', ev)}\n onBlur={(ev) => console.log('blur', ev)}\n />\n
);\n }\n}\n\nReactDOM.render(, document.getElementById('__react-content'));\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":4,"string":"4"},"text":{"kind":"string","value":"// use jsx to render html, do not modify simple.html\n\nimport 'rc-editor-core/assets/index.less';\nimport { EditorCore, Toolbar, GetText, getHTML, toEditorState } from 'rc-editor-core';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport BasicStyle from 'rc-editor-plugin-basic-style';\nimport Emoji from 'rc-editor-plugin-emoji';\nimport 'rc-editor-plugin-emoji/assets/index.css';\n\nconst plugins = [BasicStyle, Emoji];\nconst toolbars = [['bold', 'italic', 'underline', 'strikethrough', '|', 'superscript', 'subscript', '|', 'emoji']];\n\nfunction editorChange(editorState) {\n console.log('>> editorExport:', GetText(editorState, { encode: true }));\n}\n\nclass Editor extends React.Component {\n state = {\n defaultValue: \"hello world\",\n };\n reset = () => {\n this.refs.editor.Reset();\n }\n render() {\n return (
\n \n editorChange(editorState)}\n onFocus={(ev) => console.log('focus', ev)}\n onBlur={(ev) => console.log('blur', ev)}\n />\n
);\n }\n}\n\nReactDOM.render(, document.getElementById('__react-content'));\n"}}},{"rowIdx":348,"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:\nTitle: Vitória Guimarães vs. Olympique Lyon, 2013/12/12\nDate: 2013/12/12 00:00\nCategory: sports\nTags: football, football scores, Vitória Guimarães, Olympique Lyon\nSlug: vitoria-guimaraes-vs-olympique-lyon\nAuthor: carbonero\n\n\nVitória Guimarães 1 - 2 Olympique Lyon\n\n\n\n\n\n\n\n\n\n\n
minuteeventinfo
85'Moreno gets yellow.
85' gets yellow.
82'Paulo Oliveira gets yellow.
82' enters the game and replaces Tómané.
81' enters the game and replaces .
78' enters the game and replaces Crivellaro.
74' enters the game and replaces A. Pléa.
71' enters the game and replaces C. Malonga .
65' has scored a goal for Olympique Lyon!
64'\"\n"},"language":{"kind":"string","value":"markdown"},"label":{"kind":"number","value":3,"string":"3"},"text":{"kind":"string","value":"Title: Vitória Guimarães vs. Olympique Lyon, 2013/12/12\nDate: 2013/12/12 00:00\nCategory: sports\nTags: football, football scores, Vitória Guimarães, Olympique Lyon\nSlug: vitoria-guimaraes-vs-olympique-lyon\nAuthor: carbonero\n\n\nVitória Guimarães 1 - 2 Olympique Lyon\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
minuteeventinfo
85'Moreno gets yellow.
85' gets yellow.
82'Paulo Oliveira gets yellow.
82' enters the game and replaces Tómané.
81' enters the game and replaces .
78' enters the game and replaces Crivellaro.
74' enters the game and replaces A. Pléa.
71' enters the game and replaces C. Malonga .
65' has scored a goal for Olympique Lyon!
64' enters the game and replaces B. Gomis.
62' gets a second yellow card and is sent off.
62'Penalty goal scored by for Olympique Lyon!
57' gets yellow.
11'Tómané has scored a goal for Vitória Guimarães!
"}}},{"rowIdx":349,"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#include\n#include\n#include\n\n#define SMALLEST_INT64 (pow(2,63)-1)*(-1)\n\nlong int parseINT(char s[20])\n{\n\tint flag = 0, flag1 = 0;\n char c;\n int i,digit;\n long int number = 0;\n \n if(s[0]=='-')\n {\n \tflag = 1;\n }\n \n for(i=0;i='0' && c<='9') //to confirm it's a digit\n \t{\n \t\tdigit = c - '0';\n \t\tnumber = number*10 + digit;\n \t}\n }\n \n if(flag1==1) number = number*(-1);\n \n return number;\n}\n\ndouble parseDefult(char s[20])\n{\n\tint flag = 0, flag1 = 0 , pointFlag = 0 , k = 10;\n\tchar c;\n\tint i,digit;\n\tlong double number = 0;\n\tdouble pointNumber = 0.0 ;\n \n \tif(s[0]=='-')\n \t{\n \t\tflag = 1;\n \t}\n\n\telse if(s[0] >= 48 && s[0] <= 57){ // digit 0-9\n\t\tflag = 2 ;\n\t}\n\n\telse flag = 3 ;\n \n for(i=0;i='0' && c<='9' && pointFlag == 0) //to parse digits\n\t\t{\n\t\t\tdigit = c - '0';\n\t\t\tnumber = number*10 + digit;\n\t\t}\n\n\t\tif(s[i] == '.'){\n\n\t\t\tif(pointFlag==1) break ;\n\t\t\tpointFlag = 1 ;\n\t\t\ti++ ;\n\t\t\tc = s[i] ;\n\t\t}\n\n\t\tif(c>='0' && c<='9' && pointFlag == 1) //to confirm it's a digit\n\t\t\t{\n\t\t\t\tdigit = c - '0';\n\t\t\t\tpointNumber = pointNumber + digit*1.0/k;\n\t\t\t\tk = k * 10 ;\n\t\t\t}\n\n\t\tif( s[i+1] < 48 && s[i+1] > 57 && s[i+1]!=46){\n\t\t\tbreak ;\n\t\t}\n }\n\n\tif(pointFlag==1){\n\t\t//printf(\"%f\\n\",pointNumber);\n\t\tnumber = number + pointNumber ;\t\n\t}\n \n if(flag1==1) number = number*(-1);\n \n return number;\n}\n\nint type(char s[20]){\n\n\tint flag = -1 ;\n\tif(s[0]=='-')\n \t{\n \t\tflag = 1 ;\n \t}\n\n\tfor(int i=0 ; i 57 ){\n\t\t\treturn 0 ;\n\t\t}\n\t}\n\n\treturn 1 ;\n\n}\n\nint main(void)\n{\n\tchar iVal[20];\n \n\t\n\t\n\tscanf(\"%s\",iVal);\n\t\n\t//printf(\"%d\\n\",type(iV\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":"#include\n#include\n#include\n\n#define SMALLEST_INT64 (pow(2,63)-1)*(-1)\n\nlong int parseINT(char s[20])\n{\n\tint flag = 0, flag1 = 0;\n char c;\n int i,digit;\n long int number = 0;\n \n if(s[0]=='-')\n {\n \tflag = 1;\n }\n \n for(i=0;i='0' && c<='9') //to confirm it's a digit\n \t{\n \t\tdigit = c - '0';\n \t\tnumber = number*10 + digit;\n \t}\n }\n \n if(flag1==1) number = number*(-1);\n \n return number;\n}\n\ndouble parseDefult(char s[20])\n{\n\tint flag = 0, flag1 = 0 , pointFlag = 0 , k = 10;\n\tchar c;\n\tint i,digit;\n\tlong double number = 0;\n\tdouble pointNumber = 0.0 ;\n \n \tif(s[0]=='-')\n \t{\n \t\tflag = 1;\n \t}\n\n\telse if(s[0] >= 48 && s[0] <= 57){ // digit 0-9\n\t\tflag = 2 ;\n\t}\n\n\telse flag = 3 ;\n \n for(i=0;i='0' && c<='9' && pointFlag == 0) //to parse digits\n\t\t{\n\t\t\tdigit = c - '0';\n\t\t\tnumber = number*10 + digit;\n\t\t}\n\n\t\tif(s[i] == '.'){\n\n\t\t\tif(pointFlag==1) break ;\n\t\t\tpointFlag = 1 ;\n\t\t\ti++ ;\n\t\t\tc = s[i] ;\n\t\t}\n\n\t\tif(c>='0' && c<='9' && pointFlag == 1) //to confirm it's a digit\n\t\t\t{\n\t\t\t\tdigit = c - '0';\n\t\t\t\tpointNumber = pointNumber + digit*1.0/k;\n\t\t\t\tk = k * 10 ;\n\t\t\t}\n\n\t\tif( s[i+1] < 48 && s[i+1] > 57 && s[i+1]!=46){\n\t\t\tbreak ;\n\t\t}\n }\n\n\tif(pointFlag==1){\n\t\t//printf(\"%f\\n\",pointNumber);\n\t\tnumber = number + pointNumber ;\t\n\t}\n \n if(flag1==1) number = number*(-1);\n \n return number;\n}\n\nint type(char s[20]){\n\n\tint flag = -1 ;\n\tif(s[0]=='-')\n \t{\n \t\tflag = 1 ;\n \t}\n\n\tfor(int i=0 ; i 57 ){\n\t\t\treturn 0 ;\n\t\t}\n\t}\n\n\treturn 1 ;\n\n}\n\nint main(void)\n{\n\tchar iVal[20];\n \n\t\n\t\n\tscanf(\"%s\",iVal);\n\t\n\t//printf(\"%d\\n\",type(iVal));\n\n\t\n\tif(type(iVal) == 1){\n\t\tlong int x = parseINT(iVal);\n\t\t\n\t\tif(x<0)\n\t\t{\n\t\t\tx = x*(-1);\t\n\t\t\t//printf(\"%ld\\n\",x);\n\t\t}\n\t\t\n\t\tprintf(\"Output: %ld\\n\",x);\n\t}\n\n\telse if(type(iVal) == 0){\n\t\tdouble x = parseDefult(iVal);\n\t\t\n\t\tif(x<0)\n\t\t{\n\t\t\tx = x*(-1);\t\n\t\t\t\n\t\t\tif(x<=SMALLEST_INT64)\n\t\t\t{\n\t\t\t\tprintf(\"Error: Number overflow\\n\");\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\t\t\n\t\tprintf(\"Output: %f\\n\",x);\n\t}\n\n}\n"}}},{"rowIdx":350,"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' . $erc[$erc_user] . '';\n\t\t\t$style_color = ' style=\"color:#' . $theme['fontcolor3'] . '\"';\n\t\t\tbreak;\n\t\tcase MOD:\n\t\t\t$username_erc = '' . $erc[$erc_user] . '';\n\t\t\t$style_color = ' style=\"color:#' . $theme['fontcolor2'] . '\"';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$username_erc = '' . $erc[$erc_user] . '';\n\t\t\t$style_color = '';\n\t\t\tbreak;\n\t}\n\tif ( $erc[$erc_color] && $board_config['allow_totally_erc'] )\n\t{\n\t\t$username_er\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":"' . $erc[$erc_user] . '';\n\t\t\t$style_color = ' style=\"color:#' . $theme['fontcolor3'] . '\"';\n\t\t\tbreak;\n\t\tcase MOD:\n\t\t\t$username_erc = '' . $erc[$erc_user] . '';\n\t\t\t$style_color = ' style=\"color:#' . $theme['fontcolor2'] . '\"';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$username_erc = '' . $erc[$erc_user] . '';\n\t\t\t$style_color = '';\n\t\t\tbreak;\n\t}\n\tif ( $erc[$erc_color] && $board_config['allow_totally_erc'] )\n\t{\n\t\t$username_erc = '' . $erc[$erc_user] . '';\n\t\t$style_color = ' style=\"color:' . $id_color[$erc[$erc_color]] . '\"';\n\t}\n\telse if ( $user_group_color[$erc[$erc_id]] && $board_config['allow_totally_erc'] )\n\t{\n\t\t$username_erc = '' . $erc[$erc_user] . '';\n\t\t$style_color = ' style=\"color:' . $user_group_color[$erc[$erc_id]] . '\"';\n\t}\n\treturn array('username_erc' => $username_erc, 'style_color' => $style_color);\n}\n\n//--------------------------------------------------------------------------------------------------\n//\n// check_erc() : check color from erc and build the cache erc file\n//\n//--------------------------------------------------------------------------------------------------\nfunction check_erc()\n{\n\tglobal $phpbb_root_path, $phpEx, $db, $board_config, $lang;\n\tglobal $whosonline_color, $id_color, $user_group_color;\n\n\t$data = \"sql_query($ranks_sql)) )\n\t{\n\t\tmessage_die(GENERAL_MESSAGE, 'Fatal Error into getting extend rank color');\n\t}\n\twhile( $rank_row = $db->sql_fetchrow($ranks_result) )\n\t{\n\t\t$rank_name = ($rank_row['whosonline_lang_key'] && isset($lang[$rank_row['whosonline_rank_name']])) ? $lang[$rank_row['whosonline_rank_name']] : $rank_row['whosonline_rank_name'];\n\t\t$whosonline_color .= '[ ' . $rank_name . ' ]&nbsp;&nbsp;';\n\t\t$id_color[$rank_row['whosonline_rank_id']] = $rank_row['whosonline_rank_color'];\n\t\t$data .= '$id_color[' . $rank_row['whosonline_rank_id'] . '] = \\'' . $rank_row['whosonline_rank_color'] . \"';\\n\";\n\t}\n\n\t$data .= '$whosonline_color = \\'' . addslashes($whosonline_color) . \"';\\n\";\n\n\t$group_user_sql= \"SELECT ug.group_id, ug.user_id, g.group_color\n\t\tFROM \" . USER_GROUP_TABLE . \" ug, \" . GROUPS_TABLE . \" g, \" . WHOSONLINE_RANKS_TABLE . \" wr\n\t\tWHERE ug.group_id = g.group_id\n\t\t\tAND g.group_color <> '0' \n\t\t\tAND ug.user_pending <> '1'\n\t\t\tAND wr.whosonline_rank_id = g.group_color\n\t\tORDER BY wr.whosonline_rank_order DESC\";\n\tif ( !($group_user_result = $db->sql_query($group_user_sql)) )\n\t{\n\t\tmessage_die(GENERAL_MESSAGE, 'Fatal Error into getting user in group');\n\t}\n\twhile( $group_user_row = $db->sql_fetchrow($group_user_result) )\n\t{\n\t \t$user_group_color[$group_user_row['user_id']] = $id_color[$group_user_row['group_color']];\n\t \t$data .= '$user_group_color[' . $group_user_row['user_id'] . '] = \\'' . $id_color[ $group_user_row['group_color'] ] . \"';\\n\";\n\t}\n\n\t$data .= \"?>\";\n\n\tif ($board_config['cache_erc'])\n\t{\n\t\t// output to file\n\t\t$cache_file_erc = $phpbb_root_path . 'cache/def_erc.' . $phpEx;\n\t\t$fp = @fopen( $cache_file_erc, 'w' );\n\t\t@fwrite($fp, $data);\n\t\t@fclose($fp);\n\t\t@chmod($cache_file_erc, 0666);\t\n\t}\n\treturn;\n}\n\n//\n// Generate erc data\n//\nif ( $board_config['allow_totally_erc'] )\n{\n\tif ($board_config['cache_erc'])\n\t{\n\t\t$whosonline_color = '';\n\t\t@include( $phpbb_root_path . 'cache/def_erc.' . $phpEx );\n\t\tif ( empty($whosonline_color) )\n\t\t{\n\t\t\tcheck_erc();\n\t\t\tinclude( $phpbb_root_path . 'cache/def_erc.' . $phpEx );\n\t\t}\n\t\t@reset($whosonline_color);\n\t}\n\telse\n\t{\n\t\tcheck_erc();\n\t}\n}\n\n?>"}}},{"rowIdx":351,"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.Web;\nusing System.Web.UI;\nusing System.Web.UI.WebControls;\n\nnamespace WebApplication2\n{\n public partial class WebForm3 : System.Web.UI.Page\n {\n protected void Page_Load(object sender, EventArgs e)\n {\n\n }\n\n protected void Button1_Click(object sender, EventArgs e)\n {\n int a, b;\n a = int.Parse(TextBox1.Text);\n b = int.Parse(TextBox2.Text);\n if (a > b)\n Label1.Text = a + \" is the greater number\";\n else\n Label1.Text = b + \" is the greater number\";\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":3,"string":"3"},"text":{"kind":"string","value":"using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Web;\nusing System.Web.UI;\nusing System.Web.UI.WebControls;\n\nnamespace WebApplication2\n{\n public partial class WebForm3 : System.Web.UI.Page\n {\n protected void Page_Load(object sender, EventArgs e)\n {\n\n }\n\n protected void Button1_Click(object sender, EventArgs e)\n {\n int a, b;\n a = int.Parse(TextBox1.Text);\n b = int.Parse(TextBox2.Text);\n if (a > b)\n Label1.Text = a + \" is the greater number\";\n else\n Label1.Text = b + \" is the greater number\";\n }\n }\n}"}}},{"rowIdx":352,"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:\nCREATE INDEX threads_slug ON threads (slug);\nCREATE INDEX forums_slug ON forums (slug);\nCREATE INDEX users_nickname ON users (nickname);\nCREATE INDEX votes_thread ON votes (thread_id, nickname, voice);\nCREATE INDEX posts_thread_id ON posts (thread_id, id);\nCREATE INDEX posts_thread_id_children ON posts (thread_id, children);\nCREATE INDEX posts_thread_id_children_desc ON posts (thread_id, children DESC);\nCREATE INDEX threads_forum_created ON threads (forum, created);\nCREATE INDEX forumsusers_forum_slug_nickname ON forums_users (forum_slug, nickname);\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":"CREATE INDEX threads_slug ON threads (slug);\nCREATE INDEX forums_slug ON forums (slug);\nCREATE INDEX users_nickname ON users (nickname);\nCREATE INDEX votes_thread ON votes (thread_id, nickname, voice);\nCREATE INDEX posts_thread_id ON posts (thread_id, id);\nCREATE INDEX posts_thread_id_children ON posts (thread_id, children);\nCREATE INDEX posts_thread_id_children_desc ON posts (thread_id, children DESC);\nCREATE INDEX threads_forum_created ON threads (forum, created);\nCREATE INDEX forumsusers_forum_slug_nickname ON forums_users (forum_slug, nickname);\n"}}},{"rowIdx":353,"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/*\r\n Navicat SQLite Data Transfer\r\n\r\n Source Server : pruebas JR2\r\n Source Server Type : SQLite\r\n Source Server Version : 3021000\r\n Source Schema : main\r\n\r\n Target Server Type : SQLite\r\n Target Server Version : 3021000\r\n File Encoding : 65001\r\n\r\n Date: 12/03/2018 12:33:42\r\n*/\r\n\r\nPRAGMA foreign_keys = false;\r\n\r\n-- ----------------------------\r\n-- Table structure for aux\r\n-- ----------------------------\r\nDROP TABLE IF EXISTS \"aux\";\r\nCREATE TABLE \"aux\" (\r\n \"hora_inicial\" INTEGER,\r\n \"hora_final\" INTEGER\r\n);\r\n\r\n-- ----------------------------\r\n-- Table structure for horario\r\n-- ----------------------------\r\nDROP TABLE IF EXISTS \"horario\";\r\nCREATE TABLE \"horario\" (\r\n \"hora_inicial\" TEXT,\r\n \"hora_final\" TEXT\r\n);\r\n\r\n-- ----------------------------\r\n-- Table structure for mensaje\r\n-- ----------------------------\r\nDROP TABLE IF EXISTS \"mensaje\";\r\nCREATE TABLE \"mensaje\" (\r\n \"id\" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,\r\n \"fichero\" TEXT(255),\r\n \"existe\" TEXT(1),\r\n \"fecha_ini\" TEXT(10),\r\n \"fecha_fin\" TEXT(10),\r\n \"playtime\" TEXT(5)\r\n);\r\n\r\n-- ----------------------------\r\n-- Table structure for musica\r\n-- ----------------------------\r\nDROP TABLE IF EXISTS \"musica\";\r\nCREATE TABLE \"musica\" (\r\n \"carpeta\" TEXT(4096)\r\n);\r\n\r\n-- ----------------------------\r\n-- Table structure for publi\r\n-- ----------------------------\r\nDROP TABLE IF EXISTS \"publi\";\r\nCREATE TABLE \"publi\" (\r\n \"id\" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,\r\n \"fichero\" TEXT(255),\r\n \"existe\" TEXT(1),\r\n \"fecha_ini\" TEXT(10),\r\n \"fecha_fin\" TEXT(10),\r\n \"gap\" INTEGER\r\n);\r\n\r\n-- ----------------------------\r\n-- Table structure for sqlite_sequence\r\n-- ----------------------------\r\nDROP TABLE IF EXISTS \"sqlite_sequence\";\r\nCREATE TABLE \"sqlite_sequence\" (\r\n \"name\",\r\n \"seq\"\r\n);\r\n\r\n-- ----------------------------\r\n-- Records of sqlite_sequence\r\n-- ----------------------------\r\nINSERT INTO \"sqlite_sequence\" VALUES ('tienda', 0);\r\nINSERT INTO \"sqlite_sequence\" VALUES ('usuarios', 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":"sql"},"label":{"kind":"number","value":2,"string":"2"},"text":{"kind":"string","value":"/*\r\n Navicat SQLite Data Transfer\r\n\r\n Source Server : pruebas JR2\r\n Source Server Type : SQLite\r\n Source Server Version : 3021000\r\n Source Schema : main\r\n\r\n Target Server Type : SQLite\r\n Target Server Version : 3021000\r\n File Encoding : 65001\r\n\r\n Date: 12/03/2018 12:33:42\r\n*/\r\n\r\nPRAGMA foreign_keys = false;\r\n\r\n-- ----------------------------\r\n-- Table structure for aux\r\n-- ----------------------------\r\nDROP TABLE IF EXISTS \"aux\";\r\nCREATE TABLE \"aux\" (\r\n \"hora_inicial\" INTEGER,\r\n \"hora_final\" INTEGER\r\n);\r\n\r\n-- ----------------------------\r\n-- Table structure for horario\r\n-- ----------------------------\r\nDROP TABLE IF EXISTS \"horario\";\r\nCREATE TABLE \"horario\" (\r\n \"hora_inicial\" TEXT,\r\n \"hora_final\" TEXT\r\n);\r\n\r\n-- ----------------------------\r\n-- Table structure for mensaje\r\n-- ----------------------------\r\nDROP TABLE IF EXISTS \"mensaje\";\r\nCREATE TABLE \"mensaje\" (\r\n \"id\" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,\r\n \"fichero\" TEXT(255),\r\n \"existe\" TEXT(1),\r\n \"fecha_ini\" TEXT(10),\r\n \"fecha_fin\" TEXT(10),\r\n \"playtime\" TEXT(5)\r\n);\r\n\r\n-- ----------------------------\r\n-- Table structure for musica\r\n-- ----------------------------\r\nDROP TABLE IF EXISTS \"musica\";\r\nCREATE TABLE \"musica\" (\r\n \"carpeta\" TEXT(4096)\r\n);\r\n\r\n-- ----------------------------\r\n-- Table structure for publi\r\n-- ----------------------------\r\nDROP TABLE IF EXISTS \"publi\";\r\nCREATE TABLE \"publi\" (\r\n \"id\" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,\r\n \"fichero\" TEXT(255),\r\n \"existe\" TEXT(1),\r\n \"fecha_ini\" TEXT(10),\r\n \"fecha_fin\" TEXT(10),\r\n \"gap\" INTEGER\r\n);\r\n\r\n-- ----------------------------\r\n-- Table structure for sqlite_sequence\r\n-- ----------------------------\r\nDROP TABLE IF EXISTS \"sqlite_sequence\";\r\nCREATE TABLE \"sqlite_sequence\" (\r\n \"name\",\r\n \"seq\"\r\n);\r\n\r\n-- ----------------------------\r\n-- Records of sqlite_sequence\r\n-- ----------------------------\r\nINSERT INTO \"sqlite_sequence\" VALUES ('tienda', 0);\r\nINSERT INTO \"sqlite_sequence\" VALUES ('usuarios', 0);\r\nINSERT INTO \"sqlite_sequence\" VALUES ('publi', 0);\r\nINSERT INTO \"sqlite_sequence\" VALUES ('mensaje', 0);\r\n\r\n-- ----------------------------\r\n-- Table structure for st_prog_music\r\n-- ----------------------------\r\nDROP TABLE IF EXISTS \"st_prog_music\";\r\nCREATE TABLE \"st_prog_music\" (\r\n \"estado\" TEXT\r\n);\r\n\r\n-- ----------------------------\r\n-- Table structure for tienda\r\n-- ----------------------------\r\nDROP TABLE IF EXISTS \"tienda\";\r\nCREATE TABLE \"tienda\" (\r\n \"id\" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,\r\n \"dominio\" TEXT,\r\n \"last_connect\" INTEGER\r\n);\r\n\r\n-- ----------------------------\r\n-- Table structure for usuarios\r\n-- ----------------------------\r\nDROP TABLE IF EXISTS \"usuarios\";\r\nCREATE TABLE \"usuarios\" (\r\n \"id\" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,\r\n \"user\" TEXT(25),\r\n \"pass\" TEXT(25)\r\n);\r\n\r\n-- ----------------------------\r\n-- Auto increment value for mensaje\r\n-- ----------------------------\r\n\r\n-- ----------------------------\r\n-- Auto increment value for publi\r\n-- ----------------------------\r\n\r\n-- ----------------------------\r\n-- Auto increment value for tienda\r\n-- ----------------------------\r\n\r\n-- ----------------------------\r\n-- Auto increment value for usuarios\r\n-- ----------------------------\r\n\r\nPRAGMA foreign_keys = true;\r\n"}}},{"rowIdx":354,"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 gorush\n\nimport (\n\t\"github.com/appleboy/gorush/config\"\n\t\"github.com/appleboy/gorush/storage\"\n\n\t\"github.com/appleboy/go-fcm\"\n\t\"github.com/sideshow/apns2\"\n\t\"github.com/sirupsen/logrus\"\n)\n\nvar (\n\t// PushConf is gorush config\n\tPushConf config.ConfYaml\n\t// QueueNotification is chan type\n\tQueueNotification chan PushNotification\n\t// ApnsClient is apns client\n\tApnsClient *apns2.Client\n\t// FCMClient is apns client\n\tFCMClient *fcm.Client\n\t// LogAccess is log server request log\n\tLogAccess *logrus.Logger\n\t// LogError is log server error log\n\tLogError *logrus.Logger\n\t// StatStorage implements the storage interface\n\tStatStorage storage.Storage\n\t// MaxConcurrentIOSPushes pool to limit the number of concurrent iOS pushes\n\tMaxConcurrentIOSPushes chan struct{}\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":1,"string":"1"},"text":{"kind":"string","value":"package gorush\n\nimport (\n\t\"github.com/appleboy/gorush/config\"\n\t\"github.com/appleboy/gorush/storage\"\n\n\t\"github.com/appleboy/go-fcm\"\n\t\"github.com/sideshow/apns2\"\n\t\"github.com/sirupsen/logrus\"\n)\n\nvar (\n\t// PushConf is gorush config\n\tPushConf config.ConfYaml\n\t// QueueNotification is chan type\n\tQueueNotification chan PushNotification\n\t// ApnsClient is apns client\n\tApnsClient *apns2.Client\n\t// FCMClient is apns client\n\tFCMClient *fcm.Client\n\t// LogAccess is log server request log\n\tLogAccess *logrus.Logger\n\t// LogError is log server error log\n\tLogError *logrus.Logger\n\t// StatStorage implements the storage interface\n\tStatStorage storage.Storage\n\t// MaxConcurrentIOSPushes pool to limit the number of concurrent iOS pushes\n\tMaxConcurrentIOSPushes chan struct{}\n)\n"}}},{"rowIdx":355,"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// ListProductTableCell.swift\n// EnjoeiTest\n//\n// Created by on 20/05/16.\n// Copyright © 2016 . All rights reserved.\n//\n\nimport UIKit\n\nclass ListProductTableCell: BaseCell {\n\n @IBOutlet weak var collection: UICollectionView!\n var productHandler: ProductListHandler = ProductListHandler()\n \n override func populateCell(item: AnyObject){\n productHandler.collection = collection\n if let itensList = item as? [Product] {\n productHandler.listOfItens = itensList\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":1,"string":"1"},"text":{"kind":"string","value":"//\n// ListProductTableCell.swift\n// EnjoeiTest\n//\n// Created by on 20/05/16.\n// Copyright © 2016 . All rights reserved.\n//\n\nimport UIKit\n\nclass ListProductTableCell: BaseCell {\n\n @IBOutlet weak var collection: UICollectionView!\n var productHandler: ProductListHandler = ProductListHandler()\n \n override func populateCell(item: AnyObject){\n productHandler.collection = collection\n if let itensList = item as? [Product] {\n productHandler.listOfItens = itensList\n }\n }\n}\n"}}},{"rowIdx":356,"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#include\"calc.h\"\nint main(int argc,char ** argv)\n{\n\tint type;\n\tdouble op2;\n\tchar s[MAXOP];\n\twhile((type=getop(s))!=EOF)\n\t{\n\t\tswitch(type)\n\t\t{\n\t\t\tcase NUMBER:\n\t\t\t\tpush(atof(s));\n\t\t\t\tbreak;\n\t\t\tcase '+':\n\t\t\t\tpush(pop()+pop());\n\t\t\t\tbreak;\n\t\t\tcase '*':\n\t\t\t\tpush(pop()*pop());\n\t\t\t\tbreak;\n\t\t\tcase '-':\n\t\t\t\top2 = pop();\n\t\t\t\tpush(pop()-op2);\n\t\t\t\tbreak;\n\t\t\tcase '/':\n\t\t\t\top2 = pop();\n\t\t\t\tif(op2==0)\n\t\t\t\t{\n\t\t\t\tprintf(\"divide zero exception.\\n\");\n\t\t\t\texit(1);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tpush(pop()/op2);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase '%':\n\t\t\t\top2 = pop();\n\t\t\t\tpush((int)pop()%(int)op2);\n\t\t\t\tbreak;\n\t\t\tcase '\\n':\n\t\t\t\tprintf(\"\\t%.8g\\n\",pop());\n\t\t\t\tbreak;\n\t\t\tcase 's':push(sin(pop()));break;\n\t\t\tcase 'e':push(exp(pop()));break;\n\t\t\tcase 'p':\n\t\t\t\top2 = pop();\n\t\t\t\tpush(pow(pop(),op2));\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tprintf(\"error:unknown command %s\\n\",s);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\texit(0);\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":4,"string":"4"},"text":{"kind":"string","value":"#include\"calc.h\"\nint main(int argc,char ** argv)\n{\n\tint type;\n\tdouble op2;\n\tchar s[MAXOP];\n\twhile((type=getop(s))!=EOF)\n\t{\n\t\tswitch(type)\n\t\t{\n\t\t\tcase NUMBER:\n\t\t\t\tpush(atof(s));\n\t\t\t\tbreak;\n\t\t\tcase '+':\n\t\t\t\tpush(pop()+pop());\n\t\t\t\tbreak;\n\t\t\tcase '*':\n\t\t\t\tpush(pop()*pop());\n\t\t\t\tbreak;\n\t\t\tcase '-':\n\t\t\t\top2 = pop();\n\t\t\t\tpush(pop()-op2);\n\t\t\t\tbreak;\n\t\t\tcase '/':\n\t\t\t\top2 = pop();\n\t\t\t\tif(op2==0)\n\t\t\t\t{\n\t\t\t\tprintf(\"divide zero exception.\\n\");\n\t\t\t\texit(1);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tpush(pop()/op2);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase '%':\n\t\t\t\top2 = pop();\n\t\t\t\tpush((int)pop()%(int)op2);\n\t\t\t\tbreak;\n\t\t\tcase '\\n':\n\t\t\t\tprintf(\"\\t%.8g\\n\",pop());\n\t\t\t\tbreak;\n\t\t\tcase 's':push(sin(pop()));break;\n\t\t\tcase 'e':push(exp(pop()));break;\n\t\t\tcase 'p':\n\t\t\t\top2 = pop();\n\t\t\t\tpush(pow(pop(),op2));\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tprintf(\"error:unknown command %s\\n\",s);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\texit(0);\n}\n"}}},{"rowIdx":357,"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// Date+Formatter.swift\n// SeatGeekSearch\n//\n// Created by on 3/15/19.\n// Copyright © 2019 . All rights reserved.\n//\n\nimport Foundation\n\nextension String {\n func toDate() -> Date? {\n let dateFormatter = DateFormatter()\n dateFormatter.dateFormat = \"yyyy-MM-dd'T'HH:mm:ss\"\n return dateFormatter.date(from:self)\n }\n}\n\nextension Date {\n func prettyFormat() -> String {\n let dateFormatter = DateFormatter()\n dateFormatter.dateFormat = \"EE, MMM dd, yyyy hh:mm a\"\n return dateFormatter.string(from: self)\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// Date+Formatter.swift\n// SeatGeekSearch\n//\n// Created by on 3/15/19.\n// Copyright © 2019 . All rights reserved.\n//\n\nimport Foundation\n\nextension String {\n func toDate() -> Date? {\n let dateFormatter = DateFormatter()\n dateFormatter.dateFormat = \"yyyy-MM-dd'T'HH:mm:ss\"\n return dateFormatter.date(from:self)\n }\n}\n\nextension Date {\n func prettyFormat() -> String {\n let dateFormatter = DateFormatter()\n dateFormatter.dateFormat = \"EE, MMM dd, yyyy hh:mm a\"\n return dateFormatter.string(from: self)\n }\n}\n"}}},{"rowIdx":358,"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:\nimport styles from \"./Cover.module.scss\";\n\nconst Cover = ({ imageSrc }) => {\n return \"Book;\n};\n\nexport default Cover;\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":"import styles from \"./Cover.module.scss\";\n\nconst Cover = ({ imageSrc }) => {\n return \"Book;\n};\n\nexport default Cover;\n"}}},{"rowIdx":359,"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/* This program is a UDP version of tictactoe \t\t\t\t*/\n/* Two users, player 1 and player 2, pass the game back */\n/* and forth, on two computers \t */\n/**********************************************************/\n\n/*\n The client is always player 1\n The server is always player 2\n*/\n\n/* include files go here */\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n/* #define section, for now we will define the number of rows and columns */\n#define ROWS 3\n#define COLUMNS 3\n#define BUFFER_SIZE 1000\n#define DATAGRAM_SIZE 4\n#define CLIENT_NUMBER 2\n#define VERSION 3\n\n/* C language requires that you predefine all the routines you are writing */\nint checkwin(char board[ROWS][COLUMNS]);\nvoid print_board(char board[ROWS][COLUMNS]);\nint tictactoe(char board[ROWS][COLUMNS], int player_number, int sd, struct sockaddr_in to_server);\nint initSharedState(char board[ROWS][COLUMNS]);\nint client(char *ip_addr, char *port);\n\n\nint main(int argc, char *argv[])\n{\n\t/*check arguments*/\n\t/*If user input 3 arguments, call client function*/\n\tif(argc == 4)\n\t{\n\t\tif(atoi(argv[2]) == 2)\n\t\t{\n\t\t\tchar *ip_addr = argv[3];\n\t\t\tchar *port = argv[1];\n\t\t\tclient(ip_addr,port);\n\t\t} else \n\t\t{\n\t\t\tprintf(\"The player number for a client is 2.\\n\");\n\t\t}\n\t}else \n\t{\n\t\tprintf(\"Wrong number of arguments.\\n\");\n\t\tprintf(\"./tictactoeOriginal for a client.\\n\");\n\t}\t\t\n \n\treturn 0; \n}\n\n\nint client(char *ip_addr, char *port)\n{\n\tchar board[ROWS][COLUMNS];\n\n\tprintf(\"The server IP address: %s\\n\",ip_addr);\n\tprintf(\"The port number: %s\\n\",port);\n\n\tint sd = 0;\n\tstruct sockaddr_in to_server;\n\tstruct timeval timeout={15,0}; //Set timeout interval\n\n\t/* assigning values for sockaddr_in structure. */\n\tto_server.sin_family = AF_INE\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/* This program is a UDP version of tictactoe \t\t\t\t*/\n/* Two users, player 1 and player 2, pass the game back */\n/* and forth, on two computers \t */\n/**********************************************************/\n\n/*\n The client is always player 1\n The server is always player 2\n*/\n\n/* include files go here */\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n/* #define section, for now we will define the number of rows and columns */\n#define ROWS 3\n#define COLUMNS 3\n#define BUFFER_SIZE 1000\n#define DATAGRAM_SIZE 4\n#define CLIENT_NUMBER 2\n#define VERSION 3\n\n/* C language requires that you predefine all the routines you are writing */\nint checkwin(char board[ROWS][COLUMNS]);\nvoid print_board(char board[ROWS][COLUMNS]);\nint tictactoe(char board[ROWS][COLUMNS], int player_number, int sd, struct sockaddr_in to_server);\nint initSharedState(char board[ROWS][COLUMNS]);\nint client(char *ip_addr, char *port);\n\n\nint main(int argc, char *argv[])\n{\n\t/*check arguments*/\n\t/*If user input 3 arguments, call client function*/\n\tif(argc == 4)\n\t{\n\t\tif(atoi(argv[2]) == 2)\n\t\t{\n\t\t\tchar *ip_addr = argv[3];\n\t\t\tchar *port = argv[1];\n\t\t\tclient(ip_addr,port);\n\t\t} else \n\t\t{\n\t\t\tprintf(\"The player number for a client is 2.\\n\");\n\t\t}\n\t}else \n\t{\n\t\tprintf(\"Wrong number of arguments.\\n\");\n\t\tprintf(\"./tictactoeOriginal for a client.\\n\");\n\t}\t\t\n \n\treturn 0; \n}\n\n\nint client(char *ip_addr, char *port)\n{\n\tchar board[ROWS][COLUMNS];\n\n\tprintf(\"The server IP address: %s\\n\",ip_addr);\n\tprintf(\"The port number: %s\\n\",port);\n\n\tint sd = 0;\n\tstruct sockaddr_in to_server;\n\tstruct timeval timeout={15,0}; //Set timeout interval\n\n\t/* assigning values for sockaddr_in structure. */\n\tto_server.sin_family = AF_INET;\n\tto_server.sin_port = htons(atoi(port));\n\tto_server.sin_addr.s_addr = inet_addr(ip_addr);\n \n \tsd = socket(AF_INET,SOCK_DGRAM,0);\n\n\t/* socket error check. */\n\tif(sd < 0)\n\t{\n\t\tprintf(\"Failed to create a socket.\\n\");\n\t\texit(1);\n\t}\n\t/* Bind timeout with the socket*/\n\tsetsockopt(sd,SOL_SOCKET,SO_RCVTIMEO,&timeout,sizeof(struct timeval));\n\tprintf(\"Created a socket.\\n\");\n\n\tinitSharedState(board); // Initialize the 'game' board\n\ttictactoe(board, CLIENT_NUMBER, sd, to_server); // call the 'game' \t\n\tclose(sd);\n\n\treturn 0;\n}\n\n\nint tictactoe(char board[ROWS][COLUMNS], int player_number, int sd, struct sockaddr_in to_server)\n{\n\t/* Modify the original tictactoe game to a networking version */\n\n\tchar mark; // either an 'x' or an 'o'\n\tint player = 2; // keep track of whose turn it is\n\tint i; // used for keeping track of choice user makes\n\tint row, column, win_check;\n\n\t/* Define the three bytes for transfer protocal */\n\tuint8_t choice;\n\tuint8_t state_check;\n\tuint8_t modifier = 1;\n\tuint8_t *buffer;\n\tsocklen_t address_length = sizeof(to_server);\n\n\t/* loop, first print the board, then ask player 'n' to make a move */\n\n\tdo {\n\t\tchoice = 0;\n\t\tprint_board(board); // call function to print the board on the screen\n\t\tplayer = (player % 2) ? 1 : 2; // Mod math to figure out who the player is\n\n buffer = (uint8_t*) calloc(BUFFER_SIZE, sizeof(uint8_t));\n\n\t\tif(player== player_number)\n\t\t{\n\t\t\t/* print out player so you can pass game */\n\t\t\tprintf(\"Player %d, enter a number: \", player); \n\t\t\t/* using scanf to get the choice */\n\t\t\tscanf(\"%\"SCNu8, &choice);\n\t\t}else\n\t\t{\n\t\t\tint recv_length = 0;\n\t\t\t\n\t\t\t//handle UDP\n\t\t\tprintf(\"Waiting for the data.\\n\");\n\t\t\trecv_length = recvfrom(sd, buffer, DATAGRAM_SIZE, 0, (struct sockaddr*) &to_server, &address_length);\n\n\t\t\tprintf(\"Just received the data, size: %d.\\n\",recv_length);\n\t\t\tif(recv_length < 0 )\n\t\t\t{\n\t\t\t\tprintf(\"Faild to receive a data.\\n\");\n\t\t\t\tfree(buffer);\n\t\t\t\treturn 0;\n\t\t\t} \n\t\t\telse if (recv_length == 0) \n\t\t\t{\n\t\t\t\tprintf(\"Conenction Lost.\\n\");\n\t\t\t\tfree(buffer);\n\t\t\t\treturn 0;\n\t\t\t} \n\t\t\t/* Check the protocal version */\n\t\t\tif(buffer[0] != VERSION)\n\t\t\t{\n\t\t\t\tprintf(\"Wrong version message: %u.\\n\", buffer[0]);\n\t\t\t\tfree(buffer);\n\t\t\t\treturn 0;\n\t\t\t} \n\t\t\t/* Check the game state*/\n else if (buffer[2] == 2)\n\t\t\t{\n\t\t\t\tprintf(\"There was an error.\\n\");\n\t\t\t\tfree(buffer);\n\t\t\t\treturn 0;\n\n\t\t\t}\n\t\t\t/* Check if there was an error*/\t\n\t\t\telse if (buffer[2] != 0 && buffer[2] != 1) \n\t\t\t{\n\t\t\t\tprintf(\"Received an invalid message.\\n\");\n\t\t\t\tfree(buffer);\n\t\t\t\treturn 0;\n\t\t\t} \n\t\t\t/*Game complete check*/\n\t\t\telse if (buffer[2] == 1)\n\t\t\t{\n\t\t\t\twin_check = buffer[3];\n\t\t\t}\n\n\t\t\tmemcpy(&choice, &buffer[1], 1);\n\t\t}\n\n\t\tmark = (player == 1) ? 'X' : 'O'; //depending on who the player is, either us x or o\n\n\t\trow = (int)((choice-1) / ROWS); \n\t\tcolumn = (choice-1) % COLUMNS;\n\n\t\t/* first check to see if the row/column chosen is has a digit in it, if it */\n\t\t/* square 8 has and '8' then it is a valid choice */\n\n\t\tif (board[row][column] == (choice+'0'))\n\t\t{\n\t\t\tboard[row][column] = mark;\n\t\t\tif(player == player_number)\n\t\t\t{\n\t\t\t\tmemset(buffer, VERSION, 1); //Set version number\n\t\t\t\tmemset(buffer+1, choice, 1);\n\n\t\t\t\tif(checkwin(board) != -1)\n\t\t\t\t{\n \t\t\tstate_check = 1;\n\t\t\t\t\tif(checkwin(board) == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\t/* I win */\n\t\t\t\t\t\tmodifier = 2;\n\t\t\t\t\t} else \n\t\t\t\t\t{\n\t\t\t\t\t\t/* Draw */\n\t\t\t\t\t\tmodifier = 1;\n\t\t\t\t\t}\n\t\t\t\t} else \n\t\t\t\t{\n \tstate_check = 0;\n\t\t\t\t}\n\n\t\t\t\tmemset(buffer+2, state_check, 1);\n\t\t\t\tmemset(buffer+3, modifier, 1);\n\n\t\t\t\tprintf(\"The server IP address: %s\\n\", inet_ntoa(to_server.sin_addr));\n\t\t\t\tprintf(\"The port number: %u\\n\", ntohs(to_server.sin_port));\n\t\t\t\tprintf(\"Sending protocal: %u %u %u %u\\n\", buffer[0], buffer[1], buffer[2],buffer[3]);\n\n\t\t\t\tint check = sendto(sd, buffer, DATAGRAM_SIZE, 0,(struct sockaddr*)&to_server,sizeof(to_server));\n\t\t\t\tprintf(\"Sending size: %d\\n\",check);\n\t\t\t\t\n\t\t\t\tif(check < 4)\n\t\t\t\t{\n\t\t\t\t\tprintf(\"Failed to write.\\n\");\n\t\t\t\t\tfree(buffer);\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\n\t\t\t} else \n\t\t\t{\n\n\t\t\t\tmemset(buffer, VERSION, 1); //Set version number\n\t\t\t\tmemset(buffer+1, 0, 1);\n\n\t\t\t\t\n\t\t\t\tif(checkwin(board) != -1 && checkwin(board) != win_check)\n\t\t\t\t{\n\t\t\t\t\tstate_check = 2;\n\t\t\t\t\tprintf(\"ERROR: results from both users are not same.\\n\");\n\t\t\t\t}\n\n\t\t\t\tif(state_check == 2)\n\t\t\t\t{\n\n\t\t\t\t\tmemset(buffer+2, state_check, 1);\n\n\t\t\t\t\tint check = sendto(sd, buffer, DATAGRAM_SIZE, 0,(struct sockaddr*)&to_server,address_length);\n\t\t\t\t\tprintf(\"%d\",check);\n\t\t\t\t\tif(check < 3)\n\t\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t\tprintf(\"Failed to write.\\n\");\n\t\t\t\t\t\tfree(buffer);\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}else\n\t\t{\n\t\t\tprintf(\"Invalid move \");\n\t\t\tif(player == player_number)\n\t\t\t{\n\t\t\t\tplayer--;\n\t\t\t\tgetchar();\n\t\t\t} else \n\t\t\t{\n\t\t\t\tmemset(buffer, VERSION, 1); //Set version number\n \t\t\tstate_check = 2;\n\t\t\t\tmemset(buffer+2, state_check, 1);\n\t\t\t\t\n\t\t\t\tif(sendto(sd, buffer, DATAGRAM_SIZE, 0,(struct sockaddr*)&to_server,sizeof(to_server)) < 4)\n\t\t\t\t{\n\t\t\t\t\tprintf(\"Failed to write.\\n\");\n\t\t\t\t\tfree(buffer);\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\n\t\t\t\tfree(buffer);\n\t\t\t\treturn 0;\n\t\t\t}\n \t\t}\n\n\t\t/* after a move, check to see if someone won! (or if there is a draw */\n\t\ti = checkwin(board);\n\t\tplayer++;\n\n\t\tfree(buffer);\n\n\t}while (i == -1); // -1 means no one won\n \n\t/* print out the board again */\n \tprint_board(board);\n \n \tif (i == 1) // means a player won!! congratulate them\n\t\t{\n\t\t\t\t\tprintf(\"==>\\aPlayer %d wins\\n \", --player);\n\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\tprintf(\"==>\\aGame draw\"); // ran out of squares, it is a draw\n\t\t}\n\n \treturn 0;\n}\n\n\nint checkwin(char board[ROWS][COLUMNS])\n{\n /************************************************************************/\n /* brute force check to see if someone won, or if there is a draw */\n /* return a 0 if the game is 'over' and return -1 if game should go on */\n /************************************************************************/\n if (board[0][0] == board[0][1] && board[0][1] == board[0][2] ) // row matches\n return 1;\n \n else if (board[1][0] == board[1][1] && board[1][1] == board[1][2] ) // row matches\n return 1;\n \n else if (board[2][0] == board[2][1] && board[2][1] == board[2][2] ) // row matches\n return 1;\n \n else if (board[0][0] == board[1][0] && board[1][0] == board[2][0] ) // column\n return 1;\n \n else if (board[0][1] == board[1][1] && board[1][1] == board[2][1] ) // column\n return 1;\n \n else if (board[0][2] == board[1][2] && board[1][2] == board[2][2] ) // column\n return 1;\n \n else if (board[0][0] == board[1][1] && board[1][1] == board[2][2] ) // diagonal\n return 1;\n \n else if (board[2][0] == board[1][1] && board[1][1] == board[0][2] ) // diagonal\n return 1;\n \n else if (board[0][0] != '1' && board[0][1] != '2' && board[0][2] != '3' &&\n\t board[1][0] != '4' && board[1][1] != '5' && board[1][2] != '6' && \n\t board[2][0] != '7' && board[2][1] != '8' && board[2][2] != '9')\n\n return 0; // Return of 0 means game over\n else\n return - 1; // return of -1 means keep playing\n}\n\n\nvoid print_board(char board[ROWS][COLUMNS])\n{\n /*****************************************************************/\n /* brute force print out the board and all the squares/values */\n /*****************************************************************/\n\n printf(\"\\n\\n\\n\\tCurrent TicTacToe Game\\n\\n\");\n\n printf(\"Player 1 (X) - Player 2 (O)\\n\\n\\n\");\n\n\n printf(\" | | \\n\");\n printf(\" %c | %c | %c \\n\", board[0][0], board[0][1], board[0][2]);\n\n printf(\"_____|_____|_____\\n\");\n printf(\" | | \\n\");\n\n printf(\" %c | %c | %c \\n\", board[1][0], board[1][1], board[1][2]);\n\n printf(\"_____|_____|_____\\n\");\n printf(\" | | \\n\");\n\n printf(\" %c | %c | %c \\n\", board[2][0], board[2][1], board[2][2]);\n\n printf(\" | | \\n\\n\");\n}\n\n\nint initSharedState(char board[ROWS][COLUMNS])\n{ \n /* this just initializing the shared state aka the board */\n int i, j, count = 1;\n printf (\"in sharedstate area\\n\");\n for (i=0;i<3;i++)\n for (j=0;j<3;j++){\n board[i][j] = count + '0';\n count++;\n }\n return 0;\n}\n"}}},{"rowIdx":360,"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 { useEffect, useRef } from \"react\";\nimport { canUseDOM } from \"../helpers/functions\";\n\nexport const useEventListener: (e: any, handler: Function, eventOptions?: any, el?: Window & typeof globalThis) => void = (\n\te,\n\thandler,\n\teventOptions,\n\tel = window\n) => {\n\tconst savedHandler = useRef();\n\n\tuseEffect(() => {\n\t\tsavedHandler.current = handler;\n\t}, [handler]);\n\n\tuseEffect(() => {\n\t\tif (!canUseDOM) return;\n\n\t\tif (el) {\n\t\t\tconst eventListener: (event: any) => any = (event) => savedHandler.current(event);\n\n\t\t\tel.addEventListener(e, eventListener, eventOptions);\n\n\t\t\treturn () => {\n\t\t\t\tel.removeEventListener(e, eventListener, eventOptions);\n\t\t\t};\n\t\t}\n\t}, [e, el]);\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":3,"string":"3"},"text":{"kind":"string","value":"import { useEffect, useRef } from \"react\";\nimport { canUseDOM } from \"../helpers/functions\";\n\nexport const useEventListener: (e: any, handler: Function, eventOptions?: any, el?: Window & typeof globalThis) => void = (\n\te,\n\thandler,\n\teventOptions,\n\tel = window\n) => {\n\tconst savedHandler = useRef();\n\n\tuseEffect(() => {\n\t\tsavedHandler.current = handler;\n\t}, [handler]);\n\n\tuseEffect(() => {\n\t\tif (!canUseDOM) return;\n\n\t\tif (el) {\n\t\t\tconst eventListener: (event: any) => any = (event) => savedHandler.current(event);\n\n\t\t\tel.addEventListener(e, eventListener, eventOptions);\n\n\t\t\treturn () => {\n\t\t\t\tel.removeEventListener(e, eventListener, eventOptions);\n\t\t\t};\n\t\t}\n\t}, [e, el]);\n};\n"}}},{"rowIdx":361,"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\r\n\r\n\r\n\r\n \r\n \">\r\n \r\n \" crossorigin=\"anonymous\">\r\n\t \r\n\t\r\n Konum Listesi\r\n \r\n \r\n\t\r\n\r\n \r\n \r\n
\r\n\t
\r\n\t
\r\n\t\t \r\n\t\t